@baloise/ds-core 16.5.0 → 16.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/components/bal-field.js +3 -0
  2. package/components/bal-input-date2.js +2 -3
  3. package/components/bal-input.js +1 -1
  4. package/components/bal-number-input.js +1 -1
  5. package/components/bal-segment-item.js +64 -47
  6. package/components/bal-segment.js +61 -17
  7. package/components/bal-textarea.js +1 -1
  8. package/components/bal-time-input.js +1 -1
  9. package/components/form-input.js +14 -1
  10. package/components/index.js +1 -1
  11. package/components/tokens.esm.js +1 -1
  12. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  13. package/dist/baloise-design-system/index.esm.js +1 -1
  14. package/dist/baloise-design-system/{p-dd30661db2.system.entry.js → p-00014af866.system.entry.js} +1 -1
  15. package/dist/baloise-design-system/{p-b0c22ff9d1.entry.js → p-08b0e345a2.entry.js} +1 -1
  16. package/dist/baloise-design-system/{p-3eb68d7e.js → p-0db6b19e.js} +1 -1
  17. package/dist/baloise-design-system/{p-9bb8778cdc.system.entry.js → p-10c13a369c.system.entry.js} +1 -1
  18. package/dist/baloise-design-system/p-1509eaa7.system.js +1 -1
  19. package/dist/baloise-design-system/{p-09ea5913.js → p-15a85377.js} +1 -1
  20. package/dist/baloise-design-system/p-15c5fe4d6d.system.entry.js +1 -0
  21. package/dist/baloise-design-system/{p-cda868a6a5.entry.js → p-16b50b08e4.entry.js} +1 -1
  22. package/dist/baloise-design-system/{p-5fae3f5478.entry.js → p-27bc71c322.entry.js} +1 -1
  23. package/dist/baloise-design-system/{p-0530e008e9.system.entry.js → p-2aa4f352d9.system.entry.js} +1 -1
  24. package/dist/baloise-design-system/{p-8080a1192c.system.entry.js → p-2e498736fc.system.entry.js} +1 -1
  25. package/dist/baloise-design-system/{p-6e3a79cce0.system.entry.js → p-2e8508812d.system.entry.js} +1 -1
  26. package/dist/baloise-design-system/{p-f798011b48.system.entry.js → p-2ea7550d1b.system.entry.js} +1 -1
  27. package/dist/baloise-design-system/{p-380aabd5bc.entry.js → p-3180888825.entry.js} +1 -1
  28. package/dist/baloise-design-system/{p-305cffd8aa.entry.js → p-342b27632b.entry.js} +1 -1
  29. package/dist/baloise-design-system/{p-39bf8adcde.entry.js → p-34671b9410.entry.js} +1 -1
  30. package/dist/baloise-design-system/{p-e187b9de.system.js → p-368bd6ac.system.js} +1 -1
  31. package/dist/baloise-design-system/p-449ffc7a7e.entry.js +1 -0
  32. package/dist/baloise-design-system/{p-0ab43941ba.entry.js → p-462b20f382.entry.js} +1 -1
  33. package/dist/baloise-design-system/{p-f5940253.js → p-4ae121b6.js} +1 -1
  34. package/dist/baloise-design-system/p-4f083c5352.entry.js +1 -0
  35. package/dist/baloise-design-system/{p-df40272425.system.entry.js → p-52a4a89073.system.entry.js} +1 -1
  36. package/dist/baloise-design-system/p-54f81c32.js +1 -1
  37. package/dist/baloise-design-system/{p-4809d5c4.system.js → p-590da25b.system.js} +1 -1
  38. package/dist/baloise-design-system/{p-e137e273b7.system.entry.js → p-5b5d1c626d.system.entry.js} +1 -1
  39. package/dist/baloise-design-system/{p-71588db3.system.js → p-5c0b0099.system.js} +1 -1
  40. package/dist/baloise-design-system/{p-3befc6f9.system.js → p-5de0bd8a.system.js} +1 -1
  41. package/dist/baloise-design-system/{p-0fb6cbda.system.js → p-60a6af04.system.js} +1 -1
  42. package/dist/baloise-design-system/{p-d3fabdb142.system.entry.js → p-60e74d3515.system.entry.js} +1 -1
  43. package/dist/baloise-design-system/p-6139ff78d7.system.entry.js +1 -0
  44. package/dist/baloise-design-system/{p-47a8ad4d7a.system.entry.js → p-619afa0ba5.system.entry.js} +1 -1
  45. package/dist/baloise-design-system/{p-4192ad4350.entry.js → p-63c685b62d.entry.js} +1 -1
  46. package/dist/baloise-design-system/{p-77350b27fc.entry.js → p-648814edf8.entry.js} +1 -1
  47. package/dist/baloise-design-system/{p-2905abdfb8.entry.js → p-663cc3242c.entry.js} +1 -1
  48. package/dist/baloise-design-system/{p-2db4ff4c5b.entry.js → p-6f18ca5500.entry.js} +1 -1
  49. package/dist/baloise-design-system/{p-12bb6ea3e7.system.entry.js → p-760797ae02.system.entry.js} +1 -1
  50. package/dist/baloise-design-system/{p-190b5cd469.entry.js → p-784c10d48f.entry.js} +1 -1
  51. package/dist/baloise-design-system/p-7957c3c0.system.js +1 -0
  52. package/dist/baloise-design-system/{p-8e17b76e7c.system.entry.js → p-7d2709b193.system.entry.js} +1 -1
  53. package/dist/baloise-design-system/{p-7c586fb89f.entry.js → p-80e59744a7.entry.js} +1 -1
  54. package/dist/baloise-design-system/{p-a7e5ee75e2.entry.js → p-82333c3ce3.entry.js} +1 -1
  55. package/dist/baloise-design-system/{p-bcb892a723.system.entry.js → p-82afff07ac.system.entry.js} +1 -1
  56. package/dist/baloise-design-system/{p-488c4a8ce1.entry.js → p-83c70a6b53.entry.js} +1 -1
  57. package/dist/baloise-design-system/{p-f62d0ccdd1.system.entry.js → p-8613444e15.system.entry.js} +1 -1
  58. package/dist/baloise-design-system/{p-9658f4a66f.entry.js → p-898f7862e4.entry.js} +1 -1
  59. package/dist/baloise-design-system/p-8f89168b60.system.entry.js +1 -0
  60. package/dist/baloise-design-system/{p-88eb14fd.system.js → p-910b2f3d.system.js} +1 -1
  61. package/dist/baloise-design-system/{p-3818fa189f.system.entry.js → p-959fc8c170.system.entry.js} +1 -1
  62. package/dist/baloise-design-system/{p-ecab0d67d5.entry.js → p-9f5eda0e22.entry.js} +1 -1
  63. package/dist/baloise-design-system/{p-9f54cac588.system.entry.js → p-a7de2305e0.system.entry.js} +1 -1
  64. package/dist/baloise-design-system/{p-c0153f8edf.system.entry.js → p-ac6d5570d8.system.entry.js} +1 -1
  65. package/dist/baloise-design-system/{p-4fe64c3ec6.system.entry.js → p-aed4d3ac0f.system.entry.js} +1 -1
  66. package/dist/baloise-design-system/{p-372474e989.system.entry.js → p-b4941441f4.system.entry.js} +1 -1
  67. package/dist/baloise-design-system/{p-bee13e834e.entry.js → p-b4c5b5e53f.entry.js} +1 -1
  68. package/dist/baloise-design-system/p-b60576a064.entry.js +1 -0
  69. package/dist/baloise-design-system/{p-853fe65e14.system.entry.js → p-b7ceb9e59e.system.entry.js} +1 -1
  70. package/dist/baloise-design-system/{p-caec1f9e.js → p-b7cef472.js} +1 -1
  71. package/dist/baloise-design-system/p-bcca1ed3.system.js +1 -1
  72. package/dist/baloise-design-system/{p-8f77c423ad.entry.js → p-be366c8428.entry.js} +1 -1
  73. package/dist/baloise-design-system/{p-cafe624e35.entry.js → p-c00e0f64c8.entry.js} +1 -1
  74. package/dist/baloise-design-system/{p-6c2bf02eb3.entry.js → p-c442bb2db2.entry.js} +1 -1
  75. package/dist/baloise-design-system/{p-a5ee486a2b.entry.js → p-c4e11d3813.entry.js} +1 -1
  76. package/dist/baloise-design-system/{p-420d88737c.entry.js → p-c539ee8edf.entry.js} +1 -1
  77. package/dist/baloise-design-system/{p-407ffd9c55.entry.js → p-c716d30de1.entry.js} +1 -1
  78. package/dist/baloise-design-system/{p-7c7e593e07.entry.js → p-c7338c255f.entry.js} +1 -1
  79. package/dist/baloise-design-system/p-cfa901cb.js +1 -0
  80. package/dist/baloise-design-system/{p-0639833837.system.entry.js → p-d800ecde35.system.entry.js} +1 -1
  81. package/dist/baloise-design-system/{p-fb0af77320.system.entry.js → p-d8a71bc5b4.system.entry.js} +1 -1
  82. package/dist/baloise-design-system/{p-d7d6937d59.system.entry.js → p-d94b2cb869.system.entry.js} +1 -1
  83. package/dist/baloise-design-system/{p-3801afd625.entry.js → p-d9f2d48be1.entry.js} +1 -1
  84. package/dist/baloise-design-system/p-dd162dc12e.system.entry.js +1 -0
  85. package/dist/baloise-design-system/{p-ad9a7657.js → p-de08fd27.js} +1 -1
  86. package/dist/baloise-design-system/{p-d1b16f9cc2.entry.js → p-dec8453a4d.entry.js} +1 -1
  87. package/dist/baloise-design-system/{p-e1ccb7023c.system.entry.js → p-e227dcfaa1.system.entry.js} +1 -1
  88. package/dist/baloise-design-system/{p-f03e63bd1e.system.entry.js → p-e2316d2aea.system.entry.js} +1 -1
  89. package/dist/baloise-design-system/p-e45eb6121d.system.entry.js +1 -0
  90. package/dist/baloise-design-system/{p-ef916aafa5.entry.js → p-e6162b978e.entry.js} +1 -1
  91. package/dist/baloise-design-system/{p-d059465399.system.entry.js → p-e7bcca66c5.system.entry.js} +1 -1
  92. package/dist/baloise-design-system/p-e829652c7a.entry.js +1 -0
  93. package/dist/baloise-design-system/p-e833841822.entry.js +1 -0
  94. package/dist/baloise-design-system/{p-2cd1f1dedb.entry.js → p-e8cab53413.entry.js} +1 -1
  95. package/dist/baloise-design-system/p-ec044ce124.system.entry.js +1 -0
  96. package/dist/baloise-design-system/{p-23b7426d09.system.entry.js → p-efe5a8806d.system.entry.js} +1 -1
  97. package/dist/baloise-design-system/{p-1659bb968c.system.entry.js → p-f00b5e9fa4.system.entry.js} +1 -1
  98. package/dist/baloise-design-system/p-f22c8e0c59.entry.js +1 -0
  99. package/dist/baloise-design-system/{p-445d2e1c70.system.entry.js → p-f3bb565972.system.entry.js} +1 -1
  100. package/dist/baloise-design-system/{p-b8251b8f68.system.entry.js → p-fad86a959d.system.entry.js} +1 -1
  101. package/dist/baloise-design-system/{p-f819d47031.entry.js → p-fcfee1c692.entry.js} +1 -1
  102. package/dist/cjs/bal-accordion_4.cjs.entry.js +1 -1
  103. package/dist/cjs/bal-carousel_2.cjs.entry.js +4 -4
  104. package/dist/cjs/bal-checkbox-button.cjs.entry.js +1 -1
  105. package/dist/cjs/bal-checkbox_2.cjs.entry.js +1 -1
  106. package/dist/cjs/bal-content.cjs.entry.js +56 -0
  107. package/dist/cjs/bal-date-calendar-cell.cjs.entry.js +1 -1
  108. package/dist/cjs/bal-date-calendar_2.cjs.entry.js +2 -3
  109. package/dist/cjs/bal-date.cjs.entry.js +1 -1
  110. package/dist/cjs/bal-datepicker.cjs.entry.js +4 -4
  111. package/dist/cjs/bal-dropdown.cjs.entry.js +1 -1
  112. package/dist/cjs/bal-field_5.cjs.entry.js +3 -0
  113. package/dist/cjs/bal-file-upload.cjs.entry.js +1 -1
  114. package/dist/cjs/bal-footer.cjs.entry.js +1 -1
  115. package/dist/cjs/{bal-popover_2.cjs.entry.js → bal-hint_5.cjs.entry.js} +172 -3
  116. package/dist/cjs/bal-input-slider.cjs.entry.js +1 -1
  117. package/dist/cjs/bal-input-stepper.cjs.entry.js +1 -1
  118. package/dist/cjs/bal-input.cjs.entry.js +1 -1
  119. package/dist/cjs/{bal-content_2.cjs.entry.js → bal-label.cjs.entry.js} +0 -46
  120. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  121. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  122. package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
  123. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  124. package/dist/cjs/bal-number-input.cjs.entry.js +1 -1
  125. package/dist/cjs/bal-option_2.cjs.entry.js +1 -1
  126. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  127. package/dist/cjs/bal-popup.cjs.entry.js +1 -1
  128. package/dist/cjs/bal-progress-bar.cjs.entry.js +5 -5
  129. package/dist/cjs/bal-radio-button.cjs.entry.js +1 -1
  130. package/dist/cjs/bal-radio_2.cjs.entry.js +1 -1
  131. package/dist/cjs/bal-segment_2.cjs.entry.js +516 -0
  132. package/dist/cjs/bal-select_2.cjs.entry.js +1 -1
  133. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  134. package/dist/cjs/bal-steps.cjs.entry.js +4 -4
  135. package/dist/cjs/bal-tab-item_2.cjs.entry.js +4 -4
  136. package/dist/cjs/bal-textarea.cjs.entry.js +1 -1
  137. package/dist/cjs/bal-time-input.cjs.entry.js +1 -1
  138. package/dist/cjs/baloise-design-system.cjs.js +1 -1
  139. package/dist/cjs/{breakpoints.decorator-a4a5bd7a.js → breakpoints.decorator-f4da1834.js} +1 -1
  140. package/dist/cjs/{breakpoints.subject-fbf85930.js → breakpoints.subject-6fc372a8.js} +1 -1
  141. package/dist/cjs/{form-input-134c5116.js → form-input-b61eb894.js} +14 -0
  142. package/dist/cjs/index.cjs.js +2 -2
  143. package/dist/cjs/initialize-2a19d091.js +1 -1
  144. package/dist/cjs/loader.cjs.js +1 -1
  145. package/dist/cjs/{tokens.esm-aa4bb7f7.js → tokens.esm-cd3fab6c.js} +1 -1
  146. package/dist/cjs/{window-resize.decorator-c7a521b0.js → window-resize.decorator-67e1f4de.js} +1 -1
  147. package/dist/collection/collection-manifest.json +15 -13
  148. package/dist/collection/components/bal-field/bal-field.js +3 -0
  149. package/dist/collection/components/bal-segment/bal-segment-item/bal-segment-item.js +92 -69
  150. package/dist/collection/components/bal-segment/bal-segment.js +115 -19
  151. package/dist/collection/utils/constants/version.constant.js +1 -1
  152. package/dist/collection/utils/form-input.js +13 -0
  153. package/dist/collection/utils/form-input.spec.js +30 -0
  154. package/dist/collection/utils/mask/context/mask-context.js +2 -2
  155. package/dist/esm/bal-accordion_4.entry.js +2 -2
  156. package/dist/esm/bal-carousel_2.entry.js +4 -4
  157. package/dist/esm/bal-checkbox-button.entry.js +1 -1
  158. package/dist/esm/bal-checkbox_2.entry.js +2 -2
  159. package/dist/esm/bal-content.entry.js +52 -0
  160. package/dist/esm/bal-date-calendar-cell.entry.js +1 -1
  161. package/dist/esm/bal-date-calendar_2.entry.js +4 -5
  162. package/dist/esm/bal-date.entry.js +3 -3
  163. package/dist/esm/bal-datepicker.entry.js +5 -5
  164. package/dist/esm/bal-dropdown.entry.js +2 -2
  165. package/dist/esm/bal-field_5.entry.js +3 -0
  166. package/dist/esm/bal-file-upload.entry.js +2 -2
  167. package/dist/esm/bal-footer.entry.js +2 -2
  168. package/dist/esm/{bal-popover_2.entry.js → bal-hint_5.entry.js} +171 -5
  169. package/dist/esm/bal-input-slider.entry.js +1 -1
  170. package/dist/esm/bal-input-stepper.entry.js +2 -2
  171. package/dist/esm/bal-input.entry.js +1 -1
  172. package/dist/esm/{bal-content_2.entry.js → bal-label.entry.js} +1 -46
  173. package/dist/esm/bal-list_8.entry.js +4 -4
  174. package/dist/esm/bal-logo.entry.js +3 -3
  175. package/dist/esm/bal-nav_8.entry.js +3 -3
  176. package/dist/esm/bal-navbar_5.entry.js +3 -3
  177. package/dist/esm/bal-number-input.entry.js +2 -2
  178. package/dist/esm/bal-option_2.entry.js +1 -1
  179. package/dist/esm/bal-pagination.entry.js +3 -3
  180. package/dist/esm/bal-popup.entry.js +2 -2
  181. package/dist/esm/bal-progress-bar.entry.js +5 -5
  182. package/dist/esm/bal-radio-button.entry.js +1 -1
  183. package/dist/esm/bal-radio_2.entry.js +2 -2
  184. package/dist/esm/bal-segment_2.entry.js +511 -0
  185. package/dist/esm/bal-select_2.entry.js +2 -2
  186. package/dist/esm/bal-shape.entry.js +1 -1
  187. package/dist/esm/bal-steps.entry.js +5 -5
  188. package/dist/esm/bal-tab-item_2.entry.js +5 -5
  189. package/dist/esm/bal-textarea.entry.js +1 -1
  190. package/dist/esm/bal-time-input.entry.js +1 -1
  191. package/dist/esm/baloise-design-system.js +1 -1
  192. package/dist/esm/{breakpoints.decorator-f2ac9963.js → breakpoints.decorator-8a50482f.js} +1 -1
  193. package/dist/esm/{breakpoints.subject-3605e395.js → breakpoints.subject-e3538fe7.js} +1 -1
  194. package/dist/esm/{date-aba2d404.js → date-6e8f5617.js} +1 -1
  195. package/dist/esm/{form-input-28a08ec5.js → form-input-a8fdaaef.js} +14 -1
  196. package/dist/esm/{index.esm-76abd8e3.js → index.esm-cc299511.js} +1 -1
  197. package/dist/esm/index.js +5 -5
  198. package/dist/esm/initialize-e216cfe4.js +1 -1
  199. package/dist/esm/loader.js +1 -1
  200. package/dist/esm/{tokens.esm-337782ae.js → tokens.esm-7cf87670.js} +1 -1
  201. package/dist/esm/{window-resize.decorator-d5198831.js → window-resize.decorator-9c08027e.js} +1 -1
  202. package/dist/esm-es5/bal-accordion_4.entry.js +1 -1
  203. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  204. package/dist/esm-es5/bal-checkbox-button.entry.js +1 -1
  205. package/dist/esm-es5/bal-checkbox_2.entry.js +1 -1
  206. package/dist/esm-es5/bal-content.entry.js +1 -0
  207. package/dist/esm-es5/bal-date-calendar-cell.entry.js +1 -1
  208. package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
  209. package/dist/esm-es5/bal-date.entry.js +1 -1
  210. package/dist/esm-es5/bal-datepicker.entry.js +1 -1
  211. package/dist/esm-es5/bal-dropdown.entry.js +1 -1
  212. package/dist/esm-es5/bal-field_5.entry.js +1 -1
  213. package/dist/esm-es5/bal-file-upload.entry.js +1 -1
  214. package/dist/esm-es5/bal-footer.entry.js +1 -1
  215. package/dist/esm-es5/bal-hint_5.entry.js +1 -0
  216. package/dist/esm-es5/bal-input-slider.entry.js +1 -1
  217. package/dist/esm-es5/bal-input-stepper.entry.js +1 -1
  218. package/dist/esm-es5/bal-input.entry.js +1 -1
  219. package/dist/esm-es5/bal-label.entry.js +1 -0
  220. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  221. package/dist/esm-es5/bal-logo.entry.js +1 -1
  222. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  223. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  224. package/dist/esm-es5/bal-number-input.entry.js +1 -1
  225. package/dist/esm-es5/bal-option_2.entry.js +1 -1
  226. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  227. package/dist/esm-es5/bal-popup.entry.js +1 -1
  228. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  229. package/dist/esm-es5/bal-radio-button.entry.js +1 -1
  230. package/dist/esm-es5/bal-radio_2.entry.js +1 -1
  231. package/dist/esm-es5/bal-segment_2.entry.js +1 -0
  232. package/dist/esm-es5/bal-select_2.entry.js +1 -1
  233. package/dist/esm-es5/bal-shape.entry.js +1 -1
  234. package/dist/esm-es5/bal-steps.entry.js +1 -1
  235. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  236. package/dist/esm-es5/bal-textarea.entry.js +1 -1
  237. package/dist/esm-es5/bal-time-input.entry.js +1 -1
  238. package/dist/esm-es5/baloise-design-system.js +1 -1
  239. package/dist/esm-es5/{breakpoints.decorator-f2ac9963.js → breakpoints.decorator-8a50482f.js} +1 -1
  240. package/dist/esm-es5/{breakpoints.subject-3605e395.js → breakpoints.subject-e3538fe7.js} +1 -1
  241. package/dist/esm-es5/{date-aba2d404.js → date-6e8f5617.js} +1 -1
  242. package/dist/esm-es5/{form-input-28a08ec5.js → form-input-a8fdaaef.js} +1 -1
  243. package/dist/esm-es5/{index.esm-76abd8e3.js → index.esm-cc299511.js} +1 -1
  244. package/dist/esm-es5/index.js +1 -1
  245. package/dist/esm-es5/initialize-e216cfe4.js +1 -1
  246. package/dist/esm-es5/loader.js +1 -1
  247. package/dist/esm-es5/{window-resize.decorator-d5198831.js → window-resize.decorator-9c08027e.js} +1 -1
  248. package/dist/types/components/bal-segment/bal-segment-item/bal-segment-item.d.ts +17 -13
  249. package/dist/types/components/bal-segment/bal-segment.d.ts +22 -3
  250. package/dist/types/components/bal-segment/bal-segment.interfaces.d.ts +2 -0
  251. package/dist/types/components.d.ts +7 -19
  252. package/dist/types/utils/form-input.d.ts +3 -0
  253. package/package.json +7 -7
  254. package/dist/baloise-design-system/p-265f9d51c9.system.entry.js +0 -1
  255. package/dist/baloise-design-system/p-370575b8cb.system.entry.js +0 -1
  256. package/dist/baloise-design-system/p-3c25811c44.entry.js +0 -1
  257. package/dist/baloise-design-system/p-487816db33.system.entry.js +0 -1
  258. package/dist/baloise-design-system/p-53e98a0f71.entry.js +0 -1
  259. package/dist/baloise-design-system/p-547aae9610.entry.js +0 -1
  260. package/dist/baloise-design-system/p-5db0544e97.system.entry.js +0 -1
  261. package/dist/baloise-design-system/p-8de1a12660.entry.js +0 -1
  262. package/dist/baloise-design-system/p-a507ff25cb.system.entry.js +0 -1
  263. package/dist/baloise-design-system/p-b8f085f7b5.system.entry.js +0 -1
  264. package/dist/baloise-design-system/p-c1c17f8edc.system.entry.js +0 -1
  265. package/dist/baloise-design-system/p-ced37553e2.entry.js +0 -1
  266. package/dist/baloise-design-system/p-d2ee9b0a.system.js +0 -1
  267. package/dist/baloise-design-system/p-d9d229a026.entry.js +0 -1
  268. package/dist/baloise-design-system/p-e0384bfc0c.entry.js +0 -1
  269. package/dist/baloise-design-system/p-e75ccb92.js +0 -1
  270. package/dist/cjs/bal-hint_3.cjs.entry.js +0 -186
  271. package/dist/cjs/bal-segment-item.cjs.entry.js +0 -156
  272. package/dist/cjs/bal-segment.cjs.entry.js +0 -319
  273. package/dist/esm/bal-hint_3.entry.js +0 -180
  274. package/dist/esm/bal-segment-item.entry.js +0 -152
  275. package/dist/esm/bal-segment.entry.js +0 -315
  276. package/dist/esm-es5/bal-content_2.entry.js +0 -1
  277. package/dist/esm-es5/bal-hint_3.entry.js +0 -1
  278. package/dist/esm-es5/bal-popover_2.entry.js +0 -1
  279. package/dist/esm-es5/bal-segment-item.entry.js +0 -1
  280. package/dist/esm-es5/bal-segment.entry.js +0 -1
  281. /package/dist/baloise-design-system/{p-e1994e2c.js → p-46bed129.js} +0 -0
  282. /package/dist/baloise-design-system/{p-36074466.system.js → p-9ffefe27.system.js} +0 -0
  283. /package/dist/esm-es5/{tokens.esm-337782ae.js → tokens.esm-7cf87670.js} +0 -0
