@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,565 @@
|
|
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, H as Host, g as getElement, F as Fragment } from './p-c023e6a1.js';
|
7
|
+
import { c as closestElementCrossShadowBoundary, b as getElementDir } from './p-83166522.js';
|
8
|
+
import { C as CSS_UTILITY } from './p-729708a3.js';
|
9
|
+
import { u as updateHostInteraction } from './p-7daea1df.js';
|
10
|
+
import { i as isActivationKey } from './p-73e23995.js';
|
11
|
+
import { n as numberStringFormatter } from './p-9eba5c66.js';
|
12
|
+
import { c as sameDate, b as dateFromRange, i as inRange, e as getOrder, n as nextMonth, f as prevMonth } from './p-f42e014b.js';
|
13
|
+
import { H as Heading } from './p-508317b3.js';
|
14
|
+
import './p-a80b3880.js';
|
15
|
+
import './p-9a9955db.js';
|
16
|
+
|
17
|
+
const datePickerDayCss = "@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([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:flex;min-inline-size:0px;cursor:pointer;justify-content:center;color:var(--calcite-ui-text-3);inline-size:14.2857142857%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.day-v-wrapper{flex:1 1 auto}.day-wrapper{display:flex;flex-direction:column;align-items:center}.day{display:flex;align-items:center;justify-content:center;border-radius:9999px;font-size:var(--calcite-font-size--2);line-height:1rem;line-height:1;color:var(--calcite-ui-text-3);opacity:var(--calcite-ui-opacity-disabled);outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;background:none;box-shadow:0 0 0 2px transparent}.text{margin-block:1px 0px;-webkit-margin-start:0px;margin-inline-start:0px}:host([scale=s]) .day-v-wrapper{padding-block:0.125rem}:host([scale=s]) .day-wrapper{padding:0px}:host([scale=s]) .day{block-size:27px;inline-size:27px;font-size:var(--calcite-font-size--2)}:host([scale=m]) .day-v-wrapper{padding-block:0.25rem}:host([scale=m]) .day-wrapper{padding-inline:0.25rem}:host([scale=m]) .day{block-size:33px;inline-size:33px;font-size:var(--calcite-font-size--1)}:host([scale=l]) .day-v-wrapper{padding-block:0.25rem}:host([scale=l]) .day-wrapper{padding-inline:0.25rem}:host([scale=l]) .day{block-size:43px;inline-size:43px;font-size:var(--calcite-font-size-0)}:host([current-month]) .day{opacity:1}:host(:hover:not([disabled])) .day,:host([active]:not([range])) .day{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}:host(:focus),:host([active]){outline:2px solid transparent;outline-offset:2px}:host(:focus:not([disabled])) .day{outline:2px solid var(--calcite-ui-brand);outline-offset:2px;box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host([selected]) .day{font-weight:var(--calcite-font-weight-medium);background-color:var(--calcite-ui-brand) !important;color:var(--calcite-ui-foreground-1) !important}:host([range][selected]) .day-wrapper{background-color:var(--calcite-ui-foreground-current)}:host([start-of-range]) .day-wrapper{border-start-start-radius:40%;border-end-start-radius:40%}:host([end-of-range]) .day-wrapper{border-start-end-radius:40%;border-end-end-radius:40%}:host([start-of-range]) :not(.calcite--rtl) .day-wrapper{box-shadow:inset 4px 0 var(--calcite-ui-foreground-1)}:host([start-of-range]) .calcite--rtl .day-wrapper{box-shadow:inset -4px 0 var(--calcite-ui-foreground-1)}:host([start-of-range]) .day{opacity:1}:host([end-of-range]) :not(.calcite--rtl) .day-wrapper{box-shadow:inset -4px 0 var(--calcite-ui-foreground-1)}:host([end-of-range]) .calcite--rtl .day-wrapper{box-shadow:inset 4px 0 var(--calcite-ui-foreground-1)}:host([end-of-range]) .day{opacity:1}:host([start-of-range]:not(:focus)) :not(.calcite--rtl) .day{box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host([start-of-range]:not(:focus)) .calcite--rtl .day{box-shadow:0 0 0 -2px var(--calcite-ui-foreground-1)}:host([end-of-range]:not(:focus)) :not(.calcite--rtl) .day{box-shadow:0 0 0 -2px var(--calcite-ui-foreground-1)}:host([end-of-range]:not(:focus)) .calcite--rtl .day{box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host([start-of-range][scale=l]) :not(.calcite--rtl) .day-wrapper{box-shadow:inset 8px 0 var(--calcite-ui-foreground-1)}:host([start-of-range][scale=l]) .calcite--rtl .day-wrapper{box-shadow:inset -8px 0 var(--calcite-ui-foreground-1)}:host([end-of-range][scale=l]) :not(.calcite--rtl) .day-wrapper{box-shadow:inset -8px 0 var(--calcite-ui-foreground-1)}:host([end-of-range][scale=l]) .calcite--rtl .day-wrapper{box-shadow:inset 8px 0 var(--calcite-ui-foreground-1)}:host([highlighted]) .day-wrapper{background-color:var(--calcite-ui-foreground-current)}:host([highlighted]) .day-wrapper .day{color:var(--calcite-ui-text-1)}:host([highlighted]:not([active]:focus)) .day{border-radius:0px;color:var(--calcite-ui-text-1)}:host([range-hover]:not([selected])) .day-wrapper{background-color:var(--calcite-ui-foreground-2)}:host([range-hover]:not([selected])) .day{border-radius:0px}:host([start-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper{background-image:linear-gradient(to left, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([start-of-range][range-hover]) .calcite--rtl .day-wrapper{background-image:linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([end-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper{background-image:linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([end-of-range][range-hover]) .calcite--rtl .day-wrapper{background-image:linear-gradient(to left, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host(:hover[end-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,:host(:hover[start-of-range][range-hover]) .calcite--rtl .day-wrapper{background-image:linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host(:hover[start-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,:host(:hover[end-of-range][range-hover]) .calcite--rtl .day-wrapper{background-image:linear-gradient(to left, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host(:hover[range-hover]:not([selected]).focused--start) :not(.calcite--rtl) .day-wrapper{background-image:linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2))}:host(:hover[range-hover]:not([selected]).focused--start) .calcite--rtl .day-wrapper{background-image:linear-gradient(to right, var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current))}:host(:hover[range-hover]:not([selected]).focused--start) .day{border-radius:9999px;opacity:1;box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host(:hover[range-hover]:not([selected]).focused--end) :not(.calcite--rtl) .day-wrapper{background-image:linear-gradient(to right, var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current))}:host(:hover[range-hover]:not([selected]).focused--end) .calcite--rtl .day-wrapper{background-image:linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2))}:host(:hover[range-hover]:not([selected]).focused--end) .day{border-radius:9999px;opacity:1;box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) :not(.calcite--rtl) .day-wrapper,:host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) .calcite--rtl .day-wrapper{background-image:linear-gradient(to right, var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2))}:host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) :not(.calcite--rtl) .day,:host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) .calcite--rtl .day{border-radius:9999px;opacity:1;box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) :not(.calcite--rtl) .day-wrapper,:host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) .calcite--rtl .day-wrapper{background-image:linear-gradient(to right, var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1))}:host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) :not(.calcite--rtl) .day,:host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) .calcite--rtl .day{border-radius:9999px;opacity:1;box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host(:hover[start-of-range].hover--inside-range.focused--end) .day-wrapper,:host(:hover[end-of-range].hover--inside-range.focused--start) .day-wrapper{background-image:none}:host([start-of-range].hover--inside-range.focused--end) .day-wrapper,:host([end-of-range].hover--inside-range.focused--start) .day-wrapper{background-color:var(--calcite-ui-foreground-2)}:host([highlighted]:last-child) :not(.calcite--rtl) .day-wrapper,:host([range-hover]:last-child) :not(.calcite--rtl) .day-wrapper,:host([highlighted]:first-child) .calcite--rtl .day-wrapper,:host([range-hover]:first-child) .calcite--rtl .day-wrapper{box-shadow:inset -4px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([highlighted]:first-child) :not(.calcite--rtl) .day-wrapper,:host([range-hover]:first-child) :not(.calcite--rtl) .day-wrapper,:host([highlighted]:last-child) .calcite--rtl .day-wrapper,:host([range-hover]:last-child) .calcite--rtl .day-wrapper{box-shadow:inset 4px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([scale=s][highlighted]:last-child) :not(.calcite--rtl) .day-wrapper,:host([scale=s][range-hover]:last-child) :not(.calcite--rtl) .day-wrapper,:host([scale=s][highlighted]:first-child) .calcite--rtl .day-wrapper,:host([scale=s][range-hover]:first-child) .calcite--rtl .day-wrapper{box-shadow:inset -1px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([scale=s][highlighted]:first-child) :not(.calcite--rtl) .day-wrapper,:host([scale=s][range-hover]:first-child) :not(.calcite--rtl) .day-wrapper,:host([scale=s][highlighted]:last-child) .calcite--rtl .day-wrapper,:host([scale=s][range-hover]:last-child) .calcite--rtl .day-wrapper{box-shadow:inset 1px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([scale=l][highlighted]:first-child) :not(.calcite--rtl) .day-wrapper,:host([scale=l][range-hover]:first-child) :not(.calcite--rtl) .day-wrapper,:host([scale=l][highlighted]:last-child) .calcite--rtl .day-wrapper,:host([scale=l][range-hover]:last-child) .calcite--rtl .day-wrapper{box-shadow:inset 6px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([highlighted]:first-child) .day-wrapper,:host([range-hover]:first-child) .day-wrapper{border-start-start-radius:45%;border-end-start-radius:45%}:host([highlighted]:last-child) .day-wrapper,:host([range-hover]:last-child) .day-wrapper{border-start-end-radius:45%;border-end-end-radius:45%}:host([scale=l][highlighted]:last-child) :not(.calcite--rtl) .day-wrapper,:host([scale=l][range-hover]:last-child) :not(.calcite--rtl) .day-wrapper,:host([scale=l][highlighted]:first-child) .calcite--rtl .day-wrapper,:host([scale=l][range-hover]:first-child) .calcite--rtl .day-wrapper{box-shadow:inset -6px 0px 0px 0px var(--calcite-ui-foreground-1)}@media (forced-colors: active){:host(:hover:not([disabled])) .day,:host([active]:not([range])) .day{border-radius:0px}:host([selected]){outline:2px solid canvasText}:host([selected]) .day{border-radius:0px;background-color:highlight}:host([range][selected]) .day-wrapper,:host([highlighted]) .day-wrapper,:host([range-hover]:not([selected])) .day-wrapper{background-color:highlight}:host([range][selected][start-of-range]) .day-wrapper,:host([range][selected][end-of-range]) .day-wrapper{background-color:canvas}}";
|
18
|
+
|
19
|
+
const DatePickerDay = class {
|
20
|
+
constructor(hostRef) {
|
21
|
+
registerInstance(this, hostRef);
|
22
|
+
this.calciteDaySelect = createEvent(this, "calciteDaySelect", 6);
|
23
|
+
this.calciteInternalDayHover = createEvent(this, "calciteInternalDayHover", 6);
|
24
|
+
/** Date is outside of range and can't be selected */
|
25
|
+
this.disabled = false;
|
26
|
+
/** Date is in the current month. */
|
27
|
+
this.currentMonth = false;
|
28
|
+
/** Date is the current selected date of the picker */
|
29
|
+
this.selected = false;
|
30
|
+
/** Date is currently highlighted as part of the range */
|
31
|
+
this.highlighted = false;
|
32
|
+
/** Showing date range */
|
33
|
+
this.range = false;
|
34
|
+
/** Date is the start of date range */
|
35
|
+
this.startOfRange = false;
|
36
|
+
/** Date is the end of date range */
|
37
|
+
this.endOfRange = false;
|
38
|
+
/** Date is being hovered and within the set range */
|
39
|
+
this.rangeHover = false;
|
40
|
+
/** Date is actively in focus for keyboard navigation */
|
41
|
+
this.active = false;
|
42
|
+
//--------------------------------------------------------------------------
|
43
|
+
//
|
44
|
+
// Event Listeners
|
45
|
+
//
|
46
|
+
//--------------------------------------------------------------------------
|
47
|
+
this.onClick = () => {
|
48
|
+
!this.disabled && this.calciteDaySelect.emit();
|
49
|
+
};
|
50
|
+
this.keyDownHandler = (event) => {
|
51
|
+
if (isActivationKey(event.key)) {
|
52
|
+
!this.disabled && this.calciteDaySelect.emit();
|
53
|
+
event.preventDefault();
|
54
|
+
}
|
55
|
+
};
|
56
|
+
}
|
57
|
+
mouseoverHandler() {
|
58
|
+
this.calciteInternalDayHover.emit();
|
59
|
+
}
|
60
|
+
//--------------------------------------------------------------------------
|
61
|
+
//
|
62
|
+
// Lifecycle
|
63
|
+
//
|
64
|
+
//--------------------------------------------------------------------------
|
65
|
+
componentWillLoad() {
|
66
|
+
this.parentDatePickerEl = closestElementCrossShadowBoundary(this.el, "calcite-date-picker");
|
67
|
+
}
|
68
|
+
render() {
|
69
|
+
if (this.parentDatePickerEl) {
|
70
|
+
const { numberingSystem, lang: locale } = this.parentDatePickerEl;
|
71
|
+
numberStringFormatter.numberFormatOptions = Object.assign(Object.assign({ useGrouping: false }, (numberingSystem && { numberingSystem })), (locale && { locale }));
|
72
|
+
}
|
73
|
+
const formattedDay = numberStringFormatter.localize(String(this.day));
|
74
|
+
const dir = getElementDir(this.el);
|
75
|
+
return (h(Host, { onClick: this.onClick, onKeyDown: this.keyDownHandler, role: "gridcell" }, h("div", { class: { "day-v-wrapper": true, [CSS_UTILITY.rtl]: dir === "rtl" } }, h("div", { class: "day-wrapper" }, h("span", { class: "day" }, h("span", { class: "text" }, formattedDay))))));
|
76
|
+
}
|
77
|
+
componentDidRender() {
|
78
|
+
updateHostInteraction(this, this.isTabbable);
|
79
|
+
}
|
80
|
+
isTabbable() {
|
81
|
+
return this.active;
|
82
|
+
}
|
83
|
+
get el() { return getElement(this); }
|
84
|
+
};
|
85
|
+
DatePickerDay.style = datePickerDayCss;
|
86
|
+
|
87
|
+
const datePickerMonthCss = "@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}.calender{-webkit-margin-after:0.25rem;margin-block-end:0.25rem}.week-headers{display:flex;border-width:0px;border-block-start-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);padding-block:0px;padding-inline:0.25rem}.week-header{text-align:center;font-weight:var(--calcite-font-weight-bold);color:var(--calcite-ui-text-3);inline-size:14.2857142857%}:host([scale=s]) .week-header{padding-inline:0px;padding-block:0.5rem 0.75rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) .week-header{padding-inline:0px;padding-block:0.75rem 1rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=l]) .week-header{padding-inline:0px;padding-block:1rem 1.25rem;font-size:var(--calcite-font-size--1);line-height:1rem}.week-days{display:flex;flex-direction:row;padding-block:0px;padding-inline:6px}.week-days:focus{outline:2px solid transparent;outline-offset:2px}";
|
88
|
+
|
89
|
+
const DatePickerMonth = class {
|
90
|
+
constructor(hostRef) {
|
91
|
+
registerInstance(this, hostRef);
|
92
|
+
this.calciteDatePickerSelect = createEvent(this, "calciteDatePickerSelect", 6);
|
93
|
+
this.calciteInternalDatePickerHover = createEvent(this, "calciteInternalDatePickerHover", 6);
|
94
|
+
this.calciteDatePickerActiveDateChange = createEvent(this, "calciteDatePickerActiveDateChange", 6);
|
95
|
+
this.calciteInternalDatePickerMouseOut = createEvent(this, "calciteInternalDatePickerMouseOut", 6);
|
96
|
+
/** Date currently active.*/
|
97
|
+
this.activeDate = new Date();
|
98
|
+
//--------------------------------------------------------------------------
|
99
|
+
//
|
100
|
+
// Event Listeners
|
101
|
+
//
|
102
|
+
//--------------------------------------------------------------------------
|
103
|
+
this.keyDownHandler = (event) => {
|
104
|
+
if (event.defaultPrevented) {
|
105
|
+
return;
|
106
|
+
}
|
107
|
+
const isRTL = this.el.dir === "rtl";
|
108
|
+
switch (event.key) {
|
109
|
+
case "ArrowUp":
|
110
|
+
event.preventDefault();
|
111
|
+
this.addDays(-7);
|
112
|
+
break;
|
113
|
+
case "ArrowRight":
|
114
|
+
event.preventDefault();
|
115
|
+
this.addDays(isRTL ? -1 : 1);
|
116
|
+
break;
|
117
|
+
case "ArrowDown":
|
118
|
+
event.preventDefault();
|
119
|
+
this.addDays(7);
|
120
|
+
break;
|
121
|
+
case "ArrowLeft":
|
122
|
+
event.preventDefault();
|
123
|
+
this.addDays(isRTL ? 1 : -1);
|
124
|
+
break;
|
125
|
+
case "PageUp":
|
126
|
+
event.preventDefault();
|
127
|
+
this.addMonths(-1);
|
128
|
+
break;
|
129
|
+
case "PageDown":
|
130
|
+
event.preventDefault();
|
131
|
+
this.addMonths(1);
|
132
|
+
break;
|
133
|
+
case "Home":
|
134
|
+
event.preventDefault();
|
135
|
+
this.activeDate.setDate(1);
|
136
|
+
this.addDays();
|
137
|
+
break;
|
138
|
+
case "End":
|
139
|
+
event.preventDefault();
|
140
|
+
this.activeDate.setDate(new Date(this.activeDate.getFullYear(), this.activeDate.getMonth() + 1, 0).getDate());
|
141
|
+
this.addDays();
|
142
|
+
break;
|
143
|
+
case "Enter":
|
144
|
+
case " ":
|
145
|
+
event.preventDefault();
|
146
|
+
break;
|
147
|
+
case "Tab":
|
148
|
+
this.activeFocus = false;
|
149
|
+
}
|
150
|
+
};
|
151
|
+
/**
|
152
|
+
* Once user is not interacting via keyboard,
|
153
|
+
* disable auto focusing of active date
|
154
|
+
*/
|
155
|
+
this.disableActiveFocus = () => {
|
156
|
+
this.activeFocus = false;
|
157
|
+
};
|
158
|
+
this.dayHover = (event) => {
|
159
|
+
const target = event.target;
|
160
|
+
if (target.disabled) {
|
161
|
+
this.calciteInternalDatePickerMouseOut.emit();
|
162
|
+
}
|
163
|
+
else {
|
164
|
+
this.calciteInternalDatePickerHover.emit(target.value);
|
165
|
+
}
|
166
|
+
event.stopPropagation();
|
167
|
+
};
|
168
|
+
this.daySelect = (event) => {
|
169
|
+
const target = event.target;
|
170
|
+
this.calciteDatePickerSelect.emit(target.value);
|
171
|
+
};
|
172
|
+
}
|
173
|
+
mouseoutHandler() {
|
174
|
+
this.calciteInternalDatePickerMouseOut.emit();
|
175
|
+
}
|
176
|
+
//--------------------------------------------------------------------------
|
177
|
+
//
|
178
|
+
// Lifecycle
|
179
|
+
//
|
180
|
+
//--------------------------------------------------------------------------
|
181
|
+
render() {
|
182
|
+
const month = this.activeDate.getMonth();
|
183
|
+
const year = this.activeDate.getFullYear();
|
184
|
+
const startOfWeek = this.localeData.weekStart % 7;
|
185
|
+
const { abbreviated, short, narrow } = this.localeData.days;
|
186
|
+
const weekDays = this.scale === "s" ? narrow || short || abbreviated : short || abbreviated || narrow;
|
187
|
+
const adjustedWeekDays = [...weekDays.slice(startOfWeek, 7), ...weekDays.slice(0, startOfWeek)];
|
188
|
+
const curMonDays = this.getCurrentMonthDays(month, year);
|
189
|
+
const prevMonDays = this.getPrevMonthdays(month, year, startOfWeek);
|
190
|
+
const nextMonDays = this.getNextMonthDays(month, year, startOfWeek);
|
191
|
+
const days = [
|
192
|
+
...prevMonDays.map((day) => {
|
193
|
+
const date = new Date(year, month - 1, day);
|
194
|
+
return this.renderDateDay(false, day, date);
|
195
|
+
}),
|
196
|
+
...curMonDays.map((day) => {
|
197
|
+
const date = new Date(year, month, day);
|
198
|
+
const active = sameDate(date, this.activeDate);
|
199
|
+
return this.renderDateDay(active, day, date, true, true);
|
200
|
+
}),
|
201
|
+
...nextMonDays.map((day) => {
|
202
|
+
const date = new Date(year, month + 1, day);
|
203
|
+
return this.renderDateDay(false, day, date);
|
204
|
+
})
|
205
|
+
];
|
206
|
+
const weeks = [];
|
207
|
+
for (let i = 0; i < days.length; i += 7) {
|
208
|
+
weeks.push(days.slice(i, i + 7));
|
209
|
+
}
|
210
|
+
return (h(Host, { onFocusOut: this.disableActiveFocus, onKeyDown: this.keyDownHandler }, h("div", { class: "calender", role: "grid" }, h("div", { class: "week-headers", role: "row" }, adjustedWeekDays.map((weekday) => (h("span", { class: "week-header", role: "columnheader" }, weekday)))), weeks.map((days) => (h("div", { class: "week-days", role: "row" }, days))))));
|
211
|
+
}
|
212
|
+
//--------------------------------------------------------------------------
|
213
|
+
//
|
214
|
+
// Private Methods
|
215
|
+
//
|
216
|
+
//--------------------------------------------------------------------------
|
217
|
+
/**
|
218
|
+
* Add n months to the current month
|
219
|
+
*
|
220
|
+
* @param step
|
221
|
+
*/
|
222
|
+
addMonths(step) {
|
223
|
+
const nextDate = new Date(this.activeDate);
|
224
|
+
nextDate.setMonth(this.activeDate.getMonth() + step);
|
225
|
+
this.calciteDatePickerActiveDateChange.emit(dateFromRange(nextDate, this.min, this.max));
|
226
|
+
this.activeFocus = true;
|
227
|
+
}
|
228
|
+
/**
|
229
|
+
* Add n days to the current date
|
230
|
+
*
|
231
|
+
* @param step
|
232
|
+
*/
|
233
|
+
addDays(step = 0) {
|
234
|
+
const nextDate = new Date(this.activeDate);
|
235
|
+
nextDate.setDate(this.activeDate.getDate() + step);
|
236
|
+
this.calciteDatePickerActiveDateChange.emit(dateFromRange(nextDate, this.min, this.max));
|
237
|
+
this.activeFocus = true;
|
238
|
+
}
|
239
|
+
/**
|
240
|
+
* Get dates for last days of the previous month
|
241
|
+
*
|
242
|
+
* @param month
|
243
|
+
* @param year
|
244
|
+
* @param startOfWeek
|
245
|
+
*/
|
246
|
+
getPrevMonthdays(month, year, startOfWeek) {
|
247
|
+
const lastDate = new Date(year, month, 0);
|
248
|
+
const date = lastDate.getDate();
|
249
|
+
const day = lastDate.getDay();
|
250
|
+
const days = [];
|
251
|
+
if (day - 6 === startOfWeek) {
|
252
|
+
return days;
|
253
|
+
}
|
254
|
+
for (let i = lastDate.getDay() - startOfWeek; i >= 0; i--) {
|
255
|
+
days.push(date - i);
|
256
|
+
}
|
257
|
+
return days;
|
258
|
+
}
|
259
|
+
/**
|
260
|
+
* Get dates for the current month
|
261
|
+
*
|
262
|
+
* @param month
|
263
|
+
* @param year
|
264
|
+
*/
|
265
|
+
getCurrentMonthDays(month, year) {
|
266
|
+
const num = new Date(year, month + 1, 0).getDate();
|
267
|
+
const days = [];
|
268
|
+
for (let i = 0; i < num; i++) {
|
269
|
+
days.push(i + 1);
|
270
|
+
}
|
271
|
+
return days;
|
272
|
+
}
|
273
|
+
/**
|
274
|
+
* Get dates for first days of the next month
|
275
|
+
*
|
276
|
+
* @param month
|
277
|
+
* @param year
|
278
|
+
* @param startOfWeek
|
279
|
+
*/
|
280
|
+
getNextMonthDays(month, year, startOfWeek) {
|
281
|
+
const endDay = new Date(year, month + 1, 0).getDay();
|
282
|
+
const days = [];
|
283
|
+
if (endDay === (startOfWeek + 6) % 7) {
|
284
|
+
return days;
|
285
|
+
}
|
286
|
+
for (let i = 0; i < (6 - (endDay - startOfWeek)) % 7; i++) {
|
287
|
+
days.push(i + 1);
|
288
|
+
}
|
289
|
+
return days;
|
290
|
+
}
|
291
|
+
/**
|
292
|
+
* Determine if the date is in between the start and end dates
|
293
|
+
*
|
294
|
+
* @param date
|
295
|
+
*/
|
296
|
+
betweenSelectedRange(date) {
|
297
|
+
return !!(this.startDate &&
|
298
|
+
this.endDate &&
|
299
|
+
date > this.startDate &&
|
300
|
+
date < this.endDate &&
|
301
|
+
!this.isRangeHover(date));
|
302
|
+
}
|
303
|
+
/**
|
304
|
+
* Determine if the date should be in selected state
|
305
|
+
*
|
306
|
+
* @param date
|
307
|
+
*/
|
308
|
+
isSelected(date) {
|
309
|
+
return !!(sameDate(date, this.selectedDate) ||
|
310
|
+
(this.startDate && sameDate(date, this.startDate)) ||
|
311
|
+
(this.endDate && sameDate(date, this.endDate)));
|
312
|
+
}
|
313
|
+
/**
|
314
|
+
* Determine if the date is the start of the date range
|
315
|
+
*
|
316
|
+
* @param date
|
317
|
+
*/
|
318
|
+
isStartOfRange(date) {
|
319
|
+
return !!(this.startDate &&
|
320
|
+
!sameDate(this.startDate, this.endDate) &&
|
321
|
+
sameDate(this.startDate, date) &&
|
322
|
+
!this.isEndOfRange(date));
|
323
|
+
}
|
324
|
+
isEndOfRange(date) {
|
325
|
+
return !!((this.endDate && !sameDate(this.startDate, this.endDate) && sameDate(this.endDate, date)) ||
|
326
|
+
(!this.endDate &&
|
327
|
+
this.hoverRange &&
|
328
|
+
sameDate(this.startDate, this.hoverRange.end) &&
|
329
|
+
sameDate(date, this.hoverRange.end)));
|
330
|
+
}
|
331
|
+
/**
|
332
|
+
* Render calcite-date-picker-day
|
333
|
+
*
|
334
|
+
* @param active
|
335
|
+
* @param day
|
336
|
+
* @param date
|
337
|
+
* @param currentMonth
|
338
|
+
* @param ref
|
339
|
+
*/
|
340
|
+
renderDateDay(active, day, date, currentMonth, ref) {
|
341
|
+
var _a;
|
342
|
+
const isFocusedOnStart = this.isFocusedOnStart();
|
343
|
+
const isHoverInRange = this.isHoverInRange() ||
|
344
|
+
(!this.endDate && this.hoverRange && sameDate((_a = this.hoverRange) === null || _a === void 0 ? void 0 : _a.end, this.startDate));
|
345
|
+
return (h("calcite-date-picker-day", { active: active, class: {
|
346
|
+
"hover--inside-range": this.startDate && isHoverInRange,
|
347
|
+
"hover--outside-range": this.startDate && !isHoverInRange,
|
348
|
+
"focused--start": isFocusedOnStart,
|
349
|
+
"focused--end": !isFocusedOnStart
|
350
|
+
}, currentMonth: currentMonth, day: day, disabled: !inRange(date, this.min, this.max), endOfRange: this.isEndOfRange(date), highlighted: this.betweenSelectedRange(date), key: date.toDateString(), onCalciteDaySelect: this.daySelect, onCalciteInternalDayHover: this.dayHover, range: !!this.startDate && !!this.endDate && !sameDate(this.startDate, this.endDate), rangeHover: this.isRangeHover(date), ref: (el) => {
|
351
|
+
// when moving via keyboard, focus must be updated on active date
|
352
|
+
if (ref && active && this.activeFocus) {
|
353
|
+
el === null || el === void 0 ? void 0 : el.focus();
|
354
|
+
}
|
355
|
+
}, scale: this.scale, selected: this.isSelected(date), startOfRange: this.isStartOfRange(date), value: date }));
|
356
|
+
}
|
357
|
+
isFocusedOnStart() {
|
358
|
+
var _a;
|
359
|
+
return ((_a = this.hoverRange) === null || _a === void 0 ? void 0 : _a.focused) === "start";
|
360
|
+
}
|
361
|
+
isHoverInRange() {
|
362
|
+
if (!this.hoverRange) {
|
363
|
+
return false;
|
364
|
+
}
|
365
|
+
const { start, end } = this.hoverRange;
|
366
|
+
return !!((!this.isFocusedOnStart() && this.startDate && (!this.endDate || end < this.endDate)) ||
|
367
|
+
(this.isFocusedOnStart() && this.startDate && start > this.startDate));
|
368
|
+
}
|
369
|
+
isRangeHover(date) {
|
370
|
+
if (!this.hoverRange) {
|
371
|
+
return false;
|
372
|
+
}
|
373
|
+
const { start, end } = this.hoverRange;
|
374
|
+
const isStart = this.isFocusedOnStart();
|
375
|
+
const insideRange = this.isHoverInRange();
|
376
|
+
const cond1 = insideRange &&
|
377
|
+
((!isStart && date > this.startDate && (date < end || sameDate(date, end))) ||
|
378
|
+
(isStart && date < this.endDate && (date > start || sameDate(date, start))));
|
379
|
+
const cond2 = !insideRange &&
|
380
|
+
((!isStart && date >= this.endDate && (date < end || sameDate(date, end))) ||
|
381
|
+
(isStart &&
|
382
|
+
(date < this.startDate || (this.endDate && sameDate(date, this.startDate))) &&
|
383
|
+
(date > start || sameDate(date, start))));
|
384
|
+
return cond1 || cond2;
|
385
|
+
}
|
386
|
+
get el() { return getElement(this); }
|
387
|
+
};
|
388
|
+
DatePickerMonth.style = datePickerMonthCss;
|
389
|
+
|
390
|
+
/*!
|
391
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
392
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
393
|
+
* v1.0.0-beta.97
|
394
|
+
*/
|
395
|
+
const BUDDHIST_CALENDAR_YEAR_OFFSET = 543;
|
396
|
+
|
397
|
+
const datePickerMonthHeaderCss = "@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:block}.header{display:flex;justify-content:space-between;padding-block:0px;padding-inline:0.25rem}:host([scale=s]) .text{margin-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=s]) .chevron{block-size:2.25rem}:host([scale=m]) .text{margin-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m]) .chevron{block-size:3rem}:host([scale=l]) .text{margin-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.5rem}:host([scale=l]) .chevron{block-size:3.5rem}.chevron{margin-inline:-0.25rem;box-sizing:content-box;display:flex;flex-grow:0;cursor:pointer;align-items:center;justify-content:center;border-style:none;background-color:var(--calcite-ui-foreground-1);padding-inline:0.25rem;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;inline-size:14.2857142857%}.chevron:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.chevron:hover,.chevron:focus{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}.chevron:active{background-color:var(--calcite-ui-foreground-3)}.chevron[aria-disabled=true]{pointer-events:none;opacity:0}.text{margin-block:auto;display:flex;inline-size:100%;flex:1 1 auto;align-items:center;justify-content:center;text-align:center;line-height:1}.text--reverse{flex-direction:row-reverse}.month,.year,.suffix{margin-inline:0.25rem;margin-block:auto;display:inline-block;background-color:var(--calcite-ui-foreground-1);font-weight:var(--calcite-font-weight-medium);line-height:1.25;color:var(--calcite-ui-text-1);font-size:inherit}.year{position:relative;inline-size:2.5rem;border-style:none;background-color:transparent;text-align:center;font-family:inherit;outline-color:transparent}.year:hover{transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-property:outline-color;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}.year:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.year--suffix{text-align:start}.year-wrap{position:relative}.suffix{inset-block-start:0px;white-space:nowrap;text-align:start;inset-inline-start:0}";
|
398
|
+
|
399
|
+
const DatePickerMonthHeader = class {
|
400
|
+
constructor(hostRef) {
|
401
|
+
registerInstance(this, hostRef);
|
402
|
+
this.calciteDatePickerSelect = createEvent(this, "calciteDatePickerSelect", 6);
|
403
|
+
//--------------------------------------------------------------------------
|
404
|
+
//
|
405
|
+
// Private State/Props
|
406
|
+
//
|
407
|
+
//--------------------------------------------------------------------------
|
408
|
+
this.globalAttributes = {};
|
409
|
+
//--------------------------------------------------------------------------
|
410
|
+
//
|
411
|
+
// Private Methods
|
412
|
+
//
|
413
|
+
//--------------------------------------------------------------------------
|
414
|
+
/**
|
415
|
+
* Increment year on UP/DOWN keys
|
416
|
+
*
|
417
|
+
* @param event
|
418
|
+
*/
|
419
|
+
this.onYearKey = (event) => {
|
420
|
+
const localizedYear = this.parseCalendarYear(event.target.value);
|
421
|
+
switch (event.key) {
|
422
|
+
case "ArrowDown":
|
423
|
+
event.preventDefault();
|
424
|
+
this.setYear({ localizedYear, offset: -1 });
|
425
|
+
break;
|
426
|
+
case "ArrowUp":
|
427
|
+
event.preventDefault();
|
428
|
+
this.setYear({ localizedYear, offset: 1 });
|
429
|
+
break;
|
430
|
+
}
|
431
|
+
};
|
432
|
+
this.onYearChange = (event) => {
|
433
|
+
this.setYear({
|
434
|
+
localizedYear: this.parseCalendarYear(event.target.value)
|
435
|
+
});
|
436
|
+
};
|
437
|
+
this.onYearInput = (event) => {
|
438
|
+
this.setYear({
|
439
|
+
localizedYear: this.parseCalendarYear(event.target.value),
|
440
|
+
commit: false
|
441
|
+
});
|
442
|
+
};
|
443
|
+
this.prevMonthClick = (event) => {
|
444
|
+
this.handleArrowClick(event, this.prevMonthDate);
|
445
|
+
};
|
446
|
+
this.prevMonthKeydown = (event) => {
|
447
|
+
if (isActivationKey(event.key)) {
|
448
|
+
this.prevMonthClick(event);
|
449
|
+
}
|
450
|
+
};
|
451
|
+
this.nextMonthClick = (event) => {
|
452
|
+
this.handleArrowClick(event, this.nextMonthDate);
|
453
|
+
};
|
454
|
+
this.nextMonthKeydown = (event) => {
|
455
|
+
if (isActivationKey(event.key)) {
|
456
|
+
this.nextMonthClick(event);
|
457
|
+
}
|
458
|
+
};
|
459
|
+
/*
|
460
|
+
* Update active month on clicks of left/right arrows
|
461
|
+
*/
|
462
|
+
this.handleArrowClick = (event, date) => {
|
463
|
+
event.preventDefault();
|
464
|
+
this.calciteDatePickerSelect.emit(date);
|
465
|
+
};
|
466
|
+
}
|
467
|
+
//--------------------------------------------------------------------------
|
468
|
+
//
|
469
|
+
// Lifecycle
|
470
|
+
//
|
471
|
+
//--------------------------------------------------------------------------
|
472
|
+
componentWillLoad() {
|
473
|
+
this.parentDatePickerEl = closestElementCrossShadowBoundary(this.el, "calcite-date-picker");
|
474
|
+
}
|
475
|
+
connectedCallback() {
|
476
|
+
this.setNextPrevMonthDates();
|
477
|
+
}
|
478
|
+
render() {
|
479
|
+
return h("div", { class: "header" }, this.renderContent());
|
480
|
+
}
|
481
|
+
renderContent() {
|
482
|
+
var _a;
|
483
|
+
if (!this.activeDate || !this.localeData) {
|
484
|
+
return null;
|
485
|
+
}
|
486
|
+
if (this.parentDatePickerEl) {
|
487
|
+
const { numberingSystem, lang: locale } = this.parentDatePickerEl;
|
488
|
+
numberStringFormatter.numberFormatOptions = Object.assign(Object.assign({ useGrouping: false }, (numberingSystem && { numberingSystem })), (locale && { locale }));
|
489
|
+
}
|
490
|
+
const activeMonth = this.activeDate.getMonth();
|
491
|
+
const { months, unitOrder } = this.localeData;
|
492
|
+
const localizedMonth = (months.wide || months.narrow || months.abbreviated)[activeMonth];
|
493
|
+
const localizedYear = this.formatCalendarYear(this.activeDate.getFullYear());
|
494
|
+
const iconScale = this.scale === "l" ? "m" : "s";
|
495
|
+
const order = getOrder(unitOrder);
|
496
|
+
const reverse = order.indexOf("y") < order.indexOf("m");
|
497
|
+
const suffix = (_a = this.localeData.year) === null || _a === void 0 ? void 0 : _a.suffix;
|
498
|
+
return (h(Fragment, null, h("a", { "aria-disabled": `${this.prevMonthDate.getMonth() === activeMonth}`, "aria-label": this.intlPrevMonth, class: "chevron", href: "#", onClick: this.prevMonthClick, onKeyDown: this.prevMonthKeydown, role: "button", tabindex: this.prevMonthDate.getMonth() === activeMonth ? -1 : 0 }, h("calcite-icon", { "flip-rtl": true, icon: "chevron-left", scale: iconScale })), h("div", { class: { text: true, "text--reverse": reverse } }, h(Heading, { class: "month", level: this.headingLevel }, localizedMonth), h("span", { class: "year-wrap" }, h("input", { "aria-label": this.intlYear, class: {
|
499
|
+
year: true,
|
500
|
+
"year--suffix": !!suffix
|
501
|
+
}, inputmode: "numeric", maxlength: "4", minlength: "1", onChange: this.onYearChange, onInput: this.onYearInput, onKeyDown: this.onYearKey, pattern: "\\d*", ref: (el) => (this.yearInput = el), type: "text", value: localizedYear }), suffix && h("span", { class: "suffix" }, suffix))), h("a", { "aria-disabled": `${this.nextMonthDate.getMonth() === activeMonth}`, "aria-label": this.intlNextMonth, class: "chevron", href: "#", onClick: this.nextMonthClick, onKeyDown: this.nextMonthKeydown, role: "button", tabindex: this.nextMonthDate.getMonth() === activeMonth ? -1 : 0 }, h("calcite-icon", { "flip-rtl": true, icon: "chevron-right", scale: iconScale }))));
|
502
|
+
}
|
503
|
+
setNextPrevMonthDates() {
|
504
|
+
if (!this.activeDate) {
|
505
|
+
return;
|
506
|
+
}
|
507
|
+
this.nextMonthDate = dateFromRange(nextMonth(this.activeDate), this.min, this.max);
|
508
|
+
this.prevMonthDate = dateFromRange(prevMonth(this.activeDate), this.min, this.max);
|
509
|
+
}
|
510
|
+
formatCalendarYear(year) {
|
511
|
+
const { localeData } = this;
|
512
|
+
const buddhistCalendar = localeData["default-calendar"] === "buddhist";
|
513
|
+
const yearOffset = buddhistCalendar ? BUDDHIST_CALENDAR_YEAR_OFFSET : 0;
|
514
|
+
return numberStringFormatter.localize(`${year + yearOffset}`);
|
515
|
+
}
|
516
|
+
parseCalendarYear(year) {
|
517
|
+
const { localeData } = this;
|
518
|
+
const buddhistCalendar = localeData["default-calendar"] === "buddhist";
|
519
|
+
const yearOffset = buddhistCalendar ? BUDDHIST_CALENDAR_YEAR_OFFSET : 0;
|
520
|
+
const parsedYear = Number(numberStringFormatter.delocalize(year)) - yearOffset;
|
521
|
+
return numberStringFormatter.localize(`${parsedYear}`);
|
522
|
+
}
|
523
|
+
getInRangeDate({ localizedYear, offset = 0 }) {
|
524
|
+
const { min, max, activeDate } = this;
|
525
|
+
const parsedYear = Number(numberStringFormatter.delocalize(localizedYear));
|
526
|
+
const length = parsedYear.toString().length;
|
527
|
+
const year = isNaN(parsedYear) ? false : parsedYear + offset;
|
528
|
+
const inRange = year && (!min || min.getFullYear() <= year) && (!max || max.getFullYear() >= year);
|
529
|
+
// if you've supplied a year and it's in range
|
530
|
+
if (year && inRange && length === localizedYear.length) {
|
531
|
+
const nextDate = new Date(activeDate);
|
532
|
+
nextDate.setFullYear(year);
|
533
|
+
return dateFromRange(nextDate, min, max);
|
534
|
+
}
|
535
|
+
}
|
536
|
+
/**
|
537
|
+
* Parse localized year string from input,
|
538
|
+
* set to active if in range
|
539
|
+
*
|
540
|
+
* @param root0
|
541
|
+
* @param root0.localizedYear
|
542
|
+
* @param root0.commit
|
543
|
+
* @param root0.offset
|
544
|
+
*/
|
545
|
+
setYear({ localizedYear, commit = true, offset = 0 }) {
|
546
|
+
const { yearInput, activeDate } = this;
|
547
|
+
const inRangeDate = this.getInRangeDate({ localizedYear, offset });
|
548
|
+
// if you've supplied a year and it's in range, update active date
|
549
|
+
if (inRangeDate) {
|
550
|
+
this.calciteDatePickerSelect.emit(inRangeDate);
|
551
|
+
}
|
552
|
+
if (commit) {
|
553
|
+
yearInput.value = this.formatCalendarYear((inRangeDate || activeDate).getFullYear());
|
554
|
+
}
|
555
|
+
}
|
556
|
+
get el() { return getElement(this); }
|
557
|
+
static get watchers() { return {
|
558
|
+
"min": ["setNextPrevMonthDates"],
|
559
|
+
"max": ["setNextPrevMonthDates"],
|
560
|
+
"activeDate": ["setNextPrevMonthDates"]
|
561
|
+
}; }
|
562
|
+
};
|
563
|
+
DatePickerMonthHeader.style = datePickerMonthHeaderCss;
|
564
|
+
|
565
|
+
export { DatePickerDay as calcite_date_picker_day, DatePickerMonth as calcite_date_picker_month, DatePickerMonthHeader as calcite_date_picker_month_header };
|
@@ -8,4 +8,17 @@
|
|
8
8
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
9
9
|
* v1.0.0-beta.97
|
10
10
|
*/
|
11
|
-
|
11
|
+
function gen(counts) {
|
12
|
+
return counts
|
13
|
+
.map((count) => {
|
14
|
+
let out = "";
|
15
|
+
for (let i = 0; i < count; i++) {
|
16
|
+
out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
17
|
+
}
|
18
|
+
return out;
|
19
|
+
})
|
20
|
+
.join("-");
|
21
|
+
}
|
22
|
+
const guid = () => gen([2, 1, 1, 1, 3]);
|
23
|
+
|
24
|
+
export { guid as g };
|