@haiilo/catalyst 13.2.0 → 13.3.1
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-473747dc.entry.js} +4 -4
- package/dist/catalyst/p-473747dc.entry.js.map +1 -0
- package/dist/cjs/cat-alert_30.cjs.entry.js +17 -10
- 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/collection/components/cat-select/cat-select.js +5 -5
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/components/cat-input2.js +12 -5
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-select2.js +5 -5
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/esm/cat-alert_30.entry.js +17 -10
- 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) {
|
|
@@ -9168,8 +9175,8 @@ const CatSelect = class {
|
|
|
9168
9175
|
if (!oldState.isResolving) {
|
|
9169
9176
|
this.valueChangedBySelection = true;
|
|
9170
9177
|
this.value = newValue;
|
|
9178
|
+
this.catChange.emit();
|
|
9171
9179
|
}
|
|
9172
|
-
this.catChange.emit();
|
|
9173
9180
|
this.showErrorsIfTimeout();
|
|
9174
9181
|
}
|
|
9175
9182
|
}
|
|
@@ -9370,18 +9377,18 @@ const CatSelect = class {
|
|
|
9370
9377
|
}
|
|
9371
9378
|
render() {
|
|
9372
9379
|
this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
|
|
9373
|
-
return (index.h(index.Host, { key: '
|
|
9380
|
+
return (index.h(index.Host, { key: 'cce259c5f7b06306c1f336635c270de82e98064e' }, index.h("div", { key: 'a2949af92f006706e687564718aa20338b3e0f63', class: {
|
|
9374
9381
|
'select-field': true,
|
|
9375
9382
|
'select-horizontal': this.horizontal ?? this.fallbackHorizontal ?? false,
|
|
9376
9383
|
'select-multiple': this.multiple
|
|
9377
|
-
} }, index.h("div", { key: '
|
|
9384
|
+
} }, index.h("div", { key: 'eee1e60b3e1e09135935a0f7e7a093ba0ff6ee41', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (index.h("label", { key: '94948c264228e044642651a0d560457703e5a983', htmlFor: `select-${this.id}-input`, part: "label" }, index.h("span", { key: 'bd5ba65749fac9293d3209793f081fa9ac4a162f', class: "label-wrapper" }, (this.hasSlottedLabel && index.h("slot", { key: 'fca2150e151340e5ef5c10616c8e8c20654adca7', name: "label" })) || this.label, index.h("div", { key: '37d9af2e26316942d92c89380393a21f824c6e68', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (index.h("span", { key: 'a692a243a43360edb4787c19ce375d2b7ef2f633', class: "label-optional", "aria-hidden": "true" }, "(", index$1.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (index.h("span", { key: 'f38a61c19e758801fc64441c574b5dc886d92b43', class: "label-optional", "aria-hidden": "true" }, "(", index$1.catI18nRegistry.t('input.required'), ")"))))))), index.h("div", { key: '847171f206e167b9ac20d5865b5751d057c6093c', class: "select-container" }, index.h("div", { key: 'ae8c24288e33761373fc40aaf4092d8fe4ad6d8e', class: { 'select-wrapper': true, 'select-disabled': this.disabled, 'select-invalid': this.invalid }, ref: el => (this.trigger = el), id: this.id, role: "combobox", "aria-expanded": this.state.isOpen || this.isPillboxActive(), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-required": this.required ? 'true' : false, "aria-activedescendant": this.activeDescendant, onClick: e => this.onClick(e) }, index.h("div", { key: 'cb17665af425a0172bb204adf6d24cc76a4bcf79', class: "select-wrapper-inner" }, this.multiple && this.state.selection.length ? (index.h("div", { id: `select-pillbox-${this.id}`, role: "listbox", "aria-orientation": "horizontal", class: "select-pills" }, this.state.selection.map((item, i) => (index.h("span", { class: {
|
|
9378
9385
|
pill: true,
|
|
9379
9386
|
'select-no-open': true,
|
|
9380
9387
|
'select-option-active': this.state.activeSelectionIndex === i
|
|
9381
|
-
}, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (index.h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, icon: item.render.avatar.icon, initials: item.render.avatar.initials ?? '' })) : null, index.h("span", null, item.render.label), !this.disabled && (index.h("cat-button", { size: "xs", variant: "text", icon: "$cat:select-clear", iconOnly: true, a11yLabel: index$1.catI18nRegistry.t('select.deselect'), onClick: () => this.deselect(item.item.id), tabIndex: -1, "data-dropdown-no-close": true }))))))) : this.state.selection.length && this.state.selection[0].render.avatar ? (index.h("cat-avatar", { label: this.state.selection[0].render.label, round: this.state.selection[0].render.avatar.round, src: this.state.selection[0].render.avatar.src, icon: this.state.selection[0].render.avatar.icon, initials: this.state.selection[0].render.avatar.initials ?? '' })) : null, index.h("input", { key: '
|
|
9388
|
+
}, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (index.h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, icon: item.render.avatar.icon, initials: item.render.avatar.initials ?? '' })) : null, index.h("span", null, item.render.label), !this.disabled && (index.h("cat-button", { size: "xs", variant: "text", icon: "$cat:select-clear", iconOnly: true, a11yLabel: index$1.catI18nRegistry.t('select.deselect'), onClick: () => this.deselect(item.item.id), tabIndex: -1, "data-dropdown-no-close": true }))))))) : this.state.selection.length && this.state.selection[0].render.avatar ? (index.h("cat-avatar", { label: this.state.selection[0].render.label, round: this.state.selection[0].render.avatar.round, src: this.state.selection[0].render.avatar.src, icon: this.state.selection[0].render.avatar.icon, initials: this.state.selection[0].render.avatar.initials ?? '' })) : null, index.h("input", { key: '9dcca82150b5b32cfd38968fc21e78b1702e58ac', "data-test": this.testId, ...this.nativeAttributes, part: "input", id: `select-${this.id}-input`, class: "select-input", role: "combobox", ref: el => (this.input = el), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-activedescendant": this.activeDescendant, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined, "aria-autocomplete": "list", onInput: this.onInput.bind(this), value: !this.multiple ? this.state.term : undefined, placeholder: this.placeholder, disabled: this.disabled || this.state.isResolving })), this.state.isResolving && index.h("cat-spinner", { key: 'b270d73c72c3ca14cd74c07dd9ab62b248297c40' }), this.invalid && (index.h("cat-icon", { key: '928306a8eb51531aca26ad0f340c3862aef3ac26', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), (this.state.selection.length || this.state.term.length) &&
|
|
9382
9389
|
!this.disabled &&
|
|
9383
9390
|
!this.state.isResolving &&
|
|
9384
|
-
this.clearable ? (index.h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "$cat:input-close", variant: "text", size: "s", a11yLabel: index$1.catI18nRegistry.t('input.clear'), onCatClick: () => this.clearInput(), "data-dropdown-no-close": true })) : null, !this.state.isResolving && (index.h("cat-button", { key: '
|
|
9391
|
+
this.clearable ? (index.h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "$cat:input-close", variant: "text", size: "s", a11yLabel: index$1.catI18nRegistry.t('input.clear'), onCatClick: () => this.clearInput(), "data-dropdown-no-close": true })) : null, !this.state.isResolving && (index.h("cat-button", { key: 'ab86beed53c22a5fc93ecc3c075a872fd050a173', iconOnly: true, icon: "$cat:select-open", class: { 'select-btn': true, 'select-btn-open': this.state.isOpen }, variant: "text", size: "s", a11yLabel: this.state.isOpen ? index$1.catI18nRegistry.t('select.close') : index$1.catI18nRegistry.t('select.open'), "aria-controls": `select-listbox-${this.id}`, "aria-expanded": this.state.isOpen, tabIndex: -1, disabled: this.disabled || this.state.isResolving, "data-dropdown-no-close": true }))), this.hasHint && (index.h(CatFormHint, { key: '61657538dcaa5bfed0854ccb6a30e62d6d0b3d8a', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap })))), index.h("div", { key: 'b126aaa05a2491aaa0acd854f11aa3062b8cbafd', class: "select-dropdown", ref: el => (this.dropdown = el), style: { display: this.state.isOpen ? 'block' : undefined } }, this.state.isOpen && (index.h("cat-scrollable", { key: 'dc897d6566fd5bf491f11f328c2574046fddf708', class: "select-options-wrapper", scrolledBuffer: 56, noOverflowX: true, noOverscroll: true, noScrolledInit: true, onScrolledBottom: () => this.more$.next() }, index.h("ul", { key: '998a9ee7eca7f9d75d4f41b5aacc4ea4ea42251c', class: "select-options", role: "listbox", "aria-multiselectable": this.multiple, "aria-setsize": this.state.totalElements, id: `select-listbox-${this.id}` }, this.optionsList, this.state.isFirstLoading
|
|
9385
9392
|
? Array.from(Array(CatSelect.SKELETON_COUNT)).map(() => (index.h("li", { class: "select-option-loading" }, index.h("cat-skeleton", { variant: "body", lines: 1 }), index.h("cat-skeleton", { variant: "body", lines: 1 }))))
|
|
9386
9393
|
: !this.state.options.length &&
|
|
9387
9394
|
!this.tags && (index.h("li", { class: "select-option-empty" }, this.noItems ? this.noItems : index$1.catI18nRegistry.t('select.empty')))))))));
|