@dso-toolkit/core 73.2.1 → 73.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/dso-accordion-section.d.ts +11 -0
- package/dist/bundle/dso-accordion-section.js +281 -0
- package/dist/bundle/dso-accordion-section.js.map +1 -0
- package/dist/bundle/dso-accordion.d.ts +11 -0
- package/dist/bundle/dso-accordion.js +262 -0
- package/dist/bundle/dso-accordion.js.map +1 -0
- package/dist/bundle/dso-action-list-item.d.ts +11 -0
- package/dist/bundle/dso-action-list-item.js +63 -0
- package/dist/bundle/dso-action-list-item.js.map +1 -0
- package/dist/bundle/dso-action-list.d.ts +11 -0
- package/dist/bundle/dso-action-list.js +38 -0
- package/dist/bundle/dso-action-list.js.map +1 -0
- package/dist/bundle/dso-advanced-select.d.ts +11 -0
- package/dist/bundle/dso-advanced-select.js +155 -0
- package/dist/bundle/dso-advanced-select.js.map +1 -0
- package/dist/bundle/dso-alert.d.ts +11 -0
- package/dist/bundle/dso-alert.js +9 -0
- package/dist/bundle/dso-alert.js.map +1 -0
- package/dist/bundle/dso-annotation-activiteit.d.ts +11 -0
- package/dist/bundle/dso-annotation-activiteit.js +87 -0
- package/dist/bundle/dso-annotation-activiteit.js.map +1 -0
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.d.ts +11 -0
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.js +83 -0
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.js.map +1 -0
- package/dist/bundle/dso-annotation-kaart.d.ts +11 -0
- package/dist/bundle/dso-annotation-kaart.js +72 -0
- package/dist/bundle/dso-annotation-kaart.js.map +1 -0
- package/dist/bundle/dso-annotation-locatie.d.ts +11 -0
- package/dist/bundle/dso-annotation-locatie.js +9 -0
- package/dist/bundle/dso-annotation-locatie.js.map +1 -0
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.d.ts +11 -0
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.js +87 -0
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.js.map +1 -0
- package/dist/bundle/dso-attachments-counter.d.ts +11 -0
- package/dist/bundle/dso-attachments-counter.js +9 -0
- package/dist/bundle/dso-attachments-counter.js.map +1 -0
- package/dist/bundle/dso-autosuggest.d.ts +11 -0
- package/dist/bundle/dso-autosuggest.js +588 -0
- package/dist/bundle/dso-autosuggest.js.map +1 -0
- package/dist/bundle/dso-badge.d.ts +11 -0
- package/dist/bundle/dso-badge.js +9 -0
- package/dist/bundle/dso-badge.js.map +1 -0
- package/dist/bundle/dso-banner.d.ts +11 -0
- package/dist/bundle/dso-banner.js +53 -0
- package/dist/bundle/dso-banner.js.map +1 -0
- package/dist/bundle/dso-card-container.d.ts +11 -0
- package/dist/bundle/dso-card-container.js +42 -0
- package/dist/bundle/dso-card-container.js.map +1 -0
- package/dist/bundle/dso-card.d.ts +11 -0
- package/dist/bundle/dso-card.js +72 -0
- package/dist/bundle/dso-card.js.map +1 -0
- package/dist/bundle/dso-contact-information.d.ts +11 -0
- package/dist/bundle/dso-contact-information.js +36 -0
- package/dist/bundle/dso-contact-information.js.map +1 -0
- package/dist/bundle/dso-date-picker-legacy.d.ts +11 -0
- package/dist/bundle/dso-date-picker-legacy.js +773 -0
- package/dist/bundle/dso-date-picker-legacy.js.map +1 -0
- package/dist/bundle/dso-date-picker.d.ts +11 -0
- package/dist/bundle/dso-date-picker.js +187 -0
- package/dist/bundle/dso-date-picker.js.map +1 -0
- package/dist/bundle/dso-document-card.d.ts +11 -0
- package/dist/bundle/dso-document-card.js +66 -0
- package/dist/bundle/dso-document-card.js.map +1 -0
- package/dist/bundle/dso-document-component.d.ts +11 -0
- package/dist/bundle/dso-document-component.js +9 -0
- package/dist/bundle/dso-document-component.js.map +1 -0
- package/dist/bundle/dso-dropdown-menu.d.ts +11 -0
- package/dist/bundle/dso-dropdown-menu.js +9 -0
- package/dist/bundle/dso-dropdown-menu.js.map +1 -0
- package/dist/bundle/dso-expandable.d.ts +11 -0
- package/dist/bundle/dso-expandable.js +9 -0
- package/dist/bundle/dso-expandable.js.map +1 -0
- package/dist/bundle/dso-header.d.ts +11 -0
- package/dist/bundle/dso-header.js +218 -0
- package/dist/bundle/dso-header.js.map +1 -0
- package/dist/bundle/dso-highlight-box.d.ts +11 -0
- package/dist/bundle/dso-highlight-box.js +45 -0
- package/dist/bundle/dso-highlight-box.js.map +1 -0
- package/dist/bundle/dso-icon.d.ts +11 -0
- package/dist/bundle/dso-icon.js +9 -0
- package/dist/bundle/dso-icon.js.map +1 -0
- package/dist/bundle/dso-image-overlay.d.ts +11 -0
- package/dist/bundle/dso-image-overlay.js +9 -0
- package/dist/bundle/dso-image-overlay.js.map +1 -0
- package/dist/bundle/dso-info-button.d.ts +11 -0
- package/dist/bundle/dso-info-button.js +9 -0
- package/dist/bundle/dso-info-button.js.map +1 -0
- package/dist/bundle/dso-info.d.ts +11 -0
- package/dist/bundle/dso-info.js +9 -0
- package/dist/bundle/dso-info.js.map +1 -0
- package/dist/bundle/dso-input-range.d.ts +11 -0
- package/dist/bundle/dso-input-range.js +59 -0
- package/dist/bundle/dso-input-range.js.map +1 -0
- package/dist/bundle/dso-label.d.ts +11 -0
- package/dist/bundle/dso-label.js +9 -0
- package/dist/bundle/dso-label.js.map +1 -0
- package/dist/bundle/dso-legend-item.d.ts +11 -0
- package/dist/bundle/dso-legend-item.js +90 -0
- package/dist/bundle/dso-legend-item.js.map +1 -0
- package/dist/bundle/dso-list-button.d.ts +11 -0
- package/dist/bundle/dso-list-button.js +118 -0
- package/dist/bundle/dso-list-button.js.map +1 -0
- package/dist/bundle/dso-logo.d.ts +11 -0
- package/dist/bundle/dso-logo.js +64 -0
- package/dist/bundle/dso-logo.js.map +1 -0
- package/dist/bundle/dso-map-base-layers.d.ts +11 -0
- package/dist/bundle/dso-map-base-layers.js +101 -0
- package/dist/bundle/dso-map-base-layers.js.map +1 -0
- package/dist/bundle/dso-map-controls.d.ts +11 -0
- package/dist/bundle/dso-map-controls.js +138 -0
- package/dist/bundle/dso-map-controls.js.map +1 -0
- package/dist/bundle/dso-map-overlays.d.ts +11 -0
- package/dist/bundle/dso-map-overlays.js +102 -0
- package/dist/bundle/dso-map-overlays.js.map +1 -0
- package/dist/bundle/dso-mark-bar.d.ts +11 -0
- package/dist/bundle/dso-mark-bar.js +91 -0
- package/dist/bundle/dso-mark-bar.js.map +1 -0
- package/dist/bundle/dso-modal.d.ts +11 -0
- package/dist/bundle/dso-modal.js +120 -0
- package/dist/bundle/dso-modal.js.map +1 -0
- package/dist/bundle/dso-onboarding-tip.d.ts +11 -0
- package/dist/bundle/dso-onboarding-tip.js +1839 -0
- package/dist/bundle/dso-onboarding-tip.js.map +1 -0
- package/dist/bundle/dso-ozon-content.d.ts +11 -0
- package/dist/bundle/dso-ozon-content.js +9 -0
- package/dist/bundle/dso-ozon-content.js.map +1 -0
- package/dist/bundle/dso-pagination.d.ts +11 -0
- package/dist/bundle/dso-pagination.js +188 -0
- package/dist/bundle/dso-pagination.js.map +1 -0
- package/dist/bundle/dso-panel.d.ts +11 -0
- package/dist/bundle/dso-panel.js +9 -0
- package/dist/bundle/dso-panel.js.map +1 -0
- package/dist/bundle/dso-plekinfo-card.d.ts +11 -0
- package/dist/bundle/dso-plekinfo-card.js +88 -0
- package/dist/bundle/dso-plekinfo-card.js.map +1 -0
- package/dist/bundle/dso-progress-bar.d.ts +11 -0
- package/dist/bundle/dso-progress-bar.js +50 -0
- package/dist/bundle/dso-progress-bar.js.map +1 -0
- package/dist/bundle/dso-progress-indicator.d.ts +11 -0
- package/dist/bundle/dso-progress-indicator.js +9 -0
- package/dist/bundle/dso-progress-indicator.js.map +1 -0
- package/dist/bundle/dso-project-item.d.ts +11 -0
- package/dist/bundle/dso-project-item.js +56 -0
- package/dist/bundle/dso-project-item.js.map +1 -0
- package/dist/bundle/dso-renvooi.d.ts +11 -0
- package/dist/bundle/dso-renvooi.js +9 -0
- package/dist/bundle/dso-renvooi.js.map +1 -0
- package/dist/bundle/dso-responsive-element.d.ts +11 -0
- package/dist/bundle/dso-responsive-element.js +9 -0
- package/dist/bundle/dso-responsive-element.js.map +1 -0
- package/dist/bundle/dso-scrollable.d.ts +11 -0
- package/dist/bundle/dso-scrollable.js +9 -0
- package/dist/bundle/dso-scrollable.js.map +1 -0
- package/dist/bundle/dso-selectable.d.ts +11 -0
- package/dist/bundle/dso-selectable.js +9 -0
- package/dist/bundle/dso-selectable.js.map +1 -0
- package/dist/bundle/dso-skiplink.d.ts +11 -0
- package/dist/bundle/dso-skiplink.js +53 -0
- package/dist/bundle/dso-skiplink.js.map +1 -0
- package/dist/bundle/dso-slide-toggle.d.ts +11 -0
- package/dist/bundle/dso-slide-toggle.js +9 -0
- package/dist/bundle/dso-slide-toggle.js.map +1 -0
- package/dist/bundle/dso-survey-rating.d.ts +11 -0
- package/dist/bundle/dso-survey-rating.js +70 -0
- package/dist/bundle/dso-survey-rating.js.map +1 -0
- package/dist/bundle/dso-tab.d.ts +11 -0
- package/dist/bundle/dso-tab.js +70 -0
- package/dist/bundle/dso-tab.js.map +1 -0
- package/dist/bundle/dso-table.d.ts +11 -0
- package/dist/bundle/dso-table.js +9 -0
- package/dist/bundle/dso-table.js.map +1 -0
- package/dist/bundle/dso-tabs.d.ts +11 -0
- package/dist/bundle/dso-tabs.js +94 -0
- package/dist/bundle/dso-tabs.js.map +1 -0
- package/dist/bundle/dso-toggletip.d.ts +11 -0
- package/dist/bundle/dso-toggletip.js +9 -0
- package/dist/bundle/dso-toggletip.js.map +1 -0
- package/dist/bundle/dso-tooltip.d.ts +11 -0
- package/dist/bundle/dso-tooltip.js +9 -0
- package/dist/bundle/dso-tooltip.js.map +1 -0
- package/dist/bundle/dso-tree-view.d.ts +11 -0
- package/dist/bundle/dso-tree-view.js +237 -0
- package/dist/bundle/dso-tree-view.js.map +1 -0
- package/dist/bundle/dso-viewer-grid.d.ts +11 -0
- package/dist/bundle/dso-viewer-grid.js +351 -0
- package/dist/bundle/dso-viewer-grid.js.map +1 -0
- package/dist/bundle/dsot-document-component-demo.d.ts +11 -0
- package/dist/bundle/dsot-document-component-demo.js +1957 -0
- package/dist/bundle/dsot-document-component-demo.js.map +1 -0
- package/dist/bundle/index.d.ts +45 -0
- package/dist/bundle/index.js +143 -0
- package/dist/bundle/index.js.map +1 -0
- package/dist/bundle/p-0JGmXD8O.js +59 -0
- package/dist/bundle/p-0JGmXD8O.js.map +1 -0
- package/dist/bundle/p-BF0_OXTe.js +60 -0
- package/dist/bundle/p-BF0_OXTe.js.map +1 -0
- package/dist/bundle/p-BPLPqKUj.js +163 -0
- package/dist/bundle/p-BPLPqKUj.js.map +1 -0
- package/dist/bundle/p-B_kXuEcW.js +2178 -0
- package/dist/bundle/p-B_kXuEcW.js.map +1 -0
- package/dist/bundle/p-BacS1uCc.js +35 -0
- package/dist/bundle/p-BacS1uCc.js.map +1 -0
- package/dist/bundle/p-BdyXpl60.js +76 -0
- package/dist/bundle/p-BdyXpl60.js.map +1 -0
- package/dist/bundle/p-BocpUT46.js +992 -0
- package/dist/bundle/p-BocpUT46.js.map +1 -0
- package/dist/bundle/p-BtcZ9oZ6.js +115 -0
- package/dist/bundle/p-BtcZ9oZ6.js.map +1 -0
- package/dist/bundle/p-BxvZeNWe.js +126 -0
- package/dist/bundle/p-BxvZeNWe.js.map +1 -0
- package/dist/bundle/p-C1tscMvU.js +43 -0
- package/dist/bundle/p-C1tscMvU.js.map +1 -0
- package/dist/bundle/p-CZ2ipzNO.js +63 -0
- package/dist/bundle/p-CZ2ipzNO.js.map +1 -0
- package/dist/bundle/p-Cbba2ZRN.js +36 -0
- package/dist/bundle/p-Cbba2ZRN.js.map +1 -0
- package/dist/bundle/p-ChV9xqsO.js +6 -0
- package/dist/bundle/p-ChV9xqsO.js.map +1 -0
- package/dist/bundle/p-ChrHXjXh.js +80 -0
- package/dist/bundle/p-ChrHXjXh.js.map +1 -0
- package/dist/bundle/p-Cng7insW.js +145 -0
- package/dist/bundle/p-Cng7insW.js.map +1 -0
- package/dist/bundle/p-CodDyi2J.js +15 -0
- package/dist/bundle/p-CodDyi2J.js.map +1 -0
- package/dist/bundle/p-CsY83cJO.js +1801 -0
- package/dist/bundle/p-CsY83cJO.js.map +1 -0
- package/dist/bundle/p-CvGnEQcm.js +80 -0
- package/dist/bundle/p-CvGnEQcm.js.map +1 -0
- package/dist/bundle/p-D2nuXSd0.js +723 -0
- package/dist/bundle/p-D2nuXSd0.js.map +1 -0
- package/dist/bundle/p-D9Yjz_Sm.js +125 -0
- package/dist/bundle/p-D9Yjz_Sm.js.map +1 -0
- package/dist/bundle/p-DDDh2Izf.js +12 -0
- package/dist/bundle/p-DDDh2Izf.js.map +1 -0
- package/dist/bundle/p-DGWbWwct.js +121 -0
- package/dist/bundle/p-DGWbWwct.js.map +1 -0
- package/dist/bundle/p-DHO_Za64.js +1729 -0
- package/dist/bundle/p-DHO_Za64.js.map +1 -0
- package/dist/bundle/p-DPH021KD.js +14 -0
- package/dist/bundle/p-DPH021KD.js.map +1 -0
- package/dist/bundle/p-DSyv-znO.js +18 -0
- package/dist/bundle/p-DSyv-znO.js.map +1 -0
- package/dist/bundle/p-DWTXTDbr.js +253 -0
- package/dist/bundle/p-DWTXTDbr.js.map +1 -0
- package/dist/bundle/p-DacnxEpv.js +78 -0
- package/dist/bundle/p-DacnxEpv.js.map +1 -0
- package/dist/bundle/p-DcpG4jOU.js +99 -0
- package/dist/bundle/p-DcpG4jOU.js.map +1 -0
- package/dist/bundle/p-DrR9RuIM.js +83 -0
- package/dist/bundle/p-DrR9RuIM.js.map +1 -0
- package/dist/bundle/p-DvqO1i1s.js +1162 -0
- package/dist/bundle/p-DvqO1i1s.js.map +1 -0
- package/dist/bundle/p-Hgv-pDpy.js +13 -0
- package/dist/bundle/p-Hgv-pDpy.js.map +1 -0
- package/dist/bundle/p-Pk8qng7t.js +573 -0
- package/dist/bundle/p-Pk8qng7t.js.map +1 -0
- package/dist/bundle/p-WYm6cxra.js +64 -0
- package/dist/bundle/p-WYm6cxra.js.map +1 -0
- package/dist/bundle/p-dB3K6tfb.js +41 -0
- package/dist/bundle/p-dB3K6tfb.js.map +1 -0
- package/dist/bundle/p-kDtv6DeD.js +314 -0
- package/dist/bundle/p-kDtv6DeD.js.map +1 -0
- package/dist/bundle/p-pVO6m7lg.js +271 -0
- package/dist/bundle/p-pVO6m7lg.js.map +1 -0
- package/dist/bundle/p-xNnEBBZG.js +63 -0
- package/dist/bundle/p-xNnEBBZG.js.map +1 -0
- package/dist/cjs/dso-accordion-section.cjs.entry.js +3 -3
- package/dist/cjs/dso-accordion-section.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-accordion-section.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-alert_6.cjs.entry.js +3 -7
- package/dist/cjs/dso-alert_6.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-onboarding-tip.cjs.entry.js +24 -10
- package/dist/cjs/dso-onboarding-tip.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-onboarding-tip.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/components/accordion-section.js +3 -3
- package/dist/collection/components/accordion/components/accordion-section.js.map +1 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.css +21 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.js +28 -9
- package/dist/collection/components/onboarding-tip/onboarding-tip.js.map +1 -1
- package/dist/collection/components/table/table.css +2 -2
- package/dist/collection/components/table/table.js +3 -26
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/components/dso-accordion-section.js +3 -3
- package/dist/components/dso-accordion-section.js.map +1 -1
- package/dist/components/dso-onboarding-tip.js +26 -11
- package/dist/components/dso-onboarding-tip.js.map +1 -1
- package/dist/components/table.js +4 -8
- package/dist/components/table.js.map +1 -1
- package/dist/dso-toolkit/dso-accordion-section.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-onboarding-tip.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/{p-8084c884.entry.js → p-5fa008c6.entry.js} +2 -2
- package/dist/dso-toolkit/{p-8084c884.entry.js.map → p-5fa008c6.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-6a156238.entry.js → p-6f89da1c.entry.js} +2 -2
- package/dist/dso-toolkit/{p-6a156238.entry.js.map → p-6f89da1c.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-909118a3.entry.js +2 -0
- package/dist/dso-toolkit/p-909118a3.entry.js.map +1 -0
- package/dist/esm/dso-accordion-section.entry.js +3 -3
- package/dist/esm/dso-accordion-section.entry.js.map +1 -1
- package/dist/esm/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.js.map +1 -1
- package/dist/esm/dso-alert_6.entry.js +3 -7
- package/dist/esm/dso-alert_6.entry.js.map +1 -1
- package/dist/esm/dso-onboarding-tip.entry.js +24 -10
- package/dist/esm/dso-onboarding-tip.entry.js.map +1 -1
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/onboarding-tip/onboarding-tip.d.ts +1 -0
- package/dist/types/components/table/table.d.ts +1 -4
- package/dist/types/components.d.ts +0 -8
- package/package.json +3 -3
- package/dist/dso-toolkit/p-c0410277.entry.js +0 -2
- package/dist/dso-toolkit/p-c0410277.entry.js.map +0 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, e as createEvent, h, F as Fragment } from './p-DHO_Za64.js';
|
|
2
|
+
import { c as clsx } from './p-ChV9xqsO.js';
|
|
3
|
+
import { d as debounce } from './p-BxvZeNWe.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './p-D2nuXSd0.js';
|
|
5
|
+
import { d as defineCustomElement$1 } from './p-kDtv6DeD.js';
|
|
6
|
+
|
|
7
|
+
const labelCss = ":host{display:inline-block;max-inline-size:100%}*,*::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}.dso-label{border-radius:4px;display:inline-block;line-height:1.5;max-inline-size:100%;padding-block:4px;padding-inline:8px}.dso-label:focus-within,.dso-label.dso-hover{text-decoration:line-through}.dso-label button{background:none;border:0;border-radius:0 4px 4px 0;color:inherit;float:inline-end;font-size:1rem;margin-block-end:-4px;margin-inline-start:8px;margin-inline-end:-4px;margin-block-start:0;padding:0}.dso-label button:hover{cursor:pointer}.dso-label button>dso-icon,.dso-label button>svg.di{display:block}.dso-label{background-color:#f2f2f2;border-color:#f2f2f2;color:#191919}.dso-label.dso-label-info{background-color:#6ca4d9;border-color:#6ca4d9;color:#191919}.dso-label.dso-label-primary{background-color:#275937;border-color:#275937;color:#fff}.dso-label.dso-label-success{background-color:#39870c;border-color:#39870c;color:#fff}.dso-label.dso-label-warning{background-color:#dcd400;border-color:#dcd400;color:#191919}.dso-label.dso-label-danger{background-color:#ce3f51;border-color:#ce3f51;color:#fff}.dso-label.dso-label-error{background-color:#ce3f51;border-color:#ce3f51;color:#fff}.dso-label.dso-label-bright{background-color:#fff;border-color:#fff;color:#191919}.dso-label.dso-label-bright{outline:1px solid #ccc;outline-offset:-1px}.dso-label.dso-label-attention{background-color:#8b4a6a;border-color:#8b4a6a;color:#fff}.dso-label.dso-compact{padding-block:0;padding-inline:8px}.dso-label.dso-hover .dso-label-content{text-decoration:line-through}.dso-truncate.dso-label-content{display:inline-block;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap}:host([removable]) .dso-truncate.dso-label-content{max-inline-size:calc(100% - 28px)}";
|
|
8
|
+
|
|
9
|
+
const resizeObserver = new ResizeObserver(debounce((entries) => {
|
|
10
|
+
entries.forEach(({ target }) => {
|
|
11
|
+
if (isDsoLabelComponent(target)) {
|
|
12
|
+
target._truncateLabel();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}, 150));
|
|
16
|
+
function isDsoLabelComponent(element) {
|
|
17
|
+
return element.tagName === "DSO-LABEL";
|
|
18
|
+
}
|
|
19
|
+
function hasEllipses(el) {
|
|
20
|
+
return el.scrollWidth > el.clientWidth;
|
|
21
|
+
}
|
|
22
|
+
const Label = /*@__PURE__*/ proxyCustomElement(class Label extends H {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.__registerHost();
|
|
26
|
+
this.__attachShadow();
|
|
27
|
+
this.dsoRemoveClick = createEvent(this, "dsoRemoveClick", 7);
|
|
28
|
+
this.isTruncated = false;
|
|
29
|
+
this.labelText = "";
|
|
30
|
+
}
|
|
31
|
+
watchRemovable(removable) {
|
|
32
|
+
if (removable) {
|
|
33
|
+
this.startMutationObserver();
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.stopMutationObserver();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
watchTruncate(truncate) {
|
|
40
|
+
if (truncate) {
|
|
41
|
+
this.startTruncate();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.stopTruncate();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
keyDownListener(event) {
|
|
48
|
+
if (event.key === "Escape") {
|
|
49
|
+
this.textHover = false;
|
|
50
|
+
this.textFocus = false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
async _truncateLabel() {
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
this.isTruncated = !!this.labelContent && hasEllipses(this.labelContent);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
syncLabelText() {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
this.labelText = (_b = (_a = this.host.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : "";
|
|
64
|
+
}
|
|
65
|
+
componentDidLoad() {
|
|
66
|
+
if (this.truncate) {
|
|
67
|
+
this.startTruncate();
|
|
68
|
+
}
|
|
69
|
+
if (this.removable) {
|
|
70
|
+
this.startMutationObserver();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
disconnectedCallback() {
|
|
74
|
+
this.stopTruncate();
|
|
75
|
+
this.stopMutationObserver(true);
|
|
76
|
+
}
|
|
77
|
+
/** The mutationObserver fetches the text placed inside the label, this is then used for the remove button and tooltip. */
|
|
78
|
+
startMutationObserver() {
|
|
79
|
+
this.mutationObserver = new MutationObserver(() => this.syncLabelText());
|
|
80
|
+
this.mutationObserver.observe(this.host, {
|
|
81
|
+
characterData: true,
|
|
82
|
+
childList: true,
|
|
83
|
+
subtree: true,
|
|
84
|
+
attributes: true,
|
|
85
|
+
});
|
|
86
|
+
this.syncLabelText();
|
|
87
|
+
}
|
|
88
|
+
stopMutationObserver(force = false) {
|
|
89
|
+
var _a;
|
|
90
|
+
if (force || !(this.truncate && this.removable)) {
|
|
91
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
92
|
+
delete this.mutationObserver;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
startTruncate() {
|
|
96
|
+
resizeObserver.observe(this.host);
|
|
97
|
+
this.startMutationObserver();
|
|
98
|
+
this._truncateLabel();
|
|
99
|
+
}
|
|
100
|
+
stopTruncate() {
|
|
101
|
+
resizeObserver.unobserve(this.host);
|
|
102
|
+
this.stopMutationObserver();
|
|
103
|
+
this.isTruncated = false;
|
|
104
|
+
}
|
|
105
|
+
render() {
|
|
106
|
+
return (h(Fragment, { key: 'd89597ffc51b15962f552c29f36f521bdaf39c50' }, h("span", { key: 'f1e469e66f240054f1dfde27fdc8b8ab2420ff66', "aria-describedby": "toggle-anchor", class: clsx("dso-label", {
|
|
107
|
+
[`dso-label-${this.status}`]: this.status,
|
|
108
|
+
"dso-compact": this.compact && !this.removable,
|
|
109
|
+
"dso-hover": this.removeHover || this.removeFocus,
|
|
110
|
+
}) }, h("slot", { key: '45f7379dff3dc6b90427bc6c16cae56f20c361bd', name: "symbol" }), h("span", { key: '881082872c27e2ded34841d16789e14a406769fc', class: clsx("dso-label-content", {
|
|
111
|
+
"dso-truncate": !!this.truncate,
|
|
112
|
+
}), ref: (element) => (this.labelContent = element), tabindex: this.truncate && this.isTruncated ? 0 : undefined, onMouseEnter: () => (this.textHover = true), onMouseLeave: () => (this.textHover = false), onFocus: () => (this.textFocus = true), onBlur: () => (this.textFocus = false) }, h("slot", { key: 'd39c1578c6da70686cd0f29bc1c11ea3fabce7b1' })), this.removable && (h("button", { key: '54c612faadd4f9c6c857d7a615f9272bd27b54d0', type: "button", onClick: (e) => this.dsoRemoveClick.emit(e), onMouseEnter: () => (this.removeHover = true), onMouseLeave: () => (this.removeHover = false), onFocus: () => (this.removeFocus = true), onBlur: () => (this.removeFocus = false) }, h("span", { key: 'c0c9ba47faa4fe975a44082d137737d556c78634', class: "sr-only" }, "Verwijder: ", this.labelText), h("dso-icon", { key: '6120cb63ec101cccb6e36349576866cd5f8a5672', icon: "times" })))), this.isTruncated && (h("dso-tooltip", { key: 'ae3d3d54388e85890b9a536557f27a084175ac6d', stateless: true, id: "toggle-anchor", active: this.textHover || this.textFocus, position: "top", strategy: "absolute" }, this.labelText))));
|
|
113
|
+
}
|
|
114
|
+
get host() { return this; }
|
|
115
|
+
static get watchers() { return {
|
|
116
|
+
"removable": ["watchRemovable"],
|
|
117
|
+
"truncate": ["watchTruncate"]
|
|
118
|
+
}; }
|
|
119
|
+
static get style() { return labelCss; }
|
|
120
|
+
}, [1, "dso-label", {
|
|
121
|
+
"compact": [4],
|
|
122
|
+
"removable": [516],
|
|
123
|
+
"status": [1],
|
|
124
|
+
"truncate": [4],
|
|
125
|
+
"removeHover": [32],
|
|
126
|
+
"removeFocus": [32],
|
|
127
|
+
"textHover": [32],
|
|
128
|
+
"textFocus": [32],
|
|
129
|
+
"isTruncated": [32],
|
|
130
|
+
"labelText": [32],
|
|
131
|
+
"_truncateLabel": [64]
|
|
132
|
+
}, [[4, "keydown", "keyDownListener"]], {
|
|
133
|
+
"removable": ["watchRemovable"],
|
|
134
|
+
"truncate": ["watchTruncate"]
|
|
135
|
+
}]);
|
|
136
|
+
function defineCustomElement() {
|
|
137
|
+
if (typeof customElements === "undefined") {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const components = ["dso-label", "dso-icon", "dso-tooltip"];
|
|
141
|
+
components.forEach(tagName => { switch (tagName) {
|
|
142
|
+
case "dso-label":
|
|
143
|
+
if (!customElements.get(tagName)) {
|
|
144
|
+
customElements.define(tagName, Label);
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
case "dso-icon":
|
|
148
|
+
if (!customElements.get(tagName)) {
|
|
149
|
+
defineCustomElement$2();
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
case "dso-tooltip":
|
|
153
|
+
if (!customElements.get(tagName)) {
|
|
154
|
+
defineCustomElement$1();
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
} });
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export { Label as L, defineCustomElement as d };
|
|
161
|
+
//# sourceMappingURL=p-BPLPqKUj.js.map
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=p-BPLPqKUj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-BPLPqKUj.js","mappings":";;;;;;AAAA,MAAM,QAAQ,GAAG,44DAA44D;;ACmB75D,MAAM,cAAc,GAAG,IAAI,cAAc,CACvC,QAAQ,CAAC,CAAC,OAA8B,KAAI;IAC1C,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,KAAI;AAC7B,QAAA,IAAI,mBAAmB,CAAC,MAAM,CA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AAS,GAAG,KAAK,CAAC,EAAA,EAEtC,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAa,CACR,EACN,IAAI,CAAC,SAAS,KACb,+DACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAC3C,YAAY,EAAE,OAAO,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,EAC7C,YAAY,EAAE,OAAO,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,EAC9C,OAAO,EAAE,OAAO,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,EACxC,MAAM,EAAE,OAAO,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,EAAA,EAExC,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,SAAS,EAAA,iBAAa,IAAI,CAAC,SAAS,CAAQ,EACxD,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,IAAI,EAAC,OAAO,EAAY,CAAA,CAC3B,CACV,CACI,EACN,IAAI,CAAC,WAAW,KACf,CAAA,CAAA,aAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,SAAS,EACT,IAAA,EAAA,EAAE,EAAC,eAAe,EAClB,MAAM,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,EACxC,QAAQ,EAAC,KAAK,EACd,QAAQ,EAAC,UAAU,EAElB,EAAA,IAAI,CAAC,SAAS,CACH,CACf,CACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/label/label.scss?tag=dso-label&encapsulation=shadow","src/components/label/label.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/components/label\";\r\n\r\n:host {\r\n display: inline-block;\r\n max-inline-size: 100%;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n\r\n// Todo: Replace .sr-only selector with web component specific selector, no need for .sr-only if we can generate the SCSS\r\n.sr-only {\r\n @include utilities.sr-only();\r\n}\r\n\r\n.dso-label {\r\n @include label.root();\r\n\r\n &.dso-hover {\r\n .dso-label-content {\r\n text-decoration: line-through;\r\n }\r\n }\r\n}\r\n\r\n.dso-truncate.dso-label-content {\r\n display: inline-block;\r\n max-inline-size: 100%;\r\n overflow: hidden;\r\n text-overflow: ellipsis; // stylelint-disable-line declaration-property-value-disallowed-list -- full text can be viewed via tooltip.\r\n vertical-align: bottom;\r\n white-space: nowrap; // stylelint-disable-line declaration-property-value-disallowed-list -- full text can be viewed via tooltip.\r\n}\r\n\r\n:host([removable]) {\r\n .dso-truncate.dso-label-content {\r\n max-inline-size: calc(100% - (units.$u3 + 4px));\r\n }\r\n}\r\n","import {\r\n Component,\r\n ComponentInterface,\r\n Element,\r\n Event,\r\n EventEmitter,\r\n Fragment,\r\n Listen,\r\n Method,\r\n Prop,\r\n State,\r\n Watch,\r\n h,\r\n} from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\nimport debounce from \"debounce\";\r\n\r\nimport { LabelStatus } from \"./label.interfaces\";\r\n\r\nconst resizeObserver = new ResizeObserver(\r\n debounce((entries: ResizeObserverEntry[]) => {\r\n entries.forEach(({ target }) => {\r\n if (isDsoLabelComponent(target)) {\r\n target._truncateLabel();\r\n }\r\n });\r\n }, 150),\r\n);\r\n\r\nfunction isDsoLabelComponent(element: Element): element is HTMLDsoLabelElement {\r\n return element.tagName === \"DSO-LABEL\";\r\n}\r\n\r\nfunction hasEllipses(el: HTMLElement): boolean {\r\n return el.scrollWidth > el.clientWidth;\r\n}\r\n\r\n@Component({\r\n tag: \"dso-label\",\r\n styleUrl: \"label.scss\",\r\n shadow: true,\r\n})\r\nexport class Label implements ComponentInterface {\r\n private labelContent: HTMLSpanElement | undefined;\r\n\r\n private mutationObserver?: MutationObserver;\r\n\r\n @Element()\r\n private host!: HTMLDsoLabelElement;\r\n\r\n /**\r\n * For compact Label\r\n */\r\n @Prop()\r\n compact?: boolean;\r\n\r\n /**\r\n * Shows a button that can be used to remove the Label.\r\n */\r\n @Prop({ reflect: true })\r\n removable?: boolean;\r\n\r\n /**\r\n * The status of this Label.\r\n */\r\n @Prop()\r\n status?: LabelStatus;\r\n\r\n /**\r\n * Emitted when the user activates the remove button.\r\n */\r\n @Event()\r\n dsoRemoveClick!: EventEmitter<MouseEvent>;\r\n\r\n @State()\r\n removeHover?: boolean;\r\n\r\n @State()\r\n removeFocus?: boolean;\r\n\r\n /**\r\n * Whether the Label is allowed to truncate the contents if it does not fit the container element.\r\n */\r\n @Prop()\r\n truncate?: boolean;\r\n\r\n @State()\r\n textHover?: boolean;\r\n\r\n @State()\r\n textFocus?: boolean;\r\n\r\n @State()\r\n isTruncated = false;\r\n\r\n @State()\r\n labelText = \"\";\r\n\r\n @Watch(\"removable\")\r\n watchRemovable(removable: boolean) {\r\n if (removable) {\r\n this.startMutationObserver();\r\n } else {\r\n this.stopMutationObserver();\r\n }\r\n }\r\n\r\n @Watch(\"truncate\")\r\n watchTruncate(truncate: boolean) {\r\n if (truncate) {\r\n this.startTruncate();\r\n } else {\r\n this.stopTruncate();\r\n }\r\n }\r\n\r\n @Listen(\"keydown\", { target: \"document\" })\r\n keyDownListener(event: KeyboardEvent) {\r\n if (event.key === \"Escape\") {\r\n this.textHover = false;\r\n this.textFocus = false;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n @Method()\r\n async _truncateLabel() {\r\n setTimeout(() => {\r\n this.isTruncated = !!this.labelContent && hasEllipses(this.labelContent);\r\n });\r\n }\r\n\r\n private syncLabelText() {\r\n this.labelText = this.host.textContent?.trim() ?? \"\";\r\n }\r\n\r\n componentDidLoad() {\r\n if (this.truncate) {\r\n this.startTruncate();\r\n }\r\n\r\n if (this.removable) {\r\n this.startMutationObserver();\r\n }\r\n }\r\n\r\n disconnectedCallback() {\r\n this.stopTruncate();\r\n\r\n this.stopMutationObserver(true);\r\n }\r\n\r\n /** The mutationObserver fetches the text placed inside the label, this is then used for the remove button and tooltip. */\r\n private startMutationObserver(): void {\r\n this.mutationObserver = new MutationObserver(() => this.syncLabelText());\r\n\r\n this.mutationObserver.observe(this.host, {\r\n characterData: true,\r\n childList: true,\r\n subtree: true,\r\n attributes: true,\r\n });\r\n\r\n this.syncLabelText();\r\n }\r\n\r\n private stopMutationObserver(force = false): void {\r\n if (force || !(this.truncate && this.removable)) {\r\n this.mutationObserver?.disconnect();\r\n\r\n delete this.mutationObserver;\r\n }\r\n }\r\n\r\n private startTruncate(): void {\r\n resizeObserver.observe(this.host);\r\n this.startMutationObserver();\r\n this._truncateLabel();\r\n }\r\n\r\n private stopTruncate(): void {\r\n resizeObserver.unobserve(this.host);\r\n this.stopMutationObserver();\r\n this.isTruncated = false;\r\n }\r\n\r\n render() {\r\n return (\r\n <Fragment>\r\n <span\r\n aria-describedby=\"toggle-anchor\"\r\n class={clsx(\"dso-label\", {\r\n [`dso-label-${this.status}`]: this.status,\r\n \"dso-compact\": this.compact && !this.removable,\r\n \"dso-hover\": this.removeHover || this.removeFocus,\r\n })}\r\n >\r\n <slot name=\"symbol\"></slot>\r\n <span\r\n class={clsx(\"dso-label-content\", {\r\n \"dso-truncate\": !!this.truncate,\r\n })}\r\n ref={(element) => (this.labelContent = element)}\r\n tabindex={this.truncate && this.isTruncated ? 0 : undefined}\r\n onMouseEnter={() => (this.textHover = true)}\r\n onMouseLeave={() => (this.textHover = false)}\r\n onFocus={() => (this.textFocus = true)}\r\n onBlur={() => (this.textFocus = false)}\r\n >\r\n <slot></slot>\r\n </span>\r\n {this.removable && (\r\n <button\r\n type=\"button\"\r\n onClick={(e) => this.dsoRemoveClick.emit(e)}\r\n onMouseEnter={() => (this.removeHover = true)}\r\n onMouseLeave={() => (this.removeHover = false)}\r\n onFocus={() => (this.removeFocus = true)}\r\n onBlur={() => (this.removeFocus = false)}\r\n >\r\n <span class=\"sr-only\">Verwijder: {this.labelText}</span>\r\n <dso-icon icon=\"times\"></dso-icon>\r\n </button>\r\n )}\r\n </span>\r\n {this.isTruncated && (\r\n <dso-tooltip\r\n stateless\r\n id=\"toggle-anchor\"\r\n active={this.textHover || this.textFocus}\r\n position=\"top\"\r\n strategy=\"absolute\"\r\n >\r\n {this.labelText}\r\n </dso-tooltip>\r\n )}\r\n </Fragment>\r\n );\r\n }\r\n}\r\n"],"version":3}
|