@baloise/ds-core 16.8.0 → 17.0.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 (964) hide show
  1. package/components/all.d.ts +0 -2
  2. package/components/all.js +0 -3
  3. package/components/array.js +1875 -0
  4. package/components/bal-accordion-details.js +1 -1
  5. package/components/bal-accordion-summary.js +2 -2
  6. package/components/bal-accordion-trigger.js +1 -1
  7. package/components/bal-accordion.js +1 -1
  8. package/components/bal-app.js +11 -5
  9. package/components/bal-badge2.js +1 -1
  10. package/components/bal-button-group2.js +2 -2
  11. package/components/bal-button2.js +18 -4
  12. package/components/bal-card-actions.js +1 -1
  13. package/components/bal-card-button.js +1 -1
  14. package/components/bal-card-content2.js +1 -1
  15. package/components/bal-card-subtitle.js +1 -1
  16. package/components/bal-card-title.js +1 -1
  17. package/components/bal-card2.js +3 -3
  18. package/components/bal-carousel-item2.js +14 -3
  19. package/components/bal-carousel2.js +30 -7
  20. package/components/bal-checkbox-button.js +1 -1
  21. package/components/bal-checkbox-group.js +28 -3
  22. package/components/bal-checkbox2.js +16 -3
  23. package/components/bal-close2.js +1 -1
  24. package/components/bal-content2.js +1 -1
  25. package/components/bal-data-item.js +1 -1
  26. package/components/bal-data-label.js +1 -1
  27. package/components/bal-data-value.js +2 -2
  28. package/components/bal-data.js +1 -1
  29. package/components/bal-date-calendar-cell2.js +1 -1
  30. package/components/bal-date-calendar2.js +3 -3
  31. package/components/bal-date.js +39 -10
  32. package/components/bal-divider.js +1 -1
  33. package/components/bal-dropdown2.js +57 -32
  34. package/components/bal-field-control.js +2 -2
  35. package/components/bal-field-hint.js +1 -1
  36. package/components/bal-field-label.js +1 -1
  37. package/components/bal-field-message.js +2 -2
  38. package/components/bal-field.js +3 -5
  39. package/components/bal-file-upload.js +14 -7
  40. package/components/bal-footer.js +196 -6
  41. package/components/bal-form-col.js +2 -2
  42. package/components/bal-form-grid.js +1 -1
  43. package/components/bal-form.js +1 -1
  44. package/components/bal-heading2.js +1 -1
  45. package/components/bal-hint-text2.js +1 -1
  46. package/components/bal-hint-title2.js +1 -1
  47. package/components/bal-icon2.js +13 -1
  48. package/components/bal-input-date2.js +18 -6
  49. package/components/bal-input-group2.js +1 -1
  50. package/components/bal-input-slider.js +20 -6
  51. package/components/bal-input-stepper.js +20 -7
  52. package/components/bal-input.js +18 -5
  53. package/components/bal-label2.js +1 -1
  54. package/components/bal-list-item-accordion-body2.js +4 -4
  55. package/components/bal-list-item-accordion-head2.js +3 -3
  56. package/components/bal-list-item-content2.js +2 -2
  57. package/components/bal-list-item-icon2.js +2 -2
  58. package/components/bal-list-item-subtitle2.js +1 -1
  59. package/components/bal-list-item-title2.js +1 -1
  60. package/components/bal-list-item2.js +1 -1
  61. package/components/bal-list2.js +1 -1
  62. package/components/bal-logo2.js +2 -2
  63. package/components/bal-modal-body.js +1 -1
  64. package/components/bal-modal-header.js +1 -1
  65. package/components/bal-modal.js +33 -7
  66. package/components/bal-nav-link-grid-col2.js +1 -1
  67. package/components/bal-nav-link-grid2.js +1 -1
  68. package/components/bal-nav-link-group.js +1 -1
  69. package/components/bal-nav-link2.js +2 -2
  70. package/components/bal-nav-menu-bar2.js +1 -1
  71. package/components/bal-nav-menu-flyout2.js +1 -1
  72. package/components/bal-nav-meta-bar2.js +10 -3
  73. package/components/bal-nav.js +16 -3
  74. package/components/bal-navbar-brand.js +2 -2
  75. package/components/bal-navbar-menu-end.js +1 -1
  76. package/components/bal-navbar-menu-start.js +1 -1
  77. package/components/bal-navbar-menu.js +2 -2
  78. package/components/bal-navbar.js +1 -1
  79. package/components/bal-notices.js +2 -2
  80. package/components/bal-notification.js +1 -1
  81. package/components/bal-number-input.js +21 -26
  82. package/components/bal-option-list.js +17 -4
  83. package/components/bal-option2.js +9 -2
  84. package/components/bal-pagination2.js +4 -4
  85. package/components/bal-popover-content2.js +1 -1
  86. package/components/bal-popover2.js +38 -13
  87. package/components/bal-popup.js +47 -12
  88. package/components/bal-progress-bar.js +2 -2
  89. package/components/bal-radio-button.js +1 -1
  90. package/components/bal-radio-group.js +33 -2
  91. package/components/bal-radio2.js +10 -3
  92. package/components/bal-segment-item.js +2 -2
  93. package/components/bal-segment.js +17 -4
  94. package/components/bal-select-option2.js +1 -1
  95. package/components/bal-select2.js +29 -9
  96. package/components/bal-shape2.js +4 -4
  97. package/components/bal-sheet.js +1 -1
  98. package/components/bal-snackbar.js +1 -1
  99. package/components/bal-spinner2.js +3 -3
  100. package/components/bal-stack2.js +1 -1
  101. package/components/bal-stage-back-link.js +2 -2
  102. package/components/bal-stage-body.js +1 -1
  103. package/components/bal-stage-foot.js +1 -1
  104. package/components/bal-stage-head.js +1 -1
  105. package/components/bal-stage-image.js +11 -2
  106. package/components/bal-stage.js +1 -1
  107. package/components/bal-step-item.js +2 -2
  108. package/components/bal-steps.js +2 -2
  109. package/components/bal-tab-item.js +2 -2
  110. package/components/bal-table.js +1 -1
  111. package/components/bal-tabs2.js +45 -18
  112. package/components/bal-tag-group.js +1 -1
  113. package/components/bal-tag2.js +1 -1
  114. package/components/bal-text2.js +2 -2
  115. package/components/bal-textarea.js +18 -4
  116. package/components/bal-time-input.js +20 -7
  117. package/components/bal-toast.js +1 -1
  118. package/components/bal-tooltip.js +13 -9
  119. package/components/breakpoints.subject.js +1 -1
  120. package/components/date.js +32 -2
  121. package/components/element-states.decorator.js +1 -1
  122. package/components/floating-ui.dom.esm.js +493 -1
  123. package/components/floating-ui.js +26 -0
  124. package/components/focus.decorator.js +1 -1
  125. package/components/form-input.js +1 -1
  126. package/components/helpers.js +35 -3
  127. package/components/index.js +2 -3
  128. package/components/index2.js +570 -13
  129. package/components/index3.js +13 -570
  130. package/components/index4.js +558 -0
  131. package/components/keyboard.helpers.js +62 -0
  132. package/components/listen.js +58 -0
  133. package/components/mutation.decorator.js +13 -11
  134. package/components/number.js +30 -0
  135. package/components/overlays.js +1 -1
  136. package/components/resize.decorator.js +1 -1
  137. package/components/swipe.subject.js +2 -2
  138. package/components/tokens.esm.js +1 -1
  139. package/components/utils.js +1 -1
  140. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  141. package/dist/baloise-design-system/baloise-design-system.js +1 -1
  142. package/dist/baloise-design-system/index.esm.js +1 -1
  143. package/dist/baloise-design-system/p-00b37ea2.js +1 -0
  144. package/dist/baloise-design-system/p-01cdb12b31.entry.js +1 -0
  145. package/dist/baloise-design-system/p-0215ccdca9.system.entry.js +1 -0
  146. package/dist/baloise-design-system/{p-2db9030ad9.system.entry.js → p-063f4fc96f.system.entry.js} +1 -1
  147. package/dist/baloise-design-system/{p-a6e7599e.js → p-06d357bd.js} +1 -1
  148. package/dist/baloise-design-system/p-075bcd8c56.system.entry.js +1 -0
  149. package/dist/baloise-design-system/p-0935940ea0.system.entry.js +1 -0
  150. package/dist/baloise-design-system/{p-a01f3206.system.js → p-0aa1d6a4.system.js} +1 -1
  151. package/dist/baloise-design-system/p-0c51c999.js +1 -0
  152. package/dist/baloise-design-system/p-0dc26bfe1f.entry.js +1 -0
  153. package/dist/baloise-design-system/p-0ede0fa9b2.entry.js +1 -0
  154. package/dist/baloise-design-system/p-10151a65a4.entry.js +1 -0
  155. package/dist/baloise-design-system/{p-cd378385.system.js → p-10985d5e.system.js} +1 -1
  156. package/dist/baloise-design-system/p-12701030b2.system.entry.js +1 -0
  157. package/dist/baloise-design-system/p-1400a7e9cc.entry.js +1 -0
  158. package/dist/baloise-design-system/{p-0970cac46c.system.entry.js → p-14eef425da.system.entry.js} +1 -1
  159. package/dist/baloise-design-system/p-166d571e.js +1 -0
  160. package/dist/baloise-design-system/p-16ff8c81bf.entry.js +1 -0
  161. package/dist/baloise-design-system/{p-8f89168b60.system.entry.js → p-17c73b8f48.system.entry.js} +1 -1
  162. package/dist/baloise-design-system/{p-49fe011f.js → p-1c09c9b0.js} +1 -1
  163. package/dist/baloise-design-system/p-1c41de53.system.js +1 -0
  164. package/dist/baloise-design-system/{p-bcbb5b59f3.system.entry.js → p-1e344a8c28.system.entry.js} +1 -1
  165. package/dist/baloise-design-system/{p-2ea21f9c.system.js → p-1e688639.system.js} +1 -1
  166. package/dist/baloise-design-system/p-218f416b89.entry.js +1 -0
  167. package/dist/baloise-design-system/p-2539ba43.js +2 -0
  168. package/dist/baloise-design-system/p-2767b62167.system.entry.js +1 -0
  169. package/dist/baloise-design-system/p-29273a2be9.entry.js +1 -0
  170. package/dist/baloise-design-system/p-2af8b73858.entry.js +1 -0
  171. package/dist/baloise-design-system/p-2f6c32ca97.entry.js +1 -0
  172. package/dist/baloise-design-system/p-30679d51bd.system.entry.js +1 -0
  173. package/dist/baloise-design-system/p-30f41bab1a.system.entry.js +1 -0
  174. package/dist/baloise-design-system/p-3114a84410.entry.js +1 -0
  175. package/dist/baloise-design-system/p-3149162e9e.entry.js +1 -0
  176. package/dist/baloise-design-system/p-33101c54.js +1 -0
  177. package/dist/baloise-design-system/p-3508444fc8.entry.js +1 -0
  178. package/dist/baloise-design-system/{p-abd9c578.system.js → p-365fc134.system.js} +1 -1
  179. package/dist/baloise-design-system/p-3814316946.entry.js +1 -0
  180. package/dist/baloise-design-system/p-3c504ddf38.system.entry.js +1 -0
  181. package/dist/baloise-design-system/p-3f01fc8b.js +1 -0
  182. package/dist/baloise-design-system/p-4b6481e692.entry.js +1 -0
  183. package/dist/baloise-design-system/p-4bbe4ba6ba.entry.js +1 -0
  184. package/dist/baloise-design-system/p-4d807f18.system.js +1 -0
  185. package/dist/baloise-design-system/p-4d84f90534.entry.js +1 -0
  186. package/dist/baloise-design-system/p-4dad7840.js +1 -0
  187. package/dist/baloise-design-system/p-4e4fe533.js +1 -0
  188. package/dist/baloise-design-system/{p-2e9934393d.system.entry.js → p-4e75ee3c87.system.entry.js} +1 -1
  189. package/dist/baloise-design-system/p-50927d70.js +1 -0
  190. package/dist/baloise-design-system/{p-54f81c32.js → p-50b2a9c6.js} +1 -1
  191. package/dist/baloise-design-system/p-51e22c0c.js +1 -0
  192. package/dist/baloise-design-system/{p-e61fa225.js → p-51fa7a76.js} +1 -1
  193. package/dist/baloise-design-system/{p-baf64616.system.js → p-533956b7.system.js} +1 -1
  194. package/dist/baloise-design-system/p-5353ba1263.entry.js +1 -0
  195. package/dist/baloise-design-system/p-53b859d3c4.entry.js +1 -0
  196. package/dist/baloise-design-system/p-54c8a63b7c.system.entry.js +1 -0
  197. package/dist/baloise-design-system/p-579855c6.system.js +1 -0
  198. package/dist/baloise-design-system/p-5b78557886.entry.js +1 -0
  199. package/dist/baloise-design-system/p-6116192a.js +1 -0
  200. package/dist/baloise-design-system/p-61c48963c7.system.entry.js +1 -0
  201. package/dist/baloise-design-system/p-62936f4a8b.entry.js +1 -0
  202. package/dist/baloise-design-system/{p-de08fd27.js → p-63b52c0f.js} +1 -1
  203. package/dist/baloise-design-system/p-678ebde2de.entry.js +1 -0
  204. package/dist/baloise-design-system/p-68392bc0e8.system.entry.js +1 -0
  205. package/dist/baloise-design-system/p-69f82b9b22.entry.js +1 -0
  206. package/dist/baloise-design-system/p-6c3a60ddf6.entry.js +1 -0
  207. package/dist/baloise-design-system/p-6cadcbe4bb.entry.js +1 -0
  208. package/dist/baloise-design-system/{p-438787a3f4.system.entry.js → p-6d27c4949f.system.entry.js} +1 -1
  209. package/dist/baloise-design-system/p-6d6a2f64f2.entry.js +1 -0
  210. package/dist/baloise-design-system/p-6e79b03ef3.entry.js +1 -0
  211. package/dist/baloise-design-system/{p-84da5fdc6d.system.entry.js → p-6fb26bd060.system.entry.js} +1 -1
  212. package/dist/baloise-design-system/{p-29ba4f9afe.system.entry.js → p-70ff6660e5.system.entry.js} +1 -1
  213. package/dist/baloise-design-system/p-72ffb739.system.js +1 -0
  214. package/dist/baloise-design-system/p-738ca720.system.js +1 -0
  215. package/dist/baloise-design-system/p-73bd9055.system.js +1 -0
  216. package/dist/baloise-design-system/{p-10351b73.js → p-7607c59d.js} +1 -1
  217. package/dist/baloise-design-system/p-7752fa10ea.system.entry.js +1 -0
  218. package/dist/baloise-design-system/p-799a292492.entry.js +1 -0
  219. package/dist/baloise-design-system/p-7a883fd6ed.system.entry.js +1 -0
  220. package/dist/baloise-design-system/p-7eaff7954d.entry.js +1 -0
  221. package/dist/baloise-design-system/p-7f9fe862b6.system.entry.js +1 -0
  222. package/dist/baloise-design-system/p-802216cd.system.js +1 -0
  223. package/dist/baloise-design-system/{p-1920d4af.js → p-802c6111.js} +1 -1
  224. package/dist/baloise-design-system/p-8096d040b2.system.entry.js +1 -0
  225. package/dist/baloise-design-system/p-85b6c500d8.entry.js +1 -0
  226. package/dist/baloise-design-system/p-85d9ea863b.system.entry.js +1 -0
  227. package/dist/baloise-design-system/p-85ed9bd051.entry.js +1 -0
  228. package/dist/baloise-design-system/p-8669493951.system.entry.js +1 -0
  229. package/dist/baloise-design-system/p-88be14c716.entry.js +1 -0
  230. package/dist/baloise-design-system/p-8a1bb350f1.system.entry.js +1 -0
  231. package/dist/baloise-design-system/p-8a73c9b8.js +1 -0
  232. package/dist/baloise-design-system/{p-b7ceb9e59e.system.entry.js → p-8ac5772a60.system.entry.js} +1 -1
  233. package/dist/baloise-design-system/p-8b8d19171d.entry.js +1 -0
  234. package/dist/baloise-design-system/p-8d370d87cb.entry.js +1 -0
  235. package/dist/baloise-design-system/{p-fad86a959d.system.entry.js → p-9311066eb2.system.entry.js} +1 -1
  236. package/dist/baloise-design-system/p-93e2638280.system.entry.js +1 -0
  237. package/dist/baloise-design-system/p-950bd476.js +1 -0
  238. package/dist/baloise-design-system/{p-2692caf4.js → p-95a4f1be.js} +1 -1
  239. package/dist/baloise-design-system/p-98267a7765.entry.js +1 -0
  240. package/dist/baloise-design-system/{p-049f6f9bc3.system.entry.js → p-98a58cff41.system.entry.js} +1 -1
  241. package/dist/baloise-design-system/p-98f7403c7f.entry.js +1 -0
  242. package/dist/baloise-design-system/p-992c49c23e.system.entry.js +1 -0
  243. package/dist/baloise-design-system/p-9b8ca7ead8.entry.js +1 -0
  244. package/dist/baloise-design-system/p-9d29364f13.entry.js +1 -0
  245. package/dist/baloise-design-system/p-9d3f19c6af.system.entry.js +1 -0
  246. package/dist/baloise-design-system/p-9f54cfc70b.entry.js +1 -0
  247. package/dist/baloise-design-system/p-9f83acd71d.entry.js +1 -0
  248. package/dist/baloise-design-system/p-a7d15ec66b.entry.js +1 -0
  249. package/dist/baloise-design-system/{p-333ef156.system.js → p-a898208e.system.js} +1 -1
  250. package/dist/baloise-design-system/p-ad58876e8c.entry.js +1 -0
  251. package/dist/baloise-design-system/p-ae2292f251.system.entry.js +1 -0
  252. package/dist/baloise-design-system/{p-c2de2596d1.system.entry.js → p-aebb3198c4.system.entry.js} +1 -1
  253. package/dist/baloise-design-system/{p-dfccf59e11.system.entry.js → p-af3fb420b3.system.entry.js} +1 -1
  254. package/dist/baloise-design-system/p-af4c6af2.js +1 -0
  255. package/dist/baloise-design-system/p-af5e974f4c.system.entry.js +1 -0
  256. package/dist/baloise-design-system/p-b0120babb2.entry.js +1 -0
  257. package/dist/baloise-design-system/{p-ae9b85f1.system.js → p-b0fd473a.system.js} +1 -1
  258. package/dist/baloise-design-system/p-b136739bec.entry.js +1 -0
  259. package/dist/baloise-design-system/p-b4ecd87960.system.entry.js +1 -0
  260. package/dist/baloise-design-system/p-b57c473d.system.js +1 -0
  261. package/dist/baloise-design-system/{p-45b4b4fcd6.system.entry.js → p-b8658ffb85.system.entry.js} +1 -1
  262. package/dist/baloise-design-system/p-b86876e144.entry.js +1 -0
  263. package/dist/baloise-design-system/p-ba9c735428.entry.js +1 -0
  264. package/dist/baloise-design-system/p-be61baa681.entry.js +1 -0
  265. package/dist/baloise-design-system/p-be6d3bde8f.entry.js +1 -0
  266. package/dist/baloise-design-system/{p-7957c3c0.system.js → p-bf139fe5.system.js} +1 -1
  267. package/dist/baloise-design-system/p-bf1b5db620.system.entry.js +1 -0
  268. package/dist/baloise-design-system/p-c045d5a57c.system.entry.js +1 -0
  269. package/dist/baloise-design-system/p-c2157cabd4.entry.js +1 -0
  270. package/dist/baloise-design-system/p-c416afcd52.entry.js +1 -0
  271. package/dist/baloise-design-system/{p-c7cdb944f3.system.entry.js → p-c589d05bc6.system.entry.js} +1 -1
  272. package/dist/baloise-design-system/{p-328e32e1.js → p-c61080a6.js} +1 -1
  273. package/dist/baloise-design-system/{p-014286df.system.js → p-c72bd76c.system.js} +1 -1
  274. package/dist/baloise-design-system/p-c7e93ad3c1.entry.js +1 -0
  275. package/dist/baloise-design-system/p-c7efc6d470.entry.js +1 -0
  276. package/dist/baloise-design-system/{p-81f848c6.js → p-c8caa835.js} +1 -1
  277. package/dist/baloise-design-system/p-c9dce0f3ea.system.entry.js +1 -0
  278. package/dist/baloise-design-system/p-cfd4370f6b.system.entry.js +1 -0
  279. package/dist/baloise-design-system/p-cfe42ac458.system.entry.js +1 -0
  280. package/dist/baloise-design-system/p-d0d162c677.system.entry.js +1 -0
  281. package/dist/baloise-design-system/{p-2e8b4edc.system.js → p-d1ec4d6e.system.js} +1 -1
  282. package/dist/baloise-design-system/{p-1509eaa7.system.js → p-d2f9ed2b.system.js} +1 -1
  283. package/dist/baloise-design-system/p-d404537f.system.js +1 -0
  284. package/dist/baloise-design-system/p-d532d41212.system.entry.js +1 -0
  285. package/dist/baloise-design-system/p-d67f7321.system.js +2 -0
  286. package/dist/baloise-design-system/p-d88acac29e.system.entry.js +1 -0
  287. package/dist/baloise-design-system/p-d97dc6a8.system.js +1 -0
  288. package/dist/baloise-design-system/{p-7662250151.system.entry.js → p-d9bb74c913.system.entry.js} +1 -1
  289. package/dist/baloise-design-system/p-dbc0b7c370.entry.js +1 -0
  290. package/dist/baloise-design-system/p-df907af8.system.js +1 -0
  291. package/dist/baloise-design-system/{p-15c5fe4d6d.system.entry.js → p-dfcca29bc9.system.entry.js} +1 -1
  292. package/dist/baloise-design-system/{p-f2e0ee98af.system.entry.js → p-e0e123ffec.system.entry.js} +1 -1
  293. package/dist/baloise-design-system/p-e1b2f86b.system.js +1 -0
  294. package/dist/baloise-design-system/{p-13c885d840.system.entry.js → p-e2ba4d18bc.system.entry.js} +1 -1
  295. package/dist/baloise-design-system/p-e3a563de25.system.entry.js +1 -0
  296. package/dist/baloise-design-system/p-e8f93d80ca.system.entry.js +1 -0
  297. package/dist/baloise-design-system/p-ec286609dd.entry.js +1 -0
  298. package/dist/baloise-design-system/p-ec4cf5cec6.entry.js +1 -0
  299. package/dist/baloise-design-system/p-edbd880ce1.entry.js +1 -0
  300. package/dist/baloise-design-system/p-ee3c7a38.system.js +1 -0
  301. package/dist/baloise-design-system/p-f1c41da029.entry.js +1 -0
  302. package/dist/baloise-design-system/p-f3ef269852.entry.js +1 -0
  303. package/dist/baloise-design-system/{p-d800ecde35.system.entry.js → p-f8d828383b.system.entry.js} +1 -1
  304. package/dist/baloise-design-system/p-fa363ba3f9.system.entry.js +1 -0
  305. package/dist/baloise-design-system/p-fa6b5cde.system.js +1 -0
  306. package/dist/baloise-design-system/p-faaf77375f.system.entry.js +1 -0
  307. package/dist/baloise-design-system/{p-ee9c988a19.system.entry.js → p-faf5c89145.system.entry.js} +1 -1
  308. package/dist/baloise-design-system/p-fd118a1752.system.entry.js +1 -0
  309. package/dist/cjs/{app-globals-ae3a8623.js → app-globals-f5a609c1.js} +1 -1
  310. package/dist/cjs/array-ae164ca3.js +22 -0
  311. package/dist/cjs/bal-accordion_4.cjs.entry.js +8 -10
  312. package/dist/cjs/bal-app.cjs.entry.js +12 -6
  313. package/dist/cjs/bal-badge.cjs.entry.js +2 -2
  314. package/dist/cjs/bal-button_2.cjs.entry.js +21 -5
  315. package/dist/cjs/bal-card_6.cjs.entry.js +8 -8
  316. package/dist/cjs/bal-carousel_2.cjs.entry.js +49 -17
  317. package/dist/cjs/bal-checkbox-button.cjs.entry.js +5 -5
  318. package/dist/cjs/bal-checkbox_2.cjs.entry.js +50 -11
  319. package/dist/cjs/bal-close.cjs.entry.js +2 -2
  320. package/dist/cjs/bal-content.cjs.entry.js +2 -2
  321. package/dist/cjs/bal-data_4.cjs.entry.js +5 -5
  322. package/dist/cjs/bal-date-calendar-cell.cjs.entry.js +4 -4
  323. package/dist/cjs/bal-date-calendar_2.cjs.entry.js +55 -42
  324. package/dist/cjs/bal-date.cjs.entry.js +42 -15
  325. package/dist/cjs/bal-divider.cjs.entry.js +2 -2
  326. package/dist/cjs/bal-dropdown.cjs.entry.js +66 -41
  327. package/dist/cjs/bal-field_5.cjs.entry.js +11 -13
  328. package/dist/cjs/bal-file-upload.cjs.entry.js +17 -9
  329. package/dist/cjs/bal-footer.cjs.entry.js +200 -12
  330. package/dist/cjs/bal-form-col_2.cjs.entry.js +4 -4
  331. package/dist/cjs/bal-form.cjs.entry.js +3 -3
  332. package/dist/cjs/bal-heading_2.cjs.entry.js +4 -4
  333. package/dist/cjs/bal-hint_5.cjs.entry.js +45 -20
  334. package/dist/cjs/bal-icon.cjs.entry.js +14 -3
  335. package/dist/cjs/bal-input-group.cjs.entry.js +2 -2
  336. package/dist/cjs/bal-input-slider.cjs.entry.js +20 -6
  337. package/dist/cjs/bal-input-stepper.cjs.entry.js +21 -9
  338. package/dist/cjs/bal-input.cjs.entry.js +17 -4
  339. package/dist/cjs/bal-label.cjs.entry.js +2 -2
  340. package/dist/cjs/bal-list_8.cjs.entry.js +20 -22
  341. package/dist/cjs/bal-logo.cjs.entry.js +6 -6
  342. package/dist/cjs/bal-modal_3.cjs.entry.js +36 -10
  343. package/dist/cjs/bal-nav_8.cjs.entry.js +37 -18
  344. package/dist/cjs/bal-navbar_5.cjs.entry.js +11 -11
  345. package/dist/cjs/bal-notices_3.cjs.entry.js +5 -5
  346. package/dist/cjs/bal-notification.cjs.entry.js +2 -2
  347. package/dist/cjs/bal-number-input.cjs.entry.js +39 -43
  348. package/dist/cjs/bal-option_2.cjs.entry.js +25 -6
  349. package/dist/cjs/bal-pagination.cjs.entry.js +9 -9
  350. package/dist/cjs/bal-popup.cjs.entry.js +49 -16
  351. package/dist/cjs/bal-progress-bar.cjs.entry.js +7 -7
  352. package/dist/cjs/bal-radio-button.cjs.entry.js +5 -5
  353. package/dist/cjs/bal-radio_2.cjs.entry.js +45 -10
  354. package/dist/cjs/bal-segment_2.cjs.entry.js +29 -18
  355. package/dist/cjs/bal-select_2.cjs.entry.js +41 -20
  356. package/dist/cjs/bal-shape.cjs.entry.js +6 -6
  357. package/dist/cjs/bal-sheet.cjs.entry.js +2 -2
  358. package/dist/cjs/bal-spinner.cjs.entry.js +4 -4
  359. package/dist/cjs/bal-stack.cjs.entry.js +2 -2
  360. package/dist/cjs/bal-stage_6.cjs.entry.js +19 -8
  361. package/dist/cjs/bal-step-item.cjs.entry.js +3 -3
  362. package/dist/cjs/bal-steps.cjs.entry.js +10 -9
  363. package/dist/cjs/bal-tab-item_2.cjs.entry.js +54 -27
  364. package/dist/cjs/bal-table.cjs.entry.js +2 -2
  365. package/dist/cjs/bal-tag_2.cjs.entry.js +3 -3
  366. package/dist/cjs/bal-textarea.cjs.entry.js +18 -4
  367. package/dist/cjs/bal-time-input.cjs.entry.js +19 -6
  368. package/dist/cjs/bal-tooltip.cjs.entry.js +17 -10
  369. package/dist/cjs/baloise-design-system.cjs.js +14 -14
  370. package/dist/cjs/{breakpoints.decorator-3e39d424.js → breakpoints.decorator-967c2fd2.js} +1 -1
  371. package/dist/cjs/{breakpoints.subject-04e46eae.js → breakpoints.subject-679bdc55.js} +2 -2
  372. package/dist/cjs/{date-20be7524.js → date-c2a815e4.js} +33 -2
  373. package/dist/cjs/{element-states.decorator-9ce5ff3b.js → element-states.decorator-5aa9bf46.js} +1 -1
  374. package/dist/cjs/floating-ui-9f03e1cf.js +28 -0
  375. package/dist/{esm/floating-ui.dom.esm-f1cf1077.js → cjs/floating-ui.dom.esm-2ece9686.js} +508 -1
  376. package/dist/cjs/{focus.decorator-afaf9ac4.js → focus.decorator-ec3a858c.js} +1 -1
  377. package/dist/cjs/{form-input-b61eb894.js → form-input-35653e8f.js} +1 -1
  378. package/dist/cjs/{helpers-2a8c8333.js → helpers-393c2183.js} +36 -2
  379. package/dist/cjs/index-3b7f8988.js +1860 -0
  380. package/dist/cjs/index-758765f7.js +560 -0
  381. package/dist/cjs/index-96c178a6.js +1689 -0
  382. package/dist/cjs/index.cjs.js +9 -13
  383. package/dist/cjs/{initialize-2a19d091.js → initialize-e7570bc6.js} +2 -2
  384. package/dist/cjs/keyboard.helpers-3c105b0c.js +73 -0
  385. package/dist/cjs/listen-b42a4134.js +60 -0
  386. package/dist/cjs/loader.cjs.js +6 -6
  387. package/dist/cjs/{mutation.decorator-af043b68.js → mutation.decorator-d2ce6c1a.js} +13 -11
  388. package/dist/cjs/number-111783eb.js +35 -0
  389. package/dist/cjs/{overlays-3e4cf786.js → overlays-e6d14274.js} +1 -1
  390. package/dist/cjs/{resize.decorator-ae91ead2.js → resize.decorator-981b6817.js} +1 -1
  391. package/dist/cjs/{swipe.decorator-5206d283.js → swipe.decorator-391a0941.js} +1 -1
  392. package/dist/cjs/{swipe.subject-4ec94271.js → swipe.subject-48bf62a1.js} +2 -2
  393. package/dist/cjs/{tokens.esm-c5d8ed82.js → tokens.esm-e4edac35.js} +1 -1
  394. package/dist/cjs/{window-resize.decorator-f34ad3f4.js → window-resize.decorator-bb2ea6d8.js} +1 -1
  395. package/dist/collection/collection-manifest.json +3 -9
  396. package/dist/collection/components/bal-accordion/bal-accordion-details/bal-accordion-details.js +1 -1
  397. package/dist/collection/components/bal-accordion/bal-accordion-summary/bal-accordion-summary.js +2 -2
  398. package/dist/collection/components/bal-accordion/bal-accordion-trigger/bal-accordion-trigger.js +1 -1
  399. package/dist/collection/components/bal-app/bal-app.css +1 -1
  400. package/dist/collection/components/bal-app/bal-app.js +10 -4
  401. package/dist/collection/components/bal-badge/bal-badge.js +1 -1
  402. package/dist/collection/components/bal-button/bal-button-group/bal-button-group.js +2 -2
  403. package/dist/collection/components/bal-button/bal-button.js +20 -11
  404. package/dist/collection/components/bal-card/bal-card-actions/bal-card-actions.js +1 -1
  405. package/dist/collection/components/bal-card/bal-card-button/bal-card-button.js +1 -1
  406. package/dist/collection/components/bal-card/bal-card-content/bal-card-content.js +1 -1
  407. package/dist/collection/components/bal-card/bal-card-subtitle/bal-card-subtitle.js +1 -1
  408. package/dist/collection/components/bal-card/bal-card-title/bal-card-title.js +1 -1
  409. package/dist/collection/components/bal-card/bal-card.js +2 -2
  410. package/dist/collection/components/bal-carousel/bal-carousel-item/bal-carousel-item.js +19 -4
  411. package/dist/collection/components/bal-carousel/bal-carousel.js +29 -21
  412. package/dist/collection/components/bal-checkbox/bal-checkbox-button/bal-checkbox-button.js +1 -1
  413. package/dist/collection/components/bal-checkbox/bal-checkbox-group/bal-checkbox-group.js +26 -28
  414. package/dist/collection/components/bal-checkbox/bal-checkbox.js +15 -17
  415. package/dist/collection/components/bal-close/bal-close.js +1 -1
  416. package/dist/collection/components/bal-content/bal-content.js +1 -1
  417. package/dist/collection/components/bal-data/bal-data-item/bal-data-item.js +1 -1
  418. package/dist/collection/components/bal-data/bal-data-label/bal-data-label.js +1 -1
  419. package/dist/collection/components/bal-data/bal-data-value/bal-data-value.js +1 -1
  420. package/dist/collection/components/bal-data/bal-data.js +1 -1
  421. package/dist/collection/components/bal-date/bal-date-calendar/bal-date-calendar.js +1 -1
  422. package/dist/collection/components/bal-date/bal-date-calendar-cell/bal-date-calendar-cell.js +1 -1
  423. package/dist/collection/components/bal-date/bal-date.js +37 -35
  424. package/dist/collection/components/bal-divider/bal-divider.js +1 -1
  425. package/dist/collection/components/bal-dropdown/bal-dropdown.js +44 -44
  426. package/dist/collection/components/bal-field/bal-field-control/bal-field-control.js +2 -2
  427. package/dist/collection/components/bal-field/bal-field-hint/bal-field-hint.js +1 -1
  428. package/dist/collection/components/bal-field/bal-field-label/bal-field-label.js +1 -1
  429. package/dist/collection/components/bal-field/bal-field-message/bal-field-message.js +2 -2
  430. package/dist/collection/components/bal-field/bal-field.js +2 -4
  431. package/dist/collection/components/bal-file-upload/bal-file-upload.js +12 -14
  432. package/dist/collection/components/bal-footer/bal-footer.js +4 -4
  433. package/dist/collection/components/bal-form/bal-form.js +1 -1
  434. package/dist/collection/components/bal-form-grid/bal-form-col/bal-form-col.js +2 -2
  435. package/dist/collection/components/bal-form-grid/bal-form-grid.js +1 -1
  436. package/dist/collection/components/bal-heading/bal-heading.js +1 -1
  437. package/dist/collection/components/bal-hint/bal-hint-text/bal-hint-text.js +1 -1
  438. package/dist/collection/components/bal-hint/bal-hint-title/bal-hint-title.js +1 -1
  439. package/dist/collection/components/bal-icon/bal-icon.js +14 -2
  440. package/dist/collection/components/bal-input/bal-input-date/bal-input-date.js +15 -17
  441. package/dist/collection/components/bal-input/bal-input.js +14 -16
  442. package/dist/collection/components/bal-input-group/bal-input-group.js +1 -1
  443. package/dist/collection/components/bal-input-slider/bal-input-slider.js +17 -18
  444. package/dist/collection/components/bal-input-stepper/bal-input-stepper.js +17 -19
  445. package/dist/collection/components/bal-label/bal-label.js +1 -1
  446. package/dist/collection/components/bal-list/bal-list-item-accordion-body/bal-list-item-accordion-body.js +3 -3
  447. package/dist/collection/components/bal-list/bal-list-item-accordion-head/bal-list-item-accordion-head.js +3 -3
  448. package/dist/collection/components/bal-list/bal-list-item-content/bal-list-item-content.js +2 -2
  449. package/dist/collection/components/bal-list/bal-list-item-icon/bal-list-item-icon.js +2 -2
  450. package/dist/collection/components/bal-list/bal-list-item-subtitle/bal-list-item-subtitle.js +1 -1
  451. package/dist/collection/components/bal-list/bal-list-item-title/bal-list-item-title.js +1 -1
  452. package/dist/collection/components/bal-list/bal-list.js +1 -1
  453. package/dist/collection/components/bal-logo/bal-logo.js +2 -2
  454. package/dist/collection/components/bal-modal/bal-modal-body/bal-modal-body.js +1 -1
  455. package/dist/collection/components/bal-modal/bal-modal-header/bal-modal-header.js +1 -1
  456. package/dist/collection/components/bal-modal/bal-modal.js +31 -32
  457. package/dist/collection/components/bal-nav/bal-nav-link/bal-nav-link.js +2 -2
  458. package/dist/collection/components/bal-nav/bal-nav-link-grid/bal-nav-link-grid.js +1 -1
  459. package/dist/collection/components/bal-nav/bal-nav-link-grid-col/bal-nav-link-grid-col.js +1 -1
  460. package/dist/collection/components/bal-nav/bal-nav-link-group/bal-nav-link-group.js +1 -1
  461. package/dist/collection/components/bal-nav/bal-nav-menu-bar/bal-nav-menu-bar.js +1 -1
  462. package/dist/collection/components/bal-nav/bal-nav-menu-flyout/bal-nav-menu-flyout.js +1 -1
  463. package/dist/collection/components/bal-nav/bal-nav-meta-bar/bal-nav-meta-bar.css +1 -1
  464. package/dist/collection/components/bal-nav/bal-nav-meta-bar/bal-nav-meta-bar.js +8 -10
  465. package/dist/collection/components/bal-nav/bal-nav.js +15 -17
  466. package/dist/collection/components/bal-navbar/bal-navbar-brand/bal-navbar-brand.js +2 -2
  467. package/dist/collection/components/bal-navbar/bal-navbar-menu/bal-navbar-menu.js +1 -1
  468. package/dist/collection/components/bal-navbar/bal-navbar-menu-end/bal-navbar-menu-end.js +1 -1
  469. package/dist/collection/components/bal-navbar/bal-navbar-menu-start/bal-navbar-menu-start.js +1 -1
  470. package/dist/collection/components/bal-navbar/bal-navbar.js +1 -1
  471. package/dist/collection/components/bal-notices/bal-notices.js +2 -2
  472. package/dist/collection/components/bal-notification/bal-notification.js +1 -1
  473. package/dist/collection/components/bal-number-input/bal-number-input.js +14 -16
  474. package/dist/collection/components/bal-option/bal-option.js +8 -10
  475. package/dist/collection/components/bal-option-list/bal-option-list.js +14 -16
  476. package/dist/collection/components/bal-pagination/bal-pagination.js +4 -4
  477. package/dist/collection/components/bal-popover/bal-popover-content/bal-popover-content.js +1 -1
  478. package/dist/collection/components/bal-popover/bal-popover.js +37 -39
  479. package/dist/collection/components/bal-popup/bal-popup.js +33 -35
  480. package/dist/collection/components/bal-popup/variants/popover-variant.renderer.js +12 -8
  481. package/dist/collection/components/bal-progress-bar/bal-progress-bar.js +1 -1
  482. package/dist/collection/components/bal-radio/bal-radio-button/bal-radio-button.js +1 -1
  483. package/dist/collection/components/bal-radio/bal-radio-group/bal-radio-group.js +31 -33
  484. package/dist/collection/components/bal-radio/bal-radio.js +9 -11
  485. package/dist/collection/components/bal-segment/bal-segment-item/bal-segment-item.js +1 -1
  486. package/dist/collection/components/bal-segment/bal-segment.js +15 -17
  487. package/dist/collection/components/bal-select/bal-select-option/bal-select-option.js +1 -1
  488. package/dist/collection/components/bal-select/bal-select.js +26 -27
  489. package/dist/collection/components/bal-shape/bal-shape.js +4 -4
  490. package/dist/collection/components/bal-sheet/bal-sheet.js +1 -1
  491. package/dist/collection/components/bal-snackbar/bal-snackbar.js +1 -1
  492. package/dist/collection/components/bal-spinner/bal-spinner.js +3 -3
  493. package/dist/collection/components/bal-stack/bal-stack.js +1 -1
  494. package/dist/collection/components/bal-stage/bal-stage-back-link/bal-stage-back-link.js +2 -2
  495. package/dist/collection/components/bal-stage/bal-stage-body/bal-stage-body.js +1 -1
  496. package/dist/collection/components/bal-stage/bal-stage-foot/bal-stage-foot.js +1 -1
  497. package/dist/collection/components/bal-stage/bal-stage-head/bal-stage-head.js +1 -1
  498. package/dist/collection/components/bal-stage/bal-stage-image/bal-stage-image.js +14 -1
  499. package/dist/collection/components/bal-stage/bal-stage.js +1 -1
  500. package/dist/collection/components/bal-steps/bal-step-item/bal-step-item.js +2 -2
  501. package/dist/collection/components/bal-steps/bal-steps.js +1 -1
  502. package/dist/collection/components/bal-table/bal-table.js +1 -1
  503. package/dist/collection/components/bal-tabs/bal-tab-item/bal-tab-item.js +2 -2
  504. package/dist/collection/components/bal-tabs/bal-tabs.js +44 -38
  505. package/dist/collection/components/bal-tag/bal-tag-group/bal-tag-group.js +1 -1
  506. package/dist/collection/components/bal-tag/bal-tag.js +1 -1
  507. package/dist/collection/components/bal-text/bal-text.js +2 -2
  508. package/dist/collection/components/bal-textarea/bal-textarea.js +15 -16
  509. package/dist/collection/components/bal-time-input/bal-time-input.css +1 -1
  510. package/dist/collection/components/bal-time-input/bal-time-input.js +15 -17
  511. package/dist/collection/components/bal-toast/bal-toast.js +1 -1
  512. package/dist/collection/components/bal-tooltip/bal-tooltip.js +13 -9
  513. package/dist/collection/index.js +1 -2
  514. package/dist/collection/utils/array.js +17 -0
  515. package/dist/collection/utils/constants/version.constant.js +1 -1
  516. package/dist/collection/utils/date/date.helpers.js +30 -0
  517. package/dist/collection/utils/date/date.js +1 -1
  518. package/dist/collection/utils/date/index.js +1 -0
  519. package/dist/collection/utils/dropdown/auto-fill.js +1 -1
  520. package/dist/collection/utils/dropdown/icon.js +1 -1
  521. package/dist/collection/utils/dropdown/popup.js +9 -6
  522. package/dist/collection/utils/dropdown/value.js +1 -1
  523. package/dist/collection/utils/floating-ui.js +23 -0
  524. package/dist/collection/utils/helpers.js +41 -2
  525. package/dist/collection/utils/keyboard/index.js +1 -0
  526. package/dist/collection/utils/keyboard/keyboard.helpers.js +60 -0
  527. package/dist/collection/utils/listen.js +55 -0
  528. package/dist/collection/utils/mask/types/mask-date.js +1 -1
  529. package/dist/collection/utils/mutation/mutation.subject.js +13 -11
  530. package/dist/collection/utils/number.js +18 -10
  531. package/dist/collection/utils/swipe/swipe.listener.js +2 -2
  532. package/dist/esm/{app-globals-b0dd0fc4.js → app-globals-4d0448ee.js} +1 -1
  533. package/dist/esm/array-4c09dfe3.js +20 -0
  534. package/dist/esm/bal-accordion_4.entry.js +7 -9
  535. package/dist/esm/bal-app.entry.js +12 -6
  536. package/dist/esm/bal-badge.entry.js +2 -2
  537. package/dist/esm/bal-button_2.entry.js +21 -5
  538. package/dist/esm/bal-card_6.entry.js +8 -8
  539. package/dist/esm/bal-carousel_2.entry.js +49 -17
  540. package/dist/esm/bal-checkbox-button.entry.js +5 -5
  541. package/dist/esm/bal-checkbox_2.entry.js +46 -7
  542. package/dist/esm/bal-close.entry.js +2 -2
  543. package/dist/esm/bal-content.entry.js +2 -2
  544. package/dist/esm/bal-data_4.entry.js +5 -5
  545. package/dist/esm/bal-date-calendar-cell.entry.js +4 -4
  546. package/dist/esm/bal-date-calendar_2.entry.js +23 -10
  547. package/dist/esm/bal-date.entry.js +41 -14
  548. package/dist/esm/bal-divider.entry.js +2 -2
  549. package/dist/esm/bal-dropdown.entry.js +59 -34
  550. package/dist/esm/bal-field_5.entry.js +11 -13
  551. package/dist/esm/bal-file-upload.entry.js +16 -8
  552. package/dist/esm/bal-footer.entry.js +198 -10
  553. package/dist/esm/bal-form-col_2.entry.js +4 -4
  554. package/dist/esm/bal-form.entry.js +3 -3
  555. package/dist/esm/bal-heading_2.entry.js +4 -4
  556. package/dist/esm/bal-hint_5.entry.js +45 -20
  557. package/dist/esm/bal-icon.entry.js +14 -3
  558. package/dist/esm/bal-input-group.entry.js +2 -2
  559. package/dist/esm/bal-input-slider.entry.js +20 -6
  560. package/dist/esm/bal-input-stepper.entry.js +21 -9
  561. package/dist/esm/bal-input.entry.js +17 -4
  562. package/dist/esm/bal-label.entry.js +2 -2
  563. package/dist/esm/bal-list_8.entry.js +19 -21
  564. package/dist/esm/bal-logo.entry.js +6 -6
  565. package/dist/esm/bal-modal_3.entry.js +36 -10
  566. package/dist/esm/bal-nav_8.entry.js +37 -18
  567. package/dist/esm/bal-navbar_5.entry.js +11 -11
  568. package/dist/esm/bal-notices_3.entry.js +5 -5
  569. package/dist/esm/bal-notification.entry.js +2 -2
  570. package/dist/esm/bal-number-input.entry.js +20 -24
  571. package/dist/esm/bal-option_2.entry.js +25 -6
  572. package/dist/esm/bal-pagination.entry.js +9 -9
  573. package/dist/esm/bal-popup.entry.js +48 -15
  574. package/dist/esm/bal-progress-bar.entry.js +7 -7
  575. package/dist/esm/bal-radio-button.entry.js +5 -5
  576. package/dist/esm/bal-radio_2.entry.js +44 -9
  577. package/dist/esm/bal-segment_2.entry.js +24 -13
  578. package/dist/esm/bal-select_2.entry.js +31 -10
  579. package/dist/esm/bal-shape.entry.js +6 -6
  580. package/dist/esm/bal-sheet.entry.js +2 -2
  581. package/dist/esm/bal-spinner.entry.js +4 -4
  582. package/dist/esm/bal-stack.entry.js +2 -2
  583. package/dist/esm/bal-stage_6.entry.js +19 -8
  584. package/dist/esm/bal-step-item.entry.js +3 -3
  585. package/dist/esm/bal-steps.entry.js +9 -8
  586. package/dist/esm/bal-tab-item_2.entry.js +53 -26
  587. package/dist/esm/bal-table.entry.js +2 -2
  588. package/dist/esm/bal-tag_2.entry.js +3 -3
  589. package/dist/esm/bal-textarea.entry.js +18 -4
  590. package/dist/esm/bal-time-input.entry.js +19 -6
  591. package/dist/esm/bal-tooltip.entry.js +17 -10
  592. package/dist/esm/baloise-design-system.js +15 -15
  593. package/dist/esm/{breakpoints.decorator-f08ad280.js → breakpoints.decorator-9981606e.js} +1 -1
  594. package/dist/esm/{breakpoints.subject-d2b4fd79.js → breakpoints.subject-ae98d0fa.js} +2 -2
  595. package/dist/esm/{date-6e8f5617.js → date-3b88d03c.js} +32 -2
  596. package/dist/esm/{element-states.decorator-071e2b6b.js → element-states.decorator-0f2107d8.js} +1 -1
  597. package/dist/esm/floating-ui-82413f23.js +26 -0
  598. package/dist/{cjs/floating-ui.dom.esm-5dbdcff9.js → esm/floating-ui.dom.esm-8dcdb8d6.js} +493 -8
  599. package/dist/esm/{focus.decorator-8acd79c3.js → focus.decorator-dc333802.js} +1 -1
  600. package/dist/esm/{form-input-a8fdaaef.js → form-input-264ad739.js} +2 -2
  601. package/dist/esm/{helpers-c201154e.js → helpers-72ae7307.js} +35 -3
  602. package/dist/esm/index-5b1faf93.js +1658 -0
  603. package/dist/esm/index-95ee0c4b.js +1858 -0
  604. package/dist/esm/index-bba06972.js +558 -0
  605. package/dist/esm/index.js +10 -14
  606. package/dist/esm/{initialize-e216cfe4.js → initialize-f93872c4.js} +2 -2
  607. package/dist/esm/keyboard.helpers-b2dd6393.js +62 -0
  608. package/dist/esm/listen-d1712e70.js +58 -0
  609. package/dist/esm/loader.js +7 -7
  610. package/dist/esm/{mutation.decorator-c7b24839.js → mutation.decorator-985cc0a1.js} +13 -11
  611. package/dist/esm/number-54693efa.js +30 -0
  612. package/dist/esm/{overlays-9d49a4a5.js → overlays-73dcc4a8.js} +1 -1
  613. package/dist/esm/{resize.decorator-f70563b5.js → resize.decorator-f2d8461d.js} +1 -1
  614. package/dist/esm/{swipe.decorator-9d904794.js → swipe.decorator-56b6d574.js} +1 -1
  615. package/dist/esm/{swipe.subject-f1d64e8d.js → swipe.subject-683f7c7b.js} +2 -2
  616. package/dist/esm/{tokens.esm-cada8a2a.js → tokens.esm-ed9fb455.js} +1 -1
  617. package/dist/esm/{window-resize.decorator-6ef9be6a.js → window-resize.decorator-a88002f7.js} +1 -1
  618. package/dist/esm-es5/app-globals-4d0448ee.js +1 -0
  619. package/dist/esm-es5/array-4c09dfe3.js +1 -0
  620. package/dist/esm-es5/bal-accordion_4.entry.js +1 -1
  621. package/dist/esm-es5/bal-app.entry.js +1 -1
  622. package/dist/esm-es5/bal-badge.entry.js +1 -1
  623. package/dist/esm-es5/bal-button_2.entry.js +1 -1
  624. package/dist/esm-es5/bal-card_6.entry.js +1 -1
  625. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  626. package/dist/esm-es5/bal-checkbox-button.entry.js +1 -1
  627. package/dist/esm-es5/bal-checkbox_2.entry.js +1 -1
  628. package/dist/esm-es5/bal-close.entry.js +1 -1
  629. package/dist/esm-es5/bal-content.entry.js +1 -1
  630. package/dist/esm-es5/bal-data_4.entry.js +1 -1
  631. package/dist/esm-es5/bal-date-calendar-cell.entry.js +1 -1
  632. package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
  633. package/dist/esm-es5/bal-date.entry.js +1 -1
  634. package/dist/esm-es5/bal-divider.entry.js +1 -1
  635. package/dist/esm-es5/bal-dropdown.entry.js +1 -1
  636. package/dist/esm-es5/bal-field_5.entry.js +1 -1
  637. package/dist/esm-es5/bal-file-upload.entry.js +1 -1
  638. package/dist/esm-es5/bal-footer.entry.js +1 -1
  639. package/dist/esm-es5/bal-form-col_2.entry.js +1 -1
  640. package/dist/esm-es5/bal-form.entry.js +1 -1
  641. package/dist/esm-es5/bal-heading_2.entry.js +1 -1
  642. package/dist/esm-es5/bal-hint_5.entry.js +1 -1
  643. package/dist/esm-es5/bal-icon.entry.js +1 -1
  644. package/dist/esm-es5/bal-input-group.entry.js +1 -1
  645. package/dist/esm-es5/bal-input-slider.entry.js +1 -1
  646. package/dist/esm-es5/bal-input-stepper.entry.js +1 -1
  647. package/dist/esm-es5/bal-input.entry.js +1 -1
  648. package/dist/esm-es5/bal-label.entry.js +1 -1
  649. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  650. package/dist/esm-es5/bal-logo.entry.js +1 -1
  651. package/dist/esm-es5/bal-modal_3.entry.js +1 -1
  652. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  653. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  654. package/dist/esm-es5/bal-notices_3.entry.js +1 -1
  655. package/dist/esm-es5/bal-notification.entry.js +1 -1
  656. package/dist/esm-es5/bal-number-input.entry.js +1 -1
  657. package/dist/esm-es5/bal-option_2.entry.js +1 -1
  658. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  659. package/dist/esm-es5/bal-popup.entry.js +1 -1
  660. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  661. package/dist/esm-es5/bal-radio-button.entry.js +1 -1
  662. package/dist/esm-es5/bal-radio_2.entry.js +1 -1
  663. package/dist/esm-es5/bal-segment_2.entry.js +1 -1
  664. package/dist/esm-es5/bal-select_2.entry.js +1 -1
  665. package/dist/esm-es5/bal-shape.entry.js +1 -1
  666. package/dist/esm-es5/bal-sheet.entry.js +1 -1
  667. package/dist/esm-es5/bal-spinner.entry.js +1 -1
  668. package/dist/esm-es5/bal-stack.entry.js +1 -1
  669. package/dist/esm-es5/bal-stage_6.entry.js +1 -1
  670. package/dist/esm-es5/bal-step-item.entry.js +1 -1
  671. package/dist/esm-es5/bal-steps.entry.js +1 -1
  672. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  673. package/dist/esm-es5/bal-table.entry.js +1 -1
  674. package/dist/esm-es5/bal-tag_2.entry.js +1 -1
  675. package/dist/esm-es5/bal-textarea.entry.js +1 -1
  676. package/dist/esm-es5/bal-time-input.entry.js +1 -1
  677. package/dist/esm-es5/bal-tooltip.entry.js +1 -1
  678. package/dist/esm-es5/baloise-design-system.js +1 -1
  679. package/dist/esm-es5/breakpoints.decorator-9981606e.js +1 -0
  680. package/dist/esm-es5/{breakpoints.subject-d2b4fd79.js → breakpoints.subject-ae98d0fa.js} +1 -1
  681. package/dist/esm-es5/date-3b88d03c.js +1 -0
  682. package/dist/esm-es5/{element-states.decorator-071e2b6b.js → element-states.decorator-0f2107d8.js} +1 -1
  683. package/dist/esm-es5/floating-ui-82413f23.js +1 -0
  684. package/dist/esm-es5/floating-ui.dom.esm-8dcdb8d6.js +1 -0
  685. package/dist/esm-es5/{focus.decorator-8acd79c3.js → focus.decorator-dc333802.js} +1 -1
  686. package/dist/esm-es5/{form-input-a8fdaaef.js → form-input-264ad739.js} +1 -1
  687. package/dist/esm-es5/helpers-72ae7307.js +1 -0
  688. package/dist/esm-es5/index-5b1faf93.js +2 -0
  689. package/dist/esm-es5/index-95ee0c4b.js +1 -0
  690. package/dist/esm-es5/index-bba06972.js +1 -0
  691. package/dist/esm-es5/index.js +1 -1
  692. package/dist/esm-es5/{initialize-e216cfe4.js → initialize-f93872c4.js} +1 -1
  693. package/dist/esm-es5/keyboard.helpers-b2dd6393.js +1 -0
  694. package/dist/esm-es5/listen-d1712e70.js +1 -0
  695. package/dist/esm-es5/loader.js +1 -1
  696. package/dist/esm-es5/mutation.decorator-985cc0a1.js +1 -0
  697. package/dist/esm-es5/number-54693efa.js +1 -0
  698. package/dist/esm-es5/{overlays-9d49a4a5.js → overlays-73dcc4a8.js} +1 -1
  699. package/dist/esm-es5/{resize.decorator-f70563b5.js → resize.decorator-f2d8461d.js} +1 -1
  700. package/dist/esm-es5/{swipe.decorator-9d904794.js → swipe.decorator-56b6d574.js} +1 -1
  701. package/dist/esm-es5/swipe.subject-683f7c7b.js +1 -0
  702. package/dist/esm-es5/{window-resize.decorator-6ef9be6a.js → window-resize.decorator-a88002f7.js} +1 -1
  703. package/dist/html.html-data.json +0 -83
  704. package/dist/types/components/bal-accordion/bal-accordion.interfaces.d.ts +0 -1
  705. package/dist/types/components/bal-app/bal-app.interfaces.d.ts +0 -1
  706. package/dist/types/components/bal-badge/bal-badge.interfaces.d.ts +0 -1
  707. package/dist/types/components/bal-button/bal-button.d.ts +2 -0
  708. package/dist/types/components/bal-button/bal-button.interfaces.d.ts +0 -1
  709. package/dist/types/components/bal-card/bal-card.interfaces.d.ts +0 -1
  710. package/dist/types/components/bal-carousel/bal-carousel-item/bal-carousel-item.d.ts +6 -0
  711. package/dist/types/components/bal-carousel/bal-carousel.d.ts +3 -0
  712. package/dist/types/components/bal-carousel/bal-carousel.interfaces.d.ts +0 -1
  713. package/dist/types/components/bal-checkbox/bal-checkbox.interfaces.d.ts +0 -1
  714. package/dist/types/components/bal-close/bal-close.interfaces.d.ts +0 -1
  715. package/dist/types/components/bal-content/bal-content.interfaces.d.ts +0 -1
  716. package/dist/types/components/bal-data/bal-data.interfaces.d.ts +0 -1
  717. package/dist/types/components/bal-date/bal-date-calendar/bal-date-calendar.interfaces.d.ts +0 -1
  718. package/dist/types/components/bal-date/bal-date.interfaces.d.ts +0 -1
  719. package/dist/types/components/bal-divider/bal-divider.interfaces.d.ts +0 -1
  720. package/dist/types/components/bal-dropdown/bal-dropdown.d.ts +6 -4
  721. package/dist/types/components/bal-dropdown/bal-dropdown.interfaces.d.ts +0 -1
  722. package/dist/types/components/bal-field/bal-field.interfaces.d.ts +0 -1
  723. package/dist/types/components/bal-file-upload/bal-file-upload.interfaces.d.ts +0 -1
  724. package/dist/types/components/bal-form-grid/bal-form-gird.interfaces.d.ts +0 -1
  725. package/dist/types/components/bal-heading/bal-heading.interfaces.d.ts +0 -1
  726. package/dist/types/components/bal-icon/bal-icon.d.ts +6 -0
  727. package/dist/types/components/bal-icon/bal-icon.interfaces.d.ts +0 -1
  728. package/dist/types/components/bal-input/bal-input.interfaces.d.ts +0 -1
  729. package/dist/types/components/bal-input-slider/bal-input-slider.interfaces.d.ts +0 -1
  730. package/dist/types/components/bal-input-stepper/bal-input-stepper.interfaces.d.ts +0 -1
  731. package/dist/types/components/bal-label/bal-label.interfaces.d.ts +0 -1
  732. package/dist/types/components/bal-list/bal-list.interfaces.d.ts +0 -1
  733. package/dist/types/components/bal-logo/bal-logo.animation.d.ts +1 -1
  734. package/dist/types/components/bal-logo/bal-logo.interfaces.d.ts +0 -1
  735. package/dist/types/components/bal-modal/bal-modal.interfaces.d.ts +0 -1
  736. package/dist/types/components/bal-nav/bal-nav-link/bal-nav-link.interfaces.d.ts +0 -1
  737. package/dist/types/components/bal-nav/bal-nav-link-grid-col/bal-nav-link-grid-col.interfaces.d.ts +0 -1
  738. package/dist/types/components/bal-nav/bal-nav-link-group/bal-nav-link-group.interfaces.d.ts +0 -1
  739. package/dist/types/components/bal-nav/bal-nav-menu-bar/bal-nav-menu-bar.interfaces.d.ts +0 -1
  740. package/dist/types/components/bal-nav/bal-nav-menu-flyout/bal-nav-menu-flyout.interfaces.d.ts +0 -1
  741. package/dist/types/components/bal-nav/bal-nav-meta-bar/bal-nav-meta-bar.interfaces.d.ts +0 -1
  742. package/dist/types/components/bal-nav/bal-nav.interfaces.d.ts +0 -1
  743. package/dist/types/components/bal-navbar/bal-navbar.interfaces.d.ts +0 -1
  744. package/dist/types/components/bal-notification/bal-notification.interfaces.d.ts +0 -1
  745. package/dist/types/components/bal-number-input/bal-number-input.interfaces.d.ts +0 -1
  746. package/dist/types/components/bal-option/bal-option.interfaces.d.ts +0 -1
  747. package/dist/types/components/bal-option-list/bal-option-list.interfaces.d.ts +0 -1
  748. package/dist/types/components/bal-pagination/bal-pagination.interfaces.d.ts +0 -1
  749. package/dist/types/components/bal-popover/bal-popover.d.ts +1 -2
  750. package/dist/types/components/bal-popover/bal-popover.interfaces.d.ts +0 -1
  751. package/dist/types/components/bal-popup/bal-popup.interfaces.d.ts +0 -1
  752. package/dist/types/components/bal-progress-bar/bal-progress-bar.interfaces.d.ts +0 -1
  753. package/dist/types/components/bal-radio/bal-radio.interfaces.d.ts +0 -1
  754. package/dist/types/components/bal-segment/bal-segment.interfaces.d.ts +0 -1
  755. package/dist/types/components/bal-select/bal-select.d.ts +1 -1
  756. package/dist/types/components/bal-select/bal-select.interfaces.d.ts +0 -1
  757. package/dist/types/components/bal-select/utils/watch-options.d.ts +1 -1
  758. package/dist/types/components/bal-shape/bal-shape.interfaces.d.ts +0 -1
  759. package/dist/types/components/bal-sheet/bal-sheet.interfaces.d.ts +0 -1
  760. package/dist/types/components/bal-snackbar/bal-snackbar.interfaces.d.ts +0 -1
  761. package/dist/types/components/bal-spinner/bal-spinner.interfaces.d.ts +0 -1
  762. package/dist/types/components/bal-stack/bal-stack.interfaces.d.ts +0 -1
  763. package/dist/types/components/bal-stage/bal-stage-image/bal-stage-image.d.ts +2 -0
  764. package/dist/types/components/bal-stage/bal-stage.interfaces.d.ts +0 -1
  765. package/dist/types/components/bal-steps/bal-steps.interfaces.d.ts +0 -1
  766. package/dist/types/components/bal-tabs/bal-tabs.d.ts +2 -0
  767. package/dist/types/components/bal-tabs/bal-tabs.interfaces.d.ts +0 -1
  768. package/dist/types/components/bal-tag/bal-tag.interfaces.d.ts +0 -1
  769. package/dist/types/components/bal-text/bal-text.interfaces.d.ts +0 -1
  770. package/dist/types/components/bal-textarea/bal-textarea.interfaces.d.ts +0 -1
  771. package/dist/types/components/bal-time-input/bal-time-input.interfaces.d.ts +0 -1
  772. package/dist/types/components/bal-toast/bal-toast.d.ts +0 -1
  773. package/dist/types/components/bal-toast/bal-toast.interfaces.d.ts +0 -1
  774. package/dist/types/components/bal-tooltip/bal-tooltip.interfaces.d.ts +0 -1
  775. package/dist/types/components.d.ts +0 -227
  776. package/dist/types/index.d.ts +1 -2
  777. package/dist/types/interfaces.d.ts +0 -1
  778. package/dist/types/stencil-public-runtime.d.ts +9 -10
  779. package/dist/types/utils/array.d.ts +8 -0
  780. package/dist/types/utils/date/date.helpers.d.ts +9 -0
  781. package/dist/types/utils/date/index.d.ts +1 -0
  782. package/dist/types/utils/dropdown/popup.d.ts +2 -1
  783. package/dist/types/utils/floating-ui.d.ts +15 -0
  784. package/dist/types/utils/form-input.d.ts +1 -5
  785. package/dist/types/utils/helpers.d.ts +6 -0
  786. package/dist/types/utils/keyboard/index.d.ts +1 -0
  787. package/dist/types/utils/keyboard/keyboard.helpers.d.ts +40 -0
  788. package/dist/types/utils/legacy.d.ts +1 -1
  789. package/dist/types/utils/listen.d.ts +12 -0
  790. package/dist/types/utils/mask/__test__/mask-component.mock.d.ts +6 -6
  791. package/dist/types/utils/mask/__test__/mask.mock.d.ts +9 -9
  792. package/dist/types/utils/number.d.ts +3 -3
  793. package/loader/cdn.js +1 -2
  794. package/loader/index.cjs.js +1 -2
  795. package/loader/index.d.ts +3 -0
  796. package/loader/index.es2017.js +1 -2
  797. package/loader/index.js +1 -2
  798. package/package.json +9 -9
  799. package/components/bal-datepicker.d.ts +0 -11
  800. package/components/bal-datepicker.i18n.js +0 -74
  801. package/components/bal-datepicker.js +0 -1152
  802. package/components/index.esm.js +0 -7397
  803. package/dist/baloise-design-system/p-00014af866.system.entry.js +0 -1
  804. package/dist/baloise-design-system/p-004e4a0f4d.system.entry.js +0 -1
  805. package/dist/baloise-design-system/p-013b4c72.system.js +0 -1
  806. package/dist/baloise-design-system/p-09c9dcdf39.entry.js +0 -1
  807. package/dist/baloise-design-system/p-0f611b4158.system.entry.js +0 -1
  808. package/dist/baloise-design-system/p-10c13a369c.system.entry.js +0 -1
  809. package/dist/baloise-design-system/p-119b9e4909.entry.js +0 -1
  810. package/dist/baloise-design-system/p-16b1404ab3.system.entry.js +0 -1
  811. package/dist/baloise-design-system/p-1876e0cbba.entry.js +0 -1
  812. package/dist/baloise-design-system/p-26c8f676d0.system.entry.js +0 -1
  813. package/dist/baloise-design-system/p-2aa4f352d9.system.entry.js +0 -1
  814. package/dist/baloise-design-system/p-2b1171b384.entry.js +0 -1
  815. package/dist/baloise-design-system/p-2de8a7d2f2.entry.js +0 -1
  816. package/dist/baloise-design-system/p-2ea7550d1b.system.entry.js +0 -1
  817. package/dist/baloise-design-system/p-3231863d.js +0 -1
  818. package/dist/baloise-design-system/p-33028eda8b.entry.js +0 -1
  819. package/dist/baloise-design-system/p-360937c857.entry.js +0 -1
  820. package/dist/baloise-design-system/p-368bd6ac.system.js +0 -1
  821. package/dist/baloise-design-system/p-38e8a5093f.entry.js +0 -1
  822. package/dist/baloise-design-system/p-3b02994202.entry.js +0 -1
  823. package/dist/baloise-design-system/p-3b96381383.system.entry.js +0 -1
  824. package/dist/baloise-design-system/p-414d9ac8db.entry.js +0 -1
  825. package/dist/baloise-design-system/p-456fc561.system.js +0 -2
  826. package/dist/baloise-design-system/p-462b20f382.entry.js +0 -1
  827. package/dist/baloise-design-system/p-474fb49244.system.entry.js +0 -1
  828. package/dist/baloise-design-system/p-4ae121b6.js +0 -1
  829. package/dist/baloise-design-system/p-4b12d35824.entry.js +0 -1
  830. package/dist/baloise-design-system/p-4e05616242.entry.js +0 -1
  831. package/dist/baloise-design-system/p-4f083c5352.entry.js +0 -1
  832. package/dist/baloise-design-system/p-50b18f1f90.entry.js +0 -1
  833. package/dist/baloise-design-system/p-52351c7b9b.system.entry.js +0 -1
  834. package/dist/baloise-design-system/p-5b5d1c626d.system.entry.js +0 -1
  835. package/dist/baloise-design-system/p-5c0b0099.system.js +0 -1
  836. package/dist/baloise-design-system/p-5ef256a316.system.entry.js +0 -1
  837. package/dist/baloise-design-system/p-60e74d3515.system.entry.js +0 -1
  838. package/dist/baloise-design-system/p-6139ff78d7.system.entry.js +0 -1
  839. package/dist/baloise-design-system/p-619afa0ba5.system.entry.js +0 -1
  840. package/dist/baloise-design-system/p-635bc3259a.entry.js +0 -1
  841. package/dist/baloise-design-system/p-63c685b62d.entry.js +0 -1
  842. package/dist/baloise-design-system/p-648814edf8.entry.js +0 -1
  843. package/dist/baloise-design-system/p-648cafc450.entry.js +0 -1
  844. package/dist/baloise-design-system/p-663cc3242c.entry.js +0 -1
  845. package/dist/baloise-design-system/p-68828341e5.entry.js +0 -1
  846. package/dist/baloise-design-system/p-6a5d6e4680.entry.js +0 -1
  847. package/dist/baloise-design-system/p-6a8f612c6f.entry.js +0 -1
  848. package/dist/baloise-design-system/p-6aafd1a509.entry.js +0 -1
  849. package/dist/baloise-design-system/p-6c4b01f0a3.system.entry.js +0 -1
  850. package/dist/baloise-design-system/p-6c4b79bd09.entry.js +0 -1
  851. package/dist/baloise-design-system/p-6f18ca5500.entry.js +0 -1
  852. package/dist/baloise-design-system/p-6fb7d22ecb.system.entry.js +0 -1
  853. package/dist/baloise-design-system/p-73d0e3b2a7.system.entry.js +0 -1
  854. package/dist/baloise-design-system/p-749c516acc.system.entry.js +0 -1
  855. package/dist/baloise-design-system/p-760797ae02.system.entry.js +0 -1
  856. package/dist/baloise-design-system/p-7cd815d3e8.entry.js +0 -1
  857. package/dist/baloise-design-system/p-7d2709b193.system.entry.js +0 -1
  858. package/dist/baloise-design-system/p-7e54ecfcf8.system.entry.js +0 -1
  859. package/dist/baloise-design-system/p-8152631cd8.entry.js +0 -1
  860. package/dist/baloise-design-system/p-82333c3ce3.entry.js +0 -1
  861. package/dist/baloise-design-system/p-82afff07ac.system.entry.js +0 -1
  862. package/dist/baloise-design-system/p-82dea9a1e3.entry.js +0 -1
  863. package/dist/baloise-design-system/p-83c70a6b53.entry.js +0 -1
  864. package/dist/baloise-design-system/p-863d57eb.js +0 -1
  865. package/dist/baloise-design-system/p-87e2b8fad8.entry.js +0 -1
  866. package/dist/baloise-design-system/p-88f18fbc.js +0 -1
  867. package/dist/baloise-design-system/p-8954495d.system.js +0 -1
  868. package/dist/baloise-design-system/p-898f7862e4.entry.js +0 -1
  869. package/dist/baloise-design-system/p-8da6d9dae1.entry.js +0 -1
  870. package/dist/baloise-design-system/p-950dd794aa.system.entry.js +0 -1
  871. package/dist/baloise-design-system/p-959fc8c170.system.entry.js +0 -1
  872. package/dist/baloise-design-system/p-9e9e42ca3a.system.entry.js +0 -1
  873. package/dist/baloise-design-system/p-9f5eda0e22.entry.js +0 -1
  874. package/dist/baloise-design-system/p-a4dacc2d.system.js +0 -1
  875. package/dist/baloise-design-system/p-a7767b9500.system.entry.js +0 -1
  876. package/dist/baloise-design-system/p-a78d1ca569.system.entry.js +0 -1
  877. package/dist/baloise-design-system/p-a7fc2da7.system.js +0 -1
  878. package/dist/baloise-design-system/p-a8b35d33fe.entry.js +0 -1
  879. package/dist/baloise-design-system/p-ac24ebaa.system.js +0 -1
  880. package/dist/baloise-design-system/p-ac6d5570d8.system.entry.js +0 -1
  881. package/dist/baloise-design-system/p-b239069aea.entry.js +0 -1
  882. package/dist/baloise-design-system/p-b4c5b5e53f.entry.js +0 -1
  883. package/dist/baloise-design-system/p-b51665840d.entry.js +0 -1
  884. package/dist/baloise-design-system/p-b6624cd6f3.entry.js +0 -1
  885. package/dist/baloise-design-system/p-b7cef472.js +0 -1
  886. package/dist/baloise-design-system/p-b80d9e4d.js +0 -1
  887. package/dist/baloise-design-system/p-b87c29c80b.entry.js +0 -1
  888. package/dist/baloise-design-system/p-bcca1ed3.system.js +0 -1
  889. package/dist/baloise-design-system/p-bd5de78b2c.entry.js +0 -1
  890. package/dist/baloise-design-system/p-bd74623f0b.system.entry.js +0 -1
  891. package/dist/baloise-design-system/p-be366c8428.entry.js +0 -1
  892. package/dist/baloise-design-system/p-bffc03a66d.entry.js +0 -1
  893. package/dist/baloise-design-system/p-c442bb2db2.entry.js +0 -1
  894. package/dist/baloise-design-system/p-c4e11d3813.entry.js +0 -1
  895. package/dist/baloise-design-system/p-c539ee8edf.entry.js +0 -1
  896. package/dist/baloise-design-system/p-c64f74a007.entry.js +0 -1
  897. package/dist/baloise-design-system/p-c7338c255f.entry.js +0 -1
  898. package/dist/baloise-design-system/p-cb29a218db.entry.js +0 -1
  899. package/dist/baloise-design-system/p-cc0073c153.entry.js +0 -1
  900. package/dist/baloise-design-system/p-ce37dba1.js +0 -1
  901. package/dist/baloise-design-system/p-d14e28eb84.system.entry.js +0 -1
  902. package/dist/baloise-design-system/p-d5c02240d5.entry.js +0 -1
  903. package/dist/baloise-design-system/p-d7c752c6.js +0 -2
  904. package/dist/baloise-design-system/p-dbcf60eced.entry.js +0 -1
  905. package/dist/baloise-design-system/p-de69e6ded1.system.entry.js +0 -1
  906. package/dist/baloise-design-system/p-dec8453a4d.entry.js +0 -1
  907. package/dist/baloise-design-system/p-e088800e47.system.entry.js +0 -1
  908. package/dist/baloise-design-system/p-e6162b978e.entry.js +0 -1
  909. package/dist/baloise-design-system/p-e6f257c59c.entry.js +0 -1
  910. package/dist/baloise-design-system/p-e78a6409.js +0 -1
  911. package/dist/baloise-design-system/p-e7bcca66c5.system.entry.js +0 -1
  912. package/dist/baloise-design-system/p-e833841822.entry.js +0 -1
  913. package/dist/baloise-design-system/p-ec297b3c54.system.entry.js +0 -1
  914. package/dist/baloise-design-system/p-f00b5e9fa4.system.entry.js +0 -1
  915. package/dist/baloise-design-system/p-f0e432e19a.entry.js +0 -1
  916. package/dist/baloise-design-system/p-f22c8e0c59.entry.js +0 -1
  917. package/dist/baloise-design-system/p-f4e7616005.system.entry.js +0 -1
  918. package/dist/baloise-design-system/p-f8c5e9e7.system.js +0 -1
  919. package/dist/cjs/bal-datepicker.cjs.entry.js +0 -1071
  920. package/dist/cjs/bal-datepicker.i18n-8c3dd510.js +0 -76
  921. package/dist/cjs/index-219b2f52.js +0 -2521
  922. package/dist/cjs/index.esm-54a3d84e.js +0 -7429
  923. package/dist/collection/components/bal-date/utils/calendar.spec.js +0 -304
  924. package/dist/collection/components/bal-datepicker/bal-datepicker.css +0 -1
  925. package/dist/collection/components/bal-datepicker/bal-datepicker.i18n.js +0 -72
  926. package/dist/collection/components/bal-datepicker/bal-datepicker.interfaces.js +0 -4
  927. package/dist/collection/components/bal-datepicker/bal-datepicker.js +0 -1240
  928. package/dist/collection/components/bal-datepicker/bal-datepicker.type.js +0 -1
  929. package/dist/collection/components/bal-file-upload/test/file-validation.util.spec.js +0 -102
  930. package/dist/collection/components/bal-input/test/bal-input-util.spec.js +0 -141
  931. package/dist/collection/components/bal-number-input/bal-number-input.utils.spec.js +0 -402
  932. package/dist/collection/components/bal-pagination/bal-pagination.spec.js +0 -349
  933. package/dist/collection/components/bal-select/test/bal-select-utils.spec.js +0 -99
  934. package/dist/collection/components/bal-time-input/test/bal-time-input.util.spec.js +0 -27
  935. package/dist/collection/utils/date/date.spec.js +0 -137
  936. package/dist/collection/utils/form-input.spec.js +0 -30
  937. package/dist/collection/utils/mask/blocks/mask-block-list.spec.js +0 -73
  938. package/dist/collection/utils/mask/blocks/mask-blocks.spec.js +0 -48
  939. package/dist/collection/utils/mask/component/mask-component-adapter.spec.js +0 -192
  940. package/dist/collection/utils/mask/mask.spec.js +0 -332
  941. package/dist/collection/utils/mask/types/mask-date.spec.js +0 -48
  942. package/dist/collection/utils/string.spec.js +0 -24
  943. package/dist/esm/bal-datepicker.entry.js +0 -1067
  944. package/dist/esm/bal-datepicker.i18n-63a3cb67.js +0 -74
  945. package/dist/esm/index-b6003bc7.js +0 -2490
  946. package/dist/esm/index.esm-cc299511.js +0 -7397
  947. package/dist/esm-es5/app-globals-b0dd0fc4.js +0 -1
  948. package/dist/esm-es5/bal-datepicker.entry.js +0 -1
  949. package/dist/esm-es5/bal-datepicker.i18n-63a3cb67.js +0 -1
  950. package/dist/esm-es5/breakpoints.decorator-f08ad280.js +0 -1
  951. package/dist/esm-es5/date-6e8f5617.js +0 -1
  952. package/dist/esm-es5/floating-ui.dom.esm-f1cf1077.js +0 -1
  953. package/dist/esm-es5/helpers-c201154e.js +0 -1
  954. package/dist/esm-es5/index-b6003bc7.js +0 -2
  955. package/dist/esm-es5/index.esm-cc299511.js +0 -1
  956. package/dist/esm-es5/mutation.decorator-c7b24839.js +0 -1
  957. package/dist/esm-es5/swipe.subject-f1d64e8d.js +0 -1
  958. package/dist/types/components/bal-datepicker/bal-datepicker.d.ts +0 -221
  959. package/dist/types/components/bal-datepicker/bal-datepicker.i18n.d.ts +0 -10
  960. package/dist/types/components/bal-datepicker/bal-datepicker.interfaces.d.ts +0 -22
  961. package/dist/types/components/bal-datepicker/bal-datepicker.type.d.ts +0 -14
  962. /package/dist/baloise-design-system/{p-3486c48d.system.js → p-923b2e35.system.js} +0 -0
  963. /package/dist/baloise-design-system/{p-8088b32a.js → p-fc542e26.js} +0 -0
  964. /package/dist/esm-es5/{tokens.esm-cada8a2a.js → tokens.esm-ed9fb455.js} +0 -0
