@dso-toolkit/core 62.12.0 → 62.13.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.
Files changed (65) hide show
  1. package/dist/cjs/dso-advanced-select.cjs.entry.js +98 -0
  2. package/dist/cjs/dso-advanced-select.cjs.entry.js.map +1 -0
  3. package/dist/cjs/dso-dropdown-menu.cjs.entry.js +2 -11
  4. package/dist/cjs/dso-dropdown-menu.cjs.entry.js.map +1 -1
  5. package/dist/cjs/dso-modal.cjs.entry.js +13 -4
  6. package/dist/cjs/dso-modal.cjs.entry.js.map +1 -1
  7. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  8. package/dist/cjs/get-active-element-618f7b1f.js +16 -0
  9. package/dist/cjs/get-active-element-618f7b1f.js.map +1 -0
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/collection-manifest.json +1 -0
  12. package/dist/collection/components/advanced-select/advanced-select.css +206 -0
  13. package/dist/collection/components/advanced-select/advanced-select.js +220 -0
  14. package/dist/collection/components/advanced-select/advanced-select.js.map +1 -0
  15. package/dist/collection/components/advanced-select/advanced-select.models.js +2 -0
  16. package/dist/collection/components/advanced-select/advanced-select.models.js.map +1 -0
  17. package/dist/collection/components/dropdown-menu/dropdown-menu.js +3 -12
  18. package/dist/collection/components/dropdown-menu/dropdown-menu.js.map +1 -1
  19. package/dist/collection/components/modal/modal.js +37 -6
  20. package/dist/collection/components/modal/modal.js.map +1 -1
  21. package/dist/collection/utils/get-active-element.js +11 -0
  22. package/dist/collection/utils/get-active-element.js.map +1 -0
  23. package/dist/components/dropdown-menu.js +2 -11
  24. package/dist/components/dropdown-menu.js.map +1 -1
  25. package/dist/components/dso-advanced-select.d.ts +11 -0
  26. package/dist/components/dso-advanced-select.js +129 -0
  27. package/dist/components/dso-advanced-select.js.map +1 -0
  28. package/dist/components/dso-modal.js +15 -6
  29. package/dist/components/dso-modal.js.map +1 -1
  30. package/dist/components/get-active-element.js +14 -0
  31. package/dist/components/get-active-element.js.map +1 -0
  32. package/dist/components/index.d.ts +2 -0
  33. package/dist/components/index.js +1 -0
  34. package/dist/components/index.js.map +1 -1
  35. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  36. package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
  37. package/dist/dso-toolkit/p-55dec51f.entry.js +2 -0
  38. package/dist/dso-toolkit/p-55dec51f.entry.js.map +1 -0
  39. package/dist/dso-toolkit/p-6e9b961b.js +2 -0
  40. package/dist/dso-toolkit/p-6e9b961b.js.map +1 -0
  41. package/dist/dso-toolkit/p-dd21df39.entry.js +2 -0
  42. package/dist/dso-toolkit/p-dd21df39.entry.js.map +1 -0
  43. package/dist/dso-toolkit/p-e32f287e.entry.js +2 -0
  44. package/dist/dso-toolkit/p-e32f287e.entry.js.map +1 -0
  45. package/dist/esm/dso-advanced-select.entry.js +94 -0
  46. package/dist/esm/dso-advanced-select.entry.js.map +1 -0
  47. package/dist/esm/dso-dropdown-menu.entry.js +2 -11
  48. package/dist/esm/dso-dropdown-menu.entry.js.map +1 -1
  49. package/dist/esm/dso-modal.entry.js +13 -4
  50. package/dist/esm/dso-modal.entry.js.map +1 -1
  51. package/dist/esm/dso-toolkit.js +1 -1
  52. package/dist/esm/get-active-element-0e7dc01b.js +14 -0
  53. package/dist/esm/get-active-element-0e7dc01b.js.map +1 -0
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/types/components/advanced-select/advanced-select.d.ts +40 -0
  56. package/dist/types/components/advanced-select/advanced-select.models.d.ts +26 -0
  57. package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +0 -1
  58. package/dist/types/components/modal/modal.d.ts +10 -2
  59. package/dist/types/components.d.ts +71 -0
  60. package/dist/types/utils/get-active-element.d.ts +1 -0
  61. package/package.json +2 -2
  62. package/dist/dso-toolkit/p-92fd9516.entry.js +0 -2
  63. package/dist/dso-toolkit/p-92fd9516.entry.js.map +0 -1
  64. package/dist/dso-toolkit/p-f4cb0d36.entry.js +0 -2
  65. package/dist/dso-toolkit/p-f4cb0d36.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../../src/components/modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAS1B,MAAM,OAAO,KAAK;;kBAOP,EAAE,EAAE;;;;gBAqBS,QAAQ;2BAQZ,IAAI;;EAQtB,iBAAiB;IACf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;EACvE,CAAC;EAED,gBAAgB;;IACd,IAAI,MAAA,IAAI,CAAC,iBAAiB,0CAAE,WAAW,EAAE;MACvC,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;KACpC;IAED,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;EAChD,CAAC;EAED,oBAAoB;;IAClB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACjD,MAAA,IAAI,CAAC,iBAAiB,0CAAE,KAAK,EAAE,CAAC;EAClC,CAAC;EAED,MAAM;;IACJ,OAAO,CACL,cACE,KAAK,EAAC,WAAW,EACjB,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,SAAS,gBACjB,MAAM,qBACA,IAAI,CAAC,MAAM,EAC5B,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,EACpD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;QACd,CAAC,CAAC,cAAc,EAAE,CAAC;QAEnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;MAC3C,CAAC;MAED,WAAK,KAAK,EAAC,YAAY,EAAC,IAAI,EAAC,UAAU;QACpC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CACjB,WAAK,KAAK,EAAC,YAAY;UACrB,UAAI,EAAE,EAAE,IAAI,CAAC,MAAM,IAAG,IAAI,CAAC,UAAU,CAAM;UAC1C,IAAI,CAAC,eAAe,IAAI,CACvB,cAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,WAAW,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;YAC9F,gBAAU,IAAI,EAAC,OAAO,GAAY;YAClC,YAAM,KAAK,EAAC,SAAS,cAAe,CAC7B,CACV,CACG,CACP,CAAC,CAAC,CAAC,CACF,YAAM,KAAK,EAAC,SAAS,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,cAE9B,CACR;QAED;UACE,WAAK,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAE,CAAC;YAC/B,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACS;QAEhB,IAAI,CAAC,SAAS,IAAI,CACjB,WAAK,KAAK,EAAC,YAAY;UACrB,YAAM,IAAI,EAAC,QAAQ,GAAG,CAClB,CACP,CACG,CACC,CACV,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { h, Component, ComponentInterface, Element, Event, EventEmitter, Prop, State } from \"@stencil/core\";\r\nimport { v4 } from \"uuid\";\r\n\r\nimport { ModalCloseEvent } from \"./modal.interfaces\";\r\n\r\n@Component({\r\n tag: \"dso-modal\",\r\n styleUrl: \"modal.scss\",\r\n shadow: true,\r\n})\r\nexport class Modal implements ComponentInterface {\r\n private htmlDialogElement?: HTMLDialogElement;\r\n\r\n @Element()\r\n host!: HTMLDsoModalElement;\r\n\r\n @State()\r\n ariaId = v4();\r\n\r\n @State()\r\n hasFooter?: boolean;\r\n\r\n /**\r\n * when set the modal will be shown in fullscreen.\r\n */\r\n @Prop({ reflect: true })\r\n fullscreen?: boolean;\r\n\r\n /**\r\n * The title of the Modal.\r\n */\r\n @Prop()\r\n modalTitle?: string;\r\n\r\n /**\r\n * the role for the modal `dialog` | `alert` | `alertdialog`.\r\n */\r\n @Prop()\r\n role: string | null = \"dialog\";\r\n\r\n /**\r\n * when `false` the close button in the header will not be rendered. Defaults to `true`.\r\n *\r\n * Needs `modalTitle` to be set.\r\n */\r\n @Prop()\r\n showCloseButton = true;\r\n\r\n /**\r\n * Emitted when the user wants to close the Modal.\r\n */\r\n @Event()\r\n dsoClose!: EventEmitter<ModalCloseEvent>;\r\n\r\n componentWillLoad(): void {\r\n this.hasFooter = this.host.querySelector(\"[slot='footer']\") !== null;\r\n }\r\n\r\n componentDidLoad(): void {\r\n if (this.htmlDialogElement?.isConnected) {\r\n this.htmlDialogElement.showModal();\r\n }\r\n\r\n document.body.classList.add(\"dso-modal-open\");\r\n }\r\n\r\n disconnectedCallback(): void {\r\n document.body.classList.remove(\"dso-modal-open\");\r\n this.htmlDialogElement?.close();\r\n }\r\n\r\n render() {\r\n return (\r\n <dialog\r\n class=\"dso-modal\"\r\n role={this.role ?? undefined}\r\n aria-modal=\"true\"\r\n aria-labelledby={this.ariaId}\r\n ref={(element) => (this.htmlDialogElement = element)}\r\n onCancel={(e) => {\r\n e.preventDefault();\r\n\r\n this.dsoClose.emit({ originalEvent: e });\r\n }}\r\n >\r\n <div class=\"dso-dialog\" role=\"document\">\r\n {this.modalTitle ? (\r\n <div class=\"dso-header\">\r\n <h2 id={this.ariaId}>{this.modalTitle}</h2>\r\n {this.showCloseButton && (\r\n <button type=\"button\" class=\"dso-close\" onClick={(e) => this.dsoClose.emit({ originalEvent: e })}>\r\n <dso-icon icon=\"times\"></dso-icon>\r\n <span class=\"sr-only\">Sluiten</span>\r\n </button>\r\n )}\r\n </div>\r\n ) : (\r\n <span class=\"sr-only\" id={this.ariaId}>\r\n Dialoog\r\n </span>\r\n )}\r\n\r\n <dso-scrollable>\r\n <div class=\"dso-body\" tabIndex={0}>\r\n <slot name=\"body\" />\r\n </div>\r\n </dso-scrollable>\r\n\r\n {this.hasFooter && (\r\n <div class=\"dso-footer\">\r\n <slot name=\"footer\" />\r\n </div>\r\n )}\r\n </div>\r\n </dialog>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../../src/components/modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOlE,MAAM,OAAO,KAAK;;kBAOP,EAAE,EAAE;;;gBAkBS,QAAQ;uBAUiB,SAAS;2BAQtC,IAAI;;EAUtB,IAAI,SAAS;IACX,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;EAC7D,CAAC;EAED,gBAAgB;;IACd,IAAI,MAAA,IAAI,CAAC,iBAAiB,0CAAE,WAAW,EAAE;MACvC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;MACzC,IAAI,aAAa,YAAY,WAAW,EAAE;QACxC,IAAI,CAAC,kBAAkB,GAAG,aAAa,CAAC;OACzC;MAED,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;KACpC;IAED,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAA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,SAAS,cAAe,CAC7B,CACV,CACG,CACP,CAAC,CAAC,CAAC,CACF,YAAM,KAAK,EAAC,SAAS,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,cAE9B,CACR;QAED;UACE,WAAK,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAE,CAAC;YAC/B,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACS;QAEhB,IAAI,CAAC,SAAS,IAAI,CACjB,WAAK,KAAK,EAAC,YAAY;UACrB,YAAM,IAAI,EAAC,QAAQ,GAAG,CAClB,CACP,CACG,CACC,CACV,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { h, Component, ComponentInterface, Element, Event, EventEmitter, Prop, State } from \"@stencil/core\";\r\nimport { v4 } from \"uuid\";\r\n\r\nimport { ModalCloseEvent } from \"./modal.interfaces\";\r\nimport { getActiveElement } from \"../../utils/get-active-element\";\r\n\r\n@Component({\r\n tag: \"dso-modal\",\r\n styleUrl: \"modal.scss\",\r\n shadow: true,\r\n})\r\nexport class Modal implements ComponentInterface {\r\n private htmlDialogElement?: HTMLDialogElement;\r\n\r\n @Element()\r\n host!: HTMLDsoModalElement;\r\n\r\n @State()\r\n ariaId = v4();\r\n\r\n /**\r\n * when set the modal will be shown in fullscreen.\r\n */\r\n @Prop({ reflect: true })\r\n fullscreen?: boolean;\r\n\r\n /**\r\n * The title of the Modal.\r\n */\r\n @Prop()\r\n modalTitle?: string;\r\n\r\n /**\r\n * the role for the modal `dialog` | `alert` | `alertdialog`.\r\n */\r\n @Prop()\r\n role: string | null = \"dialog\";\r\n\r\n /**\r\n * The element to return focus to after the modal is closed.\r\n *\r\n * * `undefined` will return focus to the previously focused element (default).\r\n * * `false` will not return focus to any element.\r\n * * or, provide your own `HTMLElement` that will receive focus upon closing.\r\n */\r\n @Prop()\r\n returnFocus: false | HTMLElement | undefined = undefined;\r\n\r\n /**\r\n * when `false` the close button in the header will not be rendered. Defaults to `true`.\r\n *\r\n * Needs `modalTitle` to be set.\r\n */\r\n @Prop()\r\n showCloseButton = true;\r\n\r\n private returnFocusElement: HTMLElement | undefined;\r\n\r\n /**\r\n * Emitted when the user wants to close the Modal.\r\n */\r\n @Event()\r\n dsoClose!: EventEmitter<ModalCloseEvent>;\r\n\r\n get hasFooter() {\r\n return this.host.querySelector(\"[slot='footer']\") !== null;\r\n }\r\n\r\n componentDidLoad(): void {\r\n if (this.htmlDialogElement?.isConnected) {\r\n const activeElement = getActiveElement();\r\n if (activeElement instanceof HTMLElement) {\r\n this.returnFocusElement = activeElement;\r\n }\r\n\r\n this.htmlDialogElement.showModal();\r\n }\r\n\r\n document.body.classList.add(\"dso-modal-open\");\r\n }\r\n\r\n disconnectedCallback(): void {\r\n document.body.classList.remove(\"dso-modal-open\");\r\n this.htmlDialogElement?.close();\r\n\r\n if (this.returnFocus === false) {\r\n return;\r\n }\r\n\r\n (this.returnFocus ?? this.returnFocusElement)?.focus();\r\n }\r\n\r\n render() {\r\n return (\r\n <dialog\r\n class=\"dso-modal\"\r\n role={this.role ?? undefined}\r\n aria-modal=\"true\"\r\n aria-labelledby={this.ariaId}\r\n ref={(element) => (this.htmlDialogElement = element)}\r\n onCancel={(e) => {\r\n e.preventDefault();\r\n\r\n this.dsoClose.emit({ originalEvent: e });\r\n }}\r\n >\r\n <div class=\"dso-dialog\" role=\"document\">\r\n {this.modalTitle ? (\r\n <div class=\"dso-header\">\r\n <h2 id={this.ariaId}>{this.modalTitle}</h2>\r\n {this.showCloseButton && (\r\n <button type=\"button\" class=\"dso-close\" onClick={(e) => this.dsoClose.emit({ originalEvent: e })}>\r\n <dso-icon icon=\"times\"></dso-icon>\r\n <span class=\"sr-only\">Sluiten</span>\r\n </button>\r\n )}\r\n </div>\r\n ) : (\r\n <span class=\"sr-only\" id={this.ariaId}>\r\n Dialoog\r\n </span>\r\n )}\r\n\r\n <dso-scrollable>\r\n <div class=\"dso-body\" tabIndex={0}>\r\n <slot name=\"body\" />\r\n </div>\r\n </dso-scrollable>\r\n\r\n {this.hasFooter && (\r\n <div class=\"dso-footer\">\r\n <slot name=\"footer\" />\r\n </div>\r\n )}\r\n </div>\r\n </dialog>\r\n );\r\n }\r\n}\r\n"]}
