@haiilo/catalyst 6.4.7 → 6.5.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-19fad7af.js +2 -0
- package/dist/catalyst/p-19fad7af.js.map +1 -0
- package/dist/catalyst/p-376b504c.js +3 -0
- package/dist/catalyst/p-376b504c.js.map +1 -0
- package/dist/catalyst/p-d303131e.entry.js +10 -0
- package/dist/catalyst/p-d303131e.entry.js.map +1 -0
- package/dist/cjs/cat-alert_26.cjs.entry.js +118 -52
- package/dist/cjs/cat-alert_26.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +3 -3
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/{index-6ec4ef6d.js → index-329a3380.js} +111 -29
- package/dist/cjs/index-329a3380.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{of-eda6baf8.js → of-8545b523.js} +2 -2
- package/dist/cjs/of-8545b523.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/cat-alert/cat-alert.css +10 -20
- package/dist/collection/components/cat-avatar/cat-avatar.css +2 -2
- package/dist/collection/components/cat-badge/cat-badge.css +6 -11
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +4 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +1 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +2 -4
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.js +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.js +20 -4
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +1 -2
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +4 -1
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +1 -3
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.css +3 -0
- package/dist/collection/components/cat-select/cat-select.js +13 -8
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +5 -2
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +4 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +2 -4
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +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 +3 -1
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-badge.js +1 -1
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button2.js +3 -1
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +4 -1
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-datepicker-inline.js +4 -0
- package/dist/components/cat-datepicker-inline.js.map +1 -1
- package/dist/components/cat-datepicker.js +6 -0
- package/dist/components/cat-datepicker.js.map +1 -1
- package/dist/components/cat-datepicker.locale.js +1 -0
- package/dist/components/cat-datepicker.locale.js.map +1 -1
- package/dist/components/cat-dropdown2.js +44 -25
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +3 -0
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-form-hint.js +1 -1
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +1 -1
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-input2.js +22 -4
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-radio-group.js +6 -1
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +4 -1
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-select2.js +18 -6
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-tabs.js +3 -1
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-textarea.js +7 -2
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.js +4 -1
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +16 -5
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/esm/cat-alert_26.entry.js +118 -52
- package/dist/esm/cat-alert_26.entry.js.map +1 -1
- package/dist/esm/catalyst.js +4 -4
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/{index-b424aa97.js → index-6af09649.js} +111 -29
- package/dist/esm/index-6af09649.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{of-246f9b35.js → of-a965d8fb.js} +2 -2
- package/dist/esm/of-a965d8fb.js.map +1 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +1 -0
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +1 -0
- package/dist/types/components/cat-input/cat-input.d.ts +2 -0
- package/dist/types/components/cat-radio/cat-radio.d.ts +1 -0
- package/dist/types/components/cat-select/cat-select.d.ts +1 -0
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +1 -0
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +5 -3
- package/package.json +18 -18
- package/dist/catalyst/p-77eee134.entry.js +0 -10
- package/dist/catalyst/p-77eee134.entry.js.map +0 -1
- package/dist/catalyst/p-8929f28a.js +0 -2
- package/dist/catalyst/p-8929f28a.js.map +0 -1
- package/dist/catalyst/p-f0bcebed.js +0 -3
- package/dist/catalyst/p-f0bcebed.js.map +0 -1
- package/dist/cjs/index-6ec4ef6d.js.map +0 -1
- package/dist/cjs/of-eda6baf8.js.map +0 -1
- package/dist/esm/index-b424aa97.js.map +0 -1
- package/dist/esm/of-246f9b35.js.map +0 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const of = require('./of-
|
|
5
|
+
const index = require('./index-329a3380.js');
|
|
6
|
+
const of = require('./of-8545b523.js');
|
|
7
7
|
|
|
8
8
|
const ObjectUnsubscribedError = of.createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
|
|
9
9
|
_super(this);
|
|
@@ -790,7 +790,7 @@ function setAttributeDefault(host, attr, value) {
|
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
792
|
|
|
793
|
-
const catAlertCss = ":host{display:flex;gap:0.5rem;padding:1.25rem;border-radius:var(--cat-border-radius-l, 0.5rem);margin-bottom:1rem}:host([hidden]){display:none}:host(:focus-visible){outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.content{align-self:center}::slotted(:last-child){margin-bottom:0 !important}:host([color=primary]){background-color:
|
|
793
|
+
const catAlertCss = ":host{display:flex;gap:0.5rem;padding:1.25rem;border-radius:var(--cat-border-radius-l, 0.5rem);margin-bottom:1rem}:host([hidden]){display:none}:host(:focus-visible){outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.content{align-self:center}::slotted(:last-child){margin-bottom:0 !important}:host([color=primary]){background-color:rgb(var(--cat-primary-bg, 0, 129, 148));color:rgb(var(--cat-primary-fill, 255, 255, 255))}:host([color=secondary]){background-color:rgb(var(--cat-secondary-bg, 105, 118, 135));color:rgb(var(--cat-secondary-fill, 255, 255, 255))}:host([color=success]){background-color:rgb(var(--cat-success-bg, 0, 132, 88));color:rgb(var(--cat-success-fill, 255, 255, 255))}:host([color=warning]){background-color:rgb(var(--cat-warning-bg, 255, 206, 128));color:rgb(var(--cat-warning-fill, 0, 0, 0))}:host([color=danger]){background-color:rgb(var(--cat-danger-bg, 217, 52, 13));color:rgb(var(--cat-danger-fill, 255, 255, 255))}";
|
|
794
794
|
|
|
795
795
|
const CatAlert = class {
|
|
796
796
|
constructor(hostRef) {
|
|
@@ -839,7 +839,7 @@ const loadImg = (src) => {
|
|
|
839
839
|
});
|
|
840
840
|
};
|
|
841
841
|
|
|
842
|
-
const catAvatarCss = ":host{display:contents}:host([hidden]){display:none}.avatar{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:inherit;color:var(--cat-avatar-fill,
|
|
842
|
+
const catAvatarCss = ":host{display:contents}:host([hidden]){display:none}.avatar{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:inherit;color:var(--cat-avatar-fill, #515c6c);background-color:var(--cat-avatar-bg, #f2f4f7);background-size:cover;background-position:center;white-space:nowrap;overflow:hidden;vertical-align:middle;font-weight:600;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.avatar:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.avatar-round{border-radius:50%}.avatar-xs{width:var(--cat-avatar-size, 1.5rem);height:var(--cat-avatar-size, 1.5rem);line-height:var(--cat-avatar-size, 1.5rem);font-size:var(--cat-avatar-font-size, 0.75rem)}.avatar-s{width:var(--cat-avatar-size, 2rem);height:var(--cat-avatar-size, 2rem);line-height:var(--cat-avatar-size, 2rem);font-size:var(--cat-avatar-font-size, 0.875rem)}.avatar-m{width:var(--cat-avatar-size, 2.5rem);height:var(--cat-avatar-size, 2.5rem);line-height:var(--cat-avatar-size, 2.5rem);font-size:var(--cat-avatar-font-size, 0.9375rem)}.avatar-l{width:var(--cat-avatar-size, 3rem);height:var(--cat-avatar-size, 3rem);line-height:var(--cat-avatar-size, 3rem);font-size:var(--cat-avatar-font-size, 1.125rem)}.avatar-xl{width:var(--cat-avatar-size, 3.5rem);height:var(--cat-avatar-size, 3.5rem);line-height:var(--cat-avatar-size, 3.5rem);font-size:var(--cat-avatar-font-size, 1.25rem)}";
|
|
843
843
|
|
|
844
844
|
const CatAvatar = class {
|
|
845
845
|
constructor(hostRef) {
|
|
@@ -906,7 +906,7 @@ const CatAvatar = class {
|
|
|
906
906
|
};
|
|
907
907
|
CatAvatar.style = catAvatarCss;
|
|
908
908
|
|
|
909
|
-
const catBadgeCss = ":host([hidden]){display:none}:host{display:inline-flex;max-width:100%;vertical-align:baseline;align-items:center;justify-content:center;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;line-height:1.5}:host slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}:host([round]){border-radius:10rem}:host([variant=filled]){background-color:
|
|
909
|
+
const catBadgeCss = ":host([hidden]){display:none}:host{display:inline-flex;max-width:100%;vertical-align:baseline;align-items:center;justify-content:center;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;line-height:1.5}:host slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}:host([round]){border-radius:10rem}:host([variant=filled]){background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}:host([variant=outlined]){background-color:white;color:rgb(var(--text));box-shadow:inset 0 0 0 1px rgba(var(--text), 0.2)}:host([color=primary]){--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148)}:host([color=secondary]){--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0)}:host([color=success]){--bg:var(--cat-success-bg, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88)}:host([color=warning]){--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0)}:host([color=danger]){--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13)}:host([size=xs]){height:1rem;min-width:1rem;font-size:0.75rem;padding:0 0.25rem}:host([size=s]){height:1.5rem;min-width:1.5rem;font-size:0.75rem;padding:0 0.5rem}:host([size=m]){height:2rem;min-width:2rem;font-size:0.875rem;padding:0 0.75rem}:host([size=l]){height:2.5rem;min-width:2.5rem;font-size:0.9375rem;padding:0 1rem}:host([size=xl]){height:3rem;min-width:3rem;font-size:1.125rem;padding:0 1rem}:host([pulse][variant=filled]){animation:1.5s ease 0s infinite normal none running pulse}:host([pulse][variant=outlined]){animation:1.5s ease 0s infinite normal none running pulse-outlined}@keyframes pulse{0%{box-shadow:0 0 0 0 rgb(var(--bg))}70%{box-shadow:transparent 0 0 0 0.5rem}100%{box-shadow:transparent 0 0 0 0}}@keyframes pulse-outlined{0%{box-shadow:0 0 0 0 rgb(var(--bg)), inset 0 0 0 1px rgba(var(--text), 0.2)}70%{box-shadow:transparent 0 0 0 0.5rem, inset 0 0 0 1px rgba(var(--text), 0.2)}100%{box-shadow:transparent 0 0 0 0, inset 0 0 0 1px rgba(var(--text), 0.2)}}";
|
|
910
910
|
|
|
911
911
|
const CatBadge = class {
|
|
912
912
|
constructor(hostRef) {
|
|
@@ -1248,7 +1248,7 @@ CatCard.style = catCardCss;
|
|
|
1248
1248
|
const CatFormHint = props => {
|
|
1249
1249
|
const { id, hint, slottedHint, errorMap } = props;
|
|
1250
1250
|
const errors = Object.entries(errorMap || {});
|
|
1251
|
-
return (index.h("div", { id: id + '-hint', class: "hint-section" }, errors.length
|
|
1251
|
+
return (index.h("div", { "aria-live": "polite", id: id + '-hint', class: "hint-section" }, errors.length
|
|
1252
1252
|
? errors.map(([key, params]) => (index.h("p", { class: (props.class ?? '') + ' input-hint cat-text-danger' }, of.catI18nRegistry.t(`error.${key}`, params))))
|
|
1253
1253
|
: [
|
|
1254
1254
|
hint &&
|
|
@@ -1314,7 +1314,10 @@ const CatCheckbox = class {
|
|
|
1314
1314
|
this.input.blur();
|
|
1315
1315
|
}
|
|
1316
1316
|
render() {
|
|
1317
|
-
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ...this.nativeAttributes, 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) }), index.h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, index.h("svg", { class: "check", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), index.h("svg", { class: "dash", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 5 10.5 5" }))), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)),
|
|
1317
|
+
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ...this.nativeAttributes, 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 }), index.h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, index.h("svg", { class: "check", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), index.h("svg", { class: "dash", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 5 10.5 5" }))), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hasHint && (index.h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, index.h("div", { class: "box-placeholder" }), index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }) })))));
|
|
1318
|
+
}
|
|
1319
|
+
get hasHint() {
|
|
1320
|
+
return !!this.hint || !!this.hasSlottedHint;
|
|
1318
1321
|
}
|
|
1319
1322
|
onInput() {
|
|
1320
1323
|
this.checked = this.input.checked;
|
|
@@ -4004,6 +4007,7 @@ function getConfig(options, more = {}) {
|
|
|
4004
4007
|
...more,
|
|
4005
4008
|
locale: options.locale,
|
|
4006
4009
|
plugins,
|
|
4010
|
+
allowInput: true,
|
|
4007
4011
|
altInput: true,
|
|
4008
4012
|
prevArrow: '←',
|
|
4009
4013
|
nextArrow: '→',
|
|
@@ -4681,7 +4685,7 @@ const flip = function (options) {
|
|
|
4681
4685
|
name: 'flip',
|
|
4682
4686
|
options,
|
|
4683
4687
|
async fn(state) {
|
|
4684
|
-
var _middlewareData$flip;
|
|
4688
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
4685
4689
|
const {
|
|
4686
4690
|
placement,
|
|
4687
4691
|
middlewareData,
|
|
@@ -4699,6 +4703,14 @@ const flip = function (options) {
|
|
|
4699
4703
|
flipAlignment = true,
|
|
4700
4704
|
...detectOverflowOptions
|
|
4701
4705
|
} = evaluate(options, state);
|
|
4706
|
+
|
|
4707
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
4708
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
4709
|
+
// work.
|
|
4710
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
4711
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
4712
|
+
return {};
|
|
4713
|
+
}
|
|
4702
4714
|
const side = getSide(placement);
|
|
4703
4715
|
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
4704
4716
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
@@ -5112,18 +5124,21 @@ function getNearestOverflowAncestor(node) {
|
|
|
5112
5124
|
}
|
|
5113
5125
|
return getNearestOverflowAncestor(parentNode);
|
|
5114
5126
|
}
|
|
5115
|
-
function getOverflowAncestors(node, list) {
|
|
5127
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
5116
5128
|
var _node$ownerDocument2;
|
|
5117
5129
|
if (list === void 0) {
|
|
5118
5130
|
list = [];
|
|
5119
5131
|
}
|
|
5132
|
+
if (traverseIframes === void 0) {
|
|
5133
|
+
traverseIframes = true;
|
|
5134
|
+
}
|
|
5120
5135
|
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
5121
5136
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
5122
5137
|
const win = getWindow(scrollableAncestor);
|
|
5123
5138
|
if (isBody) {
|
|
5124
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
|
|
5139
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
5125
5140
|
}
|
|
5126
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
|
|
5141
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
5127
5142
|
}
|
|
5128
5143
|
|
|
5129
5144
|
function getCssDimensions(element) {
|
|
@@ -5394,7 +5409,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
5394
5409
|
if (cachedResult) {
|
|
5395
5410
|
return cachedResult;
|
|
5396
5411
|
}
|
|
5397
|
-
let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
5412
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
5398
5413
|
let currentContainingBlockComputedStyle = null;
|
|
5399
5414
|
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
5400
5415
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
@@ -6294,30 +6309,30 @@ var isFocusable = function isFocusable(node, options) {
|
|
|
6294
6309
|
};
|
|
6295
6310
|
|
|
6296
6311
|
/*!
|
|
6297
|
-
* focus-trap 7.5.
|
|
6312
|
+
* focus-trap 7.5.4
|
|
6298
6313
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
6299
6314
|
*/
|
|
6300
6315
|
|
|
6301
|
-
function ownKeys(
|
|
6302
|
-
var
|
|
6316
|
+
function ownKeys(e, r) {
|
|
6317
|
+
var t = Object.keys(e);
|
|
6303
6318
|
if (Object.getOwnPropertySymbols) {
|
|
6304
|
-
var
|
|
6305
|
-
|
|
6306
|
-
return Object.getOwnPropertyDescriptor(
|
|
6307
|
-
})),
|
|
6308
|
-
}
|
|
6309
|
-
return
|
|
6310
|
-
}
|
|
6311
|
-
function _objectSpread2(
|
|
6312
|
-
for (var
|
|
6313
|
-
var
|
|
6314
|
-
|
|
6315
|
-
_defineProperty(
|
|
6316
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
6317
|
-
Object.defineProperty(
|
|
6319
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
6320
|
+
r && (o = o.filter(function (r) {
|
|
6321
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
6322
|
+
})), t.push.apply(t, o);
|
|
6323
|
+
}
|
|
6324
|
+
return t;
|
|
6325
|
+
}
|
|
6326
|
+
function _objectSpread2(e) {
|
|
6327
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
6328
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
6329
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
6330
|
+
_defineProperty(e, r, t[r]);
|
|
6331
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
6332
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
6318
6333
|
});
|
|
6319
6334
|
}
|
|
6320
|
-
return
|
|
6335
|
+
return e;
|
|
6321
6336
|
}
|
|
6322
6337
|
function _defineProperty(obj, key, value) {
|
|
6323
6338
|
key = _toPropertyKey(key);
|
|
@@ -6694,11 +6709,30 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
6694
6709
|
throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
|
|
6695
6710
|
}
|
|
6696
6711
|
};
|
|
6712
|
+
|
|
6713
|
+
/**
|
|
6714
|
+
* Gets the current activeElement. If it's a web-component and has open shadow-root
|
|
6715
|
+
* it will recursively search inside shadow roots for the "true" activeElement.
|
|
6716
|
+
*
|
|
6717
|
+
* @param {Document | ShadowRoot} el
|
|
6718
|
+
*
|
|
6719
|
+
* @returns {HTMLElement} The element that currently has the focus
|
|
6720
|
+
**/
|
|
6721
|
+
var getActiveElement = function getActiveElement(el) {
|
|
6722
|
+
var activeElement = el.activeElement;
|
|
6723
|
+
if (!activeElement) {
|
|
6724
|
+
return;
|
|
6725
|
+
}
|
|
6726
|
+
if (activeElement.shadowRoot && activeElement.shadowRoot.activeElement !== null) {
|
|
6727
|
+
return getActiveElement(activeElement.shadowRoot);
|
|
6728
|
+
}
|
|
6729
|
+
return activeElement;
|
|
6730
|
+
};
|
|
6697
6731
|
var tryFocus = function tryFocus(node) {
|
|
6698
6732
|
if (node === false) {
|
|
6699
6733
|
return;
|
|
6700
6734
|
}
|
|
6701
|
-
if (node ===
|
|
6735
|
+
if (node === getActiveElement(document)) {
|
|
6702
6736
|
return;
|
|
6703
6737
|
}
|
|
6704
6738
|
if (!node || !node.focus) {
|
|
@@ -7112,14 +7146,14 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
7112
7146
|
state.active = true;
|
|
7113
7147
|
state.paused = false;
|
|
7114
7148
|
state.nodeFocusedBeforeActivation = doc.activeElement;
|
|
7115
|
-
onActivate === null || onActivate === void 0
|
|
7149
|
+
onActivate === null || onActivate === void 0 || onActivate();
|
|
7116
7150
|
var finishActivation = function finishActivation() {
|
|
7117
7151
|
if (checkCanFocusTrap) {
|
|
7118
7152
|
updateTabbableNodes();
|
|
7119
7153
|
}
|
|
7120
7154
|
addListeners();
|
|
7121
7155
|
updateObservedNodes();
|
|
7122
|
-
onPostActivate === null || onPostActivate === void 0
|
|
7156
|
+
onPostActivate === null || onPostActivate === void 0 || onPostActivate();
|
|
7123
7157
|
};
|
|
7124
7158
|
if (checkCanFocusTrap) {
|
|
7125
7159
|
checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
|
|
@@ -7148,13 +7182,13 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
7148
7182
|
var onPostDeactivate = getOption(options, 'onPostDeactivate');
|
|
7149
7183
|
var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
|
|
7150
7184
|
var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
|
|
7151
|
-
onDeactivate === null || onDeactivate === void 0
|
|
7185
|
+
onDeactivate === null || onDeactivate === void 0 || onDeactivate();
|
|
7152
7186
|
var finishDeactivation = function finishDeactivation() {
|
|
7153
7187
|
delay(function () {
|
|
7154
7188
|
if (returnFocus) {
|
|
7155
7189
|
tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
|
|
7156
7190
|
}
|
|
7157
|
-
onPostDeactivate === null || onPostDeactivate === void 0
|
|
7191
|
+
onPostDeactivate === null || onPostDeactivate === void 0 || onPostDeactivate();
|
|
7158
7192
|
});
|
|
7159
7193
|
};
|
|
7160
7194
|
if (returnFocus && checkCanReturnFocus) {
|
|
@@ -7171,10 +7205,10 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
7171
7205
|
var onPause = getOption(pauseOptions, 'onPause');
|
|
7172
7206
|
var onPostPause = getOption(pauseOptions, 'onPostPause');
|
|
7173
7207
|
state.paused = true;
|
|
7174
|
-
onPause === null || onPause === void 0
|
|
7208
|
+
onPause === null || onPause === void 0 || onPause();
|
|
7175
7209
|
removeListeners();
|
|
7176
7210
|
updateObservedNodes();
|
|
7177
|
-
onPostPause === null || onPostPause === void 0
|
|
7211
|
+
onPostPause === null || onPostPause === void 0 || onPostPause();
|
|
7178
7212
|
return this;
|
|
7179
7213
|
},
|
|
7180
7214
|
unpause: function unpause(unpauseOptions) {
|
|
@@ -7184,11 +7218,11 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
7184
7218
|
var onUnpause = getOption(unpauseOptions, 'onUnpause');
|
|
7185
7219
|
var onPostUnpause = getOption(unpauseOptions, 'onPostUnpause');
|
|
7186
7220
|
state.paused = false;
|
|
7187
|
-
onUnpause === null || onUnpause === void 0
|
|
7221
|
+
onUnpause === null || onUnpause === void 0 || onUnpause();
|
|
7188
7222
|
updateTabbableNodes();
|
|
7189
7223
|
addListeners();
|
|
7190
7224
|
updateObservedNodes();
|
|
7191
|
-
onPostUnpause === null || onPostUnpause === void 0
|
|
7225
|
+
onPostUnpause === null || onPostUnpause === void 0 || onPostUnpause();
|
|
7192
7226
|
return this;
|
|
7193
7227
|
},
|
|
7194
7228
|
updateContainerElements: function updateContainerElements(containerElements) {
|
|
@@ -7518,7 +7552,11 @@ const CatInput = class {
|
|
|
7518
7552
|
* the focusing process.
|
|
7519
7553
|
*/
|
|
7520
7554
|
async doFocus(options) {
|
|
7521
|
-
|
|
7555
|
+
// hack to make datepicker inputs focusable. The datepicker hides the input
|
|
7556
|
+
// element and dynamically creates a sibling. We need to find the new input
|
|
7557
|
+
// element and focus it instead.
|
|
7558
|
+
const input = this.input.type === 'hidden' ? this.findSiblingInput(this.input.nextSibling) : this.input;
|
|
7559
|
+
input?.focus(options);
|
|
7522
7560
|
}
|
|
7523
7561
|
/**
|
|
7524
7562
|
* Programmatically remove focus from the input. Use this method instead of
|
|
@@ -7557,12 +7595,15 @@ const CatInput = class {
|
|
|
7557
7595
|
'input-readonly': this.readonly,
|
|
7558
7596
|
'input-disabled': this.disabled,
|
|
7559
7597
|
'input-invalid': this.invalid
|
|
7560
|
-
}, onClick: () => this.input.focus() }, this.textPrefix && (index.h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && index.h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l" }), index.h("div", { class: "input-inner-wrapper" }, index.h("input", { ...this.nativeAttributes, ref: el => (this.input = el), id: this.id, class: {
|
|
7598
|
+
}, onClick: () => this.input.focus() }, this.textPrefix && (index.h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (index.h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), index.h("div", { class: "input-inner-wrapper" }, index.h("input", { ...this.nativeAttributes, ref: el => (this.input = el), id: this.id, class: {
|
|
7561
7599
|
'has-clearable': this.clearable && !this.disabled && !this.readonly
|
|
7562
|
-
}, 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.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.
|
|
7600
|
+
}, 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.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (index.h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": of.catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true }))), !this.invalid && this.icon && this.iconRight && (index.h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && index.h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" }), this.textSuffix && (index.h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), this.hasHint && (index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap })))));
|
|
7601
|
+
}
|
|
7602
|
+
get hasHint() {
|
|
7603
|
+
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
7563
7604
|
}
|
|
7564
7605
|
get invalid() {
|
|
7565
|
-
return !!this.errorMap;
|
|
7606
|
+
return !!Object.keys(this.errorMap || {}).length;
|
|
7566
7607
|
}
|
|
7567
7608
|
onInput() {
|
|
7568
7609
|
this.value = this.input.value;
|
|
@@ -7596,6 +7637,15 @@ const CatInput = class {
|
|
|
7596
7637
|
this.showErrors();
|
|
7597
7638
|
}
|
|
7598
7639
|
}
|
|
7640
|
+
findSiblingInput(node) {
|
|
7641
|
+
if (node instanceof HTMLInputElement) {
|
|
7642
|
+
return node;
|
|
7643
|
+
}
|
|
7644
|
+
else if (node?.nextSibling) {
|
|
7645
|
+
return this.findSiblingInput(node.nextSibling);
|
|
7646
|
+
}
|
|
7647
|
+
return undefined;
|
|
7648
|
+
}
|
|
7599
7649
|
get hostElement() { return index.getElement(this); }
|
|
7600
7650
|
static get watchers() { return {
|
|
7601
7651
|
"errors": ["onErrorsChanged"]
|
|
@@ -7727,7 +7777,10 @@ const CatRadio = class {
|
|
|
7727
7777
|
this.input.blur();
|
|
7728
7778
|
}
|
|
7729
7779
|
render() {
|
|
7730
|
-
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, index.h("span", { class: "radio" }, index.h("input", { ...this.nativeAttributes, 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) }), index.h("span", { class: "circle" })), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)),
|
|
7780
|
+
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, index.h("span", { class: "radio" }, index.h("input", { ...this.nativeAttributes, ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), index.h("span", { class: "circle" })), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hasHint && (index.h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, index.h("div", { class: "circle-placeholder" }), index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }) })))));
|
|
7781
|
+
}
|
|
7782
|
+
get hasHint() {
|
|
7783
|
+
return !!this.hint || !!this.hasSlottedHint;
|
|
7731
7784
|
}
|
|
7732
7785
|
onInput() {
|
|
7733
7786
|
this.checked = true;
|
|
@@ -8022,7 +8075,7 @@ var autosizeInput = function (element, options) {
|
|
|
8022
8075
|
}
|
|
8023
8076
|
};
|
|
8024
8077
|
|
|
8025
|
-
const catSelectCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem}.label-optional{display:flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-character-count{display:flex;align-items:center;margin-left:auto;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.hidden label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;flex-direction:column;gap:0.5rem;line-height:1.25rem;position:relative;margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.select-field,.select-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.select-field.select-horizontal{flex-direction:row;gap:1rem}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.select-wrapper{display:flex;align-items:flex-start;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;padding:0.25rem;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.select-wrapper:not(.select-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.select-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.select-wrapper.select-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.select-wrapper:has(input:-webkit-autofill),.select-wrapper:has(input:-webkit-autofill):hover,.select-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}:host(.cat-error) .select-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .select-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}.select-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108));pointer-events:none}.select-wrapper-inner{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:0.25rem;min-width:0}.select-wrapper-inner>cat-avatar{display:inline-block;padding-left:0.5rem}.select-wrapper-inner>cat-avatar+.select-input{padding-left:0.25rem}.select-wrapper-inner cat-avatar{--cat-avatar-size:1.25rem;--cat-avatar-font-size:0.5rem}.select-input{font:inherit;background:none;border:none;outline:none;padding:0.375rem 0.5rem;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select-disabled .select-input{cursor:inherit}.select-pills{display:contents}.pill{display:inline-flex;align-items:center;gap:0.5rem;padding:0.25rem 0.5rem;background:#f2f4f7;border-radius:var(--cat-border-radius-s, 0.125rem);white-space:nowrap;min-width:0}.pill>span{overflow:hidden;text-overflow:ellipsis;flex:1 1 0%}.pill>cat-button{margin-right:-0.25rem;margin-left:-0.25rem}.select-btn{transition:transform 125ms linear}.select-btn::part(button){outline:none}cat-spinner{padding:0.375rem}.icon-suffix{padding:0.25rem}.select-btn-open{transform:rotate(180deg)}.select-dropdown{position:fixed;right:0;background:white;display:none;overflow:auto;box-shadow:0 4px 6px -2px rgba(27, 31, 38, 0.03), 0 12px 16px -4px rgba(27, 31, 38, 0.08);border-radius:var(--cat-border-radius-m, 0.25rem);border:1px solid rgb(var(--cat-border-color, 235, 236, 240));z-index:calc(var(--cat-z-index, 1000) + 100);width:max-content;top:0;left:0}.select-options-wrapper{max-height:16rem;width:100%}.select-empty{margin:1rem 0;padding:0 1.25rem}.select-options{list-style-type:none;margin:0;padding:0.5rem 0}.select-options cat-checkbox,.select-options .select-option-single{margin:0;padding:0.5rem 1rem}.select-option-inner{display:flex;gap:0.5rem}.select-option-inner cat-avatar{--cat-avatar-size:1.25rem;--cat-avatar-font-size:0.5rem}.select-option-text{flex:1 1 0%;min-width:0}.select-option-single{cursor:pointer}.select-input-transparent-caret{caret-color:transparent}.select-option-empty,.select-option-loading{padding:0.5rem 1rem}.select-option:hover{background-color:rgba(var(--cat-secondary-bg, 105, 118, 135), 0.05)}.select-option-active{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-2px}.select-option-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-wrap:break-word;word-break:break-word}.select-option-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
|
|
8078
|
+
const catSelectCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem}.label-optional{display:flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-character-count{display:flex;align-items:center;margin-left:auto;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.hidden label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;flex-direction:column;gap:0.5rem;line-height:1.25rem;position:relative;margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.select-field,.select-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.select-field.select-horizontal{flex-direction:row;gap:1rem}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.select-wrapper{display:flex;align-items:flex-start;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;padding:0.25rem;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.select-wrapper:not(.select-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.select-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.select-wrapper.select-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.select-wrapper:has(input:-webkit-autofill),.select-wrapper:has(input:-webkit-autofill):hover,.select-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}:host(.cat-error) .select-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .select-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}.select-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108));pointer-events:none}.select-wrapper-inner{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:0.25rem;min-width:0}.select-wrapper-inner>cat-avatar{display:inline-block;padding-left:0.5rem}.select-wrapper-inner>cat-avatar+.select-input{padding-left:0.25rem}.select-wrapper-inner cat-avatar{--cat-avatar-size:1.25rem;--cat-avatar-font-size:0.5rem}.select-input{font:inherit;background:none;border:none;outline:none;padding:0.375rem 0.5rem;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select-input::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.select-disabled .select-input{cursor:inherit}.select-pills{display:contents}.pill{display:inline-flex;align-items:center;gap:0.5rem;padding:0.25rem 0.5rem;background:#f2f4f7;border-radius:var(--cat-border-radius-s, 0.125rem);white-space:nowrap;min-width:0}.pill>span{overflow:hidden;text-overflow:ellipsis;flex:1 1 0%}.pill>cat-button{margin-right:-0.25rem;margin-left:-0.25rem}.select-btn{transition:transform 125ms linear}.select-btn::part(button){outline:none}cat-spinner{padding:0.375rem}.icon-suffix{padding:0.25rem}.select-btn-open{transform:rotate(180deg)}.select-dropdown{position:fixed;right:0;background:white;display:none;overflow:auto;box-shadow:0 4px 6px -2px rgba(27, 31, 38, 0.03), 0 12px 16px -4px rgba(27, 31, 38, 0.08);border-radius:var(--cat-border-radius-m, 0.25rem);border:1px solid rgb(var(--cat-border-color, 235, 236, 240));z-index:calc(var(--cat-z-index, 1000) + 100);width:max-content;top:0;left:0}.select-options-wrapper{max-height:16rem;width:100%}.select-empty{margin:1rem 0;padding:0 1.25rem}.select-options{list-style-type:none;margin:0;padding:0.5rem 0}.select-options cat-checkbox,.select-options .select-option-single{margin:0;padding:0.5rem 1rem}.select-option-inner{display:flex;gap:0.5rem}.select-option-inner cat-avatar{--cat-avatar-size:1.25rem;--cat-avatar-font-size:0.5rem}.select-option-text{flex:1 1 0%;min-width:0}.select-option-single{cursor:pointer}.select-input-transparent-caret{caret-color:transparent}.select-option-empty,.select-option-loading{padding:0.5rem 1rem}.select-option:hover{background-color:rgba(var(--cat-secondary-bg, 105, 118, 135), 0.05)}.select-option-active{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-2px}.select-option-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-wrap:break-word;word-break:break-word}.select-option-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
|
|
8026
8079
|
|
|
8027
8080
|
const INIT_STATE = {
|
|
8028
8081
|
term: '',
|
|
@@ -8228,7 +8281,9 @@ const CatSelect = class {
|
|
|
8228
8281
|
}
|
|
8229
8282
|
}
|
|
8230
8283
|
else if (event.key === 'Escape') {
|
|
8231
|
-
this.hide()
|
|
8284
|
+
if (this.hide()) {
|
|
8285
|
+
event.stopPropagation();
|
|
8286
|
+
}
|
|
8232
8287
|
}
|
|
8233
8288
|
else if (event.key === 'Backspace' || event.key === 'Delete') {
|
|
8234
8289
|
this.input?.focus();
|
|
@@ -8321,16 +8376,19 @@ const CatSelect = class {
|
|
|
8321
8376
|
pill: true,
|
|
8322
8377
|
'select-no-open': true,
|
|
8323
8378
|
'select-option-active': this.state.activeSelectionIndex === i
|
|
8324
|
-
}, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (index.h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, icon: item.render.avatar.icon, initials: item.render.avatar.initials ?? '' })) : null, index.h("span", null, item.render.label), !this.disabled && (index.h("cat-button", { size: "xs", variant: "text", icon: "$cat:select-clear", iconOnly: true, a11yLabel: of.catI18nRegistry.t('select.deselect'), onClick: () => this.deselect(item.item.id), tabIndex: -1, "data-dropdown-no-close": true }))))))) : this.state.selection.length && this.state.selection[0].render.avatar ? (index.h("cat-avatar", { label: this.state.selection[0].render.label, round: this.state.selection[0].render.avatar.round, src: this.state.selection[0].render.avatar.src, icon: this.state.selection[0].render.avatar.icon, initials: this.state.selection[0].render.avatar.initials ?? '' })) : null, index.h("input", { ...this.nativeAttributes, class: "select-input", 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.
|
|
8379
|
+
}, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (index.h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, icon: item.render.avatar.icon, initials: item.render.avatar.initials ?? '' })) : null, index.h("span", null, item.render.label), !this.disabled && (index.h("cat-button", { size: "xs", variant: "text", icon: "$cat:select-clear", iconOnly: true, a11yLabel: of.catI18nRegistry.t('select.deselect'), onClick: () => this.deselect(item.item.id), tabIndex: -1, "data-dropdown-no-close": true }))))))) : this.state.selection.length && this.state.selection[0].render.avatar ? (index.h("cat-avatar", { label: this.state.selection[0].render.label, round: this.state.selection[0].render.avatar.round, src: this.state.selection[0].render.avatar.src, icon: this.state.selection[0].render.avatar.icon, initials: this.state.selection[0].render.avatar.initials ?? '' })) : null, index.h("input", { ...this.nativeAttributes, class: "select-input", 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, onInput: this.onInput.bind(this), value: !this.multiple ? this.state.term : undefined, placeholder: this.placeholder, disabled: this.disabled || this.state.isResolving })), this.state.isResolving && index.h("cat-spinner", null), this.invalid && (index.h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), (this.state.selection.length || this.state.term.length) &&
|
|
8325
8380
|
!this.disabled &&
|
|
8326
8381
|
!this.state.isResolving &&
|
|
8327
|
-
this.clearable ? (index.h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "$cat:input-close", variant: "text", size: "s", a11yLabel: of.catI18nRegistry.t('input.clear'), onCatClick: () => this.clear(), "data-dropdown-no-close": true })) : null, !this.state.isResolving && (index.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 ? of.catI18nRegistry.t('select.close') : of.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 }))),
|
|
8382
|
+
this.clearable ? (index.h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "$cat:input-close", variant: "text", size: "s", a11yLabel: of.catI18nRegistry.t('input.clear'), onCatClick: () => this.clear(), "data-dropdown-no-close": true })) : null, !this.state.isResolving && (index.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 ? of.catI18nRegistry.t('select.close') : of.catI18nRegistry.t('select.open'), "aria-controls": `select-listbox-${this.id}`, "aria-expanded": this.state.isOpen, tabIndex: -1, disabled: this.disabled || this.state.isResolving, "data-dropdown-no-close": true }))), this.hasHint && (index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap })))), index.h("div", { class: "select-dropdown", ref: el => (this.dropdown = el), style: { display: this.state.isOpen ? 'block' : undefined } }, this.state.isOpen && (index.h("cat-scrollable", { class: "select-options-wrapper", scrolledBuffer: 56, noOverflowX: true, noOverscroll: true, noScrolledInit: true, onScrolledBottom: () => this.more$.next() }, index.h("ul", { class: "select-options", role: "listbox", "aria-multiselectable": this.multiple, "aria-setsize": this.state.totalElements, id: `select-listbox-${this.id}` }, this.optionsList, this.state.isLoading
|
|
8328
8383
|
? Array.from(Array(CatSelect.SKELETON_COUNT)).map(() => (index.h("li", { class: "select-option-loading" }, index.h("cat-skeleton", { variant: "body", lines: 1 }), index.h("cat-skeleton", { variant: "body", lines: 1 }))))
|
|
8329
8384
|
: !this.state.options.length &&
|
|
8330
8385
|
!this.tags && (index.h("li", { class: "select-option-empty" }, this.noItems ? this.noItems : of.catI18nRegistry.t('select.empty')))))))));
|
|
8331
8386
|
}
|
|
8387
|
+
get hasHint() {
|
|
8388
|
+
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
8389
|
+
}
|
|
8332
8390
|
get invalid() {
|
|
8333
|
-
return !!this.errorMap;
|
|
8391
|
+
return !!Object.keys(this.errorMap || {}).length;
|
|
8334
8392
|
}
|
|
8335
8393
|
get optionsList() {
|
|
8336
8394
|
return this.state.options.map((item, i) => {
|
|
@@ -8401,7 +8459,9 @@ const CatSelect = class {
|
|
|
8401
8459
|
if (this.state.isOpen) {
|
|
8402
8460
|
this.patchState({ isOpen: false, activeOptionIndex: -1 });
|
|
8403
8461
|
this.catClose.emit();
|
|
8462
|
+
return true;
|
|
8404
8463
|
}
|
|
8464
|
+
return false;
|
|
8405
8465
|
}
|
|
8406
8466
|
search(term) {
|
|
8407
8467
|
this.patchState({ term, activeOptionIndex: -1, activeSelectionIndex: -1 });
|
|
@@ -10308,10 +10368,13 @@ const CatTextarea = class {
|
|
|
10308
10368
|
'textarea-readonly': this.readonly,
|
|
10309
10369
|
'textarea-disabled': this.disabled,
|
|
10310
10370
|
'textarea-invalid': this.invalid
|
|
10311
|
-
} }, index.h("textarea", { ...this.nativeAttributes, 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.
|
|
10371
|
+
} }, index.h("textarea", { ...this.nativeAttributes, ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.invalid && (index.h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
|
|
10372
|
+
}
|
|
10373
|
+
get hasHint() {
|
|
10374
|
+
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
10312
10375
|
}
|
|
10313
10376
|
get invalid() {
|
|
10314
|
-
return !!this.errorMap;
|
|
10377
|
+
return !!Object.keys(this.errorMap || {}).length;
|
|
10315
10378
|
}
|
|
10316
10379
|
onInput() {
|
|
10317
10380
|
this.value = this.textarea.value;
|
|
@@ -10408,7 +10471,10 @@ const CatToggle = class {
|
|
|
10408
10471
|
this.input.blur();
|
|
10409
10472
|
}
|
|
10410
10473
|
render() {
|
|
10411
|
-
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ...this.nativeAttributes, 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) }), index.h("span", { class: "toggle", part: "toggle" }), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)),
|
|
10474
|
+
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ...this.nativeAttributes, ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), index.h("span", { class: "toggle", part: "toggle" }), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hasHint && (index.h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, index.h("div", { class: "toggle-placeholder" }), index.h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && index.h("slot", { name: "hint" }) })))));
|
|
10475
|
+
}
|
|
10476
|
+
get hasHint() {
|
|
10477
|
+
return !!this.hint || !!this.hasSlottedHint;
|
|
10412
10478
|
}
|
|
10413
10479
|
onInput() {
|
|
10414
10480
|
this.checked = this.input.checked;
|