@dso-toolkit/core 55.0.0 → 56.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/dist/cjs/dso-accordion-section.cjs.entry.js +30 -87
  2. package/dist/cjs/dso-accordion-section.cjs.entry.js.map +1 -1
  3. package/dist/cjs/dso-accordion.cjs.entry.js +197 -107
  4. package/dist/cjs/dso-accordion.cjs.entry.js.map +1 -1
  5. package/dist/cjs/dso-alert_5.cjs.entry.js +719 -0
  6. package/dist/cjs/dso-alert_5.cjs.entry.js.map +1 -0
  7. package/dist/cjs/dso-annotation-output_3.cjs.entry.js +143 -0
  8. package/dist/cjs/dso-annotation-output_3.cjs.entry.js.map +1 -0
  9. package/dist/cjs/dso-expandable.cjs.entry.js +17 -36
  10. package/dist/cjs/dso-expandable.cjs.entry.js.map +1 -1
  11. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  12. package/dist/cjs/dsot-document-component-demo.cjs.entry.js +110 -0
  13. package/dist/cjs/dsot-document-component-demo.cjs.entry.js.map +1 -0
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/collection/collection-manifest.json +5 -4
  16. package/dist/collection/components/accordion/accordion.interfaces.js.map +1 -1
  17. package/dist/collection/components/accordion/accordion.js +9 -254
  18. package/dist/collection/components/accordion/accordion.js.map +1 -1
  19. package/dist/collection/components/accordion/components/accordion-section.js +68 -126
  20. package/dist/collection/components/accordion/components/accordion-section.js.map +1 -1
  21. package/dist/collection/components/annotation-button/annotation-button.css +1003 -0
  22. package/dist/collection/components/annotation-button/annotation-button.js +48 -7
  23. package/dist/collection/components/annotation-button/annotation-button.js.map +1 -1
  24. package/dist/collection/components/annotation-output/annotation-output.css +2 -2
  25. package/dist/collection/components/annotation-output/annotation-output.js +32 -64
  26. package/dist/collection/components/annotation-output/annotation-output.js.map +1 -1
  27. package/dist/collection/components/document-component/document-component-heading.js +30 -0
  28. package/dist/collection/components/document-component/document-component-heading.js.map +1 -0
  29. package/dist/collection/components/document-component/document-component.css +135 -0
  30. package/dist/collection/components/document-component/document-component.demo.js +112 -0
  31. package/dist/collection/components/document-component/document-component.demo.js.map +1 -0
  32. package/dist/collection/components/document-component/document-component.js +414 -0
  33. package/dist/collection/components/document-component/document-component.js.map +1 -0
  34. package/dist/collection/components/document-component/document-component.types.js +2 -0
  35. package/dist/collection/components/document-component/document-component.types.js.map +1 -0
  36. package/dist/collection/components/expandable/expandable.js +28 -94
  37. package/dist/collection/components/expandable/expandable.js.map +1 -1
  38. package/dist/collection/components/ozon-content/ozon-content-mapper.js +9 -1
  39. package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +1 -1
  40. package/dist/collection/components/ozon-content/ozon-content.css +49 -1
  41. package/dist/collection/components/ozon-content/ozon-content.js +1 -1
  42. package/dist/collection/components/ozon-content/ozon-content.js.map +1 -1
  43. package/dist/{esm/dso-alert.entry.js → components/alert.js} +33 -9
  44. package/dist/components/alert.js.map +1 -0
  45. package/dist/components/annotation-button.js +46 -0
  46. package/dist/components/annotation-button.js.map +1 -0
  47. package/dist/components/annotation-output.js +60 -0
  48. package/dist/components/annotation-output.js.map +1 -0
  49. package/dist/{esm/dso-badge.entry.js → components/badge.js} +26 -9
  50. package/dist/components/badge.js.map +1 -0
  51. package/dist/components/document-component.js +163 -0
  52. package/dist/components/document-component.js.map +1 -0
  53. package/dist/components/dso-accordion-section.js +35 -94
  54. package/dist/components/dso-accordion-section.js.map +1 -1
  55. package/dist/components/dso-accordion.js +199 -113
  56. package/dist/components/dso-accordion.js.map +1 -1
  57. package/dist/components/dso-alert.js +1 -50
  58. package/dist/components/dso-alert.js.map +1 -1
  59. package/dist/components/dso-annotation-button.js +1 -40
  60. package/dist/components/dso-annotation-button.js.map +1 -1
  61. package/dist/components/dso-annotation-output.js +1 -71
  62. package/dist/components/dso-annotation-output.js.map +1 -1
  63. package/dist/components/dso-autosuggest.js +1 -1
  64. package/dist/components/dso-badge.js +1 -32
  65. package/dist/components/dso-badge.js.map +1 -1
  66. package/dist/components/dso-document-component.d.ts +11 -0
  67. package/dist/components/dso-document-component.js +8 -0
  68. package/dist/components/dso-document-component.js.map +1 -0
  69. package/dist/components/dso-header.js +1 -1
  70. package/dist/components/dso-image-overlay.js +1 -1
  71. package/dist/components/dso-label.js +1 -161
  72. package/dist/components/dso-label.js.map +1 -1
  73. package/dist/components/dso-ozon-content.js +1 -544
  74. package/dist/components/dso-ozon-content.js.map +1 -1
  75. package/dist/components/dso-slide-toggle.js +1 -52
  76. package/dist/components/dso-slide-toggle.js.map +1 -1
  77. package/dist/components/dso-table.js +1 -1
  78. package/dist/components/dsot-document-component-demo.d.ts +11 -0
  79. package/dist/components/dsot-document-component-demo.js +202 -0
  80. package/dist/components/dsot-document-component-demo.js.map +1 -0
  81. package/dist/components/expandable.js +19 -40
  82. package/dist/components/expandable.js.map +1 -1
  83. package/dist/components/index.d.ts +4 -2
  84. package/dist/components/index.js +2 -1
  85. package/dist/components/index.js.map +1 -1
  86. package/dist/components/index2.js +61 -185
  87. package/dist/components/index2.js.map +1 -1
  88. package/dist/{esm/dso-label.entry.js → components/label.js} +50 -11
  89. package/dist/components/label.js.map +1 -0
  90. package/dist/{esm/dso-ozon-content.entry.js → components/ozon-content.js} +43 -14
  91. package/dist/components/ozon-content.js.map +1 -0
  92. package/dist/components/scrollable.js +1 -1
  93. package/dist/{esm/dso-slide-toggle.entry.js → components/slide-toggle.js} +31 -10
  94. package/dist/{dso-toolkit/p-b1627d68.entry.js.map → components/slide-toggle.js.map} +1 -1
  95. package/dist/components/tooltip.js +1 -1
  96. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  97. package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
  98. package/dist/dso-toolkit/{p-12c3fc19.entry.js → p-05ea1fba.entry.js} +2 -2
  99. package/dist/dso-toolkit/{p-657c43f4.entry.js → p-0e5a93c3.entry.js} +2 -2
  100. package/dist/dso-toolkit/p-14453f73.entry.js +2 -0
  101. package/dist/dso-toolkit/p-14453f73.entry.js.map +1 -0
  102. package/dist/dso-toolkit/{p-63ce173c.entry.js → p-168750a2.entry.js} +2 -2
  103. package/dist/dso-toolkit/{p-554e7d6a.entry.js → p-1cc75e0b.entry.js} +2 -2
  104. package/dist/dso-toolkit/{p-904a2caf.entry.js → p-29752a45.entry.js} +2 -2
  105. package/dist/dso-toolkit/{p-9c2d4a91.entry.js → p-29b741cb.entry.js} +2 -2
  106. package/dist/dso-toolkit/p-39f6447d.entry.js +2 -0
  107. package/dist/dso-toolkit/p-39f6447d.entry.js.map +1 -0
  108. package/dist/dso-toolkit/{p-fdf8bd94.entry.js → p-3c554a18.entry.js} +2 -2
  109. package/dist/dso-toolkit/{p-d4f8e1e0.entry.js → p-3fa7489e.entry.js} +2 -2
  110. package/dist/dso-toolkit/{p-fa6d8d5a.entry.js → p-422bcf93.entry.js} +2 -2
  111. package/dist/dso-toolkit/p-42d3c595.entry.js +2 -0
  112. package/dist/dso-toolkit/{p-1d3ed808.entry.js.map → p-42d3c595.entry.js.map} +1 -1
  113. package/dist/dso-toolkit/p-484ea1d2.entry.js +2 -0
  114. package/dist/dso-toolkit/p-484ea1d2.entry.js.map +1 -0
  115. package/dist/dso-toolkit/p-5265e22b.entry.js +2 -0
  116. package/dist/dso-toolkit/p-56d87a53.entry.js +2 -0
  117. package/dist/dso-toolkit/p-56d87a53.entry.js.map +1 -0
  118. package/dist/dso-toolkit/{p-71143eef.entry.js → p-6050e8e6.entry.js} +2 -2
  119. package/dist/dso-toolkit/{p-5040a304.entry.js → p-674e2406.entry.js} +2 -2
  120. package/dist/dso-toolkit/{p-2bd5d2a2.entry.js → p-68e9f61b.entry.js} +2 -2
  121. package/dist/dso-toolkit/{p-f70d6a66.entry.js → p-818d032e.entry.js} +2 -2
  122. package/dist/dso-toolkit/{p-a4e3638a.entry.js → p-83cdfde8.entry.js} +2 -2
  123. package/dist/dso-toolkit/{p-8f166691.entry.js → p-909ccf98.entry.js} +2 -2
  124. package/dist/dso-toolkit/{p-58bed94b.entry.js → p-9b587a94.entry.js} +2 -2
  125. package/dist/dso-toolkit/p-9c0477fc.entry.js +2 -0
  126. package/dist/dso-toolkit/{p-56069350.entry.js.map → p-9c0477fc.entry.js.map} +1 -1
  127. package/dist/dso-toolkit/{p-79767cc1.entry.js → p-9f2bb98b.entry.js} +2 -2
  128. package/dist/dso-toolkit/{p-6e0b67c9.entry.js → p-9fee52e5.entry.js} +2 -2
  129. package/dist/dso-toolkit/{p-9b14a015.entry.js → p-a616ab8a.entry.js} +2 -2
  130. package/dist/dso-toolkit/{p-ef23bffb.entry.js → p-b627d9ac.entry.js} +2 -2
  131. package/dist/dso-toolkit/{p-9d64a2f4.entry.js → p-b67631ef.entry.js} +2 -2
  132. package/dist/dso-toolkit/{p-0653b5d2.entry.js → p-bcae3f55.entry.js} +2 -2
  133. package/dist/dso-toolkit/{p-b1b53cb3.entry.js → p-bf203ab8.entry.js} +2 -2
  134. package/dist/dso-toolkit/{p-ee2771d4.entry.js → p-c8165a50.entry.js} +2 -2
  135. package/dist/dso-toolkit/{p-26cdce1c.js → p-ce928197.js} +2 -2
  136. package/dist/dso-toolkit/{p-601b4ce0.entry.js → p-cfd6f4ef.entry.js} +2 -2
  137. package/dist/dso-toolkit/{p-b6f1ae13.entry.js → p-d3f69d06.entry.js} +2 -2
  138. package/dist/dso-toolkit/{p-3ab9390b.entry.js → p-d8c137b5.entry.js} +2 -2
  139. package/dist/dso-toolkit/p-debbe184.entry.js +2 -0
  140. package/dist/dso-toolkit/{p-c3178955.entry.js.map → p-debbe184.entry.js.map} +1 -1
  141. package/dist/dso-toolkit/{p-7098eb9d.entry.js → p-ec4b568d.entry.js} +2 -2
  142. package/dist/dso-toolkit/p-ec4b568d.entry.js.map +1 -0
  143. package/dist/dso-toolkit/p-fafa5ea1.entry.js +2 -0
  144. package/dist/dso-toolkit/p-fafa5ea1.entry.js.map +1 -0
  145. package/dist/esm/dso-accordion-section.entry.js +31 -88
  146. package/dist/esm/dso-accordion-section.entry.js.map +1 -1
  147. package/dist/esm/dso-accordion.entry.js +198 -108
  148. package/dist/esm/dso-accordion.entry.js.map +1 -1
  149. package/dist/esm/dso-action-list-item.entry.js +1 -1
  150. package/dist/esm/dso-action-list.entry.js +1 -1
  151. package/dist/esm/dso-alert_5.entry.js +711 -0
  152. package/dist/esm/dso-alert_5.entry.js.map +1 -0
  153. package/dist/esm/dso-annotation-output_3.entry.js +137 -0
  154. package/dist/esm/dso-annotation-output_3.entry.js.map +1 -0
  155. package/dist/esm/dso-attachments-counter.entry.js +1 -1
  156. package/dist/esm/dso-autosuggest.entry.js +1 -1
  157. package/dist/esm/dso-banner.entry.js +1 -1
  158. package/dist/esm/dso-card-container.entry.js +1 -1
  159. package/dist/esm/dso-card.entry.js +1 -1
  160. package/dist/esm/dso-date-picker.entry.js +1 -1
  161. package/dist/esm/dso-dropdown-menu.entry.js +1 -1
  162. package/dist/esm/dso-expandable.entry.js +18 -37
  163. package/dist/esm/dso-expandable.entry.js.map +1 -1
  164. package/dist/esm/dso-header.entry.js +1 -1
  165. package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
  166. package/dist/esm/dso-highlight-box.entry.js +1 -1
  167. package/dist/esm/dso-icon.entry.js +1 -1
  168. package/dist/esm/dso-image-overlay.entry.js +1 -1
  169. package/dist/esm/dso-info-button.entry.js +1 -1
  170. package/dist/esm/dso-info_2.entry.js +1 -1
  171. package/dist/esm/dso-list-button.entry.js +1 -1
  172. package/dist/esm/dso-map-base-layers.entry.js +1 -1
  173. package/dist/esm/dso-map-controls.entry.js +1 -1
  174. package/dist/esm/dso-map-overlays.entry.js +1 -1
  175. package/dist/esm/dso-modal.entry.js +1 -1
  176. package/dist/esm/dso-pagination.entry.js +1 -1
  177. package/dist/esm/dso-progress-bar.entry.js +1 -1
  178. package/dist/esm/dso-progress-indicator.entry.js +1 -1
  179. package/dist/esm/dso-responsive-element.entry.js +1 -1
  180. package/dist/esm/dso-scrollable.entry.js +1 -1
  181. package/dist/esm/dso-table.entry.js +1 -1
  182. package/dist/esm/dso-toggletip.entry.js +1 -1
  183. package/dist/esm/dso-toolkit.js +3 -3
  184. package/dist/esm/dso-tooltip.entry.js +1 -1
  185. package/dist/esm/dso-tree-view.entry.js +1 -1
  186. package/dist/esm/dso-viewer-grid.entry.js +1 -1
  187. package/dist/esm/dsot-document-component-demo.entry.js +106 -0
  188. package/dist/esm/dsot-document-component-demo.entry.js.map +1 -0
  189. package/dist/esm/{index-898d8443.js → index-367cff36.js} +2 -2
  190. package/dist/esm/{index-898d8443.js.map → index-367cff36.js.map} +1 -1
  191. package/dist/esm/loader.js +3 -3
  192. package/dist/types/components/accordion/accordion.d.ts +6 -39
  193. package/dist/types/components/accordion/accordion.interfaces.d.ts +21 -15
  194. package/dist/types/components/accordion/components/accordion-section.d.ts +15 -18
  195. package/dist/types/components/annotation-button/annotation-button.d.ts +15 -4
  196. package/dist/types/components/annotation-output/annotation-output.d.ts +7 -5
  197. package/dist/types/components/document-component/document-component-heading.d.ts +7 -0
  198. package/dist/types/components/document-component/document-component.d.ts +84 -0
  199. package/dist/types/components/document-component/document-component.demo.d.ts +40 -0
  200. package/dist/types/components/document-component/document-component.types.d.ts +8 -0
  201. package/dist/types/components/expandable/expandable.d.ts +5 -12
  202. package/dist/types/components.d.ts +233 -125
  203. package/package.json +2 -2
  204. package/dist/cjs/annotation.service-60e6b0f1.js +0 -23
  205. package/dist/cjs/annotation.service-60e6b0f1.js.map +0 -1
  206. package/dist/cjs/dso-alert.cjs.entry.js +0 -34
  207. package/dist/cjs/dso-alert.cjs.entry.js.map +0 -1
  208. package/dist/cjs/dso-annotation-button.cjs.entry.js +0 -27
  209. package/dist/cjs/dso-annotation-button.cjs.entry.js.map +0 -1
  210. package/dist/cjs/dso-annotation-output.cjs.entry.js +0 -44
  211. package/dist/cjs/dso-annotation-output.cjs.entry.js.map +0 -1
  212. package/dist/cjs/dso-badge.cjs.entry.js +0 -23
  213. package/dist/cjs/dso-badge.cjs.entry.js.map +0 -1
  214. package/dist/cjs/dso-expandable-heading.cjs.entry.js +0 -54
  215. package/dist/cjs/dso-expandable-heading.cjs.entry.js.map +0 -1
  216. package/dist/cjs/dso-label.cjs.entry.js +0 -130
  217. package/dist/cjs/dso-label.cjs.entry.js.map +0 -1
  218. package/dist/cjs/dso-ozon-content.cjs.entry.js +0 -532
  219. package/dist/cjs/dso-ozon-content.cjs.entry.js.map +0 -1
  220. package/dist/cjs/dso-slide-toggle.cjs.entry.js +0 -39
  221. package/dist/cjs/dso-slide-toggle.cjs.entry.js.map +0 -1
  222. package/dist/cjs/index-a189d603.js +0 -198
  223. package/dist/cjs/index-a189d603.js.map +0 -1
  224. package/dist/collection/components/annotation-output/annotation-output.interfaces.js +0 -2
  225. package/dist/collection/components/annotation-output/annotation-output.interfaces.js.map +0 -1
  226. package/dist/collection/components/expandable/expandable.functions.js +0 -4
  227. package/dist/collection/components/expandable/expandable.functions.js.map +0 -1
  228. package/dist/collection/components/expandable-heading/expandable-heading.css +0 -200
  229. package/dist/collection/components/expandable-heading/expandable-heading.interfaces.js +0 -2
  230. package/dist/collection/components/expandable-heading/expandable-heading.interfaces.js.map +0 -1
  231. package/dist/collection/components/expandable-heading/expandable-heading.js +0 -163
  232. package/dist/collection/components/expandable-heading/expandable-heading.js.map +0 -1
  233. package/dist/collection/components/expandable-heading/heading.js +0 -17
  234. package/dist/collection/components/expandable-heading/heading.js.map +0 -1
  235. package/dist/collection/services/annotation.service.js +0 -17
  236. package/dist/collection/services/annotation.service.js.map +0 -1
  237. package/dist/components/annotation.service.js +0 -21
  238. package/dist/components/annotation.service.js.map +0 -1
  239. package/dist/components/dso-expandable-heading.d.ts +0 -11
  240. package/dist/components/dso-expandable-heading.js +0 -86
  241. package/dist/components/dso-expandable-heading.js.map +0 -1
  242. package/dist/components/index3.js +0 -72
  243. package/dist/components/index3.js.map +0 -1
  244. package/dist/dso-toolkit/p-0c762ac9.entry.js +0 -2
  245. package/dist/dso-toolkit/p-0c762ac9.entry.js.map +0 -1
  246. package/dist/dso-toolkit/p-0ffae824.entry.js +0 -2
  247. package/dist/dso-toolkit/p-0ffae824.entry.js.map +0 -1
  248. package/dist/dso-toolkit/p-1d3ed808.entry.js +0 -2
  249. package/dist/dso-toolkit/p-26713aef.js +0 -2
  250. package/dist/dso-toolkit/p-26713aef.js.map +0 -1
  251. package/dist/dso-toolkit/p-52f2be73.entry.js +0 -2
  252. package/dist/dso-toolkit/p-52f2be73.entry.js.map +0 -1
  253. package/dist/dso-toolkit/p-56069350.entry.js +0 -2
  254. package/dist/dso-toolkit/p-59ff4e19.entry.js +0 -2
  255. package/dist/dso-toolkit/p-59ff4e19.entry.js.map +0 -1
  256. package/dist/dso-toolkit/p-7098eb9d.entry.js.map +0 -1
  257. package/dist/dso-toolkit/p-835a599b.entry.js +0 -2
  258. package/dist/dso-toolkit/p-91453b47.entry.js +0 -2
  259. package/dist/dso-toolkit/p-91453b47.entry.js.map +0 -1
  260. package/dist/dso-toolkit/p-9eccd618.js +0 -2
  261. package/dist/dso-toolkit/p-9eccd618.js.map +0 -1
  262. package/dist/dso-toolkit/p-b1627d68.entry.js +0 -2
  263. package/dist/dso-toolkit/p-c3178955.entry.js +0 -2
  264. package/dist/dso-toolkit/p-c464da66.entry.js +0 -2
  265. package/dist/dso-toolkit/p-c464da66.entry.js.map +0 -1
  266. package/dist/dso-toolkit/p-c4e1c7cb.entry.js +0 -2
  267. package/dist/dso-toolkit/p-c4e1c7cb.entry.js.map +0 -1
  268. package/dist/dso-toolkit/p-dd9e9c47.entry.js +0 -2
  269. package/dist/dso-toolkit/p-dd9e9c47.entry.js.map +0 -1
  270. package/dist/dso-toolkit/p-de310a49.entry.js +0 -2
  271. package/dist/dso-toolkit/p-de310a49.entry.js.map +0 -1
  272. package/dist/esm/annotation.service-cd25eba0.js +0 -21
  273. package/dist/esm/annotation.service-cd25eba0.js.map +0 -1
  274. package/dist/esm/dso-alert.entry.js.map +0 -1
  275. package/dist/esm/dso-annotation-button.entry.js +0 -23
  276. package/dist/esm/dso-annotation-button.entry.js.map +0 -1
  277. package/dist/esm/dso-annotation-output.entry.js +0 -40
  278. package/dist/esm/dso-annotation-output.entry.js.map +0 -1
  279. package/dist/esm/dso-badge.entry.js.map +0 -1
  280. package/dist/esm/dso-expandable-heading.entry.js +0 -50
  281. package/dist/esm/dso-expandable-heading.entry.js.map +0 -1
  282. package/dist/esm/dso-label.entry.js.map +0 -1
  283. package/dist/esm/dso-ozon-content.entry.js.map +0 -1
  284. package/dist/esm/dso-slide-toggle.entry.js.map +0 -1
  285. package/dist/esm/index-b57dbe04.js +0 -196
  286. package/dist/esm/index-b57dbe04.js.map +0 -1
  287. package/dist/types/components/annotation-output/annotation-output.interfaces.d.ts +0 -4
  288. package/dist/types/components/expandable/expandable.functions.d.ts +0 -1
  289. package/dist/types/components/expandable-heading/expandable-heading.d.ts +0 -33
  290. package/dist/types/components/expandable-heading/expandable-heading.interfaces.d.ts +0 -6
  291. package/dist/types/components/expandable-heading/heading.d.ts +0 -9
  292. package/dist/types/services/annotation.service.d.ts +0 -10
  293. /package/dist/dso-toolkit/{p-12c3fc19.entry.js.map → p-05ea1fba.entry.js.map} +0 -0
  294. /package/dist/dso-toolkit/{p-657c43f4.entry.js.map → p-0e5a93c3.entry.js.map} +0 -0
  295. /package/dist/dso-toolkit/{p-63ce173c.entry.js.map → p-168750a2.entry.js.map} +0 -0
  296. /package/dist/dso-toolkit/{p-554e7d6a.entry.js.map → p-1cc75e0b.entry.js.map} +0 -0
  297. /package/dist/dso-toolkit/{p-904a2caf.entry.js.map → p-29752a45.entry.js.map} +0 -0
  298. /package/dist/dso-toolkit/{p-9c2d4a91.entry.js.map → p-29b741cb.entry.js.map} +0 -0
  299. /package/dist/dso-toolkit/{p-fdf8bd94.entry.js.map → p-3c554a18.entry.js.map} +0 -0
  300. /package/dist/dso-toolkit/{p-d4f8e1e0.entry.js.map → p-3fa7489e.entry.js.map} +0 -0
  301. /package/dist/dso-toolkit/{p-fa6d8d5a.entry.js.map → p-422bcf93.entry.js.map} +0 -0
  302. /package/dist/dso-toolkit/{p-835a599b.entry.js.map → p-5265e22b.entry.js.map} +0 -0
  303. /package/dist/dso-toolkit/{p-71143eef.entry.js.map → p-6050e8e6.entry.js.map} +0 -0
  304. /package/dist/dso-toolkit/{p-5040a304.entry.js.map → p-674e2406.entry.js.map} +0 -0
  305. /package/dist/dso-toolkit/{p-2bd5d2a2.entry.js.map → p-68e9f61b.entry.js.map} +0 -0
  306. /package/dist/dso-toolkit/{p-f70d6a66.entry.js.map → p-818d032e.entry.js.map} +0 -0
  307. /package/dist/dso-toolkit/{p-a4e3638a.entry.js.map → p-83cdfde8.entry.js.map} +0 -0
  308. /package/dist/dso-toolkit/{p-8f166691.entry.js.map → p-909ccf98.entry.js.map} +0 -0
  309. /package/dist/dso-toolkit/{p-58bed94b.entry.js.map → p-9b587a94.entry.js.map} +0 -0
  310. /package/dist/dso-toolkit/{p-79767cc1.entry.js.map → p-9f2bb98b.entry.js.map} +0 -0
  311. /package/dist/dso-toolkit/{p-6e0b67c9.entry.js.map → p-9fee52e5.entry.js.map} +0 -0
  312. /package/dist/dso-toolkit/{p-9b14a015.entry.js.map → p-a616ab8a.entry.js.map} +0 -0
  313. /package/dist/dso-toolkit/{p-ef23bffb.entry.js.map → p-b627d9ac.entry.js.map} +0 -0
  314. /package/dist/dso-toolkit/{p-9d64a2f4.entry.js.map → p-b67631ef.entry.js.map} +0 -0
  315. /package/dist/dso-toolkit/{p-0653b5d2.entry.js.map → p-bcae3f55.entry.js.map} +0 -0
  316. /package/dist/dso-toolkit/{p-b1b53cb3.entry.js.map → p-bf203ab8.entry.js.map} +0 -0
  317. /package/dist/dso-toolkit/{p-ee2771d4.entry.js.map → p-c8165a50.entry.js.map} +0 -0
  318. /package/dist/dso-toolkit/{p-26cdce1c.js.map → p-ce928197.js.map} +0 -0
  319. /package/dist/dso-toolkit/{p-601b4ce0.entry.js.map → p-cfd6f4ef.entry.js.map} +0 -0
  320. /package/dist/dso-toolkit/{p-b6f1ae13.entry.js.map → p-d3f69d06.entry.js.map} +0 -0
  321. /package/dist/dso-toolkit/{p-3ab9390b.entry.js.map → p-d8c137b5.entry.js.map} +0 -0
