@lmvz-ds/components 0.35.2 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/assets/icons/calendar.svg +7 -0
- package/cjs/{aria-validation-controller-BC0Eaiv4.js → aria-validation-controller-Do0uEK4t.js} +1 -1
- package/cjs/{directional-focus-controller-DBat-oF7.js → directional-focus-controller-3uDoin45.js} +3 -1
- package/cjs/{element-activation-controller-BHqCUgQv.js → element-activation-controller-BWtUKzu2.js} +1 -1
- package/cjs/{element.util-CRS_YJ59.js → element.util-CctmBvUY.js} +14 -0
- package/cjs/{index-TGsVZNDP.js → index-BgvZ4y-3.js} +12 -0
- package/cjs/lmvz-action-list.cjs.entry.js +4 -4
- package/cjs/lmvz-action.cjs.entry.js +1 -1
- package/cjs/lmvz-button-group.cjs.entry.js +2 -2
- package/cjs/lmvz-button_2.cjs.entry.js +5 -5
- package/cjs/lmvz-card.cjs.entry.js +1 -1
- package/cjs/lmvz-checkbox.cjs.entry.js +2 -2
- package/cjs/lmvz-chip.cjs.entry.js +2 -2
- package/cjs/lmvz-components.cjs.js +2 -2
- package/cjs/lmvz-datepicker.cjs.entry.js +2764 -0
- package/cjs/lmvz-header_2.cjs.entry.js +6 -6
- package/cjs/{lmvz-popover.cjs.entry.js → lmvz-input_2.cjs.entry.js} +230 -11
- package/cjs/lmvz-link.cjs.entry.js +2 -2
- package/cjs/lmvz-menuitem.cjs.entry.js +5 -5
- package/cjs/lmvz-message.cjs.entry.js +2 -2
- package/cjs/lmvz-modal.cjs.entry.js +4 -4
- package/cjs/lmvz-radio.cjs.entry.js +3 -3
- package/cjs/lmvz-select.cjs.entry.js +3 -3
- package/cjs/lmvz-snackbar.cjs.entry.js +2 -2
- package/cjs/lmvz-spinner.cjs.entry.js +2 -2
- package/cjs/lmvz-tab.cjs.entry.js +2 -2
- package/cjs/lmvz-tabs.cjs.entry.js +4 -4
- package/cjs/lmvz-toggle.cjs.entry.js +4 -5
- package/cjs/loader.cjs.js +2 -2
- package/cjs/{async.util-Dnl6c82X.js → stencil.util-TjS8_DoU.js} +13 -1
- package/collection/assets/icons/calendar.svg +7 -0
- package/collection/collection-manifest.json +1 -0
- package/collection/components/lmvz-datepicker/lmvz-datepicker.css +166 -0
- package/collection/components/lmvz-datepicker/lmvz-datepicker.js +988 -0
- package/collection/components/lmvz-datepicker/lmvz-datepicker.utils.js +189 -0
- package/collection/components/lmvz-datepicker/test/lmvz-datepicker.utils.unit.js +300 -0
- package/collection/components/lmvz-header/lmvz-header.js +1 -1
- package/collection/components/lmvz-icon/lmvz-icon.js +1 -1
- package/collection/components/lmvz-input/lmvz-input.js +40 -2
- package/collection/components/lmvz-link/lmvz-link.js +1 -1
- package/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -1
- package/collection/components/lmvz-message/lmvz-message.js +1 -1
- package/collection/components/lmvz-modal/lmvz-modal.js +1 -1
- package/collection/components/lmvz-popover/lmvz-popover.js +6 -2
- package/collection/components/lmvz-radio/lmvz-radio.js +1 -1
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- package/collection/components/lmvz-snackbar/lmvz-snackbar.js +1 -1
- package/collection/components/lmvz-spinner/lmvz-spinner.js +1 -1
- package/collection/components/lmvz-tab/lmvz-tab.js +1 -1
- package/collection/components/lmvz-tabs/lmvz-tabs.js +1 -1
- package/collection/components/lmvz-toggle/lmvz-toggle.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/utils/aria/aria.constants.js +7 -0
- package/collection/utils/aria/directional-focus-controller.js +3 -1
- package/collection/utils/element/element.util.js +5 -0
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.bak +2 -0
- package/components/index.js +1 -1
- package/components/lmvz-action-list.js +1 -1
- package/components/lmvz-action.js +1 -1
- package/components/lmvz-button-group.js +1 -1
- package/components/lmvz-button.js +1 -1
- package/components/lmvz-card.js +1 -1
- package/components/lmvz-checkbox.js +1 -1
- package/components/lmvz-chip.js +1 -1
- package/components/lmvz-datepicker.d.ts +11 -0
- package/components/lmvz-datepicker.d.ts.bak +11 -0
- package/components/lmvz-datepicker.js +1 -0
- package/components/lmvz-header.js +1 -1
- package/components/lmvz-icon.js +1 -1
- package/components/lmvz-input.js +1 -1
- package/components/lmvz-link.js +1 -1
- package/components/lmvz-menuitem.js +1 -1
- package/components/lmvz-message.js +1 -1
- package/components/lmvz-modal.js +1 -1
- package/components/lmvz-popover.js +1 -1
- package/components/lmvz-radio.js +1 -1
- package/components/lmvz-select.js +1 -1
- package/components/lmvz-snackbar.js +1 -1
- package/components/lmvz-spinner.js +1 -1
- package/components/lmvz-tab.js +1 -1
- package/components/lmvz-tabs.js +1 -1
- package/components/lmvz-toggle.js +1 -1
- package/components/{p-Chj7BuUZ.js → p--FDdvoIg.js} +1 -1
- package/components/{p-CFTmV4XZ.js → p-BAj4FkUt.js} +1 -1
- package/components/{p-CxLd309t.js → p-BLMXiDE0.js} +1 -1
- package/components/{p-DGg7OzDl.js → p-BPYBmylI.js} +1 -1
- package/components/p-BhALzK62.js +1 -0
- package/components/{p-B_rnXUwq.js → p-Bnri3fEI.js} +1 -1
- package/components/p-C-pRMuMh.js +1 -0
- package/components/p-CPuI0_r_.js +1 -0
- package/components/p-CWpl0WaZ.js +1 -0
- package/components/{p-D5FL8n1q.js → p-CrQCHVKL.js} +1 -1
- package/components/p-DqdrUt_G.js +1 -0
- package/components/{p-CgK6-SEe.js → p-diOze8wI.js} +1 -1
- package/esm/{aria-validation-controller-BvOU1BO8.js → aria-validation-controller-Cp6pofER.js} +1 -1
- package/esm/{directional-focus-controller-DgAdCZrG.js → directional-focus-controller-Bhu7RqYE.js} +3 -1
- package/esm/{element-activation-controller-7PNSl6io.js → element-activation-controller-BuwyVq4A.js} +1 -1
- package/esm/{element.util-BFcYfHYq.js → element.util-Bd9JyKJZ.js} +13 -1
- package/esm/{index-BPeerEwm.js → index-BOXP1Vx0.js} +12 -1
- package/esm/lmvz-action-list.entry.js +4 -4
- package/esm/lmvz-action.entry.js +1 -1
- package/esm/lmvz-button-group.entry.js +2 -2
- package/esm/lmvz-button_2.entry.js +5 -5
- package/esm/lmvz-card.entry.js +1 -1
- package/esm/lmvz-checkbox.entry.js +2 -2
- package/esm/lmvz-chip.entry.js +2 -2
- package/esm/lmvz-components.js +3 -3
- package/esm/lmvz-datepicker.entry.js +2762 -0
- package/esm/lmvz-header_2.entry.js +6 -6
- package/esm/{lmvz-popover.entry.js → lmvz-input_2.entry.js} +227 -9
- package/esm/lmvz-link.entry.js +2 -2
- package/esm/lmvz-menuitem.entry.js +5 -5
- package/esm/lmvz-message.entry.js +2 -2
- package/esm/lmvz-modal.entry.js +4 -4
- package/esm/lmvz-radio.entry.js +3 -3
- package/esm/lmvz-select.entry.js +3 -3
- package/esm/lmvz-snackbar.entry.js +2 -2
- package/esm/lmvz-spinner.entry.js +2 -2
- package/esm/lmvz-tab.entry.js +2 -2
- package/esm/lmvz-tabs.entry.js +4 -4
- package/esm/lmvz-toggle.entry.js +4 -5
- package/esm/loader.js +3 -3
- package/esm/{async.util-DZj20TV1.js → stencil.util-C3QOYC8E.js} +13 -1
- package/hydrate/index.js +3079 -237
- package/hydrate/index.mjs +3079 -237
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-eb62d4af.entry.js → p-0af0211a.entry.js} +1 -1
- package/lmvz-components/{p-0c05f24b.entry.js → p-3d5867df.entry.js} +1 -1
- package/lmvz-components/{p-a887018d.entry.js → p-492adf21.entry.js} +1 -1
- package/lmvz-components/{p-24d13be6.entry.js → p-4fa6e72f.entry.js} +1 -1
- package/lmvz-components/{p-5bbbcfc0.entry.js → p-544e3ccb.entry.js} +1 -1
- package/lmvz-components/{p-eb4c5a6f.entry.js → p-63f6a596.entry.js} +1 -1
- package/lmvz-components/{p-d45164a8.entry.js → p-7a7aa922.entry.js} +1 -1
- package/lmvz-components/{p-b6dd045b.entry.js → p-8022c6dc.entry.js} +1 -1
- package/lmvz-components/{p-BPeerEwm.js → p-BOXP1Vx0.js} +2 -2
- package/lmvz-components/p-Bd9JyKJZ.js +1 -0
- package/lmvz-components/{p-D9PQIBzA.js → p-BeY96W7m.js} +1 -1
- package/lmvz-components/p-C3QOYC8E.js +1 -0
- package/lmvz-components/p-GGkwaiT6.js +1 -0
- package/lmvz-components/{p-wlMjNjuv.js → p-UhNgD4L3.js} +1 -1
- package/lmvz-components/{p-d4154a65.entry.js → p-a611c110.entry.js} +1 -1
- package/lmvz-components/{p-46edf36f.entry.js → p-b1bb4393.entry.js} +1 -1
- package/lmvz-components/p-b50b1cb5.entry.js +1 -0
- package/lmvz-components/{p-f42b16e6.entry.js → p-b932cf91.entry.js} +1 -1
- package/lmvz-components/p-bff115d4.entry.js +1 -0
- package/lmvz-components/p-d280d21a.entry.js +1 -0
- package/lmvz-components/{p-c2544495.entry.js → p-d48203f9.entry.js} +1 -1
- package/lmvz-components/{p-e4ce63b3.entry.js → p-d9aede81.entry.js} +1 -1
- package/lmvz-components/{p-ecbd9e93.entry.js → p-dbfbcb74.entry.js} +1 -1
- package/lmvz-components/{p-fbf066d9.entry.js → p-f0e28f3a.entry.js} +1 -1
- package/lmvz-components/{p-aaa7691c.entry.js → p-f853faae.entry.js} +1 -1
- package/lmvz-components/p-fa2efc42.entry.js +1 -0
- package/lmvz-components/{p-194a3af5.entry.js → p-fe6f5bdc.entry.js} +1 -1
- package/manifest.json +940 -159
- package/package.json +5 -1
- package/types/api/ds.constants.d.ts +0 -1
- package/types/api/ds.types.d.ts +8 -0
- package/types/components/lmvz-action/lmvz-action.d.ts +0 -1
- package/types/components/lmvz-action-list/lmvz-action-list.d.ts +0 -1
- package/types/components/lmvz-button/lmvz-button.d.ts +0 -1
- package/types/components/lmvz-button-group/lmvz-button-group.d.ts +0 -1
- package/types/components/lmvz-card/lmvz-card.d.ts +0 -1
- package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +0 -1
- package/types/components/lmvz-chip/lmvz-chip.d.ts +0 -1
- package/types/components/lmvz-datepicker/lmvz-datepicker.d.ts +75 -0
- package/types/components/lmvz-datepicker/lmvz-datepicker.utils.d.ts +22 -0
- package/types/components/lmvz-datepicker/test/lmvz-datepicker.utils.unit.d.ts +1 -0
- package/types/components/lmvz-header/lmvz-header.d.ts +0 -1
- package/types/components/lmvz-icon/lmvz-icon.d.ts +0 -1
- package/types/components/lmvz-input/lmvz-input.d.ts +5 -1
- package/types/components/lmvz-link/lmvz-link.d.ts +0 -1
- package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +0 -1
- package/types/components/lmvz-message/lmvz-message.d.ts +0 -1
- package/types/components/lmvz-message/public.d.ts +0 -1
- package/types/components/lmvz-modal/lmvz-modal.d.ts +0 -1
- package/types/components/lmvz-modal/test/testing.d.ts +0 -1
- package/types/components/lmvz-popover/lmvz-popover.d.ts +0 -1
- package/types/components/lmvz-radio/lmvz-radio.d.ts +0 -1
- package/types/components/lmvz-select/lmvz-select.d.ts +0 -1
- package/types/components/lmvz-snackbar/lmvz-snackbar.d.ts +0 -1
- package/types/components/lmvz-snackbar/public.d.ts +0 -1
- package/types/components/lmvz-snackbar/snackbar-controller.d.ts +0 -1
- package/types/components/lmvz-spinner/lmvz-spinner.d.ts +0 -1
- package/types/components/lmvz-tab/lmvz-tab.d.ts +0 -1
- package/types/components/lmvz-tabs/lmvz-tabs.d.ts +0 -1
- package/types/components/lmvz-toggle/lmvz-toggle.d.ts +0 -1
- package/types/components.d.ts +216 -0
- package/types/index.d.ts +0 -1
- package/types/utils/aria/aria-validation-controller.d.ts +0 -1
- package/types/utils/aria/aria.constants.d.ts +1 -1
- package/types/utils/aria/directional-focus-controller.d.ts +0 -1
- package/types/utils/aria/element-activation-controller.d.ts +0 -1
- package/types/utils/async/async.util.d.ts +1 -2
- package/types/utils/data/event.util.d.ts +0 -1
- package/types/utils/data/number.util.d.ts +0 -1
- package/types/utils/data/object.util.d.ts +0 -1
- package/types/utils/data/time.util.d.ts +0 -1
- package/types/utils/element/element.util.d.ts +1 -1
- package/types/utils/environment.d.ts +0 -1
- package/types/utils/icons/icons-registry.d.ts +0 -1
- package/types/utils/icons/icons.d.ts +0 -1
- package/types/utils/icons/icons.unit.d.ts +0 -1
- package/types/utils/icons/public.d.ts +0 -1
- package/types/utils/public.d.ts +0 -1
- package/types/utils/radio/radio-group-controller.d.ts +0 -1
- package/types/utils/stencil/assets.d.ts +0 -1
- package/types/utils/stencil/reactive-controller-host.d.ts +0 -1
- package/types/utils/stencil/stencil.util.d.ts +0 -1
- package/cjs/lmvz-input.cjs.entry.js +0 -186
- package/cjs/stencil.util-CBrPLd-F.js +0 -17
- package/components/p-DLUsBYJH.js +0 -1
- package/components/p-zMWemcoB.js +0 -1
- package/esm/lmvz-input.entry.js +0 -184
- package/esm/stencil.util-D2-5rsN3.js +0 -15
- package/lmvz-components/p-5ff55ba9.entry.js +0 -1
- package/lmvz-components/p-888e04d7.entry.js +0 -1
- package/lmvz-components/p-9dc420e2.entry.js +0 -1
- package/lmvz-components/p-BFcYfHYq.js +0 -1
- package/lmvz-components/p-BuEA0MWd.js +0 -1
- package/lmvz-components/p-DZj20TV1.js +0 -1
- package/lmvz-components/p-bh9cItsP.js +0 -1
- package/lmvz-components/p-c3e62aba.entry.js +0 -1
package/hydrate/index.mjs
CHANGED
|
@@ -5666,7 +5666,19 @@ const ariaAttributes = [
|
|
|
5666
5666
|
'aria-valuenow',
|
|
5667
5667
|
'aria-valuetext',
|
|
5668
5668
|
];
|
|
5669
|
+
const ariaHostMirrorAttributes = [
|
|
5670
|
+
'aria-haspopup',
|
|
5671
|
+
'aria-controls',
|
|
5672
|
+
'aria-expanded',
|
|
5673
|
+
'aria-activedescendant',
|
|
5674
|
+
'aria-autocomplete',
|
|
5675
|
+
];
|
|
5669
5676
|
|
|
5677
|
+
function isInputElement(element) {
|
|
5678
|
+
if (!element)
|
|
5679
|
+
return false;
|
|
5680
|
+
return ['INPUT', 'TEXTAREA', 'SELECT', 'LMVZ-INPUT', 'LMVZ-SELECT', 'LMVZ-DATEPICKER'].includes(element.tagName?.toUpperCase());
|
|
5681
|
+
}
|
|
5670
5682
|
function isActionButton(element) {
|
|
5671
5683
|
return ['LMVZ-BUTTON', 'BUTTON'].includes(element.tagName.toUpperCase());
|
|
5672
5684
|
}
|
|
@@ -5894,6 +5906,8 @@ class DirectionalFocusController {
|
|
|
5894
5906
|
this.applyFocusTarget(element, true);
|
|
5895
5907
|
}
|
|
5896
5908
|
handleKeydown = (event) => {
|
|
5909
|
+
if (isInputElement(event.target))
|
|
5910
|
+
return;
|
|
5897
5911
|
const intent = this.getFocusIntent(event.key);
|
|
5898
5912
|
if (!intent)
|
|
5899
5913
|
return;
|
|
@@ -8995,243 +9009,3030 @@ class LmvzChip extends ReactiveControllerHost {
|
|
|
8995
9009
|
}; }
|
|
8996
9010
|
}
|
|
8997
9011
|
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
const
|
|
9012
|
+
// Low-Level
|
|
9013
|
+
const expectedPositive = (entityName, num) => `Non-positive ${entityName}: ${num}`;
|
|
9014
|
+
const expectedFinite = (entityName, num) => `Non-finite ${entityName}: ${num}`;
|
|
9015
|
+
const forbiddenBigIntToNumber = (entityName) => `Cannot convert bigint to ${entityName}`;
|
|
9016
|
+
const invalidObject = 'Invalid object';
|
|
9017
|
+
const numberOutOfRange = (entityName, val, min, max) => invalidEntity$1(entityName, val) + `; must be between ${min}-${max}`;
|
|
9018
|
+
// Entity/Fields/Bags
|
|
9019
|
+
const invalidEntity$1 = (fieldName, val) => `Invalid ${fieldName}: ${val}`;
|
|
9001
9020
|
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
keyboardNavigationController = new DirectionalFocusController(this, { orientation: 'both' });
|
|
9011
|
-
get primaryMenuitems() {
|
|
9012
|
-
return this.primarySlot?.assignedElements({ flatten: false }) || [];
|
|
9013
|
-
}
|
|
9014
|
-
get secondaryMenuitems() {
|
|
9015
|
-
return this.secondarySlot?.assignedElements({ flatten: true }) || [];
|
|
9016
|
-
}
|
|
9017
|
-
get role() {
|
|
9018
|
-
return 'banner';
|
|
9019
|
-
}
|
|
9020
|
-
lmvzActiveNav;
|
|
9021
|
-
get secondarySlotName() {
|
|
9022
|
-
return `connect-nav-${this.lmvzActiveNav}`;
|
|
9023
|
-
}
|
|
9024
|
-
constructor(hostRef) {
|
|
9025
|
-
super();
|
|
9026
|
-
registerInstance(this, hostRef);
|
|
9027
|
-
this.addController(new AriaValidationController(this, { reValidateOnPropChanges: true }));
|
|
9028
|
-
this.addController(this.keyboardNavigationController);
|
|
9029
|
-
}
|
|
9030
|
-
handleActiveNavChange() {
|
|
9031
|
-
this.updateElementsActive();
|
|
9032
|
-
}
|
|
9033
|
-
async initFocus() {
|
|
9034
|
-
this.keyboardNavigationController.initFocus();
|
|
9035
|
-
}
|
|
9036
|
-
componentDidLoad() {
|
|
9037
|
-
this.primarySlot?.addEventListener('slotchange', this.handlePrimaryNavItemsChange.bind(this));
|
|
9038
|
-
this.handlePrimaryNavItemsChange();
|
|
9039
|
-
this.secondarySlot?.addEventListener('slotchange', this.handleSecondaryNavItemsChange.bind(this));
|
|
9040
|
-
super.componentDidLoad();
|
|
9041
|
-
}
|
|
9042
|
-
handlePrimaryNavItemsChange() {
|
|
9043
|
-
const items = this.primaryMenuitems;
|
|
9044
|
-
if (!items.length) {
|
|
9045
|
-
console.warn('Primary slot has no assigned elements. Please add navigation items to the primary slot.');
|
|
9046
|
-
return;
|
|
9047
|
-
}
|
|
9048
|
-
items.forEach((el) => {
|
|
9049
|
-
el.setAttribute('aria-haspopup', 'true');
|
|
9050
|
-
el.setAttribute('aria-controls', `nav-secondary`);
|
|
9051
|
-
});
|
|
9052
|
-
this.updateElementsActive();
|
|
9053
|
-
this.updateKeyboardNavSubjects();
|
|
9021
|
+
const nanoInMicro$1 = 1_000;
|
|
9022
|
+
const nanoInMilli$1 = 1_000_000;
|
|
9023
|
+
const nanoInSec$1 = 1_000_000_000;
|
|
9024
|
+
const nanoInMinute$1 = 60_000_000_000;
|
|
9025
|
+
const nanoInHour$1 = 3_600_000_000_000;
|
|
9026
|
+
function normalizeOptions(options) {
|
|
9027
|
+
if (options === undefined) {
|
|
9028
|
+
return Object.create(null);
|
|
9054
9029
|
}
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
this.updateKeyboardNavSubjects();
|
|
9061
|
-
}
|
|
9062
|
-
updateKeyboardNavSubjects() {
|
|
9063
|
-
this.keyboardNavigationController.updateElements([...this.primaryMenuitems, ...this.secondaryMenuitems]);
|
|
9030
|
+
return requireObjectLike(options);
|
|
9031
|
+
}
|
|
9032
|
+
function toFiniteNumber(arg, entityName = 'number') {
|
|
9033
|
+
if (typeof arg === 'bigint') {
|
|
9034
|
+
throw new TypeError(forbiddenBigIntToNumber(entityName));
|
|
9064
9035
|
}
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
return;
|
|
9069
|
-
let label = '';
|
|
9070
|
-
items.forEach((el) => {
|
|
9071
|
-
const isActive = el.id === this.lmvzActiveNav;
|
|
9072
|
-
if (isActive)
|
|
9073
|
-
label = el.textContent || el.id;
|
|
9074
|
-
el.setAttribute('aria-expanded', isActive ? 'true' : 'false');
|
|
9075
|
-
});
|
|
9076
|
-
if (!label)
|
|
9077
|
-
return;
|
|
9078
|
-
this.secondaryNav?.setAttribute('aria-label', `Untermenü für ${label}`);
|
|
9036
|
+
arg = Number(arg);
|
|
9037
|
+
if (!Number.isFinite(arg)) {
|
|
9038
|
+
throw new RangeError(expectedFinite(entityName, arg));
|
|
9079
9039
|
}
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9040
|
+
return arg;
|
|
9041
|
+
}
|
|
9042
|
+
function toIntegerWithTrunc(arg, entityName) {
|
|
9043
|
+
return Math.trunc(toFiniteNumber(arg, entityName)) || 0; // ensure no -0
|
|
9044
|
+
}
|
|
9045
|
+
function toPositiveIntegerWithTruncation(arg, entityName) {
|
|
9046
|
+
return requireNumberIsPositive(toIntegerWithTrunc(arg, entityName), entityName);
|
|
9047
|
+
}
|
|
9048
|
+
/*
|
|
9049
|
+
Already known to be number.
|
|
9050
|
+
*/
|
|
9051
|
+
function requireNumberIsPositive(num, entityName = 'number') {
|
|
9052
|
+
if (num <= 0) {
|
|
9053
|
+
throw new RangeError(expectedPositive(entityName, num));
|
|
9085
9054
|
}
|
|
9086
|
-
|
|
9087
|
-
|
|
9055
|
+
return num;
|
|
9056
|
+
}
|
|
9057
|
+
/*
|
|
9058
|
+
min/max are inclusive
|
|
9059
|
+
*/
|
|
9060
|
+
function constrainToRange$1(num, min, max) {
|
|
9061
|
+
return Math.min(Math.max(num, min), max);
|
|
9062
|
+
}
|
|
9063
|
+
function isObjectLike(arg) {
|
|
9064
|
+
return arg !== null && (typeof arg === 'object' || typeof arg === 'function');
|
|
9065
|
+
}
|
|
9066
|
+
function requireObjectLike(arg) {
|
|
9067
|
+
if (!isObjectLike(arg)) {
|
|
9068
|
+
throw new TypeError(invalidObject);
|
|
9088
9069
|
}
|
|
9089
|
-
|
|
9090
|
-
"lmvzActiveNav": [{
|
|
9091
|
-
"handleActiveNavChange": 0
|
|
9092
|
-
}]
|
|
9093
|
-
}; }
|
|
9094
|
-
static get style() { return lmvzHeaderCss(); }
|
|
9095
|
-
static get cmpMeta() { return {
|
|
9096
|
-
"$flags$": 777,
|
|
9097
|
-
"$tagName$": "lmvz-header",
|
|
9098
|
-
"$members$": {
|
|
9099
|
-
"role": [2561],
|
|
9100
|
-
"lmvzActiveNav": [1, "lmvz-active-nav"],
|
|
9101
|
-
"initFocus": [64]
|
|
9102
|
-
},
|
|
9103
|
-
"$listeners$": undefined,
|
|
9104
|
-
"$lazyBundleId$": "-",
|
|
9105
|
-
"$attrsToReflect$": [["role", "role"]]
|
|
9106
|
-
}; }
|
|
9070
|
+
return arg;
|
|
9107
9071
|
}
|
|
9108
9072
|
|
|
9109
|
-
const
|
|
9073
|
+
const invalidEntity = invalidEntity$1;
|
|
9110
9074
|
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
if (this.intersectionObserver && typeof this.intersectionObserver.disconnect === 'function') {
|
|
9140
|
-
this.intersectionObserver.disconnect();
|
|
9141
|
-
}
|
|
9142
|
-
this.intersectionObserver = undefined;
|
|
9143
|
-
super.disconnectedCallback();
|
|
9144
|
-
}
|
|
9145
|
-
async loadIconPathData() {
|
|
9146
|
-
{
|
|
9147
|
-
return;
|
|
9148
|
-
}
|
|
9149
|
-
}
|
|
9150
|
-
componentDidRender() {
|
|
9151
|
-
this.validationEl = this.el.querySelector('svg');
|
|
9152
|
-
this.ariaValidationController.revalidateAria();
|
|
9153
|
-
super.componentDidRender();
|
|
9154
|
-
}
|
|
9155
|
-
render() {
|
|
9156
|
-
return hAsync(Host, { key: '4fba217d573d968951819f12af24d775c8ac62dc', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
|
|
9157
|
-
}
|
|
9158
|
-
waitUntilVisible(callback, rootMargin = 50) {
|
|
9159
|
-
{
|
|
9160
|
-
callback();
|
|
9161
|
-
return;
|
|
9162
|
-
}
|
|
9163
|
-
}
|
|
9164
|
-
static get watchers() { return {
|
|
9165
|
-
"icon": [{
|
|
9166
|
-
"loadIconPathData": 0
|
|
9167
|
-
}],
|
|
9168
|
-
"iconset": [{
|
|
9169
|
-
"loadIconPathData": 0
|
|
9170
|
-
}]
|
|
9171
|
-
}; }
|
|
9172
|
-
static get style() { return lmvzIconCss(); }
|
|
9173
|
-
static get cmpMeta() { return {
|
|
9174
|
-
"$flags$": 514,
|
|
9175
|
-
"$tagName$": "lmvz-icon",
|
|
9176
|
-
"$members$": {
|
|
9177
|
-
"icon": [513],
|
|
9178
|
-
"weight": [513],
|
|
9179
|
-
"size": [513],
|
|
9180
|
-
"iconset": [513],
|
|
9181
|
-
"ariaLabel": [513, "aria-label"],
|
|
9182
|
-
"iconData": [32],
|
|
9183
|
-
"visible": [32]
|
|
9184
|
-
},
|
|
9185
|
-
"$listeners$": undefined,
|
|
9186
|
-
"$lazyBundleId$": "-",
|
|
9187
|
-
"$attrsToReflect$": [["icon", "icon"], ["weight", "weight"], ["size", "size"], ["iconset", "iconset"], ["ariaLabel", "aria-label"]]
|
|
9188
|
-
}; }
|
|
9075
|
+
const missingField = fieldName => `Missing ${fieldName}`;
|
|
9076
|
+
|
|
9077
|
+
const noValidFields = validFields => "No valid fields: " + validFields.join();
|
|
9078
|
+
|
|
9079
|
+
const invalidChoice = (fieldName, val, choiceMap) => invalidEntity$1(fieldName, val) + "; must be " + Object.keys(choiceMap).join();
|
|
9080
|
+
|
|
9081
|
+
const forbiddenValueOf$1 = "Cannot use valueOf";
|
|
9082
|
+
|
|
9083
|
+
const invalidCallingContext = "Invalid calling context";
|
|
9084
|
+
|
|
9085
|
+
const missingYear = allowEra => "Missing year" + (allowEra ? "/era/eraYear" : "");
|
|
9086
|
+
|
|
9087
|
+
const invalidLeapMonth = "Invalid leap month";
|
|
9088
|
+
|
|
9089
|
+
const exoticCalendarRequired = (calendarId, remedy) => `Unknown calendar ${calendarId}; might need ${remedy}`;
|
|
9090
|
+
|
|
9091
|
+
const invalidTimeZone = calendarId => invalidEntity$1("TimeZone", calendarId);
|
|
9092
|
+
|
|
9093
|
+
const outOfBoundsDate = "Out-of-bounds date";
|
|
9094
|
+
|
|
9095
|
+
const failedParse = s => `Cannot parse: ${s}`;
|
|
9096
|
+
|
|
9097
|
+
const invalidSubstring = substring => `Invalid substring: ${substring}`;
|
|
9098
|
+
|
|
9099
|
+
const constrainToRange = constrainToRange$1;
|
|
9100
|
+
|
|
9101
|
+
function throwRangeError(message) {
|
|
9102
|
+
throw new RangeError(message);
|
|
9189
9103
|
}
|
|
9190
9104
|
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
await wait();
|
|
9195
|
-
await nextFrame();
|
|
9196
|
-
};
|
|
9197
|
-
const raf = (h) => {
|
|
9198
|
-
if (typeof __zone_symbol__requestAnimationFrame === 'function') {
|
|
9199
|
-
return __zone_symbol__requestAnimationFrame(h);
|
|
9200
|
-
}
|
|
9201
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
9202
|
-
return requestAnimationFrame(h);
|
|
9203
|
-
}
|
|
9204
|
-
return setTimeout(h);
|
|
9205
|
-
};
|
|
9105
|
+
function throwTypeError(message) {
|
|
9106
|
+
throw new TypeError(message);
|
|
9107
|
+
}
|
|
9206
9108
|
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
}
|
|
9214
|
-
};
|
|
9215
|
-
const hasLazyBuild = (stencilEl) => {
|
|
9216
|
-
return stencilEl.componentOnReady !== undefined;
|
|
9217
|
-
};
|
|
9109
|
+
function clampProp(props, propName, min, max, overflow) {
|
|
9110
|
+
return clampEntity(propName, ((props, propName) => {
|
|
9111
|
+
const propVal = props[propName];
|
|
9112
|
+
return void 0 === propVal && throwTypeError(missingField(propName)), propVal;
|
|
9113
|
+
})(props, propName), min, max, overflow);
|
|
9114
|
+
}
|
|
9218
9115
|
|
|
9219
|
-
|
|
9116
|
+
function clampEntity(entityName, num, min, max, overflow, choices) {
|
|
9117
|
+
const clamped = constrainToRange(num, min, max);
|
|
9118
|
+
return overflow && num !== clamped && throwRangeError(((entityName, val, min, max, choices) => numberOutOfRange(entityName, val, min, max))(entityName, num, min, max)),
|
|
9119
|
+
clamped;
|
|
9120
|
+
}
|
|
9220
9121
|
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9122
|
+
function memoize(generator, MapClass = Map) {
|
|
9123
|
+
const map = new MapClass;
|
|
9124
|
+
return (key, ...otherArgs) => {
|
|
9125
|
+
if (map.has(key)) {
|
|
9126
|
+
return map.get(key);
|
|
9226
9127
|
}
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9128
|
+
const val = generator(key, ...otherArgs);
|
|
9129
|
+
return map.set(key, val), val;
|
|
9130
|
+
};
|
|
9131
|
+
}
|
|
9132
|
+
|
|
9133
|
+
const createNameDescriptors = name => createPropDescriptors({
|
|
9134
|
+
name: name
|
|
9135
|
+
});
|
|
9136
|
+
|
|
9137
|
+
const createPropDescriptors = (propVals, readonly) => mapProps(value => ({
|
|
9138
|
+
value: value,
|
|
9139
|
+
configurable: 1,
|
|
9140
|
+
writable: false
|
|
9141
|
+
}), propVals);
|
|
9142
|
+
|
|
9143
|
+
const createStringTagDescriptors = value => ({
|
|
9144
|
+
[Symbol.toStringTag]: {
|
|
9145
|
+
value: value,
|
|
9146
|
+
configurable: 1
|
|
9147
|
+
}
|
|
9148
|
+
});
|
|
9149
|
+
|
|
9150
|
+
function mapProps(transformer, props) {
|
|
9151
|
+
const res = {};
|
|
9152
|
+
for (const propName in props) {
|
|
9153
|
+
res[propName] = transformer(props[propName], propName);
|
|
9154
|
+
}
|
|
9155
|
+
return res;
|
|
9156
|
+
}
|
|
9157
|
+
|
|
9158
|
+
function zipPropsConst(propNames, propVal) {
|
|
9159
|
+
const res = {};
|
|
9160
|
+
for (const propName of propNames) {
|
|
9161
|
+
res[propName] = propVal;
|
|
9162
|
+
}
|
|
9163
|
+
return res;
|
|
9164
|
+
}
|
|
9165
|
+
|
|
9166
|
+
function createPropGetters(propNames) {
|
|
9167
|
+
const getters = {};
|
|
9168
|
+
for (const propName of propNames) {
|
|
9169
|
+
getters[propName] = slots => slots[propName];
|
|
9170
|
+
}
|
|
9171
|
+
return getters;
|
|
9172
|
+
}
|
|
9173
|
+
|
|
9174
|
+
function pluckProps(propNames, props, dest = Object.create(null)) {
|
|
9175
|
+
for (const propName of propNames) {
|
|
9176
|
+
dest[propName] = props[propName];
|
|
9177
|
+
}
|
|
9178
|
+
return dest;
|
|
9179
|
+
}
|
|
9180
|
+
|
|
9181
|
+
function bindArgs(f, ...boundArgs) {
|
|
9182
|
+
return (...dynamicArgs) => f(...boundArgs, ...dynamicArgs);
|
|
9183
|
+
}
|
|
9184
|
+
|
|
9185
|
+
function noop() {}
|
|
9186
|
+
|
|
9187
|
+
function capitalize(s) {
|
|
9188
|
+
return s[0].toUpperCase() + s.substring(1);
|
|
9189
|
+
}
|
|
9190
|
+
|
|
9191
|
+
function sortStrings(...strss) {
|
|
9192
|
+
return [].concat(...strss).sort();
|
|
9193
|
+
}
|
|
9194
|
+
|
|
9195
|
+
function createRegExp(meat) {
|
|
9196
|
+
return new RegExp(`^${meat}$`, "i");
|
|
9197
|
+
}
|
|
9198
|
+
|
|
9199
|
+
function parseSubsecNano(fracStr) {
|
|
9200
|
+
return parseInt(fracStr.padEnd(9, "0"));
|
|
9201
|
+
}
|
|
9202
|
+
|
|
9203
|
+
function parseSign(s) {
|
|
9204
|
+
return s && "+" !== s ? -1 : 1;
|
|
9205
|
+
}
|
|
9206
|
+
|
|
9207
|
+
function parseInt0(s) {
|
|
9208
|
+
return void 0 === s ? 0 : parseInt(s);
|
|
9209
|
+
}
|
|
9210
|
+
|
|
9211
|
+
function padNumber(digits, num) {
|
|
9212
|
+
return String(num).padStart(digits, "0");
|
|
9213
|
+
}
|
|
9214
|
+
|
|
9215
|
+
const padNumber2 = /*@__PURE__*/ bindArgs(padNumber, 2);
|
|
9216
|
+
|
|
9217
|
+
function compareNumbers(a, b) {
|
|
9218
|
+
return Math.sign(a - b);
|
|
9219
|
+
}
|
|
9220
|
+
|
|
9221
|
+
function divFloorBigInt(num, denom) {
|
|
9222
|
+
const whole = num / denom;
|
|
9223
|
+
return num % denom < 0n ? whole - 1n : whole;
|
|
9224
|
+
}
|
|
9225
|
+
|
|
9226
|
+
function divModFloorBigInt(num, divisor) {
|
|
9227
|
+
const quotient = divFloorBigInt(num, divisor);
|
|
9228
|
+
return [ quotient, num - quotient * divisor ];
|
|
9229
|
+
}
|
|
9230
|
+
|
|
9231
|
+
function divModFloor(num, divisor) {
|
|
9232
|
+
return [ Math.floor(num / divisor), modFloor(num, divisor) ];
|
|
9233
|
+
}
|
|
9234
|
+
|
|
9235
|
+
function modFloor(num, divisor) {
|
|
9236
|
+
return (num % divisor + divisor) % divisor;
|
|
9237
|
+
}
|
|
9238
|
+
|
|
9239
|
+
function divTrunc(num, divisor) {
|
|
9240
|
+
return Math.trunc(num / divisor) || 0;
|
|
9241
|
+
}
|
|
9242
|
+
|
|
9243
|
+
function modTrunc(num, divisor) {
|
|
9244
|
+
return num % divisor || 0;
|
|
9245
|
+
}
|
|
9246
|
+
|
|
9247
|
+
const isoCalendarId = "iso8601";
|
|
9248
|
+
|
|
9249
|
+
const gregoryCalendarId = "gregory";
|
|
9250
|
+
|
|
9251
|
+
const gregoryEraOrigins = {
|
|
9252
|
+
"bce": -1,
|
|
9253
|
+
"ce": 0
|
|
9254
|
+
};
|
|
9255
|
+
|
|
9256
|
+
function normalizeEraName(era) {
|
|
9257
|
+
const normalized = era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
9258
|
+
return "bc" === normalized || "b" === normalized ? "bce" : "ad" === normalized || "a" === normalized ? "ce" : normalized;
|
|
9259
|
+
}
|
|
9260
|
+
|
|
9261
|
+
const isoCalendarImpl = void 0;
|
|
9262
|
+
|
|
9263
|
+
const gregoryCalendarImpl = 0;
|
|
9264
|
+
|
|
9265
|
+
function getCalendarSlotId(calendar) {
|
|
9266
|
+
return calendar === isoCalendarImpl ? "iso8601" : 0 === calendar ? "gregory" : calendar.id;
|
|
9267
|
+
}
|
|
9268
|
+
|
|
9269
|
+
const monthCodeRegExp = /^M(\d{2})(L?)$/;
|
|
9270
|
+
|
|
9271
|
+
function parseMonthCode(monthCode) {
|
|
9272
|
+
const m = monthCodeRegExp.exec(monthCode);
|
|
9273
|
+
return m || throwRangeError((monthCode => `Invalid monthCode: ${monthCode}`)(monthCode)),
|
|
9274
|
+
[ parseInt(m[1]), Boolean(m[2]) ];
|
|
9275
|
+
}
|
|
9276
|
+
|
|
9277
|
+
function formatMonthCode(monthCodeNumber, isLeapMonth) {
|
|
9278
|
+
return "M" + padNumber2(monthCodeNumber) + (isLeapMonth ? "L" : "");
|
|
9279
|
+
}
|
|
9280
|
+
|
|
9281
|
+
function monthCodeNumberToMonth(monthCodeNumber, isLeapMonth, leapMonth) {
|
|
9282
|
+
return monthCodeNumber + (isLeapMonth || leapMonth && monthCodeNumber >= leapMonth ? 1 : 0);
|
|
9283
|
+
}
|
|
9284
|
+
|
|
9285
|
+
const unitNameMap = {
|
|
9286
|
+
nanosecond: 0,
|
|
9287
|
+
microsecond: 1,
|
|
9288
|
+
millisecond: 2,
|
|
9289
|
+
second: 3,
|
|
9290
|
+
minute: 4,
|
|
9291
|
+
hour: 5,
|
|
9292
|
+
day: 6,
|
|
9293
|
+
week: 7,
|
|
9294
|
+
month: 8,
|
|
9295
|
+
year: 9
|
|
9296
|
+
};
|
|
9297
|
+
|
|
9298
|
+
const unitNamesAsc = /*@__PURE__*/ Object.keys(unitNameMap);
|
|
9299
|
+
|
|
9300
|
+
const nanoInMicro = nanoInMicro$1;
|
|
9301
|
+
|
|
9302
|
+
const nanoInMilli = nanoInMilli$1;
|
|
9303
|
+
|
|
9304
|
+
const nanoInSec = nanoInSec$1;
|
|
9305
|
+
|
|
9306
|
+
const nanoInMinute = nanoInMinute$1;
|
|
9307
|
+
|
|
9308
|
+
const nanoInHour = nanoInHour$1;
|
|
9309
|
+
|
|
9310
|
+
const nanoInUtcDay = 864e11;
|
|
9311
|
+
|
|
9312
|
+
const bigNanoInMicro = /*@__PURE__*/ BigInt(nanoInMicro);
|
|
9313
|
+
|
|
9314
|
+
const bigNanoInMilli = /*@__PURE__*/ BigInt(nanoInMilli);
|
|
9315
|
+
|
|
9316
|
+
const bigNanoInSec = /*@__PURE__*/ BigInt(nanoInSec);
|
|
9317
|
+
|
|
9318
|
+
const bigNanoInMinute = /*@__PURE__*/ BigInt(nanoInMinute);
|
|
9319
|
+
|
|
9320
|
+
const bigNanoInHour = /*@__PURE__*/ BigInt(nanoInHour);
|
|
9321
|
+
|
|
9322
|
+
const bigNanoInUtcDay = /*@__PURE__*/ BigInt(nanoInUtcDay);
|
|
9323
|
+
|
|
9324
|
+
const timeFieldNamesAsc = /*@__PURE__*/ unitNamesAsc.slice(0, 6);
|
|
9325
|
+
|
|
9326
|
+
const yearFieldNamesAsc = [ "year" ];
|
|
9327
|
+
|
|
9328
|
+
const dayFieldNamesAsc = [ "day" ];
|
|
9329
|
+
|
|
9330
|
+
const calendarDateFieldNamesAsc = [ "day", "month", "year" ];
|
|
9331
|
+
|
|
9332
|
+
const eraYearFieldNames = [ "era", "eraYear" ];
|
|
9333
|
+
|
|
9334
|
+
const allYearFieldNames = [ "era", "eraYear", "year" ];
|
|
9335
|
+
|
|
9336
|
+
const monthFieldNames = [ "month", "monthCode" ];
|
|
9337
|
+
|
|
9338
|
+
const monthDayFieldNames = [ "day", "month", "monthCode" ];
|
|
9339
|
+
|
|
9340
|
+
const yearMonthFieldNamesAlpha = /*@__PURE__*/ sortStrings(monthFieldNames, yearFieldNamesAsc);
|
|
9341
|
+
|
|
9342
|
+
const yearMonthCodeFieldNamesAlpha = /*@__PURE__*/ sortStrings([ "monthCode" ], yearFieldNamesAsc);
|
|
9343
|
+
|
|
9344
|
+
const yearMonthCodeFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearMonthCodeFieldNamesAlpha);
|
|
9345
|
+
|
|
9346
|
+
const dateFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, yearMonthFieldNamesAlpha);
|
|
9347
|
+
|
|
9348
|
+
const dateFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, eraYearFieldNames, yearMonthFieldNamesAlpha);
|
|
9349
|
+
|
|
9350
|
+
const yearMonthCodeDayFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, yearMonthCodeFieldNamesAlpha);
|
|
9351
|
+
|
|
9352
|
+
const yearMonthCodeDayFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, eraYearFieldNames, yearMonthCodeFieldNamesAlpha);
|
|
9353
|
+
|
|
9354
|
+
function validateTimeFields(timeFields) {
|
|
9355
|
+
return constrainTimeFields(timeFields, 1), timeFields;
|
|
9356
|
+
}
|
|
9357
|
+
|
|
9358
|
+
const maxValues = {
|
|
9359
|
+
hour: 23,
|
|
9360
|
+
minute: 59,
|
|
9361
|
+
second: 59
|
|
9362
|
+
};
|
|
9363
|
+
|
|
9364
|
+
function constrainTimeFields(timeFields, overflow) {
|
|
9365
|
+
const constrainedFields = {};
|
|
9366
|
+
for (const fieldName of timeFieldNamesAsc) {
|
|
9367
|
+
constrainedFields[fieldName] = clampEntity(fieldName, timeFields[fieldName], 0, maxValues[fieldName] || 999, overflow);
|
|
9368
|
+
}
|
|
9369
|
+
return constrainedFields;
|
|
9370
|
+
}
|
|
9371
|
+
|
|
9372
|
+
function timeFieldsToNano(timeFields) {
|
|
9373
|
+
return timeFieldsToSec(timeFields) * nanoInSec + timeFieldsToSubsecNano(timeFields);
|
|
9374
|
+
}
|
|
9375
|
+
|
|
9376
|
+
function timeFieldsToSec(timeFields) {
|
|
9377
|
+
return 3600 * timeFields.hour + 60 * timeFields.minute + timeFields.second;
|
|
9378
|
+
}
|
|
9379
|
+
|
|
9380
|
+
function timeFieldsToSubsecNano(timeFields) {
|
|
9381
|
+
return timeFields.millisecond * nanoInMilli + timeFields.microsecond * nanoInMicro + timeFields.nanosecond;
|
|
9382
|
+
}
|
|
9383
|
+
|
|
9384
|
+
function nanoToTimeAndDay(nano) {
|
|
9385
|
+
const [dayDelta, timeNano] = divModFloor(nano, nanoInUtcDay);
|
|
9386
|
+
return [ nanoToTimeFields(timeNano), dayDelta ];
|
|
9387
|
+
}
|
|
9388
|
+
|
|
9389
|
+
function nanoToTimeFields(timeNano) {
|
|
9390
|
+
const [timeMilli, nanoAfterMilli] = divModFloor(timeNano, nanoInMilli);
|
|
9391
|
+
const [microsecond, nanosecond] = divModFloor(nanoAfterMilli, nanoInMicro);
|
|
9392
|
+
return milliToTimeFields(timeMilli, microsecond, nanosecond);
|
|
9393
|
+
}
|
|
9394
|
+
|
|
9395
|
+
function milliToTimeFields(timeMilli, microsecond = 0, nanosecond = 0) {
|
|
9396
|
+
const [hour, milliAfterHour] = divModFloor(timeMilli, 36e5);
|
|
9397
|
+
const [minute, milliAfterMinute] = divModFloor(milliAfterHour, 6e4);
|
|
9398
|
+
const [second, millisecond] = divModFloor(milliAfterMinute, 1e3);
|
|
9399
|
+
return {
|
|
9400
|
+
hour: hour,
|
|
9401
|
+
minute: minute,
|
|
9402
|
+
second: second,
|
|
9403
|
+
millisecond: millisecond,
|
|
9404
|
+
microsecond: microsecond,
|
|
9405
|
+
nanosecond: nanosecond
|
|
9406
|
+
};
|
|
9407
|
+
}
|
|
9408
|
+
|
|
9409
|
+
function epochNanoToSecMod(epochNano) {
|
|
9410
|
+
const [epochSec, nano] = divModFloorBigInt(epochNano, bigNanoInSec);
|
|
9411
|
+
return [ Number(epochSec), Number(nano) ];
|
|
9412
|
+
}
|
|
9413
|
+
|
|
9414
|
+
function isoDateToEpochNano(isoDate) {
|
|
9415
|
+
return BigInt(isoDateToEpochDays(isoDate)) * bigNanoInUtcDay;
|
|
9416
|
+
}
|
|
9417
|
+
|
|
9418
|
+
function isoDateToEpochMilli(isoDate) {
|
|
9419
|
+
return 864e5 * isoDateToEpochDays(isoDate);
|
|
9420
|
+
}
|
|
9421
|
+
|
|
9422
|
+
function isoDateToEpochDays(isoDate) {
|
|
9423
|
+
return isoArgsToEpochDays(isoDate.year, isoDate.month, isoDate.day);
|
|
9424
|
+
}
|
|
9425
|
+
|
|
9426
|
+
function isoArgsToEpochDays(isoYear, isoMonth = 1, isoDay = 1) {
|
|
9427
|
+
const monthIndex = isoMonth - 1;
|
|
9428
|
+
return isoYear += Math.floor(monthIndex / 12), isoMonth = modFloor(monthIndex, 12),
|
|
9429
|
+
Date.UTC(isoYear % 400 - 400, isoMonth, 0) / 864e5 + 146097 * (divTrunc(isoYear, 400) + 1) + isoDay;
|
|
9430
|
+
}
|
|
9431
|
+
|
|
9432
|
+
function epochNanoToIsoDateTime(epochNano) {
|
|
9433
|
+
const [epochDays, nanoAfterDay] = divModFloorBigInt(epochNano, bigNanoInUtcDay);
|
|
9434
|
+
return {
|
|
9435
|
+
...epochDaysToIsoDate(Number(epochDays)),
|
|
9436
|
+
...nanoToTimeFields(Number(nanoAfterDay))
|
|
9437
|
+
};
|
|
9438
|
+
}
|
|
9439
|
+
|
|
9440
|
+
function epochDaysToIsoDate(epochDays) {
|
|
9441
|
+
const legacyDate = new Date(864e5 * modFloor(epochDays, 146097));
|
|
9442
|
+
return {
|
|
9443
|
+
year: legacyDate.getUTCFullYear() + 400 * Math.floor(epochDays / 146097),
|
|
9444
|
+
month: legacyDate.getUTCMonth() + 1,
|
|
9445
|
+
day: legacyDate.getUTCDate()
|
|
9446
|
+
};
|
|
9447
|
+
}
|
|
9448
|
+
|
|
9449
|
+
function computeIsoMonthCodeParts(month) {
|
|
9450
|
+
return [ month, 0 ];
|
|
9451
|
+
}
|
|
9452
|
+
|
|
9453
|
+
function computeIsoFieldsFromParts(year, month, day) {
|
|
9454
|
+
return {
|
|
9455
|
+
year: year,
|
|
9456
|
+
month: month,
|
|
9457
|
+
day: day
|
|
9458
|
+
};
|
|
9459
|
+
}
|
|
9460
|
+
|
|
9461
|
+
function computeIsoDaysInMonth(year, month) {
|
|
9462
|
+
switch (month) {
|
|
9463
|
+
case 2:
|
|
9464
|
+
return computeIsoInLeapYear(year) ? 29 : 28;
|
|
9465
|
+
|
|
9466
|
+
case 4:
|
|
9467
|
+
case 6:
|
|
9468
|
+
case 9:
|
|
9469
|
+
case 11:
|
|
9470
|
+
return 30;
|
|
9471
|
+
}
|
|
9472
|
+
return 31;
|
|
9473
|
+
}
|
|
9474
|
+
|
|
9475
|
+
function computeIsoDaysInYear(year) {
|
|
9476
|
+
return computeIsoInLeapYear(year) ? 366 : 365;
|
|
9477
|
+
}
|
|
9478
|
+
|
|
9479
|
+
function computeIsoInLeapYear(year) {
|
|
9480
|
+
return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
|
|
9481
|
+
}
|
|
9482
|
+
|
|
9483
|
+
function addIsoMonths(year, month, monthDelta) {
|
|
9484
|
+
return year += divTrunc(monthDelta, 12), (month += modTrunc(monthDelta, 12)) < 1 ? (year--,
|
|
9485
|
+
month += 12) : month > 12 && (year++, month -= 12), {
|
|
9486
|
+
year: year,
|
|
9487
|
+
month: month
|
|
9488
|
+
};
|
|
9489
|
+
}
|
|
9490
|
+
|
|
9491
|
+
function computeIsoDayOfWeek(isoDateFields) {
|
|
9492
|
+
return modFloor(isoArgsToEpochDays(isoDateFields.year, isoDateFields.month, isoDateFields.day) + 4, 7) || 7;
|
|
9493
|
+
}
|
|
9494
|
+
|
|
9495
|
+
function computeIsoDayOfYear(isoDateFields) {
|
|
9496
|
+
return isoArgsToEpochDays(isoDateFields.year, isoDateFields.month, isoDateFields.day) - isoArgsToEpochDays(isoDateFields.year) + 1;
|
|
9497
|
+
}
|
|
9498
|
+
|
|
9499
|
+
function computeIsoWeekFields(isoDateFields) {
|
|
9500
|
+
let yearOfWeek = isoDateFields.year;
|
|
9501
|
+
let weekOfYear = Math.floor((computeIsoDayOfYear(isoDateFields) - computeIsoDayOfWeek(isoDateFields) + 10) / 7);
|
|
9502
|
+
let weeksInYear = computeIsoWeeksInYear(yearOfWeek);
|
|
9503
|
+
return weekOfYear < 1 ? weekOfYear = weeksInYear = computeIsoWeeksInYear(--yearOfWeek) : weekOfYear > weeksInYear && (weekOfYear = 1,
|
|
9504
|
+
weeksInYear = computeIsoWeeksInYear(++yearOfWeek)), {
|
|
9505
|
+
weekOfYear: weekOfYear,
|
|
9506
|
+
yearOfWeek: yearOfWeek,
|
|
9507
|
+
Ie: weeksInYear
|
|
9508
|
+
};
|
|
9509
|
+
}
|
|
9510
|
+
|
|
9511
|
+
function computeIsoWeeksInYear(year) {
|
|
9512
|
+
const y0DayOfWeek = computeIsoDayOfWeek({
|
|
9513
|
+
year: year,
|
|
9514
|
+
month: 1,
|
|
9515
|
+
day: 1
|
|
9516
|
+
});
|
|
9517
|
+
return 4 === y0DayOfWeek || 3 === y0DayOfWeek && computeIsoInLeapYear(year) ? 53 : 52;
|
|
9518
|
+
}
|
|
9519
|
+
|
|
9520
|
+
function computeGregoryEraFields({year: year}) {
|
|
9521
|
+
return year < 1 ? {
|
|
9522
|
+
era: "bce",
|
|
9523
|
+
eraYear: 1 - year
|
|
9524
|
+
} : {
|
|
9525
|
+
era: "ce",
|
|
9526
|
+
eraYear: year
|
|
9527
|
+
};
|
|
9528
|
+
}
|
|
9529
|
+
|
|
9530
|
+
function validateIsoDateTimeFields(isoDateTime) {
|
|
9531
|
+
return validateIsoDateFields(isoDateTime), validateTimeFields(isoDateTime);
|
|
9532
|
+
}
|
|
9533
|
+
|
|
9534
|
+
function validateIsoDateFields(isoInternals) {
|
|
9535
|
+
return constrainIsoDateFields(isoInternals, 1), isoInternals;
|
|
9536
|
+
}
|
|
9537
|
+
|
|
9538
|
+
function constrainIsoDateFields(isoDate, overflow) {
|
|
9539
|
+
const {year: year} = isoDate;
|
|
9540
|
+
const month = clampProp(isoDate, "month", 1, 12, overflow);
|
|
9541
|
+
return {
|
|
9542
|
+
year: year,
|
|
9543
|
+
month: month,
|
|
9544
|
+
day: clampProp(isoDate, "day", 1, computeIsoDaysInMonth(year, month), overflow)
|
|
9545
|
+
};
|
|
9546
|
+
}
|
|
9547
|
+
|
|
9548
|
+
function computeCalendarDateFields(calendar, isoDate) {
|
|
9549
|
+
return calendar ? calendar.ie(isoDate) : isoDate;
|
|
9550
|
+
}
|
|
9551
|
+
|
|
9552
|
+
function computeCalendarMonthCodeParts(calendar, year, month) {
|
|
9553
|
+
return calendar ? calendar.O(year, month) : computeIsoMonthCodeParts(month);
|
|
9554
|
+
}
|
|
9555
|
+
|
|
9556
|
+
function computeCalendarEraFields(calendar, isoDate) {
|
|
9557
|
+
return 0 === calendar ? computeGregoryEraFields(isoDate) : calendar ? calendar.h(isoDate) : {};
|
|
9558
|
+
}
|
|
9559
|
+
|
|
9560
|
+
function computeCalendarIsoFieldsFromParts(calendar, year, month, day) {
|
|
9561
|
+
return calendar ? calendar.je(year, month, day) : computeIsoFieldsFromParts(year, month, day);
|
|
9562
|
+
}
|
|
9563
|
+
|
|
9564
|
+
function computeCalendarMonthsInYearForYear(calendar, year) {
|
|
9565
|
+
return calendar ? calendar.k(year) : 12;
|
|
9566
|
+
}
|
|
9567
|
+
|
|
9568
|
+
function computeCalendarDaysInMonthForYearMonth(calendar, year, month) {
|
|
9569
|
+
return calendar ? calendar.p(year, month) : computeIsoDaysInMonth(year, month);
|
|
9570
|
+
}
|
|
9571
|
+
|
|
9572
|
+
function computeCalendarMonthCode(calendar, isoDate) {
|
|
9573
|
+
const {year: year, month: month} = computeCalendarDateFields(calendar, isoDate);
|
|
9574
|
+
const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);
|
|
9575
|
+
return formatMonthCode(monthCodeNumber, isLeapMonth);
|
|
9576
|
+
}
|
|
9577
|
+
|
|
9578
|
+
function computeCalendarInLeapYear(calendar, isoDate) {
|
|
9579
|
+
const {year: year} = computeCalendarDateFields(calendar, isoDate);
|
|
9580
|
+
return calendar ? calendar.u(year) : computeIsoInLeapYear(year);
|
|
9581
|
+
}
|
|
9582
|
+
|
|
9583
|
+
function computeCalendarMonthsInYear(calendar, isoDate) {
|
|
9584
|
+
const {year: year} = computeCalendarDateFields(calendar, isoDate);
|
|
9585
|
+
return computeCalendarMonthsInYearForYear(calendar, year);
|
|
9586
|
+
}
|
|
9587
|
+
|
|
9588
|
+
function computeCalendarDaysInMonth(calendar, isoDate) {
|
|
9589
|
+
const {year: year, month: month} = computeCalendarDateFields(calendar, isoDate);
|
|
9590
|
+
return computeCalendarDaysInMonthForYearMonth(calendar, year, month);
|
|
9591
|
+
}
|
|
9592
|
+
|
|
9593
|
+
function computeCalendarDaysInYear(calendar, isoDate) {
|
|
9594
|
+
const {year: year} = computeCalendarDateFields(calendar, isoDate);
|
|
9595
|
+
return calendar ? calendar.j(year) : computeIsoDaysInYear(year);
|
|
9596
|
+
}
|
|
9597
|
+
|
|
9598
|
+
function computeCalendarDayOfYear(calendar, isoDate) {
|
|
9599
|
+
if (!calendar) {
|
|
9600
|
+
return computeIsoDayOfYear(isoDate);
|
|
9601
|
+
}
|
|
9602
|
+
const {year: year} = computeCalendarDateFields(calendar, isoDate);
|
|
9603
|
+
const yearStartIsoDate = computeCalendarIsoFieldsFromParts(calendar, year, 1, 1);
|
|
9604
|
+
return isoDateToEpochDays(isoDate) - isoDateToEpochDays(yearStartIsoDate) + 1;
|
|
9605
|
+
}
|
|
9606
|
+
|
|
9607
|
+
function computeCalendarWeekOfYear(calendar, isoDate) {
|
|
9608
|
+
return calendar === isoCalendarImpl ? computeIsoWeekFields(isoDate).weekOfYear : void 0;
|
|
9609
|
+
}
|
|
9610
|
+
|
|
9611
|
+
function computeCalendarYearOfWeek(calendar, isoDate) {
|
|
9612
|
+
return calendar === isoCalendarImpl ? computeIsoWeekFields(isoDate).yearOfWeek : void 0;
|
|
9613
|
+
}
|
|
9614
|
+
|
|
9615
|
+
const durationFieldNamesAsc = /*@__PURE__*/ unitNamesAsc.map(unitName => unitName + "s");
|
|
9616
|
+
|
|
9617
|
+
const durationDateFieldNamesAsc = /*@__PURE__*/ durationFieldNamesAsc.slice(6);
|
|
9618
|
+
|
|
9619
|
+
const durationCalendarFieldNamesAsc = /*@__PURE__*/ durationDateFieldNamesAsc.slice(1);
|
|
9620
|
+
|
|
9621
|
+
const durationFieldDefaults = /*@__PURE__*/ zipPropsConst(durationFieldNamesAsc, 0);
|
|
9622
|
+
|
|
9623
|
+
const requireString = /*@__PURE__*/ bindArgs(requireType, "string");
|
|
9624
|
+
|
|
9625
|
+
function requireType(typeName, arg, entityName = typeName) {
|
|
9626
|
+
return typeof arg !== typeName && throwTypeError(invalidEntity(entityName, arg)),
|
|
9627
|
+
arg;
|
|
9628
|
+
}
|
|
9629
|
+
|
|
9630
|
+
function requireNumberIsInteger(num, entityName = "number") {
|
|
9631
|
+
return Number.isInteger(num) || throwRangeError(((entityName, num) => `Non-integer ${entityName}: ${num}`)(entityName, num)),
|
|
9632
|
+
num || 0;
|
|
9633
|
+
}
|
|
9634
|
+
|
|
9635
|
+
function toString$4(arg) {
|
|
9636
|
+
return "symbol" == typeof arg && throwTypeError("Cannot convert Symbol to string"),
|
|
9637
|
+
String(arg);
|
|
9638
|
+
}
|
|
9639
|
+
|
|
9640
|
+
function toStringViaPrimitive(arg, entityName) {
|
|
9641
|
+
return isObjectLike(arg) ? String(arg) : requireString(arg, entityName);
|
|
9642
|
+
}
|
|
9643
|
+
|
|
9644
|
+
function toStrictInteger(arg, entityName) {
|
|
9645
|
+
return requireNumberIsInteger(toFiniteNumber(arg, entityName), entityName);
|
|
9646
|
+
}
|
|
9647
|
+
|
|
9648
|
+
const overflowMap = {
|
|
9649
|
+
constrain: 0,
|
|
9650
|
+
reject: 1
|
|
9651
|
+
};
|
|
9652
|
+
|
|
9653
|
+
const calendarDisplayMap = {
|
|
9654
|
+
auto: 0,
|
|
9655
|
+
never: 1,
|
|
9656
|
+
critical: 2,
|
|
9657
|
+
always: 3
|
|
9658
|
+
};
|
|
9659
|
+
|
|
9660
|
+
function coerceChoiceOption(optionName, enumNameMap, options, defaultChoice = 0) {
|
|
9661
|
+
const enumArg = options[optionName];
|
|
9662
|
+
if (void 0 === enumArg) {
|
|
9663
|
+
return defaultChoice;
|
|
9664
|
+
}
|
|
9665
|
+
const enumStr = toString$4(enumArg);
|
|
9666
|
+
const enumNum = enumNameMap[enumStr];
|
|
9667
|
+
return void 0 === enumNum && throwRangeError(invalidChoice(optionName, enumStr, enumNameMap)),
|
|
9668
|
+
enumNum;
|
|
9669
|
+
}
|
|
9670
|
+
|
|
9671
|
+
const coerceOverflow = /*@__PURE__*/ bindArgs(coerceChoiceOption, "overflow", overflowMap);
|
|
9672
|
+
|
|
9673
|
+
const coerceCalendarDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, "calendarName", calendarDisplayMap);
|
|
9674
|
+
|
|
9675
|
+
function combineDateAndTime(isoDate, time) {
|
|
9676
|
+
return pluckProps(calendarDateFieldNamesAsc, isoDate, pluckProps(timeFieldNamesAsc, time));
|
|
9677
|
+
}
|
|
9678
|
+
|
|
9679
|
+
function refineOverflowOptions(options) {
|
|
9680
|
+
return void 0 === options ? 0 : coerceOverflow(requireObjectLike(options));
|
|
9681
|
+
}
|
|
9682
|
+
|
|
9683
|
+
const epochNanoMax = /*@__PURE__*/ BigInt(1e8) * bigNanoInUtcDay;
|
|
9684
|
+
|
|
9685
|
+
const epochNanoMin = /*@__PURE__*/ BigInt(-1e8) * bigNanoInUtcDay;
|
|
9686
|
+
|
|
9687
|
+
const plainDateEpochNanoMin = epochNanoMin - bigNanoInUtcDay;
|
|
9688
|
+
|
|
9689
|
+
const isoYearMonthIndexMin = -3261848;
|
|
9690
|
+
|
|
9691
|
+
function checkIsoYearMonthInBounds(isoDate) {
|
|
9692
|
+
const isoYearMonthIndex = 12 * isoDate.year + isoDate.month;
|
|
9693
|
+
return (isoYearMonthIndex < isoYearMonthIndexMin || isoYearMonthIndex > 3309129) && throwRangeError(outOfBoundsDate),
|
|
9694
|
+
isoDate;
|
|
9695
|
+
}
|
|
9696
|
+
|
|
9697
|
+
function checkIsoDateInBounds(isoDate, allowPlainDateLowerEdge = 1) {
|
|
9698
|
+
return checkIsoDateEpochNanoInBounds(isoDateToEpochNano(isoDate), allowPlainDateLowerEdge),
|
|
9699
|
+
isoDate;
|
|
9700
|
+
}
|
|
9701
|
+
|
|
9702
|
+
function checkIsoDateTimeInBounds(isoDateTime) {
|
|
9703
|
+
const epochNano = isoDateToEpochNano(isoDateTime);
|
|
9704
|
+
return checkIsoDateEpochNanoInBounds(epochNano), epochNano !== plainDateEpochNanoMin || timeFieldsToNano(isoDateTime) || throwRangeError(outOfBoundsDate),
|
|
9705
|
+
isoDateTime;
|
|
9706
|
+
}
|
|
9707
|
+
|
|
9708
|
+
function checkIsoDateEpochNanoInBounds(epochNano, allowPlainDateLowerEdge = 1) {
|
|
9709
|
+
(epochNano < (allowPlainDateLowerEdge ? plainDateEpochNanoMin : epochNanoMin) || epochNano > epochNanoMax) && throwRangeError(outOfBoundsDate);
|
|
9710
|
+
}
|
|
9711
|
+
|
|
9712
|
+
function checkEpochNanoInBounds(epochNano) {
|
|
9713
|
+
return (epochNano < epochNanoMin || epochNano > epochNanoMax) && throwRangeError(outOfBoundsDate),
|
|
9714
|
+
epochNano;
|
|
9715
|
+
}
|
|
9716
|
+
|
|
9717
|
+
function isoDateTimeAndOffsetToEpochNano(isoDateTime, offsetNano) {
|
|
9718
|
+
return checkEpochNanoInBounds(isoDateToEpochNano(isoDateTime) + BigInt(timeFieldsToNano(isoDateTime) - offsetNano));
|
|
9719
|
+
}
|
|
9720
|
+
|
|
9721
|
+
function createDateSlots(isoDate, calendar) {
|
|
9722
|
+
return pluckProps(calendarDateFieldNamesAsc, isoDate, {
|
|
9723
|
+
calendar: calendar
|
|
9724
|
+
});
|
|
9725
|
+
}
|
|
9726
|
+
|
|
9727
|
+
function createDurationSlots(durationFields) {
|
|
9728
|
+
return pluckProps(durationFieldNamesAsc, durationFields, {
|
|
9729
|
+
sign: computeDurationSign(durationFields)
|
|
9730
|
+
});
|
|
9731
|
+
}
|
|
9732
|
+
|
|
9733
|
+
function moveYearMonth(doSubtract, calendar, isoDateFields, durationSlots, options) {
|
|
9734
|
+
const overflow = refineOverflowOptions(options);
|
|
9735
|
+
durationSlots.sign && getMaxDurationUnit(durationSlots) < 8 && throwRangeError("Cannot use small units");
|
|
9736
|
+
const startOfMonthFields = checkIsoDateInBounds(moveToStartOfMonth(calendar, isoDateFields));
|
|
9737
|
+
return moveToStartOfMonth(calendar, dateAddWithOverflow(calendar, startOfMonthFields, durationSlots, overflow));
|
|
9738
|
+
}
|
|
9739
|
+
|
|
9740
|
+
function moveToStartOfMonth(calendar, isoDateFields) {
|
|
9741
|
+
return moveByDays(isoDateFields, 1 - computeCalendarDateFields(calendar, isoDateFields).day);
|
|
9742
|
+
}
|
|
9743
|
+
|
|
9744
|
+
function moveByDays(isoDate, days) {
|
|
9745
|
+
return days ? epochDaysToIsoDate(isoDateToEpochDays(isoDate) + days) : isoDate;
|
|
9746
|
+
}
|
|
9747
|
+
|
|
9748
|
+
function dateAddWithOverflow(calendar, isoDateFields, durationFields, overflow) {
|
|
9749
|
+
let {years: years, months: months, weeks: weeks, days: days} = durationFields;
|
|
9750
|
+
let isoDate;
|
|
9751
|
+
if (days += Number(durationTimeToBigNano(durationFields) / bigNanoInUtcDay), years || months) {
|
|
9752
|
+
isoDate = addDateMonths(calendar, isoDateFields, years, months, overflow);
|
|
9753
|
+
} else {
|
|
9754
|
+
if (!weeks && !days) {
|
|
9755
|
+
return isoDateFields;
|
|
9756
|
+
}
|
|
9757
|
+
isoDate = isoDateFields;
|
|
9758
|
+
}
|
|
9759
|
+
return (weeks || days) && (isoDate = moveByDays(isoDate, 7 * weeks + days)), checkIsoDateInBounds(isoDate);
|
|
9760
|
+
}
|
|
9761
|
+
|
|
9762
|
+
function addDateMonths(calendar, isoDateFields, years, months, overflow) {
|
|
9763
|
+
const dateParts = computeCalendarDateFields(calendar, isoDateFields);
|
|
9764
|
+
let {year: year, month: month, day: day} = dateParts;
|
|
9765
|
+
if (years) {
|
|
9766
|
+
const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);
|
|
9767
|
+
year += years, month = computeYearMovedMonth(calendar, monthCodeNumber, isLeapMonth, calendar ? calendar.q(year) : void 0, overflow),
|
|
9768
|
+
month = clampEntity("month", month, 1, computeCalendarMonthsInYearForYear(calendar, year), overflow);
|
|
9769
|
+
}
|
|
9770
|
+
if (months) {
|
|
9771
|
+
const yearMonthParts = calendar ? calendar.N(year, month, months) : addIsoMonths(year, month, months);
|
|
9772
|
+
({year: year, month: month} = yearMonthParts);
|
|
9773
|
+
}
|
|
9774
|
+
return day = clampEntity("day", day, 1, computeCalendarDaysInMonthForYearMonth(calendar, year, month), overflow),
|
|
9775
|
+
computeCalendarIsoFieldsFromParts(calendar, year, month, day);
|
|
9776
|
+
}
|
|
9777
|
+
|
|
9778
|
+
function computeYearMovedMonth(calendar, monthCodeNumber, isLeapMonth, targetLeapMonth, overflow) {
|
|
9779
|
+
if (isLeapMonth) {
|
|
9780
|
+
const leapMonthMeta = calendar ? calendar.m : void 0;
|
|
9781
|
+
return void 0 !== targetLeapMonth && (leapMonthMeta < 0 || targetLeapMonth === monthCodeNumber + 1) ? targetLeapMonth : (1 === overflow && throwRangeError(invalidLeapMonth),
|
|
9782
|
+
leapMonthMeta < 0 ? -leapMonthMeta : monthCodeNumber);
|
|
9783
|
+
}
|
|
9784
|
+
return monthCodeNumberToMonth(monthCodeNumber, 0, targetLeapMonth);
|
|
9785
|
+
}
|
|
9786
|
+
|
|
9787
|
+
function computeDurationSign(fields, fieldNames = durationFieldNamesAsc) {
|
|
9788
|
+
let sign = 0;
|
|
9789
|
+
for (const fieldName of fieldNames) {
|
|
9790
|
+
const fieldSign = Math.sign(fields[fieldName]);
|
|
9791
|
+
fieldSign && (sign && sign !== fieldSign && throwRangeError("Cannot mix duration signs"),
|
|
9792
|
+
sign = fieldSign);
|
|
9793
|
+
}
|
|
9794
|
+
return sign;
|
|
9795
|
+
}
|
|
9796
|
+
|
|
9797
|
+
function validateDurationFields(fields) {
|
|
9798
|
+
for (const calendarUnit of durationCalendarFieldNamesAsc) {
|
|
9799
|
+
clampEntity(calendarUnit, fields[calendarUnit], -4294967295, 4294967295, 1);
|
|
9800
|
+
}
|
|
9801
|
+
const bigNano = durationDayTimeToBigNano(fields);
|
|
9802
|
+
return validateDurationTimeUnit(Number(bigNano / bigNanoInSec)), fields;
|
|
9803
|
+
}
|
|
9804
|
+
|
|
9805
|
+
function validateDurationTimeUnit(n) {
|
|
9806
|
+
Number.isSafeInteger(n) || throwRangeError("Out-of-bounds duration");
|
|
9807
|
+
}
|
|
9808
|
+
|
|
9809
|
+
function durationDayTimeToBigNano(fields) {
|
|
9810
|
+
return BigInt(fields.days) * bigNanoInUtcDay + durationTimeToBigNano(fields);
|
|
9811
|
+
}
|
|
9812
|
+
|
|
9813
|
+
function durationTimeToBigNano(fields) {
|
|
9814
|
+
return BigInt(fields.hours) * bigNanoInHour + BigInt(fields.minutes) * bigNanoInMinute + durationSubMinuteToBigNano(fields);
|
|
9815
|
+
}
|
|
9816
|
+
|
|
9817
|
+
function durationSubMinuteToBigNano(fields) {
|
|
9818
|
+
return BigInt(fields.seconds) * bigNanoInSec + BigInt(fields.milliseconds) * bigNanoInMilli + BigInt(fields.microseconds) * bigNanoInMicro + BigInt(fields.nanoseconds);
|
|
9819
|
+
}
|
|
9820
|
+
|
|
9821
|
+
function getMaxDurationUnit(fields) {
|
|
9822
|
+
let unit = 9;
|
|
9823
|
+
for (;unit > 0 && !fields[durationFieldNamesAsc[unit]]; unit--) {}
|
|
9824
|
+
return unit;
|
|
9825
|
+
}
|
|
9826
|
+
|
|
9827
|
+
function compareIsoDateFields(isoFields0, isoFields1) {
|
|
9828
|
+
return compareNumbers(isoDateToEpochDays(isoFields0), isoDateToEpochDays(isoFields1));
|
|
9829
|
+
}
|
|
9830
|
+
|
|
9831
|
+
function getCalendarEraOrigins(calendar) {
|
|
9832
|
+
return 0 === calendar ? gregoryEraOrigins : calendar ? calendar.l : void 0;
|
|
9833
|
+
}
|
|
9834
|
+
|
|
9835
|
+
function getCalendarFieldNames(calendar, fieldNames, fieldNamesWithEra = fieldNames) {
|
|
9836
|
+
return getCalendarEraOrigins(calendar) ? fieldNamesWithEra : fieldNames;
|
|
9837
|
+
}
|
|
9838
|
+
|
|
9839
|
+
function resolveCalendarYear(calendar, fields) {
|
|
9840
|
+
const exoticCalendar = calendar || void 0;
|
|
9841
|
+
const eraOrigins = getCalendarEraOrigins(calendar);
|
|
9842
|
+
let {era: era, eraYear: eraYear, year: year} = fields;
|
|
9843
|
+
if (void 0 !== year && (year = toIntegerWithTrunc(year, "year")), void 0 !== eraYear && (eraYear = toIntegerWithTrunc(eraYear, "eraYear")),
|
|
9844
|
+
void 0 !== era || void 0 !== eraYear) {
|
|
9845
|
+
void 0 !== era && void 0 !== eraYear || throwTypeError("Mismatching era/eraYear"),
|
|
9846
|
+
eraOrigins || throwRangeError("Forbidden era/eraYear");
|
|
9847
|
+
const normalizedEra = normalizeEraName(era);
|
|
9848
|
+
const eraOrigin = eraOrigins[normalizedEra];
|
|
9849
|
+
void 0 === eraOrigin && throwRangeError((era => `Invalid era: ${era}`)(era));
|
|
9850
|
+
const yearByEra = exoticCalendar?.te ? exoticCalendar.te(eraYear, normalizedEra, eraOrigin) : eraYearToYear(eraYear, eraOrigin);
|
|
9851
|
+
void 0 !== year && year !== yearByEra && throwRangeError("Mismatching year/eraYear"),
|
|
9852
|
+
year = yearByEra;
|
|
9853
|
+
} else {
|
|
9854
|
+
void 0 === year && throwTypeError(missingYear(eraOrigins));
|
|
9855
|
+
}
|
|
9856
|
+
return year;
|
|
9857
|
+
}
|
|
9858
|
+
|
|
9859
|
+
function resolveCalendarMonth(calendar, fields, year, overflow, monthCodeParts) {
|
|
9860
|
+
let {month: month, monthCode: monthCode} = fields;
|
|
9861
|
+
if (void 0 !== monthCode) {
|
|
9862
|
+
const monthByCode = ((calendar, monthCode, year, overflow, monthCodeParts = parseMonthCode(monthCode)) => {
|
|
9863
|
+
const leapMonth = calendar ? calendar.q(year) : void 0;
|
|
9864
|
+
const [monthCodeNumber, wantsLeapMonth] = monthCodeParts;
|
|
9865
|
+
let month = monthCodeNumberToMonth(monthCodeNumber, wantsLeapMonth, leapMonth);
|
|
9866
|
+
if (wantsLeapMonth) {
|
|
9867
|
+
const leapMonthMeta = calendar ? calendar.m : void 0;
|
|
9868
|
+
void 0 === leapMonthMeta && throwRangeError(invalidLeapMonth), leapMonthMeta > 0 ? (month > leapMonthMeta && throwRangeError(invalidLeapMonth),
|
|
9869
|
+
leapMonth !== month && (1 === overflow && throwRangeError(invalidLeapMonth), month = monthCodeNumberToMonth(monthCodeNumber, 0, leapMonth))) : (month !== -leapMonthMeta && throwRangeError(invalidLeapMonth),
|
|
9870
|
+
void 0 === leapMonth && 1 === overflow && throwRangeError(invalidLeapMonth));
|
|
9871
|
+
}
|
|
9872
|
+
return month;
|
|
9873
|
+
})(calendar, monthCode, year, overflow, monthCodeParts);
|
|
9874
|
+
void 0 !== month && month !== monthByCode && throwRangeError("Mismatching month/monthCode"),
|
|
9875
|
+
month = monthByCode, overflow = 1;
|
|
9876
|
+
} else {
|
|
9877
|
+
void 0 === month && throwTypeError("Missing month/monthCode");
|
|
9878
|
+
}
|
|
9879
|
+
return clampEntity("month", month, 1, computeCalendarMonthsInYearForYear(calendar, year), overflow);
|
|
9880
|
+
}
|
|
9881
|
+
|
|
9882
|
+
function resolveCalendarDay(calendar, fields, month, year, overflow) {
|
|
9883
|
+
return clampProp(fields, "day", 1, computeCalendarDaysInMonthForYearMonth(calendar, year, month), overflow);
|
|
9884
|
+
}
|
|
9885
|
+
|
|
9886
|
+
function eraYearToYear(eraYear, eraOrigin) {
|
|
9887
|
+
return (eraOrigin + eraYear) * (Math.sign(eraOrigin) || 1) || 0;
|
|
9888
|
+
}
|
|
9889
|
+
|
|
9890
|
+
const offsetRegExp = /*@__PURE__*/ createRegExp("([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?");
|
|
9891
|
+
|
|
9892
|
+
function parseOffsetNanoMaybe(s, onlyHourMinute) {
|
|
9893
|
+
const parts = offsetRegExp.exec(s);
|
|
9894
|
+
if (parts && (s => (s => {
|
|
9895
|
+
"T" !== s[0] && "t" !== s[0] || (s = s.slice(1));
|
|
9896
|
+
const fractionIndex = s.search(/[.,]/);
|
|
9897
|
+
const main = fractionIndex < 0 ? s : s.slice(0, fractionIndex);
|
|
9898
|
+
const parts = main.split(":");
|
|
9899
|
+
return 1 === parts.length ? /^(?:\d{2}|\d{4}|\d{6})$/i.test(main) : (2 === parts.length || 3 === parts.length) && parts.every(part => 2 === part.length && /^\d{2}$/i.test(part));
|
|
9900
|
+
})(s.slice(1)))(parts[0])) {
|
|
9901
|
+
return ((parts, onlyHourMinute) => {
|
|
9902
|
+
const firstSubMinutePart = parts[4] || parts[5];
|
|
9903
|
+
firstSubMinutePart && throwRangeError(invalidSubstring(firstSubMinutePart));
|
|
9904
|
+
const offsetNanoPos = parseInt0(parts[2]) * nanoInHour + parseInt0(parts[3]) * nanoInMinute + parseInt0(parts[4]) * nanoInSec + parseSubsecNano(parts[5] || "");
|
|
9905
|
+
return offsetNano = offsetNanoPos * parseSign(parts[1]), Math.abs(offsetNano) >= nanoInUtcDay && throwRangeError("Out-of-bounds offset"),
|
|
9906
|
+
offsetNano;
|
|
9907
|
+
var offsetNano;
|
|
9908
|
+
})(parts);
|
|
9909
|
+
}
|
|
9910
|
+
}
|
|
9911
|
+
|
|
9912
|
+
const dateFieldRefiners = {
|
|
9913
|
+
era: toStringViaPrimitive,
|
|
9914
|
+
month: toPositiveIntegerWithTruncation,
|
|
9915
|
+
monthCode(monthCode, entityName = "monthCode") {
|
|
9916
|
+
return ((monthCode, entityName) => {
|
|
9917
|
+
if ("string" == typeof monthCode) {
|
|
9918
|
+
return monthCode;
|
|
9919
|
+
}
|
|
9920
|
+
if (monthCode && "object" == typeof monthCode) {
|
|
9921
|
+
const monthCodeToString = monthCode.toString;
|
|
9922
|
+
if ("function" == typeof monthCodeToString) {
|
|
9923
|
+
return requireString(monthCodeToString.call(monthCode), entityName);
|
|
9924
|
+
}
|
|
9925
|
+
}
|
|
9926
|
+
return requireString(monthCode, entityName);
|
|
9927
|
+
})(monthCode, entityName);
|
|
9928
|
+
},
|
|
9929
|
+
day: toPositiveIntegerWithTruncation
|
|
9930
|
+
};
|
|
9931
|
+
|
|
9932
|
+
function readAndRefineBagFields(bag, validFieldNames, fieldRefiners, requiredFieldNames, disallowEmpty = !requiredFieldNames) {
|
|
9933
|
+
const res = {};
|
|
9934
|
+
let anyMatching = 0;
|
|
9935
|
+
for (const fieldName of validFieldNames) {
|
|
9936
|
+
let fieldVal = bag[fieldName];
|
|
9937
|
+
if (void 0 !== fieldVal) {
|
|
9938
|
+
anyMatching = 1;
|
|
9939
|
+
const refiner = fieldRefiners[fieldName];
|
|
9940
|
+
refiner && (fieldVal = refiner(fieldVal, fieldName)), res[fieldName] = fieldVal;
|
|
9941
|
+
} else {
|
|
9942
|
+
requiredFieldNames && requiredFieldNames.includes(fieldName) && throwTypeError(missingField(fieldName));
|
|
9943
|
+
}
|
|
9944
|
+
}
|
|
9945
|
+
return disallowEmpty && !anyMatching && throwTypeError(noValidFields(validFieldNames)),
|
|
9946
|
+
res;
|
|
9947
|
+
}
|
|
9948
|
+
|
|
9949
|
+
function createPlainDateFromFields(calendar, fields, options) {
|
|
9950
|
+
return createPlainDateFromPreparedFields(calendar, fields, prepareDateFields(calendar, fields), refineOverflowOptions(options));
|
|
9951
|
+
}
|
|
9952
|
+
|
|
9953
|
+
function createPlainDateFromPreparedFields(calendar, fields, prepared, overflow) {
|
|
9954
|
+
const year = prepared[1];
|
|
9955
|
+
const month = resolveCalendarMonth(calendar, fields, year, overflow, prepared[0]);
|
|
9956
|
+
return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, year, month, resolveCalendarDay(calendar, fields, month, year, overflow))), calendar);
|
|
9957
|
+
}
|
|
9958
|
+
|
|
9959
|
+
function parseMonthCodeField(fields) {
|
|
9960
|
+
if (void 0 !== fields.monthCode) {
|
|
9961
|
+
return parseMonthCode(fields.monthCode);
|
|
9962
|
+
}
|
|
9963
|
+
}
|
|
9964
|
+
|
|
9965
|
+
function prepareDateFields(calendar, fields) {
|
|
9966
|
+
const eraOrigins = getCalendarEraOrigins(calendar);
|
|
9967
|
+
return void 0 !== fields.year || void 0 !== fields.era && void 0 !== fields.eraYear || throwTypeError(missingYear(eraOrigins)),
|
|
9968
|
+
void 0 === fields.monthCode && void 0 === fields.month && throwTypeError("Missing month/monthCode"),
|
|
9969
|
+
void 0 === fields.day && throwTypeError(missingField("day")), [ parseMonthCodeField(fields), resolveCalendarYear(calendar, fields) ];
|
|
9970
|
+
}
|
|
9971
|
+
|
|
9972
|
+
function createPlainYearMonthFromFields(calendar, fields, options) {
|
|
9973
|
+
const eraOrigins = getCalendarEraOrigins(calendar);
|
|
9974
|
+
void 0 !== fields.year || void 0 !== fields.era && void 0 !== fields.eraYear || throwTypeError(missingYear(eraOrigins)),
|
|
9975
|
+
void 0 === fields.monthCode && void 0 === fields.month && throwTypeError("Missing month/monthCode");
|
|
9976
|
+
const monthCodeParts = parseMonthCodeField(fields);
|
|
9977
|
+
const year = resolveCalendarYear(calendar, fields);
|
|
9978
|
+
return createDateSlots(checkIsoYearMonthInBounds(computeCalendarIsoFieldsFromParts(calendar, year, resolveCalendarMonth(calendar, fields, year, refineOverflowOptions(options), monthCodeParts), 1)), calendar);
|
|
9979
|
+
}
|
|
9980
|
+
|
|
9981
|
+
const RawDateTimeFormat = Intl.DateTimeFormat;
|
|
9982
|
+
|
|
9983
|
+
function formatEpochMilliToPartsRecord(intlFormat, epochMilli) {
|
|
9984
|
+
epochMilli < -864e13 && throwRangeError(outOfBoundsDate);
|
|
9985
|
+
const parts = intlFormat.formatToParts(epochMilli);
|
|
9986
|
+
const hash = {};
|
|
9987
|
+
for (const part of parts) {
|
|
9988
|
+
hash[part.type] = part.value;
|
|
9989
|
+
}
|
|
9990
|
+
return hash;
|
|
9991
|
+
}
|
|
9992
|
+
|
|
9993
|
+
const timeZonePeriodDaysByName = {
|
|
9994
|
+
"El_Aaiun": 17,
|
|
9995
|
+
"Tucuman": 12,
|
|
9996
|
+
"Tirane": 11,
|
|
9997
|
+
"Riga": 10,
|
|
9998
|
+
"Simferopol": 9,
|
|
9999
|
+
"Vienna": 9,
|
|
10000
|
+
"Tunis": 8,
|
|
10001
|
+
"Boa_Vista": 6,
|
|
10002
|
+
"Fortaleza": 6,
|
|
10003
|
+
"Maceio": 6,
|
|
10004
|
+
"Noronha": 6,
|
|
10005
|
+
"Recife": 6,
|
|
10006
|
+
"Gaza": 6,
|
|
10007
|
+
"Hebron": 6,
|
|
10008
|
+
"DeNoronha": 6
|
|
10009
|
+
};
|
|
10010
|
+
|
|
10011
|
+
const minPossibleTransitionSec = -388152e4;
|
|
10012
|
+
|
|
10013
|
+
function refineDateDisplayOptions(options) {
|
|
10014
|
+
return coerceCalendarDisplay(normalizeOptions(options));
|
|
10015
|
+
}
|
|
10016
|
+
|
|
10017
|
+
function formatPlainDateIso(plainDateSlots, options) {
|
|
10018
|
+
return calendar = plainDateSlots.calendar, isoDate = plainDateSlots, calendarDisplay = refineDateDisplayOptions(options),
|
|
10019
|
+
formatIsoDateFields(isoDate) + formatCalendar(calendar, calendarDisplay);
|
|
10020
|
+
var calendar, isoDate, calendarDisplay;
|
|
10021
|
+
}
|
|
10022
|
+
|
|
10023
|
+
function formatDateIsoAuto(plainDateSlots) {
|
|
10024
|
+
return formatIsoDateFields(plainDateSlots) + (plainDateSlots.calendar === isoCalendarImpl ? "" : formatCalendarId(getCalendarSlotId(plainDateSlots.calendar), 0));
|
|
10025
|
+
}
|
|
10026
|
+
|
|
10027
|
+
function formatPlainYearMonthIso(plainYearMonthSlots, options) {
|
|
10028
|
+
return formatDateLikeIso(plainYearMonthSlots.calendar, formatIsoYearMonthFields, plainYearMonthSlots, refineDateDisplayOptions(options));
|
|
10029
|
+
}
|
|
10030
|
+
|
|
10031
|
+
function formatYearMonthIsoAuto(plainYearMonthSlots) {
|
|
10032
|
+
const calendar = plainYearMonthSlots.calendar;
|
|
10033
|
+
return calendar !== isoCalendarImpl ? formatIsoDateFields(plainYearMonthSlots) + formatCalendarId(getCalendarSlotId(calendar), 0) : formatIsoYearMonthFields(plainYearMonthSlots);
|
|
10034
|
+
}
|
|
10035
|
+
|
|
10036
|
+
function formatDateLikeIso(calendar, formatSimple, isoDate, calendarDisplay) {
|
|
10037
|
+
const showCalendar = calendarDisplay > 1 || 0 === calendarDisplay && calendar !== isoCalendarImpl;
|
|
10038
|
+
return 1 === calendarDisplay ? calendar === isoCalendarImpl ? formatSimple(isoDate) : formatIsoDateFields(isoDate) : showCalendar ? formatIsoDateFields(isoDate) + formatCalendarId(getCalendarSlotId(calendar), 2 === calendarDisplay) : formatSimple(isoDate);
|
|
10039
|
+
}
|
|
10040
|
+
|
|
10041
|
+
function formatIsoDateFields(isoDateFields) {
|
|
10042
|
+
return formatIsoYearMonthFields(isoDateFields) + "-" + padNumber2(isoDateFields.day);
|
|
10043
|
+
}
|
|
10044
|
+
|
|
10045
|
+
function formatIsoYearMonthFields(isoDateFields) {
|
|
10046
|
+
const {year: year} = isoDateFields;
|
|
10047
|
+
return (year < 0 || year > 9999 ? getSignStr(year) + padNumber(6, Math.abs(year)) : padNumber(4, year)) + "-" + padNumber2(isoDateFields.month);
|
|
10048
|
+
}
|
|
10049
|
+
|
|
10050
|
+
function formatOffsetNano(offsetNano, offsetDisplay = 0) {
|
|
10051
|
+
if (1 === offsetDisplay) {
|
|
10052
|
+
return "";
|
|
10053
|
+
}
|
|
10054
|
+
const [hour, nanoRemainder0] = divModFloor(Math.abs(offsetNano), nanoInHour);
|
|
10055
|
+
const [minute, nanoRemainder1] = divModFloor(nanoRemainder0, nanoInMinute);
|
|
10056
|
+
const [second, nanoRemainder2] = divModFloor(nanoRemainder1, nanoInSec);
|
|
10057
|
+
return getSignStr(offsetNano) + padNumber2(hour) + ":" + padNumber2(minute) + (second || nanoRemainder2 ? ":" + padNumber2(second) + formatSubsecNano(nanoRemainder2) : "");
|
|
10058
|
+
}
|
|
10059
|
+
|
|
10060
|
+
function formatCalendar(calendar, calendarDisplay) {
|
|
10061
|
+
return calendarDisplay > 1 || 0 === calendarDisplay && calendar !== isoCalendarImpl ? formatCalendarId(getCalendarSlotId(calendar), 2 === calendarDisplay) : "";
|
|
10062
|
+
}
|
|
10063
|
+
|
|
10064
|
+
function formatCalendarId(calendarId, isCritical) {
|
|
10065
|
+
return "[" + (isCritical ? "!" : "") + "u-ca=" + calendarId + "]";
|
|
10066
|
+
}
|
|
10067
|
+
|
|
10068
|
+
const trailingZerosRE = /0+$/;
|
|
10069
|
+
|
|
10070
|
+
function formatSubsecNano(totalNano, subsecDigits) {
|
|
10071
|
+
let s = padNumber(9, totalNano);
|
|
10072
|
+
return s = s.replace(trailingZerosRE, "") ,
|
|
10073
|
+
s ? "." + s : "";
|
|
10074
|
+
}
|
|
10075
|
+
|
|
10076
|
+
function getSignStr(num) {
|
|
10077
|
+
return num < 0 ? "-" : "+";
|
|
10078
|
+
}
|
|
10079
|
+
|
|
10080
|
+
const icuRegExp = /^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/;
|
|
10081
|
+
|
|
10082
|
+
const badCharactersRegExp = /[^\w\/:+-]+/;
|
|
10083
|
+
|
|
10084
|
+
function refineTimeZoneId(rawId) {
|
|
10085
|
+
return resolveTimeZoneId(requireString(rawId));
|
|
10086
|
+
}
|
|
10087
|
+
|
|
10088
|
+
function resolveTimeZoneId(rawId) {
|
|
10089
|
+
return resolveTimeZoneRecord(rawId).id;
|
|
10090
|
+
}
|
|
10091
|
+
|
|
10092
|
+
function resolveTimeZoneRecord(rawId) {
|
|
10093
|
+
const upperRawId = rawId.toUpperCase();
|
|
10094
|
+
const offsetRecord = (upperRawId => {
|
|
10095
|
+
const offsetNano = parseOffsetNanoMaybe(upperRawId);
|
|
10096
|
+
if (void 0 !== offsetNano) {
|
|
10097
|
+
return {
|
|
10098
|
+
id: formatOffsetNano(offsetNano),
|
|
10099
|
+
_: offsetNano,
|
|
10100
|
+
o: offsetNano
|
|
10101
|
+
};
|
|
10102
|
+
}
|
|
10103
|
+
})(upperRawId);
|
|
10104
|
+
if (offsetRecord) {
|
|
10105
|
+
return {
|
|
10106
|
+
kind: "fixed",
|
|
10107
|
+
...offsetRecord
|
|
10108
|
+
};
|
|
10109
|
+
}
|
|
10110
|
+
const normId = "UTC" === upperRawId ? "UTC" : (rawId => (badCharactersRegExp.test(rawId) && throwRangeError(invalidTimeZone(rawId)),
|
|
10111
|
+
icuRegExp.test(rawId) && throwRangeError("Forbidden ICU TimeZone"), rawId.toLowerCase().split("/").map((part, partI) => (part.length <= 3 || /\d/.test(part)) && !/etc|yap/.test(part) ? part.toUpperCase() : part.replace(/baja|dumont|[a-z]+/g, (a, i) => a.length <= 2 && !partI || "in" === a || "chat" === a ? a.toUpperCase() : a.length > 2 || !i ? capitalize(a).replace(/island|noronha|murdo|rivadavia|urville/, capitalize) : a)).join("/")))(rawId);
|
|
10112
|
+
return queryNamedTimeZoneRecord(normId);
|
|
10113
|
+
}
|
|
10114
|
+
|
|
10115
|
+
const queryNamedTimeZoneRecord = /*@__PURE__*/ memoize(normId => {
|
|
10116
|
+
if ("UTC" === normId) {
|
|
10117
|
+
return {
|
|
10118
|
+
kind: "utc",
|
|
10119
|
+
id: normId,
|
|
10120
|
+
o: normId
|
|
10121
|
+
};
|
|
10122
|
+
}
|
|
10123
|
+
const upperNormId = normId.toUpperCase();
|
|
10124
|
+
const format = queryTimeZoneIntlFormat(upperNormId);
|
|
10125
|
+
return {
|
|
10126
|
+
kind: "named",
|
|
10127
|
+
id: normId,
|
|
10128
|
+
format: format,
|
|
10129
|
+
o: format.resolvedOptions().timeZone
|
|
10130
|
+
};
|
|
10131
|
+
});
|
|
10132
|
+
|
|
10133
|
+
const queryTimeZoneIntlFormat = /*@__PURE__*/ memoize(upperNormId => new RawDateTimeFormat("en-u-hc-h23", {
|
|
10134
|
+
calendar: "iso8601",
|
|
10135
|
+
timeZone: upperNormId,
|
|
10136
|
+
era: "short",
|
|
10137
|
+
year: "numeric",
|
|
10138
|
+
month: "numeric",
|
|
10139
|
+
day: "numeric",
|
|
10140
|
+
hour: "numeric",
|
|
10141
|
+
minute: "numeric",
|
|
10142
|
+
second: "numeric"
|
|
10143
|
+
}));
|
|
10144
|
+
|
|
10145
|
+
function queryTimeZone(rawTimeZoneId) {
|
|
10146
|
+
const record = resolveTimeZoneRecord(rawTimeZoneId);
|
|
10147
|
+
return queryTimeZoneRecord(record.id, record);
|
|
10148
|
+
}
|
|
10149
|
+
|
|
10150
|
+
const queryTimeZoneRecord = /*@__PURE__*/ memoize((normTimeZoneId, record) => "named" === record.kind ? new IntlTimeZone(normTimeZoneId, record.o, record.format) : new FixedTimeZone(normTimeZoneId, record.o, "fixed" === record.kind ? record._ : 0));
|
|
10151
|
+
|
|
10152
|
+
class FixedTimeZone {
|
|
10153
|
+
constructor(id, compareKey, offsetNano) {
|
|
10154
|
+
this.id = id, this.o = compareKey, this._ = offsetNano;
|
|
10155
|
+
}
|
|
10156
|
+
C() {
|
|
10157
|
+
return this._;
|
|
10158
|
+
}
|
|
10159
|
+
R(isoDateTime) {
|
|
10160
|
+
return [ isoDateTimeAndOffsetToEpochNano(isoDateTime, this._) ];
|
|
10161
|
+
}
|
|
10162
|
+
U() {}
|
|
10163
|
+
}
|
|
10164
|
+
|
|
10165
|
+
class IntlTimeZone {
|
|
10166
|
+
constructor(id, compareKey, format) {
|
|
10167
|
+
this.id = id, this.o = compareKey, this.qe = ((computeOffsetSec, periodDays) => {
|
|
10168
|
+
const getSample = memoize(computeOffsetSec);
|
|
10169
|
+
const getSplit = memoize(createSplitTuple);
|
|
10170
|
+
const periodSec = 86400 * periodDays;
|
|
10171
|
+
function getOffsetSec(epochSec) {
|
|
10172
|
+
const [startEpochSec, endEpochSec] = computePeriod(epochSec, periodSec);
|
|
10173
|
+
const clampedStartEpochSec = clampIntlSampleEpochSec(startEpochSec);
|
|
10174
|
+
const clampedEndEpochSec = clampIntlSampleEpochSec(endEpochSec);
|
|
10175
|
+
const startOffsetSec = getSample(clampedStartEpochSec);
|
|
10176
|
+
const endOffsetSec = getSample(clampedEndEpochSec);
|
|
10177
|
+
return startOffsetSec === endOffsetSec ? startOffsetSec : pinch(getSplit(clampedStartEpochSec, clampedEndEpochSec), startOffsetSec, endOffsetSec, epochSec);
|
|
10178
|
+
}
|
|
10179
|
+
function pinch(split, startOffsetSec, endOffsetSec, forEpochSec) {
|
|
10180
|
+
let offsetSec;
|
|
10181
|
+
let splitDurSec;
|
|
10182
|
+
for (;(void 0 === forEpochSec || void 0 === (offsetSec = forEpochSec < split[0] ? startOffsetSec : forEpochSec >= split[1] ? endOffsetSec : void 0)) && (splitDurSec = split[1] - split[0]); ) {
|
|
10183
|
+
const middleEpochSec = split[0] + Math.floor(splitDurSec / 2);
|
|
10184
|
+
computeOffsetSec(middleEpochSec) === endOffsetSec ? split[1] = middleEpochSec : split[0] = middleEpochSec + 1;
|
|
10185
|
+
}
|
|
10186
|
+
return offsetSec;
|
|
10187
|
+
}
|
|
10188
|
+
return {
|
|
10189
|
+
Ee(zonedEpochSec) {
|
|
10190
|
+
const wideOffsetSec0 = getOffsetSec(zonedEpochSec - 86400);
|
|
10191
|
+
const wideOffsetSec1 = getOffsetSec(zonedEpochSec + 86400);
|
|
10192
|
+
const wideUtcEpochSec0 = zonedEpochSec - wideOffsetSec0;
|
|
10193
|
+
const wideUtcEpochSec1 = zonedEpochSec - wideOffsetSec1;
|
|
10194
|
+
if (wideOffsetSec0 === wideOffsetSec1) {
|
|
10195
|
+
return [ wideUtcEpochSec0 ];
|
|
10196
|
+
}
|
|
10197
|
+
const narrowOffsetSec0 = getOffsetSec(wideUtcEpochSec0);
|
|
10198
|
+
return narrowOffsetSec0 === getOffsetSec(wideUtcEpochSec1) ? [ zonedEpochSec - narrowOffsetSec0 ] : wideOffsetSec0 > wideOffsetSec1 ? [ wideUtcEpochSec0, wideUtcEpochSec1 ] : [];
|
|
10199
|
+
},
|
|
10200
|
+
De: getOffsetSec,
|
|
10201
|
+
U: function getTransition(epochSec, direction) {
|
|
10202
|
+
if (direction > 0 && epochSec >= 864e10) {
|
|
10203
|
+
return;
|
|
10204
|
+
}
|
|
10205
|
+
if (direction < 0) {
|
|
10206
|
+
if (epochSec <= minPossibleTransitionSec) {
|
|
10207
|
+
return;
|
|
10208
|
+
}
|
|
10209
|
+
const lookaheadEpochSec = getCurrentEpochSec() + 94867200;
|
|
10210
|
+
if (epochSec > lookaheadEpochSec) {
|
|
10211
|
+
return getTransition(lookaheadEpochSec, -1);
|
|
10212
|
+
}
|
|
10213
|
+
}
|
|
10214
|
+
const searchEpochSec = direction > 0 ? Math.max(epochSec, minPossibleTransitionSec) : epochSec;
|
|
10215
|
+
let [startEpochSec, endEpochSec] = computePeriod(searchEpochSec, periodSec);
|
|
10216
|
+
const inc = periodSec * direction;
|
|
10217
|
+
const searchLimit = direction > 0 ? Math.max(epochSec, getCurrentEpochSec()) + 94867200 : minPossibleTransitionSec;
|
|
10218
|
+
const inBounds = () => direction < 0 ? endEpochSec > searchLimit : startEpochSec < searchLimit;
|
|
10219
|
+
for (;inBounds(); ) {
|
|
10220
|
+
const clampedStartEpochSec = clampIntlSampleEpochSec(startEpochSec);
|
|
10221
|
+
const clampedEndEpochSec = clampIntlSampleEpochSec(endEpochSec);
|
|
10222
|
+
const startOffsetSec = getSample(clampedStartEpochSec);
|
|
10223
|
+
const endOffsetSec = getSample(clampedEndEpochSec);
|
|
10224
|
+
if (startOffsetSec !== endOffsetSec) {
|
|
10225
|
+
const split = getSplit(clampedStartEpochSec, clampedEndEpochSec);
|
|
10226
|
+
pinch(split, startOffsetSec, endOffsetSec);
|
|
10227
|
+
const transitionEpochSec = split[0];
|
|
10228
|
+
if ((compareNumbers(transitionEpochSec, epochSec) || 1) === direction) {
|
|
10229
|
+
return transitionEpochSec;
|
|
10230
|
+
}
|
|
10231
|
+
}
|
|
10232
|
+
startEpochSec += inc, endEpochSec += inc;
|
|
10233
|
+
}
|
|
10234
|
+
}
|
|
10235
|
+
};
|
|
10236
|
+
})((format => epochSec => {
|
|
10237
|
+
const intlParts = formatEpochMilliToPartsRecord(format, 1e3 * epochSec);
|
|
10238
|
+
return 86400 * isoArgsToEpochDays((intlParts => {
|
|
10239
|
+
const relatedYear = intlParts.relatedYear;
|
|
10240
|
+
if (void 0 !== relatedYear) {
|
|
10241
|
+
return parseInt(relatedYear);
|
|
10242
|
+
}
|
|
10243
|
+
const year = parseInt(intlParts.year);
|
|
10244
|
+
return void 0 !== intlParts.era && "bce" === normalizeEraName(intlParts.era) ? 1 - year : year;
|
|
10245
|
+
})(intlParts), parseInt(intlParts.month), parseInt(intlParts.day)) + 3600 * parseInt(intlParts.hour) + 60 * parseInt(intlParts.minute) + parseInt(intlParts.second) - epochSec;
|
|
10246
|
+
})(format), (timeZoneId => {
|
|
10247
|
+
const timeZoneName = timeZoneId.split("/").pop();
|
|
10248
|
+
return timeZonePeriodDaysByName[timeZoneName] || 60;
|
|
10249
|
+
})(id));
|
|
10250
|
+
}
|
|
10251
|
+
C(epochNano) {
|
|
10252
|
+
return this.qe.De((epochNano => epochNanoToSecMod(epochNano)[0])(epochNano)) * nanoInSec;
|
|
10253
|
+
}
|
|
10254
|
+
R(isoDateTime) {
|
|
10255
|
+
const zonedEpochSec = 86400 * isoDateToEpochDays(isoDateTime) + timeFieldsToSec(isoDateTime);
|
|
10256
|
+
const subsecNano = timeFieldsToSubsecNano(isoDateTime);
|
|
10257
|
+
return this.qe.Ee(zonedEpochSec).map(epochSec => checkEpochNanoInBounds(BigInt(epochSec) * bigNanoInSec + BigInt(subsecNano)));
|
|
10258
|
+
}
|
|
10259
|
+
U(epochNano, direction) {
|
|
10260
|
+
const [epochSec, subsecNano] = epochNanoToSecMod(epochNano);
|
|
10261
|
+
const resEpochSec = this.qe.U(epochSec + (direction > 0 || subsecNano ? 1 : 0), direction);
|
|
10262
|
+
if (void 0 !== resEpochSec) {
|
|
10263
|
+
return BigInt(resEpochSec) * bigNanoInSec;
|
|
10264
|
+
}
|
|
10265
|
+
}
|
|
10266
|
+
}
|
|
10267
|
+
|
|
10268
|
+
function getCurrentEpochSec() {
|
|
10269
|
+
return Math.floor(Date.now() / 1e3);
|
|
10270
|
+
}
|
|
10271
|
+
|
|
10272
|
+
function createSplitTuple(startEpochSec, endEpochSec) {
|
|
10273
|
+
return [ startEpochSec, endEpochSec ];
|
|
10274
|
+
}
|
|
10275
|
+
|
|
10276
|
+
function computePeriod(epochSec, periodSec) {
|
|
10277
|
+
const startEpochSec = Math.floor(epochSec / periodSec) * periodSec;
|
|
10278
|
+
return [ startEpochSec, startEpochSec + periodSec ];
|
|
10279
|
+
}
|
|
10280
|
+
|
|
10281
|
+
function clampIntlSampleEpochSec(epochSec) {
|
|
10282
|
+
return constrainToRange(epochSec, -1e10, 864e10);
|
|
10283
|
+
}
|
|
10284
|
+
|
|
10285
|
+
function refinePlainDateObjectLike(calendar, bag, options, requireFields = []) {
|
|
10286
|
+
return createPlainDateFromFields(calendar, readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha), dateFieldRefiners, requireFields), options);
|
|
10287
|
+
}
|
|
10288
|
+
|
|
10289
|
+
function throwFailedParse(s) {
|
|
10290
|
+
throwRangeError(failedParse(s));
|
|
10291
|
+
}
|
|
10292
|
+
|
|
10293
|
+
function parsePlainDate(s, resolveCalendar) {
|
|
10294
|
+
const slots = finalizeDateLike(parsePlainDateLike(requireString(s)), void 0, resolveCalendar);
|
|
10295
|
+
return createDateSlots(slots, slots.calendar);
|
|
10296
|
+
}
|
|
10297
|
+
|
|
10298
|
+
function parsePlainYearMonth(s, resolveCalendar) {
|
|
10299
|
+
const organized = parseYearMonthOnly(requireString(s));
|
|
10300
|
+
if (organized) {
|
|
10301
|
+
return requireIsoCalendar(organized), createDateSlots(checkIsoYearMonthInBounds(validateIsoDateFields(organized)), resolveCalendar(organized.calendarId));
|
|
10302
|
+
}
|
|
10303
|
+
const dateSlots = finalizeDateLike(parsePlainDateLike(s), projectIsoYearMonthDate, resolveCalendar);
|
|
10304
|
+
const {calendar: calendar} = dateSlots;
|
|
10305
|
+
return createDateSlots(moveToStartOfMonth(calendar, dateSlots), calendar);
|
|
10306
|
+
}
|
|
10307
|
+
|
|
10308
|
+
function requireIsoCalendar(organized) {
|
|
10309
|
+
"iso8601" !== organized.calendarId && throwRangeError(invalidSubstring(organized.calendarId));
|
|
10310
|
+
}
|
|
10311
|
+
|
|
10312
|
+
function parsePlainDateLike(s) {
|
|
10313
|
+
const organized = parseDateTimeLike(s);
|
|
10314
|
+
return organized && !organized.F || throwFailedParse(s), organized;
|
|
10315
|
+
}
|
|
10316
|
+
|
|
10317
|
+
function finalizeDateLike(organized, isoDateProjector, resolveCalendar) {
|
|
10318
|
+
return isoDateProjector && "iso8601" === organized.calendarId ? (validateIsoDateFields(organized),
|
|
10319
|
+
organized.fe && validateTimeFields(organized), finalizeDate(isoDateProjector(organized), resolveCalendar)) : organized.fe ? finalizeDateTime(organized, resolveCalendar) : finalizeDate(organized, resolveCalendar);
|
|
10320
|
+
}
|
|
10321
|
+
|
|
10322
|
+
function projectIsoYearMonthDate(organized) {
|
|
10323
|
+
const day = 12 * organized.year + organized.month === isoYearMonthIndexMin ? 20 : 1;
|
|
10324
|
+
return {
|
|
10325
|
+
...organized,
|
|
10326
|
+
day: day
|
|
10327
|
+
};
|
|
10328
|
+
}
|
|
10329
|
+
|
|
10330
|
+
function finalizeDateTime(organized, resolveCalendar) {
|
|
10331
|
+
return validateIsoDateTimeFields(organized), checkIsoDateTimeInBounds(organized),
|
|
10332
|
+
{
|
|
10333
|
+
...combineDateAndTime(organized, organized),
|
|
10334
|
+
calendar: resolveCalendar(organized.calendarId)
|
|
10335
|
+
};
|
|
10336
|
+
}
|
|
10337
|
+
|
|
10338
|
+
function finalizeDate(organized, resolveCalendar) {
|
|
10339
|
+
return validateIsoDateFields(organized), checkIsoDateInBounds(organized), {
|
|
10340
|
+
calendar: resolveCalendar(organized.calendarId),
|
|
10341
|
+
year: organized.year,
|
|
10342
|
+
month: organized.month,
|
|
10343
|
+
day: organized.day
|
|
10344
|
+
};
|
|
10345
|
+
}
|
|
10346
|
+
|
|
10347
|
+
function timeRegExpStr(separatorIndex) {
|
|
10348
|
+
return `(\\d{2})(?:(:?)(\\d{2})(?:\\${separatorIndex}(\\d{2})(?:[.,](\\d{1,9}))?)?)?`;
|
|
10349
|
+
}
|
|
10350
|
+
|
|
10351
|
+
function offsetRegExpStr(separatorIndex) {
|
|
10352
|
+
return "([+-])" + timeRegExpStr(separatorIndex);
|
|
10353
|
+
}
|
|
10354
|
+
|
|
10355
|
+
const dateTimeRegExpStr = "(?:(?:([+-])(\\d{6}))|(\\d{4}))(-?)(\\d{2})\\4(\\d{2})(?:[T ]" + timeRegExpStr(8) + "(Z|" + offsetRegExpStr(15) + ")?)?";
|
|
10356
|
+
|
|
10357
|
+
const yearMonthRegExp = /*@__PURE__*/ createRegExp("(?:(?:([+-])(\\d{6}))|(\\d{4}))-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})");
|
|
10358
|
+
|
|
10359
|
+
const dateTimeRegExp = /*@__PURE__*/ createRegExp(dateTimeRegExpStr + "((?:\\[(!?)([^\\]]*)\\]){0,9})");
|
|
10360
|
+
|
|
10361
|
+
const annotationRegExp = /*@__PURE__*/ new RegExp("\\[(!?)([^\\]]*)\\]", "g");
|
|
10362
|
+
|
|
10363
|
+
function parseDateTimeLike(s) {
|
|
10364
|
+
const parts = dateTimeRegExp.exec(s);
|
|
10365
|
+
return parts ? (parts => {
|
|
10366
|
+
const zOrOffset = parts[12];
|
|
10367
|
+
const hasZ = "Z" === (zOrOffset || "").toUpperCase();
|
|
10368
|
+
return {
|
|
10369
|
+
year: organizeIsoYearParts(parts),
|
|
10370
|
+
month: parseInt(parts[5]),
|
|
10371
|
+
day: parseInt(parts[6]),
|
|
10372
|
+
...organizeTimeParts(parts, 7),
|
|
10373
|
+
...organizeAnnotationParts(parts[19]),
|
|
10374
|
+
fe: Boolean(parts[7]),
|
|
10375
|
+
F: hasZ,
|
|
10376
|
+
offset: hasZ ? void 0 : zOrOffset
|
|
10377
|
+
};
|
|
10378
|
+
})(parts) : void 0;
|
|
10379
|
+
}
|
|
10380
|
+
|
|
10381
|
+
function parseYearMonthOnly(s) {
|
|
10382
|
+
const parts = yearMonthRegExp.exec(s);
|
|
10383
|
+
if (parts) {
|
|
10384
|
+
return (parts => ({
|
|
10385
|
+
year: organizeIsoYearParts(parts),
|
|
10386
|
+
month: parseInt(parts[4]),
|
|
10387
|
+
day: 1,
|
|
10388
|
+
...organizeAnnotationParts(parts[5])
|
|
10389
|
+
}))(parts);
|
|
10390
|
+
}
|
|
10391
|
+
}
|
|
10392
|
+
|
|
10393
|
+
function organizeTimeParts(parts, hourIndex) {
|
|
10394
|
+
const second = parseInt0(parts[hourIndex + 3]);
|
|
10395
|
+
return {
|
|
10396
|
+
...nanoToTimeAndDay(parseSubsecNano(parts[hourIndex + 4] || ""))[0],
|
|
10397
|
+
hour: parseInt0(parts[hourIndex]),
|
|
10398
|
+
minute: parseInt0(parts[hourIndex + 2]),
|
|
10399
|
+
second: 60 === second ? 59 : second
|
|
10400
|
+
};
|
|
10401
|
+
}
|
|
10402
|
+
|
|
10403
|
+
function organizeIsoYearParts(parts) {
|
|
10404
|
+
const yearSign = parseSign(parts[1]);
|
|
10405
|
+
const year = parseInt(parts[2] || parts[3]);
|
|
10406
|
+
return yearSign < 0 && !year && throwRangeError(invalidSubstring(-0)), yearSign * year;
|
|
10407
|
+
}
|
|
10408
|
+
|
|
10409
|
+
function organizeAnnotationParts(s) {
|
|
10410
|
+
let calendarIsCritical;
|
|
10411
|
+
let timeZoneId;
|
|
10412
|
+
const calendarIds = [];
|
|
10413
|
+
return s.replace(annotationRegExp, (whole, criticalStr, mainStr) => {
|
|
10414
|
+
const isCritical = Boolean(criticalStr);
|
|
10415
|
+
const [val, name] = mainStr.split("=").reverse();
|
|
10416
|
+
return name ? "u-ca" === name ? (calendarIds.push(val.toLowerCase()), calendarIsCritical || (calendarIsCritical = isCritical)) : (isCritical || /[A-Z]/.test(name)) && throwRangeError(invalidSubstring(whole)) : (timeZoneId && throwRangeError(invalidSubstring(whole)),
|
|
10417
|
+
timeZoneId = val), "";
|
|
10418
|
+
}), calendarIds.length > 1 && calendarIsCritical && throwRangeError(invalidSubstring(s)),
|
|
10419
|
+
{
|
|
10420
|
+
timeZoneId: timeZoneId,
|
|
10421
|
+
calendarId: calendarIds[0] || "iso8601"
|
|
10422
|
+
};
|
|
10423
|
+
}
|
|
10424
|
+
|
|
10425
|
+
function mergeCalendarFields(calendar, baseFields, additionalFields) {
|
|
10426
|
+
const merged = Object.assign(Object.create(null), baseFields);
|
|
10427
|
+
return spliceFields(merged, additionalFields, monthFieldNames), getCalendarEraOrigins(calendar) && (spliceFields(merged, additionalFields, allYearFieldNames),
|
|
10428
|
+
calendar && calendar.le && spliceFields(merged, additionalFields, monthDayFieldNames, eraYearFieldNames)),
|
|
10429
|
+
merged;
|
|
10430
|
+
}
|
|
10431
|
+
|
|
10432
|
+
function spliceFields(dest, additional, allPropNames, deletablePropNames) {
|
|
10433
|
+
let anyMatching = 0;
|
|
10434
|
+
const nonMatchingPropNames = [];
|
|
10435
|
+
for (const propName of allPropNames) {
|
|
10436
|
+
void 0 !== additional[propName] ? anyMatching = 1 : nonMatchingPropNames.push(propName);
|
|
10437
|
+
}
|
|
10438
|
+
if (Object.assign(dest, additional), anyMatching) {
|
|
10439
|
+
for (const deletablePropName of deletablePropNames || nonMatchingPropNames) {
|
|
10440
|
+
delete dest[deletablePropName];
|
|
10441
|
+
}
|
|
10442
|
+
}
|
|
10443
|
+
}
|
|
10444
|
+
|
|
10445
|
+
function convertPlainYearMonthToDate(calendar, input, bag) {
|
|
10446
|
+
return createPlainDateFromMergedFields(calendar, pluckProps(getCalendarFieldNames(calendar, yearMonthCodeFieldNamesAlpha, yearMonthCodeFieldNamesWithEraAlpha), input), readAndRefineBagFields(requireObjectLike(bag), dayFieldNamesAsc, dateFieldRefiners, []));
|
|
10447
|
+
}
|
|
10448
|
+
|
|
10449
|
+
function createPlainDateFromMergedFields(calendar, inputFields, extraFields) {
|
|
10450
|
+
const mergedFieldNames = getCalendarFieldNames(calendar, yearMonthCodeDayFieldNamesAlpha, yearMonthCodeDayFieldNamesWithEraAlpha);
|
|
10451
|
+
let mergedFields = mergeCalendarFields(calendar, inputFields, extraFields);
|
|
10452
|
+
return mergedFields = readAndRefineBagFields(mergedFields, mergedFieldNames, dateFieldRefiners, []),
|
|
10453
|
+
createPlainDateFromFields(calendar, mergedFields);
|
|
10454
|
+
}
|
|
10455
|
+
|
|
10456
|
+
function applyPlainFormatTimeZone(options) {
|
|
10457
|
+
return options.timeZone = "UTC", [ "full", "long" ].includes(options.timeStyle) && (options.timeStyle = "medium"),
|
|
10458
|
+
options;
|
|
10459
|
+
}
|
|
10460
|
+
|
|
10461
|
+
function checkResolvedCalendarCompatible(format, slots, strictCalendarCheck) {
|
|
10462
|
+
const resolvedCalendarId = format.resolvedOptions().calendar;
|
|
10463
|
+
slots.calendar === isoCalendarImpl || getCalendarSlotId(slots.calendar) === resolvedCalendarId || throwRangeError("Mismatching Calendars");
|
|
10464
|
+
}
|
|
10465
|
+
|
|
10466
|
+
function createOptionsTransformer(shapeFieldNames, invalidShapeFieldNames, ignoredFieldNames, defaultShapeFields, dateStyleReplacementFields) {
|
|
10467
|
+
const shapeFieldNameSet = new Set(shapeFieldNames);
|
|
10468
|
+
const invalidShapeFieldNameSet = new Set(invalidShapeFieldNames);
|
|
10469
|
+
const ignoredFieldNameSet = new Set(ignoredFieldNames);
|
|
10470
|
+
return (options, allowPartialOverlap) => {
|
|
10471
|
+
const analysis = ((options, shapeFieldNameSet, invalidShapeFieldNameSet, ignoredFieldNameSet) => {
|
|
10472
|
+
const analysis = {
|
|
10473
|
+
dateStyle: void 0,
|
|
10474
|
+
timeStyle: void 0,
|
|
10475
|
+
me: {},
|
|
10476
|
+
pe: {},
|
|
10477
|
+
xe: {},
|
|
10478
|
+
oe: 0,
|
|
10479
|
+
ue: 0
|
|
10480
|
+
};
|
|
10481
|
+
for (const name of Object.keys(options)) {
|
|
10482
|
+
const value = options[name];
|
|
10483
|
+
void 0 === value || ignoredFieldNameSet.has(name) || (shapeFieldNameSet.has(name) ? "dateStyle" === name ? analysis.dateStyle = value : "timeStyle" === name ? analysis.timeStyle = value : analysis.me[name] = value : "era" === name ? analysis.pe[name] = value : invalidShapeFieldNameSet.has(name) ? "dateStyle" === name || "timeStyle" === name ? analysis.ue = 1 : analysis.oe = 1 : analysis.xe[name] = value);
|
|
10484
|
+
}
|
|
10485
|
+
return analysis;
|
|
10486
|
+
})(options, shapeFieldNameSet, invalidShapeFieldNameSet, ignoredFieldNameSet);
|
|
10487
|
+
const hasDateStyle = void 0 !== analysis.dateStyle;
|
|
10488
|
+
const hasTimeStyle = void 0 !== analysis.timeStyle;
|
|
10489
|
+
const hasAnyStyle = hasDateStyle || hasTimeStyle;
|
|
10490
|
+
const hasGranularShapeFields = Object.keys(analysis.me).length > 0;
|
|
10491
|
+
const hasInvalids = analysis.oe || analysis.ue;
|
|
10492
|
+
const hasShapeFields = hasGranularShapeFields || hasDateStyle || hasTimeStyle;
|
|
10493
|
+
const hasModifierFields = Object.keys(analysis.pe).length > 0;
|
|
10494
|
+
const hasStyleConflictFields = hasGranularShapeFields || hasModifierFields || analysis.oe;
|
|
10495
|
+
(!allowPartialOverlap && hasInvalids || allowPartialOverlap && hasInvalids && !hasShapeFields || hasAnyStyle && hasStyleConflictFields) && throwTypeError("Invalid formatting options");
|
|
10496
|
+
const transformedOptions = {};
|
|
10497
|
+
return hasAnyStyle || hasShapeFields || Object.assign(transformedOptions, defaultShapeFields),
|
|
10498
|
+
Object.assign(transformedOptions, analysis.me, analysis.pe, analysis.xe),
|
|
10499
|
+
hasDateStyle && (dateStyleReplacementFields ? Object.assign(transformedOptions, dateStyleReplacementFields[analysis.dateStyle]) : transformedOptions.dateStyle = analysis.dateStyle),
|
|
10500
|
+
hasTimeStyle && (transformedOptions.timeStyle = analysis.timeStyle), transformedOptions;
|
|
10501
|
+
};
|
|
10502
|
+
}
|
|
10503
|
+
|
|
10504
|
+
const dateDefaultShapeFields = {
|
|
10505
|
+
year: "numeric",
|
|
10506
|
+
month: "numeric",
|
|
10507
|
+
day: "numeric"
|
|
10508
|
+
};
|
|
10509
|
+
|
|
10510
|
+
const dateShapeFieldNames = [ "weekday", "year", "month", "day", "dateStyle" ];
|
|
10511
|
+
|
|
10512
|
+
const timeShapeFieldNames = [ "dayPeriod", "hour", "minute", "second", "fractionalSecondDigits", "timeStyle" ];
|
|
10513
|
+
|
|
10514
|
+
const transformDateOptions = /*@__PURE__*/ createOptionsTransformer(dateShapeFieldNames, timeShapeFieldNames, [ "timeZoneName" ], dateDefaultShapeFields);
|
|
10515
|
+
|
|
10516
|
+
function getCurrentIsoDateTime(timeZone) {
|
|
10517
|
+
const epochNano = getCurrentEpochNano();
|
|
10518
|
+
const offsetNano = timeZone.C(epochNano);
|
|
10519
|
+
return epochNanoToIsoDateTime(epochNano + BigInt(offsetNano));
|
|
10520
|
+
}
|
|
10521
|
+
|
|
10522
|
+
function getCurrentEpochNano() {
|
|
10523
|
+
return BigInt(Date.now()) * bigNanoInMilli;
|
|
10524
|
+
}
|
|
10525
|
+
|
|
10526
|
+
function getCurrentTimeZoneId() {
|
|
10527
|
+
return (new RawDateTimeFormat).resolvedOptions().timeZone;
|
|
10528
|
+
}
|
|
10529
|
+
|
|
10530
|
+
const PlainYearMonthBranding = "PlainYearMonth";
|
|
10531
|
+
|
|
10532
|
+
const PlainDateBranding = "PlainDate";
|
|
10533
|
+
|
|
10534
|
+
const CalendarBranding = "Calendar";
|
|
10535
|
+
|
|
10536
|
+
function defineTemporalClass(branding, cls, getSlots, ...getterMaps) {
|
|
10537
|
+
Object.defineProperties(cls, createNameDescriptors(branding)), Object.defineProperties(cls.prototype, createStringTagDescriptors("Temporal." + branding));
|
|
10538
|
+
for (const getterMap of getterMaps) {
|
|
10539
|
+
defineSlotGetters(cls.prototype, getSlots, getterMap);
|
|
10540
|
+
}
|
|
10541
|
+
return cls;
|
|
10542
|
+
}
|
|
10543
|
+
|
|
10544
|
+
function defineSlotGetters(destPrototype, getSlots, getterMap) {
|
|
10545
|
+
Object.defineProperties(destPrototype, mapProps(getter => ({
|
|
10546
|
+
get() {
|
|
10547
|
+
return getter(getSlots(this));
|
|
10548
|
+
},
|
|
10549
|
+
configurable: 1
|
|
10550
|
+
}), getterMap));
|
|
10551
|
+
}
|
|
10552
|
+
|
|
10553
|
+
const attachDebugString = "noop" === noop.name ? instance => {
|
|
10554
|
+
Object.defineProperty(instance, "_str_", {
|
|
10555
|
+
value: instance.toJSON()
|
|
10556
|
+
});
|
|
10557
|
+
} : noop;
|
|
10558
|
+
|
|
10559
|
+
function invalidRecordType() {
|
|
10560
|
+
throwTypeError(invalidCallingContext);
|
|
10561
|
+
}
|
|
10562
|
+
|
|
10563
|
+
function forbiddenValueOf() {
|
|
10564
|
+
throwTypeError(forbiddenValueOf$1);
|
|
10565
|
+
}
|
|
10566
|
+
|
|
10567
|
+
const yearMonthFieldGetters$1 = {
|
|
10568
|
+
era(slots) {
|
|
10569
|
+
return computeCalendarEraFields(slots.calendar, slots).era;
|
|
10570
|
+
},
|
|
10571
|
+
eraYear(slots) {
|
|
10572
|
+
return computeCalendarEraFields(slots.calendar, slots).eraYear;
|
|
10573
|
+
},
|
|
10574
|
+
year(slots) {
|
|
10575
|
+
return computeCalendarDateFields(slots.calendar, slots).year;
|
|
10576
|
+
},
|
|
10577
|
+
month(slots) {
|
|
10578
|
+
return computeCalendarDateFields(slots.calendar, slots).month;
|
|
10579
|
+
},
|
|
10580
|
+
monthCode(slots) {
|
|
10581
|
+
return computeCalendarMonthCode(slots.calendar, slots);
|
|
10582
|
+
}
|
|
10583
|
+
};
|
|
10584
|
+
|
|
10585
|
+
const dateFieldGetters$1 = {
|
|
10586
|
+
era(slots) {
|
|
10587
|
+
return computeCalendarEraFields(slots.calendar, slots).era;
|
|
10588
|
+
},
|
|
10589
|
+
eraYear(slots) {
|
|
10590
|
+
return computeCalendarEraFields(slots.calendar, slots).eraYear;
|
|
10591
|
+
},
|
|
10592
|
+
year(slots) {
|
|
10593
|
+
return computeCalendarDateFields(slots.calendar, slots).year;
|
|
10594
|
+
},
|
|
10595
|
+
month(slots) {
|
|
10596
|
+
return computeCalendarDateFields(slots.calendar, slots).month;
|
|
10597
|
+
},
|
|
10598
|
+
monthCode(slots) {
|
|
10599
|
+
return computeCalendarMonthCode(slots.calendar, slots);
|
|
10600
|
+
},
|
|
10601
|
+
day(slots) {
|
|
10602
|
+
return computeCalendarDateFields(slots.calendar, slots).day;
|
|
10603
|
+
}
|
|
10604
|
+
};
|
|
10605
|
+
|
|
10606
|
+
const yearMonthDerivedGetters = {
|
|
10607
|
+
daysInMonth(slots) {
|
|
10608
|
+
return computeCalendarDaysInMonth(slots.calendar, slots);
|
|
10609
|
+
},
|
|
10610
|
+
daysInYear(slots) {
|
|
10611
|
+
return computeCalendarDaysInYear(slots.calendar, slots);
|
|
10612
|
+
},
|
|
10613
|
+
monthsInYear(slots) {
|
|
10614
|
+
return computeCalendarMonthsInYear(slots.calendar, slots);
|
|
10615
|
+
},
|
|
10616
|
+
inLeapYear(slots) {
|
|
10617
|
+
return computeCalendarInLeapYear(slots.calendar, slots);
|
|
10618
|
+
}
|
|
10619
|
+
};
|
|
10620
|
+
|
|
10621
|
+
const dateDerivedGetters = {
|
|
10622
|
+
dayOfWeek(slots) {
|
|
10623
|
+
return computeIsoDayOfWeek(slots);
|
|
10624
|
+
},
|
|
10625
|
+
dayOfYear(slots) {
|
|
10626
|
+
return computeCalendarDayOfYear(slots.calendar, slots);
|
|
10627
|
+
},
|
|
10628
|
+
weekOfYear(slots) {
|
|
10629
|
+
return computeCalendarWeekOfYear(slots.calendar, slots);
|
|
10630
|
+
},
|
|
10631
|
+
yearOfWeek(slots) {
|
|
10632
|
+
return computeCalendarYearOfWeek(slots.calendar, slots);
|
|
10633
|
+
},
|
|
10634
|
+
daysInWeek() {
|
|
10635
|
+
return 7;
|
|
10636
|
+
},
|
|
10637
|
+
daysInMonth(slots) {
|
|
10638
|
+
return computeCalendarDaysInMonth(slots.calendar, slots);
|
|
10639
|
+
},
|
|
10640
|
+
daysInYear(slots) {
|
|
10641
|
+
return computeCalendarDaysInYear(slots.calendar, slots);
|
|
10642
|
+
},
|
|
10643
|
+
monthsInYear(slots) {
|
|
10644
|
+
return computeCalendarMonthsInYear(slots.calendar, slots);
|
|
10645
|
+
},
|
|
10646
|
+
inLeapYear(slots) {
|
|
10647
|
+
return computeCalendarInLeapYear(slots.calendar, slots);
|
|
10648
|
+
}
|
|
10649
|
+
};
|
|
10650
|
+
|
|
10651
|
+
function createNativeGetters(shimGetters) {
|
|
10652
|
+
return createPropGetters(Object.keys(shimGetters));
|
|
10653
|
+
}
|
|
10654
|
+
|
|
10655
|
+
const yearMonthFieldGetters = /*@__PURE__*/ createNativeGetters(yearMonthFieldGetters$1);
|
|
10656
|
+
|
|
10657
|
+
const dateFieldGetters = /*@__PURE__*/ createNativeGetters(dateFieldGetters$1);
|
|
10658
|
+
|
|
10659
|
+
createNativeGetters(yearMonthDerivedGetters), createNativeGetters(dateDerivedGetters);
|
|
10660
|
+
|
|
10661
|
+
const PlainYearMonthRecordBranding = `${PlainYearMonthBranding}Record`;
|
|
10662
|
+
|
|
10663
|
+
const PlainDateRecordBranding = `${PlainDateBranding}Record`;
|
|
10664
|
+
|
|
10665
|
+
const CalendarRecordBranding = `${CalendarBranding}Record`;
|
|
10666
|
+
|
|
10667
|
+
const calendarMap = /*@__PURE__*/ new WeakMap;
|
|
10668
|
+
|
|
10669
|
+
const plainDateMap = /*@__PURE__*/ new WeakMap;
|
|
10670
|
+
|
|
10671
|
+
const plainYearMonthMap = /*@__PURE__*/ new WeakMap;
|
|
10672
|
+
|
|
10673
|
+
function getCalendarSlots(record) {
|
|
10674
|
+
return getCalendarSlotsIfPresent(record) || invalidRecordType();
|
|
10675
|
+
}
|
|
10676
|
+
|
|
10677
|
+
function getCalendarSlotsIfPresent(record) {
|
|
10678
|
+
return calendarMap.get(record);
|
|
10679
|
+
}
|
|
10680
|
+
|
|
10681
|
+
function getPlainDateSlots(record) {
|
|
10682
|
+
return getPlainDateSlotsIfPresent(record) || invalidRecordType();
|
|
10683
|
+
}
|
|
10684
|
+
|
|
10685
|
+
function getPlainDateSlotsIfPresent(record) {
|
|
10686
|
+
return plainDateMap.get(record);
|
|
10687
|
+
}
|
|
10688
|
+
|
|
10689
|
+
function setPlainDateSlots(instance, slots) {
|
|
10690
|
+
plainDateMap.set(instance, slots);
|
|
10691
|
+
}
|
|
10692
|
+
|
|
10693
|
+
function isPlainYearMonthRecord(record) {
|
|
10694
|
+
return !!getPlainYearMonthSlotsIfPresent(record);
|
|
10695
|
+
}
|
|
10696
|
+
|
|
10697
|
+
function getPlainYearMonthSlots(record) {
|
|
10698
|
+
return getPlainYearMonthSlotsIfPresent(record) || invalidRecordType();
|
|
10699
|
+
}
|
|
10700
|
+
|
|
10701
|
+
function getPlainYearMonthSlotsIfPresent(record) {
|
|
10702
|
+
return plainYearMonthMap.get(record);
|
|
10703
|
+
}
|
|
10704
|
+
|
|
10705
|
+
function setPlainYearMonthSlots(instance, slots) {
|
|
10706
|
+
plainYearMonthMap.set(instance, slots);
|
|
10707
|
+
}
|
|
10708
|
+
|
|
10709
|
+
const CalendarRecord = /*@__PURE__*/ defineTemporalClass(CalendarRecordBranding, class {
|
|
10710
|
+
toJSON() {
|
|
10711
|
+
return getCalendarRecordId(this);
|
|
10712
|
+
}
|
|
10713
|
+
valueOf() {
|
|
10714
|
+
return getCalendarRecordId(this);
|
|
10715
|
+
}
|
|
10716
|
+
});
|
|
10717
|
+
|
|
10718
|
+
function createCalendarRecord(id, getImpl) {
|
|
10719
|
+
const instance = Object.create(CalendarRecord.prototype);
|
|
10720
|
+
return ((instance, slots) => {
|
|
10721
|
+
calendarMap.set(instance, slots);
|
|
10722
|
+
})(instance, {
|
|
10723
|
+
id: id,
|
|
10724
|
+
Be: getImpl
|
|
10725
|
+
}), attachDebugString(instance), instance;
|
|
10726
|
+
}
|
|
10727
|
+
|
|
10728
|
+
function getCalendarRecordId(record) {
|
|
10729
|
+
return getCalendarSlots(record).id;
|
|
10730
|
+
}
|
|
10731
|
+
|
|
10732
|
+
function getCalendarRecordImplCreator(record) {
|
|
10733
|
+
const getImpl = getCalendarSlots(record).Be;
|
|
10734
|
+
return getImpl || throwRangeError(exoticCalendarRequired(getCalendarRecordId(record), "getExotic or getAny")),
|
|
10735
|
+
getImpl;
|
|
10736
|
+
}
|
|
10737
|
+
|
|
10738
|
+
const isoCalendarRecord = /*@__PURE__*/ createCalendarRecord(isoCalendarId, () => isoCalendarImpl);
|
|
10739
|
+
|
|
10740
|
+
const gregoryCalendarRecord = /*@__PURE__*/ createCalendarRecord(gregoryCalendarId, () => gregoryCalendarImpl);
|
|
10741
|
+
|
|
10742
|
+
function getBasic(rawCalendarId) {
|
|
10743
|
+
const lowerRawCalendarId = requireString(rawCalendarId).toLowerCase();
|
|
10744
|
+
return lowerRawCalendarId === isoCalendarId ? isoCalendarRecord : lowerRawCalendarId === gregoryCalendarId ? gregoryCalendarRecord : getOrCreateUnknownRecord(rawCalendarId);
|
|
10745
|
+
}
|
|
10746
|
+
|
|
10747
|
+
const getOrCreateUnknownRecord = /*@__PURE__*/ memoize(createCalendarRecord);
|
|
10748
|
+
|
|
10749
|
+
const NativeTemporal = globalThis.Temporal;
|
|
10750
|
+
|
|
10751
|
+
function refineNativeCalendarArgMaybe(calendarRecord) {
|
|
10752
|
+
if (void 0 !== calendarRecord) {
|
|
10753
|
+
return getValidatedCalendarId(calendarRecord);
|
|
10754
|
+
}
|
|
10755
|
+
}
|
|
10756
|
+
|
|
10757
|
+
function runNativeCalendarResolver(canonicalCalendarId, getCalendarRecord) {
|
|
10758
|
+
getValidatedCalendarId(getCalendarRecord(canonicalCalendarId));
|
|
10759
|
+
}
|
|
10760
|
+
|
|
10761
|
+
function getValidatedCalendarId(record) {
|
|
10762
|
+
return getCalendarRecordImplCreator(record), getCalendarRecordId(record);
|
|
10763
|
+
}
|
|
10764
|
+
|
|
10765
|
+
const getNativePlainYearMonth = getPlainYearMonthSlots;
|
|
10766
|
+
|
|
10767
|
+
const NativePlainYearMonthRecord = /*@__PURE__*/ defineTemporalClass(PlainYearMonthRecordBranding, class {
|
|
10768
|
+
get calendarId() {
|
|
10769
|
+
return getNativePlainYearMonth(this).calendarId;
|
|
10770
|
+
}
|
|
10771
|
+
toJSON() {
|
|
10772
|
+
return getNativePlainYearMonth(this).toJSON();
|
|
10773
|
+
}
|
|
10774
|
+
valueOf() {
|
|
10775
|
+
return getNativePlainYearMonth(this).valueOf();
|
|
10776
|
+
}
|
|
10777
|
+
}, getNativePlainYearMonth, yearMonthFieldGetters);
|
|
10778
|
+
|
|
10779
|
+
function createNativePlainYearMonthRecord(native) {
|
|
10780
|
+
const instance = Object.create(NativePlainYearMonthRecord.prototype);
|
|
10781
|
+
return setPlainYearMonthSlots(instance, native), attachDebugString(instance), instance;
|
|
10782
|
+
}
|
|
10783
|
+
|
|
10784
|
+
function fromString$3$1(s, getCalendarRecord) {
|
|
10785
|
+
const resNative = NativeTemporal.PlainYearMonth.from(s);
|
|
10786
|
+
return runNativeCalendarResolver(resNative.calendarId, getCalendarRecord), createNativePlainYearMonthRecord(resNative);
|
|
10787
|
+
}
|
|
10788
|
+
|
|
10789
|
+
function daysInMonth$2$1(record) {
|
|
10790
|
+
return getNativePlainYearMonth(record).daysInMonth;
|
|
10791
|
+
}
|
|
10792
|
+
|
|
10793
|
+
function compare$3$1(record, otherRecord) {
|
|
10794
|
+
const native = getNativePlainYearMonth(record);
|
|
10795
|
+
const otherNative = getNativePlainYearMonth(otherRecord);
|
|
10796
|
+
return NativeTemporal.PlainYearMonth.compare(native, otherNative);
|
|
10797
|
+
}
|
|
10798
|
+
|
|
10799
|
+
function toString$3$1(record, options) {
|
|
10800
|
+
return getNativePlainYearMonth(record).toString(options);
|
|
10801
|
+
}
|
|
10802
|
+
|
|
10803
|
+
function toPlainDate$1$1(record, fields) {
|
|
10804
|
+
return createNativePlainDateRecord(getNativePlainYearMonth(record).toPlainDate(fields));
|
|
10805
|
+
}
|
|
10806
|
+
|
|
10807
|
+
function addMonths$2$1(record, months, options) {
|
|
10808
|
+
return createNativePlainYearMonthRecord(getNativePlainYearMonth(record).add({
|
|
10809
|
+
months: months
|
|
10810
|
+
}, options));
|
|
10811
|
+
}
|
|
10812
|
+
|
|
10813
|
+
const getNativePlainDate = getPlainDateSlots;
|
|
10814
|
+
|
|
10815
|
+
const NativePlainDateRecord = /*@__PURE__*/ defineTemporalClass(PlainDateRecordBranding, class {
|
|
10816
|
+
get calendarId() {
|
|
10817
|
+
return getNativePlainDate(this).calendarId;
|
|
10818
|
+
}
|
|
10819
|
+
toJSON() {
|
|
10820
|
+
return getNativePlainDate(this).toJSON();
|
|
10821
|
+
}
|
|
10822
|
+
valueOf() {
|
|
10823
|
+
return getNativePlainDate(this).valueOf();
|
|
10824
|
+
}
|
|
10825
|
+
}, getNativePlainDate, dateFieldGetters);
|
|
10826
|
+
|
|
10827
|
+
function createNativePlainDateRecord(native) {
|
|
10828
|
+
const instance = Object.create(NativePlainDateRecord.prototype);
|
|
10829
|
+
return setPlainDateSlots(instance, native), attachDebugString(instance), instance;
|
|
10830
|
+
}
|
|
10831
|
+
|
|
10832
|
+
function fromFields$1$1(fields, options) {
|
|
10833
|
+
const calendar = refineNativeCalendarArgMaybe(fields.calendar);
|
|
10834
|
+
return createNativePlainDateRecord(NativeTemporal.PlainDate.from({
|
|
10835
|
+
...fields,
|
|
10836
|
+
calendar: calendar
|
|
10837
|
+
}, options));
|
|
10838
|
+
}
|
|
10839
|
+
|
|
10840
|
+
function fromString$2$1(s, getCalendarRecord) {
|
|
10841
|
+
const resNative = NativeTemporal.PlainDate.from(s);
|
|
10842
|
+
return runNativeCalendarResolver(resNative.calendarId, getCalendarRecord), createNativePlainDateRecord(resNative);
|
|
10843
|
+
}
|
|
10844
|
+
|
|
10845
|
+
function dayOfWeek$1$1(record) {
|
|
10846
|
+
return getNativePlainDate(record).dayOfWeek;
|
|
10847
|
+
}
|
|
10848
|
+
|
|
10849
|
+
function compare$2$1(record, otherRecord) {
|
|
10850
|
+
const native = getNativePlainDate(record);
|
|
10851
|
+
const otherNative = getNativePlainDate(otherRecord);
|
|
10852
|
+
return NativeTemporal.PlainDate.compare(native, otherNative);
|
|
10853
|
+
}
|
|
10854
|
+
|
|
10855
|
+
function toLocaleString$2$1(record, locales, options) {
|
|
10856
|
+
return getNativePlainDate(record).toLocaleString(locales, options);
|
|
10857
|
+
}
|
|
10858
|
+
|
|
10859
|
+
function toString$2$1(record, options) {
|
|
10860
|
+
return getNativePlainDate(record).toString(options);
|
|
10861
|
+
}
|
|
10862
|
+
|
|
10863
|
+
function toPlainYearMonth$2(record) {
|
|
10864
|
+
return createNativePlainYearMonthRecord(getNativePlainDate(record).toPlainYearMonth());
|
|
10865
|
+
}
|
|
10866
|
+
|
|
10867
|
+
function addYears$1$1(record, years, options) {
|
|
10868
|
+
return createNativePlainDateRecord(getNativePlainDate(record).add({
|
|
10869
|
+
years: years
|
|
10870
|
+
}, options));
|
|
10871
|
+
}
|
|
10872
|
+
|
|
10873
|
+
function addMonths$1$2(record, months, options) {
|
|
10874
|
+
return createNativePlainDateRecord(getNativePlainDate(record).add({
|
|
10875
|
+
months: months
|
|
10876
|
+
}, options));
|
|
10877
|
+
}
|
|
10878
|
+
|
|
10879
|
+
function addDays$1$1(record, days) {
|
|
10880
|
+
return createNativePlainDateRecord(getNativePlainDate(record).add({
|
|
10881
|
+
days: days
|
|
10882
|
+
}));
|
|
10883
|
+
}
|
|
10884
|
+
|
|
10885
|
+
function plainDateISO$2(timeZoneId) {
|
|
10886
|
+
return createNativePlainDateRecord(NativeTemporal.Now.plainDateISO(timeZoneId));
|
|
10887
|
+
}
|
|
10888
|
+
|
|
10889
|
+
function refineShimCalendarArgMaybe(calendarRecord) {
|
|
10890
|
+
return void 0 === calendarRecord ? isoCalendarImpl : getCalendarRecordImpl(calendarRecord);
|
|
10891
|
+
}
|
|
10892
|
+
|
|
10893
|
+
function createShimCalendarStringResolver(getCalendarRecord) {
|
|
10894
|
+
return calendarId => getCalendarRecordImpl(getCalendarRecord(calendarId.toLowerCase()));
|
|
10895
|
+
}
|
|
10896
|
+
|
|
10897
|
+
function getCalendarRecordImpl(record) {
|
|
10898
|
+
return getCalendarRecordImplCreator(record)();
|
|
10899
|
+
}
|
|
10900
|
+
|
|
10901
|
+
function moveByYears(calendar, isoDate, years, options) {
|
|
10902
|
+
const overflow = refineOverflowOptions(options);
|
|
10903
|
+
return years ? addDateMonths(calendar, isoDate, toStrictInteger(years), 0, overflow) : isoDate;
|
|
10904
|
+
}
|
|
10905
|
+
|
|
10906
|
+
function moveByMonths(calendar, isoDate, months, options) {
|
|
10907
|
+
const overflow = refineOverflowOptions(options);
|
|
10908
|
+
return months ? addDateMonths(calendar, isoDate, 0, toStrictInteger(months), overflow) : isoDate;
|
|
10909
|
+
}
|
|
10910
|
+
|
|
10911
|
+
function moveByDaysStrict(_calendar, isoDate, days) {
|
|
10912
|
+
return moveByDays(isoDate, toStrictInteger(days));
|
|
10913
|
+
}
|
|
10914
|
+
|
|
10915
|
+
const getShimPlainYearMonthSlots = getPlainYearMonthSlots;
|
|
10916
|
+
|
|
10917
|
+
const ShimPlainYearMonthRecord = /*@__PURE__*/ defineTemporalClass(PlainYearMonthRecordBranding, class {
|
|
10918
|
+
get calendarId() {
|
|
10919
|
+
return getCalendarSlotId(getShimPlainYearMonthSlots(this).calendar);
|
|
10920
|
+
}
|
|
10921
|
+
toJSON() {
|
|
10922
|
+
return formatYearMonthIsoAuto(getShimPlainYearMonthSlots(this));
|
|
10923
|
+
}
|
|
10924
|
+
valueOf() {
|
|
10925
|
+
return forbiddenValueOf();
|
|
10926
|
+
}
|
|
10927
|
+
}, getShimPlainYearMonthSlots, yearMonthFieldGetters$1);
|
|
10928
|
+
|
|
10929
|
+
function createShimPlainYearMonthRecord(slots) {
|
|
10930
|
+
const instance = Object.create(ShimPlainYearMonthRecord.prototype);
|
|
10931
|
+
return setPlainYearMonthSlots(instance, slots), attachDebugString(instance), instance;
|
|
10932
|
+
}
|
|
10933
|
+
|
|
10934
|
+
function fromString$3(s, getCalendarRecord) {
|
|
10935
|
+
return createShimPlainYearMonthRecord(parsePlainYearMonth(s, createShimCalendarStringResolver(getCalendarRecord)));
|
|
10936
|
+
}
|
|
10937
|
+
|
|
10938
|
+
function daysInMonth$2(record) {
|
|
10939
|
+
const slots = getShimPlainYearMonthSlots(record);
|
|
10940
|
+
return computeCalendarDaysInMonth(slots.calendar, slots);
|
|
10941
|
+
}
|
|
10942
|
+
|
|
10943
|
+
function compare$3(record, otherRecord) {
|
|
10944
|
+
const slots = getShimPlainYearMonthSlots(record);
|
|
10945
|
+
const otherSlots = getShimPlainYearMonthSlots(otherRecord);
|
|
10946
|
+
return compareIsoDateFields(slots, otherSlots);
|
|
10947
|
+
}
|
|
10948
|
+
|
|
10949
|
+
function toString$3(record, options) {
|
|
10950
|
+
return formatPlainYearMonthIso(getShimPlainYearMonthSlots(record), options);
|
|
10951
|
+
}
|
|
10952
|
+
|
|
10953
|
+
function toPlainDate$1(record, fields) {
|
|
10954
|
+
const slots = getShimPlainYearMonthSlots(record);
|
|
10955
|
+
return createShimPlainDateRecord(convertPlainYearMonthToDate(slots.calendar, record, fields));
|
|
10956
|
+
}
|
|
10957
|
+
|
|
10958
|
+
function addMonths$2(record, months, options) {
|
|
10959
|
+
const slots = getShimPlainYearMonthSlots(record);
|
|
10960
|
+
return createShimPlainYearMonthRecord(createDateSlots(moveYearMonth(0, slots.calendar, slots, createDurationSlots(validateDurationFields({
|
|
10961
|
+
...durationFieldDefaults,
|
|
10962
|
+
months: toStrictInteger(months)
|
|
10963
|
+
})), options), slots.calendar));
|
|
10964
|
+
}
|
|
10965
|
+
|
|
10966
|
+
const getShimPlainDateSlots = getPlainDateSlots;
|
|
10967
|
+
|
|
10968
|
+
const ShimPlainDateRecord = /*@__PURE__*/ defineTemporalClass(PlainDateRecordBranding, class {
|
|
10969
|
+
get calendarId() {
|
|
10970
|
+
return getCalendarSlotId(getShimPlainDateSlots(this).calendar);
|
|
10971
|
+
}
|
|
10972
|
+
toJSON() {
|
|
10973
|
+
return formatDateIsoAuto(getShimPlainDateSlots(this));
|
|
10974
|
+
}
|
|
10975
|
+
valueOf() {
|
|
10976
|
+
return forbiddenValueOf();
|
|
10977
|
+
}
|
|
10978
|
+
}, getShimPlainDateSlots, dateFieldGetters$1);
|
|
10979
|
+
|
|
10980
|
+
function createShimPlainDateRecord(slots) {
|
|
10981
|
+
const instance = Object.create(ShimPlainDateRecord.prototype);
|
|
10982
|
+
return setPlainDateSlots(instance, slots), attachDebugString(instance), instance;
|
|
10983
|
+
}
|
|
10984
|
+
|
|
10985
|
+
function fromFields$1(fields, options) {
|
|
10986
|
+
const calendarImpl = refineShimCalendarArgMaybe(fields.calendar);
|
|
10987
|
+
return createShimPlainDateRecord(refinePlainDateObjectLike(calendarImpl, fields, options));
|
|
10988
|
+
}
|
|
10989
|
+
|
|
10990
|
+
function fromString$2(s, getCalendarRecord) {
|
|
10991
|
+
return createShimPlainDateRecord(parsePlainDate(s, createShimCalendarStringResolver(getCalendarRecord)));
|
|
10992
|
+
}
|
|
10993
|
+
|
|
10994
|
+
function dayOfWeek$1(record) {
|
|
10995
|
+
return computeIsoDayOfWeek(getShimPlainDateSlots(record));
|
|
10996
|
+
}
|
|
10997
|
+
|
|
10998
|
+
function compare$2(record, otherRecord) {
|
|
10999
|
+
const slots = getShimPlainDateSlots(record);
|
|
11000
|
+
const otherSlots = getShimPlainDateSlots(otherRecord);
|
|
11001
|
+
return compareIsoDateFields(slots, otherSlots);
|
|
11002
|
+
}
|
|
11003
|
+
|
|
11004
|
+
function toLocaleString$2(record, locales = void 0, options = {}) {
|
|
11005
|
+
const slots = getShimPlainDateSlots(record);
|
|
11006
|
+
const format = new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformDateOptions(options)));
|
|
11007
|
+
return checkResolvedCalendarCompatible(format, slots), format.format(isoDateToEpochMilli(slots));
|
|
11008
|
+
}
|
|
11009
|
+
|
|
11010
|
+
function toString$2(record, options) {
|
|
11011
|
+
return formatPlainDateIso(getShimPlainDateSlots(record), options);
|
|
11012
|
+
}
|
|
11013
|
+
|
|
11014
|
+
function toPlainYearMonth$1(record) {
|
|
11015
|
+
const slots = getShimPlainDateSlots(record);
|
|
11016
|
+
const calendarDate = computeCalendarDateFields(slots.calendar, slots);
|
|
11017
|
+
return createShimPlainYearMonthRecord(createPlainYearMonthFromFields(slots.calendar, {
|
|
11018
|
+
year: calendarDate.year,
|
|
11019
|
+
monthCode: computeCalendarMonthCode(slots.calendar, slots)
|
|
11020
|
+
}));
|
|
11021
|
+
}
|
|
11022
|
+
|
|
11023
|
+
function addYears$1(record, years, options) {
|
|
11024
|
+
const slots = getShimPlainDateSlots(record);
|
|
11025
|
+
return createRecordFromDateFields(createDateSlots(moveByYears(slots.calendar, slots, years, options), slots.calendar));
|
|
11026
|
+
}
|
|
11027
|
+
|
|
11028
|
+
function addMonths$1$1(record, months, options) {
|
|
11029
|
+
const slots = getShimPlainDateSlots(record);
|
|
11030
|
+
return createRecordFromDateFields(createDateSlots(moveByMonths(slots.calendar, slots, months, options), slots.calendar));
|
|
11031
|
+
}
|
|
11032
|
+
|
|
11033
|
+
function addDays$1(record, days) {
|
|
11034
|
+
const slots = getShimPlainDateSlots(record);
|
|
11035
|
+
return createRecordFromDateFields(createDateSlots(moveByDaysStrict(slots.calendar, slots, days), slots.calendar));
|
|
11036
|
+
}
|
|
11037
|
+
|
|
11038
|
+
function createRecordFromDateFields(isoDate) {
|
|
11039
|
+
return checkIsoDateInBounds(isoDate), createShimPlainDateRecord(createDateSlots(isoDate, isoDate.calendar));
|
|
11040
|
+
}
|
|
11041
|
+
|
|
11042
|
+
function plainDateISO$1(timeZoneId = getCurrentTimeZoneId()) {
|
|
11043
|
+
const isoDateTime = getCurrentIsoDateTime(queryTimeZone(refineTimeZoneId(timeZoneId)));
|
|
11044
|
+
return createShimPlainDateRecord(createDateSlots(isoDateTime));
|
|
11045
|
+
}
|
|
11046
|
+
|
|
11047
|
+
const plainDateISO = NativeTemporal ? plainDateISO$2 : plainDateISO$1;
|
|
11048
|
+
|
|
11049
|
+
const fromFields = NativeTemporal ? fromFields$1$1 : fromFields$1;
|
|
11050
|
+
|
|
11051
|
+
const fromString$1 = NativeTemporal ? fromString$2$1 : fromString$2;
|
|
11052
|
+
|
|
11053
|
+
const dayOfWeek = NativeTemporal ? dayOfWeek$1$1 : dayOfWeek$1;
|
|
11054
|
+
|
|
11055
|
+
const compare$1 = NativeTemporal ? compare$2$1 : compare$2;
|
|
11056
|
+
|
|
11057
|
+
const toLocaleString = NativeTemporal ? toLocaleString$2$1 : toLocaleString$2;
|
|
11058
|
+
|
|
11059
|
+
const toString$1 = NativeTemporal ? toString$2$1 : toString$2;
|
|
11060
|
+
|
|
11061
|
+
const toPlainYearMonth = NativeTemporal ? toPlainYearMonth$2 : toPlainYearMonth$1;
|
|
11062
|
+
|
|
11063
|
+
const addYears = NativeTemporal ? addYears$1$1 : addYears$1;
|
|
11064
|
+
|
|
11065
|
+
const addMonths$1 = NativeTemporal ? addMonths$1$2 : addMonths$1$1;
|
|
11066
|
+
|
|
11067
|
+
const addDays = NativeTemporal ? addDays$1$1 : addDays$1;
|
|
11068
|
+
|
|
11069
|
+
const isRecord = isPlainYearMonthRecord;
|
|
11070
|
+
|
|
11071
|
+
const fromString = NativeTemporal ? fromString$3$1 : fromString$3;
|
|
11072
|
+
|
|
11073
|
+
const daysInMonth = NativeTemporal ? daysInMonth$2$1 : daysInMonth$2;
|
|
11074
|
+
|
|
11075
|
+
const compare = NativeTemporal ? compare$3$1 : compare$3;
|
|
11076
|
+
|
|
11077
|
+
const toString = NativeTemporal ? toString$3$1 : toString$3;
|
|
11078
|
+
|
|
11079
|
+
const toPlainDate = NativeTemporal ? toPlainDate$1$1 : toPlainDate$1;
|
|
11080
|
+
|
|
11081
|
+
const addMonths = NativeTemporal ? addMonths$2$1 : addMonths$2;
|
|
11082
|
+
|
|
11083
|
+
const chevronLeftSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE1LjMzMzQgMjAuMzMzNEw3LjAwMDA4IDEyTDE1LjMzMzQgMy42NjY2MyIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMS43NSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=';
|
|
11084
|
+
|
|
11085
|
+
const chevronRightSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTguNjY2NjMgMjAuMzMzNEwxNyAxMkw4LjY2NjYzIDMuNjY2NjMiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2Utd2lkdGg9IjEuNzUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K';
|
|
11086
|
+
|
|
11087
|
+
function parseIsoDateSafely(iso, format = fromString$1) {
|
|
11088
|
+
if (!iso)
|
|
11089
|
+
return undefined;
|
|
11090
|
+
try {
|
|
11091
|
+
return format(iso, getBasic);
|
|
11092
|
+
}
|
|
11093
|
+
catch {
|
|
11094
|
+
return undefined;
|
|
11095
|
+
}
|
|
11096
|
+
}
|
|
11097
|
+
function stripDayFromIsoDate(iso) {
|
|
11098
|
+
return iso.slice(0, 7);
|
|
11099
|
+
}
|
|
11100
|
+
/**
|
|
11101
|
+
* Serialize a PlainDate to an ISO YYYY-MM-DD string.
|
|
11102
|
+
*
|
|
11103
|
+
* IMPORTANT: the `fns` flavor of `temporal-polyfill` records do NOT carry a working instance
|
|
11104
|
+
* `.toString()` (calling it falls through to `Object.prototype.toString`, yielding
|
|
11105
|
+
* `"[object Temporal.PlainDateRecord]"`). Always use the top-level `PlainDateFns.toString()`.
|
|
11106
|
+
*/
|
|
11107
|
+
function toIsoDateString(date) {
|
|
11108
|
+
return toString$1(date);
|
|
11109
|
+
}
|
|
11110
|
+
function toIsoYearMonthString(date) {
|
|
11111
|
+
if (isRecord(date)) {
|
|
11112
|
+
return toString(date);
|
|
11113
|
+
}
|
|
11114
|
+
return stripDayFromIsoDate(toIsoDateString(date));
|
|
11115
|
+
}
|
|
11116
|
+
|
|
11117
|
+
const calendarSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8cmVjdCB4PSIzLjUiIHk9IjUiIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNSIgcng9IjIiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2Utd2lkdGg9IjEuNzUiLz4KICAgIDxwYXRoIGQ9Ik0zLjUgOS41SDIwLjUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2Utd2lkdGg9IjEuNzUiLz4KICAgIDxwYXRoIGQ9Ik04IDNWNi41IiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIxLjc1IiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAgIDxwYXRoIGQ9Ik0xNiAzVjYuNSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMS43NSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPg==';
|
|
11118
|
+
|
|
11119
|
+
function isSelected(date, value) {
|
|
11120
|
+
if (!value)
|
|
11121
|
+
return false;
|
|
11122
|
+
return compare$1(date, value) === 0;
|
|
11123
|
+
}
|
|
11124
|
+
function isDisabled(date, min, max) {
|
|
11125
|
+
if (min && compare$1(date, min) < 0)
|
|
11126
|
+
return true;
|
|
11127
|
+
if (max && compare$1(date, max) > 0)
|
|
11128
|
+
return true;
|
|
11129
|
+
return false;
|
|
11130
|
+
}
|
|
11131
|
+
function buildCalendarGrid(visibleMonth) {
|
|
11132
|
+
const firstOfMonth = toPlainDate(visibleMonth, { day: 1 });
|
|
11133
|
+
const firstDow = dayOfWeek(firstOfMonth);
|
|
11134
|
+
const offsetToMonday = firstDow - 1;
|
|
11135
|
+
const gridStart = addDays(firstOfMonth, -offsetToMonday);
|
|
11136
|
+
const grid = [];
|
|
11137
|
+
for (let i = 0; i < 42; i++) {
|
|
11138
|
+
grid.push(addDays(gridStart, i));
|
|
11139
|
+
}
|
|
11140
|
+
if (compare(visibleMonth, toPlainYearMonth(grid.at(-7))) !== 0) {
|
|
11141
|
+
return grid.slice(0, -7);
|
|
11142
|
+
}
|
|
11143
|
+
return grid;
|
|
11144
|
+
}
|
|
11145
|
+
function firstSelectableDayOfMonth(visibleMonth, min, max) {
|
|
11146
|
+
const daysInMonth$1 = daysInMonth(visibleMonth);
|
|
11147
|
+
for (let d = 1; d <= daysInMonth$1; d++) {
|
|
11148
|
+
const candidate = toPlainDate(visibleMonth, { day: d });
|
|
11149
|
+
if (!isDisabled(candidate, min, max))
|
|
11150
|
+
return candidate;
|
|
11151
|
+
}
|
|
11152
|
+
return null;
|
|
11153
|
+
}
|
|
11154
|
+
function lastSelectableDayOfMonth(visibleMonth, min, max) {
|
|
11155
|
+
const daysInMonth$1 = daysInMonth(visibleMonth);
|
|
11156
|
+
for (let d = daysInMonth$1; d >= 1; d--) {
|
|
11157
|
+
const candidate = toPlainDate(visibleMonth, { day: d });
|
|
11158
|
+
if (!isDisabled(candidate, min, max))
|
|
11159
|
+
return candidate;
|
|
11160
|
+
}
|
|
11161
|
+
return null;
|
|
11162
|
+
}
|
|
11163
|
+
const NAV_LABELS = {
|
|
11164
|
+
de: { prev: 'Vorheriger Monat', next: 'Nächster Monat' },
|
|
11165
|
+
'de-CH': { prev: 'Vorheriger Monat', next: 'Nächster Monat' },
|
|
11166
|
+
'de-AT': { prev: 'Vorheriger Monat', next: 'Nächster Monat' },
|
|
11167
|
+
'de-DE': { prev: 'Vorheriger Monat', next: 'Nächster Monat' },
|
|
11168
|
+
en: { prev: 'Previous month', next: 'Next month' },
|
|
11169
|
+
'en-US': { prev: 'Previous month', next: 'Next month' },
|
|
11170
|
+
'en-GB': { prev: 'Previous month', next: 'Next month' },
|
|
11171
|
+
fr: { prev: 'Mois précédent', next: 'Mois suivant' },
|
|
11172
|
+
'fr-CH': { prev: 'Mois précédent', next: 'Mois suivant' },
|
|
11173
|
+
it: { prev: 'Mese precedente', next: 'Mese successivo' },
|
|
11174
|
+
'it-CH': { prev: 'Mese precedente', next: 'Mese successivo' },
|
|
11175
|
+
};
|
|
11176
|
+
function getNavLabels(locale) {
|
|
11177
|
+
const DEFAULT = { prev: 'Vorheriger Monat', next: 'Nächster Monat' };
|
|
11178
|
+
const byLocale = NAV_LABELS[locale];
|
|
11179
|
+
if (byLocale)
|
|
11180
|
+
return byLocale;
|
|
11181
|
+
const lang = locale.split('-')[0];
|
|
11182
|
+
const byLang = lang !== undefined ? NAV_LABELS[lang] : undefined;
|
|
11183
|
+
if (byLang)
|
|
11184
|
+
return byLang;
|
|
11185
|
+
return DEFAULT;
|
|
11186
|
+
}
|
|
11187
|
+
const VALIDATION_LABELS = {
|
|
11188
|
+
de: { popoverSuffix: '— Kalender', invalidDateMessage: 'Ungültiges Datum' },
|
|
11189
|
+
'de-CH': { popoverSuffix: '— Kalender', invalidDateMessage: 'Ungültiges Datum' },
|
|
11190
|
+
'de-AT': { popoverSuffix: '— Kalender', invalidDateMessage: 'Ungültiges Datum' },
|
|
11191
|
+
'de-DE': { popoverSuffix: '— Kalender', invalidDateMessage: 'Ungültiges Datum' },
|
|
11192
|
+
en: { popoverSuffix: '— Calendar', invalidDateMessage: 'Invalid date' },
|
|
11193
|
+
'en-US': { popoverSuffix: '— Calendar', invalidDateMessage: 'Invalid date' },
|
|
11194
|
+
'en-GB': { popoverSuffix: '— Calendar', invalidDateMessage: 'Invalid date' },
|
|
11195
|
+
fr: { popoverSuffix: '— Calendrier', invalidDateMessage: 'Date invalide' },
|
|
11196
|
+
'fr-CH': { popoverSuffix: '— Calendrier', invalidDateMessage: 'Date invalide' },
|
|
11197
|
+
it: { popoverSuffix: '— Calendario', invalidDateMessage: 'Data non valida' },
|
|
11198
|
+
'it-CH': { popoverSuffix: '— Calendario', invalidDateMessage: 'Data non valida' },
|
|
11199
|
+
};
|
|
11200
|
+
function getValidationLabels(locale) {
|
|
11201
|
+
const DEFAULT = { popoverSuffix: '— Kalender', invalidDateMessage: 'Ungültiges Datum' };
|
|
11202
|
+
const byLocale = VALIDATION_LABELS[locale];
|
|
11203
|
+
if (byLocale)
|
|
11204
|
+
return byLocale;
|
|
11205
|
+
const lang = locale.split('-')[0];
|
|
11206
|
+
const byLang = lang !== undefined ? VALIDATION_LABELS[lang] : undefined;
|
|
11207
|
+
if (byLang)
|
|
11208
|
+
return byLang;
|
|
11209
|
+
return DEFAULT;
|
|
11210
|
+
}
|
|
11211
|
+
const FORMAT_TOKEN_ORDER = ['yyyy', 'MM', 'dd'];
|
|
11212
|
+
function derivePatternFromLocale(locale) {
|
|
11213
|
+
const reference = new Date(Date.UTC(2001, 10, 22));
|
|
11214
|
+
const parts = new Intl.DateTimeFormat(locale, { year: 'numeric', month: '2-digit', day: '2-digit', timeZone: 'UTC' }).formatToParts(reference);
|
|
11215
|
+
return parts
|
|
11216
|
+
.map((part) => {
|
|
11217
|
+
switch (part.type) {
|
|
11218
|
+
case 'year':
|
|
11219
|
+
return 'yyyy';
|
|
11220
|
+
case 'month':
|
|
11221
|
+
return 'MM';
|
|
11222
|
+
case 'day':
|
|
11223
|
+
return 'dd';
|
|
11224
|
+
default:
|
|
11225
|
+
return part.value;
|
|
11226
|
+
}
|
|
11227
|
+
})
|
|
11228
|
+
.join('');
|
|
11229
|
+
}
|
|
11230
|
+
function escapeRegExp(value) {
|
|
11231
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
11232
|
+
}
|
|
11233
|
+
function buildPatternMatcher(pattern) {
|
|
11234
|
+
const order = [];
|
|
11235
|
+
let regexSource = '';
|
|
11236
|
+
let i = 0;
|
|
11237
|
+
while (i < pattern.length) {
|
|
11238
|
+
const token = FORMAT_TOKEN_ORDER.find((t) => pattern.startsWith(t, i));
|
|
11239
|
+
if (token) {
|
|
11240
|
+
regexSource += token === 'yyyy' ? '(\\d{4})' : '(\\d{1,2})';
|
|
11241
|
+
order.push(token);
|
|
11242
|
+
i += token.length;
|
|
11243
|
+
}
|
|
11244
|
+
else {
|
|
11245
|
+
regexSource += escapeRegExp(pattern[i]);
|
|
11246
|
+
i += 1;
|
|
11247
|
+
}
|
|
11248
|
+
}
|
|
11249
|
+
return { regex: new RegExp(`^${regexSource}$`), order };
|
|
11250
|
+
}
|
|
11251
|
+
function isValidCalendarDate(year, month, day) {
|
|
11252
|
+
if (!Number.isInteger(year) || year < 1)
|
|
11253
|
+
return false;
|
|
11254
|
+
if (!Number.isInteger(month) || month < 1 || month > 12)
|
|
11255
|
+
return false;
|
|
11256
|
+
if (!Number.isInteger(day) || day < 1)
|
|
11257
|
+
return false;
|
|
11258
|
+
try {
|
|
11259
|
+
const ym = fromString(`${String(year).padStart(4, '0')}-${String(month).padStart(2, '0')}`, getBasic);
|
|
11260
|
+
return day <= daysInMonth(ym);
|
|
11261
|
+
}
|
|
11262
|
+
catch {
|
|
11263
|
+
return false;
|
|
11264
|
+
}
|
|
11265
|
+
}
|
|
11266
|
+
function formatToDisplay(value, locale, displayFormat) {
|
|
11267
|
+
if (!value)
|
|
11268
|
+
return '';
|
|
11269
|
+
const date = parseIsoDateSafely(value);
|
|
11270
|
+
if (!date)
|
|
11271
|
+
return '';
|
|
11272
|
+
const pattern = displayFormat ?? derivePatternFromLocale(locale);
|
|
11273
|
+
const yyyy = String(date.year).padStart(4, '0');
|
|
11274
|
+
const MM = String(date.month).padStart(2, '0');
|
|
11275
|
+
const dd = String(date.day).padStart(2, '0');
|
|
11276
|
+
return pattern.replace(/yyyy/g, yyyy).replace(/MM/g, MM).replace(/dd/g, dd);
|
|
11277
|
+
}
|
|
11278
|
+
function parseFromDisplay(text, locale, displayFormat) {
|
|
11279
|
+
const trimmed = text.trim();
|
|
11280
|
+
if (!trimmed)
|
|
11281
|
+
return undefined;
|
|
11282
|
+
const pattern = displayFormat ?? derivePatternFromLocale(locale);
|
|
11283
|
+
const { regex, order } = buildPatternMatcher(pattern);
|
|
11284
|
+
const match = regex.exec(trimmed);
|
|
11285
|
+
if (!match)
|
|
11286
|
+
return undefined;
|
|
11287
|
+
const values = {};
|
|
11288
|
+
order.forEach((token, idx) => {
|
|
11289
|
+
values[token] = Number(match[idx + 1]);
|
|
11290
|
+
});
|
|
11291
|
+
const { yyyy, MM, dd } = values;
|
|
11292
|
+
if (yyyy === undefined || MM === undefined || dd === undefined)
|
|
11293
|
+
return undefined;
|
|
11294
|
+
if (!isValidCalendarDate(yyyy, MM, dd))
|
|
11295
|
+
return undefined;
|
|
11296
|
+
return `${String(yyyy).padStart(4, '0')}-${String(MM).padStart(2, '0')}-${String(dd).padStart(2, '0')}`;
|
|
11297
|
+
}
|
|
11298
|
+
|
|
11299
|
+
const lmvzDatepickerCss = () => ` @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } :host { display: inline-block; width: 100%; } .datepicker-panel { display: flex; flex-direction: column; gap: var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); } .datepicker-header { display: flex; align-items: center; justify-content: space-between; width: 100%; } .datepicker-month-label { all: unset; font: var(--lmvz-typography-body-md-strong, 500 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); color: var(--lmvz-semantic-color-on-surface-primary, #000000); text-align: center; cursor: default; pointer-events: none; user-select: none; } .datepicker-weekday-row { display: flex; gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); width: 100%; } .datepicker-weekday { flex: 1; display: flex; align-items: center; justify-content: center; font: var(--lmvz-typography-body-sm-strong, 500 clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem) / 1.5 Router); color: var(--lmvz-semantic-color-on-surface-secondary, #545454); min-width: 0; text-align: center; } .datepicker-grid { display: flex; flex-direction: column; gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } .datepicker-week-row { display: flex; gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } [part~='day'] { all: unset; flex: 1; width: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); min-width: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); box-sizing: border-box; display: flex; align-items: center; justify-content: center; border-radius: var(--lmvz-semantic-border-radius-round, 999px); font: var(--lmvz-typography-body-md-strong, 500 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); color: var(--lmvz-semantic-color-on-surface-primary, #000000); background-color: transparent; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; position: relative; } [part~='day--disabled'], [part~='day']:disabled { opacity: var(--lmvz-global-opacity-disabled, 40%); pointer-events: none; } [part~='day']:focus-visible { outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); } [part~='day']:not(:disabled):hover { background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); color: var(--lmvz-semantic-color-on-surface-primary, #000000); } [part~='day--today'] { box-shadow: inset 0 0 0 1px var(--lmvz-semantic-color-border-active, #0f8acc); } [part~='day--today']:not(:disabled):hover { background-color: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); box-shadow: inset 0 0 0 1px var(--lmvz-semantic-color-border-active, #0f8acc); } [part~='day--selected'] { background-color: var(--lmvz-semantic-color-status-active-alternate, #0f8acc); color: var(--lmvz-semantic-color-status-on-active-alternate, #ffffff); box-shadow: none; } [part~='day--today'][part~='day--selected'] { background-color: var(--lmvz-semantic-color-status-active-alternate, #0f8acc); color: var(--lmvz-semantic-color-status-on-active-alternate, #ffffff); box-shadow: none; } [part~='day--selected']:not(:disabled):hover { background-color: var(--lmvz-semantic-color-status-active-alternate, #0f8acc); color: var(--lmvz-semantic-color-status-on-active-alternate, #ffffff); } [part~='day--out-of-month'] { color: var(--lmvz-semantic-color-on-surface-tertiary, #7a7a7a); } `;
|
|
11300
|
+
|
|
11301
|
+
const CHEVRON_LEFT = toValidSvgStringWithFallback(chevronLeftSvg);
|
|
11302
|
+
const CHEVRON_RIGHT = toValidSvgStringWithFallback(chevronRightSvg);
|
|
11303
|
+
const CALENDAR_ICON = toValidSvgStringWithFallback(calendarSvg);
|
|
11304
|
+
class LmvzDatepicker {
|
|
11305
|
+
constructor(hostRef) {
|
|
11306
|
+
registerInstance(this, hostRef);
|
|
11307
|
+
this.lmvzChange = createEvent(this, "lmvzChange", 7);
|
|
11308
|
+
this.lmvzMonthChange = createEvent(this, "lmvzMonthChange", 7);
|
|
11309
|
+
this.lmvzOpen = createEvent(this, "lmvzOpen", 7);
|
|
11310
|
+
this.lmvzClose = createEvent(this, "lmvzClose", 7);
|
|
11311
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
11312
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
11313
|
+
}
|
|
11314
|
+
else {
|
|
11315
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
11316
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
11317
|
+
}
|
|
11318
|
+
}
|
|
11319
|
+
get el() { return getElement(this); }
|
|
11320
|
+
monthLabelId = `lmvz-dp-month-${Math.random().toString(36).slice(2, 9)}`;
|
|
11321
|
+
internals;
|
|
11322
|
+
visibleDays;
|
|
11323
|
+
inputEl;
|
|
11324
|
+
focusedButtonRef;
|
|
11325
|
+
initialValue;
|
|
11326
|
+
pendingGridFocus = false;
|
|
11327
|
+
syncOrigin = null;
|
|
11328
|
+
focusedDate;
|
|
11329
|
+
setFocusedDate(val) {
|
|
11330
|
+
if (this.focusedDate === val || (this.focusedDate && val && compare$1(this.focusedDate, val) === 0))
|
|
11331
|
+
return;
|
|
11332
|
+
this.focusedDate = val;
|
|
11333
|
+
}
|
|
11334
|
+
valueDate;
|
|
11335
|
+
get value() {
|
|
11336
|
+
return this.valueDate ? toIsoDateString(this.valueDate) : undefined;
|
|
11337
|
+
}
|
|
11338
|
+
set value(value) {
|
|
11339
|
+
this.valueDate = value ? parseIsoDateSafely(value) : undefined;
|
|
11340
|
+
this.visibleMonthDate = this.valueDate ? toPlainYearMonth(this.valueDate) : this.effectiveVisibleMonth;
|
|
11341
|
+
this.setFocusedDate(this.valueDate);
|
|
11342
|
+
this.syncInputTextFromValue();
|
|
11343
|
+
this.updateFormState();
|
|
11344
|
+
}
|
|
11345
|
+
visibleMonthDate;
|
|
11346
|
+
get visibleMonth() {
|
|
11347
|
+
return this.visibleMonthDate ? toIsoYearMonthString(this.visibleMonthDate) : undefined;
|
|
11348
|
+
}
|
|
11349
|
+
set visibleMonth(value) {
|
|
11350
|
+
this.visibleMonthDate = value ? fromString(value, getBasic) : undefined;
|
|
11351
|
+
this.initFocusedDate();
|
|
11352
|
+
}
|
|
11353
|
+
min;
|
|
11354
|
+
max;
|
|
11355
|
+
locale = 'de-CH';
|
|
11356
|
+
firstDayOfWeek = 1;
|
|
11357
|
+
disabled = false;
|
|
11358
|
+
readonly = false;
|
|
11359
|
+
required = false;
|
|
11360
|
+
name;
|
|
11361
|
+
label;
|
|
11362
|
+
placeholder;
|
|
11363
|
+
helperText;
|
|
11364
|
+
errorMessage;
|
|
11365
|
+
open = false;
|
|
11366
|
+
displayFormat;
|
|
11367
|
+
lmvzChange;
|
|
11368
|
+
lmvzMonthChange;
|
|
11369
|
+
lmvzOpen;
|
|
11370
|
+
lmvzClose;
|
|
11371
|
+
componentWillLoad() {
|
|
11372
|
+
if (!this.label) {
|
|
11373
|
+
console.warn('[lmvz-datepicker] no `label` provided; the text field will have no accessible name.');
|
|
11374
|
+
}
|
|
11375
|
+
this.initialValue = this.value;
|
|
11376
|
+
this.syncInputTextFromValue();
|
|
11377
|
+
this.updateFormState();
|
|
11378
|
+
}
|
|
11379
|
+
formAssociatedCallback(form) {
|
|
11380
|
+
if (!form)
|
|
11381
|
+
return;
|
|
11382
|
+
this.updateFormState();
|
|
11383
|
+
}
|
|
11384
|
+
formResetCallback() {
|
|
11385
|
+
this.internals.setValidity?.({});
|
|
11386
|
+
this.value = this.initialValue;
|
|
11387
|
+
}
|
|
11388
|
+
formStateRestoreCallback(state) {
|
|
11389
|
+
if (typeof state !== 'string')
|
|
11390
|
+
return;
|
|
11391
|
+
this.value = (state || undefined);
|
|
11392
|
+
}
|
|
11393
|
+
async checkValidity() {
|
|
11394
|
+
return this.internals.checkValidity?.() ?? true;
|
|
11395
|
+
}
|
|
11396
|
+
async reportValidity() {
|
|
11397
|
+
return this.internals.reportValidity?.() ?? true;
|
|
11398
|
+
}
|
|
11399
|
+
handleValidityRelevantPropChange() {
|
|
11400
|
+
this.updateFormState();
|
|
11401
|
+
}
|
|
11402
|
+
handleDisplayFormatChange() {
|
|
11403
|
+
this.syncInputTextFromValue();
|
|
11404
|
+
}
|
|
11405
|
+
handleDisabledChange(disabled) {
|
|
11406
|
+
if (disabled)
|
|
11407
|
+
this.open = false;
|
|
11408
|
+
}
|
|
11409
|
+
handleKeydown(ev) {
|
|
11410
|
+
if (this.disabled)
|
|
11411
|
+
return;
|
|
11412
|
+
const path = ev.composedPath();
|
|
11413
|
+
if (!path.some((el) => el?.getAttribute?.('role') === 'grid'))
|
|
11414
|
+
return;
|
|
11415
|
+
const focused = this.focusedDate;
|
|
11416
|
+
if (!focused) {
|
|
11417
|
+
console.warn('[lmvz-datepicker] any date should be focused but none is.');
|
|
11418
|
+
return;
|
|
11419
|
+
}
|
|
11420
|
+
const minDate = parseIsoDateSafely(this.min);
|
|
11421
|
+
const maxDate = parseIsoDateSafely(this.max);
|
|
11422
|
+
const swallowEvent = () => {
|
|
11423
|
+
ev.preventDefault();
|
|
11424
|
+
ev.stopPropagation();
|
|
11425
|
+
};
|
|
11426
|
+
switch (ev.key) {
|
|
11427
|
+
case 'ArrowRight': {
|
|
11428
|
+
swallowEvent();
|
|
11429
|
+
this.moveFocus(addDays(focused, 1));
|
|
11430
|
+
break;
|
|
11431
|
+
}
|
|
11432
|
+
case 'ArrowLeft': {
|
|
11433
|
+
swallowEvent();
|
|
11434
|
+
this.moveFocus(addDays(focused, -1));
|
|
11435
|
+
break;
|
|
11436
|
+
}
|
|
11437
|
+
case 'ArrowDown': {
|
|
11438
|
+
swallowEvent();
|
|
11439
|
+
this.moveFocus(addDays(focused, 7));
|
|
11440
|
+
break;
|
|
11441
|
+
}
|
|
11442
|
+
case 'ArrowUp': {
|
|
11443
|
+
swallowEvent();
|
|
11444
|
+
this.moveFocus(addDays(focused, -7));
|
|
11445
|
+
break;
|
|
11446
|
+
}
|
|
11447
|
+
case 'Home': {
|
|
11448
|
+
swallowEvent();
|
|
11449
|
+
this.moveFocus(firstSelectableDayOfMonth(this.effectiveVisibleMonth, minDate, maxDate));
|
|
11450
|
+
break;
|
|
11451
|
+
}
|
|
11452
|
+
case 'End': {
|
|
11453
|
+
swallowEvent();
|
|
11454
|
+
this.moveFocus(lastSelectableDayOfMonth(this.effectiveVisibleMonth, minDate, maxDate));
|
|
11455
|
+
break;
|
|
11456
|
+
}
|
|
11457
|
+
case 'PageUp':
|
|
11458
|
+
swallowEvent();
|
|
11459
|
+
this.moveFocus(ev.shiftKey ? addYears(focused, -1) : addMonths$1(focused, -1));
|
|
11460
|
+
break;
|
|
11461
|
+
case 'PageDown':
|
|
11462
|
+
swallowEvent();
|
|
11463
|
+
this.moveFocus(ev.shiftKey ? addYears(focused, 1) : addMonths$1(focused, 1));
|
|
11464
|
+
break;
|
|
11465
|
+
case 'Enter':
|
|
11466
|
+
case ' ':
|
|
11467
|
+
ev.preventDefault();
|
|
11468
|
+
if (!this.readonly && !isDisabled(focused, minDate, maxDate)) {
|
|
11469
|
+
this.selectDate(focused, { origin: 'calendar', closePopover: true });
|
|
11470
|
+
}
|
|
11471
|
+
break;
|
|
11472
|
+
}
|
|
11473
|
+
}
|
|
11474
|
+
initFocusedDate() {
|
|
11475
|
+
const vm = this.effectiveVisibleMonth;
|
|
11476
|
+
if (this.focusedDate && compare(toPlainYearMonth(this.focusedDate), vm) === 0) {
|
|
11477
|
+
return;
|
|
11478
|
+
}
|
|
11479
|
+
const selectedDate = this.valueDate;
|
|
11480
|
+
if (selectedDate && compare(toPlainYearMonth(selectedDate), vm) === 0) {
|
|
11481
|
+
this.setFocusedDate(selectedDate);
|
|
11482
|
+
return;
|
|
11483
|
+
}
|
|
11484
|
+
const todayDate = plainDateISO();
|
|
11485
|
+
if (compare(toPlainYearMonth(todayDate), vm) === 0) {
|
|
11486
|
+
this.setFocusedDate(todayDate);
|
|
11487
|
+
return;
|
|
11488
|
+
}
|
|
11489
|
+
this.setFocusedDate(toPlainDate(vm, { day: 1 }));
|
|
11490
|
+
}
|
|
11491
|
+
get effectiveVisibleMonth() {
|
|
11492
|
+
return this.visibleMonthDate ? this.visibleMonthDate : toPlainYearMonth(plainDateISO());
|
|
11493
|
+
}
|
|
11494
|
+
navigateMonth(delta, byMonthNav = false) {
|
|
11495
|
+
if (delta === 0)
|
|
11496
|
+
return;
|
|
11497
|
+
const newMonth = addMonths(this.effectiveVisibleMonth, delta);
|
|
11498
|
+
this.visibleMonthDate = newMonth;
|
|
11499
|
+
this.lmvzMonthChange.emit({ visibleMonth: toIsoYearMonthString(newMonth) });
|
|
11500
|
+
if (byMonthNav) {
|
|
11501
|
+
this.setFocusedDate(toPlainDate(newMonth, { day: 1 }));
|
|
11502
|
+
}
|
|
11503
|
+
}
|
|
11504
|
+
selectDate(date, opts = { origin: 'calendar' }) {
|
|
11505
|
+
this.syncOrigin = opts.origin;
|
|
11506
|
+
this.valueDate = date;
|
|
11507
|
+
this.setFocusedDate(date);
|
|
11508
|
+
this.lmvzChange.emit({ value: toIsoDateString(date) });
|
|
11509
|
+
this.navigateMonth(compare(toPlainYearMonth(date), this.effectiveVisibleMonth));
|
|
11510
|
+
if (opts.origin === 'input') {
|
|
11511
|
+
this.inputText = formatToDisplay(this.value, this.locale, this.displayFormat);
|
|
11512
|
+
this.hasUnparseableInput = false;
|
|
11513
|
+
}
|
|
11514
|
+
else {
|
|
11515
|
+
this.syncInputTextFromValue();
|
|
11516
|
+
}
|
|
11517
|
+
this.updateFormState();
|
|
11518
|
+
if (opts.closePopover)
|
|
11519
|
+
this.open = false;
|
|
11520
|
+
this.syncOrigin = null;
|
|
11521
|
+
}
|
|
11522
|
+
moveFocus(date) {
|
|
11523
|
+
if (!date)
|
|
11524
|
+
return;
|
|
11525
|
+
this.setFocusedDate(date);
|
|
11526
|
+
if (!this.visibleDays?.length)
|
|
11527
|
+
return;
|
|
11528
|
+
let day = this.visibleDays.at(0);
|
|
11529
|
+
if (day && compare$1(date, day) < 0) {
|
|
11530
|
+
return this.navigateMonth(-1);
|
|
11531
|
+
}
|
|
11532
|
+
day = this.visibleDays.at(-1);
|
|
11533
|
+
if (day && compare$1(date, day) > 0) {
|
|
11534
|
+
return this.navigateMonth(1);
|
|
11535
|
+
}
|
|
11536
|
+
}
|
|
11537
|
+
syncInputTextFromValue() {
|
|
11538
|
+
if (this.syncOrigin === 'input')
|
|
11539
|
+
return;
|
|
11540
|
+
this.inputText = formatToDisplay(this.value, this.locale, this.displayFormat);
|
|
11541
|
+
this.hasUnparseableInput = false;
|
|
11542
|
+
}
|
|
11543
|
+
inputText = '';
|
|
11544
|
+
hasUnparseableInput = false;
|
|
11545
|
+
handleInputTextChange = (ev) => {
|
|
11546
|
+
const text = ev.detail;
|
|
11547
|
+
this.inputText = text;
|
|
11548
|
+
if (!text.trim()) {
|
|
11549
|
+
this.hasUnparseableInput = false;
|
|
11550
|
+
if (this.valueDate) {
|
|
11551
|
+
this.syncOrigin = 'input';
|
|
11552
|
+
this.valueDate = undefined;
|
|
11553
|
+
this.lmvzChange.emit({ value: undefined });
|
|
11554
|
+
this.syncOrigin = null;
|
|
11555
|
+
}
|
|
11556
|
+
this.updateFormState();
|
|
11557
|
+
return;
|
|
11558
|
+
}
|
|
11559
|
+
const parsed = parseFromDisplay(text, this.locale, this.displayFormat);
|
|
11560
|
+
if (!parsed) {
|
|
11561
|
+
this.hasUnparseableInput = true;
|
|
11562
|
+
this.updateFormState();
|
|
11563
|
+
return;
|
|
11564
|
+
}
|
|
11565
|
+
this.hasUnparseableInput = false;
|
|
11566
|
+
const parsedDate = parseIsoDateSafely(parsed);
|
|
11567
|
+
if (!parsedDate)
|
|
11568
|
+
return;
|
|
11569
|
+
if (this.valueDate && compare$1(this.valueDate, parsedDate) === 0)
|
|
11570
|
+
return;
|
|
11571
|
+
this.selectDate(parsedDate, { origin: 'input' });
|
|
11572
|
+
};
|
|
11573
|
+
handleInputFocus(ev) {
|
|
11574
|
+
if (this.disabled || this.readonly)
|
|
11575
|
+
return;
|
|
11576
|
+
const originalTarget = ev.composedPath()[0];
|
|
11577
|
+
if (originalTarget !== this.inputEl && !this.inputEl?.contains(originalTarget ?? null))
|
|
11578
|
+
return;
|
|
11579
|
+
this.initFocusedDate();
|
|
11580
|
+
this.open = true;
|
|
11581
|
+
}
|
|
11582
|
+
handleInputKeydown = (ev) => {
|
|
11583
|
+
if (this.disabled || this.readonly)
|
|
11584
|
+
return;
|
|
11585
|
+
if (!['ArrowDown', 'ArrowUp', ' '].includes(ev.key))
|
|
11586
|
+
return;
|
|
11587
|
+
ev.preventDefault();
|
|
11588
|
+
if (!this.open) {
|
|
11589
|
+
this.pendingGridFocus = true;
|
|
11590
|
+
this.initFocusedDate();
|
|
11591
|
+
this.open = true;
|
|
11592
|
+
}
|
|
11593
|
+
else {
|
|
11594
|
+
this.focusGrid();
|
|
11595
|
+
}
|
|
11596
|
+
};
|
|
11597
|
+
focusGrid() {
|
|
11598
|
+
requestAnimationFrame(() => this.focusedButtonRef?.focus());
|
|
11599
|
+
}
|
|
11600
|
+
handlePopoverOpen = (ev) => {
|
|
11601
|
+
ev.stopPropagation();
|
|
11602
|
+
console.log('emitting open event');
|
|
11603
|
+
this.lmvzOpen.emit();
|
|
11604
|
+
if (this.pendingGridFocus) {
|
|
11605
|
+
this.pendingGridFocus = false;
|
|
11606
|
+
this.focusGrid();
|
|
11607
|
+
}
|
|
11608
|
+
};
|
|
11609
|
+
handlePopoverClose = (ev) => {
|
|
11610
|
+
console.log('handlePopoverClose', ev);
|
|
11611
|
+
ev.stopPropagation();
|
|
11612
|
+
this.open = false;
|
|
11613
|
+
this.lmvzClose.emit();
|
|
11614
|
+
};
|
|
11615
|
+
updateFormState() {
|
|
11616
|
+
const isoValue = this.value;
|
|
11617
|
+
this.internals.setFormValue?.(isoValue ?? null);
|
|
11618
|
+
const flags = {};
|
|
11619
|
+
if (this.required && !this.valueDate) {
|
|
11620
|
+
flags.valueMissing = true;
|
|
11621
|
+
}
|
|
11622
|
+
if (this.hasUnparseableInput) {
|
|
11623
|
+
flags.badInput = true;
|
|
11624
|
+
}
|
|
11625
|
+
if (this.valueDate) {
|
|
11626
|
+
const minDate = parseIsoDateSafely(this.min);
|
|
11627
|
+
const maxDate = parseIsoDateSafely(this.max);
|
|
11628
|
+
if (minDate && compare$1(this.valueDate, minDate) < 0)
|
|
11629
|
+
flags.rangeUnderflow = true;
|
|
11630
|
+
if (maxDate && compare$1(this.valueDate, maxDate) > 0)
|
|
11631
|
+
flags.rangeOverflow = true;
|
|
11632
|
+
}
|
|
11633
|
+
const isInvalid = Object.values(flags).some(Boolean);
|
|
11634
|
+
this.isInvalid = isInvalid;
|
|
11635
|
+
const validationLabels = getValidationLabels(this.locale);
|
|
11636
|
+
this.internals.setValidity?.(flags, isInvalid ? this.errorMessage || validationLabels.invalidDateMessage : undefined, isInvalid ? this.el : undefined);
|
|
11637
|
+
}
|
|
11638
|
+
isInvalid = false;
|
|
11639
|
+
get effectivePlaceholder() {
|
|
11640
|
+
return this.placeholder ?? derivePatternFromLocale(this.locale).toLowerCase();
|
|
11641
|
+
}
|
|
11642
|
+
renderHeader() {
|
|
11643
|
+
const { locale } = this;
|
|
11644
|
+
const vm = this.effectiveVisibleMonth;
|
|
11645
|
+
const navLabels = getNavLabels(locale);
|
|
11646
|
+
const monthYearLabel = toLocaleString(toPlainDate(vm, { day: 1 }), locale, { month: 'long', year: 'numeric' });
|
|
11647
|
+
const prevMonth = addMonths(vm, -1);
|
|
11648
|
+
const nextMonth = addMonths(vm, 1);
|
|
11649
|
+
const minYM = this.min ? fromString(this.min.slice(0, 7), getBasic) : undefined;
|
|
11650
|
+
const maxYM = this.max ? fromString(this.max.slice(0, 7), getBasic) : undefined;
|
|
11651
|
+
const isPrevDisabled = this.disabled || (minYM !== undefined && compare(prevMonth, minYM) < 0);
|
|
11652
|
+
const isNextDisabled = this.disabled || (maxYM !== undefined && compare(nextMonth, maxYM) > 0);
|
|
11653
|
+
return (hAsync("div", { part: "header", class: "datepicker-header" }, hAsync("lmvz-button", { part: "nav-prev", variant: "tertiary", scale: "small", "aria-label": navLabels.prev, disabled: isPrevDisabled, onLmvzActivation: () => this.navigateMonth(-1, true) }, hAsync("lmvz-icon", { icon: CHEVRON_LEFT, "aria-hidden": "true" })), hAsync("span", { id: this.monthLabelId, part: "month-label", class: "datepicker-month-label" }, monthYearLabel), hAsync("lmvz-button", { part: "nav-next", variant: "tertiary", scale: "small", "aria-label": navLabels.next, disabled: isNextDisabled, onLmvzActivation: () => this.navigateMonth(1, true) }, hAsync("lmvz-icon", { icon: CHEVRON_RIGHT, "aria-hidden": "true" }))));
|
|
11654
|
+
}
|
|
11655
|
+
renderWeekdayRow() {
|
|
11656
|
+
const { locale } = this;
|
|
11657
|
+
const mondayFirstDows = [1, 2, 3, 4, 5, 6, 7];
|
|
11658
|
+
const refMonday = fromFields({ year: 2024, month: 1, day: 1 });
|
|
11659
|
+
return (hAsync("div", { part: "weekday-row", role: "row", class: "datepicker-weekday-row" }, mondayFirstDows.map((dow) => {
|
|
11660
|
+
const refDate = addDays(refMonday, dow - 1);
|
|
11661
|
+
const shortName = toLocaleString(refDate, locale, { weekday: 'short' });
|
|
11662
|
+
const longName = toLocaleString(refDate, locale, { weekday: 'long' });
|
|
11663
|
+
return (hAsync("span", { part: "weekday", role: "columnheader", "aria-label": longName, class: "datepicker-weekday", key: dow }, hAsync("abbr", { title: longName }, shortName)));
|
|
11664
|
+
})));
|
|
11665
|
+
}
|
|
11666
|
+
renderGrid() {
|
|
11667
|
+
const { locale, focusedDate } = this;
|
|
11668
|
+
const vm = this.effectiveVisibleMonth;
|
|
11669
|
+
const selectedDate = this.valueDate;
|
|
11670
|
+
const minDate = parseIsoDateSafely(this.min);
|
|
11671
|
+
const maxDate = parseIsoDateSafely(this.max);
|
|
11672
|
+
const grid = (this.visibleDays = buildCalendarGrid(vm));
|
|
11673
|
+
const weekdayAriaLabelFormatter = {
|
|
11674
|
+
weekday: 'long',
|
|
11675
|
+
day: 'numeric',
|
|
11676
|
+
month: 'long',
|
|
11677
|
+
year: 'numeric',
|
|
11678
|
+
};
|
|
11679
|
+
const weeks = [];
|
|
11680
|
+
for (let w = 0; w < 6; w++) {
|
|
11681
|
+
if (!grid.at(w * 7))
|
|
11682
|
+
break;
|
|
11683
|
+
weeks.push(grid.slice(w * 7, w * 7 + 7));
|
|
11684
|
+
}
|
|
11685
|
+
return (hAsync("div", { part: "grid", role: "grid", "aria-labelledby": this.monthLabelId, class: "datepicker-grid" }, this.renderWeekdayRow(), weeks.map((week, wi) => (hAsync("div", { part: "week-row", role: "row", class: "datepicker-week-row", key: wi }, week.map((date) => {
|
|
11686
|
+
const iso = toIsoDateString(date);
|
|
11687
|
+
const isTodayDate = compare$1(date, plainDateISO()) === 0;
|
|
11688
|
+
const isSelectedDate = isSelected(date, selectedDate);
|
|
11689
|
+
const isOutOfMonth = compare(toPlainYearMonth(date), vm) !== 0;
|
|
11690
|
+
const isDisabledDate = this.readonly || isDisabled(date, minDate, maxDate);
|
|
11691
|
+
const isFocused = focusedDate !== undefined && compare$1(date, focusedDate) === 0;
|
|
11692
|
+
const partMarkers = ['day'];
|
|
11693
|
+
if (isTodayDate)
|
|
11694
|
+
partMarkers.push('day--today');
|
|
11695
|
+
if (isSelectedDate)
|
|
11696
|
+
partMarkers.push('day--selected');
|
|
11697
|
+
if (isOutOfMonth)
|
|
11698
|
+
partMarkers.push('day--out-of-month');
|
|
11699
|
+
if (isDisabledDate)
|
|
11700
|
+
partMarkers.push('day--disabled');
|
|
11701
|
+
const ariaLabel = toLocaleString(date, locale, weekdayAriaLabelFormatter);
|
|
11702
|
+
let fromRender = false;
|
|
11703
|
+
let buttonRef;
|
|
11704
|
+
if (isFocused) {
|
|
11705
|
+
requestAnimationFrame(() => {
|
|
11706
|
+
const activeEl = this.el.shadowRoot?.activeElement;
|
|
11707
|
+
if (!(activeEl instanceof HTMLButtonElement) || activeEl.getAttribute('role') !== 'gridcell')
|
|
11708
|
+
return;
|
|
11709
|
+
fromRender = true;
|
|
11710
|
+
buttonRef?.focus();
|
|
11711
|
+
});
|
|
11712
|
+
}
|
|
11713
|
+
return (hAsync("button", { "data-debug-id": iso, role: "gridcell", type: "button", part: partMarkers.join(' '), tabIndex: isFocused ? 0 : -1, "aria-label": ariaLabel, "aria-selected": isSelectedDate ? 'true' : undefined, "aria-current": isTodayDate ? 'date' : undefined, "aria-disabled": isDisabledDate ? 'true' : undefined, onClick: () => {
|
|
11714
|
+
if (isDisabledDate || this.disabled)
|
|
11715
|
+
return;
|
|
11716
|
+
this.selectDate(date, { origin: 'calendar', closePopover: true });
|
|
11717
|
+
}, ref: (e) => {
|
|
11718
|
+
buttonRef = e;
|
|
11719
|
+
if (isFocused)
|
|
11720
|
+
this.focusedButtonRef = e;
|
|
11721
|
+
}, onFocus: (e) => {
|
|
11722
|
+
console.log('focus event on grid cell', iso, e.target);
|
|
11723
|
+
if (!this.el.shadowRoot?.contains(e.target))
|
|
11724
|
+
return;
|
|
11725
|
+
if (fromRender) {
|
|
11726
|
+
fromRender = false;
|
|
11727
|
+
return;
|
|
11728
|
+
}
|
|
11729
|
+
this.setFocusedDate(date);
|
|
11730
|
+
}, key: iso }, date.day));
|
|
11731
|
+
}))))));
|
|
11732
|
+
}
|
|
11733
|
+
render() {
|
|
11734
|
+
const validationLabels = getValidationLabels(this.locale);
|
|
11735
|
+
const popoverLabel = this.label ? `${this.label} ${validationLabels.popoverSuffix}` : undefined;
|
|
11736
|
+
return (hAsync(Host, { key: 'df61136bb4d184e91e086a06f60e3c198f8a2b85' }, hAsync("lmvz-input", { key: '04986afb4a0926df4da693de6210ee4fccd74bd7', ref: (el) => {
|
|
11737
|
+
this.inputEl = el;
|
|
11738
|
+
}, label: this.label ?? '', placeholder: this.effectivePlaceholder, helperText: this.helperText, errorMessage: this.errorMessage, error: this.isInvalid, disabled: this.disabled, readonly: this.readonly, required: this.required, value: this.inputText, autocomplete: "off", onLmvzInput: this.handleInputTextChange, onKeyDown: this.handleInputKeydown }, hAsync("lmvz-icon", { key: '47897492e6df2f4b303c99aa33c48f326f3d9d63', slot: "after-input", icon: CALENDAR_ICON, "aria-hidden": "true" })), hAsync("lmvz-popover", { key: 'd2904def9519907f56dada15df992800da77db55', anchor: this.inputEl, open: this.open && !this.disabled, autoFocus: false, size: "md", label: popoverLabel, onLmvzOpen: this.handlePopoverOpen, onLmvzClose: this.handlePopoverClose }, hAsync("div", { key: 'dbdfe38144a63e5ac9de4c46e0df9918f898de28', part: "panel", class: "datepicker-panel" }, this.renderHeader(), this.renderGrid()))));
|
|
11739
|
+
}
|
|
11740
|
+
static get delegatesFocus() { return true; }
|
|
11741
|
+
static get formAssociated() { return true; }
|
|
11742
|
+
static get watchers() { return {
|
|
11743
|
+
"required": [{
|
|
11744
|
+
"handleValidityRelevantPropChange": 0
|
|
11745
|
+
}],
|
|
11746
|
+
"min": [{
|
|
11747
|
+
"handleValidityRelevantPropChange": 0
|
|
11748
|
+
}],
|
|
11749
|
+
"max": [{
|
|
11750
|
+
"handleValidityRelevantPropChange": 0
|
|
11751
|
+
}],
|
|
11752
|
+
"locale": [{
|
|
11753
|
+
"handleDisplayFormatChange": 0
|
|
11754
|
+
}],
|
|
11755
|
+
"displayFormat": [{
|
|
11756
|
+
"handleDisplayFormatChange": 0
|
|
11757
|
+
}],
|
|
11758
|
+
"disabled": [{
|
|
11759
|
+
"handleDisabledChange": 0
|
|
11760
|
+
}]
|
|
11761
|
+
}; }
|
|
11762
|
+
static get style() { return lmvzDatepickerCss(); }
|
|
11763
|
+
static get cmpMeta() { return {
|
|
11764
|
+
"$flags$": 601,
|
|
11765
|
+
"$tagName$": "lmvz-datepicker",
|
|
11766
|
+
"$members$": {
|
|
11767
|
+
"value": [6145],
|
|
11768
|
+
"visibleMonth": [6145, "visible-month"],
|
|
11769
|
+
"min": [1],
|
|
11770
|
+
"max": [1],
|
|
11771
|
+
"locale": [1],
|
|
11772
|
+
"firstDayOfWeek": [2, "first-day-of-week"],
|
|
11773
|
+
"disabled": [516],
|
|
11774
|
+
"readonly": [516],
|
|
11775
|
+
"required": [516],
|
|
11776
|
+
"name": [513],
|
|
11777
|
+
"label": [1],
|
|
11778
|
+
"placeholder": [1],
|
|
11779
|
+
"helperText": [1, "helper-text"],
|
|
11780
|
+
"errorMessage": [1, "error-message"],
|
|
11781
|
+
"open": [1540],
|
|
11782
|
+
"displayFormat": [1, "display-format"],
|
|
11783
|
+
"focusedDate": [32],
|
|
11784
|
+
"valueDate": [32],
|
|
11785
|
+
"visibleMonthDate": [32],
|
|
11786
|
+
"inputText": [32],
|
|
11787
|
+
"hasUnparseableInput": [32],
|
|
11788
|
+
"isInvalid": [32],
|
|
11789
|
+
"checkValidity": [64],
|
|
11790
|
+
"reportValidity": [64]
|
|
11791
|
+
},
|
|
11792
|
+
"$listeners$": [[0, "keydown", "handleKeydown"], [0, "focusin", "handleInputFocus"], [0, "click", "handleInputFocus"]],
|
|
11793
|
+
"$lazyBundleId$": "-",
|
|
11794
|
+
"$attrsToReflect$": [["disabled", "disabled"], ["readonly", "readonly"], ["required", "required"], ["name", "name"], ["open", "open"]]
|
|
11795
|
+
}; }
|
|
11796
|
+
}
|
|
11797
|
+
|
|
11798
|
+
const logoSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDYiIGhlaWdodD0iNzIiIHZpZXdCb3g9IjAgMCA0NiA3MiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzI3Ml80MDUpIj4KPHBhdGggZD0iTTEyLjUgMjAuNjVDMTMuMSAyMC42NSAxNC4yIDIwLjM1IDE0LjcgMjAuMzVDMTYuMSAyMC4zNSAxNy4yIDIxLjQ1IDE3LjIgMjIuODVDMTcuMiAyNC4yNSAxNi4xIDI1LjM1IDE0LjcgMjUuMzVIMi44QzEuMiAyNS4zNSAwIDI0LjE1IDAgMjIuNTVDMCAyMS45NSAwLjIgMjAuNjUgMC4yIDIwLjA1VjUuODQ5OTlDMC4yIDUuMTQ5OTkgMCAzLjk0OTk5IDAgMy4zNDk5OUMwIDEuNzQ5OTkgMS4yIDAuNTQ5OTg4IDIuOCAwLjU0OTk4OEM0LjMgMC41NDk5ODggNS42IDEuNzQ5OTkgNS42IDMuMzQ5OTlDNS42IDMuOTQ5OTkgNS40IDUuMTQ5OTkgNS40IDUuODQ5OTlWMjAuNTVIMTIuNVYyMC42NVpNMjIuMSAyMi43NUMyMi4xIDIyLjE1IDIyLjMgMjAuOTUgMjIuMyAyMC4yNVY1Ljg0OTk5QzIyLjMgNS4xNDk5OSAyMi4xIDMuOTQ5OTkgMjIuMSAzLjQ0OTk5QzIyLjEgMS45NDk5OSAyMy4yIDAuNzQ5OTg4IDI0LjYgMC43NDk5ODhIMjUuMkMyNi40IDAuNzQ5OTg4IDI3LjIgMS41NDk5OSAyNy42IDIuNjQ5OTlMMjggMy40NDk5OUwzMi45IDE0LjA1QzMzLjMgMTQuOTUgMzMuNyAxNi4wNSAzNCAxNi43NUMzNC4zIDE2LjA1IDM0LjcgMTQuOTUgMzUuMSAxNC4wNUw0MCAzLjU0OTk5TDQwLjMgMi41NDk5OUM0MC43IDEuNTQ5OTkgNDEuNSAwLjY0OTk4OCA0Mi42IDAuNjQ5OTg4SDQzLjJDNDQuNyAwLjY0OTk4OCA0NS43IDEuODQ5OTkgNDUuNyAzLjM0OTk5QzQ1LjcgMy45NDk5OSA0NS41IDUuMTQ5OTkgNDUuNSA1Ljc0OTk5VjIwLjE1QzQ1LjUgMjAuODUgNDUuNyAyMi4wNSA0NS43IDIyLjY1QzQ1LjcgMjQuMjUgNDQuNSAyNS40NSA0MyAyNS40NUM0MS40IDI1LjQ1IDQwLjMgMjQuMjUgNDAuMyAyMi42NUM0MC4zIDIxLjk1IDQwLjQgMjAuNzUgNDAuNCAyMC4xNUw0MC42IDE0LjA1QzQwLjYgMTMuMTUgNDAuNyAxMS43NSA0MC43IDEwLjY1TDM3IDE5LjA1QzM2LjcgMTkuNzUgMzYuNiAxOS45NSAzNi40IDIwLjM1QzM2IDIxLjI1IDM1LjMgMjEuODUgMzMuOSAyMS44NUMzMi41IDIxLjg1IDMxLjggMjEuMjUgMzEuNCAyMC40NUMzMS4yIDIwLjA1IDMxLjIgMTkuNzUgMzAuOCAxOS4wNUwyNyAxMC43NUMyNyAxMC43NSAyNy4xIDEzLjE1IDI3LjIgMTQuMDVMMjcuNCAyMC4xNUMyNy40IDIwLjg1IDI3LjUgMjEuOTUgMjcuNSAyMi42NUMyNy41IDI0LjI1IDI2LjQgMjUuNDUgMjQuOCAyNS40NUMyMy4zIDI1LjU1IDIyLjEgMjQuMjUgMjIuMSAyMi43NVpNMjguNyAzMi45NUMyOS4xIDMyLjk1IDMwLjIgMzMuMTUgMzAuNyAzMy4xNUg0MS44QzQyLjMgMzMuMTUgNDMuMiAzMi45NSA0My43IDMyLjk1QzQ0LjkgMzIuOTUgNDUuOCAzMy44NSA0NS44IDM1LjA1QzQ1LjggMzYuMTUgNDQuOSAzNy4xNSA0My43IDM3LjE1QzQzLjMgMzcuMTUgNDIuMyAzNi45NSA0MS44IDM2Ljk1SDMwLjhDMzAuMyAzNi45NSAyOS4yIDM3LjE1IDI4LjggMzcuMTVDMjcuNiAzNy4xNSAyNi43IDM2LjI1IDI2LjcgMzUuMDVDMjYuNiAzMy45NSAyNy41IDMyLjk1IDI4LjcgMzIuOTVaTTIuMSA2Ny4yNUMyLjUgNjcuMjUgMy42IDY3LjQ1IDQuMSA2Ny40NUgxOC41QzE5IDY3LjQ1IDE5LjkgNjcuMjUgMjAuNCA2Ny4yNUMyMS42IDY3LjI1IDIyLjUgNjguMTUgMjIuNSA2OS4zNUMyMi41IDcwLjQ1IDIxLjYgNzEuNDUgMjAuNCA3MS40NUMyMCA3MS40NSAxOSA3MS4yNSAxOC41IDcxLjI1SDQuMUMzLjYgNzEuMjUgMi41IDcxLjQ1IDIuMSA3MS40NUMwLjkgNzEuNDUgMCA3MC41NSAwIDY5LjM1QzAgNjguMjUgMC45IDY3LjI1IDIuMSA2Ny4yNVpNMjEuOSAzNS42NUMyMS45IDM1Ljk1IDIxLjggMzYuMzUgMjEuNiAzNi43NUMyMS4zIDM3LjQ1IDIwLjkgMzguMzUgMjAuNyAzOC44NUwxNC43IDU0LjY1QzE0LjUgNTUuMDUgMTQuNCA1NS41NSAxNC4yIDU2LjM1QzEzLjggNTcuNjUgMTIuNiA1OC4yNSAxMS4yIDU4LjI1SDEwLjhDOS40IDU4LjI1IDguMiA1Ny43NSA3LjggNTYuMzVDNy42IDU1LjU1IDcuNCA1NS4xNSA3LjIgNTQuNjVMMS4yIDM4Ljg1QzEgMzguMzUgMC42IDM3LjU1IDAuMiAzNi44NUMwLjEgMzYuNDUgMCAzNS45NSAwIDM1LjY1QzAgMzQuMTUgMS4yIDMyLjg1IDIuOCAzMi44NUMzLjkgMzIuODUgNSAzMy41NSA1LjMgMzQuNzVDNS41IDM1LjU1IDUuNSAzNi4xNSA2IDM3LjU1TDEwLjIgNDkuNDVDMTAuNSA1MC4zNSAxMC45IDUxLjQ1IDExLjEgNTIuMzVDMTEuMyA1MS40NSAxMS42IDUwLjQ1IDExLjkgNDkuNTVMMTYgMzcuNTVDMTYuNSAzNi4wNSAxNi40IDM1LjY1IDE2LjcgMzQuODVDMTcuMSAzMy42NSAxOC4xIDMyLjg1IDE5LjMgMzIuODVDMjAuOSAzMi44NSAyMS45IDM0LjE1IDIxLjkgMzUuNjVaTTI5LjcgNzEuNDVDMjguMiA3MS40NSAyNy4yIDcwLjQ1IDI3LjIgNjkuMTVDMjcuMiA2OC43NSAyNy4yIDY4LjI1IDI3LjggNjcuNDVMMzcuNCA1My40NUMzNy45IDUyLjc1IDM4LjUgNTIuMDUgMzkuMSA1MS4zNUgzMi4yQzMxLjUgNTEuMzUgMzAuNyA1MS42NSAzMC4xIDUxLjY1QzI4LjcgNTEuNjUgMjcuNiA1MC43NSAyNy42IDQ5LjM1QzI3LjYgNDcuOTUgMjguNyA0Ni45NSAzMC4xIDQ2Ljk1SDQyLjdDNDQuMiA0Ni45NSA0NS4yIDQ3Ljg1IDQ1LjIgNDkuMjVDNDUuMiA0OS42NSA0NSA1MC4zNSA0NC41IDUxLjA1TDM1LjIgNjQuODVDMzQuNyA2NS42NSAzNC4xIDY2LjQ1IDMzLjUgNjcuMDVINDEuMUM0MS45IDY3LjA1IDQyLjcgNjYuNzUgNDMuMyA2Ni43NUM0NC43IDY2Ljc1IDQ1LjcgNjcuNzUgNDUuNyA2OS4wNUM0NS43IDcwLjU1IDQ0LjUgNzEuNTUgNDMuMiA3MS41NUgyOS43VjcxLjQ1WiIgZmlsbD0iYmxhY2siLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8yNzJfNDA1Ij4KPHJlY3Qgd2lkdGg9IjQ2IiBoZWlnaHQ9IjcyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=';
|
|
11799
|
+
|
|
11800
|
+
const lmvzHeaderCss = () => `:host{display:flex;width:100vw;flex-direction:row;align-items:center;box-sizing:border-box;background-color:var(--lmvz-semantic-color-surface-primary, #ffffff);--lmvz-header-x-spacing-level-1:var(--lmvz-dimension-28-8, clamp(0.5rem, 0.2rem + 1.29vw, 1.75rem));--lmvz-header-x-spacing-level-2:var(--lmvz-component-buttongroup-wrapper-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));padding:var(--lmvz-dimension-16-8, clamp(0.5rem, 0.38rem + 0.52vw, 1rem)) var(--lmvz-header-x-spacing-level-1);gap:var(--lmvz-header-x-spacing-level-1);.brand{display:inline-flex;justify-content:center;align-items:center}#fallback-logo-lmvz{height:34px;width:auto}nav{flex-grow:1}.primary-menubar{display:flex;flex-direction:row;align-items:center}.secondary-menubar{display:flex;flex-direction:row;align-items:center;margin-left:var(--lmvz-header-x-spacing-level-2);padding-left:var(--lmvz-header-x-spacing-level-2);border-left:1px solid var(--lmvz-semantic-color-border-default, #e0e0e0)}}`;
|
|
11801
|
+
|
|
11802
|
+
class LmvzHeader extends ReactiveControllerHost {
|
|
11803
|
+
get el() { return getElement(this); }
|
|
11804
|
+
get validationEl() {
|
|
11805
|
+
return this.el;
|
|
11806
|
+
}
|
|
11807
|
+
primarySlot;
|
|
11808
|
+
secondarySlot;
|
|
11809
|
+
secondaryNav;
|
|
11810
|
+
keyboardNavigationController = new DirectionalFocusController(this, { orientation: 'both' });
|
|
11811
|
+
get primaryMenuitems() {
|
|
11812
|
+
return this.primarySlot?.assignedElements({ flatten: false }) || [];
|
|
11813
|
+
}
|
|
11814
|
+
get secondaryMenuitems() {
|
|
11815
|
+
return this.secondarySlot?.assignedElements({ flatten: true }) || [];
|
|
11816
|
+
}
|
|
11817
|
+
get role() {
|
|
11818
|
+
return 'banner';
|
|
11819
|
+
}
|
|
11820
|
+
lmvzActiveNav;
|
|
11821
|
+
get secondarySlotName() {
|
|
11822
|
+
return `connect-nav-${this.lmvzActiveNav}`;
|
|
11823
|
+
}
|
|
11824
|
+
constructor(hostRef) {
|
|
11825
|
+
super();
|
|
11826
|
+
registerInstance(this, hostRef);
|
|
11827
|
+
this.addController(new AriaValidationController(this, { reValidateOnPropChanges: true }));
|
|
11828
|
+
this.addController(this.keyboardNavigationController);
|
|
11829
|
+
}
|
|
11830
|
+
handleActiveNavChange() {
|
|
11831
|
+
this.updateElementsActive();
|
|
11832
|
+
}
|
|
11833
|
+
async initFocus() {
|
|
11834
|
+
this.keyboardNavigationController.initFocus();
|
|
11835
|
+
}
|
|
11836
|
+
componentDidLoad() {
|
|
11837
|
+
this.primarySlot?.addEventListener('slotchange', this.handlePrimaryNavItemsChange.bind(this));
|
|
11838
|
+
this.handlePrimaryNavItemsChange();
|
|
11839
|
+
this.secondarySlot?.addEventListener('slotchange', this.handleSecondaryNavItemsChange.bind(this));
|
|
11840
|
+
super.componentDidLoad();
|
|
11841
|
+
}
|
|
11842
|
+
handlePrimaryNavItemsChange() {
|
|
11843
|
+
const items = this.primaryMenuitems;
|
|
11844
|
+
if (!items.length) {
|
|
11845
|
+
console.warn('Primary slot has no assigned elements. Please add navigation items to the primary slot.');
|
|
11846
|
+
return;
|
|
11847
|
+
}
|
|
11848
|
+
items.forEach((el) => {
|
|
11849
|
+
el.setAttribute('aria-haspopup', 'true');
|
|
11850
|
+
el.setAttribute('aria-controls', `nav-secondary`);
|
|
11851
|
+
});
|
|
11852
|
+
this.updateElementsActive();
|
|
11853
|
+
this.updateKeyboardNavSubjects();
|
|
11854
|
+
}
|
|
11855
|
+
handleSecondaryNavItemsChange() {
|
|
11856
|
+
const items = this.secondaryMenuitems;
|
|
11857
|
+
if (!items.length) {
|
|
11858
|
+
return;
|
|
11859
|
+
}
|
|
11860
|
+
this.updateKeyboardNavSubjects();
|
|
11861
|
+
}
|
|
11862
|
+
updateKeyboardNavSubjects() {
|
|
11863
|
+
this.keyboardNavigationController.updateElements([...this.primaryMenuitems, ...this.secondaryMenuitems]);
|
|
11864
|
+
}
|
|
11865
|
+
updateElementsActive() {
|
|
11866
|
+
const items = this.primaryMenuitems;
|
|
11867
|
+
if (!items.length)
|
|
11868
|
+
return;
|
|
11869
|
+
let label = '';
|
|
11870
|
+
items.forEach((el) => {
|
|
11871
|
+
const isActive = el.id === this.lmvzActiveNav;
|
|
11872
|
+
if (isActive)
|
|
11873
|
+
label = el.textContent || el.id;
|
|
11874
|
+
el.setAttribute('aria-expanded', isActive ? 'true' : 'false');
|
|
11875
|
+
});
|
|
11876
|
+
if (!label)
|
|
11877
|
+
return;
|
|
11878
|
+
this.secondaryNav?.setAttribute('aria-label', `Untermenü für ${label}`);
|
|
11879
|
+
}
|
|
11880
|
+
delegateFocus() {
|
|
11881
|
+
const firstFocusable = this.primaryMenuitems[0];
|
|
11882
|
+
if (firstFocusable) {
|
|
11883
|
+
firstFocusable.focus();
|
|
11884
|
+
}
|
|
11885
|
+
}
|
|
11886
|
+
render() {
|
|
11887
|
+
return (hAsync(Host, { key: '77744fd74160551232eb0347e9ebb01eb3b9bec0', onFocus: this.delegateFocus.bind(this) }, hAsync("div", { key: 'dfd78b2a2ab06b010d9f29dd61f57aced82243fe', class: "brand" }, hAsync("slot", { key: 'c6d29bbdbcbe581a8a170fbeb3d6ab1e31d27dcd', name: "brand" }, hAsync("img", { key: '80cea3b254d153411864d52c2ba300e0eb3c57a7', id: "fallback-logo-lmvz", src: logoSvg, alt: "Lehrmittelverlag Z\u00FCrich" }))), hAsync("nav", { key: '71c53ae0300b61291d0763cdb23f1f645a83928a', "aria-label": "Hauptnavigation" }, hAsync("div", { key: '09949b77a66c54a10c4c141de846fd5697b9d445', role: "menubar", class: "primary-menubar" }, hAsync("slot", { key: 'acec0cf7e13325c49d1e0929b90b056ad1cbbe64', name: "nav-primary", ref: (el) => (this.primarySlot = el) }), hAsync("div", { key: 'd35860c71ad5e28ee2e3aaafb157acbeff41d83e', role: "menu", id: "nav-secondary", class: "secondary-menubar", hidden: !this.lmvzActiveNav, ref: (el) => (this.secondaryNav = el) }, hAsync("slot", { key: 'a4c3a1ad1b1de5bd903b54ed6bd1616ce6517bbb', name: this.secondarySlotName, ref: (el) => (this.secondarySlot = el) })))), hAsync("div", { key: 'ff50045d9ab28bf66a619a48d9ea1f0ed2f5f952', class: "actions" }, hAsync("slot", { key: '6ead0b7a54bf93bb06f0eab2aa8159bd6e96e8f5', name: "actions" }))));
|
|
11888
|
+
}
|
|
11889
|
+
static get watchers() { return {
|
|
11890
|
+
"lmvzActiveNav": [{
|
|
11891
|
+
"handleActiveNavChange": 0
|
|
11892
|
+
}]
|
|
11893
|
+
}; }
|
|
11894
|
+
static get style() { return lmvzHeaderCss(); }
|
|
11895
|
+
static get cmpMeta() { return {
|
|
11896
|
+
"$flags$": 777,
|
|
11897
|
+
"$tagName$": "lmvz-header",
|
|
11898
|
+
"$members$": {
|
|
11899
|
+
"role": [2561],
|
|
11900
|
+
"lmvzActiveNav": [1, "lmvz-active-nav"],
|
|
11901
|
+
"initFocus": [64]
|
|
11902
|
+
},
|
|
11903
|
+
"$listeners$": undefined,
|
|
11904
|
+
"$lazyBundleId$": "-",
|
|
11905
|
+
"$attrsToReflect$": [["role", "role"]]
|
|
11906
|
+
}; }
|
|
11907
|
+
}
|
|
11908
|
+
|
|
11909
|
+
const lmvzIconCss = () => `.sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));--lmvz-icon-size:var(--lmvz-component-size, var(--lmvz-component-icon-size-md, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)));display:inline-block;line-height:0;svg{display:block;height:var(--lmvz-icon-size);width:auto}svg path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))}}[size='sm'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.84rem + 0.13vw, 1rem))}}[size='md'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-md, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))}}[size='lg'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-lg, clamp(1.25rem, 1.19rem + 0.26vw, 1.5rem))}}[size='inherit'].sc-lmvz-icon-h{svg{height:var(--lmvz-component-size, inherit)}}[weight='light'].sc-lmvz-icon-h{svg path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg path{stroke-width:2;fill:var(--lmvz-icon-color)}}`;
|
|
11910
|
+
|
|
11911
|
+
class LmvzIcon extends ReactiveControllerHost {
|
|
11912
|
+
intersectionObserver;
|
|
11913
|
+
ariaValidationController = new AriaValidationController(this);
|
|
11914
|
+
get el() { return getElement(this); }
|
|
11915
|
+
validationEl;
|
|
11916
|
+
icon;
|
|
11917
|
+
weight = 'medium';
|
|
11918
|
+
size = 'md';
|
|
11919
|
+
iconset;
|
|
11920
|
+
iconData;
|
|
11921
|
+
visible = false;
|
|
11922
|
+
ariaLabel;
|
|
11923
|
+
get ariaHidden() {
|
|
11924
|
+
return !this.ariaLabel;
|
|
11925
|
+
}
|
|
11926
|
+
constructor(hostRef) {
|
|
11927
|
+
super();
|
|
11928
|
+
registerInstance(this, hostRef);
|
|
11929
|
+
this.addController(this.ariaValidationController);
|
|
11930
|
+
}
|
|
11931
|
+
connectedCallback() {
|
|
11932
|
+
this.waitUntilVisible(() => {
|
|
11933
|
+
this.visible = true;
|
|
11934
|
+
this.loadIconPathData();
|
|
11935
|
+
});
|
|
11936
|
+
super.connectedCallback();
|
|
11937
|
+
}
|
|
11938
|
+
disconnectedCallback() {
|
|
11939
|
+
if (this.intersectionObserver && typeof this.intersectionObserver.disconnect === 'function') {
|
|
11940
|
+
this.intersectionObserver.disconnect();
|
|
11941
|
+
}
|
|
11942
|
+
this.intersectionObserver = undefined;
|
|
11943
|
+
super.disconnectedCallback();
|
|
11944
|
+
}
|
|
11945
|
+
async loadIconPathData() {
|
|
11946
|
+
{
|
|
11947
|
+
return;
|
|
11948
|
+
}
|
|
11949
|
+
}
|
|
11950
|
+
componentDidRender() {
|
|
11951
|
+
this.validationEl = this.el.querySelector('svg');
|
|
11952
|
+
this.ariaValidationController.revalidateAria();
|
|
11953
|
+
super.componentDidRender();
|
|
11954
|
+
}
|
|
11955
|
+
render() {
|
|
11956
|
+
return hAsync(Host, { key: 'be6032d11399289c3baddd63ebc7d9e1fb98b773', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
|
|
11957
|
+
}
|
|
11958
|
+
waitUntilVisible(callback, rootMargin = 50) {
|
|
11959
|
+
{
|
|
11960
|
+
callback();
|
|
11961
|
+
return;
|
|
11962
|
+
}
|
|
11963
|
+
}
|
|
11964
|
+
static get watchers() { return {
|
|
11965
|
+
"icon": [{
|
|
11966
|
+
"loadIconPathData": 0
|
|
11967
|
+
}],
|
|
11968
|
+
"iconset": [{
|
|
11969
|
+
"loadIconPathData": 0
|
|
11970
|
+
}]
|
|
11971
|
+
}; }
|
|
11972
|
+
static get style() { return lmvzIconCss(); }
|
|
11973
|
+
static get cmpMeta() { return {
|
|
11974
|
+
"$flags$": 514,
|
|
11975
|
+
"$tagName$": "lmvz-icon",
|
|
11976
|
+
"$members$": {
|
|
11977
|
+
"icon": [513],
|
|
11978
|
+
"weight": [513],
|
|
11979
|
+
"size": [513],
|
|
11980
|
+
"iconset": [513],
|
|
11981
|
+
"ariaLabel": [513, "aria-label"],
|
|
11982
|
+
"iconData": [32],
|
|
11983
|
+
"visible": [32]
|
|
11984
|
+
},
|
|
11985
|
+
"$listeners$": undefined,
|
|
11986
|
+
"$lazyBundleId$": "-",
|
|
11987
|
+
"$attrsToReflect$": [["icon", "icon"], ["weight", "weight"], ["size", "size"], ["iconset", "iconset"], ["ariaLabel", "aria-label"]]
|
|
11988
|
+
}; }
|
|
11989
|
+
}
|
|
11990
|
+
|
|
11991
|
+
const nextFrame = () => new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
11992
|
+
const wait = () => new Promise((resolve) => setTimeout(() => resolve()));
|
|
11993
|
+
const waitFrame = async () => {
|
|
11994
|
+
await wait();
|
|
11995
|
+
await nextFrame();
|
|
11996
|
+
};
|
|
11997
|
+
const raf = (h) => {
|
|
11998
|
+
if (typeof __zone_symbol__requestAnimationFrame === 'function') {
|
|
11999
|
+
return __zone_symbol__requestAnimationFrame(h);
|
|
12000
|
+
}
|
|
12001
|
+
if (typeof requestAnimationFrame === 'function') {
|
|
12002
|
+
return requestAnimationFrame(h);
|
|
12003
|
+
}
|
|
12004
|
+
return setTimeout(h);
|
|
12005
|
+
};
|
|
12006
|
+
|
|
12007
|
+
const componentOnReady = (stencilEl, callback) => {
|
|
12008
|
+
if (hasLazyBuild(stencilEl)) {
|
|
12009
|
+
stencilEl.componentOnReady().then((resolvedEl) => callback(resolvedEl));
|
|
12010
|
+
}
|
|
12011
|
+
else {
|
|
12012
|
+
raf(() => callback(stencilEl));
|
|
12013
|
+
}
|
|
12014
|
+
};
|
|
12015
|
+
const hasLazyBuild = (stencilEl) => {
|
|
12016
|
+
return stencilEl.componentOnReady !== undefined;
|
|
12017
|
+
};
|
|
12018
|
+
|
|
12019
|
+
const lmvzInputCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } .sc-lmvz-input-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --input-radius: var(--lmvz-component-input-radius-default, 999px); --input-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --input-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --input-border-color-hover: var(--lmvz-semantic-color-border-hover, #a1a1a1); --input-border-color-focus: var(--lmvz-semantic-color-border-active, #0f8acc); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --label-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454); --input-text-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --helper-text-color: var(--lmvz-semantic-color-on-surface-input-secondary, #545454); --error-text-color: var(--lmvz-semantic-color-status-on-danger, #a31419); --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } [size='sm'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); --input-padding-x: var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); --input-gap: var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem)); --input-font-size: var(--lmvz-component-body-sm-font-size, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); } [size='md'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --input-padding-x: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --input-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --input-font-size: var(--lmvz-component-body-md-font-size, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); } [size='lg'].sc-lmvz-input-h { --input-height: var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem)); --input-padding-x: var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)); --input-gap: var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); --input-font-size: var(--lmvz-component-body-lg-font-size, clamp(1rem, 0.97rem + 0.13vw, 1.13rem)); } .input-container.sc-lmvz-input { display: flex; flex-direction: column; position: relative; width: 100%; } .input-wrapper.sc-lmvz-input { background-color: var(--input-bg); border: var(--input-border-width) solid var(--input-border-color); border-radius: var(--input-radius); display: flex; align-items: center; height: var(--input-height); padding: 0 var(--input-padding-x); position: relative; transition: border-color 0.2s ease; gap: var(--input-gap); } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .input-container.sc-lmvz-input:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--input-border-color-focus); outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); } [error].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); } .sc-lmvz-input-h:not([disabled]) .input-wrapper.sc-lmvz-input:hover { border-color: var(--input-border-color-hover); } .label-input-group.sc-lmvz-input { position: relative; flex-grow: 1; display: flex; align-items: center; height: 100%; } label.sc-lmvz-input { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--label-color); font-size: var(--input-font-size); font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: 1.5; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0.5em; transform: translateY(-100%); transform-origin: left top; font-size: var(--lmvz-component-body-2xs-font-size, clamp(0.5rem, 0.47rem + 0.13vw, 0.63rem)); background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 400; } .required-indicator.sc-lmvz-input { color: var(--error-text-color); margin-left: 2px; } input.sc-lmvz-input { border: none; background: transparent; width: 100%; height: 100%; color: var(--input-text-color); font-family: inherit; font-size: var(--input-font-size); outline: none; padding: 0; margin: 0; font-weight: 400; } input.sc-lmvz-input::placeholder { color: var(--label-color); } div.sc-lmvz-input:empty { display: none; } [role='status'].sc-lmvz-input { padding-top: 8px; padding-left: var(--input-padding-x); font-size: 12px; color: var(--helper-text-color); font-weight: 400; } [role='alert'].sc-lmvz-input { padding-top: 8px; padding-left: var(--input-padding-x); font-size: 12px; color: var(--error-text-color); font-weight: 400; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: var(--lmvz-dimension-6-4, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)); --lmvz-button-min-height-override: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); }`;
|
|
12020
|
+
|
|
12021
|
+
let inputIdCounter = 0;
|
|
12022
|
+
class LmvzInput extends ReactiveControllerHost {
|
|
12023
|
+
get el() { return getElement(this); }
|
|
12024
|
+
get validationEl() {
|
|
12025
|
+
return this.el;
|
|
12026
|
+
}
|
|
12027
|
+
lmvzInput;
|
|
12028
|
+
internals;
|
|
12029
|
+
nativeInputElement;
|
|
12030
|
+
inputId = `lmvz-input-${inputIdCounter++}`;
|
|
12031
|
+
initialValue = '';
|
|
12032
|
+
ariaHostMirrorObserver;
|
|
12033
|
+
nativeError = false;
|
|
12034
|
+
errorFromProp = false;
|
|
12035
|
+
get helperId() {
|
|
9235
12036
|
return this.helperText ? `${this.inputId}-helper` : undefined;
|
|
9236
12037
|
}
|
|
9237
12038
|
get showErrorMessage() {
|
|
@@ -9328,6 +12129,42 @@ class LmvzInput extends ReactiveControllerHost {
|
|
|
9328
12129
|
this.initialValue = this.value ?? '';
|
|
9329
12130
|
super.componentWillLoad();
|
|
9330
12131
|
}
|
|
12132
|
+
connectedCallback() {
|
|
12133
|
+
super.connectedCallback();
|
|
12134
|
+
this.ariaHostMirrorObserver = new MutationObserver((mutations) => {
|
|
12135
|
+
for (const mutation of mutations) {
|
|
12136
|
+
this.mirrorHostAriaAttribute(mutation.attributeName);
|
|
12137
|
+
}
|
|
12138
|
+
});
|
|
12139
|
+
this.ariaHostMirrorObserver.observe(this.el, {
|
|
12140
|
+
attributes: true,
|
|
12141
|
+
attributeFilter: [...ariaHostMirrorAttributes],
|
|
12142
|
+
});
|
|
12143
|
+
}
|
|
12144
|
+
disconnectedCallback() {
|
|
12145
|
+
super.disconnectedCallback();
|
|
12146
|
+
this.ariaHostMirrorObserver?.disconnect();
|
|
12147
|
+
this.ariaHostMirrorObserver = undefined;
|
|
12148
|
+
}
|
|
12149
|
+
componentDidLoad() {
|
|
12150
|
+
super.componentDidLoad();
|
|
12151
|
+
for (const attr of ariaHostMirrorAttributes) {
|
|
12152
|
+
this.mirrorHostAriaAttribute(attr);
|
|
12153
|
+
}
|
|
12154
|
+
}
|
|
12155
|
+
mirrorHostAriaAttribute(attr) {
|
|
12156
|
+
if (!attr || !this.nativeInputElement)
|
|
12157
|
+
return;
|
|
12158
|
+
if (this.el.hasAttribute(attr)) {
|
|
12159
|
+
const value = this.el.getAttribute(attr);
|
|
12160
|
+
if (value !== null) {
|
|
12161
|
+
this.nativeInputElement.setAttribute(attr, value);
|
|
12162
|
+
}
|
|
12163
|
+
}
|
|
12164
|
+
else {
|
|
12165
|
+
this.nativeInputElement.removeAttribute(attr);
|
|
12166
|
+
}
|
|
12167
|
+
}
|
|
9331
12168
|
formAssociatedCallback(form) {
|
|
9332
12169
|
if (!form)
|
|
9333
12170
|
return;
|
|
@@ -9375,9 +12212,9 @@ class LmvzInput extends ReactiveControllerHost {
|
|
|
9375
12212
|
render() {
|
|
9376
12213
|
const hasValue = Boolean(this.value);
|
|
9377
12214
|
const shouldFloatLabel = hasValue || Boolean(this.placeholder);
|
|
9378
|
-
return (hAsync("div", { key: '
|
|
12215
|
+
return (hAsync("div", { key: 'b7e432c7dbc598189d85040252455c5163fe6395', class: classNames('input-container', {
|
|
9379
12216
|
'interaction-filled': hasValue,
|
|
9380
|
-
}) }, hAsync("div", { key: '
|
|
12217
|
+
}) }, hAsync("div", { key: 'a912a49f4372423d06c7a4856fb5101cb0afd0c5', class: "input-wrapper" }, hAsync("slot", { key: '88e4ee4518de0bfeef9e30a254e0d2ec6693048c', name: "before-input" }), hAsync("div", { key: 'a413a7b7e8f6510f1c09fd0052889c8fad1653f1', class: "label-input-group" }, hAsync("label", { key: '9639713adff74afcf4fb1eab0e74b7447d02b986', htmlFor: this.inputId, class: classNames({ floating: shouldFloatLabel }) }, this.label, this.required && (hAsync("span", { key: '28c1069908a2f1905008f1decce9077e9ef1538a', class: "required-indicator", "aria-hidden": "true" }, ' ', "*"))), hAsync("input", { key: '421fd9bb50de8ba189a59578373060593e1a9aab', id: this.inputId, ref: (el) => (this.nativeInputElement = el), type: this.type, min: this.min, max: this.max, step: this.step, value: this.value, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, required: this.required, form: this.form, autocomplete: this.autocomplete, inputmode: this.inputmode, autocorrect: this.autocorrect, autocapitalize: this.autocapitalize, spellcheck: this.spellcheck, autofocus: this.autofocus, minlength: this.minlength, maxlength: this.maxlength, pattern: this.pattern, "aria-invalid": this.error ? 'true' : 'false', "aria-required": this.required ? 'true' : 'false', "aria-describedby": this.describedBy, "aria-errormessage": this.errorId, onInput: this.handleInput, onChange: this.handleChange, onFocus: this.handleFocus, onBlur: this.handleBlur })), hAsync("slot", { key: '09557e1d84bb4ab2456caf391a177c8f80063ab9', name: "after-input" })), hAsync("div", { key: '34162f744f8584991e4493ebcdb6a2f75a1f8990', id: this.helperId, role: "status" }, this.helperText || null), hAsync("div", { key: 'a3c3bffbb439f9127278cedbfefa5e1986e68f23', id: this.errorId, role: "alert" }, (this.showErrorMessage && this.errorMessage) || null)));
|
|
9381
12218
|
}
|
|
9382
12219
|
static get formAssociated() { return true; }
|
|
9383
12220
|
static get watchers() { return {
|
|
@@ -9483,7 +12320,7 @@ class LmvzLink {
|
|
|
9483
12320
|
const rel = this.computeRel();
|
|
9484
12321
|
const iconSvg = this.type === 'external' ? EXTERNAL_SVG : ARROW_RIGHT_SVG;
|
|
9485
12322
|
const isBlank = this.target === '_blank';
|
|
9486
|
-
return (hAsync(Host, { key: '
|
|
12323
|
+
return (hAsync(Host, { key: 'ee4f5c107243ff858f9189840e56a0525fdac782' }, hAsync("a", { key: '28229373bec276579c2bb7b9fcf254872baae9e8', href: this.computeHref(), target: this.target, rel: rel }, hAsync("slot", { key: '7c58f3f7501e457ee4a35d2a9f2bf80ed0c33fb0' }), hAsync("lmvz-icon", { key: '14784743d148d57e7c83da0f92ba96e4bb3a30a1', "aria-hidden": "true", icon: iconSvg }), isBlank && hAsync("span", { key: 'f72adde57b462282d1a8313e2eb06cf6b68c2697', class: "sr-only" }, this.externalLabel))));
|
|
9487
12324
|
}
|
|
9488
12325
|
static get delegatesFocus() { return true; }
|
|
9489
12326
|
static get watchers() { return {
|
|
@@ -9531,7 +12368,7 @@ class LmvzMenuItem extends ReactiveControllerHost {
|
|
|
9531
12368
|
this.addController(new ElementActivationController(this));
|
|
9532
12369
|
}
|
|
9533
12370
|
render() {
|
|
9534
|
-
return (hAsync(Host, { key: '
|
|
12371
|
+
return (hAsync(Host, { key: 'cd5814d6bcfa9b0f5b1b2f5108ce0fc65722b909' }, hAsync("slot", { key: 'b503b252c95bc09ca4b888d4576badd3976292e9', ref: (e) => (this.validationSlot = e) })));
|
|
9535
12372
|
}
|
|
9536
12373
|
static get style() { return lmvzMenuitemCss(); }
|
|
9537
12374
|
static get cmpMeta() { return {
|
|
@@ -9649,7 +12486,7 @@ class LmvzMessage {
|
|
|
9649
12486
|
}
|
|
9650
12487
|
render() {
|
|
9651
12488
|
const role = this.live === 'assertive' ? 'alert' : this.live === 'polite' ? 'status' : 'note';
|
|
9652
|
-
return (hAsync(Host, { key: '
|
|
12489
|
+
return (hAsync(Host, { key: '1c45cf27f057535ffff047548a3d6681dd487d3c', role: role }, this.leadingIcon && hAsync("span", { key: '8efab69f677dfaa06d333aa304479e17e6d60ad6', class: "leading-icon", "aria-hidden": "true", innerHTML: TYPE_SVG[this.type] }), hAsync("span", { key: '2e88e9053444e2aae23341b7cba923c7c440ff64', class: "message" }, hAsync("slot", { key: 'd6b0ee6c95846a1de97e0e6ed707001c29c78c92', ref: (el) => (this.messageSlot = el), onSlotchange: this.handleSlotChange })), this.actionLabel && (hAsync("lmvz-button", { key: 'c55e38e274e98c8ac584ae16520fb0cab5e11d17', variant: "tertiary", scale: "small", onLmvzActivation: this.handleActionClick }, this.actionLabel)), this.dismissible && (hAsync("lmvz-button", { key: '1ae69fefbb23cd8a219aee1d624e9d7779ae0c08', variant: "tertiary", scale: "small", "aria-label": this.closeLabel, onClick: this.handleDismissClick }, hAsync("lmvz-icon", { key: '572c5b3309a1b1b9798dc6fc3f4ad11d0a354ebc', "aria-hidden": "true", icon: CLOSE_SM_SVG })))));
|
|
9653
12490
|
}
|
|
9654
12491
|
static get style() { return lmvzMessageCss(); }
|
|
9655
12492
|
static get cmpMeta() { return {
|
|
@@ -9893,7 +12730,7 @@ class LmvzModal extends ReactiveControllerHost {
|
|
|
9893
12730
|
this.hasHeader = this.hasAssignedContent(this.headerSlot);
|
|
9894
12731
|
};
|
|
9895
12732
|
render() {
|
|
9896
|
-
return (hAsync(Host, { key: '
|
|
12733
|
+
return (hAsync(Host, { key: '9eb1aa89e4c682586d10291e2a8a2523b8fd17f7' }, hAsync("dialog", { key: '477c537328622f85759dc72a0c499d56e3d5e345', ref: (element) => (this.dialogEl = element), onCancel: this.handleDialogCancel, onClose: this.handleDialogClose, ...this.dialogAccessibilityAttributes }, hAsync("div", { key: 'b9fe9cb306938a117002e5213740ea20269080b8', class: "modal-shell" }, hAsync("header", { key: '34d0cd8078d55d98ec526843f02710044663de70', class: { header: true, 'has-title': this.hasHeader } }, hAsync("div", { key: '1408f0e0875f5e0508ad0f5682f4879a93df65df', class: "title", id: this.dialogTitleId, hidden: !this.hasHeader }, hAsync("slot", { key: '735c1757962e4f3804700a4669d0b49f2d11fb16', name: "header", ref: (element) => (this.headerSlot = element), onSlotchange: this.handleHeaderSlotChange })), hAsync("lmvz-button", { key: 'b0eb76cde508fb434023abdc0f764e1b809b6447', ref: (element) => (this.closeButtonEl = element), type: "button", class: "close-button", "aria-label": this.closeLabel, onLmvzActivation: this.handleCloseButtonClick, variant: "tertiary" }, hAsync("lmvz-icon", { key: '9f978d3117a4046202c3ba1df39aa0c7afc7ee28', icon: closeIconSvg }))), hAsync("div", { key: '46ffd7e7315099189c0a2499d17bdeabeb0e46e5', class: "body" }, hAsync("slot", { key: '095c3353f2ea00f6fa765ac0972ee0123f8e4154' })), hAsync("footer", { key: '5b092b00f10acede66d0fac53f01584ecf528418', class: "actions", hidden: !this.buttonGroupEl?.hasActions }, hAsync("lmvz-button-group", { key: 'ce312e1b1c3407838b8704f20393e7120d6338f9', ref: (element) => (this.buttonGroupEl = element) }, hAsync("slot", { key: '6246782cbee1cc440cfdaf45dac36655f19c972e', name: "actions" })))))));
|
|
9897
12734
|
}
|
|
9898
12735
|
static get watchers() { return {
|
|
9899
12736
|
"open": [{
|
|
@@ -11349,6 +14186,9 @@ class LmvzPopover {
|
|
|
11349
14186
|
anchorEl.setAttribute('aria-haspopup', 'dialog');
|
|
11350
14187
|
}
|
|
11351
14188
|
anchorEl.setAttribute('aria-controls', this.el.getAttribute('id'));
|
|
14189
|
+
if (!anchorEl.hasAttribute('aria-expanded')) {
|
|
14190
|
+
anchorEl.setAttribute('aria-expanded', this.open ? 'true' : 'false');
|
|
14191
|
+
}
|
|
11352
14192
|
if (isActionButton(anchorEl)) {
|
|
11353
14193
|
addElementActivationListener(anchorEl, this.toggle.bind(this), this.extEventController.signal);
|
|
11354
14194
|
}
|
|
@@ -11434,7 +14274,8 @@ class LmvzPopover {
|
|
|
11434
14274
|
document.addEventListener('mousedown', (event) => {
|
|
11435
14275
|
if (!this.open)
|
|
11436
14276
|
return;
|
|
11437
|
-
|
|
14277
|
+
const mouseTarget = (event.target?.shadowRoot ?? document).elementFromPoint(event.x, event.y) ?? event.target;
|
|
14278
|
+
if (this.el === event.target || this.el.contains(mouseTarget) || this.el.contains(event.target))
|
|
11438
14279
|
return;
|
|
11439
14280
|
this.triggerClose();
|
|
11440
14281
|
}, options);
|
|
@@ -11450,7 +14291,7 @@ class LmvzPopover {
|
|
|
11450
14291
|
this.closureController?.abort();
|
|
11451
14292
|
}
|
|
11452
14293
|
render() {
|
|
11453
|
-
return (hAsync(Host, { key: '
|
|
14294
|
+
return (hAsync(Host, { key: 'f996d0a561b8f6d00913b0e2e84ac9711b878f84' }, hAsync("div", { key: 'f7fff89cf470a96b0d3d2adce43a92069d754861', role: "dialog", part: "container", class: `container lmvz-wrapper-card-${this.size}`, "aria-label": this.label || undefined, ref: (el) => (this.containerEl = el) }, hAsync("slot", { key: '2263710272a745d74f118fab6d22f0d05319fc74', ref: (el) => (this.slotEl = el) }))));
|
|
11454
14295
|
}
|
|
11455
14296
|
static get watchers() { return {
|
|
11456
14297
|
"open": [{
|
|
@@ -11823,7 +14664,7 @@ class LmvzRadio extends ReactiveControllerHost {
|
|
|
11823
14664
|
this.radioGroupController.setFocused(target);
|
|
11824
14665
|
}
|
|
11825
14666
|
render() {
|
|
11826
|
-
return (hAsync(Host, { key: '
|
|
14667
|
+
return (hAsync(Host, { key: 'cb2db48956ca781f226fbbddcf1d8ea819f9192a' }, hAsync("input", { key: 'ec208dbaa714ae015415370b0d38ef916955b023', type: "radio", id: this.radioId, name: this.name ?? undefined, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, autoFocus: this.autofocus, "aria-invalid": this.error ? 'true' : undefined, "aria-describedby": this.helperId, ref: (el) => (this.nativeInput = el), onChange: this.handleChange }), hAsync("span", { key: 'ef8221077d410d59248ce30678989f6bf7fbbebb', class: "circle", "aria-hidden": "true" }, this.checked && hAsync("span", { key: '7faa45b58d39f05f64a7782329046fe07b0c2a98', class: "dot" })), hAsync("span", { key: 'e508b4bf061ab0e038df7c169a80285bb7930dc3', class: "content" }, hAsync("label", { key: '8117be47e7b0ae9cc17bab21bb7cc5d9300d2146', htmlFor: this.radioId }, this.label), hAsync("span", { key: '44ab845ee18415b54fb5d23e533f85644f4e5e50', "aria-live": "polite", class: "helper-text", id: this.helperId }, this.helperText))));
|
|
11827
14668
|
}
|
|
11828
14669
|
static get formAssociated() { return true; }
|
|
11829
14670
|
static get watchers() { return {
|
|
@@ -11916,7 +14757,7 @@ class LmvzSelect extends ReactiveControllerHost {
|
|
|
11916
14757
|
render() {
|
|
11917
14758
|
const hasValue = this.hasValue;
|
|
11918
14759
|
const shouldShowLabel = hasValue;
|
|
11919
|
-
return (hAsync(Host, { key: '
|
|
14760
|
+
return (hAsync(Host, { key: '764be3255f76406e66600e800da85d84de8a5b62', "data-highlighted": String(this.highlighted) }, hAsync("div", { key: '81c6c1eb04d9062b142f30c201b3ec24feec8814', class: hasValue ? 'select-wrapper has-value' : 'select-wrapper' }, hAsync("label", { key: '49199adcb31515ce4b4789f27cc2520805c29a3c', htmlFor: this.selectId, class: shouldShowLabel ? 'floating-label' : 'assistive-label' }, this.label, this.required && shouldShowLabel && hAsync("span", { key: 'e7e02e878d8a130d61e426774d9d362a49e481a7', "aria-hidden": "true" }, " *")), hAsync("div", { key: 'bc5ff1214d856a084918c8e68d1b1567a97b41bb', "aria-hidden": "true" }, hAsync("span", { key: 'cc3513a16e4e621bc47f35c252e981bc25bc0d77' }, hasValue ? this.selectedLabel : this.label, this.required && !hasValue && hAsync("span", { key: 'a34658592f038b9438808418cc106842d98e63d5', "aria-hidden": "true" }, " *")), hAsync("span", { key: 'cd71dd492d758e7e53e6212cc9549ec4057abe3f' }, hAsync("svg", { key: 'fa1ea83d316fa9280516316b695163634264151c', width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, hAsync("path", { key: '7750c64531e98cc5cdebafa1ecacf624945ab198', d: "M20.3334 8.66663L12.0001 17L3.66675 8.66663", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" })))), hAsync("select", { key: '53a4e34ad1405447177675e67afcc2e9c18319cb', id: this.selectId, ref: (el) => (this.nativeSelectEl = el), name: this.name, disabled: this.disabled, required: this.required, "aria-label": this.label, onChange: this.handleChange }, !hasValue && hAsync("option", { key: '78ba2e2225d3d3b558c8a20f276f6fbbc0a670b8', value: "", disabled: true, selected: true, hidden: true }), hAsync("slot", { key: 'bbc561f3f55dbc42b705f251fdc146b0496c72a1' }))), this.helperText && hAsync("div", { key: '5bc860035c0ee46f62fefdb74d752b419bb19f7c', role: "status" }, this.helperText)));
|
|
11920
14761
|
}
|
|
11921
14762
|
static get watchers() { return {
|
|
11922
14763
|
"value": [{
|
|
@@ -12008,7 +14849,7 @@ class LmvzSnackbar {
|
|
|
12008
14849
|
this.el.dispatchEvent(new CustomEvent('lmvzAction', { bubbles: false, composed: false }));
|
|
12009
14850
|
};
|
|
12010
14851
|
render() {
|
|
12011
|
-
return (hAsync(Host, { key: '
|
|
14852
|
+
return (hAsync(Host, { key: '3526d31aa5842f2d4bf5b5b878a7ca03bb4bf731', class: this.animationClass }, hAsync("lmvz-icon", { key: '52080f476e527c9af337eb1997db1b29a90fb5c0', icon: STATUS_SVG[this.status], size: "md", weight: "bold" }), hAsync("span", { key: 'a18eaf04ca959432fc76037efd24ecf1001bd798', class: "message" }, this.message), this.actionLabel && (hAsync("lmvz-button", { key: '3126781af40ea74854db8e7c2aa7e1fb1b632d38', variant: "tertiary", scale: "small", onLmvzActivation: this.handleActionClick }, this.actionLabel))));
|
|
12012
14853
|
}
|
|
12013
14854
|
static get watchers() { return {
|
|
12014
14855
|
"status": [{
|
|
@@ -12045,7 +14886,7 @@ class LmvzSpinner {
|
|
|
12045
14886
|
ariaLabel;
|
|
12046
14887
|
render() {
|
|
12047
14888
|
const hasLabel = !!this.ariaLabel?.trim();
|
|
12048
|
-
return (hAsync(Host, { key: '
|
|
14889
|
+
return (hAsync(Host, { key: '96a151ca5586df967f9973e73cfb7be458254dc4', role: hasLabel ? 'status' : undefined, "aria-label": hasLabel ? this.ariaLabel : undefined, "aria-hidden": hasLabel ? undefined : 'true' }, hAsync("svg", { key: '27d404b929294aba50170e0ad4951c0c03d7a286', part: "indicator", viewBox: "0 0 16 16", "aria-hidden": "true" }, hAsync("circle", { key: 'bcf47ee3a704f46ab4ec26de41dd859db17266e9', pathLength: "100", cx: "8", cy: "8", r: "6" }))));
|
|
12049
14890
|
}
|
|
12050
14891
|
static get style() { return lmvzSpinnerCss(); }
|
|
12051
14892
|
static get cmpMeta() { return {
|
|
@@ -12081,7 +14922,7 @@ class LmvzTab {
|
|
|
12081
14922
|
this.el.dispatchEvent(new CustomEvent('lmvzTabReady', { bubbles: true, composed: false }));
|
|
12082
14923
|
}
|
|
12083
14924
|
render() {
|
|
12084
|
-
return (hAsync(Host, { key: '
|
|
14925
|
+
return (hAsync(Host, { key: '992500dcc371efbeab4eb83fbcfb9745384fa423' }, hAsync("button", { key: 'e346c88625b701636704e89b749971e6a016a3ff', part: "button", role: "tab", disabled: this.disabled, "aria-selected": String(this.selected), "aria-disabled": this.disabled ? 'true' : undefined, tabIndex: 0 }, hAsync("slot", { key: 'ee0790e6f04c1c05fbbb7a624e0c791e1db24506', name: "media", ref: (el) => (this.mediaSlotEl = el), onSlotchange: this.handleMediaSlotChange }), hAsync("span", { key: '45b0c2c38dcec72ab02cd308e0301d1c912e96f7', class: "label" }, hAsync("slot", { key: 'e31e6c8ade0c7b44684836c29fbb65464db7ae59' })), hAsync("span", { key: '03016f465e673bf27261e8ceb5c3a6a1666551a7', "aria-hidden": "true", part: "indicator", class: "indicator" }))));
|
|
12085
14926
|
}
|
|
12086
14927
|
static get delegatesFocus() { return true; }
|
|
12087
14928
|
static get style() { return lmvzTabCss(); }
|
|
@@ -12338,7 +15179,7 @@ class LmvzTabs extends ReactiveControllerHost {
|
|
|
12338
15179
|
this.selectTab(value);
|
|
12339
15180
|
};
|
|
12340
15181
|
render() {
|
|
12341
|
-
return (hAsync(Host, { key: '
|
|
15182
|
+
return (hAsync(Host, { key: '27d096ac6ed21fb72a5c6336c6f07ee2fe36bd92', onClick: this.handleTabClick, onKeydown: this.handleKeydown }, hAsync("div", { key: 'c3b530f13cf6829e8519a678e577e8aa6bf1c3d6', role: "tablist", "aria-orientation": this.orientation, class: "tablist" }, hAsync("slot", { key: '018641f52dfcab6dea884c95a5e550dbe60f74f6', ref: (el) => (this.tabSlotEl = el) })), hAsync("div", { key: '6f7cce2b8e551683ba04c53ebae8233c3ef61969', part: "panels-container", class: "panels-container" }, hAsync("slot", { key: '8e9f0c1e1866180a763dd41aa1974f5cf354fb44', name: "panels", ref: (el) => (this.panelSlotEl = el) }))));
|
|
12342
15183
|
}
|
|
12343
15184
|
static get watchers() { return {
|
|
12344
15185
|
"value": [{
|
|
@@ -12443,7 +15284,7 @@ class LmvzToggle extends ReactiveControllerHost {
|
|
|
12443
15284
|
this.lmvzChange.emit(newChecked);
|
|
12444
15285
|
};
|
|
12445
15286
|
render() {
|
|
12446
|
-
return (hAsync(Host, { key: '
|
|
15287
|
+
return (hAsync(Host, { key: 'bde08dcbd39c0c02602590bc0c536b5d671fa76e' }, hAsync("span", { key: '2567f70f81014d8ab7b9073a0d59f33bfeeca6a5', class: "track" }, hAsync("input", { key: '88c9fc7523489dd0decf5b5f3ddda604aadcf8a9', type: "checkbox", role: "switch", id: this.toggleId, checked: this.checked, disabled: this.disabled, required: this.required, name: this.name, value: this.value, form: this.form, ref: (el) => (this.nativeInputElement = el), onChange: this.handleChange }), hAsync("span", { key: '816fc007d7c87acc8ff0286eb861bd29059b44eb', class: "thumb", "aria-hidden": "true" })), hAsync("label", { key: '9525cd785d2c6c3b6242c6f5eac215996b881873', htmlFor: this.toggleId }, this.label)));
|
|
12447
15288
|
}
|
|
12448
15289
|
static get formAssociated() { return true; }
|
|
12449
15290
|
static get watchers() { return {
|
|
@@ -12486,6 +15327,7 @@ registerComponents([
|
|
|
12486
15327
|
LmvzCard,
|
|
12487
15328
|
LmvzCheckbox,
|
|
12488
15329
|
LmvzChip,
|
|
15330
|
+
LmvzDatepicker,
|
|
12489
15331
|
LmvzHeader,
|
|
12490
15332
|
LmvzIcon,
|
|
12491
15333
|
LmvzInput,
|