@@ -248,20 +248,20 @@
248
248
  },
249
249
  {
250
250
  "components": [
251
- "bal-heading",
252
- "bal-text"
251
+ "bal-segment",
252
+ "bal-segment-item"
253
253
  ]
254
254
  },
255
255
  {
256
256
  "components": [
257
- "bal-carousel",
258
- "bal-carousel-item"
257
+ "bal-heading",
258
+ "bal-text"
259
259
  ]
260
260
  },
261
261
  {
262
262
  "components": [
263
- "bal-popover",
264
- "bal-popover-content"
263
+ "bal-carousel",
264
+ "bal-carousel-item"
265
265
  ]
266
266
  },
267
267
  {
@@ -306,13 +306,6 @@
306
306
  "bal-option-list"
307
307
  ]
308
308
  },
309
- {
310
- "components": [
311
- "bal-hint",
312
- "bal-hint-text",
313
- "bal-hint-title"
314
- ]
315
- },
316
309
  {
317
310
  "components": [
318
311
  "bal-modal",
@@ -352,6 +345,15 @@
352
345
  "bal-navbar-menu-start"
353
346
  ]
354
347
  },
348
+ {
349
+ "components": [
350
+ "bal-hint",
351
+ "bal-hint-text",
352
+ "bal-hint-title",
353
+ "bal-popover",
354
+ "bal-popover-content"
355
+ ]
356
+ },
355
357
  {
356
358
  "components": [
357
359
  "bal-field",
@@ -22,6 +22,7 @@ export class Field {
22
22
  'bal-input-slider',
23
23
  'bal-file-upload',
24
24
  'bal-dropdown',
25
+ 'bal-segment',
25
26
  ];
26
27
  this.formElements = [...this.formControlElement, 'bal-field-label', 'bal-field-message'];
27
28
  this.isDirectChild = (el) => {
@@ -111,6 +112,8 @@ export class Field {
111
112
  'bal-field-control bal-dropdown',
112
113
  'bal-field-control bal-checkbox',
113
114
  'bal-field-control bal-radio',
115
+ 'bal-field-control bal-segment-item',
116
+ 'bal-field-control bal-segment',
114
117
  'bal-field-control bal-checkbox-group',
115
118
  'bal-field-control bal-radio-group',
116
119
  'bal-field-control bal-number-input',
@@ -1,13 +1,15 @@
1
- import { h, Host, } from "@stencil/core";
1
+ import { h, Host } from "@stencil/core";
2
2
  import { BEM } from "../../../utils/bem";
3
3
  import { inheritAttributes } from "../../../utils/attributes";
4
4
  import { addEventListener, raf, removeEventListener } from "../../../utils/helpers";
5
- let ids = 0;
5
+ import { defaultBalAriaForm } from "../../../utils/form";
6
+ let SegmentItemIds = 0;
6
7
  export class SegmentItem {
7
8
  constructor() {
8
9
  this.segmentEl = null;
9
10
  this.inheritedAttributes = {};
10
- this.id = ids++;
11
+ this.internalId = SegmentItemIds++;
12
+ this.inputId = `bal-si-${this.internalId}`;
11
13
  this.updateVertical = (ev) => {
12
14
  this.isVertical = ev.detail;
13
15
  };
@@ -15,7 +17,7 @@ export class SegmentItem {
15
17
  const { segmentEl } = this;
16
18
  if (segmentEl) {
17
19
  if (segmentEl.value === '' || segmentEl.value === undefined || segmentEl.value === null) {
18
- const items = this.items;
20
+ const items = this.allAvailableOptions;
19
21
  if (items.length > 0) {
20
22
  const first = items[0];
21
23
  this.isFocusable = first === this.el;
@@ -28,6 +30,9 @@ export class SegmentItem {
28
30
  if (segmentEl.disabled) {
29
31
  this.disabled = true;
30
32
  }
33
+ this.isLast = segmentEl.lastElementChild === this.el;
34
+ this.isFirst = segmentEl.firstElementChild === this.el;
35
+ this.calculateEmptyValue();
31
36
  }
32
37
  };
33
38
  this.onSlottedItemsChange = () => {
@@ -41,23 +46,35 @@ export class SegmentItem {
41
46
  this.hasSlotContent = false;
42
47
  this.isFocusable = false;
43
48
  this.isVertical = false;
49
+ this.isLast = false;
50
+ this.isFirst = false;
51
+ this.hasEmptyValue = true;
52
+ this.ariaForm = defaultBalAriaForm;
44
53
  this.disabled = false;
45
54
  this.invalid = false;
46
55
  this.focused = false;
47
56
  this.checked = false;
48
57
  this.label = '';
49
- this.value = 'bal-si-' + this.id;
58
+ this.value = 'bal-si-' + this.internalId;
50
59
  }
51
- valueChanged() {
52
- this.updateState();
60
+ valueChanged(newValue, oldValue) {
61
+ if (newValue !== oldValue) {
62
+ this.updateState();
63
+ }
64
+ }
65
+ componentWillLoad() {
66
+ this.inheritedAttributes = Object.assign({}, inheritAttributes(this.el, ['aria-label']));
53
67
  }
54
- connectedCallback() {
68
+ componentDidLoad() {
55
69
  const segmentEl = (this.segmentEl = this.el.closest('bal-segment'));
56
70
  if (segmentEl) {
57
- this.updateState();
58
71
  addEventListener(segmentEl, 'balSelect', this.updateState);
59
72
  addEventListener(segmentEl, 'balVertical', this.updateVertical);
60
73
  }
74
+ raf(() => {
75
+ this.checkSlotContent();
76
+ this.updateState();
77
+ });
61
78
  }
62
79
  disconnectedCallback() {
63
80
  const segmentEl = this.segmentEl;
@@ -67,11 +84,14 @@ export class SegmentItem {
67
84
  this.segmentEl = null;
68
85
  }
69
86
  }
70
- componentWillLoad() {
71
- this.inheritedAttributes = Object.assign({}, inheritAttributes(this.el, ['aria-label']));
72
- }
73
- componentDidLoad() {
74
- raf(() => this.checkSlotContent());
87
+ calculateEmptyValue() {
88
+ if (this.segmentEl) {
89
+ const segments = Array.from(this.segmentEl.querySelectorAll('bal-segment-item'));
90
+ this.hasEmptyValue = !segments.some(item => item.value === this.segmentEl.value);
91
+ }
92
+ else {
93
+ this.hasEmptyValue = false;
94
+ }
75
95
  }
76
96
  /**
77
97
  * @internal
@@ -84,54 +104,47 @@ export class SegmentItem {
84
104
  nativeEl.focus();
85
105
  }
86
106
  }
87
- get items() {
88
- return this.allItems.filter(item => !item.disabled);
107
+ /**
108
+ * @internal
109
+ */
110
+ async setAriaForm(ariaForm) {
111
+ this.ariaForm = Object.assign({}, ariaForm);
112
+ }
113
+ get allAvailableOptions() {
114
+ return this.allOptions.filter(item => !item.disabled);
89
115
  }
90
- get allItems() {
116
+ get allOptions() {
91
117
  const { segmentEl } = this;
92
118
  if (segmentEl) {
93
119
  return Array.from(segmentEl.querySelectorAll('bal-segment-item'));
94
120
  }
95
121
  return [];
96
122
  }
97
- isFirst() {
98
- const { segmentEl } = this;
99
- let items = this.items;
100
- if (segmentEl && segmentEl.disabled) {
101
- items = this.allItems;
102
- }
103
- if (items.length > 0) {
104
- const first = items[0];
105
- return first === this.el;
106
- }
107
- return false;
108
- }
109
- isLast() {
110
- const { segmentEl } = this;
111
- let items = this.items;
112
- if (segmentEl && segmentEl.disabled) {
113
- items = this.allItems;
114
- }
115
- if (items.length > 0) {
116
- const last = items[items.length - 1];
117
- return last === this.el;
118
- }
119
- return false;
120
- }
121
123
  checkSlotContent() {
122
124
  const slot = this.el.querySelector('[part="slot"]');
123
125
  const children = slot ? slot.innerHTML.trim() : '';
124
126
  this.hasSlotContent = children.length > 0;
125
127
  }
126
128
  render() {
127
- const { checked, focused, segmentEl, label, isFocusable } = this;
129
+ const { checked, focused, segmentEl, label, isFocusable, isFirst, hasEmptyValue } = this;
128
130
  const block = BEM.block('segment-item');
129
131
  const buttonBem = block.element('button');
130
132
  const indicatorBem = block.element('indicator');
131
133
  const invalid = this.invalid || (segmentEl && segmentEl.invalid);
132
134
  const disabled = this.disabled || (segmentEl && segmentEl.disabled);
133
135
  const vertical = this.isVertical;
134
- return (h(Host, { class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, block.class()), block.modifier('vertical').class(vertical)), block.modifier('disabled').class(disabled)), block.modifier('checked').class(checked)), block.modifier('invalid').class(invalid)), block.modifier('line').class(!this.isFirst() && !checked)), block.modifier('last').class(this.isLast() && !checked)) }, h("button", Object.assign({ role: "radio", "aria-checked": checked ? 'true' : 'false', class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, buttonBem.class()), buttonBem.modifier('checked').class(checked)), buttonBem.modifier('invalid').class(invalid)), buttonBem.modifier('disabled').class(disabled)), buttonBem.modifier('focused').class(focused)), buttonBem.modifier('vertical').class(vertical)), "aria-labelledby": `bal-si-${this.id}-label`, type: 'button', tabIndex: isFocusable ? 0 : -1, part: "native", onBlur: ev => this.balBlur.emit(ev), disabled: disabled, ref: el => (this.nativeEl = el) }, this.inheritedAttributes), h("bal-icon", { name: "check", size: "small", class: Object.assign(Object.assign(Object.assign({}, buttonBem.element('icon').class()), buttonBem.element('icon').modifier('animated').class(checked)), buttonBem.element('icon').modifier('vertical').class(vertical)), color: disabled ? 'grey-dark' : invalid ? 'white' : 'primary' }), h("bal-stack", { space: "x-small", layout: 'horizontal' }, h("bal-content", { space: "none" }, h("bal-label", { htmlId: `bal-si-${this.id}-label` }, label), h("span", { part: "slot", class: Object.assign({}, buttonBem.element('slot').modifier('hidden').class(!this.hasSlotContent)) }, ' ', h("slot", { onSlotchange: this.onSlottedItemsChange }))))), h("div", { class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, indicatorBem.class()), indicatorBem.modifier('animated').class()), indicatorBem.modifier('background').class()), indicatorBem.modifier('disabled').class(disabled)), indicatorBem.modifier('invalid').class(invalid)), indicatorBem.modifier('checked').class(checked)), indicatorBem.modifier('vertical').class(vertical)) })));
136
+ const hasTabindex = (hasEmptyValue && isFirst) || (isFocusable && !disabled);
137
+ const id = (hasTabindex && this.ariaForm.controlId) || this.inputId;
138
+ let buttonAttributes = {};
139
+ if (hasTabindex) {
140
+ let labelId = this.ariaForm.labelId || null;
141
+ labelId = `${labelId || ''} ${id}-lbl`.trim();
142
+ buttonAttributes = {
143
+ 'aria-labelledby': labelId,
144
+ 'aria-describedby': this.ariaForm.messageId,
145
+ };
146
+ }
147
+ return (h(Host, { class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, block.class()), block.modifier('vertical').class(vertical)), block.modifier('disabled').class(disabled)), block.modifier('checked').class(checked)), block.modifier('invalid').class(invalid)), block.modifier('last').class(this.isLast && !checked)) }, h("button", Object.assign({ id: id, role: "radio", "aria-checked": checked ? 'true' : 'false' }, buttonAttributes, { class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, buttonBem.class()), buttonBem.modifier('checked').class(checked)), buttonBem.modifier('invalid').class(invalid)), buttonBem.modifier('disabled').class(disabled)), buttonBem.modifier('focused').class(focused)), buttonBem.modifier('vertical').class(vertical)), type: 'button', tabIndex: hasTabindex ? 0 : -1, part: "native", disabled: disabled, ref: el => (this.nativeEl = el) }, this.inheritedAttributes), h("bal-icon", { name: "check", size: "small", class: Object.assign(Object.assign(Object.assign({}, buttonBem.element('icon').class()), buttonBem.element('icon').modifier('animated').class(checked)), buttonBem.element('icon').modifier('vertical').class(vertical)), color: disabled ? 'grey-dark' : invalid ? 'white' : 'primary' }), h("bal-stack", { space: "x-small", layout: 'horizontal' }, h("bal-content", { space: "none" }, h("bal-label", { htmlId: `bal-si-${this.internalId}-label` }, label), h("span", { part: "slot", class: Object.assign({}, buttonBem.element('slot').modifier('hidden').class(!this.hasSlotContent)) }, ' ', h("slot", { onSlotchange: this.onSlottedItemsChange }))))), h("div", { class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, indicatorBem.class()), indicatorBem.modifier('animated').class()), indicatorBem.modifier('background').class()), indicatorBem.modifier('disabled').class(disabled)), indicatorBem.modifier('invalid').class(invalid)), indicatorBem.modifier('checked').class(checked)), indicatorBem.modifier('vertical').class(vertical)) })));
135
148
  }