@@ -0,0 +1,11 @@
1
+ export function getActiveElement({ activeElement } = document) {
2
+ var _a;
3
+ if (!activeElement) {
4
+ return null;
5
+ }
6
+ if (activeElement.shadowRoot) {
7
+ return (_a = getActiveElement(activeElement.shadowRoot)) !== null && _a !== void 0 ? _a : activeElement;
8
+ }
9
+ return activeElement;
10
+ }
11
+ //# sourceMappingURL=get-active-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-active-element.js","sourceRoot":"","sources":["../../../src/utils/get-active-element.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,EAAE,aAAa,KAA2B,QAAQ;;EACjF,IAAI,CAAC,aAAa,EAAE;IAClB,OAAO,IAAI,CAAC;GACb;EAED,IAAI,aAAa,CAAC,UAAU,EAAE;IAC5B,OAAO,MAAA,gBAAgB,CAAC,aAAa,CAAC,UAAU,CAAC,mCAAI,aAAa,CAAC;GACpE;EAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["export function getActiveElement({ activeElement }: DocumentOrShadowRoot = document): Element | null {\r\n if (!activeElement) {\r\n return null;\r\n }\r\n\r\n if (activeElement.shadowRoot) {\r\n return getActiveElement(activeElement.shadowRoot) ?? activeElement;\r\n }\r\n\r\n return activeElement;\r\n}\r\n"]}
@@ -1,5 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { c as createFocusTrap, t as tabbable } from './focus-trap.esm.js';
3
+ import { g as getActiveElement } from './get-active-element.js';
3
4
  import { h as hasOverflow, c as createPopper } from './has-overflow.js';
4
5
  import { v as v4 } from './v4.js';
5
6
 
@@ -213,20 +214,10 @@ const DropdownMenu = /*@__PURE__*/ proxyCustomElement(class DropdownMenu extends
213
214
  var _a;
214
215
  (_a = this.popper) === null || _a === void 0 ? void 0 : _a.destroy();
215
216
  }
