@haiilo/catalyst 10.2.0 → 10.4.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/assets/fonts/Lato-Black.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.ttf +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/catalyst/catalyst.css +10 -1
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.esm.js +1 -1
- package/dist/catalyst/p-81800b65.js +2 -0
- package/dist/catalyst/p-81800b65.js.map +1 -0
- package/dist/catalyst/p-8a1d505d.entry.js +10 -0
- package/dist/catalyst/p-8a1d505d.entry.js.map +1 -0
- package/dist/catalyst/scss/core/_form.scss +12 -3
- package/dist/cjs/{cat-alert_26.cjs.entry.js → cat-alert_28.cjs.entry.js} +2293 -128
- package/dist/cjs/cat-alert_28.cjs.entry.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{of-a6e7c491.js → of-45281229.js} +34 -19
- package/dist/cjs/of-45281229.js.map +1 -0
- package/dist/collection/assets/fonts/Lato-Black.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Light.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.ttf +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/cat-alert/cat-alert.spec.js +2 -9
- package/dist/collection/components/cat-alert/cat-alert.spec.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js +3 -7
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.spec.js +2 -6
- package/dist/collection/components/cat-badge/cat-badge.spec.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +29 -0
- package/dist/collection/components/cat-button/cat-button.spec.js +1 -1
- package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js +2 -6
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.spec.js +2 -6
- package/dist/collection/components/cat-card/cat-card.spec.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +2 -17
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +1 -1
- package/dist/collection/components/cat-date/cat-date-locale.js +54 -0
- package/dist/collection/components/cat-date/cat-date-locale.js.map +1 -0
- package/dist/collection/components/cat-date/cat-date-math.js +28 -0
- package/dist/collection/components/cat-date/cat-date-math.js.map +1 -0
- package/dist/collection/components/cat-date/cat-date.css +122 -0
- package/dist/collection/components/cat-date/cat-date.e2e.js +11 -0
- package/dist/collection/components/cat-date/cat-date.e2e.js.map +1 -0
- package/dist/collection/components/cat-date/cat-date.js +923 -0
- package/dist/collection/components/cat-date/cat-date.js.map +1 -0
- package/dist/collection/components/cat-date/cat-date.spec.js +16 -0
- package/dist/collection/components/cat-date/cat-date.spec.js.map +1 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +3 -3
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +3 -8
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +1 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +2 -8
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +100 -30
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +2 -8
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js +2 -6
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +27 -15
- 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-icon/cat-icon.spec.js +1 -1
- package/dist/collection/components/cat-icon/cat-icon.spec.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +15 -0
- package/dist/collection/components/cat-input/cat-input.js +44 -6
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.spec.js +2 -23
- package/dist/collection/components/cat-input/cat-input.spec.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js +2 -18
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +1 -1
- package/dist/collection/components/cat-radio/cat-radio.spec.js +3 -13
- package/dist/collection/components/cat-radio/cat-radio.spec.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +2 -8
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +2 -13
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.js +4 -4
- package/dist/collection/components/cat-select/cat-select.spec.js +2 -28
- package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +2 -6
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +1 -1
- package/dist/collection/components/cat-tab/cat-tab.js +1 -1
- package/dist/collection/components/cat-tab/cat-tab.spec.js +2 -5
- package/dist/collection/components/cat-tab/cat-tab.spec.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js +2 -5
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js +2 -21
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +1 -1
- package/dist/collection/components/cat-time/cat-time-locale.js +15 -0
- package/dist/collection/components/cat-time/cat-time-locale.js.map +1 -0
- package/dist/collection/components/cat-time/cat-time-math.js +28 -0
- package/dist/collection/components/cat-time/cat-time-math.js.map +1 -0
- package/dist/collection/components/cat-time/cat-time.css +41 -0
- package/dist/collection/components/cat-time/cat-time.e2e.js +11 -0
- package/dist/collection/components/cat-time/cat-time.e2e.js.map +1 -0
- package/dist/collection/components/cat-time/cat-time.js +801 -0
- package/dist/collection/components/cat-time/cat-time.js.map +1 -0
- package/dist/collection/components/cat-time/cat-time.spec.js +16 -0
- package/dist/collection/components/cat-time/cat-time.spec.js.map +1 -0
- package/dist/collection/components/cat-toggle/cat-toggle.js +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js +2 -10
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +2 -2
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +1 -9
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +1 -1
- package/dist/collection/scss/core/_form.scss +12 -3
- package/dist/components/cat-button2.js +1 -1
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-date.d.ts +11 -0
- package/dist/components/cat-date.js +469 -0
- package/dist/components/cat-date.js.map +1 -0
- package/dist/components/cat-datepicker-inline.js +2 -2
- package/dist/components/cat-datepicker.js +2 -2
- package/dist/components/cat-dropdown2.js +35 -30
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +1 -1
- package/dist/components/cat-icon-registry.js +33 -18
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-icon2.js +1 -1
- package/dist/components/cat-input2.js +1572 -6
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-pagination.js +2 -2
- package/dist/components/cat-radio-group.js +1 -1
- package/dist/components/cat-radio.js +1 -1
- package/dist/components/cat-scrollable2.js +3 -3
- package/dist/components/cat-select-demo.js +1 -1
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-skeleton2.js +1 -1
- package/dist/components/cat-spinner2.js +2 -2
- package/dist/components/cat-tab.js +1 -1
- package/dist/components/cat-tabs.js +1 -1
- package/dist/components/cat-textarea.js +3 -3
- package/dist/components/cat-time.d.ts +11 -0
- package/dist/components/cat-time.js +303 -0
- package/dist/components/cat-time.js.map +1 -0
- package/dist/components/cat-toggle.js +1 -1
- package/dist/components/cat-tooltip.js +2 -2
- package/dist/esm/{cat-alert_26.entry.js → cat-alert_28.entry.js} +2293 -130
- package/dist/esm/cat-alert_28.entry.js.map +1 -0
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{of-d37c1933.js → of-19888f3b.js} +34 -19
- package/dist/esm/of-19888f3b.js.map +1 -0
- package/dist/types/components/cat-date/cat-date-locale.d.ts +24 -0
- package/dist/types/components/cat-date/cat-date-math.d.ts +7 -0
- package/dist/types/components/cat-date/cat-date.d.ts +180 -0
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +9 -3
- package/dist/types/components/cat-input/cat-input.d.ts +9 -2
- package/dist/types/components/cat-time/cat-time-locale.d.ts +6 -0
- package/dist/types/components/cat-time/cat-time-math.d.ts +3 -0
- package/dist/types/components/cat-time/cat-time.d.ts +168 -0
- package/dist/types/components.d.ts +551 -8
- package/package.json +7 -5
- package/dist/catalyst/p-37905c93.entry.js +0 -10
- package/dist/catalyst/p-37905c93.entry.js.map +0 -1
- package/dist/catalyst/p-8fc7b0f0.js +0 -2
- package/dist/catalyst/p-8fc7b0f0.js.map +0 -1
- package/dist/cjs/cat-alert_26.cjs.entry.js.map +0 -1
- package/dist/cjs/of-a6e7c491.js.map +0 -1
- package/dist/esm/cat-alert_26.entry.js.map +0 -1
- package/dist/esm/of-d37c1933.js.map +0 -1
|
@@ -0,0 +1,923 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { catI18nRegistry as i18n } from "../cat-i18n/cat-i18n-registry";
|
|
3
|
+
import { getLocale } from "./cat-date-locale";
|
|
4
|
+
import { addDays, addMonth, clampDate, isSameDay, isSameMonth, isSameYear } from "./cat-date-math";
|
|
5
|
+
export class CatDate {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.language = i18n.getLocale();
|
|
8
|
+
this.locale = getLocale(this.language);
|
|
9
|
+
this.isOpen = false;
|
|
10
|
+
// additonally store the focus date to ensure correct focus after potential re-render
|
|
11
|
+
this.focusDate = null;
|
|
12
|
+
this.hasSlottedLabel = false;
|
|
13
|
+
this.hasSlottedHint = false;
|
|
14
|
+
this.viewDate = this.now;
|
|
15
|
+
this.selectionDate = null;
|
|
16
|
+
this.requiredMarker = 'optional';
|
|
17
|
+
this.horizontal = false;
|
|
18
|
+
this.autoComplete = undefined;
|
|
19
|
+
this.clearable = false;
|
|
20
|
+
this.disabled = false;
|
|
21
|
+
this.hint = undefined;
|
|
22
|
+
this.icon = undefined;
|
|
23
|
+
this.iconRight = false;
|
|
24
|
+
this.identifier = undefined;
|
|
25
|
+
this.label = '';
|
|
26
|
+
this.labelHidden = false;
|
|
27
|
+
this.max = undefined;
|
|
28
|
+
this.min = undefined;
|
|
29
|
+
this.name = undefined;
|
|
30
|
+
this.placeholder = undefined;
|
|
31
|
+
this.textPrefix = undefined;
|
|
32
|
+
this.textSuffix = undefined;
|
|
33
|
+
this.readonly = false;
|
|
34
|
+
this.required = false;
|
|
35
|
+
this.value = undefined;
|
|
36
|
+
this.errors = undefined;
|
|
37
|
+
this.errorUpdate = 0;
|
|
38
|
+
this.nativeAttributes = undefined;
|
|
39
|
+
this.placement = 'bottom-end';
|
|
40
|
+
}
|
|
41
|
+
get maxDate() {
|
|
42
|
+
const [y, m, d] = this.max?.split('-').map(Number) || [];
|
|
43
|
+
return this.max ? new Date(y, m - 1, d) : null;
|
|
44
|
+
}
|
|
45
|
+
get minDate() {
|
|
46
|
+
const [y, m, d] = this.min?.split('-').map(Number) || [];
|
|
47
|
+
return this.min ? new Date(y, m - 1, d) : null;
|
|
48
|
+
}
|
|
49
|
+
get now() {
|
|
50
|
+
const date = new Date();
|
|
51
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
52
|
+
}
|
|
53
|
+
get focusedDate() {
|
|
54
|
+
const [all, year, month, day] = this.hostElement.shadowRoot
|
|
55
|
+
?.querySelector(`[data-date]:focus`)
|
|
56
|
+
?.dataset.date?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
57
|
+
return all ? new Date(Number(year), Number(month) - 1, Number(day)) : null;
|
|
58
|
+
}
|
|
59
|
+
componentWillLoad() {
|
|
60
|
+
const [match, year, month, day] = this.value?.match(/^(\d{4})-(\d{2})-(\d{2})/) ?? [];
|
|
61
|
+
if (match) {
|
|
62
|
+
this.select(new Date(Number(year), Number(month) - 1, Number(day)));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
componentWillRender() {
|
|
66
|
+
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
67
|
+
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
68
|
+
}
|
|
69
|
+
componentDidLoad() {
|
|
70
|
+
const format = this.locale.formatStr.replace('YYYY', 'Y').replace('YY', 'y').replace('MM', 'm').replace('DD', 'd');
|
|
71
|
+
const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(format) || [];
|
|
72
|
+
this.input?.mask({
|
|
73
|
+
date: true,
|
|
74
|
+
dateMin: this.min,
|
|
75
|
+
dateMax: this.max,
|
|
76
|
+
delimiter: d1,
|
|
77
|
+
datePattern: [p1, p2, p3]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
componentDidRender() {
|
|
81
|
+
if (this.focusDate) {
|
|
82
|
+
this.hostElement.shadowRoot
|
|
83
|
+
?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
|
|
84
|
+
?.doFocus();
|
|
85
|
+
this.focusDate = null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
onOpen() {
|
|
89
|
+
this.isOpen = true;
|
|
90
|
+
this.setAriaLive('');
|
|
91
|
+
const viewDate = this.selectionDate
|
|
92
|
+
? new Date(this.selectionDate.getFullYear(), this.selectionDate.getMonth(), 1)
|
|
93
|
+
: this.now;
|
|
94
|
+
this.viewDate = clampDate(this.minDate, viewDate, this.maxDate);
|
|
95
|
+
}
|
|
96
|
+
onClose() {
|
|
97
|
+
this.isOpen = false;
|
|
98
|
+
}
|
|
99
|
+
onKeyDown(e) {
|
|
100
|
+
if (!this.isOpen || !['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const focused = this.focusedDate;
|
|
104
|
+
if (!focused) {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
this.focus(this.selectionDate || this.now);
|
|
107
|
+
}
|
|
108
|
+
else if (e.key === 'ArrowLeft') {
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
this.focus(e.shiftKey ? addMonth(focused, -1) : addDays(focused, -1));
|
|
111
|
+
}
|
|
112
|
+
else if (e.key === 'ArrowRight') {
|
|
113
|
+
e.preventDefault();
|
|
114
|
+
this.focus(e.shiftKey ? addMonth(focused, 1) : addDays(focused, 1));
|
|
115
|
+
}
|
|
116
|
+
else if (e.key === 'ArrowUp') {
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
this.focus(addDays(focused, -7));
|
|
119
|
+
}
|
|
120
|
+
else if (e.key === 'ArrowDown') {
|
|
121
|
+
e.preventDefault();
|
|
122
|
+
this.focus(addDays(focused, 7));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Select a date in the picker.
|
|
127
|
+
*
|
|
128
|
+
* @param date The date to select.
|
|
129
|
+
*/
|
|
130
|
+
async select(date) {
|
|
131
|
+
const oldValue = this.value;
|
|
132
|
+
const newDate = clampDate(this.minDate, new Date(date.getFullYear(), date.getMonth(), date.getDate()), this.maxDate);
|
|
133
|
+
this.focus(newDate);
|
|
134
|
+
this.selectionDate = newDate;
|
|
135
|
+
this.value = newDate.toISOString();
|
|
136
|
+
if (oldValue !== this.value) {
|
|
137
|
+
this.catChange.emit(this.value);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Programmatically move focus to the input. Use this method instead of
|
|
142
|
+
* `input.focus()`.
|
|
143
|
+
*
|
|
144
|
+
* @param options An optional object providing options to control aspects of
|
|
145
|
+
* the focusing process.
|
|
146
|
+
*/
|
|
147
|
+
async doFocus(options) {
|
|
148
|
+
this.input?.doFocus(options);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Programmatically remove focus from the input. Use this method instead of
|
|
152
|
+
* `input.blur()`.
|
|
153
|
+
*/
|
|
154
|
+
async doBlur() {
|
|
155
|
+
this.input?.doBlur();
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Clear the input.
|
|
159
|
+
*/
|
|
160
|
+
async clear() {
|
|
161
|
+
this.input?.clear();
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
const dateGrid = this.dateGrid(this.viewDate.getFullYear(), this.viewDate.getMonth());
|
|
165
|
+
return (h(Host, { key: 'ebb5f193ca43bc3306449c91d2e391cb25b3287c' }, h("cat-input", { key: '27292844d077a8d79022074a191c47e72736d2c5', 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.getInputValue(), onCatFocus: e => this.catFocus.emit(e.detail), onCatBlur: e => this.onInputBlur(e.detail) }, h("span", { key: 'e9c9ad5b5374fcf944396a7ae45ae61775336be4', slot: "label" }, this.label, h("span", { key: '5a05917857fdc967bb122e0403f64b8b71ecf08a', class: "label-aria" }, " (", this.locale.formatStr, ")")), h("cat-dropdown", { key: 'ac1b7f5e1efae2648fa82acb31059ab41d0adb55', slot: "addon", placement: this.placement, arrowNavigation: "none", noResize: true }, h("cat-button", { key: 'bfaabd6f8120333b497b262894489628beb1d886', slot: "trigger", icon: "$cat:datepicker-calendar", iconOnly: true, class: "cat-date-toggle", disabled: this.disabled, a11yLabel: this.selectionDate
|
|
166
|
+
? `${this.locale.change}, ${this.getA11yLabelDay(this.selectionDate)}`
|
|
167
|
+
: 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
|
|
168
|
+
.filter((_, i) => i % 7 === 0)
|
|
169
|
+
.map(day => (h("div", null, this.getWeekNumber(day))))), h("div", { key: '1e7750157710763ad977d866bb2e511b6ec44d03', class: "picker-grid-days" }, dateGrid.map(day => (h("cat-button", { class: {
|
|
170
|
+
'cat-date-item': true,
|
|
171
|
+
'date-other': !isSameMonth(this.viewDate, day),
|
|
172
|
+
'date-today': isSameDay(this.now, day),
|
|
173
|
+
'date-selected': isSameDay(this.selectionDate, day),
|
|
174
|
+
'date-focusable': this.canFocus(day),
|
|
175
|
+
'date-disabled': !this.canClick(day)
|
|
176
|
+
}, nativeAttributes: !this.canFocus(day) ? { tabindex: '-1' } : {}, variant: isSameDay(this.selectionDate, day) ? 'filled' : isSameDay(this.now, day) ? 'outlined' : 'text', a11yLabel: this.getA11yLabelDay(day), active: isSameDay(this.selectionDate, day), color: isSameDay(this.selectionDate, day) || isSameDay(this.now, day) ? 'primary' : 'secondary', disabled: !this.canClick(day), onClick: () => this.select(day), "data-date": this.toLocalISO(day) }, day.getDate()))))), h("div", { key: 'd8874097357312b5ddd4bda5e4018d3e642aaf99', class: "picker-foot" }, this.canClick(this.now) && (h("cat-button", { size: "s", "data-dropdown-no-close": true, onClick: () => this.select(this.now) }, this.locale.today)), h("p", { key: '42d936d44ef0cb07375415ae42a95565cd7f342b', class: {
|
|
177
|
+
'cursor-help': true,
|
|
178
|
+
'cursor-right': this.canClick(this.now)
|
|
179
|
+
} }, this.locale.arrowKeys), h("p", { key: '6df5566486d5082b3c2cb79fde22cedd7608c8bf', class: "cursor-aria", "aria-live": "polite" })))))));
|
|
180
|
+
}
|
|
181
|
+
parse(value) {
|
|
182
|
+
const [, p1, d1, p2, p3] = /(\w+)([^\w]+)(\w+)[^\w]+(\w+)/.exec(this.locale.formatStr) || [];
|
|
183
|
+
const formatParts = [p1, p2, p3];
|
|
184
|
+
const parts = value.split(d1).map(s => Number(s || 'x'));
|
|
185
|
+
let year = parts[formatParts.indexOf('YYYY') || formatParts.indexOf('YY')] || this.now.getFullYear();
|
|
186
|
+
const month = parts[formatParts.indexOf('MM')];
|
|
187
|
+
const day = parts[formatParts.indexOf('DD')];
|
|
188
|
+
if (!Number.isInteger(month) || !Number.isInteger(day)) {
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
else if (year < 100) {
|
|
192
|
+
year += year < 50 ? 2000 : 1900;
|
|
193
|
+
}
|
|
194
|
+
return new Date(year, month - 1, day);
|
|
195
|
+
}
|
|
196
|
+
focus(date) {
|
|
197
|
+
this.focusDate = clampDate(this.minDate, date, this.maxDate);
|
|
198
|
+
this.viewDate = new Date(this.focusDate.getFullYear(), this.focusDate.getMonth());
|
|
199
|
+
this.hostElement.shadowRoot
|
|
200
|
+
?.querySelector(`[data-date="${this.toLocalISO(this.focusDate)}"]`)
|
|
201
|
+
?.doFocus();
|
|
202
|
+
}
|
|
203
|
+
navigate(direction, period) {
|
|
204
|
+
this.viewDate = new Date(direction === 'prev'
|
|
205
|
+
? period === 'year'
|
|
206
|
+
? this.viewDate.setFullYear(this.viewDate.getFullYear() - 1)
|
|
207
|
+
: this.viewDate.setMonth(this.viewDate.getMonth() - 1)
|
|
208
|
+
: period === 'year'
|
|
209
|
+
? this.viewDate.setFullYear(this.viewDate.getFullYear() + 1)
|
|
210
|
+
: this.viewDate.setMonth(this.viewDate.getMonth() + 1));
|
|
211
|
+
// announce the new month and year
|
|
212
|
+
this.setAriaLive(this.getHeadline());
|
|
213
|
+
}
|
|
214
|
+
setAriaLive(text) {
|
|
215
|
+
const node = this.hostElement.shadowRoot?.querySelector('.cursor-aria');
|
|
216
|
+
if (node) {
|
|
217
|
+
node.innerHTML = text;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
onInputBlur(e) {
|
|
221
|
+
if (!this.input) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const oldValue = this.value;
|
|
225
|
+
const value = this.parse(this.input.value ?? '');
|
|
226
|
+
this.selectionDate = value ? clampDate(this.minDate, value, this.maxDate) : value;
|
|
227
|
+
this.value = this.selectionDate?.toISOString();
|
|
228
|
+
if (oldValue !== this.value) {
|
|
229
|
+
this.catChange.emit(this.value);
|
|
230
|
+
}
|
|
231
|
+
this.input.value = this.getInputValue();
|
|
232
|
+
this.catBlur.emit(e);
|
|
233
|
+
}
|
|
234
|
+
dateGrid(year, month) {
|
|
235
|
+
const firstDayOfWeek = new Date(year, month, 1).getDay();
|
|
236
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
237
|
+
const days = [...Array(daysInMonth).keys()];
|
|
238
|
+
const daysBefore = [...Array(firstDayOfWeek).keys()].map(day => new Date(year, month, day - firstDayOfWeek).getDate());
|
|
239
|
+
const daysAfter = [...Array(42 - days.length - daysBefore.length).keys()];
|
|
240
|
+
return [
|
|
241
|
+
...daysBefore.map(day => new Date(year, month - 1, day + 1)),
|
|
242
|
+
...days.map(day => new Date(year, month, day + 1)),
|
|
243
|
+
...daysAfter.map(day => new Date(year, month + 1, day + 1))
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
getHeadline() {
|
|
247
|
+
return `${this.locale.months.long[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`;
|
|
248
|
+
}
|
|
249
|
+
getInputValue() {
|
|
250
|
+
const format = new Intl.DateTimeFormat(this.language, { year: 'numeric', month: '2-digit', day: '2-digit' });
|
|
251
|
+
return this.selectionDate ? format.format(this.selectionDate) : '';
|
|
252
|
+
}
|
|
253
|
+
getA11yLabelDay(date) {
|
|
254
|
+
const format = new Intl.DateTimeFormat(this.language, {
|
|
255
|
+
year: 'numeric',
|
|
256
|
+
month: 'long',
|
|
257
|
+
day: 'numeric',
|
|
258
|
+
weekday: 'long'
|
|
259
|
+
});
|
|
260
|
+
return format.format(date);
|
|
261
|
+
}
|
|
262
|
+
getWeekNumber(date, iso8601 = true) {
|
|
263
|
+
const currentDate = new Date(date.getTime());
|
|
264
|
+
const dayNum = iso8601 ? currentDate.getDay() || 7 : currentDate.getDay();
|
|
265
|
+
currentDate.setDate(currentDate.getDate() + 4 - dayNum);
|
|
266
|
+
const yearStart = new Date(currentDate.getFullYear(), 0, 1);
|
|
267
|
+
return Math.ceil(((+currentDate - +yearStart) / 86400000 + 1) / 7);
|
|
268
|
+
}
|
|
269
|
+
canFocus(date) {
|
|
270
|
+
const now = this.now;
|
|
271
|
+
const focused = this.focusedDate;
|
|
272
|
+
if (focused && isSameMonth(focused, this.viewDate)) {
|
|
273
|
+
return isSameMonth(focused, date) && isSameDay(focused, date);
|
|
274
|
+
}
|
|
275
|
+
else if (this.selectionDate && isSameMonth(this.selectionDate, this.viewDate)) {
|
|
276
|
+
return isSameMonth(this.selectionDate, date) && isSameDay(this.selectionDate, date);
|
|
277
|
+
}
|
|
278
|
+
else if (isSameMonth(this.viewDate, now) && (!this.minDate || this.minDate <= now)) {
|
|
279
|
+
return isSameMonth(this.viewDate, date) && isSameDay(now, date);
|
|
280
|
+
}
|
|
281
|
+
const minDay = isSameMonth(date, this.minDate) ? this.minDate?.getDate() ?? 1 : 1;
|
|
282
|
+
return isSameMonth(this.viewDate, date) && date.getDate() === minDay;
|
|
283
|
+
}
|
|
284
|
+
canClick(date) {
|
|
285
|
+
const min = this.minDate;
|
|
286
|
+
const max = this.maxDate;
|
|
287
|
+
return (!min || min <= date) && (!max || max >= date);
|
|
288
|
+
}
|
|
289
|
+
toLocalISO(date) {
|
|
290
|
+
const year = date.getFullYear();
|
|
291
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
292
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
293
|
+
return `${year}-${month}-${day}`;
|
|
294
|
+
}
|
|
295
|
+
static get is() { return "cat-date"; }
|
|
296
|
+
static get encapsulation() { return "shadow"; }
|
|
297
|
+
static get originalStyleUrls() {
|
|
298
|
+
return {
|
|
299
|
+
"$": ["cat-date.scss"]
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
static get styleUrls() {
|
|
303
|
+
return {
|
|
304
|
+
"$": ["cat-date.css"]
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
static get properties() {
|
|
308
|
+
return {
|
|
309
|
+
"requiredMarker": {
|
|
310
|
+
"type": "string",
|
|
311
|
+
"mutable": false,
|
|
312
|
+
"complexType": {
|
|
313
|
+
"original": "'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!'",
|
|
314
|
+
"resolved": "\"none!\" | \"none\" | \"optional!\" | \"optional\" | \"required!\" | \"required\" | undefined",
|
|
315
|
+
"references": {}
|
|
316
|
+
},
|
|
317
|
+
"required": false,
|
|
318
|
+
"optional": true,
|
|
319
|
+
"docs": {
|
|
320
|
+
"tags": [],
|
|
321
|
+
"text": "Whether the label need a marker to shown if the input is required or optional."
|
|
322
|
+
},
|
|
323
|
+
"attribute": "required-marker",
|
|
324
|
+
"reflect": false,
|
|
325
|
+
"defaultValue": "'optional'"
|
|
326
|
+
},
|
|
327
|
+
"horizontal": {
|
|
328
|
+
"type": "boolean",
|
|
329
|
+
"mutable": false,
|
|
330
|
+
"complexType": {
|
|
331
|
+
"original": "boolean",
|
|
332
|
+
"resolved": "boolean",
|
|
333
|
+
"references": {}
|
|
334
|
+
},
|
|
335
|
+
"required": false,
|
|
336
|
+
"optional": false,
|
|
337
|
+
"docs": {
|
|
338
|
+
"tags": [],
|
|
339
|
+
"text": "Whether the label is on top or left."
|
|
340
|
+
},
|
|
341
|
+
"attribute": "horizontal",
|
|
342
|
+
"reflect": false,
|
|
343
|
+
"defaultValue": "false"
|
|
344
|
+
},
|
|
345
|
+
"autoComplete": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"mutable": false,
|
|
348
|
+
"complexType": {
|
|
349
|
+
"original": "string",
|
|
350
|
+
"resolved": "string | undefined",
|
|
351
|
+
"references": {}
|
|
352
|
+
},
|
|
353
|
+
"required": false,
|
|
354
|
+
"optional": true,
|
|
355
|
+
"docs": {
|
|
356
|
+
"tags": [],
|
|
357
|
+
"text": "Hint for form autofill feature."
|
|
358
|
+
},
|
|
359
|
+
"attribute": "auto-complete",
|
|
360
|
+
"reflect": false
|
|
361
|
+
},
|
|
362
|
+
"clearable": {
|
|
363
|
+
"type": "boolean",
|
|
364
|
+
"mutable": false,
|
|
365
|
+
"complexType": {
|
|
366
|
+
"original": "boolean",
|
|
367
|
+
"resolved": "boolean",
|
|
368
|
+
"references": {}
|
|
369
|
+
},
|
|
370
|
+
"required": false,
|
|
371
|
+
"optional": false,
|
|
372
|
+
"docs": {
|
|
373
|
+
"tags": [],
|
|
374
|
+
"text": "Whether the input should show a clear button."
|
|
375
|
+
},
|
|
376
|
+
"attribute": "clearable",
|
|
377
|
+
"reflect": false,
|
|
378
|
+
"defaultValue": "false"
|
|
379
|
+
},
|
|
380
|
+
"disabled": {
|
|
381
|
+
"type": "boolean",
|
|
382
|
+
"mutable": false,
|
|
383
|
+
"complexType": {
|
|
384
|
+
"original": "boolean",
|
|
385
|
+
"resolved": "boolean",
|
|
386
|
+
"references": {}
|
|
387
|
+
},
|
|
388
|
+
"required": false,
|
|
389
|
+
"optional": false,
|
|
390
|
+
"docs": {
|
|
391
|
+
"tags": [],
|
|
392
|
+
"text": "Whether the input is disabled."
|
|
393
|
+
},
|
|
394
|
+
"attribute": "disabled",
|
|
395
|
+
"reflect": false,
|
|
396
|
+
"defaultValue": "false"
|
|
397
|
+
},
|
|
398
|
+
"hint": {
|
|
399
|
+
"type": "string",
|
|
400
|
+
"mutable": false,
|
|
401
|
+
"complexType": {
|
|
402
|
+
"original": "string | string[]",
|
|
403
|
+
"resolved": "string | string[] | undefined",
|
|
404
|
+
"references": {}
|
|
405
|
+
},
|
|
406
|
+
"required": false,
|
|
407
|
+
"optional": true,
|
|
408
|
+
"docs": {
|
|
409
|
+
"tags": [],
|
|
410
|
+
"text": "Optional hint text(s) to be displayed with the input."
|
|
411
|
+
},
|
|
412
|
+
"attribute": "hint",
|
|
413
|
+
"reflect": false
|
|
414
|
+
},
|
|
415
|
+
"icon": {
|
|
416
|
+
"type": "string",
|
|
417
|
+
"mutable": false,
|
|
418
|
+
"complexType": {
|
|
419
|
+
"original": "string",
|
|
420
|
+
"resolved": "string | undefined",
|
|
421
|
+
"references": {}
|
|
422
|
+
},
|
|
423
|
+
"required": false,
|
|
424
|
+
"optional": true,
|
|
425
|
+
"docs": {
|
|
426
|
+
"tags": [],
|
|
427
|
+
"text": "The name of an icon to be displayed in the input."
|
|
428
|
+
},
|
|
429
|
+
"attribute": "icon",
|
|
430
|
+
"reflect": false
|
|
431
|
+
},
|
|
432
|
+
"iconRight": {
|
|
433
|
+
"type": "boolean",
|
|
434
|
+
"mutable": false,
|
|
435
|
+
"complexType": {
|
|
436
|
+
"original": "boolean",
|
|
437
|
+
"resolved": "boolean",
|
|
438
|
+
"references": {}
|
|
439
|
+
},
|
|
440
|
+
"required": false,
|
|
441
|
+
"optional": false,
|
|
442
|
+
"docs": {
|
|
443
|
+
"tags": [],
|
|
444
|
+
"text": "Display the icon on the right."
|
|
445
|
+
},
|
|
446
|
+
"attribute": "icon-right",
|
|
447
|
+
"reflect": false,
|
|
448
|
+
"defaultValue": "false"
|
|
449
|
+
},
|
|
450
|
+
"identifier": {
|
|
451
|
+
"type": "string",
|
|
452
|
+
"mutable": false,
|
|
453
|
+
"complexType": {
|
|
454
|
+
"original": "string",
|
|
455
|
+
"resolved": "string | undefined",
|
|
456
|
+
"references": {}
|
|
457
|
+
},
|
|
458
|
+
"required": false,
|
|
459
|
+
"optional": true,
|
|
460
|
+
"docs": {
|
|
461
|
+
"tags": [],
|
|
462
|
+
"text": "A unique identifier for the input."
|
|
463
|
+
},
|
|
464
|
+
"attribute": "identifier",
|
|
465
|
+
"reflect": false
|
|
466
|
+
},
|
|
467
|
+
"label": {
|
|
468
|
+
"type": "string",
|
|
469
|
+
"mutable": false,
|
|
470
|
+
"complexType": {
|
|
471
|
+
"original": "string",
|
|
472
|
+
"resolved": "string",
|
|
473
|
+
"references": {}
|
|
474
|
+
},
|
|
475
|
+
"required": false,
|
|
476
|
+
"optional": false,
|
|
477
|
+
"docs": {
|
|
478
|
+
"tags": [],
|
|
479
|
+
"text": "The label for the input."
|
|
480
|
+
},
|
|
481
|
+
"attribute": "label",
|
|
482
|
+
"reflect": false,
|
|
483
|
+
"defaultValue": "''"
|
|
484
|
+
},
|
|
485
|
+
"labelHidden": {
|
|
486
|
+
"type": "boolean",
|
|
487
|
+
"mutable": false,
|
|
488
|
+
"complexType": {
|
|
489
|
+
"original": "boolean",
|
|
490
|
+
"resolved": "boolean",
|
|
491
|
+
"references": {}
|
|
492
|
+
},
|
|
493
|
+
"required": false,
|
|
494
|
+
"optional": false,
|
|
495
|
+
"docs": {
|
|
496
|
+
"tags": [],
|
|
497
|
+
"text": "Visually hide the label, but still show it to assistive technologies like screen readers."
|
|
498
|
+
},
|
|
499
|
+
"attribute": "label-hidden",
|
|
500
|
+
"reflect": false,
|
|
501
|
+
"defaultValue": "false"
|
|
502
|
+
},
|
|
503
|
+
"max": {
|
|
504
|
+
"type": "string",
|
|
505
|
+
"mutable": false,
|
|
506
|
+
"complexType": {
|
|
507
|
+
"original": "string",
|
|
508
|
+
"resolved": "string | undefined",
|
|
509
|
+
"references": {}
|
|
510
|
+
},
|
|
511
|
+
"required": false,
|
|
512
|
+
"optional": true,
|
|
513
|
+
"docs": {
|
|
514
|
+
"tags": [],
|
|
515
|
+
"text": "A maximum value for the date, given in local ISO 8601 date format YYYY-MM-DD."
|
|
516
|
+
},
|
|
517
|
+
"attribute": "max",
|
|
518
|
+
"reflect": false
|
|
519
|
+
},
|
|
520
|
+
"min": {
|
|
521
|
+
"type": "string",
|
|
522
|
+
"mutable": false,
|
|
523
|
+
"complexType": {
|
|
524
|
+
"original": "string",
|
|
525
|
+
"resolved": "string | undefined",
|
|
526
|
+
"references": {}
|
|
527
|
+
},
|
|
528
|
+
"required": false,
|
|
529
|
+
"optional": true,
|
|
530
|
+
"docs": {
|
|
531
|
+
"tags": [],
|
|
532
|
+
"text": "A minimum value for the date, given in local ISO 8601 date format YYYY-MM-DD."
|
|
533
|
+
},
|
|
534
|
+
"attribute": "min",
|
|
535
|
+
"reflect": false
|
|
536
|
+
},
|
|
537
|
+
"name": {
|
|
538
|
+
"type": "string",
|
|
539
|
+
"mutable": false,
|
|
540
|
+
"complexType": {
|
|
541
|
+
"original": "string",
|
|
542
|
+
"resolved": "string | undefined",
|
|
543
|
+
"references": {}
|
|
544
|
+
},
|
|
545
|
+
"required": false,
|
|
546
|
+
"optional": true,
|
|
547
|
+
"docs": {
|
|
548
|
+
"tags": [],
|
|
549
|
+
"text": "The name of the form control. Submitted with the form as part of a name/value pair."
|
|
550
|
+
},
|
|
551
|
+
"attribute": "name",
|
|
552
|
+
"reflect": false
|
|
553
|
+
},
|
|
554
|
+
"placeholder": {
|
|
555
|
+
"type": "string",
|
|
556
|
+
"mutable": false,
|
|
557
|
+
"complexType": {
|
|
558
|
+
"original": "string",
|
|
559
|
+
"resolved": "string | undefined",
|
|
560
|
+
"references": {}
|
|
561
|
+
},
|
|
562
|
+
"required": false,
|
|
563
|
+
"optional": true,
|
|
564
|
+
"docs": {
|
|
565
|
+
"tags": [],
|
|
566
|
+
"text": "The placeholder text to display within the input."
|
|
567
|
+
},
|
|
568
|
+
"attribute": "placeholder",
|
|
569
|
+
"reflect": false
|
|
570
|
+
},
|
|
571
|
+
"textPrefix": {
|
|
572
|
+
"type": "string",
|
|
573
|
+
"mutable": false,
|
|
574
|
+
"complexType": {
|
|
575
|
+
"original": "string",
|
|
576
|
+
"resolved": "string | undefined",
|
|
577
|
+
"references": {}
|
|
578
|
+
},
|
|
579
|
+
"required": false,
|
|
580
|
+
"optional": true,
|
|
581
|
+
"docs": {
|
|
582
|
+
"tags": [],
|
|
583
|
+
"text": "A textual prefix to be displayed in the input."
|
|
584
|
+
},
|
|
585
|
+
"attribute": "text-prefix",
|
|
586
|
+
"reflect": false
|
|
587
|
+
},
|
|
588
|
+
"textSuffix": {
|
|
589
|
+
"type": "string",
|
|
590
|
+
"mutable": false,
|
|
591
|
+
"complexType": {
|
|
592
|
+
"original": "string",
|
|
593
|
+
"resolved": "string | undefined",
|
|
594
|
+
"references": {}
|
|
595
|
+
},
|
|
596
|
+
"required": false,
|
|
597
|
+
"optional": true,
|
|
598
|
+
"docs": {
|
|
599
|
+
"tags": [],
|
|
600
|
+
"text": "A textual suffix to be displayed in the input."
|
|
601
|
+
},
|
|
602
|
+
"attribute": "text-suffix",
|
|
603
|
+
"reflect": false
|
|
604
|
+
},
|
|
605
|
+
"readonly": {
|
|
606
|
+
"type": "boolean",
|
|
607
|
+
"mutable": false,
|
|
608
|
+
"complexType": {
|
|
609
|
+
"original": "boolean",
|
|
610
|
+
"resolved": "boolean",
|
|
611
|
+
"references": {}
|
|
612
|
+
},
|
|
613
|
+
"required": false,
|
|
614
|
+
"optional": false,
|
|
615
|
+
"docs": {
|
|
616
|
+
"tags": [],
|
|
617
|
+
"text": "The value is not editable."
|
|
618
|
+
},
|
|
619
|
+
"attribute": "readonly",
|
|
620
|
+
"reflect": false,
|
|
621
|
+
"defaultValue": "false"
|
|
622
|
+
},
|
|
623
|
+
"required": {
|
|
624
|
+
"type": "boolean",
|
|
625
|
+
"mutable": false,
|
|
626
|
+
"complexType": {
|
|
627
|
+
"original": "boolean",
|
|
628
|
+
"resolved": "boolean",
|
|
629
|
+
"references": {}
|
|
630
|
+
},
|
|
631
|
+
"required": false,
|
|
632
|
+
"optional": false,
|
|
633
|
+
"docs": {
|
|
634
|
+
"tags": [],
|
|
635
|
+
"text": "A value is required or must be check for the form to be submittable."
|
|
636
|
+
},
|
|
637
|
+
"attribute": "required",
|
|
638
|
+
"reflect": false,
|
|
639
|
+
"defaultValue": "false"
|
|
640
|
+
},
|
|
641
|
+
"value": {
|
|
642
|
+
"type": "string",
|
|
643
|
+
"mutable": true,
|
|
644
|
+
"complexType": {
|
|
645
|
+
"original": "string",
|
|
646
|
+
"resolved": "string | undefined",
|
|
647
|
+
"references": {}
|
|
648
|
+
},
|
|
649
|
+
"required": false,
|
|
650
|
+
"optional": true,
|
|
651
|
+
"docs": {
|
|
652
|
+
"tags": [],
|
|
653
|
+
"text": "The value of the control, given in local ISO 8601 date format YYYY-MM-DD."
|
|
654
|
+
},
|
|
655
|
+
"attribute": "value",
|
|
656
|
+
"reflect": false
|
|
657
|
+
},
|
|
658
|
+
"errors": {
|
|
659
|
+
"type": "boolean",
|
|
660
|
+
"mutable": false,
|
|
661
|
+
"complexType": {
|
|
662
|
+
"original": "boolean | string[] | ErrorMap",
|
|
663
|
+
"resolved": "boolean | string[] | undefined | { [key: string]: any; }",
|
|
664
|
+
"references": {
|
|
665
|
+
"ErrorMap": {
|
|
666
|
+
"location": "import",
|
|
667
|
+
"path": "../cat-form-hint/cat-form-hint",
|
|
668
|
+
"id": "src/components/cat-form-hint/cat-form-hint.tsx::ErrorMap"
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
"required": false,
|
|
673
|
+
"optional": true,
|
|
674
|
+
"docs": {
|
|
675
|
+
"tags": [],
|
|
676
|
+
"text": "The validation errors for this input. Will render a hint under the input\nwith the translated error message(s) `error.${key}`. If an object is\npassed, the keys will be used as error keys and the values translation\nparameters.\nIf the value is `true`, the input will be marked as invalid without any\nhints under the input."
|
|
677
|
+
},
|
|
678
|
+
"attribute": "errors",
|
|
679
|
+
"reflect": false
|
|
680
|
+
},
|
|
681
|
+
"errorUpdate": {
|
|
682
|
+
"type": "any",
|
|
683
|
+
"mutable": false,
|
|
684
|
+
"complexType": {
|
|
685
|
+
"original": "boolean | number",
|
|
686
|
+
"resolved": "boolean | number",
|
|
687
|
+
"references": {}
|
|
688
|
+
},
|
|
689
|
+
"required": false,
|
|
690
|
+
"optional": false,
|
|
691
|
+
"docs": {
|
|
692
|
+
"tags": [],
|
|
693
|
+
"text": "Fine-grained control over when the errors are shown. Can be `false` to\nnever show errors, `true` to show errors on blur, or a number to show\nerrors on change with the given delay in milliseconds."
|
|
694
|
+
},
|
|
695
|
+
"attribute": "error-update",
|
|
696
|
+
"reflect": false,
|
|
697
|
+
"defaultValue": "0"
|
|
698
|
+
},
|
|
699
|
+
"nativeAttributes": {
|
|
700
|
+
"type": "unknown",
|
|
701
|
+
"mutable": false,
|
|
702
|
+
"complexType": {
|
|
703
|
+
"original": "{ [key: string]: string }",
|
|
704
|
+
"resolved": "undefined | { [key: string]: string; }",
|
|
705
|
+
"references": {}
|
|
706
|
+
},
|
|
707
|
+
"required": false,
|
|
708
|
+
"optional": true,
|
|
709
|
+
"docs": {
|
|
710
|
+
"tags": [],
|
|
711
|
+
"text": "Attributes that will be added to the native HTML input element."
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
"placement": {
|
|
715
|
+
"type": "string",
|
|
716
|
+
"mutable": false,
|
|
717
|
+
"complexType": {
|
|
718
|
+
"original": "Placement",
|
|
719
|
+
"resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
720
|
+
"references": {
|
|
721
|
+
"Placement": {
|
|
722
|
+
"location": "import",
|
|
723
|
+
"path": "@floating-ui/dom",
|
|
724
|
+
"id": "../node_modules/.pnpm/@floating-ui+dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
"required": false,
|
|
729
|
+
"optional": false,
|
|
730
|
+
"docs": {
|
|
731
|
+
"tags": [],
|
|
732
|
+
"text": "The placement of the dropdown."
|
|
733
|
+
},
|
|
734
|
+
"attribute": "placement",
|
|
735
|
+
"reflect": false,
|
|
736
|
+
"defaultValue": "'bottom-end'"
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
static get states() {
|
|
741
|
+
return {
|
|
742
|
+
"hasSlottedLabel": {},
|
|
743
|
+
"hasSlottedHint": {},
|
|
744
|
+
"viewDate": {},
|
|
745
|
+
"selectionDate": {}
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
static get events() {
|
|
749
|
+
return [{
|
|
750
|
+
"method": "catChange",
|
|
751
|
+
"name": "catChange",
|
|
752
|
+
"bubbles": true,
|
|
753
|
+
"cancelable": true,
|
|
754
|
+
"composed": true,
|
|
755
|
+
"docs": {
|
|
756
|
+
"tags": [],
|
|
757
|
+
"text": "Emitted when the value is changed."
|
|
758
|
+
},
|
|
759
|
+
"complexType": {
|
|
760
|
+
"original": "string",
|
|
761
|
+
"resolved": "string",
|
|
762
|
+
"references": {}
|
|
763
|
+
}
|
|
764
|
+
}, {
|
|
765
|
+
"method": "catFocus",
|
|
766
|
+
"name": "catFocus",
|
|
767
|
+
"bubbles": true,
|
|
768
|
+
"cancelable": true,
|
|
769
|
+
"composed": true,
|
|
770
|
+
"docs": {
|
|
771
|
+
"tags": [],
|
|
772
|
+
"text": "Emitted when the input received focus."
|
|
773
|
+
},
|
|
774
|
+
"complexType": {
|
|
775
|
+
"original": "FocusEvent",
|
|
776
|
+
"resolved": "FocusEvent",
|
|
777
|
+
"references": {
|
|
778
|
+
"FocusEvent": {
|
|
779
|
+
"location": "global",
|
|
780
|
+
"id": "global::FocusEvent"
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}, {
|
|
785
|
+
"method": "catBlur",
|
|
786
|
+
"name": "catBlur",
|
|
787
|
+
"bubbles": true,
|
|
788
|
+
"cancelable": true,
|
|
789
|
+
"composed": true,
|
|
790
|
+
"docs": {
|
|
791
|
+
"tags": [],
|
|
792
|
+
"text": "Emitted when the input loses focus."
|
|
793
|
+
},
|
|
794
|
+
"complexType": {
|
|
795
|
+
"original": "FocusEvent",
|
|
796
|
+
"resolved": "FocusEvent",
|
|
797
|
+
"references": {
|
|
798
|
+
"FocusEvent": {
|
|
799
|
+
"location": "global",
|
|
800
|
+
"id": "global::FocusEvent"
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}];
|
|
805
|
+
}
|
|
806
|
+
static get methods() {
|
|
807
|
+
return {
|
|
808
|
+
"select": {
|
|
809
|
+
"complexType": {
|
|
810
|
+
"signature": "(date: Date) => Promise<void>",
|
|
811
|
+
"parameters": [{
|
|
812
|
+
"name": "date",
|
|
813
|
+
"type": "Date",
|
|
814
|
+
"docs": "The date to select."
|
|
815
|
+
}],
|
|
816
|
+
"references": {
|
|
817
|
+
"Promise": {
|
|
818
|
+
"location": "global",
|
|
819
|
+
"id": "global::Promise"
|
|
820
|
+
},
|
|
821
|
+
"Date": {
|
|
822
|
+
"location": "global",
|
|
823
|
+
"id": "global::Date"
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
"return": "Promise<void>"
|
|
827
|
+
},
|
|
828
|
+
"docs": {
|
|
829
|
+
"text": "Select a date in the picker.",
|
|
830
|
+
"tags": [{
|
|
831
|
+
"name": "param",
|
|
832
|
+
"text": "date The date to select."
|
|
833
|
+
}]
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
"doFocus": {
|
|
837
|
+
"complexType": {
|
|
838
|
+
"signature": "(options?: FocusOptions) => Promise<void>",
|
|
839
|
+
"parameters": [{
|
|
840
|
+
"name": "options",
|
|
841
|
+
"type": "FocusOptions | undefined",
|
|
842
|
+
"docs": "An optional object providing options to control aspects of\nthe focusing process."
|
|
843
|
+
}],
|
|
844
|
+
"references": {
|
|
845
|
+
"Promise": {
|
|
846
|
+
"location": "global",
|
|
847
|
+
"id": "global::Promise"
|
|
848
|
+
},
|
|
849
|
+
"FocusOptions": {
|
|
850
|
+
"location": "global",
|
|
851
|
+
"id": "global::FocusOptions"
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
"return": "Promise<void>"
|
|
855
|
+
},
|
|
856
|
+
"docs": {
|
|
857
|
+
"text": "Programmatically move focus to the input. Use this method instead of\n`input.focus()`.",
|
|
858
|
+
"tags": [{
|
|
859
|
+
"name": "param",
|
|
860
|
+
"text": "options An optional object providing options to control aspects of\nthe focusing process."
|
|
861
|
+
}]
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
"doBlur": {
|
|
865
|
+
"complexType": {
|
|
866
|
+
"signature": "() => Promise<void>",
|
|
867
|
+
"parameters": [],
|
|
868
|
+
"references": {
|
|
869
|
+
"Promise": {
|
|
870
|
+
"location": "global",
|
|
871
|
+
"id": "global::Promise"
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
"return": "Promise<void>"
|
|
875
|
+
},
|
|
876
|
+
"docs": {
|
|
877
|
+
"text": "Programmatically remove focus from the input. Use this method instead of\n`input.blur()`.",
|
|
878
|
+
"tags": []
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
"clear": {
|
|
882
|
+
"complexType": {
|
|
883
|
+
"signature": "() => Promise<void>",
|
|
884
|
+
"parameters": [],
|
|
885
|
+
"references": {
|
|
886
|
+
"Promise": {
|
|
887
|
+
"location": "global",
|
|
888
|
+
"id": "global::Promise"
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
"return": "Promise<void>"
|
|
892
|
+
},
|
|
893
|
+
"docs": {
|
|
894
|
+
"text": "Clear the input.",
|
|
895
|
+
"tags": []
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
static get elementRef() { return "hostElement"; }
|
|
901
|
+
static get listeners() {
|
|
902
|
+
return [{
|
|
903
|
+
"name": "catOpen",
|
|
904
|
+
"method": "onOpen",
|
|
905
|
+
"target": undefined,
|
|
906
|
+
"capture": false,
|
|
907
|
+
"passive": false
|
|
908
|
+
}, {
|
|
909
|
+
"name": "catClose",
|
|
910
|
+
"method": "onClose",
|
|
911
|
+
"target": undefined,
|
|
912
|
+
"capture": false,
|
|
913
|
+
"passive": false
|
|
914
|
+
}, {
|
|
915
|
+
"name": "keydown",
|
|
916
|
+
"method": "onKeyDown",
|
|
917
|
+
"target": undefined,
|
|
918
|
+
"capture": false,
|
|
919
|
+
"passive": false
|
|
920
|
+
}];
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
//# sourceMappingURL=cat-date.js.map
|