@esri/solutions-components 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/buffer-tools_6.cjs.entry.js +8 -5
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +2 -2
- package/dist/cjs/calcite-input-message_5.cjs.entry.js +6 -4
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
- package/dist/cjs/{csvUtils-83af7ae1.js → csvUtils-34666909.js} +1 -1
- package/dist/cjs/{interfaces-772edf61.js → interfaces-17c631bf.js} +1 -1
- package/dist/cjs/layer-table.cjs.entry.js +3 -3
- package/dist/cjs/map-card.cjs.entry.js +1 -1
- package/dist/cjs/{mapViewUtils-55ac76cb.js → mapViewUtils-24d1d859.js} +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +16 -10
- package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
- package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
- package/dist/cjs/{solution-store-39726b81.js → solution-store-2dbab624.js} +1 -1
- package/dist/collection/components/buffer-tools/buffer-tools.js +2 -2
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +2 -1
- package/dist/collection/components/public-notification/public-notification.js +14 -8
- package/dist/collection/components/refine-selection/refine-selection.js +4 -2
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.css +1 -0
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +3 -1
- package/dist/collection/demos/new-public-notification.html +2 -1
- package/dist/collection/utils/interfaces.js +1 -1
- package/dist/collection/utils/interfaces.ts +2 -2
- package/dist/components/interfaces3.js +1 -1
- package/dist/components/map-draw-tools2.js +2 -1
- package/dist/components/public-notification.js +14 -8
- package/dist/components/refine-selection-tools2.js +4 -2
- package/dist/components/refine-selection2.js +4 -2
- package/dist/esm/buffer-tools_6.entry.js +8 -5
- package/dist/esm/calcite-combobox_3.entry.js +2 -2
- package/dist/esm/calcite-input-message_5.entry.js +6 -4
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
- package/dist/esm/{csvUtils-eb231cfb.js → csvUtils-ae3004b9.js} +1 -1
- package/dist/esm/{interfaces-3b23a5f9.js → interfaces-d0d83efa.js} +1 -1
- package/dist/esm/layer-table.entry.js +3 -3
- package/dist/esm/map-card.entry.js +1 -1
- package/dist/esm/{mapViewUtils-e5d8a1e1.js → mapViewUtils-541e7a3c.js} +1 -1
- package/dist/esm/public-notification.entry.js +16 -10
- package/dist/esm/solution-configuration.entry.js +2 -2
- package/dist/esm/solution-contents_3.entry.js +2 -2
- package/dist/esm/{solution-store-c0bf9200.js → solution-store-41e15f1c.js} +1 -1
- package/dist/solutions-components/demos/new-public-notification.html +2 -1
- package/dist/solutions-components/p-05e64bd1.js +498 -2
- package/dist/solutions-components/p-08a95b33.entry.js +138 -0
- package/dist/solutions-components/p-0da5bbdf.entry.js +91 -0
- package/dist/solutions-components/p-0ef91144.entry.js +913 -0
- package/dist/solutions-components/p-0f523243.entry.js +1916 -0
- package/dist/solutions-components/p-11b9510e.entry.js +173 -0
- package/dist/solutions-components/p-1b875d94.entry.js +58 -0
- package/dist/solutions-components/p-1c567f3a.js +23 -16
- package/dist/solutions-components/p-1c883db9.entry.js +43 -0
- package/dist/solutions-components/p-1f225056.js +322 -0
- package/dist/solutions-components/p-1f499e67.entry.js +72 -0
- package/dist/solutions-components/p-20d3d758.entry.js +881 -0
- package/dist/solutions-components/p-2274ac9e.entry.js +160 -0
- package/dist/solutions-components/p-23ec5ac5.entry.js +93 -0
- package/dist/solutions-components/p-2447798c.entry.js +155 -0
- package/dist/solutions-components/p-2525e691.entry.js +432 -0
- package/dist/solutions-components/p-2561f5b5.js +4092 -0
- package/dist/solutions-components/p-29f887c0.entry.js +234 -0
- package/dist/solutions-components/p-2a0d8047.entry.js +345 -0
- package/dist/solutions-components/p-2c177e6a.entry.js +101 -0
- package/dist/solutions-components/p-2e9ed892.js +46 -1
- package/dist/solutions-components/p-316f56db.js +219 -2
- package/dist/solutions-components/p-327f3ebf.entry.js +98 -0
- package/dist/solutions-components/p-356f8b54.entry.js +138 -0
- package/dist/solutions-components/p-359c58de.entry.js +172 -0
- package/dist/solutions-components/p-37336c0d.entry.js +116 -0
- package/dist/solutions-components/p-374a5031.js +105 -2
- package/dist/solutions-components/p-39ea6ef4.entry.js +71 -0
- package/dist/solutions-components/p-3b010ce1.js +17 -1
- package/dist/solutions-components/p-4307dacd.js +194 -1
- package/dist/solutions-components/p-44da2507.js +405 -14
- package/dist/solutions-components/p-46bdffe8.entry.js +54 -0
- package/dist/solutions-components/p-4894bbeb.js +53 -2
- package/dist/solutions-components/p-4cd569f1.entry.js +1298 -0
- package/dist/solutions-components/p-4d4160f9.entry.js +121 -0
- package/dist/solutions-components/p-4e32bf8c.js +482 -1
- package/dist/solutions-components/p-4e9cbd32.entry.js +184 -0
- package/dist/solutions-components/p-508317b3.js +13 -2
- package/dist/solutions-components/p-54697d58.entry.js +198 -0
- package/dist/solutions-components/p-55c79103.entry.js +311 -0
- package/dist/solutions-components/p-57fd19c0.entry.js +706 -0
- package/dist/solutions-components/p-59b48fde.entry.js +443 -0
- package/dist/solutions-components/p-60e0e6a0.entry.js +214 -0
- package/dist/solutions-components/p-621d0534.entry.js +123 -0
- package/dist/solutions-components/p-63f6e8f1.js +14 -1
- package/dist/solutions-components/p-66aeec57.entry.js +61 -0
- package/dist/solutions-components/p-69834f46.entry.js +618 -0
- package/dist/solutions-components/p-6d9da8e5.entry.js +21530 -0
- package/dist/solutions-components/p-6e0da576.js +13 -1
- package/dist/solutions-components/p-6ec3f294.entry.js +106 -0
- package/dist/solutions-components/p-6fe17794.js +9 -1
- package/dist/solutions-components/p-7024cb16.entry.js +72 -0
- package/dist/solutions-components/p-70535506.entry.js +226 -0
- package/dist/solutions-components/p-708a63a8.js +12 -1
- package/dist/solutions-components/p-729708a3.js +14 -1
- package/dist/solutions-components/p-73e23995.js +6 -1
- package/dist/solutions-components/p-74b29d75.entry.js +231 -0
- package/dist/solutions-components/p-74b7ee25.entry.js +711 -0
- package/dist/solutions-components/p-77182c3a.js +3015 -1
- package/dist/solutions-components/p-78b3ef80.entry.js +456 -0
- package/dist/solutions-components/p-79709c19.js +60 -3
- package/dist/solutions-components/p-7a46ef97.js +181 -2
- package/dist/solutions-components/p-7be159e6.entry.js +175 -0
- package/dist/solutions-components/p-7d4451c2.entry.js +71 -0
- package/dist/solutions-components/p-7daea1df.js +41 -1
- package/dist/solutions-components/p-7e39e5ad.entry.js +102 -0
- package/dist/solutions-components/p-7fb45059.entry.js +43 -0
- package/dist/solutions-components/p-815533de.js +306 -3
- package/dist/solutions-components/p-816622ca.entry.js +248 -0
- package/dist/solutions-components/p-83166522.js +205 -2
- package/dist/solutions-components/p-83bd1991.entry.js +36 -0
- package/dist/solutions-components/p-856464d7.entry.js +572 -0
- package/dist/solutions-components/p-8c349bad.entry.js +347 -0
- package/dist/solutions-components/p-8dccb390.entry.js +1986 -0
- package/dist/solutions-components/p-904c185a.entry.js +228 -0
- package/dist/solutions-components/p-9092f8b3.entry.js +156 -0
- package/dist/solutions-components/p-9371145a.entry.js +477 -0
- package/dist/solutions-components/p-93d3119d.js +1948 -1
- package/dist/solutions-components/p-95ec8062.entry.js +173 -0
- package/dist/solutions-components/p-991ee695.js +109 -1
- package/dist/solutions-components/p-9a57dab7.entry.js +213 -0
- package/dist/solutions-components/p-9a9955db.js +41 -1
- package/dist/solutions-components/p-9c1ebc90.js +35 -16
- package/dist/solutions-components/p-9eba5c66.js +399 -3
- package/dist/solutions-components/p-a033a507.entry.js +252 -0
- package/dist/solutions-components/p-a3773415.entry.js +1132 -0
- package/dist/solutions-components/p-a44fe40f.entry.js +94 -0
- package/dist/solutions-components/p-a5b1ab03.js +33 -3
- package/dist/solutions-components/p-a5b2c13d.entry.js +723 -0
- package/dist/solutions-components/p-a6d729b7.entry.js +85 -0
- package/dist/solutions-components/p-a8005026.entry.js +565 -0
- package/dist/solutions-components/p-a80b3880.js +14 -1
- package/dist/solutions-components/p-a89198a3.entry.js +2620 -0
- package/dist/solutions-components/p-aa04bd1f.entry.js +95 -0
- package/dist/solutions-components/p-aa0a0922.entry.js +80 -0
- package/dist/solutions-components/p-ae1fd76b.js +11 -1
- package/dist/solutions-components/p-b2cf435e.entry.js +87 -0
- package/dist/solutions-components/p-b359dc78.js +41 -1
- package/dist/solutions-components/p-b57bc4eb.entry.js +71 -0
- package/dist/solutions-components/p-b75cc407.entry.js +145 -0
- package/dist/solutions-components/p-b911cb75.entry.js +71 -0
- package/dist/solutions-components/p-b965e177.entry.js +335 -0
- package/dist/solutions-components/p-b978636e.js +14 -1
- package/dist/solutions-components/p-ba10a5c8.entry.js +42 -0
- package/dist/solutions-components/p-bd67334c.js +122 -2
- package/dist/solutions-components/p-bde20dba.entry.js +212 -0
- package/dist/solutions-components/p-be0b5a94.entry.js +248 -0
- package/dist/solutions-components/p-c023e6a1.js +2028 -2
- package/dist/solutions-components/p-c27b0c2d.entry.js +150 -0
- package/dist/solutions-components/p-c579ed60.entry.js +447 -0
- package/dist/solutions-components/p-c92bc231.js +101 -2
- package/dist/solutions-components/p-cc815aca.js +839 -16
- package/dist/solutions-components/p-cc8beabb.entry.js +695 -0
- package/dist/solutions-components/p-cdc46c0c.js +1751 -2
- package/dist/solutions-components/p-d12e6992.entry.js +118 -0
- package/dist/solutions-components/p-d1dfed6b.entry.js +179 -0
- package/dist/solutions-components/p-d48a24e6.js +754 -2
- package/dist/solutions-components/p-d96ee3ef.entry.js +579 -0
- package/dist/solutions-components/p-dbc9a5a8.js +80 -0
- package/dist/solutions-components/p-dcdbe712.entry.js +278 -0
- package/dist/solutions-components/p-de39206f.entry.js +113 -0
- package/dist/solutions-components/p-de5416e8.js +28 -1
- package/dist/solutions-components/p-df420d54.entry.js +213 -0
- package/dist/solutions-components/p-e3138cf0.entry.js +20 -0
- package/dist/solutions-components/p-e4845fec.entry.js +152 -0
- package/dist/solutions-components/p-e611d8c8.js +28 -1
- package/dist/solutions-components/p-e947d3b0.js +5 -1
- package/dist/solutions-components/p-ea534300.js +41 -2
- package/dist/solutions-components/p-ec84ee85.entry.js +55 -0
- package/dist/solutions-components/p-ed36c637.entry.js +85 -0
- package/dist/solutions-components/p-f0add71c.js +74 -0
- package/dist/solutions-components/p-f42e014b.js +171 -2
- package/dist/solutions-components/p-fc02e7de.entry.js +308 -0
- package/dist/solutions-components/p-fc884dd6.js +28 -16
- package/dist/solutions-components/p-fcbfa59c.entry.js +181 -0
- package/dist/solutions-components/p-fdc5cf5f.entry.js +138 -0
- package/dist/solutions-components/solutions-components.esm.js +20 -1
- package/dist/solutions-components/utils/interfaces.ts +2 -2
- package/dist/types/components/buffer-tools/buffer-tools.d.ts +2 -2
- package/dist/types/components/public-notification/public-notification.d.ts +9 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/solutions-components/p-021432b8.entry.js +0 -12
- package/dist/solutions-components/p-03440b1e.entry.js +0 -11
- package/dist/solutions-components/p-0512635b.entry.js +0 -6
- package/dist/solutions-components/p-086ef115.entry.js +0 -29
- package/dist/solutions-components/p-0b4bf57f.entry.js +0 -6
- package/dist/solutions-components/p-0c088725.entry.js +0 -6
- package/dist/solutions-components/p-0f820c08.entry.js +0 -6
- package/dist/solutions-components/p-164780a0.entry.js +0 -6
- package/dist/solutions-components/p-179a68a0.entry.js +0 -6
- package/dist/solutions-components/p-184b5005.entry.js +0 -11
- package/dist/solutions-components/p-1d082fee.entry.js +0 -11
- package/dist/solutions-components/p-1e6c02a2.entry.js +0 -11
- package/dist/solutions-components/p-20a58e62.entry.js +0 -17
- package/dist/solutions-components/p-20b2458c.entry.js +0 -11
- package/dist/solutions-components/p-245d47c1.entry.js +0 -6
- package/dist/solutions-components/p-2cb057a9.entry.js +0 -11
- package/dist/solutions-components/p-2cc72806.entry.js +0 -23
- package/dist/solutions-components/p-2de1db9c.entry.js +0 -11
- package/dist/solutions-components/p-2e9c7055.entry.js +0 -11
- package/dist/solutions-components/p-2ed5e6c8.entry.js +0 -11
- package/dist/solutions-components/p-3109d940.entry.js +0 -6
- package/dist/solutions-components/p-31a8bcfa.entry.js +0 -6
- package/dist/solutions-components/p-3649acb3.entry.js +0 -18
- package/dist/solutions-components/p-3f88ba73.entry.js +0 -6
- package/dist/solutions-components/p-3fa9b3c8.js +0 -36
- package/dist/solutions-components/p-40c41709.entry.js +0 -6
- package/dist/solutions-components/p-40e963c7.entry.js +0 -11
- package/dist/solutions-components/p-40f480da.entry.js +0 -11
- package/dist/solutions-components/p-49d5d2d3.entry.js +0 -11
- package/dist/solutions-components/p-4f7049a4.entry.js +0 -11
- package/dist/solutions-components/p-506e4d78.entry.js +0 -6
- package/dist/solutions-components/p-576fdcab.entry.js +0 -6
- package/dist/solutions-components/p-5bd0cf34.entry.js +0 -23
- package/dist/solutions-components/p-65e177f1.entry.js +0 -6
- package/dist/solutions-components/p-67d710c2.entry.js +0 -6
- package/dist/solutions-components/p-7268b445.entry.js +0 -11
- package/dist/solutions-components/p-75ea4667.entry.js +0 -6
- package/dist/solutions-components/p-778c0a36.entry.js +0 -17
- package/dist/solutions-components/p-7a22509b.entry.js +0 -12
- package/dist/solutions-components/p-7bff51db.entry.js +0 -6
- package/dist/solutions-components/p-7d2d0d5d.entry.js +0 -6
- package/dist/solutions-components/p-7f0036f1.entry.js +0 -11
- package/dist/solutions-components/p-8060fb94.entry.js +0 -6
- package/dist/solutions-components/p-80a1b305.entry.js +0 -6
- package/dist/solutions-components/p-81eae877.entry.js +0 -12
- package/dist/solutions-components/p-84e86b8b.entry.js +0 -6
- package/dist/solutions-components/p-851e04ae.entry.js +0 -6
- package/dist/solutions-components/p-9106950a.entry.js +0 -11
- package/dist/solutions-components/p-979804a4.entry.js +0 -11
- package/dist/solutions-components/p-9862baa8.entry.js +0 -11
- package/dist/solutions-components/p-9b5a9117.entry.js +0 -12
- package/dist/solutions-components/p-9deff0c2.entry.js +0 -6
- package/dist/solutions-components/p-9f400eeb.entry.js +0 -6
- package/dist/solutions-components/p-a0639ad1.entry.js +0 -11
- package/dist/solutions-components/p-a33c044e.entry.js +0 -6
- package/dist/solutions-components/p-a516c658.entry.js +0 -6
- package/dist/solutions-components/p-aa0ef36d.entry.js +0 -11
- package/dist/solutions-components/p-aaccbdf3.entry.js +0 -18
- package/dist/solutions-components/p-ab03a5c9.entry.js +0 -11
- package/dist/solutions-components/p-ad469b92.entry.js +0 -11
- package/dist/solutions-components/p-adc86ac3.entry.js +0 -6
- package/dist/solutions-components/p-addc1156.entry.js +0 -11
- package/dist/solutions-components/p-ae846934.entry.js +0 -11
- package/dist/solutions-components/p-b0572fc4.entry.js +0 -37
- package/dist/solutions-components/p-b4e476b7.js +0 -257
- package/dist/solutions-components/p-b668daf8.js +0 -21
- package/dist/solutions-components/p-b6e6eae1.entry.js +0 -6
- package/dist/solutions-components/p-bc317a7f.entry.js +0 -6
- package/dist/solutions-components/p-be41429f.js +0 -21
- package/dist/solutions-components/p-bf6b6353.entry.js +0 -11
- package/dist/solutions-components/p-c2e3dfbb.entry.js +0 -11
- package/dist/solutions-components/p-c4afae53.entry.js +0 -12
- package/dist/solutions-components/p-c9da1c26.entry.js +0 -6
- package/dist/solutions-components/p-cbf8cd49.entry.js +0 -6
- package/dist/solutions-components/p-cc1a064a.entry.js +0 -11
- package/dist/solutions-components/p-d09a168c.entry.js +0 -6
- package/dist/solutions-components/p-d377f913.entry.js +0 -11
- package/dist/solutions-components/p-d4cefead.entry.js +0 -37
- package/dist/solutions-components/p-d7bc0baf.entry.js +0 -16
- package/dist/solutions-components/p-d8968487.entry.js +0 -11
- package/dist/solutions-components/p-e00a0b86.entry.js +0 -11
- package/dist/solutions-components/p-e9a7ed49.entry.js +0 -11
- package/dist/solutions-components/p-ec27e493.entry.js +0 -11
- package/dist/solutions-components/p-ed6404eb.entry.js +0 -6
- package/dist/solutions-components/p-ef21e195.entry.js +0 -23
- package/dist/solutions-components/p-f6068a2d.entry.js +0 -11
- package/dist/solutions-components/p-f6c4cff3.entry.js +0 -11
- package/dist/solutions-components/p-f847291f.entry.js +0 -6
- package/dist/solutions-components/p-f90fd262.entry.js +0 -11
- package/dist/solutions-components/p-fc973005.entry.js +0 -6
- package/dist/solutions-components/p-ff9fb6bc.entry.js +0 -11
@@ -0,0 +1,711 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './p-c023e6a1.js';
|
7
|
+
import { n as numberKeys, i as isActivationKey } from './p-73e23995.js';
|
8
|
+
import { i as isValidNumber, u as updateEffectiveLocale, c as connectLocalized, d as disconnectLocalized } from './p-9eba5c66.js';
|
9
|
+
import { i as isValidTime, p as parseTimeString, a as localizeTimeStringToParts, g as getMeridiem, b as getTimeParts, c as formatTimePart, d as localizeTimePart, e as getLocaleHourCycle, m as maxTenthForMinuteAndSecond } from './p-7a46ef97.js';
|
10
|
+
import './p-9a9955db.js';
|
11
|
+
import './p-83166522.js';
|
12
|
+
import './p-729708a3.js';
|
13
|
+
import './p-a80b3880.js';
|
14
|
+
|
15
|
+
/*!
|
16
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
17
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
18
|
+
* v1.0.0-beta.97
|
19
|
+
*/
|
20
|
+
const CSS = {
|
21
|
+
button: "button",
|
22
|
+
buttonBottomLeft: "button--bottom-left",
|
23
|
+
buttonBottomRight: "button--bottom-right",
|
24
|
+
buttonHourDown: "button--hour-down",
|
25
|
+
buttonHourUp: "button--hour-up",
|
26
|
+
buttonMeridiemDown: "button--meridiem-down",
|
27
|
+
buttonMeridiemUp: "button--meridiem-up",
|
28
|
+
buttonMinuteDown: "button--minute-down",
|
29
|
+
buttonMinuteUp: "button--minute-up",
|
30
|
+
buttonSecondDown: "button--second-down",
|
31
|
+
buttonSecondUp: "button--second-up",
|
32
|
+
buttonTopLeft: "button--top-left",
|
33
|
+
buttonTopRight: "button--top-right",
|
34
|
+
column: "column",
|
35
|
+
delimiter: "delimiter",
|
36
|
+
hour: "hour",
|
37
|
+
input: "input",
|
38
|
+
meridiem: "meridiem",
|
39
|
+
minute: "minute",
|
40
|
+
second: "second",
|
41
|
+
showMeridiem: "show-meridiem",
|
42
|
+
showSecond: "show-second",
|
43
|
+
"scale-s": "scale-s",
|
44
|
+
"scale-m": "scale-m",
|
45
|
+
"scale-l": "scale-l",
|
46
|
+
timePicker: "time-picker",
|
47
|
+
meridiemStart: "meridiem--start"
|
48
|
+
};
|
49
|
+
const TEXT = {
|
50
|
+
hour: "Hour",
|
51
|
+
hourDown: "Decrease hour",
|
52
|
+
hourUp: "Increase hour",
|
53
|
+
meridiem: "AM/PM",
|
54
|
+
meridiemDown: "Decrease AM/PM",
|
55
|
+
meridiemUp: "Increase AM/PM",
|
56
|
+
minute: "Minute",
|
57
|
+
minuteDown: "Decrease minute",
|
58
|
+
minuteUp: "Increase minute",
|
59
|
+
second: "Second",
|
60
|
+
secondDown: "Decrease second",
|
61
|
+
secondUp: "Increase second"
|
62
|
+
};
|
63
|
+
|
64
|
+
const timePickerCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:inline-block}.time-picker{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;background-color:var(--calcite-ui-foreground-1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);border-radius:var(--calcite-border-radius)}.time-picker .column{display:flex;flex-direction:column}.time-picker .meridiem--start{order:-1}.time-picker .button{display:inline-flex;cursor:pointer;align-items:center;justify-content:center;background-color:var(--calcite-ui-foreground-1)}.time-picker .button:hover,.time-picker .button:focus{background-color:var(--calcite-ui-foreground-2);outline:2px solid transparent;outline-offset:2px}.time-picker .button:active{background-color:var(--calcite-ui-foreground-3)}.time-picker .button.top-left{border-start-start-radius:var(--calcite-border-radius)}.time-picker .button.bottom-left{border-end-start-radius:var(--calcite-border-radius)}.time-picker .button.top-right{border-start-end-radius:var(--calcite-border-radius)}.time-picker .button.bottom-right{border-end-end-radius:var(--calcite-border-radius)}.time-picker .button calcite-icon{color:var(--calcite-ui-text-3)}.time-picker .input{display:inline-flex;cursor:pointer;align-items:center;justify-content:center;background-color:var(--calcite-ui-foreground-1);font-weight:var(--calcite-font-weight-medium)}.time-picker .input:hover{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-2)}.time-picker .input:focus,.time-picker .input:hover:focus{outline:2px solid transparent;outline-offset:2px;box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}.time-picker.scale-s{font-size:var(--calcite-font-size--1)}.time-picker.scale-s .button,.time-picker.scale-s .input{padding-inline:0.75rem;padding-block:0.25rem}.time-picker.scale-s:not(.show-meridiem) .delimiter:last-child{-webkit-padding-end:0.75rem;padding-inline-end:0.75rem}.time-picker.scale-m{font-size:var(--calcite-font-size-0)}.time-picker.scale-m .button,.time-picker.scale-m .input{padding-inline:1rem;padding-block:0.5rem}.time-picker.scale-m:not(.show-meridiem) .delimiter:last-child{-webkit-padding-end:1rem;padding-inline-end:1rem}.time-picker.scale-l{font-size:var(--calcite-font-size-1)}.time-picker.scale-l .button,.time-picker.scale-l .input{padding-inline:1.25rem;padding-block:0.75rem}.time-picker.scale-l:not(.show-meridiem) .delimiter:last-child{-webkit-padding-end:1.25rem;padding-inline-end:1.25rem}";
|
65
|
+
|
66
|
+
function capitalize(str) {
|
67
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
68
|
+
}
|
69
|
+
const TimePicker = class {
|
70
|
+
constructor(hostRef) {
|
71
|
+
registerInstance(this, hostRef);
|
72
|
+
this.calciteInternalTimePickerBlur = createEvent(this, "calciteInternalTimePickerBlur", 6);
|
73
|
+
this.calciteInternalTimePickerChange = createEvent(this, "calciteInternalTimePickerChange", 6);
|
74
|
+
this.calciteInternalTimePickerFocus = createEvent(this, "calciteInternalTimePickerFocus", 6);
|
75
|
+
//--------------------------------------------------------------------------
|
76
|
+
//
|
77
|
+
// Properties
|
78
|
+
//
|
79
|
+
//--------------------------------------------------------------------------
|
80
|
+
/**
|
81
|
+
* Accessible name for the component's hour input.
|
82
|
+
*
|
83
|
+
* @default "Hour"
|
84
|
+
*/
|
85
|
+
this.intlHour = TEXT.hour;
|
86
|
+
/**
|
87
|
+
* Accessible name for the component's hour down button.
|
88
|
+
*
|
89
|
+
* @default "Decrease hour"
|
90
|
+
*/
|
91
|
+
this.intlHourDown = TEXT.hourDown;
|
92
|
+
/**
|
93
|
+
* Accessible name for the component's hour up button.
|
94
|
+
*
|
95
|
+
* @default "Increase hour"
|
96
|
+
*/
|
97
|
+
this.intlHourUp = TEXT.hourUp;
|
98
|
+
/**
|
99
|
+
* Accessible name for the component's meridiem (AM/PM) input.
|
100
|
+
*
|
101
|
+
* @default "AM/PM"
|
102
|
+
*/
|
103
|
+
this.intlMeridiem = TEXT.meridiem;
|
104
|
+
/**
|
105
|
+
* Accessible name for the component's meridiem (AM/PM) down button.
|
106
|
+
*
|
107
|
+
* @default "Decrease AM/PM"
|
108
|
+
*/
|
109
|
+
this.intlMeridiemDown = TEXT.meridiemDown;
|
110
|
+
/**
|
111
|
+
* Accessible name for the component's meridiem (AM/PM) up button.
|
112
|
+
*
|
113
|
+
* @default "Increase AM/PM"
|
114
|
+
*/
|
115
|
+
this.intlMeridiemUp = TEXT.meridiemUp;
|
116
|
+
/**
|
117
|
+
* Accessible name for the component's minute input.
|
118
|
+
*
|
119
|
+
* @default "Minute"
|
120
|
+
*/
|
121
|
+
this.intlMinute = TEXT.minute;
|
122
|
+
/**
|
123
|
+
* Accessible name for the component's minute down button.
|
124
|
+
*
|
125
|
+
* @default "Decrease minute"
|
126
|
+
*/
|
127
|
+
this.intlMinuteDown = TEXT.minuteDown;
|
128
|
+
/**
|
129
|
+
* Accessible name for the component's minute up button.
|
130
|
+
*
|
131
|
+
* @default "Increase minute"
|
132
|
+
*/
|
133
|
+
this.intlMinuteUp = TEXT.minuteUp;
|
134
|
+
/**
|
135
|
+
* Accessible name for the component's second input.
|
136
|
+
*
|
137
|
+
* @default "Second"
|
138
|
+
*/
|
139
|
+
this.intlSecond = TEXT.second;
|
140
|
+
/**
|
141
|
+
* Accessible name for the component's second down button.
|
142
|
+
*
|
143
|
+
* @default "Decrease second"
|
144
|
+
*/
|
145
|
+
this.intlSecondDown = TEXT.secondDown;
|
146
|
+
/**
|
147
|
+
* Accessible name for the component's second up button.
|
148
|
+
*
|
149
|
+
* @default "Increase second"
|
150
|
+
*/
|
151
|
+
this.intlSecondUp = TEXT.secondUp;
|
152
|
+
/** Specifies the size of the component. */
|
153
|
+
this.scale = "m";
|
154
|
+
/** Specifies the granularity the `value` must adhere to (in seconds). */
|
155
|
+
this.step = 60;
|
156
|
+
/** The component's value in UTC (always 24-hour format). */
|
157
|
+
this.value = null;
|
158
|
+
// --------------------------------------------------------------------------
|
159
|
+
//
|
160
|
+
// State
|
161
|
+
//
|
162
|
+
// --------------------------------------------------------------------------
|
163
|
+
this.effectiveLocale = "";
|
164
|
+
this.showSecond = this.step < 60;
|
165
|
+
this.decrementHour = () => {
|
166
|
+
const newHour = !this.hour ? 0 : this.hour === "00" ? 23 : parseInt(this.hour) - 1;
|
167
|
+
this.setValuePart("hour", newHour);
|
168
|
+
};
|
169
|
+
this.decrementMeridiem = () => {
|
170
|
+
const newMeridiem = this.meridiem === "PM" ? "AM" : "PM";
|
171
|
+
this.setValuePart("meridiem", newMeridiem);
|
172
|
+
};
|
173
|
+
this.decrementMinuteOrSecond = (key) => {
|
174
|
+
let newValue;
|
175
|
+
if (isValidNumber(this[key])) {
|
176
|
+
const valueAsNumber = parseInt(this[key]);
|
177
|
+
newValue = valueAsNumber === 0 ? 59 : valueAsNumber - 1;
|
178
|
+
}
|
179
|
+
else {
|
180
|
+
newValue = 59;
|
181
|
+
}
|
182
|
+
this.setValuePart(key, newValue);
|
183
|
+
};
|
184
|
+
this.decrementMinute = () => {
|
185
|
+
this.decrementMinuteOrSecond("minute");
|
186
|
+
};
|
187
|
+
this.decrementSecond = () => {
|
188
|
+
this.decrementMinuteOrSecond("second");
|
189
|
+
};
|
190
|
+
this.focusHandler = (event) => {
|
191
|
+
this.activeEl = event.currentTarget;
|
192
|
+
};
|
193
|
+
this.hourDownButtonKeyDownHandler = (event) => {
|
194
|
+
if (this.buttonActivated(event)) {
|
195
|
+
this.decrementHour();
|
196
|
+
}
|
197
|
+
};
|
198
|
+
this.hourKeyDownHandler = (event) => {
|
199
|
+
const { key } = event;
|
200
|
+
if (numberKeys.includes(key)) {
|
201
|
+
const keyAsNumber = parseInt(key);
|
202
|
+
let newHour;
|
203
|
+
if (isValidNumber(this.hour)) {
|
204
|
+
switch (this.hourCycle) {
|
205
|
+
case "12":
|
206
|
+
newHour =
|
207
|
+
this.hour === "01" && keyAsNumber >= 0 && keyAsNumber <= 2
|
208
|
+
? `1${keyAsNumber}`
|
209
|
+
: keyAsNumber;
|
210
|
+
break;
|
211
|
+
case "24":
|
212
|
+
if (this.hour === "01") {
|
213
|
+
newHour = `1${keyAsNumber}`;
|
214
|
+
}
|
215
|
+
else if (this.hour === "02" && keyAsNumber >= 0 && keyAsNumber <= 3) {
|
216
|
+
newHour = `2${keyAsNumber}`;
|
217
|
+
}
|
218
|
+
else {
|
219
|
+
newHour = keyAsNumber;
|
220
|
+
}
|
221
|
+
break;
|
222
|
+
}
|
223
|
+
}
|
224
|
+
else {
|
225
|
+
newHour = keyAsNumber;
|
226
|
+
}
|
227
|
+
this.setValuePart("hour", newHour);
|
228
|
+
}
|
229
|
+
else {
|
230
|
+
switch (key) {
|
231
|
+
case "Backspace":
|
232
|
+
case "Delete":
|
233
|
+
this.setValuePart("hour", null);
|
234
|
+
break;
|
235
|
+
case "ArrowDown":
|
236
|
+
event.preventDefault();
|
237
|
+
this.decrementHour();
|
238
|
+
break;
|
239
|
+
case "ArrowUp":
|
240
|
+
event.preventDefault();
|
241
|
+
this.incrementHour();
|
242
|
+
break;
|
243
|
+
case " ":
|
244
|
+
event.preventDefault();
|
245
|
+
break;
|
246
|
+
}
|
247
|
+
}
|
248
|
+
};
|
249
|
+
this.hourUpButtonKeyDownHandler = (event) => {
|
250
|
+
if (this.buttonActivated(event)) {
|
251
|
+
this.incrementHour();
|
252
|
+
}
|
253
|
+
};
|
254
|
+
this.incrementMeridiem = () => {
|
255
|
+
const newMeridiem = this.meridiem === "AM" ? "PM" : "AM";
|
256
|
+
this.setValuePart("meridiem", newMeridiem);
|
257
|
+
};
|
258
|
+
this.incrementHour = () => {
|
259
|
+
const newHour = isValidNumber(this.hour)
|
260
|
+
? this.hour === "23"
|
261
|
+
? 0
|
262
|
+
: parseInt(this.hour) + 1
|
263
|
+
: 1;
|
264
|
+
this.setValuePart("hour", newHour);
|
265
|
+
};
|
266
|
+
this.incrementMinuteOrSecond = (key) => {
|
267
|
+
const newValue = isValidNumber(this[key])
|
268
|
+
? this[key] === "59"
|
269
|
+
? 0
|
270
|
+
: parseInt(this[key]) + 1
|
271
|
+
: 0;
|
272
|
+
this.setValuePart(key, newValue);
|
273
|
+
};
|
274
|
+
this.incrementMinute = () => {
|
275
|
+
this.incrementMinuteOrSecond("minute");
|
276
|
+
};
|
277
|
+
this.incrementSecond = () => {
|
278
|
+
this.incrementMinuteOrSecond("second");
|
279
|
+
};
|
280
|
+
this.meridiemDownButtonKeyDownHandler = (event) => {
|
281
|
+
if (this.buttonActivated(event)) {
|
282
|
+
this.decrementMeridiem();
|
283
|
+
}
|
284
|
+
};
|
285
|
+
this.meridiemKeyDownHandler = (event) => {
|
286
|
+
switch (event.key) {
|
287
|
+
case "a":
|
288
|
+
this.setValuePart("meridiem", "AM");
|
289
|
+
break;
|
290
|
+
case "p":
|
291
|
+
this.setValuePart("meridiem", "PM");
|
292
|
+
break;
|
293
|
+
case "Backspace":
|
294
|
+
case "Delete":
|
295
|
+
this.setValuePart("meridiem", null);
|
296
|
+
break;
|
297
|
+
case "ArrowUp":
|
298
|
+
event.preventDefault();
|
299
|
+
this.incrementMeridiem();
|
300
|
+
break;
|
301
|
+
case "ArrowDown":
|
302
|
+
event.preventDefault();
|
303
|
+
this.decrementMeridiem();
|
304
|
+
break;
|
305
|
+
case " ":
|
306
|
+
event.preventDefault();
|
307
|
+
break;
|
308
|
+
}
|
309
|
+
};
|
310
|
+
this.meridiemUpButtonKeyDownHandler = (event) => {
|
311
|
+
if (this.buttonActivated(event)) {
|
312
|
+
this.incrementMeridiem();
|
313
|
+
}
|
314
|
+
};
|
315
|
+
this.minuteDownButtonKeyDownHandler = (event) => {
|
316
|
+
if (this.buttonActivated(event)) {
|
317
|
+
this.decrementMinute();
|
318
|
+
}
|
319
|
+
};
|
320
|
+
this.minuteKeyDownHandler = (event) => {
|
321
|
+
const { key } = event;
|
322
|
+
if (numberKeys.includes(key)) {
|
323
|
+
const keyAsNumber = parseInt(key);
|
324
|
+
let newMinute;
|
325
|
+
if (isValidNumber(this.minute) && this.minute.startsWith("0")) {
|
326
|
+
const minuteAsNumber = parseInt(this.minute);
|
327
|
+
newMinute =
|
328
|
+
minuteAsNumber > maxTenthForMinuteAndSecond
|
329
|
+
? keyAsNumber
|
330
|
+
: `${minuteAsNumber}${keyAsNumber}`;
|
331
|
+
}
|
332
|
+
else {
|
333
|
+
newMinute = keyAsNumber;
|
334
|
+
}
|
335
|
+
this.setValuePart("minute", newMinute);
|
336
|
+
}
|
337
|
+
else {
|
338
|
+
switch (key) {
|
339
|
+
case "Backspace":
|
340
|
+
case "Delete":
|
341
|
+
this.setValuePart("minute", null);
|
342
|
+
break;
|
343
|
+
case "ArrowDown":
|
344
|
+
event.preventDefault();
|
345
|
+
this.decrementMinute();
|
346
|
+
break;
|
347
|
+
case "ArrowUp":
|
348
|
+
event.preventDefault();
|
349
|
+
this.incrementMinute();
|
350
|
+
break;
|
351
|
+
case " ":
|
352
|
+
event.preventDefault();
|
353
|
+
break;
|
354
|
+
}
|
355
|
+
}
|
356
|
+
};
|
357
|
+
this.minuteUpButtonKeyDownHandler = (event) => {
|
358
|
+
if (this.buttonActivated(event)) {
|
359
|
+
this.incrementMinute();
|
360
|
+
}
|
361
|
+
};
|
362
|
+
this.secondDownButtonKeyDownHandler = (event) => {
|
363
|
+
if (this.buttonActivated(event)) {
|
364
|
+
this.decrementSecond();
|
365
|
+
}
|
366
|
+
};
|
367
|
+
this.secondKeyDownHandler = (event) => {
|
368
|
+
const { key } = event;
|
369
|
+
if (numberKeys.includes(key)) {
|
370
|
+
const keyAsNumber = parseInt(key);
|
371
|
+
let newSecond;
|
372
|
+
if (isValidNumber(this.second) && this.second.startsWith("0")) {
|
373
|
+
const secondAsNumber = parseInt(this.second);
|
374
|
+
newSecond =
|
375
|
+
secondAsNumber > maxTenthForMinuteAndSecond
|
376
|
+
? keyAsNumber
|
377
|
+
: `${secondAsNumber}${keyAsNumber}`;
|
378
|
+
}
|
379
|
+
else {
|
380
|
+
newSecond = keyAsNumber;
|
381
|
+
}
|
382
|
+
this.setValuePart("second", newSecond);
|
383
|
+
}
|
384
|
+
else {
|
385
|
+
switch (key) {
|
386
|
+
case "Backspace":
|
387
|
+
case "Delete":
|
388
|
+
this.setValuePart("second", null);
|
389
|
+
break;
|
390
|
+
case "ArrowDown":
|
391
|
+
event.preventDefault();
|
392
|
+
this.decrementSecond();
|
393
|
+
break;
|
394
|
+
case "ArrowUp":
|
395
|
+
event.preventDefault();
|
396
|
+
this.incrementSecond();
|
397
|
+
break;
|
398
|
+
case " ":
|
399
|
+
event.preventDefault();
|
400
|
+
break;
|
401
|
+
}
|
402
|
+
}
|
403
|
+
};
|
404
|
+
this.secondUpButtonKeyDownHandler = (event) => {
|
405
|
+
if (this.buttonActivated(event)) {
|
406
|
+
this.incrementSecond();
|
407
|
+
}
|
408
|
+
};
|
409
|
+
this.setHourEl = (el) => (this.hourEl = el);
|
410
|
+
this.setMeridiemEl = (el) => (this.meridiemEl = el);
|
411
|
+
this.setMinuteEl = (el) => (this.minuteEl = el);
|
412
|
+
this.setSecondEl = (el) => (this.secondEl = el);
|
413
|
+
this.setValue = (value, emit = true) => {
|
414
|
+
if (isValidTime(value)) {
|
415
|
+
const { hour, minute, second } = parseTimeString(value);
|
416
|
+
const { effectiveLocale: locale, numberingSystem } = this;
|
417
|
+
const { localizedHour, localizedHourSuffix, localizedMinute, localizedMinuteSuffix, localizedSecond, localizedSecondSuffix, localizedMeridiem } = localizeTimeStringToParts({ value, locale, numberingSystem });
|
418
|
+
this.localizedHour = localizedHour;
|
419
|
+
this.localizedHourSuffix = localizedHourSuffix;
|
420
|
+
this.localizedMinute = localizedMinute;
|
421
|
+
this.localizedMinuteSuffix = localizedMinuteSuffix;
|
422
|
+
this.localizedSecond = localizedSecond;
|
423
|
+
this.localizedSecondSuffix = localizedSecondSuffix;
|
424
|
+
this.hour = hour;
|
425
|
+
this.minute = minute;
|
426
|
+
this.second = second;
|
427
|
+
if (localizedMeridiem) {
|
428
|
+
this.localizedMeridiem = localizedMeridiem;
|
429
|
+
this.meridiem = getMeridiem(this.hour);
|
430
|
+
const formatParts = getTimeParts({ value, locale, numberingSystem });
|
431
|
+
this.meridiemOrder = this.getMeridiemOrder(formatParts);
|
432
|
+
}
|
433
|
+
}
|
434
|
+
else {
|
435
|
+
this.hour = null;
|
436
|
+
this.localizedHour = null;
|
437
|
+
this.localizedHourSuffix = null;
|
438
|
+
this.localizedMeridiem = null;
|
439
|
+
this.localizedMinute = null;
|
440
|
+
this.localizedMinuteSuffix = null;
|
441
|
+
this.localizedSecond = null;
|
442
|
+
this.localizedSecondSuffix = null;
|
443
|
+
this.meridiem = null;
|
444
|
+
this.minute = null;
|
445
|
+
this.second = null;
|
446
|
+
this.value = null;
|
447
|
+
}
|
448
|
+
if (emit) {
|
449
|
+
this.calciteInternalTimePickerChange.emit();
|
450
|
+
}
|
451
|
+
};
|
452
|
+
this.setValuePart = (key, value, emit = true) => {
|
453
|
+
var _a;
|
454
|
+
const { effectiveLocale: locale, numberingSystem } = this;
|
455
|
+
if (key === "meridiem") {
|
456
|
+
this.meridiem = value;
|
457
|
+
if (isValidNumber(this.hour)) {
|
458
|
+
const hourAsNumber = parseInt(this.hour);
|
459
|
+
switch (value) {
|
460
|
+
case "AM":
|
461
|
+
if (hourAsNumber >= 12) {
|
462
|
+
this.hour = formatTimePart(hourAsNumber - 12);
|
463
|
+
}
|
464
|
+
break;
|
465
|
+
case "PM":
|
466
|
+
if (hourAsNumber < 12) {
|
467
|
+
this.hour = formatTimePart(hourAsNumber + 12);
|
468
|
+
}
|
469
|
+
break;
|
470
|
+
}
|
471
|
+
this.localizedHour = localizeTimePart({
|
472
|
+
value: this.hour,
|
473
|
+
part: "hour",
|
474
|
+
locale,
|
475
|
+
numberingSystem
|
476
|
+
});
|
477
|
+
}
|
478
|
+
}
|
479
|
+
else {
|
480
|
+
this[key] = typeof value === "number" ? formatTimePart(value) : value;
|
481
|
+
this[`localized${capitalize(key)}`] = localizeTimePart({
|
482
|
+
value: this[key],
|
483
|
+
part: key,
|
484
|
+
locale,
|
485
|
+
numberingSystem
|
486
|
+
});
|
487
|
+
}
|
488
|
+
if (this.hour && this.minute) {
|
489
|
+
const showSeconds = this.second && this.showSecond;
|
490
|
+
this.value = `${this.hour}:${this.minute}:${showSeconds ? this.second : "00"}`;
|
491
|
+
}
|
492
|
+
else {
|
493
|
+
this.value = null;
|
494
|
+
}
|
495
|
+
this.localizedMeridiem = this.value
|
496
|
+
? ((_a = localizeTimeStringToParts({ value: this.value, locale, numberingSystem })) === null || _a === void 0 ? void 0 : _a.localizedMeridiem) || null
|
497
|
+
: localizeTimePart({ value: this.meridiem, part: "meridiem", locale, numberingSystem });
|
498
|
+
if (emit) {
|
499
|
+
this.calciteInternalTimePickerChange.emit();
|
500
|
+
}
|
501
|
+
};
|
502
|
+
}
|
503
|
+
localeChanged() {
|
504
|
+
updateEffectiveLocale(this);
|
505
|
+
}
|
506
|
+
valueWatcher(newValue) {
|
507
|
+
this.setValue(newValue, false);
|
508
|
+
}
|
509
|
+
effectiveLocaleWatcher() {
|
510
|
+
this.updateLocale();
|
511
|
+
}
|
512
|
+
//--------------------------------------------------------------------------
|
513
|
+
//
|
514
|
+
// Event Listeners
|
515
|
+
//
|
516
|
+
//--------------------------------------------------------------------------
|
517
|
+
hostBlurHandler() {
|
518
|
+
this.calciteInternalTimePickerBlur.emit();
|
519
|
+
}
|
520
|
+
hostFocusHandler() {
|
521
|
+
this.calciteInternalTimePickerFocus.emit();
|
522
|
+
}
|
523
|
+
keyDownHandler(event) {
|
524
|
+
const { defaultPrevented, key } = event;
|
525
|
+
if (defaultPrevented) {
|
526
|
+
return;
|
527
|
+
}
|
528
|
+
switch (this.activeEl) {
|
529
|
+
case this.hourEl:
|
530
|
+
if (key === "ArrowRight") {
|
531
|
+
this.setFocus("minute");
|
532
|
+
event.preventDefault();
|
533
|
+
}
|
534
|
+
break;
|
535
|
+
case this.minuteEl:
|
536
|
+
switch (key) {
|
537
|
+
case "ArrowLeft":
|
538
|
+
this.setFocus("hour");
|
539
|
+
event.preventDefault();
|
540
|
+
break;
|
541
|
+
case "ArrowRight":
|
542
|
+
if (this.step !== 60) {
|
543
|
+
this.setFocus("second");
|
544
|
+
event.preventDefault();
|
545
|
+
}
|
546
|
+
else if (this.hourCycle === "12") {
|
547
|
+
this.setFocus("meridiem");
|
548
|
+
event.preventDefault();
|
549
|
+
}
|
550
|
+
break;
|
551
|
+
}
|
552
|
+
break;
|
553
|
+
case this.secondEl:
|
554
|
+
switch (key) {
|
555
|
+
case "ArrowLeft":
|
556
|
+
this.setFocus("minute");
|
557
|
+
event.preventDefault();
|
558
|
+
break;
|
559
|
+
case "ArrowRight":
|
560
|
+
if (this.hourCycle === "12") {
|
561
|
+
this.setFocus("meridiem");
|
562
|
+
event.preventDefault();
|
563
|
+
}
|
564
|
+
break;
|
565
|
+
}
|
566
|
+
break;
|
567
|
+
case this.meridiemEl:
|
568
|
+
switch (key) {
|
569
|
+
case "ArrowLeft":
|
570
|
+
if (this.step !== 60) {
|
571
|
+
this.setFocus("second");
|
572
|
+
event.preventDefault();
|
573
|
+
}
|
574
|
+
else {
|
575
|
+
this.setFocus("minute");
|
576
|
+
event.preventDefault();
|
577
|
+
}
|
578
|
+
break;
|
579
|
+
}
|
580
|
+
break;
|
581
|
+
}
|
582
|
+
}
|
583
|
+
//--------------------------------------------------------------------------
|
584
|
+
//
|
585
|
+
// Public Methods
|
586
|
+
//
|
587
|
+
//--------------------------------------------------------------------------
|
588
|
+
/**
|
589
|
+
* Sets focus on the component.
|
590
|
+
*
|
591
|
+
* @param target
|
592
|
+
*/
|
593
|
+
async setFocus(target) {
|
594
|
+
var _a;
|
595
|
+
(_a = this[`${target || "hour"}El`]) === null || _a === void 0 ? void 0 : _a.focus();
|
596
|
+
}
|
597
|
+
// --------------------------------------------------------------------------
|
598
|
+
//
|
599
|
+
// Private Methods
|
600
|
+
//
|
601
|
+
// --------------------------------------------------------------------------
|
602
|
+
buttonActivated(event) {
|
603
|
+
const { key } = event;
|
604
|
+
if (key === " ") {
|
605
|
+
event.preventDefault();
|
606
|
+
}
|
607
|
+
return isActivationKey(key);
|
608
|
+
}
|
609
|
+
getMeridiemOrder(formatParts) {
|
610
|
+
const locale = this.effectiveLocale;
|
611
|
+
const isRTLKind = locale === "ar" || locale === "he";
|
612
|
+
if (formatParts && !isRTLKind) {
|
613
|
+
const index = formatParts.findIndex((parts) => {
|
614
|
+
return parts.value === this.localizedMeridiem;
|
615
|
+
});
|
616
|
+
return index;
|
617
|
+
}
|
618
|
+
return 0;
|
619
|
+
}
|
620
|
+
updateLocale() {
|
621
|
+
this.hourCycle = getLocaleHourCycle(this.effectiveLocale, this.numberingSystem);
|
622
|
+
this.setValue(this.value, false);
|
623
|
+
}
|
624
|
+
// --------------------------------------------------------------------------
|
625
|
+
//
|
626
|
+
// Lifecycle
|
627
|
+
//
|
628
|
+
// --------------------------------------------------------------------------
|
629
|
+
connectedCallback() {
|
630
|
+
connectLocalized(this);
|
631
|
+
this.updateLocale();
|
632
|
+
this.meridiemOrder = this.getMeridiemOrder(getTimeParts({
|
633
|
+
value: "0:00:00",
|
634
|
+
locale: this.effectiveLocale,
|
635
|
+
numberingSystem: this.numberingSystem
|
636
|
+
}));
|
637
|
+
}
|
638
|
+
disconnectedCallback() {
|
639
|
+
disconnectLocalized(this);
|
640
|
+
}
|
641
|
+
// --------------------------------------------------------------------------
|
642
|
+
//
|
643
|
+
// Render Methods
|
644
|
+
//
|
645
|
+
// --------------------------------------------------------------------------
|
646
|
+
render() {
|
647
|
+
const hourIsNumber = isValidNumber(this.hour);
|
648
|
+
const iconScale = this.scale === "s" || this.scale === "m" ? "s" : "m";
|
649
|
+
const minuteIsNumber = isValidNumber(this.minute);
|
650
|
+
const secondIsNumber = isValidNumber(this.second);
|
651
|
+
const showMeridiem = this.hourCycle === "12";
|
652
|
+
return (h("div", { class: {
|
653
|
+
[CSS.timePicker]: true,
|
654
|
+
[CSS.showMeridiem]: showMeridiem,
|
655
|
+
[CSS.showSecond]: this.showSecond,
|
656
|
+
[CSS[`scale-${this.scale}`]]: true
|
657
|
+
}, dir: "ltr" }, h("div", { class: CSS.column, role: "group" }, h("span", { "aria-label": this.intlHourUp, class: {
|
658
|
+
[CSS.button]: true,
|
659
|
+
[CSS.buttonHourUp]: true,
|
660
|
+
[CSS.buttonTopLeft]: true
|
661
|
+
}, onClick: this.incrementHour, onKeyDown: this.hourUpButtonKeyDownHandler, role: "button", tabIndex: -1 }, h("calcite-icon", { icon: "chevron-up", scale: iconScale })), h("span", { "aria-label": this.intlHour, "aria-valuemax": "23", "aria-valuemin": "1", "aria-valuenow": (hourIsNumber && parseInt(this.hour)) || "0", "aria-valuetext": this.hour, class: {
|
662
|
+
[CSS.input]: true,
|
663
|
+
[CSS.hour]: true
|
664
|
+
}, onFocus: this.focusHandler, onKeyDown: this.hourKeyDownHandler, ref: this.setHourEl, role: "spinbutton", tabIndex: 0 }, this.localizedHour || "--"), h("span", { "aria-label": this.intlHourDown, class: {
|
665
|
+
[CSS.button]: true,
|
666
|
+
[CSS.buttonHourDown]: true,
|
667
|
+
[CSS.buttonBottomLeft]: true
|
668
|
+
}, onClick: this.decrementHour, onKeyDown: this.hourDownButtonKeyDownHandler, role: "button", tabIndex: -1 }, h("calcite-icon", { icon: "chevron-down", scale: iconScale }))), h("span", { class: CSS.delimiter }, this.localizedHourSuffix), h("div", { class: CSS.column, role: "group" }, h("span", { "aria-label": this.intlMinuteUp, class: {
|
669
|
+
[CSS.button]: true,
|
670
|
+
[CSS.buttonMinuteUp]: true
|
671
|
+
}, onClick: this.incrementMinute, onKeyDown: this.minuteUpButtonKeyDownHandler, role: "button", tabIndex: -1 }, h("calcite-icon", { icon: "chevron-up", scale: iconScale })), h("span", { "aria-label": this.intlMinute, "aria-valuemax": "12", "aria-valuemin": "1", "aria-valuenow": (minuteIsNumber && parseInt(this.minute)) || "0", "aria-valuetext": this.minute, class: {
|
672
|
+
[CSS.input]: true,
|
673
|
+
[CSS.minute]: true
|
674
|
+
}, onFocus: this.focusHandler, onKeyDown: this.minuteKeyDownHandler, ref: this.setMinuteEl, role: "spinbutton", tabIndex: 0 }, this.localizedMinute || "--"), h("span", { "aria-label": this.intlMinuteDown, class: {
|
675
|
+
[CSS.button]: true,
|
676
|
+
[CSS.buttonMinuteDown]: true
|
677
|
+
}, onClick: this.decrementMinute, onKeyDown: this.minuteDownButtonKeyDownHandler, role: "button", tabIndex: -1 }, h("calcite-icon", { icon: "chevron-down", scale: iconScale }))), this.showSecond && h("span", { class: CSS.delimiter }, this.localizedMinuteSuffix), this.showSecond && (h("div", { class: CSS.column, role: "group" }, h("span", { "aria-label": this.intlSecondUp, class: {
|
678
|
+
[CSS.button]: true,
|
679
|
+
[CSS.buttonSecondUp]: true
|
680
|
+
}, onClick: this.incrementSecond, onKeyDown: this.secondUpButtonKeyDownHandler, role: "button", tabIndex: -1 }, h("calcite-icon", { icon: "chevron-up", scale: iconScale })), h("span", { "aria-label": this.intlSecond, "aria-valuemax": "59", "aria-valuemin": "0", "aria-valuenow": (secondIsNumber && parseInt(this.second)) || "0", "aria-valuetext": this.second, class: {
|
681
|
+
[CSS.input]: true,
|
682
|
+
[CSS.second]: true
|
683
|
+
}, onFocus: this.focusHandler, onKeyDown: this.secondKeyDownHandler, ref: this.setSecondEl, role: "spinbutton", tabIndex: 0 }, this.localizedSecond || "--"), h("span", { "aria-label": this.intlSecondDown, class: {
|
684
|
+
[CSS.button]: true,
|
685
|
+
[CSS.buttonSecondDown]: true
|
686
|
+
}, onClick: this.decrementSecond, onKeyDown: this.secondDownButtonKeyDownHandler, role: "button", tabIndex: -1 }, h("calcite-icon", { icon: "chevron-down", scale: iconScale })))), this.localizedSecondSuffix && (h("span", { class: CSS.delimiter }, this.localizedSecondSuffix)), showMeridiem && (h("div", { class: {
|
687
|
+
[CSS.column]: true,
|
688
|
+
[CSS.meridiemStart]: this.meridiemOrder === 0
|
689
|
+
}, role: "group" }, h("span", { "aria-label": this.intlMeridiemUp, class: {
|
690
|
+
[CSS.button]: true,
|
691
|
+
[CSS.buttonMeridiemUp]: true,
|
692
|
+
[CSS.buttonTopRight]: true
|
693
|
+
}, onClick: this.incrementMeridiem, onKeyDown: this.meridiemUpButtonKeyDownHandler, role: "button", tabIndex: -1 }, h("calcite-icon", { icon: "chevron-up", scale: iconScale })), h("span", { "aria-label": this.intlMeridiem, "aria-valuemax": "2", "aria-valuemin": "1", "aria-valuenow": (this.meridiem === "PM" && "2") || "1", "aria-valuetext": this.meridiem, class: {
|
694
|
+
[CSS.input]: true,
|
695
|
+
[CSS.meridiem]: true
|
696
|
+
}, onFocus: this.focusHandler, onKeyDown: this.meridiemKeyDownHandler, ref: this.setMeridiemEl, role: "spinbutton", tabIndex: 0 }, this.localizedMeridiem || "--"), h("span", { "aria-label": this.intlMeridiemDown, class: {
|
697
|
+
[CSS.button]: true,
|
698
|
+
[CSS.buttonMeridiemDown]: true,
|
699
|
+
[CSS.buttonBottomRight]: true
|
700
|
+
}, onClick: this.decrementMeridiem, onKeyDown: this.meridiemDownButtonKeyDownHandler, role: "button", tabIndex: -1 }, h("calcite-icon", { icon: "chevron-down", scale: iconScale }))))));
|
701
|
+
}
|
702
|
+
get el() { return getElement(this); }
|
703
|
+
static get watchers() { return {
|
704
|
+
"locale": ["localeChanged"],
|
705
|
+
"value": ["valueWatcher"],
|
706
|
+
"effectiveLocale": ["effectiveLocaleWatcher"]
|
707
|
+
}; }
|
708
|
+
};
|
709
|
+
TimePicker.style = timePickerCss;
|
710
|
+
|
711
|
+
export { TimePicker as calcite_time_picker };
|