bromcom-ui 2.7.37-rc.8 → 2.7.37

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 (497) hide show
  1. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  2. package/dist/bromcom-ui/p-0122ae3d.js +6 -0
  3. package/dist/bromcom-ui/p-02f2445a.entry.js +5 -0
  4. package/dist/bromcom-ui/p-037531dd.entry.js +5 -0
  5. package/dist/bromcom-ui/{p-b1fde043.entry.js → p-08d242bf.entry.js} +1 -1
  6. package/dist/bromcom-ui/p-095d05df.entry.js +5 -0
  7. package/dist/bromcom-ui/p-0a46b931.entry.js +5 -0
  8. package/dist/bromcom-ui/{p-151d7bec.entry.js → p-0dff677e.entry.js} +1 -1
  9. package/dist/bromcom-ui/{p-ae9edc91.entry.js → p-0f69842c.entry.js} +1 -1
  10. package/dist/bromcom-ui/p-13077a28.entry.js +5 -0
  11. package/dist/bromcom-ui/p-15e43f94.entry.js +5 -0
  12. package/dist/bromcom-ui/p-168b8ca7.entry.js +5 -0
  13. package/dist/bromcom-ui/p-1978e4ae.entry.js +5 -0
  14. package/dist/bromcom-ui/p-1ae166db.entry.js +5 -0
  15. package/dist/bromcom-ui/p-1e2d1714.entry.js +5 -0
  16. package/dist/bromcom-ui/{p-2b332236.entry.js → p-20c45a95.entry.js} +1 -1
  17. package/dist/bromcom-ui/{p-34b815f5.entry.js → p-2a7f29b6.entry.js} +1 -1
  18. package/dist/bromcom-ui/p-2c31ab48.entry.js +5 -0
  19. package/dist/bromcom-ui/{p-52e435e3.js → p-331ee3a4.js} +1 -1
  20. package/dist/bromcom-ui/p-33e2496d.entry.js +5 -0
  21. package/dist/bromcom-ui/p-341f55bf.entry.js +5 -0
  22. package/dist/bromcom-ui/{p-ad456d2b.entry.js → p-38b69e07.entry.js} +1 -1
  23. package/dist/bromcom-ui/p-3cebdafb.js +5 -0
  24. package/dist/bromcom-ui/p-3e557630.entry.js +5 -0
  25. package/dist/bromcom-ui/p-4220635e.entry.js +5 -0
  26. package/dist/bromcom-ui/{p-604f9d0d.entry.js → p-425e15b7.entry.js} +1 -1
  27. package/dist/bromcom-ui/p-44991f28.js +5 -0
  28. package/dist/bromcom-ui/p-487f7b46.js +5 -0
  29. package/dist/bromcom-ui/p-4eb1b6e1.entry.js +5 -0
  30. package/dist/bromcom-ui/p-52b34297.entry.js +5 -0
  31. package/dist/bromcom-ui/{p-31eb4512.js → p-53a00d98.js} +1 -1
  32. package/dist/bromcom-ui/p-55b88051.entry.js +5 -0
  33. package/dist/bromcom-ui/p-581f703b.entry.js +5 -0
  34. package/dist/bromcom-ui/{p-0ba26074.js → p-58761f87.js} +1 -1
  35. package/dist/bromcom-ui/p-5926788b.entry.js +5 -0
  36. package/dist/bromcom-ui/{p-e5a45bf4.entry.js → p-5b114d5a.entry.js} +1 -1
  37. package/dist/bromcom-ui/{p-591b3100.entry.js → p-5c20b83c.entry.js} +1 -1
  38. package/dist/bromcom-ui/p-5d8eb303.entry.js +5 -0
  39. package/dist/bromcom-ui/p-62ba8263.entry.js +5 -0
  40. package/dist/bromcom-ui/{p-6e873e3c.entry.js → p-6720d135.entry.js} +1 -1
  41. package/dist/bromcom-ui/p-78963452.entry.js +5 -0
  42. package/dist/bromcom-ui/p-78cf8966.entry.js +5 -0
  43. package/dist/bromcom-ui/{p-adc35e17.entry.js → p-7b5e88c5.entry.js} +1 -1
  44. package/dist/bromcom-ui/{p-0cd7e628.entry.js → p-7df747c7.entry.js} +1 -1
  45. package/dist/bromcom-ui/{p-5ae0a59b.js → p-7e44e6b5.js} +1 -1
  46. package/dist/bromcom-ui/p-8430b547.entry.js +5 -0
  47. package/dist/bromcom-ui/p-894b0a04.entry.js +5 -0
  48. package/dist/bromcom-ui/{p-3c7a0345.js → p-8c018ae0.js} +1 -1
  49. package/dist/bromcom-ui/p-8fa9378f.entry.js +5 -0
  50. package/dist/bromcom-ui/p-93e7539f.entry.js +5 -0
  51. package/dist/bromcom-ui/p-9512271e.entry.js +5 -0
  52. package/dist/bromcom-ui/p-95c5d04b.entry.js +5 -0
  53. package/dist/bromcom-ui/{p-cd0490e2.js → p-96287124.js} +1 -1
  54. package/dist/bromcom-ui/p-9729086c.entry.js +5 -0
  55. package/dist/bromcom-ui/p-99bed73b.entry.js +5 -0
  56. package/dist/bromcom-ui/p-9c2800b0.entry.js +5 -0
  57. package/dist/bromcom-ui/p-9c6de630.js +5 -0
  58. package/dist/bromcom-ui/{p-691bf6a3.entry.js → p-9d2fe304.entry.js} +1 -1
  59. package/dist/bromcom-ui/{p-58109dc6.entry.js → p-a185570c.entry.js} +1 -1
  60. package/dist/bromcom-ui/p-a29b08eb.entry.js +5 -0
  61. package/dist/bromcom-ui/p-a2b5a278.entry.js +5 -0
  62. package/dist/bromcom-ui/{p-a8d1397d.js → p-a3ffcb0d.js} +1 -1
  63. package/dist/bromcom-ui/p-a95d388e.js +5 -0
  64. package/dist/bromcom-ui/{p-34e9cd7a.entry.js → p-ac9f1774.entry.js} +1 -1
  65. package/dist/bromcom-ui/{p-f9cb7ae4.js → p-acb048b5.js} +1 -1
  66. package/dist/bromcom-ui/p-ad4cf3f3.entry.js +5 -0
  67. package/dist/bromcom-ui/p-b1b377e8.entry.js +5 -0
  68. package/dist/bromcom-ui/p-b4c617f6.entry.js +5 -0
  69. package/dist/bromcom-ui/p-b639def6.js +5 -0
  70. package/dist/bromcom-ui/p-b924d9b8.entry.js +5 -0
  71. package/dist/bromcom-ui/p-ba65d1dc.entry.js +5 -0
  72. package/dist/bromcom-ui/p-c1c18de5.entry.js +5 -0
  73. package/dist/bromcom-ui/p-c573addc.entry.js +5 -0
  74. package/dist/bromcom-ui/p-c5c9e76f.entry.js +5 -0
  75. package/dist/bromcom-ui/p-d6a11d39.entry.js +5 -0
  76. package/dist/bromcom-ui/p-da458f63.entry.js +5 -0
  77. package/dist/bromcom-ui/p-da7603b0.entry.js +5 -0
  78. package/dist/bromcom-ui/p-e0cb6ac3.entry.js +5 -0
  79. package/dist/bromcom-ui/p-e48c96b5.entry.js +5 -0
  80. package/dist/bromcom-ui/{p-e269d048.js → p-e7b229fb.js} +1 -1
  81. package/dist/bromcom-ui/p-e83e3eae.entry.js +5 -0
  82. package/dist/bromcom-ui/p-eb3aa16b.entry.js +5 -0
  83. package/dist/bromcom-ui/p-edec76e6.entry.js +5 -0
  84. package/dist/bromcom-ui/{p-b4e2c796.entry.js → p-f5ae5381.entry.js} +1 -1
  85. package/dist/bromcom-ui/p-f6685330.entry.js +5 -0
  86. package/dist/bromcom-ui/p-fc1ef08f.entry.js +5 -0
  87. package/dist/bromcom-ui/p-ff742ab4.entry.js +5 -0
  88. package/dist/cjs/bcm-accordion.cjs.entry.js +3 -3
  89. package/dist/cjs/bcm-alert.cjs.entry.js +7 -8
  90. package/dist/cjs/bcm-attendance.cjs.entry.js +3 -7
  91. package/dist/cjs/bcm-autocomplete.cjs.entry.js +3 -2
  92. package/dist/cjs/bcm-avatar_2.cjs.entry.js +15 -6
  93. package/dist/cjs/bcm-box.cjs.entry.js +2 -2
  94. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +4 -3
  95. package/dist/cjs/bcm-button-group.cjs.entry.js +5 -3
  96. package/dist/cjs/bcm-button_3.cjs.entry.js +539 -0
  97. package/dist/cjs/bcm-card.cjs.entry.js +7 -5
  98. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +12 -6
  99. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +40 -17
  100. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +11 -9
  101. package/dist/cjs/bcm-chip.cjs.entry.js +7 -3
  102. package/dist/cjs/bcm-collapse-group.cjs.entry.js +2 -2
  103. package/dist/cjs/bcm-collapse.cjs.entry.js +3 -3
  104. package/dist/cjs/bcm-colorpicker.cjs.entry.js +8 -9
  105. package/dist/cjs/bcm-date-picker.cjs.entry.js +10 -3
  106. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +1435 -0
  107. package/dist/cjs/bcm-default.cjs.entry.js +3 -3
  108. package/dist/cjs/bcm-drawer.cjs.entry.js +6 -9
  109. package/dist/cjs/bcm-dropdown.cjs.entry.js +13 -7
  110. package/dist/cjs/bcm-error-layout.cjs.entry.js +2 -2
  111. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +4 -3
  112. package/dist/cjs/bcm-form-2.cjs.entry.js +5 -5
  113. package/dist/cjs/bcm-form-group.cjs.entry.js +3 -2
  114. package/dist/cjs/bcm-form.cjs.entry.js +3 -2
  115. package/dist/cjs/bcm-input.cjs.entry.js +29 -13
  116. package/dist/cjs/bcm-item.cjs.entry.js +4 -3
  117. package/dist/cjs/bcm-items.cjs.entry.js +3 -3
  118. package/dist/cjs/bcm-label_2.cjs.entry.js +122 -0
  119. package/dist/cjs/bcm-link.cjs.entry.js +5 -2
  120. package/dist/cjs/bcm-linked.cjs.entry.js +7 -5
  121. package/dist/cjs/bcm-list.cjs.entry.js +26 -23
  122. package/dist/cjs/bcm-menu.cjs.entry.js +8 -10
  123. package/dist/cjs/bcm-message.cjs.entry.js +2 -5
  124. package/dist/cjs/bcm-notification.cjs.entry.js +4 -2
  125. package/dist/cjs/bcm-old-input.cjs.entry.js +411 -0
  126. package/dist/cjs/bcm-old-tag_2.cjs.entry.js +4 -2
  127. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +8 -3
  128. package/dist/cjs/bcm-popconfirm.cjs.entry.js +4 -3
  129. package/dist/cjs/bcm-popover.cjs.entry.js +5 -5
  130. package/dist/cjs/bcm-progress.cjs.entry.js +3 -3
  131. package/dist/cjs/bcm-radio-group.cjs.entry.js +16 -6
  132. package/dist/cjs/bcm-radio.cjs.entry.js +7 -6
  133. package/dist/cjs/bcm-range.cjs.entry.js +9 -3
  134. package/dist/cjs/bcm-result.cjs.entry.js +6 -2
  135. package/dist/cjs/bcm-search.cjs.entry.js +9 -13
  136. package/dist/cjs/bcm-select-group.cjs.entry.js +2 -1
  137. package/dist/cjs/bcm-select-option.cjs.entry.js +4 -1
  138. package/dist/cjs/bcm-select.cjs.entry.js +24 -13
  139. package/dist/cjs/bcm-skeleton.cjs.entry.js +3 -3
  140. package/dist/cjs/bcm-step.cjs.entry.js +10 -9
  141. package/dist/cjs/bcm-stepper.cjs.entry.js +5 -9
  142. package/dist/cjs/bcm-switch.cjs.entry.js +15 -5
  143. package/dist/cjs/bcm-tab-group.cjs.entry.js +4 -4
  144. package/dist/cjs/bcm-tab-pane.cjs.entry.js +2 -2
  145. package/dist/cjs/bcm-tab.cjs.entry.js +2 -5
  146. package/dist/cjs/bcm-table.cjs.entry.js +2 -2
  147. package/dist/cjs/bcm-tabs-content.cjs.entry.js +2 -2
  148. package/dist/cjs/bcm-tabs.cjs.entry.js +2 -8
  149. package/dist/cjs/bcm-tag.cjs.entry.js +7 -4
  150. package/dist/cjs/bcm-text.cjs.entry.js +5 -3
  151. package/dist/cjs/bcm-textarea.cjs.entry.js +16 -6
  152. package/dist/cjs/bcm-time-picker.cjs.entry.js +10 -3
  153. package/dist/cjs/bcm-timeline-item.cjs.entry.js +3 -5
  154. package/dist/cjs/bcm-timeline.cjs.entry.js +3 -5
  155. package/dist/cjs/bcm-treeview-group.cjs.entry.js +1 -1
  156. package/dist/cjs/bromcom-ui.cjs.js +3 -3
  157. package/dist/cjs/{caption-template-954d34bc.js → caption-template-95c791a2.js} +1 -1
  158. package/dist/cjs/{generate-bb74129d.js → generate-e91273b0.js} +1 -1
  159. package/dist/cjs/{index-f8547ecd.js → index-1d2ce51d.js} +1 -1
  160. package/dist/cjs/{index-9d98aa56.js → index-1fda1524.js} +473 -275
  161. package/dist/cjs/{input-template-8d849211.js → input-template-8d591f62.js} +2 -2
  162. package/dist/cjs/{is-load-decorator-65755a67.js → is-load-decorator-77664890.js} +1 -1
  163. package/dist/cjs/{json-parse-decarator-c7165900.js → json-parse-decarator-f014cca6.js} +2 -2
  164. package/dist/cjs/{label-template-1ed6a569.js → label-template-38d5c382.js} +2 -2
  165. package/dist/cjs/loader.cjs.js +3 -3
  166. package/dist/cjs/{number-helper-f3a12102.js → number-helper-54c0c852.js} +1 -1
  167. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +10 -4
  168. package/dist/cjs/old-bcm-popover.cjs.entry.js +6 -7
  169. package/dist/cjs/{slot-template-2ff0d22a.js → slot-template-84d37599.js} +1 -1
  170. package/dist/cjs/{stepper-states-82436ff7.js → stepper-states-b5763eec.js} +2 -2
  171. package/dist/cjs/{tooltip-helper-56706e14.js → tooltip-helper-932f081b.js} +3 -3
  172. package/dist/cjs/{validators-1ab45588.js → validators-40884433.js} +1 -1
  173. package/dist/collection/collection-manifest.json +2 -2
  174. package/dist/collection/components/atoms/avatar/avatar.js +197 -184
  175. package/dist/collection/components/atoms/badge/badge.js +174 -164
  176. package/dist/collection/components/atoms/box/box.js +8 -5
  177. package/dist/collection/components/atoms/button/button.js +392 -373
  178. package/dist/collection/components/atoms/chip/chip.js +143 -133
  179. package/dist/collection/components/atoms/divider/divider.js +61 -53
  180. package/dist/collection/components/atoms/icon/icon.js +57 -47
  181. package/dist/collection/components/atoms/label/label.js +192 -182
  182. package/dist/collection/components/atoms/link/link.js +138 -127
  183. package/dist/collection/components/atoms/tag/tag.js +286 -273
  184. package/dist/collection/components/atoms/typography/typography.js +8 -5
  185. package/dist/collection/components/molecules/accordion/accordion.js +72 -61
  186. package/dist/collection/components/molecules/alert/alert.js +218 -217
  187. package/dist/collection/components/molecules/breadcrumb/breadcrumb.js +110 -104
  188. package/dist/collection/components/molecules/breadcrumb/types.js +0 -4
  189. package/dist/collection/components/molecules/button-group/button-group.js +159 -144
  190. package/dist/collection/components/molecules/card/card.js +83 -73
  191. package/dist/collection/components/molecules/checkbox/checkbox-lite.js +175 -176
  192. package/dist/collection/components/molecules/checkbox/checkbox.js +536 -524
  193. package/dist/collection/components/molecules/checkbox/group.js +589 -571
  194. package/dist/collection/components/molecules/drawer/drawer.js +193 -189
  195. package/dist/collection/components/molecules/dropdown/dropdown.js +654 -639
  196. package/dist/collection/components/molecules/empty/empty.js +32 -26
  197. package/dist/collection/components/molecules/error-layout/error-layout.js +126 -111
  198. package/dist/collection/components/molecules/error-layout/types.js +0 -4
  199. package/dist/collection/components/molecules/expansion-panel/expansion-panel.js +212 -212
  200. package/dist/collection/components/molecules/input/input.js +891 -858
  201. package/dist/collection/components/molecules/item/item.js +95 -85
  202. package/dist/collection/components/molecules/items/items.js +46 -38
  203. package/dist/collection/components/molecules/linked/linked.js +250 -239
  204. package/dist/collection/components/molecules/menu/menu.js +426 -420
  205. package/dist/collection/components/molecules/message/message.js +149 -144
  206. package/dist/collection/components/molecules/modal/modal.js +261 -252
  207. package/dist/collection/components/molecules/notification/notification.js +167 -161
  208. package/dist/collection/components/molecules/popconfirm/popconfirm-box.js +299 -285
  209. package/dist/collection/components/molecules/popconfirm/popconfirm.js +293 -277
  210. package/dist/collection/components/molecules/popover/popover.js +190 -181
  211. package/dist/collection/components/molecules/progress/progress.js +255 -262
  212. package/dist/collection/components/molecules/radio/group.js +518 -495
  213. package/dist/collection/components/molecules/radio/radio.js +212 -207
  214. package/dist/collection/components/molecules/range/range.js +289 -285
  215. package/dist/collection/components/molecules/result/result.js +104 -97
  216. package/dist/collection/components/molecules/search/search.js +308 -295
  217. package/dist/collection/components/molecules/skeleton/skeleton.js +47 -52
  218. package/dist/collection/components/molecules/stepper/step.js +281 -271
  219. package/dist/collection/components/molecules/stepper/stepper.js +309 -300
  220. package/dist/collection/components/molecules/switch/switch.js +598 -583
  221. package/dist/collection/components/molecules/tab-group/tab-group.js +126 -120
  222. package/dist/collection/components/molecules/textarea/textarea.js +622 -597
  223. package/dist/collection/components/molecules/timeline/timeline-item.js +125 -120
  224. package/dist/collection/components/molecules/timeline/timeline.js +79 -71
  225. package/dist/collection/components/molecules/tooltip/tooltip.js +173 -164
  226. package/dist/collection/components/organism/autocomplete/autocomplete.js +260 -247
  227. package/dist/collection/components/organism/colorpicker/colorpicker.js +360 -368
  228. package/dist/collection/components/organism/date-picker/date-picker.js +626 -604
  229. package/dist/collection/components/organism/datetime-picker/datetime-picker.js +750 -775
  230. package/dist/collection/components/organism/form/form-group.js +108 -99
  231. package/dist/collection/components/organism/form/form.js +253 -238
  232. package/dist/collection/components/organism/form-2/form-2.js +164 -149
  233. package/dist/collection/components/organism/list/list.js +1133 -1128
  234. package/dist/collection/components/organism/time-picker/time-picker.js +502 -484
  235. package/dist/collection/components/other/attendance/attendance.js +60 -61
  236. package/dist/collection/components/other/data-table/table.js +40 -30
  237. package/dist/collection/components/other/default/default.js +40 -32
  238. package/dist/collection/components/other_deprecated/collapse/collapse.js +125 -119
  239. package/dist/collection/components/other_deprecated/collapse/group.js +90 -83
  240. package/dist/collection/components/other_deprecated/listbox/listbox-group.js +68 -68
  241. package/dist/collection/components/other_deprecated/listbox/listbox-item.js +500 -495
  242. package/dist/collection/components/other_deprecated/listbox/listbox.js +1067 -1071
  243. package/dist/collection/components/other_deprecated/old-input/old-input.js +786 -775
  244. package/dist/collection/components/other_deprecated/old-popover/old-popover-box.js +285 -267
  245. package/dist/collection/components/other_deprecated/old-popover/old-popover.js +214 -202
  246. package/dist/collection/components/other_deprecated/old-search/old-search.js +333 -314
  247. package/dist/collection/components/other_deprecated/old-tag/old-tag.js +247 -241
  248. package/dist/collection/components/other_deprecated/select/group.js +68 -67
  249. package/dist/collection/components/other_deprecated/select/option.js +120 -111
  250. package/dist/collection/components/other_deprecated/select/select-box.js +77 -71
  251. package/dist/collection/components/other_deprecated/select/select.js +1096 -1093
  252. package/dist/collection/components/other_deprecated/tabs/tab-pane.js +121 -111
  253. package/dist/collection/components/other_deprecated/tabs/tab.js +229 -226
  254. package/dist/collection/components/other_deprecated/tabs/tabs-content.js +108 -98
  255. package/dist/collection/components/other_deprecated/tabs/tabs.js +423 -411
  256. package/dist/collection/components/other_deprecated/text/text.js +125 -117
  257. package/dist/collection/components/other_deprecated/treeview/treeview-group.js +11 -7
  258. package/dist/collection/components/other_deprecated/treeview/treeview-item.js +651 -646
  259. package/dist/collection/components/other_deprecated/treeview/treeview.js +882 -874
  260. package/dist/collection/index.js +0 -4
  261. package/dist/collection/models/bcm-types.js +0 -4
  262. package/dist/collection/models/states/atoms/bcm-atoms-state.js +0 -4
  263. package/dist/collection/models/states/molecules/bcm-molecules-state.js +0 -4
  264. package/dist/collection/models/states/organisms/bcm-organisms-state.js +0 -4
  265. package/dist/collection/templates/button-template.js +1 -12
  266. package/dist/collection/templates/caption-template.js +3 -14
  267. package/dist/collection/templates/checkbox-template.js +1 -5
  268. package/dist/collection/templates/info-footer-template.js +1 -6
  269. package/dist/collection/templates/input-template.js +8 -29
  270. package/dist/collection/templates/label-template.js +1 -5
  271. package/dist/collection/templates/list-item-template.js +2 -9
  272. package/dist/collection/templates/list-template.js +1 -14
  273. package/dist/collection/templates/slot-template.js +1 -2
  274. package/dist/collection/templates/step-template.js +1 -5
  275. package/dist/collection/templates/tag-template.js +1 -10
  276. package/dist/collection/types/index.js +0 -4
  277. package/dist/components/avatar.js +5 -0
  278. package/dist/components/badge.js +4 -0
  279. package/dist/components/bcm-alert.js +3 -4
  280. package/dist/components/bcm-attendance.js +0 -4
  281. package/dist/components/bcm-autocomplete.js +1 -0
  282. package/dist/components/bcm-breadcrumb.js +1 -0
  283. package/dist/components/bcm-button-group.js +2 -0
  284. package/dist/components/bcm-card.js +3 -1
  285. package/dist/components/bcm-checkbox-group.js +6 -0
  286. package/dist/components/bcm-chip.js +4 -0
  287. package/dist/components/bcm-colorpicker.js +6 -7
  288. package/dist/components/bcm-date-picker.js +7 -0
  289. package/dist/components/bcm-drawer.js +1 -4
  290. package/dist/components/bcm-dropdown.js +9 -3
  291. package/dist/components/bcm-expansion-panel.js +1 -0
  292. package/dist/components/bcm-form-2.js +2 -2
  293. package/dist/components/bcm-form-group.js +1 -0
  294. package/dist/components/bcm-form.js +1 -0
  295. package/dist/components/bcm-input.js +22 -6
  296. package/dist/components/bcm-item.js +1 -0
  297. package/dist/components/bcm-linked.js +2 -0
  298. package/dist/components/bcm-list.js +15 -12
  299. package/dist/components/bcm-message.js +0 -3
  300. package/dist/components/bcm-modal.js +2 -0
  301. package/dist/components/bcm-notification.js +2 -0
  302. package/dist/components/bcm-popconfirm.js +1 -0
  303. package/dist/components/bcm-radio-group.js +11 -1
  304. package/dist/components/bcm-range.js +6 -0
  305. package/dist/components/bcm-result.js +4 -0
  306. package/dist/components/bcm-select-group.js +1 -0
  307. package/dist/components/bcm-select-option.js +3 -0
  308. package/dist/components/bcm-select.js +22 -11
  309. package/dist/components/bcm-stepper.js +0 -4
  310. package/dist/components/bcm-switch.js +11 -1
  311. package/dist/components/bcm-tab-group.js +1 -1
  312. package/dist/components/bcm-tab.js +0 -3
  313. package/dist/components/bcm-tabs.js +0 -6
  314. package/dist/components/bcm-tag.js +3 -0
  315. package/dist/components/bcm-textarea.js +11 -1
  316. package/dist/components/bcm-time-picker.js +7 -0
  317. package/dist/components/bcm-timeline-item.js +1 -3
  318. package/dist/components/bcm-timeline.js +1 -3
  319. package/dist/components/button.js +6 -0
  320. package/dist/components/checkbox.js +6 -4
  321. package/dist/components/datetime-picker.js +9 -6
  322. package/dist/components/empty.js +1 -0
  323. package/dist/components/generate.js +1 -1
  324. package/dist/components/icon.js +1 -0
  325. package/dist/components/label.js +4 -1
  326. package/dist/components/link.js +3 -0
  327. package/dist/components/listbox-group.js +1 -0
  328. package/dist/components/listbox-item.js +7 -0
  329. package/dist/components/listbox.js +16 -9
  330. package/dist/components/menu.js +2 -4
  331. package/dist/components/old-bcm-popover.js +3 -4
  332. package/dist/components/old-input.js +14 -1
  333. package/dist/components/old-popover-box.js +6 -0
  334. package/dist/components/old-tag.js +2 -0
  335. package/dist/components/popconfirm-box.js +5 -0
  336. package/dist/components/radio.js +3 -2
  337. package/dist/components/search.js +4 -8
  338. package/dist/components/step.js +5 -4
  339. package/dist/components/text.js +2 -0
  340. package/dist/components/treeview-item.js +5 -1
  341. package/dist/components/treeview.js +7 -4
  342. package/dist/esm/bcm-accordion.entry.js +3 -3
  343. package/dist/esm/bcm-alert.entry.js +7 -8
  344. package/dist/esm/bcm-attendance.entry.js +3 -7
  345. package/dist/esm/bcm-autocomplete.entry.js +3 -2
  346. package/dist/esm/bcm-avatar_2.entry.js +18 -9
  347. package/dist/esm/bcm-box.entry.js +2 -2
  348. package/dist/esm/bcm-breadcrumb.entry.js +4 -3
  349. package/dist/esm/bcm-button-group.entry.js +5 -3
  350. package/dist/esm/bcm-button_3.entry.js +533 -0
  351. package/dist/esm/bcm-card.entry.js +9 -7
  352. package/dist/esm/bcm-checkbox-group.entry.js +13 -7
  353. package/dist/esm/bcm-checkbox-lite_9.entry.js +41 -18
  354. package/dist/esm/bcm-checkbox_2.entry.js +13 -11
  355. package/dist/esm/bcm-chip.entry.js +9 -5
  356. package/dist/esm/bcm-collapse-group.entry.js +3 -3
  357. package/dist/esm/bcm-collapse.entry.js +3 -3
  358. package/dist/esm/bcm-colorpicker.entry.js +10 -11
  359. package/dist/esm/bcm-date-picker.entry.js +11 -4
  360. package/dist/esm/bcm-datetime-picker.entry.js +1431 -0
  361. package/dist/esm/bcm-default.entry.js +3 -3
  362. package/dist/esm/bcm-drawer.entry.js +9 -12
  363. package/dist/esm/bcm-dropdown.entry.js +13 -7
  364. package/dist/esm/bcm-error-layout.entry.js +2 -2
  365. package/dist/esm/bcm-expansion-panel.entry.js +6 -5
  366. package/dist/esm/bcm-form-2.entry.js +5 -5
  367. package/dist/esm/bcm-form-group.entry.js +3 -2
  368. package/dist/esm/bcm-form.entry.js +4 -3
  369. package/dist/esm/bcm-input.entry.js +30 -14
  370. package/dist/esm/bcm-item.entry.js +6 -5
  371. package/dist/esm/bcm-items.entry.js +3 -3
  372. package/dist/esm/bcm-label_2.entry.js +117 -0
  373. package/dist/esm/bcm-link.entry.js +5 -2
  374. package/dist/esm/bcm-linked.entry.js +10 -8
  375. package/dist/esm/bcm-list.entry.js +29 -26
  376. package/dist/esm/bcm-menu.entry.js +11 -13
  377. package/dist/esm/bcm-message.entry.js +2 -5
  378. package/dist/esm/bcm-notification.entry.js +4 -2
  379. package/dist/esm/bcm-old-input.entry.js +407 -0
  380. package/dist/esm/bcm-old-tag_2.entry.js +5 -3
  381. package/dist/esm/bcm-popconfirm-box.entry.js +10 -5
  382. package/dist/esm/bcm-popconfirm.entry.js +4 -3
  383. package/dist/esm/bcm-popover.entry.js +8 -8
  384. package/dist/esm/bcm-progress.entry.js +5 -5
  385. package/dist/esm/bcm-radio-group.entry.js +17 -7
  386. package/dist/esm/bcm-radio.entry.js +9 -8
  387. package/dist/esm/bcm-range.entry.js +10 -4
  388. package/dist/esm/bcm-result.entry.js +6 -2
  389. package/dist/esm/bcm-search.entry.js +10 -14
  390. package/dist/esm/bcm-select-group.entry.js +2 -1
  391. package/dist/esm/bcm-select-option.entry.js +4 -1
  392. package/dist/esm/bcm-select.entry.js +25 -14
  393. package/dist/esm/bcm-skeleton.entry.js +3 -3
  394. package/dist/esm/bcm-step.entry.js +10 -9
  395. package/dist/esm/bcm-stepper.entry.js +6 -10
  396. package/dist/esm/bcm-switch.entry.js +16 -6
  397. package/dist/esm/bcm-tab-group.entry.js +4 -4
  398. package/dist/esm/bcm-tab-pane.entry.js +2 -2
  399. package/dist/esm/bcm-tab.entry.js +2 -5
  400. package/dist/esm/bcm-table.entry.js +3 -3
  401. package/dist/esm/bcm-tabs-content.entry.js +3 -3
  402. package/dist/esm/bcm-tabs.entry.js +3 -9
  403. package/dist/esm/bcm-tag.entry.js +8 -5
  404. package/dist/esm/bcm-text.entry.js +7 -5
  405. package/dist/esm/bcm-textarea.entry.js +17 -7
  406. package/dist/esm/bcm-time-picker.entry.js +11 -4
  407. package/dist/esm/bcm-timeline-item.entry.js +3 -5
  408. package/dist/esm/bcm-timeline.entry.js +3 -5
  409. package/dist/esm/bcm-treeview-group.entry.js +1 -1
  410. package/dist/esm/bromcom-ui.js +3 -3
  411. package/dist/esm/{caption-template-d54ee0c3.js → caption-template-e7d51661.js} +1 -1
  412. package/dist/esm/{color-helper-b5e9aa56.js → color-helper-7e202fd8.js} +1 -1
  413. package/dist/esm/{element-dragger-7ea06c76.js → element-dragger-89bb52fd.js} +1 -1
  414. package/dist/esm/{generate-a9881049.js → generate-ba9e1f0b.js} +1 -1
  415. package/dist/esm/{index-2a3eeccc.js → index-58077b32.js} +473 -275
  416. package/dist/esm/{index-6e950253.js → index-6bdec00d.js} +1 -1
  417. package/dist/esm/{input-template-9fceea5b.js → input-template-569671e3.js} +2 -2
  418. package/dist/esm/{is-load-decorator-b990575a.js → is-load-decorator-d57b8f9e.js} +1 -1
  419. package/dist/esm/{json-parse-decarator-c325c1dc.js → json-parse-decarator-ae9a53d6.js} +2 -2
  420. package/dist/esm/{label-template-e3eebfbc.js → label-template-f352ef5b.js} +2 -2
  421. package/dist/esm/loader.js +3 -3
  422. package/dist/esm/{number-helper-34328380.js → number-helper-4313dc1c.js} +1 -1
  423. package/dist/esm/old-bcm-popover-box.entry.js +12 -6
  424. package/dist/esm/old-bcm-popover.entry.js +6 -7
  425. package/dist/esm/polyfills/css-shim.js +1 -1
  426. package/dist/esm/{slot-template-877c4e01.js → slot-template-aee2ff75.js} +1 -1
  427. package/dist/esm/{stepper-states-bd4ca5d4.js → stepper-states-13781383.js} +2 -2
  428. package/dist/esm/{tooltip-helper-1a392c00.js → tooltip-helper-8c88ed15.js} +5 -5
  429. package/dist/esm/{utils-b3338faf.js → utils-57652744.js} +1 -1
  430. package/dist/esm/{validators-69843fd0.js → validators-66dd02d3.js} +1 -1
  431. package/dist/types/stencil-public-runtime.d.ts +20 -4
  432. package/loader/package.json +1 -0
  433. package/package.json +1 -1
  434. package/dist/bromcom-ui/p-02892da0.entry.js +0 -5
  435. package/dist/bromcom-ui/p-05c3f64a.js +0 -5
  436. package/dist/bromcom-ui/p-0a34e8ce.entry.js +0 -5
  437. package/dist/bromcom-ui/p-0a97248d.js +0 -5
  438. package/dist/bromcom-ui/p-10caf4ce.js +0 -6
  439. package/dist/bromcom-ui/p-14ad99d5.entry.js +0 -5
  440. package/dist/bromcom-ui/p-243c1232.entry.js +0 -5
  441. package/dist/bromcom-ui/p-2cfa8d1a.js +0 -5
  442. package/dist/bromcom-ui/p-2e38b7ea.entry.js +0 -5
  443. package/dist/bromcom-ui/p-340720fb.entry.js +0 -5
  444. package/dist/bromcom-ui/p-36885946.entry.js +0 -5
  445. package/dist/bromcom-ui/p-3ebe6022.entry.js +0 -5
  446. package/dist/bromcom-ui/p-454e1d24.js +0 -5
  447. package/dist/bromcom-ui/p-4be4c5bf.js +0 -5
  448. package/dist/bromcom-ui/p-4cc3e4dd.entry.js +0 -5
  449. package/dist/bromcom-ui/p-4d419811.entry.js +0 -5
  450. package/dist/bromcom-ui/p-4eca8b88.entry.js +0 -5
  451. package/dist/bromcom-ui/p-4f9a5b60.entry.js +0 -5
  452. package/dist/bromcom-ui/p-4fc53045.entry.js +0 -5
  453. package/dist/bromcom-ui/p-522c96a2.js +0 -5
  454. package/dist/bromcom-ui/p-53ac0ebf.entry.js +0 -5
  455. package/dist/bromcom-ui/p-640244fa.entry.js +0 -5
  456. package/dist/bromcom-ui/p-6ad01d01.entry.js +0 -5
  457. package/dist/bromcom-ui/p-6c7eb43f.entry.js +0 -5
  458. package/dist/bromcom-ui/p-751c94dd.entry.js +0 -5
  459. package/dist/bromcom-ui/p-799d326b.entry.js +0 -5
  460. package/dist/bromcom-ui/p-7ee1e704.entry.js +0 -5
  461. package/dist/bromcom-ui/p-7f065a45.entry.js +0 -5
  462. package/dist/bromcom-ui/p-82ca33ab.entry.js +0 -5
  463. package/dist/bromcom-ui/p-875ef930.entry.js +0 -5
  464. package/dist/bromcom-ui/p-8f3099a6.entry.js +0 -5
  465. package/dist/bromcom-ui/p-90057167.entry.js +0 -5
  466. package/dist/bromcom-ui/p-95884484.entry.js +0 -5
  467. package/dist/bromcom-ui/p-a08d69f0.entry.js +0 -5
  468. package/dist/bromcom-ui/p-a1c849e7.js +0 -5
  469. package/dist/bromcom-ui/p-ad9303de.entry.js +0 -5
  470. package/dist/bromcom-ui/p-ae18981d.entry.js +0 -5
  471. package/dist/bromcom-ui/p-b4a2ee54.entry.js +0 -5
  472. package/dist/bromcom-ui/p-b4cbf3bd.entry.js +0 -5
  473. package/dist/bromcom-ui/p-bc56ec8a.entry.js +0 -5
  474. package/dist/bromcom-ui/p-bd74b025.entry.js +0 -5
  475. package/dist/bromcom-ui/p-bf30bf7f.entry.js +0 -5
  476. package/dist/bromcom-ui/p-c6bbfd20.entry.js +0 -5
  477. package/dist/bromcom-ui/p-cda77af6.entry.js +0 -5
  478. package/dist/bromcom-ui/p-ceba9b7a.entry.js +0 -5
  479. package/dist/bromcom-ui/p-d0f6a6bc.entry.js +0 -5
  480. package/dist/bromcom-ui/p-d11d1f5a.entry.js +0 -5
  481. package/dist/bromcom-ui/p-d24617c8.entry.js +0 -5
  482. package/dist/bromcom-ui/p-d40ebb43.entry.js +0 -5
  483. package/dist/bromcom-ui/p-da1489e5.entry.js +0 -5
  484. package/dist/bromcom-ui/p-dd0f2ded.entry.js +0 -5
  485. package/dist/bromcom-ui/p-de4e1e66.entry.js +0 -5
  486. package/dist/bromcom-ui/p-e467d49f.entry.js +0 -5
  487. package/dist/bromcom-ui/p-e9f81882.entry.js +0 -5
  488. package/dist/bromcom-ui/p-eb892c04.entry.js +0 -5
  489. package/dist/bromcom-ui/p-f2eeb1aa.entry.js +0 -5
  490. package/dist/bromcom-ui/p-fa42b2de.entry.js +0 -5
  491. package/dist/bromcom-ui/p-fb7fd3f4.entry.js +0 -5
  492. package/dist/bromcom-ui/p-fda71519.entry.js +0 -5
  493. package/dist/cjs/bcm-button_7.cjs.entry.js +0 -2424
  494. package/dist/cjs/property-decorators-cb2155ed.js +0 -33
  495. package/dist/components/property-decorators.js +0 -31
  496. package/dist/esm/bcm-button_7.entry.js +0 -2414
  497. package/dist/esm/property-decorators-f3f1e7de.js +0 -31
