@esri/calcite-components 1.0.0-beta.95 → 1.0.0-beta.97

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 (1190) hide show
  1. package/dist/calcite/assets/date-picker/nls/messages.json +31 -0
  2. package/dist/calcite/assets/date-picker/t9n/index.d.ts +5 -0
  3. package/dist/calcite/assets/date-picker/t9n/messages.json +5 -0
  4. package/dist/calcite/assets/date-picker/t9n/messages_ar.json +5 -0
  5. package/dist/calcite/assets/date-picker/t9n/messages_bg.json +5 -0
  6. package/dist/calcite/assets/date-picker/t9n/messages_bs.json +5 -0
  7. package/dist/calcite/assets/date-picker/t9n/messages_ca.json +5 -0
  8. package/dist/calcite/assets/date-picker/t9n/messages_cs.json +5 -0
  9. package/dist/calcite/assets/date-picker/t9n/messages_da.json +5 -0
  10. package/dist/calcite/assets/date-picker/t9n/messages_de.json +5 -0
  11. package/dist/calcite/assets/date-picker/t9n/messages_el.json +5 -0
  12. package/dist/calcite/assets/date-picker/t9n/messages_en.json +5 -0
  13. package/dist/calcite/assets/date-picker/t9n/messages_es.json +5 -0
  14. package/dist/calcite/assets/date-picker/t9n/messages_et.json +5 -0
  15. package/dist/calcite/assets/date-picker/t9n/messages_fi.json +5 -0
  16. package/dist/calcite/assets/date-picker/t9n/messages_fr.json +5 -0
  17. package/dist/calcite/assets/date-picker/t9n/messages_he.json +5 -0
  18. package/dist/calcite/assets/date-picker/t9n/messages_hr.json +5 -0
  19. package/dist/calcite/assets/date-picker/t9n/messages_hu.json +5 -0
  20. package/dist/calcite/assets/date-picker/t9n/messages_id.json +5 -0
  21. package/dist/calcite/assets/date-picker/t9n/messages_it.json +5 -0
  22. package/dist/calcite/assets/date-picker/t9n/messages_ja.json +5 -0
  23. package/dist/calcite/assets/date-picker/t9n/messages_ko.json +5 -0
  24. package/dist/calcite/assets/date-picker/t9n/messages_lt.json +5 -0
  25. package/dist/calcite/assets/date-picker/t9n/messages_lv.json +5 -0
  26. package/dist/calcite/assets/date-picker/t9n/messages_nl.json +5 -0
  27. package/dist/calcite/assets/date-picker/t9n/messages_no.json +5 -0
  28. package/dist/calcite/assets/date-picker/t9n/messages_pl.json +5 -0
  29. package/dist/calcite/assets/date-picker/t9n/messages_pt-BR.json +5 -0
  30. package/dist/calcite/assets/date-picker/t9n/messages_pt-PT.json +5 -0
  31. package/dist/calcite/assets/date-picker/t9n/messages_ro.json +5 -0
  32. package/dist/calcite/assets/date-picker/t9n/messages_ru.json +5 -0
  33. package/dist/calcite/assets/date-picker/t9n/messages_sk.json +5 -0
  34. package/dist/calcite/assets/date-picker/t9n/messages_sl.json +5 -0
  35. package/dist/calcite/assets/date-picker/t9n/messages_sr.json +5 -0
  36. package/dist/calcite/assets/date-picker/t9n/messages_sv.json +5 -0
  37. package/dist/calcite/assets/date-picker/t9n/messages_th.json +5 -0
  38. package/dist/calcite/assets/date-picker/t9n/messages_tr.json +5 -0
  39. package/dist/calcite/assets/date-picker/t9n/messages_uk.json +5 -0
  40. package/dist/calcite/assets/date-picker/t9n/messages_vi.json +5 -0
  41. package/dist/calcite/assets/date-picker/t9n/messages_zh-CN.json +5 -0
  42. package/dist/calcite/assets/date-picker/t9n/messages_zh-HK.json +5 -0
  43. package/dist/calcite/assets/date-picker/t9n/messages_zh-TW.json +5 -0
  44. package/dist/calcite/assets/icon/dimensions16.json +1 -0
  45. package/dist/calcite/assets/icon/dimensions24.json +1 -0
  46. package/dist/calcite/assets/icon/dimensions32.json +1 -0
  47. package/dist/calcite/assets/icon/ellipse16.json +1 -0
  48. package/dist/calcite/assets/icon/ellipse24.json +1 -0
  49. package/dist/calcite/assets/icon/ellipse32.json +1 -0
  50. package/dist/calcite/assets/icon/triangle16.json +1 -0
  51. package/dist/calcite/assets/icon/triangle24.json +1 -0
  52. package/dist/calcite/assets/icon/triangle32.json +1 -0
  53. package/dist/calcite/calcite.css +1 -1
  54. package/dist/calcite/calcite.esm.js +2 -2
  55. package/dist/calcite/index.esm.js +1 -1
  56. package/dist/calcite/p-02206586.js +6 -0
  57. package/dist/calcite/p-0327c8e3.entry.js +6 -0
  58. package/dist/calcite/p-10eda8ed.entry.js +6 -0
  59. package/dist/calcite/p-1240fa7b.entry.js +6 -0
  60. package/dist/{esm-es5/index.js → calcite/p-146b4fe4.js} +2 -1
  61. package/dist/calcite/p-15704f21.entry.js +6 -0
  62. package/dist/calcite/p-166b1433.entry.js +6 -0
  63. package/dist/calcite/p-19d918b1.entry.js +6 -0
  64. package/dist/calcite/p-19de6a2c.entry.js +6 -0
  65. package/dist/calcite/p-1d1e8bdb.entry.js +6 -0
  66. package/dist/calcite/p-20ac0aba.entry.js +6 -0
  67. package/dist/calcite/p-21b74649.entry.js +6 -0
  68. package/dist/calcite/p-21c7e603.entry.js +6 -0
  69. package/dist/calcite/p-23a63d0d.entry.js +6 -0
  70. package/dist/calcite/p-25482df1.js +6 -0
  71. package/dist/calcite/p-311896ed.entry.js +6 -0
  72. package/dist/calcite/p-344b3c6c.entry.js +6 -0
  73. package/dist/calcite/p-3bed9a6f.entry.js +6 -0
  74. package/dist/calcite/p-3e539778.entry.js +6 -0
  75. package/dist/calcite/p-417a1880.entry.js +6 -0
  76. package/dist/calcite/p-481ea3fa.entry.js +6 -0
  77. package/dist/calcite/p-4af0a397.entry.js +6 -0
  78. package/dist/calcite/p-4ca93e87.js +6 -0
  79. package/dist/calcite/p-4d5bdb2b.entry.js +6 -0
  80. package/dist/calcite/{p-58a40573.js → p-4d9ab6e1.js} +1 -1
  81. package/dist/calcite/{p-77636ceb.js → p-4ee3752e.js} +2 -2
  82. package/dist/calcite/{p-af88a01c.js → p-535e2f9b.js} +1 -1
  83. package/dist/calcite/p-55ea8247.entry.js +6 -0
  84. package/dist/calcite/p-5710214d.entry.js +6 -0
  85. package/dist/calcite/p-5a400333.entry.js +6 -0
  86. package/dist/calcite/{p-80a51eb7.js → p-5ae3b7c4.js} +1 -1
  87. package/dist/calcite/p-5c79b811.entry.js +6 -0
  88. package/dist/calcite/p-5cf8cdc7.entry.js +6 -0
  89. package/dist/calcite/{p-966679da.js → p-5d6608fd.js} +1 -1
  90. package/dist/calcite/{p-48bb042f.js → p-622f8ecb.js} +1 -1
  91. package/dist/calcite/p-6284cc30.entry.js +6 -0
  92. package/dist/calcite/p-64b5872b.js +6 -0
  93. package/dist/calcite/{p-3053c253.js → p-698bfe4a.js} +2 -2
  94. package/dist/calcite/p-6c8b5581.entry.js +6 -0
  95. package/dist/calcite/{p-f4e3dc87.js → p-717298f3.js} +1 -1
  96. package/dist/calcite/p-75bb0987.entry.js +6 -0
  97. package/dist/calcite/p-78308811.entry.js +6 -0
  98. package/dist/calcite/p-84272f4b.entry.js +6 -0
  99. package/dist/calcite/p-85cbceca.entry.js +6 -0
  100. package/dist/calcite/{p-00abe273.js → p-8713e986.js} +2 -2
  101. package/dist/calcite/p-88798f16.entry.js +6 -0
  102. package/dist/calcite/p-8dc9be64.js +6 -0
  103. package/dist/calcite/p-91755387.js +7 -0
  104. package/dist/calcite/p-91b670e6.js +6 -0
  105. package/dist/calcite/p-92e553ee.entry.js +6 -0
  106. package/dist/calcite/p-94363dcc.entry.js +6 -0
  107. package/dist/calcite/p-96bf42e5.js +6 -0
  108. package/dist/calcite/p-982627c1.entry.js +6 -0
  109. package/dist/calcite/p-98ac3a6d.entry.js +6 -0
  110. package/dist/calcite/p-9b7467a5.entry.js +6 -0
  111. package/dist/calcite/p-9b7d5490.entry.js +6 -0
  112. package/dist/calcite/{p-510d1337.js → p-9c8fc268.js} +2 -2
  113. package/dist/calcite/p-a225f799.entry.js +6 -0
  114. package/dist/calcite/p-a2ddecc3.entry.js +6 -0
  115. package/dist/calcite/p-a2f5420b.js +6 -0
  116. package/dist/calcite/p-a53ca6f0.entry.js +6 -0
  117. package/dist/calcite/p-a6fe00fa.entry.js +6 -0
  118. package/dist/calcite/{p-3aaffa03.js → p-acc49c92.js} +1 -1
  119. package/dist/calcite/{p-901dc3de.js → p-af9e6e54.js} +1 -1
  120. package/dist/calcite/{p-ef082834.js → p-b675ccdc.js} +1 -1
  121. package/dist/calcite/p-b7f0762e.entry.js +6 -0
  122. package/dist/calcite/{p-4b823890.js → p-bbb9a284.js} +2 -2
  123. package/dist/calcite/p-bd16de0f.entry.js +6 -0
  124. package/dist/calcite/{p-21116f05.js → p-bd95c6d9.js} +1 -1
  125. package/dist/calcite/{p-46fef127.js → p-bda78a0c.js} +1 -1
  126. package/dist/calcite/p-be359e77.entry.js +6 -0
  127. package/dist/calcite/p-c25eed82.entry.js +6 -0
  128. package/dist/calcite/p-c40610e0.entry.js +6 -0
  129. package/dist/calcite/p-c469f3ba.entry.js +6 -0
  130. package/dist/calcite/p-c8699730.entry.js +6 -0
  131. package/dist/calcite/p-ce98b12c.entry.js +6 -0
  132. package/dist/calcite/{p-e0cd1e84.js → p-cf2d3774.js} +2 -2
  133. package/dist/calcite/{p-bd64d06c.js → p-d5bfadd8.js} +1 -1
  134. package/dist/calcite/p-d83bbe04.entry.js +6 -0
  135. package/dist/calcite/{p-b5326072.js → p-dd293eb9.js} +1 -1
  136. package/dist/calcite/p-df9a2f95.entry.js +6 -0
  137. package/dist/calcite/p-e3400054.entry.js +6 -0
  138. package/dist/calcite/p-e393bcaa.entry.js +6 -0
  139. package/dist/calcite/p-e7379f2a.entry.js +6 -0
  140. package/dist/calcite/p-e905ec51.entry.js +6 -0
  141. package/dist/calcite/p-ef8c4700.entry.js +6 -0
  142. package/dist/calcite/p-f1815b6c.entry.js +6 -0
  143. package/dist/calcite/p-f72104d6.entry.js +6 -0
  144. package/dist/calcite/p-f74d7303.entry.js +6 -0
  145. package/dist/cjs/{ExpandToggle-d10914db.js → ExpandToggle-e41acdfc.js} +5 -5
  146. package/dist/cjs/{Heading-1d94663a.js → Heading-1e87a15f.js} +2 -2
  147. package/dist/cjs/{app-globals-843f6f1d.js → app-globals-1cc5c95b.js} +2 -2
  148. package/dist/cjs/{array-7de7f400.js → array-e708c699.js} +1 -1
  149. package/dist/cjs/calcite-accordion_2.cjs.entry.js +14 -14
  150. package/dist/cjs/calcite-action-bar.cjs.entry.js +14 -14
  151. package/dist/cjs/calcite-action-group.cjs.entry.js +12 -12
  152. package/dist/cjs/calcite-action-menu.cjs.entry.js +41 -42
  153. package/dist/cjs/calcite-action-pad.cjs.entry.js +13 -13
  154. package/dist/cjs/calcite-action.cjs.entry.js +13 -13
  155. package/dist/cjs/calcite-alert.cjs.entry.js +25 -13
  156. package/dist/cjs/calcite-avatar.cjs.entry.js +7 -7
  157. package/dist/cjs/calcite-block_2.cjs.entry.js +33 -30
  158. package/dist/cjs/calcite-button.cjs.entry.js +30 -24
  159. package/dist/cjs/calcite-card.cjs.entry.js +15 -14
  160. package/dist/cjs/calcite-checkbox.cjs.entry.js +19 -17
  161. package/dist/cjs/calcite-chip.cjs.entry.js +17 -17
  162. package/dist/cjs/calcite-color-picker_3.cjs.entry.js +62 -59
  163. package/dist/cjs/calcite-combobox_3.cjs.entry.js +60 -47
  164. package/dist/cjs/calcite-date-picker_4.cjs.entry.js +63 -33
  165. package/dist/cjs/calcite-dropdown_3.cjs.entry.js +44 -31
  166. package/dist/cjs/calcite-fab.cjs.entry.js +8 -8
  167. package/dist/cjs/calcite-filter.cjs.entry.js +9 -9
  168. package/dist/cjs/calcite-flow-item.cjs.entry.js +24 -18
  169. package/dist/cjs/calcite-flow.cjs.entry.js +4 -4
  170. package/dist/cjs/calcite-graph_2.cjs.entry.js +88 -61
  171. package/dist/cjs/calcite-handle.cjs.entry.js +6 -6
  172. package/dist/cjs/calcite-icon.cjs.entry.js +7 -7
  173. package/dist/cjs/calcite-inline-editable.cjs.entry.js +9 -9
  174. package/dist/cjs/calcite-input-date-picker.cjs.entry.js +116 -61
  175. package/dist/cjs/calcite-input-message.cjs.entry.js +9 -9
  176. package/dist/cjs/calcite-input-number.cjs.entry.js +70 -45
  177. package/dist/cjs/calcite-input-text.cjs.entry.js +18 -18
  178. package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +155 -93
  179. package/dist/cjs/calcite-input.cjs.entry.js +89 -64
  180. package/dist/cjs/calcite-label.cjs.entry.js +16 -16
  181. package/dist/cjs/calcite-link.cjs.entry.js +9 -9
  182. package/dist/cjs/calcite-list_3.cjs.entry.js +15 -15
  183. package/dist/cjs/calcite-loader.cjs.entry.js +7 -7
  184. package/dist/cjs/calcite-modal.cjs.entry.js +17 -17
  185. package/dist/cjs/calcite-notice.cjs.entry.js +15 -15
  186. package/dist/cjs/calcite-option_3.cjs.entry.js +17 -17
  187. package/dist/cjs/calcite-pagination.cjs.entry.js +20 -13
  188. package/dist/cjs/calcite-panel.cjs.entry.js +33 -32
  189. package/dist/cjs/calcite-pick-list_3.cjs.entry.js +27 -27
  190. package/dist/cjs/calcite-popover_2.cjs.entry.js +56 -41
  191. package/dist/cjs/calcite-progress.cjs.entry.js +10 -5
  192. package/dist/cjs/calcite-radio-button-group.cjs.entry.js +7 -7
  193. package/dist/cjs/calcite-radio-button.cjs.entry.js +14 -14
  194. package/dist/cjs/calcite-radio-group_2.cjs.entry.js +17 -17
  195. package/dist/cjs/calcite-rating.cjs.entry.js +16 -16
  196. package/dist/cjs/calcite-scrim.cjs.entry.js +4 -4
  197. package/dist/cjs/calcite-shell_3.cjs.entry.js +23 -17
  198. package/dist/cjs/calcite-sortable-list.cjs.entry.js +6 -6
  199. package/dist/cjs/calcite-split-button.cjs.entry.js +10 -8
  200. package/dist/cjs/calcite-stepper_2.cjs.entry.js +48 -20
  201. package/dist/cjs/calcite-switch.cjs.entry.js +14 -14
  202. package/dist/cjs/calcite-tab_4.cjs.entry.js +22 -27
  203. package/dist/cjs/calcite-tile-select_2.cjs.entry.js +13 -13
  204. package/dist/cjs/calcite-tile.cjs.entry.js +13 -13
  205. package/dist/cjs/calcite-tip_3.cjs.entry.js +15 -15
  206. package/dist/cjs/calcite-tooltip_2.cjs.entry.js +38 -23
  207. package/dist/cjs/calcite-tree_2.cjs.entry.js +141 -90
  208. package/dist/cjs/calcite-value-list_2.cjs.entry.js +25 -25
  209. package/dist/cjs/calcite.cjs.js +6 -6
  210. package/dist/cjs/{conditionalSlot-ffff1ba2.js → conditionalSlot-ef852d9d.js} +3 -3
  211. package/dist/cjs/{debounce-3f8af6d8.js → debounce-2c8b61fb.js} +1 -1
  212. package/dist/cjs/{dom-df1903f9.js → dom-2ec8c9ed.js} +41 -3
  213. package/dist/cjs/{filter-a0274ec6.js → filter-9411bbc1.js} +3 -4
  214. package/dist/cjs/{floating-ui-99430551.js → floating-ui-b48c8256.js} +175 -23
  215. package/dist/cjs/{form-53eb189e.js → form-1d831023.js} +3 -3
  216. package/dist/cjs/{guid-9ba07df0.js → guid-f4f03a7a.js} +1 -1
  217. package/dist/cjs/{index-bbc26bc6.js → index-a0010f96.js} +1117 -946
  218. package/dist/cjs/index.cjs.js +1 -1
  219. package/dist/cjs/{interactive-b210765f.js → interactive-32293bca.js} +1 -1
  220. package/dist/cjs/{interfaces-43537378.js → interfaces-971ccc32.js} +1 -1
  221. package/dist/cjs/{key-7c8bf01a.js → key-6a462411.js} +1 -1
  222. package/dist/cjs/{label-a586ee40.js → label-28060b83.js} +2 -2
  223. package/dist/cjs/loader.cjs.js +6 -6
  224. package/dist/cjs/locale-678ce361.js +414 -0
  225. package/dist/cjs/{math-8f7af178.js → math-f71ad83a.js} +1 -1
  226. package/dist/cjs/nonChromiumPlatformUtils-95812e02.js +506 -0
  227. package/dist/cjs/observers-5706326b.js +48 -0
  228. package/dist/cjs/{openCloseComponent-b884b722.js → openCloseComponent-178191c0.js} +1 -1
  229. package/dist/cjs/{resources-aa8679e5.js → resources-199140b3.js} +1 -1
  230. package/dist/cjs/{resources-ec998c3c.js → resources-4c8610b1.js} +12 -70
  231. package/dist/cjs/{resources-c61ea826.js → resources-8b3ba64a.js} +5 -5
  232. package/dist/cjs/{resources-c25710c9.js → resources-abee76d7.js} +1 -1
  233. package/dist/cjs/{resources-6f839761.js → resources-b5a5f8a7.js} +1 -1
  234. package/dist/cjs/{resources-dd0bf97d.js → resources-bd2202e9.js} +1 -1
  235. package/dist/cjs/{sortable.esm-6707f3f9.js → sortable.esm-673fe959.js} +1 -1
  236. package/dist/cjs/{utils-2cc96bc6.js → utils-1e0cd9e8.js} +1 -1
  237. package/dist/collection/collection-manifest.json +2 -2
  238. package/dist/collection/components/accordion/accordion.js +162 -153
  239. package/dist/collection/components/accordion/interfaces.js +0 -5
  240. package/dist/collection/components/accordion-item/accordion-item.js +304 -308
  241. package/dist/collection/components/accordion-item/interfaces.js +0 -5
  242. package/dist/collection/components/accordion-item/resources.js +1 -1
  243. package/dist/collection/components/action/action.css +1 -1
  244. package/dist/collection/components/action/action.js +298 -295
  245. package/dist/collection/components/action/resources.js +1 -1
  246. package/dist/collection/components/action-bar/action-bar.js +241 -234
  247. package/dist/collection/components/action-bar/resources.js +1 -1
  248. package/dist/collection/components/action-bar/utils.js +1 -1
  249. package/dist/collection/components/action-group/action-group.css +1 -1
  250. package/dist/collection/components/action-group/action-group.js +138 -135
  251. package/dist/collection/components/action-group/resources.js +1 -1
  252. package/dist/collection/components/action-menu/action-menu.js +250 -241
  253. package/dist/collection/components/action-menu/resources.js +1 -1
  254. package/dist/collection/components/action-pad/action-pad.js +198 -191
  255. package/dist/collection/components/action-pad/resources.js +1 -1
  256. package/dist/collection/components/alert/alert.css +1 -1
  257. package/dist/collection/components/alert/alert.js +413 -376
  258. package/dist/collection/components/alert/interfaces.js +1 -1
  259. package/dist/collection/components/alert/resources.js +1 -1
  260. package/dist/collection/components/avatar/avatar.js +107 -99
  261. package/dist/collection/components/avatar/utils.js +1 -1
  262. package/dist/collection/components/block/block.css +7 -0
  263. package/dist/collection/components/block/block.js +332 -339
  264. package/dist/collection/components/block/resources.js +3 -2
  265. package/dist/collection/components/block-section/block-section.js +150 -150
  266. package/dist/collection/components/block-section/interfaces.js +0 -5
  267. package/dist/collection/components/block-section/resources.js +1 -1
  268. package/dist/collection/components/button/button.js +458 -437
  269. package/dist/collection/components/button/interfaces.js +0 -5
  270. package/dist/collection/components/button/resources.js +1 -1
  271. package/dist/collection/components/card/card.js +181 -188
  272. package/dist/collection/components/card/resources.js +1 -1
  273. package/dist/collection/components/checkbox/checkbox.css +1 -1
  274. package/dist/collection/components/checkbox/checkbox.js +280 -270
  275. package/dist/collection/components/chip/chip.js +266 -261
  276. package/dist/collection/components/chip/interfaces.js +0 -5
  277. package/dist/collection/components/chip/resources.js +1 -1
  278. package/dist/collection/components/color-picker/color-picker.js +821 -817
  279. package/dist/collection/components/color-picker/interfaces.js +0 -5
  280. package/dist/collection/components/color-picker/resources.js +1 -1
  281. package/dist/collection/components/color-picker/utils.js +1 -1
  282. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +195 -178
  283. package/dist/collection/components/color-picker-hex-input/resources.js +1 -1
  284. package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +83 -77
  285. package/dist/collection/components/color-picker-swatch/resources.js +1 -1
  286. package/dist/collection/components/combobox/combobox.css +1 -2
  287. package/dist/collection/components/combobox/combobox.js +595 -576
  288. package/dist/collection/components/combobox/interfaces.js +0 -5
  289. package/dist/collection/components/combobox/resources.js +1 -1
  290. package/dist/collection/components/combobox/utils.js +1 -1
  291. package/dist/collection/components/combobox-item/combobox-item.js +247 -239
  292. package/dist/collection/components/combobox-item/resources.js +1 -1
  293. package/dist/collection/components/combobox-item-group/combobox-item-group.js +50 -47
  294. package/dist/collection/components/combobox-item-group/resources.js +1 -1
  295. package/dist/collection/components/date-picker/assets/date-picker/nls/messages.json +31 -0
  296. package/dist/collection/components/date-picker/assets/date-picker/t9n/index.d.ts +5 -0
  297. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages.json +5 -0
  298. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ar.json +5 -0
  299. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_bg.json +5 -0
  300. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_bs.json +5 -0
  301. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ca.json +5 -0
  302. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_cs.json +5 -0
  303. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_da.json +5 -0
  304. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_de.json +5 -0
  305. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_el.json +5 -0
  306. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_en.json +5 -0
  307. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_es.json +5 -0
  308. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_et.json +5 -0
  309. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_fi.json +5 -0
  310. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_fr.json +5 -0
  311. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_he.json +5 -0
  312. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_hr.json +5 -0
  313. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_hu.json +5 -0
  314. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_id.json +5 -0
  315. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_it.json +5 -0
  316. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ja.json +5 -0
  317. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ko.json +5 -0
  318. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_lt.json +5 -0
  319. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_lv.json +5 -0
  320. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_nl.json +5 -0
  321. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_no.json +5 -0
  322. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_pl.json +5 -0
  323. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_pt-BR.json +5 -0
  324. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_pt-PT.json +5 -0
  325. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ro.json +5 -0
  326. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_ru.json +5 -0
  327. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_sk.json +5 -0
  328. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_sl.json +5 -0
  329. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_sr.json +5 -0
  330. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_sv.json +5 -0
  331. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_th.json +5 -0
  332. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_tr.json +5 -0
  333. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_uk.json +5 -0
  334. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_vi.json +5 -0
  335. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_zh-CN.json +5 -0
  336. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_zh-HK.json +5 -0
  337. package/dist/collection/components/date-picker/assets/date-picker/t9n/messages_zh-TW.json +5 -0
  338. package/dist/collection/components/date-picker/date-picker.js +489 -447
  339. package/dist/collection/components/date-picker/interfaces.js +0 -5
  340. package/dist/collection/components/date-picker/resources.js +1 -1
  341. package/dist/collection/components/date-picker/utils.js +2 -22
  342. package/dist/collection/components/date-picker-day/date-picker-day.css +48 -24
  343. package/dist/collection/components/date-picker-day/date-picker-day.js +280 -285
  344. package/dist/collection/components/date-picker-month/date-picker-month.js +257 -250
  345. package/dist/collection/components/date-picker-month-header/date-picker-month-header.css +3 -9
  346. package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +249 -234
  347. package/dist/collection/components/date-picker-month-header/resources.js +1 -1
  348. package/dist/collection/components/dropdown/dropdown.css +0 -1
  349. package/dist/collection/components/dropdown/dropdown.js +460 -430
  350. package/dist/collection/components/dropdown/interfaces.js +0 -5
  351. package/dist/collection/components/dropdown/resources.js +1 -1
  352. package/dist/collection/components/dropdown-group/dropdown-group.js +113 -107
  353. package/dist/collection/components/dropdown-group/interfaces.js +0 -5
  354. package/dist/collection/components/dropdown-group/resources.js +1 -1
  355. package/dist/collection/components/dropdown-item/dropdown-item.js +292 -282
  356. package/dist/collection/components/dropdown-item/resources.js +1 -1
  357. package/dist/collection/components/fab/fab.js +205 -197
  358. package/dist/collection/components/fab/resources.js +1 -1
  359. package/dist/collection/components/filter/filter.js +200 -191
  360. package/dist/collection/components/filter/resources.js +1 -1
  361. package/dist/collection/components/flow/flow.js +55 -46
  362. package/dist/collection/components/flow/interfaces.js +0 -5
  363. package/dist/collection/components/flow/resources.js +1 -1
  364. package/dist/collection/components/flow-item/flow-item.js +419 -395
  365. package/dist/collection/components/flow-item/resources.js +1 -1
  366. package/dist/collection/components/functional/ExpandToggle.js +1 -1
  367. package/dist/collection/components/functional/Heading.js +1 -1
  368. package/dist/collection/components/graph/graph.js +125 -125
  369. package/dist/collection/components/graph/interfaces.js +0 -5
  370. package/dist/collection/components/graph/util.js +1 -1
  371. package/dist/collection/components/handle/handle.css +1 -1
  372. package/dist/collection/components/handle/handle.js +94 -85
  373. package/dist/collection/components/handle/resources.js +1 -1
  374. package/dist/collection/components/icon/assets/icon/dimensions16.json +1 -0
  375. package/dist/collection/components/icon/assets/icon/dimensions24.json +1 -0
  376. package/dist/collection/components/icon/assets/icon/dimensions32.json +1 -0
  377. package/dist/collection/components/icon/assets/icon/ellipse16.json +1 -0
  378. package/dist/collection/components/icon/assets/icon/ellipse24.json +1 -0
  379. package/dist/collection/components/icon/assets/icon/ellipse32.json +1 -0
  380. package/dist/collection/components/icon/assets/icon/triangle16.json +1 -0
  381. package/dist/collection/components/icon/assets/icon/triangle24.json +1 -0
  382. package/dist/collection/components/icon/assets/icon/triangle32.json +1 -0
  383. package/dist/collection/components/icon/icon.js +107 -98
  384. package/dist/collection/components/icon/resources.js +1 -1
  385. package/dist/collection/components/icon/utils.js +1 -1
  386. package/dist/collection/components/inline-editable/inline-editable.js +274 -266
  387. package/dist/collection/components/inline-editable/resources.js +1 -1
  388. package/dist/collection/components/input/input.css +5 -0
  389. package/dist/collection/components/input/input.js +882 -862
  390. package/dist/collection/components/input/interfaces.js +0 -5
  391. package/dist/collection/components/input/resources.js +1 -1
  392. package/dist/collection/components/input-date-picker/input-date-picker.css +1 -2
  393. package/dist/collection/components/input-date-picker/input-date-picker.js +900 -813
  394. package/dist/collection/components/input-date-picker/resources.js +1 -1
  395. package/dist/collection/components/input-message/input-message.css +1 -1
  396. package/dist/collection/components/input-message/input-message.js +124 -118
  397. package/dist/collection/components/input-message/interfaces.js +1 -1
  398. package/dist/collection/components/input-number/input-number.css +1 -20
  399. package/dist/collection/components/input-number/input-number.js +818 -796
  400. package/dist/collection/components/input-number/interfaces.js +0 -5
  401. package/dist/collection/components/input-number/resources.js +1 -1
  402. package/dist/collection/components/input-text/input-text.css +1 -20
  403. package/dist/collection/components/input-text/input-text.js +602 -603
  404. package/dist/collection/components/input-text/resources.js +1 -1
  405. package/dist/collection/components/input-time-picker/input-time-picker.js +671 -583
  406. package/dist/collection/components/interfaces.js +0 -5
  407. package/dist/collection/components/label/label.css +1 -1
  408. package/dist/collection/components/label/label.js +189 -183
  409. package/dist/collection/components/label/resources.js +1 -1
  410. package/dist/collection/components/link/link.js +186 -180
  411. package/dist/collection/components/list/list.js +76 -70
  412. package/dist/collection/components/list/resources.js +1 -1
  413. package/dist/collection/components/list-item/list-item.js +109 -113
  414. package/dist/collection/components/list-item/resources.js +1 -1
  415. package/dist/collection/components/list-item-group/list-item-group.js +54 -51
  416. package/dist/collection/components/list-item-group/resources.js +1 -1
  417. package/dist/collection/components/loader/loader.css +3 -3
  418. package/dist/collection/components/loader/loader.js +169 -172
  419. package/dist/collection/components/modal/interfaces.js +0 -5
  420. package/dist/collection/components/modal/modal.js +478 -481
  421. package/dist/collection/components/modal/resources.js +1 -1
  422. package/dist/collection/components/notice/notice.js +269 -267
  423. package/dist/collection/components/notice/resources.js +1 -1
  424. package/dist/collection/components/option/option.js +118 -108
  425. package/dist/collection/components/option-group/option-group.js +81 -73
  426. package/dist/collection/components/pagination/pagination.js +266 -258
  427. package/dist/collection/components/pagination/resources.js +1 -1
  428. package/dist/collection/components/panel/panel.css +1 -1
  429. package/dist/collection/components/panel/panel.js +557 -563
  430. package/dist/collection/components/panel/resources.js +1 -1
  431. package/dist/collection/components/pick-list/pick-list.js +255 -241
  432. package/dist/collection/components/pick-list/resources.js +1 -1
  433. package/dist/collection/components/pick-list/shared-list-logic.js +1 -1
  434. package/dist/collection/components/pick-list/shared-list-render.js +2 -9
  435. package/dist/collection/components/pick-list-group/pick-list-group.js +54 -52
  436. package/dist/collection/components/pick-list-group/resources.js +1 -1
  437. package/dist/collection/components/pick-list-item/pick-list-item.js +354 -352
  438. package/dist/collection/components/pick-list-item/resources.js +1 -1
  439. package/dist/collection/components/popover/PopoverManager.js +5 -2
  440. package/dist/collection/components/popover/popover.css +0 -1
  441. package/dist/collection/components/popover/popover.js +586 -562
  442. package/dist/collection/components/popover/resources.js +1 -1
  443. package/dist/collection/components/popover-manager/popover-manager.js +60 -52
  444. package/dist/collection/components/progress/progress.js +112 -104
  445. package/dist/collection/components/radio-button/radio-button.js +348 -337
  446. package/dist/collection/components/radio-button/resources.js +1 -1
  447. package/dist/collection/components/radio-button-group/radio-button-group.js +171 -160
  448. package/dist/collection/components/radio-group/interfaces.js +0 -5
  449. package/dist/collection/components/radio-group/radio-group.js +256 -244
  450. package/dist/collection/components/radio-group-item/radio-group-item.js +179 -176
  451. package/dist/collection/components/radio-group-item/resources.js +1 -1
  452. package/dist/collection/components/rating/rating.js +276 -277
  453. package/dist/collection/components/rating/resources.js +1 -1
  454. package/dist/collection/components/scrim/resources.js +1 -1
  455. package/dist/collection/components/scrim/scrim.js +57 -54
  456. package/dist/collection/components/select/resources.js +1 -1
  457. package/dist/collection/components/select/select.js +228 -219
  458. package/dist/collection/components/shell/resources.js +1 -1
  459. package/dist/collection/components/shell/shell.js +38 -43
  460. package/dist/collection/components/shell-center-row/resources.js +1 -1
  461. package/dist/collection/components/shell-center-row/shell-center-row.js +80 -76
  462. package/dist/collection/components/shell-panel/resources.js +1 -1
  463. package/dist/collection/components/shell-panel/shell-panel.js +194 -180
  464. package/dist/collection/components/slider/resources.js +1 -1
  465. package/dist/collection/components/slider/slider.js +643 -658
  466. package/dist/collection/components/sortable-list/resources.js +1 -1
  467. package/dist/collection/components/sortable-list/sortable-list.js +153 -142
  468. package/dist/collection/components/split-button/resources.js +1 -1
  469. package/dist/collection/components/split-button/split-button.js +366 -360
  470. package/dist/collection/components/stepper/interfaces.js +0 -5
  471. package/dist/collection/components/stepper/stepper.js +270 -236
  472. package/dist/collection/components/stepper-item/stepper-item.js +436 -400
  473. package/dist/collection/components/switch/switch.js +190 -182
  474. package/dist/collection/components/tab/interfaces.js +0 -5
  475. package/dist/collection/components/tab/tab.css +4 -2
  476. package/dist/collection/components/tab/tab.js +194 -181
  477. package/dist/collection/components/tab-nav/tab-nav.js +285 -275
  478. package/dist/collection/components/tab-title/tab-title.js +468 -456
  479. package/dist/collection/components/tabs/interfaces.js +0 -5
  480. package/dist/collection/components/tabs/resources.js +1 -1
  481. package/dist/collection/components/tabs/tabs.js +134 -132
  482. package/dist/collection/components/tile/resources.js +1 -1
  483. package/dist/collection/components/tile/tile.js +174 -178
  484. package/dist/collection/components/tile-select/interfaces.js +0 -5
  485. package/dist/collection/components/tile-select/resources.js +1 -1
  486. package/dist/collection/components/tile-select/tile-select.css +1 -0
  487. package/dist/collection/components/tile-select/tile-select.js +352 -338
  488. package/dist/collection/components/tile-select-group/interfaces.js +0 -5
  489. package/dist/collection/components/tile-select-group/tile-select-group.js +57 -51
  490. package/dist/collection/components/time-picker/resources.js +1 -1
  491. package/dist/collection/components/time-picker/time-picker.js +575 -550
  492. package/dist/collection/components/tip/resources.js +1 -1
  493. package/dist/collection/components/tip/tip.js +145 -146
  494. package/dist/collection/components/tip-group/tip-group.js +33 -27
  495. package/dist/collection/components/tip-manager/resources.js +1 -1
  496. package/dist/collection/components/tip-manager/tip-manager.js +226 -222
  497. package/dist/collection/components/tooltip/TooltipManager.js +6 -1
  498. package/dist/collection/components/tooltip/resources.js +1 -1
  499. package/dist/collection/components/tooltip/tooltip.css +0 -1
  500. package/dist/collection/components/tooltip/tooltip.js +252 -225
  501. package/dist/collection/components/tooltip-manager/tooltip-manager.js +38 -32
  502. package/dist/collection/components/tree/interfaces.js +1 -1
  503. package/dist/collection/components/tree/tree.js +278 -245
  504. package/dist/collection/components/tree/utils.js +21 -0
  505. package/dist/collection/components/tree-item/interfaces.js +0 -5
  506. package/dist/collection/components/tree-item/resources.js +1 -1
  507. package/dist/collection/components/tree-item/tree-item.css +17 -3
  508. package/dist/collection/components/tree-item/tree-item.js +306 -273
  509. package/dist/collection/components/value-list/interfaces.js +0 -5
  510. package/dist/collection/components/value-list/resources.js +1 -1
  511. package/dist/collection/components/value-list/utils.js +1 -1
  512. package/dist/collection/components/value-list/value-list.js +348 -334
  513. package/dist/collection/components/value-list-item/resources.js +1 -1
  514. package/dist/collection/components/value-list-item/value-list-item.css +1 -2
  515. package/dist/collection/components/value-list-item/value-list-item.js +286 -279
  516. package/dist/collection/demos/_assets/demo-dom-swapper.js +45 -0
  517. package/dist/collection/demos/_assets/demo-spacer.js +17 -0
  518. package/dist/collection/demos/_assets/demo-template.js +24 -0
  519. package/dist/collection/demos/_assets/head.js +48 -0
  520. package/dist/collection/demos/_assets/locales.js +223 -0
  521. package/dist/collection/utils/array.js +1 -1
  522. package/dist/collection/utils/conditionalSlot.js +1 -1
  523. package/dist/collection/utils/config.js +22 -0
  524. package/dist/collection/utils/date.js +3 -38
  525. package/dist/collection/utils/dom.js +37 -1
  526. package/dist/collection/utils/filter.js +2 -3
  527. package/dist/collection/utils/floating-ui/nonChromiumPlatformUtils.js +496 -0
  528. package/dist/collection/utils/floating-ui.js +123 -12
  529. package/dist/collection/utils/form.js +1 -1
  530. package/dist/collection/utils/globalAttributes.js +1 -1
  531. package/dist/collection/utils/globalScript.js +1 -1
  532. package/dist/collection/utils/guid.js +1 -1
  533. package/dist/collection/utils/interactive.js +1 -1
  534. package/dist/collection/utils/key.js +1 -1
  535. package/dist/collection/utils/label.js +1 -1
  536. package/dist/collection/utils/locale.js +199 -64
  537. package/dist/collection/utils/math.js +1 -1
  538. package/dist/collection/utils/number.js +36 -31
  539. package/dist/collection/utils/observers.js +31 -7
  540. package/dist/collection/utils/openCloseComponent.js +1 -1
  541. package/dist/collection/utils/resources.js +1 -1
  542. package/dist/collection/utils/t9n.js +110 -0
  543. package/dist/collection/utils/theme.js +1 -1
  544. package/dist/collection/utils/time.js +16 -14
  545. package/dist/components/ExpandToggle.js +1 -1
  546. package/dist/components/Heading.js +1 -1
  547. package/dist/components/action-group.js +4 -4
  548. package/dist/components/action-menu.js +35 -36
  549. package/dist/components/action.js +8 -8
  550. package/dist/components/array.js +1 -1
  551. package/dist/components/button.js +23 -17
  552. package/dist/components/calcite-accordion-item.js +5 -5
  553. package/dist/components/calcite-accordion.js +4 -4
  554. package/dist/components/calcite-action-bar.js +6 -6
  555. package/dist/components/calcite-action-group.js +1 -1
  556. package/dist/components/calcite-action-menu.js +1 -1
  557. package/dist/components/calcite-action-pad.js +4 -4
  558. package/dist/components/calcite-action.js +1 -1
  559. package/dist/components/calcite-alert.js +19 -7
  560. package/dist/components/calcite-avatar.js +2 -2
  561. package/dist/components/calcite-block-section.js +8 -6
  562. package/dist/components/calcite-block.js +17 -16
  563. package/dist/components/calcite-button.js +1 -1
  564. package/dist/components/calcite-card.js +9 -8
  565. package/dist/components/calcite-checkbox.js +1 -1
  566. package/dist/components/calcite-chip.js +1 -1
  567. package/dist/components/calcite-color-picker-hex-input.js +1 -1
  568. package/dist/components/calcite-color-picker-swatch.js +1 -1
  569. package/dist/components/calcite-color-picker.js +44 -39
  570. package/dist/components/calcite-combobox-item-group.js +2 -2
  571. package/dist/components/calcite-combobox-item.js +8 -6
  572. package/dist/components/calcite-combobox.js +42 -31
  573. package/dist/components/calcite-date-picker-day.js +1 -1
  574. package/dist/components/calcite-date-picker-month-header.js +1 -1
  575. package/dist/components/calcite-date-picker-month.js +1 -1
  576. package/dist/components/calcite-date-picker.js +1 -1
  577. package/dist/components/calcite-dropdown-group.js +2 -2
  578. package/dist/components/calcite-dropdown-item.js +2 -2
  579. package/dist/components/calcite-dropdown.js +1 -1
  580. package/dist/components/calcite-fab.js +3 -3
  581. package/dist/components/calcite-filter.js +1 -1
  582. package/dist/components/calcite-flow-item.js +18 -12
  583. package/dist/components/calcite-flow.js +2 -2
  584. package/dist/components/calcite-graph.js +1 -1
  585. package/dist/components/calcite-handle.js +1 -1
  586. package/dist/components/calcite-icon.js +1 -1
  587. package/dist/components/calcite-inline-editable.js +2 -2
  588. package/dist/components/calcite-input-date-picker.js +110 -53
  589. package/dist/components/calcite-input-message.js +5 -5
  590. package/dist/components/calcite-input-number.js +53 -28
  591. package/dist/components/calcite-input-text.js +10 -10
  592. package/dist/components/calcite-input-time-picker.js +83 -35
  593. package/dist/components/calcite-input.js +1 -1
  594. package/dist/components/calcite-label.js +1 -1
  595. package/dist/components/calcite-link.js +1 -1
  596. package/dist/components/calcite-list-item-group.js +2 -2
  597. package/dist/components/calcite-list-item.js +4 -4
  598. package/dist/components/calcite-list.js +3 -3
  599. package/dist/components/calcite-loader.js +1 -1
  600. package/dist/components/calcite-modal.js +11 -11
  601. package/dist/components/calcite-notice.js +8 -8
  602. package/dist/components/calcite-option-group.js +3 -3
  603. package/dist/components/calcite-option.js +3 -3
  604. package/dist/components/calcite-pagination.js +15 -11
  605. package/dist/components/calcite-panel.js +1 -1
  606. package/dist/components/calcite-pick-list-group.js +2 -2
  607. package/dist/components/calcite-pick-list-item.js +1 -1
  608. package/dist/components/calcite-pick-list.js +8 -8
  609. package/dist/components/calcite-popover-manager.js +2 -2
  610. package/dist/components/calcite-popover.js +1 -1
  611. package/dist/components/calcite-progress.js +1 -1
  612. package/dist/components/calcite-radio-button-group.js +5 -5
  613. package/dist/components/calcite-radio-button.js +7 -7
  614. package/dist/components/calcite-radio-group-item.js +6 -6
  615. package/dist/components/calcite-radio-group.js +5 -5
  616. package/dist/components/calcite-rating.js +8 -8
  617. package/dist/components/calcite-scrim.js +1 -1
  618. package/dist/components/calcite-select.js +5 -5
  619. package/dist/components/calcite-shell-center-row.js +4 -4
  620. package/dist/components/calcite-shell-panel.js +13 -7
  621. package/dist/components/calcite-shell.js +2 -2
  622. package/dist/components/calcite-slider.js +79 -53
  623. package/dist/components/calcite-sortable-list.js +2 -2
  624. package/dist/components/calcite-split-button.js +8 -6
  625. package/dist/components/calcite-stepper-item.js +39 -12
  626. package/dist/components/calcite-stepper.js +5 -4
  627. package/dist/components/calcite-switch.js +1 -1
  628. package/dist/components/calcite-tab-nav.js +1 -1
  629. package/dist/components/calcite-tab-title.js +1 -1
  630. package/dist/components/calcite-tab.js +1 -1
  631. package/dist/components/calcite-tabs.js +1 -1
  632. package/dist/components/calcite-tile-select-group.js +4 -4
  633. package/dist/components/calcite-tile-select.js +8 -8
  634. package/dist/components/calcite-tile.js +1 -1
  635. package/dist/components/calcite-time-picker.js +1 -1
  636. package/dist/components/calcite-tip-group.js +2 -2
  637. package/dist/components/calcite-tip-manager.js +3 -3
  638. package/dist/components/calcite-tip.js +5 -5
  639. package/dist/components/calcite-tooltip-manager.js +2 -2
  640. package/dist/components/calcite-tooltip.js +1 -1
  641. package/dist/components/calcite-tree-item.js +21 -9
  642. package/dist/components/calcite-tree.js +118 -78
  643. package/dist/components/calcite-value-list-item.js +6 -6
  644. package/dist/components/calcite-value-list.js +9 -9
  645. package/dist/components/checkbox.js +11 -9
  646. package/dist/components/chip.js +11 -11
  647. package/dist/components/color-picker-hex-input.js +8 -10
  648. package/dist/components/color-picker-swatch.js +4 -4
  649. package/dist/components/conditionalSlot.js +1 -1
  650. package/dist/components/date-picker-day.js +17 -9
  651. package/dist/components/date-picker-month-header.js +25 -11
  652. package/dist/components/date-picker-month.js +4 -4
  653. package/dist/components/date-picker.js +20 -28
  654. package/dist/components/date.js +5 -39
  655. package/dist/components/debounce.js +1 -1
  656. package/dist/components/dom.js +38 -2
  657. package/dist/components/dropdown.js +35 -23
  658. package/dist/components/filter.js +2 -2
  659. package/dist/components/filter2.js +2 -3
  660. package/dist/components/floating-ui.js +181 -22
  661. package/dist/components/form.js +2 -2
  662. package/dist/components/graph.js +2 -2
  663. package/dist/components/guid.js +1 -1
  664. package/dist/components/handle.js +2 -2
  665. package/dist/components/icon.js +2 -2
  666. package/dist/components/index.js +1 -1
  667. package/dist/components/input.js +72 -47
  668. package/dist/components/interactive.js +1 -1
  669. package/dist/components/interfaces.js +1 -1
  670. package/dist/components/interfaces2.js +1 -1
  671. package/dist/components/key.js +1 -1
  672. package/dist/components/label.js +11 -11
  673. package/dist/components/label2.js +2 -2
  674. package/dist/components/link.js +6 -6
  675. package/dist/components/loader.js +5 -5
  676. package/dist/components/locale.js +403 -0
  677. package/dist/components/math.js +1 -1
  678. package/dist/components/nonChromiumPlatformUtils.js +498 -0
  679. package/dist/components/observers.js +31 -7
  680. package/dist/components/openCloseComponent.js +1 -1
  681. package/dist/components/panel.js +24 -23
  682. package/dist/components/pick-list-item.js +8 -8
  683. package/dist/components/popover.js +47 -33
  684. package/dist/components/progress.js +9 -4
  685. package/dist/components/resources.js +1 -1
  686. package/dist/components/resources2.js +1 -1
  687. package/dist/components/resources3.js +1 -1
  688. package/dist/components/scrim.js +3 -3
  689. package/dist/components/shared-list-render.js +1 -1
  690. package/dist/components/sortable.esm.js +1 -1
  691. package/dist/components/switch.js +6 -6
  692. package/dist/components/tab-nav.js +3 -3
  693. package/dist/components/tab-title.js +6 -6
  694. package/dist/components/tab.js +6 -6
  695. package/dist/components/tabs.js +5 -10
  696. package/dist/components/tile.js +6 -6
  697. package/dist/components/time-picker.js +56 -39
  698. package/dist/components/tooltip.js +33 -19
  699. package/dist/components/utils.js +1 -1
  700. package/dist/components/utils2.js +2 -2
  701. package/dist/esm/{ExpandToggle-51cda39f.js → ExpandToggle-a4a9eace.js} +5 -5
  702. package/dist/esm/{Heading-3a6ae137.js → Heading-e0abf8a2.js} +2 -2
  703. package/dist/esm/{app-globals-8ea1c0e3.js → app-globals-59bc5b85.js} +2 -2
  704. package/dist/esm/{array-2db27e14.js → array-03a17827.js} +1 -1
  705. package/dist/esm/calcite-accordion_2.entry.js +14 -14
  706. package/dist/esm/calcite-action-bar.entry.js +14 -14
  707. package/dist/esm/calcite-action-group.entry.js +12 -12
  708. package/dist/esm/calcite-action-menu.entry.js +41 -42
  709. package/dist/esm/calcite-action-pad.entry.js +13 -13
  710. package/dist/esm/calcite-action.entry.js +13 -13
  711. package/dist/esm/calcite-alert.entry.js +25 -13
  712. package/dist/esm/calcite-avatar.entry.js +7 -7
  713. package/dist/esm/calcite-block_2.entry.js +33 -30
  714. package/dist/esm/calcite-button.entry.js +30 -24
  715. package/dist/esm/calcite-card.entry.js +15 -14
  716. package/dist/esm/calcite-checkbox.entry.js +19 -17
  717. package/dist/esm/calcite-chip.entry.js +17 -17
  718. package/dist/esm/calcite-color-picker_3.entry.js +62 -59
  719. package/dist/esm/calcite-combobox_3.entry.js +60 -47
  720. package/dist/esm/calcite-date-picker_4.entry.js +63 -33
  721. package/dist/esm/calcite-dropdown_3.entry.js +44 -31
  722. package/dist/esm/calcite-fab.entry.js +8 -8
  723. package/dist/esm/calcite-filter.entry.js +9 -9
  724. package/dist/esm/calcite-flow-item.entry.js +24 -18
  725. package/dist/esm/calcite-flow.entry.js +4 -4
  726. package/dist/esm/calcite-graph_2.entry.js +88 -61
  727. package/dist/esm/calcite-handle.entry.js +6 -6
  728. package/dist/esm/calcite-icon.entry.js +7 -7
  729. package/dist/esm/calcite-inline-editable.entry.js +9 -9
  730. package/dist/esm/calcite-input-date-picker.entry.js +116 -61
  731. package/dist/esm/calcite-input-message.entry.js +9 -9
  732. package/dist/esm/calcite-input-number.entry.js +61 -36
  733. package/dist/esm/calcite-input-text.entry.js +18 -18
  734. package/dist/esm/calcite-input-time-picker_2.entry.js +139 -77
  735. package/dist/esm/calcite-input.entry.js +80 -55
  736. package/dist/esm/calcite-label.entry.js +16 -16
  737. package/dist/esm/calcite-link.entry.js +9 -9
  738. package/dist/esm/calcite-list_3.entry.js +15 -15
  739. package/dist/esm/calcite-loader.entry.js +7 -7
  740. package/dist/esm/calcite-modal.entry.js +17 -17
  741. package/dist/esm/calcite-notice.entry.js +15 -15
  742. package/dist/esm/calcite-option_3.entry.js +17 -17
  743. package/dist/esm/calcite-pagination.entry.js +20 -13
  744. package/dist/esm/calcite-panel.entry.js +33 -32
  745. package/dist/esm/calcite-pick-list_3.entry.js +27 -27
  746. package/dist/esm/calcite-popover_2.entry.js +56 -41
  747. package/dist/esm/calcite-progress.entry.js +10 -5
  748. package/dist/esm/calcite-radio-button-group.entry.js +7 -7
  749. package/dist/esm/calcite-radio-button.entry.js +14 -14
  750. package/dist/esm/calcite-radio-group_2.entry.js +17 -17
  751. package/dist/esm/calcite-rating.entry.js +16 -16
  752. package/dist/esm/calcite-scrim.entry.js +4 -4
  753. package/dist/esm/calcite-shell_3.entry.js +23 -17
  754. package/dist/esm/calcite-sortable-list.entry.js +6 -6
  755. package/dist/esm/calcite-split-button.entry.js +10 -8
  756. package/dist/esm/calcite-stepper_2.entry.js +48 -20
  757. package/dist/esm/calcite-switch.entry.js +14 -14
  758. package/dist/esm/calcite-tab_4.entry.js +22 -27
  759. package/dist/esm/calcite-tile-select_2.entry.js +13 -13
  760. package/dist/esm/calcite-tile.entry.js +13 -13
  761. package/dist/esm/calcite-tip_3.entry.js +15 -15
  762. package/dist/esm/calcite-tooltip_2.entry.js +38 -23
  763. package/dist/esm/calcite-tree_2.entry.js +141 -90
  764. package/dist/esm/calcite-value-list_2.entry.js +25 -25
  765. package/dist/esm/calcite.js +6 -6
  766. package/dist/esm/{conditionalSlot-a8df5b3f.js → conditionalSlot-a3e8c63a.js} +3 -3
  767. package/dist/esm/{debounce-d31cc476.js → debounce-d85a6654.js} +1 -1
  768. package/dist/esm/{dom-24af003b.js → dom-8f0a9ff2.js} +40 -4
  769. package/dist/esm/{filter-72316b3f.js → filter-0e5a9913.js} +3 -4
  770. package/dist/esm/{floating-ui-10f8689c.js → floating-ui-5c49748f.js} +173 -22
  771. package/dist/esm/{form-390fdf0f.js → form-80dbd90e.js} +3 -3
  772. package/dist/esm/{guid-b68b1941.js → guid-9f15e57a.js} +1 -1
  773. package/dist/esm/{index-8384b5ec.js → index-1f9b54dc.js} +1117 -946
  774. package/dist/esm/index.js +1 -1
  775. package/dist/esm/{interactive-f2ec7825.js → interactive-5db230e8.js} +1 -1
  776. package/dist/esm/{interfaces-ba98f966.js → interfaces-87b65de3.js} +1 -1
  777. package/dist/esm/{key-ed874b7d.js → key-acc755b7.js} +1 -1
  778. package/dist/esm/{label-78f72c1a.js → label-333c4a4c.js} +2 -2
  779. package/dist/esm/loader.js +6 -6
  780. package/dist/esm/locale-35f81208.js +403 -0
  781. package/dist/esm/{math-2893cee3.js → math-dd4df0b5.js} +1 -1
  782. package/dist/esm/nonChromiumPlatformUtils-45c9ed51.js +502 -0
  783. package/dist/esm/observers-9f44e9b3.js +46 -0
  784. package/dist/esm/{openCloseComponent-0a4c6226.js → openCloseComponent-ba7d452b.js} +1 -1
  785. package/dist/esm/polyfills/css-shim.js +1 -1
  786. package/dist/esm/{resources-32c242fa.js → resources-3e3255c7.js} +5 -5
  787. package/dist/esm/{resources-f8aa3ed1.js → resources-8812a15c.js} +5 -61
  788. package/dist/esm/{resources-351f6f14.js → resources-9a59d78c.js} +1 -1
  789. package/dist/esm/{resources-ea0a60b4.js → resources-9c476cb6.js} +1 -1
  790. package/dist/esm/{resources-3acd3089.js → resources-a75141ea.js} +1 -1
  791. package/dist/esm/{resources-0497ae87.js → resources-ca31b4fd.js} +1 -1
  792. package/dist/esm/{sortable.esm-3d78dbdc.js → sortable.esm-8be1d379.js} +1 -1
  793. package/dist/esm/{utils-a7e4e0e1.js → utils-85948aeb.js} +1 -1
  794. package/dist/extras/docs-json.json +1948 -783
  795. package/dist/index.js +1 -1
  796. package/dist/loader/cdn.js +1 -1
  797. package/dist/loader/index.cjs.js +1 -1
  798. package/dist/loader/index.es2017.js +1 -1
  799. package/dist/loader/index.js +2 -2
  800. package/dist/loader/package.json +1 -0
  801. package/dist/types/components/accordion/accordion.d.ts +2 -2
  802. package/dist/types/components/accordion-item/accordion-item.d.ts +7 -7
  803. package/dist/types/components/action/action.d.ts +8 -8
  804. package/dist/types/components/action/assets/action/t9n/index.d.ts +3 -0
  805. package/dist/types/components/action-bar/action-bar.d.ts +3 -3
  806. package/dist/types/components/action-bar/assets/action-bar/t9n/index.d.ts +4 -0
  807. package/dist/types/components/action-group/action-group.d.ts +2 -2
  808. package/dist/types/components/action-group/assets/action-group/t9n/index.d.ts +3 -0
  809. package/dist/types/components/action-menu/action-menu.d.ts +7 -7
  810. package/dist/types/components/action-pad/action-pad.d.ts +2 -2
  811. package/dist/types/components/action-pad/assets/action-pad/t9n/index.d.ts +4 -0
  812. package/dist/types/components/alert/alert.d.ts +12 -6
  813. package/dist/types/components/alert/assets/alert/t9n/index.d.ts +3 -0
  814. package/dist/types/components/block/assets/block/t9n/index.d.ts +6 -0
  815. package/dist/types/components/block/block.d.ts +22 -20
  816. package/dist/types/components/block/resources.d.ts +2 -1
  817. package/dist/types/components/block-section/assets/block-section/t9n/index.d.ts +4 -0
  818. package/dist/types/components/block-section/block-section.d.ts +12 -10
  819. package/dist/types/components/button/assets/button/t9n/index.d.ts +3 -0
  820. package/dist/types/components/button/button.d.ts +37 -21
  821. package/dist/types/components/card/assets/card/t9n/index.d.ts +5 -0
  822. package/dist/types/components/card/card.d.ts +11 -10
  823. package/dist/types/components/checkbox/checkbox.d.ts +16 -14
  824. package/dist/types/components/chip/assets/chip/t9n/index.d.ts +3 -0
  825. package/dist/types/components/chip/chip.d.ts +13 -13
  826. package/dist/types/components/color-picker/assets/color-picker/t9n/index.d.ts +21 -0
  827. package/dist/types/components/color-picker/color-picker.d.ts +39 -41
  828. package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +9 -10
  829. package/dist/types/components/color-picker-swatch/color-picker-swatch.d.ts +2 -2
  830. package/dist/types/components/combobox/assets/combobox/t9n/index.d.ts +3 -0
  831. package/dist/types/components/combobox/combobox.d.ts +36 -31
  832. package/dist/types/components/combobox-item/combobox-item.d.ts +15 -13
  833. package/dist/types/components/combobox-item-group/combobox-item-group.d.ts +2 -2
  834. package/dist/types/components/date-picker/assets/date-picker/t9n/index.d.ts +5 -0
  835. package/dist/types/components/date-picker/date-picker.d.ts +9 -4
  836. package/dist/types/components/date-picker-day/date-picker-day.d.ts +2 -3
  837. package/dist/types/components/date-picker-month-header/date-picker-month-header.d.ts +2 -0
  838. package/dist/types/components/dropdown/dropdown.d.ts +11 -6
  839. package/dist/types/components/dropdown-item/dropdown-item.d.ts +3 -3
  840. package/dist/types/components/fab/fab.d.ts +1 -1
  841. package/dist/types/components/filter/assets/filter/t9n/index.d.ts +4 -0
  842. package/dist/types/components/flow/flow.d.ts +1 -1
  843. package/dist/types/components/flow-item/flow-item.d.ts +12 -8
  844. package/dist/types/components/handle/handle.d.ts +1 -1
  845. package/dist/types/components/inline-editable/assets/inline-editable/t9n/index.d.ts +5 -0
  846. package/dist/types/components/inline-editable/inline-editable.d.ts +1 -1
  847. package/dist/types/components/input/assets/input/t9n/index.d.ts +4 -0
  848. package/dist/types/components/input/input.d.ts +31 -32
  849. package/dist/types/components/input-date-picker/input-date-picker.d.ts +61 -44
  850. package/dist/types/components/input-message/input-message.d.ts +6 -9
  851. package/dist/types/components/input-number/assets/input-number/t9n/index.d.ts +4 -0
  852. package/dist/types/components/input-number/input-number.d.ts +17 -19
  853. package/dist/types/components/input-text/assets/input-text/t9n/index.d.ts +4 -0
  854. package/dist/types/components/input-text/input-text.d.ts +10 -10
  855. package/dist/types/components/input-time-picker/input-time-picker.d.ts +41 -30
  856. package/dist/types/components/label/label.d.ts +10 -10
  857. package/dist/types/components/link/link.d.ts +8 -8
  858. package/dist/types/components/list/list.d.ts +1 -1
  859. package/dist/types/components/list-item/list-item.d.ts +2 -2
  860. package/dist/types/components/loader/loader.d.ts +9 -4
  861. package/dist/types/components/modal/assets/modal/t9n/index.d.ts +3 -0
  862. package/dist/types/components/modal/modal.d.ts +10 -10
  863. package/dist/types/components/notice/assets/notice/t9n/index.d.ts +3 -0
  864. package/dist/types/components/notice/notice.d.ts +7 -8
  865. package/dist/types/components/option/option.d.ts +2 -2
  866. package/dist/types/components/option-group/option-group.d.ts +1 -1
  867. package/dist/types/components/pagination/assets/pagination/t9n/index.d.ts +4 -0
  868. package/dist/types/components/pagination/pagination.d.ts +5 -8
  869. package/dist/types/components/panel/assets/panel/t9n/index.d.ts +6 -0
  870. package/dist/types/components/panel/panel.d.ts +21 -23
  871. package/dist/types/components/pick-list/assets/pick-list/t9n/index.d.ts +3 -0
  872. package/dist/types/components/pick-list/pick-list.d.ts +7 -7
  873. package/dist/types/components/pick-list-item/assets/pick-list-item/t9n/index.d.ts +3 -0
  874. package/dist/types/components/pick-list-item/pick-list-item.d.ts +8 -8
  875. package/dist/types/components/popover/assets/popover/t9n/index.d.ts +3 -0
  876. package/dist/types/components/popover/popover.d.ts +24 -17
  877. package/dist/types/components/popover-manager/popover-manager.d.ts +1 -1
  878. package/dist/types/components/progress/progress.d.ts +7 -2
  879. package/dist/types/components/radio-button/radio-button.d.ts +6 -6
  880. package/dist/types/components/radio-button-group/radio-button-group.d.ts +4 -4
  881. package/dist/types/components/radio-group/radio-group.d.ts +3 -3
  882. package/dist/types/components/radio-group-item/radio-group-item.d.ts +8 -8
  883. package/dist/types/components/rating/assets/rating/t9n/index.d.ts +4 -0
  884. package/dist/types/components/rating/rating.d.ts +4 -4
  885. package/dist/types/components/scrim/assets/scrim/t9n/index.d.ts +3 -0
  886. package/dist/types/components/scrim/scrim.d.ts +1 -1
  887. package/dist/types/components/select/select.d.ts +4 -4
  888. package/dist/types/components/shell-center-row/shell-center-row.d.ts +2 -2
  889. package/dist/types/components/shell-panel/assets/shell-panel/t9n/index.d.ts +3 -0
  890. package/dist/types/components/shell-panel/shell-panel.d.ts +6 -6
  891. package/dist/types/components/slider/slider.d.ts +24 -25
  892. package/dist/types/components/sortable-list/sortable-list.d.ts +1 -1
  893. package/dist/types/components/split-button/split-button.d.ts +9 -7
  894. package/dist/types/components/stepper/stepper.d.ts +7 -2
  895. package/dist/types/components/stepper-item/stepper-item.d.ts +15 -11
  896. package/dist/types/components/switch/switch.d.ts +6 -6
  897. package/dist/types/components/tab/tab.d.ts +3 -3
  898. package/dist/types/components/tab-title/tab-title.d.ts +8 -8
  899. package/dist/types/components/tabs/tabs.d.ts +3 -4
  900. package/dist/types/components/tile/tile.d.ts +5 -5
  901. package/dist/types/components/tile-select/tile-select.d.ts +5 -5
  902. package/dist/types/components/tile-select-group/tile-select-group.d.ts +2 -2
  903. package/dist/types/components/time-picker/assets/time-picker/t9n/index.d.ts +14 -0
  904. package/dist/types/components/time-picker/time-picker.d.ts +13 -8
  905. package/dist/types/components/tip/assets/tip/t9n/index.d.ts +3 -0
  906. package/dist/types/components/tip/tip.d.ts +3 -3
  907. package/dist/types/components/tip-manager/assets/tip-manager/t9n/index.d.ts +7 -0
  908. package/dist/types/components/tip-manager/tip-manager.d.ts +3 -3
  909. package/dist/types/components/tooltip/tooltip.d.ts +16 -7
  910. package/dist/types/components/tooltip-manager/tooltip-manager.d.ts +1 -1
  911. package/dist/types/components/tree/tree.d.ts +2 -2
  912. package/dist/types/components/tree/utils.d.ts +1 -0
  913. package/dist/types/components/tree-item/tree-item.d.ts +10 -4
  914. package/dist/types/components/value-list/assets/value-list/t9n/index.d.ts +7 -0
  915. package/dist/types/components/value-list/value-list.d.ts +16 -16
  916. package/dist/types/components/value-list-item/value-list-item.d.ts +4 -4
  917. package/dist/types/components.d.ts +1074 -1007
  918. package/dist/types/preact.d.ts +2 -1
  919. package/dist/types/stencil-public-runtime.d.ts +15 -4
  920. package/dist/types/utils/config.d.ts +7 -0
  921. package/dist/types/utils/date.d.ts +0 -20
  922. package/dist/types/utils/dom.d.ts +19 -0
  923. package/dist/types/utils/floating-ui/nonChromiumPlatformUtils.d.ts +16 -0
  924. package/dist/types/utils/floating-ui.d.ts +45 -2
  925. package/dist/types/utils/locale.d.ts +81 -11
  926. package/dist/types/utils/number.d.ts +3 -5
  927. package/dist/types/utils/observers.d.ts +5 -1
  928. package/dist/types/utils/t9n.d.ts +88 -0
  929. package/dist/types/utils/time.d.ts +29 -5
  930. package/hydrate/index.d.ts +1 -1
  931. package/hydrate/index.js +2523 -1974
  932. package/package.json +31 -28
  933. package/readme.md +2 -2
  934. package/dist/calcite/calcite.js +0 -131
  935. package/dist/calcite/p-01e0a7fb.system.entry.js +0 -6
  936. package/dist/calcite/p-026ebb31.system.entry.js +0 -6
  937. package/dist/calcite/p-0371e393.system.js +0 -6
  938. package/dist/calcite/p-049ccea8.system.entry.js +0 -6
  939. package/dist/calcite/p-06715c20.system.entry.js +0 -6
  940. package/dist/calcite/p-0b16f5a2.entry.js +0 -6
  941. package/dist/calcite/p-120e25b0.entry.js +0 -6
  942. package/dist/calcite/p-132242dd.system.js +0 -6
  943. package/dist/calcite/p-164c7993.system.entry.js +0 -6
  944. package/dist/calcite/p-180c45dd.js +0 -6
  945. package/dist/calcite/p-1927311f.system.js +0 -6
  946. package/dist/calcite/p-195b47d8.system.entry.js +0 -6
  947. package/dist/calcite/p-1a801c80.system.entry.js +0 -6
  948. package/dist/calcite/p-1c1808a9.system.js +0 -6
  949. package/dist/calcite/p-21e61d1f.system.entry.js +0 -6
  950. package/dist/calcite/p-2204aeed.entry.js +0 -6
  951. package/dist/calcite/p-2292f660.entry.js +0 -6
  952. package/dist/calcite/p-234334e8.system.js +0 -7
  953. package/dist/calcite/p-240b92fc.system.entry.js +0 -6
  954. package/dist/calcite/p-244e6a16.system.js +0 -6
  955. package/dist/calcite/p-24fc537c.entry.js +0 -6
  956. package/dist/calcite/p-25d9815f.entry.js +0 -6
  957. package/dist/calcite/p-2942f335.entry.js +0 -6
  958. package/dist/calcite/p-296b72ab.entry.js +0 -6
  959. package/dist/calcite/p-2a6d83f2.system.entry.js +0 -6
  960. package/dist/calcite/p-2bb5628e.system.entry.js +0 -6
  961. package/dist/calcite/p-2dc6b889.js +0 -6
  962. package/dist/calcite/p-33e2cc83.entry.js +0 -6
  963. package/dist/calcite/p-35df3a74.entry.js +0 -6
  964. package/dist/calcite/p-390ae661.entry.js +0 -6
  965. package/dist/calcite/p-3ba3650d.entry.js +0 -6
  966. package/dist/calcite/p-3c899e58.entry.js +0 -6
  967. package/dist/calcite/p-3d0903d1.entry.js +0 -6
  968. package/dist/calcite/p-3d277c10.entry.js +0 -6
  969. package/dist/calcite/p-3fe14113.entry.js +0 -6
  970. package/dist/calcite/p-421fa896.entry.js +0 -6
  971. package/dist/calcite/p-438e56fd.entry.js +0 -6
  972. package/dist/calcite/p-43f9bb67.system.js +0 -6
  973. package/dist/calcite/p-4450a62e.system.entry.js +0 -6
  974. package/dist/calcite/p-4591d14e.entry.js +0 -6
  975. package/dist/calcite/p-47537b0f.system.entry.js +0 -6
  976. package/dist/calcite/p-4776fee2.entry.js +0 -6
  977. package/dist/calcite/p-4a3dcaab.entry.js +0 -6
  978. package/dist/calcite/p-4b4c47b4.system.js +0 -6
  979. package/dist/calcite/p-4bd4b21b.system.js +0 -12
  980. package/dist/calcite/p-4d9e93ae.system.js +0 -6
  981. package/dist/calcite/p-50148e92.system.entry.js +0 -6
  982. package/dist/calcite/p-524ac193.system.js +0 -6
  983. package/dist/calcite/p-54dc5c4f.system.entry.js +0 -6
  984. package/dist/calcite/p-55051fef.js +0 -6
  985. package/dist/calcite/p-576b3dfd.entry.js +0 -6
  986. package/dist/calcite/p-57c051cd.system.entry.js +0 -6
  987. package/dist/calcite/p-580abaa0.system.entry.js +0 -6
  988. package/dist/calcite/p-59e4f11d.entry.js +0 -6
  989. package/dist/calcite/p-5b7d6465.system.js +0 -6
  990. package/dist/calcite/p-5ee0d6fc.entry.js +0 -6
  991. package/dist/calcite/p-5ff62aa9.system.entry.js +0 -6
  992. package/dist/calcite/p-61508652.system.js +0 -6
  993. package/dist/calcite/p-619ea68d.system.entry.js +0 -6
  994. package/dist/calcite/p-638c0f83.system.js +0 -6
  995. package/dist/calcite/p-63be4875.js +0 -7
  996. package/dist/calcite/p-661983f6.system.js +0 -6
  997. package/dist/calcite/p-66a8d6f6.entry.js +0 -6
  998. package/dist/calcite/p-67a854c0.entry.js +0 -6
  999. package/dist/calcite/p-680d6cf6.entry.js +0 -6
  1000. package/dist/calcite/p-6941ffe8.entry.js +0 -6
  1001. package/dist/calcite/p-6ad53382.system.entry.js +0 -6
  1002. package/dist/calcite/p-6c421b57.entry.js +0 -6
  1003. package/dist/calcite/p-6ca84ba8.entry.js +0 -6
  1004. package/dist/calcite/p-6d884dae.entry.js +0 -6
  1005. package/dist/calcite/p-6e8a4081.system.entry.js +0 -6
  1006. package/dist/calcite/p-70c06ad4.system.entry.js +0 -6
  1007. package/dist/calcite/p-71650d4e.system.entry.js +0 -6
  1008. package/dist/calcite/p-74b0148d.system.js +0 -6
  1009. package/dist/calcite/p-75cb1d5b.system.entry.js +0 -6
  1010. package/dist/calcite/p-75f64c6d.entry.js +0 -6
  1011. package/dist/calcite/p-7c550d9b.entry.js +0 -6
  1012. package/dist/calcite/p-7ed2f59f.system.entry.js +0 -6
  1013. package/dist/calcite/p-85c6e58a.system.entry.js +0 -6
  1014. package/dist/calcite/p-89a7e6bc.entry.js +0 -6
  1015. package/dist/calcite/p-8c66c36c.system.js +0 -6
  1016. package/dist/calcite/p-8c95d7a0.entry.js +0 -6
  1017. package/dist/calcite/p-8e41d2bb.system.js +0 -6
  1018. package/dist/calcite/p-8ee1498f.entry.js +0 -6
  1019. package/dist/calcite/p-92038736.system.entry.js +0 -6
  1020. package/dist/calcite/p-9241c6a5.entry.js +0 -6
  1021. package/dist/calcite/p-93970959.system.entry.js +0 -6
  1022. package/dist/calcite/p-960c76e9.system.entry.js +0 -6
  1023. package/dist/calcite/p-96236e5c.entry.js +0 -6
  1024. package/dist/calcite/p-9a9fbf22.entry.js +0 -6
  1025. package/dist/calcite/p-9ae4b555.entry.js +0 -6
  1026. package/dist/calcite/p-9aebe377.entry.js +0 -6
  1027. package/dist/calcite/p-9b43c40c.system.js +0 -6
  1028. package/dist/calcite/p-9ca4f290.system.js +0 -6
  1029. package/dist/calcite/p-9dccf007.js +0 -6
  1030. package/dist/calcite/p-9ef7904e.js +0 -6
  1031. package/dist/calcite/p-a304a6b7.system.entry.js +0 -6
  1032. package/dist/calcite/p-a4cff117.system.js +0 -6
  1033. package/dist/calcite/p-a726bcff.entry.js +0 -6
  1034. package/dist/calcite/p-a9221536.system.js +0 -6
  1035. package/dist/calcite/p-aa6d9dcc.system.entry.js +0 -6
  1036. package/dist/calcite/p-ab4d0b8e.entry.js +0 -6
  1037. package/dist/calcite/p-abdc8c60.system.entry.js +0 -6
  1038. package/dist/calcite/p-abf5fb38.entry.js +0 -6
  1039. package/dist/calcite/p-ad22f173.entry.js +0 -6
  1040. package/dist/calcite/p-ad68bd9e.system.entry.js +0 -6
  1041. package/dist/calcite/p-ad884bc4.system.js +0 -6
  1042. package/dist/calcite/p-ae2518f0.system.js +0 -6
  1043. package/dist/calcite/p-aef54c5f.system.entry.js +0 -6
  1044. package/dist/calcite/p-b084a958.entry.js +0 -6
  1045. package/dist/calcite/p-b10ce7f4.system.entry.js +0 -6
  1046. package/dist/calcite/p-b1859703.system.entry.js +0 -6
  1047. package/dist/calcite/p-b29859b5.system.entry.js +0 -6
  1048. package/dist/calcite/p-b3004fac.entry.js +0 -6
  1049. package/dist/calcite/p-b51eb86c.system.entry.js +0 -6
  1050. package/dist/calcite/p-b5ef1019.entry.js +0 -6
  1051. package/dist/calcite/p-b6f004c4.entry.js +0 -6
  1052. package/dist/calcite/p-b7941592.js +0 -6
  1053. package/dist/calcite/p-b795148e.entry.js +0 -6
  1054. package/dist/calcite/p-b9fb0207.system.js +0 -6
  1055. package/dist/calcite/p-bb36ddb1.system.entry.js +0 -6
  1056. package/dist/calcite/p-bbc5fa4d.system.entry.js +0 -6
  1057. package/dist/calcite/p-bf0d4fa9.system.entry.js +0 -6
  1058. package/dist/calcite/p-c18b2f37.system.entry.js +0 -6
  1059. package/dist/calcite/p-c20b0a94.system.entry.js +0 -6
  1060. package/dist/calcite/p-c311d80b.entry.js +0 -6
  1061. package/dist/calcite/p-c3380c86.system.entry.js +0 -6
  1062. package/dist/calcite/p-c370487d.entry.js +0 -6
  1063. package/dist/calcite/p-c3a76a69.js +0 -6
  1064. package/dist/calcite/p-c75e4948.system.entry.js +0 -6
  1065. package/dist/calcite/p-c9179809.entry.js +0 -6
  1066. package/dist/calcite/p-ca72c4da.system.entry.js +0 -6
  1067. package/dist/calcite/p-cd3d8542.system.js +0 -6
  1068. package/dist/calcite/p-ce6b62ad.entry.js +0 -6
  1069. package/dist/calcite/p-d1131b5d.system.entry.js +0 -6
  1070. package/dist/calcite/p-d18b3ee8.entry.js +0 -6
  1071. package/dist/calcite/p-d30e6a15.system.entry.js +0 -6
  1072. package/dist/calcite/p-d6627d94.system.entry.js +0 -6
  1073. package/dist/calcite/p-d686deea.system.entry.js +0 -6
  1074. package/dist/calcite/p-dc294613.system.js +0 -6
  1075. package/dist/calcite/p-dc346223.system.js +0 -6
  1076. package/dist/calcite/p-dcb7c0a5.system.entry.js +0 -6
  1077. package/dist/calcite/p-e0ecae58.system.entry.js +0 -6
  1078. package/dist/calcite/p-e1799b74.system.js +0 -6
  1079. package/dist/calcite/p-e1e4265f.system.js +0 -6
  1080. package/dist/calcite/p-e30b9b3a.entry.js +0 -6
  1081. package/dist/calcite/p-e836bdbf.system.entry.js +0 -6
  1082. package/dist/calcite/p-e8c8a9c4.js +0 -6
  1083. package/dist/calcite/p-eb000d01.system.entry.js +0 -6
  1084. package/dist/calcite/p-ec32dce1.entry.js +0 -6
  1085. package/dist/calcite/p-ed965a88.entry.js +0 -6
  1086. package/dist/calcite/p-eddb3738.entry.js +0 -6
  1087. package/dist/calcite/p-f22e79c7.entry.js +0 -6
  1088. package/dist/calcite/p-f69aa7a0.system.entry.js +0 -6
  1089. package/dist/calcite/p-f6a26297.system.entry.js +0 -6
  1090. package/dist/calcite/p-fbb251a6.system.entry.js +0 -6
  1091. package/dist/calcite/p-fc374bdb.system.entry.js +0 -6
  1092. package/dist/calcite/p-fd76be2a.system.entry.js +0 -6
  1093. package/dist/calcite/p-ff26531e.system.entry.js +0 -6
  1094. package/dist/cjs/globalAttributes-2783566c.js +0 -335
  1095. package/dist/cjs/observers-82a85a0c.js +0 -27
  1096. package/dist/components/globalAttributes.js +0 -324
  1097. package/dist/custom-elements/index.d.ts +0 -597
  1098. package/dist/custom-elements/index.js +0 -28881
  1099. package/dist/esm/globalAttributes-9a3874c6.js +0 -324
  1100. package/dist/esm/observers-251355d3.js +0 -25
  1101. package/dist/esm-es5/ExpandToggle-51cda39f.js +0 -6
  1102. package/dist/esm-es5/Heading-3a6ae137.js +0 -6
  1103. package/dist/esm-es5/app-globals-8ea1c0e3.js +0 -6
  1104. package/dist/esm-es5/array-2db27e14.js +0 -6
  1105. package/dist/esm-es5/calcite-accordion_2.entry.js +0 -6
  1106. package/dist/esm-es5/calcite-action-bar.entry.js +0 -6
  1107. package/dist/esm-es5/calcite-action-group.entry.js +0 -6
  1108. package/dist/esm-es5/calcite-action-menu.entry.js +0 -6
  1109. package/dist/esm-es5/calcite-action-pad.entry.js +0 -6
  1110. package/dist/esm-es5/calcite-action.entry.js +0 -6
  1111. package/dist/esm-es5/calcite-alert.entry.js +0 -6
  1112. package/dist/esm-es5/calcite-avatar.entry.js +0 -6
  1113. package/dist/esm-es5/calcite-block_2.entry.js +0 -6
  1114. package/dist/esm-es5/calcite-button.entry.js +0 -6
  1115. package/dist/esm-es5/calcite-card.entry.js +0 -6
  1116. package/dist/esm-es5/calcite-checkbox.entry.js +0 -6
  1117. package/dist/esm-es5/calcite-chip.entry.js +0 -6
  1118. package/dist/esm-es5/calcite-color-picker_3.entry.js +0 -6
  1119. package/dist/esm-es5/calcite-combobox_3.entry.js +0 -6
  1120. package/dist/esm-es5/calcite-date-picker_4.entry.js +0 -6
  1121. package/dist/esm-es5/calcite-dropdown_3.entry.js +0 -6
  1122. package/dist/esm-es5/calcite-fab.entry.js +0 -6
  1123. package/dist/esm-es5/calcite-filter.entry.js +0 -6
  1124. package/dist/esm-es5/calcite-flow-item.entry.js +0 -6
  1125. package/dist/esm-es5/calcite-flow.entry.js +0 -6
  1126. package/dist/esm-es5/calcite-graph_2.entry.js +0 -6
  1127. package/dist/esm-es5/calcite-handle.entry.js +0 -6
  1128. package/dist/esm-es5/calcite-icon.entry.js +0 -6
  1129. package/dist/esm-es5/calcite-inline-editable.entry.js +0 -6
  1130. package/dist/esm-es5/calcite-input-date-picker.entry.js +0 -6
  1131. package/dist/esm-es5/calcite-input-message.entry.js +0 -6
  1132. package/dist/esm-es5/calcite-input-number.entry.js +0 -6
  1133. package/dist/esm-es5/calcite-input-text.entry.js +0 -6
  1134. package/dist/esm-es5/calcite-input-time-picker_2.entry.js +0 -6
  1135. package/dist/esm-es5/calcite-input.entry.js +0 -6
  1136. package/dist/esm-es5/calcite-label.entry.js +0 -6
  1137. package/dist/esm-es5/calcite-link.entry.js +0 -6
  1138. package/dist/esm-es5/calcite-list_3.entry.js +0 -6
  1139. package/dist/esm-es5/calcite-loader.entry.js +0 -6
  1140. package/dist/esm-es5/calcite-modal.entry.js +0 -6
  1141. package/dist/esm-es5/calcite-notice.entry.js +0 -6
  1142. package/dist/esm-es5/calcite-option_3.entry.js +0 -6
  1143. package/dist/esm-es5/calcite-pagination.entry.js +0 -6
  1144. package/dist/esm-es5/calcite-panel.entry.js +0 -6
  1145. package/dist/esm-es5/calcite-pick-list_3.entry.js +0 -6
  1146. package/dist/esm-es5/calcite-popover_2.entry.js +0 -6
  1147. package/dist/esm-es5/calcite-progress.entry.js +0 -6
  1148. package/dist/esm-es5/calcite-radio-button-group.entry.js +0 -6
  1149. package/dist/esm-es5/calcite-radio-button.entry.js +0 -6
  1150. package/dist/esm-es5/calcite-radio-group_2.entry.js +0 -6
  1151. package/dist/esm-es5/calcite-rating.entry.js +0 -6
  1152. package/dist/esm-es5/calcite-scrim.entry.js +0 -6
  1153. package/dist/esm-es5/calcite-shell_3.entry.js +0 -6
  1154. package/dist/esm-es5/calcite-sortable-list.entry.js +0 -6
  1155. package/dist/esm-es5/calcite-split-button.entry.js +0 -6
  1156. package/dist/esm-es5/calcite-stepper_2.entry.js +0 -6
  1157. package/dist/esm-es5/calcite-switch.entry.js +0 -6
  1158. package/dist/esm-es5/calcite-tab_4.entry.js +0 -6
  1159. package/dist/esm-es5/calcite-tile-select_2.entry.js +0 -6
  1160. package/dist/esm-es5/calcite-tile.entry.js +0 -6
  1161. package/dist/esm-es5/calcite-tip_3.entry.js +0 -6
  1162. package/dist/esm-es5/calcite-tooltip_2.entry.js +0 -6
  1163. package/dist/esm-es5/calcite-tree_2.entry.js +0 -6
  1164. package/dist/esm-es5/calcite-value-list_2.entry.js +0 -6
  1165. package/dist/esm-es5/calcite.js +0 -6
  1166. package/dist/esm-es5/conditionalSlot-a8df5b3f.js +0 -6
  1167. package/dist/esm-es5/debounce-d31cc476.js +0 -6
  1168. package/dist/esm-es5/dom-24af003b.js +0 -6
  1169. package/dist/esm-es5/filter-72316b3f.js +0 -6
  1170. package/dist/esm-es5/floating-ui-10f8689c.js +0 -6
  1171. package/dist/esm-es5/form-390fdf0f.js +0 -6
  1172. package/dist/esm-es5/globalAttributes-9a3874c6.js +0 -6
  1173. package/dist/esm-es5/guid-b68b1941.js +0 -6
  1174. package/dist/esm-es5/index-8384b5ec.js +0 -7
  1175. package/dist/esm-es5/interactive-f2ec7825.js +0 -6
  1176. package/dist/esm-es5/interfaces-ba98f966.js +0 -6
  1177. package/dist/esm-es5/key-ed874b7d.js +0 -6
  1178. package/dist/esm-es5/label-78f72c1a.js +0 -6
  1179. package/dist/esm-es5/loader.js +0 -6
  1180. package/dist/esm-es5/math-2893cee3.js +0 -6
  1181. package/dist/esm-es5/observers-251355d3.js +0 -6
  1182. package/dist/esm-es5/openCloseComponent-0a4c6226.js +0 -6
  1183. package/dist/esm-es5/resources-0497ae87.js +0 -6
  1184. package/dist/esm-es5/resources-32c242fa.js +0 -6
  1185. package/dist/esm-es5/resources-351f6f14.js +0 -6
  1186. package/dist/esm-es5/resources-3acd3089.js +0 -6
  1187. package/dist/esm-es5/resources-ea0a60b4.js +0 -6
  1188. package/dist/esm-es5/resources-f8aa3ed1.js +0 -6
  1189. package/dist/esm-es5/sortable.esm-3d78dbdc.js +0 -12
  1190. package/dist/esm-es5/utils-a7e4e0e1.js +0 -6