@@ -1,151 +1,237 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { c as createStore } from './index2.js';
1
+ import { getRenderingRef, forceUpdate, proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const appendToMap = (map, propName, value) => {
4
+ const items = map.get(propName);
5
+ if (!items) {
6
+ map.set(propName, [value]);
7
+ }
8
+ else if (!items.includes(value)) {
9
+ items.push(value);
10
+ }
11
+ };
12
+ const debounce = (fn, ms) => {
13
+ let timeoutId;
14
+ return (...args) => {
15
+ if (timeoutId) {
16
+ clearTimeout(timeoutId);
17
+ }
18
+ timeoutId = setTimeout(() => {
19
+ timeoutId = 0;
20
+ fn(...args);
21
+ }, ms);
22
+ };
23
+ };
24
+
25
+ /**
26
+ * Check if a possible element isConnected.
27
+ * The property might not be there, so we check for it.
28
+ *
29
+ * We want it to return true if isConnected is not a property,
30
+ * otherwise we would remove these elements and would not update.
31
+ *
32
+ * Better leak in Edge than to be useless.
33
+ */
34
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
35
+ const cleanupElements = debounce((map) => {
36
+ for (let key of map.keys()) {
37
+ map.set(key, map.get(key).filter(isConnected));
38
+ }
39
+ }, 2000);
40
+ const stencilSubscription = () => {
41
+ if (typeof getRenderingRef !== 'function') {
42
+ // If we are not in a stencil project, we do nothing.
43
+ // This function is not really exported by @stencil/core.
44
+ return {};
45
+ }
46
+ const elmsToUpdate = new Map();
47
+ return {
48
+ dispose: () => elmsToUpdate.clear(),
49
+ get: (propName) => {
50
+ const elm = getRenderingRef();
51
+ if (elm) {
52
+ appendToMap(elmsToUpdate, propName, elm);
53
+ }
54
+ },
55
+ set: (propName) => {
56
+ const elements = elmsToUpdate.get(propName);
57
+ if (elements) {
58
+ elmsToUpdate.set(propName, elements.filter(forceUpdate));
59
+ }
60
+ cleanupElements(elmsToUpdate);
61
+ },
62
+ reset: () => {
63
+ elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
64
+ cleanupElements(elmsToUpdate);
65
+ },
66
+ };
67
+ };
68
+
69
+ const unwrap = (val) => (typeof val === 'function' ? val() : val);
70
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
71
+ const unwrappedState = unwrap(defaultState);
72
+ let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
73
+ const handlers = {
74
+ dispose: [],
75
+ get: [],
76
+ set: [],
77
+ reset: [],
78
+ };
79
+ const reset = () => {
80
+ var _a;
81
+ // When resetting the state, the default state may be a function - unwrap it to invoke it.
82
+ // otherwise, the state won't be properly reset
83
+ states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
84
+ handlers.reset.forEach((cb) => cb());
85
+ };
86
+ const dispose = () => {
87
+ // Call first dispose as resetting the state would
88
+ // cause less updates ;)
89
+ handlers.dispose.forEach((cb) => cb());
90
+ reset();
91
+ };
92
+ const get = (propName) => {
93
+ handlers.get.forEach((cb) => cb(propName));
94
+ return states.get(propName);
95
+ };
96
+ const set = (propName, value) => {
97
+ const oldValue = states.get(propName);
98
+ if (shouldUpdate(value, oldValue, propName)) {
99
+ states.set(propName, value);
100
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
101
+ }
102
+ };
103
+ const state = (typeof Proxy === 'undefined'
104
+ ? {}
105
+ : new Proxy(unwrappedState, {
106
+ get(_, propName) {
107
+ return get(propName);
108
+ },
109
+ ownKeys(_) {
110
+ return Array.from(states.keys());
111
+ },
112
+ getOwnPropertyDescriptor() {
113
+ return {
114
+ enumerable: true,
115
+ configurable: true,
116
+ };
117
+ },
118
+ has(_, propName) {
119
+ return states.has(propName);
120
+ },
121
+ set(_, propName, value) {
122
+ set(propName, value);
123
+ return true;
124
+ },
125
+ }));
126
+ const on = (eventName, callback) => {
127
+ handlers[eventName].push(callback);
128
+ return () => {
129
+ removeFromArray(handlers[eventName], callback);
130
+ };
131
+ };
132
+ const onChange = (propName, cb) => {
133
+ const unSet = on('set', (key, newValue) => {
134
+ if (key === propName) {
135
+ cb(newValue);
136
+ }
137
+ });
138
+ // We need to unwrap the defaultState because it might be a function.
139
+ // Otherwise we might not be sending the right reset value.
140
+ const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
141
+ return () => {
142
+ unSet();
143
+ unReset();
144
+ };
145
+ };
146
+ const use = (...subscriptions) => {
147
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
148
+ if (subscription.set) {
149
+ unsubs.push(on('set', subscription.set));
150
+ }
151
+ if (subscription.get) {
152
+ unsubs.push(on('get', subscription.get));
153
+ }
154
+ if (subscription.reset) {
155
+ unsubs.push(on('reset', subscription.reset));
156
+ }
157
+ if (subscription.dispose) {
158
+ unsubs.push(on('dispose', subscription.dispose));
159
+ }
160
+ return unsubs;
161
+ }, []);
162
+ return () => unsubs.forEach((unsub) => unsub());
163
+ };
164
+ const forceUpdate = (key) => {
165
+ const oldValue = states.get(key);
166
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
167
+ };
168
+ return {
169
+ state,
170
+ get,
171
+ set,
172
+ on,
173
+ onChange,
174
+ use,
175
+ dispose,
176
+ reset,
177
+ forceUpdate,
178
+ };
179
+ };
180
+ const removeFromArray = (array, item) => {
181
+ const index = array.indexOf(item);
182
+ if (index >= 0) {
183
+ array[index] = array[array.length - 1];
184
+ array.length--;
185
+ }
186
+ };
187
+
188
+ const createStore = (defaultState, shouldUpdate) => {
189
+ const map = createObservableMap(defaultState, shouldUpdate);
190
+ map.use(stencilSubscription());
191
+ return map;
192
+ };
3
193
 
