wj-elements 0.3.0 → 0.3.1

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 (352) hide show
  1. package/dist/animations.js.map +1 -1
  2. package/dist/base-path.js.map +1 -1
  3. package/dist/date.js.map +1 -1
  4. package/dist/element-utils.js.map +1 -1
  5. package/dist/event.js.map +1 -1
  6. package/dist/form-associated-element-DEQ4y-jn.js.map +1 -1
  7. package/dist/icon-DVyMc4Wv.js.map +1 -1
  8. package/dist/localize.js.map +1 -1
  9. package/dist/{translations → packages/translations}/sk-sk.d.ts +5 -0
  10. package/dist/{wje-button → packages/wje-button}/button.element.d.ts +11 -0
  11. package/dist/{wje-dialog → packages/wje-dialog}/dialog.element.d.ts +2 -0
  12. package/dist/{wje-menu-item → packages/wje-menu-item}/menu-item.element.d.ts +2 -1
  13. package/dist/{wje-router-link → packages/wje-router-link}/router-link.element.d.ts +1 -0
  14. package/dist/{wje-tab → packages/wje-tab}/tab.element.d.ts +1 -0
  15. package/dist/{wje-tree-item → packages/wje-tree-item}/tree-item.element.d.ts +13 -0
  16. package/dist/permissions.js.map +1 -1
  17. package/dist/{popup.element-Cl6QeG8M.js → popup.element-DklicGea.js} +129 -96
  18. package/dist/popup.element-DklicGea.js.map +1 -0
  19. package/dist/{router-links-CJnOdbas.js → router-links-wjqCnncc.js} +9 -3
  20. package/dist/router-links-wjqCnncc.js.map +1 -0
  21. package/dist/universal-service.js.map +1 -1
  22. package/dist/utils.js.map +1 -1
  23. package/dist/wje-accordion-item.js.map +1 -1
  24. package/dist/wje-accordion.js.map +1 -1
  25. package/dist/wje-animation.js.map +1 -1
  26. package/dist/wje-aside.js.map +1 -1
  27. package/dist/wje-avatar.js.map +1 -1
  28. package/dist/wje-badge.js.map +1 -1
  29. package/dist/wje-breadcrumb.js.map +1 -1
  30. package/dist/wje-breadcrumbs.js.map +1 -1
  31. package/dist/wje-button-group.js.map +1 -1
  32. package/dist/wje-button.js +43 -18
  33. package/dist/wje-button.js.map +1 -1
  34. package/dist/wje-card-content.js.map +1 -1
  35. package/dist/wje-card-controls.js.map +1 -1
  36. package/dist/wje-card-header.js.map +1 -1
  37. package/dist/wje-card-subtitle.js.map +1 -1
  38. package/dist/wje-card-title.js.map +1 -1
  39. package/dist/wje-card.js.map +1 -1
  40. package/dist/wje-carousel-item.js.map +1 -1
  41. package/dist/wje-carousel.js.map +1 -1
  42. package/dist/wje-checkbox.js.map +1 -1
  43. package/dist/wje-chip.js.map +1 -1
  44. package/dist/wje-col.js.map +1 -1
  45. package/dist/wje-color-picker.js +2 -2
  46. package/dist/wje-color-picker.js.map +1 -1
  47. package/dist/wje-container.js.map +1 -1
  48. package/dist/wje-copy-button.js.map +1 -1
  49. package/dist/wje-dialog.js +20 -16
  50. package/dist/wje-dialog.js.map +1 -1
  51. package/dist/wje-divider.js.map +1 -1
  52. package/dist/wje-dropdown.js +1 -1
  53. package/dist/wje-dropdown.js.map +1 -1
  54. package/dist/wje-element.js.map +1 -1
  55. package/dist/wje-file-upload-item.js.map +1 -1
  56. package/dist/wje-file-upload.js.map +1 -1
  57. package/dist/wje-footer.js.map +1 -1
  58. package/dist/wje-form.js.map +1 -1
  59. package/dist/wje-format-digital.js.map +1 -1
  60. package/dist/wje-grid.js.map +1 -1
  61. package/dist/wje-header.js.map +1 -1
  62. package/dist/wje-icon-library.js.map +1 -1
  63. package/dist/wje-icon-picker.js.map +1 -1
  64. package/dist/wje-img-comparer.js.map +1 -1
  65. package/dist/wje-img.js.map +1 -1
  66. package/dist/wje-infinite-scroll.js.map +1 -1
  67. package/dist/wje-input-file.js.map +1 -1
  68. package/dist/wje-input.js.map +1 -1
  69. package/dist/wje-item.js.map +1 -1
  70. package/dist/wje-kanban.js.map +1 -1
  71. package/dist/wje-label.js.map +1 -1
  72. package/dist/wje-level-indicator.js.map +1 -1
  73. package/dist/wje-list.js.map +1 -1
  74. package/dist/wje-main.js.map +1 -1
  75. package/dist/wje-masonry.js.map +1 -1
  76. package/dist/wje-master.js +8 -3
  77. package/dist/wje-master.js.map +1 -1
  78. package/dist/wje-menu-button.js.map +1 -1
  79. package/dist/wje-menu-item.js +17 -3
  80. package/dist/wje-menu-item.js.map +1 -1
  81. package/dist/wje-menu-label.js.map +1 -1
  82. package/dist/wje-menu.js.map +1 -1
  83. package/dist/wje-option.js +11 -0
  84. package/dist/wje-option.js.map +1 -1
  85. package/dist/wje-options.js.map +1 -1
  86. package/dist/wje-orgchart-group.js.map +1 -1
  87. package/dist/wje-orgchart-item.js.map +1 -1
  88. package/dist/wje-orgchart.js.map +1 -1
  89. package/dist/wje-pagination.js.map +1 -1
  90. package/dist/wje-popup.js +1 -1
  91. package/dist/wje-progress-bar.js.map +1 -1
  92. package/dist/wje-qr-code.js +3 -3
  93. package/dist/wje-qr-code.js.map +1 -1
  94. package/dist/wje-radio-group.js.map +1 -1
  95. package/dist/wje-radio.js.map +1 -1
  96. package/dist/wje-rate.js.map +1 -1
  97. package/dist/wje-relative-time.js.map +1 -1
  98. package/dist/wje-reorder-dropzone.js.map +1 -1
  99. package/dist/wje-reorder-handle.js.map +1 -1
  100. package/dist/wje-reorder-item.js.map +1 -1
  101. package/dist/wje-reorder.js.map +1 -1
  102. package/dist/wje-route.js.map +1 -1
  103. package/dist/wje-router-link.js +12 -2
  104. package/dist/wje-router-link.js.map +1 -1
  105. package/dist/wje-router-outlet.js +15 -5
  106. package/dist/wje-router-outlet.js.map +1 -1
  107. package/dist/wje-routerx.js +64 -66
  108. package/dist/wje-routerx.js.map +1 -1
  109. package/dist/wje-row.js.map +1 -1
  110. package/dist/wje-select.js +1 -1
  111. package/dist/wje-select.js.map +1 -1
  112. package/dist/wje-slider.js.map +1 -1
  113. package/dist/wje-sliding-container.js.map +1 -1
  114. package/dist/wje-split-view.js.map +1 -1
  115. package/dist/wje-status.js.map +1 -1
  116. package/dist/wje-step.js.map +1 -1
  117. package/dist/wje-stepper.js.map +1 -1
  118. package/dist/wje-store.js.map +1 -1
  119. package/dist/wje-tab-group.js.map +1 -1
  120. package/dist/wje-tab-panel.js.map +1 -1
  121. package/dist/wje-tab.js +12 -2
  122. package/dist/wje-tab.js.map +1 -1
  123. package/dist/wje-textarea.js.map +1 -1
  124. package/dist/wje-thumbnail.js.map +1 -1
  125. package/dist/wje-toast.js.map +1 -1
  126. package/dist/wje-toggle.js.map +1 -1
  127. package/dist/wje-toolbar-action.js.map +1 -1
  128. package/dist/wje-toolbar.js.map +1 -1
  129. package/dist/wje-tooltip.js +1 -1
  130. package/dist/wje-tooltip.js.map +1 -1
  131. package/dist/wje-tree-item.js +32 -3
  132. package/dist/wje-tree-item.js.map +1 -1
  133. package/dist/wje-tree.js.map +1 -1
  134. package/dist/wje-visually-hidden.js.map +1 -1
  135. package/package.json +2 -2
  136. package/dist/popup.element-Cl6QeG8M.js.map +0 -1
  137. package/dist/router-links-CJnOdbas.js.map +0 -1
  138. /package/dist/{index.d.ts → packages/index.d.ts} +0 -0
  139. /package/dist/{internals → packages/internals}/form-associated-element.d.ts +0 -0
  140. /package/dist/{localize → packages/localize}/localize.d.ts +0 -0
  141. /package/dist/{translations → packages/translations}/en-gb.d.ts +0 -0
  142. /package/dist/{utils → packages/utils}/animations.d.ts +0 -0
  143. /package/dist/{utils → packages/utils}/base-path.d.ts +0 -0
  144. /package/dist/{utils → packages/utils}/date.d.ts +0 -0
  145. /package/dist/{utils → packages/utils}/element-utils.d.ts +0 -0
  146. /package/dist/{utils → packages/utils}/event.d.ts +0 -0
  147. /package/dist/{utils → packages/utils}/icon-library.d.ts +0 -0
  148. /package/dist/{utils → packages/utils}/localize.d.ts +0 -0
  149. /package/dist/{utils → packages/utils}/permissions.d.ts +0 -0
  150. /package/dist/{utils → packages/utils}/universal-service.d.ts +0 -0
  151. /package/dist/{utils → packages/utils}/utils.d.ts +0 -0
  152. /package/dist/{wje-accordion → packages/wje-accordion}/accordion.d.ts +0 -0
  153. /package/dist/{wje-accordion → packages/wje-accordion}/accordion.element.d.ts +0 -0
  154. /package/dist/{wje-accordion-item → packages/wje-accordion-item}/accordion-item.d.ts +0 -0
  155. /package/dist/{wje-accordion-item → packages/wje-accordion-item}/accordion-item.element.d.ts +0 -0
  156. /package/dist/{wje-animation → packages/wje-animation}/animation.d.ts +0 -0
  157. /package/dist/{wje-animation → packages/wje-animation}/animation.element.d.ts +0 -0
  158. /package/dist/{wje-aside → packages/wje-aside}/aside.d.ts +0 -0
  159. /package/dist/{wje-aside → packages/wje-aside}/aside.element.d.ts +0 -0
  160. /package/dist/{wje-avatar → packages/wje-avatar}/avatar.d.ts +0 -0
  161. /package/dist/{wje-avatar → packages/wje-avatar}/avatar.element.d.ts +0 -0
  162. /package/dist/{wje-avatar → packages/wje-avatar}/service/service.d.ts +0 -0
  163. /package/dist/{wje-badge → packages/wje-badge}/badge.d.ts +0 -0
  164. /package/dist/{wje-badge → packages/wje-badge}/badge.element.d.ts +0 -0
  165. /package/dist/{wje-breadcrumb → packages/wje-breadcrumb}/breadcrumb.d.ts +0 -0
  166. /package/dist/{wje-breadcrumb → packages/wje-breadcrumb}/breadcrumb.element.d.ts +0 -0
  167. /package/dist/{wje-breadcrumbs → packages/wje-breadcrumbs}/breadcrumbs.d.ts +0 -0
  168. /package/dist/{wje-breadcrumbs → packages/wje-breadcrumbs}/breadcrumbs.element.d.ts +0 -0
  169. /package/dist/{wje-button → packages/wje-button}/button.d.ts +0 -0
  170. /package/dist/{wje-button-group → packages/wje-button-group}/button-group.d.ts +0 -0
  171. /package/dist/{wje-button-group → packages/wje-button-group}/button-group.element.d.ts +0 -0
  172. /package/dist/{wje-card → packages/wje-card}/card.d.ts +0 -0
  173. /package/dist/{wje-card → packages/wje-card}/card.element.d.ts +0 -0
  174. /package/dist/{wje-card-content → packages/wje-card-content}/card-content.d.ts +0 -0
  175. /package/dist/{wje-card-content → packages/wje-card-content}/card-content.element.d.ts +0 -0
  176. /package/dist/{wje-card-controls → packages/wje-card-controls}/card-controls.d.ts +0 -0
  177. /package/dist/{wje-card-controls → packages/wje-card-controls}/card-controls.element.d.ts +0 -0
  178. /package/dist/{wje-card-header → packages/wje-card-header}/card-header.d.ts +0 -0
  179. /package/dist/{wje-card-header → packages/wje-card-header}/card-header.element.d.ts +0 -0
  180. /package/dist/{wje-card-subtitle → packages/wje-card-subtitle}/card-subtitle.d.ts +0 -0
  181. /package/dist/{wje-card-subtitle → packages/wje-card-subtitle}/card-subtitle.element.d.ts +0 -0
  182. /package/dist/{wje-card-title → packages/wje-card-title}/card-title.d.ts +0 -0
  183. /package/dist/{wje-card-title → packages/wje-card-title}/card-title.element.d.ts +0 -0
  184. /package/dist/{wje-carousel → packages/wje-carousel}/carousel.d.ts +0 -0
  185. /package/dist/{wje-carousel → packages/wje-carousel}/carousel.element.d.ts +0 -0
  186. /package/dist/{wje-carousel-item → packages/wje-carousel-item}/carousel-item.d.ts +0 -0
  187. /package/dist/{wje-carousel-item → packages/wje-carousel-item}/carousel-item.element.d.ts +0 -0
  188. /package/dist/{wje-checkbox → packages/wje-checkbox}/checkbox.d.ts +0 -0
  189. /package/dist/{wje-checkbox → packages/wje-checkbox}/checkbox.element.d.ts +0 -0
  190. /package/dist/{wje-chip → packages/wje-chip}/chip.d.ts +0 -0
  191. /package/dist/{wje-chip → packages/wje-chip}/chip.element.d.ts +0 -0
  192. /package/dist/{wje-col → packages/wje-col}/col.d.ts +0 -0
  193. /package/dist/{wje-col → packages/wje-col}/col.element.d.ts +0 -0
  194. /package/dist/{wje-color-picker → packages/wje-color-picker}/color-picker.d.ts +0 -0
  195. /package/dist/{wje-color-picker → packages/wje-color-picker}/color-picker.element.d.ts +0 -0
  196. /package/dist/{wje-container → packages/wje-container}/container.d.ts +0 -0
  197. /package/dist/{wje-container → packages/wje-container}/container.element.d.ts +0 -0
  198. /package/dist/{wje-copy-button → packages/wje-copy-button}/copy-button.d.ts +0 -0
  199. /package/dist/{wje-copy-button → packages/wje-copy-button}/copy-button.element.d.ts +0 -0
  200. /package/dist/{wje-copy-button → packages/wje-copy-button}/service/service.d.ts +0 -0
  201. /package/dist/{wje-dialog → packages/wje-dialog}/dialog.d.ts +0 -0
  202. /package/dist/{wje-divider → packages/wje-divider}/divider.d.ts +0 -0
  203. /package/dist/{wje-divider → packages/wje-divider}/divider.element.d.ts +0 -0
  204. /package/dist/{wje-dropdown → packages/wje-dropdown}/dropdown.d.ts +0 -0
  205. /package/dist/{wje-dropdown → packages/wje-dropdown}/dropdown.element.d.ts +0 -0
  206. /package/dist/{wje-element → packages/wje-element}/element.d.ts +0 -0
  207. /package/dist/{wje-file-upload → packages/wje-file-upload}/file-upload.d.ts +0 -0
  208. /package/dist/{wje-file-upload → packages/wje-file-upload}/file-upload.element.d.ts +0 -0
  209. /package/dist/{wje-file-upload → packages/wje-file-upload}/service/service.d.ts +0 -0
  210. /package/dist/{wje-file-upload-item → packages/wje-file-upload-item}/file-upload-item.d.ts +0 -0
  211. /package/dist/{wje-file-upload-item → packages/wje-file-upload-item}/file-upload-item.element.d.ts +0 -0
  212. /package/dist/{wje-footer → packages/wje-footer}/footer.d.ts +0 -0
  213. /package/dist/{wje-footer → packages/wje-footer}/footer.element.d.ts +0 -0
  214. /package/dist/{wje-form → packages/wje-form}/form.d.ts +0 -0
  215. /package/dist/{wje-form → packages/wje-form}/form.element.d.ts +0 -0
  216. /package/dist/{wje-format-digital → packages/wje-format-digital}/format-digital.d.ts +0 -0
  217. /package/dist/{wje-format-digital → packages/wje-format-digital}/format-digital.element.d.ts +0 -0
  218. /package/dist/{wje-grid → packages/wje-grid}/grid.d.ts +0 -0
  219. /package/dist/{wje-grid → packages/wje-grid}/grid.element.d.ts +0 -0
  220. /package/dist/{wje-header → packages/wje-header}/header.d.ts +0 -0
  221. /package/dist/{wje-header → packages/wje-header}/header.element.d.ts +0 -0
  222. /package/dist/{wje-icon → packages/wje-icon}/icon.d.ts +0 -0
  223. /package/dist/{wje-icon → packages/wje-icon}/icon.element.d.ts +0 -0
  224. /package/dist/{wje-icon → packages/wje-icon}/service/library.d.ts +0 -0
  225. /package/dist/{wje-icon → packages/wje-icon}/service/service.d.ts +0 -0
  226. /package/dist/{wje-icon-picker → packages/wje-icon-picker}/icon-picker.d.ts +0 -0
  227. /package/dist/{wje-icon-picker → packages/wje-icon-picker}/icon-picker.element.d.ts +0 -0
  228. /package/dist/{wje-img → packages/wje-img}/img.d.ts +0 -0
  229. /package/dist/{wje-img → packages/wje-img}/img.element.d.ts +0 -0
  230. /package/dist/{wje-img-comparer → packages/wje-img-comparer}/img-comparer.d.ts +0 -0
  231. /package/dist/{wje-img-comparer → packages/wje-img-comparer}/img-comparer.element.d.ts +0 -0
  232. /package/dist/{wje-img-comparer → packages/wje-img-comparer}/service/service.d.ts +0 -0
  233. /package/dist/{wje-infinite-scroll → packages/wje-infinite-scroll}/infinite-scroll.d.ts +0 -0
  234. /package/dist/{wje-infinite-scroll → packages/wje-infinite-scroll}/infinite-scroll.element.d.ts +0 -0
  235. /package/dist/{wje-input → packages/wje-input}/input.d.ts +0 -0
  236. /package/dist/{wje-input → packages/wje-input}/input.element.d.ts +0 -0
  237. /package/dist/{wje-input-file → packages/wje-input-file}/input-file.d.ts +0 -0
  238. /package/dist/{wje-input-file → packages/wje-input-file}/input-file.element.d.ts +0 -0
  239. /package/dist/{wje-item → packages/wje-item}/item.d.ts +0 -0
  240. /package/dist/{wje-item → packages/wje-item}/item.element.d.ts +0 -0
  241. /package/dist/{wje-kanban → packages/wje-kanban}/kanban.d.ts +0 -0
  242. /package/dist/{wje-kanban → packages/wje-kanban}/kanban.element.d.ts +0 -0
  243. /package/dist/{wje-label → packages/wje-label}/label.d.ts +0 -0
  244. /package/dist/{wje-label → packages/wje-label}/label.element.d.ts +0 -0
  245. /package/dist/{wje-level-indicator → packages/wje-level-indicator}/level-indicator.d.ts +0 -0
  246. /package/dist/{wje-level-indicator → packages/wje-level-indicator}/level-indicator.element.d.ts +0 -0
  247. /package/dist/{wje-list → packages/wje-list}/list.d.ts +0 -0
  248. /package/dist/{wje-list → packages/wje-list}/list.element.d.ts +0 -0
  249. /package/dist/{wje-main → packages/wje-main}/main.d.ts +0 -0
  250. /package/dist/{wje-main → packages/wje-main}/main.element.d.ts +0 -0
  251. /package/dist/{wje-masonry → packages/wje-masonry}/masonry.d.ts +0 -0
  252. /package/dist/{wje-masonry → packages/wje-masonry}/masonry.element.d.ts +0 -0
  253. /package/dist/{wje-masonry → packages/wje-masonry}/service/service.d.ts +0 -0
  254. /package/dist/{wje-menu → packages/wje-menu}/menu.d.ts +0 -0
  255. /package/dist/{wje-menu → packages/wje-menu}/menu.element.d.ts +0 -0
  256. /package/dist/{wje-menu-button → packages/wje-menu-button}/menu-button.d.ts +0 -0
  257. /package/dist/{wje-menu-button → packages/wje-menu-button}/menu-button.element.d.ts +0 -0
  258. /package/dist/{wje-menu-item → packages/wje-menu-item}/menu-item.d.ts +0 -0
  259. /package/dist/{wje-menu-label → packages/wje-menu-label}/menu-label.d.ts +0 -0
  260. /package/dist/{wje-menu-label → packages/wje-menu-label}/menu-label.element.d.ts +0 -0
  261. /package/dist/{wje-option → packages/wje-option}/option.d.ts +0 -0
  262. /package/dist/{wje-option → packages/wje-option}/option.element.d.ts +0 -0
  263. /package/dist/{wje-options → packages/wje-options}/options.d.ts +0 -0
  264. /package/dist/{wje-options → packages/wje-options}/options.element.d.ts +0 -0
  265. /package/dist/{wje-orgchart → packages/wje-orgchart}/orgchart.d.ts +0 -0
  266. /package/dist/{wje-orgchart → packages/wje-orgchart}/orgchart.element.d.ts +0 -0
  267. /package/dist/{wje-orgchart-group → packages/wje-orgchart-group}/orgchart-group.d.ts +0 -0
  268. /package/dist/{wje-orgchart-group → packages/wje-orgchart-group}/orgchart-group.element.d.ts +0 -0
  269. /package/dist/{wje-orgchart-item → packages/wje-orgchart-item}/orgchart-item.d.ts +0 -0
  270. /package/dist/{wje-orgchart-item → packages/wje-orgchart-item}/orgchart-item.element.d.ts +0 -0
  271. /package/dist/{wje-pagination → packages/wje-pagination}/pagination.d.ts +0 -0
  272. /package/dist/{wje-pagination → packages/wje-pagination}/pagination.element.d.ts +0 -0
  273. /package/dist/{wje-pagination → packages/wje-pagination}/service/service.d.ts +0 -0
  274. /package/dist/{wje-panel → packages/wje-panel}/panel.d.ts +0 -0
  275. /package/dist/{wje-panel → packages/wje-panel}/panel.element.d.ts +0 -0
  276. /package/dist/{wje-popup → packages/wje-popup}/popup.d.ts +0 -0
  277. /package/dist/{wje-popup → packages/wje-popup}/popup.element.d.ts +0 -0
  278. /package/dist/{wje-progress-bar → packages/wje-progress-bar}/progress-bar.d.ts +0 -0
  279. /package/dist/{wje-progress-bar → packages/wje-progress-bar}/progress-bar.element.d.ts +0 -0
  280. /package/dist/{wje-qr-code → packages/wje-qr-code}/qr-code.d.ts +0 -0
  281. /package/dist/{wje-qr-code → packages/wje-qr-code}/qr-code.element.d.ts +0 -0
  282. /package/dist/{wje-radio → packages/wje-radio}/radio.d.ts +0 -0
  283. /package/dist/{wje-radio → packages/wje-radio}/radio.element.d.ts +0 -0
  284. /package/dist/{wje-radio-group → packages/wje-radio-group}/radio-group.d.ts +0 -0
  285. /package/dist/{wje-radio-group → packages/wje-radio-group}/radio-group.element.d.ts +0 -0
  286. /package/dist/{wje-rate → packages/wje-rate}/rate.d.ts +0 -0
  287. /package/dist/{wje-rate → packages/wje-rate}/rate.element.d.ts +0 -0
  288. /package/dist/{wje-relative-time → packages/wje-relative-time}/relative-time.d.ts +0 -0
  289. /package/dist/{wje-relative-time → packages/wje-relative-time}/relative-time.element.d.ts +0 -0
  290. /package/dist/{wje-reorder → packages/wje-reorder}/reorder.d.ts +0 -0
  291. /package/dist/{wje-reorder → packages/wje-reorder}/reorder.element.d.ts +0 -0
  292. /package/dist/{wje-reorder-dropzone → packages/wje-reorder-dropzone}/reorder-dropzone.d.ts +0 -0
  293. /package/dist/{wje-reorder-dropzone → packages/wje-reorder-dropzone}/reorder-dropzone.element.d.ts +0 -0
  294. /package/dist/{wje-reorder-handle → packages/wje-reorder-handle}/reorder-handle.d.ts +0 -0
  295. /package/dist/{wje-reorder-handle → packages/wje-reorder-handle}/reorder-handle.element.d.ts +0 -0
  296. /package/dist/{wje-reorder-item → packages/wje-reorder-item}/reorder-item.d.ts +0 -0
  297. /package/dist/{wje-reorder-item → packages/wje-reorder-item}/reorder-item.element.d.ts +0 -0
  298. /package/dist/{wje-route → packages/wje-route}/route.d.ts +0 -0
  299. /package/dist/{wje-route → packages/wje-route}/route.element.d.ts +0 -0
  300. /package/dist/{wje-router → packages/wje-router}/router.d.ts +0 -0
  301. /package/dist/{wje-router → packages/wje-router}/router.element.d.ts +0 -0
  302. /package/dist/{wje-router-link → packages/wje-router-link}/router-link.d.ts +0 -0
  303. /package/dist/{wje-router-outlet → packages/wje-router-outlet}/router-outlet.d.ts +0 -0
  304. /package/dist/{wje-router-outlet → packages/wje-router-outlet}/router-outlet.element.d.ts +0 -0
  305. /package/dist/{wje-row → packages/wje-row}/row.d.ts +0 -0
  306. /package/dist/{wje-row → packages/wje-row}/row.element.d.ts +0 -0
  307. /package/dist/{wje-select → packages/wje-select}/select.d.ts +0 -0
  308. /package/dist/{wje-select → packages/wje-select}/select.element.d.ts +0 -0
  309. /package/dist/{wje-slider → packages/wje-slider}/slider.d.ts +0 -0
  310. /package/dist/{wje-slider → packages/wje-slider}/slider.element.d.ts +0 -0
  311. /package/dist/{wje-sliding-container → packages/wje-sliding-container}/sliding-container.d.ts +0 -0
  312. /package/dist/{wje-sliding-container → packages/wje-sliding-container}/sliding-container.element.d.ts +0 -0
  313. /package/dist/{wje-split-view → packages/wje-split-view}/service/service.d.ts +0 -0
  314. /package/dist/{wje-split-view → packages/wje-split-view}/split-view.d.ts +0 -0
  315. /package/dist/{wje-split-view → packages/wje-split-view}/split-view.element.d.ts +0 -0
  316. /package/dist/{wje-status → packages/wje-status}/status.d.ts +0 -0
  317. /package/dist/{wje-status → packages/wje-status}/status.element.d.ts +0 -0
  318. /package/dist/{wje-step → packages/wje-step}/step.d.ts +0 -0
  319. /package/dist/{wje-step → packages/wje-step}/step.element.d.ts +0 -0
  320. /package/dist/{wje-stepper → packages/wje-stepper}/stepper.d.ts +0 -0
  321. /package/dist/{wje-stepper → packages/wje-stepper}/stepper.element.d.ts +0 -0
  322. /package/dist/{wje-store → packages/wje-store}/default-store-actions.d.ts +0 -0
  323. /package/dist/{wje-store → packages/wje-store}/pubsub.d.ts +0 -0
  324. /package/dist/{wje-store → packages/wje-store}/store.d.ts +0 -0
  325. /package/dist/{wje-tab → packages/wje-tab}/tab.d.ts +0 -0
  326. /package/dist/{wje-tab-group → packages/wje-tab-group}/tab-group.d.ts +0 -0
  327. /package/dist/{wje-tab-group → packages/wje-tab-group}/tab-group.element.d.ts +0 -0
  328. /package/dist/{wje-tab-panel → packages/wje-tab-panel}/tab-panel.d.ts +0 -0
  329. /package/dist/{wje-tab-panel → packages/wje-tab-panel}/tab-panel.element.d.ts +0 -0
  330. /package/dist/{wje-textarea → packages/wje-textarea}/textarea.d.ts +0 -0
  331. /package/dist/{wje-textarea → packages/wje-textarea}/textarea.element.d.ts +0 -0
  332. /package/dist/{wje-thumbnail → packages/wje-thumbnail}/thumbnail.d.ts +0 -0
  333. /package/dist/{wje-thumbnail → packages/wje-thumbnail}/thumbnail.element.d.ts +0 -0
  334. /package/dist/{wje-timeline → packages/wje-timeline}/timeline.d.ts +0 -0
  335. /package/dist/{wje-timeline → packages/wje-timeline}/timeline.element.d.ts +0 -0
  336. /package/dist/{wje-timeline-item → packages/wje-timeline-item}/timeline-item.d.ts +0 -0
  337. /package/dist/{wje-timeline-item → packages/wje-timeline-item}/timeline-item.element.d.ts +0 -0
  338. /package/dist/{wje-toast → packages/wje-toast}/toast.d.ts +0 -0
  339. /package/dist/{wje-toast → packages/wje-toast}/toast.element.d.ts +0 -0
  340. /package/dist/{wje-toggle → packages/wje-toggle}/toggle.d.ts +0 -0
  341. /package/dist/{wje-toggle → packages/wje-toggle}/toggle.element.d.ts +0 -0
  342. /package/dist/{wje-toolbar → packages/wje-toolbar}/toolbar.d.ts +0 -0
  343. /package/dist/{wje-toolbar → packages/wje-toolbar}/toolbar.element.d.ts +0 -0
  344. /package/dist/{wje-toolbar-action → packages/wje-toolbar-action}/toolbar-action.d.ts +0 -0
  345. /package/dist/{wje-toolbar-action → packages/wje-toolbar-action}/toolbar-action.element.d.ts +0 -0
  346. /package/dist/{wje-tooltip → packages/wje-tooltip}/tooltip.d.ts +0 -0
  347. /package/dist/{wje-tooltip → packages/wje-tooltip}/tooltip.element.d.ts +0 -0
  348. /package/dist/{wje-tree → packages/wje-tree}/tree.d.ts +0 -0
  349. /package/dist/{wje-tree → packages/wje-tree}/tree.element.d.ts +0 -0
  350. /package/dist/{wje-tree-item → packages/wje-tree-item}/tree-item.d.ts +0 -0
  351. /package/dist/{wje-visually-hidden → packages/wje-visually-hidden}/visually-hidden.d.ts +0 -0
  352. /package/dist/{wje-visually-hidden → packages/wje-visually-hidden}/visually-hidden.element.d.ts +0 -0