136
149
  static get is() { return "bal-segment-item"; }
137
150
  static get originalStyleUrls() {
@@ -244,7 +257,7 @@ export class SegmentItem {
244
257
  },
245
258
  "value": {
246
259
  "type": "any",
247
- "mutable": false,
260
+ "mutable": true,
248
261
  "complexType": {
249
262
  "original": "SegmentValue",
250
263
  "resolved": "number | string",
@@ -264,7 +277,7 @@ export class SegmentItem {
264
277
  },
265
278
  "attribute": "value",
266
279
  "reflect": false,
267
- "defaultValue": "'bal-si-' + this.id"
280
+ "defaultValue": "'bal-si-' + this.internalId"
268
281
  }
269
282
  };
270
283
  }
@@ -272,32 +285,13 @@ export class SegmentItem {
272
285
  return {
273
286
  "hasSlotContent": {},
274
287
  "isFocusable": {},
275
- "isVertical": {}
288
+ "isVertical": {},
289
+ "isLast": {},
290
+ "isFirst": {},
291
+ "hasEmptyValue": {},
292
+ "ariaForm": {}
276
293
  };
277
294
  }
278
- static get events() {
279
- return [{
280
- "method": "balBlur",
281
- "name": "balBlur",
282
- "bubbles": true,
283
- "cancelable": true,
284
- "composed": true,
285
- "docs": {
286
- "tags": [],
287
- "text": "Emitted when the component was touched"
288
- },
289
- "complexType": {
290
- "original": "BalEvents.BalSegmentBlurDetail",
291
- "resolved": "FocusEvent",
292
- "references": {
293
- "BalEvents": {
294
- "location": "global",
295
- "id": "global::BalEvents"
296
- }
297
- }
298
- }
299
- }];
300
- }
301
295
  static get methods() {
302
296
  return {
303
297
  "setFocus": {
@@ -319,6 +313,35 @@ export class SegmentItem {
319
313
  "text": "Focuses the native <button> element\ninside of ion-segment-button."
320
314
  }]
321
315
  }
316
+ },
317
+ "setAriaForm": {
318
+ "complexType": {
319
+ "signature": "(ariaForm: BalAriaForm) => Promise<void>",
320
+ "parameters": [{
321
+ "name": "ariaForm",
322
+ "type": "BalAriaForm",
323
+ "docs": ""
324
+ }],
325
+ "references": {
326
+ "Promise": {
327
+ "location": "global",
328
+ "id": "global::Promise"
329
+ },
330
+ "BalAriaForm": {
331
+ "location": "import",
332
+ "path": "../../../utils/form",
333
+ "id": "src/utils/form.ts::BalAriaForm"
334
+ }
335
+ },
336
+ "return": "Promise<void>"
337
+ },
338
+ "docs": {
339
+ "text": "",
340
+ "tags": [{
341
+ "name": "internal",
342
+ "text": undefined
343
+ }]
344
+ }
322
345
  }