@@ -1,83 +1,26 @@
1
1
  /*!
2
2
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
4
- * v1.0.0-beta.95
4
+ * v1.0.0-beta.97
5
5
  */
6
6
  const NAMESPACE = 'calcite';
7
7
 
8
+ /**
9
+ * Virtual DOM patching algorithm based on Snabbdom by
10
+ * Simon Friis Vindum (@paldepind)
11
+ * Licensed under the MIT License
12
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
13
+ *
14
+ * Modified for Stencil's renderer and slot projection
15
+ */
8
16
  let scopeId;
9
17
  let hostTagName;
10
18
  let isSvgMode = false;
11
19
  let queuePending = false;
12
- const win = typeof window !== 'undefined' ? window : {};
13
- const doc = win.document || { head: {} };
14
- const plt = {
15
- $flags$: 0,
16
- $resourcesUrl$: '',
17
- jmp: (h) => h(),
18
- raf: (h) => requestAnimationFrame(h),
19
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
20
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
21
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
22
- };
23
- const supportsShadow = true;
24
- const promiseResolve = (v) => Promise.resolve(v);
25
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
26
- try {
27
- new CSSStyleSheet();
28
- return typeof new CSSStyleSheet().replaceSync === 'function';
29
- }
30
- catch (e) { }
31
- return false;
32
- })()
33
- ;
34
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
35
- if (listeners) {
36
- listeners.map(([flags, name, method]) => {
37
- const target = getHostListenerTarget(elm, flags) ;
38
- const handler = hostListenerProxy(hostRef, method);
39
- const opts = hostListenerOpts(flags);
40
- plt.ael(target, name, handler, opts);
41
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
42
- });
43
- }
44
- };
45
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
46
- try {
47
- {
48
- if (hostRef.$flags$ & 256 /* isListenReady */) {
49
- // instance is ready, let's call it's member method for this event
50
- hostRef.$lazyInstance$[methodName](ev);
51
- }
52
- else {
53
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
54
- }
55
- }
56
- }
57
- catch (e) {
58
- consoleError(e);
59
- }
60
- };
61
- const getHostListenerTarget = (elm, flags) => {
62
- if (flags & 4 /* TargetDocument */)
63
- return doc;
64
- if (flags & 8 /* TargetWindow */)
65
- return win;
66
- if (flags & 16 /* TargetBody */)
67
- return doc.body;
68
- return elm;
20
+ const getAssetPath = (path) => {
21
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
22
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
69
23
  };
70
- // prettier-ignore
71
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
72
- const CONTENT_REF_ID = 'r';
73
- const ORG_LOCATION_ID = 'o';
74
- const SLOT_NODE_ID = 's';
75
- const TEXT_NODE_ID = 't';
76
- const HYDRATE_ID = 's-id';
77
- const HYDRATED_STYLE_ID = 'sty-id';
78
- const HYDRATE_CHILD_ID = 'c-id';
79
- const HYDRATED_CSS = '{visibility:hidden}[calcite-hydrated]{visibility:inherit}';
80
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
81
24
  const createTime = (fnName, tagName = '') => {
82
25
  {
83
26
  return () => {
@@ -92,82 +35,15 @@ const uniqueTime = (key, measureText) => {
92
35
  };
93
36
  }
94
37
  };
95
- const rootAppliedStyles = new WeakMap();
96
- const registerStyle = (scopeId, cssText, allowCS) => {
97
- let style = styles.get(scopeId);
98
- if (supportsConstructableStylesheets && allowCS) {
99
- style = (style || new CSSStyleSheet());
100
- if (typeof style === 'string') {
101
- style = cssText;
102
- }
103
- else {
104
- style.replaceSync(cssText);
105
- }
106
- }
107
- else {
108
- style = cssText;
109
- }
110
- styles.set(scopeId, style);
111
- };
112
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
113
- let scopeId = getScopeId(cmpMeta);
114
- const style = styles.get(scopeId);
115
- // if an element is NOT connected then getRootNode() will return the wrong root node
116
- // so the fallback is to always use the document for the root node in those cases
117
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
118
- if (style) {
119
- if (typeof style === 'string') {
120
- styleContainerNode = styleContainerNode.head || styleContainerNode;
121
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
122
- let styleElm;
123
- if (!appliedStyles) {
124
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
125
- }
126
- if (!appliedStyles.has(scopeId)) {
127
- if (styleContainerNode.host &&
128
- (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
129
- // This is only happening on native shadow-dom, do not needs CSS var shim
130
- styleElm.innerHTML = style;
131
- }
132
- else {
133
- {
134
- styleElm = doc.createElement('style');
135
- styleElm.innerHTML = style;
136
- }
137
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
138
- }
139
- if (appliedStyles) {
140
- appliedStyles.add(scopeId);
141
- }
142
- }
143
- }
144
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
145
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
146
- }
147
- }
148
- return scopeId;
149
- };
150
- const attachStyles = (hostRef) => {
151
- const cmpMeta = hostRef.$cmpMeta$;
152
- const elm = hostRef.$hostElement$;
153
- const flags = cmpMeta.$flags$;
154
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
155
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
156
- if (flags & 10 /* needsScopedEncapsulation */) {
157
- // only required when we're NOT using native shadow dom (slot)
158
- // or this browser doesn't support native shadow dom
159
- // and this host element was NOT created with SSR
160
- // let's pick out the inner content for slot projection
161
- // create a node to represent where the original
162
- // content was first placed, which is useful later on
163
- // DOM WRITE!!
164
- elm['s-sc'] = scopeId;
165
- elm.classList.add(scopeId + '-h');
166
- }
167
- endAttachStyles();
168
- };
169
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
170
- const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
38
+ const CONTENT_REF_ID = 'r';
39
+ const ORG_LOCATION_ID = 'o';
40
+ const SLOT_NODE_ID = 's';
41
+ const TEXT_NODE_ID = 't';
42
+ const HYDRATE_ID = 's-id';
43
+ const HYDRATED_STYLE_ID = 'sty-id';
44
+ const HYDRATE_CHILD_ID = 'c-id';
45
+ const HYDRATED_CSS = '{visibility:hidden}[calcite-hydrated]{visibility:inherit}';
46
+ const XLINK_NS = 'http://www.w3.org/1999/xlink';
171
47
  /**
172
48
  * Default style mode id
173
49
  */
@@ -306,433 +182,253 @@ const convertToPrivate = (node) => {
306
182
  vnode.$name$ = node.vname;
307
183
  return vnode;
308
184
  };
309
- /**
310
- * Production setAccessor() function based on Preact by
311
- * Jason Miller (@developit)
312
- * Licensed under the MIT License
313
- * https://github.com/developit/preact/blob/master/LICENSE
314
- *
315
- * Modified for Stencil's compiler and vdom
316
- */
317
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
318
- if (oldValue !== newValue) {
319
- let isProp = isMemberInElement(elm, memberName);
320
- let ln = memberName.toLowerCase();
321
- if (memberName === 'class') {
322
- const classList = elm.classList;
323
- const oldClasses = parseClassList(oldValue);
324
- const newClasses = parseClassList(newValue);
325
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
326
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
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
- }
185
+ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
186
+ const endHydrate = createTime('hydrateClient', tagName);
187
+ const shadowRoot = hostElm.shadowRoot;
188
+ const childRenderNodes = [];
189
+ const slotNodes = [];
190
+ const shadowRootNodes = shadowRoot ? [] : null;
191
+ const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
192
+ if (!plt.$orgLocNodes$) {
193
+ initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
194
+ }
195
+ hostElm[HYDRATE_ID] = hostId;
196
+ hostElm.removeAttribute(HYDRATE_ID);
197
+ clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
198
+ childRenderNodes.map((c) => {
199
+ const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
200
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
201
+ const node = c.$elm$;
202
+ if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
203
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
352
204
  }
353
- else if (memberName === 'key')
354
- ;
355
- else if (memberName === 'ref') {
356
- // minifier will clean this up
357
- if (newValue) {
358
- newValue(elm);
205
+ if (!shadowRoot) {
206
+ node['s-hn'] = tagName;
207
+ if (orgLocationNode) {
208
+ node['s-ol'] = orgLocationNode;
209
+ node['s-ol']['s-nr'] = node;
359
210
  }
360
211
  }
361
- else if ((!isProp ) &&
362
- memberName[0] === 'o' &&
363
- memberName[1] === 'n') {
364
- // Event Handlers
365
- // so if the member name starts with "on" and the 3rd characters is
366
- // a capital letter, and it's not already a member on the element,
367
- // then we're assuming it's an event listener
368
- if (memberName[2] === '-') {
369
- // on- prefixed events
370
- // allows to be explicit about the dom event to listen without any magic
371
- // under the hood:
372
- // <my-cmp on-click> // listens for "click"
373
- // <my-cmp on-Click> // listens for "Click"
374
- // <my-cmp on-ionChange> // listens for "ionChange"
375
- // <my-cmp on-EVENTS> // listens for "EVENTS"
376
- memberName = memberName.slice(3);
377
- }
378
- else if (isMemberInElement(win, ln)) {
379
- // standard event
380
- // the JSX attribute could have been "onMouseOver" and the
381
- // member name "onmouseover" is on the window's prototype
382
- // so let's add the listener "mouseover", which is all lowercased
383
- memberName = ln.slice(2);
212
+ plt.$orgLocNodes$.delete(orgLocationId);
213
+ });
214
+ if (shadowRoot) {
215
+ shadowRootNodes.map((shadowRootNode) => {
216
+ if (shadowRootNode) {
217
+ shadowRoot.appendChild(shadowRootNode);
384
218
  }
385
- else {
386
- // custom event
387
- // the JSX attribute could have been "onMyCustomEvent"
388
- // so let's trim off the "on" prefix and lowercase the first character
389
- // and add the listener "myCustomEvent"
390
- // except for the first character, we keep the event name case
391
- memberName = ln[2] + memberName.slice(3);
392
- }
393
- if (oldValue) {
394
- plt.rel(elm, memberName, oldValue, false);
219
+ });
220
+ }
221
+ endHydrate();
222
+ };
223
+ const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
224
+ let childNodeType;
225
+ let childIdSplt;
226
+ let childVNode;
227
+ let i;
228
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
229
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
230
+ if (childNodeType) {
231
+ // got the node data from the element's attribute
232
+ // `${hostId}.${nodeId}.${depth}.${index}`
233
+ childIdSplt = childNodeType.split('.');
234
+ if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
235
+ childVNode = {
236
+ $flags$: 0,
237
+ $hostId$: childIdSplt[0],
238
+ $nodeId$: childIdSplt[1],
239
+ $depth$: childIdSplt[2],
240
+ $index$: childIdSplt[3],
241
+ $tag$: node.tagName.toLowerCase(),
242
+ $elm$: node,
243
+ $attrs$: null,
244
+ $children$: null,
245
+ $key$: null,
246
+ $name$: null,
247
+ $text$: null,
248
+ };
249
+ childRenderNodes.push(childVNode);
250
+ node.removeAttribute(HYDRATE_CHILD_ID);
251
+ // this is a new child vnode
252
+ // so ensure its parent vnode has the vchildren array
253
+ if (!parentVNode.$children$) {
254
+ parentVNode.$children$ = [];
255
+ }
256
+ // add our child vnode to a specific index of the vnode's children
257
+ parentVNode.$children$[childVNode.$index$] = childVNode;
258
+ // this is now the new parent vnode for all the next child checks
259
+ parentVNode = childVNode;
260
+ if (shadowRootNodes && childVNode.$depth$ === '0') {
261
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
262
+ }
395
263
  }
396
- if (newValue) {
397
- plt.ael(elm, memberName, newValue, false);
264
+ }
265
+ // recursively drill down, end to start so we can remove nodes
266
+ for (i = node.childNodes.length - 1; i >= 0; i--) {
267
+ clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
268
+ }
269
+ if (node.shadowRoot) {
270
+ // keep drilling down through the shadow root nodes
271
+ for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
272
+ clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
398
273
  }
399
274
  }
400
- else {
401
- // Set property if it exists and it's not a SVG
402
- const isComplex = isComplexType(newValue);
403
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
404
- try {
405
- if (!elm.tagName.includes('-')) {
406
- const n = newValue == null ? '' : newValue;
407
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
408
- if (memberName === 'list') {
409
- isProp = false;
410
- }
411
- else if (oldValue == null || elm[memberName] != n) {
412
- elm[memberName] = n;
413
- }
275
+ }
276
+ else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
277
+ // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
278
+ childIdSplt = node.nodeValue.split('.');
279
+ if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
280
+ // comment node for either the host id or a 0 host id
281
+ childNodeType = childIdSplt[0];
282
+ childVNode = {
283
+ $flags$: 0,
284
+ $hostId$: childIdSplt[1],
285
+ $nodeId$: childIdSplt[2],
286
+ $depth$: childIdSplt[3],
287
+ $index$: childIdSplt[4],
288
+ $elm$: node,
289
+ $attrs$: null,
290
+ $children$: null,
291
+ $key$: null,
292
+ $name$: null,
293
+ $tag$: null,
294
+ $text$: null,
295
+ };
296
+ if (childNodeType === TEXT_NODE_ID) {
297
+ childVNode.$elm$ = node.nextSibling;
298
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
299
+ childVNode.$text$ = childVNode.$elm$.textContent;
300
+ childRenderNodes.push(childVNode);
301
+ // remove the text comment since it's no longer needed
302
+ node.remove();
303
+ if (!parentVNode.$children$) {
304
+ parentVNode.$children$ = [];
414
305
  }
415
- else {
416
- elm[memberName] = newValue;
306
+ parentVNode.$children$[childVNode.$index$] = childVNode;
307
+ if (shadowRootNodes && childVNode.$depth$ === '0') {
308
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
417
309
  }
418
310
  }
419
- catch (e) { }
420
- }
421
- /**
422
- * Need to manually update attribute if:
423
- * - memberName is not an attribute
424
- * - if we are rendering the host element in order to reflect attribute
425
- * - if it's a SVG, since properties might not work in <svg>
426
- * - if the newValue is null/undefined or 'false'.
427
- */
428
- let xlink = false;
429
- {
430
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
431
- memberName = ln;
432
- xlink = true;
433
- }
434
311
  }
435
- if (newValue == null || newValue === false) {
436
- if (newValue !== false || elm.getAttribute(memberName) === '') {
437
- if (xlink) {
438
- elm.removeAttributeNS(XLINK_NS, memberName);
312
+ else if (childVNode.$hostId$ === hostId) {
313
+ // this comment node is specifcally for this host id
314
+ if (childNodeType === SLOT_NODE_ID) {
315
+ // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
316
+ childVNode.$tag$ = 'slot';
317
+ if (childIdSplt[5]) {
318
+ node['s-sn'] = childVNode.$name$ = childIdSplt[5];
439
319
  }
440
320
  else {
441
- elm.removeAttribute(memberName);
321
+ node['s-sn'] = '';
442
322
  }
323
+ node['s-sr'] = true;
324
+ if (shadowRootNodes) {
325
+ // browser support shadowRoot and this is a shadow dom component
326
+ // create an actual slot element
327
+ childVNode.$elm$ = doc.createElement(childVNode.$tag$);
328
+ if (childVNode.$name$) {
329
+ // add the slot name attribute
330
+ childVNode.$elm$.setAttribute('name', childVNode.$name$);
331
+ }
332
+ // insert the new slot element before the slot comment
333
+ node.parentNode.insertBefore(childVNode.$elm$, node);
334
+ // remove the slot comment since it's not needed for shadow
335
+ node.remove();
336
+ if (childVNode.$depth$ === '0') {
337
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
338
+ }
339
+ }
340
+ slotNodes.push(childVNode);
341
+ if (!parentVNode.$children$) {
342
+ parentVNode.$children$ = [];
343
+ }
344
+ parentVNode.$children$[childVNode.$index$] = childVNode;
443
345
  }
444
- }
445
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
446
- newValue = newValue === true ? '' : newValue;
447
- if (xlink) {
448
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
449
- }
450
- else {
451
- elm.setAttribute(memberName, newValue);
346
+ else if (childNodeType === CONTENT_REF_ID) {
347
+ // `${CONTENT_REF_ID}.${hostId}`;
348
+ if (shadowRootNodes) {
349
+ // remove the content ref comment since it's not needed for shadow
350
+ node.remove();
351
+ }
452
352
  }
453
353
  }
454
354
  }
455
355
  }
356
+ else if (parentVNode && parentVNode.$tag$ === 'style') {
357
+ const vnode = newVNode(null, node.textContent);
358
+ vnode.$elm$ = node;
359
+ vnode.$index$ = '0';
360
+ parentVNode.$children$ = [vnode];
361
+ }
456
362
  };
457
- const parseClassListRegex = /\s/;
458
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
459
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
460
- // if the element passed in is a shadow root, which is a document fragment
461
- // then we want to be adding attrs/props to the shadow root's "host" element
462
- // if it's not a shadow root, then we add attrs/props to the same element
463
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
464
- ? newVnode.$elm$.host
465
- : newVnode.$elm$;
466
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
467
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
468
- {
469
- // remove attributes no longer present on the vnode by setting them to undefined
470
- for (memberName in oldVnodeAttrs) {
471
- if (!(memberName in newVnodeAttrs)) {
472
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
363
+ const initializeDocumentHydrate = (node, orgLocNodes) => {
364
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
365
+ let i = 0;
366
+ for (; i < node.childNodes.length; i++) {
367
+ initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
368
+ }
369
+ if (node.shadowRoot) {
370
+ for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
371
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
473
372
  }
474
373
  }
475
374
  }
476
- // add new & update changed attributes
477
- for (memberName in newVnodeAttrs) {
478
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
375
+ else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
376
+ const childIdSplt = node.nodeValue.split('.');
377
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
378
+ orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
379
+ node.nodeValue = '';
380
+ // useful to know if the original location is
381
+ // the root light-dom of a shadow dom component
382
+ node['s-en'] = childIdSplt[3];
383
+ }
479
384
  }
480
385
  };
481
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
482
- // tslint:disable-next-line: prefer-const
483
- const newVNode = newParentVNode.$children$[childIndex];
484
- let i = 0;
485
- let elm;
486
- let childNode;
487
- if (newVNode.$text$ !== null) {
488
- // create text node
489
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
490
- }
491
- else {
492
- if (!isSvgMode) {
493
- isSvgMode = newVNode.$tag$ === 'svg';
386
+ /**
387
+ * Parse a new property value for a given property type.
388
+ *
389
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
390
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
391
+ * 1. `any`, the type given to `propValue` in the function signature
392
+ * 2. the type stored from `propType`.
393
+ *
394
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
395
+ *
396
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
397
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
398
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
399
+ * ```tsx
400
+ * <my-cmp prop-val={0}></my-cmp>
401
+ * ```
402
+ *
403
+ * HTML prop values on the other hand, will always a string
404
+ *
405
+ * @param propValue the new value to coerce to some type
406
+ * @param propType the type of the prop, expressed as a binary number
407
+ * @returns the parsed/coerced value
408
+ */
409
+ const parsePropertyValue = (propValue, propType) => {
410
+ // ensure this value is of the correct prop type
411
+ if (propValue != null && !isComplexType(propValue)) {
412
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
413
+ // per the HTML spec, any string value means it is a boolean true value
414
+ // but we'll cheat here and say that the string "false" is the boolean false
415
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
494
416
  }
495
- // create element
496
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
497
- );
498
- if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
499
- isSvgMode = false;
500
- }
501
- // add css classes, attrs, props, listeners, etc.
502
- {
503
- updateElement(null, newVNode, isSvgMode);
504
- }
505
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
506
- // if there is a scopeId and this is the initial render
507
- // then let's add the scopeId as a css class
508
- elm.classList.add((elm['s-si'] = scopeId));
509
- }
510
- if (newVNode.$children$) {
511
- for (i = 0; i < newVNode.$children$.length; ++i) {
512
- // create the node
513
- childNode = createElm(oldParentVNode, newVNode, i);
514
- // return node could have been null
515
- if (childNode) {
516
- // append our new node
517
- elm.appendChild(childNode);
518
- }
519
- }
520
- }
521
- {
522
- if (newVNode.$tag$ === 'svg') {
523
- // Only reset the SVG context when we're exiting <svg> element
524
- isSvgMode = false;
525
- }
526
- else if (elm.tagName === 'foreignObject') {
527
- // Reenter SVG context when we're exiting <foreignObject> element
528
- isSvgMode = true;
529
- }
530
- }
531
- }
532
- return elm;
533
- };
534
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
535
- let containerElm = (parentElm);
536
- let childNode;
537
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
538
- containerElm = containerElm.shadowRoot;
539
- }
540
- for (; startIdx <= endIdx; ++startIdx) {
541
- if (vnodes[startIdx]) {
542
- childNode = createElm(null, parentVNode, startIdx);
543
- if (childNode) {
544
- vnodes[startIdx].$elm$ = childNode;
545
- containerElm.insertBefore(childNode, before);
546
- }
547
- }
548
- }
549
- };
550
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
551
- for (; startIdx <= endIdx; ++startIdx) {
552
- if ((vnode = vnodes[startIdx])) {
553
- elm = vnode.$elm$;
554
- callNodeRefs(vnode);
555
- // remove the vnode's element from the dom
556
- elm.remove();
557
- }
558
- }
559
- };
560
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
561
- let oldStartIdx = 0;
562
- let newStartIdx = 0;
563
- let idxInOld = 0;
564
- let i = 0;
565
- let oldEndIdx = oldCh.length - 1;
566
- let oldStartVnode = oldCh[0];
567
- let oldEndVnode = oldCh[oldEndIdx];
568
- let newEndIdx = newCh.length - 1;
569
- let newStartVnode = newCh[0];
570
- let newEndVnode = newCh[newEndIdx];
571
- let node;
572
- let elmToMove;
573
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
574
- if (oldStartVnode == null) {
575
- // Vnode might have been moved left
576
- oldStartVnode = oldCh[++oldStartIdx];
577
- }
578
- else if (oldEndVnode == null) {
579
- oldEndVnode = oldCh[--oldEndIdx];
580
- }
581
- else if (newStartVnode == null) {
582
- newStartVnode = newCh[++newStartIdx];
583
- }
584
- else if (newEndVnode == null) {
585
- newEndVnode = newCh[--newEndIdx];
586
- }
587
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
588
- patch(oldStartVnode, newStartVnode);
589
- oldStartVnode = oldCh[++oldStartIdx];
590
- newStartVnode = newCh[++newStartIdx];
591
- }
592
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
593
- patch(oldEndVnode, newEndVnode);
594
- oldEndVnode = oldCh[--oldEndIdx];
595
- newEndVnode = newCh[--newEndIdx];
596
- }
597
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
598
- patch(oldStartVnode, newEndVnode);
599
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
600
- oldStartVnode = oldCh[++oldStartIdx];
601
- newEndVnode = newCh[--newEndIdx];
602
- }
603
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
604
- patch(oldEndVnode, newStartVnode);
605
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
606
- oldEndVnode = oldCh[--oldEndIdx];
607
- newStartVnode = newCh[++newStartIdx];
608
- }
609
- else {
610
- // createKeyToOldIdx
611
- idxInOld = -1;
612
- {
613
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
614
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
615
- idxInOld = i;
616
- break;
617
- }
618
- }
619
- }
620
- if (idxInOld >= 0) {
621
- elmToMove = oldCh[idxInOld];
622
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
623
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
624
- }
625
- else {
626
- patch(elmToMove, newStartVnode);
627
- oldCh[idxInOld] = undefined;
628
- node = elmToMove.$elm$;
629
- }
630
- newStartVnode = newCh[++newStartIdx];
631
- }
632
- else {
633
- // new element
634
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
635
- newStartVnode = newCh[++newStartIdx];
636
- }
637
- if (node) {
638
- {
639
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
640
- }
641
- }
642
- }
643
- }
644
- if (oldStartIdx > oldEndIdx) {
645
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
646
- }
647
- else if (newStartIdx > newEndIdx) {
648
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
649
- }
650
- };
651
- const isSameVnode = (vnode1, vnode2) => {
652
- // compare if two vnode to see if they're "technically" the same
653
- // need to have the same element tag, and same key to be the same
654
- if (vnode1.$tag$ === vnode2.$tag$) {
655
- {
656
- return vnode1.$key$ === vnode2.$key$;
657
- }
658
- }
659
- return false;
660
- };
661
- const patch = (oldVNode, newVNode) => {
662
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
663
- const oldChildren = oldVNode.$children$;
664
- const newChildren = newVNode.$children$;
665
- const tag = newVNode.$tag$;
666
- const text = newVNode.$text$;
667
- if (text === null) {
668
- {
669
- // test if we're rendering an svg element, or still rendering nodes inside of one
670
- // only add this to the when the compiler sees we're using an svg somewhere
671
- isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
672
- }
673
- // element node
674
- {
675
- if (tag === 'slot')
676
- ;
677
- else {
678
- // either this is the first render of an element OR it's an update
679
- // AND we already know it's possible it could have changed
680
- // this updates the element's css classes, attrs, props, listeners, etc.
681
- updateElement(oldVNode, newVNode, isSvgMode);
682
- }
683
- }
684
- if (oldChildren !== null && newChildren !== null) {
685
- // looks like there's child vnodes for both the old and new vnodes
686
- updateChildren(elm, oldChildren, newVNode, newChildren);
687
- }
688
- else if (newChildren !== null) {
689
- // no old child vnodes, but there are new child vnodes to add
690
- if (oldVNode.$text$ !== null) {
691
- // the old vnode was text, so be sure to clear it out
692
- elm.textContent = '';
693
- }
694
- // add the new vnode children
695
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
696
- }
697
- else if (oldChildren !== null) {
698
- // no new child vnodes, but there are old child vnodes to remove
699
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
417
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
418
+ // force it to be a number
419
+ return parseFloat(propValue);
700
420
  }
701
- if (isSvgMode && tag === 'svg') {
702
- isSvgMode = false;
421
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
422
+ // could have been passed as a number or boolean
423
+ // but we still want it as a string
424
+ return String(propValue);
703
425
  }
426
+ // redundant return here for better minification
427
+ return propValue;
704
428
  }
705
- else if (oldVNode.$text$ !== text) {
706
- // update the text content for the text only vnode
707
- // and also only if the text is different than before
708
- elm.data = text;
709
- }
710
- };
711
- const callNodeRefs = (vNode) => {
712
- {
713
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
714
- vNode.$children$ && vNode.$children$.map(callNodeRefs);
715
- }
716
- };
717
- const renderVdom = (hostRef, renderFnResults) => {
718
- const hostElm = hostRef.$hostElement$;
719
- const cmpMeta = hostRef.$cmpMeta$;
720
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
721
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
722
- hostTagName = hostElm.tagName;
723
- if (cmpMeta.$attrsToReflect$) {
724
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
725
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
726
- }
727
- rootVnode.$tag$ = null;
728
- rootVnode.$flags$ |= 4 /* isHost */;
729
- hostRef.$vnode$ = rootVnode;
730
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
731
- {
732
- scopeId = hostElm['s-sc'];
733
- }
734
- // synchronous patch
735
- patch(oldVNode, rootVnode);
429
+ // not sure exactly what type we want
430
+ // so no need to change to a different type
431
+ return propValue;
736
432
  };
