@haiilo/catalyst 10.23.0 → 10.24.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.css +5 -0
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.esm.js +1 -1
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/{p-594e46b4.entry.js → p-33a30da2.entry.js} +4 -4
- package/dist/catalyst/p-33a30da2.entry.js.map +1 -0
- package/dist/catalyst/scss/core/_notification.scss +5 -0
- package/dist/cjs/cat-alert_30.cjs.entry.js +97 -88
- package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +17 -4
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/cat-date/cat-date.js +3 -3
- package/dist/collection/components/cat-date/cat-date.js.map +1 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.js +6 -4
- package/dist/collection/components/cat-date-inline/cat-date-inline.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +4 -4
- package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +1 -1
- package/dist/collection/components/cat-input/cat-input.css +1 -0
- package/dist/collection/components/cat-input/cat-input.js +35 -14
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +17 -4
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-radio/cat-radio.js +2 -2
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
- package/dist/collection/components/cat-select/cat-select.js +16 -14
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
- package/dist/collection/components/cat-tab/cat-tab.js +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
- package/dist/collection/components/cat-tag/cat-tag.js +26 -18
- package/dist/collection/components/cat-tag/cat-tag.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +15 -13
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-time/cat-time.js +3 -3
- package/dist/collection/components/cat-time/cat-time.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +2 -2
- package/dist/collection/scss/core/_notification.scss +5 -0
- package/dist/components/cat-date-inline2.js +4 -4
- package/dist/components/cat-date-inline2.js.map +1 -1
- package/dist/components/cat-date.js +2 -2
- package/dist/components/cat-date.js.map +1 -1
- package/dist/components/cat-datepicker-inline.js +2 -2
- package/dist/components/cat-datepicker.js +3 -3
- package/dist/components/cat-datepicker.js.map +1 -1
- package/dist/components/cat-dropdown2.js +1 -1
- package/dist/components/cat-form-group.js +1 -1
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-icon2.js +1 -1
- package/dist/components/cat-input2.js +18 -14
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-pagination.js +2 -2
- package/dist/components/cat-radio-group.js +1 -1
- package/dist/components/cat-radio.js +2 -2
- package/dist/components/cat-scrollable2.js +3 -3
- package/dist/components/cat-select-demo.js +1 -1
- package/dist/components/cat-select2.js +15 -13
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton2.js +1 -1
- package/dist/components/cat-spinner2.js +2 -2
- package/dist/components/cat-tab.js +1 -1
- package/dist/components/cat-tabs.js +1 -1
- package/dist/components/cat-tag.js +19 -17
- package/dist/components/cat-tag.js.map +1 -1
- package/dist/components/cat-textarea.js +14 -12
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-time.js +2 -2
- package/dist/components/cat-time.js.map +1 -1
- package/dist/components/cat-toggle.js +2 -2
- package/dist/components/index.js +17 -4
- package/dist/components/index.js.map +1 -1
- package/dist/esm/cat-alert_30.entry.js +97 -88
- package/dist/esm/cat-alert_30.entry.js.map +1 -1
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/index.js +17 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cat-date/cat-date.d.ts +1 -1
- package/dist/types/components/cat-date-inline/cat-date-inline.d.ts +2 -0
- package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +1 -1
- package/dist/types/components/cat-form-hint/cat-form-hint.d.ts +1 -1
- package/dist/types/components/cat-input/cat-input.d.ts +8 -3
- package/dist/types/components/cat-notification/cat-notification.d.ts +4 -4
- package/dist/types/components/cat-select/cat-select.d.ts +4 -3
- package/dist/types/components/cat-tag/cat-tag.d.ts +15 -8
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +4 -3
- package/dist/types/components/cat-time/cat-time.d.ts +1 -1
- package/dist/types/components.d.ts +34 -14
- package/package.json +2 -2
- package/dist/catalyst/p-594e46b4.entry.js.map +0 -1
|
@@ -25,9 +25,9 @@ const CatPagination$1 = /*@__PURE__*/ proxyCustomElement(class CatPagination ext
|
|
|
25
25
|
this.iconNext = '$cat:pagination-right';
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (h("nav", { key: '
|
|
28
|
+
return (h("nav", { key: 'aea4a39cc798431911b8775600dd734595d51185', role: "navigation" }, h("ol", { key: 'bbcb43fa61bcd379ad84eb28ca6bcf995bf85159', class: {
|
|
29
29
|
[`cat-pagination-${this.size}`]: Boolean(this.size)
|
|
30
|
-
} }, h("li", { key: '
|
|
30
|
+
} }, h("li", { key: '984f120135399170d9374881a8562fa12b7c0a75' }, h("cat-button", { key: '8f173139e15c77227fc1044196887b489835a4c5', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: catI18nRegistry.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, h("li", { key: '165a68e0fd8f78f4fc6a505ec4c0715a21607d00' }, h("cat-button", { key: '74864af9ce7f4f38b3d1e47209d8c47faf559b96', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: catI18nRegistry.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
|
|
31
31
|
}
|
|
32
32
|
get isFirst() {
|
|
33
33
|
return this.page === 0;
|
|
@@ -74,7 +74,7 @@ const CatRadioGroup$1 = /*@__PURE__*/ proxyCustomElement(class CatRadioGroup ext
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
render() {
|
|
77
|
-
return (h("div", { key: '
|
|
77
|
+
return (h("div", { key: 'af9aff52c285bb32986d27c4f062f7ca8dbe394e', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: 'e4542e17427cdd2d31e38276afe5d240f5b9e6cf' })));
|
|
78
78
|
}
|
|
79
79
|
init() {
|
|
80
80
|
this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
|
|
@@ -54,13 +54,13 @@ const CatRadio$1 = /*@__PURE__*/ proxyCustomElement(class CatRadio extends HTMLE
|
|
|
54
54
|
this.input.blur();
|
|
55
55
|
}
|
|
56
56
|
render() {
|
|
57
|
-
return (h(Host, { key: '
|
|
57
|
+
return (h(Host, { key: '7fb3add02c4e5ad69577dd753a3a0353153fa304' }, h("label", { key: '3b1a872da255a8dd5c396ba55e06073146cfd758', htmlFor: this.id, class: {
|
|
58
58
|
'is-hidden': this.labelHidden,
|
|
59
59
|
'is-disabled': this.disabled,
|
|
60
60
|
'label-left': this.labelLeft,
|
|
61
61
|
'align-center': this.alignment === 'center',
|
|
62
62
|
'align-end': this.alignment === 'bottom'
|
|
63
|
-
}, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: '
|
|
63
|
+
}, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: 'baea250060694d0f239b222efafd469c3fd51d6e', class: "radio" }, h("input", { key: '8d3ab427ade40822fe3fb4eab8c8b4f9be8104ae', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", 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), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: 'a0e30eb3a071d8981dc2cf6e12d42bbcf5ff8bec', class: "circle" })), h("span", { key: '518d21be81587a6bd6fd571b4921a9c7464f65ae', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: 'f9f92eb46213178a4be84210f3a7d4b758bb043c', name: "label" })) || this.label)), this.hasHint && (h("div", { key: '9af9f7e6331131847217ad74b2c4c7bd3ca51212', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: '6064b9990cbbb0f49a305acc15f0ea7bed627da7', class: "circle-placeholder" }), h(CatFormHint, { key: '4cb103c3f9b83555b222da19bf480af83201465e', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
|
|
64
64
|
}
|
|
65
65
|
get hasHint() {
|
|
66
66
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -605,13 +605,13 @@ const CatScrollable = /*@__PURE__*/ proxyCustomElement(class CatScrollable exten
|
|
|
605
605
|
}
|
|
606
606
|
render() {
|
|
607
607
|
return [
|
|
608
|
-
h("div", { key: '
|
|
609
|
-
h("div", { key: '
|
|
608
|
+
h("div", { key: 'd2c0966e736fe4da66b4ff4c17ce51b914bc4b8d', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { key: 'a0b25b995b5f75d1c09d4dc982ceebe9a8c904b8', class: "shadow-top" }), !this.noShadowX && h("div", { key: '02e550e37511bff64e9c8c2bd09c41858fdd3930', class: "shadow-left" }), !this.noShadowX && h("div", { key: 'debb835bfcf815837e14b1378190e90a243a1af5', class: "shadow-right" }), !this.noShadowY && h("div", { key: 'd646f92372ab80246f0164c672812854d6c1c946', class: "shadow-bottom" })),
|
|
609
|
+
h("div", { key: 'e24d26d9c11070b8b0d5a66da3bcaeb12bf3532c', ref: el => (this.scrollElement = el), class: {
|
|
610
610
|
'scrollable-content': true,
|
|
611
611
|
'scroll-x': !this.noOverflowX,
|
|
612
612
|
'scroll-y': !this.noOverflowY,
|
|
613
613
|
'no-overscroll': this.noOverscroll
|
|
614
|
-
} }, h("slot", { key: '
|
|
614
|
+
} }, h("slot", { key: '6923a1a06201e1997c80af316d57d0654312dca4' }))
|
|
615
615
|
];
|
|
616
616
|
}
|
|
617
617
|
attachEmitter(from, emitter) {
|
|
@@ -176,7 +176,7 @@ const CatSelectTest = /*@__PURE__*/ proxyCustomElement(class CatSelectTest exten
|
|
|
176
176
|
setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
|
|
177
177
|
}
|
|
178
178
|
render() {
|
|
179
|
-
return (h(Host, { key: '
|
|
179
|
+
return (h(Host, { key: '0427cd222f128124aa5b7304ecc56f98f82ad601', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, h("cat-select", { key: '20731907f24cecd4f79bc2b8fb55bf4ca2a8781d', label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, h("span", { key: 'b4284b5fa7bd3c80c49900cc901a67ce87b02fba', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { key: '1ae920c166bcffb8c417887ab01830bc9704d82b', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '6928bbfea0b54d3a2d82bdc16de71208934cd4ab', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'ffa816a1e6f4e5e170aeed4c64f75aefb928e800', label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'a392acd00395251efe86deb5f95de439cb2e2947', label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), h("cat-select", { key: 'abe4098459cb27c12ecccd500080ed4b183d4221', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), h("cat-select", { key: '59e0e9df2329e1ee7f96a071462a58e7aac8c057', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { key: 'bfed29db8e502f705877dd79ad9f584569639a22', overflow: true }, h("cat-button", { key: 'fda80f359585e24f3fa9cff4567b4c6d0681cc9d', slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { key: '180ed85afb561a07ff346bd481503d57c336fbe6', slot: "content", style: { width: '400px' } }, h("cat-select", { key: '12efa7508dfcb72cb897a160353958ef2c66a7a0', label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
|
|
180
180
|
}
|
|
181
181
|
get countryConnector() {
|
|
182
182
|
return {
|
|
@@ -383,17 +383,17 @@ const CatSelect = /*@__PURE__*/ proxyCustomElement(class CatSelect extends HTMLE
|
|
|
383
383
|
onValueChanged() {
|
|
384
384
|
!this.valueChangedBySelection ? this.resolve() : (this.valueChangedBySelection = false);
|
|
385
385
|
}
|
|
386
|
-
onErrorsChanged(
|
|
386
|
+
onErrorsChanged(newValue, _oldValue, update = true) {
|
|
387
387
|
if (!coerceBoolean(this.errorUpdate)) {
|
|
388
388
|
this.errorMap = undefined;
|
|
389
389
|
}
|
|
390
390
|
else {
|
|
391
|
-
this.errorMapSrc = Array.isArray(
|
|
392
|
-
?
|
|
393
|
-
:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
391
|
+
this.errorMapSrc = Array.isArray(newValue)
|
|
392
|
+
? newValue.reduce((acc, err) => ({ ...acc, [err]: undefined }), {})
|
|
393
|
+
: newValue || undefined;
|
|
394
|
+
if (update) {
|
|
395
|
+
this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();
|
|
396
|
+
}
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
onStateChanged(newState, oldState) {
|
|
@@ -448,8 +448,10 @@ const CatSelect = /*@__PURE__*/ proxyCustomElement(class CatSelect extends HTMLE
|
|
|
448
448
|
autoUpdate(this.trigger, this.dropdown, () => this.update());
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
+
componentWillLoad() {
|
|
452
|
+
this.onErrorsChanged(this.errors, undefined, false);
|
|
453
|
+
}
|
|
451
454
|
componentWillRender() {
|
|
452
|
-
this.onErrorsChanged(this.errors);
|
|
453
455
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
454
456
|
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
455
457
|
}
|
|
@@ -634,18 +636,18 @@ const CatSelect = /*@__PURE__*/ proxyCustomElement(class CatSelect extends HTMLE
|
|
|
634
636
|
});
|
|
635
637
|
}
|
|
636
638
|
render() {
|
|
637
|
-
return (h(Host, { key: '
|
|
639
|
+
return (h(Host, { key: 'f8f27eef2e7fff527c9a3c4e7c4fde643d80b606' }, h("div", { key: '1d28d1629ab6407eb8af786b7878309885ea8e99', class: {
|
|
638
640
|
'select-field': true,
|
|
639
641
|
'select-horizontal': this.horizontal,
|
|
640
642
|
'select-multiple': this.multiple
|
|
641
|
-
} }, h("div", { key: '
|
|
643
|
+
} }, h("div", { key: 'dc241514b1e697c2a42c230c9f04cd07f1a3a735', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: 'd5f0179474aeca24a0773e81e9b08873e847facd', htmlFor: `select-${this.id}-input`, part: "label" }, h("span", { key: '3cf13b24b0537d2a70e6a0918d1ba6c9b2b84731', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: 'f0ad0d85b986a657456c8cd37b2f5cf286d1bf44', name: "label" })) || this.label, h("div", { key: '0ec56a4f09ee480300e5ea8c2c656f90e5fef2de', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: '08c2e70f25ccf68bbc73d2366e39f4bde5d1c675', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: '7e7fe7b9e28e4833bb413c60af3459a1d998189b', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))))), h("div", { key: 'bf37c5423d2e33d98bd62007a74a45f2362c4575', class: "select-container" }, h("div", { key: 'f09d751cfd05f43942ad5ad77706f8ae39050de9', 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) }, h("div", { key: '5378a3d5f444e6346c53ffb7023cce68cf1c3ffb', class: "select-wrapper-inner" }, this.multiple && this.state.selection.length ? (h("div", { id: `select-pillbox-${this.id}`, role: "listbox", "aria-orientation": "horizontal", class: "select-pills" }, this.state.selection.map((item, i) => (h("span", { class: {
|
|
642
644
|
pill: true,
|
|
643
645
|
'select-no-open': true,
|
|
644
646
|
'select-option-active': this.state.activeSelectionIndex === i
|
|
645
|
-
}, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (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, h("span", null, item.render.label), !this.disabled && (h("cat-button", { size: "xs", variant: "text", icon: "$cat:select-clear", iconOnly: true, a11yLabel: 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 ? (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, h("input", { key: '
|
|
647
|
+
}, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (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, h("span", null, item.render.label), !this.disabled && (h("cat-button", { size: "xs", variant: "text", icon: "$cat:select-clear", iconOnly: true, a11yLabel: 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 ? (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, h("input", { key: '27755954d228e33d0ba6adf5736defcd1d56b32b', ...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 && h("cat-spinner", { key: '4621c8c3b7e430e5841471757da5a51df5ca86ad' }), this.invalid && (h("cat-icon", { key: 'b4d31caef78d62769c3dc84fc6d4415f8c5ee849', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), (this.state.selection.length || this.state.term.length) &&
|
|
646
648
|
!this.disabled &&
|
|
647
649
|
!this.state.isResolving &&
|
|
648
|
-
this.clearable ? (h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "$cat:input-close", variant: "text", size: "s", a11yLabel: catI18nRegistry.t('input.clear'), onCatClick: () => this.clearInput(), "data-dropdown-no-close": true })) : null, !this.state.isResolving && (h("cat-button", { key: '
|
|
650
|
+
this.clearable ? (h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "$cat:input-close", variant: "text", size: "s", a11yLabel: catI18nRegistry.t('input.clear'), onCatClick: () => this.clearInput(), "data-dropdown-no-close": true })) : null, !this.state.isResolving && (h("cat-button", { key: '54a2c42cda8750dce73c4730a3a8f4cdc3c959f2', iconOnly: true, icon: "$cat:select-open", class: { 'select-btn': true, 'select-btn-open': this.state.isOpen }, variant: "text", size: "s", a11yLabel: this.state.isOpen ? catI18nRegistry.t('select.close') : 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 && (h(CatFormHint, { key: 'de8b11dcd1e97476a811f9811026eae619c42ac8', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))), h("div", { key: '558cf4e93022770cf7841eab7d2f8b116cb221be', class: "select-dropdown", ref: el => (this.dropdown = el), style: { display: this.state.isOpen ? 'block' : undefined } }, this.state.isOpen && (h("cat-scrollable", { key: 'cdc203f6738614839f1a18c2bce9353f0df8e47c', class: "select-options-wrapper", scrolledBuffer: 56, noOverflowX: true, noOverscroll: true, noScrolledInit: true, onScrolledBottom: () => this.more$.next() }, h("ul", { key: '63316734b1e845d727ef4628b1d324a3757f7989', class: "select-options", role: "listbox", "aria-multiselectable": this.multiple, "aria-setsize": this.state.totalElements, id: `select-listbox-${this.id}` }, this.optionsList, this.state.isFirstLoading
|
|
649
651
|
? Array.from(Array(CatSelect.SKELETON_COUNT)).map(() => (h("li", { class: "select-option-loading" }, h("cat-skeleton", { variant: "body", lines: 1 }), h("cat-skeleton", { variant: "body", lines: 1 }))))
|
|
650
652
|
: !this.state.options.length &&
|
|
651
653
|
!this.tags && (h("li", { class: "select-option-empty" }, this.noItems ? this.noItems : catI18nRegistry.t('select.empty')))))))));
|
|
@@ -654,7 +656,7 @@ const CatSelect = /*@__PURE__*/ proxyCustomElement(class CatSelect extends HTMLE
|
|
|
654
656
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
655
657
|
}
|
|
656
658
|
get invalid() {
|
|
657
|
-
return !!Object.keys(this.errorMap || {}).length;
|
|
659
|
+
return this.errorMap === true || !!Object.keys(this.errorMap || {}).length;
|
|
658
660
|
}
|
|
659
661
|
get optionsList() {
|
|
660
662
|
return this.state.options.map((item, i) => {
|