@paperless/core 0.1.0-alpha.33 → 0.1.0-alpha.331

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 (661) hide show
  1. package/CHANGELOG.md +3112 -0
  2. package/README.md +9 -1
  3. package/dist/assets/i18n/page-size-select.i18n.en.json +4 -0
  4. package/dist/assets/i18n/page-size-select.i18n.nl.json +4 -0
  5. package/dist/assets/i18n/table-footer.i18n.en.json +3 -0
  6. package/dist/assets/i18n/table-footer.i18n.nl.json +3 -0
  7. package/dist/assets/i18n/table-header.i18n.en.json +6 -0
  8. package/dist/assets/i18n/table-header.i18n.nl.json +6 -0
  9. package/dist/assets/i18n/table.i18n.en.json +13 -0
  10. package/dist/assets/i18n/table.i18n.nl.json +13 -0
  11. package/dist/assets/icons/camera.svg +10 -0
  12. package/dist/assets/icons/filter.svg +6 -13
  13. package/dist/assets/icons/menu.svg +25 -0
  14. package/dist/assets/icons/more.svg +18 -0
  15. package/dist/assets/icons/notification.svg +10 -0
  16. package/dist/assets/icons/reload.svg +10 -0
  17. package/dist/assets/icons/signout.svg +23 -0
  18. package/dist/assets/icons/switch.svg +20 -0
  19. package/dist/assets/illustrations/e-mail.svg +1 -0
  20. package/dist/assets/illustrations/empty-state-overview.svg +65 -0
  21. package/dist/assets/illustrations/empty-state-search.svg +88 -0
  22. package/dist/build/index.esm.js +1 -0
  23. package/dist/build/p-05f73516.entry.js +1 -0
  24. package/dist/build/p-0688d548.entry.js +1 -0
  25. package/dist/build/p-07f28695.entry.js +1 -0
  26. package/dist/build/p-09ea2a1a.js +1 -0
  27. package/dist/build/p-12f5c483.entry.js +1 -0
  28. package/dist/build/p-1ba7cadc.entry.js +1 -0
  29. package/dist/build/p-2e47afc7.entry.js +1 -0
  30. package/dist/build/p-37fa2c13.entry.js +1 -0
  31. package/dist/build/p-3946e0a3.entry.js +1 -0
  32. package/dist/build/p-3a98b145.entry.js +1 -0
  33. package/dist/build/p-43d1544e.entry.js +1 -0
  34. package/dist/build/p-4e650fe4.js +1 -0
  35. package/dist/build/p-4fcd08ce.entry.js +1 -0
  36. package/dist/build/p-529ccaf7.entry.js +1 -0
  37. package/dist/build/p-5b7c22ee.entry.js +1 -0
  38. package/dist/build/p-62d49606.entry.js +1 -0
  39. package/dist/build/p-63de1c3d.entry.js +1 -0
  40. package/dist/build/p-681ed79b.entry.js +1 -0
  41. package/dist/build/p-6c60fd3d.js +1 -0
  42. package/dist/build/p-7df6230f.entry.js +1 -0
  43. package/dist/build/p-8a6728d5.js +1 -0
  44. package/dist/build/p-8c67da86.entry.js +1 -0
  45. package/dist/build/p-91d032b2.entry.js +1 -0
  46. package/dist/build/p-9315c1e2.entry.js +1 -0
  47. package/dist/build/p-98e3dcd7.entry.js +1 -0
  48. package/dist/build/p-ac5a17c4.entry.js +1 -0
  49. package/dist/build/p-b273ac6d.js +1 -0
  50. package/dist/build/p-b4af4b21.entry.js +1 -0
  51. package/dist/build/p-b72559e4.entry.js +1 -0
  52. package/dist/build/p-b8dd503c.entry.js +1 -0
  53. package/dist/build/p-c296a33d.entry.js +1 -0
  54. package/dist/build/p-c80933ab.entry.js +1 -0
  55. package/dist/build/p-c9f2fa8f.js +2 -0
  56. package/dist/build/p-d1022d64.entry.js +1 -0
  57. package/dist/build/p-d2cf5ab2.entry.js +1 -0
  58. package/dist/build/p-d5885f2b.entry.js +1 -0
  59. package/dist/build/p-dbb409ab.entry.js +1 -0
  60. package/dist/build/p-ddd3372b.entry.js +1 -0
  61. package/dist/build/p-e3e3c4d1.entry.js +1 -0
  62. package/dist/build/p-e4bd4022.entry.js +1 -0
  63. package/dist/build/p-e9ed032e.entry.js +1 -0
  64. package/dist/build/p-f1867cb5.entry.js +1 -0
  65. package/dist/build/p-f499f696.entry.js +1 -0
  66. package/dist/build/p-f86fcdf4.js +1 -0
  67. package/dist/build/p-fa3216a5.entry.js +1 -0
  68. package/dist/build/p-fd1e32c1.entry.js +1 -0
  69. package/dist/build/paperless.css +1 -81
  70. package/dist/build/paperless.esm.js +1 -1
  71. package/dist/cjs/child-of-e472f812.js +9 -0
  72. package/dist/cjs/constants-a4459ec9.js +7 -0
  73. package/dist/cjs/index-040ec3f9.js +2481 -0
  74. package/dist/cjs/{index-a46a39a5.js → index-195002a8.js} +662 -261
  75. package/dist/cjs/index.cjs.js +17 -0
  76. package/dist/cjs/loader.cjs.js +3 -3
  77. package/dist/cjs/localization-9e2ac7f3.js +60 -0
  78. package/dist/cjs/object-get-by-path-6dc21ed5.js +12 -0
  79. package/dist/cjs/p-accordion.cjs.entry.js +34 -0
  80. package/dist/cjs/p-avatar-group.cjs.entry.js +20 -0
  81. package/dist/cjs/p-avatar.cjs.entry.js +22 -11
  82. package/dist/cjs/p-backdrop.cjs.entry.js +41 -0
  83. package/dist/cjs/p-button_3.cjs.entry.js +246 -104
  84. package/dist/cjs/p-calendar.cjs.entry.js +709 -0
  85. package/dist/cjs/p-card-body.cjs.entry.js +20 -0
  86. package/dist/cjs/p-card-container.cjs.entry.js +21 -0
  87. package/dist/cjs/p-card-header.cjs.entry.js +22 -0
  88. package/dist/cjs/p-content-slider.cjs.entry.js +210 -0
  89. package/dist/cjs/p-counter.cjs.entry.js +5 -3
  90. package/dist/cjs/p-datepicker.cjs.entry.js +4082 -0
  91. package/dist/cjs/p-divider.cjs.entry.js +6 -3
  92. package/dist/cjs/p-drawer-body_3.cjs.entry.js +49 -0
  93. package/dist/cjs/p-drawer.cjs.entry.js +63 -0
  94. package/dist/cjs/p-dropdown-menu-container.cjs.entry.js +5 -3
  95. package/dist/cjs/p-dropdown_2.cjs.entry.js +165 -0
  96. package/dist/cjs/p-helper_3.cjs.entry.js +204 -0
  97. package/dist/cjs/p-illustration_6.cjs.entry.js +2725 -0
  98. package/dist/cjs/p-info-panel.cjs.entry.js +4 -8
  99. package/dist/cjs/p-label_3.cjs.entry.js +63 -0
  100. package/dist/cjs/p-layout.cjs.entry.js +20 -0
  101. package/dist/cjs/p-modal-body_4.cjs.entry.js +77 -0
  102. package/dist/cjs/p-modal.cjs.entry.js +59 -0
  103. package/dist/cjs/p-navbar.cjs.entry.js +28 -0
  104. package/dist/cjs/p-navigation-item.cjs.entry.js +7 -6
  105. package/dist/cjs/p-page-size-select_3.cjs.entry.js +222 -0
  106. package/dist/cjs/p-profile.cjs.entry.js +43 -0
  107. package/dist/cjs/p-select.cjs.entry.js +183 -0
  108. package/dist/cjs/p-slider-indicator.cjs.entry.js +20 -0
  109. package/dist/cjs/p-status.cjs.entry.js +5 -5
  110. package/dist/cjs/p-stepper-item_2.cjs.entry.js +38 -0
  111. package/dist/cjs/p-stepper.cjs.entry.js +43 -0
  112. package/dist/cjs/p-tab-group.cjs.entry.js +19 -0
  113. package/dist/cjs/p-tab-item.cjs.entry.js +20 -0
  114. package/dist/cjs/p-table-column.cjs.entry.js +26 -0
  115. package/dist/cjs/p-table.cjs.entry.js +341 -0
  116. package/dist/cjs/p-toast-container.cjs.entry.js +20 -0
  117. package/dist/cjs/p-toast.cjs.entry.js +33 -0
  118. package/dist/cjs/paperless.cjs.js +3 -3
  119. package/dist/cjs/{popper-e0c4ed4c.js → popper-d7a0f999.js} +60 -49
  120. package/dist/collection/assets/icons/camera.svg +10 -0
  121. package/dist/collection/assets/icons/filter.svg +6 -13
  122. package/dist/collection/assets/icons/menu.svg +25 -0
  123. package/dist/collection/assets/icons/more.svg +18 -0
  124. package/dist/collection/assets/icons/notification.svg +10 -0
  125. package/dist/collection/assets/icons/reload.svg +10 -0
  126. package/dist/collection/assets/icons/signout.svg +23 -0
  127. package/dist/collection/assets/icons/switch.svg +20 -0
  128. package/dist/collection/assets/illustrations/e-mail.svg +1 -0
  129. package/dist/collection/assets/illustrations/empty-state-overview.svg +65 -0
  130. package/dist/collection/assets/illustrations/empty-state-search.svg +88 -0
  131. package/dist/collection/collection-manifest.json +43 -3
  132. package/dist/collection/components/atoms/avatar/avatar.component.css +1 -31
  133. package/dist/collection/components/atoms/avatar/avatar.component.js +110 -90
  134. package/dist/collection/components/atoms/avatar-group/avatar-group.component.css +1 -0
  135. package/dist/collection/components/atoms/avatar-group/avatar-group.component.js +41 -0
  136. package/dist/collection/components/atoms/backdrop/backdrop.component.css +1 -0
  137. package/dist/collection/components/atoms/backdrop/backdrop.component.js +148 -0
  138. package/dist/collection/components/atoms/button/button.component.css +1 -79
  139. package/dist/collection/components/atoms/button/button.component.js +305 -251
  140. package/dist/collection/components/atoms/card-body/card-body.component.css +1 -0
  141. package/dist/collection/components/atoms/card-body/card-body.component.js +42 -0
  142. package/dist/collection/components/atoms/card-container/card-container.component.css +1 -0
  143. package/dist/collection/components/atoms/card-container/card-container.component.js +62 -0
  144. package/dist/collection/components/atoms/card-header/card-header.component.css +1 -0
  145. package/dist/collection/components/atoms/card-header/card-header.component.js +61 -0
  146. package/dist/collection/components/atoms/counter/counter.component.css +1 -5
  147. package/dist/collection/components/atoms/counter/counter.component.js +56 -9
  148. package/dist/collection/components/atoms/divider/divider.component.css +1 -3
  149. package/dist/collection/components/atoms/divider/divider.component.js +15 -8
  150. package/dist/collection/components/atoms/drawer-body/drawer-body.component.css +1 -0
  151. package/dist/collection/components/atoms/drawer-body/drawer-body.component.js +43 -0
  152. package/dist/collection/components/atoms/drawer-container/drawer-container.component.css +1 -0
  153. package/dist/collection/components/atoms/drawer-container/drawer-container.component.js +47 -0
  154. package/dist/collection/components/atoms/drawer-header/drawer-header.component.css +1 -0
  155. package/dist/collection/components/atoms/drawer-header/drawer-header.component.js +65 -0
  156. package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.css +1 -5
  157. package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js +56 -9
  158. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +1 -13
  159. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +74 -30
  160. package/dist/collection/components/atoms/helper/helper.component.css +1 -7
  161. package/dist/collection/components/atoms/helper/helper.component.js +42 -12
  162. package/dist/collection/components/atoms/icon/icon.component.css +1 -0
  163. package/dist/collection/components/atoms/icon/icon.component.js +138 -91
  164. package/dist/collection/components/atoms/illustration/illustration.component.js +28 -23
  165. package/dist/collection/components/atoms/info-panel/info-panel.component.css +1 -28
  166. package/dist/collection/components/atoms/info-panel/info-panel.component.js +85 -89
  167. package/dist/collection/components/atoms/label/label.component.css +1 -0
  168. package/dist/collection/components/atoms/label/label.component.js +170 -0
  169. package/dist/collection/components/atoms/layout/layout.component.css +1 -0
  170. package/dist/collection/components/atoms/layout/layout.component.js +43 -0
  171. package/dist/collection/components/atoms/loader/loader.component.css +1 -26
  172. package/dist/collection/components/atoms/loader/loader.component.js +112 -114
  173. package/dist/collection/components/atoms/modal-body/modal-body.component.css +1 -0
  174. package/dist/collection/components/atoms/modal-body/modal-body.component.js +62 -0
  175. package/dist/collection/components/atoms/modal-container/modal-container.component.css +1 -0
  176. package/dist/collection/components/atoms/modal-container/modal-container.component.js +74 -0
  177. package/dist/collection/components/atoms/modal-footer/modal-footer.component.css +1 -0
  178. package/dist/collection/components/atoms/modal-footer/modal-footer.component.js +18 -0
  179. package/dist/collection/components/atoms/modal-header/modal-header.component.css +1 -0
  180. package/dist/collection/components/atoms/modal-header/modal-header.component.js +65 -0
  181. package/dist/collection/components/atoms/pagination-item/pagination-item.component.css +1 -16
  182. package/dist/collection/components/atoms/pagination-item/pagination-item.component.js +34 -32
  183. package/dist/collection/components/atoms/segment-container/segment-container.component.css +1 -5
  184. package/dist/collection/components/atoms/segment-container/segment-container.component.js +12 -9
  185. package/dist/collection/components/atoms/segment-item/segment-item.component.css +1 -21
  186. package/dist/collection/components/atoms/segment-item/segment-item.component.js +98 -87
  187. package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.css +1 -0
  188. package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.js +43 -0
  189. package/dist/collection/components/atoms/status/status.component.css +1 -16
  190. package/dist/collection/components/atoms/status/status.component.js +98 -89
  191. package/dist/collection/components/atoms/stepper-item/stepper-item.component.css +1 -0
  192. package/dist/collection/components/atoms/stepper-item/stepper-item.component.js +100 -0
  193. package/dist/collection/components/atoms/stepper-line/stepper-line.component.css +1 -0
  194. package/dist/collection/components/atoms/stepper-line/stepper-line.component.js +62 -0
  195. package/dist/collection/components/atoms/tab-group/tab-group.component.css +1 -0
  196. package/dist/collection/components/atoms/tab-group/tab-group.component.js +18 -0
  197. package/dist/collection/components/atoms/tab-item/tab-item.component.css +1 -0
  198. package/dist/collection/components/atoms/tab-item/tab-item.component.js +43 -0
  199. package/dist/collection/components/atoms/table-container/table-container.component.css +1 -0
  200. package/dist/collection/components/atoms/table-container/table-container.component.js +18 -0
  201. package/dist/collection/components/atoms/toast-container/toast-container.component.css +1 -0
  202. package/dist/collection/components/atoms/toast-container/toast-container.component.js +43 -0
  203. package/dist/collection/components/atoms/tooltip/tooltip.component.css +1 -40
  204. package/dist/collection/components/atoms/tooltip/tooltip.component.js +196 -164
  205. package/dist/collection/components/helpers/table-column/table-column.component.js +150 -0
  206. package/dist/collection/components/molecules/accordion/accordion.component.css +1 -0
  207. package/dist/collection/components/molecules/accordion/accordion.component.js +127 -0
  208. package/dist/collection/components/molecules/calendar/calendar.component.css +1 -0
  209. package/dist/collection/components/molecules/calendar/calendar.component.js +503 -0
  210. package/dist/collection/components/molecules/content-slider/content-slider.component.css +1 -0
  211. package/dist/collection/components/molecules/content-slider/content-slider.component.js +316 -0
  212. package/dist/collection/components/molecules/datepicker/datepicker.component.css +1 -0
  213. package/dist/collection/components/molecules/datepicker/datepicker.component.js +507 -0
  214. package/dist/collection/components/molecules/dropdown/dropdown.component.css +1 -9
  215. package/dist/collection/components/molecules/dropdown/dropdown.component.js +266 -127
  216. package/dist/collection/components/molecules/input-group/input-group.component.css +1 -0
  217. package/dist/collection/components/molecules/input-group/input-group.component.js +337 -0
  218. package/dist/collection/components/molecules/navigation-item/navigation-item.component.css +1 -28
  219. package/dist/collection/components/molecules/navigation-item/navigation-item.component.js +106 -104
  220. package/dist/collection/components/molecules/page-size-select/constants.js +2 -0
  221. package/dist/collection/components/molecules/page-size-select/page-size-select.component.js +204 -0
  222. package/dist/collection/components/molecules/pagination/pagination.component.css +1 -3
  223. package/dist/collection/components/molecules/pagination/pagination.component.js +118 -94
  224. package/dist/collection/components/molecules/profile/profile.component.css +1 -0
  225. package/dist/collection/components/molecules/profile/profile.component.js +89 -0
  226. package/dist/collection/components/molecules/select/select.component.css +1 -0
  227. package/dist/collection/components/molecules/select/select.component.js +570 -0
  228. package/dist/collection/components/molecules/stepper/stepper.component.css +1 -0
  229. package/dist/collection/components/molecules/stepper/stepper.component.js +84 -0
  230. package/dist/collection/components/molecules/table-cell/table-cell.component.css +1 -0
  231. package/dist/collection/components/molecules/table-cell/table-cell.component.js +262 -0
  232. package/dist/collection/components/molecules/table-footer/table-footer.component.css +1 -0
  233. package/dist/collection/components/molecules/table-footer/table-footer.component.js +275 -0
  234. package/dist/collection/components/molecules/table-header/table-header.component.css +1 -0
  235. package/dist/collection/components/molecules/table-header/table-header.component.js +380 -0
  236. package/dist/collection/components/molecules/table-row/table-row.component.css +1 -0
  237. package/dist/collection/components/molecules/table-row/table-row.component.js +64 -0
  238. package/dist/collection/components/molecules/toast/toast.component.css +1 -0
  239. package/dist/collection/components/molecules/toast/toast.component.js +196 -0
  240. package/dist/collection/components/organisms/drawer/drawer.component.css +1 -0
  241. package/dist/collection/components/organisms/drawer/drawer.component.js +233 -0
  242. package/dist/collection/components/organisms/modal/modal.component.js +258 -0
  243. package/dist/collection/components/organisms/navbar/navbar.component.css +1 -0
  244. package/dist/collection/components/organisms/navbar/navbar.component.js +89 -0
  245. package/dist/collection/components/organisms/table/table.component.css +1 -0
  246. package/dist/collection/components/organisms/table/table.component.js +1164 -0
  247. package/dist/collection/index.js +2 -1
  248. package/dist/collection/tailwind/animation.js +87 -0
  249. package/dist/collection/tailwind/backdrop-blur.js +3 -0
  250. package/dist/collection/tailwind/border-radius.js +1 -0
  251. package/dist/collection/tailwind/height.js +5 -0
  252. package/dist/collection/tailwind/screens.js +8 -0
  253. package/dist/collection/tailwind/shadows.js +11 -5
  254. package/dist/collection/tailwind/spacing.js +10 -0
  255. package/dist/collection/tailwind/typography.js +21 -0
  256. package/dist/collection/tailwind/width.js +23 -0
  257. package/dist/collection/tailwind/z-index.js +17 -0
  258. package/dist/collection/tailwind.config.js +29 -14
  259. package/dist/collection/types/index.js +2 -0
  260. package/dist/collection/types/table.js +1 -0
  261. package/dist/collection/types/tailwind.js +1 -0
  262. package/dist/collection/utils/icons.js +14 -0
  263. package/dist/collection/utils/illustrations.js +6 -0
  264. package/dist/collection/utils/index.js +6 -0
  265. package/dist/collection/utils/localization.js +55 -0
  266. package/dist/collection/utils/object-get-by-path.js +8 -0
  267. package/dist/collection/utils/transformers.js +4 -0
  268. package/dist/components/backdrop.component.js +57 -0
  269. package/dist/components/button.component.js +98 -0
  270. package/dist/components/calendar.component.js +3197 -0
  271. package/dist/components/counter.component.js +8 -3
  272. package/dist/components/divider.component.js +33 -0
  273. package/dist/components/drawer-body.component.js +33 -0
  274. package/dist/components/drawer-container.component.js +32 -0
  275. package/dist/components/drawer-header.component.js +52 -0
  276. package/dist/components/dropdown-menu-container.component.js +8 -3
  277. package/dist/components/dropdown-menu-item.component.js +43 -0
  278. package/dist/components/dropdown.component.js +182 -0
  279. package/dist/components/helper.component.js +39 -0
  280. package/dist/components/icon.component.js +182 -27
  281. package/dist/{cjs/p-illustration.cjs.entry.js → components/illustration.component.js} +188 -16
  282. package/dist/components/index.d.ts +59 -19
  283. package/dist/components/index.js +50 -0
  284. package/dist/components/input-group.component.js +116 -0
  285. package/dist/components/label.component.js +52 -0
  286. package/dist/components/loader.component.js +9 -13
  287. package/dist/components/localization.js +57 -0
  288. package/dist/components/modal-body.component.js +35 -0
  289. package/dist/components/modal-container.component.js +47 -0
  290. package/dist/components/modal-footer.component.js +36 -0
  291. package/dist/components/modal-header.component.js +52 -0
  292. package/dist/components/p-accordion.d.ts +11 -0
  293. package/dist/components/p-accordion.js +65 -0
  294. package/dist/components/p-avatar-group.d.ts +11 -0
  295. package/dist/components/p-avatar-group.js +35 -0
  296. package/dist/components/p-avatar.js +24 -14
  297. package/dist/components/p-backdrop.d.ts +11 -0
  298. package/dist/components/p-backdrop.js +6 -0
  299. package/dist/components/p-button.js +1 -102
  300. package/dist/components/p-calendar.d.ts +11 -0
  301. package/dist/components/p-calendar.js +6 -0
  302. package/dist/components/p-card-body.d.ts +11 -0
  303. package/dist/components/p-card-body.js +35 -0
  304. package/dist/components/p-card-container.d.ts +11 -0
  305. package/dist/components/p-card-container.js +38 -0
  306. package/dist/components/p-card-header.d.ts +11 -0
  307. package/dist/components/p-card-header.js +44 -0
  308. package/dist/components/p-content-slider.d.ts +11 -0
  309. package/dist/components/p-content-slider.js +239 -0
  310. package/dist/components/p-datepicker.d.ts +11 -0
  311. package/dist/components/p-datepicker.js +4156 -0
  312. package/dist/components/p-divider.js +1 -28
  313. package/dist/components/p-drawer-body.d.ts +11 -0
  314. package/dist/components/p-drawer-body.js +6 -0
  315. package/dist/components/p-drawer-container.d.ts +11 -0
  316. package/dist/components/p-drawer-container.js +6 -0
  317. package/dist/components/p-drawer-header.d.ts +11 -0
  318. package/dist/components/p-drawer-header.js +6 -0
  319. package/dist/components/p-drawer.d.ts +11 -0
  320. package/dist/components/p-drawer.js +128 -0
  321. package/dist/components/p-dropdown-menu-item.js +1 -34
  322. package/dist/components/p-dropdown.js +1 -161
  323. package/dist/components/p-helper.js +1 -34
  324. package/dist/components/p-illustration.js +1 -1432
  325. package/dist/components/p-info-panel.js +3 -7
  326. package/dist/components/p-input-group.d.ts +11 -0
  327. package/dist/components/p-input-group.js +6 -0
  328. package/dist/components/p-label.d.ts +11 -0
  329. package/dist/components/p-label.js +6 -0
  330. package/dist/components/p-layout.d.ts +11 -0
  331. package/dist/components/p-layout.js +36 -0
  332. package/dist/components/p-modal-body.d.ts +11 -0
  333. package/dist/components/p-modal-body.js +6 -0
  334. package/dist/components/p-modal-container.d.ts +11 -0
  335. package/dist/components/p-modal-container.js +6 -0
  336. package/dist/components/p-modal-footer.d.ts +11 -0
  337. package/dist/components/p-modal-footer.js +6 -0
  338. package/dist/components/p-modal-header.d.ts +11 -0
  339. package/dist/components/p-modal-header.js +6 -0
  340. package/dist/components/p-modal.d.ts +11 -0
  341. package/dist/components/p-modal.js +138 -0
  342. package/dist/components/p-navbar.d.ts +11 -0
  343. package/dist/components/p-navbar.js +70 -0
  344. package/dist/components/p-navigation-item.js +6 -5
  345. package/dist/components/p-page-size-select.d.ts +11 -0
  346. package/dist/components/p-page-size-select.js +6 -0
  347. package/dist/components/p-pagination.js +1 -195
  348. package/dist/components/p-profile.d.ts +11 -0
  349. package/dist/components/p-profile.js +79 -0
  350. package/dist/components/p-segment-container.js +1 -27
  351. package/dist/components/p-segment-item.js +1 -49
  352. package/dist/components/p-select.d.ts +11 -0
  353. package/dist/components/p-select.js +265 -0
  354. package/dist/components/p-slider-indicator.d.ts +11 -0
  355. package/dist/components/p-slider-indicator.js +6 -0
  356. package/dist/components/p-status.js +4 -4
  357. package/dist/components/p-stepper-item.d.ts +11 -0
  358. package/dist/components/p-stepper-item.js +6 -0
  359. package/dist/components/p-stepper-line.d.ts +11 -0
  360. package/dist/components/p-stepper-line.js +6 -0
  361. package/dist/components/p-stepper.d.ts +11 -0
  362. package/dist/components/p-stepper.js +78 -0
  363. package/dist/components/p-tab-group.d.ts +11 -0
  364. package/dist/components/p-tab-group.js +39 -0
  365. package/dist/components/p-tab-item.d.ts +11 -0
  366. package/dist/components/p-tab-item.js +36 -0
  367. package/dist/components/p-table-cell.d.ts +11 -0
  368. package/dist/components/p-table-cell.js +6 -0
  369. package/dist/components/p-table-column.d.ts +11 -0
  370. package/dist/components/p-table-column.js +46 -0
  371. package/dist/components/p-table-container.d.ts +11 -0
  372. package/dist/components/p-table-container.js +6 -0
  373. package/dist/components/p-table-footer.d.ts +11 -0
  374. package/dist/components/p-table-footer.js +6 -0
  375. package/dist/components/p-table-header.d.ts +11 -0
  376. package/dist/components/p-table-header.js +6 -0
  377. package/dist/components/p-table-row.d.ts +11 -0
  378. package/dist/components/p-table-row.js +6 -0
  379. package/dist/components/p-table.d.ts +11 -0
  380. package/dist/components/p-table.js +521 -0
  381. package/dist/components/p-toast-container.d.ts +11 -0
  382. package/dist/components/p-toast-container.js +36 -0
  383. package/dist/components/p-toast.d.ts +11 -0
  384. package/dist/components/p-toast.js +73 -0
  385. package/dist/components/page-size-select.component.js +105 -0
  386. package/dist/components/pagination-item.component.js +1 -4
  387. package/dist/components/pagination.component.js +194 -0
  388. package/dist/components/popper.js +60 -49
  389. package/dist/components/segment-container.component.js +29 -0
  390. package/dist/components/segment-item.component.js +51 -0
  391. package/dist/components/slider-indicator.component.js +33 -0
  392. package/dist/components/stepper-item.component.js +45 -0
  393. package/dist/components/stepper-line.component.js +35 -0
  394. package/dist/components/table-cell.component.js +143 -0
  395. package/dist/components/table-container.component.js +30 -0
  396. package/dist/components/table-footer.component.js +127 -0
  397. package/dist/components/table-header.component.js +1048 -0
  398. package/dist/components/table-row.component.js +43 -0
  399. package/dist/components/tooltip.component.js +16 -27
  400. package/dist/esm/child-of-90a8c4b5.js +7 -0
  401. package/dist/esm/constants-826f9460.js +4 -0
  402. package/dist/esm/index-340e085c.js +2458 -0
  403. package/dist/esm/{index-a68e547b.js → index-8170b4fb.js} +662 -261
  404. package/dist/esm/index.js +9 -0
  405. package/dist/esm/loader.js +3 -3
  406. package/dist/esm/localization-901dc2d3.js +57 -0
  407. package/dist/esm/object-get-by-path-d6427a61.js +10 -0
  408. package/dist/esm/p-accordion.entry.js +30 -0
  409. package/dist/esm/p-avatar-group.entry.js +16 -0
  410. package/dist/esm/p-avatar.entry.js +22 -11
  411. package/dist/esm/p-backdrop.entry.js +37 -0
  412. package/dist/esm/p-button_3.entry.js +246 -104
  413. package/dist/esm/p-calendar.entry.js +705 -0
  414. package/dist/esm/p-card-body.entry.js +16 -0
  415. package/dist/esm/p-card-container.entry.js +17 -0
  416. package/dist/esm/p-card-header.entry.js +18 -0
  417. package/dist/esm/p-content-slider.entry.js +206 -0
  418. package/dist/esm/p-counter.entry.js +5 -3
  419. package/dist/esm/p-datepicker.entry.js +4078 -0
  420. package/dist/esm/p-divider.entry.js +6 -3
  421. package/dist/esm/p-drawer-body_3.entry.js +43 -0
  422. package/dist/esm/p-drawer.entry.js +59 -0
  423. package/dist/esm/p-dropdown-menu-container.entry.js +5 -3
  424. package/dist/esm/p-dropdown_2.entry.js +160 -0
  425. package/dist/esm/p-helper_3.entry.js +198 -0
  426. package/dist/esm/{p-illustration.entry.js → p-illustration_6.entry.js} +1305 -8
  427. package/dist/esm/p-info-panel.entry.js +4 -8
  428. package/dist/esm/p-label_3.entry.js +57 -0
  429. package/dist/esm/p-layout.entry.js +16 -0
  430. package/dist/esm/p-modal-body_4.entry.js +70 -0
  431. package/dist/esm/p-modal.entry.js +55 -0
  432. package/dist/esm/p-navbar.entry.js +24 -0
  433. package/dist/esm/p-navigation-item.entry.js +7 -6
  434. package/dist/esm/p-page-size-select_3.entry.js +216 -0
  435. package/dist/esm/p-profile.entry.js +39 -0
  436. package/dist/esm/p-select.entry.js +179 -0
  437. package/dist/esm/p-slider-indicator.entry.js +16 -0
  438. package/dist/esm/p-status.entry.js +5 -5
  439. package/dist/esm/p-stepper-item_2.entry.js +33 -0
  440. package/dist/esm/p-stepper.entry.js +39 -0
  441. package/dist/esm/p-tab-group.entry.js +15 -0
  442. package/dist/esm/p-tab-item.entry.js +16 -0
  443. package/dist/esm/p-table-column.entry.js +22 -0
  444. package/dist/esm/p-table.entry.js +337 -0
  445. package/dist/esm/p-toast-container.entry.js +16 -0
  446. package/dist/esm/p-toast.entry.js +29 -0
  447. package/dist/esm/paperless.js +3 -3
  448. package/dist/esm/polyfills/core-js.js +0 -0
  449. package/dist/esm/polyfills/css-shim.js +1 -1
  450. package/dist/esm/polyfills/dom.js +0 -0
  451. package/dist/esm/polyfills/es5-html-element.js +0 -0
  452. package/dist/esm/polyfills/index.js +0 -0
  453. package/dist/esm/polyfills/system.js +0 -0
  454. package/dist/esm/{popper-41c6f9cd.js → popper-42db9fbd.js} +60 -49
  455. package/dist/index.html +1 -1
  456. package/dist/paperless/index.esm.js +1 -0
  457. package/dist/paperless/p-05f73516.entry.js +1 -0
  458. package/dist/paperless/p-0688d548.entry.js +1 -0
  459. package/dist/paperless/p-07f28695.entry.js +1 -0
  460. package/dist/paperless/p-09ea2a1a.js +1 -0
  461. package/dist/paperless/p-12f5c483.entry.js +1 -0
  462. package/dist/paperless/p-1ba7cadc.entry.js +1 -0
  463. package/dist/paperless/p-2e47afc7.entry.js +1 -0
  464. package/dist/paperless/p-37fa2c13.entry.js +1 -0
  465. package/dist/paperless/p-3946e0a3.entry.js +1 -0
  466. package/dist/paperless/p-3a98b145.entry.js +1 -0
  467. package/dist/paperless/p-43d1544e.entry.js +1 -0
  468. package/dist/paperless/p-4e650fe4.js +1 -0
  469. package/dist/paperless/p-4fcd08ce.entry.js +1 -0
  470. package/dist/paperless/p-529ccaf7.entry.js +1 -0
  471. package/dist/paperless/p-5b7c22ee.entry.js +1 -0
  472. package/dist/paperless/p-62d49606.entry.js +1 -0
  473. package/dist/paperless/p-63de1c3d.entry.js +1 -0
  474. package/dist/paperless/p-681ed79b.entry.js +1 -0
  475. package/dist/paperless/p-6c60fd3d.js +1 -0
  476. package/dist/paperless/p-7df6230f.entry.js +1 -0
  477. package/dist/paperless/p-8a6728d5.js +1 -0
  478. package/dist/paperless/p-8c67da86.entry.js +1 -0
  479. package/dist/paperless/p-91d032b2.entry.js +1 -0
  480. package/dist/paperless/p-9315c1e2.entry.js +1 -0
  481. package/dist/paperless/p-98e3dcd7.entry.js +1 -0
  482. package/dist/paperless/p-ac5a17c4.entry.js +1 -0
  483. package/dist/paperless/p-b273ac6d.js +1 -0
  484. package/dist/paperless/p-b4af4b21.entry.js +1 -0
  485. package/dist/paperless/p-b72559e4.entry.js +1 -0
  486. package/dist/paperless/p-b8dd503c.entry.js +1 -0
  487. package/dist/paperless/p-c296a33d.entry.js +1 -0
  488. package/dist/paperless/p-c80933ab.entry.js +1 -0
  489. package/dist/paperless/p-c9f2fa8f.js +2 -0
  490. package/dist/paperless/p-d1022d64.entry.js +1 -0
  491. package/dist/paperless/p-d2cf5ab2.entry.js +1 -0
  492. package/dist/paperless/p-d5885f2b.entry.js +1 -0
  493. package/dist/paperless/p-dbb409ab.entry.js +1 -0
  494. package/dist/paperless/p-ddd3372b.entry.js +1 -0
  495. package/dist/paperless/p-e3e3c4d1.entry.js +1 -0
  496. package/dist/paperless/p-e4bd4022.entry.js +1 -0
  497. package/dist/paperless/p-e9ed032e.entry.js +1 -0
  498. package/dist/paperless/p-f1867cb5.entry.js +1 -0
  499. package/dist/paperless/p-f499f696.entry.js +1 -0
  500. package/dist/paperless/p-f86fcdf4.js +1 -0
  501. package/dist/paperless/p-fa3216a5.entry.js +1 -0
  502. package/dist/paperless/p-fd1e32c1.entry.js +1 -0
  503. package/dist/paperless/paperless.css +673 -26741
  504. package/dist/paperless/paperless.esm.js +1 -1
  505. package/dist/style/_fonts.scss +70 -0
  506. package/dist/style/_helpers.scss +5 -0
  507. package/dist/style/_reset.scss +31 -0
  508. package/dist/style/_tailwind.scss +3 -0
  509. package/dist/style/_typograhpy.scss +29 -0
  510. package/dist/style/_variables.scss +2 -0
  511. package/dist/style/form/_checkbox.scss +111 -0
  512. package/dist/style/form/_input.scss +22 -0
  513. package/dist/style/form/_mixins.scss +107 -0
  514. package/dist/style/form/_radio.scss +58 -0
  515. package/dist/style/form/_textarea.scss +18 -0
  516. package/dist/style/form/index.scss +4 -0
  517. package/dist/style/paperless.scss +12 -0
  518. package/dist/sw.js +2 -644
  519. package/dist/sw.js.map +1 -0
  520. package/dist/tailwind/animation.js +87 -0
  521. package/dist/tailwind/backdrop-blur.js +3 -0
  522. package/dist/tailwind/border-radius.js +11 -0
  523. package/dist/tailwind/colors.js +52 -0
  524. package/dist/tailwind/height.js +5 -0
  525. package/dist/tailwind/rotate.js +8 -0
  526. package/dist/tailwind/scale.js +3 -0
  527. package/dist/tailwind/screens.js +8 -0
  528. package/dist/tailwind/shadows.js +13 -0
  529. package/dist/tailwind/spacing.js +10 -0
  530. package/dist/tailwind/typography.js +21 -0
  531. package/dist/tailwind/width.js +23 -0
  532. package/dist/tailwind/z-index.js +17 -0
  533. package/dist/tailwind.config.js +29 -14
  534. package/dist/types/components/atoms/avatar/avatar.component.d.ts +3 -1
  535. package/dist/types/components/atoms/avatar-group/avatar-group.component.d.ts +7 -0
  536. package/dist/types/components/atoms/backdrop/backdrop.component.d.ts +31 -0
  537. package/dist/types/components/atoms/button/button.component.d.ts +14 -1
  538. package/dist/types/components/atoms/card-body/card-body.component.d.ts +7 -0
  539. package/dist/types/components/atoms/card-container/card-container.component.d.ts +11 -0
  540. package/dist/types/components/atoms/card-header/card-header.component.d.ts +11 -0
  541. package/dist/types/components/atoms/counter/counter.component.d.ts +8 -0
  542. package/dist/types/components/atoms/divider/divider.component.d.ts +4 -0
  543. package/dist/types/components/atoms/drawer-body/drawer-body.component.d.ts +7 -0
  544. package/dist/types/components/atoms/drawer-container/drawer-container.component.d.ts +7 -0
  545. package/dist/types/components/atoms/drawer-header/drawer-header.component.d.ts +12 -0
  546. package/dist/types/components/atoms/dropdown-menu-container/dropdown-menu-container.component.d.ts +8 -0
  547. package/dist/types/components/atoms/dropdown-menu-item/dropdown-menu-item.component.d.ts +9 -0
  548. package/dist/types/components/atoms/helper/helper.component.d.ts +5 -0
  549. package/dist/types/components/atoms/icon/icon.component.d.ts +3 -3
  550. package/dist/types/components/atoms/label/label.component.d.ts +33 -0
  551. package/dist/types/components/atoms/layout/layout.component.d.ts +7 -0
  552. package/dist/types/components/atoms/loader/loader.component.d.ts +1 -1
  553. package/dist/types/components/atoms/modal-body/modal-body.component.d.ts +11 -0
  554. package/dist/types/components/atoms/modal-container/modal-container.component.d.ts +11 -0
  555. package/dist/types/components/atoms/modal-footer/modal-footer.component.d.ts +3 -0
  556. package/dist/types/components/atoms/modal-header/modal-header.component.d.ts +12 -0
  557. package/dist/types/components/atoms/segment-item/segment-item.component.d.ts +2 -1
  558. package/dist/types/components/atoms/slider-indicator/slider-indicator.component.d.ts +7 -0
  559. package/dist/types/components/atoms/status/status.component.d.ts +2 -1
  560. package/dist/types/components/atoms/stepper-item/stepper-item.component.d.ts +19 -0
  561. package/dist/types/components/atoms/stepper-line/stepper-line.component.d.ts +11 -0
  562. package/dist/types/components/atoms/tab-group/tab-group.component.d.ts +3 -0
  563. package/dist/types/components/atoms/tab-item/tab-item.component.d.ts +7 -0
  564. package/dist/types/components/atoms/table-container/table-container.component.d.ts +3 -0
  565. package/dist/types/components/atoms/toast-container/toast-container.component.d.ts +7 -0
  566. package/dist/types/components/atoms/tooltip/tooltip.component.d.ts +11 -2
  567. package/dist/types/components/helpers/table-column/table-column.component.d.ts +34 -0
  568. package/dist/types/components/molecules/accordion/accordion.component.d.ts +25 -0
  569. package/dist/types/components/molecules/calendar/calendar.component.d.ts +76 -0
  570. package/dist/types/components/molecules/content-slider/content-slider.component.d.ts +53 -0
  571. package/dist/types/components/molecules/datepicker/datepicker.component.d.ts +93 -0
  572. package/dist/types/components/molecules/dropdown/dropdown.component.d.ts +30 -3
  573. package/dist/types/components/molecules/input-group/input-group.component.d.ts +67 -0
  574. package/dist/types/components/molecules/page-size-select/constants.d.ts +2 -0
  575. package/dist/types/components/molecules/page-size-select/page-size-select.component.d.ts +50 -0
  576. package/dist/types/components/molecules/pagination/pagination.component.d.ts +7 -0
  577. package/dist/types/components/molecules/profile/profile.component.d.ts +20 -0
  578. package/dist/types/components/molecules/select/select.component.d.ts +115 -0
  579. package/dist/types/components/molecules/stepper/stepper.component.d.ts +18 -0
  580. package/dist/types/components/molecules/table-cell/table-cell.component.d.ts +42 -0
  581. package/dist/types/components/molecules/table-footer/table-footer.component.d.ts +63 -0
  582. package/dist/types/components/molecules/table-header/table-header.component.d.ts +87 -0
  583. package/dist/types/components/molecules/table-row/table-row.component.d.ts +11 -0
  584. package/dist/types/components/molecules/toast/toast.component.d.ts +39 -0
  585. package/dist/types/components/organisms/drawer/drawer.component.d.ts +52 -0
  586. package/dist/types/components/organisms/modal/modal.component.d.ts +58 -0
  587. package/dist/types/components/organisms/navbar/navbar.component.d.ts +14 -0
  588. package/dist/types/components/organisms/table/table.component.d.ts +214 -0
  589. package/dist/types/components.d.ts +2829 -327
  590. package/dist/types/index.d.ts +2 -0
  591. package/dist/types/stencil-public-runtime.d.ts +20 -4
  592. package/dist/types/types/index.d.ts +2 -0
  593. package/dist/types/types/table.d.ts +27 -0
  594. package/dist/types/types/tailwind.d.ts +2 -0
  595. package/dist/types/utils/icons.d.ts +7 -0
  596. package/dist/types/utils/illustrations.d.ts +3 -0
  597. package/dist/types/utils/index.d.ts +6 -0
  598. package/dist/types/utils/localization.d.ts +2 -0
  599. package/dist/types/utils/object-get-by-path.d.ts +1 -0
  600. package/dist/types/utils/transformers.d.ts +2 -0
  601. package/dist/workbox-5b279812.js +2 -0
  602. package/dist/workbox-5b279812.js.map +1 -0
  603. package/loader/package.json +1 -0
  604. package/package.json +65 -61
  605. package/dist/build/p-17c11169.entry.js +0 -1
  606. package/dist/build/p-41e5458b.entry.js +0 -1
  607. package/dist/build/p-42dab9d4.entry.js +0 -1
  608. package/dist/build/p-47b52f92.entry.js +0 -1
  609. package/dist/build/p-5ec6ea71.entry.js +0 -1
  610. package/dist/build/p-75f909ab.entry.js +0 -1
  611. package/dist/build/p-76464e0b.js +0 -2
  612. package/dist/build/p-8501ba07.entry.js +0 -1
  613. package/dist/build/p-87356769.entry.js +0 -1
  614. package/dist/build/p-9513868f.entry.js +0 -1
  615. package/dist/build/p-a669807e.entry.js +0 -1
  616. package/dist/build/p-a7086ffa.js +0 -1
  617. package/dist/build/p-aa28fef8.entry.js +0 -1
  618. package/dist/build/p-aae3d4f0.entry.js +0 -1
  619. package/dist/build/p-adcb0b93.entry.js +0 -1
  620. package/dist/build/p-bbec0e86.entry.js +0 -1
  621. package/dist/build/p-e7019eab.entry.js +0 -1
  622. package/dist/build/p-f689996b.entry.js +0 -1
  623. package/dist/build/p-faa4ee42.entry.js +0 -1
  624. package/dist/cjs/p-dropdown-menu-item.cjs.entry.js +0 -23
  625. package/dist/cjs/p-dropdown.cjs.entry.js +0 -141
  626. package/dist/cjs/p-helper.cjs.entry.js +0 -19
  627. package/dist/cjs/p-pagination-item.cjs.entry.js +0 -23
  628. package/dist/cjs/p-pagination.cjs.entry.js +0 -171
  629. package/dist/cjs/p-segment-container.cjs.entry.js +0 -19
  630. package/dist/cjs/p-segment-item.cjs.entry.js +0 -29
  631. package/dist/cjs/p-tooltip.cjs.entry.js +0 -137
  632. package/dist/collection/tailwind/grid.js +0 -26
  633. package/dist/collection/utils/utils.js +0 -3
  634. package/dist/esm/p-dropdown-menu-item.entry.js +0 -19
  635. package/dist/esm/p-dropdown.entry.js +0 -137
  636. package/dist/esm/p-helper.entry.js +0 -15
  637. package/dist/esm/p-pagination-item.entry.js +0 -19
  638. package/dist/esm/p-pagination.entry.js +0 -167
  639. package/dist/esm/p-segment-container.entry.js +0 -15
  640. package/dist/esm/p-segment-item.entry.js +0 -25
  641. package/dist/esm/p-tooltip.entry.js +0 -133
  642. package/dist/paperless/p-17c11169.entry.js +0 -1
  643. package/dist/paperless/p-41e5458b.entry.js +0 -1
  644. package/dist/paperless/p-42dab9d4.entry.js +0 -1
  645. package/dist/paperless/p-47b52f92.entry.js +0 -1
  646. package/dist/paperless/p-5ec6ea71.entry.js +0 -1
  647. package/dist/paperless/p-75f909ab.entry.js +0 -1
  648. package/dist/paperless/p-76464e0b.js +0 -2
  649. package/dist/paperless/p-8501ba07.entry.js +0 -1
  650. package/dist/paperless/p-87356769.entry.js +0 -1
  651. package/dist/paperless/p-9513868f.entry.js +0 -1
  652. package/dist/paperless/p-a669807e.entry.js +0 -1
  653. package/dist/paperless/p-a7086ffa.js +0 -1
  654. package/dist/paperless/p-aa28fef8.entry.js +0 -1
  655. package/dist/paperless/p-aae3d4f0.entry.js +0 -1
  656. package/dist/paperless/p-adcb0b93.entry.js +0 -1
  657. package/dist/paperless/p-bbec0e86.entry.js +0 -1
  658. package/dist/paperless/p-e7019eab.entry.js +0 -1
  659. package/dist/paperless/p-f689996b.entry.js +0 -1
  660. package/dist/paperless/p-faa4ee42.entry.js +0 -1
  661. package/dist/types/utils/utils.d.ts +0 -1
