wj-elements 0.2.0-alpha.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (385) hide show
  1. package/dist/dark.css +15 -1
  2. package/dist/{form-associated-element-o0UjvdUp.js → form-associated-element-DEQ4y-jn.js} +1 -2
  3. package/dist/form-associated-element-DEQ4y-jn.js.map +1 -0
  4. package/dist/{icon-DY5AZ6xM.js → icon-DVyMc4Wv.js} +36 -2
  5. package/dist/{icon-DY5AZ6xM.js.map → icon-DVyMc4Wv.js.map} +1 -1
  6. package/dist/{packages/internals → internals}/form-associated-element.d.ts +0 -1
  7. package/dist/light.css +7 -2
  8. package/dist/localize.js +8 -5
  9. package/dist/localize.js.map +1 -1
  10. package/dist/{popup.element-DeajFyOQ.js → popup.element-Cl6QeG8M.js} +2 -2
  11. package/dist/{popup.element-DeajFyOQ.js.map → popup.element-Cl6QeG8M.js.map} +1 -1
  12. package/dist/skeleton.css +197 -0
  13. package/dist/utils/utils.d.ts +17 -0
  14. package/dist/utils.js +18 -1
  15. package/dist/utils.js.map +1 -1
  16. package/dist/{packages/wje-accordion-item → wje-accordion-item}/accordion-item.element.d.ts +3 -0
  17. package/dist/wje-accordion-item.js +26 -4
  18. package/dist/wje-accordion-item.js.map +1 -1
  19. package/dist/wje-accordion.js +1 -0
  20. package/dist/wje-accordion.js.map +1 -1
  21. package/dist/wje-animation.js +1 -0
  22. package/dist/wje-animation.js.map +1 -1
  23. package/dist/{packages/wje-avatar → wje-avatar}/avatar.element.d.ts +5 -0
  24. package/dist/wje-avatar.js +18 -0
  25. package/dist/wje-avatar.js.map +1 -1
  26. package/dist/wje-badge.js +1 -0
  27. package/dist/wje-badge.js.map +1 -1
  28. package/dist/{packages/wje-breadcrumb → wje-breadcrumb}/breadcrumb.element.d.ts +1 -0
  29. package/dist/wje-breadcrumb.js +13 -1
  30. package/dist/wje-breadcrumb.js.map +1 -1
  31. package/dist/wje-breadcrumbs.js +1 -0
  32. package/dist/wje-breadcrumbs.js.map +1 -1
  33. package/dist/{packages/wje-button → wje-button}/button.element.d.ts +5 -1
  34. package/dist/{packages/wje-button-group → wje-button-group}/button-group.element.d.ts +4 -0
  35. package/dist/wje-button-group.js +10 -0
  36. package/dist/wje-button-group.js.map +1 -1
  37. package/dist/wje-button.js +29 -5
  38. package/dist/wje-button.js.map +1 -1
  39. package/dist/{packages/wje-card → wje-card}/card.element.d.ts +15 -6
  40. package/dist/wje-card.js +37 -0
  41. package/dist/wje-card.js.map +1 -1
  42. package/dist/{packages/wje-carousel → wje-carousel}/carousel.element.d.ts +4 -0
  43. package/dist/wje-carousel.js +38 -4
  44. package/dist/wje-carousel.js.map +1 -1
  45. package/dist/{packages/wje-checkbox → wje-checkbox}/checkbox.element.d.ts +14 -0
  46. package/dist/wje-checkbox.js +48 -3
  47. package/dist/wje-checkbox.js.map +1 -1
  48. package/dist/{packages/wje-chip → wje-chip}/chip.element.d.ts +6 -0
  49. package/dist/wje-chip.js +22 -0
  50. package/dist/wje-chip.js.map +1 -1
  51. package/dist/{packages/wje-color-picker → wje-color-picker}/color-picker.element.d.ts +43 -1
  52. package/dist/wje-color-picker.js +143 -29
  53. package/dist/wje-color-picker.js.map +1 -1
  54. package/dist/{packages/wje-copy-button → wje-copy-button}/copy-button.element.d.ts +4 -0
  55. package/dist/wje-copy-button.js +21 -0
  56. package/dist/wje-copy-button.js.map +1 -1
  57. package/dist/{packages/wje-dialog → wje-dialog}/dialog.element.d.ts +2 -0
  58. package/dist/wje-dialog.js +35 -2
  59. package/dist/wje-dialog.js.map +1 -1
  60. package/dist/{packages/wje-dropdown → wje-dropdown}/dropdown.element.d.ts +7 -0
  61. package/dist/wje-dropdown.js +27 -3
  62. package/dist/wje-dropdown.js.map +1 -1
  63. package/dist/{packages/wje-element → wje-element}/element.d.ts +55 -24
  64. package/dist/wje-element.js +87 -242
  65. package/dist/wje-element.js.map +1 -1
  66. package/dist/{packages/wje-file-upload → wje-file-upload}/file-upload.element.d.ts +17 -6
  67. package/dist/{packages/wje-file-upload → wje-file-upload}/service/service.d.ts +0 -23
  68. package/dist/{packages/wje-file-upload-item → wje-file-upload-item}/file-upload-item.element.d.ts +6 -0
  69. package/dist/wje-file-upload-item.js +24 -2
  70. package/dist/wje-file-upload-item.js.map +1 -1
  71. package/dist/wje-file-upload.js +100 -77
  72. package/dist/wje-file-upload.js.map +1 -1
  73. package/dist/{packages/wje-format-digital → wje-format-digital}/format-digital.element.d.ts +2 -0
  74. package/dist/wje-format-digital.js +9 -0
  75. package/dist/wje-format-digital.js.map +1 -1
  76. package/dist/{packages/wje-icon → wje-icon}/icon.element.d.ts +11 -0
  77. package/dist/{packages/wje-icon-picker → wje-icon-picker}/icon-picker.element.d.ts +4 -0
  78. package/dist/wje-icon-picker.js +15 -0
  79. package/dist/wje-icon-picker.js.map +1 -1
  80. package/dist/wje-icon.js +1 -1
  81. package/dist/{packages/wje-img → wje-img}/img.element.d.ts +1 -0
  82. package/dist/wje-img-comparer.js +5 -1
  83. package/dist/wje-img-comparer.js.map +1 -1
  84. package/dist/wje-img.js +16 -1
  85. package/dist/wje-img.js.map +1 -1
  86. package/dist/{packages/wje-infinite-scroll → wje-infinite-scroll}/infinite-scroll.element.d.ts +4 -0
  87. package/dist/wje-infinite-scroll.js +10 -0
  88. package/dist/wje-infinite-scroll.js.map +1 -1
  89. package/dist/{packages/wje-input → wje-input}/input.element.d.ts +9 -1
  90. package/dist/wje-input-file.js +2 -0
  91. package/dist/wje-input-file.js.map +1 -1
  92. package/dist/wje-input.js +59 -4
  93. package/dist/wje-input.js.map +1 -1
  94. package/dist/{packages/wje-item → wje-item}/item.element.d.ts +8 -0
  95. package/dist/wje-item.js +14 -0
  96. package/dist/wje-item.js.map +1 -1
  97. package/dist/{packages/wje-kanban → wje-kanban}/kanban.element.d.ts +4 -0
  98. package/dist/wje-kanban.js +14 -0
  99. package/dist/wje-kanban.js.map +1 -1
  100. package/dist/{packages/wje-level-indicator → wje-level-indicator}/level-indicator.element.d.ts +17 -0
  101. package/dist/wje-level-indicator.js +36 -0
  102. package/dist/wje-level-indicator.js.map +1 -1
  103. package/dist/{packages/wje-list → wje-list}/list.element.d.ts +4 -0
  104. package/dist/wje-list.js +10 -0
  105. package/dist/wje-list.js.map +1 -1
  106. package/dist/wje-master.js +11 -2
  107. package/dist/wje-master.js.map +1 -1
  108. package/dist/wje-menu-button.js +1 -0
  109. package/dist/wje-menu-button.js.map +1 -1
  110. package/dist/{packages/wje-menu-item → wje-menu-item}/menu-item.element.d.ts +4 -0
  111. package/dist/wje-menu-item.js +24 -0
  112. package/dist/wje-menu-item.js.map +1 -1
  113. package/dist/wje-menu.js +4 -1
  114. package/dist/wje-menu.js.map +1 -1
  115. package/dist/{packages/wje-option → wje-option}/option.element.d.ts +4 -0
  116. package/dist/wje-option.js +14 -1
  117. package/dist/wje-option.js.map +1 -1
  118. package/dist/{packages/wje-options → wje-options}/options.element.d.ts +4 -0
  119. package/dist/wje-options.js +13 -0
  120. package/dist/wje-options.js.map +1 -1
  121. package/dist/{packages/wje-orgchart → wje-orgchart}/orgchart.element.d.ts +4 -0
  122. package/dist/wje-orgchart.js +9 -0
  123. package/dist/wje-orgchart.js.map +1 -1
  124. package/dist/wje-pagination.js +18 -9
  125. package/dist/wje-pagination.js.map +1 -1
  126. package/dist/wje-popup.js +1 -1
  127. package/dist/{packages/wje-progress-bar → wje-progress-bar}/progress-bar.element.d.ts +11 -0
  128. package/dist/wje-progress-bar.js +26 -0
  129. package/dist/wje-progress-bar.js.map +1 -1
  130. package/dist/wje-qr-code/qr-code.element.d.ts +96 -0
  131. package/dist/wje-qr-code.js +159 -17
  132. package/dist/wje-qr-code.js.map +1 -1
  133. package/dist/{packages/wje-radio → wje-radio}/radio.element.d.ts +5 -0
  134. package/dist/{packages/wje-radio-group → wje-radio-group}/radio-group.element.d.ts +16 -1
  135. package/dist/wje-radio-group.js +49 -2
  136. package/dist/wje-radio-group.js.map +1 -1
  137. package/dist/wje-radio.js +27 -1
  138. package/dist/wje-radio.js.map +1 -1
  139. package/dist/{packages/wje-rate → wje-rate}/rate.element.d.ts +4 -0
  140. package/dist/wje-rate.js +23 -1
  141. package/dist/wje-rate.js.map +1 -1
  142. package/dist/{packages/wje-relative-time → wje-relative-time}/relative-time.element.d.ts +2 -0
  143. package/dist/wje-relative-time.js +14 -1
  144. package/dist/wje-relative-time.js.map +1 -1
  145. package/dist/{packages/wje-reorder → wje-reorder}/reorder.element.d.ts +4 -0
  146. package/dist/{packages/wje-reorder-handle → wje-reorder-handle}/reorder-handle.element.d.ts +4 -0
  147. package/dist/wje-reorder-handle.js +21 -0
  148. package/dist/wje-reorder-handle.js.map +1 -1
  149. package/dist/wje-reorder.js +10 -0
  150. package/dist/wje-reorder.js.map +1 -1
  151. package/dist/{packages/wje-select → wje-select}/select.element.d.ts +7 -0
  152. package/dist/wje-select.js +35 -5
  153. package/dist/wje-select.js.map +1 -1
  154. package/dist/{packages/wje-slider → wje-slider}/slider.element.d.ts +5 -0
  155. package/dist/wje-slider.js +51 -1
  156. package/dist/wje-slider.js.map +1 -1
  157. package/dist/{packages/wje-sliding-container → wje-sliding-container}/sliding-container.element.d.ts +4 -0
  158. package/dist/wje-sliding-container.js +18 -0
  159. package/dist/wje-sliding-container.js.map +1 -1
  160. package/dist/{packages/wje-split-view → wje-split-view}/split-view.element.d.ts +1 -0
  161. package/dist/wje-split-view.js +9 -0
  162. package/dist/wje-split-view.js.map +1 -1
  163. package/dist/wje-status.js +1 -0
  164. package/dist/wje-status.js.map +1 -1
  165. package/dist/{packages/wje-stepper → wje-stepper}/stepper.element.d.ts +1 -0
  166. package/dist/wje-stepper.js +24 -1
  167. package/dist/wje-stepper.js.map +1 -1
  168. package/dist/{packages/wje-tab → wje-tab}/tab.element.d.ts +10 -0
  169. package/dist/{packages/wje-tab-group → wje-tab-group}/tab-group.element.d.ts +11 -0
  170. package/dist/wje-tab-group.js +59 -2
  171. package/dist/wje-tab-group.js.map +1 -1
  172. package/dist/wje-tab.js +30 -0
  173. package/dist/wje-tab.js.map +1 -1
  174. package/dist/{packages/wje-textarea → wje-textarea}/textarea.element.d.ts +20 -1
  175. package/dist/wje-textarea.js +96 -14
  176. package/dist/wje-textarea.js.map +1 -1
  177. package/dist/{packages/wje-thumbnail → wje-thumbnail}/thumbnail.element.d.ts +4 -0
  178. package/dist/wje-thumbnail.js +19 -0
  179. package/dist/wje-thumbnail.js.map +1 -1
  180. package/dist/{packages/wje-timeline → wje-timeline}/timeline.element.d.ts +4 -0
  181. package/dist/wje-toast.js +4 -0
  182. package/dist/wje-toast.js.map +1 -1
  183. package/dist/{packages/wje-toggle → wje-toggle}/toggle.element.d.ts +4 -0
  184. package/dist/wje-toggle.js +17 -1
  185. package/dist/wje-toggle.js.map +1 -1
  186. package/dist/{packages/wje-toolbar → wje-toolbar}/toolbar.element.d.ts +4 -0
  187. package/dist/wje-toolbar.js +14 -0
  188. package/dist/wje-toolbar.js.map +1 -1
  189. package/dist/{packages/wje-tooltip → wje-tooltip}/tooltip.element.d.ts +3 -0
  190. package/dist/wje-tooltip.js +31 -7
  191. package/dist/wje-tooltip.js.map +1 -1
  192. package/dist/{packages/wje-tree → wje-tree}/tree.element.d.ts +4 -0
  193. package/dist/{packages/wje-tree-item → wje-tree-item}/tree-item.element.d.ts +5 -0
  194. package/dist/wje-tree-item.js +41 -5
  195. package/dist/wje-tree-item.js.map +1 -1
  196. package/dist/wje-tree.js +12 -1
  197. package/dist/wje-tree.js.map +1 -1
  198. package/package.json +21 -2
  199. package/dist/form-associated-element-o0UjvdUp.js.map +0 -1
  200. package/dist/packages/utils/utils.d.ts +0 -1
  201. package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
  202. package/dist/packages/wje-animation/animation.test.d.ts +0 -1
  203. package/dist/packages/wje-avatar/avatar.test.d.ts +0 -1
  204. package/dist/packages/wje-badge/badge.test.d.ts +0 -1
  205. package/dist/packages/wje-breadcrumbs/breadcrumbs.test.d.ts +0 -1
  206. package/dist/packages/wje-button/button.test.d.ts +0 -1
  207. package/dist/packages/wje-chip/chip.test.d.ts +0 -1
  208. package/dist/packages/wje-color-picker/color-picker.test.d.ts +0 -1
  209. package/dist/packages/wje-file-upload/file-upload.test.d.ts +0 -1
  210. package/dist/packages/wje-format-digital/format-digital.test.d.ts +0 -1
  211. package/dist/packages/wje-pagination/pagination.test.d.ts +0 -1
  212. package/dist/packages/wje-qr-code/qr-code.element.d.ts +0 -33
  213. package/dist/packages/wje-relative-time/relative-time.test.d.ts +0 -1
  214. package/dist/packages/wje-select/select.test.d.ts +0 -1
  215. package/dist/packages/wje-tab-group/tab-group.test.d.ts +0 -1
  216. package/dist/packages/wje-toast/toast.test.d.ts +0 -1
  217. package/dist/packages/wje-toggle/toggle.test.d.ts +0 -1
  218. package/dist/packages/wje-tree/tree.test.d.ts +0 -1
  219. package/dist/packages/wje-tree-item/tree-item.test.d.ts +0 -1
  220. /package/dist/{packages/index.d.ts → index.d.ts} +0 -0
  221. /package/dist/{packages/localize → localize}/localize.d.ts +0 -0
  222. /package/dist/{packages/translations → translations}/en-gb.d.ts +0 -0
  223. /package/dist/{packages/translations → translations}/sk-sk.d.ts +0 -0
  224. /package/dist/{packages/utils → utils}/animations.d.ts +0 -0
  225. /package/dist/{packages/utils → utils}/base-path.d.ts +0 -0
  226. /package/dist/{packages/utils → utils}/date.d.ts +0 -0
  227. /package/dist/{packages/utils → utils}/element-utils.d.ts +0 -0
  228. /package/dist/{packages/utils → utils}/event.d.ts +0 -0
  229. /package/dist/{packages/utils → utils}/icon-library.d.ts +0 -0
  230. /package/dist/{packages/utils → utils}/localize.d.ts +0 -0
  231. /package/dist/{packages/utils → utils}/permissions.d.ts +0 -0
  232. /package/dist/{packages/utils → utils}/universal-service.d.ts +0 -0
  233. /package/dist/{packages/wje-accordion → wje-accordion}/accordion.d.ts +0 -0
  234. /package/dist/{packages/wje-accordion → wje-accordion}/accordion.element.d.ts +0 -0
  235. /package/dist/{packages/wje-accordion-item → wje-accordion-item}/accordion-item.d.ts +0 -0
  236. /package/dist/{packages/wje-animation → wje-animation}/animation.d.ts +0 -0
  237. /package/dist/{packages/wje-animation → wje-animation}/animation.element.d.ts +0 -0
  238. /package/dist/{packages/wje-aside → wje-aside}/aside.d.ts +0 -0
  239. /package/dist/{packages/wje-aside → wje-aside}/aside.element.d.ts +0 -0
  240. /package/dist/{packages/wje-avatar → wje-avatar}/avatar.d.ts +0 -0
  241. /package/dist/{packages/wje-avatar → wje-avatar}/service/service.d.ts +0 -0
  242. /package/dist/{packages/wje-badge → wje-badge}/badge.d.ts +0 -0
  243. /package/dist/{packages/wje-badge → wje-badge}/badge.element.d.ts +0 -0
  244. /package/dist/{packages/wje-breadcrumb → wje-breadcrumb}/breadcrumb.d.ts +0 -0
  245. /package/dist/{packages/wje-breadcrumbs → wje-breadcrumbs}/breadcrumbs.d.ts +0 -0
  246. /package/dist/{packages/wje-breadcrumbs → wje-breadcrumbs}/breadcrumbs.element.d.ts +0 -0
  247. /package/dist/{packages/wje-button → wje-button}/button.d.ts +0 -0
  248. /package/dist/{packages/wje-button-group → wje-button-group}/button-group.d.ts +0 -0
  249. /package/dist/{packages/wje-card → wje-card}/card.d.ts +0 -0
  250. /package/dist/{packages/wje-card-content → wje-card-content}/card-content.d.ts +0 -0
  251. /package/dist/{packages/wje-card-content → wje-card-content}/card-content.element.d.ts +0 -0
  252. /package/dist/{packages/wje-card-controls → wje-card-controls}/card-controls.d.ts +0 -0
  253. /package/dist/{packages/wje-card-controls → wje-card-controls}/card-controls.element.d.ts +0 -0
  254. /package/dist/{packages/wje-card-header → wje-card-header}/card-header.d.ts +0 -0
  255. /package/dist/{packages/wje-card-header → wje-card-header}/card-header.element.d.ts +0 -0
  256. /package/dist/{packages/wje-card-subtitle → wje-card-subtitle}/card-subtitle.d.ts +0 -0
  257. /package/dist/{packages/wje-card-subtitle → wje-card-subtitle}/card-subtitle.element.d.ts +0 -0
  258. /package/dist/{packages/wje-card-title → wje-card-title}/card-title.d.ts +0 -0
  259. /package/dist/{packages/wje-card-title → wje-card-title}/card-title.element.d.ts +0 -0
  260. /package/dist/{packages/wje-carousel → wje-carousel}/carousel.d.ts +0 -0
  261. /package/dist/{packages/wje-carousel-item → wje-carousel-item}/carousel-item.d.ts +0 -0
  262. /package/dist/{packages/wje-carousel-item → wje-carousel-item}/carousel-item.element.d.ts +0 -0
  263. /package/dist/{packages/wje-checkbox → wje-checkbox}/checkbox.d.ts +0 -0
  264. /package/dist/{packages/wje-chip → wje-chip}/chip.d.ts +0 -0
  265. /package/dist/{packages/wje-col → wje-col}/col.d.ts +0 -0
  266. /package/dist/{packages/wje-col → wje-col}/col.element.d.ts +0 -0
  267. /package/dist/{packages/wje-color-picker → wje-color-picker}/color-picker.d.ts +0 -0
  268. /package/dist/{packages/wje-container → wje-container}/container.d.ts +0 -0
  269. /package/dist/{packages/wje-container → wje-container}/container.element.d.ts +0 -0
  270. /package/dist/{packages/wje-copy-button → wje-copy-button}/copy-button.d.ts +0 -0
  271. /package/dist/{packages/wje-copy-button → wje-copy-button}/service/service.d.ts +0 -0
  272. /package/dist/{packages/wje-dialog → wje-dialog}/dialog.d.ts +0 -0
  273. /package/dist/{packages/wje-divider → wje-divider}/divider.d.ts +0 -0
  274. /package/dist/{packages/wje-divider → wje-divider}/divider.element.d.ts +0 -0
  275. /package/dist/{packages/wje-dropdown → wje-dropdown}/dropdown.d.ts +0 -0
  276. /package/dist/{packages/wje-file-upload → wje-file-upload}/file-upload.d.ts +0 -0
  277. /package/dist/{packages/wje-file-upload-item → wje-file-upload-item}/file-upload-item.d.ts +0 -0
  278. /package/dist/{packages/wje-footer → wje-footer}/footer.d.ts +0 -0
  279. /package/dist/{packages/wje-footer → wje-footer}/footer.element.d.ts +0 -0
  280. /package/dist/{packages/wje-form → wje-form}/form.d.ts +0 -0
  281. /package/dist/{packages/wje-form → wje-form}/form.element.d.ts +0 -0
  282. /package/dist/{packages/wje-format-digital → wje-format-digital}/format-digital.d.ts +0 -0
  283. /package/dist/{packages/wje-grid → wje-grid}/grid.d.ts +0 -0
  284. /package/dist/{packages/wje-grid → wje-grid}/grid.element.d.ts +0 -0
  285. /package/dist/{packages/wje-header → wje-header}/header.d.ts +0 -0
  286. /package/dist/{packages/wje-header → wje-header}/header.element.d.ts +0 -0
  287. /package/dist/{packages/wje-icon → wje-icon}/icon.d.ts +0 -0
  288. /package/dist/{packages/wje-icon → wje-icon}/service/library.d.ts +0 -0
  289. /package/dist/{packages/wje-icon → wje-icon}/service/service.d.ts +0 -0
  290. /package/dist/{packages/wje-icon-picker → wje-icon-picker}/icon-picker.d.ts +0 -0
  291. /package/dist/{packages/wje-img → wje-img}/img.d.ts +0 -0
  292. /package/dist/{packages/wje-img-comparer → wje-img-comparer}/img-comparer.d.ts +0 -0
  293. /package/dist/{packages/wje-img-comparer → wje-img-comparer}/img-comparer.element.d.ts +0 -0
  294. /package/dist/{packages/wje-img-comparer → wje-img-comparer}/service/service.d.ts +0 -0
  295. /package/dist/{packages/wje-infinite-scroll → wje-infinite-scroll}/infinite-scroll.d.ts +0 -0
  296. /package/dist/{packages/wje-input → wje-input}/input.d.ts +0 -0
  297. /package/dist/{packages/wje-input-file → wje-input-file}/input-file.d.ts +0 -0
  298. /package/dist/{packages/wje-input-file → wje-input-file}/input-file.element.d.ts +0 -0
  299. /package/dist/{packages/wje-item → wje-item}/item.d.ts +0 -0
  300. /package/dist/{packages/wje-kanban → wje-kanban}/kanban.d.ts +0 -0
  301. /package/dist/{packages/wje-label → wje-label}/label.d.ts +0 -0
  302. /package/dist/{packages/wje-label → wje-label}/label.element.d.ts +0 -0
  303. /package/dist/{packages/wje-level-indicator → wje-level-indicator}/level-indicator.d.ts +0 -0
  304. /package/dist/{packages/wje-list → wje-list}/list.d.ts +0 -0
  305. /package/dist/{packages/wje-main → wje-main}/main.d.ts +0 -0
  306. /package/dist/{packages/wje-main → wje-main}/main.element.d.ts +0 -0
  307. /package/dist/{packages/wje-masonry → wje-masonry}/masonry.d.ts +0 -0
  308. /package/dist/{packages/wje-masonry → wje-masonry}/masonry.element.d.ts +0 -0
  309. /package/dist/{packages/wje-masonry → wje-masonry}/service/service.d.ts +0 -0
  310. /package/dist/{packages/wje-menu → wje-menu}/menu.d.ts +0 -0
  311. /package/dist/{packages/wje-menu → wje-menu}/menu.element.d.ts +0 -0
  312. /package/dist/{packages/wje-menu-button → wje-menu-button}/menu-button.d.ts +0 -0
  313. /package/dist/{packages/wje-menu-button → wje-menu-button}/menu-button.element.d.ts +0 -0
  314. /package/dist/{packages/wje-menu-item → wje-menu-item}/menu-item.d.ts +0 -0
  315. /package/dist/{packages/wje-menu-label → wje-menu-label}/menu-label.d.ts +0 -0
  316. /package/dist/{packages/wje-menu-label → wje-menu-label}/menu-label.element.d.ts +0 -0
  317. /package/dist/{packages/wje-option → wje-option}/option.d.ts +0 -0
  318. /package/dist/{packages/wje-options → wje-options}/options.d.ts +0 -0
  319. /package/dist/{packages/wje-orgchart → wje-orgchart}/orgchart.d.ts +0 -0
  320. /package/dist/{packages/wje-orgchart-group → wje-orgchart-group}/orgchart-group.d.ts +0 -0
  321. /package/dist/{packages/wje-orgchart-group → wje-orgchart-group}/orgchart-group.element.d.ts +0 -0
  322. /package/dist/{packages/wje-orgchart-item → wje-orgchart-item}/orgchart-item.d.ts +0 -0
  323. /package/dist/{packages/wje-orgchart-item → wje-orgchart-item}/orgchart-item.element.d.ts +0 -0
  324. /package/dist/{packages/wje-pagination → wje-pagination}/pagination.d.ts +0 -0
  325. /package/dist/{packages/wje-pagination → wje-pagination}/pagination.element.d.ts +0 -0
  326. /package/dist/{packages/wje-pagination → wje-pagination}/service/service.d.ts +0 -0
  327. /package/dist/{packages/wje-panel → wje-panel}/panel.d.ts +0 -0
  328. /package/dist/{packages/wje-panel → wje-panel}/panel.element.d.ts +0 -0
  329. /package/dist/{packages/wje-popup → wje-popup}/popup.d.ts +0 -0
  330. /package/dist/{packages/wje-popup → wje-popup}/popup.element.d.ts +0 -0
  331. /package/dist/{packages/wje-progress-bar → wje-progress-bar}/progress-bar.d.ts +0 -0
  332. /package/dist/{packages/wje-qr-code → wje-qr-code}/qr-code.d.ts +0 -0
  333. /package/dist/{packages/wje-radio → wje-radio}/radio.d.ts +0 -0
  334. /package/dist/{packages/wje-radio-group → wje-radio-group}/radio-group.d.ts +0 -0
  335. /package/dist/{packages/wje-rate → wje-rate}/rate.d.ts +0 -0
  336. /package/dist/{packages/wje-relative-time → wje-relative-time}/relative-time.d.ts +0 -0
  337. /package/dist/{packages/wje-reorder → wje-reorder}/reorder.d.ts +0 -0
  338. /package/dist/{packages/wje-reorder-dropzone → wje-reorder-dropzone}/reorder-dropzone.d.ts +0 -0
  339. /package/dist/{packages/wje-reorder-dropzone → wje-reorder-dropzone}/reorder-dropzone.element.d.ts +0 -0
  340. /package/dist/{packages/wje-reorder-handle → wje-reorder-handle}/reorder-handle.d.ts +0 -0
  341. /package/dist/{packages/wje-reorder-item → wje-reorder-item}/reorder-item.d.ts +0 -0
  342. /package/dist/{packages/wje-reorder-item → wje-reorder-item}/reorder-item.element.d.ts +0 -0
  343. /package/dist/{packages/wje-route → wje-route}/route.d.ts +0 -0
  344. /package/dist/{packages/wje-route → wje-route}/route.element.d.ts +0 -0
  345. /package/dist/{packages/wje-router → wje-router}/router.d.ts +0 -0
  346. /package/dist/{packages/wje-router → wje-router}/router.element.d.ts +0 -0
  347. /package/dist/{packages/wje-router-link → wje-router-link}/router-link.d.ts +0 -0
  348. /package/dist/{packages/wje-router-link → wje-router-link}/router-link.element.d.ts +0 -0
  349. /package/dist/{packages/wje-router-outlet → wje-router-outlet}/router-outlet.d.ts +0 -0
  350. /package/dist/{packages/wje-router-outlet → wje-router-outlet}/router-outlet.element.d.ts +0 -0
  351. /package/dist/{packages/wje-row → wje-row}/row.d.ts +0 -0
  352. /package/dist/{packages/wje-row → wje-row}/row.element.d.ts +0 -0
  353. /package/dist/{packages/wje-select → wje-select}/select.d.ts +0 -0
  354. /package/dist/{packages/wje-slider → wje-slider}/slider.d.ts +0 -0
  355. /package/dist/{packages/wje-sliding-container → wje-sliding-container}/sliding-container.d.ts +0 -0
  356. /package/dist/{packages/wje-split-view → wje-split-view}/service/service.d.ts +0 -0
  357. /package/dist/{packages/wje-split-view → wje-split-view}/split-view.d.ts +0 -0
  358. /package/dist/{packages/wje-status → wje-status}/status.d.ts +0 -0
  359. /package/dist/{packages/wje-status → wje-status}/status.element.d.ts +0 -0
  360. /package/dist/{packages/wje-step → wje-step}/step.d.ts +0 -0
  361. /package/dist/{packages/wje-step → wje-step}/step.element.d.ts +0 -0
  362. /package/dist/{packages/wje-stepper → wje-stepper}/stepper.d.ts +0 -0
  363. /package/dist/{packages/wje-store → wje-store}/default-store-actions.d.ts +0 -0
  364. /package/dist/{packages/wje-store → wje-store}/pubsub.d.ts +0 -0
  365. /package/dist/{packages/wje-store → wje-store}/store.d.ts +0 -0
  366. /package/dist/{packages/wje-tab → wje-tab}/tab.d.ts +0 -0
  367. /package/dist/{packages/wje-tab-group → wje-tab-group}/tab-group.d.ts +0 -0
  368. /package/dist/{packages/wje-tab-panel → wje-tab-panel}/tab-panel.d.ts +0 -0
  369. /package/dist/{packages/wje-tab-panel → wje-tab-panel}/tab-panel.element.d.ts +0 -0
  370. /package/dist/{packages/wje-textarea → wje-textarea}/textarea.d.ts +0 -0
  371. /package/dist/{packages/wje-thumbnail → wje-thumbnail}/thumbnail.d.ts +0 -0
  372. /package/dist/{packages/wje-timeline → wje-timeline}/timeline.d.ts +0 -0
  373. /package/dist/{packages/wje-timeline-item → wje-timeline-item}/timeline-item.d.ts +0 -0
  374. /package/dist/{packages/wje-timeline-item → wje-timeline-item}/timeline-item.element.d.ts +0 -0
  375. /package/dist/{packages/wje-toast → wje-toast}/toast.d.ts +0 -0
  376. /package/dist/{packages/wje-toast → wje-toast}/toast.element.d.ts +0 -0
  377. /package/dist/{packages/wje-toggle → wje-toggle}/toggle.d.ts +0 -0
  378. /package/dist/{packages/wje-toolbar → wje-toolbar}/toolbar.d.ts +0 -0
  379. /package/dist/{packages/wje-toolbar-action → wje-toolbar-action}/toolbar-action.d.ts +0 -0
  380. /package/dist/{packages/wje-toolbar-action → wje-toolbar-action}/toolbar-action.element.d.ts +0 -0
  381. /package/dist/{packages/wje-tooltip → wje-tooltip}/tooltip.d.ts +0 -0
  382. /package/dist/{packages/wje-tree → wje-tree}/tree.d.ts +0 -0
  383. /package/dist/{packages/wje-tree-item → wje-tree-item}/tree-item.d.ts +0 -0
  384. /package/dist/{packages/wje-visually-hidden → wje-visually-hidden}/visually-hidden.d.ts +0 -0
  385. /package/dist/{packages/wje-visually-hidden → wje-visually-hidden}/visually-hidden.element.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"wje-tooltip.js","sources":["../packages/wje-tooltip/tooltip.element.js","../packages/wje-tooltip/tooltip.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport Popup from '../wje-popup/popup.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Tooltip` is a custom web component that represents a tooltip.\n * @summary This element represents a tooltip.\n * @documentation https://elements.webjet.sk/components/tooltip\n * @status stable\n * @augments {WJElement}\n * @attribute {string} content - The content of the tooltip element. Accepts any valid string value.\n * @slot arrow - The arrow slot for the tooltip.\n * @slot anchor - The anchor slot for the tooltip.\n * @csspart native - The native tooltip wrapper.\n * @cssproperty [--wje-tooltip-arrow-color=var(--wje-color-contrast-11)] - Specifies the color of the tooltip's arrow. This property determines the visual color of the arrow that points to the element the tooltip is attached to. Accepts any valid CSS color value such as `hex`, `rgb`, or `CSS variable`.\n * @tag wje-tooltip\n */\nexport default class Tooltip extends WJElement {\n /**\n * Creates an instance of Tooltip.\n */\n constructor() {\n super();\n }\n\n /**\n * Dependencies of the Button element.\n * @type {object}\n */\n dependencies = {\n 'wje-popup': Popup,\n };\n\n /**\n * Set active attribute for the tooltip element.\n * @param value\n */\n set content(value) {\n this.setAttribute('content', value);\n }\n\n /**\n * Get active attribute for the tooltip element.\n * @returns {string}\n */\n get content() {\n if (this.hasAttribute('content')) return this.getAttribute('content');\n\n return '';\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Tooltip';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of observed attributes.\n * @static\n * @returns {Array} An array of observed attributes\n */\n static get observedAttributes() {\n return ['active'];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component for the tooltip.\n * @returns {object} Document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let popup = document.createElement('wje-popup');\n popup.setAttribute('placement', this.placement || 'top');\n popup.setAttribute('offset', this.offset || '0');\n\n // SLOT - Anchor\n let slot = document.createElement('slot');\n slot.setAttribute('slot', 'anchor');\n\n let arrow = document.createElement('div');\n arrow.classList.add('arrow');\n arrow.setAttribute('slot', 'arrow');\n\n // SLOT - Start\n let start = document.createElement('slot');\n start.setAttribute('name', 'start');\n\n // SLOT - End\n let end = document.createElement('slot');\n end.setAttribute('name', 'end');\n\n let content = document.createElement('div');\n content.innerHTML = this.content;\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tooltip');\n\n native.appendChild(start);\n native.appendChild(content);\n native.appendChild(end);\n\n popup.appendChild(slot);\n popup.appendChild(arrow);\n popup.appendChild(native);\n\n this.mySlot = slot;\n this.popup = popup;\n this.native = native;\n\n fragment.appendChild(popup);\n\n return fragment;\n }\n\n /**\n * Draws the component for the tooltip.\n */\n afterDraw() {\n let anchorEl = this.mySlot.assignedElements()[0];\n if (this.selector) {\n anchorEl = this.checkSelector(anchorEl);\n }\n\n if (!anchorEl) return;\n\n event.addListener(anchorEl, 'mouseenter', null, this.onShow);\n event.addListener(anchorEl, 'mouseleave', null, this.onHide);\n event.addListener(this, 'wje-dropdown:open', null, this.onHide);\n event.addListener(this, 'wje-dropdown:close', null, this.onShow);\n }\n\n afterDisconnect() {\n event.removeListener(this, 'wje-dropdown:open', null, this.onHide);\n event.removeListener(this, 'wje-dropdown:close', null, this.onShow);\n event.removeListener(this, 'mouseenter', null, this.onShow);\n event.removeListener(this, 'mouseleave', null, this.onHide);\n }\n\n dispatch(customEvent) {\n return new Promise((resolve) => {\n event.dispatchCustomEvent(this, customEvent, {\n resolve: resolve,\n });\n });\n }\n\n beforeShow() {\n return this.native.innerHTML;\n }\n\n afterShow() {\n return true;\n }\n\n popupHideCallback = () => {\n this.onHide();\n };\n\n /**\n * Handles the logic for showing the component's popup or tooltip.\n * Adds the `active` class, invokes lifecycle hooks, and manages the popup visibility.\n * @throws {Error} If the `beforeShow` method returns a non-string value or `false`.\n */\n onShow = () => {\n event.addListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n\n this.classList.add('active');\n\n if (this.querySelector('wje-dropdown')?.classList.contains('active')) {\n return;\n }\n\n Promise.resolve(this.beforeShow(this))\n .then((res) => {\n if (!this.classList.contains('active') || !res || typeof res !== 'string') {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.native.innerHTML = res;\n\n this.popup.show(); // Show tooltip\n\n Promise.resolve(this.afterShow(this));\n })\n .catch(() => {\n // ak je nejaka chyba tak to len zatvorime\n this.classList.remove('active');\n this.popup.hide();\n });\n };\n\n /**\n * Hides the component's popup or tooltip.\n * Removes the `active` class from the component and hides the popup element.\n */\n onHide = () => {\n event.removeListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n\n this.classList.remove('active');\n this.popup.hide();\n };\n\n /**\n * Validates if the specified selector exists within the provided element.\n * Logs an error if the selector is not found and returns the found element or `null`.\n * @param {HTMLElement} anchorEl The root element to search within.\n * @returns {HTMLElement|null} The first element matching the selector, or `null` if not found.\n */\n checkSelector(anchorEl) {\n const newAnchorEl = anchorEl.querySelector(this.selector);\n if (newAnchorEl === null) {\n console.error('Selector not found:', this.selector);\n }\n\n return newAnchorEl;\n }\n}\n","import Tooltip from './toolt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ooltip.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport Popup from '../wje-popup/popup.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Tooltip` is a custom web component that represents a tooltip.\n * @summary This element represents a tooltip.\n * @documentation https://elements.webjet.sk/components/tooltip\n * @status stable\n * @augments {WJElement}\n * @attribute {string} content - The content of the tooltip element. Accepts any valid string value.\n * @slot arrow - The arrow slot for the tooltip.\n * @slot anchor - The anchor slot for the tooltip.\n * @csspart native - The native tooltip wrapper.\n * @cssproperty [--wje-tooltip-arrow-color=var(--wje-color-contrast-11)] - Specifies the color of the tooltip's arrow. This property determines the visual color of the arrow that points to the element the tooltip is attached to. Accepts any valid CSS color value such as `hex`, `rgb`, or `CSS variable`.\n * @tag wje-tooltip\n */\nexport default class Tooltip extends WJElement {\n static _instanceId = 0;\n /**\n * Creates an instance of Tooltip.\n */\n constructor() {\n super();\n this._instanceId = ++Tooltip._instanceId;\n }\n\n /**\n * Dependencies of the Button element.\n * @type {object}\n */\n dependencies = {\n 'wje-popup': Popup,\n };\n\n /**\n * Set active attribute for the tooltip element.\n * @param value\n */\n set content(value) {\n this.setAttribute('content', value);\n }\n\n /**\n * Get active attribute for the tooltip element.\n * @returns {string}\n */\n get content() {\n if (this.hasAttribute('content')) return this.getAttribute('content');\n\n return '';\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Tooltip';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of observed attributes.\n * @static\n * @returns {Array} An array of observed attributes\n */\n static get observedAttributes() {\n return ['active'];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAriaState({ role: 'tooltip' });\n }\n\n /**\n * Draws the component for the tooltip.\n * @returns {object} Document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let popup = document.createElement('wje-popup');\n popup.setAttribute('placement', this.placement || 'top');\n popup.setAttribute('offset', this.offset || '0');\n\n // SLOT - Anchor\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'anchor');\n slot.setAttribute('slot', 'anchor');\n\n let arrow = document.createElement('div');\n arrow.classList.add('arrow');\n arrow.setAttribute('slot', 'arrow');\n\n // SLOT - Start\n let start = document.createElement('slot');\n start.setAttribute('name', 'start');\n\n // SLOT - End\n let end = document.createElement('slot');\n end.setAttribute('name', 'end');\n\n let content = document.createElement('div');\n content.innerHTML = this.content;\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tooltip');\n\n native.appendChild(start);\n native.appendChild(content);\n native.appendChild(end);\n\n popup.appendChild(slot);\n popup.appendChild(arrow);\n popup.appendChild(native);\n\n this.mySlot = slot;\n this.popup = popup;\n this.native = native;\n\n fragment.appendChild(popup);\n\n return fragment;\n }\n\n /**\n * Draws the component for the tooltip.\n */\n afterDraw() {\n const resolveAnchor = () => {\n let anchorEl = this.mySlot.assignedElements()[0];\n if (!anchorEl) {\n anchorEl = this.querySelector(':scope > *:not([slot])');\n if (anchorEl) anchorEl.setAttribute('slot', 'anchor');\n }\n if (this.selector) {\n anchorEl = this.checkSelector(anchorEl);\n }\n\n if (!anchorEl) return null;\n\n const tooltipId = this.id || `wje-tooltip-${this._instanceId}`;\n if (!this.id) this.id = tooltipId;\n anchorEl.setAttribute('aria-describedby', tooltipId);\n return anchorEl;\n };\n\n this.onSlotChange = () => {\n resolveAnchor();\n };\n\n this.mySlot.addEventListener('slotchange', this.onSlotChange);\n this.onSlotChange();\n\n let anchorEl = resolveAnchor();\n\n if (!anchorEl) return;\n\n event.addListener(anchorEl, 'mouseenter', null, this.onShow);\n event.addListener(anchorEl, 'mouseleave', null, this.onHide);\n event.addListener(this, 'wje-dropdown:open', null, this.onHide);\n event.addListener(this, 'wje-dropdown:close', null, this.onShow);\n }\n\n afterDisconnect() {\n event.removeListener(this, 'wje-dropdown:open', null, this.onHide);\n event.removeListener(this, 'wje-dropdown:close', null, this.onShow);\n event.removeListener(this, 'mouseenter', null, this.onShow);\n event.removeListener(this, 'mouseleave', null, this.onHide);\n this.mySlot?.removeEventListener('slotchange', this.onSlotChange);\n }\n\n dispatch(customEvent) {\n return new Promise((resolve) => {\n event.dispatchCustomEvent(this, customEvent, {\n resolve: resolve,\n });\n });\n }\n\n beforeShow() {\n return this.native.innerHTML;\n }\n\n afterShow() {\n return true;\n }\n\n popupHideCallback = () => {\n this.onHide();\n };\n\n /**\n * Handles the logic for showing the component's popup or tooltip.\n * Adds the `active` class, invokes lifecycle hooks, and manages the popup visibility.\n * @throws {Error} If the `beforeShow` method returns a non-string value or `false`.\n */\n onShow = () => {\n event.addListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n\n this.classList.add('active');\n\n if (this.querySelector('wje-dropdown')?.classList.contains('active')) {\n return;\n }\n\n Promise.resolve(this.beforeShow(this))\n .then((res) => {\n if (!this.classList.contains('active') || !res || typeof res !== 'string') {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.native.innerHTML = res;\n\n this.popup.show(); // Show tooltip\n\n Promise.resolve(this.afterShow(this));\n })\n .catch(() => {\n // ak je nejaka chyba tak to len zatvorime\n this.classList.remove('active');\n this.popup.hide();\n });\n };\n\n /**\n * Hides the component's popup or tooltip.\n * Removes the `active` class from the component and hides the popup element.\n */\n onHide = () => {\n event.removeListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n\n this.classList.remove('active');\n this.popup.hide();\n };\n\n /**\n * Validates if the specified selector exists within the provided element.\n * Logs an error if the selector is not found and returns the found element or `null`.\n * @param {HTMLElement} anchorEl The root element to search within.\n * @returns {HTMLElement|null} The first element matching the selector, or `null` if not found.\n */\n checkSelector(anchorEl) {\n const newAnchorEl = anchorEl.querySelector(this.selector);\n if (newAnchorEl === null) {\n console.error('Selector not found:', this.selector);\n }\n\n return newAnchorEl;\n }\n}\n","import Tooltip from './tooltip.element.js';\n\nexport default Tooltip;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MAAM;AAC1D,eAAK,WAAL,mBAAa,oBAAoB,cAAc,KAAK;AAAA,EAC5D;AAAA,EAEI,SAAS,aAAa;AAClB,WAAO,IAAI,QAAQ,CAAC,YAAY;AAC5B,YAAM,oBAAoB,MAAM,aAAa;AAAA,QACzC;AAAA,MAChB,CAAa;AAAA,IACb,CAAS;AAAA,EACT;AAAA,EAEI,aAAa;AACT,WAAO,KAAK,OAAO;AAAA,EAC3B;AAAA,EAEI,YAAY;AACR,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwDI,cAAc,UAAU;AACpB,UAAM,cAAc,SAAS,cAAc,KAAK,QAAQ;AACxD,QAAI,gBAAgB,MAAM;AACtB,cAAQ,MAAM,uBAAuB,KAAK,QAAQ;AAAA,IAC9D;AAEQ,WAAO;AAAA,EACf;AACA;AApPI,cADiB,UACV,eAAc;AADV,IAAM,UAAN;ACbf,QAAQ,OAAO,eAAe,OAAO;"}
