@dso-toolkit/core 33.1.0 → 34.0.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-alert.cjs.entry.js +1 -1
- package/dist/cjs/dso-attachments-counter.cjs.entry.js +2 -2
- package/dist/cjs/dso-autosuggest.cjs.entry.js +8 -72
- package/dist/cjs/dso-badge.cjs.entry.js +1 -1
- package/dist/cjs/dso-banner.cjs.entry.js +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +11 -11
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +19 -232
- package/dist/cjs/dso-header.cjs.entry.js +101 -0
- package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +1 -1
- package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
- package/dist/cjs/dso-icon.cjs.entry.js +1 -1
- package/dist/cjs/dso-info-button.cjs.entry.js +2 -2
- package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
- package/dist/cjs/dso-label.cjs.entry.js +2 -2
- package/dist/cjs/dso-map-base-layers.cjs.entry.js +7 -6
- package/dist/cjs/dso-map-controls.cjs.entry.js +3 -3
- package/dist/cjs/dso-map-overlays.cjs.entry.js +9 -10
- package/dist/cjs/dso-ozon-content.cjs.entry.js +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-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +2 -2
- package/dist/cjs/dso-tooltip.cjs.entry.js +169 -76
- package/dist/cjs/dso-tree-view.cjs.entry.js +2 -2
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +778 -0
- package/dist/cjs/{index-fcdfdd38.js → index-5ea63531.js} +26 -2
- package/dist/cjs/index-794ad37a.js +72 -0
- package/dist/cjs/index.esm-2ac7081c.js +267 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/alert/alert.css +0 -3
- package/dist/collection/components/anchor/anchor.template.js +17 -0
- package/dist/collection/components/attachments-counter/attachments-counter.css +0 -4
- package/dist/collection/components/autosuggest/autosuggest.css +0 -3
- package/dist/collection/components/autosuggest/autosuggest.js +19 -1
- package/dist/collection/components/autosuggest/autosuggest.template.js +2 -1
- package/dist/collection/components/badge/badge.css +0 -3
- package/dist/collection/components/banner/banner.css +0 -3
- package/dist/collection/components/button/button.template.js +48 -0
- package/dist/collection/components/context/context.template.js +42 -0
- package/dist/collection/components/date-picker/date-picker.css +0 -3
- package/dist/collection/components/date-picker/date-picker.js +10 -10
- package/dist/collection/components/definition-list/definition-list.template.js +36 -0
- package/dist/collection/components/dropdown-menu/dropdown-menu.css +0 -3
- package/dist/collection/components/dropdown-menu/dropdown-menu.js +15 -4
- package/dist/collection/components/header/header.css +433 -0
- package/dist/collection/components/header/header.js +294 -0
- package/dist/collection/components/header/header.template.js +32 -0
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.css +0 -3
- package/dist/collection/components/highlight-box/highlight-box.css +0 -3
- package/dist/collection/components/icon/icon.css +0 -4
- package/dist/collection/components/info/info.css +1 -4
- package/dist/collection/components/info-button/info-button.css +1 -3
- package/dist/collection/components/label/label.css +0 -3
- package/dist/collection/components/label/label.js +2 -1
- package/dist/collection/components/label-group/label-group.template.js +7 -0
- package/dist/collection/components/list/list.template.js +37 -0
- package/dist/collection/components/map-base-layers/map-base-layers.css +4 -3
- package/dist/collection/components/map-base-layers/map-base-layers.js +10 -27
- package/dist/collection/components/map-controls/map-controls.css +18 -11
- package/dist/collection/components/map-controls/map-controls.js +10 -11
- package/dist/collection/components/map-controls/map-controls.template.js +12 -20
- package/dist/collection/components/map-overlays/map-overlays.css +4 -3
- package/dist/collection/components/map-overlays/map-overlays.js +13 -35
- package/dist/collection/components/ozon-content/ozon-content.css +0 -3
- package/dist/collection/components/progress-bar/progress-bar.css +0 -3
- package/dist/collection/components/progress-indicator/progress-indicator.css +0 -3
- package/dist/collection/components/selectable/selectable.css +0 -3
- package/dist/collection/components/toggletip/toggletip.css +0 -3
- package/dist/collection/components/tooltip/tooltip.css +34 -15
- package/dist/collection/components/tooltip/tooltip.js +19 -4
- package/dist/collection/components/tooltip/tooltip.template.js +3 -5
- package/dist/collection/components/tree-view/tree-view.css +3 -3
- package/dist/collection/components/viewer-grid/viewer-grid-document-header.template.js +39 -0
- package/dist/collection/components/viewer-grid/viewer-grid-document-list-item.template.js +19 -0
- package/dist/collection/components/viewer-grid/viewer-grid-filterblok.template.js +28 -0
- package/dist/collection/components/viewer-grid/viewer-grid.css +251 -0
- package/dist/collection/components/viewer-grid/viewer-grid.js +127 -0
- package/dist/collection/components/viewer-grid/viewer-grid.template.js +23 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +1130 -117
- package/dist/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-06de0fa1.entry.js +1 -0
- package/dist/dso-toolkit/p-10aa1fba.entry.js +1 -0
- package/dist/dso-toolkit/p-17f073d1.entry.js +1 -0
- package/dist/dso-toolkit/p-1805f5b0.js +1 -0
- package/dist/dso-toolkit/{p-75233655.entry.js → p-1fefbf8c.entry.js} +1 -1
- package/dist/dso-toolkit/{p-a52d3623.entry.js → p-20856f91.entry.js} +1 -1
- package/dist/dso-toolkit/{p-262858dd.entry.js → p-2b6a3dfa.entry.js} +1 -1
- package/dist/dso-toolkit/{p-be5682cc.entry.js → p-348414bf.entry.js} +1 -1
- package/dist/dso-toolkit/{p-984551a8.entry.js → p-3b493a2c.entry.js} +1 -1
- package/dist/dso-toolkit/p-4e573fc5.entry.js +1 -0
- package/dist/dso-toolkit/{p-c9c1bc8f.entry.js → p-5037944e.entry.js} +1 -1
- package/dist/dso-toolkit/p-7b006b11.entry.js +1 -0
- package/dist/dso-toolkit/p-8bf3a60e.js +5 -0
- package/dist/dso-toolkit/p-8f21d07d.entry.js +5 -0
- package/dist/dso-toolkit/{p-83f166b3.entry.js → p-94dffa65.entry.js} +1 -1
- package/dist/dso-toolkit/{p-b07991b9.entry.js → p-951f5872.entry.js} +1 -1
- package/dist/dso-toolkit/p-a6c9e063.entry.js +1 -0
- package/dist/dso-toolkit/p-a7306b7b.entry.js +1 -0
- package/dist/dso-toolkit/p-aadc4f8e.entry.js +1 -0
- package/dist/dso-toolkit/p-ad2210ad.entry.js +1 -0
- package/dist/dso-toolkit/{p-b5b946de.entry.js → p-bc14cafd.entry.js} +1 -1
- package/dist/dso-toolkit/{p-5665f1ee.entry.js → p-c54ecae1.entry.js} +1 -1
- package/dist/dso-toolkit/p-c95108fe.entry.js +1 -0
- package/dist/dso-toolkit/{p-e814d644.entry.js → p-daa1e29d.entry.js} +1 -1
- package/dist/dso-toolkit/p-dad72605.js +1 -0
- package/dist/dso-toolkit/{p-2e7d535c.entry.js → p-dc86d830.entry.js} +1 -1
- package/dist/dso-toolkit/{p-19de4cc7.entry.js → p-f0b67246.entry.js} +1 -1
- package/dist/esm/dso-alert.entry.js +1 -1
- package/dist/esm/dso-attachments-counter.entry.js +2 -2
- package/dist/esm/dso-autosuggest.entry.js +7 -71
- package/dist/esm/dso-badge.entry.js +1 -1
- package/dist/esm/dso-banner.entry.js +1 -1
- package/dist/esm/dso-date-picker.entry.js +11 -11
- package/dist/esm/dso-dropdown-menu.entry.js +17 -230
- package/dist/esm/dso-header.entry.js +97 -0
- package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
- package/dist/esm/dso-highlight-box.entry.js +1 -1
- package/dist/esm/dso-icon.entry.js +1 -1
- package/dist/esm/dso-info-button.entry.js +2 -2
- package/dist/esm/dso-info_2.entry.js +2 -2
- package/dist/esm/dso-label.entry.js +2 -2
- package/dist/esm/dso-map-base-layers.entry.js +7 -6
- package/dist/esm/dso-map-controls.entry.js +3 -3
- package/dist/esm/dso-map-overlays.entry.js +9 -10
- package/dist/esm/dso-ozon-content.entry.js +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-toggletip.entry.js +1 -1
- package/dist/esm/dso-toolkit.js +2 -2
- package/dist/esm/dso-tooltip.entry.js +169 -76
- package/dist/esm/dso-tree-view.entry.js +2 -2
- package/dist/esm/dso-viewer-grid.entry.js +774 -0
- package/dist/esm/{index-61410be2.js → index-d54cae76.js} +26 -2
- package/dist/esm/index-f2bf58ce.js +70 -0
- package/dist/esm/index.esm-a1362957.js +262 -0
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/anchor/anchor.template.d.ts +2 -0
- package/dist/types/components/autosuggest/autosuggest.d.ts +5 -0
- package/dist/types/components/autosuggest/autosuggest.template.d.ts +1 -1
- package/dist/types/components/button/button.template.d.ts +2 -0
- package/dist/types/components/context/context.template.d.ts +3 -0
- package/dist/types/components/definition-list/definition-list.template.d.ts +3 -0
- package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/types/components/header/header.d.ts +36 -0
- package/dist/types/components/header/header.template.d.ts +2 -0
- package/dist/types/components/label-group/label-group.template.d.ts +2 -0
- package/dist/types/components/list/list.template.d.ts +3 -0
- package/dist/types/components/map-base-layers/map-base-layers.d.ts +3 -4
- package/dist/types/components/map-base-layers/map-base-layers.interfaces.d.ts +6 -1
- package/dist/types/components/map-controls/map-controls.template.d.ts +1 -1
- package/dist/types/components/map-overlays/map-overlays.d.ts +4 -4
- package/dist/types/components/map-overlays/map-overlays.interfaces.d.ts +7 -1
- package/dist/types/components/tooltip/tooltip.d.ts +1 -0
- package/dist/types/components/viewer-grid/viewer-grid-document-header.template.d.ts +3 -0
- package/dist/types/components/viewer-grid/viewer-grid-document-list-item.template.d.ts +3 -0
- package/dist/types/components/viewer-grid/viewer-grid-filterblok.template.d.ts +3 -0
- package/dist/types/components/viewer-grid/viewer-grid.d.ts +22 -0
- package/dist/types/components/viewer-grid/viewer-grid.template.d.ts +3 -0
- package/dist/types/components.d.ts +54 -8
- package/package.json +4 -2
- package/dist/dso-toolkit/p-08427682.entry.js +0 -1
- package/dist/dso-toolkit/p-39dae284.entry.js +0 -1
- package/dist/dso-toolkit/p-741e96de.entry.js +0 -5
- package/dist/dso-toolkit/p-759920d0.entry.js +0 -1
- package/dist/dso-toolkit/p-9e9f8bcf.entry.js +0 -1
- package/dist/dso-toolkit/p-a40eeb32.js +0 -1
- package/dist/dso-toolkit/p-affe82e6.entry.js +0 -1
- package/dist/dso-toolkit/p-e03d7741.entry.js +0 -1
- package/dist/dso-toolkit/p-e4269e02.entry.js +0 -1
- package/dist/dso-toolkit/p-e7700d9e.entry.js +0 -1
|
@@ -66,7 +66,7 @@ Alert.statusMap = new Map([
|
|
|
66
66
|
['danger', 'Fout']
|
|
67
67
|
]);
|
|
68
68
|
|
|
69
|
-
const attachmentsCounterCss = ":host{display:inline-block;--di-paperclip-grijs:url(\"data:image/svg+xml,%3csvg id='paperclip' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23666%3b'%3e %3cpath fill='currentColor' d='M21.88%2c8.94%2c10%2c20.6A4.63%2c4.63%2c0%2c0%2c1%2c6.62%2c22h0a5.78%2c5.78%2c0%2c0%2c1-4.05-1.81%2c5.34%2c5.34%2c0%2c0%2c1%2c0-7.56l9.3-9.26a1%2c1%2c0%2c1%2c1%2c1.48%2c1.48l-9.3%2c9.26h0a3.26%2c3.26%2c0%2c0%2c0%2c0%2c4.6%2c3.79%2c3.79%2c0%2c0%2c0%2c2.58%2c1.21%2c2.55%2c2.55%2c0%2c0%2c0%2c1.85-.81h0L20.4%2c7.46a1.83%2c1.83%2c0%2c0%2c0%2c.5-1.39%2c2.24%2c2.24%2c0%2c0%2c0-.63-1.44%2c1.85%2c1.85%2c0%2c0%2c0-2.61%2c0h0L7.43%2c14.73a.48.48%2c0%2c0%2c0%2c0%2c.67.48.48%2c0%2c0%2c0%2c.34.14.46.46%2c0%2c0%2c0%2c.34-.14l7.36-7.28a1%2c1%2c0%2c0%2c1%2c1.48%2c0A1%2c1%2c0%2c0%2c1%2c17%2c9.6h0L9.6%2c16.88h0a2.66%2c2.66%2c0%2c0%2c1-3.65%2c0%2c2.55%2c2.55%2c0%2c0%2c1%2c0-3.63L16.17%2c3.15a4%2c4%2c0%2c0%2c1%2c5.59%2c0A4.31%2c4.31%2c0%2c0%2c1%2c23%2c6%2c3.89%2c3.89%2c0%2c0%2c1%2c21.88%2c8.94Z'/%3e %3c/svg%3e\");--di-paperclip-wit:url(\"data:image/svg+xml,%3csvg id='paperclip' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M21.88%2c8.94%2c10%2c20.6A4.63%2c4.63%2c0%2c0%2c1%2c6.62%2c22h0a5.78%2c5.78%2c0%2c0%2c1-4.05-1.81%2c5.34%2c5.34%2c0%2c0%2c1%2c0-7.56l9.3-9.26a1%2c1%2c0%2c1%2c1%2c1.48%2c1.48l-9.3%2c9.26h0a3.26%2c3.26%2c0%2c0%2c0%2c0%2c4.6%2c3.79%2c3.79%2c0%2c0%2c0%2c2.58%2c1.21%2c2.55%2c2.55%2c0%2c0%2c0%2c1.85-.81h0L20.4%2c7.46a1.83%2c1.83%2c0%2c0%2c0%2c.5-1.39%2c2.24%2c2.24%2c0%2c0%2c0-.63-1.44%2c1.85%2c1.85%2c0%2c0%2c0-2.61%2c0h0L7.43%2c14.73a.48.48%2c0%2c0%2c0%2c0%2c.67.48.48%2c0%2c0%2c0%2c.34.14.46.46%2c0%2c0%2c0%2c.34-.14l7.36-7.28a1%2c1%2c0%2c0%2c1%2c1.48%2c0A1%2c1%2c0%2c0%2c1%2c17%2c9.6h0L9.6%2c16.88h0a2.66%2c2.66%2c0%2c0%2c1-3.65%2c0%2c2.55%2c2.55%2c0%2c0%2c1%2c0-3.63L16.17%2c3.15a4%2c4%2c0%2c0%2c1%2c5.59%2c0A4.31%2c4.31%2c0%2c0%2c1%2c23%2c6%2c3.89%2c3.89%2c0%2c0%2c1%2c21.88%2c8.94Z'/%3e %3c/svg%3e\")}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.dso-attachments{color:var(--dso-attachments-counter-color, #666);display:inline-block;font-weight:400;text-decoration:none;white-space:nowrap
|
|
69
|
+
const attachmentsCounterCss = ":host{display:inline-block;--di-paperclip-grijs:url(\"data:image/svg+xml,%3csvg id='paperclip' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23666%3b'%3e %3cpath fill='currentColor' d='M21.88%2c8.94%2c10%2c20.6A4.63%2c4.63%2c0%2c0%2c1%2c6.62%2c22h0a5.78%2c5.78%2c0%2c0%2c1-4.05-1.81%2c5.34%2c5.34%2c0%2c0%2c1%2c0-7.56l9.3-9.26a1%2c1%2c0%2c1%2c1%2c1.48%2c1.48l-9.3%2c9.26h0a3.26%2c3.26%2c0%2c0%2c0%2c0%2c4.6%2c3.79%2c3.79%2c0%2c0%2c0%2c2.58%2c1.21%2c2.55%2c2.55%2c0%2c0%2c0%2c1.85-.81h0L20.4%2c7.46a1.83%2c1.83%2c0%2c0%2c0%2c.5-1.39%2c2.24%2c2.24%2c0%2c0%2c0-.63-1.44%2c1.85%2c1.85%2c0%2c0%2c0-2.61%2c0h0L7.43%2c14.73a.48.48%2c0%2c0%2c0%2c0%2c.67.48.48%2c0%2c0%2c0%2c.34.14.46.46%2c0%2c0%2c0%2c.34-.14l7.36-7.28a1%2c1%2c0%2c0%2c1%2c1.48%2c0A1%2c1%2c0%2c0%2c1%2c17%2c9.6h0L9.6%2c16.88h0a2.66%2c2.66%2c0%2c0%2c1-3.65%2c0%2c2.55%2c2.55%2c0%2c0%2c1%2c0-3.63L16.17%2c3.15a4%2c4%2c0%2c0%2c1%2c5.59%2c0A4.31%2c4.31%2c0%2c0%2c1%2c23%2c6%2c3.89%2c3.89%2c0%2c0%2c1%2c21.88%2c8.94Z'/%3e %3c/svg%3e\");--di-paperclip-wit:url(\"data:image/svg+xml,%3csvg id='paperclip' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M21.88%2c8.94%2c10%2c20.6A4.63%2c4.63%2c0%2c0%2c1%2c6.62%2c22h0a5.78%2c5.78%2c0%2c0%2c1-4.05-1.81%2c5.34%2c5.34%2c0%2c0%2c1%2c0-7.56l9.3-9.26a1%2c1%2c0%2c1%2c1%2c1.48%2c1.48l-9.3%2c9.26h0a3.26%2c3.26%2c0%2c0%2c0%2c0%2c4.6%2c3.79%2c3.79%2c0%2c0%2c0%2c2.58%2c1.21%2c2.55%2c2.55%2c0%2c0%2c0%2c1.85-.81h0L20.4%2c7.46a1.83%2c1.83%2c0%2c0%2c0%2c.5-1.39%2c2.24%2c2.24%2c0%2c0%2c0-.63-1.44%2c1.85%2c1.85%2c0%2c0%2c0-2.61%2c0h0L7.43%2c14.73a.48.48%2c0%2c0%2c0%2c0%2c.67.48.48%2c0%2c0%2c0%2c.34.14.46.46%2c0%2c0%2c0%2c.34-.14l7.36-7.28a1%2c1%2c0%2c0%2c1%2c1.48%2c0A1%2c1%2c0%2c0%2c1%2c17%2c9.6h0L9.6%2c16.88h0a2.66%2c2.66%2c0%2c0%2c1-3.65%2c0%2c2.55%2c2.55%2c0%2c0%2c1%2c0-3.63L16.17%2c3.15a4%2c4%2c0%2c0%2c1%2c5.59%2c0A4.31%2c4.31%2c0%2c0%2c1%2c23%2c6%2c3.89%2c3.89%2c0%2c0%2c1%2c21.88%2c8.94Z'/%3e %3c/svg%3e\")}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.dso-attachments{color:var(--dso-attachments-counter-color, #666);display:inline-block;font-weight:400;text-decoration:none;white-space:nowrap}.dso-attachments::after{background:var(--dso-icon, var(--di-paperclip-grijs)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em;content:\"\";display:inline-block}";
|
|
70
70
|
|
|
71
71
|
let AttachmentsCounter = class extends HTMLElement {
|
|
72
72
|
constructor() {
|
|
@@ -243,6 +243,7 @@ let Autosuggest = class extends HTMLElement {
|
|
|
243
243
|
this.__registerHost();
|
|
244
244
|
this.selectEmitter = createEvent(this, "dsoSelect", 7);
|
|
245
245
|
this.changeEmitter = createEvent(this, "dsoChange", 7);
|
|
246
|
+
this.searchEmitter = createEvent(this, "dsoSearch", 7);
|
|
246
247
|
/**
|
|
247
248
|
* The suggestions for the value of the slotted input element
|
|
248
249
|
*/
|
|
@@ -429,9 +430,12 @@ let Autosuggest = class extends HTMLElement {
|
|
|
429
430
|
this.selectFirstSuggestion();
|
|
430
431
|
}
|
|
431
432
|
pickSelectedValue() {
|
|
432
|
-
if (this.selectedSuggestion) {
|
|
433
|
+
if (this.selectedSuggestion && this.showSuggestions) {
|
|
433
434
|
this.selectEmitter.emit(this.selectedSuggestion);
|
|
434
435
|
}
|
|
436
|
+
else {
|
|
437
|
+
this.searchEmitter.emit(this.input.value);
|
|
438
|
+
}
|
|
435
439
|
this.closeSuggestions();
|
|
436
440
|
}
|
|
437
441
|
listboxItemId(suggestion) {
|
|
@@ -741,7 +745,7 @@ const localization = {
|
|
|
741
745
|
]
|
|
742
746
|
};
|
|
743
747
|
|
|
744
|
-
const datePickerCss = "
|
|
748
|
+
const datePickerCss = ".sc-dso-date-picker-h{display:block}.dso-date.sc-dso-date-picker *.sc-dso-date-picker,.dso-date.sc-dso-date-picker *.sc-dso-date-picker::before,.dso-date.sc-dso-date-picker *.sc-dso-date-picker::after{box-sizing:border-box}.dso-date.sc-dso-date-picker{box-sizing:border-box;color:#191919;display:block;font-family:\"Asap\", sans-serif;margin:0;position:relative;text-align:left;width:100%}.dso-date__input.sc-dso-date-picker{display:block;width:100%;height:40px;padding:6px 14px;font-size:16px;line-height:1.5;color:#191919;background-color:#fff;background-image:none;border:1px solid #275937;border-radius:4px;transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s}.dso-date__input.sc-dso-date-picker::-moz-placeholder{color:#666;opacity:1}.dso-date__input.sc-dso-date-picker:-ms-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker::-webkit-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker::-ms-expand{background-color:transparent;border:0}.dso-date__input.sc-dso-date-picker:focus{border-color:#275937;outline:0;box-shadow:inset 0 0 0 1px #275937}.dso-date__input[disabled].sc-dso-date-picker,.dso-date__input[readonly].sc-dso-date-picker,fieldset[disabled].sc-dso-date-picker .dso-date__input.sc-dso-date-picker{background-color:#fff;opacity:1}.dso-date__input[disabled].sc-dso-date-picker,fieldset[disabled].sc-dso-date-picker .dso-date__input.sc-dso-date-picker{cursor:default}.dso-date__input[disabled].sc-dso-date-picker{border-color:#e5e5e5;color:#999}.dso-date__input[readonly].sc-dso-date-picker{border-width:1px}.dso-date__input[type=text].sc-dso-date-picker{line-height:40px}.dso-date__input[size].sc-dso-date-picker{width:auto}.dso-date__toggle.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;border-radius:0;border-bottom-right-radius:4px;border-top-right-radius:4px;color:#39870c;cursor:pointer;display:flex;height:38px;justify-content:center;padding:0;position:absolute;right:0;transform:translateY(-50%);top:50%;user-select:none;width:38px;z-index:2}.dso-date__toggle.sc-dso-date-picker:disabled{color:#afcf9d;cursor:pointer}.dso-date__dialog.sc-dso-date-picker{display:flex;right:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;will-change:transform, opacity, visibility;z-index:600}@media (max-width: 35.9375em){.dso-date__dialog.sc-dso-date-picker{background:rgba(25, 25, 25, 0.5);bottom:0;position:fixed;left:0;right:0;top:0;transform:translateZ(0);transform-origin:bottom center}}.dso-date__dialog.is-left.sc-dso-date-picker{left:auto;right:0;width:auto}.dso-date__dialog.is-active.sc-dso-date-picker{opacity:1;transform:scale(1.0001) translateZ(0) translateY(0);visibility:visible}.dso-date__dialog-content.sc-dso-date-picker{background:#fff;border:1px solid rgba(0, 0, 0, 0.1);border-radius:4px;box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.4);margin-left:auto;margin-right:-1px;margin-top:8px;max-width:310px;min-width:290px;padding:16px;position:relative;transform:none;width:100%;z-index:600}@media (max-width: 35.9375em){.dso-date__dialog-content.sc-dso-date-picker{border:0;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active.sc-dso-date-picker .dso-date__dialog-content.sc-dso-date-picker{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.dso-date__table.sc-dso-date-picker{border-collapse:collapse;border-spacing:0;color:#191919;font-size:1rem;font-weight:400;line-height:1.25;min-width:280px;table-layout:fixed;text-align:center;width:100%}.dso-date__table-header.sc-dso-date-picker{font-size:0.875em;font-weight:600;height:36px;line-height:36px;text-decoration:none;text-transform:uppercase}.dso-date__cell.sc-dso-date-picker{height:40px;padding:1px;text-align:center;width:40px}.dso-date__day.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;box-shadow:0 0 0 1px transparent;color:#191919;cursor:pointer;display:inline-block;font-family:\"Asap\", sans-serif;font-variant-numeric:tabular-nums;font-weight:400;height:38px;line-height:0;padding:0;position:relative;text-align:center;vertical-align:middle;width:38px;z-index:1}.dso-date__day.is-today.sc-dso-date-picker{background:transparent;height:36px;box-shadow:0 0 0 1px #39870c;width:36px}.dso-date__day.sc-dso-date-picker:hover,.dso-date__day.sc-dso-date-picker:active{background:#39870c;color:#fff}.dso-date__day.sc-dso-date-picker:focus{background:transparent;box-shadow:0 0 0 2px #275937;color:#191919;height:34px;outline:0;width:34px}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker{background:#39870c;color:#fff}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker:focus{background:transparent}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker:focus span[aria-hidden=true].sc-dso-date-picker{background:#39870c;border:1px solid #fff;line-height:32px}.dso-date__day.is-outside.sc-dso-date-picker{background:#f2f2f2;box-shadow:none;color:#666;cursor:default;pointer-events:none}.dso-date__day.is-disabled.sc-dso-date-picker{background:#fff;cursor:default}.dso-date__day.is-disabled.sc-dso-date-picker:hover{color:#666}.dso-date__day.sc-dso-date-picker span[aria-hidden=true].sc-dso-date-picker{border-radius:50%;display:inline-block;height:34px;line-height:34px;width:34px}.dso-date__header.sc-dso-date-picker{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.dso-date__header.sc-dso-date-picker span.sc-dso-date-picker{font-size:0.875rem}.dso-date__nav.sc-dso-date-picker{white-space:nowrap}.dso-date__prev.sc-dso-date-picker,.dso-date__next.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:transparent;border:1px solid #39870c;border-radius:4px;box-sizing:border-box;color:#39870c;cursor:pointer;display:inline-flex;font-size:1em;height:32px;justify-content:center;margin-left:8px;padding:0;width:32px}@media (max-width: 35.9375em){.dso-date__prev.sc-dso-date-picker,.dso-date__next.sc-dso-date-picker{height:40px;width:40px}}.dso-date__prev.sc-dso-date-picker:hover,.dso-date__prev.sc-dso-date-picker:active,.dso-date__next.sc-dso-date-picker:hover,.dso-date__next.sc-dso-date-picker:active{background-color:#39870c;color:#fff}.dso-date__prev.sc-dso-date-picker:focus,.dso-date__next.sc-dso-date-picker:focus{background:transparent;color:#39870c}.dso-date__prev.sc-dso-date-picker:disabled,.dso-date__prev.sc-dso-date-picker:disabled:hover,.dso-date__next.sc-dso-date-picker:disabled,.dso-date__next.sc-dso-date-picker:disabled:hover{background-color:#fff;border-color:#afcf9d;color:#afcf9d;opacity:1}.dso-date__prev.sc-dso-date-picker svg.sc-dso-date-picker,.dso-date__next.sc-dso-date-picker svg.sc-dso-date-picker{margin:0 auto}.dso-date__select.sc-dso-date-picker{display:inline-flex;height:28px;line-height:28px;position:relative}.dso-date__select.sc-dso-date-picker span.sc-dso-date-picker{margin-right:4px}.dso-date__select.sc-dso-date-picker select.sc-dso-date-picker{color:#275937;cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.dso-date__select.sc-dso-date-picker select.sc-dso-date-picker:focus+.dso-date__select-label.sc-dso-date-picker{box-shadow:0 0 0 2px #275937}.dso-date__select.sc-dso-date-picker select.sc-dso-date-picker:disabled{color:#afcf9d}.dso-date__select-label.sc-dso-date-picker{align-items:center;border-radius:4px;color:#39870c;display:flex;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.dso-date__select-label.sc-dso-date-picker span.sc-dso-date-picker{font-size:1.25rem;font-weight:600;line-height:1.25}.dso-date__select-label.sc-dso-date-picker svg.sc-dso-date-picker{width:16px;height:16px}.dso-date__mobile.sc-dso-date-picker{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;font-size:1em;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.dso-date__mobile.sc-dso-date-picker{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-16px;top:-16px;width:auto}}.dso-date__mobile-heading.sc-dso-date-picker{display:inline-block;font-weight:600;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.dso-date__mobile-heading.sc-dso-date-picker{display:none}}.dso-date__close.sc-dso-date-picker{-webkit-appearance:none;align-items:center;appearance:none;background-color:#fff;border:0;border-radius:50%;color:#39870c;cursor:pointer;display:flex;font-size:1em;height:32px;justify-content:center;margin-right:-4px;padding:0;width:32px}@media (min-width: 36em){.dso-date__close.sc-dso-date-picker{margin-right:0;opacity:0}}.dso-date__close.sc-dso-date-picker:focus{box-shadow:0 0 0 2px #275937;outline:none}@media (min-width: 36em){.dso-date__close.sc-dso-date-picker:focus{opacity:1}}.dso-date__vhidden.sc-dso-date-picker{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}";
|
|
745
749
|
|
|
746
750
|
function range(from, to) {
|
|
747
751
|
var result = [];
|
|
@@ -769,7 +773,6 @@ let DsoDatePicker$1 = class extends HTMLElement {
|
|
|
769
773
|
constructor() {
|
|
770
774
|
super();
|
|
771
775
|
this.__registerHost();
|
|
772
|
-
attachShadow(this);
|
|
773
776
|
this.dateChange = createEvent(this, "dateChange", 7);
|
|
774
777
|
this.dsoBlur = createEvent(this, "dsoBlur", 7);
|
|
775
778
|
this.dsoKeyUp = createEvent(this, "dsoKeyUp", 7);
|
|
@@ -977,8 +980,7 @@ let DsoDatePicker$1 = class extends HTMLElement {
|
|
|
977
980
|
};
|
|
978
981
|
this.handleInputChange = (e) => {
|
|
979
982
|
const target = e.target;
|
|
980
|
-
|
|
981
|
-
this.setValue(target.value);
|
|
983
|
+
this.setValue(target.value.replace(DISALLOWED_CHARACTERS, ""));
|
|
982
984
|
};
|
|
983
985
|
this.processFocusedDayNode = (element) => {
|
|
984
986
|
this.focusedDayNode = element;
|
|
@@ -991,13 +993,12 @@ let DsoDatePicker$1 = class extends HTMLElement {
|
|
|
991
993
|
* Component event handling.
|
|
992
994
|
*/
|
|
993
995
|
handleDocumentClick(e) {
|
|
994
|
-
var _a;
|
|
995
996
|
if (!this.open) {
|
|
996
997
|
return;
|
|
997
998
|
}
|
|
998
999
|
const path = e.composedPath();
|
|
999
1000
|
for (const target of path) {
|
|
1000
|
-
if (target instanceof Node &&
|
|
1001
|
+
if (target instanceof Node && this.element.contains(target)) {
|
|
1001
1002
|
return;
|
|
1002
1003
|
}
|
|
1003
1004
|
}
|
|
@@ -1084,10 +1085,7 @@ let DsoDatePicker$1 = class extends HTMLElement {
|
|
|
1084
1085
|
event.valueAsDate = parseDutchDate(value);
|
|
1085
1086
|
}
|
|
1086
1087
|
if (event.valueAsDate) {
|
|
1087
|
-
event.value =
|
|
1088
|
-
}
|
|
1089
|
-
else {
|
|
1090
|
-
this.value = "";
|
|
1088
|
+
event.value = printDutchDate(event.valueAsDate);
|
|
1091
1089
|
}
|
|
1092
1090
|
if (!event.valueAsDate && this.required) {
|
|
1093
1091
|
event.error = "required";
|
|
@@ -1095,9 +1093,14 @@ let DsoDatePicker$1 = class extends HTMLElement {
|
|
|
1095
1093
|
if (event.value && !event.valueAsDate) {
|
|
1096
1094
|
event.error = "invalid";
|
|
1097
1095
|
}
|
|
1096
|
+
this.value = event.value;
|
|
1098
1097
|
this.dateChange.emit(event);
|
|
1099
1098
|
}
|
|
1100
1099
|
componentDidLoad() {
|
|
1100
|
+
const valueAsDate = parseDutchDate(this.value);
|
|
1101
|
+
if (valueAsDate) {
|
|
1102
|
+
this.value = printDutchDate(valueAsDate);
|
|
1103
|
+
}
|
|
1101
1104
|
if (this.dsoAutofocus) {
|
|
1102
1105
|
this.setFocus();
|
|
1103
1106
|
}
|
|
@@ -1124,7 +1127,7 @@ let DsoDatePicker$1 = class extends HTMLElement {
|
|
|
1124
1127
|
if (maxDate) {
|
|
1125
1128
|
maxYear = Math.min(maxYear, maxDate.getFullYear());
|
|
1126
1129
|
}
|
|
1127
|
-
return (h(Host, null, h("div", { class: "dso-date" }, h("div", { class: "dso-date__input-wrapper" }, h("input", { class: "dso-date__input", value:
|
|
1130
|
+
return (h(Host, null, h("div", { class: "dso-date" }, h("div", { class: "dso-date__input-wrapper" }, h("input", { class: "dso-date__input", value: this.value, placeholder: this.localization.placeholder, id: this.identifier, disabled: this.disabled, role: this.role, required: this.required ? true : undefined, "aria-autocomplete": "none", onInput: this.handleInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown, autoComplete: "off", ref: element => (this.datePickerInput = element) }), h("button", { type: "button", class: "dso-date__toggle", onClick: this.toggleOpen, disabled: this.disabled, ref: element => (this.datePickerButton = element) }, h("span", { class: "dso-date__toggle-icon" }, h("dso-icon", { icon: "calendar" })), h("span", { class: "dso-date__vhidden" }, this.localization.buttonLabel, formattedDate && (h("span", null, ", ", this.localization.selectedDateMessage, " ", formattedDate))))), h("div", { class: {
|
|
1128
1131
|
"dso-date__dialog": true,
|
|
1129
1132
|
"is-left": this.direction === "left",
|
|
1130
1133
|
"is-active": this.open,
|
|
@@ -1359,6 +1362,42 @@ var tabbable = function tabbable(el, options) {
|
|
|
1359
1362
|
return tabbableNodes;
|
|
1360
1363
|
};
|
|
1361
1364
|
|
|
1365
|
+
var focusable = function focusable(el, options) {
|
|
1366
|
+
options = options || {};
|
|
1367
|
+
var candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
|
|
1368
|
+
return candidates;
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1371
|
+
var isTabbable = function isTabbable(node, options) {
|
|
1372
|
+
options = options || {};
|
|
1373
|
+
|
|
1374
|
+
if (!node) {
|
|
1375
|
+
throw new Error('No node provided');
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
if (matches.call(node, candidateSelector) === false) {
|
|
1379
|
+
return false;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
return isNodeMatchingSelectorTabbable(options, node);
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');
|
|
1386
|
+
|
|
1387
|
+
var isFocusable = function isFocusable(node, options) {
|
|
1388
|
+
options = options || {};
|
|
1389
|
+
|
|
1390
|
+
if (!node) {
|
|
1391
|
+
throw new Error('No node provided');
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
if (matches.call(node, focusableCandidateSelector) === false) {
|
|
1395
|
+
return false;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
return isNodeMatchingSelectorFocusable(options, node);
|
|
1399
|
+
};
|
|
1400
|
+
|
|
1362
1401
|
const dropdownMenuCss = ":host(:focus){outline:none}:host{--di-check-wit:url(\"data:image/svg+xml,%3csvg id='check' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M10.11%2c18%2c5.29%2c13.31A.92.92%2c0%2c0%2c1%2c5.3%2c12a1%2c1%2c0%2c0%2c1%2c1.41%2c0l3.4%2c3.3%2c7.18-7a1%2c1%2c0%2c0%2c1%2c1.41%2c0%2c.92.92%2c0%2c0%2c1%2c0%2c1.35Z'/%3e %3c/svg%3e\");--di-chevron-down:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-down-scampi:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23676cb0%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-down-wit:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-up:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");--di-chevron-up-scampi:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23676cb0%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");--di-chevron-up-wit:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");display:inline-block;position:relative}";
|
|
1363
1402
|
|
|
1364
1403
|
let DropdownMenu = class extends HTMLElement {
|
|
@@ -1456,9 +1495,6 @@ let DropdownMenu = class extends HTMLElement {
|
|
|
1456
1495
|
this.openPopup();
|
|
1457
1496
|
}
|
|
1458
1497
|
}
|
|
1459
|
-
componentDidRender() {
|
|
1460
|
-
this.host.setAttribute("tabindex", "-1");
|
|
1461
|
-
}
|
|
1462
1498
|
componentWillRender() {
|
|
1463
1499
|
for (const li of Array.from(this.host.getElementsByTagName("li"))) {
|
|
1464
1500
|
for (const tab of tabbable(li)) {
|
|
@@ -1473,6 +1509,7 @@ let DropdownMenu = class extends HTMLElement {
|
|
|
1473
1509
|
}
|
|
1474
1510
|
}
|
|
1475
1511
|
openPopup() {
|
|
1512
|
+
this.host.setAttribute("tabindex", "-1");
|
|
1476
1513
|
this.host.addEventListener("keydown", this.keyDownListener);
|
|
1477
1514
|
this.host.addEventListener("focusout", this.focusOutListener);
|
|
1478
1515
|
this.button.setAttribute("aria-expanded", "true");
|
|
@@ -1482,11 +1519,24 @@ let DropdownMenu = class extends HTMLElement {
|
|
|
1482
1519
|
this.host.removeEventListener("keydown", this.keyDownListener);
|
|
1483
1520
|
this.host.removeEventListener("focusout", this.focusOutListener);
|
|
1484
1521
|
this.button.setAttribute("aria-expanded", "false");
|
|
1522
|
+
this.host.removeAttribute("tabindex");
|
|
1485
1523
|
this.tabbables.forEach((tabbable) => tabbable.removeEventListener("click", this.escape));
|
|
1486
1524
|
}
|
|
1525
|
+
getActiveElement(root = document) {
|
|
1526
|
+
const activeEl = root.activeElement;
|
|
1527
|
+
if (!activeEl) {
|
|
1528
|
+
return null;
|
|
1529
|
+
}
|
|
1530
|
+
if (activeEl.shadowRoot) {
|
|
1531
|
+
return this.getActiveElement(activeEl.shadowRoot);
|
|
1532
|
+
}
|
|
1533
|
+
else {
|
|
1534
|
+
return activeEl;
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1487
1537
|
tabInPopup(direction) {
|
|
1488
1538
|
const tabs = this.tabbables;
|
|
1489
|
-
const currentIndex = tabs.findIndex((e) => e ===
|
|
1539
|
+
const currentIndex = tabs.findIndex((e) => e === this.getActiveElement());
|
|
1490
1540
|
let nextIndex = currentIndex + direction;
|
|
1491
1541
|
if (nextIndex >= tabs.length) {
|
|
1492
1542
|
nextIndex = 0;
|
|
@@ -1506,6 +1556,100 @@ let DropdownMenu = class extends HTMLElement {
|
|
|
1506
1556
|
static get style() { return dropdownMenuCss; }
|
|
1507
1557
|
};
|
|
1508
1558
|
|
|
1559
|
+
const headerCss = ":host{--di-chevron-down-bosgroen:url(\"data:image/svg+xml,%3csvg id='chevron-down' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23275937%3b'%3e %3cpath fill='currentColor' d='M12%2c16%2c5.29%2c9.63a.93.93%2c0%2c0%2c1%2c0-1.35%2c1%2c1%2c0%2c0%2c1%2c1.42%2c0l5.29%2c5%2c5.29-5a1%2c1%2c0%2c0%2c1%2c1.42%2c0%2c.91.91%2c0%2c0%2c1%2c0%2c1.34Z'/%3e %3c/svg%3e\");--di-chevron-up-bosgroen:url(\"data:image/svg+xml,%3csvg id='chevron-up' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23275937%3b'%3e %3cpath fill='currentColor' d='M18%2c16a1%2c1%2c0%2c0%2c1-.71-.28l-5.29-5-5.29%2c5a1%2c1%2c0%2c0%2c1-1.42%2c0%2c.93.93%2c0%2c0%2c1%2c0-1.35L12%2c8l6.71%2c6.38a.91.91%2c0%2c0%2c1%2c0%2c1.34A1%2c1%2c0%2c0%2c1%2c18%2c16Z'/%3e %3c/svg%3e\");display:block}.dso-header{border-bottom:1px solid #ccc;display:flex;flex-wrap:wrap}@media screen and (min-width: 768px){.dso-header{align-items:center}}@media screen and (max-width: 991px){.dso-header.use-drop-down{flex-wrap:nowrap}}.logo-container{display:flex;flex-wrap:wrap;padding-bottom:16px;padding-top:16px}@media screen and (min-width: 768px){.sub-logo{margin-left:24px}}@media screen and (max-width: 767px){.sub-logo{flex-basis:100%}}.login,.logout{margin-right:16px}.profile a,.logout a,.login a{text-decoration:none;color:#39870c;font-weight:600}.profile a:hover,.profile a:focus,.logout a:hover,.logout a:focus,.login a:hover,.login a:focus{text-decoration:none}.profile a:active,.logout a:active,.login a:active{text-decoration:underline}.dso-header-session{display:flex;margin-left:auto}.dso-header-session .profile a{margin-left:8px}.dso-header-session .profile+.logout{border-left:3px solid #ccc;margin-left:16px;padding-left:16px}.dso-navbar{flex-basis:100%}dso-dropdown-menu>.dso-primary::after,dso-dropdown-menu>.dso-secondary::after,dso-dropdown-menu>.dso-tertiary::after,dso-dropdown-menu>.btn::after{content:\"\";display:inline-block;margin-left:8px}dso-dropdown-menu>.dso-primary::after,dso-dropdown-menu>.btn-primary::after{background:var(--dso-icon, var(--di-chevron-down-wit)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}dso-dropdown-menu>.dso-secondary::after,dso-dropdown-menu>.btn-default::after{background:var(--dso-icon, var(--di-chevron-down)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}dso-dropdown-menu>.dso-secondary:hover::after,dso-dropdown-menu>.btn-default:hover::after{--dso-icon:var(--di-chevron-down-wit)}dso-dropdown-menu>.dso-tertiary::after,dso-dropdown-menu>.btn-link::after{background:var(--dso-icon, var(--di-chevron-down)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em;position:relative;top:-2px}dso-dropdown-menu>.dso-tertiary:hover::after,dso-dropdown-menu>.btn-link:hover::after{--dso-icon:var(--di-chevron-down-scampi)}dso-dropdown-menu .dso-group-label{color:#999;font-size:0.875em;font-weight:400;margin:0;padding:4px 20px 2px;text-transform:uppercase}dso-dropdown-menu ul{margin:0;padding:0}dso-dropdown-menu ul:not(:last-child){border-bottom:1px solid #e5e5e5;margin-bottom:11px;padding-bottom:11px}dso-dropdown-menu .dso-dropdown-options{background-clip:padding-box;background-color:#fff;border-radius:4px;border:1px solid rgba(0, 0, 0, 0.15);box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.4);font-size:16px;margin:2px 0 0;min-width:160px;padding:5px 0;position:absolute;text-align:left;top:100%;z-index:1000}dso-dropdown-menu .dso-dropdown-options li{list-style:none}dso-dropdown-menu .dso-dropdown-options li a:visited{color:#191919}dso-dropdown-menu .dso-dropdown-options li a,dso-dropdown-menu .dso-dropdown-options li button{text-decoration:none;clear:both;color:#191919;display:block;font-weight:400;line-height:1.5;padding:3px 20px;text-decoration:none;white-space:nowrap}dso-dropdown-menu .dso-dropdown-options li a:hover,dso-dropdown-menu .dso-dropdown-options li a:focus,dso-dropdown-menu .dso-dropdown-options li a:active,dso-dropdown-menu .dso-dropdown-options li button:hover,dso-dropdown-menu .dso-dropdown-options li button:focus,dso-dropdown-menu .dso-dropdown-options li button:active{text-decoration:underline}dso-dropdown-menu .dso-dropdown-options li a:hover,dso-dropdown-menu .dso-dropdown-options li a:focus,dso-dropdown-menu .dso-dropdown-options li button:hover,dso-dropdown-menu .dso-dropdown-options li button:focus{background-color:#39870c;border-color:#39870c;color:#fff;text-decoration:none}dso-dropdown-menu .dso-dropdown-options li button{background-color:transparent;border:0;border-radius:0;text-align:inherit;width:100%}dso-dropdown-menu[dropdown-align=right] .dso-dropdown-options{right:0}dso-dropdown-menu[open]>.dso-primary::after,dso-dropdown-menu[open]>.btn-primary::after{--dso-icon:var(--di-chevron-up-wit)}dso-dropdown-menu[open]>.dso-secondary::after,dso-dropdown-menu[open]>.btn-default::after{--dso-icon:var(--di-chevron-up)}dso-dropdown-menu[open]>.dso-secondary:hover::after,dso-dropdown-menu[open]>.btn-default:hover::after{--dso-icon:var(--di-chevron-up-wit)}dso-dropdown-menu[open]>.dso-tertiary::after,dso-dropdown-menu[open]>.btn-link::after{--dso-icon:var(--di-chevron-up)}dso-dropdown-menu[open]>.dso-tertiary:hover::after,dso-dropdown-menu[open]>.btn-link:hover::after{--dso-icon:var(--di-chevron-up-scampi)}dso-dropdown-menu[open] button::after{background:var(--dso-icon, var(--di-chevron-up-bosgroen)) no-repeat;background-position:center;background-size:cover;height:1.2em;vertical-align:top;width:1.2em}dso-dropdown-menu[checkable] .dso-group-label{padding-left:40px}dso-dropdown-menu[checkable] li a,dso-dropdown-menu[checkable] li button{padding-left:40px}dso-dropdown-menu[checkable] li.dso-checked a:not(:focus),dso-dropdown-menu[checkable] li.dso-checked button:not(:focus){background-color:#39870c;border-color:#39870c;color:#fff}dso-dropdown-menu[checkable] li.dso-checked a::before,dso-dropdown-menu[checkable] li.dso-checked button::before{background:var(--dso-icon, var(--di-check-wit)) no-repeat;background-position:center;background-size:cover;height:24px;vertical-align:top;width:24px;content:\"\";display:block;float:left;margin-left:-32px;margin-right:8px}dso-dropdown-menu button{align-items:flex-end;background-color:transparent;border:0;display:flex;font-family:Asap, sans-serif;padding-right:32px}dso-dropdown-menu button::after{background:var(--dso-icon, var(--di-chevron-down-bosgroen)) no-repeat;background-position:center;background-size:cover;height:1.2em;vertical-align:top;width:1.2em;content:\"\";display:inline-block;margin-left:8px;position:absolute;right:0;top:50%;transform:translateY(-50%)}@media screen and (max-width: 991px){dso-dropdown-menu[dropdown-align=right] .dso-dropdown-options{right:-16px}}@media screen and (max-width: 767px){dso-dropdown-menu{top:12px}}dso-dropdown-menu .dso-dropdown-options{border:0;border-radius:0}dso-dropdown-menu .dso-dropdown-options dso-dropdown-options ul{width:320px}@media screen and (max-width: 991px){dso-dropdown-menu .dso-dropdown-options dso-dropdown-options ul{width:100vw}}dso-dropdown-menu .dso-dropdown-options dso-dropdown-options li a{color:#275937;font-size:1.25rem;padding:16px}dso-dropdown-menu .dso-dropdown-options dso-dropdown-options li.dso-active a{font-weight:600}dso-dropdown-menu .dso-dropdown-options dso-dropdown-options li+li{border-top:1px solid #ccc}.dropdown{margin-left:auto}@media screen and (max-width: 767px){.dropdown dso-dropdown-menu{top:28px}}.dropdown dso-dropdown-menu .dso-dropdown-options{top:calc(100% + 29px)}@media screen and (max-width: 767px){.dropdown dso-dropdown-menu .dso-dropdown-options{top:72px}}.dropdown dso-dropdown-menu[open] button::after{background:var(--dso-icon, var(--di-chevron-up)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}.dropdown dso-dropdown-menu button{color:#39870c;font-size:16px;font-weight:600}.dropdown dso-dropdown-menu button:hover,.dropdown dso-dropdown-menu button:active{cursor:pointer;text-decoration:underline}.dropdown dso-dropdown-menu button::after{background:var(--dso-icon, var(--di-chevron-down)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}.dso-nav{align-items:end;column-gap:32px;display:flex;list-style:none;margin-bottom:0;margin-top:0;padding-left:0}.dso-nav>li{margin-bottom:4px}.dso-nav>li>a{display:block}.dso-nav>li>a,.dso-nav>li>a:hover,.dso-nav>li>a:focus,.dso-nav>li>a:visited{color:#275937}.dso-nav>li.dso-active,.dso-nav>li.is-active{margin-bottom:0}.dso-nav>li.dso-active>a,.dso-nav>li.is-active>a{border-bottom:4px solid #8b4a6a;font-weight:bold}.dso-nav.dso-nav-main>li>a{text-decoration:none;font-size:1.25em;line-height:1;margin-top:8px;padding:16px 0;white-space:nowrap}.dso-nav.dso-nav-main>li>a:hover,.dso-nav.dso-nav-main>li>a:focus,.dso-nav.dso-nav-main>li>a:active{text-decoration:underline}.dso-nav.dso-nav-main dso-dropdown-menu .dso-dropdown-options{top:calc(100% + 3px)}.dso-nav.dso-nav-main dso-dropdown-menu button{font-size:1.25em;line-height:1;margin-top:8px;padding:16px 0;align-items:center;color:#275937;padding-right:32px}.dso-nav.dso-nav-main dso-dropdown-menu button:hover,.dso-nav.dso-nav-main dso-dropdown-menu button:active{cursor:pointer;text-decoration:underline}.dso-nav.dso-nav-main dso-dropdown-menu button::after{top:auto;transform:none}.dso-nav.dso-nav-sub>li{display:inline-block}.dso-nav.dso-nav-sub>li>a{text-decoration:none;font-size:16px;margin-top:4px;padding:4px 8px 3px}.dso-nav.dso-nav-sub>li>a:hover,.dso-nav.dso-nav-sub>li>a:focus,.dso-nav.dso-nav-sub>li>a:active{text-decoration:underline}.dso-nav .menu-user-home{margin-left:auto}.dso-nav .menu-user-home dso-icon{height:1em;margin-right:8px;position:relative;top:-2px;width:1.2em}";
|
|
1560
|
+
|
|
1561
|
+
const minDesktopViewportWidth = 992;
|
|
1562
|
+
let Header = class extends HTMLElement {
|
|
1563
|
+
constructor() {
|
|
1564
|
+
super();
|
|
1565
|
+
this.__registerHost();
|
|
1566
|
+
attachShadow(this);
|
|
1567
|
+
this.useDropDownMenu = "auto";
|
|
1568
|
+
this.showDropDown = false;
|
|
1569
|
+
this.isLoggedIn = false;
|
|
1570
|
+
this.hasSubLogo = false;
|
|
1571
|
+
this.overflowMenuItems = 0;
|
|
1572
|
+
this.onWindowResize = debounce_1(() => {
|
|
1573
|
+
this.setDropDownMenu();
|
|
1574
|
+
this.setOverflowMenu();
|
|
1575
|
+
}, 100);
|
|
1576
|
+
}
|
|
1577
|
+
watchUseDropDownMenu(value) {
|
|
1578
|
+
if (value === "auto") {
|
|
1579
|
+
this.setDropDownMenu();
|
|
1580
|
+
return;
|
|
1581
|
+
}
|
|
1582
|
+
this.showDropDown = value === "always";
|
|
1583
|
+
}
|
|
1584
|
+
componentWillLoad() {
|
|
1585
|
+
this.hasSubLogo = this.host.querySelector("*[slot = 'sub-logo']") !== null;
|
|
1586
|
+
}
|
|
1587
|
+
shrinkMenuToFit() {
|
|
1588
|
+
if (!this.wrapper || !this.nav) {
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
if (this.wrapper.clientWidth >= this.nav.clientWidth) {
|
|
1592
|
+
return;
|
|
1593
|
+
}
|
|
1594
|
+
if (this.overflowMenuItems >= this.mainMenu.length) {
|
|
1595
|
+
return;
|
|
1596
|
+
}
|
|
1597
|
+
this.overflowMenuItems++;
|
|
1598
|
+
}
|
|
1599
|
+
componentDidRender() {
|
|
1600
|
+
if (this.showDropDown) {
|
|
1601
|
+
return;
|
|
1602
|
+
}
|
|
1603
|
+
window.setTimeout(() => this.shrinkMenuToFit(), 0);
|
|
1604
|
+
}
|
|
1605
|
+
setOverflowMenu() {
|
|
1606
|
+
if (this.showDropDown) {
|
|
1607
|
+
return;
|
|
1608
|
+
}
|
|
1609
|
+
if (this.overflowMenuItems != 0) {
|
|
1610
|
+
this.overflowMenuItems = 0;
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
this.shrinkMenuToFit();
|
|
1614
|
+
}
|
|
1615
|
+
setDropDownMenu() {
|
|
1616
|
+
if (this.useDropDownMenu !== "auto") {
|
|
1617
|
+
return;
|
|
1618
|
+
}
|
|
1619
|
+
this.showDropDown = window.innerWidth < minDesktopViewportWidth;
|
|
1620
|
+
}
|
|
1621
|
+
connectedCallback() {
|
|
1622
|
+
window.addEventListener("resize", this.onWindowResize);
|
|
1623
|
+
}
|
|
1624
|
+
disconnectedCallback() {
|
|
1625
|
+
window.removeEventListener("resize", this.onWindowResize);
|
|
1626
|
+
}
|
|
1627
|
+
MenuItem(item) {
|
|
1628
|
+
return (h("li", { class: item.active ? "dso-active" : undefined }, h("a", { href: item.url, "aria-current": item.active ? "page" : undefined }, item.label)));
|
|
1629
|
+
}
|
|
1630
|
+
render() {
|
|
1631
|
+
return (h(Fragment, null, h("div", { class: clsx("dso-header", {
|
|
1632
|
+
["use-drop-down"]: this.showDropDown,
|
|
1633
|
+
["has-sub-logo"]: this.hasSubLogo,
|
|
1634
|
+
}), ref: (element) => (this.wrapper = element) }, h("div", { class: "logo-container" }, h("div", { class: "logo" }, h("slot", { name: "logo" })), h("div", { class: "sub-logo" }, h("slot", { name: "sub-logo" }))), this.showDropDown && (h("div", { class: "dropdown" }, h("dso-dropdown-menu", { "dropdown-align": "right" }, h("button", { type: "button", class: "tertiary", slot: "toggle" }, h("span", null, "Menu")), h("div", { class: "dso-dropdown-options" }, h("dso-dropdown-options", null, h("ul", null, this.mainMenu.map(this.MenuItem), this.userHomeUrl && (h("li", null, h("a", { href: this.userHomeUrl }, "Mijn Omgevingsloket"))), this.loginUrl && !this.isLoggedIn && (h("li", null, h("a", { href: this.loginUrl }, "Inloggen"))), this.userProfileUrl &&
|
|
1635
|
+
this.userProfileName &&
|
|
1636
|
+
this.isLoggedIn && (h("li", null, h("a", { href: this.userProfileUrl }, this.userProfileName, h("span", { class: "profile-label" }, "- Mijn profiel")))), this.logoutUrl && this.isLoggedIn && (h("li", null, h("a", { href: this.logoutUrl }, "Uitloggen"))))))))), !this.showDropDown && (h(Fragment, null, h("div", { class: "dso-header-session" }, this.userProfileUrl &&
|
|
1637
|
+
this.userProfileName &&
|
|
1638
|
+
this.isLoggedIn && (h("div", { class: "profile" }, h("span", { class: "profile-label" }, "Welkom:"), h("a", { href: this.userProfileUrl }, this.userProfileName))), this.loginUrl && !this.isLoggedIn && (h("div", { class: "login" }, h("a", { href: this.loginUrl }, "Inloggen"))), this.logoutUrl && this.isLoggedIn && (h("div", { class: "logout" }, h("a", { href: this.logoutUrl }, "Uitloggen")))), h("nav", { class: "dso-navbar" }, h("ul", { class: "dso-nav dso-nav-main", ref: (element) => (this.nav = element) }, this.mainMenu
|
|
1639
|
+
.filter((_, index) => index < this.mainMenu.length - this.overflowMenuItems)
|
|
1640
|
+
.map(this.MenuItem), this.overflowMenuItems > 0 && (h("li", null, h("dso-dropdown-menu", { "dropdown-align": "left" }, h("button", { type: "button", class: "tertiary", slot: "toggle" }, h("span", null, "Meer")), h("div", { class: "dso-dropdown-options" }, h("dso-dropdown-options", null, h("ul", null, this.mainMenu
|
|
1641
|
+
.filter((_, index) => index >=
|
|
1642
|
+
this.mainMenu.length -
|
|
1643
|
+
this.overflowMenuItems)
|
|
1644
|
+
.map(this.MenuItem))))))), this.userHomeUrl && (h("li", { class: "menu-user-home" }, h("a", { href: this.userHomeUrl }, h("dso-icon", { icon: "user-line" }), "Mijn Omgevingsloket"))))))))));
|
|
1645
|
+
}
|
|
1646
|
+
get host() { return this; }
|
|
1647
|
+
static get watchers() { return {
|
|
1648
|
+
"useDropDownMenu": ["watchUseDropDownMenu"]
|
|
1649
|
+
}; }
|
|
1650
|
+
static get style() { return headerCss; }
|
|
1651
|
+
};
|
|
1652
|
+
|
|
1509
1653
|
const helpcenterPanelCss = ":host{display:block;--di-times:url(\"data:image/svg+xml,%3csvg id='times' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M13.36%2c12l3.3-3.3A1%2c1%2c0%2c1%2c0%2c15.3%2c7.34L12%2c10.64%2c8.7%2c7.34A1%2c1%2c0%2c1%2c0%2c7.34%2c8.7l3.3%2c3.3-3.3%2c3.3A1%2c1%2c0%2c1%2c0%2c8.7%2c16.66l3.3-3.3%2c3.3%2c3.3a1%2c1%2c0%2c1%2c0%2c1.36-1.36Z'/%3e %3c/svg%3e\");--di-times-wit:url(\"data:image/svg+xml,%3csvg id='times' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: white%3b'%3e %3cpath fill='currentColor' d='M13.36%2c12l3.3-3.3A1%2c1%2c0%2c1%2c0%2c15.3%2c7.34L12%2c10.64%2c8.7%2c7.34A1%2c1%2c0%2c1%2c0%2c7.34%2c8.7l3.3%2c3.3-3.3%2c3.3A1%2c1%2c0%2c1%2c0%2c8.7%2c16.66l3.3-3.3%2c3.3%2c3.3a1%2c1%2c0%2c1%2c0%2c1.36-1.36Z'/%3e %3c/svg%3e\")}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.wrapper{height:100%;left:0;position:fixed;top:0;visibility:hidden;width:100%}.wrapper.visible{visibility:visible}.dimscreen{background-color:#000;height:100%;opacity:0.4;width:100%}.open-button{display:inline-block;font-size:1em;font-weight:500;margin-bottom:0;text-decoration:none;touch-action:manipulation;text-align:left;user-select:none;vertical-align:middle;display:inline-block;font-size:1em;font-weight:500;margin-bottom:0;text-decoration:none;touch-action:manipulation;text-align:left;user-select:none;vertical-align:middle;background-color:#39870c;border-color:#39870c;color:#fff;border-width:1px;border-style:solid;border-radius:4px;line-height:1.5;min-width:56px;padding:11px 15px;border:0;bottom:16px;font-family:Asap, sans-serif;position:fixed;right:16px}.open-button:focus,.open-button:focus-visible{outline-offset:2px}.open-button:active{outline:0}.open-button.extern::after,.open-button.download::after{content:\"\";display:inline-block;height:1.5em;margin-left:8px;vertical-align:top;width:1.5em}.open-button:focus,.open-button:focus-visible{outline-offset:2px}.open-button:active{outline:0}.open-button.extern::after,.open-button.download::after{content:\"\";display:inline-block;height:1.5em;margin-left:8px;vertical-align:top;width:1.5em}.open-button:hover{background-color:#275937;border-color:#275937;color:#fff}.open-button:active{background-color:#15301e;border-color:#15301e;color:#fff}.open-button[disabled],.open-button[disabled]:hover{background-color:#afcf9d;border-color:#afcf9d;color:#fff}.open-button.btn-sm{line-height:16px}.open-button.btn-sm dso-icon,.open-button.btn-sm svg.di,.open-button.btn-sm.extern::after,.open-button.btn-sm.download::after{margin-bottom:-4px;margin-top:-4px}.open-button.download::after{background:var(--dso-icon, var(--di-download-wit)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}.open-button.extern::after{background:var(--dso-icon, var(--di-external-link-wit)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}.open-button dso-icon,.open-button svg.di{margin-left:-8px;margin-right:8px}.open-button span+dso-icon,.open-button span+svg.di{margin-left:8px;margin-right:-8px}.open-button:hover{cursor:pointer}.open-button.open{display:none}.close-button{display:inline-block;font-size:1em;font-weight:500;margin-bottom:0;text-decoration:none;touch-action:manipulation;text-align:left;user-select:none;vertical-align:middle;background-color:#fff;border-color:#39870c;color:#39870c;border-width:1px;border-style:solid;border-radius:4px;line-height:1.5;min-width:56px;padding:11px 15px;border-right:0;border-top:0;border-radius:0 0 0 8px;height:40px;min-width:40px;padding:0;position:fixed;right:0;width:40px;top:0}.close-button:focus,.close-button:focus-visible{outline-offset:2px}.close-button:active{outline:0}.close-button.extern::after,.close-button.download::after{content:\"\";display:inline-block;height:1.5em;margin-left:8px;vertical-align:top;width:1.5em}.close-button:hover{background-color:#39870c;border-color:#39870c;color:#fff}.close-button:active{background-color:#275937;border-color:#275937;color:#fff}.close-button[disabled],.close-button[disabled]:hover{background-color:#fff;border-color:#afcf9d;color:#afcf9d}.close-button.btn-sm{line-height:16px}.close-button.btn-sm dso-icon,.close-button.btn-sm svg.di,.close-button.btn-sm.extern::after,.close-button.btn-sm.download::after{margin-bottom:-4px;margin-top:-4px}.close-button.download::after{background:var(--dso-icon, var(--di-download)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}.close-button.download:hover::after{--dso-icon:var(--di-download-wit)}.close-button.download[disabled]::after{--dso-icon:var(--di-download-grasgroen-40)}.close-button.extern::after{background:var(--dso-icon, var(--di-external-link)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}.close-button.extern:hover::after{--dso-icon:var(--di-external-link-wit)}.close-button.extern[disabled]::after{--dso-icon:var(--di-external-link-grasgroen-40)}.close-button dso-icon,.close-button svg.di{margin-left:-8px;margin-right:8px}.close-button span+dso-icon,.close-button span+svg.di{margin-left:8px;margin-right:-8px}.close-button::before{background:var(--dso-icon, var(--di-times)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em;content:\"\";display:inline-block;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.close-button:hover,.close-button:active,.close-button:focus{cursor:pointer}.close-button:hover::before,.close-button:active::before,.close-button:focus::before{background:var(--dso-icon, var(--di-times-wit)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}.close-button.close{display:none}.iframe-container{background-color:#fff;border:0;border-left:1px solid #ccc;box-shadow:0 2px 8px 0 rgba(0, 0, 0, 0.4);height:100%;position:absolute;right:-640px;top:0;transition:right 0.5s;width:640px}.iframe-container.open{right:0}iframe{border:0;height:100%;width:100%}";
|
|
1510
1654
|
|
|
1511
1655
|
const maxCssTransitionMilliseconds = 500;
|
|
@@ -2164,7 +2308,7 @@ let Icon = class extends HTMLElement {
|
|
|
2164
2308
|
static get style() { return iconCss; }
|
|
2165
2309
|
};
|
|
2166
2310
|
|
|
2167
|
-
const infoCss = ":host{--di-times-
|
|
2311
|
+
const infoCss = ":host{--di-times-grijs90:url(\"data:image/svg+xml,%3csvg id='times' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23191919%3b'%3e %3cpath fill='currentColor' d='M13.36%2c12l3.3-3.3A1%2c1%2c0%2c1%2c0%2c15.3%2c7.34L12%2c10.64%2c8.7%2c7.34A1%2c1%2c0%2c1%2c0%2c7.34%2c8.7l3.3%2c3.3-3.3%2c3.3A1%2c1%2c0%2c1%2c0%2c8.7%2c16.66l3.3-3.3%2c3.3%2c3.3a1%2c1%2c0%2c1%2c0%2c1.36-1.36Z'/%3e %3c/svg%3e\");display:block;background-color:#f2f2f2;padding:16px 32px 16px 16px;position:relative}:host>button{background-color:transparent;border-style:none;padding:0;position:absolute;right:8px;top:8px}:host>button::before{background:var(--dso-icon, var(--di-times-grijs90)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em;content:\"\";display:inline-block}:host(:not([active]):not([fixed])){display:none}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
2168
2312
|
|
|
2169
2313
|
let Info = class extends HTMLElement {
|
|
2170
2314
|
constructor() {
|
|
@@ -2179,7 +2323,7 @@ let Info = class extends HTMLElement {
|
|
|
2179
2323
|
static get style() { return infoCss; }
|
|
2180
2324
|
};
|
|
2181
2325
|
|
|
2182
|
-
const infoButtonCss = ":host{display:inline-block;--di-info:url(\"data:image/svg+xml,%3csvg id='info' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M12%2c3a9%2c9%2c0%2c1%2c1-9%2c9%2c9%2c9%2c0%2c0%2c1%2c9-9m0-2A11%2c11%2c0%2c1%2c0%2c23%2c12%2c11%2c11%2c0%2c0%2c0%2c12%2c1Zm0%2c8a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\");--di-info-active:url(\"data:image/svg+xml,%3csvg id='info-active' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M23%2c12A11%2c11%2c0%2c1%2c1%2c12%2c1%2c11%2c11%2c0%2c0%2c1%2c23%2c12ZM12%2c9a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\");--di-info-secondary:url(\"data:image/svg+xml,%3csvg id='info' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23666%3b'%3e %3cpath fill='currentColor' d='M12%2c3a9%2c9%2c0%2c1%2c1-9%2c9%2c9%2c9%2c0%2c0%2c1%2c9-9m0-2A11%2c11%2c0%2c1%2c0%2c23%2c12%2c11%2c11%2c0%2c0%2c0%2c12%2c1Zm0%2c8a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\");--di-info-active-secondary:url(\"data:image/svg+xml,%3csvg id='info-active' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23666%3b'%3e %3cpath fill='currentColor' d='M23%2c12A11%2c11%2c0%2c1%2c1%2c12%2c1%2c11%2c11%2c0%2c0%2c1%2c23%2c12ZM12%2c9a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\")}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}button{background:var(--dso-icon, var(--di-info)) no-repeat;background-position:center;background-size:cover;height:24px;vertical-align:top;width:24px;border:1px solid transparent;margin-left:8px;padding:0}button.dso-open,button:hover,button:active{--dso-icon:var(--di-info-active)}button.dso-info-secondary{--dso-icon:var(--di-info-secondary)}button.dso-info-secondary.dso-open,button.dso-info-secondary:hover,button.dso-info-secondary:active{--dso-icon:var(--di-info-active-secondary)}";
|
|
2326
|
+
const infoButtonCss = ":host{display:inline-block;--di-info:url(\"data:image/svg+xml,%3csvg id='info' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M12%2c3a9%2c9%2c0%2c1%2c1-9%2c9%2c9%2c9%2c0%2c0%2c1%2c9-9m0-2A11%2c11%2c0%2c1%2c0%2c23%2c12%2c11%2c11%2c0%2c0%2c0%2c12%2c1Zm0%2c8a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\");--di-info-active:url(\"data:image/svg+xml,%3csvg id='info-active' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M23%2c12A11%2c11%2c0%2c1%2c1%2c12%2c1%2c11%2c11%2c0%2c0%2c1%2c23%2c12ZM12%2c9a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\");--di-info-secondary:url(\"data:image/svg+xml,%3csvg id='info' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23666%3b'%3e %3cpath fill='currentColor' d='M12%2c3a9%2c9%2c0%2c1%2c1-9%2c9%2c9%2c9%2c0%2c0%2c1%2c9-9m0-2A11%2c11%2c0%2c1%2c0%2c23%2c12%2c11%2c11%2c0%2c0%2c0%2c12%2c1Zm0%2c8a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\");--di-info-active-secondary:url(\"data:image/svg+xml,%3csvg id='info-active' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23666%3b'%3e %3cpath fill='currentColor' d='M23%2c12A11%2c11%2c0%2c1%2c1%2c12%2c1%2c11%2c11%2c0%2c0%2c1%2c23%2c12ZM12%2c9a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\")}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}button{background:var(--dso-icon, var(--di-info)) no-repeat;background-position:center;background-size:cover;height:24px;vertical-align:top;width:24px;border:1px solid transparent;margin-left:8px;padding:0;cursor:pointer}button.dso-open,button:hover,button:active{--dso-icon:var(--di-info-active)}button.dso-info-secondary{--dso-icon:var(--di-info-secondary)}button.dso-info-secondary.dso-open,button.dso-info-secondary:hover,button.dso-info-secondary:active{--dso-icon:var(--di-info-active-secondary)}";
|
|
2183
2327
|
|
|
2184
2328
|
let InfoButton = class extends HTMLElement {
|
|
2185
2329
|
constructor() {
|
|
@@ -2210,7 +2354,7 @@ let Label = class extends HTMLElement {
|
|
|
2210
2354
|
}
|
|
2211
2355
|
render() {
|
|
2212
2356
|
const status = this.status && Label.statusMap.get(this.status);
|
|
2213
|
-
return (h("span", { class: clsx('dso-label', { [`dso-label-${this.status}`]: this.status, 'dso-compact': this.compact && !this.removable, 'dso-hover': this.hover }) }, h("slot", { name: "symbol" }), status && (h("span", { class: "sr-only" }, status, ": ")), h("slot", null), this.removable && (h("button", { type: "button", onClick: e => this.removeClick.emit(e),
|
|
2357
|
+
return (h("span", { class: clsx('dso-label', { [`dso-label-${this.status}`]: this.status, 'dso-compact': this.compact && !this.removable, 'dso-hover': this.hover }) }, h("slot", { name: "symbol" }), status && (h("span", { class: "sr-only" }, status, ": ")), h("slot", null), this.removable && (h("button", { type: "button", onClick: e => this.removeClick.emit(e), onMouseEnter: () => this.hover = true, onMouseLeave: () => this.hover = false }, h("span", { class: "sr-only" }, "Verwijder"), h("dso-icon", { icon: "times" })))));
|
|
2214
2358
|
}
|
|
2215
2359
|
static get style() { return labelCss; }
|
|
2216
2360
|
};
|
|
@@ -2221,7 +2365,7 @@ Label.statusMap = new Map([
|
|
|
2221
2365
|
['danger', 'Fout']
|
|
2222
2366
|
]);
|
|
2223
2367
|
|
|
2224
|
-
const mapBaseLayersCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}fieldset{border:0;margin:0;min-width:0;padding:0}fieldset .control-label{display:inline-block;font-weight:bold;margin-bottom:8px;max-width:100%;text-align:left}";
|
|
2368
|
+
const mapBaseLayersCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}fieldset{border:0;margin:0;min-width:0;padding:0}fieldset .control-label{display:inline-block;font-weight:bold;margin-bottom:8px;max-width:100%;text-align:left}p[slot=info]{margin:0}";
|
|
2225
2369
|
|
|
2226
2370
|
let MapBaseLayers = class extends HTMLElement {
|
|
2227
2371
|
constructor() {
|
|
@@ -2230,17 +2374,18 @@ let MapBaseLayers = class extends HTMLElement {
|
|
|
2230
2374
|
attachShadow(this);
|
|
2231
2375
|
this.baseLayerChange = createEvent(this, "baseLayerChange", 7);
|
|
2232
2376
|
}
|
|
2233
|
-
|
|
2234
|
-
this.
|
|
2235
|
-
this.baseLayerChange.emit(baseLayer);
|
|
2377
|
+
baseLayerChangeHandler(baseLayer) {
|
|
2378
|
+
this.baseLayerChange.emit({ activeBaseLayer: baseLayer });
|
|
2236
2379
|
}
|
|
2237
2380
|
render() {
|
|
2238
|
-
return (h("fieldset", { class: "form-group dso-radios" }, h("legend", { class: "sr-only" }, "Achtergrond"), h("div", { class: "dso-label-container" }, h("span", { class: "control-label", "aria-hidden": "true" }, "Achtergrond")), h("div", { class: "dso-field-container" }, this.baseLayers.map(
|
|
2381
|
+
return (h("fieldset", { class: "form-group dso-radios" }, h("legend", { class: "sr-only" }, "Achtergrond"), h("div", { class: "dso-label-container" }, h("span", { class: "control-label", "aria-hidden": "true" }, "Achtergrond")), h("div", { class: "dso-field-container" }, this.baseLayers.map(baseLayer => (h("dso-selectable", { key: baseLayer.id, type: "radio", value: baseLayer.name, checked: baseLayer.checked, disabled: baseLayer.disabled, onDsoChange: () => this.baseLayerChangeHandler(baseLayer) }, baseLayer.name, baseLayer.info
|
|
2382
|
+
? h("p", { slot: "info" }, baseLayer.info)
|
|
2383
|
+
: null))))));
|
|
2239
2384
|
}
|
|
2240
2385
|
static get style() { return mapBaseLayersCss; }
|
|
2241
2386
|
};
|
|
2242
2387
|
|
|
2243
|
-
const mapControlsCss = "button{-webkit-appearance:button;color:inherit;cursor:pointer;font:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}button[disabled]{cursor:default}button::-moz-focus-inner{border:0;padding:0}:host{background-color:#fff;border:1px solid #ccc;bottom:0;display:block;font-family:Asap, sans-serif;position:absolute;top:0;left:100%;transition:transform 300ms ease;width:300px}*,*::after,*::before{box-sizing:border-box}:host([open]){box-shadow:0 1px 4px 0 rgba(0, 0, 0, 0.3);transform:translateX(-100%)}:host([open]) #toggle-visibility-button{display:none}#
|
|
2388
|
+
const mapControlsCss = "button{-webkit-appearance:button;color:inherit;cursor:pointer;font:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}button[disabled]{cursor:default}button::-moz-focus-inner{border:0;padding:0}:host{background-color:#fff;border:1px solid #ccc;bottom:0;display:block;font-family:Asap, sans-serif;position:absolute;top:0;left:100%;transition:transform 300ms ease;width:300px}*,*::after,*::before{box-sizing:border-box}:host([open]){box-shadow:0 1px 4px 0 rgba(0, 0, 0, 0.3);transform:translateX(-100%)}:host([open]) #toggle-visibility-button{display:none}#toggle-visibility-button{display:inline-block;font-size:1em;font-weight:500;margin-bottom:0;text-decoration:none;touch-action:manipulation;text-align:left;user-select:none;vertical-align:middle;background-color:#fff;border-color:#39870c;color:#39870c;border-width:1px;border-style:solid;border-radius:4px;line-height:1.5;min-width:56px;padding:11px 15px;border:0;box-shadow:0 1px 4px 0 rgba(0, 0, 0, 0.5);font-weight:600;margin-right:16px;padding:8px 16px;white-space:nowrap;position:absolute;right:calc(100% + 56px);top:16px}#toggle-visibility-button:focus,#toggle-visibility-button:focus-visible{outline-offset:2px}#toggle-visibility-button:active{outline:0}#toggle-visibility-button.extern::after,#toggle-visibility-button.download::after{content:\"\";display:inline-block;height:1.5em;margin-left:8px;vertical-align:top;width:1.5em}#toggle-visibility-button:hover{background-color:#39870c;border-color:#39870c;color:#fff}#toggle-visibility-button:active{background-color:#275937;border-color:#275937;color:#fff}#toggle-visibility-button[disabled],#toggle-visibility-button[disabled]:hover{background-color:#fff;border-color:#afcf9d;color:#afcf9d}#toggle-visibility-button.btn-sm{line-height:16px}#toggle-visibility-button.btn-sm dso-icon,#toggle-visibility-button.btn-sm svg.di,#toggle-visibility-button.btn-sm.extern::after,#toggle-visibility-button.btn-sm.download::after{margin-bottom:-4px;margin-top:-4px}#toggle-visibility-button.download::after{background:var(--dso-icon, var(--di-download)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}#toggle-visibility-button.download:hover::after{--dso-icon:var(--di-download-wit)}#toggle-visibility-button.download[disabled]::after{--dso-icon:var(--di-download-grasgroen-40)}#toggle-visibility-button.extern::after{background:var(--dso-icon, var(--di-external-link)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}#toggle-visibility-button.extern:hover::after{--dso-icon:var(--di-external-link-wit)}#toggle-visibility-button.extern[disabled]::after{--dso-icon:var(--di-external-link-grasgroen-40)}#toggle-visibility-button dso-icon,#toggle-visibility-button svg.di{margin-left:-8px;margin-right:8px}#toggle-visibility-button span+dso-icon,#toggle-visibility-button span+svg.di{margin-left:8px;margin-right:-8px}#toggle-visibility-button:focus-visible{background-color:#39870c;border-color:#39870c;color:#fff;outline:none}#zoom-buttons{border-radius:4px;box-shadow:0 1px 4px 0 rgba(0, 0, 0, 0.5);display:flex;flex-wrap:wrap;flex:0 0;position:absolute;right:calc(100% + 16px);top:16px}#zoom-buttons button{display:inline-block;font-size:1em;font-weight:500;margin-bottom:0;text-decoration:none;touch-action:manipulation;text-align:left;user-select:none;vertical-align:middle;background-color:#fff;border-color:#39870c;color:#39870c;border-width:1px;border-style:solid;border-radius:4px;line-height:1.5;min-width:56px;padding:11px 15px;border:0;padding:8px;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;flex:0 0 100%;height:40px;min-width:auto;width:40px}#zoom-buttons button:focus,#zoom-buttons button:focus-visible{outline-offset:2px}#zoom-buttons button:active{outline:0}#zoom-buttons button.extern::after,#zoom-buttons button.download::after{content:\"\";display:inline-block;height:1.5em;margin-left:8px;vertical-align:top;width:1.5em}#zoom-buttons button:hover{background-color:#39870c;border-color:#39870c;color:#fff}#zoom-buttons button:active{background-color:#275937;border-color:#275937;color:#fff}#zoom-buttons button[disabled],#zoom-buttons button[disabled]:hover{background-color:#fff;border-color:#afcf9d;color:#afcf9d}#zoom-buttons button.btn-sm{line-height:16px}#zoom-buttons button.btn-sm dso-icon,#zoom-buttons button.btn-sm svg.di,#zoom-buttons button.btn-sm.extern::after,#zoom-buttons button.btn-sm.download::after{margin-bottom:-4px;margin-top:-4px}#zoom-buttons button.download::after{background:var(--dso-icon, var(--di-download)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}#zoom-buttons button.download:hover::after{--dso-icon:var(--di-download-wit)}#zoom-buttons button.download[disabled]::after{--dso-icon:var(--di-download-grasgroen-40)}#zoom-buttons button.extern::after{background:var(--dso-icon, var(--di-external-link)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}#zoom-buttons button.extern:hover::after{--dso-icon:var(--di-external-link-wit)}#zoom-buttons button.extern[disabled]::after{--dso-icon:var(--di-external-link-grasgroen-40)}#zoom-buttons button>span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}#zoom-buttons button:focus-visible{background-color:#39870c;border-color:#39870c;color:#fff;outline:none}#zoom-buttons button+button{border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-top:1px solid #ccc}#close-button{display:inline-block;font-size:1em;font-weight:500;margin-bottom:0;text-decoration:none;touch-action:manipulation;text-align:left;user-select:none;vertical-align:middle;border:0;color:#39870c;line-height:1;padding:0;background-color:transparent;padding:0;position:absolute;right:16px;top:16px}#close-button:focus,#close-button:focus-visible{outline-offset:2px}#close-button:active{outline:0}#close-button.extern::after,#close-button.download::after{content:\"\";display:inline-block;height:1.5em;margin-left:8px;vertical-align:top;width:1.5em}#close-button[disabled]{color:#afcf9d}#close-button:not([disabled]):hover{color:#676cb0;text-decoration:underline}#close-button:not([disabled]):active{color:#676cb0}#close-button.btn-align{line-height:calc(1.5em - 1px);padding:11px 0;position:relative}#close-button.extern::after,#close-button.download::after{position:relative;top:-2px}#close-button.download::after{background:var(--dso-icon, var(--di-download)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}#close-button.download[disabled]::after{--dso-icon:var(--di-download-grasgroen-40)}#close-button.download:not([disabled]):hover::after,#close-button.download:not([disabled]):active::after{--dso-icon:var(--di-download-scampi)}#close-button.extern::after{background:var(--dso-icon, var(--di-external-link)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}#close-button.extern[disabled]::after{--dso-icon:var(--di-external-link-grasgroen-40)}#close-button.extern:not([disabled]):hover::after,#close-button.extern:not([disabled]):active::after{--dso-icon:var(--di-external-link-scampi)}#close-button>span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}header,.content{padding:16px}header{border-bottom:1px solid #ccc;position:relative}header h2{color:#275937;font-family:\"Asap\", sans-serif;line-height:1;margin:0}";
|
|
2244
2389
|
|
|
2245
2390
|
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
2246
2391
|
if (!privateMap.has(receiver)) {
|
|
@@ -2282,7 +2427,7 @@ let MapControls = class extends HTMLElement {
|
|
|
2282
2427
|
}
|
|
2283
2428
|
}
|
|
2284
2429
|
render() {
|
|
2285
|
-
return (h(Host, null, h("
|
|
2430
|
+
return (h(Host, null, h("button", { type: "button", id: "toggle-visibility-button", onClick: () => this.open = !this.open, ref: element => __classPrivateFieldSet(this, _toggleButtonElement, element) }, h("dso-icon", { icon: "layers" }), h("span", null, "Kaartlagen")), h("div", { id: "zoom-buttons" }, h("button", { type: "button", onClick: e => this.zoomIn.emit(e), disabled: this.disableZoom === 'in' || this.disableZoom === 'both' }, h("span", null, "Zoom in"), h("dso-icon", { icon: "plus" })), h("button", { type: "button", onClick: e => this.zoomOut.emit(e), disabled: this.disableZoom === 'out' || this.disableZoom === 'both' }, h("span", null, "Zoom uit"), h("dso-icon", { icon: "minus" }))), h("section", { hidden: this.hideContent }, h("header", null, h("h2", null, "Kaartlagen"), h("button", { type: "button", id: "close-button", onClick: () => this.open = false, ref: element => __classPrivateFieldSet(this, _closeButtonElement, element) }, h("span", null, "Sluit dialoog"), h("dso-icon", { icon: "times" }))), h("div", { class: "content" }, h("slot", null)))));
|
|
2286
2431
|
}
|
|
2287
2432
|
static get watchers() { return {
|
|
2288
2433
|
"open": ["watchOpen"]
|
|
@@ -2291,24 +2436,23 @@ let MapControls = class extends HTMLElement {
|
|
|
2291
2436
|
};
|
|
2292
2437
|
_closeButtonElement = new WeakMap(), _toggleButtonElement = new WeakMap();
|
|
2293
2438
|
|
|
2294
|
-
const mapOverlaysCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}fieldset{border:0;margin:0;min-width:0;padding:0}fieldset .control-label{display:inline-block;font-weight:bold;margin-bottom:8px;max-width:100%;text-align:left}";
|
|
2439
|
+
const mapOverlaysCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}fieldset{border:0;margin:0;min-width:0;padding:0}fieldset .control-label{display:inline-block;font-weight:bold;margin-bottom:8px;max-width:100%;text-align:left}p[slot=info]{margin:0}";
|
|
2295
2440
|
|
|
2296
2441
|
let MapOverlays = class extends HTMLElement {
|
|
2297
2442
|
constructor() {
|
|
2298
2443
|
super();
|
|
2299
2444
|
this.__registerHost();
|
|
2300
2445
|
attachShadow(this);
|
|
2301
|
-
this.
|
|
2302
|
-
this.checkedOverlays = [];
|
|
2446
|
+
this.toggleOverlay = createEvent(this, "toggleOverlay", 7);
|
|
2303
2447
|
}
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
: this.checkedOverlays.filter(o => o !== overlay);
|
|
2308
|
-
this.checkedOverlaysChange.emit(this.checkedOverlays);
|
|
2448
|
+
overlayChangeHandler(overlay, e) {
|
|
2449
|
+
const checked = e.detail.target instanceof HTMLInputElement ? !!e.detail.target.checked : false;
|
|
2450
|
+
this.toggleOverlay.emit({ overlay, checked });
|
|
2309
2451
|
}
|
|
2310
2452
|
render() {
|
|
2311
|
-
return (h("fieldset", { class: "form-group dso-checkboxes" }, h("legend", { class: "sr-only" }, "Kaartlagen"), h("div", { class: "dso-label-container" }, h("span", { class: "control-label", "aria-hidden": "true" }, "Kaartlagen")), h("div", { class: "dso-field-container" }, this.overlays.map(overlay => (h("dso-selectable", { type: "checkbox", value: overlay.name, checked:
|
|
2453
|
+
return (h("fieldset", { class: "form-group dso-checkboxes" }, h("legend", { class: "sr-only" }, "Kaartlagen"), h("div", { class: "dso-label-container" }, h("span", { class: "control-label", "aria-hidden": "true" }, "Kaartlagen")), h("div", { class: "dso-field-container" }, this.overlays.map(overlay => (h("dso-selectable", { type: "checkbox", value: overlay.name, checked: overlay.checked, disabled: overlay.disabled, onDsoChange: e => this.overlayChangeHandler(overlay, e) }, overlay.name, overlay.info
|
|
2454
|
+
? h("p", { slot: "info" }, overlay.info)
|
|
2455
|
+
: null))))));
|
|
2312
2456
|
}
|
|
2313
2457
|
static get style() { return mapOverlaysCss; }
|
|
2314
2458
|
};
|
|
@@ -3100,29 +3244,32 @@ function getBasePlacement(placement) {
|
|
|
3100
3244
|
return placement.split('-')[0];
|
|
3101
3245
|
}
|
|
3102
3246
|
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3247
|
+
var max = Math.max;
|
|
3248
|
+
var min = Math.min;
|
|
3249
|
+
var round = Math.round;
|
|
3250
|
+
|
|
3251
|
+
function getBoundingClientRect(element, includeScale) {
|
|
3252
|
+
if (includeScale === void 0) {
|
|
3253
|
+
includeScale = false;
|
|
3254
|
+
}
|
|
3106
3255
|
|
|
3107
3256
|
var rect = element.getBoundingClientRect();
|
|
3108
3257
|
var scaleX = 1;
|
|
3109
|
-
var scaleY = 1;
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
// }
|
|
3125
|
-
// }
|
|
3258
|
+
var scaleY = 1;
|
|
3259
|
+
|
|
3260
|
+
if (isHTMLElement(element) && includeScale) {
|
|
3261
|
+
var offsetHeight = element.offsetHeight;
|
|
3262
|
+
var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
|
|
3263
|
+
// Fallback to 1 in case both values are `0`
|
|
3264
|
+
|
|
3265
|
+
if (offsetWidth > 0) {
|
|
3266
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3269
|
+
if (offsetHeight > 0) {
|
|
3270
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3126
3273
|
|
|
3127
3274
|
return {
|
|
3128
3275
|
width: rect.width / scaleX,
|
|
@@ -3277,13 +3424,13 @@ function getMainAxisFromPlacement(placement) {
|
|
|
3277
3424
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
3278
3425
|
}
|
|
3279
3426
|
|
|
3280
|
-
var max = Math.max;
|
|
3281
|
-
var min = Math.min;
|
|
3282
|
-
var round = Math.round;
|
|
3283
|
-
|
|
3284
3427
|
function within(min$1, value, max$1) {
|
|
3285
3428
|
return max(min$1, min(value, max$1));
|
|
3286
3429
|
}
|
|
3430
|
+
function withinMaxClamp(min, value, max) {
|
|
3431
|
+
var v = within(min, value, max);
|
|
3432
|
+
return v > max ? max : v;
|
|
3433
|
+
}
|
|
3287
3434
|
|
|
3288
3435
|
function getFreshSideObject() {
|
|
3289
3436
|
return {
|
|
@@ -3406,8 +3553,8 @@ function roundOffsetsByDPR(_ref) {
|
|
|
3406
3553
|
var win = window;
|
|
3407
3554
|
var dpr = win.devicePixelRatio || 1;
|
|
3408
3555
|
return {
|
|
3409
|
-
x: round(
|
|
3410
|
-
y: round(
|
|
3556
|
+
x: round(x * dpr) / dpr || 0,
|
|
3557
|
+
y: round(y * dpr) / dpr || 0
|
|
3411
3558
|
};
|
|
3412
3559
|
}
|
|
3413
3560
|
|
|
@@ -3422,14 +3569,23 @@ function mapToStyles(_ref2) {
|
|
|
3422
3569
|
position = _ref2.position,
|
|
3423
3570
|
gpuAcceleration = _ref2.gpuAcceleration,
|
|
3424
3571
|
adaptive = _ref2.adaptive,
|
|
3425
|
-
roundOffsets = _ref2.roundOffsets
|
|
3426
|
-
|
|
3427
|
-
var
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3572
|
+
roundOffsets = _ref2.roundOffsets,
|
|
3573
|
+
isFixed = _ref2.isFixed;
|
|
3574
|
+
var _offsets$x = offsets.x,
|
|
3575
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
3576
|
+
_offsets$y = offsets.y,
|
|
3577
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
3578
|
+
|
|
3579
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
3580
|
+
x: x,
|
|
3581
|
+
y: y
|
|
3582
|
+
}) : {
|
|
3583
|
+
x: x,
|
|
3584
|
+
y: y
|
|
3585
|
+
};
|
|
3432
3586
|
|
|
3587
|
+
x = _ref3.x;
|
|
3588
|
+
y = _ref3.y;
|
|
3433
3589
|
var hasX = offsets.hasOwnProperty('x');
|
|
3434
3590
|
var hasY = offsets.hasOwnProperty('y');
|
|
3435
3591
|
var sideX = left;
|
|
@@ -3454,16 +3610,18 @@ function mapToStyles(_ref2) {
|
|
|
3454
3610
|
offsetParent = offsetParent;
|
|
3455
3611
|
|
|
3456
3612
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
3457
|
-
sideY = bottom;
|
|
3458
|
-
|
|
3459
|
-
|
|
3613
|
+
sideY = bottom;
|
|
3614
|
+
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
3615
|
+
offsetParent[heightProp];
|
|
3616
|
+
y -= offsetY - popperRect.height;
|
|
3460
3617
|
y *= gpuAcceleration ? 1 : -1;
|
|
3461
3618
|
}
|
|
3462
3619
|
|
|
3463
3620
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
3464
|
-
sideX = right;
|
|
3465
|
-
|
|
3466
|
-
|
|
3621
|
+
sideX = right;
|
|
3622
|
+
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
3623
|
+
offsetParent[widthProp];
|
|
3624
|
+
x -= offsetX - popperRect.width;
|
|
3467
3625
|
x *= gpuAcceleration ? 1 : -1;
|
|
3468
3626
|
}
|
|
3469
3627
|
}
|
|
@@ -3472,6 +3630,17 @@ function mapToStyles(_ref2) {
|
|
|
3472
3630
|
position: position
|
|
3473
3631
|
}, adaptive && unsetSides);
|
|
3474
3632
|
|
|
3633
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
3634
|
+
x: x,
|
|
3635
|
+
y: y
|
|
3636
|
+
}) : {
|
|
3637
|
+
x: x,
|
|
3638
|
+
y: y
|
|
3639
|
+
};
|
|
3640
|
+
|
|
3641
|
+
x = _ref4.x;
|
|
3642
|
+
y = _ref4.y;
|
|
3643
|
+
|
|
3475
3644
|
if (gpuAcceleration) {
|
|
3476
3645
|
var _Object$assign;
|
|
3477
3646
|
|
|
@@ -3481,9 +3650,9 @@ function mapToStyles(_ref2) {
|
|
|
3481
3650
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
3482
3651
|
}
|
|
3483
3652
|
|
|
3484
|
-
function computeStyles(
|
|
3485
|
-
var state =
|
|
3486
|
-
options =
|
|
3653
|
+
function computeStyles(_ref5) {
|
|
3654
|
+
var state = _ref5.state,
|
|
3655
|
+
options = _ref5.options;
|
|
3487
3656
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
3488
3657
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
3489
3658
|
_options$adaptive = options.adaptive,
|
|
@@ -3496,7 +3665,8 @@ function computeStyles(_ref4) {
|
|
|
3496
3665
|
variation: getVariation(state.placement),
|
|
3497
3666
|
popper: state.elements.popper,
|
|
3498
3667
|
popperRect: state.rects.popper,
|
|
3499
|
-
gpuAcceleration: gpuAcceleration
|
|
3668
|
+
gpuAcceleration: gpuAcceleration,
|
|
3669
|
+
isFixed: state.options.strategy === 'fixed'
|
|
3500
3670
|
};
|
|
3501
3671
|
|
|
3502
3672
|
if (state.modifiersData.popperOffsets != null) {
|
|
@@ -3754,7 +3924,7 @@ function getInnerBoundingClientRect(element) {
|
|
|
3754
3924
|
}
|
|
3755
3925
|
|
|
3756
3926
|
function getClientRectFromMixedType(element, clippingParent) {
|
|
3757
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) :
|
|
3927
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
3758
3928
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
3759
3929
|
// clipping (or hiding) overflowing elements with a position different from
|
|
3760
3930
|
// `initial`
|
|
@@ -4267,6 +4437,14 @@ function preventOverflow(_ref) {
|
|
|
4267
4437
|
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
4268
4438
|
placement: state.placement
|
|
4269
4439
|
})) : tetherOffset;
|
|
4440
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
|
4441
|
+
mainAxis: tetherOffsetValue,
|
|
4442
|
+
altAxis: tetherOffsetValue
|
|
4443
|
+
} : Object.assign({
|
|
4444
|
+
mainAxis: 0,
|
|
4445
|
+
altAxis: 0
|
|
4446
|
+
}, tetherOffsetValue);
|
|
4447
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
4270
4448
|
var data = {
|
|
4271
4449
|
x: 0,
|
|
4272
4450
|
y: 0
|
|
@@ -4276,13 +4454,15 @@ function preventOverflow(_ref) {
|
|
|
4276
4454
|
return;
|
|
4277
4455
|
}
|
|
4278
4456
|
|
|
4279
|
-
if (checkMainAxis
|
|
4457
|
+
if (checkMainAxis) {
|
|
4458
|
+
var _offsetModifierState$;
|
|
4459
|
+
|
|
4280
4460
|
var mainSide = mainAxis === 'y' ? top : left;
|
|
4281
4461
|
var altSide = mainAxis === 'y' ? bottom : right;
|
|
4282
4462
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
4283
4463
|
var offset = popperOffsets[mainAxis];
|
|
4284
|
-
var min$1 =
|
|
4285
|
-
var max$1 =
|
|
4464
|
+
var min$1 = offset + overflow[mainSide];
|
|
4465
|
+
var max$1 = offset - overflow[altSide];
|
|
4286
4466
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
4287
4467
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
4288
4468
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
@@ -4302,36 +4482,45 @@ function preventOverflow(_ref) {
|
|
|
4302
4482
|
// width or height)
|
|
4303
4483
|
|
|
4304
4484
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
4305
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin -
|
|
4306
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax +
|
|
4485
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
4486
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
4307
4487
|
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
4308
4488
|
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
4309
|
-
var offsetModifierValue =
|
|
4310
|
-
var tetherMin =
|
|
4311
|
-
var tetherMax =
|
|
4489
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
4490
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
4491
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
4492
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
4493
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
4494
|
+
data[mainAxis] = preventedOffset - offset;
|
|
4495
|
+
}
|
|
4312
4496
|
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
popperOffsets[mainAxis] = preventedOffset;
|
|
4316
|
-
data[mainAxis] = preventedOffset - offset;
|
|
4317
|
-
}
|
|
4497
|
+
if (checkAltAxis) {
|
|
4498
|
+
var _offsetModifierState$2;
|
|
4318
4499
|
|
|
4319
|
-
|
|
4320
|
-
var _mainSide = mainAxis === 'x' ? top : left;
|
|
4500
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
4321
4501
|
|
|
4322
|
-
|
|
4502
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
4323
4503
|
|
|
4324
|
-
|
|
4504
|
+
var _offset = popperOffsets[altAxis];
|
|
4325
4505
|
|
|
4326
|
-
|
|
4506
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
|
4327
4507
|
|
|
4328
|
-
|
|
4508
|
+
var _min = _offset + overflow[_mainSide];
|
|
4329
4509
|
|
|
4330
|
-
|
|
4510
|
+
var _max = _offset - overflow[_altSide];
|
|
4331
4511
|
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4512
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
4513
|
+
|
|
4514
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
4515
|
+
|
|
4516
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
4517
|
+
|
|
4518
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
4519
|
+
|
|
4520
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
4521
|
+
|
|
4522
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
4523
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
4335
4524
|
}
|
|
4336
4525
|
|
|
4337
4526
|
state.modifiersData[name] = data;
|
|
@@ -4363,8 +4552,8 @@ function getNodeScroll(node) {
|
|
|
4363
4552
|
|
|
4364
4553
|
function isElementScaled(element) {
|
|
4365
4554
|
var rect = element.getBoundingClientRect();
|
|
4366
|
-
var scaleX = rect.width / element.offsetWidth || 1;
|
|
4367
|
-
var scaleY = rect.height / element.offsetHeight || 1;
|
|
4555
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
4556
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
4368
4557
|
return scaleX !== 1 || scaleY !== 1;
|
|
4369
4558
|
} // Returns the composite rect of an element relative to its offsetParent.
|
|
4370
4559
|
// Composite means it takes into account transforms as well as layout.
|
|
@@ -4376,9 +4565,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
4376
4565
|
}
|
|
4377
4566
|
|
|
4378
4567
|
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
4379
|
-
isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
4568
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
4380
4569
|
var documentElement = getDocumentElement(offsetParent);
|
|
4381
|
-
var rect = getBoundingClientRect(elementOrVirtualElement);
|
|
4570
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
|
4382
4571
|
var scroll = {
|
|
4383
4572
|
scrollLeft: 0,
|
|
4384
4573
|
scrollTop: 0
|
|
@@ -4395,7 +4584,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
4395
4584
|
}
|
|
4396
4585
|
|
|
4397
4586
|
if (isHTMLElement(offsetParent)) {
|
|
4398
|
-
offsets = getBoundingClientRect(offsetParent);
|
|
4587
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
|
4399
4588
|
offsets.x += offsetParent.clientLeft;
|
|
4400
4589
|
offsets.y += offsetParent.clientTop;
|
|
4401
4590
|
} else if (documentElement) {
|
|
@@ -4682,7 +4871,41 @@ var createPopper = /*#__PURE__*/popperGenerator({
|
|
|
4682
4871
|
defaultModifiers: defaultModifiers
|
|
4683
4872
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
4684
4873
|
|
|
4685
|
-
|
|
4874
|
+
var maxSize = {
|
|
4875
|
+
name: 'maxSize',
|
|
4876
|
+
enabled: true,
|
|
4877
|
+
phase: 'main',
|
|
4878
|
+
requiresIfExists: ['offset', 'preventOverflow', 'flip'],
|
|
4879
|
+
fn: function fn(_ref) {
|
|
4880
|
+
var state = _ref.state,
|
|
4881
|
+
name = _ref.name,
|
|
4882
|
+
options = _ref.options;
|
|
4883
|
+
var overflow = detectOverflow(state, options);
|
|
4884
|
+
|
|
4885
|
+
var _ref2 = state.modifiersData.preventOverflow || {
|
|
4886
|
+
x: 0,
|
|
4887
|
+
y: 0
|
|
4888
|
+
},
|
|
4889
|
+
x = _ref2.x,
|
|
4890
|
+
y = _ref2.y;
|
|
4891
|
+
|
|
4892
|
+
var _state$rects$popper = state.rects.popper,
|
|
4893
|
+
width = _state$rects$popper.width,
|
|
4894
|
+
height = _state$rects$popper.height;
|
|
4895
|
+
|
|
4896
|
+
var _state$placement$spli = state.placement.split('-'),
|
|
4897
|
+
basePlacement = _state$placement$spli[0];
|
|
4898
|
+
|
|
4899
|
+
var widthProp = basePlacement === 'left' ? 'left' : 'right';
|
|
4900
|
+
var heightProp = basePlacement === 'top' ? 'top' : 'bottom';
|
|
4901
|
+
state.modifiersData[name] = {
|
|
4902
|
+
width: width - overflow[widthProp] - x,
|
|
4903
|
+
height: height - overflow[heightProp] - y
|
|
4904
|
+
};
|
|
4905
|
+
}
|
|
4906
|
+
};
|
|
4907
|
+
|
|
4908
|
+
const tooltipCss = ":host(.hidden){visibility:hidden}:host-context(dso-toggletip){color:red !important}:host-context(dso-toggletip) *[data-popper-placement=top] .tooltip-arrow{margin-left:3px}:host-context(dso-toggletip) *[data-popper-placement=right] .tooltip-arrow{margin-top:0}:host-context(dso-toggletip) *[data-popper-placement=bottom] .tooltip-arrow{margin-left:3px}:host-context(dso-toggletip) *[data-popper-placement=left]{margin-right:-8px !important}:host-context(dso-toggletip) *[data-popper-placement=left] .tooltip-arrow{margin-top:0}*,*::after,*::before{box-sizing:border-box}.tooltip{font-family:Asap, sans-serif;font-style:normal;font-weight:400;line-height:1.5;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;display:block;filter:drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));font-size:14px;opacity:0;position:absolute;transition:opacity 0.15s linear;z-index:1070}.tooltip.in{opacity:1}.tooltip .tooltip-inner{background-color:#fff;border-radius:4px;color:#191919;display:inline-block;font-size:16px;max-width:640px;padding:8px 16px;position:relative}.tooltip .tooltip-inner.dso-small{max-width:320px}.tooltip .tooltip-arrow{border-color:transparent;border-style:solid;height:0;width:0}.tooltip[data-popper-placement=top]{margin-top:-3px;padding:6px 0}.tooltip[data-popper-placement=top] .tooltip-arrow{border-top-color:#fff;border-width:6px 6px 0;bottom:0}.tooltip[data-popper-placement=top] .tooltip-arrow{margin-left:-3px}.tooltip[data-popper-placement=right]{margin-left:3px;padding:0 6px}.tooltip[data-popper-placement=right] .tooltip-arrow{border-right-color:#fff;border-width:6px 6px 6px 0;left:0}.tooltip[data-popper-placement=right] .tooltip-arrow{margin-top:-3px}.tooltip[data-popper-placement=bottom]{margin-top:3px;padding:6px 0}.tooltip[data-popper-placement=bottom] .tooltip-arrow{border-bottom-color:#fff;border-width:0 6px 6px;top:0}.tooltip[data-popper-placement=bottom] .tooltip-arrow{margin-left:-3px}.tooltip[data-popper-placement=left]{margin-left:-3px;padding:0 6px}.tooltip[data-popper-placement=left] .tooltip-arrow{border-left-color:#fff;border-width:6px 0 6px 6px;right:0}.tooltip[data-popper-placement=left] .tooltip-arrow{margin-top:-3px}";
|
|
4686
4909
|
|
|
4687
4910
|
// Keep const in sync with $tooltip-transition-duration in @dso-toolkit/sources/tooltip.scss tooltip_root() mixin
|
|
4688
4911
|
const transitionDuration = 150;
|
|
@@ -4704,6 +4927,19 @@ let Tooltip = class extends HTMLElement {
|
|
|
4704
4927
|
*/
|
|
4705
4928
|
this.active = false;
|
|
4706
4929
|
this.hidden = true;
|
|
4930
|
+
this.applyMaxSize = {
|
|
4931
|
+
name: 'applyMaxSize',
|
|
4932
|
+
enabled: true,
|
|
4933
|
+
phase: beforeWrite,
|
|
4934
|
+
requires: ['maxSize'],
|
|
4935
|
+
fn({ state }) {
|
|
4936
|
+
let { width } = state.modifiersData.maxSize;
|
|
4937
|
+
if (width < 160) {
|
|
4938
|
+
width = 160;
|
|
4939
|
+
}
|
|
4940
|
+
state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), { maxWidth: `${width}px` });
|
|
4941
|
+
},
|
|
4942
|
+
};
|
|
4707
4943
|
}
|
|
4708
4944
|
/**
|
|
4709
4945
|
* Activate the tooltip (Sets the `active` attribute)
|
|
@@ -4761,7 +4997,8 @@ let Tooltip = class extends HTMLElement {
|
|
|
4761
4997
|
}
|
|
4762
4998
|
this.target = this.getTarget();
|
|
4763
4999
|
this.popper = createPopper(this.target, tooltip, {
|
|
4764
|
-
placement: this.position
|
|
5000
|
+
placement: this.position,
|
|
5001
|
+
modifiers: [maxSize, this.applyMaxSize],
|
|
4765
5002
|
});
|
|
4766
5003
|
this.callbacks = {
|
|
4767
5004
|
activate: () => (this.active = true),
|
|
@@ -4793,7 +5030,7 @@ let Tooltip = class extends HTMLElement {
|
|
|
4793
5030
|
}
|
|
4794
5031
|
}
|
|
4795
5032
|
render() {
|
|
4796
|
-
return (h(Host, { hidden: this.hidden }, h("div", { class: clsx('tooltip', { in: this.active }), role: "tooltip" }, !this.noArrow && h("div", { class: "tooltip-arrow" }), h("div", { class: clsx('tooltip-inner', { 'dso-small': this.small }) }, h("slot", null)))));
|
|
5033
|
+
return (h(Host, { class: { 'hidden': this.hidden } }, h("div", { class: clsx('tooltip', { in: this.active }), role: "tooltip" }, !this.noArrow && h("div", { "data-popper-arrow": true, class: "tooltip-arrow" }), h("div", { class: clsx('tooltip-inner', { 'dso-small': this.small }) }, h("slot", null)))));
|
|
4797
5034
|
}
|
|
4798
5035
|
getTarget() {
|
|
4799
5036
|
if (this.for instanceof HTMLElement) {
|
|
@@ -4844,7 +5081,7 @@ const DsoTreeItem = ({ owner, ancestors, item, index, level, setSize }) => {
|
|
|
4844
5081
|
: h("ul", { role: "group" }, (_c = item.items) === null || _c === void 0 ? void 0 : _c.map((childItem, index, org) => h(DsoTreeItem, { owner: owner, ancestors: [...ancestors, item], item: childItem, index: index, level: level + 1, setSize: org.length }))))));
|
|
4845
5082
|
};
|
|
4846
5083
|
|
|
4847
|
-
const treeViewCss = ":host ul{list-style-type:none}:host ul[role=tree]{padding-left:0}:host li[role=treeitem]>ul{padding-left:1.5em}:host .tree-branch-control{cursor:pointer;display:inline-block}:host .tree-content{cursor:pointer;display:inline-block;margin:8px 0}:host .tree-content.active{font-weight:700}:host .tree-content.active:hover{text-decoration:underline}:host .tree-content.active a{text-decoration:none}:host .tree-content.selected{color:#191919;font-weight:700;text-decoration:underline}:host .tree-content.selected:hover,:host .tree-content.selected:focus{text-decoration:none}:host .tree-content a,:host .tree-content a:visited{color:#191919;text-decoration:underline}:host .tree-content a:hover,:host .tree-content a:focus{color:#191919;text-decoration:none}:host .tree-content a:active{text-decoration:none}:host .tree-content dso-icon{font-size:0.75em;margin-left:0.5em;vertical-align:text-bottom}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
5084
|
+
const treeViewCss = ":host ul{list-style-type:none}:host ul[role=tree]{padding-left:0}:host li[role=treeitem]>ul{padding-left:1.5em}:host .tree-branch-control{cursor:pointer;display:inline-block;margin:8px 0;vertical-align:top}:host .tree-content{cursor:pointer;display:inline-block;margin:8px 0;width:calc(100% - 24px)}:host .tree-content.active{font-weight:700}:host .tree-content.active:hover{text-decoration:underline}:host .tree-content.active a{text-decoration:none}:host .tree-content.selected{color:#191919;font-weight:700;text-decoration:underline}:host .tree-content.selected:hover,:host .tree-content.selected:focus{text-decoration:none}:host .tree-content a,:host .tree-content a:visited{color:#191919;text-decoration:underline}:host .tree-content a:hover,:host .tree-content a:focus{color:#191919;text-decoration:none}:host .tree-content a:active{text-decoration:none}:host .tree-content dso-icon{font-size:0.75em;margin-left:0.5em;vertical-align:text-bottom}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
4848
5085
|
|
|
4849
5086
|
let TreeView = class extends HTMLElement {
|
|
4850
5087
|
constructor() {
|
|
@@ -4999,22 +5236,795 @@ let TreeView = class extends HTMLElement {
|
|
|
4999
5236
|
static get style() { return treeViewCss; }
|
|
5000
5237
|
};
|
|
5001
5238
|
|
|
5239
|
+
/*!
|
|
5240
|
+
* focus-trap 6.7.3
|
|
5241
|
+
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
5242
|
+
*/
|
|
5243
|
+
|
|
5244
|
+
function ownKeys(object, enumerableOnly) {
|
|
5245
|
+
var keys = Object.keys(object);
|
|
5246
|
+
|
|
5247
|
+
if (Object.getOwnPropertySymbols) {
|
|
5248
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
5249
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
5250
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
5251
|
+
})), keys.push.apply(keys, symbols);
|
|
5252
|
+
}
|
|
5253
|
+
|
|
5254
|
+
return keys;
|
|
5255
|
+
}
|
|
5256
|
+
|
|
5257
|
+
function _objectSpread2(target) {
|
|
5258
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
5259
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
5260
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
5261
|
+
_defineProperty(target, key, source[key]);
|
|
5262
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
5263
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
5264
|
+
});
|
|
5265
|
+
}
|
|
5266
|
+
|
|
5267
|
+
return target;
|
|
5268
|
+
}
|
|
5269
|
+
|
|
5270
|
+
function _defineProperty(obj, key, value) {
|
|
5271
|
+
if (key in obj) {
|
|
5272
|
+
Object.defineProperty(obj, key, {
|
|
5273
|
+
value: value,
|
|
5274
|
+
enumerable: true,
|
|
5275
|
+
configurable: true,
|
|
5276
|
+
writable: true
|
|
5277
|
+
});
|
|
5278
|
+
} else {
|
|
5279
|
+
obj[key] = value;
|
|
5280
|
+
}
|
|
5281
|
+
|
|
5282
|
+
return obj;
|
|
5283
|
+
}
|
|
5284
|
+
|
|
5285
|
+
var activeFocusTraps = function () {
|
|
5286
|
+
var trapQueue = [];
|
|
5287
|
+
return {
|
|
5288
|
+
activateTrap: function activateTrap(trap) {
|
|
5289
|
+
if (trapQueue.length > 0) {
|
|
5290
|
+
var activeTrap = trapQueue[trapQueue.length - 1];
|
|
5291
|
+
|
|
5292
|
+
if (activeTrap !== trap) {
|
|
5293
|
+
activeTrap.pause();
|
|
5294
|
+
}
|
|
5295
|
+
}
|
|
5296
|
+
|
|
5297
|
+
var trapIndex = trapQueue.indexOf(trap);
|
|
5298
|
+
|
|
5299
|
+
if (trapIndex === -1) {
|
|
5300
|
+
trapQueue.push(trap);
|
|
5301
|
+
} else {
|
|
5302
|
+
// move this existing trap to the front of the queue
|
|
5303
|
+
trapQueue.splice(trapIndex, 1);
|
|
5304
|
+
trapQueue.push(trap);
|
|
5305
|
+
}
|
|
5306
|
+
},
|
|
5307
|
+
deactivateTrap: function deactivateTrap(trap) {
|
|
5308
|
+
var trapIndex = trapQueue.indexOf(trap);
|
|
5309
|
+
|
|
5310
|
+
if (trapIndex !== -1) {
|
|
5311
|
+
trapQueue.splice(trapIndex, 1);
|
|
5312
|
+
}
|
|
5313
|
+
|
|
5314
|
+
if (trapQueue.length > 0) {
|
|
5315
|
+
trapQueue[trapQueue.length - 1].unpause();
|
|
5316
|
+
}
|
|
5317
|
+
}
|
|
5318
|
+
};
|
|
5319
|
+
}();
|
|
5320
|
+
|
|
5321
|
+
var isSelectableInput = function isSelectableInput(node) {
|
|
5322
|
+
return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
|
|
5323
|
+
};
|
|
5324
|
+
|
|
5325
|
+
var isEscapeEvent = function isEscapeEvent(e) {
|
|
5326
|
+
return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
|
|
5327
|
+
};
|
|
5328
|
+
|
|
5329
|
+
var isTabEvent = function isTabEvent(e) {
|
|
5330
|
+
return e.key === 'Tab' || e.keyCode === 9;
|
|
5331
|
+
};
|
|
5332
|
+
|
|
5333
|
+
var delay = function delay(fn) {
|
|
5334
|
+
return setTimeout(fn, 0);
|
|
5335
|
+
}; // Array.find/findIndex() are not supported on IE; this replicates enough
|
|
5336
|
+
// of Array.findIndex() for our needs
|
|
5337
|
+
|
|
5338
|
+
|
|
5339
|
+
var findIndex = function findIndex(arr, fn) {
|
|
5340
|
+
var idx = -1;
|
|
5341
|
+
arr.every(function (value, i) {
|
|
5342
|
+
if (fn(value)) {
|
|
5343
|
+
idx = i;
|
|
5344
|
+
return false; // break
|
|
5345
|
+
}
|
|
5346
|
+
|
|
5347
|
+
return true; // next
|
|
5348
|
+
});
|
|
5349
|
+
return idx;
|
|
5350
|
+
};
|
|
5351
|
+
/**
|
|
5352
|
+
* Get an option's value when it could be a plain value, or a handler that provides
|
|
5353
|
+
* the value.
|
|
5354
|
+
* @param {*} value Option's value to check.
|
|
5355
|
+
* @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
|
|
5356
|
+
* @returns {*} The `value`, or the handler's returned value.
|
|
5357
|
+
*/
|
|
5358
|
+
|
|
5359
|
+
|
|
5360
|
+
var valueOrHandler = function valueOrHandler(value) {
|
|
5361
|
+
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
5362
|
+
params[_key - 1] = arguments[_key];
|
|
5363
|
+
}
|
|
5364
|
+
|
|
5365
|
+
return typeof value === 'function' ? value.apply(void 0, params) : value;
|
|
5366
|
+
};
|
|
5367
|
+
|
|
5368
|
+
var getActualTarget = function getActualTarget(event) {
|
|
5369
|
+
// NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
|
|
5370
|
+
// shadow host. However, event.target.composedPath() will be an array of
|
|
5371
|
+
// nodes "clicked" from inner-most (the actual element inside the shadow) to
|
|
5372
|
+
// outer-most (the host HTML document). If we have access to composedPath(),
|
|
5373
|
+
// then use its first element; otherwise, fall back to event.target (and
|
|
5374
|
+
// this only works for an _open_ shadow DOM; otherwise,
|
|
5375
|
+
// composedPath()[0] === event.target always).
|
|
5376
|
+
return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
|
|
5377
|
+
};
|
|
5378
|
+
|
|
5379
|
+
var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
5380
|
+
// SSR: a live trap shouldn't be created in this type of environment so this
|
|
5381
|
+
// should be safe code to execute if the `document` option isn't specified
|
|
5382
|
+
var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
|
|
5383
|
+
|
|
5384
|
+
var config = _objectSpread2({
|
|
5385
|
+
returnFocusOnDeactivate: true,
|
|
5386
|
+
escapeDeactivates: true,
|
|
5387
|
+
delayInitialFocus: true
|
|
5388
|
+
}, userOptions);
|
|
5389
|
+
|
|
5390
|
+
var state = {
|
|
5391
|
+
// @type {Array<HTMLElement>}
|
|
5392
|
+
containers: [],
|
|
5393
|
+
// list of objects identifying the first and last tabbable nodes in all containers/groups in
|
|
5394
|
+
// the trap
|
|
5395
|
+
// NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
|
|
5396
|
+
// is active, but the trap should never get to a state where there isn't at least one group
|
|
5397
|
+
// with at least one tabbable node in it (that would lead to an error condition that would
|
|
5398
|
+
// result in an error being thrown)
|
|
5399
|
+
// @type {Array<{
|
|
5400
|
+
// container: HTMLElement,
|
|
5401
|
+
// firstTabbableNode: HTMLElement|null,
|
|
5402
|
+
// lastTabbableNode: HTMLElement|null,
|
|
5403
|
+
// nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
|
|
5404
|
+
// }>}
|
|
5405
|
+
tabbableGroups: [],
|
|
5406
|
+
nodeFocusedBeforeActivation: null,
|
|
5407
|
+
mostRecentlyFocusedNode: null,
|
|
5408
|
+
active: false,
|
|
5409
|
+
paused: false,
|
|
5410
|
+
// timer ID for when delayInitialFocus is true and initial focus in this trap
|
|
5411
|
+
// has been delayed during activation
|
|
5412
|
+
delayInitialFocusTimer: undefined
|
|
5413
|
+
};
|
|
5414
|
+
var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
|
|
5415
|
+
|
|
5416
|
+
var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
|
|
5417
|
+
return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
|
|
5418
|
+
};
|
|
5419
|
+
|
|
5420
|
+
var containersContain = function containersContain(element) {
|
|
5421
|
+
return !!(element && state.containers.some(function (container) {
|
|
5422
|
+
return container.contains(element);
|
|
5423
|
+
}));
|
|
5424
|
+
};
|
|
5425
|
+
/**
|
|
5426
|
+
* Gets the node for the given option, which is expected to be an option that
|
|
5427
|
+
* can be either a DOM node, a string that is a selector to get a node, `false`
|
|
5428
|
+
* (if a node is explicitly NOT given), or a function that returns any of these
|
|
5429
|
+
* values.
|
|
5430
|
+
* @param {string} optionName
|
|
5431
|
+
* @returns {undefined | false | HTMLElement | SVGElement} Returns
|
|
5432
|
+
* `undefined` if the option is not specified; `false` if the option
|
|
5433
|
+
* resolved to `false` (node explicitly not given); otherwise, the resolved
|
|
5434
|
+
* DOM node.
|
|
5435
|
+
* @throws {Error} If the option is set, not `false`, and is not, or does not
|
|
5436
|
+
* resolve to a node.
|
|
5437
|
+
*/
|
|
5438
|
+
|
|
5439
|
+
|
|
5440
|
+
var getNodeForOption = function getNodeForOption(optionName) {
|
|
5441
|
+
var optionValue = config[optionName];
|
|
5442
|
+
|
|
5443
|
+
if (typeof optionValue === 'function') {
|
|
5444
|
+
for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
5445
|
+
params[_key2 - 1] = arguments[_key2];
|
|
5446
|
+
}
|
|
5447
|
+
|
|
5448
|
+
optionValue = optionValue.apply(void 0, params);
|
|
5449
|
+
}
|
|
5450
|
+
|
|
5451
|
+
if (!optionValue) {
|
|
5452
|
+
if (optionValue === undefined || optionValue === false) {
|
|
5453
|
+
return optionValue;
|
|
5454
|
+
} // else, empty string (invalid), null (invalid), 0 (invalid)
|
|
5455
|
+
|
|
5456
|
+
|
|
5457
|
+
throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
|
|
5458
|
+
}
|
|
5459
|
+
|
|
5460
|
+
var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
|
|
5461
|
+
|
|
5462
|
+
if (typeof optionValue === 'string') {
|
|
5463
|
+
node = doc.querySelector(optionValue); // resolve to node, or null if fails
|
|
5464
|
+
|
|
5465
|
+
if (!node) {
|
|
5466
|
+
throw new Error("`".concat(optionName, "` as selector refers to no known node"));
|
|
5467
|
+
}
|
|
5468
|
+
}
|
|
5469
|
+
|
|
5470
|
+
return node;
|
|
5471
|
+
};
|
|
5472
|
+
|
|
5473
|
+
var getInitialFocusNode = function getInitialFocusNode() {
|
|
5474
|
+
var node = getNodeForOption('initialFocus'); // false explicitly indicates we want no initialFocus at all
|
|
5475
|
+
|
|
5476
|
+
if (node === false) {
|
|
5477
|
+
return false;
|
|
5478
|
+
}
|
|
5479
|
+
|
|
5480
|
+
if (node === undefined) {
|
|
5481
|
+
// option not specified: use fallback options
|
|
5482
|
+
if (containersContain(doc.activeElement)) {
|
|
5483
|
+
node = doc.activeElement;
|
|
5484
|
+
} else {
|
|
5485
|
+
var firstTabbableGroup = state.tabbableGroups[0];
|
|
5486
|
+
var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; // NOTE: `fallbackFocus` option function cannot return `false` (not supported)
|
|
5487
|
+
|
|
5488
|
+
node = firstTabbableNode || getNodeForOption('fallbackFocus');
|
|
5489
|
+
}
|
|
5490
|
+
}
|
|
5491
|
+
|
|
5492
|
+
if (!node) {
|
|
5493
|
+
throw new Error('Your focus-trap needs to have at least one focusable element');
|
|
5494
|
+
}
|
|
5495
|
+
|
|
5496
|
+
return node;
|
|
5497
|
+
};
|
|
5498
|
+
|
|
5499
|
+
var updateTabbableNodes = function updateTabbableNodes() {
|
|
5500
|
+
state.tabbableGroups = state.containers.map(function (container) {
|
|
5501
|
+
var tabbableNodes = tabbable(container); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
|
|
5502
|
+
// are a superset of tabbable nodes
|
|
5503
|
+
|
|
5504
|
+
var focusableNodes = focusable(container);
|
|
5505
|
+
|
|
5506
|
+
if (tabbableNodes.length > 0) {
|
|
5507
|
+
return {
|
|
5508
|
+
container: container,
|
|
5509
|
+
firstTabbableNode: tabbableNodes[0],
|
|
5510
|
+
lastTabbableNode: tabbableNodes[tabbableNodes.length - 1],
|
|
5511
|
+
|
|
5512
|
+
/**
|
|
5513
|
+
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
5514
|
+
* in this container, if any.
|
|
5515
|
+
* @param {HTMLElement} node
|
|
5516
|
+
* @param {boolean} [forward] True if going in forward tab order; false if going
|
|
5517
|
+
* in reverse.
|
|
5518
|
+
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
5519
|
+
*/
|
|
5520
|
+
nextTabbableNode: function nextTabbableNode(node) {
|
|
5521
|
+
var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
5522
|
+
// NOTE: If tabindex is positive (in order to manipulate the tab order separate
|
|
5523
|
+
// from the DOM order), this __will not work__ because the list of focusableNodes,
|
|
5524
|
+
// while it contains tabbable nodes, does not sort its nodes in any order other
|
|
5525
|
+
// than DOM order, because it can't: Where would you place focusable (but not
|
|
5526
|
+
// tabbable) nodes in that order? They have no order, because they aren't tabbale...
|
|
5527
|
+
// Support for positive tabindex is already broken and hard to manage (possibly
|
|
5528
|
+
// not supportable, TBD), so this isn't going to make things worse than they
|
|
5529
|
+
// already are, and at least makes things better for the majority of cases where
|
|
5530
|
+
// tabindex is either 0/unset or negative.
|
|
5531
|
+
// FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
|
|
5532
|
+
var nodeIdx = focusableNodes.findIndex(function (n) {
|
|
5533
|
+
return n === node;
|
|
5534
|
+
});
|
|
5535
|
+
|
|
5536
|
+
if (forward) {
|
|
5537
|
+
return focusableNodes.slice(nodeIdx + 1).find(function (n) {
|
|
5538
|
+
return isTabbable(n);
|
|
5539
|
+
});
|
|
5540
|
+
}
|
|
5541
|
+
|
|
5542
|
+
return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
|
|
5543
|
+
return isTabbable(n);
|
|
5544
|
+
});
|
|
5545
|
+
}
|
|
5546
|
+
};
|
|
5547
|
+
}
|
|
5548
|
+
|
|
5549
|
+
return undefined;
|
|
5550
|
+
}).filter(function (group) {
|
|
5551
|
+
return !!group;
|
|
5552
|
+
}); // remove groups with no tabbable nodes
|
|
5553
|
+
// throw if no groups have tabbable nodes and we don't have a fallback focus node either
|
|
5554
|
+
|
|
5555
|
+
if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
|
|
5556
|
+
) {
|
|
5557
|
+
throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
|
|
5558
|
+
}
|
|
5559
|
+
};
|
|
5560
|
+
|
|
5561
|
+
var tryFocus = function tryFocus(node) {
|
|
5562
|
+
if (node === false) {
|
|
5563
|
+
return;
|
|
5564
|
+
}
|
|
5565
|
+
|
|
5566
|
+
if (node === doc.activeElement) {
|
|
5567
|
+
return;
|
|
5568
|
+
}
|
|
5569
|
+
|
|
5570
|
+
if (!node || !node.focus) {
|
|
5571
|
+
tryFocus(getInitialFocusNode());
|
|
5572
|
+
return;
|
|
5573
|
+
}
|
|
5574
|
+
|
|
5575
|
+
node.focus({
|
|
5576
|
+
preventScroll: !!config.preventScroll
|
|
5577
|
+
});
|
|
5578
|
+
state.mostRecentlyFocusedNode = node;
|
|
5579
|
+
|
|
5580
|
+
if (isSelectableInput(node)) {
|
|
5581
|
+
node.select();
|
|
5582
|
+
}
|
|
5583
|
+
};
|
|
5584
|
+
|
|
5585
|
+
var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
|
|
5586
|
+
var node = getNodeForOption('setReturnFocus', previousActiveElement);
|
|
5587
|
+
return node ? node : node === false ? false : previousActiveElement;
|
|
5588
|
+
}; // This needs to be done on mousedown and touchstart instead of click
|
|
5589
|
+
// so that it precedes the focus event.
|
|
5590
|
+
|
|
5591
|
+
|
|
5592
|
+
var checkPointerDown = function checkPointerDown(e) {
|
|
5593
|
+
var target = getActualTarget(e);
|
|
5594
|
+
|
|
5595
|
+
if (containersContain(target)) {
|
|
5596
|
+
// allow the click since it ocurred inside the trap
|
|
5597
|
+
return;
|
|
5598
|
+
}
|
|
5599
|
+
|
|
5600
|
+
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
5601
|
+
// immediately deactivate the trap
|
|
5602
|
+
trap.deactivate({
|
|
5603
|
+
// if, on deactivation, we should return focus to the node originally-focused
|
|
5604
|
+
// when the trap was activated (or the configured `setReturnFocus` node),
|
|
5605
|
+
// then assume it's also OK to return focus to the outside node that was
|
|
5606
|
+
// just clicked, causing deactivation, as long as that node is focusable;
|
|
5607
|
+
// if it isn't focusable, then return focus to the original node focused
|
|
5608
|
+
// on activation (or the configured `setReturnFocus` node)
|
|
5609
|
+
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
5610
|
+
// which will result in the outside click setting focus to the node
|
|
5611
|
+
// that was clicked, whether it's focusable or not; by setting
|
|
5612
|
+
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
|
|
5613
|
+
// on activation (or the configured `setReturnFocus` node)
|
|
5614
|
+
returnFocus: config.returnFocusOnDeactivate && !isFocusable(target)
|
|
5615
|
+
});
|
|
5616
|
+
return;
|
|
5617
|
+
} // This is needed for mobile devices.
|
|
5618
|
+
// (If we'll only let `click` events through,
|
|
5619
|
+
// then on mobile they will be blocked anyways if `touchstart` is blocked.)
|
|
5620
|
+
|
|
5621
|
+
|
|
5622
|
+
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
5623
|
+
// allow the click outside the trap to take place
|
|
5624
|
+
return;
|
|
5625
|
+
} // otherwise, prevent the click
|
|
5626
|
+
|
|
5627
|
+
|
|
5628
|
+
e.preventDefault();
|
|
5629
|
+
}; // In case focus escapes the trap for some strange reason, pull it back in.
|
|
5630
|
+
|
|
5631
|
+
|
|
5632
|
+
var checkFocusIn = function checkFocusIn(e) {
|
|
5633
|
+
var target = getActualTarget(e);
|
|
5634
|
+
var targetContained = containersContain(target); // In Firefox when you Tab out of an iframe the Document is briefly focused.
|
|
5635
|
+
|
|
5636
|
+
if (targetContained || target instanceof Document) {
|
|
5637
|
+
if (targetContained) {
|
|
5638
|
+
state.mostRecentlyFocusedNode = target;
|
|
5639
|
+
}
|
|
5640
|
+
} else {
|
|
5641
|
+
// escaped! pull it back in to where it just left
|
|
5642
|
+
e.stopImmediatePropagation();
|
|
5643
|
+
tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
|
|
5644
|
+
}
|
|
5645
|
+
}; // Hijack Tab events on the first and last focusable nodes of the trap,
|
|
5646
|
+
// in order to prevent focus from escaping. If it escapes for even a
|
|
5647
|
+
// moment it can end up scrolling the page and causing confusion so we
|
|
5648
|
+
// kind of need to capture the action at the keydown phase.
|
|
5649
|
+
|
|
5650
|
+
|
|
5651
|
+
var checkTab = function checkTab(e) {
|
|
5652
|
+
var target = getActualTarget(e);
|
|
5653
|
+
updateTabbableNodes();
|
|
5654
|
+
var destinationNode = null;
|
|
5655
|
+
|
|
5656
|
+
if (state.tabbableGroups.length > 0) {
|
|
5657
|
+
// make sure the target is actually contained in a group
|
|
5658
|
+
// NOTE: the target may also be the container itself if it's focusable
|
|
5659
|
+
// with tabIndex='-1' and was given initial focus
|
|
5660
|
+
var containerIndex = findIndex(state.tabbableGroups, function (_ref) {
|
|
5661
|
+
var container = _ref.container;
|
|
5662
|
+
return container.contains(target);
|
|
5663
|
+
});
|
|
5664
|
+
var containerGroup = containerIndex >= 0 ? state.tabbableGroups[containerIndex] : undefined;
|
|
5665
|
+
|
|
5666
|
+
if (containerIndex < 0) {
|
|
5667
|
+
// target not found in any group: quite possible focus has escaped the trap,
|
|
5668
|
+
// so bring it back in to...
|
|
5669
|
+
if (e.shiftKey) {
|
|
5670
|
+
// ...the last node in the last group
|
|
5671
|
+
destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
|
|
5672
|
+
} else {
|
|
5673
|
+
// ...the first node in the first group
|
|
5674
|
+
destinationNode = state.tabbableGroups[0].firstTabbableNode;
|
|
5675
|
+
}
|
|
5676
|
+
} else if (e.shiftKey) {
|
|
5677
|
+
// REVERSE
|
|
5678
|
+
// is the target the first tabbable node in a group?
|
|
5679
|
+
var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
|
|
5680
|
+
var firstTabbableNode = _ref2.firstTabbableNode;
|
|
5681
|
+
return target === firstTabbableNode;
|
|
5682
|
+
});
|
|
5683
|
+
|
|
5684
|
+
if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target) && !isTabbable(target) && !containerGroup.nextTabbableNode(target, false))) {
|
|
5685
|
+
// an exception case where the target is either the container itself, or
|
|
5686
|
+
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
5687
|
+
// and user clicked on it or node was programmatically given focus)
|
|
5688
|
+
// and is not followed by any other tabbable node, in which
|
|
5689
|
+
// case, we should handle shift+tab as if focus were on the container's
|
|
5690
|
+
// first tabbable node, and go to the last tabbable node of the LAST group
|
|
5691
|
+
startOfGroupIndex = containerIndex;
|
|
5692
|
+
}
|
|
5693
|
+
|
|
5694
|
+
if (startOfGroupIndex >= 0) {
|
|
5695
|
+
// YES: then shift+tab should go to the last tabbable node in the
|
|
5696
|
+
// previous group (and wrap around to the last tabbable node of
|
|
5697
|
+
// the LAST group if it's the first tabbable node of the FIRST group)
|
|
5698
|
+
var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
|
|
5699
|
+
var destinationGroup = state.tabbableGroups[destinationGroupIndex];
|
|
5700
|
+
destinationNode = destinationGroup.lastTabbableNode;
|
|
5701
|
+
}
|
|
5702
|
+
} else {
|
|
5703
|
+
// FORWARD
|
|
5704
|
+
// is the target the last tabbable node in a group?
|
|
5705
|
+
var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
|
|
5706
|
+
var lastTabbableNode = _ref3.lastTabbableNode;
|
|
5707
|
+
return target === lastTabbableNode;
|
|
5708
|
+
});
|
|
5709
|
+
|
|
5710
|
+
if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target) && !isTabbable(target) && !containerGroup.nextTabbableNode(target))) {
|
|
5711
|
+
// an exception case where the target is the container itself, or
|
|
5712
|
+
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
5713
|
+
// and user clicked on it or node was programmatically given focus)
|
|
5714
|
+
// and is not followed by any other tabbable node, in which
|
|
5715
|
+
// case, we should handle tab as if focus were on the container's
|
|
5716
|
+
// last tabbable node, and go to the first tabbable node of the FIRST group
|
|
5717
|
+
lastOfGroupIndex = containerIndex;
|
|
5718
|
+
}
|
|
5719
|
+
|
|
5720
|
+
if (lastOfGroupIndex >= 0) {
|
|
5721
|
+
// YES: then tab should go to the first tabbable node in the next
|
|
5722
|
+
// group (and wrap around to the first tabbable node of the FIRST
|
|
5723
|
+
// group if it's the last tabbable node of the LAST group)
|
|
5724
|
+
var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
|
|
5725
|
+
|
|
5726
|
+
var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
|
|
5727
|
+
destinationNode = _destinationGroup.firstTabbableNode;
|
|
5728
|
+
}
|
|
5729
|
+
}
|
|
5730
|
+
} else {
|
|
5731
|
+
// NOTE: the fallbackFocus option does not support returning false to opt-out
|
|
5732
|
+
destinationNode = getNodeForOption('fallbackFocus');
|
|
5733
|
+
}
|
|
5734
|
+
|
|
5735
|
+
if (destinationNode) {
|
|
5736
|
+
e.preventDefault();
|
|
5737
|
+
tryFocus(destinationNode);
|
|
5738
|
+
} // else, let the browser take care of [shift+]tab and move the focus
|
|
5739
|
+
|
|
5740
|
+
};
|
|
5741
|
+
|
|
5742
|
+
var checkKey = function checkKey(e) {
|
|
5743
|
+
if (isEscapeEvent(e) && valueOrHandler(config.escapeDeactivates, e) !== false) {
|
|
5744
|
+
e.preventDefault();
|
|
5745
|
+
trap.deactivate();
|
|
5746
|
+
return;
|
|
5747
|
+
}
|
|
5748
|
+
|
|
5749
|
+
if (isTabEvent(e)) {
|
|
5750
|
+
checkTab(e);
|
|
5751
|
+
return;
|
|
5752
|
+
}
|
|
5753
|
+
};
|
|
5754
|
+
|
|
5755
|
+
var checkClick = function checkClick(e) {
|
|
5756
|
+
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
5757
|
+
return;
|
|
5758
|
+
}
|
|
5759
|
+
|
|
5760
|
+
var target = getActualTarget(e);
|
|
5761
|
+
|
|
5762
|
+
if (containersContain(target)) {
|
|
5763
|
+
return;
|
|
5764
|
+
}
|
|
5765
|
+
|
|
5766
|
+
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
5767
|
+
return;
|
|
5768
|
+
}
|
|
5769
|
+
|
|
5770
|
+
e.preventDefault();
|
|
5771
|
+
e.stopImmediatePropagation();
|
|
5772
|
+
}; //
|
|
5773
|
+
// EVENT LISTENERS
|
|
5774
|
+
//
|
|
5775
|
+
|
|
5776
|
+
|
|
5777
|
+
var addListeners = function addListeners() {
|
|
5778
|
+
if (!state.active) {
|
|
5779
|
+
return;
|
|
5780
|
+
} // There can be only one listening focus trap at a time
|
|
5781
|
+
|
|
5782
|
+
|
|
5783
|
+
activeFocusTraps.activateTrap(trap); // Delay ensures that the focused element doesn't capture the event
|
|
5784
|
+
// that caused the focus trap activation.
|
|
5785
|
+
|
|
5786
|
+
state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function () {
|
|
5787
|
+
tryFocus(getInitialFocusNode());
|
|
5788
|
+
}) : tryFocus(getInitialFocusNode());
|
|
5789
|
+
doc.addEventListener('focusin', checkFocusIn, true);
|
|
5790
|
+
doc.addEventListener('mousedown', checkPointerDown, {
|
|
5791
|
+
capture: true,
|
|
5792
|
+
passive: false
|
|
5793
|
+
});
|
|
5794
|
+
doc.addEventListener('touchstart', checkPointerDown, {
|
|
5795
|
+
capture: true,
|
|
5796
|
+
passive: false
|
|
5797
|
+
});
|
|
5798
|
+
doc.addEventListener('click', checkClick, {
|
|
5799
|
+
capture: true,
|
|
5800
|
+
passive: false
|
|
5801
|
+
});
|
|
5802
|
+
doc.addEventListener('keydown', checkKey, {
|
|
5803
|
+
capture: true,
|
|
5804
|
+
passive: false
|
|
5805
|
+
});
|
|
5806
|
+
return trap;
|
|
5807
|
+
};
|
|
5808
|
+
|
|
5809
|
+
var removeListeners = function removeListeners() {
|
|
5810
|
+
if (!state.active) {
|
|
5811
|
+
return;
|
|
5812
|
+
}
|
|
5813
|
+
|
|
5814
|
+
doc.removeEventListener('focusin', checkFocusIn, true);
|
|
5815
|
+
doc.removeEventListener('mousedown', checkPointerDown, true);
|
|
5816
|
+
doc.removeEventListener('touchstart', checkPointerDown, true);
|
|
5817
|
+
doc.removeEventListener('click', checkClick, true);
|
|
5818
|
+
doc.removeEventListener('keydown', checkKey, true);
|
|
5819
|
+
return trap;
|
|
5820
|
+
}; //
|
|
5821
|
+
// TRAP DEFINITION
|
|
5822
|
+
//
|
|
5823
|
+
|
|
5824
|
+
|
|
5825
|
+
trap = {
|
|
5826
|
+
activate: function activate(activateOptions) {
|
|
5827
|
+
if (state.active) {
|
|
5828
|
+
return this;
|
|
5829
|
+
}
|
|
5830
|
+
|
|
5831
|
+
var onActivate = getOption(activateOptions, 'onActivate');
|
|
5832
|
+
var onPostActivate = getOption(activateOptions, 'onPostActivate');
|
|
5833
|
+
var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
|
|
5834
|
+
|
|
5835
|
+
if (!checkCanFocusTrap) {
|
|
5836
|
+
updateTabbableNodes();
|
|
5837
|
+
}
|
|
5838
|
+
|
|
5839
|
+
state.active = true;
|
|
5840
|
+
state.paused = false;
|
|
5841
|
+
state.nodeFocusedBeforeActivation = doc.activeElement;
|
|
5842
|
+
|
|
5843
|
+
if (onActivate) {
|
|
5844
|
+
onActivate();
|
|
5845
|
+
}
|
|
5846
|
+
|
|
5847
|
+
var finishActivation = function finishActivation() {
|
|
5848
|
+
if (checkCanFocusTrap) {
|
|
5849
|
+
updateTabbableNodes();
|
|
5850
|
+
}
|
|
5851
|
+
|
|
5852
|
+
addListeners();
|
|
5853
|
+
|
|
5854
|
+
if (onPostActivate) {
|
|
5855
|
+
onPostActivate();
|
|
5856
|
+
}
|
|
5857
|
+
};
|
|
5858
|
+
|
|
5859
|
+
if (checkCanFocusTrap) {
|
|
5860
|
+
checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
|
|
5861
|
+
return this;
|
|
5862
|
+
}
|
|
5863
|
+
|
|
5864
|
+
finishActivation();
|
|
5865
|
+
return this;
|
|
5866
|
+
},
|
|
5867
|
+
deactivate: function deactivate(deactivateOptions) {
|
|
5868
|
+
if (!state.active) {
|
|
5869
|
+
return this;
|
|
5870
|
+
}
|
|
5871
|
+
|
|
5872
|
+
clearTimeout(state.delayInitialFocusTimer); // noop if undefined
|
|
5873
|
+
|
|
5874
|
+
state.delayInitialFocusTimer = undefined;
|
|
5875
|
+
removeListeners();
|
|
5876
|
+
state.active = false;
|
|
5877
|
+
state.paused = false;
|
|
5878
|
+
activeFocusTraps.deactivateTrap(trap);
|
|
5879
|
+
var onDeactivate = getOption(deactivateOptions, 'onDeactivate');
|
|
5880
|
+
var onPostDeactivate = getOption(deactivateOptions, 'onPostDeactivate');
|
|
5881
|
+
var checkCanReturnFocus = getOption(deactivateOptions, 'checkCanReturnFocus');
|
|
5882
|
+
|
|
5883
|
+
if (onDeactivate) {
|
|
5884
|
+
onDeactivate();
|
|
5885
|
+
}
|
|
5886
|
+
|
|
5887
|
+
var returnFocus = getOption(deactivateOptions, 'returnFocus', 'returnFocusOnDeactivate');
|
|
5888
|
+
|
|
5889
|
+
var finishDeactivation = function finishDeactivation() {
|
|
5890
|
+
delay(function () {
|
|
5891
|
+
if (returnFocus) {
|
|
5892
|
+
tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
|
|
5893
|
+
}
|
|
5894
|
+
|
|
5895
|
+
if (onPostDeactivate) {
|
|
5896
|
+
onPostDeactivate();
|
|
5897
|
+
}
|
|
5898
|
+
});
|
|
5899
|
+
};
|
|
5900
|
+
|
|
5901
|
+
if (returnFocus && checkCanReturnFocus) {
|
|
5902
|
+
checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
|
|
5903
|
+
return this;
|
|
5904
|
+
}
|
|
5905
|
+
|
|
5906
|
+
finishDeactivation();
|
|
5907
|
+
return this;
|
|
5908
|
+
},
|
|
5909
|
+
pause: function pause() {
|
|
5910
|
+
if (state.paused || !state.active) {
|
|
5911
|
+
return this;
|
|
5912
|
+
}
|
|
5913
|
+
|
|
5914
|
+
state.paused = true;
|
|
5915
|
+
removeListeners();
|
|
5916
|
+
return this;
|
|
5917
|
+
},
|
|
5918
|
+
unpause: function unpause() {
|
|
5919
|
+
if (!state.paused || !state.active) {
|
|
5920
|
+
return this;
|
|
5921
|
+
}
|
|
5922
|
+
|
|
5923
|
+
state.paused = false;
|
|
5924
|
+
updateTabbableNodes();
|
|
5925
|
+
addListeners();
|
|
5926
|
+
return this;
|
|
5927
|
+
},
|
|
5928
|
+
updateContainerElements: function updateContainerElements(containerElements) {
|
|
5929
|
+
var elementsAsArray = [].concat(containerElements).filter(Boolean);
|
|
5930
|
+
state.containers = elementsAsArray.map(function (element) {
|
|
5931
|
+
return typeof element === 'string' ? doc.querySelector(element) : element;
|
|
5932
|
+
});
|
|
5933
|
+
|
|
5934
|
+
if (state.active) {
|
|
5935
|
+
updateTabbableNodes();
|
|
5936
|
+
}
|
|
5937
|
+
|
|
5938
|
+
return this;
|
|
5939
|
+
}
|
|
5940
|
+
}; // initialize container elements
|
|
5941
|
+
|
|
5942
|
+
trap.updateContainerElements(elements);
|
|
5943
|
+
return trap;
|
|
5944
|
+
};
|
|
5945
|
+
|
|
5946
|
+
const viewerGridCss = "*,*::after,*::before{box-sizing:border-box}:host{display:flex;height:100vh;overflow:hidden;position:relative}:host([small]) .main{flex-basis:375px}@media screen and (max-width: 375px){:host([small]) .main{transition:none;flex-basis:100vw}}:host([medium]) .main{flex-basis:624px}@media screen and (max-width: 624px){:host([medium]) .main{transition:none;flex-basis:100vw}}:host([large]) .main{flex-basis:60%;min-width:768px;max-width:1024px}@media screen and (max-width: 768px){:host([large]) .main{transition:none;flex-basis:100vw;min-width:auto;max-width:auto}}.shrink,.expand,.overlay-close-button{display:inline-block;font-size:1em;font-weight:500;margin-bottom:0;text-decoration:none;touch-action:manipulation;text-align:left;user-select:none;vertical-align:middle;border:0;color:#39870c;line-height:1;padding:0;background-color:transparent}.shrink:focus,.shrink:focus-visible,.expand:focus,.expand:focus-visible,.overlay-close-button:focus,.overlay-close-button:focus-visible{outline-offset:2px}.shrink:active,.expand:active,.overlay-close-button:active{outline:0}.shrink.extern::after,.shrink.download::after,.expand.extern::after,.expand.download::after,.overlay-close-button.extern::after,.overlay-close-button.download::after{content:\"\";display:inline-block;height:1.5em;margin-left:8px;vertical-align:top;width:1.5em}.shrink[disabled],.expand[disabled],.overlay-close-button[disabled]{color:#afcf9d}.shrink:not([disabled]):hover,.expand:not([disabled]):hover,.overlay-close-button:not([disabled]):hover{color:#676cb0;text-decoration:underline}.shrink:not([disabled]):active,.expand:not([disabled]):active,.overlay-close-button:not([disabled]):active{color:#676cb0}.shrink.btn-align,.expand.btn-align,.overlay-close-button.btn-align{line-height:calc(1.5em - 1px);padding:11px 0;position:relative}.shrink.extern::after,.shrink.download::after,.expand.extern::after,.expand.download::after,.overlay-close-button.extern::after,.overlay-close-button.download::after{position:relative;top:-2px}.shrink.download::after,.expand.download::after,.overlay-close-button.download::after{background:var(--dso-icon, var(--di-download)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}.shrink.download[disabled]::after,.expand.download[disabled]::after,.overlay-close-button.download[disabled]::after{--dso-icon:var(--di-download-grasgroen-40)}.shrink.download:not([disabled]):hover::after,.shrink.download:not([disabled]):active::after,.expand.download:not([disabled]):hover::after,.expand.download:not([disabled]):active::after,.overlay-close-button.download:not([disabled]):hover::after,.overlay-close-button.download:not([disabled]):active::after{--dso-icon:var(--di-download-scampi)}.shrink.extern::after,.expand.extern::after,.overlay-close-button.extern::after{background:var(--dso-icon, var(--di-external-link)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}.shrink.extern[disabled]::after,.expand.extern[disabled]::after,.overlay-close-button.extern[disabled]::after{--dso-icon:var(--di-external-link-grasgroen-40)}.shrink.extern:not([disabled]):hover::after,.shrink.extern:not([disabled]):active::after,.expand.extern:not([disabled]):hover::after,.expand.extern:not([disabled]):active::after,.overlay-close-button.extern:not([disabled]):hover::after,.overlay-close-button.extern:not([disabled]):active::after{--dso-icon:var(--di-external-link-scampi)}.shrink dso-icon+span:not(.sr-only),.shrink svg.di+span:not(.sr-only),.shrink span:not(.sr-only)+dso-icon,.shrink span:not(.sr-only)+svg.di,.expand dso-icon+span:not(.sr-only),.expand svg.di+span:not(.sr-only),.expand span:not(.sr-only)+dso-icon,.expand span:not(.sr-only)+svg.di,.overlay-close-button dso-icon+span:not(.sr-only),.overlay-close-button svg.di+span:not(.sr-only),.overlay-close-button span:not(.sr-only)+dso-icon,.overlay-close-button span:not(.sr-only)+svg.di{margin-left:8px}.shrink dso-icon,.shrink svg.di,.shrink span,.expand dso-icon,.expand svg.di,.expand span,.overlay-close-button dso-icon,.overlay-close-button svg.di,.overlay-close-button span{vertical-align:middle}.shrink:hover,.expand:hover,.overlay-close-button:hover{cursor:pointer}.shrink[disabled],.expand[disabled],.overlay-close-button[disabled]{display:none}.overlay-close-button{position:absolute;top:8px;right:16px}.overlay-close-button .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sizing-buttons{display:flex;justify-content:flex-end;margin-bottom:8px}.main{background-color:#fff;box-shadow:2px 0 5px #666;flex-shrink:0;flex-grow:0;height:100%;transition:flex-basis 0.2s ease-in, max-width 0.2s ease-in, min-width 0.2s ease-in;padding:8px 16px;overflow-y:auto;z-index:1}.map{height:100%;width:100%;overflow:hidden}.overlay{background-color:#fff;box-shadow:-2px 0 5px #666;height:100%;overflow-y:auto;padding:40px 16px 8px;position:absolute;right:0;width:624px;z-index:2}";
|
|
5947
|
+
|
|
5948
|
+
let ViewerGrid = class extends HTMLElement {
|
|
5949
|
+
constructor() {
|
|
5950
|
+
super();
|
|
5951
|
+
this.__registerHost();
|
|
5952
|
+
attachShadow(this);
|
|
5953
|
+
this.closeOverlay = createEvent(this, "closeOverlay", 7);
|
|
5954
|
+
this.overlayOpen = false;
|
|
5955
|
+
this.mainSize = "large";
|
|
5956
|
+
this.shrinkMain = () => {
|
|
5957
|
+
this.mainSize = this.mainSize == "large" ? "medium" : "small";
|
|
5958
|
+
};
|
|
5959
|
+
this.expandMain = () => {
|
|
5960
|
+
this.mainSize = this.mainSize == "small" ? "medium" : "large";
|
|
5961
|
+
};
|
|
5962
|
+
this.keyDownListener = (event) => {
|
|
5963
|
+
if (event.key != "Escape") {
|
|
5964
|
+
return;
|
|
5965
|
+
}
|
|
5966
|
+
this.closeOverlay.emit(event);
|
|
5967
|
+
};
|
|
5968
|
+
}
|
|
5969
|
+
updateFocusTrap() {
|
|
5970
|
+
if (!this.trap) {
|
|
5971
|
+
return;
|
|
5972
|
+
}
|
|
5973
|
+
if (this.overlayOpen) {
|
|
5974
|
+
this.trap.activate();
|
|
5975
|
+
this.host.addEventListener("keydown", this.keyDownListener);
|
|
5976
|
+
}
|
|
5977
|
+
else {
|
|
5978
|
+
this.trap.deactivate();
|
|
5979
|
+
this.host.removeEventListener("keydown", this.keyDownListener);
|
|
5980
|
+
}
|
|
5981
|
+
}
|
|
5982
|
+
connectedCallback() {
|
|
5983
|
+
this.overlaySlot = this.host.querySelector("div[slot = 'overlay']");
|
|
5984
|
+
}
|
|
5985
|
+
componentDidLoad() {
|
|
5986
|
+
if (!this.overlay || !this.overlaySlot) {
|
|
5987
|
+
return;
|
|
5988
|
+
}
|
|
5989
|
+
this.trap = createFocusTrap([this.overlay, this.overlaySlot], {
|
|
5990
|
+
escapeDeactivates: false,
|
|
5991
|
+
allowOutsideClick: true,
|
|
5992
|
+
});
|
|
5993
|
+
this.updateFocusTrap();
|
|
5994
|
+
}
|
|
5995
|
+
componentDidUpdate() {
|
|
5996
|
+
this.updateFocusTrap();
|
|
5997
|
+
}
|
|
5998
|
+
disconnectedCallback() {
|
|
5999
|
+
if (this.trap) {
|
|
6000
|
+
this.trap.deactivate();
|
|
6001
|
+
}
|
|
6002
|
+
this.host.removeEventListener("keydown", this.keyDownListener);
|
|
6003
|
+
}
|
|
6004
|
+
render() {
|
|
6005
|
+
return (h(Host, Object.assign({}, { [this.mainSize]: true }), h("div", { class: "main" }, h("div", { class: "sizing-buttons" }, h("button", { type: "button", class: "shrink", disabled: this.mainSize == "small", onClick: this.shrinkMain }, h("dso-icon", { icon: "chevron-left" })), h("button", { type: "button", class: "expand", disabled: this.mainSize == "large", onClick: this.expandMain }, h("dso-icon", { icon: "chevron-right" }))), h("slot", { name: "main" })), h("div", { class: "map" }, h("slot", { name: "map" })), h("div", { class: "overlay", hidden: !this.overlayOpen || !this.overlaySlot, ref: (element) => (this.overlay = element) }, h("button", { type: "button", class: "overlay-close-button", onClick: (e) => this.closeOverlay.emit(e) }, h("dso-icon", { icon: "times" }), h("span", { class: "sr-only" }, "sluiten")), h("slot", { name: "overlay" }))));
|
|
6006
|
+
}
|
|
6007
|
+
get host() { return this; }
|
|
6008
|
+
static get style() { return viewerGridCss; }
|
|
6009
|
+
};
|
|
6010
|
+
|
|
5002
6011
|
const DsoAlert = /*@__PURE__*/proxyCustomElement(Alert, [1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]);
|
|
5003
6012
|
const DsoAttachmentsCounter = /*@__PURE__*/proxyCustomElement(AttachmentsCounter, [1,"dso-attachments-counter",{"count":[2]}]);
|
|
5004
6013
|
const DsoAutosuggest = /*@__PURE__*/proxyCustomElement(Autosuggest, [6,"dso-autosuggest",{"suggestions":[16],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32]},[[4,"click","onDocumentClick"]]]);
|
|
5005
6014
|
const DsoBadge = /*@__PURE__*/proxyCustomElement(Badge, [1,"dso-badge",{"status":[1]}]);
|
|
5006
6015
|
const DsoBanner = /*@__PURE__*/proxyCustomElement(Banner, [1,"dso-banner",{"status":[1]}]);
|
|
5007
|
-
const DsoDatePicker = /*@__PURE__*/proxyCustomElement(DsoDatePicker$1, [
|
|
6016
|
+
const DsoDatePicker = /*@__PURE__*/proxyCustomElement(DsoDatePicker$1, [2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[4],"dsoAutofocus":[4,"dso-autofocus"],"value":[1537],"min":[1],"max":[1],"activeFocus":[32],"focusedDay":[32],"open":[32]},[[6,"click","handleDocumentClick"]]]);
|
|
5008
6017
|
const DsoDropdownMenu = /*@__PURE__*/proxyCustomElement(DropdownMenu, [1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]);
|
|
6018
|
+
const DsoHeader = /*@__PURE__*/proxyCustomElement(Header, [1,"dso-header",{"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"isLoggedIn":[4,"is-logged-in"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]);
|
|
5009
6019
|
const DsoHelpcenterPanel = /*@__PURE__*/proxyCustomElement(HelpcenterPanel, [1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]}]);
|
|
5010
6020
|
const DsoHighlightBox = /*@__PURE__*/proxyCustomElement(HighlightBox, [1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]);
|
|
5011
6021
|
const DsoIcon = /*@__PURE__*/proxyCustomElement(Icon, [1,"dso-icon",{"icon":[1]}]);
|
|
5012
6022
|
const DsoInfo = /*@__PURE__*/proxyCustomElement(Info, [1,"dso-info",{"fixed":[516],"active":[516]}]);
|
|
5013
6023
|
const DsoInfoButton = /*@__PURE__*/proxyCustomElement(InfoButton, [1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]);
|
|
5014
6024
|
const DsoLabel = /*@__PURE__*/proxyCustomElement(Label, [1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]);
|
|
5015
|
-
const DsoMapBaseLayers = /*@__PURE__*/proxyCustomElement(MapBaseLayers, [1,"dso-map-base-layers",{"baseLayers":[16]
|
|
6025
|
+
const DsoMapBaseLayers = /*@__PURE__*/proxyCustomElement(MapBaseLayers, [1,"dso-map-base-layers",{"baseLayers":[16]}]);
|
|
5016
6026
|
const DsoMapControls = /*@__PURE__*/proxyCustomElement(MapControls, [1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]);
|
|
5017
|
-
const DsoMapOverlays = /*@__PURE__*/proxyCustomElement(MapOverlays, [1,"dso-map-overlays",{"overlays":[16]
|
|
6027
|
+
const DsoMapOverlays = /*@__PURE__*/proxyCustomElement(MapOverlays, [1,"dso-map-overlays",{"overlays":[16]}]);
|
|
5018
6028
|
const DsoOzonContent = /*@__PURE__*/proxyCustomElement(OzonContent, [0,"dso-ozon-content",{"content":[1]},[[0,"click","handleClick"]]]);
|
|
5019
6029
|
const DsoProgressBar = /*@__PURE__*/proxyCustomElement(ProgressBar, [1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]);
|
|
5020
6030
|
const DsoProgressIndicator = /*@__PURE__*/proxyCustomElement(Progressindicator, [1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]);
|
|
@@ -5022,6 +6032,7 @@ const DsoSelectable = /*@__PURE__*/proxyCustomElement(Selectable, [1,"dso-select
|
|
|
5022
6032
|
const DsoToggletip = /*@__PURE__*/proxyCustomElement(Toggletip, [1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]);
|
|
5023
6033
|
const DsoTooltip = /*@__PURE__*/proxyCustomElement(Tooltip, [1,"dso-tooltip",{"position":[1],"for":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32]},[[0,"click","listenClick"]]]);
|
|
5024
6034
|
const DsoTreeView = /*@__PURE__*/proxyCustomElement(TreeView, [1,"dso-tree-view",{"collection":[16]}]);
|
|
6035
|
+
const DsoViewerGrid = /*@__PURE__*/proxyCustomElement(ViewerGrid, [1,"dso-viewer-grid",{"overlayOpen":[4,"overlay-open"],"mainSize":[32]}]);
|
|
5025
6036
|
const defineCustomElements = (opts) => {
|
|
5026
6037
|
if (typeof customElements !== 'undefined') {
|
|
5027
6038
|
[
|
|
@@ -5032,6 +6043,7 @@ const defineCustomElements = (opts) => {
|
|
|
5032
6043
|
DsoBanner,
|
|
5033
6044
|
DsoDatePicker,
|
|
5034
6045
|
DsoDropdownMenu,
|
|
6046
|
+
DsoHeader,
|
|
5035
6047
|
DsoHelpcenterPanel,
|
|
5036
6048
|
DsoHighlightBox,
|
|
5037
6049
|
DsoIcon,
|
|
@@ -5047,7 +6059,8 @@ const defineCustomElements = (opts) => {
|
|
|
5047
6059
|
DsoSelectable,
|
|
5048
6060
|
DsoToggletip,
|
|
5049
6061
|
DsoTooltip,
|
|
5050
|
-
DsoTreeView
|
|
6062
|
+
DsoTreeView,
|
|
6063
|
+
DsoViewerGrid
|
|
5051
6064
|
].forEach(cmp => {
|
|
5052
6065
|
if (!customElements.get(cmp.is)) {
|
|
5053
6066
|
customElements.define(cmp.is, cmp, opts);
|
|
@@ -5056,4 +6069,4 @@ const defineCustomElements = (opts) => {
|
|
|
5056
6069
|
}
|
|
5057
6070
|
};
|
|
5058
6071
|
|
|
5059
|
-
export { DsoAlert, DsoAttachmentsCounter, DsoAutosuggest, DsoBadge, DsoBanner, DsoDatePicker, DsoDropdownMenu, DsoHelpcenterPanel, DsoHighlightBox, DsoIcon, DsoInfo, DsoInfoButton, DsoLabel, DsoMapBaseLayers, DsoMapControls, DsoMapOverlays, DsoOzonContent, DsoProgressBar, DsoProgressIndicator, DsoSelectable, DsoToggletip, DsoTooltip, DsoTreeView, defineCustomElements };
|
|
6072
|
+
export { DsoAlert, DsoAttachmentsCounter, DsoAutosuggest, DsoBadge, DsoBanner, DsoDatePicker, DsoDropdownMenu, DsoHeader, DsoHelpcenterPanel, DsoHighlightBox, DsoIcon, DsoInfo, DsoInfoButton, DsoLabel, DsoMapBaseLayers, DsoMapControls, DsoMapOverlays, DsoOzonContent, DsoProgressBar, DsoProgressIndicator, DsoSelectable, DsoToggletip, DsoTooltip, DsoTreeView, DsoViewerGrid, defineCustomElements };
|