@@ -1,5 +1,13 @@
1
1
  const NAMESPACE = 'paperless';
2
2
 
3
+ /**
4
+ * Virtual DOM patching algorithm based on Snabbdom by
5
+ * Simon Friis Vindum (@paldepind)
6
+ * Licensed under the MIT License
7
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
8
+ *
9
+ * Modified for Stencil's renderer and slot projection
10
+ */
3
11
  let scopeId;
4
12
  let contentRef;
5
13
  let hostTagName;
@@ -8,62 +16,6 @@ let checkSlotFallbackVisibility = false;
8
16
  let checkSlotRelocate = false;
9
17
  let isSvgMode = false;
10
18
  let queuePending = false;
11
- const win = typeof window !== 'undefined' ? window : {};
12
- const doc = win.document || { head: {} };
13
- const plt = {
14
- $flags$: 0,
15
- $resourcesUrl$: '',
16
- jmp: (h) => h(),
17
- raf: (h) => requestAnimationFrame(h),
18
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
19
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
20
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
21
- };
22
- const promiseResolve = (v) => Promise.resolve(v);
23
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
24
- try {
25
- new CSSStyleSheet();
26
- return typeof new CSSStyleSheet().replace === 'function';
27
- }
28
- catch (e) { }
29
- return false;
30
- })()
31
- ;
32
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
33
- if (listeners) {
34
- listeners.map(([flags, name, method]) => {
35
- const target = getHostListenerTarget(elm, flags) ;
36
- const handler = hostListenerProxy(hostRef, method);
37
- const opts = hostListenerOpts(flags);
38
- plt.ael(target, name, handler, opts);
39
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
40
- });
41
- }
42
- };
43
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
44
- try {
45
- {
46
- if (hostRef.$flags$ & 256 /* isListenReady */) {
47
- // instance is ready, let's call it's member method for this event
48
- hostRef.$lazyInstance$[methodName](ev);
49
- }
50
- else {
51
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
52
- }
53
- }
54
- }
55
- catch (e) {
56
- consoleError(e);
57
- }
58
- };
59
- const getHostListenerTarget = (elm, flags) => {
60
- if (flags & 4 /* TargetDocument */)
61
- return doc;
62
- return elm;
63
- };
64
- // prettier-ignore
65
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
66
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
67
19
  const createTime = (fnName, tagName = '') => {
68
20
  {
69
21
  return () => {
@@ -78,71 +30,7 @@ const uniqueTime = (key, measureText) => {
78
30
  };
79
31
  }
80
32
  };
81
- const rootAppliedStyles = new WeakMap();
82
- const registerStyle = (scopeId, cssText, allowCS) => {
83
- let style = styles.get(scopeId);
84
- if (supportsConstructibleStylesheets && allowCS) {
85
- style = (style || new CSSStyleSheet());
86
- style.replace(cssText);
87
- }
88
- else {
89
- style = cssText;
90
- }
91
- styles.set(scopeId, style);
92
- };
93
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
94
- let scopeId = getScopeId(cmpMeta);
95
- const style = styles.get(scopeId);
96
- // if an element is NOT connected then getRootNode() will return the wrong root node
97
- // so the fallback is to always use the document for the root node in those cases
98
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
99
- if (style) {
100
- if (typeof style === 'string') {
101
- styleContainerNode = styleContainerNode.head || styleContainerNode;
102
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
103
- let styleElm;
104
- if (!appliedStyles) {
105
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
106
- }
107
- if (!appliedStyles.has(scopeId)) {
108
- {
109
- {
110
- styleElm = doc.createElement('style');
111
- styleElm.innerHTML = style;
112
- }
113
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
114
- }
115
- if (appliedStyles) {
116
- appliedStyles.add(scopeId);
117
- }
118
- }
119
- }
120
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
121
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
122
- }
123
- }
124
- return scopeId;
125
- };
126
- const attachStyles = (hostRef) => {
127
- const cmpMeta = hostRef.$cmpMeta$;
128
- const elm = hostRef.$hostElement$;
129
- const flags = cmpMeta.$flags$;
130
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
131
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
132
- if (flags & 10 /* needsScopedEncapsulation */) {
133
- // only required when we're NOT using native shadow dom (slot)
134
- // or this browser doesn't support native shadow dom
135
- // and this host element was NOT created with SSR
136
- // let's pick out the inner content for slot projection
137
- // create a node to represent where the original
138
- // content was first placed, which is useful later on
139
- // DOM WRITE!!
140
- elm['s-sc'] = scopeId;
141
- elm.classList.add(scopeId + '-h');
142
- }
143
- endAttachStyles();
144
- };
145
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
33
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
146
34
  /**
147
35
  * Default style mode id
148
36
  */
