@haiilo/catalyst 10.28.2 → 10.29.0
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/{p-ee89e395.entry.js → p-bb8516c7.entry.js} +2 -2
- package/dist/catalyst/p-bb8516c7.entry.js.map +1 -0
- package/dist/cjs/cat-alert_30.cjs.entry.js +11 -7
- package/dist/cjs/cat-alert_30.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-input/cat-input.js +8 -4
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +7 -3
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/components/cat-input2.js +7 -4
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-textarea.js +6 -3
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/esm/cat-alert_30.entry.js +11 -7
- package/dist/esm/cat-alert_30.entry.js.map +1 -1
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cat-input/cat-input.d.ts +2 -0
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +2 -0
- package/package.json +2 -2
- package/dist/catalyst/p-ee89e395.entry.js.map +0 -1
|
@@ -1578,6 +1578,7 @@ const CatInput = /*@__PURE__*/ proxyCustomElement(class CatInput extends HTMLEle
|
|
|
1578
1578
|
this._id = `cat-input-${nextUniqueId++}`;
|
|
1579
1579
|
this.hasSlottedLabel = false;
|
|
1580
1580
|
this.hasSlottedHint = false;
|
|
1581
|
+
this.hasSlottedCounter = false;
|
|
1581
1582
|
this.isPasswordShown = false;
|
|
1582
1583
|
this.errorMap = undefined;
|
|
1583
1584
|
this.requiredMarker = 'optional';
|
|
@@ -1619,6 +1620,7 @@ const CatInput = /*@__PURE__*/ proxyCustomElement(class CatInput extends HTMLEle
|
|
|
1619
1620
|
componentWillRender() {
|
|
1620
1621
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
1621
1622
|
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
1623
|
+
this.hasSlottedCounter = !!this.hostElement.querySelector('[slot="counter"]');
|
|
1622
1624
|
}
|
|
1623
1625
|
/**
|
|
1624
1626
|
* Programmatically move focus to the input. Use this method instead of
|
|
@@ -1671,19 +1673,19 @@ const CatInput = /*@__PURE__*/ proxyCustomElement(class CatInput extends HTMLEle
|
|
|
1671
1673
|
}
|
|
1672
1674
|
render() {
|
|
1673
1675
|
this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
|
|
1674
|
-
return (h("div", { key: '
|
|
1676
|
+
return (h("div", { key: '3d28dff29d5ced59f609ce9fcf6c2b2a14cfdda7', class: {
|
|
1675
1677
|
'input-field': true,
|
|
1676
1678
|
'input-horizontal': this.horizontal
|
|
1677
|
-
} }, h("div", { key: '
|
|
1679
|
+
} }, h("div", { key: '41399390b76c6a2e96dc3df48eede8ea2bcc4698', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '68bb767790072eb2728d680d448e1ee80e641013', htmlFor: this.id, part: "label" }, h("span", { key: '04c217ff1f227a1fb82b9a52b284bbd67f8d89dd', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '0c462827456af3b83935e569fac4fb45459c2edc', name: "label" })) || this.label, h("div", { key: '9415db27af950dc50efac0c60bdc47aa5efc8c97', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: 'fc45ea569ef7c9eec048bae75a8b5127beafcc09', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: '20f36a7a3e2c042fa4f802ea3f71cb20f60188b3', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), (this.maxLength || this.hasSlottedCounter) && (h("div", { key: '58338cb0be0db04c6030e9f295428079ba2c7316', class: "label-character-count", "aria-hidden": "true" }, this.hasSlottedCounter ? (h("slot", { name: "counter" })) : (`${this.value?.length ?? 0}/${this.maxLength}`)))))))), h("div", { key: '5ed2b9c0c812c65d2e7d77d02f61cb88f33567e1', class: "input-container" }, h("div", { key: '9b73f259436d1f7d75f2efcaec3959759631f579', class: "input-outer-wrapper" }, h("div", { key: '04ba158193111283c31ea6e8d3d4e34e0dafe995', class: {
|
|
1678
1680
|
'input-wrapper': true,
|
|
1679
1681
|
'input-round': this.round,
|
|
1680
1682
|
'input-readonly': this.readonly,
|
|
1681
1683
|
'input-disabled': this.disabled,
|
|
1682
1684
|
'input-invalid': this.invalid
|
|
1683
|
-
}, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { key: '
|
|
1685
|
+
}, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { key: '6e834d91bca7660e24f7f917034db92a530d3901', class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { key: '606625d78126b10f1efbdeec78d2339d9a66cf04', icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: '28776786dd55f04d60c985ed7891d85c0e4c1f7b', class: "input-inner-wrapper" }, h("input", { key: '7ee17b1603ed56cd4b98561c9a7f5426edfcb9e8', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
|
|
1684
1686
|
'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
|
|
1685
1687
|
'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value
|
|
1686
|
-
}, 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.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { key: '
|
|
1688
|
+
}, 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.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { key: '5195866111feaf77f8ae6b9272443c7f2e6f6c9b', class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (h("cat-button", { key: 'ffbd5c49957d02e672d1da2710fb5a2698fe34a5', class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), this.loading && h("cat-spinner", { key: '19e83c45128e1110c4404fb266b97d9a0b23ea75', size: "m", class: "icon-loading" }), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { key: '2363be86adba00d3748a2b4e72d968027e3cbc03', icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (h("cat-icon", { key: '158ae6c58f520b87023e534239550cd963c6c3f2', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (h("span", { key: '8d0148452fe5b0184ed04fbaa7e84d805ef8648f', class: "text-suffix", part: "suffix" }, this.textSuffix))), h("slot", { key: 'cc46bb14d556c4144c28b8901e0aac7ff2c6908e', name: "addon" })), this.hasHint && (h(CatFormHint, { key: '0de0feb24f62246485c054bb83237d5610c89a21', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
|
|
1687
1689
|
}
|
|
1688
1690
|
get hasHint() {
|
|
1689
1691
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -1773,6 +1775,7 @@ const CatInput = /*@__PURE__*/ proxyCustomElement(class CatInput extends HTMLEle
|
|
|
1773
1775
|
"nativeAttributes": [16],
|
|
1774
1776
|
"hasSlottedLabel": [32],
|
|
1775
1777
|
"hasSlottedHint": [32],
|
|
1778
|
+
"hasSlottedCounter": [32],
|
|
1776
1779
|
"isPasswordShown": [32],
|
|
1777
1780
|
"errorMap": [32],
|
|
1778
1781
|
"doFocus": [64],
|