323
346
  };
324
347
  }
@@ -8,11 +8,18 @@ import { FOCUS_KEYS } from "../../utils/focus-visible";
8
8
  import { ListenToWindowResize } from "../../utils/resize";
9
9
  import { raf } from "../../utils/helpers";
10
10
  import { ListenToBreakpoints } from "../../utils/breakpoints";
11
+ import { ListenToFocus } from "../../utils/focus";
12
+ import { defaultBalAriaForm } from "../../utils/form";
11
13
  export class Segment {
12
14
  constructor() {
15
+ /**
16
+ * LISTENERS
17
+ * ------------------------------------------------------
18
+ */
19
+ this.hasFocus = false;
13
20
  this.getSegmentItem = (selector) => {
14
21
  var _a, _b;
15
- const items = this.items.filter(item => !item.disabled);
22
+ const items = this.allItems.filter(item => !item.disabled);
16
23
  const currIndex = items.findIndex(item => item === document.activeElement.closest('bal-segment-item'));
17
24
  switch (selector) {
18
25
  case 'current':
@@ -77,6 +84,7 @@ export class Segment {
77
84
  this.isVertical = false;
78
85
  this.isMobile = false;
79
86
  this.maxWidth = 0;
87
+ this.ariaForm = defaultBalAriaForm;
80
88
  this.invalid = false;
81
89
  this.disabled = false;
82
90
  this.vertical = false;
@@ -87,6 +95,9 @@ export class Segment {
87
95
  createLogger(log) {
88
96
  this.log = log;
89
97
  }
98
+ disabledChanged() {
99
+ this.allItems.map(item => (item.disabled = this.disabled));
100
+ }
90
101
  valueChanged(value) {
91
102
  /**
92
103
  * `balSelect` is emitted every time the value changes (internal or external changes).
@@ -101,6 +112,7 @@ export class Segment {
101
112
  connectedCallback() {
102
113
  this.el.addEventListener('touchstart', this.onPointerDown);
103
114
  this.el.addEventListener('mousedown', this.onPointerDown);
115
+ this.disabledChanged();
104
116
  }
105
117
  disconnectedCallback() {
106
118
  this.el.removeEventListener('touchstart', this.onPointerDown);
@@ -110,10 +122,12 @@ export class Segment {
110
122
  this.setCheckedClasses();
111
123
  this.defineWidth();
112
124
  }
113
- /**
114
- * LISTENERS
115
- * ------------------------------------------------------
116
- */
125
+ focusInListener(ev) {
126
+ this.balFocus.emit(ev);
127
+ }
128
+ focusOutListener(ev) {
129
+ this.balBlur.emit(ev);
130
+ }
117
131
  breakpointListener(breakpoints) {
118
132
  this.isMobile = breakpoints.mobile;
119
133
  }
@@ -135,9 +149,8 @@ export class Segment {
135
149
  this.emitVerticalChange(true);
136
150
  }
137
151
  }
138
- listenOnBalBlur(ev) {
139
- stopEventBubbling(ev);
140
- this.balBlur.emit(ev.detail);
152
+ listenOnKeyDownOutside() {
153
+ this.keyboardMode = true;
141
154
  }
142
155
  listenOnKeyDown(ev) {
143
156
  this.keyboardMode = FOCUS_KEYS.includes(ev.key);
@@ -145,6 +158,7 @@ export class Segment {
145
158
  if (isSpaceKey(ev)) {
146
159
  stopEventBubbling(ev);
147
160
  current = this.getSegmentItem('current');
161
+ this.value = current.value;
148
162
  }
149
163
  else if (isArrowUpKey(ev) || isArrowLeftKey(ev)) {
150
164
  stopEventBubbling(ev);
@@ -174,15 +188,25 @@ export class Segment {
174
188
  current.setFocus();
175
189
  }
176
190
  }
191
+ /**
192
+ * PUBLIC METHODS
193
+ * ------------------------------------------------------
194
+ */
195
+ /**
196
+ * @internal
197
+ */
198
+ async setAriaForm(ariaForm) {
199
+ this.ariaForm = Object.assign({}, ariaForm);
200
+ }
177
201
  /**
178
202
  * GETTERS
179
203
  * ------------------------------------------------------
180
204
  */
181
- get items() {
205
+ get allItems() {
182
206
  return Array.from(this.el.querySelectorAll('bal-segment-item'));
183
207
  }
184
208
  get checked() {
185
- return this.items.find(item => item.value === this.value);
209
+ return this.allItems.find(item => item.value === this.value);
186
210
  }
187
211
  /**
188
212
  * PRIVATE METHODS
@@ -207,8 +231,11 @@ export class Segment {
207
231
  });
208
232
  }
209
233
  getIndicator(item) {
210
- const root = item.shadowRoot || item;
211
- return root.querySelector('.bal-segment-item__indicator');
234
+ if (item) {
235
+ const root = item.shadowRoot || item;
236
+ return root.querySelector('.bal-segment-item__indicator');
237
+ }
238
+ return null;
212
239
  }
213
240
  checkButton(previous, current) {
214
241
  const previousIndicator = this.getIndicator(previous);
@@ -245,7 +272,7 @@ export class Segment {
245
272
  this.setCheckedClasses();
246
273
  }
247
274
  setCheckedClasses() {
248
- const items = this.items;
275
+ const items = this.allItems;
249
276
  const index = items.findIndex(item => item.value === this.value);
250
277
  const next = index + 1;
251
278
  const previous = index - 1;
@@ -265,9 +292,9 @@ export class Segment {
265
292
  * ------------------------------------------------------
266
293
  */
267
294
  render() {
268
- const { invalid, isVertical, scrollable, keyboardMode, expanded, isMobile } = this;
295
+ const { invalid, isVertical, scrollable, keyboardMode, expanded, isMobile, disabled } = this;
269
296
  const block = BEM.block('segment');
270
- return (h(Host, { role: "radiogroup", class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, block.class()), block.modifier('invalid').class(invalid)), block.modifier('vertical').class(isVertical)), block.modifier('scrollable').class(scrollable)), block.modifier('keyboard').class(keyboardMode)), block.modifier('expanded').class((expanded || isMobile) && !isVertical)), onClick: this.onClick }, h("slot", { onSlotchange: this.onSlottedItemsChange })));
297
+ return (h(Host, { role: "radiogroup", "aria-labelledby": this.ariaForm.labelId, "aria-describedby": this.ariaForm.messageId, class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, block.class()), block.modifier('invalid').class(invalid)), block.modifier('vertical').class(isVertical)), block.modifier('scrollable').class(scrollable)), block.modifier('keyboard').class(keyboardMode)), block.modifier('disabled').class(disabled)), block.modifier('expanded').class((expanded || isMobile) && !isVertical)), onClick: this.onClick }, h("slot", { onSlotchange: this.onSlottedItemsChange })));
271
298
  }
