@dso-toolkit/core 73.2.1 → 73.3.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/dist/bundle/dso-accordion-section.d.ts +11 -0
- package/dist/bundle/dso-accordion-section.js +281 -0
- package/dist/bundle/dso-accordion-section.js.map +1 -0
- package/dist/bundle/dso-accordion.d.ts +11 -0
- package/dist/bundle/dso-accordion.js +262 -0
- package/dist/bundle/dso-accordion.js.map +1 -0
- package/dist/bundle/dso-action-list-item.d.ts +11 -0
- package/dist/bundle/dso-action-list-item.js +63 -0
- package/dist/bundle/dso-action-list-item.js.map +1 -0
- package/dist/bundle/dso-action-list.d.ts +11 -0
- package/dist/bundle/dso-action-list.js +38 -0
- package/dist/bundle/dso-action-list.js.map +1 -0
- package/dist/bundle/dso-advanced-select.d.ts +11 -0
- package/dist/bundle/dso-advanced-select.js +155 -0
- package/dist/bundle/dso-advanced-select.js.map +1 -0
- package/dist/bundle/dso-alert.d.ts +11 -0
- package/dist/bundle/dso-alert.js +9 -0
- package/dist/bundle/dso-alert.js.map +1 -0
- package/dist/bundle/dso-annotation-activiteit.d.ts +11 -0
- package/dist/bundle/dso-annotation-activiteit.js +87 -0
- package/dist/bundle/dso-annotation-activiteit.js.map +1 -0
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.d.ts +11 -0
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.js +83 -0
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.js.map +1 -0
- package/dist/bundle/dso-annotation-kaart.d.ts +11 -0
- package/dist/bundle/dso-annotation-kaart.js +72 -0
- package/dist/bundle/dso-annotation-kaart.js.map +1 -0
- package/dist/bundle/dso-annotation-locatie.d.ts +11 -0
- package/dist/bundle/dso-annotation-locatie.js +9 -0
- package/dist/bundle/dso-annotation-locatie.js.map +1 -0
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.d.ts +11 -0
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.js +87 -0
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.js.map +1 -0
- package/dist/bundle/dso-attachments-counter.d.ts +11 -0
- package/dist/bundle/dso-attachments-counter.js +9 -0
- package/dist/bundle/dso-attachments-counter.js.map +1 -0
- package/dist/bundle/dso-autosuggest.d.ts +11 -0
- package/dist/bundle/dso-autosuggest.js +588 -0
- package/dist/bundle/dso-autosuggest.js.map +1 -0
- package/dist/bundle/dso-badge.d.ts +11 -0
- package/dist/bundle/dso-badge.js +9 -0
- package/dist/bundle/dso-badge.js.map +1 -0
- package/dist/bundle/dso-banner.d.ts +11 -0
- package/dist/bundle/dso-banner.js +53 -0
- package/dist/bundle/dso-banner.js.map +1 -0
- package/dist/bundle/dso-card-container.d.ts +11 -0
- package/dist/bundle/dso-card-container.js +42 -0
- package/dist/bundle/dso-card-container.js.map +1 -0
- package/dist/bundle/dso-card.d.ts +11 -0
- package/dist/bundle/dso-card.js +72 -0
- package/dist/bundle/dso-card.js.map +1 -0
- package/dist/bundle/dso-contact-information.d.ts +11 -0
- package/dist/bundle/dso-contact-information.js +36 -0
- package/dist/bundle/dso-contact-information.js.map +1 -0
- package/dist/bundle/dso-date-picker-legacy.d.ts +11 -0
- package/dist/bundle/dso-date-picker-legacy.js +773 -0
- package/dist/bundle/dso-date-picker-legacy.js.map +1 -0
- package/dist/bundle/dso-date-picker.d.ts +11 -0
- package/dist/bundle/dso-date-picker.js +187 -0
- package/dist/bundle/dso-date-picker.js.map +1 -0
- package/dist/bundle/dso-document-card.d.ts +11 -0
- package/dist/bundle/dso-document-card.js +66 -0
- package/dist/bundle/dso-document-card.js.map +1 -0
- package/dist/bundle/dso-document-component.d.ts +11 -0
- package/dist/bundle/dso-document-component.js +9 -0
- package/dist/bundle/dso-document-component.js.map +1 -0
- package/dist/bundle/dso-dropdown-menu.d.ts +11 -0
- package/dist/bundle/dso-dropdown-menu.js +9 -0
- package/dist/bundle/dso-dropdown-menu.js.map +1 -0
- package/dist/bundle/dso-expandable.d.ts +11 -0
- package/dist/bundle/dso-expandable.js +9 -0
- package/dist/bundle/dso-expandable.js.map +1 -0
- package/dist/bundle/dso-header.d.ts +11 -0
- package/dist/bundle/dso-header.js +218 -0
- package/dist/bundle/dso-header.js.map +1 -0
- package/dist/bundle/dso-highlight-box.d.ts +11 -0
- package/dist/bundle/dso-highlight-box.js +45 -0
- package/dist/bundle/dso-highlight-box.js.map +1 -0
- package/dist/bundle/dso-icon.d.ts +11 -0
- package/dist/bundle/dso-icon.js +9 -0
- package/dist/bundle/dso-icon.js.map +1 -0
- package/dist/bundle/dso-image-overlay.d.ts +11 -0
- package/dist/bundle/dso-image-overlay.js +9 -0
- package/dist/bundle/dso-image-overlay.js.map +1 -0
- package/dist/bundle/dso-info-button.d.ts +11 -0
- package/dist/bundle/dso-info-button.js +9 -0
- package/dist/bundle/dso-info-button.js.map +1 -0
- package/dist/bundle/dso-info.d.ts +11 -0
- package/dist/bundle/dso-info.js +9 -0
- package/dist/bundle/dso-info.js.map +1 -0
- package/dist/bundle/dso-input-range.d.ts +11 -0
- package/dist/bundle/dso-input-range.js +59 -0
- package/dist/bundle/dso-input-range.js.map +1 -0
- package/dist/bundle/dso-label.d.ts +11 -0
- package/dist/bundle/dso-label.js +9 -0
- package/dist/bundle/dso-label.js.map +1 -0
- package/dist/bundle/dso-legend-item.d.ts +11 -0
- package/dist/bundle/dso-legend-item.js +90 -0
- package/dist/bundle/dso-legend-item.js.map +1 -0
- package/dist/bundle/dso-list-button.d.ts +11 -0
- package/dist/bundle/dso-list-button.js +118 -0
- package/dist/bundle/dso-list-button.js.map +1 -0
- package/dist/bundle/dso-logo.d.ts +11 -0
- package/dist/bundle/dso-logo.js +64 -0
- package/dist/bundle/dso-logo.js.map +1 -0
- package/dist/bundle/dso-map-base-layers.d.ts +11 -0
- package/dist/bundle/dso-map-base-layers.js +101 -0
- package/dist/bundle/dso-map-base-layers.js.map +1 -0
- package/dist/bundle/dso-map-controls.d.ts +11 -0
- package/dist/bundle/dso-map-controls.js +138 -0
- package/dist/bundle/dso-map-controls.js.map +1 -0
- package/dist/bundle/dso-map-overlays.d.ts +11 -0
- package/dist/bundle/dso-map-overlays.js +102 -0
- package/dist/bundle/dso-map-overlays.js.map +1 -0
- package/dist/bundle/dso-mark-bar.d.ts +11 -0
- package/dist/bundle/dso-mark-bar.js +91 -0
- package/dist/bundle/dso-mark-bar.js.map +1 -0
- package/dist/bundle/dso-modal.d.ts +11 -0
- package/dist/bundle/dso-modal.js +120 -0
- package/dist/bundle/dso-modal.js.map +1 -0
- package/dist/bundle/dso-onboarding-tip.d.ts +11 -0
- package/dist/bundle/dso-onboarding-tip.js +1839 -0
- package/dist/bundle/dso-onboarding-tip.js.map +1 -0
- package/dist/bundle/dso-ozon-content.d.ts +11 -0
- package/dist/bundle/dso-ozon-content.js +9 -0
- package/dist/bundle/dso-ozon-content.js.map +1 -0
- package/dist/bundle/dso-pagination.d.ts +11 -0
- package/dist/bundle/dso-pagination.js +188 -0
- package/dist/bundle/dso-pagination.js.map +1 -0
- package/dist/bundle/dso-panel.d.ts +11 -0
- package/dist/bundle/dso-panel.js +9 -0
- package/dist/bundle/dso-panel.js.map +1 -0
- package/dist/bundle/dso-plekinfo-card.d.ts +11 -0
- package/dist/bundle/dso-plekinfo-card.js +88 -0
- package/dist/bundle/dso-plekinfo-card.js.map +1 -0
- package/dist/bundle/dso-progress-bar.d.ts +11 -0
- package/dist/bundle/dso-progress-bar.js +50 -0
- package/dist/bundle/dso-progress-bar.js.map +1 -0
- package/dist/bundle/dso-progress-indicator.d.ts +11 -0
- package/dist/bundle/dso-progress-indicator.js +9 -0
- package/dist/bundle/dso-progress-indicator.js.map +1 -0
- package/dist/bundle/dso-project-item.d.ts +11 -0
- package/dist/bundle/dso-project-item.js +56 -0
- package/dist/bundle/dso-project-item.js.map +1 -0
- package/dist/bundle/dso-renvooi.d.ts +11 -0
- package/dist/bundle/dso-renvooi.js +9 -0
- package/dist/bundle/dso-renvooi.js.map +1 -0
- package/dist/bundle/dso-responsive-element.d.ts +11 -0
- package/dist/bundle/dso-responsive-element.js +9 -0
- package/dist/bundle/dso-responsive-element.js.map +1 -0
- package/dist/bundle/dso-scrollable.d.ts +11 -0
- package/dist/bundle/dso-scrollable.js +9 -0
- package/dist/bundle/dso-scrollable.js.map +1 -0
- package/dist/bundle/dso-selectable.d.ts +11 -0
- package/dist/bundle/dso-selectable.js +9 -0
- package/dist/bundle/dso-selectable.js.map +1 -0
- package/dist/bundle/dso-skiplink.d.ts +11 -0
- package/dist/bundle/dso-skiplink.js +53 -0
- package/dist/bundle/dso-skiplink.js.map +1 -0
- package/dist/bundle/dso-slide-toggle.d.ts +11 -0
- package/dist/bundle/dso-slide-toggle.js +9 -0
- package/dist/bundle/dso-slide-toggle.js.map +1 -0
- package/dist/bundle/dso-survey-rating.d.ts +11 -0
- package/dist/bundle/dso-survey-rating.js +70 -0
- package/dist/bundle/dso-survey-rating.js.map +1 -0
- package/dist/bundle/dso-tab.d.ts +11 -0
- package/dist/bundle/dso-tab.js +70 -0
- package/dist/bundle/dso-tab.js.map +1 -0
- package/dist/bundle/dso-table.d.ts +11 -0
- package/dist/bundle/dso-table.js +9 -0
- package/dist/bundle/dso-table.js.map +1 -0
- package/dist/bundle/dso-tabs.d.ts +11 -0
- package/dist/bundle/dso-tabs.js +94 -0
- package/dist/bundle/dso-tabs.js.map +1 -0
- package/dist/bundle/dso-toggletip.d.ts +11 -0
- package/dist/bundle/dso-toggletip.js +9 -0
- package/dist/bundle/dso-toggletip.js.map +1 -0
- package/dist/bundle/dso-tooltip.d.ts +11 -0
- package/dist/bundle/dso-tooltip.js +9 -0
- package/dist/bundle/dso-tooltip.js.map +1 -0
- package/dist/bundle/dso-tree-view.d.ts +11 -0
- package/dist/bundle/dso-tree-view.js +237 -0
- package/dist/bundle/dso-tree-view.js.map +1 -0
- package/dist/bundle/dso-viewer-grid.d.ts +11 -0
- package/dist/bundle/dso-viewer-grid.js +351 -0
- package/dist/bundle/dso-viewer-grid.js.map +1 -0
- package/dist/bundle/dsot-document-component-demo.d.ts +11 -0
- package/dist/bundle/dsot-document-component-demo.js +1957 -0
- package/dist/bundle/dsot-document-component-demo.js.map +1 -0
- package/dist/bundle/index.d.ts +45 -0
- package/dist/bundle/index.js +143 -0
- package/dist/bundle/index.js.map +1 -0
- package/dist/bundle/p-0JGmXD8O.js +59 -0
- package/dist/bundle/p-0JGmXD8O.js.map +1 -0
- package/dist/bundle/p-BF0_OXTe.js +60 -0
- package/dist/bundle/p-BF0_OXTe.js.map +1 -0
- package/dist/bundle/p-BPLPqKUj.js +163 -0
- package/dist/bundle/p-BPLPqKUj.js.map +1 -0
- package/dist/bundle/p-B_kXuEcW.js +2178 -0
- package/dist/bundle/p-B_kXuEcW.js.map +1 -0
- package/dist/bundle/p-BacS1uCc.js +35 -0
- package/dist/bundle/p-BacS1uCc.js.map +1 -0
- package/dist/bundle/p-BdyXpl60.js +76 -0
- package/dist/bundle/p-BdyXpl60.js.map +1 -0
- package/dist/bundle/p-BocpUT46.js +992 -0
- package/dist/bundle/p-BocpUT46.js.map +1 -0
- package/dist/bundle/p-BtcZ9oZ6.js +115 -0
- package/dist/bundle/p-BtcZ9oZ6.js.map +1 -0
- package/dist/bundle/p-BxvZeNWe.js +126 -0
- package/dist/bundle/p-BxvZeNWe.js.map +1 -0
- package/dist/bundle/p-C1tscMvU.js +43 -0
- package/dist/bundle/p-C1tscMvU.js.map +1 -0
- package/dist/bundle/p-CZ2ipzNO.js +63 -0
- package/dist/bundle/p-CZ2ipzNO.js.map +1 -0
- package/dist/bundle/p-Cbba2ZRN.js +36 -0
- package/dist/bundle/p-Cbba2ZRN.js.map +1 -0
- package/dist/bundle/p-ChV9xqsO.js +6 -0
- package/dist/bundle/p-ChV9xqsO.js.map +1 -0
- package/dist/bundle/p-ChrHXjXh.js +80 -0
- package/dist/bundle/p-ChrHXjXh.js.map +1 -0
- package/dist/bundle/p-Cng7insW.js +145 -0
- package/dist/bundle/p-Cng7insW.js.map +1 -0
- package/dist/bundle/p-CodDyi2J.js +15 -0
- package/dist/bundle/p-CodDyi2J.js.map +1 -0
- package/dist/bundle/p-CsY83cJO.js +1801 -0
- package/dist/bundle/p-CsY83cJO.js.map +1 -0
- package/dist/bundle/p-CvGnEQcm.js +80 -0
- package/dist/bundle/p-CvGnEQcm.js.map +1 -0
- package/dist/bundle/p-D2nuXSd0.js +723 -0
- package/dist/bundle/p-D2nuXSd0.js.map +1 -0
- package/dist/bundle/p-D9Yjz_Sm.js +125 -0
- package/dist/bundle/p-D9Yjz_Sm.js.map +1 -0
- package/dist/bundle/p-DDDh2Izf.js +12 -0
- package/dist/bundle/p-DDDh2Izf.js.map +1 -0
- package/dist/bundle/p-DGWbWwct.js +121 -0
- package/dist/bundle/p-DGWbWwct.js.map +1 -0
- package/dist/bundle/p-DHO_Za64.js +1729 -0
- package/dist/bundle/p-DHO_Za64.js.map +1 -0
- package/dist/bundle/p-DPH021KD.js +14 -0
- package/dist/bundle/p-DPH021KD.js.map +1 -0
- package/dist/bundle/p-DSyv-znO.js +18 -0
- package/dist/bundle/p-DSyv-znO.js.map +1 -0
- package/dist/bundle/p-DWTXTDbr.js +253 -0
- package/dist/bundle/p-DWTXTDbr.js.map +1 -0
- package/dist/bundle/p-DacnxEpv.js +78 -0
- package/dist/bundle/p-DacnxEpv.js.map +1 -0
- package/dist/bundle/p-DcpG4jOU.js +99 -0
- package/dist/bundle/p-DcpG4jOU.js.map +1 -0
- package/dist/bundle/p-DrR9RuIM.js +83 -0
- package/dist/bundle/p-DrR9RuIM.js.map +1 -0
- package/dist/bundle/p-DvqO1i1s.js +1162 -0
- package/dist/bundle/p-DvqO1i1s.js.map +1 -0
- package/dist/bundle/p-Hgv-pDpy.js +13 -0
- package/dist/bundle/p-Hgv-pDpy.js.map +1 -0
- package/dist/bundle/p-Pk8qng7t.js +573 -0
- package/dist/bundle/p-Pk8qng7t.js.map +1 -0
- package/dist/bundle/p-WYm6cxra.js +64 -0
- package/dist/bundle/p-WYm6cxra.js.map +1 -0
- package/dist/bundle/p-dB3K6tfb.js +41 -0
- package/dist/bundle/p-dB3K6tfb.js.map +1 -0
- package/dist/bundle/p-kDtv6DeD.js +314 -0
- package/dist/bundle/p-kDtv6DeD.js.map +1 -0
- package/dist/bundle/p-pVO6m7lg.js +271 -0
- package/dist/bundle/p-pVO6m7lg.js.map +1 -0
- package/dist/bundle/p-xNnEBBZG.js +63 -0
- package/dist/bundle/p-xNnEBBZG.js.map +1 -0
- package/dist/cjs/dso-accordion-section.cjs.entry.js +3 -3
- package/dist/cjs/dso-accordion-section.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-accordion-section.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-alert_6.cjs.entry.js +3 -7
- package/dist/cjs/dso-alert_6.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-onboarding-tip.cjs.entry.js +24 -10
- package/dist/cjs/dso-onboarding-tip.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-onboarding-tip.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/components/accordion-section.js +3 -3
- package/dist/collection/components/accordion/components/accordion-section.js.map +1 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.css +21 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.js +28 -9
- package/dist/collection/components/onboarding-tip/onboarding-tip.js.map +1 -1
- package/dist/collection/components/table/table.css +2 -2
- package/dist/collection/components/table/table.js +3 -26
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/components/dso-accordion-section.js +3 -3
- package/dist/components/dso-accordion-section.js.map +1 -1
- package/dist/components/dso-onboarding-tip.js +26 -11
- package/dist/components/dso-onboarding-tip.js.map +1 -1
- package/dist/components/table.js +4 -8
- package/dist/components/table.js.map +1 -1
- package/dist/dso-toolkit/dso-accordion-section.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-onboarding-tip.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/{p-8084c884.entry.js → p-5fa008c6.entry.js} +2 -2
- package/dist/dso-toolkit/{p-8084c884.entry.js.map → p-5fa008c6.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-6a156238.entry.js → p-6f89da1c.entry.js} +2 -2
- package/dist/dso-toolkit/{p-6a156238.entry.js.map → p-6f89da1c.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-909118a3.entry.js +2 -0
- package/dist/dso-toolkit/p-909118a3.entry.js.map +1 -0
- package/dist/esm/dso-accordion-section.entry.js +3 -3
- package/dist/esm/dso-accordion-section.entry.js.map +1 -1
- package/dist/esm/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.js.map +1 -1
- package/dist/esm/dso-alert_6.entry.js +3 -7
- package/dist/esm/dso-alert_6.entry.js.map +1 -1
- package/dist/esm/dso-onboarding-tip.entry.js +24 -10
- package/dist/esm/dso-onboarding-tip.entry.js.map +1 -1
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/onboarding-tip/onboarding-tip.d.ts +1 -0
- package/dist/types/components/table/table.d.ts +1 -4
- package/dist/types/components.d.ts +0 -8
- package/package.json +3 -3
- package/dist/dso-toolkit/p-c0410277.entry.js +0 -2
- package/dist/dso-toolkit/p-c0410277.entry.js.map +0 -1
|
@@ -0,0 +1,773 @@
|
|
|
1
|
+
import { h, p as proxyCustomElement, H, e as createEvent, d as Host } from './p-DHO_Za64.js';
|
|
2
|
+
import { c as createIdentifier } from './p-DSyv-znO.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-D2nuXSd0.js';
|
|
4
|
+
|
|
5
|
+
const localization = {
|
|
6
|
+
buttonLabel: "Kies datum",
|
|
7
|
+
placeholder: "dd-mm-jjjj",
|
|
8
|
+
selectedDateMessage: "Geselecteerde datum is",
|
|
9
|
+
prevMonthLabel: "Vorige maand",
|
|
10
|
+
nextMonthLabel: "Volgende maand",
|
|
11
|
+
monthSelectLabel: "Maand",
|
|
12
|
+
yearSelectLabel: "Jaar",
|
|
13
|
+
closeLabel: "Sluiten",
|
|
14
|
+
keyboardInstruction: "Gebruik de pijltjestoetsen om een dag te kiezen",
|
|
15
|
+
calendarHeading: "Kies een datum",
|
|
16
|
+
dayNames: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
|
|
17
|
+
monthNames: [
|
|
18
|
+
"Januari",
|
|
19
|
+
"Februari",
|
|
20
|
+
"Maart",
|
|
21
|
+
"April",
|
|
22
|
+
"Mei",
|
|
23
|
+
"Juni",
|
|
24
|
+
"Juli",
|
|
25
|
+
"Augustus",
|
|
26
|
+
"September",
|
|
27
|
+
"Oktober",
|
|
28
|
+
"November",
|
|
29
|
+
"December",
|
|
30
|
+
],
|
|
31
|
+
monthNamesShort: ["Jan", "Feb", "Mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// eslint-disable-next-line @stencil-community/ban-exported-const-enums -- This enum is not part of public API
|
|
35
|
+
var DaysOfWeek;
|
|
36
|
+
(function (DaysOfWeek) {
|
|
37
|
+
DaysOfWeek[DaysOfWeek["Sunday"] = 0] = "Sunday";
|
|
38
|
+
DaysOfWeek[DaysOfWeek["Monday"] = 1] = "Monday";
|
|
39
|
+
DaysOfWeek[DaysOfWeek["Tuesday"] = 2] = "Tuesday";
|
|
40
|
+
DaysOfWeek[DaysOfWeek["Wednesday"] = 3] = "Wednesday";
|
|
41
|
+
DaysOfWeek[DaysOfWeek["Thursday"] = 4] = "Thursday";
|
|
42
|
+
DaysOfWeek[DaysOfWeek["Friday"] = 5] = "Friday";
|
|
43
|
+
DaysOfWeek[DaysOfWeek["Saturday"] = 6] = "Saturday";
|
|
44
|
+
})(DaysOfWeek || (DaysOfWeek = {}));
|
|
45
|
+
function createDate(year, month, day) {
|
|
46
|
+
const dayInt = parseInt(day, 10);
|
|
47
|
+
const monthInt = parseInt(month, 10);
|
|
48
|
+
const yearInt = parseInt(year, 10);
|
|
49
|
+
const isValid = Number.isInteger(yearInt) && // all parts should be integers
|
|
50
|
+
Number.isInteger(monthInt) &&
|
|
51
|
+
Number.isInteger(dayInt) &&
|
|
52
|
+
monthInt > 0 && // month must be 1-12
|
|
53
|
+
monthInt <= 12 &&
|
|
54
|
+
dayInt > 0 && // day must be 1-31
|
|
55
|
+
dayInt <= 31 &&
|
|
56
|
+
yearInt > 0;
|
|
57
|
+
if (isValid) {
|
|
58
|
+
return new Date(yearInt, monthInt - 1, dayInt);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @param value date string in Dutch format D-M-YYYY
|
|
63
|
+
*/
|
|
64
|
+
function parseDutchDate(value) {
|
|
65
|
+
if (!value) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const matches = value.split("-");
|
|
69
|
+
if (matches.length === 3 &&
|
|
70
|
+
typeof matches[0] === "string" &&
|
|
71
|
+
typeof matches[1] === "string" &&
|
|
72
|
+
typeof matches[2] === "string" &&
|
|
73
|
+
matches[2].length === 4) {
|
|
74
|
+
return createDate(matches[2], matches[1], matches[0]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* print date in format DD-MM-YYYY
|
|
79
|
+
* @param date
|
|
80
|
+
*/
|
|
81
|
+
function printDutchDate(date) {
|
|
82
|
+
if (!date) {
|
|
83
|
+
return "";
|
|
84
|
+
}
|
|
85
|
+
const d = date.getDate().toString(10).padStart(2, "0");
|
|
86
|
+
const m = (date.getMonth() + 1).toString(10).padStart(2, "0");
|
|
87
|
+
const y = date.getFullYear().toString(10).padStart(2, "0");
|
|
88
|
+
return `${d}-${m}-${y}`;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Compare if two dates are equal in terms of day, month, and year
|
|
92
|
+
*/
|
|
93
|
+
function isEqual(a, b) {
|
|
94
|
+
if (!a || !b) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
98
|
+
}
|
|
99
|
+
function addDays(date, days) {
|
|
100
|
+
const d = new Date(date);
|
|
101
|
+
d.setDate(d.getDate() + days);
|
|
102
|
+
return d;
|
|
103
|
+
}
|
|
104
|
+
function startOfWeek(date, firstDayOfWeek = DaysOfWeek.Monday) {
|
|
105
|
+
const d = new Date(date);
|
|
106
|
+
const day = d.getDay();
|
|
107
|
+
const diff = (day < firstDayOfWeek ? 7 : 0) + day - firstDayOfWeek;
|
|
108
|
+
d.setDate(d.getDate() - diff);
|
|
109
|
+
return d;
|
|
110
|
+
}
|
|
111
|
+
function endOfWeek(date, firstDayOfWeek = DaysOfWeek.Monday) {
|
|
112
|
+
const d = new Date(date);
|
|
113
|
+
const day = d.getDay();
|
|
114
|
+
const diff = (day < firstDayOfWeek ? -7 : 0) + 6 - (day - firstDayOfWeek);
|
|
115
|
+
d.setDate(d.getDate() + diff);
|
|
116
|
+
return d;
|
|
117
|
+
}
|
|
118
|
+
function startOfMonth(date) {
|
|
119
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
120
|
+
}
|
|
121
|
+
function endOfMonth(date) {
|
|
122
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
123
|
+
}
|
|
124
|
+
function setMonth(date, month) {
|
|
125
|
+
const d = new Date(date);
|
|
126
|
+
d.setMonth(month);
|
|
127
|
+
return d;
|
|
128
|
+
}
|
|
129
|
+
function setYear(date, year) {
|
|
130
|
+
const d = new Date(date);
|
|
131
|
+
d.setFullYear(year);
|
|
132
|
+
return d;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Check if date is within a min and max
|
|
136
|
+
*/
|
|
137
|
+
function inRange(date, min, max) {
|
|
138
|
+
return clamp(date, min, max) === date;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Ensures date is within range, returns min or max if out of bounds
|
|
142
|
+
*/
|
|
143
|
+
function clamp(date, min, max) {
|
|
144
|
+
const time = date.getTime();
|
|
145
|
+
if (min && min instanceof Date && time < min.getTime()) {
|
|
146
|
+
return min;
|
|
147
|
+
}
|
|
148
|
+
if (max && max instanceof Date && time > max.getTime()) {
|
|
149
|
+
return max;
|
|
150
|
+
}
|
|
151
|
+
return date;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* given start and end date, return an (inclusive) array of all dates in between
|
|
155
|
+
* @param start
|
|
156
|
+
* @param end
|
|
157
|
+
*/
|
|
158
|
+
function getDaysInRange(start, end) {
|
|
159
|
+
const days = [];
|
|
160
|
+
let current = start;
|
|
161
|
+
while (!isEqual(current, end)) {
|
|
162
|
+
days.push(current);
|
|
163
|
+
current = addDays(current, 1);
|
|
164
|
+
}
|
|
165
|
+
days.push(current);
|
|
166
|
+
return days;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* given a date, return an array of dates from a calendar perspective
|
|
170
|
+
* @param date
|
|
171
|
+
* @param firstDayOfWeek
|
|
172
|
+
*/
|
|
173
|
+
function getViewOfMonth(date, firstDayOfWeek = DaysOfWeek.Monday) {
|
|
174
|
+
const start = startOfWeek(startOfMonth(date), firstDayOfWeek);
|
|
175
|
+
const end = endOfWeek(endOfMonth(date), firstDayOfWeek);
|
|
176
|
+
return getDaysInRange(start, end);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const DatePickerLegacyDay = ({ focusedDay, today, day, onDaySelect, onKeyboardNavigation, focusedDayRef, inRange, }) => {
|
|
180
|
+
const isToday = isEqual(day, today);
|
|
181
|
+
const isFocused = isEqual(day, focusedDay);
|
|
182
|
+
const notCurrentMonth = day.getMonth() !== focusedDay.getMonth();
|
|
183
|
+
const isOutsideRange = !inRange;
|
|
184
|
+
function handleClick(e) {
|
|
185
|
+
onDaySelect(e, day);
|
|
186
|
+
}
|
|
187
|
+
return (h("button", { class: {
|
|
188
|
+
"dso-date__day": true,
|
|
189
|
+
"is-today": isToday,
|
|
190
|
+
}, tabIndex: isFocused ? 0 : -1, onClick: handleClick, onKeyDown: onKeyboardNavigation, disabled: isOutsideRange || notCurrentMonth, type: "button", ref: (el) => {
|
|
191
|
+
if (isFocused && el && focusedDayRef) {
|
|
192
|
+
focusedDayRef(el);
|
|
193
|
+
}
|
|
194
|
+
} },
|
|
195
|
+
h("span", { "aria-hidden": "true" }, day.getDate()),
|
|
196
|
+
h("span", { class: "dso-date__vhidden" }, printDutchDate(day))));
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
function chunk(array, chunkSize) {
|
|
200
|
+
const result = [];
|
|
201
|
+
for (let i = 0; i < array.length; i += chunkSize) {
|
|
202
|
+
result.push(array.slice(i, i + chunkSize));
|
|
203
|
+
}
|
|
204
|
+
return result;
|
|
205
|
+
}
|
|
206
|
+
function mapWithOffset(array, startingOffset, mapFn) {
|
|
207
|
+
return array.map((_, i) => {
|
|
208
|
+
const adjustedIndex = (i + startingOffset) % array.length;
|
|
209
|
+
const item = array[adjustedIndex];
|
|
210
|
+
if (!item) {
|
|
211
|
+
throw new Error("No item found");
|
|
212
|
+
}
|
|
213
|
+
return mapFn(item);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
const DatePickerLegacyMonth = ({ selectedDate, focusedDate, labelledById, localization, firstDayOfWeek, min, max, onDateSelect, onKeyboardNavigation, focusedDayRef, onMouseDown, onFocusIn, }) => {
|
|
217
|
+
const today = new Date();
|
|
218
|
+
const days = getViewOfMonth(focusedDate, firstDayOfWeek);
|
|
219
|
+
return (h("table", { class: "dso-date__table", role: "grid", "aria-labelledby": labelledById, onFocusin: onFocusIn, onMouseDown: onMouseDown },
|
|
220
|
+
h("thead", null,
|
|
221
|
+
h("tr", null, mapWithOffset(localization.dayNames, firstDayOfWeek, (dayName) => (h("th", { class: "dso-date__table-header", scope: "col" },
|
|
222
|
+
h("span", { "aria-hidden": "true" }, dayName.substr(0, 2)),
|
|
223
|
+
h("span", { class: "dso-date__vhidden" }, dayName)))))),
|
|
224
|
+
h("tbody", null, chunk(days, 7).map((week) => (h("tr", { class: "dso-date__row" }, week.map((day) => (h("td", { class: "dso-date__cell", role: "gridcell", "aria-selected": isEqual(day, selectedDate) ? "true" : undefined, "aria-current": isEqual(day, today) ? "date" : undefined },
|
|
225
|
+
h(DatePickerLegacyDay, { day: day, today: today, focusedDay: focusedDate, inRange: inRange(day, min, max), onDaySelect: onDateSelect, onKeyboardNavigation: onKeyboardNavigation, focusedDayRef: focusedDayRef }))))))))));
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
function monthRange(localization, selectedYear, minDate, maxDate) {
|
|
229
|
+
if (minDate && maxDate) {
|
|
230
|
+
const { minYear, minMonth } = { minYear: minDate.getFullYear(), minMonth: minDate.getMonth() };
|
|
231
|
+
const { maxYear, maxMonth } = { maxYear: maxDate.getFullYear(), maxMonth: maxDate.getMonth() };
|
|
232
|
+
return localization.monthNames.filter((_month, index) => {
|
|
233
|
+
if (minYear === selectedYear && maxYear === selectedYear) {
|
|
234
|
+
return index >= minMonth && index >= maxMonth;
|
|
235
|
+
}
|
|
236
|
+
if (minYear === selectedYear) {
|
|
237
|
+
return index >= minMonth;
|
|
238
|
+
}
|
|
239
|
+
if (maxYear === selectedYear) {
|
|
240
|
+
return index <= maxMonth;
|
|
241
|
+
}
|
|
242
|
+
return true;
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
if (minDate) {
|
|
246
|
+
const { minYear, minMonth } = { minYear: minDate.getFullYear(), minMonth: minDate.getMonth() };
|
|
247
|
+
return localization.monthNames.filter((_month, index) => minYear === selectedYear && index >= minMonth);
|
|
248
|
+
}
|
|
249
|
+
if (maxDate) {
|
|
250
|
+
const { maxYear, maxMonth } = { maxYear: maxDate.getFullYear(), maxMonth: maxDate.getMonth() };
|
|
251
|
+
return localization.monthNames.filter((_month, index) => maxYear === selectedYear && index <= maxMonth);
|
|
252
|
+
}
|
|
253
|
+
return localization.monthNames;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function range(from, to) {
|
|
257
|
+
const result = [];
|
|
258
|
+
for (let i = from; i <= to; i++) {
|
|
259
|
+
result.push(i);
|
|
260
|
+
}
|
|
261
|
+
return result;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
const datePickerLegacyCss = ".sc-dso-date-picker-legacy-h{display:block}[invalid].sc-dso-date-picker-legacy-h:not([invalid=false]) .dso-date__input.sc-dso-date-picker-legacy{border-color:#ce3f51}.dso-date.sc-dso-date-picker-legacy *.sc-dso-date-picker-legacy,.dso-date.sc-dso-date-picker-legacy *.sc-dso-date-picker-legacy::before,.dso-date.sc-dso-date-picker-legacy *.sc-dso-date-picker-legacy::after{box-sizing:border-box}.dso-date.sc-dso-date-picker-legacy{box-sizing:border-box;color:#191919;display:block;font-family:\"Asap\", sans-serif;margin:0;position:relative;text-align:start;inline-size:100%}.dso-date.sc-dso-date-picker-legacy:not(.dso-visible) .dso-date__dialog.sc-dso-date-picker-legacy{display:none}.dso-date__input.sc-dso-date-picker-legacy{display:block;inline-size:100%;block-size:40px;padding-block:6px;padding-inline:14px;font-size:1rem;line-height:1.5;color:#191919;background-color:#fff;background-image:none;border:1px solid #275937;border-radius:4px;transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s}.dso-date__input.sc-dso-date-picker-legacy::-moz-placeholder{color:#666;opacity:1}.dso-date__input.sc-dso-date-picker-legacy:-ms-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker-legacy::-webkit-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker-legacy::-ms-expand{background-color:transparent;border:0}.dso-date__input.sc-dso-date-picker-legacy:focus{border-color:#275937;outline:0;box-shadow:inset 0 0 0 1px #275937}.dso-date__input[disabled].sc-dso-date-picker-legacy,.dso-date__input[readonly].sc-dso-date-picker-legacy,fieldset[disabled].sc-dso-date-picker-legacy .dso-date__input.sc-dso-date-picker-legacy{background-color:#fff;opacity:1}.dso-date__input[disabled].sc-dso-date-picker-legacy,fieldset[disabled].sc-dso-date-picker-legacy .dso-date__input.sc-dso-date-picker-legacy{cursor:default}.dso-date__input[disabled].sc-dso-date-picker-legacy{border-color:#e5e5e5;color:#999}.dso-date__input[readonly].sc-dso-date-picker-legacy{border-width:1px}.dso-date__input[type=text].sc-dso-date-picker-legacy{line-height:40px}.dso-date__input[size].sc-dso-date-picker-legacy{inline-size:auto}.dso-date__toggle.sc-dso-date-picker-legacy{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;border-radius:0;border-end-end-radius:4px;border-start-end-radius:4px;color:#39870c;cursor:pointer;display:flex;block-size:38px;justify-content:center;padding:0;position:absolute;inset-inline-end:0;transform:translateY(-50%);inset-block-start:50%;user-select:none;inline-size:38px;z-index:101}.dso-date__toggle.sc-dso-date-picker-legacy:disabled{color:#afcf9d;cursor:default}.dso-date__dialog.sc-dso-date-picker-legacy{border-width:1px;display:flex;inset-inline-end:0;min-inline-size:320px;opacity:0;position:absolute;inset-block-start:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;will-change:transform, opacity, visibility;z-index:210}@media (max-width: 35.9375em){.dso-date__dialog.sc-dso-date-picker-legacy{background:rgba(25, 25, 25, 0.5);inset-block-end:0;position:fixed;inset-inline-start:0;inset-inline-end:0;inset-block-start:0;transform:translateZ(0);transform-origin:bottom center}}.dso-date__dialog.is-left.sc-dso-date-picker-legacy{inset-inline-start:-11px;inset-inline-end:auto;inline-size:auto}.dso-date__dialog.is-active.sc-dso-date-picker-legacy{opacity:1;transform:scale(1.0001) translateZ(0) translateY(0);visibility:visible}.dso-date__dialog-content.sc-dso-date-picker-legacy{background:#fff;border:1px solid rgba(0, 0, 0, 0.1);border-radius:4px;box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.4);margin-inline-start:auto;margin-inline-end:-1px;margin-block-start:8px;max-inline-size:310px;min-inline-size:290px;padding:16px;position:relative;transform:none;inline-size:100%;z-index:210}@media (max-width: 35.9375em){.dso-date__dialog-content.sc-dso-date-picker-legacy{border:0;border-radius:0;border-start-start-radius:4px;border-start-end-radius:4px;inset-block-end:0;inset-inline-start:0;margin:0;max-inline-size:none;min-block-size:26em;opacity:0;padding-block:0 20px;padding-inline:8%;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active.sc-dso-date-picker-legacy .dso-date__dialog-content.sc-dso-date-picker-legacy{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.dso-date__table.sc-dso-date-picker-legacy{border-collapse:collapse;border-spacing:0;color:#191919;font-size:1rem;font-weight:400;line-height:1.25;min-inline-size:280px;table-layout:fixed;text-align:center;inline-size:100%}.dso-date__table-header.sc-dso-date-picker-legacy{font-size:0.875em;font-weight:600;block-size:36px;line-height:36px;text-align:center;text-decoration:none;text-transform:uppercase}.dso-date__cell.sc-dso-date-picker-legacy{block-size:40px;padding:1px;text-align:center;inline-size:40px}.dso-date__day.sc-dso-date-picker-legacy{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;box-shadow:0 0 0 1px transparent;color:#191919;cursor:pointer;display:inline-block;font-family:\"Asap\", sans-serif;font-variant-numeric:tabular-nums;font-weight:400;block-size:38px;line-height:0;padding:0;position:relative;text-align:center;vertical-align:middle;inline-size:38px;z-index:100}.dso-date__day.is-today.sc-dso-date-picker-legacy{background:transparent;block-size:36px;box-shadow:0 0 0 1px #39870c;inline-size:36px}.dso-date__day.sc-dso-date-picker-legacy:hover,.dso-date__day.sc-dso-date-picker-legacy:active{background:#39870c;color:#fff}.dso-date__day.sc-dso-date-picker-legacy:focus{background:transparent;box-shadow:0 0 0 2px #275937;color:#191919;block-size:34px;outline:0;inline-size:34px}[aria-selected=true].sc-dso-date-picker-legacy .dso-date__day.sc-dso-date-picker-legacy{background:#39870c;color:#fff}[aria-selected=true].sc-dso-date-picker-legacy .dso-date__day.sc-dso-date-picker-legacy:focus{background:transparent}[aria-selected=true].sc-dso-date-picker-legacy .dso-date__day.sc-dso-date-picker-legacy:focus span[aria-hidden=true].sc-dso-date-picker-legacy{background:#39870c;border:1px solid #fff;line-height:32px}.dso-date__day.sc-dso-date-picker-legacy:disabled{background:#fff;color:#ccc;cursor:default}.dso-date__day.sc-dso-date-picker-legacy span[aria-hidden=true].sc-dso-date-picker-legacy{border-radius:50%;display:inline-block;block-size:34px;line-height:34px;inline-size:34px}.dso-date__header.sc-dso-date-picker-legacy{align-items:center;display:flex;justify-content:space-between;margin-block-end:16px;inline-size:100%}.dso-date__header.sc-dso-date-picker-legacy span.sc-dso-date-picker-legacy{font-size:0.875rem}.dso-date__nav.sc-dso-date-picker-legacy{white-space:nowrap}.dso-date__prev.sc-dso-date-picker-legacy,.dso-date__next.sc-dso-date-picker-legacy{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:transparent;border:1px solid #39870c;border-radius:4px;box-sizing:border-box;color:#39870c;cursor:pointer;display:inline-flex;font-size:1em;block-size:32px;justify-content:center;margin-inline-start:8px;padding:0;inline-size:32px}@media (max-width: 35.9375em){.dso-date__prev.sc-dso-date-picker-legacy,.dso-date__next.sc-dso-date-picker-legacy{block-size:40px;inline-size:40px}}.dso-date__prev.sc-dso-date-picker-legacy:hover,.dso-date__prev.sc-dso-date-picker-legacy:active,.dso-date__next.sc-dso-date-picker-legacy:hover,.dso-date__next.sc-dso-date-picker-legacy:active{background-color:#39870c;color:#fff}.dso-date__prev.sc-dso-date-picker-legacy:focus,.dso-date__next.sc-dso-date-picker-legacy:focus{background:transparent;color:#39870c}.dso-date__prev.sc-dso-date-picker-legacy:disabled,.dso-date__prev.sc-dso-date-picker-legacy:disabled:hover,.dso-date__next.sc-dso-date-picker-legacy:disabled,.dso-date__next.sc-dso-date-picker-legacy:disabled:hover{background-color:#fff;border-color:#afcf9d;color:#afcf9d;opacity:1}.dso-date__prev.sc-dso-date-picker-legacy svg.sc-dso-date-picker-legacy,.dso-date__next.sc-dso-date-picker-legacy svg.sc-dso-date-picker-legacy{margin-block:0;margin-inline:auto}.dso-date__select.sc-dso-date-picker-legacy{display:inline-flex;block-size:28px;line-height:28px;position:relative}.dso-date__select.sc-dso-date-picker-legacy span.sc-dso-date-picker-legacy{margin-inline-end:4px}.dso-date__select.sc-dso-date-picker-legacy select.sc-dso-date-picker-legacy{color:#275937;cursor:pointer;font-size:1rem;block-size:100%;inset-inline-start:0;opacity:0;position:absolute;inset-block-start:0;inline-size:100%;z-index:101}.dso-date__select.sc-dso-date-picker-legacy select.sc-dso-date-picker-legacy:focus+.dso-date__select-label.sc-dso-date-picker-legacy{box-shadow:0 0 0 2px #275937}.dso-date__select.sc-dso-date-picker-legacy select.sc-dso-date-picker-legacy:disabled{color:#afcf9d}.dso-date__select-label.sc-dso-date-picker-legacy{align-items:center;border-radius:4px;color:#39870c;display:flex;padding-block:0;padding-inline:8px 4px;pointer-events:none;position:relative;inline-size:100%;z-index:100}.dso-date__select-label.sc-dso-date-picker-legacy span.sc-dso-date-picker-legacy{font-size:1.25rem;font-weight:600;line-height:1.25}.dso-date__select-label.sc-dso-date-picker-legacy svg.sc-dso-date-picker-legacy{inline-size:16px;block-size:16px}.dso-date__mobile.sc-dso-date-picker-legacy{align-items:center;border-block-end:1px solid rgba(0, 0, 0, 0.12);display:flex;font-size:1em;justify-content:space-between;margin-block-end:20px;margin-inline-start:-10%;overflow:hidden;padding-block:12px;padding-inline:20px;position:relative;text-overflow:ellipsis;white-space:nowrap;inline-size:120%}@media (min-width: 36em){.dso-date__mobile.sc-dso-date-picker-legacy{border:0;margin:0;overflow:visible;padding:0;position:absolute;inset-inline-end:-16px;inset-block-start:-16px;inline-size:auto}}.dso-date__mobile-heading.sc-dso-date-picker-legacy{display:inline-block;font-weight:600;max-inline-size:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.dso-date__mobile-heading.sc-dso-date-picker-legacy{display:none}}.dso-date__close.sc-dso-date-picker-legacy{-webkit-appearance:none;align-items:center;appearance:none;background-color:#fff;border:0;border-radius:50%;color:#39870c;cursor:pointer;display:flex;font-size:1em;block-size:32px;justify-content:center;margin-inline-end:-4px;padding:0;inline-size:32px}@media (min-width: 36em){.dso-date__close.sc-dso-date-picker-legacy{margin-inline-end:0;opacity:0}}.dso-date__close.sc-dso-date-picker-legacy:focus{box-shadow:0 0 0 2px #275937;outline:none}@media (min-width: 36em){.dso-date__close.sc-dso-date-picker-legacy:focus{opacity:1}}.dso-date__vhidden.sc-dso-date-picker-legacy{border:0;clip:rect(1px, 1px, 1px, 1px);block-size:1px;overflow:hidden;padding:0;position:absolute;inset-block-start:0;inline-size:1px}";
|
|
265
|
+
|
|
266
|
+
const keyCode = {
|
|
267
|
+
TAB: 9,
|
|
268
|
+
ESC: 27,
|
|
269
|
+
PAGE_UP: 33,
|
|
270
|
+
PAGE_DOWN: 34,
|
|
271
|
+
END: 35,
|
|
272
|
+
HOME: 36,
|
|
273
|
+
LEFT: 37,
|
|
274
|
+
UP: 38,
|
|
275
|
+
RIGHT: 39,
|
|
276
|
+
DOWN: 40,
|
|
277
|
+
};
|
|
278
|
+
const DISALLOWED_CHARACTERS = /[^0-9-]+/g;
|
|
279
|
+
const TRANSITION_MS = 300;
|
|
280
|
+
function cleanValue(input, regex) {
|
|
281
|
+
const value = input.value;
|
|
282
|
+
const cursor = input.selectionStart;
|
|
283
|
+
if (!cursor) {
|
|
284
|
+
return value;
|
|
285
|
+
}
|
|
286
|
+
const beforeCursor = value.slice(0, cursor);
|
|
287
|
+
const afterCursor = value.slice(cursor, value.length);
|
|
288
|
+
const filteredBeforeCursor = beforeCursor.replace(regex, "");
|
|
289
|
+
const filterAfterCursor = afterCursor.replace(regex, "");
|
|
290
|
+
const newValue = filteredBeforeCursor + filterAfterCursor;
|
|
291
|
+
const newCursor = filteredBeforeCursor.length;
|
|
292
|
+
input.value = newValue;
|
|
293
|
+
input.selectionStart = input.selectionEnd = newCursor;
|
|
294
|
+
return newValue;
|
|
295
|
+
}
|
|
296
|
+
const DsoDatePickerLegacy$1 = /*@__PURE__*/ proxyCustomElement(class DsoDatePickerLegacy extends H {
|
|
297
|
+
constructor() {
|
|
298
|
+
super();
|
|
299
|
+
this.__registerHost();
|
|
300
|
+
this.dsoDateChange = createEvent(this, "dsoDateChange", 7);
|
|
301
|
+
this.dsoBlur = createEvent(this, "dsoBlur", 7);
|
|
302
|
+
this.dsoKeyUp = createEvent(this, "dsoKeyUp", 7);
|
|
303
|
+
this.dsoKeyDown = createEvent(this, "dsoKeyDown", 7);
|
|
304
|
+
this.dsoFocus = createEvent(this, "dsoFocus", 7);
|
|
305
|
+
/**
|
|
306
|
+
* Own Properties
|
|
307
|
+
*/
|
|
308
|
+
this.monthSelectId = createIdentifier("DsoDateMonth");
|
|
309
|
+
this.yearSelectId = createIdentifier("DsoDateYear");
|
|
310
|
+
this.dialogLabelId = createIdentifier("DsoDateLabel");
|
|
311
|
+
this.localization = localization;
|
|
312
|
+
this.firstDayOfWeek = DaysOfWeek.Monday;
|
|
313
|
+
/**
|
|
314
|
+
* State() variables
|
|
315
|
+
*/
|
|
316
|
+
this.activeFocus = false;
|
|
317
|
+
this.focusedDay = new Date();
|
|
318
|
+
this.open = false;
|
|
319
|
+
this.visible = false;
|
|
320
|
+
/**
|
|
321
|
+
* Public Property API
|
|
322
|
+
*/
|
|
323
|
+
/**
|
|
324
|
+
* Name of the date picker input.
|
|
325
|
+
*/
|
|
326
|
+
this.name = "date";
|
|
327
|
+
/**
|
|
328
|
+
* Makes the date picker input component disabled. This prevents users from being able to
|
|
329
|
+
* interact with the input, and conveys its inactive state to assistive technologies.
|
|
330
|
+
*/
|
|
331
|
+
this.disabled = false;
|
|
332
|
+
/**
|
|
333
|
+
* Defines a specific role attribute for the date picker input.
|
|
334
|
+
*/
|
|
335
|
+
this.role = null;
|
|
336
|
+
/**
|
|
337
|
+
* Forces the opening direction of the calendar modal to be always left or right.
|
|
338
|
+
* This setting can be useful when the input is smaller than the opening date picker
|
|
339
|
+
* would be as by default the picker always opens towards right.
|
|
340
|
+
*/
|
|
341
|
+
this.direction = "right";
|
|
342
|
+
/**
|
|
343
|
+
* Should the input be marked as required?
|
|
344
|
+
*/
|
|
345
|
+
this.required = false;
|
|
346
|
+
/**
|
|
347
|
+
* Should the input be focused on load?
|
|
348
|
+
*/
|
|
349
|
+
this.dsoAutofocus = false;
|
|
350
|
+
/**
|
|
351
|
+
* Date value. Must be in Dutch date format: DD-MM-YYYY.
|
|
352
|
+
*/
|
|
353
|
+
this.value = "";
|
|
354
|
+
/**
|
|
355
|
+
* Local methods.
|
|
356
|
+
*/
|
|
357
|
+
this.enableActiveFocus = () => {
|
|
358
|
+
this.activeFocus = true;
|
|
359
|
+
};
|
|
360
|
+
this.disableActiveFocus = () => {
|
|
361
|
+
this.activeFocus = false;
|
|
362
|
+
};
|
|
363
|
+
this.toggleOpen = (e) => {
|
|
364
|
+
e.preventDefault();
|
|
365
|
+
if (this.open) {
|
|
366
|
+
this.hide(false);
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
this.show();
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
this.handleEscKey = (event) => {
|
|
373
|
+
if (event.keyCode === keyCode.ESC) {
|
|
374
|
+
this.hide();
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
this.handleBlur = (event) => {
|
|
378
|
+
event.stopPropagation();
|
|
379
|
+
this.dsoBlur.emit({
|
|
380
|
+
component: "dso-date-picker-legacy",
|
|
381
|
+
});
|
|
382
|
+
};
|
|
383
|
+
this.handleKeyUp = (event) => {
|
|
384
|
+
event.stopPropagation();
|
|
385
|
+
this.dsoKeyUp.emit({
|
|
386
|
+
component: "dso-date-picker-legacy",
|
|
387
|
+
originalEvent: event,
|
|
388
|
+
});
|
|
389
|
+
};
|
|
390
|
+
this.handleKeyDown = (event) => {
|
|
391
|
+
event.stopPropagation();
|
|
392
|
+
this.dsoKeyDown.emit({
|
|
393
|
+
component: "dso-date-picker-legacy",
|
|
394
|
+
originalEvent: event,
|
|
395
|
+
});
|
|
396
|
+
};
|
|
397
|
+
this.handleFocus = (event) => {
|
|
398
|
+
event.stopPropagation();
|
|
399
|
+
this.dsoFocus.emit({
|
|
400
|
+
component: "dso-date-picker-legacy",
|
|
401
|
+
});
|
|
402
|
+
};
|
|
403
|
+
this.handleTouchStart = (event) => {
|
|
404
|
+
const touch = event.changedTouches[0];
|
|
405
|
+
if (!touch) {
|
|
406
|
+
throw new Error("No touch found");
|
|
407
|
+
}
|
|
408
|
+
this.initialTouchX = touch.pageX;
|
|
409
|
+
this.initialTouchY = touch.pageY;
|
|
410
|
+
};
|
|
411
|
+
this.handleTouchMove = (event) => {
|
|
412
|
+
event.preventDefault();
|
|
413
|
+
};
|
|
414
|
+
this.handleTouchEnd = (event) => {
|
|
415
|
+
var _a, _b;
|
|
416
|
+
const touch = event.changedTouches[0];
|
|
417
|
+
if (!touch) {
|
|
418
|
+
throw new Error("No touch found");
|
|
419
|
+
}
|
|
420
|
+
const distX = touch.pageX - ((_a = this.initialTouchX) !== null && _a !== void 0 ? _a : 0); // get horizontal dist traveled
|
|
421
|
+
const distY = touch.pageY - ((_b = this.initialTouchY) !== null && _b !== void 0 ? _b : 0); // get vertical dist traveled
|
|
422
|
+
const threshold = 70;
|
|
423
|
+
const isHorizontalSwipe = Math.abs(distX) >= threshold && Math.abs(distY) <= threshold;
|
|
424
|
+
const isDownwardsSwipe = Math.abs(distY) >= threshold && Math.abs(distX) <= threshold && distY > 0;
|
|
425
|
+
if (isHorizontalSwipe) {
|
|
426
|
+
this.addMonths(distX < 0 ? 1 : -1);
|
|
427
|
+
}
|
|
428
|
+
else if (isDownwardsSwipe) {
|
|
429
|
+
this.hide(false);
|
|
430
|
+
event.preventDefault();
|
|
431
|
+
}
|
|
432
|
+
this.initialTouchY = undefined;
|
|
433
|
+
this.initialTouchX = undefined;
|
|
434
|
+
};
|
|
435
|
+
this.handleNextMonthClick = (event) => {
|
|
436
|
+
event.preventDefault();
|
|
437
|
+
this.addMonths(1);
|
|
438
|
+
};
|
|
439
|
+
this.handlePreviousMonthClick = (event) => {
|
|
440
|
+
event.preventDefault();
|
|
441
|
+
this.addMonths(-1);
|
|
442
|
+
};
|
|
443
|
+
this.handleFirstFocusableKeydown = (event) => {
|
|
444
|
+
var _a;
|
|
445
|
+
// this ensures focus is trapped inside the dialog
|
|
446
|
+
if (event.keyCode === keyCode.TAB && event.shiftKey) {
|
|
447
|
+
(_a = this.focusedDayNode) === null || _a === void 0 ? void 0 : _a.focus();
|
|
448
|
+
event.preventDefault();
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
this.handleKeyboardNavigation = (event) => {
|
|
452
|
+
var _a;
|
|
453
|
+
// handle tab separately, since it needs to be treated
|
|
454
|
+
// differently to other keyboard interactions
|
|
455
|
+
if (event.keyCode === keyCode.TAB && !event.shiftKey) {
|
|
456
|
+
event.preventDefault();
|
|
457
|
+
(_a = this.firstFocusableElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
let handled = true;
|
|
461
|
+
switch (event.keyCode) {
|
|
462
|
+
case keyCode.RIGHT:
|
|
463
|
+
this.addDays(1);
|
|
464
|
+
break;
|
|
465
|
+
case keyCode.LEFT:
|
|
466
|
+
this.addDays(-1);
|
|
467
|
+
break;
|
|
468
|
+
case keyCode.DOWN:
|
|
469
|
+
this.addDays(7);
|
|
470
|
+
break;
|
|
471
|
+
case keyCode.UP:
|
|
472
|
+
this.addDays(-7);
|
|
473
|
+
break;
|
|
474
|
+
case keyCode.PAGE_UP:
|
|
475
|
+
if (event.shiftKey) {
|
|
476
|
+
this.addYears(-1);
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
this.addMonths(-1);
|
|
480
|
+
}
|
|
481
|
+
break;
|
|
482
|
+
case keyCode.PAGE_DOWN:
|
|
483
|
+
if (event.shiftKey) {
|
|
484
|
+
this.addYears(1);
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
this.addMonths(1);
|
|
488
|
+
}
|
|
489
|
+
break;
|
|
490
|
+
case keyCode.HOME:
|
|
491
|
+
this.startOfWeek();
|
|
492
|
+
break;
|
|
493
|
+
case keyCode.END:
|
|
494
|
+
this.endOfWeek();
|
|
495
|
+
break;
|
|
496
|
+
default:
|
|
497
|
+
handled = false;
|
|
498
|
+
}
|
|
499
|
+
if (handled) {
|
|
500
|
+
event.preventDefault();
|
|
501
|
+
this.enableActiveFocus();
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
this.handleDaySelect = (_event, day) => {
|
|
505
|
+
if (!inRange(day, parseDutchDate(this.min), parseDutchDate(this.max))) {
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
if (day.getMonth() === this.focusedDay.getMonth()) {
|
|
509
|
+
this.setValue(day);
|
|
510
|
+
this.hide();
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
this.setFocusedDay(day);
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
this.handleMonthSelect = (e) => {
|
|
517
|
+
// Todo
|
|
518
|
+
if (e.target instanceof HTMLSelectElement) {
|
|
519
|
+
this.setMonth(parseInt(e.target.value, 10));
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
this.handleYearSelect = (e) => {
|
|
523
|
+
if (e.target instanceof HTMLSelectElement) {
|
|
524
|
+
this.setYear(parseInt(e.target.value, 10));
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
this.handleInputChange = (e) => {
|
|
528
|
+
const target = e.target;
|
|
529
|
+
const cleanedValue = cleanValue(target, DISALLOWED_CHARACTERS);
|
|
530
|
+
this.setValue(cleanedValue);
|
|
531
|
+
};
|
|
532
|
+
this.prepareEvent = (value) => {
|
|
533
|
+
const event = {
|
|
534
|
+
component: "dso-date-picker-legacy",
|
|
535
|
+
value: "",
|
|
536
|
+
valueAsDate: undefined,
|
|
537
|
+
};
|
|
538
|
+
if (value instanceof Date) {
|
|
539
|
+
event.valueAsDate = value;
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
event.value = value;
|
|
543
|
+
event.valueAsDate = parseDutchDate(value);
|
|
544
|
+
}
|
|
545
|
+
if (event.valueAsDate) {
|
|
546
|
+
event.value = printDutchDate(event.valueAsDate);
|
|
547
|
+
}
|
|
548
|
+
if (!event.valueAsDate && this.required) {
|
|
549
|
+
event.error = "required";
|
|
550
|
+
}
|
|
551
|
+
if (event.value && !event.valueAsDate) {
|
|
552
|
+
event.error = "invalid";
|
|
553
|
+
}
|
|
554
|
+
if (event.valueAsDate && (this.min || this.max)) {
|
|
555
|
+
const min = parseDutchDate(this.min);
|
|
556
|
+
const max = parseDutchDate(this.max);
|
|
557
|
+
const clampValue = clamp(event.valueAsDate, min, max);
|
|
558
|
+
if (clampValue !== event.valueAsDate && clampValue === min) {
|
|
559
|
+
event.valueAsDate = undefined;
|
|
560
|
+
event.error = "min-range";
|
|
561
|
+
}
|
|
562
|
+
else if (clampValue !== event.valueAsDate && clampValue === max) {
|
|
563
|
+
event.valueAsDate = undefined;
|
|
564
|
+
event.error = "max-range";
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return event;
|
|
568
|
+
};
|
|
569
|
+
this.processFocusedDayNode = (element) => {
|
|
570
|
+
this.focusedDayNode = element;
|
|
571
|
+
if (this.activeFocus && this.open) {
|
|
572
|
+
setTimeout(() => element.focus(), 0);
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Component event handling.
|
|
578
|
+
*/
|
|
579
|
+
handleDocumentClick(e) {
|
|
580
|
+
if (!this.open) {
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
const path = e.composedPath();
|
|
584
|
+
for (const target of path) {
|
|
585
|
+
if (target instanceof Node && this.element.contains(target)) {
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
this.hide(false);
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Sets focus on the date picker's input. Use this method instead of the global `focus()`.
|
|
593
|
+
*/
|
|
594
|
+
async setFocus() {
|
|
595
|
+
var _a;
|
|
596
|
+
return (_a = this.datePickerLegacyInput) === null || _a === void 0 ? void 0 : _a.focus();
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Public methods API
|
|
600
|
+
*/
|
|
601
|
+
/**
|
|
602
|
+
* Show the calendar modal, moving focus to the calendar inside.
|
|
603
|
+
*/
|
|
604
|
+
async show() {
|
|
605
|
+
if (typeof this.hideTimeoutId !== "undefined") {
|
|
606
|
+
clearTimeout(this.hideTimeoutId);
|
|
607
|
+
}
|
|
608
|
+
this.visible = true;
|
|
609
|
+
setTimeout(() => {
|
|
610
|
+
this.open = true;
|
|
611
|
+
this.setFocusedDay(parseDutchDate(this.value) || new Date());
|
|
612
|
+
if (typeof this.focusTimeoutId !== "undefined") {
|
|
613
|
+
clearTimeout(this.focusTimeoutId);
|
|
614
|
+
}
|
|
615
|
+
this.focusTimeoutId = setTimeout(() => { var _a; return (_a = this.monthSelectNode) === null || _a === void 0 ? void 0 : _a.focus(); }, TRANSITION_MS);
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Hide the calendar modal. Set `moveFocusToButton` to false to prevent focus
|
|
620
|
+
* returning to the date picker's button. Default is true.
|
|
621
|
+
*/
|
|
622
|
+
async hide(moveFocusToButton = true) {
|
|
623
|
+
this.open = false;
|
|
624
|
+
// in cases where calendar is quickly shown and hidden
|
|
625
|
+
// we should avoid moving focus to the button
|
|
626
|
+
if (typeof this.focusTimeoutId !== "undefined") {
|
|
627
|
+
clearTimeout(this.focusTimeoutId);
|
|
628
|
+
}
|
|
629
|
+
this.hideTimeoutId = setTimeout(() => {
|
|
630
|
+
if (moveFocusToButton && this.datePickerLegacyButton) {
|
|
631
|
+
this.datePickerLegacyButton.focus();
|
|
632
|
+
}
|
|
633
|
+
this.visible = false;
|
|
634
|
+
}, TRANSITION_MS + 200);
|
|
635
|
+
}
|
|
636
|
+
addDays(days) {
|
|
637
|
+
this.setFocusedDay(addDays(this.focusedDay, days));
|
|
638
|
+
}
|
|
639
|
+
addMonths(months) {
|
|
640
|
+
this.setMonth(this.focusedDay.getMonth() + months);
|
|
641
|
+
}
|
|
642
|
+
addYears(years) {
|
|
643
|
+
this.setYear(this.focusedDay.getFullYear() + years);
|
|
644
|
+
}
|
|
645
|
+
startOfWeek() {
|
|
646
|
+
this.setFocusedDay(startOfWeek(this.focusedDay, this.firstDayOfWeek));
|
|
647
|
+
}
|
|
648
|
+
endOfWeek() {
|
|
649
|
+
this.setFocusedDay(endOfWeek(this.focusedDay, this.firstDayOfWeek));
|
|
650
|
+
}
|
|
651
|
+
setMonth(month) {
|
|
652
|
+
const min = setMonth(startOfMonth(this.focusedDay), month);
|
|
653
|
+
const max = endOfMonth(min);
|
|
654
|
+
const date = setMonth(this.focusedDay, month);
|
|
655
|
+
this.setFocusedDay(clamp(date, min, max));
|
|
656
|
+
}
|
|
657
|
+
setYear(year) {
|
|
658
|
+
const min = setYear(startOfMonth(this.focusedDay), year);
|
|
659
|
+
const max = endOfMonth(min);
|
|
660
|
+
const date = setYear(this.focusedDay, year);
|
|
661
|
+
this.setFocusedDay(clamp(date, min, max));
|
|
662
|
+
}
|
|
663
|
+
setFocusedDay(day) {
|
|
664
|
+
this.focusedDay = clamp(day, parseDutchDate(this.min), parseDutchDate(this.max));
|
|
665
|
+
}
|
|
666
|
+
setValue(value) {
|
|
667
|
+
const event = this.prepareEvent(value);
|
|
668
|
+
this.value = typeof value === "string" ? value : event.value;
|
|
669
|
+
if (this.value !== this.previousValue) {
|
|
670
|
+
this.dsoDateChange.emit(event);
|
|
671
|
+
this.previousValue = this.value;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
componentWillLoad() {
|
|
675
|
+
const minDate = parseDutchDate(this.min);
|
|
676
|
+
const maxDate = parseDutchDate(this.max);
|
|
677
|
+
if (minDate && minDate > this.focusedDay) {
|
|
678
|
+
this.focusedDay = minDate;
|
|
679
|
+
}
|
|
680
|
+
if (maxDate && maxDate < this.focusedDay) {
|
|
681
|
+
this.focusedDay = maxDate;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
componentDidLoad() {
|
|
685
|
+
const valueAsDate = parseDutchDate(this.value);
|
|
686
|
+
if (valueAsDate) {
|
|
687
|
+
this.previousValue = this.value = printDutchDate(valueAsDate);
|
|
688
|
+
}
|
|
689
|
+
if (this.dsoAutofocus) {
|
|
690
|
+
this.setFocus();
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* render() function
|
|
695
|
+
* Always the last one in the class.
|
|
696
|
+
*/
|
|
697
|
+
render() {
|
|
698
|
+
var _a, _b;
|
|
699
|
+
const valueAsDate = parseDutchDate(this.value);
|
|
700
|
+
const formattedDate = valueAsDate && printDutchDate(valueAsDate);
|
|
701
|
+
const selectedYear = (valueAsDate || this.focusedDay).getFullYear();
|
|
702
|
+
const focusedMonth = this.focusedDay.getMonth();
|
|
703
|
+
const focusedYear = this.focusedDay.getFullYear();
|
|
704
|
+
const minDate = parseDutchDate(this.min);
|
|
705
|
+
const maxDate = parseDutchDate(this.max);
|
|
706
|
+
const prevMonthDisabled = minDate && minDate.getMonth() === focusedMonth && minDate.getFullYear() === focusedYear;
|
|
707
|
+
const nextMonthDisabled = maxDate && maxDate.getMonth() === focusedMonth && maxDate.getFullYear() === focusedYear;
|
|
708
|
+
let minYear = selectedYear - 10;
|
|
709
|
+
let maxYear = selectedYear + 10;
|
|
710
|
+
if (minDate) {
|
|
711
|
+
minYear = Math.max(minYear, minDate.getFullYear());
|
|
712
|
+
}
|
|
713
|
+
if (maxDate) {
|
|
714
|
+
maxYear = Math.min(maxYear, maxDate.getFullYear());
|
|
715
|
+
}
|
|
716
|
+
return (h(Host, { key: '957cb5ecd6d41aa4080fdc413ecd3ec720e6f2f5' }, h("div", { key: '7a6fd28aca5e525a44db67316ea232111dd78d83', class: { "dso-date": true, "dso-visible": this.visible } }, h("div", { key: '738c2f5561053e525732b03db48f767018186df1', class: "dso-date__input-wrapper" }, h("input", { key: 'be60893ee6894c6872f4a8b11e1a5329592a9cb3', class: "dso-date__input", value: this.value, placeholder: this.localization.placeholder, id: this.identifier, disabled: this.disabled, role: (_a = this.role) !== null && _a !== void 0 ? _a : undefined, required: this.required ? true : undefined, "aria-autocomplete": "none", "aria-invalid": (_b = this.invalid) === null || _b === void 0 ? void 0 : _b.toString(), "aria-describedby": this.describedBy, onInput: this.handleInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown, autoComplete: "off", ref: (element) => (this.datePickerLegacyInput = element) }), h("button", { key: '64a1581be9c55c14278206fc8bec3516fe9588c3', type: "button", class: "dso-date__toggle", onClick: this.toggleOpen, disabled: this.disabled, ref: (element) => (this.datePickerLegacyButton = element) }, h("span", { key: '0abea68907579095ed9a0f30cd3fe66f1e99adf7', class: "dso-date__toggle-icon" }, h("dso-icon", { key: '80acee7a48d20a2314a8bbfeba478ffe49bdc2f1', icon: "calendar" })), h("span", { key: 'e8734da932112b02a3d40135b9a0ae7c53762c0a', class: "dso-date__vhidden" }, this.localization.buttonLabel, formattedDate && (h("span", { key: 'd64fb70897d08a11c6ab4130686128f36ede3635' }, ", ", this.localization.selectedDateMessage, " ", formattedDate))))), h("div", { key: 'eb265922641b7bbb69ffae331ea25663246865e7', class: {
|
|
717
|
+
"dso-date__dialog": true,
|
|
718
|
+
"is-left": this.direction === "left",
|
|
719
|
+
"is-active": this.open,
|
|
720
|
+
}, role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? "false" : "true", "aria-labelledby": this.dialogLabelId, onTouchMove: this.handleTouchMove, onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, h("div", { key: '0652c8515f40627399a4d2c8e572188d4a272866', class: "dso-date__dialog-content", onKeyDown: this.handleEscKey }, h("div", { key: 'ffd05e410fb85956e9157325b55c50f6c13ffd2f', class: "dso-date__vhidden dso-date__instructions", "aria-live": "polite" }, this.localization.keyboardInstruction), h("div", { key: 'cba925b52839e002c6725e213e5cd1e4bb9527cc', class: "dso-date__mobile", onFocusin: this.disableActiveFocus }, h("label", { key: '9e5c185d36e1b36c5f434e2f4ba84f9fe05f34ab', class: "dso-date__mobile-heading" }, this.localization.calendarHeading), h("button", { key: 'cb2d54a595e5937dbdfa2493c2a78f3232a694fe', class: "dso-date__close", ref: (element) => (this.firstFocusableElement = element), onKeyDown: this.handleFirstFocusableKeydown, onClick: () => this.hide(), type: "button" }, h("dso-icon", { key: 'caa97ca69898a421dc2be65d0b72d506784b46b3', icon: "times" }), h("span", { key: '53c8e6ed325069aa3f469d2c882749b1a7c6a73a', class: "dso-date__vhidden" }, this.localization.closeLabel))), h("div", { key: '01a8aff75b3f2760466e9a8d1a98183cfc54c5f6', class: "dso-date__header", onFocusin: this.disableActiveFocus }, h("div", { key: '014941383091917d6db3b4ef61697feb50f9ca89' }, h("h2", { key: '5bc5c6226ca3e62965d44cb7213c1b3b595d1fed', id: this.dialogLabelId, class: "dso-date__vhidden", "aria-live": "polite" }, this.localization.monthNames[focusedMonth], " ", this.focusedDay.getFullYear()), h("label", { key: '4a8cfec86a434dee22a6e692c3a221f649f2b165', htmlFor: this.monthSelectId, class: "dso-date__vhidden" }, this.localization.monthSelectLabel), h("div", { key: 'e0ccf6cda124982e9193f882300d3883a88979ba', class: "dso-date__select" }, h("select", { key: 'a98658e03f28e9e82224b69d754df240183c2cd9', id: this.monthSelectId, class: "dso-date__select--month", ref: (element) => (this.monthSelectNode = element), onChange: this.handleMonthSelect }, monthRange(this.localization, selectedYear, minDate, maxDate).map((month) => {
|
|
721
|
+
const index = this.localization.monthNames.indexOf(month);
|
|
722
|
+
return (h("option", { key: month, value: index, selected: index === focusedMonth }, month));
|
|
723
|
+
})), h("div", { key: '2c430302075f436442d64aad4804936d7f47d417', class: "dso-date__select-label", "aria-hidden": "true" }, h("span", { key: 'c53a91bf0f52839fa4aa87c0ef9e2dacbe0df8bb' }, this.localization.monthNamesShort[focusedMonth]), h("dso-icon", { key: '19b52d0d3f0c1a71402515b97e7d13f98f12a105', icon: "chevron-down" }))), h("label", { key: '246fd6c2fb5c7771c139d5786346e12ef8693c3d', htmlFor: this.yearSelectId, class: "dso-date__vhidden" }, this.localization.yearSelectLabel), h("div", { key: '9b2583586116004567611ecfac87d6a98261c157', class: "dso-date__select" }, h("select", { key: '06b592e2eb87d41c85ee5bf4efaed35b51144fd8', id: this.yearSelectId, class: "dso-date__select--year", onChange: this.handleYearSelect }, range(minYear, maxYear).map((year) => (h("option", { key: year, selected: year === focusedYear }, year)))), h("div", { key: 'ef7b607dfc1e493077d79aeffe3dc687b3991e28', class: "dso-date__select-label", "aria-hidden": "true" }, h("span", { key: '36d1dec13260dbc32feaf4c9875bdc5e9ca68118' }, this.focusedDay.getFullYear()), h("dso-icon", { key: '34e5fba7b8152bf66b65eecc7ca6469ac09bec34', icon: "chevron-down" })))), h("div", { key: 'b075a1c3c963e89f7aa7708834e9a697fe3aedd9', class: "dso-date__nav" }, h("button", { key: 'ac333335f9a4a81b659d5ca787a594bcc227314b', class: "dso-date__prev", onClick: this.handlePreviousMonthClick, disabled: prevMonthDisabled, type: "button" }, h("dso-icon", { key: '3802f14d7336beabcbd2e22d76c605d6a1610ae3', icon: "chevron-left" }), h("span", { key: 'fd06635f86a685a0e25fa19f911151dc98017cd0', class: "dso-date__vhidden" }, this.localization.prevMonthLabel)), h("button", { key: 'a6c10604bd06923d4230452a629c4a585651a6e0', class: "dso-date__next", onClick: this.handleNextMonthClick, disabled: nextMonthDisabled, type: "button" }, h("dso-icon", { key: '1d43e6494d836b954eafd7b3d22efe1183e06526', icon: "chevron-right" }), h("span", { key: '4b880ddc1b3dbf49171b4e71ad6949296ce90d91', class: "dso-date__vhidden" }, this.localization.nextMonthLabel)))), h(DatePickerLegacyMonth, { key: '54c119f2a06e35cd6143994eca4a718a917f6638', selectedDate: valueAsDate, focusedDate: this.focusedDay, onDateSelect: this.handleDaySelect, onKeyboardNavigation: this.handleKeyboardNavigation, labelledById: this.dialogLabelId, localization: this.localization, firstDayOfWeek: this.firstDayOfWeek, focusedDayRef: this.processFocusedDayNode, min: minDate, max: maxDate }))))));
|
|
724
|
+
}
|
|
725
|
+
get element() { return this; }
|
|
726
|
+
static get style() { return datePickerLegacyCss; }
|
|
727
|
+
}, [2, "dso-date-picker-legacy", {
|
|
728
|
+
"name": [1],
|
|
729
|
+
"identifier": [1],
|
|
730
|
+
"disabled": [516],
|
|
731
|
+
"role": [1],
|
|
732
|
+
"direction": [1],
|
|
733
|
+
"required": [4],
|
|
734
|
+
"invalid": [516],
|
|
735
|
+
"describedBy": [1, "described-by"],
|
|
736
|
+
"dsoAutofocus": [4, "dso-autofocus"],
|
|
737
|
+
"value": [1537],
|
|
738
|
+
"min": [1],
|
|
739
|
+
"max": [1],
|
|
740
|
+
"activeFocus": [32],
|
|
741
|
+
"focusedDay": [32],
|
|
742
|
+
"open": [32],
|
|
743
|
+
"visible": [32],
|
|
744
|
+
"setFocus": [64],
|
|
745
|
+
"show": [64],
|
|
746
|
+
"hide": [64]
|
|
747
|
+
}, [[6, "click", "handleDocumentClick"]]]);
|
|
748
|
+
function defineCustomElement$1() {
|
|
749
|
+
if (typeof customElements === "undefined") {
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
const components = ["dso-date-picker-legacy", "dso-icon"];
|
|
753
|
+
components.forEach(tagName => { switch (tagName) {
|
|
754
|
+
case "dso-date-picker-legacy":
|
|
755
|
+
if (!customElements.get(tagName)) {
|
|
756
|
+
customElements.define(tagName, DsoDatePickerLegacy$1);
|
|
757
|
+
}
|
|
758
|
+
break;
|
|
759
|
+
case "dso-icon":
|
|
760
|
+
if (!customElements.get(tagName)) {
|
|
761
|
+
defineCustomElement$2();
|
|
762
|
+
}
|
|
763
|
+
break;
|
|
764
|
+
} });
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
const DsoDatePickerLegacy = DsoDatePickerLegacy$1;
|
|
768
|
+
const defineCustomElement = defineCustomElement$1;
|
|
769
|
+
|
|
770
|
+
export { DsoDatePickerLegacy, defineCustomElement };
|
|
771
|
+
//# sourceMappingURL=dso-date-picker-legacy.js.map
|
|
772
|
+
|
|
773
|
+
//# sourceMappingURL=dso-date-picker-legacy.js.map
|