@@ -26,6 +26,14 @@ function _interopNamespace(e) {
26
26
 
27
27
  const NAMESPACE = 'bromcom-ui';
28
28
 
29
+ /**
30
+ * Virtual DOM patching algorithm based on Snabbdom by
31
+ * Simon Friis Vindum (@paldepind)
32
+ * Licensed under the MIT License
33
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
34
+ *
35
+ * Modified for Stencil's renderer and slot projection
36
+ */
29
37
  let scopeId;
30
38
  let contentRef;
31
39
  let hostTagName;
@@ -35,65 +43,10 @@ let checkSlotRelocate = false;
35
43
  let isSvgMode = false;
36
44
  let renderingRef = null;
37
45
  let queuePending = false;
38
- const win = typeof window !== 'undefined' ? window : {};
39
- const doc = win.document || { head: {} };
40
- const plt = {
41
- $flags$: 0,
42
- $resourcesUrl$: '',
43
- jmp: (h) => h(),
44
- raf: (h) => requestAnimationFrame(h),
45
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
46
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
47
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
48
- };
49
- const promiseResolve = (v) => Promise.resolve(v);
50
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
51
- try {
52
- new CSSStyleSheet();
53
- return typeof new CSSStyleSheet().replaceSync === 'function';
54
- }
55
- catch (e) { }
56
- return false;
57
- })()
58
- ;
59
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
60
- if (listeners) {
61
- listeners.map(([flags, name, method]) => {
62
- const target = getHostListenerTarget(elm, flags) ;
63
- const handler = hostListenerProxy(hostRef, method);
64
- const opts = hostListenerOpts(flags);
65
- plt.ael(target, name, handler, opts);
66
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
67
- });
68
- }
69
- };
70
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
71
- try {
72
- {
73
- if (hostRef.$flags$ & 256 /* isListenReady */) {
74
- // instance is ready, let's call it's member method for this event
75
- hostRef.$lazyInstance$[methodName](ev);
76
- }
77
- else {
78
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
79
- }
80
- }
81
- }
82
- catch (e) {
83
- consoleError(e);
84
- }
85
- };
86
- const getHostListenerTarget = (elm, flags) => {
87
- if (flags & 4 /* TargetDocument */)
88
- return doc;
89
- if (flags & 8 /* TargetWindow */)
90
- return win;
91
- return elm;
46
+ const getAssetPath = (path) => {
47
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
48
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
92
49
  };
93
- // prettier-ignore
94
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
95
- const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
96
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
97
50
  const createTime = (fnName, tagName = '') => {
98
51
  {
99
52
  return () => {
@@ -108,76 +61,8 @@ const uniqueTime = (key, measureText) => {
108
61
  };
109
62
  }
110
63
  };
111
- const rootAppliedStyles = new WeakMap();
112
- const registerStyle = (scopeId, cssText, allowCS) => {
113
- let style = styles.get(scopeId);
114
- if (supportsConstructableStylesheets && allowCS) {
115
- style = (style || new CSSStyleSheet());
116
- if (typeof style === 'string') {
117
- style = cssText;
118
- }
119
- else {
120
- style.replaceSync(cssText);
121
- }
122
- }
123
- else {
124
- style = cssText;
125
- }
126
- styles.set(scopeId, style);
127
- };
128
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
129
- let scopeId = getScopeId(cmpMeta);
130
- const style = styles.get(scopeId);
131
- // if an element is NOT connected then getRootNode() will return the wrong root node
132
- // so the fallback is to always use the document for the root node in those cases
133
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
134
- if (style) {
135
- if (typeof style === 'string') {
136
- styleContainerNode = styleContainerNode.head || styleContainerNode;
137
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
138
- let styleElm;
139
- if (!appliedStyles) {
140
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
141
- }
142
- if (!appliedStyles.has(scopeId)) {
143
- {
144
- {
145
- styleElm = doc.createElement('style');
146
- styleElm.innerHTML = style;
147
- }
148
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
149
- }
150
- if (appliedStyles) {
151
- appliedStyles.add(scopeId);
152
- }
153
- }
154
- }
155
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
156
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
157
- }
158
- }
159
- return scopeId;
160
- };
161
- const attachStyles = (hostRef) => {
162
- const cmpMeta = hostRef.$cmpMeta$;
163
- const elm = hostRef.$hostElement$;
164
- const flags = cmpMeta.$flags$;
165
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
166
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
167
- if (flags & 10 /* needsScopedEncapsulation */) {
168
- // only required when we're NOT using native shadow dom (slot)
169
- // or this browser doesn't support native shadow dom
170
- // and this host element was NOT created with SSR
171
- // let's pick out the inner content for slot projection
172
- // create a node to represent where the original
173
- // content was first placed, which is useful later on
174
- // DOM WRITE!!
175
- elm['s-sc'] = scopeId;
176
- elm.classList.add(scopeId + '-h');
177
- }
178
- endAttachStyles();
179
- };
180
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
64
+ const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
65
+ const XLINK_NS = 'http://www.w3.org/1999/xlink';
181
66
  /**
182
67
  * Default style mode id
183
68
  */