4
194
  const accordionCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}";
5
195
 
6
196
  const Accordion = /*@__PURE__*/ proxyCustomElement(class Accordion extends HTMLElement {
7
197
  updateVariant(variant = "default") {
8
- this.accordionState.variant = variant || "default";
198
+ this.accordionState.variant = variant;
9
199
  }
10
200
  updateReverseAlign(reverseAlign) {
11
201
  this.accordionState.reverseAlign = reverseAlign;
12
202
  }
13
- updateAllowMultipleOpen(allowMultipleOpen) {
14
- this.accordionState.allowMultipleOpen = allowMultipleOpen;
15
- if (!allowMultipleOpen) {
16
- const openSections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section[open]"));
17
- // By removing the first section, it is kept open;
18
- openSections.shift();
19
- openSections.forEach((section) => this.controlOpenAttribute(section, false));
20
- }
21
- }
22
203
  /**
23
204
  * @internal
24
205
  */
25
206
  async _getState() {
26
207
  return this.accordionState;
27
208
  }
28
- /**
29
- * Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section.
30
- * @param sectionElement The section element that needs to toggle
31
- * @param event The event that the user triggered
32
- * @returns The state of the section
33
- */
34
- async toggleSection(sectionElement, event) {
35
- const sections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section"));
36
- if (typeof sectionElement === "number") {
37
- const section = sections[sectionElement];
38
- if (section instanceof HTMLElement) {
39
- sectionElement = section;
40
- }
41
- }
42
- if (!(sectionElement instanceof HTMLElement) || !sections.includes(sectionElement)) {
43
- return;
44
- }
45
- const sectionIsOpen = this.isSectionOpen(sectionElement);
46
- if (this.allowMultipleOpen) {
47
- this.controlOpenAttribute(sectionElement, !sectionIsOpen);
48
- this.emitToggleEvent(sectionElement, sections, event);
49
- return !sectionIsOpen;
50
- }
51
- if (sectionIsOpen) {
52
- this.controlOpenAttribute(sectionElement, false);
53
- this.emitToggleEvent(sectionElement, sections, event);
54
- return false;
55
- }
56
- await this.closeOpenSections();
57
- this.controlOpenAttribute(sectionElement, true);
58
- this.emitToggleEvent(sectionElement, sections, event);
59
- return true;
60
- }
61
- /**
62
- * Emitted when the animation of opening or closing ends.
63
- */
64
- async animationEnd(sectionElement) {
65
- this.dsoToggleSectionAnimationEnd.emit({
66
- section: {
67
- element: sectionElement,
68
- open: this.isSectionOpen(sectionElement),
69
- },
70
- });
71
- }
72
- /**
73
- * Closes all sections belonging to this accordion.
74
- */
75
- async closeOpenSections() {
76
- const sections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section"));
77
- const openSections = sections.filter((s) => this.isSectionOpen(s));
78
- openSections.forEach((section) => this.controlOpenAttribute(section, false));
79
- }
80
- // These checks are needed for a React timing issue.
81
209
  componentWillLoad() {
82
- if (this.accordionState.variant !== this.variant) {
83
- this.accordionState.variant = this.variant || "default";
84
- }
85
- if (this.accordionState.reverseAlign !== this.reverseAlign) {
86
- this.accordionState.reverseAlign = this.reverseAlign;
87
- }
88
- if (this.accordionState.allowMultipleOpen !== this.allowMultipleOpen) {
89
- this.accordionState.allowMultipleOpen = this.allowMultipleOpen;
90
- }
210
+ this.accordionState.variant = this.variant;
211
+ this.accordionState.reverseAlign = this.reverseAlign;
91
212
  }
92
213
  constructor() {
93
214
  super();
94
215
  this.__registerHost();
95
216
  this.__attachShadow();
96
- this.dsoToggleSection = createEvent(this, "dsoToggleSection", 7);
97
- this.dsoToggleSectionAnimationEnd = createEvent(this, "dsoToggleSectionAnimationEnd", 7);
98
217
  this.variant = "default";
99
218
  this.reverseAlign = false;
100
- this.allowMultipleOpen = false;
101
- const { state } = createStore({
102
- variant: this.variant || "default",
103
- reverseAlign: this.reverseAlign,
104
- allowMultipleOpen: this.allowMultipleOpen,
105
- });
219
+ const { state } = createStore({});
106
220
  this.accordionState = state;
107
221
  }
108
222
  render() {
109
- return (h(Host, { class: {
110
- "dso-accordion": true,
111
- } }, h("slot", null)));
112
- }
113
- emitToggleEvent(sectionElement, sections, e) {
114
- this.dsoToggleSection.emit({
115
- originalEvent: e,
116
- section: {
117
- element: sectionElement,
118
- open: this.isSectionOpen(sectionElement),
119
- },
120
- sections,
121
- });
122
- }
123
- isSectionOpen(sectionElement) {
124
- return typeof sectionElement.getAttribute("open") === "string";
125
- }
126
- controlOpenAttribute(sectionElement, setAttribute) {
127
- if (setAttribute) {
128
- sectionElement.setAttribute("open", "");
129
- }
130
- else {
131
- sectionElement.removeAttribute("open");
132
- }
223
+ return (h(Host, { class: "dso-accordion" }, h("slot", null)));
133
224
  }
134
225
  get host() { return this; }
135
226
  static get watchers() { return {
136
227
  "variant": ["updateVariant"],
137
- "reverseAlign": ["updateReverseAlign"],
138
- "allowMultipleOpen": ["updateAllowMultipleOpen"]
228
+ "reverseAlign": ["updateReverseAlign"]
139
229
  }; }
140
230
  static get style() { return accordionCss; }
141
231
  }, [1, "dso-accordion", {
142
232
  "variant": [513],
143
233
  "reverseAlign": [516, "reverse-align"],
144
- "allowMultipleOpen": [516, "allow-multiple-open"],
145
- "_getState": [64],
146
- "toggleSection": [64],
147
- "animationEnd": [64],
148
- "closeOpenSections": [64]
234
+ "_getState": [64]
149
235
  }]);