@@ -1,2490 +0,0 @@
1
- const NAMESPACE = 'baloise-design-system';
2
- const BUILD = /* baloise-design-system */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: true, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
3
-
4
- /**
5
- * Virtual DOM patching algorithm based on Snabbdom by
6
- * Simon Friis Vindum (@paldepind)
7
- * Licensed under the MIT License
8
- * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
9
- *
10
- * Modified for Stencil's renderer and slot projection
11
- */
12
- let scopeId;
13
- let contentRef;
14
- let hostTagName;
15
- let useNativeShadowDom = false;
16
- let checkSlotFallbackVisibility = false;
17
- let checkSlotRelocate = false;
18
- let isSvgMode = false;
19
- let queuePending = false;
20
- const createTime = (fnName, tagName = '') => {
21
- {
22
- return () => {
23
- return;
24
- };
25
- }
26
- };
27
- const uniqueTime = (key, measureText) => {
28
- {
29
- return () => {
30
- return;
31
- };
32
- }
33
- };
34
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
35
- /**
36
- * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
37
- *
38
- * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
39
- * support as of Stencil v4.
40
- */
41
- const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
42
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
43
- /**
44
- * Default style mode id
45
- */
46
- /**
47
- * Reusable empty obj/array
48
- * Don't add values to these!!
49
- */
50
- const EMPTY_OBJ = {};
51
- /**
52
- * Namespaces
53
- */
54
- const SVG_NS = 'http://www.w3.org/2000/svg';
55
- const HTML_NS = 'http://www.w3.org/1999/xhtml';
56
- const isDef = (v) => v != null;
57
- /**
58
- * Check whether a value is a 'complex type', defined here as an object or a
59
- * function.
60
- *
61
- * @param o the value to check
62
- * @returns whether it's a complex type or not
63
- */
64
- const isComplexType = (o) => {
65
- // https://jsperf.com/typeof-fn-object/5
66
- o = typeof o;
67
- return o === 'object' || o === 'function';
68
- };
69
- /**
70
- * Helper method for querying a `meta` tag that contains a nonce value
71
- * out of a DOM's head.
72
- *
73
- * @param doc The DOM containing the `head` to query against
74
- * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
75
- * exists or the tag has no content.
76
- */
77
- function queryNonceMetaTagContent(doc) {
78
- var _a, _b, _c;
79
- 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;
80
- }
81
- /**
82
- * Production h() function based on Preact by
83
- * Jason Miller (@developit)
84
- * Licensed under the MIT License
85
- * https://github.com/developit/preact/blob/master/LICENSE
86
- *
87
- * Modified for Stencil's compiler and vdom
88
- */
89
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
90
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
91
- const h = (nodeName, vnodeData, ...children) => {
92
- let child = null;
93
- let key = null;
94
- let slotName = null;
95
- let simple = false;
96
- let lastSimple = false;
97
- const vNodeChildren = [];
98
- const walk = (c) => {
99
- for (let i = 0; i < c.length; i++) {
100
- child = c[i];
101
- if (Array.isArray(child)) {
102
- walk(child);
103
- }
104
- else if (child != null && typeof child !== 'boolean') {
105
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
106
- child = String(child);
107
- }
108
- if (simple && lastSimple) {
109
- // If the previous child was simple (string), we merge both
110
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
111
- }
112
- else {
113
- // Append a new vNode, if it's text, we create a text vNode
114
- vNodeChildren.push(simple ? newVNode(null, child) : child);
115
- }
116
- lastSimple = simple;
117
- }
118
- }
119
- };
120
- walk(children);
121
- if (vnodeData) {
122
- if (vnodeData.key) {
123
- key = vnodeData.key;
124
- }
125
- if (vnodeData.name) {
126
- slotName = vnodeData.name;
127
- }
128
- // normalize class / className attributes
129
- {
130
- const classData = vnodeData.className || vnodeData.class;
131
- if (classData) {
132
- vnodeData.class =
133
- typeof classData !== 'object'
134
- ? classData
135
- : Object.keys(classData)
136
- .filter((k) => classData[k])
137
- .join(' ');
138
- }
139
- }
140
- }
141
- if (typeof nodeName === 'function') {
142
- // nodeName is a functional component
143
- return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
144
- }
145
- const vnode = newVNode(nodeName, null);
146
- vnode.$attrs$ = vnodeData;
147
- if (vNodeChildren.length > 0) {
148
- vnode.$children$ = vNodeChildren;
149
- }
150
- {
151
- vnode.$key$ = key;
152
- }
153
- {
154
- vnode.$name$ = slotName;
155
- }
156
- return vnode;
157
- };
158
- /**
159
- * A utility function for creating a virtual DOM node from a tag and some
160
- * possible text content.
161
- *
162
- * @param tag the tag for this element
163
- * @param text possible text content for the node
164
- * @returns a newly-minted virtual DOM node
165
- */
166
- const newVNode = (tag, text) => {
167
- const vnode = {
168
- $flags$: 0,
169
- $tag$: tag,
170
- $text$: text,
171
- $elm$: null,
172
- $children$: null,
173
- };
174
- {
175
- vnode.$attrs$ = null;
176
- }
177
- {
178
- vnode.$key$ = null;
179
- }
180
- {
181
- vnode.$name$ = null;
182
- }
183
- return vnode;
184
- };
185
- const Host = {};
186
- /**
187
- * Check whether a given node is a Host node or not
188
- *
189
- * @param node the virtual DOM node to check
190
- * @returns whether it's a Host node or not
191
- */
192
- const isHost = (node) => node && node.$tag$ === Host;
193
- /**
194
- * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
195
- *
196
- * Note that these functions convert from {@link d.VNode} to
197
- * {@link d.ChildNode} to give functional component developers a friendly
198
- * interface.
199
- */
200
- const vdomFnUtils = {
201
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
202
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
203
- };
204
- /**
205
- * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
206
- * friendlier public interface (hence, 'convertToPublic').
207
- *
208
- * @param node the virtual DOM node to convert
209
- * @returns a converted child node
210
- */
211
- const convertToPublic = (node) => ({
212
- vattrs: node.$attrs$,
213
- vchildren: node.$children$,
214
- vkey: node.$key$,
215
- vname: node.$name$,
216
- vtag: node.$tag$,
217
- vtext: node.$text$,
218
- });
219
- /**
220
- * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
221
- * order to use the resulting object in the virtual DOM. The initial object was
222
- * likely created as part of presenting a public API, so converting it back
223
- * involved making it 'private' again (hence, `convertToPrivate`).
224
- *
225
- * @param node the child node to convert
226
- * @returns a converted virtual DOM node
227
- */
228
- const convertToPrivate = (node) => {
229
- if (typeof node.vtag === 'function') {
230
- const vnodeData = Object.assign({}, node.vattrs);
231
- if (node.vkey) {
232
- vnodeData.key = node.vkey;
233
- }
234
- if (node.vname) {
235
- vnodeData.name = node.vname;
236
- }
237
- return h(node.vtag, vnodeData, ...(node.vchildren || []));
238
- }
239
- const vnode = newVNode(node.vtag, node.vtext);
240
- vnode.$attrs$ = node.vattrs;
241
- vnode.$children$ = node.vchildren;
242
- vnode.$key$ = node.vkey;
243
- vnode.$name$ = node.vname;
244
- return vnode;
245
- };
246
- /**
247
- * Parse a new property value for a given property type.
248
- *
249
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
250
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
251
- * 1. `any`, the type given to `propValue` in the function signature
252
- * 2. the type stored from `propType`.
253
- *
254
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
255
- *
256
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
257
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
258
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
259
- * ```tsx
260
- * <my-cmp prop-val={0}></my-cmp>
261
- * ```
262
- *
263
- * HTML prop values on the other hand, will always a string
264
- *
265
- * @param propValue the new value to coerce to some type
266
- * @param propType the type of the prop, expressed as a binary number
267
- * @returns the parsed/coerced value
268
- */
269
- const parsePropertyValue = (propValue, propType) => {
270
- // ensure this value is of the correct prop type
271
- if (propValue != null && !isComplexType(propValue)) {
272
- if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
273
- // per the HTML spec, any string value means it is a boolean true value
274
- // but we'll cheat here and say that the string "false" is the boolean false
275
- return propValue === 'false' ? false : propValue === '' || !!propValue;
276
- }
277
- if (propType & 2 /* MEMBER_FLAGS.Number */) {
278
- // force it to be a number
279
- return parseFloat(propValue);
280
- }
281
- if (propType & 1 /* MEMBER_FLAGS.String */) {
282
- // could have been passed as a number or boolean
283
- // but we still want it as a string
284
- return String(propValue);
285
- }
286
- // redundant return here for better minification
287
- return propValue;
288
- }
289
- // not sure exactly what type we want
290
- // so no need to change to a different type
291
- return propValue;
292
- };
293
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
294
- const createEvent = (ref, name, flags) => {
295
- const elm = getElement(ref);
296
- return {
297
- emit: (detail) => {
298
- return emitEvent(elm, name, {
299
- bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
300
- composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
301
- cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
302
- detail,
303
- });
304
- },
305
- };
306
- };
307
- /**
308
- * Helper function to create & dispatch a custom Event on a provided target
309
- * @param elm the target of the Event
310
- * @param name the name to give the custom Event
311
- * @param opts options for configuring a custom Event
312
- * @returns the custom Event
313
- */
314
- const emitEvent = (elm, name, opts) => {
315
- const ev = plt.ce(name, opts);
316
- elm.dispatchEvent(ev);
317
- return ev;
318
- };
319
- const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
320
- const registerStyle = (scopeId, cssText, allowCS) => {
321
- let style = styles.get(scopeId);
322
- if (supportsConstructableStylesheets && allowCS) {
323
- style = (style || new CSSStyleSheet());
324
- if (typeof style === 'string') {
325
- style = cssText;
326
- }
327
- else {
328
- style.replaceSync(cssText);
329
- }
330
- }
331
- else {
332
- style = cssText;
333
- }
334
- styles.set(scopeId, style);
335
- };
336
- const addStyle = (styleContainerNode, cmpMeta, mode) => {
337
- var _a;
338
- const scopeId = getScopeId(cmpMeta);
339
- const style = styles.get(scopeId);
340
- // if an element is NOT connected then getRootNode() will return the wrong root node
341
- // so the fallback is to always use the document for the root node in those cases
342
- styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
343
- if (style) {
344
- if (typeof style === 'string') {
345
- styleContainerNode = styleContainerNode.head || styleContainerNode;
346
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
347
- let styleElm;
348
- if (!appliedStyles) {
349
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
350
- }
351
- if (!appliedStyles.has(scopeId)) {
352
- {
353
- styleElm = doc.createElement('style');
354
- styleElm.innerHTML = style;
355
- // Apply CSP nonce to the style tag if it exists
356
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
357
- if (nonce != null) {
358
- styleElm.setAttribute('nonce', nonce);
359
- }
360
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
361
- }
362
- // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
363
- if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
364
- styleElm.innerHTML += SLOT_FB_CSS;
365
- }
366
- if (appliedStyles) {
367
- appliedStyles.add(scopeId);
368
- }
369
- }
370
- }
371
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
372
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
373
- }
374
- }
375
- return scopeId;
376
- };
377
- const attachStyles = (hostRef) => {
378
- const cmpMeta = hostRef.$cmpMeta$;
379
- const elm = hostRef.$hostElement$;
380
- const flags = cmpMeta.$flags$;
381
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
382
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
383
- if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
384
- // only required when we're NOT using native shadow dom (slot)
385
- // or this browser doesn't support native shadow dom
386
- // and this host element was NOT created with SSR
387
- // let's pick out the inner content for slot projection
388
- // create a node to represent where the original
389
- // content was first placed, which is useful later on
390
- // DOM WRITE!!
391
- elm['s-sc'] = scopeId;
392
- elm.classList.add(scopeId + '-h');
393
- if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
394
- elm.classList.add(scopeId + '-s');
395
- }
396
- }
397
- endAttachStyles();
398
- };
399
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
400
- /**
401
- * Production setAccessor() function based on Preact by
402
- * Jason Miller (@developit)
403
- * Licensed under the MIT License
404
- * https://github.com/developit/preact/blob/master/LICENSE
405
- *
406
- * Modified for Stencil's compiler and vdom
407
- */
408
- /**
409
- * When running a VDom render set properties present on a VDom node onto the
410
- * corresponding HTML element.
411
- *
412
- * Note that this function has special functionality for the `class`,
413
- * `style`, `key`, and `ref` attributes, as well as event handlers (like
414
- * `onClick`, etc). All others are just passed through as-is.
415
- *
416
- * @param elm the HTMLElement onto which attributes should be set
417
- * @param memberName the name of the attribute to set
418
- * @param oldValue the old value for the attribute
419
- * @param newValue the new value for the attribute
420
- * @param isSvg whether we're in an svg context or not
421
- * @param flags bitflags for Vdom variables
422
- */
423
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
424
- if (oldValue !== newValue) {
425
- let isProp = isMemberInElement(elm, memberName);
426
- let ln = memberName.toLowerCase();
427
- if (memberName === 'class') {
428
- const classList = elm.classList;
429
- const oldClasses = parseClassList(oldValue);
430
- const newClasses = parseClassList(newValue);
431
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
432
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
433
- }
434
- else if (memberName === 'style') {
435
- // update style attribute, css properties and values
436
- {
437
- for (const prop in oldValue) {
438
- if (!newValue || newValue[prop] == null) {
439
- if (prop.includes('-')) {
440
- elm.style.removeProperty(prop);
441
- }
442
- else {
443
- elm.style[prop] = '';
444
- }
445
- }
446
- }
447
- }
448
- for (const prop in newValue) {
449
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
450
- if (prop.includes('-')) {
451
- elm.style.setProperty(prop, newValue[prop]);
452
- }
453
- else {
454
- elm.style[prop] = newValue[prop];
455
- }
456
- }
457
- }
458
- }
459
- else if (memberName === 'key')
460
- ;
461
- else if (memberName === 'ref') {
462
- // minifier will clean this up
463
- if (newValue) {
464
- newValue(elm);
465
- }
466
- }
467
- else if ((!isProp ) &&
468
- memberName[0] === 'o' &&
469
- memberName[1] === 'n') {
470
- // Event Handlers
471
- // so if the member name starts with "on" and the 3rd characters is
472
- // a capital letter, and it's not already a member on the element,
473
- // then we're assuming it's an event listener
474
- if (memberName[2] === '-') {
475
- // on- prefixed events
476
- // allows to be explicit about the dom event to listen without any magic
477
- // under the hood:
478
- // <my-cmp on-click> // listens for "click"
479
- // <my-cmp on-Click> // listens for "Click"
480
- // <my-cmp on-ionChange> // listens for "ionChange"
481
- // <my-cmp on-EVENTS> // listens for "EVENTS"
482
- memberName = memberName.slice(3);
483
- }
484
- else if (isMemberInElement(win, ln)) {
485
- // standard event
486
- // the JSX attribute could have been "onMouseOver" and the
487
- // member name "onmouseover" is on the window's prototype
488
- // so let's add the listener "mouseover", which is all lowercased
489
- memberName = ln.slice(2);
490
- }
491
- else {
492
- // custom event
493
- // the JSX attribute could have been "onMyCustomEvent"
494
- // so let's trim off the "on" prefix and lowercase the first character
495
- // and add the listener "myCustomEvent"
496
- // except for the first character, we keep the event name case
497
- memberName = ln[2] + memberName.slice(3);
498
- }
499
- if (oldValue || newValue) {
500
- // Need to account for "capture" events.
501
- // If the event name ends with "Capture", we'll update the name to remove
502
- // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
503
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
504
- // Make sure we only replace the last instance of "Capture"
505
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
506
- if (oldValue) {
507
- plt.rel(elm, memberName, oldValue, capture);
508
- }
509
- if (newValue) {
510
- plt.ael(elm, memberName, newValue, capture);
511
- }
512
- }
513
- }
514
- else {
515
- // Set property if it exists and it's not a SVG
516
- const isComplex = isComplexType(newValue);
517
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
518
- try {
519
- if (!elm.tagName.includes('-')) {
520
- const n = newValue == null ? '' : newValue;
521
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
522
- if (memberName === 'list') {
523
- isProp = false;
524
- }
525
- else if (oldValue == null || elm[memberName] != n) {
526
- elm[memberName] = n;
527
- }
528
- }
529
- else {
530
- elm[memberName] = newValue;
531
- }
532
- }
533
- catch (e) {
534
- /**
535
- * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
536
- */
537
- }
538
- }
539
- /**
540
- * Need to manually update attribute if:
541
- * - memberName is not an attribute
542
- * - if we are rendering the host element in order to reflect attribute
543
- * - if it's a SVG, since properties might not work in <svg>
544
- * - if the newValue is null/undefined or 'false'.
545
- */
546
- let xlink = false;
547
- {
548
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
549
- memberName = ln;
550
- xlink = true;
551
- }
552
- }
553
- if (newValue == null || newValue === false) {
554
- if (newValue !== false || elm.getAttribute(memberName) === '') {
555
- if (xlink) {
556
- elm.removeAttributeNS(XLINK_NS, memberName);
557
- }
558
- else {
559
- elm.removeAttribute(memberName);
560
- }
561
- }
562
- }
563
- else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
564
- newValue = newValue === true ? '' : newValue;
565
- if (xlink) {
566
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
567
- }
568
- else {
569
- elm.setAttribute(memberName, newValue);
570
- }
571
- }
572
- }
573
- }
574
- };
575
- const parseClassListRegex = /\s/;
576
- /**
577
- * Parsed a string of classnames into an array
578
- * @param value className string, e.g. "foo bar baz"
579
- * @returns list of classes, e.g. ["foo", "bar", "baz"]
580
- */
581
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
582
- const CAPTURE_EVENT_SUFFIX = 'Capture';
583
- const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
584
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
585
- // if the element passed in is a shadow root, which is a document fragment
586
- // then we want to be adding attrs/props to the shadow root's "host" element
587
- // if it's not a shadow root, then we add attrs/props to the same element
588
- const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
589
- ? newVnode.$elm$.host
590
- : newVnode.$elm$;
591
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
592
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
593
- {
594
- // remove attributes no longer present on the vnode by setting them to undefined
595
- for (memberName in oldVnodeAttrs) {
596
- if (!(memberName in newVnodeAttrs)) {
597
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
598
- }
599
- }
600
- }
601
- // add new & update changed attributes
602
- for (memberName in newVnodeAttrs) {
603
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
604
- }
605
- };
606
- /**
607
- * Create a DOM Node corresponding to one of the children of a given VNode.
608
- *
609
- * @param oldParentVNode the parent VNode from the previous render
610
- * @param newParentVNode the parent VNode from the current render
611
- * @param childIndex the index of the VNode, in the _new_ parent node's
612
- * children, for which we will create a new DOM node
613
- * @param parentElm the parent DOM node which our new node will be a child of
614
- * @returns the newly created node
615
- */
616
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
617
- // tslint:disable-next-line: prefer-const
618
- const newVNode = newParentVNode.$children$[childIndex];
619
- let i = 0;
620
- let elm;
621
- let childNode;
622
- let oldVNode;
623
- if (!useNativeShadowDom) {
624
- // remember for later we need to check to relocate nodes
625
- checkSlotRelocate = true;
626
- if (newVNode.$tag$ === 'slot') {
627
- if (scopeId) {
628
- // scoped css needs to add its scoped id to the parent element
629
- parentElm.classList.add(scopeId + '-s');
630
- }
631
- newVNode.$flags$ |= newVNode.$children$
632
- ? // slot element has fallback content
633
- 2 /* VNODE_FLAGS.isSlotFallback */
634
- : // slot element does not have fallback content
635
- 1 /* VNODE_FLAGS.isSlotReference */;
636
- }
637
- }
638
- if (newVNode.$text$ !== null) {
639
- // create text node
640
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
641
- }
642
- else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
643
- // create a slot reference node
644
- elm = newVNode.$elm$ =
645
- doc.createTextNode('');
646
- }
647
- else {
648
- if (!isSvgMode) {
649
- isSvgMode = newVNode.$tag$ === 'svg';
650
- }
651
- // create element
652
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
653
- ? 'slot-fb'
654
- : newVNode.$tag$)
655
- );
656
- if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
657
- isSvgMode = false;
658
- }
659
- // add css classes, attrs, props, listeners, etc.
660
- {
661
- updateElement(null, newVNode, isSvgMode);
662
- }
663
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
664
- // if there is a scopeId and this is the initial render
665
- // then let's add the scopeId as a css class
666
- elm.classList.add((elm['s-si'] = scopeId));
667
- }
668
- if (newVNode.$children$) {
669
- for (i = 0; i < newVNode.$children$.length; ++i) {
670
- // create the node
671
- childNode = createElm(oldParentVNode, newVNode, i, elm);
672
- // return node could have been null
673
- if (childNode) {
674
- // append our new node
675
- elm.appendChild(childNode);
676
- }
677
- }
678
- }
679
- {
680
- if (newVNode.$tag$ === 'svg') {
681
- // Only reset the SVG context when we're exiting <svg> element
682
- isSvgMode = false;
683
- }
684
- else if (elm.tagName === 'foreignObject') {
685
- // Reenter SVG context when we're exiting <foreignObject> element
686
- isSvgMode = true;
687
- }
688
- }
689
- }
690
- // This needs to always happen so we can hide nodes that are projected
691
- // to another component but don't end up in a slot
692
- elm['s-hn'] = hostTagName;
693
- {
694
- if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
695
- // remember the content reference comment
696
- elm['s-sr'] = true;
697
- // remember the content reference comment
698
- elm['s-cr'] = contentRef;
699
- // remember the slot name, or empty string for default slot
700
- elm['s-sn'] = newVNode.$name$ || '';
701
- // check if we've got an old vnode for this slot
702
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
703
- if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
704
- {
705
- // we've got an old slot vnode and the wrapper is being replaced
706
- // so let's move the old slot content back to its original location
707
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
708
- }
709
- }
710
- }
711
- }
712
- return elm;
713
- };
714
- const putBackInOriginalLocation = (parentElm, recursive) => {
715
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
716
- const oldSlotChildNodes = parentElm.childNodes;
717
- for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
718
- const childNode = oldSlotChildNodes[i];
719
- if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
720
- // and relocate it back to it's original location
721
- parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
722
- // remove the old original location comment entirely
723
- // later on the patch function will know what to do
724
- // and move this to the correct spot if need be
725
- childNode['s-ol'].remove();
726
- childNode['s-ol'] = undefined;
727
- // Reset so we can correctly move the node around again.
728
- childNode['s-sh'] = undefined;
729
- checkSlotRelocate = true;
730
- }
731
- if (recursive) {
732
- putBackInOriginalLocation(childNode, recursive);
733
- }
734
- }
735
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
736
- };
737
- /**
738
- * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
739
- * add them to the DOM in the appropriate place.
740
- *
741
- * @param parentElm the DOM node which should be used as a parent for the new
742
- * DOM nodes
743
- * @param before a child of the `parentElm` which the new children should be
744
- * inserted before (optional)
745
- * @param parentVNode the parent virtual DOM node
746
- * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
747
- * @param startIdx the index in the child virtual DOM nodes at which to start
748
- * creating DOM nodes (inclusive)
749
- * @param endIdx the index in the child virtual DOM nodes at which to stop
750
- * creating DOM nodes (inclusive)
751
- */
752
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
753
- let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
754
- let childNode;
755
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
756
- containerElm = containerElm.shadowRoot;
757
- }
758
- for (; startIdx <= endIdx; ++startIdx) {
759
- if (vnodes[startIdx]) {
760
- childNode = createElm(null, parentVNode, startIdx, parentElm);
761
- if (childNode) {
762
- vnodes[startIdx].$elm$ = childNode;
763
- containerElm.insertBefore(childNode, referenceNode(before) );
764
- }
765
- }
766
- }
767
- };
768
- /**
769
- * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
770
- * This can be used to, for instance, clean up after a list of children which
771
- * should no longer be shown.
772
- *
773
- * This function also handles some of Stencil's slot relocation logic.
774
- *
775
- * @param vnodes a list of virtual DOM nodes to remove
776
- * @param startIdx the index at which to start removing nodes (inclusive)
777
- * @param endIdx the index at which to stop removing nodes (inclusive)
778
- */
779
- const removeVnodes = (vnodes, startIdx, endIdx) => {
780
- for (let index = startIdx; index <= endIdx; ++index) {
781
- const vnode = vnodes[index];
782
- if (vnode) {
783
- const elm = vnode.$elm$;
784
- nullifyVNodeRefs(vnode);
785
- if (elm) {
786
- {
787
- // we're removing this element
788
- // so it's possible we need to show slot fallback content now
789
- checkSlotFallbackVisibility = true;
790
- if (elm['s-ol']) {
791
- // remove the original location comment
792
- elm['s-ol'].remove();
793
- }
794
- else {
795
- // it's possible that child nodes of the node
796
- // that's being removed are slot nodes
797
- putBackInOriginalLocation(elm, true);
798
- }
799
- }
800
- // remove the vnode's element from the dom
801
- elm.remove();
802
- }
803
- }
804
- }
805
- };
806
- /**
807
- * Reconcile the children of a new VNode with the children of an old VNode by
808
- * traversing the two collections of children, identifying nodes that are
809
- * conserved or changed, calling out to `patch` to make any necessary
810
- * updates to the DOM, and rearranging DOM nodes as needed.
811
- *
812
- * The algorithm for reconciling children works by analyzing two 'windows' onto
813
- * the two arrays of children (`oldCh` and `newCh`). We keep track of the
814
- * 'windows' by storing start and end indices and references to the
815
- * corresponding array entries. Initially the two 'windows' are basically equal
816
- * to the entire array, but we progressively narrow the windows until there are
817
- * no children left to update by doing the following:
818
- *
819
- * 1. Skip any `null` entries at the beginning or end of the two arrays, so
820
- * that if we have an initial array like the following we'll end up dealing
821
- * only with a window bounded by the highlighted elements:
822
- *
823
- * [null, null, VNode1 , ... , VNode2, null, null]
824
- * ^^^^^^ ^^^^^^
825
- *
826
- * 2. Check to see if the elements at the head and tail positions are equal
827
- * across the windows. This will basically detect elements which haven't
828
- * been added, removed, or changed position, i.e. if you had the following
829
- * VNode elements (represented as HTML):
830
- *
831
- * oldVNode: `<div><p><span>HEY</span></p></div>`
832
- * newVNode: `<div><p><span>THERE</span></p></div>`
833
- *
834
- * Then when comparing the children of the `<div>` tag we check the equality
835
- * of the VNodes corresponding to the `<p>` tags and, since they are the
836
- * same tag in the same position, we'd be able to avoid completely
837
- * re-rendering the subtree under them with a new DOM element and would just
838
- * call out to `patch` to handle reconciling their children and so on.
839
- *
840
- * 3. Check, for both windows, to see if the element at the beginning of the
841
- * window corresponds to the element at the end of the other window. This is
842
- * a heuristic which will let us identify _some_ situations in which
843
- * elements have changed position, for instance it _should_ detect that the
844
- * children nodes themselves have not changed but merely moved in the
845
- * following example:
846
- *
847
- * oldVNode: `<div><element-one /><element-two /></div>`
848
- * newVNode: `<div><element-two /><element-one /></div>`
849
- *
850
- * If we find cases like this then we also need to move the concrete DOM
851
- * elements corresponding to the moved children to write the re-order to the
852
- * DOM.
853
- *
854
- * 4. Finally, if VNodes have the `key` attribute set on them we check for any
855
- * nodes in the old children which have the same key as the first element in
856
- * our window on the new children. If we find such a node we handle calling
857
- * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
858
- * what we find.
859
- *
860
- * Finally, once we've narrowed our 'windows' to the point that either of them
861
- * collapse (i.e. they have length 0) we then handle any remaining VNode
862
- * insertion or deletion that needs to happen to get a DOM state that correctly
863
- * reflects the new child VNodes. If, for instance, after our window on the old
864
- * children has collapsed we still have more nodes on the new children that
865
- * we haven't dealt with yet then we need to add them, or if the new children
866
- * collapse but we still have unhandled _old_ children then we need to make
867
- * sure the corresponding DOM nodes are removed.
868
- *
869
- * @param parentElm the node into which the parent VNode is rendered
870
- * @param oldCh the old children of the parent node
871
- * @param newVNode the new VNode which will replace the parent
872
- * @param newCh the new children of the parent node
873
- * @param isInitialRender whether or not this is the first render of the vdom
874
- */
875
- const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
876
- let oldStartIdx = 0;
877
- let newStartIdx = 0;
878
- let idxInOld = 0;
879
- let i = 0;
880
- let oldEndIdx = oldCh.length - 1;
881
- let oldStartVnode = oldCh[0];
882
- let oldEndVnode = oldCh[oldEndIdx];
883
- let newEndIdx = newCh.length - 1;
884
- let newStartVnode = newCh[0];
885
- let newEndVnode = newCh[newEndIdx];
886
- let node;
887
- let elmToMove;
888
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
889
- if (oldStartVnode == null) {
890
- // VNode might have been moved left
891
- oldStartVnode = oldCh[++oldStartIdx];
892
- }
893
- else if (oldEndVnode == null) {
894
- oldEndVnode = oldCh[--oldEndIdx];
895
- }
896
- else if (newStartVnode == null) {
897
- newStartVnode = newCh[++newStartIdx];
898
- }
899
- else if (newEndVnode == null) {
900
- newEndVnode = newCh[--newEndIdx];
901
- }
902
- else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
903
- // if the start nodes are the same then we should patch the new VNode
904
- // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
905
- // indices to reflect that. We don't need to move any DOM Nodes around
906
- // since things are matched up in order.
907
- patch(oldStartVnode, newStartVnode, isInitialRender);
908
- oldStartVnode = oldCh[++oldStartIdx];
909
- newStartVnode = newCh[++newStartIdx];
910
- }
911
- else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
912
- // likewise, if the end nodes are the same we patch new onto old and
913
- // decrement our end indices, and also likewise in this case we don't
914
- // need to move any DOM Nodes.
915
- patch(oldEndVnode, newEndVnode, isInitialRender);
916
- oldEndVnode = oldCh[--oldEndIdx];
917
- newEndVnode = newCh[--newEndIdx];
918
- }
919
- else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
920
- // case: "Vnode moved right"
921
- //
922
- // We've found that the last node in our window on the new children is
923
- // the same VNode as the _first_ node in our window on the old children
924
- // we're dealing with now. Visually, this is the layout of these two
925
- // nodes:
926
- //
927
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
928
- // ^^^^^^^^^^^
929
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
930
- // ^^^^^^^^^^^^^
931
- //
932
- // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
933
- // and move the DOM element for `oldStartVnode`.
934
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
935
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
936
- }
937
- patch(oldStartVnode, newEndVnode, isInitialRender);
938
- // We need to move the element for `oldStartVnode` into a position which
939
- // will be appropriate for `newEndVnode`. For this we can use
940
- // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
941
- // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
942
- // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
943
- //
944
- // <old-start-node />
945
- // <some-intervening-node />
946
- // <old-end-node />
947
- // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
948
- // <next-sibling />
949
- //
950
- // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
951
- // the node for `oldStartVnode` at the end of the children of
952
- // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
953
- // aren't any siblings, and passing `null` to `Node.insertBefore` will
954
- // append it to the children of the parent element.
955
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
956
- oldStartVnode = oldCh[++oldStartIdx];
957
- newEndVnode = newCh[--newEndIdx];
958
- }
959
- else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
960
- // case: "Vnode moved left"
961
- //
962
- // We've found that the first node in our window on the new children is
963
- // the same VNode as the _last_ node in our window on the old children.
964
- // Visually, this is the layout of these two nodes:
965
- //
966
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
967
- // ^^^^^^^^^^^^^
968
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
969
- // ^^^^^^^^^^^
970
- //
971
- // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
972
- // (which will handle updating any changed attributes, reconciling their
973
- // children etc) but we also need to move the DOM node to which
974
- // `oldEndVnode` corresponds.
975
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
976
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
977
- }
978
- patch(oldEndVnode, newStartVnode, isInitialRender);
979
- // We've already checked above if `oldStartVnode` and `newStartVnode` are
980
- // the same node, so since we're here we know that they are not. Thus we
981
- // can move the element for `oldEndVnode` _before_ the element for
982
- // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
983
- // future.
984
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
985
- oldEndVnode = oldCh[--oldEndIdx];
986
- newStartVnode = newCh[++newStartIdx];
987
- }
988
- else {
989
- // Here we do some checks to match up old and new nodes based on the
990
- // `$key$` attribute, which is set by putting a `key="my-key"` attribute
991
- // in the JSX for a DOM element in the implementation of a Stencil
992
- // component.
993
- //
994
- // First we check to see if there are any nodes in the array of old
995
- // children which have the same key as the first node in the new
996
- // children.
997
- idxInOld = -1;
998
- {
999
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
1000
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
1001
- idxInOld = i;
1002
- break;
1003
- }
1004
- }
1005
- }
1006
- if (idxInOld >= 0) {
1007
- // We found a node in the old children which matches up with the first
1008
- // node in the new children! So let's deal with that
1009
- elmToMove = oldCh[idxInOld];
1010
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1011
- // the tag doesn't match so we'll need a new DOM element
1012
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
1013
- }
1014
- else {
1015
- patch(elmToMove, newStartVnode, isInitialRender);
1016
- // invalidate the matching old node so that we won't try to update it
1017
- // again later on
1018
- oldCh[idxInOld] = undefined;
1019
- node = elmToMove.$elm$;
1020
- }
1021
- newStartVnode = newCh[++newStartIdx];
1022
- }
1023
- else {
1024
- // We either didn't find an element in the old children that matches
1025
- // the key of the first new child OR the build is not using `key`
1026
- // attributes at all. In either case we need to create a new element
1027
- // for the new node.
1028
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
1029
- newStartVnode = newCh[++newStartIdx];
1030
- }
1031
- if (node) {
1032
- // if we created a new node then handle inserting it to the DOM
1033
- {
1034
- parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
1035
- }
1036
- }
1037
- }
1038
- }
1039
- if (oldStartIdx > oldEndIdx) {
1040
- // we have some more new nodes to add which don't match up with old nodes
1041
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1042
- }
1043
- else if (newStartIdx > newEndIdx) {
1044
- // there are nodes in the `oldCh` array which no longer correspond to nodes
1045
- // in the new array, so lets remove them (which entails cleaning up the
1046
- // relevant DOM nodes)
1047
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1048
- }
1049
- };
1050
- /**
1051
- * Compare two VNodes to determine if they are the same
1052
- *
1053
- * **NB**: This function is an equality _heuristic_ based on the available
1054
- * information set on the two VNodes and can be misleading under certain
1055
- * circumstances. In particular, if the two nodes do not have `key` attrs
1056
- * (available under `$key$` on VNodes) then the function falls back on merely
1057
- * checking that they have the same tag.
1058
- *
1059
- * So, in other words, if `key` attrs are not set on VNodes which may be
1060
- * changing order within a `children` array or something along those lines then
1061
- * we could obtain a false negative and then have to do needless re-rendering
1062
- * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1063
- *
1064
- * @param leftVNode the first VNode to check
1065
- * @param rightVNode the second VNode to check
1066
- * @param isInitialRender whether or not this is the first render of the vdom
1067
- * @returns whether they're equal or not
1068
- */
1069
- const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1070
- // compare if two vnode to see if they're "technically" the same
1071
- // need to have the same element tag, and same key to be the same
1072
- if (leftVNode.$tag$ === rightVNode.$tag$) {
1073
- if (leftVNode.$tag$ === 'slot') {
1074
- return leftVNode.$name$ === rightVNode.$name$;
1075
- }
1076
- // this will be set if JSX tags in the build have `key` attrs set on them
1077
- // we only want to check this if we're not on the first render since on
1078
- // first render `leftVNode.$key$` will always be `null`, so we can be led
1079
- // astray and, for instance, accidentally delete a DOM node that we want to
1080
- // keep around.
1081
- if (!isInitialRender) {
1082
- return leftVNode.$key$ === rightVNode.$key$;
1083
- }
1084
- return true;
1085
- }
1086
- return false;
1087
- };
1088
- const referenceNode = (node) => {
1089
- // this node was relocated to a new location in the dom
1090
- // because of some other component's slot
1091
- // but we still have an html comment in place of where
1092
- // it's original location was according to it's original vdom
1093
- return (node && node['s-ol']) || node;
1094
- };
1095
- const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1096
- /**
1097
- * Handle reconciling an outdated VNode with a new one which corresponds to
1098
- * it. This function handles flushing updates to the DOM and reconciling the
1099
- * children of the two nodes (if any).
1100
- *
1101
- * @param oldVNode an old VNode whose DOM element and children we want to update
1102
- * @param newVNode a new VNode representing an updated version of the old one
1103
- * @param isInitialRender whether or not this is the first render of the vdom
1104
- */
1105
- const patch = (oldVNode, newVNode, isInitialRender = false) => {
1106
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
1107
- const oldChildren = oldVNode.$children$;
1108
- const newChildren = newVNode.$children$;
1109
- const tag = newVNode.$tag$;
1110
- const text = newVNode.$text$;
1111
- let defaultHolder;
1112
- if (text === null) {
1113
- {
1114
- // test if we're rendering an svg element, or still rendering nodes inside of one
1115
- // only add this to the when the compiler sees we're using an svg somewhere
1116
- isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1117
- }
1118
- {
1119
- if (tag === 'slot')
1120
- ;
1121
- else {
1122
- // either this is the first render of an element OR it's an update
1123
- // AND we already know it's possible it could have changed
1124
- // this updates the element's css classes, attrs, props, listeners, etc.
1125
- updateElement(oldVNode, newVNode, isSvgMode);
1126
- }
1127
- }
1128
- if (oldChildren !== null && newChildren !== null) {
1129
- // looks like there's child vnodes for both the old and new vnodes
1130
- // so we need to call `updateChildren` to reconcile them
1131
- updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
1132
- }
1133
- else if (newChildren !== null) {
1134
- // no old child vnodes, but there are new child vnodes to add
1135
- if (oldVNode.$text$ !== null) {
1136
- // the old vnode was text, so be sure to clear it out
1137
- elm.textContent = '';
1138
- }
1139
- // add the new vnode children
1140
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1141
- }
1142
- else if (oldChildren !== null) {
1143
- // no new child vnodes, but there are old child vnodes to remove
1144
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
1145
- }
1146
- if (isSvgMode && tag === 'svg') {
1147
- isSvgMode = false;
1148
- }
1149
- }
1150
- else if ((defaultHolder = elm['s-cr'])) {
1151
- // this element has slotted content
1152
- defaultHolder.parentNode.textContent = text;
1153
- }
1154
- else if (oldVNode.$text$ !== text) {
1155
- // update the text content for the text only vnode
1156
- // and also only if the text is different than before
1157
- elm.data = text;
1158
- }
1159
- };
1160
- /**
1161
- * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1162
- * are slot fallbacks nodes.
1163
- *
1164
- * A slot fallback node should be visible by default. Then, it should be
1165
- * conditionally hidden if:
1166
- *
1167
- * - it has a sibling with a `slot` property set to its slot name or if
1168
- * - it is a default fallback slot node, in which case we hide if it has any
1169
- * content
1170
- *
1171
- * @param elm the element of interest
1172
- */
1173
- const updateFallbackSlotVisibility = (elm) => {
1174
- const childNodes = elm.childNodes;
1175
- for (const childNode of childNodes) {
1176
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1177
- if (childNode['s-sr']) {
1178
- // this is a slot fallback node
1179
- // get the slot name for this slot reference node
1180
- const slotName = childNode['s-sn'];
1181
- // by default always show a fallback slot node
1182
- // then hide it if there are other slots in the light dom
1183
- childNode.hidden = false;
1184
- // we need to check all of its sibling nodes in order to see if
1185
- // `childNode` should be hidden
1186
- for (const siblingNode of childNodes) {
1187
- // Don't check the node against itself
1188
- if (siblingNode !== childNode) {
1189
- if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1190
- // this sibling node is from a different component OR is a named
1191
- // fallback slot node
1192
- if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1193
- (slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
1194
- childNode.hidden = true;
1195
- break;
1196
- }
1197
- }
1198
- else {
1199
- // this is a default fallback slot node
1200
- // any element or text node (with content)
1201
- // should hide the default fallback slot node
1202
- if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1203
- (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1204
- childNode.hidden = true;
1205
- break;
1206
- }
1207
- }
1208
- }
1209
- }
1210
- }
1211
- // keep drilling down
1212
- updateFallbackSlotVisibility(childNode);
1213
- }
1214
- }
1215
- };
1216
- /**
1217
- * Component-global information about nodes which are either currently being
1218
- * relocated or will be shortly.
1219
- */
1220
- const relocateNodes = [];
1221
- /**
1222
- * Mark the contents of a slot for relocation via adding references to them to
1223
- * the {@link relocateNodes} data structure. The actual work of relocating them
1224
- * will then be handled in {@link renderVdom}.
1225
- *
1226
- * @param elm a render node whose child nodes need to be relocated
1227
- */
1228
- const markSlotContentForRelocation = (elm) => {
1229
- // tslint:disable-next-line: prefer-const
1230
- let node;
1231
- let hostContentNodes;
1232
- let j;
1233
- for (const childNode of elm.childNodes) {
1234
- // we need to find child nodes which are slot references so we can then try
1235
- // to match them up with nodes that need to be relocated
1236
- if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1237
- // first get the content reference comment node ('s-cr'), then we get
1238
- // its parent, which is where all the host content is now
1239
- hostContentNodes = node.parentNode.childNodes;
1240
- const slotName = childNode['s-sn'];
1241
- // iterate through all the nodes under the location where the host was
1242
- // originally rendered
1243
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
1244
- node = hostContentNodes[j];
1245
- // check that the node is not a content reference node or a node
1246
- // reference and then check that the host name does not match that of
1247
- // childNode.
1248
- // In addition, check that the slot either has not already been relocated, or
1249
- // that its current location's host is not childNode's host. This is essentially
1250
- // a check so that we don't try to relocate (and then hide) a node that is already
1251
- // where it should be.
1252
- if (!node['s-cn'] &&
1253
- !node['s-nr'] &&
1254
- node['s-hn'] !== childNode['s-hn'] &&
1255
- (!BUILD.experimentalSlotFixes )) {
1256
- // if `node` is located in the slot that `childNode` refers to (via the
1257
- // `'s-sn'` property) then we need to relocate it from it's current spot
1258
- // (under the host element parent) to the right slot location
1259
- if (isNodeLocatedInSlot(node, slotName)) {
1260
- // it's possible we've already decided to relocate this node
1261
- let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1262
- // made some changes to slots
1263
- // let's make sure we also double check
1264
- // fallbacks are correctly hidden or shown
1265
- checkSlotFallbackVisibility = true;
1266
- // ensure that the slot-name attr is correct
1267
- node['s-sn'] = node['s-sn'] || slotName;
1268
- if (relocateNodeData) {
1269
- relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
1270
- // we marked this node for relocation previously but didn't find
1271
- // out the slot reference node to which it needs to be relocated
1272
- // so write it down now!
1273
- relocateNodeData.$slotRefNode$ = childNode;
1274
- }
1275
- else {
1276
- node['s-sh'] = childNode['s-hn'];
1277
- // add to our list of nodes to relocate
1278
- relocateNodes.push({
1279
- $slotRefNode$: childNode,
1280
- $nodeToRelocate$: node,
1281
- });
1282
- }
1283
- if (node['s-sr']) {
1284
- relocateNodes.map((relocateNode) => {
1285
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1286
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1287
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
1288
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1289
- }
1290
- }
1291
- });
1292
- }
1293
- }
1294
- else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1295
- // the node is not found within the slot (`childNode`) that we're
1296
- // currently looking at, so we stick it into `relocateNodes` to
1297
- // handle later. If we never find a home for this element then
1298
- // we'll need to hide it
1299
- relocateNodes.push({
1300
- $nodeToRelocate$: node,
1301
- });
1302
- }
1303
- }
1304
- }
1305
- }
1306
- // if we're dealing with any type of element (capable of itself being a
1307
- // slot reference or containing one) then we recur
1308
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1309
- markSlotContentForRelocation(childNode);
1310
- }
1311
- }
1312
- };
1313
- /**
1314
- * Check whether a node is located in a given named slot.
1315
- *
1316
- * @param nodeToRelocate the node of interest
1317
- * @param slotName the slot name to check
1318
- * @returns whether the node is located in the slot or not
1319
- */
1320
- const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1321
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1322
- if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1323
- // if the node doesn't have a slot attribute, and the slot we're checking
1324
- // is not a named slot, then we assume the node should be within the slot
1325
- return true;
1326
- }
1327
- if (nodeToRelocate.getAttribute('slot') === slotName) {
1328
- return true;
1329
- }
1330
- return false;
1331
- }
1332
- if (nodeToRelocate['s-sn'] === slotName) {
1333
- return true;
1334
- }
1335
- return slotName === '';
1336
- };
1337
- /**
1338
- * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1339
- * them with `null`. This signals that the DOM element corresponding to the VDom
1340
- * node has been removed from the DOM.
1341
- *
1342
- * @param vNode a virtual DOM node
1343
- */
1344
- const nullifyVNodeRefs = (vNode) => {
1345
- {
1346
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1347
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1348
- }
1349
- };
1350
- /**
1351
- * The main entry point for Stencil's virtual DOM-based rendering engine
1352
- *
1353
- * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1354
- * function will handle creating a virtual DOM tree with a single root, patching
1355
- * the current virtual DOM tree onto an old one (if any), dealing with slot
1356
- * relocation, and reflecting attributes.
1357
- *
1358
- * @param hostRef data needed to root and render the virtual DOM tree, such as
1359
- * the DOM node into which it should be rendered.
1360
- * @param renderFnResults the virtual DOM nodes to be rendered
1361
- * @param isInitialLoad whether or not this is the first call after page load
1362
- */
1363
- const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1364
- var _a, _b, _c, _d;
1365
- const hostElm = hostRef.$hostElement$;
1366
- const cmpMeta = hostRef.$cmpMeta$;
1367
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1368
- // if `renderFnResults` is a Host node then we can use it directly. If not,
1369
- // we need to call `h` again to wrap the children of our component in a
1370
- // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1371
- // implicitly that the top-level vdom node is 1) an only child and 2)
1372
- // contains attrs that need to be set on the host element.
1373
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1374
- hostTagName = hostElm.tagName;
1375
- if (cmpMeta.$attrsToReflect$) {
1376
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1377
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1378
- }
1379
- // On the first render and *only* on the first render we want to check for
1380
- // any attributes set on the host element which are also set on the vdom
1381
- // node. If we find them, we override the value on the VDom node attrs with
1382
- // the value from the host element, which allows developers building apps
1383
- // with Stencil components to override e.g. the `role` attribute on a
1384
- // component even if it's already set on the `Host`.
1385
- if (isInitialLoad && rootVnode.$attrs$) {
1386
- for (const key of Object.keys(rootVnode.$attrs$)) {
1387
- // We have a special implementation in `setAccessor` for `style` and
1388
- // `class` which reconciles values coming from the VDom with values
1389
- // already present on the DOM element, so we don't want to override those
1390
- // attributes on the VDom tree with values from the host element if they
1391
- // are present.
1392
- //
1393
- // Likewise, `ref` and `key` are special internal values for the Stencil
1394
- // runtime and we don't want to override those either.
1395
- if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1396
- rootVnode.$attrs$[key] = hostElm[key];
1397
- }
1398
- }
1399
- }
1400
- rootVnode.$tag$ = null;
1401
- rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1402
- hostRef.$vnode$ = rootVnode;
1403
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1404
- {
1405
- scopeId = hostElm['s-sc'];
1406
- }
1407
- {
1408
- contentRef = hostElm['s-cr'];
1409
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1410
- // always reset
1411
- checkSlotFallbackVisibility = false;
1412
- }
1413
- // synchronous patch
1414
- patch(oldVNode, rootVnode, isInitialLoad);
1415
- {
1416
- // while we're moving nodes around existing nodes, temporarily disable
1417
- // the disconnectCallback from working
1418
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1419
- if (checkSlotRelocate) {
1420
- markSlotContentForRelocation(rootVnode.$elm$);
1421
- for (const relocateData of relocateNodes) {
1422
- const nodeToRelocate = relocateData.$nodeToRelocate$;
1423
- if (!nodeToRelocate['s-ol']) {
1424
- // add a reference node marking this node's original location
1425
- // keep a reference to this node for later lookups
1426
- const orgLocationNode = doc.createTextNode('');
1427
- orgLocationNode['s-nr'] = nodeToRelocate;
1428
- nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1429
- }
1430
- }
1431
- for (const relocateData of relocateNodes) {
1432
- const nodeToRelocate = relocateData.$nodeToRelocate$;
1433
- const slotRefNode = relocateData.$slotRefNode$;
1434
- if (slotRefNode) {
1435
- const parentNodeRef = slotRefNode.parentNode;
1436
- // When determining where to insert content, the most simple case would be
1437
- // to relocate the node immediately following the slot reference node. We do this
1438
- // by getting a reference to the node immediately following the slot reference node
1439
- // since we will use `insertBefore` to manipulate the DOM.
1440
- //
1441
- // If there is no node immediately following the slot reference node, then we will just
1442
- // end up appending the node as the last child of the parent.
1443
- let insertBeforeNode = slotRefNode.nextSibling;
1444
- // If the node we're currently planning on inserting the new node before is an element,
1445
- // we need to do some additional checks to make sure we're inserting the node in the correct order.
1446
- // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1447
- // to make sure they get inserted into their new how in the same order they were declared in their original location.
1448
- //
1449
- // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1450
- {
1451
- let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1452
- while (orgLocationNode) {
1453
- let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
1454
- if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1455
- refNode = refNode.nextSibling;
1456
- if (!refNode || !refNode['s-nr']) {
1457
- insertBeforeNode = refNode;
1458
- break;
1459
- }
1460
- }
1461
- orgLocationNode = orgLocationNode.previousSibling;
1462
- }
1463
- }
1464
- if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1465
- nodeToRelocate.nextSibling !== insertBeforeNode) {
1466
- // we've checked that it's worth while to relocate
1467
- // since that the node to relocate
1468
- // has a different next sibling or parent relocated
1469
- if (nodeToRelocate !== insertBeforeNode) {
1470
- if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1471
- // probably a component in the index.html that doesn't have its hostname set
1472
- nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1473
- }
1474
- // Add it back to the dom but in its new home
1475
- // If we get to this point and `insertBeforeNode` is `null`, that means
1476
- // we're just going to append the node as the last child of the parent. Passing
1477
- // `null` as the second arg here will trigger that behavior.
1478
- parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1479
- // Reset the `hidden` value back to what it was defined as originally
1480
- // This solves a problem where a `slot` is dynamically rendered and `hidden` may have
1481
- // been set on content originally, but now it has a slot to go to so it should have
1482
- // the value it was defined as having in the DOM, not what we overrode it to.
1483
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1484
- nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
1485
- }
1486
- }
1487
- }
1488
- }
1489
- else {
1490
- // this node doesn't have a slot home to go to, so let's hide it
1491
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1492
- // Store the initial value of `hidden` so we can reset it later when
1493
- // moving nodes around.
1494
- if (isInitialLoad) {
1495
- nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
1496
- }
1497
- nodeToRelocate.hidden = true;
1498
- }
1499
- }
1500
- }
1501
- }
1502
- if (checkSlotFallbackVisibility) {
1503
- updateFallbackSlotVisibility(rootVnode.$elm$);
1504
- }
1505
- // done moving nodes around
1506
- // allow the disconnect callback to work again
1507
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1508
- // always reset
1509
- relocateNodes.length = 0;
1510
- }
1511
- // Clear the content ref so we don't create a memory leak
1512
- contentRef = undefined;
1513
- };
1514
- const attachToAncestor = (hostRef, ancestorComponent) => {
1515
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1516
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1517
- }
1518
- };
1519
- const scheduleUpdate = (hostRef, isInitialLoad) => {
1520
- {
1521
- hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1522
- }
1523
- if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1524
- hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1525
- return;
1526
- }
1527
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1528
- // there is no ancestor component or the ancestor component
1529
- // has already fired off its lifecycle update then
1530
- // fire off the initial update
1531
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1532
- return writeTask(dispatch) ;
1533
- };
1534
- /**
1535
- * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1536
- * component lifecycle methods like `componentWillLoad` as well as
1537
- * {@link updateComponent}, which will kick off the virtual DOM re-render.
1538
- *
1539
- * @param hostRef a reference to a host DOM node
1540
- * @param isInitialLoad whether we're on the initial load or not
1541
- * @returns an empty Promise which is used to enqueue a series of operations for
1542
- * the component
1543
- */
1544
- const dispatchHooks = (hostRef, isInitialLoad) => {
1545
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1546
- const instance = hostRef.$lazyInstance$ ;
1547
- // We're going to use this variable together with `enqueue` to implement a
1548
- // little promise-based queue. We start out with it `undefined`. When we add
1549
- // the first function to the queue we'll set this variable to be that
1550
- // function's return value. When we attempt to add subsequent values to the
1551
- // queue we'll check that value and, if it was a `Promise`, we'll then chain
1552
- // the new function off of that `Promise` using `.then()`. This will give our
1553
- // queue two nice properties:
1554
- //
1555
- // 1. If all functions added to the queue are synchronous they'll be called
1556
- // synchronously right away.
1557
- // 2. If all functions added to the queue are asynchronous they'll all be
1558
- // called in order after `dispatchHooks` exits.
1559
- let maybePromise;
1560
- if (isInitialLoad) {
1561
- {
1562
- hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1563
- if (hostRef.$queuedListeners$) {
1564
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1565
- hostRef.$queuedListeners$ = undefined;
1566
- }
1567
- }
1568
- {
1569
- // If `componentWillLoad` returns a `Promise` then we want to wait on
1570
- // whatever's going on in that `Promise` before we launch into
1571
- // rendering the component, doing other lifecycle stuff, etc. So
1572
- // in that case we assign the returned promise to the variable we
1573
- // declared above to hold a possible 'queueing' Promise
1574
- maybePromise = safeCall(instance, 'componentWillLoad');
1575
- }
1576
- }
1577
- {
1578
- maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1579
- }
1580
- endSchedule();
1581
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1582
- };
1583
- /**
1584
- * This function uses a Promise to implement a simple first-in, first-out queue
1585
- * of functions to be called.
1586
- *
1587
- * The queue is ordered on the basis of the first argument. If it's
1588
- * `undefined`, then nothing is on the queue yet, so the provided function can
1589
- * be called synchronously (although note that this function may return a
1590
- * `Promise`). The idea is that then the return value of that enqueueing
1591
- * operation is kept around, so that if it was a `Promise` then subsequent
1592
- * functions can be enqueued by calling this function again with that `Promise`
1593
- * as the first argument.
1594
- *
1595
- * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1596
- * @param fn a function to enqueue
1597
- * @returns either a `Promise` or the return value of the provided function
1598
- */
1599
- const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1600
- /**
1601
- * Check that a value is a `Promise`. To check, we first see if the value is an
1602
- * instance of the `Promise` global. In a few circumstances, in particular if
1603
- * the global has been overwritten, this is could be misleading, so we also do
1604
- * a little 'duck typing' check to see if the `.then` property of the value is
1605
- * defined and a function.
1606
- *
1607
- * @param maybePromise it might be a promise!
1608
- * @returns whether it is or not
1609
- */
1610
- const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1611
- (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1612
- /**
1613
- * Update a component given reference to its host elements and so on.
1614
- *
1615
- * @param hostRef an object containing references to the element's host node,
1616
- * VDom nodes, and other metadata
1617
- * @param instance a reference to the underlying host element where it will be
1618
- * rendered
1619
- * @param isInitialLoad whether or not this function is being called as part of
1620
- * the first render cycle
1621
- */
1622
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
1623
- var _a;
1624
- const elm = hostRef.$hostElement$;
1625
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1626
- const rc = elm['s-rc'];
1627
- if (isInitialLoad) {
1628
- // DOM WRITE!
1629
- attachStyles(hostRef);
1630
- }
1631
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1632
- {
1633
- callRender(hostRef, instance, elm, isInitialLoad);
1634
- }
1635
- if (rc) {
1636
- // ok, so turns out there are some child host elements
1637
- // waiting on this parent element to load
1638
- // let's fire off all update callbacks waiting
1639
- rc.map((cb) => cb());
1640
- elm['s-rc'] = undefined;
1641
- }
1642
- endRender();
1643
- endUpdate();
1644
- {
1645
- const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1646
- const postUpdate = () => postUpdateComponent(hostRef);
1647
- if (childrenPromises.length === 0) {
1648
- postUpdate();
1649
- }
1650
- else {
1651
- Promise.all(childrenPromises).then(postUpdate);
1652
- hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1653
- childrenPromises.length = 0;
1654
- }
1655
- }
1656
- };
1657
- /**
1658
- * Handle making the call to the VDom renderer with the proper context given
1659
- * various build variables
1660
- *
1661
- * @param hostRef an object containing references to the element's host node,
1662
- * VDom nodes, and other metadata
1663
- * @param instance a reference to the underlying host element where it will be
1664
- * rendered
1665
- * @param elm the Host element for the component
1666
- * @param isInitialLoad whether or not this function is being called as part of
1667
- * @returns an empty promise
1668
- */
1669
- const callRender = (hostRef, instance, elm, isInitialLoad) => {
1670
- try {
1671
- /**
1672
- * minification optimization: `allRenderFn` is `true` if all components have a `render`
1673
- * method, so we can call the method immediately. If not, check before calling it.
1674
- */
1675
- instance = instance.render() ;
1676
- {
1677
- hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1678
- }
1679
- {
1680
- hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1681
- }
1682
- {
1683
- {
1684
- // looks like we've got child nodes to render into this host element
1685
- // or we need to update the css class/attrs on the host element
1686
- // DOM WRITE!
1687
- {
1688
- renderVdom(hostRef, instance, isInitialLoad);
1689
- }
1690
- }
1691
- }
1692
- }
1693
- catch (e) {
1694
- consoleError(e, hostRef.$hostElement$);
1695
- }
1696
- return null;
1697
- };
1698
- const postUpdateComponent = (hostRef) => {
1699
- const tagName = hostRef.$cmpMeta$.$tagName$;
1700
- const elm = hostRef.$hostElement$;
1701
- const endPostUpdate = createTime('postUpdate', tagName);
1702
- const instance = hostRef.$lazyInstance$ ;
1703
- const ancestorComponent = hostRef.$ancestorComponent$;
1704
- {
1705
- safeCall(instance, 'componentDidRender');
1706
- }
1707
- if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1708
- hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1709
- {
1710
- // DOM WRITE!
1711
- addHydratedFlag(elm);
1712
- }
1713
- {
1714
- safeCall(instance, 'componentDidLoad');
1715
- }
1716
- endPostUpdate();
1717
- {
1718
- hostRef.$onReadyResolve$(elm);
1719
- if (!ancestorComponent) {
1720
- appDidLoad();
1721
- }
1722
- }
1723
- }
1724
- else {
1725
- {
1726
- safeCall(instance, 'componentDidUpdate');
1727
- }
1728
- endPostUpdate();
1729
- }
1730
- {
1731
- hostRef.$onInstanceResolve$(elm);
1732
- }
1733
- // load events fire from bottom to top
1734
- // the deepest elements load first then bubbles up
1735
- {
1736
- if (hostRef.$onRenderResolve$) {
1737
- hostRef.$onRenderResolve$();
1738
- hostRef.$onRenderResolve$ = undefined;
1739
- }
1740
- if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1741
- nextTick(() => scheduleUpdate(hostRef, false));
1742
- }
1743
- hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1744
- }
1745
- // ( •_•)
1746
- // ( •_•)>⌐■-■
1747
- // (⌐■_■)
1748
- };
1749
- const appDidLoad = (who) => {
1750
- // on appload
1751
- // we have finish the first big initial render
1752
- {
1753
- addHydratedFlag(doc.documentElement);
1754
- }
1755
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1756
- };
1757
- /**
1758
- * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1759
- * e.g. custom element node. If a build figures out that e.g. no component
1760
- * has a `componentDidLoad` method, the instance method gets removed from the
1761
- * output bundle and this function returns `undefined`.
1762
- * @param instance any object that may or may not contain methods
1763
- * @param method method name
1764
- * @param arg single arbitrary argument
1765
- * @returns result of method call if it exists, otherwise `undefined`
1766
- */
1767
- const safeCall = (instance, method, arg) => {
1768
- if (instance && instance[method]) {
1769
- try {
1770
- return instance[method](arg);
1771
- }
1772
- catch (e) {
1773
- consoleError(e);
1774
- }
1775
- }
1776
- return undefined;
1777
- };
1778
- const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1779
- ;
1780
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1781
- const setValue = (ref, propName, newVal, cmpMeta) => {
1782
- // check our new property value against our internal value
1783
- const hostRef = getHostRef(ref);
1784
- const elm = hostRef.$hostElement$ ;
1785
- const oldVal = hostRef.$instanceValues$.get(propName);
1786
- const flags = hostRef.$flags$;
1787
- const instance = hostRef.$lazyInstance$ ;
1788
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1789
- // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1790
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1791
- const didValueChange = newVal !== oldVal && !areBothNaN;
1792
- if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1793
- // gadzooks! the property's value has changed!!
1794
- // set our new value!
1795
- hostRef.$instanceValues$.set(propName, newVal);
1796
- if (instance) {
1797
- // get an array of method names of watch functions to call
1798
- if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1799
- const watchMethods = cmpMeta.$watchers$[propName];
1800
- if (watchMethods) {
1801
- // this instance is watching for when this property changed
1802
- watchMethods.map((watchMethodName) => {
1803
- try {
1804
- // fire off each of the watch methods that are watching this property
1805
- instance[watchMethodName](newVal, oldVal, propName);
1806
- }
1807
- catch (e) {
1808
- consoleError(e, elm);
1809
- }
1810
- });
1811
- }
1812
- }
1813
- if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1814
- // looks like this value actually changed, so we've got work to do!
1815
- // but only if we've already rendered, otherwise just chill out
1816
- // queue that we need to do an update, but don't worry about queuing
1817
- // up millions cuz this function ensures it only runs once
1818
- scheduleUpdate(hostRef, false);
1819
- }
1820
- }
1821
- }
1822
- };
1823
- /**
1824
- * Attach a series of runtime constructs to a compiled Stencil component
1825
- * constructor, including getters and setters for the `@Prop` and `@State`
1826
- * decorators, callbacks for when attributes change, and so on.
1827
- *
1828
- * @param Cstr the constructor for a component that we need to process
1829
- * @param cmpMeta metadata collected previously about the component
1830
- * @param flags a number used to store a series of bit flags
1831
- * @returns a reference to the same constructor passed in (but now mutated)
1832
- */
1833
- const proxyComponent = (Cstr, cmpMeta, flags) => {
1834
- var _a;
1835
- const prototype = Cstr.prototype;
1836
- if (cmpMeta.$members$) {
1837
- if (Cstr.watchers) {
1838
- cmpMeta.$watchers$ = Cstr.watchers;
1839
- }
1840
- // It's better to have a const than two Object.entries()
1841
- const members = Object.entries(cmpMeta.$members$);
1842
- members.map(([memberName, [memberFlags]]) => {
1843
- if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1844
- ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1845
- // proxyComponent - prop
1846
- Object.defineProperty(prototype, memberName, {
1847
- get() {
1848
- // proxyComponent, get value
1849
- return getValue(this, memberName);
1850
- },
1851
- set(newValue) {
1852
- // proxyComponent, set value
1853
- setValue(this, memberName, newValue, cmpMeta);
1854
- },
1855
- configurable: true,
1856
- enumerable: true,
1857
- });
1858
- }
1859
- else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1860
- memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1861
- // proxyComponent - method
1862
- Object.defineProperty(prototype, memberName, {
1863
- value(...args) {
1864
- var _a;
1865
- const ref = getHostRef(this);
1866
- return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
1867
- },
1868
- });
1869
- }
1870
- });
1871
- if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1872
- const attrNameToPropName = new Map();
1873
- prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1874
- plt.jmp(() => {
1875
- var _a;
1876
- const propName = attrNameToPropName.get(attrName);
1877
- // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1878
- // in the case where an attribute was set inline.
1879
- // ```html
1880
- // <my-component some-attribute="some-value"></my-component>
1881
- // ```
1882
- //
1883
- // There is an edge case where a developer sets the attribute inline on a custom element and then
1884
- // programmatically changes it before it has been upgraded as shown below:
1885
- //
1886
- // ```html
1887
- // <!-- this component has _not_ been upgraded yet -->
1888
- // <my-component id="test" some-attribute="some-value"></my-component>
1889
- // <script>
1890
- // // grab non-upgraded component
1891
- // el = document.querySelector("#test");
1892
- // el.someAttribute = "another-value";
1893
- // // upgrade component
1894
- // customElements.define('my-component', MyComponent);
1895
- // </script>
1896
- // ```
1897
- // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1898
- // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1899
- // to the value that was set inline i.e. "some-value" from above example. When
1900
- // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1901
- //
1902
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1903
- // by connectedCallback as this attributeChangedCallback will not fire.
1904
- //
1905
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1906
- //
1907
- // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1908
- // properties here given that this goes against best practices outlined here
1909
- // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1910
- if (this.hasOwnProperty(propName)) {
1911
- newValue = this[propName];
1912
- delete this[propName];
1913
- }
1914
- else if (prototype.hasOwnProperty(propName) &&
1915
- typeof this[propName] === 'number' &&
1916
- this[propName] == newValue) {
1917
- // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1918
- // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1919
- // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1920
- return;
1921
- }
1922
- else if (propName == null) {
1923
- // At this point we should know this is not a "member", so we can treat it like watching an attribute
1924
- // on a vanilla web component
1925
- const hostRef = getHostRef(this);
1926
- const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1927
- // We only want to trigger the callback(s) if:
1928
- // 1. The instance is ready
1929
- // 2. The watchers are ready
1930
- // 3. The value has changed
1931
- if (flags &&
1932
- !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1933
- flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1934
- newValue !== oldValue) {
1935
- const instance = hostRef.$lazyInstance$ ;
1936
- const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1937
- entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1938
- if (instance[callbackName] != null) {
1939
- instance[callbackName].call(instance, newValue, oldValue, attrName);
1940
- }
1941
- });
1942
- }
1943
- return;
1944
- }
1945
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1946
- });
1947
- };
1948
- // Create an array of attributes to observe
1949
- // This list in comprised of all strings used within a `@Watch()` decorator
1950
- // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1951
- // As such, there is no way to guarantee type-safety here that a user hasn't entered
1952
- // an invalid attribute.
1953
- Cstr.observedAttributes = Array.from(new Set([
1954
- ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1955
- ...members
1956
- .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1957
- .map(([propName, m]) => {
1958
- var _a;
1959
- const attrName = m[1] || propName;
1960
- attrNameToPropName.set(attrName, propName);
1961
- if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1962
- (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
1963
- }
1964
- return attrName;
1965
- }),
1966
- ]));
1967
- }
1968
- }
1969
- return Cstr;
1970
- };
1971
- /**
1972
- * Initialize a Stencil component given a reference to its host element, its
1973
- * runtime bookkeeping data structure, runtime metadata about the component,
1974
- * and (optionally) an HMR version ID.
1975
- *
1976
- * @param elm a host element
1977
- * @param hostRef the element's runtime bookkeeping object
1978
- * @param cmpMeta runtime metadata for the Stencil component
1979
- * @param hmrVersionId an (optional) HMR version ID
1980
- */
1981
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1982
- let Cstr;
1983
- // initializeComponent
1984
- if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1985
- // Let the runtime know that the component has been initialized
1986
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1987
- {
1988
- // lazy loaded components
1989
- // request the component's implementation to be
1990
- // wired up with the host element
1991
- Cstr = loadModule(cmpMeta);
1992
- if (Cstr.then) {
1993
- // Await creates a micro-task avoid if possible
1994
- const endLoad = uniqueTime();
1995
- Cstr = await Cstr;
1996
- endLoad();
1997
- }
1998
- if (!Cstr.isProxied) {
1999
- // we've never proxied this Constructor before
2000
- // let's add the getters/setters to its prototype before
2001
- // the first time we create an instance of the implementation
2002
- {
2003
- cmpMeta.$watchers$ = Cstr.watchers;
2004
- }
2005
- proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
2006
- Cstr.isProxied = true;
2007
- }
2008
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
2009
- // ok, time to construct the instance
2010
- // but let's keep track of when we start and stop
2011
- // so that the getters/setters don't incorrectly step on data
2012
- {
2013
- hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
2014
- }
2015
- // construct the lazy-loaded component implementation
2016
- // passing the hostRef is very important during
2017
- // construction in order to directly wire together the
2018
- // host element and the lazy-loaded instance
2019
- try {
2020
- new Cstr(hostRef);
2021
- }
2022
- catch (e) {
2023
- consoleError(e);
2024
- }
2025
- {
2026
- hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
2027
- }
2028
- {
2029
- hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
2030
- }
2031
- endNewInstance();
2032
- fireConnectedCallback(hostRef.$lazyInstance$);
2033
- }
2034
- if (Cstr.style) {
2035
- // this component has styles but we haven't registered them yet
2036
- let style = Cstr.style;
2037
- const scopeId = getScopeId(cmpMeta);
2038
- if (!styles.has(scopeId)) {
2039
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
2040
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
2041
- endRegisterStyles();
2042
- }
2043
- }
2044
- }
2045
- // we've successfully created a lazy instance
2046
- const ancestorComponent = hostRef.$ancestorComponent$;
2047
- const schedule = () => scheduleUpdate(hostRef, true);
2048
- if (ancestorComponent && ancestorComponent['s-rc']) {
2049
- // this is the initial load and this component it has an ancestor component
2050
- // but the ancestor component has NOT fired its will update lifecycle yet
2051
- // so let's just cool our jets and wait for the ancestor to continue first
2052
- // this will get fired off when the ancestor component
2053
- // finally gets around to rendering its lazy self
2054
- // fire off the initial update
2055
- ancestorComponent['s-rc'].push(schedule);
2056
- }
2057
- else {
2058
- schedule();
2059
- }
2060
- };
2061
- const fireConnectedCallback = (instance) => {
2062
- {
2063
- safeCall(instance, 'connectedCallback');
2064
- }
2065
- };
2066
- const connectedCallback = (elm) => {
2067
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2068
- const hostRef = getHostRef(elm);
2069
- const cmpMeta = hostRef.$cmpMeta$;
2070
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
2071
- if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
2072
- // first time this component has connected
2073
- hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
2074
- {
2075
- // initUpdate
2076
- // if the slot polyfill is required we'll need to put some nodes
2077
- // in here to act as original content anchors as we move nodes around
2078
- // host element has been connected to the DOM
2079
- if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2080
- cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
2081
- setContentReference(elm);
2082
- }
2083
- }
2084
- {
2085
- // find the first ancestor component (if there is one) and register
2086
- // this component as one of the actively loading child components for its ancestor
2087
- let ancestorComponent = elm;
2088
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
2089
- // climb up the ancestors looking for the first
2090
- // component that hasn't finished its lifecycle update yet
2091
- if (ancestorComponent['s-p']) {
2092
- // we found this components first ancestor component
2093
- // keep a reference to this component's ancestor component
2094
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
2095
- break;
2096
- }
2097
- }
2098
- }
2099
- // Lazy properties
2100
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2101
- if (cmpMeta.$members$) {
2102
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2103
- if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
2104
- const value = elm[memberName];
2105
- delete elm[memberName];
2106
- elm[memberName] = value;
2107
- }
2108
- });
2109
- }
2110
- {
2111
- // connectedCallback, taskQueue, initialLoad
2112
- // angular sets attribute AFTER connectCallback
2113
- // https://github.com/angular/angular/issues/18909
2114
- // https://github.com/angular/angular/issues/19940
2115
- nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2116
- }
2117
- }
2118
- else {
2119
- // not the first time this has connected
2120
- // reattach any event listeners to the host
2121
- // since they would have been removed when disconnected
2122
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2123
- // fire off connectedCallback() on component instance
2124
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2125
- fireConnectedCallback(hostRef.$lazyInstance$);
2126
- }
2127
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2128
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
2129
- }
2130
- }
2131
- endConnected();
2132
- }
2133
- };
2134
- const setContentReference = (elm) => {
2135
- // only required when we're NOT using native shadow dom (slot)
2136
- // or this browser doesn't support native shadow dom
2137
- // and this host element was NOT created with SSR
2138
- // let's pick out the inner content for slot projection
2139
- // create a node to represent where the original
2140
- // content was first placed, which is useful later on
2141
- const contentRefElm = (elm['s-cr'] = doc.createComment(''));
2142
- contentRefElm['s-cn'] = true;
2143
- elm.insertBefore(contentRefElm, elm.firstChild);
2144
- };
2145
- const disconnectInstance = (instance) => {
2146
- {
2147
- safeCall(instance, 'disconnectedCallback');
2148
- }
2149
- };
2150
- const disconnectedCallback = async (elm) => {
2151
- if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2152
- const hostRef = getHostRef(elm);
2153
- {
2154
- if (hostRef.$rmListeners$) {
2155
- hostRef.$rmListeners$.map((rmListener) => rmListener());
2156
- hostRef.$rmListeners$ = undefined;
2157
- }
2158
- }
2159
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2160
- disconnectInstance(hostRef.$lazyInstance$);
2161
- }
2162
- else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2163
- hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2164
- }
2165
- }
2166
- };
2167
- const bootstrapLazy = (lazyBundles, options = {}) => {
2168
- var _a;
2169
- const endBootstrap = createTime();
2170
- const cmpTags = [];
2171
- const exclude = options.exclude || [];
2172
- const customElements = win.customElements;
2173
- const head = doc.head;
2174
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
2175
- const dataStyles = /*@__PURE__*/ doc.createElement('style');
2176
- const deferredConnectedCallbacks = [];
2177
- let appLoadFallback;
2178
- let isBootstrapping = true;
2179
- Object.assign(plt, options);
2180
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2181
- let hasSlotRelocation = false;
2182
- lazyBundles.map((lazyBundle) => {
2183
- lazyBundle[1].map((compactMeta) => {
2184
- var _a;
2185
- const cmpMeta = {
2186
- $flags$: compactMeta[0],
2187
- $tagName$: compactMeta[1],
2188
- $members$: compactMeta[2],
2189
- $listeners$: compactMeta[3],
2190
- };
2191
- // Check if we are using slots outside the shadow DOM in this component.
2192
- // We'll use this information later to add styles for `slot-fb` elements
2193
- if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
2194
- hasSlotRelocation = true;
2195
- }
2196
- {
2197
- cmpMeta.$members$ = compactMeta[2];
2198
- }
2199
- {
2200
- cmpMeta.$listeners$ = compactMeta[3];
2201
- }
2202
- {
2203
- cmpMeta.$attrsToReflect$ = [];
2204
- }
2205
- {
2206
- cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
2207
- }
2208
- const tagName = cmpMeta.$tagName$;
2209
- const HostElement = class extends HTMLElement {
2210
- // StencilLazyHost
2211
- constructor(self) {
2212
- // @ts-ignore
2213
- super(self);
2214
- self = this;
2215
- registerHost(self, cmpMeta);
2216
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2217
- // this component is using shadow dom
2218
- // and this browser supports shadow dom
2219
- // add the read-only property "shadowRoot" to the host element
2220
- // adding the shadow root build conditionals to minimize runtime
2221
- {
2222
- {
2223
- self.attachShadow({ mode: 'open' });
2224
- }
2225
- }
2226
- }
2227
- }
2228
- connectedCallback() {
2229
- if (appLoadFallback) {
2230
- clearTimeout(appLoadFallback);
2231
- appLoadFallback = null;
2232
- }
2233
- if (isBootstrapping) {
2234
- // connectedCallback will be processed once all components have been registered
2235
- deferredConnectedCallbacks.push(this);
2236
- }
2237
- else {
2238
- plt.jmp(() => connectedCallback(this));
2239
- }
2240
- }
2241
- disconnectedCallback() {
2242
- plt.jmp(() => disconnectedCallback(this));
2243
- }
2244
- componentOnReady() {
2245
- return getHostRef(this).$onReadyPromise$;
2246
- }
2247
- };
2248
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
2249
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2250
- cmpTags.push(tagName);
2251
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
2252
- }
2253
- });
2254
- });
2255
- // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
2256
- if (hasSlotRelocation) {
2257
- dataStyles.innerHTML += SLOT_FB_CSS;
2258
- }
2259
- // Add hydration styles
2260
- {
2261
- dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
2262
- }
2263
- // If we have styles, add them to the DOM
2264
- if (dataStyles.innerHTML.length) {
2265
- dataStyles.setAttribute('data-styles', '');
2266
- // Apply CSP nonce to the style tag if it exists
2267
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
2268
- if (nonce != null) {
2269
- dataStyles.setAttribute('nonce', nonce);
2270
- }
2271
- // Insert the styles into the document head
2272
- // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
2273
- head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
2274
- }
2275
- // Process deferred connectedCallbacks now all components have been registered
2276
- isBootstrapping = false;
2277
- if (deferredConnectedCallbacks.length) {
2278
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
2279
- }
2280
- else {
2281
- {
2282
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2283
- }
2284
- }
2285
- // Fallback appLoad event
2286
- endBootstrap();
2287
- };
2288
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2289
- if (listeners) {
2290
- listeners.map(([flags, name, method]) => {
2291
- const target = getHostListenerTarget(elm, flags) ;
2292
- const handler = hostListenerProxy(hostRef, method);
2293
- const opts = hostListenerOpts(flags);
2294
- plt.ael(target, name, handler, opts);
2295
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2296
- });
2297
- }
2298
- };
2299
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
2300
- try {
2301
- {
2302
- if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
2303
- // instance is ready, let's call it's member method for this event
2304
- hostRef.$lazyInstance$[methodName](ev);
2305
- }
2306
- else {
2307
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2308
- }
2309
- }
2310
- }
2311
- catch (e) {
2312
- consoleError(e);
2313
- }
2314
- };
2315
- const getHostListenerTarget = (elm, flags) => {
2316
- if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
2317
- return doc;
2318
- if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
2319
- return win;
2320
- if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
2321
- return doc.body;
2322
- return elm;
2323
- };
2324
- // prettier-ignore
2325
- const hostListenerOpts = (flags) => supportsListenerOptions
2326
- ? ({
2327
- passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
2328
- capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
2329
- })
2330
- : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
2331
- /**
2332
- * Assigns the given value to the nonce property on the runtime platform object.
2333
- * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
2334
- * @param nonce The value to be assigned to the platform nonce property.
2335
- * @returns void
2336
- */
2337
- const setNonce = (nonce) => (plt.$nonce$ = nonce);
2338
- /**
2339
- * A WeakMap mapping runtime component references to their corresponding host reference
2340
- * instances.
2341
- */
2342
- const hostRefs = /*@__PURE__*/ new WeakMap();
2343
- /**
2344
- * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
2345
- *
2346
- * @param ref the runtime ref of interest
2347
- * @returns the Host reference (if found) or undefined
2348
- */
2349
- const getHostRef = (ref) => hostRefs.get(ref);
2350
- /**
2351
- * Register a lazy instance with the {@link hostRefs} object so it's
2352
- * corresponding {@link d.HostRef} can be retrieved later.
2353
- *
2354
- * @param lazyInstance the lazy instance of interest
2355
- * @param hostRef that instances `HostRef` object
2356
- * @returns a reference to the host ref WeakMap
2357
- */
2358
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2359
- /**
2360
- * Register a host element for a Stencil component, setting up various metadata
2361
- * and callbacks based on {@link BUILD} flags as well as the component's runtime
2362
- * metadata.
2363
- *
2364
- * @param hostElement the host element to register
2365
- * @param cmpMeta runtime metadata for that component
2366
- * @returns a reference to the host ref WeakMap
2367
- */
2368
- const registerHost = (hostElement, cmpMeta) => {
2369
- const hostRef = {
2370
- $flags$: 0,
2371
- $hostElement$: hostElement,
2372
- $cmpMeta$: cmpMeta,
2373
- $instanceValues$: new Map(),
2374
- };
2375
- {
2376
- hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
2377
- }
2378
- {
2379
- hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2380
- hostElement['s-p'] = [];
2381
- hostElement['s-rc'] = [];
2382
- }
2383
- addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
2384
- return hostRefs.set(hostElement, hostRef);
2385
- };
2386
- const isMemberInElement = (elm, memberName) => memberName in elm;
2387
- const consoleError = (e, el) => (0, console.error)(e, el);
2388
- const cmpModules = /*@__PURE__*/ new Map();
2389
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2390
- // loadModuleImport
2391
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2392
- const bundleId = cmpMeta.$lazyBundleId$;
2393
- const module = cmpModules.get(bundleId) ;
2394
- if (module) {
2395
- return module[exportName];
2396
- }
2397
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
2398
- return import(
2399
- /* @vite-ignore */
2400
- /* webpackInclude: /\.entry\.js$/ */
2401
- /* webpackExclude: /\.system\.entry\.js$/ */
2402
- /* webpackMode: "lazy" */
2403
- `./${bundleId}.entry.js${''}`).then((importedModule) => {
2404
- {
2405
- cmpModules.set(bundleId, importedModule);
2406
- }
2407
- return importedModule[exportName];
2408
- }, consoleError);
2409
- };
2410
- const styles = /*@__PURE__*/ new Map();
2411
- const win = typeof window !== 'undefined' ? window : {};
2412
- const doc = win.document || { head: {} };
2413
- const plt = {
2414
- $flags$: 0,
2415
- $resourcesUrl$: '',
2416
- jmp: (h) => h(),
2417
- raf: (h) => requestAnimationFrame(h),
2418
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2419
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2420
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
2421
- };
2422
- const setPlatformHelpers = (helpers) => {
2423
- Object.assign(plt, helpers);
2424
- };
2425
- const supportsListenerOptions = /*@__PURE__*/ (() => {
2426
- let supportsListenerOptions = false;
2427
- try {
2428
- doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
2429
- get() {
2430
- supportsListenerOptions = true;
2431
- },
2432
- }));
2433
- }
2434
- catch (e) { }
2435
- return supportsListenerOptions;
2436
- })();
2437
- const promiseResolve = (v) => Promise.resolve(v);
2438
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2439
- try {
2440
- new CSSStyleSheet();
2441
- return typeof new CSSStyleSheet().replaceSync === 'function';
2442
- }
2443
- catch (e) { }
2444
- return false;
2445
- })()
2446
- ;
2447
- const queueDomReads = [];
2448
- const queueDomWrites = [];
2449
- const queueTask = (queue, write) => (cb) => {
2450
- queue.push(cb);
2451
- if (!queuePending) {
2452
- queuePending = true;
2453
- if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2454
- nextTick(flush);
2455
- }
2456
- else {
2457
- plt.raf(flush);
2458
- }
2459
- }
2460
- };
2461
- const consume = (queue) => {
2462
- for (let i = 0; i < queue.length; i++) {
2463
- try {
2464
- queue[i](performance.now());
2465
- }
2466
- catch (e) {
2467
- consoleError(e);
2468
- }
2469
- }
2470
- queue.length = 0;
2471
- };
2472
- const flush = () => {
2473
- // always force a bunch of medium callbacks to run, but still have
2474
- // a throttle on how many can run in a certain time
2475
- // DOM READS!!!
2476
- consume(queueDomReads);
2477
- // DOM WRITES!!!
2478
- {
2479
- consume(queueDomWrites);
2480
- if ((queuePending = queueDomReads.length > 0)) {
2481
- // still more to do yet, but we've run out of time
2482
- // let's let this thing cool off and try again in the next tick
2483
- plt.raf(flush);
2484
- }
2485
- }
2486
- };
2487
- const nextTick = (cb) => promiseResolve().then(cb);
2488
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2489
-
2490
- export { Host as H, setPlatformHelpers as a, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s, writeTask as w };