@@ -303,6 +303,8 @@ const _Dialog = class _Dialog extends WJElement {
303
303
  Promise.resolve(this.beforeOpen(this, e)).then((res) => {
304
304
  this.htmlDialogBody(this.dialog);
305
305
  this.dialog.showModal();
306
+ this.syncHostOpenState();
307
+ this.dialog.setAttribute("aria-modal", "true");
306
308
  if (this.dialog.open) {
307
309
  Promise.resolve(this.afterOpen(this, e));
308
310
  }
@@ -316,11 +318,22 @@ const _Dialog = class _Dialog extends WJElement {
316
318
  __publicField(this, "onClose", (e) => {
317
319
  Promise.resolve(this.beforeClose(this, e)).then((res) => {
318
320
  this.dialog.close();
321
+ this.dialog.removeAttribute("aria-modal");
322
+ this.syncHostOpenState();
319
323
  if (!this.dialog.open) {
320
324
  Promise.resolve(this.afterClose(this, e));
321
325
  }
322
326
  });
323
327
  });
328
+ __publicField(this, "onNativeDialogClose", () => {
329
+ var _a;
330
+ (_a = this.dialog) == null ? void 0 : _a.removeAttribute("aria-modal");
331
+ this.removeAttribute("open");
332
+ });
333
+ __publicField(this, "syncHostOpenState", () => {
334
+ var _a;
335
+ this.toggleAttribute("open", !!((_a = this.dialog) == null ? void 0 : _a.open));
336
+ });
324
337
  this._instanceId = ++_Dialog._instanceId;
325
338
  }
326
339
  /**
@@ -425,8 +438,10 @@ const _Dialog = class _Dialog extends WJElement {
425
438
  let dialog = document.createElement("dialog");
426
439
  dialog.setAttribute("part", "dialog");
427
440
  dialog.classList.add("modal-dialog");
441
+ dialog.addEventListener("close", this.onNativeDialogClose);
428
442
  fragment.appendChild(dialog);
429
443
  this.dialog = dialog;
444
+ this.syncHostOpenState();
430
445
  return fragment;
431
446
  }
432
447
  /**
@@ -491,30 +506,18 @@ const _Dialog = class _Dialog extends WJElement {
491
506
  dialog.appendChild(body);
492
507
  if (!this.hiddenFooter) dialog.appendChild(footer);
493
508
  dialog.setAttribute("role", "dialog");
494
- dialog.setAttribute("aria-modal", "true");
495
509
  dialog.setAttribute("aria-describedby", body.id);
496
510
  if (!this.hiddenHeader) {
497
511
  dialog.setAttribute("aria-labelledby", header.id);
512
+ dialog.removeAttribute("aria-label");
498
513
  } else {
499
514
  dialog.removeAttribute("aria-labelledby");
500
- }
501
- const ariaState = {
502
- role: "dialog",
503
- modal: true,
504
- describedBy: body.id
505
- };
506
- if (!this.hiddenHeader) {
507
- ariaState.labelledBy = header.id;
508
- this.removeAttribute("aria-label");
509
- } else {
510
- this.removeAttribute("aria-labelledby");
511
515
  if (this.headline) {
512
- ariaState.label = this.headline;
516
+ dialog.setAttribute("aria-label", this.headline);
513
517
  } else {
514
- this.removeAttribute("aria-label");
518
+ dialog.removeAttribute("aria-label");
515
519
  }
516
520
  }
517
- this.setAriaState(ariaState);
518
521
  Promise.resolve().then(() => this.updateHasFooter());
519
522
  }
520
523
  /**
@@ -528,10 +531,11 @@ const _Dialog = class _Dialog extends WJElement {
528
531
  * Before the component is disconnected.
529
532
  */
530
533
  beforeDisconnect() {
531
- var _a, _b;
534
+ var _a, _b, _c;
532
535
  if ((_a = this.params) == null ? void 0 : _a.trigger) {
533
536
  event.removeListener(document, (_b = this.params) == null ? void 0 : _b.trigger, null, this.onOpen);
534
537
  }
538
+ (_c = this.dialog) == null ? void 0 : _c.removeEventListener("close", this.onNativeDialogClose);
535
539
  }
536
540
  /**
537
541
  * Before the dialog opens.
@@ -1 +1 @@
1
- {"version":3,"file":"wje-dialog.js","sources":["../packages/wje-dialog/dialog.element.js","../packages/wje-dialog/dialog.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport '../wje-button/button.element.js';\nimport '../wje-icon/icon.element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Dialog` is a custom web component that represents a dialog.\n * @summary This element represents a dialog.\n * @documentation https://elements.webjet.sk/components/dialog\n * @status stable\n * @augments {WJElement}\n * @slot header - Slot for the header content.\n * @slot body - Slot for the body content.\n * @slot footer - Slot for the footer content.\n * @csspart dialog - The dialog wrapper.\n * @csspart header - The header of the dialog.\n * @csspart body - The body of the dialog.\n * @csspart footer - The footer of the dialog.\n * @csspart close - The close button of the dialog.\n * @cssproperty [--wje-dialog-background=var(--wje-background-color)] - Specifies the background color of the dialog.\n * @cssproperty [--wje-dialog-color=var(--wje-text-color)] - Defines the text color within the dialog.\n * @cssproperty [--wje-dialog-padding=1rem] - Controls the padding inside the dialog.\n * @cssproperty [--wje-dialog-border-radius=0.5rem] - Sets the border radius for the dialog's corners.\n * @cssproperty [--wje-dialog-box-shadow=0 2px 10px rgba(0, 0, 0, 0.1)] - Applies a shadow effect to the dialog.\n * @tag wje-dialog\n */\n\nexport default class Dialog extends WJElement {\n static _instanceId = 0;\n /**\n * @class\n */\n constructor() {\n super();\n this._instanceId = ++Dialog._instanceId;\n }\n\n /**\n * Sets the value of the 'headline' attribute.\n * @param {string} value The new value for the 'headline' attribute.\n */\n set headline(value) {\n this.setAttribute('headline', value);\n }\n\n /**\n * Retrieves the value of the \"headline\" attribute from the element.\n * If the \"headline\" attribute is not present, returns an empty string.\n * @returns {string} The headline attribute value or an empty string if not set.\n */\n get headline() {\n return this.getAttribute('headline') || '';\n }\n\n /**\n * Sets the headline of the dialog.\n * @param value\n */\n set placement(value) {\n this.setAttribute('placement', value);\n }\n\n /**\n * Gets the headline of the dialog.\n * @returns {string|string}\n */\n get placement() {\n return this.getAttribute('placement') || 'slide-up';\n }\n\n /**\n * Sets the headline of the dialog.\n * @param value\n */\n set async(value) {\n this.setAttribute('async', '');\n }\n\n /**\n * Gets the headline of the dialog.\n * @returns {boolean}\n */\n get async() {\n return this.hasAttribute('async');\n }\n\n /**\n * Sets the headline of the dialog.\n * @param value\n */\n set closeHidden(value) {\n if (value) this.setAttribute('close-hidden', '');\n }\n\n /**\n * Gets the headline of the dialog.\n * @returns {boolean}\n */\n get closeHidden() {\n return !!this.hasAttribute('close-hidden');\n }\n\n set hiddenHeader(value) {\n if (value) this.setAttribute('hidden-header', '');\n }\n\n get hiddenHeader() {\n return !!this.hasAttribute('hidden-header');\n }\n\n set hiddenFooter(value) {\n if (value) this.setAttribute('hidden-footer', '');\n }\n\n get hiddenFooter() {\n return !!this.hasAttribute('hidden-footer');\n }\n\n /**\n * Sets the headline of the dialog.\n * @type {string}\n */\n className = 'Dialog';\n\n /**\n * Returns the CSS styles for the component.\n * @returns {*}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @returns {*[]}\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.\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 this.classList.add('fade', this.placement, params.size);\n\n let dialog = document.createElement('dialog');\n dialog.setAttribute('part', 'dialog');\n dialog.classList.add('modal-dialog');\n\n fragment.appendChild(dialog);\n\n this.dialog = dialog;\n\n return fragment;\n }\n\n /**\n * Draws the component after it has been drawn.\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 */\n afterDraw(context, store, params) {\n if (params.trigger) {\n event.addListener(document, params.trigger, null, this.onOpen);\n }\n }\n\n /**\n * Creates the dialog body.\n * @param dialog\n */\n htmlDialogBody(dialog) {\n const dialogId = this.id || `wje-dialog-${this._instanceId}`;\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('name', 'x');\n icon.setAttribute('slot', 'icon-only');\n\n let close = document.createElement('wje-button');\n close.setAttribute('fill', 'link');\n close.setAttribute('size', 'small');\n close.setAttribute('part', 'close');\n close.setAttribute('aria-label', 'Close dialog');\n close.addEventListener('click', (e) => {\n this.close(e);\n });\n\n let header = document.createElement('div');\n header.setAttribute('part', 'header');\n header.classList.add('dialog-header');\n header.id = `${dialogId}-header`;\n if (this.hasAttribute('headline'))\n header.innerHTML = `<span part=\"headline\">${this.headline}</span>`;\n\n let slotHeader = document.createElement('slot');\n slotHeader.setAttribute('name', 'header');\n\n const headerActions = document.createElement('div');\n headerActions.classList.add('header-actions');\n headerActions.setAttribute('part', 'header-actions');\n headerActions.appendChild(slotHeader);\n\n let contentSlot = document.createElement('slot');\n\n let body = document.createElement('div');\n body.setAttribute('part', 'body');\n body.classList.add('dialog-content');\n body.id = `${dialogId}-body`;\n\n let footer = document.createElement('div');\n footer.setAttribute('part', 'footer');\n footer.classList.add('dialog-footer');\n footer.innerHTML = '';\n\n let slotFooter = document.createElement('slot');\n slotFooter.setAttribute('name', 'footer');\n slotFooter.id = 'footerSlot';\n slotFooter.addEventListener('slotchange', () => this.updateHasFooter());\n\n close.appendChild(icon);\n\n if (!this.closeHidden) header.appendChild(close);\n\n header.appendChild(headerActions);\n body.appendChild(contentSlot);\n footer.appendChild(slotFooter);\n\n if (!this.hiddenHeader) dialog.appendChild(header);\n dialog.appendChild(body);\n if (!this.hiddenFooter) dialog.appendChild(footer);\n\n dialog.setAttribute('role', 'dialog');\n dialog.setAttribute('aria-modal', 'true');\n dialog.setAttribute('aria-describedby', body.id);\n if (!this.hiddenHeader) {\n dialog.setAttribute('aria-labelledby', header.id);\n } else {\n dialog.removeAttribute('aria-labelledby');\n }\n\n const ariaState = {\n role: 'dialog',\n modal: true,\n describedBy: body.id,\n };\n\n if (!this.hiddenHeader) {\n ariaState.labelledBy = header.id;\n this.removeAttribute('aria-label');\n } else {\n this.removeAttribute('aria-labelledby');\n if (this.headline) {\n ariaState.label = this.headline;\n } else {\n this.removeAttribute('aria-label');\n }\n }\n\n this.setAriaState(ariaState);\n\n Promise.resolve().then(() => this.updateHasFooter());\n }\n\n /**\n * Closes the dialog.\n * @param e\n */\n close(e) {\n this.onClose(e);\n }\n\n /**\n * Before the component is disconnected.\n */\n beforeDisconnect() {\n if (this.params?.trigger) {\n event.removeListener(document, this.params?.trigger, null, this.onOpen);\n }\n\n //this.dialog.removeEventListener('close', this.onClose);\n }\n\n /**\n * Before the dialog opens.\n */\n beforeOpen(dialog, trigger) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * After the dialog opens.\n */\n afterOpen(dialog, trigger) {\n // Hook for extending behavior after the dialog opens\n }\n\n /**\n * Before the dialog closes.\n */\n beforeClose(dialog, trigger) {\n // Hook for extending behavior before the dialog closes\n }\n\n /**\n * After the dialog closes.\n */\n afterClose(dialog, trigger) {\n // Hook for extending behavior after the dialog closes\n }\n\n /**\n * Opens the dialog.\n * @param e\n */\n onOpen = (e) => {\n if (this.dialog) {\n this.dialog.innerHTML = '';\n }\n\n setTimeout(() => {\n Promise.resolve(this.beforeOpen(this, e)).then((res) => {\n this.htmlDialogBody(this.dialog);\n\n this.dialog.showModal(); // Now open the dialog\n\n if (this.dialog.open) {\n Promise.resolve(this.afterOpen(this, e));\n }\n });\n }, 0);\n }\n\n /**\n * Closes the dialog.\n * @param {object} e\n */\n onClose = (e) => {\n Promise.resolve(this.beforeClose(this, e)).then((res) => {\n this.dialog.close(); // Now close the dialog\n\n if (!this.dialog.open) {\n Promise.resolve(this.afterClose(this, e));\n }\n });\n };\n\n /**\n * Registers an event listener on the provided button that triggers a blocking UI element\n * and executes a given promise when the button is clicked.\n * @param {HTMLElement} button The button element to attach the event listener to.\n * @param {Function} promise A function that returns a promise to be executed when the button is clicked.\n */\n registerBlockingEvent(button, promise) {\n button.addEventListener('wje-button:click', async (e) => {\n let blockingElement = document.createElement('div');\n blockingElement.classList.add('blocking-element');\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('name', 'loader-2');\n icon.setAttribute('size', '2x-large');\n\n blockingElement.appendChild(icon);\n\n let scrollOffset = this.dialog.scrollTop;\n blockingElement.style.top = `${scrollOffset}px`;\n blockingElement.style.bottom = `-${scrollOffset}px`;\n\n this.dialog.appendChild(blockingElement);\n\n await promise()\n .then((res) => {\n this.close();\n blockingElement.remove();\n })\n .catch((err) => {\n console.error(err);\n blockingElement.remove();\n });\n });\n }\n\n updateHasFooter() {\n // If footer is intentionally hidden, ensure it doesn't reserve space\n if (this.hiddenFooter) {\n const footerEl = this.shadowRoot?.querySelector('.dialog-footer');\n if (footerEl) footerEl.setAttribute('hidden', '');\n this.removeAttribute('has-footer');\n return;\n }\n const slot = this.shadowRoot?.getElementById('footerSlot');\n if (!slot) {\n this.removeAttribute('has-footer');\n return;\n }\n\n const assigned = slot.assignedNodes({ flatten: true });\n const hasContent = assigned.some((n) => {\n if (n.nodeType === Node.ELEMENT_NODE) return true;\n if (n.nodeType === Node.TEXT_NODE) return n.textContent.trim().length > 0;\n return false;\n });\n\n // Prefer toggling the actual footer element so CSS/spacing is always correct\n const footerEl = this.shadowRoot?.querySelector('.dialog-footer');\n if (footerEl) footerEl.toggleAttribute('hidden', !hasContent);\n\n // Keep host attribute too (harmless, may be used elsewhere)\n this.toggleAttribute('has-footer', hasContent);\n }\n}\n","import Dialog from './dialog.element.js';\n\nexport default Dialog;\n\nDialog.define('wje-dialog', Dialog);\n"],"names":["footerEl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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K,MAAO;AACZ,wBAAgB,OAAQ;AAAA,MAC3B,CAAA,EACA,MAAM,CAAC,QAAQ;AACZ,gBAAQ,MAAM,GAAG;AACjB,wBAAgB,OAAQ;AAAA,MAC5C,CAAiB;AAAA,IACjB,CAAS;AAAA,EACT;AAAA,EAEI,kBAAkB;;AAEd,QAAI,KAAK,cAAc;AACnB,YAAMA,aAAW,UAAK,eAAL,mBAAiB,cAAc;AAChD,UAAIA,UAAU,CAAAA,UAAS,aAAa,UAAU,EAAE;AAChD,WAAK,gBAAgB,YAAY;AACjC;AAAA,IACZ;AACQ,UAAM,QAAO,UAAK,eAAL,mBAAiB,eAAe;AAC7C,QAAI,CAAC,MAAM;AACP,WAAK,gBAAgB,YAAY;AACjC;AAAA,IACZ;AAEQ,UAAM,WAAW,KAAK,cAAc,EAAE,SAAS,KAAI,CAAE;AACrD,UAAM,aAAa,SAAS,KAAK,CAAC,MAAM;AACpC,UAAI,EAAE,aAAa,KAAK,aAAc,QAAO;AAC7C,UAAI,EAAE,aAAa,KAAK,UAAW,QAAO,EAAE,YAAY,OAAO,SAAS;AACxE,aAAO;AAAA,IACnB,CAAS;AAGD,UAAM,YAAW,UAAK,eAAL,mBAAiB,cAAc;AAChD,QAAI,SAAU,UAAS,gBAAgB,UAAU,CAAC,UAAU;AAG5D,SAAK,gBAAgB,cAAc,UAAU;AAAA,EACrD;AACA;AA5YI,cADiB,SACV,eAAc;AADV,IAAM,SAAN;ACvBf,OAAO,OAAO,cAAc,MAAM;"}
1
+ {"version":3,"file":"wje-dialog.js","sources":["../packages/wje-dialog/dialog.element.js","../packages/wje-dialog/dialog.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport '../wje-button/button.element.js';\nimport '../wje-icon/icon.element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Dialog` is a custom web component that represents a dialog.\n * @summary This element represents a dialog.\n * @documentation https://elements.webjet.sk/components/dialog\n * @status stable\n * @augments {WJElement}\n * @slot header - Slot for the header content.\n * @slot body - Slot for the body content.\n * @slot footer - Slot for the footer content.\n * @csspart dialog - The dialog wrapper.\n * @csspart header - The header of the dialog.\n * @csspart body - The body of the dialog.\n * @csspart footer - The footer of the dialog.\n * @csspart close - The close button of the dialog.\n * @cssproperty [--wje-dialog-background=var(--wje-background-color)] - Specifies the background color of the dialog.\n * @cssproperty [--wje-dialog-color=var(--wje-text-color)] - Defines the text color within the dialog.\n * @cssproperty [--wje-dialog-padding=1rem] - Controls the padding inside the dialog.\n * @cssproperty [--wje-dialog-border-radius=0.5rem] - Sets the border radius for the dialog's corners.\n * @cssproperty [--wje-dialog-box-shadow=0 2px 10px rgba(0, 0, 0, 0.1)] - Applies a shadow effect to the dialog.\n * @tag wje-dialog\n */\n\nexport default class Dialog extends WJElement {\n static _instanceId = 0;\n /**\n * @class\n */\n constructor() {\n super();\n this._instanceId = ++Dialog._instanceId;\n }\n\n /**\n * Sets the value of the 'headline' attribute.\n * @param {string} value The new value for the 'headline' attribute.\n */\n set headline(value) {\n this.setAttribute('headline', value);\n }\n\n /**\n * Retrieves the value of the \"headline\" attribute from the element.\n * If the \"headline\" attribute is not present, returns an empty string.\n * @returns {string} The headline attribute value or an empty string if not set.\n */\n get headline() {\n return this.getAttribute('headline') || '';\n }\n\n /**\n * Sets the headline of the dialog.\n * @param value\n */\n set placement(value) {\n this.setAttribute('placement', value);\n }\n\n /**\n * Gets the headline of the dialog.\n * @returns {string|string}\n */\n get placement() {\n return this.getAttribute('placement') || 'slide-up';\n }\n\n /**\n * Sets the headline of the dialog.\n * @param value\n */\n set async(value) {\n this.setAttribute('async', '');\n }\n\n /**\n * Gets the headline of the dialog.\n * @returns {boolean}\n */\n get async() {\n return this.hasAttribute('async');\n }\n\n /**\n * Sets the headline of the dialog.\n * @param value\n */\n set closeHidden(value) {\n if (value) this.setAttribute('close-hidden', '');\n }\n\n /**\n * Gets the headline of the dialog.\n * @returns {boolean}\n */\n get closeHidden() {\n return !!this.hasAttribute('close-hidden');\n }\n\n set hiddenHeader(value) {\n if (value) this.setAttribute('hidden-header', '');\n }\n\n get hiddenHeader() {\n return !!this.hasAttribute('hidden-header');\n }\n\n set hiddenFooter(value) {\n if (value) this.setAttribute('hidden-footer', '');\n }\n\n get hiddenFooter() {\n return !!this.hasAttribute('hidden-footer');\n }\n\n /**\n * Sets the headline of the dialog.\n * @type {string}\n */\n className = 'Dialog';\n\n /**\n * Returns the CSS styles for the component.\n * @returns {*}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @returns {*[]}\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.\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 this.classList.add('fade', this.placement, params.size);\n\n let dialog = document.createElement('dialog');\n dialog.setAttribute('part', 'dialog');\n dialog.classList.add('modal-dialog');\n dialog.addEventListener('close', this.onNativeDialogClose);\n\n fragment.appendChild(dialog);\n\n this.dialog = dialog;\n this.syncHostOpenState();\n\n return fragment;\n }\n\n /**\n * Draws the component after it has been drawn.\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 */\n afterDraw(context, store, params) {\n if (params.trigger) {\n event.addListener(document, params.trigger, null, this.onOpen);\n }\n }\n\n /**\n * Creates the dialog body.\n * @param dialog\n */\n htmlDialogBody(dialog) {\n const dialogId = this.id || `wje-dialog-${this._instanceId}`;\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('name', 'x');\n icon.setAttribute('slot', 'icon-only');\n\n let close = document.createElement('wje-button');\n close.setAttribute('fill', 'link');\n close.setAttribute('size', 'small');\n close.setAttribute('part', 'close');\n close.setAttribute('aria-label', 'Close dialog');\n close.addEventListener('click', (e) => {\n this.close(e);\n });\n\n let header = document.createElement('div');\n header.setAttribute('part', 'header');\n header.classList.add('dialog-header');\n header.id = `${dialogId}-header`;\n if (this.hasAttribute('headline'))\n header.innerHTML = `<span part=\"headline\">${this.headline}</span>`;\n\n let slotHeader = document.createElement('slot');\n slotHeader.setAttribute('name', 'header');\n\n const headerActions = document.createElement('div');\n headerActions.classList.add('header-actions');\n headerActions.setAttribute('part', 'header-actions');\n headerActions.appendChild(slotHeader);\n\n let contentSlot = document.createElement('slot');\n\n let body = document.createElement('div');\n body.setAttribute('part', 'body');\n body.classList.add('dialog-content');\n body.id = `${dialogId}-body`;\n\n let footer = document.createElement('div');\n footer.setAttribute('part', 'footer');\n footer.classList.add('dialog-footer');\n footer.innerHTML = '';\n\n let slotFooter = document.createElement('slot');\n slotFooter.setAttribute('name', 'footer');\n slotFooter.id = 'footerSlot';\n slotFooter.addEventListener('slotchange', () => this.updateHasFooter());\n\n close.appendChild(icon);\n\n if (!this.closeHidden) header.appendChild(close);\n\n header.appendChild(headerActions);\n body.appendChild(contentSlot);\n footer.appendChild(slotFooter);\n\n if (!this.hiddenHeader) dialog.appendChild(header);\n dialog.appendChild(body);\n if (!this.hiddenFooter) dialog.appendChild(footer);\n\n dialog.setAttribute('role', 'dialog');\n dialog.setAttribute('aria-describedby', body.id);\n if (!this.hiddenHeader) {\n dialog.setAttribute('aria-labelledby', header.id);\n dialog.removeAttribute('aria-label');\n } else {\n dialog.removeAttribute('aria-labelledby');\n if (this.headline) {\n dialog.setAttribute('aria-label', this.headline);\n } else {\n dialog.removeAttribute('aria-label');\n }\n }\n\n Promise.resolve().then(() => this.updateHasFooter());\n }\n\n /**\n * Closes the dialog.\n * @param e\n */\n close(e) {\n this.onClose(e);\n }\n\n /**\n * Before the component is disconnected.\n */\n beforeDisconnect() {\n if (this.params?.trigger) {\n event.removeListener(document, this.params?.trigger, null, this.onOpen);\n }\n\n this.dialog?.removeEventListener('close', this.onNativeDialogClose);\n }\n\n /**\n * Before the dialog opens.\n */\n beforeOpen(dialog, trigger) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * After the dialog opens.\n */\n afterOpen(dialog, trigger) {\n // Hook for extending behavior after the dialog opens\n }\n\n /**\n * Before the dialog closes.\n */\n beforeClose(dialog, trigger) {\n // Hook for extending behavior before the dialog closes\n }\n\n /**\n * After the dialog closes.\n */\n afterClose(dialog, trigger) {\n // Hook for extending behavior after the dialog closes\n }\n\n /**\n * Opens the dialog.\n * @param e\n */\n onOpen = (e) => {\n if (this.dialog) {\n this.dialog.innerHTML = '';\n }\n\n setTimeout(() => {\n Promise.resolve(this.beforeOpen(this, e)).then((res) => {\n this.htmlDialogBody(this.dialog);\n\n this.dialog.showModal(); // Now open the dialog\n this.syncHostOpenState();\n this.dialog.setAttribute('aria-modal', 'true');\n\n if (this.dialog.open) {\n Promise.resolve(this.afterOpen(this, e));\n }\n });\n }, 0);\n }\n\n /**\n * Closes the dialog.\n * @param {object} e\n */\n onClose = (e) => {\n Promise.resolve(this.beforeClose(this, e)).then((res) => {\n this.dialog.close(); // Now close the dialog\n this.dialog.removeAttribute('aria-modal');\n this.syncHostOpenState();\n\n if (!this.dialog.open) {\n Promise.resolve(this.afterClose(this, e));\n }\n });\n };\n\n onNativeDialogClose = () => {\n this.dialog?.removeAttribute('aria-modal');\n this.removeAttribute('open');\n };\n\n syncHostOpenState = () => {\n this.toggleAttribute('open', !!this.dialog?.open);\n };\n\n /**\n * Registers an event listener on the provided button that triggers a blocking UI element\n * and executes a given promise when the button is clicked.\n * @param {HTMLElement} button The button element to attach the event listener to.\n * @param {Function} promise A function that returns a promise to be executed when the button is clicked.\n */\n registerBlockingEvent(button, promise) {\n button.addEventListener('wje-button:click', async (e) => {\n let blockingElement = document.createElement('div');\n blockingElement.classList.add('blocking-element');\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('name', 'loader-2');\n icon.setAttribute('size', '2x-large');\n\n blockingElement.appendChild(icon);\n\n let scrollOffset = this.dialog.scrollTop;\n blockingElement.style.top = `${scrollOffset}px`;\n blockingElement.style.bottom = `-${scrollOffset}px`;\n\n this.dialog.appendChild(blockingElement);\n\n await promise()\n .then((res) => {\n this.close();\n blockingElement.remove();\n })\n .catch((err) => {\n console.error(err);\n blockingElement.remove();\n });\n });\n }\n\n updateHasFooter() {\n // If footer is intentionally hidden, ensure it doesn't reserve space\n if (this.hiddenFooter) {\n const footerEl = this.shadowRoot?.querySelector('.dialog-footer');\n if (footerEl) footerEl.setAttribute('hidden', '');\n this.removeAttribute('has-footer');\n return;\n }\n const slot = this.shadowRoot?.getElementById('footerSlot');\n if (!slot) {\n this.removeAttribute('has-footer');\n return;\n }\n\n const assigned = slot.assignedNodes({ flatten: true });\n const hasContent = assigned.some((n) => {\n if (n.nodeType === Node.ELEMENT_NODE) return true;\n if (n.nodeType === Node.TEXT_NODE) return n.textContent.trim().length > 0;\n return false;\n });\n\n // Prefer toggling the actual footer element so CSS/spacing is always correct\n const footerEl = this.shadowRoot?.querySelector('.dialog-footer');\n if (footerEl) footerEl.toggleAttribute('hidden', !hasContent);\n\n // Keep host attribute too (harmless, may be used elsewhere)\n this.toggleAttribute('has-footer', hasContent);\n }\n}\n","import Dialog from './dialog.element.js';\n\nexport default Dialog;\n\nDialog.define('wje-dialog', Dialog);\n"],"names":["footerEl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2Be,MAAM,UAAN,MAAM,gBAAe,UAAU;AAAA;AAAA;AAAA;AAAA,EAK1C,cAAc;AACV,UAAK;AAyFT;A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A,kBAAkB;;AAEd,QAAI,KAAK,cAAc;AACnB,YAAMA,aAAW,UAAK,eAAL,mBAAiB,cAAc;AAChD,UAAIA,UAAU,CAAAA,UAAS,aAAa,UAAU,EAAE;AAChD,WAAK,gBAAgB,YAAY;AACjC;AAAA,IACJ;AACA,UAAM,QAAO,UAAK,eAAL,mBAAiB,eAAe;AAC7C,QAAI,CAAC,MAAM;AACP,WAAK,gBAAgB,YAAY;AACjC;AAAA,IACJ;AAEA,UAAM,WAAW,KAAK,cAAc,EAAE,SAAS,KAAI,CAAE;AACrD,UAAM,aAAa,SAAS,KAAK,CAAC,MAAM;AACpC,UAAI,EAAE,aAAa,KAAK,aAAc,QAAO;AAC7C,UAAI,EAAE,aAAa,KAAK,UAAW,QAAO,EAAE,YAAY,OAAO,SAAS;AACxE,aAAO;AAAA,IACX,CAAC;AAGD,UAAM,YAAW,UAAK,eAAL,mBAAiB,cAAc;AAChD,QAAI,SAAU,UAAS,gBAAgB,UAAU,CAAC,UAAU;AAG5D,SAAK,gBAAgB,cAAc,UAAU;AAAA,EACjD;AACJ;AA5YI,cADiB,SACV,eAAc;AADV,IAAM,SAAN;ACvBf,OAAO,OAAO,cAAc,MAAM;"}
@@ -1 +1 @@
1
- {"version":3,"file":"wje-divider.js","sources":["../packages/wje-divider/divider.element.js","../packages/wje-divider/divider.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary Divider is a custom web component that extends WJElement.\n * It provides a simple divider line that can be used to separate content.\n * @documentation https://elements.webjet.sk/components/divider\n * @status stable\n * @augments WJElement\n * @slot - This is a default/unnamed slot.\n * @cssproperty [--wje-border-width=1px] - The size of the border.\n * @cssproperty [--wje-divider-border-color=var(--wje-border-color)] - The color of the divider borderline.\n * @cssproperty [--wje-divider-border-width=var(--wje-border-width, 1px)] - The width of the divider borderline.\n * @cssproperty [--wje-divider-spacing=0] - The spacing for the divider.\n * @tag wje-divider\n * @tag wje-divider\n */\nexport default class Divider extends WJElement {\n /**\n * Constructor for the Divider class.\n */\n constructor() {\n super();\n }\n\n /**\n * The class name for the Divider class.\n * @type {string}\n */\n className = 'Divider';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {string} The CSS stylesheet.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observed attributes.\n * @returns {Array} An empty array as there are no observed attributes.\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the Divider.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the Divider.\n * @returns {DocumentFragment} The created document fragment.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n let slot = document.createElement('slot');\n\n native.appendChild(slot);\n fragment.appendChild(native);\n\n return fragment;\n }\n}\n","import Divider from './divider.element.js';\n\nexport default Divider;\n\nDivider.define('wje-divider', Divider);\n"],"names":[],"mappings":";;;;;AAiBe,MAAM,gBAAgB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI3C,cAAc;AACV,UAAO;AAOX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAAA,EANhB;AAAA;AAAA;AAAA;AAAA;AAAA,EAYI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,WAAW,qBAAqB;AAC5B,WAAO,CAAE;AAAA,EACjB;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,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,WAAO,YAAY,IAAI;AACvB,aAAS,YAAY,MAAM;AAE3B,WAAO;AAAA,EACf;AACA;ACjEA,QAAQ,OAAO,eAAe,OAAO;"}
1
+ {"version":3,"file":"wje-divider.js","sources":["../packages/wje-divider/divider.element.js","../packages/wje-divider/divider.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary Divider is a custom web component that extends WJElement.\n * It provides a simple divider line that can be used to separate content.\n * @documentation https://elements.webjet.sk/components/divider\n * @status stable\n * @augments WJElement\n * @slot - This is a default/unnamed slot.\n * @cssproperty [--wje-border-width=1px] - The size of the border.\n * @cssproperty [--wje-divider-border-color=var(--wje-border-color)] - The color of the divider borderline.\n * @cssproperty [--wje-divider-border-width=var(--wje-border-width, 1px)] - The width of the divider borderline.\n * @cssproperty [--wje-divider-spacing=0] - The spacing for the divider.\n * @tag wje-divider\n * @tag wje-divider\n */\nexport default class Divider extends WJElement {\n /**\n * Constructor for the Divider class.\n */\n constructor() {\n super();\n }\n\n /**\n * The class name for the Divider class.\n * @type {string}\n */\n className = 'Divider';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {string} The CSS stylesheet.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observed attributes.\n * @returns {Array} An empty array as there are no observed attributes.\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the Divider.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the Divider.\n * @returns {DocumentFragment} The created document fragment.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n let slot = document.createElement('slot');\n\n native.appendChild(slot);\n fragment.appendChild(native);\n\n return fragment;\n }\n}\n","import Divider from './divider.element.js';\n\nexport default Divider;\n\nDivider.define('wje-divider', Divider);\n"],"names":[],"mappings":";;;;;AAiBe,MAAM,gBAAgB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI3C,cAAc;AACV,UAAK;AAOT;AAAA;AAAA;AAAA;AAAA,qCAAY;AAAA,EANZ;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAW,qBAAqB;AAC5B,WAAO,CAAA;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,kBAAkB;AACd,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO;AACH,QAAI,WAAW,SAAS,uBAAsB;AAE9C,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,WAAO,YAAY,IAAI;AACvB,aAAS,YAAY,MAAM;AAE3B,WAAO;AAAA,EACX;AACJ;ACjEA,QAAQ,OAAO,eAAe,OAAO;"}
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var _onMenuItemCustom;
11
11
  import WJElement from "./wje-element.js";
12
- import { P as Popup } from "./popup.element-Cl6QeG8M.js";
12
+ import { P as Popup } from "./popup.element-DklicGea.js";
13
13
  import { event } from "./event.js";
14
14
  const _Dropdown = class _Dropdown extends WJElement {
15
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"wje-dropdown.js","sources":["../packages/wje-dropdown/dropdown.element.js","../packages/wje-dropdown/dropdown.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport Popup from '../wje-popup/popup.element.js';\n\n/**\n * `Dropdown` is a custom element that displays a dropdown menu.\n * @summary This element represents a dropdown menu.\n * @documentation https://elements.webjet.sk/components/dropdown\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native part of the dropdown.\n * @slot trigger - The slot for the trigger of the dropdown.\n * @slot - The default slot for the dropdown.\n * // @fires wje-dropdown:open - Event fired when the dropdown is opened.\n * // @fires wje-dropdown:close - Event fired when the dropdown is closed.\n * @tag wje-dropdown\n */\nexport default class Dropdown extends WJElement {\n static _instanceId = 0;\n /**\n * Creates an instance of Dropdown.\n * @class\n */\n constructor() {\n super();\n this._instanceId = ++Dropdown._instanceId;\n }\n\n /**\n * The placement of the dropdown.\n * @type {{\"wje-popup\": Popup}}\n */\n dependencies = {\n 'wje-popup': Popup,\n };\n\n /**\n * Sets or removes the 'portaled' attribute on the element.\n * When the value is truthy, the attribute 'portaled' is added to the element.\n * When the value is falsy, the attribute 'portaled' is removed from the element.\n * @param {boolean} value Determines whether to add or remove the 'portaled' attribute.\n */\n set portaled(value) {\n if (value) {\n this.setAttribute('portaled', value);\n } else {\n this.removeAttribute('portaled');\n }\n }\n\n /**\n * Getter method for the `portaled` property.\n * Checks if the `portaled` attribute is present on the element.\n * @returns {boolean} Returns `true` if the `portaled` attribute exists, otherwise `false`.\n */\n get portaled() {\n return this.getAttribute('portaled') || '';\n }\n\n /**\n * Checks whether the element has the 'portaled' attribute.\n * @returns {boolean} True if the element has the 'portaled' attribute, otherwise false.\n */\n get isPortaled() {\n return this.hasAttribute('portaled');\n }\n\n /**\n * Sets the placement of the dropdown.\n * @param value\n */\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n /**\n * Gets the placement of the dropdown.\n * @returns {string|string}\n */\n get trigger() {\n return this.getAttribute('trigger') || 'click';\n }\n\n /**\n * Sets the placement of the dropdown.\n * @type {string}\n */\n className = 'Dropdown';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['active'];\n }\n\n /**\n * Callback function to handle other dropdowns being opened. Close the dropdown if it is not the target and collapse is enabled.\n * @param {Event} e The event object.\n */\n otherDropdownOpennedCallback = (e) => {\n if (e.detail.detail.target !== this) {\n this.classList.remove('active');\n this.popup.hide();\n }\n };\n\n /**\n * Sets up the attributes for the dropdown.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Removes the popup element.\n */\n beforeDraw() {\n this.popup?.remove();\n this.popup = null;\n }\n\n /**\n * Draws the dropdown element and returns the created document fragment.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n this.classList.add('wje-placement', 'wje-' + this.placement || 'wje-start');\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-dropdown');\n\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('content', this.tooltip);\n\n let anchorSlot = document.createElement('slot');\n anchorSlot.setAttribute('name', 'trigger');\n anchorSlot.setAttribute('slot', 'anchor');\n\n let slot = document.createElement('slot');\n\n let popup = document.createElement('wje-popup');\n popup.setAttribute('placement', this.placement);\n popup.setAttribute('offset', this.offset);\n popup.setAttribute('part', 'popup');\n\n if(this.isPortaled)\n popup.setAttribute('portal', this.portaled);\n\n popup.append(anchorSlot, slot);\n\n // if(this.trigger === \"click\")\n popup.setAttribute('manual', '');\n\n native.appendChild(popup);\n\n fragment.appendChild(native);\n\n this.popup = popup;\n this.anchorSlot = anchorSlot;\n\n return fragment;\n }\n\n /**\n * Adds event listeners for the mouseenter and mouseleave events.\n */\n afterDraw() {\n event.addListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n\n // Close when any actionable wje-menu-item inside the popup is clicked (works across Shadow DOM via composed path)\n event.addListener(this.popup, 'click', null, this.onMenuItemClick, { capture: true });\n\n if (this.trigger !== 'click') {\n event.addListener(this, 'mouseenter', null, this.onOpen);\n event.addListener(this, 'mouseleave', null, this.onClose);\n } else {\n event.addListener(this.anchorSlot, 'click', null, this.toggleCallback, { capture: true });\n }\n\n if (this.hasAttribute('collapsible')) {\n event.addListener(\n Array.from(this.querySelectorAll('wje-menu-item')),\n 'click',\n 'wje-menu-item:click',\n this.onClose\n );\n }\n\n this.onSlotChange = () => this.syncAria();\n this.anchorSlot.addEventListener('slotchange', this.onSlotChange);\n\n this.syncAria();\n }\n\n /**\n * Adds event listeners for the mouseenter and mouseleave events.\n */\n afterDisconnect() {\n event.removeListener(this, 'mouseenter', null, this.onOpen);\n event.removeListener(this, 'mouseleave', null, this.onClose);\n event.removeListener(this.anchorSlot, 'click', null, this.toggleCallback, { capture: true });\n event.removeListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n event.removeListener(this.popup, 'click', null, this.onMenuItemClick, { capture: true });\n event.removeListener(document, 'wje-menu-item:click', null, this.#onMenuItemCustom, false);\n this.anchorSlot?.removeEventListener('slotchange', this.onSlotChange);\n }\n\n popupHideCallback = (e) => {\n if (this.classList.contains('active') && e.target.tagName === \"WJE-DROPDOWN\") {\n this.toggleCallback(e);\n }\n };\n\n /**\n * Handles delegated clicks from inside the popup and closes the dropdown when a leaf menu item is selected.\n * This works even when the menu is portaled, because we rely on the composed path.\n */\n onMenuItemClick = (e) => {\n // Find nearest wje-menu-item in the composed path\n const path = typeof e.composedPath === 'function' ? e.composedPath() : [];\n const item = path.find((n) => n && n.tagName === 'WJE-MENU-ITEM');\n if (!item) return;\n\n // Ignore disabled items\n if (item.hasAttribute('disabled') || item.getAttribute('aria-disabled') === 'true') return;\n\n // If this item contains a nested submenu (wje-menu), it's not a leaf -> don't close yet\n if (typeof item.querySelector === 'function' && item.querySelector('wje-menu')) return;\n\n // Leaf item selected -> close dropdown (which calls popup.hide(true) inside onClose)\n this.onClose();\n }\n\n /**\n * @summary Toggles the dropdown element between active and inactive states.\n * Calls the `onOpen` method if the element is currently inactive,\n * and calls the `onClose` method if the element is currently active.\n * @param {Event} e The event object.\n */\n toggleCallback = (e) => {\n if (this.classList.contains('active')) {\n e.stopPropagation();\n this.onClose();\n } else {\n e.stopPropagation();\n this.onOpen(e);\n }\n };\n\n /**\n * @summary Returns the content to be displayed before showing the dropdown.\n * @returns {any} The content to be displayed.\n */\n beforeShow() {\n return this.content;\n }\n\n /**\n * This method is called after the dropdown is shown.\n */\n afterShow() {\n // Do nothing\n }\n\n /**\n * Open the popup element.\n * @param {object} e\n */\n onOpen = (e) => {\n this.classList.add('active');\n this.syncAria();\n Promise.resolve(this.beforeShow(this))\n .then((res) => {\n if (!this.classList.contains('active')) {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.popup.show(true); // Show tooltip\n\n event.addListener(document, 'wje-menu-item:click', null, this.#onMenuItemCustom, false);\n\n event.dispatchCustomEvent(this, 'wje-dropdown:open', {\n bubbles: true,\n detail: { target: this },\n });\n\n Promise.resolve(this.afterShow(this));\n })\n .catch((error) => {\n // ak je nejaka chyba tak to len zatvorime\n this.classList.remove('active');\n this.popup.hide(true);\n });\n };\n\n beforeClose = () => {\n // Do nothing\n };\n\n afterClose = () => {\n // Do nothing\n };\n\n onClose = () => {\n this.classList.remove('active');\n this.syncAria();\n Promise.resolve(this.beforeClose(this))\n .then((res) => {\n if (this.classList.contains('active')) {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.popup.hide(true); // Show tooltip\n\n event.removeListener(document, 'wje-menu-item:click', null, this.#onMenuItemCustom, false);\n\n event.dispatchCustomEvent(this, 'wje-dropdown:close', {\n bubbles: true,\n detail: { target: this },\n });\n\n Promise.resolve(this.afterClose(this));\n })\n .catch((error) => {\n this.classList.add('active');\n this.popup.show(true);\n });\n }\n\n /**\n * Syncs ARIA attributes for the trigger element.\n */\n syncAria() {\n const triggerEl = this.anchorSlot?.assignedElements?.({ flatten: true })?.[0];\n if (!triggerEl) return;\n\n const popupId = this.popup?.id || `wje-dropdown-popup-${this._instanceId}`;\n if (this.popup && !this.popup.id) this.popup.id = popupId;\n\n const hasMenu = !!this.querySelector('wje-menu');\n triggerEl.setAttribute('aria-haspopup', hasMenu ? 'menu' : 'dialog');\n triggerEl.setAttribute('aria-expanded', this.classList.contains('active') ? 'true' : 'false');\n triggerEl.setAttribute('aria-controls', popupId);\n }\n\n #onMenuItemCustom = (e) => {\n const path = typeof e.composedPath === 'function' ? e.composedPath() : [];\n if (!this.popup || !this.popup.floatingEl || !path.includes(this.popup.floatingEl)) return;\n\n const item = path.find(n => n && n.tagName === 'WJE-MENU-ITEM');\n if (!item) return;\n if (item.hasAttribute('disabled') || item.getAttribute('aria-disabled') === 'true') return;\n if (item.hasAttribute('has-submenu')) return; // parent; nezatváraj\n\n // Zavri len tento dropdown. NEvolaj stopPropagation na custom evente,\n // aby fungovali aj tvoje app-level listenery (riadok 480).\n this.classList.remove('active');\n this.popup.hide(true);\n }\n}\n","import Dropdown from './dropdown.element.js';\n\nexport default Dropdown;\n\nDropdown.define('wje-dropdown', Dropdown);\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgBe,MAAM,YAAN,MAAM,kBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5C,cAAc;AACV,UAAO;AAQX;AAAA;AAAA;AAAA;AAAA,wCAAe;AAAA,MACX,aAAa;AAAA,IAChB;AAqDD;AAAA;AAAA;AAAA;AAAA,qCAAY;AAcZ;AAAA;AAAA;AAAA;AAAA,wDAA+B,CAAC,MAAM;AAClC,UAAI,EAAE,OAAO,OAAO,WAAW,MAAM;AACjC,aAAK,UAAU,OAAO,QAAQ;AAC9B,aAAK,MAAM,KAAM;AAAA,MAC7B;AAAA,IACK;AA0GD,6CAAoB,CAAC,MAAM;AACvB,UAAI,KAAK,UAAU,SAAS,QAAQ,KAAK,EAAE,OAAO,YAAY,gBAAgB;AAC1E,aAAK,eAAe,CAAC;AAAA,MACjC;AAAA,IACK;AAMD;AAAA;AAAA;AAAA;AAAA,2CAAkB,CAAC,MAAM;AAErB,YAAM,OAAO,OAAO,EAAE,iBAAiB,aAAa,EAAE,aAAY,IAAK,CAAE;AACzE,YAAM,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,EAAE,YAAY,eAAe;AAChE,UAAI,CAAC,KAAM;AAGX,UAAI,KAAK,aAAa,UAAU,KAAK,KAAK,aAAa,eAAe,MAAM,OAAQ;AAGpF,UAAI,OAAO,KAAK,kBAAkB,cAAc,KAAK,cAAc,UAAU,EAAG;AAGhF,WAAK,QAAS;AAAA,IACtB;AAQI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0CAAiB,CAAC,MAAM;AACpB,UAAI,KAAK,UAAU,SAAS,QAAQ,GAAG;AACnC,UAAE,gBAAiB;AACnB,aAAK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C,mBAAyD;AAC3E,QAAI,CAAC,UAAW;AAEhB,UAAM,YAAU,UAAK,UAAL,mBAAY,OAAM,sBAAsB,KAAK,WAAW;AACxE,QAAI,KAAK,SAAS,CAAC,KAAK,MAAM,GAAI,MAAK,MAAM,KAAK;AAElD,UAAM,UAAU,CAAC,CAAC,KAAK,cAAc,UAAU;AAC/C,cAAU,aAAa,iBAAiB,UAAU,SAAS,QAAQ;AACnE,cAAU,aAAa,iBAAiB,KAAK,UAAU,SAAS,QAAQ,IAAI,SAAS,OAAO;AAC5F,cAAU,aAAa,iBAAiB,OAAO;AAAA,EACvD;AAgBA;AAdI;AA5UA,cADiB,WACV,eAAc;AADV,IAAM,WAAN;ACZf,SAAS,OAAO,gBAAgB,QAAQ;"}
1
+ {"version":3,"file":"wje-dropdown.js","sources":["../packages/wje-dropdown/dropdown.element.js","../packages/wje-dropdown/dropdown.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport Popup from '../wje-popup/popup.element.js';\n\n/**\n * `Dropdown` is a custom element that displays a dropdown menu.\n * @summary This element represents a dropdown menu.\n * @documentation https://elements.webjet.sk/components/dropdown\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native part of the dropdown.\n * @slot trigger - The slot for the trigger of the dropdown.\n * @slot - The default slot for the dropdown.\n * // @fires wje-dropdown:open - Event fired when the dropdown is opened.\n * // @fires wje-dropdown:close - Event fired when the dropdown is closed.\n * @tag wje-dropdown\n */\nexport default class Dropdown extends WJElement {\n static _instanceId = 0;\n /**\n * Creates an instance of Dropdown.\n * @class\n */\n constructor() {\n super();\n this._instanceId = ++Dropdown._instanceId;\n }\n\n /**\n * The placement of the dropdown.\n * @type {{\"wje-popup\": Popup}}\n */\n dependencies = {\n 'wje-popup': Popup,\n };\n\n /**\n * Sets or removes the 'portaled' attribute on the element.\n * When the value is truthy, the attribute 'portaled' is added to the element.\n * When the value is falsy, the attribute 'portaled' is removed from the element.\n * @param {boolean} value Determines whether to add or remove the 'portaled' attribute.\n */\n set portaled(value) {\n if (value) {\n this.setAttribute('portaled', value);\n } else {\n this.removeAttribute('portaled');\n }\n }\n\n /**\n * Getter method for the `portaled` property.\n * Checks if the `portaled` attribute is present on the element.\n * @returns {boolean} Returns `true` if the `portaled` attribute exists, otherwise `false`.\n */\n get portaled() {\n return this.getAttribute('portaled') || '';\n }\n\n /**\n * Checks whether the element has the 'portaled' attribute.\n * @returns {boolean} True if the element has the 'portaled' attribute, otherwise false.\n */\n get isPortaled() {\n return this.hasAttribute('portaled');\n }\n\n /**\n * Sets the placement of the dropdown.\n * @param value\n */\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n /**\n * Gets the placement of the dropdown.\n * @returns {string|string}\n */\n get trigger() {\n return this.getAttribute('trigger') || 'click';\n }\n\n /**\n * Sets the placement of the dropdown.\n * @type {string}\n */\n className = 'Dropdown';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['active'];\n }\n\n /**\n * Callback function to handle other dropdowns being opened. Close the dropdown if it is not the target and collapse is enabled.\n * @param {Event} e The event object.\n */\n otherDropdownOpennedCallback = (e) => {\n if (e.detail.detail.target !== this) {\n this.classList.remove('active');\n this.popup.hide();\n }\n };\n\n /**\n * Sets up the attributes for the dropdown.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Removes the popup element.\n */\n beforeDraw() {\n this.popup?.remove();\n this.popup = null;\n }\n\n /**\n * Draws the dropdown element and returns the created document fragment.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n this.classList.add('wje-placement', 'wje-' + this.placement || 'wje-start');\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-dropdown');\n\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('content', this.tooltip);\n\n let anchorSlot = document.createElement('slot');\n anchorSlot.setAttribute('name', 'trigger');\n anchorSlot.setAttribute('slot', 'anchor');\n\n let slot = document.createElement('slot');\n\n let popup = document.createElement('wje-popup');\n popup.setAttribute('placement', this.placement);\n popup.setAttribute('offset', this.offset);\n popup.setAttribute('part', 'popup');\n\n if(this.isPortaled)\n popup.setAttribute('portal', this.portaled);\n\n popup.append(anchorSlot, slot);\n\n // if(this.trigger === \"click\")\n popup.setAttribute('manual', '');\n\n native.appendChild(popup);\n\n fragment.appendChild(native);\n\n this.popup = popup;\n this.anchorSlot = anchorSlot;\n\n return fragment;\n }\n\n /**\n * Adds event listeners for the mouseenter and mouseleave events.\n */\n afterDraw() {\n event.addListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n\n // Close when any actionable wje-menu-item inside the popup is clicked (works across Shadow DOM via composed path)\n event.addListener(this.popup, 'click', null, this.onMenuItemClick, { capture: true });\n\n if (this.trigger !== 'click') {\n event.addListener(this, 'mouseenter', null, this.onOpen);\n event.addListener(this, 'mouseleave', null, this.onClose);\n } else {\n event.addListener(this.anchorSlot, 'click', null, this.toggleCallback, { capture: true });\n }\n\n if (this.hasAttribute('collapsible')) {\n event.addListener(\n Array.from(this.querySelectorAll('wje-menu-item')),\n 'click',\n 'wje-menu-item:click',\n this.onClose\n );\n }\n\n this.onSlotChange = () => this.syncAria();\n this.anchorSlot.addEventListener('slotchange', this.onSlotChange);\n\n this.syncAria();\n }\n\n /**\n * Adds event listeners for the mouseenter and mouseleave events.\n */\n afterDisconnect() {\n event.removeListener(this, 'mouseenter', null, this.onOpen);\n event.removeListener(this, 'mouseleave', null, this.onClose);\n event.removeListener(this.anchorSlot, 'click', null, this.toggleCallback, { capture: true });\n event.removeListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n event.removeListener(this.popup, 'click', null, this.onMenuItemClick, { capture: true });\n event.removeListener(document, 'wje-menu-item:click', null, this.#onMenuItemCustom, false);\n this.anchorSlot?.removeEventListener('slotchange', this.onSlotChange);\n }\n\n popupHideCallback = (e) => {\n if (this.classList.contains('active') && e.target.tagName === \"WJE-DROPDOWN\") {\n this.toggleCallback(e);\n }\n };\n\n /**\n * Handles delegated clicks from inside the popup and closes the dropdown when a leaf menu item is selected.\n * This works even when the menu is portaled, because we rely on the composed path.\n */\n onMenuItemClick = (e) => {\n // Find nearest wje-menu-item in the composed path\n const path = typeof e.composedPath === 'function' ? e.composedPath() : [];\n const item = path.find((n) => n && n.tagName === 'WJE-MENU-ITEM');\n if (!item) return;\n\n // Ignore disabled items\n if (item.hasAttribute('disabled') || item.getAttribute('aria-disabled') === 'true') return;\n\n // If this item contains a nested submenu (wje-menu), it's not a leaf -> don't close yet\n if (typeof item.querySelector === 'function' && item.querySelector('wje-menu')) return;\n\n // Leaf item selected -> close dropdown (which calls popup.hide(true) inside onClose)\n this.onClose();\n }\n\n /**\n * @summary Toggles the dropdown element between active and inactive states.\n * Calls the `onOpen` method if the element is currently inactive,\n * and calls the `onClose` method if the element is currently active.\n * @param {Event} e The event object.\n */\n toggleCallback = (e) => {\n if (this.classList.contains('active')) {\n e.stopPropagation();\n this.onClose();\n } else {\n e.stopPropagation();\n this.onOpen(e);\n }\n };\n\n /**\n * @summary Returns the content to be displayed before showing the dropdown.\n * @returns {any} The content to be displayed.\n */\n beforeShow() {\n return this.content;\n }\n\n /**\n * This method is called after the dropdown is shown.\n */\n afterShow() {\n // Do nothing\n }\n\n /**\n * Open the popup element.\n * @param {object} e\n */\n onOpen = (e) => {\n this.classList.add('active');\n this.syncAria();\n Promise.resolve(this.beforeShow(this))\n .then((res) => {\n if (!this.classList.contains('active')) {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.popup.show(true); // Show tooltip\n\n event.addListener(document, 'wje-menu-item:click', null, this.#onMenuItemCustom, false);\n\n event.dispatchCustomEvent(this, 'wje-dropdown:open', {\n bubbles: true,\n detail: { target: this },\n });\n\n Promise.resolve(this.afterShow(this));\n })\n .catch((error) => {\n // ak je nejaka chyba tak to len zatvorime\n this.classList.remove('active');\n this.popup.hide(true);\n });\n };\n\n beforeClose = () => {\n // Do nothing\n };\n\n afterClose = () => {\n // Do nothing\n };\n\n onClose = () => {\n this.classList.remove('active');\n this.syncAria();\n Promise.resolve(this.beforeClose(this))\n .then((res) => {\n if (this.classList.contains('active')) {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.popup.hide(true); // Show tooltip\n\n event.removeListener(document, 'wje-menu-item:click', null, this.#onMenuItemCustom, false);\n\n event.dispatchCustomEvent(this, 'wje-dropdown:close', {\n bubbles: true,\n detail: { target: this },\n });\n\n Promise.resolve(this.afterClose(this));\n })\n .catch((error) => {\n this.classList.add('active');\n this.popup.show(true);\n });\n }\n\n /**\n * Syncs ARIA attributes for the trigger element.\n */\n syncAria() {\n const triggerEl = this.anchorSlot?.assignedElements?.({ flatten: true })?.[0];\n if (!triggerEl) return;\n\n const popupId = this.popup?.id || `wje-dropdown-popup-${this._instanceId}`;\n if (this.popup && !this.popup.id) this.popup.id = popupId;\n\n const hasMenu = !!this.querySelector('wje-menu');\n triggerEl.setAttribute('aria-haspopup', hasMenu ? 'menu' : 'dialog');\n triggerEl.setAttribute('aria-expanded', this.classList.contains('active') ? 'true' : 'false');\n triggerEl.setAttribute('aria-controls', popupId);\n }\n\n #onMenuItemCustom = (e) => {\n const path = typeof e.composedPath === 'function' ? e.composedPath() : [];\n if (!this.popup || !this.popup.floatingEl || !path.includes(this.popup.floatingEl)) return;\n\n const item = path.find(n => n && n.tagName === 'WJE-MENU-ITEM');\n if (!item) return;\n if (item.hasAttribute('disabled') || item.getAttribute('aria-disabled') === 'true') return;\n if (item.hasAttribute('has-submenu')) return; // parent; nezatváraj\n\n // Zavri len tento dropdown. NEvolaj stopPropagation na custom evente,\n // aby fungovali aj tvoje app-level listenery (riadok 480).\n this.classList.remove('active');\n this.popup.hide(true);\n }\n}\n","import Dropdown from './dropdown.element.js';\n\nexport default Dropdown;\n\nDropdown.define('wje-dropdown', Dropdown);\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgBe,MAAM,YAAN,MAAM,kBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAM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aAAa,iBAAiB,KAAK,UAAU,SAAS,QAAQ,IAAI,SAAS,OAAO;AAC5F,cAAU,aAAa,iBAAiB,OAAO;AAAA,EACnD;AAgBJ;AAdI;AA5UA,cADiB,WACV,eAAc;AADV,IAAM,WAAN;ACZf,SAAS,OAAO,gBAAgB,QAAQ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"wje-element.js","sources":["../packages/wje-element/element.js"],"sourcesContent":["import { UniversalService } from '../utils/universal-service.js';\nimport { Permissions } from '../utils/permissions.js';\nimport { WjElementUtils } from '../utils/element-utils.js';\nimport { event } from '../utils/event.js';\nimport { defaultStoreActions, store } from '../wje-store/store.js';\n\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\n\nexport default class WJElement extends HTMLElement {\n\t#drawingStatus;\n\t#isAttached;\n\t#isRendering;\n\t#originalVisibility;\n\t#pristine;\n\n\t/**\n\t * Initializes a new instance of the WJElement class.\n\t */\n\n\tconstructor() {\n\t\tsuper();\n\n\t\t// Initialize ElementInternals when supported.\n\t\tif (typeof this.attachInternals === 'function') {\n\t\t\tthis.internals = this.attachInternals();\n\t\t}\n\n\t\tthis.#isAttached = false;\n\t\tthis.service = new UniversalService({\n\t\t\tstore: store,\n\t\t});\n\n\t\t// definujeme vsetky zavislosti.\n\t\t// Do zavislosti patria len komponenty, ktore su zavisle od ktoreho je zavisly tento komponent\n\t\tthis.defineDependencies();\n\n\t\tthis.#isRendering = false;\n\t\tthis._dependencies = {};\n\n\t\t/**\n\t\t * @typedef {object} DrawingStatuses\n\t\t * @property {number} CREATED - The component has been created.\n\t\t * @property {number} ATTACHED - The component has been attached to the DOM.\n\t\t * @property {number} BEGINING - The component is beginning to draw.\n\t\t * @property {number} START - The component has started drawing.\n\t\t * @property {number} DRAWING - The component is drawing.\n\t\t * @property {number} DONE - The component has finished drawing.\n\t\t * @property {number} DISCONNECTED - The component has been disconnected from the DOM.\n\t\t */\n\n\t\t/**\n\t\t * WJElement is a base class for custom web components with managed lifecycle, attribute/property sync,\n\t\t * permission-based visibility, and extensibility hooks.\n\t\t * @property {boolean} isAttached - True if the component is currently attached to the DOM.\n\t\t * @property {DrawingStatuses} drawingStatuses - Enum of possible drawing states.\n\t\t * @property {number} drawingStatus - Current drawing status (see drawingStatuses).\n\t\t * @property {boolean} _pristine - True if the component has not been updated since last render.\n\t\t * @property {boolean} isRendering - True if a render is currently in progress.\n\t\t * @property {number|null} rafId - ID of the scheduled animation frame for rendering, or null.\n\t\t * @property {string|null} originalVisibility - Stores the original CSS visibility before rendering.\n\t\t * @property {object} params - Stores the current attributes/properties for rendering.\n\t\t * @property {Promise<void>} updateComplete - Promise resolved when the current update/render is complete.\n\t\t * @property {string[]} permission - List of required permissions (from 'permission' attribute).\n\t\t * @property {boolean} isPermissionCheck - Whether permission checking is enabled (from 'permission-check' attribute).\n\t\t * @property {boolean} noShow - Whether the element should be hidden (from 'no-show' attribute).\n\t\t * @property {string|undefined} isShadowRoot - Value of the 'shadow' attribute, if present.\n\t\t * @property {boolean} hasShadowRoot - True if the 'shadow' attribute is present.\n\t\t * @property {string} shadowType - Type of shadow root ('open' by default).\n\t\t * @property {object} store - Reference to the global store instance.\n\t\t * @property {object} defaultStoreActions - Default store actions for arrays and objects.\n\t\t * @property {string[]|undefined} removeClassAfterConnect - Classes to remove after connect (from 'remove-class-after-connect' attribute).\n\t\t * @property {object} dependencies - Registered component dependencies.\n\t\t * @property {HTMLElement|ShadowRoot} context - The rendering context (shadow root or element itself).\n\t\t */\n\t\tthis.drawingStatuses = {\n\t\t\tCREATED: 0,\n\t\t\tATTACHED: 1,\n\t\t\tBEGINING: 2,\n\t\t\tSTART: 3,\n\t\t\tDRAWING: 4,\n\t\t\tDONE: 5,\n\t\t\tDISCONNECTED: 6,\n\t\t};\n\n\t\tthis.#drawingStatus = this.drawingStatuses.CREATED;\n\n\t\tthis.#pristine = true;\n\t\tthis.#isRendering = false;\n\t\tthis.rafId = null;\n\t\tthis.#originalVisibility = null;\n\t\tthis.params = {};\n\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\t}\n\n\tget drawingStatus() {\n\t\treturn this.#drawingStatus;\n\t}\n\n\t/**\n\t * Sets the value of the 'permission' attribute.\n\t * @param {string[]} value The value to set for the 'permission' attribute.\n\t */\n\tset permission(value) {\n\t\tthis.setAttribute('permission', value.join(','));\n\t}\n\n\t/**\n\t * Gets the value of the 'permission-check' attribute.\n\t * @returns {string[]} The value of the 'permission' attribute.\n\t */\n\tget permission() {\n\t\treturn this.getAttribute('permission')?.split(',') || [];\n\t}\n\n\t/**\n\t * Sets the 'permission-check' attribute.\n\t * @param {boolean} value The value to set for the 'permission-check' attribute.\n\t */\n\tset isPermissionCheck(value) {\n\t\tif (value) this.setAttribute('permission-check', '');\n\t\telse this.removeAttribute('permission-check');\n\t}\n\n\t/**\n\t * Checks if the 'permission-check' attribute is present.\n\t * @returns {boolean} True if the 'permission-check' attribute is present.\n\t */\n\tget isPermissionCheck() {\n\t\treturn this.hasAttribute('permission-check');\n\t}\n\n\tset noShow(value) {\n\t\tif (value) this.setAttribute('no-show', '');\n\t\telse this.removeAttribute('no-show');\n\t}\n\n\t/**\n\t * Checks if the 'show' attribute is present.\n\t * @returns {boolean} True if the 'show' attribute is present.\n\t */\n\tget noShow() {\n\t\treturn this.hasAttribute('no-show');\n\t}\n\n\t/**\n\t * Sets the 'shadow' attribute.\n\t * @param {string} value The value to set for the 'shadow' attribute.\n\t */\n\tset isShadowRoot(value) {\n\t\treturn this.setAttribute('shadow', value);\n\t}\n\n\tget isShadowRoot() {\n\t\treturn this.getAttribute('shadow');\n\t}\n\n\t/**\n\t * Checks if the 'shadow' attribute is present.\n\t * @returns {boolean} True if the 'shadow' attribute is present.\n\t */\n\tget hasShadowRoot() {\n\t\treturn this.hasAttribute('shadow');\n\t}\n\n\t/**\n\t * Gets the value of the 'shadow' attribute or 'open' if not set.\n\t * @returns {string} The value of the 'shadow' attribute or 'open'.\n\t */\n\tget shadowType() {\n\t\treturn this.getAttribute('shadow') || 'open';\n\t}\n\n\t/**\n\t * Gets the rendering context, either the shadow root or the component itself.\n\t * @returns The rendering context.\n\t */\n\tget context() {\n\t\tif (this.hasShadowRoot) {\n\t\t\treturn this.shadowRoot;\n\t\t} else {\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t/**\n\t * Gets the store instance.\n\t * @returns {object} The store instance.\n\t */\n\tget store() {\n\t\treturn store;\n\t}\n\n\t/**\n\t * Returns ElementInternals when available.\n\t * @returns {ElementInternals|null}\n\t */\n\tgetInternals() {\n\t\treturn this.internals || null;\n\t}\n\n\t/**\n\t * Sets ARIA state via attributes.\n\t * Accepts camelCase keys without the \"aria\" prefix, plus \"role\".\n\t * Example: setAriaState({ role: 'tab', selected: true, controls: 'panel-1' })\n\t * @param {object} state\n\t */\n\tsetAriaState(state = {}) {\n\t\tif (!state || typeof state !== 'object') return;\n\n\t\tObject.entries(state).forEach(([key, value]) => {\n\t\t\tif (value === undefined || value === null) return;\n\n\t\t\tif (key === 'role') {\n\t\t\t\tthis.setAttribute('role', value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet attr;\n\t\t\tif (key === 'labelledBy') attr = 'aria-labelledby';\n\t\t\telse if (key === 'describedBy') attr = 'aria-describedby';\n\t\t\telse attr = `aria-${key.replace(/([A-Z])/g, '-$1').toLowerCase()}`;\n\t\t\t// Convert booleans to \"true\"/\"false\" strings for aria attributes.\n\t\t\tconst normalized = (typeof value === 'boolean') ? (value ? 'true' : 'false') : value;\n\t\t\tthis.setAttribute(attr, normalized);\n\t\t});\n\t}\n\n\t/**\n\t * @typedef {object} ArrayActions\n\t * @property {Function} addAction - Adds an item to the array.\n\t * @property {Function} deleteAction - Deletes an item from the array.\n\t * @property {Function} loadAction - Loads an array.\n\t * @property {Function} updateAction - Updates an item in the array.\n\t * @property {Function} addManyAction - Adds many items to the array.\n\t */\n\n\t/**\n\t * @typedef {object} ObjectActions\n\t * @property {Function} addAction - Replace old object with new object\n\t * @property {Function} deleteAction - Delete item based on key\n\t * @property {Function} updateAction - Update item based on key\n\t */\n\n\t/**\n\t * Gets the default store actions.\n\t * @returns The default store actions for arrays and objects.\n\t */\n\tget defaultStoreActions() {\n\t\treturn defaultStoreActions;\n\t}\n\n\t/**\n\t * Gets the classes to be removed after the component is connected.\n\t * @returns An array of class names to remove.\n\t */\n\tget removeClassAfterConnect() {\n\t\treturn this.getAttribute('remove-class-after-connect')?.split(' ');\n\t}\n\n\t/**\n\t * Sets the component dependencies.\n\t * @param value The dependencies to set.\n\t */\n\tset dependencies(value) {\n\t\tthis._dependencies = value;\n\t}\n\n\t/**\n\t * Gets the component dependencies.\n\t * @returns The component dependencies.\n\t */\n\tget dependencies() {\n\t\treturn this._dependencies;\n\t}\n\n\t/**\n\t * Processes and combines two templates into one.\n\t * @param pTemplate The primary template.\n\t * @param inputTemplate The secondary template.\n\t * @returns The combined template.\n\t */\n\tstatic processTemplates = (pTemplate, inputTemplate) => {\n\t\tconst newTemplate = document.createElement('template');\n\t\tnewTemplate.innerHTML = [inputTemplate.innerHTML, pTemplate?.innerHTML || ''].join('');\n\t\treturn newTemplate;\n\t};\n\n\t/**\n\t * Defines a custom element if not already defined.\n\t * @param name The name of the custom element.\n\t * @param [elementConstructor] The constructor for the custom element.\n\t * @param [options] Additional options for defining the element.\n\t */\n\tstatic define(name, elementConstructor = this, options = {}) {\n\t\tconst definedElement = customElements.get(name);\n\n\t\tif (!definedElement) {\n\t\t\tcustomElements.define(name, elementConstructor, options);\n\t\t}\n\t}\n\n\t/**\n\t * Defines component dependencies by registering custom elements.\n\t */\n\tdefineDependencies() {\n\t\tif (this.dependencies) {\n\t\t\tObject.entries(this.dependencies).forEach(([name, component]) => WJElement.define(name, component));\n\t\t}\n\t}\n\n\t/**\n\t * Hook for extending behavior before drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tbeforeDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior before drawing\n\t}\n\n\t/**\n\t * Renders the component within the provided context.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj\n\t * @param params Additional parameters or attributes for rendering the component.\n\t * @returns This implementation does not render anything and returns `null`.\n\t * @description\n\t * The `draw` method is responsible for rendering the component's content.\n\t * Override this method in subclasses to define custom rendering logic.\n\t * @example\n\t * class MyComponent extends WJElement {\n\t * draw(context, appStoreObj, params) {\n\t * const div = document.createElement('div');\n\t * div.textContent = 'Hello, world!';\n\t * context.appendChild(div);\n\t * }\n\t * }\n\t */\n\tdraw(context, appStoreObj, params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Hook for extending behavior after drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tafterDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior after drawing\n\t}\n\n\t/**\n\t * Optional hook: return skeleton markup used while async draw is in progress.\n\t * Prefer declarative skeleton via `<div slot=\"skeleton\">...</div>`.\n\t * Return: string | Node | DocumentFragment | null | Promise of those.\n\t */\n\trenderSkeleton(params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Retrieves the delay duration for the skeleton display, determining the value based on a hierarchy of overrides and defaults.\n\t * The method prioritizes in the following order:\n\t * 1. A finite number set as the `_wjSkeletonDelayOverride` property.\n\t * 2. A valid numeric value from the `skeleton-delay` attribute.\n\t * 3. The `skeletonDelayMs` property, if defined with a finite number.\n\t * 4. A default value of 150 if none of the above are set.\n\t * @returns {number} The delay in milliseconds before the skeleton is displayed.\n\t */\n\tget skeletonDelay() {\n\t\tif (Number.isFinite(this._wjSkeletonDelayOverride)) return this._wjSkeletonDelayOverride;\n\n\t\tconst v = this.getAttribute('skeleton-delay');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\tif (Number.isFinite(this.skeletonDelayMs)) return this.skeletonDelayMs;\n\n\t\treturn 150;\n\t}\n\n\t/**\n\t * Retrieves the minimum duration for the skeleton animation.\n\t * The method checks for an internally stored finite value. If unavailable,\n\t * it retrieves the value from the 'skeleton-min-duration' attribute,\n\t * converts it to a number if possible, and uses it. If neither is valid,\n\t * a default duration of 300 is returned.\n\t * @returns {number} The minimum duration for the skeleton animation in milliseconds.\n\t */\n\tget skeletonMinDuration() {\n\t\tif (Number.isFinite(this._wjSkeletonMinDurationOverride)) return this._wjSkeletonMinDurationOverride;\n\n\t\tconst v = this.getAttribute('skeleton-min-duration');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\treturn 300;\n\t}\n\n\t/**\n\t * Sets the minimum duration for the skeleton state. If the provided value is null, undefined, or an empty string,\n\t * the override for the minimum duration is removed.\n\t * @param {string|number|null|undefined} value The minimum duration to be set for the skeleton state. It can be a numeric value, string representation of a number, or null/undefined to reset the value.\n\t */\n\tset skeletonMinDuration(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonMinDurationOverride;\n\t\t\tthis.removeAttribute('skeleton-min-duration');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonMinDurationOverride = n;\n\t\t\tthis.setAttribute('skeleton-min-duration', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Sets or removes the 'skeleton' attribute based on the provided value.\n\t * @param {boolean} value A boolean value indicating whether to set ('true') or remove ('false') the 'skeleton' attribute.\n\t */\n\tset skeleton(value) {\n\t\tif (value) this.setAttribute('skeleton', '');\n\t\telse this.removeAttribute('skeleton');\n\t}\n\n\t/**\n\t * Checks if the 'skeleton' attribute is present on the element.\n\t * @returns {boolean} True if the 'skeleton' attribute exists, false otherwise.\n\t */\n\tget skeleton() {\n\t\treturn this.hasAttribute('skeleton');\n\t}\n\n\t/**\n\t * Sets the delay for the skeleton loading indicator.\n\t * @param {string|number|null|undefined} value The delay value to be set. Accepts a numerical value,\n\t * a string that can be converted to a number, null, or undefined.\n\t * If null or undefined is provided, the skeleton delay will be cleared.\n\t */\n\tset skeletonDelay(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonDelayOverride;\n\t\t\tthis.removeAttribute('skeleton-delay');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonDelayOverride = n;\n\t\t\tthis.setAttribute('skeleton-delay', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the delay value used for skeleton loading.\n\t * @returns {number} The delay value for the skeleton loader.\n\t */\n\tget skeletonDelayValue() {\n\t\treturn this.skeletonDelay;\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is connected to the DOM.\n\t */\n\tconnectedCallback() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.#originalVisibility = this.#originalVisibility ?? this.style.visibility;\n\t\t\tthis.style.visibility = 'hidden';\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.ATTACHED;\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the component, setting up attributes and rendering.\n\t * @param [force] Whether to force initialization.\n\t * @returns A promise that resolves when initialization is complete.\n\t */\n\tinitWjElement = (force = false) => {\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tthis.#drawingStatus = this.drawingStatuses.BEGINING;\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tif (!this.shadowRoot) this.attachShadow({ mode: this.shadowType || 'open', delegatesFocus: true });\n\t\t\t}\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.START;\n\n\t\t\t// Adopt component + skeleton styles BEFORE display, so skeleton is visible in Shadow DOM.\n\t\t\tconst sheet = new CSSStyleSheet();\n\t\t\tsheet.replaceSync(this.constructor.cssStyleSheet);\n\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tconst existing = this.shadowRoot.adoptedStyleSheets || [];\n\t\t\t\tconst next = [...existing];\n\n\t\t\t\tif (!next.includes(sheet)) next.push(sheet);\n\n\t\t\t\tthis.shadowRoot.adoptedStyleSheets = next;\n\t\t\t}\n\n\t\t\tawait this.display(force);\n\n\t\t\tresolve();\n\t\t});\n\t};\n\n\t/**\n\t * Sets up attributes and event listeners for the component.\n\t * This method retrieves all custom events defined for the component\n\t * and adds event listeners for each of them. When an event is triggered,\n\t * it calls the corresponding method on the host element.\n\t */\n\tsetupAttributes() {\n\t\t// Keď neaký element si zadefinuje funkciu \"setupAttributes\" tak sa obsah tejto funkcie nezavolá\n\n\t\tlet allEvents = WjElementUtils.getEvents(this);\n\t\tallEvents.forEach((customEvent, domEvent) => {\n\t\t\tthis.addEventListener(domEvent, (e) => {\n\t\t\t\tthis.getRootNode().host[customEvent]?.();\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Hook for extending behavior before disconnecting the component.\n\t */\n\tbeforeDisconnect() {\n\t\t// Hook for extending behavior before disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior after disconnecting the component.\n\t */\n\tafterDisconnect() {\n\t\t// Hook for extending behavior after disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior before redrawing the component.\n\t */\n\tbeforeRedraw() {\n\t\t// Hook for extending behavior before redrawing\n\t}\n\n\t/**\n\t * Cleans up resources and event listeners for the component.\n\t */\n\tcomponentCleanup() {\n\t\t// Hook for cleaning up the component\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is disconnected from the DOM.\n\t */\n\tdisconnectedCallback() {\n\t\tif (this.#isAttached) {\n\t\t\tthis.beforeDisconnect?.();\n\t\t\tthis.context.innerHTML = '';\n\t\t\tthis.afterDisconnect?.();\n\t\t\tthis.#isAttached = false;\n\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\tthis.#originalVisibility = null;\n\t\t}\n\n\t\tif (this.#isRendering) {\n\t\t\tthis.stopRenderLoop();\n\t\t}\n\n\t\tthis.#drawingStatus = this.drawingStatuses.DISCONNECTED;\n\n\t\tthis.componentCleanup();\n\t}\n\n\t/**\n\t * Enqueues an update for the component.\n\t * This method processes the current render promise and then refreshes the component.\n\t */\n\t#enqueueUpdate() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t}\n\t}\n\n\t/**\n\t * Lifecycle method invoked when an observed attribute changes.\n\t * @param name The name of the attribute that changed.\n\t * @param old The old value of the attribute.\n\t * @param newName The new value of the attribute.\n\t */\n\tattributeChangedCallback(name, old, newName) {\n\t\tif (old !== newName) {\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Triggers a refresh operation by initializing the update lifecycle and setting up promises\n\t * to track its completion or failure status. Marks the instance as not pristine and queues\n\t * an update.\n\t * @returns {void} Does not return a value.\n\t */\n\trefresh() {\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\n\t\tthis.#pristine = false;\n\t\tthis.#enqueueUpdate();\n\t}\n\n\t/**\n\t * Refreshes the component by reinitializing it if it is in a drawing state.\n\t * This method checks if the component's drawing status is at least in the START state.\n\t * If so, it performs the following steps:\n\t * 1. Calls the `beforeRedraw` hook if defined.\n\t * 2. Calls the `beforeDisconnect` hook if defined.\n\t * 3. Refreshes the update promise to manage the rendering lifecycle.\n\t * 4. Calls the `afterDisconnect` hook if defined.\n\t * 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.\n\t * If the component is not in a drawing state, it simply returns a resolved promise.\n\t */\n\tasync #refresh() {\n\t\tif (this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t\treturn; // Skip if async render is still processing\n\t\t}\n\n\t\tif (!this.#pristine) {\n\t\t\tthis.#pristine = true;\n\t\t\tthis.#isRendering = true;\n\n\t\t\tif (this.#isAttached) {\n\t\t\t\tthis.beforeRedraw?.();\n\t\t\t\tthis.beforeDisconnect?.();\n\t\t\t\tthis.afterDisconnect?.();\n\t\t\t} else {\n\t\t\t\tthis.stopRenderLoop();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tawait this.initWjElement(true);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Render error:', error);\n\t\t\t} finally {\n\t\t\t\tthis.#isRendering = false;\n\n\t\t\t\tif (!this.#pristine) {\n\t\t\t\t\tthis.#pristine = false;\n\t\t\t\t\tthis.#enqueueUpdate();\n\t\t\t\t} else {\n\t\t\t\t\tthis.finisPromise();\n\t\t\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Stops the current render loop if it is running by canceling the requestAnimationFrame.\n\t * @returns {void} This method does not return a value.\n\t */\n\tstopRenderLoop() {\n\t\tif (this.rafId) {\n\t\t\tcancelAnimationFrame(this.rafId);\n\t\t\tthis.rafId = null;\n\t\t}\n\t}\n\n\t/**\n\t * Displays the component's content, optionally forcing a re-render.\n\t * @param [force] Whether to force a re-render.\n\t * @returns A promise that resolves when the display is complete.\n\t */\n\tdisplay(force = false) {\n\t\tthis.template = this.constructor.customTemplate || document.createElement('template');\n\n\t\t// Build the next context offscreen\n\t\tconst nextContext = document.createDocumentFragment();\n\t\tnextContext.append(this.template.content.cloneNode(true));\n\n\t\t// Check permission/noShow before DOM swap\n\t\tif (this.noShow || (this.isPermissionCheck && !Permissions.isPermissionFulfilled(this.permission))) {\n\t\t\tthis.remove();\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tlet skeletonTimer = null;\n\t\tlet renderFinished = false;\n\t\tlet skeletonShownAt = null;\n\n\t\tconst clearSkeletonTimer = () => {\n\t\t\tif (skeletonTimer) {\n\t\t\t\tclearTimeout(skeletonTimer);\n\t\t\t\tskeletonTimer = null;\n\t\t\t}\n\t\t};\n\n\t\tconst buildSkeletonFragment = async () => {\n\t\t\tconst slotted = this.querySelector('[slot=\"skeleton\"]');\n\n\t\t\tif (slotted) {\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\t\tconst slot = document.createElement('slot');\n\t\t\t\t\tslot.name = 'skeleton';\n\t\t\t\t\tfrag.append(slot);\n\t\t\t\t\treturn frag;\n\t\t\t\t}\n\n\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\tfrag.append(slotted.cloneNode(true));\n\t\t\t\treturn frag;\n\t\t\t}\n\n\t\t\tconst frag = document.createDocumentFragment();\n\n\t\t\tlet skel = this.renderSkeleton?.(WjElementUtils.getAttributes(this));\n\n\t\t\tif (skel instanceof Promise || skel?.constructor?.name === 'Promise') {\n\t\t\t\tskel = await skel;\n\t\t\t}\n\n\t\t\tif (skel === null || skel === undefined) return null;\n\n\t\t\tlet node;\n\n\t\t\tif (skel instanceof HTMLElement || skel instanceof DocumentFragment) {\n\t\t\t\tnode = skel;\n\t\t\t} else {\n\t\t\t\tconst t = document.createElement('template');\n\t\t\t\tt.innerHTML = skel;\n\t\t\t\tnode = t.content.cloneNode(true);\n\t\t\t}\n\t\t\tfrag.append(node);\n\t\t\treturn frag;\n\t\t};\n\n\t\tconst showSkeleton = async () => {\n\t\t\tif (renderFinished) return;\n\t\t\tif (!this.hasAttribute('skeleton')) return;\n\n\t\t\tconst frag = await buildSkeletonFragment();\n\t\t\tif (!frag) return;\n\n\t\t\ttry {\n\t\t\t\tconst cs = getComputedStyle(this);\n\t\t\t\tif (cs.display === 'inline') this.style.display = 'block';\n\t\t\t\tif (cs.width === '0px') this.style.width = '100%';\n\t\t\t} catch (e) {\n\t\t\t\t// ignore\n\t\t\t}\n\n\t\t\t// REPLACE mode only\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tthis.shadowRoot.replaceChildren(frag);\n\t\t\t} else {\n\t\t\t\tthis.replaceChildren(frag);\n\t\t\t}\n\n\t\t\tskeletonShownAt = performance.now();\n\n\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:show', {\n\t\t\t\tdetail: { delay: this.skeletonDelay },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}));\n\t\t\tif (this.hasAttribute('debug-skeleton')) {\n\t\t\t\tdebugger;\n\t\t\t}\n\t\t};\n\n\t\tif (this.hasAttribute('skeleton') && this.style.visibility === 'hidden') {\n\t\t\tthis.style.visibility = this.#originalVisibility ?? 'visible';\n\t\t}\n\n\t\tlet skeletonPlannedAt;\n\n\t\tif (this.hasAttribute('skeleton')) {\n\t\t\tskeletonPlannedAt = performance.now();\n\t\t\tskeletonTimer = setTimeout(() => {\n\t\t\t\tshowSkeleton();\n\t\t\t}, this.skeletonDelay);\n\t\t}\n\n\t\treturn this.#resolveRender(nextContext, { skipAfterDraw: true })\n\t\t\t.then(async () => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\n\t\t\t\tif (skeletonShownAt === null) {\n\t\t\t\t\tconst elapsed = skeletonPlannedAt ? (performance.now() - skeletonPlannedAt) : 0;\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:skip', {\n\t\t\t\t\t\tdetail: { reason: 'render-finished-fast', elapsedMs: elapsed, delay: this.skeletonDelay },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\t// Skeleton was shown: enforce minimum visible duration to avoid flashing\n\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\tconst visibleFor = now - skeletonShownAt;\n\t\t\t\t\tconst remaining = this.skeletonMinDuration - visibleFor;\n\t\t\t\t\tif (remaining > 0) {\n\t\t\t\t\t\tawait new Promise((r) => setTimeout(r, remaining));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tthis.shadowRoot.replaceChildren(nextContext);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replaceChildren(nextContext);\n\t\t\t\t}\n\n\t\t\t\tif (skeletonShownAt !== null) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:hide', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\treason: 'render-finished',\n\t\t\t\t\t\t\tvisibleMs: Math.max(this.skeletonMinDuration, performance.now() - skeletonShownAt),\n\t\t\t\t\t\t\tdelay: this.skeletonDelay,\n\t\t\t\t\t\t\tminDuration: this.skeletonMinDuration,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tconst liveContext = this.hasShadowRoot ? this.shadowRoot : this;\n\t\t\t\tconst _afterDraw = this.afterDraw?.(liveContext, this.store, WjElementUtils.getAttributes(this));\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\t\t\t\tif (!this.#isRendering) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:hide', {\n\t\t\t\t\t\tdetail: { reason: 'finally' },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Renders the content into the provided target context.\n\t * This method handles asynchronous rendering, processes the output from the `draw` method,\n\t * and appends the resulting content to the specified target context.\n\t * @returns {Promise<void>} A promise that resolves once the render operation is complete and the content is appended to the target context.\n\t * @param targetContext\n\t */\n\tasync render(targetContext = this.context) {\n\t\tthis.#drawingStatus = this.drawingStatuses.DRAWING;\n\n\t\tlet _draw = this.draw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\tif (_draw instanceof Promise || _draw?.constructor.name === 'Promise') {\n\t\t\t_draw = await _draw;\n\t\t}\n\n\t\tlet rend = _draw;\n\t\tlet element;\n\n\t\tif (rend instanceof HTMLElement || rend instanceof DocumentFragment) {\n\t\t\telement = rend;\n\t\t} else {\n\t\t\tlet inputTemplate = document.createElement('template');\n\t\t\tinputTemplate.innerHTML = rend;\n\t\t\telement = inputTemplate.content.cloneNode(true);\n\t\t}\n\n\t\tlet rendered = element;\n\n\t\ttargetContext.appendChild(rendered);\n\t}\n\n\t/**\n\t * Sanitizes a given name by converting it from kebab-case to camelCase.\n\t * @param {string} name The name in kebab-case format (e.g., \"example-name\").\n\t * @returns {string} The sanitized name in camelCase format (e.g., \"exampleName\").\n\t * @example\n\t * sanitizeName('example-name');\n\t * @example\n\t * sanitizeName('my-custom-component');\n\t */\n\tsanitizeName(name) {\n\t\tlet parts = name.split('-');\n\t\treturn [parts.shift(), ...parts.map((n) => n[0].toUpperCase() + n.slice(1))].join('');\n\t}\n\n\t/**\n\t * Checks if a property on an object has a getter or setter method defined.\n\t * @param {object} obj The object on which the property is defined.\n\t * @param {string} property The name of the property to check.\n\t * @returns {object} An object indicating the presence of getter and setter methods.\n\t * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.\n\t * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.\n\t * @example\n\t * const obj = {\n\t * get name() { return 'value'; },\n\t * set name(val) { console.log(val); }\n\t * };\n\t * checkGetterSetter(obj, 'name');\n\t * @example\n\t * const obj = { prop: 42 };\n\t * checkGetterSetter(obj, 'prop');\n\t */\n\tcheckGetterSetter(obj, property) {\n\t\tlet descriptor = Object.getOwnPropertyDescriptor(obj, property);\n\n\t\tif (descriptor) {\n\t\t\treturn {\n\t\t\t\thasGetter: typeof descriptor.get === 'function' ? descriptor.get : null,\n\t\t\t\thasSetter: typeof descriptor.set === 'function' ? descriptor.set : null,\n\t\t\t};\n\t\t}\n\n\t\tlet proto = Object.getPrototypeOf(obj);\n\t\tif (proto) {\n\t\t\treturn this.checkGetterSetter(proto, property);\n\t\t}\n\n\t\treturn { hasGetter: null, hasSetter: null };\n\t}\n\n\t/**\n\t * Sets up accessors (getter and setter) for all attributes of the current object.\n\t * This method retrieves the attribute names, sanitizes them, and dynamically defines\n\t * property accessors for each attribute using `Object.defineProperty`.\n\t * @returns {void} This method does not return any value.\n\t */\n\tsetUpAccessors() {\n\t\tlet attrs = this.getAttributeNames();\n\t\tattrs.forEach((name) => {\n\t\t\tconst sanitizedName = this.sanitizeName(name);\n\n\t\t\tconst { hasGetter, hasSetter } = this.checkGetterSetter(this, sanitizedName);\n\n\t\t\tObject.defineProperty(this, sanitizedName, {\n\t\t\t\tset: hasSetter ?? ((value) => this.setAttribute(name, value)),\n\t\t\t\tget: hasGetter ?? (() => this.getAttribute(name)),\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Resolves the rendering process of the component, using the given target context.\n\t * @param {HTMLElement|ShadowRoot|DocumentFragment} targetContext Target for rendering (defaults to this.context)\n\t * @returns A promise that resolves when rendering is complete.\n\t * @private\n\t */\n\t#resolveRender(targetContext = this.context, { skipAfterDraw = false } = {}) {\n\t\tthis.params = WjElementUtils.getAttributes(this);\n\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tconst _beforeDraw = this.beforeDraw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\tif (_beforeDraw instanceof Promise || _beforeDraw?.constructor.name === 'Promise') {\n\t\t\t\tawait _beforeDraw;\n\t\t\t}\n\n\t\t\tawait this.render(targetContext);\n\n\t\t\tif (!skipAfterDraw) {\n\t\t\t\tconst _afterDraw = this.afterDraw?.(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// RHR toto je bicykel pre slickRouter pretože routovanie nieje vykonané pokiaľ sa nezavolá updateComplete promise,\n\t\t\t// toto bude treba rozšíriť aby sme lepšie vedeli kontrolovať vykreslovanie elementov, a flow hookov.\n\t\t\tthis.#isRendering = false;\n\t\t\tthis.#isAttached = true;\n\n\t\t\tif (this.removeClassAfterConnect) {\n\t\t\t\tthis.classList.remove(...this.removeClassAfterConnect);\n\t\t\t}\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.DONE;\n\n\t\t\tresolve();\n\t\t}).catch((e) => {\n\t\t\tconsole.error(e);\n\t\t});\n\t}\n}\n\nlet __esModule = 'true';\nexport { __esModule, Permissions, WjElementUtils, event };\n"],"names":["frag"],"mappings":";;;;;;;;;;;;;;;;;AAMA,MAAM,WAAW,SAAS,cAAc,UAAU;AAClD,SAAS,YAAY;AAEN,MAAM,aAAN,MAAM,mBAAkB,YAAY;AAAA;AAAA;AAAA;AAAA,EAWlD,cAAc;AACb,UAAO;AAZM;AACd;AACA;AACA;AACA;AACA;AA2dA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAAgB,CAAC,QAAQ,UAAU;AAClC,aAAO,IAAI,QAAQ,OAAO,SAAS,WAAW;;AAC7C,2BAAK,gBAAiB,KAAK,gBAAgB;AAE3C,mBAAK,oBAAL;AACA,YAAI,KAAK,eAAe;AACvB,cAAI,CAAC,KAAK,WAAY,MAAK,aAAa,EAAE,MAAM,KAAK,cAAc,QAAQ,gBAAgB,KAAI,CAAE;AAAA,QACrG;AACG,aAAK,eAAgB;AAErB,2BAAK,gBAAiB,KAAK,gBAAgB;AAG3C,cAAM,QAAQ,IAAI,cAAe;AACjC,cAAM,YAAY,KAAK,YAAY,aAAa;AAEhD,YAAI,KAAK,YAAY;AACpB,gBAAM,WAAW,KAAK,WAAW,sBAAsB,CAAE;AACzD,gBAAM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,aAAK,MAAM,aAAa,mBAAK;AAAA,MAClC;AAAA,IACA;AAAA,EACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwSC,mBAAc,SAAC,gBAAgB,KAAK,SAAS,EAAE,gBAAgB,MAAO,IAAG,IAAI;AAC5E,OAAK,SAAS,eAAe,cAAc,IAAI;AAE/C,SAAO,IAAI,QAAQ,OAAO,SAAS,WAAW;;AAC7C,UAAM,cAAc,KAAK,WAAW,eAAe,KAAK,OAAO,eAAe,cAAc,IAAI,CAAC;AAEjG,QAAI,uBAAuB,YAAW,2CAAa,YAAY,UAAS,WAAW;AAClF,YAAM;AAAA,IACV;AAEG,UAAM,KAAK,OAAO,aAAa;AAE/B,QAAI,CAAC,eAAe;AACnB,YAAM,cAAa,UAAK,cAAL,8BAAiB,eAAe,KAAK,OAAO,eAAe,cAAc,IAAI;AAEhG,UAAI,sBAAsB,YAAW,yCAAY,YAAY,UAAS,WAAW;AAChF,cAAM;AAAA,MACX;AAAA,IACA;AAIG,uBAAK,cAAe;AACpB,uBAAK,aAAc;AAEnB,QAAI,KAAK,yBAAyB;AACjC,WAAK,UAAU,OAAO,GAAG,KAAK,uBAAuB;AAAA,IACzD;AAEG,uBAAK,gBAAiB,KAAK,gBAAgB;AAE3C,YAAS;AAAA,EACZ,CAAG,EAAE,MAAM,CAAC,MAAM;AACf,YAAQ,MAAM,CAAC;AAAA,EAClB,CAAG;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA5sBC,cArRoB,YAqRb,oBAAmB,CAAC,WAAW,kBAAkB;AACvD,QAAM,cAAc,SAAS,cAAc,UAAU;AACrD,cAAY,YAAY,CAAC,cAAc,YAAW,uCAAW,cAAa,EAAE,EAAE,KAAK,EAAE;AACrF,SAAO;AACP;AAzRa,IAAM,YAAN;AAo+BZ,IAAC,aAAa;"}
1
+ {"version":3,"file":"wje-element.js","sources":["../packages/wje-element/element.js"],"sourcesContent":["import { UniversalService } from '../utils/universal-service.js';\nimport { Permissions } from '../utils/permissions.js';\nimport { WjElementUtils } from '../utils/element-utils.js';\nimport { event } from '../utils/event.js';\nimport { defaultStoreActions, store } from '../wje-store/store.js';\n\nconst template = document.createElement('template');\ntemplate.innerHTML = ``;\n\nexport default class WJElement extends HTMLElement {\n\t#drawingStatus;\n\t#isAttached;\n\t#isRendering;\n\t#originalVisibility;\n\t#pristine;\n\n\t/**\n\t * Initializes a new instance of the WJElement class.\n\t */\n\n\tconstructor() {\n\t\tsuper();\n\n\t\t// Initialize ElementInternals when supported.\n\t\tif (typeof this.attachInternals === 'function') {\n\t\t\tthis.internals = this.attachInternals();\n\t\t}\n\n\t\tthis.#isAttached = false;\n\t\tthis.service = new UniversalService({\n\t\t\tstore: store,\n\t\t});\n\n\t\t// definujeme vsetky zavislosti.\n\t\t// Do zavislosti patria len komponenty, ktore su zavisle od ktoreho je zavisly tento komponent\n\t\tthis.defineDependencies();\n\n\t\tthis.#isRendering = false;\n\t\tthis._dependencies = {};\n\n\t\t/**\n\t\t * @typedef {object} DrawingStatuses\n\t\t * @property {number} CREATED - The component has been created.\n\t\t * @property {number} ATTACHED - The component has been attached to the DOM.\n\t\t * @property {number} BEGINING - The component is beginning to draw.\n\t\t * @property {number} START - The component has started drawing.\n\t\t * @property {number} DRAWING - The component is drawing.\n\t\t * @property {number} DONE - The component has finished drawing.\n\t\t * @property {number} DISCONNECTED - The component has been disconnected from the DOM.\n\t\t */\n\n\t\t/**\n\t\t * WJElement is a base class for custom web components with managed lifecycle, attribute/property sync,\n\t\t * permission-based visibility, and extensibility hooks.\n\t\t * @property {boolean} isAttached - True if the component is currently attached to the DOM.\n\t\t * @property {DrawingStatuses} drawingStatuses - Enum of possible drawing states.\n\t\t * @property {number} drawingStatus - Current drawing status (see drawingStatuses).\n\t\t * @property {boolean} _pristine - True if the component has not been updated since last render.\n\t\t * @property {boolean} isRendering - True if a render is currently in progress.\n\t\t * @property {number|null} rafId - ID of the scheduled animation frame for rendering, or null.\n\t\t * @property {string|null} originalVisibility - Stores the original CSS visibility before rendering.\n\t\t * @property {object} params - Stores the current attributes/properties for rendering.\n\t\t * @property {Promise<void>} updateComplete - Promise resolved when the current update/render is complete.\n\t\t * @property {string[]} permission - List of required permissions (from 'permission' attribute).\n\t\t * @property {boolean} isPermissionCheck - Whether permission checking is enabled (from 'permission-check' attribute).\n\t\t * @property {boolean} noShow - Whether the element should be hidden (from 'no-show' attribute).\n\t\t * @property {string|undefined} isShadowRoot - Value of the 'shadow' attribute, if present.\n\t\t * @property {boolean} hasShadowRoot - True if the 'shadow' attribute is present.\n\t\t * @property {string} shadowType - Type of shadow root ('open' by default).\n\t\t * @property {object} store - Reference to the global store instance.\n\t\t * @property {object} defaultStoreActions - Default store actions for arrays and objects.\n\t\t * @property {string[]|undefined} removeClassAfterConnect - Classes to remove after connect (from 'remove-class-after-connect' attribute).\n\t\t * @property {object} dependencies - Registered component dependencies.\n\t\t * @property {HTMLElement|ShadowRoot} context - The rendering context (shadow root or element itself).\n\t\t */\n\t\tthis.drawingStatuses = {\n\t\t\tCREATED: 0,\n\t\t\tATTACHED: 1,\n\t\t\tBEGINING: 2,\n\t\t\tSTART: 3,\n\t\t\tDRAWING: 4,\n\t\t\tDONE: 5,\n\t\t\tDISCONNECTED: 6,\n\t\t};\n\n\t\tthis.#drawingStatus = this.drawingStatuses.CREATED;\n\n\t\tthis.#pristine = true;\n\t\tthis.#isRendering = false;\n\t\tthis.rafId = null;\n\t\tthis.#originalVisibility = null;\n\t\tthis.params = {};\n\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\t}\n\n\tget drawingStatus() {\n\t\treturn this.#drawingStatus;\n\t}\n\n\t/**\n\t * Sets the value of the 'permission' attribute.\n\t * @param {string[]} value The value to set for the 'permission' attribute.\n\t */\n\tset permission(value) {\n\t\tthis.setAttribute('permission', value.join(','));\n\t}\n\n\t/**\n\t * Gets the value of the 'permission-check' attribute.\n\t * @returns {string[]} The value of the 'permission' attribute.\n\t */\n\tget permission() {\n\t\treturn this.getAttribute('permission')?.split(',') || [];\n\t}\n\n\t/**\n\t * Sets the 'permission-check' attribute.\n\t * @param {boolean} value The value to set for the 'permission-check' attribute.\n\t */\n\tset isPermissionCheck(value) {\n\t\tif (value) this.setAttribute('permission-check', '');\n\t\telse this.removeAttribute('permission-check');\n\t}\n\n\t/**\n\t * Checks if the 'permission-check' attribute is present.\n\t * @returns {boolean} True if the 'permission-check' attribute is present.\n\t */\n\tget isPermissionCheck() {\n\t\treturn this.hasAttribute('permission-check');\n\t}\n\n\tset noShow(value) {\n\t\tif (value) this.setAttribute('no-show', '');\n\t\telse this.removeAttribute('no-show');\n\t}\n\n\t/**\n\t * Checks if the 'show' attribute is present.\n\t * @returns {boolean} True if the 'show' attribute is present.\n\t */\n\tget noShow() {\n\t\treturn this.hasAttribute('no-show');\n\t}\n\n\t/**\n\t * Sets the 'shadow' attribute.\n\t * @param {string} value The value to set for the 'shadow' attribute.\n\t */\n\tset isShadowRoot(value) {\n\t\treturn this.setAttribute('shadow', value);\n\t}\n\n\tget isShadowRoot() {\n\t\treturn this.getAttribute('shadow');\n\t}\n\n\t/**\n\t * Checks if the 'shadow' attribute is present.\n\t * @returns {boolean} True if the 'shadow' attribute is present.\n\t */\n\tget hasShadowRoot() {\n\t\treturn this.hasAttribute('shadow');\n\t}\n\n\t/**\n\t * Gets the value of the 'shadow' attribute or 'open' if not set.\n\t * @returns {string} The value of the 'shadow' attribute or 'open'.\n\t */\n\tget shadowType() {\n\t\treturn this.getAttribute('shadow') || 'open';\n\t}\n\n\t/**\n\t * Gets the rendering context, either the shadow root or the component itself.\n\t * @returns The rendering context.\n\t */\n\tget context() {\n\t\tif (this.hasShadowRoot) {\n\t\t\treturn this.shadowRoot;\n\t\t} else {\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t/**\n\t * Gets the store instance.\n\t * @returns {object} The store instance.\n\t */\n\tget store() {\n\t\treturn store;\n\t}\n\n\t/**\n\t * Returns ElementInternals when available.\n\t * @returns {ElementInternals|null}\n\t */\n\tgetInternals() {\n\t\treturn this.internals || null;\n\t}\n\n\t/**\n\t * Sets ARIA state via attributes.\n\t * Accepts camelCase keys without the \"aria\" prefix, plus \"role\".\n\t * Example: setAriaState({ role: 'tab', selected: true, controls: 'panel-1' })\n\t * @param {object} state\n\t */\n\tsetAriaState(state = {}) {\n\t\tif (!state || typeof state !== 'object') return;\n\n\t\tObject.entries(state).forEach(([key, value]) => {\n\t\t\tif (value === undefined || value === null) return;\n\n\t\t\tif (key === 'role') {\n\t\t\t\tthis.setAttribute('role', value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet attr;\n\t\t\tif (key === 'labelledBy') attr = 'aria-labelledby';\n\t\t\telse if (key === 'describedBy') attr = 'aria-describedby';\n\t\t\telse attr = `aria-${key.replace(/([A-Z])/g, '-$1').toLowerCase()}`;\n\t\t\t// Convert booleans to \"true\"/\"false\" strings for aria attributes.\n\t\t\tconst normalized = (typeof value === 'boolean') ? (value ? 'true' : 'false') : value;\n\t\t\tthis.setAttribute(attr, normalized);\n\t\t});\n\t}\n\n\t/**\n\t * @typedef {object} ArrayActions\n\t * @property {Function} addAction - Adds an item to the array.\n\t * @property {Function} deleteAction - Deletes an item from the array.\n\t * @property {Function} loadAction - Loads an array.\n\t * @property {Function} updateAction - Updates an item in the array.\n\t * @property {Function} addManyAction - Adds many items to the array.\n\t */\n\n\t/**\n\t * @typedef {object} ObjectActions\n\t * @property {Function} addAction - Replace old object with new object\n\t * @property {Function} deleteAction - Delete item based on key\n\t * @property {Function} updateAction - Update item based on key\n\t */\n\n\t/**\n\t * Gets the default store actions.\n\t * @returns The default store actions for arrays and objects.\n\t */\n\tget defaultStoreActions() {\n\t\treturn defaultStoreActions;\n\t}\n\n\t/**\n\t * Gets the classes to be removed after the component is connected.\n\t * @returns An array of class names to remove.\n\t */\n\tget removeClassAfterConnect() {\n\t\treturn this.getAttribute('remove-class-after-connect')?.split(' ');\n\t}\n\n\t/**\n\t * Sets the component dependencies.\n\t * @param value The dependencies to set.\n\t */\n\tset dependencies(value) {\n\t\tthis._dependencies = value;\n\t}\n\n\t/**\n\t * Gets the component dependencies.\n\t * @returns The component dependencies.\n\t */\n\tget dependencies() {\n\t\treturn this._dependencies;\n\t}\n\n\t/**\n\t * Processes and combines two templates into one.\n\t * @param pTemplate The primary template.\n\t * @param inputTemplate The secondary template.\n\t * @returns The combined template.\n\t */\n\tstatic processTemplates = (pTemplate, inputTemplate) => {\n\t\tconst newTemplate = document.createElement('template');\n\t\tnewTemplate.innerHTML = [inputTemplate.innerHTML, pTemplate?.innerHTML || ''].join('');\n\t\treturn newTemplate;\n\t};\n\n\t/**\n\t * Defines a custom element if not already defined.\n\t * @param name The name of the custom element.\n\t * @param [elementConstructor] The constructor for the custom element.\n\t * @param [options] Additional options for defining the element.\n\t */\n\tstatic define(name, elementConstructor = this, options = {}) {\n\t\tconst definedElement = customElements.get(name);\n\n\t\tif (!definedElement) {\n\t\t\tcustomElements.define(name, elementConstructor, options);\n\t\t}\n\t}\n\n\t/**\n\t * Defines component dependencies by registering custom elements.\n\t */\n\tdefineDependencies() {\n\t\tif (this.dependencies) {\n\t\t\tObject.entries(this.dependencies).forEach(([name, component]) => WJElement.define(name, component));\n\t\t}\n\t}\n\n\t/**\n\t * Hook for extending behavior before drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tbeforeDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior before drawing\n\t}\n\n\t/**\n\t * Renders the component within the provided context.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj\n\t * @param params Additional parameters or attributes for rendering the component.\n\t * @returns This implementation does not render anything and returns `null`.\n\t * @description\n\t * The `draw` method is responsible for rendering the component's content.\n\t * Override this method in subclasses to define custom rendering logic.\n\t * @example\n\t * class MyComponent extends WJElement {\n\t * draw(context, appStoreObj, params) {\n\t * const div = document.createElement('div');\n\t * div.textContent = 'Hello, world!';\n\t * context.appendChild(div);\n\t * }\n\t * }\n\t */\n\tdraw(context, appStoreObj, params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Hook for extending behavior after drawing the component.\n\t * @param context The rendering context, usually the element's shadow root or main DOM element.\n\t * @param appStoreObj The global application store for managing state.\n\t * @param params Additional parameters or attributes for rendering the component.\n\t */\n\tafterDraw(context, appStoreObj, params) {\n\t\t// Hook for extending behavior after drawing\n\t}\n\n\t/**\n\t * Optional hook: return skeleton markup used while async draw is in progress.\n\t * Prefer declarative skeleton via `<div slot=\"skeleton\">...</div>`.\n\t * Return: string | Node | DocumentFragment | null | Promise of those.\n\t */\n\trenderSkeleton(params) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Retrieves the delay duration for the skeleton display, determining the value based on a hierarchy of overrides and defaults.\n\t * The method prioritizes in the following order:\n\t * 1. A finite number set as the `_wjSkeletonDelayOverride` property.\n\t * 2. A valid numeric value from the `skeleton-delay` attribute.\n\t * 3. The `skeletonDelayMs` property, if defined with a finite number.\n\t * 4. A default value of 150 if none of the above are set.\n\t * @returns {number} The delay in milliseconds before the skeleton is displayed.\n\t */\n\tget skeletonDelay() {\n\t\tif (Number.isFinite(this._wjSkeletonDelayOverride)) return this._wjSkeletonDelayOverride;\n\n\t\tconst v = this.getAttribute('skeleton-delay');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\tif (Number.isFinite(this.skeletonDelayMs)) return this.skeletonDelayMs;\n\n\t\treturn 150;\n\t}\n\n\t/**\n\t * Retrieves the minimum duration for the skeleton animation.\n\t * The method checks for an internally stored finite value. If unavailable,\n\t * it retrieves the value from the 'skeleton-min-duration' attribute,\n\t * converts it to a number if possible, and uses it. If neither is valid,\n\t * a default duration of 300 is returned.\n\t * @returns {number} The minimum duration for the skeleton animation in milliseconds.\n\t */\n\tget skeletonMinDuration() {\n\t\tif (Number.isFinite(this._wjSkeletonMinDurationOverride)) return this._wjSkeletonMinDurationOverride;\n\n\t\tconst v = this.getAttribute('skeleton-min-duration');\n\t\tconst n = (v === null || v === undefined) ? NaN : Number(v);\n\t\tif (Number.isFinite(n)) return n;\n\n\t\treturn 300;\n\t}\n\n\t/**\n\t * Sets the minimum duration for the skeleton state. If the provided value is null, undefined, or an empty string,\n\t * the override for the minimum duration is removed.\n\t * @param {string|number|null|undefined} value The minimum duration to be set for the skeleton state. It can be a numeric value, string representation of a number, or null/undefined to reset the value.\n\t */\n\tset skeletonMinDuration(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonMinDurationOverride;\n\t\t\tthis.removeAttribute('skeleton-min-duration');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonMinDurationOverride = n;\n\t\t\tthis.setAttribute('skeleton-min-duration', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Sets or removes the 'skeleton' attribute based on the provided value.\n\t * @param {boolean} value A boolean value indicating whether to set ('true') or remove ('false') the 'skeleton' attribute.\n\t */\n\tset skeleton(value) {\n\t\tif (value) this.setAttribute('skeleton', '');\n\t\telse this.removeAttribute('skeleton');\n\t}\n\n\t/**\n\t * Checks if the 'skeleton' attribute is present on the element.\n\t * @returns {boolean} True if the 'skeleton' attribute exists, false otherwise.\n\t */\n\tget skeleton() {\n\t\treturn this.hasAttribute('skeleton');\n\t}\n\n\t/**\n\t * Sets the delay for the skeleton loading indicator.\n\t * @param {string|number|null|undefined} value The delay value to be set. Accepts a numerical value,\n\t * a string that can be converted to a number, null, or undefined.\n\t * If null or undefined is provided, the skeleton delay will be cleared.\n\t */\n\tset skeletonDelay(value) {\n\t\tif (value === null || value === undefined || value === '') {\n\t\t\tdelete this._wjSkeletonDelayOverride;\n\t\t\tthis.removeAttribute('skeleton-delay');\n\t\t\treturn;\n\t\t}\n\t\tconst n = Number(value);\n\t\tif (Number.isFinite(n)) {\n\t\t\tthis._wjSkeletonDelayOverride = n;\n\t\t\tthis.setAttribute('skeleton-delay', String(n));\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the delay value used for skeleton loading.\n\t * @returns {number} The delay value for the skeleton loader.\n\t */\n\tget skeletonDelayValue() {\n\t\treturn this.skeletonDelay;\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is connected to the DOM.\n\t */\n\tconnectedCallback() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.#originalVisibility = this.#originalVisibility ?? this.style.visibility;\n\t\t\tthis.style.visibility = 'hidden';\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.ATTACHED;\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the component, setting up attributes and rendering.\n\t * @param [force] Whether to force initialization.\n\t * @returns A promise that resolves when initialization is complete.\n\t */\n\tinitWjElement = (force = false) => {\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tthis.#drawingStatus = this.drawingStatuses.BEGINING;\n\n\t\t\tthis.setupAttributes?.();\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tif (!this.shadowRoot) this.attachShadow({ mode: this.shadowType || 'open', delegatesFocus: true });\n\t\t\t}\n\t\t\tthis.setUpAccessors();\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.START;\n\n\t\t\t// Adopt component + skeleton styles BEFORE display, so skeleton is visible in Shadow DOM.\n\t\t\tconst sheet = new CSSStyleSheet();\n\t\t\tsheet.replaceSync(this.constructor.cssStyleSheet);\n\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tconst existing = this.shadowRoot.adoptedStyleSheets || [];\n\t\t\t\tconst next = [...existing];\n\n\t\t\t\tif (!next.includes(sheet)) next.push(sheet);\n\n\t\t\t\tthis.shadowRoot.adoptedStyleSheets = next;\n\t\t\t}\n\n\t\t\tawait this.display(force);\n\n\t\t\tresolve();\n\t\t});\n\t};\n\n\t/**\n\t * Sets up attributes and event listeners for the component.\n\t * This method retrieves all custom events defined for the component\n\t * and adds event listeners for each of them. When an event is triggered,\n\t * it calls the corresponding method on the host element.\n\t */\n\tsetupAttributes() {\n\t\t// Keď neaký element si zadefinuje funkciu \"setupAttributes\" tak sa obsah tejto funkcie nezavolá\n\n\t\tlet allEvents = WjElementUtils.getEvents(this);\n\t\tallEvents.forEach((customEvent, domEvent) => {\n\t\t\tthis.addEventListener(domEvent, (e) => {\n\t\t\t\tthis.getRootNode().host[customEvent]?.();\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Hook for extending behavior before disconnecting the component.\n\t */\n\tbeforeDisconnect() {\n\t\t// Hook for extending behavior before disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior after disconnecting the component.\n\t */\n\tafterDisconnect() {\n\t\t// Hook for extending behavior after disconnecting\n\t}\n\n\t/**\n\t * Hook for extending behavior before redrawing the component.\n\t */\n\tbeforeRedraw() {\n\t\t// Hook for extending behavior before redrawing\n\t}\n\n\t/**\n\t * Cleans up resources and event listeners for the component.\n\t */\n\tcomponentCleanup() {\n\t\t// Hook for cleaning up the component\n\t}\n\n\t/**\n\t * Lifecycle method invoked when the component is disconnected from the DOM.\n\t */\n\tdisconnectedCallback() {\n\t\tif (this.#isAttached) {\n\t\t\tthis.beforeDisconnect?.();\n\t\t\tthis.context.innerHTML = '';\n\t\t\tthis.afterDisconnect?.();\n\t\t\tthis.#isAttached = false;\n\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\tthis.#originalVisibility = null;\n\t\t}\n\n\t\tif (this.#isRendering) {\n\t\t\tthis.stopRenderLoop();\n\t\t}\n\n\t\tthis.#drawingStatus = this.drawingStatuses.DISCONNECTED;\n\n\t\tthis.componentCleanup();\n\t}\n\n\t/**\n\t * Enqueues an update for the component.\n\t * This method processes the current render promise and then refreshes the component.\n\t */\n\t#enqueueUpdate() {\n\t\tif (!this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t}\n\t}\n\n\t/**\n\t * Lifecycle method invoked when an observed attribute changes.\n\t * @param name The name of the attribute that changed.\n\t * @param old The old value of the attribute.\n\t * @param newName The new value of the attribute.\n\t */\n\tattributeChangedCallback(name, old, newName) {\n\t\tif (old !== newName) {\n\t\t\tthis.#pristine = false;\n\t\t\tthis.#enqueueUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * Triggers a refresh operation by initializing the update lifecycle and setting up promises\n\t * to track its completion or failure status. Marks the instance as not pristine and queues\n\t * an update.\n\t * @returns {void} Does not return a value.\n\t */\n\trefresh() {\n\t\tthis.updateComplete = new Promise((resolve, reject) => {\n\t\t\tthis.finisPromise = resolve;\n\t\t\tthis.rejectPromise = reject;\n\t\t});\n\n\t\tthis.#pristine = false;\n\t\tthis.#enqueueUpdate();\n\t}\n\n\t/**\n\t * Refreshes the component by reinitializing it if it is in a drawing state.\n\t * This method checks if the component's drawing status is at least in the START state.\n\t * If so, it performs the following steps:\n\t * 1. Calls the `beforeRedraw` hook if defined.\n\t * 2. Calls the `beforeDisconnect` hook if defined.\n\t * 3. Refreshes the update promise to manage the rendering lifecycle.\n\t * 4. Calls the `afterDisconnect` hook if defined.\n\t * 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.\n\t * If the component is not in a drawing state, it simply returns a resolved promise.\n\t */\n\tasync #refresh() {\n\t\tif (this.#isRendering) {\n\t\t\tthis.rafId = requestAnimationFrame(() => this.#refresh());\n\t\t\treturn; // Skip if async render is still processing\n\t\t}\n\n\t\tif (!this.#pristine) {\n\t\t\tthis.#pristine = true;\n\t\t\tthis.#isRendering = true;\n\n\t\t\tif (this.#isAttached) {\n\t\t\t\tthis.beforeRedraw?.();\n\t\t\t\tthis.beforeDisconnect?.();\n\t\t\t\tthis.afterDisconnect?.();\n\t\t\t} else {\n\t\t\t\tthis.stopRenderLoop();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tawait this.initWjElement(true);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Render error:', error);\n\t\t\t} finally {\n\t\t\t\tthis.#isRendering = false;\n\n\t\t\t\tif (!this.#pristine) {\n\t\t\t\t\tthis.#pristine = false;\n\t\t\t\t\tthis.#enqueueUpdate();\n\t\t\t\t} else {\n\t\t\t\t\tthis.finisPromise();\n\t\t\t\t\tthis.style.visibility = this.#originalVisibility;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Stops the current render loop if it is running by canceling the requestAnimationFrame.\n\t * @returns {void} This method does not return a value.\n\t */\n\tstopRenderLoop() {\n\t\tif (this.rafId) {\n\t\t\tcancelAnimationFrame(this.rafId);\n\t\t\tthis.rafId = null;\n\t\t}\n\t}\n\n\t/**\n\t * Displays the component's content, optionally forcing a re-render.\n\t * @param [force] Whether to force a re-render.\n\t * @returns A promise that resolves when the display is complete.\n\t */\n\tdisplay(force = false) {\n\t\tthis.template = this.constructor.customTemplate || document.createElement('template');\n\n\t\t// Build the next context offscreen\n\t\tconst nextContext = document.createDocumentFragment();\n\t\tnextContext.append(this.template.content.cloneNode(true));\n\n\t\t// Check permission/noShow before DOM swap\n\t\tif (this.noShow || (this.isPermissionCheck && !Permissions.isPermissionFulfilled(this.permission))) {\n\t\t\tthis.remove();\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tlet skeletonTimer = null;\n\t\tlet renderFinished = false;\n\t\tlet skeletonShownAt = null;\n\n\t\tconst clearSkeletonTimer = () => {\n\t\t\tif (skeletonTimer) {\n\t\t\t\tclearTimeout(skeletonTimer);\n\t\t\t\tskeletonTimer = null;\n\t\t\t}\n\t\t};\n\n\t\tconst buildSkeletonFragment = async () => {\n\t\t\tconst slotted = this.querySelector('[slot=\"skeleton\"]');\n\n\t\t\tif (slotted) {\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\t\tconst slot = document.createElement('slot');\n\t\t\t\t\tslot.name = 'skeleton';\n\t\t\t\t\tfrag.append(slot);\n\t\t\t\t\treturn frag;\n\t\t\t\t}\n\n\t\t\t\tconst frag = document.createDocumentFragment();\n\t\t\t\tfrag.append(slotted.cloneNode(true));\n\t\t\t\treturn frag;\n\t\t\t}\n\n\t\t\tconst frag = document.createDocumentFragment();\n\n\t\t\tlet skel = this.renderSkeleton?.(WjElementUtils.getAttributes(this));\n\n\t\t\tif (skel instanceof Promise || skel?.constructor?.name === 'Promise') {\n\t\t\t\tskel = await skel;\n\t\t\t}\n\n\t\t\tif (skel === null || skel === undefined) return null;\n\n\t\t\tlet node;\n\n\t\t\tif (skel instanceof HTMLElement || skel instanceof DocumentFragment) {\n\t\t\t\tnode = skel;\n\t\t\t} else {\n\t\t\t\tconst t = document.createElement('template');\n\t\t\t\tt.innerHTML = skel;\n\t\t\t\tnode = t.content.cloneNode(true);\n\t\t\t}\n\t\t\tfrag.append(node);\n\t\t\treturn frag;\n\t\t};\n\n\t\tconst showSkeleton = async () => {\n\t\t\tif (renderFinished) return;\n\t\t\tif (!this.hasAttribute('skeleton')) return;\n\n\t\t\tconst frag = await buildSkeletonFragment();\n\t\t\tif (!frag) return;\n\n\t\t\ttry {\n\t\t\t\tconst cs = getComputedStyle(this);\n\t\t\t\tif (cs.display === 'inline') this.style.display = 'block';\n\t\t\t\tif (cs.width === '0px') this.style.width = '100%';\n\t\t\t} catch (e) {\n\t\t\t\t// ignore\n\t\t\t}\n\n\t\t\t// REPLACE mode only\n\t\t\tif (this.hasShadowRoot) {\n\t\t\t\tthis.shadowRoot.replaceChildren(frag);\n\t\t\t} else {\n\t\t\t\tthis.replaceChildren(frag);\n\t\t\t}\n\n\t\t\tskeletonShownAt = performance.now();\n\n\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:show', {\n\t\t\t\tdetail: { delay: this.skeletonDelay },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}));\n\t\t\tif (this.hasAttribute('debug-skeleton')) {\n\t\t\t\tdebugger;\n\t\t\t}\n\t\t};\n\n\t\tif (this.hasAttribute('skeleton') && this.style.visibility === 'hidden') {\n\t\t\tthis.style.visibility = this.#originalVisibility ?? 'visible';\n\t\t}\n\n\t\tlet skeletonPlannedAt;\n\n\t\tif (this.hasAttribute('skeleton')) {\n\t\t\tskeletonPlannedAt = performance.now();\n\t\t\tskeletonTimer = setTimeout(() => {\n\t\t\t\tshowSkeleton();\n\t\t\t}, this.skeletonDelay);\n\t\t}\n\n\t\treturn this.#resolveRender(nextContext, { skipAfterDraw: true })\n\t\t\t.then(async () => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\n\t\t\t\tif (skeletonShownAt === null) {\n\t\t\t\t\tconst elapsed = skeletonPlannedAt ? (performance.now() - skeletonPlannedAt) : 0;\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:skip', {\n\t\t\t\t\t\tdetail: { reason: 'render-finished-fast', elapsedMs: elapsed, delay: this.skeletonDelay },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\t// Skeleton was shown: enforce minimum visible duration to avoid flashing\n\t\t\t\t\tconst now = performance.now();\n\t\t\t\t\tconst visibleFor = now - skeletonShownAt;\n\t\t\t\t\tconst remaining = this.skeletonMinDuration - visibleFor;\n\t\t\t\t\tif (remaining > 0) {\n\t\t\t\t\t\tawait new Promise((r) => setTimeout(r, remaining));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.hasShadowRoot) {\n\t\t\t\t\tthis.shadowRoot.replaceChildren(nextContext);\n\t\t\t\t} else {\n\t\t\t\t\tthis.replaceChildren(nextContext);\n\t\t\t\t}\n\n\t\t\t\tif (skeletonShownAt !== null) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:hide', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\treason: 'render-finished',\n\t\t\t\t\t\t\tvisibleMs: Math.max(this.skeletonMinDuration, performance.now() - skeletonShownAt),\n\t\t\t\t\t\t\tdelay: this.skeletonDelay,\n\t\t\t\t\t\t\tminDuration: this.skeletonMinDuration,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tconst liveContext = this.hasShadowRoot ? this.shadowRoot : this;\n\t\t\t\tconst _afterDraw = this.afterDraw?.(liveContext, this.store, WjElementUtils.getAttributes(this));\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\trenderFinished = true;\n\t\t\t\tclearSkeletonTimer();\n\t\t\t\tif (!this.#isRendering) {\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent('wj:skeleton:hide', {\n\t\t\t\t\t\tdetail: { reason: 'finally' },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Renders the content into the provided target context.\n\t * This method handles asynchronous rendering, processes the output from the `draw` method,\n\t * and appends the resulting content to the specified target context.\n\t * @returns {Promise<void>} A promise that resolves once the render operation is complete and the content is appended to the target context.\n\t * @param targetContext\n\t */\n\tasync render(targetContext = this.context) {\n\t\tthis.#drawingStatus = this.drawingStatuses.DRAWING;\n\n\t\tlet _draw = this.draw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\tif (_draw instanceof Promise || _draw?.constructor.name === 'Promise') {\n\t\t\t_draw = await _draw;\n\t\t}\n\n\t\tlet rend = _draw;\n\t\tlet element;\n\n\t\tif (rend instanceof HTMLElement || rend instanceof DocumentFragment) {\n\t\t\telement = rend;\n\t\t} else {\n\t\t\tlet inputTemplate = document.createElement('template');\n\t\t\tinputTemplate.innerHTML = rend;\n\t\t\telement = inputTemplate.content.cloneNode(true);\n\t\t}\n\n\t\tlet rendered = element;\n\n\t\ttargetContext.appendChild(rendered);\n\t}\n\n\t/**\n\t * Sanitizes a given name by converting it from kebab-case to camelCase.\n\t * @param {string} name The name in kebab-case format (e.g., \"example-name\").\n\t * @returns {string} The sanitized name in camelCase format (e.g., \"exampleName\").\n\t * @example\n\t * sanitizeName('example-name');\n\t * @example\n\t * sanitizeName('my-custom-component');\n\t */\n\tsanitizeName(name) {\n\t\tlet parts = name.split('-');\n\t\treturn [parts.shift(), ...parts.map((n) => n[0].toUpperCase() + n.slice(1))].join('');\n\t}\n\n\t/**\n\t * Checks if a property on an object has a getter or setter method defined.\n\t * @param {object} obj The object on which the property is defined.\n\t * @param {string} property The name of the property to check.\n\t * @returns {object} An object indicating the presence of getter and setter methods.\n\t * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.\n\t * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.\n\t * @example\n\t * const obj = {\n\t * get name() { return 'value'; },\n\t * set name(val) { console.log(val); }\n\t * };\n\t * checkGetterSetter(obj, 'name');\n\t * @example\n\t * const obj = { prop: 42 };\n\t * checkGetterSetter(obj, 'prop');\n\t */\n\tcheckGetterSetter(obj, property) {\n\t\tlet descriptor = Object.getOwnPropertyDescriptor(obj, property);\n\n\t\tif (descriptor) {\n\t\t\treturn {\n\t\t\t\thasGetter: typeof descriptor.get === 'function' ? descriptor.get : null,\n\t\t\t\thasSetter: typeof descriptor.set === 'function' ? descriptor.set : null,\n\t\t\t};\n\t\t}\n\n\t\tlet proto = Object.getPrototypeOf(obj);\n\t\tif (proto) {\n\t\t\treturn this.checkGetterSetter(proto, property);\n\t\t}\n\n\t\treturn { hasGetter: null, hasSetter: null };\n\t}\n\n\t/**\n\t * Sets up accessors (getter and setter) for all attributes of the current object.\n\t * This method retrieves the attribute names, sanitizes them, and dynamically defines\n\t * property accessors for each attribute using `Object.defineProperty`.\n\t * @returns {void} This method does not return any value.\n\t */\n\tsetUpAccessors() {\n\t\tlet attrs = this.getAttributeNames();\n\t\tattrs.forEach((name) => {\n\t\t\tconst sanitizedName = this.sanitizeName(name);\n\n\t\t\tconst { hasGetter, hasSetter } = this.checkGetterSetter(this, sanitizedName);\n\n\t\t\tObject.defineProperty(this, sanitizedName, {\n\t\t\t\tset: hasSetter ?? ((value) => this.setAttribute(name, value)),\n\t\t\t\tget: hasGetter ?? (() => this.getAttribute(name)),\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Resolves the rendering process of the component, using the given target context.\n\t * @param {HTMLElement|ShadowRoot|DocumentFragment} targetContext Target for rendering (defaults to this.context)\n\t * @returns A promise that resolves when rendering is complete.\n\t * @private\n\t */\n\t#resolveRender(targetContext = this.context, { skipAfterDraw = false } = {}) {\n\t\tthis.params = WjElementUtils.getAttributes(this);\n\n\t\treturn new Promise(async (resolve, reject) => {\n\t\t\tconst _beforeDraw = this.beforeDraw(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\tif (_beforeDraw instanceof Promise || _beforeDraw?.constructor.name === 'Promise') {\n\t\t\t\tawait _beforeDraw;\n\t\t\t}\n\n\t\t\tawait this.render(targetContext);\n\n\t\t\tif (!skipAfterDraw) {\n\t\t\t\tconst _afterDraw = this.afterDraw?.(targetContext, this.store, WjElementUtils.getAttributes(this));\n\n\t\t\t\tif (_afterDraw instanceof Promise || _afterDraw?.constructor.name === 'Promise') {\n\t\t\t\t\tawait _afterDraw;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// RHR toto je bicykel pre slickRouter pretože routovanie nieje vykonané pokiaľ sa nezavolá updateComplete promise,\n\t\t\t// toto bude treba rozšíriť aby sme lepšie vedeli kontrolovať vykreslovanie elementov, a flow hookov.\n\t\t\tthis.#isRendering = false;\n\t\t\tthis.#isAttached = true;\n\n\t\t\tif (this.removeClassAfterConnect) {\n\t\t\t\tthis.classList.remove(...this.removeClassAfterConnect);\n\t\t\t}\n\n\t\t\tthis.#drawingStatus = this.drawingStatuses.DONE;\n\n\t\t\tresolve();\n\t\t}).catch((e) => {\n\t\t\tconsole.error(e);\n\t\t});\n\t}\n}\n\nlet __esModule = 'true';\nexport { __esModule, Permissions, WjElementUtils, event };\n"],"names":["frag"],"mappings":";;;;;;;;;;;;;;;;;AAMA,MAAM,WAAW,SAAS,cAAc,UAAU;AAClD,SAAS,YAAY;AAEN,MAAM,aAAN,MAAM,mBAAkB,YAAY;AAAA;AAAA;AAAA;AAAA,EAWlD,cAAc;AACb,UAAK;AAZQ;AACd;AACA;AACA;AACA;AACA;AA2dA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAAgB,CAAC,QAAQ,UAAU;AAClC,aAAO,IAAI,QAAQ,OAAO,SAAS,WAAW;;AAC7C,2BAAK,gBAAiB,KAAK,gBAAgB;AAE3C,mBAAK,oBAAL;AACA,YAAI,KAAK,eAAe;AACvB,cAAI,CAAC,KAAK,WAAY,MAAK,aAAa,EAAE,MAAM,KAAK,cAAc,QAAQ,gBAAgB,KAAI,CAAE;AAAA,QAClG;AACA,aAAK,eAAc;AAEnB,2BAAK,gBAAiB,KAAK,gBAAgB;AAG3C,cAAM,QAAQ,IAAI,cAAa;AAC/B,cAAM,YAAY,KAAK,YAAY,aAAa;AAEhD,YAAI,KAAK,YAAY;AACpB,gBAAM,WAAW,KAAK,WAAW,sBAAsB,CAAA;AACvD,gBAAM,OAAO,CAAC,GAAG,QAAQ;AAEzB,cAAI,CAAC,KAAK,SAAS,KAAK,EAAG,MAAK,KAAK,KAAK;AAE1C,eAAK,WAAW,qBAAqB;AAAA,QACtC;AAEA,cAAM,KAAK,QAAQ,KAAK;AAExB,gBAAO;AAAA,MACR,CAAC;AAAA,IACF;AA9eC,QAAI,OAAO,KAAK,oBAAoB,YAAY;AAC/C,WAAK,YAAY,KAAK,gBAAe;AAAA,IACtC;AAEA,uBAAK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