@haiilo/catalyst 10.4.0 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalyst/catalyst.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-54544546.js +2 -0
- package/dist/catalyst/p-54544546.js.map +1 -0
- package/dist/catalyst/{p-8a1d505d.entry.js → p-66b41008.entry.js} +4 -4
- package/dist/catalyst/p-66b41008.entry.js.map +1 -0
- package/dist/cjs/{cat-alert_28.cjs.entry.js → cat-alert_29.cjs.entry.js} +269 -176
- 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-8163b41f.js} +11 -3
- package/dist/cjs/of-8163b41f.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-date/cat-date.css +2 -96
- package/dist/collection/components/cat-date/cat-date.js +46 -254
- 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 +5 -1
- 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.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-demo/cat-select-demo.js +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
- package/dist/collection/components/cat-tab/cat-tab.js +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
- package/dist/collection/components/cat-time/cat-time.js +4 -1
- package/dist/collection/components/cat-time/cat-time.js.map +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/components/cat-button2.js +1 -1
- package/dist/components/cat-button2.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 +50 -288
- 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 +1 -1
- 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 +1 -1
- package/dist/components/cat-scrollable2.js +3 -3
- package/dist/components/cat-select-demo.js +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 +1 -1
- package/dist/components/cat-time.js.map +1 -1
- package/dist/components/cat-toggle.js +1 -1
- package/dist/components/cat-tooltip.js +2 -2
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{cat-alert_28.entry.js → cat-alert_29.entry.js} +269 -177
- 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-f4b9a3ca.js} +11 -3
- package/dist/esm/of-f4b9a3ca.js.map +1 -0
- package/dist/types/components/cat-date/cat-date.d.ts +8 -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 +4 -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.d.ts +3 -0
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +201 -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.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-f4b9a3ca.js';
|
|
3
3
|
|
|
4
4
|
const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
|
|
5
5
|
_super(this);
|
|
@@ -1040,7 +1040,7 @@ function createEmptyStyleRule(query) {
|
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
1042
|
|
|
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}";
|
|
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: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
1044
|
const CatButtonStyle0 = catButtonCss;
|
|
1045
1045
|
|
|
1046
1046
|
const CatButton = class {
|
|
@@ -1384,6 +1384,7 @@ function getLocale$2(language) {
|
|
|
1384
1384
|
today: catI18nRegistry.t('datepicker.today'),
|
|
1385
1385
|
change: catI18nRegistry.t('datepicker.change'),
|
|
1386
1386
|
choose: catI18nRegistry.t('datepicker.choose'),
|
|
1387
|
+
clear: catI18nRegistry.t('datepicker.clear'),
|
|
1387
1388
|
formatStr: getFormat$1(language),
|
|
1388
1389
|
weekInfo: getWeekInfo(language),
|
|
1389
1390
|
days: {
|
|
@@ -1393,7 +1394,27 @@ function getLocale$2(language) {
|
|
|
1393
1394
|
months: {
|
|
1394
1395
|
short: getMonths(language, 'short'),
|
|
1395
1396
|
long: getMonths(language, 'long')
|
|
1396
|
-
}
|
|
1397
|
+
},
|
|
1398
|
+
now: () => {
|
|
1399
|
+
const date = new Date();
|
|
1400
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
1401
|
+
},
|
|
1402
|
+
fromLocalISO: (date) => {
|
|
1403
|
+
const [match, year, month, day] = date?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
1404
|
+
return match ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
|
|
1405
|
+
},
|
|
1406
|
+
toLocalISO: (date) => {
|
|
1407
|
+
const year = date.getFullYear();
|
|
1408
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
1409
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
1410
|
+
return `${year}-${month}-${day}`;
|
|
1411
|
+
},
|
|
1412
|
+
toLocalStr: (date) => new Intl.DateTimeFormat(language, {
|
|
1413
|
+
year: 'numeric',
|
|
1414
|
+
month: 'long',
|
|
1415
|
+
day: 'numeric',
|
|
1416
|
+
weekday: 'long'
|
|
1417
|
+
}).format(date)
|
|
1397
1418
|
};
|
|
1398
1419
|
}
|
|
1399
1420
|
|
|
@@ -1425,7 +1446,7 @@ function clampDate(min, date, max) {
|
|
|
1425
1446
|
return new Date(Math.min(Math.max(date.getTime(), min?.getTime() ?? -Infinity), max?.getTime() ?? Infinity));
|
|
1426
1447
|
}
|
|
1427
1448
|
|
|
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}
|
|
1449
|
+
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
1450
|
const CatDateStyle0 = catDateCss;
|
|
1430
1451
|
|
|
1431
1452
|
const CatDate = class {
|
|
@@ -1436,13 +1457,8 @@ const CatDate = class {
|
|
|
1436
1457
|
this.catBlur = createEvent(this, "catBlur", 7);
|
|
1437
1458
|
this.language = catI18nRegistry.getLocale();
|
|
1438
1459
|
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
1460
|
this.hasSlottedLabel = false;
|
|
1443
1461
|
this.hasSlottedHint = false;
|
|
1444
|
-
this.viewDate = this.now;
|
|
1445
|
-
this.selectionDate = null;
|
|
1446
1462
|
this.requiredMarker = 'optional';
|
|
1447
1463
|
this.horizontal = false;
|
|
1448
1464
|
this.autoComplete = undefined;
|
|
@@ -1468,29 +1484,14 @@ const CatDate = class {
|
|
|
1468
1484
|
this.nativeAttributes = undefined;
|
|
1469
1485
|
this.placement = 'bottom-end';
|
|
1470
1486
|
}
|
|
1471
|
-
get
|
|
1472
|
-
const [y, m, d] = this.max?.split('-').map(Number) || [];
|
|
1473
|
-
return this.max ? new Date(y, m - 1, d) : null;
|
|
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());
|
|
1482
|
-
}
|
|
1483
|
-
get focusedDate() {
|
|
1484
|
-
const [all, year, month, day] = this.hostElement.shadowRoot
|
|
1485
|
-
?.querySelector(`[data-date]:focus`)
|
|
1486
|
-
?.dataset.date?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
1487
|
-
return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
|
|
1488
|
-
}
|
|
1489
|
-
componentWillLoad() {
|
|
1487
|
+
get inputValue() {
|
|
1490
1488
|
const [match, year, month, day] = this.value?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
1491
1489
|
if (match) {
|
|
1492
|
-
|
|
1490
|
+
const date = new Date(Number(year), Number(month) - 1, Number(day));
|
|
1491
|
+
const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });
|
|
1492
|
+
return format.format(date);
|
|
1493
1493
|
}
|
|
1494
|
+
return '';
|
|
1494
1495
|
}
|
|
1495
1496
|
componentWillRender() {
|
|
1496
1497
|
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
@@ -1507,49 +1508,155 @@ const CatDate = class {
|
|
|
1507
1508
|
datePattern: [p1, p2, p3]
|
|
1508
1509
|
});
|
|
1509
1510
|
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Programmatically move focus to the input. Use this method instead of
|
|
1513
|
+
* `input.focus()`.
|
|
1514
|
+
*
|
|
1515
|
+
* @param options An optional object providing options to control aspects of
|
|
1516
|
+
* the focusing process.
|
|
1517
|
+
*/
|
|
1518
|
+
async doFocus(options) {
|
|
1519
|
+
this.input?.doFocus(options);
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Programmatically remove focus from the input. Use this method instead of
|
|
1523
|
+
* `input.blur()`.
|
|
1524
|
+
*/
|
|
1525
|
+
async doBlur() {
|
|
1526
|
+
this.input?.doBlur();
|
|
1527
|
+
}
|
|
1528
|
+
/**
|
|
1529
|
+
* Clear the input.
|
|
1530
|
+
*/
|
|
1531
|
+
async clear() {
|
|
1532
|
+
this.input?.clear();
|
|
1533
|
+
}
|
|
1534
|
+
render() {
|
|
1535
|
+
return (h(Host, { key: '6f8ed88396eb9932a91f26e1f32086a573f82add' }, h("cat-input", { key: 'e73ec2bceb1cd648e14d8917ebf7fb6c99079408', 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 => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: '8fb02c395b64728db2a2f5d4896e3151b3dc5aec', slot: "label" }, this.label, h("span", { key: 'f08e83d369b1f35d45fb4c0b2c39a9ad52b68b77', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: '48ee8472fab9d59b511df69afbbc348aa7b04828', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true, onCatOpen: () => this.dateInline?.resetView() }, h("cat-button", { key: 'b12ea88e170c2c8d916e9553b0bb205fae5e5d45', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.getTriggerA11yLabel() }), h("div", { key: '9173b680adcf83c32a7c10e818acbab188cfd979', slot: "content" }, h("cat-date-inline", { key: '997bc3bb5137d860893732234442feda61cd3d21', ref: el => (this.dateInline = el), min: this.min, max: this.max, value: this.value, noClear: true, onCatChange: this.onDateChange.bind(this) }))))));
|
|
1536
|
+
}
|
|
1537
|
+
getTriggerA11yLabel() {
|
|
1538
|
+
const date = this.locale.fromLocalISO(this.value);
|
|
1539
|
+
return date ? `${this.locale.change}, ${this.locale.toLocalStr(date)}` : this.locale.choose;
|
|
1540
|
+
}
|
|
1541
|
+
onInputBlur(e) {
|
|
1542
|
+
if (!this.input) {
|
|
1543
|
+
return;
|
|
1544
|
+
}
|
|
1545
|
+
const oldValue = this.value;
|
|
1546
|
+
const dateParsed = this.parse(this.input.value ?? '');
|
|
1547
|
+
const dateMin = this.locale.fromLocalISO(this.min);
|
|
1548
|
+
const dateMax = this.locale.fromLocalISO(this.max);
|
|
1549
|
+
const date = dateParsed ? clampDate(dateMin, dateParsed, dateMax) : null;
|
|
1550
|
+
this.value = date ? this.locale.toLocalISO(date) : undefined;
|
|
1551
|
+
if (oldValue !== this.value) {
|
|
1552
|
+
if (date) {
|
|
1553
|
+
this.dateInline?.select(date);
|
|
1554
|
+
}
|
|
1555
|
+
else {
|
|
1556
|
+
this.dateInline?.clear();
|
|
1557
|
+
}
|
|
1558
|
+
this.catChange.emit(this.value);
|
|
1559
|
+
}
|
|
1560
|
+
this.input.value = this.inputValue;
|
|
1561
|
+
this.catBlur.emit(e);
|
|
1562
|
+
}
|
|
1563
|
+
onDateChange(e) {
|
|
1564
|
+
const oldValue = this.value;
|
|
1565
|
+
const date = e.detail ? new Date(e.detail) : null;
|
|
1566
|
+
this.value = date ? this.locale.toLocalISO(date) : undefined;
|
|
1567
|
+
if (oldValue !== this.value) {
|
|
1568
|
+
this.catChange.emit(this.value);
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
parse(value) {
|
|
1572
|
+
const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(this.locale.formatStr) || [];
|
|
1573
|
+
const formatParts = [p1, p2, p3];
|
|
1574
|
+
const parts = value.split(d1).map(s => Number(s || 'x'));
|
|
1575
|
+
let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.locale.now().getFullYear();
|
|
1576
|
+
const month = parts[formatParts.indexOf('MM')];
|
|
1577
|
+
const day = parts[formatParts.indexOf('DD')];
|
|
1578
|
+
if (!Number.isInteger(month) || !Number.isInteger(day)) {
|
|
1579
|
+
return null;
|
|
1580
|
+
}
|
|
1581
|
+
else if (year < 100) {
|
|
1582
|
+
year += year < 50 ? 2000 : 1900;
|
|
1583
|
+
}
|
|
1584
|
+
return new Date(year, month - 1, day);
|
|
1585
|
+
}
|
|
1586
|
+
get hostElement() { return getElement(this); }
|
|
1587
|
+
};
|
|
1588
|
+
CatDate.style = CatDateStyle0;
|
|
1589
|
+
|
|
1590
|
+
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}";
|
|
1591
|
+
const CatDateInlineStyle0 = catDateInlineCss;
|
|
1592
|
+
|
|
1593
|
+
const CatDateInline = class {
|
|
1594
|
+
constructor(hostRef) {
|
|
1595
|
+
registerInstance(this, hostRef);
|
|
1596
|
+
this.catChange = createEvent(this, "catChange", 7);
|
|
1597
|
+
this.language = catI18nRegistry.getLocale();
|
|
1598
|
+
this.locale = getLocale$2(this.language);
|
|
1599
|
+
// additonally store the focus date to ensure correct focus after potential re-render
|
|
1600
|
+
this.focusDate = null;
|
|
1601
|
+
this.viewDate = this.locale.now();
|
|
1602
|
+
this.noClear = false;
|
|
1603
|
+
this.noHint = false;
|
|
1604
|
+
this.noToday = false;
|
|
1605
|
+
this.noWeeks = false;
|
|
1606
|
+
this.size = 'm';
|
|
1607
|
+
this.min = undefined;
|
|
1608
|
+
this.max = undefined;
|
|
1609
|
+
this.range = false;
|
|
1610
|
+
this.value = undefined;
|
|
1611
|
+
}
|
|
1612
|
+
get focusedDate() {
|
|
1613
|
+
const [all, year, month, day] = this.hostElement.shadowRoot
|
|
1614
|
+
?.querySelector(`[data-date]:focus`)
|
|
1615
|
+
?.dataset.date?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
1616
|
+
return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
|
|
1617
|
+
}
|
|
1618
|
+
componentWillLoad() {
|
|
1619
|
+
// select the initial value
|
|
1620
|
+
const [startDate, endDate] = this.getValue();
|
|
1621
|
+
this.select(startDate);
|
|
1622
|
+
if (this.range && endDate) {
|
|
1623
|
+
this.select(endDate);
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1510
1626
|
componentDidRender() {
|
|
1511
1627
|
if (this.focusDate) {
|
|
1628
|
+
// re-focus the previously focused date after re-render
|
|
1512
1629
|
this.hostElement.shadowRoot
|
|
1513
|
-
?.querySelector(`[data-date="${this.
|
|
1630
|
+
?.querySelector(`[data-date="${this.locale.toLocalStr(this.focusDate)}"]`)
|
|
1514
1631
|
?.doFocus();
|
|
1515
1632
|
this.focusDate = null;
|
|
1516
1633
|
}
|
|
1517
1634
|
}
|
|
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
1635
|
onKeyDown(e) {
|
|
1530
|
-
if (!
|
|
1636
|
+
if (!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {
|
|
1531
1637
|
return;
|
|
1532
1638
|
}
|
|
1533
|
-
const
|
|
1534
|
-
if (!
|
|
1639
|
+
const focusedDate = this.focusedDate;
|
|
1640
|
+
if (!focusedDate) {
|
|
1535
1641
|
e.preventDefault();
|
|
1536
|
-
|
|
1642
|
+
const [startDate] = this.getValue();
|
|
1643
|
+
this.focus(startDate || this.locale.now());
|
|
1537
1644
|
}
|
|
1538
1645
|
else if (e.key === 'ArrowLeft') {
|
|
1539
1646
|
e.preventDefault();
|
|
1540
|
-
this.focus(e.shiftKey ? addMonth(
|
|
1647
|
+
this.focus(e.shiftKey ? addMonth(focusedDate, -1) : addDays(focusedDate, -1));
|
|
1541
1648
|
}
|
|
1542
1649
|
else if (e.key === 'ArrowRight') {
|
|
1543
1650
|
e.preventDefault();
|
|
1544
|
-
this.focus(e.shiftKey ? addMonth(
|
|
1651
|
+
this.focus(e.shiftKey ? addMonth(focusedDate, 1) : addDays(focusedDate, 1));
|
|
1545
1652
|
}
|
|
1546
1653
|
else if (e.key === 'ArrowUp') {
|
|
1547
1654
|
e.preventDefault();
|
|
1548
|
-
this.focus(addDays(
|
|
1655
|
+
this.focus(addDays(focusedDate, -7));
|
|
1549
1656
|
}
|
|
1550
1657
|
else if (e.key === 'ArrowDown') {
|
|
1551
1658
|
e.preventDefault();
|
|
1552
|
-
this.focus(addDays(
|
|
1659
|
+
this.focus(addDays(focusedDate, 7));
|
|
1553
1660
|
}
|
|
1554
1661
|
}
|
|
1555
1662
|
/**
|
|
@@ -1558,76 +1665,76 @@ const CatDate = class {
|
|
|
1558
1665
|
* @param date The date to select.
|
|
1559
1666
|
*/
|
|
1560
1667
|
async select(date) {
|
|
1668
|
+
if (!date) {
|
|
1669
|
+
return this.clear();
|
|
1670
|
+
}
|
|
1561
1671
|
const oldValue = this.value;
|
|
1562
|
-
const
|
|
1672
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1673
|
+
const newDate = clampDate(minDate, new Date(date.getFullYear(), date.getMonth(), date.getDate()), maxDate);
|
|
1563
1674
|
this.focus(newDate);
|
|
1564
|
-
this.
|
|
1565
|
-
|
|
1675
|
+
if (this.range) {
|
|
1676
|
+
const [startDate, endDate] = this.getValue();
|
|
1677
|
+
if (!startDate || endDate || newDate < startDate) {
|
|
1678
|
+
this.value = this.toRangeValue(newDate, null);
|
|
1679
|
+
}
|
|
1680
|
+
else {
|
|
1681
|
+
this.value = this.toRangeValue(startDate, newDate);
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
else {
|
|
1685
|
+
this.value = this.locale.toLocalISO(newDate);
|
|
1686
|
+
}
|
|
1566
1687
|
if (oldValue !== this.value) {
|
|
1567
1688
|
this.catChange.emit(this.value);
|
|
1568
1689
|
}
|
|
1569
1690
|
}
|
|
1570
1691
|
/**
|
|
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()`.
|
|
1692
|
+
* Clear the picker.
|
|
1583
1693
|
*/
|
|
1584
|
-
async
|
|
1585
|
-
this.
|
|
1694
|
+
async clear() {
|
|
1695
|
+
const oldValue = this.value;
|
|
1696
|
+
this.value = undefined;
|
|
1697
|
+
if (oldValue !== this.value) {
|
|
1698
|
+
this.catChange.emit(this.value);
|
|
1699
|
+
}
|
|
1586
1700
|
}
|
|
1587
1701
|
/**
|
|
1588
|
-
*
|
|
1702
|
+
* Resets the view of the picker.
|
|
1589
1703
|
*/
|
|
1590
|
-
async
|
|
1591
|
-
this.
|
|
1704
|
+
async resetView() {
|
|
1705
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1706
|
+
const [dateStart] = this.getValue();
|
|
1707
|
+
this.viewDate = dateStart ?? clampDate(minDate, this.locale.now(), maxDate);
|
|
1592
1708
|
}
|
|
1593
1709
|
render() {
|
|
1710
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1594
1711
|
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
|
|
1712
|
+
const [dateStart, dateEnd] = this.getValue();
|
|
1713
|
+
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
1714
|
.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);
|
|
1715
|
+
.map(day => (h("div", null, this.getWeekNumber(day)))))), h("div", { key: '48f7b239e8ccb0d56b4f7c80d8892b79c2908990', class: "picker-grid-days" }, dateGrid.map(day => {
|
|
1716
|
+
const isStartDate = isSameDay(dateStart, day);
|
|
1717
|
+
const isEndDate = isSameDay(dateEnd, day);
|
|
1718
|
+
const isRange = !!dateStart && !!dateEnd && day > dateStart && day < dateEnd;
|
|
1719
|
+
const isToday = isSameDay(this.locale.now(), day);
|
|
1720
|
+
return (h("cat-button", { class: {
|
|
1721
|
+
'cat-date-item': true,
|
|
1722
|
+
'date-other': !isSameMonth(this.viewDate, day),
|
|
1723
|
+
'date-today': isToday,
|
|
1724
|
+
'date-start': this.range && isStartDate,
|
|
1725
|
+
'date-range': this.range && isRange,
|
|
1726
|
+
'date-end': this.range && isEndDate,
|
|
1727
|
+
'date-focusable': this.canFocus(day),
|
|
1728
|
+
'date-disabled': !this.canClick(day)
|
|
1729
|
+
}, 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()));
|
|
1730
|
+
}))), 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
1731
|
}
|
|
1626
1732
|
focus(date) {
|
|
1627
|
-
|
|
1733
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1734
|
+
this.focusDate = clampDate(minDate, date, maxDate);
|
|
1628
1735
|
this.viewDate = new Date(this.focusDate.getFullYear(), this.focusDate.getMonth());
|
|
1629
1736
|
this.hostElement.shadowRoot
|
|
1630
|
-
?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
|
|
1737
|
+
?.querySelector(`[data-date="${this.locale.toLocalISO(this.focusDate)}"]`)
|
|
1631
1738
|
?.doFocus();
|
|
1632
1739
|
}
|
|
1633
1740
|
navigate(direction, period) {
|
|
@@ -1647,20 +1754,6 @@ const CatDate = class {
|
|
|
1647
1754
|
node.innerHTML = text;
|
|
1648
1755
|
}
|
|
1649
1756
|
}
|
|
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
1757
|
dateGrid(year, month) {
|
|
1665
1758
|
const firstDayOfWeek = new Date(year, month, 1).getDay();
|
|
1666
1759
|
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
@@ -1676,19 +1769,6 @@ const CatDate = class {
|
|
|
1676
1769
|
getHeadline() {
|
|
1677
1770
|
return `${this.locale.months.long[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`;
|
|
1678
1771
|
}
|
|
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
1772
|
getWeekNumber(date, iso8601 = true) {
|
|
1693
1773
|
const currentDate = new Date(date.getTime());
|
|
1694
1774
|
const dayNum = iso8601 ? currentDate.getDay() || 7 : currentDate.getDay();
|
|
@@ -1697,34 +1777,46 @@ const CatDate = class {
|
|
|
1697
1777
|
return Math.ceil(((+currentDate - +yearStart) / 86400000 + 1) / 7);
|
|
1698
1778
|
}
|
|
1699
1779
|
canFocus(date) {
|
|
1700
|
-
const now = this.now;
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1703
|
-
|
|
1780
|
+
const now = this.locale.now();
|
|
1781
|
+
const [minDate] = this.getMinMaxDate();
|
|
1782
|
+
const focusedDate = this.focusedDate;
|
|
1783
|
+
const [startDate] = this.getValue();
|
|
1784
|
+
if (focusedDate && isSameMonth(focusedDate, this.viewDate)) {
|
|
1785
|
+
return isSameMonth(focusedDate, date) && isSameDay(focusedDate, date);
|
|
1704
1786
|
}
|
|
1705
|
-
else if (
|
|
1706
|
-
return isSameMonth(
|
|
1787
|
+
else if (startDate && isSameMonth(startDate, this.viewDate)) {
|
|
1788
|
+
return isSameMonth(startDate, date) && isSameDay(startDate, date);
|
|
1707
1789
|
}
|
|
1708
|
-
else if (isSameMonth(this.viewDate, now) && (!
|
|
1790
|
+
else if (isSameMonth(this.viewDate, now) && (!minDate || minDate <= now)) {
|
|
1709
1791
|
return isSameMonth(this.viewDate, date) && isSameDay(now, date);
|
|
1710
1792
|
}
|
|
1711
|
-
const minDay = isSameMonth(date,
|
|
1793
|
+
const minDay = isSameMonth(date, minDate) ? minDate?.getDate() ?? 1 : 1;
|
|
1712
1794
|
return isSameMonth(this.viewDate, date) && date.getDate() === minDay;
|
|
1713
1795
|
}
|
|
1714
1796
|
canClick(date) {
|
|
1715
|
-
const
|
|
1716
|
-
|
|
1717
|
-
return (!min || min <= date) && (!max || max >= date);
|
|
1797
|
+
const [minDate, maxDate] = this.getMinMaxDate();
|
|
1798
|
+
return (!minDate || minDate <= date) && (!maxDate || maxDate >= date);
|
|
1718
1799
|
}
|
|
1719
|
-
|
|
1720
|
-
const
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1723
|
-
|
|
1800
|
+
getMinMaxDate() {
|
|
1801
|
+
const minDate = this.locale.fromLocalISO(this.min);
|
|
1802
|
+
const maxDate = this.locale.fromLocalISO(this.max);
|
|
1803
|
+
return [minDate, maxDate];
|
|
1804
|
+
}
|
|
1805
|
+
getValue() {
|
|
1806
|
+
if (this.range) {
|
|
1807
|
+
const [startDate, endDate] = JSON.parse(this.value || '[]');
|
|
1808
|
+
return [this.locale.fromLocalISO(startDate), this.locale.fromLocalISO(endDate)];
|
|
1809
|
+
}
|
|
1810
|
+
else {
|
|
1811
|
+
return [this.locale.fromLocalISO(this.value), null];
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
toRangeValue(startDate, endDate) {
|
|
1815
|
+
return JSON.stringify([startDate, endDate].map(date => (date ? this.locale.toLocalISO(date) : null)));
|
|
1724
1816
|
}
|
|
1725
1817
|
get hostElement() { return getElement(this); }
|
|
1726
1818
|
};
|
|
1727
|
-
|
|
1819
|
+
CatDateInline.style = CatDateInlineStyle0;
|
|
1728
1820
|
|
|
1729
1821
|
var HOOKS = [
|
|
1730
1822
|
"onChange",
|
|
@@ -6084,7 +6176,7 @@ const CatDatepickerFlat = class {
|
|
|
6084
6176
|
}
|
|
6085
6177
|
render() {
|
|
6086
6178
|
return [
|
|
6087
|
-
h("cat-input", { key: '
|
|
6179
|
+
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
6180
|
e.stopPropagation();
|
|
6089
6181
|
this.value = e.detail || undefined;
|
|
6090
6182
|
}, onCatFocus: e => {
|
|
@@ -6094,7 +6186,7 @@ const CatDatepickerFlat = class {
|
|
|
6094
6186
|
e.stopPropagation();
|
|
6095
6187
|
this.catBlur.emit(e.detail);
|
|
6096
6188
|
} }, this.hasSlottedLabel && (h("span", { slot: "label" }, h("slot", { name: "label" }))), this.hasSlottedHint && (h("span", { slot: "hint" }, h("slot", { name: "hint" })))),
|
|
6097
|
-
h("div", { key: '
|
|
6189
|
+
h("div", { key: 'c8112214544e0582a1196350a846ddeb063067a3', ref: el => (this._calendarWrapper = el), class: "datepicker-wrapper" })
|
|
6098
6190
|
];
|
|
6099
6191
|
}
|
|
6100
6192
|
initDatepicker(input) {
|
|
@@ -6197,11 +6289,11 @@ const CatDatepickerInline = class {
|
|
|
6197
6289
|
this.pickr = this.initDatepicker(this.input);
|
|
6198
6290
|
}
|
|
6199
6291
|
render() {
|
|
6200
|
-
return (h(Host, { key: '
|
|
6292
|
+
return (h(Host, { key: '6f363a4a673603f0c39f5a24b31bb768e804abfc' }, h("div", { key: '2c56934aad4d60ea96a6a3c983ae9d1e39c82bde', tabIndex: this.disabled || this.readonly ? -1 : undefined, class: {
|
|
6201
6293
|
'datepicker-wrapper': true,
|
|
6202
6294
|
'datepicker-disabled': this.disabled,
|
|
6203
6295
|
'datepicker-readonly': this.readonly
|
|
6204
|
-
} }, h("input", { key: '
|
|
6296
|
+
} }, h("input", { key: '6885c1c919af468401dddda38045ab9a8dc26aaf', ref: el => (this.input = el), value: this.value, disabled: this.disabled, readonly: this.readonly }))));
|
|
6205
6297
|
}
|
|
6206
6298
|
initDatepicker(input) {
|
|
6207
6299
|
if (!input) {
|
|
@@ -7856,7 +7948,7 @@ const CatDropdown = class {
|
|
|
7856
7948
|
}, timeTransitionS);
|
|
7857
7949
|
}
|
|
7858
7950
|
render() {
|
|
7859
|
-
return (h(Host, { key: '
|
|
7951
|
+
return (h(Host, { key: '5e8a36f00643aa9717333a38ef215b27d328c167' }, h("slot", { key: '86a79d3b71d98a57e78be7c94caf35bbf8dbdfdd', name: "trigger", ref: el => (this.triggerSlot = el) }), h("div", { key: '1367ba9d60feb7abb4ae5993ba0b5c48ee44e308', id: this.contentId, class: { content: true, 'overflow-auto': !this.overflow }, ref: el => (this.content = el) }, h("slot", { key: '816d07aa40e29aff294b1110370286f2b968fc46', name: "content" }))));
|
|
7860
7952
|
}
|
|
7861
7953
|
get contentId() {
|
|
7862
7954
|
return `cat-dropdown-${this.id}`;
|
|
@@ -7942,7 +8034,7 @@ const CatFormGroup = class {
|
|
|
7942
8034
|
});
|
|
7943
8035
|
}
|
|
7944
8036
|
render() {
|
|
7945
|
-
return (h(Host, { key: '
|
|
8037
|
+
return (h(Host, { key: '6892a4f36f418d431b6006518c44bf2b58e70f70', style: { '--label-size': this.labelSize } }, h("slot", { key: '908b2720b504ce9dfb3a491aa3bbe092a3d2e0cf', onSlotchange: this.onSlotChange.bind(this) })));
|
|
7946
8038
|
}
|
|
7947
8039
|
onSlotChange() {
|
|
7948
8040
|
this.formElements = Array.from(this.hostElement.querySelectorAll('cat-input, cat-textarea, cat-select, cat-datepicker'));
|
|
@@ -7974,7 +8066,7 @@ const CatIcon = class {
|
|
|
7974
8066
|
this.a11yLabel = undefined;
|
|
7975
8067
|
}
|
|
7976
8068
|
render() {
|
|
7977
|
-
return (h("span", { key: '
|
|
8069
|
+
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
8070
|
icon: true,
|
|
7979
8071
|
[`icon-${this.size}`]: this.size !== 'inline'
|
|
7980
8072
|
} }));
|
|
@@ -9655,19 +9747,19 @@ const CatInput = class {
|
|
|
9655
9747
|
}
|
|
9656
9748
|
}
|
|
9657
9749
|
render() {
|
|
9658
|
-
return (h("div", { key: '
|
|
9750
|
+
return (h("div", { key: '34152d1627e62e4852531f9afdb2b0abc3894a78', class: {
|
|
9659
9751
|
'input-field': true,
|
|
9660
9752
|
'input-horizontal': this.horizontal
|
|
9661
|
-
} }, h("div", { key: '
|
|
9753
|
+
} }, 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
9754
|
'input-wrapper': true,
|
|
9663
9755
|
'input-round': this.round,
|
|
9664
9756
|
'input-readonly': this.readonly,
|
|
9665
9757
|
'input-disabled': this.disabled,
|
|
9666
9758
|
'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: '
|
|
9759
|
+
}, 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
9760
|
'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
|
|
9669
9761
|
'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: '
|
|
9762
|
+
}, 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
9763
|
}
|
|
9672
9764
|
get hasHint() {
|
|
9673
9765
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -9745,9 +9837,9 @@ const CatPagination = class {
|
|
|
9745
9837
|
this.iconNext = '$cat:pagination-right';
|
|
9746
9838
|
}
|
|
9747
9839
|
render() {
|
|
9748
|
-
return (h("nav", { key: '
|
|
9840
|
+
return (h("nav", { key: 'ede4b30a483fb729428b8d2bfdd4d67b1b5f1022', role: "navigation" }, h("ol", { key: '04fd80b91e33c55a23d010e5fa108b10a08e2bdb', class: {
|
|
9749
9841
|
[`cat-pagination-${this.size}`]: Boolean(this.size)
|
|
9750
|
-
} }, h("li", { key: '
|
|
9842
|
+
} }, 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
9843
|
}
|
|
9752
9844
|
get isFirst() {
|
|
9753
9845
|
return this.page === 0;
|
|
@@ -9852,7 +9944,7 @@ const CatRadio = class {
|
|
|
9852
9944
|
this.input.blur();
|
|
9853
9945
|
}
|
|
9854
9946
|
render() {
|
|
9855
|
-
return (h(Host, { key: '
|
|
9947
|
+
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
9948
|
}
|
|
9857
9949
|
get hasHint() {
|
|
9858
9950
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -9943,7 +10035,7 @@ const CatRadioGroup = class {
|
|
|
9943
10035
|
}
|
|
9944
10036
|
}
|
|
9945
10037
|
render() {
|
|
9946
|
-
return (h("div", { key: '
|
|
10038
|
+
return (h("div", { key: '5608e54b1bb857a4068a6287b072bd71081d51d2', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: '8e62283745589e94e99650f7fe85afeea39fa253' })));
|
|
9947
10039
|
}
|
|
9948
10040
|
init() {
|
|
9949
10041
|
this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
|
|
@@ -10032,13 +10124,13 @@ const CatScrollable = class {
|
|
|
10032
10124
|
}
|
|
10033
10125
|
render() {
|
|
10034
10126
|
return [
|
|
10035
|
-
h("div", { key: '
|
|
10036
|
-
h("div", { key: '
|
|
10127
|
+
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" })),
|
|
10128
|
+
h("div", { key: '9552a4a4a86713effab40df3f95310dae5863f78', ref: el => (this.scrollElement = el), class: {
|
|
10037
10129
|
'scrollable-content': true,
|
|
10038
10130
|
'scroll-x': !this.noOverflowX,
|
|
10039
10131
|
'scroll-y': !this.noOverflowY,
|
|
10040
10132
|
'no-overscroll': this.noOverscroll
|
|
10041
|
-
} }, h("slot", { key: '
|
|
10133
|
+
} }, h("slot", { key: 'acc0afcb95539ad6db29c6a96b2673892f2d9153' }))
|
|
10042
10134
|
];
|
|
10043
10135
|
}
|
|
10044
10136
|
attachEmitter(from, emitter) {
|
|
@@ -10982,7 +11074,7 @@ const CatSelectTest = class {
|
|
|
10982
11074
|
setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
|
|
10983
11075
|
}
|
|
10984
11076
|
render() {
|
|
10985
|
-
return (h(Host, { key: '
|
|
11077
|
+
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
11078
|
}
|
|
10987
11079
|
get countryConnector() {
|
|
10988
11080
|
return {
|
|
@@ -12238,7 +12330,7 @@ const CatSkeleton = class {
|
|
|
12238
12330
|
this.lines = undefined;
|
|
12239
12331
|
}
|
|
12240
12332
|
render() {
|
|
12241
|
-
return (h(Host, { key: '
|
|
12333
|
+
return (h(Host, { key: '8f1e4584c050cc8b6d1341efd3d8b04ca7223a73' }, Array.from(Array(this.count)).map(() => (h("div", { style: this.style, class: {
|
|
12242
12334
|
skeleton: true,
|
|
12243
12335
|
[`skeleton-${this.effect}`]: Boolean(this.effect),
|
|
12244
12336
|
[`skeleton-${this.variant}`]: Boolean(this.variant),
|
|
@@ -12278,9 +12370,9 @@ const CatSpinner = class {
|
|
|
12278
12370
|
this.a11yLabel = undefined;
|
|
12279
12371
|
}
|
|
12280
12372
|
render() {
|
|
12281
|
-
return (h("span", { key: '
|
|
12373
|
+
return (h("span", { key: 'cf1110c7ae2c653c87f44f2668aa3bcc757ed0c9', "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', class: {
|
|
12282
12374
|
[`spinner-${this.size}`]: this.size !== 'inline'
|
|
12283
|
-
} }, h("svg", { key: '
|
|
12375
|
+
} }, 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
12376
|
}
|
|
12285
12377
|
};
|
|
12286
12378
|
CatSpinner.style = CatSpinnerStyle0;
|
|
@@ -12312,7 +12404,7 @@ const CatTab = class {
|
|
|
12312
12404
|
this.catClick.emit(event);
|
|
12313
12405
|
}
|
|
12314
12406
|
render() {
|
|
12315
|
-
return h(Host, { key: '
|
|
12407
|
+
return h(Host, { key: 'e0b1e0562a35130f4b0de08530eb66c9df5ec145' });
|
|
12316
12408
|
}
|
|
12317
12409
|
get hostElement() { return getElement(this); }
|
|
12318
12410
|
};
|
|
@@ -12376,7 +12468,7 @@ const CatTabs = class {
|
|
|
12376
12468
|
this.activate(this.tabs[index]);
|
|
12377
12469
|
}
|
|
12378
12470
|
render() {
|
|
12379
|
-
return (h(Host, { key: '
|
|
12471
|
+
return (h(Host, { key: '05969fc6e983159aaad4a36ab07b6326c5c85589' }, this.tabs.map((tab) => {
|
|
12380
12472
|
return (h("cat-button", { buttonId: tab.id, role: "tab", part: "tab", class: {
|
|
12381
12473
|
'cat-tab': true,
|
|
12382
12474
|
'cat-tab-active': tab.id === this.activeTab,
|
|
@@ -12496,15 +12588,15 @@ const CatTextarea = class {
|
|
|
12496
12588
|
}
|
|
12497
12589
|
}
|
|
12498
12590
|
render() {
|
|
12499
|
-
return (h(Host, { key: '
|
|
12591
|
+
return (h(Host, { key: '2fac5152cbeeb9d4a9c4dc0f9539bb1a1503c9e8' }, h("div", { key: '88d992d98f72a0862b3736ad102a0124363e17b6', class: {
|
|
12500
12592
|
'textarea-field': true,
|
|
12501
12593
|
'textarea-horizontal': this.horizontal
|
|
12502
|
-
} }, h("div", { key: '
|
|
12594
|
+
} }, 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
12595
|
'textarea-wrapper': true,
|
|
12504
12596
|
'textarea-readonly': this.readonly,
|
|
12505
12597
|
'textarea-disabled': this.disabled,
|
|
12506
12598
|
'textarea-invalid': this.invalid
|
|
12507
|
-
} }, h("textarea", { key: '
|
|
12599
|
+
} }, 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
12600
|
}
|
|
12509
12601
|
get hasHint() {
|
|
12510
12602
|
return !!this.hint || !!this.hasSlottedHint || this.invalid;
|
|
@@ -12709,7 +12801,7 @@ const CatTime = class {
|
|
|
12709
12801
|
this.input?.clear();
|
|
12710
12802
|
}
|
|
12711
12803
|
render() {
|
|
12712
|
-
return (h(Host, { key: '
|
|
12804
|
+
return (h(Host, { key: '899fb8f5f263ba560bacb99d111792e9219e057a' }, h("cat-input", { key: 'e2b84c644e265cdc166c7ec50cb873d79ddeb12e', 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: '097ee8e93a2d05d35051ddc1aa105b1e9ebf0528', slot: "label" }, this.hasSlottedLabel && h("slot", { name: "label" }), !this.hasSlottedLabel && this.label, h("span", { key: '5d526fe661331f8eb1a887ddc0eabc3f3338747a', class: "label-aria" }, " (HH:mm)")), h("div", { key: '28fcd51b6e297d552e121a01813c92c564cccbda', 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: 'f93687883da3f3c32027edcd89d6989caad8e504', slot: "addon", placement: this.placement }, h("cat-button", { key: 'eae27c8538ff6564d6b5a735b30e8c2aac07751d', 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: 'a334804d935c713bb95e3bb88fce40fa7f05724c', slot: "content", class: "cat-nav" }, h("ul", { key: '713181fc8597cf4b9486f2fb7aa63fb412180054' }, this.timeArray().map(time => {
|
|
12713
12805
|
const isoTime = this.formatIso(time);
|
|
12714
12806
|
const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
|
|
12715
12807
|
return (h("li", null, h("cat-button", { class: {
|
|
@@ -12824,7 +12916,7 @@ const CatToggle = class {
|
|
|
12824
12916
|
this.input.blur();
|
|
12825
12917
|
}
|
|
12826
12918
|
render() {
|
|
12827
|
-
return (h(Host, { key: '
|
|
12919
|
+
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
12920
|
}
|
|
12829
12921
|
get hasHint() {
|
|
12830
12922
|
return !!this.hint || !!this.hasSlottedHint;
|
|
@@ -12911,12 +13003,12 @@ const CatTooltip = class {
|
|
|
12911
13003
|
}
|
|
12912
13004
|
}
|
|
12913
13005
|
render() {
|
|
12914
|
-
return (h(Host, { key: '
|
|
13006
|
+
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
13007
|
tooltip: true,
|
|
12916
13008
|
'tooltip-hidden': this.inactive,
|
|
12917
13009
|
'tooltip-round': this.round,
|
|
12918
13010
|
[`tooltip-${this.size}`]: Boolean(this.size)
|
|
12919
|
-
} }, h("slot", { key: '
|
|
13011
|
+
} }, h("slot", { key: '724fac6b27719c0cb9d243aab8ab4485fa72fc43', name: "content" }, h("p", { key: '2d6c325c46035725ac8c81330038888eefeb0c89' }, this.content)))));
|
|
12920
13012
|
}
|
|
12921
13013
|
async update() {
|
|
12922
13014
|
if (this.trigger && this.tooltip) {
|
|
@@ -12996,6 +13088,6 @@ CatTooltip.OFFSET = 4;
|
|
|
12996
13088
|
CatTooltip.SHIFT_PADDING = 4;
|
|
12997
13089
|
CatTooltip.style = CatTooltipStyle0;
|
|
12998
13090
|
|
|
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 };
|
|
13091
|
+
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
13092
|
|
|
13001
|
-
//# sourceMappingURL=cat-
|
|
13093
|
+
//# sourceMappingURL=cat-alert_29.entry.js.map
|