150
236
  function defineCustomElement$1() {
151
237
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"dso-accordion.js","mappings":";;;AAAA,MAAM,YAAY,GAAG,iEAAiE;;MC2BzE,SAAS;EAyCpB,aAAa,CAAC,UAA4B,SAAS;IACjD,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC;GACpD;EAGD,kBAAkB,CAAC,YAAqB;IACtC,IAAI,CAAC,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC;GACjD;EAGD,uBAAuB,CAAC,iBAA0B;IAChD,IAAI,CAAC,cAAc,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAE1D,IAAI,CAAC,iBAAiB,EAAE;MACtB,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAc,sCAAsC,CAAC,CAAC,CAAC;;MAGjH,YAAY,CAAC,KAAK,EAAE,CAAC;MAErB,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,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C,YAAY;MAC/B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;KAC1C,CAAC,CAAC;IAEH,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;GAC7B;EAED,MAAM;IACJ,QACE,EAAC,IAAI,IACH,KAAK,EAAE;QACL,eAAe,EAAE,IAAI;OACtB,IAED,eAAa,CACR,EACP;GACH;EAEO,eAAe,CAAC,cAA2B,EAAE,QAAuB,EAAE,CAAc;IAC1F,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;MACzB,aAAa,EAAE,CAAC;MAChB,OAAO,EAAE;QACP,OAAO,EAAE,cAAc;QACvB,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;OACzC;MACD,QAAQ;KACT,CAAC,CAAC;GACJ;EAEO,aAAa,CAAC,cAA2B;IAC/C,OAAO,OAAO,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC;GAChE;EAEO,oBAAoB,CAAC,cAA2B,EAAE,YAAqB;IAC7E,IAAI,YAAY,EAAE;MAChB,cAAc,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;KACzC;SAAM;MACL,cAAc,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;KACxC;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/accordion/accordion.scss?tag=dso-accordion&encapsulation=shadow","./src/components/accordion/accordion.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n","import {\r\n h,\r\n Component,\r\n ComponentInterface,\r\n Prop,\r\n Host,\r\n Method,\r\n Watch,\r\n Element,\r\n Event,\r\n EventEmitter,\r\n} from \"@stencil/core\";\r\n\r\nimport {\r\n AccordionInternalState,\r\n AccordionSectionToggleAnimationEndEvent,\r\n AccordionSectionToggleEvent,\r\n AccordionVariant,\r\n} from \"./accordion.interfaces\";\r\n\r\nimport { createStore } from \"@stencil/store\";\r\n\r\n@Component({\r\n tag: \"dso-accordion\",\r\n styleUrl: \"accordion.scss\",\r\n shadow: true,\r\n})\r\nexport class Accordion implements ComponentInterface {\r\n private accordionState: AccordionInternalState;\r\n\r\n @Element()\r\n host!: HTMLDsoAccordionElement;\r\n\r\n /**\r\n * The variant of the Accordion.\r\n */\r\n @Prop({ reflect: true })\r\n variant?: AccordionVariant = \"default\";\r\n\r\n /**\r\n * Places the chevron at the opposite side. Note: this mode does not display `state`, `attachmentCount` or `status` props on child `<dso-accordion-section>` elements\r\n */\r\n @Prop({ reflect: true })\r\n reverseAlign = false;\r\n\r\n /**\r\n * Allows multiple sections to be open at the same time.\r\n */\r\n @Prop({ reflect: true })\r\n allowMultipleOpen = false;\r\n\r\n /**\r\n * Emitted when a section is toggled.\r\n *\r\n * `event.detail.originalEvent` contains the original `MouseEvent` when the section is toggled by clicking on the header\r\n * `event.detail.section` contains the toggled section and its new opened value.\\\r\n * `event.detail.sections` contains all `<dso-accordion-section>` elements belonging to this accordion.\r\n */\r\n @Event()\r\n dsoToggleSection!: EventEmitter<AccordionSectionToggleEvent>;\r\n\r\n /**\r\n * Event emitted when the accordion section completes its toggle animation.\r\n */\r\n @Event()\r\n dsoToggleSectionAnimationEnd!: EventEmitter<AccordionSectionToggleAnimationEndEvent>;\r\n\r\n @Watch(\"variant\")\r\n updateVariant(variant: AccordionVariant = \"default\") {\r\n this.accordionState.variant = variant || \"default\";\r\n }\r\n\r\n @Watch(\"reverseAlign\")\r\n updateReverseAlign(reverseAlign: boolean) {\r\n this.accordionState.reverseAlign = reverseAlign;\r\n }\r\n\r\n @Watch(\"allowMultipleOpen\")\r\n updateAllowMultipleOpen(allowMultipleOpen: boolean) {\r\n this.accordionState.allowMultipleOpen = allowMultipleOpen;\r\n\r\n if (!allowMultipleOpen) {\r\n const openSections = Array.from(this.host.querySelectorAll<HTMLElement>(\":scope > dso-accordion-section[open]\"));\r\n\r\n // By removing the first section, it is kept open;\r\n openSections.shift();\r\n\r\n openSections.forEach((section) => this.controlOpenAttribute(section, false));\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n @Method()\r\n async _getState(): Promise<AccordionInternalState> {\r\n return this.accordionState;\r\n }\r\n\r\n /**\r\n * Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section.\r\n * @param sectionElement The section element that needs to toggle\r\n * @param event The event that the user triggered\r\n * @returns The state of the section\r\n */\r\n @Method()\r\n async toggleSection(sectionElement: HTMLElement | number, event?: MouseEvent): Promise<undefined | boolean> {\r\n const sections = Array.from(this.host.querySelectorAll<HTMLElement>(\":scope > dso-accordion-section\"));\r\n\r\n if (typeof sectionElement === \"number\") {\r\n const section = sections[sectionElement];\r\n if (section instanceof HTMLElement) {\r\n sectionElement = section;\r\n }\r\n }\r\n\r\n if (!(sectionElement instanceof HTMLElement) || !sections.includes(sectionElement)) {\r\n return;\r\n }\r\n\r\n const sectionIsOpen = this.isSectionOpen(sectionElement);\r\n\r\n if (this.allowMultipleOpen) {\r\n this.controlOpenAttribute(sectionElement, !sectionIsOpen);\r\n this.emitToggleEvent(sectionElement, sections, event);\r\n return !sectionIsOpen;\r\n }\r\n\r\n if (sectionIsOpen) {\r\n this.controlOpenAttribute(sectionElement, false);\r\n this.emitToggleEvent(sectionElement, sections, event);\r\n\r\n return false;\r\n }\r\n\r\n await this.closeOpenSections();\r\n\r\n this.controlOpenAttribute(sectionElement, true);\r\n this.emitToggleEvent(sectionElement, sections, event);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Emitted when the animation of opening or closing ends.\r\n */\r\n @Method()\r\n async animationEnd(sectionElement: HTMLElement): Promise<void> {\r\n this.dsoToggleSectionAnimationEnd.emit({\r\n section: {\r\n element: sectionElement,\r\n open: this.isSectionOpen(sectionElement),\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Closes all sections belonging to this accordion.\r\n */\r\n @Method()\r\n async closeOpenSections(): Promise<void> {\r\n const sections = Array.from(this.host.querySelectorAll<HTMLElement>(\":scope > dso-accordion-section\"));\r\n\r\n const openSections = sections.filter((s) => this.isSectionOpen(s));\r\n openSections.forEach((section) => this.controlOpenAttribute(section, false));\r\n }\r\n\r\n // These checks are needed for a React timing issue.\r\n componentWillLoad() {\r\n if (this.accordionState.variant !== this.variant) {\r\n this.accordionState.variant = this.variant || \"default\";\r\n }\r\n\r\n if (this.accordionState.reverseAlign !== this.reverseAlign) {\r\n this.accordionState.reverseAlign = this.reverseAlign;\r\n }\r\n\r\n if (this.accordionState.allowMultipleOpen !== this.allowMultipleOpen) {\r\n this.accordionState.allowMultipleOpen = this.allowMultipleOpen;\r\n }\r\n }\r\n\r\n constructor() {\r\n const { state } = createStore<AccordionInternalState>({\r\n variant: this.variant || \"default\",\r\n reverseAlign: this.reverseAlign,\r\n allowMultipleOpen: this.allowMultipleOpen,\r\n });\r\n\r\n this.accordionState = state;\r\n }\r\n\r\n render() {\r\n return (\r\n <Host\r\n class={{\r\n \"dso-accordion\": true,\r\n }}\r\n >\r\n <slot></slot>\r\n </Host>\r\n );\r\n }\r\n\r\n private emitToggleEvent(sectionElement: HTMLElement, sections: HTMLElement[], e?: MouseEvent): void {\r\n this.dsoToggleSection.emit({\r\n originalEvent: e,\r\n section: {\r\n element: sectionElement,\r\n open: this.isSectionOpen(sectionElement),\r\n },\r\n sections,\r\n });\r\n }\r\n\r\n private isSectionOpen(sectionElement: HTMLElement): boolean {\r\n return typeof sectionElement.getAttribute(\"open\") === \"string\";\r\n }\r\n\r\n private controlOpenAttribute(sectionElement: HTMLElement, setAttribute: boolean): void {\r\n if (setAttribute) {\r\n sectionElement.setAttribute(\"open\", \"\");\r\n } else {\r\n sectionElement.removeAttribute(\"open\");\r\n }\r\n }\r\n}\r\n"],"version":3}
1
+ {"file":"dso-accordion.js","mappings":";;AAEA,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,KAAK;AAC9C,IAAI,MAAM,KAAK,GAAG,GAAG,CA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E,CAAC;AACvB,KAAK;AACL,CAAC,CAAC;AACF;AACA,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,YAAY,KAAK;AACpD,IAAI,MAAM,GAAG,GAAG,mBAAmB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;AAChE,IAAI,GAAG,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC,CAAC;AACnC,IAAI,OAAO,GAAG,CAAC;AACf,CAAC;;AC/LD,MAAM,YAAY,GAAG,iEAAiE;;MCWzE,SAAS;EAqBpB,aAAa,CAAC,UAA4B,SAAS;IACjD,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,OAAO,CAAC;GACvC;EAGD,kBAAkB,CAAC,YAAqB;IACtC,IAAI,CAAC,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC;GACjD;;;;EAMD,MAAM,SAAS;IACb,OAAO,IAAI,CAAC,cAAc,CAAC;GAC5B;EAED,iBAAiB;IACf,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC3C,IAAI,CAAC,cAAc,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;GACtD;EAED;;;;mBAjC4B,SAAS;wBAQtB,KAAK;IA0BlB,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAAyB,EAAE,CAAC,CAAC;IAE1D,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;GAC7B;EAED,MAAM;IACJ,QACE,EAAC,IAAI,IAAC,KAAK,EAAC,eAAe,IACzB,eAAa,CACR,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../node_modules/@stencil/store/dist/index.mjs","./src/components/accordion/accordion.scss?tag=dso-accordion&encapsulation=shadow","./src/components/accordion/accordion.tsx"],"sourcesContent":["import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const unwrappedState = unwrap(defaultState);\n let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n const reset = () => {\n var _a;\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(unwrappedState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const unSet = on('set', (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n });\n // We need to unwrap the defaultState because it might be a function.\n // Otherwise we might not be sending the right reset value.\n const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));\n return () => {\n unSet();\n unReset();\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","@use \"~dso-toolkit/src/utilities\";\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n","import { h, Component, ComponentInterface, Prop, Host, Method, Watch, Element } from \"@stencil/core\";\r\n\r\nimport { AccordionInternalState, AccordionVariant } from \"./accordion.interfaces\";\r\n\r\nimport { createStore } from \"@stencil/store\";\r\n\r\n@Component({\r\n tag: \"dso-accordion\",\r\n styleUrl: \"accordion.scss\",\r\n shadow: true,\r\n})\r\nexport class Accordion implements ComponentInterface {\r\n private accordionState: AccordionInternalState;\r\n\r\n @Element()\r\n host!: HTMLDsoAccordionElement;\r\n\r\n /**\r\n * The variant of the Accordion.\r\n */\r\n @Prop({ reflect: true })\r\n variant: AccordionVariant = \"default\";\r\n\r\n /**\r\n * Places the chevron at the opposite side.\r\n *\r\n * Note: this mode does not display `state`, `attachmentCount` or `status` props on Accordion Sections\r\n */\r\n @Prop({ reflect: true })\r\n reverseAlign = false;\r\n\r\n @Watch(\"variant\")\r\n updateVariant(variant: AccordionVariant = \"default\") {\r\n this.accordionState.variant = variant;\r\n }\r\n\r\n @Watch(\"reverseAlign\")\r\n updateReverseAlign(reverseAlign: boolean) {\r\n this.accordionState.reverseAlign = reverseAlign;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n @Method()\r\n async _getState(): Promise<AccordionInternalState> {\r\n return this.accordionState;\r\n }\r\n\r\n componentWillLoad() {\r\n this.accordionState.variant = this.variant;\r\n this.accordionState.reverseAlign = this.reverseAlign;\r\n }\r\n\r\n constructor() {\r\n const { state } = createStore<AccordionInternalState>({});\r\n\r\n this.accordionState = state;\r\n }\r\n\r\n render() {\r\n return (\r\n <Host class=\"dso-accordion\">\r\n <slot></slot>\r\n </Host>\r\n );\r\n }\r\n}\r\n"],"version":3}
@@ -1,53 +1,4 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { c as clsx } from './clsx.m.js';
3
- import { d as defineCustomElement$2 } from './icon.js';
4
-
5
- const alertCss = ":host{display:block}:host(:not(:first-child)){margin-top:24px}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.alert{border:1px solid transparent;line-height:1.5;margin-bottom:24px;min-height:64px;position:relative}@media screen and (min-width: 481px){.alert{padding:19px 16px 19px 63px}}@media screen and (max-width: 480px){.alert{padding:63px 16px 16px}}.alert:not(:first-child){margin-top:24px}.alert.alert-success{color:#000;background-color:#e4f1d4;border-color:#e4f1d4}.alert.alert-error{color:#000;background-color:#f5d8dc;border-color:#f5d8dc}.alert.alert-warning{color:#000;background-color:#f8f6cc;border-color:#f8f6cc}.alert.alert-info{color:#000;background-color:#e1ecf7;border-color:#e1ecf7}.alert dso-icon{left:15px;position:absolute;top:15px;height:32px;width:32px}";
6
-
7
- const Alert = /*@__PURE__*/ proxyCustomElement(class Alert extends HTMLElement {
8
- constructor() {
9
- super();
10
- this.__registerHost();
11
- this.__attachShadow();
12
- this.status = undefined;
13
- this.roleAlert = undefined;
14
- }
15
- render() {
16
- const status = Alert.statusMap.get(this.status);
17
- if (!status) {
18
- throw new Error(`Invalid status ${this.status}`);
19
- }
20
- return (h("div", { class: clsx("alert", `alert-${this.status}`), role: this.roleAlert ? "alert" : undefined }, h("dso-icon", { icon: "status-" + this.status }), h("span", { class: "sr-only" }, status, ":"), h("slot", null)));
21
- }
22
- static get style() { return alertCss; }
23
- }, [1, "dso-alert", {
24
- "status": [1],
25
- "roleAlert": [4, "role-alert"]
26
- }]);
27
- Alert.statusMap = new Map([
28
- ["success", "Gelukt"],
29
- ["info", "Opmerking"],
30
- ["warning", "Waarschuwing"],
31
- ["error", "Fout"],
32
- ]);
33
- function defineCustomElement$1() {
34
- if (typeof customElements === "undefined") {
35
- return;
36
- }
37
- const components = ["dso-alert", "dso-icon"];
38
- components.forEach(tagName => { switch (tagName) {
39
- case "dso-alert":
40
- if (!customElements.get(tagName)) {
41
- customElements.define(tagName, Alert);
42
- }
43
- break;
44
- case "dso-icon":
45
- if (!customElements.get(tagName)) {
46
- defineCustomElement$2();
47
- }
48
- break;
49
- } });
50
- }
1
+ import { A as Alert, d as defineCustomElement$1 } from './alert.js';
51
2
 
