@haiilo/catalyst 13.2.0 → 13.3.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/{p-1823cdaa.entry.js → p-cd47a310.entry.js} +4 -4
- package/dist/catalyst/p-cd47a310.entry.js.map +1 -0
- package/dist/cjs/cat-alert_30.cjs.entry.js +12 -5
- package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.js +31 -5
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/components/cat-input2.js +12 -5
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/esm/cat-alert_30.entry.js +12 -5
- package/dist/esm/cat-alert_30.entry.js.map +1 -1
- package/dist/types/components/cat-input/cat-input.d.ts +4 -0
- package/dist/types/components.d.ts +5 -0
- package/package.json +2 -2
- package/dist/catalyst/p-1823cdaa.entry.js.map +0 -1
|
@@ -7982,6 +7982,7 @@ const CatInput = class {
|
|
|
7982
7982
|
this.catChange = index.createEvent(this, "catChange");
|
|
7983
7983
|
this.catFocus = index.createEvent(this, "catFocus");
|
|
7984
7984
|
this.catBlur = index.createEvent(this, "catBlur");
|
|
7985
|
+
this.catChangeFiles = index.createEvent(this, "catChangeFiles");
|
|
7985
7986
|
if (hostRef.$hostElement$["s-ei"]) {
|
|
7986
7987
|
this.internals = hostRef.$hostElement$["s-ei"];
|
|
7987
7988
|
}
|
|
@@ -8088,6 +8089,9 @@ const CatInput = class {
|
|
|
8088
8089
|
async clear() {
|
|
8089
8090
|
this.value = '';
|
|
8090
8091
|
this.catChange.emit(this.value);
|
|
8092
|
+
if (this.type === 'file') {
|
|
8093
|
+
this.catChangeFiles.emit(null);
|
|
8094
|
+
}
|
|
8091
8095
|
}
|
|
8092
8096
|
onErrorsChanged(newValue, _oldValue, update = true) {
|
|
8093
8097
|
if (!coerceBoolean(this.errorUpdate)) {
|
|
@@ -8104,24 +8108,24 @@ const CatInput = class {
|
|
|
8104
8108
|
}
|
|
8105
8109
|
render() {
|
|
8106
8110
|
this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
|
|
8107
|
-
return (index.h("div", { key: '
|
|
8111
|
+
return (index.h("div", { key: 'ffc4412a1f7c10431da8c4b6380fd8218298ac5a', class: {
|
|
8108
8112
|
'input-field': true,
|
|
8109
8113
|
'input-horizontal': this.horizontal ?? this.fallbackHorizontal ?? false
|
|
8110
|
-
} }, index.h("div", { key: '
|
|
8114
|
+
} }, index.h("div", { key: '212806d23ea27c6bcfd8850ee3da759014ca78ad', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (index.h("label", { key: '78072a1cba66307777885eb284c8e1bdd58e16a1', htmlFor: this.id, part: "label" }, index.h("span", { key: '8418283fde42db3445d5ca9b10559684c8bcd7d7', class: "label-wrapper" }, (this.hasSlottedLabel && index.h("slot", { key: '6676d6381311ed2d171cb807598de2c408d017bf', name: "label" })) || this.label, index.h("div", { key: '5ae2d177c55c34663304c8d844e232fda8378067', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (index.h("span", { key: '21f4e5a75faa4753f75a5a08de6cad4fdcf685fd', class: "label-optional", "aria-hidden": "true" }, "(", index$1.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (index.h("span", { key: 'ea4c178c57d407e09bb8b10f14016c4987db4874', class: "label-optional", "aria-hidden": "true" }, "(", index$1.catI18nRegistry.t('input.required'), ")")), (this.maxLength || this.hasSlottedCounter) && (index.h("div", { key: '43e04d882ca31ad03a66fbc148594cbcdb9ee313', class: "label-character-count", "aria-hidden": "true" }, this.hasSlottedCounter ? (index.h("slot", { name: "counter" })) : (`${this.value?.length ?? 0}/${this.maxLength}`)))))))), index.h("div", { key: '06b53fdb4df82aeb736ae19d73b2a11d1c4e9af0', class: { 'input-color': this.type === 'color', 'input-container': true } }, index.h("div", { key: 'edb77ce73acff3cbcc0f4228a3c9ac95dbaca2d8', class: "input-outer-wrapper" }, index.h("div", { key: 'b39ccf857a38b31e2f15885f11c6d5f75f335aa3', class: {
|
|
8111
8115
|
'input-wrapper': true,
|
|
8112
8116
|
'input-round': this.round,
|
|
8113
8117
|
'input-readonly': this.readonly,
|
|
8114
8118
|
'input-disabled': this.disabled,
|
|
8115
8119
|
'input-invalid': this.invalid
|
|
8116
|
-
}, onClick: () => this.input.focus() }, this.textPrefix && (index.h("span", { key: '
|
|
8120
|
+
}, onClick: () => this.input.focus() }, this.textPrefix && (index.h("span", { key: 'f075bb5d4a81c2ccf35d7c50fd3ec65a6b9ab37e', class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (index.h("cat-icon", { key: '12013d6b78cd440b99982c12aef4af31dcd91246', icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), index.h("div", { key: '6d339cfe079f7926b4263b161ff08f4c6b9a4a43', class: {
|
|
8117
8121
|
'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
|
|
8118
8122
|
'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value,
|
|
8119
8123
|
'input-inner-wrapper': true,
|
|
8120
8124
|
'type-color': this.type === 'color'
|
|
8121
|
-
} }, this.type === 'color' && index.h("span", { key: '
|
|
8125
|
+
} }, this.type === 'color' && index.h("span", { key: 'cf422632d44d234e7a9aef52572665a9a28ecc9d', class: "color-value" }, this.value ?? '#000000'), index.h("input", { key: 'ebc4a025956a028f1f73958486fa7e37dcd585a3', "data-test": this.testId, ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
|
|
8122
8126
|
'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
|
|
8123
8127
|
'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value
|
|
8124
|
-
}, autocomplete: this.autoComplete, disabled: this.disabled, accept: this.type === 'file' ? this.accept : undefined, multiple: this.type === 'file' ? this.multiple : undefined, 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 && (index.h("cat-button", { key: '
|
|
8128
|
+
}, autocomplete: this.autoComplete, disabled: this.disabled, accept: this.type === 'file' ? this.accept : undefined, multiple: this.type === 'file' ? this.multiple : undefined, 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 && (index.h("cat-button", { key: 'c60b67e4b261a08d91180a92618fdfc692d239bf', class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": index$1.catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (index.h("cat-button", { key: 'db6c218c74a241f626e5c2fdc767fa8f63d33a86', class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": index$1.catI18nRegistry.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), this.loading && index.h("cat-spinner", { key: 'b2179d6109246c579189f0911faeb95168b96016', size: "m", class: "icon-loading" }), !this.invalid && this.icon && this.iconRight && (index.h("cat-icon", { key: '52487c6ce3219d9b60f4af4f3360691bd7c34ace', icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (index.h("cat-icon", { key: '18a27e11f4c4501d17758af16953ee2e23a1f0b9', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (index.h("span", { key: '670348803c9828e4cf0587dd24de55273611f3a1', class: "text-suffix", part: "suffix" }, this.textSuffix))), index.h("slot", { key: '31969e55553baa41f18f60af3f81add74dafc6a7', name: "addon" })), this.hasHint && (index.h(CatFormHint, { key: '3a240f0af4686de4c2fc66c267e0e8c6b5f26157', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap })))));
|
|
8125
8129
|
}
|
|
8126
8130
|
get hasHint() {
|
|
8127
8131
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -8142,6 +8146,9 @@ const CatInput = class {
|
|
|
8142
8146
|
this.value = formattedValue;
|
|
8143
8147
|
this.internals.setFormValue(this.input.value);
|
|
8144
8148
|
this.catChange.emit(this.value);
|
|
8149
|
+
if (this.type === 'file') {
|
|
8150
|
+
this.catChangeFiles.emit(this.input.files);
|
|
8151
|
+
}
|
|
8145
8152
|
this.showErrorsIfTimeout();
|
|
8146
8153
|
}
|
|
8147
8154
|
onFocus(event) {
|