@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,237 @@
|
|
|
1
|
+
import { h, F as Fragment, p as proxyCustomElement, H, e as createEvent } from './p-DHO_Za64.js';
|
|
2
|
+
import { c as clsx } from './p-ChV9xqsO.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './p-D2nuXSd0.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './p-0JGmXD8O.js';
|
|
5
|
+
|
|
6
|
+
const DsoTreeItem = ({ owner, ancestors, item, index, level, setSize, }) => {
|
|
7
|
+
var _a, _b, _c, _d;
|
|
8
|
+
return (h("li", { key: item.id, class: clsx("tree-item", { "has-child": item.hasItems, "is-expanded": !!item.open && !!((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) }), role: "none" },
|
|
9
|
+
h("div", { class: "tree-branch-control" }, item.hasItems ? (h("div", { onClick: (e) => owner.itemClick(e, ancestors, item) },
|
|
10
|
+
h("dso-icon", { icon: item.open ? "minus-square" : "plus-square" }))) : (h("dso-icon", null))),
|
|
11
|
+
h("p", { class: clsx("tree-content", { active: item.active }, { selected: item.selected }), tabindex: level === 1 && index === 0 ? 0 : -1, role: "treeitem", "aria-expanded": item.hasItems ? "" + (!!item.open && !!((_b = item.items) === null || _b === void 0 ? void 0 : _b.length)) : undefined, "aria-current": item.active ? "true" : undefined, "aria-level": level, "aria-setsize": setSize, "aria-posinset": index + 1, "aria-busy": item.loading ? "true" : undefined, "data-item-id": item.id, onClick: (e) => owner.itemClick(e, ancestors, item) },
|
|
12
|
+
item.selected && h("span", { class: "sr-only" }, "Resultaat: "),
|
|
13
|
+
item.href ? (h("a", { href: item.href, tabindex: "-1" }, item.label)) : (h("span", null, item.label)), (_c = item.icons) === null || _c === void 0 ? void 0 :
|
|
14
|
+
_c.map((icon) => h("dso-icon", { icon: icon.icon, title: icon.label }))),
|
|
15
|
+
item.open && (h(Fragment, null, item.hasItems && !item.items && item.loading ? (h("dso-progress-indicator", { size: "small", label: "Resultaten laden: een moment geduld alstublieft." })) : (h("ul", { role: "group" }, (_d = item.items) === null || _d === void 0 ? void 0 : _d.map((childItem, childIndex, org) => (h(DsoTreeItem, { owner: owner, ancestors: [...ancestors, item], item: childItem, index: childIndex, level: level + 1, setSize: org.length })))))))));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const treeViewCss = ":host ul{list-style-type:none;padding-inline-start:32px;position:relative}:host li{position:relative}:host ul[role=tree]{padding-inline-start:0}:host ul[role=group]::before{border-inline-start:1px solid #275937;content:\"\";block-size:8px;inset-inline-start:44px;position:absolute;inset-block-start:0;inline-size:0}:host li:not(.has-child)::before{border-block-start:1px solid #275937;content:\"\";block-size:0;inset-inline-start:12px;position:absolute;inset-block-start:20px;inline-size:16px}:host li:not(.has-child)::after{border-inline-start:1px solid #275937;content:\"\";block-size:100%;inset-inline-start:12px;position:absolute;inset-block-start:8px;inline-size:0}:host li:not(.has-child):last-child::after{block-size:20px;inset-block-start:0}:host li.has-child::before{border-block-start:1px solid #275937;content:\"\";block-size:0;inset-inline-start:24px;position:absolute;inset-block-start:20px;inline-size:4px}:host li.has-child:not(:last-child)::after{border-inline-start:1px solid #275937;content:\"\";block-size:calc(100% - 24px);inset-inline-start:12px;position:absolute;inset-block-start:32px;inline-size:0}:host li.has-child.is-expanded:last-child::after{border-inline-start:1px solid #275937;content:\"\";block-size:calc(100% - 32px);inset-inline-start:12px;position:absolute;inset-block-start:32px;inline-size:0}:host .tree-branch-control{color:#39870c;display:inline-block;font-size:16px;margin-block:8px;margin-inline:0 8px;vertical-align:top}:host .tree-branch-control>div{cursor:pointer}:host .tree-content{cursor:pointer;display:inline-block;margin-block:8px;margin-inline:0;max-inline-size:calc(100% - 40px)}:host .tree-content a{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.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.active{color:#8b4a6a;font-style:italic;font-weight:700;text-decoration:underline}:host .tree-content.active:hover,:host .tree-content.active:focus{text-decoration:none}:host .tree-content.active a{color:#8b4a6a}:host .tree-content.active a:hover,:host .tree-content.active a:focus{text-decoration:none}:host .tree-content dso-icon{color:#39870c;font-size:0.75em;margin-inline-start:0.5em;vertical-align:text-bottom}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
19
|
+
|
|
20
|
+
const TreeView = /*@__PURE__*/ proxyCustomElement(class TreeView extends H {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.__registerHost();
|
|
24
|
+
this.__attachShadow();
|
|
25
|
+
this.dsoOpenItem = createEvent(this, "dsoOpenItem", 7);
|
|
26
|
+
this.dsoCloseItem = createEvent(this, "dsoCloseItem", 7);
|
|
27
|
+
this.dsoClickItem = createEvent(this, "dsoClickItem", 7);
|
|
28
|
+
this.keyDownListener = (event) => {
|
|
29
|
+
if (event.defaultPrevented) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const isIndexLetter = (str) => str.length === 1 && str.match(/\S/);
|
|
33
|
+
const tree = event
|
|
34
|
+
.composedPath()
|
|
35
|
+
.find((item) => (item instanceof H ? item.className === "dso-tree" : false));
|
|
36
|
+
if (!(event.target instanceof HTMLParagraphElement) || !(tree instanceof H)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
switch (event.key) {
|
|
40
|
+
case "ArrowDown":
|
|
41
|
+
TreeView.moveFocus(tree, event.target, "next");
|
|
42
|
+
break;
|
|
43
|
+
case "ArrowUp":
|
|
44
|
+
TreeView.moveFocus(tree, event.target, "previous");
|
|
45
|
+
break;
|
|
46
|
+
case "ArrowRight":
|
|
47
|
+
TreeView.expandItemOrFocusChild(tree, event.target);
|
|
48
|
+
break;
|
|
49
|
+
case "ArrowLeft":
|
|
50
|
+
TreeView.collapseItemOrFocusParent(tree, event.target);
|
|
51
|
+
break;
|
|
52
|
+
case "End":
|
|
53
|
+
TreeView.moveFocus(tree, event.target, "last");
|
|
54
|
+
break;
|
|
55
|
+
case "Home":
|
|
56
|
+
TreeView.moveFocus(tree, event.target, "first");
|
|
57
|
+
break;
|
|
58
|
+
case "Enter":
|
|
59
|
+
case " ":
|
|
60
|
+
event.target.click();
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
if (isIndexLetter(event.key)) {
|
|
64
|
+
if (TreeView.setFocusByFirstCharacter(tree, event.target, event.key, event.shiftKey)) {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
};
|
|
72
|
+
// eslint-disable-next-line @stencil-community/own-props-must-be-private -- Omdat this als TreeView instance aan Functionele Components wordt gegeven
|
|
73
|
+
this.itemClick = (event, ancestors, item) => {
|
|
74
|
+
if (!(event.target instanceof H)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const contentElement = event.target.closest(".tree-content");
|
|
78
|
+
if (contentElement) {
|
|
79
|
+
const tree = event
|
|
80
|
+
.composedPath()
|
|
81
|
+
.find((eventTarget) => (eventTarget instanceof H ? eventTarget.className === "dso-tree" : false));
|
|
82
|
+
if (!(contentElement instanceof HTMLParagraphElement) || !(tree instanceof H)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
TreeView.setFocus(tree, contentElement);
|
|
86
|
+
this.dsoClickItem.emit({ path: [...ancestors, item], originalEvent: event });
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (item.open) {
|
|
90
|
+
this.dsoCloseItem.emit([...ancestors, item]);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
this.dsoOpenItem.emit([...ancestors, item]);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Set focus on the last item in the specified path.
|
|
99
|
+
* The consumer is responsible for providing a TreeView collection where the last item is visible.
|
|
100
|
+
* @async
|
|
101
|
+
* @returns Whether the item was found.
|
|
102
|
+
*/
|
|
103
|
+
async focusItem(path) {
|
|
104
|
+
var _a;
|
|
105
|
+
const tree = this.tree;
|
|
106
|
+
if (!tree || path.length === 0) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
const itemToFocus = path[path.length - 1];
|
|
110
|
+
if (!itemToFocus) {
|
|
111
|
+
throw new Error("No itemToFocus found");
|
|
112
|
+
}
|
|
113
|
+
const elementToFocus = Array.from((_a = tree.querySelectorAll("p")) !== null && _a !== void 0 ? _a : [])
|
|
114
|
+
.filter((item) => item.offsetWidth > 0 && item.offsetHeight > 0)
|
|
115
|
+
.find((item) => item.dataset["itemId"] === itemToFocus.id);
|
|
116
|
+
if (!elementToFocus) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
TreeView.setFocus(tree, elementToFocus);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
static setFocus(tree, target) {
|
|
123
|
+
if (target) {
|
|
124
|
+
Array.from(tree.querySelectorAll("p"))
|
|
125
|
+
.filter((item) => item.tabIndex === 0)
|
|
126
|
+
.forEach((item) => (item.tabIndex = -1));
|
|
127
|
+
target.tabIndex = 0;
|
|
128
|
+
target.focus();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
static moveFocus(tree, el, moveTo) {
|
|
132
|
+
const focusableItems = Array.from(tree.querySelectorAll("p")).filter((item) => item.offsetWidth > 0 && item.offsetHeight > 0);
|
|
133
|
+
let index = 0;
|
|
134
|
+
switch (moveTo) {
|
|
135
|
+
case "first":
|
|
136
|
+
index = 0;
|
|
137
|
+
break;
|
|
138
|
+
case "previous":
|
|
139
|
+
index = focusableItems.indexOf(el) - 1;
|
|
140
|
+
break;
|
|
141
|
+
case "next":
|
|
142
|
+
index = focusableItems.indexOf(el) + 1;
|
|
143
|
+
break;
|
|
144
|
+
case "last":
|
|
145
|
+
index = focusableItems.length - 1;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
const focusableItem = focusableItems[index];
|
|
149
|
+
if (!focusableItem) {
|
|
150
|
+
throw new Error("No focusableItem found");
|
|
151
|
+
}
|
|
152
|
+
TreeView.setFocus(tree, focusableItem);
|
|
153
|
+
}
|
|
154
|
+
static expandItemOrFocusChild(tree, target) {
|
|
155
|
+
var _a;
|
|
156
|
+
if ((target === null || target === void 0 ? void 0 : target.getAttribute("aria-expanded")) === "true") {
|
|
157
|
+
TreeView.moveFocus(tree, target, "next");
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
const controlElement = (_a = target.previousElementSibling) === null || _a === void 0 ? void 0 : _a.firstElementChild;
|
|
161
|
+
if (controlElement instanceof H) {
|
|
162
|
+
controlElement.click();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
static collapseItemOrFocusParent(tree, target) {
|
|
167
|
+
var _a, _b, _c;
|
|
168
|
+
if ((target === null || target === void 0 ? void 0 : target.getAttribute("aria-expanded")) === "true") {
|
|
169
|
+
const controlElement = (_a = target.previousElementSibling) === null || _a === void 0 ? void 0 : _a.firstElementChild;
|
|
170
|
+
if (controlElement instanceof H) {
|
|
171
|
+
controlElement.click();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
const parentTarget = (_c = (_b = target === null || target === void 0 ? void 0 : target.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.previousElementSibling;
|
|
176
|
+
if (parentTarget instanceof H) {
|
|
177
|
+
TreeView.setFocus(tree, parentTarget);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
static setFocusByFirstCharacter(tree, el, char, backwards) {
|
|
182
|
+
const focusableItems = Array.from(tree.querySelectorAll("p")).filter((item) => item.offsetWidth > 0 && item.offsetHeight > 0);
|
|
183
|
+
if (backwards) {
|
|
184
|
+
focusableItems.reverse();
|
|
185
|
+
}
|
|
186
|
+
const current = focusableItems.indexOf(el);
|
|
187
|
+
char = char.toLowerCase();
|
|
188
|
+
let nextItem = focusableItems.find((item, index) => { var _a; return index > current && ((_a = item.textContent) === null || _a === void 0 ? void 0 : _a.toLowerCase().startsWith(char)); });
|
|
189
|
+
if (!nextItem) {
|
|
190
|
+
nextItem = focusableItems.find((item, index) => { var _a; return index < current && ((_a = item.textContent) === null || _a === void 0 ? void 0 : _a.toLowerCase().startsWith(char)); });
|
|
191
|
+
}
|
|
192
|
+
if (nextItem) {
|
|
193
|
+
TreeView.setFocus(tree, nextItem);
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
render() {
|
|
199
|
+
var _a;
|
|
200
|
+
return (h("div", { key: '7db23c7d7736a1b2f4f18c6240db2dcb72d965a2', id: "tree", class: "dso-tree", onKeyDown: (e) => this.keyDownListener(e), ref: (element) => (this.tree = element) }, h("ul", { key: 'dc8acc481f22aaced2657634b24a0e054194a33f', role: "tree", "aria-label": "Objectenboom" }, (_a = this.collection) === null || _a === void 0 ? void 0 : _a.map((item, index) => (h(DsoTreeItem, { owner: this, ancestors: [], item: item, index: index, level: 1, setSize: this.collection.length }))))));
|
|
201
|
+
}
|
|
202
|
+
static get style() { return treeViewCss; }
|
|
203
|
+
}, [1, "dso-tree-view", {
|
|
204
|
+
"collection": [16],
|
|
205
|
+
"focusItem": [64]
|
|
206
|
+
}]);
|
|
207
|
+
function defineCustomElement$1() {
|
|
208
|
+
if (typeof customElements === "undefined") {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const components = ["dso-tree-view", "dso-icon", "dso-progress-indicator"];
|
|
212
|
+
components.forEach(tagName => { switch (tagName) {
|
|
213
|
+
case "dso-tree-view":
|
|
214
|
+
if (!customElements.get(tagName)) {
|
|
215
|
+
customElements.define(tagName, TreeView);
|
|
216
|
+
}
|
|
217
|
+
break;
|
|
218
|
+
case "dso-icon":
|
|
219
|
+
if (!customElements.get(tagName)) {
|
|
220
|
+
defineCustomElement$3();
|
|
221
|
+
}
|
|
222
|
+
break;
|
|
223
|
+
case "dso-progress-indicator":
|
|
224
|
+
if (!customElements.get(tagName)) {
|
|
225
|
+
defineCustomElement$2();
|
|
226
|
+
}
|
|
227
|
+
break;
|
|
228
|
+
} });
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const DsoTreeView = TreeView;
|
|
232
|
+
const defineCustomElement = defineCustomElement$1;
|
|
233
|
+
|
|
234
|
+
export { DsoTreeView, defineCustomElement };
|
|
235
|
+
//# sourceMappingURL=dso-tree-view.js.map
|
|
236
|
+
|
|
237
|
+
//# sourceMappingURL=dso-tree-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"dso-tree-view.js","mappings":";;;;;AAeO,MAAM,WAAW,GAA2C,CAAC,EAClE,KAAK,EACL,SAAS,EACT,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,GACR,KAAI;;IAAC,QACJ,UACE,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,EAAC,CAAA,EAAA,GAAA,IAAI,CAAC,KAAK,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,CAAA,EAAE,CAAC,EAC5G,IAAI,EAAC,MAAM,EAAA;AAEX,QAAA,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,qBAAqB,EAAA,EAC7B,IAAI,CAAC,QAAQ,IACZ,CAAA,CAAA,KAAA,EAAA,EAAK,OAAO,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAA;YACtD,CAAU,CAAA,UAAA,EAAA,EAAA,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,cAAc,GAAG,aAAa,EAAA,CAAa,CACnE,KAEN,CAAqB,CAAA,UAAA,EAAA,IAAA,CAAA,CACtB,CACG;AACN,QAAA,CAAA,CAAA,GAAA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E,KAAK,MAChC,CAAA,CAAC,WAAW,EAAA,EACV,KAAK,EAAE,IAAI,EACX,SAAS,EAAE,EAAE,EACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,EAClB,CAAA,CAChB,CAAC,CACC,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/tree-view/tree-item.tsx","src/components/tree-view/tree-view.scss?tag=dso-tree-view&encapsulation=shadow","src/components/tree-view/tree-view.tsx"],"sourcesContent":["import { Fragment, FunctionalComponent, h } from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\n\r\nimport { TreeView } from \"./tree-view\";\r\nimport { TreeViewItem, TreeViewItemIcon } from \"./tree-view.interfaces\";\r\n\r\ninterface TreeViewItemProps {\r\n owner: TreeView;\r\n ancestors: TreeViewItem[];\r\n item: TreeViewItem;\r\n index: number;\r\n level: number;\r\n setSize: number;\r\n}\r\n\r\nexport const DsoTreeItem: FunctionalComponent<TreeViewItemProps> = ({\r\n owner,\r\n ancestors,\r\n item,\r\n index,\r\n level,\r\n setSize,\r\n}) => (\r\n <li\r\n key={item.id}\r\n class={clsx(\"tree-item\", { \"has-child\": item.hasItems, \"is-expanded\": !!item.open && !!item.items?.length })}\r\n role=\"none\"\r\n >\r\n <div class=\"tree-branch-control\">\r\n {item.hasItems ? (\r\n <div onClick={(e) => owner.itemClick(e, ancestors, item)}>\r\n <dso-icon icon={item.open ? \"minus-square\" : \"plus-square\"}></dso-icon>\r\n </div>\r\n ) : (\r\n <dso-icon></dso-icon>\r\n )}\r\n </div>\r\n <p\r\n class={clsx(\"tree-content\", { active: item.active }, { selected: item.selected })}\r\n tabindex={level === 1 && index === 0 ? 0 : -1}\r\n role=\"treeitem\"\r\n aria-expanded={item.hasItems ? \"\" + (!!item.open && !!item.items?.length) : undefined}\r\n aria-current={item.active ? \"true\" : undefined}\r\n aria-level={level}\r\n aria-setsize={setSize}\r\n aria-posinset={index + 1}\r\n aria-busy={item.loading ? \"true\" : undefined}\r\n data-item-id={item.id}\r\n onClick={(e) => owner.itemClick(e, ancestors, item)}\r\n >\r\n {item.selected && <span class=\"sr-only\">Resultaat: </span>}\r\n {item.href ? (\r\n <a href={item.href} tabindex=\"-1\">\r\n {item.label}\r\n </a>\r\n ) : (\r\n <span>{item.label}</span>\r\n )}\r\n {item.icons?.map((icon: TreeViewItemIcon) => <dso-icon icon={icon.icon} title={icon.label}></dso-icon>)}\r\n </p>\r\n {item.open && (\r\n <>\r\n {item.hasItems && !item.items && item.loading ? (\r\n <dso-progress-indicator size=\"small\" label=\"Resultaten laden: een moment geduld alstublieft.\" />\r\n ) : (\r\n <ul role=\"group\">\r\n {item.items?.map((childItem: TreeViewItem, childIndex: number, org: TreeViewItem[]) => (\r\n <DsoTreeItem\r\n owner={owner}\r\n ancestors={[...ancestors, item]}\r\n item={childItem}\r\n index={childIndex}\r\n level={level + 1}\r\n setSize={org.length}\r\n ></DsoTreeItem>\r\n ))}\r\n </ul>\r\n )}\r\n </>\r\n )}\r\n </li>\r\n);\r\n","@use \"sass:math\";\r\n\r\n@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n@use \"~dso-toolkit/src/variables/scaffolding\";\r\n\r\n@use \"tree-view.mixins\" as core-tree-view-mixins;\r\n@use \"tree-view.variables\" as core-tree-view-variables;\r\n\r\n:host {\r\n ul {\r\n list-style-type: none;\r\n padding-inline-start: core-tree-view-variables.$indent;\r\n position: relative;\r\n }\r\n\r\n li {\r\n position: relative;\r\n }\r\n\r\n ul[role=\"tree\"] {\r\n padding-inline-start: 0;\r\n }\r\n\r\n // connects branch or leaf to parent\r\n ul[role=\"group\"]::before {\r\n @include core-tree-view-mixins.vertical-line(\r\n core-tree-view-variables.$indent + core-tree-view-variables.$hcenter,\r\n 0,\r\n core-tree-view-variables.$vspace\r\n );\r\n }\r\n\r\n li:not(.has-child) {\r\n // horizontal connector for a leaf\r\n &::before {\r\n @include core-tree-view-mixins.horizontal-line(\r\n core-tree-view-variables.$hcenter,\r\n core-tree-view-variables.$vcenter,\r\n core-tree-view-variables.$hspace + 0.5 * core-tree-view-variables.$icon-size - 4px\r\n );\r\n }\r\n\r\n // vertical connector for a leaf\r\n &::after {\r\n @include core-tree-view-mixins.vertical-line(\r\n core-tree-view-variables.$hcenter,\r\n core-tree-view-variables.$vspace,\r\n 100%\r\n );\r\n }\r\n\r\n // vertical connector for the last leaf\r\n &:last-child::after {\r\n block-size: core-tree-view-variables.$vcenter;\r\n inset-block-start: 0;\r\n }\r\n }\r\n\r\n li.has-child {\r\n // horizontal connector for a branch\r\n &::before {\r\n @include core-tree-view-mixins.horizontal-line(\r\n core-tree-view-variables.$icon-size,\r\n core-tree-view-variables.$vcenter,\r\n core-tree-view-variables.$hspace - 4px\r\n );\r\n }\r\n\r\n // vertical connector for a branch (not last)\r\n &:not(:last-child)::after {\r\n @include core-tree-view-mixins.vertical-line(\r\n core-tree-view-variables.$hcenter,\r\n core-tree-view-variables.$vcenter + 0.5 * core-tree-view-variables.$icon-size,\r\n calc(100% - core-tree-view-variables.$icon-size)\r\n );\r\n }\r\n\r\n // vertical line after a expanded branch (creating dead ends)\r\n &.is-expanded:last-child::after {\r\n @include core-tree-view-mixins.vertical-line(\r\n core-tree-view-variables.$hcenter,\r\n core-tree-view-variables.$vcenter + 0.5 * core-tree-view-variables.$icon-size,\r\n calc(100% - (core-tree-view-variables.$vcenter + 0.5 * core-tree-view-variables.$icon-size))\r\n );\r\n }\r\n }\r\n\r\n .tree-branch-control {\r\n color: colors.$grasgroen;\r\n display: inline-block;\r\n font-size: math.div(2 * core-tree-view-variables.$icon-size, 3);\r\n margin-block: core-tree-view-variables.$vspace;\r\n margin-inline: 0 core-tree-view-variables.$hspace;\r\n vertical-align: top;\r\n\r\n > div {\r\n cursor: pointer;\r\n }\r\n }\r\n\r\n .tree-content {\r\n cursor: pointer;\r\n display: inline-block;\r\n margin-block: core-tree-view-variables.$vspace;\r\n margin-inline: 0;\r\n max-inline-size: calc(100% - (core-tree-view-variables.$indent + core-tree-view-variables.$hspace));\r\n\r\n a {\r\n color: scaffolding.$text-color;\r\n text-decoration: underline;\r\n\r\n &:hover,\r\n &:focus {\r\n color: scaffolding.$text-color;\r\n text-decoration: none;\r\n }\r\n\r\n &:active {\r\n text-decoration: none;\r\n }\r\n }\r\n\r\n &.selected {\r\n color: scaffolding.$text-color;\r\n font-weight: 700;\r\n text-decoration: underline;\r\n\r\n &:hover,\r\n &:focus {\r\n text-decoration: none;\r\n }\r\n }\r\n\r\n &.active {\r\n color: colors.$mauve;\r\n font-style: italic;\r\n font-weight: 700;\r\n\r\n text-decoration: underline;\r\n\r\n &:hover,\r\n &:focus {\r\n text-decoration: none;\r\n }\r\n\r\n a {\r\n color: colors.$mauve;\r\n\r\n &:hover,\r\n &:focus {\r\n text-decoration: none;\r\n }\r\n }\r\n }\r\n\r\n dso-icon {\r\n color: colors.$grasgroen;\r\n font-size: 0.75em;\r\n margin-inline-start: 0.5em;\r\n vertical-align: text-bottom;\r\n }\r\n }\r\n}\r\n\r\n@include utilities.box-sizing();\r\n\r\n.sr-only {\r\n @include utilities.sr-only();\r\n}\r\n","import { Component, ComponentInterface, Event, EventEmitter, Method, Prop, h } from \"@stencil/core\";\r\n\r\nimport { DsoTreeItem } from \"./tree-item\";\r\nimport { TreeViewItem, TreeViewPointerEvent } from \"./tree-view.interfaces\";\r\n\r\n@Component({\r\n tag: \"dso-tree-view\",\r\n styleUrl: \"./tree-view.scss\",\r\n shadow: true,\r\n})\r\nexport class TreeView implements ComponentInterface {\r\n private tree?: HTMLElement;\r\n\r\n /**\r\n * The collection of TreeViewItems\r\n */\r\n @Prop()\r\n collection!: TreeViewItem[];\r\n\r\n /**\r\n * Emitted when a tree view item is opened.\r\n * The `detail` property of the `CustomEvent` will contain the complete path of TreeViewItems from the\r\n * root to the item that is emitting the open event. The consumer of the event is responsible for updating\r\n * the TreeView's collection (usually set the open state on the last TreeViewItem in path).\r\n */\r\n @Event()\r\n dsoOpenItem!: EventEmitter<TreeViewItem[]>;\r\n\r\n /**\r\n * Emitted when a tree view item is closed.\r\n * The `detail` property of the `CustomEvent` will contain the complete path of TreeViewItems from the\r\n * root to the item that is emitting the close event. The consumer of the event is responsible for updating\r\n * the TreeView's collection (usually set the closed state on the last TreeViewItem in path).\r\n */\r\n @Event()\r\n dsoCloseItem!: EventEmitter<TreeViewItem[]>;\r\n\r\n /**\r\n * Emitted when a tree view item is clicked.\r\n * The `detail` property of the `CustomEvent` will contain an object with:\r\n * `path` = the complete path of TreeViewItems from the root to the item that is emitting the clicked event.\r\n * `originalEvent` = the original click event.\r\n * The consumer of the event is responsible for updating the TreeView's collection (usually set the active\r\n * state on the last TreeViewItem in path and clear all other active item states).\r\n */\r\n @Event()\r\n dsoClickItem!: EventEmitter<TreeViewPointerEvent>;\r\n\r\n /**\r\n * Set focus on the last item in the specified path.\r\n * The consumer is responsible for providing a TreeView collection where the last item is visible.\r\n * @async\r\n * @returns Whether the item was found.\r\n */\r\n @Method()\r\n async focusItem(path: TreeViewItem[]): Promise<boolean> {\r\n const tree = this.tree;\r\n\r\n if (!tree || path.length === 0) {\r\n return false;\r\n }\r\n\r\n const itemToFocus = path[path.length - 1];\r\n if (!itemToFocus) {\r\n throw new Error(\"No itemToFocus found\");\r\n }\r\n\r\n const elementToFocus = (Array.from(tree.querySelectorAll(\"p\") ?? []) as HTMLElement[])\r\n .filter((item) => item.offsetWidth > 0 && item.offsetHeight > 0)\r\n .find((item) => item.dataset[\"itemId\"] === itemToFocus.id);\r\n\r\n if (!elementToFocus) {\r\n return false;\r\n }\r\n\r\n TreeView.setFocus(tree, elementToFocus);\r\n\r\n return true;\r\n }\r\n\r\n private keyDownListener = (event: KeyboardEvent) => {\r\n if (event.defaultPrevented) {\r\n return;\r\n }\r\n\r\n const isIndexLetter = (str: string) => str.length === 1 && str.match(/\\S/);\r\n\r\n const tree = event\r\n .composedPath()\r\n .find((item) => (item instanceof HTMLElement ? item.className === \"dso-tree\" : false));\r\n\r\n if (!(event.target instanceof HTMLParagraphElement) || !(tree instanceof HTMLElement)) {\r\n return;\r\n }\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n TreeView.moveFocus(tree, event.target, \"next\");\r\n break;\r\n case \"ArrowUp\":\r\n TreeView.moveFocus(tree, event.target, \"previous\");\r\n break;\r\n case \"ArrowRight\":\r\n TreeView.expandItemOrFocusChild(tree, event.target);\r\n break;\r\n case \"ArrowLeft\":\r\n TreeView.collapseItemOrFocusParent(tree, event.target);\r\n break;\r\n case \"End\":\r\n TreeView.moveFocus(tree, event.target, \"last\");\r\n break;\r\n case \"Home\":\r\n TreeView.moveFocus(tree, event.target, \"first\");\r\n break;\r\n case \"Enter\":\r\n case \" \":\r\n event.target.click();\r\n break;\r\n default:\r\n if (isIndexLetter(event.key)) {\r\n if (TreeView.setFocusByFirstCharacter(tree, event.target, event.key, event.shiftKey)) {\r\n break;\r\n }\r\n }\r\n\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n };\r\n\r\n // eslint-disable-next-line @stencil-community/own-props-must-be-private -- Omdat this als TreeView instance aan Functionele Components wordt gegeven\r\n itemClick = (event: MouseEvent, ancestors: TreeViewItem[], item: TreeViewItem) => {\r\n if (!(event.target instanceof HTMLElement)) {\r\n return;\r\n }\r\n\r\n const contentElement = event.target.closest(\".tree-content\");\r\n\r\n if (contentElement) {\r\n const tree = event\r\n .composedPath()\r\n .find((eventTarget) => (eventTarget instanceof HTMLElement ? eventTarget.className === \"dso-tree\" : false));\r\n if (!(contentElement instanceof HTMLParagraphElement) || !(tree instanceof HTMLElement)) {\r\n return;\r\n }\r\n\r\n TreeView.setFocus(tree, contentElement);\r\n this.dsoClickItem.emit({ path: [...ancestors, item], originalEvent: event });\r\n\r\n return;\r\n }\r\n\r\n if (item.open) {\r\n this.dsoCloseItem.emit([...ancestors, item]);\r\n } else {\r\n this.dsoOpenItem.emit([...ancestors, item]);\r\n }\r\n };\r\n\r\n private static setFocus(tree: HTMLElement, target: HTMLElement) {\r\n if (target) {\r\n (Array.from(tree.querySelectorAll(\"p\")) as HTMLElement[])\r\n .filter((item) => item.tabIndex === 0)\r\n .forEach((item) => (item.tabIndex = -1));\r\n\r\n target.tabIndex = 0;\r\n target.focus();\r\n }\r\n }\r\n\r\n private static moveFocus(tree: HTMLElement, el: HTMLElement, moveTo: \"first\" | \"previous\" | \"next\" | \"last\"): void {\r\n const focusableItems = (Array.from(tree.querySelectorAll(\"p\")) as HTMLElement[]).filter(\r\n (item) => item.offsetWidth > 0 && item.offsetHeight > 0,\r\n );\r\n\r\n let index = 0;\r\n switch (moveTo) {\r\n case \"first\":\r\n index = 0;\r\n break;\r\n case \"previous\":\r\n index = focusableItems.indexOf(el) - 1;\r\n break;\r\n case \"next\":\r\n index = focusableItems.indexOf(el) + 1;\r\n break;\r\n case \"last\":\r\n index = focusableItems.length - 1;\r\n break;\r\n }\r\n\r\n const focusableItem = focusableItems[index];\r\n if (!focusableItem) {\r\n throw new Error(\"No focusableItem found\");\r\n }\r\n\r\n TreeView.setFocus(tree, focusableItem);\r\n }\r\n\r\n private static expandItemOrFocusChild(tree: HTMLElement, target: HTMLElement): void {\r\n if (target?.getAttribute(\"aria-expanded\") === \"true\") {\r\n TreeView.moveFocus(tree, target, \"next\");\r\n } else {\r\n const controlElement = target.previousElementSibling?.firstElementChild;\r\n if (controlElement instanceof HTMLElement) {\r\n controlElement.click();\r\n }\r\n }\r\n }\r\n\r\n private static collapseItemOrFocusParent(tree: HTMLElement, target: HTMLElement): void {\r\n if (target?.getAttribute(\"aria-expanded\") === \"true\") {\r\n const controlElement = target.previousElementSibling?.firstElementChild;\r\n if (controlElement instanceof HTMLElement) {\r\n controlElement.click();\r\n }\r\n } else {\r\n const parentTarget = target?.parentElement?.parentElement?.previousElementSibling;\r\n if (parentTarget instanceof HTMLElement) {\r\n TreeView.setFocus(tree, parentTarget);\r\n }\r\n }\r\n }\r\n\r\n private static setFocusByFirstCharacter(\r\n tree: HTMLElement,\r\n el: HTMLElement,\r\n char: string,\r\n backwards: boolean,\r\n ): boolean {\r\n const focusableItems = (Array.from(tree.querySelectorAll(\"p\")) as HTMLElement[]).filter(\r\n (item) => item.offsetWidth > 0 && item.offsetHeight > 0,\r\n );\r\n\r\n if (backwards) {\r\n focusableItems.reverse();\r\n }\r\n\r\n const current = focusableItems.indexOf(el);\r\n\r\n char = char.toLowerCase();\r\n let nextItem = focusableItems.find(\r\n (item, index) => index > current && item.textContent?.toLowerCase().startsWith(char),\r\n );\r\n if (!nextItem) {\r\n nextItem = focusableItems.find(\r\n (item, index) => index < current && item.textContent?.toLowerCase().startsWith(char),\r\n );\r\n }\r\n\r\n if (nextItem) {\r\n TreeView.setFocus(tree, nextItem);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n render() {\r\n return (\r\n <div\r\n id=\"tree\"\r\n class=\"dso-tree\"\r\n onKeyDown={(e) => this.keyDownListener(e)}\r\n ref={(element) => (this.tree = element)}\r\n >\r\n <ul role=\"tree\" aria-label=\"Objectenboom\">\r\n {this.collection?.map((item, index) => (\r\n <DsoTreeItem\r\n owner={this}\r\n ancestors={[]}\r\n item={item}\r\n index={index}\r\n level={1}\r\n setSize={this.collection.length}\r\n ></DsoTreeItem>\r\n ))}\r\n </ul>\r\n </div>\r\n );\r\n }\r\n}\r\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DsoViewerGrid extends Components.DsoViewerGrid, HTMLElement {}
|
|
4
|
+
export const DsoViewerGrid: {
|
|
5
|
+
prototype: DsoViewerGrid;
|
|
6
|
+
new (): DsoViewerGrid;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|