@@ -326,6 +211,149 @@ const convertToPrivate = (node) => {
326
211
  vnode.$name$ = node.vname;
327
212
  return vnode;
328
213
  };
214
+ /**
215
+ * Parse a new property value for a given property type.
216
+ *
217
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
218
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
219
+ * 1. `any`, the type given to `propValue` in the function signature
220
+ * 2. the type stored from `propType`.
221
+ *
222
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
223
+ *
224
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
225
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
226
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
227
+ * ```tsx
228
+ * <my-cmp prop-val={0}></my-cmp>
229
+ * ```
230
+ *
231
+ * HTML prop values on the other hand, will always a string
232
+ *
233
+ * @param propValue the new value to coerce to some type
234
+ * @param propType the type of the prop, expressed as a binary number
235
+ * @returns the parsed/coerced value
236
+ */
237
+ const parsePropertyValue = (propValue, propType) => {
238
+ // ensure this value is of the correct prop type
239
+ if (propValue != null && !isComplexType(propValue)) {
240
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
241
+ // per the HTML spec, any string value means it is a boolean true value
242
+ // but we'll cheat here and say that the string "false" is the boolean false
243
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
244
+ }
245
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
246
+ // force it to be a number
247
+ return parseFloat(propValue);
248
+ }
249
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
250
+ // could have been passed as a number or boolean
251
+ // but we still want it as a string
252
+ return String(propValue);
253
+ }
254
+ // redundant return here for better minification
255
+ return propValue;
256
+ }
257
+ // not sure exactly what type we want
258
+ // so no need to change to a different type
259
+ return propValue;
260
+ };
261
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
262
+ const createEvent = (ref, name, flags) => {
263
+ const elm = getElement(ref);
264
+ return {
265
+ emit: (detail) => {
266
+ return emitEvent(elm, name, {
267
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
268
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
269
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
270
+ detail,
271
+ });
272
+ },
273
+ };
274
+ };
275
+ /**
276
+ * Helper function to create & dispatch a custom Event on a provided target
277
+ * @param elm the target of the Event
278
+ * @param name the name to give the custom Event
279
+ * @param opts options for configuring a custom Event
280
+ * @returns the custom Event
281
+ */
282
+ const emitEvent = (elm, name, opts) => {
283
+ const ev = plt.ce(name, opts);
284
+ elm.dispatchEvent(ev);
285
+ return ev;
286
+ };
287
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
288
+ const registerStyle = (scopeId, cssText, allowCS) => {
289
+ let style = styles.get(scopeId);
290
+ if (supportsConstructableStylesheets && allowCS) {
291
+ style = (style || new CSSStyleSheet());
292
+ if (typeof style === 'string') {
293
+ style = cssText;
294
+ }
295
+ else {
296
+ style.replaceSync(cssText);
297
+ }
298
+ }
299
+ else {
300
+ style = cssText;
301
+ }
302
+ styles.set(scopeId, style);
303
+ };
304
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
305
+ let scopeId = getScopeId(cmpMeta);
306
+ const style = styles.get(scopeId);
307
+ // if an element is NOT connected then getRootNode() will return the wrong root node
308
+ // so the fallback is to always use the document for the root node in those cases
309
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
310
+ if (style) {
311
+ if (typeof style === 'string') {
312
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
313
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
314
+ let styleElm;
315
+ if (!appliedStyles) {
316
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
317
+ }
318
+ if (!appliedStyles.has(scopeId)) {
319
+ {
320
+ {
321
+ styleElm = doc.createElement('style');
322
+ styleElm.innerHTML = style;
323
+ }
324
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
325
+ }
326
+ if (appliedStyles) {
327
+ appliedStyles.add(scopeId);
328
+ }
329
+ }
330
+ }
331
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
332
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
333
+ }
334
+ }
335
+ return scopeId;
336
+ };
337
+ const attachStyles = (hostRef) => {
338
+ const cmpMeta = hostRef.$cmpMeta$;
339
+ const elm = hostRef.$hostElement$;
340
+ const flags = cmpMeta.$flags$;
341
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
342
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
343
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
344
+ // only required when we're NOT using native shadow dom (slot)
345
+ // or this browser doesn't support native shadow dom
346
+ // and this host element was NOT created with SSR
347
+ // let's pick out the inner content for slot projection
348
+ // create a node to represent where the original
349
+ // content was first placed, which is useful later on
350
+ // DOM WRITE!!
351
+ elm['s-sc'] = scopeId;
352
+ elm.classList.add(scopeId + '-h');
353
+ }
354
+ endAttachStyles();
355
+ };
356
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
329
357
  /**
330
358
  * Production setAccessor() function based on Preact by
331
359
  * Jason Miller (@developit)
@@ -462,7 +490,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
462
490
  }
463
491
  }
464
492
  }
465
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
493
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
466
494
  newValue = newValue === true ? '' : newValue;
467
495
  if (xlink) {
468
496
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
@@ -480,7 +508,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
480
508
  // if the element passed in is a shadow root, which is a document fragment
481
509
  // then we want to be adding attrs/props to the shadow root's "host" element
482
510
  // if it's not a shadow root, then we add attrs/props to the same element
483
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
511
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
484
512
  ? newVnode.$elm$.host
485
513
  : newVnode.$elm$;
486
514
  const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
@@ -498,6 +526,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
498
526
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
499
527
  }
500
528
  };
529
+ /**
530
+ * Create a DOM Node corresponding to one of the children of a given VNode.
531
+ *
532
+ * @param oldParentVNode the parent VNode from the previous render
533
+ * @param newParentVNode the parent VNode from the current render
534
+ * @param childIndex the index of the VNode, in the _new_ parent node's
535
+ * children, for which we will create a new DOM node
536
+ * @param parentElm the parent DOM node which our new node will be a child of
537
+ * @returns the newly created node
538
+ */
501
539
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
502
540
  // tslint:disable-next-line: prefer-const
