budibase/packages/standard-components/src/Input.svelte

42 lines
597 B
Svelte
Raw Normal View History

<script>
export let value="";
export let className = "default";
export let type = "text";
export let _bb;
let actualValue = "";
const onchange = (ev) => {
if(_bb) {
2019-10-19 08:24:20 +02:00
_bb.setStateFromBinding(_bb.props.value, ev.target.value);
}
}
</script>
<input class={className}
type={type}
value={value}
on:change={onchange}/>
<style>
.default {
width: 100%;
font-family: inherit;
font-size: inherit;
padding: 0.4em;
margin: 0 0 0.5em 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 2px;
width: 100%;
}
.default:disabled {
color: #ccc;
}
</style>