@dso-toolkit/core 55.0.0 → 56.1.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 (334) hide show
  1. package/dist/cjs/dso-accordion-section.cjs.entry.js +31 -88
  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 +721 -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 +16 -35
  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/dso-viewer-grid.cjs.entry.js +1 -1
  13. package/dist/cjs/dso-viewer-grid.cjs.entry.js.map +1 -1
  14. package/dist/cjs/dsot-document-component-demo.cjs.entry.js +110 -0
  15. package/dist/cjs/dsot-document-component-demo.cjs.entry.js.map +1 -0
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/collection/collection-manifest.json +5 -4
  18. package/dist/collection/components/accordion/accordion.interfaces.js.map +1 -1
  19. package/dist/collection/components/accordion/accordion.js +9 -254
  20. package/dist/collection/components/accordion/accordion.js.map +1 -1
  21. package/dist/collection/components/accordion/components/accordion-section.css +31 -31
  22. package/dist/collection/components/accordion/components/accordion-section.interfaces.js.map +1 -1
  23. package/dist/collection/components/accordion/components/accordion-section.js +69 -127
  24. package/dist/collection/components/accordion/components/accordion-section.js.map +1 -1
  25. package/dist/collection/components/annotation-button/annotation-button.css +1003 -0
  26. package/dist/collection/components/annotation-button/annotation-button.js +48 -7
  27. package/dist/collection/components/annotation-button/annotation-button.js.map +1 -1
  28. package/dist/collection/components/annotation-output/annotation-output.css +2 -2
  29. package/dist/collection/components/annotation-output/annotation-output.js +32 -64
  30. package/dist/collection/components/annotation-output/annotation-output.js.map +1 -1
  31. package/dist/collection/components/document-component/document-component-heading.js +30 -0
  32. package/dist/collection/components/document-component/document-component-heading.js.map +1 -0
  33. package/dist/collection/components/document-component/document-component.css +135 -0
  34. package/dist/collection/components/document-component/document-component.demo.js +112 -0
  35. package/dist/collection/components/document-component/document-component.demo.js.map +1 -0
  36. package/dist/collection/components/document-component/document-component.js +414 -0
  37. package/dist/collection/components/document-component/document-component.js.map +1 -0
  38. package/dist/collection/components/document-component/document-component.types.js +2 -0
  39. package/dist/collection/components/document-component/document-component.types.js.map +1 -0
  40. package/dist/collection/components/expandable/expandable.js +27 -93
  41. package/dist/collection/components/expandable/expandable.js.map +1 -1
  42. package/dist/collection/components/label/label.js +42 -33
  43. package/dist/collection/components/label/label.js.map +1 -1
  44. package/dist/collection/components/ozon-content/ozon-content-mapper.js +9 -1
  45. package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +1 -1
  46. package/dist/collection/components/ozon-content/ozon-content.css +49 -1
  47. package/dist/collection/components/ozon-content/ozon-content.js +1 -1
  48. package/dist/collection/components/ozon-content/ozon-content.js.map +1 -1
  49. package/dist/collection/components/viewer-grid/viewer-grid.js +1 -1
  50. package/dist/collection/components/viewer-grid/viewer-grid.js.map +1 -1
  51. package/dist/{esm/dso-alert.entry.js → components/alert.js} +33 -9
  52. package/dist/components/alert.js.map +1 -0
  53. package/dist/components/annotation-button.js +46 -0
  54. package/dist/components/annotation-button.js.map +1 -0
  55. package/dist/components/annotation-output.js +60 -0
  56. package/dist/components/annotation-output.js.map +1 -0
  57. package/dist/{esm/dso-badge.entry.js → components/badge.js} +26 -9
  58. package/dist/components/badge.js.map +1 -0
  59. package/dist/components/document-component.js +163 -0
  60. package/dist/components/document-component.js.map +1 -0
  61. package/dist/components/dso-accordion-section.js +36 -95
  62. package/dist/components/dso-accordion-section.js.map +1 -1
  63. package/dist/components/dso-accordion.js +199 -113
  64. package/dist/components/dso-accordion.js.map +1 -1
  65. package/dist/components/dso-alert.js +1 -50
  66. package/dist/components/dso-alert.js.map +1 -1
  67. package/dist/components/dso-annotation-button.js +1 -40
  68. package/dist/components/dso-annotation-button.js.map +1 -1
  69. package/dist/components/dso-annotation-output.js +1 -71
  70. package/dist/components/dso-annotation-output.js.map +1 -1
  71. package/dist/components/dso-autosuggest.js +1 -1
  72. package/dist/components/dso-badge.js +1 -32
  73. package/dist/components/dso-badge.js.map +1 -1
  74. package/dist/components/dso-document-component.d.ts +11 -0
  75. package/dist/components/dso-document-component.js +8 -0
  76. package/dist/components/dso-document-component.js.map +1 -0
  77. package/dist/components/dso-header.js +1 -1
  78. package/dist/components/dso-image-overlay.js +1 -1
  79. package/dist/components/dso-label.js +1 -161
  80. package/dist/components/dso-label.js.map +1 -1
  81. package/dist/components/dso-ozon-content.js +1 -544
  82. package/dist/components/dso-ozon-content.js.map +1 -1
  83. package/dist/components/dso-slide-toggle.js +1 -52
  84. package/dist/components/dso-slide-toggle.js.map +1 -1
  85. package/dist/components/dso-table.js +1 -1
  86. package/dist/components/dso-viewer-grid.js +1 -1
  87. package/dist/components/dso-viewer-grid.js.map +1 -1
  88. package/dist/components/dsot-document-component-demo.d.ts +11 -0
  89. package/dist/components/dsot-document-component-demo.js +202 -0
  90. package/dist/components/dsot-document-component-demo.js.map +1 -0
  91. package/dist/components/expandable.js +18 -39
  92. package/dist/components/expandable.js.map +1 -1
  93. package/dist/components/index.d.ts +4 -2
  94. package/dist/components/index.js +2 -1
  95. package/dist/components/index.js.map +1 -1
  96. package/dist/components/index2.js +61 -185
  97. package/dist/components/index2.js.map +1 -1
  98. package/dist/{esm/dso-label.entry.js → components/label.js} +82 -41
  99. package/dist/components/label.js.map +1 -0
  100. package/dist/{esm/dso-ozon-content.entry.js → components/ozon-content.js} +43 -14
  101. package/dist/components/ozon-content.js.map +1 -0
  102. package/dist/components/scrollable.js +1 -1
  103. package/dist/{esm/dso-slide-toggle.entry.js → components/slide-toggle.js} +31 -10
  104. package/dist/{dso-toolkit/p-b1627d68.entry.js.map → components/slide-toggle.js.map} +1 -1
  105. package/dist/components/tooltip.js +1 -1
  106. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  107. package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
  108. package/dist/dso-toolkit/p-021589dc.entry.js +2 -0
  109. package/dist/dso-toolkit/p-021589dc.entry.js.map +1 -0
  110. package/dist/dso-toolkit/{p-12c3fc19.entry.js → p-05ea1fba.entry.js} +2 -2
  111. package/dist/dso-toolkit/{p-657c43f4.entry.js → p-0e5a93c3.entry.js} +2 -2
  112. package/dist/dso-toolkit/p-14453f73.entry.js +2 -0
  113. package/dist/dso-toolkit/p-14453f73.entry.js.map +1 -0
  114. package/dist/dso-toolkit/{p-63ce173c.entry.js → p-168750a2.entry.js} +2 -2
  115. package/dist/dso-toolkit/{p-904a2caf.entry.js → p-29752a45.entry.js} +2 -2
  116. package/dist/dso-toolkit/{p-9c2d4a91.entry.js → p-29b741cb.entry.js} +2 -2
  117. package/dist/dso-toolkit/{p-fdf8bd94.entry.js → p-3c554a18.entry.js} +2 -2
  118. package/dist/dso-toolkit/{p-d4f8e1e0.entry.js → p-3fa7489e.entry.js} +2 -2
  119. package/dist/dso-toolkit/{p-fa6d8d5a.entry.js → p-422bcf93.entry.js} +2 -2
  120. package/dist/dso-toolkit/p-42d3c595.entry.js +2 -0
  121. package/dist/dso-toolkit/{p-1d3ed808.entry.js.map → p-42d3c595.entry.js.map} +1 -1
  122. package/dist/dso-toolkit/p-5265e22b.entry.js +2 -0
  123. package/dist/dso-toolkit/p-56d87a53.entry.js +2 -0
  124. package/dist/dso-toolkit/p-56d87a53.entry.js.map +1 -0
  125. package/dist/dso-toolkit/{p-71143eef.entry.js → p-6050e8e6.entry.js} +2 -2
  126. package/dist/dso-toolkit/{p-5040a304.entry.js → p-674e2406.entry.js} +2 -2
  127. package/dist/dso-toolkit/{p-2bd5d2a2.entry.js → p-68e9f61b.entry.js} +2 -2
  128. package/dist/dso-toolkit/{p-f70d6a66.entry.js → p-818d032e.entry.js} +2 -2
  129. package/dist/dso-toolkit/{p-a4e3638a.entry.js → p-83cdfde8.entry.js} +2 -2
  130. package/dist/dso-toolkit/p-88f4366e.entry.js +2 -0
  131. package/dist/dso-toolkit/p-88f4366e.entry.js.map +1 -0
  132. package/dist/dso-toolkit/{p-8f166691.entry.js → p-909ccf98.entry.js} +2 -2
  133. package/dist/dso-toolkit/{p-58bed94b.entry.js → p-9b587a94.entry.js} +2 -2
  134. package/dist/dso-toolkit/p-9c0477fc.entry.js +2 -0
  135. package/dist/dso-toolkit/{p-56069350.entry.js.map → p-9c0477fc.entry.js.map} +1 -1
  136. package/dist/dso-toolkit/{p-79767cc1.entry.js → p-9f2bb98b.entry.js} +2 -2
  137. package/dist/dso-toolkit/{p-6e0b67c9.entry.js → p-9fee52e5.entry.js} +2 -2
  138. package/dist/dso-toolkit/{p-9b14a015.entry.js → p-a616ab8a.entry.js} +2 -2
  139. package/dist/dso-toolkit/{p-ef23bffb.entry.js → p-b627d9ac.entry.js} +2 -2
  140. package/dist/dso-toolkit/{p-9d64a2f4.entry.js → p-b67631ef.entry.js} +2 -2
  141. package/dist/dso-toolkit/{p-0653b5d2.entry.js → p-bcae3f55.entry.js} +2 -2
  142. package/dist/dso-toolkit/{p-b1b53cb3.entry.js → p-bf203ab8.entry.js} +2 -2
  143. package/dist/dso-toolkit/{p-ee2771d4.entry.js → p-c8165a50.entry.js} +2 -2
  144. package/dist/dso-toolkit/{p-26cdce1c.js → p-ce928197.js} +2 -2
  145. package/dist/dso-toolkit/{p-601b4ce0.entry.js → p-cfd6f4ef.entry.js} +2 -2
  146. package/dist/dso-toolkit/{p-b6f1ae13.entry.js → p-d3f69d06.entry.js} +2 -2
  147. package/dist/dso-toolkit/{p-554e7d6a.entry.js → p-d4320890.entry.js} +2 -2
  148. package/dist/dso-toolkit/{p-554e7d6a.entry.js.map → p-d4320890.entry.js.map} +1 -1
  149. package/dist/dso-toolkit/{p-3ab9390b.entry.js → p-d8c137b5.entry.js} +2 -2
  150. package/dist/dso-toolkit/p-debbe184.entry.js +2 -0
  151. package/dist/dso-toolkit/{p-c3178955.entry.js.map → p-debbe184.entry.js.map} +1 -1
  152. package/dist/dso-toolkit/{p-7098eb9d.entry.js → p-f56c1b28.entry.js} +2 -2
  153. package/dist/dso-toolkit/p-f56c1b28.entry.js.map +1 -0
  154. package/dist/dso-toolkit/p-fafa5ea1.entry.js +2 -0
  155. package/dist/dso-toolkit/p-fafa5ea1.entry.js.map +1 -0
  156. package/dist/esm/dso-accordion-section.entry.js +32 -89
  157. package/dist/esm/dso-accordion-section.entry.js.map +1 -1
  158. package/dist/esm/dso-accordion.entry.js +198 -108
  159. package/dist/esm/dso-accordion.entry.js.map +1 -1
  160. package/dist/esm/dso-action-list-item.entry.js +1 -1
  161. package/dist/esm/dso-action-list.entry.js +1 -1
  162. package/dist/esm/dso-alert_5.entry.js +713 -0
  163. package/dist/esm/dso-alert_5.entry.js.map +1 -0
  164. package/dist/esm/dso-annotation-output_3.entry.js +137 -0
  165. package/dist/esm/dso-annotation-output_3.entry.js.map +1 -0
  166. package/dist/esm/dso-attachments-counter.entry.js +1 -1
  167. package/dist/esm/dso-autosuggest.entry.js +1 -1
  168. package/dist/esm/dso-banner.entry.js +1 -1
  169. package/dist/esm/dso-card-container.entry.js +1 -1
  170. package/dist/esm/dso-card.entry.js +1 -1
  171. package/dist/esm/dso-date-picker.entry.js +1 -1
  172. package/dist/esm/dso-dropdown-menu.entry.js +1 -1
  173. package/dist/esm/dso-expandable.entry.js +17 -36
  174. package/dist/esm/dso-expandable.entry.js.map +1 -1
  175. package/dist/esm/dso-header.entry.js +1 -1
  176. package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
  177. package/dist/esm/dso-highlight-box.entry.js +1 -1
  178. package/dist/esm/dso-icon.entry.js +1 -1
  179. package/dist/esm/dso-image-overlay.entry.js +1 -1
  180. package/dist/esm/dso-info-button.entry.js +1 -1
  181. package/dist/esm/dso-info_2.entry.js +1 -1
  182. package/dist/esm/dso-list-button.entry.js +1 -1
  183. package/dist/esm/dso-map-base-layers.entry.js +1 -1
  184. package/dist/esm/dso-map-controls.entry.js +1 -1
  185. package/dist/esm/dso-map-overlays.entry.js +1 -1
  186. package/dist/esm/dso-modal.entry.js +1 -1
  187. package/dist/esm/dso-pagination.entry.js +1 -1
  188. package/dist/esm/dso-progress-bar.entry.js +1 -1
  189. package/dist/esm/dso-progress-indicator.entry.js +1 -1
  190. package/dist/esm/dso-responsive-element.entry.js +1 -1
  191. package/dist/esm/dso-scrollable.entry.js +1 -1
  192. package/dist/esm/dso-table.entry.js +1 -1
  193. package/dist/esm/dso-toggletip.entry.js +1 -1
  194. package/dist/esm/dso-toolkit.js +3 -3
  195. package/dist/esm/dso-tooltip.entry.js +1 -1
  196. package/dist/esm/dso-tree-view.entry.js +1 -1
  197. package/dist/esm/dso-viewer-grid.entry.js +2 -2
  198. package/dist/esm/dso-viewer-grid.entry.js.map +1 -1
  199. package/dist/esm/dsot-document-component-demo.entry.js +106 -0
  200. package/dist/esm/dsot-document-component-demo.entry.js.map +1 -0
  201. package/dist/esm/{index-898d8443.js → index-367cff36.js} +2 -2
  202. package/dist/esm/{index-898d8443.js.map → index-367cff36.js.map} +1 -1
  203. package/dist/esm/loader.js +3 -3
  204. package/dist/types/components/accordion/accordion.d.ts +6 -39
  205. package/dist/types/components/accordion/accordion.interfaces.d.ts +2 -18
  206. package/dist/types/components/accordion/components/accordion-section.d.ts +15 -19
  207. package/dist/types/components/accordion/components/accordion-section.interfaces.d.ts +22 -0
  208. package/dist/types/components/annotation-button/annotation-button.d.ts +15 -4
  209. package/dist/types/components/annotation-output/annotation-output.d.ts +7 -5
  210. package/dist/types/components/document-component/document-component-heading.d.ts +7 -0
  211. package/dist/types/components/document-component/document-component.d.ts +84 -0
  212. package/dist/types/components/document-component/document-component.demo.d.ts +40 -0
  213. package/dist/types/components/document-component/document-component.types.d.ts +8 -0
  214. package/dist/types/components/expandable/expandable.d.ts +5 -12
  215. package/dist/types/components/label/label.d.ts +9 -9
  216. package/dist/types/components.d.ts +235 -127
  217. package/package.json +2 -2
  218. package/dist/cjs/annotation.service-60e6b0f1.js +0 -23
  219. package/dist/cjs/annotation.service-60e6b0f1.js.map +0 -1
  220. package/dist/cjs/dso-alert.cjs.entry.js +0 -34
  221. package/dist/cjs/dso-alert.cjs.entry.js.map +0 -1
  222. package/dist/cjs/dso-annotation-button.cjs.entry.js +0 -27
  223. package/dist/cjs/dso-annotation-button.cjs.entry.js.map +0 -1
  224. package/dist/cjs/dso-annotation-output.cjs.entry.js +0 -44
  225. package/dist/cjs/dso-annotation-output.cjs.entry.js.map +0 -1
  226. package/dist/cjs/dso-badge.cjs.entry.js +0 -23
  227. package/dist/cjs/dso-badge.cjs.entry.js.map +0 -1
  228. package/dist/cjs/dso-expandable-heading.cjs.entry.js +0 -54
  229. package/dist/cjs/dso-expandable-heading.cjs.entry.js.map +0 -1
  230. package/dist/cjs/dso-label.cjs.entry.js +0 -130
  231. package/dist/cjs/dso-label.cjs.entry.js.map +0 -1
  232. package/dist/cjs/dso-ozon-content.cjs.entry.js +0 -532
  233. package/dist/cjs/dso-ozon-content.cjs.entry.js.map +0 -1
  234. package/dist/cjs/dso-slide-toggle.cjs.entry.js +0 -39
  235. package/dist/cjs/dso-slide-toggle.cjs.entry.js.map +0 -1
  236. package/dist/cjs/index-a189d603.js +0 -198
  237. package/dist/cjs/index-a189d603.js.map +0 -1
  238. package/dist/collection/components/annotation-output/annotation-output.interfaces.js +0 -2
  239. package/dist/collection/components/annotation-output/annotation-output.interfaces.js.map +0 -1
  240. package/dist/collection/components/expandable/expandable.functions.js +0 -4
  241. package/dist/collection/components/expandable/expandable.functions.js.map +0 -1
  242. package/dist/collection/components/expandable-heading/expandable-heading.css +0 -200
  243. package/dist/collection/components/expandable-heading/expandable-heading.interfaces.js +0 -2
  244. package/dist/collection/components/expandable-heading/expandable-heading.interfaces.js.map +0 -1
  245. package/dist/collection/components/expandable-heading/expandable-heading.js +0 -163
  246. package/dist/collection/components/expandable-heading/expandable-heading.js.map +0 -1
  247. package/dist/collection/components/expandable-heading/heading.js +0 -17
  248. package/dist/collection/components/expandable-heading/heading.js.map +0 -1
  249. package/dist/collection/services/annotation.service.js +0 -17
  250. package/dist/collection/services/annotation.service.js.map +0 -1
  251. package/dist/components/annotation.service.js +0 -21
  252. package/dist/components/annotation.service.js.map +0 -1
  253. package/dist/components/dso-expandable-heading.d.ts +0 -11
  254. package/dist/components/dso-expandable-heading.js +0 -86
  255. package/dist/components/dso-expandable-heading.js.map +0 -1
  256. package/dist/components/index3.js +0 -72
  257. package/dist/components/index3.js.map +0 -1
  258. package/dist/dso-toolkit/p-0c762ac9.entry.js +0 -2
  259. package/dist/dso-toolkit/p-0c762ac9.entry.js.map +0 -1
  260. package/dist/dso-toolkit/p-0ffae824.entry.js +0 -2
  261. package/dist/dso-toolkit/p-0ffae824.entry.js.map +0 -1
  262. package/dist/dso-toolkit/p-1d3ed808.entry.js +0 -2
  263. package/dist/dso-toolkit/p-26713aef.js +0 -2
  264. package/dist/dso-toolkit/p-26713aef.js.map +0 -1
  265. package/dist/dso-toolkit/p-52f2be73.entry.js +0 -2
  266. package/dist/dso-toolkit/p-52f2be73.entry.js.map +0 -1
  267. package/dist/dso-toolkit/p-56069350.entry.js +0 -2
  268. package/dist/dso-toolkit/p-59ff4e19.entry.js +0 -2
  269. package/dist/dso-toolkit/p-59ff4e19.entry.js.map +0 -1
  270. package/dist/dso-toolkit/p-7098eb9d.entry.js.map +0 -1
  271. package/dist/dso-toolkit/p-835a599b.entry.js +0 -2
  272. package/dist/dso-toolkit/p-91453b47.entry.js +0 -2
  273. package/dist/dso-toolkit/p-91453b47.entry.js.map +0 -1
  274. package/dist/dso-toolkit/p-9eccd618.js +0 -2
  275. package/dist/dso-toolkit/p-9eccd618.js.map +0 -1
  276. package/dist/dso-toolkit/p-b1627d68.entry.js +0 -2
  277. package/dist/dso-toolkit/p-c3178955.entry.js +0 -2
  278. package/dist/dso-toolkit/p-c464da66.entry.js +0 -2
  279. package/dist/dso-toolkit/p-c464da66.entry.js.map +0 -1
  280. package/dist/dso-toolkit/p-c4e1c7cb.entry.js +0 -2
  281. package/dist/dso-toolkit/p-c4e1c7cb.entry.js.map +0 -1
  282. package/dist/dso-toolkit/p-dd9e9c47.entry.js +0 -2
  283. package/dist/dso-toolkit/p-dd9e9c47.entry.js.map +0 -1
  284. package/dist/dso-toolkit/p-de310a49.entry.js +0 -2
  285. package/dist/dso-toolkit/p-de310a49.entry.js.map +0 -1
  286. package/dist/esm/annotation.service-cd25eba0.js +0 -21
  287. package/dist/esm/annotation.service-cd25eba0.js.map +0 -1
  288. package/dist/esm/dso-alert.entry.js.map +0 -1
  289. package/dist/esm/dso-annotation-button.entry.js +0 -23
  290. package/dist/esm/dso-annotation-button.entry.js.map +0 -1
  291. package/dist/esm/dso-annotation-output.entry.js +0 -40
  292. package/dist/esm/dso-annotation-output.entry.js.map +0 -1
  293. package/dist/esm/dso-badge.entry.js.map +0 -1
  294. package/dist/esm/dso-expandable-heading.entry.js +0 -50
  295. package/dist/esm/dso-expandable-heading.entry.js.map +0 -1
  296. package/dist/esm/dso-label.entry.js.map +0 -1
  297. package/dist/esm/dso-ozon-content.entry.js.map +0 -1
  298. package/dist/esm/dso-slide-toggle.entry.js.map +0 -1
  299. package/dist/esm/index-b57dbe04.js +0 -196
  300. package/dist/esm/index-b57dbe04.js.map +0 -1
  301. package/dist/types/components/annotation-output/annotation-output.interfaces.d.ts +0 -4
  302. package/dist/types/components/expandable/expandable.functions.d.ts +0 -1
  303. package/dist/types/components/expandable-heading/expandable-heading.d.ts +0 -33
  304. package/dist/types/components/expandable-heading/expandable-heading.interfaces.d.ts +0 -6
  305. package/dist/types/components/expandable-heading/heading.d.ts +0 -9
  306. package/dist/types/services/annotation.service.d.ts +0 -10
  307. /package/dist/dso-toolkit/{p-12c3fc19.entry.js.map → p-05ea1fba.entry.js.map} +0 -0
  308. /package/dist/dso-toolkit/{p-657c43f4.entry.js.map → p-0e5a93c3.entry.js.map} +0 -0
  309. /package/dist/dso-toolkit/{p-63ce173c.entry.js.map → p-168750a2.entry.js.map} +0 -0
  310. /package/dist/dso-toolkit/{p-904a2caf.entry.js.map → p-29752a45.entry.js.map} +0 -0
  311. /package/dist/dso-toolkit/{p-9c2d4a91.entry.js.map → p-29b741cb.entry.js.map} +0 -0
  312. /package/dist/dso-toolkit/{p-fdf8bd94.entry.js.map → p-3c554a18.entry.js.map} +0 -0
  313. /package/dist/dso-toolkit/{p-d4f8e1e0.entry.js.map → p-3fa7489e.entry.js.map} +0 -0
  314. /package/dist/dso-toolkit/{p-fa6d8d5a.entry.js.map → p-422bcf93.entry.js.map} +0 -0
  315. /package/dist/dso-toolkit/{p-835a599b.entry.js.map → p-5265e22b.entry.js.map} +0 -0
  316. /package/dist/dso-toolkit/{p-71143eef.entry.js.map → p-6050e8e6.entry.js.map} +0 -0
  317. /package/dist/dso-toolkit/{p-5040a304.entry.js.map → p-674e2406.entry.js.map} +0 -0
  318. /package/dist/dso-toolkit/{p-2bd5d2a2.entry.js.map → p-68e9f61b.entry.js.map} +0 -0
  319. /package/dist/dso-toolkit/{p-f70d6a66.entry.js.map → p-818d032e.entry.js.map} +0 -0
  320. /package/dist/dso-toolkit/{p-a4e3638a.entry.js.map → p-83cdfde8.entry.js.map} +0 -0
  321. /package/dist/dso-toolkit/{p-8f166691.entry.js.map → p-909ccf98.entry.js.map} +0 -0
  322. /package/dist/dso-toolkit/{p-58bed94b.entry.js.map → p-9b587a94.entry.js.map} +0 -0
  323. /package/dist/dso-toolkit/{p-79767cc1.entry.js.map → p-9f2bb98b.entry.js.map} +0 -0
  324. /package/dist/dso-toolkit/{p-6e0b67c9.entry.js.map → p-9fee52e5.entry.js.map} +0 -0
  325. /package/dist/dso-toolkit/{p-9b14a015.entry.js.map → p-a616ab8a.entry.js.map} +0 -0
  326. /package/dist/dso-toolkit/{p-ef23bffb.entry.js.map → p-b627d9ac.entry.js.map} +0 -0
  327. /package/dist/dso-toolkit/{p-9d64a2f4.entry.js.map → p-b67631ef.entry.js.map} +0 -0
  328. /package/dist/dso-toolkit/{p-0653b5d2.entry.js.map → p-bcae3f55.entry.js.map} +0 -0
  329. /package/dist/dso-toolkit/{p-b1b53cb3.entry.js.map → p-bf203ab8.entry.js.map} +0 -0
  330. /package/dist/dso-toolkit/{p-ee2771d4.entry.js.map → p-c8165a50.entry.js.map} +0 -0
  331. /package/dist/dso-toolkit/{p-26cdce1c.js.map → p-ce928197.js.map} +0 -0
  332. /package/dist/dso-toolkit/{p-601b4ce0.entry.js.map → p-cfd6f4ef.entry.js.map} +0 -0
  333. /package/dist/dso-toolkit/{p-b6f1ae13.entry.js.map → p-d3f69d06.entry.js.map} +0 -0
  334. /package/dist/dso-toolkit/{p-3ab9390b.entry.js.map → p-d8c137b5.entry.js.map} +0 -0