503
541
  const newVNode = newParentVNode.$children$[childIndex];
@@ -515,16 +553,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
515
553
  }
516
554
  newVNode.$flags$ |= newVNode.$children$
517
555
  ? // slot element has fallback content
518
- 2 /* isSlotFallback */
556
+ 2 /* VNODE_FLAGS.isSlotFallback */
519
557
  : // slot element does not have fallback content
520
- 1 /* isSlotReference */;
558
+ 1 /* VNODE_FLAGS.isSlotReference */;
521
559
  }
522
560
  }
523
561
  if (newVNode.$text$ !== null) {
524
562
  // create text node
525
563
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
526
564
  }
527
- else if (newVNode.$flags$ & 1 /* isSlotReference */) {
565
+ else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
528
566
  // create a slot reference node
529
567
  elm = newVNode.$elm$ =
530
568
  doc.createTextNode('');
@@ -534,7 +572,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
534
572
  isSvgMode = newVNode.$tag$ === 'svg';
535
573
  }
536
574
  // create element
537
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
575
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
538
576
  ? 'slot-fb'
539
577
  : newVNode.$tag$)
540
578
  );
@@ -574,7 +612,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
574
612
  }
575
613
  {
576
614
  elm['s-hn'] = hostTagName;
577
- if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
615
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
578
616
  // remember the content reference comment
579
617
  elm['s-sr'] = true;
580
618
  // remember the content reference comment
@@ -593,7 +631,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
593
631
  return elm;
594
632
  };
