@zanichelli/albe-web-components 2.31.2 → 2.33.1

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 (470) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/types/beans/index.d.ts +4 -0
  3. package/dist/types/components/z-aria-alert/index.d.ts +4 -0
  4. package/dist/types/components/z-visually-hidden/index.d.ts +3 -0
  5. package/dist/types/components.d.ts +28 -0
  6. package/dist/web-components-library/_commonjsHelpers-cb1cd7bb.js +44 -0
  7. package/dist/web-components-library/app-globals-0f993ce5.js +3 -0
  8. package/dist/{esm → web-components-library}/breakpoints-c386984e.js +0 -0
  9. package/dist/web-components-library/css-shim-003e9264.js +4 -0
  10. package/dist/web-components-library/dom-1b195079.js +73 -0
  11. package/dist/{esm/hammer-c807d0b5.js → web-components-library/hammer-52e2c4fe.js} +4 -15
  12. package/dist/{collection/components/icons/icons.js → web-components-library/icons-9a191d79.js} +3 -1
  13. package/dist/web-components-library/index-44936066.js +2832 -0
  14. package/dist/web-components-library/index-8067f807.js +64 -0
  15. package/dist/{esm/index-0258069c.js → web-components-library/index-8f67b3da.js} +6 -1
  16. package/dist/web-components-library/index.esm.js +9 -1
  17. package/dist/web-components-library/shadow-css-c1ad5fdc.js +383 -0
  18. package/dist/{esm/utils-0345e333.js → web-components-library/utils-5e70920f.js} +20 -2
  19. package/dist/web-components-library/web-components-library.css +789 -1
  20. package/dist/web-components-library/web-components-library.esm.js +122 -1
  21. package/dist/web-components-library/z-alert.entry.js +15 -0
  22. package/dist/{esm → web-components-library}/z-app-header.entry.js +1 -1
  23. package/dist/web-components-library/z-app-switcher.entry.js +25 -0
  24. package/dist/web-components-library/z-app-topbar.entry.js +37 -0
  25. package/dist/web-components-library/z-aria-alert.entry.js +14 -0
  26. package/dist/web-components-library/z-avatar.entry.js +39 -0
  27. package/dist/web-components-library/z-body.entry.js +13 -0
  28. package/dist/web-components-library/z-button-filter.entry.js +45 -0
  29. package/dist/web-components-library/z-button-sort.entry.js +50 -0
  30. package/dist/web-components-library/z-button.entry.js +35 -0
  31. package/dist/{esm → web-components-library}/z-candybar.entry.js +1 -1
  32. package/dist/web-components-library/z-card.entry.js +54 -0
  33. package/dist/web-components-library/z-chip.entry.js +20 -0
  34. package/dist/web-components-library/z-combobox.entry.js +166 -0
  35. package/dist/web-components-library/z-contextual-menu.entry.js +36 -0
  36. package/dist/{esm → web-components-library}/z-cookiebar.entry.js +2 -2
  37. package/dist/web-components-library/z-divider.entry.js +22 -0
  38. package/dist/web-components-library/z-footer-link.entry.js +15 -0
  39. package/dist/web-components-library/z-footer-section.entry.js +19 -0
  40. package/dist/web-components-library/z-footer-social.entry.js +15 -0
  41. package/dist/web-components-library/z-footer.entry.js +98 -0
  42. package/dist/web-components-library/z-ghost-loading.entry.js +15 -0
  43. package/dist/{esm → web-components-library}/z-heading.entry.js +1 -1
  44. package/dist/web-components-library/z-icon-package.entry.js +19 -0
  45. package/dist/web-components-library/z-icon.entry.js +24 -0
  46. package/dist/web-components-library/z-info-box.entry.js +21 -0
  47. package/dist/web-components-library/z-input-label.entry.js +17 -0
  48. package/dist/web-components-library/z-input-message.entry.js +20 -0
  49. package/dist/web-components-library/z-input.entry.js +264 -0
  50. package/dist/web-components-library/z-link.entry.js +67 -0
  51. package/dist/web-components-library/z-list-element.entry.js +150 -0
  52. package/dist/web-components-library/z-list-group.entry.js +50 -0
  53. package/dist/web-components-library/z-list.entry.js +30 -0
  54. package/dist/web-components-library/z-logo.entry.js +24 -0
  55. package/dist/web-components-library/z-menu-dropdown.entry.js +56 -0
  56. package/dist/web-components-library/z-menu-section.entry.js +42 -0
  57. package/dist/web-components-library/z-menu.entry.js +106 -0
  58. package/dist/{esm → web-components-library}/z-messages-pocket.entry.js +2 -2
  59. package/dist/{esm → web-components-library}/z-modal-login.entry.js +2 -2
  60. package/dist/web-components-library/z-modal.entry.js +32 -0
  61. package/dist/web-components-library/z-myz-card-alert.entry.js +59 -0
  62. package/dist/web-components-library/z-myz-card-body.entry.js +15 -0
  63. package/dist/web-components-library/z-myz-card-cover.entry.js +18 -0
  64. package/dist/{esm → web-components-library}/z-myz-card-dictionary.entry.js +2 -2
  65. package/dist/{esm → web-components-library}/z-myz-card-footer-sections.entry.js +1 -1
  66. package/dist/web-components-library/z-myz-card-footer.entry.js +48 -0
  67. package/dist/web-components-library/z-myz-card-header.entry.js +34 -0
  68. package/dist/web-components-library/z-myz-card-icon.entry.js +17 -0
  69. package/dist/{esm → web-components-library}/z-myz-card-info.entry.js +3 -3
  70. package/dist/web-components-library/z-myz-card-list.entry.js +33 -0
  71. package/dist/web-components-library/z-myz-card.entry.js +37 -0
  72. package/dist/web-components-library/z-myz-list-item.entry.js +33 -0
  73. package/dist/web-components-library/z-myz-list.entry.js +31 -0
  74. package/dist/{esm → web-components-library}/z-myz-topbar.entry.js +2 -2
  75. package/dist/{esm → web-components-library}/z-navigation-tab.entry.js +1 -1
  76. package/dist/{esm → web-components-library}/z-navigation-tabs.entry.js +2 -2
  77. package/dist/web-components-library/z-notification.entry.js +38 -0
  78. package/dist/{esm → web-components-library}/z-otp.entry.js +2 -2
  79. package/dist/web-components-library/z-pagination-bar.entry.js +126 -0
  80. package/dist/web-components-library/z-pagination-page.entry.js +21 -0
  81. package/dist/web-components-library/z-panel-elem.entry.js +26 -0
  82. package/dist/web-components-library/z-pocket-body.entry.js +23 -0
  83. package/dist/web-components-library/z-pocket-header.entry.js +36 -0
  84. package/dist/{esm → web-components-library}/z-pocket-message.entry.js +1 -1
  85. package/dist/web-components-library/z-pocket.entry.js +68 -0
  86. package/dist/web-components-library/z-popover.entry.js +124 -0
  87. package/dist/web-components-library/z-registro-table-body.entry.js +20 -0
  88. package/dist/web-components-library/z-registro-table-cell.entry.js +30 -0
  89. package/dist/web-components-library/z-registro-table-empty-box.entry.js +24 -0
  90. package/dist/web-components-library/z-registro-table-expanded-row.entry.js +15 -0
  91. package/dist/{esm → web-components-library}/z-registro-table-footer.entry.js +1 -1
  92. package/dist/web-components-library/z-registro-table-head.entry.js +19 -0
  93. package/dist/web-components-library/z-registro-table-header-row.entry.js +18 -0
  94. package/dist/web-components-library/z-registro-table-header.entry.js +80 -0
  95. package/dist/web-components-library/z-registro-table-row.entry.js +39 -0
  96. package/dist/web-components-library/z-registro-table-sticky-footer.entry.js +15 -0
  97. package/dist/web-components-library/z-registro-table.entry.js +78 -0
  98. package/dist/web-components-library/z-select.entry.js +281 -0
  99. package/dist/{esm → web-components-library}/z-slideshow.entry.js +3 -3
  100. package/dist/web-components-library/z-status-tag.entry.js +25 -0
  101. package/dist/web-components-library/z-stepper-item.entry.js +18 -0
  102. package/dist/web-components-library/z-stepper.entry.js +15 -0
  103. package/dist/{esm → web-components-library}/z-toast-notification-list.entry.js +2 -2
  104. package/dist/{esm → web-components-library}/z-toast-notification.entry.js +4 -3
  105. package/dist/web-components-library/z-toggle-button.entry.js +32 -0
  106. package/dist/{collection/components/notification/z-tooltip/index.js → web-components-library/z-tooltip.entry.js} +19 -128
  107. package/dist/web-components-library/z-typography.entry.js +25 -0
  108. package/dist/web-components-library/z-user-dropdown.entry.js +91 -0
  109. package/dist/web-components-library/z-visually-hidden.entry.js +15 -0
  110. package/package.json +1 -1
  111. package/react/components.d.ts +2 -0
  112. package/react/components.js +4 -2
  113. package/react/components.js.map +1 -1
  114. package/www/build/_commonjsHelpers-cb1cd7bb.js +44 -0
  115. package/www/build/app-globals-0f993ce5.js +3 -0
  116. package/{dist/collection/constants/breakpoints.js → www/build/breakpoints-c386984e.js} +2 -1
  117. package/www/build/css-shim-003e9264.js +4 -0
  118. package/www/build/dom-1b195079.js +73 -0
  119. package/{dist/cjs/hammer-6e321f0b.js → www/build/hammer-52e2c4fe.js} +4 -18
  120. package/www/build/icons-9a191d79.js +475 -0
  121. package/www/build/index-44936066.js +2832 -0
  122. package/www/build/index-8067f807.js +64 -0
  123. package/{dist/collection/beans/index.js → www/build/index-8f67b3da.js} +41 -34
  124. package/www/build/index.esm.js +9 -1
  125. package/www/build/shadow-css-c1ad5fdc.js +383 -0
  126. package/{dist/collection/utils/utils.js → www/build/utils-5e70920f.js} +15 -12
  127. package/www/build/web-components-library.css +789 -1
  128. package/www/build/web-components-library.esm.js +122 -1
  129. package/www/build/z-alert.entry.js +15 -0
  130. package/{dist/cjs/z-app-header.cjs.entry.js → www/build/z-app-header.entry.js} +5 -9
  131. package/www/build/z-app-switcher.entry.js +25 -0
  132. package/www/build/z-app-topbar.entry.js +37 -0
  133. package/www/build/z-aria-alert.entry.js +14 -0
  134. package/www/build/z-avatar.entry.js +39 -0
  135. package/www/build/z-body.entry.js +13 -0
  136. package/www/build/z-button-filter.entry.js +45 -0
  137. package/www/build/z-button-sort.entry.js +50 -0
  138. package/www/build/z-button.entry.js +35 -0
  139. package/{dist/cjs/z-candybar.cjs.entry.js → www/build/z-candybar.entry.js} +4 -8
  140. package/www/build/z-card.entry.js +54 -0
  141. package/www/build/z-chip.entry.js +20 -0
  142. package/www/build/z-combobox.entry.js +166 -0
  143. package/www/build/z-contextual-menu.entry.js +36 -0
  144. package/{dist/cjs/z-cookiebar.cjs.entry.js → www/build/z-cookiebar.entry.js} +7 -11
  145. package/www/build/z-divider.entry.js +22 -0
  146. package/www/build/z-footer-link.entry.js +15 -0
  147. package/www/build/z-footer-section.entry.js +19 -0
  148. package/www/build/z-footer-social.entry.js +15 -0
  149. package/www/build/z-footer.entry.js +98 -0
  150. package/www/build/z-ghost-loading.entry.js +15 -0
  151. package/www/build/z-heading.entry.js +13 -0
  152. package/www/build/z-icon-package.entry.js +19 -0
  153. package/www/build/z-icon.entry.js +24 -0
  154. package/www/build/z-info-box.entry.js +21 -0
  155. package/www/build/z-input-label.entry.js +17 -0
  156. package/www/build/z-input-message.entry.js +20 -0
  157. package/www/build/z-input.entry.js +264 -0
  158. package/www/build/z-link.entry.js +67 -0
  159. package/www/build/z-list-element.entry.js +150 -0
  160. package/www/build/z-list-group.entry.js +50 -0
  161. package/www/build/z-list.entry.js +30 -0
  162. package/www/build/z-logo.entry.js +24 -0
  163. package/www/build/z-menu-dropdown.entry.js +56 -0
  164. package/www/build/z-menu-section.entry.js +42 -0
  165. package/www/build/z-menu.entry.js +106 -0
  166. package/{dist/cjs/z-messages-pocket.cjs.entry.js → www/build/z-messages-pocket.entry.js} +13 -17
  167. package/www/build/z-modal-login.entry.js +77 -0
  168. package/www/build/z-modal.entry.js +32 -0
  169. package/www/build/z-myz-card-alert.entry.js +59 -0
  170. package/www/build/z-myz-card-body.entry.js +15 -0
  171. package/www/build/z-myz-card-cover.entry.js +18 -0
  172. package/{dist/cjs/z-myz-card-dictionary.cjs.entry.js → www/build/z-myz-card-dictionary.entry.js} +6 -10
  173. package/{dist/cjs/z-myz-card-footer-sections.cjs.entry.js → www/build/z-myz-card-footer-sections.entry.js} +4 -8
  174. package/www/build/z-myz-card-footer.entry.js +48 -0
  175. package/www/build/z-myz-card-header.entry.js +34 -0
  176. package/www/build/z-myz-card-icon.entry.js +17 -0
  177. package/{dist/cjs/z-myz-card-info.cjs.entry.js → www/build/z-myz-card-info.entry.js} +19 -23
  178. package/www/build/z-myz-card-list.entry.js +33 -0
  179. package/www/build/z-myz-card.entry.js +37 -0
  180. package/www/build/z-myz-list-item.entry.js +33 -0
  181. package/www/build/z-myz-list.entry.js +31 -0
  182. package/{dist/cjs/z-myz-topbar.cjs.entry.js → www/build/z-myz-topbar.entry.js} +29 -33
  183. package/{dist/cjs/z-navigation-tab.cjs.entry.js → www/build/z-navigation-tab.entry.js} +6 -10
  184. package/{dist/cjs/z-navigation-tabs.cjs.entry.js → www/build/z-navigation-tabs.entry.js} +11 -15
  185. package/www/build/z-notification.entry.js +38 -0
  186. package/{dist/cjs/z-otp.cjs.entry.js → www/build/z-otp.entry.js} +8 -12
  187. package/www/build/z-pagination-bar.entry.js +126 -0
  188. package/www/build/z-pagination-page.entry.js +21 -0
  189. package/www/build/z-panel-elem.entry.js +26 -0
  190. package/www/build/z-pocket-body.entry.js +23 -0
  191. package/www/build/z-pocket-header.entry.js +36 -0
  192. package/{dist/cjs/z-pocket-message.cjs.entry.js → www/build/z-pocket-message.entry.js} +4 -8
  193. package/www/build/z-pocket.entry.js +68 -0
  194. package/www/build/z-popover.entry.js +124 -0
  195. package/www/build/z-registro-table-body.entry.js +20 -0
  196. package/www/build/z-registro-table-cell.entry.js +30 -0
  197. package/www/build/z-registro-table-empty-box.entry.js +24 -0
  198. package/www/build/z-registro-table-expanded-row.entry.js +15 -0
  199. package/{dist/cjs/z-registro-table-footer.cjs.entry.js → www/build/z-registro-table-footer.entry.js} +5 -9
  200. package/www/build/z-registro-table-head.entry.js +19 -0
  201. package/www/build/z-registro-table-header-row.entry.js +18 -0
  202. package/www/build/z-registro-table-header.entry.js +80 -0
  203. package/www/build/z-registro-table-row.entry.js +39 -0
  204. package/www/build/z-registro-table-sticky-footer.entry.js +15 -0
  205. package/www/build/z-registro-table.entry.js +78 -0
  206. package/www/build/z-select.entry.js +281 -0
  207. package/{dist/cjs/z-slideshow.cjs.entry.js → www/build/z-slideshow.entry.js} +19 -23
  208. package/www/build/z-status-tag.entry.js +25 -0
  209. package/www/build/z-stepper-item.entry.js +18 -0
  210. package/www/build/z-stepper.entry.js +15 -0
  211. package/{dist/cjs/z-toast-notification-list.cjs.entry.js → www/build/z-toast-notification-list.entry.js} +7 -11
  212. package/{dist/cjs/z-toast-notification.cjs.entry.js → www/build/z-toast-notification.entry.js} +31 -34
  213. package/www/build/z-toggle-button.entry.js +32 -0
  214. package/www/build/z-tooltip.entry.js +270 -0
  215. package/www/build/z-typography.entry.js +25 -0
  216. package/www/build/z-user-dropdown.entry.js +91 -0
  217. package/www/build/z-visually-hidden.entry.js +15 -0
  218. package/www/index.html +44 -31
  219. package/dist/cjs/breakpoints-88c4fd6c.js +0 -7
  220. package/dist/cjs/index-8f4b351d.js +0 -251
  221. package/dist/cjs/index-dee3e21d.js +0 -1694
  222. package/dist/cjs/index.cjs.js +0 -13
  223. package/dist/cjs/loader.cjs.js +0 -21
  224. package/dist/cjs/utils-6d6841cc.js +0 -75
  225. package/dist/cjs/web-components-library.cjs.js +0 -19
  226. package/dist/cjs/z-alert_66.cjs.entry.js +0 -3736
  227. package/dist/cjs/z-heading.cjs.entry.js +0 -17
  228. package/dist/cjs/z-modal-login.cjs.entry.js +0 -81
  229. package/dist/cjs/z-pocket_3.cjs.entry.js +0 -124
  230. package/dist/collection/collection-manifest.json +0 -98
  231. package/dist/collection/components/buttons/z-button/index.js +0 -219
  232. package/dist/collection/components/buttons/z-button/styles.css +0 -231
  233. package/dist/collection/components/buttons/z-button-filter/index.js +0 -155
  234. package/dist/collection/components/buttons/z-button-filter/styles.css +0 -74
  235. package/dist/collection/components/buttons/z-button-sort/index.js +0 -216
  236. package/dist/collection/components/buttons/z-button-sort/styles.css +0 -101
  237. package/dist/collection/components/buttons/z-chip/index.js +0 -59
  238. package/dist/collection/components/buttons/z-chip/styles.css +0 -17
  239. package/dist/collection/components/buttons/z-toggle-button/index.js +0 -122
  240. package/dist/collection/components/buttons/z-toggle-button/styles.css +0 -62
  241. package/dist/collection/components/footer/z-footer/index.js +0 -286
  242. package/dist/collection/components/footer/z-footer/styles.css +0 -242
  243. package/dist/collection/components/footer/z-footer-link/index.js +0 -37
  244. package/dist/collection/components/footer/z-footer-link/styles.css +0 -33
  245. package/dist/collection/components/footer/z-footer-section/index.js +0 -51
  246. package/dist/collection/components/footer/z-footer-section/styles.css +0 -163
  247. package/dist/collection/components/footer/z-footer-social/index.js +0 -68
  248. package/dist/collection/components/footer/z-footer-social/styles.css +0 -23
  249. package/dist/collection/components/icons/z-icon/index.js +0 -110
  250. package/dist/collection/components/icons/z-icon/styles.css +0 -14
  251. package/dist/collection/components/icons/z-icon-package/index.js +0 -20
  252. package/dist/collection/components/icons/z-icon-package/styles.css +0 -16
  253. package/dist/collection/components/indicators/z-stepper/index.js +0 -17
  254. package/dist/collection/components/indicators/z-stepper/styles.css +0 -19
  255. package/dist/collection/components/indicators/z-stepper-item/index.js +0 -93
  256. package/dist/collection/components/indicators/z-stepper-item/styles.css +0 -115
  257. package/dist/collection/components/inputs/z-combobox/index.js +0 -480
  258. package/dist/collection/components/inputs/z-combobox/styles.css +0 -148
  259. package/dist/collection/components/inputs/z-input/index.js +0 -821
  260. package/dist/collection/components/inputs/z-input/styles.css +0 -304
  261. package/dist/collection/components/inputs/z-input-label/index.js +0 -72
  262. package/dist/collection/components/inputs/z-input-label/styles.css +0 -16
  263. package/dist/collection/components/inputs/z-input-message/index.js +0 -64
  264. package/dist/collection/components/inputs/z-input-message/styles.css +0 -33
  265. package/dist/collection/components/inputs/z-select/index.js +0 -647
  266. package/dist/collection/components/inputs/z-select/styles.css +0 -131
  267. package/dist/collection/components/list/z-list/index.js +0 -57
  268. package/dist/collection/components/list/z-list/styles.css +0 -7
  269. package/dist/collection/components/list/z-list-element/index.js +0 -439
  270. package/dist/collection/components/list/z-list-element/styles.css +0 -133
  271. package/dist/collection/components/list/z-list-group/index.js +0 -144
  272. package/dist/collection/components/list/z-list-group/styles.css +0 -22
  273. package/dist/collection/components/list/z-toast-notification-list/index.js +0 -97
  274. package/dist/collection/components/list/z-toast-notification-list/styles.css +0 -107
  275. package/dist/collection/components/logo/z-logo/index.js +0 -128
  276. package/dist/collection/components/logo/z-logo/styles.css +0 -29
  277. package/dist/collection/components/modal/z-modal/index.js +0 -160
  278. package/dist/collection/components/modal/z-modal/styles.css +0 -185
  279. package/dist/collection/components/modal/z-modal-login/index.js +0 -272
  280. package/dist/collection/components/modal/z-modal-login/styles.css +0 -159
  281. package/dist/collection/components/navigation/z-app-header/index.js +0 -267
  282. package/dist/collection/components/navigation/z-app-header/styles.css +0 -445
  283. package/dist/collection/components/navigation/z-app-switcher/index.js +0 -70
  284. package/dist/collection/components/navigation/z-app-switcher/styles.css +0 -35
  285. package/dist/collection/components/navigation/z-app-topbar/index.js +0 -156
  286. package/dist/collection/components/navigation/z-app-topbar/styles.css +0 -71
  287. package/dist/collection/components/navigation/z-link/index.js +0 -309
  288. package/dist/collection/components/navigation/z-link/styles.css +0 -160
  289. package/dist/collection/components/navigation/z-menu/index.js +0 -223
  290. package/dist/collection/components/navigation/z-menu/styles.css +0 -149
  291. package/dist/collection/components/navigation/z-menu-dropdown/index.js +0 -125
  292. package/dist/collection/components/navigation/z-menu-dropdown/styles.css +0 -146
  293. package/dist/collection/components/navigation/z-menu-section/index.js +0 -109
  294. package/dist/collection/components/navigation/z-menu-section/styles.css +0 -91
  295. package/dist/collection/components/navigation/z-navigation-tab/index.js +0 -151
  296. package/dist/collection/components/navigation/z-navigation-tab/styles.css +0 -113
  297. package/dist/collection/components/navigation/z-navigation-tabs/index.js +0 -179
  298. package/dist/collection/components/navigation/z-navigation-tabs/styles.css +0 -117
  299. package/dist/collection/components/navigation/z-user-dropdown/index.js +0 -252
  300. package/dist/collection/components/navigation/z-user-dropdown/styles.css +0 -315
  301. package/dist/collection/components/notification/z-candybar/index.js +0 -18
  302. package/dist/collection/components/notification/z-candybar/styles.css +0 -61
  303. package/dist/collection/components/notification/z-cookiebar/index.js +0 -111
  304. package/dist/collection/components/notification/z-cookiebar/styles.css +0 -109
  305. package/dist/collection/components/notification/z-info-box/index.js +0 -79
  306. package/dist/collection/components/notification/z-info-box/styles.css +0 -23
  307. package/dist/collection/components/notification/z-notification/index.js +0 -171
  308. package/dist/collection/components/notification/z-notification/styles.css +0 -93
  309. package/dist/collection/components/notification/z-toast-notification/index.js +0 -402
  310. package/dist/collection/components/notification/z-toast-notification/styles.css +0 -247
  311. package/dist/collection/components/notification/z-tooltip/styles.css +0 -128
  312. package/dist/collection/components/pagination/z-pagination-bar/index.js +0 -278
  313. package/dist/collection/components/pagination/z-pagination-bar/styles.css +0 -23
  314. package/dist/collection/components/pagination/z-pagination-page/index.js +0 -129
  315. package/dist/collection/components/pagination/z-pagination-page/styles.css +0 -57
  316. package/dist/collection/components/panel/z-panel-elem/index.js +0 -193
  317. package/dist/collection/components/panel/z-panel-elem/styles.css +0 -39
  318. package/dist/collection/components/typography/z-body/index.js +0 -66
  319. package/dist/collection/components/typography/z-heading/index.js +0 -66
  320. package/dist/collection/components/typography/z-typography/index.js +0 -84
  321. package/dist/collection/components/typography/z-typography/styles.css +0 -61
  322. package/dist/collection/components/z-avatar/index.js +0 -137
  323. package/dist/collection/components/z-avatar/styles.css +0 -35
  324. package/dist/collection/components/z-card/index.js +0 -153
  325. package/dist/collection/components/z-card/styles.css +0 -188
  326. package/dist/collection/components/z-contextual-menu/index.js +0 -122
  327. package/dist/collection/components/z-contextual-menu/styles.css +0 -45
  328. package/dist/collection/components/z-divider/index.js +0 -89
  329. package/dist/collection/components/z-divider/styles.css +0 -37
  330. package/dist/collection/components/z-ghost-loading/index.js +0 -14
  331. package/dist/collection/components/z-ghost-loading/styles.css +0 -34
  332. package/dist/collection/components/z-popover/index.js +0 -274
  333. package/dist/collection/components/z-popover/styles.css +0 -236
  334. package/dist/collection/components/z-status-tag/index.js +0 -125
  335. package/dist/collection/components/z-status-tag/styles.css +0 -133
  336. package/dist/collection/constants/icons.js +0 -6
  337. package/dist/collection/index.js +0 -5
  338. package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +0 -119
  339. package/dist/collection/snowflakes/myz/card/z-myz-card/styles.css +0 -38
  340. package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +0 -148
  341. package/dist/collection/snowflakes/myz/card/z-myz-card-alert/styles.css +0 -62
  342. package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +0 -20
  343. package/dist/collection/snowflakes/myz/card/z-myz-card-body/styles.css +0 -13
  344. package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +0 -87
  345. package/dist/collection/snowflakes/myz/card/z-myz-card-cover/styles.css +0 -11
  346. package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +0 -177
  347. package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/styles.css +0 -85
  348. package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +0 -190
  349. package/dist/collection/snowflakes/myz/card/z-myz-card-footer/styles.css +0 -137
  350. package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +0 -23
  351. package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/styles.css +0 -32
  352. package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +0 -101
  353. package/dist/collection/snowflakes/myz/card/z-myz-card-header/styles.css +0 -46
  354. package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +0 -74
  355. package/dist/collection/snowflakes/myz/card/z-myz-card-icon/styles.css +0 -70
  356. package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +0 -213
  357. package/dist/collection/snowflakes/myz/card/z-myz-card-info/styles.css +0 -124
  358. package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +0 -53
  359. package/dist/collection/snowflakes/myz/card/z-myz-card-list/styles.css +0 -41
  360. package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +0 -70
  361. package/dist/collection/snowflakes/myz/list/z-myz-list/styles.css +0 -4
  362. package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +0 -188
  363. package/dist/collection/snowflakes/myz/list/z-myz-list-item/styles.css +0 -48
  364. package/dist/collection/snowflakes/myz/pocket/z-messages-pocket/index.js +0 -121
  365. package/dist/collection/snowflakes/myz/pocket/z-messages-pocket/styles.css +0 -106
  366. package/dist/collection/snowflakes/myz/pocket/z-pocket/index.js +0 -181
  367. package/dist/collection/snowflakes/myz/pocket/z-pocket/styles.css +0 -56
  368. package/dist/collection/snowflakes/myz/pocket/z-pocket-body/index.js +0 -77
  369. package/dist/collection/snowflakes/myz/pocket/z-pocket-body/styles.css +0 -49
  370. package/dist/collection/snowflakes/myz/pocket/z-pocket-header/index.js +0 -86
  371. package/dist/collection/snowflakes/myz/pocket/z-pocket-header/styles.css +0 -40
  372. package/dist/collection/snowflakes/myz/pocket/z-pocket-message/index.js +0 -23
  373. package/dist/collection/snowflakes/myz/pocket/z-pocket-message/styles.css +0 -53
  374. package/dist/collection/snowflakes/myz/topbar/index.js +0 -428
  375. package/dist/collection/snowflakes/myz/topbar/styles.css +0 -594
  376. package/dist/collection/snowflakes/myz/z-alert/index.js +0 -42
  377. package/dist/collection/snowflakes/myz/z-alert/styles.css +0 -28
  378. package/dist/collection/snowflakes/myz/z-otp/index.js +0 -114
  379. package/dist/collection/snowflakes/myz/z-otp/styles.css +0 -47
  380. package/dist/collection/snowflakes/myz/z-slideshow/index.js +0 -165
  381. package/dist/collection/snowflakes/myz/z-slideshow/styles.css +0 -128
  382. package/dist/collection/snowflakes/registro-table/z-registro-table/index.js +0 -365
  383. package/dist/collection/snowflakes/registro-table/z-registro-table/styles.css +0 -166
  384. package/dist/collection/snowflakes/registro-table/z-registro-table-body/index.js +0 -19
  385. package/dist/collection/snowflakes/registro-table/z-registro-table-body/styles.css +0 -9
  386. package/dist/collection/snowflakes/registro-table/z-registro-table-cell/index.js +0 -58
  387. package/dist/collection/snowflakes/registro-table/z-registro-table-cell/styles.css +0 -39
  388. package/dist/collection/snowflakes/registro-table/z-registro-table-empty-box/index.js +0 -69
  389. package/dist/collection/snowflakes/registro-table/z-registro-table-empty-box/styles.css +0 -24
  390. package/dist/collection/snowflakes/registro-table/z-registro-table-expanded-row/index.js +0 -36
  391. package/dist/collection/snowflakes/registro-table/z-registro-table-expanded-row/styles.css +0 -16
  392. package/dist/collection/snowflakes/registro-table/z-registro-table-footer/index.js +0 -18
  393. package/dist/collection/snowflakes/registro-table/z-registro-table-footer/styles.css +0 -5
  394. package/dist/collection/snowflakes/registro-table/z-registro-table-head/index.js +0 -18
  395. package/dist/collection/snowflakes/registro-table/z-registro-table-head/styles.css +0 -5
  396. package/dist/collection/snowflakes/registro-table/z-registro-table-header/index.js +0 -240
  397. package/dist/collection/snowflakes/registro-table/z-registro-table-header/styles.css +0 -67
  398. package/dist/collection/snowflakes/registro-table/z-registro-table-header-row/index.js +0 -37
  399. package/dist/collection/snowflakes/registro-table/z-registro-table-header-row/styles.css +0 -13
  400. package/dist/collection/snowflakes/registro-table/z-registro-table-row/index.js +0 -86
  401. package/dist/collection/snowflakes/registro-table/z-registro-table-row/styles.css +0 -54
  402. package/dist/collection/snowflakes/registro-table/z-registro-table-sticky-footer/index.js +0 -17
  403. package/dist/collection/snowflakes/registro-table/z-registro-table-sticky-footer/styles.css +0 -11
  404. package/dist/collection/themes/index.story.js +0 -18
  405. package/dist/esm/index-fa9e549c.js +0 -1666
  406. package/dist/esm/index.js +0 -9
  407. package/dist/esm/loader.js +0 -17
  408. package/dist/esm/polyfills/core-js.js +0 -11
  409. package/dist/esm/polyfills/css-shim.js +0 -1
  410. package/dist/esm/polyfills/dom.js +0 -79
  411. package/dist/esm/polyfills/es5-html-element.js +0 -1
  412. package/dist/esm/polyfills/index.js +0 -34
  413. package/dist/esm/polyfills/system.js +0 -6
  414. package/dist/esm/web-components-library.js +0 -17
  415. package/dist/esm/z-alert_66.entry.js +0 -3667
  416. package/dist/esm/z-pocket_3.entry.js +0 -118
  417. package/dist/index.cjs.js +0 -1
  418. package/dist/index.js +0 -1
  419. package/dist/web-components-library/p-017370c7.entry.js +0 -1
  420. package/dist/web-components-library/p-02e55441.entry.js +0 -1
  421. package/dist/web-components-library/p-140cc18f.entry.js +0 -1
  422. package/dist/web-components-library/p-18f6f866.entry.js +0 -1
  423. package/dist/web-components-library/p-1c72783c.entry.js +0 -1
  424. package/dist/web-components-library/p-231e7797.entry.js +0 -1
  425. package/dist/web-components-library/p-2f354863.entry.js +0 -1
  426. package/dist/web-components-library/p-35b1f338.entry.js +0 -1
  427. package/dist/web-components-library/p-3cdefa38.entry.js +0 -1
  428. package/dist/web-components-library/p-4a6ec3df.entry.js +0 -1
  429. package/dist/web-components-library/p-5cdcaa8c.entry.js +0 -1
  430. package/dist/web-components-library/p-8902f400.entry.js +0 -7
  431. package/dist/web-components-library/p-8ad12683.entry.js +0 -1
  432. package/dist/web-components-library/p-904a85e4.js +0 -1
  433. package/dist/web-components-library/p-96e3aec6.entry.js +0 -1
  434. package/dist/web-components-library/p-9912e411.js +0 -7
  435. package/dist/web-components-library/p-b80081c9.entry.js +0 -1
  436. package/dist/web-components-library/p-c7af96eb.entry.js +0 -1
  437. package/dist/web-components-library/p-d4830f32.entry.js +0 -1
  438. package/dist/web-components-library/p-d63b9ed3.js +0 -1
  439. package/dist/web-components-library/p-d69e14fb.js +0 -1
  440. package/dist/web-components-library/p-e7304c42.js +0 -1
  441. package/dist/web-components-library/p-f113a03a.entry.js +0 -1
  442. package/dist/web-components-library/p-f83347fd.entry.js +0 -1
  443. package/dist/web-components-library/p-ff6b02d1.entry.js +0 -1
  444. package/www/build/p-017370c7.entry.js +0 -1
  445. package/www/build/p-02e55441.entry.js +0 -1
  446. package/www/build/p-140cc18f.entry.js +0 -1
  447. package/www/build/p-18f6f866.entry.js +0 -1
  448. package/www/build/p-1c72783c.entry.js +0 -1
  449. package/www/build/p-231e7797.entry.js +0 -1
  450. package/www/build/p-2f354863.entry.js +0 -1
  451. package/www/build/p-35b1f338.entry.js +0 -1
  452. package/www/build/p-3cdefa38.entry.js +0 -1
  453. package/www/build/p-4a6ec3df.entry.js +0 -1
  454. package/www/build/p-5cdcaa8c.entry.js +0 -1
  455. package/www/build/p-7206f897.js +0 -1
  456. package/www/build/p-8902f400.entry.js +0 -7
  457. package/www/build/p-8ad12683.entry.js +0 -1
  458. package/www/build/p-904a85e4.js +0 -1
  459. package/www/build/p-96e3aec6.entry.js +0 -1
  460. package/www/build/p-9912e411.js +0 -7
  461. package/www/build/p-b80081c9.entry.js +0 -1
  462. package/www/build/p-c7af96eb.entry.js +0 -1
  463. package/www/build/p-d4830f32.entry.js +0 -1
  464. package/www/build/p-d63b9ed3.js +0 -1
  465. package/www/build/p-d69e14fb.js +0 -1
  466. package/www/build/p-e7304c42.js +0 -1
  467. package/www/build/p-ea943cbd.css +0 -1
  468. package/www/build/p-f113a03a.entry.js +0 -1
  469. package/www/build/p-f83347fd.entry.js +0 -1
  470. package/www/build/p-ff6b02d1.entry.js +0 -1
