@ukic/canary-web-components 3.0.0-canary.33 → 3.0.0-canary.34
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/cjs/core.cjs.js +1 -1
- package/dist/cjs/helpers-f81fed28.js.map +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +6 -2
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +28 -16
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +23 -2
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_4.cjs.entry.js +3 -4
- package/dist/cjs/ic-input-component-container_4.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +20 -5
- package/dist/cjs/ic-skeleton.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +16 -14
- package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +24 -4
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +4 -4
- package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-time-input.cjs.entry.js +7 -7
- package/dist/cjs/ic-time-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-time-selector.cjs.entry.js +50 -170
- package/dist/cjs/ic-time-selector.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast-region.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +5 -5
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button_2.cjs.entry.js +4 -4
- package/dist/cjs/ic-toggle-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-time-input/ic-time-input.js +8 -8
- package/dist/collection/components/ic-time-input/ic-time-input.js.map +1 -1
- package/dist/collection/components/ic-time-input/ic-time-input.stories.js +4 -4
- package/dist/collection/components/ic-time-input/ic-time-input.stories.js.map +1 -1
- package/dist/collection/components/ic-time-selector/ic-time-selector.js +53 -200
- package/dist/collection/components/ic-time-selector/ic-time-selector.js.map +1 -1
- package/dist/collection/components/ic-time-selector/ic-time-selector.stories.js +50 -24
- package/dist/collection/components/ic-time-selector/ic-time-selector.stories.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers2.js.map +1 -1
- package/dist/components/ic-alert.js +7 -2
- package/dist/components/ic-alert.js.map +1 -1
- package/dist/components/ic-button2.js +4 -4
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +24 -2
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-data-row.js +1 -1
- package/dist/components/ic-data-row.js.map +1 -1
- package/dist/components/ic-input-validation2.js +4 -5
- package/dist/components/ic-input-validation2.js.map +1 -1
- package/dist/components/ic-loading-indicator2.js +27 -13
- package/dist/components/ic-loading-indicator2.js.map +1 -1
- package/dist/components/ic-menu2.js +1 -1
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-skeleton.js +23 -6
- package/dist/components/ic-skeleton.js.map +1 -1
- package/dist/components/ic-step.js +17 -15
- package/dist/components/ic-step.js.map +1 -1
- package/dist/components/ic-stepper.js +24 -4
- package/dist/components/ic-stepper.js.map +1 -1
- package/dist/components/ic-switch.js +4 -4
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab-context.js +1 -1
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-tab-group.js +2 -2
- package/dist/components/ic-tab-group.js.map +1 -1
- package/dist/components/ic-tab-panel.js +2 -2
- package/dist/components/ic-tab-panel.js.map +1 -1
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-theme.js.map +1 -1
- package/dist/components/ic-time-input.js +7 -7
- package/dist/components/ic-time-input.js.map +1 -1
- package/dist/components/ic-time-selector.js +50 -172
- package/dist/components/ic-time-selector.js.map +1 -1
- package/dist/components/ic-toast-region.js +1 -1
- package/dist/components/ic-toast-region.js.map +1 -1
- package/dist/components/ic-toast.js +5 -5
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-toggle-button-group2.js +2 -2
- package/dist/components/ic-toggle-button-group2.js.map +1 -1
- package/dist/components/ic-toggle-button2.js +2 -2
- package/dist/components/ic-toggle-button2.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-802a4bd3.entry.js → p-0bca234b.entry.js} +2 -2
- package/dist/core/{p-802a4bd3.entry.js.map → p-0bca234b.entry.js.map} +1 -1
- package/dist/core/{p-5254a078.entry.js → p-1be17f22.entry.js} +2 -2
- package/dist/core/{p-5254a078.entry.js.map → p-1be17f22.entry.js.map} +1 -1
- package/dist/core/{p-d528d856.entry.js → p-1dbefb37.entry.js} +2 -2
- package/dist/core/p-1dbefb37.entry.js.map +1 -0
- package/dist/core/{p-c9525aac.entry.js → p-409d03b2.entry.js} +2 -2
- package/dist/core/{p-c9525aac.entry.js.map → p-409d03b2.entry.js.map} +1 -1
- package/dist/core/p-492991ad.entry.js +2 -0
- package/dist/core/p-492991ad.entry.js.map +1 -0
- package/dist/core/p-53dad961.entry.js +2 -0
- package/dist/core/p-53dad961.entry.js.map +1 -0
- package/dist/core/{p-ad551a0c.entry.js → p-7c4d6b13.entry.js} +2 -2
- package/dist/core/p-7c4d6b13.entry.js.map +1 -0
- package/dist/core/{p-a88e61b2.entry.js → p-7d878ad7.entry.js} +2 -2
- package/dist/core/{p-a88e61b2.entry.js.map → p-7d878ad7.entry.js.map} +1 -1
- package/dist/core/p-829b34f9.js.map +1 -1
- package/dist/core/p-8d42a6e5.entry.js +2 -0
- package/dist/core/{p-a94a7b71.entry.js.map → p-8d42a6e5.entry.js.map} +1 -1
- package/dist/core/{p-e2e556ec.entry.js → p-a58cf6fd.entry.js} +2 -2
- package/dist/core/p-a58cf6fd.entry.js.map +1 -0
- package/dist/core/{p-53740194.entry.js → p-a8310dfd.entry.js} +2 -2
- package/dist/core/p-a8310dfd.entry.js.map +1 -0
- package/dist/core/{p-c32f043e.entry.js → p-b76fdade.entry.js} +2 -2
- package/dist/core/{p-c32f043e.entry.js.map → p-b76fdade.entry.js.map} +1 -1
- package/dist/core/{p-04cb17d7.entry.js → p-b9459ba2.entry.js} +2 -2
- package/dist/core/{p-04cb17d7.entry.js.map → p-b9459ba2.entry.js.map} +1 -1
- package/dist/core/p-bb3db366.entry.js +2 -0
- package/dist/core/p-bb3db366.entry.js.map +1 -0
- package/dist/core/p-bc6e5d64.entry.js +2 -0
- package/dist/core/p-bc6e5d64.entry.js.map +1 -0
- package/dist/core/{p-adde6c66.entry.js → p-d376858f.entry.js} +2 -2
- package/dist/core/{p-adde6c66.entry.js.map → p-d376858f.entry.js.map} +1 -1
- package/dist/core/{p-6323da7a.entry.js → p-dbd9a403.entry.js} +2 -2
- package/dist/core/{p-6323da7a.entry.js.map → p-dbd9a403.entry.js.map} +1 -1
- package/dist/core/p-df064c8b.entry.js +2 -0
- package/dist/core/p-df064c8b.entry.js.map +1 -0
- package/dist/core/p-eac60693.entry.js +2 -0
- package/dist/core/p-eac60693.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/helpers-a08b3f32.js.map +1 -1
- package/dist/esm/ic-alert.entry.js +6 -2
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-button_3.entry.js +28 -16
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +23 -2
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-data-row.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_4.entry.js +3 -4
- package/dist/esm/ic-input-component-container_4.entry.js.map +1 -1
- package/dist/esm/ic-menu.entry.js +1 -1
- package/dist/esm/ic-menu.entry.js.map +1 -1
- package/dist/esm/ic-skeleton.entry.js +20 -5
- package/dist/esm/ic-skeleton.entry.js.map +1 -1
- package/dist/esm/ic-step.entry.js +17 -15
- package/dist/esm/ic-step.entry.js.map +1 -1
- package/dist/esm/ic-stepper.entry.js +24 -4
- package/dist/esm/ic-stepper.entry.js.map +1 -1
- package/dist/esm/ic-switch.entry.js +4 -4
- package/dist/esm/ic-switch.entry.js.map +1 -1
- package/dist/esm/ic-tab-context.entry.js +1 -1
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +2 -2
- package/dist/esm/ic-tab-group.entry.js.map +1 -1
- package/dist/esm/ic-tab-panel.entry.js +2 -2
- package/dist/esm/ic-tab-panel.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-theme.entry.js.map +1 -1
- package/dist/esm/ic-time-input.entry.js +7 -7
- package/dist/esm/ic-time-input.entry.js.map +1 -1
- package/dist/esm/ic-time-selector.entry.js +50 -170
- package/dist/esm/ic-time-selector.entry.js.map +1 -1
- package/dist/esm/ic-toast-region.entry.js +1 -1
- package/dist/esm/ic-toast-region.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +5 -5
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button_2.entry.js +4 -4
- package/dist/esm/ic-toggle-button_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-time-input/ic-time-input.d.ts +1 -1
- package/dist/types/components/ic-time-selector/ic-time-selector.d.ts +2 -10
- package/dist/types/components/ic-time-selector/ic-time-selector.stories.d.ts +48 -13
- package/dist/types/components.d.ts +6 -16
- package/dist/types/utils/types.d.ts +1 -2
- package/hydrate/index.js +208 -250
- package/hydrate/index.mjs +208 -250
- package/package.json +3 -3
- package/dist/core/p-53740194.entry.js.map +0 -1
- package/dist/core/p-71cc5909.entry.js +0 -2
- package/dist/core/p-71cc5909.entry.js.map +0 -1
- package/dist/core/p-8830011c.entry.js +0 -2
- package/dist/core/p-8830011c.entry.js.map +0 -1
- package/dist/core/p-939b168a.entry.js +0 -2
- package/dist/core/p-939b168a.entry.js.map +0 -1
- package/dist/core/p-a94a7b71.entry.js +0 -2
- package/dist/core/p-ad551a0c.entry.js.map +0 -1
- package/dist/core/p-b434bd7c.entry.js +0 -2
- package/dist/core/p-b434bd7c.entry.js.map +0 -1
- package/dist/core/p-d528d856.entry.js.map +0 -1
- package/dist/core/p-da1c2883.entry.js +0 -2
- package/dist/core/p-da1c2883.entry.js.map +0 -1
- package/dist/core/p-e2e556ec.entry.js.map +0 -1
- package/dist/core/p-eaeb473e.entry.js +0 -2
- package/dist/core/p-eaeb473e.entry.js.map +0 -1
|
@@ -20,22 +20,20 @@ const Clear = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill=
|
|
|
20
20
|
const icTimeSelectorCss = ":host(.ic-time-selector-small){--time-selector-padded-item-height:var(--ic-space-lg)}:host(.ic-time-selector-medium){--time-selector-padded-item-height:calc(\n var(--ic-space-lg) + var(--ic-space-xxs)\n )}:host(.ic-time-selector-large){--time-selector-padded-item-height:var(--ic-space-xl)}.ic-time-selector-dialog-container{background-color:var(--ic-time-picker-time-selector-bg);border:var(--ic-space-1px) solid var(--ic-time-picker-time-selector-border);border-radius:var(--ic-space-xxs);padding:var(--ic-space-xs);max-width:calc(\n 3 * var(--ic-space-xxl) + var(--ic-space-xl) + var(--ic-space-xxs)\n );width:-moz-fit-content;width:fit-content}:host(.ic-time-selector-small) .ic-time-selector-dialog-container{padding:var(--ic-space-xxs);max-width:calc(\n 3 * var(--ic-space-xxl) + var(--ic-space-lg) + var(--ic-space-xxs)\n )}:host(.ic-time-selector-large) .ic-time-selector-dialog-container{padding:var(--ic-space-md);max-width:calc(\n 3 * var(--ic-space-xxl) + var(--ic-space-xl) + var(--ic-space-xs) +\n var(--ic-space-xxs)\n )}.ic-time-selector-item{height:var(--ic-space-lg);padding:var(--ic-space-xxxs);text-align:center;cursor:pointer;scroll-snap-align:start;transition:background 0.2s, color 0.2s}:host(.ic-time-selector-small) .ic-time-selector-item{padding:0}:host(.ic-time-selector-large) .ic-time-selector-item{padding:var(--ic-space-xxs)}.ic-time-selector-item:hover:not(.disabled):not(.selected){background-color:var(--ic-time-picker-time-bg-hover)}.ic-time-selector-item:active:not(.disabled):not(.selected){background-color:var(--ic-time-picker-time-bg-pressed)}.ic-time-selector-item.selected{background-color:var(--ic-time-picker-time-bg-selected);--ic-typography-color:var(--ic-time-picker-time-text-selected);position:relative}.ic-time-selector-item.selected:hover{background-color:var(--ic-time-picker-time-active-bg-hover)}.ic-time-selector-item.selected:active{background-color:var(--ic-time-picker-time-active-bg-pressed)}.ic-time-selector-colon-selected{background-color:var(--ic-time-picker-colon-bg-selected);color:var(--ic-time-picker-colon-selected) !important}.ic-time-selector-item.selected::before,.ic-time-selector-item.selected::after,.ic-time-selector-colon-selected::before,.ic-time-selector-colon-selected::after{content:\"\";position:absolute;left:0;right:0;height:var(--ic-space-1px);background:var(--ic-time-picker-time-selector-bg)}.ic-time-selector-item.selected::before,.ic-time-selector-colon-selected::before{top:0}.ic-time-selector-item.selected::after,.ic-time-selector-colon-selected::after{bottom:0}.ic-time-selector-item.disabled{--ic-typography-color:var(--ic-time-picker-time-text-disabled);cursor:not-allowed}.ic-time-selector-column-wrapper{display:flex;flex-direction:column}.ic-time-selector-scroll-row{height:var(--time-selector-padded-item-height) !important;background:transparent !important;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:default !important;box-sizing:border-box}:host(.ic-time-selector-small) .ic-time-selector-scroll-row-last{height:calc(var(--ic-space-1px) + var(--ic-space-xxxs)) !important}:host(.ic-time-selector-medium) .ic-time-selector-scroll-row-last,:host(.ic-time-selector-large) .ic-time-selector-scroll-row-last{height:calc(\n var(--ic-space-1px) + var(--ic-space-xxxs) + var(--ic-space-md)\n ) !important}.ic-time-selector-scroll-row:hover,.ic-time-selector-scroll-row:active{background:transparent !important}.ic-time-selector-header-row{color:var(--ic-time-picker-hh-label);--ic-typography-color:var(--ic-time-picker-hh-label) !important;background:transparent !important;text-align:center;height:var(--time-selector-padded-item-height);display:flex;align-items:center;justify-content:center}.ic-time-selector-header-border{position:absolute;left:0;right:0;top:var(--time-selector-padded-item-height);height:var(--ic-space-1px);background:var(--ic-time-picker-header-border);pointer-events:none}.ic-time-selector-colon{display:flex;align-items:center;justify-content:center;color:var(--ic-time-picker-colon-default);height:var(--time-selector-padded-item-height);margin-top:calc(3 * var(--time-selector-padded-item-height))}.ic-time-selector-columns{display:flex;flex-direction:row;border-bottom:var(--ic-space-1px) solid var(--ic-time-picker-lower-border);margin:0 var(--ic-space-xxs);position:relative;z-index:1}.ic-time-selector-highlight-lines{position:relative;width:100%}.ic-time-selector-highlight{position:absolute;left:0;right:0;width:100%;height:var(--ic-space-1px);background:var(--ic-time-picker-selection-border);pointer-events:none;z-index:1}.ic-time-selector-highlight-top{top:calc(3 * var(--time-selector-padded-item-height) - var(--ic-space-1px))}.ic-time-selector-highlight-bottom{top:calc(4 * var(--time-selector-padded-item-height))}.ic-time-selector-column{height:calc((5 * var(--ic-space-xxl)) + (3 * var(--ic-space-1px)));overflow-y:auto;width:calc(var(--ic-space-xl) + var(--ic-space-xs));position:relative;scroll-snap-type:y mandatory;scrollbar-width:none;-ms-overflow-style:none}:host(.ic-time-selector-small) .ic-time-selector-column{width:calc(var(--ic-space-xl) + var(--ic-space-xxs) + var(--ic-space-xxxs))}:host(.ic-time-selector-large) .ic-time-selector-column{width:calc(var(--ic-space-xl) + var(--ic-space-xs) + var(--ic-space-xxxs))}.ic-time-selector-column-period{margin-left:var(--ic-space-xxs)}.ic-time-selector-column::-webkit-scrollbar{display:none}.ic-time-selector-column:focus-visible,.ic-time-selector-item:focus-visible{outline:none;background-color:transparent}.ic-time-selector-column:focus{box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast);z-index:3}.ic-time-selector-list{list-style:none;margin:0;padding:0}.ic-time-selector-actions{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;width:100%;margin-top:var(--ic-space-xs);margin-left:auto}.ic-time-selector-check-btn{margin-left:calc(var(--ic-space-xs) + var(--ic-space-xxxs))}.sr-only{position:absolute;left:-9999px}@media (forced-colors: active){.ic-time-selector-item.selected{background-color:highlight !important}.ic-time-selector-item.disabled{--ic-typography-color:GrayText !important}.ic-time-selector-column:focus{border:var(--ic-border-hc)}.ic-time-selector-highlight{background:Highlight !important}}";
|
|
21
21
|
const IcTimeSelectorStyle0 = icTimeSelectorCss;
|
|
22
22
|
|
|
23
|
-
const COLUMN_TYPES = ["hour", "minute", "
|
|
23
|
+
const COLUMN_TYPES = ["hour", "minute", "period"];
|
|
24
24
|
const COLUMN_CLASS = ".ic-time-selector-column";
|
|
25
25
|
const ITEM_CLASS = ".ic-time-selector-item";
|
|
26
26
|
const TimeSelector = class {
|
|
27
27
|
constructor(hostRef) {
|
|
28
28
|
index.registerInstance(this, hostRef);
|
|
29
29
|
this.icChange = index.createEvent(this, "icChange", 7);
|
|
30
|
-
this.DEFAULT_TIME_FORMAT = "HH:MM:SS";
|
|
31
30
|
this.minutes = Array.from({ length: 60 }, (_, i) => i);
|
|
32
|
-
this.seconds = Array.from({ length: 60 }, (_, i) => i);
|
|
33
31
|
this.periods = ["AM", "PM"];
|
|
34
32
|
this.minTime = null;
|
|
35
33
|
this.maxTime = null;
|
|
36
34
|
this.ariaLiveMessage = "";
|
|
37
35
|
/**
|
|
38
|
-
* An array of
|
|
36
|
+
* An array of objects with start and end values that will be disabled in the time selector. The times can be in any format supported as `timeFormat`, in ISO 8601 time string format (`HH:MM:SS`) or as a JavaScript `Date` object.
|
|
39
37
|
*/
|
|
40
38
|
this.disableTimes = [];
|
|
41
39
|
/**
|
|
@@ -54,10 +52,6 @@ const TimeSelector = class {
|
|
|
54
52
|
* Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
|
|
55
53
|
*/
|
|
56
54
|
this.theme = "inherit";
|
|
57
|
-
/**
|
|
58
|
-
* The format in which the time will be displayed.
|
|
59
|
-
*/
|
|
60
|
-
this.timeFormat = this.DEFAULT_TIME_FORMAT;
|
|
61
55
|
/**
|
|
62
56
|
* The time period format: "12" for 12-hour, "24" for 24-hour. Defaults to "24".
|
|
63
57
|
*/
|
|
@@ -66,7 +60,7 @@ const TimeSelector = class {
|
|
|
66
60
|
* The value of the time selector. The value can be in any format supported as `timeFormat`, in ISO 8601 time string format (`HH:MM:SS`) or as a JavaScript `Date` object.
|
|
67
61
|
*/
|
|
68
62
|
this.value = "";
|
|
69
|
-
this.setTimeParts = (hour, minute
|
|
63
|
+
this.setTimeParts = (hour, minute) => {
|
|
70
64
|
let period = "AM";
|
|
71
65
|
if (this.timePeriod === "12") {
|
|
72
66
|
if (hour === 0) {
|
|
@@ -90,7 +84,6 @@ const TimeSelector = class {
|
|
|
90
84
|
this.selectedHour = hour;
|
|
91
85
|
}
|
|
92
86
|
this.selectedMinute = minute;
|
|
93
|
-
this.selectedSecond = second;
|
|
94
87
|
};
|
|
95
88
|
this.checkIfScrollIsFinished = (column, scrollTop) => {
|
|
96
89
|
const isScrollFinished = setInterval(() => {
|
|
@@ -110,9 +103,6 @@ const TimeSelector = class {
|
|
|
110
103
|
case "minute":
|
|
111
104
|
this.selectedMinute = Number(value);
|
|
112
105
|
break;
|
|
113
|
-
case "second":
|
|
114
|
-
this.selectedSecond = Number(value);
|
|
115
|
-
break;
|
|
116
106
|
case "period":
|
|
117
107
|
this.selectedPeriod = value;
|
|
118
108
|
break;
|
|
@@ -133,25 +123,16 @@ const TimeSelector = class {
|
|
|
133
123
|
this.lastAnnouncedValue = this.getSelectedValue(type);
|
|
134
124
|
}
|
|
135
125
|
};
|
|
136
|
-
this.isTimeDisabled = (hour, minute,
|
|
137
|
-
var _a, _b
|
|
126
|
+
this.isTimeDisabled = (hour, minute, type) => {
|
|
127
|
+
var _a, _b;
|
|
138
128
|
for (const t of this.disableTimes) {
|
|
139
|
-
if (typeof t === "
|
|
140
|
-
const parts = helpers.parseTimeHelper(t).parts;
|
|
141
|
-
if (parts &&
|
|
142
|
-
parts.hour === hour &&
|
|
143
|
-
parts.minute === minute &&
|
|
144
|
-
parts.second === second) {
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
else if (t && typeof t === "object" && "start" in t && "end" in t) {
|
|
129
|
+
if (t && typeof t === "object" && "start" in t && "end" in t) {
|
|
149
130
|
const startParts = helpers.parseTimeHelper(t.start).parts;
|
|
150
131
|
const endParts = helpers.parseTimeHelper(t.end).parts;
|
|
151
132
|
if (startParts && endParts) {
|
|
152
|
-
const timeVal = hour * 3600 + minute * 60
|
|
153
|
-
const startVal = startParts.hour * 3600 + startParts.minute * 60
|
|
154
|
-
const endVal = endParts.hour * 3600 + endParts.minute * 60
|
|
133
|
+
const timeVal = hour * 3600 + minute * 60;
|
|
134
|
+
const startVal = startParts.hour * 3600 + startParts.minute * 60;
|
|
135
|
+
const endVal = endParts.hour * 3600 + endParts.minute * 60;
|
|
155
136
|
if (timeVal >= startVal && timeVal <= endVal) {
|
|
156
137
|
return true;
|
|
157
138
|
}
|
|
@@ -163,15 +144,11 @@ const TimeSelector = class {
|
|
|
163
144
|
if (this.minTime) {
|
|
164
145
|
const minHour = this.minTime.getHours();
|
|
165
146
|
const minMinute = this.minTime.getMinutes();
|
|
166
|
-
const minSecond = this.minTime.getSeconds();
|
|
167
147
|
if (type === "hour") {
|
|
168
148
|
const highlightedMinute = (_a = this.selectedMinute) !== null && _a !== void 0 ? _a : minMinute;
|
|
169
|
-
const highlightedSecond = (_b = this.selectedSecond) !== null && _b !== void 0 ? _b : minSecond;
|
|
170
149
|
if (hour < minHour ||
|
|
171
150
|
(hour === minHour && highlightedMinute < minMinute) ||
|
|
172
|
-
(hour === minHour &&
|
|
173
|
-
highlightedMinute === minMinute &&
|
|
174
|
-
highlightedSecond < minSecond)) {
|
|
151
|
+
(hour === minHour && highlightedMinute === minMinute)) {
|
|
175
152
|
return true;
|
|
176
153
|
}
|
|
177
154
|
}
|
|
@@ -180,15 +157,10 @@ const TimeSelector = class {
|
|
|
180
157
|
return true;
|
|
181
158
|
}
|
|
182
159
|
}
|
|
183
|
-
else if (type === "second") {
|
|
184
|
-
if (hour === minHour && minute === minMinute && second < minSecond) {
|
|
185
|
-
return true;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
160
|
else {
|
|
189
161
|
if (hour < minHour ||
|
|
190
162
|
(hour === minHour && minute < minMinute) ||
|
|
191
|
-
(hour === minHour && minute === minMinute
|
|
163
|
+
(hour === minHour && minute === minMinute)) {
|
|
192
164
|
return true;
|
|
193
165
|
}
|
|
194
166
|
}
|
|
@@ -199,15 +171,11 @@ const TimeSelector = class {
|
|
|
199
171
|
if (this.maxTime) {
|
|
200
172
|
const maxHour = this.maxTime.getHours();
|
|
201
173
|
const maxMinute = this.maxTime.getMinutes();
|
|
202
|
-
const maxSecond = this.maxTime.getSeconds();
|
|
203
174
|
if (type === "hour") {
|
|
204
|
-
const selectedMinute = (
|
|
205
|
-
const selectedSecond = (_d = this.selectedSecond) !== null && _d !== void 0 ? _d : 59;
|
|
175
|
+
const selectedMinute = (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : 59;
|
|
206
176
|
if (hour > maxHour ||
|
|
207
177
|
(hour === maxHour && selectedMinute > maxMinute) ||
|
|
208
|
-
(hour === maxHour &&
|
|
209
|
-
selectedMinute === maxMinute &&
|
|
210
|
-
selectedSecond > maxSecond)) {
|
|
178
|
+
(hour === maxHour && selectedMinute === maxMinute)) {
|
|
211
179
|
return true;
|
|
212
180
|
}
|
|
213
181
|
}
|
|
@@ -216,15 +184,10 @@ const TimeSelector = class {
|
|
|
216
184
|
return true;
|
|
217
185
|
}
|
|
218
186
|
}
|
|
219
|
-
else if (type === "second") {
|
|
220
|
-
if (hour === maxHour && minute === maxMinute && second > maxSecond) {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
187
|
else {
|
|
225
188
|
if (hour > maxHour ||
|
|
226
189
|
(hour === maxHour && minute > maxMinute) ||
|
|
227
|
-
(hour === maxHour && minute === maxMinute
|
|
190
|
+
(hour === maxHour && minute === maxMinute)) {
|
|
228
191
|
return true;
|
|
229
192
|
}
|
|
230
193
|
}
|
|
@@ -306,18 +269,15 @@ const TimeSelector = class {
|
|
|
306
269
|
} while (newIdx >= 0 &&
|
|
307
270
|
newIdx <= maxIdx &&
|
|
308
271
|
(() => {
|
|
309
|
-
var _a, _b
|
|
310
|
-
if (type === "hour" || type === "minute"
|
|
272
|
+
var _a, _b;
|
|
273
|
+
if (type === "hour" || type === "minute") {
|
|
311
274
|
const hour = type === "hour"
|
|
312
275
|
? values[newIdx]
|
|
313
276
|
: (_a = this.selectedHour) !== null && _a !== void 0 ? _a : 0;
|
|
314
277
|
const minute = type === "minute"
|
|
315
278
|
? values[newIdx]
|
|
316
279
|
: (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : 0;
|
|
317
|
-
|
|
318
|
-
? values[newIdx]
|
|
319
|
-
: (_c = this.selectedSecond) !== null && _c !== void 0 ? _c : 0;
|
|
320
|
-
return this.isTimeDisabled(hour, minute, second);
|
|
280
|
+
return this.isTimeDisabled(hour, minute);
|
|
321
281
|
}
|
|
322
282
|
return false;
|
|
323
283
|
})());
|
|
@@ -332,7 +292,7 @@ const TimeSelector = class {
|
|
|
332
292
|
}
|
|
333
293
|
};
|
|
334
294
|
this.renderColumn = (type, values, selected) => {
|
|
335
|
-
const isTimeColumn = type === "hour" || type === "minute"
|
|
295
|
+
const isTimeColumn = type === "hour" || type === "minute";
|
|
336
296
|
const isPeriodColumn = type === "period";
|
|
337
297
|
const headerLabel = this.getHeaderLabel(type);
|
|
338
298
|
const topSpacerCount = 2;
|
|
@@ -347,17 +307,14 @@ const TimeSelector = class {
|
|
|
347
307
|
"ic-time-selector-column": true,
|
|
348
308
|
"ic-time-selector-column-period": isPeriodColumn,
|
|
349
309
|
}, tabIndex: 0, onKeyDown: (e) => this.handleColumnKeyDown(type, e) }, index.h("ul", { class: "ic-time-selector-list", role: "listbox", "aria-label": type }, this.renderScrollRows(topSpacerCount, `${type}-top-spacer`), values.map((val) => {
|
|
350
|
-
var _a, _b
|
|
310
|
+
var _a, _b;
|
|
351
311
|
let disabled = false;
|
|
352
312
|
if (isTimeColumn) {
|
|
353
313
|
const hour = type === "hour" ? val : (_a = this.selectedHour) !== null && _a !== void 0 ? _a : 0;
|
|
354
314
|
const minute = type === "minute"
|
|
355
315
|
? val
|
|
356
316
|
: (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : 0;
|
|
357
|
-
|
|
358
|
-
? val
|
|
359
|
-
: (_c = this.selectedSecond) !== null && _c !== void 0 ? _c : 0;
|
|
360
|
-
disabled = this.isTimeDisabled(hour, minute, second, type);
|
|
317
|
+
disabled = this.isTimeDisabled(hour, minute, type);
|
|
361
318
|
}
|
|
362
319
|
return (index.h("li", { class: {
|
|
363
320
|
"ic-time-selector-item": true,
|
|
@@ -374,8 +331,6 @@ const TimeSelector = class {
|
|
|
374
331
|
this.scrollSelectedItem("hour", true);
|
|
375
332
|
this.selectedMinute = undefined;
|
|
376
333
|
this.scrollSelectedItem("minute", true);
|
|
377
|
-
this.selectedSecond = undefined;
|
|
378
|
-
this.scrollSelectedItem("second", true);
|
|
379
334
|
this.selectedPeriod = undefined;
|
|
380
335
|
this.scrollSelectedItem("period", true);
|
|
381
336
|
this.lastAnnouncedType = undefined;
|
|
@@ -386,7 +341,6 @@ const TimeSelector = class {
|
|
|
386
341
|
timeObject: {
|
|
387
342
|
hour: null,
|
|
388
343
|
minute: null,
|
|
389
|
-
second: null,
|
|
390
344
|
period: undefined,
|
|
391
345
|
},
|
|
392
346
|
});
|
|
@@ -394,18 +348,11 @@ const TimeSelector = class {
|
|
|
394
348
|
this.handleConfirmClick = () => {
|
|
395
349
|
const hour = this.selectedHour != null ? this.selectedHour : null;
|
|
396
350
|
const minute = this.selectedMinute != null ? this.selectedMinute : null;
|
|
397
|
-
const second = this.selectedSecond != null ? this.selectedSecond : null;
|
|
398
351
|
const period = this.selectedPeriod;
|
|
399
352
|
const hourStr = hour != null ? hour.toString().padStart(2, "0") : null;
|
|
400
353
|
const minuteStr = minute != null ? minute.toString().padStart(2, "0") : null;
|
|
401
|
-
const secondStr = second != null ? second.toString().padStart(2, "0") : null;
|
|
402
354
|
let allSelected = false;
|
|
403
|
-
|
|
404
|
-
allSelected = hour !== null && minute !== null && second !== null;
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
allSelected = hour !== null && minute !== null;
|
|
408
|
-
}
|
|
355
|
+
allSelected = hour !== null && minute !== null;
|
|
409
356
|
let value = null;
|
|
410
357
|
let timeString = null;
|
|
411
358
|
if (allSelected) {
|
|
@@ -419,26 +366,13 @@ const TimeSelector = class {
|
|
|
419
366
|
value = new Date();
|
|
420
367
|
value.setHours(date24hours !== null && date24hours !== void 0 ? date24hours : 0);
|
|
421
368
|
value.setMinutes(minute !== null && minute !== void 0 ? minute : 0);
|
|
422
|
-
|
|
423
|
-
value.setMilliseconds(0);
|
|
424
|
-
if (this.timeFormat === "HH:MM") {
|
|
425
|
-
timeString = hourStr + ":" + minuteStr + (period ? " " + period : "");
|
|
426
|
-
}
|
|
427
|
-
else if (this.timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
428
|
-
timeString =
|
|
429
|
-
hourStr +
|
|
430
|
-
":" +
|
|
431
|
-
minuteStr +
|
|
432
|
-
":" +
|
|
433
|
-
secondStr +
|
|
434
|
-
(period ? " " + period : "");
|
|
435
|
-
}
|
|
369
|
+
timeString = hourStr + ":" + minuteStr + (period ? " " + period : "");
|
|
436
370
|
this.value = value;
|
|
437
371
|
}
|
|
438
372
|
this.icChange.emit({
|
|
439
373
|
value: allSelected ? value : null,
|
|
440
374
|
timeString: allSelected ? timeString : null,
|
|
441
|
-
timeObject: Object.assign({ hour: hourStr, minute: minuteStr
|
|
375
|
+
timeObject: Object.assign({ hour: hourStr, minute: minuteStr }, (period ? { period } : {})),
|
|
442
376
|
});
|
|
443
377
|
};
|
|
444
378
|
}
|
|
@@ -453,9 +387,6 @@ const TimeSelector = class {
|
|
|
453
387
|
setTimeout(() => {
|
|
454
388
|
this.scrollSelectedItem("hour");
|
|
455
389
|
this.scrollSelectedItem("minute");
|
|
456
|
-
if (this.timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
457
|
-
this.scrollSelectedItem("second");
|
|
458
|
-
}
|
|
459
390
|
if (this.timePeriod === "12") {
|
|
460
391
|
this.scrollSelectedItem("period");
|
|
461
392
|
}
|
|
@@ -478,14 +409,6 @@ const TimeSelector = class {
|
|
|
478
409
|
else if (this.min) {
|
|
479
410
|
this.scrollMinTime("minute");
|
|
480
411
|
}
|
|
481
|
-
if (this.timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
482
|
-
if (this.selectedSecond !== undefined && this.selectedSecond !== null) {
|
|
483
|
-
this.scrollSelectedItem("second");
|
|
484
|
-
}
|
|
485
|
-
else if (this.min) {
|
|
486
|
-
this.scrollMinTime("second");
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
412
|
if (this.timePeriod === "12") {
|
|
490
413
|
if (this.selectedPeriod !== undefined && this.selectedPeriod !== null) {
|
|
491
414
|
this.scrollSelectedItem("period");
|
|
@@ -503,8 +426,6 @@ const TimeSelector = class {
|
|
|
503
426
|
return "HH";
|
|
504
427
|
case "minute":
|
|
505
428
|
return "MM";
|
|
506
|
-
case "second":
|
|
507
|
-
return "SS";
|
|
508
429
|
default:
|
|
509
430
|
return "";
|
|
510
431
|
}
|
|
@@ -517,17 +438,17 @@ const TimeSelector = class {
|
|
|
517
438
|
if (typeof time === "string") {
|
|
518
439
|
const zuluMatch = time.match(/^([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.[0-9]{1,3})?Z?$/);
|
|
519
440
|
if (zuluMatch) {
|
|
520
|
-
this.setTimeParts(Number(zuluMatch[1]), Number(zuluMatch[2])
|
|
441
|
+
this.setTimeParts(Number(zuluMatch[1]), Number(zuluMatch[2]));
|
|
521
442
|
}
|
|
522
443
|
else {
|
|
523
444
|
const parts = time.split(":");
|
|
524
|
-
this.setTimeParts(Number(parts[0]) || 0, Number(parts[1]) || 0
|
|
445
|
+
this.setTimeParts(Number(parts[0]) || 0, Number(parts[1]) || 0);
|
|
525
446
|
}
|
|
526
447
|
}
|
|
527
448
|
else {
|
|
528
449
|
const { parts } = helpers.parseTimeHelper(time);
|
|
529
450
|
if (parts) {
|
|
530
|
-
this.setTimeParts(parts.hour, parts.minute
|
|
451
|
+
this.setTimeParts(parts.hour, parts.minute);
|
|
531
452
|
}
|
|
532
453
|
}
|
|
533
454
|
}
|
|
@@ -590,18 +511,16 @@ const TimeSelector = class {
|
|
|
590
511
|
if (!col)
|
|
591
512
|
return;
|
|
592
513
|
const items = col.querySelectorAll(ITEM_CLASS);
|
|
593
|
-
let minHour = 0, minMinute = 0
|
|
514
|
+
let minHour = 0, minMinute = 0;
|
|
594
515
|
if (this.minTime) {
|
|
595
516
|
minHour = this.minTime.getHours() + 2;
|
|
596
517
|
minMinute = this.minTime.getMinutes() + 2;
|
|
597
|
-
minSecond = this.minTime.getSeconds();
|
|
598
518
|
}
|
|
599
519
|
else if (this.min) {
|
|
600
520
|
const minDate = helpers.parseTimeHelper(this.min).date;
|
|
601
521
|
if (minDate) {
|
|
602
522
|
minHour = minDate.getHours();
|
|
603
523
|
minMinute = minDate.getMinutes();
|
|
604
|
-
minSecond = minDate.getSeconds();
|
|
605
524
|
}
|
|
606
525
|
}
|
|
607
526
|
let targetIdx = -1;
|
|
@@ -612,9 +531,6 @@ const TimeSelector = class {
|
|
|
612
531
|
else if (colClass === "minute") {
|
|
613
532
|
targetIdx = values.findIndex((v) => v === minMinute);
|
|
614
533
|
}
|
|
615
|
-
else if (colClass === "second") {
|
|
616
|
-
targetIdx = values.findIndex((v) => v === minSecond);
|
|
617
|
-
}
|
|
618
534
|
else if (colClass === "period") {
|
|
619
535
|
let period = "AM";
|
|
620
536
|
if (this.timePeriod === "12") {
|
|
@@ -668,22 +584,18 @@ const TimeSelector = class {
|
|
|
668
584
|
: Array.from({ length: 24 }, (_, i) => i);
|
|
669
585
|
if (type === "minute")
|
|
670
586
|
return this.minutes;
|
|
671
|
-
if (type === "second")
|
|
672
|
-
return this.seconds;
|
|
673
587
|
if (type === "period")
|
|
674
588
|
return this.periods;
|
|
675
589
|
return [];
|
|
676
590
|
}
|
|
677
591
|
getSelectedValue(type) {
|
|
678
|
-
var _a, _b, _c
|
|
592
|
+
var _a, _b, _c;
|
|
679
593
|
if (type === "hour")
|
|
680
594
|
return (_a = this.selectedHour) !== null && _a !== void 0 ? _a : null;
|
|
681
595
|
if (type === "minute")
|
|
682
596
|
return (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : null;
|
|
683
|
-
if (type === "second")
|
|
684
|
-
return (_c = this.selectedSecond) !== null && _c !== void 0 ? _c : null;
|
|
685
597
|
if (type === "period")
|
|
686
|
-
return (
|
|
598
|
+
return (_c = this.selectedPeriod) !== null && _c !== void 0 ? _c : null;
|
|
687
599
|
return null;
|
|
688
600
|
}
|
|
689
601
|
getHighlightedValue(type, col) {
|
|
@@ -707,7 +619,7 @@ const TimeSelector = class {
|
|
|
707
619
|
const key = item.getAttribute("key");
|
|
708
620
|
if (key) {
|
|
709
621
|
const valStr = key.replace(`${type}-val-`, "");
|
|
710
|
-
if (type === "hour" || type === "minute"
|
|
622
|
+
if (type === "hour" || type === "minute") {
|
|
711
623
|
return Number(valStr);
|
|
712
624
|
}
|
|
713
625
|
else {
|
|
@@ -715,7 +627,7 @@ const TimeSelector = class {
|
|
|
715
627
|
}
|
|
716
628
|
}
|
|
717
629
|
const text = (_c = item.textContent) === null || _c === void 0 ? void 0 : _c.trim();
|
|
718
|
-
if (type === "hour" || type === "minute"
|
|
630
|
+
if (type === "hour" || type === "minute") {
|
|
719
631
|
return text ? Number(text) : null;
|
|
720
632
|
}
|
|
721
633
|
else {
|
|
@@ -732,87 +644,56 @@ const TimeSelector = class {
|
|
|
732
644
|
const minuteStr = this.selectedMinute != null
|
|
733
645
|
? this.selectedMinute.toString().padStart(2, "0")
|
|
734
646
|
: null;
|
|
735
|
-
const secondStr = this.selectedSecond != null
|
|
736
|
-
? this.selectedSecond.toString().padStart(2, "0")
|
|
737
|
-
: null;
|
|
738
647
|
let timeString = "";
|
|
739
648
|
let allSelected = false;
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
(this.selectedPeriod ? " " + this.selectedPeriod : "");
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
else if (this.timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
751
|
-
allSelected =
|
|
752
|
-
hourStr !== null && minuteStr !== null && secondStr !== null;
|
|
753
|
-
if (allSelected) {
|
|
754
|
-
timeString =
|
|
755
|
-
hourStr +
|
|
756
|
-
":" +
|
|
757
|
-
minuteStr +
|
|
758
|
-
":" +
|
|
759
|
-
secondStr +
|
|
760
|
-
(this.selectedPeriod ? " " + this.selectedPeriod : "");
|
|
761
|
-
}
|
|
649
|
+
allSelected = hourStr !== null && minuteStr !== null;
|
|
650
|
+
if (allSelected) {
|
|
651
|
+
timeString =
|
|
652
|
+
hourStr +
|
|
653
|
+
":" +
|
|
654
|
+
minuteStr +
|
|
655
|
+
(this.selectedPeriod ? " " + this.selectedPeriod : "");
|
|
762
656
|
}
|
|
763
657
|
this.ariaLiveMessage =
|
|
764
658
|
allSelected && timeString ? `Selected time: ${timeString}` : "";
|
|
765
659
|
}
|
|
766
660
|
render() {
|
|
767
|
-
var _a, _b, _c
|
|
661
|
+
var _a, _b, _c;
|
|
768
662
|
const hours = this.timePeriod === "12"
|
|
769
663
|
? Array.from({ length: 12 }, (_, i) => i + 1)
|
|
770
664
|
: Array.from({ length: 24 }, (_, i) => i);
|
|
771
|
-
const timeFormat = this.timeFormat || this.DEFAULT_TIME_FORMAT;
|
|
772
665
|
const columns = [
|
|
773
666
|
this.renderColumn("hour", hours, (_a = this.selectedHour) !== null && _a !== void 0 ? _a : null),
|
|
774
667
|
this.renderColumn("minute", this.minutes, (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : null),
|
|
775
668
|
];
|
|
776
|
-
if (timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
777
|
-
columns.push(this.renderColumn("second", this.seconds, (_c = this.selectedSecond) !== null && _c !== void 0 ? _c : null));
|
|
778
|
-
}
|
|
779
669
|
let colonSelectedStates = [];
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
this.selectedMinute !== undefined && this.selectedSecond !== undefined,
|
|
784
|
-
];
|
|
785
|
-
}
|
|
786
|
-
else {
|
|
787
|
-
colonSelectedStates = [
|
|
788
|
-
this.selectedHour !== undefined && this.selectedMinute !== undefined,
|
|
789
|
-
];
|
|
790
|
-
}
|
|
670
|
+
colonSelectedStates = [
|
|
671
|
+
this.selectedHour !== undefined && this.selectedMinute !== undefined,
|
|
672
|
+
];
|
|
791
673
|
const isInPicker = this.el.closest("ic-time-picker") !== null;
|
|
792
674
|
const { size, theme, timePeriod } = this;
|
|
793
|
-
return (index.h(index.Host, { key: '
|
|
675
|
+
return (index.h(index.Host, { key: 'af65b8999b8c677a6ef2e33fe167fb5b333f0571', class: {
|
|
794
676
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
795
677
|
[`ic-time-selector-${size}`]: true,
|
|
796
|
-
} }, index.h("div", { key: '
|
|
678
|
+
} }, index.h("div", { key: 'c345308cda9bc9b1a6e20ad7b1969c8e1b173efa', role: isInPicker ? "dialog" : undefined, "aria-modal": isInPicker ? true : undefined, "aria-label": "Select time. Use arrow keys to navigate and select the options and then tab to move onto the next selection.", class: {
|
|
797
679
|
"ic-time-selector-dialog-container": true,
|
|
798
|
-
} }, index.h("div", { key: '
|
|
680
|
+
} }, index.h("div", { key: '85f4f862ec0a9263e491e45dc4cacac69854d5d6', class: "ic-time-selector-highlight-lines" }, index.h("div", { key: 'd5175185db4049b2660ec4b81971ac13b9b307cb', class: "ic-time-selector-header-border" }), index.h("div", { key: 'b1be244ff1cdd68b33dad814f501c4e5c8486318', class: {
|
|
799
681
|
"ic-time-selector-highlight": true,
|
|
800
682
|
"ic-time-selector-highlight-top": true,
|
|
801
|
-
} }), index.h("div", { key: '
|
|
683
|
+
} }), index.h("div", { key: 'ec20a6536aa67a4dbc96f29ef42d424a0342ebe8', class: "ic-time-selector-columns" }, columns.map((col, idx) => [
|
|
802
684
|
col,
|
|
803
685
|
idx < columns.length - 1 ? (index.h("ic-typography", { class: {
|
|
804
686
|
"ic-time-selector-colon": true,
|
|
805
687
|
"ic-time-selector-colon-selected": colonSelectedStates[idx],
|
|
806
688
|
}, variant: "subtitle-small", "aria-hidden": "true", key: `colon-${idx}` }, ":")) : null,
|
|
807
689
|
]), timePeriod !== "24" &&
|
|
808
|
-
this.renderColumn("period", this.periods, (
|
|
690
|
+
this.renderColumn("period", this.periods, (_c = this.selectedPeriod) !== null && _c !== void 0 ? _c : null)), index.h("div", { key: '72b1abb5e7f19bf853b208dca7365c57b397d9f6', class: {
|
|
809
691
|
"ic-time-selector-highlight": true,
|
|
810
692
|
"ic-time-selector-highlight-bottom": true,
|
|
811
|
-
} })), index.h("div", { key: '
|
|
693
|
+
} })), index.h("div", { key: '2b8125333fd8e8d119d3496cb690a9c3d3711cb7', class: "ic-time-selector-actions" }, index.h("ic-button", { key: '5cd3db3be7006940e8e8ed8c2e823c384e6a677c', variant: "icon-tertiary", "aria-label": "Clear time", class: {
|
|
812
694
|
"ic-time-selector-clear-btn": true,
|
|
813
695
|
}, onClick: this.handleClear, disabled: this.selectedHour === undefined &&
|
|
814
696
|
this.selectedMinute === undefined &&
|
|
815
|
-
this.selectedSecond === undefined &&
|
|
816
697
|
this.selectedPeriod === undefined, size: size, tabIndex: 0, onKeyDown: (e) => {
|
|
817
698
|
var _a;
|
|
818
699
|
if (e.key === "Tab" && e.shiftKey) {
|
|
@@ -823,10 +704,9 @@ const TimeSelector = class {
|
|
|
823
704
|
lastCol === null || lastCol === void 0 ? void 0 : lastCol.focus();
|
|
824
705
|
}
|
|
825
706
|
}
|
|
826
|
-
} }, index.h("span", { key: '
|
|
707
|
+
} }, index.h("span", { key: '4c6383f537d199e7d282d0dc5f4d8eac30c86e47', "aria-hidden": "true", innerHTML: Clear })), index.h("ic-button", { key: '021b111b463ddb83d4449fb2c77cf27c972c04b7', variant: "icon-tertiary", "aria-label": "Select time", class: "ic-time-selector-check-btn", onClick: this.handleConfirmClick, disabled: this.selectedHour === undefined &&
|
|
827
708
|
this.selectedMinute === undefined &&
|
|
828
|
-
this.
|
|
829
|
-
this.selectedPeriod === undefined, size: size, tabIndex: 0 }, index.h("span", { key: 'f586f8d1b2659d3cf2f0f8e7365ebcd9828ebf23', "aria-hidden": "true", innerHTML: Check })))), index.h("div", { key: '27dd2db88615040635a0b61b9e785d50a488d90a', class: "sr-only", "aria-live": "polite" }, this.ariaLiveMessage)));
|
|
709
|
+
this.selectedPeriod === undefined, size: size, tabIndex: 0 }, index.h("span", { key: '95ba008a5b36459cba5d972dee1356f8c0194297', "aria-hidden": "true", innerHTML: Check })))), index.h("div", { key: '266f4b6084ff8530d3832eee59546af9419eb7a3', class: "sr-only", "aria-live": "polite" }, this.ariaLiveMessage)));
|
|
830
710
|
}
|
|
831
711
|
get el() { return index.getElement(this); }
|
|
832
712
|
static get watchers() { return {
|