737
433
  const getElement = (ref) => (getHostRef(ref).$hostElement$ );
738
434
  const createEvent = (ref, name, flags) => {
@@ -740,9 +436,9 @@ const createEvent = (ref, name, flags) => {
740
436
  return {
741
437
  emit: (detail) => {
742
438
  return emitEvent(elm, name, {
743
- bubbles: !!(flags & 4 /* Bubbles */),
744
- composed: !!(flags & 2 /* Composed */),
745
- cancelable: !!(flags & 1 /* Cancellable */),
439
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
440
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
441
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
746
442
  detail,
747
443
  });
748
444
  },
@@ -760,440 +456,849 @@ const emitEvent = (elm, name, opts) => {
760
456
  elm.dispatchEvent(ev);
761
457
  return ev;
762
458
  };
763
- const attachToAncestor = (hostRef, ancestorComponent) => {
764
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
765
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
459
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
460
+ const registerStyle = (scopeId, cssText, allowCS) => {
461
+ let style = styles.get(scopeId);
462
+ if (supportsConstructableStylesheets && allowCS) {
463
+ style = (style || new CSSStyleSheet());
464
+ if (typeof style === 'string') {
465
+ style = cssText;
466
+ }
467
+ else {
468
+ style.replaceSync(cssText);
469
+ }
766
470
  }
767
- };
768
- const scheduleUpdate = (hostRef, isInitialLoad) => {
769
- {
770
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
471
+ else {
472
+ style = cssText;
771
473
  }
772
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
773
- hostRef.$flags$ |= 512 /* needsRerender */;
774
- return;
474
+ styles.set(scopeId, style);
475
+ };
476
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
477
+ let scopeId = getScopeId(cmpMeta);
478
+ const style = styles.get(scopeId);
479
+ // if an element is NOT connected then getRootNode() will return the wrong root node
480
+ // so the fallback is to always use the document for the root node in those cases
481
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
482
+ if (style) {
483
+ if (typeof style === 'string') {
484
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
485
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
486
+ let styleElm;
487
+ if (!appliedStyles) {
488
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
489
+ }
490
+ if (!appliedStyles.has(scopeId)) {
491
+ if (styleContainerNode.host &&
492
+ (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
493
+ // This is only happening on native shadow-dom, do not needs CSS var shim
494
+ styleElm.innerHTML = style;
495
+ }
496
+ else {
497
+ {
498
+ styleElm = doc.createElement('style');
499
+ styleElm.innerHTML = style;
500
+ }
501
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
502
+ }
503
+ if (appliedStyles) {
504
+ appliedStyles.add(scopeId);
505
+ }
506
+ }
507
+ }
508
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
509
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
510
+ }
775
511
  }
776
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
777
- // there is no ancestor component or the ancestor component
778
- // has already fired off its lifecycle update then
779
- // fire off the initial update
780
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
781
- return writeTask(dispatch) ;
512
+ return scopeId;
782
513
  };
783
- const dispatchHooks = (hostRef, isInitialLoad) => {
784
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
785
- const instance = hostRef.$lazyInstance$ ;
786
- let promise;
787
- if (isInitialLoad) {
788
- {
789
- hostRef.$flags$ |= 256 /* isListenReady */;
790
- if (hostRef.$queuedListeners$) {
791
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
792
- hostRef.$queuedListeners$ = null;
514
+ const attachStyles = (hostRef) => {
515
+ const cmpMeta = hostRef.$cmpMeta$;
516
+ const elm = hostRef.$hostElement$;
517
+ const flags = cmpMeta.$flags$;
518
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
519
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
520
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
521
+ // only required when we're NOT using native shadow dom (slot)
522
+ // or this browser doesn't support native shadow dom
523
+ // and this host element was NOT created with SSR
524
+ // let's pick out the inner content for slot projection
525
+ // create a node to represent where the original
526
+ // content was first placed, which is useful later on
527
+ // DOM WRITE!!
528
+ elm['s-sc'] = scopeId;
529
+ elm.classList.add(scopeId + '-h');
530
+ }
531
+ endAttachStyles();
532
+ };
533
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
534
+ const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
535
+ /**
536
+ * Production setAccessor() function based on Preact by
537
+ * Jason Miller (@developit)
538
+ * Licensed under the MIT License
539
+ * https://github.com/developit/preact/blob/master/LICENSE
540
+ *
541
+ * Modified for Stencil's compiler and vdom
542
+ */
543
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
544
+ if (oldValue !== newValue) {
545
+ let isProp = isMemberInElement(elm, memberName);
546
+ let ln = memberName.toLowerCase();
547
+ if (memberName === 'class') {
548
+ const classList = elm.classList;
549
+ const oldClasses = parseClassList(oldValue);
550
+ const newClasses = parseClassList(newValue);
551
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
552
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
553
+ }
554
+ else if (memberName === 'style') {
555
+ // update style attribute, css properties and values
556
+ {
557
+ for (const prop in oldValue) {
558
+ if (!newValue || newValue[prop] == null) {
559
+ if (prop.includes('-')) {
560
+ elm.style.removeProperty(prop);
561
+ }
562
+ else {
563
+ elm.style[prop] = '';
564
+ }
565
+ }
566
+ }
567
+ }
568
+ for (const prop in newValue) {
569
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
570
+ if (prop.includes('-')) {
571
+ elm.style.setProperty(prop, newValue[prop]);
572
+ }
573
+ else {
574
+ elm.style[prop] = newValue[prop];
575
+ }
576
+ }
793
577
  }
794
578
  }
795
- {
796
- promise = safeCall(instance, 'componentWillLoad');
579
+ else if (memberName === 'key')
580
+ ;
581
+ else if (memberName === 'ref') {
582
+ // minifier will clean this up
583
+ if (newValue) {
584
+ newValue(elm);
585
+ }
586
+ }
587
+ else if ((!isProp ) &&
588
+ memberName[0] === 'o' &&
589
+ memberName[1] === 'n') {
590
+ // Event Handlers
591
+ // so if the member name starts with "on" and the 3rd characters is
592
+ // a capital letter, and it's not already a member on the element,
593
+ // then we're assuming it's an event listener
594
+ if (memberName[2] === '-') {
595
+ // on- prefixed events
596
+ // allows to be explicit about the dom event to listen without any magic
597
+ // under the hood:
598
+ // <my-cmp on-click> // listens for "click"
599
+ // <my-cmp on-Click> // listens for "Click"
600
+ // <my-cmp on-ionChange> // listens for "ionChange"
601
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
602
+ memberName = memberName.slice(3);
603
+ }
604
+ else if (isMemberInElement(win, ln)) {
605
+ // standard event
606
+ // the JSX attribute could have been "onMouseOver" and the
607
+ // member name "onmouseover" is on the window's prototype
608
+ // so let's add the listener "mouseover", which is all lowercased
609
+ memberName = ln.slice(2);
610
+ }
611
+ else {
612
+ // custom event
613
+ // the JSX attribute could have been "onMyCustomEvent"
614
+ // so let's trim off the "on" prefix and lowercase the first character
615
+ // and add the listener "myCustomEvent"
616
+ // except for the first character, we keep the event name case
617
+ memberName = ln[2] + memberName.slice(3);
618
+ }
619
+ if (oldValue) {
620
+ plt.rel(elm, memberName, oldValue, false);
621
+ }
622
+ if (newValue) {
623
+ plt.ael(elm, memberName, newValue, false);
624
+ }
625
+ }
626
+ else {
627
+ // Set property if it exists and it's not a SVG
628
+ const isComplex = isComplexType(newValue);
629
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
630
+ try {
631
+ if (!elm.tagName.includes('-')) {
632
+ const n = newValue == null ? '' : newValue;
633
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
634
+ if (memberName === 'list') {
635
+ isProp = false;
636
+ }
637
+ else if (oldValue == null || elm[memberName] != n) {
638
+ elm[memberName] = n;
639
+ }
640
+ }
641
+ else {
642
+ elm[memberName] = newValue;
643
+ }
644
+ }
645
+ catch (e) { }
646
+ }
647
+ /**
648
+ * Need to manually update attribute if:
649
+ * - memberName is not an attribute
650
+ * - if we are rendering the host element in order to reflect attribute
651
+ * - if it's a SVG, since properties might not work in <svg>
652
+ * - if the newValue is null/undefined or 'false'.
653
+ */
654
+ let xlink = false;
655
+ {
656
+ if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
657
+ memberName = ln;
658
+ xlink = true;
659
+ }
660
+ }
661
+ if (newValue == null || newValue === false) {
662
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
663
+ if (xlink) {
664
+ elm.removeAttributeNS(XLINK_NS, memberName);
665
+ }
666
+ else {
667
+ elm.removeAttribute(memberName);
668
+ }
669
+ }
670
+ }
671
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
672
+ newValue = newValue === true ? '' : newValue;
673
+ if (xlink) {
674
+ elm.setAttributeNS(XLINK_NS, memberName, newValue);
675
+ }
676
+ else {
677
+ elm.setAttribute(memberName, newValue);
678
+ }
679
+ }
797
680
  }
798
681
  }
682
+ };
683
+ const parseClassListRegex = /\s/;
684
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
685
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
686
+ // if the element passed in is a shadow root, which is a document fragment
687
+ // then we want to be adding attrs/props to the shadow root's "host" element
688
+ // if it's not a shadow root, then we add attrs/props to the same element
689
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
690
+ ? newVnode.$elm$.host
691
+ : newVnode.$elm$;
692
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
693
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
799
694
  {
800
- promise = then(promise, () => safeCall(instance, 'componentWillRender'));
695
+ // remove attributes no longer present on the vnode by setting them to undefined
696
+ for (memberName in oldVnodeAttrs) {
697
+ if (!(memberName in newVnodeAttrs)) {
698
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
699
+ }
700
+ }
701
+ }
702
+ // add new & update changed attributes
703
+ for (memberName in newVnodeAttrs) {
704
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
801
705
  }
802
- endSchedule();
803
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
804
706
  };
805
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
806
- // updateComponent
807
- const elm = hostRef.$hostElement$;
808
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
809
- const rc = elm['s-rc'];
810
- if (isInitialLoad) {
811
- // DOM WRITE!
812
- attachStyles(hostRef);
707
+ /**
708
+ * Create a DOM Node corresponding to one of the children of a given VNode.
709
+ *
710
+ * @param oldParentVNode the parent VNode from the previous render
711
+ * @param newParentVNode the parent VNode from the current render
712
+ * @param childIndex the index of the VNode, in the _new_ parent node's
713
+ * children, for which we will create a new DOM node
714
+ * @param parentElm the parent DOM node which our new node will be a child of
715
+ * @returns the newly created node
716
+ */
717
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
718
+ // tslint:disable-next-line: prefer-const
719
+ const newVNode = newParentVNode.$children$[childIndex];
720
+ let i = 0;
721
+ let elm;
722
+ let childNode;
723
+ if (newVNode.$text$ !== null) {
724
+ // create text node
725
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
813
726
  }
814
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
815
- {
816
- callRender(hostRef, instance);
727
+ else {
728
+ if (!isSvgMode) {
729
+ isSvgMode = newVNode.$tag$ === 'svg';
730
+ }
731
+ // create element
732
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
733
+ );
734
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
735
+ isSvgMode = false;
736
+ }
737
+ // add css classes, attrs, props, listeners, etc.
738
+ {
739
+ updateElement(null, newVNode, isSvgMode);
740
+ }
741
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
742
+ // if there is a scopeId and this is the initial render
743
+ // then let's add the scopeId as a css class
744
+ elm.classList.add((elm['s-si'] = scopeId));
745
+ }
746
+ if (newVNode.$children$) {
747
+ for (i = 0; i < newVNode.$children$.length; ++i) {
748
+ // create the node
749
+ childNode = createElm(oldParentVNode, newVNode, i);
750
+ // return node could have been null
751
+ if (childNode) {
752
+ // append our new node
753
+ elm.appendChild(childNode);
754
+ }
755
+ }
756
+ }
757
+ {
758
+ if (newVNode.$tag$ === 'svg') {
759
+ // Only reset the SVG context when we're exiting <svg> element
760
+ isSvgMode = false;
761
+ }
762
+ else if (elm.tagName === 'foreignObject') {
763
+ // Reenter SVG context when we're exiting <foreignObject> element
764
+ isSvgMode = true;
765
+ }
766
+ }
817
767
  }