@@ -275,6 +163,149 @@ const convertToPrivate = (node) => {
275
163
  vnode.$name$ = node.vname;
276
164
  return vnode;
277
165
  };
166
+ /**
167
+ * Parse a new property value for a given property type.
168
+ *
169
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
170
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
171
+ * 1. `any`, the type given to `propValue` in the function signature
172
+ * 2. the type stored from `propType`.
173
+ *
174
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
175
+ *
176
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
177
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
178
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
179
+ * ```tsx
180
+ * <my-cmp prop-val={0}></my-cmp>
181
+ * ```
182
+ *
183
+ * HTML prop values on the other hand, will always a string
184
+ *
185
+ * @param propValue the new value to coerce to some type
186
+ * @param propType the type of the prop, expressed as a binary number
187
+ * @returns the parsed/coerced value
188
+ */
189
+ const parsePropertyValue = (propValue, propType) => {
190
+ // ensure this value is of the correct prop type
191
+ if (propValue != null && !isComplexType(propValue)) {
192
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
193
+ // per the HTML spec, any string value means it is a boolean true value
194
+ // but we'll cheat here and say that the string "false" is the boolean false
195
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
196
+ }
197
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
198
+ // force it to be a number
199
+ return parseFloat(propValue);
200
+ }
201
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
202
+ // could have been passed as a number or boolean
203
+ // but we still want it as a string
204
+ return String(propValue);
205
+ }
206
+ // redundant return here for better minification
207
+ return propValue;
208
+ }
209
+ // not sure exactly what type we want
210
+ // so no need to change to a different type
211
+ return propValue;
212
+ };
213
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
214
+ const createEvent = (ref, name, flags) => {
215
+ const elm = getElement(ref);
216
+ return {
217
+ emit: (detail) => {
218
+ return emitEvent(elm, name, {
219
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
220
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
221
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
222
+ detail,
223
+ });
224
+ },
225
+ };
226
+ };
227
+ /**
228
+ * Helper function to create & dispatch a custom Event on a provided target
229
+ * @param elm the target of the Event
230
+ * @param name the name to give the custom Event
231
+ * @param opts options for configuring a custom Event
232
+ * @returns the custom Event
233
+ */
234
+ const emitEvent = (elm, name, opts) => {
235
+ const ev = plt.ce(name, opts);
236
+ elm.dispatchEvent(ev);
237
+ return ev;
238
+ };
239
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
240
+ const registerStyle = (scopeId, cssText, allowCS) => {
241
+ let style = styles.get(scopeId);
242
+ if (supportsConstructableStylesheets && allowCS) {
243
+ style = (style || new CSSStyleSheet());
244
+ if (typeof style === 'string') {
245
+ style = cssText;
246
+ }
247
+ else {
248
+ style.replaceSync(cssText);
249
+ }
250
+ }
251
+ else {
252
+ style = cssText;
253
+ }
254
+ styles.set(scopeId, style);
255
+ };
256
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
257
+ let scopeId = getScopeId(cmpMeta);
258
+ const style = styles.get(scopeId);
259
+ // if an element is NOT connected then getRootNode() will return the wrong root node
260
+ // so the fallback is to always use the document for the root node in those cases
261
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
262
+ if (style) {
263
+ if (typeof style === 'string') {
264
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
265
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
266
+ let styleElm;
267
+ if (!appliedStyles) {
268
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
269
+ }
270
+ if (!appliedStyles.has(scopeId)) {
271
+ {
272
+ {
273
+ styleElm = doc.createElement('style');
274
+ styleElm.innerHTML = style;
275
+ }
276
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
277
+ }
278
+ if (appliedStyles) {
279
+ appliedStyles.add(scopeId);
280
+ }
281
+ }
282
+ }
283
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
284
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
285
+ }
286
+ }
287
+ return scopeId;
288
+ };
289
+ const attachStyles = (hostRef) => {
290
+ const cmpMeta = hostRef.$cmpMeta$;
291
+ const elm = hostRef.$hostElement$;
292
+ const flags = cmpMeta.$flags$;
293
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
294
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
295
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
296
+ // only required when we're NOT using native shadow dom (slot)
297
+ // or this browser doesn't support native shadow dom
298
+ // and this host element was NOT created with SSR
299
+ // let's pick out the inner content for slot projection
300
+ // create a node to represent where the original
301
+ // content was first placed, which is useful later on
302
+ // DOM WRITE!!
303
+ elm['s-sc'] = scopeId;
304
+ elm.classList.add(scopeId + '-h');
305
+ }
306
+ endAttachStyles();
307
+ };
308
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
278
309
  /**
279
310
  * Production setAccessor() function based on Preact by
280
311
  * Jason Miller (@developit)
@@ -294,6 +325,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
294
325
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
295
326
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
296
327
  }
328
+ else if (memberName === 'style') {
329
+ // update style attribute, css properties and values
330
+ {
331
+ for (const prop in oldValue) {
332
+ if (!newValue || newValue[prop] == null) {
333
+ if (prop.includes('-')) {
334
+ elm.style.removeProperty(prop);
335
+ }
336
+ else {
337
+ elm.style[prop] = '';
338
+ }
339
+ }
340
+ }
341
+ }
342
+ for (const prop in newValue) {
343
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
344
+ if (prop.includes('-')) {
345
+ elm.style.setProperty(prop, newValue[prop]);
346
+ }
347
+ else {
348
+ elm.style[prop] = newValue[prop];
349
+ }
350
+ }
351
+ }
352
+ }
297
353
  else if (memberName === 'ref') {
298
354
  // minifier will clean this up
299
355
  if (newValue) {
@@ -367,7 +423,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
367
423
  }
368
424
  }
369
425
  }
370
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
426
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
371
427
  newValue = newValue === true ? '' : newValue;
372
428
  {
373
429
  elm.setAttribute(memberName, newValue);
@@ -382,7 +438,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
382
438
  // if the element passed in is a shadow root, which is a document fragment
383
439
  // then we want to be adding attrs/props to the shadow root's "host" element
384
440
  // if it's not a shadow root, then we add attrs/props to the same element
385
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
441
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
386
442
  ? newVnode.$elm$.host
387
443
  : newVnode.$elm$;
388
444
  const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
@@ -400,6 +456,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
400
456
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
401
457
  }
402
458
  };
459
+ /**
460
+ * Create a DOM Node corresponding to one of the children of a given VNode.
461
+ *
462
+ * @param oldParentVNode the parent VNode from the previous render
463
+ * @param newParentVNode the parent VNode from the current render
464
+ * @param childIndex the index of the VNode, in the _new_ parent node's
465
+ * children, for which we will create a new DOM node
466
+ * @param parentElm the parent DOM node which our new node will be a child of
467
+ * @returns the newly created node
468
+ */
403
469
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
404
470
  // tslint:disable-next-line: prefer-const