272
299
  static get is() { return "bal-segment"; }
273
300
  static get originalStyleUrls() {
@@ -402,11 +429,32 @@ export class Segment {
402
429
  "keyboardMode": {},
403
430
  "isVertical": {},
404
431
  "isMobile": {},
405
- "maxWidth": {}
432
+ "maxWidth": {},
433
+ "ariaForm": {}
406
434
  };
407
435
  }
408
436
  static get events() {
409
437
  return [{
438
+ "method": "balFocus",
439
+ "name": "balFocus",
440
+ "bubbles": true,
441
+ "cancelable": true,
442
+ "composed": true,
443
+ "docs": {
444
+ "tags": [],
445
+ "text": "Emitted when the toggle has focus."
446
+ },
447
+ "complexType": {
448
+ "original": "BalEvents.BalSegmentFocusDetail",
449
+ "resolved": "FocusEvent",
450
+ "references": {
451
+ "BalEvents": {
452
+ "location": "global",
453
+ "id": "global::BalEvents"
454
+ }
455
+ }
456
+ }
457
+ }, {
410
458
  "method": "balBlur",
411
459
  "name": "balBlur",
412
460
  "bubbles": true,
@@ -494,18 +542,54 @@ export class Segment {
494
542
  }
495
543
  }];
496
544
  }
