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