405
471
  const newVNode = newParentVNode.$children$[childIndex];
@@ -417,23 +483,23 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
417
483
  }
418
484
  newVNode.$flags$ |= newVNode.$children$
419
485
  ? // slot element has fallback content
420
- 2 /* isSlotFallback */
486
+ 2 /* VNODE_FLAGS.isSlotFallback */
421
487
  : // slot element does not have fallback content
422
- 1 /* isSlotReference */;
488
+ 1 /* VNODE_FLAGS.isSlotReference */;
423
489
  }
424
490
  }
425
491
  if (newVNode.$text$ !== null) {
426
492
  // create text node
427
493
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
428
494
  }
429
- else if (newVNode.$flags$ & 1 /* isSlotReference */) {
495
+ else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
430
496
  // create a slot reference node
431
497
  elm = newVNode.$elm$ =
432
498
  doc.createTextNode('');
433
499
  }
434
500
  else {
435
501
  // create element
436
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* isSlotFallback */
502
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
437
503
  ? 'slot-fb'
438
504
  : newVNode.$tag$));
439
505
  // add css classes, attrs, props, listeners, etc.
@@ -459,7 +525,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
459
525
  }
460
526
  {
461
527
  elm['s-hn'] = hostTagName;
462
- if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
528
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
463
529
  // remember the content reference comment
464
530
  elm['s-sr'] = true;
465
531
  // remember the content reference comment
@@ -478,7 +544,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
478
544
  return elm;
479
545
  };
