@dso-toolkit/core 62.19.0 → 62.20.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/cjs/dso-accordion-section.cjs.entry.js +2 -2
- package/dist/cjs/dso-accordion.cjs.entry.js +1 -1
- package/dist/cjs/dso-action-list-item.cjs.entry.js +2 -2
- package/dist/cjs/dso-action-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-action-list.cjs.entry.js +1 -1
- package/dist/cjs/dso-advanced-select.cjs.entry.js +2 -2
- package/dist/cjs/dso-advanced-select.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-alert_7.cjs.entry.js +55 -30
- package/dist/cjs/dso-alert_7.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-annotation-output_3.cjs.entry.js +3 -3
- package/dist/cjs/dso-annotation-output_3.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-attachments-counter.cjs.entry.js +1 -1
- package/dist/cjs/dso-autosuggest.cjs.entry.js +1 -1
- package/dist/cjs/dso-banner.cjs.entry.js +2 -2
- package/dist/cjs/dso-card-container.cjs.entry.js +1 -1
- package/dist/cjs/dso-card-container.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-card.cjs.entry.js +2 -2
- package/dist/cjs/dso-card.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-date-picker-legacy.cjs.entry.js +3 -3
- package/dist/cjs/dso-date-picker-legacy.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +1 -1
- package/dist/cjs/dso-expandable.cjs.entry.js +2 -2
- package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +2 -2
- package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
- package/dist/cjs/dso-highlight-box.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-icon.cjs.entry.js +1 -1
- package/dist/cjs/dso-info-button.cjs.entry.js +1 -1
- package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
- package/dist/cjs/dso-info_2.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-input-range.cjs.entry.js +2 -2
- package/dist/cjs/dso-input-range.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-legend-item.cjs.entry.js +46 -0
- package/dist/cjs/dso-legend-item.cjs.entry.js.map +1 -0
- package/dist/cjs/dso-list-button.cjs.entry.js +1 -1
- package/dist/cjs/dso-list-button.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-logo.cjs.entry.js +1 -1
- package/dist/cjs/dso-logo.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-map-base-layers.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-controls.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-overlays.cjs.entry.js +1 -1
- package/dist/cjs/dso-mark-bar.cjs.entry.js +1 -1
- package/dist/cjs/dso-modal.cjs.entry.js +2 -2
- package/dist/cjs/dso-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/dso-progress-indicator.cjs.entry.js +1 -1
- package/dist/cjs/dso-responsive-element.cjs.entry.js +1 -1
- package/dist/cjs/dso-scrollable.cjs.entry.js +2 -2
- package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +2 -2
- package/dist/cjs/dso-toolkit.cjs.js.map +1 -1
- package/dist/cjs/dso-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/dso-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-tree-view.cjs.entry.js +1 -1
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +1 -1
- package/dist/cjs/dso-viewer-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/dsot-document-component-demo.cjs.entry.js +1 -1
- package/dist/cjs/dsot-document-component-demo.cjs.entry.js.map +1 -1
- package/dist/cjs/index-a58ba49d.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/accordion/accordion.js +1 -1
- package/dist/collection/components/accordion/components/accordion-section.js +2 -2
- package/dist/collection/components/action-list/action-list.js +1 -1
- package/dist/collection/components/action-list/components/action-list-item.js +2 -2
- package/dist/collection/components/action-list/components/action-list-item.js.map +1 -1
- package/dist/collection/components/advanced-select/advanced-select.js +2 -2
- package/dist/collection/components/advanced-select/advanced-select.js.map +1 -1
- package/dist/collection/components/alert/alert.js +1 -1
- package/dist/collection/components/annotation-output/annotation-output.js +1 -1
- package/dist/collection/components/annotation-output/annotation-output.js.map +1 -1
- package/dist/collection/components/attachments-counter/attachments-counter.js +1 -1
- package/dist/collection/components/autosuggest/autosuggest.js +1 -1
- package/dist/collection/components/badge/badge.js +1 -1
- package/dist/collection/components/banner/banner.js +2 -2
- package/dist/collection/components/card/card.js +2 -2
- package/dist/collection/components/card/card.js.map +1 -1
- package/dist/collection/components/card-container/card-container.js +1 -1
- package/dist/collection/components/card-container/card-container.js.map +1 -1
- package/dist/collection/components/date-picker/date-picker.js +1 -1
- package/dist/collection/components/date-picker-legacy/date-picker-legacy.js +3 -3
- package/dist/collection/components/document-component/document-component.js +1 -1
- package/dist/collection/components/document-component/document-component.js.map +1 -1
- package/dist/collection/components/document-component-demo/document-component.demo.js +1 -1
- package/dist/collection/components/document-component-demo/document-component.demo.js.map +1 -1
- package/dist/collection/components/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/collection/components/expandable/expandable.js +2 -2
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.js +2 -2
- package/dist/collection/components/highlight-box/highlight-box.js +1 -1
- package/dist/collection/components/highlight-box/highlight-box.js.map +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/info/info.js +1 -1
- package/dist/collection/components/info/info.js.map +1 -1
- package/dist/collection/components/info-button/info-button.js +1 -1
- package/dist/collection/components/input-range/input-range.js +2 -2
- package/dist/collection/components/input-range/input-range.js.map +1 -1
- package/dist/collection/components/label/label.js +3 -3
- package/dist/collection/components/label/label.js.map +1 -1
- package/dist/collection/components/legend-item/legend-item.css +104 -0
- package/dist/collection/components/legend-item/legend-item.interfaces.js +2 -0
- package/dist/collection/components/legend-item/legend-item.interfaces.js.map +1 -0
- package/dist/collection/components/legend-item/legend-item.js +162 -0
- package/dist/collection/components/legend-item/legend-item.js.map +1 -0
- package/dist/collection/components/list-button/list-button.js +1 -1
- package/dist/collection/components/list-button/list-button.js.map +1 -1
- package/dist/collection/components/logo/logo.js +1 -1
- package/dist/collection/components/logo/logo.js.map +1 -1
- package/dist/collection/components/map-base-layers/map-base-layers.js +1 -1
- package/dist/collection/components/map-controls/map-controls.js +1 -1
- package/dist/collection/components/map-overlays/map-overlays.js +1 -1
- package/dist/collection/components/mark-bar/mark-bar.js +1 -1
- package/dist/collection/components/modal/modal.js +2 -2
- package/dist/collection/components/modal/modal.js.map +1 -1
- package/dist/collection/components/ozon-content/functional-components/wrap-wijzigactie.functional-component.js +11 -0
- package/dist/collection/components/ozon-content/functional-components/wrap-wijzigactie.functional-component.js.map +1 -0
- package/dist/collection/components/ozon-content/functions/parse-wijzigactie-from-node.function.js +5 -0
- package/dist/collection/components/ozon-content/functions/parse-wijzigactie-from-node.function.js.map +1 -0
- package/dist/collection/components/ozon-content/functions/wijzigactie-to-class-name.function.js +10 -0
- package/dist/collection/components/ozon-content/functions/wijzigactie-to-class-name.function.js.map +1 -0
- package/dist/collection/components/ozon-content/nodes/al.node.js +6 -11
- package/dist/collection/components/ozon-content/nodes/al.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/lijst.node.js +14 -4
- package/dist/collection/components/ozon-content/nodes/lijst.node.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content.css +23 -2
- package/dist/collection/components/ozon-content/ozon-content.interfaces.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content.js +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js +1 -1
- package/dist/collection/components/progress-indicator/progress-indicator.js +1 -1
- package/dist/collection/components/responsive-element/responsive-element.js +1 -1
- package/dist/collection/components/scrollable/scrollable.js +2 -2
- package/dist/collection/components/selectable/selectable.js +1 -1
- package/dist/collection/components/selectable/selectable.js.map +1 -1
- package/dist/collection/components/slide-toggle/slide-toggle.js +1 -1
- package/dist/collection/components/slide-toggle/slide-toggle.js.map +1 -1
- package/dist/collection/components/table/table.js +1 -1
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/toggletip/toggletip.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/collection/components/tree-view/tree-view.js +1 -1
- package/dist/collection/components/viewer-grid/viewer-grid.js +1 -1
- package/dist/collection/components/viewer-grid/viewer-grid.js.map +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/annotation-output.js +1 -1
- package/dist/components/annotation-output.js.map +1 -1
- package/dist/components/attachments-counter.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/document-component.js +1 -1
- package/dist/components/document-component.js.map +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/dso-accordion-section.js +2 -2
- package/dist/components/dso-accordion.js +1 -1
- package/dist/components/dso-action-list-item.js +2 -2
- package/dist/components/dso-action-list-item.js.map +1 -1
- package/dist/components/dso-action-list.js +1 -1
- package/dist/components/dso-advanced-select.js +2 -2
- package/dist/components/dso-advanced-select.js.map +1 -1
- package/dist/components/dso-autosuggest.js +1 -1
- package/dist/components/dso-banner.js +2 -2
- package/dist/components/dso-card-container.js +1 -1
- package/dist/components/dso-card-container.js.map +1 -1
- package/dist/components/dso-card.js +2 -2
- package/dist/components/dso-card.js.map +1 -1
- package/dist/components/dso-date-picker-legacy.js +3 -3
- package/dist/components/dso-date-picker-legacy.js.map +1 -1
- package/dist/components/dso-date-picker.js +1 -1
- package/dist/components/dso-helpcenter-panel.js +2 -2
- package/dist/components/dso-highlight-box.js +1 -1
- package/dist/components/dso-highlight-box.js.map +1 -1
- package/dist/components/dso-input-range.js +2 -2
- package/dist/components/dso-input-range.js.map +1 -1
- package/dist/components/dso-legend-item.d.ts +11 -0
- package/dist/components/dso-legend-item.js +89 -0
- package/dist/components/dso-legend-item.js.map +1 -0
- package/dist/components/dso-list-button.js +1 -1
- package/dist/components/dso-list-button.js.map +1 -1
- package/dist/components/dso-logo.js +1 -1
- package/dist/components/dso-logo.js.map +1 -1
- package/dist/components/dso-map-base-layers.js +1 -1
- package/dist/components/dso-map-controls.js +1 -1
- package/dist/components/dso-map-overlays.js +1 -1
- package/dist/components/dso-mark-bar.js +1 -1
- package/dist/components/dso-modal.js +2 -2
- package/dist/components/dso-modal.js.map +1 -1
- package/dist/components/dso-progress-bar.js +1 -1
- package/dist/components/dso-toggletip.js +1 -86
- package/dist/components/dso-toggletip.js.map +1 -1
- package/dist/components/dso-tree-view.js +1 -1
- package/dist/components/dso-viewer-grid.js +1 -1
- package/dist/components/dso-viewer-grid.js.map +1 -1
- package/dist/components/dsot-document-component-demo.js +1 -1
- package/dist/components/dsot-document-component-demo.js.map +1 -1
- package/dist/components/expandable.js +2 -2
- package/dist/components/icon.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/info-button.js +1 -1
- package/dist/components/info.js +1 -1
- package/dist/components/info.js.map +1 -1
- package/dist/components/label.js +3 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/ozon-content.js +49 -24
- package/dist/components/ozon-content.js.map +1 -1
- package/dist/components/progress-indicator.js +1 -1
- package/dist/components/responsive-element.js +1 -1
- package/dist/components/scrollable.js +2 -2
- package/dist/components/selectable.js +1 -1
- package/dist/components/selectable.js.map +1 -1
- package/dist/components/slide-toggle.js +1 -1
- package/dist/components/slide-toggle.js.map +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/toggletip.js +90 -0
- package/dist/components/toggletip.js.map +1 -0
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
- package/dist/dso-toolkit/p-0142294a.entry.js +2 -0
- package/dist/dso-toolkit/p-0142294a.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-69e2f1a3.entry.js → p-0308135a.entry.js} +2 -2
- package/dist/dso-toolkit/{p-69e2f1a3.entry.js.map → p-0308135a.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-590c98cb.entry.js → p-0bb4a95b.entry.js} +2 -2
- package/dist/dso-toolkit/{p-590c98cb.entry.js.map → p-0bb4a95b.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-b8be68cd.entry.js → p-0bbdb3e7.entry.js} +2 -2
- package/dist/dso-toolkit/{p-d6fa20f7.entry.js → p-0c1b34f6.entry.js} +2 -2
- package/dist/dso-toolkit/{p-d6fa20f7.entry.js.map → p-0c1b34f6.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-10d464fa.entry.js +2 -0
- package/dist/dso-toolkit/{p-9f9ed7fc.entry.js → p-1cb9cd71.entry.js} +2 -2
- package/dist/dso-toolkit/{p-9f9ed7fc.entry.js.map → p-1cb9cd71.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-05115f40.entry.js → p-1f66a719.entry.js} +2 -2
- package/dist/dso-toolkit/{p-00f36d82.entry.js → p-28de6034.entry.js} +2 -2
- package/dist/dso-toolkit/{p-c435f94d.entry.js → p-435baefc.entry.js} +2 -2
- package/dist/dso-toolkit/{p-c435f94d.entry.js.map → p-435baefc.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-9579c352.entry.js → p-43bcfb18.entry.js} +2 -2
- package/dist/dso-toolkit/{p-9579c352.entry.js.map → p-43bcfb18.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-8a41761d.entry.js → p-4eaf26e3.entry.js} +2 -2
- package/dist/dso-toolkit/{p-0df15acb.entry.js → p-5028d1e1.entry.js} +2 -2
- package/dist/dso-toolkit/{p-171df922.entry.js → p-62ec675a.entry.js} +2 -2
- package/dist/dso-toolkit/{p-171df922.entry.js.map → p-62ec675a.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-ba1757f9.entry.js → p-64755e52.entry.js} +2 -2
- package/dist/dso-toolkit/{p-1543b25f.entry.js → p-64d88436.entry.js} +2 -2
- package/dist/dso-toolkit/{p-c3af1efc.entry.js → p-67480a2f.entry.js} +2 -2
- package/dist/dso-toolkit/{p-3b8f44b1.entry.js → p-6e7dcc0e.entry.js} +2 -2
- package/dist/dso-toolkit/{p-3b8f44b1.entry.js.map → p-6e7dcc0e.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-701648d3.js.map +1 -1
- package/dist/dso-toolkit/{p-e1f82103.entry.js → p-7f5b0979.entry.js} +2 -2
- package/dist/dso-toolkit/{p-bf2ef44a.entry.js → p-86e80f9c.entry.js} +2 -2
- package/dist/dso-toolkit/{p-ffdcb2e4.entry.js → p-88b1db54.entry.js} +2 -2
- package/dist/dso-toolkit/p-906ae1e7.entry.js +2 -0
- package/dist/dso-toolkit/p-9709ff83.entry.js +2 -0
- package/dist/dso-toolkit/p-a00fb3ac.entry.js +2 -0
- package/dist/dso-toolkit/p-a00fb3ac.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-ae783ec3.entry.js → p-b22757ab.entry.js} +2 -2
- package/dist/dso-toolkit/p-b51c4022.entry.js +2 -0
- package/dist/dso-toolkit/{p-e968c726.entry.js.map → p-b51c4022.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-0f1c1ad3.entry.js → p-b879c985.entry.js} +2 -2
- package/dist/dso-toolkit/{p-db0796f2.entry.js → p-bc3c966f.entry.js} +2 -2
- package/dist/dso-toolkit/p-bc95874a.entry.js +2 -0
- package/dist/dso-toolkit/{p-64ed1e16.entry.js.map → p-bc95874a.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-130c00f5.entry.js → p-bcc19bae.entry.js} +2 -2
- package/dist/dso-toolkit/{p-f3f23018.entry.js → p-bec5778a.entry.js} +2 -2
- package/dist/dso-toolkit/{p-f3f23018.entry.js.map → p-bec5778a.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-32e3c872.entry.js → p-c22965e0.entry.js} +2 -2
- package/dist/dso-toolkit/{p-32e3c872.entry.js.map → p-c22965e0.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-cd466fa3.entry.js +2 -0
- package/dist/dso-toolkit/p-cd466fa3.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-bb65ba35.entry.js → p-cef2a4da.entry.js} +2 -2
- package/dist/dso-toolkit/{p-bb65ba35.entry.js.map → p-cef2a4da.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-487a5da9.entry.js → p-dd9d670a.entry.js} +2 -2
- package/dist/dso-toolkit/{p-b73a27bc.entry.js → p-e3b54b03.entry.js} +2 -2
- package/dist/dso-toolkit/{p-3e0495a4.entry.js → p-e8648400.entry.js} +2 -2
- package/dist/dso-toolkit/p-e8ada03b.entry.js +2 -0
- package/dist/dso-toolkit/{p-889aa72f.entry.js.map → p-e8ada03b.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-0edf4492.entry.js → p-fbf6613f.entry.js} +2 -2
- package/dist/dso-toolkit/{p-0edf4492.entry.js.map → p-fbf6613f.entry.js.map} +1 -1
- package/dist/esm/dso-accordion-section.entry.js +2 -2
- package/dist/esm/dso-accordion.entry.js +1 -1
- package/dist/esm/dso-action-list-item.entry.js +2 -2
- package/dist/esm/dso-action-list-item.entry.js.map +1 -1
- package/dist/esm/dso-action-list.entry.js +1 -1
- package/dist/esm/dso-advanced-select.entry.js +2 -2
- package/dist/esm/dso-advanced-select.entry.js.map +1 -1
- package/dist/esm/dso-alert_7.entry.js +55 -30
- package/dist/esm/dso-alert_7.entry.js.map +1 -1
- package/dist/esm/dso-annotation-output_3.entry.js +3 -3
- package/dist/esm/dso-annotation-output_3.entry.js.map +1 -1
- package/dist/esm/dso-attachments-counter.entry.js +1 -1
- package/dist/esm/dso-autosuggest.entry.js +1 -1
- package/dist/esm/dso-banner.entry.js +2 -2
- package/dist/esm/dso-card-container.entry.js +1 -1
- package/dist/esm/dso-card-container.entry.js.map +1 -1
- package/dist/esm/dso-card.entry.js +2 -2
- package/dist/esm/dso-card.entry.js.map +1 -1
- package/dist/esm/dso-date-picker-legacy.entry.js +3 -3
- package/dist/esm/dso-date-picker-legacy.entry.js.map +1 -1
- package/dist/esm/dso-date-picker.entry.js +1 -1
- package/dist/esm/dso-dropdown-menu.entry.js +1 -1
- package/dist/esm/dso-expandable.entry.js +2 -2
- package/dist/esm/dso-helpcenter-panel.entry.js +2 -2
- package/dist/esm/dso-highlight-box.entry.js +1 -1
- package/dist/esm/dso-highlight-box.entry.js.map +1 -1
- package/dist/esm/dso-icon.entry.js +1 -1
- package/dist/esm/dso-info-button.entry.js +1 -1
- package/dist/esm/dso-info_2.entry.js +2 -2
- package/dist/esm/dso-info_2.entry.js.map +1 -1
- package/dist/esm/dso-input-range.entry.js +2 -2
- package/dist/esm/dso-input-range.entry.js.map +1 -1
- package/dist/esm/dso-legend-item.entry.js +42 -0
- package/dist/esm/dso-legend-item.entry.js.map +1 -0
- package/dist/esm/dso-list-button.entry.js +1 -1
- package/dist/esm/dso-list-button.entry.js.map +1 -1
- package/dist/esm/dso-logo.entry.js +1 -1
- package/dist/esm/dso-logo.entry.js.map +1 -1
- package/dist/esm/dso-map-base-layers.entry.js +1 -1
- package/dist/esm/dso-map-controls.entry.js +1 -1
- package/dist/esm/dso-map-overlays.entry.js +1 -1
- package/dist/esm/dso-mark-bar.entry.js +1 -1
- package/dist/esm/dso-modal.entry.js +2 -2
- package/dist/esm/dso-modal.entry.js.map +1 -1
- package/dist/esm/dso-progress-bar.entry.js +1 -1
- package/dist/esm/dso-progress-indicator.entry.js +1 -1
- package/dist/esm/dso-responsive-element.entry.js +1 -1
- package/dist/esm/dso-scrollable.entry.js +2 -2
- package/dist/esm/dso-toggletip.entry.js +1 -1
- package/dist/esm/dso-toolkit.js +2 -2
- package/dist/esm/dso-toolkit.js.map +1 -1
- package/dist/esm/dso-tooltip.entry.js +1 -1
- package/dist/esm/dso-tooltip.entry.js.map +1 -1
- package/dist/esm/dso-tree-view.entry.js +1 -1
- package/dist/esm/dso-viewer-grid.entry.js +1 -1
- package/dist/esm/dso-viewer-grid.entry.js.map +1 -1
- package/dist/esm/dsot-document-component-demo.entry.js +1 -1
- package/dist/esm/dsot-document-component-demo.entry.js.map +1 -1
- package/dist/esm/index-2e1b7388.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/legend-item/legend-item.d.ts +39 -0
- package/dist/types/components/legend-item/legend-item.interfaces.d.ts +3 -0
- package/dist/types/components/ozon-content/functional-components/wrap-wijzigactie.functional-component.d.ts +6 -0
- package/dist/types/components/ozon-content/functions/parse-wijzigactie-from-node.function.d.ts +2 -0
- package/dist/types/components/ozon-content/functions/wijzigactie-to-class-name.function.d.ts +2 -0
- package/dist/types/components/ozon-content/nodes/al.node.d.ts +1 -1
- package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +1 -0
- package/dist/types/components.d.ts +68 -0
- package/package.json +4 -4
- package/dist/dso-toolkit/p-30f09a47.entry.js +0 -2
- package/dist/dso-toolkit/p-3603f65a.entry.js +0 -2
- package/dist/dso-toolkit/p-3603f65a.entry.js.map +0 -1
- package/dist/dso-toolkit/p-535f755f.entry.js +0 -2
- package/dist/dso-toolkit/p-535f755f.entry.js.map +0 -1
- package/dist/dso-toolkit/p-64ed1e16.entry.js +0 -2
- package/dist/dso-toolkit/p-889aa72f.entry.js +0 -2
- package/dist/dso-toolkit/p-9f465136.entry.js +0 -2
- package/dist/dso-toolkit/p-a7ec3cce.entry.js +0 -2
- package/dist/dso-toolkit/p-e968c726.entry.js +0 -2
- /package/dist/dso-toolkit/{p-b8be68cd.entry.js.map → p-0bbdb3e7.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-9f465136.entry.js.map → p-10d464fa.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-05115f40.entry.js.map → p-1f66a719.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-00f36d82.entry.js.map → p-28de6034.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-8a41761d.entry.js.map → p-4eaf26e3.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-0df15acb.entry.js.map → p-5028d1e1.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-ba1757f9.entry.js.map → p-64755e52.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-1543b25f.entry.js.map → p-64d88436.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-c3af1efc.entry.js.map → p-67480a2f.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-e1f82103.entry.js.map → p-7f5b0979.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-bf2ef44a.entry.js.map → p-86e80f9c.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-ffdcb2e4.entry.js.map → p-88b1db54.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-a7ec3cce.entry.js.map → p-906ae1e7.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-30f09a47.entry.js.map → p-9709ff83.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-ae783ec3.entry.js.map → p-b22757ab.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-0f1c1ad3.entry.js.map → p-b879c985.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-db0796f2.entry.js.map → p-bc3c966f.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-130c00f5.entry.js.map → p-bcc19bae.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-487a5da9.entry.js.map → p-dd9d670a.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-b73a27bc.entry.js.map → p-e3b54b03.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-3e0495a4.entry.js.map → p-e8648400.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DaysOfWeek","createDate","year","month","day","dayInt","parseInt","monthInt","yearInt","isValid","Number","isInteger","Date","parseDutchDate","value","matches","split","length","printDutchDate","date","d","getDate","toString","padStart","m","getMonth","y","getFullYear","isEqual","a","b","addDays","days","setDate","startOfWeek","firstDayOfWeek","Monday","getDay","diff","endOfWeek","startOfMonth","endOfMonth","setMonth","setYear","setFullYear","inRange","min","max","clamp","time","getTime","getDaysInRange","start","end","current","push","getViewOfMonth","DatePickerLegacyDay","focusedDay","today","onDaySelect","onKeyboardNavigation","focusedDayRef","isToday","isFocused","notCurrentMonth","isOutsideRange","handleClick","e","h","class","tabIndex","onClick","onKeyDown","disabled","type","ref","el","chunk","array","chunkSize","result","i","slice","mapWithOffset","startingOffset","mapFn","map","_","adjustedIndex","item","Error","DatePickerLegacyMonth","selectedDate","focusedDate","labelledById","localization","onDateSelect","onMouseDown","onFocusIn","role","onFocusin","dayNames","dayName","scope","substr","week","undefined","buttonLabel","placeholder","selectedDateMessage","prevMonthLabel","nextMonthLabel","monthSelectLabel","yearSelectLabel","closeLabel","keyboardInstruction","calendarHeading","monthNames","monthNamesShort","monthRange","selectedYear","minDate","maxDate","minYear","minMonth","maxYear","maxMonth","filter","_month","index","range","from","to","datePickerLegacyCss","DsoDatePickerLegacyStyle0","keyCode","TAB","ESC","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT","UP","RIGHT","DOWN","DISALLOWED_CHARACTERS","TRANSITION_MS","cleanValue","input","regex","cursor","selectionStart","beforeCursor","afterCursor","filteredBeforeCursor","replace","filterAfterCursor","newValue","newCursor","selectionEnd","DsoDatePickerLegacy","this","monthSelectId","createIdentifier","yearSelectId","dialogLabelId","defaultLocalization","enableActiveFocus","activeFocus","disableActiveFocus","toggleOpen","preventDefault","open","hide","show","handleEscKey","event","handleBlur","stopPropagation","dsoBlur","emit","component","handleKeyUp","dsoKeyUp","originalEvent","handleKeyDown","dsoKeyDown","handleFocus","dsoFocus","handleTouchStart","touch","changedTouches","initialTouchX","pageX","initialTouchY","pageY","handleTouchMove","handleTouchEnd","distX","_a","distY","_b","threshold","isHorizontalSwipe","Math","abs","isDownwardsSwipe","addMonths","handleNextMonthClick","handlePreviousMonthClick","handleFirstFocusableKeydown","shiftKey","focusedDayNode","focus","handleKeyboardNavigation","firstFocusableElement","handled","addYears","handleDaySelect","_event","setValue","setFocusedDay","handleMonthSelect","target","HTMLSelectElement","handleYearSelect","handleInputChange","cleanedValue","prepareEvent","valueAsDate","required","error","clampValue","processFocusedDayNode","element","setTimeout","handleDocumentClick","path","composedPath","Node","contains","setFocus","datePickerLegacyInput","hideTimeoutId","clearTimeout","visible","focusTimeoutId","monthSelectNode","moveFocusToButton","datePickerLegacyButton","months","years","previousValue","dsoDateChange","componentWillLoad","componentDidLoad","dsoAutofocus","render","formattedDate","focusedMonth","focusedYear","prevMonthDisabled","nextMonthDisabled","Host","key","id","identifier","invalid","describedBy","onInput","onFocus","onBlur","onKeyUp","autoComplete","icon","direction","onTouchMove","onTouchStart","onTouchEnd","htmlFor","onChange","indexOf","selected"],"sources":["src/components/date-picker-legacy/date-utils.ts","src/components/date-picker-legacy/date-picker-day.tsx","src/components/date-picker-legacy/date-picker-month.tsx","src/components/date-picker-legacy/date-localization.ts","src/components/date-picker-legacy/utils/month-range.ts","src/components/date-picker-legacy/utils/range.ts","src/components/date-picker-legacy/date-picker-legacy.scss?tag=dso-date-picker-legacy&encapsulation=scoped","src/components/date-picker-legacy/date-picker-legacy.tsx"],"sourcesContent":["// eslint-disable-next-line @stencil-community/ban-exported-const-enums -- This enum is not part of public API\r\nexport enum DaysOfWeek {\r\n Sunday = 0,\r\n Monday = 1,\r\n Tuesday = 2,\r\n Wednesday = 3,\r\n Thursday = 4,\r\n Friday = 5,\r\n Saturday = 6,\r\n}\r\n\r\nexport function createDate(year: string, month: string, day: string): Date | undefined {\r\n const dayInt = parseInt(day, 10);\r\n const monthInt = parseInt(month, 10);\r\n const yearInt = parseInt(year, 10);\r\n\r\n const isValid =\r\n Number.isInteger(yearInt) && // all parts should be integers\r\n Number.isInteger(monthInt) &&\r\n Number.isInteger(dayInt) &&\r\n monthInt > 0 && // month must be 1-12\r\n monthInt <= 12 &&\r\n dayInt > 0 && // day must be 1-31\r\n dayInt <= 31 &&\r\n yearInt > 0;\r\n\r\n if (isValid) {\r\n return new Date(yearInt, monthInt - 1, dayInt);\r\n }\r\n}\r\n\r\n/**\r\n * @param value date string in Dutch format D-M-YYYY\r\n */\r\nexport function parseDutchDate(value: string | undefined): Date | undefined {\r\n if (!value) {\r\n return;\r\n }\r\n\r\n const matches = value.split(\"-\");\r\n\r\n if (\r\n matches.length === 3 &&\r\n typeof matches[0] === \"string\" &&\r\n typeof matches[1] === \"string\" &&\r\n typeof matches[2] === \"string\" &&\r\n matches[2].length === 4\r\n ) {\r\n return createDate(matches[2], matches[1], matches[0]);\r\n }\r\n}\r\n\r\n/**\r\n * print date in format DD-MM-YYYY\r\n * @param date\r\n */\r\nexport function printDutchDate(date: Date | undefined): string {\r\n if (!date) {\r\n return \"\";\r\n }\r\n\r\n const d = date.getDate().toString(10).padStart(2, \"0\");\r\n const m = (date.getMonth() + 1).toString(10).padStart(2, \"0\");\r\n const y = date.getFullYear().toString(10).padStart(2, \"0\");\r\n\r\n return `${d}-${m}-${y}`;\r\n}\r\n\r\n/**\r\n * Compare if two dates are equal in terms of day, month, and year\r\n */\r\nexport function isEqual(a: Date | undefined, b: Date | undefined): boolean {\r\n if (!a || !b) {\r\n return false;\r\n }\r\n\r\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\r\n}\r\n\r\nexport function addDays(date: Date, days: number): Date {\r\n const d = new Date(date);\r\n d.setDate(d.getDate() + days);\r\n return d;\r\n}\r\n\r\nexport function addMonths(date: Date, months: number): Date {\r\n const d = new Date(date);\r\n d.setMonth(date.getMonth() + months);\r\n return d;\r\n}\r\n\r\nexport function addYears(date: Date, years: number): Date {\r\n const d = new Date(date);\r\n d.setFullYear(date.getFullYear() + years);\r\n return d;\r\n}\r\n\r\nexport function startOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\r\n const d = new Date(date);\r\n const day = d.getDay();\r\n const diff = (day < firstDayOfWeek ? 7 : 0) + day - firstDayOfWeek;\r\n\r\n d.setDate(d.getDate() - diff);\r\n return d;\r\n}\r\n\r\nexport function endOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\r\n const d = new Date(date);\r\n const day = d.getDay();\r\n const diff = (day < firstDayOfWeek ? -7 : 0) + 6 - (day - firstDayOfWeek);\r\n\r\n d.setDate(d.getDate() + diff);\r\n return d;\r\n}\r\n\r\nexport function startOfMonth(date: Date): Date {\r\n return new Date(date.getFullYear(), date.getMonth(), 1);\r\n}\r\n\r\nexport function endOfMonth(date: Date): Date {\r\n return new Date(date.getFullYear(), date.getMonth() + 1, 0);\r\n}\r\n\r\nexport function setMonth(date: Date, month: number): Date {\r\n const d = new Date(date);\r\n d.setMonth(month);\r\n return d;\r\n}\r\n\r\nexport function setYear(date: Date, year: number): Date {\r\n const d = new Date(date);\r\n d.setFullYear(year);\r\n return d;\r\n}\r\n\r\n/**\r\n * Check if date is within a min and max\r\n */\r\nexport function inRange(date: Date, min?: Date, max?: Date): boolean {\r\n return clamp(date, min, max) === date;\r\n}\r\n\r\n/**\r\n * Ensures date is within range, returns min or max if out of bounds\r\n */\r\nexport function clamp(date: Date, min?: Date, max?: Date): Date {\r\n const time = date.getTime();\r\n\r\n if (min && min instanceof Date && time < min.getTime()) {\r\n return min;\r\n }\r\n\r\n if (max && max instanceof Date && time > max.getTime()) {\r\n return max;\r\n }\r\n\r\n return date;\r\n}\r\n\r\n/**\r\n * given start and end date, return an (inclusive) array of all dates in between\r\n * @param start\r\n * @param end\r\n */\r\nfunction getDaysInRange(start: Date, end: Date): Date[] {\r\n const days: Date[] = [];\r\n let current = start;\r\n\r\n while (!isEqual(current, end)) {\r\n days.push(current);\r\n current = addDays(current, 1);\r\n }\r\n\r\n days.push(current);\r\n\r\n return days;\r\n}\r\n\r\n/**\r\n * given a date, return an array of dates from a calendar perspective\r\n * @param date\r\n * @param firstDayOfWeek\r\n */\r\nexport function getViewOfMonth(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date[] {\r\n const start = startOfWeek(startOfMonth(date), firstDayOfWeek);\r\n const end = endOfWeek(endOfMonth(date), firstDayOfWeek);\r\n\r\n return getDaysInRange(start, end);\r\n}\r\n","import { h, FunctionalComponent } from \"@stencil/core\";\r\nimport { isEqual, printDutchDate } from \"./date-utils\";\r\n\r\nexport type DatePickerLegacyDayProps = {\r\n focusedDay: Date;\r\n today: Date;\r\n day: Date;\r\n inRange: boolean;\r\n onDaySelect: (event: MouseEvent, day: Date) => void;\r\n onKeyboardNavigation: (event: KeyboardEvent) => void;\r\n focusedDayRef?: (element: HTMLButtonElement) => void;\r\n};\r\n\r\nexport const DatePickerLegacyDay: FunctionalComponent<DatePickerLegacyDayProps> = ({\r\n focusedDay,\r\n today,\r\n day,\r\n onDaySelect,\r\n onKeyboardNavigation,\r\n focusedDayRef,\r\n inRange,\r\n}) => {\r\n const isToday = isEqual(day, today);\r\n const isFocused = isEqual(day, focusedDay);\r\n const notCurrentMonth = day.getMonth() !== focusedDay.getMonth();\r\n const isOutsideRange = !inRange;\r\n\r\n function handleClick(e: MouseEvent) {\r\n onDaySelect(e, day);\r\n }\r\n\r\n return (\r\n <button\r\n class={{\r\n \"dso-date__day\": true,\r\n \"is-today\": isToday,\r\n }}\r\n tabIndex={isFocused ? 0 : -1}\r\n onClick={handleClick}\r\n onKeyDown={onKeyboardNavigation}\r\n disabled={isOutsideRange || notCurrentMonth}\r\n type=\"button\"\r\n ref={(el) => {\r\n if (isFocused && el && focusedDayRef) {\r\n focusedDayRef(el);\r\n }\r\n }}\r\n >\r\n <span aria-hidden=\"true\">{day.getDate()}</span>\r\n <span class=\"dso-date__vhidden\">{printDutchDate(day)}</span>\r\n </button>\r\n );\r\n};\r\n","import { h, FunctionalComponent } from \"@stencil/core\";\r\nimport { DsoLocalizedText } from \"./date-localization\";\r\nimport { DatePickerLegacyDay, DatePickerLegacyDayProps } from \"./date-picker-day\";\r\nimport { getViewOfMonth, inRange, DaysOfWeek, isEqual } from \"./date-utils\";\r\n\r\nfunction chunk<T>(array: T[], chunkSize: number): T[][] {\r\n const result = [];\r\n\r\n for (let i = 0; i < array.length; i += chunkSize) {\r\n result.push(array.slice(i, i + chunkSize));\r\n }\r\n\r\n return result;\r\n}\r\n\r\nfunction mapWithOffset<T, U>(array: T[], startingOffset: number, mapFn: (item: T) => U): U[] {\r\n return array.map((_, i) => {\r\n const adjustedIndex = (i + startingOffset) % array.length;\r\n const item = array[adjustedIndex];\r\n if (!item) {\r\n throw new Error(\"No item found\");\r\n }\r\n\r\n return mapFn(item);\r\n });\r\n}\r\n\r\ntype DatePickerLegacyMonthProps = {\r\n selectedDate: Date | undefined;\r\n focusedDate: Date;\r\n labelledById: string;\r\n localization: DsoLocalizedText;\r\n firstDayOfWeek: DaysOfWeek;\r\n min?: Date;\r\n max?: Date;\r\n onDateSelect: DatePickerLegacyDayProps[\"onDaySelect\"];\r\n onKeyboardNavigation: DatePickerLegacyDayProps[\"onKeyboardNavigation\"];\r\n focusedDayRef: (element: HTMLButtonElement) => void;\r\n onFocusIn?: (e: FocusEvent) => void;\r\n onMouseDown?: (e: MouseEvent) => void;\r\n};\r\n\r\nexport const DatePickerLegacyMonth: FunctionalComponent<DatePickerLegacyMonthProps> = ({\r\n selectedDate,\r\n focusedDate,\r\n labelledById,\r\n localization,\r\n firstDayOfWeek,\r\n min,\r\n max,\r\n onDateSelect,\r\n onKeyboardNavigation,\r\n focusedDayRef,\r\n onMouseDown,\r\n onFocusIn,\r\n}) => {\r\n const today = new Date();\r\n const days = getViewOfMonth(focusedDate, firstDayOfWeek);\r\n\r\n return (\r\n <table\r\n class=\"dso-date__table\"\r\n role=\"grid\"\r\n aria-labelledby={labelledById}\r\n onFocusin={onFocusIn}\r\n onMouseDown={onMouseDown}\r\n >\r\n <thead>\r\n <tr>\r\n {mapWithOffset(localization.dayNames, firstDayOfWeek, (dayName) => (\r\n <th class=\"dso-date__table-header\" scope=\"col\">\r\n <span aria-hidden=\"true\">{dayName.substr(0, 2)}</span>\r\n <span class=\"dso-date__vhidden\">{dayName}</span>\r\n </th>\r\n ))}\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {chunk(days, 7).map((week) => (\r\n <tr class=\"dso-date__row\">\r\n {week.map((day) => (\r\n <td\r\n class=\"dso-date__cell\"\r\n role=\"gridcell\"\r\n aria-selected={isEqual(day, selectedDate) ? \"true\" : undefined}\r\n aria-current={isEqual(day, today) ? \"date\" : undefined}\r\n >\r\n <DatePickerLegacyDay\r\n day={day}\r\n today={today}\r\n focusedDay={focusedDate}\r\n inRange={inRange(day, min, max)}\r\n onDaySelect={onDateSelect}\r\n onKeyboardNavigation={onKeyboardNavigation}\r\n focusedDayRef={focusedDayRef}\r\n />\r\n </td>\r\n ))}\r\n </tr>\r\n ))}\r\n </tbody>\r\n </table>\r\n );\r\n};\r\n","type MonthsNames = [string, string, string, string, string, string, string, string, string, string, string, string];\r\ntype DayNames = [string, string, string, string, string, string, string];\r\n\r\nexport type DsoLocalizedText = {\r\n buttonLabel: string;\r\n placeholder: string;\r\n selectedDateMessage: string;\r\n prevMonthLabel: string;\r\n nextMonthLabel: string;\r\n monthSelectLabel: string;\r\n yearSelectLabel: string;\r\n closeLabel: string;\r\n keyboardInstruction: string;\r\n calendarHeading: string;\r\n dayNames: DayNames;\r\n monthNames: MonthsNames;\r\n monthNamesShort: MonthsNames;\r\n};\r\n\r\nconst localization: DsoLocalizedText = {\r\n buttonLabel: \"Kies datum\",\r\n placeholder: \"dd-mm-jjjj\",\r\n selectedDateMessage: \"Geselecteerde datum is\",\r\n prevMonthLabel: \"Vorige maand\",\r\n nextMonthLabel: \"Volgende maand\",\r\n monthSelectLabel: \"Maand\",\r\n yearSelectLabel: \"Jaar\",\r\n closeLabel: \"Sluiten\",\r\n keyboardInstruction: \"Gebruik de pijltjestoetsen om een dag te kiezen\",\r\n calendarHeading: \"Kies een datum\",\r\n dayNames: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n monthNames: [\r\n \"Januari\",\r\n \"Februari\",\r\n \"Maart\",\r\n \"April\",\r\n \"Mei\",\r\n \"Juni\",\r\n \"Juli\",\r\n \"Augustus\",\r\n \"September\",\r\n \"Oktober\",\r\n \"November\",\r\n \"December\",\r\n ],\r\n monthNamesShort: [\"Jan\", \"Feb\", \"Mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n};\r\n\r\nexport default localization;\r\n","import { DsoLocalizedText } from \"../date-localization\";\r\n\r\nexport function monthRange(\r\n localization: DsoLocalizedText,\r\n selectedYear: number,\r\n minDate?: Date,\r\n maxDate?: Date,\r\n): string[] {\r\n if (minDate && maxDate) {\r\n const { minYear, minMonth } = { minYear: minDate.getFullYear(), minMonth: minDate.getMonth() };\r\n const { maxYear, maxMonth } = { maxYear: maxDate.getFullYear(), maxMonth: maxDate.getMonth() };\r\n\r\n return localization.monthNames.filter((_month, index) => {\r\n if (minYear === selectedYear && maxYear === selectedYear) {\r\n return index >= minMonth && index >= maxMonth;\r\n }\r\n\r\n if (minYear === selectedYear) {\r\n return index >= minMonth;\r\n }\r\n\r\n if (maxYear === selectedYear) {\r\n return index <= maxMonth;\r\n }\r\n\r\n return true;\r\n });\r\n }\r\n\r\n if (minDate) {\r\n const { minYear, minMonth } = { minYear: minDate.getFullYear(), minMonth: minDate.getMonth() };\r\n\r\n return localization.monthNames.filter((_month, index) => minYear === selectedYear && index >= minMonth);\r\n }\r\n\r\n if (maxDate) {\r\n const { maxYear, maxMonth } = { maxYear: maxDate.getFullYear(), maxMonth: maxDate.getMonth() };\r\n\r\n return localization.monthNames.filter((_month, index) => maxYear === selectedYear && index <= maxMonth);\r\n }\r\n\r\n return localization.monthNames;\r\n}\r\n","export function range(from: number, to: number) {\r\n const result: number[] = [];\r\n for (let i = from; i <= to; i++) {\r\n result.push(i);\r\n }\r\n return result;\r\n}\r\n","@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n@use \"~dso-toolkit/src/variables/zindex\";\r\n@use \"~dso-toolkit/src/components/form-control\";\r\n\r\n@use \"date-picker-legacy.variables\" as core-date-picker-legacy-variables;\r\n\r\n:host {\r\n display: block;\r\n\r\n &[invalid]:not([invalid=\"false\"]) {\r\n .dso-date__input {\r\n border-color: colors.$danger-color;\r\n }\r\n }\r\n}\r\n\r\n.dso-date *,\r\n.dso-date *::before,\r\n.dso-date *::after {\r\n box-sizing: border-box;\r\n}\r\n\r\n.dso-date {\r\n box-sizing: border-box;\r\n color: core-date-picker-legacy-variables.$color-text;\r\n display: block;\r\n font-family: core-date-picker-legacy-variables.$font;\r\n margin: 0;\r\n position: relative;\r\n text-align: left;\r\n width: 100%;\r\n\r\n &:not(.dso-visible) {\r\n .dso-date__dialog {\r\n display: none;\r\n }\r\n }\r\n}\r\n\r\n.dso-date__input {\r\n @include form-control.root();\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ TOGGLE\r\n// ---------------------------------------------\r\n\r\n.dso-date__toggle {\r\n -moz-appearance: none;\r\n -webkit-appearance: none;\r\n -webkit-user-select: none;\r\n align-items: center;\r\n appearance: none;\r\n background: core-date-picker-legacy-variables.$color-button-bg;\r\n border: 0;\r\n border-radius: 0;\r\n border-bottom-right-radius: core-date-picker-legacy-variables.$radius;\r\n border-top-right-radius: core-date-picker-legacy-variables.$radius;\r\n color: core-date-picker-legacy-variables.$color-icon;\r\n cursor: pointer;\r\n display: flex;\r\n height: core-date-picker-legacy-variables.$size;\r\n justify-content: center;\r\n padding: 0;\r\n position: absolute;\r\n right: 0;\r\n transform: translateY(-50%);\r\n top: 50%;\r\n user-select: none;\r\n width: core-date-picker-legacy-variables.$size;\r\n z-index: zindex.$datepicker + 1;\r\n\r\n &:disabled {\r\n color: core-date-picker-legacy-variables.$nav-button-disabled;\r\n cursor: default;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ DIALOG\r\n// ---------------------------------------------\r\n\r\n.dso-date__dialog {\r\n border-width: core-date-picker-legacy-variables.$border-width;\r\n display: flex;\r\n right: 0;\r\n min-width: 320px;\r\n opacity: 0;\r\n position: absolute;\r\n top: 100%;\r\n transform: scale(0.96) translateZ(0) translateY(-20px);\r\n transform-origin: top right;\r\n transition:\r\n transform 300ms ease,\r\n opacity 300ms ease,\r\n visibility 300ms ease;\r\n visibility: hidden;\r\n will-change: transform, opacity, visibility;\r\n z-index: zindex.$datepicker-dialog;\r\n\r\n @media (max-width: 35.9375em) {\r\n background: core-date-picker-legacy-variables.$overlay;\r\n bottom: 0;\r\n position: fixed;\r\n left: 0;\r\n right: 0;\r\n top: 0;\r\n transform: translateZ(0);\r\n transform-origin: bottom center;\r\n }\r\n\r\n &.is-left {\r\n left: units.$padding-base-horizontal * -1 + core-date-picker-legacy-variables.$border-width;\r\n right: auto;\r\n width: auto;\r\n }\r\n\r\n &.is-active {\r\n opacity: 1;\r\n // The value of 1.0001 fixes a Chrome glitch with scaling\r\n transform: scale(1.0001) translateZ(0) translateY(0);\r\n visibility: visible;\r\n }\r\n}\r\n\r\n.dso-date__dialog-content {\r\n background: core-date-picker-legacy-variables.$surface;\r\n border: 1px solid rgba(0, 0, 0, 0.1);\r\n border-radius: core-date-picker-legacy-variables.$radius;\r\n box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.4);\r\n margin-left: auto;\r\n margin-right: -1px;\r\n margin-top: 8px;\r\n max-width: 310px;\r\n min-width: 290px;\r\n padding: 16px;\r\n position: relative;\r\n transform: none;\r\n width: 100%;\r\n z-index: zindex.$datepicker-dialog;\r\n\r\n @media (max-width: 35.9375em) {\r\n border: 0;\r\n border-radius: 0;\r\n border-top-left-radius: core-date-picker-legacy-variables.$radius;\r\n border-top-right-radius: core-date-picker-legacy-variables.$radius;\r\n bottom: 0;\r\n left: 0;\r\n margin: 0;\r\n max-width: none;\r\n min-height: 26em;\r\n opacity: 0;\r\n padding: 0 8% 20px;\r\n position: absolute;\r\n transform: translateZ(0) translateY(100%);\r\n transition:\r\n transform core-date-picker-legacy-variables.$transition-duration ease,\r\n opacity core-date-picker-legacy-variables.$transition-duration ease,\r\n visibility core-date-picker-legacy-variables.$transition-duration ease;\r\n visibility: hidden;\r\n will-change: transform, opacity, visibility;\r\n\r\n .is-active & {\r\n opacity: 1;\r\n transform: translateZ(0) translateY(0);\r\n visibility: visible;\r\n }\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ TABLE\r\n// ---------------------------------------------\r\n\r\n.dso-date__table {\r\n border-collapse: collapse;\r\n border-spacing: 0;\r\n color: core-date-picker-legacy-variables.$color-text;\r\n font-size: 1rem;\r\n font-weight: core-date-picker-legacy-variables.$font-normal;\r\n line-height: 1.25;\r\n min-width: (core-date-picker-legacy-variables.$size + 2) * 7;\r\n table-layout: fixed;\r\n text-align: center;\r\n width: 100%;\r\n}\r\n\r\n.dso-date__table-header {\r\n font-size: 0.875em;\r\n font-weight: core-date-picker-legacy-variables.$font-bold;\r\n height: 36px;\r\n line-height: 36px;\r\n text-align: center;\r\n text-decoration: none;\r\n text-transform: uppercase;\r\n}\r\n\r\n.dso-date__cell {\r\n height: core-date-picker-legacy-variables.$size + 2;\r\n padding: 1px;\r\n text-align: center;\r\n width: core-date-picker-legacy-variables.$size + 2;\r\n}\r\n\r\n.dso-date__day {\r\n -moz-appearance: none;\r\n -webkit-appearance: none;\r\n appearance: none;\r\n background: transparent;\r\n border: 0;\r\n border-radius: 50%;\r\n box-shadow: 0 0 0 1px transparent;\r\n color: core-date-picker-legacy-variables.$color-text;\r\n cursor: pointer;\r\n display: inline-block;\r\n font-family: core-date-picker-legacy-variables.$font;\r\n font-variant-numeric: tabular-nums;\r\n font-weight: core-date-picker-legacy-variables.$font-normal;\r\n height: core-date-picker-legacy-variables.$size;\r\n line-height: 0;\r\n padding: 0;\r\n position: relative;\r\n text-align: center;\r\n vertical-align: middle;\r\n width: core-date-picker-legacy-variables.$size;\r\n z-index: zindex.$datepicker;\r\n\r\n &.is-today {\r\n background: transparent;\r\n height: core-date-picker-legacy-variables.$size - 2;\r\n box-shadow: 0 0 0 1px core-date-picker-legacy-variables.$color-button;\r\n width: core-date-picker-legacy-variables.$size - 2;\r\n }\r\n\r\n &:hover,\r\n &:active {\r\n background: core-date-picker-legacy-variables.$color-button;\r\n color: core-date-picker-legacy-variables.$color-text-active;\r\n }\r\n\r\n &:focus {\r\n background: transparent;\r\n box-shadow: 0 0 0 2px colors.$bosgroen;\r\n color: core-date-picker-legacy-variables.$color-text;\r\n height: core-date-picker-legacy-variables.$size - 4;\r\n outline: 0;\r\n width: core-date-picker-legacy-variables.$size - 4;\r\n }\r\n\r\n [aria-selected=\"true\"] & {\r\n background: core-date-picker-legacy-variables.$color-button;\r\n color: core-date-picker-legacy-variables.$color-text-active;\r\n\r\n &:focus {\r\n background: transparent;\r\n\r\n span[aria-hidden=\"true\"] {\r\n background: core-date-picker-legacy-variables.$color-button;\r\n border: 1px solid colors.$wit;\r\n line-height: core-date-picker-legacy-variables.$size - 6;\r\n }\r\n }\r\n }\r\n\r\n &:disabled {\r\n background: colors.$wit;\r\n color: core-date-picker-legacy-variables.$color-text-disabled;\r\n cursor: default;\r\n }\r\n\r\n span[aria-hidden=\"true\"] {\r\n border-radius: 50%;\r\n display: inline-block;\r\n height: core-date-picker-legacy-variables.$size - 4;\r\n line-height: core-date-picker-legacy-variables.$size - 4;\r\n width: core-date-picker-legacy-variables.$size - 4;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ HEADER\r\n// ---------------------------------------------\r\n\r\n.dso-date__header {\r\n align-items: center;\r\n display: flex;\r\n justify-content: space-between;\r\n margin-bottom: 16px;\r\n width: 100%;\r\n\r\n span {\r\n font-size: 0.875rem;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ NAVIGATION\r\n// ---------------------------------------------\r\n\r\n.dso-date__nav {\r\n white-space: nowrap; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n}\r\n\r\n.dso-date__prev,\r\n.dso-date__next {\r\n -moz-appearance: none;\r\n -webkit-appearance: none;\r\n align-items: center;\r\n appearance: none;\r\n background: core-date-picker-legacy-variables.$color-button-bg;\r\n border: 1px solid core-date-picker-legacy-variables.$color-button;\r\n border-radius: core-date-picker-legacy-variables.$radius;\r\n box-sizing: border-box;\r\n color: core-date-picker-legacy-variables.$color-button;\r\n cursor: pointer;\r\n display: inline-flex;\r\n font-size: 1em;\r\n height: 32px;\r\n justify-content: center;\r\n margin-left: 8px;\r\n padding: 0;\r\n width: 32px;\r\n\r\n @media (max-width: 35.9375em) {\r\n height: 40px;\r\n width: 40px;\r\n }\r\n\r\n &:hover,\r\n &:active {\r\n background-color: core-date-picker-legacy-variables.$color-button;\r\n color: core-date-picker-legacy-variables.$color-text-active;\r\n }\r\n\r\n &:focus {\r\n background: core-date-picker-legacy-variables.$color-button-bg;\r\n color: core-date-picker-legacy-variables.$color-button;\r\n }\r\n\r\n &:disabled {\r\n &,\r\n &:hover {\r\n background-color: colors.$wit;\r\n border-color: core-date-picker-legacy-variables.$nav-button-disabled;\r\n color: core-date-picker-legacy-variables.$nav-button-disabled;\r\n opacity: 1;\r\n }\r\n }\r\n\r\n svg {\r\n margin: 0 auto;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ SELECT\r\n// ---------------------------------------------\r\n\r\n.dso-date__select {\r\n display: inline-flex;\r\n height: units.$u1 * 4 - 4;\r\n line-height: units.$u1 * 4 - 4;\r\n position: relative;\r\n\r\n span {\r\n margin-right: 4px;\r\n }\r\n\r\n select {\r\n color: core-date-picker-legacy-variables.$color-primary;\r\n cursor: pointer;\r\n font-size: 1rem;\r\n height: 100%;\r\n left: 0;\r\n opacity: 0;\r\n position: absolute;\r\n top: 0;\r\n width: 100%;\r\n z-index: zindex.$datepicker + 1;\r\n\r\n &:focus + .dso-date__select-label {\r\n box-shadow: 0 0 0 2px core-date-picker-legacy-variables.$color-primary;\r\n }\r\n\r\n &:disabled {\r\n color: core-date-picker-legacy-variables.$nav-button-disabled;\r\n }\r\n }\r\n}\r\n\r\n.dso-date__select-label {\r\n align-items: center;\r\n border-radius: core-date-picker-legacy-variables.$radius;\r\n color: core-date-picker-legacy-variables.$select;\r\n display: flex;\r\n padding: 0 4px 0 8px;\r\n pointer-events: none;\r\n position: relative;\r\n width: 100%;\r\n z-index: zindex.$datepicker;\r\n\r\n span {\r\n font-size: 1.25rem;\r\n font-weight: core-date-picker-legacy-variables.$font-bold;\r\n line-height: 1.25;\r\n }\r\n\r\n svg {\r\n width: 16px;\r\n height: 16px;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ MOBILE\r\n// ---------------------------------------------\r\n\r\n.dso-date__mobile {\r\n align-items: center;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\r\n display: flex;\r\n font-size: 1em;\r\n justify-content: space-between;\r\n margin-bottom: 20px;\r\n margin-left: -10%;\r\n overflow: hidden;\r\n padding: 12px 20px;\r\n position: relative;\r\n text-overflow: ellipsis; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n white-space: nowrap; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n width: 120%;\r\n\r\n @media (min-width: 36em) {\r\n border: 0;\r\n margin: 0;\r\n overflow: visible;\r\n padding: 0;\r\n position: absolute;\r\n right: -16px;\r\n top: -16px;\r\n width: auto;\r\n }\r\n}\r\n\r\n.dso-date__mobile-heading {\r\n display: inline-block;\r\n font-weight: core-date-picker-legacy-variables.$font-bold;\r\n max-width: 84%;\r\n overflow: hidden;\r\n text-overflow: ellipsis; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n white-space: nowrap; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n\r\n @media (min-width: 36em) {\r\n display: none;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ CLOSE\r\n// ---------------------------------------------\r\n\r\n.dso-date__close {\r\n -webkit-appearance: none;\r\n align-items: center;\r\n appearance: none;\r\n background-color: colors.$wit;\r\n border: 0;\r\n border-radius: 50%;\r\n color: core-date-picker-legacy-variables.$color-icon;\r\n cursor: pointer;\r\n display: flex;\r\n font-size: 1em;\r\n height: units.$u1 * 4;\r\n justify-content: center;\r\n margin-right: -4px;\r\n padding: 0;\r\n width: units.$u1 * 4;\r\n\r\n @media (min-width: 36em) {\r\n margin-right: 0;\r\n opacity: 0;\r\n }\r\n\r\n &:focus {\r\n box-shadow: 0 0 0 2px colors.$bosgroen;\r\n outline: none;\r\n\r\n @media (min-width: 36em) {\r\n opacity: 1;\r\n }\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ VISUALLY HIDDEN\r\n// ---------------------------------------------\r\n\r\n.dso-date__vhidden {\r\n border: 0;\r\n clip: rect(1px, 1px, 1px, 1px);\r\n height: 1px;\r\n overflow: hidden;\r\n padding: 0;\r\n position: absolute;\r\n top: 0;\r\n width: 1px;\r\n}\r\n","import {\r\n Component,\r\n ComponentInterface,\r\n Host,\r\n Prop,\r\n Element,\r\n h,\r\n Event,\r\n EventEmitter,\r\n State,\r\n Listen,\r\n Method,\r\n} from \"@stencil/core\";\r\n\r\nimport { createIdentifier } from \"../../utils/create-identifier\";\r\nimport {\r\n addDays,\r\n startOfWeek,\r\n endOfWeek,\r\n setMonth,\r\n setYear,\r\n clamp,\r\n inRange,\r\n endOfMonth,\r\n startOfMonth,\r\n printDutchDate,\r\n parseDutchDate,\r\n DaysOfWeek,\r\n} from \"./date-utils\";\r\nimport { DatePickerLegacyMonth } from \"./date-picker-month\";\r\nimport defaultLocalization, { DsoLocalizedText } from \"./date-localization\";\r\nimport {\r\n DsoDatePickerLegacyDirection,\r\n DsoDatePickerLegacyChangeEvent,\r\n DsoDatePickerLegacyFocusEvent,\r\n DsoDatePickerLegacyKeyboardEvent,\r\n} from \"./date-picker-legacy.interfaces\";\r\nimport { monthRange } from \"./utils/month-range\";\r\nimport { range } from \"./utils/range\";\r\n\r\nconst keyCode = {\r\n TAB: 9,\r\n ESC: 27,\r\n SPACE: 32,\r\n PAGE_UP: 33,\r\n PAGE_DOWN: 34,\r\n END: 35,\r\n HOME: 36,\r\n LEFT: 37,\r\n UP: 38,\r\n RIGHT: 39,\r\n DOWN: 40,\r\n};\r\n\r\nconst DISALLOWED_CHARACTERS = /[^0-9-]+/g;\r\nconst TRANSITION_MS = 300;\r\n\r\nfunction cleanValue(input: HTMLInputElement, regex: RegExp): string {\r\n const value = input.value;\r\n const cursor = input.selectionStart;\r\n\r\n if (!cursor) {\r\n return value;\r\n }\r\n\r\n const beforeCursor = value.slice(0, cursor);\r\n const afterCursor = value.slice(cursor, value.length);\r\n\r\n const filteredBeforeCursor = beforeCursor.replace(regex, \"\");\r\n const filterAfterCursor = afterCursor.replace(regex, \"\");\r\n\r\n const newValue = filteredBeforeCursor + filterAfterCursor;\r\n const newCursor = filteredBeforeCursor.length;\r\n\r\n input.value = newValue;\r\n input.selectionStart = input.selectionEnd = newCursor;\r\n\r\n return newValue;\r\n}\r\n\r\n@Component({\r\n tag: \"dso-date-picker-legacy\",\r\n styleUrl: \"date-picker-legacy.scss\",\r\n shadow: false,\r\n scoped: true,\r\n})\r\nexport class DsoDatePickerLegacy implements ComponentInterface {\r\n /**\r\n * Own Properties\r\n */\r\n private monthSelectId = createIdentifier(\"DsoDateMonth\");\r\n private yearSelectId = createIdentifier(\"DsoDateYear\");\r\n private dialogLabelId = createIdentifier(\"DsoDateLabel\");\r\n\r\n private datePickerLegacyButton: HTMLButtonElement | undefined;\r\n private datePickerLegacyInput: HTMLInputElement | undefined;\r\n private firstFocusableElement: HTMLElement | undefined;\r\n private monthSelectNode: HTMLElement | undefined;\r\n private focusedDayNode: HTMLButtonElement | undefined;\r\n\r\n private focusTimeoutId: ReturnType<typeof setTimeout> | undefined;\r\n private hideTimeoutId: ReturnType<typeof setTimeout> | undefined;\r\n\r\n private initialTouchX: number | undefined;\r\n private initialTouchY: number | undefined;\r\n\r\n private localization: DsoLocalizedText = defaultLocalization;\r\n private firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday;\r\n\r\n private previousValue: string | undefined;\r\n\r\n /**\r\n * Reference to host HTML element.\r\n */\r\n @Element()\r\n element!: HTMLDsoDatePickerLegacyElement;\r\n\r\n /**\r\n * State() variables\r\n */\r\n @State()\r\n activeFocus = false;\r\n\r\n @State()\r\n focusedDay = new Date();\r\n\r\n @State()\r\n open = false;\r\n\r\n @State()\r\n visible = false;\r\n\r\n /**\r\n * Public Property API\r\n */\r\n\r\n /**\r\n * Name of the date picker input.\r\n */\r\n @Prop()\r\n name = \"date\";\r\n\r\n /**\r\n * Adds a unique identifier for the date picker input. Use this instead of html `id` attribute.\r\n */\r\n @Prop()\r\n identifier: string | undefined;\r\n\r\n /**\r\n * Makes the date picker input component disabled. This prevents users from being able to\r\n * interact with the input, and conveys its inactive state to assistive technologies.\r\n */\r\n @Prop({ reflect: true })\r\n disabled = false;\r\n\r\n /**\r\n * Defines a specific role attribute for the date picker input.\r\n */\r\n @Prop()\r\n // eslint-disable-next-line @stencil-community/reserved-member-names\r\n role: string | null = null;\r\n\r\n /**\r\n * Forces the opening direction of the calendar modal to be always left or right.\r\n * This setting can be useful when the input is smaller than the opening date picker\r\n * would be as by default the picker always opens towards right.\r\n */\r\n @Prop()\r\n direction: DsoDatePickerLegacyDirection = \"right\";\r\n\r\n /**\r\n * Should the input be marked as required?\r\n */\r\n @Prop()\r\n required = false;\r\n\r\n /**\r\n * Is input invalid?\r\n */\r\n @Prop({ reflect: true })\r\n invalid?: boolean;\r\n\r\n /**\r\n * ID of element that describes the input element\r\n */\r\n @Prop()\r\n describedBy?: string;\r\n\r\n /**\r\n * Should the input be focused on load?\r\n */\r\n @Prop()\r\n dsoAutofocus = false;\r\n\r\n /**\r\n * Date value. Must be in Dutch date format: DD-MM-YYYY.\r\n */\r\n @Prop({ reflect: true, mutable: true })\r\n value = \"\";\r\n\r\n /**\r\n * Minimum date allowed to be picked. Must be in Dutch date format: DD-MM-YYYY.\r\n * This setting can be used alone or together with the max property.\r\n */\r\n @Prop()\r\n min: string | undefined;\r\n\r\n /**\r\n * Maximum date allowed to be picked. Must be in Dutch date format: DD-MM-YYYY.\r\n * This setting can be used alone or together with the min property.\r\n */\r\n @Prop()\r\n max: string | undefined;\r\n\r\n /**\r\n * Events section.\r\n */\r\n\r\n /**\r\n * Event emitted when a date is selected.\r\n */\r\n @Event()\r\n dsoDateChange!: EventEmitter<DsoDatePickerLegacyChangeEvent>;\r\n\r\n /**\r\n * Event emitted the date picker input is blurred.\r\n */\r\n @Event()\r\n dsoBlur!: EventEmitter<DsoDatePickerLegacyFocusEvent>;\r\n\r\n /**\r\n * Event emitted on key up in the date picker input.\r\n */\r\n @Event()\r\n dsoKeyUp!: EventEmitter<DsoDatePickerLegacyKeyboardEvent>;\r\n\r\n /**\r\n * Event emitted on key down in the date picker input.\r\n */\r\n @Event()\r\n dsoKeyDown!: EventEmitter<DsoDatePickerLegacyKeyboardEvent>;\r\n\r\n /**\r\n * Event emitted the date picker input is focused.\r\n */\r\n @Event()\r\n dsoFocus!: EventEmitter<DsoDatePickerLegacyFocusEvent>;\r\n\r\n /**\r\n * Component event handling.\r\n */\r\n @Listen(\"click\", { target: \"document\", capture: true })\r\n handleDocumentClick(e: MouseEvent) {\r\n if (!this.open) {\r\n return;\r\n }\r\n\r\n const path = e.composedPath();\r\n\r\n for (const target of path) {\r\n if (target instanceof Node && this.element.contains(target)) {\r\n return;\r\n }\r\n }\r\n\r\n this.hide(false);\r\n }\r\n\r\n /**\r\n * Sets focus on the date picker's input. Use this method instead of the global `focus()`.\r\n */\r\n @Method()\r\n async setFocus() {\r\n return this.datePickerLegacyInput?.focus();\r\n }\r\n\r\n /**\r\n * Public methods API\r\n */\r\n\r\n /**\r\n * Show the calendar modal, moving focus to the calendar inside.\r\n */\r\n @Method()\r\n async show() {\r\n if (typeof this.hideTimeoutId !== \"undefined\") {\r\n clearTimeout(this.hideTimeoutId);\r\n }\r\n\r\n this.visible = true;\r\n\r\n setTimeout(() => {\r\n this.open = true;\r\n this.setFocusedDay(parseDutchDate(this.value) || new Date());\r\n\r\n if (typeof this.focusTimeoutId !== \"undefined\") {\r\n clearTimeout(this.focusTimeoutId);\r\n }\r\n\r\n this.focusTimeoutId = setTimeout(() => this.monthSelectNode?.focus(), TRANSITION_MS);\r\n });\r\n }\r\n\r\n /**\r\n * Hide the calendar modal. Set `moveFocusToButton` to false to prevent focus\r\n * returning to the date picker's button. Default is true.\r\n */\r\n @Method()\r\n async hide(moveFocusToButton = true) {\r\n this.open = false;\r\n\r\n // in cases where calendar is quickly shown and hidden\r\n // we should avoid moving focus to the button\r\n if (typeof this.focusTimeoutId !== \"undefined\") {\r\n clearTimeout(this.focusTimeoutId);\r\n }\r\n\r\n this.hideTimeoutId = setTimeout(() => {\r\n if (moveFocusToButton && this.datePickerLegacyButton) {\r\n this.datePickerLegacyButton.focus();\r\n }\r\n\r\n this.visible = false;\r\n }, TRANSITION_MS + 200);\r\n }\r\n\r\n /**\r\n * Local methods.\r\n */\r\n private enableActiveFocus = () => {\r\n this.activeFocus = true;\r\n };\r\n\r\n private disableActiveFocus = () => {\r\n this.activeFocus = false;\r\n };\r\n\r\n private addDays(days: number) {\r\n this.setFocusedDay(addDays(this.focusedDay, days));\r\n }\r\n\r\n private addMonths(months: number) {\r\n this.setMonth(this.focusedDay.getMonth() + months);\r\n }\r\n\r\n private addYears(years: number) {\r\n this.setYear(this.focusedDay.getFullYear() + years);\r\n }\r\n\r\n private startOfWeek() {\r\n this.setFocusedDay(startOfWeek(this.focusedDay, this.firstDayOfWeek));\r\n }\r\n\r\n private endOfWeek() {\r\n this.setFocusedDay(endOfWeek(this.focusedDay, this.firstDayOfWeek));\r\n }\r\n\r\n private setMonth(month: number) {\r\n const min = setMonth(startOfMonth(this.focusedDay), month);\r\n const max = endOfMonth(min);\r\n const date = setMonth(this.focusedDay, month);\r\n\r\n this.setFocusedDay(clamp(date, min, max));\r\n }\r\n\r\n private setYear(year: number) {\r\n const min = setYear(startOfMonth(this.focusedDay), year);\r\n const max = endOfMonth(min);\r\n const date = setYear(this.focusedDay, year);\r\n\r\n this.setFocusedDay(clamp(date, min, max));\r\n }\r\n\r\n private setFocusedDay(day: Date) {\r\n this.focusedDay = clamp(day, parseDutchDate(this.min), parseDutchDate(this.max));\r\n }\r\n\r\n private toggleOpen = (e: Event) => {\r\n e.preventDefault();\r\n this.open ? this.hide(false) : this.show();\r\n };\r\n\r\n private handleEscKey = (event: KeyboardEvent) => {\r\n if (event.keyCode === keyCode.ESC) {\r\n this.hide();\r\n }\r\n };\r\n\r\n private handleBlur = (event: Event) => {\r\n event.stopPropagation();\r\n\r\n this.dsoBlur.emit({\r\n component: \"dso-date-picker-legacy\",\r\n });\r\n };\r\n\r\n private handleKeyUp = (event: KeyboardEvent) => {\r\n event.stopPropagation();\r\n\r\n this.dsoKeyUp.emit({\r\n component: \"dso-date-picker-legacy\",\r\n originalEvent: event,\r\n });\r\n };\r\n\r\n private handleKeyDown = (event: KeyboardEvent) => {\r\n event.stopPropagation();\r\n\r\n this.dsoKeyDown.emit({\r\n component: \"dso-date-picker-legacy\",\r\n originalEvent: event,\r\n });\r\n };\r\n\r\n private handleFocus = (event: Event) => {\r\n event.stopPropagation();\r\n\r\n this.dsoFocus.emit({\r\n component: \"dso-date-picker-legacy\",\r\n });\r\n };\r\n\r\n private handleTouchStart = (event: TouchEvent) => {\r\n const touch = event.changedTouches[0];\r\n if (!touch) {\r\n throw new Error(\"No touch found\");\r\n }\r\n\r\n this.initialTouchX = touch.pageX;\r\n this.initialTouchY = touch.pageY;\r\n };\r\n\r\n private handleTouchMove = (event: TouchEvent) => {\r\n event.preventDefault();\r\n };\r\n\r\n private handleTouchEnd = (event: TouchEvent) => {\r\n const touch = event.changedTouches[0];\r\n if (!touch) {\r\n throw new Error(\"No touch found\");\r\n }\r\n\r\n const distX = touch.pageX - (this.initialTouchX ?? 0); // get horizontal dist traveled\r\n const distY = touch.pageY - (this.initialTouchY ?? 0); // get vertical dist traveled\r\n const threshold = 70;\r\n\r\n const isHorizontalSwipe = Math.abs(distX) >= threshold && Math.abs(distY) <= threshold;\r\n const isDownwardsSwipe = Math.abs(distY) >= threshold && Math.abs(distX) <= threshold && distY > 0;\r\n\r\n if (isHorizontalSwipe) {\r\n this.addMonths(distX < 0 ? 1 : -1);\r\n } else if (isDownwardsSwipe) {\r\n this.hide(false);\r\n event.preventDefault();\r\n }\r\n\r\n this.initialTouchY = undefined;\r\n this.initialTouchX = undefined;\r\n };\r\n\r\n private handleNextMonthClick = (event: MouseEvent) => {\r\n event.preventDefault();\r\n this.addMonths(1);\r\n };\r\n\r\n private handlePreviousMonthClick = (event: MouseEvent) => {\r\n event.preventDefault();\r\n this.addMonths(-1);\r\n };\r\n\r\n private handleFirstFocusableKeydown = (event: KeyboardEvent) => {\r\n // this ensures focus is trapped inside the dialog\r\n if (event.keyCode === keyCode.TAB && event.shiftKey) {\r\n this.focusedDayNode?.focus();\r\n event.preventDefault();\r\n }\r\n };\r\n\r\n private handleKeyboardNavigation = (event: KeyboardEvent) => {\r\n // handle tab separately, since it needs to be treated\r\n // differently to other keyboard interactions\r\n if (event.keyCode === keyCode.TAB && !event.shiftKey) {\r\n event.preventDefault();\r\n this.firstFocusableElement?.focus();\r\n return;\r\n }\r\n\r\n let handled = true;\r\n\r\n switch (event.keyCode) {\r\n case keyCode.RIGHT:\r\n this.addDays(1);\r\n break;\r\n case keyCode.LEFT:\r\n this.addDays(-1);\r\n break;\r\n case keyCode.DOWN:\r\n this.addDays(7);\r\n break;\r\n case keyCode.UP:\r\n this.addDays(-7);\r\n break;\r\n case keyCode.PAGE_UP:\r\n if (event.shiftKey) {\r\n this.addYears(-1);\r\n } else {\r\n this.addMonths(-1);\r\n }\r\n break;\r\n case keyCode.PAGE_DOWN:\r\n if (event.shiftKey) {\r\n this.addYears(1);\r\n } else {\r\n this.addMonths(1);\r\n }\r\n break;\r\n case keyCode.HOME:\r\n this.startOfWeek();\r\n break;\r\n case keyCode.END:\r\n this.endOfWeek();\r\n break;\r\n default:\r\n handled = false;\r\n }\r\n\r\n if (handled) {\r\n event.preventDefault();\r\n this.enableActiveFocus();\r\n }\r\n };\r\n\r\n private handleDaySelect = (_event: MouseEvent, day: Date) => {\r\n if (!inRange(day, parseDutchDate(this.min), parseDutchDate(this.max))) {\r\n return;\r\n }\r\n\r\n if (day.getMonth() === this.focusedDay.getMonth()) {\r\n this.setValue(day);\r\n this.hide();\r\n } else {\r\n this.setFocusedDay(day);\r\n }\r\n };\r\n\r\n private handleMonthSelect = (e: Event) => {\r\n // Todo\r\n if (e.target instanceof HTMLSelectElement) {\r\n this.setMonth(parseInt(e.target.value, 10));\r\n }\r\n };\r\n\r\n private handleYearSelect = (e: Event) => {\r\n if (e.target instanceof HTMLSelectElement) {\r\n this.setYear(parseInt(e.target.value, 10));\r\n }\r\n };\r\n\r\n private handleInputChange = (e: Event) => {\r\n const target = e.target as HTMLInputElement;\r\n\r\n const cleanedValue = cleanValue(target, DISALLOWED_CHARACTERS);\r\n\r\n this.setValue(cleanedValue);\r\n };\r\n\r\n private setValue(value: Date | string) {\r\n const event = this.prepareEvent(value);\r\n\r\n this.value = typeof value === \"string\" ? value : event.value;\r\n\r\n if (this.value !== this.previousValue) {\r\n this.dsoDateChange.emit(event);\r\n this.previousValue = this.value;\r\n }\r\n }\r\n\r\n private prepareEvent = (value: Date | string): DsoDatePickerLegacyChangeEvent => {\r\n const event: DsoDatePickerLegacyChangeEvent = {\r\n component: \"dso-date-picker-legacy\",\r\n value: \"\",\r\n valueAsDate: undefined,\r\n };\r\n\r\n if (value instanceof Date) {\r\n event.valueAsDate = value;\r\n } else {\r\n event.value = value;\r\n event.valueAsDate = parseDutchDate(value);\r\n }\r\n\r\n if (event.valueAsDate) {\r\n event.value = printDutchDate(event.valueAsDate);\r\n }\r\n\r\n if (!event.valueAsDate && this.required) {\r\n event.error = \"required\";\r\n }\r\n\r\n if (event.value && !event.valueAsDate) {\r\n event.error = \"invalid\";\r\n }\r\n\r\n if (event.valueAsDate && (this.min || this.max)) {\r\n const min = parseDutchDate(this.min);\r\n const max = parseDutchDate(this.max);\r\n const clampValue = clamp(event.valueAsDate, min, max);\r\n\r\n if (clampValue !== event.valueAsDate && clampValue === min) {\r\n event.valueAsDate = undefined;\r\n event.error = \"min-range\";\r\n } else if (clampValue !== event.valueAsDate && clampValue === max) {\r\n event.valueAsDate = undefined;\r\n event.error = \"max-range\";\r\n }\r\n }\r\n\r\n return event;\r\n };\r\n\r\n private processFocusedDayNode = (element: HTMLButtonElement) => {\r\n this.focusedDayNode = element;\r\n\r\n if (this.activeFocus && this.open) {\r\n setTimeout(() => element.focus(), 0);\r\n }\r\n };\r\n\r\n componentWillLoad(): void | Promise<void> {\r\n const minDate = parseDutchDate(this.min);\r\n const maxDate = parseDutchDate(this.max);\r\n\r\n if (minDate && minDate > this.focusedDay) {\r\n this.focusedDay = minDate;\r\n }\r\n\r\n if (maxDate && maxDate < this.focusedDay) {\r\n this.focusedDay = maxDate;\r\n }\r\n }\r\n\r\n componentDidLoad() {\r\n const valueAsDate = parseDutchDate(this.value);\r\n if (valueAsDate) {\r\n this.previousValue = this.value = printDutchDate(valueAsDate);\r\n }\r\n\r\n if (this.dsoAutofocus) {\r\n this.setFocus();\r\n }\r\n }\r\n\r\n /**\r\n * render() function\r\n * Always the last one in the class.\r\n */\r\n render() {\r\n const valueAsDate = parseDutchDate(this.value);\r\n const formattedDate = valueAsDate && printDutchDate(valueAsDate);\r\n const selectedYear = (valueAsDate || this.focusedDay).getFullYear();\r\n const focusedMonth = this.focusedDay.getMonth();\r\n const focusedYear = this.focusedDay.getFullYear();\r\n\r\n const minDate = parseDutchDate(this.min);\r\n const maxDate = parseDutchDate(this.max);\r\n const prevMonthDisabled = minDate && minDate.getMonth() === focusedMonth && minDate.getFullYear() === focusedYear;\r\n const nextMonthDisabled = maxDate && maxDate.getMonth() === focusedMonth && maxDate.getFullYear() === focusedYear;\r\n\r\n let minYear = selectedYear - 10;\r\n let maxYear = selectedYear + 10;\r\n if (minDate) {\r\n minYear = Math.max(minYear, minDate.getFullYear());\r\n }\r\n if (maxDate) {\r\n maxYear = Math.min(maxYear, maxDate.getFullYear());\r\n }\r\n\r\n return (\r\n <Host>\r\n <div class={{ \"dso-date\": true, \"dso-visible\": this.visible }}>\r\n <div class=\"dso-date__input-wrapper\">\r\n <input\r\n class=\"dso-date__input\"\r\n value={this.value}\r\n placeholder={this.localization.placeholder}\r\n id={this.identifier}\r\n disabled={this.disabled}\r\n role={this.role ?? undefined}\r\n required={this.required ? true : undefined}\r\n aria-autocomplete=\"none\"\r\n aria-invalid={this.invalid?.toString()}\r\n aria-describedby={this.describedBy}\r\n onInput={this.handleInputChange}\r\n onFocus={this.handleFocus}\r\n onBlur={this.handleBlur}\r\n onKeyUp={this.handleKeyUp}\r\n onKeyDown={this.handleKeyDown}\r\n autoComplete=\"off\"\r\n ref={(element) => (this.datePickerLegacyInput = element)}\r\n />\r\n <button\r\n type=\"button\"\r\n class=\"dso-date__toggle\"\r\n onClick={this.toggleOpen}\r\n disabled={this.disabled}\r\n ref={(element) => (this.datePickerLegacyButton = element)}\r\n >\r\n <span class=\"dso-date__toggle-icon\">\r\n <dso-icon icon=\"calendar\"></dso-icon>\r\n </span>\r\n <span class=\"dso-date__vhidden\">\r\n {this.localization.buttonLabel}\r\n {formattedDate && (\r\n <span>\r\n , {this.localization.selectedDateMessage} {formattedDate}\r\n </span>\r\n )}\r\n </span>\r\n </button>\r\n </div>\r\n\r\n <div\r\n class={{\r\n \"dso-date__dialog\": true,\r\n \"is-left\": this.direction === \"left\",\r\n \"is-active\": this.open,\r\n }}\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n aria-hidden={this.open ? \"false\" : \"true\"}\r\n aria-labelledby={this.dialogLabelId}\r\n onTouchMove={this.handleTouchMove}\r\n onTouchStart={this.handleTouchStart}\r\n onTouchEnd={this.handleTouchEnd}\r\n >\r\n <div class=\"dso-date__dialog-content\" onKeyDown={this.handleEscKey}>\r\n <div class=\"dso-date__vhidden dso-date__instructions\" aria-live=\"polite\">\r\n {this.localization.keyboardInstruction}\r\n </div>\r\n <div class=\"dso-date__mobile\" onFocusin={this.disableActiveFocus}>\r\n <label class=\"dso-date__mobile-heading\">{this.localization.calendarHeading}</label>\r\n <button\r\n class=\"dso-date__close\"\r\n ref={(element) => (this.firstFocusableElement = element)}\r\n onKeyDown={this.handleFirstFocusableKeydown}\r\n onClick={() => this.hide()}\r\n type=\"button\"\r\n >\r\n <dso-icon icon=\"times\"></dso-icon>\r\n <span class=\"dso-date__vhidden\">{this.localization.closeLabel}</span>\r\n </button>\r\n </div>\r\n <div class=\"dso-date__header\" onFocusin={this.disableActiveFocus}>\r\n <div>\r\n <h2 id={this.dialogLabelId} class=\"dso-date__vhidden\" aria-live=\"polite\">\r\n {this.localization.monthNames[focusedMonth]} {this.focusedDay.getFullYear()}\r\n </h2>\r\n\r\n <label htmlFor={this.monthSelectId} class=\"dso-date__vhidden\">\r\n {this.localization.monthSelectLabel}\r\n </label>\r\n <div class=\"dso-date__select\">\r\n <select\r\n id={this.monthSelectId}\r\n class=\"dso-date__select--month\"\r\n ref={(element) => (this.monthSelectNode = element)}\r\n onChange={this.handleMonthSelect}\r\n >\r\n {monthRange(this.localization, selectedYear, minDate, maxDate).map((month) => {\r\n const index = this.localization.monthNames.indexOf(month);\r\n\r\n return (\r\n <option key={month} value={index} selected={index === focusedMonth}>\r\n {month}\r\n </option>\r\n );\r\n })}\r\n </select>\r\n <div class=\"dso-date__select-label\" aria-hidden=\"true\">\r\n <span>{this.localization.monthNamesShort[focusedMonth]}</span>\r\n <dso-icon icon=\"chevron-down\"></dso-icon>\r\n </div>\r\n </div>\r\n\r\n <label htmlFor={this.yearSelectId} class=\"dso-date__vhidden\">\r\n {this.localization.yearSelectLabel}\r\n </label>\r\n <div class=\"dso-date__select\">\r\n <select id={this.yearSelectId} class=\"dso-date__select--year\" onChange={this.handleYearSelect}>\r\n {range(minYear, maxYear).map((year) => (\r\n <option key={year} selected={year === focusedYear}>\r\n {year}\r\n </option>\r\n ))}\r\n </select>\r\n <div class=\"dso-date__select-label\" aria-hidden=\"true\">\r\n <span>{this.focusedDay.getFullYear()}</span>\r\n <dso-icon icon=\"chevron-down\"></dso-icon>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"dso-date__nav\">\r\n <button\r\n class=\"dso-date__prev\"\r\n onClick={this.handlePreviousMonthClick}\r\n disabled={prevMonthDisabled}\r\n type=\"button\"\r\n >\r\n <dso-icon icon=\"chevron-left\"></dso-icon>\r\n <span class=\"dso-date__vhidden\">{this.localization.prevMonthLabel}</span>\r\n </button>\r\n <button\r\n class=\"dso-date__next\"\r\n onClick={this.handleNextMonthClick}\r\n disabled={nextMonthDisabled}\r\n type=\"button\"\r\n >\r\n <dso-icon icon=\"chevron-right\"></dso-icon>\r\n <span class=\"dso-date__vhidden\">{this.localization.nextMonthLabel}</span>\r\n </button>\r\n </div>\r\n </div>\r\n <DatePickerLegacyMonth\r\n selectedDate={valueAsDate}\r\n focusedDate={this.focusedDay}\r\n onDateSelect={this.handleDaySelect}\r\n onKeyboardNavigation={this.handleKeyboardNavigation}\r\n labelledById={this.dialogLabelId}\r\n localization={this.localization}\r\n firstDayOfWeek={this.firstDayOfWeek}\r\n focusedDayRef={this.processFocusedDayNode}\r\n min={minDate}\r\n max={maxDate}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n </Host>\r\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,KAAKqD,yBAC3B1H,aAAcqE,KAAKI,cACnBxE,aAAcoE,KAAKpE,aACnB7D,eAAgBiI,KAAKjI,eACrB2B,cAAesG,KAAKwE,sBACpB9L,IAAK4E,EACL3E,IAAK4E,O"}
|
|
1
|
+
{"version":3,"names":["DaysOfWeek","createDate","year","month","day","dayInt","parseInt","monthInt","yearInt","isValid","Number","isInteger","Date","parseDutchDate","value","matches","split","length","printDutchDate","date","d","getDate","toString","padStart","m","getMonth","y","getFullYear","isEqual","a","b","addDays","days","setDate","startOfWeek","firstDayOfWeek","Monday","getDay","diff","endOfWeek","startOfMonth","endOfMonth","setMonth","setYear","setFullYear","inRange","min","max","clamp","time","getTime","getDaysInRange","start","end","current","push","getViewOfMonth","DatePickerLegacyDay","focusedDay","today","onDaySelect","onKeyboardNavigation","focusedDayRef","isToday","isFocused","notCurrentMonth","isOutsideRange","handleClick","e","h","class","tabIndex","onClick","onKeyDown","disabled","type","ref","el","chunk","array","chunkSize","result","i","slice","mapWithOffset","startingOffset","mapFn","map","_","adjustedIndex","item","Error","DatePickerLegacyMonth","selectedDate","focusedDate","labelledById","localization","onDateSelect","onMouseDown","onFocusIn","role","onFocusin","dayNames","dayName","scope","substr","week","undefined","buttonLabel","placeholder","selectedDateMessage","prevMonthLabel","nextMonthLabel","monthSelectLabel","yearSelectLabel","closeLabel","keyboardInstruction","calendarHeading","monthNames","monthNamesShort","monthRange","selectedYear","minDate","maxDate","minYear","minMonth","maxYear","maxMonth","filter","_month","index","range","from","to","datePickerLegacyCss","DsoDatePickerLegacyStyle0","keyCode","TAB","ESC","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT","UP","RIGHT","DOWN","DISALLOWED_CHARACTERS","TRANSITION_MS","cleanValue","input","regex","cursor","selectionStart","beforeCursor","afterCursor","filteredBeforeCursor","replace","filterAfterCursor","newValue","newCursor","selectionEnd","DsoDatePickerLegacy","this","monthSelectId","createIdentifier","yearSelectId","dialogLabelId","defaultLocalization","enableActiveFocus","activeFocus","disableActiveFocus","toggleOpen","preventDefault","open","hide","show","handleEscKey","event","handleBlur","stopPropagation","dsoBlur","emit","component","handleKeyUp","dsoKeyUp","originalEvent","handleKeyDown","dsoKeyDown","handleFocus","dsoFocus","handleTouchStart","touch","changedTouches","initialTouchX","pageX","initialTouchY","pageY","handleTouchMove","handleTouchEnd","distX","_a","distY","_b","threshold","isHorizontalSwipe","Math","abs","isDownwardsSwipe","addMonths","handleNextMonthClick","handlePreviousMonthClick","handleFirstFocusableKeydown","shiftKey","focusedDayNode","focus","handleKeyboardNavigation","firstFocusableElement","handled","addYears","handleDaySelect","_event","setValue","setFocusedDay","handleMonthSelect","target","HTMLSelectElement","handleYearSelect","handleInputChange","cleanedValue","prepareEvent","valueAsDate","required","error","clampValue","processFocusedDayNode","element","setTimeout","handleDocumentClick","path","composedPath","Node","contains","setFocus","datePickerLegacyInput","hideTimeoutId","clearTimeout","visible","focusTimeoutId","monthSelectNode","moveFocusToButton","datePickerLegacyButton","months","years","previousValue","dsoDateChange","componentWillLoad","componentDidLoad","dsoAutofocus","render","formattedDate","focusedMonth","focusedYear","prevMonthDisabled","nextMonthDisabled","Host","key","id","identifier","invalid","describedBy","onInput","onFocus","onBlur","onKeyUp","autoComplete","icon","direction","onTouchMove","onTouchStart","onTouchEnd","htmlFor","onChange","indexOf","selected"],"sources":["src/components/date-picker-legacy/date-utils.ts","src/components/date-picker-legacy/date-picker-day.tsx","src/components/date-picker-legacy/date-picker-month.tsx","src/components/date-picker-legacy/date-localization.ts","src/components/date-picker-legacy/utils/month-range.ts","src/components/date-picker-legacy/utils/range.ts","src/components/date-picker-legacy/date-picker-legacy.scss?tag=dso-date-picker-legacy&encapsulation=scoped","src/components/date-picker-legacy/date-picker-legacy.tsx"],"sourcesContent":["// eslint-disable-next-line @stencil-community/ban-exported-const-enums -- This enum is not part of public API\r\nexport enum DaysOfWeek {\r\n Sunday = 0,\r\n Monday = 1,\r\n Tuesday = 2,\r\n Wednesday = 3,\r\n Thursday = 4,\r\n Friday = 5,\r\n Saturday = 6,\r\n}\r\n\r\nexport function createDate(year: string, month: string, day: string): Date | undefined {\r\n const dayInt = parseInt(day, 10);\r\n const monthInt = parseInt(month, 10);\r\n const yearInt = parseInt(year, 10);\r\n\r\n const isValid =\r\n Number.isInteger(yearInt) && // all parts should be integers\r\n Number.isInteger(monthInt) &&\r\n Number.isInteger(dayInt) &&\r\n monthInt > 0 && // month must be 1-12\r\n monthInt <= 12 &&\r\n dayInt > 0 && // day must be 1-31\r\n dayInt <= 31 &&\r\n yearInt > 0;\r\n\r\n if (isValid) {\r\n return new Date(yearInt, monthInt - 1, dayInt);\r\n }\r\n}\r\n\r\n/**\r\n * @param value date string in Dutch format D-M-YYYY\r\n */\r\nexport function parseDutchDate(value: string | undefined): Date | undefined {\r\n if (!value) {\r\n return;\r\n }\r\n\r\n const matches = value.split(\"-\");\r\n\r\n if (\r\n matches.length === 3 &&\r\n typeof matches[0] === \"string\" &&\r\n typeof matches[1] === \"string\" &&\r\n typeof matches[2] === \"string\" &&\r\n matches[2].length === 4\r\n ) {\r\n return createDate(matches[2], matches[1], matches[0]);\r\n }\r\n}\r\n\r\n/**\r\n * print date in format DD-MM-YYYY\r\n * @param date\r\n */\r\nexport function printDutchDate(date: Date | undefined): string {\r\n if (!date) {\r\n return \"\";\r\n }\r\n\r\n const d = date.getDate().toString(10).padStart(2, \"0\");\r\n const m = (date.getMonth() + 1).toString(10).padStart(2, \"0\");\r\n const y = date.getFullYear().toString(10).padStart(2, \"0\");\r\n\r\n return `${d}-${m}-${y}`;\r\n}\r\n\r\n/**\r\n * Compare if two dates are equal in terms of day, month, and year\r\n */\r\nexport function isEqual(a: Date | undefined, b: Date | undefined): boolean {\r\n if (!a || !b) {\r\n return false;\r\n }\r\n\r\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\r\n}\r\n\r\nexport function addDays(date: Date, days: number): Date {\r\n const d = new Date(date);\r\n d.setDate(d.getDate() + days);\r\n return d;\r\n}\r\n\r\nexport function addMonths(date: Date, months: number): Date {\r\n const d = new Date(date);\r\n d.setMonth(date.getMonth() + months);\r\n return d;\r\n}\r\n\r\nexport function addYears(date: Date, years: number): Date {\r\n const d = new Date(date);\r\n d.setFullYear(date.getFullYear() + years);\r\n return d;\r\n}\r\n\r\nexport function startOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\r\n const d = new Date(date);\r\n const day = d.getDay();\r\n const diff = (day < firstDayOfWeek ? 7 : 0) + day - firstDayOfWeek;\r\n\r\n d.setDate(d.getDate() - diff);\r\n return d;\r\n}\r\n\r\nexport function endOfWeek(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date {\r\n const d = new Date(date);\r\n const day = d.getDay();\r\n const diff = (day < firstDayOfWeek ? -7 : 0) + 6 - (day - firstDayOfWeek);\r\n\r\n d.setDate(d.getDate() + diff);\r\n return d;\r\n}\r\n\r\nexport function startOfMonth(date: Date): Date {\r\n return new Date(date.getFullYear(), date.getMonth(), 1);\r\n}\r\n\r\nexport function endOfMonth(date: Date): Date {\r\n return new Date(date.getFullYear(), date.getMonth() + 1, 0);\r\n}\r\n\r\nexport function setMonth(date: Date, month: number): Date {\r\n const d = new Date(date);\r\n d.setMonth(month);\r\n return d;\r\n}\r\n\r\nexport function setYear(date: Date, year: number): Date {\r\n const d = new Date(date);\r\n d.setFullYear(year);\r\n return d;\r\n}\r\n\r\n/**\r\n * Check if date is within a min and max\r\n */\r\nexport function inRange(date: Date, min?: Date, max?: Date): boolean {\r\n return clamp(date, min, max) === date;\r\n}\r\n\r\n/**\r\n * Ensures date is within range, returns min or max if out of bounds\r\n */\r\nexport function clamp(date: Date, min?: Date, max?: Date): Date {\r\n const time = date.getTime();\r\n\r\n if (min && min instanceof Date && time < min.getTime()) {\r\n return min;\r\n }\r\n\r\n if (max && max instanceof Date && time > max.getTime()) {\r\n return max;\r\n }\r\n\r\n return date;\r\n}\r\n\r\n/**\r\n * given start and end date, return an (inclusive) array of all dates in between\r\n * @param start\r\n * @param end\r\n */\r\nfunction getDaysInRange(start: Date, end: Date): Date[] {\r\n const days: Date[] = [];\r\n let current = start;\r\n\r\n while (!isEqual(current, end)) {\r\n days.push(current);\r\n current = addDays(current, 1);\r\n }\r\n\r\n days.push(current);\r\n\r\n return days;\r\n}\r\n\r\n/**\r\n * given a date, return an array of dates from a calendar perspective\r\n * @param date\r\n * @param firstDayOfWeek\r\n */\r\nexport function getViewOfMonth(date: Date, firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday): Date[] {\r\n const start = startOfWeek(startOfMonth(date), firstDayOfWeek);\r\n const end = endOfWeek(endOfMonth(date), firstDayOfWeek);\r\n\r\n return getDaysInRange(start, end);\r\n}\r\n","import { h, FunctionalComponent } from \"@stencil/core\";\r\nimport { isEqual, printDutchDate } from \"./date-utils\";\r\n\r\nexport type DatePickerLegacyDayProps = {\r\n focusedDay: Date;\r\n today: Date;\r\n day: Date;\r\n inRange: boolean;\r\n onDaySelect: (event: MouseEvent, day: Date) => void;\r\n onKeyboardNavigation: (event: KeyboardEvent) => void;\r\n focusedDayRef?: (element: HTMLButtonElement) => void;\r\n};\r\n\r\nexport const DatePickerLegacyDay: FunctionalComponent<DatePickerLegacyDayProps> = ({\r\n focusedDay,\r\n today,\r\n day,\r\n onDaySelect,\r\n onKeyboardNavigation,\r\n focusedDayRef,\r\n inRange,\r\n}) => {\r\n const isToday = isEqual(day, today);\r\n const isFocused = isEqual(day, focusedDay);\r\n const notCurrentMonth = day.getMonth() !== focusedDay.getMonth();\r\n const isOutsideRange = !inRange;\r\n\r\n function handleClick(e: MouseEvent) {\r\n onDaySelect(e, day);\r\n }\r\n\r\n return (\r\n <button\r\n class={{\r\n \"dso-date__day\": true,\r\n \"is-today\": isToday,\r\n }}\r\n tabIndex={isFocused ? 0 : -1}\r\n onClick={handleClick}\r\n onKeyDown={onKeyboardNavigation}\r\n disabled={isOutsideRange || notCurrentMonth}\r\n type=\"button\"\r\n ref={(el) => {\r\n if (isFocused && el && focusedDayRef) {\r\n focusedDayRef(el);\r\n }\r\n }}\r\n >\r\n <span aria-hidden=\"true\">{day.getDate()}</span>\r\n <span class=\"dso-date__vhidden\">{printDutchDate(day)}</span>\r\n </button>\r\n );\r\n};\r\n","import { h, FunctionalComponent } from \"@stencil/core\";\r\nimport { DsoLocalizedText } from \"./date-localization\";\r\nimport { DatePickerLegacyDay, DatePickerLegacyDayProps } from \"./date-picker-day\";\r\nimport { getViewOfMonth, inRange, DaysOfWeek, isEqual } from \"./date-utils\";\r\n\r\nfunction chunk<T>(array: T[], chunkSize: number): T[][] {\r\n const result = [];\r\n\r\n for (let i = 0; i < array.length; i += chunkSize) {\r\n result.push(array.slice(i, i + chunkSize));\r\n }\r\n\r\n return result;\r\n}\r\n\r\nfunction mapWithOffset<T, U>(array: T[], startingOffset: number, mapFn: (item: T) => U): U[] {\r\n return array.map((_, i) => {\r\n const adjustedIndex = (i + startingOffset) % array.length;\r\n const item = array[adjustedIndex];\r\n if (!item) {\r\n throw new Error(\"No item found\");\r\n }\r\n\r\n return mapFn(item);\r\n });\r\n}\r\n\r\ntype DatePickerLegacyMonthProps = {\r\n selectedDate: Date | undefined;\r\n focusedDate: Date;\r\n labelledById: string;\r\n localization: DsoLocalizedText;\r\n firstDayOfWeek: DaysOfWeek;\r\n min?: Date;\r\n max?: Date;\r\n onDateSelect: DatePickerLegacyDayProps[\"onDaySelect\"];\r\n onKeyboardNavigation: DatePickerLegacyDayProps[\"onKeyboardNavigation\"];\r\n focusedDayRef: (element: HTMLButtonElement) => void;\r\n onFocusIn?: (e: FocusEvent) => void;\r\n onMouseDown?: (e: MouseEvent) => void;\r\n};\r\n\r\nexport const DatePickerLegacyMonth: FunctionalComponent<DatePickerLegacyMonthProps> = ({\r\n selectedDate,\r\n focusedDate,\r\n labelledById,\r\n localization,\r\n firstDayOfWeek,\r\n min,\r\n max,\r\n onDateSelect,\r\n onKeyboardNavigation,\r\n focusedDayRef,\r\n onMouseDown,\r\n onFocusIn,\r\n}) => {\r\n const today = new Date();\r\n const days = getViewOfMonth(focusedDate, firstDayOfWeek);\r\n\r\n return (\r\n <table\r\n class=\"dso-date__table\"\r\n role=\"grid\"\r\n aria-labelledby={labelledById}\r\n onFocusin={onFocusIn}\r\n onMouseDown={onMouseDown}\r\n >\r\n <thead>\r\n <tr>\r\n {mapWithOffset(localization.dayNames, firstDayOfWeek, (dayName) => (\r\n <th class=\"dso-date__table-header\" scope=\"col\">\r\n <span aria-hidden=\"true\">{dayName.substr(0, 2)}</span>\r\n <span class=\"dso-date__vhidden\">{dayName}</span>\r\n </th>\r\n ))}\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {chunk(days, 7).map((week) => (\r\n <tr class=\"dso-date__row\">\r\n {week.map((day) => (\r\n <td\r\n class=\"dso-date__cell\"\r\n role=\"gridcell\"\r\n aria-selected={isEqual(day, selectedDate) ? \"true\" : undefined}\r\n aria-current={isEqual(day, today) ? \"date\" : undefined}\r\n >\r\n <DatePickerLegacyDay\r\n day={day}\r\n today={today}\r\n focusedDay={focusedDate}\r\n inRange={inRange(day, min, max)}\r\n onDaySelect={onDateSelect}\r\n onKeyboardNavigation={onKeyboardNavigation}\r\n focusedDayRef={focusedDayRef}\r\n />\r\n </td>\r\n ))}\r\n </tr>\r\n ))}\r\n </tbody>\r\n </table>\r\n );\r\n};\r\n","type MonthsNames = [string, string, string, string, string, string, string, string, string, string, string, string];\r\ntype DayNames = [string, string, string, string, string, string, string];\r\n\r\nexport type DsoLocalizedText = {\r\n buttonLabel: string;\r\n placeholder: string;\r\n selectedDateMessage: string;\r\n prevMonthLabel: string;\r\n nextMonthLabel: string;\r\n monthSelectLabel: string;\r\n yearSelectLabel: string;\r\n closeLabel: string;\r\n keyboardInstruction: string;\r\n calendarHeading: string;\r\n dayNames: DayNames;\r\n monthNames: MonthsNames;\r\n monthNamesShort: MonthsNames;\r\n};\r\n\r\nconst localization: DsoLocalizedText = {\r\n buttonLabel: \"Kies datum\",\r\n placeholder: \"dd-mm-jjjj\",\r\n selectedDateMessage: \"Geselecteerde datum is\",\r\n prevMonthLabel: \"Vorige maand\",\r\n nextMonthLabel: \"Volgende maand\",\r\n monthSelectLabel: \"Maand\",\r\n yearSelectLabel: \"Jaar\",\r\n closeLabel: \"Sluiten\",\r\n keyboardInstruction: \"Gebruik de pijltjestoetsen om een dag te kiezen\",\r\n calendarHeading: \"Kies een datum\",\r\n dayNames: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n monthNames: [\r\n \"Januari\",\r\n \"Februari\",\r\n \"Maart\",\r\n \"April\",\r\n \"Mei\",\r\n \"Juni\",\r\n \"Juli\",\r\n \"Augustus\",\r\n \"September\",\r\n \"Oktober\",\r\n \"November\",\r\n \"December\",\r\n ],\r\n monthNamesShort: [\"Jan\", \"Feb\", \"Mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n};\r\n\r\nexport default localization;\r\n","import { DsoLocalizedText } from \"../date-localization\";\r\n\r\nexport function monthRange(\r\n localization: DsoLocalizedText,\r\n selectedYear: number,\r\n minDate?: Date,\r\n maxDate?: Date,\r\n): string[] {\r\n if (minDate && maxDate) {\r\n const { minYear, minMonth } = { minYear: minDate.getFullYear(), minMonth: minDate.getMonth() };\r\n const { maxYear, maxMonth } = { maxYear: maxDate.getFullYear(), maxMonth: maxDate.getMonth() };\r\n\r\n return localization.monthNames.filter((_month, index) => {\r\n if (minYear === selectedYear && maxYear === selectedYear) {\r\n return index >= minMonth && index >= maxMonth;\r\n }\r\n\r\n if (minYear === selectedYear) {\r\n return index >= minMonth;\r\n }\r\n\r\n if (maxYear === selectedYear) {\r\n return index <= maxMonth;\r\n }\r\n\r\n return true;\r\n });\r\n }\r\n\r\n if (minDate) {\r\n const { minYear, minMonth } = { minYear: minDate.getFullYear(), minMonth: minDate.getMonth() };\r\n\r\n return localization.monthNames.filter((_month, index) => minYear === selectedYear && index >= minMonth);\r\n }\r\n\r\n if (maxDate) {\r\n const { maxYear, maxMonth } = { maxYear: maxDate.getFullYear(), maxMonth: maxDate.getMonth() };\r\n\r\n return localization.monthNames.filter((_month, index) => maxYear === selectedYear && index <= maxMonth);\r\n }\r\n\r\n return localization.monthNames;\r\n}\r\n","export function range(from: number, to: number) {\r\n const result: number[] = [];\r\n for (let i = from; i <= to; i++) {\r\n result.push(i);\r\n }\r\n return result;\r\n}\r\n","@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n@use \"~dso-toolkit/src/variables/zindex\";\r\n@use \"~dso-toolkit/src/components/form-control\";\r\n\r\n@use \"date-picker-legacy.variables\" as core-date-picker-legacy-variables;\r\n\r\n:host {\r\n display: block;\r\n\r\n &[invalid]:not([invalid=\"false\"]) {\r\n .dso-date__input {\r\n border-color: colors.$danger-color;\r\n }\r\n }\r\n}\r\n\r\n.dso-date *,\r\n.dso-date *::before,\r\n.dso-date *::after {\r\n box-sizing: border-box;\r\n}\r\n\r\n.dso-date {\r\n box-sizing: border-box;\r\n color: core-date-picker-legacy-variables.$color-text;\r\n display: block;\r\n font-family: core-date-picker-legacy-variables.$font;\r\n margin: 0;\r\n position: relative;\r\n text-align: left;\r\n width: 100%;\r\n\r\n &:not(.dso-visible) {\r\n .dso-date__dialog {\r\n display: none;\r\n }\r\n }\r\n}\r\n\r\n.dso-date__input {\r\n @include form-control.root();\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ TOGGLE\r\n// ---------------------------------------------\r\n\r\n.dso-date__toggle {\r\n -moz-appearance: none;\r\n -webkit-appearance: none;\r\n -webkit-user-select: none;\r\n align-items: center;\r\n appearance: none;\r\n background: core-date-picker-legacy-variables.$color-button-bg;\r\n border: 0;\r\n border-radius: 0;\r\n border-bottom-right-radius: core-date-picker-legacy-variables.$radius;\r\n border-top-right-radius: core-date-picker-legacy-variables.$radius;\r\n color: core-date-picker-legacy-variables.$color-icon;\r\n cursor: pointer;\r\n display: flex;\r\n height: core-date-picker-legacy-variables.$size;\r\n justify-content: center;\r\n padding: 0;\r\n position: absolute;\r\n right: 0;\r\n transform: translateY(-50%);\r\n top: 50%;\r\n user-select: none;\r\n width: core-date-picker-legacy-variables.$size;\r\n z-index: zindex.$datepicker + 1;\r\n\r\n &:disabled {\r\n color: core-date-picker-legacy-variables.$nav-button-disabled;\r\n cursor: default;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ DIALOG\r\n// ---------------------------------------------\r\n\r\n.dso-date__dialog {\r\n border-width: core-date-picker-legacy-variables.$border-width;\r\n display: flex;\r\n right: 0;\r\n min-width: 320px;\r\n opacity: 0;\r\n position: absolute;\r\n top: 100%;\r\n transform: scale(0.96) translateZ(0) translateY(-20px);\r\n transform-origin: top right;\r\n transition:\r\n transform 300ms ease,\r\n opacity 300ms ease,\r\n visibility 300ms ease;\r\n visibility: hidden;\r\n will-change: transform, opacity, visibility;\r\n z-index: zindex.$datepicker-dialog;\r\n\r\n @media (max-width: 35.9375em) {\r\n background: core-date-picker-legacy-variables.$overlay;\r\n bottom: 0;\r\n position: fixed;\r\n left: 0;\r\n right: 0;\r\n top: 0;\r\n transform: translateZ(0);\r\n transform-origin: bottom center;\r\n }\r\n\r\n &.is-left {\r\n left: units.$padding-base-horizontal * -1 + core-date-picker-legacy-variables.$border-width;\r\n right: auto;\r\n width: auto;\r\n }\r\n\r\n &.is-active {\r\n opacity: 1;\r\n // The value of 1.0001 fixes a Chrome glitch with scaling\r\n transform: scale(1.0001) translateZ(0) translateY(0);\r\n visibility: visible;\r\n }\r\n}\r\n\r\n.dso-date__dialog-content {\r\n background: core-date-picker-legacy-variables.$surface;\r\n border: 1px solid rgba(0, 0, 0, 0.1);\r\n border-radius: core-date-picker-legacy-variables.$radius;\r\n box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.4);\r\n margin-left: auto;\r\n margin-right: -1px;\r\n margin-top: 8px;\r\n max-width: 310px;\r\n min-width: 290px;\r\n padding: 16px;\r\n position: relative;\r\n transform: none;\r\n width: 100%;\r\n z-index: zindex.$datepicker-dialog;\r\n\r\n @media (max-width: 35.9375em) {\r\n border: 0;\r\n border-radius: 0;\r\n border-top-left-radius: core-date-picker-legacy-variables.$radius;\r\n border-top-right-radius: core-date-picker-legacy-variables.$radius;\r\n bottom: 0;\r\n left: 0;\r\n margin: 0;\r\n max-width: none;\r\n min-height: 26em;\r\n opacity: 0;\r\n padding: 0 8% 20px;\r\n position: absolute;\r\n transform: translateZ(0) translateY(100%);\r\n transition:\r\n transform core-date-picker-legacy-variables.$transition-duration ease,\r\n opacity core-date-picker-legacy-variables.$transition-duration ease,\r\n visibility core-date-picker-legacy-variables.$transition-duration ease;\r\n visibility: hidden;\r\n will-change: transform, opacity, visibility;\r\n\r\n .is-active & {\r\n opacity: 1;\r\n transform: translateZ(0) translateY(0);\r\n visibility: visible;\r\n }\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ TABLE\r\n// ---------------------------------------------\r\n\r\n.dso-date__table {\r\n border-collapse: collapse;\r\n border-spacing: 0;\r\n color: core-date-picker-legacy-variables.$color-text;\r\n font-size: 1rem;\r\n font-weight: core-date-picker-legacy-variables.$font-normal;\r\n line-height: 1.25;\r\n min-width: (core-date-picker-legacy-variables.$size + 2) * 7;\r\n table-layout: fixed;\r\n text-align: center;\r\n width: 100%;\r\n}\r\n\r\n.dso-date__table-header {\r\n font-size: 0.875em;\r\n font-weight: core-date-picker-legacy-variables.$font-bold;\r\n height: 36px;\r\n line-height: 36px;\r\n text-align: center;\r\n text-decoration: none;\r\n text-transform: uppercase;\r\n}\r\n\r\n.dso-date__cell {\r\n height: core-date-picker-legacy-variables.$size + 2;\r\n padding: 1px;\r\n text-align: center;\r\n width: core-date-picker-legacy-variables.$size + 2;\r\n}\r\n\r\n.dso-date__day {\r\n -moz-appearance: none;\r\n -webkit-appearance: none;\r\n appearance: none;\r\n background: transparent;\r\n border: 0;\r\n border-radius: 50%;\r\n box-shadow: 0 0 0 1px transparent;\r\n color: core-date-picker-legacy-variables.$color-text;\r\n cursor: pointer;\r\n display: inline-block;\r\n font-family: core-date-picker-legacy-variables.$font;\r\n font-variant-numeric: tabular-nums;\r\n font-weight: core-date-picker-legacy-variables.$font-normal;\r\n height: core-date-picker-legacy-variables.$size;\r\n line-height: 0;\r\n padding: 0;\r\n position: relative;\r\n text-align: center;\r\n vertical-align: middle;\r\n width: core-date-picker-legacy-variables.$size;\r\n z-index: zindex.$datepicker;\r\n\r\n &.is-today {\r\n background: transparent;\r\n height: core-date-picker-legacy-variables.$size - 2;\r\n box-shadow: 0 0 0 1px core-date-picker-legacy-variables.$color-button;\r\n width: core-date-picker-legacy-variables.$size - 2;\r\n }\r\n\r\n &:hover,\r\n &:active {\r\n background: core-date-picker-legacy-variables.$color-button;\r\n color: core-date-picker-legacy-variables.$color-text-active;\r\n }\r\n\r\n &:focus {\r\n background: transparent;\r\n box-shadow: 0 0 0 2px colors.$bosgroen;\r\n color: core-date-picker-legacy-variables.$color-text;\r\n height: core-date-picker-legacy-variables.$size - 4;\r\n outline: 0;\r\n width: core-date-picker-legacy-variables.$size - 4;\r\n }\r\n\r\n [aria-selected=\"true\"] & {\r\n background: core-date-picker-legacy-variables.$color-button;\r\n color: core-date-picker-legacy-variables.$color-text-active;\r\n\r\n &:focus {\r\n background: transparent;\r\n\r\n span[aria-hidden=\"true\"] {\r\n background: core-date-picker-legacy-variables.$color-button;\r\n border: 1px solid colors.$wit;\r\n line-height: core-date-picker-legacy-variables.$size - 6;\r\n }\r\n }\r\n }\r\n\r\n &:disabled {\r\n background: colors.$wit;\r\n color: core-date-picker-legacy-variables.$color-text-disabled;\r\n cursor: default;\r\n }\r\n\r\n span[aria-hidden=\"true\"] {\r\n border-radius: 50%;\r\n display: inline-block;\r\n height: core-date-picker-legacy-variables.$size - 4;\r\n line-height: core-date-picker-legacy-variables.$size - 4;\r\n width: core-date-picker-legacy-variables.$size - 4;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ HEADER\r\n// ---------------------------------------------\r\n\r\n.dso-date__header {\r\n align-items: center;\r\n display: flex;\r\n justify-content: space-between;\r\n margin-bottom: 16px;\r\n width: 100%;\r\n\r\n span {\r\n font-size: 0.875rem;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ NAVIGATION\r\n// ---------------------------------------------\r\n\r\n.dso-date__nav {\r\n white-space: nowrap; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n}\r\n\r\n.dso-date__prev,\r\n.dso-date__next {\r\n -moz-appearance: none;\r\n -webkit-appearance: none;\r\n align-items: center;\r\n appearance: none;\r\n background: core-date-picker-legacy-variables.$color-button-bg;\r\n border: 1px solid core-date-picker-legacy-variables.$color-button;\r\n border-radius: core-date-picker-legacy-variables.$radius;\r\n box-sizing: border-box;\r\n color: core-date-picker-legacy-variables.$color-button;\r\n cursor: pointer;\r\n display: inline-flex;\r\n font-size: 1em;\r\n height: 32px;\r\n justify-content: center;\r\n margin-left: 8px;\r\n padding: 0;\r\n width: 32px;\r\n\r\n @media (max-width: 35.9375em) {\r\n height: 40px;\r\n width: 40px;\r\n }\r\n\r\n &:hover,\r\n &:active {\r\n background-color: core-date-picker-legacy-variables.$color-button;\r\n color: core-date-picker-legacy-variables.$color-text-active;\r\n }\r\n\r\n &:focus {\r\n background: core-date-picker-legacy-variables.$color-button-bg;\r\n color: core-date-picker-legacy-variables.$color-button;\r\n }\r\n\r\n &:disabled {\r\n &,\r\n &:hover {\r\n background-color: colors.$wit;\r\n border-color: core-date-picker-legacy-variables.$nav-button-disabled;\r\n color: core-date-picker-legacy-variables.$nav-button-disabled;\r\n opacity: 1;\r\n }\r\n }\r\n\r\n svg {\r\n margin: 0 auto;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ SELECT\r\n// ---------------------------------------------\r\n\r\n.dso-date__select {\r\n display: inline-flex;\r\n height: units.$u1 * 4 - 4;\r\n line-height: units.$u1 * 4 - 4;\r\n position: relative;\r\n\r\n span {\r\n margin-right: 4px;\r\n }\r\n\r\n select {\r\n color: core-date-picker-legacy-variables.$color-primary;\r\n cursor: pointer;\r\n font-size: 1rem;\r\n height: 100%;\r\n left: 0;\r\n opacity: 0;\r\n position: absolute;\r\n top: 0;\r\n width: 100%;\r\n z-index: zindex.$datepicker + 1;\r\n\r\n &:focus + .dso-date__select-label {\r\n box-shadow: 0 0 0 2px core-date-picker-legacy-variables.$color-primary;\r\n }\r\n\r\n &:disabled {\r\n color: core-date-picker-legacy-variables.$nav-button-disabled;\r\n }\r\n }\r\n}\r\n\r\n.dso-date__select-label {\r\n align-items: center;\r\n border-radius: core-date-picker-legacy-variables.$radius;\r\n color: core-date-picker-legacy-variables.$select;\r\n display: flex;\r\n padding: 0 4px 0 8px;\r\n pointer-events: none;\r\n position: relative;\r\n width: 100%;\r\n z-index: zindex.$datepicker;\r\n\r\n span {\r\n font-size: 1.25rem;\r\n font-weight: core-date-picker-legacy-variables.$font-bold;\r\n line-height: 1.25;\r\n }\r\n\r\n svg {\r\n width: 16px;\r\n height: 16px;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ MOBILE\r\n// ---------------------------------------------\r\n\r\n.dso-date__mobile {\r\n align-items: center;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\r\n display: flex;\r\n font-size: 1em;\r\n justify-content: space-between;\r\n margin-bottom: 20px;\r\n margin-left: -10%;\r\n overflow: hidden;\r\n padding: 12px 20px;\r\n position: relative;\r\n text-overflow: ellipsis; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n white-space: nowrap; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n width: 120%;\r\n\r\n @media (min-width: 36em) {\r\n border: 0;\r\n margin: 0;\r\n overflow: visible;\r\n padding: 0;\r\n position: absolute;\r\n right: -16px;\r\n top: -16px;\r\n width: auto;\r\n }\r\n}\r\n\r\n.dso-date__mobile-heading {\r\n display: inline-block;\r\n font-weight: core-date-picker-legacy-variables.$font-bold;\r\n max-width: 84%;\r\n overflow: hidden;\r\n text-overflow: ellipsis; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n white-space: nowrap; // stylelint-disable-line declaration-property-value-disallowed-list -- 3rd party code\r\n\r\n @media (min-width: 36em) {\r\n display: none;\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ CLOSE\r\n// ---------------------------------------------\r\n\r\n.dso-date__close {\r\n -webkit-appearance: none;\r\n align-items: center;\r\n appearance: none;\r\n background-color: colors.$wit;\r\n border: 0;\r\n border-radius: 50%;\r\n color: core-date-picker-legacy-variables.$color-icon;\r\n cursor: pointer;\r\n display: flex;\r\n font-size: 1em;\r\n height: units.$u1 * 4;\r\n justify-content: center;\r\n margin-right: -4px;\r\n padding: 0;\r\n width: units.$u1 * 4;\r\n\r\n @media (min-width: 36em) {\r\n margin-right: 0;\r\n opacity: 0;\r\n }\r\n\r\n &:focus {\r\n box-shadow: 0 0 0 2px colors.$bosgroen;\r\n outline: none;\r\n\r\n @media (min-width: 36em) {\r\n opacity: 1;\r\n }\r\n }\r\n}\r\n\r\n// ---------------------------------------------\r\n// dso DATE PICKER __ VISUALLY HIDDEN\r\n// ---------------------------------------------\r\n\r\n.dso-date__vhidden {\r\n border: 0;\r\n clip: rect(1px, 1px, 1px, 1px);\r\n height: 1px;\r\n overflow: hidden;\r\n padding: 0;\r\n position: absolute;\r\n top: 0;\r\n width: 1px;\r\n}\r\n","import {\r\n Component,\r\n ComponentInterface,\r\n Host,\r\n Prop,\r\n Element,\r\n h,\r\n Event,\r\n EventEmitter,\r\n State,\r\n Listen,\r\n Method,\r\n} from \"@stencil/core\";\r\n\r\nimport { createIdentifier } from \"../../utils/create-identifier\";\r\nimport {\r\n addDays,\r\n startOfWeek,\r\n endOfWeek,\r\n setMonth,\r\n setYear,\r\n clamp,\r\n inRange,\r\n endOfMonth,\r\n startOfMonth,\r\n printDutchDate,\r\n parseDutchDate,\r\n DaysOfWeek,\r\n} from \"./date-utils\";\r\nimport { DatePickerLegacyMonth } from \"./date-picker-month\";\r\nimport defaultLocalization, { DsoLocalizedText } from \"./date-localization\";\r\nimport {\r\n DsoDatePickerLegacyDirection,\r\n DsoDatePickerLegacyChangeEvent,\r\n DsoDatePickerLegacyFocusEvent,\r\n DsoDatePickerLegacyKeyboardEvent,\r\n} from \"./date-picker-legacy.interfaces\";\r\nimport { monthRange } from \"./utils/month-range\";\r\nimport { range } from \"./utils/range\";\r\n\r\nconst keyCode = {\r\n TAB: 9,\r\n ESC: 27,\r\n SPACE: 32,\r\n PAGE_UP: 33,\r\n PAGE_DOWN: 34,\r\n END: 35,\r\n HOME: 36,\r\n LEFT: 37,\r\n UP: 38,\r\n RIGHT: 39,\r\n DOWN: 40,\r\n};\r\n\r\nconst DISALLOWED_CHARACTERS = /[^0-9-]+/g;\r\nconst TRANSITION_MS = 300;\r\n\r\nfunction cleanValue(input: HTMLInputElement, regex: RegExp): string {\r\n const value = input.value;\r\n const cursor = input.selectionStart;\r\n\r\n if (!cursor) {\r\n return value;\r\n }\r\n\r\n const beforeCursor = value.slice(0, cursor);\r\n const afterCursor = value.slice(cursor, value.length);\r\n\r\n const filteredBeforeCursor = beforeCursor.replace(regex, \"\");\r\n const filterAfterCursor = afterCursor.replace(regex, \"\");\r\n\r\n const newValue = filteredBeforeCursor + filterAfterCursor;\r\n const newCursor = filteredBeforeCursor.length;\r\n\r\n input.value = newValue;\r\n input.selectionStart = input.selectionEnd = newCursor;\r\n\r\n return newValue;\r\n}\r\n\r\n@Component({\r\n tag: \"dso-date-picker-legacy\",\r\n styleUrl: \"date-picker-legacy.scss\",\r\n shadow: false,\r\n scoped: true,\r\n})\r\nexport class DsoDatePickerLegacy implements ComponentInterface {\r\n /**\r\n * Own Properties\r\n */\r\n private monthSelectId = createIdentifier(\"DsoDateMonth\");\r\n private yearSelectId = createIdentifier(\"DsoDateYear\");\r\n private dialogLabelId = createIdentifier(\"DsoDateLabel\");\r\n\r\n private datePickerLegacyButton: HTMLButtonElement | undefined;\r\n private datePickerLegacyInput: HTMLInputElement | undefined;\r\n private firstFocusableElement: HTMLElement | undefined;\r\n private monthSelectNode: HTMLElement | undefined;\r\n private focusedDayNode: HTMLButtonElement | undefined;\r\n\r\n private focusTimeoutId: ReturnType<typeof setTimeout> | undefined;\r\n private hideTimeoutId: ReturnType<typeof setTimeout> | undefined;\r\n\r\n private initialTouchX: number | undefined;\r\n private initialTouchY: number | undefined;\r\n\r\n private localization: DsoLocalizedText = defaultLocalization;\r\n private firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday;\r\n\r\n private previousValue: string | undefined;\r\n\r\n /**\r\n * Reference to host HTML element.\r\n */\r\n @Element()\r\n element!: HTMLDsoDatePickerLegacyElement;\r\n\r\n /**\r\n * State() variables\r\n */\r\n @State()\r\n activeFocus = false;\r\n\r\n @State()\r\n focusedDay = new Date();\r\n\r\n @State()\r\n open = false;\r\n\r\n @State()\r\n visible = false;\r\n\r\n /**\r\n * Public Property API\r\n */\r\n\r\n /**\r\n * Name of the date picker input.\r\n */\r\n @Prop()\r\n name = \"date\";\r\n\r\n /**\r\n * Adds a unique identifier for the date picker input. Use this instead of html `id` attribute.\r\n */\r\n @Prop()\r\n identifier: string | undefined;\r\n\r\n /**\r\n * Makes the date picker input component disabled. This prevents users from being able to\r\n * interact with the input, and conveys its inactive state to assistive technologies.\r\n */\r\n @Prop({ reflect: true })\r\n disabled = false;\r\n\r\n /**\r\n * Defines a specific role attribute for the date picker input.\r\n */\r\n @Prop()\r\n // eslint-disable-next-line @stencil-community/reserved-member-names\r\n role: string | null = null;\r\n\r\n /**\r\n * Forces the opening direction of the calendar modal to be always left or right.\r\n * This setting can be useful when the input is smaller than the opening date picker\r\n * would be as by default the picker always opens towards right.\r\n */\r\n @Prop()\r\n direction: DsoDatePickerLegacyDirection = \"right\";\r\n\r\n /**\r\n * Should the input be marked as required?\r\n */\r\n @Prop()\r\n required = false;\r\n\r\n /**\r\n * Is input invalid?\r\n */\r\n @Prop({ reflect: true })\r\n invalid?: boolean;\r\n\r\n /**\r\n * ID of element that describes the input element\r\n */\r\n @Prop()\r\n describedBy?: string;\r\n\r\n /**\r\n * Should the input be focused on load?\r\n */\r\n @Prop()\r\n dsoAutofocus = false;\r\n\r\n /**\r\n * Date value. Must be in Dutch date format: DD-MM-YYYY.\r\n */\r\n @Prop({ reflect: true, mutable: true })\r\n value = \"\";\r\n\r\n /**\r\n * Minimum date allowed to be picked. Must be in Dutch date format: DD-MM-YYYY.\r\n * This setting can be used alone or together with the max property.\r\n */\r\n @Prop()\r\n min: string | undefined;\r\n\r\n /**\r\n * Maximum date allowed to be picked. Must be in Dutch date format: DD-MM-YYYY.\r\n * This setting can be used alone or together with the min property.\r\n */\r\n @Prop()\r\n max: string | undefined;\r\n\r\n /**\r\n * Events section.\r\n */\r\n\r\n /**\r\n * Event emitted when a date is selected.\r\n */\r\n @Event()\r\n dsoDateChange!: EventEmitter<DsoDatePickerLegacyChangeEvent>;\r\n\r\n /**\r\n * Event emitted the date picker input is blurred.\r\n */\r\n @Event()\r\n dsoBlur!: EventEmitter<DsoDatePickerLegacyFocusEvent>;\r\n\r\n /**\r\n * Event emitted on key up in the date picker input.\r\n */\r\n @Event()\r\n dsoKeyUp!: EventEmitter<DsoDatePickerLegacyKeyboardEvent>;\r\n\r\n /**\r\n * Event emitted on key down in the date picker input.\r\n */\r\n @Event()\r\n dsoKeyDown!: EventEmitter<DsoDatePickerLegacyKeyboardEvent>;\r\n\r\n /**\r\n * Event emitted the date picker input is focused.\r\n */\r\n @Event()\r\n dsoFocus!: EventEmitter<DsoDatePickerLegacyFocusEvent>;\r\n\r\n /**\r\n * Component event handling.\r\n */\r\n @Listen(\"click\", { target: \"document\", capture: true })\r\n handleDocumentClick(e: MouseEvent) {\r\n if (!this.open) {\r\n return;\r\n }\r\n\r\n const path = e.composedPath();\r\n\r\n for (const target of path) {\r\n if (target instanceof Node && this.element.contains(target)) {\r\n return;\r\n }\r\n }\r\n\r\n this.hide(false);\r\n }\r\n\r\n /**\r\n * Sets focus on the date picker's input. Use this method instead of the global `focus()`.\r\n */\r\n @Method()\r\n async setFocus() {\r\n return this.datePickerLegacyInput?.focus();\r\n }\r\n\r\n /**\r\n * Public methods API\r\n */\r\n\r\n /**\r\n * Show the calendar modal, moving focus to the calendar inside.\r\n */\r\n @Method()\r\n async show() {\r\n if (typeof this.hideTimeoutId !== \"undefined\") {\r\n clearTimeout(this.hideTimeoutId);\r\n }\r\n\r\n this.visible = true;\r\n\r\n setTimeout(() => {\r\n this.open = true;\r\n this.setFocusedDay(parseDutchDate(this.value) || new Date());\r\n\r\n if (typeof this.focusTimeoutId !== \"undefined\") {\r\n clearTimeout(this.focusTimeoutId);\r\n }\r\n\r\n this.focusTimeoutId = setTimeout(() => this.monthSelectNode?.focus(), TRANSITION_MS);\r\n });\r\n }\r\n\r\n /**\r\n * Hide the calendar modal. Set `moveFocusToButton` to false to prevent focus\r\n * returning to the date picker's button. Default is true.\r\n */\r\n @Method()\r\n async hide(moveFocusToButton = true) {\r\n this.open = false;\r\n\r\n // in cases where calendar is quickly shown and hidden\r\n // we should avoid moving focus to the button\r\n if (typeof this.focusTimeoutId !== \"undefined\") {\r\n clearTimeout(this.focusTimeoutId);\r\n }\r\n\r\n this.hideTimeoutId = setTimeout(() => {\r\n if (moveFocusToButton && this.datePickerLegacyButton) {\r\n this.datePickerLegacyButton.focus();\r\n }\r\n\r\n this.visible = false;\r\n }, TRANSITION_MS + 200);\r\n }\r\n\r\n /**\r\n * Local methods.\r\n */\r\n private enableActiveFocus = () => {\r\n this.activeFocus = true;\r\n };\r\n\r\n private disableActiveFocus = () => {\r\n this.activeFocus = false;\r\n };\r\n\r\n private addDays(days: number) {\r\n this.setFocusedDay(addDays(this.focusedDay, days));\r\n }\r\n\r\n private addMonths(months: number) {\r\n this.setMonth(this.focusedDay.getMonth() + months);\r\n }\r\n\r\n private addYears(years: number) {\r\n this.setYear(this.focusedDay.getFullYear() + years);\r\n }\r\n\r\n private startOfWeek() {\r\n this.setFocusedDay(startOfWeek(this.focusedDay, this.firstDayOfWeek));\r\n }\r\n\r\n private endOfWeek() {\r\n this.setFocusedDay(endOfWeek(this.focusedDay, this.firstDayOfWeek));\r\n }\r\n\r\n private setMonth(month: number) {\r\n const min = setMonth(startOfMonth(this.focusedDay), month);\r\n const max = endOfMonth(min);\r\n const date = setMonth(this.focusedDay, month);\r\n\r\n this.setFocusedDay(clamp(date, min, max));\r\n }\r\n\r\n private setYear(year: number) {\r\n const min = setYear(startOfMonth(this.focusedDay), year);\r\n const max = endOfMonth(min);\r\n const date = setYear(this.focusedDay, year);\r\n\r\n this.setFocusedDay(clamp(date, min, max));\r\n }\r\n\r\n private setFocusedDay(day: Date) {\r\n this.focusedDay = clamp(day, parseDutchDate(this.min), parseDutchDate(this.max));\r\n }\r\n\r\n private toggleOpen = (e: Event) => {\r\n e.preventDefault();\r\n this.open ? this.hide(false) : this.show();\r\n };\r\n\r\n private handleEscKey = (event: KeyboardEvent) => {\r\n if (event.keyCode === keyCode.ESC) {\r\n this.hide();\r\n }\r\n };\r\n\r\n private handleBlur = (event: Event) => {\r\n event.stopPropagation();\r\n\r\n this.dsoBlur.emit({\r\n component: \"dso-date-picker-legacy\",\r\n });\r\n };\r\n\r\n private handleKeyUp = (event: KeyboardEvent) => {\r\n event.stopPropagation();\r\n\r\n this.dsoKeyUp.emit({\r\n component: \"dso-date-picker-legacy\",\r\n originalEvent: event,\r\n });\r\n };\r\n\r\n private handleKeyDown = (event: KeyboardEvent) => {\r\n event.stopPropagation();\r\n\r\n this.dsoKeyDown.emit({\r\n component: \"dso-date-picker-legacy\",\r\n originalEvent: event,\r\n });\r\n };\r\n\r\n private handleFocus = (event: Event) => {\r\n event.stopPropagation();\r\n\r\n this.dsoFocus.emit({\r\n component: \"dso-date-picker-legacy\",\r\n });\r\n };\r\n\r\n private handleTouchStart = (event: TouchEvent) => {\r\n const touch = event.changedTouches[0];\r\n if (!touch) {\r\n throw new Error(\"No touch found\");\r\n }\r\n\r\n this.initialTouchX = touch.pageX;\r\n this.initialTouchY = touch.pageY;\r\n };\r\n\r\n private handleTouchMove = (event: TouchEvent) => {\r\n event.preventDefault();\r\n };\r\n\r\n private handleTouchEnd = (event: TouchEvent) => {\r\n const touch = event.changedTouches[0];\r\n if (!touch) {\r\n throw new Error(\"No touch found\");\r\n }\r\n\r\n const distX = touch.pageX - (this.initialTouchX ?? 0); // get horizontal dist traveled\r\n const distY = touch.pageY - (this.initialTouchY ?? 0); // get vertical dist traveled\r\n const threshold = 70;\r\n\r\n const isHorizontalSwipe = Math.abs(distX) >= threshold && Math.abs(distY) <= threshold;\r\n const isDownwardsSwipe = Math.abs(distY) >= threshold && Math.abs(distX) <= threshold && distY > 0;\r\n\r\n if (isHorizontalSwipe) {\r\n this.addMonths(distX < 0 ? 1 : -1);\r\n } else if (isDownwardsSwipe) {\r\n this.hide(false);\r\n event.preventDefault();\r\n }\r\n\r\n this.initialTouchY = undefined;\r\n this.initialTouchX = undefined;\r\n };\r\n\r\n private handleNextMonthClick = (event: MouseEvent) => {\r\n event.preventDefault();\r\n this.addMonths(1);\r\n };\r\n\r\n private handlePreviousMonthClick = (event: MouseEvent) => {\r\n event.preventDefault();\r\n this.addMonths(-1);\r\n };\r\n\r\n private handleFirstFocusableKeydown = (event: KeyboardEvent) => {\r\n // this ensures focus is trapped inside the dialog\r\n if (event.keyCode === keyCode.TAB && event.shiftKey) {\r\n this.focusedDayNode?.focus();\r\n event.preventDefault();\r\n }\r\n };\r\n\r\n private handleKeyboardNavigation = (event: KeyboardEvent) => {\r\n // handle tab separately, since it needs to be treated\r\n // differently to other keyboard interactions\r\n if (event.keyCode === keyCode.TAB && !event.shiftKey) {\r\n event.preventDefault();\r\n this.firstFocusableElement?.focus();\r\n return;\r\n }\r\n\r\n let handled = true;\r\n\r\n switch (event.keyCode) {\r\n case keyCode.RIGHT:\r\n this.addDays(1);\r\n break;\r\n case keyCode.LEFT:\r\n this.addDays(-1);\r\n break;\r\n case keyCode.DOWN:\r\n this.addDays(7);\r\n break;\r\n case keyCode.UP:\r\n this.addDays(-7);\r\n break;\r\n case keyCode.PAGE_UP:\r\n if (event.shiftKey) {\r\n this.addYears(-1);\r\n } else {\r\n this.addMonths(-1);\r\n }\r\n break;\r\n case keyCode.PAGE_DOWN:\r\n if (event.shiftKey) {\r\n this.addYears(1);\r\n } else {\r\n this.addMonths(1);\r\n }\r\n break;\r\n case keyCode.HOME:\r\n this.startOfWeek();\r\n break;\r\n case keyCode.END:\r\n this.endOfWeek();\r\n break;\r\n default:\r\n handled = false;\r\n }\r\n\r\n if (handled) {\r\n event.preventDefault();\r\n this.enableActiveFocus();\r\n }\r\n };\r\n\r\n private handleDaySelect = (_event: MouseEvent, day: Date) => {\r\n if (!inRange(day, parseDutchDate(this.min), parseDutchDate(this.max))) {\r\n return;\r\n }\r\n\r\n if (day.getMonth() === this.focusedDay.getMonth()) {\r\n this.setValue(day);\r\n this.hide();\r\n } else {\r\n this.setFocusedDay(day);\r\n }\r\n };\r\n\r\n private handleMonthSelect = (e: Event) => {\r\n // Todo\r\n if (e.target instanceof HTMLSelectElement) {\r\n this.setMonth(parseInt(e.target.value, 10));\r\n }\r\n };\r\n\r\n private handleYearSelect = (e: Event) => {\r\n if (e.target instanceof HTMLSelectElement) {\r\n this.setYear(parseInt(e.target.value, 10));\r\n }\r\n };\r\n\r\n private handleInputChange = (e: Event) => {\r\n const target = e.target as HTMLInputElement;\r\n\r\n const cleanedValue = cleanValue(target, DISALLOWED_CHARACTERS);\r\n\r\n this.setValue(cleanedValue);\r\n };\r\n\r\n private setValue(value: Date | string) {\r\n const event = this.prepareEvent(value);\r\n\r\n this.value = typeof value === \"string\" ? value : event.value;\r\n\r\n if (this.value !== this.previousValue) {\r\n this.dsoDateChange.emit(event);\r\n this.previousValue = this.value;\r\n }\r\n }\r\n\r\n private prepareEvent = (value: Date | string): DsoDatePickerLegacyChangeEvent => {\r\n const event: DsoDatePickerLegacyChangeEvent = {\r\n component: \"dso-date-picker-legacy\",\r\n value: \"\",\r\n valueAsDate: undefined,\r\n };\r\n\r\n if (value instanceof Date) {\r\n event.valueAsDate = value;\r\n } else {\r\n event.value = value;\r\n event.valueAsDate = parseDutchDate(value);\r\n }\r\n\r\n if (event.valueAsDate) {\r\n event.value = printDutchDate(event.valueAsDate);\r\n }\r\n\r\n if (!event.valueAsDate && this.required) {\r\n event.error = \"required\";\r\n }\r\n\r\n if (event.value && !event.valueAsDate) {\r\n event.error = \"invalid\";\r\n }\r\n\r\n if (event.valueAsDate && (this.min || this.max)) {\r\n const min = parseDutchDate(this.min);\r\n const max = parseDutchDate(this.max);\r\n const clampValue = clamp(event.valueAsDate, min, max);\r\n\r\n if (clampValue !== event.valueAsDate && clampValue === min) {\r\n event.valueAsDate = undefined;\r\n event.error = \"min-range\";\r\n } else if (clampValue !== event.valueAsDate && clampValue === max) {\r\n event.valueAsDate = undefined;\r\n event.error = \"max-range\";\r\n }\r\n }\r\n\r\n return event;\r\n };\r\n\r\n private processFocusedDayNode = (element: HTMLButtonElement) => {\r\n this.focusedDayNode = element;\r\n\r\n if (this.activeFocus && this.open) {\r\n setTimeout(() => element.focus(), 0);\r\n }\r\n };\r\n\r\n componentWillLoad(): void | Promise<void> {\r\n const minDate = parseDutchDate(this.min);\r\n const maxDate = parseDutchDate(this.max);\r\n\r\n if (minDate && minDate > this.focusedDay) {\r\n this.focusedDay = minDate;\r\n }\r\n\r\n if (maxDate && maxDate < this.focusedDay) {\r\n this.focusedDay = maxDate;\r\n }\r\n }\r\n\r\n componentDidLoad() {\r\n const valueAsDate = parseDutchDate(this.value);\r\n if (valueAsDate) {\r\n this.previousValue = this.value = printDutchDate(valueAsDate);\r\n }\r\n\r\n if (this.dsoAutofocus) {\r\n this.setFocus();\r\n }\r\n }\r\n\r\n /**\r\n * render() function\r\n * Always the last one in the class.\r\n */\r\n render() {\r\n const valueAsDate = parseDutchDate(this.value);\r\n const formattedDate = valueAsDate && printDutchDate(valueAsDate);\r\n const selectedYear = (valueAsDate || this.focusedDay).getFullYear();\r\n const focusedMonth = this.focusedDay.getMonth();\r\n const focusedYear = this.focusedDay.getFullYear();\r\n\r\n const minDate = parseDutchDate(this.min);\r\n const maxDate = parseDutchDate(this.max);\r\n const prevMonthDisabled = minDate && minDate.getMonth() === focusedMonth && minDate.getFullYear() === focusedYear;\r\n const nextMonthDisabled = maxDate && maxDate.getMonth() === focusedMonth && maxDate.getFullYear() === focusedYear;\r\n\r\n let minYear = selectedYear - 10;\r\n let maxYear = selectedYear + 10;\r\n if (minDate) {\r\n minYear = Math.max(minYear, minDate.getFullYear());\r\n }\r\n if (maxDate) {\r\n maxYear = Math.min(maxYear, maxDate.getFullYear());\r\n }\r\n\r\n return (\r\n <Host>\r\n <div class={{ \"dso-date\": true, \"dso-visible\": this.visible }}>\r\n <div class=\"dso-date__input-wrapper\">\r\n <input\r\n class=\"dso-date__input\"\r\n value={this.value}\r\n placeholder={this.localization.placeholder}\r\n id={this.identifier}\r\n disabled={this.disabled}\r\n role={this.role ?? undefined}\r\n required={this.required ? true : undefined}\r\n aria-autocomplete=\"none\"\r\n aria-invalid={this.invalid?.toString()}\r\n aria-describedby={this.describedBy}\r\n onInput={this.handleInputChange}\r\n onFocus={this.handleFocus}\r\n onBlur={this.handleBlur}\r\n onKeyUp={this.handleKeyUp}\r\n onKeyDown={this.handleKeyDown}\r\n autoComplete=\"off\"\r\n ref={(element) => (this.datePickerLegacyInput = element)}\r\n />\r\n <button\r\n type=\"button\"\r\n class=\"dso-date__toggle\"\r\n onClick={this.toggleOpen}\r\n disabled={this.disabled}\r\n ref={(element) => (this.datePickerLegacyButton = element)}\r\n >\r\n <span class=\"dso-date__toggle-icon\">\r\n <dso-icon icon=\"calendar\"></dso-icon>\r\n </span>\r\n <span class=\"dso-date__vhidden\">\r\n {this.localization.buttonLabel}\r\n {formattedDate && (\r\n <span>\r\n , {this.localization.selectedDateMessage} {formattedDate}\r\n </span>\r\n )}\r\n </span>\r\n </button>\r\n </div>\r\n\r\n <div\r\n class={{\r\n \"dso-date__dialog\": true,\r\n \"is-left\": this.direction === \"left\",\r\n \"is-active\": this.open,\r\n }}\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n aria-hidden={this.open ? \"false\" : \"true\"}\r\n aria-labelledby={this.dialogLabelId}\r\n onTouchMove={this.handleTouchMove}\r\n onTouchStart={this.handleTouchStart}\r\n onTouchEnd={this.handleTouchEnd}\r\n >\r\n <div class=\"dso-date__dialog-content\" onKeyDown={this.handleEscKey}>\r\n <div class=\"dso-date__vhidden dso-date__instructions\" aria-live=\"polite\">\r\n {this.localization.keyboardInstruction}\r\n </div>\r\n <div class=\"dso-date__mobile\" onFocusin={this.disableActiveFocus}>\r\n <label class=\"dso-date__mobile-heading\">{this.localization.calendarHeading}</label>\r\n <button\r\n class=\"dso-date__close\"\r\n ref={(element) => (this.firstFocusableElement = element)}\r\n onKeyDown={this.handleFirstFocusableKeydown}\r\n onClick={() => this.hide()}\r\n type=\"button\"\r\n >\r\n <dso-icon icon=\"times\"></dso-icon>\r\n <span class=\"dso-date__vhidden\">{this.localization.closeLabel}</span>\r\n </button>\r\n </div>\r\n <div class=\"dso-date__header\" onFocusin={this.disableActiveFocus}>\r\n <div>\r\n <h2 id={this.dialogLabelId} class=\"dso-date__vhidden\" aria-live=\"polite\">\r\n {this.localization.monthNames[focusedMonth]} {this.focusedDay.getFullYear()}\r\n </h2>\r\n\r\n <label htmlFor={this.monthSelectId} class=\"dso-date__vhidden\">\r\n {this.localization.monthSelectLabel}\r\n </label>\r\n <div class=\"dso-date__select\">\r\n <select\r\n id={this.monthSelectId}\r\n class=\"dso-date__select--month\"\r\n ref={(element) => (this.monthSelectNode = element)}\r\n onChange={this.handleMonthSelect}\r\n >\r\n {monthRange(this.localization, selectedYear, minDate, maxDate).map((month) => {\r\n const index = this.localization.monthNames.indexOf(month);\r\n\r\n return (\r\n <option key={month} value={index} selected={index === focusedMonth}>\r\n {month}\r\n </option>\r\n );\r\n })}\r\n </select>\r\n <div class=\"dso-date__select-label\" aria-hidden=\"true\">\r\n <span>{this.localization.monthNamesShort[focusedMonth]}</span>\r\n <dso-icon icon=\"chevron-down\"></dso-icon>\r\n </div>\r\n </div>\r\n\r\n <label htmlFor={this.yearSelectId} class=\"dso-date__vhidden\">\r\n {this.localization.yearSelectLabel}\r\n </label>\r\n <div class=\"dso-date__select\">\r\n <select id={this.yearSelectId} class=\"dso-date__select--year\" onChange={this.handleYearSelect}>\r\n {range(minYear, maxYear).map((year) => (\r\n <option key={year} selected={year === focusedYear}>\r\n {year}\r\n </option>\r\n ))}\r\n </select>\r\n <div class=\"dso-date__select-label\" aria-hidden=\"true\">\r\n <span>{this.focusedDay.getFullYear()}</span>\r\n <dso-icon icon=\"chevron-down\"></dso-icon>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"dso-date__nav\">\r\n <button\r\n class=\"dso-date__prev\"\r\n onClick={this.handlePreviousMonthClick}\r\n disabled={prevMonthDisabled}\r\n type=\"button\"\r\n >\r\n <dso-icon icon=\"chevron-left\"></dso-icon>\r\n <span class=\"dso-date__vhidden\">{this.localization.prevMonthLabel}</span>\r\n </button>\r\n <button\r\n class=\"dso-date__next\"\r\n onClick={this.handleNextMonthClick}\r\n disabled={nextMonthDisabled}\r\n type=\"button\"\r\n >\r\n <dso-icon icon=\"chevron-right\"></dso-icon>\r\n <span class=\"dso-date__vhidden\">{this.localization.nextMonthLabel}</span>\r\n </button>\r\n </div>\r\n </div>\r\n <DatePickerLegacyMonth\r\n selectedDate={valueAsDate}\r\n focusedDate={this.focusedDay}\r\n onDateSelect={this.handleDaySelect}\r\n onKeyboardNavigation={this.handleKeyboardNavigation}\r\n labelledById={this.dialogLabelId}\r\n localization={this.localization}\r\n firstDayOfWeek={this.firstDayOfWeek}\r\n focusedDayRef={this.processFocusedDayNode}\r\n min={minDate}\r\n max={maxDate}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"],"mappings":"oGACA,IAAYA,GAAZ,SAAYA,GACVA,IAAA,sBACAA,IAAA,sBACAA,IAAA,wBACAA,IAAA,4BACAA,IAAA,0BACAA,IAAA,sBACAA,IAAA,yBACD,EARD,CAAYA,MAAU,K,SAUNC,EAAWC,EAAcC,EAAeC,GACtD,MAAMC,EAASC,SAASF,EAAK,IAC7B,MAAMG,EAAWD,SAASH,EAAO,IACjC,MAAMK,EAAUF,SAASJ,EAAM,IAE/B,MAAMO,EACJC,OAAOC,UAAUH,IACjBE,OAAOC,UAAUJ,IACjBG,OAAOC,UAAUN,IACjBE,EAAW,GACXA,GAAY,IACZF,EAAS,GACTA,GAAU,IACVG,EAAU,EAEZ,GAAIC,EAAS,CACX,OAAO,IAAIG,KAAKJ,EAASD,EAAW,EAAGF,E,CAE3C,C,SAKgBQ,EAAeC,GAC7B,IAAKA,EAAO,CACV,M,CAGF,MAAMC,EAAUD,EAAME,MAAM,KAE5B,GACED,EAAQE,SAAW,UACZF,EAAQ,KAAO,iBACfA,EAAQ,KAAO,iBACfA,EAAQ,KAAO,UACtBA,EAAQ,GAAGE,SAAW,EACtB,CACA,OAAOhB,EAAWc,EAAQ,GAAIA,EAAQ,GAAIA,EAAQ,G,CAEtD,C,SAMgBG,EAAeC,GAC7B,IAAKA,EAAM,CACT,MAAO,E,CAGT,MAAMC,EAAID,EAAKE,UAAUC,SAAS,IAAIC,SAAS,EAAG,KAClD,MAAMC,GAAKL,EAAKM,WAAa,GAAGH,SAAS,IAAIC,SAAS,EAAG,KACzD,MAAMG,EAAIP,EAAKQ,cAAcL,SAAS,IAAIC,SAAS,EAAG,KAEtD,MAAO,GAAGH,KAAKI,KAAKE,GACtB,C,SAKgBE,EAAQC,EAAqBC,GAC3C,IAAKD,IAAMC,EAAG,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AagB,mBAIzD3C,EAACuB,EAAqB,CAAA+K,IAAA,2CACpB9K,aAAc2I,EACd1I,YAAasE,KAAK1G,WAClBuC,aAAcmE,KAAKyD,gBACnBhK,qBAAsBuG,KAAKqD,yBAC3B1H,aAAcqE,KAAKI,cACnBxE,aAAcoE,KAAKpE,aACnB7D,eAAgBiI,KAAKjI,eACrB2B,cAAesG,KAAKwE,sBACpB9L,IAAK4E,EACL3E,IAAK4E,O"}
|
|
@@ -164,12 +164,12 @@ const AccordionSection = class {
|
|
|
164
164
|
var _a;
|
|
165
165
|
const { variant, reverseAlign } = (_a = this.accordionState) !== null && _a !== void 0 ? _a : {};
|
|
166
166
|
const hasAddons = !!this.statusDescription || !!this.status || !!this.icon || !!this.attachmentCount;
|
|
167
|
-
return (h(Host, { key: '
|
|
167
|
+
return (h(Host, { key: 'e6d935b422454ca54ef161939dbe7ff8707cd336', class: {
|
|
168
168
|
"dso-accordion-section": true,
|
|
169
169
|
["dso-accordion-" + variant]: true,
|
|
170
170
|
"dso-nested-accordion": this.hasNestedAccordion || this.containsNestedAccordion,
|
|
171
171
|
"dso-accordion-reverse-align": reverseAlign !== null && reverseAlign !== void 0 ? reverseAlign : false,
|
|
172
|
-
}, hidden: !variant, onMouseenter: () => (this.hover = true), onMouseleave: () => (this.hover = false) }, h(Handle, { key: '
|
|
172
|
+
}, hidden: !variant, onMouseenter: () => (this.hover = true), onMouseleave: () => (this.hover = false) }, h(Handle, { key: 'df0aade07259ea950aa2d5af7fc78d318607f99f', heading: this.heading, ref: (element) => (this.sectionHeading = element) }, h(HandleElement, { key: 'c3113baab09dcb2429f2755558f47bd5cd0f81f2', handleUrl: this.handleUrl, onClick: this.handleClick, open: this.open, handleElementRef: (e) => (this.handleElementRef = e) }, reverseAlign ? (h(Fragment, null, hasAddons && (h("div", { class: "dso-section-handle-addons" }, h(HandleIcon, { icon: this.icon }))), h("span", null, this.handleTitle), h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-down" }))) : (h(Fragment, null, h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-right" }), this.status && h("span", { class: "sr-only" }, stateMap[this.status]), h("span", null, this.handleTitle, this.isNeutral && (h("dso-icon", { class: "info-icon", icon: this.open || this.hover ? "info-active" : "info" }))), hasAddons && (h("div", { class: "dso-section-handle-addons" }, this.statusDescription && h("span", { class: "dso-status" }, this.statusDescription), h(HandleIcon, { state: this.status, icon: this.icon, attachmentCount: this.attachmentCount }))))))), h("dso-expandable", { key: 'fc46969992194a44e6118eae4d1ad7c52c4d5105', class: "dso-section-body", open: this.open, enableAnimation: true, minimumHeight: this.isNeutral ? 0 : 4, onDsoExpandableAnimationStart: this.handleExpandableAnimationStart, onDsoExpandableAnimationEnd: this.handleExpandableAnimationEnd }, h("div", { key: '72b09c8a6e9121e3454b796cfcc4b248cae2733f', class: "dso-section-body-content", ref: (element) => (this.sectionBody = element) }, h("slot", { key: 'a45f7c226d70d44f86e58c960c486960586fd62f' })))));
|
|
173
173
|
}
|
|
174
174
|
get host() { return getElement(this); }
|
|
175
175
|
};
|
|
@@ -219,7 +219,7 @@ const Accordion = class {
|
|
|
219
219
|
this.accordionState = state;
|
|
220
220
|
}
|
|
221
221
|
render() {
|
|
222
|
-
return (h(Host, { key: '
|
|
222
|
+
return (h(Host, { key: 'ff5ce15d5c8f250a00fd32179023c5640fcdaa60', class: "dso-accordion" }, h("slot", { key: '4d8471b5d095ccfb38184cba1c1dab7f958638aa' })));
|
|
223
223
|
}
|
|
224
224
|
get host() { return getElement(this); }
|
|
225
225
|
static get watchers() { return {
|
|
@@ -13,10 +13,10 @@ const ActionListItem = class {
|
|
|
13
13
|
this.divider = false;
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return (h(Host, { key: '
|
|
16
|
+
return (h(Host, { key: 'e8990e05c76ad77722c3077377a14b8595359cf1', class: {
|
|
17
17
|
divider: this.divider,
|
|
18
18
|
"flow-line": this.flowLine,
|
|
19
|
-
} }, h("div", { key: '
|
|
19
|
+
} }, h("div", { key: 'f1f9bc9160d015bec044d56f6f9d4bdc8cfcb6c0', class: "dso-action-list-item" }, this.warning ? h("dso-icon", { icon: "status-warning" }) : h("div", { class: "dso-step-counter" }, this.step), h("div", { key: '4fccf3d1ae0fc47154ee934ed6e5fb067b5ff059', class: "action-list-item-content" }, this.itemTitle && h("h3", { key: '284707c09c1452c332353c2ac04f519ccc8fc409' }, this.itemTitle), h("slot", { key: 'd90f788cdbde8734a8130731808a2cb04495faa2' })))));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
ActionListItem.style = DsoActionListItemStyle0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"dso-action-list-item.entry.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,6zCAA6zC,CAAC;AACx1C,gCAAe,iBAAiB;;MCMnB,cAAc;;;;;wBAiBd,KAAK;uBAMN,KAAK;uBAML,KAAK;;IAEf,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,WAAW,EAAE,IAAI,CAAC,QAAQ;aAC3B,IAED,4DAAK,KAAK,EAAC,sBAAsB,IAC9B,IAAI,CAAC,OAAO,GAAG,gBAAU,IAAI,EAAC,gBAAgB,GAAY,GAAG,WAAK,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,IAAI,CAAO,EAC7G,4DAAK,KAAK,EAAC,0BAA0B,IAClC,IAAI,CAAC,SAAS,IAAI,
|
|
1
|
+
{"file":"dso-action-list-item.entry.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,6zCAA6zC,CAAC;AACx1C,gCAAe,iBAAiB;;MCMnB,cAAc;;;;;wBAiBd,KAAK;uBAMN,KAAK;uBAML,KAAK;;IAEf,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,WAAW,EAAE,IAAI,CAAC,QAAQ;aAC3B,IAED,4DAAK,KAAK,EAAC,sBAAsB,IAC9B,IAAI,CAAC,OAAO,GAAG,gBAAU,IAAI,EAAC,gBAAgB,GAAY,GAAG,WAAK,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,IAAI,CAAO,EAC7G,4DAAK,KAAK,EAAC,0BAA0B,IAClC,IAAI,CAAC,SAAS,IAAI,6DAAK,IAAI,CAAC,SAAS,CAAM,EAC5C,8DAAQ,CACJ,CACF,CACD,EACP;KACH;;;;;;","names":[],"sources":["src/components/action-list/components/action-list-item.scss?tag=dso-action-list-item&encapsulation=shadow","src/components/action-list/components/action-list-item.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/variables/media-query-breakpoints\";\r\n@use \"~dso-toolkit/src/components/headings\";\r\n@use \"~dso-toolkit/src/components/step-counter\";\r\n@use \"~dso-toolkit/src/components/action-list/action-list.variables\" as action-list-variables;\r\n@use \"~dso-toolkit/src/components/action-list/components/action-list-item.variables\" as action-list-item-variables;\r\n\r\n@include utilities.box-sizing();\r\n\r\n:host {\r\n @include step-counter.step-counter();\r\n\r\n display: block;\r\n padding-block: action-list-item-variables.$padding-vertical;\r\n position: relative;\r\n}\r\n\r\n:host(.divider) {\r\n .dso-action-list-item {\r\n &::after {\r\n border-bottom: 0.25rem dashed colors.$lichtblauw;\r\n bottom: 0;\r\n content: \"\";\r\n display: block;\r\n height: units.$u3;\r\n position: absolute;\r\n left: calc(action-list-variables.$content-indent - action-list-item-variables.$step-counter-margin);\r\n width: calc(100% - (action-list-variables.$content-indent - action-list-item-variables.$step-counter-margin));\r\n\r\n @media screen and (min-width: media-query-breakpoints.$screen-xs-min) {\r\n left: action-list-variables.$content-indent;\r\n width: calc(100% - action-list-variables.$content-indent);\r\n }\r\n }\r\n }\r\n}\r\n\r\nh3 {\r\n @include headings.base();\r\n @include headings.h3();\r\n\r\n margin-block-end: units.$u2;\r\n margin-block-start: 0;\r\n min-height: units.$u6;\r\n padding-block-start: 9px;\r\n}\r\n\r\n.dso-action-list-item {\r\n display: grid;\r\n grid-template-columns: calc(action-list-variables.$content-indent - action-list-item-variables.$step-counter-margin) 1fr;\r\n\r\n @media screen and (min-width: media-query-breakpoints.$screen-xs-min) {\r\n grid-template-columns: action-list-variables.$content-indent 1fr;\r\n }\r\n\r\n .dso-step-counter {\r\n position: unset;\r\n }\r\n\r\n .action-list-item-content {\r\n grid-column: 2 / 2;\r\n }\r\n}\r\n\r\ndso-icon {\r\n height: units.$u6;\r\n width: units.$u6;\r\n}\r\n","import { h, Component, ComponentInterface, Host, Prop } from \"@stencil/core\";\r\n\r\n@Component({\r\n tag: \"dso-action-list-item\",\r\n styleUrl: \"action-list-item.scss\",\r\n shadow: true,\r\n})\r\nexport class ActionListItem implements ComponentInterface {\r\n /**\r\n * The step of the Action List Item.\r\n */\r\n @Prop()\r\n step!: number;\r\n\r\n /**\r\n * The title of the item.\r\n */\r\n @Prop()\r\n itemTitle?: string;\r\n\r\n /**\r\n * Show flow line to next step\r\n */\r\n @Prop()\r\n flowLine = false;\r\n\r\n /**\r\n * When there is a warning.\r\n */\r\n @Prop()\r\n warning = false;\r\n\r\n /**\r\n * Places a dashed line at the bottom of the item.\r\n */\r\n @Prop()\r\n divider = false;\r\n\r\n render() {\r\n return (\r\n <Host\r\n class={{\r\n divider: this.divider,\r\n \"flow-line\": this.flowLine,\r\n }}\r\n >\r\n <div class=\"dso-action-list-item\">\r\n {this.warning ? <dso-icon icon=\"status-warning\"></dso-icon> : <div class=\"dso-step-counter\">{this.step}</div>}\r\n <div class=\"action-list-item-content\">\r\n {this.itemTitle && <h3>{this.itemTitle}</h3>}\r\n <slot />\r\n </div>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"],"version":3}
|
|
@@ -9,7 +9,7 @@ const ActionList = class {
|
|
|
9
9
|
this.listTitle = undefined;
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: 'ccfbfad51860c767b58f0d1c5f8c41beac645353' }, h("h2", { key: 'dee9b4b9b262637e1c4a944df6f26ec984d6d4ae' }, this.listTitle), h("div", { key: '2d725e445a201bf47ccb837e4251aae65bfc0ba2', class: "dso-action-list-content" }, h("slot", { key: '9947aab99743404054b4c5f678da57813462f9e0' }))));
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
ActionList.style = DsoActionListStyle0;
|
|
@@ -79,12 +79,12 @@ const AdvancedSelect = class {
|
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
81
|
var _a, _b;
|
|
82
|
-
return (h(Fragment, null, h("button", { key: '
|
|
82
|
+
return (h(Fragment, null, h("button", { key: 'faa2a464654b5588270e5167fd6fcbd02bcb2e4c', "aria-expanded": this.open.toString(), class: clsx(["active-option", { open: this.open }]), type: "button", onClick: this.toggleOpen, ref: (element) => (this.toggleButtonElementRef = element) }, h("span", { key: 'f6ac64547bde1524cb7d3b58c58bf869dc726f65', class: "active-option-label" }, (_b = (_a = this.active) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : "Selecteer een optie"), h("span", { key: '5aa6fbc03ef2b9452cbe9c6af20ce402bf5d0a3f', class: "active-option-aside" }, this.options.some((optionOrGroup) => "summaryCounter" in optionOrGroup && (optionOrGroup === null || optionOrGroup === void 0 ? void 0 : optionOrGroup.summaryCounter)) && (h("span", { key: '44fe615ffd6638471c4d8022a654296405b9311a', class: "badges" }, this.options
|
|
83
83
|
.filter((option) => "options" in option && "summaryCounter" in option && !!(option === null || option === void 0 ? void 0 : option.summaryCounter))
|
|
84
84
|
.map((group) => {
|
|
85
85
|
var _a;
|
|
86
86
|
return (h("dso-badge", { status: (_a = group.variant) !== null && _a !== void 0 ? _a : "outline" }, group.options.length));
|
|
87
|
-
}))), h("dso-icon", { key: '
|
|
87
|
+
}))), h("dso-icon", { key: 'b0a5459c6c17c7d109b88a923054c85cc2a9c75f', icon: "caret-down" }))), this.open && (h("div", { key: 'f1490ff92e27d6b970558c83ccab35efec989597', class: "groups-container" }, h("ul", { key: 'a10ee50e10d87e7437cb9a51bc349207f82725fc', class: "groups" }, this.options.map((optionOrGroup) => ("options" in optionOrGroup && (h("li", { class: clsx(["group", { [`group-${optionOrGroup.variant}`]: !!optionOrGroup.variant }]) }, h("p", { class: "group-label" }, optionOrGroup.label), h("ul", { class: "options" }, optionOrGroup.options.map((option) => (h("li", null, h(OptionElement, { option: option, active: this.active, activeHint: this.activeHint, callback: this.handleOptionClick }))))), optionOrGroup.redirect && (h(RedirectElement, { redirect: optionOrGroup.redirect, callback: this.handleRedirectClick }))))) ||
|
|
88
88
|
("placeholder" in optionOrGroup && (h("li", { class: "group" }, h("p", { class: "group-label" }, optionOrGroup.label), h(PlaceholderElement, { placeholder: optionOrGroup.placeholder }), optionOrGroup.redirect && (h(RedirectElement, { redirect: optionOrGroup.redirect, callback: this.handleRedirectClick }))))) || (h("li", null, h(OptionElement, { option: optionOrGroup, active: this.active, activeHint: this.activeHint, callback: this.handleOptionClick })))))))));
|
|
89
89
|
}
|
|
90
90
|
get host() { return getElement(this); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"dso-advanced-select.entry.js","mappings":";;;;;;AAAA,MAAM,iBAAiB,GAAG,2uFAA2uF,CAAC;AACtwF,gCAAe,iBAAiB;;MC8BnB,cAAc;;;;;QA+DjB,eAAU,GAAG;YACnB,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;SACxB,CAAC;QAmCM,sBAAiB,GAAG,CAAC,KAAiB,EAAE,MAAmC;YACjF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YACtD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;SACnB,CAAC;QAEM,wBAAmB,GAAG,CAAC,KAAiB,EAAE,QAAq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,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,IAC7E,QAAQ,CAAC,KAAK,EACf,gBAAU,IAAI,EAAC,eAAe,GAAY,CACxC,CACL,CAAC;;;;;","names":[],"sources":["src/components/advanced-select/advanced-select.scss?tag=dso-advanced-select&encapsulation=shadow","src/components/advanced-select/advanced-select.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/global/mixins/set-colors.mixin\" as set-colors;\r\n@use \"~dso-toolkit/src/components/advanced-select\";\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n\r\n.active-option {\r\n display: flex;\r\n inline-size: 100%;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 0;\r\n border: 1px solid advanced-select.$border-color;\r\n border-radius: advanced-select.$border-radius;\r\n cursor: pointer;\r\n background-color: advanced-select.$bg-color;\r\n line-height: inherit;\r\n font-family: inherit;\r\n font-size: inherit;\r\n\r\n &.open {\r\n border-radius: advanced-select.$border-radius advanced-select.$border-radius 0 0;\r\n }\r\n\r\n dso-icon {\r\n color: advanced-select.$icon-color;\r\n }\r\n}\r\n\r\n.active-option-label {\r\n padding: advanced-select.$vertical-padding advanced-select.$horizontal-padding;\r\n overflow: hidden;\r\n /* stylelint-disable-next-line declaration-property-value-disallowed-list -- Nodig om lange titels op de zelfde regel te houden */\r\n white-space: nowrap;\r\n /* stylelint-disable-next-line declaration-property-value-disallowed-list -- Nodig om lange titels op de zelfde regel te houden */\r\n text-overflow: ellipsis;\r\n}\r\n\r\n.active-option-aside {\r\n display: flex;\r\n align-items: center;\r\n gap: advanced-select.$horizontal-padding * 0.5;\r\n padding: 0 advanced-select.$horizontal-padding * 0.5;\r\n}\r\n\r\n.badges {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n gap: advanced-select.$vertical-padding;\r\n}\r\n\r\n.groups-container {\r\n position: relative;\r\n}\r\n\r\n.groups {\r\n position: absolute;\r\n inset-block-start: -1px;\r\n inset-inline-start: 0;\r\n inline-size: 100%;\r\n max-block-size: 500px;\r\n margin: 0;\r\n padding: 0;\r\n overflow-y: auto;\r\n background-color: advanced-select.$bg-color;\r\n border: 1px solid advanced-select.$border-color;\r\n border-radius: 0 0 advanced-select.$border-radius advanced-select.$border-radius;\r\n\r\n li {\r\n &::marker {\r\n display: none;\r\n }\r\n }\r\n}\r\n\r\n.group {\r\n border-bottom: 1px solid advanced-select.$hr-color;\r\n\r\n &:last-child {\r\n border-bottom: none;\r\n }\r\n\r\n .option {\r\n padding-left: advanced-select.$horizontal-padding * 2 + advanced-select.$option-dot-size * 0.5;\r\n }\r\n\r\n .option-label::before {\r\n content: \"\";\r\n position: absolute;\r\n display: block;\r\n block-size: advanced-select.$option-dot-size;\r\n inline-size: advanced-select.$option-dot-size;\r\n inset: advanced-select.$vertical-padding auto auto -#{advanced-select.$option-dot-size * 2};\r\n border-radius: 50%;\r\n @include set-colors.apply(advanced-select.$default-variant-color, $icons: false, $links: false);\r\n }\r\n}\r\n\r\n.group-label {\r\n margin: 0;\r\n padding: advanced-select.$vertical-padding advanced-select.$horizontal-padding;\r\n color: advanced-select.$group-label-color;\r\n font-size: advanced-select.$group-label-font-size;\r\n font-weight: advanced-select.$group-label-font-weight;\r\n border-bottom: 1px solid advanced-select.$hr-color;\r\n}\r\n\r\n.group-link {\r\n display: block;\r\n padding: advanced-select.$group-link-horizontal-padding advanced-select.$group-link-vertical-padding;\r\n text-align: end;\r\n color: advanced-select.$group-link-color;\r\n text-decoration: none;\r\n\r\n &:hover {\r\n text-decoration: underline;\r\n }\r\n\r\n dso-icon {\r\n color: advanced-select.$redirect-icon-color;\r\n }\r\n}\r\n\r\n.group-info .option-label::before {\r\n @include set-colors.apply(advanced-select.$info-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-primary .option-label::before {\r\n @include set-colors.apply(advanced-select.$primary-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-success .option-label::before {\r\n @include set-colors.apply(advanced-select.$success-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-warning .option-label::before {\r\n @include set-colors.apply(advanced-select.$warning-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-danger .option-label::before {\r\n @include set-colors.apply(advanced-select.$danger-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-error .option-label::before {\r\n @include set-colors.apply(advanced-select.$error-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-attention .option-label::before {\r\n @include set-colors.apply(advanced-select.$attention-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.options {\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n.option {\r\n display: block;\r\n inline-size: 100%;\r\n padding: advanced-select.$vertical-padding * 2 advanced-select.$horizontal-padding;\r\n cursor: pointer;\r\n line-height: inherit;\r\n font-family: inherit;\r\n font-size: inherit;\r\n border: none;\r\n text-align: left;\r\n background-color: advanced-select.$bg-color;\r\n\r\n &:hover {\r\n background-color: advanced-select.$option-hover-bg-color;\r\n\r\n .option-label {\r\n color: advanced-select.$option-hover-color;\r\n font-weight: advanced-select.$option-hover-font-weight;\r\n }\r\n }\r\n}\r\n\r\n.option.option-active .option-label {\r\n color: advanced-select.$option-active-color;\r\n font-weight: advanced-select.$option-active-font-weight;\r\n text-decoration: underline;\r\n}\r\n\r\n.option-label {\r\n position: relative;\r\n color: advanced-select.$option-color;\r\n font-size: advanced-select.$option-font-size;\r\n font-weight: advanced-select.$option-font-weight;\r\n}\r\n\r\n.option-hint {\r\n padding-left: 5px;\r\n color: advanced-select.$option-active-color;\r\n font-size: advanced-select.$option-font-size;\r\n font-weight: advanced-select.$option-active-font-weight;\r\n}\r\n\r\n.placeholder {\r\n margin: 0;\r\n padding: advanced-select.$vertical-padding * 2 advanced-select.$horizontal-padding;\r\n color: advanced-select.$option-placeholder-color;\r\n}\r\n","import {\r\n Component,\r\n ComponentInterface,\r\n Prop,\r\n h,\r\n FunctionalComponent,\r\n Element,\r\n Event,\r\n EventEmitter,\r\n State,\r\n Fragment,\r\n Listen,\r\n} from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\nimport {\r\n AdvancedSelectGroup,\r\n AdvancedSelectGroupRedirect,\r\n AdvancedSelectOption,\r\n AdvancedSelectChangeEvent,\r\n AdvancedSelectOptionOrGroup,\r\n AdvancedSelectRedirectEvent,\r\n} from \"./advanced-select.models\";\r\nimport { createFocusTrap, FocusTrap } from \"focus-trap\";\r\nimport { tabbable } from \"tabbable\";\r\nimport { isModifiedEvent } from \"../../utils/is-modified-event\";\r\n\r\n@Component({\r\n tag: \"dso-advanced-select\",\r\n styleUrl: \"advanced-select.scss\",\r\n shadow: true,\r\n})\r\nexport class AdvancedSelect implements ComponentInterface {\r\n private trap?: FocusTrap;\r\n\r\n @Element()\r\n host!: HTMLDsoAdvancedSelectElement;\r\n\r\n /**\r\n * The options to display in the select.\r\n */\r\n @Prop()\r\n options: AdvancedSelectOptionOrGroup<never>[] = [];\r\n\r\n /**\r\n * The active option. By object reference.\r\n */\r\n @Prop()\r\n active?: AdvancedSelectOption<never>;\r\n\r\n /**\r\n * An extra text for the active option. Only visible in the list of options.\r\n */\r\n @Prop()\r\n activeHint?: string;\r\n\r\n /**\r\n * The open state of the options list.\r\n */\r\n @State()\r\n open: boolean = false;\r\n\r\n /**\r\n * Emitted when user selects an option\r\n */\r\n @Event({ bubbles: false })\r\n dsoChange!: EventEmitter<AdvancedSelectChangeEvent<never>>;\r\n\r\n /**\r\n * Emitted when user activates a group redirect link.\r\n */\r\n @Event({ bubbles: false })\r\n dsoRedirect!: EventEmitter<AdvancedSelectRedirectEvent>;\r\n\r\n private toggleButtonElementRef: HTMLButtonElement | undefined;\r\n\r\n @Listen(\"keydown\", { target: \"window\" })\r\n keyDownListener(event: KeyboardEvent) {\r\n if (this.open && event.key === \"ArrowUp\") {\r\n event.preventDefault();\r\n this.handleTab(-1);\r\n } else if (this.open && event.key === \"ArrowDown\") {\r\n event.preventDefault();\r\n this.handleTab(1);\r\n }\r\n }\r\n\r\n componentDidRender() {\r\n if (this.open && !this.trap) {\r\n this.createTrap();\r\n } else if (!this.open && this.trap) {\r\n this.removeTrap();\r\n }\r\n }\r\n\r\n private toggleOpen = () => {\r\n this.open = !this.open;\r\n };\r\n\r\n private createTrap() {\r\n this.trap = createFocusTrap(this.host, {\r\n clickOutsideDeactivates: true,\r\n escapeDeactivates: true,\r\n setReturnFocus: this.toggleButtonElementRef,\r\n tabbableOptions: {\r\n getShadowRoot: true,\r\n },\r\n onDeactivate: () => {\r\n this.open = false;\r\n },\r\n }).activate();\r\n }\r\n\r\n private removeTrap() {\r\n this.trap?.deactivate();\r\n delete this.trap;\r\n }\r\n\r\n private handleTab(direction: number) {\r\n const elements = tabbable(this.host, { getShadowRoot: true });\r\n const currentIndex = elements.findIndex((e) => e === this.host.shadowRoot?.activeElement);\r\n\r\n let nextIndex = currentIndex + direction;\r\n if (nextIndex >= elements.length) {\r\n nextIndex = 0;\r\n } else if (nextIndex < 0) {\r\n nextIndex = elements.length - 1;\r\n }\r\n\r\n elements[nextIndex]?.focus();\r\n }\r\n\r\n private handleOptionClick = (event: MouseEvent, option: AdvancedSelectOption<never>) => {\r\n this.dsoChange.emit({ originalEvent: event, option });\r\n this.open = false;\r\n };\r\n\r\n private handleRedirectClick = (event: MouseEvent, redirect: AdvancedSelectGroupRedirect) => {\r\n this.dsoRedirect.emit({ originalEvent: event, isModifiedEvent: isModifiedEvent(event), redirect });\r\n this.open = false;\r\n };\r\n\r\n render() {\r\n return (\r\n <>\r\n <button\r\n aria-expanded={this.open.toString()}\r\n class={clsx([\"active-option\", { open: this.open }])}\r\n type=\"button\"\r\n onClick={this.toggleOpen}\r\n ref={(element) => (this.toggleButtonElementRef = element)}\r\n >\r\n <span class=\"active-option-label\">{this.active?.label ?? \"Selecteer een optie\"}</span>\r\n <span class=\"active-option-aside\">\r\n {this.options.some(\r\n (optionOrGroup) => \"summaryCounter\" in optionOrGroup && optionOrGroup?.summaryCounter,\r\n ) && (\r\n <span class=\"badges\">\r\n {this.options\r\n .filter(\r\n (option): option is AdvancedSelectGroup<never> =>\r\n \"options\" in option && \"summaryCounter\" in option && !!option?.summaryCounter,\r\n )\r\n .map((group) => (\r\n <dso-badge status={group.variant ?? \"outline\"}>{group.options.length}</dso-badge>\r\n ))}\r\n </span>\r\n )}\r\n <dso-icon icon=\"caret-down\"></dso-icon>\r\n </span>\r\n </button>\r\n {this.open && (\r\n <div class=\"groups-container\">\r\n <ul class=\"groups\">\r\n {this.options.map(\r\n (optionOrGroup) =>\r\n (\"options\" in optionOrGroup && (\r\n <li class={clsx([\"group\", { [`group-${optionOrGroup.variant}`]: !!optionOrGroup.variant }])}>\r\n <p class=\"group-label\">{optionOrGroup.label}</p>\r\n <ul class=\"options\">\r\n {optionOrGroup.options.map((option) => (\r\n <li>\r\n <OptionElement\r\n option={option}\r\n active={this.active}\r\n activeHint={this.activeHint}\r\n callback={this.handleOptionClick}\r\n />\r\n </li>\r\n ))}\r\n </ul>\r\n {optionOrGroup.redirect && (\r\n <RedirectElement\r\n redirect={optionOrGroup.redirect}\r\n callback={this.handleRedirectClick}\r\n ></RedirectElement>\r\n )}\r\n </li>\r\n )) ||\r\n (\"placeholder\" in optionOrGroup && (\r\n <li class=\"group\">\r\n <p class=\"group-label\">{optionOrGroup.label}</p>\r\n <PlaceholderElement placeholder={optionOrGroup.placeholder}></PlaceholderElement>\r\n {optionOrGroup.redirect && (\r\n <RedirectElement\r\n redirect={optionOrGroup.redirect}\r\n callback={this.handleRedirectClick}\r\n ></RedirectElement>\r\n )}\r\n </li>\r\n )) || (\r\n <li>\r\n <OptionElement\r\n option={optionOrGroup}\r\n active={this.active}\r\n activeHint={this.activeHint}\r\n callback={this.handleOptionClick}\r\n />\r\n </li>\r\n ),\r\n )}\r\n </ul>\r\n </div>\r\n )}\r\n </>\r\n );\r\n }\r\n}\r\n\r\nconst PlaceholderElement: FunctionalComponent<{\r\n placeholder: string;\r\n}> = ({ placeholder }) => <p class=\"placeholder\">{placeholder}</p>;\r\n\r\nconst OptionElement: FunctionalComponent<{\r\n option: AdvancedSelectOption<never>;\r\n active: AdvancedSelectOption<never> | undefined;\r\n activeHint: string | undefined;\r\n callback: (event: MouseEvent, value: AdvancedSelectOption<never>) => void;\r\n}> = ({ option, active, activeHint, callback }) => (\r\n <button\r\n class={clsx([\"option\", { \"option-active\": active === option }])}\r\n type=\"button\"\r\n onClick={(e) => callback(e, option)}\r\n >\r\n <span class=\"option-label\">{option.label}</span>\r\n {!!activeHint && active === option && <span class=\"option-hint\">({activeHint})</span>}\r\n </button>\r\n);\r\n\r\nconst RedirectElement: FunctionalComponent<{\r\n redirect: AdvancedSelectGroupRedirect;\r\n callback: (event: MouseEvent, value: AdvancedSelectGroupRedirect) => void;\r\n}> = ({ redirect, callback }) => (\r\n <a class=\"group-link\" href={redirect.href} onClick={(e) => callback(e, redirect)}>\r\n {redirect.label}\r\n <dso-icon icon=\"chevron-right\"></dso-icon>\r\n </a>\r\n);\r\n"],"version":3}
|
|
1
|
+
{"file":"dso-advanced-select.entry.js","mappings":";;;;;;AAAA,MAAM,iBAAiB,GAAG,2uFAA2uF,CAAC;AACtwF,gCAAe,iBAAiB;;MC8BnB,cAAc;;;;;QA+DjB,eAAU,GAAG;YACnB,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;SACxB,CAAC;QAmCM,sBAAiB,GAAG,CAAC,KAAiB,EAAE,MAAmC;YACjF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YACtD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;SACnB,CAAC;QAEM,wBAAmB,GAAG,CAAC,KAAiB,EAAE,QAAqC;YACrF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,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,eAAe,GAAY,CACxC,CACL,CAAC;;;;;","names":[],"sources":["src/components/advanced-select/advanced-select.scss?tag=dso-advanced-select&encapsulation=shadow","src/components/advanced-select/advanced-select.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/global/mixins/set-colors.mixin\" as set-colors;\r\n@use \"~dso-toolkit/src/components/advanced-select\";\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n\r\n.active-option {\r\n display: flex;\r\n inline-size: 100%;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 0;\r\n border: 1px solid advanced-select.$border-color;\r\n border-radius: advanced-select.$border-radius;\r\n cursor: pointer;\r\n background-color: advanced-select.$bg-color;\r\n line-height: inherit;\r\n font-family: inherit;\r\n font-size: inherit;\r\n\r\n &.open {\r\n border-radius: advanced-select.$border-radius advanced-select.$border-radius 0 0;\r\n }\r\n\r\n dso-icon {\r\n color: advanced-select.$icon-color;\r\n }\r\n}\r\n\r\n.active-option-label {\r\n padding: advanced-select.$vertical-padding advanced-select.$horizontal-padding;\r\n overflow: hidden;\r\n /* stylelint-disable-next-line declaration-property-value-disallowed-list -- Nodig om lange titels op de zelfde regel te houden */\r\n white-space: nowrap;\r\n /* stylelint-disable-next-line declaration-property-value-disallowed-list -- Nodig om lange titels op de zelfde regel te houden */\r\n text-overflow: ellipsis;\r\n}\r\n\r\n.active-option-aside {\r\n display: flex;\r\n align-items: center;\r\n gap: advanced-select.$horizontal-padding * 0.5;\r\n padding: 0 advanced-select.$horizontal-padding * 0.5;\r\n}\r\n\r\n.badges {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n gap: advanced-select.$vertical-padding;\r\n}\r\n\r\n.groups-container {\r\n position: relative;\r\n}\r\n\r\n.groups {\r\n position: absolute;\r\n inset-block-start: -1px;\r\n inset-inline-start: 0;\r\n inline-size: 100%;\r\n max-block-size: 500px;\r\n margin: 0;\r\n padding: 0;\r\n overflow-y: auto;\r\n background-color: advanced-select.$bg-color;\r\n border: 1px solid advanced-select.$border-color;\r\n border-radius: 0 0 advanced-select.$border-radius advanced-select.$border-radius;\r\n\r\n li {\r\n &::marker {\r\n display: none;\r\n }\r\n }\r\n}\r\n\r\n.group {\r\n border-bottom: 1px solid advanced-select.$hr-color;\r\n\r\n &:last-child {\r\n border-bottom: none;\r\n }\r\n\r\n .option {\r\n padding-left: advanced-select.$horizontal-padding * 2 + advanced-select.$option-dot-size * 0.5;\r\n }\r\n\r\n .option-label::before {\r\n content: \"\";\r\n position: absolute;\r\n display: block;\r\n block-size: advanced-select.$option-dot-size;\r\n inline-size: advanced-select.$option-dot-size;\r\n inset: advanced-select.$vertical-padding auto auto -#{advanced-select.$option-dot-size * 2};\r\n border-radius: 50%;\r\n @include set-colors.apply(advanced-select.$default-variant-color, $icons: false, $links: false);\r\n }\r\n}\r\n\r\n.group-label {\r\n margin: 0;\r\n padding: advanced-select.$vertical-padding advanced-select.$horizontal-padding;\r\n color: advanced-select.$group-label-color;\r\n font-size: advanced-select.$group-label-font-size;\r\n font-weight: advanced-select.$group-label-font-weight;\r\n border-bottom: 1px solid advanced-select.$hr-color;\r\n}\r\n\r\n.group-link {\r\n display: block;\r\n padding: advanced-select.$group-link-horizontal-padding advanced-select.$group-link-vertical-padding;\r\n text-align: end;\r\n color: advanced-select.$group-link-color;\r\n text-decoration: none;\r\n\r\n &:hover {\r\n text-decoration: underline;\r\n }\r\n\r\n dso-icon {\r\n color: advanced-select.$redirect-icon-color;\r\n }\r\n}\r\n\r\n.group-info .option-label::before {\r\n @include set-colors.apply(advanced-select.$info-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-primary .option-label::before {\r\n @include set-colors.apply(advanced-select.$primary-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-success .option-label::before {\r\n @include set-colors.apply(advanced-select.$success-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-warning .option-label::before {\r\n @include set-colors.apply(advanced-select.$warning-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-danger .option-label::before {\r\n @include set-colors.apply(advanced-select.$danger-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-error .option-label::before {\r\n @include set-colors.apply(advanced-select.$error-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-attention .option-label::before {\r\n @include set-colors.apply(advanced-select.$attention-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.options {\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n.option {\r\n display: block;\r\n inline-size: 100%;\r\n padding: advanced-select.$vertical-padding * 2 advanced-select.$horizontal-padding;\r\n cursor: pointer;\r\n line-height: inherit;\r\n font-family: inherit;\r\n font-size: inherit;\r\n border: none;\r\n text-align: left;\r\n background-color: advanced-select.$bg-color;\r\n\r\n &:hover {\r\n background-color: advanced-select.$option-hover-bg-color;\r\n\r\n .option-label {\r\n color: advanced-select.$option-hover-color;\r\n font-weight: advanced-select.$option-hover-font-weight;\r\n }\r\n }\r\n}\r\n\r\n.option.option-active .option-label {\r\n color: advanced-select.$option-active-color;\r\n font-weight: advanced-select.$option-active-font-weight;\r\n text-decoration: underline;\r\n}\r\n\r\n.option-label {\r\n position: relative;\r\n color: advanced-select.$option-color;\r\n font-size: advanced-select.$option-font-size;\r\n font-weight: advanced-select.$option-font-weight;\r\n}\r\n\r\n.option-hint {\r\n padding-left: 5px;\r\n color: advanced-select.$option-active-color;\r\n font-size: advanced-select.$option-font-size;\r\n font-weight: advanced-select.$option-active-font-weight;\r\n}\r\n\r\n.placeholder {\r\n margin: 0;\r\n padding: advanced-select.$vertical-padding * 2 advanced-select.$horizontal-padding;\r\n color: advanced-select.$option-placeholder-color;\r\n}\r\n","import {\r\n Component,\r\n ComponentInterface,\r\n Prop,\r\n h,\r\n FunctionalComponent,\r\n Element,\r\n Event,\r\n EventEmitter,\r\n State,\r\n Fragment,\r\n Listen,\r\n} from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\nimport {\r\n AdvancedSelectGroup,\r\n AdvancedSelectGroupRedirect,\r\n AdvancedSelectOption,\r\n AdvancedSelectChangeEvent,\r\n AdvancedSelectOptionOrGroup,\r\n AdvancedSelectRedirectEvent,\r\n} from \"./advanced-select.models\";\r\nimport { createFocusTrap, FocusTrap } from \"focus-trap\";\r\nimport { tabbable } from \"tabbable\";\r\nimport { isModifiedEvent } from \"../../utils/is-modified-event\";\r\n\r\n@Component({\r\n tag: \"dso-advanced-select\",\r\n styleUrl: \"advanced-select.scss\",\r\n shadow: true,\r\n})\r\nexport class AdvancedSelect implements ComponentInterface {\r\n private trap?: FocusTrap;\r\n\r\n @Element()\r\n host!: HTMLDsoAdvancedSelectElement;\r\n\r\n /**\r\n * The options to display in the select.\r\n */\r\n @Prop()\r\n options: AdvancedSelectOptionOrGroup<never>[] = [];\r\n\r\n /**\r\n * The active option. By object reference.\r\n */\r\n @Prop()\r\n active?: AdvancedSelectOption<never>;\r\n\r\n /**\r\n * An extra text for the active option. Only visible in the list of options.\r\n */\r\n @Prop()\r\n activeHint?: string;\r\n\r\n /**\r\n * The open state of the options list.\r\n */\r\n @State()\r\n open: boolean = false;\r\n\r\n /**\r\n * Emitted when user selects an option\r\n */\r\n @Event({ bubbles: false })\r\n dsoChange!: EventEmitter<AdvancedSelectChangeEvent<never>>;\r\n\r\n /**\r\n * Emitted when user activates a group redirect link.\r\n */\r\n @Event({ bubbles: false })\r\n dsoRedirect!: EventEmitter<AdvancedSelectRedirectEvent>;\r\n\r\n private toggleButtonElementRef: HTMLButtonElement | undefined;\r\n\r\n @Listen(\"keydown\", { target: \"window\" })\r\n keyDownListener(event: KeyboardEvent) {\r\n if (this.open && event.key === \"ArrowUp\") {\r\n event.preventDefault();\r\n this.handleTab(-1);\r\n } else if (this.open && event.key === \"ArrowDown\") {\r\n event.preventDefault();\r\n this.handleTab(1);\r\n }\r\n }\r\n\r\n componentDidRender() {\r\n if (this.open && !this.trap) {\r\n this.createTrap();\r\n } else if (!this.open && this.trap) {\r\n this.removeTrap();\r\n }\r\n }\r\n\r\n private toggleOpen = () => {\r\n this.open = !this.open;\r\n };\r\n\r\n private createTrap() {\r\n this.trap = createFocusTrap(this.host, {\r\n clickOutsideDeactivates: true,\r\n escapeDeactivates: true,\r\n setReturnFocus: this.toggleButtonElementRef,\r\n tabbableOptions: {\r\n getShadowRoot: true,\r\n },\r\n onDeactivate: () => {\r\n this.open = false;\r\n },\r\n }).activate();\r\n }\r\n\r\n private removeTrap() {\r\n this.trap?.deactivate();\r\n delete this.trap;\r\n }\r\n\r\n private handleTab(direction: number) {\r\n const elements = tabbable(this.host, { getShadowRoot: true });\r\n const currentIndex = elements.findIndex((e) => e === this.host.shadowRoot?.activeElement);\r\n\r\n let nextIndex = currentIndex + direction;\r\n if (nextIndex >= elements.length) {\r\n nextIndex = 0;\r\n } else if (nextIndex < 0) {\r\n nextIndex = elements.length - 1;\r\n }\r\n\r\n elements[nextIndex]?.focus();\r\n }\r\n\r\n private handleOptionClick = (event: MouseEvent, option: AdvancedSelectOption<never>) => {\r\n this.dsoChange.emit({ originalEvent: event, option });\r\n this.open = false;\r\n };\r\n\r\n private handleRedirectClick = (event: MouseEvent, redirect: AdvancedSelectGroupRedirect) => {\r\n this.dsoRedirect.emit({ originalEvent: event, isModifiedEvent: isModifiedEvent(event), redirect });\r\n this.open = false;\r\n };\r\n\r\n render() {\r\n return (\r\n <>\r\n <button\r\n aria-expanded={this.open.toString()}\r\n class={clsx([\"active-option\", { open: this.open }])}\r\n type=\"button\"\r\n onClick={this.toggleOpen}\r\n ref={(element) => (this.toggleButtonElementRef = element)}\r\n >\r\n <span class=\"active-option-label\">{this.active?.label ?? \"Selecteer een optie\"}</span>\r\n <span class=\"active-option-aside\">\r\n {this.options.some(\r\n (optionOrGroup) => \"summaryCounter\" in optionOrGroup && optionOrGroup?.summaryCounter,\r\n ) && (\r\n <span class=\"badges\">\r\n {this.options\r\n .filter(\r\n (option): option is AdvancedSelectGroup<never> =>\r\n \"options\" in option && \"summaryCounter\" in option && !!option?.summaryCounter,\r\n )\r\n .map((group) => (\r\n <dso-badge status={group.variant ?? \"outline\"}>{group.options.length}</dso-badge>\r\n ))}\r\n </span>\r\n )}\r\n <dso-icon icon=\"caret-down\"></dso-icon>\r\n </span>\r\n </button>\r\n {this.open && (\r\n <div class=\"groups-container\">\r\n <ul class=\"groups\">\r\n {this.options.map(\r\n (optionOrGroup) =>\r\n (\"options\" in optionOrGroup && (\r\n <li class={clsx([\"group\", { [`group-${optionOrGroup.variant}`]: !!optionOrGroup.variant }])}>\r\n <p class=\"group-label\">{optionOrGroup.label}</p>\r\n <ul class=\"options\">\r\n {optionOrGroup.options.map((option) => (\r\n <li>\r\n <OptionElement\r\n option={option}\r\n active={this.active}\r\n activeHint={this.activeHint}\r\n callback={this.handleOptionClick}\r\n />\r\n </li>\r\n ))}\r\n </ul>\r\n {optionOrGroup.redirect && (\r\n <RedirectElement\r\n redirect={optionOrGroup.redirect}\r\n callback={this.handleRedirectClick}\r\n ></RedirectElement>\r\n )}\r\n </li>\r\n )) ||\r\n (\"placeholder\" in optionOrGroup && (\r\n <li class=\"group\">\r\n <p class=\"group-label\">{optionOrGroup.label}</p>\r\n <PlaceholderElement placeholder={optionOrGroup.placeholder}></PlaceholderElement>\r\n {optionOrGroup.redirect && (\r\n <RedirectElement\r\n redirect={optionOrGroup.redirect}\r\n callback={this.handleRedirectClick}\r\n ></RedirectElement>\r\n )}\r\n </li>\r\n )) || (\r\n <li>\r\n <OptionElement\r\n option={optionOrGroup}\r\n active={this.active}\r\n activeHint={this.activeHint}\r\n callback={this.handleOptionClick}\r\n />\r\n </li>\r\n ),\r\n )}\r\n </ul>\r\n </div>\r\n )}\r\n </>\r\n );\r\n }\r\n}\r\n\r\nconst PlaceholderElement: FunctionalComponent<{\r\n placeholder: string;\r\n}> = ({ placeholder }) => <p class=\"placeholder\">{placeholder}</p>;\r\n\r\nconst OptionElement: FunctionalComponent<{\r\n option: AdvancedSelectOption<never>;\r\n active: AdvancedSelectOption<never> | undefined;\r\n activeHint: string | undefined;\r\n callback: (event: MouseEvent, value: AdvancedSelectOption<never>) => void;\r\n}> = ({ option, active, activeHint, callback }) => (\r\n <button\r\n class={clsx([\"option\", { \"option-active\": active === option }])}\r\n type=\"button\"\r\n onClick={(e) => callback(e, option)}\r\n >\r\n <span class=\"option-label\">{option.label}</span>\r\n {!!activeHint && active === option && <span class=\"option-hint\">({activeHint})</span>}\r\n </button>\r\n);\r\n\r\nconst RedirectElement: FunctionalComponent<{\r\n redirect: AdvancedSelectGroupRedirect;\r\n callback: (event: MouseEvent, value: AdvancedSelectGroupRedirect) => void;\r\n}> = ({ redirect, callback }) => (\r\n <a class=\"group-link\" href={redirect.href} onClick={(e) => callback(e, redirect)}>\r\n {redirect.label}\r\n <dso-icon icon=\"chevron-right\"></dso-icon>\r\n </a>\r\n);\r\n"],"version":3}
|