@baloise/ds-core 19.8.3-snapshot.1877-5fcfacefc → 19.8.4

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 (440) hide show
  1. package/components/bal-dropdown.js +63 -19
  2. package/components/bal-field-control.js +2 -2
  3. package/components/bal-field-hint.js +1 -1
  4. package/components/bal-field-label.js +1 -1
  5. package/components/bal-field-message.js +2 -2
  6. package/components/bal-field.js +2 -2
  7. package/components/bal-file-upload.js +4 -4
  8. package/components/bal-footer.js +3 -3
  9. package/components/bal-form-col.js +2 -2
  10. package/components/bal-form-grid.js +1 -1
  11. package/components/bal-form.js +1 -1
  12. package/components/bal-heading2.js +1 -1
  13. package/components/bal-hint-text2.js +1 -1
  14. package/components/bal-hint-title2.js +1 -1
  15. package/components/bal-icon2.js +1 -1
  16. package/components/bal-input-date2.js +2 -2
  17. package/components/bal-input-group2.js +1 -1
  18. package/components/bal-input-slider.js +3 -3
  19. package/components/bal-input-stepper.js +1 -1
  20. package/components/bal-input.js +1 -1
  21. package/components/bal-label2.js +1 -1
  22. package/components/bal-list-item-content2.js +2 -2
  23. package/components/bal-list-item-icon2.js +2 -2
  24. package/components/bal-list-item-subtitle2.js +1 -1
  25. package/components/bal-list-item-title2.js +1 -1
  26. package/components/bal-list2.js +1 -1
  27. package/components/bal-modal-body.js +1 -1
  28. package/components/bal-modal-header.js +1 -1
  29. package/components/bal-modal.js +5 -5
  30. package/components/bal-nav-link-grid-col2.js +1 -1
  31. package/components/bal-nav-link-grid2.js +1 -1
  32. package/components/bal-nav-link-group.js +1 -1
  33. package/components/bal-nav-link2.js +2 -2
  34. package/components/bal-nav-menu-bar2.js +1 -1
  35. package/components/bal-nav-menu-flyout2.js +1 -1
  36. package/components/bal-nav-meta-bar2.js +1 -1
  37. package/components/bal-nav.js +2 -2
  38. package/components/bal-navbar-brand.js +1 -1
  39. package/components/bal-navbar-menu-end.js +1 -1
  40. package/components/bal-navbar-menu-start.js +1 -1
  41. package/components/bal-navbar-menu.js +1 -1
  42. package/components/bal-navbar.js +1 -1
  43. package/components/bal-notices.js +1 -1
  44. package/components/bal-notification.js +1 -1
  45. package/components/bal-number-input.js +1 -1
  46. package/components/bal-option-list.js +1 -502
  47. package/components/bal-option-list2.js +504 -0
  48. package/components/bal-option.js +1 -195
  49. package/components/bal-option2.js +197 -0
  50. package/components/bal-pagination.js +4 -4
  51. package/components/bal-popover-content2.js +1 -1
  52. package/components/bal-popup2.js +1 -1
  53. package/components/bal-progress-bar.js +1 -1
  54. package/components/bal-radio-icon2.js +1 -1
  55. package/components/bal-radio2.js +2 -2
  56. package/components/bal-segment-item.js +1 -1
  57. package/components/bal-segment.js +1 -1
  58. package/components/bal-select-option2.js +1 -1
  59. package/components/bal-select2.js +5 -5
  60. package/components/bal-shape2.js +4 -4
  61. package/components/bal-sheet.js +1 -1
  62. package/components/bal-snackbar.js +1 -1
  63. package/components/bal-spinner2.js +1 -1
  64. package/components/bal-stack2.js +1 -1
  65. package/components/bal-stage-back-link.js +2 -2
  66. package/components/bal-stage-body.js +1 -1
  67. package/components/bal-stage-foot.js +1 -1
  68. package/components/bal-stage-head.js +1 -1
  69. package/components/bal-stage-image.js +1 -1
  70. package/components/bal-stage.js +1 -1
  71. package/components/bal-step-item.js +2 -2
  72. package/components/bal-tab-item.js +2 -2
  73. package/components/bal-table.js +1 -1
  74. package/components/bal-tabs2.js +2 -2
  75. package/components/bal-tag-group.js +1 -1
  76. package/components/bal-tag2.js +1 -1
  77. package/components/bal-text.js +2 -2
  78. package/components/bal-textarea.js +1 -1
  79. package/components/bal-time-input.js +1 -1
  80. package/components/bal-toast.js +1 -1
  81. package/components/bal-tooltip.js +1 -1
  82. package/components/index.js +1 -1
  83. package/components/tokens.esm.js +1 -1
  84. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  85. package/dist/baloise-design-system/index.esm.js +1 -1
  86. package/dist/baloise-design-system/{p-308efc1ab8.system.entry.js → p-042570e1b4.system.entry.js} +1 -1
  87. package/dist/baloise-design-system/p-07b3561d34.entry.js +1 -0
  88. package/dist/baloise-design-system/p-09341cadc6.system.entry.js +1 -0
  89. package/dist/baloise-design-system/{p-261f0c83c1.entry.js → p-0b05d342f5.entry.js} +1 -1
  90. package/dist/baloise-design-system/{p-dd0977c1a5.system.entry.js → p-0db571d8f2.system.entry.js} +1 -1
  91. package/dist/baloise-design-system/{p-c9e7b5febd.entry.js → p-1074fb7fbc.entry.js} +1 -1
  92. package/dist/baloise-design-system/{p-f9a22579af.entry.js → p-133b5a4986.entry.js} +1 -1
  93. package/dist/baloise-design-system/{p-7e55f97a9b.entry.js → p-1df2fb625c.entry.js} +1 -1
  94. package/dist/baloise-design-system/{p-8da6979637.system.entry.js → p-24185181f1.system.entry.js} +1 -1
  95. package/dist/baloise-design-system/{p-e43650f8c2.system.entry.js → p-255e5491e6.system.entry.js} +1 -1
  96. package/dist/baloise-design-system/{p-fe5b5b4e92.system.entry.js → p-26085b7dcc.system.entry.js} +1 -1
  97. package/dist/baloise-design-system/p-31abb1f859.entry.js +1 -0
  98. package/dist/baloise-design-system/p-345901e33b.entry.js +1 -0
  99. package/dist/baloise-design-system/p-34d75cbfe8.entry.js +1 -0
  100. package/dist/baloise-design-system/{p-d04073fca3.entry.js → p-3678c7a958.entry.js} +1 -1
  101. package/dist/baloise-design-system/{p-a68f9da861.entry.js → p-38fa211868.entry.js} +1 -1
  102. package/dist/baloise-design-system/p-3f596ba050.entry.js +1 -0
  103. package/dist/baloise-design-system/{p-e0ddc62028.system.entry.js → p-41dcd76f1f.system.entry.js} +1 -1
  104. package/dist/baloise-design-system/{p-167806fc44.entry.js → p-4256f1331b.entry.js} +1 -1
  105. package/dist/baloise-design-system/{p-06d6d65df7.entry.js → p-427fe8eede.entry.js} +1 -1
  106. package/dist/baloise-design-system/{p-96bf290c11.system.entry.js → p-46986c305d.system.entry.js} +1 -1
  107. package/dist/baloise-design-system/{p-2d8dd4be3a.entry.js → p-49c12d2474.entry.js} +1 -1
  108. package/dist/baloise-design-system/{p-eb726f11fd.system.entry.js → p-4aeaa1a916.system.entry.js} +1 -1
  109. package/dist/baloise-design-system/{p-bf4f338b08.system.entry.js → p-4c23ab651a.system.entry.js} +1 -1
  110. package/dist/baloise-design-system/{p-0b8fd4ec15.entry.js → p-586de1181e.entry.js} +1 -1
  111. package/dist/baloise-design-system/{p-cc08c698c8.entry.js → p-5a66d8f568.entry.js} +1 -1
  112. package/dist/baloise-design-system/{p-b81b635342.system.entry.js → p-5f105bc63d.system.entry.js} +1 -1
  113. package/dist/baloise-design-system/{p-c983f0df44.entry.js → p-627def5e99.entry.js} +1 -1
  114. package/dist/baloise-design-system/{p-88606d2a51.entry.js → p-6670584628.entry.js} +1 -1
  115. package/dist/baloise-design-system/{p-8cff569252.system.entry.js → p-670a2bf1e7.system.entry.js} +1 -1
  116. package/dist/baloise-design-system/{p-dbb9b3b5e2.system.entry.js → p-68e405562e.system.entry.js} +1 -1
  117. package/dist/baloise-design-system/{p-ef841ce7eb.system.entry.js → p-71d9805e14.system.entry.js} +1 -1
  118. package/dist/baloise-design-system/{p-dcdff65e55.entry.js → p-74047cc11f.entry.js} +1 -1
  119. package/dist/baloise-design-system/{p-76fdd28025.system.entry.js → p-744c19c66d.system.entry.js} +1 -1
  120. package/dist/baloise-design-system/{p-967ff349ed.system.entry.js → p-746165a211.system.entry.js} +1 -1
  121. package/dist/baloise-design-system/{p-42801b7e0c.system.entry.js → p-77404bcf6d.system.entry.js} +1 -1
  122. package/dist/baloise-design-system/{p-8b3958b0a1.entry.js → p-7cb15b231d.entry.js} +1 -1
  123. package/dist/baloise-design-system/{p-69ba98aa56.entry.js → p-81a7d8f03d.entry.js} +1 -1
  124. package/dist/baloise-design-system/{p-8316ebffca.entry.js → p-878f4e40a8.entry.js} +1 -1
  125. package/dist/baloise-design-system/{p-c3af6cc44a.system.entry.js → p-87d7996b33.system.entry.js} +1 -1
  126. package/dist/baloise-design-system/{p-a494f5de47.system.entry.js → p-88f9358a95.system.entry.js} +1 -1
  127. package/dist/baloise-design-system/{p-7e6c509606.entry.js → p-8cf1d029e7.entry.js} +1 -1
  128. package/dist/baloise-design-system/{p-3351459a27.entry.js → p-93dc4e9ec8.entry.js} +1 -1
  129. package/dist/baloise-design-system/{p-7000f4ab00.entry.js → p-99a9cc7202.entry.js} +1 -1
  130. package/dist/baloise-design-system/{p-a2abd2bae3.system.entry.js → p-9be82de5a5.system.entry.js} +1 -1
  131. package/dist/baloise-design-system/{p-d846f14080.system.entry.js → p-9da9d45bda.system.entry.js} +1 -1
  132. package/dist/baloise-design-system/{p-cbc17a1f06.system.entry.js → p-9fc710438a.system.entry.js} +1 -1
  133. package/dist/baloise-design-system/{p-BztQqSGe.system.js → p-B3ZVog4n.system.js} +1 -1
  134. package/dist/baloise-design-system/p-BRJ7ljGZ.system.js +1 -0
  135. package/dist/baloise-design-system/{p-CFFaybGS.system.js → p-BVitEMYC.system.js} +1 -1
  136. package/dist/baloise-design-system/p-BtgFoKGn.js +1 -1
  137. package/dist/baloise-design-system/{p-1MTD7lsM.js → p-COIM5Kkz.js} +1 -1
  138. package/dist/baloise-design-system/{p-5dg9nJgB.js → p-CgBveYeB.js} +1 -1
  139. package/dist/baloise-design-system/p-CwWHLbPB.system.js +1 -1
  140. package/dist/baloise-design-system/{p-yVWmRk4o.system.js → p-DAsF8QfB.system.js} +1 -1
  141. package/dist/baloise-design-system/p-DNy7adIE.system.js +1 -1
  142. package/dist/baloise-design-system/{p-Cjjfryhf.js → p-ReLIdwsB.js} +1 -1
  143. package/dist/baloise-design-system/{p-5c70477d4e.system.entry.js → p-a2a1ed74fe.system.entry.js} +1 -1
  144. package/dist/baloise-design-system/{p-df0264e119.system.entry.js → p-a32d50871a.system.entry.js} +1 -1
  145. package/dist/baloise-design-system/{p-a4ba08cb91.system.entry.js → p-a3558335f2.system.entry.js} +1 -1
  146. package/dist/baloise-design-system/{p-b0b5fa7a40.entry.js → p-a53c24274c.entry.js} +1 -1
  147. package/dist/baloise-design-system/{p-cf749f385e.entry.js → p-a576422cb2.entry.js} +1 -1
  148. package/dist/baloise-design-system/{p-fdb00a8fdc.entry.js → p-a584c6763e.entry.js} +1 -1
  149. package/dist/baloise-design-system/p-a6135f2559.system.entry.js +1 -0
  150. package/dist/baloise-design-system/{p-93bba463b3.system.entry.js → p-aaf33f152f.system.entry.js} +1 -1
  151. package/dist/baloise-design-system/{p-6da83fc08c.system.entry.js → p-ac1cd5a1e1.system.entry.js} +1 -1
  152. package/dist/baloise-design-system/{p-5e4a2342f3.entry.js → p-b01f9c5651.entry.js} +1 -1
  153. package/dist/baloise-design-system/{p-5439c93408.entry.js → p-b4fa55782e.entry.js} +1 -1
  154. package/dist/baloise-design-system/{p-923685a0b7.system.entry.js → p-b4ff1b324f.system.entry.js} +1 -1
  155. package/dist/baloise-design-system/{p-dda36d324a.entry.js → p-c29bcf4e69.entry.js} +1 -1
  156. package/dist/baloise-design-system/{p-6adbf9b7b0.system.entry.js → p-cb3abec4bd.system.entry.js} +1 -1
  157. package/dist/baloise-design-system/{p-9993f8ad74.system.entry.js → p-cd6d0bfa91.system.entry.js} +1 -1
  158. package/dist/baloise-design-system/{p-84de20be7c.entry.js → p-ce3e34fa95.entry.js} +1 -1
  159. package/dist/baloise-design-system/{p-56535b513e.system.entry.js → p-cf77551018.system.entry.js} +1 -1
  160. package/dist/baloise-design-system/{p-01c556671d.system.entry.js → p-d4252ea848.system.entry.js} +1 -1
  161. package/dist/baloise-design-system/{p-84d321b4f8.entry.js → p-d5365ffe38.entry.js} +1 -1
  162. package/dist/baloise-design-system/{p-94f54b5ec2.system.entry.js → p-d94f439c3b.system.entry.js} +1 -1
  163. package/dist/baloise-design-system/{p-ab8e430432.system.entry.js → p-db2823d02b.system.entry.js} +1 -1
  164. package/dist/baloise-design-system/{p-987050dd20.system.entry.js → p-dcebb4b8a2.system.entry.js} +1 -1
  165. package/dist/baloise-design-system/p-ddd75e43d6.entry.js +1 -0
  166. package/dist/baloise-design-system/{p-469503b436.entry.js → p-def5a43710.entry.js} +1 -1
  167. package/dist/baloise-design-system/{p-a17017ddc0.system.entry.js → p-e125257826.system.entry.js} +1 -1
  168. package/dist/baloise-design-system/{p-77045369a5.system.entry.js → p-e1b3b1f609.system.entry.js} +1 -1
  169. package/dist/baloise-design-system/{p-b1fa4370b0.entry.js → p-e2e7e3c5c4.entry.js} +1 -1
  170. package/dist/baloise-design-system/{p-f2773433fa.system.entry.js → p-e9095ec856.system.entry.js} +1 -1
  171. package/dist/baloise-design-system/p-ed1aad24be.entry.js +1 -0
  172. package/dist/baloise-design-system/{p-440fb2470e.entry.js → p-ee070d06bc.entry.js} +1 -1
  173. package/dist/baloise-design-system/{p-07cd3d2e40.entry.js → p-eeff81381f.entry.js} +1 -1
  174. package/dist/baloise-design-system/{p-e03203e89d.entry.js → p-f217ad88a9.entry.js} +1 -1
  175. package/dist/baloise-design-system/{p-996075a13e.entry.js → p-f2222919fc.entry.js} +1 -1
  176. package/dist/baloise-design-system/{p-31b3a653f9.entry.js → p-f55a98dc20.entry.js} +1 -1
  177. package/dist/baloise-design-system/p-f6238b798a.system.entry.js +1 -0
  178. package/dist/baloise-design-system/{p-b9be7f4ef6.system.entry.js → p-f647a73892.system.entry.js} +1 -1
  179. package/dist/baloise-design-system/{p-3717f4438f.system.entry.js → p-f682c289a1.system.entry.js} +1 -1
  180. package/dist/baloise-design-system/{p-29bc400e5d.system.entry.js → p-f6cb5253aa.system.entry.js} +1 -1
  181. package/dist/baloise-design-system/{p-8ff2a6299d.system.entry.js → p-f8b560b22f.system.entry.js} +1 -1
  182. package/dist/baloise-design-system/{p-1cd3d84388.entry.js → p-f91be8b19a.entry.js} +1 -1
  183. package/dist/baloise-design-system/{p-5c583159db.entry.js → p-fb2960c1b6.entry.js} +1 -1
  184. package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
  185. package/dist/cjs/bal-date-calendar_2.cjs.entry.js +2 -2
  186. package/dist/cjs/bal-dropdown_3.cjs.entry.js +23 -21
  187. package/dist/cjs/bal-field_5.cjs.entry.js +11 -11
  188. package/dist/cjs/bal-file-upload.cjs.entry.js +4 -4
  189. package/dist/cjs/bal-footer.cjs.entry.js +3 -3
  190. package/dist/cjs/bal-form-col_2.cjs.entry.js +3 -3
  191. package/dist/cjs/bal-form.cjs.entry.js +1 -1
  192. package/dist/cjs/bal-heading_2.cjs.entry.js +3 -3
  193. package/dist/cjs/bal-hint_5.cjs.entry.js +6 -6
  194. package/dist/cjs/bal-icon.cjs.entry.js +1 -1
  195. package/dist/cjs/bal-input-group.cjs.entry.js +1 -1
  196. package/dist/cjs/bal-input-slider.cjs.entry.js +3 -3
  197. package/dist/cjs/bal-input-stepper.cjs.entry.js +1 -1
  198. package/dist/cjs/bal-input.cjs.entry.js +1 -1
  199. package/dist/cjs/bal-label.cjs.entry.js +1 -1
  200. package/dist/cjs/bal-list_8.cjs.entry.js +10 -10
  201. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  202. package/dist/cjs/bal-modal_3.cjs.entry.js +7 -7
  203. package/dist/cjs/bal-nav_8.cjs.entry.js +13 -13
  204. package/dist/cjs/bal-navbar_5.cjs.entry.js +8 -8
  205. package/dist/cjs/bal-notices_3.cjs.entry.js +3 -3
  206. package/dist/cjs/bal-notification.cjs.entry.js +1 -1
  207. package/dist/cjs/bal-number-input.cjs.entry.js +1 -1
  208. package/dist/cjs/bal-pagination.cjs.entry.js +7 -7
  209. package/dist/cjs/bal-popup.cjs.entry.js +1 -1
  210. package/dist/cjs/bal-progress-bar.cjs.entry.js +5 -5
  211. package/dist/cjs/bal-radio-icon.cjs.entry.js +1 -1
  212. package/dist/cjs/bal-radio_2.cjs.entry.js +2 -2
  213. package/dist/cjs/bal-segment_2.cjs.entry.js +6 -6
  214. package/dist/cjs/bal-select_2.cjs.entry.js +6 -6
  215. package/dist/cjs/bal-shape.cjs.entry.js +5 -5
  216. package/dist/cjs/bal-sheet.cjs.entry.js +1 -1
  217. package/dist/cjs/bal-spinner.cjs.entry.js +1 -1
  218. package/dist/cjs/bal-stack.cjs.entry.js +1 -1
  219. package/dist/cjs/bal-stage_6.cjs.entry.js +7 -7
  220. package/dist/cjs/bal-step-item.cjs.entry.js +2 -2
  221. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  222. package/dist/cjs/bal-tab-item_2.cjs.entry.js +7 -7
  223. package/dist/cjs/bal-table.cjs.entry.js +1 -1
  224. package/dist/cjs/bal-tag_2.cjs.entry.js +2 -2
  225. package/dist/cjs/bal-textarea.cjs.entry.js +1 -1
  226. package/dist/cjs/bal-time-input.cjs.entry.js +1 -1
  227. package/dist/cjs/bal-tooltip.cjs.entry.js +1 -1
  228. package/dist/cjs/baloise-design-system.cjs.js +1 -1
  229. package/dist/cjs/{breakpoints.decorator-smfz6gUz.js → breakpoints.decorator-byAdfhn7.js} +1 -1
  230. package/dist/cjs/{breakpoints.subject-DxslhN-k.js → breakpoints.subject-CarqIcOv.js} +1 -1
  231. package/dist/cjs/index.cjs.js +2 -2
  232. package/dist/cjs/initialize-CWGvp-PN.js +1 -1
  233. package/dist/cjs/loader.cjs.js +1 -1
  234. package/dist/cjs/{tokens.esm-jKG0Q7mH.js → tokens.esm-wN1fum6F.js} +1 -1
  235. package/dist/cjs/{window-resize.decorator-rHyW41kD.js → window-resize.decorator-DMReD0Er.js} +1 -1
  236. package/dist/collection/components/bal-dropdown/bal-dropdown.js +7 -3
  237. package/dist/collection/components/bal-field/bal-field-control/bal-field-control.js +2 -2
  238. package/dist/collection/components/bal-field/bal-field-hint/bal-field-hint.js +1 -1
  239. package/dist/collection/components/bal-field/bal-field-label/bal-field-label.js +1 -1
  240. package/dist/collection/components/bal-field/bal-field-message/bal-field-message.js +2 -2
  241. package/dist/collection/components/bal-field/bal-field.js +2 -2
  242. package/dist/collection/components/bal-file-upload/bal-file-upload.js +4 -4
  243. package/dist/collection/components/bal-footer/bal-footer.js +3 -3
  244. package/dist/collection/components/bal-form/bal-form.js +1 -1
  245. package/dist/collection/components/bal-form-grid/bal-form-col/bal-form-col.js +2 -2
  246. package/dist/collection/components/bal-form-grid/bal-form-grid.js +1 -1
  247. package/dist/collection/components/bal-heading/bal-heading.js +1 -1
  248. package/dist/collection/components/bal-hint/bal-hint-text/bal-hint-text.js +1 -1
  249. package/dist/collection/components/bal-hint/bal-hint-title/bal-hint-title.js +1 -1
  250. package/dist/collection/components/bal-icon/bal-icon.js +1 -1
  251. package/dist/collection/components/bal-input/bal-input-date/bal-input-date.js +2 -2
  252. package/dist/collection/components/bal-input/bal-input.js +1 -1
  253. package/dist/collection/components/bal-input-group/bal-input-group.js +1 -1
  254. package/dist/collection/components/bal-input-slider/bal-input-slider.js +3 -3
  255. package/dist/collection/components/bal-input-stepper/bal-input-stepper.js +1 -1
  256. package/dist/collection/components/bal-label/bal-label.js +1 -1
  257. package/dist/collection/components/bal-list/bal-list-item-content/bal-list-item-content.js +2 -2
  258. package/dist/collection/components/bal-list/bal-list-item-icon/bal-list-item-icon.js +2 -2
  259. package/dist/collection/components/bal-list/bal-list-item-subtitle/bal-list-item-subtitle.js +1 -1
  260. package/dist/collection/components/bal-list/bal-list-item-title/bal-list-item-title.js +1 -1
  261. package/dist/collection/components/bal-list/bal-list.js +1 -1
  262. package/dist/collection/components/bal-modal/bal-modal-body/bal-modal-body.js +1 -1
  263. package/dist/collection/components/bal-modal/bal-modal-header/bal-modal-header.js +1 -1
  264. package/dist/collection/components/bal-modal/bal-modal.js +5 -5
  265. package/dist/collection/components/bal-nav/bal-nav-link/bal-nav-link.js +2 -2
  266. package/dist/collection/components/bal-nav/bal-nav-link-grid/bal-nav-link-grid.js +1 -1
  267. package/dist/collection/components/bal-nav/bal-nav-link-grid-col/bal-nav-link-grid-col.js +1 -1
  268. package/dist/collection/components/bal-nav/bal-nav-link-group/bal-nav-link-group.js +1 -1
  269. package/dist/collection/components/bal-nav/bal-nav-menu-bar/bal-nav-menu-bar.js +1 -1
  270. package/dist/collection/components/bal-nav/bal-nav-menu-flyout/bal-nav-menu-flyout.js +1 -1
  271. package/dist/collection/components/bal-nav/bal-nav-meta-bar/bal-nav-meta-bar.js +1 -1
  272. package/dist/collection/components/bal-nav/bal-nav.js +2 -2
  273. package/dist/collection/components/bal-navbar/bal-navbar-brand/bal-navbar-brand.js +1 -1
  274. package/dist/collection/components/bal-navbar/bal-navbar-menu/bal-navbar-menu.js +1 -1
  275. package/dist/collection/components/bal-navbar/bal-navbar-menu-end/bal-navbar-menu-end.js +1 -1
  276. package/dist/collection/components/bal-navbar/bal-navbar-menu-start/bal-navbar-menu-start.js +1 -1
  277. package/dist/collection/components/bal-navbar/bal-navbar.js +1 -1
  278. package/dist/collection/components/bal-notices/bal-notices.js +1 -1
  279. package/dist/collection/components/bal-notification/bal-notification.js +1 -1
  280. package/dist/collection/components/bal-number-input/bal-number-input.js +1 -1
  281. package/dist/collection/components/bal-option/bal-option.js +1 -1
  282. package/dist/collection/components/bal-option-list/bal-option-list.js +1 -1
  283. package/dist/collection/components/bal-pagination/bal-pagination.js +4 -4
  284. package/dist/collection/components/bal-popover/bal-popover-content/bal-popover-content.js +1 -1
  285. package/dist/collection/components/bal-popup/bal-popup.js +1 -1
  286. package/dist/collection/components/bal-progress-bar/bal-progress-bar.js +1 -1
  287. package/dist/collection/components/bal-radio/bal-radio-icon/bal-radio-icon.js +1 -1
  288. package/dist/collection/components/bal-radio/bal-radio.js +2 -2
  289. package/dist/collection/components/bal-segment/bal-segment-item/bal-segment-item.js +1 -1
  290. package/dist/collection/components/bal-segment/bal-segment.js +1 -1
  291. package/dist/collection/components/bal-select/bal-select-option/bal-select-option.js +1 -1
  292. package/dist/collection/components/bal-select/bal-select.js +5 -5
  293. package/dist/collection/components/bal-shape/bal-shape.js +4 -4
  294. package/dist/collection/components/bal-sheet/bal-sheet.js +1 -1
  295. package/dist/collection/components/bal-snackbar/bal-snackbar.js +1 -1
  296. package/dist/collection/components/bal-spinner/bal-spinner.js +1 -1
  297. package/dist/collection/components/bal-stack/bal-stack.js +1 -1
  298. package/dist/collection/components/bal-stage/bal-stage-back-link/bal-stage-back-link.js +2 -2
  299. package/dist/collection/components/bal-stage/bal-stage-body/bal-stage-body.js +1 -1
  300. package/dist/collection/components/bal-stage/bal-stage-foot/bal-stage-foot.js +1 -1
  301. package/dist/collection/components/bal-stage/bal-stage-head/bal-stage-head.js +1 -1
  302. package/dist/collection/components/bal-stage/bal-stage-image/bal-stage-image.js +1 -1
  303. package/dist/collection/components/bal-stage/bal-stage.js +1 -1
  304. package/dist/collection/components/bal-steps/bal-step-item/bal-step-item.js +2 -2
  305. package/dist/collection/components/bal-table/bal-table.js +1 -1
  306. package/dist/collection/components/bal-tabs/bal-tab-item/bal-tab-item.js +2 -2
  307. package/dist/collection/components/bal-tabs/bal-tabs.js +2 -2
  308. package/dist/collection/components/bal-tag/bal-tag-group/bal-tag-group.js +1 -1
  309. package/dist/collection/components/bal-tag/bal-tag.js +1 -1
  310. package/dist/collection/components/bal-text/bal-text.js +2 -2
  311. package/dist/collection/components/bal-textarea/bal-textarea.js +1 -1
  312. package/dist/collection/components/bal-time-input/bal-time-input.js +1 -1
  313. package/dist/collection/components/bal-toast/bal-toast.js +1 -1
  314. package/dist/collection/components/bal-tooltip/bal-tooltip.js +1 -1
  315. package/dist/collection/utils/constants/version.constant.js +1 -1
  316. package/dist/collection/utils/dropdown/index.js +1 -2
  317. package/dist/collection/utils/dropdown/value.js +8 -3
  318. package/dist/esm/bal-carousel_2.entry.js +3 -3
  319. package/dist/esm/bal-date-calendar_2.entry.js +2 -2
  320. package/dist/esm/bal-dropdown_3.entry.js +23 -21
  321. package/dist/esm/bal-field_5.entry.js +11 -11
  322. package/dist/esm/bal-file-upload.entry.js +4 -4
  323. package/dist/esm/bal-footer.entry.js +3 -3
  324. package/dist/esm/bal-form-col_2.entry.js +3 -3
  325. package/dist/esm/bal-form.entry.js +1 -1
  326. package/dist/esm/bal-heading_2.entry.js +3 -3
  327. package/dist/esm/bal-hint_5.entry.js +6 -6
  328. package/dist/esm/bal-icon.entry.js +1 -1
  329. package/dist/esm/bal-input-group.entry.js +1 -1
  330. package/dist/esm/bal-input-slider.entry.js +3 -3
  331. package/dist/esm/bal-input-stepper.entry.js +1 -1
  332. package/dist/esm/bal-input.entry.js +1 -1
  333. package/dist/esm/bal-label.entry.js +1 -1
  334. package/dist/esm/bal-list_8.entry.js +10 -10
  335. package/dist/esm/bal-logo.entry.js +3 -3
  336. package/dist/esm/bal-modal_3.entry.js +7 -7
  337. package/dist/esm/bal-nav_8.entry.js +13 -13
  338. package/dist/esm/bal-navbar_5.entry.js +8 -8
  339. package/dist/esm/bal-notices_3.entry.js +3 -3
  340. package/dist/esm/bal-notification.entry.js +1 -1
  341. package/dist/esm/bal-number-input.entry.js +1 -1
  342. package/dist/esm/bal-pagination.entry.js +7 -7
  343. package/dist/esm/bal-popup.entry.js +1 -1
  344. package/dist/esm/bal-progress-bar.entry.js +5 -5
  345. package/dist/esm/bal-radio-icon.entry.js +1 -1
  346. package/dist/esm/bal-radio_2.entry.js +2 -2
  347. package/dist/esm/bal-segment_2.entry.js +6 -6
  348. package/dist/esm/bal-select_2.entry.js +6 -6
  349. package/dist/esm/bal-shape.entry.js +5 -5
  350. package/dist/esm/bal-sheet.entry.js +1 -1
  351. package/dist/esm/bal-spinner.entry.js +1 -1
  352. package/dist/esm/bal-stack.entry.js +1 -1
  353. package/dist/esm/bal-stage_6.entry.js +7 -7
  354. package/dist/esm/bal-step-item.entry.js +2 -2
  355. package/dist/esm/bal-steps.entry.js +3 -3
  356. package/dist/esm/bal-tab-item_2.entry.js +7 -7
  357. package/dist/esm/bal-table.entry.js +1 -1
  358. package/dist/esm/bal-tag_2.entry.js +2 -2
  359. package/dist/esm/bal-textarea.entry.js +1 -1
  360. package/dist/esm/bal-time-input.entry.js +1 -1
  361. package/dist/esm/bal-tooltip.entry.js +1 -1
  362. package/dist/esm/baloise-design-system.js +1 -1
  363. package/dist/esm/{breakpoints.decorator-C53gt7tV.js → breakpoints.decorator-t_yXJIZL.js} +1 -1
  364. package/dist/esm/{breakpoints.subject-BjroUbV7.js → breakpoints.subject-BnQp404Z.js} +1 -1
  365. package/dist/esm/index.js +3 -3
  366. package/dist/esm/initialize-pdWsVO-c.js +1 -1
  367. package/dist/esm/loader.js +1 -1
  368. package/dist/esm/{tokens.esm-DkCu8hIH.js → tokens.esm-Cf90NR4z.js} +1 -1
  369. package/dist/esm/{window-resize.decorator-CNLwHGZp.js → window-resize.decorator-DBJlK-45.js} +1 -1
  370. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  371. package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
  372. package/dist/esm-es5/bal-dropdown_3.entry.js +1 -1
  373. package/dist/esm-es5/bal-field_5.entry.js +1 -1
  374. package/dist/esm-es5/bal-file-upload.entry.js +1 -1
  375. package/dist/esm-es5/bal-footer.entry.js +1 -1
  376. package/dist/esm-es5/bal-form-col_2.entry.js +1 -1
  377. package/dist/esm-es5/bal-form.entry.js +1 -1
  378. package/dist/esm-es5/bal-heading_2.entry.js +1 -1
  379. package/dist/esm-es5/bal-hint_5.entry.js +1 -1
  380. package/dist/esm-es5/bal-icon.entry.js +1 -1
  381. package/dist/esm-es5/bal-input-group.entry.js +1 -1
  382. package/dist/esm-es5/bal-input-slider.entry.js +1 -1
  383. package/dist/esm-es5/bal-input-stepper.entry.js +1 -1
  384. package/dist/esm-es5/bal-input.entry.js +1 -1
  385. package/dist/esm-es5/bal-label.entry.js +1 -1
  386. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  387. package/dist/esm-es5/bal-logo.entry.js +1 -1
  388. package/dist/esm-es5/bal-modal_3.entry.js +1 -1
  389. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  390. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  391. package/dist/esm-es5/bal-notices_3.entry.js +1 -1
  392. package/dist/esm-es5/bal-notification.entry.js +1 -1
  393. package/dist/esm-es5/bal-number-input.entry.js +1 -1
  394. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  395. package/dist/esm-es5/bal-popup.entry.js +1 -1
  396. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  397. package/dist/esm-es5/bal-radio-icon.entry.js +1 -1
  398. package/dist/esm-es5/bal-radio_2.entry.js +1 -1
  399. package/dist/esm-es5/bal-segment_2.entry.js +1 -1
  400. package/dist/esm-es5/bal-select_2.entry.js +1 -1
  401. package/dist/esm-es5/bal-shape.entry.js +1 -1
  402. package/dist/esm-es5/bal-sheet.entry.js +1 -1
  403. package/dist/esm-es5/bal-spinner.entry.js +1 -1
  404. package/dist/esm-es5/bal-stack.entry.js +1 -1
  405. package/dist/esm-es5/bal-stage_6.entry.js +1 -1
  406. package/dist/esm-es5/bal-step-item.entry.js +1 -1
  407. package/dist/esm-es5/bal-steps.entry.js +1 -1
  408. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  409. package/dist/esm-es5/bal-table.entry.js +1 -1
  410. package/dist/esm-es5/bal-tag_2.entry.js +1 -1
  411. package/dist/esm-es5/bal-textarea.entry.js +1 -1
  412. package/dist/esm-es5/bal-time-input.entry.js +1 -1
  413. package/dist/esm-es5/bal-tooltip.entry.js +1 -1
  414. package/dist/esm-es5/baloise-design-system.js +1 -1
  415. package/dist/esm-es5/breakpoints.decorator-t_yXJIZL.js +1 -0
  416. package/dist/esm-es5/{breakpoints.subject-BjroUbV7.js → breakpoints.subject-BnQp404Z.js} +1 -1
  417. package/dist/esm-es5/index.js +1 -1
  418. package/dist/esm-es5/initialize-pdWsVO-c.js +1 -1
  419. package/dist/esm-es5/loader.js +1 -1
  420. package/dist/esm-es5/{window-resize.decorator-CNLwHGZp.js → window-resize.decorator-DBJlK-45.js} +1 -1
  421. package/dist/types/utils/dropdown/index.d.ts +1 -2
  422. package/dist/types/utils/dropdown/value.d.ts +2 -5
  423. package/package.json +6 -6
  424. package/dist/baloise-design-system/p-0dadba9150.system.entry.js +0 -1
  425. package/dist/baloise-design-system/p-17fb47d0d4.entry.js +0 -1
  426. package/dist/baloise-design-system/p-1f011724dd.entry.js +0 -1
  427. package/dist/baloise-design-system/p-2d57df519d.entry.js +0 -1
  428. package/dist/baloise-design-system/p-4c12fc1e8f.system.entry.js +0 -1
  429. package/dist/baloise-design-system/p-60ab46a87c.entry.js +0 -1
  430. package/dist/baloise-design-system/p-80cae9282e.system.entry.js +0 -1
  431. package/dist/baloise-design-system/p-8670cb3845.entry.js +0 -1
  432. package/dist/baloise-design-system/p-B-QBxqhr.system.js +0 -1
  433. package/dist/baloise-design-system/p-ccf29475c6.entry.js +0 -1
  434. package/dist/baloise-design-system/p-f348ec6012.entry.js +0 -1
  435. package/dist/collection/utils/dropdown/option-list.js +0 -8
  436. package/dist/esm-es5/breakpoints.decorator-C53gt7tV.js +0 -1
  437. package/dist/types/utils/dropdown/option-list.d.ts +0 -17
  438. /package/dist/baloise-design-system/{p-DkCu8hIH.js → p-Cf90NR4z.js} +0 -0
  439. /package/dist/baloise-design-system/{p-DBjFnS0q.system.js → p-LFV9NiI-.system.js} +0 -0
  440. /package/dist/esm-es5/{tokens.esm-DkCu8hIH.js → tokens.esm-Cf90NR4z.js} +0 -0