52
3
  const DsoAlert = Alert;
53
4
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"dso-alert.js","mappings":";;;;AAAA,MAAM,QAAQ,GAAG,83BAA83B;;MCQl4B,KAAK;;;;;;;;EAoBhB,MAAM;IACJ,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,EAAE;MACX,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;KAClD;IAED,QACE,WAAK,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,GAAG,SAAS,IAC3F,gBAAU,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC,MAAM,GAAa,EACpD,YAAM,KAAK,EAAC,SAAS,IAAE,MAAM,MAAS,EACtC,eAAa,CACT,EACN;GACH;;;;;;AApBc,eAAS,GAAG,IAAI,GAAG,CAAiB;EACjD,CAAC,SAAS,EAAE,QAAQ,CAAC;EACrB,CAAC,MAAM,EAAE,WAAW,CAAC;EACrB,CAAC,SAAS,EAAE,cAAc,CAAC;EAC3B,CAAC,OAAO,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/alert/alert.scss?tag=dso-alert&encapsulation=shadow","./src/components/alert/alert.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/components/alert\";\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n:host(:not(:first-child)) {\r\n margin-top: units.$u3;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n\r\n.sr-only {\r\n @include utilities.sr-only();\r\n}\r\n\r\n.alert {\r\n @include alert.root();\r\n\r\n dso-icon {\r\n @include alert.icon-position();\r\n\r\n height: units.$u4;\r\n width: units.$u4;\r\n }\r\n}\r\n","import { Component, h, Prop } from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\n\r\n@Component({\r\n tag: \"dso-alert\",\r\n styleUrl: \"alert.scss\",\r\n shadow: true,\r\n})\r\nexport class Alert {\r\n /**\r\n * Set status of alert\r\n */\r\n @Prop()\r\n status!: \"success\" | \"info\" | \"warning\" | \"error\";\r\n\r\n /**\r\n * Whether or not to show the role attribute with value \"alert\". To control the tooltip add the `role-alert` attribute.\r\n */\r\n @Prop()\r\n roleAlert?: boolean;\r\n\r\n private static statusMap = new Map<string, string>([\r\n [\"success\", \"Gelukt\"],\r\n [\"info\", \"Opmerking\"],\r\n [\"warning\", \"Waarschuwing\"],\r\n [\"error\", \"Fout\"],\r\n ]);\r\n\r\n render() {\r\n const status = Alert.statusMap.get(this.status);\r\n if (!status) {\r\n throw new Error(`Invalid status ${this.status}`);\r\n }\r\n\r\n return (\r\n <div class={clsx(\"alert\", `alert-${this.status}`)} role={this.roleAlert ? \"alert\" : undefined}>\r\n <dso-icon icon={\"status-\" + this.status}></dso-icon>\r\n <span class=\"sr-only\">{status}:</span>\r\n <slot></slot>\r\n </div>\r\n );\r\n }\r\n}\r\n"],"version":3}
1
+ {"file":"dso-alert.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,43 +1,4 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { A as AnnotationService } from './annotation.service.js';
3
- import { d as defineCustomElement$2 } from './icon.js';
4
-
5
- const annotationButtonCss = "dso-annotation-button{display:block}";
6
-
7
- const AnnotationButton = /*@__PURE__*/ proxyCustomElement(class AnnotationButton extends HTMLElement {
8
- constructor() {
9
- super();
10
- this.__registerHost();
11
- this.identifier = undefined;
12
- }
13
- componentDidLoad() {
14
- this.annotationOutput = document.querySelector(`dso-annotation-output[identifier='${this.identifier}']`);
15
- }
16
- render() {
17
- return (h("button", { type: "button", class: "dso-tertiary", "aria-controls": this.identifier, "aria-expanded": AnnotationService.state[this.identifier] ? "true" : "false", onClick: (e) => { var _a; return (_a = this.annotationOutput) === null || _a === void 0 ? void 0 : _a._toggleAnnotation(e, this.identifier); } }, h("dso-icon", { icon: "label" }), h("span", { class: "sr-only" }, "Toelichting bekijken")));
18
- }
19
- static get style() { return annotationButtonCss; }
20
- }, [0, "dso-annotation-button", {
21
- "identifier": [1]
22
- }]);
23
- function defineCustomElement$1() {
24
- if (typeof customElements === "undefined") {
25
- return;
26
- }
27
- const components = ["dso-annotation-button", "dso-icon"];
28
- components.forEach(tagName => { switch (tagName) {
29
- case "dso-annotation-button":
30
- if (!customElements.get(tagName)) {
31
- customElements.define(tagName, AnnotationButton);
32
- }
33
- break;
34
- case "dso-icon":
35
- if (!customElements.get(tagName)) {
36
- defineCustomElement$2();
37
- }
38
- break;
39
- } });
40
- }
1
+ import { A as AnnotationButton, d as defineCustomElement$1 } from './annotation-button.js';
41
2
 
42
3
  const DsoAnnotationButton = AnnotationButton;
43
4
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"dso-annotation-button.js","mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,sCAAsC;;MCSrD,gBAAgB;;;;;;EAS3B,gBAAgB;IACd,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAC,qCAAqC,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;GAC1G;EAED,MAAM;IACJ,QACE,cACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,cAAc,mBACL,IAAI,CAAC,UAAU,mBACf,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,OAAO,EAC1E,OAAO,EAAE,CAAC,CAAC,eAAK,OAAA,MAAA,IAAI,CAAC,gBAAgB,0CAAE,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA,EAAA,IAE5E,gBAAU,IAAI,EAAC,OAAO,GAAY,EAClC,YAAM,KAAK,EAAC,SAAS,2BAA4B,CAC1C,EACT;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/annotation-button/annotation-button.scss?tag=dso-annotation-button","./src/components/annotation-button/annotation-button.tsx"],"sourcesContent":["dso-annotation-button {\r\n display: block;\r\n}\r\n","import { Component, ComponentInterface, h, Prop } from \"@stencil/core\";\r\nimport { AnnotationService } from \"../../services/annotation.service\";\r\n\r\n@Component({\r\n tag: \"dso-annotation-button\",\r\n styleUrl: \"annotation-button.scss\",\r\n // We disable shadowdom for a11y reasons (aria-controls pointing to element inside another component)\r\n shadow: false,\r\n})\r\nexport class AnnotationButton implements ComponentInterface {\r\n /**\r\n * To link the Annotation Button with `aria-controls` to a different element, most likely an Annotation Output.\r\n */\r\n @Prop()\r\n identifier!: string;\r\n\r\n private annotationOutput!: HTMLDsoAnnotationOutputElement | null;\r\n\r\n componentDidLoad() {\r\n this.annotationOutput = document.querySelector(`dso-annotation-output[identifier='${this.identifier}']`);\r\n }\r\n\r\n render() {\r\n return (\r\n <button\r\n type=\"button\"\r\n class=\"dso-tertiary\"\r\n aria-controls={this.identifier}\r\n aria-expanded={AnnotationService.state[this.identifier] ? \"true\" : \"false\"}\r\n onClick={(e) => this.annotationOutput?._toggleAnnotation(e, this.identifier)}\r\n >\r\n <dso-icon icon=\"label\"></dso-icon>\r\n <span class=\"sr-only\">Toelichting bekijken</span>\r\n </button>\r\n );\r\n }\r\n}\r\n"],"version":3}
1
+ {"file":"dso-annotation-button.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,74 +1,4 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { A as AnnotationService } from './annotation.service.js';
3
- import { d as defineCustomElement$4 } from './expandable.js';
4
- import { d as defineCustomElement$3 } from './icon.js';
5
- import { d as defineCustomElement$2 } from './responsive-element.js';
6
-
7
- const annotationOutputCss = "*,*::after,*::before{box-sizing:border-box}dso-annotation-output{display:block}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.dso-annotation-header{align-items:center;background-color:#f2f2f2;clear:both;display:flex;margin-bottom:2px;margin-top:8px;padding-left:16px;padding-right:8px;padding-top:8px;padding-bottom:8px}.dso-annotation-header>*[slot=title]{color:#000;font-size:1.25rem;margin-bottom:0;margin-top:0}.dso-annotation-header>*:nth-child(2){margin-left:auto}dso-responsive-element[small] .dso-annotation-header,dso-responsive-element[medium] .dso-annotation-header{display:grid;row-gap:8px}dso-responsive-element[small] .dso-annotation-header *[slot=title],dso-responsive-element[medium] .dso-annotation-header *[slot=title]{grid-row:1;grid-column:1}dso-responsive-element[small] .dso-annotation-header *[slot=addons],dso-responsive-element[medium] .dso-annotation-header *[slot=addons]{grid-row:2;grid-column:1;margin-left:initial}dso-responsive-element[small] .dso-annotation-header .dso-annotation-close-button,dso-responsive-element[medium] .dso-annotation-header .dso-annotation-close-button{grid-row:1;grid-column:2;margin-left:8px;text-align:end}.dso-annotation-content{background-color:#f2f2f2;padding-left:16px;padding-right:8px;padding-top:8px;padding-bottom:8px}.dso-annotation-close-button{margin-left:32px}.dso-annotation-prefix{font-style:italic}";
8
-
9
- const AnnotationOutput = /*@__PURE__*/ proxyCustomElement(class AnnotationOutput extends HTMLElement {
10
- constructor() {
11
- super();
12
- this.__registerHost();
13
- this.dsoToggle = createEvent(this, "dsoToggle", 3);
14
- this.identifier = undefined;
15
- this.annotationPrefix = undefined;
16
- }
17
- /**
18
- * @internal
19
- */
20
- async _toggleAnnotation(e, identifier) {
21
- AnnotationService.toggle(identifier);
22
- const open = AnnotationService.state[this.identifier];
23
- if (open === undefined) {
24
- throw new Error(`No state found for ${this.identifier}`);
25
- }
26
- this.dsoToggle.emit({
27
- originalEvent: e,
28
- open,
29
- });
30
- }
31
- toggleHandler(e) {
32
- this._toggleAnnotation(e, this.identifier);
33
- }
34
- render() {
35
- const expandableProperties = AnnotationService.state[this.identifier] ? { open: true } : {};
36
- return (h("dso-responsive-element", null, h("dso-expandable", Object.assign({ id: this.identifier }, expandableProperties), h("div", { slot: "expandable-content" }, this.annotationPrefix && h("span", { class: "dso-annotation-prefix" }, this.annotationPrefix), h("div", { class: "dso-annotation-header" }, h("slot", { name: "title" }), h("slot", { name: "addons" }), h("button", { type: "button", class: "dso-tertiary dso-annotation-close-button", onClick: (e) => this.toggleHandler(e) }, h("dso-icon", { icon: "times" }), h("span", { class: "sr-only" }, "Toelichting sluiten"))), h("div", { class: "dso-annotation-content" }, h("slot", null))))));
37
- }
38
- static get style() { return annotationOutputCss; }
39
- }, [4, "dso-annotation-output", {
40
- "identifier": [1],
41
- "annotationPrefix": [1, "annotation-prefix"],
42
- "_toggleAnnotation": [64]
43
- }]);
44
- function defineCustomElement$1() {
45
- if (typeof customElements === "undefined") {
46
- return;
47
- }
48
- const components = ["dso-annotation-output", "dso-expandable", "dso-icon", "dso-responsive-element"];
49
- components.forEach(tagName => { switch (tagName) {
50
- case "dso-annotation-output":
51
- if (!customElements.get(tagName)) {
52
- customElements.define(tagName, AnnotationOutput);
53
- }
54
- break;
55
- case "dso-expandable":
56
- if (!customElements.get(tagName)) {
57
- defineCustomElement$4();
58
- }
59
- break;
60
- case "dso-icon":
61
- if (!customElements.get(tagName)) {
62
- defineCustomElement$3();
63
- }
64
- break;
65
- case "dso-responsive-element":
66
- if (!customElements.get(tagName)) {
67
- defineCustomElement$2();
68
- }
69
- break;
70
- } });
71
- }
1
+ import { A as AnnotationOutput, d as defineCustomElement$1 } from './annotation-output.js';
72
2
 
73
3
  const DsoAnnotationOutput = AnnotationOutput;
74
4
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"dso-annotation-output.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,q6CAAq6C;;MCWp7C,gBAAgB;;;;;;;;;;;EAuB3B,MAAM,iBAAiB,CAAC,CAA6B,EAAE,UAAkB;IACvE,iBAAiB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAErC,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtD,IAAI,IAAI,KAAK,SAAS,EAAE;MACtB,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;KAC1D;IAED,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;MAClB,aAAa,EAAE,CAAC;MAChB,IAAI;KACL,CAAC,CAAC;GACJ;EAEO,aAAa,CAAC,CAA6B;IACjD,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;GAC5C;EAED,MAAM;IACJ,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IAE5F,QACE,kCACE,oCAAgB,EAAE,EAAE,IAAI,CAAC,UAAU,IAAM,oBAAoB,GAC3D,WAAK,IAAI,EAAC,oBAAoB,IAC3B,IAAI,CAAC,gBAAgB,IAAI,YAAM,KAAK,EAAC,uBAAuB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,EAC5F,WAAK,KAAK,EAAC,uBAAuB,IAChC,YAAM,IAAI,EAAC,OAAO,GAAG,EACrB,YAAM,IAAI,EAAC,QAAQ,GAAG,EACtB,cACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,0CAA0C,EAChD,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAErC,gBAAU,IAAI,EAAC,OAAO,GAAY,EAClC,YAAM,KAAK,EAAC,SAAS,0BAA2B,CACzC,CACL,EACN,WAAK,KAAK,EAAC,wBAAwB,IACjC,eAAQ,CACJ,CACF,CACS,CACM,EACzB;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/annotation-output/annotation-output.scss?tag=dso-annotation-output","./src/components/annotation-output/annotation-output.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n\r\n@include utilities.box-sizing();\r\n\r\ndso-annotation-output {\r\n display: block;\r\n}\r\n\r\n.sr-only {\r\n @include utilities.sr-only();\r\n}\r\n\r\n.dso-annotation-header {\r\n align-items: center;\r\n background-color: colors.$grijs-5;\r\n clear: both;\r\n display: flex;\r\n margin-bottom: 2px;\r\n margin-top: units.$u1;\r\n padding-left: units.$u2;\r\n padding-right: units.$u1;\r\n padding-top: units.$u1;\r\n padding-bottom: units.$u1;\r\n\r\n > *[slot=\"title\"] {\r\n color: colors.$zwart;\r\n font-size: 1.25rem;\r\n margin-bottom: 0;\r\n margin-top: 0;\r\n }\r\n\r\n > *:nth-child(2) {\r\n margin-left: auto;\r\n }\r\n}\r\n\r\ndso-responsive-element[small],\r\ndso-responsive-element[medium] {\r\n .dso-annotation-header {\r\n display: grid;\r\n row-gap: units.$u1;\r\n\r\n *[slot=\"title\"] {\r\n grid-row: 1;\r\n grid-column: 1;\r\n }\r\n\r\n *[slot=\"addons\"] {\r\n grid-row: 2;\r\n grid-column: 1;\r\n margin-left: initial;\r\n }\r\n\r\n .dso-annotation-close-button {\r\n grid-row: 1;\r\n grid-column: 2;\r\n margin-left: units.$u1;\r\n text-align: end;\r\n }\r\n }\r\n}\r\n\r\n.dso-annotation-content {\r\n background-color: colors.$grijs-5;\r\n padding-left: units.$u2;\r\n padding-right: units.$u1;\r\n padding-top: units.$u1;\r\n padding-bottom: units.$u1;\r\n}\r\n\r\n.dso-annotation-close-button {\r\n margin-left: units.$u4;\r\n}\r\n\r\n.dso-annotation-prefix {\r\n font-style: italic;\r\n}\r\n","import { Component, ComponentInterface, Event, EventEmitter, h, Method, Prop } from \"@stencil/core\";\r\n\r\nimport { AnnotationService } from \"../../services/annotation.service\";\r\nimport { AnnotationToggleEvent } from \"./annotation-output.interfaces\";\r\n\r\n@Component({\r\n tag: \"dso-annotation-output\",\r\n styleUrl: \"annotation-output.scss\",\r\n // We disable shadowdom for a11y reasons (aria-controls being set inside another component)\r\n shadow: false,\r\n})\r\nexport class AnnotationOutput implements ComponentInterface {\r\n /**\r\n * The annotation-button that toggles this component should have the same identifier.\r\n */\r\n @Prop()\r\n identifier!: string;\r\n\r\n /**\r\n * This text will be displayed above the annotation-output when opened\r\n */\r\n @Prop()\r\n annotationPrefix?: string;\r\n\r\n /**\r\n * This event is emitted when the user activates the Annotation Button.\r\n */\r\n @Event({ bubbles: false })\r\n dsoToggle!: EventEmitter<AnnotationToggleEvent>;\r\n\r\n /**\r\n * @internal\r\n */\r\n @Method()\r\n async _toggleAnnotation(e: MouseEvent | KeyboardEvent, identifier: string) {\r\n AnnotationService.toggle(identifier);\r\n\r\n const open = AnnotationService.state[this.identifier];\r\n if (open === undefined) {\r\n throw new Error(`No state found for ${this.identifier}`);\r\n }\r\n\r\n this.dsoToggle.emit({\r\n originalEvent: e,\r\n open,\r\n });\r\n }\r\n\r\n private toggleHandler(e: MouseEvent | KeyboardEvent) {\r\n this._toggleAnnotation(e, this.identifier);\r\n }\r\n\r\n render() {\r\n const expandableProperties = AnnotationService.state[this.identifier] ? { open: true } : {};\r\n\r\n return (\r\n <dso-responsive-element>\r\n <dso-expandable id={this.identifier} {...expandableProperties}>\r\n <div slot=\"expandable-content\">\r\n {this.annotationPrefix && <span class=\"dso-annotation-prefix\">{this.annotationPrefix}</span>}\r\n <div class=\"dso-annotation-header\">\r\n <slot name=\"title\" />\r\n <slot name=\"addons\" />\r\n <button\r\n type=\"button\"\r\n class=\"dso-tertiary dso-annotation-close-button\"\r\n onClick={(e) => this.toggleHandler(e)}\r\n >\r\n <dso-icon icon=\"times\"></dso-icon>\r\n <span class=\"sr-only\">Toelichting sluiten</span>\r\n </button>\r\n </div>\r\n <div class=\"dso-annotation-content\">\r\n <slot />\r\n </div>\r\n </div>\r\n </dso-expandable>\r\n </dso-responsive-element>\r\n );\r\n }\r\n}\r\n"],"version":3}
1
+ {"file":"dso-annotation-output.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
2
- import { d as debounce_1 } from './index3.js';
2
+ import { d as debounce_1 } from './index2.js';
3
3
  import { d as defineCustomElement$2 } from './progress-indicator.js';
4
4
  import { v as v4 } from './v4.js';
5
5