wj-elements 0.2.0-alpha.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (385) hide show
  1. package/dist/dark.css +15 -1
  2. package/dist/{form-associated-element-o0UjvdUp.js → form-associated-element-DEQ4y-jn.js} +1 -2
  3. package/dist/form-associated-element-DEQ4y-jn.js.map +1 -0
  4. package/dist/{icon-DY5AZ6xM.js → icon-DVyMc4Wv.js} +36 -2
  5. package/dist/{icon-DY5AZ6xM.js.map → icon-DVyMc4Wv.js.map} +1 -1
  6. package/dist/{packages/internals → internals}/form-associated-element.d.ts +0 -1
  7. package/dist/light.css +7 -2
  8. package/dist/localize.js +8 -5
  9. package/dist/localize.js.map +1 -1
  10. package/dist/{popup.element-DeajFyOQ.js → popup.element-Cl6QeG8M.js} +2 -2
  11. package/dist/{popup.element-DeajFyOQ.js.map → popup.element-Cl6QeG8M.js.map} +1 -1
  12. package/dist/skeleton.css +197 -0
  13. package/dist/utils/utils.d.ts +17 -0
  14. package/dist/utils.js +18 -1
  15. package/dist/utils.js.map +1 -1
  16. package/dist/{packages/wje-accordion-item → wje-accordion-item}/accordion-item.element.d.ts +3 -0
  17. package/dist/wje-accordion-item.js +26 -4
  18. package/dist/wje-accordion-item.js.map +1 -1
  19. package/dist/wje-accordion.js +1 -0
  20. package/dist/wje-accordion.js.map +1 -1
  21. package/dist/wje-animation.js +1 -0
  22. package/dist/wje-animation.js.map +1 -1
  23. package/dist/{packages/wje-avatar → wje-avatar}/avatar.element.d.ts +5 -0
  24. package/dist/wje-avatar.js +18 -0
  25. package/dist/wje-avatar.js.map +1 -1
  26. package/dist/wje-badge.js +1 -0
  27. package/dist/wje-badge.js.map +1 -1
  28. package/dist/{packages/wje-breadcrumb → wje-breadcrumb}/breadcrumb.element.d.ts +1 -0
  29. package/dist/wje-breadcrumb.js +13 -1
  30. package/dist/wje-breadcrumb.js.map +1 -1
  31. package/dist/wje-breadcrumbs.js +1 -0
  32. package/dist/wje-breadcrumbs.js.map +1 -1
  33. package/dist/{packages/wje-button → wje-button}/button.element.d.ts +5 -1
  34. package/dist/{packages/wje-button-group → wje-button-group}/button-group.element.d.ts +4 -0
  35. package/dist/wje-button-group.js +10 -0
  36. package/dist/wje-button-group.js.map +1 -1
  37. package/dist/wje-button.js +29 -5
  38. package/dist/wje-button.js.map +1 -1
  39. package/dist/{packages/wje-card → wje-card}/card.element.d.ts +15 -6
  40. package/dist/wje-card.js +37 -0
  41. package/dist/wje-card.js.map +1 -1
  42. package/dist/{packages/wje-carousel → wje-carousel}/carousel.element.d.ts +4 -0
  43. package/dist/wje-carousel.js +38 -4
  44. package/dist/wje-carousel.js.map +1 -1
  45. package/dist/{packages/wje-checkbox → wje-checkbox}/checkbox.element.d.ts +14 -0
  46. package/dist/wje-checkbox.js +48 -3
  47. package/dist/wje-checkbox.js.map +1 -1
  48. package/dist/{packages/wje-chip → wje-chip}/chip.element.d.ts +6 -0
  49. package/dist/wje-chip.js +22 -0
  50. package/dist/wje-chip.js.map +1 -1
  51. package/dist/{packages/wje-color-picker → wje-color-picker}/color-picker.element.d.ts +43 -1
  52. package/dist/wje-color-picker.js +143 -29
  53. package/dist/wje-color-picker.js.map +1 -1
  54. package/dist/{packages/wje-copy-button → wje-copy-button}/copy-button.element.d.ts +4 -0
  55. package/dist/wje-copy-button.js +21 -0
  56. package/dist/wje-copy-button.js.map +1 -1
  57. package/dist/{packages/wje-dialog → wje-dialog}/dialog.element.d.ts +2 -0
  58. package/dist/wje-dialog.js +35 -2
  59. package/dist/wje-dialog.js.map +1 -1
  60. package/dist/{packages/wje-dropdown → wje-dropdown}/dropdown.element.d.ts +7 -0
  61. package/dist/wje-dropdown.js +27 -3
  62. package/dist/wje-dropdown.js.map +1 -1
  63. package/dist/{packages/wje-element → wje-element}/element.d.ts +55 -24
  64. package/dist/wje-element.js +87 -242
  65. package/dist/wje-element.js.map +1 -1
  66. package/dist/{packages/wje-file-upload → wje-file-upload}/file-upload.element.d.ts +17 -6
  67. package/dist/{packages/wje-file-upload → wje-file-upload}/service/service.d.ts +0 -23
  68. package/dist/{packages/wje-file-upload-item → wje-file-upload-item}/file-upload-item.element.d.ts +6 -0
  69. package/dist/wje-file-upload-item.js +24 -2
  70. package/dist/wje-file-upload-item.js.map +1 -1
  71. package/dist/wje-file-upload.js +100 -77
  72. package/dist/wje-file-upload.js.map +1 -1
  73. package/dist/{packages/wje-format-digital → wje-format-digital}/format-digital.element.d.ts +2 -0
  74. package/dist/wje-format-digital.js +9 -0
  75. package/dist/wje-format-digital.js.map +1 -1
  76. package/dist/{packages/wje-icon → wje-icon}/icon.element.d.ts +11 -0
  77. package/dist/{packages/wje-icon-picker → wje-icon-picker}/icon-picker.element.d.ts +4 -0
  78. package/dist/wje-icon-picker.js +15 -0
  79. package/dist/wje-icon-picker.js.map +1 -1
  80. package/dist/wje-icon.js +1 -1
  81. package/dist/{packages/wje-img → wje-img}/img.element.d.ts +1 -0
  82. package/dist/wje-img-comparer.js +5 -1
  83. package/dist/wje-img-comparer.js.map +1 -1
  84. package/dist/wje-img.js +16 -1
  85. package/dist/wje-img.js.map +1 -1
  86. package/dist/{packages/wje-infinite-scroll → wje-infinite-scroll}/infinite-scroll.element.d.ts +4 -0
  87. package/dist/wje-infinite-scroll.js +10 -0
  88. package/dist/wje-infinite-scroll.js.map +1 -1
  89. package/dist/{packages/wje-input → wje-input}/input.element.d.ts +9 -1
  90. package/dist/wje-input-file.js +2 -0
  91. package/dist/wje-input-file.js.map +1 -1
  92. package/dist/wje-input.js +59 -4
  93. package/dist/wje-input.js.map +1 -1
  94. package/dist/{packages/wje-item → wje-item}/item.element.d.ts +8 -0
  95. package/dist/wje-item.js +14 -0
  96. package/dist/wje-item.js.map +1 -1
  97. package/dist/{packages/wje-kanban → wje-kanban}/kanban.element.d.ts +4 -0
  98. package/dist/wje-kanban.js +14 -0
  99. package/dist/wje-kanban.js.map +1 -1
  100. package/dist/{packages/wje-level-indicator → wje-level-indicator}/level-indicator.element.d.ts +17 -0
  101. package/dist/wje-level-indicator.js +36 -0
  102. package/dist/wje-level-indicator.js.map +1 -1
  103. package/dist/{packages/wje-list → wje-list}/list.element.d.ts +4 -0
  104. package/dist/wje-list.js +10 -0
  105. package/dist/wje-list.js.map +1 -1
  106. package/dist/wje-master.js +11 -2
  107. package/dist/wje-master.js.map +1 -1
  108. package/dist/wje-menu-button.js +1 -0
  109. package/dist/wje-menu-button.js.map +1 -1
  110. package/dist/{packages/wje-menu-item → wje-menu-item}/menu-item.element.d.ts +4 -0
  111. package/dist/wje-menu-item.js +24 -0
  112. package/dist/wje-menu-item.js.map +1 -1
  113. package/dist/wje-menu.js +4 -1
  114. package/dist/wje-menu.js.map +1 -1
  115. package/dist/{packages/wje-option → wje-option}/option.element.d.ts +4 -0
  116. package/dist/wje-option.js +14 -1
  117. package/dist/wje-option.js.map +1 -1
  118. package/dist/{packages/wje-options → wje-options}/options.element.d.ts +4 -0
  119. package/dist/wje-options.js +13 -0
  120. package/dist/wje-options.js.map +1 -1
  121. package/dist/{packages/wje-orgchart → wje-orgchart}/orgchart.element.d.ts +4 -0
  122. package/dist/wje-orgchart.js +9 -0
  123. package/dist/wje-orgchart.js.map +1 -1
  124. package/dist/wje-pagination.js +18 -9
  125. package/dist/wje-pagination.js.map +1 -1
  126. package/dist/wje-popup.js +1 -1
  127. package/dist/{packages/wje-progress-bar → wje-progress-bar}/progress-bar.element.d.ts +11 -0
  128. package/dist/wje-progress-bar.js +26 -0
  129. package/dist/wje-progress-bar.js.map +1 -1
  130. package/dist/wje-qr-code/qr-code.element.d.ts +96 -0
  131. package/dist/wje-qr-code.js +159 -17
  132. package/dist/wje-qr-code.js.map +1 -1
  133. package/dist/{packages/wje-radio → wje-radio}/radio.element.d.ts +5 -0
  134. package/dist/{packages/wje-radio-group → wje-radio-group}/radio-group.element.d.ts +16 -1
  135. package/dist/wje-radio-group.js +49 -2
  136. package/dist/wje-radio-group.js.map +1 -1
  137. package/dist/wje-radio.js +27 -1
  138. package/dist/wje-radio.js.map +1 -1
  139. package/dist/{packages/wje-rate → wje-rate}/rate.element.d.ts +4 -0
  140. package/dist/wje-rate.js +23 -1
  141. package/dist/wje-rate.js.map +1 -1
  142. package/dist/{packages/wje-relative-time → wje-relative-time}/relative-time.element.d.ts +2 -0
  143. package/dist/wje-relative-time.js +14 -1
  144. package/dist/wje-relative-time.js.map +1 -1
  145. package/dist/{packages/wje-reorder → wje-reorder}/reorder.element.d.ts +4 -0
  146. package/dist/{packages/wje-reorder-handle → wje-reorder-handle}/reorder-handle.element.d.ts +4 -0
  147. package/dist/wje-reorder-handle.js +21 -0
  148. package/dist/wje-reorder-handle.js.map +1 -1
  149. package/dist/wje-reorder.js +10 -0
  150. package/dist/wje-reorder.js.map +1 -1
  151. package/dist/{packages/wje-select → wje-select}/select.element.d.ts +7 -0
  152. package/dist/wje-select.js +35 -5
  153. package/dist/wje-select.js.map +1 -1
  154. package/dist/{packages/wje-slider → wje-slider}/slider.element.d.ts +5 -0
  155. package/dist/wje-slider.js +51 -1
  156. package/dist/wje-slider.js.map +1 -1
  157. package/dist/{packages/wje-sliding-container → wje-sliding-container}/sliding-container.element.d.ts +4 -0
  158. package/dist/wje-sliding-container.js +18 -0
  159. package/dist/wje-sliding-container.js.map +1 -1
  160. package/dist/{packages/wje-split-view → wje-split-view}/split-view.element.d.ts +1 -0
  161. package/dist/wje-split-view.js +9 -0
  162. package/dist/wje-split-view.js.map +1 -1
  163. package/dist/wje-status.js +1 -0
  164. package/dist/wje-status.js.map +1 -1
  165. package/dist/{packages/wje-stepper → wje-stepper}/stepper.element.d.ts +1 -0
  166. package/dist/wje-stepper.js +24 -1
  167. package/dist/wje-stepper.js.map +1 -1
  168. package/dist/{packages/wje-tab → wje-tab}/tab.element.d.ts +10 -0
  169. package/dist/{packages/wje-tab-group → wje-tab-group}/tab-group.element.d.ts +11 -0
  170. package/dist/wje-tab-group.js +59 -2
  171. package/dist/wje-tab-group.js.map +1 -1
  172. package/dist/wje-tab.js +30 -0
  173. package/dist/wje-tab.js.map +1 -1
  174. package/dist/{packages/wje-textarea → wje-textarea}/textarea.element.d.ts +20 -1
  175. package/dist/wje-textarea.js +96 -14
  176. package/dist/wje-textarea.js.map +1 -1
  177. package/dist/{packages/wje-thumbnail → wje-thumbnail}/thumbnail.element.d.ts +4 -0
  178. package/dist/wje-thumbnail.js +19 -0
  179. package/dist/wje-thumbnail.js.map +1 -1
  180. package/dist/{packages/wje-timeline → wje-timeline}/timeline.element.d.ts +4 -0
  181. package/dist/wje-toast.js +4 -0
  182. package/dist/wje-toast.js.map +1 -1
  183. package/dist/{packages/wje-toggle → wje-toggle}/toggle.element.d.ts +4 -0
  184. package/dist/wje-toggle.js +17 -1
  185. package/dist/wje-toggle.js.map +1 -1
  186. package/dist/{packages/wje-toolbar → wje-toolbar}/toolbar.element.d.ts +4 -0
  187. package/dist/wje-toolbar.js +14 -0
  188. package/dist/wje-toolbar.js.map +1 -1
  189. package/dist/{packages/wje-tooltip → wje-tooltip}/tooltip.element.d.ts +3 -0
  190. package/dist/wje-tooltip.js +31 -7
  191. package/dist/wje-tooltip.js.map +1 -1
  192. package/dist/{packages/wje-tree → wje-tree}/tree.element.d.ts +4 -0
  193. package/dist/{packages/wje-tree-item → wje-tree-item}/tree-item.element.d.ts +5 -0
  194. package/dist/wje-tree-item.js +41 -5
  195. package/dist/wje-tree-item.js.map +1 -1
  196. package/dist/wje-tree.js +12 -1
  197. package/dist/wje-tree.js.map +1 -1
  198. package/package.json +21 -2
  199. package/dist/form-associated-element-o0UjvdUp.js.map +0 -1
  200. package/dist/packages/utils/utils.d.ts +0 -1
  201. package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
  202. package/dist/packages/wje-animation/animation.test.d.ts +0 -1
  203. package/dist/packages/wje-avatar/avatar.test.d.ts +0 -1
  204. package/dist/packages/wje-badge/badge.test.d.ts +0 -1
  205. package/dist/packages/wje-breadcrumbs/breadcrumbs.test.d.ts +0 -1
  206. package/dist/packages/wje-button/button.test.d.ts +0 -1
  207. package/dist/packages/wje-chip/chip.test.d.ts +0 -1
  208. package/dist/packages/wje-color-picker/color-picker.test.d.ts +0 -1
  209. package/dist/packages/wje-file-upload/file-upload.test.d.ts +0 -1
  210. package/dist/packages/wje-format-digital/format-digital.test.d.ts +0 -1
  211. package/dist/packages/wje-pagination/pagination.test.d.ts +0 -1
  212. package/dist/packages/wje-qr-code/qr-code.element.d.ts +0 -33
  213. package/dist/packages/wje-relative-time/relative-time.test.d.ts +0 -1
  214. package/dist/packages/wje-select/select.test.d.ts +0 -1
  215. package/dist/packages/wje-tab-group/tab-group.test.d.ts +0 -1
  216. package/dist/packages/wje-toast/toast.test.d.ts +0 -1
  217. package/dist/packages/wje-toggle/toggle.test.d.ts +0 -1
  218. package/dist/packages/wje-tree/tree.test.d.ts +0 -1
  219. package/dist/packages/wje-tree-item/tree-item.test.d.ts +0 -1
  220. /package/dist/{packages/index.d.ts → index.d.ts} +0 -0
  221. /package/dist/{packages/localize → localize}/localize.d.ts +0 -0
  222. /package/dist/{packages/translations → translations}/en-gb.d.ts +0 -0
  223. /package/dist/{packages/translations → translations}/sk-sk.d.ts +0 -0
  224. /package/dist/{packages/utils → utils}/animations.d.ts +0 -0
  225. /package/dist/{packages/utils → utils}/base-path.d.ts +0 -0
  226. /package/dist/{packages/utils → utils}/date.d.ts +0 -0
  227. /package/dist/{packages/utils → utils}/element-utils.d.ts +0 -0
  228. /package/dist/{packages/utils → utils}/event.d.ts +0 -0
  229. /package/dist/{packages/utils → utils}/icon-library.d.ts +0 -0
  230. /package/dist/{packages/utils → utils}/localize.d.ts +0 -0
  231. /package/dist/{packages/utils → utils}/permissions.d.ts +0 -0
  232. /package/dist/{packages/utils → utils}/universal-service.d.ts +0 -0
  233. /package/dist/{packages/wje-accordion → wje-accordion}/accordion.d.ts +0 -0
  234. /package/dist/{packages/wje-accordion → wje-accordion}/accordion.element.d.ts +0 -0
  235. /package/dist/{packages/wje-accordion-item → wje-accordion-item}/accordion-item.d.ts +0 -0
  236. /package/dist/{packages/wje-animation → wje-animation}/animation.d.ts +0 -0
  237. /package/dist/{packages/wje-animation → wje-animation}/animation.element.d.ts +0 -0
  238. /package/dist/{packages/wje-aside → wje-aside}/aside.d.ts +0 -0
  239. /package/dist/{packages/wje-aside → wje-aside}/aside.element.d.ts +0 -0
  240. /package/dist/{packages/wje-avatar → wje-avatar}/avatar.d.ts +0 -0
  241. /package/dist/{packages/wje-avatar → wje-avatar}/service/service.d.ts +0 -0
  242. /package/dist/{packages/wje-badge → wje-badge}/badge.d.ts +0 -0
  243. /package/dist/{packages/wje-badge → wje-badge}/badge.element.d.ts +0 -0
  244. /package/dist/{packages/wje-breadcrumb → wje-breadcrumb}/breadcrumb.d.ts +0 -0
  245. /package/dist/{packages/wje-breadcrumbs → wje-breadcrumbs}/breadcrumbs.d.ts +0 -0
  246. /package/dist/{packages/wje-breadcrumbs → wje-breadcrumbs}/breadcrumbs.element.d.ts +0 -0
  247. /package/dist/{packages/wje-button → wje-button}/button.d.ts +0 -0
  248. /package/dist/{packages/wje-button-group → wje-button-group}/button-group.d.ts +0 -0
  249. /package/dist/{packages/wje-card → wje-card}/card.d.ts +0 -0
  250. /package/dist/{packages/wje-card-content → wje-card-content}/card-content.d.ts +0 -0
  251. /package/dist/{packages/wje-card-content → wje-card-content}/card-content.element.d.ts +0 -0
  252. /package/dist/{packages/wje-card-controls → wje-card-controls}/card-controls.d.ts +0 -0
  253. /package/dist/{packages/wje-card-controls → wje-card-controls}/card-controls.element.d.ts +0 -0
  254. /package/dist/{packages/wje-card-header → wje-card-header}/card-header.d.ts +0 -0
  255. /package/dist/{packages/wje-card-header → wje-card-header}/card-header.element.d.ts +0 -0
  256. /package/dist/{packages/wje-card-subtitle → wje-card-subtitle}/card-subtitle.d.ts +0 -0
  257. /package/dist/{packages/wje-card-subtitle → wje-card-subtitle}/card-subtitle.element.d.ts +0 -0
  258. /package/dist/{packages/wje-card-title → wje-card-title}/card-title.d.ts +0 -0
  259. /package/dist/{packages/wje-card-title → wje-card-title}/card-title.element.d.ts +0 -0
  260. /package/dist/{packages/wje-carousel → wje-carousel}/carousel.d.ts +0 -0
  261. /package/dist/{packages/wje-carousel-item → wje-carousel-item}/carousel-item.d.ts +0 -0
  262. /package/dist/{packages/wje-carousel-item → wje-carousel-item}/carousel-item.element.d.ts +0 -0
  263. /package/dist/{packages/wje-checkbox → wje-checkbox}/checkbox.d.ts +0 -0
  264. /package/dist/{packages/wje-chip → wje-chip}/chip.d.ts +0 -0
  265. /package/dist/{packages/wje-col → wje-col}/col.d.ts +0 -0
  266. /package/dist/{packages/wje-col → wje-col}/col.element.d.ts +0 -0
  267. /package/dist/{packages/wje-color-picker → wje-color-picker}/color-picker.d.ts +0 -0
  268. /package/dist/{packages/wje-container → wje-container}/container.d.ts +0 -0
  269. /package/dist/{packages/wje-container → wje-container}/container.element.d.ts +0 -0
  270. /package/dist/{packages/wje-copy-button → wje-copy-button}/copy-button.d.ts +0 -0
  271. /package/dist/{packages/wje-copy-button → wje-copy-button}/service/service.d.ts +0 -0
  272. /package/dist/{packages/wje-dialog → wje-dialog}/dialog.d.ts +0 -0
  273. /package/dist/{packages/wje-divider → wje-divider}/divider.d.ts +0 -0
  274. /package/dist/{packages/wje-divider → wje-divider}/divider.element.d.ts +0 -0
  275. /package/dist/{packages/wje-dropdown → wje-dropdown}/dropdown.d.ts +0 -0
  276. /package/dist/{packages/wje-file-upload → wje-file-upload}/file-upload.d.ts +0 -0
  277. /package/dist/{packages/wje-file-upload-item → wje-file-upload-item}/file-upload-item.d.ts +0 -0
  278. /package/dist/{packages/wje-footer → wje-footer}/footer.d.ts +0 -0
  279. /package/dist/{packages/wje-footer → wje-footer}/footer.element.d.ts +0 -0
  280. /package/dist/{packages/wje-form → wje-form}/form.d.ts +0 -0
  281. /package/dist/{packages/wje-form → wje-form}/form.element.d.ts +0 -0
  282. /package/dist/{packages/wje-format-digital → wje-format-digital}/format-digital.d.ts +0 -0
  283. /package/dist/{packages/wje-grid → wje-grid}/grid.d.ts +0 -0
  284. /package/dist/{packages/wje-grid → wje-grid}/grid.element.d.ts +0 -0
  285. /package/dist/{packages/wje-header → wje-header}/header.d.ts +0 -0
  286. /package/dist/{packages/wje-header → wje-header}/header.element.d.ts +0 -0
  287. /package/dist/{packages/wje-icon → wje-icon}/icon.d.ts +0 -0
  288. /package/dist/{packages/wje-icon → wje-icon}/service/library.d.ts +0 -0
  289. /package/dist/{packages/wje-icon → wje-icon}/service/service.d.ts +0 -0
  290. /package/dist/{packages/wje-icon-picker → wje-icon-picker}/icon-picker.d.ts +0 -0
  291. /package/dist/{packages/wje-img → wje-img}/img.d.ts +0 -0
  292. /package/dist/{packages/wje-img-comparer → wje-img-comparer}/img-comparer.d.ts +0 -0
  293. /package/dist/{packages/wje-img-comparer → wje-img-comparer}/img-comparer.element.d.ts +0 -0
  294. /package/dist/{packages/wje-img-comparer → wje-img-comparer}/service/service.d.ts +0 -0
  295. /package/dist/{packages/wje-infinite-scroll → wje-infinite-scroll}/infinite-scroll.d.ts +0 -0
  296. /package/dist/{packages/wje-input → wje-input}/input.d.ts +0 -0
  297. /package/dist/{packages/wje-input-file → wje-input-file}/input-file.d.ts +0 -0
  298. /package/dist/{packages/wje-input-file → wje-input-file}/input-file.element.d.ts +0 -0
  299. /package/dist/{packages/wje-item → wje-item}/item.d.ts +0 -0
  300. /package/dist/{packages/wje-kanban → wje-kanban}/kanban.d.ts +0 -0
  301. /package/dist/{packages/wje-label → wje-label}/label.d.ts +0 -0
  302. /package/dist/{packages/wje-label → wje-label}/label.element.d.ts +0 -0
  303. /package/dist/{packages/wje-level-indicator → wje-level-indicator}/level-indicator.d.ts +0 -0
  304. /package/dist/{packages/wje-list → wje-list}/list.d.ts +0 -0
  305. /package/dist/{packages/wje-main → wje-main}/main.d.ts +0 -0
  306. /package/dist/{packages/wje-main → wje-main}/main.element.d.ts +0 -0
  307. /package/dist/{packages/wje-masonry → wje-masonry}/masonry.d.ts +0 -0
  308. /package/dist/{packages/wje-masonry → wje-masonry}/masonry.element.d.ts +0 -0
  309. /package/dist/{packages/wje-masonry → wje-masonry}/service/service.d.ts +0 -0
  310. /package/dist/{packages/wje-menu → wje-menu}/menu.d.ts +0 -0
  311. /package/dist/{packages/wje-menu → wje-menu}/menu.element.d.ts +0 -0
  312. /package/dist/{packages/wje-menu-button → wje-menu-button}/menu-button.d.ts +0 -0
  313. /package/dist/{packages/wje-menu-button → wje-menu-button}/menu-button.element.d.ts +0 -0
  314. /package/dist/{packages/wje-menu-item → wje-menu-item}/menu-item.d.ts +0 -0
  315. /package/dist/{packages/wje-menu-label → wje-menu-label}/menu-label.d.ts +0 -0
  316. /package/dist/{packages/wje-menu-label → wje-menu-label}/menu-label.element.d.ts +0 -0
  317. /package/dist/{packages/wje-option → wje-option}/option.d.ts +0 -0
  318. /package/dist/{packages/wje-options → wje-options}/options.d.ts +0 -0
  319. /package/dist/{packages/wje-orgchart → wje-orgchart}/orgchart.d.ts +0 -0
  320. /package/dist/{packages/wje-orgchart-group → wje-orgchart-group}/orgchart-group.d.ts +0 -0
  321. /package/dist/{packages/wje-orgchart-group → wje-orgchart-group}/orgchart-group.element.d.ts +0 -0
  322. /package/dist/{packages/wje-orgchart-item → wje-orgchart-item}/orgchart-item.d.ts +0 -0
  323. /package/dist/{packages/wje-orgchart-item → wje-orgchart-item}/orgchart-item.element.d.ts +0 -0
  324. /package/dist/{packages/wje-pagination → wje-pagination}/pagination.d.ts +0 -0
  325. /package/dist/{packages/wje-pagination → wje-pagination}/pagination.element.d.ts +0 -0
  326. /package/dist/{packages/wje-pagination → wje-pagination}/service/service.d.ts +0 -0
  327. /package/dist/{packages/wje-panel → wje-panel}/panel.d.ts +0 -0
  328. /package/dist/{packages/wje-panel → wje-panel}/panel.element.d.ts +0 -0
  329. /package/dist/{packages/wje-popup → wje-popup}/popup.d.ts +0 -0
  330. /package/dist/{packages/wje-popup → wje-popup}/popup.element.d.ts +0 -0
  331. /package/dist/{packages/wje-progress-bar → wje-progress-bar}/progress-bar.d.ts +0 -0
  332. /package/dist/{packages/wje-qr-code → wje-qr-code}/qr-code.d.ts +0 -0
  333. /package/dist/{packages/wje-radio → wje-radio}/radio.d.ts +0 -0
  334. /package/dist/{packages/wje-radio-group → wje-radio-group}/radio-group.d.ts +0 -0
  335. /package/dist/{packages/wje-rate → wje-rate}/rate.d.ts +0 -0
  336. /package/dist/{packages/wje-relative-time → wje-relative-time}/relative-time.d.ts +0 -0
  337. /package/dist/{packages/wje-reorder → wje-reorder}/reorder.d.ts +0 -0
  338. /package/dist/{packages/wje-reorder-dropzone → wje-reorder-dropzone}/reorder-dropzone.d.ts +0 -0
  339. /package/dist/{packages/wje-reorder-dropzone → wje-reorder-dropzone}/reorder-dropzone.element.d.ts +0 -0
  340. /package/dist/{packages/wje-reorder-handle → wje-reorder-handle}/reorder-handle.d.ts +0 -0
  341. /package/dist/{packages/wje-reorder-item → wje-reorder-item}/reorder-item.d.ts +0 -0
  342. /package/dist/{packages/wje-reorder-item → wje-reorder-item}/reorder-item.element.d.ts +0 -0
  343. /package/dist/{packages/wje-route → wje-route}/route.d.ts +0 -0
  344. /package/dist/{packages/wje-route → wje-route}/route.element.d.ts +0 -0
  345. /package/dist/{packages/wje-router → wje-router}/router.d.ts +0 -0
  346. /package/dist/{packages/wje-router → wje-router}/router.element.d.ts +0 -0
  347. /package/dist/{packages/wje-router-link → wje-router-link}/router-link.d.ts +0 -0
  348. /package/dist/{packages/wje-router-link → wje-router-link}/router-link.element.d.ts +0 -0
  349. /package/dist/{packages/wje-router-outlet → wje-router-outlet}/router-outlet.d.ts +0 -0
  350. /package/dist/{packages/wje-router-outlet → wje-router-outlet}/router-outlet.element.d.ts +0 -0
  351. /package/dist/{packages/wje-row → wje-row}/row.d.ts +0 -0
  352. /package/dist/{packages/wje-row → wje-row}/row.element.d.ts +0 -0
  353. /package/dist/{packages/wje-select → wje-select}/select.d.ts +0 -0
  354. /package/dist/{packages/wje-slider → wje-slider}/slider.d.ts +0 -0
  355. /package/dist/{packages/wje-sliding-container → wje-sliding-container}/sliding-container.d.ts +0 -0
  356. /package/dist/{packages/wje-split-view → wje-split-view}/service/service.d.ts +0 -0
  357. /package/dist/{packages/wje-split-view → wje-split-view}/split-view.d.ts +0 -0
  358. /package/dist/{packages/wje-status → wje-status}/status.d.ts +0 -0
  359. /package/dist/{packages/wje-status → wje-status}/status.element.d.ts +0 -0
  360. /package/dist/{packages/wje-step → wje-step}/step.d.ts +0 -0
  361. /package/dist/{packages/wje-step → wje-step}/step.element.d.ts +0 -0
  362. /package/dist/{packages/wje-stepper → wje-stepper}/stepper.d.ts +0 -0
  363. /package/dist/{packages/wje-store → wje-store}/default-store-actions.d.ts +0 -0
  364. /package/dist/{packages/wje-store → wje-store}/pubsub.d.ts +0 -0
  365. /package/dist/{packages/wje-store → wje-store}/store.d.ts +0 -0
  366. /package/dist/{packages/wje-tab → wje-tab}/tab.d.ts +0 -0
  367. /package/dist/{packages/wje-tab-group → wje-tab-group}/tab-group.d.ts +0 -0
  368. /package/dist/{packages/wje-tab-panel → wje-tab-panel}/tab-panel.d.ts +0 -0
  369. /package/dist/{packages/wje-tab-panel → wje-tab-panel}/tab-panel.element.d.ts +0 -0
  370. /package/dist/{packages/wje-textarea → wje-textarea}/textarea.d.ts +0 -0
  371. /package/dist/{packages/wje-thumbnail → wje-thumbnail}/thumbnail.d.ts +0 -0
  372. /package/dist/{packages/wje-timeline → wje-timeline}/timeline.d.ts +0 -0
  373. /package/dist/{packages/wje-timeline-item → wje-timeline-item}/timeline-item.d.ts +0 -0
  374. /package/dist/{packages/wje-timeline-item → wje-timeline-item}/timeline-item.element.d.ts +0 -0
  375. /package/dist/{packages/wje-toast → wje-toast}/toast.d.ts +0 -0
  376. /package/dist/{packages/wje-toast → wje-toast}/toast.element.d.ts +0 -0
  377. /package/dist/{packages/wje-toggle → wje-toggle}/toggle.d.ts +0 -0
  378. /package/dist/{packages/wje-toolbar → wje-toolbar}/toolbar.d.ts +0 -0
  379. /package/dist/{packages/wje-toolbar-action → wje-toolbar-action}/toolbar-action.d.ts +0 -0
  380. /package/dist/{packages/wje-toolbar-action → wje-toolbar-action}/toolbar-action.element.d.ts +0 -0
  381. /package/dist/{packages/wje-tooltip → wje-tooltip}/tooltip.d.ts +0 -0
  382. /package/dist/{packages/wje-tree → wje-tree}/tree.d.ts +0 -0
  383. /package/dist/{packages/wje-tree-item → wje-tree-item}/tree-item.d.ts +0 -0
  384. /package/dist/{packages/wje-visually-hidden → wje-visually-hidden}/visually-hidden.d.ts +0 -0
  385. /package/dist/{packages/wje-visually-hidden → wje-visually-hidden}/visually-hidden.element.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"wje-sliding-container.js","sources":["../packages/wje-sliding-container/sliding-container.element.js","../packages/wje-sliding-container/sliding-container.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary SlidingContainer is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/SlidingContainer\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @slot - The default slot for the SlidingContainer.\n * @property {string} maxWidth - The maximum width of the SlidingContainer.\n * @property {string} maxHeight - The maximum height of the SlidingContainer.\n * @property {string} trigger - The trigger for the SlidingContainer.\n * @property {string} direction - Specifies the sliding direction of the container (e.g., 'left' or 'right').\n * @property {string} variant - Determines how the SlidingContainer behaves, such as 'over' or 'in-place'.\n * @property {string} screenBreakPoint - The width (in pixels) at which the SlidingContainer switches to the \"over\" variant for smaller screens.\n * @property {boolean} removeChildAfterClose - Removes the child after the SlidingContainer is closed.\n * @property {string} animationDuration - Specifies the duration (in milliseconds) of the sliding animation.\n * @property {string} animationEasing - Specifies the easing function used for the sliding animation (e.g., 'linear', 'ease-in', 'ease-out').\n * @property {boolean} hasOpacity - Sets the opacity of the SlidingContainer.\n * @tag wje-sliding-container\n * @example\n * <wje-sliding-container trigger=\"test-resize-container-event-right\" id=\"left-in-place\" direction=\"left\" max-width=\"100px\" max-height=\"100%\">\n * <wje-card>\n * <wje-card-header>\n * <wje-card-subtitle>CONTENT Subtitle</wje-card-subtitle>\n * <wje-card-title>CONTENT Title</wje-card-title>\n * </wje-card-header>\n * <wje-card-content>\n * CONTENT Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n * </wje-card-content>\n * </wje-card>\n * </wje-sliding-container>\n */\nexport default class SlidingContainer extends WJElement {\n /**\n * Creates an instance of SlidingContainer.\n * @class\n */\n constructor() {\n super();\n\n this._isOpen = false;\n this._lastCaller = null;\n\n this._resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n if (entry.contentBoxSize) {\n if (this.drawingStatus < 3) return;\n\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n if (this.variant !== 'over') {\n this.variant = 'over';\n } else {\n this.checkForVariant(this.variant);\n }\n } else {\n if (this.variant !== 'in-place') {\n this.variant = 'in-place';\n } else {\n this.checkForVariant(this.variant);\n }\n }\n }\n }\n });\n\n this._resizeObserver.observe(document.documentElement);\n }\n\n /**\n * Sets the maximum width of an element by updating the 'max-width' attribute.\n * @param {string} value The maximum width value to be set (e.g., '100px', '50%', etc.).\n */\n set maxWidth(value) {\n this.setAttribute('max-width', value);\n }\n\n /**\n * Gets the maximum width value of the element.\n * Retrieves the value of the 'max-width' attribute. If the attribute is not set, it defaults to 'auto'.\n * @returns {string} The maximum width value of the element or 'auto' if the attribute is not defined.\n */\n get maxWidth() {\n return this.getAttribute('max-width') ?? 'auto';\n }\n\n /**\n * Sets the maximum height for the element.\n * @param {string} value The maximum height value to be applied to the element. This can include units such as \"px\", \"em\", \"%\", etc.\n */\n set maxHeight(value) {\n this.setAttribute('max-height', value);\n }\n\n /**\n * Retrieves the maximum height value of the element, or returns 'auto' if not set.\n * @returns {string} The maximum height value or 'auto' if the attribute is not specified.\n */\n get maxHeight() {\n return this.getAttribute('max-height') ?? 'auto';\n }\n\n /**\n * Sets the 'trigger' attribute for the element.\n * @param {string} value The value to set for the 'trigger' attribute.\n */\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n /**\n * Retrieves the value of the 'trigger' attribute. If the attribute is not set, it defaults to 'sliding-container'.\n * @returns {string} The value of the 'trigger' attribute or the default value 'sliding-container' if not defined.\n */\n get trigger() {\n return this.getAttribute('trigger') ?? 'sliding-container';\n }\n\n /**\n * Sets the direction attribute for the element.\n * @param {string} value The direction value to be assigned. Possible values are typically 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto'.\n */\n set direction(value) {\n this.setAttribute('direction', value);\n }\n\n /**\n * Retrieves the direction attribute of the instance.\n * If the direction attribute is not set, it defaults to 'right'.\n * @returns {string} The value of the direction attribute or 'right' if not set.\n */\n get direction() {\n return this.getAttribute('direction') ?? 'right';\n }\n\n /**\n * Sets the value of the `remove-child-after-close` attribute.\n * This attribute determines if a child element should be removed after a close operation.\n * @param {boolean|string} value The value to set for the `remove-child-after-close` attribute. The value can be a boolean or a string representation of a boolean.\n */\n set removeChildAfterClose(value) {\n this.setAttribute('remove-child-after-close', value);\n }\n\n /**\n * Gets the value indicating whether the child element should be removed after closing.\n *\n * This property checks the presence of the 'remove-child-after-close' attribute on the element.\n * Returns `false` if the attribute does not exist.\n * @returns {boolean} True if the 'remove-child-after-close' attribute is present, otherwise false.\n */\n get removeChildAfterClose() {\n return this.hasAttribute('remove-child-after-close') ?? false;\n }\n\n /**\n * Sets the 'variant' attribute to the specified value.\n * @param {string} value The value to set for the 'variant' attribute.\n */\n set variant(value) {\n this.setAttribute('variant', value);\n }\n\n /**\n * Retrieves the value of the \"variant\" attribute. If the attribute is not set,\n * it returns the default value 'in-place'.\n * @returns {string} The variant value or the default value 'in-place'.\n */\n get variant() {\n return this.getAttribute('variant') ?? 'in-place';\n }\n\n /**\n * Retrieves the value of the 'screen-break-point' attribute.\n * @returns {string} The value of the 'screen-break-point' attribute.\n */\n get screenBreakPoint() {\n return this.getAttribute('screen-break-point');\n }\n\n /**\n * Sets the screen break point value to determine responsive behavior.\n * @param {string} value The value to set as the screen break point.\n */\n set screenBreakPoint(value) {\n this.setAttribute('screen-break-point', value);\n }\n\n /**\n * Sets the duration of the animation by updating the `animation-duration` attribute.\n * @param {string} value The duration value for the animation, specified in a format\n * such as seconds (e.g., \"2s\") or milliseconds (e.g., \"200ms\").\n */\n set animationDuration(value) {\n this.setAttribute('animation-duration', value);\n }\n\n /**\n * Gets the animation duration for an element.\n * It retrieves the value of the 'animation-duration' attribute if present; otherwise, it defaults to '500'.\n * @returns {string} The value of the animation duration, either from the attribute or the default '500'.\n */\n get animationDuration() {\n return this.getAttribute('animation-duration') ?? '500';\n }\n\n /**\n * Sets the easing function for the animation.\n * @param {string} value The easing function to use for the animation. This can be any valid CSS timing function such as \"ease\", \"linear\", \"ease-in\", \"ease-out\", etc.\n */\n set animationEasing(value) {\n this.setAttribute('animation-easing', value);\n }\n\n /**\n * Retrieves the easing function for the animation.\n * @returns {string} The value of the 'animation-easing' attribute if set, otherwise defaults to 'linear'.\n */\n get animationEasing() {\n return this.getAttribute('animation-easing') ?? 'linear';\n }\n\n /**\n * Determines if the element has an 'has-opacity' attribute.\n * @returns {boolean} True if the element has the 'has-opacity' attribute, otherwise false.\n */\n get hasOpacity() {\n return this.hasAttribute('has-opacity') ?? false;\n }\n\n /**\n * Sets the value of the 'add-to-height' attribute.\n * This attribute is used to modify or adjust the height dynamically.\n * @param {string} value The value to be assigned to the 'add-to-height' attribute.\n */\n set addToHeight(value) {\n this.setAttribute('add-to-height', value);\n }\n\n /**\n * Retrieves the value of the 'add-to-height' attribute from the element.\n * If the attribute is not set, it defaults to '0'.\n * @returns {string} The value of the 'add-to-height' attribute or '0' if the attribute is not present.\n */\n get addToHeight() {\n return this.getAttribute('add-to-height') ?? '0';\n }\n\n /**\n * Determines whether the current state is open.\n * @returns {boolean} True if the state is open, otherwise false.\n */\n get isOpen() {\n return this._isOpen;\n }\n\n className = 'SlidingContainer';\n\n /**\n * Returns the observed attributes for the component.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['max-width', 'max-height', 'trigger', 'direction', 'variant', 'screen-break-point', 'remove-child-after-close', 'animation-duration', 'animation-easing', 'has-opacity'];\n }\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n\n document.removeEventListener(this.trigger, this.triggerEvent);\n }\n\n /**\n * Draws the component.\n * @param {object} context The context for drawing.\n * @param {object} store The store for drawing.\n * @param {object} params The parameters for drawing.\n * @returns {DocumentFragment}\n */\n draw(context, store, params) {\n let fragment = document.createDocumentFragment();\n\n let wrapperDiv = document.createElement('div');\n wrapperDiv.classList.add('sliding-container-wrapper');\n\n let transparentDiv = document.createElement('div');\n transparentDiv.classList.add('sliding-container-transparent');\n\n if (this._isOpen) {\n transparentDiv.style.width = this.maxWidth;\n }\n\n let native = document.createElement('div');\n native.setAttribute('part', 'sliding-container');\n native.classList.add('native-sliding-container');\n native.style.width = 0;\n if (this.hasOpacity) {\n native.style.opacity = 0;\n }\n\n if (this._isOpen) {\n native.style.width = this.maxWidth;\n if (this.hasOpacity) {\n native.style.opacity = 1;\n }\n }\n\n if (this.direction === 'right') {\n native.style.right = 0;\n } else {\n native.style.left = 0;\n }\n\n let slot = document.createElement('slot');\n\n const nativeInner = document.createElement('div');\n nativeInner.classList.add('native-sliding-container-inner');\n nativeInner.style.width = this.maxWidth;\n\n // APPEND\n nativeInner.append(slot);\n nativeInner.append(this.htmlCloseButton());\n\n native.append(nativeInner);\n\n wrapperDiv.append(transparentDiv);\n wrapperDiv.append(native);\n\n fragment.append(wrapperDiv);\n\n this.transparentDiv = transparentDiv;\n this.wrapperDiv = wrapperDiv\n this.nativeElement = native;\n\n return fragment;\n }\n\n /**\n * Performs actions after the element is drawn on the screen.\n * Attaches an event listener to the document based on the specified trigger.\n * Sets the variant to \"over\" if the document width is smaller than the screen break point.\n * Calls the checkForVariant method with the current variant.\n */\n afterDraw() {\n document.addEventListener(this.trigger, this.triggerEvent);\n\n // if document width is on small screen set variant to over\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n this.variant = 'over';\n }\n\n this.checkForVariant(this.variant);\n }\n\n /**\n * Creates and returns a styled close button element with an icon,\n * including an event listener to trigger the close method.\n * @returns {HTMLElement} The close button element configured with styles, an icon, and event listener.\n */\n htmlCloseButton() {\n let closeButton = document.createElement('wje-button');\n closeButton.setAttribute('part', 'close-button');\n closeButton.classList.add('close-button');\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('slot', 'icon-only');\n icon.setAttribute('name', 'x');\n\n closeButton.append(icon);\n\n event.addListener(closeButton, 'wje-button:click', null,(e) => {\n this.close();\n });\n\n return closeButton;\n }\n\n /**\n * Retrieves the parent element of the current element.\n * If the parent element is not found, it attempts to find the root host element.\n * @returns {Element|null} The parent element or the root host element if no parent exists. Returns null if neither is found.\n */\n getParentElement() {\n let parentElement = this.parentElement;\n\n if (!parentElement) {\n parentElement = this.getRootNode().host;\n }\n\n return parentElement;\n }\n\n /**\n * Adjusts the position and dimensions of the current element based on the specified variant.\n *\n * The method handles modifications to the element's positioning style, aligns it relative to its parent,\n * and manages alignment to its siblings based on the specified direction.\n * @param {string} variant The variant to determine how the element should be updated. For example, when set to 'over', specific adjustments to the position and size are performed.\n * @returns {void} No value is returned, the method modifies the element's style properties directly.\n */\n checkForVariant(variant) {\n if (variant === 'over') {\n this.style.position = 'fixed';\n let computentStyleOfParent = window.getComputedStyle(this.getParentElement());\n let parentElementBoundingbox = this.getParentElement().getBoundingClientRect();\n let heightOfParrentElement = parseFloat(computentStyleOfParent.height);\n\n let topOfParrentElement = parseFloat(computentStyleOfParent.top);\n\n this.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.wrapperDiv.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.style.top = topOfParrentElement + 'px';\n\n const leftSibling = this.previousElementSibling;\n const rightSibling = this.nextElementSibling;\n const leftSiblingBoundingbox = leftSibling?.getBoundingClientRect();\n const rightSiblingBoundingbox = rightSibling?.getBoundingClientRect();\n\n if (this.direction === 'right') {\n // attach to left sibling\n if (leftSiblingBoundingbox) {\n this.style.left = leftSiblingBoundingbox.left + leftSiblingBoundingbox.width + 'px';\n } else {\n this.style.left = parentElementBoundingbox.left + 'px';\n }\n } else {\n // attach to right sibling\n if (rightSiblingBoundingbox) {\n this.style.right = window.innerWidth - rightSiblingBoundingbox.left + 'px';\n } else {\n this.style.right =\n window.innerWidth - (parentElementBoundingbox.left + parentElementBoundingbox.width) + 'px';\n }\n }\n }\n }\n\n /**\n * Triggers the event based on the target element.\n * If the target element is different from the last caller, it refreshes the children by calling the `open` method.\n * If the target element is the same as the last caller, it toggles the state by calling the `toggle` method.\n * @param {Event} e The event object.\n */\n triggerEvent = async (e) => {\n if (this._lastCaller && this._lastCaller !== e.composedPath()[0]) {\n // same oppener event but different caller so just refresh inner content\n await this.open(e);\n } else {\n // came caller so toggle\n await this.toggle(e);\n }\n\n this._lastCaller = e.composedPath()[0];\n };\n\n /**\n * Executes before the element is opened.\n */\n beforeOpen(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function called after the element is opened.\n */\n afterOpen(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function that is called after the container is closed.\n */\n afterClose(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Animates the transition of elements with specified options, toggling the visibility and/or dimensions\n * of the associated elements based on their current state.\n *\n * This method handles both forward and reverse animations for two elements (`transparentDiv` and `nativeElement`)\n * with optional opacity changes. It ensures smooth transitioning by canceling any previous animations on the provided\n * elements before initiating a new animation sequence.\n * @returns {Promise<void>} A promise that resolves when the transition animation is completed.\n */\n doAnimateTransition() {\n const options = {\n delay: 0,\n endDelay: 0,\n fill: 'forwards',\n duration: +this.animationDuration,\n iterationStart: 0,\n iterations: 1,\n direction: 'normal',\n easing: this.animationEasing,\n };\n\n if (this.animation && this.animation?.effect?.target !== this.transparentDiv) {\n this.animation.cancel();\n this.animation = null;\n }\n\n if (this.nativeAnimation && this.nativeAnimation?.effect?.target !== this.nativeElement) {\n this.nativeAnimation.cancel();\n this.nativeAnimation = null;\n }\n\n if (!this._isOpen) {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: 0,\n },\n {\n width: this.maxWidth,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n ],\n options\n );\n }\n } else {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: this.maxWidth,\n },\n {\n width: 0,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n ],\n options\n );\n }\n }\n\n return new Promise((resolve, reject) => {\n this.animation.onfinish = () => {\n this._isOpen = !this._isOpen;\n resolve();\n };\n });\n }\n\n /**\n * Opens the sliding container by performing necessary preparatory and transitional operations.\n * @param {Event} e The event that triggered the open operation.\n * @returns {Promise<void>} A promise that resolves when the open operation, including animations and subsequent handlers, is complete.\n */\n async open(e) {\n await Promise.resolve(this.beforeOpen(e)).then(async () => {\n if (!this._isOpen) {\n this.classList.add('open');\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeOpen')\n\n this.checkForVariant(this.variant);\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterOpen(e)).then(() => {\n event.dispatchCustomEvent(this, 'wje-sliding-container:open')\n });\n }\n });\n }\n\n /**\n * Closes the sliding container and performs associated operations such as animations and event dispatches.\n * @param {Event} e The event object associated with the close action.\n * @returns {Promise<void>} A promise that resolves when the closing operation, including animations and child element removal, is completed.\n */\n async close(e) {\n await Promise.resolve(this.beforeClose(e)).then(async () => {\n if (this._isOpen) {\n this.classList.remove('open');\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeClose');\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterClose(e)).then(() => {\n if (this.removeChildAfterClose) {\n this.childNodes.forEach((child) => {\n child.remove();\n });\n }\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:afterClose');\n });\n }\n });\n }\n\n /**\n * Toggles the state between open and closed.\n * @param {Event} e The event object triggering the toggle.\n * @returns {Promise<void>} A promise that resolves once the toggle operation (open or close) is complete.\n */\n async toggle(e) {\n if (this._isOpen) {\n await this.close(event);\n } else {\n await this.open(event);\n }\n }\n\n /**\n * Cleans up resources associated with the component by disconnecting\n * the resize observer and setting it to null.\n * @returns {void} Does not return a value.\n */\n componentCleanup() {\n this._resizeObserver?.disconnect();\n this._resizeObserver = null;\n }\n}\n","import SlidingContainer from './sliding-container.element.js';\n\nexport default SlidingContainer;\n\nSlidingContainer.define('wje-sliding-container', SlidingContainer);\n"],"names":[],"mappings":";;;;;;AAkCe,MAAM,yBAAyB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpD,cAAc;AACV,UAAO;AAyNX,qCAAY;AA+MZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe,OAAO,MAAM;AACxB,UAAI,KAAK,eAAe,KAAK,gBAAgB,EAAE,aAAY,EAAG,CAAC,GAAG;AAE9D,cAAM,KAAK,KAAK,CAAC;AAAA,MAC7B,OAAe;AAEH,cAAM,KAAK,OAAO,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,KAAK,MAAM;AAChD,gBAAM,oBAAoB,MAAM,4BAA4B;AAAA,QAChF,CAAiB;AAAA,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,MAAM,MAAM,GAAG;AACX,UAAM,QAAQ,QAAQ,KAAK,YAAY,CAAC,CAAC,EAAE,KAAK,YAAY;AACxD,UAAI,KAAK,SAAS;AACd,aAAK,UAAU,OAAO,MAAM;AAE5B,cAAM,oBAAoB,MAAM,mCAAmC;AAEnE,cAAM,KAAK,oBAAqB;AAEhC,cAAM,QAAQ,QAAQ,KAAK,WAAW,CAAC,CAAC,EAAE,KAAK,MAAM;AACjD,cAAI,KAAK,uBAAuB;AAC5B,iBAAK,WAAW,QAAQ,CAAC,UAAU;AAC/B,oBAAM,OAAQ;AAAA,YAC1C,CAAyB;AAAA,UACzB;AAEoB,gBAAM,oBAAoB,MAAM,kCAAkC;AAAA,QACtF,CAAiB;AAAA,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,MAAM,OAAO,GAAG;AACZ,QAAI,KAAK,SAAS;AACd,YAAM,KAAK,MAAM,KAAK;AAAA,IAClC,OAAe;AACH,YAAM,KAAK,KAAK,KAAK;AAAA,IACjC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB;;AACf,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB;AAAA,EAC/B;AACA;ACnqBA,iBAAiB,OAAO,yBAAyB,gBAAgB;"}
