@scania/tegel 1.8.2 → 1.9.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/dist/cjs/index-fd96d7bb.js +1988 -0
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/tds-accordion-item.cjs.entry.js +1 -1
  4. package/dist/cjs/tds-accordion.cjs.entry.js +8 -3
  5. package/dist/cjs/tds-badge.cjs.entry.js +1 -1
  6. package/dist/cjs/tds-banner.cjs.entry.js +3 -3
  7. package/dist/cjs/tds-block.cjs.entry.js +2 -2
  8. package/dist/cjs/tds-body-cell.cjs.entry.js +3 -3
  9. package/dist/cjs/tds-breadcrumb.cjs.entry.js +2 -2
  10. package/dist/cjs/tds-breadcrumbs.cjs.entry.js +2 -2
  11. package/dist/cjs/tds-button.cjs.entry.js +3 -3
  12. package/dist/cjs/tds-card.cjs.entry.js +2 -2
  13. package/dist/cjs/tds-checkbox.cjs.entry.js +3 -3
  14. package/dist/cjs/tds-chip.cjs.entry.js +39 -36
  15. package/dist/cjs/tds-core-header-item_2.cjs.entry.js +4 -4
  16. package/dist/cjs/tds-datetime.cjs.entry.js +3 -3
  17. package/dist/cjs/tds-divider.cjs.entry.js +2 -2
  18. package/dist/cjs/tds-dropdown-option.cjs.entry.js +2 -2
  19. package/dist/cjs/tds-dropdown.cjs.entry.js +4 -4
  20. package/dist/cjs/tds-folder-tab.cjs.entry.js +3 -3
  21. package/dist/cjs/tds-folder-tabs.cjs.entry.js +3 -3
  22. package/dist/cjs/tds-footer-group.cjs.entry.js +4 -4
  23. package/dist/cjs/tds-footer-item.cjs.entry.js +2 -2
  24. package/dist/cjs/tds-footer.cjs.entry.js +2 -2
  25. package/dist/cjs/tds-header-brand-symbol.cjs.entry.js +2 -2
  26. package/dist/cjs/tds-header-cell.cjs.entry.js +2 -2
  27. package/dist/cjs/tds-header-dropdown-list-item.cjs.entry.js +3 -3
  28. package/dist/cjs/tds-header-dropdown-list-user.cjs.entry.js +2 -2
  29. package/dist/cjs/tds-header-dropdown-list.cjs.entry.js +2 -2
  30. package/dist/cjs/tds-header-dropdown.cjs.entry.js +4 -4
  31. package/dist/cjs/tds-header-hamburger.cjs.entry.js +2 -2
  32. package/dist/cjs/tds-header-launcher-button.cjs.entry.js +2 -2
  33. package/dist/cjs/tds-header-launcher-grid-item.cjs.entry.js +2 -2
  34. package/dist/cjs/tds-header-launcher-grid-title.cjs.entry.js +2 -2
  35. package/dist/cjs/tds-header-launcher-grid.cjs.entry.js +2 -2
  36. package/dist/cjs/tds-header-launcher-list-item.cjs.entry.js +2 -2
  37. package/dist/cjs/tds-header-launcher-list-title.cjs.entry.js +2 -2
  38. package/dist/cjs/tds-header-launcher-list.cjs.entry.js +2 -2
  39. package/dist/cjs/tds-header-launcher.cjs.entry.js +3 -3
  40. package/dist/cjs/tds-header-title.cjs.entry.js +2 -2
  41. package/dist/cjs/tds-header.cjs.entry.js +2 -2
  42. package/dist/cjs/tds-icon.cjs.entry.js +3 -3
  43. package/dist/cjs/tds-inline-tab.cjs.entry.js +3 -3
  44. package/dist/cjs/tds-inline-tabs.cjs.entry.js +3 -3
  45. package/dist/cjs/tds-link.cjs.entry.js +3 -3
  46. package/dist/cjs/tds-message.cjs.entry.js +3 -3
  47. package/dist/cjs/tds-modal.cjs.entry.js +6 -2
  48. package/dist/cjs/tds-navigation-tab.cjs.entry.js +3 -3
  49. package/dist/cjs/tds-navigation-tabs.cjs.entry.js +3 -3
  50. package/dist/cjs/tds-popover-canvas.cjs.entry.js +3 -3
  51. package/dist/cjs/tds-popover-core.cjs.entry.js +2 -2
  52. package/dist/cjs/tds-popover-menu-item.cjs.entry.js +3 -3
  53. package/dist/cjs/tds-popover-menu.cjs.entry.js +3 -3
  54. package/dist/cjs/tds-radio-button.cjs.entry.js +2 -2
  55. package/dist/cjs/tds-side-menu-close-button.cjs.entry.js +2 -2
  56. package/dist/cjs/tds-side-menu-collapse-button.cjs.entry.js +5 -5
  57. package/dist/cjs/tds-side-menu-dropdown-list-item.cjs.entry.js +3 -3
  58. package/dist/cjs/tds-side-menu-dropdown-list.cjs.entry.js +3 -3
  59. package/dist/cjs/tds-side-menu-dropdown.cjs.entry.js +5 -5
  60. package/dist/cjs/tds-side-menu-item.cjs.entry.js +3 -3
  61. package/dist/cjs/tds-side-menu-overlay.cjs.entry.js +2 -2
  62. package/dist/cjs/tds-side-menu-user-image_2.cjs.entry.js +3 -3
  63. package/dist/cjs/tds-side-menu-user.cjs.entry.js +2 -2
  64. package/dist/cjs/tds-side-menu.cjs.entry.js +2 -2
  65. package/dist/cjs/tds-slider.cjs.entry.js +8 -8
  66. package/dist/cjs/tds-spinner.cjs.entry.js +2 -2
  67. package/dist/cjs/tds-step.cjs.entry.js +3 -3
  68. package/dist/cjs/tds-stepper.cjs.entry.js +2 -4
  69. package/dist/cjs/tds-table-body-row-expandable.cjs.entry.js +33 -5
  70. package/dist/cjs/tds-table-body-row.cjs.entry.js +3 -3
  71. package/dist/cjs/tds-table-body.cjs.entry.js +2 -2
  72. package/dist/cjs/tds-table-footer.cjs.entry.js +2 -2
  73. package/dist/cjs/tds-table-header.cjs.entry.js +3 -3
  74. package/dist/cjs/tds-table-toolbar.cjs.entry.js +2 -2
  75. package/dist/cjs/tds-table.cjs.entry.js +1 -1
  76. package/dist/cjs/tds-text-field.cjs.entry.js +6 -6
  77. package/dist/cjs/tds-textarea.cjs.entry.js +4 -4
  78. package/dist/cjs/tds-toast.cjs.entry.js +4 -4
  79. package/dist/cjs/tds-toggle.cjs.entry.js +2 -2
  80. package/dist/cjs/tds-tooltip.cjs.entry.js +3 -3
  81. package/dist/cjs/tegel.cjs.js +10 -10
  82. package/dist/collection/collection-manifest.json +2 -2
  83. package/dist/collection/components/accordion/accordion.css +4 -0
  84. package/dist/collection/components/accordion/accordion.js +24 -1
  85. package/dist/collection/components/banner/banner.js +2 -2
  86. package/dist/collection/components/block/block.js +1 -1
  87. package/dist/collection/components/breadcrumbs/breadcrumb/breadcrumb.js +1 -1
  88. package/dist/collection/components/breadcrumbs/breadcrumbs.js +1 -1
  89. package/dist/collection/components/button/button.js +2 -2
  90. package/dist/collection/components/card/card.js +1 -1
  91. package/dist/collection/components/checkbox/checkbox.js +2 -2
  92. package/dist/collection/components/chip/chip.css +17 -0
  93. package/dist/collection/components/chip/chip.js +55 -34
  94. package/dist/collection/components/datetime/datetime.js +2 -2
  95. package/dist/collection/components/divider/divider.js +1 -1
  96. package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +1 -1
  97. package/dist/collection/components/dropdown/dropdown.js +3 -3
  98. package/dist/collection/components/footer/footer-group/footer-group.js +3 -3
  99. package/dist/collection/components/footer/footer-item/footer-item.js +1 -1
  100. package/dist/collection/components/footer/footer.js +1 -1
  101. package/dist/collection/components/header/core-header-item/core-header-item.js +1 -1
  102. package/dist/collection/components/header/header-brand-symbol/header-brand-symbol.js +1 -1
  103. package/dist/collection/components/header/header-dropdown/header-dropdown.js +3 -3
  104. package/dist/collection/components/header/header-dropdown-list/header-dropdown-list.js +1 -1
  105. package/dist/collection/components/header/header-dropdown-list-item/header-dropdown-list-item.js +2 -2
  106. package/dist/collection/components/header/header-dropdown-list-user/header-dropdown-list-user.js +1 -1
  107. package/dist/collection/components/header/header-hamburger/header-hamburger.js +1 -1
  108. package/dist/collection/components/header/header-item/header-item.js +2 -2
  109. package/dist/collection/components/header/header-launcher/header-launcher.js +2 -2
  110. package/dist/collection/components/header/header-launcher-button/header-launcher-button.js +1 -1
  111. package/dist/collection/components/header/header-launcher-grid/header-launcher-grid.js +1 -1
  112. package/dist/collection/components/header/header-launcher-grid-item/header-launcher-grid-item.js +1 -1
  113. package/dist/collection/components/header/header-launcher-grid-title/header-launcher-grid-title.js +1 -1
  114. package/dist/collection/components/header/header-launcher-list/header-launcher-list.js +1 -1
  115. package/dist/collection/components/header/header-launcher-list-item/header-launcher-list-item.js +1 -1
  116. package/dist/collection/components/header/header-launcher-list-title/header-launcher-list-title.js +1 -1
  117. package/dist/collection/components/header/header-title/header-title.js +1 -1
  118. package/dist/collection/components/header/header.js +1 -1
  119. package/dist/collection/components/icon/icon.js +1 -1
  120. package/dist/collection/components/icon/iconsArray.js +9 -1
  121. package/dist/collection/components/link/link.js +2 -2
  122. package/dist/collection/components/message/message.js +2 -2
  123. package/dist/collection/components/modal/modal.js +23 -1
  124. package/dist/collection/components/popover-canvas/popover-canvas.js +2 -2
  125. package/dist/collection/components/popover-core/popover-core.js +1 -1
  126. package/dist/collection/components/popover-menu/popover-menu-item/popover-menu-item.js +2 -2
  127. package/dist/collection/components/popover-menu/popover-menu.js +2 -2
  128. package/dist/collection/components/radio-button/radio-button.js +1 -1
  129. package/dist/collection/components/side-menu/side-menu-close-button/side-menu-close-button.js +1 -1
  130. package/dist/collection/components/side-menu/side-menu-collapse-button/side-menu-collapse-button.js +4 -4
  131. package/dist/collection/components/side-menu/side-menu-dropdown/side-menu-dropdown.css +1 -1
  132. package/dist/collection/components/side-menu/side-menu-dropdown/side-menu-dropdown.js +21 -4
  133. package/dist/collection/components/side-menu/side-menu-dropdown-list/side-menu-dropdown-list.js +2 -2
  134. package/dist/collection/components/side-menu/side-menu-dropdown-list-item/side-menu-dropdown-list-item.js +2 -2
  135. package/dist/collection/components/side-menu/side-menu-item/side-menu-item.js +2 -2
  136. package/dist/collection/components/side-menu/side-menu-overlay/side-menu-overlay.js +1 -1
  137. package/dist/collection/components/side-menu/side-menu-user/side-menu-user.js +1 -1
  138. package/dist/collection/components/side-menu/side-menu-user-image/side-menu-user-image.js +1 -1
  139. package/dist/collection/components/side-menu/side-menu-user-label/side-menu-user-label.js +1 -1
  140. package/dist/collection/components/side-menu/side-menu.css +1 -0
  141. package/dist/collection/components/side-menu/side-menu.js +3 -3
  142. package/dist/collection/components/slider/slider.js +7 -7
  143. package/dist/collection/components/spinner/spinner.js +1 -1
  144. package/dist/collection/components/stepper/step/step.css +9 -3
  145. package/dist/collection/components/stepper/step/step.js +1 -1
  146. package/dist/collection/components/stepper/stepper.js +2 -4
  147. package/dist/collection/components/table/table/table.js +1 -1
  148. package/dist/collection/components/table/table-body/table-body.js +1 -1
  149. package/dist/collection/components/table/table-body-cell/table-body-cell.js +2 -2
  150. package/dist/collection/components/table/table-body-row/table-body-row.js +2 -2
  151. package/dist/collection/components/table/table-body-row-expandable/table-body-row-expandable.js +122 -4
  152. package/dist/collection/components/table/table-footer/table-footer.js +1 -1
  153. package/dist/collection/components/table/table-header/table-header.js +2 -2
  154. package/dist/collection/components/table/table-header-cell/table-header-cell.js +1 -1
  155. package/dist/collection/components/table/table-toolbar/table-toolbar.js +1 -1
  156. package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +2 -2
  157. package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +2 -2
  158. package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.js +2 -2
  159. package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +2 -2
  160. package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.js +2 -2
  161. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +2 -2
  162. package/dist/collection/components/text-field/text-field.js +5 -5
  163. package/dist/collection/components/textarea/textarea.js +3 -3
  164. package/dist/collection/components/toast/toast.js +3 -3
  165. package/dist/collection/components/toggle/toggle.js +1 -1
  166. package/dist/collection/components/tooltip/tooltip.js +2 -2
  167. package/dist/components/index.js +1 -1
  168. package/dist/components/{inheritAriaAttributes.js → p-0bd4c19c.js} +1 -1
  169. package/dist/components/{side-menu-user-image.js → p-0ea19663.js} +3 -3
  170. package/dist/components/{popover-canvas.js → p-19c59509.js} +6 -6
  171. package/dist/components/{header-dropdown-list-item.js → p-2bb5f9be.js} +4 -4
  172. package/dist/components/{header-launcher-button.js → p-2c342ccf.js} +7 -7
  173. package/dist/components/{checkbox.js → p-2d20f437.js} +5 -5
  174. package/dist/components/p-604b1ae6.js +1474 -0
  175. package/dist/components/{side-menu-user-label.js → p-7972bf06.js} +3 -3
  176. package/dist/components/{getPreviousNestedChildOfSiblingsMatching.js → p-859e3ebf.js} +1 -1
  177. package/dist/components/{core-header-item.js → p-a79e3dad.js} +3 -3
  178. package/dist/components/{divider.js → p-b226e1ea.js} +3 -3
  179. package/dist/components/{popover-core.js → p-b615fa10.js} +4 -4
  180. package/dist/components/{side-menu-item.js → p-c393fec5.js} +5 -5
  181. package/dist/components/{header-item.js → p-d9d19636.js} +6 -6
  182. package/dist/components/{header-dropdown-list.js → p-e7f57d5e.js} +4 -4
  183. package/dist/components/p-f64a898a.js +65 -0
  184. package/dist/components/tds-accordion-item.js +3 -3
  185. package/dist/components/tds-accordion.js +11 -5
  186. package/dist/components/tds-badge.js +2 -2
  187. package/dist/components/tds-banner.js +7 -7
  188. package/dist/components/tds-block.js +3 -3
  189. package/dist/components/tds-body-cell.js +4 -4
  190. package/dist/components/tds-breadcrumb.js +3 -3
  191. package/dist/components/tds-breadcrumbs.js +3 -3
  192. package/dist/components/tds-button.js +5 -5
  193. package/dist/components/tds-card.js +6 -6
  194. package/dist/components/tds-checkbox.js +1 -1
  195. package/dist/components/tds-chip.js +44 -40
  196. package/dist/components/tds-core-header-item.js +1 -1
  197. package/dist/components/tds-datetime.js +5 -5
  198. package/dist/components/tds-divider.js +1 -1
  199. package/dist/components/tds-dropdown-option.js +5 -5
  200. package/dist/components/tds-dropdown.js +6 -6
  201. package/dist/components/tds-folder-tab.js +4 -4
  202. package/dist/components/tds-folder-tabs.js +5 -5
  203. package/dist/components/tds-footer-group.js +6 -6
  204. package/dist/components/tds-footer-item.js +3 -3
  205. package/dist/components/tds-footer.js +4 -4
  206. package/dist/components/tds-header-brand-symbol.js +5 -5
  207. package/dist/components/tds-header-cell.js +3 -3
  208. package/dist/components/tds-header-dropdown-list-item.js +1 -1
  209. package/dist/components/tds-header-dropdown-list-user.js +3 -3
  210. package/dist/components/tds-header-dropdown-list.js +1 -1
  211. package/dist/components/tds-header-dropdown.js +11 -11
  212. package/dist/components/tds-header-hamburger.js +7 -7
  213. package/dist/components/tds-header-item.js +1 -1
  214. package/dist/components/tds-header-launcher-button.js +1 -1
  215. package/dist/components/tds-header-launcher-grid-item.js +3 -3
  216. package/dist/components/tds-header-launcher-grid-title.js +4 -4
  217. package/dist/components/tds-header-launcher-grid.js +4 -4
  218. package/dist/components/tds-header-launcher-list-item.js +4 -4
  219. package/dist/components/tds-header-launcher-list-title.js +4 -4
  220. package/dist/components/tds-header-launcher-list.js +5 -5
  221. package/dist/components/tds-header-launcher.js +12 -12
  222. package/dist/components/tds-header-title.js +3 -3
  223. package/dist/components/tds-header.js +4 -4
  224. package/dist/components/tds-icon.js +1 -1
  225. package/dist/components/tds-inline-tab.js +4 -4
  226. package/dist/components/tds-inline-tabs.js +5 -5
  227. package/dist/components/tds-link.js +4 -4
  228. package/dist/components/tds-message.js +5 -5
  229. package/dist/components/tds-modal.js +10 -5
  230. package/dist/components/tds-navigation-tab.js +4 -4
  231. package/dist/components/tds-navigation-tabs.js +5 -5
  232. package/dist/components/tds-popover-canvas.js +1 -1
  233. package/dist/components/tds-popover-core.js +1 -1
  234. package/dist/components/tds-popover-menu-item.js +4 -4
  235. package/dist/components/tds-popover-menu.js +6 -6
  236. package/dist/components/tds-radio-button.js +4 -4
  237. package/dist/components/tds-side-menu-close-button.js +5 -5
  238. package/dist/components/tds-side-menu-collapse-button.js +7 -7
  239. package/dist/components/tds-side-menu-dropdown-list-item.js +4 -4
  240. package/dist/components/tds-side-menu-dropdown-list.js +4 -4
  241. package/dist/components/tds-side-menu-dropdown.js +9 -9
  242. package/dist/components/tds-side-menu-item.js +1 -1
  243. package/dist/components/tds-side-menu-overlay.js +3 -3
  244. package/dist/components/tds-side-menu-user-image.js +1 -1
  245. package/dist/components/tds-side-menu-user-label.js +1 -1
  246. package/dist/components/tds-side-menu-user.js +5 -5
  247. package/dist/components/tds-side-menu.js +3 -3
  248. package/dist/components/tds-slider.js +11 -11
  249. package/dist/components/tds-spinner.js +3 -3
  250. package/dist/components/tds-step.js +5 -5
  251. package/dist/components/tds-stepper.js +4 -6
  252. package/dist/components/tds-table-body-row-expandable.js +42 -8
  253. package/dist/components/tds-table-body-row.js +5 -5
  254. package/dist/components/tds-table-body.js +3 -3
  255. package/dist/components/tds-table-footer.js +4 -4
  256. package/dist/components/tds-table-header.js +5 -5
  257. package/dist/components/tds-table-toolbar.js +4 -4
  258. package/dist/components/tds-table.js +3 -3
  259. package/dist/components/tds-text-field.js +9 -9
  260. package/dist/components/tds-textarea.js +6 -6
  261. package/dist/components/tds-toast.js +8 -8
  262. package/dist/components/tds-toggle.js +4 -4
  263. package/dist/components/tds-tooltip.js +6 -6
  264. package/dist/esm/index-9aa00178.js +1958 -0
  265. package/dist/esm/loader.js +3 -3
  266. package/dist/esm/tds-accordion-item.entry.js +1 -1
  267. package/dist/esm/tds-accordion.entry.js +8 -3
  268. package/dist/esm/tds-badge.entry.js +1 -1
  269. package/dist/esm/tds-banner.entry.js +3 -3
  270. package/dist/esm/tds-block.entry.js +2 -2
  271. package/dist/esm/tds-body-cell.entry.js +3 -3
  272. package/dist/esm/tds-breadcrumb.entry.js +2 -2
  273. package/dist/esm/tds-breadcrumbs.entry.js +2 -2
  274. package/dist/esm/tds-button.entry.js +3 -3
  275. package/dist/esm/tds-card.entry.js +2 -2
  276. package/dist/esm/tds-checkbox.entry.js +3 -3
  277. package/dist/esm/tds-chip.entry.js +39 -36
  278. package/dist/esm/tds-core-header-item_2.entry.js +4 -4
  279. package/dist/esm/tds-datetime.entry.js +3 -3
  280. package/dist/esm/tds-divider.entry.js +2 -2
  281. package/dist/esm/tds-dropdown-option.entry.js +2 -2
  282. package/dist/esm/tds-dropdown.entry.js +4 -4
  283. package/dist/esm/tds-folder-tab.entry.js +3 -3
  284. package/dist/esm/tds-folder-tabs.entry.js +3 -3
  285. package/dist/esm/tds-footer-group.entry.js +4 -4
  286. package/dist/esm/tds-footer-item.entry.js +2 -2
  287. package/dist/esm/tds-footer.entry.js +2 -2
  288. package/dist/esm/tds-header-brand-symbol.entry.js +2 -2
  289. package/dist/esm/tds-header-cell.entry.js +2 -2
  290. package/dist/esm/tds-header-dropdown-list-item.entry.js +3 -3
  291. package/dist/esm/tds-header-dropdown-list-user.entry.js +2 -2
  292. package/dist/esm/tds-header-dropdown-list.entry.js +2 -2
  293. package/dist/esm/tds-header-dropdown.entry.js +4 -4
  294. package/dist/esm/tds-header-hamburger.entry.js +2 -2
  295. package/dist/esm/tds-header-launcher-button.entry.js +2 -2
  296. package/dist/esm/tds-header-launcher-grid-item.entry.js +2 -2
  297. package/dist/esm/tds-header-launcher-grid-title.entry.js +2 -2
  298. package/dist/esm/tds-header-launcher-grid.entry.js +2 -2
  299. package/dist/esm/tds-header-launcher-list-item.entry.js +2 -2
  300. package/dist/esm/tds-header-launcher-list-title.entry.js +2 -2
  301. package/dist/esm/tds-header-launcher-list.entry.js +2 -2
  302. package/dist/esm/tds-header-launcher.entry.js +3 -3
  303. package/dist/esm/tds-header-title.entry.js +2 -2
  304. package/dist/esm/tds-header.entry.js +2 -2
  305. package/dist/esm/tds-icon.entry.js +3 -3
  306. package/dist/esm/tds-inline-tab.entry.js +3 -3
  307. package/dist/esm/tds-inline-tabs.entry.js +3 -3
  308. package/dist/esm/tds-link.entry.js +3 -3
  309. package/dist/esm/tds-message.entry.js +3 -3
  310. package/dist/esm/tds-modal.entry.js +6 -2
  311. package/dist/esm/tds-navigation-tab.entry.js +3 -3
  312. package/dist/esm/tds-navigation-tabs.entry.js +3 -3
  313. package/dist/esm/tds-popover-canvas.entry.js +3 -3
  314. package/dist/esm/tds-popover-core.entry.js +2 -2
  315. package/dist/esm/tds-popover-menu-item.entry.js +3 -3
  316. package/dist/esm/tds-popover-menu.entry.js +3 -3
  317. package/dist/esm/tds-radio-button.entry.js +2 -2
  318. package/dist/esm/tds-side-menu-close-button.entry.js +2 -2
  319. package/dist/esm/tds-side-menu-collapse-button.entry.js +5 -5
  320. package/dist/esm/tds-side-menu-dropdown-list-item.entry.js +3 -3
  321. package/dist/esm/tds-side-menu-dropdown-list.entry.js +3 -3
  322. package/dist/esm/tds-side-menu-dropdown.entry.js +5 -5
  323. package/dist/esm/tds-side-menu-item.entry.js +3 -3
  324. package/dist/esm/tds-side-menu-overlay.entry.js +2 -2
  325. package/dist/esm/tds-side-menu-user-image_2.entry.js +3 -3
  326. package/dist/esm/tds-side-menu-user.entry.js +2 -2
  327. package/dist/esm/tds-side-menu.entry.js +2 -2
  328. package/dist/esm/tds-slider.entry.js +8 -8
  329. package/dist/esm/tds-spinner.entry.js +2 -2
  330. package/dist/esm/tds-step.entry.js +3 -3
  331. package/dist/esm/tds-stepper.entry.js +2 -4
  332. package/dist/esm/tds-table-body-row-expandable.entry.js +33 -5
  333. package/dist/esm/tds-table-body-row.entry.js +3 -3
  334. package/dist/esm/tds-table-body.entry.js +2 -2
  335. package/dist/esm/tds-table-footer.entry.js +2 -2
  336. package/dist/esm/tds-table-header.entry.js +3 -3
  337. package/dist/esm/tds-table-toolbar.entry.js +2 -2
  338. package/dist/esm/tds-table.entry.js +1 -1
  339. package/dist/esm/tds-text-field.entry.js +6 -6
  340. package/dist/esm/tds-textarea.entry.js +4 -4
  341. package/dist/esm/tds-toast.entry.js +4 -4
  342. package/dist/esm/tds-toggle.entry.js +2 -2
  343. package/dist/esm/tds-tooltip.entry.js +3 -3
  344. package/dist/esm/tegel.js +11 -11
  345. package/dist/tegel/p-0552fcf0.entry.js +1 -0
  346. package/dist/tegel/p-069d929a.entry.js +1 -0
  347. package/dist/tegel/{p-d362d26c.entry.js → p-08b7ab13.entry.js} +1 -1
  348. package/dist/tegel/p-0a3f16c3.entry.js +1 -0
  349. package/dist/tegel/p-0b2429b7.entry.js +1 -0
  350. package/dist/tegel/{p-f226f11e.entry.js → p-0c3dc988.entry.js} +1 -1
  351. package/dist/tegel/{p-52b9333c.entry.js → p-0e419ec2.entry.js} +1 -1
  352. package/dist/tegel/p-0ee8d8f8.entry.js +1 -0
  353. package/dist/tegel/{p-16f0471f.entry.js → p-10c67559.entry.js} +1 -1
  354. package/dist/tegel/p-120ddbc3.entry.js +1 -0
  355. package/dist/tegel/p-154b0295.entry.js +1 -0
  356. package/dist/tegel/p-1839e86c.entry.js +1 -0
  357. package/dist/tegel/p-1e5daa25.entry.js +1 -0
  358. package/dist/tegel/p-21df17f2.entry.js +1 -0
  359. package/dist/tegel/{p-dd082e5f.entry.js → p-2581e064.entry.js} +1 -1
  360. package/dist/tegel/{p-bc7459fb.entry.js → p-2bc51e55.entry.js} +1 -1
  361. package/dist/tegel/p-306ceae7.js +2 -0
  362. package/dist/tegel/{p-3e675690.entry.js → p-31e34f56.entry.js} +1 -1
  363. package/dist/tegel/p-39370666.entry.js +1 -0
  364. package/dist/tegel/p-39977bb1.entry.js +1 -0
  365. package/dist/tegel/p-47d4ea47.entry.js +1 -0
  366. package/dist/tegel/p-4b4cda77.entry.js +1 -0
  367. package/dist/tegel/{p-1e2ef3d6.entry.js → p-4dc24f53.entry.js} +1 -1
  368. package/dist/tegel/p-4dcd862a.entry.js +1 -0
  369. package/dist/tegel/{p-5d756b0b.entry.js → p-53593a00.entry.js} +1 -1
  370. package/dist/tegel/{p-18387cf5.entry.js → p-53d3bfdb.entry.js} +1 -1
  371. package/dist/tegel/p-54e139fa.entry.js +1 -0
  372. package/dist/tegel/p-5540ec23.entry.js +1 -0
  373. package/dist/tegel/p-5abd13c0.entry.js +1 -0
  374. package/dist/tegel/{p-2f5db352.entry.js → p-5c07ccd7.entry.js} +1 -1
  375. package/dist/tegel/p-5c1c3b4b.entry.js +1 -0
  376. package/dist/tegel/{p-3dd15e1e.entry.js → p-6128483a.entry.js} +1 -1
  377. package/dist/tegel/{p-3f983f99.entry.js → p-641b0db1.entry.js} +1 -1
  378. package/dist/tegel/{p-76a00407.entry.js → p-66d9fd55.entry.js} +1 -1
  379. package/dist/tegel/p-69748ddd.entry.js +1 -0
  380. package/dist/tegel/{p-9697550b.entry.js → p-6bd5c9f3.entry.js} +1 -1
  381. package/dist/tegel/{p-5a273781.entry.js → p-6d39b655.entry.js} +1 -1
  382. package/dist/tegel/p-6d7887d7.entry.js +1 -0
  383. package/dist/tegel/{p-e3e19bd6.entry.js → p-752a508f.entry.js} +1 -1
  384. package/dist/tegel/p-78f41f1e.entry.js +1 -0
  385. package/dist/tegel/{p-7172fd77.entry.js → p-7995afce.entry.js} +1 -1
  386. package/dist/tegel/{p-033fbea5.entry.js → p-7c33a930.entry.js} +1 -1
  387. package/dist/tegel/{p-ed8f1e2a.entry.js → p-7e3d4dfc.entry.js} +1 -1
  388. package/dist/tegel/p-8545dc7a.entry.js +1 -0
  389. package/dist/tegel/p-87387c4b.entry.js +1 -0
  390. package/dist/tegel/p-879e02ad.entry.js +1 -0
  391. package/dist/tegel/{p-5880c2f3.entry.js → p-8d4a30ac.entry.js} +1 -1
  392. package/dist/tegel/p-91df4ba5.entry.js +1 -0
  393. package/dist/tegel/{p-e38b51a2.entry.js → p-927fad9a.entry.js} +1 -1
  394. package/dist/tegel/{p-e10b2f73.entry.js → p-9d15b453.entry.js} +1 -1
  395. package/dist/tegel/{p-7e0116af.entry.js → p-9ee01e60.entry.js} +1 -1
  396. package/dist/tegel/p-a34c65df.entry.js +1 -0
  397. package/dist/tegel/p-a384f9a0.entry.js +1 -0
  398. package/dist/tegel/p-a557aec6.entry.js +1 -0
  399. package/dist/tegel/{p-8a90d1ae.entry.js → p-af1a436c.entry.js} +1 -1
  400. package/dist/tegel/p-afe00180.entry.js +1 -0
  401. package/dist/tegel/p-b2c68cbc.entry.js +1 -0
  402. package/dist/tegel/{p-747811d6.entry.js → p-b7e4fc1c.entry.js} +1 -1
  403. package/dist/tegel/p-b945b89c.entry.js +1 -0
  404. package/dist/tegel/p-b975e962.entry.js +1 -0
  405. package/dist/tegel/{p-b6f8c65f.entry.js → p-c17b8164.entry.js} +1 -1
  406. package/dist/tegel/p-c3d1ab6b.entry.js +1 -0
  407. package/dist/tegel/{p-0c444c09.entry.js → p-c64f7cfe.entry.js} +1 -1
  408. package/dist/tegel/p-c652dddb.entry.js +1 -0
  409. package/dist/tegel/p-cd19d0f3.entry.js +1 -0
  410. package/dist/tegel/p-d6cf180a.entry.js +1 -0
  411. package/dist/tegel/{p-8ebc7052.entry.js → p-da0fceab.entry.js} +1 -1
  412. package/dist/tegel/p-da7072c2.entry.js +1 -0
  413. package/dist/tegel/{p-e2443a41.entry.js → p-de071583.entry.js} +1 -1
  414. package/dist/tegel/{p-2f692ff0.entry.js → p-de085966.entry.js} +1 -1
  415. package/dist/tegel/p-de10bf9c.entry.js +1 -0
  416. package/dist/tegel/{p-e36e82c5.entry.js → p-de3bf6c0.entry.js} +1 -1
  417. package/dist/tegel/p-de59b8dd.entry.js +1 -0
  418. package/dist/tegel/p-e0dd13b6.entry.js +1 -0
  419. package/dist/tegel/{p-b03790b1.entry.js → p-e7e960f6.entry.js} +1 -1
  420. package/dist/tegel/{p-1fcf69c3.entry.js → p-f18d7a60.entry.js} +1 -1
  421. package/dist/tegel/p-f8029cbb.entry.js +1 -0
  422. package/dist/tegel/{p-a1151348.entry.js → p-fb8e02ff.entry.js} +1 -1
  423. package/dist/tegel/{p-7a3fbb5b.entry.js → p-fdd59c9c.entry.js} +1 -1
  424. package/dist/tegel/tegel.css +1 -1
  425. package/dist/tegel/tegel.esm.js +1 -1
  426. package/dist/types/components/accordion/accordion.d.ts +2 -0
  427. package/dist/types/components/chip/chip.d.ts +2 -0
  428. package/dist/types/components/modal/modal.d.ts +2 -0
  429. package/dist/types/components/side-menu/side-menu-dropdown/side-menu-dropdown.d.ts +1 -0
  430. package/dist/types/components/table/table-body-row-expandable/table-body-row-expandable.d.ts +16 -0
  431. package/dist/types/components.d.ts +67 -0
  432. package/dist/types/stencil-public-runtime.d.ts +1 -0
  433. package/dist/types/utils/appendHiddenInput.d.ts +2 -2
  434. package/loader/cdn.js +1 -3
  435. package/loader/index.cjs.js +1 -3
  436. package/loader/index.es2017.js +1 -3
  437. package/loader/index.js +1 -3
  438. package/package.json +332 -4
  439. package/dist/cjs/index-da55351d.js +0 -2863
  440. package/dist/components/icon.js +0 -65
  441. package/dist/esm/index-529974bd.js +0 -2833
  442. package/dist/esm/polyfills/core-js.js +0 -11
  443. package/dist/esm/polyfills/dom.js +0 -79
  444. package/dist/esm/polyfills/es5-html-element.js +0 -1
  445. package/dist/esm/polyfills/index.js +0 -34
  446. package/dist/esm/polyfills/system.js +0 -6
  447. package/dist/tegel/p-0215d53c.entry.js +0 -1
  448. package/dist/tegel/p-02417061.entry.js +0 -1
  449. package/dist/tegel/p-10610955.entry.js +0 -1
  450. package/dist/tegel/p-1ba2c5df.entry.js +0 -1
  451. package/dist/tegel/p-1f39c53a.entry.js +0 -1
  452. package/dist/tegel/p-21b555ec.entry.js +0 -1
  453. package/dist/tegel/p-2598dc8a.entry.js +0 -1
  454. package/dist/tegel/p-2c388774.entry.js +0 -1
  455. package/dist/tegel/p-3b546070.entry.js +0 -1
  456. package/dist/tegel/p-412d8fd1.entry.js +0 -1
  457. package/dist/tegel/p-453c8af8.entry.js +0 -1
  458. package/dist/tegel/p-4a04433c.entry.js +0 -1
  459. package/dist/tegel/p-56bae450.entry.js +0 -1
  460. package/dist/tegel/p-5b7d9ca4.entry.js +0 -1
  461. package/dist/tegel/p-5db63168.entry.js +0 -1
  462. package/dist/tegel/p-652eb0ff.entry.js +0 -1
  463. package/dist/tegel/p-699829fc.js +0 -2
  464. package/dist/tegel/p-74a93487.entry.js +0 -1
  465. package/dist/tegel/p-864e5bb0.entry.js +0 -1
  466. package/dist/tegel/p-87bfc032.entry.js +0 -1
  467. package/dist/tegel/p-8a46d308.entry.js +0 -1
  468. package/dist/tegel/p-8b13327b.entry.js +0 -1
  469. package/dist/tegel/p-8bb8d06a.entry.js +0 -1
  470. package/dist/tegel/p-8c6aad07.entry.js +0 -1
  471. package/dist/tegel/p-9806d3d3.entry.js +0 -1
  472. package/dist/tegel/p-a0812bb2.entry.js +0 -1
  473. package/dist/tegel/p-a31282be.entry.js +0 -1
  474. package/dist/tegel/p-acc70f3c.entry.js +0 -1
  475. package/dist/tegel/p-afa72e58.entry.js +0 -1
  476. package/dist/tegel/p-b263f884.entry.js +0 -1
  477. package/dist/tegel/p-c08c8bd8.entry.js +0 -1
  478. package/dist/tegel/p-c77d9eaf.entry.js +0 -1
  479. package/dist/tegel/p-d26257ca.entry.js +0 -1
  480. package/dist/tegel/p-d2e0442d.entry.js +0 -1
  481. package/dist/tegel/p-d41ef4f8.entry.js +0 -1
  482. package/dist/tegel/p-d9fec37c.entry.js +0 -1
  483. package/dist/tegel/p-ddabb9e9.entry.js +0 -1
  484. package/dist/tegel/p-e6a51915.entry.js +0 -1
  485. package/dist/tegel/p-e8957bd2.entry.js +0 -1
  486. package/dist/tegel/p-ed56507b.entry.js +0 -1
  487. package/dist/tegel/p-f8482e1e.entry.js +0 -1
  488. package/dist/tegel/p-f93bb760.entry.js +0 -1
  489. package/dist/tegel/p-fb2968f2.entry.js +0 -1
  490. /package/dist/components/{generateUniqueId.js → p-11648030.js} +0 -0
  491. /package/dist/components/{inheritAttributes.js → p-3fe9cbbf.js} +0 -0
  492. /package/dist/components/{dfs.js → p-52bf0fdf.js} +0 -0
  493. /package/dist/components/{hasSlot.js → p-ae110fc2.js} +0 -0