@@ -0,0 +1,504 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { _ as __decorate, a as __metadata } from './tslib.es6.js';
3
+ import { i as isNil } from './index2.js';
4
+ import { a as ariaBooleanToString } from './aria.js';
5
+ import { i as inheritAttributes } from './attributes.js';
6
+ import { B as BEM } from './bem.js';
7
+ import { d as defaultBalAriaForm } from './form.js';
8
+ import { b as waitAfterFramePaint, r as raf } from './helpers.js';
9
+ import { L as Logger } from './log.js';
10
+ import { i as includes, s as startsWith } from './utils.js';
11
+
12
+ const balOptionListCss = ".bal-option-list{display:block;position:relative;width:100%;list-style:none;margin:0;outline:0;max-height:var(--bal-option-list-max-height);border-radius:var(--bal-radius-normal);overflow:hidden auto}";
13
+
14
+ const OptionList = /*@__PURE__*/ proxyCustomElement(class OptionList extends HTMLElement {
15
+ constructor(registerHost) {
16
+ super();
17
+ if (registerHost !== false) {
18
+ this.__registerHost();
19
+ }
20
+ this.inputId = `bal-option-list-${balOptionListIds++}`;
21
+ this.inheritAttributes = {};
22
+ this.ariaForm = defaultBalAriaForm;
23
+ /**
24
+ * PUBLIC PROPERTY API
25
+ * ------------------------------------------------------
26
+ */
27
+ /**
28
+ * If `true` the list supports multiple selections
29
+ */
30
+ this.multiple = false;
31
+ /**
32
+ * If `true`, the user cannot interact with the option.
33
+ */
34
+ this.disabled = false;
35
+ /**
36
+ * If `true`, the user must fill in a value before submitting a form.
37
+ */
38
+ this.required = false;
39
+ /**
40
+ * Defines the focused option with his index value
41
+ */
42
+ this.focusIndex = -1;
43
+ /**
44
+ * Defines the filter logic of the list
45
+ */
46
+ this.filter = 'includes';
47
+ /**
48
+ * Defines the max height of the list element
49
+ */
50
+ this.contentHeight = 262;
51
+ }
52
+ createLogger(log) {
53
+ this.log = log;
54
+ }
55
+ contentHeightChanged(value) {
56
+ if (value === undefined) {
57
+ this.el.style.removeProperty('--bal-option-list-max-height');
58
+ }
59
+ else {
60
+ this.el.style.setProperty('--bal-option-list-max-height', `${value}px`);
61
+ }
62
+ }
63
+ /**
64
+ * LIFECYCLE
65
+ * ------------------------------------------------------
66
+ */
67
+ componentDidLoad() {
68
+ this.contentHeightChanged(this.contentHeight);
69
+ }
70
+ componentWillRender() {
71
+ this.inheritAttributes = inheritAttributes(this.el, ['aria-multiselectable', 'aria-labelledby']);
72
+ }
73
+ /**
74
+ * LISTENERS
75
+ * ------------------------------------------------------
76
+ */
77
+ listenToMouseEnter(ev) {
78
+ const options = this.options;
79
+ const indexToFocus = this.getOptionIndex(options, ev.detail.value);
80
+ if (indexToFocus !== undefined) {
81
+ this.updateFocus(options, indexToFocus);
82
+ }
83
+ }
84
+ listenToOptionChange({ detail }) {
85
+ if (!this.multiple) {
86
+ this.options.filter(option => option.value !== detail.value).forEach(option => (option.selected = false));
87
+ }
88
+ }
89
+ /**
90
+ * PUBLIC METHODS
91
+ * ------------------------------------------------------
92
+ */
93
+ /**
94
+ * Focus the selected visible option in the list, if no option is selected it selects the first one
95
+ */
96
+ async focusSelected() {
97
+ const options = this.options;
98
+ const indexToFocus = this.getSelectedOptionIndex(options);
99
+ if (indexToFocus > 0) {
100
+ this.updateFocus(options, indexToFocus);
101
+ await waitAfterFramePaint();
102
+ return indexToFocus;
103
+ }
104
+ else {
105
+ return await this.focusFirst();
106
+ }
107
+ }
108
+ /**
109
+ * Focus the first visible option in the list
110
+ * @returns focusIndex
111
+ */
112
+ async focusFirst() {
113
+ const options = this.options;
114
+ const indexToFocus = this.getFirstOptionIndex(options);
115
+ this.updateFocus(options, indexToFocus);
116
+ const option = options[indexToFocus];
117
+ this.updateScrollTopPosition(option);
118
+ await waitAfterFramePaint();
119
+ return indexToFocus;
120
+ }
121
+ /**
122
+ * Focus the last visible option in the list
123
+ * @returns focusIndex
124
+ */
125
+ async focusLast() {
126
+ const options = this.options;
127
+ const indexToFocus = this.getLastOptionIndex(options);
128
+ this.updateFocus(options, indexToFocus);
129
+ const option = options[indexToFocus];
130
+ this.updateScrollBottomPosition(option);
131
+ await waitAfterFramePaint();
132
+ return indexToFocus;
133
+ }
134
+ /**
135
+ * Focus the next visible option in the list
136
+ * @returns focusIndex
137
+ */
138
+ async focusNext() {
139
+ const options = this.options;
140
+ const indexToFocus = this.getNextOptionIndex(options);
141
+ this.updateFocus(options, indexToFocus);
142
+ const option = options[indexToFocus];
143
+ this.updateScrollBottomPosition(option);
144
+ await waitAfterFramePaint();
145
+ return indexToFocus;
146
+ }
147
+ /**
148
+ * Focus the previous visible option in the list
149
+ * @returns focusIndex
150
+ */
151
+ async focusPrevious() {
152
+ const options = this.options;
153
+ const indexToFocus = this.getPreviousOptionIndex(options);
154
+ this.updateFocus(options, indexToFocus);
155
+ const option = options[indexToFocus];
156
+ this.updateScrollTopPosition(option);
157
+ await waitAfterFramePaint();
158
+ return indexToFocus;
159
+ }
160
+ /**
161
+ * Focus the option with the label that starts with the search property
162
+ * @returns focusIndex
163
+ */
164
+ async focusByLabel(search, config) {
165
+ const options = this.options;
166
+ const indexToFocus = this.getOptionIndexByLabel(options, search);
167
+ this.updateFocus(options, indexToFocus);
168
+ const option = options[indexToFocus];
169
+ this.updateScrollTopPosition(option);
170
+ await waitAfterFramePaint();
171
+ if (config.select) {
172
+ await option.select();
173
+ }
174
+ return indexToFocus;
175
+ }
176
+ /**
177
+ * Filter the options by the given filter property and hides options
178
+ * @returns focusIndex
179
+ */
180
+ async filterByContent(search) {
181
+ const options = this.allOptions;
182
+ this.filterOptions(options, search);
183
+ await waitAfterFramePaint();
184
+ return this.focusFirst();
185
+ }
186
+ /**
187
+ * Shows or hides all options
188
+ */
189
+ async resetHidden(hidden = false) {
190
+ this.options.forEach(option => (option.hidden = hidden));
191
+ await waitAfterFramePaint();
192
+ this.resetFocus();
193
+ }
194
+ /**
195
+ * Selects or deselects all options
196
+ */
197
+ async resetSelected(selected = false) {
198
+ this.options.forEach(option => (option.selected = selected));
199
+ await waitAfterFramePaint();
200
+ }
201
+ /**
202
+ * Updates options
203
+ */
204
+ async updateSelected(values) {
205
+ this.options.forEach(option => (option.selected = values.includes(option.value)));
206
+ await waitAfterFramePaint();
207
+ }
208
+ /**
209
+ * Resets the focus index to pristine and scrolls to the top of the list
210
+ */
211
+ async resetFocus() {
212
+ const options = this.options;
213
+ const indexToFocus = -1;
214
+ this.updateFocus(options, indexToFocus);
215
+ this.scrollTo(0);
216
+ await waitAfterFramePaint();
217
+ return indexToFocus;
218
+ }
219
+ /**
220
+ * Returns a list of option values
221
+ */
222
+ async getSelectedValues() {
223
+ const options = this.options;
224
+ return options.filter(option => option.selected).map(option => option.value);
225
+ }
226
+ /**
227
+ * Returns a list of option labels
228
+ */
229
+ async getSelectedOptions(values) {
230
+ const options = this.options;
231
+ if (values && values.length > 0) {
232
+ return options.filter(option => values.includes(option.value)).map(option => option);
233
+ }
234
+ return options.filter(option => option.selected).map(option => option);
235
+ }
236
+ /**
237
+ * Returns a list of options
238
+ */
239
+ async getValues() {
240
+ return this.options.map(option => option.value);
241
+ }
242
+ /**
243
+ * Returns a list of options
244
+ */
245
+ async getLabels() {
246
+ return this.options.map(option => option.label);
247
+ }
248
+ /**
249
+ * Returns a list of accessible options
250
+ */
251
+ async getOptions() {
252
+ return this.options.filter(o => !o.disabled || !o.hidden);
253
+ }
254
+ /**
255
+ * Selects the option with the current focus
256
+ */
257
+ async selectByFocus() {
258
+ const options = this.options;
259
+ const option = options[this.focusIndex];
260
+ if (option) {
261
+ if (this.multiple) {
262
+ option.select(!option.selected);
263
+ }
264
+ else {
265
+ option.select(true);
266
+ }
267
+ }
268
+ }
269
+ /**
270
+ * @internal
271
+ */
272
+ async setAriaForm(ariaForm) {
273
+ this.ariaForm = Object.assign({}, ariaForm);
274
+ }
275
+ /**
276
+ * GETTERS
277
+ * ------------------------------------------------------
278
+ */
279
+ get options() {
280
+ return Array.from(this.el.querySelectorAll('bal-option')).filter(o => !o.hidden);
281
+ }
282
+ get allOptions() {
283
+ return Array.from(this.el.querySelectorAll('bal-option'));
284
+ }
285
+ /**
286
+ * PRIVATE METHODS
287
+ * ------------------------------------------------------
288
+ */
289
+ filterOptions(options, search) {
290
+ const filteredOptions = [];
291
+ const filter = this.filter === 'includes' ? includes : startsWith;
292
+ for (let index = 0; index < options.length; index++) {
293
+ const option = options[index];
294
+ const content = option.textContent || '';
295
+ if (filter(content, search)) {
296
+ filteredOptions.push(option);
297
+ option.hidden = false;
298
+ }
299
+ else {
300
+ option.hidden = true;
301
+ }
302
+ }
303
+ return filteredOptions;
304
+ }
305
+ isOptionVisible(option) {
306
+ const visibleHeight = this.el.clientHeight;
307
+ const topPosition = this.el.scrollTop;
308
+ const bottomPosition = topPosition + visibleHeight;
309
+ const isVisible = topPosition <= option.offsetTop && option.offsetTop + option.clientHeight <= bottomPosition;
310
+ return isVisible;
311
+ }
312
+ updateScrollTopPosition(option) {
313
+ if (option) {
314
+ const isVisible = this.isOptionVisible(option);
315
+ if (!isVisible) {
316
+ this.scrollTo(this.getScrollTopForTopPosition(option));
317
+ }
318
+ }
319
+ }
320
+ updateScrollBottomPosition(option) {
321
+ if (option) {
322
+ const isVisible = this.isOptionVisible(option);
323
+ if (!isVisible) {
324
+ this.scrollTo(this.getScrollTopForBottomPosition(option));
325
+ }
326
+ }
327
+ }
328
+ getScrollTopForTopPosition(option) {
329
+ const topPosition = option.offsetTop;
330
+ const scrollTop = topPosition;
331
+ if (scrollTop < 0) {
332
+ return 0;
333
+ }
334
+ return scrollTop;
335
+ }
336
+ getScrollTopForBottomPosition(option) {
337
+ const visibleHeight = this.el.clientHeight;
338
+ const bottomPosition = option.offsetTop + option.clientHeight;
339
+ const scrollTop = bottomPosition - visibleHeight;
340
+ if (scrollTop < 0) {
341
+ return 0;
342
+ }
343
+ return scrollTop;
344
+ }
345
+ async scrollTo(scrollTop) {
346
+ if (scrollTop !== undefined && scrollTop !== null) {
347
+ if (this.focusRaf !== undefined) {
348
+ cancelAnimationFrame(this.focusRaf);
349
+ }
350
+ this.focusRaf = raf(async () => {
351
+ this.el.scrollTop = scrollTop;
352
+ });
353
+ }
354
+ }
355
+ updateFocus(options, indexToFocus) {
356
+ this.focusIndex = indexToFocus;
357
+ for (let index = 0; index < options.length; index++) {
358
+ const option = options[index];
359
+ option.focused = index === indexToFocus;
360
+ }
361
+ }
362
+ getOptionIndex(options, value) {
363
+ for (let index = 0; index < options.length; index++) {
364
+ const option = options[index];
365
+ if (option.value === value) {
366
+ return index;
367
+ }
368
+ }
369
+ return undefined;
370
+ }
371
+ getSelectedOptionIndex(options) {
372
+ for (let index = 0; index < options.length; index++) {
373
+ const option = options[index];
374
+ if (option.selected && !option.hidden) {
375
+ return index;
376
+ }
377
+ }
378
+ return this.focusIndex;
379
+ }
380
+ getFirstOptionIndex(options) {
381
+ for (let index = 0; index < options.length; index++) {
382
+ const option = options[index];
383
+ if (!option.disabled && !option.hidden) {
384
+ return index;
385
+ }
386
+ }
387
+ return this.focusIndex;
388
+ }
389
+ getNextOptionIndex(options, index = this.focusIndex) {
390
+ if (index < 0) {
391
+ return this.getFirstOptionIndex(options);
392
+ }
393
+ const lastIndex = this.getLength(options);
394
+ let newIndex = index;
395
+ if (index < lastIndex) {
396
+ newIndex = index + 1;
397
+ if (options[newIndex].disabled) {
398
+ return this.getNextOptionIndex(options, newIndex);
399
+ }
400
+ }
401
+ return newIndex;
402
+ }
403
+ getPreviousOptionIndex(options, index = this.focusIndex) {
404
+ const firstIndex = this.getFirstOptionIndex(options);
405
+ if (index <= firstIndex) {
406
+ return firstIndex;
407
+ }
408
+ let newIndex = index;
409
+ newIndex = index - 1;
410
+ if (options[newIndex].disabled) {
411
+ return this.getPreviousOptionIndex(options, newIndex);
412
+ }
413
+ return newIndex;
414
+ }
415
+ getLastOptionIndex(options) {
416
+ for (let index = options.length - 1; index >= 0; index--) {
417
+ const option = options[index];
418
+ if (!option.disabled) {
419
+ return index;
420
+ }
421
+ }
422
+ return this.focusIndex;
423
+ }
424
+ getOptionIndexByLabel(options, label) {
425
+ if (label === undefined || label === '') {
426
+ return this.focusIndex;
427
+ }
428
+ const option = options.find(o => startsWith(o.label || '', label));
429
+ if (!isNil(option) && option.id) {
430
+ return options.indexOf(option);
431
+ }
432
+ return this.focusIndex;
433
+ }
434
+ getLength(options) {
435
+ const indexes = options.map((option, index) => (option.disabled ? 0 : index));
436
+ const length = Math.max(...indexes);
437
+ return length;
438
+ }
439
+ /**
440
+ * RENDER
441
+ * ------------------------------------------------------
442
+ */
443
+ render() {
444
+ const block = BEM.block('option-list');
445
+ const labelledby = this.labelledby || this.ariaForm.labelId;
446
+ return (h(Host, { key: 'bcb9ee55aefe68beac309225d1127524f327f9da', class: Object.assign({}, block.class()), id: this.inputId }, h("div", Object.assign({ key: 'ac14c8a5615c6497569ca0aa8436dda3924babf6', role: "listbox", "aria-labelledby": labelledby, "aria-disabled": ariaBooleanToString(this.disabled), class: Object.assign({}, block.element('container').class()) }, this.inheritAttributes), h("slot", { key: '869656387e53fd832b45141cb3b5b89684e61727' }))));
447
+ }
448
+ get el() { return this; }
449
+ static get watchers() { return {
450
+ "contentHeight": ["contentHeightChanged"]
451
+ }; }
452
+ static get style() { return balOptionListCss; }
453
+ }, [260, "bal-option-list", {
454
+ "multiple": [4],
455
+ "disabled": [4],
456
+ "required": [4],
457
+ "focusIndex": [1026, "focus-index"],
458
+ "labelledby": [1],
459
+ "filter": [1],
460
+ "contentHeight": [2, "content-height"],
461
+ "ariaForm": [32],
462
+ "focusSelected": [64],
463
+ "focusFirst": [64],
464
+ "focusLast": [64],
465
+ "focusNext": [64],
466
+ "focusPrevious": [64],
467
+ "focusByLabel": [64],
468
+ "filterByContent": [64],
469
+ "resetHidden": [64],
470
+ "resetSelected": [64],
471
+ "updateSelected": [64],
472
+ "resetFocus": [64],
473
+ "getSelectedValues": [64],
474
+ "getSelectedOptions": [64],
475
+ "getValues": [64],
476
+ "getLabels": [64],
477
+ "getOptions": [64],
478
+ "selectByFocus": [64],
479
+ "setAriaForm": [64]
480
+ }, [[1, "balOptionFocus", "listenToMouseEnter"], [0, "balOptionChange", "listenToOptionChange"]], {
481
+ "contentHeight": ["contentHeightChanged"]
482
+ }]);
483
+ __decorate([
484
+ Logger('bal-option-list'),
485
+ __metadata("design:type", Function),
486
+ __metadata("design:paramtypes", [Function]),
487
+ __metadata("design:returntype", void 0)
488
+ ], OptionList.prototype, "createLogger", null);
489
+ let balOptionListIds = 0;
490
+ function defineCustomElement() {
491
+ if (typeof customElements === "undefined") {
492
+ return;
493
+ }
494
+ const components = ["bal-option-list"];
495
+ components.forEach(tagName => { switch (tagName) {
496
+ case "bal-option-list":
497
+ if (!customElements.get(tagName)) {
498
+ customElements.define(tagName, OptionList);
499
+ }
500
+ break;
501
+ } });
502
+ }
503
+
504
+ export { OptionList as O, defineCustomElement as d };