595
633
  const putBackInOriginalLocation = (parentElm, recursive) => {
596
- plt.$flags$ |= 1 /* isTmpDisconnected */;
634
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
597
635
  const oldSlotChildNodes = parentElm.childNodes;
598
636
  for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
599
637
  const childNode = oldSlotChildNodes[i];
@@ -614,7 +652,7 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
614
652
  putBackInOriginalLocation(childNode, recursive);
615
653
  }
616
654
  }
617
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
655
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
618
656
  };
619
657
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
620
658
  let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
@@ -656,6 +694,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
656
694
  }
657
695
  }
658
696
  };
697
+ /**
698
+ * Reconcile the children of a new VNode with the children of an old VNode by
699
+ * traversing the two collections of children, identifying nodes that are
700
+ * conserved or changed, calling out to `patch` to make any necessary
701
+ * updates to the DOM, and rearranging DOM nodes as needed.
702
+ *
703
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
704
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
705
+ * 'windows' by storing start and end indices and references to the
706
+ * corresponding array entries. Initially the two 'windows' are basically equal
707
+ * to the entire array, but we progressively narrow the windows until there are
708
+ * no children left to update by doing the following:
709
+ *
710
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
711
+ * that if we have an initial array like the following we'll end up dealing
712
+ * only with a window bounded by the highlighted elements:
713
+ *
714
+ * [null, null, VNode1 , ... , VNode2, null, null]
715
+ * ^^^^^^ ^^^^^^
716
+ *
717
+ * 2. Check to see if the elements at the head and tail positions are equal
718
+ * across the windows. This will basically detect elements which haven't
719
+ * been added, removed, or changed position, i.e. if you had the following
720
+ * VNode elements (represented as HTML):
721
+ *
722
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
723
+ * newVNode: `<div><p><span>THERE</span></p></div>`
724
+ *
725
+ * Then when comparing the children of the `<div>` tag we check the equality
726
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
727
+ * same tag in the same position, we'd be able to avoid completely
728
+ * re-rendering the subtree under them with a new DOM element and would just
729
+ * call out to `patch` to handle reconciling their children and so on.
730
+ *
731
+ * 3. Check, for both windows, to see if the element at the beginning of the
732
+ * window corresponds to the element at the end of the other window. This is
733
+ * a heuristic which will let us identify _some_ situations in which
734
+ * elements have changed position, for instance it _should_ detect that the
735
+ * children nodes themselves have not changed but merely moved in the
736
+ * following example:
737
+ *
738
+ * oldVNode: `<div><element-one /><element-two /></div>`
739
+ * newVNode: `<div><element-two /><element-one /></div>`
740
+ *
741
+ * If we find cases like this then we also need to move the concrete DOM
742
+ * elements corresponding to the moved children to write the re-order to the
743
+ * DOM.
744
+ *
745
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
746
+ * nodes in the old children which have the same key as the first element in
747
+ * our window on the new children. If we find such a node we handle calling
748
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
749
+ * what we find.
750
+ *
751
+ * Finally, once we've narrowed our 'windows' to the point that either of them
752
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
753
+ * insertion or deletion that needs to happen to get a DOM state that correctly
754
+ * reflects the new child VNodes. If, for instance, after our window on the old
755
+ * children has collapsed we still have more nodes on the new children that
756
+ * we haven't dealt with yet then we need to add them, or if the new children
757
+ * collapse but we still have unhandled _old_ children then we need to make
758
+ * sure the corresponding DOM nodes are removed.
759
+ *
760
+ * @param parentElm the node into which the parent VNode is rendered
761
+ * @param oldCh the old children of the parent node
762
+ * @param newVNode the new VNode which will replace the parent
763
+ * @param newCh the new children of the parent node
764
+ */
659
765
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
660
766
  let oldStartIdx = 0;