1
+ {"version":3,"file":"wje-sliding-container.js","sources":["../packages/wje-sliding-container/sliding-container.element.js","../packages/wje-sliding-container/sliding-container.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary SlidingContainer is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/SlidingContainer\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @slot - The default slot for the SlidingContainer.\n * @property {string} maxWidth - The maximum width of the SlidingContainer.\n * @property {string} maxHeight - The maximum height of the SlidingContainer.\n * @property {string} trigger - The trigger for the SlidingContainer.\n * @property {string} direction - Specifies the sliding direction of the container (e.g., 'left' or 'right').\n * @property {string} variant - Determines how the SlidingContainer behaves, such as 'over' or 'in-place'.\n * @property {string} screenBreakPoint - The width (in pixels) at which the SlidingContainer switches to the \"over\" variant for smaller screens.\n * @property {boolean} removeChildAfterClose - Removes the child after the SlidingContainer is closed.\n * @property {string} animationDuration - Specifies the duration (in milliseconds) of the sliding animation.\n * @property {string} animationEasing - Specifies the easing function used for the sliding animation (e.g., 'linear', 'ease-in', 'ease-out').\n * @property {boolean} hasOpacity - Sets the opacity of the SlidingContainer.\n * @tag wje-sliding-container\n * @example\n * <wje-sliding-container trigger=\"test-resize-container-event-right\" id=\"left-in-place\" direction=\"left\" max-width=\"100px\" max-height=\"100%\">\n * <wje-card>\n * <wje-card-header>\n * <wje-card-subtitle>CONTENT Subtitle</wje-card-subtitle>\n * <wje-card-title>CONTENT Title</wje-card-title>\n * </wje-card-header>\n * <wje-card-content>\n * CONTENT Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n * </wje-card-content>\n * </wje-card>\n * </wje-sliding-container>\n */\nexport default class SlidingContainer extends WJElement {\n /**\n * Creates an instance of SlidingContainer.\n * @class\n */\n constructor() {\n super();\n\n this._isOpen = false;\n this._lastCaller = null;\n\n this._resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n if (entry.contentBoxSize) {\n if (this.drawingStatus < 3) return;\n\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n if (this.variant !== 'over') {\n this.variant = 'over';\n } else {\n this.checkForVariant(this.variant);\n }\n } else {\n if (this.variant !== 'in-place') {\n this.variant = 'in-place';\n } else {\n this.checkForVariant(this.variant);\n }\n }\n }\n }\n });\n\n this._resizeObserver.observe(document.documentElement);\n }\n\n /**\n * Sets the maximum width of an element by updating the 'max-width' attribute.\n * @param {string} value The maximum width value to be set (e.g., '100px', '50%', etc.).\n */\n set maxWidth(value) {\n this.setAttribute('max-width', value);\n }\n\n /**\n * Gets the maximum width value of the element.\n * Retrieves the value of the 'max-width' attribute. If the attribute is not set, it defaults to 'auto'.\n * @returns {string} The maximum width value of the element or 'auto' if the attribute is not defined.\n */\n get maxWidth() {\n return this.getAttribute('max-width') ?? 'auto';\n }\n\n /**\n * Sets the maximum height for the element.\n * @param {string} value The maximum height value to be applied to the element. This can include units such as \"px\", \"em\", \"%\", etc.\n */\n set maxHeight(value) {\n this.setAttribute('max-height', value);\n }\n\n /**\n * Retrieves the maximum height value of the element, or returns 'auto' if not set.\n * @returns {string} The maximum height value or 'auto' if the attribute is not specified.\n */\n get maxHeight() {\n return this.getAttribute('max-height') ?? 'auto';\n }\n\n /**\n * Sets the 'trigger' attribute for the element.\n * @param {string} value The value to set for the 'trigger' attribute.\n */\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n /**\n * Retrieves the value of the 'trigger' attribute. If the attribute is not set, it defaults to 'sliding-container'.\n * @returns {string} The value of the 'trigger' attribute or the default value 'sliding-container' if not defined.\n */\n get trigger() {\n return this.getAttribute('trigger') ?? 'sliding-container';\n }\n\n /**\n * Sets the direction attribute for the element.\n * @param {string} value The direction value to be assigned. Possible values are typically 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto'.\n */\n set direction(value) {\n this.setAttribute('direction', value);\n }\n\n /**\n * Retrieves the direction attribute of the instance.\n * If the direction attribute is not set, it defaults to 'right'.\n * @returns {string} The value of the direction attribute or 'right' if not set.\n */\n get direction() {\n return this.getAttribute('direction') ?? 'right';\n }\n\n /**\n * Sets the value of the `remove-child-after-close` attribute.\n * This attribute determines if a child element should be removed after a close operation.\n * @param {boolean|string} value The value to set for the `remove-child-after-close` attribute. The value can be a boolean or a string representation of a boolean.\n */\n set removeChildAfterClose(value) {\n this.setAttribute('remove-child-after-close', value);\n }\n\n /**\n * Gets the value indicating whether the child element should be removed after closing.\n *\n * This property checks the presence of the 'remove-child-after-close' attribute on the element.\n * Returns `false` if the attribute does not exist.\n * @returns {boolean} True if the 'remove-child-after-close' attribute is present, otherwise false.\n */\n get removeChildAfterClose() {\n return this.hasAttribute('remove-child-after-close') ?? false;\n }\n\n /**\n * Sets the 'variant' attribute to the specified value.\n * @param {string} value The value to set for the 'variant' attribute.\n */\n set variant(value) {\n this.setAttribute('variant', value);\n }\n\n /**\n * Retrieves the value of the \"variant\" attribute. If the attribute is not set,\n * it returns the default value 'in-place'.\n * @returns {string} The variant value or the default value 'in-place'.\n */\n get variant() {\n return this.getAttribute('variant') ?? 'in-place';\n }\n\n /**\n * Retrieves the value of the 'screen-break-point' attribute.\n * @returns {string} The value of the 'screen-break-point' attribute.\n */\n get screenBreakPoint() {\n return this.getAttribute('screen-break-point');\n }\n\n /**\n * Sets the screen break point value to determine responsive behavior.\n * @param {string} value The value to set as the screen break point.\n */\n set screenBreakPoint(value) {\n this.setAttribute('screen-break-point', value);\n }\n\n /**\n * Sets the duration of the animation by updating the `animation-duration` attribute.\n * @param {string} value The duration value for the animation, specified in a format\n * such as seconds (e.g., \"2s\") or milliseconds (e.g., \"200ms\").\n */\n set animationDuration(value) {\n this.setAttribute('animation-duration', value);\n }\n\n /**\n * Gets the animation duration for an element.\n * It retrieves the value of the 'animation-duration' attribute if present; otherwise, it defaults to '500'.\n * @returns {string} The value of the animation duration, either from the attribute or the default '500'.\n */\n get animationDuration() {\n return this.getAttribute('animation-duration') ?? '500';\n }\n\n /**\n * Sets the easing function for the animation.\n * @param {string} value The easing function to use for the animation. This can be any valid CSS timing function such as \"ease\", \"linear\", \"ease-in\", \"ease-out\", etc.\n */\n set animationEasing(value) {\n this.setAttribute('animation-easing', value);\n }\n\n /**\n * Retrieves the easing function for the animation.\n * @returns {string} The value of the 'animation-easing' attribute if set, otherwise defaults to 'linear'.\n */\n get animationEasing() {\n return this.getAttribute('animation-easing') ?? 'linear';\n }\n\n /**\n * Determines if the element has an 'has-opacity' attribute.\n * @returns {boolean} True if the element has the 'has-opacity' attribute, otherwise false.\n */\n get hasOpacity() {\n return this.hasAttribute('has-opacity') ?? false;\n }\n\n /**\n * Sets the value of the 'add-to-height' attribute.\n * This attribute is used to modify or adjust the height dynamically.\n * @param {string} value The value to be assigned to the 'add-to-height' attribute.\n */\n set addToHeight(value) {\n this.setAttribute('add-to-height', value);\n }\n\n /**\n * Retrieves the value of the 'add-to-height' attribute from the element.\n * If the attribute is not set, it defaults to '0'.\n * @returns {string} The value of the 'add-to-height' attribute or '0' if the attribute is not present.\n */\n get addToHeight() {\n return this.getAttribute('add-to-height') ?? '0';\n }\n\n /**\n * Determines whether the current state is open.\n * @returns {boolean} True if the state is open, otherwise false.\n */\n get isOpen() {\n return this._isOpen;\n }\n\n className = 'SlidingContainer';\n\n /**\n * Returns the observed attributes for the component.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['max-width', 'max-height', 'trigger', 'direction', 'variant', 'screen-break-point', 'remove-child-after-close', 'animation-duration', 'animation-easing', 'has-opacity'];\n }\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n\n document.removeEventListener(this.trigger, this.triggerEvent);\n }\n\n /**\n * Draws the component.\n * @param {object} context The context for drawing.\n * @param {object} store The store for drawing.\n * @param {object} params The parameters for drawing.\n * @returns {DocumentFragment}\n */\n draw(context, store, params) {\n let fragment = document.createDocumentFragment();\n\n let wrapperDiv = document.createElement('div');\n wrapperDiv.classList.add('sliding-container-wrapper');\n\n let transparentDiv = document.createElement('div');\n transparentDiv.classList.add('sliding-container-transparent');\n\n if (this._isOpen) {\n transparentDiv.style.width = this.maxWidth;\n }\n\n let native = document.createElement('div');\n native.setAttribute('part', 'sliding-container');\n native.classList.add('native-sliding-container');\n native.style.width = 0;\n if (this.hasOpacity) {\n native.style.opacity = 0;\n }\n\n if (this._isOpen) {\n native.style.width = this.maxWidth;\n if (this.hasOpacity) {\n native.style.opacity = 1;\n }\n }\n\n if (this.direction === 'right') {\n native.style.right = 0;\n } else {\n native.style.left = 0;\n }\n\n let slot = document.createElement('slot');\n\n const nativeInner = document.createElement('div');\n nativeInner.classList.add('native-sliding-container-inner');\n nativeInner.style.width = this.maxWidth;\n\n // APPEND\n nativeInner.append(slot);\n nativeInner.append(this.htmlCloseButton());\n\n native.append(nativeInner);\n\n wrapperDiv.append(transparentDiv);\n wrapperDiv.append(native);\n\n fragment.append(wrapperDiv);\n\n this.transparentDiv = transparentDiv;\n this.wrapperDiv = wrapperDiv\n this.nativeElement = native;\n\n return fragment;\n }\n\n /**\n * Performs actions after the element is drawn on the screen.\n * Attaches an event listener to the document based on the specified trigger.\n * Sets the variant to \"over\" if the document width is smaller than the screen break point.\n * Calls the checkForVariant method with the current variant.\n */\n afterDraw() {\n this.syncAria();\n document.addEventListener(this.trigger, this.triggerEvent);\n\n // if document width is on small screen set variant to over\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n this.variant = 'over';\n }\n\n this.checkForVariant(this.variant);\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'region' });\n }\n\n this.setAriaState({ hidden: !this.isOpen });\n\n const ariaLabel = this.getAttribute('aria-label');\n const label = this.getAttribute('label');\n if (!ariaLabel && label) {\n this.setAriaState({ label });\n }\n }\n\n /**\n * Creates and returns a styled close button element with an icon,\n * including an event listener to trigger the close method.\n * @returns {HTMLElement} The close button element configured with styles, an icon, and event listener.\n */\n htmlCloseButton() {\n let closeButton = document.createElement('wje-button');\n closeButton.setAttribute('part', 'close-button');\n closeButton.classList.add('close-button');\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('slot', 'icon-only');\n icon.setAttribute('name', 'x');\n\n closeButton.append(icon);\n\n event.addListener(closeButton, 'wje-button:click', null,(e) => {\n this.close();\n });\n\n return closeButton;\n }\n\n /**\n * Retrieves the parent element of the current element.\n * If the parent element is not found, it attempts to find the root host element.\n * @returns {Element|null} The parent element or the root host element if no parent exists. Returns null if neither is found.\n */\n getParentElement() {\n let parentElement = this.parentElement;\n\n if (!parentElement) {\n parentElement = this.getRootNode().host;\n }\n\n return parentElement;\n }\n\n /**\n * Adjusts the position and dimensions of the current element based on the specified variant.\n *\n * The method handles modifications to the element's positioning style, aligns it relative to its parent,\n * and manages alignment to its siblings based on the specified direction.\n * @param {string} variant The variant to determine how the element should be updated. For example, when set to 'over', specific adjustments to the position and size are performed.\n * @returns {void} No value is returned, the method modifies the element's style properties directly.\n */\n checkForVariant(variant) {\n if (variant === 'over') {\n this.style.position = 'fixed';\n let computentStyleOfParent = window.getComputedStyle(this.getParentElement());\n let parentElementBoundingbox = this.getParentElement().getBoundingClientRect();\n let heightOfParrentElement = parseFloat(computentStyleOfParent.height);\n\n let topOfParrentElement = parseFloat(computentStyleOfParent.top);\n\n this.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.wrapperDiv.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.style.top = topOfParrentElement + 'px';\n\n const leftSibling = this.previousElementSibling;\n const rightSibling = this.nextElementSibling;\n const leftSiblingBoundingbox = leftSibling?.getBoundingClientRect();\n const rightSiblingBoundingbox = rightSibling?.getBoundingClientRect();\n\n if (this.direction === 'right') {\n // attach to left sibling\n if (leftSiblingBoundingbox) {\n this.style.left = leftSiblingBoundingbox.left + leftSiblingBoundingbox.width + 'px';\n } else {\n this.style.left = parentElementBoundingbox.left + 'px';\n }\n } else {\n // attach to right sibling\n if (rightSiblingBoundingbox) {\n this.style.right = window.innerWidth - rightSiblingBoundingbox.left + 'px';\n } else {\n this.style.right =\n window.innerWidth - (parentElementBoundingbox.left + parentElementBoundingbox.width) + 'px';\n }\n }\n }\n }\n\n /**\n * Triggers the event based on the target element.\n * If the target element is different from the last caller, it refreshes the children by calling the `open` method.\n * If the target element is the same as the last caller, it toggles the state by calling the `toggle` method.\n * @param {Event} e The event object.\n */\n triggerEvent = async (e) => {\n if (this._lastCaller && this._lastCaller !== e.composedPath()[0]) {\n // same oppener event but different caller so just refresh inner content\n await this.open(e);\n } else {\n // came caller so toggle\n await this.toggle(e);\n }\n\n this._lastCaller = e.composedPath()[0];\n };\n\n /**\n * Executes before the element is opened.\n */\n beforeOpen(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function called after the element is opened.\n */\n afterOpen(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function that is called after the container is closed.\n */\n afterClose(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Animates the transition of elements with specified options, toggling the visibility and/or dimensions\n * of the associated elements based on their current state.\n *\n * This method handles both forward and reverse animations for two elements (`transparentDiv` and `nativeElement`)\n * with optional opacity changes. It ensures smooth transitioning by canceling any previous animations on the provided\n * elements before initiating a new animation sequence.\n * @returns {Promise<void>} A promise that resolves when the transition animation is completed.\n */\n doAnimateTransition() {\n const options = {\n delay: 0,\n endDelay: 0,\n fill: 'forwards',\n duration: +this.animationDuration,\n iterationStart: 0,\n iterations: 1,\n direction: 'normal',\n easing: this.animationEasing,\n };\n\n if (this.animation && this.animation?.effect?.target !== this.transparentDiv) {\n this.animation.cancel();\n this.animation = null;\n }\n\n if (this.nativeAnimation && this.nativeAnimation?.effect?.target !== this.nativeElement) {\n this.nativeAnimation.cancel();\n this.nativeAnimation = null;\n }\n\n if (!this._isOpen) {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: 0,\n },\n {\n width: this.maxWidth,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n ],\n options\n );\n }\n } else {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: this.maxWidth,\n },\n {\n width: 0,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n ],\n options\n );\n }\n }\n\n return new Promise((resolve, reject) => {\n this.animation.onfinish = () => {\n this._isOpen = !this._isOpen;\n resolve();\n };\n });\n }\n\n /**\n * Opens the sliding container by performing necessary preparatory and transitional operations.\n * @param {Event} e The event that triggered the open operation.\n * @returns {Promise<void>} A promise that resolves when the open operation, including animations and subsequent handlers, is complete.\n */\n async open(e) {\n await Promise.resolve(this.beforeOpen(e)).then(async () => {\n if (!this._isOpen) {\n this.classList.add('open');\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeOpen')\n\n this.checkForVariant(this.variant);\n\n await this.doAnimateTransition();\n this.syncAria();\n\n await Promise.resolve(this.afterOpen(e)).then(() => {\n event.dispatchCustomEvent(this, 'wje-sliding-container:open')\n });\n }\n });\n }\n\n /**\n * Closes the sliding container and performs associated operations such as animations and event dispatches.\n * @param {Event} e The event object associated with the close action.\n * @returns {Promise<void>} A promise that resolves when the closing operation, including animations and child element removal, is completed.\n */\n async close(e) {\n await Promise.resolve(this.beforeClose(e)).then(async () => {\n if (this._isOpen) {\n this.classList.remove('open');\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeClose');\n\n await this.doAnimateTransition();\n this.syncAria();\n\n await Promise.resolve(this.afterClose(e)).then(() => {\n if (this.removeChildAfterClose) {\n this.childNodes.forEach((child) => {\n child.remove();\n });\n }\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:afterClose');\n });\n }\n });\n }\n\n /**\n * Toggles the state between open and closed.\n * @param {Event} e The event object triggering the toggle.\n * @returns {Promise<void>} A promise that resolves once the toggle operation (open or close) is complete.\n */\n async toggle(e) {\n if (this._isOpen) {\n await this.close(event);\n } else {\n await this.open(event);\n }\n }\n\n /**\n * Cleans up resources associated with the component by disconnecting\n * the resize observer and setting it to null.\n * @returns {void} Does not return a value.\n */\n componentCleanup() {\n this._resizeObserver?.disconnect();\n this._resizeObserver = null;\n }\n}\n","import SlidingContainer from './sliding-container.element.js';\n\nexport default SlidingContainer;\n\nSlidingContainer.define('wje-sliding-container', SlidingContainer);\n"],"names":[],"mappings":";;;;;;AAkCe,MAAM,yBAAyB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpD,cAAc;AACV,UAAO;AAyNX,qCAAY;AAkOZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe,OAAO,MAAM;AACxB,UAAI,KAAK,eAAe,KAAK,gBAAgB,EAAE,aAAY,EAAG,CAAC,GAAG;AAE9D,cAAM,KAAK,KAAK,CAAC;AAAA,MAC7B,OAAe;AAEH,cAAM,KAAK,OAAO,CAAC;AAAA,MAC/B;AAEQ,WAAK,cAAc,EAAE,aAAY,EAAG,CAAC;AAAA,IACxC;AAncG,SAAK,UAAU;AACf,SAAK,cAAc;AAEnB,SAAK,kBAAkB,IAAI,eAAe,CAAC,YAAY;AACnD,eAAS,SAAS,SAAS;AACvB,YAAI,MAAM,gBAAgB;AACtB,cAAI,KAAK,gBAAgB,EAAG;AAE5B,cAAI,KAAK,oBAAoB,OAAO,cAAc,KAAK,kBAAkB;AACrE,gBAAI,KAAK,YAAY,QAAQ;AACzB,mBAAK,UAAU;AAAA,YAC3C,OAA+B;AACH,mBAAK,gBAAgB,KAAK,OAAO;AAAA,YAC7D;AAAA,UAC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AAM,oBAAoB,MAAM,4BAA4B;AAAA,QAChF,CAAiB;AAAA,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,MAAM,MAAM,GAAG;AACX,UAAM,QAAQ,QAAQ,KAAK,YAAY,CAAC,CAAC,EAAE,KAAK,YAAY;AACxD,UAAI,KAAK,SAAS;AACd,aAAK,UAAU,OAAO,MAAM;AAE5B,cAAM,oBAAoB,MAAM,mCAAmC;AAEnE,cAAM,KAAK,oBAAqB;AAChC,aAAK,SAAU;AAEf,cAAM,QAAQ,QAAQ,KAAK,WAAW,CAAC,CAAC,EAAE,KAAK,MAAM;AACjD,cAAI,KAAK,uBAAuB;AAC5B,iBAAK,WAAW,QAAQ,CAAC,UAAU;AAC/B,oBAAM,OAAQ;AAAA,YAC1C,CAAyB;AAAA,UACzB;AAEoB,gBAAM,oBAAoB,MAAM,kCAAkC;AAAA,QACtF,CAAiB;AAAA,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,MAAM,OAAO,GAAG;AACZ,QAAI,KAAK,SAAS;AACd,YAAM,KAAK,MAAM,KAAK;AAAA,IAClC,OAAe;AACH,YAAM,KAAK,KAAK,KAAK;AAAA,IACjC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB;;AACf,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB;AAAA,EAC/B;AACA;ACxrBA,iBAAiB,OAAO,yBAAyB,gBAAgB;"}
@@ -41,6 +41,7 @@ export default class SplitView extends WJElement {
41
41
  * @returns {DocumentFragment}
42
42
  */
43
43
  draw(): DocumentFragment;
44
+ dividerElement: HTMLDivElement;
44
45
  /**
45
46
  * Sets up the event listeners after the component is drawn.
46
47
  */
@@ -49,6 +49,9 @@ class SplitView extends WJElement {
49
49
  let sizeB = 100 - this.pixelsToPercentage(newPositionInPixels);
50
50
  this.style.setProperty("--wje-split-view-calc-a", sizeA + "%");
51
51
  this.style.setProperty("--wje-split-view-calc-b", sizeB + "%");
52
+ if (this.dividerElement) {
53
+ this.dividerElement.setAttribute("aria-valuenow", `${Math.round(sizeA)}`);
54
+ }
52
55
  },
53
56
  initialEvent: e
54
57
  });
