@haiilo/catalyst 10.4.0 → 10.7.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 +2 -2
- 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-2c8ac8cf.js +2 -0
- package/dist/catalyst/p-2c8ac8cf.js.map +1 -0
- package/dist/catalyst/p-b2ec6eb3.entry.js +10 -0
- package/dist/catalyst/p-b2ec6eb3.entry.js.map +1 -0
- package/dist/catalyst/scss/_variables.scss +0 -1
- package/dist/catalyst/scss/core/_form.scss +2 -2
- package/dist/cjs/{cat-alert_28.cjs.entry.js → cat-alert_29.cjs.entry.js} +387 -218
- package/dist/cjs/cat-alert_29.cjs.entry.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +4 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{of-45281229.js → of-f2844da8.js} +12 -4
- package/dist/cjs/of-f2844da8.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/cat-button/cat-button.css +12 -2
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +2 -1
- package/dist/collection/components/cat-date/cat-date.css +2 -96
- package/dist/collection/components/cat-date/cat-date.js +77 -245
- package/dist/collection/components/cat-date/cat-date.js.map +1 -1
- package/dist/collection/components/cat-date/cat-date.spec.js +2 -1
- package/dist/collection/components/cat-date/cat-date.spec.js.map +1 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.css +166 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js +11 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js.map +1 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.js +505 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.js.map +1 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js +16 -0
- package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js.map +1 -0
- package/dist/collection/components/{cat-date → cat-date-inline}/cat-date-locale.js +22 -1
- package/dist/collection/components/cat-date-inline/cat-date-locale.js.map +1 -0
- package/dist/collection/components/cat-date-inline/cat-date-math.js.map +1 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +2 -2
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +29 -2
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +4 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +6 -0
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +4 -2
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +1 -1
- package/dist/collection/components/cat-input/cat-input.js +4 -4
- package/dist/collection/components/cat-notification/cat-notification.js +3 -0
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-radio/cat-radio.css +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
- package/dist/collection/components/cat-select/cat-select.js +5 -5
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
- package/dist/collection/components/cat-tab/cat-tab.js +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
- package/dist/collection/components/cat-time/cat-time-locale.js +3 -0
- package/dist/collection/components/cat-time/cat-time-locale.js.map +1 -1
- package/dist/collection/components/cat-time/cat-time.js +39 -8
- package/dist/collection/components/cat-time/cat-time.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.css +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +7 -2
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/collection/scss/_variables.scss +0 -1
- package/dist/collection/scss/core/_form.scss +2 -2
- package/dist/components/cat-button2.js +1 -1
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +1 -1
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-date-inline.d.ts +11 -0
- package/dist/components/cat-date-inline.js +8 -0
- package/dist/components/cat-date-inline.js.map +1 -0
- package/dist/components/cat-date-inline2.js +386 -0
- package/dist/components/cat-date-inline2.js.map +1 -0
- package/dist/components/cat-date.js +83 -283
- package/dist/components/cat-date.js.map +1 -1
- package/dist/components/cat-datepicker-inline.js +2 -2
- package/dist/components/cat-datepicker.js +2 -2
- package/dist/components/cat-dropdown2.js +8 -2
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +1 -1
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +6 -0
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-icon-registry.js +4 -2
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-icon2.js +1 -1
- package/dist/components/cat-input2.js +4 -4
- package/dist/components/cat-pagination.js +2 -2
- package/dist/components/cat-radio-group.js +1 -1
- package/dist/components/cat-radio.js +2 -2
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable2.js +8 -6
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +3 -3
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton2.js +1 -1
- package/dist/components/cat-spinner2.js +2 -2
- package/dist/components/cat-tab.js +1 -1
- package/dist/components/cat-tabs.js +1 -1
- package/dist/components/cat-textarea.js +3 -3
- package/dist/components/cat-time.js +37 -8
- package/dist/components/cat-time.js.map +1 -1
- package/dist/components/cat-toggle.js +2 -2
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +2 -2
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +38 -30
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/components/from.js +1 -1
- package/dist/components/from.js.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/of.js.map +1 -1
- package/dist/esm/{cat-alert_28.entry.js → cat-alert_29.entry.js} +387 -219
- package/dist/esm/cat-alert_29.entry.js.map +1 -0
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/index.js +5 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{of-19888f3b.js → of-53334b95.js} +12 -4
- package/dist/esm/of-53334b95.js.map +1 -0
- package/dist/types/components/cat-date/cat-date.d.ts +11 -31
- package/dist/types/components/cat-date-inline/cat-date-inline.d.ts +81 -0
- package/dist/types/components/{cat-date → cat-date-inline}/cat-date-locale.d.ts +5 -0
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +9 -0
- package/dist/types/components/cat-form-group/cat-form-group.d.ts +3 -0
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +6 -0
- package/dist/types/components/cat-icon/cat-icon-registry.d.ts +1 -0
- package/dist/types/components/cat-notification/cat-notification.d.ts +3 -0
- package/dist/types/components/cat-time/cat-time-locale.d.ts +1 -0
- package/dist/types/components/cat-time/cat-time.d.ts +6 -1
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +209 -5
- package/package.json +2 -2
- package/dist/catalyst/p-81800b65.js +0 -2
- package/dist/catalyst/p-81800b65.js.map +0 -1
- package/dist/catalyst/p-8a1d505d.entry.js +0 -10
- package/dist/catalyst/p-8a1d505d.entry.js.map +0 -1
- package/dist/cjs/cat-alert_28.cjs.entry.js.map +0 -1
- package/dist/cjs/of-45281229.js.map +0 -1
- package/dist/collection/components/cat-date/cat-date-locale.js.map +0 -1
- package/dist/collection/components/cat-date/cat-date-math.js.map +0 -1
- package/dist/esm/cat-alert_28.entry.js.map +0 -1
- package/dist/esm/of-19888f3b.js.map +0 -1
- /package/dist/collection/components/{cat-date → cat-date-inline}/cat-date-math.js +0 -0
- /package/dist/types/components/{cat-date → cat-date-inline}/cat-date-math.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-ecb4a974.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-
|
|
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-53334b95.js';
|
|
3
3
|
|
|
4
4
|
const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
|
|
5
5
|
_super(this);
|
|
@@ -175,6 +175,7 @@ class AsyncAction extends Action {
|
|
|
175
175
|
this.pending = false;
|
|
176
176
|
}
|
|
177
177
|
schedule(state, delay = 0) {
|
|
178
|
+
var _a;
|
|
178
179
|
if (this.closed) {
|
|
179
180
|
return this;
|
|
180
181
|
}
|
|
@@ -186,7 +187,7 @@ class AsyncAction extends Action {
|
|
|
186
187
|
}
|
|
187
188
|
this.pending = true;
|
|
188
189
|
this.delay = delay;
|
|
189
|
-
this.id = this.id
|
|
190
|
+
this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);
|
|
190
191
|
return this;
|
|
191
192
|
}
|
|
192
193
|
requestAsyncId(scheduler, _id, delay = 0) {
|
|
@@ -196,7 +197,9 @@ class AsyncAction extends Action {
|
|
|
196
197
|
if (delay != null && this.delay === delay && this.pending === false) {
|
|
197
198
|
return id;
|
|
198
199
|
}
|
|
199
|
-
|
|
200
|
+
if (id != null) {
|
|
201
|
+
intervalProvider.clearInterval(id);
|
|
202
|
+
}
|
|
200
203
|
return undefined;
|
|
201
204
|
}
|
|
202
205
|
execute(state, delay) {
|
|
@@ -259,7 +262,6 @@ class AsyncScheduler extends Scheduler {
|
|
|
259
262
|
super(SchedulerAction, now);
|
|
260
263
|
this.actions = [];
|
|
261
264
|
this._active = false;
|
|
262
|
-
this._scheduled = undefined;
|
|
263
265
|
}
|
|
264
266
|
flush(action) {
|
|
265
267
|
const { actions } = this;
|
|
@@ -649,7 +651,7 @@ function delayWhen(delayDurationSelector, subscriptionDelay) {
|
|
|
649
651
|
if (subscriptionDelay) {
|
|
650
652
|
return (source) => concat(subscriptionDelay.pipe(take(1), ignoreElements()), source.pipe(delayWhen(delayDurationSelector)));
|
|
651
653
|
}
|
|
652
|
-
return mergeMap((value, index) => delayDurationSelector(value, index).pipe(take(1), mapTo(value)));
|
|
654
|
+
return mergeMap((value, index) => innerFrom(delayDurationSelector(value, index)).pipe(take(1), mapTo(value)));
|
|
653
655
|
}
|
|
654
656
|
|
|
655
657
|
function delay$1(due, scheduler = asyncScheduler) {
|
|
@@ -1040,7 +1042,7 @@ function createEmptyStyleRule(query) {
|
|
|
1040
1042
|
}
|
|
1041
1043
|
}
|
|
1042
1044
|
|
|
1043
|
-
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-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);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-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);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-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);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-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);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-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);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-time-format) .cat-button{border-radius:0}:host(.cat-date-toggle) .cat-button,:host(.cat-time-toggle) .cat-button{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}:host(.cat-date-item) .cat-button:hover,:host(.cat-date-toggle) .cat-button:hover,:host(.cat-time-format) .cat-button:hover,:host(.cat-time-toggle) .cat-button:hover{z-index:1}:host(.cat-date-item) .cat-button:focus-visible,:host(.cat-date-toggle) .cat-button:focus-visible,:host(.cat-time-format) .cat-button:focus-visible,:host(.cat-time-toggle) .cat-button:focus-visible{z-index:2}:host(.cat-date-item) .cat-button{padding-left:0;padding-right:0}";
|
|
1045
|
+
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:var(--cat-font-weight-button, 600);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-link{background-color:transparent;color:rgb(var(--text))}.cat-button-link.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-link:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-link.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-decoration-hover, underline)}.cat-button-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);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 113)}.cat-button-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);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-secondary-text-active, 0, 0, 0)}.cat-button-info{--bg:var(--cat-info-bg, 0, 115, 230);--fill:var(--cat-info-fill, 255, 255, 255);--text:var(--cat-info-text, 0, 115, 230);--base:var(--cat-info-text, 0, 115, 230)}.cat-button-info:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-hover, 0, 107, 227);--fill:var(--cat-info-fill-hover, 255, 255, 255);--text:var(--cat-info-text-hover, 0, 107, 227)}.cat-button-info.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-info:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-info-bg-active, 0, 96, 223);--fill:var(--cat-info-fill-active, 255, 255, 255);--text:var(--cat-info-text-active, 0, 96, 223)}.cat-button-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);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-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);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-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);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-danger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;height:1.5rem;padding:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;height:2rem;padding:0}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;height:2.5rem;padding:0}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;gap:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;height:3rem;padding:0}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;height:3.5rem;padding:0}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-secondary-bg:transparent;--cat-primary-text:transparent;--cat-danger-text:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-time-format) .cat-button{border-radius:0}:host(.cat-date-toggle) .cat-button,:host(.cat-time-toggle) .cat-button{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}:host(.cat-date-item) .cat-button:hover,:host(.cat-date-toggle) .cat-button:hover,:host(.cat-time-format) .cat-button:hover,:host(.cat-time-toggle) .cat-button:hover{z-index:1}:host(.cat-date-item) .cat-button:focus-visible,:host(.cat-date-toggle) .cat-button:focus-visible,:host(.cat-time-format) .cat-button:focus-visible,:host(.cat-time-toggle) .cat-button:focus-visible{z-index:2}:host(.cat-date-item) .cat-button{padding:0;aspect-ratio:1}:host(.date-start:not(.date-end)) .cat-button{border-top-right-radius:0;border-bottom-right-radius:0}:host(.date-end:not(.date-start)) .cat-button{border-top-left-radius:0;border-bottom-left-radius:0}";
|
|
1044
1046
|
const CatButtonStyle0 = catButtonCss;
|
|
1045
1047
|
|
|
1046
1048
|
const CatButton = class {
|
|
@@ -1261,7 +1263,7 @@ const CatFormHint = props => {
|
|
|
1261
1263
|
]));
|
|
1262
1264
|
};
|
|
1263
1265
|
|
|
1264
|
-
const catCheckboxCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.
|
|
1266
|
+
const catCheckboxCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.25rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative}.label-left{flex-direction:row-reverse}.label-left input{right:1px;left:unset}input{position:absolute;width:1.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit;left:1px;top:0.5px}.box-placeholder{width:calc(1.25rem + 2px);flex-shrink:0}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:var(--cat-border-radius-s, 0.125rem);transition:background-color 125ms ease, border-color 125ms ease;pointer-events:none;box-sizing:border-box}.box svg{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all 125ms ease;width:50%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:indeterminate+.box .check{stroke-dashoffset:16px}:indeterminate+.box .dash{stroke-dashoffset:0}:focus-visible+.box{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.is-disabled .box{background-color:#f2f4f7;border-color:rgb(var(--cat-border-color-dark, 215, 219, 224));stroke:rgb(var(--cat-font-color-muted, 81, 92, 108))}:host(.cat-error) .box{border:1px solid rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.box,:host(.cat-error) :indeterminate+.box{background-color:rgb(var(--cat-danger-bg, 217, 52, 13));border-color:rgb(var(--cat-danger-bg, 217, 52, 13));stroke:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto;min-width:0}.is-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}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
|
|
1265
1267
|
const CatCheckboxStyle0 = catCheckboxCss;
|
|
1266
1268
|
|
|
1267
1269
|
let nextUniqueId$8 = 0;
|
|
@@ -1384,6 +1386,7 @@ function getLocale$2(language) {
|
|
|
1384
1386
|
today: catI18nRegistry.t('datepicker.today'),
|
|
1385
1387
|
change: catI18nRegistry.t('datepicker.change'),
|
|
1386
1388
|
choose: catI18nRegistry.t('datepicker.choose'),
|
|
1389
|
+
clear: catI18nRegistry.t('datepicker.clear'),
|
|
1387
1390
|
formatStr: getFormat$1(language),
|
|
1388
1391
|
weekInfo: getWeekInfo(language),
|
|
1389
1392
|
days: {
|
|
@@ -1393,7 +1396,27 @@ function getLocale$2(language) {
|
|
|
1393
1396
|
months: {
|
|
1394
1397
|
short: getMonths(language, 'short'),
|
|
1395
1398
|
long: getMonths(language, 'long')
|
|
1396
|
-
}
|
|
1399
|
+
},
|
|
1400
|
+
now: () => {
|
|
1401
|
+
const date = new Date();
|
|
1402
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
1403
|
+
},
|
|
1404
|
+
fromLocalISO: (date) => {
|
|
1405
|
+
const [match, year, month, day] = date?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
1406
|
+
return match ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
|
|
1407
|
+
},
|
|
1408
|
+
toLocalISO: (date) => {
|
|
1409
|
+
const year = date.getFullYear();
|
|
1410
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
1411
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
1412
|
+
return `${year}-${month}-${day}`;
|
|
1413
|
+
},
|
|
1414
|
+
toLocalStr: (date) => new Intl.DateTimeFormat(language, {
|
|
1415
|
+
year: 'numeric',
|
|
1416
|
+
month: 'long',
|
|
1417
|
+
day: 'numeric',
|
|
1418
|
+
weekday: 'long'
|
|
1419
|
+
}).format(date)
|
|
1397
1420
|
};
|
|
1398
1421
|
}
|
|
1399
1422
|
|
|
@@ -1425,7 +1448,7 @@ function clampDate(min, date, max) {
|
|
|
1425
1448
|
return new Date(Math.min(Math.max(date.getTime(), min?.getTime() ?? -Infinity), max?.getTime() ?? Infinity));
|
|
1426
1449
|
}
|
|
1427
1450
|
|
|
1428
|
-
const catDateCss = ":host{display:block}:host([hidden]){display:none}.label-aria{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}
|
|
1451
|
+
const catDateCss = ":host{display:block}:host([hidden]){display:none}.label-aria{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}cat-date-inline{margin:1rem}";
|
|
1429
1452
|
const CatDateStyle0 = catDateCss;
|
|
1430
1453
|
|
|
1431
1454
|
const CatDate = class {
|
|
@@ -1436,13 +1459,8 @@ const CatDate = class {
|
|
|
1436
1459
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
1437
1460
|
this.language = catI18nRegistry.getLocale();
|
|
1438
1461
|
this.locale = getLocale$2(this.language);
|
|
1439
|
-
this.isOpen = false;
|
|
1440
|
-
// additonally store the focus date to ensure correct focus after potential re-render
|
|
1441
|
-
this.focusDate = null;
|
|
1442
1462
|
this.hasSlottedLabel = false;
|
|
1443
1463
|
this.hasSlottedHint = false;
|
|
1444
|
-
this.viewDate = this.now;
|
|
1445
|
-
this.selectionDate = null;
|
|
1446
1464
|
this.requiredMarker = 'optional';
|
|
1447
1465
|
this.horizontal = false;
|
|
1448
1466
|
this.autoComplete = undefined;
|
|
@@ -1468,29 +1486,24 @@ const CatDate = class {
|
|
|
1468
1486
|
this.nativeAttributes = undefined;
|
|
1469
1487
|
this.placement = 'bottom-end';
|
|
1470
1488
|
}
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
get minDate() {
|
|
1476
|
-
const [y, m, d] = this.min?.split('-').map(Number) || [];
|
|
1477
|
-
return this.min ? new Date(y, m - 1, d) : null;
|
|
1478
|
-
}
|
|
1479
|
-
get now() {
|
|
1480
|
-
const date = new Date();
|
|
1481
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
1489
|
+
onMinChanged(min, oldMin) {
|
|
1490
|
+
if (min !== oldMin) {
|
|
1491
|
+
this.reclamp('min', min);
|
|
1492
|
+
}
|
|
1482
1493
|
}
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
|
|
1494
|
+
onMaxChanged(max, oldMax) {
|
|
1495
|
+
if (max !== oldMax) {
|
|
1496
|
+
this.reclamp('max', max);
|
|
1497
|
+
}
|
|
1488
1498
|
}
|
|
1489
|
-
|
|
1499
|
+
get inputValue() {
|
|
1490
1500
|
const [match, year, month, day] = this.value?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
1491
1501
|
if (match) {
|
|
1492
|
-
|
|
1502
|
+
const date = new Date(Number(year), Number(month) - 1, Number(day));
|
|
1503
|
+
const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });
|
|
1504
|
+
return format.format(date);
|
|
1493
1505
|
}
|
|
1506
|
+
return '';
|
|
1494
1507
|
}
|
|
1495
1508
|
componentWillRender() {
|
|
1496
1509
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
@@ -1507,49 +1520,180 @@ const CatDate = class {
|
|
|
1507
1520
|
datePattern: [p1, p2, p3]
|
|
1508
1521
|
});
|
|
1509
1522
|
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Programmatically move focus to the input. Use this method instead of
|
|
1525
|
+
* `input.focus()`.
|
|
1526
|
+
*
|
|
1527
|
+
* @param options An optional object providing options to control aspects of
|
|
1528
|
+
* the focusing process.
|
|
1529
|
+
*/
|
|
1530
|
+
async doFocus(options) {
|
|
1531
|
+
this.input?.doFocus(options);
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Programmatically remove focus from the input. Use this method instead of
|
|
1535
|
+
* `input.blur()`.
|
|
1536
|
+
*/
|
|
1537
|
+
async doBlur() {
|
|
1538
|
+
this.input?.doBlur();
|
|
1539
|
+
}
|
|
1540
|
+
/**
|
|
1541
|
+
* Clear the input.
|
|
1542
|
+
*/
|
|
1543
|
+
async clear() {
|
|
1544
|
+
this.input?.clear();
|
|
1545
|
+
}
|
|
1546
|
+
render() {
|
|
1547
|
+
return (h(Host, { key: 'd588c96f031fc8ab9518d13dfaac730a0d424caa' }, h("cat-input", { key: 'f49f0682e2f2fe3dfcd89477bda91fe46ed44dfa', 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 => {
|
|
1548
|
+
e.stopPropagation();
|
|
1549
|
+
this.catFocus.emit(e.detail);
|
|
1550
|
+
}, onCatBlur: e => {
|
|
1551
|
+
e.stopPropagation();
|
|
1552
|
+
this.onInputBlur(e.detail);
|
|
1553
|
+
} }, h("span", { key: '68ef0708d25128b9a52d60c5b1a7b34e0ffb2ef1', slot: "label" }, this.label, h("span", { key: 'ac017335567a4e0059631e7535455d52f61f2e43', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '16a6e95f6e4f6a9b0ddd7716f0b713c8fac3fdff', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'cf7f2aaa2c5775b23f3e8826e9b0e722c4ce8be6', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: 'f90eef976a3102855801df5ffeee770d45e7eaba', slot: "content" }, h("cat-date-inline", { key: '853b3adee0ea8f9c9b2a1276a10fcaa299044b42', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
|
|
1554
|
+
}
|
|
1555
|
+
getTriggerA11yLabel() {
|
|
1556
|
+
const date = this.locale.fromLocalISO(this.value);
|
|
1557
|
+
return date ? `${this.locale.change}, ${this.locale.toLocalStr(date)}` : this.locale.choose;
|
|
1558
|
+
}
|
|
1559
|
+
onInputBlur(e) {
|
|
1560
|
+
if (!this.input) {
|
|
1561
|
+
return;
|
|
1562
|
+
}
|
|
1563
|
+
const oldValue = this.value;
|
|
1564
|
+
const dateParsed = this.parse(this.input.value ?? '');
|
|
1565
|
+
const dateMin = this.locale.fromLocalISO(this.min);
|
|
1566
|
+
const dateMax = this.locale.fromLocalISO(this.max);
|
|
1567
|
+
const date = dateParsed ? clampDate(dateMin, dateParsed, dateMax) : null;
|
|
1568
|
+
this.value = date ? this.locale.toLocalISO(date) : undefined;
|
|
1569
|
+
if (oldValue !== this.value) {
|
|
1570
|
+
if (date) {
|
|
1571
|
+
this.dateInline?.select(date);
|
|
1572
|
+
}
|
|
1573
|
+
else {
|
|
1574
|
+
this.dateInline?.clear();
|
|
1575
|
+
}
|
|
1576
|
+
this.catChange.emit(this.value);
|
|
1577
|
+
}
|
|
1578
|
+
this.input.value = this.inputValue;
|
|
1579
|
+
this.catBlur.emit(e);
|
|
1580
|
+
}
|
|
1581
|
+
onDateChange(e) {
|
|
1582
|
+
e.stopPropagation();
|
|
1583
|
+
const oldValue = this.value;
|
|
1584
|
+
const date = e.detail ? new Date(e.detail) : null;
|
|
1585
|
+
this.value = date ? this.locale.toLocalISO(date) : undefined;
|
|
1586
|
+
if (oldValue !== this.value) {
|
|
1587
|
+
this.catChange.emit(this.value);
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
parse(value) {
|
|
1591
|
+
const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(this.locale.formatStr) || [];
|
|
1592
|
+
const formatParts = [p1, p2, p3];
|
|
1593
|
+
const parts = value.split(d1).map(s => Number(s || 'x'));
|
|
1594
|
+
let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.locale.now().getFullYear();
|
|
1595
|
+
const month = parts[formatParts.indexOf('MM')];
|
|
1596
|
+
const day = parts[formatParts.indexOf('DD')];
|
|
1597
|
+
if (!Number.isInteger(month) || !Number.isInteger(day)) {
|
|
1598
|
+
return null;
|
|
1599
|
+
}
|
|
1600
|
+
else if (year < 100) {
|
|
1601
|
+
year += year < 50 ? 2000 : 1900;
|
|
1602
|
+
}
|
|
1603
|
+
return new Date(year, month - 1, day);
|
|
1604
|
+
}
|
|
1605
|
+
reclamp(mode, limit) {
|
|
1606
|
+
const oldValue = this.value;
|
|
1607
|
+
const oldDate = this.locale.fromLocalISO(oldValue);
|
|
1608
|
+
const limitDate = this.locale.fromLocalISO(limit);
|
|
1609
|
+
if (!oldDate || !limitDate) {
|
|
1610
|
+
return;
|
|
1611
|
+
}
|
|
1612
|
+
const newDate = clampDate(mode === 'min' ? limitDate : null, oldDate, mode === 'max' ? limitDate : null);
|
|
1613
|
+
const newValue = this.locale.toLocalISO(newDate);
|
|
1614
|
+
if (oldValue !== newValue) {
|
|
1615
|
+
this.value = newValue;
|
|
1616
|
+
this.catChange.emit(newValue);
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
get hostElement() { return getElement(this); }
|
|
1620
|
+
static get watchers() { return {
|
|
1621
|
+
"min": ["onMinChanged"],
|
|
1622
|
+
"max": ["onMaxChanged"]
|
|
1623
|
+
}; }
|
|
1624
|
+
};
|
|
1625
|
+
CatDate.style = CatDateStyle0;
|
|
1626
|
+
|
|
1627
|
+
const catDateInlineCss = ":host{display:inline-block}:host([hidden]){display:none}.picker{display:flex;flex-direction:column;min-width:19.5rem;max-width:30rem}.picker.picker-weeks{min-width:17.5rem;max-width:28rem}.picker.picker-small{min-width:16rem;max-width:23rem}.picker.picker-small.picker-weeks{min-width:14rem;max-width:21rem}.picker-head{display:flex;gap:0.5rem;align-items:center}.picker-head h3{font-size:1.125rem;line-height:1.5rem;font-weight:var(--cat-font-weight-head, 600);font-feature-settings:\"pnum\";flex:1;text-align:center;margin:0}.picker-small .picker-head{gap:0.25rem}.picker-small .picker-head h3{font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-head, 600);font-feature-settings:\"pnum\"}.picker-grid{display:grid;grid-template-rows:2rem repeat(6, 1fr);grid-template-columns:repeat(7, 1fr);grid-template-areas:\"h h h h h h h\" \"d d d d d d d\" \"d d d d d d d\" \"d d d d d d d\" \"d d d d d d d\" \"d d d d d d d\" \"d d d d d d d\";margin:1rem 0 0.5rem}.picker-weeks .picker-grid{grid-template-columns:2rem repeat(7, 1fr);grid-template-areas:\". h h h h h h h\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\" \"w d d d d d d d\";}.picker-small .picker-grid{margin:0.5rem 0}.picker-grid-head{grid-area:h;display:grid;grid-template-columns:repeat(7, 1fr);place-items:end center;padding-bottom:0.5rem}.picker-grid-weeks{grid-area:w;display:grid;grid-template-rows:repeat(6, 1fr);place-items:center right;padding-right:0.5rem}.picker-grid-days{grid-area:d;display:grid;grid-template-rows:repeat(6, 1fr);grid-template-columns:repeat(7, 1fr)}.picker-grid-head>*,.picker-grid-weeks>*{font-size:0.75rem;line-height:1rem;font-weight:600;color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;text-decoration:none}.date-other{opacity:0.5}.date-disabled{opacity:0.25}.picker-foot{display:flex;gap:1rem;align-items:center;width:min-content;min-width:100%;justify-content:space-between}.picker-small .picker-foot{gap:0.5rem}.cursor-help{margin:0;font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important;text-align:center;flex:1}.cursor-help:first-child{text-align:left}.cursor-help:last-child{text-align:right}.cursor-help:only-child{text-align:center}.picker-small .cursor-help{font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400)}.cursor-aria{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}.date-range{--cat-border-radius-m:0}";
|
|
1628
|
+
const CatDateInlineStyle0 = catDateInlineCss;
|
|
1629
|
+
|
|
1630
|
+
const CatDateInline = class {
|
|
1631
|
+
constructor(hostRef) {
|
|
1632
|
+
registerInstance(this, hostRef);
|
|
1633
|
+
this.catChange = createEvent(this, "catChange", 7);
|
|
1634
|
+
this.language = catI18nRegistry.getLocale();
|
|
1635
|
+
this.locale = getLocale$2(this.language);
|
|
1636
|
+
// additonally store the focus date to ensure correct focus after potential re-render
|
|
1637
|
+
this.focusDate = null;
|
|
1638
|
+
this.viewDate = this.locale.now();
|
|
1639
|
+
this.noClear = false;
|
|
1640
|
+
this.noHint = false;
|
|
1641
|
+
this.noToday = false;
|
|
1642
|
+
this.noWeeks = false;
|
|
1643
|
+
this.size = 'm';
|
|
1644
|
+
this.min = undefined;
|
|
1645
|
+
this.max = undefined;
|
|
1646
|
+
this.range = false;
|
|
1647
|
+
this.value = undefined;
|
|
1648
|
+
}
|
|
1649
|
+
get focusedDate() {
|
|
1650
|
+
const [all, year, month, day] = this.hostElement.shadowRoot
|
|
1651
|
+
?.querySelector(`[data-date]:focus`)
|
|
1652
|
+
?.dataset.date?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
1653
|
+
return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
|
|
1654
|
+
}
|
|
1655
|
+
componentWillLoad() {
|
|
1656
|
+
// select the initial value
|
|
1657
|
+
const [startDate, endDate] = this.getValue();
|
|
1658
|
+
this.select(startDate);
|
|
1659
|
+
if (this.range && endDate) {
|
|
1660
|
+
this.select(endDate);
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1510
1663
|
componentDidRender() {
|
|
1511
1664
|
if (this.focusDate) {
|
|
1665
|
+
// re-focus the previously focused date after re-render
|
|
1512
1666
|
this.hostElement.shadowRoot
|
|
1513
|
-
?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
|
|
1667
|
+
?.querySelector(`[data-date="${this.locale.toLocalISO(this.focusDate)}"]`)
|
|
1514
1668
|
?.doFocus();
|
|
1515
1669
|
this.focusDate = null;
|
|
1516
1670
|
}
|
|
1517
1671
|
}
|
|
1518
|
-
onOpen() {
|
|
1519
|
-
this.isOpen = true;
|
|
1520
|
-
this.setAriaLive('');
|
|
1521
|
-
const viewDate = this.selectionDate
|
|
1522
|
-
? new Date(this.selectionDate.getFullYear(), this.selectionDate.getMonth(), 1)
|
|
1523
|
-
: this.now;
|
|
1524
|
-
this.viewDate = clampDate(this.minDate, viewDate, this.maxDate);
|
|
1525
|
-
}
|
|
1526
|
-
onClose() {
|
|
1527
|
-
this.isOpen = false;
|
|
1528
|
-
}
|
|
1529
1672
|
onKeyDown(e) {
|
|
1530
|
-
if (!
|
|
1673
|
+
if (!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {
|
|
1531
1674
|
return;
|
|
1532
1675
|
}
|
|
1533
|
-
const
|
|
1534
|
-
if (!
|
|
1676
|
+
const focusedDate = this.focusedDate;
|
|
1677
|
+
if (!focusedDate) {
|
|
1535
1678
|
e.preventDefault();
|
|
1536
|
-
|
|
1679
|
+
const [startDate] = this.getValue();
|
|
1680
|
+
this.focus(startDate || this.locale.now());
|
|
1537
1681
|
}
|
|
1538
1682
|
else if (e.key === 'ArrowLeft') {
|
|
1539
1683
|
e.preventDefault();
|
|
1540
|
-
this.focus(e.shiftKey ? addMonth(
|
|
1684
|
+
this.focus(e.shiftKey ? addMonth(focusedDate, -1) : addDays(focusedDate, -1));
|
|
1541
1685
|
}
|
|
1542
1686
|
else if (e.key === 'ArrowRight') {
|
|
1543
1687
|
e.preventDefault();
|
|
1544
|
-
this.focus(e.shiftKey ? addMonth(
|
|
1688
|
+
this.focus(e.shiftKey ? addMonth(focusedDate, 1) : addDays(focusedDate, 1));
|
|
1545
1689
|
}
|
|
1546
1690
|
else if (e.key === 'ArrowUp') {
|
|
1547
1691
|
e.preventDefault();
|
|
1548
|
-
this.focus(addDays(
|
|
1692
|
+
this.focus(addDays(focusedDate, -7));
|
|
1549
1693
|
}
|
|
1550
1694
|
else if (e.key === 'ArrowDown') {
|
|
1551
1695
|
e.preventDefault();
|
|
1552
|
-
this.focus(addDays(
|
|
1696
|
+
this.focus(addDays(focusedDate, 7));
|
|
1553
1697
|
}
|
|
1554
1698
|
}
|
|
1555
1699
|
/**
|
|
@@ -1558,76 +1702,76 @@ const CatDate = class {
|
|
|
1558
1702
|
* @param date The date to select.
|
|
1559
1703
|
*/
|
|
1560
1704
|
async select(date) {
|
|
1705
|
+
if (!date) {
|
|
1706
|
+
return this.clear();
|
|
1707
|
+
}
|
|
1561
1708
|
const oldValue = this.value;
|
|
1562
|
-
const
|
|
1709
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1710
|
+
const newDate = clampDate(minDate, new Date(date.getFullYear(), date.getMonth(), date.getDate()), maxDate);
|
|
1563
1711
|
this.focus(newDate);
|
|
1564
|
-
this.
|
|
1565
|
-
|
|
1712
|
+
if (this.range) {
|
|
1713
|
+
const [startDate, endDate] = this.getValue();
|
|
1714
|
+
if (!startDate || endDate || newDate < startDate) {
|
|
1715
|
+
this.value = this.toRangeValue(newDate, null);
|
|
1716
|
+
}
|
|
1717
|
+
else {
|
|
1718
|
+
this.value = this.toRangeValue(startDate, newDate);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
else {
|
|
1722
|
+
this.value = this.locale.toLocalISO(newDate);
|
|
1723
|
+
}
|
|
1566
1724
|
if (oldValue !== this.value) {
|
|
1567
1725
|
this.catChange.emit(this.value);
|
|
1568
1726
|
}
|
|
1569
1727
|
}
|
|
1570
1728
|
/**
|
|
1571
|
-
*
|
|
1572
|
-
* `input.focus()`.
|
|
1573
|
-
*
|
|
1574
|
-
* @param options An optional object providing options to control aspects of
|
|
1575
|
-
* the focusing process.
|
|
1576
|
-
*/
|
|
1577
|
-
async doFocus(options) {
|
|
1578
|
-
this.input?.doFocus(options);
|
|
1579
|
-
}
|
|
1580
|
-
/**
|
|
1581
|
-
* Programmatically remove focus from the input. Use this method instead of
|
|
1582
|
-
* `input.blur()`.
|
|
1729
|
+
* Clear the picker.
|
|
1583
1730
|
*/
|
|
1584
|
-
async
|
|
1585
|
-
this.
|
|
1731
|
+
async clear() {
|
|
1732
|
+
const oldValue = this.value;
|
|
1733
|
+
this.value = undefined;
|
|
1734
|
+
if (oldValue !== this.value) {
|
|
1735
|
+
this.catChange.emit(this.value);
|
|
1736
|
+
}
|
|
1586
1737
|
}
|
|
1587
1738
|
/**
|
|
1588
|
-
*
|
|
1739
|
+
* Resets the view of the picker.
|
|
1589
1740
|
*/
|
|
1590
|
-
async
|
|
1591
|
-
this.
|
|
1741
|
+
async resetView() {
|
|
1742
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1743
|
+
const [dateStart] = this.getValue();
|
|
1744
|
+
this.viewDate = dateStart ?? clampDate(minDate, this.locale.now(), maxDate);
|
|
1592
1745
|
}
|
|
1593
1746
|
render() {
|
|
1747
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1594
1748
|
const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
: this.locale.choose }), h("div", { key: '9cfb02ca034584dcdd23fadb5f41ca598552a605', class: "picker", slot: "content" }, h("div", { key: '4d09c5f3ca84346bbcc68f4c83f3413159b8b608', class: "picker-head" }, h("cat-button", { key: '9e8d1695f1a882f2388a2b57ccd8cc51e8b52483', icon: "$cat:datepicker-year-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevYear, disabled: isSameYear(this.viewDate, this.minDate), onClick: () => this.navigate('prev', 'year'), "data-dropdown-no-close": true }), h("cat-button", { key: '5af1b092c2f0d13e5c12d49699e85ea5dded7580', icon: "$cat:datepicker-month-prev", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.prevMonth, disabled: isSameMonth(this.viewDate, this.minDate), onClick: () => this.navigate('prev', 'month'), "data-dropdown-no-close": true }), h("h3", { key: 'cd730386e0fc19a4b12ee2910e6de7f079133584' }, this.getHeadline()), h("cat-button", { key: 'f0c76ac04573977e255956d2e377dd197080a5b8', icon: "$cat:datepicker-month-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextMonth, disabled: isSameMonth(this.viewDate, this.maxDate), onClick: () => this.navigate('next', 'month'), "data-dropdown-no-close": true }), h("cat-button", { key: 'd58917e0665df029acc6dac35e7ab05eab60f9d4', icon: "$cat:datepicker-year-next", iconOnly: true, size: "xs", variant: "text", "a11y-label": this.locale.nextYear, disabled: isSameYear(this.viewDate, this.maxDate), onClick: () => this.navigate('next', 'year'), "data-dropdown-no-close": true })), h("div", { key: '5307170ba72c90fceef4276aa5feb74dc569c74d', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, h("div", { key: 'acd6b0e720722ed3e3d013463645fe294a75b68d', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => (h("abbr", { title: this.locale.days.long[i] }, this.locale.days.short[i])))), h("div", { key: 'a8b349d48f3595b7a29a037fb48b130dfb9af438', class: "picker-grid-weeks" }, dateGrid
|
|
1749
|
+
const [dateStart, dateEnd] = this.getValue();
|
|
1750
|
+
return (h(Host, { key: '2b21e43ebc9a69988b475f2eae1eb2f2aeee97cb' }, h("div", { key: '3f256483614d09440bee07be4e8996bc1c187d2b', class: { picker: true, 'picker-small': this.size === 's', 'picker-weeks': !this.noWeeks } }, h("div", { key: 'c9d82a518d78439164e99240fa13afabcc81e267', class: "picker-head" }, h("cat-button", { key: 'bcc803acb0ac2d7947fa53615ca105d77063e9f9', 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: '3626bbe3e1a79c08d7a6257cb78ce398ceb1b750', 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: '92462a6702792afd573c91f0c12e2bae599378ae' }, this.getHeadline()), h("cat-button", { key: '4ce63e1451b820098feea0ff2f45d9b7d0b5cc28', 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: '97adedac70ce8f19ba0725ca6a1bb836a1d8c0c3', 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: '9bbc58c07f911e928cd231a784604abada3698ea', class: "picker-grid", onFocusin: () => this.setAriaLive(this.locale.arrowKeys) }, h("div", { key: '2eff946487bfdbce49521b513d6065bd42c78ac0', class: "picker-grid-head" }, Array.from(Array(7), (_, i) => (h("abbr", { title: this.locale.days.long[i] }, this.locale.days.short[i])))), !this.noWeeks && (h("div", { class: "picker-grid-weeks" }, dateGrid
|
|
1598
1751
|
.filter((_, i) => i % 7 === 0)
|
|
1599
|
-
.map(day => (h("div", null, this.getWeekNumber(day))))), h("div", { key: '
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.now.getFullYear();
|
|
1616
|
-
const month = parts[formatParts.indexOf('MM')];
|
|
1617
|
-
const day = parts[formatParts.indexOf('DD')];
|
|
1618
|
-
if (!Number.isInteger(month) || !Number.isInteger(day)) {
|
|
1619
|
-
return null;
|
|
1620
|
-
}
|
|
1621
|
-
else if (year < 100) {
|
|
1622
|
-
year += year < 50 ? 2000 : 1900;
|
|
1623
|
-
}
|
|
1624
|
-
return new Date(year, month - 1, day);
|
|
1752
|
+
.map(day => (h("div", null, this.getWeekNumber(day)))))), h("div", { key: '48f7b239e8ccb0d56b4f7c80d8892b79c2908990', class: "picker-grid-days" }, dateGrid.map(day => {
|
|
1753
|
+
const isStartDate = isSameDay(dateStart, day);
|
|
1754
|
+
const isEndDate = isSameDay(dateEnd, day);
|
|
1755
|
+
const isRange = !!dateStart && !!dateEnd && day > dateStart && day < dateEnd;
|
|
1756
|
+
const isToday = isSameDay(this.locale.now(), day);
|
|
1757
|
+
return (h("cat-button", { class: {
|
|
1758
|
+
'cat-date-item': true,
|
|
1759
|
+
'date-other': !isSameMonth(this.viewDate, day),
|
|
1760
|
+
'date-today': isToday,
|
|
1761
|
+
'date-start': this.range && isStartDate,
|
|
1762
|
+
'date-range': this.range && isRange,
|
|
1763
|
+
'date-end': this.range && isEndDate,
|
|
1764
|
+
'date-focusable': this.canFocus(day),
|
|
1765
|
+
'date-disabled': !this.canClick(day)
|
|
1766
|
+
}, size: this.size, 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()));
|
|
1767
|
+
}))), h("div", { key: 'e6c30b78568d92d3a17936fdff4c7fec1ac4965f', class: "picker-foot" }, !this.noToday && this.canClick(this.locale.now()) && (h("cat-button", { size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.locale.now()) }, this.locale.today)), !this.noHint && h("p", { class: "cursor-help" }, this.locale.arrowKeys), !this.noClear && (h("cat-button", { size: "s", disabled: !this.value, "data-dropdown-no-close": true, onClick: () => this.clear() }, this.locale.clear)))), h("p", { key: 'e31cabf38ed3545ddd4acc32c2540eb5706bc17c', class: "cursor-aria", "aria-live": "polite" })));
|
|
1625
1768
|
}
|
|
1626
1769
|
focus(date) {
|
|
1627
|
-
|
|
1770
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1771
|
+
this.focusDate = clampDate(minDate, date, maxDate);
|
|
1628
1772
|
this.viewDate = new Date(this.focusDate.getFullYear(), this.focusDate.getMonth());
|
|
1629
1773
|
this.hostElement.shadowRoot
|
|
1630
|
-
?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
|
|
1774
|
+
?.querySelector(`[data-date="${this.locale.toLocalISO(this.focusDate)}"]`)
|
|
1631
1775
|
?.doFocus();
|
|
1632
1776
|
}
|
|
1633
1777
|
navigate(direction, period) {
|
|
@@ -1647,20 +1791,6 @@ const CatDate = class {
|
|
|
1647
1791
|
node.innerHTML = text;
|
|
1648
1792
|
}
|
|
1649
1793
|
}
|
|
1650
|
-
onInputBlur(e) {
|
|
1651
|
-
if (!this.input) {
|
|
1652
|
-
return;
|
|
1653
|
-
}
|
|
1654
|
-
const oldValue = this.value;
|
|
1655
|
-
const value = this.parse(this.input.value ?? '');
|
|
1656
|
-
this.selectionDate = value ? clampDate(this.minDate, value, this.maxDate) : value;
|
|
1657
|
-
this.value = this.selectionDate?.toISOString();
|
|
1658
|
-
if (oldValue !== this.value) {
|
|
1659
|
-
this.catChange.emit(this.value);
|
|
1660
|
-
}
|
|
1661
|
-
this.input.value = this.getInputValue();
|
|
1662
|
-
this.catBlur.emit(e);
|
|
1663
|
-
}
|
|
1664
1794
|
dateGrid(year, month) {
|
|
1665
1795
|
const firstDayOfWeek = new Date(year, month, 1).getDay();
|
|
1666
1796
|
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
@@ -1676,19 +1806,6 @@ const CatDate = class {
|
|
|
1676
1806
|
getHeadline() {
|
|
1677
1807
|
return `${this.locale.months.long[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`;
|
|
1678
1808
|
}
|
|
1679
|
-
getInputValue() {
|
|
1680
|
-
const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });
|
|
1681
|
-
return this.selectionDate ? format.format(this.selectionDate) : '';
|
|
1682
|
-
}
|
|
1683
|
-
getA11yLabelDay(date) {
|
|
1684
|
-
const format = new Intl.DateTimeFormat(this.language, {
|
|
1685
|
-
year: 'numeric',
|
|
1686
|
-
month: 'long',
|
|
1687
|
-
day: 'numeric',
|
|
1688
|
-
weekday: 'long'
|
|
1689
|
-
});
|
|
1690
|
-
return format.format(date);
|
|
1691
|
-
}
|
|
1692
1809
|
getWeekNumber(date, iso8601 = true) {
|
|
1693
1810
|
const currentDate = new Date(date.getTime());
|
|
1694
1811
|
const dayNum = iso8601 ? currentDate.getDay() || 7 : currentDate.getDay();
|
|
@@ -1697,34 +1814,46 @@ const CatDate = class {
|
|
|
1697
1814
|
return Math.ceil(((+currentDate - +yearStart) / 86400000 + 1) / 7);
|
|
1698
1815
|
}
|
|
1699
1816
|
canFocus(date) {
|
|
1700
|
-
const now = this.now;
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1703
|
-
|
|
1817
|
+
const now = this.locale.now();
|
|
1818
|
+
const [minDate] = this.getMinMaxDate();
|
|
1819
|
+
const focusedDate = this.focusedDate;
|
|
1820
|
+
const [startDate] = this.getValue();
|
|
1821
|
+
if (focusedDate && isSameMonth(focusedDate, this.viewDate)) {
|
|
1822
|
+
return isSameMonth(focusedDate, date) && isSameDay(focusedDate, date);
|
|
1704
1823
|
}
|
|
1705
|
-
else if (
|
|
1706
|
-
return isSameMonth(
|
|
1824
|
+
else if (startDate && isSameMonth(startDate, this.viewDate)) {
|
|
1825
|
+
return isSameMonth(startDate, date) && isSameDay(startDate, date);
|
|
1707
1826
|
}
|
|
1708
|
-
else if (isSameMonth(this.viewDate, now) && (!
|
|
1827
|
+
else if (isSameMonth(this.viewDate, now) && (!minDate || minDate <= now)) {
|
|
1709
1828
|
return isSameMonth(this.viewDate, date) && isSameDay(now, date);
|
|
1710
1829
|
}
|
|
1711
|
-
const minDay = isSameMonth(date,
|
|
1830
|
+
const minDay = isSameMonth(date, minDate) ? minDate?.getDate() ?? 1 : 1;
|
|
1712
1831
|
return isSameMonth(this.viewDate, date) && date.getDate() === minDay;
|
|
1713
1832
|
}
|
|
1714
1833
|
canClick(date) {
|
|
1715
|
-
const
|
|
1716
|
-
|
|
1717
|
-
|
|
1834
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1835
|
+
return (!minDate || minDate <= date) && (!maxDate || maxDate >= date);
|
|
1836
|
+
}
|
|
1837
|
+
getMinMaxDate() {
|
|
1838
|
+
const minDate = this.locale.fromLocalISO(this.min);
|
|
1839
|
+
const maxDate = this.locale.fromLocalISO(this.max);
|
|
1840
|
+
return [minDate, maxDate];
|
|
1841
|
+
}
|
|
1842
|
+
getValue() {
|
|
1843
|
+
if (this.range) {
|
|
1844
|
+
const [startDate, endDate] = JSON.parse(this.value || '[]');
|
|
1845
|
+
return [this.locale.fromLocalISO(startDate), this.locale.fromLocalISO(endDate)];
|
|
1846
|
+
}
|
|
1847
|
+
else {
|
|
1848
|
+
return [this.locale.fromLocalISO(this.value), null];
|
|
1849
|
+
}
|
|
1718
1850
|
}
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
1722
|
-
const day = date.getDate().toString().padStart(2, '0');
|
|
1723
|
-
return `${year}-${month}-${day}`;
|
|
1851
|
+
toRangeValue(startDate, endDate) {
|
|
1852
|
+
return JSON.stringify([startDate, endDate].map(date => (date ? this.locale.toLocalISO(date) : null)));
|
|
1724
1853
|
}
|
|
1725
1854
|
get hostElement() { return getElement(this); }
|
|
1726
1855
|
};
|
|
1727
|
-
|
|
1856
|
+
CatDateInline.style = CatDateInlineStyle0;
|
|
1728
1857
|
|
|
1729
1858
|
var HOOKS = [
|
|
1730
1859
|
"onChange",
|
|
@@ -4537,8 +4666,18 @@ function getLocale$1(language) {
|
|
|
4537
4666
|
};
|
|
4538
4667
|
}
|
|
4539
4668
|
|
|
4540
|
-
|
|
4541
|
-
|
|
4669
|
+
/**
|
|
4670
|
+
* Custom positioning reference element.
|
|
4671
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
4672
|
+
*/
|
|
4673
|
+
const min = Math.min;
|
|
4674
|
+
const max = Math.max;
|
|
4675
|
+
const round = Math.round;
|
|
4676
|
+
const floor = Math.floor;
|
|
4677
|
+
const createCoords = v => ({
|
|
4678
|
+
x: v,
|
|
4679
|
+
y: v
|
|
4680
|
+
});
|
|
4542
4681
|
const oppositeSideMap = {
|
|
4543
4682
|
left: 'right',
|
|
4544
4683
|
right: 'left',
|
|
@@ -4550,7 +4689,7 @@ const oppositeAlignmentMap = {
|
|
|
4550
4689
|
end: 'start'
|
|
4551
4690
|
};
|
|
4552
4691
|
function clamp(start, value, end) {
|
|
4553
|
-
return max
|
|
4692
|
+
return max(start, min(value, end));
|
|
4554
4693
|
}
|
|
4555
4694
|
function evaluate(value, param) {
|
|
4556
4695
|
return typeof value === 'function' ? value(param) : value;
|
|
@@ -4709,7 +4848,7 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
4709
4848
|
|
|
4710
4849
|
/**
|
|
4711
4850
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
4712
|
-
* next to a reference element
|
|
4851
|
+
* next to a given reference element.
|
|
4713
4852
|
*
|
|
4714
4853
|
* This export does not have any `platform` interface logic. You will need to
|
|
4715
4854
|
* write one for the platform you are using Floating UI with.
|
|
@@ -4787,7 +4926,6 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
4787
4926
|
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
4788
4927
|
}
|
|
4789
4928
|
i = -1;
|
|
4790
|
-
continue;
|
|
4791
4929
|
}
|
|
4792
4930
|
}
|
|
4793
4931
|
return {
|
|
@@ -4850,6 +4988,7 @@ async function detectOverflow(state, options) {
|
|
|
4850
4988
|
y: 1
|
|
4851
4989
|
};
|
|
4852
4990
|
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
4991
|
+
elements,
|
|
4853
4992
|
rect,
|
|
4854
4993
|
offsetParent,
|
|
4855
4994
|
strategy
|
|
@@ -4979,6 +5118,7 @@ const flip$1 = function (options) {
|
|
|
4979
5118
|
|
|
4980
5119
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
4981
5120
|
// Derivable.
|
|
5121
|
+
|
|
4982
5122
|
async function convertValueToCoords(state, options) {
|
|
4983
5123
|
const {
|
|
4984
5124
|
placement,
|
|
@@ -4992,8 +5132,6 @@ async function convertValueToCoords(state, options) {
|
|
|
4992
5132
|
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
4993
5133
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
4994
5134
|
const rawValue = evaluate(options, state);
|
|
4995
|
-
|
|
4996
|
-
// eslint-disable-next-line prefer-const
|
|
4997
5135
|
let {
|
|
4998
5136
|
mainAxis,
|
|
4999
5137
|
crossAxis,
|
|
@@ -5035,15 +5173,27 @@ const offset = function (options) {
|
|
|
5035
5173
|
name: 'offset',
|
|
5036
5174
|
options,
|
|
5037
5175
|
async fn(state) {
|
|
5176
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
5038
5177
|
const {
|
|
5039
5178
|
x,
|
|
5040
|
-
y
|
|
5179
|
+
y,
|
|
5180
|
+
placement,
|
|
5181
|
+
middlewareData
|
|
5041
5182
|
} = state;
|
|
5042
5183
|
const diffCoords = await convertValueToCoords(state, options);
|
|
5184
|
+
|
|
5185
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
5186
|
+
// then we don't need to change the positioning coordinates.
|
|
5187
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
5188
|
+
return {};
|
|
5189
|
+
}
|
|
5043
5190
|
return {
|
|
5044
5191
|
x: x + diffCoords.x,
|
|
5045
5192
|
y: y + diffCoords.y,
|
|
5046
|
-
data:
|
|
5193
|
+
data: {
|
|
5194
|
+
...diffCoords,
|
|
5195
|
+
placement
|
|
5196
|
+
}
|
|
5047
5197
|
};
|
|
5048
5198
|
}
|
|
5049
5199
|
};
|
|
@@ -5171,20 +5321,20 @@ const size$1 = function (options) {
|
|
|
5171
5321
|
let availableWidth = overflowAvailableWidth;
|
|
5172
5322
|
if (isYAxis) {
|
|
5173
5323
|
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
5174
|
-
availableWidth = alignment || noShift ? min
|
|
5324
|
+
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
5175
5325
|
} else {
|
|
5176
5326
|
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
5177
|
-
availableHeight = alignment || noShift ? min
|
|
5327
|
+
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
5178
5328
|
}
|
|
5179
5329
|
if (noShift && !alignment) {
|
|
5180
|
-
const xMin = max
|
|
5181
|
-
const xMax = max
|
|
5182
|
-
const yMin = max
|
|
5183
|
-
const yMax = max
|
|
5330
|
+
const xMin = max(overflow.left, 0);
|
|
5331
|
+
const xMax = max(overflow.right, 0);
|
|
5332
|
+
const yMin = max(overflow.top, 0);
|
|
5333
|
+
const yMax = max(overflow.bottom, 0);
|
|
5184
5334
|
if (isYAxis) {
|
|
5185
|
-
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max
|
|
5335
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
5186
5336
|
} else {
|
|
5187
|
-
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max
|
|
5337
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
5188
5338
|
}
|
|
5189
5339
|
}
|
|
5190
5340
|
await apply({
|
|
@@ -5205,19 +5355,6 @@ const size$1 = function (options) {
|
|
|
5205
5355
|
};
|
|
5206
5356
|
};
|
|
5207
5357
|
|
|
5208
|
-
/**
|
|
5209
|
-
* Custom positioning reference element.
|
|
5210
|
-
* @see https://floating-ui.com/docs/virtual-elements
|
|
5211
|
-
*/
|
|
5212
|
-
const min = Math.min;
|
|
5213
|
-
const max = Math.max;
|
|
5214
|
-
const round = Math.round;
|
|
5215
|
-
const floor = Math.floor;
|
|
5216
|
-
const createCoords = v => ({
|
|
5217
|
-
x: v,
|
|
5218
|
-
y: v
|
|
5219
|
-
});
|
|
5220
|
-
|
|
5221
5358
|
function getNodeName(node) {
|
|
5222
5359
|
if (isNode(node)) {
|
|
5223
5360
|
return (node.nodeName || '').toLowerCase();
|
|
@@ -6084,7 +6221,7 @@ const CatDatepickerFlat = class {
|
|
|
6084
6221
|
}
|
|
6085
6222
|
render() {
|
|
6086
6223
|
return [
|
|
6087
|
-
h("cat-input", { key: '
|
|
6224
|
+
h("cat-input", { key: 'bb983974c17139ee60d88877e398b1c46d672d37', 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 => {
|
|
6088
6225
|
e.stopPropagation();
|
|
6089
6226
|
this.value = e.detail || undefined;
|
|
6090
6227
|
}, onCatFocus: e => {
|
|
@@ -6094,7 +6231,7 @@ const CatDatepickerFlat = class {
|
|
|
6094
6231
|
e.stopPropagation();
|
|
6095
6232
|
this.catBlur.emit(e.detail);
|
|
6096
6233
|
} }, this.hasSlottedLabel && (h("span", { slot: "label" }, h("slot", { name: "label" }))), this.hasSlottedHint && (h("span", { slot: "hint" }, h("slot", { name: "hint" })))),
|
|
6097
|
-
h("div", { key: '
|
|
6234
|
+
h("div", { key: 'c8112214544e0582a1196350a846ddeb063067a3', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
|
|
6098
6235
|
];
|
|
6099
6236
|
}
|
|
6100
6237
|
initDatepicker(input) {
|
|
@@ -6197,11 +6334,11 @@ const CatDatepickerInline = class {
|
|
|
6197
6334
|
this.pickr = this.initDatepicker(this.input);
|
|
6198
6335
|
}
|
|
6199
6336
|
render() {
|
|
6200
|
-
return (h(Host, { key: '
|
|
6337
|
+
return (h(Host, { key: '6f363a4a673603f0c39f5a24b31bb768e804abfc' }, h("div", { key: '2c56934aad4d60ea96a6a3c983ae9d1e39c82bde', tabIndex: this.disabled || this.readonly ? -1 : undefined, class: {
|
|
6201
6338
|
'datepicker-wrapper': true,
|
|
6202
6339
|
'datepicker-disabled': this.disabled,
|
|
6203
6340
|
'datepicker-readonly': this.readonly
|
|
6204
|
-
} }, h("input", { key: '
|
|
6341
|
+
} }, h("input", { key: '6885c1c919af468401dddda38045ab9a8dc26aaf', ref: el => (this.input = el), value: this.value, disabled: this.disabled, readonly: this.readonly }))));
|
|
6205
6342
|
}
|
|
6206
6343
|
initDatepicker(input) {
|
|
6207
6344
|
if (!input) {
|
|
@@ -7760,6 +7897,7 @@ const CatDropdown = class {
|
|
|
7760
7897
|
this.arrowNavigation = 'vertical';
|
|
7761
7898
|
this.noResize = false;
|
|
7762
7899
|
this.overflow = false;
|
|
7900
|
+
this.noInitialFocus = false;
|
|
7763
7901
|
}
|
|
7764
7902
|
clickHandler(event) {
|
|
7765
7903
|
// we need to delay the initialization of the trigger until first
|
|
@@ -7791,6 +7929,9 @@ const CatDropdown = class {
|
|
|
7791
7929
|
* Opens the dropdown.
|
|
7792
7930
|
*/
|
|
7793
7931
|
async open() {
|
|
7932
|
+
if (!this.trigger) {
|
|
7933
|
+
this.initTrigger();
|
|
7934
|
+
}
|
|
7794
7935
|
if (this.isOpen === null || this.isOpen) {
|
|
7795
7936
|
return; // busy or open
|
|
7796
7937
|
}
|
|
@@ -7831,7 +7972,8 @@ const CatDropdown = class {
|
|
|
7831
7972
|
return true;
|
|
7832
7973
|
}
|
|
7833
7974
|
return event.key === 'Tab' && event.shiftKey;
|
|
7834
|
-
}
|
|
7975
|
+
},
|
|
7976
|
+
initialFocus: () => (this.noInitialFocus ? false : undefined)
|
|
7835
7977
|
});
|
|
7836
7978
|
this.trap.activate();
|
|
7837
7979
|
});
|
|
@@ -7856,7 +7998,7 @@ const CatDropdown = class {
|
|
|
7856
7998
|
}, timeTransitionS);
|
|
7857
7999
|
}
|
|
7858
8000
|
render() {
|
|
7859
|
-
return (h(Host, { key: '
|
|
8001
|
+
return (h(Host, { key: '6cde42e7f7bfc2df858b7179157a1f52e0c23e0e' }, h("slot", { key: '91633464f448a8142f52b6e1e62420974a929e84', name: "trigger", ref: el => (this.triggerSlot = el) }), h("div", { key: '2ed9bd2dcc58b83ec1e7781959456e67d9397c48', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, h("slot", { key: 'a91710cd8455cb006f60e48dd49aee7f6d114877', name: "content" }))));
|
|
7860
8002
|
}
|
|
7861
8003
|
get contentId() {
|
|
7862
8004
|
return `cat-dropdown-${this.id}`;
|
|
@@ -7942,7 +8084,7 @@ const CatFormGroup = class {
|
|
|
7942
8084
|
});
|
|
7943
8085
|
}
|
|
7944
8086
|
render() {
|
|
7945
|
-
return (h(Host, { key: '
|
|
8087
|
+
return (h(Host, { key: '6892a4f36f418d431b6006518c44bf2b58e70f70', style: { '--label-size': this.labelSize } }, h("slot", { key: '908b2720b504ce9dfb3a491aa3bbe092a3d2e0cf', onSlotchange: this.onSlotChange.bind(this) })));
|
|
7946
8088
|
}
|
|
7947
8089
|
onSlotChange() {
|
|
7948
8090
|
this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker'));
|
|
@@ -7974,7 +8116,7 @@ const CatIcon = class {
|
|
|
7974
8116
|
this.a11yLabel = undefined;
|
|
7975
8117
|
}
|
|
7976
8118
|
render() {
|
|
7977
|
-
return (h("span", { key: '
|
|
8119
|
+
return (h("span", { key: '66938702e645f5bc12ca9a4592af24ac46b40c52', innerHTML: this.iconSrc || (this.icon ? catIconRegistry.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
|
|
7978
8120
|
icon: true,
|
|
7979
8121
|
[`icon-${this.size}`]: this.size !== 'inline'
|
|
7980
8122
|
} }));
|
|
@@ -9655,19 +9797,19 @@ const CatInput = class {
|
|
|
9655
9797
|
}
|
|
9656
9798
|
}
|
|
9657
9799
|
render() {
|
|
9658
|
-
return (h("div", { key: '
|
|
9800
|
+
return (h("div", { key: '34152d1627e62e4852531f9afdb2b0abc3894a78', class: {
|
|
9659
9801
|
'input-field': true,
|
|
9660
9802
|
'input-horizontal': this.horizontal
|
|
9661
|
-
} }, h("div", { key: '
|
|
9803
|
+
} }, h("div", { key: '89c3e91d9d041a68389e776f38647aa6360e5ea5', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, part: "label" }, h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { key: 'ceed5e06d5bfb6eaf425c562422a6cb470c3dea4', class: "input-container" }, h("div", { key: 'bbd90f6b705d2e9213a45f5f7839370fce830c89', class: "input-outer-wrapper" }, h("div", { key: '7fa315fbb8421e0466d7bceba57c9f158d08c476', class: {
|
|
9662
9804
|
'input-wrapper': true,
|
|
9663
9805
|
'input-round': this.round,
|
|
9664
9806
|
'input-readonly': this.readonly,
|
|
9665
9807
|
'input-disabled': this.disabled,
|
|
9666
9808
|
'input-invalid': this.invalid
|
|
9667
|
-
}, 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: '
|
|
9809
|
+
}, 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: 'd8db1f7ab01afe94166fc4f6a6d37a595941c0e5', class: "input-inner-wrapper" }, h("input", { key: 'af383fe0a04ca8a41e9d9595ee4f422cebb5d99d', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
|
|
9668
9810
|
'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
|
|
9669
9811
|
'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value
|
|
9670
|
-
}, 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: '
|
|
9812
|
+
}, 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: '5d318f9d6eeeebcef42b5d7abb000f0e51375303', name: "addon" })), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
|
|
9671
9813
|
}
|
|
9672
9814
|
get hasHint() {
|
|
9673
9815
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -9745,9 +9887,9 @@ const CatPagination = class {
|
|
|
9745
9887
|
this.iconNext = '$cat:pagination-right';
|
|
9746
9888
|
}
|
|
9747
9889
|
render() {
|
|
9748
|
-
return (h("nav", { key: '
|
|
9890
|
+
return (h("nav", { key: 'ede4b30a483fb729428b8d2bfdd4d67b1b5f1022', role: "navigation" }, h("ol", { key: '04fd80b91e33c55a23d010e5fa108b10a08e2bdb', class: {
|
|
9749
9891
|
[`cat-pagination-${this.size}`]: Boolean(this.size)
|
|
9750
|
-
} }, h("li", { key: '
|
|
9892
|
+
} }, h("li", { key: 'cd98373b4a9a69b25e9df8185b808561336c9a75' }, h("cat-button", { key: 'ec601998cd4ba8a2007e1f1dcecad86f36633095', 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: '8ff7654e0087ece5cb4f81205083ea8f13af7112' }, h("cat-button", { key: '3ca4cf8fa48d650472e20efc09cbed49b55d33bf', 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) })))));
|
|
9751
9893
|
}
|
|
9752
9894
|
get isFirst() {
|
|
9753
9895
|
return this.page === 0;
|
|
@@ -9799,7 +9941,7 @@ const CatPagination = class {
|
|
|
9799
9941
|
};
|
|
9800
9942
|
CatPagination.style = CatPaginationStyle0;
|
|
9801
9943
|
|
|
9802
|
-
const catRadioCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.
|
|
9944
|
+
const catRadioCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.25rem}:host([hidden]){display:none}label{display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);cursor:pointer}.label-left{flex-direction:row-reverse}.radio{display:flex;position:relative;align-self:flex-start}.circle-placeholder{width:calc(1.25rem + 1px);flex-shrink:0}.circle{position:absolute;width:0.75rem;height:0.75rem;background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-radius:10rem;top:calc(50% - 0.375rem);left:calc(50% - 0.375rem);visibility:hidden;pointer-events:none}input{margin:0;width:1.25rem;height:1.25rem;appearance:none;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:10rem;cursor:inherit}input:checked{border-color:rgb(var(--cat-primary-bg, 0, 129, 148))}input:checked+.circle{visibility:visible}input:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host(.cat-error) input{border-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .circle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}.label{flex:1 1 auto}.is-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}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.is-disabled input{background-color:#f2f4f7}.is-disabled input:checked{border-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}.is-disabled .circle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}";
|
|
9803
9945
|
const CatRadioStyle0 = catRadioCss;
|
|
9804
9946
|
|
|
9805
9947
|
let nextUniqueId$5 = 0;
|
|
@@ -9852,7 +9994,7 @@ const CatRadio = class {
|
|
|
9852
9994
|
this.input.blur();
|
|
9853
9995
|
}
|
|
9854
9996
|
render() {
|
|
9855
|
-
return (h(Host, { key: '
|
|
9997
|
+
return (h(Host, { key: '1f5432c0800e82741e2786146b728403157eb874' }, h("label", { key: 'cac427f0f10635bd03a799d25ac0160b721cfcdb', 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: '6a8598e54d46eb976717faf125c58a675b79ad99', class: "radio" }, h("input", { key: '7b5dea2ce070d83a1a1f16375d3d782f8b3d1459', ...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: 'e6f1802e164c2b74f84f413fd351ea6a9f10c9a2', class: "circle" })), h("span", { key: '95e951a221d6b36d980a6619fa501a409555e981', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hasHint && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "circle-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
|
|
9856
9998
|
}
|
|
9857
9999
|
get hasHint() {
|
|
9858
10000
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -9943,7 +10085,7 @@ const CatRadioGroup = class {
|
|
|
9943
10085
|
}
|
|
9944
10086
|
}
|
|
9945
10087
|
render() {
|
|
9946
|
-
return (h("div", { key: '
|
|
10088
|
+
return (h("div", { key: '5608e54b1bb857a4068a6287b072bd71081d51d2', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: '8e62283745589e94e99650f7fe85afeea39fa253' })));
|
|
9947
10089
|
}
|
|
9948
10090
|
init() {
|
|
9949
10091
|
this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
|
|
@@ -10032,13 +10174,13 @@ const CatScrollable = class {
|
|
|
10032
10174
|
}
|
|
10033
10175
|
render() {
|
|
10034
10176
|
return [
|
|
10035
|
-
h("div", { key: '
|
|
10036
|
-
h("div", { key: '
|
|
10177
|
+
h("div", { key: 'b8d4abf49b6747e516f23bc4e16bbc1b7b9e2efe', class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { class: "shadow-top" }), !this.noShadowX && h("div", { class: "shadow-left" }), !this.noShadowX && h("div", { class: "shadow-right" }), !this.noShadowY && h("div", { class: "shadow-bottom" })),
|
|
10178
|
+
h("div", { key: '9552a4a4a86713effab40df3f95310dae5863f78', ref: el => (this.scrollElement = el), class: {
|
|
10037
10179
|
'scrollable-content': true,
|
|
10038
10180
|
'scroll-x': !this.noOverflowX,
|
|
10039
10181
|
'scroll-y': !this.noOverflowY,
|
|
10040
10182
|
'no-overscroll': this.noOverscroll
|
|
10041
|
-
} }, h("slot", { key: '
|
|
10183
|
+
} }, h("slot", { key: 'acc0afcb95539ad6db29c6a96b2673892f2d9153' }))
|
|
10042
10184
|
];
|
|
10043
10185
|
}
|
|
10044
10186
|
attachEmitter(from, emitter) {
|
|
@@ -10982,7 +11124,7 @@ const CatSelectTest = class {
|
|
|
10982
11124
|
setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
|
|
10983
11125
|
}
|
|
10984
11126
|
render() {
|
|
10985
|
-
return (h(Host, { key: '
|
|
11127
|
+
return (h(Host, { key: 'fbbdfc05bd034597b84d235445b70c526ed17dd4', style: { display: 'flex', flexDirection: 'column' }, class: "cat-form" }, h("cat-select", { key: 'e88f94e3022868b3ec6ca75a704a45edac6dedc6', 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: 'a5e00768df01e4f91dfd2b4b3f62a998df32bf7d', slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { key: '935aacbe810131079d95d61d9e6fd2efbec03d01', label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '0b8fbe7e2ec42acf7cbd01fd216d0909befd30a2', label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { key: '509741cf8a8f6438649f2a4debe0829fd3b905eb', 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: 'a42ff7c4b8f1686fa0cdbd5a202b4bff59f7e599', 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: 'e29353e92663b785844080bf6ef6937348c80379', 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: 'a53e0848faed0a98be3d2bc6e81c1e21c82cbc9c', label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { key: 'f6173b84ec5d84401dbc7190c6e09719c0412f26', overflow: true }, h("cat-button", { key: '4d45f4bd17867cb4d54078f503e8613441e04374', slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { key: '2736181440e085cf623c2c3c875edaab23f71a3e', slot: "content", style: { width: '400px' } }, h("cat-select", { key: '9fa27d270fc984bd22ef82de2e54e7ac952f71a2', 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%' } })))));
|
|
10986
11128
|
}
|
|
10987
11129
|
get countryConnector() {
|
|
10988
11130
|
return {
|
|
@@ -12238,7 +12380,7 @@ const CatSkeleton = class {
|
|
|
12238
12380
|
this.lines = undefined;
|
|
12239
12381
|
}
|
|
12240
12382
|
render() {
|
|
12241
|
-
return (h(Host, { key: '
|
|
12383
|
+
return (h(Host, { key: '8f1e4584c050cc8b6d1341efd3d8b04ca7223a73' }, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
|
|
12242
12384
|
skeleton: true,
|
|
12243
12385
|
[`skeleton-${this.effect}`]: Boolean(this.effect),
|
|
12244
12386
|
[`skeleton-${this.variant}`]: Boolean(this.variant),
|
|
@@ -12278,9 +12420,9 @@ const CatSpinner = class {
|
|
|
12278
12420
|
this.a11yLabel = undefined;
|
|
12279
12421
|
}
|
|
12280
12422
|
render() {
|
|
12281
|
-
return (h("span", { key: '
|
|
12423
|
+
return (h("span", { key: 'cf1110c7ae2c653c87f44f2668aa3bcc757ed0c9', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
|
|
12282
12424
|
[`spinner-${this.size}`]: this.size !== 'inline'
|
|
12283
|
-
} }, h("svg", { key: '
|
|
12425
|
+
} }, h("svg", { key: '22d1a1c15575274a75d4203ae9a1c945a199759d', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { key: 'f067c870a5699603761b7d8d6e4a32354cef6f7e', cx: "24", cy: "24", r: "21.5" }))));
|
|
12284
12426
|
}
|
|
12285
12427
|
};
|
|
12286
12428
|
CatSpinner.style = CatSpinnerStyle0;
|
|
@@ -12312,7 +12454,7 @@ const CatTab = class {
|
|
|
12312
12454
|
this.catClick.emit(event);
|
|
12313
12455
|
}
|
|
12314
12456
|
render() {
|
|
12315
|
-
return h(Host, { key: '
|
|
12457
|
+
return h(Host, { key: 'e0b1e0562a35130f4b0de08530eb66c9df5ec145' });
|
|
12316
12458
|
}
|
|
12317
12459
|
get hostElement() { return getElement(this); }
|
|
12318
12460
|
};
|
|
@@ -12376,7 +12518,7 @@ const CatTabs = class {
|
|
|
12376
12518
|
this.activate(this.tabs[index]);
|
|
12377
12519
|
}
|
|
12378
12520
|
render() {
|
|
12379
|
-
return (h(Host, { key: '
|
|
12521
|
+
return (h(Host, { key: '05969fc6e983159aaad4a36ab07b6326c5c85589' }, this.tabs.map((tab) => {
|
|
12380
12522
|
return (h("cat-button", { buttonId: tab.id, role: "tab", part: "tab", class: {
|
|
12381
12523
|
'cat-tab': true,
|
|
12382
12524
|
'cat-tab-active': tab.id === this.activeTab,
|
|
@@ -12496,15 +12638,15 @@ const CatTextarea = class {
|
|
|
12496
12638
|
}
|
|
12497
12639
|
}
|
|
12498
12640
|
render() {
|
|
12499
|
-
return (h(Host, { key: '
|
|
12641
|
+
return (h(Host, { key: '2fac5152cbeeb9d4a9c4dc0f9539bb1a1503c9e8' }, h("div", { key: '88d992d98f72a0862b3736ad102a0124363e17b6', class: {
|
|
12500
12642
|
'textarea-field': true,
|
|
12501
12643
|
'textarea-horizontal': this.horizontal
|
|
12502
|
-
} }, h("div", { key: '
|
|
12644
|
+
} }, h("div", { key: 'ab23b2ebcc13b7511c4e951041817bb8b1952c0c', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, part: "label" }, h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { key: '30a02b82d605c5e416a63b8eef5205d41139ce6d', class: "textarea-container" }, h("div", { key: '32aad8e1e15134dad90e991cc3e471b06dcbc9fd', class: {
|
|
12503
12645
|
'textarea-wrapper': true,
|
|
12504
12646
|
'textarea-readonly': this.readonly,
|
|
12505
12647
|
'textarea-disabled': this.disabled,
|
|
12506
12648
|
'textarea-invalid': this.invalid
|
|
12507
|
-
} }, h("textarea", { key: '
|
|
12649
|
+
} }, h("textarea", { key: '96d5a02bfdb1c7feb85ce02380a59ff63a7d1760', ...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", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
|
|
12508
12650
|
}
|
|
12509
12651
|
get hasHint() {
|
|
12510
12652
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -12564,6 +12706,9 @@ function getLocale(language) {
|
|
|
12564
12706
|
timeFormat: getHour12(language) ? '12' : '24'
|
|
12565
12707
|
};
|
|
12566
12708
|
}
|
|
12709
|
+
function formatIso(date) {
|
|
12710
|
+
return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
|
|
12711
|
+
}
|
|
12567
12712
|
|
|
12568
12713
|
function clampTime(min, date, max) {
|
|
12569
12714
|
const [, hhMin, mmMin] = min?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
|
|
@@ -12634,6 +12779,16 @@ const CatTime = class {
|
|
|
12634
12779
|
this.placement = 'bottom-end';
|
|
12635
12780
|
this.step = 30;
|
|
12636
12781
|
}
|
|
12782
|
+
onMinChanged(min, oldMin) {
|
|
12783
|
+
if (min !== oldMin) {
|
|
12784
|
+
this.reclamp('min', min);
|
|
12785
|
+
}
|
|
12786
|
+
}
|
|
12787
|
+
onMaxChanged(max, oldMax) {
|
|
12788
|
+
if (max !== oldMax) {
|
|
12789
|
+
this.reclamp('max', max);
|
|
12790
|
+
}
|
|
12791
|
+
}
|
|
12637
12792
|
componentWillLoad() {
|
|
12638
12793
|
this.syncValue(this.value ?? '');
|
|
12639
12794
|
}
|
|
@@ -12651,9 +12806,9 @@ const CatTime = class {
|
|
|
12651
12806
|
onOpen() {
|
|
12652
12807
|
const query = (selector) => this.hostElement.shadowRoot?.querySelector(selector);
|
|
12653
12808
|
const time = clampTime(this.min ?? null, this.selectionTime ?? new Date(2000, 5, 1, 8), this.max ?? null);
|
|
12654
|
-
const elem1 = query(`[data-time="${
|
|
12809
|
+
const elem1 = query(`[data-time="${formatIso(time)}"]`);
|
|
12655
12810
|
time.setMinutes(Math.floor(time.getMinutes() / this.step) * this.step);
|
|
12656
|
-
const elem2 = query(`[data-time="${
|
|
12811
|
+
const elem2 = query(`[data-time="${formatIso(time)}"]`);
|
|
12657
12812
|
setTimeout(() => {
|
|
12658
12813
|
(elem2 ?? elem1)?.doFocus();
|
|
12659
12814
|
(elem2 ?? elem1)?.scrollIntoView(this.selectionTime ? { block: 'center' } : undefined);
|
|
@@ -12674,7 +12829,7 @@ const CatTime = class {
|
|
|
12674
12829
|
const time = clampTime(this.min ?? null, date, this.max ?? null);
|
|
12675
12830
|
this.isAm = this.format(time).toLowerCase().includes('am');
|
|
12676
12831
|
this.selectionTime = time;
|
|
12677
|
-
this.value =
|
|
12832
|
+
this.value = formatIso(time);
|
|
12678
12833
|
}
|
|
12679
12834
|
// we need to set the input explicitly to sync the input even without a
|
|
12680
12835
|
// rerender (if the value is not changed)
|
|
@@ -12709,8 +12864,8 @@ const CatTime = class {
|
|
|
12709
12864
|
this.input?.clear();
|
|
12710
12865
|
}
|
|
12711
12866
|
render() {
|
|
12712
|
-
return (h(Host, { key: '
|
|
12713
|
-
const isoTime =
|
|
12867
|
+
return (h(Host, { key: 'c7ebe7c00d372720ce9c34907438f47150df0820' }, h("cat-input", { key: 'e83d9bddbdff4d1e0c97531f3684618e0f4251a8', 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: '504e24bcf7d7fa3e0eddb7df91261778e720cc87', slot: "label" }, this.hasSlottedLabel && h("slot", { name: "label" }), !this.hasSlottedLabel && this.label, h("span", { key: 'c617e13394f44bd851beae13e809f791a56dfa42', class: "label-aria" }, " (HH:mm)")), h("div", { key: '601bd57b6137a44901a3d32ce10f881aae67a2a8', slot: "addon", class: "cat-time-addon" }, this.locale.timeFormat === '12' && (h("cat-button", { class: "cat-time-format", disabled: this.disabled || this.readonly, onCatClick: () => this.toggleAm() }, this.isAm ? 'AM' : 'PM')), h("cat-dropdown", { key: 'ecdd2fb5987eb30890c9258ece4bd1e176b2d6c6', slot: "addon", placement: this.placement }, h("cat-button", { key: 'a38158d199940ff276b5263833c39cdbea04d194', 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: 'e2e77112f74467cc2db37d24f38165389888978a', slot: "content", class: "cat-nav" }, h("ul", { key: 'c005ac2b43037f3e5953117e968a967ce60be477' }, this.timeArray().map(time => {
|
|
12868
|
+
const isoTime = formatIso(time);
|
|
12714
12869
|
const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
|
|
12715
12870
|
return (h("li", null, h("cat-button", { class: {
|
|
12716
12871
|
'cat-nav-item': true,
|
|
@@ -12759,14 +12914,27 @@ const CatTime = class {
|
|
|
12759
12914
|
: '';
|
|
12760
12915
|
return includeAmPm ? str : str.replace(/\s?(am|pm)/i, '');
|
|
12761
12916
|
}
|
|
12762
|
-
|
|
12763
|
-
|
|
12917
|
+
reclamp(mode, limit) {
|
|
12918
|
+
if (!this.value)
|
|
12919
|
+
return;
|
|
12920
|
+
const min = (mode === 'min' ? limit : this.min) ?? null;
|
|
12921
|
+
const max = (mode === 'max' ? limit : this.max) ?? null;
|
|
12922
|
+
const [match, hh, mm] = this.value.match(/(\d{2}):(\d{2})/) ?? [];
|
|
12923
|
+
const newValue = match ? formatIso(clampTime(min, new Date(2000, 5, 1, Number(hh), Number(mm)), max)) : undefined;
|
|
12924
|
+
if (this.value !== newValue) {
|
|
12925
|
+
this.syncValue(newValue ?? '');
|
|
12926
|
+
this.catChange.emit(newValue);
|
|
12927
|
+
}
|
|
12764
12928
|
}
|
|
12765
12929
|
get hostElement() { return getElement(this); }
|
|
12930
|
+
static get watchers() { return {
|
|
12931
|
+
"min": ["onMinChanged"],
|
|
12932
|
+
"max": ["onMaxChanged"]
|
|
12933
|
+
}; }
|
|
12766
12934
|
};
|
|
12767
12935
|
CatTime.style = CatTimeStyle0;
|
|
12768
12936
|
|
|
12769
|
-
const catToggleCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.
|
|
12937
|
+
const catToggleCss = ".hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}:host{display:flex;flex-direction:column;gap:0.25rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.label-left{flex-direction:row-reverse}input{position:absolute;margin:0;width:2rem;height:1.25rem;opacity:0;cursor:inherit}.toggle-placeholder{width:calc(2rem + 1px);flex-shrink:0}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:rgb(var(--cat-border-color-dark, 215, 219, 224));transition:background-color 125ms ease;pointer-events:none}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 0, 129, 148))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 125ms linear;box-shadow:0 1px 2px rgba(27, 31, 38, 0.06), 0 1px 3px rgba(27, 31, 38, 0.1)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem));background:rgb(var(--cat-primary-fill, 255, 255, 255))}.is-disabled .toggle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}:host(.cat-error) .toggle{background-color:rgba(var(--cat-danger-bg, 217, 52, 13), 0.2)}:host(.cat-error) :checked+.toggle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.toggle::after{background:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto}.is-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}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
|
|
12770
12938
|
const CatToggleStyle0 = catToggleCss;
|
|
12771
12939
|
|
|
12772
12940
|
let nextUniqueId$1 = 0;
|
|
@@ -12824,7 +12992,7 @@ const CatToggle = class {
|
|
|
12824
12992
|
this.input.blur();
|
|
12825
12993
|
}
|
|
12826
12994
|
render() {
|
|
12827
|
-
return (h(Host, { key: '
|
|
12995
|
+
return (h(Host, { key: '08337e6aece1d072c3c4540e4c5e97562a0c1f4c' }, h("label", { key: '79b0b9d2d136125ba7f15be32a3a34da73488a2f', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", { key: '0c22754e817b0d6eab349583287c8d30f25f84ad', ...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: '7a08a4ec1fc79d18c16065697f672bf7f4e35908', class: "toggle" }), h("span", { key: 'b78eacbcb262452ba33972f2647dc69b01c1bd20', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hasHint && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "toggle-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
|
|
12828
12996
|
}
|
|
12829
12997
|
get hasHint() {
|
|
12830
12998
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -12911,12 +13079,12 @@ const CatTooltip = class {
|
|
|
12911
13079
|
}
|
|
12912
13080
|
}
|
|
12913
13081
|
render() {
|
|
12914
|
-
return (h(Host, { key: '
|
|
13082
|
+
return (h(Host, { key: '742d0c7f6203b8e685886f1c272562176b348fa9' }, h("slot", { key: '0e7bf66c6aadcf0b87fbbadf2d3e357ebb9b98c0' }), h("div", { key: '14eaa638d2f3170be57188d32841e22c98f1319b', ref: el => (this.tooltip = el), id: this.id, role: "tooltip", "aria-hidden": !this.open, "aria-live": this.open ? 'polite' : 'off', class: {
|
|
12915
13083
|
tooltip: true,
|
|
12916
13084
|
'tooltip-hidden': this.inactive,
|
|
12917
13085
|
'tooltip-round': this.round,
|
|
12918
13086
|
[`tooltip-${this.size}`]: Boolean(this.size)
|
|
12919
|
-
} }, h("slot", { key: '
|
|
13087
|
+
} }, h("slot", { key: '724fac6b27719c0cb9d243aab8ab4485fa72fc43', name: "content" }, h("p", { key: '2d6c325c46035725ac8c81330038888eefeb0c89' }, this.content)))));
|
|
12920
13088
|
}
|
|
12921
13089
|
async update() {
|
|
12922
13090
|
if (this.trigger && this.tooltip) {
|
|
@@ -12996,6 +13164,6 @@ CatTooltip.OFFSET = 4;
|
|
|
12996
13164
|
CatTooltip.SHIFT_PADDING = 4;
|
|
12997
13165
|
CatTooltip.style = CatTooltipStyle0;
|
|
12998
13166
|
|
|
12999
|
-
export { CatAlert as cat_alert, CatAvatar as cat_avatar, CatBadge as cat_badge, CatButton as cat_button, CatButtonGroup as cat_button_group, CatCard as cat_card, CatCheckbox as cat_checkbox, CatDate as cat_date, CatDatepickerFlat as cat_datepicker, CatDatepickerInline as cat_datepicker_inline, CatDropdown as cat_dropdown, CatFormGroup as cat_form_group, CatIcon as cat_icon, CatInput as cat_input, CatPagination as cat_pagination, CatRadio as cat_radio, CatRadioGroup as cat_radio_group, CatScrollable as cat_scrollable, CatSelect as cat_select, CatSelectTest as cat_select_demo, CatSkeleton as cat_skeleton, CatSpinner as cat_spinner, CatTab as cat_tab, CatTabs as cat_tabs, CatTextarea as cat_textarea, CatTime as cat_time, CatToggle as cat_toggle, CatTooltip as cat_tooltip };
|
|
13167
|
+
export { CatAlert as cat_alert, CatAvatar as cat_avatar, CatBadge as cat_badge, CatButton as cat_button, CatButtonGroup as cat_button_group, CatCard as cat_card, CatCheckbox as cat_checkbox, CatDate as cat_date, CatDateInline as cat_date_inline, CatDatepickerFlat as cat_datepicker, CatDatepickerInline as cat_datepicker_inline, CatDropdown as cat_dropdown, CatFormGroup as cat_form_group, CatIcon as cat_icon, CatInput as cat_input, CatPagination as cat_pagination, CatRadio as cat_radio, CatRadioGroup as cat_radio_group, CatScrollable as cat_scrollable, CatSelect as cat_select, CatSelectTest as cat_select_demo, CatSkeleton as cat_skeleton, CatSpinner as cat_spinner, CatTab as cat_tab, CatTabs as cat_tabs, CatTextarea as cat_textarea, CatTime as cat_time, CatToggle as cat_toggle, CatTooltip as cat_tooltip };
|
|
13000
13168
|
|
|
13001
|
-
//# sourceMappingURL=cat-
|
|
13169
|
+
//# sourceMappingURL=cat-alert_29.entry.js.map
|