818
- if (rc) {
819
- // ok, so turns out there are some child host elements
820
- // waiting on this parent element to load
821
- // let's fire off all update callbacks waiting
822
- rc.map((cb) => cb());
823
- elm['s-rc'] = undefined;
768
+ return elm;
769
+ };
770
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
771
+ let containerElm = (parentElm);
772
+ let childNode;
773
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
774
+ containerElm = containerElm.shadowRoot;
824
775
  }
825
- endRender();
826
- endUpdate();
827
- {
828
- const childrenPromises = elm['s-p'];
829
- const postUpdate = () => postUpdateComponent(hostRef);
830
- if (childrenPromises.length === 0) {
831
- postUpdate();
776
+ for (; startIdx <= endIdx; ++startIdx) {
777
+ if (vnodes[startIdx]) {
778
+ childNode = createElm(null, parentVNode, startIdx);
779
+ if (childNode) {
780
+ vnodes[startIdx].$elm$ = childNode;
781
+ containerElm.insertBefore(childNode, before);
782
+ }
832
783
  }
833
- else {
834
- Promise.all(childrenPromises).then(postUpdate);
835
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
836
- childrenPromises.length = 0;
784
+ }
785
+ };
786
+ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
787
+ for (; startIdx <= endIdx; ++startIdx) {
788
+ if ((vnode = vnodes[startIdx])) {
789
+ elm = vnode.$elm$;
790
+ callNodeRefs(vnode);
791
+ // remove the vnode's element from the dom
792
+ elm.remove();
837
793
  }
838
794
  }
839
795
  };
840
- const callRender = (hostRef, instance, elm) => {
841
- try {
842
- instance = instance.render() ;
843
- {
844
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
796
+ /**
797
+ * Reconcile the children of a new VNode with the children of an old VNode by
798
+ * traversing the two collections of children, identifying nodes that are
799
+ * conserved or changed, calling out to `patch` to make any necessary
800
+ * updates to the DOM, and rearranging DOM nodes as needed.
801
+ *
802
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
803
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
804
+ * 'windows' by storing start and end indices and references to the
805
+ * corresponding array entries. Initially the two 'windows' are basically equal
806
+ * to the entire array, but we progressively narrow the windows until there are
807
+ * no children left to update by doing the following:
808
+ *
809
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
810
+ * that if we have an initial array like the following we'll end up dealing
811
+ * only with a window bounded by the highlighted elements:
812
+ *
813
+ * [null, null, VNode1 , ... , VNode2, null, null]
814
+ * ^^^^^^ ^^^^^^
815
+ *
816
+ * 2. Check to see if the elements at the head and tail positions are equal
817
+ * across the windows. This will basically detect elements which haven't
818
+ * been added, removed, or changed position, i.e. if you had the following
819
+ * VNode elements (represented as HTML):
820
+ *
821
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
822
+ * newVNode: `<div><p><span>THERE</span></p></div>`
823
+ *
824
+ * Then when comparing the children of the `<div>` tag we check the equality
825
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
826
+ * same tag in the same position, we'd be able to avoid completely
827
+ * re-rendering the subtree under them with a new DOM element and would just
828
+ * call out to `patch` to handle reconciling their children and so on.
829
+ *
830
+ * 3. Check, for both windows, to see if the element at the beginning of the
831
+ * window corresponds to the element at the end of the other window. This is
832
+ * a heuristic which will let us identify _some_ situations in which
833
+ * elements have changed position, for instance it _should_ detect that the
834
+ * children nodes themselves have not changed but merely moved in the
835
+ * following example:
836
+ *
837
+ * oldVNode: `<div><element-one /><element-two /></div>`
838
+ * newVNode: `<div><element-two /><element-one /></div>`
839
+ *
840
+ * If we find cases like this then we also need to move the concrete DOM
841
+ * elements corresponding to the moved children to write the re-order to the
842
+ * DOM.
843
+ *
844
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
845
+ * nodes in the old children which have the same key as the first element in
846
+ * our window on the new children. If we find such a node we handle calling
847
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
848
+ * what we find.
849
+ *
850
+ * Finally, once we've narrowed our 'windows' to the point that either of them
851
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
852
+ * insertion or deletion that needs to happen to get a DOM state that correctly
853
+ * reflects the new child VNodes. If, for instance, after our window on the old
854
+ * children has collapsed we still have more nodes on the new children that
855
+ * we haven't dealt with yet then we need to add them, or if the new children
856
+ * collapse but we still have unhandled _old_ children then we need to make
857
+ * sure the corresponding DOM nodes are removed.
858
+ *
859
+ * @param parentElm the node into which the parent VNode is rendered
860
+ * @param oldCh the old children of the parent node
861
+ * @param newVNode the new VNode which will replace the parent
862
+ * @param newCh the new children of the parent node
863
+ */
864
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
865
+ let oldStartIdx = 0;
866
+ let newStartIdx = 0;
867
+ let idxInOld = 0;
868
+ let i = 0;
869
+ let oldEndIdx = oldCh.length - 1;
870
+ let oldStartVnode = oldCh[0];
871
+ let oldEndVnode = oldCh[oldEndIdx];
872
+ let newEndIdx = newCh.length - 1;
873
+ let newStartVnode = newCh[0];
874
+ let newEndVnode = newCh[newEndIdx];
875
+ let node;
876
+ let elmToMove;
877
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
878
+ if (oldStartVnode == null) {
879
+ // VNode might have been moved left
880
+ oldStartVnode = oldCh[++oldStartIdx];
845
881
  }
846
- {
847
- hostRef.$flags$ |= 2 /* hasRendered */;
882
+ else if (oldEndVnode == null) {
883
+ oldEndVnode = oldCh[--oldEndIdx];
848
884
  }
849
- {
885
+ else if (newStartVnode == null) {
886
+ newStartVnode = newCh[++newStartIdx];
887
+ }
888
+ else if (newEndVnode == null) {
889
+ newEndVnode = newCh[--newEndIdx];
890
+ }
891
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
892
+ // if the start nodes are the same then we should patch the new VNode
893
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
894
+ // indices to reflect that. We don't need to move any DOM Nodes around
895
+ // since things are matched up in order.
896
+ patch(oldStartVnode, newStartVnode);
897
+ oldStartVnode = oldCh[++oldStartIdx];
898
+ newStartVnode = newCh[++newStartIdx];
899
+ }
900
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
901
+ // likewise, if the end nodes are the same we patch new onto old and
902
+ // decrement our end indices, and also likewise in this case we don't
903
+ // need to move any DOM Nodes.
904
+ patch(oldEndVnode, newEndVnode);
905
+ oldEndVnode = oldCh[--oldEndIdx];
906
+ newEndVnode = newCh[--newEndIdx];
907
+ }
908
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
909
+ patch(oldStartVnode, newEndVnode);
910
+ // We need to move the element for `oldStartVnode` into a position which
911
+ // will be appropriate for `newEndVnode`. For this we can use
912
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
913
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
914
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
915
+ //
916
+ // <old-start-node />
917
+ // <some-intervening-node />
918
+ // <old-end-node />
919
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
920
+ // <next-sibling />
921
+ //
922
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
923
+ // the node for `oldStartVnode` at the end of the children of
924
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
925
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
926
+ // append it to the children of the parent element.
927
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
928
+ oldStartVnode = oldCh[++oldStartIdx];
929
+ newEndVnode = newCh[--newEndIdx];
930
+ }
931
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
932
+ patch(oldEndVnode, newStartVnode);
933
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
934
+ // the same node, so since we're here we know that they are not. Thus we
935
+ // can move the element for `oldEndVnode` _before_ the element for
936
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
937
+ // future.
938
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
939
+ oldEndVnode = oldCh[--oldEndIdx];
940
+ newStartVnode = newCh[++newStartIdx];
941
+ }
942
+ else {
943
+ // Here we do some checks to match up old and new nodes based on the
944
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
945
+ // in the JSX for a DOM element in the implementation of a Stencil
946
+ // component.
947
+ //
948
+ // First we check to see if there are any nodes in the array of old
949
+ // children which have the same key as the first node in the new
950
+ // children.
951
+ idxInOld = -1;
850
952
  {
851
- // looks like we've got child nodes to render into this host element
852
- // or we need to update the css class/attrs on the host element
853
- // DOM WRITE!
953
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
954
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
955
+ idxInOld = i;
956
+ break;
957
+ }
958
+ }
959
+ }
960
+ if (idxInOld >= 0) {
961
+ // We found a node in the old children which matches up with the first
962
+ // node in the new children! So let's deal with that
963
+ elmToMove = oldCh[idxInOld];
964
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
965
+ // the tag doesn't match so we'll need a new DOM element
966
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
967
+ }
968
+ else {
969
+ patch(elmToMove, newStartVnode);
970
+ // invalidate the matching old node so that we won't try to update it
971
+ // again later on
972
+ oldCh[idxInOld] = undefined;
973
+ node = elmToMove.$elm$;
974
+ }
975
+ newStartVnode = newCh[++newStartIdx];
976
+ }
977
+ else {
978
+ // We either didn't find an element in the old children that matches
979
+ // the key of the first new child OR the build is not using `key`
980
+ // attributes at all. In either case we need to create a new element
981
+ // for the new node.
982
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
983
+ newStartVnode = newCh[++newStartIdx];
984
+ }
985
+ if (node) {
986
+ // if we created a new node then handle inserting it to the DOM
854
987
  {
855
- renderVdom(hostRef, instance);
988
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
856
989
  }
857
990
  }
