@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,801 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { catI18nRegistry as i18n } from "../cat-i18n/cat-i18n-registry";
|
|
3
|
+
import { getLocale } from "./cat-time-locale";
|
|
4
|
+
import { clampTime, isAfter, isBefore } from "./cat-time-math";
|
|
5
|
+
export class CatTime {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.language = i18n.getLocale();
|
|
8
|
+
this.locale = getLocale(this.language);
|
|
9
|
+
this.hasSlottedLabel = false;
|
|
10
|
+
this.hasSlottedHint = false;
|
|
11
|
+
this.selectionTime = null;
|
|
12
|
+
this.isAm = true;
|
|
13
|
+
this.requiredMarker = 'optional';
|
|
14
|
+
this.horizontal = false;
|
|
15
|
+
this.autoComplete = undefined;
|
|
16
|
+
this.clearable = false;
|
|
17
|
+
this.disabled = false;
|
|
18
|
+
this.hint = undefined;
|
|
19
|
+
this.icon = undefined;
|
|
20
|
+
this.iconRight = false;
|
|
21
|
+
this.identifier = undefined;
|
|
22
|
+
this.label = '';
|
|
23
|
+
this.labelHidden = false;
|
|
24
|
+
this.max = undefined;
|
|
25
|
+
this.min = undefined;
|
|
26
|
+
this.name = undefined;
|
|
27
|
+
this.placeholder = undefined;
|
|
28
|
+
this.textPrefix = undefined;
|
|
29
|
+
this.textSuffix = undefined;
|
|
30
|
+
this.readonly = false;
|
|
31
|
+
this.required = false;
|
|
32
|
+
this.value = undefined;
|
|
33
|
+
this.errors = undefined;
|
|
34
|
+
this.errorUpdate = 0;
|
|
35
|
+
this.nativeAttributes = undefined;
|
|
36
|
+
this.placement = 'bottom-end';
|
|
37
|
+
this.step = 30;
|
|
38
|
+
}
|
|
39
|
+
componentWillLoad() {
|
|
40
|
+
this.syncValue(this.value ?? '');
|
|
41
|
+
}
|
|
42
|
+
componentWillRender() {
|
|
43
|
+
this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
|
|
44
|
+
this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
|
|
45
|
+
}
|
|
46
|
+
componentDidLoad() {
|
|
47
|
+
this.input?.mask({
|
|
48
|
+
time: true,
|
|
49
|
+
timeFormat: this.locale.timeFormat,
|
|
50
|
+
timePattern: ['h', 'm']
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
onOpen() {
|
|
54
|
+
const query = (selector) => this.hostElement.shadowRoot?.querySelector(selector);
|
|
55
|
+
const time = clampTime(this.min ?? null, this.selectionTime ?? new Date(2000, 5, 1, 8), this.max ?? null);
|
|
56
|
+
const elem1 = query(`[data-time="${this.formatIso(time)}"]`);
|
|
57
|
+
time.setMinutes(Math.floor(time.getMinutes() / this.step) * this.step);
|
|
58
|
+
const elem2 = query(`[data-time="${this.formatIso(time)}"]`);
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
(elem2 ?? elem1)?.doFocus();
|
|
61
|
+
(elem2 ?? elem1)?.scrollIntoView(this.selectionTime ? { block: 'center' } : undefined);
|
|
62
|
+
}); // not entirely sure why this is necessary
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Select a time in the picker.
|
|
66
|
+
*
|
|
67
|
+
* @param date The time to select.
|
|
68
|
+
*/
|
|
69
|
+
async select(date) {
|
|
70
|
+
const oldValue = this.value;
|
|
71
|
+
if (!date) {
|
|
72
|
+
this.selectionTime = null;
|
|
73
|
+
this.value = undefined;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
const time = clampTime(this.min ?? null, date, this.max ?? null);
|
|
77
|
+
this.isAm = this.format(time).toLowerCase().includes('am');
|
|
78
|
+
this.selectionTime = time;
|
|
79
|
+
this.value = this.formatIso(time);
|
|
80
|
+
}
|
|
81
|
+
// we need to set the input explicitly to sync the input even without a
|
|
82
|
+
// rerender (if the value is not changed)
|
|
83
|
+
if (this.input) {
|
|
84
|
+
this.input.value = this.format(this.selectionTime, false);
|
|
85
|
+
}
|
|
86
|
+
if (oldValue !== this.value) {
|
|
87
|
+
this.catChange.emit(this.value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Programmatically move focus to the input. Use this method instead of
|
|
92
|
+
* `input.focus()`.
|
|
93
|
+
*
|
|
94
|
+
* @param options An optional object providing options to control aspects of
|
|
95
|
+
* the focusing process.
|
|
96
|
+
*/
|
|
97
|
+
async doFocus(options) {
|
|
98
|
+
this.input?.doFocus(options);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Programmatically remove focus from the input. Use this method instead of
|
|
102
|
+
* `input.blur()`.
|
|
103
|
+
*/
|
|
104
|
+
async doBlur() {
|
|
105
|
+
this.input?.doBlur();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Clear the input.
|
|
109
|
+
*/
|
|
110
|
+
async clear() {
|
|
111
|
+
this.input?.clear();
|
|
112
|
+
}
|
|
113
|
+
render() {
|
|
114
|
+
return (h(Host, { key: '417fe04aff5d229b3f99595cd464ed1b35a64655' }, h("cat-input", { key: 'a240ad76627fcc5013d8e51e0728e0296dbb0e42', 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: 'cf2026f70a32a5df5331b82d1d64cb4695a0b42e', slot: "label" }, this.hasSlottedLabel && h("slot", { name: "label" }), !this.hasSlottedLabel && this.label, h("span", { key: '46b4a5363823a48d5569f77bcbadbaf0ef93e7b1', class: "label-aria" }, " (HH:mm)")), h("div", { key: 'cfad61c399b5b4a487b211976e61c3e33fb37a98', 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: '2a158234c4cc55920105b326cdf31fbe02fedfb7', slot: "addon", placement: this.placement }, h("cat-button", { key: '1aa21b054ef608a4f1e9cc32312a762fa64d8b2d', 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: 'dd604da9f2244c970ca62ca68385cc86d0b98bef', slot: "content", class: "cat-nav" }, h("ul", { key: '3c5e331defd7f192c27aab7085f5337a2eaf0fe7' }, this.timeArray().map(time => {
|
|
115
|
+
const isoTime = this.formatIso(time);
|
|
116
|
+
const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);
|
|
117
|
+
return (h("li", null, h("cat-button", { class: {
|
|
118
|
+
'cat-nav-item': true,
|
|
119
|
+
'time-disabled': disabled
|
|
120
|
+
}, disabled: disabled, active: isoTime === this.value, color: isoTime === this.value ? 'primary' : 'secondary', variant: isoTime === this.value ? 'filled' : 'outlined', onCatClick: () => this.select(time), "data-time": isoTime }, this.format(time))));
|
|
121
|
+
}))))), this.hasSlottedHint && (h("span", { slot: "hint" }, h("slot", { name: "hint" }))))));
|
|
122
|
+
}
|
|
123
|
+
timeArray() {
|
|
124
|
+
const result = [];
|
|
125
|
+
const start = new Date(2000, 5, 1, 0, 0, 0);
|
|
126
|
+
let time = new Date(start.getTime());
|
|
127
|
+
while (time.getDate() === start.getDate()) {
|
|
128
|
+
result.push(time);
|
|
129
|
+
time = new Date(time.getTime() + this.step * 60000);
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
syncValue(value) {
|
|
134
|
+
const [, hh, mm] = value.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
|
|
135
|
+
if (hh === undefined || mm === undefined) {
|
|
136
|
+
this.select(null);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this.select(this.locale.timeFormat === '24'
|
|
140
|
+
? new Date(2000, 5, 1, hh, mm, 0)
|
|
141
|
+
: new Date(2000, 5, 1, (hh % 12) + (this.isAm ? 0 : 12), mm, 0));
|
|
142
|
+
}
|
|
143
|
+
toggleAm() {
|
|
144
|
+
if (this.selectionTime) {
|
|
145
|
+
this.select(new Date(this.selectionTime.getTime() + (this.isAm ? 12 : -12) * 3600000));
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
this.isAm = !this.isAm;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
onInputBlur(e) {
|
|
152
|
+
this.syncValue(this.input?.value ?? '');
|
|
153
|
+
this.catBlur.emit(e);
|
|
154
|
+
}
|
|
155
|
+
format(date, includeAmPm = true) {
|
|
156
|
+
const str = date
|
|
157
|
+
? new Intl.DateTimeFormat(this.language, {
|
|
158
|
+
hour: '2-digit',
|
|
159
|
+
minute: '2-digit'
|
|
160
|
+
}).format(date)
|
|
161
|
+
: '';
|
|
162
|
+
return includeAmPm ? str : str.replace(/\s?(am|pm)/i, '');
|
|
163
|
+
}
|
|
164
|
+
formatIso(date) {
|
|
165
|
+
return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
|
|
166
|
+
}
|
|
167
|
+
static get is() { return "cat-time"; }
|
|
168
|
+
static get encapsulation() { return "shadow"; }
|
|
169
|
+
static get originalStyleUrls() {
|
|
170
|
+
return {
|
|
171
|
+
"$": ["cat-time.scss"]
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
static get styleUrls() {
|
|
175
|
+
return {
|
|
176
|
+
"$": ["cat-time.css"]
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
static get properties() {
|
|
180
|
+
return {
|
|
181
|
+
"requiredMarker": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"mutable": false,
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!'",
|
|
186
|
+
"resolved": "\"none!\" | \"none\" | \"optional!\" | \"optional\" | \"required!\" | \"required\" | undefined",
|
|
187
|
+
"references": {}
|
|
188
|
+
},
|
|
189
|
+
"required": false,
|
|
190
|
+
"optional": true,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": "Whether the label need a marker to shown if the input is required or optional."
|
|
194
|
+
},
|
|
195
|
+
"attribute": "required-marker",
|
|
196
|
+
"reflect": false,
|
|
197
|
+
"defaultValue": "'optional'"
|
|
198
|
+
},
|
|
199
|
+
"horizontal": {
|
|
200
|
+
"type": "boolean",
|
|
201
|
+
"mutable": false,
|
|
202
|
+
"complexType": {
|
|
203
|
+
"original": "boolean",
|
|
204
|
+
"resolved": "boolean",
|
|
205
|
+
"references": {}
|
|
206
|
+
},
|
|
207
|
+
"required": false,
|
|
208
|
+
"optional": false,
|
|
209
|
+
"docs": {
|
|
210
|
+
"tags": [],
|
|
211
|
+
"text": "Whether the label is on top or left."
|
|
212
|
+
},
|
|
213
|
+
"attribute": "horizontal",
|
|
214
|
+
"reflect": false,
|
|
215
|
+
"defaultValue": "false"
|
|
216
|
+
},
|
|
217
|
+
"autoComplete": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"mutable": false,
|
|
220
|
+
"complexType": {
|
|
221
|
+
"original": "string",
|
|
222
|
+
"resolved": "string | undefined",
|
|
223
|
+
"references": {}
|
|
224
|
+
},
|
|
225
|
+
"required": false,
|
|
226
|
+
"optional": true,
|
|
227
|
+
"docs": {
|
|
228
|
+
"tags": [],
|
|
229
|
+
"text": "Hint for form autofill feature."
|
|
230
|
+
},
|
|
231
|
+
"attribute": "auto-complete",
|
|
232
|
+
"reflect": false
|
|
233
|
+
},
|
|
234
|
+
"clearable": {
|
|
235
|
+
"type": "boolean",
|
|
236
|
+
"mutable": false,
|
|
237
|
+
"complexType": {
|
|
238
|
+
"original": "boolean",
|
|
239
|
+
"resolved": "boolean",
|
|
240
|
+
"references": {}
|
|
241
|
+
},
|
|
242
|
+
"required": false,
|
|
243
|
+
"optional": false,
|
|
244
|
+
"docs": {
|
|
245
|
+
"tags": [],
|
|
246
|
+
"text": "Whether the input should show a clear button."
|
|
247
|
+
},
|
|
248
|
+
"attribute": "clearable",
|
|
249
|
+
"reflect": false,
|
|
250
|
+
"defaultValue": "false"
|
|
251
|
+
},
|
|
252
|
+
"disabled": {
|
|
253
|
+
"type": "boolean",
|
|
254
|
+
"mutable": false,
|
|
255
|
+
"complexType": {
|
|
256
|
+
"original": "boolean",
|
|
257
|
+
"resolved": "boolean",
|
|
258
|
+
"references": {}
|
|
259
|
+
},
|
|
260
|
+
"required": false,
|
|
261
|
+
"optional": false,
|
|
262
|
+
"docs": {
|
|
263
|
+
"tags": [],
|
|
264
|
+
"text": "Whether the input is disabled."
|
|
265
|
+
},
|
|
266
|
+
"attribute": "disabled",
|
|
267
|
+
"reflect": false,
|
|
268
|
+
"defaultValue": "false"
|
|
269
|
+
},
|
|
270
|
+
"hint": {
|
|
271
|
+
"type": "string",
|
|
272
|
+
"mutable": false,
|
|
273
|
+
"complexType": {
|
|
274
|
+
"original": "string | string[]",
|
|
275
|
+
"resolved": "string | string[] | undefined",
|
|
276
|
+
"references": {}
|
|
277
|
+
},
|
|
278
|
+
"required": false,
|
|
279
|
+
"optional": true,
|
|
280
|
+
"docs": {
|
|
281
|
+
"tags": [],
|
|
282
|
+
"text": "Optional hint text(s) to be displayed with the input."
|
|
283
|
+
},
|
|
284
|
+
"attribute": "hint",
|
|
285
|
+
"reflect": false
|
|
286
|
+
},
|
|
287
|
+
"icon": {
|
|
288
|
+
"type": "string",
|
|
289
|
+
"mutable": false,
|
|
290
|
+
"complexType": {
|
|
291
|
+
"original": "string",
|
|
292
|
+
"resolved": "string | undefined",
|
|
293
|
+
"references": {}
|
|
294
|
+
},
|
|
295
|
+
"required": false,
|
|
296
|
+
"optional": true,
|
|
297
|
+
"docs": {
|
|
298
|
+
"tags": [],
|
|
299
|
+
"text": "The name of an icon to be displayed in the input."
|
|
300
|
+
},
|
|
301
|
+
"attribute": "icon",
|
|
302
|
+
"reflect": false
|
|
303
|
+
},
|
|
304
|
+
"iconRight": {
|
|
305
|
+
"type": "boolean",
|
|
306
|
+
"mutable": false,
|
|
307
|
+
"complexType": {
|
|
308
|
+
"original": "boolean",
|
|
309
|
+
"resolved": "boolean",
|
|
310
|
+
"references": {}
|
|
311
|
+
},
|
|
312
|
+
"required": false,
|
|
313
|
+
"optional": false,
|
|
314
|
+
"docs": {
|
|
315
|
+
"tags": [],
|
|
316
|
+
"text": "Display the icon on the right."
|
|
317
|
+
},
|
|
318
|
+
"attribute": "icon-right",
|
|
319
|
+
"reflect": false,
|
|
320
|
+
"defaultValue": "false"
|
|
321
|
+
},
|
|
322
|
+
"identifier": {
|
|
323
|
+
"type": "string",
|
|
324
|
+
"mutable": false,
|
|
325
|
+
"complexType": {
|
|
326
|
+
"original": "string",
|
|
327
|
+
"resolved": "string | undefined",
|
|
328
|
+
"references": {}
|
|
329
|
+
},
|
|
330
|
+
"required": false,
|
|
331
|
+
"optional": true,
|
|
332
|
+
"docs": {
|
|
333
|
+
"tags": [],
|
|
334
|
+
"text": "A unique identifier for the input."
|
|
335
|
+
},
|
|
336
|
+
"attribute": "identifier",
|
|
337
|
+
"reflect": false
|
|
338
|
+
},
|
|
339
|
+
"label": {
|
|
340
|
+
"type": "string",
|
|
341
|
+
"mutable": false,
|
|
342
|
+
"complexType": {
|
|
343
|
+
"original": "string",
|
|
344
|
+
"resolved": "string",
|
|
345
|
+
"references": {}
|
|
346
|
+
},
|
|
347
|
+
"required": false,
|
|
348
|
+
"optional": false,
|
|
349
|
+
"docs": {
|
|
350
|
+
"tags": [],
|
|
351
|
+
"text": "The label for the input."
|
|
352
|
+
},
|
|
353
|
+
"attribute": "label",
|
|
354
|
+
"reflect": false,
|
|
355
|
+
"defaultValue": "''"
|
|
356
|
+
},
|
|
357
|
+
"labelHidden": {
|
|
358
|
+
"type": "boolean",
|
|
359
|
+
"mutable": false,
|
|
360
|
+
"complexType": {
|
|
361
|
+
"original": "boolean",
|
|
362
|
+
"resolved": "boolean",
|
|
363
|
+
"references": {}
|
|
364
|
+
},
|
|
365
|
+
"required": false,
|
|
366
|
+
"optional": false,
|
|
367
|
+
"docs": {
|
|
368
|
+
"tags": [],
|
|
369
|
+
"text": "Visually hide the label, but still show it to assistive technologies like screen readers."
|
|
370
|
+
},
|
|
371
|
+
"attribute": "label-hidden",
|
|
372
|
+
"reflect": false,
|
|
373
|
+
"defaultValue": "false"
|
|
374
|
+
},
|
|
375
|
+
"max": {
|
|
376
|
+
"type": "string",
|
|
377
|
+
"mutable": false,
|
|
378
|
+
"complexType": {
|
|
379
|
+
"original": "string",
|
|
380
|
+
"resolved": "string | undefined",
|
|
381
|
+
"references": {}
|
|
382
|
+
},
|
|
383
|
+
"required": false,
|
|
384
|
+
"optional": true,
|
|
385
|
+
"docs": {
|
|
386
|
+
"tags": [],
|
|
387
|
+
"text": "A maximum time value given in HH:mm format."
|
|
388
|
+
},
|
|
389
|
+
"attribute": "max",
|
|
390
|
+
"reflect": false
|
|
391
|
+
},
|
|
392
|
+
"min": {
|
|
393
|
+
"type": "string",
|
|
394
|
+
"mutable": false,
|
|
395
|
+
"complexType": {
|
|
396
|
+
"original": "string",
|
|
397
|
+
"resolved": "string | undefined",
|
|
398
|
+
"references": {}
|
|
399
|
+
},
|
|
400
|
+
"required": false,
|
|
401
|
+
"optional": true,
|
|
402
|
+
"docs": {
|
|
403
|
+
"tags": [],
|
|
404
|
+
"text": "A minimum value given in HH:mm format."
|
|
405
|
+
},
|
|
406
|
+
"attribute": "min",
|
|
407
|
+
"reflect": false
|
|
408
|
+
},
|
|
409
|
+
"name": {
|
|
410
|
+
"type": "string",
|
|
411
|
+
"mutable": false,
|
|
412
|
+
"complexType": {
|
|
413
|
+
"original": "string",
|
|
414
|
+
"resolved": "string | undefined",
|
|
415
|
+
"references": {}
|
|
416
|
+
},
|
|
417
|
+
"required": false,
|
|
418
|
+
"optional": true,
|
|
419
|
+
"docs": {
|
|
420
|
+
"tags": [],
|
|
421
|
+
"text": "The name of the form control. Submitted with the form as part of a name/value pair."
|
|
422
|
+
},
|
|
423
|
+
"attribute": "name",
|
|
424
|
+
"reflect": false
|
|
425
|
+
},
|
|
426
|
+
"placeholder": {
|
|
427
|
+
"type": "string",
|
|
428
|
+
"mutable": false,
|
|
429
|
+
"complexType": {
|
|
430
|
+
"original": "string",
|
|
431
|
+
"resolved": "string | undefined",
|
|
432
|
+
"references": {}
|
|
433
|
+
},
|
|
434
|
+
"required": false,
|
|
435
|
+
"optional": true,
|
|
436
|
+
"docs": {
|
|
437
|
+
"tags": [],
|
|
438
|
+
"text": "The placeholder text to display within the input."
|
|
439
|
+
},
|
|
440
|
+
"attribute": "placeholder",
|
|
441
|
+
"reflect": false
|
|
442
|
+
},
|
|
443
|
+
"textPrefix": {
|
|
444
|
+
"type": "string",
|
|
445
|
+
"mutable": false,
|
|
446
|
+
"complexType": {
|
|
447
|
+
"original": "string",
|
|
448
|
+
"resolved": "string | undefined",
|
|
449
|
+
"references": {}
|
|
450
|
+
},
|
|
451
|
+
"required": false,
|
|
452
|
+
"optional": true,
|
|
453
|
+
"docs": {
|
|
454
|
+
"tags": [],
|
|
455
|
+
"text": "A textual prefix to be displayed in the input."
|
|
456
|
+
},
|
|
457
|
+
"attribute": "text-prefix",
|
|
458
|
+
"reflect": false
|
|
459
|
+
},
|
|
460
|
+
"textSuffix": {
|
|
461
|
+
"type": "string",
|
|
462
|
+
"mutable": false,
|
|
463
|
+
"complexType": {
|
|
464
|
+
"original": "string",
|
|
465
|
+
"resolved": "string | undefined",
|
|
466
|
+
"references": {}
|
|
467
|
+
},
|
|
468
|
+
"required": false,
|
|
469
|
+
"optional": true,
|
|
470
|
+
"docs": {
|
|
471
|
+
"tags": [],
|
|
472
|
+
"text": "A textual suffix to be displayed in the input."
|
|
473
|
+
},
|
|
474
|
+
"attribute": "text-suffix",
|
|
475
|
+
"reflect": false
|
|
476
|
+
},
|
|
477
|
+
"readonly": {
|
|
478
|
+
"type": "boolean",
|
|
479
|
+
"mutable": false,
|
|
480
|
+
"complexType": {
|
|
481
|
+
"original": "boolean",
|
|
482
|
+
"resolved": "boolean",
|
|
483
|
+
"references": {}
|
|
484
|
+
},
|
|
485
|
+
"required": false,
|
|
486
|
+
"optional": false,
|
|
487
|
+
"docs": {
|
|
488
|
+
"tags": [],
|
|
489
|
+
"text": "The value is not editable."
|
|
490
|
+
},
|
|
491
|
+
"attribute": "readonly",
|
|
492
|
+
"reflect": false,
|
|
493
|
+
"defaultValue": "false"
|
|
494
|
+
},
|
|
495
|
+
"required": {
|
|
496
|
+
"type": "boolean",
|
|
497
|
+
"mutable": false,
|
|
498
|
+
"complexType": {
|
|
499
|
+
"original": "boolean",
|
|
500
|
+
"resolved": "boolean",
|
|
501
|
+
"references": {}
|
|
502
|
+
},
|
|
503
|
+
"required": false,
|
|
504
|
+
"optional": false,
|
|
505
|
+
"docs": {
|
|
506
|
+
"tags": [],
|
|
507
|
+
"text": "A value is required or must be check for the form to be submittable."
|
|
508
|
+
},
|
|
509
|
+
"attribute": "required",
|
|
510
|
+
"reflect": false,
|
|
511
|
+
"defaultValue": "false"
|
|
512
|
+
},
|
|
513
|
+
"value": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"mutable": true,
|
|
516
|
+
"complexType": {
|
|
517
|
+
"original": "string",
|
|
518
|
+
"resolved": "string | undefined",
|
|
519
|
+
"references": {}
|
|
520
|
+
},
|
|
521
|
+
"required": false,
|
|
522
|
+
"optional": true,
|
|
523
|
+
"docs": {
|
|
524
|
+
"tags": [],
|
|
525
|
+
"text": "The value of the control given in HH:mm format"
|
|
526
|
+
},
|
|
527
|
+
"attribute": "value",
|
|
528
|
+
"reflect": false
|
|
529
|
+
},
|
|
530
|
+
"errors": {
|
|
531
|
+
"type": "boolean",
|
|
532
|
+
"mutable": false,
|
|
533
|
+
"complexType": {
|
|
534
|
+
"original": "boolean | string[] | ErrorMap",
|
|
535
|
+
"resolved": "boolean | string[] | undefined | { [key: string]: any; }",
|
|
536
|
+
"references": {
|
|
537
|
+
"ErrorMap": {
|
|
538
|
+
"location": "import",
|
|
539
|
+
"path": "../cat-form-hint/cat-form-hint",
|
|
540
|
+
"id": "src/components/cat-form-hint/cat-form-hint.tsx::ErrorMap"
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
"required": false,
|
|
545
|
+
"optional": true,
|
|
546
|
+
"docs": {
|
|
547
|
+
"tags": [],
|
|
548
|
+
"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."
|
|
549
|
+
},
|
|
550
|
+
"attribute": "errors",
|
|
551
|
+
"reflect": false
|
|
552
|
+
},
|
|
553
|
+
"errorUpdate": {
|
|
554
|
+
"type": "any",
|
|
555
|
+
"mutable": false,
|
|
556
|
+
"complexType": {
|
|
557
|
+
"original": "boolean | number",
|
|
558
|
+
"resolved": "boolean | number",
|
|
559
|
+
"references": {}
|
|
560
|
+
},
|
|
561
|
+
"required": false,
|
|
562
|
+
"optional": false,
|
|
563
|
+
"docs": {
|
|
564
|
+
"tags": [],
|
|
565
|
+
"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."
|
|
566
|
+
},
|
|
567
|
+
"attribute": "error-update",
|
|
568
|
+
"reflect": false,
|
|
569
|
+
"defaultValue": "0"
|
|
570
|
+
},
|
|
571
|
+
"nativeAttributes": {
|
|
572
|
+
"type": "unknown",
|
|
573
|
+
"mutable": false,
|
|
574
|
+
"complexType": {
|
|
575
|
+
"original": "{ [key: string]: string }",
|
|
576
|
+
"resolved": "undefined | { [key: string]: string; }",
|
|
577
|
+
"references": {}
|
|
578
|
+
},
|
|
579
|
+
"required": false,
|
|
580
|
+
"optional": true,
|
|
581
|
+
"docs": {
|
|
582
|
+
"tags": [],
|
|
583
|
+
"text": "Attributes that will be added to the native HTML input element."
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
"placement": {
|
|
587
|
+
"type": "string",
|
|
588
|
+
"mutable": false,
|
|
589
|
+
"complexType": {
|
|
590
|
+
"original": "Placement",
|
|
591
|
+
"resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
592
|
+
"references": {
|
|
593
|
+
"Placement": {
|
|
594
|
+
"location": "import",
|
|
595
|
+
"path": "@floating-ui/dom",
|
|
596
|
+
"id": "../node_modules/.pnpm/@floating-ui+dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
"required": false,
|
|
601
|
+
"optional": false,
|
|
602
|
+
"docs": {
|
|
603
|
+
"tags": [],
|
|
604
|
+
"text": "The placement of the dropdown."
|
|
605
|
+
},
|
|
606
|
+
"attribute": "placement",
|
|
607
|
+
"reflect": false,
|
|
608
|
+
"defaultValue": "'bottom-end'"
|
|
609
|
+
},
|
|
610
|
+
"step": {
|
|
611
|
+
"type": "number",
|
|
612
|
+
"mutable": false,
|
|
613
|
+
"complexType": {
|
|
614
|
+
"original": "number",
|
|
615
|
+
"resolved": "number",
|
|
616
|
+
"references": {}
|
|
617
|
+
},
|
|
618
|
+
"required": false,
|
|
619
|
+
"optional": false,
|
|
620
|
+
"docs": {
|
|
621
|
+
"tags": [],
|
|
622
|
+
"text": "The step size for times in minutes."
|
|
623
|
+
},
|
|
624
|
+
"attribute": "step",
|
|
625
|
+
"reflect": false,
|
|
626
|
+
"defaultValue": "30"
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
static get states() {
|
|
631
|
+
return {
|
|
632
|
+
"hasSlottedLabel": {},
|
|
633
|
+
"hasSlottedHint": {},
|
|
634
|
+
"selectionTime": {},
|
|
635
|
+
"isAm": {}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
static get events() {
|
|
639
|
+
return [{
|
|
640
|
+
"method": "catChange",
|
|
641
|
+
"name": "catChange",
|
|
642
|
+
"bubbles": true,
|
|
643
|
+
"cancelable": true,
|
|
644
|
+
"composed": true,
|
|
645
|
+
"docs": {
|
|
646
|
+
"tags": [],
|
|
647
|
+
"text": "Emitted when the value is changed."
|
|
648
|
+
},
|
|
649
|
+
"complexType": {
|
|
650
|
+
"original": "string",
|
|
651
|
+
"resolved": "string",
|
|
652
|
+
"references": {}
|
|
653
|
+
}
|
|
654
|
+
}, {
|
|
655
|
+
"method": "catFocus",
|
|
656
|
+
"name": "catFocus",
|
|
657
|
+
"bubbles": true,
|
|
658
|
+
"cancelable": true,
|
|
659
|
+
"composed": true,
|
|
660
|
+
"docs": {
|
|
661
|
+
"tags": [],
|
|
662
|
+
"text": "Emitted when the input received focus."
|
|
663
|
+
},
|
|
664
|
+
"complexType": {
|
|
665
|
+
"original": "FocusEvent",
|
|
666
|
+
"resolved": "FocusEvent",
|
|
667
|
+
"references": {
|
|
668
|
+
"FocusEvent": {
|
|
669
|
+
"location": "global",
|
|
670
|
+
"id": "global::FocusEvent"
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}, {
|
|
675
|
+
"method": "catBlur",
|
|
676
|
+
"name": "catBlur",
|
|
677
|
+
"bubbles": true,
|
|
678
|
+
"cancelable": true,
|
|
679
|
+
"composed": true,
|
|
680
|
+
"docs": {
|
|
681
|
+
"tags": [],
|
|
682
|
+
"text": "Emitted when the input loses focus."
|
|
683
|
+
},
|
|
684
|
+
"complexType": {
|
|
685
|
+
"original": "FocusEvent",
|
|
686
|
+
"resolved": "FocusEvent",
|
|
687
|
+
"references": {
|
|
688
|
+
"FocusEvent": {
|
|
689
|
+
"location": "global",
|
|
690
|
+
"id": "global::FocusEvent"
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}];
|
|
695
|
+
}
|
|
696
|
+
static get methods() {
|
|
697
|
+
return {
|
|
698
|
+
"select": {
|
|
699
|
+
"complexType": {
|
|
700
|
+
"signature": "(date: Date | null) => Promise<void>",
|
|
701
|
+
"parameters": [{
|
|
702
|
+
"name": "date",
|
|
703
|
+
"type": "Date | null",
|
|
704
|
+
"docs": "The time to select."
|
|
705
|
+
}],
|
|
706
|
+
"references": {
|
|
707
|
+
"Promise": {
|
|
708
|
+
"location": "global",
|
|
709
|
+
"id": "global::Promise"
|
|
710
|
+
},
|
|
711
|
+
"Date": {
|
|
712
|
+
"location": "global",
|
|
713
|
+
"id": "global::Date"
|
|
714
|
+
}
|
|
715
|
+
},
|
|
716
|
+
"return": "Promise<void>"
|
|
717
|
+
},
|
|
718
|
+
"docs": {
|
|
719
|
+
"text": "Select a time in the picker.",
|
|
720
|
+
"tags": [{
|
|
721
|
+
"name": "param",
|
|
722
|
+
"text": "date The time to select."
|
|
723
|
+
}]
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
"doFocus": {
|
|
727
|
+
"complexType": {
|
|
728
|
+
"signature": "(options?: FocusOptions) => Promise<void>",
|
|
729
|
+
"parameters": [{
|
|
730
|
+
"name": "options",
|
|
731
|
+
"type": "FocusOptions | undefined",
|
|
732
|
+
"docs": "An optional object providing options to control aspects of\nthe focusing process."
|
|
733
|
+
}],
|
|
734
|
+
"references": {
|
|
735
|
+
"Promise": {
|
|
736
|
+
"location": "global",
|
|
737
|
+
"id": "global::Promise"
|
|
738
|
+
},
|
|
739
|
+
"FocusOptions": {
|
|
740
|
+
"location": "global",
|
|
741
|
+
"id": "global::FocusOptions"
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
"return": "Promise<void>"
|
|
745
|
+
},
|
|
746
|
+
"docs": {
|
|
747
|
+
"text": "Programmatically move focus to the input. Use this method instead of\n`input.focus()`.",
|
|
748
|
+
"tags": [{
|
|
749
|
+
"name": "param",
|
|
750
|
+
"text": "options An optional object providing options to control aspects of\nthe focusing process."
|
|
751
|
+
}]
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
"doBlur": {
|
|
755
|
+
"complexType": {
|
|
756
|
+
"signature": "() => Promise<void>",
|
|
757
|
+
"parameters": [],
|
|
758
|
+
"references": {
|
|
759
|
+
"Promise": {
|
|
760
|
+
"location": "global",
|
|
761
|
+
"id": "global::Promise"
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
"return": "Promise<void>"
|
|
765
|
+
},
|
|
766
|
+
"docs": {
|
|
767
|
+
"text": "Programmatically remove focus from the input. Use this method instead of\n`input.blur()`.",
|
|
768
|
+
"tags": []
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
"clear": {
|
|
772
|
+
"complexType": {
|
|
773
|
+
"signature": "() => Promise<void>",
|
|
774
|
+
"parameters": [],
|
|
775
|
+
"references": {
|
|
776
|
+
"Promise": {
|
|
777
|
+
"location": "global",
|
|
778
|
+
"id": "global::Promise"
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
"return": "Promise<void>"
|
|
782
|
+
},
|
|
783
|
+
"docs": {
|
|
784
|
+
"text": "Clear the input.",
|
|
785
|
+
"tags": []
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
static get elementRef() { return "hostElement"; }
|
|
791
|
+
static get listeners() {
|
|
792
|
+
return [{
|
|
793
|
+
"name": "catOpen",
|
|
794
|
+
"method": "onOpen",
|
|
795
|
+
"target": undefined,
|
|
796
|
+
"capture": false,
|
|
797
|
+
"passive": false
|
|
798
|
+
}];
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
//# sourceMappingURL=cat-time.js.map
|