545
+ static get methods() {
546
+ return {
547
+ "setAriaForm": {
548
+ "complexType": {
549
+ "signature": "(ariaForm: BalAriaForm) => Promise<void>",
550
+ "parameters": [{
551
+ "name": "ariaForm",
552
+ "type": "BalAriaForm",
553
+ "docs": ""
554
+ }],
555
+ "references": {
556
+ "Promise": {
557
+ "location": "global",
558
+ "id": "global::Promise"
559
+ },
560
+ "BalAriaForm": {
561
+ "location": "import",
562
+ "path": "../../utils/form",
563
+ "id": "src/utils/form.ts::BalAriaForm"
564
+ }
565
+ },
566
+ "return": "Promise<void>"
567
+ },
568
+ "docs": {
569
+ "text": "",
570
+ "tags": [{
571
+ "name": "internal",
572
+ "text": undefined
573
+ }]
574
+ }
575
+ }
576
+ };
577
+ }
497
578
  static get elementRef() { return "el"; }
498
579
  static get watchers() {
499
580
  return [{
581
+ "propName": "disabled",
582
+ "methodName": "disabledChanged"
583
+ }, {
500
584
  "propName": "value",
501
585
  "methodName": "valueChanged"
502
586
  }];
503
587
  }
504
588
  static get listeners() {
505
589
  return [{
506
- "name": "balBlur",
507
- "method": "listenOnBalBlur",
508
- "target": undefined,
590
+ "name": "keydown",
591
+ "method": "listenOnKeyDownOutside",
592
+ "target": "document",
509
593
  "capture": false,
510
594
  "passive": false
511
595
  }, {
@@ -523,6 +607,18 @@ __decorate([
523
607
  __metadata("design:paramtypes", [Function]),
524
608
  __metadata("design:returntype", void 0)
525
609
  ], Segment.prototype, "createLogger", null);
610
+ __decorate([
611
+ ListenToFocus(),
612
+ __metadata("design:type", Function),
613
+ __metadata("design:paramtypes", [FocusEvent]),
614
+ __metadata("design:returntype", void 0)
615
+ ], Segment.prototype, "focusInListener", null);
616
+ __decorate([
617
+ ListenToFocus(),
618
+ __metadata("design:type", Function),
619
+ __metadata("design:paramtypes", [FocusEvent]),
620
+ __metadata("design:returntype", void 0)
621
+ ], Segment.prototype, "focusOutListener", null);
526
622
  __decorate([
527
623
  ListenToBreakpoints(),
528
624
  __metadata("design:type", Function),
@@ -1,2 +1,2 @@
1
1
  // generated by .build/version.js
2
- export const VERSION = '16.5.0';
2
+ export const VERSION = '16.5.1';
@@ -72,3 +72,16 @@ export const inputHandleChange = (component) => {
72
72
  component.balChange.emit(component.value);
73
73
  }
74
74
  };
75
+ export const isEmptyValue = (value) => {
76
+ return (value === '' ||
77
+ value === undefined ||
78
+ value === null ||
79
+ (Array.isArray(value) && !value.length) ||
80
+ (typeof value === 'number' && isNaN(value)));
81
+ };
82
+ export const parseValue = (value) => {
83
+ return isEmptyValue(value) ? undefined : value;
84
+ };
85
+ export const hasValueChanged = (oldValue, newValue) => {
86
+ return parseValue(oldValue) !== parseValue(newValue);
87
+ };
@@ -0,0 +1,30 @@
1
+ import { isEmptyValue, parseValue, hasValueChanged } from "./form-input";
2
+ describe('form input', () => {
3
+ describe('isEmptyValue', () => {
4
+ test('should check if value is empty', () => {
5
+ expect(isEmptyValue('')).toBeTruthy;
6
+ expect(isEmptyValue(undefined)).toBeTruthy;
7
+ expect(isEmptyValue(null)).toBeTruthy;
8
+ expect(isEmptyValue([])).toBeTruthy;
9
+ expect(isEmptyValue('01')).toBeFalsy;
10
+ });
11
+ });
12
+ describe('parseValue', () => {
13
+ test('should return undefined if value is considered as empty', () => {
14
+ expect(parseValue('')).toBe(undefined);
15
+ expect(parseValue(undefined)).toBe(undefined);
16
+ expect(parseValue(null)).toBe(undefined);
17
+ expect(parseValue([])).toBe(undefined);
18
+ expect(parseValue('01')).toBe('01');
19
+ });
20
+ });
21
+ describe('hasValueChanged', () => {
22
+ test('should return true if values are not equal', () => {
23
+ expect(hasValueChanged('', undefined)).toBeFalsy();
24
+ expect(hasValueChanged(null, undefined)).toBeFalsy();
25
+ expect(hasValueChanged(undefined, undefined)).toBeFalsy();
26
+ expect(hasValueChanged([], undefined)).toBeFalsy();
27
+ expect(hasValueChanged('01', undefined)).toBeTruthy();
28
+ });
29
+ });
30
+ });
@@ -1,4 +1,5 @@
1
1
  import { MaskPosition } from "./mask-position";
2
+ import { hasValueChanged } from "../../form-input";
2
3
  export class MaskContext {
3
4
  constructor(_options) {
4
5
  this._options = _options;
@@ -49,8 +50,7 @@ export class MaskContext {
49
50
  this._options.component.balInput.emit(this.value);
50
51
  }
51
52
  if ((eventType === 'change' || eventType === 'blur') && parsedValue !== undefined) {
52
- const valueChanged = this._options.component.value !== parsedValue;
53
- if (valueChanged) {
53
+ if (hasValueChanged(this._options.component.value, parsedValue)) {
54
54
  this._options.component.value = parsedValue;
55
55
  this._options.component.balChange.emit(parsedValue);
56
56
  }