480
546
  const putBackInOriginalLocation = (parentElm, recursive) => {
481
- plt.$flags$ |= 1 /* isTmpDisconnected */;
547
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
482
548
  const oldSlotChildNodes = parentElm.childNodes;
483
549
  for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
484
550
  const childNode = oldSlotChildNodes[i];
@@ -499,7 +565,7 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
499
565
  putBackInOriginalLocation(childNode, recursive);
500
566
  }
501
567
  }
502
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
568
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
503
569
  };
504
570
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
505
571
  let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
@@ -541,6 +607,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
541
607
  }
542
608
  }
543
609
  };
610
+ /**
611
+ * Reconcile the children of a new VNode with the children of an old VNode by
612
+ * traversing the two collections of children, identifying nodes that are
613
+ * conserved or changed, calling out to `patch` to make any necessary
614
+ * updates to the DOM, and rearranging DOM nodes as needed.
615
+ *
616
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
617
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
618
+ * 'windows' by storing start and end indices and references to the
619
+ * corresponding array entries. Initially the two 'windows' are basically equal
620
+ * to the entire array, but we progressively narrow the windows until there are
621
+ * no children left to update by doing the following:
622
+ *
623
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
624
+ * that if we have an initial array like the following we'll end up dealing
625
+ * only with a window bounded by the highlighted elements:
626
+ *
627
+ * [null, null, VNode1 , ... , VNode2, null, null]
628
+ * ^^^^^^ ^^^^^^
629
+ *
630
+ * 2. Check to see if the elements at the head and tail positions are equal
631
+ * across the windows. This will basically detect elements which haven't
632
+ * been added, removed, or changed position, i.e. if you had the following
633
+ * VNode elements (represented as HTML):
634
+ *
635
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
636
+ * newVNode: `<div><p><span>THERE</span></p></div>`
637
+ *
638
+ * Then when comparing the children of the `<div>` tag we check the equality
639
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
640
+ * same tag in the same position, we'd be able to avoid completely
641
+ * re-rendering the subtree under them with a new DOM element and would just
642
+ * call out to `patch` to handle reconciling their children and so on.
643
+ *
644
+ * 3. Check, for both windows, to see if the element at the beginning of the
645
+ * window corresponds to the element at the end of the other window. This is
646
+ * a heuristic which will let us identify _some_ situations in which
647
+ * elements have changed position, for instance it _should_ detect that the
648
+ * children nodes themselves have not changed but merely moved in the
649
+ * following example:
650
+ *
651
+ * oldVNode: `<div><element-one /><element-two /></div>`
652
+ * newVNode: `<div><element-two /><element-one /></div>`
653
+ *
654
+ * If we find cases like this then we also need to move the concrete DOM
655
+ * elements corresponding to the moved children to write the re-order to the
656
+ * DOM.
657
+ *
658
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
659
+ * nodes in the old children which have the same key as the first element in
660
+ * our window on the new children. If we find such a node we handle calling
661
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
662
+ * what we find.
663
+ *
664
+ * Finally, once we've narrowed our 'windows' to the point that either of them
665
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
666
+ * insertion or deletion that needs to happen to get a DOM state that correctly
667
+ * reflects the new child VNodes. If, for instance, after our window on the old
668
+ * children has collapsed we still have more nodes on the new children that
669
+ * we haven't dealt with yet then we need to add them, or if the new children
670
+ * collapse but we still have unhandled _old_ children then we need to make
671
+ * sure the corresponding DOM nodes are removed.
672
+ *
673
+ * @param parentElm the node into which the parent VNode is rendered
674
+ * @param oldCh the old children of the parent node
675
+ * @param newVNode the new VNode which will replace the parent
676
+ * @param newCh the new children of the parent node
677
+ */
544
678
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
545
679
  let oldStartIdx = 0;
