wj-elements 0.3.0 → 0.3.2

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 (353) hide show
  1. package/dist/animations.js.map +1 -1
  2. package/dist/base-path.js.map +1 -1
  3. package/dist/date.js.map +1 -1
  4. package/dist/element-utils.js.map +1 -1
  5. package/dist/event.js.map +1 -1
  6. package/dist/form-associated-element-DEQ4y-jn.js.map +1 -1
  7. package/dist/icon-DVyMc4Wv.js.map +1 -1
  8. package/dist/localize.js.map +1 -1
  9. package/dist/{index.d.ts → packages/index.d.ts} +1 -0
  10. package/dist/{translations → packages/translations}/sk-sk.d.ts +5 -0
  11. package/dist/packages/utils/router-links.d.ts +8 -0
  12. package/dist/{wje-button → packages/wje-button}/button.element.d.ts +12 -1
  13. package/dist/{wje-dialog → packages/wje-dialog}/dialog.element.d.ts +2 -0
  14. package/dist/{wje-menu-item → packages/wje-menu-item}/menu-item.element.d.ts +3 -2
  15. package/dist/{wje-router-link → packages/wje-router-link}/router-link.element.d.ts +2 -1
  16. package/dist/{wje-tab → packages/wje-tab}/tab.element.d.ts +2 -1
  17. package/dist/{wje-tree-item → packages/wje-tree-item}/tree-item.element.d.ts +13 -0
  18. package/dist/permissions.js.map +1 -1
  19. package/dist/{popup.element-Cl6QeG8M.js → popup.element-DklicGea.js} +129 -96
  20. package/dist/popup.element-DklicGea.js.map +1 -0
  21. package/dist/{router-links-CJnOdbas.js → router-links-DU0wTw84.js} +15 -3
  22. package/dist/router-links-DU0wTw84.js.map +1 -0
  23. package/dist/universal-service.js.map +1 -1
  24. package/dist/utils.js.map +1 -1
  25. package/dist/wje-accordion-item.js.map +1 -1
  26. package/dist/wje-accordion.js.map +1 -1
  27. package/dist/wje-animation.js.map +1 -1
  28. package/dist/wje-aside.js.map +1 -1
  29. package/dist/wje-avatar.js.map +1 -1
  30. package/dist/wje-badge.js.map +1 -1
  31. package/dist/wje-breadcrumb.js.map +1 -1
  32. package/dist/wje-breadcrumbs.js.map +1 -1
  33. package/dist/wje-button-group.js.map +1 -1
  34. package/dist/wje-button.js +43 -18
  35. package/dist/wje-button.js.map +1 -1
  36. package/dist/wje-card-content.js.map +1 -1
  37. package/dist/wje-card-controls.js.map +1 -1
  38. package/dist/wje-card-header.js.map +1 -1
  39. package/dist/wje-card-subtitle.js.map +1 -1
  40. package/dist/wje-card-title.js.map +1 -1
  41. package/dist/wje-card.js.map +1 -1
  42. package/dist/wje-carousel-item.js.map +1 -1
  43. package/dist/wje-carousel.js.map +1 -1
  44. package/dist/wje-checkbox.js.map +1 -1
  45. package/dist/wje-chip.js.map +1 -1
  46. package/dist/wje-col.js.map +1 -1
  47. package/dist/wje-color-picker.js +2 -2
  48. package/dist/wje-color-picker.js.map +1 -1
  49. package/dist/wje-container.js.map +1 -1
  50. package/dist/wje-copy-button.js.map +1 -1
  51. package/dist/wje-dialog.js +20 -16
  52. package/dist/wje-dialog.js.map +1 -1
  53. package/dist/wje-divider.js.map +1 -1
  54. package/dist/wje-dropdown.js +1 -1
  55. package/dist/wje-dropdown.js.map +1 -1
  56. package/dist/wje-element.js.map +1 -1
  57. package/dist/wje-file-upload-item.js.map +1 -1
  58. package/dist/wje-file-upload.js.map +1 -1
  59. package/dist/wje-footer.js.map +1 -1
  60. package/dist/wje-form.js.map +1 -1
  61. package/dist/wje-format-digital.js.map +1 -1
  62. package/dist/wje-grid.js.map +1 -1
  63. package/dist/wje-header.js.map +1 -1
  64. package/dist/wje-icon-library.js.map +1 -1
  65. package/dist/wje-icon-picker.js.map +1 -1
  66. package/dist/wje-img-comparer.js.map +1 -1
  67. package/dist/wje-img.js.map +1 -1
  68. package/dist/wje-infinite-scroll.js.map +1 -1
  69. package/dist/wje-input-file.js.map +1 -1
  70. package/dist/wje-input.js.map +1 -1
  71. package/dist/wje-item.js.map +1 -1
  72. package/dist/wje-kanban.js.map +1 -1
  73. package/dist/wje-label.js.map +1 -1
  74. package/dist/wje-level-indicator.js.map +1 -1
  75. package/dist/wje-list.js.map +1 -1
  76. package/dist/wje-main.js.map +1 -1
  77. package/dist/wje-masonry.js.map +1 -1
  78. package/dist/wje-master.js +8 -3
  79. package/dist/wje-master.js.map +1 -1
  80. package/dist/wje-menu-button.js.map +1 -1
  81. package/dist/wje-menu-item.js +17 -3
  82. package/dist/wje-menu-item.js.map +1 -1
  83. package/dist/wje-menu-label.js.map +1 -1
  84. package/dist/wje-menu.js.map +1 -1
  85. package/dist/wje-option.js +11 -0
  86. package/dist/wje-option.js.map +1 -1
  87. package/dist/wje-options.js.map +1 -1
  88. package/dist/wje-orgchart-group.js.map +1 -1
  89. package/dist/wje-orgchart-item.js.map +1 -1
  90. package/dist/wje-orgchart.js.map +1 -1
  91. package/dist/wje-pagination.js.map +1 -1
  92. package/dist/wje-popup.js +1 -1
  93. package/dist/wje-progress-bar.js.map +1 -1
  94. package/dist/wje-qr-code.js +3 -3
  95. package/dist/wje-qr-code.js.map +1 -1
  96. package/dist/wje-radio-group.js.map +1 -1
  97. package/dist/wje-radio.js.map +1 -1
  98. package/dist/wje-rate.js.map +1 -1
  99. package/dist/wje-relative-time.js.map +1 -1
  100. package/dist/wje-reorder-dropzone.js.map +1 -1
  101. package/dist/wje-reorder-handle.js.map +1 -1
  102. package/dist/wje-reorder-item.js.map +1 -1
  103. package/dist/wje-reorder.js.map +1 -1
  104. package/dist/wje-route.js.map +1 -1
  105. package/dist/wje-router-link.js +12 -2
  106. package/dist/wje-router-link.js.map +1 -1
  107. package/dist/wje-router-outlet.js +15 -5
  108. package/dist/wje-router-outlet.js.map +1 -1
  109. package/dist/wje-routerx.js +132 -73
  110. package/dist/wje-routerx.js.map +1 -1
  111. package/dist/wje-row.js.map +1 -1
  112. package/dist/wje-select.js +1 -1
  113. package/dist/wje-select.js.map +1 -1
  114. package/dist/wje-slider.js.map +1 -1
  115. package/dist/wje-sliding-container.js.map +1 -1
  116. package/dist/wje-split-view.js.map +1 -1
  117. package/dist/wje-status.js.map +1 -1
  118. package/dist/wje-step.js.map +1 -1
  119. package/dist/wje-stepper.js.map +1 -1
  120. package/dist/wje-store.js.map +1 -1
  121. package/dist/wje-tab-group.js.map +1 -1
  122. package/dist/wje-tab-panel.js.map +1 -1
  123. package/dist/wje-tab.js +12 -2
  124. package/dist/wje-tab.js.map +1 -1
  125. package/dist/wje-textarea.js.map +1 -1
  126. package/dist/wje-thumbnail.js.map +1 -1
  127. package/dist/wje-toast.js.map +1 -1
  128. package/dist/wje-toggle.js.map +1 -1
  129. package/dist/wje-toolbar-action.js.map +1 -1
  130. package/dist/wje-toolbar.js.map +1 -1
  131. package/dist/wje-tooltip.js +1 -1
  132. package/dist/wje-tooltip.js.map +1 -1
  133. package/dist/wje-tree-item.js +32 -3
  134. package/dist/wje-tree-item.js.map +1 -1
  135. package/dist/wje-tree.js.map +1 -1
  136. package/dist/wje-visually-hidden.js.map +1 -1
  137. package/package.json +2 -2
  138. package/dist/popup.element-Cl6QeG8M.js.map +0 -1
  139. package/dist/router-links-CJnOdbas.js.map +0 -1
  140. /package/dist/{internals → packages/internals}/form-associated-element.d.ts +0 -0
  141. /package/dist/{localize → packages/localize}/localize.d.ts +0 -0
  142. /package/dist/{translations → packages/translations}/en-gb.d.ts +0 -0
  143. /package/dist/{utils → packages/utils}/animations.d.ts +0 -0
  144. /package/dist/{utils → packages/utils}/base-path.d.ts +0 -0
  145. /package/dist/{utils → packages/utils}/date.d.ts +0 -0
  146. /package/dist/{utils → packages/utils}/element-utils.d.ts +0 -0
  147. /package/dist/{utils → packages/utils}/event.d.ts +0 -0
  148. /package/dist/{utils → packages/utils}/icon-library.d.ts +0 -0
  149. /package/dist/{utils → packages/utils}/localize.d.ts +0 -0
  150. /package/dist/{utils → packages/utils}/permissions.d.ts +0 -0
  151. /package/dist/{utils → packages/utils}/universal-service.d.ts +0 -0
  152. /package/dist/{utils → packages/utils}/utils.d.ts +0 -0
  153. /package/dist/{wje-accordion → packages/wje-accordion}/accordion.d.ts +0 -0
  154. /package/dist/{wje-accordion → packages/wje-accordion}/accordion.element.d.ts +0 -0
  155. /package/dist/{wje-accordion-item → packages/wje-accordion-item}/accordion-item.d.ts +0 -0
  156. /package/dist/{wje-accordion-item → packages/wje-accordion-item}/accordion-item.element.d.ts +0 -0
  157. /package/dist/{wje-animation → packages/wje-animation}/animation.d.ts +0 -0
  158. /package/dist/{wje-animation → packages/wje-animation}/animation.element.d.ts +0 -0
  159. /package/dist/{wje-aside → packages/wje-aside}/aside.d.ts +0 -0
  160. /package/dist/{wje-aside → packages/wje-aside}/aside.element.d.ts +0 -0
  161. /package/dist/{wje-avatar → packages/wje-avatar}/avatar.d.ts +0 -0
  162. /package/dist/{wje-avatar → packages/wje-avatar}/avatar.element.d.ts +0 -0
  163. /package/dist/{wje-avatar → packages/wje-avatar}/service/service.d.ts +0 -0
  164. /package/dist/{wje-badge → packages/wje-badge}/badge.d.ts +0 -0
  165. /package/dist/{wje-badge → packages/wje-badge}/badge.element.d.ts +0 -0
  166. /package/dist/{wje-breadcrumb → packages/wje-breadcrumb}/breadcrumb.d.ts +0 -0
  167. /package/dist/{wje-breadcrumb → packages/wje-breadcrumb}/breadcrumb.element.d.ts +0 -0
  168. /package/dist/{wje-breadcrumbs → packages/wje-breadcrumbs}/breadcrumbs.d.ts +0 -0
  169. /package/dist/{wje-breadcrumbs → packages/wje-breadcrumbs}/breadcrumbs.element.d.ts +0 -0
  170. /package/dist/{wje-button → packages/wje-button}/button.d.ts +0 -0
  171. /package/dist/{wje-button-group → packages/wje-button-group}/button-group.d.ts +0 -0
  172. /package/dist/{wje-button-group → packages/wje-button-group}/button-group.element.d.ts +0 -0
  173. /package/dist/{wje-card → packages/wje-card}/card.d.ts +0 -0
  174. /package/dist/{wje-card → packages/wje-card}/card.element.d.ts +0 -0
  175. /package/dist/{wje-card-content → packages/wje-card-content}/card-content.d.ts +0 -0
  176. /package/dist/{wje-card-content → packages/wje-card-content}/card-content.element.d.ts +0 -0
  177. /package/dist/{wje-card-controls → packages/wje-card-controls}/card-controls.d.ts +0 -0
  178. /package/dist/{wje-card-controls → packages/wje-card-controls}/card-controls.element.d.ts +0 -0
  179. /package/dist/{wje-card-header → packages/wje-card-header}/card-header.d.ts +0 -0
  180. /package/dist/{wje-card-header → packages/wje-card-header}/card-header.element.d.ts +0 -0
  181. /package/dist/{wje-card-subtitle → packages/wje-card-subtitle}/card-subtitle.d.ts +0 -0
  182. /package/dist/{wje-card-subtitle → packages/wje-card-subtitle}/card-subtitle.element.d.ts +0 -0
  183. /package/dist/{wje-card-title → packages/wje-card-title}/card-title.d.ts +0 -0
  184. /package/dist/{wje-card-title → packages/wje-card-title}/card-title.element.d.ts +0 -0
  185. /package/dist/{wje-carousel → packages/wje-carousel}/carousel.d.ts +0 -0
  186. /package/dist/{wje-carousel → packages/wje-carousel}/carousel.element.d.ts +0 -0
  187. /package/dist/{wje-carousel-item → packages/wje-carousel-item}/carousel-item.d.ts +0 -0
  188. /package/dist/{wje-carousel-item → packages/wje-carousel-item}/carousel-item.element.d.ts +0 -0
  189. /package/dist/{wje-checkbox → packages/wje-checkbox}/checkbox.d.ts +0 -0
  190. /package/dist/{wje-checkbox → packages/wje-checkbox}/checkbox.element.d.ts +0 -0
  191. /package/dist/{wje-chip → packages/wje-chip}/chip.d.ts +0 -0
  192. /package/dist/{wje-chip → packages/wje-chip}/chip.element.d.ts +0 -0
  193. /package/dist/{wje-col → packages/wje-col}/col.d.ts +0 -0
  194. /package/dist/{wje-col → packages/wje-col}/col.element.d.ts +0 -0
  195. /package/dist/{wje-color-picker → packages/wje-color-picker}/color-picker.d.ts +0 -0
  196. /package/dist/{wje-color-picker → packages/wje-color-picker}/color-picker.element.d.ts +0 -0
  197. /package/dist/{wje-container → packages/wje-container}/container.d.ts +0 -0
  198. /package/dist/{wje-container → packages/wje-container}/container.element.d.ts +0 -0
  199. /package/dist/{wje-copy-button → packages/wje-copy-button}/copy-button.d.ts +0 -0
  200. /package/dist/{wje-copy-button → packages/wje-copy-button}/copy-button.element.d.ts +0 -0
  201. /package/dist/{wje-copy-button → packages/wje-copy-button}/service/service.d.ts +0 -0
  202. /package/dist/{wje-dialog → packages/wje-dialog}/dialog.d.ts +0 -0
  203. /package/dist/{wje-divider → packages/wje-divider}/divider.d.ts +0 -0
  204. /package/dist/{wje-divider → packages/wje-divider}/divider.element.d.ts +0 -0
  205. /package/dist/{wje-dropdown → packages/wje-dropdown}/dropdown.d.ts +0 -0
  206. /package/dist/{wje-dropdown → packages/wje-dropdown}/dropdown.element.d.ts +0 -0
  207. /package/dist/{wje-element → packages/wje-element}/element.d.ts +0 -0
  208. /package/dist/{wje-file-upload → packages/wje-file-upload}/file-upload.d.ts +0 -0
  209. /package/dist/{wje-file-upload → packages/wje-file-upload}/file-upload.element.d.ts +0 -0
  210. /package/dist/{wje-file-upload → packages/wje-file-upload}/service/service.d.ts +0 -0
  211. /package/dist/{wje-file-upload-item → packages/wje-file-upload-item}/file-upload-item.d.ts +0 -0
  212. /package/dist/{wje-file-upload-item → packages/wje-file-upload-item}/file-upload-item.element.d.ts +0 -0
  213. /package/dist/{wje-footer → packages/wje-footer}/footer.d.ts +0 -0
  214. /package/dist/{wje-footer → packages/wje-footer}/footer.element.d.ts +0 -0
  215. /package/dist/{wje-form → packages/wje-form}/form.d.ts +0 -0
  216. /package/dist/{wje-form → packages/wje-form}/form.element.d.ts +0 -0
  217. /package/dist/{wje-format-digital → packages/wje-format-digital}/format-digital.d.ts +0 -0
  218. /package/dist/{wje-format-digital → packages/wje-format-digital}/format-digital.element.d.ts +0 -0
  219. /package/dist/{wje-grid → packages/wje-grid}/grid.d.ts +0 -0
  220. /package/dist/{wje-grid → packages/wje-grid}/grid.element.d.ts +0 -0
  221. /package/dist/{wje-header → packages/wje-header}/header.d.ts +0 -0
  222. /package/dist/{wje-header → packages/wje-header}/header.element.d.ts +0 -0
  223. /package/dist/{wje-icon → packages/wje-icon}/icon.d.ts +0 -0
  224. /package/dist/{wje-icon → packages/wje-icon}/icon.element.d.ts +0 -0
  225. /package/dist/{wje-icon → packages/wje-icon}/service/library.d.ts +0 -0
  226. /package/dist/{wje-icon → packages/wje-icon}/service/service.d.ts +0 -0
  227. /package/dist/{wje-icon-picker → packages/wje-icon-picker}/icon-picker.d.ts +0 -0
  228. /package/dist/{wje-icon-picker → packages/wje-icon-picker}/icon-picker.element.d.ts +0 -0
  229. /package/dist/{wje-img → packages/wje-img}/img.d.ts +0 -0
  230. /package/dist/{wje-img → packages/wje-img}/img.element.d.ts +0 -0
  231. /package/dist/{wje-img-comparer → packages/wje-img-comparer}/img-comparer.d.ts +0 -0
  232. /package/dist/{wje-img-comparer → packages/wje-img-comparer}/img-comparer.element.d.ts +0 -0
  233. /package/dist/{wje-img-comparer → packages/wje-img-comparer}/service/service.d.ts +0 -0
  234. /package/dist/{wje-infinite-scroll → packages/wje-infinite-scroll}/infinite-scroll.d.ts +0 -0
  235. /package/dist/{wje-infinite-scroll → packages/wje-infinite-scroll}/infinite-scroll.element.d.ts +0 -0
  236. /package/dist/{wje-input → packages/wje-input}/input.d.ts +0 -0
  237. /package/dist/{wje-input → packages/wje-input}/input.element.d.ts +0 -0
  238. /package/dist/{wje-input-file → packages/wje-input-file}/input-file.d.ts +0 -0
  239. /package/dist/{wje-input-file → packages/wje-input-file}/input-file.element.d.ts +0 -0
  240. /package/dist/{wje-item → packages/wje-item}/item.d.ts +0 -0
  241. /package/dist/{wje-item → packages/wje-item}/item.element.d.ts +0 -0
  242. /package/dist/{wje-kanban → packages/wje-kanban}/kanban.d.ts +0 -0
  243. /package/dist/{wje-kanban → packages/wje-kanban}/kanban.element.d.ts +0 -0
  244. /package/dist/{wje-label → packages/wje-label}/label.d.ts +0 -0
  245. /package/dist/{wje-label → packages/wje-label}/label.element.d.ts +0 -0
  246. /package/dist/{wje-level-indicator → packages/wje-level-indicator}/level-indicator.d.ts +0 -0
  247. /package/dist/{wje-level-indicator → packages/wje-level-indicator}/level-indicator.element.d.ts +0 -0
  248. /package/dist/{wje-list → packages/wje-list}/list.d.ts +0 -0
  249. /package/dist/{wje-list → packages/wje-list}/list.element.d.ts +0 -0
  250. /package/dist/{wje-main → packages/wje-main}/main.d.ts +0 -0
  251. /package/dist/{wje-main → packages/wje-main}/main.element.d.ts +0 -0
  252. /package/dist/{wje-masonry → packages/wje-masonry}/masonry.d.ts +0 -0
  253. /package/dist/{wje-masonry → packages/wje-masonry}/masonry.element.d.ts +0 -0
  254. /package/dist/{wje-masonry → packages/wje-masonry}/service/service.d.ts +0 -0
  255. /package/dist/{wje-menu → packages/wje-menu}/menu.d.ts +0 -0
  256. /package/dist/{wje-menu → packages/wje-menu}/menu.element.d.ts +0 -0
  257. /package/dist/{wje-menu-button → packages/wje-menu-button}/menu-button.d.ts +0 -0
  258. /package/dist/{wje-menu-button → packages/wje-menu-button}/menu-button.element.d.ts +0 -0
  259. /package/dist/{wje-menu-item → packages/wje-menu-item}/menu-item.d.ts +0 -0
  260. /package/dist/{wje-menu-label → packages/wje-menu-label}/menu-label.d.ts +0 -0
  261. /package/dist/{wje-menu-label → packages/wje-menu-label}/menu-label.element.d.ts +0 -0
  262. /package/dist/{wje-option → packages/wje-option}/option.d.ts +0 -0
  263. /package/dist/{wje-option → packages/wje-option}/option.element.d.ts +0 -0
  264. /package/dist/{wje-options → packages/wje-options}/options.d.ts +0 -0
  265. /package/dist/{wje-options → packages/wje-options}/options.element.d.ts +0 -0
  266. /package/dist/{wje-orgchart → packages/wje-orgchart}/orgchart.d.ts +0 -0
  267. /package/dist/{wje-orgchart → packages/wje-orgchart}/orgchart.element.d.ts +0 -0
  268. /package/dist/{wje-orgchart-group → packages/wje-orgchart-group}/orgchart-group.d.ts +0 -0
  269. /package/dist/{wje-orgchart-group → packages/wje-orgchart-group}/orgchart-group.element.d.ts +0 -0
  270. /package/dist/{wje-orgchart-item → packages/wje-orgchart-item}/orgchart-item.d.ts +0 -0
  271. /package/dist/{wje-orgchart-item → packages/wje-orgchart-item}/orgchart-item.element.d.ts +0 -0
  272. /package/dist/{wje-pagination → packages/wje-pagination}/pagination.d.ts +0 -0
  273. /package/dist/{wje-pagination → packages/wje-pagination}/pagination.element.d.ts +0 -0
  274. /package/dist/{wje-pagination → packages/wje-pagination}/service/service.d.ts +0 -0
  275. /package/dist/{wje-panel → packages/wje-panel}/panel.d.ts +0 -0
  276. /package/dist/{wje-panel → packages/wje-panel}/panel.element.d.ts +0 -0
  277. /package/dist/{wje-popup → packages/wje-popup}/popup.d.ts +0 -0
  278. /package/dist/{wje-popup → packages/wje-popup}/popup.element.d.ts +0 -0
  279. /package/dist/{wje-progress-bar → packages/wje-progress-bar}/progress-bar.d.ts +0 -0
  280. /package/dist/{wje-progress-bar → packages/wje-progress-bar}/progress-bar.element.d.ts +0 -0
  281. /package/dist/{wje-qr-code → packages/wje-qr-code}/qr-code.d.ts +0 -0
  282. /package/dist/{wje-qr-code → packages/wje-qr-code}/qr-code.element.d.ts +0 -0
  283. /package/dist/{wje-radio → packages/wje-radio}/radio.d.ts +0 -0
  284. /package/dist/{wje-radio → packages/wje-radio}/radio.element.d.ts +0 -0
  285. /package/dist/{wje-radio-group → packages/wje-radio-group}/radio-group.d.ts +0 -0
  286. /package/dist/{wje-radio-group → packages/wje-radio-group}/radio-group.element.d.ts +0 -0
  287. /package/dist/{wje-rate → packages/wje-rate}/rate.d.ts +0 -0
  288. /package/dist/{wje-rate → packages/wje-rate}/rate.element.d.ts +0 -0
  289. /package/dist/{wje-relative-time → packages/wje-relative-time}/relative-time.d.ts +0 -0
  290. /package/dist/{wje-relative-time → packages/wje-relative-time}/relative-time.element.d.ts +0 -0
  291. /package/dist/{wje-reorder → packages/wje-reorder}/reorder.d.ts +0 -0
  292. /package/dist/{wje-reorder → packages/wje-reorder}/reorder.element.d.ts +0 -0
  293. /package/dist/{wje-reorder-dropzone → packages/wje-reorder-dropzone}/reorder-dropzone.d.ts +0 -0
  294. /package/dist/{wje-reorder-dropzone → packages/wje-reorder-dropzone}/reorder-dropzone.element.d.ts +0 -0
  295. /package/dist/{wje-reorder-handle → packages/wje-reorder-handle}/reorder-handle.d.ts +0 -0
  296. /package/dist/{wje-reorder-handle → packages/wje-reorder-handle}/reorder-handle.element.d.ts +0 -0
  297. /package/dist/{wje-reorder-item → packages/wje-reorder-item}/reorder-item.d.ts +0 -0
  298. /package/dist/{wje-reorder-item → packages/wje-reorder-item}/reorder-item.element.d.ts +0 -0
  299. /package/dist/{wje-route → packages/wje-route}/route.d.ts +0 -0
  300. /package/dist/{wje-route → packages/wje-route}/route.element.d.ts +0 -0
  301. /package/dist/{wje-router → packages/wje-router}/router.d.ts +0 -0
  302. /package/dist/{wje-router → packages/wje-router}/router.element.d.ts +0 -0
  303. /package/dist/{wje-router-link → packages/wje-router-link}/router-link.d.ts +0 -0
  304. /package/dist/{wje-router-outlet → packages/wje-router-outlet}/router-outlet.d.ts +0 -0
  305. /package/dist/{wje-router-outlet → packages/wje-router-outlet}/router-outlet.element.d.ts +0 -0
  306. /package/dist/{wje-row → packages/wje-row}/row.d.ts +0 -0
  307. /package/dist/{wje-row → packages/wje-row}/row.element.d.ts +0 -0
  308. /package/dist/{wje-select → packages/wje-select}/select.d.ts +0 -0
  309. /package/dist/{wje-select → packages/wje-select}/select.element.d.ts +0 -0
  310. /package/dist/{wje-slider → packages/wje-slider}/slider.d.ts +0 -0
  311. /package/dist/{wje-slider → packages/wje-slider}/slider.element.d.ts +0 -0
  312. /package/dist/{wje-sliding-container → packages/wje-sliding-container}/sliding-container.d.ts +0 -0
  313. /package/dist/{wje-sliding-container → packages/wje-sliding-container}/sliding-container.element.d.ts +0 -0
  314. /package/dist/{wje-split-view → packages/wje-split-view}/service/service.d.ts +0 -0
  315. /package/dist/{wje-split-view → packages/wje-split-view}/split-view.d.ts +0 -0
  316. /package/dist/{wje-split-view → packages/wje-split-view}/split-view.element.d.ts +0 -0
  317. /package/dist/{wje-status → packages/wje-status}/status.d.ts +0 -0
  318. /package/dist/{wje-status → packages/wje-status}/status.element.d.ts +0 -0
  319. /package/dist/{wje-step → packages/wje-step}/step.d.ts +0 -0
  320. /package/dist/{wje-step → packages/wje-step}/step.element.d.ts +0 -0
  321. /package/dist/{wje-stepper → packages/wje-stepper}/stepper.d.ts +0 -0
  322. /package/dist/{wje-stepper → packages/wje-stepper}/stepper.element.d.ts +0 -0
  323. /package/dist/{wje-store → packages/wje-store}/default-store-actions.d.ts +0 -0
  324. /package/dist/{wje-store → packages/wje-store}/pubsub.d.ts +0 -0
  325. /package/dist/{wje-store → packages/wje-store}/store.d.ts +0 -0
  326. /package/dist/{wje-tab → packages/wje-tab}/tab.d.ts +0 -0
  327. /package/dist/{wje-tab-group → packages/wje-tab-group}/tab-group.d.ts +0 -0
  328. /package/dist/{wje-tab-group → packages/wje-tab-group}/tab-group.element.d.ts +0 -0
  329. /package/dist/{wje-tab-panel → packages/wje-tab-panel}/tab-panel.d.ts +0 -0
  330. /package/dist/{wje-tab-panel → packages/wje-tab-panel}/tab-panel.element.d.ts +0 -0
  331. /package/dist/{wje-textarea → packages/wje-textarea}/textarea.d.ts +0 -0
  332. /package/dist/{wje-textarea → packages/wje-textarea}/textarea.element.d.ts +0 -0
  333. /package/dist/{wje-thumbnail → packages/wje-thumbnail}/thumbnail.d.ts +0 -0
  334. /package/dist/{wje-thumbnail → packages/wje-thumbnail}/thumbnail.element.d.ts +0 -0
  335. /package/dist/{wje-timeline → packages/wje-timeline}/timeline.d.ts +0 -0
  336. /package/dist/{wje-timeline → packages/wje-timeline}/timeline.element.d.ts +0 -0
  337. /package/dist/{wje-timeline-item → packages/wje-timeline-item}/timeline-item.d.ts +0 -0
  338. /package/dist/{wje-timeline-item → packages/wje-timeline-item}/timeline-item.element.d.ts +0 -0
  339. /package/dist/{wje-toast → packages/wje-toast}/toast.d.ts +0 -0
  340. /package/dist/{wje-toast → packages/wje-toast}/toast.element.d.ts +0 -0
  341. /package/dist/{wje-toggle → packages/wje-toggle}/toggle.d.ts +0 -0
  342. /package/dist/{wje-toggle → packages/wje-toggle}/toggle.element.d.ts +0 -0
  343. /package/dist/{wje-toolbar → packages/wje-toolbar}/toolbar.d.ts +0 -0
  344. /package/dist/{wje-toolbar → packages/wje-toolbar}/toolbar.element.d.ts +0 -0
  345. /package/dist/{wje-toolbar-action → packages/wje-toolbar-action}/toolbar-action.d.ts +0 -0
  346. /package/dist/{wje-toolbar-action → packages/wje-toolbar-action}/toolbar-action.element.d.ts +0 -0
  347. /package/dist/{wje-tooltip → packages/wje-tooltip}/tooltip.d.ts +0 -0
  348. /package/dist/{wje-tooltip → packages/wje-tooltip}/tooltip.element.d.ts +0 -0
  349. /package/dist/{wje-tree → packages/wje-tree}/tree.d.ts +0 -0
  350. /package/dist/{wje-tree → packages/wje-tree}/tree.element.d.ts +0 -0
  351. /package/dist/{wje-tree-item → packages/wje-tree-item}/tree-item.d.ts +0 -0
  352. /package/dist/{wje-visually-hidden → packages/wje-visually-hidden}/visually-hidden.d.ts +0 -0
  353. /package/dist/{wje-visually-hidden → packages/wje-visually-hidden}/visually-hidden.element.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"wje-option.js","sources":["../packages/wje-option/option.element.js","../packages/wje-option/option.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport Icon from '../wje-icon/icon.js';\nimport Checkbox from '../wje-checkbox/checkbox.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Option` is a custom web component that represents an option.\n * @summary This element represents an option.\n * @documentation https://elements.webjet.sk/components/option\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native part of the option.\n * @slot start - The slot for the start of the option.\n * @slot - The default slot for the option.\n * @slot end - The slot for the end of the option.\n * // @fires wje-option:change - Event fired when the option is clicked.\n * @tag wje-option\n */\nexport default class Option extends WJElement {\n\t/**\n\t * Creates an instance of Option.\n\t * @class\n\t */\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\t/**\n\t * Dependencies of the Option component.\n\t */\n\tdependencies = {\n\t\t'wje-icon': Icon,\n\t\t'wje-checkbox': Checkbox,\n\t};\n\n\t/**\n\t * Sets the selected attribute of the option.\n\t * @param {boolean} value The value to set.\n\t */\n\tset selected(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('selected', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('selected');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the 'selected' attribute status of the element.\n\t * @returns {boolean} Returns true if the 'selected' attribute is set on the element; otherwise, false.\n\t */\n\tget selected() {\n\t\treturn this.hasAttribute('selected');\n\t}\n\n\t/**\n\t * Retrieves the value indicating whether the closest 'wje-select' element has a 'checkbox' attribute.\n\t * @returns {boolean} True if the closest 'wje-select' element has a 'checkbox' attribute; otherwise, false.\n\t */\n\tget checkbox() {\n\t\treturn this.closest('wje-select')?.hasAttribute('checkbox');\n\t}\n\n\t/**\n\t * Determines whether the closest 'wje-select' element has the 'multiple' attribute.\n\t * @returns {boolean} Returns true if the 'wje-select' element has the 'multiple' attribute, otherwise false.\n\t */\n\tget multiple() {\n\t\treturn this.closest('wje-select')?.hasAttribute('multiple') || false;\n\t}\n\n\t/**\n\t * Sets the value attribute of the option.\n\t * @param {string} value The value to set.\n\t */\n\tset value(value) {\n\t\tthis.setAttribute('value', value);\n\t}\n\n\tget value() {\n\t\treturn this.getAttribute('value');\n\t}\n\n\t/**\n\t * Sets the text content of the option.\n\t * @param {string} value The text to set.\n\t */\n\tset text(value) {\n\t\tthis.innerText = value;\n\t}\n\n\tclassName = 'Option';\n\n\t/**\n\t * Returns the CSS styles for the component.\n\t * @static\n\t * @returns {CSSStyleSheet}\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\t/**\n\t * Returns the list of attributes to observe for changes.\n\t * @static\n\t * @returns {Array<string>}\n\t */\n\tstatic get observedAttributes() {\n\t\treturn ['selected'];\n\t}\n\n\t/**\n\t * This method is called whenever an observed attribute is added, removed, or changed.\n\t * @param {string} name The name of the attribute that was changed.\n\t * @param {*} old The previous value of the attribute before the change.\n\t * @param {*} newName The new value of the attribute after the change.\n\t * @returns {void} This method does not return a value.\n\t */\n\tattributeChangedCallback(name, old, newName) {\n\t\tif (this.checkbox) {\n\t\t\tif (name === 'selected' && newName !== null) {\n\t\t\t\tthis.#setCheckbox(true);\n\t\t\t} else {\n\t\t\t\tthis.#setCheckbox(false);\n\t\t\t}\n\t\t}\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Draws the component for the option.\n\t * @returns {DocumentFragment}\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tlet native = document.createElement('div');\n\t\tnative.classList.add('native-option');\n\t\tnative.setAttribute('part', 'native');\n\n\t\tlet icon = document.createElement('wje-icon');\n\t\ticon.setAttribute('name', 'check');\n\t\ticon.setAttribute('slot', 'check');\n\n\t\tlet checkboxEl = document.createElement('wje-checkbox');\n\t\tcheckboxEl.setAttribute('slot', 'check');\n\n\t\tlet check = document.createElement('slot');\n\t\tcheck.setAttribute('name', 'check');\n\t\tcheck.setAttribute('part', 'check');\n\n\t\tlet start = document.createElement('slot');\n\t\tstart.setAttribute('name', 'start');\n\n\t\tlet slot = document.createElement('slot');\n\n\t\tlet endWrapper = document.createElement('span');\n\t\tendWrapper.classList.add('end-slot');\n\n\t\tlet end = document.createElement('slot');\n\t\tend.setAttribute('name', 'end');\n\n\t\tendWrapper.append(end);\n\n\t\tconst hasCheckSlot = this.querySelector('[slot=\"check\"]') !== null;\n\n\t\tif (!hasCheckSlot) {\n\t\t\tif (this.checkbox && this.multiple) {\n\t\t\t\tthis.append(checkboxEl);\n\t\t\t} else {\n\t\t\t\tthis.append(icon);\n\t\t\t}\n\t\t}\n\n\t\tnative.append(check);\n\t\tnative.append(start);\n\t\tnative.append(slot);\n\t\tnative.append(endWrapper);\n\n\t\tfragment.append(native);\n\n\t\tthis.check = check;\n\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Method executed after the drawing process is completed.\n\t * Sets up an event listener for 'click' events, linking them to the specified callback function.\n\t * @returns {void} Does not return a value.\n\t */\n\tafterDraw() {\n\t\tevent.addListener(this, 'click', null, this.optionClickCallback);\n\n\t\t// If `selected` was set before render, attributeChangedCallback may have run\n\t\t// before `this.check` existed. Sync the checkbox state once slots exist.\n\t\tif (this.checkbox && this.multiple) {\n\t\t\tthis.#setCheckbox(this.selected);\n\t\t}\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Syncs ARIA attributes on the host element.\n\t */\n\tsyncAria() {\n\t\tthis.setAriaState({\n\t\t\trole: 'option',\n\t\t\tselected: this.selected,\n\t\t\tdisabled: this.hasAttribute('disabled'),\n\t\t});\n\t}\n\n\t/**\n\t * Handles operations or cleanup tasks that need to occur before disconnecting.\n\t * Removes an event listener associated with the 'click' event and a specified callback function.\n\t * @returns {void} This method does not return a value.\n\t */\n\tbeforeDisconnect() {\n\t\tevent.removeListener(this, 'click', null, this.optionClickCallback);\n\t}\n\n\t/**\n\t * Handles the click event on an option element and dispatches a custom event when triggered.\n\t * @param {Event} e The click event object that triggered the callback.\n\t * @returns {void} No return value.\n\t */\n\toptionClickCallback(e) {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\te.stopImmediatePropagation();\n\n\t\tif (this.hasAttribute('disabled')) return;\n\n\t\tevent.dispatchCustomEvent(this, 'wje-option:change', {\n\t\t\tvalue: this.value,\n\t\t\ttext: this.textContent,\n\t\t\toption: this,\n\t\t});\n\t}\n\n\t/**\n\t * Checks if the given DOM node represents a checkbox element.\n\t * @param {Node} node The DOM node to be checked.\n\t * @returns {boolean} Returns true if the node is an element with a class name of 'Checkbox', otherwise false.\n\t */\n\t#isCheckbox(node) {\n\t\treturn node instanceof Element && node.className === 'Checkbox';\n\t}\n\n\t/**\n\t * Updates the checked status of the first checkbox element found within the assigned elements of the specified container.\n\t * @param {boolean} checked The desired checked state to be applied to the checkbox.\n\t * @returns {void}\n\t */\n\t#setCheckbox(checked) {\n\t\tconst assigned = this.check?.assignedElements({ flatten: true }) ?? [];\n\t\tconst arr = assigned.filter((item) => this.#isCheckbox(item));\n\t\tif (arr.length > 0) arr[0].checked = checked;\n\t}\n}\n","import Option from './option.element.js';\n\nexport default Option;\n\nOption.define('wje-option', Option);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBe,MAAM,eAAe,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK7C,cAAc;AACb,UAAO;AANM;AAYd;AAAA;AAAA;AAAA,wCAAe;AAAA,MACd,YAAY;AAAA,MACZ,gBAAgB;AAAA,IAChB;AA0DD,qCAAY;AAAA,EAlEb;AAAA;AAAA;AAAA;AAAA;AAAA,EAcC,IAAI,SAAS,OAAO;AACnB,QAAI,OAAO;AACV,WAAK,aAAa,YAAY,EAAE;AAAA,IACnC,OAAS;AACN,WAAK,gBAAgB,UAAU;AAAA,IAClC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMC,IAAI,WAAW;AACd,WAAO,KAAK,aAAa,UAAU;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMC,IAAI,WAAW;;AACd,YAAO,UAAK,QAAQ,YAAY,MAAzB,mBAA4B,aAAa;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMC,IAAI,WAAW;;AACd,aAAO,UAAK,QAAQ,YAAY,MAAzB,mBAA4B,aAAa,gBAAe;AAAA,EACjE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMC,IAAI,MAAM,OAAO;AAChB,SAAK,aAAa,SAAS,KAAK;AAAA,EAClC;AAAA,EAEC,IAAI,QAAQ;AACX,WAAO,KAAK,aAAa,OAAO;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMC,IAAI,KAAK,OAAO;AACf,SAAK,YAAY;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA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;AAAA;AAAA;AAOC,iBAAY,SAAC,SAAS;;AACrB,QAAM,aAAW,UAAK,UAAL,mBAAY,iBAAiB,EAAE,SAAS,KAAM,OAAK,CAAE;AACtE,QAAM,MAAM,SAAS,OAAO,CAAC,SAAS,sBAAK,kCAAL,WAAiB,KAAK;AAC5D,MAAI,IAAI,SAAS,EAAG,KAAI,CAAC,EAAE,UAAU;AACvC;ACvQA,OAAO,OAAO,cAAc,MAAM;"}
