@paperless/core 1.17.4 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (512) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/assets/i18n/page-size-select.i18n.en.json +2 -2
  3. package/dist/assets/i18n/page-size-select.i18n.nl.json +2 -2
  4. package/dist/assets/i18n/table-footer.i18n.en.json +1 -1
  5. package/dist/assets/i18n/table-footer.i18n.nl.json +1 -1
  6. package/dist/assets/i18n/table-header.i18n.en.json +4 -4
  7. package/dist/assets/i18n/table-header.i18n.nl.json +4 -4
  8. package/dist/assets/i18n/table.i18n.en.json +15 -15
  9. package/dist/assets/i18n/table.i18n.nl.json +15 -15
  10. package/dist/build/p-03090f03.entry.js.map +1 -1
  11. package/dist/build/p-085e6ff4.entry.js.map +1 -1
  12. package/dist/build/p-2becd73c.entry.js.map +1 -1
  13. package/dist/build/p-2cb55f24.entry.js.map +1 -1
  14. package/dist/build/p-2cd5062f.entry.js.map +1 -1
  15. package/dist/build/p-35c563a7.entry.js.map +1 -1
  16. package/dist/build/p-415c5040.entry.js.map +1 -1
  17. package/dist/build/p-424d5c8a.entry.js.map +1 -1
  18. package/dist/build/p-46a939e2.entry.js.map +1 -1
  19. package/dist/build/p-4c30c74b.entry.js.map +1 -1
  20. package/dist/build/p-4dc5647e.entry.js.map +1 -1
  21. package/dist/build/p-4e9e4ce2.entry.js.map +1 -1
  22. package/dist/build/p-606ad811.entry.js.map +1 -1
  23. package/dist/build/p-682db916.entry.js.map +1 -1
  24. package/dist/build/p-699e0b35.entry.js.map +1 -1
  25. package/dist/build/p-6a5aeb90.entry.js.map +1 -1
  26. package/dist/build/p-7793ba3a.entry.js.map +1 -1
  27. package/dist/build/p-7d15ff9a.entry.js.map +1 -1
  28. package/dist/build/p-8426ca20.entry.js.map +1 -1
  29. package/dist/build/p-93052b42.entry.js.map +1 -1
  30. package/dist/build/p-97bcf0b5.entry.js.map +1 -1
  31. package/dist/build/p-9c914665.entry.js.map +1 -1
  32. package/dist/build/p-9d3d72fa.entry.js.map +1 -1
  33. package/dist/build/p-a2b552f9.entry.js.map +1 -1
  34. package/dist/build/p-a7344d53.entry.js +2 -0
  35. package/dist/build/p-a7344d53.entry.js.map +1 -0
  36. package/dist/build/p-af6b813e.entry.js.map +1 -1
  37. package/dist/build/p-b6f43309.entry.js.map +1 -1
  38. package/dist/build/p-b7c0f157.entry.js.map +1 -1
  39. package/dist/build/p-c644d1e3.entry.js.map +1 -1
  40. package/dist/build/p-c9b840a7.entry.js.map +1 -1
  41. package/dist/build/p-cb2674b5.entry.js.map +1 -1
  42. package/dist/build/p-cf7bd354.entry.js.map +1 -1
  43. package/dist/build/p-d0796984.entry.js.map +1 -1
  44. package/dist/build/p-d23db949.entry.js.map +1 -1
  45. package/dist/build/p-dace47c5.entry.js.map +1 -1
  46. package/dist/build/p-dd20caf1.entry.js.map +1 -1
  47. package/dist/build/p-dfa8eae9.entry.js +2 -0
  48. package/dist/build/p-dfa8eae9.entry.js.map +1 -0
  49. package/dist/build/p-ec15ee73.entry.js.map +1 -1
  50. package/dist/build/p-ec29eed0.entry.js.map +1 -1
  51. package/dist/build/p-f0f1a46b.entry.js.map +1 -1
  52. package/dist/build/p-f34e08ec.entry.js.map +1 -1
  53. package/dist/build/p-f9e52ae3.entry.js.map +1 -1
  54. package/dist/build/p-fac13366.entry.js.map +1 -1
  55. package/dist/build/paperless.css +1 -1
  56. package/dist/build/paperless.esm.js +1 -1
  57. package/dist/build/paperless.esm.js.map +1 -1
  58. package/dist/cjs/index-1fde8b14.js +4 -4
  59. package/dist/cjs/loader.cjs.js +1 -1
  60. package/dist/cjs/p-accordion.cjs.entry.js.map +1 -1
  61. package/dist/cjs/p-attachment.cjs.entry.js.map +1 -1
  62. package/dist/cjs/p-avatar-group.cjs.entry.js.map +1 -1
  63. package/dist/cjs/p-avatar.cjs.entry.js.map +1 -1
  64. package/dist/cjs/p-backdrop.cjs.entry.js.map +1 -1
  65. package/dist/cjs/p-button_3.cjs.entry.js.map +1 -1
  66. package/dist/cjs/p-calendar.cjs.entry.js +2 -2
  67. package/dist/cjs/p-calendar.cjs.entry.js.map +1 -1
  68. package/dist/cjs/p-card-body.cjs.entry.js.map +1 -1
  69. package/dist/cjs/p-card-container.cjs.entry.js.map +1 -1
  70. package/dist/cjs/p-card-header.cjs.entry.js.map +1 -1
  71. package/dist/cjs/p-content-slider.cjs.entry.js.map +1 -1
  72. package/dist/cjs/p-counter.cjs.entry.js.map +1 -1
  73. package/dist/cjs/p-cropper.cjs.entry.js.map +1 -1
  74. package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
  75. package/dist/cjs/p-divider.cjs.entry.js.map +1 -1
  76. package/dist/cjs/p-drawer-body_3.cjs.entry.js.map +1 -1
  77. package/dist/cjs/p-drawer.cjs.entry.js.map +1 -1
  78. package/dist/cjs/p-dropdown-menu-container.cjs.entry.js.map +1 -1
  79. package/dist/cjs/p-dropdown_2.cjs.entry.js +7 -2
  80. package/dist/cjs/p-dropdown_2.cjs.entry.js.map +1 -1
  81. package/dist/cjs/p-floating-menu-container_8.cjs.entry.js +40 -40
  82. package/dist/cjs/p-floating-menu-container_8.cjs.entry.js.map +1 -1
  83. package/dist/cjs/p-helper_3.cjs.entry.js +4 -4
  84. package/dist/cjs/p-helper_3.cjs.entry.js.map +1 -1
  85. package/dist/cjs/p-info-panel.cjs.entry.js.map +1 -1
  86. package/dist/cjs/p-label_3.cjs.entry.js +1 -1
  87. package/dist/cjs/p-label_3.cjs.entry.js.map +1 -1
  88. package/dist/cjs/p-layout.cjs.entry.js.map +1 -1
  89. package/dist/cjs/p-modal-body_4.cjs.entry.js.map +1 -1
  90. package/dist/cjs/p-modal.cjs.entry.js.map +1 -1
  91. package/dist/cjs/p-navbar.cjs.entry.js.map +1 -1
  92. package/dist/cjs/p-navigation-item.cjs.entry.js.map +1 -1
  93. package/dist/cjs/p-page-size-select_3.cjs.entry.js.map +1 -1
  94. package/dist/cjs/p-profile.cjs.entry.js.map +1 -1
  95. package/dist/cjs/p-select.cjs.entry.js +136 -18
  96. package/dist/cjs/p-select.cjs.entry.js.map +1 -1
  97. package/dist/cjs/p-slider-indicator.cjs.entry.js.map +1 -1
  98. package/dist/cjs/p-status.cjs.entry.js.map +1 -1
  99. package/dist/cjs/p-stepper-item.cjs.entry.js.map +1 -1
  100. package/dist/cjs/p-stepper-line.cjs.entry.js.map +1 -1
  101. package/dist/cjs/p-stepper.cjs.entry.js.map +1 -1
  102. package/dist/cjs/p-tab-group.cjs.entry.js.map +1 -1
  103. package/dist/cjs/p-tab-item.cjs.entry.js.map +1 -1
  104. package/dist/cjs/p-table-column.cjs.entry.js.map +1 -1
  105. package/dist/cjs/p-table.cjs.entry.js.map +1 -1
  106. package/dist/cjs/p-toast-container.cjs.entry.js.map +1 -1
  107. package/dist/cjs/p-toast.cjs.entry.js.map +1 -1
  108. package/dist/cjs/p-tooltip.cjs.entry.js.map +1 -1
  109. package/dist/cjs/paperless.cjs.js +1 -1
  110. package/dist/collection/components/atoms/avatar/avatar.component.js +1 -1
  111. package/dist/collection/components/atoms/avatar/avatar.component.js.map +1 -1
  112. package/dist/collection/components/atoms/avatar/test/avatar.component.e2e.js.map +1 -1
  113. package/dist/collection/components/atoms/avatar/test/avatar.component.spec.js.map +1 -1
  114. package/dist/collection/components/atoms/avatar-group/avatar-group.component.js.map +1 -1
  115. package/dist/collection/components/atoms/avatar-group/test/avatar-group.component.e2e.js.map +1 -1
  116. package/dist/collection/components/atoms/avatar-group/test/avatar-group.component.spec.js.map +1 -1
  117. package/dist/collection/components/atoms/backdrop/backdrop.component.js +1 -1
  118. package/dist/collection/components/atoms/backdrop/backdrop.component.js.map +1 -1
  119. package/dist/collection/components/atoms/backdrop/test/backdrop.component.e2e.js.map +1 -1
  120. package/dist/collection/components/atoms/backdrop/test/backdrop.component.spec.js.map +1 -1
  121. package/dist/collection/components/atoms/button/button.component.js.map +1 -1
  122. package/dist/collection/components/atoms/button/test/button.component.e2e.js.map +1 -1
  123. package/dist/collection/components/atoms/button/test/button.component.spec.js.map +1 -1
  124. package/dist/collection/components/atoms/card-body/card-body.component.js.map +1 -1
  125. package/dist/collection/components/atoms/card-body/test/card-body.component.e2e.js.map +1 -1
  126. package/dist/collection/components/atoms/card-body/test/card-body.component.spec.js.map +1 -1
  127. package/dist/collection/components/atoms/card-container/card-container.component.js.map +1 -1
  128. package/dist/collection/components/atoms/card-container/test/card-container.component.e2e.js.map +1 -1
  129. package/dist/collection/components/atoms/card-container/test/card-container.component.spec.js.map +1 -1
  130. package/dist/collection/components/atoms/card-header/card-header.component.js.map +1 -1
  131. package/dist/collection/components/atoms/card-header/test/card-header.component.e2e.js.map +1 -1
  132. package/dist/collection/components/atoms/card-header/test/card-header.component.spec.js.map +1 -1
  133. package/dist/collection/components/atoms/counter/counter.component.js.map +1 -1
  134. package/dist/collection/components/atoms/counter/test/counter.component.e2e.js.map +1 -1
  135. package/dist/collection/components/atoms/counter/test/counter.component.spec.js.map +1 -1
  136. package/dist/collection/components/atoms/divider/divider.component.js.map +1 -1
  137. package/dist/collection/components/atoms/divider/test/divider.component.e2e.js.map +1 -1
  138. package/dist/collection/components/atoms/divider/test/divider.component.spec.js.map +1 -1
  139. package/dist/collection/components/atoms/drawer-body/drawer-body.component.js.map +1 -1
  140. package/dist/collection/components/atoms/drawer-body/test/drawer-body.component.e2e.js.map +1 -1
  141. package/dist/collection/components/atoms/drawer-body/test/drawer-body.component.spec.js.map +1 -1
  142. package/dist/collection/components/atoms/drawer-container/drawer-container.component.js.map +1 -1
  143. package/dist/collection/components/atoms/drawer-container/test/drawer-container.component.e2e.js.map +1 -1
  144. package/dist/collection/components/atoms/drawer-container/test/drawer-container.component.spec.js.map +1 -1
  145. package/dist/collection/components/atoms/drawer-header/drawer-header.component.js.map +1 -1
  146. package/dist/collection/components/atoms/drawer-header/test/drawer-header.component.e2e.js.map +1 -1
  147. package/dist/collection/components/atoms/drawer-header/test/drawer-header.component.spec.js.map +1 -1
  148. package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js.map +1 -1
  149. package/dist/collection/components/atoms/dropdown-menu-container/test/dropdown-menu-container.component.e2e.js.map +1 -1
  150. package/dist/collection/components/atoms/dropdown-menu-container/test/dropdown-menu-item.component.spec.js.map +1 -1
  151. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +1 -1
  152. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +21 -2
  153. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js.map +1 -1
  154. package/dist/collection/components/atoms/dropdown-menu-item/test/dropdown-menu-item.component.e2e.js.map +1 -1
  155. package/dist/collection/components/atoms/dropdown-menu-item/test/dropdown-menu-item.component.spec.js.map +1 -1
  156. package/dist/collection/components/atoms/floating-menu-container/floating-menu-container.component.js.map +1 -1
  157. package/dist/collection/components/atoms/floating-menu-container/test/floating-menu-container.component.e2e.js.map +1 -1
  158. package/dist/collection/components/atoms/floating-menu-container/test/floating-menu-container.component.spec.js.map +1 -1
  159. package/dist/collection/components/atoms/floating-menu-item/floating-menu-item.component.js.map +1 -1
  160. package/dist/collection/components/atoms/floating-menu-item/test/floating-menu-container.component.e2e.js.map +1 -1
  161. package/dist/collection/components/atoms/floating-menu-item/test/floating-menu-container.component.spec.js.map +1 -1
  162. package/dist/collection/components/atoms/helper/helper.component.js.map +1 -1
  163. package/dist/collection/components/atoms/helper/test/helper.component.e2e.js.map +1 -1
  164. package/dist/collection/components/atoms/helper/test/helper.component.spec.js.map +1 -1
  165. package/dist/collection/components/atoms/icon/icon.component.js.map +1 -1
  166. package/dist/collection/components/atoms/icon/test/icon.component.e2e.js.map +1 -1
  167. package/dist/collection/components/atoms/icon/test/icon.component.spec.js.map +1 -1
  168. package/dist/collection/components/atoms/illustration/illustration.component.js +1 -1
  169. package/dist/collection/components/atoms/illustration/illustration.component.js.map +1 -1
  170. package/dist/collection/components/atoms/illustration/test/illustration.component.e2e.js.map +1 -1
  171. package/dist/collection/components/atoms/illustration/test/illustration.component.spec.js.map +1 -1
  172. package/dist/collection/components/atoms/info-panel/info-panel.component.js.map +1 -1
  173. package/dist/collection/components/atoms/info-panel/test/info-panel.component.e2e.js.map +1 -1
  174. package/dist/collection/components/atoms/info-panel/test/info-panel.component.spec.js.map +1 -1
  175. package/dist/collection/components/atoms/label/label.component.js +2 -2
  176. package/dist/collection/components/atoms/label/label.component.js.map +1 -1
  177. package/dist/collection/components/atoms/label/test/label.component.e2e.js.map +1 -1
  178. package/dist/collection/components/atoms/label/test/label.component.spec.js.map +1 -1
  179. package/dist/collection/components/atoms/layout/layout.component.js.map +1 -1
  180. package/dist/collection/components/atoms/layout/test/layout.component.e2e.js.map +1 -1
  181. package/dist/collection/components/atoms/layout/test/layout.component.spec.js.map +1 -1
  182. package/dist/collection/components/atoms/loader/loader.component.js +1 -1
  183. package/dist/collection/components/atoms/loader/loader.component.js.map +1 -1
  184. package/dist/collection/components/atoms/loader/test/loader.component.e2e.js.map +1 -1
  185. package/dist/collection/components/atoms/loader/test/loader.component.spec.js.map +1 -1
  186. package/dist/collection/components/atoms/modal-body/modal-body.component.js.map +1 -1
  187. package/dist/collection/components/atoms/modal-body/test/modal-body.component.e2e.js.map +1 -1
  188. package/dist/collection/components/atoms/modal-body/test/modal-body.component.spec.js.map +1 -1
  189. package/dist/collection/components/atoms/modal-container/modal-container.component.js.map +1 -1
  190. package/dist/collection/components/atoms/modal-container/test/modal-container.component.e2e.js.map +1 -1
  191. package/dist/collection/components/atoms/modal-container/test/modal-container.component.spec.js.map +1 -1
  192. package/dist/collection/components/atoms/modal-footer/modal-footer.component.js.map +1 -1
  193. package/dist/collection/components/atoms/modal-footer/test/modal-footer.component.e2e.js.map +1 -1
  194. package/dist/collection/components/atoms/modal-footer/test/modal-footer.component.spec.js.map +1 -1
  195. package/dist/collection/components/atoms/modal-header/modal-header.component.js.map +1 -1
  196. package/dist/collection/components/atoms/modal-header/test/modal-header.component.e2e.js.map +1 -1
  197. package/dist/collection/components/atoms/modal-header/test/modal-header.component.spec.js.map +1 -1
  198. package/dist/collection/components/atoms/pagination-item/pagination-item.component.js.map +1 -1
  199. package/dist/collection/components/atoms/pagination-item/test/pagination-item.component.e2e.js.map +1 -1
  200. package/dist/collection/components/atoms/pagination-item/test/pagination-item.component.spec.js.map +1 -1
  201. package/dist/collection/components/atoms/segment-container/segment-container.component.js.map +1 -1
  202. package/dist/collection/components/atoms/segment-container/test/segment-container.component.e2e.js.map +1 -1
  203. package/dist/collection/components/atoms/segment-container/test/segment-container.component.spec.js.map +1 -1
  204. package/dist/collection/components/atoms/segment-item/segment-item.component.js +1 -1
  205. package/dist/collection/components/atoms/segment-item/segment-item.component.js.map +1 -1
  206. package/dist/collection/components/atoms/segment-item/test/segment-item.component.e2e.js.map +1 -1
  207. package/dist/collection/components/atoms/segment-item/test/segment-item.component.spec.js.map +1 -1
  208. package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.js.map +1 -1
  209. package/dist/collection/components/atoms/slider-indicator/test/slider-indicator.component.e2e.js.map +1 -1
  210. package/dist/collection/components/atoms/slider-indicator/test/slider-indicator.component.spec.js.map +1 -1
  211. package/dist/collection/components/atoms/status/status.component.js.map +1 -1
  212. package/dist/collection/components/atoms/status/test/status.component.e2e.js.map +1 -1
  213. package/dist/collection/components/atoms/status/test/status.component.spec.js.map +1 -1
  214. package/dist/collection/components/atoms/stepper-item/stepper-item.component.js.map +1 -1
  215. package/dist/collection/components/atoms/stepper-item/test/stepper-item.component.e2e.js.map +1 -1
  216. package/dist/collection/components/atoms/stepper-item/test/stepper-item.component.spec.js.map +1 -1
  217. package/dist/collection/components/atoms/stepper-line/stepper-line.component.js.map +1 -1
  218. package/dist/collection/components/atoms/stepper-line/test/stepper-line.component.e2e.js.map +1 -1
  219. package/dist/collection/components/atoms/stepper-line/test/stepper-line.component.spec.js.map +1 -1
  220. package/dist/collection/components/atoms/tab-group/tab-group.component.js.map +1 -1
  221. package/dist/collection/components/atoms/tab-group/test/tab-group.component.e2e.js.map +1 -1
  222. package/dist/collection/components/atoms/tab-group/test/tab-group.component.spec.js.map +1 -1
  223. package/dist/collection/components/atoms/tab-item/tab-item.component.js.map +1 -1
  224. package/dist/collection/components/atoms/tab-item/test/tab-item.component.e2e.js.map +1 -1
  225. package/dist/collection/components/atoms/tab-item/test/tab-item.component.spec.js.map +1 -1
  226. package/dist/collection/components/atoms/table-container/table-container.component.js.map +1 -1
  227. package/dist/collection/components/atoms/table-container/test/table-container.component.e2e.js.map +1 -1
  228. package/dist/collection/components/atoms/table-container/test/table-container.component.spec.js.map +1 -1
  229. package/dist/collection/components/atoms/toast-container/test/toast-container.component.e2e.js.map +1 -1
  230. package/dist/collection/components/atoms/toast-container/test/toast-container.component.spec.js.map +1 -1
  231. package/dist/collection/components/atoms/toast-container/toast-container.component.js.map +1 -1
  232. package/dist/collection/components/atoms/tooltip/test/tooltip.component.e2e.js.map +1 -1
  233. package/dist/collection/components/atoms/tooltip/test/tooltip.component.spec.js.map +1 -1
  234. package/dist/collection/components/atoms/tooltip/tooltip.component.js.map +1 -1
  235. package/dist/collection/components/helpers/table-column/table-column.component.js +1 -1
  236. package/dist/collection/components/helpers/table-column/table-column.component.js.map +1 -1
  237. package/dist/collection/components/molecules/accordion/accordion.component.js.map +1 -1
  238. package/dist/collection/components/molecules/accordion/test/accordion.component.e2e.js.map +1 -1
  239. package/dist/collection/components/molecules/accordion/test/accordion.component.spec.js.map +1 -1
  240. package/dist/collection/components/molecules/attachment/attachment.component.js.map +1 -1
  241. package/dist/collection/components/molecules/attachment/test/attachment.component.e2e.js.map +1 -1
  242. package/dist/collection/components/molecules/attachment/test/attachment.component.spec.js.map +1 -1
  243. package/dist/collection/components/molecules/calendar/calendar.component.js +2 -2
  244. package/dist/collection/components/molecules/calendar/calendar.component.js.map +1 -1
  245. package/dist/collection/components/molecules/calendar/test/calendar.component.e2e.js.map +1 -1
  246. package/dist/collection/components/molecules/calendar/test/calendar.component.spec.js.map +1 -1
  247. package/dist/collection/components/molecules/content-slider/content-slider.component.js.map +1 -1
  248. package/dist/collection/components/molecules/content-slider/test/content-slider.component.e2e.js.map +1 -1
  249. package/dist/collection/components/molecules/content-slider/test/content-slider.component.spec.js.map +1 -1
  250. package/dist/collection/components/molecules/cropper/cropper.component.js.map +1 -1
  251. package/dist/collection/components/molecules/cropper/test/cropper.component.e2e.js.map +1 -1
  252. package/dist/collection/components/molecules/cropper/test/cropper.component.spec.js.map +1 -1
  253. package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -1
  254. package/dist/collection/components/molecules/datepicker/test/datepicker.component.e2e.js.map +1 -1
  255. package/dist/collection/components/molecules/datepicker/test/datepicker.component.spec.js.map +1 -1
  256. package/dist/collection/components/molecules/dropdown/dropdown.component.js +22 -0
  257. package/dist/collection/components/molecules/dropdown/dropdown.component.js.map +1 -1
  258. package/dist/collection/components/molecules/dropdown/test/dropdown.component.e2e.js.map +1 -1
  259. package/dist/collection/components/molecules/dropdown/test/dropdown.component.spec.js.map +1 -1
  260. package/dist/collection/components/molecules/input-error/input-error.component.js.map +1 -1
  261. package/dist/collection/components/molecules/input-error/test/input-error.component.e2e.js.map +1 -1
  262. package/dist/collection/components/molecules/input-error/test/input-error.component.spec.js.map +1 -1
  263. package/dist/collection/components/molecules/input-group/input-group.component.js +4 -4
  264. package/dist/collection/components/molecules/input-group/input-group.component.js.map +1 -1
  265. package/dist/collection/components/molecules/input-group/test/input-group.component.e2e.js.map +1 -1
  266. package/dist/collection/components/molecules/input-group/test/input-group.component.spec.js.map +1 -1
  267. package/dist/collection/components/molecules/navigation-item/navigation-item.component.js.map +1 -1
  268. package/dist/collection/components/molecules/navigation-item/test/navigation-item.component.e2e.js.map +1 -1
  269. package/dist/collection/components/molecules/navigation-item/test/navigation-item.component.spec.js.map +1 -1
  270. package/dist/collection/components/molecules/page-size-select/page-size-select.component.js +2 -2
  271. package/dist/collection/components/molecules/page-size-select/page-size-select.component.js.map +1 -1
  272. package/dist/collection/components/molecules/page-size-select/test/page-size-select.component.e2e.js.map +1 -1
  273. package/dist/collection/components/molecules/page-size-select/test/page-size-select.component.spec.js.map +1 -1
  274. package/dist/collection/components/molecules/pagination/pagination.component.js +1 -1
  275. package/dist/collection/components/molecules/pagination/pagination.component.js.map +1 -1
  276. package/dist/collection/components/molecules/pagination/test/pagination.component.e2e.js.map +1 -1
  277. package/dist/collection/components/molecules/pagination/test/pagination.component.spec.js.map +1 -1
  278. package/dist/collection/components/molecules/profile/profile.component.js.map +1 -1
  279. package/dist/collection/components/molecules/profile/test/profile.component.e2e.js.map +1 -1
  280. package/dist/collection/components/molecules/profile/test/profile.component.spec.js.map +1 -1
  281. package/dist/collection/components/molecules/select/select.component.css +1 -1
  282. package/dist/collection/components/molecules/select/select.component.js +238 -18
  283. package/dist/collection/components/molecules/select/select.component.js.map +1 -1
  284. package/dist/collection/components/molecules/select/test/select.component.e2e.js.map +1 -1
  285. package/dist/collection/components/molecules/select/test/select.component.spec.js.map +1 -1
  286. package/dist/collection/components/molecules/stepper/stepper.component.js.map +1 -1
  287. package/dist/collection/components/molecules/stepper/test/stepper.component.e2e.js.map +1 -1
  288. package/dist/collection/components/molecules/stepper/test/stepper.component.spec.js.map +1 -1
  289. package/dist/collection/components/molecules/table-cell/table-cell.component.js +40 -40
  290. package/dist/collection/components/molecules/table-cell/table-cell.component.js.map +1 -1
  291. package/dist/collection/components/molecules/table-cell/test/table-cell.component.e2e.js.map +1 -1
  292. package/dist/collection/components/molecules/table-cell/test/table-cell.component.spec.js.map +1 -1
  293. package/dist/collection/components/molecules/table-footer/table-footer.component.js +2 -2
  294. package/dist/collection/components/molecules/table-footer/table-footer.component.js.map +1 -1
  295. package/dist/collection/components/molecules/table-footer/test/table-footer.component.e2e.js.map +1 -1
  296. package/dist/collection/components/molecules/table-footer/test/table-footer.component.spec.js.map +1 -1
  297. package/dist/collection/components/molecules/table-header/table-header.component.js.map +1 -1
  298. package/dist/collection/components/molecules/table-header/test/table-header.component.e2e.js.map +1 -1
  299. package/dist/collection/components/molecules/table-header/test/table-header.component.spec.js.map +1 -1
  300. package/dist/collection/components/molecules/table-row/table-row.component.js.map +1 -1
  301. package/dist/collection/components/molecules/table-row/test/table-row.component.e2e.js.map +1 -1
  302. package/dist/collection/components/molecules/table-row/test/table-row.component.spec.js.map +1 -1
  303. package/dist/collection/components/molecules/toast/test/toast.component.e2e.js.map +1 -1
  304. package/dist/collection/components/molecules/toast/test/toast.component.spec.js.map +1 -1
  305. package/dist/collection/components/molecules/toast/toast.component.js.map +1 -1
  306. package/dist/collection/components/organisms/drawer/drawer.component.js +2 -2
  307. package/dist/collection/components/organisms/drawer/drawer.component.js.map +1 -1
  308. package/dist/collection/components/organisms/drawer/test/drawer.component.e2e.js.map +1 -1
  309. package/dist/collection/components/organisms/drawer/test/drawer.component.spec.js.map +1 -1
  310. package/dist/collection/components/organisms/modal/modal.component.js.map +1 -1
  311. package/dist/collection/components/organisms/modal/test/modal.component.e2e.js.map +1 -1
  312. package/dist/collection/components/organisms/modal/test/modal.component.spec.js.map +1 -1
  313. package/dist/collection/components/organisms/navbar/navbar.component.js.map +1 -1
  314. package/dist/collection/components/organisms/navbar/test/navbar.component.e2e.js.map +1 -1
  315. package/dist/collection/components/organisms/navbar/test/navbar.component.spec.js.map +1 -1
  316. package/dist/collection/components/organisms/table/table.component.js +6 -6
  317. package/dist/collection/components/organisms/table/table.component.js.map +1 -1
  318. package/dist/collection/components/organisms/table/test/table.component.e2e.js.map +1 -1
  319. package/dist/collection/components/organisms/table/test/table.component.spec.js.map +1 -1
  320. package/dist/components/avatar.component.js +70 -0
  321. package/dist/components/avatar.component.js.map +1 -0
  322. package/dist/components/backdrop.component.js.map +1 -1
  323. package/dist/components/button.component.js.map +1 -1
  324. package/dist/components/calendar.component.js +2 -2
  325. package/dist/components/calendar.component.js.map +1 -1
  326. package/dist/components/counter.component.js.map +1 -1
  327. package/dist/components/divider.component.js.map +1 -1
  328. package/dist/components/drawer-body.component.js.map +1 -1
  329. package/dist/components/drawer-container.component.js.map +1 -1
  330. package/dist/components/drawer-header.component.js.map +1 -1
  331. package/dist/components/dropdown-menu-container.component.js.map +1 -1
  332. package/dist/components/dropdown-menu-item.component.js +4 -2
  333. package/dist/components/dropdown-menu-item.component.js.map +1 -1
  334. package/dist/components/dropdown.component.js +5 -0
  335. package/dist/components/dropdown.component.js.map +1 -1
  336. package/dist/components/floating-menu-container.component.js.map +1 -1
  337. package/dist/components/floating-menu-item.component.js.map +1 -1
  338. package/dist/components/helper.component.js.map +1 -1
  339. package/dist/components/icon.component.js.map +1 -1
  340. package/dist/components/illustration.component.js +1 -1
  341. package/dist/components/illustration.component.js.map +1 -1
  342. package/dist/components/input-error.component.js.map +1 -1
  343. package/dist/components/input-group.component.js +4 -4
  344. package/dist/components/input-group.component.js.map +1 -1
  345. package/dist/components/label.component.js.map +1 -1
  346. package/dist/components/loader.component.js.map +1 -1
  347. package/dist/components/modal-body.component.js.map +1 -1
  348. package/dist/components/modal-container.component.js.map +1 -1
  349. package/dist/components/modal-footer.component.js.map +1 -1
  350. package/dist/components/modal-header.component.js.map +1 -1
  351. package/dist/components/p-accordion.js.map +1 -1
  352. package/dist/components/p-attachment.js.map +1 -1
  353. package/dist/components/p-avatar-group.js.map +1 -1
  354. package/dist/components/p-avatar.js +1 -66
  355. package/dist/components/p-avatar.js.map +1 -1
  356. package/dist/components/p-card-body.js.map +1 -1
  357. package/dist/components/p-card-container.js.map +1 -1
  358. package/dist/components/p-card-header.js.map +1 -1
  359. package/dist/components/p-content-slider.js.map +1 -1
  360. package/dist/components/p-cropper.js.map +1 -1
  361. package/dist/components/p-datepicker.js.map +1 -1
  362. package/dist/components/p-drawer.js.map +1 -1
  363. package/dist/components/p-info-panel.js.map +1 -1
  364. package/dist/components/p-layout.js.map +1 -1
  365. package/dist/components/p-modal.js.map +1 -1
  366. package/dist/components/p-navbar.js.map +1 -1
  367. package/dist/components/p-navigation-item.js.map +1 -1
  368. package/dist/components/p-profile.js.map +1 -1
  369. package/dist/components/p-select.js +150 -20
  370. package/dist/components/p-select.js.map +1 -1
  371. package/dist/components/p-status.js.map +1 -1
  372. package/dist/components/p-stepper-item.js.map +1 -1
  373. package/dist/components/p-stepper.js.map +1 -1
  374. package/dist/components/p-tab-group.js.map +1 -1
  375. package/dist/components/p-tab-item.js.map +1 -1
  376. package/dist/components/p-table-column.js.map +1 -1
  377. package/dist/components/p-table.js.map +1 -1
  378. package/dist/components/p-toast-container.js.map +1 -1
  379. package/dist/components/p-toast.js.map +1 -1
  380. package/dist/components/page-size-select.component.js.map +1 -1
  381. package/dist/components/pagination-item.component.js.map +1 -1
  382. package/dist/components/pagination.component.js.map +1 -1
  383. package/dist/components/segment-container.component.js.map +1 -1
  384. package/dist/components/segment-item.component.js +1 -1
  385. package/dist/components/segment-item.component.js.map +1 -1
  386. package/dist/components/slider-indicator.component.js.map +1 -1
  387. package/dist/components/stepper-line.component.js.map +1 -1
  388. package/dist/components/table-cell.component.js +39 -39
  389. package/dist/components/table-cell.component.js.map +1 -1
  390. package/dist/components/table-container.component.js.map +1 -1
  391. package/dist/components/table-footer.component.js.map +1 -1
  392. package/dist/components/table-header.component.js.map +1 -1
  393. package/dist/components/table-row.component.js.map +1 -1
  394. package/dist/components/tooltip.component.js.map +1 -1
  395. package/dist/esm/index-7b917f6b.js +4 -4
  396. package/dist/esm/loader.js +1 -1
  397. package/dist/esm/p-accordion.entry.js.map +1 -1
  398. package/dist/esm/p-attachment.entry.js.map +1 -1
  399. package/dist/esm/p-avatar-group.entry.js.map +1 -1
  400. package/dist/esm/p-avatar.entry.js.map +1 -1
  401. package/dist/esm/p-backdrop.entry.js.map +1 -1
  402. package/dist/esm/p-button_3.entry.js.map +1 -1
  403. package/dist/esm/p-calendar.entry.js +2 -2
  404. package/dist/esm/p-calendar.entry.js.map +1 -1
  405. package/dist/esm/p-card-body.entry.js.map +1 -1
  406. package/dist/esm/p-card-container.entry.js.map +1 -1
  407. package/dist/esm/p-card-header.entry.js.map +1 -1
  408. package/dist/esm/p-content-slider.entry.js.map +1 -1
  409. package/dist/esm/p-counter.entry.js.map +1 -1
  410. package/dist/esm/p-cropper.entry.js.map +1 -1
  411. package/dist/esm/p-datepicker.entry.js.map +1 -1
  412. package/dist/esm/p-divider.entry.js.map +1 -1
  413. package/dist/esm/p-drawer-body_3.entry.js.map +1 -1
  414. package/dist/esm/p-drawer.entry.js.map +1 -1
  415. package/dist/esm/p-dropdown-menu-container.entry.js.map +1 -1
  416. package/dist/esm/p-dropdown_2.entry.js +7 -2
  417. package/dist/esm/p-dropdown_2.entry.js.map +1 -1
  418. package/dist/esm/p-floating-menu-container_8.entry.js +40 -40
  419. package/dist/esm/p-floating-menu-container_8.entry.js.map +1 -1
  420. package/dist/esm/p-helper_3.entry.js +4 -4
  421. package/dist/esm/p-helper_3.entry.js.map +1 -1
  422. package/dist/esm/p-info-panel.entry.js.map +1 -1
  423. package/dist/esm/p-label_3.entry.js +1 -1
  424. package/dist/esm/p-label_3.entry.js.map +1 -1
  425. package/dist/esm/p-layout.entry.js.map +1 -1
  426. package/dist/esm/p-modal-body_4.entry.js.map +1 -1
  427. package/dist/esm/p-modal.entry.js.map +1 -1
  428. package/dist/esm/p-navbar.entry.js.map +1 -1
  429. package/dist/esm/p-navigation-item.entry.js.map +1 -1
  430. package/dist/esm/p-page-size-select_3.entry.js.map +1 -1
  431. package/dist/esm/p-profile.entry.js.map +1 -1
  432. package/dist/esm/p-select.entry.js +136 -18
  433. package/dist/esm/p-select.entry.js.map +1 -1
  434. package/dist/esm/p-slider-indicator.entry.js.map +1 -1
  435. package/dist/esm/p-status.entry.js.map +1 -1
  436. package/dist/esm/p-stepper-item.entry.js.map +1 -1
  437. package/dist/esm/p-stepper-line.entry.js.map +1 -1
  438. package/dist/esm/p-stepper.entry.js.map +1 -1
  439. package/dist/esm/p-tab-group.entry.js.map +1 -1
  440. package/dist/esm/p-tab-item.entry.js.map +1 -1
  441. package/dist/esm/p-table-column.entry.js.map +1 -1
  442. package/dist/esm/p-table.entry.js.map +1 -1
  443. package/dist/esm/p-toast-container.entry.js.map +1 -1
  444. package/dist/esm/p-toast.entry.js.map +1 -1
  445. package/dist/esm/p-tooltip.entry.js.map +1 -1
  446. package/dist/esm/paperless.js +1 -1
  447. package/dist/index.html +1 -1
  448. package/dist/paperless/p-03090f03.entry.js.map +1 -1
  449. package/dist/paperless/p-085e6ff4.entry.js.map +1 -1
  450. package/dist/paperless/p-2becd73c.entry.js.map +1 -1
  451. package/dist/paperless/p-2cb55f24.entry.js.map +1 -1
  452. package/dist/paperless/p-2cd5062f.entry.js.map +1 -1
  453. package/dist/paperless/p-35c563a7.entry.js.map +1 -1
  454. package/dist/paperless/p-415c5040.entry.js.map +1 -1
  455. package/dist/paperless/p-424d5c8a.entry.js.map +1 -1
  456. package/dist/paperless/p-46a939e2.entry.js.map +1 -1
  457. package/dist/paperless/p-4c30c74b.entry.js.map +1 -1
  458. package/dist/paperless/p-4dc5647e.entry.js.map +1 -1
  459. package/dist/paperless/p-4e9e4ce2.entry.js.map +1 -1
  460. package/dist/paperless/p-606ad811.entry.js.map +1 -1
  461. package/dist/paperless/p-682db916.entry.js.map +1 -1
  462. package/dist/paperless/p-699e0b35.entry.js.map +1 -1
  463. package/dist/paperless/p-6a5aeb90.entry.js.map +1 -1
  464. package/dist/paperless/p-7793ba3a.entry.js.map +1 -1
  465. package/dist/paperless/p-7d15ff9a.entry.js.map +1 -1
  466. package/dist/paperless/p-8426ca20.entry.js.map +1 -1
  467. package/dist/paperless/p-93052b42.entry.js.map +1 -1
  468. package/dist/paperless/p-97bcf0b5.entry.js.map +1 -1
  469. package/dist/paperless/p-9c914665.entry.js.map +1 -1
  470. package/dist/paperless/p-9d3d72fa.entry.js.map +1 -1
  471. package/dist/paperless/p-a2b552f9.entry.js.map +1 -1
  472. package/dist/paperless/p-a7344d53.entry.js +2 -0
  473. package/dist/paperless/p-a7344d53.entry.js.map +1 -0
  474. package/dist/paperless/p-af6b813e.entry.js.map +1 -1
  475. package/dist/paperless/p-b6f43309.entry.js.map +1 -1
  476. package/dist/paperless/p-b7c0f157.entry.js.map +1 -1
  477. package/dist/paperless/p-c644d1e3.entry.js.map +1 -1
  478. package/dist/paperless/p-c9b840a7.entry.js.map +1 -1
  479. package/dist/paperless/p-cb2674b5.entry.js.map +1 -1
  480. package/dist/paperless/p-cf7bd354.entry.js.map +1 -1
  481. package/dist/paperless/p-d0796984.entry.js.map +1 -1
  482. package/dist/paperless/p-d23db949.entry.js.map +1 -1
  483. package/dist/paperless/p-dace47c5.entry.js.map +1 -1
  484. package/dist/paperless/p-dd20caf1.entry.js.map +1 -1
  485. package/dist/paperless/p-dfa8eae9.entry.js +2 -0
  486. package/dist/paperless/p-dfa8eae9.entry.js.map +1 -0
  487. package/dist/paperless/p-ec15ee73.entry.js.map +1 -1
  488. package/dist/paperless/p-ec29eed0.entry.js.map +1 -1
  489. package/dist/paperless/p-f0f1a46b.entry.js.map +1 -1
  490. package/dist/paperless/p-f34e08ec.entry.js.map +1 -1
  491. package/dist/paperless/p-f9e52ae3.entry.js.map +1 -1
  492. package/dist/paperless/p-fac13366.entry.js.map +1 -1
  493. package/dist/paperless/paperless.css +7 -0
  494. package/dist/paperless/paperless.esm.js +1 -1
  495. package/dist/paperless/paperless.esm.js.map +1 -1
  496. package/dist/style/form/_checkbox.scss +4 -0
  497. package/dist/sw.js +1 -1
  498. package/dist/sw.js.map +1 -1
  499. package/dist/types/components/atoms/dropdown-menu-item/dropdown-menu-item.component.d.ts +4 -0
  500. package/dist/types/components/molecules/dropdown/dropdown.component.d.ts +4 -0
  501. package/dist/types/components/molecules/select/select.component.d.ts +34 -0
  502. package/dist/types/components.d.ts +105 -45
  503. package/hydrate/index.js +201 -70
  504. package/package.json +1 -1
  505. package/dist/build/p-573648d0.entry.js +0 -2
  506. package/dist/build/p-573648d0.entry.js.map +0 -1
  507. package/dist/build/p-9c7cfd25.entry.js +0 -2
  508. package/dist/build/p-9c7cfd25.entry.js.map +0 -1
  509. package/dist/paperless/p-573648d0.entry.js +0 -2
  510. package/dist/paperless/p-573648d0.entry.js.map +0 -1
  511. package/dist/paperless/p-9c7cfd25.entry.js +0 -2
  512. package/dist/paperless/p-9c7cfd25.entry.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-7b917f6b.js';