546
680
  let newStartIdx = 0;
@@ -553,7 +687,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
553
687
  let node;
554
688
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
555
689
  if (oldStartVnode == null) {
556
- // Vnode might have been moved left
690
+ // VNode might have been moved left
557
691
  oldStartVnode = oldCh[++oldStartIdx];
558
692
  }
559
693
  else if (oldEndVnode == null) {
@@ -566,42 +700,102 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
566
700
  newEndVnode = newCh[--newEndIdx];
567
701
  }
568
702
  else if (isSameVnode(oldStartVnode, newStartVnode)) {
703
+ // if the start nodes are the same then we should patch the new VNode
704
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
705
+ // indices to reflect that. We don't need to move any DOM Nodes around
706
+ // since things are matched up in order.
569
707
  patch(oldStartVnode, newStartVnode);
570
708
  oldStartVnode = oldCh[++oldStartIdx];
571
709
  newStartVnode = newCh[++newStartIdx];
572
710
  }
573
711
  else if (isSameVnode(oldEndVnode, newEndVnode)) {
712
+ // likewise, if the end nodes are the same we patch new onto old and
713
+ // decrement our end indices, and also likewise in this case we don't
714
+ // need to move any DOM Nodes.
574
715
  patch(oldEndVnode, newEndVnode);
575
716
  oldEndVnode = oldCh[--oldEndIdx];
576
717
  newEndVnode = newCh[--newEndIdx];
577
718
  }
578
719
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
579
- // Vnode moved right
720
+ // case: "Vnode moved right"
721
+ //
722
+ // We've found that the last node in our window on the new children is
723
+ // the same VNode as the _first_ node in our window on the old children
724
+ // we're dealing with now. Visually, this is the layout of these two
725
+ // nodes:
726
+ //
727
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
728
+ // ^^^^^^^^^^^
729
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
730
+ // ^^^^^^^^^^^^^
731
+ //
732
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
733
+ // and move the DOM element for `oldStartVnode`.
580
734
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
581
735
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
582
736
  }
583
737
  patch(oldStartVnode, newEndVnode);
738
+ // We need to move the element for `oldStartVnode` into a position which
739
+ // will be appropriate for `newEndVnode`. For this we can use
740
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
741
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
742
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
743
+ //
744
+ // <old-start-node />
745
+ // <some-intervening-node />
746
+ // <old-end-node />
747
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
748
+ // <next-sibling />
749
+ //
750
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
751
+ // the node for `oldStartVnode` at the end of the children of
752
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
753
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
754
+ // append it to the children of the parent element.
584
755
  parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
585
756
  oldStartVnode = oldCh[++oldStartIdx];
586
757
  newEndVnode = newCh[--newEndIdx];
587
758
  }
588
759
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
589
- // Vnode moved left
760
+ // case: "Vnode moved left"
761
+ //
762
+ // We've found that the first node in our window on the new children is
763
+ // the same VNode as the _last_ node in our window on the old children.
764
+ // Visually, this is the layout of these two nodes:
765
+ //
766
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
767
+ // ^^^^^^^^^^^^^
768
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
769
+ // ^^^^^^^^^^^
770
+ //
771
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
772
+ // (which will handle updating any changed attributes, reconciling their
773
+ // children etc) but we also need to move the DOM node to which
774
+ // `oldEndVnode` corresponds.
590
775
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
591
776
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
592
777
  }
593
778
  patch(oldEndVnode, newStartVnode);
779
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
780
+ // the same node, so since we're here we know that they are not. Thus we
781
+ // can move the element for `oldEndVnode` _before_ the element for
782
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
783
+ // future.
594
784
  parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
595
785
  oldEndVnode = oldCh[--oldEndIdx];
596
786
  newStartVnode = newCh[++newStartIdx];
597
787
  }
598
788
  else {
599
789
  {
600
- // new element
790
+ // We either didn't find an element in the old children that matches
791
+ // the key of the first new child OR the build is not using `key`
792
+ // attributes at all. In either case we need to create a new element
793
+ // for the new node.
601
794
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
602
795
  newStartVnode = newCh[++newStartIdx];
603
796
  }
604
797
  if (node) {
798
+ // if we created a new node then handle inserting it to the DOM
605
799
  {
606
800
  parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
607
801
  }
@@ -609,18 +803,39 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
609
803
  }
610
804
  }
611
805
  if (oldStartIdx > oldEndIdx) {
806
+ // we have some more new nodes to add which don't match up with old nodes
612
807
  addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
613
808
  }
614
809
  else if (newStartIdx > newEndIdx) {
810
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
811
+ // in the new array, so lets remove them (which entails cleaning up the
812
+ // relevant DOM nodes)
615
813
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
616
814
  }
617
815
  };
