@paperless/core 1.17.5 → 1.19.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 (536) hide show
  1. package/CHANGELOG.md +25 -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/assets/icons/company.svg +8 -0
  11. package/dist/build/p-03090f03.entry.js.map +1 -1
  12. package/dist/build/p-085e6ff4.entry.js.map +1 -1
  13. package/dist/build/p-2becd73c.entry.js.map +1 -1
  14. package/dist/build/p-2cb55f24.entry.js.map +1 -1
  15. package/dist/build/p-2cd5062f.entry.js.map +1 -1
  16. package/dist/build/p-35c563a7.entry.js.map +1 -1
  17. package/dist/build/p-415c5040.entry.js.map +1 -1
  18. package/dist/build/p-424d5c8a.entry.js.map +1 -1
  19. package/dist/build/p-46a939e2.entry.js.map +1 -1
  20. package/dist/build/p-4c30c74b.entry.js.map +1 -1
  21. package/dist/build/p-4dc5647e.entry.js.map +1 -1
  22. package/dist/build/p-4e9e4ce2.entry.js.map +1 -1
  23. package/dist/build/p-606ad811.entry.js.map +1 -1
  24. package/dist/build/p-682db916.entry.js.map +1 -1
  25. package/dist/build/p-699e0b35.entry.js.map +1 -1
  26. package/dist/build/p-6a5aeb90.entry.js.map +1 -1
  27. package/dist/build/p-7793ba3a.entry.js.map +1 -1
  28. package/dist/build/p-7d15ff9a.entry.js.map +1 -1
  29. package/dist/build/p-8426ca20.entry.js.map +1 -1
  30. package/dist/build/p-93052b42.entry.js.map +1 -1
  31. package/dist/build/p-97bcf0b5.entry.js.map +1 -1
  32. package/dist/build/p-9c914665.entry.js.map +1 -1
  33. package/dist/build/p-9d3d72fa.entry.js.map +1 -1
  34. package/dist/build/p-a2b552f9.entry.js.map +1 -1
  35. package/dist/build/p-a7344d53.entry.js +2 -0
  36. package/dist/build/p-a7344d53.entry.js.map +1 -0
  37. package/dist/build/p-af6b813e.entry.js.map +1 -1
  38. package/dist/build/p-b6f43309.entry.js.map +1 -1
  39. package/dist/build/p-b7c0f157.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-daeadc69.entry.js +2 -0
  47. package/dist/build/p-daeadc69.entry.js.map +1 -0
  48. package/dist/build/p-dd20caf1.entry.js.map +1 -1
  49. package/dist/build/p-dfa8eae9.entry.js +2 -0
  50. package/dist/build/p-dfa8eae9.entry.js.map +1 -0
  51. package/dist/build/p-ec15ee73.entry.js.map +1 -1
  52. package/dist/build/p-ec29eed0.entry.js.map +1 -1
  53. package/dist/build/p-f0f1a46b.entry.js.map +1 -1
  54. package/dist/build/p-f34e08ec.entry.js.map +1 -1
  55. package/dist/build/p-f9e52ae3.entry.js.map +1 -1
  56. package/dist/build/p-fac13366.entry.js.map +1 -1
  57. package/dist/build/paperless.css +1 -1
  58. package/dist/build/paperless.esm.js +1 -1
  59. package/dist/build/paperless.esm.js.map +1 -1
  60. package/dist/cjs/index-1fde8b14.js +4 -4
  61. package/dist/cjs/loader.cjs.js +1 -1
  62. package/dist/cjs/p-accordion.cjs.entry.js.map +1 -1
  63. package/dist/cjs/p-attachment.cjs.entry.js.map +1 -1
  64. package/dist/cjs/p-avatar-group.cjs.entry.js.map +1 -1
  65. package/dist/cjs/p-avatar.cjs.entry.js.map +1 -1
  66. package/dist/cjs/p-backdrop.cjs.entry.js.map +1 -1
  67. package/dist/cjs/p-button_3.cjs.entry.js +10 -5
  68. package/dist/cjs/p-button_3.cjs.entry.js.map +1 -1
  69. package/dist/cjs/p-calendar.cjs.entry.js +2 -2
  70. package/dist/cjs/p-calendar.cjs.entry.js.map +1 -1
  71. package/dist/cjs/p-card-body.cjs.entry.js.map +1 -1
  72. package/dist/cjs/p-card-container.cjs.entry.js.map +1 -1
  73. package/dist/cjs/p-card-header.cjs.entry.js.map +1 -1
  74. package/dist/cjs/p-content-slider.cjs.entry.js.map +1 -1
  75. package/dist/cjs/p-counter.cjs.entry.js.map +1 -1
  76. package/dist/cjs/p-cropper.cjs.entry.js.map +1 -1
  77. package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
  78. package/dist/cjs/p-divider.cjs.entry.js.map +1 -1
  79. package/dist/cjs/p-drawer-body_3.cjs.entry.js.map +1 -1
  80. package/dist/cjs/p-drawer.cjs.entry.js.map +1 -1
  81. package/dist/cjs/p-dropdown-menu-container.cjs.entry.js.map +1 -1
  82. package/dist/cjs/p-dropdown_2.cjs.entry.js +7 -2
  83. package/dist/cjs/p-dropdown_2.cjs.entry.js.map +1 -1
  84. package/dist/cjs/p-floating-menu-container_8.cjs.entry.js +40 -40
  85. package/dist/cjs/p-floating-menu-container_8.cjs.entry.js.map +1 -1
  86. package/dist/cjs/p-helper_3.cjs.entry.js +4 -4
  87. package/dist/cjs/p-helper_3.cjs.entry.js.map +1 -1
  88. package/dist/cjs/p-info-panel.cjs.entry.js.map +1 -1
  89. package/dist/cjs/p-label_3.cjs.entry.js +1 -1
  90. package/dist/cjs/p-label_3.cjs.entry.js.map +1 -1
  91. package/dist/cjs/p-layout.cjs.entry.js.map +1 -1
  92. package/dist/cjs/p-modal-body_4.cjs.entry.js.map +1 -1
  93. package/dist/cjs/p-modal.cjs.entry.js.map +1 -1
  94. package/dist/cjs/p-navbar.cjs.entry.js.map +1 -1
  95. package/dist/cjs/p-navigation-item.cjs.entry.js.map +1 -1
  96. package/dist/cjs/p-page-size-select_3.cjs.entry.js.map +1 -1
  97. package/dist/cjs/p-profile.cjs.entry.js.map +1 -1
  98. package/dist/cjs/p-select.cjs.entry.js +136 -18
  99. package/dist/cjs/p-select.cjs.entry.js.map +1 -1
  100. package/dist/cjs/p-slider-indicator.cjs.entry.js.map +1 -1
  101. package/dist/cjs/p-status.cjs.entry.js.map +1 -1
  102. package/dist/cjs/p-stepper-item.cjs.entry.js.map +1 -1
  103. package/dist/cjs/p-stepper-line.cjs.entry.js.map +1 -1
  104. package/dist/cjs/p-stepper.cjs.entry.js.map +1 -1
  105. package/dist/cjs/p-tab-group.cjs.entry.js.map +1 -1
  106. package/dist/cjs/p-tab-item.cjs.entry.js.map +1 -1
  107. package/dist/cjs/p-table-column.cjs.entry.js.map +1 -1
  108. package/dist/cjs/p-table.cjs.entry.js.map +1 -1
  109. package/dist/cjs/p-toast-container.cjs.entry.js.map +1 -1
  110. package/dist/cjs/p-toast.cjs.entry.js.map +1 -1
  111. package/dist/cjs/p-tooltip.cjs.entry.js.map +1 -1
  112. package/dist/cjs/paperless.cjs.js +1 -1
  113. package/dist/collection/assets/icons/company.svg +8 -0
  114. package/dist/collection/components/atoms/avatar/avatar.component.js +1 -1
  115. package/dist/collection/components/atoms/avatar/avatar.component.js.map +1 -1
  116. package/dist/collection/components/atoms/avatar/test/avatar.component.e2e.js.map +1 -1
  117. package/dist/collection/components/atoms/avatar/test/avatar.component.spec.js.map +1 -1
  118. package/dist/collection/components/atoms/avatar-group/avatar-group.component.js.map +1 -1
  119. package/dist/collection/components/atoms/avatar-group/test/avatar-group.component.e2e.js.map +1 -1
  120. package/dist/collection/components/atoms/avatar-group/test/avatar-group.component.spec.js.map +1 -1
  121. package/dist/collection/components/atoms/backdrop/backdrop.component.js +1 -1
  122. package/dist/collection/components/atoms/backdrop/backdrop.component.js.map +1 -1
  123. package/dist/collection/components/atoms/backdrop/test/backdrop.component.e2e.js.map +1 -1
  124. package/dist/collection/components/atoms/backdrop/test/backdrop.component.spec.js.map +1 -1
  125. package/dist/collection/components/atoms/button/button.component.js +1 -1
  126. package/dist/collection/components/atoms/button/button.component.js.map +1 -1
  127. package/dist/collection/components/atoms/button/test/button.component.e2e.js.map +1 -1
  128. package/dist/collection/components/atoms/button/test/button.component.spec.js.map +1 -1
  129. package/dist/collection/components/atoms/card-body/card-body.component.js.map +1 -1
  130. package/dist/collection/components/atoms/card-body/test/card-body.component.e2e.js.map +1 -1
  131. package/dist/collection/components/atoms/card-body/test/card-body.component.spec.js.map +1 -1
  132. package/dist/collection/components/atoms/card-container/card-container.component.js.map +1 -1
  133. package/dist/collection/components/atoms/card-container/test/card-container.component.e2e.js.map +1 -1
  134. package/dist/collection/components/atoms/card-container/test/card-container.component.spec.js.map +1 -1
  135. package/dist/collection/components/atoms/card-header/card-header.component.js.map +1 -1
  136. package/dist/collection/components/atoms/card-header/test/card-header.component.e2e.js.map +1 -1
  137. package/dist/collection/components/atoms/card-header/test/card-header.component.spec.js.map +1 -1
  138. package/dist/collection/components/atoms/counter/counter.component.js.map +1 -1
  139. package/dist/collection/components/atoms/counter/test/counter.component.e2e.js.map +1 -1
  140. package/dist/collection/components/atoms/counter/test/counter.component.spec.js.map +1 -1
  141. package/dist/collection/components/atoms/divider/divider.component.js.map +1 -1
  142. package/dist/collection/components/atoms/divider/test/divider.component.e2e.js.map +1 -1
  143. package/dist/collection/components/atoms/divider/test/divider.component.spec.js.map +1 -1
  144. package/dist/collection/components/atoms/drawer-body/drawer-body.component.js.map +1 -1
  145. package/dist/collection/components/atoms/drawer-body/test/drawer-body.component.e2e.js.map +1 -1
  146. package/dist/collection/components/atoms/drawer-body/test/drawer-body.component.spec.js.map +1 -1
  147. package/dist/collection/components/atoms/drawer-container/drawer-container.component.js.map +1 -1
  148. package/dist/collection/components/atoms/drawer-container/test/drawer-container.component.e2e.js.map +1 -1
  149. package/dist/collection/components/atoms/drawer-container/test/drawer-container.component.spec.js.map +1 -1
  150. package/dist/collection/components/atoms/drawer-header/drawer-header.component.js.map +1 -1
  151. package/dist/collection/components/atoms/drawer-header/test/drawer-header.component.e2e.js.map +1 -1
  152. package/dist/collection/components/atoms/drawer-header/test/drawer-header.component.spec.js.map +1 -1
  153. package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js.map +1 -1
  154. package/dist/collection/components/atoms/dropdown-menu-container/test/dropdown-menu-container.component.e2e.js.map +1 -1
  155. package/dist/collection/components/atoms/dropdown-menu-container/test/dropdown-menu-item.component.spec.js.map +1 -1
  156. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +1 -1
  157. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +22 -3
  158. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js.map +1 -1
  159. package/dist/collection/components/atoms/dropdown-menu-item/test/dropdown-menu-item.component.e2e.js.map +1 -1
  160. package/dist/collection/components/atoms/dropdown-menu-item/test/dropdown-menu-item.component.spec.js.map +1 -1
  161. package/dist/collection/components/atoms/floating-menu-container/floating-menu-container.component.js.map +1 -1
  162. package/dist/collection/components/atoms/floating-menu-container/test/floating-menu-container.component.e2e.js.map +1 -1
  163. package/dist/collection/components/atoms/floating-menu-container/test/floating-menu-container.component.spec.js.map +1 -1
  164. package/dist/collection/components/atoms/floating-menu-item/floating-menu-item.component.js.map +1 -1
  165. package/dist/collection/components/atoms/floating-menu-item/test/floating-menu-container.component.e2e.js.map +1 -1
  166. package/dist/collection/components/atoms/floating-menu-item/test/floating-menu-container.component.spec.js.map +1 -1
  167. package/dist/collection/components/atoms/helper/helper.component.js.map +1 -1
  168. package/dist/collection/components/atoms/helper/test/helper.component.e2e.js.map +1 -1
  169. package/dist/collection/components/atoms/helper/test/helper.component.spec.js.map +1 -1
  170. package/dist/collection/components/atoms/icon/icon.component.js +1 -1
  171. package/dist/collection/components/atoms/icon/icon.component.js.map +1 -1
  172. package/dist/collection/components/atoms/icon/test/icon.component.e2e.js.map +1 -1
  173. package/dist/collection/components/atoms/icon/test/icon.component.spec.js.map +1 -1
  174. package/dist/collection/components/atoms/illustration/illustration.component.js +1 -1
  175. package/dist/collection/components/atoms/illustration/illustration.component.js.map +1 -1
  176. package/dist/collection/components/atoms/illustration/test/illustration.component.e2e.js.map +1 -1
  177. package/dist/collection/components/atoms/illustration/test/illustration.component.spec.js.map +1 -1
  178. package/dist/collection/components/atoms/info-panel/info-panel.component.js.map +1 -1
  179. package/dist/collection/components/atoms/info-panel/test/info-panel.component.e2e.js.map +1 -1
  180. package/dist/collection/components/atoms/info-panel/test/info-panel.component.spec.js.map +1 -1
  181. package/dist/collection/components/atoms/label/label.component.js +3 -3
  182. package/dist/collection/components/atoms/label/label.component.js.map +1 -1
  183. package/dist/collection/components/atoms/label/test/label.component.e2e.js.map +1 -1
  184. package/dist/collection/components/atoms/label/test/label.component.spec.js.map +1 -1
  185. package/dist/collection/components/atoms/layout/layout.component.js.map +1 -1
  186. package/dist/collection/components/atoms/layout/test/layout.component.e2e.js.map +1 -1
  187. package/dist/collection/components/atoms/layout/test/layout.component.spec.js.map +1 -1
  188. package/dist/collection/components/atoms/loader/loader.component.js +1 -1
  189. package/dist/collection/components/atoms/loader/loader.component.js.map +1 -1
  190. package/dist/collection/components/atoms/loader/test/loader.component.e2e.js.map +1 -1
  191. package/dist/collection/components/atoms/loader/test/loader.component.spec.js.map +1 -1
  192. package/dist/collection/components/atoms/modal-body/modal-body.component.js.map +1 -1
  193. package/dist/collection/components/atoms/modal-body/test/modal-body.component.e2e.js.map +1 -1
  194. package/dist/collection/components/atoms/modal-body/test/modal-body.component.spec.js.map +1 -1
  195. package/dist/collection/components/atoms/modal-container/modal-container.component.js.map +1 -1
  196. package/dist/collection/components/atoms/modal-container/test/modal-container.component.e2e.js.map +1 -1
  197. package/dist/collection/components/atoms/modal-container/test/modal-container.component.spec.js.map +1 -1
  198. package/dist/collection/components/atoms/modal-footer/modal-footer.component.js.map +1 -1
  199. package/dist/collection/components/atoms/modal-footer/test/modal-footer.component.e2e.js.map +1 -1
  200. package/dist/collection/components/atoms/modal-footer/test/modal-footer.component.spec.js.map +1 -1
  201. package/dist/collection/components/atoms/modal-header/modal-header.component.js.map +1 -1
  202. package/dist/collection/components/atoms/modal-header/test/modal-header.component.e2e.js.map +1 -1
  203. package/dist/collection/components/atoms/modal-header/test/modal-header.component.spec.js.map +1 -1
  204. package/dist/collection/components/atoms/pagination-item/pagination-item.component.js.map +1 -1
  205. package/dist/collection/components/atoms/pagination-item/test/pagination-item.component.e2e.js.map +1 -1
  206. package/dist/collection/components/atoms/pagination-item/test/pagination-item.component.spec.js.map +1 -1
  207. package/dist/collection/components/atoms/segment-container/segment-container.component.js.map +1 -1
  208. package/dist/collection/components/atoms/segment-container/test/segment-container.component.e2e.js.map +1 -1
  209. package/dist/collection/components/atoms/segment-container/test/segment-container.component.spec.js.map +1 -1
  210. package/dist/collection/components/atoms/segment-item/segment-item.component.js +2 -2
  211. package/dist/collection/components/atoms/segment-item/segment-item.component.js.map +1 -1
  212. package/dist/collection/components/atoms/segment-item/test/segment-item.component.e2e.js.map +1 -1
  213. package/dist/collection/components/atoms/segment-item/test/segment-item.component.spec.js.map +1 -1
  214. package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.js.map +1 -1
  215. package/dist/collection/components/atoms/slider-indicator/test/slider-indicator.component.e2e.js.map +1 -1
  216. package/dist/collection/components/atoms/slider-indicator/test/slider-indicator.component.spec.js.map +1 -1
  217. package/dist/collection/components/atoms/status/status.component.js +1 -1
  218. package/dist/collection/components/atoms/status/status.component.js.map +1 -1
  219. package/dist/collection/components/atoms/status/test/status.component.e2e.js.map +1 -1
  220. package/dist/collection/components/atoms/status/test/status.component.spec.js.map +1 -1
  221. package/dist/collection/components/atoms/stepper-item/stepper-item.component.js.map +1 -1
  222. package/dist/collection/components/atoms/stepper-item/test/stepper-item.component.e2e.js.map +1 -1
  223. package/dist/collection/components/atoms/stepper-item/test/stepper-item.component.spec.js.map +1 -1
  224. package/dist/collection/components/atoms/stepper-line/stepper-line.component.js.map +1 -1
  225. package/dist/collection/components/atoms/stepper-line/test/stepper-line.component.e2e.js.map +1 -1
  226. package/dist/collection/components/atoms/stepper-line/test/stepper-line.component.spec.js.map +1 -1
  227. package/dist/collection/components/atoms/tab-group/tab-group.component.js.map +1 -1
  228. package/dist/collection/components/atoms/tab-group/test/tab-group.component.e2e.js.map +1 -1
  229. package/dist/collection/components/atoms/tab-group/test/tab-group.component.spec.js.map +1 -1
  230. package/dist/collection/components/atoms/tab-item/tab-item.component.js.map +1 -1
  231. package/dist/collection/components/atoms/tab-item/test/tab-item.component.e2e.js.map +1 -1
  232. package/dist/collection/components/atoms/tab-item/test/tab-item.component.spec.js.map +1 -1
  233. package/dist/collection/components/atoms/table-container/table-container.component.js.map +1 -1
  234. package/dist/collection/components/atoms/table-container/test/table-container.component.e2e.js.map +1 -1
  235. package/dist/collection/components/atoms/table-container/test/table-container.component.spec.js.map +1 -1
  236. package/dist/collection/components/atoms/toast-container/test/toast-container.component.e2e.js.map +1 -1
  237. package/dist/collection/components/atoms/toast-container/test/toast-container.component.spec.js.map +1 -1
  238. package/dist/collection/components/atoms/toast-container/toast-container.component.js.map +1 -1
  239. package/dist/collection/components/atoms/tooltip/test/tooltip.component.e2e.js.map +1 -1
  240. package/dist/collection/components/atoms/tooltip/test/tooltip.component.spec.js.map +1 -1
  241. package/dist/collection/components/atoms/tooltip/tooltip.component.js.map +1 -1
  242. package/dist/collection/components/helpers/table-column/table-column.component.js +1 -1
  243. package/dist/collection/components/helpers/table-column/table-column.component.js.map +1 -1
  244. package/dist/collection/components/molecules/accordion/accordion.component.js.map +1 -1
  245. package/dist/collection/components/molecules/accordion/test/accordion.component.e2e.js.map +1 -1
  246. package/dist/collection/components/molecules/accordion/test/accordion.component.spec.js.map +1 -1
  247. package/dist/collection/components/molecules/attachment/attachment.component.js.map +1 -1
  248. package/dist/collection/components/molecules/attachment/test/attachment.component.e2e.js.map +1 -1
  249. package/dist/collection/components/molecules/attachment/test/attachment.component.spec.js.map +1 -1
  250. package/dist/collection/components/molecules/calendar/calendar.component.js +2 -2
  251. package/dist/collection/components/molecules/calendar/calendar.component.js.map +1 -1
  252. package/dist/collection/components/molecules/calendar/test/calendar.component.e2e.js.map +1 -1
  253. package/dist/collection/components/molecules/calendar/test/calendar.component.spec.js.map +1 -1
  254. package/dist/collection/components/molecules/content-slider/content-slider.component.js.map +1 -1
  255. package/dist/collection/components/molecules/content-slider/test/content-slider.component.e2e.js.map +1 -1
  256. package/dist/collection/components/molecules/content-slider/test/content-slider.component.spec.js.map +1 -1
  257. package/dist/collection/components/molecules/cropper/cropper.component.js.map +1 -1
  258. package/dist/collection/components/molecules/cropper/test/cropper.component.e2e.js.map +1 -1
  259. package/dist/collection/components/molecules/cropper/test/cropper.component.spec.js.map +1 -1
  260. package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -1
  261. package/dist/collection/components/molecules/datepicker/test/datepicker.component.e2e.js.map +1 -1
  262. package/dist/collection/components/molecules/datepicker/test/datepicker.component.spec.js.map +1 -1
  263. package/dist/collection/components/molecules/dropdown/dropdown.component.js +22 -0
  264. package/dist/collection/components/molecules/dropdown/dropdown.component.js.map +1 -1
  265. package/dist/collection/components/molecules/dropdown/test/dropdown.component.e2e.js.map +1 -1
  266. package/dist/collection/components/molecules/dropdown/test/dropdown.component.spec.js.map +1 -1
  267. package/dist/collection/components/molecules/input-error/input-error.component.js.map +1 -1
  268. package/dist/collection/components/molecules/input-error/test/input-error.component.e2e.js.map +1 -1
  269. package/dist/collection/components/molecules/input-error/test/input-error.component.spec.js.map +1 -1
  270. package/dist/collection/components/molecules/input-group/input-group.component.js +5 -5
  271. package/dist/collection/components/molecules/input-group/input-group.component.js.map +1 -1
  272. package/dist/collection/components/molecules/input-group/test/input-group.component.e2e.js.map +1 -1
  273. package/dist/collection/components/molecules/input-group/test/input-group.component.spec.js.map +1 -1
  274. package/dist/collection/components/molecules/navigation-item/navigation-item.component.js +1 -1
  275. package/dist/collection/components/molecules/navigation-item/navigation-item.component.js.map +1 -1
  276. package/dist/collection/components/molecules/navigation-item/test/navigation-item.component.e2e.js.map +1 -1
  277. package/dist/collection/components/molecules/navigation-item/test/navigation-item.component.spec.js.map +1 -1
  278. package/dist/collection/components/molecules/page-size-select/page-size-select.component.js +2 -2
  279. package/dist/collection/components/molecules/page-size-select/page-size-select.component.js.map +1 -1
  280. package/dist/collection/components/molecules/page-size-select/test/page-size-select.component.e2e.js.map +1 -1
  281. package/dist/collection/components/molecules/page-size-select/test/page-size-select.component.spec.js.map +1 -1
  282. package/dist/collection/components/molecules/pagination/pagination.component.js +1 -1
  283. package/dist/collection/components/molecules/pagination/pagination.component.js.map +1 -1
  284. package/dist/collection/components/molecules/pagination/test/pagination.component.e2e.js.map +1 -1
  285. package/dist/collection/components/molecules/pagination/test/pagination.component.spec.js.map +1 -1
  286. package/dist/collection/components/molecules/profile/profile.component.js.map +1 -1
  287. package/dist/collection/components/molecules/profile/test/profile.component.e2e.js.map +1 -1
  288. package/dist/collection/components/molecules/profile/test/profile.component.spec.js.map +1 -1
  289. package/dist/collection/components/molecules/select/select.component.css +1 -1
  290. package/dist/collection/components/molecules/select/select.component.js +239 -19
  291. package/dist/collection/components/molecules/select/select.component.js.map +1 -1
  292. package/dist/collection/components/molecules/select/test/select.component.e2e.js.map +1 -1
  293. package/dist/collection/components/molecules/select/test/select.component.spec.js.map +1 -1
  294. package/dist/collection/components/molecules/stepper/stepper.component.js.map +1 -1
  295. package/dist/collection/components/molecules/stepper/test/stepper.component.e2e.js.map +1 -1
  296. package/dist/collection/components/molecules/stepper/test/stepper.component.spec.js.map +1 -1
  297. package/dist/collection/components/molecules/table-cell/table-cell.component.js +40 -40
  298. package/dist/collection/components/molecules/table-cell/table-cell.component.js.map +1 -1
  299. package/dist/collection/components/molecules/table-cell/test/table-cell.component.e2e.js.map +1 -1
  300. package/dist/collection/components/molecules/table-cell/test/table-cell.component.spec.js.map +1 -1
  301. package/dist/collection/components/molecules/table-footer/table-footer.component.js +2 -2
  302. package/dist/collection/components/molecules/table-footer/table-footer.component.js.map +1 -1
  303. package/dist/collection/components/molecules/table-footer/test/table-footer.component.e2e.js.map +1 -1
  304. package/dist/collection/components/molecules/table-footer/test/table-footer.component.spec.js.map +1 -1
  305. package/dist/collection/components/molecules/table-header/table-header.component.js +1 -1
  306. package/dist/collection/components/molecules/table-header/table-header.component.js.map +1 -1
  307. package/dist/collection/components/molecules/table-header/test/table-header.component.e2e.js.map +1 -1
  308. package/dist/collection/components/molecules/table-header/test/table-header.component.spec.js.map +1 -1
  309. package/dist/collection/components/molecules/table-row/table-row.component.js.map +1 -1
  310. package/dist/collection/components/molecules/table-row/test/table-row.component.e2e.js.map +1 -1
  311. package/dist/collection/components/molecules/table-row/test/table-row.component.spec.js.map +1 -1
  312. package/dist/collection/components/molecules/toast/test/toast.component.e2e.js.map +1 -1
  313. package/dist/collection/components/molecules/toast/test/toast.component.spec.js.map +1 -1
  314. package/dist/collection/components/molecules/toast/toast.component.js +1 -1
  315. package/dist/collection/components/molecules/toast/toast.component.js.map +1 -1
  316. package/dist/collection/components/organisms/drawer/drawer.component.js +2 -2
  317. package/dist/collection/components/organisms/drawer/drawer.component.js.map +1 -1
  318. package/dist/collection/components/organisms/drawer/test/drawer.component.e2e.js.map +1 -1
  319. package/dist/collection/components/organisms/drawer/test/drawer.component.spec.js.map +1 -1
  320. package/dist/collection/components/organisms/modal/modal.component.js.map +1 -1
  321. package/dist/collection/components/organisms/modal/test/modal.component.e2e.js.map +1 -1
  322. package/dist/collection/components/organisms/modal/test/modal.component.spec.js.map +1 -1
  323. package/dist/collection/components/organisms/navbar/navbar.component.js.map +1 -1
  324. package/dist/collection/components/organisms/navbar/test/navbar.component.e2e.js.map +1 -1
  325. package/dist/collection/components/organisms/navbar/test/navbar.component.spec.js.map +1 -1
  326. package/dist/collection/components/organisms/table/table.component.js +7 -7
  327. package/dist/collection/components/organisms/table/table.component.js.map +1 -1
  328. package/dist/collection/components/organisms/table/test/table.component.e2e.js.map +1 -1
  329. package/dist/collection/components/organisms/table/test/table.component.spec.js.map +1 -1
  330. package/dist/collection/utils/icons.js +2 -2
  331. package/dist/collection/utils/icons.js.map +1 -1
  332. package/dist/components/avatar.component.js +70 -0
  333. package/dist/components/avatar.component.js.map +1 -0
  334. package/dist/components/backdrop.component.js.map +1 -1
  335. package/dist/components/button.component.js.map +1 -1
  336. package/dist/components/calendar.component.js +2 -2
  337. package/dist/components/calendar.component.js.map +1 -1
  338. package/dist/components/counter.component.js.map +1 -1
  339. package/dist/components/divider.component.js.map +1 -1
  340. package/dist/components/drawer-body.component.js.map +1 -1
  341. package/dist/components/drawer-container.component.js.map +1 -1
  342. package/dist/components/drawer-header.component.js.map +1 -1
  343. package/dist/components/dropdown-menu-container.component.js.map +1 -1
  344. package/dist/components/dropdown-menu-item.component.js +4 -2
  345. package/dist/components/dropdown-menu-item.component.js.map +1 -1
  346. package/dist/components/dropdown.component.js +5 -0
  347. package/dist/components/dropdown.component.js.map +1 -1
  348. package/dist/components/floating-menu-container.component.js.map +1 -1
  349. package/dist/components/floating-menu-item.component.js.map +1 -1
  350. package/dist/components/helper.component.js.map +1 -1
  351. package/dist/components/icon.component.js +10 -5
  352. package/dist/components/icon.component.js.map +1 -1
  353. package/dist/components/illustration.component.js +1 -1
  354. package/dist/components/illustration.component.js.map +1 -1
  355. package/dist/components/input-error.component.js.map +1 -1
  356. package/dist/components/input-group.component.js +4 -4
  357. package/dist/components/input-group.component.js.map +1 -1
  358. package/dist/components/label.component.js.map +1 -1
  359. package/dist/components/loader.component.js.map +1 -1
  360. package/dist/components/modal-body.component.js.map +1 -1
  361. package/dist/components/modal-container.component.js.map +1 -1
  362. package/dist/components/modal-footer.component.js.map +1 -1
  363. package/dist/components/modal-header.component.js.map +1 -1
  364. package/dist/components/p-accordion.js.map +1 -1
  365. package/dist/components/p-attachment.js.map +1 -1
  366. package/dist/components/p-avatar-group.js.map +1 -1
  367. package/dist/components/p-avatar.js +1 -66
  368. package/dist/components/p-avatar.js.map +1 -1
  369. package/dist/components/p-card-body.js.map +1 -1
  370. package/dist/components/p-card-container.js.map +1 -1
  371. package/dist/components/p-card-header.js.map +1 -1
  372. package/dist/components/p-content-slider.js.map +1 -1
  373. package/dist/components/p-cropper.js.map +1 -1
  374. package/dist/components/p-datepicker.js.map +1 -1
  375. package/dist/components/p-drawer.js.map +1 -1
  376. package/dist/components/p-info-panel.js.map +1 -1
  377. package/dist/components/p-layout.js.map +1 -1
  378. package/dist/components/p-modal.js.map +1 -1
  379. package/dist/components/p-navbar.js.map +1 -1
  380. package/dist/components/p-navigation-item.js.map +1 -1
  381. package/dist/components/p-profile.js.map +1 -1
  382. package/dist/components/p-select.js +150 -20
  383. package/dist/components/p-select.js.map +1 -1
  384. package/dist/components/p-status.js.map +1 -1
  385. package/dist/components/p-stepper-item.js.map +1 -1
  386. package/dist/components/p-stepper.js.map +1 -1
  387. package/dist/components/p-tab-group.js.map +1 -1
  388. package/dist/components/p-tab-item.js.map +1 -1
  389. package/dist/components/p-table-column.js.map +1 -1
  390. package/dist/components/p-table.js.map +1 -1
  391. package/dist/components/p-toast-container.js.map +1 -1
  392. package/dist/components/p-toast.js.map +1 -1
  393. package/dist/components/page-size-select.component.js.map +1 -1
  394. package/dist/components/pagination-item.component.js.map +1 -1
  395. package/dist/components/pagination.component.js.map +1 -1
  396. package/dist/components/segment-container.component.js.map +1 -1
  397. package/dist/components/segment-item.component.js +1 -1
  398. package/dist/components/segment-item.component.js.map +1 -1
  399. package/dist/components/slider-indicator.component.js.map +1 -1
  400. package/dist/components/stepper-line.component.js.map +1 -1
  401. package/dist/components/table-cell.component.js +39 -39
  402. package/dist/components/table-cell.component.js.map +1 -1
  403. package/dist/components/table-container.component.js.map +1 -1
  404. package/dist/components/table-footer.component.js.map +1 -1
  405. package/dist/components/table-header.component.js.map +1 -1
  406. package/dist/components/table-row.component.js.map +1 -1
  407. package/dist/components/tooltip.component.js.map +1 -1
  408. package/dist/esm/index-7b917f6b.js +4 -4
  409. package/dist/esm/loader.js +1 -1
  410. package/dist/esm/p-accordion.entry.js.map +1 -1
  411. package/dist/esm/p-attachment.entry.js.map +1 -1
  412. package/dist/esm/p-avatar-group.entry.js.map +1 -1
  413. package/dist/esm/p-avatar.entry.js.map +1 -1
  414. package/dist/esm/p-backdrop.entry.js.map +1 -1
  415. package/dist/esm/p-button_3.entry.js +10 -5
  416. package/dist/esm/p-button_3.entry.js.map +1 -1
  417. package/dist/esm/p-calendar.entry.js +2 -2
  418. package/dist/esm/p-calendar.entry.js.map +1 -1
  419. package/dist/esm/p-card-body.entry.js.map +1 -1
  420. package/dist/esm/p-card-container.entry.js.map +1 -1
  421. package/dist/esm/p-card-header.entry.js.map +1 -1
  422. package/dist/esm/p-content-slider.entry.js.map +1 -1
  423. package/dist/esm/p-counter.entry.js.map +1 -1
  424. package/dist/esm/p-cropper.entry.js.map +1 -1
  425. package/dist/esm/p-datepicker.entry.js.map +1 -1
  426. package/dist/esm/p-divider.entry.js.map +1 -1
  427. package/dist/esm/p-drawer-body_3.entry.js.map +1 -1
  428. package/dist/esm/p-drawer.entry.js.map +1 -1
  429. package/dist/esm/p-dropdown-menu-container.entry.js.map +1 -1
  430. package/dist/esm/p-dropdown_2.entry.js +7 -2
  431. package/dist/esm/p-dropdown_2.entry.js.map +1 -1
  432. package/dist/esm/p-floating-menu-container_8.entry.js +40 -40
  433. package/dist/esm/p-floating-menu-container_8.entry.js.map +1 -1
  434. package/dist/esm/p-helper_3.entry.js +4 -4
  435. package/dist/esm/p-helper_3.entry.js.map +1 -1
  436. package/dist/esm/p-info-panel.entry.js.map +1 -1
  437. package/dist/esm/p-label_3.entry.js +1 -1
  438. package/dist/esm/p-label_3.entry.js.map +1 -1
  439. package/dist/esm/p-layout.entry.js.map +1 -1
  440. package/dist/esm/p-modal-body_4.entry.js.map +1 -1
  441. package/dist/esm/p-modal.entry.js.map +1 -1
  442. package/dist/esm/p-navbar.entry.js.map +1 -1
  443. package/dist/esm/p-navigation-item.entry.js.map +1 -1
  444. package/dist/esm/p-page-size-select_3.entry.js.map +1 -1
  445. package/dist/esm/p-profile.entry.js.map +1 -1
  446. package/dist/esm/p-select.entry.js +136 -18
  447. package/dist/esm/p-select.entry.js.map +1 -1
  448. package/dist/esm/p-slider-indicator.entry.js.map +1 -1
  449. package/dist/esm/p-status.entry.js.map +1 -1
  450. package/dist/esm/p-stepper-item.entry.js.map +1 -1
  451. package/dist/esm/p-stepper-line.entry.js.map +1 -1
  452. package/dist/esm/p-stepper.entry.js.map +1 -1
  453. package/dist/esm/p-tab-group.entry.js.map +1 -1
  454. package/dist/esm/p-tab-item.entry.js.map +1 -1
  455. package/dist/esm/p-table-column.entry.js.map +1 -1
  456. package/dist/esm/p-table.entry.js.map +1 -1
  457. package/dist/esm/p-toast-container.entry.js.map +1 -1
  458. package/dist/esm/p-toast.entry.js.map +1 -1
  459. package/dist/esm/p-tooltip.entry.js.map +1 -1
  460. package/dist/esm/paperless.js +1 -1
  461. package/dist/index.html +1 -1
  462. package/dist/paperless/p-03090f03.entry.js.map +1 -1
  463. package/dist/paperless/p-085e6ff4.entry.js.map +1 -1
  464. package/dist/paperless/p-2becd73c.entry.js.map +1 -1
  465. package/dist/paperless/p-2cb55f24.entry.js.map +1 -1
  466. package/dist/paperless/p-2cd5062f.entry.js.map +1 -1
  467. package/dist/paperless/p-35c563a7.entry.js.map +1 -1
  468. package/dist/paperless/p-415c5040.entry.js.map +1 -1
  469. package/dist/paperless/p-424d5c8a.entry.js.map +1 -1
  470. package/dist/paperless/p-46a939e2.entry.js.map +1 -1
  471. package/dist/paperless/p-4c30c74b.entry.js.map +1 -1
  472. package/dist/paperless/p-4dc5647e.entry.js.map +1 -1
  473. package/dist/paperless/p-4e9e4ce2.entry.js.map +1 -1
  474. package/dist/paperless/p-606ad811.entry.js.map +1 -1
  475. package/dist/paperless/p-682db916.entry.js.map +1 -1
  476. package/dist/paperless/p-699e0b35.entry.js.map +1 -1
  477. package/dist/paperless/p-6a5aeb90.entry.js.map +1 -1
  478. package/dist/paperless/p-7793ba3a.entry.js.map +1 -1
  479. package/dist/paperless/p-7d15ff9a.entry.js.map +1 -1
  480. package/dist/paperless/p-8426ca20.entry.js.map +1 -1
  481. package/dist/paperless/p-93052b42.entry.js.map +1 -1
  482. package/dist/paperless/p-97bcf0b5.entry.js.map +1 -1
  483. package/dist/paperless/p-9c914665.entry.js.map +1 -1
  484. package/dist/paperless/p-9d3d72fa.entry.js.map +1 -1
  485. package/dist/paperless/p-a2b552f9.entry.js.map +1 -1
  486. package/dist/paperless/p-a7344d53.entry.js +2 -0
  487. package/dist/paperless/p-a7344d53.entry.js.map +1 -0
  488. package/dist/paperless/p-af6b813e.entry.js.map +1 -1
  489. package/dist/paperless/p-b6f43309.entry.js.map +1 -1
  490. package/dist/paperless/p-b7c0f157.entry.js.map +1 -1
  491. package/dist/paperless/p-c9b840a7.entry.js.map +1 -1
  492. package/dist/paperless/p-cb2674b5.entry.js.map +1 -1
  493. package/dist/paperless/p-cf7bd354.entry.js.map +1 -1
  494. package/dist/paperless/p-d0796984.entry.js.map +1 -1
  495. package/dist/paperless/p-d23db949.entry.js.map +1 -1
  496. package/dist/paperless/p-dace47c5.entry.js.map +1 -1
  497. package/dist/paperless/p-daeadc69.entry.js +2 -0
  498. package/dist/paperless/p-daeadc69.entry.js.map +1 -0
  499. package/dist/paperless/p-dd20caf1.entry.js.map +1 -1
  500. package/dist/paperless/p-dfa8eae9.entry.js +2 -0
  501. package/dist/paperless/p-dfa8eae9.entry.js.map +1 -0
  502. package/dist/paperless/p-ec15ee73.entry.js.map +1 -1
  503. package/dist/paperless/p-ec29eed0.entry.js.map +1 -1
  504. package/dist/paperless/p-f0f1a46b.entry.js.map +1 -1
  505. package/dist/paperless/p-f34e08ec.entry.js.map +1 -1
  506. package/dist/paperless/p-f9e52ae3.entry.js.map +1 -1
  507. package/dist/paperless/p-fac13366.entry.js.map +1 -1
  508. package/dist/paperless/paperless.css +7 -0
  509. package/dist/paperless/paperless.esm.js +1 -1
  510. package/dist/paperless/paperless.esm.js.map +1 -1
  511. package/dist/style/form/_checkbox.scss +4 -0
  512. package/dist/sw.js +1 -1
  513. package/dist/sw.js.map +1 -1
  514. package/dist/types/components/atoms/dropdown-menu-item/dropdown-menu-item.component.d.ts +4 -0
  515. package/dist/types/components/molecules/dropdown/dropdown.component.d.ts +4 -0
  516. package/dist/types/components/molecules/select/select.component.d.ts +34 -0
  517. package/dist/types/components.d.ts +105 -45
  518. package/dist/types/utils/icons.d.ts +1 -1
  519. package/hydrate/index.js +211 -75
  520. package/package.json +1 -1
  521. package/dist/assets/icons/fa/building.svg +0 -3
  522. package/dist/assets/icons/fa/buildings.svg +0 -3
  523. package/dist/build/p-573648d0.entry.js +0 -2
  524. package/dist/build/p-573648d0.entry.js.map +0 -1
  525. package/dist/build/p-9c7cfd25.entry.js +0 -2
  526. package/dist/build/p-9c7cfd25.entry.js.map +0 -1
  527. package/dist/build/p-c644d1e3.entry.js +0 -2
  528. package/dist/build/p-c644d1e3.entry.js.map +0 -1
  529. package/dist/collection/assets/icons/fa/building.svg +0 -3
  530. package/dist/collection/assets/icons/fa/buildings.svg +0 -3
  531. package/dist/paperless/p-573648d0.entry.js +0 -2
  532. package/dist/paperless/p-573648d0.entry.js.map +0 -1
  533. package/dist/paperless/p-9c7cfd25.entry.js +0 -2
  534. package/dist/paperless/p-9c7cfd25.entry.js.map +0 -1
  535. package/dist/paperless/p-c644d1e3.entry.js +0 -2
  536. package/dist/paperless/p-c644d1e3.entry.js.map +0 -1