858
991
  }
859
992
  }
860
- catch (e) {
861
- consoleError(e, hostRef.$hostElement$);
993
+ if (oldStartIdx > oldEndIdx) {
994
+ // we have some more new nodes to add which don't match up with old nodes
995
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
862
996
  }
863
- return null;
864
- };
865
- const postUpdateComponent = (hostRef) => {
866
- const tagName = hostRef.$cmpMeta$.$tagName$;
867
- const elm = hostRef.$hostElement$;
868
- const endPostUpdate = createTime('postUpdate', tagName);
869
- const instance = hostRef.$lazyInstance$ ;
870
- const ancestorComponent = hostRef.$ancestorComponent$;
871
- {
872
- safeCall(instance, 'componentDidRender');
997
+ else if (newStartIdx > newEndIdx) {
998
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
999
+ // in the new array, so lets remove them (which entails cleaning up the
1000
+ // relevant DOM nodes)
1001
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
873
1002
  }
874
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
875
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1003
+ };
1004
+ /**
1005
+ * Compare two VNodes to determine if they are the same
1006
+ *
1007
+ * **NB**: This function is an equality _heuristic_ based on the available
1008
+ * information set on the two VNodes and can be misleading under certain
1009
+ * circumstances. In particular, if the two nodes do not have `key` attrs
1010
+ * (available under `$key$` on VNodes) then the function falls back on merely
1011
+ * checking that they have the same tag.
1012
+ *
1013
+ * So, in other words, if `key` attrs are not set on VNodes which may be
1014
+ * changing order within a `children` array or something along those lines then
1015
+ * we could obtain a false positive and then have to do needless re-rendering.
1016
+ *
1017
+ * @param leftVNode the first VNode to check
1018
+ * @param rightVNode the second VNode to check
1019
+ * @returns whether they're equal or not
1020
+ */
1021
+ const isSameVnode = (leftVNode, rightVNode) => {
1022
+ // compare if two vnode to see if they're "technically" the same
1023
+ // need to have the same element tag, and same key to be the same
1024
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
1025
+ // this will be set if components in the build have `key` attrs set on them
876
1026
  {
877
- // DOM WRITE!
878
- addHydratedFlag(elm);
1027
+ return leftVNode.$key$ === rightVNode.$key$;
879
1028
  }
1029
+ }
1030
+ return false;
1031
+ };
1032
+ /**
1033
+ * Handle reconciling an outdated VNode with a new one which corresponds to
1034
+ * it. This function handles flushing updates to the DOM and reconciling the
1035
+ * children of the two nodes (if any).
1036
+ *
1037
+ * @param oldVNode an old VNode whose DOM element and children we want to update
1038
+ * @param newVNode a new VNode representing an updated version of the old one
1039
+ */
1040
+ const patch = (oldVNode, newVNode) => {
1041
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
1042
+ const oldChildren = oldVNode.$children$;
1043
+ const newChildren = newVNode.$children$;
1044
+ const tag = newVNode.$tag$;
1045
+ const text = newVNode.$text$;
1046
+ if (text === null) {
880
1047
  {
881
- safeCall(instance, 'componentDidLoad');
1048
+ // test if we're rendering an svg element, or still rendering nodes inside of one
1049
+ // only add this to the when the compiler sees we're using an svg somewhere
1050
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
882
1051
  }
883
- endPostUpdate();
884
1052
  {
885
- hostRef.$onReadyResolve$(elm);
886
- if (!ancestorComponent) {
887
- appDidLoad();
1053
+ if (tag === 'slot')
1054
+ ;
1055
+ else {
1056
+ // either this is the first render of an element OR it's an update
1057
+ // AND we already know it's possible it could have changed
1058
+ // this updates the element's css classes, attrs, props, listeners, etc.
1059
+ updateElement(oldVNode, newVNode, isSvgMode);
1060
+ }
1061
+ }
1062
+ if (oldChildren !== null && newChildren !== null) {
1063
+ // looks like there's child vnodes for both the old and new vnodes
1064
+ // so we need to call `updateChildren` to reconcile them
1065
+ updateChildren(elm, oldChildren, newVNode, newChildren);
1066
+ }
1067
+ else if (newChildren !== null) {
1068
+ // no old child vnodes, but there are new child vnodes to add
1069
+ if (oldVNode.$text$ !== null) {
1070
+ // the old vnode was text, so be sure to clear it out
1071
+ elm.textContent = '';
888
1072
  }
1073
+ // add the new vnode children
1074
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
889
1075
  }
890
- }
891
- else {
892
- endPostUpdate();
893
- }
894
- {
895
- hostRef.$onInstanceResolve$(elm);
896
- }
897
- // load events fire from bottom to top
898
- // the deepest elements load first then bubbles up
899
- {
900
- if (hostRef.$onRenderResolve$) {
901
- hostRef.$onRenderResolve$();
902
- hostRef.$onRenderResolve$ = undefined;
1076
+ else if (oldChildren !== null) {
1077
+ // no new child vnodes, but there are old child vnodes to remove
1078
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
903
1079
  }
904
- if (hostRef.$flags$ & 512 /* needsRerender */) {
905
- nextTick(() => scheduleUpdate(hostRef, false));
1080
+ if (isSvgMode && tag === 'svg') {
1081
+ isSvgMode = false;
906
1082
  }
907
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
908
1083
  }
909
- // ( •_•)
910
- // ( •_•)>⌐■-■
911
- // (⌐■_■)
1084
+ else if (oldVNode.$text$ !== text) {
1085
+ // update the text content for the text only vnode
1086
+ // and also only if the text is different than before
1087
+ elm.data = text;
1088
+ }
912
1089
  };
913
- const forceUpdate = (ref) => {
1090
+ const callNodeRefs = (vNode) => {
914
1091
  {
915
- const hostRef = getHostRef(ref);
916
- const isConnected = hostRef.$hostElement$.isConnected;
917
- if (isConnected &&
918
- (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
919
- scheduleUpdate(hostRef, false);
920
- }
921
- // Returns "true" when the forced update was successfully scheduled
922
- return isConnected;
1092
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1093
+ vNode.$children$ && vNode.$children$.map(callNodeRefs);
923
1094
  }
924
1095
  };
925
- const appDidLoad = (who) => {
926
- // on appload
927
- // we have finish the first big initial render
1096
+ const renderVdom = (hostRef, renderFnResults) => {
1097
+ const hostElm = hostRef.$hostElement$;
1098
+ const cmpMeta = hostRef.$cmpMeta$;
1099
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1100
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1101
+ hostTagName = hostElm.tagName;
1102
+ if (cmpMeta.$attrsToReflect$) {
1103
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1104
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1105
+ }
1106
+ rootVnode.$tag$ = null;
1107
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1108
+ hostRef.$vnode$ = rootVnode;
1109
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
928
1110
  {
929
- addHydratedFlag(doc.documentElement);
1111
+ scopeId = hostElm['s-sc'];
930
1112
  }
931
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1113
+ // synchronous patch
1114
+ patch(oldVNode, rootVnode);
932
1115
  };
933
- const safeCall = (instance, method, arg) => {
934
- if (instance && instance[method]) {
935
- try {
936
- return instance[method](arg);
937
- }
938
- catch (e) {
939
- consoleError(e);
940
- }
1116
+ const attachToAncestor = (hostRef, ancestorComponent) => {
1117
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1118
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
941
1119
  }
942
- return undefined;
943
- };
944
- const then = (promise, thenFn) => {
945
- return promise && promise.then ? promise.then(thenFn) : thenFn();
946
1120
  };
947
- const addHydratedFlag = (elm) => elm.setAttribute('calcite-hydrated', '')
948
- ;
949
- const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
950
- const endHydrate = createTime('hydrateClient', tagName);
951
- const shadowRoot = hostElm.shadowRoot;
952
- const childRenderNodes = [];
953
- const slotNodes = [];
954
- const shadowRootNodes = shadowRoot ? [] : null;
955
- const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
956
- if (!plt.$orgLocNodes$) {
957
- initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
1121
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
1122
+ {
1123
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
958
1124
  }
959
- hostElm[HYDRATE_ID] = hostId;
960
- hostElm.removeAttribute(HYDRATE_ID);
961
- clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
962
- childRenderNodes.map((c) => {
963
- const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
964
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
965
- const node = c.$elm$;
966
- if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
967
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
968
- }
969
- if (!shadowRoot) {
970
- node['s-hn'] = tagName;
971
- if (orgLocationNode) {
972
- node['s-ol'] = orgLocationNode;
973
- node['s-ol']['s-nr'] = node;
974
- }
975
- }
976
- plt.$orgLocNodes$.delete(orgLocationId);
977
- });
978
- if (shadowRoot) {
979
- shadowRootNodes.map((shadowRootNode) => {
980
- if (shadowRootNode) {
981
- shadowRoot.appendChild(shadowRootNode);
982
- }
983
- });
1125
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1126
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1127
+ return;
984
1128
  }
985
- endHydrate();
1129
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1130
+ // there is no ancestor component or the ancestor component
1131
+ // has already fired off its lifecycle update then
1132
+ // fire off the initial update
1133
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1134
+ return writeTask(dispatch) ;
986
1135
  };
987
- const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
988
- let childNodeType;
989
- let childIdSplt;
990
- let childVNode;
991
- let i;
992
- if (node.nodeType === 1 /* ElementNode */) {
993
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
994
- if (childNodeType) {
995
- // got the node data from the element's attribute
996
- // `${hostId}.${nodeId}.${depth}.${index}`
997
- childIdSplt = childNodeType.split('.');
998
- if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
999
- childVNode = {
1000
- $flags$: 0,
1001
- $hostId$: childIdSplt[0],
1002
- $nodeId$: childIdSplt[1],
1003
- $depth$: childIdSplt[2],
1004
- $index$: childIdSplt[3],
1005
- $tag$: node.tagName.toLowerCase(),
1006
- $elm$: node,
1007
- $attrs$: null,
1008
- $children$: null,
1009
- $key$: null,
1010
- $name$: null,
1011
- $text$: null,
1012
- };
1013
- childRenderNodes.push(childVNode);
1014
- node.removeAttribute(HYDRATE_CHILD_ID);
1015
- // this is a new child vnode
1016
- // so ensure its parent vnode has the vchildren array
1017
- if (!parentVNode.$children$) {
1018
- parentVNode.$children$ = [];
1019
- }
1020
- // add our child vnode to a specific index of the vnode's children
1021
- parentVNode.$children$[childVNode.$index$] = childVNode;
1022
- // this is now the new parent vnode for all the next child checks
1023
- parentVNode = childVNode;
1024
- if (shadowRootNodes && childVNode.$depth$ === '0') {
1025
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1026
- }
1027
- }
1028
- }
1029
- // recursively drill down, end to start so we can remove nodes
1030
- for (i = node.childNodes.length - 1; i >= 0; i--) {
1031
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
1032
- }
1033
- if (node.shadowRoot) {
1034
- // keep drilling down through the shadow root nodes
1035
- for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
1036
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
1037
- }
1038
- }
1039
- }
1040
- else if (node.nodeType === 8 /* CommentNode */) {
1041
- // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
1042
- childIdSplt = node.nodeValue.split('.');
1043
- if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
1044
- // comment node for either the host id or a 0 host id
1045
- childNodeType = childIdSplt[0];
1046
- childVNode = {
1047
- $flags$: 0,
1048
- $hostId$: childIdSplt[1],
1049
- $nodeId$: childIdSplt[2],
1050
- $depth$: childIdSplt[3],
1051
- $index$: childIdSplt[4],
1052
- $elm$: node,
1053
- $attrs$: null,
1054
- $children$: null,
1055
- $key$: null,
1056
- $name$: null,
1057
- $tag$: null,
1058
- $text$: null,
1059
- };
1060
- if (childNodeType === TEXT_NODE_ID) {
1061
- childVNode.$elm$ = node.nextSibling;
1062
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
1063
- childVNode.$text$ = childVNode.$elm$.textContent;
1064
- childRenderNodes.push(childVNode);
1065
- // remove the text comment since it's no longer needed
1066
- node.remove();
1067
- if (!parentVNode.$children$) {
1068
- parentVNode.$children$ = [];
1069
- }
1070
- parentVNode.$children$[childVNode.$index$] = childVNode;
1071
- if (shadowRootNodes && childVNode.$depth$ === '0') {
1072
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1073
- }
1074
- }
1075
- }
1076
- else if (childVNode.$hostId$ === hostId) {
1077
- // this comment node is specifcally for this host id
1078
- if (childNodeType === SLOT_NODE_ID) {
1079
- // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
1080
- childVNode.$tag$ = 'slot';
1081
- if (childIdSplt[5]) {
1082
- node['s-sn'] = childVNode.$name$ = childIdSplt[5];
1083
- }
1084
- else {
1085
- node['s-sn'] = '';
1086
- }
1087
- node['s-sr'] = true;
1088
- if (shadowRootNodes) {
1089
- // browser support shadowRoot and this is a shadow dom component
1090
- // create an actual slot element
1091
- childVNode.$elm$ = doc.createElement(childVNode.$tag$);
1092
- if (childVNode.$name$) {
1093
- // add the slot name attribute
1094
- childVNode.$elm$.setAttribute('name', childVNode.$name$);
1095
- }
1096
- // insert the new slot element before the slot comment
1097
- node.parentNode.insertBefore(childVNode.$elm$, node);
1098
- // remove the slot comment since it's not needed for shadow
1099
- node.remove();
1100
- if (childVNode.$depth$ === '0') {
1101
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1102
- }
1103
- }
1104
- slotNodes.push(childVNode);
1105
- if (!parentVNode.$children$) {
1106
- parentVNode.$children$ = [];
1107
- }
1108
- parentVNode.$children$[childVNode.$index$] = childVNode;
1109
- }
1110
- else if (childNodeType === CONTENT_REF_ID) {
1111
- // `${CONTENT_REF_ID}.${hostId}`;
1112
- if (shadowRootNodes) {
1113
- // remove the content ref comment since it's not needed for shadow
1114
- node.remove();
1115
- }
1136
+ const dispatchHooks = (hostRef, isInitialLoad) => {
1137
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1138
+ const instance = hostRef.$lazyInstance$ ;
1139
+ let promise;
1140
+ if (isInitialLoad) {
1141
+ {
1142
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1143
+ if (hostRef.$queuedListeners$) {
1144
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1145
+ hostRef.$queuedListeners$ = null;
1146
+ }
1147
+ }
1148
+ {
1149
+ promise = safeCall(instance, 'componentWillLoad');
1150
+ }
1151
+ }
1152
+ {
1153
+ promise = then(promise, () => safeCall(instance, 'componentWillRender'));
1154
+ }
1155
+ endSchedule();
1156
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
1157
+ };
1158
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1159
+ // updateComponent
1160
+ const elm = hostRef.$hostElement$;
1161
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1162
+ const rc = elm['s-rc'];
1163
+ if (isInitialLoad) {
1164
+ // DOM WRITE!
1165
+ attachStyles(hostRef);
1166
+ }
1167
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1168
+ {
1169
+ callRender(hostRef, instance);
1170
+ }
1171
+ if (rc) {
1172
+ // ok, so turns out there are some child host elements
1173
+ // waiting on this parent element to load
1174
+ // let's fire off all update callbacks waiting
1175
+ rc.map((cb) => cb());
1176
+ elm['s-rc'] = undefined;
1177
+ }
1178
+ endRender();
1179
+ endUpdate();
1180
+ {
1181
+ const childrenPromises = elm['s-p'];
1182
+ const postUpdate = () => postUpdateComponent(hostRef);
1183
+ if (childrenPromises.length === 0) {
1184
+ postUpdate();
1185
+ }
1186
+ else {
1187
+ Promise.all(childrenPromises).then(postUpdate);
1188
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1189
+ childrenPromises.length = 0;
1190
+ }
1191
+ }
1192
+ };
1193
+ const callRender = (hostRef, instance, elm) => {
1194
+ try {
1195
+ instance = instance.render() ;
1196
+ {
1197
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1198
+ }
1199
+ {
1200
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1201
+ }
1202
+ {
1203
+ {
1204
+ // looks like we've got child nodes to render into this host element
1205
+ // or we need to update the css class/attrs on the host element
1206
+ // DOM WRITE!
1207
+ {
1208
+ renderVdom(hostRef, instance);
1116
1209
  }
1117
1210
  }
1118
1211
  }
1119
1212
  }
1120
- else if (parentVNode && parentVNode.$tag$ === 'style') {
1121
- const vnode = newVNode(null, node.textContent);
1122
- vnode.$elm$ = node;
1123
- vnode.$index$ = '0';
1124
- parentVNode.$children$ = [vnode];
1213
+ catch (e) {
1214
+ consoleError(e, hostRef.$hostElement$);
1125
1215
  }
1216
+ return null;
1126
1217
  };
1127
- const initializeDocumentHydrate = (node, orgLocNodes) => {
1128
- if (node.nodeType === 1 /* ElementNode */) {
1129
- let i = 0;
1130
- for (; i < node.childNodes.length; i++) {
1131
- initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
1218
+ const postUpdateComponent = (hostRef) => {
1219
+ const tagName = hostRef.$cmpMeta$.$tagName$;
1220
+ const elm = hostRef.$hostElement$;
1221
+ const endPostUpdate = createTime('postUpdate', tagName);
1222
+ const instance = hostRef.$lazyInstance$ ;
1223
+ const ancestorComponent = hostRef.$ancestorComponent$;
1224
+ {
1225
+ safeCall(instance, 'componentDidRender');
1226
+ }
1227
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1228
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1229
+ {
1230
+ // DOM WRITE!
1231
+ addHydratedFlag(elm);
1132
1232
  }
1133
- if (node.shadowRoot) {
1134
- for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
1135
- initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
1233
+ {
1234
+ safeCall(instance, 'componentDidLoad');
1235
+ }
1236
+ endPostUpdate();
1237
+ {
1238
+ hostRef.$onReadyResolve$(elm);
1239
+ if (!ancestorComponent) {
1240
+ appDidLoad();
1136
1241
  }
1137
1242
  }
1138
1243
  }
1139
- else if (node.nodeType === 8 /* CommentNode */) {
1140
- const childIdSplt = node.nodeValue.split('.');
1141
- if (childIdSplt[0] === ORG_LOCATION_ID) {
1142
- orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
1143
- node.nodeValue = '';
1144
- // useful to know if the original location is
1145
- // the root light-dom of a shadow dom component
1146
- node['s-en'] = childIdSplt[3];
1244
+ else {
1245
+ endPostUpdate();
1246
+ }
1247
+ {
1248
+ hostRef.$onInstanceResolve$(elm);
1249
+ }
1250
+ // load events fire from bottom to top
1251
+ // the deepest elements load first then bubbles up
1252
+ {
1253
+ if (hostRef.$onRenderResolve$) {
1254
+ hostRef.$onRenderResolve$();
1255
+ hostRef.$onRenderResolve$ = undefined;
1147
1256
  }
1257
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1258
+ nextTick(() => scheduleUpdate(hostRef, false));
1259
+ }
1260
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1148
1261
  }
1262
+ // ( •_•)
1263
+ // ( •_•)>⌐■-■
1264
+ // (⌐■_■)
1149
1265
  };
1150
- /**
1151
- * Parse a new property value for a given property type.
1152
- *
1153
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
1154
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
1155
- * 1. `any`, the type given to `propValue` in the function signature
1156
- * 2. the type stored from `propType`.
1157
- *
1158
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
1159
- *
1160
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
1161
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
1162
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
1163
- * ```tsx
1164
- * <my-cmp prop-val={0}></my-cmp>
1165
- * ```
1166
- *
1167
- * HTML prop values on the other hand, will always a string
1168
- *
1169
- * @param propValue the new value to coerce to some type
1170
- * @param propType the type of the prop, expressed as a binary number
1171
- * @returns the parsed/coerced value
1172
- */
1173
- const parsePropertyValue = (propValue, propType) => {
1174
- // ensure this value is of the correct prop type
1175
- if (propValue != null && !isComplexType(propValue)) {
1176
- if (propType & 4 /* Boolean */) {
1177
- // per the HTML spec, any string value means it is a boolean true value
1178
- // but we'll cheat here and say that the string "false" is the boolean false
1179
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1266
+ const forceUpdate = (ref) => {
1267
+ {
1268
+ const hostRef = getHostRef(ref);
1269
+ const isConnected = hostRef.$hostElement$.isConnected;
1270
+ if (isConnected &&
1271
+ (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1272
+ scheduleUpdate(hostRef, false);
1180
1273
  }
1181
- if (propType & 2 /* Number */) {
1182
- // force it to be a number
1183
- return parseFloat(propValue);
1274
+ // Returns "true" when the forced update was successfully scheduled
1275
+ return isConnected;
1276
+ }
1277
+ };
1278
+ const appDidLoad = (who) => {
1279
+ // on appload
1280
+ // we have finish the first big initial render
1281
+ {
1282
+ addHydratedFlag(doc.documentElement);
1283
+ }
1284
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1285
+ };
1286
+ const safeCall = (instance, method, arg) => {
1287
+ if (instance && instance[method]) {
1288
+ try {
1289
+ return instance[method](arg);
1184
1290
  }
1185
- if (propType & 1 /* String */) {
1186
- // could have been passed as a number or boolean
1187
- // but we still want it as a string
1188
- return String(propValue);
1291
+ catch (e) {
1292
+ consoleError(e);
1189
1293
  }
1190
- // redundant return here for better minification
1191
- return propValue;
1192
1294
  }
1193
- // not sure exactly what type we want
1194
- // so no need to change to a different type
1195
- return propValue;
1295
+ return undefined;
1296
+ };
1297
+ const then = (promise, thenFn) => {
1298
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
1196
1299
  };
1300
+ const addHydratedFlag = (elm) => elm.setAttribute('calcite-hydrated', '')
1301
+ ;
1197
1302
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1198
1303
  const setValue = (ref, propName, newVal, cmpMeta) => {
1199
1304
  // check our new property value against our internal value
@@ -1206,13 +1311,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1206
1311
  // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1207
1312
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1208
1313
  const didValueChange = newVal !== oldVal && !areBothNaN;
1209
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1314
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1210
1315
  // gadzooks! the property's value has changed!!
1211
1316
  // set our new value!
1212
1317
  hostRef.$instanceValues$.set(propName, newVal);
1213
1318
  if (instance) {
1214
1319
  // get an array of method names of watch functions to call
1215
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1320
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1216
1321
  const watchMethods = cmpMeta.$watchers$[propName];
1217
1322
  if (watchMethods) {
1218
1323
  // this instance is watching for when this property changed
@@ -1227,7 +1332,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1227
1332
  });
1228
1333
  }
1229
1334
  }
1230
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1335
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1231
1336
  if (instance.componentShouldUpdate) {
1232
1337
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1233
1338
  return;
@@ -1242,6 +1347,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1242
1347
  }
1243
1348
  }
1244
1349
  };
1350
+ /**
1351
+ * Attach a series of runtime constructs to a compiled Stencil component
1352
+ * constructor, including getters and setters for the `@Prop` and `@State`
1353
+ * decorators, callbacks for when attributes change, and so on.
1354
+ *
1355
+ * @param Cstr the constructor for a component that we need to process
1356
+ * @param cmpMeta metadata collected previously about the component
1357
+ * @param flags a number used to store a series of bit flags
1358
+ * @returns a reference to the same constructor passed in (but now mutated)
1359
+ */
1245
1360
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1246
1361
  if (cmpMeta.$members$) {
1247
1362
  if (Cstr.watchers) {
@@ -1251,8 +1366,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1251
1366
  const members = Object.entries(cmpMeta.$members$);
1252
1367
  const prototype = Cstr.prototype;
1253
1368
  members.map(([memberName, [memberFlags]]) => {
1254
- if ((memberFlags & 31 /* Prop */ ||
1255
- ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1369
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1370
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1256
1371
  // proxyComponent - prop
1257
1372
  Object.defineProperty(prototype, memberName, {
1258
1373
  get() {
@@ -1267,8 +1382,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1267
1382
  enumerable: true,
1268
1383
  });
1269
1384
  }
1270
- else if (flags & 1 /* isElementConstructor */ &&
1271
- memberFlags & 64 /* Method */) {
1385
+ else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1386
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1272
1387
  // proxyComponent - method
1273
1388
  Object.defineProperty(prototype, memberName, {
1274
1389
  value(...args) {
@@ -1278,7 +1393,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1278
1393
  });
1279
1394
  }
1280
1395
  });
1281
- if ((flags & 1 /* isElementConstructor */)) {
1396
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1282
1397
  const attrNameToPropName = new Map();
1283
1398
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1284
1399
  plt.jmp(() => {
@@ -1334,11 +1449,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1334
1449
  // create an array of attributes to observe
1335
1450
  // and also create a map of html attribute name to js property name
1336
1451
  Cstr.observedAttributes = members
1337
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1452
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1338
1453
  .map(([propName, m]) => {
1339
1454
  const attrName = m[1] || propName;
1340
1455
  attrNameToPropName.set(attrName, propName);
1341
- if (m[0] & 512 /* ReflectAttr */) {
1456
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1342
1457
  cmpMeta.$attrsToReflect$.push([propName, attrName]);
1343
1458
  }
1344
1459
  return attrName;
@@ -1349,10 +1464,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1349
1464
  };
1350
1465
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1351
1466
  // initializeComponent
1352
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1467
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1353
1468
  {
1354
1469
  // we haven't initialized this element yet
1355
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1470
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1356
1471
  // lazy loaded components
1357
1472
  // request the component's implementation to be
1358
1473
  // wired up with the host element
@@ -1370,7 +1485,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1370
1485
  {
1371
1486
  cmpMeta.$watchers$ = Cstr.watchers;
1372
1487
  }
1373
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1488
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1374
1489
  Cstr.isProxied = true;
1375
1490
  }
1376
1491
  const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
@@ -1378,7 +1493,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1378
1493
  // but let's keep track of when we start and stop
1379
1494
  // so that the getters/setters don't incorrectly step on data
1380
1495
  {
1381
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1496
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1382
1497
  }
1383
1498
  // construct the lazy-loaded component implementation
1384
1499
  // passing the hostRef is very important during
@@ -1391,10 +1506,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1391
1506
  consoleError(e);
1392
1507
  }
1393
1508
  {
1394
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1509
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1395
1510
  }
1396
1511
  {
1397
- hostRef.$flags$ |= 128 /* isWatchReady */;
1512
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1398
1513
  }
1399
1514
  endNewInstance();
1400
1515
  fireConnectedCallback(hostRef.$lazyInstance$);
@@ -1405,7 +1520,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1405
1520
  const scopeId = getScopeId(cmpMeta);
1406
1521
  if (!styles.has(scopeId)) {
1407
1522
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1408
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1523
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1409
1524
  endRegisterStyles();
1410
1525
  }
1411
1526
  }
@@ -1432,18 +1547,18 @@ const fireConnectedCallback = (instance) => {
1432
1547
  }
1433
1548
  };
1434
1549
  const connectedCallback = (elm) => {
1435
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1550
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1436
1551
  const hostRef = getHostRef(elm);
1437
1552
  const cmpMeta = hostRef.$cmpMeta$;
1438
1553
  const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1439
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1554
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1440
1555
  // first time this component has connected
1441
- hostRef.$flags$ |= 1 /* hasConnected */;
1556
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1442
1557
  let hostId;
1443
1558
  {
1444
1559
  hostId = elm.getAttribute(HYDRATE_ID);
1445
1560
  if (hostId) {
1446
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1561
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1447
1562
  const scopeId = addStyle(elm.shadowRoot, cmpMeta);
1448
1563
  elm.classList.remove(scopeId + '-h', scopeId + '-s');
1449
1564
  }
@@ -1457,7 +1572,7 @@ const connectedCallback = (elm) => {
1457
1572
  while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1458
1573
  // climb up the ancestors looking for the first
1459
1574
  // component that hasn't finished its lifecycle update yet
1460
- if ((ancestorComponent.nodeType === 1 /* ElementNode */ &&
1575
+ if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1461
1576
  ancestorComponent.hasAttribute('s-id') &&
1462
1577
  ancestorComponent['s-p']) ||
1463
1578
  ancestorComponent['s-p']) {
@@ -1472,7 +1587,7 @@ const connectedCallback = (elm) => {
1472
1587
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1473
1588
  if (cmpMeta.$members$) {
1474
1589
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1475
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1590
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1476
1591
  const value = elm[memberName];
1477
1592
  delete elm[memberName];
1478
1593
  elm[memberName] = value;
@@ -1495,7 +1610,7 @@ const connectedCallback = (elm) => {
1495
1610
  }
1496
1611
  };
1497
1612
  const disconnectedCallback = (elm) => {
1498
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1613
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1499
1614
  const hostRef = getHostRef(elm);
1500
1615
  const instance = hostRef.$lazyInstance$ ;
1501
1616
  {
@@ -1527,7 +1642,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1527
1642
  {
1528
1643
  // If the app is already hydrated there is not point to disable the
1529
1644
  // async queue. This will improve the first input delay
1530
- plt.$flags$ |= 2 /* appLoaded */;
1645
+ plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
1531
1646
  }
1532
1647
  {
1533
1648
  for (; i < styles.length; i++) {
@@ -1562,7 +1677,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1562
1677
  super(self);
1563
1678
  self = this;
1564
1679
  registerHost(self, cmpMeta);
1565
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1680
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1566
1681
  // this component is using shadow dom
1567
1682
  // and this browser supports shadow dom
1568
1683
  // add the read-only property "shadowRoot" to the host element
@@ -1597,7 +1712,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1597
1712
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
1598
1713
  if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1599
1714
  cmpTags.push(tagName);
1600
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1715
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1601
1716
  }
1602
1717
  });
1603
1718
  });
@@ -1619,12 +1734,46 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1619
1734
  // Fallback appLoad event
1620
1735
  endBootstrap();
1621
1736
  };
1622
- const getAssetPath = (path) => {
1623
- const assetUrl = new URL(path, plt.$resourcesUrl$);
1624
- return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
1625
- };
1626
1737
  const Fragment = (_, children) => children;
1627
- const hostRefs = new WeakMap();
1738
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1739
+ if (listeners) {
1740
+ listeners.map(([flags, name, method]) => {
1741
+ const target = getHostListenerTarget(elm, flags) ;
1742
+ const handler = hostListenerProxy(hostRef, method);
1743
+ const opts = hostListenerOpts(flags);
1744
+ plt.ael(target, name, handler, opts);
1745
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1746
+ });
1747
+ }
1748
+ };
1749
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
1750
+ try {
1751
+ {
1752
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1753
+ // instance is ready, let's call it's member method for this event
1754
+ hostRef.$lazyInstance$[methodName](ev);
1755
+ }
1756
+ else {
1757
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1758
+ }
1759
+ }
1760
+ }
1761
+ catch (e) {
1762
+ consoleError(e);
1763
+ }
1764
+ };
1765
+ const getHostListenerTarget = (elm, flags) => {
1766
+ if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
1767
+ return doc;
1768
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
1769
+ return win;
1770
+ if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
1771
+ return doc.body;
1772
+ return elm;
1773
+ };
1774
+ // prettier-ignore
1775
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1776
+ const hostRefs = /*@__PURE__*/ new WeakMap();
1628
1777
  const getHostRef = (ref) => hostRefs.get(ref);
1629
1778
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1630
1779
  const registerHost = (elm, cmpMeta) => {
@@ -1669,14 +1818,36 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1669
1818
  return importedModule[exportName];
1670
1819
  }, consoleError);
1671
1820
  };
1672
- const styles = new Map();
1821
+ const styles = /*@__PURE__*/ new Map();
1822
+ const win = typeof window !== 'undefined' ? window : {};
1823
+ const doc = win.document || { head: {} };
1824
+ const plt = {
1825
+ $flags$: 0,
1826
+ $resourcesUrl$: '',
1827
+ jmp: (h) => h(),
1828
+ raf: (h) => requestAnimationFrame(h),
1829
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1830
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1831
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
1832
+ };
1833
+ const supportsShadow = true;
1834
+ const promiseResolve = (v) => Promise.resolve(v);
1835
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1836
+ try {
1837
+ new CSSStyleSheet();
1838
+ return typeof new CSSStyleSheet().replaceSync === 'function';
1839
+ }
1840
+ catch (e) { }
1841
+ return false;
1842
+ })()
1843
+ ;
1673
1844
  const queueDomReads = [];
1674
1845
  const queueDomWrites = [];
1675
1846
  const queueTask = (queue, write) => (cb) => {
1676
1847
  queue.push(cb);
1677
1848
  if (!queuePending) {
1678
1849
  queuePending = true;
1679
- if (write && plt.$flags$ & 4 /* queueSync */) {
1850
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1680
1851
  nextTick(flush);
1681
1852
  }
1682
1853
  else {