@@ -99,12 +102,18 @@ class SplitView extends WJElement {
99
102
  let dividerElement = document.createElement("div");
100
103
  dividerElement.classList.add("wje-divider");
101
104
  dividerElement.setAttribute("part", "divider");
105
+ dividerElement.setAttribute("role", "separator");
106
+ dividerElement.setAttribute("aria-orientation", this.hasAttribute("vertical") ? "vertical" : "horizontal");
107
+ dividerElement.setAttribute("aria-valuemin", "0");
108
+ dividerElement.setAttribute("aria-valuemax", "100");
109
+ dividerElement.setAttribute("aria-valuenow", `${this.initial}`);
102
110
  dividerElement.appendChild(divider);
103
111
  dividerElement.addEventListener("mousedown", this.handleDrag, false);
104
112
  native.appendChild(start);
105
113
  native.appendChild(dividerElement);
106
114
  native.appendChild(end);
107
115
  fragment.appendChild(native);
116
+ this.dividerElement = dividerElement;
108
117
  return fragment;
109
118
  }
110
119
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"wje-split-view.js","sources":["../packages/wje-split-view/service/service.js","../packages/wje-split-view/split-view.element.js","../packages/wje-split-view/split-view.js"],"sourcesContent":["export function drag(container, options) {\n function move(pointerEvent) {\n const dims = container.getBoundingClientRect();\n const defaultView = container.ownerDocument.defaultView;\n const offsetX = dims.left + defaultView.pageXOffset;\n const offsetY = dims.top + defaultView.pageYOffset;\n const x = pointerEvent.pageX - offsetX;\n const y = pointerEvent.pageY - offsetY;\n if (options?.onMove) {\n options.onMove(x, y);\n }\n }\n\n function stop() {\n document.removeEventListener('pointermove', move);\n document.removeEventListener('pointerup', stop);\n\n if (options?.onStop) {\n options.onStop();\n }\n }\n\n document.addEventListener('pointermove', move, { passive: true });\n document.addEventListener('pointerup', stop);\n\n if (options?.initialEvent instanceof PointerEvent) {\n move(options.initialEvent);\n }\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport { drag } from './service/service.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `SplitView` is a custom web component that represents a split view.\n * @summary This element represents a split view.\n * @documentation https://elements.webjet.sk/components/split-view\n * @status stable\n * @augments WJElement\n * @slot start - Slot for the start view.\n * @slot end - Slot for the end view.\n * @slot divider - Slot for the divider.\n * @csspart wje-divider - The divider of the split view.\n * @cssproperty [--wje-split-view-divider-area=12px] - Defines the interactive area (hitbox) of the divider for resizing. Accepts any valid CSS length unit (e.g., `px`, `rem`, `%`).\n * @cssproperty [--wje-split-view-divider-width=4px] - Specifies the visual width of the divider. Controls how thick the divider appears.\n * @cssproperty [--wje-split-view-min=0%] - Sets the minimum size limit for the split views. Ensures that a view cannot be resized below this value.\n * @cssproperty [--wje-split-view-max=100%] - Sets the maximum size limit for the split views. Ensures that a view cannot be resized beyond this value.\n * @cssproperty [--wje-split-view-calc-a=50%] - Represents the calculated size of the first view. This is used to dynamically set the size of the first view.\n * @cssproperty [--wje-split-view-calc-b=50%] - Represents the calculated size of the second view. This is used to dynamically set the size of the second view.\n * @cssproperty [--wje-split-view-clamp-a=clamp(var(--wje-split-view-min), var(--wje-split-view-calc-a), var(--wje-split-view-max))] - Clamps the size of the first view between minimum and maximum limits. Ensures the calculated size stays within the defined range.\n * @cssproperty [--wje-split-view-clamp-b=clamp(var(--wje-split-view-min), var(--wje-split-view-calc-b), var(--wje-split-view-max))] - Clamps the size of the second view between minimum and maximum limits. Ensures the calculated size stays within the defined range.\n * @cssproperty [--wje-split-view-divider-background=var(--wje-border-color)] - Sets the background color of the divider. Accepts any valid CSS color value (e.g., hex, RGB, or CSS variable).\n * @cssproperty [--wje-split-view-divider-size=4px] - Defines the overall size of the divider, affecting both its visual and interactive dimensions. Accepts any valid CSS length unit.\n * @tag wje-split-view\n */\n\nexport default class SplitView extends WJElement {\n /**\n * Creates an instance of SplitView.\n * @class\n */\n constructor() {\n super();\n }\n\n set initial(value) {\n this.setAttribute('initial', value);\n }\n\n get initial() {\n return +this.getAttribute('initial') || 50;\n }\n\n className = 'SplitView';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component for the split view.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-split-view');\n\n let start = document.createElement('slot');\n start.setAttribute('name', 'start');\n\n let end = document.createElement('slot');\n end.setAttribute('name', 'end');\n\n let divider = document.createElement('slot');\n divider.setAttribute('name', 'divider');\n\n let dividerElement = document.createElement('div');\n dividerElement.classList.add('wje-divider');\n dividerElement.setAttribute('part', 'divider');\n dividerElement.appendChild(divider);\n dividerElement.addEventListener('mousedown', this.handleDrag, false);\n\n native.appendChild(start);\n native.appendChild(dividerElement);\n native.appendChild(end);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n\n /**\n * Sets up the event listeners after the component is drawn.\n */\n afterDraw() {\n this.detectSize();\n\n if (this.min) this.style.setProperty('--wje-split-view-min', this.pixelsToPercentage(this.min) + '%');\n\n if (this.max) this.style.setProperty('--wje-split-view-max', 100 - this.pixelsToPercentage(this.max) + '%');\n\n if (this.initial) {\n this.style.setProperty('--wje-split-view-calc-a', this.pixelsToPercentage(this.initial) + '%');\n this.style.setProperty('--wje-split-view-calc-b', 100 - this.pixelsToPercentage(this.initial) + '%');\n }\n\n this.resizeObserver = new ResizeObserver((entries) => this.handleResize(entries));\n }\n\n /**\n * Handles the drag event.\n * @param {Event} e The event object.\n */\n handleDrag = (e) => {\n if (this.hasAttribute('disabled')) return;\n\n drag(this, {\n onMove: (x, y) => {\n let newPositionInPixels = this.hasAttribute('vertical') ? y : x;\n let sizeA = this.pixelsToPercentage(newPositionInPixels);\n let sizeB = 100 - this.pixelsToPercentage(newPositionInPixels);\n\n this.style.setProperty('--wje-split-view-calc-a', sizeA + '%');\n this.style.setProperty('--wje-split-view-calc-b', sizeB + '%');\n },\n initialEvent: e,\n });\n };\n\n /**\n * Detects the size of the split view.\n */\n detectSize() {\n const { width, height } = this.getBoundingClientRect();\n\n this.size = this.hasAttribute('vertical') ? height : width;\n }\n\n /**\n * Converts pixels to a percentage.\n * @param {number} value The pixel value.\n * @returns {number} The percentage value.\n */\n pixelsToPercentage(value) {\n return (value / this.size) * 100;\n }\n}\n","import SplitView from './split-view.element.js';\n\nexport default SplitView;\n\nSplitView.define('wje-split-view', SplitView);\n"],"names":[],"mappings":";;;;AAAO,SAAS,KAAK,WAAW,SAAS;AACrC,WAAS,KAAK,cAAc;AACxB,UAAM,OAAO,UAAU,sBAAuB;AAC9C,UAAM,cAAc,UAAU,cAAc;AAC5C,UAAM,UAAU,KAAK,OAAO,YAAY;AACxC,UAAM,UAAU,KAAK,MAAM,YAAY;AACvC,UAAM,IAAI,aAAa,QAAQ;AAC/B,UAAM,IAAI,aAAa,QAAQ;AAC/B,QAAI,mCAAS,QAAQ;AACjB,cAAQ,OAAO,GAAG,CAAC;AAAA,IAC/B;AAAA,EACA;AAEI,WAAS,OAAO;AACZ,aAAS,oBAAoB,eAAe,IAAI;AAChD,aAAS,oBAAoB,aAAa,IAAI;AAE9C,QAAI,mCAAS,QAAQ;AACjB,cAAQ,OAAQ;AAAA,IAC5B;AAAA,EACA;AAEI,WAAS,iBAAiB,eAAe,MAAM,EAAE,SAAS,MAAM;AAChE,WAAS,iBAAiB,aAAa,IAAI;AAE3C,OAAI,mCAAS,yBAAwB,cAAc;AAC/C,SAAK,QAAQ,YAAY;AAAA,EACjC;AACA;;ACDe,MAAM,kBAAkB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK7C,cAAc;AACV,UAAO;AAWX,qCAAY;AAmFZ;AAAA;AAAA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aAAa;AAC1C,mBAAe,aAAa,QAAQ,SAAS;AAC7C,mBAAe,YAAY,OAAO;AAClC,mBAAe,iBAAiB,aAAa,KAAK,YAAY,KAAK;AAEnE,WAAO,YAAY,KAAK;AACxB,WAAO,YAAY,cAAc;AACjC,WAAO,YAAY,GAAG;AAEtB,aAAS,YAAY,MAAM;AAE3B,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,YAAY;AACR,SAAK,WAAY;AAEjB,QAAI,KAAK,IAAK,MAAK,MAAM,YAAY,wBAAwB,KAAK,mBAAmB,KAAK,GAAG,IAAI,GAAG;AAEpG,QAAI,KAAK,IAAK,MAAK,MAAM,YAAY,wBAAwB,MAAM,KAAK,mBAAmB,KAAK,GAAG,IAAI,GAAG;AAE1G,QAAI,KAAK,SAAS;AACd,WAAK,MAAM,YAAY,2BAA2B,KAAK,mBAAmB,KAAK,OAAO,IAAI,GAAG;AAC7F,WAAK,MAAM,YAAY,2BAA2B,MAAM,KAAK,mBAAmB,KAAK,OAAO,IAAI,GAAG;AAAA,IAC/G;AAEQ,SAAK,iBAAiB,IAAI,eAAe,CAAC,YAAY,KAAK,aAAa,OAAO,CAAC;AAAA,EACxF;AAAA;AAAA;AAAA;AAAA,EAyBI,aAAa;AACT,UAAM,EAAE,OAAO,WAAW,KAAK,sBAAuB;AAEtD,SAAK,OAAO,KAAK,aAAa,UAAU,IAAI,SAAS;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB,OAAO;AACtB,WAAQ,QAAQ,KAAK,OAAQ;AAAA,EACrC;AACA;AC5JA,UAAU,OAAO,kBAAkB,SAAS;"}
1
+ {"version":3,"file":"wje-split-view.js","sources":["../packages/wje-split-view/service/service.js","../packages/wje-split-view/split-view.element.js","../packages/wje-split-view/split-view.js"],"sourcesContent":["export function drag(container, options) {\n function move(pointerEvent) {\n const dims = container.getBoundingClientRect();\n const defaultView = container.ownerDocument.defaultView;\n const offsetX = dims.left + defaultView.pageXOffset;\n const offsetY = dims.top + defaultView.pageYOffset;\n const x = pointerEvent.pageX - offsetX;\n const y = pointerEvent.pageY - offsetY;\n if (options?.onMove) {\n options.onMove(x, y);\n }\n }\n\n function stop() {\n document.removeEventListener('pointermove', move);\n document.removeEventListener('pointerup', stop);\n\n if (options?.onStop) {\n options.onStop();\n }\n }\n\n document.addEventListener('pointermove', move, { passive: true });\n document.addEventListener('pointerup', stop);\n\n if (options?.initialEvent instanceof PointerEvent) {\n move(options.initialEvent);\n }\n}\n","import { default as WJElement } from '../wje-element/element.js';\nimport { drag } from './service/service.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `SplitView` is a custom web component that represents a split view.\n * @summary This element represents a split view.\n * @documentation https://elements.webjet.sk/components/split-view\n * @status stable\n * @augments WJElement\n * @slot start - Slot for the start view.\n * @slot end - Slot for the end view.\n * @slot divider - Slot for the divider.\n * @csspart wje-divider - The divider of the split view.\n * @cssproperty [--wje-split-view-divider-area=12px] - Defines the interactive area (hitbox) of the divider for resizing. Accepts any valid CSS length unit (e.g., `px`, `rem`, `%`).\n * @cssproperty [--wje-split-view-divider-width=4px] - Specifies the visual width of the divider. Controls how thick the divider appears.\n * @cssproperty [--wje-split-view-min=0%] - Sets the minimum size limit for the split views. Ensures that a view cannot be resized below this value.\n * @cssproperty [--wje-split-view-max=100%] - Sets the maximum size limit for the split views. Ensures that a view cannot be resized beyond this value.\n * @cssproperty [--wje-split-view-calc-a=50%] - Represents the calculated size of the first view. This is used to dynamically set the size of the first view.\n * @cssproperty [--wje-split-view-calc-b=50%] - Represents the calculated size of the second view. This is used to dynamically set the size of the second view.\n * @cssproperty [--wje-split-view-clamp-a=clamp(var(--wje-split-view-min), var(--wje-split-view-calc-a), var(--wje-split-view-max))] - Clamps the size of the first view between minimum and maximum limits. Ensures the calculated size stays within the defined range.\n * @cssproperty [--wje-split-view-clamp-b=clamp(var(--wje-split-view-min), var(--wje-split-view-calc-b), var(--wje-split-view-max))] - Clamps the size of the second view between minimum and maximum limits. Ensures the calculated size stays within the defined range.\n * @cssproperty [--wje-split-view-divider-background=var(--wje-border-color)] - Sets the background color of the divider. Accepts any valid CSS color value (e.g., hex, RGB, or CSS variable).\n * @cssproperty [--wje-split-view-divider-size=4px] - Defines the overall size of the divider, affecting both its visual and interactive dimensions. Accepts any valid CSS length unit.\n * @tag wje-split-view\n */\n\nexport default class SplitView extends WJElement {\n /**\n * Creates an instance of SplitView.\n * @class\n */\n constructor() {\n super();\n }\n\n set initial(value) {\n this.setAttribute('initial', value);\n }\n\n get initial() {\n return +this.getAttribute('initial') || 50;\n }\n\n className = 'SplitView';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component for the split view.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native-split-view');\n\n let start = document.createElement('slot');\n start.setAttribute('name', 'start');\n\n let end = document.createElement('slot');\n end.setAttribute('name', 'end');\n\n let divider = document.createElement('slot');\n divider.setAttribute('name', 'divider');\n\n let dividerElement = document.createElement('div');\n dividerElement.classList.add('wje-divider');\n dividerElement.setAttribute('part', 'divider');\n dividerElement.setAttribute('role', 'separator');\n dividerElement.setAttribute('aria-orientation', this.hasAttribute('vertical') ? 'vertical' : 'horizontal');\n dividerElement.setAttribute('aria-valuemin', '0');\n dividerElement.setAttribute('aria-valuemax', '100');\n dividerElement.setAttribute('aria-valuenow', `${this.initial}`);\n dividerElement.appendChild(divider);\n dividerElement.addEventListener('mousedown', this.handleDrag, false);\n\n native.appendChild(start);\n native.appendChild(dividerElement);\n native.appendChild(end);\n\n fragment.appendChild(native);\n\n this.dividerElement = dividerElement;\n\n return fragment;\n }\n\n /**\n * Sets up the event listeners after the component is drawn.\n */\n afterDraw() {\n this.detectSize();\n\n if (this.min) this.style.setProperty('--wje-split-view-min', this.pixelsToPercentage(this.min) + '%');\n\n if (this.max) this.style.setProperty('--wje-split-view-max', 100 - this.pixelsToPercentage(this.max) + '%');\n\n if (this.initial) {\n this.style.setProperty('--wje-split-view-calc-a', this.pixelsToPercentage(this.initial) + '%');\n this.style.setProperty('--wje-split-view-calc-b', 100 - this.pixelsToPercentage(this.initial) + '%');\n }\n\n this.resizeObserver = new ResizeObserver((entries) => this.handleResize(entries));\n }\n\n /**\n * Handles the drag event.\n * @param {Event} e The event object.\n */\n handleDrag = (e) => {\n if (this.hasAttribute('disabled')) return;\n\n drag(this, {\n onMove: (x, y) => {\n let newPositionInPixels = this.hasAttribute('vertical') ? y : x;\n let sizeA = this.pixelsToPercentage(newPositionInPixels);\n let sizeB = 100 - this.pixelsToPercentage(newPositionInPixels);\n\n this.style.setProperty('--wje-split-view-calc-a', sizeA + '%');\n this.style.setProperty('--wje-split-view-calc-b', sizeB + '%');\n if (this.dividerElement) {\n this.dividerElement.setAttribute('aria-valuenow', `${Math.round(sizeA)}`);\n }\n },\n initialEvent: e,\n });\n };\n\n /**\n * Detects the size of the split view.\n */\n detectSize() {\n const { width, height } = this.getBoundingClientRect();\n\n this.size = this.hasAttribute('vertical') ? height : width;\n }\n\n /**\n * Converts pixels to a percentage.\n * @param {number} value The pixel value.\n * @returns {number} The percentage value.\n */\n pixelsToPercentage(value) {\n return (value / this.size) * 100;\n }\n}\n","import SplitView from './split-view.element.js';\n\nexport default SplitView;\n\nSplitView.define('wje-split-view', SplitView);\n"],"names":[],"mappings":";;;;AAAO,SAAS,KAAK,WAAW,SAAS;AACrC,WAAS,KAAK,cAAc;AACxB,UAAM,OAAO,UAAU,sBAAuB;AAC9C,UAAM,cAAc,UAAU,cAAc;AAC5C,UAAM,UAAU,KAAK,OAAO,YAAY;AACxC,UAAM,UAAU,K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EjB,QAAI,KAAK,IAAK,MAAK,MAAM,YAAY,wBAAwB,KAAK,mBAAmB,KAAK,GAAG,IAAI,GAAG;AAEpG,QAAI,KAAK,IAAK,MAAK,MAAM,YAAY,wBAAwB,MAAM,KAAK,mBAAmB,KAAK,GAAG,IAAI,GAAG;AAE1G,QAAI,KAAK,SAAS;AACd,WAAK,MAAM,YAAY,2BAA2B,KAAK,mBAAmB,KAAK,OAAO,IAAI,GAAG;AAC7F,WAAK,MAAM,YAAY,2BAA2B,MAAM,KAAK,mBAAmB,KAAK,OAAO,IAAI,GAAG;AAAA,IAC/G;AAEQ,SAAK,iBAAiB,IAAI,eAAe,CAAC,YAAY,KAAK,aAAa,OAAO,CAAC;AAAA,EACxF;AAAA;AAAA;AAAA;AAAA,EA4BI,aAAa;AACT,UAAM,EAAE,OAAO,WAAW,KAAK,sBAAuB;AAEtD,SAAK,OAAO,KAAK,aAAa,UAAU,IAAI,SAAS;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB,OAAO;AACtB,WAAQ,QAAQ,KAAK,OAAQ;AAAA,EACrC;AACA;ACtKA,UAAU,OAAO,kBAAkB,SAAS;"}
@@ -28,6 +28,7 @@ class Status extends WJElement {
28
28
  */
29
29
  setupAttributes() {
30
30
  this.isShadowRoot = "open";
31
+ this.setAriaState({ role: "status" });
31
32
  }
32
33
  /**
33
34
  * Draws the component for the status.
@@ -1 +1 @@
1
- {"version":3,"file":"wje-status.js","sources":["../packages/wje-status/status.element.js","../packages/wje-status/status.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents Status element, extending the WJElement class.\n * @documentation https://elements.webjet.sk/components/status\n * @status stable\n * @augments WJElement\n * @slot - The status main content.\n * @slot start - The status start content.\n * @slot end - The status end content.\n * @csspart native - The native part of the status.\n * @csspart bullet - The bullet part of the status.\n * @tag wje-status\n */\nexport default class Status extends WJElement {\n /**\n * Creates an instance of Status.\n */\n constructor() {\n super();\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Status';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component for the status.\n * @returns {object} fragment - The document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-status');\n\n let bullet = document.createElement('div');\n bullet.setAttribute('part', 'bullet');\n bullet.classList.add('bullet');\n\n let slot = document.createElement('slot');\n\n let start = document.createElement('slot');\n start.setAttribute('name', 'start');\n\n let end = document.createElement('slot');\n end.setAttribute('name', 'end');\n\n bullet.appendChild(slot);\n\n native.appendChild(start);\n native.appendChild(bullet);\n native.appendChild(end);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n}\n","import Status from './status.element.js';\n\nexport default Status;\n\nStatus.define('wje-status', Status);\n"],"names":[],"mappings":";;;;;AAee,MAAM,eAAe,UAAU;AAAA;AAAA;AAAA;AAAA,EAI1C,cAAc;AACV,UAAO;AAOX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAAA,EANhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,QAAI,WAAW,SAAS,uBAAwB;AAEhD,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,UAAU,IAAI,eAAe;AAEpC,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,UAAU,IAAI,QAAQ;AAE7B,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,QAAI,QAAQ,SAAS,cAAc,MAAM;AACzC,UAAM,aAAa,QAAQ,OAAO;AAElC,QAAI,MAAM,SAAS,cAAc,MAAM;AACvC,QAAI,aAAa,QAAQ,KAAK;AAE9B,WAAO,YAAY,IAAI;AAEvB,WAAO,YAAY,KAAK;AACxB,WAAO,YAAY,MAAM;AACzB,WAAO,YAAY,GAAG;AAEtB,aAAS,YAAY,MAAM;AAE3B,WAAO;AAAA,EACf;AACA;AC1EA,OAAO,OAAO,cAAc,MAAM;"}
1
+ {"version":3,"file":"wje-status.js","sources":["../packages/wje-status/status.element.js","../packages/wje-status/status.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents Status element, extending the WJElement class.\n * @documentation https://elements.webjet.sk/components/status\n * @status stable\n * @augments WJElement\n * @slot - The status main content.\n * @slot start - The status start content.\n * @slot end - The status end content.\n * @csspart native - The native part of the status.\n * @csspart bullet - The bullet part of the status.\n * @tag wje-status\n */\nexport default class Status extends WJElement {\n /**\n * Creates an instance of Status.\n */\n constructor() {\n super();\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Status';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAriaState({ role: 'status' });\n }\n\n /**\n * Draws the component for the status.\n * @returns {object} fragment - The document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-status');\n\n let bullet = document.createElement('div');\n bullet.setAttribute('part', 'bullet');\n bullet.classList.add('bullet');\n\n let slot = document.createElement('slot');\n\n let start = document.createElement('slot');\n start.setAttribute('name', 'start');\n\n let end = document.createElement('slot');\n end.setAttribute('name', 'end');\n\n bullet.appendChild(slot);\n\n native.appendChild(start);\n native.appendChild(bullet);\n native.appendChild(end);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n}\n","import Status from './status.element.js';\n\nexport default Status;\n\nStatus.define('wje-status', Status);\n"],"names":[],"mappings":";;;;;AAee,MAAM,eAAe,UAAU;AAAA;AAAA;AAAA;AAAA,EAI1C,cAAc;AACV,UAAO;AAOX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAAA,EANhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AACpB,SAAK,aAAa,EAAE,MAAM,SAAQ,CAAE;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,QAAI,WAAW,SAAS,uBAAwB;AAEhD,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,UAAU,IAAI,eAAe;AAEpC,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,UAAU,IAAI,QAAQ;AAE7B,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,QAAI,QAAQ,SAAS,cAAc,MAAM;AACzC,UAAM,aAAa,QAAQ,OAAO;AAElC,QAAI,MAAM,SAAS,cAAc,MAAM;AACvC,QAAI,aAAa,QAAQ,KAAK;AAE9B,WAAO,YAAY,IAAI;AAEvB,WAAO,YAAY,KAAK;AACxB,WAAO,YAAY,MAAM;AACzB,WAAO,YAAY,GAAG;AAEtB,aAAS,YAAY,MAAM;AAE3B,WAAO;AAAA,EACf;AACA;AC3EA,OAAO,OAAO,cAAc,MAAM;"}
@@ -20,6 +20,7 @@ export default class Stepper extends WJElement {
20
20
  localizer: Localizer;
21
21
  steps: any[];
22
22
  headerSteps: any[];
23
+ _stepperId: number;
23
24
  /**
24
25
  * Sets the start index for an operation or a process. This method assigns
25
26
  * the provided value to the attribute 'start-index'.
@@ -5,6 +5,7 @@ import { Localizer } from "./localize.js";
5
5
  import WJElement from "./wje-element.js";
6
6
  import { event } from "./event.js";
7
7
  const styles = '.container {\n display: flex;\n flex-direction: column;\n}\n\n.header {\n display: flex;\n justify-content: var(--wje-stepper-justify);\n margin-bottom: var(--wje-spacing-medium);\n}\n\n.step-header {\n display: flex;\n padding: var(--wje-spacing-medium);\n gap: var(--wje-spacing-x-small);\n color: var(--wje-color-contrast-5);\n flex-grow: var(--wje-stepper-grow);\n text-align: center;\n}\n\n.pointer {\n cursor: pointer;\n}\n\n[active] {\n color: var(--wje-color-contrast-11);\n}\n\n.content {\n margin-bottom: var(--wje-spacing-medium);\n}\n\n.arrow-icon {\n margin-top: var(--wje-stepper-margin);\n}\n\n.step {\n padding: var(--wje-spacing-medium);\n text-align: center;\n}\n\n[done] {\n color: var(--wje-color-contrast-11);\n}\n\n.nav-buttons {\n display: flex;\n justify-content: space-between;\n\n slot[hidden] {\n visibility: hidden;\n display: initial;\n }\n\n slot[disabled] {\n opacity: 0.5;\n pointer-events: none;\n cursor: not-allowed;\n\n /* after */\n ::after {\n content: "";\n display: block;\n width: 100%;\n height: 100%;\n background-color: var(--wje-color-contrast-2);\n position: absolute;\n top: 0;\n left: 0;\n opacity: .5;\n }\n }\n}';
