@haiilo/catalyst 10.12.0 → 10.13.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 +1 -1
- 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-751d92ed.js +3 -0
- package/dist/catalyst/p-751d92ed.js.map +1 -0
- package/dist/catalyst/p-8f350146.entry.js +10 -0
- package/dist/catalyst/p-8f350146.entry.js.map +1 -0
- package/dist/catalyst/p-e1255160.js.map +1 -1
- package/dist/catalyst/p-f4873629.js +2 -0
- package/dist/catalyst/{p-2c8ac8cf.js.map → p-f4873629.js.map} +1 -1
- package/dist/catalyst/scss/core/_dialog.scss +1 -1
- package/dist/cjs/cat-alert_29.cjs.entry.js +582 -121
- package/dist/cjs/cat-alert_29.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +9 -9
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/index-a45dd7c9.js +1383 -0
- package/dist/cjs/index-a45dd7c9.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{of-f2844da8.js → of-5cd84f84.js} +22 -22
- package/dist/cjs/{of-f2844da8.js.map → of-5cd84f84.js.map} +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/cat-alert/cat-alert.js +1 -1
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.js +0 -4
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.js +1 -1
- package/dist/collection/components/cat-button/cat-button.js +0 -4
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.js +1 -1
- package/dist/collection/components/cat-card/cat-card.js +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +1 -9
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-date/cat-date.js +3 -3
- package/dist/collection/components/cat-date-inline/cat-date-inline.js +4 -12
- 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 +2 -2
- 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-input/cat-input.js +4 -10
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-radio/cat-radio.js +1 -9
- package/dist/collection/components/cat-radio/cat-radio.js.map +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-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.js +6 -12
- 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 -9
- 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 +1 -9
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +3 -3
- package/dist/collection/scss/core/_dialog.scss +1 -1
- package/dist/components/cat-alert.js +1 -1
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-avatar2.js +0 -4
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-badge.js +1 -1
- package/dist/components/cat-button-group.js +1 -1
- package/dist/components/cat-button2.js +0 -4
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-card.js +1 -1
- package/dist/components/cat-checkbox2.js +1 -9
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-date-inline2.js +4 -12
- package/dist/components/cat-date-inline2.js.map +1 -1
- package/dist/components/cat-date.js +2 -2
- 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-icon-registry.js +21 -21
- package/dist/components/cat-icon2.js +1 -1
- package/dist/components/cat-input2.js +4 -10
- 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 +1 -9
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable2.js +3 -3
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +1 -1
- package/dist/components/cat-select2.js +5 -11
- 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 -9
- 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 +1 -9
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +2 -2
- package/dist/components/floating-ui.dom.esm.js +531 -13
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/esm/cat-alert_29.entry.js +582 -121
- package/dist/esm/cat-alert_29.entry.js.map +1 -1
- package/dist/esm/catalyst.js +10 -10
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/index-3059296e.js +1354 -0
- package/dist/esm/index-3059296e.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{of-53334b95.js → of-625babef.js} +22 -22
- package/dist/esm/{of-53334b95.js.map → of-625babef.js.map} +1 -1
- package/dist/types/components/cat-avatar/cat-avatar.d.ts +0 -1
- package/dist/types/components/cat-button/cat-button.d.ts +0 -1
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +0 -1
- package/dist/types/components/cat-date-inline/cat-date-inline.d.ts +0 -1
- package/dist/types/components/cat-radio/cat-radio.d.ts +0 -1
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +3 -8
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/package.json +16 -16
- package/dist/catalyst/p-22f0435a.js +0 -3
- package/dist/catalyst/p-22f0435a.js.map +0 -1
- package/dist/catalyst/p-2c8ac8cf.js +0 -2
- package/dist/catalyst/p-3e87007e.entry.js +0 -10
- package/dist/catalyst/p-3e87007e.entry.js.map +0 -1
- package/dist/cjs/index-66a60071.js +0 -2081
- package/dist/cjs/index-66a60071.js.map +0 -1
- package/dist/collection/utils/assert.js +0 -9
- package/dist/collection/utils/assert.js.map +0 -1
- package/dist/components/assert.js +0 -13
- package/dist/components/assert.js.map +0 -1
- package/dist/esm/index-b7832dfc.js +0 -2052
- package/dist/esm/index-b7832dfc.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/types/utils/assert.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-
|
|
2
|
-
import { e as createErrorClass, O as Observable, f as errorContext, E as EMPTY_SUBSCRIPTION, S as Subscription, g as arrRemove, h as operate, i as createOperatorSubscriber, j as innerFrom, k as executeSchedule, l as isFunction, m as identity, n as from, p as popScheduler, q as isArrayLike, r as isScheduler, s as popNumber, t as noop, u as log, a as catI18nRegistry, c as commonjsGlobal$1, d as catIconRegistry, o as of } from './of-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-3059296e.js';
|
|
2
|
+
import { e as createErrorClass, O as Observable, f as errorContext, E as EMPTY_SUBSCRIPTION, S as Subscription, g as arrRemove, h as operate, i as createOperatorSubscriber, j as innerFrom, k as executeSchedule, l as isFunction, m as identity, n as from, p as popScheduler, q as isArrayLike, r as isScheduler, s as popNumber, t as noop, u as log, a as catI18nRegistry, c as commonjsGlobal$1, d as catIconRegistry, o as of } from './of-625babef.js';
|
|
3
3
|
|
|
4
4
|
const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
|
|
5
5
|
_super(this);
|
|
@@ -819,20 +819,12 @@ const CatAlert = class {
|
|
|
819
819
|
setAttributeDefault(this, 'role', this.mapRole.get(this.color));
|
|
820
820
|
}
|
|
821
821
|
render() {
|
|
822
|
-
return (h(Host, { key: '
|
|
822
|
+
return (h(Host, { key: '7a1be6c2ec8bf0638bc0e6197f85ef2047b3e125' }, !this.noIcon && h("cat-icon", { key: '3505dc2c7c9ca0b28fc5145eab55beaedb4a2500', size: "l", icon: this.icon || this.mapIcon.get(this.color) }), h("div", { key: '6cac35c1cba20613515c75e066cfd91f5dd9670c', class: "content" }, h("slot", { key: '0d845eb31d8df70d4a0bf089fbe764a9c5359502' }))));
|
|
823
823
|
}
|
|
824
824
|
get hostElement() { return getElement(this); }
|
|
825
825
|
};
|
|
826
826
|
CatAlert.style = CatAlertStyle0;
|
|
827
827
|
|
|
828
|
-
function delayedAssertWarn(component, assertion, message, timeout = 500) {
|
|
829
|
-
window.setTimeout(() => {
|
|
830
|
-
if (!assertion()) {
|
|
831
|
-
log.warn(message, component);
|
|
832
|
-
}
|
|
833
|
-
}, timeout);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
828
|
/**
|
|
837
829
|
* Loads an image and wraps the result in a promise.
|
|
838
830
|
*
|
|
@@ -875,9 +867,6 @@ const CatAvatar = class {
|
|
|
875
867
|
componentWillLoad() {
|
|
876
868
|
this.onSrcChanged(this.src);
|
|
877
869
|
}
|
|
878
|
-
componentWillRender() {
|
|
879
|
-
delayedAssertWarn(this, () => !!this.label, '[A11y] Missing ARIA label on avatar');
|
|
880
|
-
}
|
|
881
870
|
render() {
|
|
882
871
|
if (this.url) {
|
|
883
872
|
return (h("a", { href: this.url, target: this.urlTarget, style: this.cssStyle, class: this.cssClass, "aria-label": this.label }, this.content));
|
|
@@ -927,7 +916,7 @@ const CatBadge = class {
|
|
|
927
916
|
this.pulse = false;
|
|
928
917
|
}
|
|
929
918
|
render() {
|
|
930
|
-
return h("slot", { key: '
|
|
919
|
+
return h("slot", { key: '68b23417a5826a8a39c0ed38bcae472c2d5d8c9d' });
|
|
931
920
|
}
|
|
932
921
|
get hostElement() { return getElement(this); }
|
|
933
922
|
};
|
|
@@ -1102,9 +1091,6 @@ const CatButton = class {
|
|
|
1102
1091
|
componentWillLoad() {
|
|
1103
1092
|
this.onIconOnlyChanged(this.iconOnly);
|
|
1104
1093
|
}
|
|
1105
|
-
componentWillRender() {
|
|
1106
|
-
delayedAssertWarn(this, () => !this.isIconButton || !!this.a11yLabel, '[A11y] Missing ARIA label on icon button');
|
|
1107
|
-
}
|
|
1108
1094
|
haltDisabledEvents(event) {
|
|
1109
1095
|
if (this.disabled || this.loading) {
|
|
1110
1096
|
event.preventDefault();
|
|
@@ -1224,7 +1210,7 @@ const CatButtonGroup = class {
|
|
|
1224
1210
|
this.a11yLabel = undefined;
|
|
1225
1211
|
}
|
|
1226
1212
|
render() {
|
|
1227
|
-
return (h(Host, { key: '
|
|
1213
|
+
return (h(Host, { key: 'adf2bd20526672d6b485b7f84422510e40301415', role: "group", "aria-label": this.a11yLabel }, h("slot", { key: 'cd9e705fb12cf83bc4b7a7efb65ebd7b0e2652e9', onSlotchange: this.onSlotChange.bind(this) })));
|
|
1228
1214
|
}
|
|
1229
1215
|
onSlotChange() {
|
|
1230
1216
|
this.formElements = Array.from(this.hostElement.querySelectorAll('cat-button'));
|
|
@@ -1245,7 +1231,7 @@ const CatCard = class {
|
|
|
1245
1231
|
this.catLoad = createEvent(this, "catLoad", 7);
|
|
1246
1232
|
}
|
|
1247
1233
|
render() {
|
|
1248
|
-
return h("slot", { key: '
|
|
1234
|
+
return h("slot", { key: '08f1d49357a212da833a722f733c3f654780ff41' });
|
|
1249
1235
|
}
|
|
1250
1236
|
componentDidLoad() {
|
|
1251
1237
|
this.catLoad.emit();
|
|
@@ -1305,13 +1291,6 @@ const CatCheckbox = class {
|
|
|
1305
1291
|
componentWillLoad() {
|
|
1306
1292
|
this.updateResolved();
|
|
1307
1293
|
}
|
|
1308
|
-
componentWillRender() {
|
|
1309
|
-
delayedAssertWarn(this, () => {
|
|
1310
|
-
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
1311
|
-
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
1312
|
-
return !!this.label && !!this.hasSlottedLabel;
|
|
1313
|
-
}, '[A11y] Missing ARIA label on checkbox');
|
|
1314
|
-
}
|
|
1315
1294
|
/**
|
|
1316
1295
|
* Programmatically move focus to the checkbox. Use this method instead of
|
|
1317
1296
|
* `input.focus()`.
|
|
@@ -1330,7 +1309,7 @@ const CatCheckbox = class {
|
|
|
1330
1309
|
this.input.blur();
|
|
1331
1310
|
}
|
|
1332
1311
|
render() {
|
|
1333
|
-
return (h(Host, { key: '
|
|
1312
|
+
return (h(Host, { key: 'd992e46b09bb4718045c6212eb39ac1920b7d035' }, h("label", { key: '0abc83fa25b794f8a79edd1a943a143c2faff705', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", { key: '9562082ebbb7d41afeb100f05d1e131ee8a796f5', ...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, indeterminate: this.indeterminate, 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: 'cd4e67fe4cd4c4c8346a94bc53ff9c7268b40eb8', class: "box", "aria-hidden": "true" }, h("svg", { key: '4288d465cd962a77dec305626e0122d82e4f527f', class: "check", viewBox: "0 0 12 10" }, h("polyline", { key: '487de91926ddc9f85839f33df3c1df21cb83adaa', points: "1.5 6 4.5 9 10.5 1" })), h("svg", { key: 'aa91bbf64d7c7488d2508fc3b29dbaf3c689d3a1', class: "dash", viewBox: "0 0 12 10" }, h("polyline", { key: '66db802d9ff914bc412a19ce4aacde2c7a79320a', points: "1.5 5 10.5 5" }))), h("span", { key: 'd03c3c11cd5925a39952e3ee99439f7eb0c2633f', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: '53123f708f14e1dc645d1ee2ec50395984204bef', name: "label" })) || this.label)), this.hasHint && (h("div", { key: 'aafa7081b3e8b6b1fc49656e7a90d58d3002cf2f', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: '8ef5e59d1309c37dc7372210cd7e690162b41a25', class: "box-placeholder" }), h(CatFormHint, { key: 'a396f2cb479141ddf587e50ee2ed2f76a7fb6d62', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
|
|
1334
1313
|
}
|
|
1335
1314
|
get hasHint() {
|
|
1336
1315
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -1552,13 +1531,13 @@ const CatDate = class {
|
|
|
1552
1531
|
this.input?.clear();
|
|
1553
1532
|
}
|
|
1554
1533
|
render() {
|
|
1555
|
-
return (h(Host, { key: '
|
|
1534
|
+
return (h(Host, { key: '302c4461dfbfb4bfa806bf570185b3b8310d63e4' }, h("cat-input", { key: '1b95d4b88d607a1f6358211ec1c076d1af9e08d0', class: "cat-date-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, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, value: this.inputValue, onCatFocus: e => {
|
|
1556
1535
|
e.stopPropagation();
|
|
1557
1536
|
this.catFocus.emit(e.detail);
|
|
1558
1537
|
}, onCatBlur: e => {
|
|
1559
1538
|
e.stopPropagation();
|
|
1560
1539
|
this.onInputBlur(e.detail);
|
|
1561
|
-
} }, h("span", { key: '
|
|
1540
|
+
} }, h("span", { key: 'f232c781551f8095fbdb6182ed2a754a44d59dee', slot: "label" }, this.label, h("span", { key: '5bbc5977c4744fab70fa9a7331601df10879370f', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '9104b5e8a68ab11667f640e8c5bef8c9f41f3e05', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: '308e1a09a8585798d3a7a4709163191080e0a82f', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: 'fde7d1c733a39c77dd1dc173f94899516bfe7fa0', slot: "content" }, h("cat-date-inline", { key: 'e1c22d53c4c99fd146149d50c3d867f4ea653b27', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, hint: true, weeks: true, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
|
|
1562
1541
|
}
|
|
1563
1542
|
getTriggerA11yLabel() {
|
|
1564
1543
|
const date = this.locale.fromLocalISO(this.value);
|
|
@@ -2254,13 +2233,6 @@ const CatDateInline = class {
|
|
|
2254
2233
|
this.focus(startDate, false);
|
|
2255
2234
|
}
|
|
2256
2235
|
}
|
|
2257
|
-
componentWillRender() {
|
|
2258
|
-
delayedAssertWarn(this, () => {
|
|
2259
|
-
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
2260
|
-
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
2261
|
-
return !!this.label && !!this.hasSlottedLabel;
|
|
2262
|
-
}, '[A11y] Missing ARIA label on input');
|
|
2263
|
-
}
|
|
2264
2236
|
componentDidRender() {
|
|
2265
2237
|
if (this.focusDate) {
|
|
2266
2238
|
// re-focus the previously focused date after re-render
|
|
@@ -2358,12 +2330,12 @@ const CatDateInline = class {
|
|
|
2358
2330
|
const [minDate, maxDate] = this.getMinMaxDate();
|
|
2359
2331
|
const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());
|
|
2360
2332
|
const [dateStart, dateEnd] = this.getValue();
|
|
2361
|
-
return (h(Host, { key: '
|
|
2333
|
+
return (h(Host, { key: 'fa2169799cdc21797df46449a06fa3538b481286', "aria-label": this.a11yLabel, FocusIn: () => this.a11yLabel && this.setAriaLive(this.a11yLabel) }, h("div", { key: '95f9ae98d74689c928c488e2e8924ebccae9deaa', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: 'de108b4fcbde1361f04658ca9a68809ff1f34a37', id: `${this.id}-label`, htmlFor: this.id, part: "label", onClick: () => this.doFocus() }, h("span", { key: '4fd5fe55a590decbdf7ace8d10d8216da5ed1a32', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: 'e59222221d1c7a1897c84c12e85107e6b460cf2a', name: "label" })) || this.label, h("div", { key: '1469b37e8c549e3748debb2c5beb470cfea9b983', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: 'f3a3692c210e71ec251cad75059e0a176acd876e', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: '7707a89f4d6f3d99d6c77b85a660778fce4009c2', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))))), h("div", { key: '43ab9073c35766a4faa9eded116650aa29e7d7c3', class: { picker: true, 'picker-weeks': this.weeks }, id: this.id, "aria-describedby": `${this.id}-label` }, h("div", { key: 'cc213fdedd24bff149aae56ad20903a0eef0b59f', class: "picker-head" }, h("cat-button", { key: 'fd74cf7796cc3523a643f0851df6375c498b8d6c', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), h("cat-button", { key: 'b8073b0dd3057c0d50174f546d188b90853938c1', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), h("h3", { key: '55c304c724d755374579c745679fef9783f51346' }, this.getHeadline()), h("cat-button", { key: '2eb82ee8702d7f63ef96681b54d5c147261550d3', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), h("cat-button", { key: 'e65f47d327e241d75ef29072412c267afa222a81', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), h("div", { key: '6c334ab997639ba426a984fedc39e8afc24c8ef8', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, h("div", { key: '9ee6363a2f517d120870a5ec9aa573333e2caef7', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => {
|
|
2362
2334
|
const day = (i + this.locale.weekInfo.firstDay) % 7;
|
|
2363
2335
|
return h("abbr", { title: this.locale.days.long[day] }, this.locale.days.short[day]);
|
|
2364
|
-
})), this.weeks && (h("div", { class: "picker-grid-weeks" }, dateGrid
|
|
2336
|
+
})), this.weeks && (h("div", { key: '0d82b2fa4cfbb1c9ca38ea447b9a3ccdd8ff4ea6', class: "picker-grid-weeks" }, dateGrid
|
|
2365
2337
|
.filter((_, i) => i % 7 === 0)
|
|
2366
|
-
.map(day => (h("div", null, this.getWeekNumber(day)))))), h("div", { key: '
|
|
2338
|
+
.map(day => (h("div", null, this.getWeekNumber(day)))))), h("div", { key: 'f88d1120c200ed2f83546872174b4d15c723552a', class: "picker-grid-days" }, dateGrid.map(day => {
|
|
2367
2339
|
const isStartDate = isSameDay(dateStart, day);
|
|
2368
2340
|
const isEndDate = isSameDay(dateEnd, day);
|
|
2369
2341
|
const isRange = !!dateStart && !!dateEnd && day > dateStart && day < dateEnd;
|
|
@@ -2380,7 +2352,7 @@ const CatDateInline = class {
|
|
|
2380
2352
|
'date-focusable': this.canFocus(day),
|
|
2381
2353
|
'date-disabled': !this.canClick(day)
|
|
2382
2354
|
}, nativeAttributes: !this.canFocus(day) ? { tabindex: '-1' } : {}, variant: isStartDate || isEndDate ? 'filled' : isToday ? 'outlined' : 'text', a11yLabel: this.locale.toLocalStr(day), active: isStartDate || isEndDate || isRange, color: isStartDate || isEndDate || isToday ? 'primary' : 'secondary', disabled: !this.canClick(day), onClick: () => this.select(day), "data-date": this.locale.toLocalISO(day) }, day.getDate()));
|
|
2383
|
-
}))), h("div", { key: '
|
|
2355
|
+
}))), h("div", { key: '50d3734a13b4b45dc74bfb7d8d0ba2540f39fb6a', class: "picker-foot" }, !this.noToday && this.canClick(this.locale.now()) && (h("cat-button", { key: '8af97da412bcd88e9c967e2c636ff6d5f61f434e', size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.locale.now()) }, this.locale.today)), this.hint && h("p", { key: '34434a1523cbc88106b859a2eb5d0a4fd78212bf', class: "cursor-help" }, this.locale.arrowKeys), !this.noClear && (h("cat-button", { key: '7febb5a8cf664ea399b3b2940d1dfdf85f353200', size: "s", disabled: !this.value, "data-dropdown-no-close": true, onClick: () => this.clear() }, this.locale.clear)))), h("p", { key: 'bb2b8c0fa92cda41a170e1ebe83bcac55325b7aa', class: "cursor-aria", "aria-live": "polite" })));
|
|
2384
2356
|
}
|
|
2385
2357
|
focus(date, focus = true) {
|
|
2386
2358
|
const [minDate, maxDate] = this.getMinMaxDate();
|
|
@@ -5294,6 +5266,10 @@ function getLocale$1(language) {
|
|
|
5294
5266
|
* Custom positioning reference element.
|
|
5295
5267
|
* @see https://floating-ui.com/docs/virtual-elements
|
|
5296
5268
|
*/
|
|
5269
|
+
|
|
5270
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
5271
|
+
const alignments = ['start', 'end'];
|
|
5272
|
+
const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
5297
5273
|
const min = Math.min;
|
|
5298
5274
|
const max = Math.max;
|
|
5299
5275
|
const round = Math.round;
|
|
@@ -5625,6 +5601,191 @@ async function detectOverflow(state, options) {
|
|
|
5625
5601
|
};
|
|
5626
5602
|
}
|
|
5627
5603
|
|
|
5604
|
+
/**
|
|
5605
|
+
* Provides data to position an inner element of the floating element so that it
|
|
5606
|
+
* appears centered to the reference element.
|
|
5607
|
+
* @see https://floating-ui.com/docs/arrow
|
|
5608
|
+
*/
|
|
5609
|
+
const arrow = options => ({
|
|
5610
|
+
name: 'arrow',
|
|
5611
|
+
options,
|
|
5612
|
+
async fn(state) {
|
|
5613
|
+
const {
|
|
5614
|
+
x,
|
|
5615
|
+
y,
|
|
5616
|
+
placement,
|
|
5617
|
+
rects,
|
|
5618
|
+
platform,
|
|
5619
|
+
elements,
|
|
5620
|
+
middlewareData
|
|
5621
|
+
} = state;
|
|
5622
|
+
// Since `element` is required, we don't Partial<> the type.
|
|
5623
|
+
const {
|
|
5624
|
+
element,
|
|
5625
|
+
padding = 0
|
|
5626
|
+
} = evaluate(options, state) || {};
|
|
5627
|
+
if (element == null) {
|
|
5628
|
+
return {};
|
|
5629
|
+
}
|
|
5630
|
+
const paddingObject = getPaddingObject(padding);
|
|
5631
|
+
const coords = {
|
|
5632
|
+
x,
|
|
5633
|
+
y
|
|
5634
|
+
};
|
|
5635
|
+
const axis = getAlignmentAxis(placement);
|
|
5636
|
+
const length = getAxisLength(axis);
|
|
5637
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
5638
|
+
const isYAxis = axis === 'y';
|
|
5639
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
5640
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
5641
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
5642
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
5643
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
5644
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
5645
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
5646
|
+
|
|
5647
|
+
// DOM platform can return `window` as the `offsetParent`.
|
|
5648
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
5649
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
5650
|
+
}
|
|
5651
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
5652
|
+
|
|
5653
|
+
// If the padding is large enough that it causes the arrow to no longer be
|
|
5654
|
+
// centered, modify the padding so that it is centered.
|
|
5655
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
5656
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
5657
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
5658
|
+
|
|
5659
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
|
5660
|
+
// point is outside the floating element's bounds.
|
|
5661
|
+
const min$1 = minPadding;
|
|
5662
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
5663
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
5664
|
+
const offset = clamp(min$1, center, max);
|
|
5665
|
+
|
|
5666
|
+
// If the reference is small enough that the arrow's padding causes it to
|
|
5667
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
5668
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
|
5669
|
+
// a single reset is performed when this is true.
|
|
5670
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
5671
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
5672
|
+
return {
|
|
5673
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
5674
|
+
data: {
|
|
5675
|
+
[axis]: offset,
|
|
5676
|
+
centerOffset: center - offset - alignmentOffset,
|
|
5677
|
+
...(shouldAddOffset && {
|
|
5678
|
+
alignmentOffset
|
|
5679
|
+
})
|
|
5680
|
+
},
|
|
5681
|
+
reset: shouldAddOffset
|
|
5682
|
+
};
|
|
5683
|
+
}
|
|
5684
|
+
});
|
|
5685
|
+
|
|
5686
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
5687
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
5688
|
+
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
5689
|
+
if (alignment) {
|
|
5690
|
+
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
5691
|
+
}
|
|
5692
|
+
return true;
|
|
5693
|
+
});
|
|
5694
|
+
}
|
|
5695
|
+
/**
|
|
5696
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
5697
|
+
* that has the most space available automatically, without needing to specify a
|
|
5698
|
+
* preferred placement. Alternative to `flip`.
|
|
5699
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
5700
|
+
*/
|
|
5701
|
+
const autoPlacement = function (options) {
|
|
5702
|
+
if (options === void 0) {
|
|
5703
|
+
options = {};
|
|
5704
|
+
}
|
|
5705
|
+
return {
|
|
5706
|
+
name: 'autoPlacement',
|
|
5707
|
+
options,
|
|
5708
|
+
async fn(state) {
|
|
5709
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
|
5710
|
+
const {
|
|
5711
|
+
rects,
|
|
5712
|
+
middlewareData,
|
|
5713
|
+
placement,
|
|
5714
|
+
platform,
|
|
5715
|
+
elements
|
|
5716
|
+
} = state;
|
|
5717
|
+
const {
|
|
5718
|
+
crossAxis = false,
|
|
5719
|
+
alignment,
|
|
5720
|
+
allowedPlacements = placements,
|
|
5721
|
+
autoAlignment = true,
|
|
5722
|
+
...detectOverflowOptions
|
|
5723
|
+
} = evaluate(options, state);
|
|
5724
|
+
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
5725
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
5726
|
+
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
5727
|
+
const currentPlacement = placements$1[currentIndex];
|
|
5728
|
+
if (currentPlacement == null) {
|
|
5729
|
+
return {};
|
|
5730
|
+
}
|
|
5731
|
+
const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
5732
|
+
|
|
5733
|
+
// Make `computeCoords` start from the right place.
|
|
5734
|
+
if (placement !== currentPlacement) {
|
|
5735
|
+
return {
|
|
5736
|
+
reset: {
|
|
5737
|
+
placement: placements$1[0]
|
|
5738
|
+
}
|
|
5739
|
+
};
|
|
5740
|
+
}
|
|
5741
|
+
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
|
|
5742
|
+
const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
|
|
5743
|
+
placement: currentPlacement,
|
|
5744
|
+
overflows: currentOverflows
|
|
5745
|
+
}];
|
|
5746
|
+
const nextPlacement = placements$1[currentIndex + 1];
|
|
5747
|
+
|
|
5748
|
+
// There are more placements to check.
|
|
5749
|
+
if (nextPlacement) {
|
|
5750
|
+
return {
|
|
5751
|
+
data: {
|
|
5752
|
+
index: currentIndex + 1,
|
|
5753
|
+
overflows: allOverflows
|
|
5754
|
+
},
|
|
5755
|
+
reset: {
|
|
5756
|
+
placement: nextPlacement
|
|
5757
|
+
}
|
|
5758
|
+
};
|
|
5759
|
+
}
|
|
5760
|
+
const placementsSortedByMostSpace = allOverflows.map(d => {
|
|
5761
|
+
const alignment = getAlignment(d.placement);
|
|
5762
|
+
return [d.placement, alignment && crossAxis ?
|
|
5763
|
+
// Check along the mainAxis and main crossAxis side.
|
|
5764
|
+
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
|
|
5765
|
+
// Check only the mainAxis.
|
|
5766
|
+
d.overflows[0], d.overflows];
|
|
5767
|
+
}).sort((a, b) => a[1] - b[1]);
|
|
5768
|
+
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
|
|
5769
|
+
// Aligned placements should not check their opposite crossAxis
|
|
5770
|
+
// side.
|
|
5771
|
+
getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
|
|
5772
|
+
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
5773
|
+
if (resetPlacement !== placement) {
|
|
5774
|
+
return {
|
|
5775
|
+
data: {
|
|
5776
|
+
index: currentIndex + 1,
|
|
5777
|
+
overflows: allOverflows
|
|
5778
|
+
},
|
|
5779
|
+
reset: {
|
|
5780
|
+
placement: resetPlacement
|
|
5781
|
+
}
|
|
5782
|
+
};
|
|
5783
|
+
}
|
|
5784
|
+
return {};
|
|
5785
|
+
}
|
|
5786
|
+
};
|
|
5787
|
+
};
|
|
5788
|
+
|
|
5628
5789
|
/**
|
|
5629
5790
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
5630
5791
|
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
@@ -5740,6 +5901,206 @@ const flip$1 = function (options) {
|
|
|
5740
5901
|
};
|
|
5741
5902
|
};
|
|
5742
5903
|
|
|
5904
|
+
function getSideOffsets(overflow, rect) {
|
|
5905
|
+
return {
|
|
5906
|
+
top: overflow.top - rect.height,
|
|
5907
|
+
right: overflow.right - rect.width,
|
|
5908
|
+
bottom: overflow.bottom - rect.height,
|
|
5909
|
+
left: overflow.left - rect.width
|
|
5910
|
+
};
|
|
5911
|
+
}
|
|
5912
|
+
function isAnySideFullyClipped(overflow) {
|
|
5913
|
+
return sides.some(side => overflow[side] >= 0);
|
|
5914
|
+
}
|
|
5915
|
+
/**
|
|
5916
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
5917
|
+
* when it is not in the same clipping context as the reference element.
|
|
5918
|
+
* @see https://floating-ui.com/docs/hide
|
|
5919
|
+
*/
|
|
5920
|
+
const hide = function (options) {
|
|
5921
|
+
if (options === void 0) {
|
|
5922
|
+
options = {};
|
|
5923
|
+
}
|
|
5924
|
+
return {
|
|
5925
|
+
name: 'hide',
|
|
5926
|
+
options,
|
|
5927
|
+
async fn(state) {
|
|
5928
|
+
const {
|
|
5929
|
+
rects
|
|
5930
|
+
} = state;
|
|
5931
|
+
const {
|
|
5932
|
+
strategy = 'referenceHidden',
|
|
5933
|
+
...detectOverflowOptions
|
|
5934
|
+
} = evaluate(options, state);
|
|
5935
|
+
switch (strategy) {
|
|
5936
|
+
case 'referenceHidden':
|
|
5937
|
+
{
|
|
5938
|
+
const overflow = await detectOverflow(state, {
|
|
5939
|
+
...detectOverflowOptions,
|
|
5940
|
+
elementContext: 'reference'
|
|
5941
|
+
});
|
|
5942
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
5943
|
+
return {
|
|
5944
|
+
data: {
|
|
5945
|
+
referenceHiddenOffsets: offsets,
|
|
5946
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
5947
|
+
}
|
|
5948
|
+
};
|
|
5949
|
+
}
|
|
5950
|
+
case 'escaped':
|
|
5951
|
+
{
|
|
5952
|
+
const overflow = await detectOverflow(state, {
|
|
5953
|
+
...detectOverflowOptions,
|
|
5954
|
+
altBoundary: true
|
|
5955
|
+
});
|
|
5956
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
5957
|
+
return {
|
|
5958
|
+
data: {
|
|
5959
|
+
escapedOffsets: offsets,
|
|
5960
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
5961
|
+
}
|
|
5962
|
+
};
|
|
5963
|
+
}
|
|
5964
|
+
default:
|
|
5965
|
+
{
|
|
5966
|
+
return {};
|
|
5967
|
+
}
|
|
5968
|
+
}
|
|
5969
|
+
}
|
|
5970
|
+
};
|
|
5971
|
+
};
|
|
5972
|
+
|
|
5973
|
+
function getBoundingRect(rects) {
|
|
5974
|
+
const minX = min(...rects.map(rect => rect.left));
|
|
5975
|
+
const minY = min(...rects.map(rect => rect.top));
|
|
5976
|
+
const maxX = max(...rects.map(rect => rect.right));
|
|
5977
|
+
const maxY = max(...rects.map(rect => rect.bottom));
|
|
5978
|
+
return {
|
|
5979
|
+
x: minX,
|
|
5980
|
+
y: minY,
|
|
5981
|
+
width: maxX - minX,
|
|
5982
|
+
height: maxY - minY
|
|
5983
|
+
};
|
|
5984
|
+
}
|
|
5985
|
+
function getRectsByLine(rects) {
|
|
5986
|
+
const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
|
|
5987
|
+
const groups = [];
|
|
5988
|
+
let prevRect = null;
|
|
5989
|
+
for (let i = 0; i < sortedRects.length; i++) {
|
|
5990
|
+
const rect = sortedRects[i];
|
|
5991
|
+
if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
|
|
5992
|
+
groups.push([rect]);
|
|
5993
|
+
} else {
|
|
5994
|
+
groups[groups.length - 1].push(rect);
|
|
5995
|
+
}
|
|
5996
|
+
prevRect = rect;
|
|
5997
|
+
}
|
|
5998
|
+
return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
|
|
5999
|
+
}
|
|
6000
|
+
/**
|
|
6001
|
+
* Provides improved positioning for inline reference elements that can span
|
|
6002
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
6003
|
+
* @see https://floating-ui.com/docs/inline
|
|
6004
|
+
*/
|
|
6005
|
+
const inline = function (options) {
|
|
6006
|
+
if (options === void 0) {
|
|
6007
|
+
options = {};
|
|
6008
|
+
}
|
|
6009
|
+
return {
|
|
6010
|
+
name: 'inline',
|
|
6011
|
+
options,
|
|
6012
|
+
async fn(state) {
|
|
6013
|
+
const {
|
|
6014
|
+
placement,
|
|
6015
|
+
elements,
|
|
6016
|
+
rects,
|
|
6017
|
+
platform,
|
|
6018
|
+
strategy
|
|
6019
|
+
} = state;
|
|
6020
|
+
// A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
|
6021
|
+
// ClientRect's bounds, despite the event listener being triggered. A
|
|
6022
|
+
// padding of 2 seems to handle this issue.
|
|
6023
|
+
const {
|
|
6024
|
+
padding = 2,
|
|
6025
|
+
x,
|
|
6026
|
+
y
|
|
6027
|
+
} = evaluate(options, state);
|
|
6028
|
+
const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
|
|
6029
|
+
const clientRects = getRectsByLine(nativeClientRects);
|
|
6030
|
+
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
6031
|
+
const paddingObject = getPaddingObject(padding);
|
|
6032
|
+
function getBoundingClientRect() {
|
|
6033
|
+
// There are two rects and they are disjoined.
|
|
6034
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
6035
|
+
// Find the first rect in which the point is fully inside.
|
|
6036
|
+
return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
6037
|
+
}
|
|
6038
|
+
|
|
6039
|
+
// There are 2 or more connected rects.
|
|
6040
|
+
if (clientRects.length >= 2) {
|
|
6041
|
+
if (getSideAxis(placement) === 'y') {
|
|
6042
|
+
const firstRect = clientRects[0];
|
|
6043
|
+
const lastRect = clientRects[clientRects.length - 1];
|
|
6044
|
+
const isTop = getSide(placement) === 'top';
|
|
6045
|
+
const top = firstRect.top;
|
|
6046
|
+
const bottom = lastRect.bottom;
|
|
6047
|
+
const left = isTop ? firstRect.left : lastRect.left;
|
|
6048
|
+
const right = isTop ? firstRect.right : lastRect.right;
|
|
6049
|
+
const width = right - left;
|
|
6050
|
+
const height = bottom - top;
|
|
6051
|
+
return {
|
|
6052
|
+
top,
|
|
6053
|
+
bottom,
|
|
6054
|
+
left,
|
|
6055
|
+
right,
|
|
6056
|
+
width,
|
|
6057
|
+
height,
|
|
6058
|
+
x: left,
|
|
6059
|
+
y: top
|
|
6060
|
+
};
|
|
6061
|
+
}
|
|
6062
|
+
const isLeftSide = getSide(placement) === 'left';
|
|
6063
|
+
const maxRight = max(...clientRects.map(rect => rect.right));
|
|
6064
|
+
const minLeft = min(...clientRects.map(rect => rect.left));
|
|
6065
|
+
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
6066
|
+
const top = measureRects[0].top;
|
|
6067
|
+
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
6068
|
+
const left = minLeft;
|
|
6069
|
+
const right = maxRight;
|
|
6070
|
+
const width = right - left;
|
|
6071
|
+
const height = bottom - top;
|
|
6072
|
+
return {
|
|
6073
|
+
top,
|
|
6074
|
+
bottom,
|
|
6075
|
+
left,
|
|
6076
|
+
right,
|
|
6077
|
+
width,
|
|
6078
|
+
height,
|
|
6079
|
+
x: left,
|
|
6080
|
+
y: top
|
|
6081
|
+
};
|
|
6082
|
+
}
|
|
6083
|
+
return fallback;
|
|
6084
|
+
}
|
|
6085
|
+
const resetRects = await platform.getElementRects({
|
|
6086
|
+
reference: {
|
|
6087
|
+
getBoundingClientRect
|
|
6088
|
+
},
|
|
6089
|
+
floating: elements.floating,
|
|
6090
|
+
strategy
|
|
6091
|
+
});
|
|
6092
|
+
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
|
6093
|
+
return {
|
|
6094
|
+
reset: {
|
|
6095
|
+
rects: resetRects
|
|
6096
|
+
}
|
|
6097
|
+
};
|
|
6098
|
+
}
|
|
6099
|
+
return {};
|
|
6100
|
+
}
|
|
6101
|
+
};
|
|
6102
|
+
};
|
|
6103
|
+
|
|
5743
6104
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
5744
6105
|
// Derivable.
|
|
5745
6106
|
|
|
@@ -5789,7 +6150,7 @@ async function convertValueToCoords(state, options) {
|
|
|
5789
6150
|
* object may be passed.
|
|
5790
6151
|
* @see https://floating-ui.com/docs/offset
|
|
5791
6152
|
*/
|
|
5792
|
-
const offset = function (options) {
|
|
6153
|
+
const offset$1 = function (options) {
|
|
5793
6154
|
if (options === void 0) {
|
|
5794
6155
|
options = 0;
|
|
5795
6156
|
}
|
|
@@ -5896,6 +6257,74 @@ const shift$1 = function (options) {
|
|
|
5896
6257
|
}
|
|
5897
6258
|
};
|
|
5898
6259
|
};
|
|
6260
|
+
/**
|
|
6261
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
6262
|
+
*/
|
|
6263
|
+
const limitShift = function (options) {
|
|
6264
|
+
if (options === void 0) {
|
|
6265
|
+
options = {};
|
|
6266
|
+
}
|
|
6267
|
+
return {
|
|
6268
|
+
options,
|
|
6269
|
+
fn(state) {
|
|
6270
|
+
const {
|
|
6271
|
+
x,
|
|
6272
|
+
y,
|
|
6273
|
+
placement,
|
|
6274
|
+
rects,
|
|
6275
|
+
middlewareData
|
|
6276
|
+
} = state;
|
|
6277
|
+
const {
|
|
6278
|
+
offset = 0,
|
|
6279
|
+
mainAxis: checkMainAxis = true,
|
|
6280
|
+
crossAxis: checkCrossAxis = true
|
|
6281
|
+
} = evaluate(options, state);
|
|
6282
|
+
const coords = {
|
|
6283
|
+
x,
|
|
6284
|
+
y
|
|
6285
|
+
};
|
|
6286
|
+
const crossAxis = getSideAxis(placement);
|
|
6287
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
6288
|
+
let mainAxisCoord = coords[mainAxis];
|
|
6289
|
+
let crossAxisCoord = coords[crossAxis];
|
|
6290
|
+
const rawOffset = evaluate(offset, state);
|
|
6291
|
+
const computedOffset = typeof rawOffset === 'number' ? {
|
|
6292
|
+
mainAxis: rawOffset,
|
|
6293
|
+
crossAxis: 0
|
|
6294
|
+
} : {
|
|
6295
|
+
mainAxis: 0,
|
|
6296
|
+
crossAxis: 0,
|
|
6297
|
+
...rawOffset
|
|
6298
|
+
};
|
|
6299
|
+
if (checkMainAxis) {
|
|
6300
|
+
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
6301
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
6302
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
6303
|
+
if (mainAxisCoord < limitMin) {
|
|
6304
|
+
mainAxisCoord = limitMin;
|
|
6305
|
+
} else if (mainAxisCoord > limitMax) {
|
|
6306
|
+
mainAxisCoord = limitMax;
|
|
6307
|
+
}
|
|
6308
|
+
}
|
|
6309
|
+
if (checkCrossAxis) {
|
|
6310
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
6311
|
+
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
6312
|
+
const isOriginSide = ['top', 'left'].includes(getSide(placement));
|
|
6313
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
6314
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
6315
|
+
if (crossAxisCoord < limitMin) {
|
|
6316
|
+
crossAxisCoord = limitMin;
|
|
6317
|
+
} else if (crossAxisCoord > limitMax) {
|
|
6318
|
+
crossAxisCoord = limitMax;
|
|
6319
|
+
}
|
|
6320
|
+
}
|
|
6321
|
+
return {
|
|
6322
|
+
[mainAxis]: mainAxisCoord,
|
|
6323
|
+
[crossAxis]: crossAxisCoord
|
|
6324
|
+
};
|
|
6325
|
+
}
|
|
6326
|
+
};
|
|
6327
|
+
};
|
|
5899
6328
|
|
|
5900
6329
|
/**
|
|
5901
6330
|
* Provides data that allows you to change the size of the floating element —
|
|
@@ -6234,10 +6663,10 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
6234
6663
|
}
|
|
6235
6664
|
|
|
6236
6665
|
const topLayerSelectors = [':popover-open', ':modal'];
|
|
6237
|
-
function isTopLayer(
|
|
6666
|
+
function isTopLayer(element) {
|
|
6238
6667
|
return topLayerSelectors.some(selector => {
|
|
6239
6668
|
try {
|
|
6240
|
-
return
|
|
6669
|
+
return element.matches(selector);
|
|
6241
6670
|
} catch (e) {
|
|
6242
6671
|
return false;
|
|
6243
6672
|
}
|
|
@@ -6425,7 +6854,7 @@ function getClippingRect(_ref) {
|
|
|
6425
6854
|
rootBoundary,
|
|
6426
6855
|
strategy
|
|
6427
6856
|
} = _ref;
|
|
6428
|
-
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
6857
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
6429
6858
|
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
6430
6859
|
const firstClippingAncestor = clippingAncestors[0];
|
|
6431
6860
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
@@ -6487,6 +6916,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
6487
6916
|
};
|
|
6488
6917
|
}
|
|
6489
6918
|
|
|
6919
|
+
function isStaticPositioned(element) {
|
|
6920
|
+
return getComputedStyle$1(element).position === 'static';
|
|
6921
|
+
}
|
|
6922
|
+
|
|
6490
6923
|
function getTrueOffsetParent(element, polyfill) {
|
|
6491
6924
|
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
6492
6925
|
return null;
|
|
@@ -6500,29 +6933,41 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
6500
6933
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
6501
6934
|
// such as table ancestors and cross browser bugs.
|
|
6502
6935
|
function getOffsetParent(element, polyfill) {
|
|
6503
|
-
const
|
|
6504
|
-
if (
|
|
6505
|
-
return
|
|
6936
|
+
const win = getWindow(element);
|
|
6937
|
+
if (isTopLayer(element)) {
|
|
6938
|
+
return win;
|
|
6939
|
+
}
|
|
6940
|
+
if (!isHTMLElement(element)) {
|
|
6941
|
+
let svgOffsetParent = getParentNode(element);
|
|
6942
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
6943
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
6944
|
+
return svgOffsetParent;
|
|
6945
|
+
}
|
|
6946
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
6947
|
+
}
|
|
6948
|
+
return win;
|
|
6506
6949
|
}
|
|
6507
6950
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
6508
|
-
while (offsetParent && isTableElement(offsetParent) &&
|
|
6951
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
6509
6952
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
6510
6953
|
}
|
|
6511
|
-
if (offsetParent && (
|
|
6512
|
-
return
|
|
6954
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
6955
|
+
return win;
|
|
6513
6956
|
}
|
|
6514
|
-
return offsetParent || getContainingBlock(element) ||
|
|
6957
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
6515
6958
|
}
|
|
6516
6959
|
|
|
6517
6960
|
const getElementRects = async function (data) {
|
|
6518
6961
|
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
6519
6962
|
const getDimensionsFn = this.getDimensions;
|
|
6963
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
6520
6964
|
return {
|
|
6521
6965
|
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
6522
6966
|
floating: {
|
|
6523
6967
|
x: 0,
|
|
6524
6968
|
y: 0,
|
|
6525
|
-
|
|
6969
|
+
width: floatingDimensions.width,
|
|
6970
|
+
height: floatingDimensions.height
|
|
6526
6971
|
}
|
|
6527
6972
|
};
|
|
6528
6973
|
};
|
|
@@ -6592,9 +7037,11 @@ function observeMove(element, onMove) {
|
|
|
6592
7037
|
return refresh();
|
|
6593
7038
|
}
|
|
6594
7039
|
if (!ratio) {
|
|
7040
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
7041
|
+
// to prevent an infinite loop of updates.
|
|
6595
7042
|
timeoutId = setTimeout(() => {
|
|
6596
7043
|
refresh(false, 1e-7);
|
|
6597
|
-
},
|
|
7044
|
+
}, 1000);
|
|
6598
7045
|
} else {
|
|
6599
7046
|
refresh(false, ratio);
|
|
6600
7047
|
}
|
|
@@ -6698,6 +7145,23 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
6698
7145
|
};
|
|
6699
7146
|
}
|
|
6700
7147
|
|
|
7148
|
+
/**
|
|
7149
|
+
* Modifies the placement by translating the floating element along the
|
|
7150
|
+
* specified axes.
|
|
7151
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
7152
|
+
* object may be passed.
|
|
7153
|
+
* @see https://floating-ui.com/docs/offset
|
|
7154
|
+
*/
|
|
7155
|
+
const offset = offset$1;
|
|
7156
|
+
|
|
7157
|
+
/**
|
|
7158
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
7159
|
+
* that has the most space available automatically, without needing to specify a
|
|
7160
|
+
* preferred placement. Alternative to `flip`.
|
|
7161
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
7162
|
+
*/
|
|
7163
|
+
autoPlacement;
|
|
7164
|
+
|
|
6701
7165
|
/**
|
|
6702
7166
|
* Optimizes the visibility of the floating element by shifting it in order to
|
|
6703
7167
|
* keep it in view when it will overflow the clipping boundary.
|
|
@@ -6721,6 +7185,32 @@ const flip = flip$1;
|
|
|
6721
7185
|
*/
|
|
6722
7186
|
const size = size$1;
|
|
6723
7187
|
|
|
7188
|
+
/**
|
|
7189
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
7190
|
+
* when it is not in the same clipping context as the reference element.
|
|
7191
|
+
* @see https://floating-ui.com/docs/hide
|
|
7192
|
+
*/
|
|
7193
|
+
hide;
|
|
7194
|
+
|
|
7195
|
+
/**
|
|
7196
|
+
* Provides data to position an inner element of the floating element so that it
|
|
7197
|
+
* appears centered to the reference element.
|
|
7198
|
+
* @see https://floating-ui.com/docs/arrow
|
|
7199
|
+
*/
|
|
7200
|
+
arrow;
|
|
7201
|
+
|
|
7202
|
+
/**
|
|
7203
|
+
* Provides improved positioning for inline reference elements that can span
|
|
7204
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
7205
|
+
* @see https://floating-ui.com/docs/inline
|
|
7206
|
+
*/
|
|
7207
|
+
inline;
|
|
7208
|
+
|
|
7209
|
+
/**
|
|
7210
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
7211
|
+
*/
|
|
7212
|
+
limitShift;
|
|
7213
|
+
|
|
6724
7214
|
/**
|
|
6725
7215
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
6726
7216
|
* next to a given reference element.
|
|
@@ -6845,7 +7335,7 @@ const CatDatepickerFlat = class {
|
|
|
6845
7335
|
}
|
|
6846
7336
|
render() {
|
|
6847
7337
|
return [
|
|
6848
|
-
h("cat-input", { key: '
|
|
7338
|
+
h("cat-input", { key: '1f60758f6fc4ca114bea5c8cfcec32763cac649f', 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.value, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatChange: e => {
|
|
6849
7339
|
e.stopPropagation();
|
|
6850
7340
|
this.value = e.detail || undefined;
|
|
6851
7341
|
}, onCatFocus: e => {
|
|
@@ -6854,8 +7344,8 @@ const CatDatepickerFlat = class {
|
|
|
6854
7344
|
}, onCatBlur: e => {
|
|
6855
7345
|
e.stopPropagation();
|
|
6856
7346
|
this.catBlur.emit(e.detail);
|
|
6857
|
-
} }, this.hasSlottedLabel && (h("span", { slot: "label" }, h("slot", { name: "label" }))), this.hasSlottedHint && (h("span", { slot: "hint" }, h("slot", { name: "hint" })))),
|
|
6858
|
-
h("div", { key: '
|
|
7347
|
+
} }, this.hasSlottedLabel && (h("span", { key: '271ad004aa697563085fb57e1633c3a67a7f4f70', slot: "label" }, h("slot", { key: 'c861a52fcae08849a0f300eeb4587aa601699dc1', name: "label" }))), this.hasSlottedHint && (h("span", { key: 'dd7569a837fc0ee50e4f493a681659843e0cff7e', slot: "hint" }, h("slot", { key: 'bf6b53c72d931d125ab11470a189ea7131c40973', name: "hint" })))),
|
|
7348
|
+
h("div", { key: 'fec506ba4d9cc99aa4ab2164945af6a52fc97041', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
|
|
6859
7349
|
];
|
|
6860
7350
|
}
|
|
6861
7351
|
initDatepicker(input) {
|
|
@@ -6958,11 +7448,11 @@ const CatDatepickerInline = class {
|
|
|
6958
7448
|
this.pickr = this.initDatepicker(this.input);
|
|
6959
7449
|
}
|
|
6960
7450
|
render() {
|
|
6961
|
-
return (h(Host, { key: '
|
|
7451
|
+
return (h(Host, { key: 'a99a043dd25944a4e4488c6ff65407370a94a541' }, h("div", { key: 'cce3869c564103b2c38a6f0148d97d76947fcb44', tabIndex: this.disabled || this.readonly ? -1 : undefined, class: {
|
|
6962
7452
|
'datepicker-wrapper': true,
|
|
6963
7453
|
'datepicker-disabled': this.disabled,
|
|
6964
7454
|
'datepicker-readonly': this.readonly
|
|
6965
|
-
} }, h("input", { key: '
|
|
7455
|
+
} }, h("input", { key: 'ba7e41cc8561b4f63433cc52af83cc74db260327', ref: el => (this.input = el), value: this.value, disabled: this.disabled, readonly: this.readonly }))));
|
|
6966
7456
|
}
|
|
6967
7457
|
initDatepicker(input) {
|
|
6968
7458
|
if (!input) {
|
|
@@ -8050,7 +8540,7 @@ const CatDropdown = class {
|
|
|
8050
8540
|
}, timeTransitionS);
|
|
8051
8541
|
}
|
|
8052
8542
|
render() {
|
|
8053
|
-
return (h(Host, { key: '
|
|
8543
|
+
return (h(Host, { key: 'ecbe6c25380b7e553dd81932af3faf7871e60650' }, h("slot", { key: '2c067a4bcbcb5491b1eb9c939b9f4ca1e13f4bf9', name: "trigger", ref: el => (this.triggerSlot = el) }), h("div", { key: '74c96accb106aba04746eb200ca2a57642828b2b', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, h("slot", { key: '064f79e0d0c636f087b0185f0813cfb263fc7832', name: "content" }))));
|
|
8054
8544
|
}
|
|
8055
8545
|
get contentId() {
|
|
8056
8546
|
return `cat-dropdown-${this.id}`;
|
|
@@ -8136,7 +8626,7 @@ const CatFormGroup = class {
|
|
|
8136
8626
|
});
|
|
8137
8627
|
}
|
|
8138
8628
|
render() {
|
|
8139
|
-
return (h(Host, { key: '
|
|
8629
|
+
return (h(Host, { key: '89edc92669abb1c9a1f4c5ed47830371a5f315bd', style: { '--label-size': this.labelSize } }, h("slot", { key: '451878b08d2ca7cfece502b00b14f2da3c274d88', onSlotchange: this.onSlotChange.bind(this) })));
|
|
8140
8630
|
}
|
|
8141
8631
|
onSlotChange() {
|
|
8142
8632
|
this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker'));
|
|
@@ -8168,7 +8658,7 @@ const CatIcon = class {
|
|
|
8168
8658
|
this.a11yLabel = undefined;
|
|
8169
8659
|
}
|
|
8170
8660
|
render() {
|
|
8171
|
-
return (h("span", { key: '
|
|
8661
|
+
return (h("span", { key: '03076f9f5e7335d8c42b1802e78ad24afa459c2e', innerHTML: this.iconSrc || (this.icon ? catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
8172
8662
|
icon: true,
|
|
8173
8663
|
[`icon-${this.size}`]: this.size !== 'inline'
|
|
8174
8664
|
} }));
|
|
@@ -9793,11 +10283,6 @@ const CatInput = class {
|
|
|
9793
10283
|
}
|
|
9794
10284
|
componentWillRender() {
|
|
9795
10285
|
this.onErrorsChanged(this.errors);
|
|
9796
|
-
delayedAssertWarn(this, () => {
|
|
9797
|
-
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
9798
|
-
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
9799
|
-
return !!this.label && !!this.hasSlottedLabel;
|
|
9800
|
-
}, '[A11y] Missing ARIA label on input');
|
|
9801
10286
|
}
|
|
9802
10287
|
/**
|
|
9803
10288
|
* Programmatically move focus to the input. Use this method instead of
|
|
@@ -9849,19 +10334,19 @@ const CatInput = class {
|
|
|
9849
10334
|
}
|
|
9850
10335
|
}
|
|
9851
10336
|
render() {
|
|
9852
|
-
return (h("div", { key: '
|
|
10337
|
+
return (h("div", { key: '76ad5d8b725b6b204ed4aad31bb9f11d05ad62fb', class: {
|
|
9853
10338
|
'input-field': true,
|
|
9854
10339
|
'input-horizontal': this.horizontal
|
|
9855
|
-
} }, h("div", { key: '
|
|
10340
|
+
} }, h("div", { key: '8862cbdf26f7ea41437ee6cf9c42f547a2191c50', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '74baa9ff52220470797009105ac219b3e1056d3b', htmlFor: this.id, part: "label" }, h("span", { key: '876771638e7acbb10bcb5c2e2c35729c3632faf0', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '9133d0c6ea7b47976f216ffccd185d861448b95a', name: "label" })) || this.label, h("div", { key: 'c844e96edf30f93fdfc9d626a7afa970fdca169f', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: 'fb6bc86c31e732056954cc77454414576f816368', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'cd7945347dca48a5d08c6936e435d08e9c3be832', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { key: '7d58f0b5338d9182d8210560856bff03c8d1b9d5', class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { key: '0820cdb769758527ae0d0b4718c29b34c37b93d1', class: "input-container" }, h("div", { key: 'b6376f9644223f2115dfe9f5346f25f67fa94688', class: "input-outer-wrapper" }, h("div", { key: '174021266ea289a90b8fc2d65135fcbdce14b0b0', class: {
|
|
9856
10341
|
'input-wrapper': true,
|
|
9857
10342
|
'input-round': this.round,
|
|
9858
10343
|
'input-readonly': this.readonly,
|
|
9859
10344
|
'input-disabled': this.disabled,
|
|
9860
10345
|
'input-invalid': this.invalid
|
|
9861
|
-
}, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: '
|
|
10346
|
+
}, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { key: 'ceeea12176047095802c81771c09f2b66c10a0a5', class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { key: 'c9ffa0705e9a343c9f99558dc091be023f2e0294', icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: 'ca13e810597797073cadcac68f8701eaae85f816', class: "input-inner-wrapper" }, h("input", { key: '0dfc4adec512642452075f51065a598cd59c9b2f', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
|
|
9862
10347
|
'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
|
|
9863
10348
|
'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value
|
|
9864
|
-
}, 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", { 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", { 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.invalid && this.icon && this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), h("slot", { key: '
|
|
10349
|
+
}, 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: 'b45dde66204e6bb5d040649fdaf37f8303c2ed29', 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: '3b230e4d2ad85481665ab54653f95b06c3a5d930', 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.invalid && this.icon && this.iconRight && (h("cat-icon", { key: '33052e7fae76cd81908db4837fea2d5e01c2392e', icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (h("cat-icon", { key: 'c93e983876dc5249a21333d4fad945b2e549dde7', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (h("span", { key: 'a77ecd9c4fcf230dc33ec69faf4e97b3dd5856f9', class: "text-suffix", part: "suffix" }, this.textSuffix))), h("slot", { key: 'd53d531ff9b28994c6e1b6df2a4423c757b288d8', name: "addon" })), this.hasHint && (h(CatFormHint, { key: '59b36e9b6b47f094f32a8a069a24fc706f974ebb', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
|
|
9865
10350
|
}
|
|
9866
10351
|
get hasHint() {
|
|
9867
10352
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -9939,9 +10424,9 @@ const CatPagination = class {
|
|
|
9939
10424
|
this.iconNext = '$cat:pagination-right';
|
|
9940
10425
|
}
|
|
9941
10426
|
render() {
|
|
9942
|
-
return (h("nav", { key: '
|
|
10427
|
+
return (h("nav", { key: '1929458d04848122f7b5b5fa806b347c32d562a5', role: "navigation" }, h("ol", { key: 'e93478ef96a8a8ca0b11f238c168194934848f1b', class: {
|
|
9943
10428
|
[`cat-pagination-${this.size}`]: Boolean(this.size)
|
|
9944
|
-
} }, h("li", { key: '
|
|
10429
|
+
} }, h("li", { key: '116feebfe0d10971ffce4a8ff7f9ecd1d293c3cc' }, h("cat-button", { key: '22b12534bac787dc91ac969e30e4dce6ce3c8b87', 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: '1b17792a3ce126cedbfc832ee98c203bdc479057' }, h("cat-button", { key: 'b697f56af43022877c3822a0b584a7c0b433fb0d', 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) })))));
|
|
9945
10430
|
}
|
|
9946
10431
|
get isFirst() {
|
|
9947
10432
|
return this.page === 0;
|
|
@@ -10021,13 +10506,6 @@ const CatRadio = class {
|
|
|
10021
10506
|
get id() {
|
|
10022
10507
|
return this.identifier || this._id;
|
|
10023
10508
|
}
|
|
10024
|
-
componentWillRender() {
|
|
10025
|
-
delayedAssertWarn(this, () => {
|
|
10026
|
-
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
10027
|
-
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
10028
|
-
return !!this.label && !!this.hasSlottedLabel;
|
|
10029
|
-
}, '[A11y] Missing ARIA label on radio');
|
|
10030
|
-
}
|
|
10031
10509
|
/**
|
|
10032
10510
|
* Programmatically move focus to the radio button. Use this method instead of
|
|
10033
10511
|
* `input.focus()`.
|
|
@@ -10046,7 +10524,7 @@ const CatRadio = class {
|
|
|
10046
10524
|
this.input.blur();
|
|
10047
10525
|
}
|
|
10048
10526
|
render() {
|
|
10049
|
-
return (h(Host, { key: '
|
|
10527
|
+
return (h(Host, { key: 'a073383246de555ba0c02eb3bbf375e3d8cebfeb' }, h("label", { key: '7ec947d5373540582e62e8b1f8eafed152c558f3', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: 'b718b75cb484da79ed934ad3135a02c9a8ecef55', class: "radio" }, h("input", { key: '5a608ff6df9e5ee981d4d3581ea36128ebf54b01', ...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: '3a698e323f3e29dc33161570afe8ab0e257ec6b2', class: "circle" })), h("span", { key: '3e700cbb3c918954cb380f462077972ded288d02', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: '0cff14fd68ea95ebfb0a37916c3f56bdcdc5a2f8', name: "label" })) || this.label)), this.hasHint && (h("div", { key: '7c2bce41360bc5a8f12dda908ad071e06c09f48d', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: '04e8b4fbcb3be51c62d0c27ac92bf80d9eb0ac10', class: "circle-placeholder" }), h(CatFormHint, { key: 'aefee640f2ee261a77b062d06462a09839a00617', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
|
|
10050
10528
|
}
|
|
10051
10529
|
get hasHint() {
|
|
10052
10530
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -10137,7 +10615,7 @@ const CatRadioGroup = class {
|
|
|
10137
10615
|
}
|
|
10138
10616
|
}
|
|
10139
10617
|
render() {
|
|
10140
|
-
return (h("div", { key: '
|
|
10618
|
+
return (h("div", { key: '700491e3e68675725272b877296df47e8d538af3', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: '3a03df80cac82f5530f5e1317b226d6d120b52ba' })));
|
|
10141
10619
|
}
|
|
10142
10620
|
init() {
|
|
10143
10621
|
this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
|
|
@@ -10226,13 +10704,13 @@ const CatScrollable = class {
|
|
|
10226
10704
|
}
|
|
10227
10705
|
render() {
|
|
10228
10706
|
return [
|
|
10229
|
-
h("div", { key: '
|
|
10230
|
-
h("div", { key: '
|
|
10707
|
+
h("div", { key: 'b9e809dfdeafaba07bf5e6b6fee92b256c5dc7ec', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { key: '2a1fd0f1de1abbbba912e571197cb3bec51d458f', class: "shadow-top" }), !this.noShadowX && h("div", { key: '7d45944d3e77653c57bac6f40a2903a00bbe07d3', class: "shadow-left" }), !this.noShadowX && h("div", { key: '4b556dbb3cec3f34fce448721a8b0f1a8fa2e2c3', class: "shadow-right" }), !this.noShadowY && h("div", { key: 'dcbcf18521b4cbfd0f9b50e2a0090fff1e230571', class: "shadow-bottom" })),
|
|
10708
|
+
h("div", { key: '0847d6934ff533528636f27b6e2ca41af71f6538', ref: el => (this.scrollElement = el), class: {
|
|
10231
10709
|
'scrollable-content': true,
|
|
10232
10710
|
'scroll-x': !this.noOverflowX,
|
|
10233
10711
|
'scroll-y': !this.noOverflowY,
|
|
10234
10712
|
'no-overscroll': this.noOverscroll
|
|
10235
|
-
} }, h("slot", { key: '
|
|
10713
|
+
} }, h("slot", { key: 'f1e5dd010c1e4fe9f875046096d313b76a55b062' }))
|
|
10236
10714
|
];
|
|
10237
10715
|
}
|
|
10238
10716
|
attachEmitter(from, emitter) {
|
|
@@ -10485,11 +10963,6 @@ const CatSelect = class {
|
|
|
10485
10963
|
}
|
|
10486
10964
|
componentWillRender() {
|
|
10487
10965
|
this.onErrorsChanged(this.errors);
|
|
10488
|
-
delayedAssertWarn(this, () => {
|
|
10489
|
-
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
10490
|
-
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
10491
|
-
return !!this.label && !!this.hasSlottedLabel;
|
|
10492
|
-
}, '[A11y] Missing ARIA label on select');
|
|
10493
10966
|
}
|
|
10494
10967
|
onBlur(event) {
|
|
10495
10968
|
if (!this.multiple && this.state.activeOptionIndex >= 0) {
|
|
@@ -10672,18 +11145,18 @@ const CatSelect = class {
|
|
|
10672
11145
|
});
|
|
10673
11146
|
}
|
|
10674
11147
|
render() {
|
|
10675
|
-
return (h(Host, { key: '
|
|
11148
|
+
return (h(Host, { key: '77d901f97448ee35547ee0cddd8f68fd20e978f2' }, h("div", { key: '390d0f6a55f18491a9ec5b1cce8cc577e3c1d89d', class: {
|
|
10676
11149
|
'select-field': true,
|
|
10677
11150
|
'select-horizontal': this.horizontal,
|
|
10678
11151
|
'select-multiple': this.multiple
|
|
10679
|
-
} }, h("div", { key: '
|
|
11152
|
+
} }, h("div", { key: '3caf33926c0c4919f9d6941c7f3105fd9341e43f', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '2499bcb11afa49e8edeec3d4598f3e9c8402c37e', htmlFor: `select-${this.id}-input`, part: "label" }, h("span", { key: 'f39aa80a79e69a8dd4ca9dcfe36446ba920bdb3a', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: 'e7272b0381004efcff9a411764528a17553f2ff4', name: "label" })) || this.label, h("div", { key: 'bbe109a0d168aac83855e5a2cefa24c443e945c0', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: 'bf139e6f92b1c4f091777e6fdaa6f67720c9bd74', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'de60d30414ae74b77582da94297ca08dc1f1405c', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))))), h("div", { key: '252978c537c24470de267ce66e93c55e05925a29', class: "select-container" }, h("div", { key: 'e94f404f098bbecad5ccde214c0bd32479bc5b2c', 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: '43a6e5e890d5e20b95e6d7047038d0428823d2aa', 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: {
|
|
10680
11153
|
pill: true,
|
|
10681
11154
|
'select-no-open': true,
|
|
10682
11155
|
'select-option-active': this.state.activeSelectionIndex === i
|
|
10683
|
-
}, 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: '
|
|
11156
|
+
}, 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: '87339aa2205e8f0e1f718b0f49b0daf527ddbe5c', ...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: 'a0f7ed3c542fd808de8a7d195c40ea72a2b776ee' }), this.invalid && (h("cat-icon", { key: '23afed14552f6730b39958c70471747d77d2d454', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), (this.state.selection.length || this.state.term.length) &&
|
|
10684
11157
|
!this.disabled &&
|
|
10685
11158
|
!this.state.isResolving &&
|
|
10686
|
-
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", { 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, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))), h("div", { key: '
|
|
11159
|
+
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: 'bd4d09ba526ed4881fad163ef8e95e619c817fdf', 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: '9687a0ad10cb26fe8cdcf52b0459816d9d1e1271', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))), h("div", { key: '009eaed16563b9bbd48dcc1bb3777de8500d3e6f', class: "select-dropdown", ref: el => (this.dropdown = el), style: { display: this.state.isOpen ? 'block' : undefined } }, this.state.isOpen && (h("cat-scrollable", { key: '10e3d878110aebf52d89b8b975e0d6be503c1fea', class: "select-options-wrapper", scrolledBuffer: 56, noOverflowX: true, noOverscroll: true, noScrolledInit: true, onScrolledBottom: () => this.more$.next() }, h("ul", { key: '1ed3aae098cafc10de05ff6a8feb5047ad23abae', class: "select-options", role: "listbox", "aria-multiselectable": this.multiple, "aria-setsize": this.state.totalElements, id: `select-listbox-${this.id}` }, this.optionsList, this.state.isLoading
|
|
10687
11160
|
? 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 }))))
|
|
10688
11161
|
: !this.state.options.length &&
|
|
10689
11162
|
!this.tags && (h("li", { class: "select-option-empty" }, this.noItems ? this.noItems : catI18nRegistry.t('select.empty')))))))));
|
|
@@ -10846,7 +11319,7 @@ const CatSelect = class {
|
|
|
10846
11319
|
selectionClone.pop();
|
|
10847
11320
|
this.patchState({ selection: selectionClone, tempSelection: [...this.state.selection] });
|
|
10848
11321
|
}
|
|
10849
|
-
if (!this.input?.value.trim()) {
|
|
11322
|
+
if (!this.required && !this.input?.value.trim()) {
|
|
10850
11323
|
this.patchState({ tempSelection: [] });
|
|
10851
11324
|
}
|
|
10852
11325
|
}
|
|
@@ -11176,7 +11649,7 @@ const CatSelectTest = class {
|
|
|
11176
11649
|
setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
|
|
11177
11650
|
}
|
|
11178
11651
|
render() {
|
|
11179
|
-
return (h(Host, { key: '
|
|
11652
|
+
return (h(Host, { key: '6dee38053268c2d945c195cfd4dd39109ed22021', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, h("cat-select", { key: 'fa571970ee14e63d95567ed847af36d2da7e96ae', 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: 'a222dd43988c0e088903c8f260a7bcb2a074c73e', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { key: '34314fa05e1dc159594d12a242b720276449e35d', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'ac72d824efb07f6012fee35725c9e5fd6e16b9f8', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: 'e4965ee7c2c0d2452bf907fcc51809b45f590219', 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: '62b13c5e38165dbcf6c4b98376d65183e45b6b02', 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: '6417bfc737cb4fab8fbbcd777c9f522f084f375f', 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: '9e530aad5e9cd9add1fcfaf8fc00651091c267c4', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { key: '5cc4e92952af134af6fabc5fe6555ba7e8f5d3f2', overflow: true }, h("cat-button", { key: '5916378b87e75d58bdc3b253e7731f9a0a7a5350', slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { key: '9efbc90e07ffba870869de8682f4e57a7611550c', slot: "content", style: { width: '400px' } }, h("cat-select", { key: 'd45765d2243918ef11b8ec63438347dd8421fe6d', 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%' } })))));
|
|
11180
11653
|
}
|
|
11181
11654
|
get countryConnector() {
|
|
11182
11655
|
return {
|
|
@@ -12432,7 +12905,7 @@ const CatSkeleton = class {
|
|
|
12432
12905
|
this.lines = undefined;
|
|
12433
12906
|
}
|
|
12434
12907
|
render() {
|
|
12435
|
-
return (h(Host, { key: '
|
|
12908
|
+
return (h(Host, { key: '9039e34e1c03c573e07e1fc9f0041bbb5bc9369e' }, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
|
|
12436
12909
|
skeleton: true,
|
|
12437
12910
|
[`skeleton-${this.effect}`]: Boolean(this.effect),
|
|
12438
12911
|
[`skeleton-${this.variant}`]: Boolean(this.variant),
|
|
@@ -12472,9 +12945,9 @@ const CatSpinner = class {
|
|
|
12472
12945
|
this.a11yLabel = undefined;
|
|
12473
12946
|
}
|
|
12474
12947
|
render() {
|
|
12475
|
-
return (h("span", { key: '
|
|
12948
|
+
return (h("span", { key: '5dc8097429f1b606c187ae3e5adc2871680f05f4', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
|
|
12476
12949
|
[`spinner-${this.size}`]: this.size !== 'inline'
|
|
12477
|
-
} }, h("svg", { key: '
|
|
12950
|
+
} }, h("svg", { key: '2daf677665ac8f5089d33414acde28e1d7bf630d', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { key: '7c38b0547d2aaa78921072917306765d866d4d97', cx: "24", cy: "24", r: "21.5" }))));
|
|
12478
12951
|
}
|
|
12479
12952
|
};
|
|
12480
12953
|
CatSpinner.style = CatSpinnerStyle0;
|
|
@@ -12506,7 +12979,7 @@ const CatTab = class {
|
|
|
12506
12979
|
this.catClick.emit(event);
|
|
12507
12980
|
}
|
|
12508
12981
|
render() {
|
|
12509
|
-
return h(Host, { key: '
|
|
12982
|
+
return h(Host, { key: '454f82a9ffacf27abd207c7e06af0c2a888cc201' });
|
|
12510
12983
|
}
|
|
12511
12984
|
get hostElement() { return getElement(this); }
|
|
12512
12985
|
};
|
|
@@ -12570,7 +13043,7 @@ const CatTabs = class {
|
|
|
12570
13043
|
this.activate(this.tabs[index]);
|
|
12571
13044
|
}
|
|
12572
13045
|
render() {
|
|
12573
|
-
return (h(Host, { key: '
|
|
13046
|
+
return (h(Host, { key: '19c67fc838c4dd854168d398b3dd6c9e0e522ff0' }, this.tabs.map((tab) => {
|
|
12574
13047
|
return (h("cat-button", { buttonId: tab.id, role: "tab", part: "tab", class: {
|
|
12575
13048
|
'cat-tab': true,
|
|
12576
13049
|
'cat-tab-active': tab.id === this.activeTab,
|
|
@@ -12643,11 +13116,6 @@ const CatTextarea = class {
|
|
|
12643
13116
|
}
|
|
12644
13117
|
componentWillRender() {
|
|
12645
13118
|
this.onErrorsChanged(this.errors);
|
|
12646
|
-
delayedAssertWarn(this, () => {
|
|
12647
|
-
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
12648
|
-
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
12649
|
-
return !!this.label && !!this.hasSlottedLabel;
|
|
12650
|
-
}, '[A11y] Missing ARIA label on textarea');
|
|
12651
13119
|
}
|
|
12652
13120
|
componentDidLoad() {
|
|
12653
13121
|
n(this.textarea);
|
|
@@ -12690,15 +13158,15 @@ const CatTextarea = class {
|
|
|
12690
13158
|
}
|
|
12691
13159
|
}
|
|
12692
13160
|
render() {
|
|
12693
|
-
return (h(Host, { key: '
|
|
13161
|
+
return (h(Host, { key: '32bf75e107566610f1857fb76efcabbfd7c9e60a' }, h("div", { key: '8398f556629abcad71b3d67d0016e94ece130433', class: {
|
|
12694
13162
|
'textarea-field': true,
|
|
12695
13163
|
'textarea-horizontal': this.horizontal
|
|
12696
|
-
} }, h("div", { key: '
|
|
13164
|
+
} }, h("div", { key: '69f992803f4ae9d1870ad0181f061d606263ba05', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { key: '69028a7e208a61d91c0d6d46c1d8651fb497daae', htmlFor: this.id, part: "label" }, h("span", { key: 'a4e25a51de8e01efe8816cc9c2ea598bdda3dbef', class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { key: '6506a4127f3173c98356518410b91cd9e46cac55', name: "label" })) || this.label, h("div", { key: '98f92550ed4aadf45b862222207234acd52236b5', class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { key: 'e5226719a2114fe3bffc8708d79c65960a309045', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { key: 'e36109ea692a6aff99662d8b30b96943bddf13d7', class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { key: 'c8c0a9e01cf203b63be501186dd32b84fff2ae93', class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { key: 'b8b1373d861ca572de0622b2c653da8a0d4f3994', class: "textarea-container" }, h("div", { key: 'f6a41aeedb7d80061f806f32d11a72f711423f03', class: {
|
|
12697
13165
|
'textarea-wrapper': true,
|
|
12698
13166
|
'textarea-readonly': this.readonly,
|
|
12699
13167
|
'textarea-disabled': this.disabled,
|
|
12700
13168
|
'textarea-invalid': this.invalid
|
|
12701
|
-
} }, h("textarea", { key: '
|
|
13169
|
+
} }, h("textarea", { key: '780080e15a3a443cea3f2a4c54a2c6a5a6995817', ...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 && (h("cat-icon", { key: '7b155ac7ed0241445b60953dfea7ce2b6dc46e61', icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { key: '35ecac2f4355ea2533780584bc3a1a17babbc92c', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
|
|
12702
13170
|
}
|
|
12703
13171
|
get hasHint() {
|
|
12704
13172
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -12916,14 +13384,14 @@ const CatTime = class {
|
|
|
12916
13384
|
this.input?.clear();
|
|
12917
13385
|
}
|
|
12918
13386
|
render() {
|
|
12919
|
-
return (h(Host, { key: '
|
|
13387
|
+
return (h(Host, { key: 'f27248f07e9dee2b129f3ffd651f3fbc40ec9c60' }, h("cat-input", { key: '8031cdca279be78f7af36e62c961aeb74641ad6e', 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) }, h("span", { key: '658e7782b963294d9c48443b98e47841e96276ca', slot: "label" }, this.hasSlottedLabel && h("slot", { key: 'a773fa33d7dcc51cbdad72ae4bbfff3158e0b1e8', name: "label" }), !this.hasSlottedLabel && this.label, h("span", { key: 'e6b75349897b779521da75541dcd6467bd57af62', class: "label-aria" }, " (HH:mm)")), h("div", { key: 'e6ca724256eacbaa48d0aa4a4dfcd3eeba8adfec', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (h("cat-button", { key: 'c60bd2a02b5f7a0e12fb397e7d4230e648b815e9', class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), h("cat-dropdown", { key: '80fcef2872af257486240ea8c3447b38d55f13a5', slot: "addon", placement: this.placement }, h("cat-button", { key: '8ff466440e2a2631770509500a40c9cae5d7d549', 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 }), h("nav", { key: '8ba70ebb9ab84e28712df787b7402a7e2fbd7b59', slot: "content", class: "cat-nav" }, h("ul", { key: '50c2e92dc053177bc0b5a99bb77468e906f58f9e' }, this.timeArray().map(time => {
|
|
12920
13388
|
const isoTime = formatIso(time);
|
|
12921
13389
|
const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
|
|
12922
13390
|
return (h("li", null, h("cat-button", { class: {
|
|
12923
13391
|
'cat-nav-item': true,
|
|
12924
13392
|
'time-disabled': disabled
|
|
12925
13393
|
}, 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))));
|
|
12926
|
-
}))))), this.hasSlottedHint && (h("span", { slot: "hint" }, h("slot", { name: "hint" }))))));
|
|
13394
|
+
}))))), this.hasSlottedHint && (h("span", { key: '5d9cb046f0aa9e692578353ac6e07533670c9429', slot: "hint" }, h("slot", { key: '109e5477d55a9a90701a9d83aa2d79cf434ebbc0', name: "hint" }))))));
|
|
12927
13395
|
}
|
|
12928
13396
|
timeArray() {
|
|
12929
13397
|
const result = [];
|
|
@@ -13019,13 +13487,6 @@ const CatToggle = class {
|
|
|
13019
13487
|
componentWillLoad() {
|
|
13020
13488
|
this.updateResolved();
|
|
13021
13489
|
}
|
|
13022
|
-
componentWillRender() {
|
|
13023
|
-
delayedAssertWarn(this, () => {
|
|
13024
|
-
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
13025
|
-
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
13026
|
-
return !!this.label && !!this.hasSlottedLabel;
|
|
13027
|
-
}, '[A11y] Missing ARIA label on toggle');
|
|
13028
|
-
}
|
|
13029
13490
|
/**
|
|
13030
13491
|
* Programmatically move focus to the toggle. Use this method instead of
|
|
13031
13492
|
* `input.focus()`.
|
|
@@ -13044,7 +13505,7 @@ const CatToggle = class {
|
|
|
13044
13505
|
this.input.blur();
|
|
13045
13506
|
}
|
|
13046
13507
|
render() {
|
|
13047
|
-
return (h(Host, { key: '
|
|
13508
|
+
return (h(Host, { key: '3bcad5fa9b7198a4637bcfcc9d0094808514885c' }, h("label", { key: '18ffc8bbbf19925c75c01ac2d7698988224fcf3d', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", { key: 'b8aea6493e16a8313d0b541d560b904c88f70ef4', ...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 }), h("span", { key: '2464e14cf9716a6b85113c8004b67efabb94f99d', class: "toggle" }), h("span", { key: '5aa268a5106315bbb763c8d2205492add23d476a', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { key: 'ef8e10fe4daa20cec780188a37f39c8b748bb999', name: "label" })) || this.label)), this.hasHint && (h("div", { key: 'd2f729369fecaa358a524ee7de06705ebaa15210', class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { key: 'acdb67f2d481d11cfbd9c6ab016da8bb74ee25c5', class: "toggle-placeholder" }), h(CatFormHint, { key: '8b690c36d6aad34a657421d3d6a1e7814f883176', id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
|
|
13048
13509
|
}
|
|
13049
13510
|
get hasHint() {
|
|
13050
13511
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -13131,12 +13592,12 @@ const CatTooltip = class {
|
|
|
13131
13592
|
}
|
|
13132
13593
|
}
|
|
13133
13594
|
render() {
|
|
13134
|
-
return (h(Host, { key: '
|
|
13595
|
+
return (h(Host, { key: '38a9782f607e32cd7c6af0603a32f0880691cd64' }, h("slot", { key: '960baa37b44020a8032b5f90d2eaa8d90ee212ff' }), h("div", { key: 'f5a14f7a0e887c0e0b7879e44cee099b090cf913', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
|
|
13135
13596
|
tooltip: true,
|
|
13136
13597
|
'tooltip-hidden': this.inactive,
|
|
13137
13598
|
'tooltip-round': this.round,
|
|
13138
13599
|
[`tooltip-${this.size}`]: Boolean(this.size)
|
|
13139
|
-
} }, h("slot", { key: '
|
|
13600
|
+
} }, h("slot", { key: '205c5d7b2f65120aa3d0f46a4539c1c5c6d888c8', name: "content" }, h("p", { key: 'e88757f1e19d4de60e1b1ca295d9e7fc74e88fee' }, this.content)))));
|
|
13140
13601
|
}
|
|
13141
13602
|
async update() {
|
|
13142
13603
|
if (this.trigger && this.tooltip) {
|