@@ -3,6 +3,7 @@ import { childOf } from "../../../utils";
3
3
  export class Select {
4
4
  constructor() {
5
5
  this.items = undefined;
6
+ this.multi = undefined;
6
7
  this.icon = undefined;
7
8
  this.query = undefined;
8
9
  this.placeholder = undefined;
@@ -10,6 +11,8 @@ export class Select {
10
11
  this.value = undefined;
11
12
  this.displayKey = 'text';
12
13
  this.valueKey = undefined;
14
+ this.avatarKey = undefined;
15
+ this.avatarLettersKey = undefined;
13
16
  this.identifierKey = undefined;
14
17
  this.queryKey = undefined;
15
18
  this.autoSelectFirst = true;
@@ -26,9 +29,12 @@ export class Select {
26
29
  this.required = undefined;
27
30
  this.error = undefined;
28
31
  this.disabled = false;
32
+ this.showAddItem = false;
33
+ this.addItemText = 'Add item';
29
34
  this._showDropdown = false;
30
35
  this._selectedItem = null;
31
36
  this._isAutoCompleting = false;
37
+ this._amountHidden = 0;
32
38
  }
33
39
  get _items() {
34
40
  var _a, _b;
@@ -61,11 +67,14 @@ export class Select {
61
67
  return items === null || items === void 0 ? void 0 : items.slice(0, this.maxDisplayedItems);
62
68
  }
63
69
  get _displayValue() {
64
- var _a;
70
+ var _a, _b;
65
71
  if (this._isAutoCompleting) {
66
72
  return this.query;
67
73
  }
68
- return (_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a[this.displayKey];
74
+ if (this.multi) {
75
+ 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);
76
+ }
77
+ return (_b = this._selectedItem) === null || _b === void 0 ? void 0 : _b[this.displayKey];
69
78
  }
70
79
  get _placeholder() {
71
80
  var _a;
@@ -81,17 +90,46 @@ export class Select {
81
90
  if (!this.valueKey && !this.identifierKey) {
82
91
  throw new Error('You must provide a valueKey or identifierKey');
83
92
  }
93
+ if (this.multi) {
94
+ this.enableAutocomplete = false;
95
+ this._setMultiContainerMaxWidth();
96
+ this._resizeObserver = new ResizeObserver(() => {
97
+ if (this._resizeDebounceTimer) {
98
+ clearTimeout(this._resizeDebounceTimer);
99
+ this._resizeDebounceTimer = null;
100
+ }
101
+ this._resizeDebounceTimer = setTimeout(() => {
102
+ this._setMultiContainerMaxWidth();
103
+ this._checkSelectedItems();
104
+ }, 200);
105
+ });
106
+ this._resizeObserver.observe(this._el);
107
+ }
84
108
  if (this.value) {
85
109
  this._valueChange();
86
110
  return;
87
111
  }
88
112
  this.itemChanges();
89
113
  }
114
+ componentDidRender() {
115
+ if (this.multi) {
116
+ this._setMultiContainerMaxWidth();
117
+ this._checkSelectedItems();
118
+ }
119
+ }
120
+ disconnectedCallback() {
121
+ if (this.multi) {
122
+ this._resizeObserver.disconnect();
123
+ }
124
+ }
90
125
  render() {
126
+ var _a, _b;
91
127
  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 &&
92
- (!!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
128
+ (!!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)
129
+ ? ' '
130
+ : 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
93
131
  ? this._getLoadingItems()
94
- : this._getItems()))));
132
+ : 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)))));
95
133
  }