@@ -1,1694 +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 = 'web-components-library';
24
-
25
- let scopeId;
26
- let contentRef;
27
- let hostTagName;
28
- let useNativeShadowDom = false;
29
- let checkSlotFallbackVisibility = false;
30
- let checkSlotRelocate = false;
31
- let isSvgMode = false;
32
- let queuePending = false;
33
- const win = typeof window !== 'undefined' ? window : {};
34
- const doc = win.document || { head: {} };
35
- const plt = {
36
- $flags$: 0,
37
- $resourcesUrl$: '',
38
- jmp: h => h(),
39
- raf: h => requestAnimationFrame(h),
40
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
41
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
42
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
43
- };
44
- const promiseResolve = (v) => Promise.resolve(v);
45
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
46
- try {
47
- new CSSStyleSheet();
48
- return typeof (new CSSStyleSheet()).replace === 'function';
49
- }
50
- catch (e) { }
51
- return false;
52
- })()
53
- ;
54
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
55
- if (listeners) {
56
- listeners.map(([flags, name, method]) => {
57
- const target = getHostListenerTarget(elm, flags) ;
58
- const handler = hostListenerProxy(hostRef, method);
59
- const opts = hostListenerOpts(flags);
60
- plt.ael(target, name, handler, opts);
61
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
62
- });
63
- }
64
- };
65
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
66
- try {
67
- {
68
- if (hostRef.$flags$ & 256 /* isListenReady */) {
69
- // instance is ready, let's call it's member method for this event
70
- hostRef.$lazyInstance$[methodName](ev);
71
- }
72
- else {
73
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
74
- }
75
- }
76
- }
77
- catch (e) {
78
- consoleError(e);
79
- }
80
- };
81
- const getHostListenerTarget = (elm, flags) => {
82
- if (flags & 4 /* TargetDocument */)
83
- return doc;
84
- if (flags & 8 /* TargetWindow */)
85
- return win;
86
- if (flags & 16 /* TargetBody */)
87
- return doc.body;
88
- return elm;
89
- };
90
- // prettier-ignore
91
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
92
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
93
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
94
- const createTime = (fnName, tagName = '') => {
95
- {
96
- return () => {
97
- return;
98
- };
99
- }
100
- };
101
- const uniqueTime = (key, measureText) => {
102
- {
103
- return () => {
104
- return;
105
- };
106
- }
107
- };
108
- const rootAppliedStyles = new WeakMap();
109
- const registerStyle = (scopeId, cssText, allowCS) => {
110
- let style = styles.get(scopeId);
111
- if (supportsConstructibleStylesheets && allowCS) {
112
- style = (style || new CSSStyleSheet());
113
- style.replace(cssText);
114
- }
115
- else {
116
- style = cssText;
117
- }
118
- styles.set(scopeId, style);
119
- };
120
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
121
- let scopeId = getScopeId(cmpMeta);
122
- let style = styles.get(scopeId);
123
- // if an element is NOT connected then getRootNode() will return the wrong root node
124
- // so the fallback is to always use the document for the root node in those cases
125
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
126
- if (style) {
127
- if (typeof style === 'string') {
128
- styleContainerNode = styleContainerNode.head || styleContainerNode;
129
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
130
- let styleElm;
131
- if (!appliedStyles) {
132
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
133
- }
134
- if (!appliedStyles.has(scopeId)) {
135
- {
136
- {
137
- styleElm = doc.createElement('style');
138
- styleElm.innerHTML = style;
139
- }
140
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
141
- }
142
- if (appliedStyles) {
143
- appliedStyles.add(scopeId);
144
- }
145
- }
146
- }
147
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
148
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
149
- }
150
- }
151
- return scopeId;
152
- };
153
- const attachStyles = (hostRef) => {
154
- const cmpMeta = hostRef.$cmpMeta$;
155
- const elm = hostRef.$hostElement$;
156
- const flags = cmpMeta.$flags$;
157
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
158
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
159
- if (flags & 10 /* needsScopedEncapsulation */) {
160
- // only required when we're NOT using native shadow dom (slot)
161
- // or this browser doesn't support native shadow dom
162
- // and this host element was NOT created with SSR
163
- // let's pick out the inner content for slot projection
164
- // create a node to represent where the original
165
- // content was first placed, which is useful later on
166
- // DOM WRITE!!
167
- elm['s-sc'] = scopeId;
168
- elm.classList.add(scopeId + '-h');
169
- if (flags & 2 /* scopedCssEncapsulation */) {
170
- elm.classList.add(scopeId + '-s');
171
- }
172
- }
173
- endAttachStyles();
174
- };
175
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
176
- /**
177
- * Default style mode id
178
- */
179
- /**
180
- * Reusable empty obj/array
181
- * Don't add values to these!!
182
- */
183
- const EMPTY_OBJ = {};
184
- /**
185
- * Namespaces
186
- */
187
- const SVG_NS = 'http://www.w3.org/2000/svg';
188
- const HTML_NS = 'http://www.w3.org/1999/xhtml';
189
- const isDef = (v) => v != null;
190
- const isComplexType = (o) => {
191
- // https://jsperf.com/typeof-fn-object/5
192
- o = typeof o;
193
- return o === 'object' || o === 'function';
194
- };
195
- /**
196
- * Production h() function based on Preact by
197
- * Jason Miller (@developit)
198
- * Licensed under the MIT License
199
- * https://github.com/developit/preact/blob/master/LICENSE
200
- *
201
- * Modified for Stencil's compiler and vdom
202
- */
203
- // const stack: any[] = [];
204
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
205
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
206
- const h = (nodeName, vnodeData, ...children) => {
207
- let child = null;
208
- let key = null;
209
- let slotName = null;
210
- let simple = false;
211
- let lastSimple = false;
212
- let vNodeChildren = [];
213
- const walk = (c) => {
214
- for (let i = 0; i < c.length; i++) {
215
- child = c[i];
216
- if (Array.isArray(child)) {
217
- walk(child);
218
- }
219
- else if (child != null && typeof child !== 'boolean') {
220
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
221
- child = String(child);
222
- }
223
- if (simple && lastSimple) {
224
- // If the previous child was simple (string), we merge both
225
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
226
- }
227
- else {
228
- // Append a new vNode, if it's text, we create a text vNode
229
- vNodeChildren.push(simple ? newVNode(null, child) : child);
230
- }
231
- lastSimple = simple;
232
- }
233
- }
234
- };
235
- walk(children);
236
- if (vnodeData) {
237
- // normalize class / classname attributes
238
- if (vnodeData.key) {
239
- key = vnodeData.key;
240
- }
241
- if (vnodeData.name) {
242
- slotName = vnodeData.name;
243
- }
244
- {
245
- const classData = vnodeData.className || vnodeData.class;
246
- if (classData) {
247
- vnodeData.class =
248
- typeof classData !== 'object'
249
- ? classData
250
- : Object.keys(classData)
251
- .filter(k => classData[k])
252
- .join(' ');
253
- }
254
- }
255
- }
256
- const vnode = newVNode(nodeName, null);
257
- vnode.$attrs$ = vnodeData;
258
- if (vNodeChildren.length > 0) {
259
- vnode.$children$ = vNodeChildren;
260
- }
261
- {
262
- vnode.$key$ = key;
263
- }
264
- {
265
- vnode.$name$ = slotName;
266
- }
267
- return vnode;
268
- };
269
- const newVNode = (tag, text) => {
270
- const vnode = {
271
- $flags$: 0,
272
- $tag$: tag,
273
- $text$: text,
274
- $elm$: null,
275
- $children$: null,
276
- };
277
- {
278
- vnode.$attrs$ = null;
279
- }
280
- {
281
- vnode.$key$ = null;
282
- }
283
- {
284
- vnode.$name$ = null;
285
- }
286
- return vnode;
287
- };
288
- const Host = {};
289
- const isHost = (node) => node && node.$tag$ === Host;
290
- /**
291
- * Production setAccessor() function based on Preact by
292
- * Jason Miller (@developit)
293
- * Licensed under the MIT License
294
- * https://github.com/developit/preact/blob/master/LICENSE
295
- *
296
- * Modified for Stencil's compiler and vdom
297
- */
298
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
299
- if (oldValue !== newValue) {
300
- let isProp = isMemberInElement(elm, memberName);
301
- let ln = memberName.toLowerCase();
302
- if (memberName === 'class') {
303
- const classList = elm.classList;
304
- const oldClasses = parseClassList(oldValue);
305
- const newClasses = parseClassList(newValue);
306
- classList.remove(...oldClasses.filter(c => c && !newClasses.includes(c)));
307
- classList.add(...newClasses.filter(c => c && !oldClasses.includes(c)));
308
- }
309
- else if (memberName === 'style') {
310
- // update style attribute, css properties and values
311
- {
312
- for (const prop in oldValue) {
313
- if (!newValue || newValue[prop] == null) {
314
- if (prop.includes('-')) {
315
- elm.style.removeProperty(prop);
316
- }
317
- else {
318
- elm.style[prop] = '';
319
- }
320
- }
321
- }
322
- }
323
- for (const prop in newValue) {
324
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
325
- if (prop.includes('-')) {
326
- elm.style.setProperty(prop, newValue[prop]);
327
- }
328
- else {
329
- elm.style[prop] = newValue[prop];
330
- }
331
- }
332
- }
333
- }
334
- else if (memberName === 'key')
335
- ;
336
- else if (memberName === 'ref') {
337
- // minifier will clean this up
338
- if (newValue) {
339
- newValue(elm);
340
- }
341
- }
342
- else if ((!isProp ) && memberName[0] === 'o' && memberName[1] === 'n') {
343
- // Event Handlers
344
- // so if the member name starts with "on" and the 3rd characters is
345
- // a capital letter, and it's not already a member on the element,
346
- // then we're assuming it's an event listener
347
- if (memberName[2] === '-') {
348
- // on- prefixed events
349
- // allows to be explicit about the dom event to listen without any magic
350
- // under the hood:
351
- // <my-cmp on-click> // listens for "click"
352
- // <my-cmp on-Click> // listens for "Click"
353
- // <my-cmp on-ionChange> // listens for "ionChange"
354
- // <my-cmp on-EVENTS> // listens for "EVENTS"
355
- memberName = memberName.slice(3);
356
- }
357
- else if (isMemberInElement(win, ln)) {
358
- // standard event
359
- // the JSX attribute could have been "onMouseOver" and the
360
- // member name "onmouseover" is on the window's prototype
361
- // so let's add the listener "mouseover", which is all lowercased
362
- memberName = ln.slice(2);
363
- }
364
- else {
365
- // custom event
366
- // the JSX attribute could have been "onMyCustomEvent"
367
- // so let's trim off the "on" prefix and lowercase the first character
368
- // and add the listener "myCustomEvent"
369
- // except for the first character, we keep the event name case
370
- memberName = ln[2] + memberName.slice(3);
371
- }
372
- if (oldValue) {
373
- plt.rel(elm, memberName, oldValue, false);
374
- }
375
- if (newValue) {
376
- plt.ael(elm, memberName, newValue, false);
377
- }
378
- }
379
- else {
380
- // Set property if it exists and it's not a SVG
381
- const isComplex = isComplexType(newValue);
382
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
383
- try {
384
- if (!elm.tagName.includes('-')) {
385
- let n = newValue == null ? '' : newValue;
386
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
387
- if (memberName === 'list') {
388
- isProp = false;
389
- // tslint:disable-next-line: triple-equals
390
- }
391
- else if (oldValue == null || elm[memberName] != n) {
392
- elm[memberName] = n;
393
- }
394
- }
395
- else {
396
- elm[memberName] = newValue;
397
- }
398
- }
399
- catch (e) { }
400
- }
401
- /**
402
- * Need to manually update attribute if:
403
- * - memberName is not an attribute
404
- * - if we are rendering the host element in order to reflect attribute
405
- * - if it's a SVG, since properties might not work in <svg>
406
- * - if the newValue is null/undefined or 'false'.
407
- */
408
- let xlink = false;
409
- {
410
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
411
- memberName = ln;
412
- xlink = true;
413
- }
414
- }
415
- if (newValue == null || newValue === false) {
416
- if (newValue !== false || elm.getAttribute(memberName) === '') {
417
- if (xlink) {
418
- elm.removeAttributeNS(XLINK_NS, memberName);
419
- }
420
- else {
421
- elm.removeAttribute(memberName);
422
- }
423
- }
424
- }
425
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
426
- newValue = newValue === true ? '' : newValue;
427
- if (xlink) {
428
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
429
- }
430
- else {
431
- elm.setAttribute(memberName, newValue);
432
- }
433
- }
434
- }
435
- }
436
- };
437
- const parseClassListRegex = /\s/;
438
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
439
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
440
- // if the element passed in is a shadow root, which is a document fragment
441
- // then we want to be adding attrs/props to the shadow root's "host" element
442
- // if it's not a shadow root, then we add attrs/props to the same element
443
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
444
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
445
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
446
- {
447
- // remove attributes no longer present on the vnode by setting them to undefined
448
- for (memberName in oldVnodeAttrs) {
449
- if (!(memberName in newVnodeAttrs)) {
450
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
451
- }
452
- }
453
- }
454
- // add new & update changed attributes
455
- for (memberName in newVnodeAttrs) {
456
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
457
- }
458
- };
459
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
460
- // tslint:disable-next-line: prefer-const
461
- let newVNode = newParentVNode.$children$[childIndex];
462
- let i = 0;
463
- let elm;
464
- let childNode;
465
- let oldVNode;
466
- if (!useNativeShadowDom) {
467
- // remember for later we need to check to relocate nodes
468
- checkSlotRelocate = true;
469
- if (newVNode.$tag$ === 'slot') {
470
- if (scopeId) {
471
- // scoped css needs to add its scoped id to the parent element
472
- parentElm.classList.add(scopeId + '-s');
473
- }
474
- newVNode.$flags$ |= newVNode.$children$
475
- ? // slot element has fallback content
476
- 2 /* isSlotFallback */
477
- : // slot element does not have fallback content
478
- 1 /* isSlotReference */;
479
- }
480
- }
481
- if (newVNode.$text$ !== null) {
482
- // create text node
483
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
484
- }
485
- else if (newVNode.$flags$ & 1 /* isSlotReference */) {
486
- // create a slot reference node
487
- elm = newVNode.$elm$ = doc.createTextNode('');
488
- }
489
- else {
490
- if (!isSvgMode) {
491
- isSvgMode = newVNode.$tag$ === 'svg';
492
- }
493
- // create element
494
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */ ? 'slot-fb' : newVNode.$tag$)
495
- );
496
- if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
497
- isSvgMode = false;
498
- }
499
- // add css classes, attrs, props, listeners, etc.
500
- {
501
- updateElement(null, newVNode, isSvgMode);
502
- }
503
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
504
- // if there is a scopeId and this is the initial render
505
- // then let's add the scopeId as a css class
506
- elm.classList.add((elm['s-si'] = scopeId));
507
- }
508
- if (newVNode.$children$) {
509
- for (i = 0; i < newVNode.$children$.length; ++i) {
510
- // create the node
511
- childNode = createElm(oldParentVNode, newVNode, i, elm);
512
- // return node could have been null
513
- if (childNode) {
514
- // append our new node
515
- elm.appendChild(childNode);
516
- }
517
- }
518
- }
519
- {
520
- if (newVNode.$tag$ === 'svg') {
521
- // Only reset the SVG context when we're exiting <svg> element
522
- isSvgMode = false;
523
- }
524
- else if (elm.tagName === 'foreignObject') {
525
- // Reenter SVG context when we're exiting <foreignObject> element
526
- isSvgMode = true;
527
- }
528
- }
529
- }
530
- {
531
- elm['s-hn'] = hostTagName;
532
- if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
533
- // remember the content reference comment
534
- elm['s-sr'] = true;
535
- // remember the content reference comment
536
- elm['s-cr'] = contentRef;
537
- // remember the slot name, or empty string for default slot
538
- elm['s-sn'] = newVNode.$name$ || '';
539
- // check if we've got an old vnode for this slot
540
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
541
- if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
542
- // we've got an old slot vnode and the wrapper is being replaced
543
- // so let's move the old slot content back to it's original location
544
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
545
- }
546
- }
547
- }
548
- return elm;
549
- };
550
- const putBackInOriginalLocation = (parentElm, recursive) => {
551
- plt.$flags$ |= 1 /* isTmpDisconnected */;
552
- const oldSlotChildNodes = parentElm.childNodes;
553
- for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
554
- const childNode = oldSlotChildNodes[i];
555
- if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
556
- // // this child node in the old element is from another component
557
- // // remove this node from the old slot's parent
558
- // childNode.remove();
559
- // and relocate it back to it's original location
560
- parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
561
- // remove the old original location comment entirely
562
- // later on the patch function will know what to do
563
- // and move this to the correct spot in need be
564
- childNode['s-ol'].remove();
565
- childNode['s-ol'] = undefined;
566
- checkSlotRelocate = true;
567
- }
568
- if (recursive) {
569
- putBackInOriginalLocation(childNode, recursive);
570
- }
571
- }
572
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
573
- };
574
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
575
- let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
576
- let childNode;
577
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
578
- containerElm = containerElm.shadowRoot;
579
- }
580
- for (; startIdx <= endIdx; ++startIdx) {
581
- if (vnodes[startIdx]) {
582
- childNode = createElm(null, parentVNode, startIdx, parentElm);
583
- if (childNode) {
584
- vnodes[startIdx].$elm$ = childNode;
585
- containerElm.insertBefore(childNode, referenceNode(before) );
586
- }
587
- }
588
- }
589
- };
590
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
591
- for (; startIdx <= endIdx; ++startIdx) {
592
- if ((vnode = vnodes[startIdx])) {
593
- elm = vnode.$elm$;
594
- callNodeRefs(vnode);
595
- {
596
- // we're removing this element
597
- // so it's possible we need to show slot fallback content now
598
- checkSlotFallbackVisibility = true;
599
- if (elm['s-ol']) {
600
- // remove the original location comment
601
- elm['s-ol'].remove();
602
- }
603
- else {
604
- // it's possible that child nodes of the node
605
- // that's being removed are slot nodes
606
- putBackInOriginalLocation(elm, true);
607
- }
608
- }
609
- // remove the vnode's element from the dom
610
- elm.remove();
611
- }
612
- }
613
- };
614
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
615
- let oldStartIdx = 0;
616
- let newStartIdx = 0;
617
- let idxInOld = 0;
618
- let i = 0;
619
- let oldEndIdx = oldCh.length - 1;
620
- let oldStartVnode = oldCh[0];
621
- let oldEndVnode = oldCh[oldEndIdx];
622
- let newEndIdx = newCh.length - 1;
623
- let newStartVnode = newCh[0];
624
- let newEndVnode = newCh[newEndIdx];
625
- let node;
626
- let elmToMove;
627
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
628
- if (oldStartVnode == null) {
629
- // Vnode might have been moved left
630
- oldStartVnode = oldCh[++oldStartIdx];
631
- }
632
- else if (oldEndVnode == null) {
633
- oldEndVnode = oldCh[--oldEndIdx];
634
- }
635
- else if (newStartVnode == null) {
636
- newStartVnode = newCh[++newStartIdx];
637
- }
638
- else if (newEndVnode == null) {
639
- newEndVnode = newCh[--newEndIdx];
640
- }
641
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
642
- patch(oldStartVnode, newStartVnode);
643
- oldStartVnode = oldCh[++oldStartIdx];
644
- newStartVnode = newCh[++newStartIdx];
645
- }
646
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
647
- patch(oldEndVnode, newEndVnode);
648
- oldEndVnode = oldCh[--oldEndIdx];
649
- newEndVnode = newCh[--newEndIdx];
650
- }
651
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
652
- // Vnode moved right
653
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
654
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
655
- }
656
- patch(oldStartVnode, newEndVnode);
657
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
658
- oldStartVnode = oldCh[++oldStartIdx];
659
- newEndVnode = newCh[--newEndIdx];
660
- }
661
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
662
- // Vnode moved left
663
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
664
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
665
- }
666
- patch(oldEndVnode, newStartVnode);
667
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
668
- oldEndVnode = oldCh[--oldEndIdx];
669
- newStartVnode = newCh[++newStartIdx];
670
- }
671
- else {
672
- // createKeyToOldIdx
673
- idxInOld = -1;
674
- {
675
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
676
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
677
- idxInOld = i;
678
- break;
679
- }
680
- }
681
- }
682
- if (idxInOld >= 0) {
683
- elmToMove = oldCh[idxInOld];
684
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
685
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
686
- }
687
- else {
688
- patch(elmToMove, newStartVnode);
689
- oldCh[idxInOld] = undefined;
690
- node = elmToMove.$elm$;
691
- }
692
- newStartVnode = newCh[++newStartIdx];
693
- }
694
- else {
695
- // new element
696
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
697
- newStartVnode = newCh[++newStartIdx];
698
- }
699
- if (node) {
700
- {
701
- parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
702
- }
703
- }
704
- }
705
- }
706
- if (oldStartIdx > oldEndIdx) {
707
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
708
- }
709
- else if (newStartIdx > newEndIdx) {
710
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
711
- }
712
- };
713
- const isSameVnode = (vnode1, vnode2) => {
714
- // compare if two vnode to see if they're "technically" the same
715
- // need to have the same element tag, and same key to be the same
716
- if (vnode1.$tag$ === vnode2.$tag$) {
717
- if (vnode1.$tag$ === 'slot') {
718
- return vnode1.$name$ === vnode2.$name$;
719
- }
720
- {
721
- return vnode1.$key$ === vnode2.$key$;
722
- }
723
- }
724
- return false;
725
- };
726
- const referenceNode = (node) => {
727
- // this node was relocated to a new location in the dom
728
- // because of some other component's slot
729
- // but we still have an html comment in place of where
730
- // it's original location was according to it's original vdom
731
- return (node && node['s-ol']) || node;
732
- };
733
- const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
734
- const patch = (oldVNode, newVNode) => {
735
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
736
- const oldChildren = oldVNode.$children$;
737
- const newChildren = newVNode.$children$;
738
- const tag = newVNode.$tag$;
739
- const text = newVNode.$text$;
740
- let defaultHolder;
741
- if (text === null) {
742
- {
743
- // test if we're rendering an svg element, or still rendering nodes inside of one
744
- // only add this to the when the compiler sees we're using an svg somewhere
745
- isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
746
- }
747
- // element node
748
- {
749
- if (tag === 'slot')
750
- ;
751
- else {
752
- // either this is the first render of an element OR it's an update
753
- // AND we already know it's possible it could have changed
754
- // this updates the element's css classes, attrs, props, listeners, etc.
755
- updateElement(oldVNode, newVNode, isSvgMode);
756
- }
757
- }
758
- if (oldChildren !== null && newChildren !== null) {
759
- // looks like there's child vnodes for both the old and new vnodes
760
- updateChildren(elm, oldChildren, newVNode, newChildren);
761
- }
762
- else if (newChildren !== null) {
763
- // no old child vnodes, but there are new child vnodes to add
764
- if (oldVNode.$text$ !== null) {
765
- // the old vnode was text, so be sure to clear it out
766
- elm.textContent = '';
767
- }
768
- // add the new vnode children
769
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
770
- }
771
- else if (oldChildren !== null) {
772
- // no new child vnodes, but there are old child vnodes to remove
773
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
774
- }
775
- if (isSvgMode && tag === 'svg') {
776
- isSvgMode = false;
777
- }
778
- }
779
- else if ((defaultHolder = elm['s-cr'])) {
780
- // this element has slotted content
781
- defaultHolder.parentNode.textContent = text;
782
- }
783
- else if (oldVNode.$text$ !== text) {
784
- // update the text content for the text only vnode
785
- // and also only if the text is different than before
786
- elm.data = text;
787
- }
788
- };
789
- const updateFallbackSlotVisibility = (elm) => {
790
- // tslint:disable-next-line: prefer-const
791
- let childNodes = elm.childNodes;
792
- let childNode;
793
- let i;
794
- let ilen;
795
- let j;
796
- let slotNameAttr;
797
- let nodeType;
798
- for (i = 0, ilen = childNodes.length; i < ilen; i++) {
799
- childNode = childNodes[i];
800
- if (childNode.nodeType === 1 /* ElementNode */) {
801
- if (childNode['s-sr']) {
802
- // this is a slot fallback node
803
- // get the slot name for this slot reference node
804
- slotNameAttr = childNode['s-sn'];
805
- // by default always show a fallback slot node
806
- // then hide it if there are other slots in the light dom
807
- childNode.hidden = false;
808
- for (j = 0; j < ilen; j++) {
809
- nodeType = childNodes[j].nodeType;
810
- if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
811
- // this sibling node is from a different component OR is a named fallback slot node
812
- if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
813
- childNode.hidden = true;
814
- break;
815
- }
816
- }
817
- else {
818
- // this is a default fallback slot node
819
- // any element or text node (with content)
820
- // should hide the default fallback slot node
821
- if (nodeType === 1 /* ElementNode */ ||
822
- (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
823
- childNode.hidden = true;
824
- break;
825
- }
826
- }
827
- }
828
- }
829
- // keep drilling down
830
- updateFallbackSlotVisibility(childNode);
831
- }
832
- }
833
- };
834
- const relocateNodes = [];
835
- const relocateSlotContent = (elm) => {
836
- // tslint:disable-next-line: prefer-const
837
- let childNode;
838
- let node;
839
- let hostContentNodes;
840
- let slotNameAttr;
841
- let relocateNodeData;
842
- let j;
843
- let i = 0;
844
- let childNodes = elm.childNodes;
845
- let ilen = childNodes.length;
846
- for (; i < ilen; i++) {
847
- childNode = childNodes[i];
848
- if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
849
- // first got the content reference comment node
850
- // then we got it's parent, which is where all the host content is in now
851
- hostContentNodes = node.parentNode.childNodes;
852
- slotNameAttr = childNode['s-sn'];
853
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
854
- node = hostContentNodes[j];
855
- if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
856
- // let's do some relocating to its new home
857
- // but never relocate a content reference node
858
- // that is suppose to always represent the original content location
859
- if (isNodeLocatedInSlot(node, slotNameAttr)) {
860
- // it's possible we've already decided to relocate this node
861
- relocateNodeData = relocateNodes.find(r => r.$nodeToRelocate$ === node);
862
- // made some changes to slots
863
- // let's make sure we also double check
864
- // fallbacks are correctly hidden or shown
865
- checkSlotFallbackVisibility = true;
866
- node['s-sn'] = node['s-sn'] || slotNameAttr;
867
- if (relocateNodeData) {
868
- // previously we never found a slot home for this node
869
- // but turns out we did, so let's remember it now
870
- relocateNodeData.$slotRefNode$ = childNode;
871
- }
872
- else {
873
- // add to our list of nodes to relocate
874
- relocateNodes.push({
875
- $slotRefNode$: childNode,
876
- $nodeToRelocate$: node,
877
- });
878
- }
879
- if (node['s-sr']) {
880
- relocateNodes.map(relocateNode => {
881
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
882
- relocateNodeData = relocateNodes.find(r => r.$nodeToRelocate$ === node);
883
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
884
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
885
- }
886
- }
887
- });
888
- }
889
- }
890
- else if (!relocateNodes.some(r => r.$nodeToRelocate$ === node)) {
891
- // so far this element does not have a slot home, not setting slotRefNode on purpose
892
- // if we never find a home for this element then we'll need to hide it
893
- relocateNodes.push({
894
- $nodeToRelocate$: node,
895
- });
896
- }
897
- }
898
- }
899
- }
900
- if (childNode.nodeType === 1 /* ElementNode */) {
901
- relocateSlotContent(childNode);
902
- }
903
- }
904
- };
905
- const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
906
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
907
- if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
908
- return true;
909
- }
910
- if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
911
- return true;
912
- }
913
- return false;
914
- }
915
- if (nodeToRelocate['s-sn'] === slotNameAttr) {
916
- return true;
917
- }
918
- return slotNameAttr === '';
919
- };
920
- const callNodeRefs = (vNode) => {
921
- {
922
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
923
- vNode.$children$ && vNode.$children$.map(callNodeRefs);
924
- }
925
- };
926
- const renderVdom = (hostRef, renderFnResults) => {
927
- const hostElm = hostRef.$hostElement$;
928
- const cmpMeta = hostRef.$cmpMeta$;
929
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
930
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
931
- hostTagName = hostElm.tagName;
932
- if (cmpMeta.$attrsToReflect$) {
933
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
934
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
935
- }
936
- rootVnode.$tag$ = null;
937
- rootVnode.$flags$ |= 4 /* isHost */;
938
- hostRef.$vnode$ = rootVnode;
939
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
940
- {
941
- scopeId = hostElm['s-sc'];
942
- }
943
- {
944
- contentRef = hostElm['s-cr'];
945
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
946
- // always reset
947
- checkSlotFallbackVisibility = false;
948
- }
949
- // synchronous patch
950
- patch(oldVNode, rootVnode);
951
- {
952
- // while we're moving nodes around existing nodes, temporarily disable
953
- // the disconnectCallback from working
954
- plt.$flags$ |= 1 /* isTmpDisconnected */;
955
- if (checkSlotRelocate) {
956
- relocateSlotContent(rootVnode.$elm$);
957
- let relocateData;
958
- let nodeToRelocate;
959
- let orgLocationNode;
960
- let parentNodeRef;
961
- let insertBeforeNode;
962
- let refNode;
963
- let i = 0;
964
- for (; i < relocateNodes.length; i++) {
965
- relocateData = relocateNodes[i];
966
- nodeToRelocate = relocateData.$nodeToRelocate$;
967
- if (!nodeToRelocate['s-ol']) {
968
- // add a reference node marking this node's original location
969
- // keep a reference to this node for later lookups
970
- orgLocationNode = doc.createTextNode('');
971
- orgLocationNode['s-nr'] = nodeToRelocate;
972
- nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
973
- }
974
- }
975
- for (i = 0; i < relocateNodes.length; i++) {
976
- relocateData = relocateNodes[i];
977
- nodeToRelocate = relocateData.$nodeToRelocate$;
978
- if (relocateData.$slotRefNode$) {
979
- // by default we're just going to insert it directly
980
- // after the slot reference node
981
- parentNodeRef = relocateData.$slotRefNode$.parentNode;
982
- insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
983
- orgLocationNode = nodeToRelocate['s-ol'];
984
- while ((orgLocationNode = orgLocationNode.previousSibling)) {
985
- refNode = orgLocationNode['s-nr'];
986
- if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
987
- refNode = refNode.nextSibling;
988
- if (!refNode || !refNode['s-nr']) {
989
- insertBeforeNode = refNode;
990
- break;
991
- }
992
- }
993
- }
994
- if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) || nodeToRelocate.nextSibling !== insertBeforeNode) {
995
- // we've checked that it's worth while to relocate
996
- // since that the node to relocate
997
- // has a different next sibling or parent relocated
998
- if (nodeToRelocate !== insertBeforeNode) {
999
- if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1000
- // probably a component in the index.html that doesn't have it's hostname set
1001
- nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1002
- }
1003
- // add it back to the dom but in its new home
1004
- parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1005
- }
1006
- }
1007
- }
1008
- else {
1009
- // this node doesn't have a slot home to go to, so let's hide it
1010
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1011
- nodeToRelocate.hidden = true;
1012
- }
1013
- }
1014
- }
1015
- }
1016
- if (checkSlotFallbackVisibility) {
1017
- updateFallbackSlotVisibility(rootVnode.$elm$);
1018
- }
1019
- // done moving nodes around
1020
- // allow the disconnect callback to work again
1021
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
1022
- // always reset
1023
- relocateNodes.length = 0;
1024
- }
1025
- };
1026
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
1027
- const createEvent = (ref, name, flags) => {
1028
- const elm = getElement(ref);
1029
- return {
1030
- emit: (detail) => {
1031
- return emitEvent(elm, name, {
1032
- bubbles: !!(flags & 4 /* Bubbles */),
1033
- composed: !!(flags & 2 /* Composed */),
1034
- cancelable: !!(flags & 1 /* Cancellable */),
1035
- detail,
1036
- });
1037
- },
1038
- };
1039
- };
1040
- const emitEvent = (elm, name, opts) => {
1041
- const ev = plt.ce(name, opts);
1042
- elm.dispatchEvent(ev);
1043
- return ev;
1044
- };
1045
- const attachToAncestor = (hostRef, ancestorComponent) => {
1046
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1047
- ancestorComponent['s-p'].push(new Promise(r => (hostRef.$onRenderResolve$ = r)));
1048
- }
1049
- };
1050
- const scheduleUpdate = (hostRef, isInitialLoad) => {
1051
- {
1052
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1053
- }
1054
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1055
- hostRef.$flags$ |= 512 /* needsRerender */;
1056
- return;
1057
- }
1058
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1059
- // there is no ancestor component or the ancestor component
1060
- // has already fired off its lifecycle update then
1061
- // fire off the initial update
1062
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1063
- return writeTask(dispatch) ;
1064
- };
1065
- const dispatchHooks = (hostRef, isInitialLoad) => {
1066
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1067
- const instance = hostRef.$lazyInstance$ ;
1068
- let promise;
1069
- if (isInitialLoad) {
1070
- {
1071
- hostRef.$flags$ |= 256 /* isListenReady */;
1072
- if (hostRef.$queuedListeners$) {
1073
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1074
- hostRef.$queuedListeners$ = null;
1075
- }
1076
- }
1077
- {
1078
- promise = safeCall(instance, 'componentWillLoad');
1079
- }
1080
- }
1081
- else {
1082
- {
1083
- promise = safeCall(instance, 'componentWillUpdate');
1084
- }
1085
- }
1086
- {
1087
- promise = then(promise, () => safeCall(instance, 'componentWillRender'));
1088
- }
1089
- endSchedule();
1090
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
1091
- };
1092
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
1093
- // updateComponent
1094
- const elm = hostRef.$hostElement$;
1095
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1096
- const rc = elm['s-rc'];
1097
- if (isInitialLoad) {
1098
- // DOM WRITE!
1099
- attachStyles(hostRef);
1100
- }
1101
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1102
- {
1103
- callRender(hostRef, instance);
1104
- }
1105
- if (rc) {
1106
- // ok, so turns out there are some child host elements
1107
- // waiting on this parent element to load
1108
- // let's fire off all update callbacks waiting
1109
- rc.map(cb => cb());
1110
- elm['s-rc'] = undefined;
1111
- }
1112
- endRender();
1113
- endUpdate();
1114
- {
1115
- const childrenPromises = elm['s-p'];
1116
- const postUpdate = () => postUpdateComponent(hostRef);
1117
- if (childrenPromises.length === 0) {
1118
- postUpdate();
1119
- }
1120
- else {
1121
- Promise.all(childrenPromises).then(postUpdate);
1122
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1123
- childrenPromises.length = 0;
1124
- }
1125
- }
1126
- };
1127
- const callRender = (hostRef, instance, elm) => {
1128
- try {
1129
- instance = instance.render() ;
1130
- {
1131
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1132
- }
1133
- {
1134
- hostRef.$flags$ |= 2 /* hasRendered */;
1135
- }
1136
- {
1137
- {
1138
- // looks like we've got child nodes to render into this host element
1139
- // or we need to update the css class/attrs on the host element
1140
- // DOM WRITE!
1141
- {
1142
- renderVdom(hostRef, instance);
1143
- }
1144
- }
1145
- }
1146
- }
1147
- catch (e) {
1148
- consoleError(e, hostRef.$hostElement$);
1149
- }
1150
- return null;
1151
- };
1152
- const postUpdateComponent = (hostRef) => {
1153
- const tagName = hostRef.$cmpMeta$.$tagName$;
1154
- const elm = hostRef.$hostElement$;
1155
- const endPostUpdate = createTime('postUpdate', tagName);
1156
- const instance = hostRef.$lazyInstance$ ;
1157
- const ancestorComponent = hostRef.$ancestorComponent$;
1158
- {
1159
- safeCall(instance, 'componentDidRender');
1160
- }
1161
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1162
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1163
- {
1164
- // DOM WRITE!
1165
- addHydratedFlag(elm);
1166
- }
1167
- {
1168
- safeCall(instance, 'componentDidLoad');
1169
- }
1170
- endPostUpdate();
1171
- {
1172
- hostRef.$onReadyResolve$(elm);
1173
- if (!ancestorComponent) {
1174
- appDidLoad();
1175
- }
1176
- }
1177
- }
1178
- else {
1179
- endPostUpdate();
1180
- }
1181
- {
1182
- hostRef.$onInstanceResolve$(elm);
1183
- }
1184
- // load events fire from bottom to top
1185
- // the deepest elements load first then bubbles up
1186
- {
1187
- if (hostRef.$onRenderResolve$) {
1188
- hostRef.$onRenderResolve$();
1189
- hostRef.$onRenderResolve$ = undefined;
1190
- }
1191
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1192
- nextTick(() => scheduleUpdate(hostRef, false));
1193
- }
1194
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1195
- }
1196
- // ( •_•)
1197
- // ( •_•)>⌐■-■
1198
- // (⌐■_■)
1199
- };
1200
- const appDidLoad = (who) => {
1201
- // on appload
1202
- // we have finish the first big initial render
1203
- {
1204
- addHydratedFlag(doc.documentElement);
1205
- }
1206
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1207
- };
1208
- const safeCall = (instance, method, arg) => {
1209
- if (instance && instance[method]) {
1210
- try {
1211
- return instance[method](arg);
1212
- }
1213
- catch (e) {
1214
- consoleError(e);
1215
- }
1216
- }
1217
- return undefined;
1218
- };
1219
- const then = (promise, thenFn) => {
1220
- return promise && promise.then ? promise.then(thenFn) : thenFn();
1221
- };
1222
- const addHydratedFlag = (elm) => (elm.classList.add('hydrated') );
1223
- const parsePropertyValue = (propValue, propType) => {
1224
- // ensure this value is of the correct prop type
1225
- if (propValue != null && !isComplexType(propValue)) {
1226
- if (propType & 4 /* Boolean */) {
1227
- // per the HTML spec, any string value means it is a boolean true value
1228
- // but we'll cheat here and say that the string "false" is the boolean false
1229
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1230
- }
1231
- if (propType & 2 /* Number */) {
1232
- // force it to be a number
1233
- return parseFloat(propValue);
1234
- }
1235
- if (propType & 1 /* String */) {
1236
- // could have been passed as a number or boolean
1237
- // but we still want it as a string
1238
- return String(propValue);
1239
- }
1240
- // redundant return here for better minification
1241
- return propValue;
1242
- }
1243
- // not sure exactly what type we want
1244
- // so no need to change to a different type
1245
- return propValue;
1246
- };
1247
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1248
- const setValue = (ref, propName, newVal, cmpMeta) => {
1249
- // check our new property value against our internal value
1250
- const hostRef = getHostRef(ref);
1251
- const elm = hostRef.$hostElement$ ;
1252
- const oldVal = hostRef.$instanceValues$.get(propName);
1253
- const flags = hostRef.$flags$;
1254
- const instance = hostRef.$lazyInstance$ ;
1255
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1256
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
1257
- // gadzooks! the property's value has changed!!
1258
- // set our new value!
1259
- hostRef.$instanceValues$.set(propName, newVal);
1260
- if (instance) {
1261
- // get an array of method names of watch functions to call
1262
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1263
- const watchMethods = cmpMeta.$watchers$[propName];
1264
- if (watchMethods) {
1265
- // this instance is watching for when this property changed
1266
- watchMethods.map(watchMethodName => {
1267
- try {
1268
- // fire off each of the watch methods that are watching this property
1269
- instance[watchMethodName](newVal, oldVal, propName);
1270
- }
1271
- catch (e) {
1272
- consoleError(e, elm);
1273
- }
1274
- });
1275
- }
1276
- }
1277
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1278
- // looks like this value actually changed, so we've got work to do!
1279
- // but only if we've already rendered, otherwise just chill out
1280
- // queue that we need to do an update, but don't worry about queuing
1281
- // up millions cuz this function ensures it only runs once
1282
- scheduleUpdate(hostRef, false);
1283
- }
1284
- }
1285
- }
1286
- };
1287
- const proxyComponent = (Cstr, cmpMeta, flags) => {
1288
- if (cmpMeta.$members$) {
1289
- if (Cstr.watchers) {
1290
- cmpMeta.$watchers$ = Cstr.watchers;
1291
- }
1292
- // It's better to have a const than two Object.entries()
1293
- const members = Object.entries(cmpMeta.$members$);
1294
- const prototype = Cstr.prototype;
1295
- members.map(([memberName, [memberFlags]]) => {
1296
- if ((memberFlags & 31 /* Prop */ || ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1297
- // proxyComponent - prop
1298
- Object.defineProperty(prototype, memberName, {
1299
- get() {
1300
- // proxyComponent, get value
1301
- return getValue(this, memberName);
1302
- },
1303
- set(newValue) {
1304
- // proxyComponent, set value
1305
- setValue(this, memberName, newValue, cmpMeta);
1306
- },
1307
- configurable: true,
1308
- enumerable: true,
1309
- });
1310
- }
1311
- else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
1312
- // proxyComponent - method
1313
- Object.defineProperty(prototype, memberName, {
1314
- value(...args) {
1315
- const ref = getHostRef(this);
1316
- return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
1317
- },
1318
- });
1319
- }
1320
- });
1321
- if ((flags & 1 /* isElementConstructor */)) {
1322
- const attrNameToPropName = new Map();
1323
- prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1324
- plt.jmp(() => {
1325
- const propName = attrNameToPropName.get(attrName);
1326
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1327
- });
1328
- };
1329
- // create an array of attributes to observe
1330
- // and also create a map of html attribute name to js property name
1331
- Cstr.observedAttributes = members
1332
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1333
- .map(([propName, m]) => {
1334
- const attrName = m[1] || propName;
1335
- attrNameToPropName.set(attrName, propName);
1336
- if (m[0] & 512 /* ReflectAttr */) {
1337
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
1338
- }
1339
- return attrName;
1340
- });
1341
- }
1342
- }
1343
- return Cstr;
1344
- };
1345
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1346
- // initializeComponent
1347
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1348
- {
1349
- // we haven't initialized this element yet
1350
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1351
- // lazy loaded components
1352
- // request the component's implementation to be
1353
- // wired up with the host element
1354
- Cstr = loadModule(cmpMeta);
1355
- if (Cstr.then) {
1356
- // Await creates a micro-task avoid if possible
1357
- const endLoad = uniqueTime();
1358
- Cstr = await Cstr;
1359
- endLoad();
1360
- }
1361
- if (!Cstr.isProxied) {
1362
- // we'eve never proxied this Constructor before
1363
- // let's add the getters/setters to its prototype before
1364
- // the first time we create an instance of the implementation
1365
- {
1366
- cmpMeta.$watchers$ = Cstr.watchers;
1367
- }
1368
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1369
- Cstr.isProxied = true;
1370
- }
1371
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1372
- // ok, time to construct the instance
1373
- // but let's keep track of when we start and stop
1374
- // so that the getters/setters don't incorrectly step on data
1375
- {
1376
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1377
- }
1378
- // construct the lazy-loaded component implementation
1379
- // passing the hostRef is very important during
1380
- // construction in order to directly wire together the
1381
- // host element and the lazy-loaded instance
1382
- try {
1383
- new Cstr(hostRef);
1384
- }
1385
- catch (e) {
1386
- consoleError(e);
1387
- }
1388
- {
1389
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1390
- }
1391
- {
1392
- hostRef.$flags$ |= 128 /* isWatchReady */;
1393
- }
1394
- endNewInstance();
1395
- }
1396
- if (Cstr.style) {
1397
- // this component has styles but we haven't registered them yet
1398
- let style = Cstr.style;
1399
- const scopeId = getScopeId(cmpMeta);
1400
- if (!styles.has(scopeId)) {
1401
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1402
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1403
- endRegisterStyles();
1404
- }
1405
- }
1406
- }
1407
- // we've successfully created a lazy instance
1408
- const ancestorComponent = hostRef.$ancestorComponent$;
1409
- const schedule = () => scheduleUpdate(hostRef, true);
1410
- if (ancestorComponent && ancestorComponent['s-rc']) {
1411
- // this is the intial load and this component it has an ancestor component
1412
- // but the ancestor component has NOT fired its will update lifecycle yet
1413
- // so let's just cool our jets and wait for the ancestor to continue first
1414
- // this will get fired off when the ancestor component
1415
- // finally gets around to rendering its lazy self
1416
- // fire off the initial update
1417
- ancestorComponent['s-rc'].push(schedule);
1418
- }
1419
- else {
1420
- schedule();
1421
- }
1422
- };
1423
- const connectedCallback = (elm) => {
1424
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1425
- const hostRef = getHostRef(elm);
1426
- const cmpMeta = hostRef.$cmpMeta$;
1427
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1428
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1429
- // first time this component has connected
1430
- hostRef.$flags$ |= 1 /* hasConnected */;
1431
- {
1432
- // initUpdate
1433
- // if the slot polyfill is required we'll need to put some nodes
1434
- // in here to act as original content anchors as we move nodes around
1435
- // host element has been connected to the DOM
1436
- if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1437
- setContentReference(elm);
1438
- }
1439
- }
1440
- {
1441
- // find the first ancestor component (if there is one) and register
1442
- // this component as one of the actively loading child components for its ancestor
1443
- let ancestorComponent = elm;
1444
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1445
- // climb up the ancestors looking for the first
1446
- // component that hasn't finished its lifecycle update yet
1447
- if (ancestorComponent['s-p']) {
1448
- // we found this components first ancestor component
1449
- // keep a reference to this component's ancestor component
1450
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1451
- break;
1452
- }
1453
- }
1454
- }
1455
- // Lazy properties
1456
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1457
- if (cmpMeta.$members$) {
1458
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1459
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1460
- const value = elm[memberName];
1461
- delete elm[memberName];
1462
- elm[memberName] = value;
1463
- }
1464
- });
1465
- }
1466
- {
1467
- initializeComponent(elm, hostRef, cmpMeta);
1468
- }
1469
- }
1470
- else {
1471
- // not the first time this has connected
1472
- // reattach any event listeners to the host
1473
- // since they would have been removed when disconnected
1474
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1475
- }
1476
- endConnected();
1477
- }
1478
- };
1479
- const setContentReference = (elm) => {
1480
- // only required when we're NOT using native shadow dom (slot)
1481
- // or this browser doesn't support native shadow dom
1482
- // and this host element was NOT created with SSR
1483
- // let's pick out the inner content for slot projection
1484
- // create a node to represent where the original
1485
- // content was first placed, which is useful later on
1486
- const contentRefElm = (elm['s-cr'] = doc.createComment(''));
1487
- contentRefElm['s-cn'] = true;
1488
- elm.insertBefore(contentRefElm, elm.firstChild);
1489
- };
1490
- const disconnectedCallback = (elm) => {
1491
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1492
- const hostRef = getHostRef(elm);
1493
- const instance = hostRef.$lazyInstance$ ;
1494
- {
1495
- if (hostRef.$rmListeners$) {
1496
- hostRef.$rmListeners$.map(rmListener => rmListener());
1497
- hostRef.$rmListeners$ = undefined;
1498
- }
1499
- }
1500
- {
1501
- safeCall(instance, 'disconnectedCallback');
1502
- }
1503
- }
1504
- };
1505
- const bootstrapLazy = (lazyBundles, options = {}) => {
1506
- const endBootstrap = createTime();
1507
- const cmpTags = [];
1508
- const exclude = options.exclude || [];
1509
- const customElements = win.customElements;
1510
- const head = doc.head;
1511
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1512
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1513
- const deferredConnectedCallbacks = [];
1514
- let appLoadFallback;
1515
- let isBootstrapping = true;
1516
- Object.assign(plt, options);
1517
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1518
- lazyBundles.map(lazyBundle => lazyBundle[1].map(compactMeta => {
1519
- const cmpMeta = {
1520
- $flags$: compactMeta[0],
1521
- $tagName$: compactMeta[1],
1522
- $members$: compactMeta[2],
1523
- $listeners$: compactMeta[3],
1524
- };
1525
- {
1526
- cmpMeta.$members$ = compactMeta[2];
1527
- }
1528
- {
1529
- cmpMeta.$listeners$ = compactMeta[3];
1530
- }
1531
- {
1532
- cmpMeta.$attrsToReflect$ = [];
1533
- }
1534
- {
1535
- cmpMeta.$watchers$ = {};
1536
- }
1537
- const tagName = cmpMeta.$tagName$;
1538
- const HostElement = class extends HTMLElement {
1539
- // StencilLazyHost
1540
- constructor(self) {
1541
- // @ts-ignore
1542
- super(self);
1543
- self = this;
1544
- registerHost(self, cmpMeta);
1545
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1546
- // this component is using shadow dom
1547
- // and this browser supports shadow dom
1548
- // add the read-only property "shadowRoot" to the host element
1549
- // adding the shadow root build conditionals to minimize runtime
1550
- {
1551
- {
1552
- self.attachShadow({ mode: 'open' });
1553
- }
1554
- }
1555
- }
1556
- }
1557
- connectedCallback() {
1558
- if (appLoadFallback) {
1559
- clearTimeout(appLoadFallback);
1560
- appLoadFallback = null;
1561
- }
1562
- if (isBootstrapping) {
1563
- // connectedCallback will be processed once all components have been registered
1564
- deferredConnectedCallbacks.push(this);
1565
- }
1566
- else {
1567
- plt.jmp(() => connectedCallback(this));
1568
- }
1569
- }
1570
- disconnectedCallback() {
1571
- plt.jmp(() => disconnectedCallback(this));
1572
- }
1573
- componentOnReady() {
1574
- return getHostRef(this).$onReadyPromise$;
1575
- }
1576
- };
1577
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1578
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1579
- cmpTags.push(tagName);
1580
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1581
- }
1582
- }));
1583
- {
1584
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1585
- visibilityStyle.setAttribute('data-styles', '');
1586
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1587
- }
1588
- // Process deferred connectedCallbacks now all components have been registered
1589
- isBootstrapping = false;
1590
- if (deferredConnectedCallbacks.length) {
1591
- deferredConnectedCallbacks.map(host => host.connectedCallback());
1592
- }
1593
- else {
1594
- {
1595
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1596
- }
1597
- }
1598
- // Fallback appLoad event
1599
- endBootstrap();
1600
- };
1601
- const hostRefs = new WeakMap();
1602
- const getHostRef = (ref) => hostRefs.get(ref);
1603
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1604
- const registerHost = (elm, cmpMeta) => {
1605
- const hostRef = {
1606
- $flags$: 0,
1607
- $hostElement$: elm,
1608
- $cmpMeta$: cmpMeta,
1609
- $instanceValues$: new Map(),
1610
- };
1611
- {
1612
- hostRef.$onInstancePromise$ = new Promise(r => (hostRef.$onInstanceResolve$ = r));
1613
- }
1614
- {
1615
- hostRef.$onReadyPromise$ = new Promise(r => (hostRef.$onReadyResolve$ = r));
1616
- elm['s-p'] = [];
1617
- elm['s-rc'] = [];
1618
- }
1619
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1620
- return hostRefs.set(elm, hostRef);
1621
- };
1622
- const isMemberInElement = (elm, memberName) => memberName in elm;
1623
- const consoleError = (e, el) => (0, console.error)(e, el);
1624
- const cmpModules = /*@__PURE__*/ new Map();
1625
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1626
- // loadModuleImport
1627
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1628
- const bundleId = cmpMeta.$lazyBundleId$;
1629
- const module = cmpModules.get(bundleId) ;
1630
- if (module) {
1631
- return module[exportName];
1632
- }
1633
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1634
- /* webpackInclude: /\.entry\.js$/ */
1635
- /* webpackExclude: /\.system\.entry\.js$/ */
1636
- /* webpackMode: "lazy" */
1637
- `./${bundleId}.entry.js${''}`)); }).then(importedModule => {
1638
- {
1639
- cmpModules.set(bundleId, importedModule);
1640
- }
1641
- return importedModule[exportName];
1642
- }, consoleError);
1643
- };
1644
- const styles = new Map();
1645
- const queueDomReads = [];
1646
- const queueDomWrites = [];
1647
- const queueTask = (queue, write) => (cb) => {
1648
- queue.push(cb);
1649
- if (!queuePending) {
1650
- queuePending = true;
1651
- if (write && plt.$flags$ & 4 /* queueSync */) {
1652
- nextTick(flush);
1653
- }
1654
- else {
1655
- plt.raf(flush);
1656
- }
1657
- }
1658
- };
1659
- const consume = (queue) => {
1660
- for (let i = 0; i < queue.length; i++) {
1661
- try {
1662
- queue[i](performance.now());
1663
- }
1664
- catch (e) {
1665
- consoleError(e);
1666
- }
1667
- }
1668
- queue.length = 0;
1669
- };
1670
- const flush = () => {
1671
- // always force a bunch of medium callbacks to run, but still have
1672
- // a throttle on how many can run in a certain time
1673
- // DOM READS!!!
1674
- consume(queueDomReads);
1675
- // DOM WRITES!!!
1676
- {
1677
- consume(queueDomWrites);
1678
- if ((queuePending = queueDomReads.length > 0)) {
1679
- // still more to do yet, but we've run out of time
1680
- // let's let this thing cool off and try again in the next tick
1681
- plt.raf(flush);
1682
- }
1683
- }
1684
- };
1685
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1686
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1687
-
1688
- exports.Host = Host;
1689
- exports.bootstrapLazy = bootstrapLazy;
1690
- exports.createEvent = createEvent;
1691
- exports.getElement = getElement;
1692
- exports.h = h;
1693
- exports.promiseResolve = promiseResolve;
1694
- exports.registerInstance = registerInstance;