216
- getActiveElement(root = document) {
217
- const activeEl = root.activeElement;
218
- if (!activeEl) {
219
- return null;
220
- }
221
- if (activeEl.shadowRoot) {
222
- return this.getActiveElement(activeEl.shadowRoot);
223
- }
224
- return activeEl;
225
- }
226
217
  tabInPopup(direction) {
227
218
  var _a;
228
219
  const tabs = this.tabbables;
229
- const currentIndex = tabs.findIndex((e) => e === this.getActiveElement());
220
+ const currentIndex = tabs.findIndex((e) => e === getActiveElement());
230
221
  let nextIndex = currentIndex + direction;
231
222
  if (nextIndex >= tabs.length) {
232
223
  nextIndex = 0;
@@ -1 +1 @@
1
- {"file":"dropdown-menu.js","mappings":";;;;;AAAA,MAAM,eAAe,GAAG,wDAAwD;;MCanE,YAAY;;;;;IA2Pf,oBAAe,GAAG,CAAC,KAAoB;MAC7C,IAAI,KAAK,CAAC,gBAAgB,EAAE;QAC1B,OAAO;OACR;MAED,QAAQ,KAAK,CAAC,GAAG;QACf,KAAK,WAAW;UACd,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;UACnB,MAAM;QAER,KAAK,SAAS;UACZ,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;UACpB,MAAM;QAER,KAAK,QAAQ;UACX,IAAI,CAAC,MAAM,EAAE,CAAC;UACd,MAAM;QAER,KAAK,GAAG;UACN,IAAI,KAAK,CAAC,MAAM,YAAY,WAAW,EAAE;YACvC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;WACtB;UAED,MAAM;QAER;UACE,OAAO;OACV;MAED,KAAK,CAAC,cAAc,EAAE,CAAC;KACxB,CAAC;IA8BM,WAAM,GAAG;MACf,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,C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C,SAAiB;;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;IAC5B,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE1E,IAAI,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;IACzC,IAAI,SAAS,IAAI,IAAI,CAAC,MAAM,EAAE;MAC5B,SAAS,GAAG,CAAC,CAAC;KACf;SAAM,IAAI,SAAS,GAAG,CAAC,EAAE;MACxB,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;KAC7B;IAED,MAAA,IAAI,CAAC,SAAS,CAAC,0CAAE,KAAK,EAAE,CAAC;GAC1B;EAOD,MAAM;IACJ,QACE,EAAC,IAAI,IAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,IAC1C,YAAM,IAAI,EAAC,QAAQ,GAAG,EACtB,WAAK,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,IACrB,eAAQ,CACJ,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["uuidv4"],"sources":["src/components/dropdown-menu/dropdown-menu.scss?tag=dso-dropdown-menu&encapsulation=shadow","src/components/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/components/dropdown-menu\";\r\n\r\n:host(:focus) {\r\n outline: none;\r\n}\r\n\r\n:host {\r\n @include dropdown-menu.root();\r\n}\r\n","import { createPopper, Placement, Instance as PopperInstance } from \"@popperjs/core\";\r\nimport { h, Component, Element, Host, Prop, Watch } from \"@stencil/core\";\r\nimport { FocusableElement, tabbable } from \"tabbable\";\r\nimport { v4 as uuidv4 } from \"uuid\";\r\n\r\nimport { hasOverflow } from \"../../utils/has-overflow\";\r\nimport { createFocusTrap, FocusTrap } from \"focus-trap\";\r\n\r\n@Component({\r\n tag: \"dso-dropdown-menu\",\r\n styleUrl: \"dropdown-menu.scss\",\r\n shadow: true,\r\n})\r\nexport class DropdownMenu {\r\n private trap?: FocusTrap;\r\n /**\r\n * Whether the menu is open or closed.\r\n * This attribute is reflected and mutable.\r\n */\r\n @Prop({ reflect: true, mutable: true })\r\n open = false;\r\n\r\n /**\r\n * Alignment of the dropdown\r\n */\r\n @Prop()\r\n dropdownAlign: \"left\" | \"right\" = \"left\";\r\n\r\n /**\r\n * Space between button and dropdown options\r\n */\r\n @Prop()\r\n dropdownOptionsOffset = 2;\r\n\r\n /**\r\n * Whether the menu is checkable.\r\n */\r\n @Prop()\r\n checkable = false;\r\n\r\n /**\r\n * Selector for the element the dropdown options should not be overflowing.\r\n */\r\n @Prop()\r\n boundary?: string;\r\n\r\n /**\r\n * Force placement of dropdown.\r\n *\r\n * This property overrides `dropdownAlign`.\r\n */\r\n @Prop()\r\n placement?: Placement;\r\n\r\n /**\r\n * Set position strategy of dropdown options\r\n */\r\n @Prop()\r\n strategy: \"auto\" | \"absolute\" | \"fixed\" = \"auto\";\r\n\r\n @Watch(\"placement\")\r\n @Watch(\"dropdownAlign\")\r\n watchPosition() {\r\n if (!this.popper) {\r\n return;\r\n }\r\n\r\n this.popper.setOptions({\r\n placement: this.placement || (this.dropdownAlign === \"right\" ? \"bottom-end\" : \"bottom-start\"),\r\n });\r\n }\r\n\r\n @Watch(\"dropdownOptionsOffset\")\r\n watchOptionsOffset() {\r\n this.popper?.setOptions({\r\n modifiers: [\r\n {\r\n name: \"offset\",\r\n options: {\r\n offset: [0, this.dropdownOptionsOffset],\r\n },\r\n },\r\n ],\r\n });\r\n }\r\n\r\n @Watch(\"strategy\")\r\n watchStrategy() {\r\n this.setStrategy();\r\n }\r\n\r\n private createTrap() {\r\n this.trap = createFocusTrap(this.host, {\r\n clickOutsideDeactivates: () => {\r\n this.open = false;\r\n this.trap?.deactivate();\r\n delete this.trap;\r\n\r\n return true;\r\n },\r\n escapeDeactivates: (event) => {\r\n if (event instanceof KeyboardEvent) {\r\n this.open = false;\r\n this.trap?.deactivate();\r\n delete this.trap;\r\n }\r\n\r\n return true;\r\n },\r\n tabbableOptions: {\r\n getShadowRoot: true,\r\n },\r\n setReturnFocus: this.button ?? false,\r\n initialFocus: this.button ?? false,\r\n }).activate();\r\n }\r\n\r\n private setStrategy() {\r\n if (!this.popper) {\r\n return;\r\n }\r\n\r\n if (this.strategy === \"absolute\" || this.strategy === \"fixed\") {\r\n this.popper.setOptions({\r\n strategy: this.strategy,\r\n });\r\n\r\n return;\r\n }\r\n\r\n let element: Element | null = this.host;\r\n\r\n const boundary = this.boundary || document;\r\n\r\n while (element && element.parentNode !== boundary) {\r\n element = element.parentNode instanceof ShadowRoot ? element.parentNode.host : element.parentElement;\r\n if (element !== null && hasOverflow(element)) {\r\n this.popper.setOptions({\r\n strategy: \"fixed\",\r\n });\r\n\r\n return;\r\n }\r\n }\r\n\r\n this.popper.setOptions({\r\n strategy: \"absolute\",\r\n });\r\n }\r\n\r\n @Element()\r\n host!: HTMLDsoDropdownMenuElement;\r\n\r\n private popper: PopperInstance | undefined;\r\n\r\n get button(): HTMLButtonElement {\r\n const button = this.host.querySelector('button[slot=\"toggle\"]');\r\n\r\n if (!(button instanceof HTMLButtonElement)) {\r\n throw new ReferenceError(\"Mandatory toggle button not found\");\r\n }\r\n\r\n return button;\r\n }\r\n\r\n get tabbables(): FocusableElement[] {\r\n return tabbable(this.host).filter((e) => e !== this.button);\r\n }\r\n\r\n componentDidLoad() {\r\n this.button.setAttribute(\"aria-haspopup\", \"menu\");\r\n this.button.setAttribute(\"aria-expanded\", \"false\");\r\n if (!this.button.id) {\r\n this.button.id = uuidv4();\r\n }\r\n\r\n this.button.addEventListener(\"click\", () => {\r\n this.open = !this.open;\r\n });\r\n\r\n const options = this.host.querySelector(\".dso-dropdown-options\");\r\n if (!options) {\r\n throw new ReferenceError(\"Dropdown options not found\");\r\n }\r\n\r\n options.setAttribute(\"role\", \"menu\");\r\n options.setAttribute(\"aria-labelledby\", this.button.id);\r\n\r\n for (const ul of Array.from(this.host.getElementsByTagName(\"ul\"))) {\r\n ul.setAttribute(\"role\", \"group\");\r\n for (const li of Array.from(ul.getElementsByTagName(\"li\"))) {\r\n li.setAttribute(\"role\", \"none\");\r\n }\r\n }\r\n\r\n if (this.popper) {\r\n return;\r\n }\r\n\r\n const dropdownOptionsElement = this.host.querySelector(\".dso-dropdown-options\");\r\n\r\n if (!(dropdownOptionsElement instanceof HTMLElement)) {\r\n throw new Error(\"dropdown options element is not instanceof HTMLElement\");\r\n }\r\n\r\n this.popper = createPopper(this.button, dropdownOptionsElement, {\r\n placement: this.placement || (this.dropdownAlign === \"right\" ? \"bottom-end\" : \"bottom-start\"),\r\n modifiers: [\r\n {\r\n name: \"offset\",\r\n options: {\r\n offset: [0, this.dropdownOptionsOffset],\r\n },\r\n },\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: this.boundary ? document.querySelector(this.boundary) : null,\r\n },\r\n enabled: this.boundary !== undefined,\r\n },\r\n ],\r\n });\r\n }\r\n\r\n componentDidRender() {\r\n this.setStrategy();\r\n if (this.open) {\r\n this.popper?.update();\r\n this.createTrap();\r\n } else {\r\n this.trap?.deactivate();\r\n\r\n delete this.trap;\r\n }\r\n\r\n for (const li of Array.from(this.host.getElementsByTagName(\"li\"))) {\r\n for (const tab of tabbable(li)) {\r\n tab.setAttribute(\"role\", this.checkable ? \"menuitemradio\" : \"menuitem\");\r\n\r\n if (this.checkable) {\r\n tab.setAttribute(\"aria-checked\", li.classList.contains(\"dso-checked\").toString());\r\n }\r\n }\r\n }\r\n\r\n this.host.removeEventListener(\"keydown\", this.keyDownListener);\r\n this.button.setAttribute(\"aria-expanded\", this.open ? \"true\" : \"false\");\r\n if (this.open) {\r\n this.host.addEventListener(\"keydown\", this.keyDownListener);\r\n }\r\n\r\n this.tabbables.forEach((focusableElement) => {\r\n focusableElement.removeEventListener(\"click\", this.escape);\r\n if (this.open) {\r\n focusableElement.addEventListener(\"click\", this.escape);\r\n }\r\n });\r\n }\r\n\r\n disconnectedCallback() {\r\n this.popper?.destroy();\r\n }\r\n\r\n private keyDownListener = (event: KeyboardEvent) => {\r\n if (event.defaultPrevented) {\r\n return;\r\n }\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n this.tabInPopup(1);\r\n break;\r\n\r\n case \"ArrowUp\":\r\n this.tabInPopup(-1);\r\n break;\r\n\r\n case \"Escape\":\r\n this.escape();\r\n break;\r\n\r\n case \" \":\r\n if (event.target instanceof HTMLElement) {\r\n event.target.click();\r\n }\r\n\r\n break;\r\n\r\n default:\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n };\r\n\r\n private getActiveElement(root: Document | ShadowRoot = document): Element | null {\r\n const activeEl = root.activeElement;\r\n\r\n if (!activeEl) {\r\n return null;\r\n }\r\n\r\n if (activeEl.shadowRoot) {\r\n return this.getActiveElement(activeEl.shadowRoot);\r\n }\r\n\r\n return activeEl;\r\n }\r\n\r\n private tabInPopup(direction: number) {\r\n const tabs = this.tabbables;\r\n const currentIndex = tabs.findIndex((e) => e === this.getActiveElement());\r\n\r\n let nextIndex = currentIndex + direction;\r\n if (nextIndex >= tabs.length) {\r\n nextIndex = 0;\r\n } else if (nextIndex < 0) {\r\n nextIndex = tabs.length - 1;\r\n }\r\n\r\n tabs[nextIndex]?.focus();\r\n }\r\n\r\n private escape = () => {\r\n this.button.focus();\r\n this.open = false;\r\n };\r\n\r\n render() {\r\n return (\r\n <Host tabindex={this.open ? \"-1\" : undefined}>\r\n <slot name=\"toggle\" />\r\n <div hidden={!this.open}>\r\n <slot />\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"],"version":3}
1
+ {"file":"dropdown-menu.js","mappings":";;;;;;AAAA,MAAM,eAAe,GAAG,wDAAwD;;MCcnE,YAAY;;;;;IA2Pf,oBAAe,GAAG,CAAC,KAAoB;MAC7C,IAAI,KAAK,CAAC,gBAAgB,EAAE;QAC1B,OAAO;OACR;MAED,QAAQ,KAAK,C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AAE;QACb,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;OACzD;KACF,CAAC,CAAC;GACJ;EAED,oBAAoB;;IAClB,MAAA,IAAI,CAAC,MAAM,0CAAE,OAAO,EAAE,CAAC;GACxB;EAkCO,UAAU,CAAC,SAAiB;;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;IAC5B,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,gBAAgB,EAAE,CAAC,CAAC;IAErE,IAAI,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;IACzC,IAAI,SAAS,IAAI,IAAI,CAAC,MAAM,EAAE;MAC5B,SAAS,GAAG,CAAC,CAAC;KACf;SAAM,IAAI,SAAS,GAAG,CAAC,EAAE;MACxB,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;KAC7B;IAED,MAAA,IAAI,CAAC,SAAS,CAAC,0CAAE,KAAK,EAAE,CAAC;GAC1B;EAOD,MAAM;IACJ,QACE,EAAC,IAAI,IAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,IAC1C,YAAM,IAAI,EAAC,QAAQ,GAAG,EACtB,WAAK,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,IACrB,eAAQ,CACJ,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["uuidv4"],"sources":["src/components/dropdown-menu/dropdown-menu.scss?tag=dso-dropdown-menu&encapsulation=shadow","src/components/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/components/dropdown-menu\";\r\n\r\n:host(:focus) {\r\n outline: none;\r\n}\r\n\r\n:host {\r\n @include dropdown-menu.root();\r\n}\r\n","import { createPopper, Placement, Instance as PopperInstance } from \"@popperjs/core\";\r\nimport { h, Component, Element, Host, Prop, Watch } from \"@stencil/core\";\r\nimport { FocusableElement, tabbable } from \"tabbable\";\r\nimport { v4 as uuidv4 } from \"uuid\";\r\nimport { createFocusTrap, FocusTrap } from \"focus-trap\";\r\n\r\nimport { getActiveElement } from \"../../utils/get-active-element\";\r\nimport { hasOverflow } from \"../../utils/has-overflow\";\r\n\r\n@Component({\r\n tag: \"dso-dropdown-menu\",\r\n styleUrl: \"dropdown-menu.scss\",\r\n shadow: true,\r\n})\r\nexport class DropdownMenu {\r\n private trap?: FocusTrap;\r\n /**\r\n * Whether the menu is open or closed.\r\n * This attribute is reflected and mutable.\r\n */\r\n @Prop({ reflect: true, mutable: true })\r\n open = false;\r\n\r\n /**\r\n * Alignment of the dropdown\r\n */\r\n @Prop()\r\n dropdownAlign: \"left\" | \"right\" = \"left\";\r\n\r\n /**\r\n * Space between button and dropdown options\r\n */\r\n @Prop()\r\n dropdownOptionsOffset = 2;\r\n\r\n /**\r\n * Whether the menu is checkable.\r\n */\r\n @Prop()\r\n checkable = false;\r\n\r\n /**\r\n * Selector for the element the dropdown options should not be overflowing.\r\n */\r\n @Prop()\r\n boundary?: string;\r\n\r\n /**\r\n * Force placement of dropdown.\r\n *\r\n * This property overrides `dropdownAlign`.\r\n */\r\n @Prop()\r\n placement?: Placement;\r\n\r\n /**\r\n * Set position strategy of dropdown options\r\n */\r\n @Prop()\r\n strategy: \"auto\" | \"absolute\" | \"fixed\" = \"auto\";\r\n\r\n @Watch(\"placement\")\r\n @Watch(\"dropdownAlign\")\r\n watchPosition() {\r\n if (!this.popper) {\r\n return;\r\n }\r\n\r\n this.popper.setOptions({\r\n placement: this.placement || (this.dropdownAlign === \"right\" ? \"bottom-end\" : \"bottom-start\"),\r\n });\r\n }\r\n\r\n @Watch(\"dropdownOptionsOffset\")\r\n watchOptionsOffset() {\r\n this.popper?.setOptions({\r\n modifiers: [\r\n {\r\n name: \"offset\",\r\n options: {\r\n offset: [0, this.dropdownOptionsOffset],\r\n },\r\n },\r\n ],\r\n });\r\n }\r\n\r\n @Watch(\"strategy\")\r\n watchStrategy() {\r\n this.setStrategy();\r\n }\r\n\r\n private createTrap() {\r\n this.trap = createFocusTrap(this.host, {\r\n clickOutsideDeactivates: () => {\r\n this.open = false;\r\n this.trap?.deactivate();\r\n delete this.trap;\r\n\r\n return true;\r\n },\r\n escapeDeactivates: (event) => {\r\n if (event instanceof KeyboardEvent) {\r\n this.open = false;\r\n this.trap?.deactivate();\r\n delete this.trap;\r\n }\r\n\r\n return true;\r\n },\r\n tabbableOptions: {\r\n getShadowRoot: true,\r\n },\r\n setReturnFocus: this.button ?? false,\r\n initialFocus: this.button ?? false,\r\n }).activate();\r\n }\r\n\r\n private setStrategy() {\r\n if (!this.popper) {\r\n return;\r\n }\r\n\r\n if (this.strategy === \"absolute\" || this.strategy === \"fixed\") {\r\n this.popper.setOptions({\r\n strategy: this.strategy,\r\n });\r\n\r\n return;\r\n }\r\n\r\n let element: Element | null = this.host;\r\n\r\n const boundary = this.boundary || document;\r\n\r\n while (element && element.parentNode !== boundary) {\r\n element = element.parentNode instanceof ShadowRoot ? element.parentNode.host : element.parentElement;\r\n if (element !== null && hasOverflow(element)) {\r\n this.popper.setOptions({\r\n strategy: \"fixed\",\r\n });\r\n\r\n return;\r\n }\r\n }\r\n\r\n this.popper.setOptions({\r\n strategy: \"absolute\",\r\n });\r\n }\r\n\r\n @Element()\r\n host!: HTMLDsoDropdownMenuElement;\r\n\r\n private popper: PopperInstance | undefined;\r\n\r\n get button(): HTMLButtonElement {\r\n const button = this.host.querySelector('button[slot=\"toggle\"]');\r\n\r\n if (!(button instanceof HTMLButtonElement)) {\r\n throw new ReferenceError(\"Mandatory toggle button not found\");\r\n }\r\n\r\n return button;\r\n }\r\n\r\n get tabbables(): FocusableElement[] {\r\n return tabbable(this.host).filter((e) => e !== this.button);\r\n }\r\n\r\n componentDidLoad() {\r\n this.button.setAttribute(\"aria-haspopup\", \"menu\");\r\n this.button.setAttribute(\"aria-expanded\", \"false\");\r\n if (!this.button.id) {\r\n this.button.id = uuidv4();\r\n }\r\n\r\n this.button.addEventListener(\"click\", () => {\r\n this.open = !this.open;\r\n });\r\n\r\n const options = this.host.querySelector(\".dso-dropdown-options\");\r\n if (!options) {\r\n throw new ReferenceError(\"Dropdown options not found\");\r\n }\r\n\r\n options.setAttribute(\"role\", \"menu\");\r\n options.setAttribute(\"aria-labelledby\", this.button.id);\r\n\r\n for (const ul of Array.from(this.host.getElementsByTagName(\"ul\"))) {\r\n ul.setAttribute(\"role\", \"group\");\r\n for (const li of Array.from(ul.getElementsByTagName(\"li\"))) {\r\n li.setAttribute(\"role\", \"none\");\r\n }\r\n }\r\n\r\n if (this.popper) {\r\n return;\r\n }\r\n\r\n const dropdownOptionsElement = this.host.querySelector(\".dso-dropdown-options\");\r\n\r\n if (!(dropdownOptionsElement instanceof HTMLElement)) {\r\n throw new Error(\"dropdown options element is not instanceof HTMLElement\");\r\n }\r\n\r\n this.popper = createPopper(this.button, dropdownOptionsElement, {\r\n placement: this.placement || (this.dropdownAlign === \"right\" ? \"bottom-end\" : \"bottom-start\"),\r\n modifiers: [\r\n {\r\n name: \"offset\",\r\n options: {\r\n offset: [0, this.dropdownOptionsOffset],\r\n },\r\n },\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: this.boundary ? document.querySelector(this.boundary) : null,\r\n },\r\n enabled: this.boundary !== undefined,\r\n },\r\n ],\r\n });\r\n }\r\n\r\n componentDidRender() {\r\n this.setStrategy();\r\n if (this.open) {\r\n this.popper?.update();\r\n this.createTrap();\r\n } else {\r\n this.trap?.deactivate();\r\n\r\n delete this.trap;\r\n }\r\n\r\n for (const li of Array.from(this.host.getElementsByTagName(\"li\"))) {\r\n for (const tab of tabbable(li)) {\r\n tab.setAttribute(\"role\", this.checkable ? \"menuitemradio\" : \"menuitem\");\r\n\r\n if (this.checkable) {\r\n tab.setAttribute(\"aria-checked\", li.classList.contains(\"dso-checked\").toString());\r\n }\r\n }\r\n }\r\n\r\n this.host.removeEventListener(\"keydown\", this.keyDownListener);\r\n this.button.setAttribute(\"aria-expanded\", this.open ? \"true\" : \"false\");\r\n if (this.open) {\r\n this.host.addEventListener(\"keydown\", this.keyDownListener);\r\n }\r\n\r\n this.tabbables.forEach((focusableElement) => {\r\n focusableElement.removeEventListener(\"click\", this.escape);\r\n if (this.open) {\r\n focusableElement.addEventListener(\"click\", this.escape);\r\n }\r\n });\r\n }\r\n\r\n disconnectedCallback() {\r\n this.popper?.destroy();\r\n }\r\n\r\n private keyDownListener = (event: KeyboardEvent) => {\r\n if (event.defaultPrevented) {\r\n return;\r\n }\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n this.tabInPopup(1);\r\n break;\r\n\r\n case \"ArrowUp\":\r\n this.tabInPopup(-1);\r\n break;\r\n\r\n case \"Escape\":\r\n this.escape();\r\n break;\r\n\r\n case \" \":\r\n if (event.target instanceof HTMLElement) {\r\n event.target.click();\r\n }\r\n\r\n break;\r\n\r\n default:\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n };\r\n\r\n private tabInPopup(direction: number) {\r\n const tabs = this.tabbables;\r\n const currentIndex = tabs.findIndex((e) => e === getActiveElement());\r\n\r\n let nextIndex = currentIndex + direction;\r\n if (nextIndex >= tabs.length) {\r\n nextIndex = 0;\r\n } else if (nextIndex < 0) {\r\n nextIndex = tabs.length - 1;\r\n }\r\n\r\n tabs[nextIndex]?.focus();\r\n }\r\n\r\n private escape = () => {\r\n this.button.focus();\r\n this.open = false;\r\n };\r\n\r\n render() {\r\n return (\r\n <Host tabindex={this.open ? \"-1\" : undefined}>\r\n <slot name=\"toggle\" />\r\n <div hidden={!this.open}>\r\n <slot />\r\n </div>\r\n </Host>\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 DsoAdvancedSelect extends Components.DsoAdvancedSelect, HTMLElement {}
4
+ export const DsoAdvancedSelect: {
5
+ prototype: DsoAdvancedSelect;
6
+ new (): DsoAdvancedSelect;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,129 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
2
+ import { c as clsx } from './clsx.js';
3
+ import { c as createFocusTrap, t as tabbable } from './focus-trap.esm.js';
4
+ import { i as isModifiedEvent } from './is-modified-event.js';
5
+ import { d as defineCustomElement$3 } from './badge.js';
6
+ import { d as defineCustomElement$2 } from './icon.js';
7
+
8
+ const advancedSelectCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.active-option{display:flex;inline-size:100%;justify-content:space-between;align-items:center;padding:0;border:1px solid #275937;border-radius:4px;cursor:pointer;background-color:#fff;line-height:inherit;font-family:inherit;font-size:inherit}.active-option.open{border-radius:4px 4px 0 0}.active-option dso-icon{color:#275937}.active-option-label{padding:4px 16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.active-option-aside{display:flex;align-items:center;gap:8px;padding:0 8px}.badges{display:flex;justify-content:space-between;align-items:center;gap:4px}.groups-container{position:relative}.groups{position:absolute;inset-block-start:-1px;inset-inline-start:0;inline-size:100%;max-block-size:500px;margin:0;padding:0;overflow-y:auto;background-color:#fff;border:1px solid #275937;border-radius:0 0 4px 4px}.groups li::marker{display:none}.group{border-bottom:1px solid #ccc}.group:last-child{border-bottom:none}.group .option{padding-left:37px}.group .option-label::before{content:\"\";position:absolute;display:block;block-size:10px;inline-size:10px;inset:4px auto auto -20px;border-radius:50%;background-color:#ccc;border-color:#ccc;color:#191919}.group-label{margin:0;padding:4px 16px;color:#666;font-size:14px;font-weight:500;border-bottom:1px solid #ccc}.group-link{display:block;padding:8px 4px;text-align:end;color:#000;text-decoration:none}.group-link:hover{text-decoration:underline}.group-link dso-icon{color:#39870c}.group-info .option-label::before{background-color:#6ca4d9;border-color:#6ca4d9;color:#191919}.group-primary .option-label::before{background-color:#275937;border-color:#275937;color:#fff}.group-success .option-label::before{background-color:#39870c;border-color:#39870c;color:#fff}.group-warning .option-label::before{background-color:#dcd400;border-color:#dcd400;color:#191919}.group-danger .option-label::before{background-color:#ce3f51;border-color:#ce3f51;color:#fff}.group-error .option-label::before{background-color:#ce3f51;border-color:#ce3f51;color:#fff}.group-attention .option-label::before{background-color:#8b4a6a;border-color:#8b4a6a;color:#fff}.options{margin:0;padding:0}.option{display:block;inline-size:100%;padding:8px 16px;cursor:pointer;line-height:inherit;font-family:inherit;font-size:inherit;border:none;text-align:left;background-color:#fff}.option:hover{background-color:#ebf3e6}.option:hover .option-label{color:#39870c;font-weight:bold}.option.option-active .option-label{color:#39870c;font-weight:bold;text-decoration:underline}.option-label{position:relative;color:#000;font-size:Asap, sans-serif;font-weight:400}.option-hint{padding-left:5px;color:#39870c;font-size:Asap, sans-serif;font-weight:bold}";
9
+
10
+ const AdvancedSelect = /*@__PURE__*/ proxyCustomElement(class AdvancedSelect extends HTMLElement {
11
+ constructor() {
12
+ super();
13
+ this.__registerHost();
14
+ this.__attachShadow();
15
+ this.dsoChange = createEvent(this, "dsoChange", 3);
16
+ this.dsoRedirect = createEvent(this, "dsoRedirect", 3);
17
+ this.toggleOpen = () => {
18
+ this.open = !this.open;
19
+ };
20
+ this.handleOptionClick = (event, option) => {
21
+ this.dsoChange.emit({ originalEvent: event, option });
22
+ this.open = false;
23
+ };
24
+ this.handleRedirectClick = (event, redirect) => {
25
+ this.dsoRedirect.emit({ originalEvent: event, isModifiedEvent: isModifiedEvent(event), redirect });
26
+ this.open = false;
27
+ };
28
+ this.options = [];
29
+ this.active = undefined;
30
+ this.activeHint = undefined;
31
+ this.open = false;
32
+ }
33
+ keyDownListener(event) {
34
+ if (this.open && event.key === "ArrowUp") {
35
+ event.preventDefault();
36
+ this.handleTab(-1);
37
+ }
38
+ else if (this.open && event.key === "ArrowDown") {
39
+ event.preventDefault();
40
+ this.handleTab(1);
41
+ }
42
+ }
43
+ componentDidRender() {
44
+ if (this.open && !this.trap) {
45
+ this.createTrap();
46
+ }
47
+ else if (!this.open && this.trap) {
48
+ this.removeTrap();
49
+ }
50
+ }
51
+ createTrap() {
52
+ this.trap = createFocusTrap(this.host, {
53
+ clickOutsideDeactivates: true,
54
+ escapeDeactivates: true,
55
+ setReturnFocus: this.toggleButtonElementRef,
56
+ tabbableOptions: {
57
+ getShadowRoot: true,
58
+ },
59
+ onDeactivate: () => {
60
+ this.open = false;
61
+ },
62
+ }).activate();
63
+ }
64
+ removeTrap() {
65
+ var _a;
66
+ (_a = this.trap) === null || _a === void 0 ? void 0 : _a.deactivate();
67
+ delete this.trap;
68
+ }
69
+ handleTab(direction) {
70
+ var _a;
71
+ const elements = tabbable(this.host, { getShadowRoot: true });
72
+ const currentIndex = elements.findIndex((e) => { var _a; return e === ((_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement); });
73
+ let nextIndex = currentIndex + direction;
74
+ if (nextIndex >= elements.length) {
75
+ nextIndex = 0;
76
+ }
77
+ else if (nextIndex < 0) {
78
+ nextIndex = elements.length - 1;
79
+ }
80
+ (_a = elements[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus();
81
+ }
82
+ render() {
83
+ var _a, _b;
84
+ return (h(Fragment, null, h("button", { "aria-expanded": this.open.toString(), class: clsx(["active-option", { open: this.open }]), type: "button", onClick: this.toggleOpen, ref: (element) => (this.toggleButtonElementRef = element) }, h("span", { class: "active-option-label" }, (_b = (_a = this.active) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : "Selecteer een optie"), h("span", { class: "active-option-aside" }, this.options.some((optionOrGroup) => "summaryCounter" in optionOrGroup && (optionOrGroup === null || optionOrGroup === void 0 ? void 0 : optionOrGroup.summaryCounter)) && (h("span", { class: "badges" }, this.options
85
+ .filter((option) => "options" in option && "summaryCounter" in option && !!(option === null || option === void 0 ? void 0 : option.summaryCounter))
86
+ .map((group) => {
87
+ var _a;
88
+ return h("dso-badge", { status: (_a = group.variant) !== null && _a !== void 0 ? _a : "outline" }, group.options.length);
89
+ }))), h("dso-icon", { icon: "caret-down" }))), this.open && (h("div", { class: "groups-container" }, h("ul", { class: "groups" }, this.options.map((optionOrGroup) => "options" in optionOrGroup ? (h("li", { class: clsx(["group", { [`group-${optionOrGroup.variant}`]: !!optionOrGroup.variant }]) }, optionOrGroup.label && h("p", { class: "group-label" }, optionOrGroup.label), h("ul", { class: "options" }, optionOrGroup.options.map((option) => (h(OptionElement, { option: option, active: this.active, activeHint: this.activeHint, callback: this.handleOptionClick })))), optionOrGroup.redirect && (h("a", { class: "group-link", href: optionOrGroup.redirect.href, onClick: (e) => optionOrGroup.redirect && this.handleRedirectClick(e, optionOrGroup.redirect) }, optionOrGroup.redirect.label, h("dso-icon", { icon: "chevron-right" }))))) : (h(OptionElement, { option: optionOrGroup, active: this.active, activeHint: this.activeHint, callback: this.handleOptionClick }))))))));
90
+ }
91
+ get host() { return this; }
92
+ static get style() { return advancedSelectCss; }
93
+ }, [1, "dso-advanced-select", {
94
+ "options": [16],
95
+ "active": [16],
96
+ "activeHint": [1, "active-hint"],
97
+ "open": [32]
98
+ }, [[8, "keydown", "keyDownListener"]]]);
99
+ const OptionElement = ({ option, active, activeHint, callback }) => (h("li", null, h("button", { class: clsx(["option", { "option-active": active === option }]), type: "button", onClick: (e) => callback(e, option) }, h("span", { class: "option-label" }, option.label), !!activeHint && active === option && h("span", { class: "option-hint" }, "(", activeHint, ")"))));
100
+ function defineCustomElement$1() {
101
+ if (typeof customElements === "undefined") {
102
+ return;
103
+ }
104
+ const components = ["dso-advanced-select", "dso-badge", "dso-icon"];
105
+ components.forEach(tagName => { switch (tagName) {
106
+ case "dso-advanced-select":
107
+ if (!customElements.get(tagName)) {
108
+ customElements.define(tagName, AdvancedSelect);
109
+ }
110
+ break;
111
+ case "dso-badge":
112
+ if (!customElements.get(tagName)) {
113
+ defineCustomElement$3();
114
+ }
115
+ break;
116
+ case "dso-icon":
117
+ if (!customElements.get(tagName)) {
118
+ defineCustomElement$2();
119
+ }
120
+ break;
121
+ } });
122
+ }
123
+
124
+ const DsoAdvancedSelect = AdvancedSelect;
125
+ const defineCustomElement = defineCustomElement$1;
126
+
127
+ export { DsoAdvancedSelect, defineCustomElement };
128
+
129
+ //# sourceMappingURL=dso-advanced-select.js.map
@@ -0,0 +1 @@
1
+ {"file":"dso-advanced-select.js","mappings":";;;;;;;AAAA,MAAM,iBAAiB,GAAG,yrFAAyrF;;MC+BtsF,cAAc;;;;;;;IA+DjB,eAAU,GAAG;MACnB,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;KACxB,CAAC;IAmCM,sBAAiB,GAAG,CAAC,KAAiB,EAAE,MAAmC;MACjF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;MACtD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;KACnB,CAAC;IAEM,wBAAmB,GAAG,CAAC,KAAiB,EAAE,QAAqC;MACrF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;MACnG,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;KACnB,CAAC;mBAlG8C,EAAE;;;gBAkBlC,KAAK;;EAiBrB,eAAe,CAAC,KAAoB;IAClC,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE;MACxC,KAAK,CAAC,cAAc,EAAE,CAAC;MACvB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;KACpB;SAAM,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,WAAW,EAAE;MACjD,KAAK,CAAC,cAAc,EAAE,CAAC;MACvB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KACnB;GACF;EAED,kBAAkB;IAChB,IA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C,CAAC,KAAK,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,IAEnC,YAAM,KAAK,EAAC,cAAc,IAAE,MAAM,CAAC,KAAK,CAAQ,EAC/C,CAAC,CAAC,UAAU,IAAI,MAAM,KAAK,MAAM,IAAI,YAAM,KAAK,EAAC,aAAa,SAAG,UAAU,MAAS,CAC9E,CACN,CACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/advanced-select/advanced-select.scss?tag=dso-advanced-select&encapsulation=shadow","src/components/advanced-select/advanced-select.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/global/mixins/set-colors.mixin\" as set-colors;\r\n@use \"~dso-toolkit/src/components/advanced-select\";\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n\r\n.active-option {\r\n display: flex;\r\n inline-size: 100%;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 0;\r\n border: 1px solid advanced-select.$border-color;\r\n border-radius: advanced-select.$border-radius;\r\n cursor: pointer;\r\n background-color: advanced-select.$bg-color;\r\n line-height: inherit;\r\n font-family: inherit;\r\n font-size: inherit;\r\n\r\n &.open {\r\n border-radius: advanced-select.$border-radius advanced-select.$border-radius 0 0;\r\n }\r\n\r\n dso-icon {\r\n color: advanced-select.$icon-color;\r\n }\r\n}\r\n\r\n.active-option-label {\r\n padding: advanced-select.$vertical-padding advanced-select.$horizontal-padding;\r\n overflow: hidden;\r\n /* stylelint-disable-next-line declaration-property-value-disallowed-list -- Nodig om lange titels op de zelfde regel te houden */\r\n white-space: nowrap;\r\n /* stylelint-disable-next-line declaration-property-value-disallowed-list -- Nodig om lange titels op de zelfde regel te houden */\r\n text-overflow: ellipsis;\r\n}\r\n\r\n.active-option-aside {\r\n display: flex;\r\n align-items: center;\r\n gap: advanced-select.$horizontal-padding * 0.5;\r\n padding: 0 advanced-select.$horizontal-padding * 0.5;\r\n}\r\n\r\n.badges {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n gap: advanced-select.$vertical-padding;\r\n}\r\n\r\n.groups-container {\r\n position: relative;\r\n}\r\n\r\n.groups {\r\n position: absolute;\r\n inset-block-start: -1px;\r\n inset-inline-start: 0;\r\n inline-size: 100%;\r\n max-block-size: 500px;\r\n margin: 0;\r\n padding: 0;\r\n overflow-y: auto;\r\n background-color: advanced-select.$bg-color;\r\n border: 1px solid advanced-select.$border-color;\r\n border-radius: 0 0 advanced-select.$border-radius advanced-select.$border-radius;\r\n\r\n li {\r\n &::marker {\r\n display: none;\r\n }\r\n }\r\n}\r\n\r\n.group {\r\n border-bottom: 1px solid advanced-select.$hr-color;\r\n\r\n &:last-child {\r\n border-bottom: none;\r\n }\r\n\r\n .option {\r\n padding-left: advanced-select.$horizontal-padding * 2 + advanced-select.$option-dot-size * 0.5;\r\n }\r\n\r\n .option-label::before {\r\n content: \"\";\r\n position: absolute;\r\n display: block;\r\n block-size: advanced-select.$option-dot-size;\r\n inline-size: advanced-select.$option-dot-size;\r\n inset: advanced-select.$vertical-padding auto auto -#{advanced-select.$option-dot-size * 2};\r\n border-radius: 50%;\r\n @include set-colors.apply(advanced-select.$default-variant-color, $icons: false, $links: false);\r\n }\r\n}\r\n\r\n.group-label {\r\n margin: 0;\r\n padding: advanced-select.$vertical-padding advanced-select.$horizontal-padding;\r\n color: advanced-select.$group-label-color;\r\n font-size: advanced-select.$group-label-font-size;\r\n font-weight: advanced-select.$group-label-font-weight;\r\n border-bottom: 1px solid advanced-select.$hr-color;\r\n}\r\n\r\n.group-link {\r\n display: block;\r\n padding: advanced-select.$group-link-horizontal-padding advanced-select.$group-link-vertical-padding;\r\n text-align: end;\r\n color: advanced-select.$group-link-color;\r\n text-decoration: none;\r\n\r\n &:hover {\r\n text-decoration: underline;\r\n }\r\n\r\n dso-icon {\r\n color: advanced-select.$redirect-icon-color;\r\n }\r\n}\r\n\r\n.group-info .option-label::before {\r\n @include set-colors.apply(advanced-select.$info-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-primary .option-label::before {\r\n @include set-colors.apply(advanced-select.$primary-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-success .option-label::before {\r\n @include set-colors.apply(advanced-select.$success-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-warning .option-label::before {\r\n @include set-colors.apply(advanced-select.$warning-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-danger .option-label::before {\r\n @include set-colors.apply(advanced-select.$danger-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-error .option-label::before {\r\n @include set-colors.apply(advanced-select.$error-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.group-attention .option-label::before {\r\n @include set-colors.apply(advanced-select.$attention-variant-color, $icons: false, $links: false);\r\n}\r\n\r\n.options {\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n.option {\r\n display: block;\r\n inline-size: 100%;\r\n padding: advanced-select.$vertical-padding * 2 advanced-select.$horizontal-padding;\r\n cursor: pointer;\r\n line-height: inherit;\r\n font-family: inherit;\r\n font-size: inherit;\r\n border: none;\r\n text-align: left;\r\n background-color: advanced-select.$bg-color;\r\n\r\n &:hover {\r\n background-color: advanced-select.$option-hover-bg-color;\r\n\r\n .option-label {\r\n color: advanced-select.$option-hover-color;\r\n font-weight: advanced-select.$option-hover-font-weight;\r\n }\r\n }\r\n}\r\n\r\n.option.option-active .option-label {\r\n color: advanced-select.$option-active-color;\r\n font-weight: advanced-select.$option-active-font-weight;\r\n text-decoration: underline;\r\n}\r\n\r\n.option-label {\r\n position: relative;\r\n color: advanced-select.$option-color;\r\n font-size: advanced-select.$option-font-size;\r\n font-weight: advanced-select.$option-font-weight;\r\n}\r\n\r\n.option-hint {\r\n padding-left: 5px;\r\n color: advanced-select.$option-active-color;\r\n font-size: advanced-select.$option-font-size;\r\n font-weight: advanced-select.$option-active-font-weight;\r\n}\r\n","import {\r\n Component,\r\n ComponentInterface,\r\n Prop,\r\n h,\r\n FunctionalComponent,\r\n Element,\r\n Event,\r\n EventEmitter,\r\n State,\r\n Fragment,\r\n Listen,\r\n} from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\nimport {\r\n AdvancedSelectGroup,\r\n AdvancedSelectGroupRedirect,\r\n AdvancedSelectOption,\r\n AdvancedSelectChangeEvent,\r\n AdvancedSelectOptionOrGroup,\r\n AdvancedSelectRedirectEvent,\r\n} from \"./advanced-select.models\";\r\nimport { createFocusTrap, FocusTrap } from \"focus-trap\";\r\nimport { tabbable } from \"tabbable\";\r\nimport { isModifiedEvent } from \"../../utils/is-modified-event\";\r\n\r\n@Component({\r\n tag: \"dso-advanced-select\",\r\n styleUrl: \"advanced-select.scss\",\r\n shadow: true,\r\n})\r\nexport class AdvancedSelect implements ComponentInterface {\r\n private trap?: FocusTrap;\r\n\r\n @Element()\r\n host!: HTMLDsoAdvancedSelectElement;\r\n\r\n /**\r\n * The options to display in the select.\r\n */\r\n @Prop()\r\n options: AdvancedSelectOptionOrGroup<never>[] = [];\r\n\r\n /**\r\n * The active option. By object reference.\r\n */\r\n @Prop()\r\n active?: AdvancedSelectOption<never>;\r\n\r\n /**\r\n * An extra text for the active option. Only visible in the list of options.\r\n */\r\n @Prop()\r\n activeHint?: string;\r\n\r\n /**\r\n * The open state of the options list.\r\n */\r\n @State()\r\n open: boolean = false;\r\n\r\n /**\r\n * Emitted when user selects an option\r\n */\r\n @Event({ bubbles: false })\r\n dsoChange!: EventEmitter<AdvancedSelectChangeEvent<never>>;\r\n\r\n /**\r\n * Emitted when user activates a group redirect link.\r\n */\r\n @Event({ bubbles: false })\r\n dsoRedirect!: EventEmitter<AdvancedSelectRedirectEvent>;\r\n\r\n private toggleButtonElementRef: HTMLButtonElement | undefined;\r\n\r\n @Listen(\"keydown\", { target: \"window\" })\r\n keyDownListener(event: KeyboardEvent) {\r\n if (this.open && event.key === \"ArrowUp\") {\r\n event.preventDefault();\r\n this.handleTab(-1);\r\n } else if (this.open && event.key === \"ArrowDown\") {\r\n event.preventDefault();\r\n this.handleTab(1);\r\n }\r\n }\r\n\r\n componentDidRender() {\r\n if (this.open && !this.trap) {\r\n this.createTrap();\r\n } else if (!this.open && this.trap) {\r\n this.removeTrap();\r\n }\r\n }\r\n\r\n private toggleOpen = () => {\r\n this.open = !this.open;\r\n };\r\n\r\n private createTrap() {\r\n this.trap = createFocusTrap(this.host, {\r\n clickOutsideDeactivates: true,\r\n escapeDeactivates: true,\r\n setReturnFocus: this.toggleButtonElementRef,\r\n tabbableOptions: {\r\n getShadowRoot: true,\r\n },\r\n onDeactivate: () => {\r\n this.open = false;\r\n },\r\n }).activate();\r\n }\r\n\r\n private removeTrap() {\r\n this.trap?.deactivate();\r\n delete this.trap;\r\n }\r\n\r\n private handleTab(direction: number) {\r\n const elements = tabbable(this.host, { getShadowRoot: true });\r\n const currentIndex = elements.findIndex((e) => e === this.host.shadowRoot?.activeElement);\r\n\r\n let nextIndex = currentIndex + direction;\r\n if (nextIndex >= elements.length) {\r\n nextIndex = 0;\r\n } else if (nextIndex < 0) {\r\n nextIndex = elements.length - 1;\r\n }\r\n\r\n elements[nextIndex]?.focus();\r\n }\r\n\r\n private handleOptionClick = (event: MouseEvent, option: AdvancedSelectOption<never>) => {\r\n this.dsoChange.emit({ originalEvent: event, option });\r\n this.open = false;\r\n };\r\n\r\n private handleRedirectClick = (event: MouseEvent, redirect: AdvancedSelectGroupRedirect) => {\r\n this.dsoRedirect.emit({ originalEvent: event, isModifiedEvent: isModifiedEvent(event), redirect });\r\n this.open = false;\r\n };\r\n\r\n render() {\r\n return (\r\n <>\r\n <button\r\n aria-expanded={this.open.toString()}\r\n class={clsx([\"active-option\", { open: this.open }])}\r\n type=\"button\"\r\n onClick={this.toggleOpen}\r\n ref={(element) => (this.toggleButtonElementRef = element)}\r\n >\r\n <span class=\"active-option-label\">{this.active?.label ?? \"Selecteer een optie\"}</span>\r\n <span class=\"active-option-aside\">\r\n {this.options.some(\r\n (optionOrGroup) => \"summaryCounter\" in optionOrGroup && optionOrGroup?.summaryCounter,\r\n ) && (\r\n <span class=\"badges\">\r\n {this.options\r\n .filter(\r\n (option): option is AdvancedSelectGroup<never> =>\r\n \"options\" in option && \"summaryCounter\" in option && !!option?.summaryCounter,\r\n )\r\n .map((group) => {\r\n return <dso-badge status={group.variant ?? \"outline\"}>{group.options.length}</dso-badge>;\r\n })}\r\n </span>\r\n )}\r\n <dso-icon icon=\"caret-down\"></dso-icon>\r\n </span>\r\n </button>\r\n {this.open && (\r\n <div class=\"groups-container\">\r\n <ul class=\"groups\">\r\n {this.options.map((optionOrGroup) =>\r\n \"options\" in optionOrGroup ? (\r\n <li class={clsx([\"group\", { [`group-${optionOrGroup.variant}`]: !!optionOrGroup.variant }])}>\r\n {optionOrGroup.label && <p class=\"group-label\">{optionOrGroup.label}</p>}\r\n <ul class=\"options\">\r\n {optionOrGroup.options.map((option) => (\r\n <OptionElement\r\n option={option}\r\n active={this.active}\r\n activeHint={this.activeHint}\r\n callback={this.handleOptionClick}\r\n />\r\n ))}\r\n </ul>\r\n {optionOrGroup.redirect && (\r\n <a\r\n class=\"group-link\"\r\n href={optionOrGroup.redirect.href}\r\n onClick={(e) => optionOrGroup.redirect && this.handleRedirectClick(e, optionOrGroup.redirect)}\r\n >\r\n {optionOrGroup.redirect.label}\r\n <dso-icon icon=\"chevron-right\"></dso-icon>\r\n </a>\r\n )}\r\n </li>\r\n ) : (\r\n <OptionElement\r\n option={optionOrGroup}\r\n active={this.active}\r\n activeHint={this.activeHint}\r\n callback={this.handleOptionClick}\r\n />\r\n ),\r\n )}\r\n </ul>\r\n </div>\r\n )}\r\n </>\r\n );\r\n }\r\n}\r\n\r\nconst OptionElement: FunctionalComponent<{\r\n option: AdvancedSelectOption<never>;\r\n active: AdvancedSelectOption<never> | undefined;\r\n activeHint: string | undefined;\r\n callback: (event: MouseEvent, value: AdvancedSelectOption<never>) => void;\r\n}> = ({ option, active, activeHint, callback }) => (\r\n <li>\r\n <button\r\n class={clsx([\"option\", { \"option-active\": active === option }])}\r\n type=\"button\"\r\n onClick={(e) => callback(e, option)}\r\n >\r\n <span class=\"option-label\">{option.label}</span>\r\n {!!activeHint && active === option && <span class=\"option-hint\">({activeHint})</span>}\r\n </button>\r\n </li>\r\n);\r\n"],"version":3}
@@ -1,4 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { g as getActiveElement } from './get-active-element.js';
2
3
  import { d as defineCustomElement$3 } from './icon.js';
3
4
  import { d as defineCustomElement$2 } from './scrollable.js';
4
5
  import { v as v4 } from './v4.js';
@@ -12,26 +13,34 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
12
13
  this.__attachShadow();
13
14
  this.dsoClose = createEvent(this, "dsoClose", 7);
14
15
  this.ariaId = v4();
15
- this.hasFooter = undefined;
16
16
  this.fullscreen = undefined;
17
17
  this.modalTitle = undefined;
18
18
  this.role = "dialog";
19
+ this.returnFocus = undefined;
19
20
  this.showCloseButton = true;
20
21
  }
21
- componentWillLoad() {
22
- this.hasFooter = this.host.querySelector("[slot='footer']") !== null;
22
+ get hasFooter() {
23
+ return this.host.querySelector("[slot='footer']") !== null;
23
24
  }
24
25
  componentDidLoad() {
25
26
  var _a;
26
27
  if ((_a = this.htmlDialogElement) === null || _a === void 0 ? void 0 : _a.isConnected) {
28
+ const activeElement = getActiveElement();
29
+ if (activeElement instanceof HTMLElement) {
30
+ this.returnFocusElement = activeElement;
31
+ }
27
32
  this.htmlDialogElement.showModal();
28
33
  }
29
34
  document.body.classList.add("dso-modal-open");
30
35
  }
31
36
  disconnectedCallback() {
32
- var _a;
37
+ var _a, _b, _c;
33
38
  document.body.classList.remove("dso-modal-open");
34
39
  (_a = this.htmlDialogElement) === null || _a === void 0 ? void 0 : _a.close();
40
+ if (this.returnFocus === false) {
41
+ return;
42
+ }
43
+ (_c = ((_b = this.returnFocus) !== null && _b !== void 0 ? _b : this.returnFocusElement)) === null || _c === void 0 ? void 0 : _c.focus();
35
44
  }
36
45
  render() {
37
46
  var _a;
@@ -46,9 +55,9 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
46
55
  "fullscreen": [516],
47
56
  "modalTitle": [1, "modal-title"],
48
57
  "role": [1],
58
+ "returnFocus": [4, "return-focus"],
49
59
  "showCloseButton": [4, "show-close-button"],
50
- "ariaId": [32],
51
- "hasFooter": [32]
60
+ "ariaId": [32]
52
61
  }]);
53
62
  function defineCustomElement$1() {
54
63
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"dso-modal.js","mappings":";;;;;AAAA,MAAM,QAAQ,GAAG,23LAA23L;;MCU/3L,KAAK;;;;;;kBAOP,EAAE,EAAE;;;;gBAqBS,QAAQ;2BAQZ,IAAI;;EAQtB,iBAAiB;IACf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;GACtE;EAED,gBAAgB;;IACd,IAAI,MAAA,IAAI,CAAC,iBAAiB,0CAAE,WAAW,EAAE;MACvC,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;KACpC;IAED,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;GAC/C;EAED,oBAAoB;;IAClB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACjD,MAAA,IAAI,CAAC,iBAAiB,0CAAE,KAAK,EAAE,CAAC;GACjC;EAED,MAAM;;IACJ,QACE,cACE,KAAK,EAAC,WAAW,EACjB,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,SAAS,gBACjB,MAAM,qBACA,IAAI,CAAC,MAAM,EAC5B,GAAG,EAAE,CAAC,OAAO,MAAM,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,EACpD,QAAQ,EAAE,CAAC,CAAC;QACV,CAAC,CAAC,cAAc,EAAE,CAAC;QAEnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;OAC1C,IAED,WAAK,KAAK,EAAC,YAAY,EAAC,IAAI,EAAC,UAAU,IACpC,IAAI,CAAC,UAAU,IACd,WAAK,KAAK,EAAC,YAAY,IACrB,UAAI,EAAE,EAAE,IAAI,CAAC,MAAM,IAAG,IAAI,CAAC,UAAU,CAAM,EAC1C,IAAI,CAAC,eAAe,KACnB,cAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,WAAW,EAAC,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,IAC9F,gBAAU,IAAI,EAAC,OAAO,GAAY,EAClC,YAAM,KAAK,EAAC,SAAS,cAAe,CAC7B,CACV,CACG,KAEN,YAAM,KAAK,EAAC,SAAS,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,cAE9B,CACR,EAED,0BACE,WAAK,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAE,CAAC,IAC/B,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACS,EAEhB,IAAI,CAAC,SAAS,KACb,WAAK,KAAK,EAAC,YAAY,IACrB,YAAM,IAAI,EAAC,QAAQ,GAAG,CAClB,CACP,CACG,CACC,EACT;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/modal/modal.scss?tag=dso-modal&encapsulation=shadow","src/components/modal/modal.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/components/button\";\r\n@use \"~dso-toolkit/src/components/modal\";\r\n@use \"~dso-toolkit/src/variables/media-query-breakpoints\";\r\n\r\n@include utilities.box-sizing();\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n// fullscreen option\r\n:host([fullscreen]) dialog {\r\n @include modal.fullscreen();\r\n}\r\n\r\n// Go to fullscreen on =< 480px viewport\r\n@media screen and (max-width: media-query-breakpoints.$screen-xs-min) {\r\n :host dialog {\r\n @include modal.fullscreen();\r\n }\r\n}\r\n\r\n.sr-only {\r\n @include utilities.sr-only();\r\n}\r\n\r\nbutton {\r\n @include button.element();\r\n}\r\n\r\n.dso-modal {\r\n @include modal.root();\r\n}\r\n\r\n.dso-close {\r\n dso-icon {\r\n color: modal.$close-icon-color;\r\n }\r\n}\r\n","import { h, Component, ComponentInterface, Element, Event, EventEmitter, Prop, State } from \"@stencil/core\";\r\nimport { v4 } from \"uuid\";\r\n\r\nimport { ModalCloseEvent } from \"./modal.interfaces\";\r\n\r\n@Component({\r\n tag: \"dso-modal\",\r\n styleUrl: \"modal.scss\",\r\n shadow: true,\r\n})\r\nexport class Modal implements ComponentInterface {\r\n private htmlDialogElement?: HTMLDialogElement;\r\n\r\n @Element()\r\n host!: HTMLDsoModalElement;\r\n\r\n @State()\r\n ariaId = v4();\r\n\r\n @State()\r\n hasFooter?: boolean;\r\n\r\n /**\r\n * when set the modal will be shown in fullscreen.\r\n */\r\n @Prop({ reflect: true })\r\n fullscreen?: boolean;\r\n\r\n /**\r\n * The title of the Modal.\r\n */\r\n @Prop()\r\n modalTitle?: string;\r\n\r\n /**\r\n * the role for the modal `dialog` | `alert` | `alertdialog`.\r\n */\r\n @Prop()\r\n role: string | null = \"dialog\";\r\n\r\n /**\r\n * when `false` the close button in the header will not be rendered. Defaults to `true`.\r\n *\r\n * Needs `modalTitle` to be set.\r\n */\r\n @Prop()\r\n showCloseButton = true;\r\n\r\n /**\r\n * Emitted when the user wants to close the Modal.\r\n */\r\n @Event()\r\n dsoClose!: EventEmitter<ModalCloseEvent>;\r\n\r\n componentWillLoad(): void {\r\n this.hasFooter = this.host.querySelector(\"[slot='footer']\") !== null;\r\n }\r\n\r\n componentDidLoad(): void {\r\n if (this.htmlDialogElement?.isConnected) {\r\n this.htmlDialogElement.showModal();\r\n }\r\n\r\n document.body.classList.add(\"dso-modal-open\");\r\n }\r\n\r\n disconnectedCallback(): void {\r\n document.body.classList.remove(\"dso-modal-open\");\r\n this.htmlDialogElement?.close();\r\n }\r\n\r\n render() {\r\n return (\r\n <dialog\r\n class=\"dso-modal\"\r\n role={this.role ?? undefined}\r\n aria-modal=\"true\"\r\n aria-labelledby={this.ariaId}\r\n ref={(element) => (this.htmlDialogElement = element)}\r\n onCancel={(e) => {\r\n e.preventDefault();\r\n\r\n this.dsoClose.emit({ originalEvent: e });\r\n }}\r\n >\r\n <div class=\"dso-dialog\" role=\"document\">\r\n {this.modalTitle ? (\r\n <div class=\"dso-header\">\r\n <h2 id={this.ariaId}>{this.modalTitle}</h2>\r\n {this.showCloseButton && (\r\n <button type=\"button\" class=\"dso-close\" onClick={(e) => this.dsoClose.emit({ originalEvent: e })}>\r\n <dso-icon icon=\"times\"></dso-icon>\r\n <span class=\"sr-only\">Sluiten</span>\r\n </button>\r\n )}\r\n </div>\r\n ) : (\r\n <span class=\"sr-only\" id={this.ariaId}>\r\n Dialoog\r\n </span>\r\n )}\r\n\r\n <dso-scrollable>\r\n <div class=\"dso-body\" tabIndex={0}>\r\n <slot name=\"body\" />\r\n </div>\r\n </dso-scrollable>\r\n\r\n {this.hasFooter && (\r\n <div class=\"dso-footer\">\r\n <slot name=\"footer\" />\r\n </div>\r\n )}\r\n </div>\r\n </dialog>\r\n );\r\n }\r\n}\r\n"],"version":3}
1
+ {"file":"dso-modal.js","mappings":";;;;;;AAAA,MAAM,QAAQ,GAAG,23LAA23L;;MCW/3L,KAAK;;;;;;kBAOP,EAAE,EAAE;;;gBAkBS,QAAQ;uBAUiB,SAAS;2BAQtC,IAAI;;EAUtB,IAAI,SAAS;IACX,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;GAC5D;EAED,gBAAgB;;IACd,IAAI,MAAA,IAAI,CAAC,iBAAiB,0CAAE,WAAW,EAAE;MACvC,M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C,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,IAC9F,gBAAU,IAAI,EAAC,OAAO,GAAY,EAClC,YAAM,KAAK,EAAC,SAAS,cAAe,CAC7B,CACV,CACG,KAEN,YAAM,KAAK,EAAC,SAAS,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,cAE9B,CACR,EAED,0BACE,WAAK,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAE,CAAC,IAC/B,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACS,EAEhB,IAAI,CAAC,SAAS,KACb,WAAK,KAAK,EAAC,YAAY,IACrB,YAAM,IAAI,EAAC,QAAQ,GAAG,CAClB,CACP,CACG,CACC,EACT;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/modal/modal.scss?tag=dso-modal&encapsulation=shadow","src/components/modal/modal.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/components/button\";\r\n@use \"~dso-toolkit/src/components/modal\";\r\n@use \"~dso-toolkit/src/variables/media-query-breakpoints\";\r\n\r\n@include utilities.box-sizing();\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n// fullscreen option\r\n:host([fullscreen]) dialog {\r\n @include modal.fullscreen();\r\n}\r\n\r\n// Go to fullscreen on =< 480px viewport\r\n@media screen and (max-width: media-query-breakpoints.$screen-xs-min) {\r\n :host dialog {\r\n @include modal.fullscreen();\r\n }\r\n}\r\n\r\n.sr-only {\r\n @include utilities.sr-only();\r\n}\r\n\r\nbutton {\r\n @include button.element();\r\n}\r\n\r\n.dso-modal {\r\n @include modal.root();\r\n}\r\n\r\n.dso-close {\r\n dso-icon {\r\n color: modal.$close-icon-color;\r\n }\r\n}\r\n","import { h, Component, ComponentInterface, Element, Event, EventEmitter, Prop, State } from \"@stencil/core\";\r\nimport { v4 } from \"uuid\";\r\n\r\nimport { ModalCloseEvent } from \"./modal.interfaces\";\r\nimport { getActiveElement } from \"../../utils/get-active-element\";\r\n\r\n@Component({\r\n tag: \"dso-modal\",\r\n styleUrl: \"modal.scss\",\r\n shadow: true,\r\n})\r\nexport class Modal implements ComponentInterface {\r\n private htmlDialogElement?: HTMLDialogElement;\r\n\r\n @Element()\r\n host!: HTMLDsoModalElement;\r\n\r\n @State()\r\n ariaId = v4();\r\n\r\n /**\r\n * when set the modal will be shown in fullscreen.\r\n */\r\n @Prop({ reflect: true })\r\n fullscreen?: boolean;\r\n\r\n /**\r\n * The title of the Modal.\r\n */\r\n @Prop()\r\n modalTitle?: string;\r\n\r\n /**\r\n * the role for the modal `dialog` | `alert` | `alertdialog`.\r\n */\r\n @Prop()\r\n role: string | null = \"dialog\";\r\n\r\n /**\r\n * The element to return focus to after the modal is closed.\r\n *\r\n * * `undefined` will return focus to the previously focused element (default).\r\n * * `false` will not return focus to any element.\r\n * * or, provide your own `HTMLElement` that will receive focus upon closing.\r\n */\r\n @Prop()\r\n returnFocus: false | HTMLElement | undefined = undefined;\r\n\r\n /**\r\n * when `false` the close button in the header will not be rendered. Defaults to `true`.\r\n *\r\n * Needs `modalTitle` to be set.\r\n */\r\n @Prop()\r\n showCloseButton = true;\r\n\r\n private returnFocusElement: HTMLElement | undefined;\r\n\r\n /**\r\n * Emitted when the user wants to close the Modal.\r\n */\r\n @Event()\r\n dsoClose!: EventEmitter<ModalCloseEvent>;\r\n\r\n get hasFooter() {\r\n return this.host.querySelector(\"[slot='footer']\") !== null;\r\n }\r\n\r\n componentDidLoad(): void {\r\n if (this.htmlDialogElement?.isConnected) {\r\n const activeElement = getActiveElement();\r\n if (activeElement instanceof HTMLElement) {\r\n this.returnFocusElement = activeElement;\r\n }\r\n\r\n this.htmlDialogElement.showModal();\r\n }\r\n\r\n document.body.classList.add(\"dso-modal-open\");\r\n }\r\n\r\n disconnectedCallback(): void {\r\n document.body.classList.remove(\"dso-modal-open\");\r\n this.htmlDialogElement?.close();\r\n\r\n if (this.returnFocus === false) {\r\n return;\r\n }\r\n\r\n (this.returnFocus ?? this.returnFocusElement)?.focus();\r\n }\r\n\r\n render() {\r\n return (\r\n <dialog\r\n class=\"dso-modal\"\r\n role={this.role ?? undefined}\r\n aria-modal=\"true\"\r\n aria-labelledby={this.ariaId}\r\n ref={(element) => (this.htmlDialogElement = element)}\r\n onCancel={(e) => {\r\n e.preventDefault();\r\n\r\n this.dsoClose.emit({ originalEvent: e });\r\n }}\r\n >\r\n <div class=\"dso-dialog\" role=\"document\">\r\n {this.modalTitle ? (\r\n <div class=\"dso-header\">\r\n <h2 id={this.ariaId}>{this.modalTitle}</h2>\r\n {this.showCloseButton && (\r\n <button type=\"button\" class=\"dso-close\" onClick={(e) => this.dsoClose.emit({ originalEvent: e })}>\r\n <dso-icon icon=\"times\"></dso-icon>\r\n <span class=\"sr-only\">Sluiten</span>\r\n </button>\r\n )}\r\n </div>\r\n ) : (\r\n <span class=\"sr-only\" id={this.ariaId}>\r\n Dialoog\r\n </span>\r\n )}\r\n\r\n <dso-scrollable>\r\n <div class=\"dso-body\" tabIndex={0}>\r\n <slot name=\"body\" />\r\n </div>\r\n </dso-scrollable>\r\n\r\n {this.hasFooter && (\r\n <div class=\"dso-footer\">\r\n <slot name=\"footer\" />\r\n </div>\r\n )}\r\n </div>\r\n </dialog>\r\n );\r\n }\r\n}\r\n"],"version":3}
@@ -0,0 +1,14 @@
1
+ function getActiveElement({ activeElement } = document) {
2
+ var _a;
3
+ if (!activeElement) {
4
+ return null;
5
+ }
6
+ if (activeElement.shadowRoot) {
7
+ return (_a = getActiveElement(activeElement.shadowRoot)) !== null && _a !== void 0 ? _a : activeElement;
8
+ }
9
+ return activeElement;
10
+ }
11
+
12
+ export { getActiveElement as g };
13
+
14
+ //# sourceMappingURL=get-active-element.js.map
@@ -0,0 +1 @@
1
+ {"file":"get-active-element.js","mappings":"SAAgB,gBAAgB,CAAC,EAAE,aAAa,KAA2B,QAAQ;;EACjF,IAAI,CAAC,aAAa,EAAE;IAClB,OAAO,IAAI,CAAC;GACb;EAED,IAAI,aAAa,CAAC,UAAU,EAAE;IAC5B,OAAO,MAAA,gBAAgB,CAAC,aAAa,CAAC,UAAU,CAAC,mCAAI,aAAa,CAAC;GACpE;EAED,OAAO,aAAa,CAAC;AACvB;;;;","names":[],"sources":["src/utils/get-active-element.ts"],"sourcesContent":["export function getActiveElement({ activeElement }: DocumentOrShadowRoot = document): Element | null {\r\n if (!activeElement) {\r\n return null;\r\n }\r\n\r\n if (activeElement.shadowRoot) {\r\n return getActiveElement(activeElement.shadowRoot) ?? activeElement;\r\n }\r\n\r\n return activeElement;\r\n}\r\n"],"version":3}
@@ -7,6 +7,8 @@ export { ActionList as DsoActionList } from '../types/components/action-list/act
7
7
  export { defineCustomElement as defineCustomElementDsoActionList } from './dso-action-list';
8
8
  export { ActionListItem as DsoActionListItem } from '../types/components/action-list/components/action-list-item';
9
9
  export { defineCustomElement as defineCustomElementDsoActionListItem } from './dso-action-list-item';
10
+ export { AdvancedSelect as DsoAdvancedSelect } from '../types/components/advanced-select/advanced-select';
11
+ export { defineCustomElement as defineCustomElementDsoAdvancedSelect } from './dso-advanced-select';
10
12
  export { Alert as DsoAlert } from '../types/components/alert/alert';
11
13
  export { defineCustomElement as defineCustomElementDsoAlert } from './dso-alert';
12
14
  export { AnnotationButton as DsoAnnotationButton } from '../types/components/annotation-button/annotation-button';
@@ -3,6 +3,7 @@ export { DsoAccordion, defineCustomElement as defineCustomElementDsoAccordion }
3
3
  export { DsoAccordionSection, defineCustomElement as defineCustomElementDsoAccordionSection } from './dso-accordion-section.js';
4
4
  export { DsoActionList, defineCustomElement as defineCustomElementDsoActionList } from './dso-action-list.js';
5
5
  export { DsoActionListItem, defineCustomElement as defineCustomElementDsoActionListItem } from './dso-action-list-item.js';
6
+ export { DsoAdvancedSelect, defineCustomElement as defineCustomElementDsoAdvancedSelect } from './dso-advanced-select.js';
6
7
  export { DsoAlert, defineCustomElement as defineCustomElementDsoAlert } from './dso-alert.js';
7
8
  export { DsoAnnotationButton, defineCustomElement as defineCustomElementDsoAnnotationButton } from './dso-annotation-button.js';
8
9
  export { DsoAnnotationOutput, defineCustomElement as defineCustomElementDsoAnnotationOutput } from './dso-annotation-output.js';
@@ -1 +1 @@
1
- {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,2 +1,2 @@
1
- import{p as e,b as o}from"./p-4592810d.js";export{s as setNonce}from"./p-4592810d.js";const t=()=>{const o=import.meta.url;const t={};if(o!==""){t.resourcesUrl=new URL(".",o).href}return e(t)};t().then((e=>o([["p-d24073fe",[[2,"dsot-document-component-demo",{showCanvas:[516,"show-canvas"],jsonFile:[1,"json-file"],openDefault:[4,"open-default"],response:[32],document:[32],openOrClosed:[32],openedAnnotation:[32],filtered:[32],notApplicable:[32],activeAnnotationSelectables:[32]},null,{jsonFile:["jsonFileWatcher"],openDefault:["openDefaultWatcher"]}]]],["p-51f9702b",[[1,"dso-map-base-layers",{group:[1],baseLayers:[16]}]]],["p-c1bab0f1",[[1,"dso-map-overlays",{group:[1],overlays:[16]}]]],["p-9bf33855",[[1,"dso-accordion-section",{handleTitle:[1,"handle-title"],heading:[1],handleUrl:[1,"handle-url"],status:[1],attachmentCount:[2,"attachment-count"],icon:[1],statusDescription:[1,"status-description"],open:[516],hasNestedAccordion:[516,"has-nested-accordion"],hover:[32],focusHandle:[64]}]]],["p-43511221",[[1,"dso-toggletip",{label:[1],position:[1],small:[4],secondary:[4],active:[32]}]]],["p-7bcce109",[[6,"dso-header",{mainMenu:[16],useDropDownMenu:[1,"use-drop-down-menu"],authStatus:[1,"auth-status"],loginUrl:[1,"login-url"],logoutUrl:[1,"logout-url"],showHelp:[4,"show-help"],helpUrl:[1,"help-url"],userProfileName:[1,"user-profile-name"],userProfileUrl:[1,"user-profile-url"],userHomeUrl:[1,"user-home-url"],userHomeActive:[4,"user-home-active"],showDropDown:[32],overflowMenuItems:[32],dropdownOptionsOffset:[32]},null,{useDropDownMenu:["setShowDropDown"]}]]],["p-e1cb1603",[[1,"dso-map-controls",{open:[1540],disableZoom:[1,"disable-zoom"],hideContent:[32],toggleVisibility:[64]},null,{open:["watchOpen"]}]]],["p-f4cb0d36",[[1,"dso-modal",{fullscreen:[516],modalTitle:[1,"modal-title"],role:[1],showCloseButton:[4,"show-close-button"],ariaId:[32],hasFooter:[32]}]]],["p-6d602847",[[1,"dso-pagination",{totalPages:[2,"total-pages"],currentPage:[2,"current-page"],formatHref:[16],availablePositions:[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["p-302764ae",[[1,"dso-tree-view",{collection:[16],focusItem:[64]}]]],["p-67461818",[[1,"dso-action-list-item",{step:[2],itemTitle:[1,"item-title"],flowLine:[4,"flow-line"],warning:[4],divider:[4]}]]],["p-df63a085",[[6,"dso-autosuggest",{suggestions:[16],loading:[4],loadingLabel:[1,"loading-label"],loadingDelayed:[2,"loading-delayed"],notFoundLabel:[1,"not-found-label"],suggestOnFocus:[4,"suggest-on-focus"],showSuggestions:[32],selectedSuggestion:[32],notFound:[32],showLoading:[32]},[[4,"click","onDocumentClick"]],{suggestions:["suggestionsWatcher"]}]]],["p-4e5a6107",[[1,"dso-card",{clickable:[516],imageShape:[513,"image-shape"],href:[513],mode:[513]}]]],["p-84be819d",[[2,"dso-date-picker-legacy",{name:[1],identifier:[1],disabled:[516],role:[1],direction:[1],required:[4],invalid:[516],describedBy:[1,"described-by"],dsoAutofocus:[4,"dso-autofocus"],value:[1537],min:[1],max:[1],activeFocus:[32],focusedDay:[32],open:[32],visible:[32],setFocus:[64],show:[64],hide:[64]},[[6,"click","handleDocumentClick"]]]]],["p-1faa1497",[[1,"dso-helpcenter-panel",{label:[1],url:[1],visibility:[32],isOpen:[32],slideState:[32],loadIframe:[32]},[[8,"keydown","keyDownListener"]],{url:["watchUrl"],isOpen:["watchIsOpen"]}]]],["p-5595d073",[[1,"dso-list-button",{label:[1],sublabel:[1],count:[2],min:[8],max:[8],checked:[516],disabled:[516],subcontentPrefix:[1,"subcontent-prefix"],manual:[4],manualInputWrapperElement:[32],manualCount:[32]},null,{manual:["watchManualCallback"]}]]],["p-159c0a88",[[1,"dso-mark-bar",{value:[1],label:[1],current:[2],totalCount:[2,"total-count"],dsoFocus:[64]}]]],["p-b6af439e",[[1,"dso-accordion",{variant:[513],reverseAlign:[516,"reverse-align"],_getState:[64]},null,{variant:["updateVariant"],reverseAlign:["updateReverseAlign"]}]]],["p-c9fbf040",[[1,"dso-action-list",{listTitle:[1,"list-title"]}]]],["p-15c3da8e",[[1,"dso-banner",{status:[513],compact:[4],noIcon:[4,"no-icon"]}]]],["p-09552584",[[1,"dso-card-container",{mode:[513]}]]],["p-f6d1d215",[[2,"dso-date-picker",{name:[1],identifier:[1],disabled:[516],required:[516],invalid:[516],describedBy:[1,"described-by"],dsoAutofocus:[4,"dso-autofocus"],value:[513],min:[1],max:[1]}]]],["p-e5ecc82f",[[1,"dso-highlight-box",{yellow:[516],border:[516],white:[516],dropShadow:[516,"drop-shadow"],step:[514]}]]],["p-ea6ca8b2",[[1,"dso-logo",{label:[513],ribbon:[1]}]]],["p-7cac2dd2",[[1,"dso-progress-bar",{progress:[2],min:[2],max:[2]}]]],["p-aa6d1e42",[[1,"dso-viewer-grid",{mode:[513],filterpanelOpen:[516,"filterpanel-open"],overlayOpen:[516,"overlay-open"],documentPanelOpen:[516,"document-panel-open"],mainSize:[513,"main-size"],activeTab:[1,"active-tab"],documentPanelSize:[513,"document-panel-size"],mainPanelExpanded:[4,"main-panel-expanded"],mainPanelHidden:[4,"main-panel-hidden"],tabView:[32],_checkMainPanelVisibility:[64]},null,{documentPanelOpen:["documentPanelOpenWatcher"],filterpanelOpen:["filterpanelOpenWatcher"],overlayOpen:["overlayOpenWatcher"]}]]],["p-11eb95a2",[[1,"dso-attachments-counter",{count:[2]}]]],["p-92fd9516",[[1,"dso-dropdown-menu",{open:[1540],dropdownAlign:[1,"dropdown-align"],dropdownOptionsOffset:[2,"dropdown-options-offset"],checkable:[4],boundary:[1],placement:[1],strategy:[1]},null,{placement:["watchPosition"],dropdownAlign:["watchPosition"],dropdownOptionsOffset:["watchOptionsOffset"],strategy:["watchStrategy"]}]]],["p-56136f3c",[[1,"dso-progress-indicator",{label:[1],size:[513],block:[4]}]]],["p-1180ebe3",[[1,"dso-scrollable",{scrollPosition:[32],_setScrollState:[64]}]]],["p-1981592d",[[1,"dso-expandable",{open:[516],enableAnimation:[516,"enable-animation"],minimumHeight:[2,"minimum-height"],animationReady:[32],isOpen:[32]},null,{open:["toggleOpen"],enableAnimation:["toggleEnableAnimation"]}]]],["p-a435b9fd",[[1,"dso-responsive-element",{sizeAlias:[32],sizeWidth:[32],getSize:[64]}]]],["p-eeacda43",[[1,"dso-icon",{icon:[1]}]]],["p-fd4b0b0b",[[1,"dso-info-button",{active:[1540],secondary:[4],label:[1],hover:[32],setFocus:[64]}]]],["p-31825ec2",[[6,"dso-selectable",{type:[1],identifier:[1],name:[1],value:[1],invalid:[4],describedById:[1,"described-by-id"],labelledById:[1,"labelled-by-id"],disabled:[4],required:[4],checked:[516],indeterminate:[4],infoFixed:[4,"info-fixed"],infoActive:[32],keyboardFocus:[32],toggleInfo:[64]},null,{indeterminate:["setIndeterminate"]}],[1,"dso-info",{fixed:[516],active:[516]}]]],["p-b0116121",[[1,"dso-tooltip",{descriptive:[516],position:[1],strategy:[1],noArrow:[4,"no-arrow"],stateless:[4],small:[4],active:[1540],hidden:[32],activate:[64],deactivate:[64]},null,{position:["watchPosition"],strategy:["watchStrategy"],active:["watchActive"]}]]],["p-2862c19a",[[1,"dso-ozon-content",{content:[1],inline:[516],mark:[16],state:[32]},null,{content:["contentWatcher"]}],[1,"dso-label",{compact:[4],removable:[4],status:[1],truncate:[4],removeHover:[32],removeFocus:[32],textHover:[32],textFocus:[32],isTruncated:[32],labelText:[32],_truncateLabel:[64]},[[4,"keydown","keyDownListener"]],{removable:["watchRemovable"],truncate:["watchTruncate"]}],[1,"dso-alert",{status:[1],roleAlert:[4,"role-alert"]}],[0,"dso-annotation-button",{identifier:[1],open:[4]}],[1,"dso-badge",{status:[1]}],[1,"dso-image-overlay",{active:[32],zoomable:[32]},[[2,"load","loadListener"]]],[1,"dso-table",{noModal:[516,"no-modal"],isResponsive:[516,"is-responsive"],modalActive:[32],placeholderHeight:[32]}]]],["p-5def1d28",[[1,"dso-document-component",{heading:[1],label:[1],nummer:[1],opschrift:[1],inhoud:[1],open:[516],filtered:[516],notApplicable:[516,"not-applicable"],genesteOntwerpInformatie:[516,"geneste-ontwerp-informatie"],bevatOntwerpInformatie:[516,"bevat-ontwerp-informatie"],annotated:[516],gereserveerd:[4],vervallen:[4],openAnnotation:[4,"open-annotation"],alternativeTitle:[1,"alternative-title"],type:[513],wijzigactie:[513],mark:[16],recursiveToggle:[8,"recursive-toggle"]}],[4,"dso-annotation-output",{identifier:[513],annotationPrefix:[513,"annotation-prefix"],open:[516]}],[4,"dso-slide-toggle",{checked:[4],disabled:[4],accessibleLabel:[1,"accessible-label"],labelledbyId:[1,"labelledby-id"],identifier:[1],hasVisibleLabel:[32]}]]]],e)));
1
+ import{p as e,b as o}from"./p-4592810d.js";export{s as setNonce}from"./p-4592810d.js";const n=()=>{const o=import.meta.url;const n={};if(o!==""){n.resourcesUrl=new URL(".",o).href}return e(n)};n().then((e=>o([["p-d24073fe",[[2,"dsot-document-component-demo",{showCanvas:[516,"show-canvas"],jsonFile:[1,"json-file"],openDefault:[4,"open-default"],response:[32],document:[32],openOrClosed:[32],openedAnnotation:[32],filtered:[32],notApplicable:[32],activeAnnotationSelectables:[32]},null,{jsonFile:["jsonFileWatcher"],openDefault:["openDefaultWatcher"]}]]],["p-51f9702b",[[1,"dso-map-base-layers",{group:[1],baseLayers:[16]}]]],["p-c1bab0f1",[[1,"dso-map-overlays",{group:[1],overlays:[16]}]]],["p-9bf33855",[[1,"dso-accordion-section",{handleTitle:[1,"handle-title"],heading:[1],handleUrl:[1,"handle-url"],status:[1],attachmentCount:[2,"attachment-count"],icon:[1],statusDescription:[1,"status-description"],open:[516],hasNestedAccordion:[516,"has-nested-accordion"],hover:[32],focusHandle:[64]}]]],["p-43511221",[[1,"dso-toggletip",{label:[1],position:[1],small:[4],secondary:[4],active:[32]}]]],["p-e32f287e",[[1,"dso-advanced-select",{options:[16],active:[16],activeHint:[1,"active-hint"],open:[32]},[[8,"keydown","keyDownListener"]]]]],["p-7bcce109",[[6,"dso-header",{mainMenu:[16],useDropDownMenu:[1,"use-drop-down-menu"],authStatus:[1,"auth-status"],loginUrl:[1,"login-url"],logoutUrl:[1,"logout-url"],showHelp:[4,"show-help"],helpUrl:[1,"help-url"],userProfileName:[1,"user-profile-name"],userProfileUrl:[1,"user-profile-url"],userHomeUrl:[1,"user-home-url"],userHomeActive:[4,"user-home-active"],showDropDown:[32],overflowMenuItems:[32],dropdownOptionsOffset:[32]},null,{useDropDownMenu:["setShowDropDown"]}]]],["p-e1cb1603",[[1,"dso-map-controls",{open:[1540],disableZoom:[1,"disable-zoom"],hideContent:[32],toggleVisibility:[64]},null,{open:["watchOpen"]}]]],["p-dd21df39",[[1,"dso-modal",{fullscreen:[516],modalTitle:[1,"modal-title"],role:[1],returnFocus:[4,"return-focus"],showCloseButton:[4,"show-close-button"],ariaId:[32]}]]],["p-6d602847",[[1,"dso-pagination",{totalPages:[2,"total-pages"],currentPage:[2,"current-page"],formatHref:[16],availablePositions:[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["p-302764ae",[[1,"dso-tree-view",{collection:[16],focusItem:[64]}]]],["p-67461818",[[1,"dso-action-list-item",{step:[2],itemTitle:[1,"item-title"],flowLine:[4,"flow-line"],warning:[4],divider:[4]}]]],["p-df63a085",[[6,"dso-autosuggest",{suggestions:[16],loading:[4],loadingLabel:[1,"loading-label"],loadingDelayed:[2,"loading-delayed"],notFoundLabel:[1,"not-found-label"],suggestOnFocus:[4,"suggest-on-focus"],showSuggestions:[32],selectedSuggestion:[32],notFound:[32],showLoading:[32]},[[4,"click","onDocumentClick"]],{suggestions:["suggestionsWatcher"]}]]],["p-4e5a6107",[[1,"dso-card",{clickable:[516],imageShape:[513,"image-shape"],href:[513],mode:[513]}]]],["p-84be819d",[[2,"dso-date-picker-legacy",{name:[1],identifier:[1],disabled:[516],role:[1],direction:[1],required:[4],invalid:[516],describedBy:[1,"described-by"],dsoAutofocus:[4,"dso-autofocus"],value:[1537],min:[1],max:[1],activeFocus:[32],focusedDay:[32],open:[32],visible:[32],setFocus:[64],show:[64],hide:[64]},[[6,"click","handleDocumentClick"]]]]],["p-1faa1497",[[1,"dso-helpcenter-panel",{label:[1],url:[1],visibility:[32],isOpen:[32],slideState:[32],loadIframe:[32]},[[8,"keydown","keyDownListener"]],{url:["watchUrl"],isOpen:["watchIsOpen"]}]]],["p-5595d073",[[1,"dso-list-button",{label:[1],sublabel:[1],count:[2],min:[8],max:[8],checked:[516],disabled:[516],subcontentPrefix:[1,"subcontent-prefix"],manual:[4],manualInputWrapperElement:[32],manualCount:[32]},null,{manual:["watchManualCallback"]}]]],["p-159c0a88",[[1,"dso-mark-bar",{value:[1],label:[1],current:[2],totalCount:[2,"total-count"],dsoFocus:[64]}]]],["p-b6af439e",[[1,"dso-accordion",{variant:[513],reverseAlign:[516,"reverse-align"],_getState:[64]},null,{variant:["updateVariant"],reverseAlign:["updateReverseAlign"]}]]],["p-c9fbf040",[[1,"dso-action-list",{listTitle:[1,"list-title"]}]]],["p-15c3da8e",[[1,"dso-banner",{status:[513],compact:[4],noIcon:[4,"no-icon"]}]]],["p-09552584",[[1,"dso-card-container",{mode:[513]}]]],["p-f6d1d215",[[2,"dso-date-picker",{name:[1],identifier:[1],disabled:[516],required:[516],invalid:[516],describedBy:[1,"described-by"],dsoAutofocus:[4,"dso-autofocus"],value:[513],min:[1],max:[1]}]]],["p-e5ecc82f",[[1,"dso-highlight-box",{yellow:[516],border:[516],white:[516],dropShadow:[516,"drop-shadow"],step:[514]}]]],["p-ea6ca8b2",[[1,"dso-logo",{label:[513],ribbon:[1]}]]],["p-7cac2dd2",[[1,"dso-progress-bar",{progress:[2],min:[2],max:[2]}]]],["p-aa6d1e42",[[1,"dso-viewer-grid",{mode:[513],filterpanelOpen:[516,"filterpanel-open"],overlayOpen:[516,"overlay-open"],documentPanelOpen:[516,"document-panel-open"],mainSize:[513,"main-size"],activeTab:[1,"active-tab"],documentPanelSize:[513,"document-panel-size"],mainPanelExpanded:[4,"main-panel-expanded"],mainPanelHidden:[4,"main-panel-hidden"],tabView:[32],_checkMainPanelVisibility:[64]},null,{documentPanelOpen:["documentPanelOpenWatcher"],filterpanelOpen:["filterpanelOpenWatcher"],overlayOpen:["overlayOpenWatcher"]}]]],["p-11eb95a2",[[1,"dso-attachments-counter",{count:[2]}]]],["p-55dec51f",[[1,"dso-dropdown-menu",{open:[1540],dropdownAlign:[1,"dropdown-align"],dropdownOptionsOffset:[2,"dropdown-options-offset"],checkable:[4],boundary:[1],placement:[1],strategy:[1]},null,{placement:["watchPosition"],dropdownAlign:["watchPosition"],dropdownOptionsOffset:["watchOptionsOffset"],strategy:["watchStrategy"]}]]],["p-56136f3c",[[1,"dso-progress-indicator",{label:[1],size:[513],block:[4]}]]],["p-1180ebe3",[[1,"dso-scrollable",{scrollPosition:[32],_setScrollState:[64]}]]],["p-1981592d",[[1,"dso-expandable",{open:[516],enableAnimation:[516,"enable-animation"],minimumHeight:[2,"minimum-height"],animationReady:[32],isOpen:[32]},null,{open:["toggleOpen"],enableAnimation:["toggleEnableAnimation"]}]]],["p-a435b9fd",[[1,"dso-responsive-element",{sizeAlias:[32],sizeWidth:[32],getSize:[64]}]]],["p-eeacda43",[[1,"dso-icon",{icon:[1]}]]],["p-fd4b0b0b",[[1,"dso-info-button",{active:[1540],secondary:[4],label:[1],hover:[32],setFocus:[64]}]]],["p-31825ec2",[[6,"dso-selectable",{type:[1],identifier:[1],name:[1],value:[1],invalid:[4],describedById:[1,"described-by-id"],labelledById:[1,"labelled-by-id"],disabled:[4],required:[4],checked:[516],indeterminate:[4],infoFixed:[4,"info-fixed"],infoActive:[32],keyboardFocus:[32],toggleInfo:[64]},null,{indeterminate:["setIndeterminate"]}],[1,"dso-info",{fixed:[516],active:[516]}]]],["p-b0116121",[[1,"dso-tooltip",{descriptive:[516],position:[1],strategy:[1],noArrow:[4,"no-arrow"],stateless:[4],small:[4],active:[1540],hidden:[32],activate:[64],deactivate:[64]},null,{position:["watchPosition"],strategy:["watchStrategy"],active:["watchActive"]}]]],["p-2862c19a",[[1,"dso-ozon-content",{content:[1],inline:[516],mark:[16],state:[32]},null,{content:["contentWatcher"]}],[1,"dso-label",{compact:[4],removable:[4],status:[1],truncate:[4],removeHover:[32],removeFocus:[32],textHover:[32],textFocus:[32],isTruncated:[32],labelText:[32],_truncateLabel:[64]},[[4,"keydown","keyDownListener"]],{removable:["watchRemovable"],truncate:["watchTruncate"]}],[1,"dso-alert",{status:[1],roleAlert:[4,"role-alert"]}],[0,"dso-annotation-button",{identifier:[1],open:[4]}],[1,"dso-image-overlay",{active:[32],zoomable:[32]},[[2,"load","loadListener"]]],[1,"dso-table",{noModal:[516,"no-modal"],isResponsive:[516,"is-responsive"],modalActive:[32],placeholderHeight:[32]}],[1,"dso-badge",{status:[1]}]]],["p-5def1d28",[[1,"dso-document-component",{heading:[1],label:[1],nummer:[1],opschrift:[1],inhoud:[1],open:[516],filtered:[516],notApplicable:[516,"not-applicable"],genesteOntwerpInformatie:[516,"geneste-ontwerp-informatie"],bevatOntwerpInformatie:[516,"bevat-ontwerp-informatie"],annotated:[516],gereserveerd:[4],vervallen:[4],openAnnotation:[4,"open-annotation"],alternativeTitle:[1,"alternative-title"],type:[513],wijzigactie:[513],mark:[16],recursiveToggle:[8,"recursive-toggle"]}],[4,"dso-annotation-output",{identifier:[513],annotationPrefix:[513,"annotation-prefix"],open:[516]}],[4,"dso-slide-toggle",{checked:[4],disabled:[4],accessibleLabel:[1,"accessible-label"],labelledbyId:[1,"labelledby-id"],identifier:[1],hasVisibleLabel:[32]}]]]],e)));
2
2
  //# sourceMappingURL=dso-toolkit.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","showCanvas","jsonFile","openDefault","response","document","openOrClosed","openedAnnotation","filtered","notApplicable","activeAnnotationSelectables","group","baseLayers","overlays","handleTitle","heading","handleUrl","status","attachmentCount","icon","statusDescription","open","hasNestedAccordion","hover","focusHandle","label","position","small","secondary","active","mainMenu","useDropDownMenu","authStatus","loginUrl","logoutUrl","showHelp","helpUrl","userProfileName","userProfileUrl","userHomeUrl","userHomeActive","showDropDown","overflowMenuItems","dropdownOptionsOffset","disableZoom","hideContent","toggleVisibility","fullscreen","modalTitle","role","showCloseButton","ariaId","hasFooter","totalPages","currentPage","formatHref","availablePositions","collection","focusItem","step","itemTitle","flowLine","warning","divider","suggestions","loading","loadingLabel","loadingDelayed","notFoundLabel","suggestOnFocus","showSuggestions","selectedSuggestion","notFound","showLoading","clickable","imageShape","mode","name","identifier","disabled","direction","required","invalid","describedBy","dsoAutofocus","value","min","max","activeFocus","focusedDay","visible","setFocus","show","hide","visibility","isOpen","slideState","loadIframe","sublabel","count","checked","subcontentPrefix","manual","manualInputWrapperElement","manualCount","current","totalCount","dsoFocus","variant","reverseAlign","_getState","listTitle","compact","noIcon","yellow","border","white","dropShadow","ribbon","progress","filterpanelOpen","overlayOpen","documentPanelOpen","mainSize","activeTab","documentPanelSize","mainPanelExpanded","mainPanelHidden","tabView","_checkMainPanelVisibility","dropdownAlign","checkable","boundary","placement","strategy","size","block","scrollPosition","_setScrollState","enableAnimation","minimumHeight","animationReady","sizeAlias","sizeWidth","getSize","type","describedById","labelledById","indeterminate","infoFixed","infoActive","keyboardFocus","toggleInfo","fixed","descriptive","noArrow","stateless","hidden","activate","deactivate","content","inline","mark","state","removable","truncate","removeHover","removeFocus","textHover","textFocus","isTruncated","labelText","_truncateLabel","roleAlert","zoomable","noModal","isResponsive","modalActive","placeholderHeight","nummer","opschrift","inhoud","genesteOntwerpInformatie","bevatOntwerpInformatie","annotated","gereserveerd","vervallen","openAnnotation","alternativeTitle","wijzigactie","recursiveToggle","annotationPrefix","accessibleLabel","labelledbyId","hasVisibleLabel"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAc,kDAAuC,CAAAC,WAAA,oBAAAC,SAAA,gBAAAC,YAAA,mBAAAC,SAAA,KAAAC,SAAA,KAAAC,aAAA,KAAAC,iBAAA,KAAAC,SAAA,KAAAC,cAAA,KAAAC,4BAAA,YAAAR,SAAA,oBAAAC,YAAA,oEAAAQ,MAAA,IAAAC,WAAA,+CAAAD,MAAA,IAAAE,SAAA,oDAAAC,YAAA,mBAAAC,QAAA,IAAAC,UAAA,iBAAAC,OAAA,IAAAC,gBAAA,uBAAAC,KAAA,IAAAC,kBAAA,yBAAAC,KAAA,MAAAC,mBAAA,6BAAAC,MAAA,KAAAC,YAAA,4CAAAC,MAAA,IAAAC,SAAA,IAAAC,MAAA,IAAAC,UAAA,IAAAC,OAAA,yCAAAC,SAAA,KAAAC,gBAAA,yBAAAC,WAAA,kBAAAC,SAAA,gBAAAC,UAAA,iBAAAC,SAAA,gBAAAC,QAAA,eAAAC,gBAAA,wBAAAC,eAAA,uBAAAC,YAAA,oBAAAC,eAAA,uBAAAC,aAAA,KAAAC,kBAAA,KAA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cAAA,KAAAC,WAAA,YAAAJ,cAAA,sCAAAK,MAAA,MAAA5H,OAAA,2CAAA6H,YAAA,MAAAhI,SAAA,IAAA4G,SAAA,IAAAqB,QAAA,eAAAC,UAAA,IAAAjI,MAAA,IAAAE,OAAA,OAAAgI,OAAA,KAAAC,SAAA,KAAAC,WAAA,YAAArI,SAAA,kBAAA4G,SAAA,kBAAAzG,OAAA,0DAAAmI,QAAA,IAAAC,OAAA,MAAAC,KAAA,KAAAC,MAAA,YAAAH,QAAA,qCAAAhD,QAAA,IAAAoD,UAAA,IAAAnJ,OAAA,IAAAoJ,SAAA,IAAAC,YAAA,KAAAC,YAAA,KAAAC,UAAA,KAAAC,UAAA,KAAAC,YAAA,KAAAC,UAAA,KAAAC,eAAA,yCAAAR,UAAA,mBAAAC,SAAA,oCAAApJ,OAAA,IAAA4J,UAAA,+CAAA/F,WAAA,IAAAzD,KAAA,sBAAAJ,OAAA,8BAAAY,OAAA,KAAAiJ,SAAA,mDAAAC,QAAA,iBAAAC,aAAA,sBAAAC,YAAA,KAAAC,kBAAA,qDAAAnK,QAAA,IAAAU,MAAA,IAAA0J,OAAA,IAAAC,UAAA,IAAAC,OAAA,IAAAhK,KAAA,MAAAb,SAAA,MAAAC,cAAA,uBAAA6K,yBAAA,mCAAAC,uBAAA,iCAAAC,UAAA,MAAAC,aAAA,IAAAC,UAAA,IAAAC,eAAA,sBAAAC,iBAAA,wBAAA3C,KAAA,MAAA4C,YAAA,MAAA3B,KAAA,KAAA4B,gBAAA,qDAAAhH,WAAA,MAAAiH,iBAAA,0BAAA1K,KAAA,+BAAA+E,QAAA,IAAArB,SAAA,IAAAiH,gBAAA,uBAAAC,aAAA,oBAAAnH,WAAA,IAAAoH,gBAAA,UAAAnM"}
1
+ {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","showCanvas","jsonFile","openDefault","response","document","openOrClosed","openedAnnotation","filtered","notApplicable","activeAnnotationSelectables","group","baseLayers","overlays","handleTitle","heading","handleUrl","status","attachmentCount","icon","statusDescription","open","hasNestedAccordion","hover","focusHandle","label","position","small","secondary","active","activeHint","mainMenu","useDropDownMenu","authStatus","loginUrl","logoutUrl","showHelp","helpUrl","userProfileName","userProfileUrl","userHomeUrl","userHomeActive","showDropDown","overflowMenuItems","dropdownOptionsOffset","disableZoom","hideContent","toggleVisibility","fullscreen","modalTitle","role","returnFocus","showCloseButton","ariaId","totalPages","currentPage","formatHref","availablePositions","collection","focusItem","step","itemTitle","flowLine","warning","divider","suggestions","loading","loadingLabel","loadingDelayed","notFoundLabel","suggestOnFocus","showSuggestions","selectedSuggestion","notFound","showLoading","clickable","imageShape","mode","name","identifier","disabled","direction","required","invalid","describedBy","dsoAutofocus","value","min","max","activeFocus","focusedDay","visible","setFocus","show","hide","visibility","isOpen","slideState","loadIframe","sublabel","count","checked","subcontentPrefix","manual","manualInputWrapperElement","manualCount","current","totalCount","dsoFocus","variant","reverseAlign","_getState","listTitle","compact","noIcon","yellow","border","white","dropShadow","ribbon","progress","filterpanelOpen","overlayOpen","documentPanelOpen","mainSize","activeTab","documentPanelSize","mainPanelExpanded","mainPanelHidden","tabView","_checkMainPanelVisibility","dropdownAlign","checkable","boundary","placement","strategy","size","block","scrollPosition","_setScrollState","enableAnimation","minimumHeight","animationReady","sizeAlias","sizeWidth","getSize","type","describedById","labelledById","indeterminate","infoFixed","infoActive","keyboardFocus","toggleInfo","fixed","descriptive","noArrow","stateless","hidden","activate","deactivate","content","inline","mark","state","removable","truncate","removeHover","removeFocus","textHover","textFocus","isTruncated","labelText","_truncateLabel","roleAlert","zoomable","noModal","isResponsive","modalActive","placeholderHeight","nummer","opschrift","inhoud","genesteOntwerpInformatie","bevatOntwerpInformatie","annotated","gereserveerd","vervallen","openAnnotation","alternativeTitle","wijzigactie","recursiveToggle","annotationPrefix","accessibleLabel","labelledbyId","hasVisibleLabel"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DAT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