wj-elements 0.1.136 → 0.1.138

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 (422) hide show
  1. package/dist/dark.css +223 -0
  2. package/dist/infinite-scroll.element-XVJukzjy.js +272 -0
  3. package/dist/infinite-scroll.element-XVJukzjy.js.map +1 -0
  4. package/dist/light.css +534 -0
  5. package/dist/list.element-Ce1vIm1O.js +50 -0
  6. package/dist/list.element-Ce1vIm1O.js.map +1 -0
  7. package/dist/localize.js +70 -0
  8. package/dist/localize.js.map +1 -0
  9. package/dist/packages/index.d.ts +102 -0
  10. package/dist/packages/localize/localize.d.ts +17 -0
  11. package/dist/packages/translations/en-gb.d.ts +13 -0
  12. package/dist/packages/translations/sk-sk.d.ts +13 -0
  13. package/dist/packages/utils/animations.d.ts +2 -0
  14. package/dist/packages/utils/date.d.ts +1 -0
  15. package/dist/packages/utils/element-utils.d.ts +46 -0
  16. package/dist/packages/utils/event.d.ts +67 -0
  17. package/dist/packages/utils/localize.d.ts +4 -0
  18. package/dist/packages/utils/permissions-api.d.ts +34 -0
  19. package/dist/packages/utils/utils.d.ts +1 -0
  20. package/dist/packages/utils/wje-import-firefox.d.ts +0 -0
  21. package/dist/packages/utils/wje-import.d.ts +0 -0
  22. package/dist/packages/wje-accordion/accordion.d.ts +2 -0
  23. package/dist/packages/wje-accordion/accordion.element.d.ts +72 -0
  24. package/dist/packages/wje-accordion-item/accordion-item.d.ts +2 -0
  25. package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +40 -0
  26. package/dist/packages/wje-animation/animation.d.ts +2 -0
  27. package/dist/packages/wje-animation/animation.element.d.ts +153 -0
  28. package/dist/packages/wje-animation/animation.test.d.ts +1 -0
  29. package/dist/packages/wje-aside/aside.d.ts +2 -0
  30. package/dist/packages/wje-aside/aside.element.d.ts +31 -0
  31. package/dist/packages/wje-avatar/avatar.d.ts +2 -0
  32. package/dist/packages/wje-avatar/avatar.element.d.ts +37 -0
  33. package/dist/packages/wje-avatar/service/service.d.ts +40 -0
  34. package/dist/packages/wje-badge/badge.d.ts +2 -0
  35. package/dist/packages/wje-badge/badge.element.d.ts +35 -0
  36. package/dist/packages/wje-badge/badge.test.d.ts +1 -0
  37. package/dist/packages/wje-breadcrumb/breadcrumb.d.ts +2 -0
  38. package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +80 -0
  39. package/dist/packages/wje-breadcrumbs/breadcrumbs.d.ts +2 -0
  40. package/dist/packages/wje-breadcrumbs/breadcrumbs.element.d.ts +97 -0
  41. package/dist/packages/wje-breadcrumbs/breadcrumbs.test.d.ts +1 -0
  42. package/dist/packages/wje-button/button.d.ts +2 -0
  43. package/dist/packages/wje-button/button.element.d.ts +173 -0
  44. package/dist/packages/wje-button/button.test.d.ts +1 -0
  45. package/dist/packages/wje-button-group/button-group.d.ts +2 -0
  46. package/dist/packages/wje-button-group/button-group.element.d.ts +39 -0
  47. package/dist/packages/wje-card/card.d.ts +2 -0
  48. package/dist/packages/wje-card/card.element.d.ts +29 -0
  49. package/dist/packages/wje-card-content/card-content.d.ts +2 -0
  50. package/dist/packages/wje-card-content/card-content.element.d.ts +22 -0
  51. package/dist/packages/wje-card-controls/card-controls.d.ts +2 -0
  52. package/dist/packages/wje-card-controls/card-controls.element.d.ts +23 -0
  53. package/dist/packages/wje-card-header/card-header.d.ts +2 -0
  54. package/dist/packages/wje-card-header/card-header.element.d.ts +22 -0
  55. package/dist/packages/wje-card-subtitle/card-subtitle.d.ts +2 -0
  56. package/dist/packages/wje-card-subtitle/card-subtitle.element.d.ts +30 -0
  57. package/dist/packages/wje-card-title/card-title.d.ts +2 -0
  58. package/dist/packages/wje-card-title/card-title.element.d.ts +32 -0
  59. package/dist/packages/wje-carousel/carousel.d.ts +2 -0
  60. package/dist/packages/wje-carousel/carousel.element.d.ts +146 -0
  61. package/dist/packages/wje-carousel-item/carousel-item.d.ts +2 -0
  62. package/dist/packages/wje-carousel-item/carousel-item.element.d.ts +38 -0
  63. package/dist/packages/wje-checkbox/checkbox.d.ts +2 -0
  64. package/dist/packages/wje-checkbox/checkbox.element.d.ts +171 -0
  65. package/dist/packages/wje-chip/chip.d.ts +2 -0
  66. package/dist/packages/wje-chip/chip.element.d.ts +29 -0
  67. package/dist/packages/wje-col/col.d.ts +2 -0
  68. package/dist/packages/wje-col/col.element.d.ts +16 -0
  69. package/dist/packages/wje-color-picker/color-picker.d.ts +2 -0
  70. package/dist/packages/wje-color-picker/color-picker.element.d.ts +187 -0
  71. package/dist/packages/wje-container/container.d.ts +2 -0
  72. package/dist/packages/wje-container/container.element.d.ts +31 -0
  73. package/dist/packages/wje-copy-button/copy-button.d.ts +2 -0
  74. package/dist/packages/wje-copy-button/copy-button.element.d.ts +89 -0
  75. package/dist/packages/wje-copy-button/service/service.d.ts +12 -0
  76. package/dist/packages/wje-dialog/dialog.d.ts +2 -0
  77. package/dist/packages/wje-dialog/dialog.element.d.ts +116 -0
  78. package/dist/packages/wje-divider/divider.d.ts +2 -0
  79. package/dist/packages/wje-divider/divider.element.d.ts +32 -0
  80. package/dist/packages/wje-dropdown/dropdown.d.ts +2 -0
  81. package/dist/packages/wje-dropdown/dropdown.element.d.ts +85 -0
  82. package/dist/packages/wje-element/element.d.ts +313 -0
  83. package/dist/packages/wje-element/service/universal-service.d.ts +18 -0
  84. package/dist/packages/wje-file-upload/file-upload.d.ts +2 -0
  85. package/dist/packages/wje-file-upload/file-upload.element.d.ts +191 -0
  86. package/dist/packages/wje-file-upload/service/service.d.ts +70 -0
  87. package/dist/packages/wje-file-upload-item/file-upload-item.d.ts +2 -0
  88. package/dist/packages/wje-file-upload-item/file-upload-item.element.d.ts +64 -0
  89. package/dist/packages/wje-footer/footer.d.ts +2 -0
  90. package/dist/packages/wje-footer/footer.element.d.ts +28 -0
  91. package/dist/packages/wje-form/form.d.ts +2 -0
  92. package/dist/packages/wje-form/form.element.d.ts +28 -0
  93. package/dist/packages/wje-format-digital/format-digital.d.ts +2 -0
  94. package/dist/packages/wje-format-digital/format-digital.element.d.ts +87 -0
  95. package/dist/packages/wje-format-digital/format-digital.test.d.ts +1 -0
  96. package/dist/packages/wje-grid/grid.d.ts +2 -0
  97. package/dist/packages/wje-grid/grid.element.d.ts +26 -0
  98. package/dist/packages/wje-header/header.d.ts +2 -0
  99. package/dist/packages/wje-header/header.element.d.ts +35 -0
  100. package/dist/packages/wje-icon/icon.d.ts +2 -0
  101. package/dist/packages/wje-icon/icon.element.d.ts +40 -0
  102. package/dist/packages/wje-icon/service/service.d.ts +11 -0
  103. package/dist/packages/wje-icon-picker/icon-picker.d.ts +2 -0
  104. package/dist/packages/wje-icon-picker/icon-picker.element.d.ts +197 -0
  105. package/dist/packages/wje-img/img.d.ts +2 -0
  106. package/dist/packages/wje-img/img.element.d.ts +36 -0
  107. package/dist/packages/wje-img-comparer/img-comparer.d.ts +2 -0
  108. package/dist/packages/wje-img-comparer/img-comparer.element.d.ts +60 -0
  109. package/dist/packages/wje-img-comparer/service/service.d.ts +1 -0
  110. package/dist/packages/wje-infinite-scroll/infinite-scroll.d.ts +2 -0
  111. package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +134 -0
  112. package/dist/packages/wje-input/input.d.ts +2 -0
  113. package/dist/packages/wje-input/input.element.d.ts +204 -0
  114. package/dist/packages/wje-input-file/input-file.d.ts +2 -0
  115. package/dist/packages/wje-input-file/input-file.element.d.ts +50 -0
  116. package/dist/packages/wje-item/item.d.ts +2 -0
  117. package/dist/packages/wje-item/item.element.d.ts +68 -0
  118. package/dist/packages/wje-kanban/kanban.d.ts +2 -0
  119. package/dist/packages/wje-kanban/kanban.element.d.ts +183 -0
  120. package/dist/packages/wje-label/label.d.ts +2 -0
  121. package/dist/packages/wje-label/label.element.d.ts +34 -0
  122. package/dist/packages/wje-list/list.d.ts +2 -0
  123. package/dist/packages/wje-list/list.element.d.ts +31 -0
  124. package/dist/packages/wje-main/main.d.ts +2 -0
  125. package/dist/packages/wje-main/main.element.d.ts +30 -0
  126. package/dist/packages/wje-masonry/masonry.d.ts +2 -0
  127. package/dist/packages/wje-masonry/masonry.element.d.ts +114 -0
  128. package/dist/packages/wje-masonry/service/service.d.ts +32 -0
  129. package/dist/packages/wje-menu/menu.d.ts +2 -0
  130. package/dist/packages/wje-menu/menu.element.d.ts +47 -0
  131. package/dist/packages/wje-menu-button/menu-button.d.ts +2 -0
  132. package/dist/packages/wje-menu-button/menu-button.element.d.ts +34 -0
  133. package/dist/packages/wje-menu-item/menu-item.d.ts +2 -0
  134. package/dist/packages/wje-menu-item/menu-item.element.d.ts +139 -0
  135. package/dist/packages/wje-menu-label/menu-label.d.ts +2 -0
  136. package/dist/packages/wje-menu-label/menu-label.element.d.ts +39 -0
  137. package/dist/packages/wje-option/option.d.ts +2 -0
  138. package/dist/packages/wje-option/option.element.d.ts +59 -0
  139. package/dist/packages/wje-options/options.d.ts +2 -0
  140. package/dist/packages/wje-options/options.element.d.ts +183 -0
  141. package/dist/packages/wje-orgchart/orgchart.d.ts +2 -0
  142. package/dist/packages/wje-orgchart/orgchart.element.d.ts +24 -0
  143. package/dist/packages/wje-orgchart-group/orgchart-group.d.ts +2 -0
  144. package/dist/packages/wje-orgchart-group/orgchart-group.element.d.ts +28 -0
  145. package/dist/packages/wje-orgchart-item/orgchart-item.d.ts +2 -0
  146. package/dist/packages/wje-orgchart-item/orgchart-item.element.d.ts +49 -0
  147. package/dist/packages/wje-panel/panel.d.ts +2 -0
  148. package/dist/packages/wje-panel/panel.element.d.ts +34 -0
  149. package/dist/packages/wje-popup/popup.d.ts +2 -0
  150. package/dist/packages/wje-popup/popup.element.d.ts +93 -0
  151. package/dist/packages/wje-progress-bar/progress-bar.d.ts +2 -0
  152. package/dist/packages/wje-progress-bar/progress-bar.element.d.ts +96 -0
  153. package/dist/packages/wje-qr-code/qr-code.d.ts +2 -0
  154. package/dist/packages/wje-qr-code/qr-code.element.d.ts +33 -0
  155. package/dist/packages/wje-radio/radio.d.ts +2 -0
  156. package/dist/packages/wje-radio/radio.element.d.ts +53 -0
  157. package/dist/packages/wje-radio-group/radio-group.d.ts +2 -0
  158. package/dist/packages/wje-radio-group/radio-group.element.d.ts +137 -0
  159. package/dist/packages/wje-rate/rate.d.ts +2 -0
  160. package/dist/packages/wje-rate/rate.element.d.ts +156 -0
  161. package/dist/packages/wje-relative-time/relative-time.d.ts +2 -0
  162. package/dist/packages/wje-relative-time/relative-time.element.d.ts +55 -0
  163. package/dist/packages/wje-relative-time/relative-time.test.d.ts +1 -0
  164. package/dist/packages/wje-reorder/reorder.d.ts +2 -0
  165. package/dist/packages/wje-reorder/reorder.element.d.ts +119 -0
  166. package/dist/packages/wje-reorder-dropzone/reorder-dropzone.d.ts +2 -0
  167. package/dist/packages/wje-reorder-dropzone/reorder-dropzone.element.d.ts +23 -0
  168. package/dist/packages/wje-reorder-handle/reorder-handle.d.ts +2 -0
  169. package/dist/packages/wje-reorder-handle/reorder-handle.element.d.ts +75 -0
  170. package/dist/packages/wje-reorder-item/reorder-item.d.ts +2 -0
  171. package/dist/packages/wje-reorder-item/reorder-item.element.d.ts +24 -0
  172. package/dist/packages/wje-route/route.d.ts +2 -0
  173. package/dist/packages/wje-route/route.element.d.ts +22 -0
  174. package/dist/packages/wje-router/router.d.ts +2 -0
  175. package/dist/packages/wje-router/router.element.d.ts +39 -0
  176. package/dist/packages/wje-router-link/router-link.d.ts +2 -0
  177. package/dist/packages/wje-router-link/router-link.element.d.ts +31 -0
  178. package/dist/packages/wje-router-outlet/router-outlet.d.ts +2 -0
  179. package/dist/packages/wje-router-outlet/router-outlet.element.d.ts +15 -0
  180. package/dist/packages/wje-row/row.d.ts +2 -0
  181. package/dist/packages/wje-row/row.element.d.ts +23 -0
  182. package/dist/packages/wje-select/select.d.ts +2 -0
  183. package/dist/packages/wje-select/select.element.d.ts +315 -0
  184. package/dist/packages/wje-slider/slider.d.ts +2 -0
  185. package/dist/packages/wje-slider/slider.element.d.ts +103 -0
  186. package/dist/packages/wje-split-view/service/service.d.ts +1 -0
  187. package/dist/packages/wje-split-view/split-view.d.ts +2 -0
  188. package/dist/packages/wje-split-view/split-view.element.d.ts +66 -0
  189. package/dist/packages/wje-status/status.d.ts +2 -0
  190. package/dist/packages/wje-status/status.element.d.ts +26 -0
  191. package/dist/packages/wje-step/step.d.ts +2 -0
  192. package/dist/packages/wje-step/step.element.d.ts +23 -0
  193. package/dist/packages/wje-stepper/stepper.d.ts +2 -0
  194. package/dist/packages/wje-stepper/stepper.element.d.ts +78 -0
  195. package/dist/packages/wje-store/default-store-actions.d.ts +25 -0
  196. package/dist/packages/wje-store/pubsub.d.ts +21 -0
  197. package/dist/packages/wje-store/store.d.ts +153 -0
  198. package/dist/packages/wje-tab/tab.d.ts +2 -0
  199. package/dist/packages/wje-tab/tab.element.d.ts +41 -0
  200. package/dist/packages/wje-tab-group/tab-group.d.ts +2 -0
  201. package/dist/packages/wje-tab-group/tab-group.element.d.ts +67 -0
  202. package/dist/packages/wje-tab-panel/tab-panel.d.ts +2 -0
  203. package/dist/packages/wje-tab-panel/tab-panel.element.d.ts +23 -0
  204. package/dist/packages/wje-textarea/textarea.d.ts +2 -0
  205. package/dist/packages/wje-textarea/textarea.element.d.ts +176 -0
  206. package/dist/packages/wje-thumbnail/thumbnail.d.ts +2 -0
  207. package/dist/packages/wje-thumbnail/thumbnail.element.d.ts +31 -0
  208. package/dist/packages/wje-timeline/timeline.d.ts +2 -0
  209. package/dist/packages/wje-timeline/timeline.element.d.ts +25 -0
  210. package/dist/packages/wje-timeline-item/timeline-item.d.ts +2 -0
  211. package/dist/packages/wje-timeline-item/timeline-item.element.d.ts +27 -0
  212. package/dist/packages/wje-toast/toast.d.ts +2 -0
  213. package/dist/packages/wje-toast/toast.element.d.ts +173 -0
  214. package/dist/packages/wje-toast/toast.test.d.ts +1 -0
  215. package/dist/packages/wje-toggle/toggle.d.ts +2 -0
  216. package/dist/packages/wje-toggle/toggle.element.d.ts +65 -0
  217. package/dist/packages/wje-toolbar/toolbar.d.ts +2 -0
  218. package/dist/packages/wje-toolbar/toolbar.element.d.ts +39 -0
  219. package/dist/packages/wje-toolbar-action/toolbar-action.d.ts +2 -0
  220. package/dist/packages/wje-toolbar-action/toolbar-action.element.d.ts +35 -0
  221. package/dist/packages/wje-tooltip/tooltip.d.ts +2 -0
  222. package/dist/packages/wje-tooltip/tooltip.element.d.ts +71 -0
  223. package/dist/packages/wje-tree/tree.d.ts +2 -0
  224. package/dist/packages/wje-tree/tree.element.d.ts +48 -0
  225. package/dist/packages/wje-tree-item/tree-item.d.ts +2 -0
  226. package/dist/packages/wje-tree-item/tree-item.element.d.ts +48 -0
  227. package/dist/packages/wje-visually-hidden/visually-hidden.d.ts +2 -0
  228. package/dist/packages/wje-visually-hidden/visually-hidden.element.d.ts +29 -0
  229. package/dist/popup.element-tyYxow0p.js +1623 -0
  230. package/dist/popup.element-tyYxow0p.js.map +1 -0
  231. package/dist/router-links-CJnOdbas.js +150 -0
  232. package/dist/router-links-CJnOdbas.js.map +1 -0
  233. package/dist/styles.css +849 -0
  234. package/dist/wje-accordion-item.js +113 -0
  235. package/dist/wje-accordion-item.js.map +1 -0
  236. package/dist/wje-accordion.js +122 -0
  237. package/dist/wje-accordion.js.map +1 -0
  238. package/dist/wje-animation.js +4324 -0
  239. package/dist/wje-animation.js.map +1 -0
  240. package/dist/wje-aside.js +55 -0
  241. package/dist/wje-aside.js.map +1 -0
  242. package/dist/wje-avatar.js +90 -0
  243. package/dist/wje-avatar.js.map +1 -0
  244. package/dist/wje-badge.js +71 -0
  245. package/dist/wje-badge.js.map +1 -0
  246. package/dist/wje-breadcrumb.js +195 -0
  247. package/dist/wje-breadcrumb.js.map +1 -0
  248. package/dist/wje-breadcrumbs.js +140 -0
  249. package/dist/wje-breadcrumbs.js.map +1 -0
  250. package/dist/wje-button-group.js +85 -0
  251. package/dist/wje-button-group.js.map +1 -0
  252. package/dist/wje-button.js +352 -0
  253. package/dist/wje-button.js.map +1 -0
  254. package/dist/wje-card-content.js +48 -0
  255. package/dist/wje-card-content.js.map +1 -0
  256. package/dist/wje-card-controls.js +48 -0
  257. package/dist/wje-card-controls.js.map +1 -0
  258. package/dist/wje-card-header.js +48 -0
  259. package/dist/wje-card-header.js.map +1 -0
  260. package/dist/wje-card-subtitle.js +55 -0
  261. package/dist/wje-card-subtitle.js.map +1 -0
  262. package/dist/wje-card-title.js +55 -0
  263. package/dist/wje-card-title.js.map +1 -0
  264. package/dist/wje-card.js +56 -0
  265. package/dist/wje-card.js.map +1 -0
  266. package/dist/wje-carousel-item.js +63 -0
  267. package/dist/wje-carousel-item.js.map +1 -0
  268. package/dist/wje-carousel.js +380 -0
  269. package/dist/wje-carousel.js.map +1 -0
  270. package/dist/wje-checkbox.js +540 -0
  271. package/dist/wje-checkbox.js.map +1 -0
  272. package/dist/wje-chip.js +76 -0
  273. package/dist/wje-chip.js.map +1 -0
  274. package/dist/wje-col.js +38 -0
  275. package/dist/wje-col.js.map +1 -0
  276. package/dist/wje-color-picker.js +1339 -0
  277. package/dist/wje-color-picker.js.map +1 -0
  278. package/dist/wje-container.js +56 -0
  279. package/dist/wje-container.js.map +1 -0
  280. package/dist/wje-copy-button.js +218 -0
  281. package/dist/wje-copy-button.js.map +1 -0
  282. package/dist/wje-dialog.js +249 -0
  283. package/dist/wje-dialog.js.map +1 -0
  284. package/dist/wje-divider.js +55 -0
  285. package/dist/wje-divider.js.map +1 -0
  286. package/dist/wje-dropdown.js +194 -0
  287. package/dist/wje-dropdown.js.map +1 -0
  288. package/dist/wje-element.js +967 -0
  289. package/dist/wje-element.js.map +1 -0
  290. package/dist/wje-fetchAndParseCSS.js +60 -0
  291. package/dist/wje-fetchAndParseCSS.js.map +1 -0
  292. package/dist/wje-file-upload-item.js +140 -0
  293. package/dist/wje-file-upload-item.js.map +1 -0
  294. package/dist/wje-file-upload.js +552 -0
  295. package/dist/wje-file-upload.js.map +1 -0
  296. package/dist/wje-footer.js +52 -0
  297. package/dist/wje-footer.js.map +1 -0
  298. package/dist/wje-form.js +53 -0
  299. package/dist/wje-form.js.map +1 -0
  300. package/dist/wje-format-digital.js +146 -0
  301. package/dist/wje-format-digital.js.map +1 -0
  302. package/dist/wje-grid.js +54 -0
  303. package/dist/wje-grid.js.map +1 -0
  304. package/dist/wje-header.js +56 -0
  305. package/dist/wje-header.js.map +1 -0
  306. package/dist/wje-icon-picker.js +349 -0
  307. package/dist/wje-icon-picker.js.map +1 -0
  308. package/dist/wje-icon.js +191 -0
  309. package/dist/wje-icon.js.map +1 -0
  310. package/dist/wje-img-comparer.js +131 -0
  311. package/dist/wje-img-comparer.js.map +1 -0
  312. package/dist/wje-img.js +80 -0
  313. package/dist/wje-img.js.map +1 -0
  314. package/dist/wje-infinite-scroll.js +6 -0
  315. package/dist/wje-infinite-scroll.js.map +1 -0
  316. package/dist/wje-input-file.js +111 -0
  317. package/dist/wje-input-file.js.map +1 -0
  318. package/dist/wje-input.js +452 -0
  319. package/dist/wje-input.js.map +1 -0
  320. package/dist/wje-item.js +88 -0
  321. package/dist/wje-item.js.map +1 -0
  322. package/dist/wje-kanban.js +462 -0
  323. package/dist/wje-kanban.js.map +1 -0
  324. package/dist/wje-label.js +53 -0
  325. package/dist/wje-label.js.map +1 -0
  326. package/dist/wje-list.js +6 -0
  327. package/dist/wje-list.js.map +1 -0
  328. package/dist/wje-main.js +52 -0
  329. package/dist/wje-main.js.map +1 -0
  330. package/dist/wje-masonry.js +267 -0
  331. package/dist/wje-masonry.js.map +1 -0
  332. package/dist/wje-master.js +622 -0
  333. package/dist/wje-master.js.map +1 -0
  334. package/dist/wje-menu-button.js +60 -0
  335. package/dist/wje-menu-button.js.map +1 -0
  336. package/dist/wje-menu-item.js +545 -0
  337. package/dist/wje-menu-item.js.map +1 -0
  338. package/dist/wje-menu-label.js +55 -0
  339. package/dist/wje-menu-label.js.map +1 -0
  340. package/dist/wje-menu.js +72 -0
  341. package/dist/wje-menu.js.map +1 -0
  342. package/dist/wje-option.js +112 -0
  343. package/dist/wje-option.js.map +1 -0
  344. package/dist/wje-options.js +355 -0
  345. package/dist/wje-options.js.map +1 -0
  346. package/dist/wje-orgchart-group.js +72 -0
  347. package/dist/wje-orgchart-group.js.map +1 -0
  348. package/dist/wje-orgchart-item.js +98 -0
  349. package/dist/wje-orgchart-item.js.map +1 -0
  350. package/dist/wje-orgchart.js +49 -0
  351. package/dist/wje-orgchart.js.map +1 -0
  352. package/dist/wje-popup.js +6 -0
  353. package/dist/wje-popup.js.map +1 -0
  354. package/dist/wje-progress-bar.js +213 -0
  355. package/dist/wje-progress-bar.js.map +1 -0
  356. package/dist/wje-qr-code.js +2892 -0
  357. package/dist/wje-qr-code.js.map +1 -0
  358. package/dist/wje-radio-group.js +228 -0
  359. package/dist/wje-radio-group.js.map +1 -0
  360. package/dist/wje-radio.js +106 -0
  361. package/dist/wje-radio.js.map +1 -0
  362. package/dist/wje-rate.js +300 -0
  363. package/dist/wje-rate.js.map +1 -0
  364. package/dist/wje-relative-time.js +115 -0
  365. package/dist/wje-relative-time.js.map +1 -0
  366. package/dist/wje-reorder-dropzone.js +49 -0
  367. package/dist/wje-reorder-dropzone.js.map +1 -0
  368. package/dist/wje-reorder-handle.js +218 -0
  369. package/dist/wje-reorder-handle.js.map +1 -0
  370. package/dist/wje-reorder-item.js +61 -0
  371. package/dist/wje-reorder-item.js.map +1 -0
  372. package/dist/wje-reorder.js +281 -0
  373. package/dist/wje-reorder.js.map +1 -0
  374. package/dist/wje-route.js +43 -0
  375. package/dist/wje-route.js.map +1 -0
  376. package/dist/wje-router-link.js +64 -0
  377. package/dist/wje-router-link.js.map +1 -0
  378. package/dist/wje-router-outlet.js +192 -0
  379. package/dist/wje-router-outlet.js.map +1 -0
  380. package/dist/wje-routerx.js +1437 -0
  381. package/dist/wje-routerx.js.map +1 -0
  382. package/dist/wje-row.js +49 -0
  383. package/dist/wje-row.js.map +1 -0
  384. package/dist/wje-select.js +630 -0
  385. package/dist/wje-select.js.map +1 -0
  386. package/dist/wje-slider.js +221 -0
  387. package/dist/wje-slider.js.map +1 -0
  388. package/dist/wje-sliding-container.js +474 -0
  389. package/dist/wje-sliding-container.js.map +1 -0
  390. package/dist/wje-split-view.js +153 -0
  391. package/dist/wje-split-view.js.map +1 -0
  392. package/dist/wje-status.js +61 -0
  393. package/dist/wje-status.js.map +1 -0
  394. package/dist/wje-step.js +50 -0
  395. package/dist/wje-step.js.map +1 -0
  396. package/dist/wje-stepper.js +231 -0
  397. package/dist/wje-stepper.js.map +1 -0
  398. package/dist/wje-store.js +401 -0
  399. package/dist/wje-store.js.map +1 -0
  400. package/dist/wje-tab-group.js +137 -0
  401. package/dist/wje-tab-group.js.map +1 -0
  402. package/dist/wje-tab-panel.js +46 -0
  403. package/dist/wje-tab-panel.js.map +1 -0
  404. package/dist/wje-tab.js +59 -0
  405. package/dist/wje-tab.js.map +1 -0
  406. package/dist/wje-textarea.js +376 -0
  407. package/dist/wje-textarea.js.map +1 -0
  408. package/dist/wje-thumbnail.js +54 -0
  409. package/dist/wje-thumbnail.js.map +1 -0
  410. package/dist/wje-toast.js +334 -0
  411. package/dist/wje-toast.js.map +1 -0
  412. package/dist/wje-toggle.js +125 -0
  413. package/dist/wje-toggle.js.map +1 -0
  414. package/dist/wje-toolbar-action.js +72 -0
  415. package/dist/wje-toolbar-action.js.map +1 -0
  416. package/dist/wje-toolbar.js +63 -0
  417. package/dist/wje-toolbar.js.map +1 -0
  418. package/dist/wje-tooltip.js +166 -0
  419. package/dist/wje-tooltip.js.map +1 -0
  420. package/dist/wje-visually-hidden.js +55 -0
  421. package/dist/wje-visually-hidden.js.map +1 -0
  422. package/package.json +1 -1