1
+ {"version":3,"file":"wje-option.js","sources":["../packages/wje-option/option.element.js","../packages/wje-option/option.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport Icon from '../wje-icon/icon.js';\nimport Checkbox from '../wje-checkbox/checkbox.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Option` is a custom web component that represents an option.\n * @summary This element represents an option.\n * @documentation https://elements.webjet.sk/components/option\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native part of the option.\n * @slot start - The slot for the start of the option.\n * @slot - The default slot for the option.\n * @slot end - The slot for the end of the option.\n * // @fires wje-option:change - Event fired when the option is clicked.\n * @tag wje-option\n */\nexport default class Option extends WJElement {\n\t/**\n\t * Creates an instance of Option.\n\t * @class\n\t */\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\t/**\n\t * Dependencies of the Option component.\n\t */\n\tdependencies = {\n\t\t'wje-icon': Icon,\n\t\t'wje-checkbox': Checkbox,\n\t};\n\n\t/**\n\t * Sets the selected attribute of the option.\n\t * @param {boolean} value The value to set.\n\t */\n\tset selected(value) {\n\t\tif (value) {\n\t\t\tthis.setAttribute('selected', '');\n\t\t} else {\n\t\t\tthis.removeAttribute('selected');\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the 'selected' attribute status of the element.\n\t * @returns {boolean} Returns true if the 'selected' attribute is set on the element; otherwise, false.\n\t */\n\tget selected() {\n\t\treturn this.hasAttribute('selected');\n\t}\n\n\t/**\n\t * Retrieves the value indicating whether the closest 'wje-select' element has a 'checkbox' attribute.\n\t * @returns {boolean} True if the closest 'wje-select' element has a 'checkbox' attribute; otherwise, false.\n\t */\n\tget checkbox() {\n\t\treturn this.closest('wje-select')?.hasAttribute('checkbox');\n\t}\n\n\t/**\n\t * Determines whether the closest 'wje-select' element has the 'multiple' attribute.\n\t * @returns {boolean} Returns true if the 'wje-select' element has the 'multiple' attribute, otherwise false.\n\t */\n\tget multiple() {\n\t\treturn this.closest('wje-select')?.hasAttribute('multiple') || false;\n\t}\n\n\t/**\n\t * Sets the value attribute of the option.\n\t * @param {string} value The value to set.\n\t */\n\tset value(value) {\n\t\tthis.setAttribute('value', value);\n\t}\n\n\tget value() {\n\t\treturn this.getAttribute('value');\n\t}\n\n\t/**\n\t * Sets the text content of the option.\n\t * @param {string} value The text to set.\n\t */\n\tset text(value) {\n\t\tthis.innerText = value;\n\t}\n\n\tclassName = 'Option';\n\n\t/**\n\t * Returns the CSS styles for the component.\n\t * @static\n\t * @returns {CSSStyleSheet}\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\t/**\n\t * Returns the list of attributes to observe for changes.\n\t * @static\n\t * @returns {Array<string>}\n\t */\n\tstatic get observedAttributes() {\n\t\treturn ['selected'];\n\t}\n\n\t/**\n\t * This method is called whenever an observed attribute is added, removed, or changed.\n\t * @param {string} name The name of the attribute that was changed.\n\t * @param {*} old The previous value of the attribute before the change.\n\t * @param {*} newName The new value of the attribute after the change.\n\t * @returns {void} This method does not return a value.\n\t */\n\tattributeChangedCallback(name, old, newName) {\n\t\tif (this.checkbox) {\n\t\t\tif (name === 'selected' && newName !== null) {\n\t\t\t\tthis.#setCheckbox(true);\n\t\t\t} else {\n\t\t\t\tthis.#setCheckbox(false);\n\t\t\t}\n\t\t}\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Draws the component for the option.\n\t * @returns {DocumentFragment}\n\t */\n\tdraw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tlet native = document.createElement('div');\n\t\tnative.classList.add('native-option');\n\t\tnative.setAttribute('part', 'native');\n\n\t\tlet icon = document.createElement('wje-icon');\n\t\ticon.setAttribute('name', 'check');\n\t\ticon.setAttribute('slot', 'check');\n\n\t\tlet checkboxEl = document.createElement('wje-checkbox');\n\t\tcheckboxEl.setAttribute('slot', 'check');\n\n\t\tlet check = document.createElement('slot');\n\t\tcheck.setAttribute('name', 'check');\n\t\tcheck.setAttribute('part', 'check');\n\n\t\tlet start = document.createElement('slot');\n\t\tstart.setAttribute('name', 'start');\n\n\t\tlet slot = document.createElement('slot');\n\n\t\tlet endWrapper = document.createElement('span');\n\t\tendWrapper.classList.add('end-slot');\n\n\t\tlet end = document.createElement('slot');\n\t\tend.setAttribute('name', 'end');\n\n\t\tendWrapper.append(end);\n\n\t\tconst hasCheckSlot = this.querySelector('[slot=\"check\"]') !== null;\n\n\t\tif (!hasCheckSlot) {\n\t\t\tif (this.checkbox && this.multiple) {\n\t\t\t\tthis.append(checkboxEl);\n\t\t\t} else {\n\t\t\t\tthis.append(icon);\n\t\t\t}\n\t\t}\n\n\t\tnative.append(check);\n\t\tnative.append(start);\n\t\tnative.append(slot);\n\t\tnative.append(endWrapper);\n\n\t\tfragment.append(native);\n\n\t\tthis.check = check;\n\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Method executed after the drawing process is completed.\n\t * Sets up an event listener for 'click' events, linking them to the specified callback function.\n\t * @returns {void} Does not return a value.\n\t */\n\tafterDraw() {\n\t\tevent.addListener(this, 'click', null, this.optionClickCallback);\n\n\t\t// If `selected` was set before render, attributeChangedCallback may have run\n\t\t// before `this.check` existed. Sync the checkbox state once slots exist.\n\t\tif (this.checkbox && this.multiple) {\n\t\t\tthis.#setCheckbox(this.selected);\n\t\t}\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Syncs ARIA attributes on the host element.\n\t */\n\tsyncAria() {\n\t\tthis.setAriaState({\n\t\t\trole: 'option',\n\t\t\tselected: this.selected,\n\t\t\tdisabled: this.hasAttribute('disabled'),\n\t\t});\n\t}\n\n\t/**\n\t * Handles operations or cleanup tasks that need to occur before disconnecting.\n\t * Removes an event listener associated with the 'click' event and a specified callback function.\n\t * @returns {void} This method does not return a value.\n\t */\n\tbeforeDisconnect() {\n\t\tevent.removeListener(this, 'click', null, this.optionClickCallback);\n\t}\n\n\t/**\n\t * Handles the click event on an option element and dispatches a custom event when triggered.\n\t * @param {Event} e The click event object that triggered the callback.\n\t * @returns {void} No return value.\n\t */\n\toptionClickCallback(e) {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\te.stopImmediatePropagation();\n\n\t\tif (this.hasAttribute('disabled')) return;\n\n\t\tevent.dispatchCustomEvent(this, 'wje-option:change', {\n\t\t\tvalue: this.value,\n\t\t\ttext: this.textContent,\n\t\t\toption: this,\n\t\t});\n\t}\n\n\t/**\n\t * Checks if the given DOM node represents a checkbox element.\n\t * @param {Node} node The DOM node to be checked.\n\t * @returns {boolean} Returns true if the node is an element with a class name of 'Checkbox', otherwise false.\n\t */\n\t#isCheckbox(node) {\n\t\treturn node instanceof Element && node.className === 'Checkbox';\n\t}\n\n\t/**\n\t * Updates the checked status of the first checkbox element found within the assigned elements of the specified container.\n\t * @param {boolean} checked The desired checked state to be applied to the checkbox.\n\t * @returns {void}\n\t */\n\t#setCheckbox(checked) {\n\t\tconst assigned = this.check?.assignedElements({ flatten: true }) ?? [];\n\t\tconst arr = assigned.filter((item) => this.#isCheckbox(item));\n\t\tif (arr.length > 0) arr[0].checked = checked;\n\t}\n}\n","import Option from './option.element.js';\n\nexport default Option;\n\nOption.define('wje-option', Option);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBe,MAAM,eAAe,UAAU;AAAA;AAA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je-options.js","sources":["../packages/wje-options/options.element.js","../packages/wje-options/options.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport InfiniteScroll from '../wje-infinite-scroll/infinite-scroll.js';\nimport List from '../wje-list/list.js';\nimport Option from '../wje-option/option.js';\n\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Options` is a custom web component that represents a set of options. It extends from `WJElement`.\n * @summary This element represents a set of options.\n * @documentation https://elements.webjet.sk/components/options\n * @status stable\n * @tag wje-options\n */\n\nexport default class Options extends WJElement {\n\n\t#loadedOptions = [];\n\n\t#drawPreloadedElements = [];\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tdependencies = {\n\t\t'wje-option': Option,\n\t\t'wje-infinite-scroll': InfiniteScroll,\n\t\t'wje-list': List,\n\t}\n\n\t/**\n\t * Sets the option array path attribute.\n\t * @param {string} value The value to set for the option array path.\n\t */\n\tset optionArrayPath(value) {\n\t\tthis.setAttribute('option-array-path', value);\n\t}\n\n\t/**\n\t * Gets the option array path attribute.\n\t * @returns {string} The value of the option array path attribute or \"data\" if not set.\n\t */\n\tget optionArrayPath() {\n\t\treturn this.getAttribute('option-array-path');\n\t}\n\n\t/**\n\t * Checks if the option array path attribute is present.\n\t * @returns {boolean} True if the option array path attribute is present, false otherwise.\n\t */\n\tget hasOptionArrayPath() {\n\t\treturn this.hasAttribute('option-array-path');\n\t}\n\n\t/**\n\t * Gets the dropdown height attribute.\n\t * @returns {string} The value of the dropdown height attribute or \"100%\" if not set.\n\t */\n\tget dropdownHeight() {\n\t\treturn this.getAttribute('dropdown-height') || '100%';\n\t}\n\n\t/**\n\t * Sets the dropdown height attribute.\n\t * @param {string} value The value to set for the dropdown height.\n\t */\n\tset dropdownHeight(value) {\n\t\tthis.setAttribute('dropdown-height', value);\n\t}\n\n\t/**\n\t * Sets the item value attribute.\n\t * @param {string} value The value to set for the item value.\n\t */\n\tset itemValue(value) {\n\t\tthis.setAttribute('item-value', value);\n\t}\n\n\t/**\n\t * Gets the item value attribute.\n\t * @returns {string} The value of the item value attribute or \"value\" if not set.\n\t */\n\tget itemValue() {\n\t\treturn this.getAttribute('item-value') || 'value';\n\t}\n\n\t/**\n\t * Sets the item text attribute.\n\t * @param {string} value The value to set for the item text.\n\t */\n\tset itemText(value) {\n\t\tthis.setAttribute('item-text', value);\n\t}\n\n\t/**\n\t * Gets the item text attribute.\n\t * @returns {string} The value of the item text attribute or \"text\" if not set.\n\t */\n\tget itemText() {\n\t\treturn this.getAttribute('item-text') || 'text';\n\t}\n\n\t/**\n\t * Gets the lazy load size attribute.\n\t * @returns {number} The value of the lazy load size attribute or 10 if not set.\n\t */\n\tget lazyLoadSize() {\n\t\treturn this.getAttribute('lazy-load-size') || 10;\n\t}\n\n\t/**\n\t * Sets the lazy load size attribute.\n\t * @param {number} value The value to set for the lazy load size.\n\t */\n\tset lazyLoadSize(value) {\n\t\tthis.setAttribute('lazy-load-size', value);\n\t}\n\n\t/**\n\t * Sets the search attribute.\n\t * @param {string} value The value to set for the search.\n\t */\n\tset search(value) {\n\t\tthis.setAttribute('search', value);\n\t}\n\n\t/**\n\t * Gets the search attribute.\n\t * @returns {string} The value of the search attribute.\n\t */\n\tget search() {\n\t\treturn this.getAttribute('search');\n\t}\n\n\t/**\n\t * Checks if the search attribute is present.\n\t * @returns {boolean} True if the search attribute is present, false otherwise.\n\t */\n\tget hasSearch() {\n\t\treturn this.hasAttribute('search');\n\t}\n\n\t/**\n\t * Retrieves the value of the 'search-to-query-params' attribute from the current instance.\n\t * @returns {string | null} The value of the 'search-to-query-params' attribute, or null if the attribute is not set.\n\t */\n\tget searchToQueryParams() {\n\t\treturn this.getAttribute('search-to-query-params');\n\t}\n\n\t/**\n\t * Sets the value to define search-to-query params behavior.\n\t * @param {string} value The value to be set for the search-to-query-params attribute.\n\t */\n\tset searchToQueryParams(value) {\n\t\tthis.setAttribute('search-to-query-params', value);\n\t}\n\n\t/**\n\t * Determines whether the 'search-to-query-params' attribute is present on the element.\n\t * @returns {boolean} True if the 'search-to-query-params' attribute exists, otherwise false.\n\t */\n\tget hasSearchToQueryParams() {\n\t\treturn this.hasAttribute('search-to-query-params');\n\t}\n\n\t/**\n\t * Sets the value of the search parameter name attribute.\n\t * @param {string} value The string value to set as the search parameter name.\n\t */\n\tset searchParamName(value) {\n\t\tthis.setAttribute('search-param-name', value);\n\t}\n\n\t/**\n\t * Gets the search parameter name used in queries.\n\t * Retrieves the value of the 'search-param-name' attribute.\n\t * If the attribute is not set, it defaults to 'search'.\n\t * @returns {string} The search parameter name used for queries.\n\t */\n\tget searchParamName() {\n\t\treturn this.getAttribute('search-param-name') || 'search';\n\t}\n\n\t/**\n\t * Sets the queryParams attribute on the element.\n\t * @param {string} value The query parameters to set, represented as a string.\n\t */\n\tset queryParams(value) {\n\t\tthis.setAttribute('query-params', value);\n\t}\n\n\t/**\n\t * Retrieves the value of the 'query-params' attribute.\n\t * @returns {string | null} The value of the 'query-params' attribute, or null if the attribute is not set.\n\t */\n\tget queryParams() {\n\t\treturn this.getAttribute('query-params');\n\t}\n\n\t/**\n\t * Sets the lazy attribute.\n\t * @param {boolean} value The value to set for the lazy attribute.\n\t */\n\tset lazy(value) {\n\t\tthis.setAttribute('lazy', value);\n\t}\n\n\t/**\n\t * Checks if the lazy attribute is present.\n\t * @returns {boolean} True if the lazy attribute is present, false otherwise.\n\t */\n\tget lazy() {\n\t\treturn this.hasAttribute('lazy');\n\t}\n\n\t/**\n\t * Gets the loaded options.\n\t * @returns {Array} The loaded options.\n\t */\n\tget options() {\n\t\treturn this.loadedOptions?.flat();\n\t}\n\n\t/**\n\t * Gets the loaded options.\n\t * @type {Array}\n\t */\n\tget loadedOptions() {\n\t\treturn this.#loadedOptions;\n\t}\n\n\t/**\n\t * Sets the loaded options.\n\t * @type {Array}\n\t */\n\tset loadedOptions(loadedOptions) {\n\t\tthis.#loadedOptions = loadedOptions;\n\t}\n\n\t/**\n\t * Array of preloaded elements.\n\t * @type {Array}\n\t * @private\n\t */\n\tget drawPreloadedElements() {\n\t\treturn this.#drawPreloadedElements;\n\t}\n\n\t/**\n\t * Sets the elements that are preloaded and ready to be drawn.\n\t * @param {Array|object} elements The elements to be set for preloading. This can be an array or a specific object containing drawable elements.\n\t */\n\tset drawPreloadedElements(elements) {\n\t\tthis.#drawPreloadedElements = elements;\n\t}\n\n\tclassName = 'Options';\n\n\t/**\n\t * Returns the CSS styles for the component.\n\t * @static\n\t * @returns {CSSStyleSheet} The CSS styles for the component.\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\t/**\n\t * Retrieves an array of attributes that should be observed for changes.\n\t * The method returns a list of attribute names that the browser will monitor for changes.\n\t * @returns {Array<string>} An array of attribute names to observe.\n\t */\n\tstatic get observedAttributes() {\n\t\treturn ['search', 'attached'];\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Draws the component.\n\t * @returns {DocumentFragment}\n\t */\n\tasync draw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tconst slot = document.createElement('slot');\n\t\tfragment.appendChild(slot);\n\t\tthis.syncAria();\n\n\t\tif (this.lazy) {\n\t\t\tif (this.contains(this.infiniteScroll)) {\n\t\t\t\tthis.drawPreloadedElements.forEach((el) => { el.remove() });\n\t\t\t\tthis.loadedOptions = [];\n\t\t\t\tthis.infiniteScroll.placementObj.innerHTML = '';\n\t\t\t\tthis.infiniteScroll.totalPages = 0;\n\t\t\t\tthis.infiniteScroll.refresh();\n\t\t\t}\n\n\t\t\tlet loader = document.createElement('div');\n\t\t\tloader.setAttribute('slot', 'loader');\n\t\t\tloader.append('Loading...');\n\t\t\tloader.classList.add('loader');\n\n\t\t\tconst infiniteScroll = document.createElement('wje-infinite-scroll');\n\t\t\tinfiniteScroll.setAttribute('placement', 'wje-list');\n\t\t\tinfiniteScroll.setAttribute('height', this.dropdownHeight);\n\t\t\tinfiniteScroll.setAttribute('object-name', this.optionArrayPath);\n\t\t\tinfiniteScroll.dataToHtml = this.htmlItem;\n\t\t\tinfiniteScroll.setCustomData = async (page, signal) => {\n\t\t\t\tlet processedUrl = `${this.url}${this.search ? `/${this.search}` : ''}?page=${page}&size=${this.lazyLoadSize}${this.queryParams ? `&${this.queryParams}` : ''}`;\n\n\t\t\t\tif (this.hasSearchToQueryParams) {\n\t\t\t\t\tprocessedUrl = `${this.url}?page=${page}&size=${this.lazyLoadSize}${this.queryParams ? `&${this.queryParams}` : ''}${this.search ? `&${this.searchParamName}=${this.search}` : ''}`;\n\t\t\t\t}\n\n\t\t\t\tlet res = await this.service.get(processedUrl, null, false, signal);\n\t\t\t\tconst filteredOptions = this.filterOutDrawnOptions(res);\n\t\t\t\tthis.loadedOptions.push(...this.processData(filteredOptions));\n\n\t\t\t\treturn filteredOptions;\n\t\t\t};\n\n\t\t\tconst list = document.createElement('wje-list');\n\n\t\t\tinfiniteScroll.append(list);\n\t\t\tinfiniteScroll.append(loader);\n\n\t\t\tif (this.hasAttribute('attached') && !this.hasSearch) {\n\t\t\t\tthis.appendChild(infiniteScroll);\n\t\t\t\tthis.drawPreloadedElements.forEach((el) => {\n\t\t\t\t\tlist.appendChild(el);\n\t\t\t\t});\n\t\t\t\tthis.infiniteScroll = infiniteScroll;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.response = await this.getPages();\n\n\t\t\tlet optionsData = this.filterOutDrawnOptions(this.response);\n\t\t\toptionsData = this.processData(optionsData);\n\n\t\t\tthis.loadedOptions.push(...optionsData);\n\n\t\t\tthis.append(...optionsData.map(this.htmlItem));\n\n\t\t\tevent.dispatchCustomEvent(this, 'wje-options:load', {});\n\t\t}\n\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Syncs ARIA attributes on the host element.\n\t */\n\tsyncAria() {\n\t\tconst isMultiple = this.closest('wje-select')?.hasAttribute('multiple');\n\t\tthis.setAriaState({\n\t\t\trole: 'listbox',\n\t\t\tmultiselectable: isMultiple ? 'true' : undefined,\n\t\t});\n\t}\n\n\tafterDraw() {\n\t\tevent.addListener(this.infiniteScroll, 'wje-infinite-scroll:load', null, this.dispatchOptionsLoadEvent);\n\t}\n\n\tdispatchOptionsLoadEvent = (e) => {\n\t\t// Wait for next paint cycle to ensure options are in DOM\n\t\trequestAnimationFrame(() => {\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tevent.dispatchCustomEvent(this, 'wje-options:load', {});\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Processes the provided data based on the optional array path set in the instance.\n\t * @param {object} data The input data to be processed.\n\t * @returns {Array} The resolved options array from the data or an empty array if no match is found.\n\t */\n\tprocessData(data) {\n\t\tconst splittedOptionArrayPath = this.optionArrayPath ? this.optionArrayPath?.split('.') : null;\n\t\tlet options = data;\n\n\t\tsplittedOptionArrayPath?.forEach((path) => {\n\t\t\toptions = options[path];\n\t\t});\n\n\t\treturn options ?? [];\n\t}\n\n\t/**\n\t * Filters out options from the response object that have already been drawn, based on the specified option array path.\n\t * @param {object} response The response object containing data to process.\n\t * @returns {object} The filtered response object with drawn options removed.\n\t */\n\tfilterOutDrawnOptions(response) {\n\t\tconst splittedOptionArrayPath = this.optionArrayPath ? this.optionArrayPath?.split('.') : [];\n\t\tlet filteredResponse = structuredClone(response);\n\n\t\tfilteredResponse = this.recursiveUpdate(filteredResponse, splittedOptionArrayPath);\n\t\treturn filteredResponse;\n\t}\n\n\t/**\n\t * Recursively updates the object based on the provided path to the property.\n\t * @param {object | Array | null} object\n\t * @param {Array<string> | null} pathToProperty\n\t * @returns {object | Array | null}\n\t */\n\trecursiveUpdate = (object, pathToProperty) => {\n\t\tif (pathToProperty.length === 0) {\n\t\t\tif (Array.isArray(object)) {\n\t\t\t\treturn object.filter(\n\t\t\t\t\t(option) =>\n\t\t\t\t\t\t!this.loadedOptions.some(\n\t\t\t\t\t\t\t(loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconsole.error('Expected an array but got:', object, pathToProperty);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t}\n\n\t\tconst [currentPath, ...remainingPath] = pathToProperty;\n\t\tif (remainingPath.length > 0) {\n\t\t\tobject[currentPath] = this.recursiveUpdate(object[currentPath], remainingPath);\n\t\t} else {\n\t\t\tobject[currentPath] =\n\t\t\t\tobject[currentPath]?.filter(\n\t\t\t\t\t(option) =>\n\t\t\t\t\t\t!this.loadedOptions.some(\n\t\t\t\t\t\t\t(loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]\n\t\t\t\t\t\t)\n\t\t\t\t) ?? [];\n\t\t}\n\t\treturn object;\n\t};\n\n\t/**\n\t * Generates an HTML option element based on the provided item.\n\t * @param {object} item The item to generate the option element for.\n\t * @returns {HTMLElement} The generated option element.\n\t */\n\thtmlItem = (item) => {\n\t\tlet option = document.createElement('wje-option');\n\n\t\tif (item[this.itemValue] === null || item[this.itemValue] === undefined) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemValue}`);\n\t\t}\n\n\t\tif (item[this.itemText] === null || item[this.itemText] === undefined) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemText}`);\n\t\t}\n\n\t\toption.setAttribute('value', item[this.itemValue] ?? '');\n\t\toption.innerText = item[this.itemText] ?? '';\n\n\t\treturn option;\n\t};\n\n\t/**\n\t * Fetches the pages from the provided URL.\n\t * @param {number} page The page number to fetch.\n\t * @returns {Promise<object>} The fetched data.\n\t * @throws Will throw an error if the response is not ok.\n\t */\n\tasync getPages(page) {\n\t\tconst response = await fetch(this.url);\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`An error occurred: ${response.status}`);\n\t\t}\n\t\treturn await response.json();\n\t}\n\n\t/**\n\t * Finds the selected option data based on the given selected option values.\n\t * @param {Array} selectedOptionValues The array of selected option values.\n\t * @returns {Array} - The array of option data that matches the selected option values.\n\t */\n\tfindSelectedOptionData(selectedOptionValues = []) {\n\t\treturn this.options.filter((option) => selectedOptionValues.includes(option[this.itemValue]));\n\t}\n\n\t/**\n\t * Adds an option to the element.\n\t * @param {object} optionData The data of the option to be added.\n\t */\n\taddOption(optionData) {\n\t\tif (this.loadedOptions.some((option) => option[this.itemValue] === optionData[this.itemValue])) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = this.htmlItem(optionData);\n\t\tthis.#drawPreloadedElements.push(item);\n\t\tthis.prepend(item);\n\t\tthis.loadedOptions.push(optionData);\n\t}\n\n\t/**\n\t * Adds options to the element.\n\t * @param {Array} optionsData The array of option data to be added.\n\t * @param {boolean} [silent] Whether to suppress events triggered by adding options.\n\t */\n\taddOptions(optionsData = [], silent = false) {\n\t\tif (Array.isArray(optionsData)) optionsData?.forEach((od) => this.addOption(od, silent));\n\t\telse this.addOption(optionsData, silent);\n\t}\n\n\tbeforeDisconnect() {\n\t\tevent.removeListener(this.infiniteScroll, 'wje-infinite-scroll:load', null, this.dispatchOptionsLoadEvent);\n\t}\n}\n","import Options from './options.element.js';\n\nexport default Options;\n\nOptions.define('wje-options', Options);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAee,MAAM,gBAAgB,UAAU;AAAA,EAM9C,cAAc;AACb,UAAO;AALR,uCAAiB,CAAE;AAEnB,+CAAyB,CAAE;AAM3B,wCAAe;AAAA,MACd,cAAc;AAAA,MACd,uBAAuB;AAAA,MACvB,YAAY;AAAA,IACd;AAqOC,qCAAY;AAmHZ,oDAA2B,CAAC,MAAM;AAEjC,4BAAsB,MAAM;AAC3B,8BAAsB,MAAM;AAC3B,gBAAM,oBAAoB,MAAM,oBAAoB,CAAA,CAAE;AAAA,QAC1D,CAAI;AAAA,MACJ,CAAG;AAAA,IACH;AAqCC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2CAAkB,CAAC,QAAQ,mBAAmB;;AAC7C,UAAI,eAAe,WAAW,GAAG;AAChC,YAAI,MAAM,QAAQ,MAAM,GA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AAAA,IACH;AAEE,UAAM,OAAO,KAAK,SAAS,UAAU;AACrC,uBAAK,wBAAuB,KAAK,IAAI;AACrC,SAAK,QAAQ,IAAI;AACjB,SAAK,cAAc,KAAK,UAAU;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOC,WAAW,cAAc,IAAI,SAAS,OAAO;AAC5C,QAAI,MAAM,QAAQ,WAAW,EAAG,4CAAa,QAAQ,CAAC,OAAO,KAAK,UAAU,IAAI,MAAM;AAAA,QACjF,MAAK,UAAU,aAAa,MAAM;AAAA,EACzC;AAAA,EAEC,mBAAmB;AAClB,UAAM,eAAe,KAAK,gBAAgB,4BAA4B,MAAM,KAAK,wBAAwB;AAAA,EAC3G;AACA;AAvfC;AAEA;ACfD,QAAQ,OAAO,eAAe,OAAO;"}
1
+ {"version":3,"file":"wje-options.js","sources":["../packages/wje-options/options.element.js","../packages/wje-options/options.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport InfiniteScroll from '../wje-infinite-scroll/infinite-scroll.js';\nimport List from '../wje-list/list.js';\nimport Option from '../wje-option/option.js';\n\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Options` is a custom web component that represents a set of options. It extends from `WJElement`.\n * @summary This element represents a set of options.\n * @documentation https://elements.webjet.sk/components/options\n * @status stable\n * @tag wje-options\n */\n\nexport default class Options extends WJElement {\n\n\t#loadedOptions = [];\n\n\t#drawPreloadedElements = [];\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tdependencies = {\n\t\t'wje-option': Option,\n\t\t'wje-infinite-scroll': InfiniteScroll,\n\t\t'wje-list': List,\n\t}\n\n\t/**\n\t * Sets the option array path attribute.\n\t * @param {string} value The value to set for the option array path.\n\t */\n\tset optionArrayPath(value) {\n\t\tthis.setAttribute('option-array-path', value);\n\t}\n\n\t/**\n\t * Gets the option array path attribute.\n\t * @returns {string} The value of the option array path attribute or \"data\" if not set.\n\t */\n\tget optionArrayPath() {\n\t\treturn this.getAttribute('option-array-path');\n\t}\n\n\t/**\n\t * Checks if the option array path attribute is present.\n\t * @returns {boolean} True if the option array path attribute is present, false otherwise.\n\t */\n\tget hasOptionArrayPath() {\n\t\treturn this.hasAttribute('option-array-path');\n\t}\n\n\t/**\n\t * Gets the dropdown height attribute.\n\t * @returns {string} The value of the dropdown height attribute or \"100%\" if not set.\n\t */\n\tget dropdownHeight() {\n\t\treturn this.getAttribute('dropdown-height') || '100%';\n\t}\n\n\t/**\n\t * Sets the dropdown height attribute.\n\t * @param {string} value The value to set for the dropdown height.\n\t */\n\tset dropdownHeight(value) {\n\t\tthis.setAttribute('dropdown-height', value);\n\t}\n\n\t/**\n\t * Sets the item value attribute.\n\t * @param {string} value The value to set for the item value.\n\t */\n\tset itemValue(value) {\n\t\tthis.setAttribute('item-value', value);\n\t}\n\n\t/**\n\t * Gets the item value attribute.\n\t * @returns {string} The value of the item value attribute or \"value\" if not set.\n\t */\n\tget itemValue() {\n\t\treturn this.getAttribute('item-value') || 'value';\n\t}\n\n\t/**\n\t * Sets the item text attribute.\n\t * @param {string} value The value to set for the item text.\n\t */\n\tset itemText(value) {\n\t\tthis.setAttribute('item-text', value);\n\t}\n\n\t/**\n\t * Gets the item text attribute.\n\t * @returns {string} The value of the item text attribute or \"text\" if not set.\n\t */\n\tget itemText() {\n\t\treturn this.getAttribute('item-text') || 'text';\n\t}\n\n\t/**\n\t * Gets the lazy load size attribute.\n\t * @returns {number} The value of the lazy load size attribute or 10 if not set.\n\t */\n\tget lazyLoadSize() {\n\t\treturn this.getAttribute('lazy-load-size') || 10;\n\t}\n\n\t/**\n\t * Sets the lazy load size attribute.\n\t * @param {number} value The value to set for the lazy load size.\n\t */\n\tset lazyLoadSize(value) {\n\t\tthis.setAttribute('lazy-load-size', value);\n\t}\n\n\t/**\n\t * Sets the search attribute.\n\t * @param {string} value The value to set for the search.\n\t */\n\tset search(value) {\n\t\tthis.setAttribute('search', value);\n\t}\n\n\t/**\n\t * Gets the search attribute.\n\t * @returns {string} The value of the search attribute.\n\t */\n\tget search() {\n\t\treturn this.getAttribute('search');\n\t}\n\n\t/**\n\t * Checks if the search attribute is present.\n\t * @returns {boolean} True if the search attribute is present, false otherwise.\n\t */\n\tget hasSearch() {\n\t\treturn this.hasAttribute('search');\n\t}\n\n\t/**\n\t * Retrieves the value of the 'search-to-query-params' attribute from the current instance.\n\t * @returns {string | null} The value of the 'search-to-query-params' attribute, or null if the attribute is not set.\n\t */\n\tget searchToQueryParams() {\n\t\treturn this.getAttribute('search-to-query-params');\n\t}\n\n\t/**\n\t * Sets the value to define search-to-query params behavior.\n\t * @param {string} value The value to be set for the search-to-query-params attribute.\n\t */\n\tset searchToQueryParams(value) {\n\t\tthis.setAttribute('search-to-query-params', value);\n\t}\n\n\t/**\n\t * Determines whether the 'search-to-query-params' attribute is present on the element.\n\t * @returns {boolean} True if the 'search-to-query-params' attribute exists, otherwise false.\n\t */\n\tget hasSearchToQueryParams() {\n\t\treturn this.hasAttribute('search-to-query-params');\n\t}\n\n\t/**\n\t * Sets the value of the search parameter name attribute.\n\t * @param {string} value The string value to set as the search parameter name.\n\t */\n\tset searchParamName(value) {\n\t\tthis.setAttribute('search-param-name', value);\n\t}\n\n\t/**\n\t * Gets the search parameter name used in queries.\n\t * Retrieves the value of the 'search-param-name' attribute.\n\t * If the attribute is not set, it defaults to 'search'.\n\t * @returns {string} The search parameter name used for queries.\n\t */\n\tget searchParamName() {\n\t\treturn this.getAttribute('search-param-name') || 'search';\n\t}\n\n\t/**\n\t * Sets the queryParams attribute on the element.\n\t * @param {string} value The query parameters to set, represented as a string.\n\t */\n\tset queryParams(value) {\n\t\tthis.setAttribute('query-params', value);\n\t}\n\n\t/**\n\t * Retrieves the value of the 'query-params' attribute.\n\t * @returns {string | null} The value of the 'query-params' attribute, or null if the attribute is not set.\n\t */\n\tget queryParams() {\n\t\treturn this.getAttribute('query-params');\n\t}\n\n\t/**\n\t * Sets the lazy attribute.\n\t * @param {boolean} value The value to set for the lazy attribute.\n\t */\n\tset lazy(value) {\n\t\tthis.setAttribute('lazy', value);\n\t}\n\n\t/**\n\t * Checks if the lazy attribute is present.\n\t * @returns {boolean} True if the lazy attribute is present, false otherwise.\n\t */\n\tget lazy() {\n\t\treturn this.hasAttribute('lazy');\n\t}\n\n\t/**\n\t * Gets the loaded options.\n\t * @returns {Array} The loaded options.\n\t */\n\tget options() {\n\t\treturn this.loadedOptions?.flat();\n\t}\n\n\t/**\n\t * Gets the loaded options.\n\t * @type {Array}\n\t */\n\tget loadedOptions() {\n\t\treturn this.#loadedOptions;\n\t}\n\n\t/**\n\t * Sets the loaded options.\n\t * @type {Array}\n\t */\n\tset loadedOptions(loadedOptions) {\n\t\tthis.#loadedOptions = loadedOptions;\n\t}\n\n\t/**\n\t * Array of preloaded elements.\n\t * @type {Array}\n\t * @private\n\t */\n\tget drawPreloadedElements() {\n\t\treturn this.#drawPreloadedElements;\n\t}\n\n\t/**\n\t * Sets the elements that are preloaded and ready to be drawn.\n\t * @param {Array|object} elements The elements to be set for preloading. This can be an array or a specific object containing drawable elements.\n\t */\n\tset drawPreloadedElements(elements) {\n\t\tthis.#drawPreloadedElements = elements;\n\t}\n\n\tclassName = 'Options';\n\n\t/**\n\t * Returns the CSS styles for the component.\n\t * @static\n\t * @returns {CSSStyleSheet} The CSS styles for the component.\n\t */\n\tstatic get cssStyleSheet() {\n\t\treturn styles;\n\t}\n\n\t/**\n\t * Retrieves an array of attributes that should be observed for changes.\n\t * The method returns a list of attribute names that the browser will monitor for changes.\n\t * @returns {Array<string>} An array of attribute names to observe.\n\t */\n\tstatic get observedAttributes() {\n\t\treturn ['search', 'attached'];\n\t}\n\n\t/**\n\t * Sets up the attributes for the component.\n\t */\n\tsetupAttributes() {\n\t\tthis.isShadowRoot = 'open';\n\t\tthis.syncAria();\n\t}\n\n\t/**\n\t * Draws the component.\n\t * @returns {DocumentFragment}\n\t */\n\tasync draw() {\n\t\tlet fragment = document.createDocumentFragment();\n\n\t\tconst slot = document.createElement('slot');\n\t\tfragment.appendChild(slot);\n\t\tthis.syncAria();\n\n\t\tif (this.lazy) {\n\t\t\tif (this.contains(this.infiniteScroll)) {\n\t\t\t\tthis.drawPreloadedElements.forEach((el) => { el.remove() });\n\t\t\t\tthis.loadedOptions = [];\n\t\t\t\tthis.infiniteScroll.placementObj.innerHTML = '';\n\t\t\t\tthis.infiniteScroll.totalPages = 0;\n\t\t\t\tthis.infiniteScroll.refresh();\n\t\t\t}\n\n\t\t\tlet loader = document.createElement('div');\n\t\t\tloader.setAttribute('slot', 'loader');\n\t\t\tloader.append('Loading...');\n\t\t\tloader.classList.add('loader');\n\n\t\t\tconst infiniteScroll = document.createElement('wje-infinite-scroll');\n\t\t\tinfiniteScroll.setAttribute('placement', 'wje-list');\n\t\t\tinfiniteScroll.setAttribute('height', this.dropdownHeight);\n\t\t\tinfiniteScroll.setAttribute('object-name', this.optionArrayPath);\n\t\t\tinfiniteScroll.dataToHtml = this.htmlItem;\n\t\t\tinfiniteScroll.setCustomData = async (page, signal) => {\n\t\t\t\tlet processedUrl = `${this.url}${this.search ? `/${this.search}` : ''}?page=${page}&size=${this.lazyLoadSize}${this.queryParams ? `&${this.queryParams}` : ''}`;\n\n\t\t\t\tif (this.hasSearchToQueryParams) {\n\t\t\t\t\tprocessedUrl = `${this.url}?page=${page}&size=${this.lazyLoadSize}${this.queryParams ? `&${this.queryParams}` : ''}${this.search ? `&${this.searchParamName}=${this.search}` : ''}`;\n\t\t\t\t}\n\n\t\t\t\tlet res = await this.service.get(processedUrl, null, false, signal);\n\t\t\t\tconst filteredOptions = this.filterOutDrawnOptions(res);\n\t\t\t\tthis.loadedOptions.push(...this.processData(filteredOptions));\n\n\t\t\t\treturn filteredOptions;\n\t\t\t};\n\n\t\t\tconst list = document.createElement('wje-list');\n\n\t\t\tinfiniteScroll.append(list);\n\t\t\tinfiniteScroll.append(loader);\n\n\t\t\tif (this.hasAttribute('attached') && !this.hasSearch) {\n\t\t\t\tthis.appendChild(infiniteScroll);\n\t\t\t\tthis.drawPreloadedElements.forEach((el) => {\n\t\t\t\t\tlist.appendChild(el);\n\t\t\t\t});\n\t\t\t\tthis.infiniteScroll = infiniteScroll;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.response = await this.getPages();\n\n\t\t\tlet optionsData = this.filterOutDrawnOptions(this.response);\n\t\t\toptionsData = this.processData(optionsData);\n\n\t\t\tthis.loadedOptions.push(...optionsData);\n\n\t\t\tthis.append(...optionsData.map(this.htmlItem));\n\n\t\t\tevent.dispatchCustomEvent(this, 'wje-options:load', {});\n\t\t}\n\n\t\treturn fragment;\n\t}\n\n\t/**\n\t * Syncs ARIA attributes on the host element.\n\t */\n\tsyncAria() {\n\t\tconst isMultiple = this.closest('wje-select')?.hasAttribute('multiple');\n\t\tthis.setAriaState({\n\t\t\trole: 'listbox',\n\t\t\tmultiselectable: isMultiple ? 'true' : undefined,\n\t\t});\n\t}\n\n\tafterDraw() {\n\t\tevent.addListener(this.infiniteScroll, 'wje-infinite-scroll:load', null, this.dispatchOptionsLoadEvent);\n\t}\n\n\tdispatchOptionsLoadEvent = (e) => {\n\t\t// Wait for next paint cycle to ensure options are in DOM\n\t\trequestAnimationFrame(() => {\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tevent.dispatchCustomEvent(this, 'wje-options:load', {});\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Processes the provided data based on the optional array path set in the instance.\n\t * @param {object} data The input data to be processed.\n\t * @returns {Array} The resolved options array from the data or an empty array if no match is found.\n\t */\n\tprocessData(data) {\n\t\tconst splittedOptionArrayPath = this.optionArrayPath ? this.optionArrayPath?.split('.') : null;\n\t\tlet options = data;\n\n\t\tsplittedOptionArrayPath?.forEach((path) => {\n\t\t\toptions = options[path];\n\t\t});\n\n\t\treturn options ?? [];\n\t}\n\n\t/**\n\t * Filters out options from the response object that have already been drawn, based on the specified option array path.\n\t * @param {object} response The response object containing data to process.\n\t * @returns {object} The filtered response object with drawn options removed.\n\t */\n\tfilterOutDrawnOptions(response) {\n\t\tconst splittedOptionArrayPath = this.optionArrayPath ? this.optionArrayPath?.split('.') : [];\n\t\tlet filteredResponse = structuredClone(response);\n\n\t\tfilteredResponse = this.recursiveUpdate(filteredResponse, splittedOptionArrayPath);\n\t\treturn filteredResponse;\n\t}\n\n\t/**\n\t * Recursively updates the object based on the provided path to the property.\n\t * @param {object | Array | null} object\n\t * @param {Array<string> | null} pathToProperty\n\t * @returns {object | Array | null}\n\t */\n\trecursiveUpdate = (object, pathToProperty) => {\n\t\tif (pathToProperty.length === 0) {\n\t\t\tif (Array.isArray(object)) {\n\t\t\t\treturn object.filter(\n\t\t\t\t\t(option) =>\n\t\t\t\t\t\t!this.loadedOptions.some(\n\t\t\t\t\t\t\t(loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconsole.error('Expected an array but got:', object, pathToProperty);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t}\n\n\t\tconst [currentPath, ...remainingPath] = pathToProperty;\n\t\tif (remainingPath.length > 0) {\n\t\t\tobject[currentPath] = this.recursiveUpdate(object[currentPath], remainingPath);\n\t\t} else {\n\t\t\tobject[currentPath] =\n\t\t\t\tobject[currentPath]?.filter(\n\t\t\t\t\t(option) =>\n\t\t\t\t\t\t!this.loadedOptions.some(\n\t\t\t\t\t\t\t(loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]\n\t\t\t\t\t\t)\n\t\t\t\t) ?? [];\n\t\t}\n\t\treturn object;\n\t};\n\n\t/**\n\t * Generates an HTML option element based on the provided item.\n\t * @param {object} item The item to generate the option element for.\n\t * @returns {HTMLElement} The generated option element.\n\t */\n\thtmlItem = (item) => {\n\t\tlet option = document.createElement('wje-option');\n\n\t\tif (item[this.itemValue] === null || item[this.itemValue] === undefined) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemValue}`);\n\t\t}\n\n\t\tif (item[this.itemText] === null || item[this.itemText] === undefined) {\n\t\t\tconsole.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemText}`);\n\t\t}\n\n\t\toption.setAttribute('value', item[this.itemValue] ?? '');\n\t\toption.innerText = item[this.itemText] ?? '';\n\n\t\treturn option;\n\t};\n\n\t/**\n\t * Fetches the pages from the provided URL.\n\t * @param {number} page The page number to fetch.\n\t * @returns {Promise<object>} The fetched data.\n\t * @throws Will throw an error if the response is not ok.\n\t */\n\tasync getPages(page) {\n\t\tconst response = await fetch(this.url);\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`An error occurred: ${response.status}`);\n\t\t}\n\t\treturn await response.json();\n\t}\n\n\t/**\n\t * Finds the selected option data based on the given selected option values.\n\t * @param {Array} selectedOptionValues The array of selected option values.\n\t * @returns {Array} - The array of option data that matches the selected option values.\n\t */\n\tfindSelectedOptionData(selectedOptionValues = []) {\n\t\treturn this.options.filter((option) => selectedOptionValues.includes(option[this.itemValue]));\n\t}\n\n\t/**\n\t * Adds an option to the element.\n\t * @param {object} optionData The data of the option to be added.\n\t */\n\taddOption(optionData) {\n\t\tif (this.loadedOptions.some((option) => option[this.itemValue] === optionData[this.itemValue])) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = this.htmlItem(optionData);\n\t\tthis.#drawPreloadedElements.push(item);\n\t\tthis.prepend(item);\n\t\tthis.loadedOptions.push(optionData);\n\t}\n\n\t/**\n\t * Adds options to the element.\n\t * @param {Array} optionsData The array of option data to be added.\n\t * @param {boolean} [silent] Whether to suppress events triggered by adding options.\n\t */\n\taddOptions(optionsData = [], silent = false) {\n\t\tif (Array.isArray(optionsData)) optionsData?.forEach((od) => this.addOption(od, silent));\n\t\telse this.addOption(optionsData, silent);\n\t}\n\n\tbeforeDisconnect() {\n\t\tevent.removeListener(this.infiniteScroll, 'wje-infinite-scroll:load', null, this.dispatchOptionsLoadEvent);\n\t}\n}\n","import Options from './options.element.js';\n\nexport default Options;\n\nOptions.define('wje-options', Options);\n"],"names":[],"m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A;AAAA;AAAA,EAkEA,MAAM,SAAS,MAAM;AACpB,UAAM,WAAW,MAAM,MAAM,KAAK,GAAG;AACrC,QAAI,CAAC,SAAS,IAAI;AACjB,YAAM,IAAI,MAAM,sBAAsB,SAAS,MAAM,EAAE;AAAA,IACxD;AACA,WAAO,MAAM,SAAS,KAAI;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,uBAAuB,uBAAuB,IAAI;AACjD,WAAO,KAAK,QAAQ,OAAO,CAAC,WAAW,qBAAqB,SAAS,OAAO,KAAK,SAAS,CAAC,CAAC;AAAA,EAC7F;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAU,YAAY;AACrB,QAAI,KAAK,cAAc,KAAK,CAAC,WAAW,OAAO,KAAK,SAAS,MAAM,WAAW,KAAK,SAAS,CAAC,GAAG;AAC/F;AAAA,IACD;AAEA,UAAM,OAAO,KAAK,SAAS,UAAU;AACrC,uBAAK,wBAAuB,KAAK,IAAI;AACrC,SAAK,QAAQ,IAAI;AACjB,SAAK,cAAc,KAAK,UAAU;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,WAAW,cAAc,IAAI,SAAS,OAAO;AAC5C,QAAI,MAAM,QAAQ,WAAW,EAAG,4CAAa,QAAQ,CAAC,OAAO,KAAK,UAAU,IAAI,MAAM;AAAA,QACjF,MAAK,UAAU,aAAa,MAAM;AAAA,EACxC;AAAA,EAEA,mBAAmB;AAClB,UAAM,eAAe,KAAK,gBAAgB,4BAA4B,MAAM,KAAK,wBAAwB;AAAA,EAC1G;AACD;AAvfC;AAEA;ACfD,QAAQ,OAAO,eAAe,OAAO;"}
@@ -1 +1 @@
1
- {"version":3,"file":"wje-orgchart-group.js","sources":["../packages/wje-orgchart-group/orgchart-group.element.js","../packages/wje-orgchart-group/orgchart-group.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary OrgchartItem is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/OrgchartItem\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @tag wje-orgchart-item\n * @example\n */\nexport default class OrgchartGroup extends WJElement {\n /**\n * Creates an instance of OrgchartGroup.\n * @class\n */\n constructor() {\n super();\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'OrgchartGroup';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component for the org chart group.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('orgchart-group');\n\n let card = document.createElement('wje-card');\n\n let title = document.createElement('h4');\n title.setAttribute('part', 'title');\n title.innerHTML = this.getAttribute('title') || '';\n\n let items = document.createElement('div');\n items.setAttribute('part', 'items');\n items.classList.add('items');\n\n let slot = document.createElement('slot');\n\n items.appendChild(slot);\n\n card.appendChild(title);\n card.appendChild(items);\n\n native.appendChild(card);\n\n fragment.appendChild(native);\n\n this.card = card;\n\n return fragment;\n }\n\n /**\n * After Draws the component for the org chart group.\n */\n afterDraw() {\n this.card.addEventListener('click', (e) => {\n e.stopPropagation();\n event.dispatchCustomEvent(this.card, 'wje-orgchart-group:click', { target: this });\n });\n }\n}\n","import OrgchartGroup from './orgchart-group.element.js';\n\nexport default OrgchartGroup;\n\nOrgchartGroup.define('wje-orgchart-group', OrgchartGroup);\n"],"names":[],"mappings":";;;;;;AAYe,MAAM,sBAAsB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjD,cAAc;AACV,UAAO;AAOX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAAA,EANhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,QAAI,WAAW,SAAS,uBAAwB;AAEhD,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,UAAU,IAAI,gBAAgB;AAErC,QAAI,OAAO,SAAS,cAAc,UAAU;AAE5C,QAAI,QAAQ,SAAS,cAAc,IAAI;AACvC,UAAM,aAAa,QAAQ,OAAO;AAClC,UAAM,YAAY,KAAK,aAAa,OAAO,KAAK;AAEhD,QAAI,QAAQ,SAAS,cAAc,KAAK;AACxC,UAAM,aAAa,QAAQ,OAAO;AAClC,UAAM,UAAU,IAAI,OAAO;AAE3B,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,UAAM,YAAY,IAAI;AAEtB,SAAK,YAAY,KAAK;AACtB,SAAK,YAAY,KAAK;AAEtB,WAAO,YAAY,IAAI;AAEvB,aAAS,YAAY,MAAM;AAE3B,SAAK,OAAO;AAEZ,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,YAAY;AACR,SAAK,KAAK,iBAAiB,SAAS,CAAC,MAAM;AACvC,QAAE,gBAAiB;AACnB,YAAM,oBAAoB,KAAK,MAAM,4BAA4B,EAAE,QAAQ,MAAM;AAAA,IAC7F,CAAS;AAAA,EACT;AACA;ACrFA,cAAc,OAAO,sBAAsB,aAAa;"}
1
+ {"version":3,"file":"wje-orgchart-group.js","sources":["../packages/wje-orgchart-group/orgchart-group.element.js","../packages/wje-orgchart-group/orgchart-group.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary OrgchartItem is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/OrgchartItem\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @tag wje-orgchart-item\n * @example\n */\nexport default class OrgchartGroup extends WJElement {\n /**\n * Creates an instance of OrgchartGroup.\n * @class\n */\n constructor() {\n super();\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'OrgchartGroup';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component for the org chart group.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('orgchart-group');\n\n let card = document.createElement('wje-card');\n\n let title = document.createElement('h4');\n title.setAttribute('part', 'title');\n title.innerHTML = this.getAttribute('title') || '';\n\n let items = document.createElement('div');\n items.setAttribute('part', 'items');\n items.classList.add('items');\n\n let slot = document.createElement('slot');\n\n items.appendChild(slot);\n\n card.appendChild(title);\n card.appendChild(items);\n\n native.appendChild(card);\n\n fragment.appendChild(native);\n\n this.card = card;\n\n return fragment;\n }\n\n /**\n * After Draws the component for the org chart group.\n */\n afterDraw() {\n this.card.addEventListener('click', (e) => {\n e.stopPropagation();\n event.dispatchCustomEvent(this.card, 'wje-orgchart-group:click', { target: this });\n });\n }\n}\n","import OrgchartGroup from './orgchart-group.element.js';\n\nexport default OrgchartGroup;\n\nOrgchartGroup.define('wje-orgchart-group', OrgchartGroup);\n"],"names":[],"mappings":";;;;;;AAYe,MAAM,sBAAsB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjD,cAAc;AACV,UAAK;AAOT;AAAA;AAAA;AAAA;AAAA,qCAAY;AAAA,EANZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,kBAAkB;AACd,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO;AACH,QAAI,WAAW,SAAS,uBAAsB;AAE9C,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,UAAU,IAAI,gBAAgB;AAErC,QAAI,OAAO,SAAS,cAAc,UAAU;AAE5C,QAAI,QAAQ,SAAS,cAAc,IAAI;AACvC,UAAM,aAAa,QAAQ,OAAO;AAClC,UAAM,YAAY,KAAK,aAAa,OAAO,KAAK;AAEhD,QAAI,QAAQ,SAAS,cAAc,KAAK;AACxC,UAAM,aAAa,QAAQ,OAAO;AAClC,UAAM,UAAU,IAAI,OAAO;AAE3B,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,UAAM,YAAY,IAAI;AAEtB,SAAK,YAAY,KAAK;AACtB,SAAK,YAAY,KAAK;AAEtB,WAAO,YAAY,IAAI;AAEvB,aAAS,YAAY,MAAM;AAE3B,SAAK,OAAO;AAEZ,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY;AACR,SAAK,KAAK,iBAAiB,SAAS,CAAC,MAAM;AACvC,QAAE,gBAAe;AACjB,YAAM,oBAAoB,KAAK,MAAM,4BAA4B,EAAE,QAAQ,MAAM;AAAA,IACrF,CAAC;AAAA,EACL;AACJ;ACrFA,cAAc,OAAO,sBAAsB,aAAa;"}
@@ -1 +1 @@
1
- {"version":3,"file":"wje-orgchart-item.js","sources":["../packages/wje-orgchart-item/orgchart-item.element.js","../packages/wje-orgchart-item/orgchart-item.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary OrgchartItem is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/OrgchartItem\n * @status stable\n * @augments WJElement\n * @attribute {boolean} boss - The boss of the orgchart item (default: false).\n * @slot - The default slot for the orgchart item.\n * @slot child - The child slot for the orgchart item.\n * @csspart - Styles the element.\n * @csspart native - Styles the native element.\n * @csspart expander - Styles the expander element.\n * @tag wje-orgchart-item\n */\nexport default class OrgchartItem extends WJElement {\n /**\n * Creates an instance of OrgchartItem.\n * @class\n */\n constructor() {\n super();\n }\n\n /**\n * Sets the boss of the orgchart item.\n * @param value\n */\n\n set boss(value) {\n if (value) this.setAttribute('boss', value);\n }\n\n /**\n * Gets the boss of the orgchart item.\n * @returns {boolean}\n */\n\n get boss() {\n return this.hasAttribute('boss');\n }\n\n className = 'OrgchartItem';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n beforeDraw() {\n if (this.parentElement && this.parentElement.tagName === 'WJE-ORGCHART-GROUP') {\n this.classList.add('parent-group');\n }\n }\n\n /**\n * Draws the component for the org chart item.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('orgchart-item');\n\n let card = document.createElement('wje-card');\n card.setAttribute('part', 'card');\n\n let slot = document.createElement('slot');\n\n let child = document.createElement('slot');\n child.setAttribute('name', 'child');\n\n let expander = document.createElement('div');\n expander.setAttribute('part', 'expander');\n expander.classList.add('expander');\n expander.innerHTML = '-';\n\n card.appendChild(slot);\n if (this.children.length > 0 && Array.from(this.children).some((el) => el.tagName === 'WJE-ORGCHART'))\n card.appendChild(expander); // if the orgchart item has children and\n\n native.appendChild(card);\n native.appendChild(child);\n\n fragment.appendChild(native);\n\n this.expander = expander;\n\n return fragment;\n }\n\n /**\n * After Draws the component for the org chart item.\n */\n afterDraw() {\n this.expander.addEventListener('click', this.toggleChildren);\n }\n\n /**\n * Toggles the children of the orgchart item.\n * @param e The event object.\n */\n toggleChildren = (e) => {\n this.classList.toggle('collapse');\n if (this.classList.contains('collapse')) e.target.innerHTML = '+';\n else e.target.innerHTML = '-';\n };\n\n dispatchEvent(e) {\n return false;\n }\n}\n","import OrgchartItem from './orgchart-item.element.js';\n\nexport default OrgchartItem;\n\nOrgchartItem.define('wje-orgchart-item', OrgchartItem);\n"],"names":[],"mappings":";;;;;AAgBe,MAAM,qBAAqB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhD,cAAc;AACV,UAAO;AAqBX,qCAAY;AAyEZ;AAAA;AAAA;AAAA;AAAA,0CAAiB,CAAC,MAAM;AACpB,WAAK,UAAU,OAAO,UAAU;AAChC,UAAI,KAAK,UAAU,SAAS,UAAU,EAAG,GAAE,OAAO,YAAY;AAAA,UACzD,GAAE,OAAO,YAAY;AAAA,IAC7B;AAAA,EAjGL;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAAI,KAAK,OAAO;AACZ,QAAI,MAAO,MAAK,aAAa,QAAQ,KAAK;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAAI,OAAO;AACP,WAAO,KAAK,aAAa,MAAM;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA,EAEI,aAAa;AACT,QAAI,KAAK,iBAAiB,KAAK,cAAc,YAAY,sBAAsB;AAC3E,WAAK,UAAU,IAAI,cAAc;AAAA,IAC7C;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,QAAI,WAAW,SAAS,uBAAwB;AAEhD,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,UAAU,IAAI,eAAe;AAEpC,QAAI,OAAO,SAAS,cAAc,UAAU;AAC5C,SAAK,aAAa,QAAQ,MAAM;AAEhC,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,QAAI,QAAQ,SAAS,cAAc,MAAM;AACzC,UAAM,aAAa,QAAQ,OAAO;AAElC,QAAI,WAAW,SAAS,cAAc,KAAK;AAC3C,aAAS,aAAa,QAAQ,UAAU;AACxC,aAAS,UAAU,IAAI,UAAU;AACjC,aAAS,YAAY;AAErB,SAAK,YAAY,IAAI;AACrB,QAAI,KAAK,SAAS,SAAS,KAAK,MAAM,KAAK,KAAK,QAAQ,EAAE,KAAK,CAAC,OAAO,GAAG,YAAY,cAAc;AAChG,WAAK,YAAY,QAAQ;AAE7B,WAAO,YAAY,IAAI;AACvB,WAAO,YAAY,KAAK;AAExB,aAAS,YAAY,MAAM;AAE3B,SAAK,WAAW;AAEhB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,YAAY;AACR,SAAK,SAAS,iBAAiB,SAAS,KAAK,cAAc;AAAA,EACnE;AAAA,EAYI,cAAc,GAAG;AACb,WAAO;AAAA,EACf;AACA;ACzHA,aAAa,OAAO,qBAAqB,YAAY;"}
1
+ {"version":3,"file":"wje-orgchart-item.js","sources":["../packages/wje-orgchart-item/orgchart-item.element.js","../packages/wje-orgchart-item/orgchart-item.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary OrgchartItem is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/OrgchartItem\n * @status stable\n * @augments WJElement\n * @attribute {boolean} boss - The boss of the orgchart item (default: false).\n * @slot - The default slot for the orgchart item.\n * @slot child - The child slot for the orgchart item.\n * @csspart - Styles the element.\n * @csspart native - Styles the native element.\n * @csspart expander - Styles the expander element.\n * @tag wje-orgchart-item\n */\nexport default class OrgchartItem extends WJElement {\n /**\n * Creates an instance of OrgchartItem.\n * @class\n */\n constructor() {\n super();\n }\n\n /**\n * Sets the boss of the orgchart item.\n * @param value\n */\n\n set boss(value) {\n if (value) this.setAttribute('boss', value);\n }\n\n /**\n * Gets the boss of the orgchart item.\n * @returns {boolean}\n */\n\n get boss() {\n return this.hasAttribute('boss');\n }\n\n className = 'OrgchartItem';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n beforeDraw() {\n if (this.parentElement && this.parentElement.tagName === 'WJE-ORGCHART-GROUP') {\n this.classList.add('parent-group');\n }\n }\n\n /**\n * Draws the component for the org chart item.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('orgchart-item');\n\n let card = document.createElement('wje-card');\n card.setAttribute('part', 'card');\n\n let slot = document.createElement('slot');\n\n let child = document.createElement('slot');\n child.setAttribute('name', 'child');\n\n let expander = document.createElement('div');\n expander.setAttribute('part', 'expander');\n expander.classList.add('expander');\n expander.innerHTML = '-';\n\n card.appendChild(slot);\n if (this.children.length > 0 && Array.from(this.children).some((el) => el.tagName === 'WJE-ORGCHART'))\n card.appendChild(expander); // if the orgchart item has children and\n\n native.appendChild(card);\n native.appendChild(child);\n\n fragment.appendChild(native);\n\n this.expander = expander;\n\n return fragment;\n }\n\n /**\n * After Draws the component for the org chart item.\n */\n afterDraw() {\n this.expander.addEventListener('click', this.toggleChildren);\n }\n\n /**\n * Toggles the children of the orgchart item.\n * @param e The event object.\n */\n toggleChildren = (e) => {\n this.classList.toggle('collapse');\n if (this.classList.contains('collapse')) e.target.innerHTML = '+';\n else e.target.innerHTML = '-';\n };\n\n dispatchEvent(e) {\n return false;\n }\n}\n","import OrgchartItem from './orgchart-item.element.js';\n\nexport default OrgchartItem;\n\nOrgchartItem.define('wje-orgchart-item', OrgchartItem);\n"],"names":[],"mappings":";;;;;AAgBe,MAAM,qBAAqB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhD,cAAc;AACV,UAAK;AAqBT,qCAAY;AAyEZ;AAAA;AAAA;AAAA;AAAA,0CAAiB,CAAC,MAAM;AACpB,WAAK,UAAU,OA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Y,IAAI;AACvB,WAAO,YAAY,KAAK;AAExB,aAAS,YAAY,MAAM;AAE3B,SAAK,WAAW;AAEhB,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY;AACR,SAAK,SAAS,iBAAiB,SAAS,KAAK,cAAc;AAAA,EAC/D;AAAA,EAYA,cAAc,GAAG;AACb,WAAO;AAAA,EACX;AACJ;ACzHA,aAAa,OAAO,qBAAqB,YAAY;"}
@@ -1 +1 @@
1
- {"version":3,"file":"wje-orgchart.js","sources":["../packages/wje-orgchart/orgchart.element.js","../packages/wje-orgchart/orgchart.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary Orgchart is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/Orgchart\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @tag wje-orgchart\n * @example\n */\nexport default class Orgchart extends WJElement {\n /**\n * Creates an instance of Orgchart.\n * @class\n */\n constructor() {\n super();\n }\n\n className = 'Orgchart';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Draws the component for the org chart.\n * @returns {DocumentFragment}\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-orgchart');\n\n let slot = document.createElement('slot');\n\n native.appendChild(slot);\n\n fragment.appendChild(native);\n\n this.native = native;\n\n return fragment;\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'tree' });\n }\n }\n}\n","import Orgchart from './orgchart.element.js';\n\nexport default Orgchart;\n\nOrgchart.define('wje-orgchart', Orgchart);\n"],"names":[],"mappings":";;;;;AAYe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,cAAc;AACV,UAAO;AAGX,qCAAY;AAAA,EAFhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AACpB,SAAK,SAAU;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,QAAI,WAAW,SAAS,uBAAwB;AAEhD,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,UAAU,IAAI,iBAAiB;AAEtC,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,WAAO,YAAY,IAAI;AAEvB,aAAS,YAAY,MAAM;AAE3B,SAAK,SAAS;AAEd,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,WAAW;AACP,QAAI,CAAC,KAAK,aAAa,MAAM,GAAG;AAC5B,WAAK,aAAa,EAAE,MAAM,OAAM,CAAE;AAAA,IAC9C;AAAA,EACA;AACA;AClEA,SAAS,OAAO,gBAAgB,QAAQ;"}
1
+ {"version":3,"file":"wje-orgchart.js","sources":["../packages/wje-orgchart/orgchart.element.js","../packages/wje-orgchart/orgchart.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary Orgchart is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/Orgchart\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @tag wje-orgchart\n * @example\n */\nexport default class Orgchart extends WJElement {\n /**\n * Creates an instance of Orgchart.\n * @class\n */\n constructor() {\n super();\n }\n\n className = 'Orgchart';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Draws the component for the org chart.\n * @returns {DocumentFragment}\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-orgchart');\n\n let slot = document.createElement('slot');\n\n native.appendChild(slot);\n\n fragment.appendChild(native);\n\n this.native = native;\n\n return fragment;\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n if (!this.hasAttribute('role')) {\n this.setAriaState({ role: 'tree' });\n }\n }\n}\n","import Orgchart from './orgchart.element.js';\n\nexport default Orgchart;\n\nOrgchart.define('wje-orgchart', Orgchart);\n"],"names":[],"mappings":";;;;;AAYe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,cAAc;AACV,UAAK;AAGT,qCAAY;AAAA,EAFZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,kBAAkB;AACd,SAAK,eAAe;AACpB,SAAK,SAAQ;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO;AACH,QAAI,WAAW,SAAS,uBAAsB;AAE9C,QAAI,SAAS,SAAS,cAAc,KAAK;AACzC,WAAO,aAAa,QAAQ,QAAQ;AACpC,WAAO,UAAU,IAAI,iBAAiB;AAEtC,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,WAAO,YAAY,IAAI;AAEvB,aAAS,YAAY,MAAM;AAE3B,SAAK,SAAS;AAEd,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,WAAW;AACP,QAAI,CAAC,KAAK,aAAa,MAAM,GAAG;AAC5B,WAAK,aAAa,EAAE,MAAM,OAAM,CAAE;AAAA,IACtC;AAAA,EACJ;AACJ;AClEA,SAAS,OAAO,gBAAgB,QAAQ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"wje-pagination.js","sources":["../packages/wje-pagination/service/service.js","../packages/wje-pagination/pagination.element.js","../packages/wje-pagination/pagination.js"],"sourcesContent":["/**\n * Paginates items based on the total number of items, current page, page size, and maximum number of pages to display.\n * @param {number} totalItems The total number of items to paginate.\n * @param {number} [currentPage] The current page number (default is 1).\n * @param {number} [pageSize] The number of items per page (default is 10).\n * @param {number} [maxPages] The maximum number of pages to display in the pagination control (default is 5).\n * @returns {object} An object containing pagination details including total items, current page, page size, total pages, start/end page, start/end index, and the pages array.\n */\nexport function paginate(totalItems, currentPage = 1, pageSize = 10, maxPages = 5) {\n // Calculate total pages\n const totalPages = Math.ceil(totalItems / pageSize);\n\n // Ensure current page is within valid range\n if (currentPage < 1) {\n currentPage = 1;\n } else if (currentPage > totalPages) {\n currentPage = totalPages;\n }\n\n let startPage;\n let endPage;\n\n const pagesNearEnd = maxPages + 1; // Define how close to the end we switch back to 5 pages 4\n\n const boundary = pagesNearEnd + 3;\n\n if (totalPages > boundary) {\n if (currentPage < pagesNearEnd) {\n // If in the first 4 pages, show up to 5 pages\n startPage = 1;\n endPage = Math.min(pagesNearEnd + 1, totalPages); //5\n } else if (currentPage >= totalPages - pagesNearEnd) {\n // If within 4 pages from the end, show last 5 pages\n startPage = Math.max(totalPages - pagesNearEnd, 1); //4\n endPage = totalPages;\n } else {\n const halfPages = Math.floor(maxPages / 2);\n // Otherwise, only show 3 pages (current, previous, next)\n startPage = currentPage - halfPages + 1;\n endPage = maxPages % 2 === 1 ? currentPage + halfPages + 1 : currentPage + halfPages - 1;\n }\n } else {\n startPage = 1;\n endPage = totalPages;\n }\n\n // Calculate start and end item indexes\n const startIndex = (currentPage - 1) * pageSize;\n const endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1);\n\n // Create an array of pages to display\n const pages = Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i);\n\n // Return object with all pager properties (preserving original format)\n return {\n boundary: boundary,\n currentPage: currentPage,\n endIndex: endIndex,\n endPage: endPage,\n totalPages: totalPages,\n pages: pages,\n pageSize: pageSize,\n startIndex: startIndex,\n startPage: startPage,\n totalItems: totalItems,\n };\n}\n","import { Localizer } from '../utils/localize.js';\nimport { default as WJElement, event } from '../wje-element/element.js';\nimport { paginate } from './service/service.js';\nimport Icon from '../wje-icon/icon.js';\nimport Button from '../wje-button/button.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents the Pagination component for navigating through paginated content and dynamically updating navigation elements based on attributes like the number of items, page size, etc. Extends the WJElement class.\n * @documentation https://elements.webjet.sk/components/pagination\n * @status stable\n * @augments WJElement\n * @dependency wje-icon, wje-button\n * @csspart native - The wrapper element for the pagination component.\n */\nexport default class Pagination extends WJElement {\n /**\n * Creates an instance of Pagination.\n */\n constructor() {\n super();\n this.localizer = new Localizer(this);\n\n this._paginateObj = null;\n }\n\n /**\n * Sets the value of the 'page' attribute for the object.\n * @param {string} value The value to set for the 'page' attribute.\n */\n set page(value) {\n this.setAttribute('page', value);\n }\n\n /**\n * Retrieves the current page number as a numeric value.\n * @returns {number} The current page number. Returns 0 if the attribute 'page' is not set or is not a numeric value.\n */\n get page() {\n return +this.getAttribute('page') || 0;\n }\n\n /**\n * Sets the maximum number of pages.\n * Updates the 'max-pages' attribute with the provided value.\n * @param {number|string} value The maximum number of pages to set. Can be a number or a parsable string representing a number.\n */\n set maxPages(value) {\n this.setAttribute('max-pages', value);\n }\n\n /**\n * Gets the maximum number of pages.\n * This getter retrieves the value of the \"max-pages\" attribute from the element.\n * If the attribute is not set or is invalid, it defaults to 3.\n * @returns {number} The maximum number of pages as a numeric value.\n */\n get maxPages() {\n return +this.getAttribute('max-pages') || 10;\n }\n\n /**\n * Sets the `pageSize` attribute to the specified value.\n * @param {number|string} value The desired page size value. This can be a number or a string representation of the size.\n */\n set pageSize(value) {\n this.setAttribute('page-size', value);\n }\n\n /**\n * Retrieves the value of the 'page-size' attribute and converts it to a number.\n * If the attribute is not set or is invalid, returns the default value of 3.\n * @returns {number} The numeric value of the 'page-size' attribute or the default value of 3.\n */\n get pageSize() {\n return +this.getAttribute('page-size') || 3;\n }\n\n /**\n * Sets the total number of items.\n * @param {number} value The new total number of items to set.\n */\n set totalItems(value) {\n this.setAttribute('total-items', value);\n }\n\n /**\n * Retrieves the total number of items represented by the 'total-items' attribute.\n * @returns {number} The total number of items. Defaults to 0 if the attribute is not set or is invalid.\n */\n get totalItems() {\n return +this.getAttribute('total-items') || 0;\n }\n\n /**\n * Sets the visibility of the first button based on the provided value.\n * Adds the 'show-first-button' attribute when the value is truthy, and removes it otherwise.\n * @param {boolean} value Determines whether to show the first button. If true, the 'show-first-button' attribute is added; if false, it is removed.\n */\n set showFirstButton(value) {\n this.removeAttribute('show-first-button');\n\n if (value) {\n this.setAttribute('show-first-button', '');\n }\n }\n\n /**\n * Determines whether the 'show-first-button' attribute is present on the element.\n * @returns {boolean} True if the 'show-first-button' attribute is set; otherwise, false.\n */\n get showFirstButton() {\n return this.hasAttribute('show-first-button');\n }\n\n /**\n * Sets the visibility of the \"last\" button. This method controls the presence\n * or absence of the \"show-last-button\" attribute based on the provided value.\n * @param {boolean} value A boolean value indicating whether to show the \"last\" button.\n * If true, the \"show-last-button\" attribute is added;\n * if false, the attribute is removed.\n */\n set showLastButton(value) {\n this.removeAttribute('show-last-button');\n\n if (value) {\n this.setAttribute('show-last-button', '');\n }\n }\n\n /**\n * Determines if the 'show-last-button' attribute is present on the element.\n * @returns {boolean} True if the 'show-last-button' attribute is present, otherwise false.\n */\n get showLastButton() {\n return this.hasAttribute('show-last-button');\n }\n\n /**\n * Sets the pagination object by calculating the pagination details\n * based on the total items, current page, page size, and maximum pages.\n * @param {object} value The value to set the pagination object. The pagination details are computed internally.\n */\n set paginateObj(value) {\n this._paginateObj = value;\n }\n\n /**\n * Retrieves the pagination object used for managing paginated data.\n * @returns {object} The pagination object containing details and functionality for paginating data.\n */\n get paginateObj() {\n return this._paginateObj;\n }\n\n /**\n * Sets the 'round' attribute on the element. If the provided value is truthy,\n * the 'round' attribute is added. If the value is falsy, the attribute is removed.\n * @param {boolean} value A boolean value determining whether to add or remove the 'round' attribute.\n */\n set round(value) {\n this.removeAttribute('round');\n\n if (value) {\n this.setAttribute('round', '');\n }\n }\n\n /**\n * Retrieves the value of the 'round' attribute for the current element.\n * @returns {boolean} A boolean indicating whether the 'round' attribute is present on the element.\n */\n get round() {\n return this.hasAttribute('round');\n }\n\n /**\n * Sets the `show-info` attribute on the element based on the provided value.\n * @param {boolean} value A boolean indicating whether to add or remove the `show-info` attribute.\n */\n set showInfo(value) {\n this.removeAttribute('show-info');\n\n if (value) {\n this.setAttribute('show-info', '');\n }\n }\n\n /**\n * Retrieves the value of the 'show-info' attribute.\n * Checks if the 'show-info' attribute is present on the element.\n * @returns {boolean} True if the 'show-info' attribute is present, otherwise false.\n */\n get showInfo() {\n return this.hasAttribute('show-info');\n }\n\n set showPageSizeOptions(value) {\n if (!value) return;\n this.setAttribute('show-page-size-options', value);\n }\n\n get showPageSizeOptions() {\n return this.hasAttribute('show-page-size-options');\n }\n\n set pageSizeOptions(value) {\n if (!value) return;\n this.setAttribute('page-size-options', value);\n }\n\n /**\n * Retrieves the list of available page size options.\n * This method is used to fetch the values representing the different page size options\n * that can be provided or configured in a paginated component or system.\n * @returns {Array<number>} An array of numbers representing the selectable page size options.\n */\n get pageSizeOptions() {\n let options = this.getAttribute('page-size-options');\n if (!options) return [6, 10, 50, 100, 500];\n return options.split(',').map((o) => +o).filter((o) => !isNaN(o));\n }\n\n set hideEmpty(value) {\n if (!value) return;\n this.setAttribute('hide-empty', value);\n }\n\n get hideEmpty() {\n return this.hasAttribute('hide-empty');\n }\n\n /**\n * Dependencies of the Button element.\n * @type {object}\n */\n dependencies = {\n 'wje-icon': Icon,\n 'wje-button': Button,\n };\n\n className = 'Pagination';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observedAttributes attribute of the input element.\n * @returns {Array} The attributes to observe for changes.\n */\n static get observedAttributes() {\n return ['page', 'total-items', 'page-size'];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAriaState({\n role: 'navigation',\n });\n }\n\n async beforeDraw() {\n this.classList.remove('empty');\n this.removeAttribute(\"hidden\");\n\n if (!this.totalItems || this.totalItems === 0) {\n this.classList.add('empty');\n if (this.hideEmpty)\n this.setAttribute(\"hidden\", \"\");\n\n return;\n }\n\n this.paginateObj = await paginate(this.totalItems, this.page + 1, this.pageSize, this.maxPages) || {};\n }\n\n /**\n * Creates a document fragment, appends a new slot element to it, and returns the fragment.\n * @returns {DocumentFragment} A document fragment containing a slot element.\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-pagination');\n\n native.append(this.htmlPagination());\n\n fragment.append(native);\n\n return fragment;\n }\n\n /**\n * Creates a pagination control for navigating between pages of content.\n * This method generates and returns a document fragment containing pagination controls, including buttons for navigating to the first, previous, next, and last pages, as well as optional informational text about the current set of displayed items and total number of items.\n * @returns {DocumentFragment} A document fragment containing the pagination controls.\n */\n htmlPagination() {\n let fragment = document.createDocumentFragment();\n\n let select = document.createElement('wje-select');\n select.setAttribute('size', 'small');\n select.setAttribute('variant', 'standard');\n select.setAttribute('value', this.pageSize);\n select.addEventListener('wje-select:change', (e) => {\n\n if(+e.detail.context.value[0] !== this.pageSize) {\n this.pageSize = +e.detail.context.value[0];\n this.page = 0; // Reset to first page when page size changes\n event.dispatchCustomEvent(this, 'wje-pagination:page-change', { page: this.page, pageSize: this.pageSize });\n }\n });\n\n let options = this.pageSizeOptions.map((o) => {\n let option = document.createElement('wje-option');\n option.value = o;\n option.textContent = o;\n return option;\n });\n\n let info = document.createElement('div');\n info.classList.add('info');\n info.innerHTML = `${this.paginateObj?.startIndex + 1} - ${this.paginateObj?.endIndex + 1} ${this.localizer.translate('wj.pagination.of')} ${this.totalItems}`;\n\n let pagination = document.createElement('div');\n pagination.classList.add('pages');\n\n const button = document.createElement('wje-button');\n button.setAttribute('fill', 'link');\n if (this.round) button.setAttribute('round', '');\n\n // First button\n let firstButton = button.cloneNode(true);\n firstButton.title = this.localizer.translate('wj.pagination.first');\n firstButton.setAttribute('aria-label', firstButton.title);\n firstButton.innerHTML = `<wje-icon name=\"chevron-left-pipe\" slot=\"icon-only\"></wje-icon>`;\n firstButton.addEventListener('click', (e) => this.pageClickAction(e, 0));\n\n // Previous button\n const prevButton = button.cloneNode(true);\n prevButton.title = this.localizer.translate('wj.pagination.prev');\n prevButton.setAttribute('aria-label', prevButton.title);\n prevButton.innerHTML = `<wje-icon name=\"chevron-left\" slot=\"icon-only\"></wje-icon>`;\n if (this.page === 0) prevButton.disabled = true;\n prevButton.addEventListener('click', (e) => this.pageClickAction(e, this.page - 1));\n\n // Next button\n const nextButton = button.cloneNode(true);\n nextButton.title = this.localizer.translate('wj.pagination.next');\n nextButton.setAttribute('aria-label', nextButton.title);\n nextButton.innerHTML = `<wje-icon name=\"chevron-right\" slot=\"icon-only\"></wje-icon>`;\n if (this.page + 1 >= this.paginateObj?.totalPages) nextButton.disabled = true;\n nextButton.addEventListener('click', (e) => this.pageClickAction(e, this.page + 1));\n\n // Last button\n let lastButton = button.cloneNode(true);\n lastButton.title = this.localizer.translate('wj.pagination.last');\n lastButton.setAttribute('aria-label', lastButton.title);\n lastButton.innerHTML = `<wje-icon name=\"chevron-right-pipe\" slot=\"icon-only\"></wje-icon>`;\n lastButton.disabled = this.paginateObj?.endIndex + 1 >= this.totalItems;\n lastButton.addEventListener('click', (e) =>\n this.pageClickAction(e, this.paginateObj?.totalPages - 1)\n );\n\n select.append(...options);\n\n if (this.showFirstButton) pagination.appendChild(firstButton);\n pagination.appendChild(prevButton);\n pagination.appendChild(this.htmlStackButtons(this.paginateObj));\n pagination.appendChild(nextButton);\n if (this.showLastButton) pagination.appendChild(lastButton);\n\n if (this.showPageSizeOptions) fragment.append(select);\n if (this.showInfo) fragment.appendChild(info);\n fragment.appendChild(pagination);\n\n return fragment;\n }\n\n /**\n * Creates and returns a DocumentFragment containing a series of buttons for pagination purposes,\n * based on the provided pagination object.\n * @param {object} paginateObj An object containing pagination details.\n * @param {number} paginateObj.currentPage The current active page index (1-based).\n * @param {Array<number>} paginateObj.pages An array of page numbers to display in the pagination.\n * @param {number} paginateObj.totalPages Total number of pages available for pagination.\n * @returns {DocumentFragment} A DocumentFragment containing the buttons and additional pagination elements.\n */\n htmlStackButtons(paginateObj) {\n let fragment = document.createDocumentFragment();\n\n const button = document.createElement('wje-button');\n button.setAttribute('fill', 'link');\n if (this.round) button.setAttribute('round', '');\n\n let dots = document.createElement('span');\n dots.classList.add('dots');\n dots.setAttribute('aria-hidden', 'true');\n\n const first = button.cloneNode(true);\n first.textContent = '1';\n first.addEventListener('click', (e) => this.pageClickAction(e, 0));\n\n const last = button.cloneNode(true);\n last.textContent = paginateObj?.totalPages;\n last.addEventListener('click', (e) => this.pageClickAction(e, paginateObj?.totalPages - 1));\n\n if (paginateObj?.currentPage >= this.maxPages + 1 && paginateObj?.boundary < paginateObj?.totalPages) {\n fragment.appendChild(first);\n fragment.appendChild(dots);\n }\n\n paginateObj?.pages.forEach((page) => {\n let newButton = button.cloneNode(true);\n newButton.textContent = page;\n\n if (page - 1 === this.page) {\n newButton.removeAttribute('fill');\n newButton.setAttribute('aria-current', 'page');\n } else {\n newButton.addEventListener('click', (e) => this.pageClickAction(e, page - 1));\n }\n\n fragment.appendChild(newButton);\n });\n\n if (\n (paginateObj?.pages.length === this.maxPages || paginateObj?.currentPage < this.maxPages + 1) &&\n paginateObj.boundary < paginateObj?.totalPages\n ) {\n fragment.appendChild(dots.cloneNode(true));\n fragment.appendChild(last);\n }\n\n return fragment;\n }\n\n /**\n * Handles the click action for pagination and updates the current page.\n * If the clicked page number is the same as the current page, no action is performed.\n * Otherwise, the current page is updated to the new page number, and a custom event\n * 'wje-pagination:page-change' is dispatched with the pagination object.\n * @param {Event} e The event triggered by the page click.\n * @param {number} page The page number that was clicked.\n */\n pageClickAction = (e, page) => {\n if (+page === this.page || this.page > this.paginateObj.totalPages) return;\n this.page = page;\n event.dispatchCustomEvent(this, 'wje-pagination:page-change', { page: this.page, pageSize: this.pageSize });\n };\n}\n\nPagination.define('wje-pagination', Pagination);\n","import Pagination from './pagination.element.js';\n\nexport default Pagination;\n\nPagination.define('wje-pagination', Pagination);\n"],"names":["_a"],"mappings":";;;;;;;;AAQO,SAAS,SAAS,YAAY,cAAc,GAAG,WAAW,IAAI,WAAW,GAAG;AAE/E,QAAM,aAAa,KAAK,KAAK,aAAa,QAAQ;AAGlD,MAAI,cAAc,GAAG;AACjB,kBAAc;AAAA,EACtB,WAAe,cAAc,YAAY;AACjC,kBAAc;AAAA,EACtB;AAEI,MAAI;AACJ,MAAI;AAEJ,QAAM,eAAe,WAAW;AAEhC,QAAM,WAAW,eAAe;AAEhC,MAAI,aAAa,UAAU;AACvB,QAAI,cAAc,cAAc;AAE5B,kBAAY;AACZ,gBAAU,KAAK,IAAI,eAAe,GAAG,UAAU;AAAA,IAC3D,WAAmB,eAAe,aAAa,cAAc;AAEjD,kBAAY,KAAK,IAAI,aAAa,cAAc,CAAC;AACjD,gBAAU;AAAA,IACtB,OAAe;AACH,YAAM,YAAY,KAAK,MAAM,WAAW,CAAC;AAEzC,kBAAY,cAAc,YAAY;AACtC,gBAAU,WAAW,MAAM,IAAI,cAAc,YAAY,IAAI,cAAc,YAAY;AAAA,IACnG;AAAA,EACA,OAAW;AACH,gBAAY;AACZ,cAAU;AAAA,EAClB;AAGI,QAAM,cAAc,cAAc,KAAK;AACvC,QAAM,WAAW,KAAK,IAAI,aAAa,WAAW,GAAG,aAAa,CAAC;AAGnE,QAAM,QAAQ,MAAM,KAAK,EAAE,QAAQ,UAAU,YAAY,EAAG,GAAE,CAAC,GAAG,MAAM,YAAY,CAAC;AAGrF,SAAO;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAA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,gBAAe,KAAK,WAAW,MAAK,2CAAa,aAAW,2CAAa,aAAY;AAClG,eAAS,YAAY,KAAK;AAC1B,eAAS,YAAY,IAAI;AAAA,IACrC;AAEQ,+CAAa,MAAM,QAAQ,CAAC,SAAS;AACjC,UAAI,YAAY,OAAO,UAAU,IAAI;AACrC,gBAAU,cAAc;AAExB,UAAI,OAAO,MAAM,KAAK,MAAM;AACxB,kBAAU,gBAAgB,MAAM;AAChC,kBAAU,aAAa,gBAAgB,MAAM;AAAA,MAC7D,OAAmB;AACH,kBAAU,iBAAiB,SAAS,CAAC,MAAM,KAAK,gBAAgB,GAAG,OAAO,CAAC,CAAC;AAAA,MAC5F;AAEY,eAAS,YAAY,SAAS;AAAA,IAC1C;AAEQ,UACK,2CAAa,MAAM,YAAW,KAAK,aAAY,2CAAa,eAAc,KAAK,WAAW,MAC3F,YAAY,YAAW,2CAAa,aACtC;AACE,eAAS,YAAY,KAAK,UAAU,IAAI,CAAC;AACzC,eAAS,YAAY,IAAI;AAAA,IACrC;AAEQ,WAAO;AAAA,EACf;AAeA;AAEA,WAAW,OAAO,kBAAkB,UAAU;AC3c9C,WAAW,OAAO,kBAAkB,UAAU;"}
1
+ {"version":3,"file":"wje-pagination.js","sources":["../packages/wje-pagination/service/service.js","../packages/wje-pagination/pagination.element.js","../packages/wje-pagination/pagination.js"],"sourcesContent":["/**\n * Paginates items based on the total number of items, current page, page size, and maximum number of pages to display.\n * @param {number} totalItems The total number of items to paginate.\n * @param {number} [currentPage] The current page number (default is 1).\n * @param {number} [pageSize] The number of items per page (default is 10).\n * @param {number} [maxPages] The maximum number of pages to display in the pagination control (default is 5).\n * @returns {object} An object containing pagination details including total items, current page, page size, total pages, start/end page, start/end index, and the pages array.\n */\nexport function paginate(totalItems, currentPage = 1, pageSize = 10, maxPages = 5) {\n // Calculate total pages\n const totalPages = Math.ceil(totalItems / pageSize);\n\n // Ensure current page is within valid range\n if (currentPage < 1) {\n currentPage = 1;\n } else if (currentPage > totalPages) {\n currentPage = totalPages;\n }\n\n let startPage;\n let endPage;\n\n const pagesNearEnd = maxPages + 1; // Define how close to the end we switch back to 5 pages 4\n\n const boundary = pagesNearEnd + 3;\n\n if (totalPages > boundary) {\n if (currentPage < pagesNearEnd) {\n // If in the first 4 pages, show up to 5 pages\n startPage = 1;\n endPage = Math.min(pagesNearEnd + 1, totalPages); //5\n } else if (currentPage >= totalPages - pagesNearEnd) {\n // If within 4 pages from the end, show last 5 pages\n startPage = Math.max(totalPages - pagesNearEnd, 1); //4\n endPage = totalPages;\n } else {\n const halfPages = Math.floor(maxPages / 2);\n // Otherwise, only show 3 pages (current, previous, next)\n startPage = currentPage - halfPages + 1;\n endPage = maxPages % 2 === 1 ? currentPage + halfPages + 1 : currentPage + halfPages - 1;\n }\n } else {\n startPage = 1;\n endPage = totalPages;\n }\n\n // Calculate start and end item indexes\n const startIndex = (currentPage - 1) * pageSize;\n const endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1);\n\n // Create an array of pages to display\n const pages = Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i);\n\n // Return object with all pager properties (preserving original format)\n return {\n boundary: boundary,\n currentPage: currentPage,\n endIndex: endIndex,\n endPage: endPage,\n totalPages: totalPages,\n pages: pages,\n pageSize: pageSize,\n startIndex: startIndex,\n startPage: startPage,\n totalItems: totalItems,\n };\n}\n","import { Localizer } from '../utils/localize.js';\nimport { default as WJElement, event } from '../wje-element/element.js';\nimport { paginate } from './service/service.js';\nimport Icon from '../wje-icon/icon.js';\nimport Button from '../wje-button/button.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents the Pagination component for navigating through paginated content and dynamically updating navigation elements based on attributes like the number of items, page size, etc. Extends the WJElement class.\n * @documentation https://elements.webjet.sk/components/pagination\n * @status stable\n * @augments WJElement\n * @dependency wje-icon, wje-button\n * @csspart native - The wrapper element for the pagination component.\n */\nexport default class Pagination extends WJElement {\n /**\n * Creates an instance of Pagination.\n */\n constructor() {\n super();\n this.localizer = new Localizer(this);\n\n this._paginateObj = null;\n }\n\n /**\n * Sets the value of the 'page' attribute for the object.\n * @param {string} value The value to set for the 'page' attribute.\n */\n set page(value) {\n this.setAttribute('page', value);\n }\n\n /**\n * Retrieves the current page number as a numeric value.\n * @returns {number} The current page number. Returns 0 if the attribute 'page' is not set or is not a numeric value.\n */\n get page() {\n return +this.getAttribute('page') || 0;\n }\n\n /**\n * Sets the maximum number of pages.\n * Updates the 'max-pages' attribute with the provided value.\n * @param {number|string} value The maximum number of pages to set. Can be a number or a parsable string representing a number.\n */\n set maxPages(value) {\n this.setAttribute('max-pages', value);\n }\n\n /**\n * Gets the maximum number of pages.\n * This getter retrieves the value of the \"max-pages\" attribute from the element.\n * If the attribute is not set or is invalid, it defaults to 3.\n * @returns {number} The maximum number of pages as a numeric value.\n */\n get maxPages() {\n return +this.getAttribute('max-pages') || 10;\n }\n\n /**\n * Sets the `pageSize` attribute to the specified value.\n * @param {number|string} value The desired page size value. This can be a number or a string representation of the size.\n */\n set pageSize(value) {\n this.setAttribute('page-size', value);\n }\n\n /**\n * Retrieves the value of the 'page-size' attribute and converts it to a number.\n * If the attribute is not set or is invalid, returns the default value of 3.\n * @returns {number} The numeric value of the 'page-size' attribute or the default value of 3.\n */\n get pageSize() {\n return +this.getAttribute('page-size') || 3;\n }\n\n /**\n * Sets the total number of items.\n * @param {number} value The new total number of items to set.\n */\n set totalItems(value) {\n this.setAttribute('total-items', value);\n }\n\n /**\n * Retrieves the total number of items represented by the 'total-items' attribute.\n * @returns {number} The total number of items. Defaults to 0 if the attribute is not set or is invalid.\n */\n get totalItems() {\n return +this.getAttribute('total-items') || 0;\n }\n\n /**\n * Sets the visibility of the first button based on the provided value.\n * Adds the 'show-first-button' attribute when the value is truthy, and removes it otherwise.\n * @param {boolean} value Determines whether to show the first button. If true, the 'show-first-button' attribute is added; if false, it is removed.\n */\n set showFirstButton(value) {\n this.removeAttribute('show-first-button');\n\n if (value) {\n this.setAttribute('show-first-button', '');\n }\n }\n\n /**\n * Determines whether the 'show-first-button' attribute is present on the element.\n * @returns {boolean} True if the 'show-first-button' attribute is set; otherwise, false.\n */\n get showFirstButton() {\n return this.hasAttribute('show-first-button');\n }\n\n /**\n * Sets the visibility of the \"last\" button. This method controls the presence\n * or absence of the \"show-last-button\" attribute based on the provided value.\n * @param {boolean} value A boolean value indicating whether to show the \"last\" button.\n * If true, the \"show-last-button\" attribute is added;\n * if false, the attribute is removed.\n */\n set showLastButton(value) {\n this.removeAttribute('show-last-button');\n\n if (value) {\n this.setAttribute('show-last-button', '');\n }\n }\n\n /**\n * Determines if the 'show-last-button' attribute is present on the element.\n * @returns {boolean} True if the 'show-last-button' attribute is present, otherwise false.\n */\n get showLastButton() {\n return this.hasAttribute('show-last-button');\n }\n\n /**\n * Sets the pagination object by calculating the pagination details\n * based on the total items, current page, page size, and maximum pages.\n * @param {object} value The value to set the pagination object. The pagination details are computed internally.\n */\n set paginateObj(value) {\n this._paginateObj = value;\n }\n\n /**\n * Retrieves the pagination object used for managing paginated data.\n * @returns {object} The pagination object containing details and functionality for paginating data.\n */\n get paginateObj() {\n return this._paginateObj;\n }\n\n /**\n * Sets the 'round' attribute on the element. If the provided value is truthy,\n * the 'round' attribute is added. If the value is falsy, the attribute is removed.\n * @param {boolean} value A boolean value determining whether to add or remove the 'round' attribute.\n */\n set round(value) {\n this.removeAttribute('round');\n\n if (value) {\n this.setAttribute('round', '');\n }\n }\n\n /**\n * Retrieves the value of the 'round' attribute for the current element.\n * @returns {boolean} A boolean indicating whether the 'round' attribute is present on the element.\n */\n get round() {\n return this.hasAttribute('round');\n }\n\n /**\n * Sets the `show-info` attribute on the element based on the provided value.\n * @param {boolean} value A boolean indicating whether to add or remove the `show-info` attribute.\n */\n set showInfo(value) {\n this.removeAttribute('show-info');\n\n if (value) {\n this.setAttribute('show-info', '');\n }\n }\n\n /**\n * Retrieves the value of the 'show-info' attribute.\n * Checks if the 'show-info' attribute is present on the element.\n * @returns {boolean} True if the 'show-info' attribute is present, otherwise false.\n */\n get showInfo() {\n return this.hasAttribute('show-info');\n }\n\n set showPageSizeOptions(value) {\n if (!value) return;\n this.setAttribute('show-page-size-options', value);\n }\n\n get showPageSizeOptions() {\n return this.hasAttribute('show-page-size-options');\n }\n\n set pageSizeOptions(value) {\n if (!value) return;\n this.setAttribute('page-size-options', value);\n }\n\n /**\n * Retrieves the list of available page size options.\n * This method is used to fetch the values representing the different page size options\n * that can be provided or configured in a paginated component or system.\n * @returns {Array<number>} An array of numbers representing the selectable page size options.\n */\n get pageSizeOptions() {\n let options = this.getAttribute('page-size-options');\n if (!options) return [6, 10, 50, 100, 500];\n return options.split(',').map((o) => +o).filter((o) => !isNaN(o));\n }\n\n set hideEmpty(value) {\n if (!value) return;\n this.setAttribute('hide-empty', value);\n }\n\n get hideEmpty() {\n return this.hasAttribute('hide-empty');\n }\n\n /**\n * Dependencies of the Button element.\n * @type {object}\n */\n dependencies = {\n 'wje-icon': Icon,\n 'wje-button': Button,\n };\n\n className = 'Pagination';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Getter for the observedAttributes attribute of the input element.\n * @returns {Array} The attributes to observe for changes.\n */\n static get observedAttributes() {\n return ['page', 'total-items', 'page-size'];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAriaState({\n role: 'navigation',\n });\n }\n\n async beforeDraw() {\n this.classList.remove('empty');\n this.removeAttribute(\"hidden\");\n\n if (!this.totalItems || this.totalItems === 0) {\n this.classList.add('empty');\n if (this.hideEmpty)\n this.setAttribute(\"hidden\", \"\");\n\n return;\n }\n\n this.paginateObj = await paginate(this.totalItems, this.page + 1, this.pageSize, this.maxPages) || {};\n }\n\n /**\n * Creates a document fragment, appends a new slot element to it, and returns the fragment.\n * @returns {DocumentFragment} A document fragment containing a slot element.\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-pagination');\n\n native.append(this.htmlPagination());\n\n fragment.append(native);\n\n return fragment;\n }\n\n /**\n * Creates a pagination control for navigating between pages of content.\n * This method generates and returns a document fragment containing pagination controls, including buttons for navigating to the first, previous, next, and last pages, as well as optional informational text about the current set of displayed items and total number of items.\n * @returns {DocumentFragment} A document fragment containing the pagination controls.\n */\n htmlPagination() {\n let fragment = document.createDocumentFragment();\n\n let select = document.createElement('wje-select');\n select.setAttribute('size', 'small');\n select.setAttribute('variant', 'standard');\n select.setAttribute('value', this.pageSize);\n select.addEventListener('wje-select:change', (e) => {\n\n if(+e.detail.context.value[0] !== this.pageSize) {\n this.pageSize = +e.detail.context.value[0];\n this.page = 0; // Reset to first page when page size changes\n event.dispatchCustomEvent(this, 'wje-pagination:page-change', { page: this.page, pageSize: this.pageSize });\n }\n });\n\n let options = this.pageSizeOptions.map((o) => {\n let option = document.createElement('wje-option');\n option.value = o;\n option.textContent = o;\n return option;\n });\n\n let info = document.createElement('div');\n info.classList.add('info');\n info.innerHTML = `${this.paginateObj?.startIndex + 1} - ${this.paginateObj?.endIndex + 1} ${this.localizer.translate('wj.pagination.of')} ${this.totalItems}`;\n\n let pagination = document.createElement('div');\n pagination.classList.add('pages');\n\n const button = document.createElement('wje-button');\n button.setAttribute('fill', 'link');\n if (this.round) button.setAttribute('round', '');\n\n // First button\n let firstButton = button.cloneNode(true);\n firstButton.title = this.localizer.translate('wj.pagination.first');\n firstButton.setAttribute('aria-label', firstButton.title);\n firstButton.innerHTML = `<wje-icon name=\"chevron-left-pipe\" slot=\"icon-only\"></wje-icon>`;\n firstButton.addEventListener('click', (e) => this.pageClickAction(e, 0));\n\n // Previous button\n const prevButton = button.cloneNode(true);\n prevButton.title = this.localizer.translate('wj.pagination.prev');\n prevButton.setAttribute('aria-label', prevButton.title);\n prevButton.innerHTML = `<wje-icon name=\"chevron-left\" slot=\"icon-only\"></wje-icon>`;\n if (this.page === 0) prevButton.disabled = true;\n prevButton.addEventListener('click', (e) => this.pageClickAction(e, this.page - 1));\n\n // Next button\n const nextButton = button.cloneNode(true);\n nextButton.title = this.localizer.translate('wj.pagination.next');\n nextButton.setAttribute('aria-label', nextButton.title);\n nextButton.innerHTML = `<wje-icon name=\"chevron-right\" slot=\"icon-only\"></wje-icon>`;\n if (this.page + 1 >= this.paginateObj?.totalPages) nextButton.disabled = true;\n nextButton.addEventListener('click', (e) => this.pageClickAction(e, this.page + 1));\n\n // Last button\n let lastButton = button.cloneNode(true);\n lastButton.title = this.localizer.translate('wj.pagination.last');\n lastButton.setAttribute('aria-label', lastButton.title);\n lastButton.innerHTML = `<wje-icon name=\"chevron-right-pipe\" slot=\"icon-only\"></wje-icon>`;\n lastButton.disabled = this.paginateObj?.endIndex + 1 >= this.totalItems;\n lastButton.addEventListener('click', (e) =>\n this.pageClickAction(e, this.paginateObj?.totalPages - 1)\n );\n\n select.append(...options);\n\n if (this.showFirstButton) pagination.appendChild(firstButton);\n pagination.appendChild(prevButton);\n pagination.appendChild(this.htmlStackButtons(this.paginateObj));\n pagination.appendChild(nextButton);\n if (this.showLastButton) pagination.appendChild(lastButton);\n\n if (this.showPageSizeOptions) fragment.append(select);\n if (this.showInfo) fragment.appendChild(info);\n fragment.appendChild(pagination);\n\n return fragment;\n }\n\n /**\n * Creates and returns a DocumentFragment containing a series of buttons for pagination purposes,\n * based on the provided pagination object.\n * @param {object} paginateObj An object containing pagination details.\n * @param {number} paginateObj.currentPage The current active page index (1-based).\n * @param {Array<number>} paginateObj.pages An array of page numbers to display in the pagination.\n * @param {number} paginateObj.totalPages Total number of pages available for pagination.\n * @returns {DocumentFragment} A DocumentFragment containing the buttons and additional pagination elements.\n */\n htmlStackButtons(paginateObj) {\n let fragment = document.createDocumentFragment();\n\n const button = document.createElement('wje-button');\n button.setAttribute('fill', 'link');\n if (this.round) button.setAttribute('round', '');\n\n let dots = document.createElement('span');\n dots.classList.add('dots');\n dots.setAttribute('aria-hidden', 'true');\n\n const first = button.cloneNode(true);\n first.textContent = '1';\n first.addEventListener('click', (e) => this.pageClickAction(e, 0));\n\n const last = button.cloneNode(true);\n last.textContent = paginateObj?.totalPages;\n last.addEventListener('click', (e) => this.pageClickAction(e, paginateObj?.totalPages - 1));\n\n if (paginateObj?.currentPage >= this.maxPages + 1 && paginateObj?.boundary < paginateObj?.totalPages) {\n fragment.appendChild(first);\n fragment.appendChild(dots);\n }\n\n paginateObj?.pages.forEach((page) => {\n let newButton = button.cloneNode(true);\n newButton.textContent = page;\n\n if (page - 1 === this.page) {\n newButton.removeAttribute('fill');\n newButton.setAttribute('aria-current', 'page');\n } else {\n newButton.addEventListener('click', (e) => this.pageClickAction(e, page - 1));\n }\n\n fragment.appendChild(newButton);\n });\n\n if (\n (paginateObj?.pages.length === this.maxPages || paginateObj?.currentPage < this.maxPages + 1) &&\n paginateObj.boundary < paginateObj?.totalPages\n ) {\n fragment.appendChild(dots.cloneNode(true));\n fragment.appendChild(last);\n }\n\n return fragment;\n }\n\n /**\n * Handles the click action for pagination and updates the current page.\n * If the clicked page number is the same as the current page, no action is performed.\n * Otherwise, the current page is updated to the new page number, and a custom event\n * 'wje-pagination:page-change' is dispatched with the pagination object.\n * @param {Event} e The event triggered by the page click.\n * @param {number} page The page number that was clicked.\n */\n pageClickAction = (e, page) => {\n if (+page === this.page || this.page > this.paginateObj.totalPages) return;\n this.page = page;\n event.dispatchCustomEvent(this, 'wje-pagination:page-change', { page: this.page, pageSize: this.pageSize });\n };\n}\n\nPagination.define('wje-pagination', Pagination);\n","import Pagination from './pagination.element.js';\n\nexport default Pagination;\n\nPagination.define('wje-pagination', Pagination);\n"],"names":["_a"],"mappings":";;;;;;;;AAQO,SAAS,SAAS,YAAY,cAAc,GAAG,WAAW,IAAI,WAAW,GAAG;AAE/E,QAAM,aAAa,KAAK,KAAK,aAAa,QAAQ;AAGlD,MAAI,cAAc,GAAG;AACjB,kBAAc;AAAA,EAClB,WAAW,cAAc,YAAY;AACjC,kBAAc;A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AK,aAAY,2CAAa,eAAc,KAAK,WAAW,MAC3F,YAAY,YAAW,2CAAa,aACtC;AACE,eAAS,YAAY,KAAK,UAAU,IAAI,CAAC;AACzC,eAAS,YAAY,IAAI;AAAA,IAC7B;AAEA,WAAO;AAAA,EACX;AAeJ;AAEA,WAAW,OAAO,kBAAkB,UAAU;AC3c9C,WAAW,OAAO,kBAAkB,UAAU;"}
package/dist/wje-popup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as Popup } from "./popup.element-Cl6QeG8M.js";
1
+ import { P as Popup } from "./popup.element-DklicGea.js";
2
2
  Popup.define("wje-popup", Popup);
3
3
  export {
4
4
  Popup as default
@@ -1 +1 @@
1
- {"version":3,"file":"wje-progress-bar.js","sources":["../packages/wje-progress-bar/progress-bar.element.js","../packages/wje-progress-bar/progress-bar.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `ProgressBar` is a custom web component that represents a progress bar.\n * @summary This element represents a progress bar.\n * @documentation https://elements.webjet.sk/components/progress-bar\n * @status stable\n * @augments {WJElement}\n * @slot - The default slot for the progress bar.\n * @slot start - The start slot of the progress bar.\n * @slot end - The end slot of the progress bar.\n * @cssproperty [--wje-progress-bar-color=var(--wje-color-contrast-6)] - Sets the color of the progress bar. This property controls the fill color of the progress indicator. Accepts any valid CSS color value, such as named colors (`red`), hex values (`#ff0000`), or CSS variables.\n * @cssproperty [--wje-progress-bar-text-size=.75rem] - Defines the font size of the text displayed within the progress bar. Accepts any valid CSS length unit (e.g., `rem`, `px`, `em`) to control text size relative to the bar's design.\n * @cssproperty [--wje-progress-bar-text-color=var(--wje-color)] - Specifies the color of the text displayed within the progress bar. Accepts any valid CSS color value to ensure contrast and readability against the progress bar's background.\n * @tag wje-progress-bar\n */\nexport default class ProgressBar extends WJElement {\n /**\n * Creates an instance of ProgressBar.\n * @class\n */\n constructor() {\n super();\n }\n\n /**\n * Sets the radius of the progress bar.\n * @param {number} value The value to set.\n */\n set radius(value) {\n this.setAttribute('radius', value);\n }\n\n /**\n * Gets the radius of the progress bar.\n * @returns {number} The value of the radius.\n */\n get radius() {\n return +this.getAttribute('radius') || 70;\n }\n\n /**\n * Gets the diameter of the progress bar.\n * @returns {number} The value of the diameter.\n */\n get diameter() {\n return this.radius * 2;\n }\n\n /**\n * Gets the diameter of the progress bar.\n * @returns {number} The value of the diameter.\n */\n get containerSize() {\n return this.diameter + 2 * this.stroke;\n }\n\n /**\n * Sets the stroke of the progress bar.\n * @param {number} value The value to set.\n */\n set stroke(value) {\n this.setAttribute('stroke', value);\n }\n\n /**\n * Gets the stroke of the progress bar.\n * @returns {number} The value of the stroke.\n */\n get stroke() {\n return +this.getAttribute('stroke') || 6;\n }\n\n /**\n * Gets the linecap of the progress bar.\n * @returns {string} The value of the linecap.\n */\n get linecap() {\n return this.getAttribute('linecap') || 'square';\n }\n\n className = 'ProgressBar';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return ['progress'];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Draws the component.\n * @param {object} context The context for drawing.\n * @param {object} store The store for drawing.\n * @param {object} params The parameters for drawing.\n * @returns {DocumentFragment}\n */\n draw(context, store, params) {\n let xy = this.radius + this.stroke / 2;\n\n let fragment = document.createDocumentFragment();\n\n if (params.color) this.classList.add('wje-color');\n\n let element = document.createElement('div');\n element.classList.add('progress');\n\n let slot = document.createElement('slot');\n\n let slotWrapper = document.createElement('div');\n slotWrapper.classList.add('slot-wrapper');\n\n let slotStart = document.createElement('slot');\n slotStart.setAttribute('name', 'start');\n\n let slotEnd = document.createElement('slot');\n slotEnd.setAttribute('name', 'end');\n\n const svgNamespace = 'http://www.w3.org/2000/svg';\n\n let svg = document.createElementNS(svgNamespace, 'svg');\n\n let background;\n let bar;\n\n if (this?.type === 'circle') {\n svg.setAttribute('width', this.containerSize);\n svg.setAttribute('height', this.containerSize);\n svg.setAttribute('viewBox', `0 0 ${this.containerSize} ${this.containerSize}`);\n svg.setAttribute('style', 'transform: rotate(-90deg)');\n\n background = document.createElementNS(svgNamespace, 'circle');\n background.setAttribute('stroke', 'var(--wje-progress-bar-background-color)');\n background.setAttribute('stroke-width', this.stroke);\n background.setAttribute('fill', 'transparent');\n background.setAttribute('r', this.radius);\n background.setAttribute('cx', this.containerSize / 2);\n background.setAttribute('cy', this.containerSize / 2);\n\n bar = document.createElementNS(svgNamespace, 'circle');\n bar.setAttribute('stroke', 'var(--wje-progress-bar-color)');\n bar.setAttribute('stroke-width', this.stroke);\n bar.setAttribute('fill', 'transparent');\n bar.setAttribute('r', this.radius);\n bar.setAttribute('cx', this.containerSize / 2);\n bar.setAttribute('cy', this.containerSize / 2);\n bar.setAttribute('stroke-linecap', this.linecap);\n\n let text = document.createElementNS(svgNamespace, 'text');\n text.setAttribute('x', '50%');\n text.setAttribute('y', '50%');\n text.innerHTML = this.progress + '%';\n\n svg.appendChild(text);\n } else {\n svg.setAttribute('width', '100%');\n svg.setAttribute('height', this.stroke);\n svg.setAttribute('preserveAspectRatio', 'none');\n\n background = document.createElementNS(svgNamespace, 'rect');\n background.setAttribute('x', 0);\n background.setAttribute('y', 0);\n background.setAttribute('width', '100%');\n background.setAttribute('height', this.stroke);\n if (this.linecap === 'round') {\n background.setAttribute('rx', this.stroke / 2);\n background.setAttribute('ry', this.stroke / 2);\n }\n\n bar = document.createElementNS(svgNamespace, 'rect');\n bar.setAttribute('x', 0);\n bar.setAttribute('y', 0);\n bar.setAttribute('width', this.progress + '%');\n bar.setAttribute('height', this.stroke);\n bar.setAttribute('id', 'bar');\n\n if (this.linecap === 'round') {\n bar.setAttribute('rx', this.stroke / 2);\n bar.setAttribute('ry', this.stroke / 2);\n }\n }\n\n svg.appendChild(background);\n svg.appendChild(bar);\n\n slotWrapper.appendChild(slot);\n\n element.appendChild(slotStart);\n element.appendChild(slotWrapper);\n element.appendChild(svg);\n element.appendChild(slotEnd);\n\n fragment.appendChild(element);\n\n this.background = background;\n this.bar = bar;\n\n return fragment;\n }\n\n /**\n * Handles attribute changes for ARIA sync.\n * @param {string} name\n * @param {string|null} oldValue\n * @param {string|null} newValue\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (super.attributeChangedCallback) {\n super.attributeChangedCallback(name, oldValue, newValue);\n }\n\n if (name === 'progress' && oldValue !== newValue) {\n this.syncAria();\n }\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n this.setAriaState({\n role: 'progressbar',\n valuemin: 0,\n valuemax: 100,\n valuenow: this.progress || 0,\n });\n }\n\n /**\n * Adds event listeners after the component is drawn.\n */\n afterDraw() {\n if (this.type === 'circle') {\n this.setCircleProgress(this.progress);\n }\n }\n\n /**\n * Returns the dasharray for a circle with the given radius.\n * @param {number} radius The radius of the circle in pixels.\n * @returns {number} The dasharray value.\n */\n getCircleDasharray(radius = 70) {\n return 2 * Math.PI * radius;\n }\n\n /**\n * Returns the dashoffset for a circle with the given progress and radius.\n * @param {number} progress The progress of the circle in percentage.\n * @param {number} radius The radius of the circle in pixels.\n * @returns {number} The dashoffset value.\n */\n getCircleDashoffset(progress = 0, radius = 70) {\n return this.getCircleDasharray(radius) * ((100 - progress) / 100);\n }\n\n /**\n * Sets the progress of the circle.\n * @param percent\n */\n setCircleProgress(percent) {\n const progress = this.bar;\n const radius = progress.r.baseVal.value;\n const circumference = 2 * Math.PI * radius;\n\n progress.style.strokeDasharray = `${circumference}`;\n const offset = circumference - (percent / 100) * circumference;\n progress.style.strokeDashoffset = offset;\n }\n}\n","import ProgressBar from './progress-bar.element.js';\n\nexport default ProgressBar;\n\nProgressBar.define('wje-progress-bar', ProgressBar);\n"],"names":[],"mappings":";;;;;AAiBe,MAAM,oBAAoB,UAAU;AAAA;AAAA;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AA0B;AAChC,YAAM,yBAAyB,MAAM,UAAU,QAAQ;AAAA,IACnE;AAEQ,QAAI,SAAS,cAAc,aAAa,UAAU;AAC9C,WAAK,SAAU;AAAA,IAC3B;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKI,WAAW;AACP,SAAK,aAAa;AAAA,MACd,MAAM;AAAA,MACN,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU,KAAK,YAAY;AAAA,IACvC,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKI,YAAY;AACR,QAAI,KAAK,SAAS,UAAU;AACxB,WAAK,kBAAkB,KAAK,QAAQ;AAAA,IAChD;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,mBAAmB,SAAS,IAAI;AAC5B,WAAO,IAAI,KAAK,KAAK;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,oBAAoB,WAAW,GAAG,SAAS,IAAI;AAC3C,WAAO,KAAK,mBAAmB,MAAM,MAAM,MAAM,YAAY;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,kBAAkB,SAAS;AACvB,UAAM,WAAW,KAAK;AACtB,UAAM,SAAS,SAAS,EAAE,QAAQ;AAClC,UAAM,gBAAgB,IAAI,KAAK,KAAK;AAEpC,aAAS,MAAM,kBAAkB,GAAG,aAAa;AACjD,UAAM,SAAS,gBAAiB,UAAU,MAAO;AACjD,aAAS,MAAM,mBAAmB;AAAA,EAC1C;AACA;AC7RA,YAAY,OAAO,oBAAoB,WAAW;"}
1
+ {"version":3,"file":"wje-progress-bar.js","sources":["../packages/wje-progress-bar/progress-bar.element.js","../packages/wje-progress-bar/progress-bar.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `ProgressBar` is a custom web component that represents a progress bar.\n * @summary This element represents a progress bar.\n * @documentation https://elements.webjet.sk/components/progress-bar\n * @status stable\n * @augments {WJElement}\n * @slot - The default slot for the progress bar.\n * @slot start - The start slot of the progress bar.\n * @slot end - The end slot of the progress bar.\n * @cssproperty [--wje-progress-bar-color=var(--wje-color-contrast-6)] - Sets the color of the progress bar. This property controls the fill color of the progress indicator. Accepts any valid CSS color value, such as named colors (`red`), hex values (`#ff0000`), or CSS variables.\n * @cssproperty [--wje-progress-bar-text-size=.75rem] - Defines the font size of the text displayed within the progress bar. Accepts any valid CSS length unit (e.g., `rem`, `px`, `em`) to control text size relative to the bar's design.\n * @cssproperty [--wje-progress-bar-text-color=var(--wje-color)] - Specifies the color of the text displayed within the progress bar. Accepts any valid CSS color value to ensure contrast and readability against the progress bar's background.\n * @tag wje-progress-bar\n */\nexport default class ProgressBar extends WJElement {\n /**\n * Creates an instance of ProgressBar.\n * @class\n */\n constructor() {\n super();\n }\n\n /**\n * Sets the radius of the progress bar.\n * @param {number} value The value to set.\n */\n set radius(value) {\n this.setAttribute('radius', value);\n }\n\n /**\n * Gets the radius of the progress bar.\n * @returns {number} The value of the radius.\n */\n get radius() {\n return +this.getAttribute('radius') || 70;\n }\n\n /**\n * Gets the diameter of the progress bar.\n * @returns {number} The value of the diameter.\n */\n get diameter() {\n return this.radius * 2;\n }\n\n /**\n * Gets the diameter of the progress bar.\n * @returns {number} The value of the diameter.\n */\n get containerSize() {\n return this.diameter + 2 * this.stroke;\n }\n\n /**\n * Sets the stroke of the progress bar.\n * @param {number} value The value to set.\n */\n set stroke(value) {\n this.setAttribute('stroke', value);\n }\n\n /**\n * Gets the stroke of the progress bar.\n * @returns {number} The value of the stroke.\n */\n get stroke() {\n return +this.getAttribute('stroke') || 6;\n }\n\n /**\n * Gets the linecap of the progress bar.\n * @returns {string} The value of the linecap.\n */\n get linecap() {\n return this.getAttribute('linecap') || 'square';\n }\n\n className = 'ProgressBar';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return ['progress'];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.syncAria();\n }\n\n /**\n * Draws the component.\n * @param {object} context The context for drawing.\n * @param {object} store The store for drawing.\n * @param {object} params The parameters for drawing.\n * @returns {DocumentFragment}\n */\n draw(context, store, params) {\n let xy = this.radius + this.stroke / 2;\n\n let fragment = document.createDocumentFragment();\n\n if (params.color) this.classList.add('wje-color');\n\n let element = document.createElement('div');\n element.classList.add('progress');\n\n let slot = document.createElement('slot');\n\n let slotWrapper = document.createElement('div');\n slotWrapper.classList.add('slot-wrapper');\n\n let slotStart = document.createElement('slot');\n slotStart.setAttribute('name', 'start');\n\n let slotEnd = document.createElement('slot');\n slotEnd.setAttribute('name', 'end');\n\n const svgNamespace = 'http://www.w3.org/2000/svg';\n\n let svg = document.createElementNS(svgNamespace, 'svg');\n\n let background;\n let bar;\n\n if (this?.type === 'circle') {\n svg.setAttribute('width', this.containerSize);\n svg.setAttribute('height', this.containerSize);\n svg.setAttribute('viewBox', `0 0 ${this.containerSize} ${this.containerSize}`);\n svg.setAttribute('style', 'transform: rotate(-90deg)');\n\n background = document.createElementNS(svgNamespace, 'circle');\n background.setAttribute('stroke', 'var(--wje-progress-bar-background-color)');\n background.setAttribute('stroke-width', this.stroke);\n background.setAttribute('fill', 'transparent');\n background.setAttribute('r', this.radius);\n background.setAttribute('cx', this.containerSize / 2);\n background.setAttribute('cy', this.containerSize / 2);\n\n bar = document.createElementNS(svgNamespace, 'circle');\n bar.setAttribute('stroke', 'var(--wje-progress-bar-color)');\n bar.setAttribute('stroke-width', this.stroke);\n bar.setAttribute('fill', 'transparent');\n bar.setAttribute('r', this.radius);\n bar.setAttribute('cx', this.containerSize / 2);\n bar.setAttribute('cy', this.containerSize / 2);\n bar.setAttribute('stroke-linecap', this.linecap);\n\n let text = document.createElementNS(svgNamespace, 'text');\n text.setAttribute('x', '50%');\n text.setAttribute('y', '50%');\n text.innerHTML = this.progress + '%';\n\n svg.appendChild(text);\n } else {\n svg.setAttribute('width', '100%');\n svg.setAttribute('height', this.stroke);\n svg.setAttribute('preserveAspectRatio', 'none');\n\n background = document.createElementNS(svgNamespace, 'rect');\n background.setAttribute('x', 0);\n background.setAttribute('y', 0);\n background.setAttribute('width', '100%');\n background.setAttribute('height', this.stroke);\n if (this.linecap === 'round') {\n background.setAttribute('rx', this.stroke / 2);\n background.setAttribute('ry', this.stroke / 2);\n }\n\n bar = document.createElementNS(svgNamespace, 'rect');\n bar.setAttribute('x', 0);\n bar.setAttribute('y', 0);\n bar.setAttribute('width', this.progress + '%');\n bar.setAttribute('height', this.stroke);\n bar.setAttribute('id', 'bar');\n\n if (this.linecap === 'round') {\n bar.setAttribute('rx', this.stroke / 2);\n bar.setAttribute('ry', this.stroke / 2);\n }\n }\n\n svg.appendChild(background);\n svg.appendChild(bar);\n\n slotWrapper.appendChild(slot);\n\n element.appendChild(slotStart);\n element.appendChild(slotWrapper);\n element.appendChild(svg);\n element.appendChild(slotEnd);\n\n fragment.appendChild(element);\n\n this.background = background;\n this.bar = bar;\n\n return fragment;\n }\n\n /**\n * Handles attribute changes for ARIA sync.\n * @param {string} name\n * @param {string|null} oldValue\n * @param {string|null} newValue\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (super.attributeChangedCallback) {\n super.attributeChangedCallback(name, oldValue, newValue);\n }\n\n if (name === 'progress' && oldValue !== newValue) {\n this.syncAria();\n }\n }\n\n /**\n * Sync ARIA attributes on host.\n */\n syncAria() {\n this.setAriaState({\n role: 'progressbar',\n valuemin: 0,\n valuemax: 100,\n valuenow: this.progress || 0,\n });\n }\n\n /**\n * Adds event listeners after the component is drawn.\n */\n afterDraw() {\n if (this.type === 'circle') {\n this.setCircleProgress(this.progress);\n }\n }\n\n /**\n * Returns the dasharray for a circle with the given radius.\n * @param {number} radius The radius of the circle in pixels.\n * @returns {number} The dasharray value.\n */\n getCircleDasharray(radius = 70) {\n return 2 * Math.PI * radius;\n }\n\n /**\n * Returns the dashoffset for a circle with the given progress and radius.\n * @param {number} progress The progress of the circle in percentage.\n * @param {number} radius The radius of the circle in pixels.\n * @returns {number} The dashoffset value.\n */\n getCircleDashoffset(progress = 0, radius = 70) {\n return this.getCircleDasharray(radius) * ((100 - progress) / 100);\n }\n\n /**\n * Sets the progress of the circle.\n * @param percent\n */\n setCircleProgress(percent) {\n const progress = this.bar;\n const radius = progress.r.baseVal.value;\n const circumference = 2 * Math.PI * radius;\n\n progress.style.strokeDasharray = `${circumference}`;\n const offset = circumference - (percent / 100) * circumference;\n progress.style.strokeDashoffset = offset;\n }\n}\n","import ProgressBar from './progress-bar.element.js';\n\nexport default ProgressBar;\n\nProgressBar.define('wje-progress-bar', ProgressBar);\n"],"names":[],"mappings":";;;;;AAiBe,MAAM,oBAAoB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK/C,cAAc;AACV,UAAK;AA2DT,qCAAY;AAAA,EA1DZ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,OAAO,OAAO;AACd,SAAK,aAAa,UAAU,KAAK;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,SAAS;AACT,WAAO,CAAC,KAAK,aAAa,QAAQ,KAAK;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,WAAW;AACX,WAAO,KAAK,SAAS;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,gBAAgB;AAChB,WAAO,KAAK,WAAW,IAAI,KAAK;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,OAAO,OAAO;AACd,SAAK,aAAa,UAAU,KAAK;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,SAAS;AACT,WAAO,CAAC,KAAK,aAAa,QAAQ,KAAK;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA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AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,kBAAkB,SAAS;AACvB,UAAM,WAAW,KAAK;AACtB,UAAM,SAAS,SAAS,EAAE,QAAQ;AAClC,UAAM,gBAAgB,IAAI,KAAK,KAAK;AAEpC,aAAS,MAAM,kBAAkB,GAAG,aAAa;AACjD,UAAM,SAAS,gBAAiB,UAAU,MAAO;AACjD,aAAS,MAAM,mBAAmB;AAAA,EACtC;AACJ;AC7RA,YAAY,OAAO,oBAAoB,WAAW;"}
@@ -12,10 +12,10 @@ var hasRequiredQrious;
12
12
  function requireQrious() {
13
13
  if (hasRequiredQrious) return qrious$1.exports;
14
14
  hasRequiredQrious = 1;
15
- (function(module, exports) {
15
+ (function(module, exports$1) {
16
16
  (function(global, factory) {
17
17
  module.exports = factory();
18
- })(qrious, function() {
18
+ })(qrious, (function() {
19
19
  var Constructor = (
20
20
  /* istanbul ignore next */
21
21
  function() {
@@ -2795,7 +2795,7 @@ function requireQrious() {
2795
2795
  index.use(new BrowserElementService_1());
2796
2796
  var QRious_1 = index;
2797
2797
  return QRious_1;
2798
- });
2798
+ }));
2799
2799
  })(qrious$1);
2800
2800
  return qrious$1.exports;
2801
2801
  }