@@ -3,141 +3,231 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-efc2222e.js');
6
- const index$1 = require('./index-a189d603.js');
6
+
7
+ const appendToMap = (map, propName, value) => {
8
+ const items = map.get(propName);
9
+ if (!items) {
10
+ map.set(propName, [value]);
11
+ }
12
+ else if (!items.includes(value)) {
13
+ items.push(value);
14
+ }
15
+ };
16
+ const debounce = (fn, ms) => {
17
+ let timeoutId;
18
+ return (...args) => {
19
+ if (timeoutId) {
20
+ clearTimeout(timeoutId);
21
+ }
22
+ timeoutId = setTimeout(() => {
23
+ timeoutId = 0;
24
+ fn(...args);
25
+ }, ms);
26
+ };
27
+ };
28
+
29
+ /**
30
+ * Check if a possible element isConnected.
31
+ * The property might not be there, so we check for it.
32
+ *
33
+ * We want it to return true if isConnected is not a property,
34
+ * otherwise we would remove these elements and would not update.
35
+ *
36
+ * Better leak in Edge than to be useless.
37
+ */
38
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
39
+ const cleanupElements = debounce((map) => {
40
+ for (let key of map.keys()) {
41
+ map.set(key, map.get(key).filter(isConnected));
42
+ }
43
+ }, 2000);
44
+ const stencilSubscription = () => {
45
+ if (typeof index.getRenderingRef !== 'function') {
46
+ // If we are not in a stencil project, we do nothing.
47
+ // This function is not really exported by @stencil/core.
48
+ return {};
49
+ }
50
+ const elmsToUpdate = new Map();
51
+ return {
52
+ dispose: () => elmsToUpdate.clear(),
53
+ get: (propName) => {
54
+ const elm = index.getRenderingRef();
55
+ if (elm) {
56
+ appendToMap(elmsToUpdate, propName, elm);
57
+ }
58
+ },
59
+ set: (propName) => {
60
+ const elements = elmsToUpdate.get(propName);
61
+ if (elements) {
62
+ elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
63
+ }
64
+ cleanupElements(elmsToUpdate);
65
+ },
66
+ reset: () => {
67
+ elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
68
+ cleanupElements(elmsToUpdate);
69
+ },
70
+ };
71
+ };
72
+
73
+ const unwrap = (val) => (typeof val === 'function' ? val() : val);
74
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
75
+ const unwrappedState = unwrap(defaultState);
76
+ let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
77
+ const handlers = {
78
+ dispose: [],
79
+ get: [],
80
+ set: [],
81
+ reset: [],
82
+ };
83
+ const reset = () => {
84
+ var _a;
85
+ // When resetting the state, the default state may be a function - unwrap it to invoke it.
86
+ // otherwise, the state won't be properly reset
87
+ states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
88
+ handlers.reset.forEach((cb) => cb());
89
+ };
90
+ const dispose = () => {
91
+ // Call first dispose as resetting the state would
92
+ // cause less updates ;)
93
+ handlers.dispose.forEach((cb) => cb());
94
+ reset();
95
+ };
96
+ const get = (propName) => {
97
+ handlers.get.forEach((cb) => cb(propName));
98
+ return states.get(propName);
99
+ };
100
+ const set = (propName, value) => {
101
+ const oldValue = states.get(propName);
102
+ if (shouldUpdate(value, oldValue, propName)) {
103
+ states.set(propName, value);
104
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
105
+ }
106
+ };
107
+ const state = (typeof Proxy === 'undefined'
108
+ ? {}
109
+ : new Proxy(unwrappedState, {
110
+ get(_, propName) {
111
+ return get(propName);
112
+ },
113
+ ownKeys(_) {
114
+ return Array.from(states.keys());
115
+ },
116
+ getOwnPropertyDescriptor() {
117
+ return {
118
+ enumerable: true,
119
+ configurable: true,
120
+ };
121
+ },
122
+ has(_, propName) {
123
+ return states.has(propName);
124
+ },
125
+ set(_, propName, value) {
126
+ set(propName, value);
127
+ return true;
128
+ },
129
+ }));
130
+ const on = (eventName, callback) => {
131
+ handlers[eventName].push(callback);
132
+ return () => {
133
+ removeFromArray(handlers[eventName], callback);
134
+ };
135
+ };
136
+ const onChange = (propName, cb) => {
137
+ const unSet = on('set', (key, newValue) => {
138
+ if (key === propName) {
139
+ cb(newValue);
140
+ }
141
+ });
142
+ // We need to unwrap the defaultState because it might be a function.
143
+ // Otherwise we might not be sending the right reset value.
144
+ const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
145
+ return () => {
146
+ unSet();
147
+ unReset();
148
+ };
149
+ };
150
+ const use = (...subscriptions) => {
151
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
152
+ if (subscription.set) {
153
+ unsubs.push(on('set', subscription.set));
154
+ }
155
+ if (subscription.get) {
156
+ unsubs.push(on('get', subscription.get));
157
+ }
158
+ if (subscription.reset) {
159
+ unsubs.push(on('reset', subscription.reset));
160
+ }
161
+ if (subscription.dispose) {
162
+ unsubs.push(on('dispose', subscription.dispose));
163
+ }
164
+ return unsubs;
165
+ }, []);
166
+ return () => unsubs.forEach((unsub) => unsub());
167
+ };
168
+ const forceUpdate = (key) => {
169
+ const oldValue = states.get(key);
170
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
171
+ };
172
+ return {
173
+ state,
174
+ get,
175
+ set,
176
+ on,
177
+ onChange,
178
+ use,
179
+ dispose,
180
+ reset,
181
+ forceUpdate,
182
+ };
183
+ };
184
+ const removeFromArray = (array, item) => {
185
+ const index = array.indexOf(item);
186
+ if (index >= 0) {
187
+ array[index] = array[array.length - 1];
188
+ array.length--;
189
+ }
190
+ };
191
+
192
+ const createStore = (defaultState, shouldUpdate) => {
193
+ const map = createObservableMap(defaultState, shouldUpdate);
194
+ map.use(stencilSubscription());
195
+ return map;
196
+ };
7
197
 
8
198
  const accordionCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}";
9
199
 
10
200
  const Accordion = class {
11
201
  updateVariant(variant = "default") {
12
- this.accordionState.variant = variant || "default";
202
+ this.accordionState.variant = variant;
13
203
  }
14
204
  updateReverseAlign(reverseAlign) {
15
205
  this.accordionState.reverseAlign = reverseAlign;
16
206
  }
17
- updateAllowMultipleOpen(allowMultipleOpen) {
18
- this.accordionState.allowMultipleOpen = allowMultipleOpen;
19
- if (!allowMultipleOpen) {
20
- const openSections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section[open]"));
21
- // By removing the first section, it is kept open;
22
- openSections.shift();
23
- openSections.forEach((section) => this.controlOpenAttribute(section, false));
24
- }
25
- }
26
207
  /**
27
208
  * @internal
28
209
  */
29
210
  async _getState() {
30
211
  return this.accordionState;
31
212
  }
32
- /**
33
- * Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section.
34
- * @param sectionElement The section element that needs to toggle
35
- * @param event The event that the user triggered
36
- * @returns The state of the section
37
- */
38
- async toggleSection(sectionElement, event) {
39
- const sections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section"));
40
- if (typeof sectionElement === "number") {
41
- const section = sections[sectionElement];
42
- if (section instanceof HTMLElement) {
43
- sectionElement = section;
44
- }
45
- }
46
- if (!(sectionElement instanceof HTMLElement) || !sections.includes(sectionElement)) {
47
- return;
48
- }
49
- const sectionIsOpen = this.isSectionOpen(sectionElement);
50
- if (this.allowMultipleOpen) {
51
- this.controlOpenAttribute(sectionElement, !sectionIsOpen);
52
- this.emitToggleEvent(sectionElement, sections, event);
53
- return !sectionIsOpen;
54
- }
55
- if (sectionIsOpen) {
56
- this.controlOpenAttribute(sectionElement, false);
57
- this.emitToggleEvent(sectionElement, sections, event);
58
- return false;
59
- }
60
- await this.closeOpenSections();
61
- this.controlOpenAttribute(sectionElement, true);
62
- this.emitToggleEvent(sectionElement, sections, event);
63
- return true;
64
- }
65
- /**
66
- * Emitted when the animation of opening or closing ends.
67
- */
68
- async animationEnd(sectionElement) {
69
- this.dsoToggleSectionAnimationEnd.emit({
70
- section: {
71
- element: sectionElement,
72
- open: this.isSectionOpen(sectionElement),
73
- },
74
- });
75
- }
76
- /**
77
- * Closes all sections belonging to this accordion.
78
- */
79
- async closeOpenSections() {
80
- const sections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section"));
81
- const openSections = sections.filter((s) => this.isSectionOpen(s));
82
- openSections.forEach((section) => this.controlOpenAttribute(section, false));
83
- }
84
- // These checks are needed for a React timing issue.
85
213
  componentWillLoad() {
86
- if (this.accordionState.variant !== this.variant) {
87
- this.accordionState.variant = this.variant || "default";
88
- }
89
- if (this.accordionState.reverseAlign !== this.reverseAlign) {
90
- this.accordionState.reverseAlign = this.reverseAlign;
91
- }
92
- if (this.accordionState.allowMultipleOpen !== this.allowMultipleOpen) {
93
- this.accordionState.allowMultipleOpen = this.allowMultipleOpen;
94
- }
214
+ this.accordionState.variant = this.variant;
215
+ this.accordionState.reverseAlign = this.reverseAlign;
95
216
  }
96
217
  constructor(hostRef) {
97
218
  index.registerInstance(this, hostRef);
98
- this.dsoToggleSection = index.createEvent(this, "dsoToggleSection", 7);
99
- this.dsoToggleSectionAnimationEnd = index.createEvent(this, "dsoToggleSectionAnimationEnd", 7);
100
219
  this.variant = "default";
101
220
  this.reverseAlign = false;
102
- this.allowMultipleOpen = false;
103
- const { state } = index$1.createStore({
104
- variant: this.variant || "default",
105
- reverseAlign: this.reverseAlign,
106
- allowMultipleOpen: this.allowMultipleOpen,
107
- });
221
+ const { state } = createStore({});
108
222
  this.accordionState = state;
109
223
  }
110
224
  render() {
111
- return (index.h(index.Host, { class: {
112
- "dso-accordion": true,
113
- } }, index.h("slot", null)));
114
- }
115
- emitToggleEvent(sectionElement, sections, e) {
116
- this.dsoToggleSection.emit({
117
- originalEvent: e,
118
- section: {
119
- element: sectionElement,
120
- open: this.isSectionOpen(sectionElement),
121
- },
122
- sections,
123
- });
124
- }
125
- isSectionOpen(sectionElement) {
126
- return typeof sectionElement.getAttribute("open") === "string";
127
- }
128
- controlOpenAttribute(sectionElement, setAttribute) {
129
- if (setAttribute) {
130
- sectionElement.setAttribute("open", "");
131
- }
132
- else {
133
- sectionElement.removeAttribute("open");
134
- }
225
+ return (index.h(index.Host, { class: "dso-accordion" }, index.h("slot", null)));
135
226
  }
136
227
  get host() { return index.getElement(this); }
137
228
  static get watchers() { return {
138
229
  "variant": ["updateVariant"],
139
- "reverseAlign": ["updateReverseAlign"],
140
- "allowMultipleOpen": ["updateAllowMultipleOpen"]
230
+ "reverseAlign": ["updateReverseAlign"]
141
231
  }; }
142
232
  };
143
233
  Accordion.style = accordionCss;
@@ -1 +1 @@
1
- {"file":"dso-accordion.entry.cjs.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,CAA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AiB,CAAC;KAChE;GACF;EAED;;;;mBAjJ6B,SAAS;wBAMvB,KAAK;6BAMA,KAAK;IAsIvB,MAAM,EAAE,KAAK,EAAE,GAAGA,mBAAW,CAAyB;MACpD,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS;MAClC,YAAY,EAAE,IAAI,CAAC,YAAY;MAC/B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;KAC1C,CAAC,CAAC;IAEH,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;GAC7B;EAED,MAAM;IACJ,QACEC,QAACC,UAAI,IACH,KAAK,EAAE;QACL,eAAe,EAAE,IAAI;OACtB,IAEDD,qBAAa,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":["createStore","h","Host"],"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\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@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}