@@ -47,6 +47,10 @@ export default class Tree extends WJElement {
47
47
  * @returns {void} This method does not return a value.
48
48
  */
49
49
  afterDraw(): void;
50
+ /**
51
+ * Syncs ARIA attributes on the host element.
52
+ */
53
+ syncAria(): void;
50
54
  /**
51
55
  * Handles the click event triggered by the user interaction.
52
56
  * Identifies the closest tree item element to the event target and sets it
@@ -82,6 +82,7 @@ export default class TreeItem extends HTMLElement {
82
82
  */
83
83
  setupAttributes(): void;
84
84
  isShadowRoot: string;
85
+ connectedCallback(): void;
85
86
  /**
86
87
  * Handles updates when observed attributes of the element are changed.
87
88
  * Updates the checkbox state based on changes to the "selected" or "indeterminate" attributes.
@@ -137,6 +138,10 @@ export default class TreeItem extends HTMLElement {
137
138
  * @returns {void} Does not return a value.
138
139
  */
139
140
  toggleChildren(): void;
141
+ /**
142
+ * Syncs ARIA attributes on the host element.
143
+ */
144
+ syncAria(): void;
140
145
  /**
141
146
  * Retrieves the child items from the `childrenSlot` that match specific criteria.
142
147
  * @param {object} [options] Configuration options.
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import WJElement from "./wje-element.js";
5
- const styles = "/*\n[ WJ Tree Item ]\n*/\n\n:host {\n .native-tree-item {\n position: relative;\n display: flex;\n align-items: stretch;\n flex-direction: column;\n &.multiple {\n .item {\n border-radius: 0 !important;\n }\n }\n .item {\n display: flex;\n align-items: center;\n padding-inline: var(--wje-tree-item-padding-inline);\n padding-block: var(--wje-tree-item-padding-block);\n border-radius: var(--wje-tree-item-border-radius);\n background-color: var(--wje-tree-item-background);\n color: var(--wje-tree-item-color);\n &:hover {\n background-color: var(--wje-tree-item-background-hover);\n color: var(--wje-tree-item-color-hover);\n }\n .indent {\n display: block;\n width: 1em;\n }\n .toggle {\n font-size: var(--wje-tree-item-font-size);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: content-box;\n width: var(--wje-tree-item-indent);\n height: var(--wje-tree-item-indent);\n flex-shrink: 0;\n }\n wje-checkbox {\n font-size: var(--wje-tree-item-font-size);\n margin: 0;\n }\n .content {\n font-size: var(--wje-tree-item-font-size);\n }\n slot {\n display: flex;\n align-items: center;\n }\n slot:not([name])::slotted(wje-icon) {\n margin-right: var(--wje-spacing-2x-small);\n }\n slot[name='end'] {\n margin-inline-start: auto;\n }\n }\n .children {\n font-size: calc(1rem + var(--wje-tree-item-indent, var(--wje-spacing-medium)));\n display: none;\n &.open {\n font-size: var(--wje-tree-item-font-size);\n display: block;\n\n ::before {\n content: '';\n position: absolute;\n top: var(--wje-tree-item-indent);\n bottom: 5px;\n left: calc(1em - (var(--wje-spacing-3x-small) * 2) - (var(--wje-tree-item-indent-guid-width) / 2));\n border-inline-end: var(--wje-tree-item-indent-guid-width) solid var(--wje-border-color);\n z-index: 1;\n }\n }\n }\n }\n\n .native-tree-item.expanded .item slot[name='expand'],\n .native-tree-item:not(.expanded) slot[name='collapse'] {\n display: none;\n }\n}\n\n:host([selected]) {\n .item {\n background-color: var(--wje-tree-item-background-selected);\n color: var(--wje-tree-item-color-selected);\n }\n}\n:host([slot-hover-visible]) {\n .item {\n &:hover {\n slot[name='start'], slot[name='end'] {\n visibility: visible;\n }\n }\n slot[name='start'], slot[name='end'] {\n visibility: hidden;\n }\n }\n}\n";
5
+ const styles = "/*\n[ WJ Tree Item ]\n*/\n\n:host {\n .native-tree-item {\n position: relative;\n display: flex;\n align-items: stretch;\n flex-direction: column;\n &.multiple {\n .item {\n border-radius: 0 !important;\n }\n }\n .item {\n display: flex;\n align-items: center;\n padding-inline: var(--wje-tree-item-padding-inline);\n padding-block: var(--wje-tree-item-padding-block);\n border-radius: var(--wje-tree-item-border-radius);\n background-color: var(--wje-tree-item-background);\n color: var(--wje-tree-item-color);\n\n &:hover {\n background-color: var(--wje-tree-item-background-hover);\n color: var(--wje-tree-item-color-hover);\n }\n\n .indent {\n display: block;\n width: 1em;\n flex-shrink: 0;\n }\n\n .toggle {\n font-size: var(--wje-tree-item-font-size);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: content-box;\n width: var(--wje-tree-item-indent);\n height: var(--wje-tree-item-indent);\n flex-shrink: 0;\n }\n\n wje-checkbox {\n font-size: var(--wje-tree-item-font-size);\n margin: 0;\n }\n\n .content {\n font-size: var(--wje-tree-item-font-size);\n }\n\n slot {\n display: flex;\n align-items: center;\n }\n\n slot:not([name])::slotted(wje-icon) {\n margin-right: var(--wje-spacing-2x-small);\n }\n\n slot[name='end'] {\n margin-inline-start: auto;\n }\n }\n .children {\n font-size: calc(1rem + var(--wje-tree-item-indent, var(--wje-spacing-medium)));\n padding-inline-start: var(--wje-tree-item-indent, var(--wje-spacing-medium));\n display: none;\n &.open {\n font-size: var(--wje-tree-item-font-size);\n display: block;\n\n ::before {\n content: '';\n position: absolute;\n top: var(--wje-tree-item-indent);\n bottom: 5px;\n left: calc(1em - (var(--wje-spacing-3x-small) * 2) - (var(--wje-tree-item-indent-guid-width) / 2));\n border-inline-end: var(--wje-tree-item-indent-guid-width) solid var(--wje-border-color);\n z-index: 1;\n }\n }\n }\n }\n\n .native-tree-item.expanded .item slot[name='expand'],\n .native-tree-item:not(.expanded) slot[name='collapse'] {\n display: none;\n }\n}\n\n:host([selected]) {\n .item {\n background-color: var(--wje-tree-item-background-selected);\n color: var(--wje-tree-item-color-selected);\n }\n}\n:host([slot-hover-visible]) {\n .item {\n &:hover {\n slot[name='start'], slot[name='end'] {\n visibility: visible;\n }\n }\n slot[name='start'], slot[name='end'] {\n visibility: hidden;\n }\n }\n}\n";
6
6
  class TreeItem extends WJElement {
7
7
  /**
8
8
  * Creates an instance of Toast.
@@ -102,6 +102,12 @@ class TreeItem extends WJElement {
102
102
  */
103
103
  setupAttributes() {
104
104
  this.isShadowRoot = "open";
105
+ this.syncAria();
106
+ }
107
+ connectedCallback() {
108
+ var _a;
109
+ (_a = super.connectedCallback) == null ? void 0 : _a.call(this);
110
+ if (this.isNestedItem()) this.slot = "children";
105
111
  }
106
112
  /**
107
113
  * Returns the list of attributes to observe for changes.
@@ -120,6 +126,10 @@ class TreeItem extends WJElement {
120
126
  * @returns {void}
121
127
  */
122
128
  attributeChangedCallback(name, oldValue, newValue) {
129
+ if (!this.checkbox) {
130
+ this.syncAria();
131
+ return;
132
+ }
123
133
  if (name === "selected") {
124
134
  if (this.selected) {
125
135
  this.checkbox.checked = true;
@@ -132,6 +142,7 @@ class TreeItem extends WJElement {
132
142
  this.checkbox.removeAttribute("checked");
133
143
  if (this.indeterminate) this.checkbox.setAttribute("indeterminate", "");
134
144
  }
145
+ this.syncAria();
135
146
  }
136
147
  /**
137
148
  * Custom logic executed before the draw process begins.
@@ -169,6 +180,7 @@ class TreeItem extends WJElement {
169
180
  let checkbox = document.createElement("wje-checkbox");
170
181
  if (this.selected) checkbox.setAttribute("checked", "");
171
182
  let label = document.createElement("div");
183
+ label.setAttribute("part", "label");
172
184
  label.classList.add("content");
173
185
  let slotElement = document.createElement("slot");
174
186
  let children = document.createElement("div");
@@ -224,6 +236,8 @@ class TreeItem extends WJElement {
224
236
  afterDraw() {
225
237
  if (this.expanded) this.toggleChildren();
226
238
  this.button.addEventListener("click", this.toggleChildren.bind(this));
239
+ this.setAttribute("tabindex", "0");
240
+ this.syncAria();
227
241
  }
228
242
  /**
229
243
  * Determines if the current item is a nested item within a tree structure.
@@ -251,6 +265,29 @@ class TreeItem extends WJElement {
251
265
  toggleChildren() {
252
266
  this.childrenElement.classList.toggle("open");
253
267
  this.native.classList.toggle("expanded");
268
+ this.syncAria();
269
+ }
270
+ /**
271
+ * Syncs ARIA attributes on the host element.
272
+ */
273
+ syncAria() {
274
+ var _a, _b;
275
+ const hasChildren = this.querySelectorAll(":scope > wje-tree-item").length > 0;
276
+ const expanded = hasChildren ? (_b = (_a = this.native) == null ? void 0 : _a.classList) == null ? void 0 : _b.contains("expanded") : void 0;
277
+ if (this.selection === "multiple") {
278
+ const checked = this.indeterminate ? "mixed" : this.selected ? "true" : "false";
279
+ this.setAriaState({
280
+ role: "treeitem",
281
+ checked,
282
+ expanded
283
+ });
284
+ } else {
285
+ this.setAriaState({
286
+ role: "treeitem",
287
+ selected: this.selected,
288
+ expanded
289
+ });
290
+ }
254
291
  }
255
292
  /**
256
293
  * Retrieves the child items from the `childrenSlot` that match specific criteria.
@@ -260,10 +297,9 @@ class TreeItem extends WJElement {
260
297
  */
261
298
  getChildrenItems(options = {}) {
262
299
  const includeDisabled = options.includeDisabled ?? true;
263
- if (!this.childrenSlot) {
264
- return [];
265
- }
266
- return [...this.childrenSlot.assignedElements({ flatten: true })].filter(
300
+ const assigned = this.childrenSlot ? this.childrenSlot.assignedElements({ flatten: true }) : [];
301
+ const direct = assigned.length ? assigned : Array.from(this.querySelectorAll(":scope > wje-tree-item"));
302
+ return direct.filter(
267
303
  (item) => this.isTreeItem(item) && (includeDisabled || !item.disabled)
268
304
  );
269
305
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wje-tree-item.js","sources":["../packages/wje-tree-item/tree-item.element.js","../packages/wje-tree-item/tree-item.js"],"sourcesContent":["import { default as WJElement, WjElementUtils, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `wje-tree-item` is a custom web component used as a child of the `wje-tree`.\n * It represents a node within a tree structure, capable of nesting other items.\n * @summary Represents a single item in a tree structure.\n * @documentation https://elements.webjet.sk/components/tree-item\n * @status stable\n * @augments {HTMLElement}\n * @slot - Default slot for rendering the tree item's content (e.g., text or custom elements).\n * @csspart native - The native container of the tree item.\n * @cssproperty [--wje-tree-item-indent=var(--wje-spacing-large)] - Defines the indentation for nested tree items.\n * @cssproperty [--wje-tree-item-indent-guid-width=0px] - Specifies the width of the guide element shown next to a tree item.\n * @cssproperty [--wje-tree-item-border-radius=var(--wje-border-radius-medium)] - Sets the border radius of the tree item’s container.\n * @tag wje-tree-item\n */\n\nexport default class TreeItem extends WJElement {\n /**\n * Creates an instance of Toast.\n */\n constructor() {\n super();\n\n this._selection = 'single';\n }\n\n /**\n * Sets the expanded state of the element. When set to a truthy value,\n * the 'expanded' attribute will be added to the element. When set to a falsy\n * value, the 'expanded' attribute will be removed.\n * @param {boolean} value A boolean value indicating whether the\n * element should be expanded (true) or collapsed (false).\n */\n set expanded(value) {\n if (value) {\n this.setAttribute('expanded', '');\n } else {\n this.removeAttribute('expanded');\n }\n }\n\n /**\n * Retrieves the value of the 'expanded' state for the current element.\n * This getter checks whether the 'expanded' attribute is present on the element.\n * If the attribute exists, it returns true, representing that the element is expanded.\n * Otherwise, it returns false, indicating that the element is not expanded.\n * @returns {boolean} True if the 'expanded' attribute is present, false otherwise.\n */\n get expanded() {\n return this.hasAttribute('expanded');\n }\n\n /**\n * Sets the 'selected' attribute of the element. Removes the attribute if the provided value is falsy; otherwise, sets it.\n * @param {boolean} value The value indicating whether the element should have the 'selected' attribute.\n */\n set selected(value) {\n this.removeAttribute('selected');\n\n if (value) this.setAttribute('selected', '');\n }\n\n /**\n * Getter method for determining if the 'selected' attribute is present on the element.\n * @returns {boolean} Returns true if the 'selected' attribute is present, otherwise false.\n */\n get selected() {\n return this.hasAttribute('selected');\n }\n\n /**\n * Sets the selection mode for the component.\n * @param {string} value The selection mode to apply. Defaults to 'single'\n * if no value is provided. Possible options may be\n * specific to the implementation of the component\n * (e.g., 'single', 'multiple').\n */\n set selection(value) {\n this._selection = value || 'single';\n }\n\n /**\n * Retrieves the current selection.\n * @returns {*} The value of the current selection.\n */\n get selection() {\n return this._selection;\n }\n\n /**\n * Sets or removes the 'indeterminate' attribute based on the provided value.\n * This can be used to visually indicate an indeterminate state for elements like checkboxes.\n * @param {boolean} value A boolean indicating whether to set the element to an indeterminate state.\n * If true, the 'indeterminate' attribute is added to the element; if false, the attribute is removed.\n */\n set indeterminate(value) {\n this.removeAttribute('indeterminate');\n\n if (value) this.setAttribute('indeterminate', '');\n }\n\n /**\n * Retrieves the state of the indeterminate attribute.\n * @returns {boolean} True if the indeterminate attribute is present, otherwise false.\n */\n get indeterminate() {\n return this.hasAttribute('indeterminate');\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'TreeItem';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return ['selected', 'indeterminate'];\n }\n\n /**\n * Handles updates when observed attributes of the element are changed.\n * Updates the checkbox state based on changes to the \"selected\" or \"indeterminate\" attributes.\n * @param {string} name The name of the attribute that was changed.\n * @param {string|null} oldValue The previous value of the attribute before the change.\n * @param {string|null} newValue The new value of the attribute after the change.\n * @returns {void}\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'selected') {\n // this.checkbox.removeAttribute('indeterminate');\n if (this.selected) {\n this.checkbox.checked = true;\n } else {\n this.checkbox.checked = false;\n }\n }\n\n if (name === 'indeterminate' && !this.selected) {\n this.checkbox.removeAttribute('indeterminate');\n this.checkbox.removeAttribute('checked');\n\n if (this.indeterminate) this.checkbox.setAttribute('indeterminate', '');\n }\n }\n\n /**\n * Custom logic executed before the draw process begins.\n * Determines and sets the appropriate slot if the current item is nested.\n * @returns {void} No return value.\n */\n beforeDraw() {\n if (this.isNestedItem()) this.slot = 'children';\n\n if(this.closest('wje-tree')?.hasAttribute('slot-hover-visible'))\n this.setAttribute('slot-hover-visible', '');\n }\n\n /**\n * Creates and returns a document fragment representing the structure of a tree item component.\n * The method constructs the DOM elements including the native container, indentation, toggle button,\n * selection checkbox, label, and children container, along with their respective slots and attributes.\n * It dynamically handles the creation of expand and collapse icons, as well as appending slots for\n * child components.\n * @returns {DocumentFragment} A fragment containing the complete tree item structure to be rendered.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tree-item', this.selection === 'multiple' ? 'multiple' : 'single');\n\n let slotStart = document.createElement('slot');\n slotStart.setAttribute('name', 'start');\n\n let item = document.createElement('div');\n item.setAttribute('part', 'item');\n item.classList.add('item');\n\n let indent = document.createElement('div');\n indent.classList.add('indent');\n\n let button = document.createElement('div');\n button.classList.add('toggle');\n\n let checkbox = document.createElement('wje-checkbox');\n if (this.selected) checkbox.setAttribute('checked', '');\n\n let label = document.createElement('div');\n label.classList.add('content');\n\n let slotElement = document.createElement('slot');\n\n let children = document.createElement('div');\n children.classList.add('children');\n\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'children');\n children.appendChild(slot);\n\n let slotEnd = document.createElement('slot');\n slotEnd.setAttribute('name', 'end');\n\n item.appendChild(slotStart);\n item.appendChild(indent);\n\n if (this.querySelectorAll(':scope > wje-tree-item').length > 0) {\n if (this.querySelectorAll('[slot=\"expand\"]').length < 1) {\n let expandIcon = document.createElement('wje-icon');\n expandIcon.setAttribute('name', 'chevron-right');\n expandIcon.setAttribute('slot', 'expand');\n\n this.appendChild(expandIcon);\n }\n\n if (this.querySelectorAll('[slot=\"collapse\"]').length < 1) {\n let collapseIcon = document.createElement('wje-icon');\n collapseIcon.setAttribute('name', 'chevron-down');\n collapseIcon.setAttribute('slot', 'collapse');\n\n this.appendChild(collapseIcon);\n }\n\n let expandSlot = document.createElement('slot');\n expandSlot.setAttribute('name', 'expand');\n\n let collapseSlot = document.createElement('slot');\n collapseSlot.setAttribute('name', 'collapse');\n\n button.appendChild(expandSlot);\n button.appendChild(collapseSlot);\n }\n\n item.appendChild(button);\n\n if (this.selection === 'multiple') item.appendChild(checkbox);\n\n label.appendChild(slotElement);\n item.appendChild(label);\n item.appendChild(slotEnd);\n\n native.appendChild(item);\n native.appendChild(children);\n\n fragment.appendChild(native);\n\n this.checkbox = checkbox;\n this.native = native;\n this.button = button;\n this.childrenElement = children;\n this.childrenSlot = slot;\n\n return fragment;\n }\n\n /**\n * Executes operations to be performed after the draw action is completed.\n * If the state indicates it is expanded, toggles its children.\n * Additionally, sets up an event listener on the button element to handle toggling children upon click.\n * @returns {void} Does not return a value.\n */\n afterDraw() {\n if (this.expanded) this.toggleChildren();\n\n this.button.addEventListener('click', this.toggleChildren.bind(this));\n }\n\n /**\n * Determines if the current item is a nested item within a tree structure.\n * Checks if the item's parent element exists and is also a tree item.\n * @returns {boolean} Returns true if the current item is a nested tree item; otherwise, false.\n */\n isNestedItem() {\n const parent = this.parentElement;\n return !!parent && this.isTreeItem(parent);\n }\n\n /**\n * Checks whether the given node is a tree item.\n * @param {object} node The node to check.\n * @returns {boolean} Returns true if the node is an Element and has a class name of 'TreeItem', otherwise false.\n */\n isTreeItem(node) {\n return node instanceof Element && node.className === 'TreeItem';\n }\n\n /**\n * Toggles the visibility state of the children element and updates the class of the parent element.\n * The method toggles the 'open' class on the children elements and the 'expanded' class on the parent element,\n * effectively showing or hiding the children and indicating the expanded state.\n * @returns {void} Does not return a value.\n */\n toggleChildren() {\n this.childrenElement.classList.toggle('open');\n this.native.classList.toggle('expanded');\n }\n\n /**\n * Retrieves the child items from the `childrenSlot` that match specific criteria.\n * @param {object} [options] Configuration options.\n * @param {boolean} [options.includeDisabled] Determines whether disabled items should be included in the result. Defaults to true.\n * @returns {Array} An array of child items that are valid tree items and meet the criteria specified in the options.\n */\n getChildrenItems(options = {}) {\n const includeDisabled = options.includeDisabled ?? true; // Ak nie je zadané, predvolená hodnota je true\n\n if (!this.childrenSlot) {\n return []; // Ak `childrenSlot` neexistuje, vráti prázdne pole\n }\n\n return [...this.childrenSlot.assignedElements({ flatten: true })].filter(\n (item) => this.isTreeItem(item) && (includeDisabled || !item.disabled)\n );\n }\n\n /**\n * Retrieves all descendant children of the current object in a flattened array structure.\n * @param {object} [options] An optional object specifying filters or configurations for retrieving children.\n * @returns {Array} An array containing all children and their descendants in a flat structure.\n */\n getAllChildrenFlat(options = {}) {\n const directChildren = this.getChildrenItems(options);\n return directChildren.flatMap((child) => [child, ...child.getAllChildrenFlat(options)]);\n }\n}\n","import TreeItem from './tree-item.element.js';\n\nexport default TreeItem;\n\nTreeItem.define('wje-tree-item', TreeItem);\n"],"names":[],"mappings":";;;;;AAkBe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI5C,cAAc;AACV,UAAO;AA4FX;AAAA;AAAA;AAAA;AAAA,qCAAY;AA1FR,SAAK,aAAa;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,IAAI,SAAS,OAAO;AAChB,QAAI,OAAO;AACP,WAAK,aAAa,YAAY,EAAE;AAAA,IAC5C,OAAe;AACH,WAAK,gBAAgB,UAAU;AAAA,IAC3C;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,IAAI,WAAW;AACX,WAAO,KAAK,aAAa,UAAU;AAAA,EAC3C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AAA;AAAA,EAOI,eAAe;AACX,UAAM,SAAS,KAAK;AACpB,WAAO,CAAC,CAAC,UAAU,KAAK,WAAW,MAAM;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,WAAW,MAAM;AACb,WAAO,gBAAgB,WAAW,KAAK,cAAc;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,iBAAiB;AACb,SAAK,gBAAgB,UAAU,OAAO,MAAM;AAC5C,SAAK,OAAO,UAAU,OAAO,UAAU;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,iBAAiB,UAAU,IAAI;AAC3B,UAAM,kBAAkB,QAAQ,mBAAmB;AAEnD,QAAI,CAAC,KAAK,cAAc;AACpB,aAAO;IACnB;AAEQ,WAAO,CAAC,GAAG,KAAK,aAAa,iBAAiB,EAAE,SAAS,MAAM,CAAC,EAAE;AAAA,MAC9D,CAAC,SAAS,KAAK,WAAW,IAAI,MAAM,mBAAmB,CAAC,KAAK;AAAA,IAChE;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB,UAAU,IAAI;AAC7B,UAAM,iBAAiB,KAAK,iBAAiB,OAAO;AACpD,WAAO,eAAe,QAAQ,CAAC,UAAU,CAAC,OAAO,GAAG,MAAM,mBAAmB,OAAO,CAAC,CAAC;AAAA,EAC9F;AACA;ACvVA,SAAS,OAAO,iBAAiB,QAAQ;"}
1
+ {"version":3,"file":"wje-tree-item.js","sources":["../packages/wje-tree-item/tree-item.element.js","../packages/wje-tree-item/tree-item.js"],"sourcesContent":["import { default as WJElement, WjElementUtils, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `wje-tree-item` is a custom web component used as a child of the `wje-tree`.\n * It represents a node within a tree structure, capable of nesting other items.\n * @summary Represents a single item in a tree structure.\n * @documentation https://elements.webjet.sk/components/tree-item\n * @status stable\n * @augments {HTMLElement}\n * @slot - Default slot for rendering the tree item's content (e.g., text or custom elements).\n * @csspart native - The native container of the tree item.\n * @cssproperty [--wje-tree-item-indent=var(--wje-spacing-large)] - Defines the indentation for nested tree items.\n * @cssproperty [--wje-tree-item-indent-guid-width=0px] - Specifies the width of the guide element shown next to a tree item.\n * @cssproperty [--wje-tree-item-border-radius=var(--wje-border-radius-medium)] - Sets the border radius of the tree item’s container.\n * @tag wje-tree-item\n */\n\nexport default class TreeItem extends WJElement {\n /**\n * Creates an instance of Toast.\n */\n constructor() {\n super();\n\n this._selection = 'single';\n }\n\n /**\n * Sets the expanded state of the element. When set to a truthy value,\n * the 'expanded' attribute will be added to the element. When set to a falsy\n * value, the 'expanded' attribute will be removed.\n * @param {boolean} value A boolean value indicating whether the\n * element should be expanded (true) or collapsed (false).\n */\n set expanded(value) {\n if (value) {\n this.setAttribute('expanded', '');\n } else {\n this.removeAttribute('expanded');\n }\n }\n\n /**\n * Retrieves the value of the 'expanded' state for the current element.\n * This getter checks whether the 'expanded' attribute is present on the element.\n * If the attribute exists, it returns true, representing that the element is expanded.\n * Otherwise, it returns false, indicating that the element is not expanded.\n * @returns {boolean} True if the 'expanded' attribute is present, false otherwise.\n */\n get expanded() {\n return this.hasAttribute('expanded');\n }\n\n /**\n * Sets the 'selected' attribute of the element. Removes the attribute if the provided value is falsy; otherwise, sets it.\n * @param {boolean} value The value indicating whether the element should have the 'selected' attribute.\n */\n set selected(value) {\n this.removeAttribute('selected');\n\n if (value) this.setAttribute('selected', '');\n }\n\n /**\n * Getter method for determining if the 'selected' attribute is present on the element.\n * @returns {boolean} Returns true if the 'selected' attribute is present, otherwise false.\n */\n get selected() {\n return this.hasAttribute('selected');\n }\n\n /**\n * Sets the selection mode for the component.\n * @param {string} value The selection mode to apply. Defaults to 'single'\n * if no value is provided. Possible options may be\n * specific to the implementation of the component\n * (e.g., 'single', 'multiple').\n */\n set selection(value) {\n this._selection = value || 'single';\n }\n\n /**\n * Retrieves the current selection.\n * @returns {*} The value of the current selection.\n */\n get selection() {\n return this._selection;\n }\n\n /**\n * Sets or removes the 'indeterminate' attribute based on the provided value.\n * This can be used to visually indicate an indeterminate state for elements like checkboxes.\n * @param {boolean} value A boolean indicating whether to set the element to an indeterminate state.\n * If true, the 'indeterminate' attribute is added to the element; if false, the attribute is removed.\n */\n set indeterminate(value) {\n this.removeAttribute('indeterminate');\n\n if (value) this.setAttribute('indeterminate', '');\n }\n\n /**\n * Retrieves the state of the indeterminate attribute.\n * @returns {boolean} True if the indeterminate attribute is present, otherwise false.\n */\n get indeterminate() {\n return this.hasAttribute('indeterminate');\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'TreeItem';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n connectedCallback() {\n super.connectedCallback?.();\n if (this.isNestedItem()) this.slot = 'children';\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return ['selected', 'indeterminate'];\n }\n\n /**\n * Handles updates when observed attributes of the element are changed.\n * Updates the checkbox state based on changes to the \"selected\" or \"indeterminate\" attributes.\n * @param {string} name The name of the attribute that was changed.\n * @param {string|null} oldValue The previous value of the attribute before the change.\n * @param {string|null} newValue The new value of the attribute after the change.\n * @returns {void}\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (!this.checkbox) {\n this.syncAria();\n return;\n }\n if (name === 'selected') {\n // this.checkbox.removeAttribute('indeterminate');\n if (this.selected) {\n this.checkbox.checked = true;\n } else {\n this.checkbox.checked = false;\n }\n }\n\n if (name === 'indeterminate' && !this.selected) {\n this.checkbox.removeAttribute('indeterminate');\n this.checkbox.removeAttribute('checked');\n\n if (this.indeterminate) this.checkbox.setAttribute('indeterminate', '');\n }\n this.syncAria();\n }\n\n /**\n * Custom logic executed before the draw process begins.\n * Determines and sets the appropriate slot if the current item is nested.\n * @returns {void} No return value.\n */\n beforeDraw() {\n if (this.isNestedItem()) this.slot = 'children';\n\n if(this.closest('wje-tree')?.hasAttribute('slot-hover-visible'))\n this.setAttribute('slot-hover-visible', '');\n }\n\n /**\n * Creates and returns a document fragment representing the structure of a tree item component.\n * The method constructs the DOM elements including the native container, indentation, toggle button,\n * selection checkbox, label, and children container, along with their respective slots and attributes.\n * It dynamically handles the creation of expand and collapse icons, as well as appending slots for\n * child components.\n * @returns {DocumentFragment} A fragment containing the complete tree item structure to be rendered.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tree-item', this.selection === 'multiple' ? 'multiple' : 'single');\n\n let slotStart = document.createElement('slot');\n slotStart.setAttribute('name', 'start');\n\n let item = document.createElement('div');\n item.setAttribute('part', 'item');\n item.classList.add('item');\n\n let indent = document.createElement('div');\n indent.classList.add('indent');\n\n let button = document.createElement('div');\n button.classList.add('toggle');\n\n let checkbox = document.createElement('wje-checkbox');\n if (this.selected) checkbox.setAttribute('checked', '');\n\n let label = document.createElement('div');\n label.setAttribute('part', 'label');\n label.classList.add('content');\n\n let slotElement = document.createElement('slot');\n\n let children = document.createElement('div');\n children.classList.add('children');\n\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'children');\n children.appendChild(slot);\n\n let slotEnd = document.createElement('slot');\n slotEnd.setAttribute('name', 'end');\n\n item.appendChild(slotStart);\n item.appendChild(indent);\n\n if (this.querySelectorAll(':scope > wje-tree-item').length > 0) {\n if (this.querySelectorAll('[slot=\"expand\"]').length < 1) {\n let expandIcon = document.createElement('wje-icon');\n expandIcon.setAttribute('name', 'chevron-right');\n expandIcon.setAttribute('slot', 'expand');\n\n this.appendChild(expandIcon);\n }\n\n if (this.querySelectorAll('[slot=\"collapse\"]').length < 1) {\n let collapseIcon = document.createElement('wje-icon');\n collapseIcon.setAttribute('name', 'chevron-down');\n collapseIcon.setAttribute('slot', 'collapse');\n\n this.appendChild(collapseIcon);\n }\n\n let expandSlot = document.createElement('slot');\n expandSlot.setAttribute('name', 'expand');\n\n let collapseSlot = document.createElement('slot');\n collapseSlot.setAttribute('name', 'collapse');\n\n button.appendChild(expandSlot);\n button.appendChild(collapseSlot);\n }\n\n item.appendChild(button);\n\n if (this.selection === 'multiple') item.appendChild(checkbox);\n\n label.appendChild(slotElement);\n item.appendChild(label);\n item.appendChild(slotEnd);\n\n native.appendChild(item);\n native.appendChild(children);\n\n fragment.appendChild(native);\n\n this.checkbox = checkbox;\n this.native = native;\n this.button = button;\n this.childrenElement = children;\n this.childrenSlot = slot;\n\n return fragment;\n }\n\n /**\n * Executes operations to be performed after the draw action is completed.\n * If the state indicates it is expanded, toggles its children.\n * Additionally, sets up an event listener on the button element to handle toggling children upon click.\n * @returns {void} Does not return a value.\n */\n afterDraw() {\n if (this.expanded) this.toggleChildren();\n\n this.button.addEventListener('click', this.toggleChildren.bind(this));\n this.setAttribute('tabindex', '0');\n this.syncAria();\n }\n\n /**\n * Determines if the current item is a nested item within a tree structure.\n * Checks if the item's parent element exists and is also a tree item.\n * @returns {boolean} Returns true if the current item is a nested tree item; otherwise, false.\n */\n isNestedItem() {\n const parent = this.parentElement;\n return !!parent && this.isTreeItem(parent);\n }\n\n /**\n * Checks whether the given node is a tree item.\n * @param {object} node The node to check.\n * @returns {boolean} Returns true if the node is an Element and has a class name of 'TreeItem', otherwise false.\n */\n isTreeItem(node) {\n return node instanceof Element && node.className === 'TreeItem';\n }\n\n /**\n * Toggles the visibility state of the children element and updates the class of the parent element.\n * The method toggles the 'open' class on the children elements and the 'expanded' class on the parent element,\n * effectively showing or hiding the children and indicating the expanded state.\n * @returns {void} Does not return a value.\n */\n toggleChildren() {\n this.childrenElement.classList.toggle('open');\n this.native.classList.toggle('expanded');\n this.syncAria();\n }\n\n /**\n * Syncs ARIA attributes on the host element.\n */\n syncAria() {\n const hasChildren = this.querySelectorAll(':scope > wje-tree-item').length > 0;\n const expanded = hasChildren ? this.native?.classList?.contains('expanded') : undefined;\n if (this.selection === 'multiple') {\n const checked = this.indeterminate ? 'mixed' : (this.selected ? 'true' : 'false');\n this.setAriaState({\n role: 'treeitem',\n checked,\n expanded,\n });\n } else {\n this.setAriaState({\n role: 'treeitem',\n selected: this.selected,\n expanded,\n });\n }\n }\n\n /**\n * Retrieves the child items from the `childrenSlot` that match specific criteria.\n * @param {object} [options] Configuration options.\n * @param {boolean} [options.includeDisabled] Determines whether disabled items should be included in the result. Defaults to true.\n * @returns {Array} An array of child items that are valid tree items and meet the criteria specified in the options.\n */\n getChildrenItems(options = {}) {\n const includeDisabled = options.includeDisabled ?? true; // Ak nie je zadané, predvolená hodnota je true\n\n const assigned = this.childrenSlot\n ? this.childrenSlot.assignedElements({ flatten: true })\n : [];\n const direct = assigned.length\n ? assigned\n : Array.from(this.querySelectorAll(':scope > wje-tree-item'));\n\n return direct.filter(\n (item) => this.isTreeItem(item) && (includeDisabled || !item.disabled)\n );\n }\n\n /**\n * Retrieves all descendant children of the current object in a flattened array structure.\n * @param {object} [options] An optional object specifying filters or configurations for retrieving children.\n * @returns {Array} An array containing all children and their descendants in a flat structure.\n */\n getAllChildrenFlat(options = {}) {\n const directChildren = this.getChildrenItems(options);\n return directChildren.flatMap((child) => [child, ...child.getAllChildrenFlat(options)]);\n }\n}\n","import TreeItem from './tree-item.element.js';\n\nexport default TreeItem;\n\nTreeItem.define('wje-tree-item', TreeItem);\n"],"names":[],"mappings":";;;;;AAkBe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI5C,cAAc;AACV,UAAO;AA4FX;AAAA;AAAA;AAAA;AAAA,qCAAY;AA1FR,SAAK,aAAa;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,IAAI,SAAS,OAAO;AAChB,QAAI,OAAO;AACP,WAAK,aAAa,YAAY,EAAE;AAAA,I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ChB,CAAa;AAAA,IACb;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,iBAAiB,UAAU,IAAI;AAC3B,UAAM,kBAAkB,QAAQ,mBAAmB;AAEnD,UAAM,WAAW,KAAK,eAChB,KAAK,aAAa,iBAAiB,EAAE,SAAS,KAAM,CAAA,IACpD,CAAE;AACR,UAAM,SAAS,SAAS,SAClB,WACA,MAAM,KAAK,KAAK,iBAAiB,wBAAwB,CAAC;AAEhE,WAAO,OAAO;AAAA,MACV,CAAC,SAAS,KAAK,WAAW,IAAI,MAAM,mBAAmB,CAAC,KAAK;AAAA,IAChE;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB,UAAU,IAAI;AAC7B,UAAM,iBAAiB,KAAK,iBAAiB,OAAO;AACpD,WAAO,eAAe,QAAQ,CAAC,UAAU,CAAC,OAAO,GAAG,MAAM,mBAAmB,OAAO,CAAC,CAAC;AAAA,EAC9F;AACA;AC/XA,SAAS,OAAO,iBAAiB,QAAQ;"}
package/dist/wje-tree.js CHANGED
@@ -22,7 +22,7 @@ class Tree extends WJElement {
22
22
  * @param {Event} e The click event object.
23
23
  */
24
24
  __publicField(this, "handleClick", (e) => {
25
- e.preventDefault();
25
+ if (e == null ? void 0 : e.preventDefault) e.preventDefault();
26
26
  let selectedItem = e.target.closest("wje-tree-item");
27
27
  let isClickButton = e.composedPath().some((el) => {
28
28
  var _a;
@@ -69,6 +69,7 @@ class Tree extends WJElement {
69
69
  */
70
70
  setupAttributes() {
71
71
  this.isShadowRoot = "open";
72
+ this.syncAria();
72
73
  }
73
74
  /**
74
75
  * A method called before the drawing or rendering process of tree items.
@@ -108,6 +109,16 @@ class Tree extends WJElement {
108
109
  */
109
110
  afterDraw() {
110
111
  this.addEventListener("click", this.handleClick);
112
+ this.syncAria();
113
+ }
114
+ /**
115
+ * Syncs ARIA attributes on the host element.
116
+ */
117
+ syncAria() {
118
+ this.setAriaState({
119
+ role: "tree",
120
+ multiselectable: this.selection === "multiple" ? "true" : void 0
121
+ });
111
122
  }
112
123
  beforeDisconnect() {
113
124
  this.removeEventListener("click", this.handleClick);
@@ -1 +1 @@
1
- {"version":3,"file":"wje-tree.js","sources":["../packages/wje-tree/tree.element.js","../packages/wje-tree/tree.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Tree` is a custom web component that represents a hierarchical tree structure.\n * It extends from `WJElement`.\n * @summary This element visually represents a tree structure, supporting single or multiple selection modes and hierarchy management.\n * @documentation https://elements.webjet.sk/components/tree\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native container part of the tree.\n * @slot - The default slot to place `wje-tree-item` child components.\n * @tag wje-tree\n */\n\nexport default class Tree extends WJElement {\n /**\n * Creates an instance of Toast.\n */\n constructor() {\n super();\n }\n\n /**\n * Sets the selection attribute for the element.\n * @param {string} value The value to set as the selection attribute.\n */\n set selection(value) {\n this.setAttribute('selection', value);\n }\n\n /**\n * Gets the current selection mode for the element.\n * If no selection is explicitly set, it defaults to 'single'.\n * @returns {string} The current selection mode, either set by the element's attribute or the default value 'single'.\n */\n get selection() {\n return this.getAttribute('selection') || 'single';\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Tree';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * A method called before the drawing or rendering process of tree items.\n * It iterates through all `wje-tree-item` elements, updating their selection state\n * and managing their expand/collapse icons accordingly.\n * @returns {void} This method does not return a value.\n */\n beforeDraw() {\n const items = this.querySelectorAll('wje-tree-item');\n items?.forEach((item) => {\n item.selection = this.selection;\n\n this.getExpandCollapseIcon(item, 'expand');\n this.getExpandCollapseIcon(item, 'collapse');\n\n this.getSlots(item, 'start');\n this.getSlots(item, 'end');\n });\n }\n\n /**\n * Draw method for the toast notification.\n * @returns {object} Document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tree');\n\n let slot = document.createElement('slot');\n\n native.appendChild(slot);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n\n /**\n * Called after the draw process of the component is completed.\n * Typically used to add event listeners or perform operations\n * that are dependent on the component's drawn state.\n * @returns {void} This method does not return a value.\n */\n afterDraw() {\n this.addEventListener('click', this.handleClick);\n }\n\n beforeDisconnect() {\n this.removeEventListener('click', this.handleClick);\n }\n\n /**\n * Handles the click event triggered by the user interaction.\n * Identifies the closest tree item element to the event target and sets it\n * as the selected item. Ensures that only one item is selected at a time, resetting\n * the selection state for all other items.\n * @param {Event} e The click event object.\n */\n handleClick = (e) => {\n e.preventDefault();\n\n let selectedItem = e.target.closest('wje-tree-item');\n let isClickButton = e.composedPath().some((el) => el?.classList?.contains('toggle'));\n if (isClickButton) return;\n\n if (this.selection === 'single') {\n if (selectedItem) {\n for (let item of this.getAllItems()) {\n item.selected = item === selectedItem;\n }\n }\n } else if (this.selection === 'multiple') {\n // let children = selectedItem.getAllChildrenFlat();\n selectedItem.selected = !selectedItem.selected;\n\n this.updateCheckboxState(selectedItem);\n }\n };\n\n /**\n * Retrieves all items that match the selector 'wje-tree-item' within the current context.\n * @returns {Array<Element>} An array of all matching DOM elements.\n */\n getAllItems() {\n return [...this.querySelectorAll('wje-tree-item')];\n }\n\n /**\n * Retrieves and appends an expand/collapse icon to a given item based on the provided status.\n * @param {HTMLElement} item The DOM element to which the icon will be appended.\n * @param {string} status The status indicating which icon to retrieve (e.g., \"expand\" or \"collapse\").\n * @returns {void} This method does not return a value. If the icon matching the given status is not found, a warning is logged.\n */\n getExpandCollapseIcon(item, status) {\n let icon = this.querySelector('template')?.content.querySelector(`[slot=\"${status}\"]`);\n if (!icon) {\n console.warn(`Icon with slot \"${status}\" was not found.`);\n return;\n }\n\n let iconClone = icon.cloneNode(true);\n item.append(iconClone);\n }\n\n getSlots(item, slotName) {\n let slot = this.querySelector('template')?.content.querySelector(`[slot=\"${slotName}\"]`);\n if (!slot) {\n console.warn(`Icon with slot \"${slotName}\" was not found.`);\n return;\n }\n\n let slotClone = slot.cloneNode(true);\n item.append(slotClone);\n }\n\n /**\n * Updates the state of a checkbox, syncing the state both upwards to parent elements\n * and downwards to child elements as necessary.\n * @param {object} changedItem The specific item whose checkbox state has changed.\n * @param {boolean} [isInitialSync] Indicates whether the state update is part of the initial synchronization process.\n * @returns {void} This method does not return a value.\n */\n updateCheckboxState(changedItem, isInitialSync = false) {\n this.isInitialSync = isInitialSync;\n this.propagateStateDownwards(changedItem);\n this.propagateStateUpwards(changedItem);\n }\n\n /**\n * Updates the state of the parent item based on the state of its child items.\n * Recursively propagates changes up to all parent items to reflect the selection\n * or indeterminate state accurately.\n * @param {object} item The current tree item whose parent state needs to be updated.\n * It is expected to have properties `selected`, `indeterminate`,\n * and a method `getChildrenItems({ includeDisabled: boolean })`.\n * @returns {void} This method does not return a value.\n */\n updateParentState(item) {\n const children = item.getChildrenItems({ includeDisabled: false });\n\n if (children.length) {\n const areAllChildrenChecked = children.every((child) => child.selected);\n const areSomeChildrenChecked = children.some((child) => child.selected);\n const areSomeChildrenIndeterminate = children.some((child) => child.indeterminate);\n\n item.selected = areAllChildrenChecked;\n item.indeterminate = areSomeChildrenIndeterminate || (areSomeChildrenChecked && !areAllChildrenChecked);\n } else {\n item.indeterminate = false;\n }\n\n const parent = item.parentElement?.closest('wje-tree-item');\n if (parent) {\n this.updateParentState(parent);\n }\n }\n\n /**\n * Propagates the state changes of an item upwards through its ancestors in the hierarchy.\n * Calls the `updateParentState` method for each parent element until no parent exists.\n * @param {HTMLElement} item The current item whose state to propagate to its parent.\n * @returns {void} This method does not return a value.\n */\n propagateStateUpwards(item) {\n const parent = item.parentElement?.closest('wje-tree-item');\n\n if (parent) {\n this.updateParentState(parent);\n this.propagateStateUpwards(parent);\n }\n }\n\n /**\n * Propagates the selected state of an item to its children recursively. Depending on the `isInitialSync` flag,\n * it also determines how the state should be applied to the child items and updates the parent state if needed.\n * @param {object} item The item whose state is being propagated to its child items. The item must have properties\n * such as `selected` and methods like `getChildrenItems` to retrieve its child elements.\n * @returns {void} This method does not return a value.\n */\n propagateStateDownwards(item) {\n const isChecked = item.selected;\n\n item.getChildrenItems().forEach((child) => {\n child.selected = this.isInitialSync ? isChecked || child.selected : !child.disabled && isChecked;\n this.propagateStateDownwards(child);\n });\n\n if (this.isInitialSync) {\n this.updateParentState(item);\n }\n }\n}\n","import Tree from './tree.element.js';\n\nexport default Tree;\n\nTree.define('wje-tree', Tree);\n"],"names":[],"mappings":";;;;;AAee,MAAM,aAAa,UAAU;AAAA;AAAA;AAAA;AAAA,EAIxC,cAAc;AACV,UAAO;AAwBX;AAAA;AAAA;AAAA;AAAA,qCAAY;AA8EZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uCAAc,CAAC,MAAM;AACjB,QAAE,eAAgB;AAElB,UAAI,eAAe,EAAE,OAAO,QAAQ,eAAe;AACnD,UAAI,gBAAgB,EAAE,aAAY,EAAG,KAAK,CAAC,OAAE;;AAAK,8CAAI,cAAJ,mBAAe,SAAS;AAAA,OAAS;AACnF,UAAI,cAAe;AAEnB,UAAI,KAAK,cAAc,UAAU;AAC7B,YAAI,cAAc;AACd,mBAAS,QAAQ,KAAK,eAAe;AACjC,iBAAK,WAAW,SAAS;AAAA,UAC7C;AAAA,QACA;AAAA,MACA,WAAmB,KAAK,cAAc,YAAY;AAEtC,qBAAa,WAAW,CAAC,aAAa;AAEtC,aAAK,oBAAoB,YAAY;AAAA,MACjD;AAAA,IACK;AAAA,EAxHL;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,UAAU,OAAO;AACjB,SAAK,aAAa,aAAa,KAAK;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAA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AAK,kBAAL,mBAAoB,QAAQ;AAE3C,QAAI,QAAQ;AACR,WAAK,kBAAkB,MAAM;AAC7B,WAAK,sBAAsB,MAAM;AAAA,IAC7C;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,wBAAwB,MAAM;AAC1B,UAAM,YAAY,KAAK;AAEvB,SAAK,iBAAgB,EAAG,QAAQ,CAAC,UAAU;AACvC,YAAM,WAAW,KAAK,gBAAgB,aAAa,MAAM,WAAW,CAAC,MAAM,YAAY;AACvF,WAAK,wBAAwB,KAAK;AAAA,IAC9C,CAAS;AAED,QAAI,KAAK,eAAe;AACpB,WAAK,kBAAkB,IAAI;AAAA,IACvC;AAAA,EACA;AACA;AC3PA,KAAK,OAAO,YAAY,IAAI;"}
1
+ {"version":3,"file":"wje-tree.js","sources":["../packages/wje-tree/tree.element.js","../packages/wje-tree/tree.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Tree` is a custom web component that represents a hierarchical tree structure.\n * It extends from `WJElement`.\n * @summary This element visually represents a tree structure, supporting single or multiple selection modes and hierarchy management.\n * @documentation https://elements.webjet.sk/components/tree\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native container part of the tree.\n * @slot - The default slot to place `wje-tree-item` child components.\n * @tag wje-tree\n */\n\nexport default class Tree extends WJElement {\n /**\n * Creates an instance of Toast.\n */\n constructor() {\n super();\n }\n\n /**\n * Sets the selection attribute for the element.\n * @param {string} value The value to set as the selection attribute.\n */\n set selection(value) {\n this.setAttribute('selection', value);\n }\n\n /**\n * Gets the current selection mode for the element.\n * If no selection is explicitly set, it defaults to 'single'.\n * @returns {string} The current selection mode, either set by the element's attribute or the default value 'single'.\n */\n get selection() {\n return this.getAttribute('selection') || 'single';\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Tree';\n\n /**\n * Returns the CSS stylesheet for the component.\n * @static\n * @returns {CSSStyleSheet} The CSS stylesheet\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * A method called before the drawing or rendering process of tree items.\n * It iterates through all `wje-tree-item` elements, updating their selection state\n * and managing their expand/collapse icons accordingly.\n * @returns {void} This method does not return a value.\n */\n beforeDraw() {\n const items = this.querySelectorAll('wje-tree-item');\n items?.forEach((item) => {\n item.selection = this.selection;\n\n this.getExpandCollapseIcon(item, 'expand');\n this.getExpandCollapseIcon(item, 'collapse');\n\n this.getSlots(item, 'start');\n this.getSlots(item, 'end');\n });\n }\n\n /**\n * Draw method for the toast notification.\n * @returns {object} Document fragment\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tree');\n\n let slot = document.createElement('slot');\n\n native.appendChild(slot);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n\n /**\n * Called after the draw process of the component is completed.\n * Typically used to add event listeners or perform operations\n * that are dependent on the component's drawn state.\n * @returns {void} This method does not return a value.\n */\n afterDraw() {\n this.addEventListener('click', this.handleClick);\n this.syncAria();\n }\n\n /**\n * Syncs ARIA attributes on the host element.\n */\n syncAria() {\n this.setAriaState({\n role: 'tree',\n multiselectable: this.selection === 'multiple' ? 'true' : undefined,\n });\n }\n\n beforeDisconnect() {\n this.removeEventListener('click', this.handleClick);\n }\n\n /**\n * Handles the click event triggered by the user interaction.\n * Identifies the closest tree item element to the event target and sets it\n * as the selected item. Ensures that only one item is selected at a time, resetting\n * the selection state for all other items.\n * @param {Event} e The click event object.\n */\n handleClick = (e) => {\n if (e?.preventDefault) e.preventDefault();\n\n let selectedItem = e.target.closest('wje-tree-item');\n let isClickButton = e.composedPath().some((el) => el?.classList?.contains('toggle'));\n if (isClickButton) return;\n\n if (this.selection === 'single') {\n if (selectedItem) {\n for (let item of this.getAllItems()) {\n item.selected = item === selectedItem;\n }\n }\n } else if (this.selection === 'multiple') {\n // let children = selectedItem.getAllChildrenFlat();\n selectedItem.selected = !selectedItem.selected;\n\n this.updateCheckboxState(selectedItem);\n }\n };\n\n /**\n * Retrieves all items that match the selector 'wje-tree-item' within the current context.\n * @returns {Array<Element>} An array of all matching DOM elements.\n */\n getAllItems() {\n return [...this.querySelectorAll('wje-tree-item')];\n }\n\n /**\n * Retrieves and appends an expand/collapse icon to a given item based on the provided status.\n * @param {HTMLElement} item The DOM element to which the icon will be appended.\n * @param {string} status The status indicating which icon to retrieve (e.g., \"expand\" or \"collapse\").\n * @returns {void} This method does not return a value. If the icon matching the given status is not found, a warning is logged.\n */\n getExpandCollapseIcon(item, status) {\n let icon = this.querySelector('template')?.content.querySelector(`[slot=\"${status}\"]`);\n if (!icon) {\n console.warn(`Icon with slot \"${status}\" was not found.`);\n return;\n }\n\n let iconClone = icon.cloneNode(true);\n item.append(iconClone);\n }\n\n getSlots(item, slotName) {\n let slot = this.querySelector('template')?.content.querySelector(`[slot=\"${slotName}\"]`);\n if (!slot) {\n console.warn(`Icon with slot \"${slotName}\" was not found.`);\n return;\n }\n\n let slotClone = slot.cloneNode(true);\n item.append(slotClone);\n }\n\n /**\n * Updates the state of a checkbox, syncing the state both upwards to parent elements\n * and downwards to child elements as necessary.\n * @param {object} changedItem The specific item whose checkbox state has changed.\n * @param {boolean} [isInitialSync] Indicates whether the state update is part of the initial synchronization process.\n * @returns {void} This method does not return a value.\n */\n updateCheckboxState(changedItem, isInitialSync = false) {\n this.isInitialSync = isInitialSync;\n this.propagateStateDownwards(changedItem);\n this.propagateStateUpwards(changedItem);\n }\n\n /**\n * Updates the state of the parent item based on the state of its child items.\n * Recursively propagates changes up to all parent items to reflect the selection\n * or indeterminate state accurately.\n * @param {object} item The current tree item whose parent state needs to be updated.\n * It is expected to have properties `selected`, `indeterminate`,\n * and a method `getChildrenItems({ includeDisabled: boolean })`.\n * @returns {void} This method does not return a value.\n */\n updateParentState(item) {\n const children = item.getChildrenItems({ includeDisabled: false });\n\n if (children.length) {\n const areAllChildrenChecked = children.every((child) => child.selected);\n const areSomeChildrenChecked = children.some((child) => child.selected);\n const areSomeChildrenIndeterminate = children.some((child) => child.indeterminate);\n\n item.selected = areAllChildrenChecked;\n item.indeterminate = areSomeChildrenIndeterminate || (areSomeChildrenChecked && !areAllChildrenChecked);\n } else {\n item.indeterminate = false;\n }\n\n const parent = item.parentElement?.closest('wje-tree-item');\n if (parent) {\n this.updateParentState(parent);\n }\n }\n\n /**\n * Propagates the state changes of an item upwards through its ancestors in the hierarchy.\n * Calls the `updateParentState` method for each parent element until no parent exists.\n * @param {HTMLElement} item The current item whose state to propagate to its parent.\n * @returns {void} This method does not return a value.\n */\n propagateStateUpwards(item) {\n const parent = item.parentElement?.closest('wje-tree-item');\n\n if (parent) {\n this.updateParentState(parent);\n this.propagateStateUpwards(parent);\n }\n }\n\n /**\n * Propagates the selected state of an item to its children recursively. Depending on the `isInitialSync` flag,\n * it also determines how the state should be applied to the child items and updates the parent state if needed.\n * @param {object} item The item whose state is being propagated to its child items. The item must have properties\n * such as `selected` and methods like `getChildrenItems` to retrieve its child elements.\n * @returns {void} This method does not return a value.\n */\n propagateStateDownwards(item) {\n const isChecked = item.selected;\n\n item.getChildrenItems().forEach((child) => {\n child.selected = this.isInitialSync ? isChecked || child.selected : !child.disabled && isChecked;\n this.propagateStateDownwards(child);\n });\n\n if (this.isInitialSync) {\n this.updateParentState(item);\n }\n }\n}\n","import Tree from './tree.element.js';\n\nexport default Tree;\n\nTree.define('wje-tree', Tree);\n"],"names":[],"mappings":";;;;;AAee,MAAM,aAAa,UAAU;AAAA;AAAA;AAAA;AAAA,EAIxC,cAAc;AACV,UAAO;AAwBX;AAAA;AAAA;AAAA;AAAA,qCAAY;AA0FZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uCAAc,CAAC,MAAM;AACjB,UAAI,uBAAG,eAAgB,GAAE,eAAgB;AAEzC,UAAI,eAAe,EAAE,OAAO,QAAQ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@@
1
1
  {
2
2
  "name": "wj-elements",
3
3
  "description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
4
- "version": "0.2.0-alpha.8",
4
+ "version": "0.3.0",
5
5
  "homepage": "https://github.com/lencys/wj-elements",
6
6
  "author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
7
7
  "license": "MIT",
@@ -44,20 +44,39 @@
44
44
  "lint": "eslint packages experimental-packages --max-warnings 0",
45
45
  "lint:fix": "eslint packages experimental-packages --max-warnings 0 --fix",
46
46
  "prettier": "prettier --write ./packages ./experimental-packages",
47
+ "test:accordion": "web-test-runner --files packages/wje-accordion/accordion.test.js",
47
48
  "test:animation": "web-test-runner --files packages/wje-animation/animation.test.js",
48
49
  "test:avatar": "web-test-runner --files packages/wje-avatar/avatar.test.js",
49
50
  "test:badge": "web-test-runner --files packages/wje-badge/badge.test.js",
50
51
  "test:breadcrumbs": "web-test-runner --files packages/wje-breadcrumbs/breadcrumbs.test.js",
51
52
  "test:button": "web-test-runner --files packages/wje-button/button.test.js",
52
53
  "test:chip": "web-test-runner --files packages/wje-chip/chip.test.js",
54
+ "test:checkbox": "web-test-runner --files packages/wje-checkbox/checkbox.test.js",
53
55
  "test:color-picker": "web-test-runner --files packages/wje-color-picker/color-picker.test.js",
56
+ "test:dialog": "web-test-runner --files packages/wje-dialog/dialog.test.js",
57
+ "test:dropdown": "web-test-runner --files packages/wje-dropdown/dropdown.test.js",
54
58
  "test:file-upload": "web-test-runner --files packages/wje-file-upload/file-upload.test.js",
55
59
  "test:format-digital": "web-test-runner --files packages/wje-format-digital/format-digital.test.js",
60
+ "test:img": "web-test-runner --files packages/wje-img/img.test.js",
61
+ "test:img-comparer": "web-test-runner --files packages/wje-img-comparer/img-comparer.test.js",
62
+ "test:input": "web-test-runner --files packages/wje-input/input.test.js",
63
+ "test:input-file": "web-test-runner --files packages/wje-input-file/input-file.test.js",
64
+ "test:menu-button": "web-test-runner --files packages/wje-menu-button/menu-button.test.js",
65
+ "test:menu-item": "web-test-runner --files packages/wje-menu-item/menu-item.test.js",
66
+ "test:menu": "web-test-runner --files packages/wje-menu/menu.test.js",
67
+ "test:pagination": "web-test-runner --files packages/wje-pagination/pagination.test.js",
68
+ "test:qr-code": "web-test-runner --files packages/wje-qr-code/qr-code.test.js",
69
+ "test:radio": "web-test-runner --files packages/wje-radio/radio.test.js",
70
+ "test:radio-group": "web-test-runner --files packages/wje-radio-group/radio-group.test.js",
56
71
  "test:relative-time": "web-test-runner --files packages/wje-relative-time/relative-time.test.js",
57
72
  "test:select": "web-test-runner --files packages/wje-select/select.test.js",
73
+ "test:slider": "web-test-runner --files packages/wje-slider/slider.test.js",
74
+ "test:status": "web-test-runner --files packages/wje-status/status.test.js",
58
75
  "test:tab-group": "web-test-runner --files packages/wje-tab-group/tab-group.test.js",
76
+ "test:textarea": "web-test-runner --files packages/wje-textarea/textarea.test.js",
59
77
  "test:toast": "web-test-runner --files packages/wje-toast/toast.test.js",
60
- "test:toggle": "web-test-runner --files packages/wje-toggle/toggle.test.js"
78
+ "test:toggle": "web-test-runner --files packages/wje-toggle/toggle.test.js",
79
+ "test:tooltip": "web-test-runner --files packages/wje-tooltip/tooltip.test.js"
61
80
  },
62
81
  "exports": {
63
82
  ".": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-associated-element-o0UjvdUp.js","sources":["../packages/internals/form-associated-element.js"],"sourcesContent":["import { default as WJElement, event } from \"../wje-element/element.js\";\n\nexport class FormAssociatedElement extends WJElement {\n static formAssociated = true;\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n /**\n * Sets the 'name' attribute to the given value.\n * @param {string} value The new value for the 'name' attribute.\n */\n set name(value) {\n this.setAttribute('name', value);\n }\n\n /**\n * Getter for the name attribute.\n * @returns {string} The name of the input.\n */\n get name() {\n return this.getAttribute('name');\n }\n\n /**\n * Getter for the type attribute.\n * @returns {string} The type of the input.\n */\n get type() {\n return this.getAttribute(\"type\");\n }\n\n /**\n * Sets or removes the 'required' attribute on the element.\n * @param {boolean} value If true, adds the 'required' attribute. If false, removes the 'required' attribute.\n */\n set required(value) {\n if (value) {\n this.setAttribute('required', '');\n } else {\n this.removeAttribute('required');\n }\n }\n\n /**\n * Checks if the 'required' attribute is present on the element.\n * @returns {boolean} `true` if the 'required' attribute is set, otherwise `false`.\n */\n get required() {\n return this.hasAttribute('required');\n }\n\n /**\n * Setter for the invalid attribute.\n * @param {boolean} isInvalid Whether the input is invalid.\n */\n set invalid(isInvalid) {\n if (isInvalid) this.setAttribute('invalid', '');\n else this.removeAttribute('invalid');\n }\n\n /**\n * Getter for the invalid attribute.\n * @returns {boolean} Whether the attribute is present.\n */\n get invalid() {\n return this.hasAttribute('invalid');\n }\n\n /**\n * Set checked attribute.\n * @param {boolean} value true if the toggle is checked, false otherwise\n */\n set disabled(value) {\n if (value) {\n this.setAttribute('disabled', '');\n } else {\n this.removeAttribute('disabled');\n }\n }\n\n /**\n * Get disabled attribute value.\n * @returns {boolean} true if the toggle is disabled, false otherwise\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n /**\n * Retrieves the form element associated with this object.\n * @returns {HTMLFormElement|null} The associated form element, or null if there isn't one.\n */\n get form() {\n return this.internals.form;\n }\n\n /**\n * Retrieves the validity state of the element by returning the validity object from the internal element.\n * The validity object provides information on whether the element satisfies its validation constraints.\n * @returns {ValidityState} The validity state object representing the element's validation constraints.\n */\n get validity() {\n return this.internals.validity;\n }\n\n /**\n * Retrieves the current validation message associated with the element.\n * @returns {string} The validation message that describes why the element's value fails validity checks.\n */\n get validationMessage() {\n return this.internals.validationMessage;\n }\n\n /**\n * Indicates whether the element is a candidate for constraint validation.\n * @returns {boolean} Returns true if the element will be validated during constraint validation, false otherwise.\n */\n get willValidate() {\n return this.internals.willValidate;\n }\n\n /**\n * Validates the input element associated with the component and updates its validity state\n * and error messages based on the user's input and the current validation rules.\n * @returns {void} This method does not return a value. It modifies the validity state\n * internally and sets appropriate validation messages.\n */\n validate() {\n const validState = this.input.validity;\n\n if (!validState.valid) {\n for (let state in validState) {\n const attr = `message-${state.toString()}`;\n\n if (validState[state]) {\n this.validationError = state.toString();\n let errorMessage = this.message;\n\n // TODO this take error messages based on lang from operating system of user should we implement custom translations based on app language ?\n if (!this.hasAttribute('message'))\n errorMessage = this.hasAttribute(attr) ? this.getAttribute(attr) : this.input.validationMessage;\n\n this.internals.setValidity({ [this.validationError]: true }, errorMessage, this.input);\n }\n }\n } else {\n this.internals.setValidity({});\n }\n }\n\n /**\n * Propagates a validation event based on the validity state of the component.\n *\n * This method checks the validity status of the component and emits a custom\n * event if the component is invalid. The event's name and additional details\n * can be specified.\n * @param {string} [eventName] The name of the event to dispatch when the component is invalid.\n * @param {object} [detail] Additional detail to include in the dispatched event.\n * @returns {void} This method does not return a value.\n */\n propagateValidation(eventName = 'invalid', detail = {}) {\n const internals = this.internals;\n\n this.invalid = !this.pristine && !internals.validity.valid;\n\n if (this.invalid) {\n event.dispatchCustomEvent(this, this.tagName.toLocaleLowerCase() + ':' + eventName, detail);\n }\n }\n\n /**\n * Displays an invalid message for the current element.\n * If an error message element does not exist within the designated slot,\n * it creates one and appends it to the slot. Updates the text content\n * of the error message element with the validation message from the\n * element's internals.\n * @returns {void} This method does not return any value.\n */\n showInvalidMessage() {\n const internals = this.internals;\n const slot = this.querySelector(\"[slot='error']\");\n let errorMessageEl = slot?.querySelector('[error-message]');\n\n if (!errorMessageEl) {\n const error = document.createElement('div');\n error.setAttribute('error-message', '');\n slot?.append(error);\n errorMessageEl = error;\n }\n\n errorMessageEl.textContent = internals.validationMessage;\n }\n\n /**\n * Checks the validity of the input by invoking custom validation logic\n * and then verifying against internal validation rules.\n * @returns {boolean} Returns true if the input is valid according to both custom validation and internal validation rules, otherwise false.\n */\n checkValidity() {\n // zavolá tvoju vlastnú validáciu pred kontrolou internals\n this.validate();\n return this.internals.checkValidity();\n }\n\n /**\n * Callback to handle the reset action for a form.\n * Resets the value of the form control to its default value, updates the form value, and clears any validity states.\n * @returns {void} Does not return a value.\n */\n formResetCallback() {\n this.value = this.defaultValue;\n this.internals.setFormValue(this.defaultValue);\n this.internals.setValidity({});\n }\n\n /**\n * Restores the form state by assigning the provided state value\n * and updating the internal form value and validity.\n * @param {object} state The state object containing the value to restore the form.\n * @param {*} state.value The value to set for the form element.\n * @returns {void} This method does not return any value.\n */\n formStateRestoreCallback(state) {\n this.value = state.value;\n this.internals.setFormValue(state.value);\n this.internals.setValidity({});\n }\n\n /**\n * Callback method to save the current state of a form.\n * This method captures and returns the form's value property.\n * @returns {object} An object containing the `value` property of the current form state.\n */\n formStateSaveCallback() {\n return {\n value: this.value\n };\n }\n\n /**\n * Toggles the disabled state of the component and updates corresponding attributes.\n * @param {boolean} disabled Indicates whether the form should be marked as disabled.\n * If true, the 'disabled' class is added, and the 'disabled' attribute is set.\n * If false, both the class and attribute are removed.\n * @returns {void}\n */\n formDisabledCallback(disabled) {\n this.native?.classList.toggle('disabled', disabled);\n this.toggleAttribute('disabled', disabled);\n }\n\n /**\n * A lifecycle callback that is executed when the element is associated with a form.\n * It updates the form's value field with the element's value and sets up an event\n * listener to perform validation and propagate it whenever the form is submitted.\n * @returns {void} Does not return any value.\n */\n formAssociatedCallback() {\n if (this.form) {\n this.internals.setFormValue(this.value);\n this.form?.addEventListener('submit', () => {\n this.validate();\n this.propagateValidation();\n });\n }\n }\n}"],"names":[],"mappings":";;;;;AAEO,MAAM,8BAA8B,UAAU;AAAA,EAGnD,cAAc;AACZ,UAAO;AACP,SAAK,YAAY,KAAK,gBAAiB;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA;AAAA,EAME,IAAI,KAAK,OAAO;AACd,SAAK,aAAa,QAAQ,KAAK;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA,EAME,IAAI,OAAO;AACT,WAAO,KAAK,aAAa,MAAM;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA,EAME,IAAI,OAAO;AACT,WAAO,KAAK,aAAa,MAAM;AAAA,E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AQ,KAAK;AAClB,SAAK,UAAU,aAAa,KAAK,YAAY;AAC7C,SAAK,UAAU,YAAY,EAAE;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASE,yBAAyB,OAAO;AAC9B,SAAK,QAAQ,MAAM;AACnB,SAAK,UAAU,aAAa,MAAM,KAAK;AACvC,SAAK,UAAU,YAAY,EAAE;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOE,wBAAwB;AACtB,WAAO;AAAA,MACL,OAAO,KAAK;AAAA,IACb;AAAA,EACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASE,qBAAqB,UAAU;;AAC7B,eAAK,WAAL,mBAAa,UAAU,OAAO,YAAY;AAC1C,SAAK,gBAAgB,YAAY,QAAQ;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQE,yBAAyB;;AACvB,QAAI,KAAK,MAAM;AACb,WAAK,UAAU,aAAa,KAAK,KAAK;AACtC,iBAAK,SAAL,mBAAW,iBAAiB,UAAU,MAAM;AAC1C,aAAK,SAAU;AACf,aAAK,oBAAqB;AAAA,MAClC;AAAA,IACA;AAAA,EACA;AACA;AA1QE,cADW,uBACJ,kBAAiB;"}
@@ -1 +0,0 @@
1
- export function bool(v: any): boolean;
File without changes
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,33 +0,0 @@
1
- import { default as WJElement } from '../wje-element/element.js';
2
- /**
3
- * `QrCode` is a custom web component that generates a QR code.
4
- * @summary This element represents a QR code generator.
5
- * @documentation https://elements.webjet.sk/components/qr-code
6
- * @status stable
7
- * @augments {WJElement}
8
- * @csspart native - The native part of the QR code.
9
- * @slot top - The slot for the top content of the QR code.
10
- * @slot bottom - The slot for the bottom content of the QR code.
11
- * @tag wje-qr-code
12
- */
13
- export default class QrCode extends WJElement {
14
- /**
15
- * Returns the CSS stylesheet for the component.
16
- * @returns {CSSStyleSheet} The CSS stylesheet.
17
- */
18
- static get cssStyleSheet(): CSSStyleSheet;
19
- /**
20
- * Returns the list of observed attributes.
21
- * @returns {string[]} The list of observed attributes.
22
- */
23
- static get observedAttributes(): string[];
24
- /**
25
- * Draws the QR code component.
26
- * @returns {DocumentFragment} The document fragment containing the QR code component.
27
- */
28
- draw(): DocumentFragment;
29
- /**
30
- * Called after the component is drawn to generate the QR code.
31
- */
32
- afterDraw(): void;
33
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes