diff --git a/src/form/input.wc b/src/form/input.wc index f964da4..dc7c302 100644 --- a/src/form/input.wc +++ b/src/form/input.wc @@ -343,8 +343,8 @@ export default class Input { props = { value: '', placeholder: '', - maxlength: null, - minlength: null, + maxlength: 0, + minlength: 0, clearable: false, autofocus: false, readonly: false, @@ -608,7 +608,7 @@ export default class Input { break case 'value': - this.value = val + this.value = val || '' break case 'maxlength': diff --git a/src/form/link.wc b/src/form/link.wc index e36ec97..b8e0b5e 100644 --- a/src/form/link.wc +++ b/src/form/link.wc @@ -170,19 +170,19 @@ } // ------- -:host([type='default']) { +:host([type='help']) { color: var(--color-grey-2); &::after { border-color: var(--color-grey-1); } } -:host([type='default']:not([disabled]):hover) { +:host([type='help']:not([disabled]):hover) { color: var(--color-grey-1); } -:host([type='default']:not([disabled]):active) { +:host([type='help']:not([disabled]):active) { color: var(--color-grey-3); } -:host([type='default']:not([disabled]):focus-within) { +:host([type='help']:not([disabled]):focus-within) { box-shadow: 0 0 0 2px var(--color-grey-a); } diff --git a/src/form/number.wc b/src/form/number.wc index 11af83c..fda9d78 100644 --- a/src/form/number.wc +++ b/src/form/number.wc @@ -424,7 +424,7 @@ export default class Number { if (k === 'readonly') { k = 'readOnly' } - this[k] = true + this[k] = val !== null break } } diff --git a/src/form/select.wc b/src/form/select.wc index d4af4a4..bafec4a 100644 --- a/src/form/select.wc +++ b/src/form/select.wc @@ -494,7 +494,7 @@ export default class Select { if (k === 'readonly') { k = 'readOnly' } - this[k] = true + this[k] = val !== null break } } diff --git a/src/form/switch.wc b/src/form/switch.wc index 9356093..dc5e9ac 100644 --- a/src/form/switch.wc +++ b/src/form/switch.wc @@ -189,8 +189,9 @@ export default class Switch { switch (name) { case 'checked': case 'disabled': - this[name] = true + this[name] = val !== null break + case 'active-text': case 'inactive-text': console.log('------------->>>') diff --git a/src/form/textarea.wc b/src/form/textarea.wc index bc95167..0004098 100644 --- a/src/form/textarea.wc +++ b/src/form/textarea.wc @@ -1,7 +1,7 @@ @@ -139,8 +139,8 @@ export default class Textarea { props = { value: '', placeholder: '', - maxlength: null, - minlength: null, + maxlength: 0, + minlength: 0, autofocus: false, readonly: false, disabled: false, @@ -268,17 +268,19 @@ export default class Textarea { break case 'value': - this.value = val + this.value = val || '' break case 'maxlength': case 'minlength': if (val === null) { this.__INPUT__.removeAttribute(name) + this.props[name] = 0 } else { let n = +val if (n > 0) { - this.__INPUT__.setAttribute(name, +val) + this.__INPUT__.setAttribute(name, n) + this.props[name] = n } } break @@ -293,7 +295,7 @@ export default class Textarea { if (k === 'readonly') { k = 'readOnly' } - this[k] = true + this[k] = val !== null break } }