2
2
  import { c as childOf } from './child-of-fec6ab3a.js';
3
3
 
4
- const selectComponentCss = ".flex{display:flex!important}.w-full{width:100%!important}*{box-sizing:border-box}p-select{display:flex;flex-direction:column;width:100%}p-select input.read-only{text-overflow:ellipsis}.static{position:static!important}.h-6{height:1.5rem!important}.cursor-pointer{cursor:pointer!important}.rounded{border-radius:.25rem!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}";
4
+ const selectComponentCss = ".pointer-events-none{pointer-events:none!important}.pointer-events-auto{pointer-events:auto!important}.absolute{position:absolute!important}.relative{position:relative!important}.left-0{left:0!important}.top-0{top:0!important}.flex{display:flex!important}.h-\\[1\\.625rem\\]{height:1.625rem!important}.h-full{height:100%!important}.w-full{width:100%!important}.cursor-pointer{cursor:pointer!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.gap-2{gap:.5rem!important}.overflow-hidden{overflow:hidden!important}.rounded{border-radius:.25rem!important}.bg-indigo-light{--tw-bg-opacity:1!important;background-color:rgb(241 246 255/var(--tw-bg-opacity))!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.py-4{padding-bottom:1rem!important;padding-top:1rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.font-semibold{font-weight:600!important}.text-indigo{--tw-text-opacity:1!important;color:rgb(82 138 250/var(--tw-text-opacity))!important}.text-indigo-dark{--tw-text-opacity:1!important;color:rgb(44 75 169/var(--tw-text-opacity))!important}.text-storm-medium{--tw-text-opacity:1!important;color:rgb(128 130 158/var(--tw-text-opacity))!important}*{box-sizing:border-box}p-select{display:flex;flex-direction:column;position:relative;width:100%}p-select input.read-only{text-overflow:ellipsis}p-select .multi-container{align-items:center;display:flex;gap:.5rem;height:100%;left:0;overflow:hidden;padding:1rem .5rem;pointer-events:none;position:absolute;top:0;width:100%}p-select .multi-container .item{--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;background-color:rgb(241 246 255/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(44 75 169/var(--tw-text-opacity));cursor:pointer;display:flex;font-size:.875rem;font-weight:600;gap:.5rem;height:1.625rem;line-height:1.25rem;padding-left:.5rem;padding-right:.5rem;pointer-events:auto;white-space:nowrap}p-select .multi-container .item p-icon{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity));font-size:.75rem;line-height:1rem}p-select .multi-container .extra{--tw-text-opacity:1;color:rgb(128 130 158/var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem;pointer-events:none}.static{position:static!important}.hidden{display:none!important}.h-6{height:1.5rem!important}.gap-1{gap:.25rem!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}";
5
5
 
