@rededor/cura 0.5.4 → 1.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (640) hide show
  1. package/dist/assets/icons/iconset-default-list.ts +1 -1
  2. package/dist/assets/icons/iconset-default-tmp.svg +8 -0
  3. package/dist/assets/icons/iconset-default.svg +1 -1
  4. package/dist/cjs/app-globals-bcffd819.js +511 -0
  5. package/dist/cjs/app-globals-bcffd819.js.map +1 -0
  6. package/dist/cjs/cura-accordion_9.cjs.entry.js +544 -0
  7. package/dist/cjs/cura-accordion_9.cjs.entry.js.map +1 -0
  8. package/dist/cjs/cura-alert.cjs.entry.js +57 -55
  9. package/dist/cjs/cura-alert.cjs.entry.js.map +1 -1
  10. package/dist/cjs/cura-avatar.cjs.entry.js +68 -0
  11. package/dist/cjs/cura-avatar.cjs.entry.js.map +1 -0
  12. package/dist/cjs/cura-button-outline.cjs.entry.js +102 -71
  13. package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
  14. package/dist/cjs/cura-button-select.cjs.entry.js +91 -85
  15. package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
  16. package/dist/cjs/cura-button-transparent_2.cjs.entry.js +4055 -0
  17. package/dist/cjs/cura-button-transparent_2.cjs.entry.js.map +1 -0
  18. package/dist/cjs/cura-calendar.cjs.entry.js +3913 -0
  19. package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -0
  20. package/dist/cjs/cura-card.cjs.entry.js +53 -0
  21. package/dist/cjs/cura-card.cjs.entry.js.map +1 -0
  22. package/dist/cjs/cura-checkbox.cjs.entry.js +168 -131
  23. package/dist/cjs/cura-checkbox.cjs.entry.js.map +1 -1
  24. package/dist/cjs/cura-display.cjs.entry.js +63 -62
  25. package/dist/cjs/cura-display.cjs.entry.js.map +1 -1
  26. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +22 -0
  27. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js.map +1 -0
  28. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +55 -0
  29. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +1 -0
  30. package/dist/cjs/cura-dropdown-search.cjs.entry.js +209 -0
  31. package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -0
  32. package/dist/cjs/cura-forms.definitions-c164f1b8.js +20 -0
  33. package/dist/cjs/cura-forms.definitions-c164f1b8.js.map +1 -0
  34. package/dist/cjs/cura-icon.definitions-8d714f6a.js +21 -0
  35. package/dist/cjs/cura-icon.definitions-8d714f6a.js.map +1 -0
  36. package/dist/cjs/cura-icons-view.cjs.entry.js +24 -23
  37. package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
  38. package/dist/cjs/cura-radio.cjs.entry.js +142 -103
  39. package/dist/cjs/cura-radio.cjs.entry.js.map +1 -1
  40. package/dist/cjs/cura-select_2.cjs.entry.js +325 -0
  41. package/dist/cjs/cura-select_2.cjs.entry.js.map +1 -0
  42. package/dist/cjs/cura-switch.cjs.entry.js +113 -78
  43. package/dist/cjs/cura-switch.cjs.entry.js.map +1 -1
  44. package/dist/cjs/cura.cjs.js +13 -22
  45. package/dist/cjs/cura.cjs.js.map +1 -1
  46. package/dist/cjs/index-5b63ff7a.js +1529 -0
  47. package/dist/cjs/index-5b63ff7a.js.map +1 -0
  48. package/dist/cjs/index.cjs.js +1 -1
  49. package/dist/cjs/index.cjs.js.map +1 -1
  50. package/dist/cjs/loader.cjs.js +6 -31
  51. package/dist/cjs/loader.cjs.js.map +1 -1
  52. package/dist/collection/api/cura-api.js +30 -30
  53. package/dist/collection/api/cura-api.js.map +1 -1
  54. package/dist/collection/api/cura-api.type.js +2 -2
  55. package/dist/collection/api/cura-api.type.js.map +1 -1
  56. package/dist/collection/api/modules/cura-theme-breakpoints-module.js +10 -10
  57. package/dist/collection/api/modules/cura-theme-breakpoints-module.js.map +1 -1
  58. package/dist/collection/api/modules/cura-theme-colors-module.js +72 -72
  59. package/dist/collection/api/modules/cura-theme-colors-module.js.map +1 -1
  60. package/dist/collection/api/modules/cura-theme-fonts-module.js +28 -28
  61. package/dist/collection/api/modules/cura-theme-fonts-module.js.map +1 -1
  62. package/dist/collection/api/modules/cura-theme-module.js +66 -66
  63. package/dist/collection/api/modules/cura-theme-module.js.map +1 -1
  64. package/dist/collection/api/modules/cura-theme-spacing-module.js +9 -9
  65. package/dist/collection/api/modules/cura-theme-spacing-module.js.map +1 -1
  66. package/dist/collection/api/theme-presets/static.js +63 -63
  67. package/dist/collection/api/theme-presets/static.js.map +1 -1
  68. package/dist/collection/api/theme-presets/theme-default.js +41 -41
  69. package/dist/collection/api/theme-presets/theme-default.js.map +1 -1
  70. package/dist/collection/api/theme-presets/theme-legacy-default.js +24 -24
  71. package/dist/collection/api/theme-presets/theme-legacy-default.js.map +1 -1
  72. package/dist/collection/api/theme-presets/theme-maternity.js +38 -38
  73. package/dist/collection/api/theme-presets/theme-maternity.js.map +1 -1
  74. package/dist/collection/api/theme-presets/theme-oncology.js +46 -46
  75. package/dist/collection/api/theme-presets/theme-oncology.js.map +1 -1
  76. package/dist/collection/api/theme-presets/theme-presets.js +8 -8
  77. package/dist/collection/api/theme-presets/theme-presets.js.map +1 -1
  78. package/dist/collection/assets/icons/iconset-default-list.js +1 -1
  79. package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
  80. package/dist/collection/assets/icons/iconset-default-tmp.svg +8 -0
  81. package/dist/collection/assets/icons/iconset-default.svg +1 -1
  82. package/dist/collection/assets/images/avatar/doctor-default.svg +8 -0
  83. package/dist/collection/assets/images/avatar/dora-default.svg +5 -0
  84. package/dist/collection/assets/images/avatar/patient-default.svg +12 -0
  85. package/dist/collection/assets/images/avatar/unit-default.svg +9 -0
  86. package/dist/collection/assets/images/logoCura.svg +15 -0
  87. package/dist/collection/assets-raw/icons/default/contacts.svg +3 -0
  88. package/dist/collection/assets-raw/icons/default/scheduleCancel.svg +3 -0
  89. package/dist/collection/collection-manifest.json +29 -21
  90. package/dist/collection/components/accordion/cura-accordion/cura-accordion.js +267 -267
  91. package/dist/collection/components/accordion/cura-accordion/cura-accordion.js.map +1 -1
  92. package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js +127 -127
  93. package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js.map +1 -1
  94. package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js +196 -196
  95. package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js.map +1 -1
  96. package/dist/collection/components/buttons/cura-button/cura-button.css +112 -46
  97. package/dist/collection/components/buttons/cura-button/cura-button.js +368 -306
  98. package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
  99. package/dist/collection/components/buttons/cura-button/cura-button.stories.js +184 -159
  100. package/dist/collection/components/buttons/cura-button/cura-button.stories.js.map +1 -1
  101. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.css +37 -64
  102. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +374 -306
  103. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
  104. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js +184 -159
  105. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js.map +1 -1
  106. package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +36 -23
  107. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +265 -260
  108. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
  109. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.css +32 -50
  110. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +339 -306
  111. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
  112. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js +172 -159
  113. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js.map +1 -1
  114. package/dist/collection/components/cura-alert/cura-alert.js +182 -164
  115. package/dist/collection/components/cura-alert/cura-alert.js.map +1 -1
  116. package/dist/collection/components/cura-alert/cura-alert.stories.js +90 -77
  117. package/dist/collection/components/cura-alert/cura-alert.stories.js.map +1 -1
  118. package/dist/collection/components/cura-avatar/cura-avatar.css +24 -0
  119. package/dist/collection/components/cura-avatar/cura-avatar.definitions.js +7 -0
  120. package/dist/collection/components/cura-avatar/cura-avatar.definitions.js.map +1 -0
  121. package/dist/collection/components/cura-avatar/cura-avatar.js +231 -0
  122. package/dist/collection/components/cura-avatar/cura-avatar.js.map +1 -0
  123. package/dist/collection/components/cura-avatar/cura-avatar.stories.js +198 -0
  124. package/dist/collection/components/cura-avatar/cura-avatar.stories.js.map +1 -0
  125. package/dist/collection/components/cura-calendar/cura-calendar.css +181 -0
  126. package/dist/collection/components/cura-calendar/cura-calendar.js +681 -0
  127. package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -0
  128. package/dist/collection/components/cura-calendar/cura-calendar.stories.js +126 -0
  129. package/dist/collection/components/cura-calendar/cura-calendar.stories.js.map +1 -0
  130. package/dist/collection/components/cura-card/cura-card.css +175 -0
  131. package/dist/collection/components/cura-card/cura-card.js +201 -0
  132. package/dist/collection/components/cura-card/cura-card.js.map +1 -0
  133. package/dist/collection/components/cura-card/cura-card.stories.js +127 -0
  134. package/dist/collection/components/cura-card/cura-card.stories.js.map +1 -0
  135. package/dist/collection/components/cura-icon/cura-icon.definitions.js +11 -11
  136. package/dist/collection/components/cura-icon/cura-icon.definitions.js.map +1 -1
  137. package/dist/collection/components/cura-icon/cura-icon.js +151 -151
  138. package/dist/collection/components/cura-icon/cura-icon.js.map +1 -1
  139. package/dist/collection/components/cura-icon/cura-icon.stories.js +60 -60
  140. package/dist/collection/components/cura-icon/cura-icon.stories.js.map +1 -1
  141. package/dist/collection/components/cura-icons-view/cura-icons-view.js +37 -37
  142. package/dist/collection/components/cura-icons-view/cura-icons-view.js.map +1 -1
  143. package/dist/collection/components/cura-icons-view/cura-icons-view.stories.js +7 -7
  144. package/dist/collection/components/cura-icons-view/cura-icons-view.stories.js.map +1 -1
  145. package/dist/collection/components/cura-page-template/cura-page-template.js +52 -52
  146. package/dist/collection/components/cura-page-template/cura-page-template.js.map +1 -1
  147. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.css +19 -11
  148. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +457 -427
  149. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js.map +1 -1
  150. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.stories.js +170 -170
  151. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.stories.js.map +1 -1
  152. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +50 -0
  153. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +136 -0
  154. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -0
  155. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js +56 -0
  156. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +1 -0
  157. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.css +10 -0
  158. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +19 -0
  159. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js.map +1 -0
  160. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +149 -0
  161. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +384 -0
  162. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -0
  163. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js +181 -0
  164. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map +1 -0
  165. package/dist/collection/components/forms/cura-forms.definitions.js +12 -12
  166. package/dist/collection/components/forms/cura-forms.definitions.js.map +1 -1
  167. package/dist/collection/components/forms/cura-input-text/cura-input-text.css +849 -139
  168. package/dist/collection/components/forms/cura-input-text/cura-input-text.js +732 -641
  169. package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -1
  170. package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js +217 -196
  171. package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js.map +1 -1
  172. package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js +40 -40
  173. package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js.map +1 -1
  174. package/dist/collection/components/forms/cura-label/cura-label.js +187 -187
  175. package/dist/collection/components/forms/cura-label/cura-label.js.map +1 -1
  176. package/dist/collection/components/forms/cura-label/cura-label.stories.js +108 -108
  177. package/dist/collection/components/forms/cura-label/cura-label.stories.js.map +1 -1
  178. package/dist/collection/components/forms/cura-radio/cura-radio.js +395 -363
  179. package/dist/collection/components/forms/cura-radio/cura-radio.js.map +1 -1
  180. package/dist/collection/components/forms/cura-radio/cura-radio.stories.js +150 -150
  181. package/dist/collection/components/forms/cura-radio/cura-radio.stories.js.map +1 -1
  182. package/dist/collection/components/forms/cura-select/cura-select.css +519 -0
  183. package/dist/collection/components/forms/cura-select/cura-select.js +444 -0
  184. package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -0
  185. package/dist/collection/components/forms/cura-select/cura-select.stories.js +144 -0
  186. package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -0
  187. package/dist/collection/components/forms/cura-select-options/cura-select-option.css +28 -0
  188. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +138 -0
  189. package/dist/collection/components/forms/cura-select-options/cura-select-option.js.map +1 -0
  190. package/dist/collection/components/forms/cura-switch/cura-switch.css +88 -24
  191. package/dist/collection/components/forms/cura-switch/cura-switch.js +292 -264
  192. package/dist/collection/components/forms/cura-switch/cura-switch.js.map +1 -1
  193. package/dist/collection/components/forms/cura-switch/cura-switch.stories.js +115 -115
  194. package/dist/collection/components/forms/cura-switch/cura-switch.stories.js.map +1 -1
  195. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +74 -74
  196. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js.map +1 -1
  197. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.stories.js +41 -41
  198. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.stories.js.map +1 -1
  199. package/dist/collection/components/text/cura-display/cura-display.js +174 -174
  200. package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
  201. package/dist/collection/components/text/cura-display/cura-display.stories.js +97 -97
  202. package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -1
  203. package/dist/collection/components/text/cura-heading/cura-heading.js +220 -220
  204. package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
  205. package/dist/collection/components/text/cura-heading/cura-heading.stories.js +117 -117
  206. package/dist/collection/components/text/cura-heading/cura-heading.stories.js.map +1 -1
  207. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +168 -168
  208. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
  209. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +98 -98
  210. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -1
  211. package/dist/collection/index.js +1 -1
  212. package/dist/collection/index.js.map +1 -1
  213. package/dist/collection/rededor-cura-start.js +7 -7
  214. package/dist/collection/rededor-cura-start.js.map +1 -1
  215. package/dist/collection/utils/utils.js +11 -11
  216. package/dist/collection/utils/utils.js.map +1 -1
  217. package/dist/components/cura-accordion-item.d.ts +2 -2
  218. package/dist/components/cura-accordion-item.js +62 -61
  219. package/dist/components/cura-accordion-item.js.map +1 -1
  220. package/dist/components/cura-accordion.d.ts +2 -2
  221. package/dist/components/cura-accordion.js +108 -104
  222. package/dist/components/cura-accordion.js.map +1 -1
  223. package/dist/components/cura-alert.d.ts +2 -2
  224. package/dist/components/cura-alert.js +93 -88
  225. package/dist/components/cura-alert.js.map +1 -1
  226. package/dist/components/cura-avatar.d.ts +11 -0
  227. package/dist/components/cura-avatar.js +95 -0
  228. package/dist/components/cura-avatar.js.map +1 -0
  229. package/dist/components/cura-button-outline.d.ts +2 -2
  230. package/dist/components/cura-button-outline.js +147 -109
  231. package/dist/components/cura-button-outline.js.map +1 -1
  232. package/dist/components/cura-button-select.d.ts +2 -2
  233. package/dist/components/cura-button-select.js +129 -113
  234. package/dist/components/cura-button-select.js.map +1 -1
  235. package/dist/components/cura-button-transparent.d.ts +2 -2
  236. package/dist/components/cura-button-transparent.js +1 -116
  237. package/dist/components/cura-button-transparent.js.map +1 -1
  238. package/dist/components/cura-button-transparent2.js +144 -0
  239. package/dist/components/cura-button-transparent2.js.map +1 -0
  240. package/dist/components/cura-button.d.ts +2 -2
  241. package/dist/components/cura-button.js +145 -109
  242. package/dist/components/cura-button.js.map +1 -1
  243. package/dist/components/cura-calendar.d.ts +11 -0
  244. package/dist/components/cura-calendar.js +3969 -0
  245. package/dist/components/cura-calendar.js.map +1 -0
  246. package/dist/components/cura-card.d.ts +11 -0
  247. package/dist/components/cura-card.js +75 -0
  248. package/dist/components/cura-card.js.map +1 -0
  249. package/dist/components/cura-checkbox.d.ts +2 -2
  250. package/dist/components/cura-checkbox.js +210 -174
  251. package/dist/components/cura-checkbox.js.map +1 -1
  252. package/dist/components/cura-display.d.ts +2 -2
  253. package/dist/components/cura-display.js +85 -81
  254. package/dist/components/cura-display.js.map +1 -1
  255. package/dist/components/cura-dropdown-search-option-title.d.ts +11 -0
  256. package/dist/components/cura-dropdown-search-option-title.js +42 -0
  257. package/dist/components/cura-dropdown-search-option-title.js.map +1 -0
  258. package/dist/components/cura-dropdown-search-option.d.ts +11 -0
  259. package/dist/components/cura-dropdown-search-option.js +82 -0
  260. package/dist/components/cura-dropdown-search-option.js.map +1 -0
  261. package/dist/components/cura-dropdown-search.d.ts +11 -0
  262. package/dist/components/cura-dropdown-search.js +272 -0
  263. package/dist/components/cura-dropdown-search.js.map +1 -0
  264. package/dist/components/cura-forms.definitions.js +12 -12
  265. package/dist/components/cura-forms.definitions.js.map +1 -1
  266. package/dist/components/cura-heading.d.ts +2 -2
  267. package/dist/components/cura-heading2.js +97 -93
  268. package/dist/components/cura-heading2.js.map +1 -1
  269. package/dist/components/cura-icon.d.ts +2 -2
  270. package/dist/components/cura-icon2.js +74 -69
  271. package/dist/components/cura-icon2.js.map +1 -1
  272. package/dist/components/cura-icons-view.d.ts +2 -2
  273. package/dist/components/cura-icons-view.js +57 -56
  274. package/dist/components/cura-icons-view.js.map +1 -1
  275. package/dist/components/cura-input-text.d.ts +2 -2
  276. package/dist/components/cura-input-text.js +1 -3954
  277. package/dist/components/cura-input-text.js.map +1 -1
  278. package/dist/{cjs/cura-input-text.cjs.entry.js → components/cura-input-text2.js} +393 -283
  279. package/dist/components/cura-input-text2.js.map +1 -0
  280. package/dist/components/cura-label.d.ts +2 -2
  281. package/dist/components/cura-label2.js +81 -77
  282. package/dist/components/cura-label2.js.map +1 -1
  283. package/dist/components/cura-loader-circle.d.ts +2 -2
  284. package/dist/components/cura-loader-circle2.js +41 -40
  285. package/dist/components/cura-loader-circle2.js.map +1 -1
  286. package/dist/components/cura-page-template.d.ts +2 -2
  287. package/dist/components/cura-page-template.js +36 -35
  288. package/dist/components/cura-page-template.js.map +1 -1
  289. package/dist/components/cura-paragraph.d.ts +2 -2
  290. package/dist/components/cura-paragraph2.js +79 -75
  291. package/dist/components/cura-paragraph2.js.map +1 -1
  292. package/dist/components/cura-radio.d.ts +2 -2
  293. package/dist/components/cura-radio.js +176 -139
  294. package/dist/components/cura-radio.js.map +1 -1
  295. package/dist/components/cura-select-option.d.ts +11 -0
  296. package/dist/components/cura-select-option.js +8 -0
  297. package/dist/components/cura-select-option.js.map +1 -0
  298. package/dist/components/cura-select-option2.js +87 -0
  299. package/dist/components/cura-select-option2.js.map +1 -0
  300. package/dist/components/cura-select.d.ts +11 -0
  301. package/dist/components/cura-select.js +8 -0
  302. package/dist/components/cura-select.js.map +1 -0
  303. package/dist/components/cura-select2.js +308 -0
  304. package/dist/components/cura-select2.js.map +1 -0
  305. package/dist/components/cura-switch.d.ts +2 -2
  306. package/dist/components/cura-switch.js +138 -105
  307. package/dist/components/cura-switch.js.map +1 -1
  308. package/dist/components/index.d.ts +6 -0
  309. package/dist/components/index.js +482 -466
  310. package/dist/components/index.js.map +1 -1
  311. package/dist/cura/cura.esm.js +1 -1
  312. package/dist/cura/cura.esm.js.map +1 -1
  313. package/dist/cura/index.esm.js.map +1 -1
  314. package/dist/cura/p-12d75346.entry.js +2 -0
  315. package/dist/cura/p-12d75346.entry.js.map +1 -0
  316. package/dist/cura/p-2176f253.entry.js +2 -0
  317. package/dist/cura/p-2176f253.entry.js.map +1 -0
  318. package/dist/cura/p-22292bfa.entry.js +2 -0
  319. package/dist/cura/p-22292bfa.entry.js.map +1 -0
  320. package/dist/cura/p-2a8be665.entry.js +2 -0
  321. package/dist/cura/p-2a8be665.entry.js.map +1 -0
  322. package/dist/cura/p-2d70b515.entry.js +2 -0
  323. package/dist/cura/p-2d70b515.entry.js.map +1 -0
  324. package/dist/cura/p-3c2ebc3a.entry.js +2 -0
  325. package/dist/cura/p-3c2ebc3a.entry.js.map +1 -0
  326. package/dist/cura/p-45a0a5e8.entry.js +2 -0
  327. package/dist/cura/p-45a0a5e8.entry.js.map +1 -0
  328. package/dist/cura/p-586bbe43.js +3 -0
  329. package/dist/cura/p-586bbe43.js.map +1 -0
  330. package/dist/cura/p-5d8e3ee3.entry.js +2 -0
  331. package/dist/cura/p-5d8e3ee3.entry.js.map +1 -0
  332. package/dist/cura/{p-f8fffdc1.js → p-70c369b1.js} +1 -1
  333. package/dist/cura/p-70c369b1.js.map +1 -0
  334. package/dist/cura/p-7c41f034.entry.js +2 -0
  335. package/dist/cura/p-7c41f034.entry.js.map +1 -0
  336. package/dist/cura/p-8cecf9e5.entry.js +2 -0
  337. package/dist/cura/p-8cecf9e5.entry.js.map +1 -0
  338. package/dist/cura/p-94b5c3b3.entry.js +2 -0
  339. package/dist/cura/p-94b5c3b3.entry.js.map +1 -0
  340. package/dist/cura/p-a5456007.entry.js +2 -0
  341. package/dist/cura/p-a5456007.entry.js.map +1 -0
  342. package/dist/cura/{p-c791725b.js → p-a7221f0c.js} +1 -1
  343. package/dist/{esm-es5/cura-icon.definitions-a63d1862.js.map → cura/p-a7221f0c.js.map} +1 -1
  344. package/dist/cura/p-cd757625.entry.js +2 -0
  345. package/dist/cura/p-cd757625.entry.js.map +1 -0
  346. package/dist/cura/p-de870781.entry.js +2 -0
  347. package/dist/cura/p-de870781.entry.js.map +1 -0
  348. package/dist/cura/p-e661bcca.entry.js +2 -0
  349. package/dist/cura/p-e661bcca.entry.js.map +1 -0
  350. package/dist/cura/p-ee7388a5.entry.js +2 -0
  351. package/dist/cura/p-ee7388a5.entry.js.map +1 -0
  352. package/dist/cura/{p-3688570d.js → p-f9b8f665.js} +1 -1
  353. package/dist/{esm-es5/cura-forms.definitions-0f774253.js.map → cura/p-f9b8f665.js.map} +1 -1
  354. package/dist/cura/p-fb9bece3.entry.js +2 -0
  355. package/dist/cura/p-fb9bece3.entry.js.map +1 -0
  356. package/dist/esm/app-globals-f2da2b14.js +509 -0
  357. package/dist/esm/app-globals-f2da2b14.js.map +1 -0
  358. package/dist/esm/cura-accordion_9.entry.js +532 -0
  359. package/dist/esm/cura-accordion_9.entry.js.map +1 -0
  360. package/dist/esm/cura-alert.entry.js +57 -55
  361. package/dist/esm/cura-alert.entry.js.map +1 -1
  362. package/dist/esm/cura-avatar.entry.js +64 -0
  363. package/dist/esm/cura-avatar.entry.js.map +1 -0
  364. package/dist/esm/cura-button-outline.entry.js +102 -71
  365. package/dist/esm/cura-button-outline.entry.js.map +1 -1
  366. package/dist/esm/cura-button-select.entry.js +91 -85
  367. package/dist/esm/cura-button-select.entry.js.map +1 -1
  368. package/dist/esm/{cura-input-text.entry.js → cura-button-transparent_2.entry.js} +423 -276
  369. package/dist/esm/cura-button-transparent_2.entry.js.map +1 -0
  370. package/dist/esm/cura-calendar.entry.js +3909 -0
  371. package/dist/esm/cura-calendar.entry.js.map +1 -0
  372. package/dist/esm/cura-card.entry.js +49 -0
  373. package/dist/esm/cura-card.entry.js.map +1 -0
  374. package/dist/esm/cura-checkbox.entry.js +168 -131
  375. package/dist/esm/cura-checkbox.entry.js.map +1 -1
  376. package/dist/esm/cura-display.entry.js +63 -62
  377. package/dist/esm/cura-display.entry.js.map +1 -1
  378. package/dist/esm/cura-dropdown-search-option-title.entry.js +18 -0
  379. package/dist/esm/cura-dropdown-search-option-title.entry.js.map +1 -0
  380. package/dist/esm/cura-dropdown-search-option.entry.js +51 -0
  381. package/dist/esm/cura-dropdown-search-option.entry.js.map +1 -0
  382. package/dist/esm/cura-dropdown-search.entry.js +205 -0
  383. package/dist/esm/cura-dropdown-search.entry.js.map +1 -0
  384. package/dist/esm/cura-forms.definitions-2f963167.js +18 -0
  385. package/dist/esm/cura-forms.definitions-2f963167.js.map +1 -0
  386. package/dist/esm/cura-icon.definitions-aaa4e80f.js +18 -0
  387. package/dist/esm/cura-icon.definitions-aaa4e80f.js.map +1 -0
  388. package/dist/esm/cura-icons-view.entry.js +24 -23
  389. package/dist/esm/cura-icons-view.entry.js.map +1 -1
  390. package/dist/esm/cura-radio.entry.js +142 -103
  391. package/dist/esm/cura-radio.entry.js.map +1 -1
  392. package/dist/esm/cura-select_2.entry.js +320 -0
  393. package/dist/esm/cura-select_2.entry.js.map +1 -0
  394. package/dist/esm/cura-switch.entry.js +113 -78
  395. package/dist/esm/cura-switch.entry.js.map +1 -1
  396. package/dist/esm/cura.js +14 -23
  397. package/dist/esm/cura.js.map +1 -1
  398. package/dist/esm/index-b6c443d5.js +1500 -0
  399. package/dist/esm/index-b6c443d5.js.map +1 -0
  400. package/dist/esm/index.js +1 -1
  401. package/dist/esm/index.js.map +1 -1
  402. package/dist/esm/loader.js +8 -33
  403. package/dist/esm/loader.js.map +1 -1
  404. package/dist/index.js +1 -1
  405. package/dist/loader/cdn.js +1 -3
  406. package/dist/loader/index.cjs.js +1 -3
  407. package/dist/loader/index.d.ts +4 -1
  408. package/dist/loader/index.es2017.js +1 -3
  409. package/dist/loader/index.js +1 -3
  410. package/dist/types/api/cura-api.d.ts +3 -3
  411. package/dist/types/api/cura-api.type.d.ts +44 -44
  412. package/dist/types/api/modules/cura-theme-breakpoints-module.d.ts +3 -3
  413. package/dist/types/api/modules/cura-theme-colors-module.d.ts +46 -46
  414. package/dist/types/api/modules/cura-theme-fonts-module.d.ts +22 -22
  415. package/dist/types/api/modules/cura-theme-module.d.ts +25 -25
  416. package/dist/types/api/modules/cura-theme-spacing-module.d.ts +4 -4
  417. package/dist/types/api/theme-presets/static.d.ts +62 -62
  418. package/dist/types/api/theme-presets/theme-default.d.ts +38 -38
  419. package/dist/types/api/theme-presets/theme-legacy-default.d.ts +38 -38
  420. package/dist/types/api/theme-presets/theme-maternity.d.ts +38 -38
  421. package/dist/types/api/theme-presets/theme-oncology.d.ts +45 -45
  422. package/dist/types/api/theme-presets/theme-presets.d.ts +175 -175
  423. package/dist/types/components/accordion/cura-accordion/cura-accordion.d.ts +37 -37
  424. package/dist/types/components/accordion/cura-accordion/cura-accordion.stories.d.ts +140 -140
  425. package/dist/types/components/accordion/cura-accordion-item/cura-accordion-item.d.ts +27 -27
  426. package/dist/types/components/buttons/cura-button/cura-button.d.ts +70 -59
  427. package/dist/types/components/buttons/cura-button/cura-button.stories.d.ts +184 -155
  428. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +70 -59
  429. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.stories.d.ts +184 -155
  430. package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +48 -47
  431. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +65 -59
  432. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.stories.d.ts +169 -155
  433. package/dist/types/components/cura-alert/cura-alert.d.ts +14 -13
  434. package/dist/types/components/cura-alert/cura-alert.stories.d.ts +85 -70
  435. package/dist/types/components/cura-avatar/cura-avatar.d.ts +24 -0
  436. package/dist/types/components/cura-avatar/cura-avatar.definitions.d.ts +14 -0
  437. package/dist/types/components/cura-avatar/cura-avatar.stories.d.ts +167 -0
  438. package/dist/types/components/cura-calendar/cura-calendar.d.ts +323 -0
  439. package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +128 -0
  440. package/dist/types/components/cura-card/cura-card.d.ts +48 -0
  441. package/dist/types/components/cura-card/cura-card.stories.d.ts +98 -0
  442. package/dist/types/components/cura-icon/cura-icon.d.ts +12 -12
  443. package/dist/types/components/cura-icon/cura-icon.definitions.d.ts +44 -44
  444. package/dist/types/components/cura-icon/cura-icon.stories.d.ts +56 -56
  445. package/dist/types/components/cura-icons-view/cura-icons-view.d.ts +6 -6
  446. package/dist/types/components/cura-icons-view/cura-icons-view.stories.d.ts +3 -3
  447. package/dist/types/components/cura-page-template/cura-page-template.d.ts +6 -6
  448. package/dist/types/components/forms/cura-checkbox/cura-checkbox.d.ts +111 -95
  449. package/dist/types/components/forms/cura-checkbox/cura-checkbox.stories.d.ts +193 -193
  450. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts +27 -0
  451. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts +44 -0
  452. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.d.ts +3 -0
  453. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +103 -0
  454. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.stories.d.ts +112 -0
  455. package/dist/types/components/forms/cura-forms.definitions.d.ts +12 -12
  456. package/dist/types/components/forms/cura-input-text/cura-input-text.d.ts +169 -132
  457. package/dist/types/components/forms/cura-input-text/cura-input-text.stories.d.ts +241 -218
  458. package/dist/types/components/forms/cura-input-text/mask-presets/input-mask-presets.d.ts +1 -2
  459. package/dist/types/components/forms/cura-label/cura-label.d.ts +52 -52
  460. package/dist/types/components/forms/cura-label/cura-label.stories.d.ts +112 -112
  461. package/dist/types/components/forms/cura-radio/cura-radio.d.ts +96 -74
  462. package/dist/types/components/forms/cura-radio/cura-radio.stories.d.ts +162 -162
  463. package/dist/types/components/forms/cura-select/cura-select.d.ts +176 -0
  464. package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +156 -0
  465. package/dist/types/components/forms/cura-select-options/cura-select-option.d.ts +17 -0
  466. package/dist/types/components/forms/cura-switch/cura-switch.d.ts +78 -57
  467. package/dist/types/components/forms/cura-switch/cura-switch.stories.d.ts +121 -121
  468. package/dist/types/components/loaders/cura-loader-circle/cura-loader-circle.d.ts +21 -21
  469. package/dist/types/components/loaders/cura-loader-circle/cura-loader-circle.stories.d.ts +35 -35
  470. package/dist/types/components/text/cura-display/cura-display.d.ts +47 -47
  471. package/dist/types/components/text/cura-display/cura-display.stories.d.ts +101 -101
  472. package/dist/types/components/text/cura-heading/cura-heading.d.ts +58 -58
  473. package/dist/types/components/text/cura-heading/cura-heading.stories.d.ts +127 -127
  474. package/dist/types/components/text/cura-paragraph/cura-paragraph.d.ts +47 -47
  475. package/dist/types/components/text/cura-paragraph/cura-paragraph.stories.d.ts +99 -99
  476. package/dist/types/components.d.ts +689 -13
  477. package/dist/types/index.d.ts +4 -4
  478. package/dist/types/rededor-cura-start.d.ts +4 -4
  479. package/dist/types/stencil-public-runtime.d.ts +51 -15
  480. package/package.json +5 -5
  481. package/dist/cjs/app-globals-2988084b.js +0 -511
  482. package/dist/cjs/app-globals-2988084b.js.map +0 -1
  483. package/dist/cjs/css-shim-83cf0349.js +0 -8
  484. package/dist/cjs/css-shim-83cf0349.js.map +0 -1
  485. package/dist/cjs/cura-accordion_8.cjs.entry.js +0 -445
  486. package/dist/cjs/cura-accordion_8.cjs.entry.js.map +0 -1
  487. package/dist/cjs/cura-button-transparent.cjs.entry.js +0 -83
  488. package/dist/cjs/cura-button-transparent.cjs.entry.js.map +0 -1
  489. package/dist/cjs/cura-forms.definitions-11be2ebd.js +0 -20
  490. package/dist/cjs/cura-forms.definitions-11be2ebd.js.map +0 -1
  491. package/dist/cjs/cura-icon.definitions-b73b0178.js +0 -21
  492. package/dist/cjs/cura-icon.definitions-b73b0178.js.map +0 -1
  493. package/dist/cjs/cura-input-text.cjs.entry.js.map +0 -1
  494. package/dist/cjs/cura-label.cjs.entry.js +0 -69
  495. package/dist/cjs/cura-label.cjs.entry.js.map +0 -1
  496. package/dist/cjs/index-7616f620.js +0 -2281
  497. package/dist/cjs/index-7616f620.js.map +0 -1
  498. package/dist/cjs/shadow-css-8baae635.js +0 -391
  499. package/dist/cjs/shadow-css-8baae635.js.map +0 -1
  500. package/dist/collection/utils/utils.spec.js +0 -16
  501. package/dist/collection/utils/utils.spec.js.map +0 -1
  502. package/dist/cura/cura.js +0 -133
  503. package/dist/cura/p-118112e5.system.js +0 -14
  504. package/dist/cura/p-118112e5.system.js.map +0 -1
  505. package/dist/cura/p-120926c5.system.js +0 -2
  506. package/dist/cura/p-120926c5.system.js.map +0 -1
  507. package/dist/cura/p-1228e771.entry.js +0 -2
  508. package/dist/cura/p-1228e771.entry.js.map +0 -1
  509. package/dist/cura/p-183305c3.js +0 -2
  510. package/dist/cura/p-183305c3.js.map +0 -1
  511. package/dist/cura/p-2d42ccf4.entry.js +0 -2
  512. package/dist/cura/p-2d42ccf4.entry.js.map +0 -1
  513. package/dist/cura/p-3688570d.js.map +0 -1
  514. package/dist/cura/p-36a83bc7.system.js +0 -3
  515. package/dist/cura/p-36a83bc7.system.js.map +0 -1
  516. package/dist/cura/p-3f3355f3.system.entry.js +0 -2
  517. package/dist/cura/p-3f3355f3.system.entry.js.map +0 -1
  518. package/dist/cura/p-3f5de5e2.entry.js +0 -2
  519. package/dist/cura/p-3f5de5e2.entry.js.map +0 -1
  520. package/dist/cura/p-3f6aaefc.system.js +0 -2
  521. package/dist/cura/p-3f6aaefc.system.js.map +0 -1
  522. package/dist/cura/p-48426f60.system.js +0 -2
  523. package/dist/cura/p-48426f60.system.js.map +0 -1
  524. package/dist/cura/p-4db87e8d.system.entry.js +0 -2
  525. package/dist/cura/p-4db87e8d.system.entry.js.map +0 -1
  526. package/dist/cura/p-51e00a16.entry.js +0 -2
  527. package/dist/cura/p-51e00a16.entry.js.map +0 -1
  528. package/dist/cura/p-72a9ed55.entry.js +0 -2
  529. package/dist/cura/p-72a9ed55.entry.js.map +0 -1
  530. package/dist/cura/p-75b2e4d1.system.entry.js +0 -2
  531. package/dist/cura/p-75b2e4d1.system.entry.js.map +0 -1
  532. package/dist/cura/p-880917c1.entry.js +0 -2
  533. package/dist/cura/p-880917c1.entry.js.map +0 -1
  534. package/dist/cura/p-8d959fb2.entry.js +0 -2
  535. package/dist/cura/p-8d959fb2.entry.js.map +0 -1
  536. package/dist/cura/p-9471c93e.system.entry.js +0 -2
  537. package/dist/cura/p-9471c93e.system.entry.js.map +0 -1
  538. package/dist/cura/p-98014544.entry.js +0 -2
  539. package/dist/cura/p-98014544.entry.js.map +0 -1
  540. package/dist/cura/p-98352c92.system.entry.js +0 -2
  541. package/dist/cura/p-98352c92.system.entry.js.map +0 -1
  542. package/dist/cura/p-a32889a4.system.js +0 -2
  543. package/dist/cura/p-a32889a4.system.js.map +0 -1
  544. package/dist/cura/p-ab8c9a8f.system.entry.js +0 -2
  545. package/dist/cura/p-ab8c9a8f.system.entry.js.map +0 -1
  546. package/dist/cura/p-ad194144.entry.js +0 -2
  547. package/dist/cura/p-ad194144.entry.js.map +0 -1
  548. package/dist/cura/p-b0e13882.system.entry.js +0 -2
  549. package/dist/cura/p-b0e13882.system.entry.js.map +0 -1
  550. package/dist/cura/p-ba66d7be.js +0 -3
  551. package/dist/cura/p-ba66d7be.js.map +0 -1
  552. package/dist/cura/p-bb3f9d05.entry.js +0 -2
  553. package/dist/cura/p-bb3f9d05.entry.js.map +0 -1
  554. package/dist/cura/p-beab48cd.js +0 -13
  555. package/dist/cura/p-beab48cd.js.map +0 -1
  556. package/dist/cura/p-c791725b.js.map +0 -1
  557. package/dist/cura/p-cb4e2a0c.system.entry.js +0 -2
  558. package/dist/cura/p-cb4e2a0c.system.entry.js.map +0 -1
  559. package/dist/cura/p-d3f9c888.system.js +0 -2
  560. package/dist/cura/p-d3f9c888.system.js.map +0 -1
  561. package/dist/cura/p-e5e259fd.system.entry.js +0 -2
  562. package/dist/cura/p-e5e259fd.system.entry.js.map +0 -1
  563. package/dist/cura/p-edeffbfc.entry.js +0 -2
  564. package/dist/cura/p-edeffbfc.entry.js.map +0 -1
  565. package/dist/cura/p-f51705c2.system.entry.js +0 -2
  566. package/dist/cura/p-f51705c2.system.entry.js.map +0 -1
  567. package/dist/cura/p-f89f2ecc.system.entry.js +0 -2
  568. package/dist/cura/p-f89f2ecc.system.entry.js.map +0 -1
  569. package/dist/cura/p-f8fffdc1.js.map +0 -1
  570. package/dist/cura/p-fc4ba4ce.system.js +0 -2
  571. package/dist/cura/p-fc4ba4ce.system.js.map +0 -1
  572. package/dist/cura/p-fef52079.entry.js +0 -2
  573. package/dist/cura/p-fef52079.entry.js.map +0 -1
  574. package/dist/cura/p-ffd41520.system.entry.js +0 -2
  575. package/dist/cura/p-ffd41520.system.entry.js.map +0 -1
  576. package/dist/esm/app-globals-29001758.js +0 -509
  577. package/dist/esm/app-globals-29001758.js.map +0 -1
  578. package/dist/esm/css-shim-d13f0738.js +0 -6
  579. package/dist/esm/css-shim-d13f0738.js.map +0 -1
  580. package/dist/esm/cura-accordion_8.entry.js +0 -434
  581. package/dist/esm/cura-accordion_8.entry.js.map +0 -1
  582. package/dist/esm/cura-button-transparent.entry.js +0 -79
  583. package/dist/esm/cura-button-transparent.entry.js.map +0 -1
  584. package/dist/esm/cura-forms.definitions-0f774253.js +0 -18
  585. package/dist/esm/cura-forms.definitions-0f774253.js.map +0 -1
  586. package/dist/esm/cura-icon.definitions-a63d1862.js +0 -18
  587. package/dist/esm/cura-icon.definitions-a63d1862.js.map +0 -1
  588. package/dist/esm/cura-input-text.entry.js.map +0 -1
  589. package/dist/esm/cura-label.entry.js +0 -65
  590. package/dist/esm/cura-label.entry.js.map +0 -1
  591. package/dist/esm/index-81f1a268.js +0 -2249
  592. package/dist/esm/index-81f1a268.js.map +0 -1
  593. package/dist/esm/polyfills/core-js.js +0 -11
  594. package/dist/esm/polyfills/css-shim.js +0 -1
  595. package/dist/esm/polyfills/dom.js +0 -79
  596. package/dist/esm/polyfills/es5-html-element.js +0 -1
  597. package/dist/esm/polyfills/index.js +0 -34
  598. package/dist/esm/polyfills/system.js +0 -6
  599. package/dist/esm/shadow-css-07b0c8c8.js +0 -389
  600. package/dist/esm/shadow-css-07b0c8c8.js.map +0 -1
  601. package/dist/esm-es5/app-globals-29001758.js +0 -2
  602. package/dist/esm-es5/app-globals-29001758.js.map +0 -1
  603. package/dist/esm-es5/css-shim-d13f0738.js +0 -2
  604. package/dist/esm-es5/css-shim-d13f0738.js.map +0 -1
  605. package/dist/esm-es5/cura-accordion_8.entry.js +0 -2
  606. package/dist/esm-es5/cura-accordion_8.entry.js.map +0 -1
  607. package/dist/esm-es5/cura-alert.entry.js +0 -2
  608. package/dist/esm-es5/cura-alert.entry.js.map +0 -1
  609. package/dist/esm-es5/cura-button-outline.entry.js +0 -2
  610. package/dist/esm-es5/cura-button-outline.entry.js.map +0 -1
  611. package/dist/esm-es5/cura-button-select.entry.js +0 -2
  612. package/dist/esm-es5/cura-button-select.entry.js.map +0 -1
  613. package/dist/esm-es5/cura-button-transparent.entry.js +0 -2
  614. package/dist/esm-es5/cura-button-transparent.entry.js.map +0 -1
  615. package/dist/esm-es5/cura-checkbox.entry.js +0 -2
  616. package/dist/esm-es5/cura-checkbox.entry.js.map +0 -1
  617. package/dist/esm-es5/cura-display.entry.js +0 -2
  618. package/dist/esm-es5/cura-display.entry.js.map +0 -1
  619. package/dist/esm-es5/cura-forms.definitions-0f774253.js +0 -2
  620. package/dist/esm-es5/cura-icon.definitions-a63d1862.js +0 -2
  621. package/dist/esm-es5/cura-icons-view.entry.js +0 -2
  622. package/dist/esm-es5/cura-icons-view.entry.js.map +0 -1
  623. package/dist/esm-es5/cura-input-text.entry.js +0 -2
  624. package/dist/esm-es5/cura-input-text.entry.js.map +0 -1
  625. package/dist/esm-es5/cura-label.entry.js +0 -2
  626. package/dist/esm-es5/cura-label.entry.js.map +0 -1
  627. package/dist/esm-es5/cura-radio.entry.js +0 -2
  628. package/dist/esm-es5/cura-radio.entry.js.map +0 -1
  629. package/dist/esm-es5/cura-switch.entry.js +0 -2
  630. package/dist/esm-es5/cura-switch.entry.js.map +0 -1
  631. package/dist/esm-es5/cura.js +0 -2
  632. package/dist/esm-es5/cura.js.map +0 -1
  633. package/dist/esm-es5/index-81f1a268.js +0 -3
  634. package/dist/esm-es5/index-81f1a268.js.map +0 -1
  635. package/dist/esm-es5/index.js +0 -2
  636. package/dist/esm-es5/index.js.map +0 -1
  637. package/dist/esm-es5/loader.js +0 -2
  638. package/dist/esm-es5/loader.js.map +0 -1
  639. package/dist/esm-es5/shadow-css-07b0c8c8.js +0 -13
  640. package/dist/esm-es5/shadow-css-07b0c8c8.js.map +0 -1