8
+ let stepperId = 0;
8
9
  class Stepper extends WJElement {
9
10
  constructor() {
10
11
  super();
@@ -32,6 +33,7 @@ class Stepper extends WJElement {
32
33
  this.localizer = new Localizer(this);
33
34
  this.steps = [];
34
35
  this.headerSteps = [];
36
+ this._stepperId = ++stepperId;
35
37
  }
36
38
  /**
37
39
  * Sets the start index for an operation or a process. This method assigns
@@ -78,6 +80,7 @@ class Stepper extends WJElement {
78
80
  const header = document.createElement("div");
79
81
  header.setAttribute("part", "header");
80
82
  header.className = "header";
83
+ header.setAttribute("role", "tablist");
81
84
  const content = document.createElement("div");
82
85
  content.setAttribute("part", "content");
83
86
  content.className = "content";
@@ -144,6 +147,7 @@ class Stepper extends WJElement {
144
147
  processStep(index, step, header, steps) {
145
148
  const nav = document.createElement("div");
146
149
  nav.className = "step-header";
150
+ nav.setAttribute("role", "tab");
147
151
  nav.addEventListener("click", (e) => {
148
152
  this.goToStep(index);
149
153
  });
@@ -153,8 +157,18 @@ class Stepper extends WJElement {
153
157
  badge.innerHTML = index + 1;
154
158
  const label = document.createElement("span");
155
159
  label.innerText = step.getAttribute("label") || `${this.localizer.translate("wj.stepper.step")} ${index + 1}`;
160
+ const panelId = step.id || `wje-stepper-${this._stepperId}-panel-${index}`;
161
+ const tabId = nav.id || `wje-stepper-${this._stepperId}-tab-${index}`;
162
+ step.id = panelId;
163
+ nav.id = tabId;
164
+ nav.setAttribute("aria-controls", panelId);
165
+ step.setAttribute("role", "tabpanel");
166
+ step.setAttribute("aria-labelledby", tabId);
156
167
  if (index === this.currentStep || step.hasAttribute("active")) {
157
- this.setStepActive(nav, badge);
168
+ this.setStepActive(nav, badge, index);
169
+ } else {
170
+ nav.setAttribute("aria-selected", "false");
171
+ nav.setAttribute("tabindex", "-1");
158
172
  }
159
173
  if (step.hasAttribute("disabled")) {
160
174
  nav.setAttribute("disabled", "");
@@ -175,6 +189,9 @@ class Stepper extends WJElement {
175
189
  step.classList.add("step");
176
190
  if (index !== this.currentStep) {
177
191
  step.style.display = "none";
192
+ step.setAttribute("aria-hidden", "true");
193
+ } else {
194
+ step.setAttribute("aria-hidden", "false");
178
195
  }
179
196
  this.steps.push(step);
180
197
  return nav;
@@ -266,6 +283,8 @@ class Stepper extends WJElement {
266
283
  setStepDefault(nav, badge = null, stepIndex = 0) {
267
284
  nav.removeAttribute("active");
268
285
  nav.removeAttribute("done");
286
+ nav.setAttribute("aria-selected", "false");
287
+ nav.setAttribute("tabindex", "-1");
269
288
  if (!badge) {
270
289
  badge = nav.querySelector("wje-badge");
271
290
  }
@@ -280,6 +299,8 @@ class Stepper extends WJElement {
280
299
  */
281
300
  setStepActive(nav, badge = null, stepIndex = null) {
282
301
  nav.setAttribute("active", "");
302
+ nav.setAttribute("aria-selected", "true");
303
+ nav.setAttribute("tabindex", "0");
283
304
  if (!badge) {
284
305
  badge = nav.querySelector("wje-badge");
285
306
  }
@@ -295,8 +316,10 @@ class Stepper extends WJElement {
295
316
  (_a = this.steps) == null ? void 0 : _a.forEach((step, index) => {
296
317
  if (index === stepIndex) {
297
318
  step.style.display = "block";
319
+ step.setAttribute("aria-hidden", "false");
298
320
  } else {
299
321
  step.style.display = "none";
322
+ step.setAttribute("aria-hidden", "true");
300
323
  }
301
324
  });
302
325
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wje-stepper.js","sources":["../packages/wje-stepper/stepper.element.js","../packages/wje-stepper/stepper.js"],"sourcesContent":["import { Localizer } from '../utils/localize.js';\nimport { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Stepper` is a custom web component that represents a stepper.\n * @summary This element represents a stepper.\n * @documentation https://elements.webjet.sk/components/stepper\n * @status stable\n * @augments WJElement\n * @attribute {string} active - The active color for the stepper.\n * @attribute {string} done - The done color for the stepper.\n * @slot - The default slot for the stepper.\n * @csspart native - The native part of the stepper.\n * @csspart header - The header part of the stepper.\n * @csspart content - The content part of the stepper.\n * @tag wje-stepper\n */\nexport default class Stepper extends WJElement {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.currentStep = 0;\n\n\t\tthis.localizer = new Localizer(this);\n\t\tthis.steps = [];\n\t\tthis.headerSteps = [];\n\n\t}\n\n\t/**\n\t * Sets the start index for an operation or a process. This method assigns\n\t * the provided value to the attribute 'start-index'.\n\t * @param {number|string} value The value to set for the 'start-index' attribute.\n\t */\n\tset startIndex(value) {\n\t\tthis.setAttribute('start-index', value);\n\t}\n\n\t/**\n\t * Retrieves the starting index value stored as an attribute.\n\t * If the attribute 'start-index' exists and is not null, it parses the value as an integer and returns it.\n\t * If the attribute does not exist, it returns the default value of 0.\n\t * @returns {number} The starting index as an integer, or 0 if the attribute is not present.\n\t */\n\tget startIndex() {\n\t\tconst index = this.getAttribute('start-index');\n\t\treturn index !== null ? +index : 0;\n\t}\n\n\tget active() {\n\t\tif (this.hasAttribute('active')) return this.getAttribute('active');\n\n\t\treturn 'primary';\n\t}\n\n\tget done() {\n\t\tif (this.hasAttribute('done')) return this.getAttribute('done');\n\n\t\treturn 'success';\n\t}\n\n\tclassName = 'Stepper';\n\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t}\n\n\t/**\n\t * Draws the component for the stepper.\n\t * @returns {DocumentFragment}\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tconst native = document.createElement('div');\n\t\tnative.setAttribute('part', 'native');\n\t\tnative.className = 'native-stepper';\n\n\t\tconst header = document.createElement('div');\n\t\theader.setAttribute('part', 'header');\n\t\theader.className = 'header';\n\n\t\tconst content = document.createElement('div');\n\t\tcontent.setAttribute('part', 'content');\n\t\tcontent.className = 'content';\n\n\t\tconst steps = Array.from(this.children);\n\n\t\tsteps?.forEach((step, index) => {\n\t\t\tif (step.nodeName === 'WJE-STEP') {\n\t\t\t\tthis.headerSteps.push(this.processStep(index, step, header, steps));\n\t\t\t}\n\t\t});\n\n\t\tlet slot = document.createElement('slot');\n\n\t\tconst navButtons = document.createElement('div');\n\t\tnavButtons.className = 'nav-buttons';\n\n\t\tconst prevButton = document.createElement('wje-button');\n\t\tprevButton.setAttribute('label', this.localizer.translate('wj.stepper.button.previous'));\n\t\tprevButton.innerHTML = this.localizer.translate('wj.stepper.button.previous');\n\n\t\tlet nextButton = document.createElement('wje-button');\n\t\tnextButton.setAttribute('label', this.localizer.translate('wj.stepper.button.next'));\n\t\tnextButton.innerHTML = this.localizer.translate('wj.stepper.button.next');\n\n\t\tlet finishButton = document.createElement('wje-button');\n\t\tfinishButton.setAttribute('label', this.localizer.translate('wj.stepper.button.next'));\n\t\tfinishButton.innerHTML = this.localizer.translate('wj.stepper.button.finish');\n\t\tfinishButton.setAttribute('color', 'primary');\n\n\t\tconst navButtonPrevSlot = document.createElement('slot');\n\t\tnavButtonPrevSlot.setAttribute('name', 'prev');\n\t\tnavButtonPrevSlot.appendChild(prevButton);\n\t\tnavButtonPrevSlot.hidden = this.currentStep === 0;\n\n\t\tconst navButtonNextSlot = document.createElement('slot');\n\t\tnavButtonNextSlot.setAttribute('name', 'next');\n\t\tnavButtonNextSlot.appendChild(nextButton);\n\t\tnavButtonNextSlot.hidden = this.currentStep === this.steps.length - 1;\n\n\t\tconst navButtonFinishSlot = document.createElement('slot');\n\t\tnavButtonFinishSlot.setAttribute('name', 'finish');\n\t\tnavButtonFinishSlot.appendChild(nextButton);\n\t\tnavButtonFinishSlot.hidden = this.currentStep !== this.steps.length - 1;\n\n\t\tconst isNextLocked = this.headerSteps[this.currentStep + 1]?.hasAttribute('locked');\n\t\tnavButtonNextSlot.toggleAttribute('disabled', !!isNextLocked);\n\t\tnavButtonFinishSlot.toggleAttribute('disabled', !!isNextLocked);\n\n\t\tif (steps.length > 1) {\n\t\t\tnavButtonPrevSlot.appendChild(prevButton);\n\t\t\tnavButtonNextSlot.appendChild(nextButton);\n\t\t\tnavButtonFinishSlot.appendChild(finishButton);\n\t\t\tnavButtonFinishSlot.style.display = 'none';\n\n\t\t} else {\n\t\t\tnavButtonPrevSlot.hidden = true;\n\t\t\tnavButtonNextSlot.hidden = true;\n\t\t\tnavButtonPrevSlot.appendChild(prevButton);\n\t\t\tnavButtonNextSlot.appendChild(nextButton);\n\t\t\tnavButtonFinishSlot.appendChild(finishButton);\n\t\t}\n\n\t\tcontent.appendChild(slot);\n\n\t\tnative.appendChild(header);\n\t\tnative.appendChild(content);\n\t\tnative.appendChild(navButtons);\n\n\t\tnavButtons.appendChild(navButtonPrevSlot);\n\t\tnavButtons.appendChild(navButtonNextSlot);\n\t\tnavButtons.appendChild(navButtonFinishSlot);\n\n\t\tfragment.appendChild(native);\n\n\t\tthis.header = header;\n\t\tthis.prev = navButtonPrevSlot;\n\t\tthis.next = navButtonNextSlot;\n\t\tthis.finish = navButtonFinishSlot;\n\n\t\treturn fragment;\n\t}\n\n\tprocessStep(index, step, header, steps) {\n\t\tconst nav = document.createElement('div');\n\t\tnav.className = 'step-header';\n\t\tnav.addEventListener('click', (e) => {\n\t\t\tthis.goToStep(index)\n\t\t});\n\n\t\tconst badge = document.createElement('wje-badge');\n\t\tbadge.setAttribute('label', (index + 1).toString());\n\t\tbadge.className = 'step-badge';\n\t\tbadge.innerHTML = index + 1;\n\n\t\tconst label = document.createElement('span');\n\t\tlabel.innerText = step.getAttribute('label') || `${this.localizer.translate('wj.stepper.step')} ${index + 1}`; // default label\n\n\t\t// set active step\n\t\tif (index === this.currentStep || step.hasAttribute('active')) {\n\t\t\tthis.setStepActive(nav, badge);\n\t\t}\n\n\t\tif (step.hasAttribute('disabled')) {\n\t\t\tnav.setAttribute('disabled', '');\n\t\t\tthis.setStepLocked(nav, badge);\n\t\t} else {\n\t\t\tnav.classList.add('pointer');\n\t\t}\n\n\t\tnav.appendChild(badge);\n\t\tnav.appendChild(label);\n\n\t\theader.appendChild(nav);\n\n\t\tif (index < steps.length - 1) {\n\t\t\tconst arrowIcon = document.createElement('wje-icon');\n\t\t\tarrowIcon.setAttribute('name', 'chevron-right');\n\t\t\tarrowIcon.classList.add('arrow-icon');\n\t\t\tarrowIcon.setAttribute('size', 'small');\n\n\t\t\theader.appendChild(arrowIcon);\n\t\t}\n\n\t\tstep.classList.add('step');\n\t\tif (index !== this.currentStep) {\n\t\t\tstep.style.display = 'none';\n\t\t}\n\n\t\tthis.steps.push(step);\n\n\t\treturn nav\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tafterDraw() {\n\t\tif (this.steps.length <= 1) {\n\t\t\tthis.prev.hidden = true;\n\t\t}\n\n\t\tevent.addListener(this.prev, 'click', '', () => this.navigate(-1));\n\t\tevent.addListener(this.next, 'click', '', () => this.navigate(1));\n\t\tevent.addListener(this.finish, 'click', '', () => this.navigate(1));\n\n\t\trequestAnimationFrame(() => {\n\t\t\tthis.goToStep(this.startIndex);\n\t\t});\n\t}\n\n\t/**\n\t * Navigates to a different step in a multi-step process based on the provided direction.\n\t * @param {number} direction The navigation direction.\n\t * Use a positive value to move forward or a negative value to move backward.\n\t */\n\tnavigate(direction) {\n\t\tthis.goToStep(this.currentStep + direction);\n\t}\n\n\t/**\n\t * Navigates to a specific step in a workflow or process.\n\t * Executes a set of operations before and after the step transition.\n\t * @param {number} stepIndex The index of the step to navigate to.\n\t * @returns {void} This method does not return a value.\n\t */\n\tgoToStep(stepIndex) {\n\t\tPromise.resolve(this.beforeOpen(stepIndex, this.currentStep)).then((res) => {\n\t\t\tthis._executeGoToStep(stepIndex);\n\n\t\t\tPromise.resolve(this.afterOpen(stepIndex, this.currentStep));\n\t\t})\n\t\t.catch(console.error);\n\t}\n\n\t_executeGoToStep(stepIndex = 0) {\n\t\tif (stepIndex >= 0 && stepIndex < this.steps.length) {\n\t\t\tif (this.headerSteps[stepIndex].hasAttribute('disabled')) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (stepIndex > this.currentStep) {\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('stepper:next', { detail: { stepIndex }, bubbles: true, composed: true })\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('stepper:prev', { detail: { stepIndex }, bubbles: true, composed: true })\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.headerSteps.forEach((step, index) => {\n\t\t\t\tlet badge = step.querySelector('wje-badge');\n\n\t\t\t\tthis.setStepDefault(step, badge, index);\n\t\t\t\tif (index < stepIndex) this.setStepDone(step, badge);\n\t\t\t\tif (index > stepIndex && step.hasAttribute('disabled')) this.setStepLocked(step, badge, index);\n\t\t\t});\n\n\t\t\tthis.setStepActive(this.headerSteps[stepIndex], null, stepIndex);\n\t\t\tthis.setContentActive(stepIndex);\n\n\t\t\tthis.currentStep = stepIndex;\n\t\t\tthis.prev.hidden = this.currentStep === 0;\n\n\t\t\tconst isNextLocked = this.headerSteps[this.currentStep + 1]?.hasAttribute('locked');\n\t\t\tthis.next.toggleAttribute('disabled', !!isNextLocked);\n\t\t\tthis.finish.toggleAttribute('disabled', !!isNextLocked);\n\n\t\t\tif (this.currentStep === this.steps.length - 1) {\n\t\t\t\tthis.next.hidden = true;\n\t\t\t\tthis.finish.hidden = false;\n\t\t\t\tthis.finish.style.display = 'block';\n\t\t\t} else {\n\t\t\t\tthis.next.hidden = false;\n\t\t\t\tthis.finish.hidden = true;\n\t\t\t\tthis.finish.style.display = 'none';\n\t\t\t}\n\t\t} else if (stepIndex === this.steps.length) {\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('stepper:finish', { detail: { stepIndex }, bubbles: true, composed: true })\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Resets a step to its default state by clearing its active and done attributes.\n\t * Updates the step's badge to show its index and removes any color styling.\n\t * @param {HTMLElement} nav The navigation element representing the step.\n\t * @param {HTMLElement|null} [badge] The badge element within the step. If not provided, it will be selected from the `nav` element.\n\t * @param {number} [stepIndex] The index of the step, used to set the badge content.\n\t */\n\tsetStepDefault(nav, badge = null, stepIndex = 0) {\n\t\tnav.removeAttribute('active');\n\t\tnav.removeAttribute('done');\n\n\t\tif (!badge) {\n\t\t\tbadge = nav.querySelector('wje-badge');\n\t\t}\n\t\tbadge.innerHTML = stepIndex + 1;\n\t\tbadge.removeAttribute('color');\n\t}\n\n\t/**\n\t * Sets a step as active by adding the `active` attribute and updating the step's badge.\n\t * @param {HTMLElement} nav The navigation element representing the step to activate.\n\t * @param {HTMLElement|null} [badge] The badge element within the step. If not provided, it will be selected from the `nav` element.\n\t * @param {number|null} [stepIndex] The index of the step, used to set the badge content. Defaults to `null` if not provided.\n\t */\n\tsetStepActive(nav, badge = null, stepIndex = null) {\n\t\tnav.setAttribute('active', '');\n\n\t\tif (!badge) {\n\t\t\tbadge = nav.querySelector('wje-badge');\n\t\t}\n\t\tbadge.innerHTML = stepIndex + 1;\n\t\tbadge.setAttribute('color', this.active);\n\t}\n\n\t/**\n\t * Activates the content of a specific step by displaying it and hiding all others.\n\t * @param {number} stepIndex The index of the step whose content should be displayed.\n\t */\n\tsetContentActive(stepIndex) {\n\t\tthis.steps?.forEach((step, index) => {\n\t\t\tif (index === stepIndex) {\n\t\t\t\tstep.style.display = 'block';\n\t\t\t} else {\n\t\t\t\tstep.style.display = 'none';\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Returns the DOM element of a step by index.\n\t * @param {number} stepIndex\n\t * @returns {HTMLElement}\n\t */\n\tgetStepElement(stepIndex) {\n\t\treturn this.steps?.[stepIndex];\n\t}\n\n\t/**\n\t * Appends or replaces content inside the step container.\n\t * @param {number} stepIndex\n\t * @param {Node|string|Node[]} content DOM node(s) or HTML string to insert.\n\t * @param {{ replace?: boolean }} [options]\n\t */\n\trenderStepContent(stepIndex, content, options = {}) {\n\t\tconst stepEl = this.getStepElement(stepIndex);\n\t\tif (!stepEl) return;\n\n\t\tconst { replace = false } = options;\n\n\t\tlet frag = document.createDocumentFragment();\n\t\tif (typeof content === 'string') {\n\t\t\tconst tpl = document.createElement('template');\n\t\t\ttpl.innerHTML = content;\n\t\t\tfrag.append(tpl.content);\n\t\t} else if (Array.isArray(content)) {\n\t\t\tcontent.forEach(node => {\n\t\t\t\tif (node instanceof Node) frag.appendChild(node);\n\t\t\t});\n\t\t} else if (content instanceof Node) {\n\t\t\tfrag.append(content);\n\t\t}\n\n\t\tif (replace) {\n\t\t\tstepEl.replaceChildren(frag);\n\t\t} else {\n\t\t\tstepEl.append(frag);\n\t\t}\n\t}\n\n\t/**\n\t * Marks a step as completed by setting the `done` attribute and updating its badge with a check icon.\n\t * @param {HTMLElement} nav The navigation element representing the completed step.\n\t * @param {HTMLElement|null} [badge] The badge element within the step. If not provided, it will be selected from the `nav` element.\n\t */\n\tsetStepDone(nav, badge = null) {\n\t\tnav.setAttribute('done', '');\n\n\t\tconst checkIcon = document.createElement('wje-icon');\n\t\tcheckIcon.setAttribute('name', 'check');\n\t\tcheckIcon.setAttribute('color', this.done);\n\t\tcheckIcon.setAttribute('size', 'medium');\n\n\t\tif (!badge) {\n\t\t\tbadge = nav.querySelector('wje-badge');\n\t\t}\n\n\t\tbadge.setAttribute('color', this.done);\n\t\tbadge.innerHTML = '';\n\t\tbadge.appendChild(checkIcon);\n\t}\n\n\tsetStepLocked(nav, badge = null) {\n\t\tnav.setAttribute('disabled', '');\n\t\tnav.setAttribute('locked', '');\n\n\t\tconst lockIcon = document.createElement('wje-icon');\n\t\tlockIcon.setAttribute('name', 'lock');\n\t\tlockIcon.setAttribute('color', \"danger\");\n\t\tlockIcon.setAttribute('size', 'medium');\n\n\t\tif (!badge) {\n\t\t\tbadge = nav.querySelector('wje-badge');\n\t\t}\n\t\tbadge.innerHTML = '';\n\t\tbadge.removeAttribute('color');\n\t\tbadge.classList.add('disabled');\n\t\tbadge.appendChild(lockIcon);\n\t}\n\n\t/**\n\t * A callback function that is executed before opening a step in a process.\n\t * This allows for custom behavior or logic to be applied before the step is displayed.\n\t * @callback beforeOpen\n\t * @param {number} stepIndex The index of the step that is about to be opened.\n\t * @param {object} currentStep The current step data or configuration object before opening the new step.\n\t */\n\tbeforeOpen = (stepIndex, currentStep) => {\n\t\t// Override to add custom behavior before opening a step.\n\t}\n\n\t/**\n\t * Callback function executed after a step is opened.\n\t * This function can be overridden to implement custom behavior\n\t * that should take place immediately after a step is opened.\n\t * @function afterOpen\n\t * @param {number} stepIndex The index of the step that has been opened.\n\t * @param {object} currentStep The object representing the current step that has been opened.\n\t */\n\tafterOpen = (stepIndex, currentStep) => {\n\t\t// Override to add custom behavior after opening a step.\n\t}\n}\n","import Stepper from './stepper.element.js';\n\nexport default Stepper;\n\nStepper.define('wje-stepper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,aAAa,UAAU,EAAE;AAE7B,UAAM,WAAW,SAAS,cAAc,UAAU;AAClD,aAAS,aAAa,QAAQ,MAAM;AACpC,aAAS,aAAa,SAAS,QAAQ;AACvC,aAAS,aAAa,QAAQ,QAAQ;AAEtC,QAAI,CAAC,OAAO;AACX,cAAQ,IAAI,cAAc,WAAW;AAAA,IACxC;AACE,UAAM,YAAY;AAClB,UAAM,gBAAgB,OAAO;AAC7B,UAAM,UAAU,IAAI,UAAU;AAC9B,UAAM,YAAY,QAAQ;AAAA,EAC5B;AAwBA;AC1cA,QAAQ,OAAO,eAAe,OAAO;"}
1
+ {"version":3,"file":"wje-stepper.js","sources":["../packages/wje-stepper/stepper.element.js","../packages/wje-stepper/stepper.js"],"sourcesContent":["import { Localizer } from '../utils/localize.js';\nimport { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\nlet stepperId = 0;\n\n/**\n * `Stepper` is a custom web component that represents a stepper.\n * @summary This element represents a stepper.\n * @documentation https://elements.webjet.sk/components/stepper\n * @status stable\n * @augments WJElement\n * @attribute {string} active - The active color for the stepper.\n * @attribute {string} done - The done color for the stepper.\n * @slot - The default slot for the stepper.\n * @csspart native - The native part of the stepper.\n * @csspart header - The header part of the stepper.\n * @csspart content - The content part of the stepper.\n * @tag wje-stepper\n */\nexport default class Stepper extends WJElement {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.currentStep = 0;\n\n\t\tthis.localizer = new Localizer(this);\n\t\tthis.steps = [];\n\t\tthis.headerSteps = [];\n\t\tthis._stepperId = ++stepperId;\n\n\t}\n\n\t/**\n\t * Sets the start index for an operation or a process. This method assigns\n\t * the provided value to the attribute 'start-index'.\n\t * @param {number|string} value The value to set for the 'start-index' attribute.\n\t */\n\tset startIndex(value) {\n\t\tthis.setAttribute('start-index', value);\n\t}\n\n\t/**\n\t * Retrieves the starting index value stored as an attribute.\n\t * If the attribute 'start-index' exists and is not null, it parses the value as an integer and returns it.\n\t * If the attribute does not exist, it returns the default value of 0.\n\t * @returns {number} The starting index as an integer, or 0 if the attribute is not present.\n\t */\n\tget startIndex() {\n\t\tconst index = this.getAttribute('start-index');\n\t\treturn index !== null ? +index : 0;\n\t}\n\n\tget active() {\n\t\tif (this.hasAttribute('active')) return this.getAttribute('active');\n\n\t\treturn 'primary';\n\t}\n\n\tget done() {\n\t\tif (this.hasAttribute('done')) return this.getAttribute('done');\n\n\t\treturn 'success';\n\t}\n\n\tclassName = 'Stepper';\n\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t}\n\n\t/**\n\t * Draws the component for the stepper.\n\t * @returns {DocumentFragment}\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tconst native = document.createElement('div');\n\t\tnative.setAttribute('part', 'native');\n\t\tnative.className = 'native-stepper';\n\n\t\tconst header = document.createElement('div');\n\t\theader.setAttribute('part', 'header');\n\t\theader.className = 'header';\n\t\theader.setAttribute('role', 'tablist');\n\n\t\tconst content = document.createElement('div');\n\t\tcontent.setAttribute('part', 'content');\n\t\tcontent.className = 'content';\n\n\t\tconst steps = Array.from(this.children);\n\n\t\tsteps?.forEach((step, index) => {\n\t\t\tif (step.nodeName === 'WJE-STEP') {\n\t\t\t\tthis.headerSteps.push(this.processStep(index, step, header, steps));\n\t\t\t}\n\t\t});\n\n\t\tlet slot = document.createElement('slot');\n\n\t\tconst navButtons = document.createElement('div');\n\t\tnavButtons.className = 'nav-buttons';\n\n\t\tconst prevButton = document.createElement('wje-button');\n\t\tprevButton.setAttribute('label', this.localizer.translate('wj.stepper.button.previous'));\n\t\tprevButton.innerHTML = this.localizer.translate('wj.stepper.button.previous');\n\n\t\tlet nextButton = document.createElement('wje-button');\n\t\tnextButton.setAttribute('label', this.localizer.translate('wj.stepper.button.next'));\n\t\tnextButton.innerHTML = this.localizer.translate('wj.stepper.button.next');\n\n\t\tlet finishButton = document.createElement('wje-button');\n\t\tfinishButton.setAttribute('label', this.localizer.translate('wj.stepper.button.next'));\n\t\tfinishButton.innerHTML = this.localizer.translate('wj.stepper.button.finish');\n\t\tfinishButton.setAttribute('color', 'primary');\n\n\t\tconst navButtonPrevSlot = document.createElement('slot');\n\t\tnavButtonPrevSlot.setAttribute('name', 'prev');\n\t\tnavButtonPrevSlot.appendChild(prevButton);\n\t\tnavButtonPrevSlot.hidden = this.currentStep === 0;\n\n\t\tconst navButtonNextSlot = document.createElement('slot');\n\t\tnavButtonNextSlot.setAttribute('name', 'next');\n\t\tnavButtonNextSlot.appendChild(nextButton);\n\t\tnavButtonNextSlot.hidden = this.currentStep === this.steps.length - 1;\n\n\t\tconst navButtonFinishSlot = document.createElement('slot');\n\t\tnavButtonFinishSlot.setAttribute('name', 'finish');\n\t\tnavButtonFinishSlot.appendChild(nextButton);\n\t\tnavButtonFinishSlot.hidden = this.currentStep !== this.steps.length - 1;\n\n\t\tconst isNextLocked = this.headerSteps[this.currentStep + 1]?.hasAttribute('locked');\n\t\tnavButtonNextSlot.toggleAttribute('disabled', !!isNextLocked);\n\t\tnavButtonFinishSlot.toggleAttribute('disabled', !!isNextLocked);\n\n\t\tif (steps.length > 1) {\n\t\t\tnavButtonPrevSlot.appendChild(prevButton);\n\t\t\tnavButtonNextSlot.appendChild(nextButton);\n\t\t\tnavButtonFinishSlot.appendChild(finishButton);\n\t\t\tnavButtonFinishSlot.style.display = 'none';\n\n\t\t} else {\n\t\t\tnavButtonPrevSlot.hidden = true;\n\t\t\tnavButtonNextSlot.hidden = true;\n\t\t\tnavButtonPrevSlot.appendChild(prevButton);\n\t\t\tnavButtonNextSlot.appendChild(nextButton);\n\t\t\tnavButtonFinishSlot.appendChild(finishButton);\n\t\t}\n\n\t\tcontent.appendChild(slot);\n\n\t\tnative.appendChild(header);\n\t\tnative.appendChild(content);\n\t\tnative.appendChild(navButtons);\n\n\t\tnavButtons.appendChild(navButtonPrevSlot);\n\t\tnavButtons.appendChild(navButtonNextSlot);\n\t\tnavButtons.appendChild(navButtonFinishSlot);\n\n\t\tfragment.appendChild(native);\n\n\t\tthis.header = header;\n\t\tthis.prev = navButtonPrevSlot;\n\t\tthis.next = navButtonNextSlot;\n\t\tthis.finish = navButtonFinishSlot;\n\n\t\treturn fragment;\n\t}\n\n\tprocessStep(index, step, header, steps) {\n\t\tconst nav = document.createElement('div');\n\t\tnav.className = 'step-header';\n\t\tnav.setAttribute('role', 'tab');\n\t\tnav.addEventListener('click', (e) => {\n\t\t\tthis.goToStep(index)\n\t\t});\n\n\t\tconst badge = document.createElement('wje-badge');\n\t\tbadge.setAttribute('label', (index + 1).toString());\n\t\tbadge.className = 'step-badge';\n\t\tbadge.innerHTML = index + 1;\n\n\t\tconst label = document.createElement('span');\n\t\tlabel.innerText = step.getAttribute('label') || `${this.localizer.translate('wj.stepper.step')} ${index + 1}`; // default label\n\n\t\tconst panelId = step.id || `wje-stepper-${this._stepperId}-panel-${index}`;\n\t\tconst tabId = nav.id || `wje-stepper-${this._stepperId}-tab-${index}`;\n\t\tstep.id = panelId;\n\t\tnav.id = tabId;\n\t\tnav.setAttribute('aria-controls', panelId);\n\t\tstep.setAttribute('role', 'tabpanel');\n\t\tstep.setAttribute('aria-labelledby', tabId);\n\n\t\t// set active step\n\t\tif (index === this.currentStep || step.hasAttribute('active')) {\n\t\t\tthis.setStepActive(nav, badge, index);\n\t\t} else {\n\t\t\tnav.setAttribute('aria-selected', 'false');\n\t\t\tnav.setAttribute('tabindex', '-1');\n\t\t}\n\n\t\tif (step.hasAttribute('disabled')) {\n\t\t\tnav.setAttribute('disabled', '');\n\t\t\tthis.setStepLocked(nav, badge);\n\t\t} else {\n\t\t\tnav.classList.add('pointer');\n\t\t}\n\n\t\tnav.appendChild(badge);\n\t\tnav.appendChild(label);\n\n\t\theader.appendChild(nav);\n\n\t\tif (index < steps.length - 1) {\n\t\t\tconst arrowIcon = document.createElement('wje-icon');\n\t\t\tarrowIcon.setAttribute('name', 'chevron-right');\n\t\t\tarrowIcon.classList.add('arrow-icon');\n\t\t\tarrowIcon.setAttribute('size', 'small');\n\n\t\t\theader.appendChild(arrowIcon);\n\t\t}\n\n\t\tstep.classList.add('step');\n\t\tif (index !== this.currentStep) {\n\t\t\tstep.style.display = 'none';\n\t\t\tstep.setAttribute('aria-hidden', 'true');\n\t\t} else {\n\t\t\tstep.setAttribute('aria-hidden', 'false');\n\t\t}\n\n\t\tthis.steps.push(step);\n\n\t\treturn nav\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tafterDraw() {\n\t\tif (this.steps.length <= 1) {\n\t\t\tthis.prev.hidden = true;\n\t\t}\n\n\t\tevent.addListener(this.prev, 'click', '', () => this.navigate(-1));\n\t\tevent.addListener(this.next, 'click', '', () => this.navigate(1));\n\t\tevent.addListener(this.finish, 'click', '', () => this.navigate(1));\n\n\t\trequestAnimationFrame(() => {\n\t\t\tthis.goToStep(this.startIndex);\n\t\t});\n\t}\n\n\t/**\n\t * Navigates to a different step in a multi-step process based on the provided direction.\n\t * @param {number} direction The navigation direction.\n\t * Use a positive value to move forward or a negative value to move backward.\n\t */\n\tnavigate(direction) {\n\t\tthis.goToStep(this.currentStep + direction);\n\t}\n\n\t/**\n\t * Navigates to a specific step in a workflow or process.\n\t * Executes a set of operations before and after the step transition.\n\t * @param {number} stepIndex The index of the step to navigate to.\n\t * @returns {void} This method does not return a value.\n\t */\n\tgoToStep(stepIndex) {\n\t\tPromise.resolve(this.beforeOpen(stepIndex, this.currentStep)).then((res) => {\n\t\t\tthis._executeGoToStep(stepIndex);\n\n\t\t\tPromise.resolve(this.afterOpen(stepIndex, this.currentStep));\n\t\t})\n\t\t.catch(console.error);\n\t}\n\n\t_executeGoToStep(stepIndex = 0) {\n\t\tif (stepIndex >= 0 && stepIndex < this.steps.length) {\n\t\t\tif (this.headerSteps[stepIndex].hasAttribute('disabled')) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (stepIndex > this.currentStep) {\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('stepper:next', { detail: { stepIndex }, bubbles: true, composed: true })\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('stepper:prev', { detail: { stepIndex }, bubbles: true, composed: true })\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.headerSteps.forEach((step, index) => {\n\t\t\t\tlet badge = step.querySelector('wje-badge');\n\n\t\t\t\tthis.setStepDefault(step, badge, index);\n\t\t\t\tif (index < stepIndex) this.setStepDone(step, badge);\n\t\t\t\tif (index > stepIndex && step.hasAttribute('disabled')) this.setStepLocked(step, badge, index);\n\t\t\t});\n\n\t\t\tthis.setStepActive(this.headerSteps[stepIndex], null, stepIndex);\n\t\t\tthis.setContentActive(stepIndex);\n\n\t\t\tthis.currentStep = stepIndex;\n\t\t\tthis.prev.hidden = this.currentStep === 0;\n\n\t\t\tconst isNextLocked = this.headerSteps[this.currentStep + 1]?.hasAttribute('locked');\n\t\t\tthis.next.toggleAttribute('disabled', !!isNextLocked);\n\t\t\tthis.finish.toggleAttribute('disabled', !!isNextLocked);\n\n\t\t\tif (this.currentStep === this.steps.length - 1) {\n\t\t\t\tthis.next.hidden = true;\n\t\t\t\tthis.finish.hidden = false;\n\t\t\t\tthis.finish.style.display = 'block';\n\t\t\t} else {\n\t\t\t\tthis.next.hidden = false;\n\t\t\t\tthis.finish.hidden = true;\n\t\t\t\tthis.finish.style.display = 'none';\n\t\t\t}\n\t\t} else if (stepIndex === this.steps.length) {\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('stepper:finish', { detail: { stepIndex }, bubbles: true, composed: true })\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Resets a step to its default state by clearing its active and done attributes.\n\t * Updates the step's badge to show its index and removes any color styling.\n\t * @param {HTMLElement} nav The navigation element representing the step.\n\t * @param {HTMLElement|null} [badge] The badge element within the step. If not provided, it will be selected from the `nav` element.\n\t * @param {number} [stepIndex] The index of the step, used to set the badge content.\n\t */\n\tsetStepDefault(nav, badge = null, stepIndex = 0) {\n\t\tnav.removeAttribute('active');\n\t\tnav.removeAttribute('done');\n\t\tnav.setAttribute('aria-selected', 'false');\n\t\tnav.setAttribute('tabindex', '-1');\n\n\t\tif (!badge) {\n\t\t\tbadge = nav.querySelector('wje-badge');\n\t\t}\n\t\tbadge.innerHTML = stepIndex + 1;\n\t\tbadge.removeAttribute('color');\n\t}\n\n\t/**\n\t * Sets a step as active by adding the `active` attribute and updating the step's badge.\n\t * @param {HTMLElement} nav The navigation element representing the step to activate.\n\t * @param {HTMLElement|null} [badge] The badge element within the step. If not provided, it will be selected from the `nav` element.\n\t * @param {number|null} [stepIndex] The index of the step, used to set the badge content. Defaults to `null` if not provided.\n\t */\n\tsetStepActive(nav, badge = null, stepIndex = null) {\n\t\tnav.setAttribute('active', '');\n\t\tnav.setAttribute('aria-selected', 'true');\n\t\tnav.setAttribute('tabindex', '0');\n\n\t\tif (!badge) {\n\t\t\tbadge = nav.querySelector('wje-badge');\n\t\t}\n\t\tbadge.innerHTML = stepIndex + 1;\n\t\tbadge.setAttribute('color', this.active);\n\t}\n\n\t/**\n\t * Activates the content of a specific step by displaying it and hiding all others.\n\t * @param {number} stepIndex The index of the step whose content should be displayed.\n\t */\n\tsetContentActive(stepIndex) {\n\t\tthis.steps?.forEach((step, index) => {\n\t\t\tif (index === stepIndex) {\n\t\t\t\tstep.style.display = 'block';\n\t\t\t\tstep.setAttribute('aria-hidden', 'false');\n\t\t\t} else {\n\t\t\t\tstep.style.display = 'none';\n\t\t\t\tstep.setAttribute('aria-hidden', 'true');\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Returns the DOM element of a step by index.\n\t * @param {number} stepIndex\n\t * @returns {HTMLElement}\n\t */\n\tgetStepElement(stepIndex) {\n\t\treturn this.steps?.[stepIndex];\n\t}\n\n\t/**\n\t * Appends or replaces content inside the step container.\n\t * @param {number} stepIndex\n\t * @param {Node|string|Node[]} content DOM node(s) or HTML string to insert.\n\t * @param {{ replace?: boolean }} [options]\n\t */\n\trenderStepContent(stepIndex, content, options = {}) {\n\t\tconst stepEl = this.getStepElement(stepIndex);\n\t\tif (!stepEl) return;\n\n\t\tconst { replace = false } = options;\n\n\t\tlet frag = document.createDocumentFragment();\n\t\tif (typeof content === 'string') {\n\t\t\tconst tpl = document.createElement('template');\n\t\t\ttpl.innerHTML = content;\n\t\t\tfrag.append(tpl.content);\n\t\t} else if (Array.isArray(content)) {\n\t\t\tcontent.forEach(node => {\n\t\t\t\tif (node instanceof Node) frag.appendChild(node);\n\t\t\t});\n\t\t} else if (content instanceof Node) {\n\t\t\tfrag.append(content);\n\t\t}\n\n\t\tif (replace) {\n\t\t\tstepEl.replaceChildren(frag);\n\t\t} else {\n\t\t\tstepEl.append(frag);\n\t\t}\n\t}\n\n\t/**\n\t * Marks a step as completed by setting the `done` attribute and updating its badge with a check icon.\n\t * @param {HTMLElement} nav The navigation element representing the completed step.\n\t * @param {HTMLElement|null} [badge] The badge element within the step. If not provided, it will be selected from the `nav` element.\n\t */\n\tsetStepDone(nav, badge = null) {\n\t\tnav.setAttribute('done', '');\n\n\t\tconst checkIcon = document.createElement('wje-icon');\n\t\tcheckIcon.setAttribute('name', 'check');\n\t\tcheckIcon.setAttribute('color', this.done);\n\t\tcheckIcon.setAttribute('size', 'medium');\n\n\t\tif (!badge) {\n\t\t\tbadge = nav.querySelector('wje-badge');\n\t\t}\n\n\t\tbadge.setAttribute('color', this.done);\n\t\tbadge.innerHTML = '';\n\t\tbadge.appendChild(checkIcon);\n\t}\n\n\tsetStepLocked(nav, badge = null) {\n\t\tnav.setAttribute('disabled', '');\n\t\tnav.setAttribute('locked', '');\n\n\t\tconst lockIcon = document.createElement('wje-icon');\n\t\tlockIcon.setAttribute('name', 'lock');\n\t\tlockIcon.setAttribute('color', \"danger\");\n\t\tlockIcon.setAttribute('size', 'medium');\n\n\t\tif (!badge) {\n\t\t\tbadge = nav.querySelector('wje-badge');\n\t\t}\n\t\tbadge.innerHTML = '';\n\t\tbadge.removeAttribute('color');\n\t\tbadge.classList.add('disabled');\n\t\tbadge.appendChild(lockIcon);\n\t}\n\n\t/**\n\t * A callback function that is executed before opening a step in a process.\n\t * This allows for custom behavior or logic to be applied before the step is displayed.\n\t * @callback beforeOpen\n\t * @param {number} stepIndex The index of the step that is about to be opened.\n\t * @param {object} currentStep The current step data or configuration object before opening the new step.\n\t */\n\tbeforeOpen = (stepIndex, currentStep) => {\n\t\t// Override to add custom behavior before opening a step.\n\t}\n\n\t/**\n\t * Callback function executed after a step is opened.\n\t * This function can be overridden to implement custom behavior\n\t * that should take place immediately after a step is opened.\n\t * @function afterOpen\n\t * @param {number} stepIndex The index of the step that has been opened.\n\t * @param {object} currentStep The object representing the current step that has been opened.\n\t */\n\tafterOpen = (stepIndex, currentStep) => {\n\t\t// Override to add custom behavior after opening a step.\n\t}\n}\n","import Stepper from './stepper.element.js';\n\nexport default Stepper;\n\nStepper.define('wje-stepper', Stepper);\n"],"names":[],"mappings":";;;;;;;AAIA,IAAI,YAAY;AAgBD,MAAM,gBAAgB,UAAU;AAAA,EAC9C,cAAc;AACb,UAAO;AA0CR,qCAAY;AAwZZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sCAAa,CAAC,WAAW,gBAAgB;AAAA,IAE1C;AAUC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qCAAY,CAAC,WAAW,gBAAgB;AAAA,IAEzC;AA/cE,SAAK,cAAc;AAEnB,SAAK,YAAY,IAAI,UAAU,IAAI;AACnC,SAAK,QAAQ,CAAE;AACf,SAAK,cAAc,CAAE;AACrB,SAAK,aAAa,EAAE;AAAA,EAEtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOC,IAAI,WAAW,OAAO;AACrB,SAAK,aAAa,eAAe,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQC,IAAI,aAAa;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,SAAS;AAAA,EAC7B;AAAA,EAEC,cAAc,KAAK,QAAQ,MAAM;AAChC,QAAI,aAAa,YAAY,EAAE;AAC/B,QAAI,aAAa,UAAU,EAAE;AAE7B,UAAM,WAAW,SAAS,cAAc,UAAU;AAClD,aAAS,aAAa,QAAQ,MAAM;AACpC,aAAS,aAAa,SAAS,QAAQ;AACvC,aAAS,aAAa,QAAQ,QAAQ;AAEtC,QAAI,CAAC,OAAO;AACX,cAAQ,IAAI,cAAc,WAAW;AAAA,IACxC;AACE,UAAM,YAAY;AAClB,UAAM,gBAAgB,OAAO;AAC7B,UAAM,UAAU,IAAI,UAAU;AAC9B,UAAM,YAAY,QAAQ;AAAA,EAC5B;AAwBA;ACneA,QAAQ,OAAO,eAAe,OAAO;"}
@@ -57,10 +57,20 @@ export default class Tab extends WJElement {
57
57
  * @returns {DocumentFragment}
58
58
  */
59
59
  draw(): DocumentFragment;
60
+ slotEl: HTMLSlotElement;
60
61
  /**
61
62
  * Sets up event listeners after the component is rendered.
62
63
  * // @fires wje-tab:change - Dispatched when the component is clicked, indicating a tab change.
63
64
  */
64
65
  afterDraw(): void;
65
66
  unbindRouterLinks: any;
67
+ /**
68
+ * Sync aria-label on host based on slotted text when not provided.
69
+ */
70
+ syncAriaLabel(): void;
71
+ /**
72
+ * Sets the roving tabindex on the internal focusable anchor.
73
+ * @param {number} value
74
+ */
75
+ setRovingTabIndex(value: number): void;
66
76
  }
@@ -12,12 +12,14 @@ import { default as WJElement } from '../wje-element/element.js';
12
12
  * @tag wje-tab-group
13
13
  */
14
14
  export default class TabGroup extends WJElement {
15
+ static _instanceId: number;
15
16
  /**
16
17
  * Returns the CSS styles for the component.
17
18
  * @static
18
19
  * @returns {CSSStyleSheet}
19
20
  */
20
21
  static get cssStyleSheet(): CSSStyleSheet;
22
+ _instanceId: number;
21
23
  _lastNavWidth: any;
22
24
  _initialized: boolean;
23
25
  /**
@@ -90,6 +92,11 @@ export default class TabGroup extends WJElement {
90
92
  * @returns {Array<Element>} An array of all tabs.
91
93
  */
92
94
  getTabAll(): Array<Element>;
95
+ /**
96
+ * Returns all tabs, including those moved to "more".
97
+ * @returns {Array<Element>} An array of all tabs.
98
+ */
99
+ getAllTabs(): Array<Element>;
93
100
  /**
94
101
  * Returns all panels.
95
102
  * @returns {Array<Element>} An array of all panels.
@@ -128,4 +135,8 @@ export default class TabGroup extends WJElement {
128
135
  * @returns {void} This method does not return any value.
129
136
  */
130
137
  dropdownActive(el: HTMLElement): void;
138
+ /**
139
+ * Syncs ARIA attributes on tabs and panels.
140
+ */
141
+ syncAria(): void;
131
142
  }