618
- const isSameVnode = (vnode1, vnode2) => {
816
+ /**
817
+ * Compare two VNodes to determine if they are the same
818
+ *
819
+ * **NB**: This function is an equality _heuristic_ based on the available
820
+ * information set on the two VNodes and can be misleading under certain
821
+ * circumstances. In particular, if the two nodes do not have `key` attrs
822
+ * (available under `$key$` on VNodes) then the function falls back on merely
823
+ * checking that they have the same tag.
824
+ *
825
+ * So, in other words, if `key` attrs are not set on VNodes which may be
826
+ * changing order within a `children` array or something along those lines then
827
+ * we could obtain a false positive and then have to do needless re-rendering.
828
+ *
829
+ * @param leftVNode the first VNode to check
830
+ * @param rightVNode the second VNode to check
831
+ * @returns whether they're equal or not
832
+ */
833
+ const isSameVnode = (leftVNode, rightVNode) => {
619
834
  // compare if two vnode to see if they're "technically" the same
620
835
  // need to have the same element tag, and same key to be the same
621
- if (vnode1.$tag$ === vnode2.$tag$) {
622
- if (vnode1.$tag$ === 'slot') {
623
- return vnode1.$name$ === vnode2.$name$;
836
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
837
+ if (leftVNode.$tag$ === 'slot') {
838
+ return leftVNode.$name$ === rightVNode.$name$;
624
839
  }
625
840
  return true;
626
841
  }
@@ -634,6 +849,14 @@ const referenceNode = (node) => {
634
849
  return (node && node['s-ol']) || node;
635
850
  };
636
851
  const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
852
+ /**
853
+ * Handle reconciling an outdated VNode with a new one which corresponds to
854
+ * it. This function handles flushing updates to the DOM and reconciling the
855
+ * children of the two nodes (if any).
856
+ *
857
+ * @param oldVNode an old VNode whose DOM element and children we want to update
858
+ * @param newVNode a new VNode representing an updated version of the old one
859
+ */
637
860
  const patch = (oldVNode, newVNode) => {
638
861
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
639
862
  const oldChildren = oldVNode.$children$;
@@ -642,7 +865,6 @@ const patch = (oldVNode, newVNode) => {
642
865
  const text = newVNode.$text$;
643
866
  let defaultHolder;
644
867
  if (text === null) {
645
- // element node
646
868
  {
647
869
  if (tag === 'slot')
648
870
  ;
@@ -655,6 +877,7 @@ const patch = (oldVNode, newVNode) => {
655
877
  }
656
878
  if (oldChildren !== null && newChildren !== null) {
657
879
  // looks like there's child vnodes for both the old and new vnodes
880
+ // so we need to call `updateChildren` to reconcile them
658
881
  updateChildren(elm, oldChildren, newVNode, newChildren);
659
882
  }
660
883
  else if (newChildren !== null) {
@@ -692,7 +915,7 @@ const updateFallbackSlotVisibility = (elm) => {
692
915
  let nodeType;
693
916
  for (i = 0, ilen = childNodes.length; i < ilen; i++) {
694
917
  childNode = childNodes[i];
695
- if (childNode.nodeType === 1 /* ElementNode */) {
918
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
696
919
  if (childNode['s-sr']) {
697
920
  // this is a slot fallback node
698
921
  // get the slot name for this slot reference node
@@ -704,7 +927,7 @@ const updateFallbackSlotVisibility = (elm) => {
704
927
  nodeType = childNodes[j].nodeType;
705
928
  if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
706
929
  // this sibling node is from a different component OR is a named fallback slot node
707
- if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
930
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
708
931
  childNode.hidden = true;
709
932
  break;
710
933
  }
@@ -713,8 +936,8 @@ const updateFallbackSlotVisibility = (elm) => {
713
936
  // this is a default fallback slot node
714
937
  // any element or text node (with content)
715
938
  // should hide the default fallback slot node
716
- if (nodeType === 1 /* ElementNode */ ||
717
- (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
939
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
940
+ (nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
718
941
  childNode.hidden = true;
719
942
  break;
720
943
  }
@@ -792,13 +1015,13 @@ const relocateSlotContent = (elm) => {
792
1015
  }
793
1016
  }
794
1017
  }
795
- if (childNode.nodeType === 1 /* ElementNode */) {
1018
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
796
1019
  relocateSlotContent(childNode);
797
1020
  }
798
1021
  }
799
1022
  };
800
1023
  const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
801
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1024
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
802
1025
  if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
803
1026
  return true;
804
1027
  }
@@ -829,7 +1052,7 @@ const renderVdom = (hostRef, renderFnResults) => {
829
1052
  cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
830
1053
  }
831
1054
  rootVnode.$tag$ = null;
832
- rootVnode.$flags$ |= 4 /* isHost */;
1055
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
833
1056
  hostRef.$vnode$ = rootVnode;
834
1057
  rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
835
1058
  {
@@ -837,7 +1060,7 @@ const renderVdom = (hostRef, renderFnResults) => {
837
1060
  }
838
1061
  {
839
1062
  contentRef = hostElm['s-cr'];
840
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1063
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
841
1064
  // always reset
842
1065
  checkSlotFallbackVisibility = false;
843
1066
  }
@@ -846,7 +1069,7 @@ const renderVdom = (hostRef, renderFnResults) => {
846
1069
  {
847
1070
  // while we're moving nodes around existing nodes, temporarily disable
848
1071
  // the disconnectCallback from working
849
- plt.$flags$ |= 1 /* isTmpDisconnected */;
1072
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
850
1073
  if (checkSlotRelocate) {
851
1074
  relocateSlotContent(rootVnode.$elm$);
852
1075
  let relocateData;
@@ -904,7 +1127,7 @@ const renderVdom = (hostRef, renderFnResults) => {
904
1127
  }
905
1128
  else {
906
1129
  // this node doesn't have a slot home to go to, so let's hide it
907
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1130
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
908
1131
  nodeToRelocate.hidden = true;
909
1132
  }
910
1133
  }
@@ -915,37 +1138,11 @@ const renderVdom = (hostRef, renderFnResults) => {
915
1138
  }
916
1139
  // done moving nodes around
917
1140
  // allow the disconnect callback to work again
918
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
1141
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
919
1142
  // always reset
920
1143
  relocateNodes.length = 0;
921
1144
  }
922
1145
  };
923
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
924
- const createEvent = (ref, name, flags) => {
925
- const elm = getElement(ref);
926
- return {
927
- emit: (detail) => {
928
- return emitEvent(elm, name, {
929
- bubbles: !!(flags & 4 /* Bubbles */),
930
- composed: !!(flags & 2 /* Composed */),
931
- cancelable: !!(flags & 1 /* Cancellable */),
932
- detail,
933
- });
934
- },
935
- };
936
- };
937
- /**
938
- * Helper function to create & dispatch a custom Event on a provided target
939
- * @param elm the target of the Event
940
- * @param name the name to give the custom Event
941
- * @param opts options for configuring a custom Event
942
- * @returns the custom Event
943
- */
944
- const emitEvent = (elm, name, opts) => {
945
- const ev = plt.ce(name, opts);
946
- elm.dispatchEvent(ev);
947
- return ev;
948
- };
949
1146
  const attachToAncestor = (hostRef, ancestorComponent) => {
950
1147
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
951
1148
  ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
@@ -953,10 +1150,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
953
1150
  };
954
1151
  const scheduleUpdate = (hostRef, isInitialLoad) => {
955
1152
  {
956
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1153
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
957
1154
  }
958
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
959
- hostRef.$flags$ |= 512 /* needsRerender */;
1155
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1156
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
960
1157
  return;
961
1158
  }
962
1159
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
@@ -972,12 +1169,15 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
972
1169
  let promise;
973
1170
  if (isInitialLoad) {
974
1171
  {
975
- hostRef.$flags$ |= 256 /* isListenReady */;
1172
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
976
1173
  if (hostRef.$queuedListeners$) {
977
1174
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
978
1175
  hostRef.$queuedListeners$ = null;
979
1176
  }
980
1177
  }
1178
+ {
1179
+ promise = safeCall(instance, 'componentWillLoad');
1180
+ }
981
1181
  }
982
1182
  {
983
1183
  promise = then(promise, () => safeCall(instance, 'componentWillRender'));
@@ -1015,7 +1215,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1015
1215
  }
1016
1216
  else {
1017
1217
  Promise.all(childrenPromises).then(postUpdate);
1018
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1218
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1019
1219
  childrenPromises.length = 0;
1020
1220
  }
1021
1221
  }
@@ -1024,10 +1224,10 @@ const callRender = (hostRef, instance, elm) => {
1024
1224
  try {
1025
1225
  instance = instance.render() ;
1026
1226
  {
1027
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1227
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1028
1228
  }
1029
1229
  {
1030
- hostRef.$flags$ |= 2 /* hasRendered */;
1230
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1031
1231
  }
1032
1232
  {
1033
1233
  {
@@ -1049,13 +1249,20 @@ const postUpdateComponent = (hostRef) => {
1049
1249
  const tagName = hostRef.$cmpMeta$.$tagName$;
1050
1250
  const elm = hostRef.$hostElement$;
1051
1251
  const endPostUpdate = createTime('postUpdate', tagName);
1252
+ const instance = hostRef.$lazyInstance$ ;
1052
1253
  const ancestorComponent = hostRef.$ancestorComponent$;
1053
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1054
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1254
+ {
1255
+ safeCall(instance, 'componentDidRender');
1256
+ }
1257
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1258
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1055
1259
  {
1056
1260
  // DOM WRITE!
1057
1261
  addHydratedFlag(elm);
1058
1262
  }
1263
+ {
1264
+ safeCall(instance, 'componentDidLoad');
1265
+ }
1059
1266
  endPostUpdate();
1060
1267
  {
1061
1268
  hostRef.$onReadyResolve$(elm);
@@ -1065,6 +1272,9 @@ const postUpdateComponent = (hostRef) => {
1065
1272
  }
1066
1273
  }
1067
1274
  else {
1275
+ {
1276
+ safeCall(instance, 'componentDidUpdate');
1277
+ }
1068
1278
  endPostUpdate();
1069
1279
  }
1070
1280
  // load events fire from bottom to top
@@ -1074,10 +1284,10 @@ const postUpdateComponent = (hostRef) => {
1074
1284
  hostRef.$onRenderResolve$();
1075
1285
  hostRef.$onRenderResolve$ = undefined;
1076
1286
  }
1077
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1287
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1078
1288
  nextTick(() => scheduleUpdate(hostRef, false));
1079
1289
  }
1080
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1290
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1081
1291
  }
1082
1292
  // ( •_•)
1083
1293
  // ( •_•)>⌐■-■
@@ -1107,53 +1317,6 @@ const then = (promise, thenFn) => {
1107
1317
  };
1108
1318
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1109
1319
  ;
1110
- /**
1111
- * Parse a new property value for a given property type.
1112
- *
1113
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
1114
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
1115
- * 1. `any`, the type given to `propValue` in the function signature
1116
- * 2. the type stored from `propType`.
1117
- *
1118
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
1119
- *
1120
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
1121
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
1122
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
1123
- * ```tsx
1124
- * <my-cmp prop-val={0}></my-cmp>
1125
- * ```
1126
- *
1127
- * HTML prop values on the other hand, will always a string
1128
- *
1129
- * @param propValue the new value to coerce to some type
1130
- * @param propType the type of the prop, expressed as a binary number
1131
- * @returns the parsed/coerced value
1132
- */
1133
- const parsePropertyValue = (propValue, propType) => {
1134
- // ensure this value is of the correct prop type
1135
- if (propValue != null && !isComplexType(propValue)) {
1136
- if (propType & 4 /* Boolean */) {
1137
- // per the HTML spec, any string value means it is a boolean true value
1138
- // but we'll cheat here and say that the string "false" is the boolean false
1139
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1140
- }
1141
- if (propType & 2 /* Number */) {
1142
- // force it to be a number
1143
- return parseFloat(propValue);
1144
- }
1145
- if (propType & 1 /* String */) {
1146
- // could have been passed as a number or boolean
1147
- // but we still want it as a string
1148
- return String(propValue);
1149
- }
1150
- // redundant return here for better minification
1151
- return propValue;
1152
- }
1153
- // not sure exactly what type we want
1154
- // so no need to change to a different type
1155
- return propValue;
1156
- };
1157
1320
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1158
1321
  const setValue = (ref, propName, newVal, cmpMeta) => {
1159
1322
  // check our new property value against our internal value
@@ -1166,13 +1329,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1166
1329
  // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1167
1330
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1168
1331
  const didValueChange = newVal !== oldVal && !areBothNaN;
1169
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1332
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1170
1333
  // gadzooks! the property's value has changed!!
1171
1334
  // set our new value!
1172
1335
  hostRef.$instanceValues$.set(propName, newVal);
1173
1336
  if (instance) {
1174
1337
  // get an array of method names of watch functions to call
1175
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1338
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1176
1339
  const watchMethods = cmpMeta.$watchers$[propName];
1177
1340
  if (watchMethods) {
1178
1341
  // this instance is watching for when this property changed
@@ -1187,7 +1350,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1187
1350
  });
1188
1351
  }
1189
1352
  }
1190
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1353
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1191
1354
  if (instance.componentShouldUpdate) {
1192
1355
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1193
1356
  return;
@@ -1202,6 +1365,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1202
1365
  }
1203
1366
  }
1204
1367
  };
1368
+ /**
1369
+ * Attach a series of runtime constructs to a compiled Stencil component
1370
+ * constructor, including getters and setters for the `@Prop` and `@State`
1371
+ * decorators, callbacks for when attributes change, and so on.
1372
+ *
1373
+ * @param Cstr the constructor for a component that we need to process
1374
+ * @param cmpMeta metadata collected previously about the component
1375
+ * @param flags a number used to store a series of bit flags
1376
+ * @returns a reference to the same constructor passed in (but now mutated)
1377
+ */
1205
1378
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1206
1379
  if (cmpMeta.$members$) {
1207
1380
  if (Cstr.watchers) {
@@ -1211,8 +1384,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1211
1384
  const members = Object.entries(cmpMeta.$members$);
1212
1385
  const prototype = Cstr.prototype;
1213
1386
  members.map(([memberName, [memberFlags]]) => {
1214
- if ((memberFlags & 31 /* Prop */ ||
1215
- ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1387
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1388
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1216
1389
  // proxyComponent - prop
1217
1390
  Object.defineProperty(prototype, memberName, {
1218
1391
  get() {
@@ -1228,7 +1401,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1228
1401
  });
1229
1402
  }
1230
1403
  });
1231
- if ((flags & 1 /* isElementConstructor */)) {
1404
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1232
1405
  const attrNameToPropName = new Map();
1233
1406
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1234
1407
  plt.jmp(() => {
@@ -1284,11 +1457,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1284
1457
  // create an array of attributes to observe
1285
1458
  // and also create a map of html attribute name to js property name
1286
1459
  Cstr.observedAttributes = members
1287
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1460
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1288
1461
  .map(([propName, m]) => {
1289
1462
  const attrName = m[1] || propName;
1290
1463
  attrNameToPropName.set(attrName, propName);
1291
- if (m[0] & 512 /* ReflectAttr */) {
1464
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1292
1465
  cmpMeta.$attrsToReflect$.push([propName, attrName]);
1293
1466
  }
1294
1467
  return attrName;
@@ -1299,10 +1472,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1299
1472
  };
1300
1473
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1301
1474
  // initializeComponent
1302
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1475
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1303
1476
  {
1304
1477
  // we haven't initialized this element yet
1305
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1478
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1306
1479
  // lazy loaded components
1307
1480
  // request the component's implementation to be
1308
1481
  // wired up with the host element
@@ -1320,7 +1493,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1320
1493
  {
1321
1494
  cmpMeta.$watchers$ = Cstr.watchers;
1322
1495
  }
1323
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1496
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1324
1497
  Cstr.isProxied = true;
1325
1498
  }
1326
1499
  const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
@@ -1328,7 +1501,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1328
1501
  // but let's keep track of when we start and stop
1329
1502
  // so that the getters/setters don't incorrectly step on data
1330
1503
  {
1331
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1504
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1332
1505
  }
1333
1506
  // construct the lazy-loaded component implementation
1334
1507
  // passing the hostRef is very important during
@@ -1341,10 +1514,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1341
1514
  consoleError(e);
1342
1515
  }
1343
1516
  {
1344
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1517
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1345
1518
  }
1346
1519
  {
1347
- hostRef.$flags$ |= 128 /* isWatchReady */;
1520
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1348
1521
  }
1349
1522
  endNewInstance();
1350
1523
  }
@@ -1354,7 +1527,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1354
1527
  const scopeId = getScopeId(cmpMeta);
1355
1528
  if (!styles.has(scopeId)) {
1356
1529
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1357
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1530
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1358
1531
  endRegisterStyles();
1359
1532
  }
1360
1533
  }
@@ -1376,19 +1549,19 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1376
1549
  }
1377
1550
  };
1378
1551
  const connectedCallback = (elm) => {
1379
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1552
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1380
1553
  const hostRef = getHostRef(elm);
1381
1554
  const cmpMeta = hostRef.$cmpMeta$;
1382
1555
  const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1383
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1556
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1384
1557
  // first time this component has connected
1385
- hostRef.$flags$ |= 1 /* hasConnected */;
1558
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1386
1559
  {
1387
1560
  // initUpdate
1388
1561
  // if the slot polyfill is required we'll need to put some nodes
1389
1562
  // in here to act as original content anchors as we move nodes around
1390
1563
  // host element has been connected to the DOM
1391
- if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1564
+ if ((cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
1392
1565
  setContentReference(elm);
1393
1566
  }
1394
1567
  }
@@ -1411,7 +1584,7 @@ const connectedCallback = (elm) => {
1411
1584
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1412
1585
  if (cmpMeta.$members$) {
1413
1586
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1414
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1587
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1415
1588
  const value = elm[memberName];
1416
1589
  delete elm[memberName];
1417
1590
  elm[memberName] = value;
@@ -1443,14 +1616,18 @@ const setContentReference = (elm) => {
1443
1616
  elm.insertBefore(contentRefElm, elm.firstChild);
1444
1617
  };
1445
1618
  const disconnectedCallback = (elm) => {
1446
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1619
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1447
1620
  const hostRef = getHostRef(elm);
1621
+ const instance = hostRef.$lazyInstance$ ;
1448
1622
  {
1449
1623
  if (hostRef.$rmListeners$) {
1450
1624
  hostRef.$rmListeners$.map((rmListener) => rmListener());
1451
1625
  hostRef.$rmListeners$ = undefined;
1452
1626
  }
1453
1627
  }
1628
+ {
1629
+ safeCall(instance, 'disconnectedCallback');
1630
+ }
1454
1631
  }
1455
1632
  };
1456
1633
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -1494,7 +1671,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1494
1671
  super(self);
1495
1672
  self = this;
1496
1673
  registerHost(self, cmpMeta);
1497
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1674
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1498
1675
  // this component is using shadow dom
1499
1676
  // and this browser supports shadow dom
1500
1677
  // add the read-only property "shadowRoot" to the host element
@@ -1529,7 +1706,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1529
1706
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
1530
1707
  if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1531
1708
  cmpTags.push(tagName);
1532
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1709
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1533
1710
  }
1534
1711
  });
1535
1712
  });
@@ -1551,7 +1728,45 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1551
1728
  // Fallback appLoad event
1552
1729
  endBootstrap();
1553
1730
  };
1554
- const hostRefs = new WeakMap();
1731
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1732
+ if (listeners) {
1733
+ listeners.map(([flags, name, method]) => {
1734
+ const target = getHostListenerTarget(elm, flags) ;
1735
+ const handler = hostListenerProxy(hostRef, method);
1736
+ const opts = hostListenerOpts(flags);
1737
+ plt.ael(target, name, handler, opts);
1738
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1739
+ });
1740
+ }
1741
+ };
1742
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
1743
+ try {
1744
+ {
1745
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1746
+ // instance is ready, let's call it's member method for this event
1747
+ hostRef.$lazyInstance$[methodName](ev);
1748
+ }
1749
+ else {
1750
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1751
+ }
1752
+ }
1753
+ }
1754
+ catch (e) {
1755
+ consoleError(e);
1756
+ }
1757
+ };
1758
+ const getHostListenerTarget = (elm, flags) => {
1759
+ if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
1760
+ return doc;
1761
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
1762
+ return win;
1763
+ if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
1764
+ return doc.body;
1765
+ return elm;
1766
+ };
1767
+ // prettier-ignore
1768
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1769
+ const hostRefs = /*@__PURE__*/ new WeakMap();
1555
1770
  const getHostRef = (ref) => hostRefs.get(ref);
1556
1771
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1557
1772
  const registerHost = (elm, cmpMeta) => {
@@ -1580,7 +1795,172 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1580
1795
  if (module) {
1581
1796
  return module[exportName];
1582
1797
  }
1583
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
1798
+
1799
+ if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1800
+ const processMod = importedModule => {
1801
+ cmpModules.set(bundleId, importedModule);
1802
+ return importedModule[exportName];
1803
+ }
1804
+ switch(bundleId) {
1805
+
1806
+ case 'p-button_3':
1807
+ return import(
1808
+ /* webpackMode: "lazy" */
1809
+ './p-button_3.entry.js').then(processMod, consoleError);
1810
+ case 'p-accordion':
1811
+ return import(
1812
+ /* webpackMode: "lazy" */
1813
+ './p-accordion.entry.js').then(processMod, consoleError);
1814
+ case 'p-avatar':
1815
+ return import(
1816
+ /* webpackMode: "lazy" */
1817
+ './p-avatar.entry.js').then(processMod, consoleError);
1818
+ case 'p-avatar-group':
1819
+ return import(
1820
+ /* webpackMode: "lazy" */
1821
+ './p-avatar-group.entry.js').then(processMod, consoleError);
1822
+ case 'p-card-body':
1823
+ return import(
1824
+ /* webpackMode: "lazy" */
1825
+ './p-card-body.entry.js').then(processMod, consoleError);
1826
+ case 'p-card-container':
1827
+ return import(
1828
+ /* webpackMode: "lazy" */
1829
+ './p-card-container.entry.js').then(processMod, consoleError);
1830
+ case 'p-card-header':
1831
+ return import(
1832
+ /* webpackMode: "lazy" */
1833
+ './p-card-header.entry.js').then(processMod, consoleError);
1834
+ case 'p-content-slider':
1835
+ return import(
1836
+ /* webpackMode: "lazy" */
1837
+ './p-content-slider.entry.js').then(processMod, consoleError);
1838
+ case 'p-datepicker':
1839
+ return import(
1840
+ /* webpackMode: "lazy" */
1841
+ './p-datepicker.entry.js').then(processMod, consoleError);
1842
+ case 'p-drawer':
1843
+ return import(
1844
+ /* webpackMode: "lazy" */
1845
+ './p-drawer.entry.js').then(processMod, consoleError);
1846
+ case 'p-info-panel':
1847
+ return import(
1848
+ /* webpackMode: "lazy" */
1849
+ './p-info-panel.entry.js').then(processMod, consoleError);
1850
+ case 'p-layout':
1851
+ return import(
1852
+ /* webpackMode: "lazy" */
1853
+ './p-layout.entry.js').then(processMod, consoleError);
1854
+ case 'p-modal':
1855
+ return import(
1856
+ /* webpackMode: "lazy" */
1857
+ './p-modal.entry.js').then(processMod, consoleError);
1858
+ case 'p-navbar':
1859
+ return import(
1860
+ /* webpackMode: "lazy" */
1861
+ './p-navbar.entry.js').then(processMod, consoleError);
1862
+ case 'p-navigation-item':
1863
+ return import(
1864
+ /* webpackMode: "lazy" */
1865
+ './p-navigation-item.entry.js').then(processMod, consoleError);
1866
+ case 'p-profile':
1867
+ return import(
1868
+ /* webpackMode: "lazy" */
1869
+ './p-profile.entry.js').then(processMod, consoleError);
1870
+ case 'p-select':
1871
+ return import(
1872
+ /* webpackMode: "lazy" */
1873
+ './p-select.entry.js').then(processMod, consoleError);
1874
+ case 'p-status':
1875
+ return import(
1876
+ /* webpackMode: "lazy" */
1877
+ './p-status.entry.js').then(processMod, consoleError);
1878
+ case 'p-stepper':
1879
+ return import(
1880
+ /* webpackMode: "lazy" */
1881
+ './p-stepper.entry.js').then(processMod, consoleError);
1882
+ case 'p-tab-group':
1883
+ return import(
1884
+ /* webpackMode: "lazy" */
1885
+ './p-tab-group.entry.js').then(processMod, consoleError);
1886
+ case 'p-tab-item':
1887
+ return import(
1888
+ /* webpackMode: "lazy" */
1889
+ './p-tab-item.entry.js').then(processMod, consoleError);
1890
+ case 'p-table':
1891
+ return import(
1892
+ /* webpackMode: "lazy" */
1893
+ './p-table.entry.js').then(processMod, consoleError);
1894
+ case 'p-table-column':
1895
+ return import(
1896
+ /* webpackMode: "lazy" */
1897
+ './p-table-column.entry.js').then(processMod, consoleError);
1898
+ case 'p-toast':
1899
+ return import(
1900
+ /* webpackMode: "lazy" */
1901
+ './p-toast.entry.js').then(processMod, consoleError);
1902
+ case 'p-toast-container':
1903
+ return import(
1904
+ /* webpackMode: "lazy" */
1905
+ './p-toast-container.entry.js').then(processMod, consoleError);
1906
+ case 'p-calendar':
1907
+ return import(
1908
+ /* webpackMode: "lazy" */
1909
+ './p-calendar.entry.js').then(processMod, consoleError);
1910
+ case 'p-counter':
1911
+ return import(
1912
+ /* webpackMode: "lazy" */
1913
+ './p-counter.entry.js').then(processMod, consoleError);
1914
+ case 'p-drawer-body_3':
1915
+ return import(
1916
+ /* webpackMode: "lazy" */
1917
+ './p-drawer-body_3.entry.js').then(processMod, consoleError);
1918
+ case 'p-illustration_6':
1919
+ return import(
1920
+ /* webpackMode: "lazy" */
1921
+ './p-illustration_6.entry.js').then(processMod, consoleError);
1922
+ case 'p-modal-body_4':
1923
+ return import(
1924
+ /* webpackMode: "lazy" */
1925
+ './p-modal-body_4.entry.js').then(processMod, consoleError);
1926
+ case 'p-slider-indicator':
1927
+ return import(
1928
+ /* webpackMode: "lazy" */
1929
+ './p-slider-indicator.entry.js').then(processMod, consoleError);
1930
+ case 'p-stepper-item_2':
1931
+ return import(
1932
+ /* webpackMode: "lazy" */
1933
+ './p-stepper-item_2.entry.js').then(processMod, consoleError);
1934
+ case 'p-label_3':
1935
+ return import(
1936
+ /* webpackMode: "lazy" */
1937
+ './p-label_3.entry.js').then(processMod, consoleError);
1938
+ case 'p-page-size-select_3':
1939
+ return import(
1940
+ /* webpackMode: "lazy" */
1941
+ './p-page-size-select_3.entry.js').then(processMod, consoleError);
1942
+ case 'p-backdrop':
1943
+ return import(
1944
+ /* webpackMode: "lazy" */
1945
+ './p-backdrop.entry.js').then(processMod, consoleError);
1946
+ case 'p-dropdown_2':
1947
+ return import(
1948
+ /* webpackMode: "lazy" */
1949
+ './p-dropdown_2.entry.js').then(processMod, consoleError);
1950
+ case 'p-helper_3':
1951
+ return import(
1952
+ /* webpackMode: "lazy" */
1953
+ './p-helper_3.entry.js').then(processMod, consoleError);
1954
+ case 'p-divider':
1955
+ return import(
1956
+ /* webpackMode: "lazy" */
1957
+ './p-divider.entry.js').then(processMod, consoleError);
1958
+ case 'p-dropdown-menu-container':
1959
+ return import(
1960
+ /* webpackMode: "lazy" */
1961
+ './p-dropdown-menu-container.entry.js').then(processMod, consoleError);
1962
+ }
1963
+ }
1584
1964
  return import(
1585
1965
  /* @vite-ignore */
1586
1966
  /* webpackInclude: /\.entry\.js$/ */
@@ -1593,14 +1973,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1593
1973
  return importedModule[exportName];
1594
1974
  }, consoleError);
1595
1975
  };
1596
- const styles = new Map();
1976
+ const styles = /*@__PURE__*/ new Map();
1977
+ const win = typeof window !== 'undefined' ? window : {};
1978
+ const doc = win.document || { head: {} };
1979
+ const plt = {
1980
+ $flags$: 0,
1981
+ $resourcesUrl$: '',
1982
+ jmp: (h) => h(),
1983
+ raf: (h) => requestAnimationFrame(h),
1984
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1985
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1986
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
1987
+ };
1988
+ const promiseResolve = (v) => Promise.resolve(v);
1989
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1990
+ try {
1991
+ new CSSStyleSheet();
1992
+ return typeof new CSSStyleSheet().replaceSync === 'function';
1993
+ }
1994
+ catch (e) { }
1995
+ return false;
1996
+ })()
1997
+ ;
1597
1998
  const queueDomReads = [];
1598
1999
  const queueDomWrites = [];
1599
2000
  const queueTask = (queue, write) => (cb) => {
1600
2001
  queue.push(cb);
1601
2002
  if (!queuePending) {
1602
2003
  queuePending = true;
1603
- if (write && plt.$flags$ & 4 /* queueSync */) {
2004
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1604
2005
  nextTick(flush);
1605
2006
  }
1606
2007
  else {