@haiilo/catalyst 10.14.1 → 10.15.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-d7169e38.entry.js → p-c2b462ed.entry.js} +2 -2
- package/dist/catalyst/p-c2b462ed.entry.js.map +1 -0
- package/dist/cjs/cat-alert_29.cjs.entry.js +45 -29
- package/dist/cjs/cat-alert_29.cjs.entry.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +19 -5
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-radio/cat-radio.js +1 -1
- 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 +3 -1
- 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-textarea/cat-textarea.js +3 -3
- package/dist/collection/components/cat-time/cat-time.js +2 -2
- package/dist/collection/components/cat-toggle/cat-toggle.js +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +2 -2
- package/dist/components/cat-dropdown2.js +19 -5
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +1 -1
- package/dist/components/cat-icon2.js +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 +1 -1
- package/dist/components/cat-scrollable2.js +3 -3
- package/dist/components/cat-select-demo.js +1 -1
- package/dist/components/cat-select2.js +3 -1
- 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-textarea.js +3 -3
- package/dist/components/cat-time.js +2 -2
- package/dist/components/cat-toggle.js +1 -1
- package/dist/components/cat-tooltip.js +2 -2
- package/dist/esm/cat-alert_29.entry.js +45 -29
- package/dist/esm/cat-alert_29.entry.js.map +1 -1
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +4 -0
- package/package.json +2 -2
- package/dist/catalyst/p-d7169e38.entry.js.map +0 -1
|
@@ -8477,6 +8477,9 @@ const CatDropdown = class {
|
|
|
8477
8477
|
* Opens the dropdown.
|
|
8478
8478
|
*/
|
|
8479
8479
|
async open() {
|
|
8480
|
+
// we need to delay the initialization of the trigger until first
|
|
8481
|
+
// interaction because the element might still be hidden (and thus not
|
|
8482
|
+
// tabbable) if contained in another Stencil web component
|
|
8480
8483
|
if (!this.trigger) {
|
|
8481
8484
|
this.initTrigger();
|
|
8482
8485
|
}
|
|
@@ -8546,7 +8549,10 @@ const CatDropdown = class {
|
|
|
8546
8549
|
}, timeTransitionS);
|
|
8547
8550
|
}
|
|
8548
8551
|
render() {
|
|
8549
|
-
return (index.h(index.Host, { key: '
|
|
8552
|
+
return (index.h(index.Host, { key: '7e36594a07f06a29d6360a275ac2aeff94c15a6e' }, index.h("slot", { key: '4eca46c3ef78b8dc33861b53b4c24fea7e55934b', name: "anchor", ref: el => (this.anchorSlot = el) }), index.h("slot", { key: '63cf5ee478ac0f4472525bf7af87b951f190c1a6', name: "trigger", ref: el => (this.triggerSlot = el) }), index.h("div", { key: '7721f06ff6ad699d11775edbb56b428ba3f2fcdd', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, index.h("slot", { key: 'a3019a04b20c6e0d18af8aa690ae6ff71bd30ae6', name: "content" }))));
|
|
8553
|
+
}
|
|
8554
|
+
componentDidLoad() {
|
|
8555
|
+
this.initAnchor();
|
|
8550
8556
|
}
|
|
8551
8557
|
get contentId() {
|
|
8552
8558
|
return `cat-dropdown-${this.id}`;
|
|
@@ -8557,7 +8563,15 @@ const CatDropdown = class {
|
|
|
8557
8563
|
this.trigger.setAttribute('aria-expanded', 'false');
|
|
8558
8564
|
this.trigger.setAttribute('aria-controls', this.contentId);
|
|
8559
8565
|
this.trigger.addEventListener('click', () => this.toggle());
|
|
8560
|
-
|
|
8566
|
+
if (!this.anchor) {
|
|
8567
|
+
autoUpdate(this.trigger, this.content, () => this.update(this.trigger));
|
|
8568
|
+
}
|
|
8569
|
+
}
|
|
8570
|
+
initAnchor() {
|
|
8571
|
+
this.anchor = (this.anchorSlot?.assignedElements?.() || [])[0];
|
|
8572
|
+
if (this.anchor) {
|
|
8573
|
+
autoUpdate(this.anchor, this.content, () => this.update(this.anchor));
|
|
8574
|
+
}
|
|
8561
8575
|
}
|
|
8562
8576
|
findTrigger() {
|
|
8563
8577
|
let trigger;
|
|
@@ -8576,8 +8590,8 @@ const CatDropdown = class {
|
|
|
8576
8590
|
}
|
|
8577
8591
|
return trigger;
|
|
8578
8592
|
}
|
|
8579
|
-
update() {
|
|
8580
|
-
if (
|
|
8593
|
+
update(anchorElement) {
|
|
8594
|
+
if (anchorElement) {
|
|
8581
8595
|
const resize = this.noResize
|
|
8582
8596
|
? []
|
|
8583
8597
|
: [
|
|
@@ -8591,7 +8605,7 @@ const CatDropdown = class {
|
|
|
8591
8605
|
}
|
|
8592
8606
|
})
|
|
8593
8607
|
];
|
|
8594
|
-
computePosition(
|
|
8608
|
+
computePosition(anchorElement, this.content, {
|
|
8595
8609
|
strategy: 'fixed',
|
|
8596
8610
|
placement: this.placement,
|
|
8597
8611
|
middleware: [offset(CatDropdown.OFFSET), flip(), ...resize]
|
|
@@ -8632,7 +8646,7 @@ const CatFormGroup = class {
|
|
|
8632
8646
|
});
|
|
8633
8647
|
}
|
|
8634
8648
|
render() {
|
|
8635
|
-
return (index.h(index.Host, { key: '
|
|
8649
|
+
return (index.h(index.Host, { key: '9dd41737f5494414b9d512ed96574d601354e30f', style: { '--label-size': this.labelSize } }, index.h("slot", { key: '59eb8e44f63bdb5530ff4abe9171997cbe4a315d', onSlotchange: this.onSlotChange.bind(this) })));
|
|
8636
8650
|
}
|
|
8637
8651
|
onSlotChange() {
|
|
8638
8652
|
this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker'));
|
|
@@ -8664,7 +8678,7 @@ const CatIcon = class {
|
|
|
8664
8678
|
this.a11yLabel = undefined;
|
|
8665
8679
|
}
|
|
8666
8680
|
render() {
|
|
8667
|
-
return (index.h("span", { key: '
|
|
8681
|
+
return (index.h("span", { key: '83b5dc326310880529e5edc274e2a3196a0e6234', innerHTML: this.iconSrc || (this.icon ? of.catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
8668
8682
|
icon: true,
|
|
8669
8683
|
[`icon-${this.size}`]: this.size !== 'inline'
|
|
8670
8684
|
} }));
|
|
@@ -10432,9 +10446,9 @@ const CatPagination = class {
|
|
|
10432
10446
|
this.iconNext = '$cat:pagination-right';
|
|
10433
10447
|
}
|
|
10434
10448
|
render() {
|
|
10435
|
-
return (index.h("nav", { key: '
|
|
10449
|
+
return (index.h("nav", { key: 'e0afa5efde129998d5899191374849c2538d5656', role: "navigation" }, index.h("ol", { key: '3b6d1838f508a3323d0ff11b95318eee5cfe5c89', class: {
|
|
10436
10450
|
[`cat-pagination-${this.size}`]: Boolean(this.size)
|
|
10437
|
-
} }, index.h("li", { key: '
|
|
10451
|
+
} }, index.h("li", { key: 'fffae2ea8d502b03c01841f2cdf281150d6b62b5' }, index.h("cat-button", { key: '8f320c285b322ca8ae618143b70fdf85b227c232', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: of.catI18nRegistry.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, index.h("li", { key: '77d3aa0acb4a27cd8c65d7396dab318dcce7825c' }, index.h("cat-button", { key: 'fe70cf4c908cbc7ac2bd2167f778f42fa3b49025', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: of.catI18nRegistry.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
|
|
10438
10452
|
}
|
|
10439
10453
|
get isFirst() {
|
|
10440
10454
|
return this.page === 0;
|
|
@@ -10536,7 +10550,7 @@ const CatRadio = class {
|
|
|
10536
10550
|
this.input.blur();
|
|
10537
10551
|
}
|
|
10538
10552
|
render() {
|
|
10539
|
-
return (index.h(index.Host, { key: '
|
|
10553
|
+
return (index.h(index.Host, { key: 'ac195620510636c4a00252872b925c26b7e40809' }, index.h("label", { key: 'bdca13538284884a2e8b66365d32c951b84e19e9', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, index.h("span", { key: 'e1c58b79ee19209fafb8120e4ce560c6df260454', class: "radio" }, index.h("input", { key: 'b847d19afa147207a7a21586f941ce38da8bc11f', ...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 }), index.h("span", { key: '9872df04798ec57660c35cd4b0cad8e179668022', class: "circle" })), index.h("span", { key: '89d6e1dc470e6db8c94ecc7567392eeaae636f67', class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { key: 'ff6c945b79f690771e3751c95685cdf9df91c9cf', name: "label" })) || this.label)), this.hasHint && (index.h("div", { key: '24b4f214a0c3d1c5d27f3517f4a57edde61a73dd', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, index.h("div", { key: '3e37c759d11347654c86d522189f82b6509fc680', class: "circle-placeholder" }), index.h(CatFormHint, { key: 'a236040feaa1f77d9e3bbf326f7cf2cac3ab5031', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }) })))));
|
|
10540
10554
|
}
|
|
10541
10555
|
get hasHint() {
|
|
10542
10556
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -10627,7 +10641,7 @@ const CatRadioGroup = class {
|
|
|
10627
10641
|
}
|
|
10628
10642
|
}
|
|
10629
10643
|
render() {
|
|
10630
|
-
return (index.h("div", { key: '
|
|
10644
|
+
return (index.h("div", { key: '597881a52c2314f3cc6e159473d8dc83e5944900', role: "radiogroup", "aria-label": this.a11yLabel }, index.h("slot", { key: 'ca1d499d74100334a86bf75362bd61f3674d31fa' })));
|
|
10631
10645
|
}
|
|
10632
10646
|
init() {
|
|
10633
10647
|
this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
|
|
@@ -10716,13 +10730,13 @@ const CatScrollable = class {
|
|
|
10716
10730
|
}
|
|
10717
10731
|
render() {
|
|
10718
10732
|
return [
|
|
10719
|
-
index.h("div", { key: '
|
|
10720
|
-
index.h("div", { key: '
|
|
10733
|
+
index.h("div", { key: '3fa7e90419b11118694def5d300036b1062fb685', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && index.h("div", { key: '3f7a3b2aa4a8b434ab66fc676e02771e056dfc95', class: "shadow-top" }), !this.noShadowX && index.h("div", { key: '450547a0b1a08a15903e605f2bd12c1eb2637089', class: "shadow-left" }), !this.noShadowX && index.h("div", { key: '69fe8dc3f0282d9d8bf1ccd65add30c0046789c4', class: "shadow-right" }), !this.noShadowY && index.h("div", { key: 'b2f1df225d3653cd778b28f2f94724ff1f7a7729', class: "shadow-bottom" })),
|
|
10734
|
+
index.h("div", { key: '56833efe4ee21f847c2321e89e0b3e2fa9a7240b', ref: el => (this.scrollElement = el), class: {
|
|
10721
10735
|
'scrollable-content': true,
|
|
10722
10736
|
'scroll-x': !this.noOverflowX,
|
|
10723
10737
|
'scroll-y': !this.noOverflowY,
|
|
10724
10738
|
'no-overscroll': this.noOverscroll
|
|
10725
|
-
} }, index.h("slot", { key: '
|
|
10739
|
+
} }, index.h("slot", { key: 'c959b7cbbd06a0233ad773738ef925b05bd76be3' }))
|
|
10726
10740
|
];
|
|
10727
10741
|
}
|
|
10728
10742
|
attachEmitter(from, emitter) {
|
|
@@ -11223,10 +11237,12 @@ const CatSelect = class {
|
|
|
11223
11237
|
selection.push({ item, render: { label: item.name } });
|
|
11224
11238
|
});
|
|
11225
11239
|
}
|
|
11240
|
+
const term = !this.multiple && selection.length ? selection[0].render.label : '';
|
|
11241
|
+
this.input && (this.input.value = term);
|
|
11226
11242
|
this.patchState({
|
|
11227
11243
|
isResolving: false,
|
|
11228
11244
|
selection,
|
|
11229
|
-
term
|
|
11245
|
+
term
|
|
11230
11246
|
});
|
|
11231
11247
|
});
|
|
11232
11248
|
}
|
|
@@ -11663,7 +11679,7 @@ const CatSelectTest = class {
|
|
|
11663
11679
|
setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
|
|
11664
11680
|
}
|
|
11665
11681
|
render() {
|
|
11666
|
-
return (index.h(index.Host, { key: '
|
|
11682
|
+
return (index.h(index.Host, { key: '745d55bbd0e1c38377f5f7ed138dc78213b47960', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, index.h("cat-select", { key: '7c201ebc18e36a8551899b7e5276a63ded6bb6c8', 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 }, index.h("span", { key: 'a0c9f9514070e2101c84839292bbc749a7969eab', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), index.h("cat-select", { key: 'b648ecf10f825cb33a11da79b6528caf78b7b07c', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), index.h("cat-select", { key: '23e6ab45009463f2d703d8913b232ade2f1abfa3', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), index.h("cat-select", { key: '18f247000136a32e7ec202c7be7f01e625a4a40d', 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 }), index.h("cat-select", { key: '445e29437d8af225222a9af1e2cd87e730d23b8f', 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 }), index.h("cat-select", { key: '781b635fbe75a7cc9f8bfb840b0614b65f53b7f6', label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), index.h("cat-select", { key: '2078bf8f1778a21c1b6a4180292b244a8b11eb62', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), index.h("cat-dropdown", { key: '42a8847c8e88d349f4919794ca93e067a25ecf36', overflow: true }, index.h("cat-button", { key: '55f407b6d3316311faa138169f1eb8725757f588', slot: "trigger", style: { width: '50%' } }, "Open select"), index.h("div", { key: 'c68ad1b486b5985bb550d026ba2969a786995c48', slot: "content", style: { width: '400px' } }, index.h("cat-select", { key: '2a32550e0f87e8aa3f90abbe819c7ceab0d9c773', 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%' } })))));
|
|
11667
11683
|
}
|
|
11668
11684
|
get countryConnector() {
|
|
11669
11685
|
return {
|
|
@@ -12919,7 +12935,7 @@ const CatSkeleton = class {
|
|
|
12919
12935
|
this.lines = undefined;
|
|
12920
12936
|
}
|
|
12921
12937
|
render() {
|
|
12922
|
-
return (index.h(index.Host, { key: '
|
|
12938
|
+
return (index.h(index.Host, { key: 'aac4684f2816b1be2367866041d15e9fac0de7ac' }, Array.from(Array(this.count)).map(() => (index.h("div", { style: this.style, class: {
|
|
12923
12939
|
skeleton: true,
|
|
12924
12940
|
[`skeleton-${this.effect}`]: Boolean(this.effect),
|
|
12925
12941
|
[`skeleton-${this.variant}`]: Boolean(this.variant),
|
|
@@ -12959,9 +12975,9 @@ const CatSpinner = class {
|
|
|
12959
12975
|
this.a11yLabel = undefined;
|
|
12960
12976
|
}
|
|
12961
12977
|
render() {
|
|
12962
|
-
return (index.h("span", { key: '
|
|
12978
|
+
return (index.h("span", { key: '6e6fe85607e6f6b00fd095c176604aecc05ea75a', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
|
|
12963
12979
|
[`spinner-${this.size}`]: this.size !== 'inline'
|
|
12964
|
-
} }, index.h("svg", { key: '
|
|
12980
|
+
} }, index.h("svg", { key: '9c5823b8f4ab7796a34342901e1d1278a3c34537', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, index.h("circle", { key: '386e29a6dd880ae337f20ba1c4074edb7484c8f6', cx: "24", cy: "24", r: "21.5" }))));
|
|
12965
12981
|
}
|
|
12966
12982
|
};
|
|
12967
12983
|
CatSpinner.style = CatSpinnerStyle0;
|
|
@@ -12993,7 +13009,7 @@ const CatTab = class {
|
|
|
12993
13009
|
this.catClick.emit(event);
|
|
12994
13010
|
}
|
|
12995
13011
|
render() {
|
|
12996
|
-
return index.h(index.Host, { key: '
|
|
13012
|
+
return index.h(index.Host, { key: '423a9d58be83b8acccdbe72ffb0f75733dc91cc7' });
|
|
12997
13013
|
}
|
|
12998
13014
|
get hostElement() { return index.getElement(this); }
|
|
12999
13015
|
};
|
|
@@ -13057,7 +13073,7 @@ const CatTabs = class {
|
|
|
13057
13073
|
this.activate(this.tabs[index]);
|
|
13058
13074
|
}
|
|
13059
13075
|
render() {
|
|
13060
|
-
return (index.h(index.Host, { key: '
|
|
13076
|
+
return (index.h(index.Host, { key: 'b3119423d8f6cae90991af25bd6d7d6ef94b5609' }, this.tabs.map((tab) => {
|
|
13061
13077
|
return (index.h("cat-button", { buttonId: tab.id, role: "tab", part: "tab", class: {
|
|
13062
13078
|
'cat-tab': true,
|
|
13063
13079
|
'cat-tab-active': tab.id === this.activeTab,
|
|
@@ -13174,15 +13190,15 @@ const CatTextarea = class {
|
|
|
13174
13190
|
}
|
|
13175
13191
|
}
|
|
13176
13192
|
render() {
|
|
13177
|
-
return (index.h(index.Host, { key: '
|
|
13193
|
+
return (index.h(index.Host, { key: '75665cdb53070b131971482ec39853e07d2f4ca9' }, index.h("div", { key: 'a2439d68f9e7314a9f970ff10f900c4c04e23e4a', class: {
|
|
13178
13194
|
'textarea-field': true,
|
|
13179
13195
|
'textarea-horizontal': this.horizontal
|
|
13180
|
-
} }, index.h("div", { key: '
|
|
13196
|
+
} }, index.h("div", { key: 'fc3556d42d3b02cf31d83cccf03b0226d53c9517', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (index.h("label", { key: '1e7a169e766a4a349a080fab967aa6c678b27ede', htmlFor: this.id, part: "label" }, index.h("span", { key: '3658d2fc258162a3c1c635fa1b5148005d1e1bac', class: "label-wrapper" }, (this.hasSlottedLabel && index.h("slot", { key: '2ce32b2a5984547d09aa8921f9ee33b918e1aab2', name: "label" })) || this.label, index.h("div", { key: '36ef608cdee7550adc0be30270db64f3dcd4ea2e', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (index.h("span", { key: '4a7480181592a16d39db92273dd9a32fe338388a', class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (index.h("span", { key: 'de54a7e25c78c6cdc1f8683c8e5c1773714323ce', class: "label-optional", "aria-hidden": "true" }, "(", of.catI18nRegistry.t('input.required'), ")")), this.maxLength && (index.h("div", { key: '05a49aeae9c47c22c5ee0c95a5d4d1708f8aeff1', class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), index.h("div", { key: 'b2a6bc4d2f61b4a5683fd7fdf39123c8c0c4c39e', class: "textarea-container" }, index.h("div", { key: '79a4291af19da695a14b80539cfc6d6e9313ccaf', class: {
|
|
13181
13197
|
'textarea-wrapper': true,
|
|
13182
13198
|
'textarea-readonly': this.readonly,
|
|
13183
13199
|
'textarea-disabled': this.disabled,
|
|
13184
13200
|
'textarea-invalid': this.invalid
|
|
13185
|
-
} }, index.h("textarea", { key: '
|
|
13201
|
+
} }, index.h("textarea", { key: '3e06a6c68119338adf15b93d717da4a3dbc4e8cb', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, 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.invalid && (index.h("cat-icon", { key: '3845c0f84764b5f382b8e36ff90571548c057087', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (index.h(CatFormHint, { key: '564729eaa387e7b08c35415dd9ac16ad6e2c806a', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
|
|
13186
13202
|
}
|
|
13187
13203
|
get hasHint() {
|
|
13188
13204
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -13400,14 +13416,14 @@ const CatTime = class {
|
|
|
13400
13416
|
this.input?.clear();
|
|
13401
13417
|
}
|
|
13402
13418
|
render() {
|
|
13403
|
-
return (index.h(index.Host, { key: '
|
|
13419
|
+
return (index.h(index.Host, { key: '4f78a1c5d3dd09a6f7476a4fed55ba1241305b4b' }, index.h("cat-input", { key: 'e783cd952c5a9bfc1b205eabf62b4b7e42684695', class: "cat-time-input", ref: el => (this.input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.format(this.selectionTime, false), errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, index.h("span", { key: '945c465de003a32f67c6cab827afe8667c3d8436', slot: "label" }, this.hasSlottedLabel && index.h("slot", { key: '801d55325c6ec485c8519586a1fe03751b7ea4a2', name: "label" }), !this.hasSlottedLabel && this.label, index.h("span", { key: '0dacef4090d789d0a600b5db2881bd9598e38a18', class: "label-aria" }, " (HH:mm)")), index.h("div", { key: '209dfdb875dbb40a0865dde72fd4aaa217a2592f', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (index.h("cat-button", { key: 'd3b901214820efebe32769996a8aa188d3a1e3e2', class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), index.h("cat-dropdown", { key: 'b25d55512fc792bcb159e016ea71547032856aca', slot: "addon", placement: this.placement }, index.h("cat-button", { key: '5b6d1cf64a4c561b7d56ddbbaecf4e035e1ec3d4', slot: "trigger", class: "cat-time-toggle", disabled: this.disabled || this.readonly, icon: "$cat:timepicker-clock", iconOnly: true, a11yLabel: this.selectionTime ? `${this.locale.change}, ${this.format(this.selectionTime)}` : this.locale.choose }), index.h("nav", { key: 'b24b73a4374c5304b600c07c8c5f6c01e478f990', slot: "content", class: "cat-nav" }, index.h("ul", { key: '386fda017f42a0152b0095f3a107f892c425f844' }, this.timeArray().map(time => {
|
|
13404
13420
|
const isoTime = formatIso(time);
|
|
13405
13421
|
const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
|
|
13406
13422
|
return (index.h("li", null, index.h("cat-button", { class: {
|
|
13407
13423
|
'cat-nav-item': true,
|
|
13408
13424
|
'time-disabled': disabled
|
|
13409
13425
|
}, disabled: disabled, active: isoTime === this.value, color: isoTime === this.value ? 'primary' : 'secondary', variant: isoTime === this.value ? 'filled' : 'outlined', onCatClick: () => this.select(time), "data-time": isoTime }, this.format(time))));
|
|
13410
|
-
}))))), this.hasSlottedHint && (index.h("span", { key: '
|
|
13426
|
+
}))))), this.hasSlottedHint && (index.h("span", { key: 'e563a161e00cc919f39ecf663cc93065ca078f9a', slot: "hint" }, index.h("slot", { key: 'c302e5d24d005b43fe035865488318d03389d7cb', name: "hint" }))))));
|
|
13411
13427
|
}
|
|
13412
13428
|
timeArray() {
|
|
13413
13429
|
const result = [];
|
|
@@ -13525,7 +13541,7 @@ const CatToggle = class {
|
|
|
13525
13541
|
this.input.blur();
|
|
13526
13542
|
}
|
|
13527
13543
|
render() {
|
|
13528
|
-
return (index.h(index.Host, { key: '
|
|
13544
|
+
return (index.h(index.Host, { key: 'e41e7a93c56caf528e912f498da751e9a5710ba4' }, index.h("label", { key: '85521c6e6d45dc66625ba22eb3580b66544afc9c', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { key: 'a3dac924a5139b0574cbc61ae884dc59bb17e2be', ...this.nativeAttributes, part: "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), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), index.h("span", { key: 'be56569d133a4ee3d2177209bb72db2f23414748', class: "toggle" }), index.h("span", { key: '83696bea618f5b68f5ecbf1e04e27cdad09cb7da', class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { key: '05affd31e735cbf00d1e273bef672911d8b7ac42', name: "label" })) || this.label)), this.hasHint && (index.h("div", { key: '9f60cdd92373eff8d40926d5d23c359ec1aa65d6', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, index.h("div", { key: '1df00fec9243519ad820a34ddf0ff282874af215', class: "toggle-placeholder" }), index.h(CatFormHint, { key: '6bf5540c16adf497f33c51783bd624d71f18343f', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }) })))));
|
|
13529
13545
|
}
|
|
13530
13546
|
get hasHint() {
|
|
13531
13547
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -13612,12 +13628,12 @@ const CatTooltip = class {
|
|
|
13612
13628
|
}
|
|
13613
13629
|
}
|
|
13614
13630
|
render() {
|
|
13615
|
-
return (index.h(index.Host, { key: '
|
|
13631
|
+
return (index.h(index.Host, { key: '22e95841f5029e24e0ae9b08e0843fd8b8d360df' }, index.h("slot", { key: 'b9fc1e2472dc4610fe61ffc16274fa7b49510ecf' }), index.h("div", { key: 'e2971ec2746574a27b066ae9b3cece3236aa1bd9', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
|
|
13616
13632
|
tooltip: true,
|
|
13617
13633
|
'tooltip-hidden': this.inactive,
|
|
13618
13634
|
'tooltip-round': this.round,
|
|
13619
13635
|
[`tooltip-${this.size}`]: Boolean(this.size)
|
|
13620
|
-
} }, index.h("slot", { key: '
|
|
13636
|
+
} }, index.h("slot", { key: 'afbcad951679fb8d139c8415a7305f498072276c', name: "content" }, index.h("p", { key: '6e10ef094c479288a02f8b874d48206158dece38' }, this.content)))));
|
|
13621
13637
|
}
|
|
13622
13638
|
async update() {
|
|
13623
13639
|
if (this.trigger && this.tooltip) {
|