@@ -1,2863 +0,0 @@
1
- 'use strict';
2
-
3
- function _interopNamespace(e) {
4
- if (e && e.__esModule) return e;
5
- var n = Object.create(null);
6
- if (e) {
7
- Object.keys(e).forEach(function (k) {
8
- if (k !== 'default') {
9
- var d = Object.getOwnPropertyDescriptor(e, k);
10
- Object.defineProperty(n, k, d.get ? d : {
11
- enumerable: true,
12
- get: function () {
13
- return e[k];
14
- }
15
- });
16
- }
17
- });
18
- }
19
- n['default'] = e;
20
- return Object.freeze(n);
21
- }
22
-
23
- const NAMESPACE = 'tegel';
24
- const BUILD = /* tegel */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: true, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
25
-
26
- /**
27
- * Virtual DOM patching algorithm based on Snabbdom by
28
- * Simon Friis Vindum (@paldepind)
29
- * Licensed under the MIT License
30
- * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
31
- *
32
- * Modified for Stencil's renderer and slot projection
33
- */
34
- let scopeId;
35
- let contentRef;
36
- let hostTagName;
37
- let useNativeShadowDom = false;
38
- let checkSlotFallbackVisibility = false;
39
- let checkSlotRelocate = false;
40
- let isSvgMode = false;
41
- let queuePending = false;
42
- const createTime = (fnName, tagName = '') => {
43
- {
44
- return () => {
45
- return;
46
- };
47
- }
48
- };
49
- const uniqueTime = (key, measureText) => {
50
- {
51
- return () => {
52
- return;
53
- };
54
- }
55
- };
56
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
57
- /**
58
- * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
59
- *
60
- * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
61
- * support as of Stencil v4.
62
- */
63
- const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
64
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
65
- /**
66
- * Default style mode id
67
- */
68
- /**
69
- * Reusable empty obj/array
70
- * Don't add values to these!!
71
- */
72
- const EMPTY_OBJ = {};
73
- /**
74
- * Namespaces
75
- */
76
- const SVG_NS = 'http://www.w3.org/2000/svg';
77
- const HTML_NS = 'http://www.w3.org/1999/xhtml';
78
- const isDef = (v) => v != null;
79
- /**
80
- * Check whether a value is a 'complex type', defined here as an object or a
81
- * function.
82
- *
83
- * @param o the value to check
84
- * @returns whether it's a complex type or not
85
- */
86
- const isComplexType = (o) => {
87
- // https://jsperf.com/typeof-fn-object/5
88
- o = typeof o;
89
- return o === 'object' || o === 'function';
90
- };
91
- /**
92
- * Helper method for querying a `meta` tag that contains a nonce value
93
- * out of a DOM's head.
94
- *
95
- * @param doc The DOM containing the `head` to query against
96
- * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
97
- * exists or the tag has no content.
98
- */
99
- function queryNonceMetaTagContent(doc) {
100
- var _a, _b, _c;
101
- return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
102
- }
103
- /**
104
- * Production h() function based on Preact by
105
- * Jason Miller (@developit)
106
- * Licensed under the MIT License
107
- * https://github.com/developit/preact/blob/master/LICENSE
108
- *
109
- * Modified for Stencil's compiler and vdom
110
- */
111
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
112
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
113
- const h = (nodeName, vnodeData, ...children) => {
114
- let child = null;
115
- let key = null;
116
- let slotName = null;
117
- let simple = false;
118
- let lastSimple = false;
119
- const vNodeChildren = [];
120
- const walk = (c) => {
121
- for (let i = 0; i < c.length; i++) {
122
- child = c[i];
123
- if (Array.isArray(child)) {
124
- walk(child);
125
- }
126
- else if (child != null && typeof child !== 'boolean') {
127
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
128
- child = String(child);
129
- }
130
- if (simple && lastSimple) {
131
- // If the previous child was simple (string), we merge both
132
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
133
- }
134
- else {
135
- // Append a new vNode, if it's text, we create a text vNode
136
- vNodeChildren.push(simple ? newVNode(null, child) : child);
137
- }
138
- lastSimple = simple;
139
- }
140
- }
141
- };
142
- walk(children);
143
- if (vnodeData) {
144
- if (vnodeData.key) {
145
- key = vnodeData.key;
146
- }
147
- if (vnodeData.name) {
148
- slotName = vnodeData.name;
149
- }
150
- // normalize class / className attributes
151
- {
152
- const classData = vnodeData.className || vnodeData.class;
153
- if (classData) {
154
- vnodeData.class =
155
- typeof classData !== 'object'
156
- ? classData
157
- : Object.keys(classData)
158
- .filter((k) => classData[k])
159
- .join(' ');
160
- }
161
- }
162
- }
163
- if (typeof nodeName === 'function') {
164
- // nodeName is a functional component
165
- return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
166
- }
167
- const vnode = newVNode(nodeName, null);
168
- vnode.$attrs$ = vnodeData;
169
- if (vNodeChildren.length > 0) {
170
- vnode.$children$ = vNodeChildren;
171
- }
172
- {
173
- vnode.$key$ = key;
174
- }
175
- {
176
- vnode.$name$ = slotName;
177
- }
178
- return vnode;
179
- };
180
- /**
181
- * A utility function for creating a virtual DOM node from a tag and some
182
- * possible text content.
183
- *
184
- * @param tag the tag for this element
185
- * @param text possible text content for the node
186
- * @returns a newly-minted virtual DOM node
187
- */
188
- const newVNode = (tag, text) => {
189
- const vnode = {
190
- $flags$: 0,
191
- $tag$: tag,
192
- $text$: text,
193
- $elm$: null,
194
- $children$: null,
195
- };
196
- {
197
- vnode.$attrs$ = null;
198
- }
199
- {
200
- vnode.$key$ = null;
201
- }
202
- {
203
- vnode.$name$ = null;
204
- }
205
- return vnode;
206
- };
207
- const Host = {};
208
- /**
209
- * Check whether a given node is a Host node or not
210
- *
211
- * @param node the virtual DOM node to check
212
- * @returns whether it's a Host node or not
213
- */
214
- const isHost = (node) => node && node.$tag$ === Host;
215
- /**
216
- * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
217
- *
218
- * Note that these functions convert from {@link d.VNode} to
219
- * {@link d.ChildNode} to give functional component developers a friendly
220
- * interface.
221
- */
222
- const vdomFnUtils = {
223
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
224
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
225
- };
226
- /**
227
- * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
228
- * friendlier public interface (hence, 'convertToPublic').
229
- *
230
- * @param node the virtual DOM node to convert
231
- * @returns a converted child node
232
- */
233
- const convertToPublic = (node) => ({
234
- vattrs: node.$attrs$,
235
- vchildren: node.$children$,
236
- vkey: node.$key$,
237
- vname: node.$name$,
238
- vtag: node.$tag$,
239
- vtext: node.$text$,
240
- });
241
- /**
242
- * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
243
- * order to use the resulting object in the virtual DOM. The initial object was
244
- * likely created as part of presenting a public API, so converting it back
245
- * involved making it 'private' again (hence, `convertToPrivate`).
246
- *
247
- * @param node the child node to convert
248
- * @returns a converted virtual DOM node
249
- */
250
- const convertToPrivate = (node) => {
251
- if (typeof node.vtag === 'function') {
252
- const vnodeData = Object.assign({}, node.vattrs);
253
- if (node.vkey) {
254
- vnodeData.key = node.vkey;
255
- }
256
- if (node.vname) {
257
- vnodeData.name = node.vname;
258
- }
259
- return h(node.vtag, vnodeData, ...(node.vchildren || []));
260
- }
261
- const vnode = newVNode(node.vtag, node.vtext);
262
- vnode.$attrs$ = node.vattrs;
263
- vnode.$children$ = node.vchildren;
264
- vnode.$key$ = node.vkey;
265
- vnode.$name$ = node.vname;
266
- return vnode;
267
- };
268
- /**
269
- * Parse a new property value for a given property type.
270
- *
271
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
272
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
273
- * 1. `any`, the type given to `propValue` in the function signature
274
- * 2. the type stored from `propType`.
275
- *
276
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
277
- *
278
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
279
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
280
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
281
- * ```tsx
282
- * <my-cmp prop-val={0}></my-cmp>
283
- * ```
284
- *
285
- * HTML prop values on the other hand, will always a string
286
- *
287
- * @param propValue the new value to coerce to some type
288
- * @param propType the type of the prop, expressed as a binary number
289
- * @returns the parsed/coerced value
290
- */
291
- const parsePropertyValue = (propValue, propType) => {
292
- // ensure this value is of the correct prop type
293
- if (propValue != null && !isComplexType(propValue)) {
294
- if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
295
- // per the HTML spec, any string value means it is a boolean true value
296
- // but we'll cheat here and say that the string "false" is the boolean false
297
- return propValue === 'false' ? false : propValue === '' || !!propValue;
298
- }
299
- if (propType & 2 /* MEMBER_FLAGS.Number */) {
300
- // force it to be a number
301
- return parseFloat(propValue);
302
- }
303
- if (propType & 1 /* MEMBER_FLAGS.String */) {
304
- // could have been passed as a number or boolean
305
- // but we still want it as a string
306
- return String(propValue);
307
- }
308
- // redundant return here for better minification
309
- return propValue;
310
- }
311
- // not sure exactly what type we want
312
- // so no need to change to a different type
313
- return propValue;
314
- };
315
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
316
- const createEvent = (ref, name, flags) => {
317
- const elm = getElement(ref);
318
- return {
319
- emit: (detail) => {
320
- return emitEvent(elm, name, {
321
- bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
322
- composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
323
- cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
324
- detail,
325
- });
326
- },
327
- };
328
- };
329
- /**
330
- * Helper function to create & dispatch a custom Event on a provided target
331
- * @param elm the target of the Event
332
- * @param name the name to give the custom Event
333
- * @param opts options for configuring a custom Event
334
- * @returns the custom Event
335
- */
336
- const emitEvent = (elm, name, opts) => {
337
- const ev = plt.ce(name, opts);
338
- elm.dispatchEvent(ev);
339
- return ev;
340
- };
341
- const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
342
- const registerStyle = (scopeId, cssText, allowCS) => {
343
- let style = styles.get(scopeId);
344
- if (supportsConstructableStylesheets && allowCS) {
345
- style = (style || new CSSStyleSheet());
346
- if (typeof style === 'string') {
347
- style = cssText;
348
- }
349
- else {
350
- style.replaceSync(cssText);
351
- }
352
- }
353
- else {
354
- style = cssText;
355
- }
356
- styles.set(scopeId, style);
357
- };
358
- const addStyle = (styleContainerNode, cmpMeta, mode) => {
359
- var _a;
360
- const scopeId = getScopeId(cmpMeta);
361
- const style = styles.get(scopeId);
362
- // if an element is NOT connected then getRootNode() will return the wrong root node
363
- // so the fallback is to always use the document for the root node in those cases
364
- styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
365
- if (style) {
366
- if (typeof style === 'string') {
367
- styleContainerNode = styleContainerNode.head || styleContainerNode;
368
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
369
- let styleElm;
370
- if (!appliedStyles) {
371
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
372
- }
373
- if (!appliedStyles.has(scopeId)) {
374
- {
375
- styleElm = doc.createElement('style');
376
- styleElm.innerHTML = style;
377
- // Apply CSP nonce to the style tag if it exists
378
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
379
- if (nonce != null) {
380
- styleElm.setAttribute('nonce', nonce);
381
- }
382
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
383
- }
384
- // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
385
- if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
386
- styleElm.innerHTML += SLOT_FB_CSS;
387
- }
388
- if (appliedStyles) {
389
- appliedStyles.add(scopeId);
390
- }
391
- }
392
- }
393
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
394
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
395
- }
396
- }
397
- return scopeId;
398
- };
399
- const attachStyles = (hostRef) => {
400
- const cmpMeta = hostRef.$cmpMeta$;
401
- const elm = hostRef.$hostElement$;
402
- const flags = cmpMeta.$flags$;
403
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
404
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
405
- if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
406
- // only required when we're NOT using native shadow dom (slot)
407
- // or this browser doesn't support native shadow dom
408
- // and this host element was NOT created with SSR
409
- // let's pick out the inner content for slot projection
410
- // create a node to represent where the original
411
- // content was first placed, which is useful later on
412
- // DOM WRITE!!
413
- elm['s-sc'] = scopeId;
414
- elm.classList.add(scopeId + '-h');
415
- if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
416
- elm.classList.add(scopeId + '-s');
417
- }
418
- }
419
- endAttachStyles();
420
- };
421
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
422
- /**
423
- * Production setAccessor() function based on Preact by
424
- * Jason Miller (@developit)
425
- * Licensed under the MIT License
426
- * https://github.com/developit/preact/blob/master/LICENSE
427
- *
428
- * Modified for Stencil's compiler and vdom
429
- */
430
- /**
431
- * When running a VDom render set properties present on a VDom node onto the
432
- * corresponding HTML element.
433
- *
434
- * Note that this function has special functionality for the `class`,
435
- * `style`, `key`, and `ref` attributes, as well as event handlers (like
436
- * `onClick`, etc). All others are just passed through as-is.
437
- *
438
- * @param elm the HTMLElement onto which attributes should be set
439
- * @param memberName the name of the attribute to set
440
- * @param oldValue the old value for the attribute
441
- * @param newValue the new value for the attribute
442
- * @param isSvg whether we're in an svg context or not
443
- * @param flags bitflags for Vdom variables
444
- */
445
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
446
- if (oldValue !== newValue) {
447
- let isProp = isMemberInElement(elm, memberName);
448
- let ln = memberName.toLowerCase();
449
- if (memberName === 'class') {
450
- const classList = elm.classList;
451
- const oldClasses = parseClassList(oldValue);
452
- const newClasses = parseClassList(newValue);
453
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
454
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
455
- }
456
- else if (memberName === 'style') {
457
- // update style attribute, css properties and values
458
- {
459
- for (const prop in oldValue) {
460
- if (!newValue || newValue[prop] == null) {
461
- if (prop.includes('-')) {
462
- elm.style.removeProperty(prop);
463
- }
464
- else {
465
- elm.style[prop] = '';
466
- }
467
- }
468
- }
469
- }
470
- for (const prop in newValue) {
471
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
472
- if (prop.includes('-')) {
473
- elm.style.setProperty(prop, newValue[prop]);
474
- }
475
- else {
476
- elm.style[prop] = newValue[prop];
477
- }
478
- }
479
- }
480
- }
481
- else if (memberName === 'key')
482
- ;
483
- else if (memberName === 'ref') {
484
- // minifier will clean this up
485
- if (newValue) {
486
- newValue(elm);
487
- }
488
- }
489
- else if ((!isProp ) &&
490
- memberName[0] === 'o' &&
491
- memberName[1] === 'n') {
492
- // Event Handlers
493
- // so if the member name starts with "on" and the 3rd characters is
494
- // a capital letter, and it's not already a member on the element,
495
- // then we're assuming it's an event listener
496
- if (memberName[2] === '-') {
497
- // on- prefixed events
498
- // allows to be explicit about the dom event to listen without any magic
499
- // under the hood:
500
- // <my-cmp on-click> // listens for "click"
501
- // <my-cmp on-Click> // listens for "Click"
502
- // <my-cmp on-ionChange> // listens for "ionChange"
503
- // <my-cmp on-EVENTS> // listens for "EVENTS"
504
- memberName = memberName.slice(3);
505
- }
506
- else if (isMemberInElement(win, ln)) {
507
- // standard event
508
- // the JSX attribute could have been "onMouseOver" and the
509
- // member name "onmouseover" is on the window's prototype
510
- // so let's add the listener "mouseover", which is all lowercased
511
- memberName = ln.slice(2);
512
- }
513
- else {
514
- // custom event
515
- // the JSX attribute could have been "onMyCustomEvent"
516
- // so let's trim off the "on" prefix and lowercase the first character
517
- // and add the listener "myCustomEvent"
518
- // except for the first character, we keep the event name case
519
- memberName = ln[2] + memberName.slice(3);
520
- }
521
- if (oldValue || newValue) {
522
- // Need to account for "capture" events.
523
- // If the event name ends with "Capture", we'll update the name to remove
524
- // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
525
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
526
- // Make sure we only replace the last instance of "Capture"
527
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
528
- if (oldValue) {
529
- plt.rel(elm, memberName, oldValue, capture);
530
- }
531
- if (newValue) {
532
- plt.ael(elm, memberName, newValue, capture);
533
- }
534
- }
535
- }
536
- else {
537
- // Set property if it exists and it's not a SVG
538
- const isComplex = isComplexType(newValue);
539
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
540
- try {
541
- if (!elm.tagName.includes('-')) {
542
- const n = newValue == null ? '' : newValue;
543
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
544
- if (memberName === 'list') {
545
- isProp = false;
546
- }
547
- else if (oldValue == null || elm[memberName] != n) {
548
- elm[memberName] = n;
549
- }
550
- }
551
- else {
552
- elm[memberName] = newValue;
553
- }
554
- }
555
- catch (e) {
556
- /**
557
- * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
558
- */
559
- }
560
- }
561
- /**
562
- * Need to manually update attribute if:
563
- * - memberName is not an attribute
564
- * - if we are rendering the host element in order to reflect attribute
565
- * - if it's a SVG, since properties might not work in <svg>
566
- * - if the newValue is null/undefined or 'false'.
567
- */
568
- let xlink = false;
569
- {
570
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
571
- memberName = ln;
572
- xlink = true;
573
- }
574
- }
575
- if (newValue == null || newValue === false) {
576
- if (newValue !== false || elm.getAttribute(memberName) === '') {
577
- if (xlink) {
578
- elm.removeAttributeNS(XLINK_NS, memberName);
579
- }
580
- else {
581
- elm.removeAttribute(memberName);
582
- }
583
- }
584
- }
585
- else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
586
- newValue = newValue === true ? '' : newValue;
587
- if (xlink) {
588
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
589
- }
590
- else {
591
- elm.setAttribute(memberName, newValue);
592
- }
593
- }
594
- }
595
- }
596
- };
597
- const parseClassListRegex = /\s/;
598
- /**
599
- * Parsed a string of classnames into an array
600
- * @param value className string, e.g. "foo bar baz"
601
- * @returns list of classes, e.g. ["foo", "bar", "baz"]
602
- */
603
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
604
- const CAPTURE_EVENT_SUFFIX = 'Capture';
605
- const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
606
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
607
- // if the element passed in is a shadow root, which is a document fragment
608
- // then we want to be adding attrs/props to the shadow root's "host" element
609
- // if it's not a shadow root, then we add attrs/props to the same element
610
- const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
611
- ? newVnode.$elm$.host
612
- : newVnode.$elm$;
613
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
614
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
615
- {
616
- // remove attributes no longer present on the vnode by setting them to undefined
617
- for (memberName in oldVnodeAttrs) {
618
- if (!(memberName in newVnodeAttrs)) {
619
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
620
- }
621
- }
622
- }
623
- // add new & update changed attributes
624
- for (memberName in newVnodeAttrs) {
625
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
626
- }
627
- };
628
- /**
629
- * Create a DOM Node corresponding to one of the children of a given VNode.
630
- *
631
- * @param oldParentVNode the parent VNode from the previous render
632
- * @param newParentVNode the parent VNode from the current render
633
- * @param childIndex the index of the VNode, in the _new_ parent node's
634
- * children, for which we will create a new DOM node
635
- * @param parentElm the parent DOM node which our new node will be a child of
636
- * @returns the newly created node
637
- */
638
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
639
- // tslint:disable-next-line: prefer-const
640
- const newVNode = newParentVNode.$children$[childIndex];
641
- let i = 0;
642
- let elm;
643
- let childNode;
644
- let oldVNode;
645
- if (!useNativeShadowDom) {
646
- // remember for later we need to check to relocate nodes
647
- checkSlotRelocate = true;
648
- if (newVNode.$tag$ === 'slot') {
649
- if (scopeId) {
650
- // scoped css needs to add its scoped id to the parent element
651
- parentElm.classList.add(scopeId + '-s');
652
- }
653
- newVNode.$flags$ |= newVNode.$children$
654
- ? // slot element has fallback content
655
- 2 /* VNODE_FLAGS.isSlotFallback */
656
- : // slot element does not have fallback content
657
- 1 /* VNODE_FLAGS.isSlotReference */;
658
- }
659
- }
660
- if (newVNode.$text$ !== null) {
661
- // create text node
662
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
663
- }
664
- else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
665
- // create a slot reference node
666
- elm = newVNode.$elm$ =
667
- doc.createTextNode('');
668
- }
669
- else {
670
- if (!isSvgMode) {
671
- isSvgMode = newVNode.$tag$ === 'svg';
672
- }
673
- // create element
674
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
675
- ? 'slot-fb'
676
- : newVNode.$tag$)
677
- );
678
- if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
679
- isSvgMode = false;
680
- }
681
- // add css classes, attrs, props, listeners, etc.
682
- {
683
- updateElement(null, newVNode, isSvgMode);
684
- }
685
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
686
- // if there is a scopeId and this is the initial render
687
- // then let's add the scopeId as a css class
688
- elm.classList.add((elm['s-si'] = scopeId));
689
- }
690
- if (newVNode.$children$) {
691
- for (i = 0; i < newVNode.$children$.length; ++i) {
692
- // create the node
693
- childNode = createElm(oldParentVNode, newVNode, i, elm);
694
- // return node could have been null
695
- if (childNode) {
696
- // append our new node
697
- elm.appendChild(childNode);
698
- }
699
- }
700
- }
701
- {
702
- if (newVNode.$tag$ === 'svg') {
703
- // Only reset the SVG context when we're exiting <svg> element
704
- isSvgMode = false;
705
- }
706
- else if (elm.tagName === 'foreignObject') {
707
- // Reenter SVG context when we're exiting <foreignObject> element
708
- isSvgMode = true;
709
- }
710
- }
711
- }
712
- // This needs to always happen so we can hide nodes that are projected
713
- // to another component but don't end up in a slot
714
- elm['s-hn'] = hostTagName;
715
- {
716
- if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
717
- // remember the content reference comment
718
- elm['s-sr'] = true;
719
- // remember the content reference comment
720
- elm['s-cr'] = contentRef;
721
- // remember the slot name, or empty string for default slot
722
- elm['s-sn'] = newVNode.$name$ || '';
723
- // check if we've got an old vnode for this slot
724
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
725
- if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
726
- {
727
- // we've got an old slot vnode and the wrapper is being replaced
728
- // so let's move the old slot content back to its original location
729
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
730
- }
731
- }
732
- }
733
- }
734
- return elm;
735
- };
736
- const putBackInOriginalLocation = (parentElm, recursive) => {
737
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
738
- const oldSlotChildNodes = parentElm.childNodes;
739
- for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
740
- const childNode = oldSlotChildNodes[i];
741
- if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
742
- // and relocate it back to it's original location
743
- parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
744
- // remove the old original location comment entirely
745
- // later on the patch function will know what to do
746
- // and move this to the correct spot if need be
747
- childNode['s-ol'].remove();
748
- childNode['s-ol'] = undefined;
749
- // Reset so we can correctly move the node around again.
750
- childNode['s-sh'] = undefined;
751
- checkSlotRelocate = true;
752
- }
753
- if (recursive) {
754
- putBackInOriginalLocation(childNode, recursive);
755
- }
756
- }
757
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
758
- };
759
- /**
760
- * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
761
- * add them to the DOM in the appropriate place.
762
- *
763
- * @param parentElm the DOM node which should be used as a parent for the new
764
- * DOM nodes
765
- * @param before a child of the `parentElm` which the new children should be
766
- * inserted before (optional)
767
- * @param parentVNode the parent virtual DOM node
768
- * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
769
- * @param startIdx the index in the child virtual DOM nodes at which to start
770
- * creating DOM nodes (inclusive)
771
- * @param endIdx the index in the child virtual DOM nodes at which to stop
772
- * creating DOM nodes (inclusive)
773
- */
774
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
775
- let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
776
- let childNode;
777
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
778
- containerElm = containerElm.shadowRoot;
779
- }
780
- for (; startIdx <= endIdx; ++startIdx) {
781
- if (vnodes[startIdx]) {
782
- childNode = createElm(null, parentVNode, startIdx, parentElm);
783
- if (childNode) {
784
- vnodes[startIdx].$elm$ = childNode;
785
- containerElm.insertBefore(childNode, referenceNode(before) );
786
- }
787
- }
788
- }
789
- };
790
- /**
791
- * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
792
- * This can be used to, for instance, clean up after a list of children which
793
- * should no longer be shown.
794
- *
795
- * This function also handles some of Stencil's slot relocation logic.
796
- *
797
- * @param vnodes a list of virtual DOM nodes to remove
798
- * @param startIdx the index at which to start removing nodes (inclusive)
799
- * @param endIdx the index at which to stop removing nodes (inclusive)
800
- */
801
- const removeVnodes = (vnodes, startIdx, endIdx) => {
802
- for (let index = startIdx; index <= endIdx; ++index) {
803
- const vnode = vnodes[index];
804
- if (vnode) {
805
- const elm = vnode.$elm$;
806
- nullifyVNodeRefs(vnode);
807
- if (elm) {
808
- {
809
- // we're removing this element
810
- // so it's possible we need to show slot fallback content now
811
- checkSlotFallbackVisibility = true;
812
- if (elm['s-ol']) {
813
- // remove the original location comment
814
- elm['s-ol'].remove();
815
- }
816
- else {
817
- // it's possible that child nodes of the node
818
- // that's being removed are slot nodes
819
- putBackInOriginalLocation(elm, true);
820
- }
821
- }
822
- // remove the vnode's element from the dom
823
- elm.remove();
824
- }
825
- }
826
- }
827
- };
828
- /**
829
- * Reconcile the children of a new VNode with the children of an old VNode by
830
- * traversing the two collections of children, identifying nodes that are
831
- * conserved or changed, calling out to `patch` to make any necessary
832
- * updates to the DOM, and rearranging DOM nodes as needed.
833
- *
834
- * The algorithm for reconciling children works by analyzing two 'windows' onto
835
- * the two arrays of children (`oldCh` and `newCh`). We keep track of the
836
- * 'windows' by storing start and end indices and references to the
837
- * corresponding array entries. Initially the two 'windows' are basically equal
838
- * to the entire array, but we progressively narrow the windows until there are
839
- * no children left to update by doing the following:
840
- *
841
- * 1. Skip any `null` entries at the beginning or end of the two arrays, so
842
- * that if we have an initial array like the following we'll end up dealing
843
- * only with a window bounded by the highlighted elements:
844
- *
845
- * [null, null, VNode1 , ... , VNode2, null, null]
846
- * ^^^^^^ ^^^^^^
847
- *
848
- * 2. Check to see if the elements at the head and tail positions are equal
849
- * across the windows. This will basically detect elements which haven't
850
- * been added, removed, or changed position, i.e. if you had the following
851
- * VNode elements (represented as HTML):
852
- *
853
- * oldVNode: `<div><p><span>HEY</span></p></div>`
854
- * newVNode: `<div><p><span>THERE</span></p></div>`
855
- *
856
- * Then when comparing the children of the `<div>` tag we check the equality
857
- * of the VNodes corresponding to the `<p>` tags and, since they are the
858
- * same tag in the same position, we'd be able to avoid completely
859
- * re-rendering the subtree under them with a new DOM element and would just
860
- * call out to `patch` to handle reconciling their children and so on.
861
- *
862
- * 3. Check, for both windows, to see if the element at the beginning of the
863
- * window corresponds to the element at the end of the other window. This is
864
- * a heuristic which will let us identify _some_ situations in which
865
- * elements have changed position, for instance it _should_ detect that the
866
- * children nodes themselves have not changed but merely moved in the
867
- * following example:
868
- *
869
- * oldVNode: `<div><element-one /><element-two /></div>`
870
- * newVNode: `<div><element-two /><element-one /></div>`
871
- *
872
- * If we find cases like this then we also need to move the concrete DOM
873
- * elements corresponding to the moved children to write the re-order to the
874
- * DOM.
875
- *
876
- * 4. Finally, if VNodes have the `key` attribute set on them we check for any
877
- * nodes in the old children which have the same key as the first element in
878
- * our window on the new children. If we find such a node we handle calling
879
- * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
880
- * what we find.
881
- *
882
- * Finally, once we've narrowed our 'windows' to the point that either of them
883
- * collapse (i.e. they have length 0) we then handle any remaining VNode
884
- * insertion or deletion that needs to happen to get a DOM state that correctly
885
- * reflects the new child VNodes. If, for instance, after our window on the old
886
- * children has collapsed we still have more nodes on the new children that
887
- * we haven't dealt with yet then we need to add them, or if the new children
888
- * collapse but we still have unhandled _old_ children then we need to make
889
- * sure the corresponding DOM nodes are removed.
890
- *
891
- * @param parentElm the node into which the parent VNode is rendered
892
- * @param oldCh the old children of the parent node
893
- * @param newVNode the new VNode which will replace the parent
894
- * @param newCh the new children of the parent node
895
- * @param isInitialRender whether or not this is the first render of the vdom
896
- */
897
- const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
898
- let oldStartIdx = 0;
899
- let newStartIdx = 0;
900
- let idxInOld = 0;
901
- let i = 0;
902
- let oldEndIdx = oldCh.length - 1;
903
- let oldStartVnode = oldCh[0];
904
- let oldEndVnode = oldCh[oldEndIdx];
905
- let newEndIdx = newCh.length - 1;
906
- let newStartVnode = newCh[0];
907
- let newEndVnode = newCh[newEndIdx];
908
- let node;
909
- let elmToMove;
910
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
911
- if (oldStartVnode == null) {
912
- // VNode might have been moved left
913
- oldStartVnode = oldCh[++oldStartIdx];
914
- }
915
- else if (oldEndVnode == null) {
916
- oldEndVnode = oldCh[--oldEndIdx];
917
- }
918
- else if (newStartVnode == null) {
919
- newStartVnode = newCh[++newStartIdx];
920
- }
921
- else if (newEndVnode == null) {
922
- newEndVnode = newCh[--newEndIdx];
923
- }
924
- else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
925
- // if the start nodes are the same then we should patch the new VNode
926
- // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
927
- // indices to reflect that. We don't need to move any DOM Nodes around
928
- // since things are matched up in order.
929
- patch(oldStartVnode, newStartVnode, isInitialRender);
930
- oldStartVnode = oldCh[++oldStartIdx];
931
- newStartVnode = newCh[++newStartIdx];
932
- }
933
- else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
934
- // likewise, if the end nodes are the same we patch new onto old and
935
- // decrement our end indices, and also likewise in this case we don't
936
- // need to move any DOM Nodes.
937
- patch(oldEndVnode, newEndVnode, isInitialRender);
938
- oldEndVnode = oldCh[--oldEndIdx];
939
- newEndVnode = newCh[--newEndIdx];
940
- }
941
- else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
942
- // case: "Vnode moved right"
943
- //
944
- // We've found that the last node in our window on the new children is
945
- // the same VNode as the _first_ node in our window on the old children
946
- // we're dealing with now. Visually, this is the layout of these two
947
- // nodes:
948
- //
949
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
950
- // ^^^^^^^^^^^
951
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
952
- // ^^^^^^^^^^^^^
953
- //
954
- // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
955
- // and move the DOM element for `oldStartVnode`.
956
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
957
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
958
- }
959
- patch(oldStartVnode, newEndVnode, isInitialRender);
960
- // We need to move the element for `oldStartVnode` into a position which
961
- // will be appropriate for `newEndVnode`. For this we can use
962
- // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
963
- // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
964
- // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
965
- //
966
- // <old-start-node />
967
- // <some-intervening-node />
968
- // <old-end-node />
969
- // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
970
- // <next-sibling />
971
- //
972
- // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
973
- // the node for `oldStartVnode` at the end of the children of
974
- // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
975
- // aren't any siblings, and passing `null` to `Node.insertBefore` will
976
- // append it to the children of the parent element.
977
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
978
- oldStartVnode = oldCh[++oldStartIdx];
979
- newEndVnode = newCh[--newEndIdx];
980
- }
981
- else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
982
- // case: "Vnode moved left"
983
- //
984
- // We've found that the first node in our window on the new children is
985
- // the same VNode as the _last_ node in our window on the old children.
986
- // Visually, this is the layout of these two nodes:
987
- //
988
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
989
- // ^^^^^^^^^^^^^
990
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
991
- // ^^^^^^^^^^^
992
- //
993
- // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
994
- // (which will handle updating any changed attributes, reconciling their
995
- // children etc) but we also need to move the DOM node to which
996
- // `oldEndVnode` corresponds.
997
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
998
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
999
- }
1000
- patch(oldEndVnode, newStartVnode, isInitialRender);
1001
- // We've already checked above if `oldStartVnode` and `newStartVnode` are
1002
- // the same node, so since we're here we know that they are not. Thus we
1003
- // can move the element for `oldEndVnode` _before_ the element for
1004
- // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
1005
- // future.
1006
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
1007
- oldEndVnode = oldCh[--oldEndIdx];
1008
- newStartVnode = newCh[++newStartIdx];
1009
- }
1010
- else {
1011
- // Here we do some checks to match up old and new nodes based on the
1012
- // `$key$` attribute, which is set by putting a `key="my-key"` attribute
1013
- // in the JSX for a DOM element in the implementation of a Stencil
1014
- // component.
1015
- //
1016
- // First we check to see if there are any nodes in the array of old
1017
- // children which have the same key as the first node in the new
1018
- // children.
1019
- idxInOld = -1;
1020
- {
1021
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
1022
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
1023
- idxInOld = i;
1024
- break;
1025
- }
1026
- }
1027
- }
1028
- if (idxInOld >= 0) {
1029
- // We found a node in the old children which matches up with the first
1030
- // node in the new children! So let's deal with that
1031
- elmToMove = oldCh[idxInOld];
1032
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1033
- // the tag doesn't match so we'll need a new DOM element
1034
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
1035
- }
1036
- else {
1037
- patch(elmToMove, newStartVnode, isInitialRender);
1038
- // invalidate the matching old node so that we won't try to update it
1039
- // again later on
1040
- oldCh[idxInOld] = undefined;
1041
- node = elmToMove.$elm$;
1042
- }
1043
- newStartVnode = newCh[++newStartIdx];
1044
- }
1045
- else {
1046
- // We either didn't find an element in the old children that matches
1047
- // the key of the first new child OR the build is not using `key`
1048
- // attributes at all. In either case we need to create a new element
1049
- // for the new node.
1050
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
1051
- newStartVnode = newCh[++newStartIdx];
1052
- }
1053
- if (node) {
1054
- // if we created a new node then handle inserting it to the DOM
1055
- {
1056
- parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
1057
- }
1058
- }
1059
- }
1060
- }
1061
- if (oldStartIdx > oldEndIdx) {
1062
- // we have some more new nodes to add which don't match up with old nodes
1063
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1064
- }
1065
- else if (newStartIdx > newEndIdx) {
1066
- // there are nodes in the `oldCh` array which no longer correspond to nodes
1067
- // in the new array, so lets remove them (which entails cleaning up the
1068
- // relevant DOM nodes)
1069
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1070
- }
1071
- };
1072
- /**
1073
- * Compare two VNodes to determine if they are the same
1074
- *
1075
- * **NB**: This function is an equality _heuristic_ based on the available
1076
- * information set on the two VNodes and can be misleading under certain
1077
- * circumstances. In particular, if the two nodes do not have `key` attrs
1078
- * (available under `$key$` on VNodes) then the function falls back on merely
1079
- * checking that they have the same tag.
1080
- *
1081
- * So, in other words, if `key` attrs are not set on VNodes which may be
1082
- * changing order within a `children` array or something along those lines then
1083
- * we could obtain a false negative and then have to do needless re-rendering
1084
- * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1085
- *
1086
- * @param leftVNode the first VNode to check
1087
- * @param rightVNode the second VNode to check
1088
- * @param isInitialRender whether or not this is the first render of the vdom
1089
- * @returns whether they're equal or not
1090
- */
1091
- const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1092
- // compare if two vnode to see if they're "technically" the same
1093
- // need to have the same element tag, and same key to be the same
1094
- if (leftVNode.$tag$ === rightVNode.$tag$) {
1095
- if (leftVNode.$tag$ === 'slot') {
1096
- return leftVNode.$name$ === rightVNode.$name$;
1097
- }
1098
- // this will be set if JSX tags in the build have `key` attrs set on them
1099
- // we only want to check this if we're not on the first render since on
1100
- // first render `leftVNode.$key$` will always be `null`, so we can be led
1101
- // astray and, for instance, accidentally delete a DOM node that we want to
1102
- // keep around.
1103
- if (!isInitialRender) {
1104
- return leftVNode.$key$ === rightVNode.$key$;
1105
- }
1106
- return true;
1107
- }
1108
- return false;
1109
- };
1110
- const referenceNode = (node) => {
1111
- // this node was relocated to a new location in the dom
1112
- // because of some other component's slot
1113
- // but we still have an html comment in place of where
1114
- // it's original location was according to it's original vdom
1115
- return (node && node['s-ol']) || node;
1116
- };
1117
- const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1118
- /**
1119
- * Handle reconciling an outdated VNode with a new one which corresponds to
1120
- * it. This function handles flushing updates to the DOM and reconciling the
1121
- * children of the two nodes (if any).
1122
- *
1123
- * @param oldVNode an old VNode whose DOM element and children we want to update
1124
- * @param newVNode a new VNode representing an updated version of the old one
1125
- * @param isInitialRender whether or not this is the first render of the vdom
1126
- */
1127
- const patch = (oldVNode, newVNode, isInitialRender = false) => {
1128
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
1129
- const oldChildren = oldVNode.$children$;
1130
- const newChildren = newVNode.$children$;
1131
- const tag = newVNode.$tag$;
1132
- const text = newVNode.$text$;
1133
- let defaultHolder;
1134
- if (text === null) {
1135
- {
1136
- // test if we're rendering an svg element, or still rendering nodes inside of one
1137
- // only add this to the when the compiler sees we're using an svg somewhere
1138
- isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1139
- }
1140
- {
1141
- if (tag === 'slot' && !useNativeShadowDom) ;
1142
- else {
1143
- // either this is the first render of an element OR it's an update
1144
- // AND we already know it's possible it could have changed
1145
- // this updates the element's css classes, attrs, props, listeners, etc.
1146
- updateElement(oldVNode, newVNode, isSvgMode);
1147
- }
1148
- }
1149
- if (oldChildren !== null && newChildren !== null) {
1150
- // looks like there's child vnodes for both the old and new vnodes
1151
- // so we need to call `updateChildren` to reconcile them
1152
- updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
1153
- }
1154
- else if (newChildren !== null) {
1155
- // no old child vnodes, but there are new child vnodes to add
1156
- if (oldVNode.$text$ !== null) {
1157
- // the old vnode was text, so be sure to clear it out
1158
- elm.textContent = '';
1159
- }
1160
- // add the new vnode children
1161
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1162
- }
1163
- else if (oldChildren !== null) {
1164
- // no new child vnodes, but there are old child vnodes to remove
1165
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
1166
- }
1167
- if (isSvgMode && tag === 'svg') {
1168
- isSvgMode = false;
1169
- }
1170
- }
1171
- else if ((defaultHolder = elm['s-cr'])) {
1172
- // this element has slotted content
1173
- defaultHolder.parentNode.textContent = text;
1174
- }
1175
- else if (oldVNode.$text$ !== text) {
1176
- // update the text content for the text only vnode
1177
- // and also only if the text is different than before
1178
- elm.data = text;
1179
- }
1180
- };
1181
- /**
1182
- * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1183
- * are slot fallbacks nodes.
1184
- *
1185
- * A slot fallback node should be visible by default. Then, it should be
1186
- * conditionally hidden if:
1187
- *
1188
- * - it has a sibling with a `slot` property set to its slot name or if
1189
- * - it is a default fallback slot node, in which case we hide if it has any
1190
- * content
1191
- *
1192
- * @param elm the element of interest
1193
- */
1194
- const updateFallbackSlotVisibility = (elm) => {
1195
- const childNodes = elm.childNodes;
1196
- for (const childNode of childNodes) {
1197
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1198
- if (childNode['s-sr']) {
1199
- // this is a slot fallback node
1200
- // get the slot name for this slot reference node
1201
- const slotName = childNode['s-sn'];
1202
- // by default always show a fallback slot node
1203
- // then hide it if there are other slots in the light dom
1204
- childNode.hidden = false;
1205
- // we need to check all of its sibling nodes in order to see if
1206
- // `childNode` should be hidden
1207
- for (const siblingNode of childNodes) {
1208
- // Don't check the node against itself
1209
- if (siblingNode !== childNode) {
1210
- if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1211
- // this sibling node is from a different component OR is a named
1212
- // fallback slot node
1213
- if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1214
- (slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
1215
- childNode.hidden = true;
1216
- break;
1217
- }
1218
- }
1219
- else {
1220
- // this is a default fallback slot node
1221
- // any element or text node (with content)
1222
- // should hide the default fallback slot node
1223
- if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1224
- (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1225
- childNode.hidden = true;
1226
- break;
1227
- }
1228
- }
1229
- }
1230
- }
1231
- }
1232
- // keep drilling down
1233
- updateFallbackSlotVisibility(childNode);
1234
- }
1235
- }
1236
- };
1237
- /**
1238
- * Component-global information about nodes which are either currently being
1239
- * relocated or will be shortly.
1240
- */
1241
- const relocateNodes = [];
1242
- /**
1243
- * Mark the contents of a slot for relocation via adding references to them to
1244
- * the {@link relocateNodes} data structure. The actual work of relocating them
1245
- * will then be handled in {@link renderVdom}.
1246
- *
1247
- * @param elm a render node whose child nodes need to be relocated
1248
- */
1249
- const markSlotContentForRelocation = (elm) => {
1250
- // tslint:disable-next-line: prefer-const
1251
- let node;
1252
- let hostContentNodes;
1253
- let j;
1254
- for (const childNode of elm.childNodes) {
1255
- // we need to find child nodes which are slot references so we can then try
1256
- // to match them up with nodes that need to be relocated
1257
- if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1258
- // first get the content reference comment node ('s-cr'), then we get
1259
- // its parent, which is where all the host content is now
1260
- hostContentNodes = node.parentNode.childNodes;
1261
- const slotName = childNode['s-sn'];
1262
- // iterate through all the nodes under the location where the host was
1263
- // originally rendered
1264
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
1265
- node = hostContentNodes[j];
1266
- // check that the node is not a content reference node or a node
1267
- // reference and then check that the host name does not match that of
1268
- // childNode.
1269
- // In addition, check that the slot either has not already been relocated, or
1270
- // that its current location's host is not childNode's host. This is essentially
1271
- // a check so that we don't try to relocate (and then hide) a node that is already
1272
- // where it should be.
1273
- if (!node['s-cn'] &&
1274
- !node['s-nr'] &&
1275
- node['s-hn'] !== childNode['s-hn'] &&
1276
- (!BUILD.experimentalSlotFixes )) {
1277
- // if `node` is located in the slot that `childNode` refers to (via the
1278
- // `'s-sn'` property) then we need to relocate it from it's current spot
1279
- // (under the host element parent) to the right slot location
1280
- if (isNodeLocatedInSlot(node, slotName)) {
1281
- // it's possible we've already decided to relocate this node
1282
- let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1283
- // made some changes to slots
1284
- // let's make sure we also double check
1285
- // fallbacks are correctly hidden or shown
1286
- checkSlotFallbackVisibility = true;
1287
- // ensure that the slot-name attr is correct
1288
- node['s-sn'] = node['s-sn'] || slotName;
1289
- if (relocateNodeData) {
1290
- relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
1291
- // we marked this node for relocation previously but didn't find
1292
- // out the slot reference node to which it needs to be relocated
1293
- // so write it down now!
1294
- relocateNodeData.$slotRefNode$ = childNode;
1295
- }
1296
- else {
1297
- node['s-sh'] = childNode['s-hn'];
1298
- // add to our list of nodes to relocate
1299
- relocateNodes.push({
1300
- $slotRefNode$: childNode,
1301
- $nodeToRelocate$: node,
1302
- });
1303
- }
1304
- if (node['s-sr']) {
1305
- relocateNodes.map((relocateNode) => {
1306
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1307
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1308
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
1309
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1310
- }
1311
- }
1312
- });
1313
- }
1314
- }
1315
- else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1316
- // the node is not found within the slot (`childNode`) that we're
1317
- // currently looking at, so we stick it into `relocateNodes` to
1318
- // handle later. If we never find a home for this element then
1319
- // we'll need to hide it
1320
- relocateNodes.push({
1321
- $nodeToRelocate$: node,
1322
- });
1323
- }
1324
- }
1325
- }
1326
- }
1327
- // if we're dealing with any type of element (capable of itself being a
1328
- // slot reference or containing one) then we recur
1329
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1330
- markSlotContentForRelocation(childNode);
1331
- }
1332
- }
1333
- };
1334
- /**
1335
- * Check whether a node is located in a given named slot.
1336
- *
1337
- * @param nodeToRelocate the node of interest
1338
- * @param slotName the slot name to check
1339
- * @returns whether the node is located in the slot or not
1340
- */
1341
- const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1342
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1343
- if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1344
- // if the node doesn't have a slot attribute, and the slot we're checking
1345
- // is not a named slot, then we assume the node should be within the slot
1346
- return true;
1347
- }
1348
- if (nodeToRelocate.getAttribute('slot') === slotName) {
1349
- return true;
1350
- }
1351
- return false;
1352
- }
1353
- if (nodeToRelocate['s-sn'] === slotName) {
1354
- return true;
1355
- }
1356
- return slotName === '';
1357
- };
1358
- /**
1359
- * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1360
- * them with `null`. This signals that the DOM element corresponding to the VDom
1361
- * node has been removed from the DOM.
1362
- *
1363
- * @param vNode a virtual DOM node
1364
- */
1365
- const nullifyVNodeRefs = (vNode) => {
1366
- {
1367
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1368
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1369
- }
1370
- };
1371
- /**
1372
- * The main entry point for Stencil's virtual DOM-based rendering engine
1373
- *
1374
- * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1375
- * function will handle creating a virtual DOM tree with a single root, patching
1376
- * the current virtual DOM tree onto an old one (if any), dealing with slot
1377
- * relocation, and reflecting attributes.
1378
- *
1379
- * @param hostRef data needed to root and render the virtual DOM tree, such as
1380
- * the DOM node into which it should be rendered.
1381
- * @param renderFnResults the virtual DOM nodes to be rendered
1382
- * @param isInitialLoad whether or not this is the first call after page load
1383
- */
1384
- const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1385
- var _a, _b, _c, _d;
1386
- const hostElm = hostRef.$hostElement$;
1387
- const cmpMeta = hostRef.$cmpMeta$;
1388
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1389
- // if `renderFnResults` is a Host node then we can use it directly. If not,
1390
- // we need to call `h` again to wrap the children of our component in a
1391
- // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1392
- // implicitly that the top-level vdom node is 1) an only child and 2)
1393
- // contains attrs that need to be set on the host element.
1394
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1395
- hostTagName = hostElm.tagName;
1396
- if (cmpMeta.$attrsToReflect$) {
1397
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1398
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1399
- }
1400
- // On the first render and *only* on the first render we want to check for
1401
- // any attributes set on the host element which are also set on the vdom
1402
- // node. If we find them, we override the value on the VDom node attrs with
1403
- // the value from the host element, which allows developers building apps
1404
- // with Stencil components to override e.g. the `role` attribute on a
1405
- // component even if it's already set on the `Host`.
1406
- if (isInitialLoad && rootVnode.$attrs$) {
1407
- for (const key of Object.keys(rootVnode.$attrs$)) {
1408
- // We have a special implementation in `setAccessor` for `style` and
1409
- // `class` which reconciles values coming from the VDom with values
1410
- // already present on the DOM element, so we don't want to override those
1411
- // attributes on the VDom tree with values from the host element if they
1412
- // are present.
1413
- //
1414
- // Likewise, `ref` and `key` are special internal values for the Stencil
1415
- // runtime and we don't want to override those either.
1416
- if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1417
- rootVnode.$attrs$[key] = hostElm[key];
1418
- }
1419
- }
1420
- }
1421
- rootVnode.$tag$ = null;
1422
- rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1423
- hostRef.$vnode$ = rootVnode;
1424
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1425
- {
1426
- scopeId = hostElm['s-sc'];
1427
- }
1428
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1429
- {
1430
- contentRef = hostElm['s-cr'];
1431
- // always reset
1432
- checkSlotFallbackVisibility = false;
1433
- }
1434
- // synchronous patch
1435
- patch(oldVNode, rootVnode, isInitialLoad);
1436
- {
1437
- // while we're moving nodes around existing nodes, temporarily disable
1438
- // the disconnectCallback from working
1439
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1440
- if (checkSlotRelocate) {
1441
- markSlotContentForRelocation(rootVnode.$elm$);
1442
- for (const relocateData of relocateNodes) {
1443
- const nodeToRelocate = relocateData.$nodeToRelocate$;
1444
- if (!nodeToRelocate['s-ol']) {
1445
- // add a reference node marking this node's original location
1446
- // keep a reference to this node for later lookups
1447
- const orgLocationNode = doc.createTextNode('');
1448
- orgLocationNode['s-nr'] = nodeToRelocate;
1449
- nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1450
- }
1451
- }
1452
- for (const relocateData of relocateNodes) {
1453
- const nodeToRelocate = relocateData.$nodeToRelocate$;
1454
- const slotRefNode = relocateData.$slotRefNode$;
1455
- if (slotRefNode) {
1456
- const parentNodeRef = slotRefNode.parentNode;
1457
- // When determining where to insert content, the most simple case would be
1458
- // to relocate the node immediately following the slot reference node. We do this
1459
- // by getting a reference to the node immediately following the slot reference node
1460
- // since we will use `insertBefore` to manipulate the DOM.
1461
- //
1462
- // If there is no node immediately following the slot reference node, then we will just
1463
- // end up appending the node as the last child of the parent.
1464
- let insertBeforeNode = slotRefNode.nextSibling;
1465
- // If the node we're currently planning on inserting the new node before is an element,
1466
- // we need to do some additional checks to make sure we're inserting the node in the correct order.
1467
- // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1468
- // to make sure they get inserted into their new how in the same order they were declared in their original location.
1469
- //
1470
- // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1471
- {
1472
- let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1473
- while (orgLocationNode) {
1474
- let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
1475
- if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1476
- refNode = refNode.nextSibling;
1477
- if (!refNode || !refNode['s-nr']) {
1478
- insertBeforeNode = refNode;
1479
- break;
1480
- }
1481
- }
1482
- orgLocationNode = orgLocationNode.previousSibling;
1483
- }
1484
- }
1485
- if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1486
- nodeToRelocate.nextSibling !== insertBeforeNode) {
1487
- // we've checked that it's worth while to relocate
1488
- // since that the node to relocate
1489
- // has a different next sibling or parent relocated
1490
- if (nodeToRelocate !== insertBeforeNode) {
1491
- if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1492
- // probably a component in the index.html that doesn't have its hostname set
1493
- nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1494
- }
1495
- // Add it back to the dom but in its new home
1496
- // If we get to this point and `insertBeforeNode` is `null`, that means
1497
- // we're just going to append the node as the last child of the parent. Passing
1498
- // `null` as the second arg here will trigger that behavior.
1499
- parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1500
- // Reset the `hidden` value back to what it was defined as originally
1501
- // This solves a problem where a `slot` is dynamically rendered and `hidden` may have
1502
- // been set on content originally, but now it has a slot to go to so it should have
1503
- // the value it was defined as having in the DOM, not what we overrode it to.
1504
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1505
- nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
1506
- }
1507
- }
1508
- }
1509
- }
1510
- else {
1511
- // this node doesn't have a slot home to go to, so let's hide it
1512
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1513
- // Store the initial value of `hidden` so we can reset it later when
1514
- // moving nodes around.
1515
- if (isInitialLoad) {
1516
- nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
1517
- }
1518
- nodeToRelocate.hidden = true;
1519
- }
1520
- }
1521
- }
1522
- }
1523
- if (checkSlotFallbackVisibility) {
1524
- updateFallbackSlotVisibility(rootVnode.$elm$);
1525
- }
1526
- // done moving nodes around
1527
- // allow the disconnect callback to work again
1528
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1529
- // always reset
1530
- relocateNodes.length = 0;
1531
- }
1532
- // Clear the content ref so we don't create a memory leak
1533
- contentRef = undefined;
1534
- };
1535
- const attachToAncestor = (hostRef, ancestorComponent) => {
1536
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1537
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1538
- }
1539
- };
1540
- const scheduleUpdate = (hostRef, isInitialLoad) => {
1541
- {
1542
- hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1543
- }
1544
- if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1545
- hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1546
- return;
1547
- }
1548
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1549
- // there is no ancestor component or the ancestor component
1550
- // has already fired off its lifecycle update then
1551
- // fire off the initial update
1552
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1553
- return writeTask(dispatch) ;
1554
- };
1555
- /**
1556
- * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1557
- * component lifecycle methods like `componentWillLoad` as well as
1558
- * {@link updateComponent}, which will kick off the virtual DOM re-render.
1559
- *
1560
- * @param hostRef a reference to a host DOM node
1561
- * @param isInitialLoad whether we're on the initial load or not
1562
- * @returns an empty Promise which is used to enqueue a series of operations for
1563
- * the component
1564
- */
1565
- const dispatchHooks = (hostRef, isInitialLoad) => {
1566
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1567
- const instance = hostRef.$lazyInstance$ ;
1568
- // We're going to use this variable together with `enqueue` to implement a
1569
- // little promise-based queue. We start out with it `undefined`. When we add
1570
- // the first function to the queue we'll set this variable to be that
1571
- // function's return value. When we attempt to add subsequent values to the
1572
- // queue we'll check that value and, if it was a `Promise`, we'll then chain
1573
- // the new function off of that `Promise` using `.then()`. This will give our
1574
- // queue two nice properties:
1575
- //
1576
- // 1. If all functions added to the queue are synchronous they'll be called
1577
- // synchronously right away.
1578
- // 2. If all functions added to the queue are asynchronous they'll all be
1579
- // called in order after `dispatchHooks` exits.
1580
- let maybePromise;
1581
- if (isInitialLoad) {
1582
- {
1583
- hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1584
- if (hostRef.$queuedListeners$) {
1585
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1586
- hostRef.$queuedListeners$ = undefined;
1587
- }
1588
- }
1589
- {
1590
- // If `componentWillLoad` returns a `Promise` then we want to wait on
1591
- // whatever's going on in that `Promise` before we launch into
1592
- // rendering the component, doing other lifecycle stuff, etc. So
1593
- // in that case we assign the returned promise to the variable we
1594
- // declared above to hold a possible 'queueing' Promise
1595
- maybePromise = safeCall(instance, 'componentWillLoad');
1596
- }
1597
- }
1598
- {
1599
- maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1600
- }
1601
- endSchedule();
1602
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1603
- };
1604
- /**
1605
- * This function uses a Promise to implement a simple first-in, first-out queue
1606
- * of functions to be called.
1607
- *
1608
- * The queue is ordered on the basis of the first argument. If it's
1609
- * `undefined`, then nothing is on the queue yet, so the provided function can
1610
- * be called synchronously (although note that this function may return a
1611
- * `Promise`). The idea is that then the return value of that enqueueing
1612
- * operation is kept around, so that if it was a `Promise` then subsequent
1613
- * functions can be enqueued by calling this function again with that `Promise`
1614
- * as the first argument.
1615
- *
1616
- * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1617
- * @param fn a function to enqueue
1618
- * @returns either a `Promise` or the return value of the provided function
1619
- */
1620
- const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1621
- /**
1622
- * Check that a value is a `Promise`. To check, we first see if the value is an
1623
- * instance of the `Promise` global. In a few circumstances, in particular if
1624
- * the global has been overwritten, this is could be misleading, so we also do
1625
- * a little 'duck typing' check to see if the `.then` property of the value is
1626
- * defined and a function.
1627
- *
1628
- * @param maybePromise it might be a promise!
1629
- * @returns whether it is or not
1630
- */
1631
- const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1632
- (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1633
- /**
1634
- * Update a component given reference to its host elements and so on.
1635
- *
1636
- * @param hostRef an object containing references to the element's host node,
1637
- * VDom nodes, and other metadata
1638
- * @param instance a reference to the underlying host element where it will be
1639
- * rendered
1640
- * @param isInitialLoad whether or not this function is being called as part of
1641
- * the first render cycle
1642
- */
1643
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
1644
- var _a;
1645
- const elm = hostRef.$hostElement$;
1646
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1647
- const rc = elm['s-rc'];
1648
- if (isInitialLoad) {
1649
- // DOM WRITE!
1650
- attachStyles(hostRef);
1651
- }
1652
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1653
- {
1654
- callRender(hostRef, instance, elm, isInitialLoad);
1655
- }
1656
- if (rc) {
1657
- // ok, so turns out there are some child host elements
1658
- // waiting on this parent element to load
1659
- // let's fire off all update callbacks waiting
1660
- rc.map((cb) => cb());
1661
- elm['s-rc'] = undefined;
1662
- }
1663
- endRender();
1664
- endUpdate();
1665
- {
1666
- const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1667
- const postUpdate = () => postUpdateComponent(hostRef);
1668
- if (childrenPromises.length === 0) {
1669
- postUpdate();
1670
- }
1671
- else {
1672
- Promise.all(childrenPromises).then(postUpdate);
1673
- hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1674
- childrenPromises.length = 0;
1675
- }
1676
- }
1677
- };
1678
- /**
1679
- * Handle making the call to the VDom renderer with the proper context given
1680
- * various build variables
1681
- *
1682
- * @param hostRef an object containing references to the element's host node,
1683
- * VDom nodes, and other metadata
1684
- * @param instance a reference to the underlying host element where it will be
1685
- * rendered
1686
- * @param elm the Host element for the component
1687
- * @param isInitialLoad whether or not this function is being called as part of
1688
- * @returns an empty promise
1689
- */
1690
- const callRender = (hostRef, instance, elm, isInitialLoad) => {
1691
- try {
1692
- /**
1693
- * minification optimization: `allRenderFn` is `true` if all components have a `render`
1694
- * method, so we can call the method immediately. If not, check before calling it.
1695
- */
1696
- instance = instance.render() ;
1697
- {
1698
- hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1699
- }
1700
- {
1701
- hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1702
- }
1703
- {
1704
- {
1705
- // looks like we've got child nodes to render into this host element
1706
- // or we need to update the css class/attrs on the host element
1707
- // DOM WRITE!
1708
- {
1709
- renderVdom(hostRef, instance, isInitialLoad);
1710
- }
1711
- }
1712
- }
1713
- }
1714
- catch (e) {
1715
- consoleError(e, hostRef.$hostElement$);
1716
- }
1717
- return null;
1718
- };
1719
- const postUpdateComponent = (hostRef) => {
1720
- const tagName = hostRef.$cmpMeta$.$tagName$;
1721
- const elm = hostRef.$hostElement$;
1722
- const endPostUpdate = createTime('postUpdate', tagName);
1723
- const instance = hostRef.$lazyInstance$ ;
1724
- const ancestorComponent = hostRef.$ancestorComponent$;
1725
- {
1726
- safeCall(instance, 'componentDidRender');
1727
- }
1728
- if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1729
- hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1730
- {
1731
- // DOM WRITE!
1732
- addHydratedFlag(elm);
1733
- }
1734
- {
1735
- safeCall(instance, 'componentDidLoad');
1736
- }
1737
- endPostUpdate();
1738
- {
1739
- hostRef.$onReadyResolve$(elm);
1740
- if (!ancestorComponent) {
1741
- appDidLoad();
1742
- }
1743
- }
1744
- }
1745
- else {
1746
- {
1747
- safeCall(instance, 'componentDidUpdate');
1748
- }
1749
- endPostUpdate();
1750
- }
1751
- {
1752
- hostRef.$onInstanceResolve$(elm);
1753
- }
1754
- // load events fire from bottom to top
1755
- // the deepest elements load first then bubbles up
1756
- {
1757
- if (hostRef.$onRenderResolve$) {
1758
- hostRef.$onRenderResolve$();
1759
- hostRef.$onRenderResolve$ = undefined;
1760
- }
1761
- if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1762
- nextTick(() => scheduleUpdate(hostRef, false));
1763
- }
1764
- hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1765
- }
1766
- // ( •_•)
1767
- // ( •_•)>⌐■-■
1768
- // (⌐■_■)
1769
- };
1770
- const appDidLoad = (who) => {
1771
- // on appload
1772
- // we have finish the first big initial render
1773
- {
1774
- addHydratedFlag(doc.documentElement);
1775
- }
1776
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1777
- };
1778
- /**
1779
- * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1780
- * e.g. custom element node. If a build figures out that e.g. no component
1781
- * has a `componentDidLoad` method, the instance method gets removed from the
1782
- * output bundle and this function returns `undefined`.
1783
- * @param instance any object that may or may not contain methods
1784
- * @param method method name
1785
- * @param arg single arbitrary argument
1786
- * @returns result of method call if it exists, otherwise `undefined`
1787
- */
1788
- const safeCall = (instance, method, arg) => {
1789
- if (instance && instance[method]) {
1790
- try {
1791
- return instance[method](arg);
1792
- }
1793
- catch (e) {
1794
- consoleError(e);
1795
- }
1796
- }
1797
- return undefined;
1798
- };
1799
- const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1800
- ;
1801
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1802
- const setValue = (ref, propName, newVal, cmpMeta) => {
1803
- // check our new property value against our internal value
1804
- const hostRef = getHostRef(ref);
1805
- const elm = hostRef.$hostElement$ ;
1806
- const oldVal = hostRef.$instanceValues$.get(propName);
1807
- const flags = hostRef.$flags$;
1808
- const instance = hostRef.$lazyInstance$ ;
1809
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1810
- // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1811
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1812
- const didValueChange = newVal !== oldVal && !areBothNaN;
1813
- if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1814
- // gadzooks! the property's value has changed!!
1815
- // set our new value!
1816
- hostRef.$instanceValues$.set(propName, newVal);
1817
- if (instance) {
1818
- // get an array of method names of watch functions to call
1819
- if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1820
- const watchMethods = cmpMeta.$watchers$[propName];
1821
- if (watchMethods) {
1822
- // this instance is watching for when this property changed
1823
- watchMethods.map((watchMethodName) => {
1824
- try {
1825
- // fire off each of the watch methods that are watching this property
1826
- instance[watchMethodName](newVal, oldVal, propName);
1827
- }
1828
- catch (e) {
1829
- consoleError(e, elm);
1830
- }
1831
- });
1832
- }
1833
- }
1834
- if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1835
- // looks like this value actually changed, so we've got work to do!
1836
- // but only if we've already rendered, otherwise just chill out
1837
- // queue that we need to do an update, but don't worry about queuing
1838
- // up millions cuz this function ensures it only runs once
1839
- scheduleUpdate(hostRef, false);
1840
- }
1841
- }
1842
- }
1843
- };
1844
- /**
1845
- * Attach a series of runtime constructs to a compiled Stencil component
1846
- * constructor, including getters and setters for the `@Prop` and `@State`
1847
- * decorators, callbacks for when attributes change, and so on.
1848
- *
1849
- * @param Cstr the constructor for a component that we need to process
1850
- * @param cmpMeta metadata collected previously about the component
1851
- * @param flags a number used to store a series of bit flags
1852
- * @returns a reference to the same constructor passed in (but now mutated)
1853
- */
1854
- const proxyComponent = (Cstr, cmpMeta, flags) => {
1855
- var _a;
1856
- const prototype = Cstr.prototype;
1857
- if (cmpMeta.$members$) {
1858
- if (Cstr.watchers) {
1859
- cmpMeta.$watchers$ = Cstr.watchers;
1860
- }
1861
- // It's better to have a const than two Object.entries()
1862
- const members = Object.entries(cmpMeta.$members$);
1863
- members.map(([memberName, [memberFlags]]) => {
1864
- if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1865
- ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1866
- // proxyComponent - prop
1867
- Object.defineProperty(prototype, memberName, {
1868
- get() {
1869
- // proxyComponent, get value
1870
- return getValue(this, memberName);
1871
- },
1872
- set(newValue) {
1873
- // proxyComponent, set value
1874
- setValue(this, memberName, newValue, cmpMeta);
1875
- },
1876
- configurable: true,
1877
- enumerable: true,
1878
- });
1879
- }
1880
- else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1881
- memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1882
- // proxyComponent - method
1883
- Object.defineProperty(prototype, memberName, {
1884
- value(...args) {
1885
- var _a;
1886
- const ref = getHostRef(this);
1887
- return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
1888
- },
1889
- });
1890
- }
1891
- });
1892
- if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1893
- const attrNameToPropName = new Map();
1894
- prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1895
- plt.jmp(() => {
1896
- var _a;
1897
- const propName = attrNameToPropName.get(attrName);
1898
- // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1899
- // in the case where an attribute was set inline.
1900
- // ```html
1901
- // <my-component some-attribute="some-value"></my-component>
1902
- // ```
1903
- //
1904
- // There is an edge case where a developer sets the attribute inline on a custom element and then
1905
- // programmatically changes it before it has been upgraded as shown below:
1906
- //
1907
- // ```html
1908
- // <!-- this component has _not_ been upgraded yet -->
1909
- // <my-component id="test" some-attribute="some-value"></my-component>
1910
- // <script>
1911
- // // grab non-upgraded component
1912
- // el = document.querySelector("#test");
1913
- // el.someAttribute = "another-value";
1914
- // // upgrade component
1915
- // customElements.define('my-component', MyComponent);
1916
- // </script>
1917
- // ```
1918
- // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1919
- // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1920
- // to the value that was set inline i.e. "some-value" from above example. When
1921
- // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1922
- //
1923
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1924
- // by connectedCallback as this attributeChangedCallback will not fire.
1925
- //
1926
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1927
- //
1928
- // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1929
- // properties here given that this goes against best practices outlined here
1930
- // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1931
- if (this.hasOwnProperty(propName)) {
1932
- newValue = this[propName];
1933
- delete this[propName];
1934
- }
1935
- else if (prototype.hasOwnProperty(propName) &&
1936
- typeof this[propName] === 'number' &&
1937
- this[propName] == newValue) {
1938
- // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1939
- // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1940
- // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1941
- return;
1942
- }
1943
- else if (propName == null) {
1944
- // At this point we should know this is not a "member", so we can treat it like watching an attribute
1945
- // on a vanilla web component
1946
- const hostRef = getHostRef(this);
1947
- const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1948
- // We only want to trigger the callback(s) if:
1949
- // 1. The instance is ready
1950
- // 2. The watchers are ready
1951
- // 3. The value has changed
1952
- if (flags &&
1953
- !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1954
- flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1955
- newValue !== oldValue) {
1956
- const instance = hostRef.$lazyInstance$ ;
1957
- const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1958
- entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1959
- if (instance[callbackName] != null) {
1960
- instance[callbackName].call(instance, newValue, oldValue, attrName);
1961
- }
1962
- });
1963
- }
1964
- return;
1965
- }
1966
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1967
- });
1968
- };
1969
- // Create an array of attributes to observe
1970
- // This list in comprised of all strings used within a `@Watch()` decorator
1971
- // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1972
- // As such, there is no way to guarantee type-safety here that a user hasn't entered
1973
- // an invalid attribute.
1974
- Cstr.observedAttributes = Array.from(new Set([
1975
- ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1976
- ...members
1977
- .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1978
- .map(([propName, m]) => {
1979
- var _a;
1980
- const attrName = m[1] || propName;
1981
- attrNameToPropName.set(attrName, propName);
1982
- if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1983
- (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
1984
- }
1985
- return attrName;
1986
- }),
1987
- ]));
1988
- }
1989
- }
1990
- return Cstr;
1991
- };
1992
- /**
1993
- * Initialize a Stencil component given a reference to its host element, its
1994
- * runtime bookkeeping data structure, runtime metadata about the component,
1995
- * and (optionally) an HMR version ID.
1996
- *
1997
- * @param elm a host element
1998
- * @param hostRef the element's runtime bookkeeping object
1999
- * @param cmpMeta runtime metadata for the Stencil component
2000
- * @param hmrVersionId an (optional) HMR version ID
2001
- */
2002
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2003
- let Cstr;
2004
- // initializeComponent
2005
- if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
2006
- // Let the runtime know that the component has been initialized
2007
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
2008
- const bundleId = cmpMeta.$lazyBundleId$;
2009
- if (bundleId) {
2010
- // lazy loaded components
2011
- // request the component's implementation to be
2012
- // wired up with the host element
2013
- Cstr = loadModule(cmpMeta);
2014
- if (Cstr.then) {
2015
- // Await creates a micro-task avoid if possible
2016
- const endLoad = uniqueTime();
2017
- Cstr = await Cstr;
2018
- endLoad();
2019
- }
2020
- if (!Cstr.isProxied) {
2021
- // we've never proxied this Constructor before
2022
- // let's add the getters/setters to its prototype before
2023
- // the first time we create an instance of the implementation
2024
- {
2025
- cmpMeta.$watchers$ = Cstr.watchers;
2026
- }
2027
- proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
2028
- Cstr.isProxied = true;
2029
- }
2030
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
2031
- // ok, time to construct the instance
2032
- // but let's keep track of when we start and stop
2033
- // so that the getters/setters don't incorrectly step on data
2034
- {
2035
- hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
2036
- }
2037
- // construct the lazy-loaded component implementation
2038
- // passing the hostRef is very important during
2039
- // construction in order to directly wire together the
2040
- // host element and the lazy-loaded instance
2041
- try {
2042
- new Cstr(hostRef);
2043
- }
2044
- catch (e) {
2045
- consoleError(e);
2046
- }
2047
- {
2048
- hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
2049
- }
2050
- {
2051
- hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
2052
- }
2053
- endNewInstance();
2054
- fireConnectedCallback(hostRef.$lazyInstance$);
2055
- }
2056
- else {
2057
- // sync constructor component
2058
- Cstr = elm.constructor;
2059
- // wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
2060
- // watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
2061
- // Stencil has completed instantiating the component.
2062
- customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
2063
- }
2064
- if (Cstr.style) {
2065
- // this component has styles but we haven't registered them yet
2066
- let style = Cstr.style;
2067
- const scopeId = getScopeId(cmpMeta);
2068
- if (!styles.has(scopeId)) {
2069
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
2070
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
2071
- endRegisterStyles();
2072
- }
2073
- }
2074
- }
2075
- // we've successfully created a lazy instance
2076
- const ancestorComponent = hostRef.$ancestorComponent$;
2077
- const schedule = () => scheduleUpdate(hostRef, true);
2078
- if (ancestorComponent && ancestorComponent['s-rc']) {
2079
- // this is the initial load and this component it has an ancestor component
2080
- // but the ancestor component has NOT fired its will update lifecycle yet
2081
- // so let's just cool our jets and wait for the ancestor to continue first
2082
- // this will get fired off when the ancestor component
2083
- // finally gets around to rendering its lazy self
2084
- // fire off the initial update
2085
- ancestorComponent['s-rc'].push(schedule);
2086
- }
2087
- else {
2088
- schedule();
2089
- }
2090
- };
2091
- const fireConnectedCallback = (instance) => {
2092
- {
2093
- safeCall(instance, 'connectedCallback');
2094
- }
2095
- };
2096
- const connectedCallback = (elm) => {
2097
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2098
- const hostRef = getHostRef(elm);
2099
- const cmpMeta = hostRef.$cmpMeta$;
2100
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
2101
- if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
2102
- // first time this component has connected
2103
- hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
2104
- {
2105
- // initUpdate
2106
- // if the slot polyfill is required we'll need to put some nodes
2107
- // in here to act as original content anchors as we move nodes around
2108
- // host element has been connected to the DOM
2109
- if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2110
- cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
2111
- setContentReference(elm);
2112
- }
2113
- }
2114
- {
2115
- // find the first ancestor component (if there is one) and register
2116
- // this component as one of the actively loading child components for its ancestor
2117
- let ancestorComponent = elm;
2118
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
2119
- // climb up the ancestors looking for the first
2120
- // component that hasn't finished its lifecycle update yet
2121
- if (ancestorComponent['s-p']) {
2122
- // we found this components first ancestor component
2123
- // keep a reference to this component's ancestor component
2124
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
2125
- break;
2126
- }
2127
- }
2128
- }
2129
- // Lazy properties
2130
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2131
- if (cmpMeta.$members$) {
2132
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2133
- if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
2134
- const value = elm[memberName];
2135
- delete elm[memberName];
2136
- elm[memberName] = value;
2137
- }
2138
- });
2139
- }
2140
- {
2141
- initializeComponent(elm, hostRef, cmpMeta);
2142
- }
2143
- }
2144
- else {
2145
- // not the first time this has connected
2146
- // reattach any event listeners to the host
2147
- // since they would have been removed when disconnected
2148
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2149
- // fire off connectedCallback() on component instance
2150
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2151
- fireConnectedCallback(hostRef.$lazyInstance$);
2152
- }
2153
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2154
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
2155
- }
2156
- }
2157
- endConnected();
2158
- }
2159
- };
2160
- const setContentReference = (elm) => {
2161
- // only required when we're NOT using native shadow dom (slot)
2162
- // or this browser doesn't support native shadow dom
2163
- // and this host element was NOT created with SSR
2164
- // let's pick out the inner content for slot projection
2165
- // create a node to represent where the original
2166
- // content was first placed, which is useful later on
2167
- const contentRefElm = (elm['s-cr'] = doc.createComment(''));
2168
- contentRefElm['s-cn'] = true;
2169
- elm.insertBefore(contentRefElm, elm.firstChild);
2170
- };
2171
- const disconnectInstance = (instance) => {
2172
- {
2173
- safeCall(instance, 'disconnectedCallback');
2174
- }
2175
- };
2176
- const disconnectedCallback = async (elm) => {
2177
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2178
- const hostRef = getHostRef(elm);
2179
- {
2180
- if (hostRef.$rmListeners$) {
2181
- hostRef.$rmListeners$.map((rmListener) => rmListener());
2182
- hostRef.$rmListeners$ = undefined;
2183
- }
2184
- }
2185
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2186
- disconnectInstance(hostRef.$lazyInstance$);
2187
- }
2188
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2189
- hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2190
- }
2191
- }
2192
- };
2193
- const bootstrapLazy = (lazyBundles, options = {}) => {
2194
- var _a;
2195
- const endBootstrap = createTime();
2196
- const cmpTags = [];
2197
- const exclude = options.exclude || [];
2198
- const customElements = win.customElements;
2199
- const head = doc.head;
2200
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
2201
- const dataStyles = /*@__PURE__*/ doc.createElement('style');
2202
- const deferredConnectedCallbacks = [];
2203
- let appLoadFallback;
2204
- let isBootstrapping = true;
2205
- Object.assign(plt, options);
2206
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2207
- let hasSlotRelocation = false;
2208
- lazyBundles.map((lazyBundle) => {
2209
- lazyBundle[1].map((compactMeta) => {
2210
- var _a;
2211
- const cmpMeta = {
2212
- $flags$: compactMeta[0],
2213
- $tagName$: compactMeta[1],
2214
- $members$: compactMeta[2],
2215
- $listeners$: compactMeta[3],
2216
- };
2217
- // Check if we are using slots outside the shadow DOM in this component.
2218
- // We'll use this information later to add styles for `slot-fb` elements
2219
- if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
2220
- hasSlotRelocation = true;
2221
- }
2222
- {
2223
- cmpMeta.$members$ = compactMeta[2];
2224
- }
2225
- {
2226
- cmpMeta.$listeners$ = compactMeta[3];
2227
- }
2228
- {
2229
- cmpMeta.$attrsToReflect$ = [];
2230
- }
2231
- {
2232
- cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
2233
- }
2234
- const tagName = options.transformTagName
2235
- ? options.transformTagName(cmpMeta.$tagName$)
2236
- : cmpMeta.$tagName$;
2237
- const HostElement = class extends HTMLElement {
2238
- // StencilLazyHost
2239
- constructor(self) {
2240
- // @ts-ignore
2241
- super(self);
2242
- self = this;
2243
- registerHost(self, cmpMeta);
2244
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2245
- // this component is using shadow dom
2246
- // and this browser supports shadow dom
2247
- // add the read-only property "shadowRoot" to the host element
2248
- // adding the shadow root build conditionals to minimize runtime
2249
- {
2250
- {
2251
- self.attachShadow({
2252
- mode: 'open',
2253
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
2254
- });
2255
- }
2256
- }
2257
- }
2258
- }
2259
- connectedCallback() {
2260
- if (appLoadFallback) {
2261
- clearTimeout(appLoadFallback);
2262
- appLoadFallback = null;
2263
- }
2264
- if (isBootstrapping) {
2265
- // connectedCallback will be processed once all components have been registered
2266
- deferredConnectedCallbacks.push(this);
2267
- }
2268
- else {
2269
- plt.jmp(() => connectedCallback(this));
2270
- }
2271
- }
2272
- disconnectedCallback() {
2273
- plt.jmp(() => disconnectedCallback(this));
2274
- }
2275
- componentOnReady() {
2276
- return getHostRef(this).$onReadyPromise$;
2277
- }
2278
- };
2279
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
2280
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2281
- cmpTags.push(tagName);
2282
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
2283
- }
2284
- });
2285
- });
2286
- // Only bother generating CSS if we have components
2287
- // TODO(STENCIL-1118): Add test cases for CSS content based on conditionals
2288
- if (cmpTags.length > 0) {
2289
- // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
2290
- if (hasSlotRelocation) {
2291
- dataStyles.textContent += SLOT_FB_CSS;
2292
- }
2293
- // Add hydration styles
2294
- {
2295
- dataStyles.textContent += cmpTags + HYDRATED_CSS;
2296
- }
2297
- // If we have styles, add them to the DOM
2298
- if (dataStyles.innerHTML.length) {
2299
- dataStyles.setAttribute('data-styles', '');
2300
- // Apply CSP nonce to the style tag if it exists
2301
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
2302
- if (nonce != null) {
2303
- dataStyles.setAttribute('nonce', nonce);
2304
- }
2305
- // Insert the styles into the document head
2306
- // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
2307
- head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
2308
- }
2309
- }
2310
- // Process deferred connectedCallbacks now all components have been registered
2311
- isBootstrapping = false;
2312
- if (deferredConnectedCallbacks.length) {
2313
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
2314
- }
2315
- else {
2316
- {
2317
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2318
- }
2319
- }
2320
- // Fallback appLoad event
2321
- endBootstrap();
2322
- };
2323
- const Fragment = (_, children) => children;
2324
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2325
- if (listeners) {
2326
- listeners.map(([flags, name, method]) => {
2327
- const target = getHostListenerTarget(elm, flags) ;
2328
- const handler = hostListenerProxy(hostRef, method);
2329
- const opts = hostListenerOpts(flags);
2330
- plt.ael(target, name, handler, opts);
2331
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2332
- });
2333
- }
2334
- };
2335
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
2336
- try {
2337
- {
2338
- if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
2339
- // instance is ready, let's call it's member method for this event
2340
- hostRef.$lazyInstance$[methodName](ev);
2341
- }
2342
- else {
2343
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2344
- }
2345
- }
2346
- }
2347
- catch (e) {
2348
- consoleError(e);
2349
- }
2350
- };
2351
- const getHostListenerTarget = (elm, flags) => {
2352
- if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
2353
- return doc;
2354
- if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
2355
- return win;
2356
- if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
2357
- return doc.body;
2358
- return elm;
2359
- };
2360
- // prettier-ignore
2361
- const hostListenerOpts = (flags) => supportsListenerOptions
2362
- ? ({
2363
- passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
2364
- capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
2365
- })
2366
- : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
2367
- /**
2368
- * Assigns the given value to the nonce property on the runtime platform object.
2369
- * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
2370
- * @param nonce The value to be assigned to the platform nonce property.
2371
- * @returns void
2372
- */
2373
- const setNonce = (nonce) => (plt.$nonce$ = nonce);
2374
- /**
2375
- * A WeakMap mapping runtime component references to their corresponding host reference
2376
- * instances.
2377
- *
2378
- * **Note**: If we're in an HMR context we need to store a reference to this
2379
- * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
2380
- * to {@link d.HostRef} across HMR updates.
2381
- *
2382
- * This is necessary because when HMR updates for a component are processed by
2383
- * the browser-side dev server client the JS bundle for that component is
2384
- * re-fetched. Since the module containing {@link hostRefs} is included in
2385
- * that bundle, if we do not store a reference to it the new iteration of the
2386
- * component will not have access to the previous hostRef map, leading to a
2387
- * bug where the new version of the component cannot properly initialize.
2388
- */
2389
- const hostRefs = new WeakMap();
2390
- /**
2391
- * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
2392
- *
2393
- * @param ref the runtime ref of interest
2394
- * @returns the Host reference (if found) or undefined
2395
- */
2396
- const getHostRef = (ref) => hostRefs.get(ref);
2397
- /**
2398
- * Register a lazy instance with the {@link hostRefs} object so it's
2399
- * corresponding {@link d.HostRef} can be retrieved later.
2400
- *
2401
- * @param lazyInstance the lazy instance of interest
2402
- * @param hostRef that instances `HostRef` object
2403
- * @returns a reference to the host ref WeakMap
2404
- */
2405
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2406
- /**
2407
- * Register a host element for a Stencil component, setting up various metadata
2408
- * and callbacks based on {@link BUILD} flags as well as the component's runtime
2409
- * metadata.
2410
- *
2411
- * @param hostElement the host element to register
2412
- * @param cmpMeta runtime metadata for that component
2413
- * @returns a reference to the host ref WeakMap
2414
- */
2415
- const registerHost = (hostElement, cmpMeta) => {
2416
- const hostRef = {
2417
- $flags$: 0,
2418
- $hostElement$: hostElement,
2419
- $cmpMeta$: cmpMeta,
2420
- $instanceValues$: new Map(),
2421
- };
2422
- {
2423
- hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
2424
- }
2425
- {
2426
- hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2427
- hostElement['s-p'] = [];
2428
- hostElement['s-rc'] = [];
2429
- }
2430
- addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
2431
- return hostRefs.set(hostElement, hostRef);
2432
- };
2433
- const isMemberInElement = (elm, memberName) => memberName in elm;
2434
- const consoleError = (e, el) => (0, console.error)(e, el);
2435
- const cmpModules = /*@__PURE__*/ new Map();
2436
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2437
- // loadModuleImport
2438
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2439
- const bundleId = cmpMeta.$lazyBundleId$;
2440
- const module = cmpModules.get(bundleId) ;
2441
- if (module) {
2442
- return module[exportName];
2443
- }
2444
-
2445
- if (!hmrVersionId || !BUILD.hotModuleReplacement) {
2446
- const processMod = importedModule => {
2447
- cmpModules.set(bundleId, importedModule);
2448
- return importedModule[exportName];
2449
- }
2450
- switch(bundleId) {
2451
-
2452
- case 'tds-accordion.cjs':
2453
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2454
- /* webpackMode: "lazy" */
2455
- './tds-accordion.cjs.entry.js')); }).then(processMod, consoleError);
2456
- case 'tds-accordion-item.cjs':
2457
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2458
- /* webpackMode: "lazy" */
2459
- './tds-accordion-item.cjs.entry.js')); }).then(processMod, consoleError);
2460
- case 'tds-badge.cjs':
2461
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2462
- /* webpackMode: "lazy" */
2463
- './tds-badge.cjs.entry.js')); }).then(processMod, consoleError);
2464
- case 'tds-banner.cjs':
2465
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2466
- /* webpackMode: "lazy" */
2467
- './tds-banner.cjs.entry.js')); }).then(processMod, consoleError);
2468
- case 'tds-block.cjs':
2469
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2470
- /* webpackMode: "lazy" */
2471
- './tds-block.cjs.entry.js')); }).then(processMod, consoleError);
2472
- case 'tds-body-cell.cjs':
2473
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2474
- /* webpackMode: "lazy" */
2475
- './tds-body-cell.cjs.entry.js')); }).then(processMod, consoleError);
2476
- case 'tds-breadcrumb.cjs':
2477
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2478
- /* webpackMode: "lazy" */
2479
- './tds-breadcrumb.cjs.entry.js')); }).then(processMod, consoleError);
2480
- case 'tds-breadcrumbs.cjs':
2481
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2482
- /* webpackMode: "lazy" */
2483
- './tds-breadcrumbs.cjs.entry.js')); }).then(processMod, consoleError);
2484
- case 'tds-button.cjs':
2485
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2486
- /* webpackMode: "lazy" */
2487
- './tds-button.cjs.entry.js')); }).then(processMod, consoleError);
2488
- case 'tds-card.cjs':
2489
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2490
- /* webpackMode: "lazy" */
2491
- './tds-card.cjs.entry.js')); }).then(processMod, consoleError);
2492
- case 'tds-chip.cjs':
2493
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2494
- /* webpackMode: "lazy" */
2495
- './tds-chip.cjs.entry.js')); }).then(processMod, consoleError);
2496
- case 'tds-datetime.cjs':
2497
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2498
- /* webpackMode: "lazy" */
2499
- './tds-datetime.cjs.entry.js')); }).then(processMod, consoleError);
2500
- case 'tds-dropdown.cjs':
2501
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2502
- /* webpackMode: "lazy" */
2503
- './tds-dropdown.cjs.entry.js')); }).then(processMod, consoleError);
2504
- case 'tds-dropdown-option.cjs':
2505
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2506
- /* webpackMode: "lazy" */
2507
- './tds-dropdown-option.cjs.entry.js')); }).then(processMod, consoleError);
2508
- case 'tds-folder-tab.cjs':
2509
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2510
- /* webpackMode: "lazy" */
2511
- './tds-folder-tab.cjs.entry.js')); }).then(processMod, consoleError);
2512
- case 'tds-folder-tabs.cjs':
2513
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2514
- /* webpackMode: "lazy" */
2515
- './tds-folder-tabs.cjs.entry.js')); }).then(processMod, consoleError);
2516
- case 'tds-footer.cjs':
2517
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2518
- /* webpackMode: "lazy" */
2519
- './tds-footer.cjs.entry.js')); }).then(processMod, consoleError);
2520
- case 'tds-footer-group.cjs':
2521
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2522
- /* webpackMode: "lazy" */
2523
- './tds-footer-group.cjs.entry.js')); }).then(processMod, consoleError);
2524
- case 'tds-footer-item.cjs':
2525
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2526
- /* webpackMode: "lazy" */
2527
- './tds-footer-item.cjs.entry.js')); }).then(processMod, consoleError);
2528
- case 'tds-header.cjs':
2529
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2530
- /* webpackMode: "lazy" */
2531
- './tds-header.cjs.entry.js')); }).then(processMod, consoleError);
2532
- case 'tds-header-brand-symbol.cjs':
2533
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2534
- /* webpackMode: "lazy" */
2535
- './tds-header-brand-symbol.cjs.entry.js')); }).then(processMod, consoleError);
2536
- case 'tds-header-cell.cjs':
2537
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2538
- /* webpackMode: "lazy" */
2539
- './tds-header-cell.cjs.entry.js')); }).then(processMod, consoleError);
2540
- case 'tds-header-dropdown.cjs':
2541
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2542
- /* webpackMode: "lazy" */
2543
- './tds-header-dropdown.cjs.entry.js')); }).then(processMod, consoleError);
2544
- case 'tds-header-dropdown-list-user.cjs':
2545
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2546
- /* webpackMode: "lazy" */
2547
- './tds-header-dropdown-list-user.cjs.entry.js')); }).then(processMod, consoleError);
2548
- case 'tds-header-hamburger.cjs':
2549
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2550
- /* webpackMode: "lazy" */
2551
- './tds-header-hamburger.cjs.entry.js')); }).then(processMod, consoleError);
2552
- case 'tds-header-launcher.cjs':
2553
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2554
- /* webpackMode: "lazy" */
2555
- './tds-header-launcher.cjs.entry.js')); }).then(processMod, consoleError);
2556
- case 'tds-header-launcher-grid.cjs':
2557
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2558
- /* webpackMode: "lazy" */
2559
- './tds-header-launcher-grid.cjs.entry.js')); }).then(processMod, consoleError);
2560
- case 'tds-header-launcher-grid-item.cjs':
2561
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2562
- /* webpackMode: "lazy" */
2563
- './tds-header-launcher-grid-item.cjs.entry.js')); }).then(processMod, consoleError);
2564
- case 'tds-header-launcher-grid-title.cjs':
2565
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2566
- /* webpackMode: "lazy" */
2567
- './tds-header-launcher-grid-title.cjs.entry.js')); }).then(processMod, consoleError);
2568
- case 'tds-header-launcher-list.cjs':
2569
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2570
- /* webpackMode: "lazy" */
2571
- './tds-header-launcher-list.cjs.entry.js')); }).then(processMod, consoleError);
2572
- case 'tds-header-launcher-list-item.cjs':
2573
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2574
- /* webpackMode: "lazy" */
2575
- './tds-header-launcher-list-item.cjs.entry.js')); }).then(processMod, consoleError);
2576
- case 'tds-header-launcher-list-title.cjs':
2577
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2578
- /* webpackMode: "lazy" */
2579
- './tds-header-launcher-list-title.cjs.entry.js')); }).then(processMod, consoleError);
2580
- case 'tds-header-title.cjs':
2581
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2582
- /* webpackMode: "lazy" */
2583
- './tds-header-title.cjs.entry.js')); }).then(processMod, consoleError);
2584
- case 'tds-inline-tab.cjs':
2585
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2586
- /* webpackMode: "lazy" */
2587
- './tds-inline-tab.cjs.entry.js')); }).then(processMod, consoleError);
2588
- case 'tds-inline-tabs.cjs':
2589
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2590
- /* webpackMode: "lazy" */
2591
- './tds-inline-tabs.cjs.entry.js')); }).then(processMod, consoleError);
2592
- case 'tds-link.cjs':
2593
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2594
- /* webpackMode: "lazy" */
2595
- './tds-link.cjs.entry.js')); }).then(processMod, consoleError);
2596
- case 'tds-message.cjs':
2597
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2598
- /* webpackMode: "lazy" */
2599
- './tds-message.cjs.entry.js')); }).then(processMod, consoleError);
2600
- case 'tds-modal.cjs':
2601
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2602
- /* webpackMode: "lazy" */
2603
- './tds-modal.cjs.entry.js')); }).then(processMod, consoleError);
2604
- case 'tds-navigation-tab.cjs':
2605
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2606
- /* webpackMode: "lazy" */
2607
- './tds-navigation-tab.cjs.entry.js')); }).then(processMod, consoleError);
2608
- case 'tds-navigation-tabs.cjs':
2609
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2610
- /* webpackMode: "lazy" */
2611
- './tds-navigation-tabs.cjs.entry.js')); }).then(processMod, consoleError);
2612
- case 'tds-popover-menu.cjs':
2613
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2614
- /* webpackMode: "lazy" */
2615
- './tds-popover-menu.cjs.entry.js')); }).then(processMod, consoleError);
2616
- case 'tds-popover-menu-item.cjs':
2617
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2618
- /* webpackMode: "lazy" */
2619
- './tds-popover-menu-item.cjs.entry.js')); }).then(processMod, consoleError);
2620
- case 'tds-radio-button.cjs':
2621
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2622
- /* webpackMode: "lazy" */
2623
- './tds-radio-button.cjs.entry.js')); }).then(processMod, consoleError);
2624
- case 'tds-side-menu.cjs':
2625
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2626
- /* webpackMode: "lazy" */
2627
- './tds-side-menu.cjs.entry.js')); }).then(processMod, consoleError);
2628
- case 'tds-side-menu-close-button.cjs':
2629
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2630
- /* webpackMode: "lazy" */
2631
- './tds-side-menu-close-button.cjs.entry.js')); }).then(processMod, consoleError);
2632
- case 'tds-side-menu-collapse-button.cjs':
2633
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2634
- /* webpackMode: "lazy" */
2635
- './tds-side-menu-collapse-button.cjs.entry.js')); }).then(processMod, consoleError);
2636
- case 'tds-side-menu-dropdown.cjs':
2637
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2638
- /* webpackMode: "lazy" */
2639
- './tds-side-menu-dropdown.cjs.entry.js')); }).then(processMod, consoleError);
2640
- case 'tds-side-menu-dropdown-list.cjs':
2641
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2642
- /* webpackMode: "lazy" */
2643
- './tds-side-menu-dropdown-list.cjs.entry.js')); }).then(processMod, consoleError);
2644
- case 'tds-side-menu-dropdown-list-item.cjs':
2645
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2646
- /* webpackMode: "lazy" */
2647
- './tds-side-menu-dropdown-list-item.cjs.entry.js')); }).then(processMod, consoleError);
2648
- case 'tds-side-menu-overlay.cjs':
2649
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2650
- /* webpackMode: "lazy" */
2651
- './tds-side-menu-overlay.cjs.entry.js')); }).then(processMod, consoleError);
2652
- case 'tds-side-menu-user.cjs':
2653
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2654
- /* webpackMode: "lazy" */
2655
- './tds-side-menu-user.cjs.entry.js')); }).then(processMod, consoleError);
2656
- case 'tds-slider.cjs':
2657
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2658
- /* webpackMode: "lazy" */
2659
- './tds-slider.cjs.entry.js')); }).then(processMod, consoleError);
2660
- case 'tds-spinner.cjs':
2661
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2662
- /* webpackMode: "lazy" */
2663
- './tds-spinner.cjs.entry.js')); }).then(processMod, consoleError);
2664
- case 'tds-step.cjs':
2665
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2666
- /* webpackMode: "lazy" */
2667
- './tds-step.cjs.entry.js')); }).then(processMod, consoleError);
2668
- case 'tds-stepper.cjs':
2669
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2670
- /* webpackMode: "lazy" */
2671
- './tds-stepper.cjs.entry.js')); }).then(processMod, consoleError);
2672
- case 'tds-table.cjs':
2673
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2674
- /* webpackMode: "lazy" */
2675
- './tds-table.cjs.entry.js')); }).then(processMod, consoleError);
2676
- case 'tds-table-body.cjs':
2677
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2678
- /* webpackMode: "lazy" */
2679
- './tds-table-body.cjs.entry.js')); }).then(processMod, consoleError);
2680
- case 'tds-table-body-row.cjs':
2681
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2682
- /* webpackMode: "lazy" */
2683
- './tds-table-body-row.cjs.entry.js')); }).then(processMod, consoleError);
2684
- case 'tds-table-body-row-expandable.cjs':
2685
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2686
- /* webpackMode: "lazy" */
2687
- './tds-table-body-row-expandable.cjs.entry.js')); }).then(processMod, consoleError);
2688
- case 'tds-table-footer.cjs':
2689
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2690
- /* webpackMode: "lazy" */
2691
- './tds-table-footer.cjs.entry.js')); }).then(processMod, consoleError);
2692
- case 'tds-table-header.cjs':
2693
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2694
- /* webpackMode: "lazy" */
2695
- './tds-table-header.cjs.entry.js')); }).then(processMod, consoleError);
2696
- case 'tds-table-toolbar.cjs':
2697
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2698
- /* webpackMode: "lazy" */
2699
- './tds-table-toolbar.cjs.entry.js')); }).then(processMod, consoleError);
2700
- case 'tds-text-field.cjs':
2701
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2702
- /* webpackMode: "lazy" */
2703
- './tds-text-field.cjs.entry.js')); }).then(processMod, consoleError);
2704
- case 'tds-textarea.cjs':
2705
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2706
- /* webpackMode: "lazy" */
2707
- './tds-textarea.cjs.entry.js')); }).then(processMod, consoleError);
2708
- case 'tds-toast.cjs':
2709
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2710
- /* webpackMode: "lazy" */
2711
- './tds-toast.cjs.entry.js')); }).then(processMod, consoleError);
2712
- case 'tds-toggle.cjs':
2713
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2714
- /* webpackMode: "lazy" */
2715
- './tds-toggle.cjs.entry.js')); }).then(processMod, consoleError);
2716
- case 'tds-tooltip.cjs':
2717
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2718
- /* webpackMode: "lazy" */
2719
- './tds-tooltip.cjs.entry.js')); }).then(processMod, consoleError);
2720
- case 'tds-divider.cjs':
2721
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2722
- /* webpackMode: "lazy" */
2723
- './tds-divider.cjs.entry.js')); }).then(processMod, consoleError);
2724
- case 'tds-header-dropdown-list.cjs':
2725
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2726
- /* webpackMode: "lazy" */
2727
- './tds-header-dropdown-list.cjs.entry.js')); }).then(processMod, consoleError);
2728
- case 'tds-header-dropdown-list-item.cjs':
2729
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2730
- /* webpackMode: "lazy" */
2731
- './tds-header-dropdown-list-item.cjs.entry.js')); }).then(processMod, consoleError);
2732
- case 'tds-header-launcher-button.cjs':
2733
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2734
- /* webpackMode: "lazy" */
2735
- './tds-header-launcher-button.cjs.entry.js')); }).then(processMod, consoleError);
2736
- case 'tds-side-menu-user-image_2.cjs':
2737
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2738
- /* webpackMode: "lazy" */
2739
- './tds-side-menu-user-image_2.cjs.entry.js')); }).then(processMod, consoleError);
2740
- case 'tds-popover-canvas.cjs':
2741
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2742
- /* webpackMode: "lazy" */
2743
- './tds-popover-canvas.cjs.entry.js')); }).then(processMod, consoleError);
2744
- case 'tds-side-menu-item.cjs':
2745
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2746
- /* webpackMode: "lazy" */
2747
- './tds-side-menu-item.cjs.entry.js')); }).then(processMod, consoleError);
2748
- case 'tds-checkbox.cjs':
2749
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2750
- /* webpackMode: "lazy" */
2751
- './tds-checkbox.cjs.entry.js')); }).then(processMod, consoleError);
2752
- case 'tds-core-header-item_2.cjs':
2753
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2754
- /* webpackMode: "lazy" */
2755
- './tds-core-header-item_2.cjs.entry.js')); }).then(processMod, consoleError);
2756
- case 'tds-popover-core.cjs':
2757
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2758
- /* webpackMode: "lazy" */
2759
- './tds-popover-core.cjs.entry.js')); }).then(processMod, consoleError);
2760
- case 'tds-icon.cjs':
2761
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2762
- /* webpackMode: "lazy" */
2763
- './tds-icon.cjs.entry.js')); }).then(processMod, consoleError);
2764
- }
2765
- }
2766
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2767
- /* @vite-ignore */
2768
- /* webpackInclude: /\.entry\.js$/ */
2769
- /* webpackExclude: /\.system\.entry\.js$/ */
2770
- /* webpackMode: "lazy" */
2771
- `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
2772
- {
2773
- cmpModules.set(bundleId, importedModule);
2774
- }
2775
- return importedModule[exportName];
2776
- }, consoleError);
2777
- };
2778
- const styles = /*@__PURE__*/ new Map();
2779
- const win = typeof window !== 'undefined' ? window : {};
2780
- const doc = win.document || { head: {} };
2781
- const plt = {
2782
- $flags$: 0,
2783
- $resourcesUrl$: '',
2784
- jmp: (h) => h(),
2785
- raf: (h) => requestAnimationFrame(h),
2786
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2787
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2788
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
2789
- };
2790
- const supportsListenerOptions = /*@__PURE__*/ (() => {
2791
- let supportsListenerOptions = false;
2792
- try {
2793
- doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
2794
- get() {
2795
- supportsListenerOptions = true;
2796
- },
2797
- }));
2798
- }
2799
- catch (e) { }
2800
- return supportsListenerOptions;
2801
- })();
2802
- const promiseResolve = (v) => Promise.resolve(v);
2803
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2804
- try {
2805
- new CSSStyleSheet();
2806
- return typeof new CSSStyleSheet().replaceSync === 'function';
2807
- }
2808
- catch (e) { }
2809
- return false;
2810
- })()
2811
- ;
2812
- const queueDomReads = [];
2813
- const queueDomWrites = [];
2814
- const queueTask = (queue, write) => (cb) => {
2815
- queue.push(cb);
2816
- if (!queuePending) {
2817
- queuePending = true;
2818
- if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2819
- nextTick(flush);
2820
- }
2821
- else {
2822
- plt.raf(flush);
2823
- }
2824
- }
2825
- };
2826
- const consume = (queue) => {
2827
- for (let i = 0; i < queue.length; i++) {
2828
- try {
2829
- queue[i](performance.now());
2830
- }
2831
- catch (e) {
2832
- consoleError(e);
2833
- }
2834
- }
2835
- queue.length = 0;
2836
- };
2837
- const flush = () => {
2838
- // always force a bunch of medium callbacks to run, but still have
2839
- // a throttle on how many can run in a certain time
2840
- // DOM READS!!!
2841
- consume(queueDomReads);
2842
- // DOM WRITES!!!
2843
- {
2844
- consume(queueDomWrites);
2845
- if ((queuePending = queueDomReads.length > 0)) {
2846
- // still more to do yet, but we've run out of time
2847
- // let's let this thing cool off and try again in the next tick
2848
- plt.raf(flush);
2849
- }
2850
- }
2851
- };
2852
- const nextTick = (cb) => promiseResolve().then(cb);
2853
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2854
-
2855
- exports.Fragment = Fragment;
2856
- exports.Host = Host;
2857
- exports.bootstrapLazy = bootstrapLazy;
2858
- exports.createEvent = createEvent;
2859
- exports.getElement = getElement;
2860
- exports.h = h;
2861
- exports.promiseResolve = promiseResolve;
2862
- exports.registerInstance = registerInstance;
2863
- exports.setNonce = setNonce;