@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
@@ -1 +1 @@
1
- {"version":3,"file":"content-slider.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/content-slider/content-slider.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GACR,MAAM,eAAe,CAAC;AAOvB,MAAM,OA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AC,CAAC,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;IACrE,IAAI,WAAW,IAAI,IAAI,CAAC,YAAY,EAAE;MAClC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;KACnC;EACL,CAAC;EAEO,SAAS,CAAC,EAAgB;IAC9B,IAAI,CAAC,EAAE,EAAE;MACL,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC1B;IAED,MAAM,MAAM,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC;IAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC;IAE3D,OAAO,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n h,\n Host,\n Listen,\n Prop,\n State,\n} from '@stencil/core';\n\n@Component({\n tag: 'p-content-slider',\n styleUrl: 'content-slider.component.scss',\n shadow: true,\n})\nexport class ContentSlider {\n /**\n * Wether to hide the indicator on mobile\n */\n @Prop() hideMobileIndicator: boolean = false;\n\n /**\n * Wether to disable dragging the content\n */\n @Prop() disableDrag: boolean = false;\n\n /**\n * Wether to disable auto centering the content\n */\n @Prop() disableAutoCenter: boolean = false;\n\n /**\n * Wether to disable clicking the indicator scrolls content\n */\n @Prop() disableIndicatorClick: boolean = false;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n @State() private _visibleIndex: number;\n @State() private _outerHeight = 0;\n @State() private _totalWidth = 0;\n private _sliderRef: HTMLElement;\n private _innerSliderRef: HTMLElement;\n private _items: HTMLElement[] = [];\n private _innerSliderResizeObserver: ResizeObserver;\n\n // mouse movement stuff\n private _startX: number;\n private _startMouseX: number;\n private _lastMouseX: number;\n private _lastIndex: number;\n private _shouldCheckLocation = false;\n @State() private _dragging = false;\n\n componentWillRender() {\n const items = this._el.querySelectorAll(':scope > *');\n this._items = Array.from(items) as HTMLElement[];\n }\n\n componentDidLoad() {\n this._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n this._calculateWidth();\n this._calculateIndicator();\n }\n\n disconnectedCallback() {\n if (this._innerSliderResizeObserver) {\n this._innerSliderResizeObserver.disconnect();\n }\n }\n\n render() {\n return (\n <Host class=\"p-content-slider\">\n <div\n class={`slider ${!this.disableDrag && 'draggable'} ${\n this._dragging && 'dragging'\n }`}\n style={{\n height: `${this._outerHeight}px`,\n }}\n ref={(el) => (this._sliderRef = el)}\n onMouseDown={(e) => this._mouseDownHandler(e)}\n onTouchStart={(e) => this._mouseDownHandler(e)}\n onMouseMove={(e) => this._mouseMoveHandler(e)}\n onTouchMove={(e) => this._mouseMoveHandler(e)}\n >\n <div\n class=\"inner-slider\"\n ref={(ref) => this._setInnerSliderReft(ref)}\n onTransitionEnd={() => this._transitionEndHandler()}\n >\n <slot />\n </div>\n </div>\n <div\n class={`indicator ${this.hideMobileIndicator && 'hidden'}`}\n >\n {this._items.map((_, i) => (\n <div\n onClick={() => this._scrollTo(i, true)}\n class={`item ${\n !this.disableIndicatorClick && 'cursor-pointer'\n }`}\n >\n <p-slider-indicator\n active={i === this._visibleIndex}\n />\n </div>\n ))}\n </div>\n </Host>\n );\n }\n\n private _mouseDownHandler(e) {\n if (this.disableDrag || this._dragging) {\n return;\n }\n\n const innerSliderStyle = getComputedStyle(this._innerSliderRef);\n if (innerSliderStyle.flexWrap === 'wrap') {\n return;\n }\n\n this._startMouseX = e.x;\n const sliderRect = this._sliderRef.getBoundingClientRect();\n if (e.type === 'touchstart') {\n this._startMouseX = e.touches?.[0].clientX;\n }\n\n const innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n const offsetLeft = innerSliderRect.x - sliderRect.x;\n\n this._startX = this._startMouseX - sliderRect.x - offsetLeft;\n this._lastIndex = this._visibleIndex;\n this._dragging = true;\n }\n\n private _mouseMoveHandler(e) {\n if (!e || !this._dragging || this.disableDrag) {\n return;\n }\n\n e.preventDefault();\n\n this._shouldCheckLocation = true;\n\n if (\n this._innerSliderRef.style.getPropertyValue('pointer-events') === ''\n ) {\n this._innerSliderRef.style.pointerEvents = 'none';\n }\n\n const sliderRect = this._sliderRef.getBoundingClientRect();\n let x = e.clientX - sliderRect.left;\n this._lastMouseX = e.x;\n if (e.type === 'touchmove') {\n x = e.touches?.[0].clientX - sliderRect.left;\n this._lastMouseX = e.touches?.[0].clientX;\n }\n\n this._innerSliderRef.style.setProperty(\n '--tw-translate-x',\n `${x - this._startX}px`\n );\n\n this._checkBoundary();\n this._calculateIndicator();\n }\n\n private _transitionEndHandler() {\n this._calculateIndicator();\n }\n\n @Listen('mouseup', { target: 'window' })\n @Listen('touchend', { target: 'window' })\n mouseUpHandler() {\n this._dragging = false;\n this._innerSliderRef.style.removeProperty('pointer-events');\n\n this._checkLocation();\n }\n\n @Listen('resize', { target: 'window' })\n resizeHandler() {\n if (this._innerSliderRef) {\n this._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n this._calculateWidth();\n this._calculateIndicator();\n }\n }\n\n private _setInnerSliderReft(ref) {\n this._innerSliderRef = ref;\n this._innerSliderResizeObserver = new ResizeObserver(() =>\n this._calculateHeight()\n );\n this._innerSliderResizeObserver.observe(this._innerSliderRef);\n }\n\n private _scrollTo(i: number, manual = false) {\n if (this.disableIndicatorClick && manual) {\n return;\n }\n\n const el = this._items[i];\n\n if (i === 0) {\n this._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n return;\n }\n\n const sliderRect = this._sliderRef.getBoundingClientRect();\n const innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n const elRect = el.getBoundingClientRect();\n\n const offsetLeft = elRect.x - innerSliderRect.x;\n\n const centerOffset =\n offsetLeft + elRect.width / 2 - sliderRect.width / 2;\n\n this._innerSliderRef.style.setProperty(\n '--tw-translate-x',\n `-${centerOffset}px`\n );\n\n this._checkBoundary();\n this._calculateIndicator();\n }\n\n private _checkBoundary() {\n let outer = this._sliderRef.getBoundingClientRect();\n\n const left = parseInt(\n this._innerSliderRef.style.getPropertyValue('--tw-translate-x')\n );\n if (left > 0) {\n this._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n }\n\n const maxLeft = (this._totalWidth - outer.width) * -1;\n if (left < maxLeft) {\n this._innerSliderRef.style.setProperty(\n '--tw-translate-x',\n `${maxLeft}px`\n );\n }\n }\n\n private _calculateIndicator() {\n for (let i = 0; i < this._items.length; i++) {\n const item = this._items[i];\n const visible = this._isVisible(item);\n\n if (visible) {\n this._visibleIndex = i;\n }\n\n if (i === 0 && visible) {\n break;\n }\n }\n }\n\n private _checkLocation() {\n if (!this._shouldCheckLocation) {\n return;\n }\n\n let scrollToIndex = null;\n if (this._lastIndex !== this._visibleIndex) {\n scrollToIndex = this._visibleIndex;\n }\n\n if (this._lastIndex === this._visibleIndex) {\n if (this._lastMouseX > this._startMouseX && this._lastIndex !== 0) {\n scrollToIndex = this._lastIndex - 1;\n }\n\n if (\n this._lastMouseX < this._startMouseX &&\n this._lastIndex !== this._items?.length - 1\n ) {\n scrollToIndex = this._lastIndex + 1;\n }\n }\n\n if (scrollToIndex !== null) {\n this._shouldCheckLocation = false;\n setTimeout(() => this._scrollTo(scrollToIndex), 100);\n }\n }\n\n private _isVisible(el: HTMLElement) {\n if (!this._el || !el) {\n return false;\n }\n\n const elRect = el.getBoundingClientRect();\n const sliderRect = this._sliderRef.getBoundingClientRect();\n\n return (\n (elRect.left >= sliderRect.left &&\n elRect.right <= sliderRect.right) ||\n (this._isMobile(el) &&\n elRect.left + elRect.width / 2 >= sliderRect.left &&\n elRect.left + elRect.width / 2 <= sliderRect.right)\n );\n }\n\n private _calculateWidth() {\n let totalWidth = 0;\n\n for (let item of this._items) {\n const rect = item.getBoundingClientRect();\n totalWidth += rect.width;\n }\n\n const sliderStyle = getComputedStyle(this._sliderRef);\n const padding = parseInt(sliderStyle.padding) * 2;\n\n const innerSliderStyle = getComputedStyle(this._innerSliderRef);\n const gap = parseInt(innerSliderStyle.gap) * (this._items.length - 1);\n\n totalWidth += padding + gap;\n\n this._totalWidth = totalWidth;\n }\n\n private _calculateHeight() {\n const outerHeight = this._items.at(0).getBoundingClientRect().height;\n if (outerHeight != this._outerHeight) {\n this._outerHeight = outerHeight;\n }\n }\n\n private _isMobile(el?: HTMLElement) {\n if (!el) {\n el = this._items.at(0);\n }\n\n const elRect = el.getBoundingClientRect();\n const sliderRect = this._sliderRef.getBoundingClientRect();\n\n return sliderRect.width - elRect.width < 10;\n }\n}\n"]}
1
+ {"version":3,"file":"content-slider.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/content-slider/content-slider.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AAOvB,MAAM,OAAO,aAAa;;IA+BjB,WAAM,GAAkB,EAAE,CAAC;IAQ3B,yBAAoB,GAAG,KAAK,CAAC;+BAnCE,KAAK;uBAKb,KAAK;6BAKC,KAAK;iCAKD,KAAK;;wBAQd,CAAC;uBACF,CAAC;qBAYH,KAAK;;EAElC,mBAAmB;IAClB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACtD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAkB,CAAC;EAClD,CAAC;EAED,gBAAgB;IACf,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAClE,IAAI,CAAC,eAAe,EAAE,CAAC;IACvB,IAAI,CAAC,mBAAmB,EAAE,CAAC;EAC5B,CAAC;EAED,oBAAoB;IACnB,IAAI,IAAI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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tComponent,\n\tElement,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\n\n@Component({\n\ttag: 'p-content-slider',\n\tstyleUrl: 'content-slider.component.scss',\n\tshadow: true,\n})\nexport class ContentSlider {\n\t/**\n\t * Wether to hide the indicator on mobile\n\t */\n\t@Prop() hideMobileIndicator: boolean = false;\n\n\t/**\n\t * Wether to disable dragging the content\n\t */\n\t@Prop() disableDrag: boolean = false;\n\n\t/**\n\t * Wether to disable auto centering the content\n\t */\n\t@Prop() disableAutoCenter: boolean = false;\n\n\t/**\n\t * Wether to disable clicking the indicator scrolls content\n\t */\n\t@Prop() disableIndicatorClick: boolean = false;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _visibleIndex: number;\n\t@State() private _outerHeight = 0;\n\t@State() private _totalWidth = 0;\n\tprivate _sliderRef: HTMLElement;\n\tprivate _innerSliderRef: HTMLElement;\n\tprivate _items: HTMLElement[] = [];\n\tprivate _innerSliderResizeObserver: ResizeObserver;\n\n\t// mouse movement stuff\n\tprivate _startX: number;\n\tprivate _startMouseX: number;\n\tprivate _lastMouseX: number;\n\tprivate _lastIndex: number;\n\tprivate _shouldCheckLocation = false;\n\t@State() private _dragging = false;\n\n\tcomponentWillRender() {\n\t\tconst items = this._el.querySelectorAll(':scope > *');\n\t\tthis._items = Array.from(items) as HTMLElement[];\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\tthis._calculateWidth();\n\t\tthis._calculateIndicator();\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._innerSliderResizeObserver) {\n\t\t\tthis._innerSliderResizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-content-slider\">\n\t\t\t\t<div\n\t\t\t\t\tclass={`slider ${!this.disableDrag && 'draggable'} ${\n\t\t\t\t\t\tthis._dragging && 'dragging'\n\t\t\t\t\t}`}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\theight: `${this._outerHeight}px`,\n\t\t\t\t\t}}\n\t\t\t\t\tref={(el) => (this._sliderRef = el)}\n\t\t\t\t\tonMouseDown={(e) => this._mouseDownHandler(e)}\n\t\t\t\t\tonTouchStart={(e) => this._mouseDownHandler(e)}\n\t\t\t\t\tonMouseMove={(e) => this._mouseMoveHandler(e)}\n\t\t\t\t\tonTouchMove={(e) => this._mouseMoveHandler(e)}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"inner-slider\"\n\t\t\t\t\t\tref={(ref) => this._setInnerSliderReft(ref)}\n\t\t\t\t\t\tonTransitionEnd={() => this._transitionEndHandler()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclass={`indicator ${this.hideMobileIndicator && 'hidden'}`}\n\t\t\t\t>\n\t\t\t\t\t{this._items.map((_, i) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tonClick={() => this._scrollTo(i, true)}\n\t\t\t\t\t\t\tclass={`item ${\n\t\t\t\t\t\t\t\t!this.disableIndicatorClick && 'cursor-pointer'\n\t\t\t\t\t\t\t}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<p-slider-indicator\n\t\t\t\t\t\t\t\tactive={i === this._visibleIndex}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _mouseDownHandler(e) {\n\t\tif (this.disableDrag || this._dragging) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tif (innerSliderStyle.flexWrap === 'wrap') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startMouseX = e.x;\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tif (e.type === 'touchstart') {\n\t\t\tthis._startMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst offsetLeft = innerSliderRect.x - sliderRect.x;\n\n\t\tthis._startX = this._startMouseX - sliderRect.x - offsetLeft;\n\t\tthis._lastIndex = this._visibleIndex;\n\t\tthis._dragging = true;\n\t}\n\n\tprivate _mouseMoveHandler(e) {\n\t\tif (!e || !this._dragging || this.disableDrag) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tthis._shouldCheckLocation = true;\n\n\t\tif (\n\t\t\tthis._innerSliderRef.style.getPropertyValue('pointer-events') === ''\n\t\t) {\n\t\t\tthis._innerSliderRef.style.pointerEvents = 'none';\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tlet x = e.clientX - sliderRect.left;\n\t\tthis._lastMouseX = e.x;\n\t\tif (e.type === 'touchmove') {\n\t\t\tx = e.touches?.[0].clientX - sliderRect.left;\n\t\t\tthis._lastMouseX = e.touches?.[0].clientX;\n\t\t}\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`${x - this._startX}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _transitionEndHandler() {\n\t\tthis._calculateIndicator();\n\t}\n\n\t@Listen('mouseup', { target: 'window' })\n\t@Listen('touchend', { target: 'window' })\n\tmouseUpHandler() {\n\t\tthis._dragging = false;\n\t\tthis._innerSliderRef.style.removeProperty('pointer-events');\n\n\t\tthis._checkLocation();\n\t}\n\n\t@Listen('resize', { target: 'window' })\n\tresizeHandler() {\n\t\tif (this._innerSliderRef) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', '0px');\n\t\t\tthis._calculateWidth();\n\t\t\tthis._calculateIndicator();\n\t\t}\n\t}\n\n\tprivate _setInnerSliderReft(ref) {\n\t\tthis._innerSliderRef = ref;\n\t\tthis._innerSliderResizeObserver = new ResizeObserver(() =>\n\t\t\tthis._calculateHeight()\n\t\t);\n\t\tthis._innerSliderResizeObserver.observe(this._innerSliderRef);\n\t}\n\n\tprivate _scrollTo(i: number, manual = false) {\n\t\tif (this.disableIndicatorClick && manual) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst el = this._items[i];\n\n\t\tif (i === 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\t\tconst innerSliderRect = this._innerSliderRef.getBoundingClientRect();\n\t\tconst elRect = el.getBoundingClientRect();\n\n\t\tconst offsetLeft = elRect.x - innerSliderRect.x;\n\n\t\tconst centerOffset =\n\t\t\toffsetLeft + elRect.width / 2 - sliderRect.width / 2;\n\n\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t'--tw-translate-x',\n\t\t\t`-${centerOffset}px`\n\t\t);\n\n\t\tthis._checkBoundary();\n\t\tthis._calculateIndicator();\n\t}\n\n\tprivate _checkBoundary() {\n\t\tlet outer = this._sliderRef.getBoundingClientRect();\n\n\t\tconst left = parseInt(\n\t\t\tthis._innerSliderRef.style.getPropertyValue('--tw-translate-x')\n\t\t);\n\t\tif (left > 0) {\n\t\t\tthis._innerSliderRef.style.setProperty('--tw-translate-x', `0px`);\n\t\t}\n\n\t\tconst maxLeft = (this._totalWidth - outer.width) * -1;\n\t\tif (left < maxLeft) {\n\t\t\tthis._innerSliderRef.style.setProperty(\n\t\t\t\t'--tw-translate-x',\n\t\t\t\t`${maxLeft}px`\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _calculateIndicator() {\n\t\tfor (let i = 0; i < this._items.length; i++) {\n\t\t\tconst item = this._items[i];\n\t\t\tconst visible = this._isVisible(item);\n\n\t\t\tif (visible) {\n\t\t\t\tthis._visibleIndex = i;\n\t\t\t}\n\n\t\t\tif (i === 0 && visible) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _checkLocation() {\n\t\tif (!this._shouldCheckLocation) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet scrollToIndex = null;\n\t\tif (this._lastIndex !== this._visibleIndex) {\n\t\t\tscrollToIndex = this._visibleIndex;\n\t\t}\n\n\t\tif (this._lastIndex === this._visibleIndex) {\n\t\t\tif (this._lastMouseX > this._startMouseX && this._lastIndex !== 0) {\n\t\t\t\tscrollToIndex = this._lastIndex - 1;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tthis._lastMouseX < this._startMouseX &&\n\t\t\t\tthis._lastIndex !== this._items?.length - 1\n\t\t\t) {\n\t\t\t\tscrollToIndex = this._lastIndex + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (scrollToIndex !== null) {\n\t\t\tthis._shouldCheckLocation = false;\n\t\t\tsetTimeout(() => this._scrollTo(scrollToIndex), 100);\n\t\t}\n\t}\n\n\tprivate _isVisible(el: HTMLElement) {\n\t\tif (!this._el || !el) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn (\n\t\t\t(elRect.left >= sliderRect.left &&\n\t\t\t\telRect.right <= sliderRect.right) ||\n\t\t\t(this._isMobile(el) &&\n\t\t\t\telRect.left + elRect.width / 2 >= sliderRect.left &&\n\t\t\t\telRect.left + elRect.width / 2 <= sliderRect.right)\n\t\t);\n\t}\n\n\tprivate _calculateWidth() {\n\t\tlet totalWidth = 0;\n\n\t\tfor (let item of this._items) {\n\t\t\tconst rect = item.getBoundingClientRect();\n\t\t\ttotalWidth += rect.width;\n\t\t}\n\n\t\tconst sliderStyle = getComputedStyle(this._sliderRef);\n\t\tconst padding = parseInt(sliderStyle.padding) * 2;\n\n\t\tconst innerSliderStyle = getComputedStyle(this._innerSliderRef);\n\t\tconst gap = parseInt(innerSliderStyle.gap) * (this._items.length - 1);\n\n\t\ttotalWidth += padding + gap;\n\n\t\tthis._totalWidth = totalWidth;\n\t}\n\n\tprivate _calculateHeight() {\n\t\tconst outerHeight = this._items.at(0).getBoundingClientRect().height;\n\t\tif (outerHeight != this._outerHeight) {\n\t\t\tthis._outerHeight = outerHeight;\n\t\t}\n\t}\n\n\tprivate _isMobile(el?: HTMLElement) {\n\t\tif (!el) {\n\t\t\tel = this._items.at(0);\n\t\t}\n\n\t\tconst elRect = el.getBoundingClientRect();\n\t\tconst sliderRect = this._sliderRef.getBoundingClientRect();\n\n\t\treturn sliderRect.width - elRect.width < 10;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"content-slider.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/content-slider/test/content-slider.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;EAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,uCAAuC,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACpD,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,uCAAuC,CAAC,CAAC;IAC/D,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACpD,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-content-slider', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n\n await page.setContent('<p-content-slider></p-content-slider>');\n const element = await page.find('p-content-slider');\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-content-slider></p-content-slider>');\n // const component = await page.find('p-button');\n const element = await page.find('p-content-slider');\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":"content-slider.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/content-slider/test/content-slider.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;EACjC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,uCAAuC,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACpD,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,uCAAuC,CAAC,CAAC;IAC/D,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACpD,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-content-slider', () => {\n\tit('renders', async () => {\n\t\tconst page = await newE2EPage();\n\n\t\tawait page.setContent('<p-content-slider></p-content-slider>');\n\t\tconst element = await page.find('p-content-slider');\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-content-slider></p-content-slider>');\n\t\t// const component = await page.find('p-button');\n\t\tconst element = await page.find('p-content-slider');\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":"content-slider.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/content-slider/test/content-slider.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;EAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAC/B,UAAU,EAAE,CAAC,aAAa,CAAC;MAC3B,IAAI,EAAE,uCAAuC;KAChD,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 { ContentSlider } from '../content-slider.component';\n\ndescribe('p-content-slider', () => {\n it('renders', async () => {\n const { root } = await newSpecPage({\n components: [ContentSlider],\n html: '<p-content-slider></p-content-slider>',\n });\n expect(root).toEqualHtml(`\n <p-content-slider class=\"p-content-slider\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-content-slider>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"content-slider.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/content-slider/test/content-slider.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;EACjC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAClC,UAAU,EAAE,CAAC,aAAa,CAAC;MAC3B,IAAI,EAAE,uCAAuC;KAC7C,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 { ContentSlider } from '../content-slider.component';\n\ndescribe('p-content-slider', () => {\n\tit('renders', async () => {\n\t\tconst { root } = await newSpecPage({\n\t\t\tcomponents: [ContentSlider],\n\t\t\thtml: '<p-content-slider></p-content-slider>',\n\t\t});\n\t\texpect(root).toEqualHtml(`\n <p-content-slider class=\"p-content-slider\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-content-slider>\n `);\n\t});\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cropper.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/cropper/cropper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,GACJ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,WAAW,CAAC;AAQnB,MAAM,OAAO,OAAO;;IA2BR,cAAS,GAAG,CAAC,CAAC;IACd,cAAS,GAAG,CAAC,CAAC;mBAxBiC,MAAM;;sBAUnB,QAAQ;mBAoBhC,KAAK;yBAGC,CAAC;;EAGzB,QAAQ;IACJ,IAAI,IAAI,CAAC,sBAAsB,EAAE;MAC7B,YAAY,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;KAC7C;IAED,IAAI,CAAC,sBAAsB,GAAG,UAAU,CAAC,GAAG,EAAE;MAC1C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;MAC7B,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC,EAAE,GAAG,CAAC,CAAC;EACZ,CAAC;EAED,gBAAgB;IACZ,UAAU,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n h,\n} from '@stencil/core';\nimport { clsx } from 'clsx';\nimport 'cropperjs';\nimport { CropperImage, CropperSelection } from 'cropperjs';\n\n@Component({\n tag: 'p-cropper',\n styleUrl: 'cropper.component.scss',\n shadow: true,\n})\nexport class Cropper {\n /**\n * Variant of the image that's being cropped\n */\n @Prop({ reflect: true }) variant: 'user' | 'company' = 'user';\n\n /**\n * The image to crop (url or base64)\n */\n @Prop() value: any;\n\n /**\n * The return type of the onchange\n */\n @Prop() returnType: 'canvas' | 'base64' = 'base64';\n\n /**\n * Event when the value changes\n */\n @Event({\n bubbles: false,\n })\n valueChange: EventEmitter<any>;\n\n private _imageRef: CropperImage;\n private _selectionRef: CropperSelection;\n\n private _maxScale = 0;\n private _minScale = 0;\n\n private _resizeDebounceTimeout: NodeJS.Timer;\n private _toCanvasDebounceTimeout: NodeJS.Timer;\n\n @State()\n private _loaded = false;\n\n @State()\n private _currentScale = 0;\n\n @Listen('resize', { target: 'window' })\n onResize() {\n if (this._resizeDebounceTimeout) {\n clearTimeout(this._resizeDebounceTimeout);\n }\n\n this._resizeDebounceTimeout = setTimeout(() => {\n this._selectionRef.$center();\n this._imageRef.$center();\n }, 200);\n }\n\n componentDidLoad() {\n setTimeout(() => {\n this._loaded = true;\n }, 200);\n }\n\n render() {\n return (\n <Host class=\"p-cropper\">\n {this._loaded && (\n <cropper-canvas\n class=\"h-[17.5rem] w-full border-0 border-b border-solid border-mystic-medium bg-white\"\n onAction={() => this._onAction()}\n >\n <cropper-image\n src={this.value}\n alt=\"Picture\"\n ref={(ref) =>\n this._setImageRef(ref as CropperImage)\n }\n scalable\n crossorigin=\"anonymous\"\n />\n <cropper-shade\n class={clsx({\n 'rounded-round': this.variant === 'user',\n rounded: this.variant === 'company',\n })}\n theme-color=\"rgba(255, 255, 255, 0.5)\"\n hidden\n />\n <cropper-selection\n initial-coverage=\"0.7\"\n aspect-ratio=\"1\"\n ref={(ref) =>\n (this._selectionRef = ref as CropperSelection)\n }\n />\n\n <cropper-handle action=\"move\" plain></cropper-handle>\n </cropper-canvas>\n )}\n\n <div class=\"flex w-full items-center gap-2 px-14 text-storm-vague tablet:max-w-xs tablet:px-1\">\n <p-icon variant=\"minus\" />\n <input\n class=\"p-input w-full\"\n type=\"range\"\n min=\"0\"\n max=\"100\"\n value={this._currentScale}\n onInput={(ev) =>\n this._onInput((ev.target as HTMLInputElement).value)\n }\n step=\"0.5\"\n />\n <p-icon variant=\"plus\" />\n </div>\n </Host>\n );\n }\n\n private _setImageRef(ref: CropperImage) {\n if (this._imageRef) {\n return;\n }\n\n this._imageRef = ref;\n this._imageRef.$ready((image) =>\n setTimeout(() => this._setInitialState(image), 200)\n );\n }\n\n private _setInitialState(image) {\n let scale: number;\n if (image.naturalWidth > image.naturalHeight) {\n // set scale by height\n scale = 200 / image.naturalHeight;\n }\n\n if (image.naturalHeight >= image.naturalWidth) {\n // set scale by width\n scale = 200 / image.naturalWidth;\n }\n\n const current = this._imageRef.$getTransform();\n\n this._minScale = scale;\n this._maxScale = current[0];\n\n this._selectionRef.$resize('nw-resize', 200, 200, 1);\n this._selectionRef.$center();\n\n this._setScale(scale);\n this._toCanvas();\n }\n\n private _onAction() {\n this._setCurrentScale();\n this._toCanvas();\n }\n\n private _setScale(\n scale: number,\n setCenter: boolean = true,\n setCurrentScale: boolean = true\n ) {\n const transform = this._imageRef.$getTransform();\n this._imageRef.$setTransform([\n scale,\n 0,\n 0,\n scale,\n transform[4],\n transform[5],\n ]);\n\n if (setCenter) {\n this._imageRef.$center();\n }\n\n if (setCurrentScale) {\n this._setCurrentScale();\n }\n }\n\n private _setCurrentScale() {\n const transform = this._imageRef.$getTransform();\n const current = transform[0];\n\n if (current < this._minScale) {\n this._setScale(this._minScale, true, false);\n this._currentScale = 0;\n return;\n }\n\n if (current > this._maxScale) {\n this._setScale(this._maxScale, true, false);\n this._currentScale = 100;\n return;\n }\n\n if (current === this._minScale) {\n this._currentScale = 0;\n return;\n }\n\n if (current === this._maxScale) {\n this._currentScale = 100;\n return;\n }\n\n const minMaxDiff = this._maxScale - this._minScale;\n const currentDiff = current - this._minScale;\n\n const percentage = (currentDiff / minMaxDiff) * 100;\n this._currentScale = percentage;\n }\n\n private _onInput(value) {\n const transform = this._imageRef.$getTransform();\n const current = transform[0];\n const minMaxDiff = this._maxScale - this._minScale;\n\n const toSet = minMaxDiff * (value / 100);\n\n if (toSet === current) {\n return;\n }\n\n this._setScale(toSet + this._minScale, false, false);\n this._currentScale = value;\n\n this._toCanvas();\n }\n\n private _toCanvas() {\n if (this._toCanvasDebounceTimeout) {\n clearTimeout(this._toCanvasDebounceTimeout);\n }\n\n this._toCanvasDebounceTimeout = setTimeout(async () => {\n const canvas = await this._selectionRef.$toCanvas();\n if (this.returnType === 'canvas') {\n this.valueChange.emit(canvas);\n return;\n }\n\n const data = canvas.toDataURL('image/png');\n this.valueChange.emit(data);\n }, 200);\n }\n}\n"]}
1
+ {"version":3,"file":"cropper.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/cropper/cropper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,WAAW,CAAC;AAQnB,MAAM,OAAO,OAAO;;IA2BX,cAAS,GAAG,CAAC,CAAC;IACd,cAAS,GAAG,CAAC,CAAC;mBAxBiC,MAAM;;sBAUnB,QAAQ;mBAoBhC,KAAK;yBAGC,CAAC;;EAGzB,QAAQ;IACP,IAAI,IAAI,CAAC,sBAAsB,EAAE;MAChC,YAAY,CAAC,IAAI,CAAC,sB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IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,OAAO;OACP;MAED,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;MAC3C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,EAAE,GAAG,CAAC,CAAC;EACT,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n\th,\n} from '@stencil/core';\nimport { clsx } from 'clsx';\nimport 'cropperjs';\nimport { CropperImage, CropperSelection } from 'cropperjs';\n\n@Component({\n\ttag: 'p-cropper',\n\tstyleUrl: 'cropper.component.scss',\n\tshadow: true,\n})\nexport class Cropper {\n\t/**\n\t * Variant of the image that's being cropped\n\t */\n\t@Prop({ reflect: true }) variant: 'user' | 'company' = 'user';\n\n\t/**\n\t * The image to crop (url or base64)\n\t */\n\t@Prop() value: any;\n\n\t/**\n\t * The return type of the onchange\n\t */\n\t@Prop() returnType: 'canvas' | 'base64' = 'base64';\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\tprivate _imageRef: CropperImage;\n\tprivate _selectionRef: CropperSelection;\n\n\tprivate _maxScale = 0;\n\tprivate _minScale = 0;\n\n\tprivate _resizeDebounceTimeout: NodeJS.Timer;\n\tprivate _toCanvasDebounceTimeout: NodeJS.Timer;\n\n\t@State()\n\tprivate _loaded = false;\n\n\t@State()\n\tprivate _currentScale = 0;\n\n\t@Listen('resize', { target: 'window' })\n\tonResize() {\n\t\tif (this._resizeDebounceTimeout) {\n\t\t\tclearTimeout(this._resizeDebounceTimeout);\n\t\t}\n\n\t\tthis._resizeDebounceTimeout = setTimeout(() => {\n\t\t\tthis._selectionRef.$center();\n\t\t\tthis._imageRef.$center();\n\t\t}, 200);\n\t}\n\n\tcomponentDidLoad() {\n\t\tsetTimeout(() => {\n\t\t\tthis._loaded = true;\n\t\t}, 200);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-cropper\">\n\t\t\t\t{this._loaded && (\n\t\t\t\t\t<cropper-canvas\n\t\t\t\t\t\tclass=\"h-[17.5rem] w-full border-0 border-b border-solid border-mystic-medium bg-white\"\n\t\t\t\t\t\tonAction={() => this._onAction()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<cropper-image\n\t\t\t\t\t\t\tsrc={this.value}\n\t\t\t\t\t\t\talt=\"Picture\"\n\t\t\t\t\t\t\tref={(ref) =>\n\t\t\t\t\t\t\t\tthis._setImageRef(ref as CropperImage)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tscalable\n\t\t\t\t\t\t\tcrossorigin=\"anonymous\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<cropper-shade\n\t\t\t\t\t\t\tclass={clsx({\n\t\t\t\t\t\t\t\t'rounded-round': this.variant === 'user',\n\t\t\t\t\t\t\t\trounded: this.variant === 'company',\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\ttheme-color=\"rgba(255, 255, 255, 0.5)\"\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<cropper-selection\n\t\t\t\t\t\t\tinitial-coverage=\"0.7\"\n\t\t\t\t\t\t\taspect-ratio=\"1\"\n\t\t\t\t\t\t\tref={(ref) =>\n\t\t\t\t\t\t\t\t(this._selectionRef = ref as CropperSelection)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<cropper-handle action=\"move\" plain></cropper-handle>\n\t\t\t\t\t</cropper-canvas>\n\t\t\t\t)}\n\n\t\t\t\t<div class=\"flex w-full items-center gap-2 px-14 text-storm-vague tablet:max-w-xs tablet:px-1\">\n\t\t\t\t\t<p-icon variant=\"minus\" />\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass=\"p-input w-full\"\n\t\t\t\t\t\ttype=\"range\"\n\t\t\t\t\t\tmin=\"0\"\n\t\t\t\t\t\tmax=\"100\"\n\t\t\t\t\t\tvalue={this._currentScale}\n\t\t\t\t\t\tonInput={(ev) =>\n\t\t\t\t\t\t\tthis._onInput((ev.target as HTMLInputElement).value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep=\"0.5\"\n\t\t\t\t\t/>\n\t\t\t\t\t<p-icon variant=\"plus\" />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _setImageRef(ref: CropperImage) {\n\t\tif (this._imageRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._imageRef = ref;\n\t\tthis._imageRef.$ready((image) =>\n\t\t\tsetTimeout(() => this._setInitialState(image), 200)\n\t\t);\n\t}\n\n\tprivate _setInitialState(image) {\n\t\tlet scale: number;\n\t\tif (image.naturalWidth > image.naturalHeight) {\n\t\t\t// set scale by height\n\t\t\tscale = 200 / image.naturalHeight;\n\t\t}\n\n\t\tif (image.naturalHeight >= image.naturalWidth) {\n\t\t\t// set scale by width\n\t\t\tscale = 200 / image.naturalWidth;\n\t\t}\n\n\t\tconst current = this._imageRef.$getTransform();\n\n\t\tthis._minScale = scale;\n\t\tthis._maxScale = current[0];\n\n\t\tthis._selectionRef.$resize('nw-resize', 200, 200, 1);\n\t\tthis._selectionRef.$center();\n\n\t\tthis._setScale(scale);\n\t\tthis._toCanvas();\n\t}\n\n\tprivate _onAction() {\n\t\tthis._setCurrentScale();\n\t\tthis._toCanvas();\n\t}\n\n\tprivate _setScale(\n\t\tscale: number,\n\t\tsetCenter: boolean = true,\n\t\tsetCurrentScale: boolean = true\n\t) {\n\t\tconst transform = this._imageRef.$getTransform();\n\t\tthis._imageRef.$setTransform([\n\t\t\tscale,\n\t\t\t0,\n\t\t\t0,\n\t\t\tscale,\n\t\t\ttransform[4],\n\t\t\ttransform[5],\n\t\t]);\n\n\t\tif (setCenter) {\n\t\t\tthis._imageRef.$center();\n\t\t}\n\n\t\tif (setCurrentScale) {\n\t\t\tthis._setCurrentScale();\n\t\t}\n\t}\n\n\tprivate _setCurrentScale() {\n\t\tconst transform = this._imageRef.$getTransform();\n\t\tconst current = transform[0];\n\n\t\tif (current < this._minScale) {\n\t\t\tthis._setScale(this._minScale, true, false);\n\t\t\tthis._currentScale = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tif (current > this._maxScale) {\n\t\t\tthis._setScale(this._maxScale, true, false);\n\t\t\tthis._currentScale = 100;\n\t\t\treturn;\n\t\t}\n\n\t\tif (current === this._minScale) {\n\t\t\tthis._currentScale = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tif (current === this._maxScale) {\n\t\t\tthis._currentScale = 100;\n\t\t\treturn;\n\t\t}\n\n\t\tconst minMaxDiff = this._maxScale - this._minScale;\n\t\tconst currentDiff = current - this._minScale;\n\n\t\tconst percentage = (currentDiff / minMaxDiff) * 100;\n\t\tthis._currentScale = percentage;\n\t}\n\n\tprivate _onInput(value) {\n\t\tconst transform = this._imageRef.$getTransform();\n\t\tconst current = transform[0];\n\t\tconst minMaxDiff = this._maxScale - this._minScale;\n\n\t\tconst toSet = minMaxDiff * (value / 100);\n\n\t\tif (toSet === current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._setScale(toSet + this._minScale, false, false);\n\t\tthis._currentScale = value;\n\n\t\tthis._toCanvas();\n\t}\n\n\tprivate _toCanvas() {\n\t\tif (this._toCanvasDebounceTimeout) {\n\t\t\tclearTimeout(this._toCanvasDebounceTimeout);\n\t\t}\n\n\t\tthis._toCanvasDebounceTimeout = setTimeout(async () => {\n\t\t\tconst canvas = await this._selectionRef.$toCanvas();\n\t\t\tif (this.returnType === 'canvas') {\n\t\t\t\tthis.valueChange.emit(canvas);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = canvas.toDataURL('image/png');\n\t\t\tthis.valueChange.emit(data);\n\t\t}, 200);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cropper.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/cropper/test/cropper.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-cropper', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n\n await page.setContent('<p-cropper></p-cropper>');\n const element = await page.find('p-cropper');\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-cropper></p-cropper>');\n // const component = await page.find('p-button');\n const element = await page.find('p-cropper');\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":"cropper.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/cropper/test/cropper.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-cropper', () => {\n\tit('renders', async () => {\n\t\tconst page = await newE2EPage();\n\n\t\tawait page.setContent('<p-cropper></p-cropper>');\n\t\tconst element = await page.find('p-cropper');\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-cropper></p-cropper>');\n\t\t// const component = await page.find('p-button');\n\t\tconst element = await page.find('p-cropper');\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":"cropper.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/cropper/test/cropper.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 { Cropper } from '../cropper.component';\n\ndescribe('p-cropper', () => {\n it('renders', async () => {\n const { root } = await newSpecPage({\n components: [Cropper],\n html: '<p-cropper></p-cropper>',\n });\n expect(root).toEqualHtml(`\n <p-cropper class=\"p-cropper\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-cropper>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"cropper.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/cropper/test/cropper.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 { Cropper } from '../cropper.component';\n\ndescribe('p-cropper', () => {\n\tit('renders', async () => {\n\t\tconst { root } = await newSpecPage({\n\t\t\tcomponents: [Cropper],\n\t\t\thtml: '<p-cropper></p-cropper>',\n\t\t});\n\t\texpect(root).toEqualHtml(`\n <p-cropper class=\"p-cropper\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-cropper>\n `);\n\t});\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/datepicker/datepicker.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,EACH,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,EACL,UAAU,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAOzC,MAAM,OAAO,UAAU;;IAsGX,oBAAe,GAAG;MACtB,IAAI,EAAE,MAAM;MACZ,KAAK,EAAE,YAAY;MACnB,GAAG,EAAE,YAAY;KACpB,CAAC;;;0BA5FgC,KAAK;;;;2BAoBJ,KAAK;gBAKC,KAAK;kBAarB,YAAY;gBAKF,QAAQ;;;;;;oBA8BE,KAAK;yBAOZ,KAAK;;;;0BAID,EAAE;;EAWlC,UAAU,CAAC,KAAoB;IACrC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,cAAc,EAAE;MAC/B,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;KACtB;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;MAC3B,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;KAC3B;IAED,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;EAC1B,CAAC;EAGS,YAAY,CAAC,OAAsB;IACzC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;MAC7B,OAAO,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;KAC/B;IAED,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;MACnB,OAAO;KACV;IAED,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAExB,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,I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,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport {\n format,\n isAfter,\n isBefore,\n isSameDay,\n isValid,\n parse,\n startOfDay,\n} from 'date-fns';\nimport { childOf } from '../../../utils';\n\n@Component({\n tag: 'p-datepicker',\n styleUrl: 'datepicker.component.scss',\n shadow: false,\n})\nexport class Datepicker {\n /**\n * The placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * The current value\n */\n @Prop() value: Date | string | null | undefined;\n\n /**\n * Wethter to automatically preselect today\n */\n @Prop() preselectToday: boolean = false;\n\n /**\n * Disabled dates\n */\n @Prop() disabledDates?: Array<Date | string> | string;\n\n /**\n * Min date\n */\n @Prop() minDate?: Date | string;\n\n /**\n * Max date\n */\n @Prop() maxDate?: Date | string;\n\n /**\n * Wether to disable the weekends\n */\n @Prop() disableWeekends: boolean = false;\n\n /**\n * The mode of the datepicker\n */\n @Prop() mode: 'year' | 'month' | 'day' = 'day';\n\n /**\n * Event when the value changes\n */\n @Event({\n bubbles: false,\n })\n valueChange: EventEmitter<any>;\n\n /**\n * The display & parse format to use\n */\n @Prop() format: string = 'dd-MM-yyyy';\n\n /**\n * The size of the input group used by the datepicker\n */\n @Prop() size: 'small' | 'medium' = 'medium';\n\n /**\n * The prefix of the input group used by the datepicker\n */\n @Prop() prefix: string;\n\n /**\n * The label of the input group used by the datepicker\n */\n @Prop() label: string;\n\n /**\n * The helper of the input group used by the datepicker\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 datepicker\n */\n @Prop({ reflect: true }) error: string;\n\n /**\n * Wether the input group is disabled used by the datepicker\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 _value: Date;\n @State() private _minDate: Date;\n @State() private _maxDate: Date;\n @State() private _disabledDates: Date[] = [];\n\n private _onInputTimeout: NodeJS.Timeout;\n\n private _defaultFormats = {\n year: 'yyyy',\n month: 'LLLL, yyyy',\n day: 'dd-MM-yyyy',\n };\n\n @Watch('value')\n protected parseValue(value: string | Date) {\n if (!value && this.preselectToday) {\n value = new Date();\n }\n\n if (typeof value === 'string') {\n value = new Date(value);\n }\n\n this._setValue(value);\n }\n\n @Watch('minDate')\n protected parseMinDate(minDate: string | Date) {\n if (typeof minDate === 'string') {\n minDate = new Date(minDate);\n }\n\n if (!isValid(minDate)) {\n return;\n }\n\n this._minDate = minDate;\n\n if (isBefore(this._value, this._minDate)) {\n this._setValue(null);\n }\n }\n\n @Watch('maxDate')\n protected parseMaxDate(maxDate: string | Date) {\n if (typeof maxDate === 'string') {\n maxDate = new Date(maxDate);\n }\n\n if (!isValid(maxDate)) {\n return;\n }\n\n this._maxDate = maxDate;\n\n if (isAfter(this._value, this._maxDate)) {\n this._setValue(null);\n }\n }\n\n @Watch('disabledDates')\n protected parseDisabledDates(disabledDates: Array<string | Date> | string) {\n if (typeof disabledDates === 'string') {\n disabledDates = JSON.parse(disabledDates);\n }\n\n if (!disabledDates || !Array.isArray(disabledDates)) {\n return;\n }\n\n // normalize all to date\n this._disabledDates = disabledDates\n .map((date) => {\n if (typeof date === 'string') {\n return new Date(date);\n }\n\n return date;\n })\n .filter((date) => isValid(date));\n\n if (this._isDisabledDay(this._value)) {\n this._setValue(null);\n }\n }\n\n componentWillLoad() {\n if (this.disabledDates) {\n this.parseDisabledDates(this.disabledDates);\n }\n\n if (this.minDate) {\n this.parseMinDate(this.minDate);\n }\n\n if (this.maxDate) {\n this.parseMaxDate(this.maxDate);\n }\n\n if (\n this.mode !== 'day' &&\n this.format === this._defaultFormats['day']\n ) {\n this.format = this._defaultFormats[this.mode];\n }\n\n this.parseValue(this.value);\n }\n\n render() {\n return (\n <Host class=\"p-datepicker\">\n <p-dropdown\n disableTriggerClick={true}\n applyMaxWidth={false}\n applyFullWidth={false}\n insideClick={true}\n show={this._showDropdown}\n >\n <p-input-group\n slot=\"trigger\"\n icon=\"calendar\"\n iconPosition=\"start\"\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 >\n <input\n slot=\"input\"\n type=\"text\"\n placeholder={this.placeholder}\n value={this._getFormattedDate()}\n class=\"p-input cursor-pointer\"\n onFocus={() => this._onFocus()}\n onBlur={(ev) => this._onBlur(ev)}\n onInput={(ev) => this._onInput(ev)}\n />\n </p-input-group>\n <div slot=\"items\">\n <p-calendar\n variant=\"embedded\"\n value={this._value}\n onValueChange={({ detail }) =>\n (this.value = detail)\n }\n preselectToday={this.preselectToday}\n disabledDates={this.disabledDates}\n minDate={this.minDate}\n maxDate={this.maxDate}\n disableWeekends={this.disableWeekends}\n mode={this.mode}\n />\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 }\n\n private _onFocus() {\n this._showDropdown = true;\n }\n\n private _onBlur(ev) {\n if (ev.target.value === null) {\n return;\n }\n\n const value = parse(ev.target.value, this.format, new Date());\n\n if (!isValid(value) || this._isDisabledDay(value)) {\n ev.target.value = this._getFormattedDate();\n return;\n }\n }\n\n private _onInput(ev) {\n if (this._onInputTimeout) {\n clearTimeout(this._onInputTimeout);\n this._onInputTimeout = null;\n }\n\n this._onInputTimeout = setTimeout(() => {\n const value = parse(ev.target.value, this.format, new Date());\n if (!isValid(value)) {\n return;\n }\n\n this._setValue(value, false);\n }, 250);\n }\n\n private _setValue(value: Date | null, hideDropdown = true) {\n if (value === null) {\n this._value = null;\n this.valueChange.emit(null);\n return;\n }\n\n if (!isValid(value)) {\n return;\n }\n\n if (this._isDisabledDay(value)) {\n return;\n }\n\n value = startOfDay(value);\n const isSameValue = isSameDay(value, this._value);\n\n if (isSameValue) {\n return;\n }\n\n if (hideDropdown) {\n this._showDropdown = false;\n }\n\n this._value = value;\n this.valueChange.emit(value);\n }\n\n private _isDisabledDay(day: Date) {\n return (\n (isBefore(day, this._minDate) && !isSameDay(day, this._minDate)) ||\n (isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||\n this._disabledDates.findIndex((date) => isSameDay(date, day)) >= 0\n );\n }\n\n private _getFormattedDate() {\n if (!this._value) {\n return '';\n }\n\n return format(this._value, this.format);\n }\n}\n"]}
1
+ {"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/datepicker/datepicker.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,EACN,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,EACL,UAAU,GACV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAOzC,MAAM,OAAO,UAAU;;IAsGd,oBAAe,GAAG;MACzB,IAAI,EAAE,MAAM;MACZ,KAAK,EAAE,YAAY;MACnB,GAAG,EAAE,YAAY;KACjB,CAAC;;;0BA5FgC,KAAK;;;;2BAoBJ,KAAK;gBAKC,KAAK;kBAarB,YAAY;gBAKF,QAAQ;;;;;;oBA8BE,KAAK;yBAOZ,KAAK;;;;0BAID,EAAE;;EAWlC,UAAU,CAAC,KAAoB;IACxC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,cAAc,EAAE;MAClC,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;KACnB;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;MAC9B,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;IAED,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;EACvB,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 {\n\tformat,\n\tisAfter,\n\tisBefore,\n\tisSameDay,\n\tisValid,\n\tparse,\n\tstartOfDay,\n} from 'date-fns';\nimport { childOf } from '../../../utils';\n\n@Component({\n\ttag: 'p-datepicker',\n\tstyleUrl: 'datepicker.component.scss',\n\tshadow: false,\n})\nexport class Datepicker {\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: Date | string | null | undefined;\n\n\t/**\n\t * Wethter to automatically preselect today\n\t */\n\t@Prop() preselectToday: boolean = false;\n\n\t/**\n\t * Disabled dates\n\t */\n\t@Prop() disabledDates?: Array<Date | string> | string;\n\n\t/**\n\t * Min date\n\t */\n\t@Prop() minDate?: Date | string;\n\n\t/**\n\t * Max date\n\t */\n\t@Prop() maxDate?: Date | string;\n\n\t/**\n\t * Wether to disable the weekends\n\t */\n\t@Prop() disableWeekends: boolean = false;\n\n\t/**\n\t * The mode of the datepicker\n\t */\n\t@Prop() mode: 'year' | 'month' | 'day' = 'day';\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 * The display & parse format to use\n\t */\n\t@Prop() format: string = 'dd-MM-yyyy';\n\n\t/**\n\t * The size of the input group used by the datepicker\n\t */\n\t@Prop() size: 'small' | 'medium' = 'medium';\n\n\t/**\n\t * The prefix of the input group used by the datepicker\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the datepicker\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * The helper of the input group used by the datepicker\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 datepicker\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the datepicker\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\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 _value: Date;\n\t@State() private _minDate: Date;\n\t@State() private _maxDate: Date;\n\t@State() private _disabledDates: Date[] = [];\n\n\tprivate _onInputTimeout: NodeJS.Timeout;\n\n\tprivate _defaultFormats = {\n\t\tyear: 'yyyy',\n\t\tmonth: 'LLLL, yyyy',\n\t\tday: 'dd-MM-yyyy',\n\t};\n\n\t@Watch('value')\n\tprotected parseValue(value: string | Date) {\n\t\tif (!value && this.preselectToday) {\n\t\t\tvalue = new Date();\n\t\t}\n\n\t\tif (typeof value === 'string') {\n\t\t\tvalue = new Date(value);\n\t\t}\n\n\t\tthis._setValue(value);\n\t}\n\n\t@Watch('minDate')\n\tprotected parseMinDate(minDate: string | Date) {\n\t\tif (typeof minDate === 'string') {\n\t\t\tminDate = new Date(minDate);\n\t\t}\n\n\t\tif (!isValid(minDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._minDate = minDate;\n\n\t\tif (isBefore(this._value, this._minDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('maxDate')\n\tprotected parseMaxDate(maxDate: string | Date) {\n\t\tif (typeof maxDate === 'string') {\n\t\t\tmaxDate = new Date(maxDate);\n\t\t}\n\n\t\tif (!isValid(maxDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._maxDate = maxDate;\n\n\t\tif (isAfter(this._value, this._maxDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('disabledDates')\n\tprotected parseDisabledDates(disabledDates: Array<string | Date> | string) {\n\t\tif (typeof disabledDates === 'string') {\n\t\t\tdisabledDates = JSON.parse(disabledDates);\n\t\t}\n\n\t\tif (!disabledDates || !Array.isArray(disabledDates)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// normalize all to date\n\t\tthis._disabledDates = disabledDates\n\t\t\t.map((date) => {\n\t\t\t\tif (typeof date === 'string') {\n\t\t\t\t\treturn new Date(date);\n\t\t\t\t}\n\n\t\t\t\treturn date;\n\t\t\t})\n\t\t\t.filter((date) => isValid(date));\n\n\t\tif (this._isDisabledDay(this._value)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tif (this.disabledDates) {\n\t\t\tthis.parseDisabledDates(this.disabledDates);\n\t\t}\n\n\t\tif (this.minDate) {\n\t\t\tthis.parseMinDate(this.minDate);\n\t\t}\n\n\t\tif (this.maxDate) {\n\t\t\tthis.parseMaxDate(this.maxDate);\n\t\t}\n\n\t\tif (\n\t\t\tthis.mode !== 'day' &&\n\t\t\tthis.format === this._defaultFormats['day']\n\t\t) {\n\t\t\tthis.format = this._defaultFormats[this.mode];\n\t\t}\n\n\t\tthis.parseValue(this.value);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-datepicker\">\n\t\t\t\t<p-dropdown\n\t\t\t\t\tdisableTriggerClick={true}\n\t\t\t\t\tapplyMaxWidth={false}\n\t\t\t\t\tapplyFullWidth={false}\n\t\t\t\t\tinsideClick={true}\n\t\t\t\t\tshow={this._showDropdown}\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=\"calendar\"\n\t\t\t\t\t\ticonPosition=\"start\"\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>\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={this._getFormattedDate()}\n\t\t\t\t\t\t\tclass=\"p-input cursor-pointer\"\n\t\t\t\t\t\t\tonFocus={() => this._onFocus()}\n\t\t\t\t\t\t\tonBlur={(ev) => this._onBlur(ev)}\n\t\t\t\t\t\t\tonInput={(ev) => this._onInput(ev)}\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<p-calendar\n\t\t\t\t\t\t\tvariant=\"embedded\"\n\t\t\t\t\t\t\tvalue={this._value}\n\t\t\t\t\t\t\tonValueChange={({ detail }) =>\n\t\t\t\t\t\t\t\t(this.value = detail)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpreselectToday={this.preselectToday}\n\t\t\t\t\t\t\tdisabledDates={this.disabledDates}\n\t\t\t\t\t\t\tminDate={this.minDate}\n\t\t\t\t\t\t\tmaxDate={this.maxDate}\n\t\t\t\t\t\t\tdisableWeekends={this.disableWeekends}\n\t\t\t\t\t\t\tmode={this.mode}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</p-dropdown>\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}\n\n\tprivate _onFocus() {\n\t\tthis._showDropdown = true;\n\t}\n\n\tprivate _onBlur(ev) {\n\t\tif (ev.target.value === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = parse(ev.target.value, this.format, new Date());\n\n\t\tif (!isValid(value) || this._isDisabledDay(value)) {\n\t\t\tev.target.value = this._getFormattedDate();\n\t\t\treturn;\n\t\t}\n\t}\n\n\tprivate _onInput(ev) {\n\t\tif (this._onInputTimeout) {\n\t\t\tclearTimeout(this._onInputTimeout);\n\t\t\tthis._onInputTimeout = null;\n\t\t}\n\n\t\tthis._onInputTimeout = setTimeout(() => {\n\t\t\tconst value = parse(ev.target.value, this.format, new Date());\n\t\t\tif (!isValid(value)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._setValue(value, false);\n\t\t}, 250);\n\t}\n\n\tprivate _setValue(value: Date | null, hideDropdown = true) {\n\t\tif (value === null) {\n\t\t\tthis._value = null;\n\t\t\tthis.valueChange.emit(null);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isValid(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDisabledDay(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalue = startOfDay(value);\n\t\tconst isSameValue = isSameDay(value, this._value);\n\n\t\tif (isSameValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (hideDropdown) {\n\t\t\tthis._showDropdown = false;\n\t\t}\n\n\t\tthis._value = value;\n\t\tthis.valueChange.emit(value);\n\t}\n\n\tprivate _isDisabledDay(day: Date) {\n\t\treturn (\n\t\t\t(isBefore(day, this._minDate) && !isSameDay(day, this._minDate)) ||\n\t\t\t(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||\n\t\t\tthis._disabledDates.findIndex((date) => isSameDay(date, day)) >= 0\n\t\t);\n\t}\n\n\tprivate _getFormattedDate() {\n\t\tif (!this._value) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn format(this._value, this.format);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/datepicker/test/datepicker.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;EAC1B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAChD,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,+BAA+B,CAAC,CAAC;IACvD,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAChD,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-datepicker', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n\n await page.setContent('<p-datepicker></p-datepicker>');\n const element = await page.find('p-datepicker');\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-datepicker></p-datepicker>');\n // const component = await page.find('p-button');\n const element = await page.find('p-datepicker');\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":"datepicker.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/datepicker/test/datepicker.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;EAC7B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAChD,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,+BAA+B,CAAC,CAAC;IACvD,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAChD,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-datepicker', () => {\n\tit('renders', async () => {\n\t\tconst page = await newE2EPage();\n\n\t\tawait page.setContent('<p-datepicker></p-datepicker>');\n\t\tconst element = await page.find('p-datepicker');\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-datepicker></p-datepicker>');\n\t\t// const component = await page.find('p-button');\n\t\tconst element = await page.find('p-datepicker');\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":"datepicker.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/datepicker/test/datepicker.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;EAC1B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAC/B,UAAU,EAAE,CAAC,UAAU,CAAC;MACxB,IAAI,EAAE,+BAA+B;KACxC,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 { Datepicker } from '../datepicker.component';\n\ndescribe('p-datepicker', () => {\n it('renders', async () => {\n const { root } = await newSpecPage({\n components: [Datepicker],\n html: '<p-datepicker></p-datepicker>',\n });\n expect(root).toEqualHtml(`\n <p-datepicker class=\"p-datepicker\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-datepicker>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"datepicker.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/datepicker/test/datepicker.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;EAC7B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAClC,UAAU,EAAE,CAAC,UAAU,CAAC;MACxB,IAAI,EAAE,+BAA+B;KACrC,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 { Datepicker } from '../datepicker.component';\n\ndescribe('p-datepicker', () => {\n\tit('renders', async () => {\n\t\tconst { root } = await newSpecPage({\n\t\t\tcomponents: [Datepicker],\n\t\t\thtml: '<p-datepicker></p-datepicker>',\n\t\t});\n\t\texpect(root).toEqualHtml(`\n <p-datepicker class=\"p-datepicker\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-datepicker>\n `);\n\t});\n});\n"]}
@@ -13,6 +13,7 @@ export class Dropdown {
13
13
  this.scrollable = false;
14
14
  this.insideClick = false;
15
15
  this.disableTriggerClick = false;
16
+ this.applyChevron = true;
16
17
  this.chevronPosition = 'end';
17
18
  this.chevronDirection = undefined;
18
19
  }
@@ -29,6 +30,9 @@ export class Dropdown {
29
30
  return (h(Host, { class: "p-dropdown" }, h("div", { class: "trigger", ref: (ref) => (this._trigger = ref), onClick: () => this._triggerClickHandler() }, h("slot", { onSlotchange: (ev) => this._checkButton(ev), name: "trigger" })), h("p-dropdown-menu-container", { role: "popover", maxWidth: !this.calculateWidth && this.applyMaxWidth, fullWidth: this.applyFullWidth && !this.applyMaxWidth, ref: (el) => this._load(el), "data-placement": this.placement, "data-strategy": this.strategy, onClick: () => this._containerClickHandler(), scrollable: this.scrollable }, h("slot", { name: "items" }))));
30
31
  }
31
32
  _checkButton({ target }) {
33
+ if (!this.applyChevron) {
34
+ return;
35
+ }
32
36
  const slot = target;
33
37
  const children = slot.assignedElements();
34
38
  for (let child of children) {
@@ -315,6 +319,24 @@ export class Dropdown {
315
319
  "reflect": false,
316
320
  "defaultValue": "false"
317
321
  },
322
+ "applyChevron": {
323
+ "type": "boolean",
324
+ "mutable": false,
325
+ "complexType": {
326
+ "original": "boolean",
327
+ "resolved": "boolean",
328
+ "references": {}
329
+ },
330
+ "required": false,
331
+ "optional": false,
332
+ "docs": {
333
+ "tags": [],
334
+ "text": "Wether to apply chevron automatically"
335
+ },
336
+ "attribute": "apply-chevron",
337
+ "reflect": false,
338
+ "defaultValue": "true"
339
+ },
318
340
  "chevronPosition": {
319
341
  "type": "string",
320
342
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/dropdown/dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EAEN,KAAK,GAER,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,I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\n} from '@floating-ui/dom';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n Watch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils/child-of';\n\n@Component({\n tag: 'p-dropdown',\n styleUrl: 'dropdown.component.scss',\n shadow: true,\n})\nexport class Dropdown {\n /**\n * The content of the dropdown menu\n */\n @Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n /**\n * The strategy of the popover placement\n */\n @Prop() strategy: Strategy = 'absolute';\n\n /**\n * Wether to show the dropdown menu\n */\n @Prop() show: boolean = false;\n\n /**\n * Wether to automatically calculate the width of the menu based on the trigger\n */\n @Prop() calculateWidth: boolean = false;\n\n /**\n * Wether to apply the max width\n */\n @Prop() applyMaxWidth: boolean = true;\n\n /**\n * Wether to apply the full width\n */\n @Prop() applyFullWidth: boolean = true;\n\n /**\n * Wether the dropdown container should be scrollable when the threshold is met.\n */\n @Prop() scrollable: boolean = false;\n\n /**\n * Wether to automatically close the dropdown menu after clicking inside\n */\n @Prop() insideClick: boolean = false;\n\n /**\n * Wether to automatically close the dropdown menu after clicking inside\n */\n @Prop() disableTriggerClick: boolean = false;\n\n /**\n * Chevron position\n */\n @Prop() chevronPosition: 'start' | 'end' = 'end';\n\n /**\n * Chevron direction\n */\n @Prop() chevronDirection: 'up' | 'down';\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n /**\n * Open change event\n */\n @Event({\n bubbles: false,\n })\n isOpen: EventEmitter<boolean>;\n\n private _loaded = false;\n private _trigger: HTMLElement;\n private _menu: HTMLElement;\n private _cleanup: () => void;\n\n componentShouldUpdate() {\n this._update();\n }\n\n disconnectedCallback() {\n if (this._cleanup) {\n this._cleanup();\n this._cleanup = null;\n }\n }\n\n render() {\n return (\n <Host class=\"p-dropdown\">\n <div\n class=\"trigger\"\n ref={(ref) => (this._trigger = ref)}\n onClick={() => this._triggerClickHandler()}\n >\n <slot\n onSlotchange={(ev) => this._checkButton(ev)}\n name=\"trigger\"\n />\n </div>\n <p-dropdown-menu-container\n role=\"popover\"\n maxWidth={!this.calculateWidth && this.applyMaxWidth}\n fullWidth={this.applyFullWidth && !this.applyMaxWidth}\n ref={(el) => this._load(el)}\n data-placement={this.placement}\n data-strategy={this.strategy}\n onClick={() => this._containerClickHandler()}\n scrollable={this.scrollable}\n >\n <slot name=\"items\" />\n </p-dropdown-menu-container>\n </Host>\n );\n }\n\n private _checkButton({ target }: Event) {\n const slot = target as HTMLSlotElement;\n const children = slot.assignedElements();\n\n for (let child of children) {\n if (child.nodeName === 'P-BUTTON') {\n (child as any).chevronPosition = this.chevronPosition;\n (child as any).chevron = this.chevronDirection\n ? this.chevronDirection\n : this.placement.indexOf('top') >= 0\n ? 'up'\n : 'down';\n }\n }\n }\n\n @Watch('show')\n protected onShowChange(show) {\n if (!this._loaded) {\n return;\n }\n\n if (!show) {\n this._hide();\n return;\n }\n\n this._show();\n }\n\n @Listen('click', { target: 'document', capture: true })\n protected documentClickHandler({ target }) {\n if (\n !this._menu.hasAttribute('data-show') ||\n childOf(target, this._el)\n ) {\n return;\n }\n\n this._hide();\n }\n\n private _containerClickHandler() {\n if (this.insideClick) {\n return;\n }\n\n if (this._menu.hasAttribute('data-show')) {\n this._hide();\n }\n }\n\n private _triggerClickHandler() {\n if (this.disableTriggerClick) {\n return;\n }\n\n if (this._menu.hasAttribute('data-show')) {\n this._hide();\n return;\n }\n\n this._show();\n }\n\n private _load(popover: HTMLElement) {\n this._menu = popover;\n if (popover) {\n this._update();\n this._loaded = true;\n\n if (this.show) {\n setTimeout(() => this._show(), 100);\n }\n }\n }\n\n private _show() {\n if (!this._loaded) {\n return;\n }\n\n // Make the popover visible\n if (this.calculateWidth) {\n this._menu.style.width = `${this._trigger.clientWidth}px`;\n }\n\n this._cleanup = autoUpdate(this._el, this._menu, () => this._update());\n\n this._menu.setAttribute('data-show', '');\n this.isOpen.emit(true);\n }\n\n private _hide() {\n if (!this._loaded || this.show) {\n return;\n }\n\n if (this._cleanup) {\n this._cleanup();\n this._cleanup = null;\n }\n\n // Hide the popover\n this._menu.removeAttribute('data-show');\n this.isOpen.emit(false);\n }\n\n private _update() {\n if (!this._menu) {\n return;\n }\n\n computePosition(this._el, this._menu, {\n placement: this.placement,\n strategy: this.strategy,\n middleware: [offset(8), flip(), shift()],\n }).then(({ x, y, placement }) => {\n this._menu.dataset.placement = placement;\n Object.assign(this._menu.style, {\n top: `${y}px`,\n left: `${x}px`,\n });\n });\n }\n}\n"]}
1
+ {"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/dropdown/dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,eAAe,EACf,IAAI,EACJ,MAAM,EAEN,KAAK,GAEL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAOlD,MAAM,OAAO,QAAQ;;IA0EZ,YAAO,GAAG,KAAK,CAAC;qBAtEwB,cAAc;oBAKjC,UAAU;gBAKf,KAAK;0BAKK,KAAK;yBAKN,IAAI;0BAKH,IAAI;sBAKR,KAAK;uBAKJ,KAAK;+BAKG,KAAK;wBAKZ,IAAI;2BAKO,KAAK;;;EAyBhD,qBAAqB;IACpB,IAAI,CAAC,OAAO,EAAE,CAAC;EAChB,CAAC;EAED,oBAAoB;IACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;MAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;KACrB;EACF,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAC,YAAY;MACvB,WACC,KAAK,EAAC,SAAS,EACf,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,C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S,EAAE,EAAE,EAAE;MAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;MACzC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;QAC/B,GAAG,EAAE,GAAG,CAAC,IAAI;QACb,IAAI,EAAE,GAAG,CAAC,IAAI;OACd,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tStrategy,\n} from '@floating-ui/dom';\nimport {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils/child-of';\n\n@Component({\n\ttag: 'p-dropdown',\n\tstyleUrl: 'dropdown.component.scss',\n\tshadow: true,\n})\nexport class Dropdown {\n\t/**\n\t * The content of the dropdown menu\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The strategy of the popover placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * Wether to show the dropdown menu\n\t */\n\t@Prop() show: boolean = false;\n\n\t/**\n\t * Wether to automatically calculate the width of the menu based on the trigger\n\t */\n\t@Prop() calculateWidth: boolean = false;\n\n\t/**\n\t * Wether to apply the max width\n\t */\n\t@Prop() applyMaxWidth: boolean = true;\n\n\t/**\n\t * Wether to apply the full width\n\t */\n\t@Prop() applyFullWidth: boolean = true;\n\n\t/**\n\t * Wether the dropdown container should be scrollable when the threshold is met.\n\t */\n\t@Prop() scrollable: boolean = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() insideClick: boolean = false;\n\n\t/**\n\t * Wether to automatically close the dropdown menu after clicking inside\n\t */\n\t@Prop() disableTriggerClick: boolean = false;\n\n\t/**\n\t * Wether to apply chevron automatically\n\t */\n\t@Prop() applyChevron: boolean = true;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Chevron direction\n\t */\n\t@Prop() chevronDirection: 'up' | 'down';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Open change event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tisOpen: EventEmitter<boolean>;\n\n\tprivate _loaded = false;\n\tprivate _trigger: HTMLElement;\n\tprivate _menu: HTMLElement;\n\tprivate _cleanup: () => void;\n\n\tcomponentShouldUpdate() {\n\t\tthis._update();\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-dropdown\">\n\t\t\t\t<div\n\t\t\t\t\tclass=\"trigger\"\n\t\t\t\t\tref={(ref) => (this._trigger = ref)}\n\t\t\t\t\tonClick={() => this._triggerClickHandler()}\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\tonSlotchange={(ev) => this._checkButton(ev)}\n\t\t\t\t\t\tname=\"trigger\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<p-dropdown-menu-container\n\t\t\t\t\trole=\"popover\"\n\t\t\t\t\tmaxWidth={!this.calculateWidth && this.applyMaxWidth}\n\t\t\t\t\tfullWidth={this.applyFullWidth && !this.applyMaxWidth}\n\t\t\t\t\tref={(el) => this._load(el)}\n\t\t\t\t\tdata-placement={this.placement}\n\t\t\t\t\tdata-strategy={this.strategy}\n\t\t\t\t\tonClick={() => this._containerClickHandler()}\n\t\t\t\t\tscrollable={this.scrollable}\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"items\" />\n\t\t\t\t</p-dropdown-menu-container>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _checkButton({ target }: Event) {\n\t\tif (!this.applyChevron) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst slot = target as HTMLSlotElement;\n\t\tconst children = slot.assignedElements();\n\n\t\tfor (let child of children) {\n\t\t\tif (child.nodeName === 'P-BUTTON') {\n\t\t\t\t(child as any).chevronPosition = this.chevronPosition;\n\t\t\t\t(child as any).chevron = this.chevronDirection\n\t\t\t\t\t? this.chevronDirection\n\t\t\t\t\t: this.placement.indexOf('top') >= 0\n\t\t\t\t\t\t? 'up'\n\t\t\t\t\t\t: 'down';\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch('show')\n\tprotected onShowChange(show) {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!show) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (\n\t\t\t!this._menu.hasAttribute('data-show') ||\n\t\t\tchildOf(target, this._el)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hide();\n\t}\n\n\tprivate _containerClickHandler() {\n\t\tif (this.insideClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t}\n\t}\n\n\tprivate _triggerClickHandler() {\n\t\tif (this.disableTriggerClick) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._menu.hasAttribute('data-show')) {\n\t\t\tthis._hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._show();\n\t}\n\n\tprivate _load(popover: HTMLElement) {\n\t\tthis._menu = popover;\n\t\tif (popover) {\n\t\t\tthis._update();\n\t\t\tthis._loaded = true;\n\n\t\t\tif (this.show) {\n\t\t\t\tsetTimeout(() => this._show(), 100);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _show() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make the popover visible\n\t\tif (this.calculateWidth) {\n\t\t\tthis._menu.style.width = `${this._trigger.clientWidth}px`;\n\t\t}\n\n\t\tthis._cleanup = autoUpdate(this._el, this._menu, () => this._update());\n\n\t\tthis._menu.setAttribute('data-show', '');\n\t\tthis.isOpen.emit(true);\n\t}\n\n\tprivate _hide() {\n\t\tif (!this._loaded || this.show) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._cleanup) {\n\t\t\tthis._cleanup();\n\t\t\tthis._cleanup = null;\n\t\t}\n\n\t\t// Hide the popover\n\t\tthis._menu.removeAttribute('data-show');\n\t\tthis.isOpen.emit(false);\n\t}\n\n\tprivate _update() {\n\t\tif (!this._menu) {\n\t\t\treturn;\n\t\t}\n\n\t\tcomputePosition(this._el, this._menu, {\n\t\t\tplacement: this.placement,\n\t\t\tstrategy: this.strategy,\n\t\t\tmiddleware: [offset(8), flip(), shift()],\n\t\t}).then(({ x, y, placement }) => {\n\t\t\tthis._menu.dataset.placement = placement;\n\t\t\tObject.assign(this._menu.style, {\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tleft: `${x}px`,\n\t\t\t});\n\t\t});\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/dropdown/test/dropdown.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;EACxB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,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,2BAA2B,CAAC,CAAC;IACnD,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,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-dropdown', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n\n await page.setContent('<p-dropdown></p-dropdown>');\n const element = await page.find('p-dropdown');\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-dropdown></p-dropdown>');\n // const component = await page.find('p-button');\n const element = await page.find('p-dropdown');\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":"dropdown.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/dropdown/test/dropdown.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;EAC3B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,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,2BAA2B,CAAC,CAAC;IACnD,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,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-dropdown', () => {\n\tit('renders', async () => {\n\t\tconst page = await newE2EPage();\n\n\t\tawait page.setContent('<p-dropdown></p-dropdown>');\n\t\tconst element = await page.find('p-dropdown');\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-dropdown></p-dropdown>');\n\t\t// const component = await page.find('p-button');\n\t\tconst element = await page.find('p-dropdown');\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":"dropdown.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/dropdown/test/dropdown.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;EACxB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACrB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAC/B,UAAU,EAAE,CAAC,QAAQ,CAAC;MACtB,IAAI,EAAE,2BAA2B;KACpC,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 { Dropdown } from '../dropdown.component';\n\ndescribe('p-dropdown', () => {\n it('renders', async () => {\n const { root } = await newSpecPage({\n components: [Dropdown],\n html: '<p-dropdown></p-dropdown>',\n });\n expect(root).toEqualHtml(`\n <p-dropdown class=\"p-dropdown\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-dropdown>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"dropdown.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/dropdown/test/dropdown.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;EAC3B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAClC,UAAU,EAAE,CAAC,QAAQ,CAAC;MACtB,IAAI,EAAE,2BAA2B;KACjC,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 { Dropdown } from '../dropdown.component';\n\ndescribe('p-dropdown', () => {\n\tit('renders', async () => {\n\t\tconst { root } = await newSpecPage({\n\t\t\tcomponents: [Dropdown],\n\t\t\thtml: '<p-dropdown></p-dropdown>',\n\t\t});\n\t\texpect(root).toEqualHtml(`\n <p-dropdown class=\"p-dropdown\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-dropdown>\n `);\n\t});\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"input-error.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/input-error/input-error.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAMhE,MAAM,OAAO,UAAU;;;4BASQ,KAAK;wBAEA,KAAK;;EAErC,MAAM;IACF,OAAO,CACH,EAAC,IAAI,IAAC,KAAK,EAAC,eAAe;MACvB,iBACI,OAAO,EAAC,OAAO,EACf,OAAO,EAAE,IAAI,CAAC,KAAK,EACnB,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAC3B,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,MAAM,CAAC;QAEjD,cACI,KAAK,EAAE,GACH,IAAI,CAAC,YAAY;YACb,CAAC,CAAC,eAAe;YACjB,CAAC,CAAC,qBACV,sBAAsB,EACtB,IAAI,EAAC,SAAS,EACd,OAAO,EAAC,aAAa,GACvB,CACM,CACT,CACV,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Host, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'p-input-error',\n shadow: true,\n})\nexport class InputError {\n /**\n * The error to show\n */\n @Prop() error: string;\n\n /**\n * Wether to force show the tooltip\n */\n @Prop() forceShowTooltip = false;\n\n @State() private _showTooltip = false;\n\n render() {\n return (\n <Host class=\"p-input-error\">\n <p-tooltip\n variant=\"error\"\n content={this.error}\n show={this.forceShowTooltip}\n onIsOpen={(ev) => (this._showTooltip = ev.detail)}\n >\n <p-icon\n class={`${\n this._showTooltip\n ? 'text-negative'\n : 'text-negative-light'\n } hover:text-negative`}\n slot=\"trigger\"\n variant=\"explanation\"\n />\n </p-tooltip>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"input-error.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/input-error/input-error.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAMhE,MAAM,OAAO,UAAU;;;4BASK,KAAK;wBAEA,KAAK;;EAErC,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAC,eAAe;MAC1B,iBACC,OAAO,EAAC,OAAO,EACf,OAAO,EAAE,IAAI,CAAC,KAAK,EACnB,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAC3B,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,MAAM,CAAC;QAEjD,cACC,KAAK,EAAE,GACN,IAAI,CAAC,YAAY;YAChB,CAAC,CAAC,eAAe;YACjB,CAAC,CAAC,qBACJ,sBAAsB,EACtB,IAAI,EAAC,SAAS,EACd,OAAO,EAAC,aAAa,GACpB,CACS,CACN,CACP,CAAC;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Prop, State } from '@stencil/core';\n\n@Component({\n\ttag: 'p-input-error',\n\tshadow: true,\n})\nexport class InputError {\n\t/**\n\t * The error to show\n\t */\n\t@Prop() error: string;\n\n\t/**\n\t * Wether to force show the tooltip\n\t */\n\t@Prop() forceShowTooltip = false;\n\n\t@State() private _showTooltip = false;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-input-error\">\n\t\t\t\t<p-tooltip\n\t\t\t\t\tvariant=\"error\"\n\t\t\t\t\tcontent={this.error}\n\t\t\t\t\tshow={this.forceShowTooltip}\n\t\t\t\t\tonIsOpen={(ev) => (this._showTooltip = ev.detail)}\n\t\t\t\t>\n\t\t\t\t\t<p-icon\n\t\t\t\t\t\tclass={`${\n\t\t\t\t\t\t\tthis._showTooltip\n\t\t\t\t\t\t\t\t? 'text-negative'\n\t\t\t\t\t\t\t\t: 'text-negative-light'\n\t\t\t\t\t\t} hover:text-negative`}\n\t\t\t\t\t\tslot=\"trigger\"\n\t\t\t\t\t\tvariant=\"explanation\"\n\t\t\t\t\t/>\n\t\t\t\t</p-tooltip>\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"input-error.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/input-error/test/input-error.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;EAC7B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,iCAAiC,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;IAC9C,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,iCAAiC,CAAC,CAAC;IACzD,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjD,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;EACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('p-input-error', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n\n await page.setContent('<p-input-error></p-input-error>');\n const element = await page.find('p-input-error');\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-input-error></p-input-error>');\n // const component = await page.find('p-button');\n const element = await page.find('p-input-error');\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":"input-error.component.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/input-error/test/input-error.component.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;EAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAEhC,MAAM,IAAI,CAAC,UAAU,CAAC,iCAAiC,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjD,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,iCAAiC,CAAC,CAAC;IACzD,iDAAiD;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjD,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-input-error', () => {\n\tit('renders', async () => {\n\t\tconst page = await newE2EPage();\n\n\t\tawait page.setContent('<p-input-error></p-input-error>');\n\t\tconst element = await page.find('p-input-error');\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-input-error></p-input-error>');\n\t\t// const component = await page.find('p-button');\n\t\tconst element = await page.find('p-input-error');\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":"input-error.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/input-error/test/input-error.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;EAC7B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MACjC,UAAU,EAAE,CAAC,UAAU,CAAC;MACxB,IAAI,EAAE,iCAAiC;KACxC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;KAKxB,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { InputError } from '../input-error.component';\n\ndescribe('p-input-error', () => {\n it('renders', async () => {\n const { root } = await newSpecPage({\n components: [InputError],\n html: '<p-input-error></p-input-error>',\n });\n expect(root).toEqualHtml(`\n <p-input-error class=\"p-input-error\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-input-error>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"input-error.component.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/input-error/test/input-error.component.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;EAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,CAAC;MAClC,UAAU,EAAE,CAAC,UAAU,CAAC;MACxB,IAAI,EAAE,iCAAiC;KACvC,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 { InputError } from '../input-error.component';\n\ndescribe('p-input-error', () => {\n\tit('renders', async () => {\n\t\tconst { root } = await newSpecPage({\n\t\t\tcomponents: [InputError],\n\t\t\thtml: '<p-input-error></p-input-error>',\n\t\t});\n\t\texpect(root).toEqualHtml(`\n <p-input-error class=\"p-input-error\">\n <mock:shadow-root>\n </mock:shadow-root>\n </p-input-error>\n `);\n\t});\n});\n"]}
@@ -40,10 +40,10 @@ export class InputGroup {
40
40
  this._forceShowTooltip = false;
41
41
  }
42
42
  /*
43
- With this, we shall hack the system in ways no one would ever have thought.
44
-
45
- <div class="pl-0 pr-0 border-l-0 border-r-0 rounded-tl-none rounded-bl-none rounded-tr-none rounded-br-none"></div>
46
- */
43
+ With this, we shall hack the system in ways no one would ever have thought.
44
+
45
+ <div class="pl-0 pr-0 border-l-0 border-r-0 rounded-tl-none rounded-bl-none rounded-tr-none rounded-br-none"></div>
46
+ */
47
47
  _setInputClasses() {
48
48
  const input = this._el.querySelector(':scope > [slot="input"]');
49
49
  if (!input) {
@@ -180,7 +180,7 @@ export class InputGroup {
180
180
  "mutable": false,
181
181
  "complexType": {
182
182
  "original": "IconVariant",
183
- "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\"",
183
+ "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\"",
184
184
  "references": {
185
185
  "IconVariant": {
186
186
  "location": "import",