@dso-toolkit/core 73.2.0 → 73.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/dso-accordion-section.d.ts +11 -0
- package/dist/bundle/dso-accordion-section.js +281 -0
- package/dist/bundle/dso-accordion-section.js.map +1 -0
- package/dist/bundle/dso-accordion.d.ts +11 -0
- package/dist/bundle/dso-accordion.js +262 -0
- package/dist/bundle/dso-accordion.js.map +1 -0
- package/dist/bundle/dso-action-list-item.d.ts +11 -0
- package/dist/bundle/dso-action-list-item.js +63 -0
- package/dist/bundle/dso-action-list-item.js.map +1 -0
- package/dist/bundle/dso-action-list.d.ts +11 -0
- package/dist/bundle/dso-action-list.js +38 -0
- package/dist/bundle/dso-action-list.js.map +1 -0
- package/dist/bundle/dso-advanced-select.d.ts +11 -0
- package/dist/bundle/dso-advanced-select.js +155 -0
- package/dist/bundle/dso-advanced-select.js.map +1 -0
- package/dist/bundle/dso-alert.d.ts +11 -0
- package/dist/bundle/dso-alert.js +9 -0
- package/dist/bundle/dso-alert.js.map +1 -0
- package/dist/bundle/dso-annotation-activiteit.d.ts +11 -0
- package/dist/bundle/dso-annotation-activiteit.js +87 -0
- package/dist/bundle/dso-annotation-activiteit.js.map +1 -0
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.d.ts +11 -0
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.js +83 -0
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.js.map +1 -0
- package/dist/bundle/dso-annotation-kaart.d.ts +11 -0
- package/dist/bundle/dso-annotation-kaart.js +72 -0
- package/dist/bundle/dso-annotation-kaart.js.map +1 -0
- package/dist/bundle/dso-annotation-locatie.d.ts +11 -0
- package/dist/bundle/dso-annotation-locatie.js +9 -0
- package/dist/bundle/dso-annotation-locatie.js.map +1 -0
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.d.ts +11 -0
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.js +87 -0
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.js.map +1 -0
- package/dist/bundle/dso-attachments-counter.d.ts +11 -0
- package/dist/bundle/dso-attachments-counter.js +9 -0
- package/dist/bundle/dso-attachments-counter.js.map +1 -0
- package/dist/bundle/dso-autosuggest.d.ts +11 -0
- package/dist/bundle/dso-autosuggest.js +588 -0
- package/dist/bundle/dso-autosuggest.js.map +1 -0
- package/dist/bundle/dso-badge.d.ts +11 -0
- package/dist/bundle/dso-badge.js +9 -0
- package/dist/bundle/dso-badge.js.map +1 -0
- package/dist/bundle/dso-banner.d.ts +11 -0
- package/dist/bundle/dso-banner.js +53 -0
- package/dist/bundle/dso-banner.js.map +1 -0
- package/dist/bundle/dso-card-container.d.ts +11 -0
- package/dist/bundle/dso-card-container.js +42 -0
- package/dist/bundle/dso-card-container.js.map +1 -0
- package/dist/bundle/dso-card.d.ts +11 -0
- package/dist/bundle/dso-card.js +72 -0
- package/dist/bundle/dso-card.js.map +1 -0
- package/dist/bundle/dso-contact-information.d.ts +11 -0
- package/dist/bundle/dso-contact-information.js +36 -0
- package/dist/bundle/dso-contact-information.js.map +1 -0
- package/dist/bundle/dso-date-picker-legacy.d.ts +11 -0
- package/dist/bundle/dso-date-picker-legacy.js +773 -0
- package/dist/bundle/dso-date-picker-legacy.js.map +1 -0
- package/dist/bundle/dso-date-picker.d.ts +11 -0
- package/dist/bundle/dso-date-picker.js +187 -0
- package/dist/bundle/dso-date-picker.js.map +1 -0
- package/dist/bundle/dso-document-card.d.ts +11 -0
- package/dist/bundle/dso-document-card.js +66 -0
- package/dist/bundle/dso-document-card.js.map +1 -0
- package/dist/bundle/dso-document-component.d.ts +11 -0
- package/dist/bundle/dso-document-component.js +9 -0
- package/dist/bundle/dso-document-component.js.map +1 -0
- package/dist/bundle/dso-dropdown-menu.d.ts +11 -0
- package/dist/bundle/dso-dropdown-menu.js +9 -0
- package/dist/bundle/dso-dropdown-menu.js.map +1 -0
- package/dist/bundle/dso-expandable.d.ts +11 -0
- package/dist/bundle/dso-expandable.js +9 -0
- package/dist/bundle/dso-expandable.js.map +1 -0
- package/dist/bundle/dso-header.d.ts +11 -0
- package/dist/bundle/dso-header.js +218 -0
- package/dist/bundle/dso-header.js.map +1 -0
- package/dist/bundle/dso-highlight-box.d.ts +11 -0
- package/dist/bundle/dso-highlight-box.js +45 -0
- package/dist/bundle/dso-highlight-box.js.map +1 -0
- package/dist/bundle/dso-icon.d.ts +11 -0
- package/dist/bundle/dso-icon.js +9 -0
- package/dist/bundle/dso-icon.js.map +1 -0
- package/dist/bundle/dso-image-overlay.d.ts +11 -0
- package/dist/bundle/dso-image-overlay.js +9 -0
- package/dist/bundle/dso-image-overlay.js.map +1 -0
- package/dist/bundle/dso-info-button.d.ts +11 -0
- package/dist/bundle/dso-info-button.js +9 -0
- package/dist/bundle/dso-info-button.js.map +1 -0
- package/dist/bundle/dso-info.d.ts +11 -0
- package/dist/bundle/dso-info.js +9 -0
- package/dist/bundle/dso-info.js.map +1 -0
- package/dist/bundle/dso-input-range.d.ts +11 -0
- package/dist/bundle/dso-input-range.js +59 -0
- package/dist/bundle/dso-input-range.js.map +1 -0
- package/dist/bundle/dso-label.d.ts +11 -0
- package/dist/bundle/dso-label.js +9 -0
- package/dist/bundle/dso-label.js.map +1 -0
- package/dist/bundle/dso-legend-item.d.ts +11 -0
- package/dist/bundle/dso-legend-item.js +90 -0
- package/dist/bundle/dso-legend-item.js.map +1 -0
- package/dist/bundle/dso-list-button.d.ts +11 -0
- package/dist/bundle/dso-list-button.js +118 -0
- package/dist/bundle/dso-list-button.js.map +1 -0
- package/dist/bundle/dso-logo.d.ts +11 -0
- package/dist/bundle/dso-logo.js +64 -0
- package/dist/bundle/dso-logo.js.map +1 -0
- package/dist/bundle/dso-map-base-layers.d.ts +11 -0
- package/dist/bundle/dso-map-base-layers.js +101 -0
- package/dist/bundle/dso-map-base-layers.js.map +1 -0
- package/dist/bundle/dso-map-controls.d.ts +11 -0
- package/dist/bundle/dso-map-controls.js +138 -0
- package/dist/bundle/dso-map-controls.js.map +1 -0
- package/dist/bundle/dso-map-overlays.d.ts +11 -0
- package/dist/bundle/dso-map-overlays.js +102 -0
- package/dist/bundle/dso-map-overlays.js.map +1 -0
- package/dist/bundle/dso-mark-bar.d.ts +11 -0
- package/dist/bundle/dso-mark-bar.js +91 -0
- package/dist/bundle/dso-mark-bar.js.map +1 -0
- package/dist/bundle/dso-modal.d.ts +11 -0
- package/dist/bundle/dso-modal.js +120 -0
- package/dist/bundle/dso-modal.js.map +1 -0
- package/dist/bundle/dso-onboarding-tip.d.ts +11 -0
- package/dist/bundle/dso-onboarding-tip.js +1839 -0
- package/dist/bundle/dso-onboarding-tip.js.map +1 -0
- package/dist/bundle/dso-ozon-content.d.ts +11 -0
- package/dist/bundle/dso-ozon-content.js +9 -0
- package/dist/bundle/dso-ozon-content.js.map +1 -0
- package/dist/bundle/dso-pagination.d.ts +11 -0
- package/dist/bundle/dso-pagination.js +188 -0
- package/dist/bundle/dso-pagination.js.map +1 -0
- package/dist/bundle/dso-panel.d.ts +11 -0
- package/dist/bundle/dso-panel.js +9 -0
- package/dist/bundle/dso-panel.js.map +1 -0
- package/dist/bundle/dso-plekinfo-card.d.ts +11 -0
- package/dist/bundle/dso-plekinfo-card.js +88 -0
- package/dist/bundle/dso-plekinfo-card.js.map +1 -0
- package/dist/bundle/dso-progress-bar.d.ts +11 -0
- package/dist/bundle/dso-progress-bar.js +50 -0
- package/dist/bundle/dso-progress-bar.js.map +1 -0
- package/dist/bundle/dso-progress-indicator.d.ts +11 -0
- package/dist/bundle/dso-progress-indicator.js +9 -0
- package/dist/bundle/dso-progress-indicator.js.map +1 -0
- package/dist/bundle/dso-project-item.d.ts +11 -0
- package/dist/bundle/dso-project-item.js +56 -0
- package/dist/bundle/dso-project-item.js.map +1 -0
- package/dist/bundle/dso-renvooi.d.ts +11 -0
- package/dist/bundle/dso-renvooi.js +9 -0
- package/dist/bundle/dso-renvooi.js.map +1 -0
- package/dist/bundle/dso-responsive-element.d.ts +11 -0
- package/dist/bundle/dso-responsive-element.js +9 -0
- package/dist/bundle/dso-responsive-element.js.map +1 -0
- package/dist/bundle/dso-scrollable.d.ts +11 -0
- package/dist/bundle/dso-scrollable.js +9 -0
- package/dist/bundle/dso-scrollable.js.map +1 -0
- package/dist/bundle/dso-selectable.d.ts +11 -0
- package/dist/bundle/dso-selectable.js +9 -0
- package/dist/bundle/dso-selectable.js.map +1 -0
- package/dist/bundle/dso-skiplink.d.ts +11 -0
- package/dist/bundle/dso-skiplink.js +53 -0
- package/dist/bundle/dso-skiplink.js.map +1 -0
- package/dist/bundle/dso-slide-toggle.d.ts +11 -0
- package/dist/bundle/dso-slide-toggle.js +9 -0
- package/dist/bundle/dso-slide-toggle.js.map +1 -0
- package/dist/bundle/dso-survey-rating.d.ts +11 -0
- package/dist/bundle/dso-survey-rating.js +70 -0
- package/dist/bundle/dso-survey-rating.js.map +1 -0
- package/dist/bundle/dso-tab.d.ts +11 -0
- package/dist/bundle/dso-tab.js +70 -0
- package/dist/bundle/dso-tab.js.map +1 -0
- package/dist/bundle/dso-table.d.ts +11 -0
- package/dist/bundle/dso-table.js +9 -0
- package/dist/bundle/dso-table.js.map +1 -0
- package/dist/bundle/dso-tabs.d.ts +11 -0
- package/dist/bundle/dso-tabs.js +94 -0
- package/dist/bundle/dso-tabs.js.map +1 -0
- package/dist/bundle/dso-toggletip.d.ts +11 -0
- package/dist/bundle/dso-toggletip.js +9 -0
- package/dist/bundle/dso-toggletip.js.map +1 -0
- package/dist/bundle/dso-tooltip.d.ts +11 -0
- package/dist/bundle/dso-tooltip.js +9 -0
- package/dist/bundle/dso-tooltip.js.map +1 -0
- package/dist/bundle/dso-tree-view.d.ts +11 -0
- package/dist/bundle/dso-tree-view.js +237 -0
- package/dist/bundle/dso-tree-view.js.map +1 -0
- package/dist/bundle/dso-viewer-grid.d.ts +11 -0
- package/dist/bundle/dso-viewer-grid.js +351 -0
- package/dist/bundle/dso-viewer-grid.js.map +1 -0
- package/dist/bundle/dsot-document-component-demo.d.ts +11 -0
- package/dist/bundle/dsot-document-component-demo.js +1957 -0
- package/dist/bundle/dsot-document-component-demo.js.map +1 -0
- package/dist/bundle/index.d.ts +45 -0
- package/dist/bundle/index.js +143 -0
- package/dist/bundle/index.js.map +1 -0
- package/dist/bundle/p-0JGmXD8O.js +59 -0
- package/dist/bundle/p-0JGmXD8O.js.map +1 -0
- package/dist/bundle/p-BF0_OXTe.js +60 -0
- package/dist/bundle/p-BF0_OXTe.js.map +1 -0
- package/dist/bundle/p-BPLPqKUj.js +163 -0
- package/dist/bundle/p-BPLPqKUj.js.map +1 -0
- package/dist/bundle/p-B_kXuEcW.js +2178 -0
- package/dist/bundle/p-B_kXuEcW.js.map +1 -0
- package/dist/bundle/p-BacS1uCc.js +35 -0
- package/dist/bundle/p-BacS1uCc.js.map +1 -0
- package/dist/bundle/p-BdyXpl60.js +76 -0
- package/dist/bundle/p-BdyXpl60.js.map +1 -0
- package/dist/bundle/p-BocpUT46.js +992 -0
- package/dist/bundle/p-BocpUT46.js.map +1 -0
- package/dist/bundle/p-BtcZ9oZ6.js +115 -0
- package/dist/bundle/p-BtcZ9oZ6.js.map +1 -0
- package/dist/bundle/p-BxvZeNWe.js +126 -0
- package/dist/bundle/p-BxvZeNWe.js.map +1 -0
- package/dist/bundle/p-C1tscMvU.js +43 -0
- package/dist/bundle/p-C1tscMvU.js.map +1 -0
- package/dist/bundle/p-CZ2ipzNO.js +63 -0
- package/dist/bundle/p-CZ2ipzNO.js.map +1 -0
- package/dist/bundle/p-Cbba2ZRN.js +36 -0
- package/dist/bundle/p-Cbba2ZRN.js.map +1 -0
- package/dist/bundle/p-ChV9xqsO.js +6 -0
- package/dist/bundle/p-ChV9xqsO.js.map +1 -0
- package/dist/bundle/p-ChrHXjXh.js +80 -0
- package/dist/bundle/p-ChrHXjXh.js.map +1 -0
- package/dist/bundle/p-Cng7insW.js +145 -0
- package/dist/bundle/p-Cng7insW.js.map +1 -0
- package/dist/bundle/p-CodDyi2J.js +15 -0
- package/dist/bundle/p-CodDyi2J.js.map +1 -0
- package/dist/bundle/p-CsY83cJO.js +1801 -0
- package/dist/bundle/p-CsY83cJO.js.map +1 -0
- package/dist/bundle/p-CvGnEQcm.js +80 -0
- package/dist/bundle/p-CvGnEQcm.js.map +1 -0
- package/dist/bundle/p-D2nuXSd0.js +723 -0
- package/dist/bundle/p-D2nuXSd0.js.map +1 -0
- package/dist/bundle/p-D9Yjz_Sm.js +125 -0
- package/dist/bundle/p-D9Yjz_Sm.js.map +1 -0
- package/dist/bundle/p-DDDh2Izf.js +12 -0
- package/dist/bundle/p-DDDh2Izf.js.map +1 -0
- package/dist/bundle/p-DGWbWwct.js +121 -0
- package/dist/bundle/p-DGWbWwct.js.map +1 -0
- package/dist/bundle/p-DHO_Za64.js +1729 -0
- package/dist/bundle/p-DHO_Za64.js.map +1 -0
- package/dist/bundle/p-DPH021KD.js +14 -0
- package/dist/bundle/p-DPH021KD.js.map +1 -0
- package/dist/bundle/p-DSyv-znO.js +18 -0
- package/dist/bundle/p-DSyv-znO.js.map +1 -0
- package/dist/bundle/p-DWTXTDbr.js +253 -0
- package/dist/bundle/p-DWTXTDbr.js.map +1 -0
- package/dist/bundle/p-DacnxEpv.js +78 -0
- package/dist/bundle/p-DacnxEpv.js.map +1 -0
- package/dist/bundle/p-DcpG4jOU.js +99 -0
- package/dist/bundle/p-DcpG4jOU.js.map +1 -0
- package/dist/bundle/p-DrR9RuIM.js +83 -0
- package/dist/bundle/p-DrR9RuIM.js.map +1 -0
- package/dist/bundle/p-DvqO1i1s.js +1162 -0
- package/dist/bundle/p-DvqO1i1s.js.map +1 -0
- package/dist/bundle/p-Hgv-pDpy.js +13 -0
- package/dist/bundle/p-Hgv-pDpy.js.map +1 -0
- package/dist/bundle/p-Pk8qng7t.js +573 -0
- package/dist/bundle/p-Pk8qng7t.js.map +1 -0
- package/dist/bundle/p-WYm6cxra.js +64 -0
- package/dist/bundle/p-WYm6cxra.js.map +1 -0
- package/dist/bundle/p-dB3K6tfb.js +41 -0
- package/dist/bundle/p-dB3K6tfb.js.map +1 -0
- package/dist/bundle/p-kDtv6DeD.js +314 -0
- package/dist/bundle/p-kDtv6DeD.js.map +1 -0
- package/dist/bundle/p-pVO6m7lg.js +271 -0
- package/dist/bundle/p-pVO6m7lg.js.map +1 -0
- package/dist/bundle/p-xNnEBBZG.js +63 -0
- package/dist/bundle/p-xNnEBBZG.js.map +1 -0
- package/dist/cjs/dso-accordion-section.cjs.entry.js +3 -3
- package/dist/cjs/dso-accordion-section.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-accordion-section.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-alert_6.cjs.entry.js +3 -7
- package/dist/cjs/dso-alert_6.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-onboarding-tip.cjs.entry.js +24 -10
- package/dist/cjs/dso-onboarding-tip.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-onboarding-tip.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/components/accordion-section.js +3 -3
- package/dist/collection/components/accordion/components/accordion-section.js.map +1 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.css +21 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.js +28 -9
- package/dist/collection/components/onboarding-tip/onboarding-tip.js.map +1 -1
- package/dist/collection/components/table/table.css +2 -2
- package/dist/collection/components/table/table.js +3 -26
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/components/dso-accordion-section.js +3 -3
- package/dist/components/dso-accordion-section.js.map +1 -1
- package/dist/components/dso-onboarding-tip.js +26 -11
- package/dist/components/dso-onboarding-tip.js.map +1 -1
- package/dist/components/table.js +4 -8
- package/dist/components/table.js.map +1 -1
- package/dist/dso-toolkit/dso-accordion-section.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-onboarding-tip.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/{p-8084c884.entry.js → p-5fa008c6.entry.js} +2 -2
- package/dist/dso-toolkit/{p-8084c884.entry.js.map → p-5fa008c6.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-6a156238.entry.js → p-6f89da1c.entry.js} +2 -2
- package/dist/dso-toolkit/{p-6a156238.entry.js.map → p-6f89da1c.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-909118a3.entry.js +2 -0
- package/dist/dso-toolkit/p-909118a3.entry.js.map +1 -0
- package/dist/esm/dso-accordion-section.entry.js +3 -3
- package/dist/esm/dso-accordion-section.entry.js.map +1 -1
- package/dist/esm/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.js.map +1 -1
- package/dist/esm/dso-alert_6.entry.js +3 -7
- package/dist/esm/dso-alert_6.entry.js.map +1 -1
- package/dist/esm/dso-onboarding-tip.entry.js +24 -10
- package/dist/esm/dso-onboarding-tip.entry.js.map +1 -1
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/onboarding-tip/onboarding-tip.d.ts +1 -0
- package/dist/types/components/table/table.d.ts +1 -4
- package/dist/types/components.d.ts +0 -8
- package/package.json +3 -3
- package/dist/dso-toolkit/p-c0410277.entry.js +0 -2
- package/dist/dso-toolkit/p-c0410277.entry.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"dso-attachments-counter.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DsoAutosuggest extends Components.DsoAutosuggest, HTMLElement {}
|
|
4
|
+
export const DsoAutosuggest: {
|
|
5
|
+
prototype: DsoAutosuggest;
|
|
6
|
+
new (): DsoAutosuggest;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, e as createEvent, h, F as Fragment } from './p-DHO_Za64.js';
|
|
2
|
+
import { d as debounce } from './p-BxvZeNWe.js';
|
|
3
|
+
import { i as i18n } from './p-B_kXuEcW.js';
|
|
4
|
+
import { d as defineCustomElement$4 } from './p-D2nuXSd0.js';
|
|
5
|
+
import { d as defineCustomElement$3 } from './p-0JGmXD8O.js';
|
|
6
|
+
import { d as defineCustomElement$2 } from './p-DGWbWwct.js';
|
|
7
|
+
import { v as v4 } from './p-BF0_OXTe.js';
|
|
8
|
+
|
|
9
|
+
function escapeStringRegexp(string) {
|
|
10
|
+
if (typeof string !== 'string') {
|
|
11
|
+
throw new TypeError('Expected a string');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Escape characters with special meaning either inside or outside character sets.
|
|
15
|
+
// Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
|
|
16
|
+
return string
|
|
17
|
+
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
|
|
18
|
+
.replace(/-/g, '\\x2d');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const translations = {
|
|
22
|
+
en: {
|
|
23
|
+
"dso-autosuggest": {
|
|
24
|
+
notFound: "{{inputValue}} was not found.",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
nl: {
|
|
28
|
+
"dso-autosuggest": {
|
|
29
|
+
notFound: "{{inputValue}} is niet gevonden.",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const autosuggestCss = ".sc-dso-autosuggest-h{display:block;position:relative}.listbox-container.sc-dso-autosuggest{inset-inline:0;inset-block-start:100%;block-size:auto;max-block-size:var(--_dso-autosuggest-max-block-size);min-block-size:50px;overflow-y:auto;position:absolute;z-index:200}.listbox.sc-dso-autosuggest,.autosuggest-progress-box.sc-dso-autosuggest{background-clip:padding-box;background-color:#fff;border:1px solid rgba(0, 0, 0, 0.15);border-radius:4px;box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);list-style-type:none;margin-block:0}.autosuggest-progress-box.sc-dso-autosuggest{padding-block:12px;padding-inline:8px}.listbox.sc-dso-autosuggest{padding-block:8px;padding-inline:0}.listbox.sc-dso-autosuggest .group.sc-dso-autosuggest:not(:first-child) .group-label.sc-dso-autosuggest{border-block-start:1px solid #b2b2b2;padding-block-start:12px}.listbox.sc-dso-autosuggest .group-label.sc-dso-autosuggest{color:#275937;font-weight:700;padding-block:4px;margin-inline:16px}.listbox.sc-dso-autosuggest .option.sc-dso-autosuggest{padding-block:4px;padding-inline:16px}.listbox.sc-dso-autosuggest .option.sc-dso-autosuggest .suggestion-row.sc-dso-autosuggest{display:flex;justify-content:space-between}.listbox.sc-dso-autosuggest .option.sc-dso-autosuggest:active{background-color:#275937}.listbox.sc-dso-autosuggest .option.sc-dso-autosuggest:active,.listbox.sc-dso-autosuggest .option.sc-dso-autosuggest:active .type.sc-dso-autosuggest,.listbox.sc-dso-autosuggest .option.sc-dso-autosuggest:active .extra.sc-dso-autosuggest{color:#fff}.option[aria-selected=true].sc-dso-autosuggest{cursor:pointer;background-color:#d7e7ce}mark.sc-dso-autosuggest{font-weight:700;background-color:inherit;color:inherit;padding:0}.type.sc-dso-autosuggest,.extra.sc-dso-autosuggest{color:#666}.type.sc-dso-autosuggest{text-align:end}.extra.sc-dso-autosuggest{font-size:14px;line-height:21px}.extra.sc-dso-autosuggest:not(:first-child){text-align:end}";
|
|
35
|
+
|
|
36
|
+
const maxSuggestionsViewable = 10;
|
|
37
|
+
const listboxPaddingBlock = 8;
|
|
38
|
+
const listboxBorderWidth = 1;
|
|
39
|
+
const Option = ({ id, mouseEnter, mouseLeave, click, selected, suggestion, ref, markedSuggestion }) => (h("div", { class: "option", role: "option", id: id, onMouseEnter: mouseEnter, onMouseLeave: mouseLeave, onClick: click, "aria-selected": selected, "aria-label": suggestion.value, ref: ref }, h("div", { class: "suggestion-row" }, h("span", { class: "value" }, markedSuggestion.value), markedSuggestion.type ? h("span", { class: "type" }, markedSuggestion.type) : undefined), markedSuggestion.extras &&
|
|
40
|
+
markedSuggestion.extras.map((markedChunk) => (h("div", { class: "suggestion-row" }, markedChunk.map((extra) => (h("span", { class: "extra" }, extra))))))));
|
|
41
|
+
function isGrouped(suggestions) {
|
|
42
|
+
return (!!suggestions &&
|
|
43
|
+
suggestions.length > 0 &&
|
|
44
|
+
suggestions.every((suggestion) => suggestion !== undefined &&
|
|
45
|
+
"groupLabel" in suggestion &&
|
|
46
|
+
suggestion.groupLabel !== undefined &&
|
|
47
|
+
"suggestions" in suggestion &&
|
|
48
|
+
suggestion.suggestions.length > 0));
|
|
49
|
+
}
|
|
50
|
+
function isFlat(suggestions) {
|
|
51
|
+
return (!!suggestions &&
|
|
52
|
+
suggestions.length > 0 &&
|
|
53
|
+
suggestions.every((suggestion) => suggestion !== undefined && "value" in suggestion && suggestion.value !== undefined));
|
|
54
|
+
}
|
|
55
|
+
const Autosuggest = /*@__PURE__*/ proxyCustomElement(class Autosuggest extends H {
|
|
56
|
+
constructor() {
|
|
57
|
+
super();
|
|
58
|
+
this.__registerHost();
|
|
59
|
+
this.dsoSelect = createEvent(this, "dsoSelect", 7);
|
|
60
|
+
this.dsoChange = createEvent(this, "dsoChange", 7);
|
|
61
|
+
this.dsoSearch = createEvent(this, "dsoSearch", 7);
|
|
62
|
+
/**
|
|
63
|
+
* The suggestions for the value of the slotted input element.
|
|
64
|
+
*
|
|
65
|
+
* This can be an array of type Suggestion or an Array of type SuggestionGroup.
|
|
66
|
+
*
|
|
67
|
+
* A suggestionGroup must have a `groupLabel` and `suggestions`.
|
|
68
|
+
*
|
|
69
|
+
* A suggestion must have a `value` and can have a `type`, an `item` or `extras`.
|
|
70
|
+
*
|
|
71
|
+
* The `type` is used to style the suggestion. `item` can be use to reference the original object that was used to
|
|
72
|
+
* create the suggestion. `extras` is an array of additional strings to further specify the suggestion.
|
|
73
|
+
*
|
|
74
|
+
* The value should be null when no suggestions have been fetched.
|
|
75
|
+
*/
|
|
76
|
+
this.suggestions = null;
|
|
77
|
+
/**
|
|
78
|
+
* Shows progress indicator when fetching results.
|
|
79
|
+
*/
|
|
80
|
+
this.loading = false;
|
|
81
|
+
/**
|
|
82
|
+
* To override progress indicator's default loading label.
|
|
83
|
+
*/
|
|
84
|
+
this.loadingLabel = "Een moment geduld.";
|
|
85
|
+
/**
|
|
86
|
+
* Whether the previous suggestions will be presented when the input gets focus again.
|
|
87
|
+
*/
|
|
88
|
+
this.suggestOnFocus = false;
|
|
89
|
+
this.showSuggestions = false;
|
|
90
|
+
this.notFound = false;
|
|
91
|
+
this.showLoading = false;
|
|
92
|
+
// ListboxItems are used for the calculation of the listboxContainerMaxBlockSize
|
|
93
|
+
this.listboxItems = [];
|
|
94
|
+
this.listboxId = v4();
|
|
95
|
+
this.inputId = v4();
|
|
96
|
+
this.labelId = v4();
|
|
97
|
+
this.resizeObserver = new ResizeObserver(debounce(() => this.setListboxContainerMaxBlockSize(), 150));
|
|
98
|
+
this.debouncedEmitValue = debounce((value) => {
|
|
99
|
+
this.dsoChange.emit(value);
|
|
100
|
+
this.debouncedShowLoading();
|
|
101
|
+
}, 200);
|
|
102
|
+
this.debouncedShowLoading = debounce(() => {
|
|
103
|
+
if (this.inputValue) {
|
|
104
|
+
this.showLoading = true;
|
|
105
|
+
}
|
|
106
|
+
}, this.loadingDelayed);
|
|
107
|
+
this.inputValue = "";
|
|
108
|
+
this.onInput = (event) => {
|
|
109
|
+
if (!(event.target instanceof HTMLInputElement)) {
|
|
110
|
+
return;
|
|
111
|
+
// throw new Error("event.target is not instanceof HTMLInputElement"); #2293
|
|
112
|
+
}
|
|
113
|
+
this.showLoading = !this.loadingDelayed;
|
|
114
|
+
this.inputValue = event.target.value;
|
|
115
|
+
this.debouncedEmitValue(event.target.value.match(/(\S+)/g) ? event.target.value : "");
|
|
116
|
+
};
|
|
117
|
+
this.onFocusIn = () => {
|
|
118
|
+
if (this.suggestOnFocus) {
|
|
119
|
+
this.openSuggestions();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
this.text = i18n(() => this.host, translations);
|
|
123
|
+
this.onWindowResize = debounce(() => this.setListboxContainerMaxBlockSize(), 150);
|
|
124
|
+
this.onScrollend = () => this.setListboxContainerMaxBlockSize();
|
|
125
|
+
this.onKeyDown = (event) => {
|
|
126
|
+
if (event.defaultPrevented || this.loading) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
switch (event.key) {
|
|
130
|
+
case "ArrowDown":
|
|
131
|
+
if (!this.showSuggestions) {
|
|
132
|
+
this.openSuggestions("first");
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
this.selectNextSuggestion();
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
case "ArrowUp":
|
|
139
|
+
if (!this.showSuggestions) {
|
|
140
|
+
this.openSuggestions("last");
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this.selectPreviousSuggestion();
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
case "Tab":
|
|
147
|
+
this.closeSuggestions();
|
|
148
|
+
return;
|
|
149
|
+
case "Escape":
|
|
150
|
+
this.closeSuggestions();
|
|
151
|
+
break;
|
|
152
|
+
case "Enter":
|
|
153
|
+
this.pickSelectedValue();
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
event.preventDefault();
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
suggestionsWatcher() {
|
|
162
|
+
this.resetSelectedSuggestion();
|
|
163
|
+
if ((!this.showSuggestions || !this.notFound) && this.inputValue) {
|
|
164
|
+
this.openSuggestions();
|
|
165
|
+
}
|
|
166
|
+
else if ((this.showSuggestions || this.notFound) && !this.inputValue) {
|
|
167
|
+
this.closeSuggestions();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
onDocumentClick(event) {
|
|
171
|
+
if ((this.showSuggestions || this.notFound) &&
|
|
172
|
+
this.listbox &&
|
|
173
|
+
event.target instanceof Node &&
|
|
174
|
+
!this.listbox.contains(event.target) &&
|
|
175
|
+
this.input !== event.target) {
|
|
176
|
+
this.closeSuggestions();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
componentDidRender() {
|
|
180
|
+
this.setListboxContainerMaxBlockSize();
|
|
181
|
+
}
|
|
182
|
+
connectedCallback() {
|
|
183
|
+
const input = this.host.querySelector('input[type="text"]');
|
|
184
|
+
if (!(input instanceof HTMLInputElement)) {
|
|
185
|
+
return;
|
|
186
|
+
// throw new ReferenceError("Mandatory text input not found"); #2293
|
|
187
|
+
}
|
|
188
|
+
this.input = input;
|
|
189
|
+
if (input.id) {
|
|
190
|
+
this.inputId = input.id;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
input.id = this.inputId;
|
|
194
|
+
}
|
|
195
|
+
if (!this.input.labels || this.input.labels.length < 1) {
|
|
196
|
+
return;
|
|
197
|
+
// throw new ReferenceError("Mandatory label for text input not found"); #2293
|
|
198
|
+
}
|
|
199
|
+
const label = this.input.labels[0];
|
|
200
|
+
if (label === null || label === void 0 ? void 0 : label.id) {
|
|
201
|
+
this.labelId = label.id;
|
|
202
|
+
}
|
|
203
|
+
else if (label) {
|
|
204
|
+
label.id = this.labelId;
|
|
205
|
+
}
|
|
206
|
+
this.input.setAttribute("role", "combobox");
|
|
207
|
+
this.input.setAttribute("aria-haspopup", "listbox");
|
|
208
|
+
this.input.setAttribute("aria-expanded", "false");
|
|
209
|
+
this.input.setAttribute("autocomplete", "off");
|
|
210
|
+
this.input.setAttribute("aria-autocomplete", "list");
|
|
211
|
+
this.input.setAttribute("aria-activedescendant", "");
|
|
212
|
+
this.input.addEventListener("input", this.onInput);
|
|
213
|
+
this.input.addEventListener("keydown", this.onKeyDown);
|
|
214
|
+
this.input.addEventListener("focusin", this.onFocusIn);
|
|
215
|
+
window.addEventListener("resize", this.onWindowResize);
|
|
216
|
+
document.addEventListener("scrollend", this.onScrollend);
|
|
217
|
+
this.resizeObserver.observe(this.host);
|
|
218
|
+
}
|
|
219
|
+
disconnectedCallback() {
|
|
220
|
+
var _a, _b, _c;
|
|
221
|
+
(_a = this.input) === null || _a === void 0 ? void 0 : _a.removeEventListener("input", this.onInput);
|
|
222
|
+
(_b = this.input) === null || _b === void 0 ? void 0 : _b.removeEventListener("keydown", this.onKeyDown);
|
|
223
|
+
(_c = this.input) === null || _c === void 0 ? void 0 : _c.removeEventListener("focusin", this.onFocusIn);
|
|
224
|
+
window.removeEventListener("resize", this.onWindowResize);
|
|
225
|
+
document.removeEventListener("scrollend", this.onScrollend);
|
|
226
|
+
this.resizeObserver.disconnect();
|
|
227
|
+
}
|
|
228
|
+
setListboxContainerMaxBlockSize() {
|
|
229
|
+
var _a;
|
|
230
|
+
if (!this.listboxContainer || !this.showSuggestions) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (this.showSuggestions) {
|
|
234
|
+
let blockSizeViewableListItems = 0;
|
|
235
|
+
let listboxContainerMaxBlockSize = 0;
|
|
236
|
+
// The total number of list items to reserve vertical space for.
|
|
237
|
+
const total = this.listboxItems.length ? Math.min(this.listboxItems.length, maxSuggestionsViewable) : 0;
|
|
238
|
+
for (let i = 0; i < total; i++) {
|
|
239
|
+
blockSizeViewableListItems =
|
|
240
|
+
blockSizeViewableListItems + (((_a = this.listboxItems[i]) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height) || 0);
|
|
241
|
+
}
|
|
242
|
+
const availableBlockSize = window.innerHeight - this.host.getBoundingClientRect().bottom;
|
|
243
|
+
const listboxMaxBlockSize = blockSizeViewableListItems + 2 * listboxPaddingBlock + 2 * listboxBorderWidth;
|
|
244
|
+
if (availableBlockSize < listboxMaxBlockSize || availableBlockSize <= blockSizeViewableListItems) {
|
|
245
|
+
listboxContainerMaxBlockSize = availableBlockSize - 2 * listboxPaddingBlock;
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
listboxContainerMaxBlockSize = listboxMaxBlockSize;
|
|
249
|
+
}
|
|
250
|
+
this.listboxContainer.style.setProperty("--_dso-autosuggest-max-block-size", `${listboxContainerMaxBlockSize}px`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
showInputValueNotFound(text) {
|
|
254
|
+
var _a, _b;
|
|
255
|
+
return this.processAutosuggestMarkItems(this.markTerms((_b = (_a = this.input) === null || _a === void 0 ? void 0 : _a.value.split(" ").filter((t) => t)) !== null && _b !== void 0 ? _b : [], text));
|
|
256
|
+
}
|
|
257
|
+
handleMark(suggestion, text, type, extraIndex) {
|
|
258
|
+
var _a, _b;
|
|
259
|
+
if (this.mark && type) {
|
|
260
|
+
return this.processAutosuggestMarkItems(this.mark(suggestion, text, type, extraIndex));
|
|
261
|
+
}
|
|
262
|
+
return this.processAutosuggestMarkItems(this.markTerms((_b = (_a = this.input) === null || _a === void 0 ? void 0 : _a.value.split(" ").filter((t) => t)) !== null && _b !== void 0 ? _b : [], text));
|
|
263
|
+
}
|
|
264
|
+
markTerms(terms, suggestionValue) {
|
|
265
|
+
if (!suggestionValue || !terms || terms.length === 0 || terms[0] === undefined) {
|
|
266
|
+
return [""];
|
|
267
|
+
}
|
|
268
|
+
const termRegex = new RegExp(`(${escapeStringRegexp(terms[0])})`, "gi");
|
|
269
|
+
return suggestionValue.split(termRegex).reduce((total, valuePart) => {
|
|
270
|
+
if (!valuePart) {
|
|
271
|
+
total.push(valuePart);
|
|
272
|
+
}
|
|
273
|
+
else if (termRegex.test(valuePart)) {
|
|
274
|
+
total.push({ mark: valuePart });
|
|
275
|
+
}
|
|
276
|
+
else if (terms.length === 1) {
|
|
277
|
+
total.push(valuePart);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
total.push(...this.markTerms(terms.slice(1), valuePart));
|
|
281
|
+
}
|
|
282
|
+
return total;
|
|
283
|
+
}, []);
|
|
284
|
+
}
|
|
285
|
+
processAutosuggestMarkItems(items) {
|
|
286
|
+
if (items.length === 0) {
|
|
287
|
+
return [""];
|
|
288
|
+
}
|
|
289
|
+
return items.map((item) => {
|
|
290
|
+
if (typeof item === "object") {
|
|
291
|
+
return h("mark", null, item.mark);
|
|
292
|
+
}
|
|
293
|
+
return item;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
selectSuggestion(suggestion, group) {
|
|
297
|
+
this.selectedSuggestion = suggestion;
|
|
298
|
+
this.selectedSuggestionGroup = group;
|
|
299
|
+
this.setAriaActiveDescendant();
|
|
300
|
+
}
|
|
301
|
+
selectFirstSuggestion() {
|
|
302
|
+
if (!this.suggestions) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
if (isGrouped(this.suggestions) && this.selectedSuggestionGroup) {
|
|
306
|
+
this.selectedSuggestion = this.selectedSuggestionGroup.suggestions[0];
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
if (isFlat(this.suggestions)) {
|
|
310
|
+
this.selectedSuggestion = this.suggestions[0];
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
this.setAriaActiveDescendant(true);
|
|
314
|
+
}
|
|
315
|
+
selectLastSuggestion() {
|
|
316
|
+
if (!this.suggestions) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
if (isGrouped(this.suggestions) && this.selectedSuggestionGroup) {
|
|
320
|
+
this.selectedSuggestion =
|
|
321
|
+
this.selectedSuggestionGroup.suggestions[this.selectedSuggestionGroup.suggestions.length - 1];
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
if (isFlat(this.suggestions)) {
|
|
325
|
+
this.selectedSuggestion = this.suggestions[this.suggestions.length - 1];
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
this.setAriaActiveDescendant(true);
|
|
329
|
+
}
|
|
330
|
+
selectNextSuggestion() {
|
|
331
|
+
var _a;
|
|
332
|
+
if (!this.suggestions) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (isGrouped(this.suggestions)) {
|
|
336
|
+
this.selectNextGroupedSuggestion();
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
const index = this.selectedSuggestion ? this.suggestions.indexOf(this.selectedSuggestion) : -1;
|
|
340
|
+
this.selectedSuggestion = (_a = this.suggestions[index + 1]) !== null && _a !== void 0 ? _a : this.suggestions[0];
|
|
341
|
+
}
|
|
342
|
+
this.setAriaActiveDescendant(true);
|
|
343
|
+
}
|
|
344
|
+
selectNextGroupedSuggestion() {
|
|
345
|
+
var _a;
|
|
346
|
+
if (!this.suggestions) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
if (this.selectedSuggestionGroup) {
|
|
350
|
+
const indexInGroup = this.selectedSuggestion
|
|
351
|
+
? this.selectedSuggestionGroup.suggestions.indexOf(this.selectedSuggestion)
|
|
352
|
+
: -1;
|
|
353
|
+
if (indexInGroup === this.selectedSuggestionGroup.suggestions.length - 1) {
|
|
354
|
+
// Move to first suggestion in next or first group
|
|
355
|
+
const groupIndex = this.suggestionGroups.indexOf(this.selectedSuggestionGroup);
|
|
356
|
+
this.selectedSuggestionGroup = (_a = this.suggestionGroups[groupIndex + 1]) !== null && _a !== void 0 ? _a : this.suggestionGroups[0];
|
|
357
|
+
this.selectedSuggestion = this.selectedSuggestionGroup.suggestions[0];
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
// Within this group
|
|
361
|
+
this.selectedSuggestion = this.selectedSuggestionGroup.suggestions[indexInGroup + 1];
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
this.selectedSuggestionGroup = this.suggestionGroups[0];
|
|
366
|
+
this.selectedSuggestion = this.selectedSuggestionGroup.suggestions[0];
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
selectPreviousSuggestion() {
|
|
370
|
+
var _a;
|
|
371
|
+
if (!this.suggestions) {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
if (isGrouped(this.suggestions)) {
|
|
375
|
+
this.selectPreviousGroupedSuggestion();
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
const index = this.selectedSuggestion ? this.suggestions.indexOf(this.selectedSuggestion) : 0;
|
|
379
|
+
this.selectedSuggestion = (_a = this.suggestions[index - 1]) !== null && _a !== void 0 ? _a : this.suggestions[this.suggestions.length - 1];
|
|
380
|
+
}
|
|
381
|
+
this.setAriaActiveDescendant(true);
|
|
382
|
+
}
|
|
383
|
+
selectPreviousGroupedSuggestion() {
|
|
384
|
+
var _a;
|
|
385
|
+
if (!this.suggestions) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (this.selectedSuggestionGroup) {
|
|
389
|
+
const indexInGroup = this.selectedSuggestion
|
|
390
|
+
? this.selectedSuggestionGroup.suggestions.indexOf(this.selectedSuggestion)
|
|
391
|
+
: -1;
|
|
392
|
+
if (indexInGroup === 0) {
|
|
393
|
+
// Move to last suggestion in previous or last group
|
|
394
|
+
const groupIndex = this.suggestionGroups.indexOf(this.selectedSuggestionGroup);
|
|
395
|
+
this.selectedSuggestionGroup =
|
|
396
|
+
(_a = this.suggestionGroups[groupIndex - 1]) !== null && _a !== void 0 ? _a : this.suggestionGroups[this.suggestions.length - 1];
|
|
397
|
+
this.selectedSuggestion =
|
|
398
|
+
this.selectedSuggestionGroup.suggestions[this.selectedSuggestionGroup.suggestions.length - 1];
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
// Within this group
|
|
402
|
+
this.selectedSuggestion = this.selectedSuggestionGroup.suggestions[indexInGroup - 1];
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
this.selectedSuggestionGroup = this.suggestionGroups[this.suggestions.length - 1];
|
|
407
|
+
this.selectedSuggestion =
|
|
408
|
+
this.selectedSuggestionGroup.suggestions[this.selectedSuggestionGroup.suggestions.length - 1];
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
get suggestionGroups() {
|
|
412
|
+
return isGrouped(this.suggestions) ? this.suggestions : [];
|
|
413
|
+
}
|
|
414
|
+
setAriaActiveDescendant(scroll = false) {
|
|
415
|
+
var _a, _b;
|
|
416
|
+
if (this.selectedSuggestion) {
|
|
417
|
+
const id = this.selectedSuggestionGroup
|
|
418
|
+
? this.listboxGroupedItemId(this.selectedSuggestionGroup, this.selectedSuggestion)
|
|
419
|
+
: this.listboxItemId(this.selectedSuggestion);
|
|
420
|
+
(_a = this.input) === null || _a === void 0 ? void 0 : _a.setAttribute("aria-activedescendant", id);
|
|
421
|
+
if (scroll) {
|
|
422
|
+
(_b = document.getElementById(id)) === null || _b === void 0 ? void 0 : _b.scrollIntoView({ block: "nearest" });
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
resetSelectedSuggestion() {
|
|
427
|
+
var _a;
|
|
428
|
+
this.showLoading = !this.loadingDelayed;
|
|
429
|
+
this.notFound = false;
|
|
430
|
+
this.selectedSuggestion = undefined;
|
|
431
|
+
this.selectedSuggestionGroup = undefined;
|
|
432
|
+
(_a = this.input) === null || _a === void 0 ? void 0 : _a.setAttribute("aria-activedescendant", "");
|
|
433
|
+
}
|
|
434
|
+
openSuggestions(selectSuggestion) {
|
|
435
|
+
var _a, _b, _c, _d;
|
|
436
|
+
this.showSuggestions = (_a = (this.suggestions && this.suggestions.length > 0)) !== null && _a !== void 0 ? _a : false;
|
|
437
|
+
this.notFound = (_c = (this.suggestions && ((_b = this.suggestions) === null || _b === void 0 ? void 0 : _b.length) === 0)) !== null && _c !== void 0 ? _c : false;
|
|
438
|
+
(_d = this.input) === null || _d === void 0 ? void 0 : _d.setAttribute("aria-expanded", (this.showSuggestions || this.notFound).toString());
|
|
439
|
+
if (this.showSuggestions && selectSuggestion === "first") {
|
|
440
|
+
this.selectFirstSuggestion();
|
|
441
|
+
}
|
|
442
|
+
else if (this.showSuggestions && selectSuggestion === "last") {
|
|
443
|
+
this.selectLastSuggestion();
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
closeSuggestions() {
|
|
447
|
+
var _a;
|
|
448
|
+
this.showSuggestions = false;
|
|
449
|
+
this.notFound = false;
|
|
450
|
+
(_a = this.input) === null || _a === void 0 ? void 0 : _a.setAttribute("aria-expanded", "false");
|
|
451
|
+
this.selectFirstSuggestion();
|
|
452
|
+
}
|
|
453
|
+
pickSelectedValue() {
|
|
454
|
+
var _a;
|
|
455
|
+
if (this.selectedSuggestion && this.showSuggestions) {
|
|
456
|
+
this.dsoSelect.emit(this.selectedSuggestion);
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
this.dsoSearch.emit((_a = this.input) === null || _a === void 0 ? void 0 : _a.value);
|
|
460
|
+
}
|
|
461
|
+
this.closeSuggestions();
|
|
462
|
+
}
|
|
463
|
+
listboxItemId(suggestion) {
|
|
464
|
+
if (!this.suggestions) {
|
|
465
|
+
return "";
|
|
466
|
+
}
|
|
467
|
+
return `${this.inputId}-${isFlat(this.suggestions) && this.suggestions.indexOf(suggestion) + 1}`;
|
|
468
|
+
}
|
|
469
|
+
listboxGroupedItemId(suggestionGroup, suggestion) {
|
|
470
|
+
if (!this.suggestions) {
|
|
471
|
+
return "";
|
|
472
|
+
}
|
|
473
|
+
return `${this.inputId}-${this.suggestionGroups.indexOf(suggestionGroup) + 1}-${suggestionGroup.suggestions.indexOf(suggestion) + 1}`;
|
|
474
|
+
}
|
|
475
|
+
getMarkedChunkedExtras(extras, suggestion) {
|
|
476
|
+
const chunkedExtras = extras.reduce((resultArray, extra, index) => {
|
|
477
|
+
var _a;
|
|
478
|
+
const chunkIndex = Math.floor(index / 2);
|
|
479
|
+
if (!resultArray[chunkIndex]) {
|
|
480
|
+
resultArray[chunkIndex] = [];
|
|
481
|
+
}
|
|
482
|
+
(_a = resultArray[chunkIndex]) === null || _a === void 0 ? void 0 : _a.push(extra);
|
|
483
|
+
return resultArray;
|
|
484
|
+
}, []);
|
|
485
|
+
return chunkedExtras.map((chunk, index) => chunk.map((c, i) => this.handleMark(suggestion, c, "extra", index * 2 + i)));
|
|
486
|
+
}
|
|
487
|
+
getMarkedSuggestions(suggestion) {
|
|
488
|
+
return {
|
|
489
|
+
value: this.handleMark(suggestion, suggestion.value, "value"),
|
|
490
|
+
type: suggestion.type ? this.handleMark(suggestion, suggestion.type, "type") : undefined,
|
|
491
|
+
extras: suggestion.extras ? this.getMarkedChunkedExtras(suggestion.extras, suggestion) : undefined,
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
getAutosuggestStatus() {
|
|
495
|
+
if (this.notFound) {
|
|
496
|
+
return `"${this.inputValue}" is niet gevonden.`;
|
|
497
|
+
}
|
|
498
|
+
let totalSuggestions = 0;
|
|
499
|
+
if (isFlat(this.suggestions)) {
|
|
500
|
+
totalSuggestions = this.suggestions.length;
|
|
501
|
+
}
|
|
502
|
+
else if (isGrouped(this.suggestions)) {
|
|
503
|
+
totalSuggestions = this.suggestions.reduce((count, group) => count + group.suggestions.length, 0);
|
|
504
|
+
}
|
|
505
|
+
return `${totalSuggestions} resultaten gevonden.`;
|
|
506
|
+
}
|
|
507
|
+
render() {
|
|
508
|
+
this.listboxItems = [];
|
|
509
|
+
const showListbox = this.showSuggestions || this.notFound;
|
|
510
|
+
const grouped = isGrouped(this.suggestions);
|
|
511
|
+
const flat = isFlat(this.suggestions);
|
|
512
|
+
if (showListbox && this.input) {
|
|
513
|
+
this.input.setAttribute("aria-controls", this.listboxId);
|
|
514
|
+
}
|
|
515
|
+
else if (this.input) {
|
|
516
|
+
this.input.removeAttribute("aria-controls");
|
|
517
|
+
}
|
|
518
|
+
return (h(Fragment, null, h("slot", { key: '75db3245d7e2a85722c0a408bfa8c2d117000a4a' }), this.loading && this.showLoading ? (h("div", { class: "autosuggest-progress-box" }, h("dso-progress-indicator", { label: this.loadingLabel }))) : (showListbox && (h(Fragment, null, h("dso-scrollable", { class: "listbox-container", ref: (element) => (this.listboxContainer = element) }, h("div", { class: "listbox", role: "listbox", id: this.listboxId, "aria-labelledby": this.labelId, ref: (element) => (this.listbox = element), tabindex: "0" }, (flat &&
|
|
519
|
+
this.showSuggestions &&
|
|
520
|
+
this.suggestions &&
|
|
521
|
+
this.suggestions.map((suggestion) => (h(Option, { id: this.listboxItemId(suggestion), mouseEnter: () => this.selectSuggestion(suggestion), mouseLeave: () => this.resetSelectedSuggestion(), click: () => this.pickSelectedValue(), selected: (suggestion === this.selectedSuggestion).toString(), suggestion: suggestion, ref: (element) => element && this.listboxItems.push(element), markedSuggestion: this.getMarkedSuggestions(suggestion) })))) ||
|
|
522
|
+
(grouped &&
|
|
523
|
+
this.showSuggestions &&
|
|
524
|
+
this.suggestions &&
|
|
525
|
+
this.suggestions.map((suggestionGroup) => {
|
|
526
|
+
const groupLabelId = v4();
|
|
527
|
+
return (h("div", { role: "group", class: "group", "aria-labelledby": groupLabelId }, h("div", { class: "group-label", role: "presentation", id: groupLabelId, ref: (element) => element && this.listboxItems.push(element) }, suggestionGroup.groupLabel), suggestionGroup.suggestions.map((suggestion) => (h(Option, { id: this.listboxGroupedItemId(suggestionGroup, suggestion), mouseEnter: () => this.selectSuggestion(suggestion, suggestionGroup), mouseLeave: () => this.resetSelectedSuggestion(), click: () => this.pickSelectedValue(), selected: (suggestion === this.selectedSuggestion).toString(), suggestion: suggestion, ref: (element) => element && this.listboxItems.push(element), markedSuggestion: this.getMarkedSuggestions(suggestion) })))));
|
|
528
|
+
})) ||
|
|
529
|
+
(this.notFound && (h("div", { class: "option" }, h("span", { class: "value" }, this.notFoundLabel ||
|
|
530
|
+
this.showInputValueNotFound(this.text("notFound", { inputValue: this.inputValue })))))))), h("div", { class: "sr-only", "aria-live": "polite", "aria-atomic": "true" }, this.getAutosuggestStatus()))))));
|
|
531
|
+
}
|
|
532
|
+
get host() { return this; }
|
|
533
|
+
static get watchers() { return {
|
|
534
|
+
"suggestions": ["suggestionsWatcher"]
|
|
535
|
+
}; }
|
|
536
|
+
static get style() { return autosuggestCss; }
|
|
537
|
+
}, [6, "dso-autosuggest", {
|
|
538
|
+
"suggestions": [16],
|
|
539
|
+
"loading": [4],
|
|
540
|
+
"loadingLabel": [1, "loading-label"],
|
|
541
|
+
"loadingDelayed": [2, "loading-delayed"],
|
|
542
|
+
"notFoundLabel": [1, "not-found-label"],
|
|
543
|
+
"suggestOnFocus": [4, "suggest-on-focus"],
|
|
544
|
+
"mark": [16],
|
|
545
|
+
"showSuggestions": [32],
|
|
546
|
+
"selectedSuggestion": [32],
|
|
547
|
+
"selectedSuggestionGroup": [32],
|
|
548
|
+
"notFound": [32],
|
|
549
|
+
"showLoading": [32]
|
|
550
|
+
}, [[4, "click", "onDocumentClick"]], {
|
|
551
|
+
"suggestions": ["suggestionsWatcher"]
|
|
552
|
+
}]);
|
|
553
|
+
function defineCustomElement$1() {
|
|
554
|
+
if (typeof customElements === "undefined") {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
const components = ["dso-autosuggest", "dso-icon", "dso-progress-indicator", "dso-scrollable"];
|
|
558
|
+
components.forEach(tagName => { switch (tagName) {
|
|
559
|
+
case "dso-autosuggest":
|
|
560
|
+
if (!customElements.get(tagName)) {
|
|
561
|
+
customElements.define(tagName, Autosuggest);
|
|
562
|
+
}
|
|
563
|
+
break;
|
|
564
|
+
case "dso-icon":
|
|
565
|
+
if (!customElements.get(tagName)) {
|
|
566
|
+
defineCustomElement$4();
|
|
567
|
+
}
|
|
568
|
+
break;
|
|
569
|
+
case "dso-progress-indicator":
|
|
570
|
+
if (!customElements.get(tagName)) {
|
|
571
|
+
defineCustomElement$3();
|
|
572
|
+
}
|
|
573
|
+
break;
|
|
574
|
+
case "dso-scrollable":
|
|
575
|
+
if (!customElements.get(tagName)) {
|
|
576
|
+
defineCustomElement$2();
|
|
577
|
+
}
|
|
578
|
+
break;
|
|
579
|
+
} });
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
const DsoAutosuggest = Autosuggest;
|
|
583
|
+
const defineCustomElement = defineCustomElement$1;
|
|
584
|
+
|
|
585
|
+
export { DsoAutosuggest, defineCustomElement };
|
|
586
|
+
//# sourceMappingURL=dso-autosuggest.js.map
|
|
587
|
+
|
|
588
|
+
//# sourceMappingURL=dso-autosuggest.js.map
|