@@ -1,2249 +0,0 @@
1
- const NAMESPACE = 'cura';
2
-
3
- /**
4
- * Virtual DOM patching algorithm based on Snabbdom by
5
- * Simon Friis Vindum (@paldepind)
6
- * Licensed under the MIT License
7
- * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
8
- *
9
- * Modified for Stencil's renderer and slot projection
10
- */
11
- let scopeId;
12
- let contentRef;
13
- let hostTagName;
14
- let useNativeShadowDom = false;
15
- let checkSlotFallbackVisibility = false;
16
- let checkSlotRelocate = false;
17
- let isSvgMode = false;
18
- let queuePending = false;
19
- const createTime = (fnName, tagName = '') => {
20
- {
21
- return () => {
22
- return;
23
- };
24
- }
25
- };
26
- const uniqueTime = (key, measureText) => {
27
- {
28
- return () => {
29
- return;
30
- };
31
- }
32
- };
33
- const CONTENT_REF_ID = 'r';
34
- const ORG_LOCATION_ID = 'o';
35
- const SLOT_NODE_ID = 's';
36
- const TEXT_NODE_ID = 't';
37
- const HYDRATE_ID = 's-id';
38
- const HYDRATED_STYLE_ID = 'sty-id';
39
- const HYDRATE_CHILD_ID = 'c-id';
40
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
41
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
42
- /**
43
- * Default style mode id
44
- */
45
- /**
46
- * Reusable empty obj/array
47
- * Don't add values to these!!
48
- */
49
- const EMPTY_OBJ = {};
50
- /**
51
- * Namespaces
52
- */
53
- const SVG_NS = 'http://www.w3.org/2000/svg';
54
- const HTML_NS = 'http://www.w3.org/1999/xhtml';
55
- const isDef = (v) => v != null;
56
- /**
57
- * Check whether a value is a 'complex type', defined here as an object or a
58
- * function.
59
- *
60
- * @param o the value to check
61
- * @returns whether it's a complex type or not
62
- */
63
- const isComplexType = (o) => {
64
- // https://jsperf.com/typeof-fn-object/5
65
- o = typeof o;
66
- return o === 'object' || o === 'function';
67
- };
68
- /**
69
- * Helper method for querying a `meta` tag that contains a nonce value
70
- * out of a DOM's head.
71
- *
72
- * @param doc The DOM containing the `head` to query against
73
- * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
74
- * exists or the tag has no content.
75
- */
76
- function queryNonceMetaTagContent(doc) {
77
- var _a, _b, _c;
78
- return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
79
- }
80
- /**
81
- * Production h() function based on Preact by
82
- * Jason Miller (@developit)
83
- * Licensed under the MIT License
84
- * https://github.com/developit/preact/blob/master/LICENSE
85
- *
86
- * Modified for Stencil's compiler and vdom
87
- */
88
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
89
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
90
- const h = (nodeName, vnodeData, ...children) => {
91
- let child = null;
92
- let slotName = null;
93
- let simple = false;
94
- let lastSimple = false;
95
- const vNodeChildren = [];
96
- const walk = (c) => {
97
- for (let i = 0; i < c.length; i++) {
98
- child = c[i];
99
- if (Array.isArray(child)) {
100
- walk(child);
101
- }
102
- else if (child != null && typeof child !== 'boolean') {
103
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
104
- child = String(child);
105
- }
106
- if (simple && lastSimple) {
107
- // If the previous child was simple (string), we merge both
108
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
109
- }
110
- else {
111
- // Append a new vNode, if it's text, we create a text vNode
112
- vNodeChildren.push(simple ? newVNode(null, child) : child);
113
- }
114
- lastSimple = simple;
115
- }
116
- }
117
- };
118
- walk(children);
119
- if (vnodeData) {
120
- if (vnodeData.name) {
121
- slotName = vnodeData.name;
122
- }
123
- {
124
- const classData = vnodeData.className || vnodeData.class;
125
- if (classData) {
126
- vnodeData.class =
127
- typeof classData !== 'object'
128
- ? classData
129
- : Object.keys(classData)
130
- .filter((k) => classData[k])
131
- .join(' ');
132
- }
133
- }
134
- }
135
- const vnode = newVNode(nodeName, null);
136
- vnode.$attrs$ = vnodeData;
137
- if (vNodeChildren.length > 0) {
138
- vnode.$children$ = vNodeChildren;
139
- }
140
- {
141
- vnode.$name$ = slotName;
142
- }
143
- return vnode;
144
- };
145
- /**
146
- * A utility function for creating a virtual DOM node from a tag and some
147
- * possible text content.
148
- *
149
- * @param tag the tag for this element
150
- * @param text possible text content for the node
151
- * @returns a newly-minted virtual DOM node
152
- */
153
- const newVNode = (tag, text) => {
154
- const vnode = {
155
- $flags$: 0,
156
- $tag$: tag,
157
- $text$: text,
158
- $elm$: null,
159
- $children$: null,
160
- };
161
- {
162
- vnode.$attrs$ = null;
163
- }
164
- {
165
- vnode.$name$ = null;
166
- }
167
- return vnode;
168
- };
169
- const Host = {};
170
- /**
171
- * Check whether a given node is a Host node or not
172
- *
173
- * @param node the virtual DOM node to check
174
- * @returns whether it's a Host node or not
175
- */
176
- const isHost = (node) => node && node.$tag$ === Host;
177
- const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
178
- const endHydrate = createTime('hydrateClient', tagName);
179
- const shadowRoot = hostElm.shadowRoot;
180
- const childRenderNodes = [];
181
- const slotNodes = [];
182
- const shadowRootNodes = shadowRoot ? [] : null;
183
- const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
184
- if (!plt.$orgLocNodes$) {
185
- initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
186
- }
187
- hostElm[HYDRATE_ID] = hostId;
188
- hostElm.removeAttribute(HYDRATE_ID);
189
- clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
190
- childRenderNodes.map((c) => {
191
- const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
192
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
193
- const node = c.$elm$;
194
- if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
195
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
196
- }
197
- if (!shadowRoot) {
198
- node['s-hn'] = tagName;
199
- if (orgLocationNode) {
200
- node['s-ol'] = orgLocationNode;
201
- node['s-ol']['s-nr'] = node;
202
- }
203
- }
204
- plt.$orgLocNodes$.delete(orgLocationId);
205
- });
206
- if (shadowRoot) {
207
- shadowRootNodes.map((shadowRootNode) => {
208
- if (shadowRootNode) {
209
- shadowRoot.appendChild(shadowRootNode);
210
- }
211
- });
212
- }
213
- endHydrate();
214
- };
215
- const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
216
- let childNodeType;
217
- let childIdSplt;
218
- let childVNode;
219
- let i;
220
- if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
221
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
222
- if (childNodeType) {
223
- // got the node data from the element's attribute
224
- // `${hostId}.${nodeId}.${depth}.${index}`
225
- childIdSplt = childNodeType.split('.');
226
- if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
227
- childVNode = {
228
- $flags$: 0,
229
- $hostId$: childIdSplt[0],
230
- $nodeId$: childIdSplt[1],
231
- $depth$: childIdSplt[2],
232
- $index$: childIdSplt[3],
233
- $tag$: node.tagName.toLowerCase(),
234
- $elm$: node,
235
- $attrs$: null,
236
- $children$: null,
237
- $key$: null,
238
- $name$: null,
239
- $text$: null,
240
- };
241
- childRenderNodes.push(childVNode);
242
- node.removeAttribute(HYDRATE_CHILD_ID);
243
- // this is a new child vnode
244
- // so ensure its parent vnode has the vchildren array
245
- if (!parentVNode.$children$) {
246
- parentVNode.$children$ = [];
247
- }
248
- // add our child vnode to a specific index of the vnode's children
249
- parentVNode.$children$[childVNode.$index$] = childVNode;
250
- // this is now the new parent vnode for all the next child checks
251
- parentVNode = childVNode;
252
- if (shadowRootNodes && childVNode.$depth$ === '0') {
253
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
254
- }
255
- }
256
- }
257
- // recursively drill down, end to start so we can remove nodes
258
- for (i = node.childNodes.length - 1; i >= 0; i--) {
259
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
260
- }
261
- if (node.shadowRoot) {
262
- // keep drilling down through the shadow root nodes
263
- for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
264
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
265
- }
266
- }
267
- }
268
- else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
269
- // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
270
- childIdSplt = node.nodeValue.split('.');
271
- if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
272
- // comment node for either the host id or a 0 host id
273
- childNodeType = childIdSplt[0];
274
- childVNode = {
275
- $flags$: 0,
276
- $hostId$: childIdSplt[1],
277
- $nodeId$: childIdSplt[2],
278
- $depth$: childIdSplt[3],
279
- $index$: childIdSplt[4],
280
- $elm$: node,
281
- $attrs$: null,
282
- $children$: null,
283
- $key$: null,
284
- $name$: null,
285
- $tag$: null,
286
- $text$: null,
287
- };
288
- if (childNodeType === TEXT_NODE_ID) {
289
- childVNode.$elm$ = node.nextSibling;
290
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
291
- childVNode.$text$ = childVNode.$elm$.textContent;
292
- childRenderNodes.push(childVNode);
293
- // remove the text comment since it's no longer needed
294
- node.remove();
295
- if (!parentVNode.$children$) {
296
- parentVNode.$children$ = [];
297
- }
298
- parentVNode.$children$[childVNode.$index$] = childVNode;
299
- if (shadowRootNodes && childVNode.$depth$ === '0') {
300
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
301
- }
302
- }
303
- }
304
- else if (childVNode.$hostId$ === hostId) {
305
- // this comment node is specifcally for this host id
306
- if (childNodeType === SLOT_NODE_ID) {
307
- // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
308
- childVNode.$tag$ = 'slot';
309
- if (childIdSplt[5]) {
310
- node['s-sn'] = childVNode.$name$ = childIdSplt[5];
311
- }
312
- else {
313
- node['s-sn'] = '';
314
- }
315
- node['s-sr'] = true;
316
- if (shadowRootNodes) {
317
- // browser support shadowRoot and this is a shadow dom component
318
- // create an actual slot element
319
- childVNode.$elm$ = doc.createElement(childVNode.$tag$);
320
- if (childVNode.$name$) {
321
- // add the slot name attribute
322
- childVNode.$elm$.setAttribute('name', childVNode.$name$);
323
- }
324
- // insert the new slot element before the slot comment
325
- node.parentNode.insertBefore(childVNode.$elm$, node);
326
- // remove the slot comment since it's not needed for shadow
327
- node.remove();
328
- if (childVNode.$depth$ === '0') {
329
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
330
- }
331
- }
332
- slotNodes.push(childVNode);
333
- if (!parentVNode.$children$) {
334
- parentVNode.$children$ = [];
335
- }
336
- parentVNode.$children$[childVNode.$index$] = childVNode;
337
- }
338
- else if (childNodeType === CONTENT_REF_ID) {
339
- // `${CONTENT_REF_ID}.${hostId}`;
340
- if (shadowRootNodes) {
341
- // remove the content ref comment since it's not needed for shadow
342
- node.remove();
343
- }
344
- else {
345
- hostElm['s-cr'] = node;
346
- node['s-cn'] = true;
347
- }
348
- }
349
- }
350
- }
351
- }
352
- else if (parentVNode && parentVNode.$tag$ === 'style') {
353
- const vnode = newVNode(null, node.textContent);
354
- vnode.$elm$ = node;
355
- vnode.$index$ = '0';
356
- parentVNode.$children$ = [vnode];
357
- }
358
- };
359
- const initializeDocumentHydrate = (node, orgLocNodes) => {
360
- if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
361
- let i = 0;
362
- for (; i < node.childNodes.length; i++) {
363
- initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
364
- }
365
- if (node.shadowRoot) {
366
- for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
367
- initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
368
- }
369
- }
370
- }
371
- else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
372
- const childIdSplt = node.nodeValue.split('.');
373
- if (childIdSplt[0] === ORG_LOCATION_ID) {
374
- orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
375
- node.nodeValue = '';
376
- // useful to know if the original location is
377
- // the root light-dom of a shadow dom component
378
- node['s-en'] = childIdSplt[3];
379
- }
380
- }
381
- };
382
- /**
383
- * Parse a new property value for a given property type.
384
- *
385
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
386
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
387
- * 1. `any`, the type given to `propValue` in the function signature
388
- * 2. the type stored from `propType`.
389
- *
390
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
391
- *
392
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
393
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
394
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
395
- * ```tsx
396
- * <my-cmp prop-val={0}></my-cmp>
397
- * ```
398
- *
399
- * HTML prop values on the other hand, will always a string
400
- *
401
- * @param propValue the new value to coerce to some type
402
- * @param propType the type of the prop, expressed as a binary number
403
- * @returns the parsed/coerced value
404
- */
405
- const parsePropertyValue = (propValue, propType) => {
406
- // ensure this value is of the correct prop type
407
- if (propValue != null && !isComplexType(propValue)) {
408
- if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
409
- // per the HTML spec, any string value means it is a boolean true value
410
- // but we'll cheat here and say that the string "false" is the boolean false
411
- return propValue === 'false' ? false : propValue === '' || !!propValue;
412
- }
413
- if (propType & 2 /* MEMBER_FLAGS.Number */) {
414
- // force it to be a number
415
- return parseFloat(propValue);
416
- }
417
- if (propType & 1 /* MEMBER_FLAGS.String */) {
418
- // could have been passed as a number or boolean
419
- // but we still want it as a string
420
- return String(propValue);
421
- }
422
- // redundant return here for better minification
423
- return propValue;
424
- }
425
- // not sure exactly what type we want
426
- // so no need to change to a different type
427
- return propValue;
428
- };
429
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
430
- const createEvent = (ref, name, flags) => {
431
- const elm = getElement(ref);
432
- return {
433
- emit: (detail) => {
434
- return emitEvent(elm, name, {
435
- bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
436
- composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
437
- cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
438
- detail,
439
- });
440
- },
441
- };
442
- };
443
- /**
444
- * Helper function to create & dispatch a custom Event on a provided target
445
- * @param elm the target of the Event
446
- * @param name the name to give the custom Event
447
- * @param opts options for configuring a custom Event
448
- * @returns the custom Event
449
- */
450
- const emitEvent = (elm, name, opts) => {
451
- const ev = plt.ce(name, opts);
452
- elm.dispatchEvent(ev);
453
- return ev;
454
- };
455
- const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
456
- const registerStyle = (scopeId, cssText, allowCS) => {
457
- let style = styles.get(scopeId);
458
- if (supportsConstructableStylesheets && allowCS) {
459
- style = (style || new CSSStyleSheet());
460
- if (typeof style === 'string') {
461
- style = cssText;
462
- }
463
- else {
464
- style.replaceSync(cssText);
465
- }
466
- }
467
- else {
468
- style = cssText;
469
- }
470
- styles.set(scopeId, style);
471
- };
472
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
473
- var _a;
474
- let scopeId = getScopeId(cmpMeta);
475
- const style = styles.get(scopeId);
476
- // if an element is NOT connected then getRootNode() will return the wrong root node
477
- // so the fallback is to always use the document for the root node in those cases
478
- styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
479
- if (style) {
480
- if (typeof style === 'string') {
481
- styleContainerNode = styleContainerNode.head || styleContainerNode;
482
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
483
- let styleElm;
484
- if (!appliedStyles) {
485
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
486
- }
487
- if (!appliedStyles.has(scopeId)) {
488
- if (styleContainerNode.host &&
489
- (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
490
- // This is only happening on native shadow-dom, do not needs CSS var shim
491
- styleElm.innerHTML = style;
492
- }
493
- else {
494
- // TODO(STENCIL-659): Remove code implementing the CSS variable shim
495
- if (plt.$cssShim$) {
496
- // TODO(STENCIL-659): Remove code implementing the CSS variable shim
497
- styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style,
498
- // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
499
- !!(cmpMeta.$flags$ & 10 /* CMP_FLAGS.needsScopedEncapsulation */));
500
- const newScopeId = styleElm['s-sc'];
501
- if (newScopeId) {
502
- scopeId = newScopeId;
503
- // we don't want to add this styleID to the appliedStyles Set
504
- // since the cssVarShim might need to apply several different
505
- // stylesheets for the same component
506
- appliedStyles = null;
507
- }
508
- }
509
- else {
510
- styleElm = doc.createElement('style');
511
- styleElm.innerHTML = style;
512
- }
513
- // Apply CSP nonce to the style tag if it exists
514
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
515
- if (nonce != null) {
516
- styleElm.setAttribute('nonce', nonce);
517
- }
518
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
519
- }
520
- if (appliedStyles) {
521
- appliedStyles.add(scopeId);
522
- }
523
- }
524
- }
525
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
526
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
527
- }
528
- }
529
- return scopeId;
530
- };
531
- const attachStyles = (hostRef) => {
532
- const cmpMeta = hostRef.$cmpMeta$;
533
- const elm = hostRef.$hostElement$;
534
- const flags = cmpMeta.$flags$;
535
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
536
- const scopeId = addStyle(supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
537
- // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
538
- if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
539
- // only required when we're NOT using native shadow dom (slot)
540
- // or this browser doesn't support native shadow dom
541
- // and this host element was NOT created with SSR
542
- // let's pick out the inner content for slot projection
543
- // create a node to represent where the original
544
- // content was first placed, which is useful later on
545
- // DOM WRITE!!
546
- elm['s-sc'] = scopeId;
547
- elm.classList.add(scopeId + '-h');
548
- }
549
- endAttachStyles();
550
- };
551
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
552
- const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
553
- /**
554
- * Production setAccessor() function based on Preact by
555
- * Jason Miller (@developit)
556
- * Licensed under the MIT License
557
- * https://github.com/developit/preact/blob/master/LICENSE
558
- *
559
- * Modified for Stencil's compiler and vdom
560
- */
561
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
562
- if (oldValue !== newValue) {
563
- let isProp = isMemberInElement(elm, memberName);
564
- let ln = memberName.toLowerCase();
565
- if (memberName === 'class') {
566
- const classList = elm.classList;
567
- const oldClasses = parseClassList(oldValue);
568
- const newClasses = parseClassList(newValue);
569
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
570
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
571
- }
572
- else if (memberName === 'style') {
573
- // update style attribute, css properties and values
574
- {
575
- for (const prop in oldValue) {
576
- if (!newValue || newValue[prop] == null) {
577
- if (prop.includes('-')) {
578
- elm.style.removeProperty(prop);
579
- }
580
- else {
581
- elm.style[prop] = '';
582
- }
583
- }
584
- }
585
- }
586
- for (const prop in newValue) {
587
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
588
- if (prop.includes('-')) {
589
- elm.style.setProperty(prop, newValue[prop]);
590
- }
591
- else {
592
- elm.style[prop] = newValue[prop];
593
- }
594
- }
595
- }
596
- }
597
- else if (memberName === 'ref') {
598
- // minifier will clean this up
599
- if (newValue) {
600
- newValue(elm);
601
- }
602
- }
603
- else if ((!isProp ) &&
604
- memberName[0] === 'o' &&
605
- memberName[1] === 'n') {
606
- // Event Handlers
607
- // so if the member name starts with "on" and the 3rd characters is
608
- // a capital letter, and it's not already a member on the element,
609
- // then we're assuming it's an event listener
610
- if (memberName[2] === '-') {
611
- // on- prefixed events
612
- // allows to be explicit about the dom event to listen without any magic
613
- // under the hood:
614
- // <my-cmp on-click> // listens for "click"
615
- // <my-cmp on-Click> // listens for "Click"
616
- // <my-cmp on-ionChange> // listens for "ionChange"
617
- // <my-cmp on-EVENTS> // listens for "EVENTS"
618
- memberName = memberName.slice(3);
619
- }
620
- else if (isMemberInElement(win, ln)) {
621
- // standard event
622
- // the JSX attribute could have been "onMouseOver" and the
623
- // member name "onmouseover" is on the window's prototype
624
- // so let's add the listener "mouseover", which is all lowercased
625
- memberName = ln.slice(2);
626
- }
627
- else {
628
- // custom event
629
- // the JSX attribute could have been "onMyCustomEvent"
630
- // so let's trim off the "on" prefix and lowercase the first character
631
- // and add the listener "myCustomEvent"
632
- // except for the first character, we keep the event name case
633
- memberName = ln[2] + memberName.slice(3);
634
- }
635
- if (oldValue) {
636
- plt.rel(elm, memberName, oldValue, false);
637
- }
638
- if (newValue) {
639
- plt.ael(elm, memberName, newValue, false);
640
- }
641
- }
642
- else {
643
- // Set property if it exists and it's not a SVG
644
- const isComplex = isComplexType(newValue);
645
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
646
- try {
647
- if (!elm.tagName.includes('-')) {
648
- const n = newValue == null ? '' : newValue;
649
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
650
- if (memberName === 'list') {
651
- isProp = false;
652
- }
653
- else if (oldValue == null || elm[memberName] != n) {
654
- elm[memberName] = n;
655
- }
656
- }
657
- else {
658
- elm[memberName] = newValue;
659
- }
660
- }
661
- catch (e) { }
662
- }
663
- /**
664
- * Need to manually update attribute if:
665
- * - memberName is not an attribute
666
- * - if we are rendering the host element in order to reflect attribute
667
- * - if it's a SVG, since properties might not work in <svg>
668
- * - if the newValue is null/undefined or 'false'.
669
- */
670
- let xlink = false;
671
- {
672
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
673
- memberName = ln;
674
- xlink = true;
675
- }
676
- }
677
- if (newValue == null || newValue === false) {
678
- if (newValue !== false || elm.getAttribute(memberName) === '') {
679
- if (xlink) {
680
- elm.removeAttributeNS(XLINK_NS, memberName);
681
- }
682
- else {
683
- elm.removeAttribute(memberName);
684
- }
685
- }
686
- }
687
- else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
688
- newValue = newValue === true ? '' : newValue;
689
- if (xlink) {
690
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
691
- }
692
- else {
693
- elm.setAttribute(memberName, newValue);
694
- }
695
- }
696
- }
697
- }
698
- };
699
- const parseClassListRegex = /\s/;
700
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
701
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
702
- // if the element passed in is a shadow root, which is a document fragment
703
- // then we want to be adding attrs/props to the shadow root's "host" element
704
- // if it's not a shadow root, then we add attrs/props to the same element
705
- const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
706
- ? newVnode.$elm$.host
707
- : newVnode.$elm$;
708
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
709
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
710
- {
711
- // remove attributes no longer present on the vnode by setting them to undefined
712
- for (memberName in oldVnodeAttrs) {
713
- if (!(memberName in newVnodeAttrs)) {
714
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
715
- }
716
- }
717
- }
718
- // add new & update changed attributes
719
- for (memberName in newVnodeAttrs) {
720
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
721
- }
722
- };
723
- /**
724
- * Create a DOM Node corresponding to one of the children of a given VNode.
725
- *
726
- * @param oldParentVNode the parent VNode from the previous render
727
- * @param newParentVNode the parent VNode from the current render
728
- * @param childIndex the index of the VNode, in the _new_ parent node's
729
- * children, for which we will create a new DOM node
730
- * @param parentElm the parent DOM node which our new node will be a child of
731
- * @returns the newly created node
732
- */
733
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
734
- // tslint:disable-next-line: prefer-const
735
- const newVNode = newParentVNode.$children$[childIndex];
736
- let i = 0;
737
- let elm;
738
- let childNode;
739
- let oldVNode;
740
- if (!useNativeShadowDom) {
741
- // remember for later we need to check to relocate nodes
742
- checkSlotRelocate = true;
743
- if (newVNode.$tag$ === 'slot') {
744
- if (scopeId) {
745
- // scoped css needs to add its scoped id to the parent element
746
- parentElm.classList.add(scopeId + '-s');
747
- }
748
- newVNode.$flags$ |= newVNode.$children$
749
- ? // slot element has fallback content
750
- 2 /* VNODE_FLAGS.isSlotFallback */
751
- : // slot element does not have fallback content
752
- 1 /* VNODE_FLAGS.isSlotReference */;
753
- }
754
- }
755
- if (newVNode.$text$ !== null) {
756
- // create text node
757
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
758
- }
759
- else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
760
- // create a slot reference node
761
- elm = newVNode.$elm$ =
762
- doc.createTextNode('');
763
- }
764
- else {
765
- if (!isSvgMode) {
766
- isSvgMode = newVNode.$tag$ === 'svg';
767
- }
768
- // create element
769
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
770
- ? 'slot-fb'
771
- : newVNode.$tag$)
772
- );
773
- if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
774
- isSvgMode = false;
775
- }
776
- // add css classes, attrs, props, listeners, etc.
777
- {
778
- updateElement(null, newVNode, isSvgMode);
779
- }
780
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
781
- // if there is a scopeId and this is the initial render
782
- // then let's add the scopeId as a css class
783
- elm.classList.add((elm['s-si'] = scopeId));
784
- }
785
- if (newVNode.$children$) {
786
- for (i = 0; i < newVNode.$children$.length; ++i) {
787
- // create the node
788
- childNode = createElm(oldParentVNode, newVNode, i, elm);
789
- // return node could have been null
790
- if (childNode) {
791
- // append our new node
792
- elm.appendChild(childNode);
793
- }
794
- }
795
- }
796
- {
797
- if (newVNode.$tag$ === 'svg') {
798
- // Only reset the SVG context when we're exiting <svg> element
799
- isSvgMode = false;
800
- }
801
- else if (elm.tagName === 'foreignObject') {
802
- // Reenter SVG context when we're exiting <foreignObject> element
803
- isSvgMode = true;
804
- }
805
- }
806
- }
807
- {
808
- elm['s-hn'] = hostTagName;
809
- if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
810
- // remember the content reference comment
811
- elm['s-sr'] = true;
812
- // remember the content reference comment
813
- elm['s-cr'] = contentRef;
814
- // remember the slot name, or empty string for default slot
815
- elm['s-sn'] = newVNode.$name$ || '';
816
- // check if we've got an old vnode for this slot
817
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
818
- if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
819
- // we've got an old slot vnode and the wrapper is being replaced
820
- // so let's move the old slot content back to it's original location
821
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
822
- }
823
- }
824
- }
825
- return elm;
826
- };
827
- const putBackInOriginalLocation = (parentElm, recursive) => {
828
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
829
- const oldSlotChildNodes = parentElm.childNodes;
830
- for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
831
- const childNode = oldSlotChildNodes[i];
832
- if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
833
- // // this child node in the old element is from another component
834
- // // remove this node from the old slot's parent
835
- // childNode.remove();
836
- // and relocate it back to it's original location
837
- parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
838
- // remove the old original location comment entirely
839
- // later on the patch function will know what to do
840
- // and move this to the correct spot in need be
841
- childNode['s-ol'].remove();
842
- childNode['s-ol'] = undefined;
843
- checkSlotRelocate = true;
844
- }
845
- if (recursive) {
846
- putBackInOriginalLocation(childNode, recursive);
847
- }
848
- }
849
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
850
- };
851
- /**
852
- * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
853
- * add them to the DOM in the appropriate place.
854
- *
855
- * @param parentElm the DOM node which should be used as a parent for the new
856
- * DOM nodes
857
- * @param before a child of the `parentElm` which the new children should be
858
- * inserted before (optional)
859
- * @param parentVNode the parent virtual DOM node
860
- * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
861
- * @param startIdx the index in the child virtual DOM nodes at which to start
862
- * creating DOM nodes (inclusive)
863
- * @param endIdx the index in the child virtual DOM nodes at which to stop
864
- * creating DOM nodes (inclusive)
865
- */
866
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
867
- let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
868
- let childNode;
869
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
870
- containerElm = containerElm.shadowRoot;
871
- }
872
- for (; startIdx <= endIdx; ++startIdx) {
873
- if (vnodes[startIdx]) {
874
- childNode = createElm(null, parentVNode, startIdx, parentElm);
875
- if (childNode) {
876
- vnodes[startIdx].$elm$ = childNode;
877
- containerElm.insertBefore(childNode, referenceNode(before) );
878
- }
879
- }
880
- }
881
- };
882
- /**
883
- * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
884
- * This can be used to, for instance, clean up after a list of children which
885
- * should no longer be shown.
886
- *
887
- * This function also handles some of Stencil's slot relocation logic.
888
- *
889
- * @param vnodes a list of virtual DOM nodes to remove
890
- * @param startIdx the index at which to start removing nodes (inclusive)
891
- * @param endIdx the index at which to stop removing nodes (inclusive)
892
- */
893
- const removeVnodes = (vnodes, startIdx, endIdx) => {
894
- for (let index = startIdx; index <= endIdx; ++index) {
895
- const vnode = vnodes[index];
896
- if (vnode) {
897
- const elm = vnode.$elm$;
898
- nullifyVNodeRefs(vnode);
899
- if (elm) {
900
- {
901
- // we're removing this element
902
- // so it's possible we need to show slot fallback content now
903
- checkSlotFallbackVisibility = true;
904
- if (elm['s-ol']) {
905
- // remove the original location comment
906
- elm['s-ol'].remove();
907
- }
908
- else {
909
- // it's possible that child nodes of the node
910
- // that's being removed are slot nodes
911
- putBackInOriginalLocation(elm, true);
912
- }
913
- }
914
- // remove the vnode's element from the dom
915
- elm.remove();
916
- }
917
- }
918
- }
919
- };
920
- /**
921
- * Reconcile the children of a new VNode with the children of an old VNode by
922
- * traversing the two collections of children, identifying nodes that are
923
- * conserved or changed, calling out to `patch` to make any necessary
924
- * updates to the DOM, and rearranging DOM nodes as needed.
925
- *
926
- * The algorithm for reconciling children works by analyzing two 'windows' onto
927
- * the two arrays of children (`oldCh` and `newCh`). We keep track of the
928
- * 'windows' by storing start and end indices and references to the
929
- * corresponding array entries. Initially the two 'windows' are basically equal
930
- * to the entire array, but we progressively narrow the windows until there are
931
- * no children left to update by doing the following:
932
- *
933
- * 1. Skip any `null` entries at the beginning or end of the two arrays, so
934
- * that if we have an initial array like the following we'll end up dealing
935
- * only with a window bounded by the highlighted elements:
936
- *
937
- * [null, null, VNode1 , ... , VNode2, null, null]
938
- * ^^^^^^ ^^^^^^
939
- *
940
- * 2. Check to see if the elements at the head and tail positions are equal
941
- * across the windows. This will basically detect elements which haven't
942
- * been added, removed, or changed position, i.e. if you had the following
943
- * VNode elements (represented as HTML):
944
- *
945
- * oldVNode: `<div><p><span>HEY</span></p></div>`
946
- * newVNode: `<div><p><span>THERE</span></p></div>`
947
- *
948
- * Then when comparing the children of the `<div>` tag we check the equality
949
- * of the VNodes corresponding to the `<p>` tags and, since they are the
950
- * same tag in the same position, we'd be able to avoid completely
951
- * re-rendering the subtree under them with a new DOM element and would just
952
- * call out to `patch` to handle reconciling their children and so on.
953
- *
954
- * 3. Check, for both windows, to see if the element at the beginning of the
955
- * window corresponds to the element at the end of the other window. This is
956
- * a heuristic which will let us identify _some_ situations in which
957
- * elements have changed position, for instance it _should_ detect that the
958
- * children nodes themselves have not changed but merely moved in the
959
- * following example:
960
- *
961
- * oldVNode: `<div><element-one /><element-two /></div>`
962
- * newVNode: `<div><element-two /><element-one /></div>`
963
- *
964
- * If we find cases like this then we also need to move the concrete DOM
965
- * elements corresponding to the moved children to write the re-order to the
966
- * DOM.
967
- *
968
- * 4. Finally, if VNodes have the `key` attribute set on them we check for any
969
- * nodes in the old children which have the same key as the first element in
970
- * our window on the new children. If we find such a node we handle calling
971
- * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
972
- * what we find.
973
- *
974
- * Finally, once we've narrowed our 'windows' to the point that either of them
975
- * collapse (i.e. they have length 0) we then handle any remaining VNode
976
- * insertion or deletion that needs to happen to get a DOM state that correctly
977
- * reflects the new child VNodes. If, for instance, after our window on the old
978
- * children has collapsed we still have more nodes on the new children that
979
- * we haven't dealt with yet then we need to add them, or if the new children
980
- * collapse but we still have unhandled _old_ children then we need to make
981
- * sure the corresponding DOM nodes are removed.
982
- *
983
- * @param parentElm the node into which the parent VNode is rendered
984
- * @param oldCh the old children of the parent node
985
- * @param newVNode the new VNode which will replace the parent
986
- * @param newCh the new children of the parent node
987
- */
988
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
989
- let oldStartIdx = 0;
990
- let newStartIdx = 0;
991
- let oldEndIdx = oldCh.length - 1;
992
- let oldStartVnode = oldCh[0];
993
- let oldEndVnode = oldCh[oldEndIdx];
994
- let newEndIdx = newCh.length - 1;
995
- let newStartVnode = newCh[0];
996
- let newEndVnode = newCh[newEndIdx];
997
- let node;
998
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
999
- if (oldStartVnode == null) {
1000
- // VNode might have been moved left
1001
- oldStartVnode = oldCh[++oldStartIdx];
1002
- }
1003
- else if (oldEndVnode == null) {
1004
- oldEndVnode = oldCh[--oldEndIdx];
1005
- }
1006
- else if (newStartVnode == null) {
1007
- newStartVnode = newCh[++newStartIdx];
1008
- }
1009
- else if (newEndVnode == null) {
1010
- newEndVnode = newCh[--newEndIdx];
1011
- }
1012
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
1013
- // if the start nodes are the same then we should patch the new VNode
1014
- // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
1015
- // indices to reflect that. We don't need to move any DOM Nodes around
1016
- // since things are matched up in order.
1017
- patch(oldStartVnode, newStartVnode);
1018
- oldStartVnode = oldCh[++oldStartIdx];
1019
- newStartVnode = newCh[++newStartIdx];
1020
- }
1021
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
1022
- // likewise, if the end nodes are the same we patch new onto old and
1023
- // decrement our end indices, and also likewise in this case we don't
1024
- // need to move any DOM Nodes.
1025
- patch(oldEndVnode, newEndVnode);
1026
- oldEndVnode = oldCh[--oldEndIdx];
1027
- newEndVnode = newCh[--newEndIdx];
1028
- }
1029
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
1030
- // case: "Vnode moved right"
1031
- //
1032
- // We've found that the last node in our window on the new children is
1033
- // the same VNode as the _first_ node in our window on the old children
1034
- // we're dealing with now. Visually, this is the layout of these two
1035
- // nodes:
1036
- //
1037
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
1038
- // ^^^^^^^^^^^
1039
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
1040
- // ^^^^^^^^^^^^^
1041
- //
1042
- // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
1043
- // and move the DOM element for `oldStartVnode`.
1044
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1045
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1046
- }
1047
- patch(oldStartVnode, newEndVnode);
1048
- // We need to move the element for `oldStartVnode` into a position which
1049
- // will be appropriate for `newEndVnode`. For this we can use
1050
- // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
1051
- // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
1052
- // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
1053
- //
1054
- // <old-start-node />
1055
- // <some-intervening-node />
1056
- // <old-end-node />
1057
- // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
1058
- // <next-sibling />
1059
- //
1060
- // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
1061
- // the node for `oldStartVnode` at the end of the children of
1062
- // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
1063
- // aren't any siblings, and passing `null` to `Node.insertBefore` will
1064
- // append it to the children of the parent element.
1065
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
1066
- oldStartVnode = oldCh[++oldStartIdx];
1067
- newEndVnode = newCh[--newEndIdx];
1068
- }
1069
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
1070
- // case: "Vnode moved left"
1071
- //
1072
- // We've found that the first node in our window on the new children is
1073
- // the same VNode as the _last_ node in our window on the old children.
1074
- // Visually, this is the layout of these two nodes:
1075
- //
1076
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
1077
- // ^^^^^^^^^^^^^
1078
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
1079
- // ^^^^^^^^^^^
1080
- //
1081
- // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
1082
- // (which will handle updating any changed attributes, reconciling their
1083
- // children etc) but we also need to move the DOM node to which
1084
- // `oldEndVnode` corresponds.
1085
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1086
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1087
- }
1088
- patch(oldEndVnode, newStartVnode);
1089
- // We've already checked above if `oldStartVnode` and `newStartVnode` are
1090
- // the same node, so since we're here we know that they are not. Thus we
1091
- // can move the element for `oldEndVnode` _before_ the element for
1092
- // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
1093
- // future.
1094
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
1095
- oldEndVnode = oldCh[--oldEndIdx];
1096
- newStartVnode = newCh[++newStartIdx];
1097
- }
1098
- else {
1099
- {
1100
- // We either didn't find an element in the old children that matches
1101
- // the key of the first new child OR the build is not using `key`
1102
- // attributes at all. In either case we need to create a new element
1103
- // for the new node.
1104
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
1105
- newStartVnode = newCh[++newStartIdx];
1106
- }
1107
- if (node) {
1108
- // if we created a new node then handle inserting it to the DOM
1109
- {
1110
- parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
1111
- }
1112
- }
1113
- }
1114
- }
1115
- if (oldStartIdx > oldEndIdx) {
1116
- // we have some more new nodes to add which don't match up with old nodes
1117
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1118
- }
1119
- else if (newStartIdx > newEndIdx) {
1120
- // there are nodes in the `oldCh` array which no longer correspond to nodes
1121
- // in the new array, so lets remove them (which entails cleaning up the
1122
- // relevant DOM nodes)
1123
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1124
- }
1125
- };
1126
- /**
1127
- * Compare two VNodes to determine if they are the same
1128
- *
1129
- * **NB**: This function is an equality _heuristic_ based on the available
1130
- * information set on the two VNodes and can be misleading under certain
1131
- * circumstances. In particular, if the two nodes do not have `key` attrs
1132
- * (available under `$key$` on VNodes) then the function falls back on merely
1133
- * checking that they have the same tag.
1134
- *
1135
- * So, in other words, if `key` attrs are not set on VNodes which may be
1136
- * changing order within a `children` array or something along those lines then
1137
- * we could obtain a false negative and then have to do needless re-rendering
1138
- * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1139
- *
1140
- * @param leftVNode the first VNode to check
1141
- * @param rightVNode the second VNode to check
1142
- * @returns whether they're equal or not
1143
- */
1144
- const isSameVnode = (leftVNode, rightVNode) => {
1145
- // compare if two vnode to see if they're "technically" the same
1146
- // need to have the same element tag, and same key to be the same
1147
- if (leftVNode.$tag$ === rightVNode.$tag$) {
1148
- if (leftVNode.$tag$ === 'slot') {
1149
- return leftVNode.$name$ === rightVNode.$name$;
1150
- }
1151
- return true;
1152
- }
1153
- return false;
1154
- };
1155
- const referenceNode = (node) => {
1156
- // this node was relocated to a new location in the dom
1157
- // because of some other component's slot
1158
- // but we still have an html comment in place of where
1159
- // it's original location was according to it's original vdom
1160
- return (node && node['s-ol']) || node;
1161
- };
1162
- const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1163
- /**
1164
- * Handle reconciling an outdated VNode with a new one which corresponds to
1165
- * it. This function handles flushing updates to the DOM and reconciling the
1166
- * children of the two nodes (if any).
1167
- *
1168
- * @param oldVNode an old VNode whose DOM element and children we want to update
1169
- * @param newVNode a new VNode representing an updated version of the old one
1170
- */
1171
- const patch = (oldVNode, newVNode) => {
1172
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
1173
- const oldChildren = oldVNode.$children$;
1174
- const newChildren = newVNode.$children$;
1175
- const tag = newVNode.$tag$;
1176
- const text = newVNode.$text$;
1177
- let defaultHolder;
1178
- if (text === null) {
1179
- {
1180
- // test if we're rendering an svg element, or still rendering nodes inside of one
1181
- // only add this to the when the compiler sees we're using an svg somewhere
1182
- isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1183
- }
1184
- {
1185
- if (tag === 'slot')
1186
- ;
1187
- else {
1188
- // either this is the first render of an element OR it's an update
1189
- // AND we already know it's possible it could have changed
1190
- // this updates the element's css classes, attrs, props, listeners, etc.
1191
- updateElement(oldVNode, newVNode, isSvgMode);
1192
- }
1193
- }
1194
- if (oldChildren !== null && newChildren !== null) {
1195
- // looks like there's child vnodes for both the old and new vnodes
1196
- // so we need to call `updateChildren` to reconcile them
1197
- updateChildren(elm, oldChildren, newVNode, newChildren);
1198
- }
1199
- else if (newChildren !== null) {
1200
- // no old child vnodes, but there are new child vnodes to add
1201
- if (oldVNode.$text$ !== null) {
1202
- // the old vnode was text, so be sure to clear it out
1203
- elm.textContent = '';
1204
- }
1205
- // add the new vnode children
1206
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1207
- }
1208
- else if (oldChildren !== null) {
1209
- // no new child vnodes, but there are old child vnodes to remove
1210
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
1211
- }
1212
- if (isSvgMode && tag === 'svg') {
1213
- isSvgMode = false;
1214
- }
1215
- }
1216
- else if ((defaultHolder = elm['s-cr'])) {
1217
- // this element has slotted content
1218
- defaultHolder.parentNode.textContent = text;
1219
- }
1220
- else if (oldVNode.$text$ !== text) {
1221
- // update the text content for the text only vnode
1222
- // and also only if the text is different than before
1223
- elm.data = text;
1224
- }
1225
- };
1226
- const updateFallbackSlotVisibility = (elm) => {
1227
- // tslint:disable-next-line: prefer-const
1228
- const childNodes = elm.childNodes;
1229
- let childNode;
1230
- let i;
1231
- let ilen;
1232
- let j;
1233
- let slotNameAttr;
1234
- let nodeType;
1235
- for (i = 0, ilen = childNodes.length; i < ilen; i++) {
1236
- childNode = childNodes[i];
1237
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1238
- if (childNode['s-sr']) {
1239
- // this is a slot fallback node
1240
- // get the slot name for this slot reference node
1241
- slotNameAttr = childNode['s-sn'];
1242
- // by default always show a fallback slot node
1243
- // then hide it if there are other slots in the light dom
1244
- childNode.hidden = false;
1245
- for (j = 0; j < ilen; j++) {
1246
- nodeType = childNodes[j].nodeType;
1247
- if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
1248
- // this sibling node is from a different component OR is a named fallback slot node
1249
- if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
1250
- childNode.hidden = true;
1251
- break;
1252
- }
1253
- }
1254
- else {
1255
- // this is a default fallback slot node
1256
- // any element or text node (with content)
1257
- // should hide the default fallback slot node
1258
- if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1259
- (nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
1260
- childNode.hidden = true;
1261
- break;
1262
- }
1263
- }
1264
- }
1265
- }
1266
- // keep drilling down
1267
- updateFallbackSlotVisibility(childNode);
1268
- }
1269
- }
1270
- };
1271
- const relocateNodes = [];
1272
- const relocateSlotContent = (elm) => {
1273
- // tslint:disable-next-line: prefer-const
1274
- let childNode;
1275
- let node;
1276
- let hostContentNodes;
1277
- let slotNameAttr;
1278
- let relocateNodeData;
1279
- let j;
1280
- let i = 0;
1281
- const childNodes = elm.childNodes;
1282
- const ilen = childNodes.length;
1283
- for (; i < ilen; i++) {
1284
- childNode = childNodes[i];
1285
- if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1286
- // first got the content reference comment node
1287
- // then we got it's parent, which is where all the host content is in now
1288
- hostContentNodes = node.parentNode.childNodes;
1289
- slotNameAttr = childNode['s-sn'];
1290
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
1291
- node = hostContentNodes[j];
1292
- if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
1293
- // let's do some relocating to its new home
1294
- // but never relocate a content reference node
1295
- // that is suppose to always represent the original content location
1296
- if (isNodeLocatedInSlot(node, slotNameAttr)) {
1297
- // it's possible we've already decided to relocate this node
1298
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1299
- // made some changes to slots
1300
- // let's make sure we also double check
1301
- // fallbacks are correctly hidden or shown
1302
- checkSlotFallbackVisibility = true;
1303
- node['s-sn'] = node['s-sn'] || slotNameAttr;
1304
- if (relocateNodeData) {
1305
- // previously we never found a slot home for this node
1306
- // but turns out we did, so let's remember it now
1307
- relocateNodeData.$slotRefNode$ = childNode;
1308
- }
1309
- else {
1310
- // add to our list of nodes to relocate
1311
- relocateNodes.push({
1312
- $slotRefNode$: childNode,
1313
- $nodeToRelocate$: node,
1314
- });
1315
- }
1316
- if (node['s-sr']) {
1317
- relocateNodes.map((relocateNode) => {
1318
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1319
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1320
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
1321
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1322
- }
1323
- }
1324
- });
1325
- }
1326
- }
1327
- else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1328
- // so far this element does not have a slot home, not setting slotRefNode on purpose
1329
- // if we never find a home for this element then we'll need to hide it
1330
- relocateNodes.push({
1331
- $nodeToRelocate$: node,
1332
- });
1333
- }
1334
- }
1335
- }
1336
- }
1337
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1338
- relocateSlotContent(childNode);
1339
- }
1340
- }
1341
- };
1342
- const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
1343
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1344
- if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
1345
- return true;
1346
- }
1347
- if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
1348
- return true;
1349
- }
1350
- return false;
1351
- }
1352
- if (nodeToRelocate['s-sn'] === slotNameAttr) {
1353
- return true;
1354
- }
1355
- return slotNameAttr === '';
1356
- };
1357
- /**
1358
- * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
1359
- * calling them with `null`. This signals that the DOM element corresponding to
1360
- * the VDom node has been removed from the DOM.
1361
- *
1362
- * @param vNode a virtual DOM node
1363
- */
1364
- const nullifyVNodeRefs = (vNode) => {
1365
- {
1366
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1367
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1368
- }
1369
- };
1370
- /**
1371
- * The main entry point for Stencil's virtual DOM-based rendering engine
1372
- *
1373
- * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1374
- * function will handle creating a virtual DOM tree with a single root, patching
1375
- * the current virtual DOM tree onto an old one (if any), dealing with slot
1376
- * relocation, and reflecting attributes.
1377
- *
1378
- * @param hostRef data needed to root and render the virtual DOM tree, such as
1379
- * the DOM node into which it should be rendered.
1380
- * @param renderFnResults the virtual DOM nodes to be rendered
1381
- */
1382
- const renderVdom = (hostRef, renderFnResults) => {
1383
- const hostElm = hostRef.$hostElement$;
1384
- const cmpMeta = hostRef.$cmpMeta$;
1385
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1386
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1387
- hostTagName = hostElm.tagName;
1388
- if (cmpMeta.$attrsToReflect$) {
1389
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1390
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1391
- }
1392
- rootVnode.$tag$ = null;
1393
- rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1394
- hostRef.$vnode$ = rootVnode;
1395
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1396
- {
1397
- scopeId = hostElm['s-sc'];
1398
- }
1399
- {
1400
- contentRef = hostElm['s-cr'];
1401
- useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1402
- // always reset
1403
- checkSlotFallbackVisibility = false;
1404
- }
1405
- // synchronous patch
1406
- patch(oldVNode, rootVnode);
1407
- {
1408
- // while we're moving nodes around existing nodes, temporarily disable
1409
- // the disconnectCallback from working
1410
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1411
- if (checkSlotRelocate) {
1412
- relocateSlotContent(rootVnode.$elm$);
1413
- let relocateData;
1414
- let nodeToRelocate;
1415
- let orgLocationNode;
1416
- let parentNodeRef;
1417
- let insertBeforeNode;
1418
- let refNode;
1419
- let i = 0;
1420
- for (; i < relocateNodes.length; i++) {
1421
- relocateData = relocateNodes[i];
1422
- nodeToRelocate = relocateData.$nodeToRelocate$;
1423
- if (!nodeToRelocate['s-ol']) {
1424
- // add a reference node marking this node's original location
1425
- // keep a reference to this node for later lookups
1426
- orgLocationNode =
1427
- doc.createTextNode('');
1428
- orgLocationNode['s-nr'] = nodeToRelocate;
1429
- nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1430
- }
1431
- }
1432
- for (i = 0; i < relocateNodes.length; i++) {
1433
- relocateData = relocateNodes[i];
1434
- nodeToRelocate = relocateData.$nodeToRelocate$;
1435
- if (relocateData.$slotRefNode$) {
1436
- // by default we're just going to insert it directly
1437
- // after the slot reference node
1438
- parentNodeRef = relocateData.$slotRefNode$.parentNode;
1439
- insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
1440
- orgLocationNode = nodeToRelocate['s-ol'];
1441
- while ((orgLocationNode = orgLocationNode.previousSibling)) {
1442
- refNode = orgLocationNode['s-nr'];
1443
- if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1444
- refNode = refNode.nextSibling;
1445
- if (!refNode || !refNode['s-nr']) {
1446
- insertBeforeNode = refNode;
1447
- break;
1448
- }
1449
- }
1450
- }
1451
- if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1452
- nodeToRelocate.nextSibling !== insertBeforeNode) {
1453
- // we've checked that it's worth while to relocate
1454
- // since that the node to relocate
1455
- // has a different next sibling or parent relocated
1456
- if (nodeToRelocate !== insertBeforeNode) {
1457
- if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1458
- // probably a component in the index.html that doesn't have it's hostname set
1459
- nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1460
- }
1461
- // add it back to the dom but in its new home
1462
- parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1463
- }
1464
- }
1465
- }
1466
- else {
1467
- // this node doesn't have a slot home to go to, so let's hide it
1468
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1469
- nodeToRelocate.hidden = true;
1470
- }
1471
- }
1472
- }
1473
- }
1474
- if (checkSlotFallbackVisibility) {
1475
- updateFallbackSlotVisibility(rootVnode.$elm$);
1476
- }
1477
- // done moving nodes around
1478
- // allow the disconnect callback to work again
1479
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1480
- // always reset
1481
- relocateNodes.length = 0;
1482
- }
1483
- };
1484
- const attachToAncestor = (hostRef, ancestorComponent) => {
1485
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1486
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1487
- }
1488
- };
1489
- const scheduleUpdate = (hostRef, isInitialLoad) => {
1490
- {
1491
- hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1492
- }
1493
- if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1494
- hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1495
- return;
1496
- }
1497
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1498
- // there is no ancestor component or the ancestor component
1499
- // has already fired off its lifecycle update then
1500
- // fire off the initial update
1501
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1502
- return writeTask(dispatch) ;
1503
- };
1504
- /**
1505
- * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1506
- * component lifecycle methods like `componentWillLoad` as well as
1507
- * {@link updateComponent}, which will kick off the virtual DOM re-render.
1508
- *
1509
- * @param hostRef a reference to a host DOM node
1510
- * @param isInitialLoad whether we're on the initial load or not
1511
- * @returns an empty Promise which is used to enqueue a series of operations for
1512
- * the component
1513
- */
1514
- const dispatchHooks = (hostRef, isInitialLoad) => {
1515
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1516
- const instance = hostRef.$lazyInstance$ ;
1517
- // We're going to use this variable together with `enqueue` to implement a
1518
- // little promise-based queue. We start out with it `undefined`. When we add
1519
- // the first function to the queue we'll set this variable to be that
1520
- // function's return value. When we attempt to add subsequent values to the
1521
- // queue we'll check that value and, if it was a `Promise`, we'll then chain
1522
- // the new function off of that `Promise` using `.then()`. This will give our
1523
- // queue two nice properties:
1524
- //
1525
- // 1. If all functions added to the queue are synchronous they'll be called
1526
- // synchronously right away.
1527
- // 2. If all functions added to the queue are asynchronous they'll all be
1528
- // called in order after `dispatchHooks` exits.
1529
- let maybePromise;
1530
- endSchedule();
1531
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1532
- };
1533
- /**
1534
- * This function uses a Promise to implement a simple first-in, first-out queue
1535
- * of functions to be called.
1536
- *
1537
- * The queue is ordered on the basis of the first argument. If it's
1538
- * `undefined`, then nothing is on the queue yet, so the provided function can
1539
- * be called synchronously (although note that this function may return a
1540
- * `Promise`). The idea is that then the return value of that enqueueing
1541
- * operation is kept around, so that if it was a `Promise` then subsequent
1542
- * functions can be enqueued by calling this function again with that `Promise`
1543
- * as the first argument.
1544
- *
1545
- * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1546
- * @param fn a function to enqueue
1547
- * @returns either a `Promise` or the return value of the provided function
1548
- */
1549
- const enqueue = (maybePromise, fn) => maybePromise instanceof Promise ? maybePromise.then(fn) : fn();
1550
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
1551
- var _a;
1552
- const elm = hostRef.$hostElement$;
1553
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1554
- const rc = elm['s-rc'];
1555
- if (isInitialLoad) {
1556
- // DOM WRITE!
1557
- attachStyles(hostRef);
1558
- }
1559
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1560
- {
1561
- callRender(hostRef, instance);
1562
- }
1563
- // TODO(STENCIL-659): Remove code implementing the CSS variable shim
1564
- if (plt.$cssShim$) {
1565
- // TODO(STENCIL-659): Remove code implementing the CSS variable shim
1566
- plt.$cssShim$.updateHost(elm);
1567
- }
1568
- if (rc) {
1569
- // ok, so turns out there are some child host elements
1570
- // waiting on this parent element to load
1571
- // let's fire off all update callbacks waiting
1572
- rc.map((cb) => cb());
1573
- elm['s-rc'] = undefined;
1574
- }
1575
- endRender();
1576
- endUpdate();
1577
- {
1578
- const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1579
- const postUpdate = () => postUpdateComponent(hostRef);
1580
- if (childrenPromises.length === 0) {
1581
- postUpdate();
1582
- }
1583
- else {
1584
- Promise.all(childrenPromises).then(postUpdate);
1585
- hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1586
- childrenPromises.length = 0;
1587
- }
1588
- }
1589
- };
1590
- const callRender = (hostRef, instance, elm) => {
1591
- try {
1592
- instance = instance.render() ;
1593
- {
1594
- hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1595
- }
1596
- {
1597
- hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1598
- }
1599
- {
1600
- {
1601
- // looks like we've got child nodes to render into this host element
1602
- // or we need to update the css class/attrs on the host element
1603
- // DOM WRITE!
1604
- {
1605
- renderVdom(hostRef, instance);
1606
- }
1607
- }
1608
- }
1609
- }
1610
- catch (e) {
1611
- consoleError(e, hostRef.$hostElement$);
1612
- }
1613
- return null;
1614
- };
1615
- const postUpdateComponent = (hostRef) => {
1616
- const tagName = hostRef.$cmpMeta$.$tagName$;
1617
- const elm = hostRef.$hostElement$;
1618
- const endPostUpdate = createTime('postUpdate', tagName);
1619
- const instance = hostRef.$lazyInstance$ ;
1620
- const ancestorComponent = hostRef.$ancestorComponent$;
1621
- if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1622
- hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1623
- {
1624
- // DOM WRITE!
1625
- addHydratedFlag(elm);
1626
- }
1627
- {
1628
- safeCall(instance, 'componentDidLoad');
1629
- }
1630
- endPostUpdate();
1631
- {
1632
- hostRef.$onReadyResolve$(elm);
1633
- if (!ancestorComponent) {
1634
- appDidLoad();
1635
- }
1636
- }
1637
- }
1638
- else {
1639
- endPostUpdate();
1640
- }
1641
- // load events fire from bottom to top
1642
- // the deepest elements load first then bubbles up
1643
- {
1644
- if (hostRef.$onRenderResolve$) {
1645
- hostRef.$onRenderResolve$();
1646
- hostRef.$onRenderResolve$ = undefined;
1647
- }
1648
- if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1649
- nextTick(() => scheduleUpdate(hostRef, false));
1650
- }
1651
- hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1652
- }
1653
- // ( •_•)
1654
- // ( •_•)>⌐■-■
1655
- // (⌐■_■)
1656
- };
1657
- const appDidLoad = (who) => {
1658
- // on appload
1659
- // we have finish the first big initial render
1660
- {
1661
- addHydratedFlag(doc.documentElement);
1662
- }
1663
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1664
- };
1665
- const safeCall = (instance, method, arg) => {
1666
- if (instance && instance[method]) {
1667
- try {
1668
- return instance[method](arg);
1669
- }
1670
- catch (e) {
1671
- consoleError(e);
1672
- }
1673
- }
1674
- return undefined;
1675
- };
1676
- const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1677
- ;
1678
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1679
- const setValue = (ref, propName, newVal, cmpMeta) => {
1680
- // check our new property value against our internal value
1681
- const hostRef = getHostRef(ref);
1682
- const elm = hostRef.$hostElement$ ;
1683
- const oldVal = hostRef.$instanceValues$.get(propName);
1684
- const flags = hostRef.$flags$;
1685
- const instance = hostRef.$lazyInstance$ ;
1686
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1687
- // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1688
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1689
- const didValueChange = newVal !== oldVal && !areBothNaN;
1690
- if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1691
- // gadzooks! the property's value has changed!!
1692
- // set our new value!
1693
- hostRef.$instanceValues$.set(propName, newVal);
1694
- if (instance) {
1695
- // get an array of method names of watch functions to call
1696
- if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1697
- const watchMethods = cmpMeta.$watchers$[propName];
1698
- if (watchMethods) {
1699
- // this instance is watching for when this property changed
1700
- watchMethods.map((watchMethodName) => {
1701
- try {
1702
- // fire off each of the watch methods that are watching this property
1703
- instance[watchMethodName](newVal, oldVal, propName);
1704
- }
1705
- catch (e) {
1706
- consoleError(e, elm);
1707
- }
1708
- });
1709
- }
1710
- }
1711
- if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1712
- // looks like this value actually changed, so we've got work to do!
1713
- // but only if we've already rendered, otherwise just chill out
1714
- // queue that we need to do an update, but don't worry about queuing
1715
- // up millions cuz this function ensures it only runs once
1716
- scheduleUpdate(hostRef, false);
1717
- }
1718
- }
1719
- }
1720
- };
1721
- /**
1722
- * Attach a series of runtime constructs to a compiled Stencil component
1723
- * constructor, including getters and setters for the `@Prop` and `@State`
1724
- * decorators, callbacks for when attributes change, and so on.
1725
- *
1726
- * @param Cstr the constructor for a component that we need to process
1727
- * @param cmpMeta metadata collected previously about the component
1728
- * @param flags a number used to store a series of bit flags
1729
- * @returns a reference to the same constructor passed in (but now mutated)
1730
- */
1731
- const proxyComponent = (Cstr, cmpMeta, flags) => {
1732
- if (cmpMeta.$members$) {
1733
- if (Cstr.watchers) {
1734
- cmpMeta.$watchers$ = Cstr.watchers;
1735
- }
1736
- // It's better to have a const than two Object.entries()
1737
- const members = Object.entries(cmpMeta.$members$);
1738
- const prototype = Cstr.prototype;
1739
- members.map(([memberName, [memberFlags]]) => {
1740
- if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1741
- ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1742
- // proxyComponent - prop
1743
- Object.defineProperty(prototype, memberName, {
1744
- get() {
1745
- // proxyComponent, get value
1746
- return getValue(this, memberName);
1747
- },
1748
- set(newValue) {
1749
- // proxyComponent, set value
1750
- setValue(this, memberName, newValue, cmpMeta);
1751
- },
1752
- configurable: true,
1753
- enumerable: true,
1754
- });
1755
- }
1756
- });
1757
- if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1758
- const attrNameToPropName = new Map();
1759
- prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1760
- plt.jmp(() => {
1761
- const propName = attrNameToPropName.get(attrName);
1762
- // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1763
- // in the case where an attribute was set inline.
1764
- // ```html
1765
- // <my-component some-attribute="some-value"></my-component>
1766
- // ```
1767
- //
1768
- // There is an edge case where a developer sets the attribute inline on a custom element and then
1769
- // programmatically changes it before it has been upgraded as shown below:
1770
- //
1771
- // ```html
1772
- // <!-- this component has _not_ been upgraded yet -->
1773
- // <my-component id="test" some-attribute="some-value"></my-component>
1774
- // <script>
1775
- // // grab non-upgraded component
1776
- // el = document.querySelector("#test");
1777
- // el.someAttribute = "another-value";
1778
- // // upgrade component
1779
- // customElements.define('my-component', MyComponent);
1780
- // </script>
1781
- // ```
1782
- // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
1783
- // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1784
- // to the value that was set inline i.e. "some-value" from above example. When
1785
- // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
1786
- //
1787
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
1788
- // by connectedCallback as this attributeChangedCallback will not fire.
1789
- //
1790
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1791
- //
1792
- // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1793
- // properties here given that this goes against best practices outlined here
1794
- // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1795
- if (this.hasOwnProperty(propName)) {
1796
- newValue = this[propName];
1797
- delete this[propName];
1798
- }
1799
- else if (prototype.hasOwnProperty(propName) &&
1800
- typeof this[propName] === 'number' &&
1801
- this[propName] == newValue) {
1802
- // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1803
- // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1804
- // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1805
- return;
1806
- }
1807
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1808
- });
1809
- };
1810
- // create an array of attributes to observe
1811
- // and also create a map of html attribute name to js property name
1812
- Cstr.observedAttributes = members
1813
- .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1814
- .map(([propName, m]) => {
1815
- const attrName = m[1] || propName;
1816
- attrNameToPropName.set(attrName, propName);
1817
- if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1818
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
1819
- }
1820
- return attrName;
1821
- });
1822
- }
1823
- }
1824
- return Cstr;
1825
- };
1826
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1827
- // initializeComponent
1828
- if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1829
- // Let the runtime know that the component has been initialized
1830
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1831
- {
1832
- // lazy loaded components
1833
- // request the component's implementation to be
1834
- // wired up with the host element
1835
- Cstr = loadModule(cmpMeta);
1836
- if (Cstr.then) {
1837
- // Await creates a micro-task avoid if possible
1838
- const endLoad = uniqueTime();
1839
- Cstr = await Cstr;
1840
- endLoad();
1841
- }
1842
- if (!Cstr.isProxied) {
1843
- // we've never proxied this Constructor before
1844
- // let's add the getters/setters to its prototype before
1845
- // the first time we create an instance of the implementation
1846
- {
1847
- cmpMeta.$watchers$ = Cstr.watchers;
1848
- }
1849
- proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1850
- Cstr.isProxied = true;
1851
- }
1852
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1853
- // ok, time to construct the instance
1854
- // but let's keep track of when we start and stop
1855
- // so that the getters/setters don't incorrectly step on data
1856
- {
1857
- hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1858
- }
1859
- // construct the lazy-loaded component implementation
1860
- // passing the hostRef is very important during
1861
- // construction in order to directly wire together the
1862
- // host element and the lazy-loaded instance
1863
- try {
1864
- new Cstr(hostRef);
1865
- }
1866
- catch (e) {
1867
- consoleError(e);
1868
- }
1869
- {
1870
- hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1871
- }
1872
- {
1873
- hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1874
- }
1875
- endNewInstance();
1876
- fireConnectedCallback(hostRef.$lazyInstance$);
1877
- }
1878
- if (Cstr.style) {
1879
- // this component has styles but we haven't registered them yet
1880
- let style = Cstr.style;
1881
- const scopeId = getScopeId(cmpMeta);
1882
- if (!styles.has(scopeId)) {
1883
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1884
- if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
1885
- style = await import('./shadow-css-07b0c8c8.js').then((m) => m.scopeCss(style, scopeId, false));
1886
- }
1887
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1888
- endRegisterStyles();
1889
- }
1890
- }
1891
- }
1892
- // we've successfully created a lazy instance
1893
- const ancestorComponent = hostRef.$ancestorComponent$;
1894
- const schedule = () => scheduleUpdate(hostRef, true);
1895
- if (ancestorComponent && ancestorComponent['s-rc']) {
1896
- // this is the initial load and this component it has an ancestor component
1897
- // but the ancestor component has NOT fired its will update lifecycle yet
1898
- // so let's just cool our jets and wait for the ancestor to continue first
1899
- // this will get fired off when the ancestor component
1900
- // finally gets around to rendering its lazy self
1901
- // fire off the initial update
1902
- ancestorComponent['s-rc'].push(schedule);
1903
- }
1904
- else {
1905
- schedule();
1906
- }
1907
- };
1908
- const fireConnectedCallback = (instance) => {
1909
- {
1910
- safeCall(instance, 'connectedCallback');
1911
- }
1912
- };
1913
- const connectedCallback = (elm) => {
1914
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1915
- const hostRef = getHostRef(elm);
1916
- const cmpMeta = hostRef.$cmpMeta$;
1917
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1918
- if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1919
- // first time this component has connected
1920
- hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1921
- let hostId;
1922
- {
1923
- hostId = elm.getAttribute(HYDRATE_ID);
1924
- if (hostId) {
1925
- if (supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1926
- const scopeId = addStyle(elm.shadowRoot, cmpMeta);
1927
- elm.classList.remove(scopeId + '-h', scopeId + '-s');
1928
- }
1929
- initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
1930
- }
1931
- }
1932
- if (!hostId) {
1933
- // initUpdate
1934
- // if the slot polyfill is required we'll need to put some nodes
1935
- // in here to act as original content anchors as we move nodes around
1936
- // host element has been connected to the DOM
1937
- if ((// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
1938
- cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
1939
- setContentReference(elm);
1940
- }
1941
- }
1942
- {
1943
- // find the first ancestor component (if there is one) and register
1944
- // this component as one of the actively loading child components for its ancestor
1945
- let ancestorComponent = elm;
1946
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1947
- // climb up the ancestors looking for the first
1948
- // component that hasn't finished its lifecycle update yet
1949
- if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1950
- ancestorComponent.hasAttribute('s-id') &&
1951
- ancestorComponent['s-p']) ||
1952
- ancestorComponent['s-p']) {
1953
- // we found this components first ancestor component
1954
- // keep a reference to this component's ancestor component
1955
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1956
- break;
1957
- }
1958
- }
1959
- }
1960
- // Lazy properties
1961
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1962
- if (cmpMeta.$members$) {
1963
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1964
- if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1965
- const value = elm[memberName];
1966
- delete elm[memberName];
1967
- elm[memberName] = value;
1968
- }
1969
- });
1970
- }
1971
- {
1972
- initializeComponent(elm, hostRef, cmpMeta);
1973
- }
1974
- }
1975
- else {
1976
- // fire off connectedCallback() on component instance
1977
- fireConnectedCallback(hostRef.$lazyInstance$);
1978
- }
1979
- endConnected();
1980
- }
1981
- };
1982
- const setContentReference = (elm) => {
1983
- // only required when we're NOT using native shadow dom (slot)
1984
- // or this browser doesn't support native shadow dom
1985
- // and this host element was NOT created with SSR
1986
- // let's pick out the inner content for slot projection
1987
- // create a node to represent where the original
1988
- // content was first placed, which is useful later on
1989
- const contentRefElm = (elm['s-cr'] = doc.createComment(''));
1990
- contentRefElm['s-cn'] = true;
1991
- elm.insertBefore(contentRefElm, elm.firstChild);
1992
- };
1993
- const disconnectedCallback = (elm) => {
1994
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1995
- const hostRef = getHostRef(elm);
1996
- const instance = hostRef.$lazyInstance$ ;
1997
- // clear CSS var-shim tracking
1998
- // TODO(STENCIL-659): Remove code implementing the CSS variable shim
1999
- if (plt.$cssShim$) {
2000
- // TODO(STENCIL-659): Remove code implementing the CSS variable shim
2001
- plt.$cssShim$.removeHost(elm);
2002
- }
2003
- {
2004
- safeCall(instance, 'disconnectedCallback');
2005
- }
2006
- }
2007
- };
2008
- const bootstrapLazy = (lazyBundles, options = {}) => {
2009
- var _a;
2010
- const endBootstrap = createTime();
2011
- const cmpTags = [];
2012
- const exclude = options.exclude || [];
2013
- const customElements = win.customElements;
2014
- const head = doc.head;
2015
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
2016
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
2017
- const deferredConnectedCallbacks = [];
2018
- const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2019
- let appLoadFallback;
2020
- let isBootstrapping = true;
2021
- let i = 0;
2022
- Object.assign(plt, options);
2023
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2024
- {
2025
- // If the app is already hydrated there is not point to disable the
2026
- // async queue. This will improve the first input delay
2027
- plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
2028
- }
2029
- {
2030
- for (; i < styles.length; i++) {
2031
- registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
2032
- }
2033
- }
2034
- lazyBundles.map((lazyBundle) => {
2035
- lazyBundle[1].map((compactMeta) => {
2036
- const cmpMeta = {
2037
- $flags$: compactMeta[0],
2038
- $tagName$: compactMeta[1],
2039
- $members$: compactMeta[2],
2040
- $listeners$: compactMeta[3],
2041
- };
2042
- {
2043
- cmpMeta.$members$ = compactMeta[2];
2044
- }
2045
- {
2046
- cmpMeta.$attrsToReflect$ = [];
2047
- }
2048
- {
2049
- cmpMeta.$watchers$ = {};
2050
- }
2051
- if (!supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2052
- // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
2053
- cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
2054
- }
2055
- const tagName = cmpMeta.$tagName$;
2056
- const HostElement = class extends HTMLElement {
2057
- // StencilLazyHost
2058
- constructor(self) {
2059
- // @ts-ignore
2060
- super(self);
2061
- self = this;
2062
- registerHost(self, cmpMeta);
2063
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2064
- // this component is using shadow dom
2065
- // and this browser supports shadow dom
2066
- // add the read-only property "shadowRoot" to the host element
2067
- // adding the shadow root build conditionals to minimize runtime
2068
- if (supportsShadow) {
2069
- {
2070
- self.attachShadow({ mode: 'open' });
2071
- }
2072
- }
2073
- else if (!('shadowRoot' in self)) {
2074
- self.shadowRoot = self;
2075
- }
2076
- }
2077
- }
2078
- connectedCallback() {
2079
- if (appLoadFallback) {
2080
- clearTimeout(appLoadFallback);
2081
- appLoadFallback = null;
2082
- }
2083
- if (isBootstrapping) {
2084
- // connectedCallback will be processed once all components have been registered
2085
- deferredConnectedCallbacks.push(this);
2086
- }
2087
- else {
2088
- plt.jmp(() => connectedCallback(this));
2089
- }
2090
- }
2091
- disconnectedCallback() {
2092
- plt.jmp(() => disconnectedCallback(this));
2093
- }
2094
- componentOnReady() {
2095
- return getHostRef(this).$onReadyPromise$;
2096
- }
2097
- };
2098
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
2099
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2100
- cmpTags.push(tagName);
2101
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
2102
- }
2103
- });
2104
- });
2105
- {
2106
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
2107
- visibilityStyle.setAttribute('data-styles', '');
2108
- // Apply CSP nonce to the style tag if it exists
2109
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
2110
- if (nonce != null) {
2111
- visibilityStyle.setAttribute('nonce', nonce);
2112
- }
2113
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
2114
- }
2115
- // Process deferred connectedCallbacks now all components have been registered
2116
- isBootstrapping = false;
2117
- if (deferredConnectedCallbacks.length) {
2118
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
2119
- }
2120
- else {
2121
- {
2122
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2123
- }
2124
- }
2125
- // Fallback appLoad event
2126
- endBootstrap();
2127
- };
2128
- /**
2129
- * Assigns the given value to the nonce property on the runtime platform object.
2130
- * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
2131
- * @param nonce The value to be assigned to the platform nonce property.
2132
- * @returns void
2133
- */
2134
- const setNonce = (nonce) => (plt.$nonce$ = nonce);
2135
- const hostRefs = /*@__PURE__*/ new WeakMap();
2136
- const getHostRef = (ref) => hostRefs.get(ref);
2137
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2138
- const registerHost = (elm, cmpMeta) => {
2139
- const hostRef = {
2140
- $flags$: 0,
2141
- $hostElement$: elm,
2142
- $cmpMeta$: cmpMeta,
2143
- $instanceValues$: new Map(),
2144
- };
2145
- {
2146
- hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2147
- elm['s-p'] = [];
2148
- elm['s-rc'] = [];
2149
- }
2150
- return hostRefs.set(elm, hostRef);
2151
- };
2152
- const isMemberInElement = (elm, memberName) => memberName in elm;
2153
- const consoleError = (e, el) => (0, console.error)(e, el);
2154
- const cmpModules = /*@__PURE__*/ new Map();
2155
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2156
- // loadModuleImport
2157
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2158
- const bundleId = cmpMeta.$lazyBundleId$;
2159
- const module = cmpModules.get(bundleId) ;
2160
- if (module) {
2161
- return module[exportName];
2162
- }
2163
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
2164
- return import(
2165
- /* @vite-ignore */
2166
- /* webpackInclude: /\.entry\.js$/ */
2167
- /* webpackExclude: /\.system\.entry\.js$/ */
2168
- /* webpackMode: "lazy" */
2169
- `./${bundleId}.entry.js${''}`).then((importedModule) => {
2170
- {
2171
- cmpModules.set(bundleId, importedModule);
2172
- }
2173
- return importedModule[exportName];
2174
- }, consoleError);
2175
- };
2176
- const styles = /*@__PURE__*/ new Map();
2177
- const win = typeof window !== 'undefined' ? window : {};
2178
- // TODO(STENCIL-659): Remove code implementing the CSS variable shim
2179
- const CSS = win.CSS ;
2180
- const doc = win.document || { head: {} };
2181
- const plt = {
2182
- $flags$: 0,
2183
- $resourcesUrl$: '',
2184
- jmp: (h) => h(),
2185
- raf: (h) => requestAnimationFrame(h),
2186
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2187
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2188
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
2189
- };
2190
- const supportsShadow =
2191
- // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
2192
- /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
2193
- ;
2194
- const promiseResolve = (v) => Promise.resolve(v);
2195
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2196
- try {
2197
- new CSSStyleSheet();
2198
- return typeof new CSSStyleSheet().replaceSync === 'function';
2199
- }
2200
- catch (e) { }
2201
- return false;
2202
- })()
2203
- ;
2204
- const queueDomReads = [];
2205
- const queueDomWrites = [];
2206
- const queueTask = (queue, write) => (cb) => {
2207
- queue.push(cb);
2208
- if (!queuePending) {
2209
- queuePending = true;
2210
- if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2211
- nextTick(flush);
2212
- }
2213
- else {
2214
- plt.raf(flush);
2215
- }
2216
- }
2217
- };
2218
- const consume = (queue) => {
2219
- for (let i = 0; i < queue.length; i++) {
2220
- try {
2221
- queue[i](performance.now());
2222
- }
2223
- catch (e) {
2224
- consoleError(e);
2225
- }
2226
- }
2227
- queue.length = 0;
2228
- };
2229
- const flush = () => {
2230
- // always force a bunch of medium callbacks to run, but still have
2231
- // a throttle on how many can run in a certain time
2232
- // DOM READS!!!
2233
- consume(queueDomReads);
2234
- // DOM WRITES!!!
2235
- {
2236
- consume(queueDomWrites);
2237
- if ((queuePending = queueDomReads.length > 0)) {
2238
- // still more to do yet, but we've run out of time
2239
- // let's let this thing cool off and try again in the next tick
2240
- plt.raf(flush);
2241
- }
2242
- }
2243
- };
2244
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
2245
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2246
-
2247
- export { CSS as C, Host as H, promiseResolve as a, bootstrapLazy as b, createEvent as c, getElement as g, h, plt as p, registerInstance as r, setNonce as s, win as w };
2248
-
2249
- //# sourceMappingURL=index-81f1a268.js.map