96
134
  documentClickHandler({ target }) {
97
135
  if (!this._showDropdown || childOf(target, this._el)) {
@@ -117,14 +155,28 @@ export class Select {
117
155
  if (this._isAutoCompleting && ((_a = this.query) === null || _a === void 0 ? void 0 : _a.length)) {
118
156
  return;
119
157
  }
120
- let value = this.value;
158
+ let value = typeof this.value === 'string' && this.multi
159
+ ? JSON.parse(this.value)
160
+ : this.value;
161
+ if (this.multi) {
162
+ if (!Array.isArray(value)) {
163
+ this.value = [];
164
+ this.valueChange.emit(this.value);
165
+ return;
166
+ }
167
+ this.value = value;
168
+ if (!value.length) {
169
+ return;
170
+ }
171
+ this._selectedItem =
172
+ !!this.valueKey && this.valueKey !== 'false'
173
+ ? this._items.filter((i) => value.includes(i === null || i === void 0 ? void 0 : i[this.valueKey]))
174
+ : [...value];
175
+ return;
176
+ }
121
177
  if (!this._selectedItem && !value && this.autoSelectFirst) {
122
178
  value = this._items[0];
123
179
  }
124
- // if (!value) {
125
- // this._selectValue(null);
126
- // return;
127
- // }
128
180
  const identifier = typeof value === 'object' && value !== null
129
181
  ? value[this._identifierKey]
130
182
  : value;
@@ -155,14 +207,40 @@ export class Select {
155
207
  this._selectValue(!!item ? item : value);
156
208
  }
157
209
  _selectValue(item) {
158
- this._selectedItem = item;
159
- const value = !!this.valueKey && this.valueKey !== 'false' && item !== null
210
+ let value = !!this.valueKey && this.valueKey !== 'false' && item !== null
160
211
  ? item === null || item === void 0 ? void 0 : item[this.valueKey]
161
212
  : item;
162
213
  this.query = this.keepQuery ? item === null || item === void 0 ? void 0 : item[this.displayKey] : null;
163
- this.value = value;
164
- this.valueChange.emit(value);
165
- this._onBlur(true);
214
+ if (this.multi) {
215
+ if (!this._selectedItem || !Array.isArray(this._selectedItem)) {
216
+ this._selectedItem = [];
217
+ }
218
+ if (!this.value || !Array.isArray(this.value)) {
219
+ this.value = [];
220
+ }
221
+ const selectedItem = [...this._selectedItem];
222
+ const valueArray = [...this.value];
223
+ const includesIndex = selectedItem.findIndex((i) => i[this._identifierKey] === item[this._identifierKey]);
224
+ if (includesIndex === -1) {
225
+ selectedItem.push(item);
226
+ valueArray.push(value);
227
+ }
228
+ else {
229
+ selectedItem.splice(includesIndex, 1);
230
+ valueArray.splice(includesIndex, 1);
231
+ }
232
+ this._selectedItem = selectedItem;
233
+ this.value = valueArray;
234
+ this.valueChange.emit(valueArray);
235
+ }
236
+ else {
237
+ this._selectedItem = item;
238
+ this.value = value;
239
+ this.valueChange.emit(value);
240
+ }
241
+ if (!this.multi) {
242
+ this._onBlur(true);
243
+ }
166
244
  }
167
245
  _onFocus(ev) {
168
246
  if (!this.enableAutocomplete) {
@@ -212,14 +290,53 @@ export class Select {
212
290
  }
213
291
  _getItems() {
214
292
  return this._items.map((item) => {
215
- var _a;
216
- return (h("p-dropdown-menu-item", { onClick: () => this._selectValue(item), active: item[this._identifierKey] ===
217
- ((_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a[this._identifierKey]) }, item[this.displayKey]));
293
+ var _a, _b;
294
+ return (h("p-dropdown-menu-item", { onClick: () => this._selectValue(item), active: this.multi
295
+ ? ((_a = this._selectedItem) === null || _a === void 0 ? void 0 : _a.findIndex((i) => i[this._identifierKey] ===
296
+ item[this._identifierKey])) >= 0
297
+ : item[this._identifierKey] ===
298
+ ((_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])));
218
299
  });
219
300
  }
301
+ _getAddItem() {
302
+ 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" }))));
303
+ }
220
304
  _getLoadingItems() {
221
305
  return [0, 0, 0].map(() => (h("p-dropdown-menu-item", { enableHover: false }, h("p-loader", { variant: "ghost", class: "h-6 w-full rounded" }))));
222
306
  }
307
+ _setMultiContainerMaxWidth() {
308
+ if (!this._inputRef || !this._multiContainerRef) {
309
+ return;
310
+ }
311
+ this._multiContainerRef.style.maxWidth = `${this._inputRef.clientWidth - 16}px`;
312
+ }
313
+ _checkSelectedItems() {
314
+ if (!this._multiContainerRef) {
315
+ return;
316
+ }
317
+ const containerRect = this._multiContainerRef.getBoundingClientRect();
318
+ const items = Array.from(this._multiContainerRef.querySelectorAll('.item'));
319
+ let amountHidden = 0;
320
+ for (const child of items) {
321
+ child.classList.remove('hidden');
322
+ const childRect = child.getBoundingClientRect();
323
+ if (childRect.right > containerRect.right) {
324
+ child.classList.add('hidden');
325
+ amountHidden++;
326
+ }
327
+ }
328
+ this._amountHidden = amountHidden;
329
+ const extra = this._multiContainerRef.querySelector('.extra');
330
+ if (!extra) {
331
+ return;
332
+ }
333
+ if (!extra.classList.contains('hidden')) {
334
+ extra.classList.add('hidden');
335
+ }
336
+ if (amountHidden > 0) {
337
+ extra.classList.remove('hidden');
338
+ }
339
+ }
223
340
  static get is() { return "p-select"; }
224
341
  static get originalStyleUrls() {
225
342
  return {
@@ -250,12 +367,29 @@ export class Select {
250
367
  "attribute": "items",
251
368
  "reflect": false
252
369
  },
370
+ "multi": {
371
+ "type": "boolean",
372
+ "mutable": false,
373
+ "complexType": {
374
+ "original": "boolean",
375
+ "resolved": "boolean",
376
+ "references": {}
377
+ },
378
+ "required": false,
379
+ "optional": false,
380
+ "docs": {
381
+ "tags": [],
382
+ "text": "Wether to enable multi select"
383
+ },
384
+ "attribute": "multi",
385
+ "reflect": true
386
+ },
253
387
  "icon": {
254
388
  "type": "string",
255
389
  "mutable": false,
256
390
  "complexType": {
257
391
  "original": "IconVariant",
258
- "resolved": "\"arrow\" | \"attachment\" | \"bread\" | \"calendar\" | \"camera\" | \"car\" | \"checklist\" | \"checkmark\" | \"chevron\" | \"chevrons\" | \"clock\" | \"colleagues\" | \"cogs\" | \"comment\" | \"companies\" | \"deactivate\" | \"document\" | \"download\" | \"envelope\" | \"explanation\" | \"eye\" | \"faBuilding\" | \"faPiggy\" | \"filter\" | \"folder\" | \"formula\" | \"grid\" | \"hashtag\" | \"headset\" | \"iDeal\" | \"integration\" | \"list\" | \"location\" | \"megaphone\" | \"menu\" | \"minus\" | \"more\" | \"negative\" | \"notification\" | \"pagination\" | \"payment\" | \"pencil\" | \"person\" | \"plan\" | \"plus\" | \"question\" | \"reload\" | \"receipt\" | \"report\" | \"search\" | \"settings\" | \"sick\" | \"signout\" | \"switch\" | \"tachometer\" | \"task\" | \"template\" | \"tool\" | \"trash\" | \"turn\" | \"upload\" | \"warning\"",
392
+ "resolved": "\"arrow\" | \"attachment\" | \"bread\" | \"calendar\" | \"camera\" | \"car\" | \"checklist\" | \"checkmark\" | \"chevron\" | \"chevrons\" | \"clock\" | \"colleagues\" | \"cogs\" | \"comment\" | \"companies\" | \"company\" | \"deactivate\" | \"document\" | \"download\" | \"envelope\" | \"explanation\" | \"eye\" | \"faPiggy\" | \"filter\" | \"folder\" | \"formula\" | \"grid\" | \"hashtag\" | \"headset\" | \"iDeal\" | \"integration\" | \"list\" | \"location\" | \"megaphone\" | \"menu\" | \"minus\" | \"more\" | \"negative\" | \"notification\" | \"pagination\" | \"payment\" | \"pencil\" | \"person\" | \"plan\" | \"plus\" | \"question\" | \"reload\" | \"receipt\" | \"report\" | \"search\" | \"settings\" | \"sick\" | \"signout\" | \"switch\" | \"tachometer\" | \"task\" | \"template\" | \"tool\" | \"trash\" | \"turn\" | \"upload\" | \"warning\"",
259
393
  "references": {
260
394
  "IconVariant": {
261
395
  "location": "import",
@@ -376,6 +510,40 @@ export class Select {
376
510
  "attribute": "value-key",
377
511
  "reflect": false
378
512
  },
513
+ "avatarKey": {
514
+ "type": "string",
515
+ "mutable": false,
516
+ "complexType": {
517
+ "original": "string",
518
+ "resolved": "string",
519
+ "references": {}
520
+ },
521
+ "required": false,
522
+ "optional": false,
523
+ "docs": {
524
+ "tags": [],
525
+ "text": "The key of avatar within an item to show"
526
+ },
527
+ "attribute": "avatar-key",
528
+ "reflect": false
529
+ },
530
+ "avatarLettersKey": {
531
+ "type": "string",
532
+ "mutable": false,
533
+ "complexType": {
534
+ "original": "string",
535
+ "resolved": "string",
536
+ "references": {}
537
+ },
538
+ "required": false,
539
+ "optional": false,
540
+ "docs": {
541
+ "tags": [],
542
+ "text": "The key of avatar letters within an item to show when the avatar url doesn't work"
543
+ },
544
+ "attribute": "avatar-letters-key",
545
+ "reflect": false
546
+ },
379
547
  "identifierKey": {
380
548
  "type": "string",
381
549
  "mutable": false,
@@ -656,6 +824,42 @@ export class Select {
656
824
  "attribute": "disabled",
657
825
  "reflect": true,
658
826
  "defaultValue": "false"
827
+ },
828
+ "showAddItem": {
829
+ "type": "boolean",
830
+ "mutable": false,
831
+ "complexType": {
832
+ "original": "boolean",
833
+ "resolved": "boolean",
834
+ "references": {}
835
+ },
836
+ "required": false,
837
+ "optional": false,
838
+ "docs": {
839
+ "tags": [],
840
+ "text": "Wether to show a \"add\" item"
841
+ },
842
+ "attribute": "show-add-item",
843
+ "reflect": false,
844
+ "defaultValue": "false"
845
+ },
846
+ "addItemText": {
847
+ "type": "string",
848
+ "mutable": false,
849
+ "complexType": {
850
+ "original": "string",
851
+ "resolved": "string",
852
+ "references": {}
853
+ },
854
+ "required": false,
855
+ "optional": false,
856
+ "docs": {
857
+ "tags": [],
858
+ "text": "The text to show when add item is being shown"
859
+ },
860
+ "attribute": "add-item-text",
861
+ "reflect": false,
862
+ "defaultValue": "'Add item'"
659
863
  }
660
864
  };
661
865
  }
@@ -663,7 +867,8 @@ export class Select {
663
867
  return {
664
868
  "_showDropdown": {},
665
869
  "_selectedItem": {},
666
- "_isAutoCompleting": {}
870
+ "_isAutoCompleting": {},
871
+ "_amountHidden": {}
667
872
  };
668
873
  }
669
874
  static get events() {
@@ -712,6 +917,21 @@ export class Select {
712
917
  "resolved": "any",
713
918
  "references": {}
714
919
  }
920
+ }, {
921
+ "method": "add",
922
+ "name": "add",
923
+ "bubbles": false,
924
+ "cancelable": true,
925
+ "composed": true,
926
+ "docs": {
927
+ "tags": [],
928
+ "text": "Event when the add item is clicked"
929
+ },
930
+ "complexType": {
931
+ "original": "any",
932
+ "resolved": "any",
933
+ "references": {}
934
+ }
715
935
  }];
716
936
  }
717
937
  static get elementRef() { return "_el"; }
@@ -1 +1 @@
1
- {"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/select.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAQzC,MAAM,OAAO,MAAM;;;;;;;;sBAkCc,MAAM;;;;2BAoBA,IAAI;uBAKR,IAAI;6BAKC,EAAE;8BAKA,IAAI;qBAKb,IAAI;uBAKF,KAAK;mBAKT,KAAK;gBA6BG,QAAQ;;;;;;oBA8BE,KAAK;yBAOZ,KAAK;yBACL,IAAI;6BAEI,KAAK;;EAEnD,IAAI,MAAM;;IACN,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE;MAC7B,OAAO,EAAE,CAAC;KACb;IAED,IAAI,KAAK,GACL,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;MAC1B,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["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"]}
1
+ {"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/select.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAQzC,MAAM,OAAO,MAAM;;;;;;;;;sBAuCW,MAAM;;;;;;2BA8BA,IAAI;uBAKR,IAAI;6BAKC,EAAE;8BA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AAG,CAAC,EAAE;MACrB,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KACjC;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/select/test/select.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EACtB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC5C,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;IAC5C,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAC/C,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAExC,0CAA0C;IAC1C,+BAA+B;IAC/B,wDAAwD;IAExD,wCAAwC;IACxC,+BAA+B;IAC/B,sDAAsD;IAEtD,yCAAyC;IACzC,+BAA+B;IAC/B,uDAAuD;EAC3D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('p-select', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n\n await page.setContent('<p-select></p-select>');\n const element = await page.find('p-select');\n expect(element).toHaveClass('hydrated');\n });\n\n it('renders changes to the content', async () => {\n const page = await newE2EPage();\n\n await page.setContent('<p-select></p-select>');\n // const component = await page.find('p-button');\n const element = await page.find('p-select');\n expect(element.textContent).toEqual(``);\n\n // component.setProperty('name', 'World');\n // await page.waitForChanges();\n // expect(element.textContent).toEqual(`Hello, World!`);\n\n // component.setProperty('name', 'Bob');\n // await page.waitForChanges();\n // expect(element.textContent).toEqual(`Hello, Bob!`);\n\n // component.setProperty('name', 'Earl');\n // await page.waitForChanges();\n // expect(element.textContent).toEqual(`Hello, Earl!`);\n });\n});\n"]}
1
+ {"version":3,"file":"select.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/select/test/select.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EACzB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EACzC,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;IAC/C,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAC/C,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAExC,0CAA0C;IAC1C,+BAA+B;IAC/B,wDAAwD;IAExD,wCAAwC;IACxC,+BAA+B;IAC/B,sDAAsD;IAEtD,yCAAyC;IACzC,+BAA+B;IAC/B,uDAAuD;EACxD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('p-select', () => {\n\tit('renders', async () => {\n\t\tconst page = await newE2EPage();\n\n\t\tawait page.setContent('<p-select></p-select>');\n\t\tconst element = await page.find('p-select');\n\t\texpect(element).toHaveClass('hydrated');\n\t});\n\n\tit('renders changes to the content', async () => {\n\t\tconst page = await newE2EPage();\n\n\t\tawait page.setContent('<p-select></p-select>');\n\t\t// const component = await page.find('p-button');\n\t\tconst element = await page.find('p-select');\n\t\texpect(element.textContent).toEqual(``);\n\n\t\t// component.setProperty('name', 'World');\n\t\t// await page.waitForChanges();\n\t\t// expect(element.textContent).toEqual(`Hello, World!`);\n\n\t\t// component.setProperty('name', 'Bob');\n\t\t// await page.waitForChanges();\n\t\t// expect(element.textContent).toEqual(`Hello, Bob!`);\n\n\t\t// component.setProperty('name', 'Earl');\n\t\t// await page.waitForChanges();\n\t\t// expect(element.textContent).toEqual(`Hello, Earl!`);\n\t});\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"select.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/select/test/select.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EACtB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAC/B,UAAU,EAAE,CAAC,MAAM,CAAC;MACpB,IAAI,EAAE,uBAAuB;KAChC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;KAK5B,CAAC,CAAC;EACH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { Select } from '../select.component';\n\ndescribe('p-select', () => {\n it('renders', async () => {\n const { root } = await newSpecPage({\n components: [Select],\n html: '<p-select></p-select>',\n });\n expect(root).toEqualHtml(`\n <p-select class=\"p-select\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-select>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"select.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/select/test/select.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EACzB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAClC,UAAU,EAAE,CAAC,MAAM,CAAC;MACpB,IAAI,EAAE,uBAAuB;KAC7B,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;KAKtB,CAAC,CAAC;EACN,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { Select } from '../select.component';\n\ndescribe('p-select', () => {\n\tit('renders', async () => {\n\t\tconst { root } = await newSpecPage({\n\t\t\tcomponents: [Select],\n\t\t\thtml: '<p-select></p-select>',\n\t\t});\n\t\texpect(root).toEqualHtml(`\n <p-select class=\"p-select\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-select>\n `);\n\t});\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/stepper/stepper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOzE,MAAM,OAAO,OAAO;;sBAIa,CAAC;qBAM1B,YAAY;2BAK4C,KAAK;;EAOjE,kDAAkD;EAElD,kBAAkB;IACd,IAAI,CAAC,cAAc,EAAE,CAAC;EAC1B,CAAC;EAED,MAAM;IACF,OAAO,CACH,EAAC,IAAI,IAAC,KAAK,EAAC,WAAW;MACnB,eAAQ,CACL,CACV,CAAC;EACN,CAAC;EAGO,cAAc;IAClB,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;MACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,IAAI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,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;UACvC,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,CAAC;UAErC,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,UAAU,EAAE;YACjD,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,UAAU,GAAG,EAAE,KAAK,CAAC;YACvD,WAAW,CAAC,KAAK,CAAC,YAAY,GAAG,IAC7B,UAAU,GAAG,EACjB,KAAK,CAAC;YACN,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,eAC1B,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,EACvB,MAAM,CAAC;WACV;UAED,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;UAE7C,SAAS;SACZ;OACJ;MAED,IAAI,CAAC,GAAG,CAAC,EAAE;QACP,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACjD,IAAI,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE;UACzD,YAAY,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;UACxC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC;SACtD;OACJ;KACJ;EACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["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"]}
1
+ {"version":3,"file":"stepper.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/stepper/stepper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,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AAS;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;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/stepper/test/stepper.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;EACvB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC5C,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;IAC5C,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACjD,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAExC,0CAA0C;IAC1C,+BAA+B;IAC/B,wDAAwD;IAExD,wCAAwC;IACxC,+BAA+B;IAC/B,sDAAsD;IAEtD,yCAAyC;IACzC,+BAA+B;IAC/B,uDAAuD;EAC3D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('p-stepper', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n\n await page.setContent('<p-stepper></p-stepper>');\n const element = await page.find('p-stepper');\n expect(element).toHaveClass('hydrated');\n });\n\n it('renders changes to the content', async () => {\n const page = await newE2EPage();\n\n await page.setContent('<p-stepper></p-stepper>');\n // const component = await page.find('p-button');\n const element = await page.find('p-stepper');\n expect(element.textContent).toEqual(``);\n\n // component.setProperty('name', 'World');\n // await page.waitForChanges();\n // expect(element.textContent).toEqual(`Hello, World!`);\n\n // component.setProperty('name', 'Bob');\n // await page.waitForChanges();\n // expect(element.textContent).toEqual(`Hello, Bob!`);\n\n // component.setProperty('name', 'Earl');\n // await page.waitForChanges();\n // expect(element.textContent).toEqual(`Hello, Earl!`);\n });\n});\n"]}
1
+ {"version":3,"file":"stepper.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/stepper/test/stepper.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;EAC1B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EACzC,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;IAC/C,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACjD,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAExC,0CAA0C;IAC1C,+BAA+B;IAC/B,wDAAwD;IAExD,wCAAwC;IACxC,+BAA+B;IAC/B,sDAAsD;IAEtD,yCAAyC;IACzC,+BAA+B;IAC/B,uDAAuD;EACxD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('p-stepper', () => {\n\tit('renders', async () => {\n\t\tconst page = await newE2EPage();\n\n\t\tawait page.setContent('<p-stepper></p-stepper>');\n\t\tconst element = await page.find('p-stepper');\n\t\texpect(element).toHaveClass('hydrated');\n\t});\n\n\tit('renders changes to the content', async () => {\n\t\tconst page = await newE2EPage();\n\n\t\tawait page.setContent('<p-stepper></p-stepper>');\n\t\t// const component = await page.find('p-button');\n\t\tconst element = await page.find('p-stepper');\n\t\texpect(element.textContent).toEqual(``);\n\n\t\t// component.setProperty('name', 'World');\n\t\t// await page.waitForChanges();\n\t\t// expect(element.textContent).toEqual(`Hello, World!`);\n\n\t\t// component.setProperty('name', 'Bob');\n\t\t// await page.waitForChanges();\n\t\t// expect(element.textContent).toEqual(`Hello, Bob!`);\n\n\t\t// component.setProperty('name', 'Earl');\n\t\t// await page.waitForChanges();\n\t\t// expect(element.textContent).toEqual(`Hello, Earl!`);\n\t});\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/stepper/test/stepper.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;EACvB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAC/B,UAAU,EAAE,CAAC,OAAO,CAAC;MACrB,IAAI,EAAE,yBAAyB;KAClC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;KAK5B,CAAC,CAAC;EACH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { Stepper } from '../stepper.component';\n\ndescribe('p-stepper', () => {\n it('renders', async () => {\n const { root } = await newSpecPage({\n components: [Stepper],\n html: '<p-stepper></p-stepper>',\n });\n expect(root).toEqualHtml(`\n <p-stepper class=\"p-stepper\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-stepper>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"stepper.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/stepper/test/stepper.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;EAC1B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAClC,UAAU,EAAE,CAAC,OAAO,CAAC;MACrB,IAAI,EAAE,yBAAyB;KAC/B,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;KAKtB,CAAC,CAAC;EACN,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { Stepper } from '../stepper.component';\n\ndescribe('p-stepper', () => {\n\tit('renders', async () => {\n\t\tconst { root } = await newSpecPage({\n\t\t\tcomponents: [Stepper],\n\t\t\thtml: '<p-stepper></p-stepper>',\n\t\t});\n\t\texpect(root).toEqualHtml(`\n <p-stepper class=\"p-stepper\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-stepper>\n `);\n\t});\n});\n"]}