@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
|
@@ -16,22 +16,20 @@ const Clear = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill=
|
|
|
16
16
|
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}}";
|
|
17
17
|
const IcTimeSelectorStyle0 = icTimeSelectorCss;
|
|
18
18
|
|
|
19
|
-
const COLUMN_TYPES = ["hour", "minute", "
|
|
19
|
+
const COLUMN_TYPES = ["hour", "minute", "period"];
|
|
20
20
|
const COLUMN_CLASS = ".ic-time-selector-column";
|
|
21
21
|
const ITEM_CLASS = ".ic-time-selector-item";
|
|
22
22
|
const TimeSelector = class {
|
|
23
23
|
constructor(hostRef) {
|
|
24
24
|
registerInstance(this, hostRef);
|
|
25
25
|
this.icChange = createEvent(this, "icChange", 7);
|
|
26
|
-
this.DEFAULT_TIME_FORMAT = "HH:MM:SS";
|
|
27
26
|
this.minutes = Array.from({ length: 60 }, (_, i) => i);
|
|
28
|
-
this.seconds = Array.from({ length: 60 }, (_, i) => i);
|
|
29
27
|
this.periods = ["AM", "PM"];
|
|
30
28
|
this.minTime = null;
|
|
31
29
|
this.maxTime = null;
|
|
32
30
|
this.ariaLiveMessage = "";
|
|
33
31
|
/**
|
|
34
|
-
* An array of
|
|
32
|
+
* 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.
|
|
35
33
|
*/
|
|
36
34
|
this.disableTimes = [];
|
|
37
35
|
/**
|
|
@@ -50,10 +48,6 @@ const TimeSelector = class {
|
|
|
50
48
|
* 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.
|
|
51
49
|
*/
|
|
52
50
|
this.theme = "inherit";
|
|
53
|
-
/**
|
|
54
|
-
* The format in which the time will be displayed.
|
|
55
|
-
*/
|
|
56
|
-
this.timeFormat = this.DEFAULT_TIME_FORMAT;
|
|
57
51
|
/**
|
|
58
52
|
* The time period format: "12" for 12-hour, "24" for 24-hour. Defaults to "24".
|
|
59
53
|
*/
|
|
@@ -62,7 +56,7 @@ const TimeSelector = class {
|
|
|
62
56
|
* 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.
|
|
63
57
|
*/
|
|
64
58
|
this.value = "";
|
|
65
|
-
this.setTimeParts = (hour, minute
|
|
59
|
+
this.setTimeParts = (hour, minute) => {
|
|
66
60
|
let period = "AM";
|
|
67
61
|
if (this.timePeriod === "12") {
|
|
68
62
|
if (hour === 0) {
|
|
@@ -86,7 +80,6 @@ const TimeSelector = class {
|
|
|
86
80
|
this.selectedHour = hour;
|
|
87
81
|
}
|
|
88
82
|
this.selectedMinute = minute;
|
|
89
|
-
this.selectedSecond = second;
|
|
90
83
|
};
|
|
91
84
|
this.checkIfScrollIsFinished = (column, scrollTop) => {
|
|
92
85
|
const isScrollFinished = setInterval(() => {
|
|
@@ -106,9 +99,6 @@ const TimeSelector = class {
|
|
|
106
99
|
case "minute":
|
|
107
100
|
this.selectedMinute = Number(value);
|
|
108
101
|
break;
|
|
109
|
-
case "second":
|
|
110
|
-
this.selectedSecond = Number(value);
|
|
111
|
-
break;
|
|
112
102
|
case "period":
|
|
113
103
|
this.selectedPeriod = value;
|
|
114
104
|
break;
|
|
@@ -129,25 +119,16 @@ const TimeSelector = class {
|
|
|
129
119
|
this.lastAnnouncedValue = this.getSelectedValue(type);
|
|
130
120
|
}
|
|
131
121
|
};
|
|
132
|
-
this.isTimeDisabled = (hour, minute,
|
|
133
|
-
var _a, _b
|
|
122
|
+
this.isTimeDisabled = (hour, minute, type) => {
|
|
123
|
+
var _a, _b;
|
|
134
124
|
for (const t of this.disableTimes) {
|
|
135
|
-
if (typeof t === "
|
|
136
|
-
const parts = parseTimeHelper(t).parts;
|
|
137
|
-
if (parts &&
|
|
138
|
-
parts.hour === hour &&
|
|
139
|
-
parts.minute === minute &&
|
|
140
|
-
parts.second === second) {
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
else if (t && typeof t === "object" && "start" in t && "end" in t) {
|
|
125
|
+
if (t && typeof t === "object" && "start" in t && "end" in t) {
|
|
145
126
|
const startParts = parseTimeHelper(t.start).parts;
|
|
146
127
|
const endParts = parseTimeHelper(t.end).parts;
|
|
147
128
|
if (startParts && endParts) {
|
|
148
|
-
const timeVal = hour * 3600 + minute * 60
|
|
149
|
-
const startVal = startParts.hour * 3600 + startParts.minute * 60
|
|
150
|
-
const endVal = endParts.hour * 3600 + endParts.minute * 60
|
|
129
|
+
const timeVal = hour * 3600 + minute * 60;
|
|
130
|
+
const startVal = startParts.hour * 3600 + startParts.minute * 60;
|
|
131
|
+
const endVal = endParts.hour * 3600 + endParts.minute * 60;
|
|
151
132
|
if (timeVal >= startVal && timeVal <= endVal) {
|
|
152
133
|
return true;
|
|
153
134
|
}
|
|
@@ -159,15 +140,11 @@ const TimeSelector = class {
|
|
|
159
140
|
if (this.minTime) {
|
|
160
141
|
const minHour = this.minTime.getHours();
|
|
161
142
|
const minMinute = this.minTime.getMinutes();
|
|
162
|
-
const minSecond = this.minTime.getSeconds();
|
|
163
143
|
if (type === "hour") {
|
|
164
144
|
const highlightedMinute = (_a = this.selectedMinute) !== null && _a !== void 0 ? _a : minMinute;
|
|
165
|
-
const highlightedSecond = (_b = this.selectedSecond) !== null && _b !== void 0 ? _b : minSecond;
|
|
166
145
|
if (hour < minHour ||
|
|
167
146
|
(hour === minHour && highlightedMinute < minMinute) ||
|
|
168
|
-
(hour === minHour &&
|
|
169
|
-
highlightedMinute === minMinute &&
|
|
170
|
-
highlightedSecond < minSecond)) {
|
|
147
|
+
(hour === minHour && highlightedMinute === minMinute)) {
|
|
171
148
|
return true;
|
|
172
149
|
}
|
|
173
150
|
}
|
|
@@ -176,15 +153,10 @@ const TimeSelector = class {
|
|
|
176
153
|
return true;
|
|
177
154
|
}
|
|
178
155
|
}
|
|
179
|
-
else if (type === "second") {
|
|
180
|
-
if (hour === minHour && minute === minMinute && second < minSecond) {
|
|
181
|
-
return true;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
156
|
else {
|
|
185
157
|
if (hour < minHour ||
|
|
186
158
|
(hour === minHour && minute < minMinute) ||
|
|
187
|
-
(hour === minHour && minute === minMinute
|
|
159
|
+
(hour === minHour && minute === minMinute)) {
|
|
188
160
|
return true;
|
|
189
161
|
}
|
|
190
162
|
}
|
|
@@ -195,15 +167,11 @@ const TimeSelector = class {
|
|
|
195
167
|
if (this.maxTime) {
|
|
196
168
|
const maxHour = this.maxTime.getHours();
|
|
197
169
|
const maxMinute = this.maxTime.getMinutes();
|
|
198
|
-
const maxSecond = this.maxTime.getSeconds();
|
|
199
170
|
if (type === "hour") {
|
|
200
|
-
const selectedMinute = (
|
|
201
|
-
const selectedSecond = (_d = this.selectedSecond) !== null && _d !== void 0 ? _d : 59;
|
|
171
|
+
const selectedMinute = (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : 59;
|
|
202
172
|
if (hour > maxHour ||
|
|
203
173
|
(hour === maxHour && selectedMinute > maxMinute) ||
|
|
204
|
-
(hour === maxHour &&
|
|
205
|
-
selectedMinute === maxMinute &&
|
|
206
|
-
selectedSecond > maxSecond)) {
|
|
174
|
+
(hour === maxHour && selectedMinute === maxMinute)) {
|
|
207
175
|
return true;
|
|
208
176
|
}
|
|
209
177
|
}
|
|
@@ -212,15 +180,10 @@ const TimeSelector = class {
|
|
|
212
180
|
return true;
|
|
213
181
|
}
|
|
214
182
|
}
|
|
215
|
-
else if (type === "second") {
|
|
216
|
-
if (hour === maxHour && minute === maxMinute && second > maxSecond) {
|
|
217
|
-
return true;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
183
|
else {
|
|
221
184
|
if (hour > maxHour ||
|
|
222
185
|
(hour === maxHour && minute > maxMinute) ||
|
|
223
|
-
(hour === maxHour && minute === maxMinute
|
|
186
|
+
(hour === maxHour && minute === maxMinute)) {
|
|
224
187
|
return true;
|
|
225
188
|
}
|
|
226
189
|
}
|
|
@@ -302,18 +265,15 @@ const TimeSelector = class {
|
|
|
302
265
|
} while (newIdx >= 0 &&
|
|
303
266
|
newIdx <= maxIdx &&
|
|
304
267
|
(() => {
|
|
305
|
-
var _a, _b
|
|
306
|
-
if (type === "hour" || type === "minute"
|
|
268
|
+
var _a, _b;
|
|
269
|
+
if (type === "hour" || type === "minute") {
|
|
307
270
|
const hour = type === "hour"
|
|
308
271
|
? values[newIdx]
|
|
309
272
|
: (_a = this.selectedHour) !== null && _a !== void 0 ? _a : 0;
|
|
310
273
|
const minute = type === "minute"
|
|
311
274
|
? values[newIdx]
|
|
312
275
|
: (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : 0;
|
|
313
|
-
|
|
314
|
-
? values[newIdx]
|
|
315
|
-
: (_c = this.selectedSecond) !== null && _c !== void 0 ? _c : 0;
|
|
316
|
-
return this.isTimeDisabled(hour, minute, second);
|
|
276
|
+
return this.isTimeDisabled(hour, minute);
|
|
317
277
|
}
|
|
318
278
|
return false;
|
|
319
279
|
})());
|
|
@@ -328,7 +288,7 @@ const TimeSelector = class {
|
|
|
328
288
|
}
|
|
329
289
|
};
|
|
330
290
|
this.renderColumn = (type, values, selected) => {
|
|
331
|
-
const isTimeColumn = type === "hour" || type === "minute"
|
|
291
|
+
const isTimeColumn = type === "hour" || type === "minute";
|
|
332
292
|
const isPeriodColumn = type === "period";
|
|
333
293
|
const headerLabel = this.getHeaderLabel(type);
|
|
334
294
|
const topSpacerCount = 2;
|
|
@@ -343,17 +303,14 @@ const TimeSelector = class {
|
|
|
343
303
|
"ic-time-selector-column": true,
|
|
344
304
|
"ic-time-selector-column-period": isPeriodColumn,
|
|
345
305
|
}, tabIndex: 0, onKeyDown: (e) => this.handleColumnKeyDown(type, e) }, h("ul", { class: "ic-time-selector-list", role: "listbox", "aria-label": type }, this.renderScrollRows(topSpacerCount, `${type}-top-spacer`), values.map((val) => {
|
|
346
|
-
var _a, _b
|
|
306
|
+
var _a, _b;
|
|
347
307
|
let disabled = false;
|
|
348
308
|
if (isTimeColumn) {
|
|
349
309
|
const hour = type === "hour" ? val : (_a = this.selectedHour) !== null && _a !== void 0 ? _a : 0;
|
|
350
310
|
const minute = type === "minute"
|
|
351
311
|
? val
|
|
352
312
|
: (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : 0;
|
|
353
|
-
|
|
354
|
-
? val
|
|
355
|
-
: (_c = this.selectedSecond) !== null && _c !== void 0 ? _c : 0;
|
|
356
|
-
disabled = this.isTimeDisabled(hour, minute, second, type);
|
|
313
|
+
disabled = this.isTimeDisabled(hour, minute, type);
|
|
357
314
|
}
|
|
358
315
|
return (h("li", { class: {
|
|
359
316
|
"ic-time-selector-item": true,
|
|
@@ -370,8 +327,6 @@ const TimeSelector = class {
|
|
|
370
327
|
this.scrollSelectedItem("hour", true);
|
|
371
328
|
this.selectedMinute = undefined;
|
|
372
329
|
this.scrollSelectedItem("minute", true);
|
|
373
|
-
this.selectedSecond = undefined;
|
|
374
|
-
this.scrollSelectedItem("second", true);
|
|
375
330
|
this.selectedPeriod = undefined;
|
|
376
331
|
this.scrollSelectedItem("period", true);
|
|
377
332
|
this.lastAnnouncedType = undefined;
|
|
@@ -382,7 +337,6 @@ const TimeSelector = class {
|
|
|
382
337
|
timeObject: {
|
|
383
338
|
hour: null,
|
|
384
339
|
minute: null,
|
|
385
|
-
second: null,
|
|
386
340
|
period: undefined,
|
|
387
341
|
},
|
|
388
342
|
});
|
|
@@ -390,18 +344,11 @@ const TimeSelector = class {
|
|
|
390
344
|
this.handleConfirmClick = () => {
|
|
391
345
|
const hour = this.selectedHour != null ? this.selectedHour : null;
|
|
392
346
|
const minute = this.selectedMinute != null ? this.selectedMinute : null;
|
|
393
|
-
const second = this.selectedSecond != null ? this.selectedSecond : null;
|
|
394
347
|
const period = this.selectedPeriod;
|
|
395
348
|
const hourStr = hour != null ? hour.toString().padStart(2, "0") : null;
|
|
396
349
|
const minuteStr = minute != null ? minute.toString().padStart(2, "0") : null;
|
|
397
|
-
const secondStr = second != null ? second.toString().padStart(2, "0") : null;
|
|
398
350
|
let allSelected = false;
|
|
399
|
-
|
|
400
|
-
allSelected = hour !== null && minute !== null && second !== null;
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
allSelected = hour !== null && minute !== null;
|
|
404
|
-
}
|
|
351
|
+
allSelected = hour !== null && minute !== null;
|
|
405
352
|
let value = null;
|
|
406
353
|
let timeString = null;
|
|
407
354
|
if (allSelected) {
|
|
@@ -415,26 +362,13 @@ const TimeSelector = class {
|
|
|
415
362
|
value = new Date();
|
|
416
363
|
value.setHours(date24hours !== null && date24hours !== void 0 ? date24hours : 0);
|
|
417
364
|
value.setMinutes(minute !== null && minute !== void 0 ? minute : 0);
|
|
418
|
-
|
|
419
|
-
value.setMilliseconds(0);
|
|
420
|
-
if (this.timeFormat === "HH:MM") {
|
|
421
|
-
timeString = hourStr + ":" + minuteStr + (period ? " " + period : "");
|
|
422
|
-
}
|
|
423
|
-
else if (this.timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
424
|
-
timeString =
|
|
425
|
-
hourStr +
|
|
426
|
-
":" +
|
|
427
|
-
minuteStr +
|
|
428
|
-
":" +
|
|
429
|
-
secondStr +
|
|
430
|
-
(period ? " " + period : "");
|
|
431
|
-
}
|
|
365
|
+
timeString = hourStr + ":" + minuteStr + (period ? " " + period : "");
|
|
432
366
|
this.value = value;
|
|
433
367
|
}
|
|
434
368
|
this.icChange.emit({
|
|
435
369
|
value: allSelected ? value : null,
|
|
436
370
|
timeString: allSelected ? timeString : null,
|
|
437
|
-
timeObject: Object.assign({ hour: hourStr, minute: minuteStr
|
|
371
|
+
timeObject: Object.assign({ hour: hourStr, minute: minuteStr }, (period ? { period } : {})),
|
|
438
372
|
});
|
|
439
373
|
};
|
|
440
374
|
}
|
|
@@ -449,9 +383,6 @@ const TimeSelector = class {
|
|
|
449
383
|
setTimeout(() => {
|
|
450
384
|
this.scrollSelectedItem("hour");
|
|
451
385
|
this.scrollSelectedItem("minute");
|
|
452
|
-
if (this.timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
453
|
-
this.scrollSelectedItem("second");
|
|
454
|
-
}
|
|
455
386
|
if (this.timePeriod === "12") {
|
|
456
387
|
this.scrollSelectedItem("period");
|
|
457
388
|
}
|
|
@@ -474,14 +405,6 @@ const TimeSelector = class {
|
|
|
474
405
|
else if (this.min) {
|
|
475
406
|
this.scrollMinTime("minute");
|
|
476
407
|
}
|
|
477
|
-
if (this.timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
478
|
-
if (this.selectedSecond !== undefined && this.selectedSecond !== null) {
|
|
479
|
-
this.scrollSelectedItem("second");
|
|
480
|
-
}
|
|
481
|
-
else if (this.min) {
|
|
482
|
-
this.scrollMinTime("second");
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
408
|
if (this.timePeriod === "12") {
|
|
486
409
|
if (this.selectedPeriod !== undefined && this.selectedPeriod !== null) {
|
|
487
410
|
this.scrollSelectedItem("period");
|
|
@@ -499,8 +422,6 @@ const TimeSelector = class {
|
|
|
499
422
|
return "HH";
|
|
500
423
|
case "minute":
|
|
501
424
|
return "MM";
|
|
502
|
-
case "second":
|
|
503
|
-
return "SS";
|
|
504
425
|
default:
|
|
505
426
|
return "";
|
|
506
427
|
}
|
|
@@ -513,17 +434,17 @@ const TimeSelector = class {
|
|
|
513
434
|
if (typeof time === "string") {
|
|
514
435
|
const zuluMatch = time.match(/^([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.[0-9]{1,3})?Z?$/);
|
|
515
436
|
if (zuluMatch) {
|
|
516
|
-
this.setTimeParts(Number(zuluMatch[1]), Number(zuluMatch[2])
|
|
437
|
+
this.setTimeParts(Number(zuluMatch[1]), Number(zuluMatch[2]));
|
|
517
438
|
}
|
|
518
439
|
else {
|
|
519
440
|
const parts = time.split(":");
|
|
520
|
-
this.setTimeParts(Number(parts[0]) || 0, Number(parts[1]) || 0
|
|
441
|
+
this.setTimeParts(Number(parts[0]) || 0, Number(parts[1]) || 0);
|
|
521
442
|
}
|
|
522
443
|
}
|
|
523
444
|
else {
|
|
524
445
|
const { parts } = parseTimeHelper(time);
|
|
525
446
|
if (parts) {
|
|
526
|
-
this.setTimeParts(parts.hour, parts.minute
|
|
447
|
+
this.setTimeParts(parts.hour, parts.minute);
|
|
527
448
|
}
|
|
528
449
|
}
|
|
529
450
|
}
|
|
@@ -586,18 +507,16 @@ const TimeSelector = class {
|
|
|
586
507
|
if (!col)
|
|
587
508
|
return;
|
|
588
509
|
const items = col.querySelectorAll(ITEM_CLASS);
|
|
589
|
-
let minHour = 0, minMinute = 0
|
|
510
|
+
let minHour = 0, minMinute = 0;
|
|
590
511
|
if (this.minTime) {
|
|
591
512
|
minHour = this.minTime.getHours() + 2;
|
|
592
513
|
minMinute = this.minTime.getMinutes() + 2;
|
|
593
|
-
minSecond = this.minTime.getSeconds();
|
|
594
514
|
}
|
|
595
515
|
else if (this.min) {
|
|
596
516
|
const minDate = parseTimeHelper(this.min).date;
|
|
597
517
|
if (minDate) {
|
|
598
518
|
minHour = minDate.getHours();
|
|
599
519
|
minMinute = minDate.getMinutes();
|
|
600
|
-
minSecond = minDate.getSeconds();
|
|
601
520
|
}
|
|
602
521
|
}
|
|
603
522
|
let targetIdx = -1;
|
|
@@ -608,9 +527,6 @@ const TimeSelector = class {
|
|
|
608
527
|
else if (colClass === "minute") {
|
|
609
528
|
targetIdx = values.findIndex((v) => v === minMinute);
|
|
610
529
|
}
|
|
611
|
-
else if (colClass === "second") {
|
|
612
|
-
targetIdx = values.findIndex((v) => v === minSecond);
|
|
613
|
-
}
|
|
614
530
|
else if (colClass === "period") {
|
|
615
531
|
let period = "AM";
|
|
616
532
|
if (this.timePeriod === "12") {
|
|
@@ -664,22 +580,18 @@ const TimeSelector = class {
|
|
|
664
580
|
: Array.from({ length: 24 }, (_, i) => i);
|
|
665
581
|
if (type === "minute")
|
|
666
582
|
return this.minutes;
|
|
667
|
-
if (type === "second")
|
|
668
|
-
return this.seconds;
|
|
669
583
|
if (type === "period")
|
|
670
584
|
return this.periods;
|
|
671
585
|
return [];
|
|
672
586
|
}
|
|
673
587
|
getSelectedValue(type) {
|
|
674
|
-
var _a, _b, _c
|
|
588
|
+
var _a, _b, _c;
|
|
675
589
|
if (type === "hour")
|
|
676
590
|
return (_a = this.selectedHour) !== null && _a !== void 0 ? _a : null;
|
|
677
591
|
if (type === "minute")
|
|
678
592
|
return (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : null;
|
|
679
|
-
if (type === "second")
|
|
680
|
-
return (_c = this.selectedSecond) !== null && _c !== void 0 ? _c : null;
|
|
681
593
|
if (type === "period")
|
|
682
|
-
return (
|
|
594
|
+
return (_c = this.selectedPeriod) !== null && _c !== void 0 ? _c : null;
|
|
683
595
|
return null;
|
|
684
596
|
}
|
|
685
597
|
getHighlightedValue(type, col) {
|
|
@@ -703,7 +615,7 @@ const TimeSelector = class {
|
|
|
703
615
|
const key = item.getAttribute("key");
|
|
704
616
|
if (key) {
|
|
705
617
|
const valStr = key.replace(`${type}-val-`, "");
|
|
706
|
-
if (type === "hour" || type === "minute"
|
|
618
|
+
if (type === "hour" || type === "minute") {
|
|
707
619
|
return Number(valStr);
|
|
708
620
|
}
|
|
709
621
|
else {
|
|
@@ -711,7 +623,7 @@ const TimeSelector = class {
|
|
|
711
623
|
}
|
|
712
624
|
}
|
|
713
625
|
const text = (_c = item.textContent) === null || _c === void 0 ? void 0 : _c.trim();
|
|
714
|
-
if (type === "hour" || type === "minute"
|
|
626
|
+
if (type === "hour" || type === "minute") {
|
|
715
627
|
return text ? Number(text) : null;
|
|
716
628
|
}
|
|
717
629
|
else {
|
|
@@ -728,87 +640,56 @@ const TimeSelector = class {
|
|
|
728
640
|
const minuteStr = this.selectedMinute != null
|
|
729
641
|
? this.selectedMinute.toString().padStart(2, "0")
|
|
730
642
|
: null;
|
|
731
|
-
const secondStr = this.selectedSecond != null
|
|
732
|
-
? this.selectedSecond.toString().padStart(2, "0")
|
|
733
|
-
: null;
|
|
734
643
|
let timeString = "";
|
|
735
644
|
let allSelected = false;
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
(this.selectedPeriod ? " " + this.selectedPeriod : "");
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
else if (this.timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
747
|
-
allSelected =
|
|
748
|
-
hourStr !== null && minuteStr !== null && secondStr !== null;
|
|
749
|
-
if (allSelected) {
|
|
750
|
-
timeString =
|
|
751
|
-
hourStr +
|
|
752
|
-
":" +
|
|
753
|
-
minuteStr +
|
|
754
|
-
":" +
|
|
755
|
-
secondStr +
|
|
756
|
-
(this.selectedPeriod ? " " + this.selectedPeriod : "");
|
|
757
|
-
}
|
|
645
|
+
allSelected = hourStr !== null && minuteStr !== null;
|
|
646
|
+
if (allSelected) {
|
|
647
|
+
timeString =
|
|
648
|
+
hourStr +
|
|
649
|
+
":" +
|
|
650
|
+
minuteStr +
|
|
651
|
+
(this.selectedPeriod ? " " + this.selectedPeriod : "");
|
|
758
652
|
}
|
|
759
653
|
this.ariaLiveMessage =
|
|
760
654
|
allSelected && timeString ? `Selected time: ${timeString}` : "";
|
|
761
655
|
}
|
|
762
656
|
render() {
|
|
763
|
-
var _a, _b, _c
|
|
657
|
+
var _a, _b, _c;
|
|
764
658
|
const hours = this.timePeriod === "12"
|
|
765
659
|
? Array.from({ length: 12 }, (_, i) => i + 1)
|
|
766
660
|
: Array.from({ length: 24 }, (_, i) => i);
|
|
767
|
-
const timeFormat = this.timeFormat || this.DEFAULT_TIME_FORMAT;
|
|
768
661
|
const columns = [
|
|
769
662
|
this.renderColumn("hour", hours, (_a = this.selectedHour) !== null && _a !== void 0 ? _a : null),
|
|
770
663
|
this.renderColumn("minute", this.minutes, (_b = this.selectedMinute) !== null && _b !== void 0 ? _b : null),
|
|
771
664
|
];
|
|
772
|
-
if (timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
773
|
-
columns.push(this.renderColumn("second", this.seconds, (_c = this.selectedSecond) !== null && _c !== void 0 ? _c : null));
|
|
774
|
-
}
|
|
775
665
|
let colonSelectedStates = [];
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
this.selectedMinute !== undefined && this.selectedSecond !== undefined,
|
|
780
|
-
];
|
|
781
|
-
}
|
|
782
|
-
else {
|
|
783
|
-
colonSelectedStates = [
|
|
784
|
-
this.selectedHour !== undefined && this.selectedMinute !== undefined,
|
|
785
|
-
];
|
|
786
|
-
}
|
|
666
|
+
colonSelectedStates = [
|
|
667
|
+
this.selectedHour !== undefined && this.selectedMinute !== undefined,
|
|
668
|
+
];
|
|
787
669
|
const isInPicker = this.el.closest("ic-time-picker") !== null;
|
|
788
670
|
const { size, theme, timePeriod } = this;
|
|
789
|
-
return (h(Host, { key: '
|
|
671
|
+
return (h(Host, { key: 'af65b8999b8c677a6ef2e33fe167fb5b333f0571', class: {
|
|
790
672
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
791
673
|
[`ic-time-selector-${size}`]: true,
|
|
792
|
-
} }, h("div", { key: '
|
|
674
|
+
} }, 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: {
|
|
793
675
|
"ic-time-selector-dialog-container": true,
|
|
794
|
-
} }, h("div", { key: '
|
|
676
|
+
} }, h("div", { key: '85f4f862ec0a9263e491e45dc4cacac69854d5d6', class: "ic-time-selector-highlight-lines" }, h("div", { key: 'd5175185db4049b2660ec4b81971ac13b9b307cb', class: "ic-time-selector-header-border" }), h("div", { key: 'b1be244ff1cdd68b33dad814f501c4e5c8486318', class: {
|
|
795
677
|
"ic-time-selector-highlight": true,
|
|
796
678
|
"ic-time-selector-highlight-top": true,
|
|
797
|
-
} }), h("div", { key: '
|
|
679
|
+
} }), h("div", { key: 'ec20a6536aa67a4dbc96f29ef42d424a0342ebe8', class: "ic-time-selector-columns" }, columns.map((col, idx) => [
|
|
798
680
|
col,
|
|
799
681
|
idx < columns.length - 1 ? (h("ic-typography", { class: {
|
|
800
682
|
"ic-time-selector-colon": true,
|
|
801
683
|
"ic-time-selector-colon-selected": colonSelectedStates[idx],
|
|
802
684
|
}, variant: "subtitle-small", "aria-hidden": "true", key: `colon-${idx}` }, ":")) : null,
|
|
803
685
|
]), timePeriod !== "24" &&
|
|
804
|
-
this.renderColumn("period", this.periods, (
|
|
686
|
+
this.renderColumn("period", this.periods, (_c = this.selectedPeriod) !== null && _c !== void 0 ? _c : null)), h("div", { key: '72b1abb5e7f19bf853b208dca7365c57b397d9f6', class: {
|
|
805
687
|
"ic-time-selector-highlight": true,
|
|
806
688
|
"ic-time-selector-highlight-bottom": true,
|
|
807
|
-
} })), h("div", { key: '
|
|
689
|
+
} })), h("div", { key: '2b8125333fd8e8d119d3496cb690a9c3d3711cb7', class: "ic-time-selector-actions" }, h("ic-button", { key: '5cd3db3be7006940e8e8ed8c2e823c384e6a677c', variant: "icon-tertiary", "aria-label": "Clear time", class: {
|
|
808
690
|
"ic-time-selector-clear-btn": true,
|
|
809
691
|
}, onClick: this.handleClear, disabled: this.selectedHour === undefined &&
|
|
810
692
|
this.selectedMinute === undefined &&
|
|
811
|
-
this.selectedSecond === undefined &&
|
|
812
693
|
this.selectedPeriod === undefined, size: size, tabIndex: 0, onKeyDown: (e) => {
|
|
813
694
|
var _a;
|
|
814
695
|
if (e.key === "Tab" && e.shiftKey) {
|
|
@@ -819,10 +700,9 @@ const TimeSelector = class {
|
|
|
819
700
|
lastCol === null || lastCol === void 0 ? void 0 : lastCol.focus();
|
|
820
701
|
}
|
|
821
702
|
}
|
|
822
|
-
} }, h("span", { key: '
|
|
703
|
+
} }, h("span", { key: '4c6383f537d199e7d282d0dc5f4d8eac30c86e47', "aria-hidden": "true", innerHTML: Clear })), 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 &&
|
|
823
704
|
this.selectedMinute === undefined &&
|
|
824
|
-
this.
|
|
825
|
-
this.selectedPeriod === undefined, size: size, tabIndex: 0 }, h("span", { key: 'f586f8d1b2659d3cf2f0f8e7365ebcd9828ebf23', "aria-hidden": "true", innerHTML: Check })))), h("div", { key: '27dd2db88615040635a0b61b9e785d50a488d90a', class: "sr-only", "aria-live": "polite" }, this.ariaLiveMessage)));
|
|
705
|
+
this.selectedPeriod === undefined, size: size, tabIndex: 0 }, h("span", { key: '95ba008a5b36459cba5d972dee1356f8c0194297', "aria-hidden": "true", innerHTML: Check })))), h("div", { key: '266f4b6084ff8530d3832eee59546af9419eb7a3', class: "sr-only", "aria-live": "polite" }, this.ariaLiveMessage)));
|
|
826
706
|
}
|
|
827
707
|
get el() { return getElement(this); }
|
|
828
708
|
static get watchers() { return {
|