661
767
  let newStartIdx = 0;
@@ -671,7 +777,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
671
777
  let elmToMove;
672
778
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
673
779
  if (oldStartVnode == null) {
674
- // Vnode might have been moved left
780
+ // VNode might have been moved left
675
781
  oldStartVnode = oldCh[++oldStartIdx];
676
782
  }
677
783
  else if (oldEndVnode == null) {
@@ -684,37 +790,100 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
684
790
  newEndVnode = newCh[--newEndIdx];
685
791
  }
686
792
  else if (isSameVnode(oldStartVnode, newStartVnode)) {
793
+ // if the start nodes are the same then we should patch the new VNode
794
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
795
+ // indices to reflect that. We don't need to move any DOM Nodes around
796
+ // since things are matched up in order.
687
797
  patch(oldStartVnode, newStartVnode);
688
798
  oldStartVnode = oldCh[++oldStartIdx];
689
799
  newStartVnode = newCh[++newStartIdx];
690
800
  }
691
801
  else if (isSameVnode(oldEndVnode, newEndVnode)) {
802
+ // likewise, if the end nodes are the same we patch new onto old and
803
+ // decrement our end indices, and also likewise in this case we don't
804
+ // need to move any DOM Nodes.
692
805
  patch(oldEndVnode, newEndVnode);
693
806
  oldEndVnode = oldCh[--oldEndIdx];
694
807
  newEndVnode = newCh[--newEndIdx];
695
808
  }
696
809
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
697
- // Vnode moved right
810
+ // case: "Vnode moved right"
811
+ //
812
+ // We've found that the last node in our window on the new children is
813
+ // the same VNode as the _first_ node in our window on the old children
814
+ // we're dealing with now. Visually, this is the layout of these two
815
+ // nodes:
816
+ //
817
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
818
+ // ^^^^^^^^^^^
819
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
820
+ // ^^^^^^^^^^^^^
821
+ //
822
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
823
+ // and move the DOM element for `oldStartVnode`.
698
824
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
699
825
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
700
826
  }
701
827
  patch(oldStartVnode, newEndVnode);
828
+ // We need to move the element for `oldStartVnode` into a position which
829
+ // will be appropriate for `newEndVnode`. For this we can use
830
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
831
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
832
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
833
+ //
834
+ // <old-start-node />
835
+ // <some-intervening-node />
836
+ // <old-end-node />
837
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
838
+ // <next-sibling />
839
+ //
840
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
841
+ // the node for `oldStartVnode` at the end of the children of
842
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
843
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
844
+ // append it to the children of the parent element.
702
845
  parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
703
846
  oldStartVnode = oldCh[++oldStartIdx];
704
847
  newEndVnode = newCh[--newEndIdx];
705
848
  }
706
849
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
707
- // Vnode moved left
850
+ // case: "Vnode moved left"
851
+ //
852
+ // We've found that the first node in our window on the new children is
853
+ // the same VNode as the _last_ node in our window on the old children.
854
+ // Visually, this is the layout of these two nodes:
855
+ //
856
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
857
+ // ^^^^^^^^^^^^^
858
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
859
+ // ^^^^^^^^^^^
860
+ //
861
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
862
+ // (which will handle updating any changed attributes, reconciling their
863
+ // children etc) but we also need to move the DOM node to which
864
+ // `oldEndVnode` corresponds.
708
865
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
709
866
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
710
867
  }
711
868
  patch(oldEndVnode, newStartVnode);
869
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
870
+ // the same node, so since we're here we know that they are not. Thus we
871
+ // can move the element for `oldEndVnode` _before_ the element for
872
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
873
+ // future.
712
874
  parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
713
875
  oldEndVnode = oldCh[--oldEndIdx];
714
876
  newStartVnode = newCh[++newStartIdx];
715
877
  }
716
878
  else {
717
- // createKeyToOldIdx
879
+ // Here we do some checks to match up old and new nodes based on the
880
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
881
+ // in the JSX for a DOM element in the implementation of a Stencil
882
+ // component.
883
+ //
884
+ // First we check to see if there are any nodes in the array of old
885
+ // children which have the same key as the first node in the new
886
+ // children.
718
887
  idxInOld = -1;
719
888
  {
720
889
  for (i = oldStartIdx; i <= oldEndIdx; ++i) {
@@ -725,23 +894,32 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
725
894
  }
726
895
  }
727
896
  if (idxInOld >= 0) {
897
+ // We found a node in the old children which matches up with the first
898
+ // node in the new children! So let's deal with that
728
899
  elmToMove = oldCh[idxInOld];
729
900
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
901
+ // the tag doesn't match so we'll need a new DOM element
730
902
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
731
903
  }
732
904
  else {
733
905
  patch(elmToMove, newStartVnode);
906
+ // invalidate the matching old node so that we won't try to update it
907
+ // again later on
734
908
  oldCh[idxInOld] = undefined;
735
909
  node = elmToMove.$elm$;
736
910
  }
737
911
  newStartVnode = newCh[++newStartIdx];
738
912
  }
739
913
  else {
740
- // new element
914
+ // We either didn't find an element in the old children that matches
915
+ // the key of the first new child OR the build is not using `key`
916
+ // attributes at all. In either case we need to create a new element
917
+ // for the new node.
741
918
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
742
919
  newStartVnode = newCh[++newStartIdx];
743
920
  }
744
921
  if (node) {
922
+ // if we created a new node then handle inserting it to the DOM
745
923
  {
746
924
  parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
747
925
  }
@@ -749,21 +927,43 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
749
927
  }
750
928
  }
751
929
  if (oldStartIdx > oldEndIdx) {
930
+ // we have some more new nodes to add which don't match up with old nodes
752
931
  addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
753
932
  }
754
933
  else if (newStartIdx > newEndIdx) {
934
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
935
+ // in the new array, so lets remove them (which entails cleaning up the
936
+ // relevant DOM nodes)
755
937
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
756
938
  }
757
939
  };