6
6
  const Select = class {
7
7
  constructor(hostRef) {
@@ -9,7 +9,9 @@ const Select = class {
9
9
  this.queryChange = createEvent(this, "queryChange", 3);
10
10
  this.valueChange = createEvent(this, "valueChange", 3);
11
11
  this.dropdownShown = createEvent(this, "dropdownShown", 3);
12
+ this.add = createEvent(this, "add", 3);
12
13
  this.items = undefined;
14
+ this.multi = undefined;
13
15
  this.icon = undefined;
14
16
  this.query = undefined;
15
17
  this.placeholder = undefined;
@@ -17,6 +19,8 @@ const Select = class {
17
19
  this.value = undefined;
18
20
  this.displayKey = 'text';
19
21
  this.valueKey = undefined;
22
+ this.avatarKey = undefined;
23
+ this.avatarLettersKey = undefined;
20
24
  this.identifierKey = undefined;
21
25
  this.queryKey = undefined;
22
26
  this.autoSelectFirst = true;
@@ -33,9 +37,12 @@ const Select = class {
33
37
  this.required = undefined;
34
38
  this.error = undefined;
35
39
  this.disabled = false;
40
+ this.showAddItem = false;
41
+ this.addItemText = 'Add item';
36
42
  this._showDropdown = false;
37
43
  this._selectedItem = null;
38
44
  this._isAutoCompleting = false;
45
+ this._amountHidden = 0;
39
46
  }
40
47
  get _items() {
41
48
  var _a, _b;
@@ -68,11 +75,14 @@ const Select = class {
68
75
  return items === null || items === void 0 ? void 0 : items.slice(0, this.maxDisplayedItems);
69
76
  }
70
77
  get _displayValue() {
71
- var _a;
78
+ var _a, _b;
72
79
  if (this._isAutoCompleting) {
73
80
  return this.query;
74
81
  }
75
- return (_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a[this.displayKey];
82
+ if (this.multi) {
83
+ return (_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a.map((i) => i === null || i === void 0 ? void 0 : i[this.displayKey]).filter((i) => !!i);
84
+ }
85
+ return (_b = this._selectedItem) === null || _b === void 0 ? void 0 : _b[this.displayKey];
76
86
  }
77
87
  get _placeholder() {
78
88
  var _a;
@@ -88,17 +98,46 @@ const Select = class {
88
98
  if (!this.valueKey && !this.identifierKey) {
89
99
  throw new Error('You must provide a valueKey or identifierKey');
90
100
  }
101
+ if (this.multi) {
102
+ this.enableAutocomplete = false;
103
+ this._setMultiContainerMaxWidth();
104
+ this._resizeObserver = new ResizeObserver(() => {
105
+ if (this._resizeDebounceTimer) {
106
+ clearTimeout(this._resizeDebounceTimer);
107
+ this._resizeDebounceTimer = null;
108
+ }
109
+ this._resizeDebounceTimer = setTimeout(() => {
110
+ this._setMultiContainerMaxWidth();
111
+ this._checkSelectedItems();
112
+ }, 200);
113
+ });
114
+ this._resizeObserver.observe(this._el);
115
+ }
91
116
  if (this.value) {
92
117
  this._valueChange();
93
118
  return;
94
119
  }
95
120
  this.itemChanges();
96
121
  }
122
+ componentDidRender() {
123
+ if (this.multi) {
124
+ this._setMultiContainerMaxWidth();
125
+ this._checkSelectedItems();
126
+ }
127
+ }
128
+ disconnectedCallback() {
129
+ if (this.multi) {
130
+ this._resizeObserver.disconnect();
131
+ }
132
+ }
97
133
  render() {
134
+ var _a, _b;
98
135
  return (h(Host, { class: "p-select" }, this._showDropdown && (!!this._items.length || this.loading), this._isAutoCompleting, h("p-dropdown", { disableTriggerClick: true, calculateWidth: true, insideClick: true, scrollable: true, show: this._showDropdown &&
99
- (!!this._items.length || this.loading) }, h("p-input-group", { slot: "trigger", icon: this.icon, size: this.size, prefix: this.prefix, label: this.label, helper: this.helper, required: this.required, error: this.error, disabled: this.disabled, focused: this._showDropdown, focusMethod: this.enableAutocomplete ? 'focus' : 'click' }, h("input", { slot: "input", type: "text", placeholder: this._placeholder, value: this._displayValue, class: `p-input cursor-pointer ${!this._isAutoCompleting && 'read-only'}`, onFocus: (ev) => this._onFocus(ev), onMouseDown: (ev) => this._onMouseDown(ev), onClick: () => this._onClick(), onInput: (ev) => this._onChange(ev) }), this.showChevron && (h("p-icon", { variant: "chevron", slot: "suffix" }))), h("div", { slot: "items" }, this.loading
136
+ (!!this._items.length || this.loading) }, h("p-input-group", { slot: "trigger", icon: this.icon, size: this.size, prefix: this.prefix, label: this.label, helper: this.helper, required: this.required, error: this.error, disabled: this.disabled, focused: this._showDropdown, focusMethod: this.enableAutocomplete ? 'focus' : 'click' }, h("input", { slot: "input", type: "text", placeholder: this._placeholder, value: this.multi && ((_a = this._displayValue) === null || _a === void 0 ? void 0 : _a.length)
137
+ ? ' '
138
+ : this._displayValue, class: `p-input cursor-pointer ${!this._isAutoCompleting && 'read-only'}`, onFocus: (ev) => this._onFocus(ev), onMouseDown: (ev) => this._onMouseDown(ev), onClick: () => this._onClick(), onInput: (ev) => this._onChange(ev), ref: (ref) => (this._inputRef = ref) }), this.showChevron && (h("p-icon", { variant: "chevron", slot: "suffix" }))), h("div", { slot: "items" }, this.loading
100
139
  ? this._getLoadingItems()
101
- : this._getItems()))));
140
+ : this._getItems(), this.showAddItem && this._getAddItem())), this.multi && ((_b = this._selectedItem) === null || _b === void 0 ? void 0 : _b.length) > 0 && (h("div", { class: "multi-container", ref: (ref) => (this._multiContainerRef = ref) }, this._selectedItem.map((item) => (h("div", { class: "item", onClick: () => this._selectValue(item) }, item[this.displayKey], h("p-icon", { variant: "negative" })))), h("div", { class: "extra hidden" }, "+", this._amountHidden)))));
102
141
  }
103
142
  documentClickHandler({ target }) {
104
143
  if (!this._showDropdown || childOf(target, this._el)) {
@@ -124,14 +163,28 @@ const Select = class {
124
163
  if (this._isAutoCompleting && ((_a = this.query) === null || _a === void 0 ? void 0 : _a.length)) {
125
164
  return;
126
165
  }
127
- let value = this.value;
166
+ let value = typeof this.value === 'string' && this.multi
167
+ ? JSON.parse(this.value)
168
+ : this.value;
169
+ if (this.multi) {
170
+ if (!Array.isArray(value)) {
171
+ this.value = [];
172
+ this.valueChange.emit(this.value);
173
+ return;
174
+ }
175
+ this.value = value;
176
+ if (!value.length) {
177
+ return;
178
+ }
179
+ this._selectedItem =
180
+ !!this.valueKey && this.valueKey !== 'false'
181
+ ? this._items.filter((i) => value.includes(i === null || i === void 0 ? void 0 : i[this.valueKey]))
182
+ : [...value];
183
+ return;
184
+ }
128
185
  if (!this._selectedItem && !value && this.autoSelectFirst) {
129
186
  value = this._items[0];
130
187
  }
131
- // if (!value) {
132
- // this._selectValue(null);
133
- // return;
134
- // }
135
188
  const identifier = typeof value === 'object' && value !== null
136
189
  ? value[this._identifierKey]
137
190
  : value;
@@ -162,14 +215,40 @@ const Select = class {
162
215
  this._selectValue(!!item ? item : value);
163
216
  }
164
217
  _selectValue(item) {
165
- this._selectedItem = item;
166
- const value = !!this.valueKey && this.valueKey !== 'false' && item !== null
218
+ let value = !!this.valueKey && this.valueKey !== 'false' && item !== null
167
219
  ? item === null || item === void 0 ? void 0 : item[this.valueKey]
168
220
  : item;
169
221
  this.query = this.keepQuery ? item === null || item === void 0 ? void 0 : item[this.displayKey] : null;
170
- this.value = value;
171
- this.valueChange.emit(value);
172
- this._onBlur(true);
222
+ if (this.multi) {
223
+ if (!this._selectedItem || !Array.isArray(this._selectedItem)) {
224
+ this._selectedItem = [];
225
+ }
226
+ if (!this.value || !Array.isArray(this.value)) {
227
+ this.value = [];
228
+ }
229
+ const selectedItem = [...this._selectedItem];
230
+ const valueArray = [...this.value];
231
+ const includesIndex = selectedItem.findIndex((i) => i[this._identifierKey] === item[this._identifierKey]);
232
+ if (includesIndex === -1) {
233
+ selectedItem.push(item);
234
+ valueArray.push(value);
235
+ }
236
+ else {
237
+ selectedItem.splice(includesIndex, 1);
238
+ valueArray.splice(includesIndex, 1);
239
+ }
240
+ this._selectedItem = selectedItem;
241
+ this.value = valueArray;
242
+ this.valueChange.emit(valueArray);
243
+ }
244
+ else {
245
+ this._selectedItem = item;
246
+ this.value = value;
247
+ this.valueChange.emit(value);
248
+ }
249
+ if (!this.multi) {
250
+ this._onBlur(true);
251
+ }
173
252
  }
174
253
  _onFocus(ev) {
175
254
  if (!this.enableAutocomplete) {
@@ -219,14 +298,53 @@ const Select = class {
219
298
  }
220
299
  _getItems() {
221
300
  return this._items.map((item) => {
222
- var _a;
223
- return (h("p-dropdown-menu-item", { onClick: () => this._selectValue(item), active: item[this._identifierKey] ===
224
- ((_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a[this._identifierKey]) }, item[this.displayKey]));
301
+ var _a, _b;
302
+ return (h("p-dropdown-menu-item", { onClick: () => this._selectValue(item), active: this.multi
303
+ ? ((_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a.findIndex((i) => i[this._identifierKey] ===
304
+ item[this._identifierKey])) >= 0
305
+ : item[this._identifierKey] ===
306
+ ((_b = this._selectedItem) === null || _b === void 0 ? void 0 : _b[this._identifierKey]), variant: this.multi ? 'checkbox' : 'default' }, this.avatarKey ? (h("span", { class: "flex items-center gap-2" }, h("p-avatar", { size: "xsmall", src: item[this.avatarKey], letters: item[this.avatarLettersKey] }), item[this.displayKey])) : (item[this.displayKey])));
225
307
  });
226
308
  }
309
+ _getAddItem() {
310
+ return (h("p-dropdown-menu-item", { onClick: () => this.add.emit() }, h("span", { class: "text-indigo font-semibold flex gap-1 items-center" }, this.addItemText, h("p-icon", { variant: "plus" }))));
311
+ }
227
312
  _getLoadingItems() {
228
313
  return [0, 0, 0].map(() => (h("p-dropdown-menu-item", { enableHover: false }, h("p-loader", { variant: "ghost", class: "h-6 w-full rounded" }))));
229
314
  }
315
+ _setMultiContainerMaxWidth() {
316
+ if (!this._inputRef || !this._multiContainerRef) {
317
+ return;
318
+ }
319
+ this._multiContainerRef.style.maxWidth = `${this._inputRef.clientWidth - 16}px`;
320
+ }
321
+ _checkSelectedItems() {
322
+ if (!this._multiContainerRef) {
323
+ return;
324
+ }
325
+ const containerRect = this._multiContainerRef.getBoundingClientRect();
326
+ const items = Array.from(this._multiContainerRef.querySelectorAll('.item'));
327
+ let amountHidden = 0;
328
+ for (const child of items) {
329
+ child.classList.remove('hidden');
330
+ const childRect = child.getBoundingClientRect();
331
+ if (childRect.right > containerRect.right) {
332
+ child.classList.add('hidden');
333
+ amountHidden++;
334
+ }
335
+ }
336
+ this._amountHidden = amountHidden;
337
+ const extra = this._multiContainerRef.querySelector('.extra');
338
+ if (!extra) {
339
+ return;
340
+ }
341
+ if (!extra.classList.contains('hidden')) {
342
+ extra.classList.add('hidden');
343
+ }
344
+ if (amountHidden > 0) {
345
+ extra.classList.remove('hidden');
346
+ }
347
+ }
230
348
  get _el() { return getElement(this); }
231
349
  static get watchers() { return {
232
350
  "value": ["_valueChange"],
@@ -1 +1 @@
1
- {"file":"p-select.entry.js","mappings":";;;AAAA,MAAM,kBAAkB,GAAG,8gBAA8gB;;MCoB5hB,MAAM;;;;;;;;;;;;sBAkCc,MAAM;;;;2BAoBA,IAAI;uBAKR,IAAI;6BAKC,EAAE;8BAKA,IAAI;qBAKb,IAAI;uBAKF,KAAK;mBAKT,KAAK;gBA6BG,QAAQ;;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zB,QACI,CAAA,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,GAAG,CAAC,0CACL,QAAQ,EAAE,0CACV,WAAW,GACZ,OAAO,CAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,EAAE,CAAC,KAAI,CAAC,EAC9C;GACL;EAEO,SAAS;IACb,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI;;MAAK,QAC7B,4BACI,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EACtC,MAAM,EACF,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;WACzB,MAAA,IAAI,CAAC,aAAa,0CAAG,IAAI,CAAC,cAAc,CAAC,CAAA,IAG5C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CACH,EAC1B;KAAA,CAAC,CAAC;GACN;EAEO,gBAAgB;IACpB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OACjB,4BAAsB,WAAW,EAAE,KAAK,IACpC,gBAAU,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,oBAAoB,GAAG,CACpC,CAC1B,CAAC,CAAC;GACN;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/select/select.component.scss?tag=p-select","src/components/molecules/select/select.component.tsx"],"sourcesContent":["p-select {\n @apply flex w-full flex-col;\n\n input.read-only {\n @apply text-ellipsis;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n tag: 'p-select',\n styleUrl: 'select.component.scss',\n shadow: false,\n})\nexport class Select {\n /**\n * The items to show in the dropdown\n */\n @Prop() items: string | any[];\n\n /**\n * Icon of the select box\n */\n @Prop() icon: IconVariant;\n\n /**\n * The current query\n */\n @Prop() query: string;\n\n /**\n * The placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * The placeholder of the input when auto completing\n */\n @Prop() autocompletePlaceholder: string;\n\n /**\n * The current value\n */\n @Prop() value: any;\n\n /**\n * The key of the object to display\n */\n @Prop() displayKey: string = 'text';\n\n /**\n * The key of the object to return\n */\n @Prop() valueKey: string;\n\n /**\n * The key to identify an object\n */\n @Prop() identifierKey: string;\n\n /**\n * The key of the object to display\n */\n @Prop() queryKey?: string;\n\n /**\n * Wether to automatically select the first item\n */\n @Prop() autoSelectFirst: boolean = true;\n\n /**\n * Wether to show the chevron or not\n */\n @Prop() showChevron: boolean = true;\n\n /**\n * The maximum amount of items to display\n */\n @Prop() maxDisplayedItems: number = 10;\n\n /**\n * Wether to enable autocomplete\n */\n @Prop() enableAutocomplete: boolean = true;\n\n /**\n * Wether to keep the query or not\n */\n @Prop() keepQuery: boolean = true;\n\n /**\n * Wether the input uses async filtering\n */\n @Prop() asyncFilter: boolean = false;\n\n /**\n * Wether to show loading items\n */\n @Prop() loading: boolean = false;\n\n /**\n * Event when the query of the autocomplete changes\n */\n @Event({\n bubbles: false,\n })\n queryChange: EventEmitter<string>;\n\n /**\n * Event when the value changes\n */\n @Event({\n bubbles: false,\n })\n valueChange: EventEmitter<any>;\n\n /**\n * Event when the dropdown shows\n */\n @Event({\n bubbles: false,\n })\n dropdownShown: EventEmitter<any>;\n\n /**\n * The size of the input group used by the select\n */\n @Prop() size: 'small' | 'medium' = 'medium';\n\n /**\n * The prefix of the input group used by the select\n */\n @Prop() prefix: string;\n\n /**\n * The label of the input group used by the select\n */\n @Prop() label: string;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop() helper: string;\n\n /**\n * Wether the field is required\n */\n @Prop({ reflect: true }) required: boolean;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop({ reflect: true }) error: string;\n\n /**\n * Wether the input group is disabled used by the select\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n @State() private _showDropdown: any = false;\n @State() private _selectedItem: any = null;\n\n @State() private _isAutoCompleting: boolean = false;\n\n get _items() {\n if (!this.items || this.loading) {\n return [];\n }\n\n let items =\n typeof this.items === 'string'\n ? JSON.parse(this.items)\n : this.items;\n\n if (typeof items?.[0] === 'string') {\n this.displayKey = 'text';\n this.valueKey = 'value';\n\n items = items.map((str) => ({\n value: str,\n text: str,\n }));\n }\n\n if (\n this._isAutoCompleting &&\n this.query?.length &&\n this.query !== this._selectedItem?.[this.displayKey] &&\n !this.asyncFilter\n ) {\n items = items.filter((item) => {\n if (this.queryKey) {\n return this._checkvalue(this.queryKey, item);\n }\n\n return (\n this._checkvalue(this._identifierKey, item) ||\n this._checkvalue(this.displayKey, item)\n );\n });\n }\n\n return items?.slice(0, this.maxDisplayedItems);\n }\n\n get _displayValue() {\n if (this._isAutoCompleting) {\n return this.query;\n }\n\n return this._selectedItem?.[this.displayKey];\n }\n\n get _placeholder() {\n return this._isAutoCompleting && this.autocompletePlaceholder?.length\n ? this.autocompletePlaceholder\n : this.placeholder;\n }\n\n get _identifierKey() {\n return this.identifierKey ?? this.valueKey ?? 'value';\n }\n\n componentDidLoad() {\n if (!this.valueKey && !this.identifierKey) {\n throw new Error('You must provide a valueKey or identifierKey');\n }\n\n if (this.value) {\n this._valueChange();\n return;\n }\n\n this.itemChanges();\n }\n\n render() {\n return (\n <Host class=\"p-select\">\n {this._showDropdown && (!!this._items.length || this.loading)}\n {this._isAutoCompleting}\n <p-dropdown\n disableTriggerClick={true}\n calculateWidth={true}\n insideClick={true}\n scrollable={true}\n show={\n this._showDropdown &&\n (!!this._items.length || this.loading)\n }\n >\n <p-input-group\n slot=\"trigger\"\n icon={this.icon}\n size={this.size}\n prefix={this.prefix}\n label={this.label}\n helper={this.helper}\n required={this.required}\n error={this.error}\n disabled={this.disabled}\n focused={this._showDropdown}\n focusMethod={\n this.enableAutocomplete ? 'focus' : 'click'\n }\n >\n <input\n slot=\"input\"\n type=\"text\"\n placeholder={this._placeholder}\n value={this._displayValue}\n class={`p-input cursor-pointer ${\n !this._isAutoCompleting && 'read-only'\n }`}\n onFocus={(ev) => this._onFocus(ev)}\n onMouseDown={(ev) => this._onMouseDown(ev)}\n onClick={() => this._onClick()}\n onInput={(ev) => this._onChange(ev)}\n />\n\n {this.showChevron && (\n <p-icon variant=\"chevron\" slot=\"suffix\" />\n )}\n </p-input-group>\n <div slot=\"items\">\n {this.loading\n ? this._getLoadingItems()\n : this._getItems()}\n </div>\n </p-dropdown>\n </Host>\n );\n }\n\n @Listen('click', { target: 'document', capture: true })\n protected documentClickHandler({ target }) {\n if (!this._showDropdown || childOf(target, this._el)) {\n return;\n }\n\n this._showDropdown = false;\n this._isAutoCompleting = false;\n }\n\n @Watch('value')\n private _valueChange() {\n this._preselectItem();\n }\n\n @Watch('items')\n public itemChanges() {\n this._preselectItem();\n }\n\n @Watch('_showDropdown')\n public _showDropdownChanges() {\n this.dropdownShown.emit({\n value: this._showDropdown,\n query: this.query,\n });\n }\n\n private _preselectItem() {\n if (this._isAutoCompleting && this.query?.length) {\n return;\n }\n\n let value = this.value;\n\n if (!this._selectedItem && !value && this.autoSelectFirst) {\n value = this._items[0];\n }\n\n // if (!value) {\n // this._selectValue(null);\n // return;\n // }\n\n const identifier =\n typeof value === 'object' && value !== null\n ? value[this._identifierKey]\n : value;\n const parsedValue =\n typeof identifier === 'string' || typeof identifier === 'number'\n ? identifier\n : JSON.stringify(identifier);\n\n const currentValue = this._selectedItem\n ? this._selectedItem?.[this._identifierKey]\n : null;\n const currentParsedValue =\n typeof currentValue === 'string' || typeof currentValue === 'number'\n ? currentValue\n : JSON.stringify(currentValue);\n\n if (this._selectedItem && currentParsedValue === parsedValue) {\n return;\n }\n\n if (!this._items?.length && value) {\n this._selectValue(value);\n return;\n }\n\n const item = this._items.find((i) => {\n const itemIdentifier = i?.[this._identifierKey];\n const parsedItemIdentifier =\n typeof itemIdentifier === 'string' ||\n typeof itemIdentifier === 'number'\n ? itemIdentifier\n : JSON.stringify(itemIdentifier);\n\n return parsedItemIdentifier === parsedValue;\n });\n\n this._selectValue(!!item ? item : value);\n }\n\n private _selectValue(item) {\n this._selectedItem = item;\n const value =\n !!this.valueKey && this.valueKey !== 'false' && item !== null\n ? item?.[this.valueKey]\n : item;\n\n this.query = this.keepQuery ? item?.[this.displayKey] : null;\n this.value = value;\n this.valueChange.emit(value);\n\n this._onBlur(true);\n }\n\n private _onFocus(ev) {\n if (!this.enableAutocomplete) {\n ev.preventDefault();\n ev.stopPropogation();\n\n if (!this._showDropdown) {\n this._showDropdown = true;\n }\n return;\n }\n\n this._showDropdown = true;\n this._isAutoCompleting = true;\n }\n\n private _onMouseDown(ev) {\n if (this.enableAutocomplete) {\n return;\n }\n\n ev.preventDefault();\n }\n\n private _onClick() {\n if (this.enableAutocomplete) {\n return;\n }\n\n this._showDropdown = !this._showDropdown;\n }\n\n private _onBlur(force = false) {\n if (!this.enableAutocomplete && !force) {\n return;\n }\n\n this._isAutoCompleting = false;\n this._showDropdown = false;\n }\n\n private _onChange(ev) {\n if (!this.enableAutocomplete) {\n return;\n }\n\n if (!this._isAutoCompleting) {\n this._isAutoCompleting = true;\n this._showDropdown = true;\n }\n\n this.query = ev.target.value;\n this.queryChange.emit(ev.target.value);\n }\n\n private _checkvalue(key, item) {\n return (\n item?.[key]\n ?.toString()\n ?.toLowerCase()\n .indexOf(this.query?.toLowerCase()) >= 0\n );\n }\n\n private _getItems() {\n return this._items.map((item) => (\n <p-dropdown-menu-item\n onClick={() => this._selectValue(item)}\n active={\n item[this._identifierKey] ===\n this._selectedItem?.[this._identifierKey]\n }\n >\n {item[this.displayKey]}\n </p-dropdown-menu-item>\n ));\n }\n\n private _getLoadingItems() {\n return [0, 0, 0].map(() => (\n <p-dropdown-menu-item enableHover={false}>\n <p-loader variant=\"ghost\" class=\"h-6 w-full rounded\" />\n </p-dropdown-menu-item>\n ));\n }\n}\n"],"version":3}
1
+ {"file":"p-select.entry.js","mappings":";;;AAAA,MAA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KACD;IAED,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IAClC,MAAM,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,EAAE;MACX,OAAO;KACP;IAED,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;MACxC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;KAC9B;IAED,IAAI,YAAY,GAAG,CAAC,EAAE;MACrB,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KACjC;GACD;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/select/select.component.scss?tag=p-select","src/components/molecules/select/select.component.tsx"],"sourcesContent":["p-select {\n\t@apply flex w-full flex-col relative;\n\n\tinput.read-only {\n\t\t@apply text-ellipsis;\n\t}\n\n\t.multi-container {\n\t\t@apply absolute top-0 left-0 h-full flex gap-2 items-center px-2 py-4 overflow-hidden pointer-events-none w-full;\n\n\t\t.item {\n\t\t\t@apply bg-indigo-light rounded px-2 flex gap-2 items-center cursor-pointer text-indigo-dark h-[1.625rem] text-sm font-semibold pointer-events-auto whitespace-nowrap;\n\n\t\t\tp-icon {\n\t\t\t\t@apply text-indigo text-xs;\n\t\t\t}\n\t\t}\n\n\t\t.extra {\n\t\t\t@apply text-sm text-storm-medium pointer-events-none;\n\t\t}\n\t}\n}\n","import {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n\ttag: 'p-select',\n\tstyleUrl: 'select.component.scss',\n\tshadow: false,\n})\nexport class Select {\n\t/**\n\t * The items to show in the dropdown\n\t */\n\t@Prop() items: string | any[];\n\n\t/**\n\t * Wether to enable multi select\n\t */\n\t@Prop({ reflect: true }) multi: boolean;\n\n\t/**\n\t * Icon of the select box\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * The current query\n\t */\n\t@Prop() query: string;\n\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The placeholder of the input when auto completing\n\t */\n\t@Prop() autocompletePlaceholder: string;\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: any;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() displayKey: string = 'text';\n\n\t/**\n\t * The key of the object to return\n\t */\n\t@Prop() valueKey: string;\n\n\t/**\n\t * The key of avatar within an item to show\n\t */\n\t@Prop() avatarKey: string;\n\n\t/**\n\t * The key of avatar letters within an item to show when the avatar url doesn't work\n\t */\n\t@Prop() avatarLettersKey: string;\n\n\t/**\n\t * The key to identify an object\n\t */\n\t@Prop() identifierKey: string;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() queryKey?: string;\n\n\t/**\n\t * Wether to automatically select the first item\n\t */\n\t@Prop() autoSelectFirst: boolean = true;\n\n\t/**\n\t * Wether to show the chevron or not\n\t */\n\t@Prop() showChevron: boolean = true;\n\n\t/**\n\t * The maximum amount of items to display\n\t */\n\t@Prop() maxDisplayedItems: number = 10;\n\n\t/**\n\t * Wether to enable autocomplete\n\t */\n\t@Prop() enableAutocomplete: boolean = true;\n\n\t/**\n\t * Wether to keep the query or not\n\t */\n\t@Prop() keepQuery: boolean = true;\n\n\t/**\n\t * Wether the input uses async filtering\n\t */\n\t@Prop() asyncFilter: boolean = false;\n\n\t/**\n\t * Wether to show loading items\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Event when the query of the autocomplete changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tqueryChange: EventEmitter<string>;\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\t/**\n\t * Event when the dropdown shows\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tdropdownShown: EventEmitter<any>;\n\n\t/**\n\t * The size of the input group used by the select\n\t */\n\t@Prop() size: 'small' | 'medium' = 'medium';\n\n\t/**\n\t * The prefix of the input group used by the select\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the select\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop() helper: string;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the select\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether to show a \"add\" item\n\t */\n\t@Prop() showAddItem: boolean = false;\n\n\t/**\n\t * The text to show when add item is being shown\n\t */\n\t@Prop() addItemText: string = 'Add item';\n\n\t/**\n\t * Event when the add item is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tadd: EventEmitter;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _showDropdown: any = false;\n\t@State() private _selectedItem: any = null;\n\n\t@State() private _isAutoCompleting: boolean = false;\n\t@State() private _amountHidden = 0;\n\n\tprivate _inputRef: HTMLInputElement;\n\tprivate _multiContainerRef: HTMLElement;\n\n\tprivate _resizeObserver: ResizeObserver;\n\tprivate _resizeDebounceTimer: NodeJS.Timer;\n\n\tget _items() {\n\t\tif (!this.items || this.loading) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet items =\n\t\t\ttypeof this.items === 'string'\n\t\t\t\t? JSON.parse(this.items)\n\t\t\t\t: this.items;\n\n\t\tif (typeof items?.[0] === 'string') {\n\t\t\tthis.displayKey = 'text';\n\t\t\tthis.valueKey = 'value';\n\n\t\t\titems = items.map((str) => ({\n\t\t\t\tvalue: str,\n\t\t\t\ttext: str,\n\t\t\t}));\n\t\t}\n\n\t\tif (\n\t\t\tthis._isAutoCompleting &&\n\t\t\tthis.query?.length &&\n\t\t\tthis.query !== this._selectedItem?.[this.displayKey] &&\n\t\t\t!this.asyncFilter\n\t\t) {\n\t\t\titems = items.filter((item) => {\n\t\t\t\tif (this.queryKey) {\n\t\t\t\t\treturn this._checkvalue(this.queryKey, item);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tthis._checkvalue(this._identifierKey, item) ||\n\t\t\t\t\tthis._checkvalue(this.displayKey, item)\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\treturn items?.slice(0, this.maxDisplayedItems);\n\t}\n\n\tget _displayValue() {\n\t\tif (this._isAutoCompleting) {\n\t\t\treturn this.query;\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\treturn this._selectedItem\n\t\t\t\t?.map((i) => i?.[this.displayKey])\n\t\t\t\t.filter((i) => !!i);\n\t\t}\n\n\t\treturn this._selectedItem?.[this.displayKey];\n\t}\n\n\tget _placeholder() {\n\t\treturn this._isAutoCompleting && this.autocompletePlaceholder?.length\n\t\t\t? this.autocompletePlaceholder\n\t\t\t: this.placeholder;\n\t}\n\n\tget _identifierKey() {\n\t\treturn this.identifierKey ?? this.valueKey ?? 'value';\n\t}\n\n\tcomponentDidLoad() {\n\t\tif (!this.valueKey && !this.identifierKey) {\n\t\t\tthrow new Error('You must provide a valueKey or identifierKey');\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\tthis.enableAutocomplete = false;\n\t\t\tthis._setMultiContainerMaxWidth();\n\n\t\t\tthis._resizeObserver = new ResizeObserver(() => {\n\t\t\t\tif (this._resizeDebounceTimer) {\n\t\t\t\t\tclearTimeout(this._resizeDebounceTimer);\n\t\t\t\t\tthis._resizeDebounceTimer = null;\n\t\t\t\t}\n\n\t\t\t\tthis._resizeDebounceTimer = setTimeout(() => {\n\t\t\t\t\tthis._setMultiContainerMaxWidth();\n\t\t\t\t\tthis._checkSelectedItems();\n\t\t\t\t}, 200);\n\t\t\t});\n\t\t\tthis._resizeObserver.observe(this._el);\n\t\t}\n\n\t\tif (this.value) {\n\t\t\tthis._valueChange();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.itemChanges();\n\t}\n\n\tcomponentDidRender() {\n\t\tif (this.multi) {\n\t\t\tthis._setMultiContainerMaxWidth();\n\t\t\tthis._checkSelectedItems();\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this.multi) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-select\">\n\t\t\t\t{this._showDropdown && (!!this._items.length || this.loading)}\n\t\t\t\t{this._isAutoCompleting}\n\t\t\t\t<p-dropdown\n\t\t\t\t\tdisableTriggerClick={true}\n\t\t\t\t\tcalculateWidth={true}\n\t\t\t\t\tinsideClick={true}\n\t\t\t\t\tscrollable={true}\n\t\t\t\t\tshow={\n\t\t\t\t\t\tthis._showDropdown &&\n\t\t\t\t\t\t(!!this._items.length || this.loading)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<p-input-group\n\t\t\t\t\t\tslot=\"trigger\"\n\t\t\t\t\t\ticon={this.icon}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tprefix={this.prefix}\n\t\t\t\t\t\tlabel={this.label}\n\t\t\t\t\t\thelper={this.helper}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\terror={this.error}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tfocused={this._showDropdown}\n\t\t\t\t\t\tfocusMethod={\n\t\t\t\t\t\t\tthis.enableAutocomplete ? 'focus' : 'click'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tslot=\"input\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tplaceholder={this._placeholder}\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tthis.multi && this._displayValue?.length\n\t\t\t\t\t\t\t\t\t? ' '\n\t\t\t\t\t\t\t\t\t: this._displayValue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclass={`p-input cursor-pointer ${\n\t\t\t\t\t\t\t\t!this._isAutoCompleting && 'read-only'\n\t\t\t\t\t\t\t}`}\n\t\t\t\t\t\t\tonFocus={(ev) => this._onFocus(ev)}\n\t\t\t\t\t\t\tonMouseDown={(ev) => this._onMouseDown(ev)}\n\t\t\t\t\t\t\tonClick={() => this._onClick()}\n\t\t\t\t\t\t\tonInput={(ev) => this._onChange(ev)}\n\t\t\t\t\t\t\tref={(ref) => (this._inputRef = ref)}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{this.showChevron && (\n\t\t\t\t\t\t\t<p-icon variant=\"chevron\" slot=\"suffix\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</p-input-group>\n\t\t\t\t\t<div slot=\"items\">\n\t\t\t\t\t\t{this.loading\n\t\t\t\t\t\t\t? this._getLoadingItems()\n\t\t\t\t\t\t\t: this._getItems()}\n\t\t\t\t\t\t{this.showAddItem && this._getAddItem()}\n\t\t\t\t\t</div>\n\t\t\t\t</p-dropdown>\n\n\t\t\t\t{this.multi && this._selectedItem?.length > 0 && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"multi-container\"\n\t\t\t\t\t\tref={(ref) => (this._multiContainerRef = ref)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this._selectedItem.map((item) => (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass=\"item\"\n\t\t\t\t\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{item[this.displayKey]}\n\t\t\t\t\t\t\t\t<p-icon variant=\"negative\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t))}\n\n\t\t\t\t\t\t<div class=\"extra hidden\">+{this._amountHidden}</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._showDropdown || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t\tthis._isAutoCompleting = false;\n\t}\n\n\t@Watch('value')\n\tprivate _valueChange() {\n\t\tthis._preselectItem();\n\t}\n\n\t@Watch('items')\n\tpublic itemChanges() {\n\t\tthis._preselectItem();\n\t}\n\n\t@Watch('_showDropdown')\n\tpublic _showDropdownChanges() {\n\t\tthis.dropdownShown.emit({\n\t\t\tvalue: this._showDropdown,\n\t\t\tquery: this.query,\n\t\t});\n\t}\n\n\tprivate _preselectItem() {\n\t\tif (this._isAutoCompleting && this.query?.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet value =\n\t\t\ttypeof this.value === 'string' && this.multi\n\t\t\t\t? JSON.parse(this.value)\n\t\t\t\t: this.value;\n\n\t\tif (this.multi) {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthis.value = [];\n\t\t\t\tthis.valueChange.emit(this.value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.value = value;\n\t\t\tif (!value.length) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._selectedItem =\n\t\t\t\t!!this.valueKey && this.valueKey !== 'false'\n\t\t\t\t\t? this._items.filter((i) =>\n\t\t\t\t\t\t\tvalue.includes(i?.[this.valueKey])\n\t\t\t\t\t\t)\n\t\t\t\t\t: [...value];\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._selectedItem && !value && this.autoSelectFirst) {\n\t\t\tvalue = this._items[0];\n\t\t}\n\n\t\tconst identifier =\n\t\t\ttypeof value === 'object' && value !== null\n\t\t\t\t? value[this._identifierKey]\n\t\t\t\t: value;\n\t\tconst parsedValue =\n\t\t\ttypeof identifier === 'string' || typeof identifier === 'number'\n\t\t\t\t? identifier\n\t\t\t\t: JSON.stringify(identifier);\n\n\t\tconst currentValue = this._selectedItem\n\t\t\t? this._selectedItem?.[this._identifierKey]\n\t\t\t: null;\n\t\tconst currentParsedValue =\n\t\t\ttypeof currentValue === 'string' || typeof currentValue === 'number'\n\t\t\t\t? currentValue\n\t\t\t\t: JSON.stringify(currentValue);\n\n\t\tif (this._selectedItem && currentParsedValue === parsedValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._items?.length && value) {\n\t\t\tthis._selectValue(value);\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = this._items.find((i) => {\n\t\t\tconst itemIdentifier = i?.[this._identifierKey];\n\t\t\tconst parsedItemIdentifier =\n\t\t\t\ttypeof itemIdentifier === 'string' ||\n\t\t\t\ttypeof itemIdentifier === 'number'\n\t\t\t\t\t? itemIdentifier\n\t\t\t\t\t: JSON.stringify(itemIdentifier);\n\n\t\t\treturn parsedItemIdentifier === parsedValue;\n\t\t});\n\n\t\tthis._selectValue(!!item ? item : value);\n\t}\n\n\tprivate _selectValue(item) {\n\t\tlet value =\n\t\t\t!!this.valueKey && this.valueKey !== 'false' && item !== null\n\t\t\t\t? item?.[this.valueKey]\n\t\t\t\t: item;\n\n\t\tthis.query = this.keepQuery ? item?.[this.displayKey] : null;\n\n\t\tif (this.multi) {\n\t\t\tif (!this._selectedItem || !Array.isArray(this._selectedItem)) {\n\t\t\t\tthis._selectedItem = [];\n\t\t\t}\n\n\t\t\tif (!this.value || !Array.isArray(this.value)) {\n\t\t\t\tthis.value = [];\n\t\t\t}\n\n\t\t\tconst selectedItem = [...this._selectedItem];\n\t\t\tconst valueArray = [...this.value];\n\n\t\t\tconst includesIndex = selectedItem.findIndex(\n\t\t\t\t(i) => i[this._identifierKey] === item[this._identifierKey]\n\t\t\t);\n\t\t\tif (includesIndex === -1) {\n\t\t\t\tselectedItem.push(item);\n\t\t\t\tvalueArray.push(value);\n\t\t\t} else {\n\t\t\t\tselectedItem.splice(includesIndex, 1);\n\t\t\t\tvalueArray.splice(includesIndex, 1);\n\t\t\t}\n\n\t\t\tthis._selectedItem = selectedItem;\n\t\t\tthis.value = valueArray;\n\t\t\tthis.valueChange.emit(valueArray);\n\t\t} else {\n\t\t\tthis._selectedItem = item;\n\t\t\tthis.value = value;\n\t\t\tthis.valueChange.emit(value);\n\t\t}\n\n\t\tif (!this.multi) {\n\t\t\tthis._onBlur(true);\n\t\t}\n\t}\n\n\tprivate _onFocus(ev) {\n\t\tif (!this.enableAutocomplete) {\n\t\t\tev.preventDefault();\n\t\t\tev.stopPropogation();\n\n\t\t\tif (!this._showDropdown) {\n\t\t\t\tthis._showDropdown = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = true;\n\t\tthis._isAutoCompleting = true;\n\t}\n\n\tprivate _onMouseDown(ev) {\n\t\tif (this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tev.preventDefault();\n\t}\n\n\tprivate _onClick() {\n\t\tif (this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = !this._showDropdown;\n\t}\n\n\tprivate _onBlur(force = false) {\n\t\tif (!this.enableAutocomplete && !force) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._isAutoCompleting = false;\n\t\tthis._showDropdown = false;\n\t}\n\n\tprivate _onChange(ev) {\n\t\tif (!this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._isAutoCompleting) {\n\t\t\tthis._isAutoCompleting = true;\n\t\t\tthis._showDropdown = true;\n\t\t}\n\n\t\tthis.query = ev.target.value;\n\t\tthis.queryChange.emit(ev.target.value);\n\t}\n\n\tprivate _checkvalue(key, item) {\n\t\treturn (\n\t\t\titem?.[key]\n\t\t\t\t?.toString()\n\t\t\t\t?.toLowerCase()\n\t\t\t\t.indexOf(this.query?.toLowerCase()) >= 0\n\t\t);\n\t}\n\n\tprivate _getItems() {\n\t\treturn this._items.map((item) => (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\tactive={\n\t\t\t\t\tthis.multi\n\t\t\t\t\t\t? this._selectedItem?.findIndex(\n\t\t\t\t\t\t\t\t(i) =>\n\t\t\t\t\t\t\t\t\ti[this._identifierKey] ===\n\t\t\t\t\t\t\t\t\titem[this._identifierKey]\n\t\t\t\t\t\t\t) >= 0\n\t\t\t\t\t\t: item[this._identifierKey] ===\n\t\t\t\t\t\t\tthis._selectedItem?.[this._identifierKey]\n\t\t\t\t}\n\t\t\t\tvariant={this.multi ? 'checkbox' : 'default'}\n\t\t\t>\n\t\t\t\t{this.avatarKey ? (\n\t\t\t\t\t<span class=\"flex items-center gap-2\">\n\t\t\t\t\t\t<p-avatar\n\t\t\t\t\t\t\tsize=\"xsmall\"\n\t\t\t\t\t\t\tsrc={item[this.avatarKey]}\n\t\t\t\t\t\t\tletters={item[this.avatarLettersKey]}\n\t\t\t\t\t\t></p-avatar>\n\t\t\t\t\t\t{item[this.displayKey]}\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\titem[this.displayKey]\n\t\t\t\t)}\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\t}\n\n\tprivate _getAddItem() {\n\t\treturn (\n\t\t\t<p-dropdown-menu-item onClick={() => this.add.emit()}>\n\t\t\t\t<span class=\"text-indigo font-semibold flex gap-1 items-center\">\n\t\t\t\t\t{this.addItemText}\n\t\t\t\t\t<p-icon variant=\"plus\" />\n\t\t\t\t</span>\n\t\t\t</p-dropdown-menu-item>\n\t\t);\n\t}\n\n\tprivate _getLoadingItems() {\n\t\treturn [0, 0, 0].map(() => (\n\t\t\t<p-dropdown-menu-item enableHover={false}>\n\t\t\t\t<p-loader variant=\"ghost\" class=\"h-6 w-full rounded\" />\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\t}\n\n\tprivate _setMultiContainerMaxWidth() {\n\t\tif (!this._inputRef || !this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._multiContainerRef.style.maxWidth = `${this._inputRef.clientWidth - 16}px`;\n\t}\n\n\tprivate _checkSelectedItems() {\n\t\tif (!this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst containerRect = this._multiContainerRef.getBoundingClientRect();\n\t\tconst items = Array.from(\n\t\t\tthis._multiContainerRef.querySelectorAll('.item')\n\t\t) as HTMLElement[];\n\n\t\tlet amountHidden = 0;\n\n\t\tfor (const child of items) {\n\t\t\tchild.classList.remove('hidden');\n\n\t\t\tconst childRect = child.getBoundingClientRect();\n\t\t\tif (childRect.right > containerRect.right) {\n\t\t\t\tchild.classList.add('hidden');\n\t\t\t\tamountHidden++;\n\t\t\t}\n\t\t}\n\n\t\tthis._amountHidden = amountHidden;\n\t\tconst extra = this._multiContainerRef.querySelector('.extra');\n\t\tif (!extra) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!extra.classList.contains('hidden')) {\n\t\t\textra.classList.add('hidden');\n\t\t}\n\n\t\tif (amountHidden > 0) {\n\t\t\textra.classList.remove('hidden');\n\t\t}\n\t}\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"p-slider-indicator.entry.js","mappings":";;AAAA,MAAM,2BAA2B,GAAG,+dAA+d;;MCOtf,eAAe;;;kBAIE,KAAK;;EAE/B,MAAM;IACF,QACI,EAAC,IAAI,IACD,KAAK,EAAE,sBAAsB,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,GAClD,EACV;GACL;;;;;;","names":[],"sources":["src/components/atoms/slider-indicator/slider-indicator.component.scss?tag=p-slider-indicator&encapsulation=shadow","src/components/atoms/slider-indicator/slider-indicator.component.tsx"],"sourcesContent":[":host {\n @apply block w-2 h-2 bg-mystic-dark rounded-round;\n}\n\n:host(.active) {\n @apply bg-indigo;\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'p-slider-indicator',\n styleUrl: 'slider-indicator.component.scss',\n shadow: true,\n})\nexport class SliderIndicator {\n /**\n * Wether the slider indicator is active\n */\n @Prop() active: boolean = false;\n\n render() {\n return (\n <Host\n class={`p-slider-indicator ${this.active && 'active'}`}\n ></Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-slider-indicator.entry.js","mappings":";;AAAA,MAAM,2BAA2B,GAAG,+dAA+d;;MCOtf,eAAe;;;kBAID,KAAK;;EAE/B,MAAM;IACL,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,sBAAsB,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,GAC/C,EACP;GACF;;;;;;","names":[],"sources":["src/components/atoms/slider-indicator/slider-indicator.component.scss?tag=p-slider-indicator&encapsulation=shadow","src/components/atoms/slider-indicator/slider-indicator.component.tsx"],"sourcesContent":[":host {\n\t@apply block w-2 h-2 bg-mystic-dark rounded-round;\n}\n\n:host(.active) {\n\t@apply bg-indigo;\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n\ttag: 'p-slider-indicator',\n\tstyleUrl: 'slider-indicator.component.scss',\n\tshadow: true,\n})\nexport class SliderIndicator {\n\t/**\n\t * Wether the slider indicator is active\n\t */\n\t@Prop() active: boolean = false;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-slider-indicator ${this.active && 'active'}`}\n\t\t\t></Host>\n\t\t);\n\t}\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"p-status.entry.js","mappings":";;AAAA,MAAM,kBAAkB,GAAG,6xBAA6xB;;MCQ3yB,MAAM;;;mBAKX,SAAS;;;;;EAiBb,MAAM;IACF,QACI,EAAC,IAAI,IACD,KAAK,EAAE,oBAAoB,IAAI,CAAC,OAAO;kBACrC,IAED,IAAI,CAAC,QAAQ,EAAE,EAChB,eAAQ,CACL,EACT;GACL;EAEO,QAAQ;IACZ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IAEjD,IAAI,CAAC,IAAI,EAAE;MACP,OAAO;KACV;IAED,QACI,cACI,OAAO,EAAE,IAAI,EACb,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,MAAM,EAAE,IAAI,CAAC,UAAU,GACzB,EACJ;GACL;EAEO,eAAe;IACnB,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,QAAQ,IAAI,CAAC,OAAO;MAChB,KAAK,UAAU;QACX,IAAI,GAAG,WAAW,CAAC;QACnB,MAAM;MACV,KAAK,UAAU;QACX,IAAI,GAAG,UAAU,CAAC;QAClB,MAAM;MACV,KAAK,UAAU;QACX,IAAI,GAAG,OAAO,CAAC;QACf,MAAM;MACV;QACI,IAAI,GAAG,IAAI,CAAC;QACZ,MAAM;KACb;IAED,OAAO,IAAI,CAAC;GACf;;;;;;","names":[],"sources":["src/components/atoms/status/status.component.scss?tag=p-status","src/components/atoms/status/status.component.tsx"],"sourcesContent":["p-status {\n @apply flex items-center;\n @apply text-sm text-storm-vague font-medium;\n\n p-icon {\n @apply mr-2 text-base;\n }\n\n &.variant-positive {\n @apply text-positive;\n }\n\n &.variant-unbiased {\n @apply text-unbiased;\n }\n\n &.variant-negative {\n @apply text-negative;\n }\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\nimport { RotateOptions } from '../../../types/tailwind';\nimport { IconFlipOptions, IconVariant } from '../icon/icon.component';\n\n@Component({\n tag: 'p-status',\n styleUrl: 'status.component.scss',\n})\nexport class Status {\n /**\n * The variant of the status\n */\n @Prop() variant: 'default' | 'positive' | 'unbiased' | 'negative' =\n 'default';\n\n /**\n * Icon to show on the status\n */\n @Prop() icon: IconVariant;\n\n /**\n * Icon flip\n */\n @Prop() iconFlip: IconFlipOptions;\n\n /**\n * Icon rotate\n */\n @Prop() iconRotate: RotateOptions;\n\n render() {\n return (\n <Host\n class={`p-status variant-${this.variant}\n }`}\n >\n {this._getIcon()}\n <slot />\n </Host>\n );\n }\n\n private _getIcon() {\n const icon = this.icon || this._getVariantIcon();\n\n if (!icon) {\n return;\n }\n\n return (\n <p-icon\n variant={icon}\n flip={this.iconFlip}\n rotate={this.iconRotate}\n />\n );\n }\n\n private _getVariantIcon() {\n let icon = null;\n switch (this.variant) {\n case 'positive':\n icon = 'checkmark';\n break;\n case 'negative':\n icon = 'negative';\n break;\n case 'unbiased':\n icon = 'clock';\n break;\n default:\n icon = null;\n break;\n }\n\n return icon;\n }\n}\n"],"version":3}
1
+ {"file":"p-status.entry.js","mappings":";;AAAA,MAAM,kBAAkB,GAAG,6xBAA6xB;;MCQ3yB,MAAM;;;mBAKjB,SAAS;;;;;EAiBV,MAAM;IACL,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,oBAAoB,IAAI,CAAC,OAAO;kBACzB,IAEb,IAAI,CAAC,QAAQ,EAAE,EAChB,eAAQ,CACF,EACN;GACF;EAEO,QAAQ;IACf,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IAEjD,IAAI,CAAC,IAAI,EAAE;MACV,OAAO;KACP;IAED,QACC,cACC,OAAO,EAAE,IAAI,EACb,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,MAAM,EAAE,IAAI,CAAC,UAAU,GACtB,EACD;GACF;EAEO,eAAe;IACtB,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,QAAQ,IAAI,CAAC,OAAO;MACnB,KAAK,UAAU;QACd,IAAI,GAAG,WAAW,CAAC;QACnB,MAAM;MACP,KAAK,UAAU;QACd,IAAI,GAAG,UAAU,CAAC;QAClB,MAAM;MACP,KAAK,UAAU;QACd,IAAI,GAAG,OAAO,CAAC;QACf,MAAM;MACP;QACC,IAAI,GAAG,IAAI,CAAC;QACZ,MAAM;KACP;IAED,OAAO,IAAI,CAAC;GACZ;;;;;;","names":[],"sources":["src/components/atoms/status/status.component.scss?tag=p-status","src/components/atoms/status/status.component.tsx"],"sourcesContent":["p-status {\n\t@apply flex items-center;\n\t@apply text-sm text-storm-vague font-medium;\n\n\tp-icon {\n\t\t@apply mr-2 text-base;\n\t}\n\n\t&.variant-positive {\n\t\t@apply text-positive;\n\t}\n\n\t&.variant-unbiased {\n\t\t@apply text-unbiased;\n\t}\n\n\t&.variant-negative {\n\t\t@apply text-negative;\n\t}\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\nimport { RotateOptions } from '../../../types/tailwind';\nimport { IconFlipOptions, IconVariant } from '../icon/icon.component';\n\n@Component({\n\ttag: 'p-status',\n\tstyleUrl: 'status.component.scss',\n})\nexport class Status {\n\t/**\n\t * The variant of the status\n\t */\n\t@Prop() variant: 'default' | 'positive' | 'unbiased' | 'negative' =\n\t\t'default';\n\n\t/**\n\t * Icon to show on the status\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * Icon flip\n\t */\n\t@Prop() iconFlip: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate: RotateOptions;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-status variant-${this.variant}\n }`}\n\t\t\t>\n\t\t\t\t{this._getIcon()}\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _getIcon() {\n\t\tconst icon = this.icon || this._getVariantIcon();\n\n\t\tif (!icon) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\t<p-icon\n\t\t\t\tvariant={icon}\n\t\t\t\tflip={this.iconFlip}\n\t\t\t\trotate={this.iconRotate}\n\t\t\t/>\n\t\t);\n\t}\n\n\tprivate _getVariantIcon() {\n\t\tlet icon = null;\n\t\tswitch (this.variant) {\n\t\t\tcase 'positive':\n\t\t\t\ticon = 'checkmark';\n\t\t\t\tbreak;\n\t\t\tcase 'negative':\n\t\t\t\ticon = 'negative';\n\t\t\t\tbreak;\n\t\t\tcase 'unbiased':\n\t\t\t\ticon = 'clock';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ticon = null;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn icon;\n\t}\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"p-stepper-item.entry.js","mappings":";;AAAA,MAAM,uBAAuB,GAAG,g6HAAg6H;;MCOn7H,WAAW;;;iBAIyC,QAAQ;qBAMjE,YAAY;2BAK4C,KAAK;oBAKpB,KAAK;kBAKP,KAAK;;EAEhD,MAAM;IACF,QACI,EAAC,IAAI,IAAC,KAAK,EAAC,gBAAgB,IACxB,WAAK,KAAK,EAAC,QAAQ,IACd,IAAI,CAAC,QAAQ,IAAI,cAAQ,OAAO,EAAC,WAAW,GAAG,CAC9C,EACN,WAAK,KAAK,EAAC,SAAS,IAChB,YAAM,IAAI,EAAC,SAAS,GAAG,CACrB,CACH,EACT;GACL;;;;;;","names":[],"sources":["src/components/atoms/stepper-item/stepper-item.component.scss?tag=p-stepper-item&encapsulation=shadow","src/components/atoms/stepper-item/stepper-item.component.tsx"],"sourcesContent":[":host {\n @apply relative flex w-full items-end justify-center;\n\n .content {\n @apply min-w-[calc(100%-2rem)] whitespace-nowrap;\n @apply text-sm text-storm-light;\n }\n\n .circle {\n @apply transition duration-500 ease-in-out;\n @apply flex items-center justify-center;\n @apply h-4 w-4 rounded-round;\n @apply bg-mystic-dark text-white;\n\n p-icon {\n @apply flex #{!important};\n font-size: 0.625rem;\n }\n }\n}\n\n:host([direction='horizontal']) {\n @apply h-10;\n\n .content {\n @apply absolute top-0 min-w-0;\n @apply order-1;\n }\n\n .circle {\n @apply order-2;\n }\n}\n\n:host([direction='vertical']) {\n @apply min-h-[1rem] items-center;\n\n .content {\n @apply order-2 ml-4;\n }\n\n .circle {\n @apply order-1;\n }\n}\n\n:host([active]),\n:host([finished]) {\n .content {\n @apply text-indigo;\n }\n\n .circle {\n @apply bg-indigo;\n }\n}\n\n:host([direction='horizontal'][align='start']) {\n .content {\n @apply left-0;\n }\n}\n\n:host([direction='horizontal'][align='end']) {\n .content {\n @apply right-0;\n }\n}\n\n:host([direction='horizontal'][align='center']) {\n .content {\n @apply left-1/2 -translate-x-1/2 transform text-center;\n }\n}\n\n:host([direction='vertical'][content-position='start']) {\n @apply flex-row-reverse;\n\n .content {\n @apply ml-0 mr-4 flex justify-end;\n }\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'p-stepper-item',\n styleUrl: 'stepper-item.component.scss',\n shadow: true,\n})\nexport class StepperItem {\n /**\n * The alignment of the step content\n */\n @Prop({ reflect: true }) align: 'start' | 'center' | 'end' = 'center';\n\n /**\n * The direction of the stepper step\n */\n @Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n 'horizontal';\n\n /**\n * The position of the content in case of vertical direction\n */\n @Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n /**\n * Wether the step is finished\n */\n @Prop({ reflect: true }) finished: boolean = false;\n\n /**\n * Wether the step is active\n */\n @Prop({ reflect: true }) active: boolean = false;\n\n render() {\n return (\n <Host class=\"p-stepper-item\">\n <div class=\"circle\">\n {this.finished && <p-icon variant=\"checkmark\" />}\n </div>\n <div class=\"content\">\n <slot name=\"content\" />\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-stepper-item.entry.js","mappings":";;AAAA,MAAM,uBAAuB,GAAG,g6HAAg6H;;MCOn7H,WAAW;;;iBAIsC,QAAQ;qBAMpE,YAAY;2BAK+C,KAAK;oBAKpB,KAAK;kBAKP,KAAK;;EAEhD,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAC,gBAAgB,IAC3B,WAAK,KAAK,EAAC,QAAQ,IACjB,IAAI,CAAC,QAAQ,IAAI,cAAQ,OAAO,EAAC,WAAW,GAAG,CAC3C,EACN,WAAK,KAAK,EAAC,SAAS,IACnB,YAAM,IAAI,EAAC,SAAS,GAAG,CAClB,CACA,EACN;GACF;;;;;;","names":[],"sources":["src/components/atoms/stepper-item/stepper-item.component.scss?tag=p-stepper-item&encapsulation=shadow","src/components/atoms/stepper-item/stepper-item.component.tsx"],"sourcesContent":[":host {\n\t@apply relative flex w-full items-end justify-center;\n\n\t.content {\n\t\t@apply min-w-[calc(100%-2rem)] whitespace-nowrap;\n\t\t@apply text-sm text-storm-light;\n\t}\n\n\t.circle {\n\t\t@apply transition duration-500 ease-in-out;\n\t\t@apply flex items-center justify-center;\n\t\t@apply h-4 w-4 rounded-round;\n\t\t@apply bg-mystic-dark text-white;\n\n\t\tp-icon {\n\t\t\t@apply flex #{!important};\n\t\t\tfont-size: 0.625rem;\n\t\t}\n\t}\n}\n\n:host([direction='horizontal']) {\n\t@apply h-10;\n\n\t.content {\n\t\t@apply absolute top-0 min-w-0;\n\t\t@apply order-1;\n\t}\n\n\t.circle {\n\t\t@apply order-2;\n\t}\n}\n\n:host([direction='vertical']) {\n\t@apply min-h-[1rem] items-center;\n\n\t.content {\n\t\t@apply order-2 ml-4;\n\t}\n\n\t.circle {\n\t\t@apply order-1;\n\t}\n}\n\n:host([active]),\n:host([finished]) {\n\t.content {\n\t\t@apply text-indigo;\n\t}\n\n\t.circle {\n\t\t@apply bg-indigo;\n\t}\n}\n\n:host([direction='horizontal'][align='start']) {\n\t.content {\n\t\t@apply left-0;\n\t}\n}\n\n:host([direction='horizontal'][align='end']) {\n\t.content {\n\t\t@apply right-0;\n\t}\n}\n\n:host([direction='horizontal'][align='center']) {\n\t.content {\n\t\t@apply left-1/2 -translate-x-1/2 transform text-center;\n\t}\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply flex-row-reverse;\n\n\t.content {\n\t\t@apply ml-0 mr-4 flex justify-end;\n\t}\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper-item',\n\tstyleUrl: 'stepper-item.component.scss',\n\tshadow: true,\n})\nexport class StepperItem {\n\t/**\n\t * The alignment of the step content\n\t */\n\t@Prop({ reflect: true }) align: 'start' | 'center' | 'end' = 'center';\n\n\t/**\n\t * The direction of the stepper step\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Wether the step is finished\n\t */\n\t@Prop({ reflect: true }) finished: boolean = false;\n\n\t/**\n\t * Wether the step is active\n\t */\n\t@Prop({ reflect: true }) active: boolean = false;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper-item\">\n\t\t\t\t<div class=\"circle\">\n\t\t\t\t\t{this.finished && <p-icon variant=\"checkmark\" />}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<slot name=\"content\" />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"p-stepper-line.entry.js","mappings":";;AAAA,MAAM,uBAAuB,GAAG,67DAA67D;;MCOh9D,WAAW;;;kBAIuB,KAAK;qBAM5C,YAAY;;EAEhB,MAAM;IACF,OAAO,EAAC,IAAI,IAAC,KAAK,EAAC,gBAAgB,GAAQ,CAAC;GAC/C;;;;;;","names":[],"sources":["src/components/atoms/stepper-line/stepper-line.component.scss?tag=p-stepper-line&encapsulation=shadow","src/components/atoms/stepper-line/stepper-line.component.tsx"],"sourcesContent":[":host {\n @apply flex-auto;\n @apply transition duration-500 ease-in-out;\n\n @apply block;\n\n @apply bg-mystic-dark;\n}\n\n:host([direction='horizontal']) {\n @apply mb-[calc(.5rem-1px)] h-[2px];\n}\n\n:host([direction='vertical']) {\n @apply ml-[calc(.5rem-1px)] mr-[calc(.5rem-1px)] min-h-[1rem] w-[2px];\n}\n\n:host([active]) {\n @apply bg-indigo;\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'p-stepper-line',\n styleUrl: 'stepper-line.component.scss',\n shadow: true,\n})\nexport class StepperLine {\n /**\n * Wether the line is active\n */\n @Prop({ reflect: true }) active: boolean = false;\n\n /**\n * The direction of the stepper line\n */\n @Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n 'horizontal';\n\n render() {\n return <Host class=\"p-stepper-line\"></Host>;\n }\n}\n"],"version":3}
1
+ {"file":"p-stepper-line.entry.js","mappings":";;AAAA,MAAM,uBAAuB,GAAG,67DAA67D;;MCOh9D,WAAW;;;kBAIoB,KAAK;qBAM/C,YAAY;;EAEb,MAAM;IACL,OAAO,EAAC,IAAI,IAAC,KAAK,EAAC,gBAAgB,GAAQ,CAAC;GAC5C;;;;;;","names":[],"sources":["src/components/atoms/stepper-line/stepper-line.component.scss?tag=p-stepper-line&encapsulation=shadow","src/components/atoms/stepper-line/stepper-line.component.tsx"],"sourcesContent":[":host {\n\t@apply flex-auto;\n\t@apply transition duration-500 ease-in-out;\n\n\t@apply block;\n\n\t@apply bg-mystic-dark;\n}\n\n:host([direction='horizontal']) {\n\t@apply mb-[calc(.5rem-1px)] h-[2px];\n}\n\n:host([direction='vertical']) {\n\t@apply ml-[calc(.5rem-1px)] mr-[calc(.5rem-1px)] min-h-[1rem] w-[2px];\n}\n\n:host([active]) {\n\t@apply bg-indigo;\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper-line',\n\tstyleUrl: 'stepper-line.component.scss',\n\tshadow: true,\n})\nexport class StepperLine {\n\t/**\n\t * Wether the line is active\n\t */\n\t@Prop({ reflect: true }) active: boolean = false;\n\n\t/**\n\t * The direction of the stepper line\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\trender() {\n\t\treturn <Host class=\"p-stepper-line\"></Host>;\n\t}\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"p-stepper.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;sBAIa,CAAC;qBAM1B,YAAY;2BAK4C,KAAK;;;EASjE,kBAAkB;IACd,IAAI,CAAC,cAAc,EAAE,CAAC;GACzB;EAED,MAAM;IACF,QACI,EAAC,IAAI,IAAC,KAAK,EAAC,WAAW,IACnB,eAAQ,CACL,EACT;G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shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n @apply flex;\n}\n\n:host([direction='horizontal']) {\n @apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n @apply flex-col flex-wrap items-start;\n @apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n @apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n tag: 'p-stepper',\n styleUrl: 'stepper.component.scss',\n shadow: true,\n})\nexport class Stepper {\n /**\n * The currently active step\n */\n @Prop() activeStep: number = 1;\n\n /**\n * The direction of the stepper\n */\n @Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n 'horizontal';\n\n /**\n * The position of the content in case of vertical direction\n */\n @Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n // private _steps: Array<HTMLPStepperItemElement>;\n\n componentDidRender() {\n this._generateSteps();\n }\n\n render() {\n return (\n <Host class=\"p-stepper\">\n <slot />\n </Host>\n );\n }\n\n @Watch('activeStep')\n private _generateSteps() {\n let activeStep = this.activeStep - 1 || 0;\n const items = this._el.querySelectorAll('p-stepper-item');\n\n if (!this.activeStep || activeStep < 0) {\n for (let i = 0; i < items?.length; i++) {\n const item = items.item(i) as any;\n\n if (item.active) {\n activeStep = i;\n }\n\n if (activeStep < 0 && item.finished) {\n activeStep = i + 1;\n }\n }\n }\n\n for (let i = 0; i < items?.length; i++) {\n const item = items.item(i) as any;\n\n item.active = i === activeStep;\n item.finished = i < activeStep;\n item.direction = this.direction;\n item.align =\n i === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n item.contentPosition = this.contentPosition;\n\n if (i < items.length - 1) {\n const nextItem = item.nextElementSibling;\n if (\n nextItem &&\n nextItem.tagName.toLowerCase() === 'p-stepper-item'\n ) {\n const heightDiff = (item.clientHeight - 16) / 2;\n\n const stepperLine =\n document.createElement('p-stepper-line');\n\n stepperLine.direction = this.direction;\n stepperLine.active = i <= activeStep;\n\n if (heightDiff > 0 && this.direction === 'vertical') {\n stepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n stepperLine.style.marginBottom = `-${\n heightDiff / 16\n }rem`;\n stepperLine.style.minHeight = `calc(1rem + ${\n (heightDiff * 2) / 16\n }rem)`;\n }\n\n this._el.insertBefore(stepperLine, nextItem);\n\n continue;\n }\n }\n\n if (i > 0) {\n const previousItem = item.previousElementSibling;\n if (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\n previousItem.direction = this.direction;\n previousItem.active = item.active || item.finished;\n }\n }\n }\n }\n}\n"],"version":3}
1
+ {"file":"p-stepper.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,gfAAgf;;MCO/f,OAAO;;;sBAIU,CAAC;qBAM7B,YAAY;2BAK+C,KAAK;;;EASjE,kBAAkB;IACjB,IAAI,CAAC,cAAc,EAAE,CAAC;GACtB;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAC,WAAW,IACtB,eAAQ,CACF,EACN;GACF;EAGO,cAAc;IACrB,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAE1D,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,GAAG,CAAC,EAAE;MACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,EAAE,CAAC,EAAE,EAAE;QACvC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAQ,CAAC;QAElC,IAAI,IAAI,CAAC,MAAM,EAAE;UAChB,UAAU,GAAG,CAAC,CAAC;SACf;QAED,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;UACpC,UA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C;YACvD,WAAW,CAAC,KAAK,CAAC,YAAY,GAAG,IAChC,UAAU,GAAG,EACd,KAAK,CAAC;YACN,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,eAC7B,CAAC,UAAU,GAAG,CAAC,IAAI,EACpB,MAAM,CAAC;WACP;UAED,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;UAE7C,SAAS;SACT;OACD;MAED,IAAI,CAAC,GAAG,CAAC,EAAE;QACV,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACjD,IAAI,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE;UAC5D,YAAY,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;UACxC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC;SACnD;OACD;KACD;GACD;;;;;;;;;;","names":[],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tcomponentDidRender() {\n\t\tthis._generateSteps();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprivate _generateSteps() {\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\tconst heightDiff = (item.clientHeight - 16) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\tpreviousItem.direction = this.direction;\n\t\t\t\t\tpreviousItem.active = item.active || item.finished;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"p-tab-group.entry.js","mappings":";;MAMa,QAAQ;;;;;kBAGJ,IAAC,sDACF,WAAK,kEACD,kBAEJ,iBAAW,gDACR,EACT;;;;;;;;","names":[],"sources":["src/components/atoms/tab-group/tab-group.component.tsx"],"sourcesContent":["import { Component, h, Host } from '@stencil/core';\n\n@Component({\n tag: 'p-tab-group',\n shadow: true,\n})\nexport class TabGroup {\n render() {\n return (\n <Host class=\"p-tab-group relative flex w-full flex-col\">\n <div class=\"scrollbar-hide z-10 flex w-full gap-5 overflow-x-auto\">\n <slot />\n </div>\n <p-divider class=\"absolute bottom-0 left-0 m-0 w-full\" />\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-tab-group.entry.js","mappings":";;MAMa,QAAQ;;;;;kBAGb,IAAC,sDACL,WAAK,kEACJ,kBAED,iBAAW,gDACL,EACN;;;;;;;;","names":[],"sources":["src/components/atoms/tab-group/tab-group.component.tsx"],"sourcesContent":["import { Component, h, Host } from '@stencil/core';\n\n@Component({\n\ttag: 'p-tab-group',\n\tshadow: true,\n})\nexport class TabGroup {\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-tab-group relative flex w-full flex-col\">\n\t\t\t\t<div class=\"scrollbar-hide z-10 flex w-full gap-5 overflow-x-auto\">\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t\t<p-divider class=\"absolute bottom-0 left-0 m-0 w-full\" />\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"p-tab-item.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,u9BAAu9B;;MCOt+B,OAAO;;;kBAIU,KAAK;;EAE/B,MAAM;IACF,QACI,EAAC,IAAI,IAAC,KAAK,EAAE,cAAc,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,IAChD,eAAQ,CACL,EACT;GACL;;;;;;","names":[],"sources":["src/components/atoms/tab-item/tab-item.component.scss?tag=p-tab-item&encapsulation=shadow","src/components/atoms/tab-item/tab-item.component.tsx"],"sourcesContent":[":host {\n @apply flex h-10 items-center;\n @apply whitespace-nowrap font-semibold text-storm-medium;\n @apply cursor-pointer;\n @apply border-0 border-b-2 border-transparent #{!important};\n}\n\n:host(.active) {\n @apply border-indigo text-indigo #{!important};\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'p-tab-item',\n styleUrl: 'tab-item.component.scss',\n shadow: true,\n})\nexport class TabItem {\n /**\n * Wether the tab item is active\n */\n @Prop() active: boolean = false;\n\n render() {\n return (\n <Host class={`p-tab-item ${this.active && 'active'}`}>\n <slot />\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-tab-item.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,u9BAAu9B;;MCOt+B,OAAO;;;kBAIO,KAAK;;EAE/B,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,cAAc,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,IACnD,eAAQ,CACF,EACN;GACF;;;;;;","names":[],"sources":["src/components/atoms/tab-item/tab-item.component.scss?tag=p-tab-item&encapsulation=shadow","src/components/atoms/tab-item/tab-item.component.tsx"],"sourcesContent":[":host {\n\t@apply flex h-10 items-center;\n\t@apply whitespace-nowrap font-semibold text-storm-medium;\n\t@apply cursor-pointer;\n\t@apply border-0 border-b-2 border-transparent #{!important};\n}\n\n:host(.active) {\n\t@apply border-indigo text-indigo #{!important};\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n\ttag: 'p-tab-item',\n\tstyleUrl: 'tab-item.component.scss',\n\tshadow: true,\n})\nexport class TabItem {\n\t/**\n\t * Wether the tab item is active\n\t */\n\t@Prop() active: boolean = false;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={`p-tab-item ${this.active && 'active'}`}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"p-table-column.entry.js","mappings":";;MAMa,WAAW;;;;;gBASwC,IAAI;;mBAUL,KAAK;uBAKD,KAAK;iBAMhE,OAAO;kBAK+C,KAAK;iBAUtC,MAAM;;EAQ/B,kBAAkB;IACd,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GAC1C;EAED,MAAM;IACF,OAAO;GACV;;;;;","names":[],"sources":["src/components/helpers/table-column/table-column.component.tsx"],"sourcesContent":["import { Component, Event, EventEmitter, Prop } from '@stencil/core';\nimport { TableColumnSizes } from '../../../types/table';\n\n@Component({\n tag: 'p-table-column',\n})\nexport class TableColumn {\n /**\n * The path of the value of the item you want to display\n */\n @Prop({ reflect: true, mutable: true }) path: string;\n\n /**\n * The type of the column\n */\n @Prop({ reflect: true, mutable: true }) type: 'td' | 'th' = 'td';\n\n /**\n * The name of the column\n */\n @Prop({ reflect: true, mutable: true }) name: string;\n\n /**\n * Wether the column should use the slot\n */\n @Prop({ reflect: true, mutable: true }) useSlot: boolean = false;\n\n /**\n * Wether the column should have a checkbox\n */\n @Prop({ reflect: true, mutable: true }) hasCheckbox: boolean = false;\n\n /**\n * The alignment of the column\n */\n @Prop({ reflect: true, mutable: true }) align: 'start' | 'center' | 'end' =\n 'start';\n\n /**\n * Wether the column is the last in the row\n */\n @Prop({ reflect: true, mutable: true }) isLast: boolean = false;\n\n /**\n * The sizes of the column\n */\n @Prop({ mutable: true }) sizes:\n | 'auto'\n | 'hidden'\n | 'full'\n | number\n | TableColumnSizes = 'auto';\n\n /**\n * Event to let the table know it has to re render\n */\n @Event({ bubbles: true, composed: true })\n tableDefinitionChanged: EventEmitter<boolean>;\n\n componentDidUpdate() {\n this.tableDefinitionChanged.emit(true);\n }\n\n render() {\n return;\n }\n}\n"],"version":3}
1
+ {"file":"p-table-column.entry.js","mappings":";;MAMa,WAAW;;;;;gBASqC,IAAI;;mBAUL,KAAK;uBAKD,KAAK;iBAMnE,OAAO;kBAKkD,KAAK;iBAUzC,MAAM;;EAQ5B,kBAAkB;IACjB,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACvC;EAED,MAAM;IACL,OAAO;GACP;;;;;","names":[],"sources":["src/components/helpers/table-column/table-column.component.tsx"],"sourcesContent":["import { Component, Event, EventEmitter, Prop } from '@stencil/core';\nimport { TableColumnSizes } from '../../../types/table';\n\n@Component({\n\ttag: 'p-table-column',\n})\nexport class TableColumn {\n\t/**\n\t * The path of the value of the item you want to display\n\t */\n\t@Prop({ reflect: true, mutable: true }) path: string;\n\n\t/**\n\t * The type of the column\n\t */\n\t@Prop({ reflect: true, mutable: true }) type: 'td' | 'th' = 'td';\n\n\t/**\n\t * The name of the column\n\t */\n\t@Prop({ reflect: true, mutable: true }) name: string;\n\n\t/**\n\t * Wether the column should use the slot\n\t */\n\t@Prop({ reflect: true, mutable: true }) useSlot: boolean = false;\n\n\t/**\n\t * Wether the column should have a checkbox\n\t */\n\t@Prop({ reflect: true, mutable: true }) hasCheckbox: boolean = false;\n\n\t/**\n\t * The alignment of the column\n\t */\n\t@Prop({ reflect: true, mutable: true }) align: 'start' | 'center' | 'end' =\n\t\t'start';\n\n\t/**\n\t * Wether the column is the last in the row\n\t */\n\t@Prop({ reflect: true, mutable: true }) isLast: boolean = false;\n\n\t/**\n\t * The sizes of the column\n\t */\n\t@Prop({ mutable: true }) sizes:\n\t\t| 'auto'\n\t\t| 'hidden'\n\t\t| 'full'\n\t\t| number\n\t\t| TableColumnSizes = 'auto';\n\n\t/**\n\t * Event to let the table know it has to re render\n\t */\n\t@Event({ bubbles: true, composed: true })\n\ttableDefinitionChanged: EventEmitter<boolean>;\n\n\tcomponentDidUpdate() {\n\t\tthis.tableDefinitionChanged.emit(true);\n\t}\n\n\trender() {\n\t\treturn;\n\t}\n}\n"],"version":3}