@haiilo/catalyst 0.14.0 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.cdn.js +37 -15
- package/dist/catalyst/{p-5f9b3485.entry.js → p-45547af1.entry.js} +3 -3
- package/dist/catalyst/p-45547af1.entry.js.map +1 -0
- package/dist/cjs/cat-alert_22.cjs.entry.js +11 -5
- package/dist/cjs/cat-alert_22.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +9 -6
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.js +9 -9
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +9 -6
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/index.cdn.js +37 -15
- package/dist/components/cat-checkbox.js +7 -4
- package/dist/components/cat-checkbox.js.map +1 -1
- package/dist/components/cat-input.js +3 -3
- package/dist/components/cat-input.js.map +1 -1
- package/dist/components/cat-toggle.js +7 -4
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/esm/cat-alert_22.entry.js +11 -5
- package/dist/esm/cat-alert_22.entry.js.map +1 -1
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +1 -1
- package/dist/types/components/cat-input/cat-input.d.ts +4 -4
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +1 -1
- package/dist/types/components.d.ts +12 -12
- package/package.json +2 -2
- package/dist/catalyst/p-5f9b3485.entry.js.map +0 -1
|
@@ -548,14 +548,17 @@ const CatCheckbox = class {
|
|
|
548
548
|
this.input.focus(options);
|
|
549
549
|
}
|
|
550
550
|
render() {
|
|
551
|
-
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), index.h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, index.h("svg", { class: "check", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), index.h("svg", { class: "dash", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 5 10.5 5" }))), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hintSection));
|
|
551
|
+
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), index.h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, index.h("svg", { class: "check", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), index.h("svg", { class: "dash", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 5 10.5 5" }))), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hintSection));
|
|
552
552
|
}
|
|
553
553
|
get hintSection() {
|
|
554
554
|
const hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
555
555
|
return ((this.hint || hasSlottedHint) && (index.h(CatFormHint, { hint: this.hint, slottedHint: hasSlottedHint && index.h("slot", { name: "hint" }) })));
|
|
556
556
|
}
|
|
557
557
|
onInput(event) {
|
|
558
|
-
this.
|
|
558
|
+
this.checked = this.input.checked;
|
|
559
|
+
if (!this.value || typeof this.value === 'boolean') {
|
|
560
|
+
this.value = this.checked;
|
|
561
|
+
}
|
|
559
562
|
this.catChange.emit(event);
|
|
560
563
|
}
|
|
561
564
|
onFocus(event) {
|
|
@@ -673,7 +676,7 @@ const CatInput = class {
|
|
|
673
676
|
'input-disabled': this.disabled
|
|
674
677
|
}, onClick: () => this.input.focus() }, this.textPrefix && (index.h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && index.h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l" }), index.h("div", { class: "input-inner-wrapper" }, index.h("input", { ref: el => (this.input = el), id: this.id, class: {
|
|
675
678
|
'has-clearable': this.clearable && !this.disabled
|
|
676
|
-
}, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.
|
|
679
|
+
}, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), this.clearable && !this.disabled && this.value && (index.h("cat-button", { class: "clearable", icon: "cross-circle-outlined", "icon-only": "true", size: "s", variant: "text", "a11y-label": this.i18n.t('input.clear'), onClick: this.clear.bind(this) }))), this.icon && this.iconRight && index.h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l" }), this.textSuffix && (index.h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), this.hintSection));
|
|
677
680
|
}
|
|
678
681
|
get hintSection() {
|
|
679
682
|
const hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
@@ -12776,14 +12779,17 @@ const CatToggle = class {
|
|
|
12776
12779
|
this.input.focus(options);
|
|
12777
12780
|
}
|
|
12778
12781
|
render() {
|
|
12779
|
-
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), index.h("span", { class: "toggle", part: "toggle" }), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hintSection));
|
|
12782
|
+
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), index.h("span", { class: "toggle", part: "toggle" }), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hintSection));
|
|
12780
12783
|
}
|
|
12781
12784
|
get hintSection() {
|
|
12782
12785
|
const hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
12783
12786
|
return ((this.hint || hasSlottedHint) && (index.h(CatFormHint, { hint: this.hint, slottedHint: hasSlottedHint && index.h("slot", { name: "hint" }) })));
|
|
12784
12787
|
}
|
|
12785
12788
|
onInput(event) {
|
|
12786
|
-
this.
|
|
12789
|
+
this.checked = this.input.checked;
|
|
12790
|
+
if (!this.value || typeof this.value === 'boolean') {
|
|
12791
|
+
this.value = this.checked;
|
|
12792
|
+
}
|
|
12787
12793
|
this.catChange.emit(event);
|
|
12788
12794
|
}
|
|
12789
12795
|
onFocus(event) {
|