758
- const isSameVnode = (vnode1, vnode2) => {
940
+ /**
941
+ * Compare two VNodes to determine if they are the same
942
+ *
943
+ * **NB**: This function is an equality _heuristic_ based on the available
944
+ * information set on the two VNodes and can be misleading under certain
945
+ * circumstances. In particular, if the two nodes do not have `key` attrs
946
+ * (available under `$key$` on VNodes) then the function falls back on merely
947
+ * checking that they have the same tag.
948
+ *
949
+ * So, in other words, if `key` attrs are not set on VNodes which may be
950
+ * changing order within a `children` array or something along those lines then
951
+ * we could obtain a false positive and then have to do needless re-rendering.
952
+ *
953
+ * @param leftVNode the first VNode to check
954
+ * @param rightVNode the second VNode to check
955
+ * @returns whether they're equal or not
956
+ */
957
+ const isSameVnode = (leftVNode, rightVNode) => {
759
958
  // compare if two vnode to see if they're "technically" the same
760
959
  // need to have the same element tag, and same key to be the same
761
- if (vnode1.$tag$ === vnode2.$tag$) {
762
- if (vnode1.$tag$ === 'slot') {
763
- return vnode1.$name$ === vnode2.$name$;
960
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
961
+ if (leftVNode.$tag$ === 'slot') {
962
+ return leftVNode.$name$ === rightVNode.$name$;
764
963
  }
964
+ // this will be set if components in the build have `key` attrs set on them
765
965
  {
766
- return vnode1.$key$ === vnode2.$key$;
966
+ return leftVNode.$key$ === rightVNode.$key$;
767
967
  }
768
968
  }
769
969
  return false;
@@ -776,6 +976,14 @@ const referenceNode = (node) => {
776
976
  return (node && node['s-ol']) || node;
777
977
  };
778
978
  const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
979
+ /**
980
+ * Handle reconciling an outdated VNode with a new one which corresponds to
981
+ * it. This function handles flushing updates to the DOM and reconciling the
982
+ * children of the two nodes (if any).
983
+ *
984
+ * @param oldVNode an old VNode whose DOM element and children we want to update
985
+ * @param newVNode a new VNode representing an updated version of the old one
986
+ */
779
987
  const patch = (oldVNode, newVNode) => {
780
988
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
781
989
  const oldChildren = oldVNode.$children$;
@@ -789,7 +997,6 @@ const patch = (oldVNode, newVNode) => {
789
997
  // only add this to the when the compiler sees we're using an svg somewhere
790
998
  isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
791
999
  }
792
- // element node
793
1000
  {
794
1001
  if (tag === 'slot')
795
1002
  ;
@@ -802,6 +1009,7 @@ const patch = (oldVNode, newVNode) => {
802
1009
  }
803
1010
  if (oldChildren !== null && newChildren !== null) {
804
1011
  // looks like there's child vnodes for both the old and new vnodes
1012
+ // so we need to call `updateChildren` to reconcile them
805
1013
  updateChildren(elm, oldChildren, newVNode, newChildren);
806
1014
  }
807
1015
  else if (newChildren !== null) {
@@ -842,7 +1050,7 @@ const updateFallbackSlotVisibility = (elm) => {
842
1050
  let nodeType;
843
1051
  for (i = 0, ilen = childNodes.length; i < ilen; i++) {
844
1052
  childNode = childNodes[i];
845
- if (childNode.nodeType === 1 /* ElementNode */) {
1053
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
846
1054
  if (childNode['s-sr']) {
847
1055
  // this is a slot fallback node
848
1056
  // get the slot name for this slot reference node
@@ -854,7 +1062,7 @@ const updateFallbackSlotVisibility = (elm) => {
854
1062
  nodeType = childNodes[j].nodeType;
855
1063
  if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
856
1064
  // this sibling node is from a different component OR is a named fallback slot node
857
- if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
1065
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
858
1066
  childNode.hidden = true;
859
1067
  break;
860
1068
  }
@@ -863,8 +1071,8 @@ const updateFallbackSlotVisibility = (elm) => {
863
1071
  // this is a default fallback slot node
864
1072
  // any element or text node (with content)
865
1073
  // should hide the default fallback slot node
866
- if (nodeType === 1 /* ElementNode */ ||
867
- (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
1074
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1075
+ (nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
868
1076
  childNode.hidden = true;
869
1077
  break;
870
1078
  }
@@ -942,13 +1150,13 @@ const relocateSlotContent = (elm) => {
942
1150
  }
943
1151
  }
944
1152
  }
945
- if (childNode.nodeType === 1 /* ElementNode */) {
1153
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
946
1154
  relocateSlotContent(childNode);
947
1155
  }
948
1156
  }
949
1157
  };
950
1158
  const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
951
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1159
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
952
1160
  if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
953
1161
  return true;
954
1162
  }
@@ -979,7 +1187,7 @@ const renderVdom = (hostRef, renderFnResults) => {
979
1187
  cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
980
1188
  }
981
1189
  rootVnode.$tag$ = null;
982
- rootVnode.$flags$ |= 4 /* isHost */;
1190
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
983
1191
  hostRef.$vnode$ = rootVnode;
984
1192
  rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
985
1193
  {
@@ -987,7 +1195,7 @@ const renderVdom = (hostRef, renderFnResults) => {
987
1195
  }
988
1196
  {
989
1197
  contentRef = hostElm['s-cr'];
990
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1198
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
991
1199
  // always reset
992
1200
  checkSlotFallbackVisibility = false;
993
1201
  }
@@ -996,7 +1204,7 @@ const renderVdom = (hostRef, renderFnResults) => {
996
1204
  {
997
1205
  // while we're moving nodes around existing nodes, temporarily disable
998
1206
  // the disconnectCallback from working
999
- plt.$flags$ |= 1 /* isTmpDisconnected */;
1207
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1000
1208
  if (checkSlotRelocate) {
1001
1209
  relocateSlotContent(rootVnode.$elm$);
1002
1210
  let relocateData;
@@ -1054,7 +1262,7 @@ const renderVdom = (hostRef, renderFnResults) => {
1054
1262
  }
1055
1263
  else {
1056
1264
  // this node doesn't have a slot home to go to, so let's hide it
1057
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1265
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1058
1266
  nodeToRelocate.hidden = true;
1059
1267
  }
1060
1268
  }
@@ -1065,37 +1273,11 @@ const renderVdom = (hostRef, renderFnResults) => {
1065
1273
  }
1066
1274
  // done moving nodes around
1067
1275
  // allow the disconnect callback to work again
1068
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
1276
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1069
1277
  // always reset
1070
1278
  relocateNodes.length = 0;
1071
1279
  }
1072
1280
  };
1073
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
1074
- const createEvent = (ref, name, flags) => {
1075
- const elm = getElement(ref);
1076
- return {
1077
- emit: (detail) => {
1078
- return emitEvent(elm, name, {
1079
- bubbles: !!(flags & 4 /* Bubbles */),
1080
- composed: !!(flags & 2 /* Composed */),
1081
- cancelable: !!(flags & 1 /* Cancellable */),
1082
- detail,
1083
- });
1084
- },
1085
- };
1086
- };
1087
- /**
1088
- * Helper function to create & dispatch a custom Event on a provided target
1089
- * @param elm the target of the Event
1090
- * @param name the name to give the custom Event
1091
- * @param opts options for configuring a custom Event
1092
- * @returns the custom Event
1093
- */
1094
- const emitEvent = (elm, name, opts) => {
1095
- const ev = plt.ce(name, opts);
1096
- elm.dispatchEvent(ev);
1097
- return ev;
1098
- };
1099
1281
  const attachToAncestor = (hostRef, ancestorComponent) => {
1100
1282
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1101
1283
  ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
@@ -1103,10 +1285,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
1103
1285
  };
1104
1286
  const scheduleUpdate = (hostRef, isInitialLoad) => {
1105
1287
  {
1106
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1288
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1107
1289
  }
1108
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1109
- hostRef.$flags$ |= 512 /* needsRerender */;
1290
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1291
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1110
1292
  return;
1111
1293
  }
1112
1294
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
@@ -1122,7 +1304,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
1122
1304
  let promise;
1123
1305
  if (isInitialLoad) {
1124
1306
  {
1125
- hostRef.$flags$ |= 256 /* isListenReady */;
1307
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1126
1308
  if (hostRef.$queuedListeners$) {
1127
1309
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1128
1310
  hostRef.$queuedListeners$ = null;
@@ -1173,7 +1355,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1173
1355
  }
1174
1356
  else {
1175
1357
  Promise.all(childrenPromises).then(postUpdate);
1176
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1358
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1177
1359
  childrenPromises.length = 0;
1178
1360
  }
1179
1361
  }
@@ -1183,10 +1365,10 @@ const callRender = (hostRef, instance, elm) => {
1183
1365
  renderingRef = instance;
1184
1366
  instance = instance.render() ;
1185
1367
  {
1186
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1368
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1187
1369
  }
1188
1370
  {
1189
- hostRef.$flags$ |= 2 /* hasRendered */;
1371
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1190
1372
  }
1191
1373
  {
1192
1374
  {
@@ -1215,8 +1397,8 @@ const postUpdateComponent = (hostRef) => {
1215
1397
  {
1216
1398
  safeCall(instance, 'componentDidRender');
1217
1399
  }
1218
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1219
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1400
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1401
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1220
1402
  {
1221
1403
  // DOM WRITE!
1222
1404
  addHydratedFlag(elm);
@@ -1248,10 +1430,10 @@ const postUpdateComponent = (hostRef) => {
1248
1430
  hostRef.$onRenderResolve$();
1249
1431
  hostRef.$onRenderResolve$ = undefined;
1250
1432
  }
1251
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1433
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1252
1434
  nextTick(() => scheduleUpdate(hostRef, false));
1253
1435
  }
1254
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1436
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1255
1437
  }
1256
1438
  // ( •_•)
1257
1439
  // ( •_•)>⌐■-■
@@ -1262,7 +1444,7 @@ const forceUpdate = (ref) => {
1262
1444
  const hostRef = getHostRef(ref);
1263
1445
  const isConnected = hostRef.$hostElement$.isConnected;
1264
1446
  if (isConnected &&
1265
- (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1447
+ (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1266
1448
  scheduleUpdate(hostRef, false);
1267
1449
  }
1268
1450
  // Returns "true" when the forced update was successfully scheduled
@@ -1293,53 +1475,6 @@ const then = (promise, thenFn) => {
1293
1475
  };
1294
1476
  const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
1295
1477
  ;
1296
- /**
1297
- * Parse a new property value for a given property type.
1298
- *
1299
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
1300
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
1301
- * 1. `any`, the type given to `propValue` in the function signature
1302
- * 2. the type stored from `propType`.
1303
- *
1304
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
1305
- *
1306
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
1307
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
1308
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
1309
- * ```tsx
1310
- * <my-cmp prop-val={0}></my-cmp>
1311
- * ```
1312
- *
1313
- * HTML prop values on the other hand, will always a string
1314
- *
1315
- * @param propValue the new value to coerce to some type
1316
- * @param propType the type of the prop, expressed as a binary number
1317
- * @returns the parsed/coerced value
1318
- */
1319
- const parsePropertyValue = (propValue, propType) => {
1320
- // ensure this value is of the correct prop type
1321
- if (propValue != null && !isComplexType(propValue)) {
1322
- if (propType & 4 /* Boolean */) {
1323
- // per the HTML spec, any string value means it is a boolean true value
1324
- // but we'll cheat here and say that the string "false" is the boolean false
1325
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1326
- }
1327
- if (propType & 2 /* Number */) {
1328
- // force it to be a number
1329
- return parseFloat(propValue);
1330
- }
1331
- if (propType & 1 /* String */) {
1332
- // could have been passed as a number or boolean
1333
- // but we still want it as a string
1334
- return String(propValue);
1335
- }
1336
- // redundant return here for better minification
1337
- return propValue;
1338
- }
1339
- // not sure exactly what type we want
1340
- // so no need to change to a different type
1341
- return propValue;
1342
- };
1343
1478
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1344
1479
  const setValue = (ref, propName, newVal, cmpMeta) => {
1345
1480
  // check our new property value against our internal value
@@ -1352,13 +1487,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1352
1487
  // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1353
1488
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1354
1489
  const didValueChange = newVal !== oldVal && !areBothNaN;
1355
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1490
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1356
1491
  // gadzooks! the property's value has changed!!
1357
1492
  // set our new value!
1358
1493
  hostRef.$instanceValues$.set(propName, newVal);
1359
1494
  if (instance) {
1360
1495
  // get an array of method names of watch functions to call
1361
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1496
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1362
1497
  const watchMethods = cmpMeta.$watchers$[propName];
1363
1498
  if (watchMethods) {
1364
1499
  // this instance is watching for when this property changed
@@ -1373,7 +1508,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1373
1508
  });
1374
1509
  }
1375
1510
  }
1376
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1511
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1377
1512
  if (instance.componentShouldUpdate) {
1378
1513
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1379
1514
  return;
@@ -1388,6 +1523,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1388
1523
  }
1389
1524
  }
1390
1525
  };
1526
+ /**
1527
+ * Attach a series of runtime constructs to a compiled Stencil component
1528
+ * constructor, including getters and setters for the `@Prop` and `@State`
1529
+ * decorators, callbacks for when attributes change, and so on.
1530
+ *
1531
+ * @param Cstr the constructor for a component that we need to process
1532
+ * @param cmpMeta metadata collected previously about the component
1533
+ * @param flags a number used to store a series of bit flags
1534
+ * @returns a reference to the same constructor passed in (but now mutated)
1535
+ */
1391
1536
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1392
1537
  if (cmpMeta.$members$) {
1393
1538
  if (Cstr.watchers) {
@@ -1397,8 +1542,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1397
1542
  const members = Object.entries(cmpMeta.$members$);
1398
1543
  const prototype = Cstr.prototype;
1399
1544
  members.map(([memberName, [memberFlags]]) => {
1400
- if ((memberFlags & 31 /* Prop */ ||
1401
- ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1545
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1546
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1402
1547
  // proxyComponent - prop
1403
1548
  Object.defineProperty(prototype, memberName, {
1404
1549
  get() {
@@ -1413,8 +1558,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1413
1558
  enumerable: true,
1414
1559
  });
1415
1560
  }
1416
- else if (flags & 1 /* isElementConstructor */ &&
1417
- memberFlags & 64 /* Method */) {
1561
+ else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1562
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1418
1563
  // proxyComponent - method
1419
1564
  Object.defineProperty(prototype, memberName, {
1420
1565
  value(...args) {
@@ -1424,7 +1569,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1424
1569
  });
1425
1570
  }
1426
1571
  });
1427
- if ((flags & 1 /* isElementConstructor */)) {
1572
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1428
1573
  const attrNameToPropName = new Map();
1429
1574
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1430
1575
  plt.jmp(() => {
@@ -1480,11 +1625,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1480
1625
  // create an array of attributes to observe
1481
1626
  // and also create a map of html attribute name to js property name
1482
1627
  Cstr.observedAttributes = members
1483
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1628
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1484
1629
  .map(([propName, m]) => {
1485
1630
  const attrName = m[1] || propName;
1486
1631
  attrNameToPropName.set(attrName, propName);
1487
- if (m[0] & 512 /* ReflectAttr */) {
1632
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1488
1633
  cmpMeta.$attrsToReflect$.push([propName, attrName]);
1489
1634
  }
1490
1635
  return attrName;
@@ -1495,10 +1640,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1495
1640
  };
1496
1641
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1497
1642
  // initializeComponent
1498
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1643
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1499
1644
  {
1500
1645
  // we haven't initialized this element yet
1501
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1646
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1502
1647
  // lazy loaded components
1503
1648
  // request the component's implementation to be
1504
1649
  // wired up with the host element
@@ -1516,7 +1661,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1516
1661
  {
1517
1662
  cmpMeta.$watchers$ = Cstr.watchers;
1518
1663
  }
1519
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1664
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1520
1665
  Cstr.isProxied = true;
1521
1666
  }
1522
1667
  const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
@@ -1524,7 +1669,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1524
1669
  // but let's keep track of when we start and stop
1525
1670
  // so that the getters/setters don't incorrectly step on data
1526
1671
  {
1527
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1672
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1528
1673
  }
1529
1674
  // construct the lazy-loaded component implementation
1530
1675
  // passing the hostRef is very important during
@@ -1537,10 +1682,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1537
1682
  consoleError(e);
1538
1683
  }
1539
1684
  {
1540
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1685
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1541
1686
  }
1542
1687
  {
1543
- hostRef.$flags$ |= 128 /* isWatchReady */;
1688
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1544
1689
  }
1545
1690
  endNewInstance();
1546
1691
  fireConnectedCallback(hostRef.$lazyInstance$);
@@ -1551,7 +1696,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1551
1696
  const scopeId = getScopeId(cmpMeta);
1552
1697
  if (!styles.has(scopeId)) {
1553
1698
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1554
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1699
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1555
1700
  endRegisterStyles();
1556
1701
  }
1557
1702
  }
@@ -1578,19 +1723,19 @@ const fireConnectedCallback = (instance) => {
1578
1723
  }
1579
1724
  };
1580
1725
  const connectedCallback = (elm) => {
1581
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1726
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1582
1727
  const hostRef = getHostRef(elm);
1583
1728
  const cmpMeta = hostRef.$cmpMeta$;
1584
1729
  const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1585
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1730
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1586
1731
  // first time this component has connected
1587
- hostRef.$flags$ |= 1 /* hasConnected */;
1732
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1588
1733
  {
1589
1734
  // initUpdate
1590
1735
  // if the slot polyfill is required we'll need to put some nodes
1591
1736
  // in here to act as original content anchors as we move nodes around
1592
1737
  // host element has been connected to the DOM
1593
- if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1738
+ if ((cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
1594
1739
  setContentReference(elm);
1595
1740
  }
1596
1741
  }
@@ -1613,7 +1758,7 @@ const connectedCallback = (elm) => {
1613
1758
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1614
1759
  if (cmpMeta.$members$) {
1615
1760
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1616
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1761
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1617
1762
  const value = elm[memberName];
1618
1763
  delete elm[memberName];
1619
1764
  elm[memberName] = value;
@@ -1647,7 +1792,7 @@ const setContentReference = (elm) => {
1647
1792
  elm.insertBefore(contentRefElm, elm.firstChild);
1648
1793
  };
1649
1794
  const disconnectedCallback = (elm) => {
1650
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1795
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1651
1796
  const hostRef = getHostRef(elm);
1652
1797
  const instance = hostRef.$lazyInstance$ ;
1653
1798
  {
@@ -1702,7 +1847,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1702
1847
  super(self);
1703
1848
  self = this;
1704
1849
  registerHost(self, cmpMeta);
1705
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1850
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1706
1851
  // this component is using shadow dom
1707
1852
  // and this browser supports shadow dom
1708
1853
  // add the read-only property "shadowRoot" to the host element
@@ -1737,7 +1882,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1737
1882
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
1738
1883
  if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1739
1884
  cmpTags.push(tagName);
1740
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1885
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1741
1886
  }
1742
1887
  });
1743
1888
  });
@@ -1759,11 +1904,43 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1759
1904
  // Fallback appLoad event
1760
1905
  endBootstrap();
1761
1906
  };
1762
- const getAssetPath = (path) => {
1763
- const assetUrl = new URL(path, plt.$resourcesUrl$);
1764
- return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
1907
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1908
+ if (listeners) {
1909
+ listeners.map(([flags, name, method]) => {
1910
+ const target = getHostListenerTarget(elm, flags) ;
1911
+ const handler = hostListenerProxy(hostRef, method);
1912
+ const opts = hostListenerOpts(flags);
1913
+ plt.ael(target, name, handler, opts);
1914
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1915
+ });
1916
+ }
1917
+ };
1918
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
1919
+ try {
1920
+ {
1921
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1922
+ // instance is ready, let's call it's member method for this event
1923
+ hostRef.$lazyInstance$[methodName](ev);
1924
+ }
1925
+ else {
1926
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1927
+ }
1928
+ }
1929
+ }
1930
+ catch (e) {
1931
+ consoleError(e);
1932
+ }
1765
1933
  };
1766
- const hostRefs = new WeakMap();
1934
+ const getHostListenerTarget = (elm, flags) => {
1935
+ if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
1936
+ return doc;
1937
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
1938
+ return win;
1939
+ return elm;
1940
+ };
1941
+ // prettier-ignore
1942
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1943
+ const hostRefs = /*@__PURE__*/ new WeakMap();
1767
1944
  const getHostRef = (ref) => hostRefs.get(ref);
1768
1945
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1769
1946
  const registerHost = (elm, cmpMeta) => {
@@ -1808,14 +1985,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1808
1985
  return importedModule[exportName];
1809
1986
  }, consoleError);
1810
1987
  };
1811
- const styles = new Map();
1988
+ const styles = /*@__PURE__*/ new Map();
1989
+ const win = typeof window !== 'undefined' ? window : {};
1990
+ const doc = win.document || { head: {} };
1991
+ const plt = {
1992
+ $flags$: 0,
1993
+ $resourcesUrl$: '',
1994
+ jmp: (h) => h(),
1995
+ raf: (h) => requestAnimationFrame(h),
1996
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1997
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1998
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
1999
+ };
2000
+ const promiseResolve = (v) => Promise.resolve(v);
2001
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2002
+ try {
2003
+ new CSSStyleSheet();
2004
+ return typeof new CSSStyleSheet().replaceSync === 'function';
2005
+ }
2006
+ catch (e) { }
2007
+ return false;
2008
+ })()
2009
+ ;
1812
2010
  const queueDomReads = [];
1813
2011
  const queueDomWrites = [];
1814
2012
  const queueTask = (queue, write) => (cb) => {
1815
2013
  queue.push(cb);
1816
2014
  if (!queuePending) {
1817
2015
  queuePending = true;
1818
- if (write && plt.$flags$ & 4 /* queueSync */) {
2016
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1819
2017
  nextTick(flush);
1820
2018
  }
1821
2019
  else {