@@ -0,0 +1,355 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import WJElement, { event } from "./wje-element.js";
5
+ import { I as InfiniteScroll } from "./infinite-scroll.element-XVJukzjy.js";
6
+ import { L as List } from "./list.element-Ce1vIm1O.js";
7
+ import Option from "./wje-option.js";
8
+ class Options extends WJElement {
9
+ /**
10
+ * Creates an instance of Options.
11
+ * @class
12
+ */
13
+ constructor() {
14
+ super();
15
+ __publicField(this, "dependencies", {
16
+ "wje-option": Option,
17
+ "wje-infinite-scroll": InfiniteScroll,
18
+ "wje-list": List
19
+ });
20
+ __publicField(this, "className", "Options");
21
+ /**
22
+ * Recursively updates the object based on the provided path to the property.
23
+ * @param {object | Array | null} object
24
+ * @param {Array<string> | null} pathToProperty
25
+ * @returns {object | Array | null}
26
+ */
27
+ __publicField(this, "recursiveUpdate", (object, pathToProperty) => {
28
+ var _a;
29
+ if (pathToProperty.length === 0) {
30
+ if (Array.isArray(object)) {
31
+ return object.filter(
32
+ (option) => !this.loadedOptions.some(
33
+ (loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]
34
+ )
35
+ );
36
+ } else {
37
+ console.error("Expected an array but got:", object, pathToProperty);
38
+ return [];
39
+ }
40
+ }
41
+ const [currentPath, ...remainingPath] = pathToProperty;
42
+ if (remainingPath.length > 0) {
43
+ object[currentPath] = this.recursiveUpdate(object[currentPath], remainingPath);
44
+ } else {
45
+ object[currentPath] = ((_a = object[currentPath]) == null ? void 0 : _a.filter(
46
+ (option) => !this.loadedOptions.some(
47
+ (loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]
48
+ )
49
+ )) ?? [];
50
+ }
51
+ return object;
52
+ });
53
+ /**
54
+ * Generates an HTML option element based on the provided item.
55
+ * @param {object} item The item to generate the option element for.
56
+ * @returns {HTMLElement} The generated option element.
57
+ */
58
+ __publicField(this, "htmlItem", (item) => {
59
+ let option = document.createElement("wje-option");
60
+ if (item[this.itemValue] === null || item[this.itemValue] === void 0) {
61
+ console.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemValue}`);
62
+ }
63
+ if (item[this.itemText] === null || item[this.itemText] === void 0) {
64
+ console.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemText}`);
65
+ }
66
+ option.setAttribute("value", item[this.itemValue] ?? "");
67
+ option.innerText = item[this.itemText] ?? "";
68
+ return option;
69
+ });
70
+ this._loadedOptions = [];
71
+ }
72
+ /**
73
+ * Returns the list of attributes to observe for changes.
74
+ * @static
75
+ * @returns {Array<string>}
76
+ */
77
+ static get observedAttributes() {
78
+ return ["search"];
79
+ }
80
+ /**
81
+ * Sets the option array path attribute.
82
+ * @param {string} value The value to set for the option array path.
83
+ */
84
+ set optionArrayPath(value) {
85
+ this.setAttribute("option-array-path", value);
86
+ }
87
+ /**
88
+ * Gets the option array path attribute.
89
+ * @returns {string} The value of the option array path attribute or "data" if not set.
90
+ */
91
+ get optionArrayPath() {
92
+ return this.getAttribute("option-array-path");
93
+ }
94
+ /**
95
+ * Checks if the option array path attribute is present.
96
+ * @returns {boolean} True if the option array path attribute is present, false otherwise.
97
+ */
98
+ get hasOptionArrayPath() {
99
+ return this.hasAttribute("option-array-path");
100
+ }
101
+ /**
102
+ * Gets the dropdown height attribute.
103
+ * @returns {string} The value of the dropdown height attribute or "100%" if not set.
104
+ */
105
+ get dropdownHeight() {
106
+ return this.getAttribute("dropdown-height") || "100%";
107
+ }
108
+ /**
109
+ * Sets the dropdown height attribute.
110
+ * @param {string} value The value to set for the dropdown height.
111
+ */
112
+ set dropdownHeight(value) {
113
+ this.setAttribute("dropdown-height", value);
114
+ }
115
+ /**
116
+ * Sets the item value attribute.
117
+ * @param {string} value The value to set for the item value.
118
+ */
119
+ set itemValue(value) {
120
+ this.setAttribute("item-value", value);
121
+ }
122
+ /**
123
+ * Gets the item value attribute.
124
+ * @returns {string} The value of the item value attribute or "value" if not set.
125
+ */
126
+ get itemValue() {
127
+ return this.getAttribute("item-value") || "value";
128
+ }
129
+ /**
130
+ * Sets the item text attribute.
131
+ * @param {string} value The value to set for the item text.
132
+ */
133
+ set itemText(value) {
134
+ this.setAttribute("item-text", value);
135
+ }
136
+ /**
137
+ * Gets the item text attribute.
138
+ * @returns {string} The value of the item text attribute or "text" if not set.
139
+ */
140
+ get itemText() {
141
+ return this.getAttribute("item-text") || "text";
142
+ }
143
+ /**
144
+ * Gets the lazy load size attribute.
145
+ * @returns {number} The value of the lazy load size attribute or 10 if not set.
146
+ */
147
+ get lazyLoadSize() {
148
+ return this.getAttribute("lazy-load-size") || 10;
149
+ }
150
+ /**
151
+ * Sets the lazy load size attribute.
152
+ * @param {number} value The value to set for the lazy load size.
153
+ */
154
+ set lazyLoadSize(value) {
155
+ this.setAttribute("lazy-load-size", value);
156
+ }
157
+ /**
158
+ * Sets the search attribute.
159
+ * @param {string} value The value to set for the search.
160
+ */
161
+ set search(value) {
162
+ this.setAttribute("search", value);
163
+ }
164
+ /**
165
+ * Gets the search attribute.
166
+ * @returns {string} The value of the search attribute.
167
+ */
168
+ get search() {
169
+ return this.getAttribute("search");
170
+ }
171
+ /**
172
+ * Checks if the search attribute is present.
173
+ * @returns {boolean} True if the search attribute is present, false otherwise.
174
+ */
175
+ get hasSearch() {
176
+ return this.hasAttribute("search");
177
+ }
178
+ get searchToQueryParams() {
179
+ return this.getAttribute("search-to-query-params");
180
+ }
181
+ set searchToQueryParams(value) {
182
+ this.setAttribute("search-to-query-params", value);
183
+ }
184
+ get hasSearchToQueryParams() {
185
+ return this.hasAttribute("search-to-query-params");
186
+ }
187
+ /**
188
+ * Checks if the lazy attribute is present.
189
+ * @returns {boolean} True if the lazy attribute is present, false otherwise.
190
+ */
191
+ get lazy() {
192
+ return this.hasAttribute("lazy");
193
+ }
194
+ /**
195
+ * Sets the lazy attribute.
196
+ * @param {boolean} value The value to set for the lazy attribute.
197
+ */
198
+ set lazy(value) {
199
+ this.setAttribute("lazy", value);
200
+ }
201
+ /**
202
+ * Gets the loaded options.
203
+ * @returns {Array} The loaded options.
204
+ */
205
+ get options() {
206
+ var _a;
207
+ return (_a = this.loadedOptions) == null ? void 0 : _a.flat();
208
+ }
209
+ get loadedOptions() {
210
+ return this._loadedOptions;
211
+ }
212
+ set loadedOptions(loadedOptions) {
213
+ this._loadedOptions = loadedOptions;
214
+ }
215
+ /**
216
+ * Lifecycle method, called whenever an observed property changes.
217
+ */
218
+ attributeChangedCallback(name, oldValue, newValue) {
219
+ if (this.infiniteScroll && name === "search" && oldValue !== newValue) {
220
+ this.loadedOptions = [];
221
+ this.infiniteScroll.placementObj.innerHTML = "";
222
+ this.infiniteScroll.totalPages = 0;
223
+ this.infiniteScroll.refresh();
224
+ }
225
+ }
226
+ /**
227
+ * Sets up the attributes for the component.
228
+ */
229
+ setupAttributes() {
230
+ this.isShadowRoot = "open";
231
+ }
232
+ /**
233
+ * Prepares the component before drawing.
234
+ * Fetches the pages and creates the options elements.
235
+ */
236
+ afterDraw() {
237
+ event.dispatchCustomEvent(this, "wje-options:load", {});
238
+ }
239
+ /**
240
+ * Draws the component.
241
+ * @returns {DocumentFragment}
242
+ */
243
+ async draw() {
244
+ let fragment = document.createDocumentFragment();
245
+ const slot = document.createElement("slot");
246
+ if (this.hasAttribute("lazy")) {
247
+ const list = document.createElement("wje-list");
248
+ const infiniteScroll = document.createElement("wje-infinite-scroll");
249
+ infiniteScroll.setAttribute("placement", "wje-list");
250
+ infiniteScroll.setAttribute("height", this.dropdownHeight);
251
+ infiniteScroll.setAttribute("object-name", this.optionArrayPath);
252
+ infiniteScroll.append(list);
253
+ infiniteScroll.dataToHtml = this.htmlItem;
254
+ infiniteScroll.setCustomData = async (page, signal) => {
255
+ let processedUrl = `${this.url}${this.search ? `/${this.search}` : ""}?page=${page}&size=${this.lazyLoadSize}`;
256
+ if (this.hasSearchToQueryParams) {
257
+ processedUrl = `${this.url}?page=${page}&size=${this.lazyLoadSize}${this.search ? `&search=${this.search}` : ""}`;
258
+ }
259
+ let res = await this.service.get(
260
+ processedUrl,
261
+ null,
262
+ false,
263
+ signal
264
+ );
265
+ const filteredOptions = this.filterOutDrawnOptions(res);
266
+ this.loadedOptions.push(...this.processData(filteredOptions));
267
+ return filteredOptions;
268
+ };
269
+ if (!this.contains(infiniteScroll)) {
270
+ this.appendChild(infiniteScroll);
271
+ }
272
+ this.infiniteScroll = infiniteScroll;
273
+ } else {
274
+ this.response = await this.getPages();
275
+ let optionsData = this.filterOutDrawnOptions(this.response);
276
+ optionsData = this.processData(optionsData);
277
+ this.loadedOptions.push(...optionsData);
278
+ this.append(...optionsData.map(this.htmlItem));
279
+ }
280
+ fragment.appendChild(slot);
281
+ return fragment;
282
+ }
283
+ /**
284
+ * Processes the given data and returns the options based on the option array path.
285
+ * @param {any} data The data to be processed.
286
+ * @returns {any} - The options based on the option array path.
287
+ */
288
+ processData(data) {
289
+ var _a;
290
+ const splittedOptionArrayPath = this.optionArrayPath ? (_a = this.optionArrayPath) == null ? void 0 : _a.split(".") : null;
291
+ let options = data;
292
+ splittedOptionArrayPath == null ? void 0 : splittedOptionArrayPath.forEach((path) => {
293
+ options = options[path];
294
+ });
295
+ return options ?? [];
296
+ }
297
+ /**
298
+ * Filters out drawn options from the response.
299
+ * @param {object | null} response The response to filter.
300
+ * @returns {object} The filtered response.
301
+ */
302
+ filterOutDrawnOptions(response) {
303
+ var _a;
304
+ const splittedOptionArrayPath = this.optionArrayPath ? (_a = this.optionArrayPath) == null ? void 0 : _a.split(".") : [];
305
+ let filteredResponse = structuredClone(response);
306
+ filteredResponse = this.recursiveUpdate(filteredResponse, splittedOptionArrayPath);
307
+ return filteredResponse;
308
+ }
309
+ /**
310
+ * Fetches the pages from the provided URL.
311
+ * @param {number} page The page number to fetch.
312
+ * @returns {Promise<object>} The fetched data.
313
+ * @throws Will throw an error if the response is not ok.
314
+ */
315
+ async getPages(page) {
316
+ const response = await fetch(this.url);
317
+ if (!response.ok) {
318
+ throw new Error(`An error occurred: ${response.status}`);
319
+ }
320
+ return await response.json();
321
+ }
322
+ /**
323
+ * Finds the selected option data based on the given selected option values.
324
+ * @param {Array} selectedOptionValues The array of selected option values.
325
+ * @returns {Array} - The array of option data that matches the selected option values.
326
+ */
327
+ findSelectedOptionData(selectedOptionValues = []) {
328
+ return this.options.filter((option) => selectedOptionValues.includes(option[this.itemValue]));
329
+ }
330
+ /**
331
+ * Adds an option to the element.
332
+ * @param {object} optionData The data of the option to be added.
333
+ */
334
+ addOption(optionData) {
335
+ if (this.loadedOptions.some((option) => option[this.itemValue] === optionData[this.itemValue])) {
336
+ return;
337
+ }
338
+ this.prepend(this.htmlItem(optionData));
339
+ this.loadedOptions.push(optionData);
340
+ }
341
+ /**
342
+ * Adds options to the element.
343
+ * @param {Array} optionsData The array of option data to be added.
344
+ * @param {boolean} [silent] Whether to suppress events triggered by adding options.
345
+ */
346
+ addOptions(optionsData = [], silent = false) {
347
+ if (Array.isArray(optionsData)) optionsData == null ? void 0 : optionsData.forEach((od) => this.addOption(od, silent));
348
+ else this.addOption(optionsData, silent);
349
+ }
350
+ }
351
+ Options.define("wje-options", Options);
352
+ export {
353
+ Options as default
354
+ };
355
+ //# sourceMappingURL=wje-options.js.map
@@ -0,0 +1 @@
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.element.js';\nimport List from '../wje-list/list.element.js';\nimport Option from '../wje-option/option.js';\n\n/**\n * `Options` is a custom web component that represents a set of options.\n * 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 * @augments {WJElement}\n * // @fires wje-options:load - Event fired when the options are loaded.\n * @tag wje-options\n */\nexport default class Options extends WJElement {\n /**\n * Creates an instance of Options.\n * @class\n */\n constructor() {\n super();\n\n this._loadedOptions = [];\n }\n\n dependencies = {\n 'wje-option': Option,\n 'wje-infinite-scroll': InfiniteScroll,\n 'wje-list': List,\n };\n\n className = 'Options';\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 ['search'];\n }\n\n /**\n * Sets the option array path attribute.\n * @param {string} value The value to set for the option array path.\n */\n set optionArrayPath(value) {\n this.setAttribute('option-array-path', value);\n }\n\n /**\n * Gets the option array path attribute.\n * @returns {string} The value of the option array path attribute or \"data\" if not set.\n */\n get optionArrayPath() {\n return this.getAttribute('option-array-path');\n }\n\n /**\n * Checks if the option array path attribute is present.\n * @returns {boolean} True if the option array path attribute is present, false otherwise.\n */\n get hasOptionArrayPath() {\n return this.hasAttribute('option-array-path');\n }\n\n /**\n * Gets the dropdown height attribute.\n * @returns {string} The value of the dropdown height attribute or \"100%\" if not set.\n */\n get dropdownHeight() {\n return this.getAttribute('dropdown-height') || '100%';\n }\n\n /**\n * Sets the dropdown height attribute.\n * @param {string} value The value to set for the dropdown height.\n */\n set dropdownHeight(value) {\n this.setAttribute('dropdown-height', value);\n }\n\n /**\n * Sets the item value attribute.\n * @param {string} value The value to set for the item value.\n */\n set itemValue(value) {\n this.setAttribute('item-value', value);\n }\n\n /**\n * Gets the item value attribute.\n * @returns {string} The value of the item value attribute or \"value\" if not set.\n */\n get itemValue() {\n return this.getAttribute('item-value') || 'value';\n }\n\n /**\n * Sets the item text attribute.\n * @param {string} value The value to set for the item text.\n */\n set itemText(value) {\n this.setAttribute('item-text', value);\n }\n\n /**\n * Gets the item text attribute.\n * @returns {string} The value of the item text attribute or \"text\" if not set.\n */\n get itemText() {\n return this.getAttribute('item-text') || 'text';\n }\n\n /**\n * Gets the lazy load size attribute.\n * @returns {number} The value of the lazy load size attribute or 10 if not set.\n */\n get lazyLoadSize() {\n return this.getAttribute('lazy-load-size') || 10;\n }\n\n /**\n * Sets the lazy load size attribute.\n * @param {number} value The value to set for the lazy load size.\n */\n set lazyLoadSize(value) {\n this.setAttribute('lazy-load-size', value);\n }\n\n /**\n * Sets the search attribute.\n * @param {string} value The value to set for the search.\n */\n set search(value) {\n this.setAttribute('search', value);\n }\n\n /**\n * Gets the search attribute.\n * @returns {string} The value of the search attribute.\n */\n get search() {\n return this.getAttribute('search');\n }\n\n /**\n * Checks if the search attribute is present.\n * @returns {boolean} True if the search attribute is present, false otherwise.\n */\n get hasSearch() {\n return this.hasAttribute('search');\n }\n\n get searchToQueryParams() {\n return this.getAttribute('search-to-query-params');\n }\n\n set searchToQueryParams(value) {\n this.setAttribute('search-to-query-params', value);\n }\n\n get hasSearchToQueryParams() {\n return this.hasAttribute('search-to-query-params');\n }\n\n /**\n * Checks if the lazy attribute is present.\n * @returns {boolean} True if the lazy attribute is present, false otherwise.\n */\n get lazy() {\n return this.hasAttribute('lazy');\n }\n\n /**\n * Sets the lazy attribute.\n * @param {boolean} value The value to set for the lazy attribute.\n */\n set lazy(value) {\n this.setAttribute('lazy', value);\n }\n\n /**\n * Gets the loaded options.\n * @returns {Array} The loaded options.\n */\n get options() {\n return this.loadedOptions?.flat();\n }\n\n get loadedOptions() {\n return this._loadedOptions;\n }\n\n set loadedOptions(loadedOptions) {\n this._loadedOptions = loadedOptions;\n }\n\n /**\n * Lifecycle method, called whenever an observed property changes.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (this.infiniteScroll && name === 'search' && oldValue !== newValue) {\n this.loadedOptions = [];\n this.infiniteScroll.placementObj.innerHTML = '';\n this.infiniteScroll.totalPages = 0;\n this.infiniteScroll.refresh();\n }\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Prepares the component before drawing.\n * Fetches the pages and creates the options elements.\n */\n afterDraw() {\n event.dispatchCustomEvent(this, 'wje-options:load', {}); // nepomohlo to, v ff stale je scroll hore\n }\n\n /**\n * Draws the component.\n * @returns {DocumentFragment}\n */\n async draw() {\n let fragment = document.createDocumentFragment();\n\n const slot = document.createElement('slot');\n\n if (this.hasAttribute('lazy')) {\n const list = document.createElement('wje-list');\n\n const infiniteScroll = document.createElement('wje-infinite-scroll');\n infiniteScroll.setAttribute('placement', 'wje-list');\n infiniteScroll.setAttribute('height', this.dropdownHeight);\n infiniteScroll.setAttribute('object-name', this.optionArrayPath);\n infiniteScroll.append(list);\n\n infiniteScroll.dataToHtml = this.htmlItem;\n\n infiniteScroll.setCustomData = async (page, signal) => {\n let processedUrl = `${this.url}${this.search ? `/${this.search}` : ''}?page=${page}&size=${this.lazyLoadSize}`\n\n if (this.hasSearchToQueryParams) {\n processedUrl = `${this.url}?page=${page}&size=${this.lazyLoadSize}${this.search ? `&search=${this.search}` : ''}`;\n }\n\n let res = await this.service.get(processedUrl,\n null,\n false,\n signal\n );\n const filteredOptions = this.filterOutDrawnOptions(res);\n this.loadedOptions.push(...this.processData(filteredOptions));\n\n return filteredOptions;\n };\n\n if (!this.contains(infiniteScroll)) {\n this.appendChild(infiniteScroll);\n }\n\n this.infiniteScroll = infiniteScroll;\n } else {\n this.response = await this.getPages();\n let optionsData = this.filterOutDrawnOptions(this.response);\n optionsData = this.processData(optionsData);\n\n this.loadedOptions.push(...optionsData);\n\n this.append(...optionsData.map(this.htmlItem));\n }\n\n fragment.appendChild(slot);\n\n return fragment;\n }\n\n /**\n * Processes the given data and returns the options based on the option array path.\n * @param {any} data The data to be processed.\n * @returns {any} - The options based on the option array path.\n */\n processData(data) {\n const splittedOptionArrayPath = this.optionArrayPath ? this.optionArrayPath?.split('.') : null;\n let options = data;\n\n splittedOptionArrayPath?.forEach((path) => {\n options = options[path];\n });\n\n return options ?? [];\n }\n\n /**\n * Filters out drawn options from the response.\n * @param {object | null} response The response to filter.\n * @returns {object} The filtered response.\n */\n filterOutDrawnOptions(response) {\n const splittedOptionArrayPath = this.optionArrayPath ? this.optionArrayPath?.split('.') : [];\n let filteredResponse = structuredClone(response);\n\n filteredResponse = this.recursiveUpdate(filteredResponse, splittedOptionArrayPath);\n return filteredResponse;\n }\n\n /**\n * Recursively updates the object based on the provided path to the property.\n * @param {object | Array | null} object\n * @param {Array<string> | null} pathToProperty\n * @returns {object | Array | null}\n */\n recursiveUpdate = (object, pathToProperty) => {\n if (pathToProperty.length === 0) {\n if (Array.isArray(object)) {\n return object.filter(\n (option) =>\n !this.loadedOptions.some(\n (loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]\n )\n );\n } else {\n console.error('Expected an array but got:', object, pathToProperty);\n return [];\n }\n }\n\n const [currentPath, ...remainingPath] = pathToProperty;\n if (remainingPath.length > 0) {\n object[currentPath] = this.recursiveUpdate(object[currentPath], remainingPath);\n } else {\n object[currentPath] =\n object[currentPath]?.filter(\n (option) =>\n !this.loadedOptions.some(\n (loadedOption) => loadedOption[this.itemValue] === option[this.itemValue]\n )\n ) ?? [];\n }\n return object;\n };\n\n /**\n * Generates an HTML option element based on the provided item.\n * @param {object} item The item to generate the option element for.\n * @returns {HTMLElement} The generated option element.\n */\n htmlItem = (item) => {\n let option = document.createElement('wje-option');\n\n if (item[this.itemValue] === null || item[this.itemValue] === undefined) {\n console.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemValue}`);\n }\n\n if (item[this.itemText] === null || item[this.itemText] === undefined) {\n console.warn(`The item ${JSON.stringify(item)} does not have the property ${this.itemText}`);\n }\n\n option.setAttribute('value', item[this.itemValue] ?? '');\n option.innerText = item[this.itemText] ?? '';\n\n return option;\n };\n\n /**\n * Fetches the pages from the provided URL.\n * @param {number} page The page number to fetch.\n * @returns {Promise<object>} The fetched data.\n * @throws Will throw an error if the response is not ok.\n */\n async getPages(page) {\n const response = await fetch(this.url);\n if (!response.ok) {\n throw new Error(`An error occurred: ${response.status}`);\n }\n return await response.json();\n }\n\n /**\n * Finds the selected option data based on the given selected option values.\n * @param {Array} selectedOptionValues The array of selected option values.\n * @returns {Array} - The array of option data that matches the selected option values.\n */\n findSelectedOptionData(selectedOptionValues = []) {\n return this.options.filter((option) => selectedOptionValues.includes(option[this.itemValue]));\n }\n\n /**\n * Adds an option to the element.\n * @param {object} optionData The data of the option to be added.\n */\n addOption(optionData) {\n if (this.loadedOptions.some((option) => option[this.itemValue] === optionData[this.itemValue])) {\n return;\n }\n\n this.prepend(this.htmlItem(optionData));\n this.loadedOptions.push(optionData);\n }\n\n /**\n * Adds options to the element.\n * @param {Array} optionsData The array of option data to be added.\n * @param {boolean} [silent] Whether to suppress events triggered by adding options.\n */\n addOptions(optionsData = [], silent = false) {\n if (Array.isArray(optionsData)) optionsData?.forEach((od) => this.addOption(od, silent));\n else this.addOption(optionsData, silent);\n }\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;AAAA;AAAA;AAAA;AAAA,EAK3C,cAAc;AACV,UAAO;AAKX,wCAAe;AAAA,MACX,cAAc;AAAA,MACd,uBAAuB;AAAA,MACvB,YAAY;AAAA,IACf;AAED,qCAAY;AA+RZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2CAAkB,CAAC,QAAQ,mBAAmB;;AAC1C,UAAI,eAAe,WAAW,GAAG;AAC7B,YAAI,MAAM,QAAQ,MAAM,GAAG;AACvB,iBAAO,OAAO;AAAA,YACV,CAAC,WACG,CAAC,KAAK,cAAc;AAAA,cAChB,CAAC,iBAAiB,aAAa,KAAK,SAAS,MAAM,OAAO,KAAK,SAAS;AAAA,YACpG;AAAA,UACiB;AAAA,QACjB,OAAmB;AACH,kBAAQ,MAAM,8BAA8B,QAAQ,cAAc;AAClE,iBAAO,CAAE;AAAA,QACzB;AAAA,MACA;AAEQ,YAAM,CAAC,aAAa,GAAG,aAAa,IAAI;AACxC,UAAI,cAAc,SAAS,GAAG;AAC1B,eAAO,WAAW,IAAI,KAAK,gBAAgB,OAAO,WAAW,GAAG,aAAa;AAAA,MACzF,OAAe;AACH,eAAO,WAAW,MACd,YAAO,WAAW,MAAlB,mBAAqB;AAAA,UACjB,CAAC,WACG,CAAC,KAAK,cAAc;AAAA,YAChB,CAAC,iBAAiB,aAAa,KAAK,SAAS,MAAM,OAAO,KAAK,SAAS;AAAA,UACpG;AAAA,cACqB,CAAE;AAAA,MACvB;AACQ,aAAO;AAAA,IACV;AAOD;AAAA;AAAA;AAAA;AAAA;AAAA,oCAAW,CAAC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SAAS,IAAI;AACd,YAAM,IAAI,MAAM,sBAAsB,SAAS,MAAM,EAAE;AAAA,IACnE;AACQ,WAAO,MAAM,SAAS,KAAM;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,uBAAuB,uBAAuB,IAAI;AAC9C,WAAO,KAAK,QAAQ,OAAO,CAAC,WAAW,qBAAqB,SAAS,OAAO,KAAK,SAAS,CAAC,CAAC;AAAA,EACpG;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,UAAU,YAAY;AAClB,QAAI,KAAK,cAAc,KAAK,CAAC,WAAW,OAAO,KAAK,SAAS,MAAM,WAAW,KAAK,SAAS,CAAC,GAAG;AAC5F;AAAA,IACZ;AAEQ,SAAK,QAAQ,KAAK,SAAS,UAAU,CAAC;AACtC,SAAK,cAAc,KAAK,UAAU;AAAA,EAC1C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,WAAW,cAAc,IAAI,SAAS,OAAO;AACzC,QAAI,MAAM,QAAQ,WAAW,EAAG,4CAAa,QAAQ,CAAC,OAAO,KAAK,UAAU,IAAI,MAAM;AAAA,QACjF,MAAK,UAAU,aAAa,MAAM;AAAA,EAC/C;AACA;AC5ZA,QAAQ,OAAO,eAAe,OAAO;"}
@@ -0,0 +1,72 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import WJElement, { event } from "./wje-element.js";
5
+ const styles = ":host {\n text-align: center;\n list-style-type: none;\n position: relative;\n padding: var(--wje-orgchart-group-height-line) 0 0 0;\n transition: all 0.5s;\n\n &::before,\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 50%;\n border-top: 1px solid var(--wje-border-color);\n width: 50%;\n height: var(--wje-orgchart-group-height-line);\n }\n\n &::after {\n right: auto;\n left: 50%;\n border-left: 1px solid var(--wje-border-color);\n }\n\n wje-card::part(native) {\n box-sizing: border-box;\n padding: var(--wje-orgchart-group-padding);\n }\n\n wje-card h4 {\n margin: 0;\n }\n wje-card .items {\n display: flex;\n }\n\n .orgchart-group {\n display: flex;\n flex-direction: column;\n wje-card {\n margin: 0 auto;\n width: var(--wje-orgchart-group-width);\n }\n }\n}\n\n:host(:only-child)::after,\n:host(:only-child)::before {\n display: none;\n}\n\n:host(:only-child) {\n padding-top: 0;\n}\n\n:host(:first-child)::before,\n:host(:last-child)::after {\n border: 0 none;\n}\n\n:host(:last-child)::before {\n border-right: 1px solid var(--wje-border-color);\n border-radius: 0 var(--wje-orgchart-group-border-radius) 0 0;\n}\n\n:host(:first-child)::after {\n border-radius: var(--wje-orgchart-group-border-radius) 0 0 0;\n}\n";
6
+ class OrgchartGroup extends WJElement {
7
+ /**
8
+ * Creates an instance of OrgchartGroup.
9
+ * @class
10
+ */
11
+ constructor() {
12
+ super();
13
+ /**
14
+ * The class name for the component.
15
+ * @type {string}
16
+ */
17
+ __publicField(this, "className", "OrgchartGroup");
18
+ }
19
+ /**
20
+ * Returns the CSS styles for the component.
21
+ * @static
22
+ * @returns {CSSStyleSheet}
23
+ */
24
+ static get cssStyleSheet() {
25
+ return styles;
26
+ }
27
+ /**
28
+ * Sets up the attributes for the component.
29
+ */
30
+ setupAttributes() {
31
+ this.isShadowRoot = "open";
32
+ }
33
+ /**
34
+ * Draws the component for the org chart group.
35
+ * @returns {DocumentFragment}
36
+ */
37
+ draw() {
38
+ let fragment = document.createDocumentFragment();
39
+ let native = document.createElement("div");
40
+ native.setAttribute("part", "native");
41
+ native.classList.add("orgchart-group");
42
+ let card = document.createElement("wje-card");
43
+ let title = document.createElement("h4");
44
+ title.setAttribute("part", "title");
45
+ title.innerHTML = this.getAttribute("title") || "";
46
+ let items = document.createElement("div");
47
+ items.setAttribute("part", "items");
48
+ items.classList.add("items");
49
+ let slot = document.createElement("slot");
50
+ items.appendChild(slot);
51
+ card.appendChild(title);
52
+ card.appendChild(items);
53
+ native.appendChild(card);
54
+ fragment.appendChild(native);
55
+ this.card = card;
56
+ return fragment;
57
+ }
58
+ /**
59
+ * After Draws the component for the org chart group.
60
+ */
61
+ afterDraw() {
62
+ this.card.addEventListener("click", (e) => {
63
+ e.stopPropagation();
64
+ event.dispatchCustomEvent(this.card, "wje-orgchart-group:click", { target: this });
65
+ });
66
+ }
67
+ }
68
+ OrgchartGroup.define("wje-orgchart-group", OrgchartGroup);
69
+ export {
70
+ OrgchartGroup as default
71
+ };
72
+ //# sourceMappingURL=wje-orgchart-group.js.map
@@ -0,0 +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;"}
@@ -0,0 +1,98 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import WJElement from "./wje-element.js";
5
+ const styles = ":host {\n width: var(--wje-orgchart-item-width);\n box-sizing: border-box;\n\n .orgchart-item {\n display: flex;\n flex-direction: column;\n\n wje-card {\n margin: 0 auto;\n padding-inline: 0.25rem;\n width: var(--wje-orgchart-item-width);\n box-sizing: border-box;\n &::part(native) {\n border-radius: var(--wje-orgchart-border-radius) !important;\n box-sizing: border-box;\n overflow: visible;\n padding-block: 0.125rem;\n background: var(--wje-orgchart-item-background);\n }\n }\n }\n\n .expander {\n position: absolute;\n left: calc(50% + 1px / 2);\n border: 1px solid var(--wje-border-color);\n border-radius: 50%;\n width: var(--wje-orgchart-item-expander-size);\n height: var(--wje-orgchart-item-expander-size);\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--wje-color-contrast-0);\n font-size: 8px;\n line-height: 1;\n box-sizing: border-box;\n transform: translate(-50%, calc(var(--wje-orgchart-item-expander-size) / 2));\n padding-bottom: 1px;\n cursor: pointer;\n z-index: 999;\n bottom: 0;\n &.collapse {\n content: '+';\n wje-orgchart {\n display: none;\n }\n }\n &:hover {\n background: var(--wje-color-contrast-1);\n }\n }\n}\n\n:host(.collapse) {\n .expander {\n content: '+';\n }\n slot[name='child'] {\n display: none;\n }\n}\n/* ak nie je parent-group */\n:host(:not(.parent-group)) {\n text-align: center;\n list-style-type: none;\n position: relative;\n padding: var(--wje-orgchart-item-height-line) 0 0 0;\n transition: all 0.5s;\n width: auto;\n box-sizing: border-box;\n\n &::before,\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 50%;\n border-top: 1px solid var(--wje-border-color);\n width: 50%;\n height: calc(var(--wje-orgchart-item-height-line) - 1px);\n }\n\n &::after {\n right: auto;\n left: 50%;\n border-left: 1px solid var(--wje-border-color);\n }\n\n wje-card::part(native) {\n box-sizing: border-box;\n }\n}\n\n:host([boss]) {\n wje-card::part(native) {\n background: var(--wje-orgchart-item-boss-background);\n border: var(--wje-orgchart-item-boss-border);\n }\n}\n\n:host(:hover) {\n wje-card::part(native) {\n background: var(--wje-orgchart-item-hover-background);\n border: var(--wje-orgchart-item-hover-border);\n }\n}\n\n:host(.highlight) {\n wje-card::part(native) {\n background: var(--wje-orgchart-item-highlight-background);\n border: var(--wje-orgchart-item-highlight-border);\n }\n}\n\n:host(:only-child)::after,\n:host(:only-child)::before {\n display: none;\n}\n\n:host(:only-child) {\n padding-top: 0;\n}\n\n:host(:first-child)::before,\n:host(:last-child)::after {\n border: 0 none;\n}\n\n:host(:last-child)::before {\n border-right: 1px solid var(--wje-border-color);\n border-radius: 0 var(--wje-orgchart-item-border-radius) 0 0;\n}\n\n:host(:first-child)::after {\n border-radius: var(--wje-orgchart-item-border-radius) 0 0 0;\n}\n";
6
+ class OrgchartItem extends WJElement {
7
+ /**
8
+ * Creates an instance of OrgchartItem.
9
+ * @class
10
+ */
11
+ constructor() {
12
+ super();
13
+ __publicField(this, "className", "OrgchartItem");
14
+ /**
15
+ * Toggles the children of the orgchart item.
16
+ * @param e The event object.
17
+ */
18
+ __publicField(this, "toggleChildren", (e) => {
19
+ this.classList.toggle("collapse");
20
+ if (this.classList.contains("collapse")) e.target.innerHTML = "+";
21
+ else e.target.innerHTML = "-";
22
+ });
23
+ }
24
+ /**
25
+ * Sets the boss of the orgchart item.
26
+ * @param value
27
+ */
28
+ set boss(value) {
29
+ if (value) this.setAttribute("boss", value);
30
+ }
31
+ /**
32
+ * Gets the boss of the orgchart item.
33
+ * @returns {boolean}
34
+ */
35
+ get boss() {
36
+ return this.hasAttribute("boss");
37
+ }
38
+ /**
39
+ * Returns the CSS styles for the component.
40
+ * @static
41
+ * @returns {CSSStyleSheet}
42
+ */
43
+ static get cssStyleSheet() {
44
+ return styles;
45
+ }
46
+ /**
47
+ * Sets up the attributes for the component.
48
+ */
49
+ setupAttributes() {
50
+ this.isShadowRoot = "open";
51
+ }
52
+ beforeDraw() {
53
+ if (this.parentElement && this.parentElement.tagName === "WJE-ORGCHART-GROUP") {
54
+ this.classList.add("parent-group");
55
+ }
56
+ }
57
+ /**
58
+ * Draws the component for the org chart item.
59
+ * @returns {DocumentFragment}
60
+ */
61
+ draw() {
62
+ let fragment = document.createDocumentFragment();
63
+ let native = document.createElement("div");
64
+ native.setAttribute("part", "native");
65
+ native.classList.add("orgchart-item");
66
+ let card = document.createElement("wje-card");
67
+ card.setAttribute("part", "card");
68
+ let slot = document.createElement("slot");
69
+ let child = document.createElement("slot");
70
+ child.setAttribute("name", "child");
71
+ let expander = document.createElement("div");
72
+ expander.setAttribute("part", "expander");
73
+ expander.classList.add("expander");
74
+ expander.innerHTML = "-";
75
+ card.appendChild(slot);
76
+ if (this.children.length > 0 && Array.from(this.children).some((el) => el.tagName === "WJE-ORGCHART"))
77
+ card.appendChild(expander);
78
+ native.appendChild(card);
79
+ native.appendChild(child);
80
+ fragment.appendChild(native);
81
+ this.expander = expander;
82
+ return fragment;
83
+ }
84
+ /**
85
+ * After Draws the component for the org chart item.
86
+ */
87
+ afterDraw() {
88
+ this.expander.addEventListener("click", this.toggleChildren);
89
+ }
90
+ dispatchEvent(e) {
91
+ return false;
92
+ }
93
+ }
94
+ OrgchartItem.define("wje-orgchart-item", OrgchartItem);
95
+ export {
96
+ OrgchartItem as default
97
+ };
98
+ //# sourceMappingURL=wje-orgchart-item.js.map
@@ -0,0 +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;"}
@@ -0,0 +1,49 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import WJElement from "./wje-element.js";
5
+ const styles = "* {\n margin: 0;\n padding: 0;\n}\n\n:host {\n position: relative;\n .native-orgchart {\n padding-top: var(--wje-orgchart-height-line);\n display: flex;\n justify-content: center;\n }\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 50%;\n border-left: 1px solid var(--wje-border-color);\n width: 0;\n height: var(--wje-orgchart-height-line);\n }\n}\n";
6
+ class Orgchart extends WJElement {
7
+ /**
8
+ * Creates an instance of Orgchart.
9
+ * @class
10
+ */
11
+ constructor() {
12
+ super();
13
+ __publicField(this, "className", "Orgchart");
14
+ }
15
+ /**
16
+ * Returns the CSS styles for the component.
17
+ * @static
18
+ * @returns {CSSStyleSheet}
19
+ */
20
+ static get cssStyleSheet() {
21
+ return styles;
22
+ }
23
+ /**
24
+ * Sets up the attributes for the component.
25
+ */
26
+ setupAttributes() {
27
+ this.isShadowRoot = "open";
28
+ }
29
+ /**
30
+ * Draws the component for the org chart.
31
+ * @returns {DocumentFragment}
32
+ */
33
+ draw() {
34
+ let fragment = document.createDocumentFragment();
35
+ let native = document.createElement("div");
36
+ native.setAttribute("part", "native");
37
+ native.classList.add("native-orgchart");
38
+ let slot = document.createElement("slot");
39
+ native.appendChild(slot);
40
+ fragment.appendChild(native);
41
+ this.native = native;
42
+ return fragment;
43
+ }
44
+ }
45
+ Orgchart.define("wje-orgchart", Orgchart);
46
+ export {
47
+ Orgchart as default
48
+ };
49
+ //# sourceMappingURL=wje-orgchart.js.map
@@ -0,0 +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 }\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","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;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,iBAAiB;AAEtC,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,WAAO,YAAY,IAAI;AAEvB,aAAS,YAAY,MAAM;AAE3B,SAAK,SAAS;AAEd,WAAO;AAAA,EACf;AACA;ACxDA,SAAS,OAAO,gBAAgB,QAAQ;"}
@@ -0,0 +1,6 @@
1
+ import { P as Popup } from "./popup.element-tyYxow0p.js";
2
+ Popup.define("wje-popup", Popup);
3
+ export {
4
+ Popup as default
5
+ };
6
+ //# sourceMappingURL=wje-popup.js.map