|
|
@ -45,6 +45,8 @@ |
|
|
export let cols = 40 |
|
|
export let cols = 40 |
|
|
export let validation = false |
|
|
export let validation = false |
|
|
export let persistent = false |
|
|
export let persistent = false |
|
|
|
|
|
export let value |
|
|
|
|
|
export let _bb |
|
|
|
|
|
|
|
|
let id = `${label}-${variant}` |
|
|
let id = `${label}-${variant}` |
|
|
|
|
|
|
|
|
@ -87,6 +89,13 @@ |
|
|
function focus(event) { |
|
|
function focus(event) { |
|
|
tfInstance.focus() |
|
|
tfInstance.focus() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function changed(e) { |
|
|
|
|
|
if (_bb.isBound(_bb.props.value)) { |
|
|
|
|
|
_bb.setStateFromBinding(_bb.props.value, e.target.value) |
|
|
|
|
|
} |
|
|
|
|
|
_bb.call(onChange, e.target.value) |
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<!-- |
|
|
<!-- |
|
|
@ -108,7 +117,8 @@ TODO:Needs error handling - this will depend on how Budibase handles errors |
|
|
{placeholder} |
|
|
{placeholder} |
|
|
{minLength} |
|
|
{minLength} |
|
|
{maxLength} |
|
|
{maxLength} |
|
|
on:change={e => onChange(e.target.value)} /> |
|
|
value={value} |
|
|
|
|
|
on:change={changed} /> |
|
|
{:else} |
|
|
{:else} |
|
|
{#if renderLeadingIcon} |
|
|
{#if renderLeadingIcon} |
|
|
<Icon {icon} /> |
|
|
<Icon {icon} /> |
|
|
@ -122,9 +132,10 @@ TODO:Needs error handling - this will depend on how Budibase handles errors |
|
|
placeholder={!!label && fullwidth ? label : placeholder} |
|
|
placeholder={!!label && fullwidth ? label : placeholder} |
|
|
{minLength} |
|
|
{minLength} |
|
|
{maxLength} |
|
|
{maxLength} |
|
|
|
|
|
value={value} |
|
|
aria-label={`Textfield ${variant}`} |
|
|
aria-label={`Textfield ${variant}`} |
|
|
on:focus={focus} |
|
|
on:focus={focus} |
|
|
on:change={e => onChange(e.target.value)} /> |
|
|
on:change={changed} /> |
|
|
{#if renderTrailingIcon} |
|
|
{#if renderTrailingIcon} |
|
|
<Icon {icon} /> |
|
|
<Icon {icon} /> |
|
|
{/if} |
|
|
{/if} |
|
|
|