@baloise/ds-core 19.9.4-nightly.20260513 → 19.9.5

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 (214) hide show
  1. package/components/all.d.ts +0 -2
  2. package/components/all.js +0 -3
  3. package/components/animation.decorator.js +1 -1
  4. package/components/bal-accordion.js +1 -1
  5. package/components/bal-app.js +102 -1
  6. package/components/bal-button2.js +1 -1
  7. package/components/bal-carousel-item.js +1 -1
  8. package/components/bal-checkbox-group.js +21 -3
  9. package/components/bal-checkbox2.js +21 -4
  10. package/components/bal-date-calendar2.js +1 -1
  11. package/components/bal-date.js +1 -1
  12. package/components/bal-dropdown.js +1 -1
  13. package/components/bal-field.js +1 -1
  14. package/components/bal-footer.js +1 -1
  15. package/components/bal-form.js +1 -1
  16. package/components/bal-input-stepper.js +1 -1
  17. package/components/bal-list-item-accordion-body2.js +1 -1
  18. package/components/bal-list-item2.js +1 -1
  19. package/components/bal-logo2.js +1 -1
  20. package/components/bal-modal.js +1 -1
  21. package/components/bal-nav.js +65 -53
  22. package/components/bal-navbar-brand.js +1 -1
  23. package/components/bal-option-list2.js +1 -1
  24. package/components/bal-popup2.js +1 -1
  25. package/components/bal-radio-group.js +1 -1
  26. package/components/bal-segment-item.js +1 -1
  27. package/components/bal-select2.js +23 -11
  28. package/components/bal-spinner2.js +1 -1
  29. package/components/bal-stage-image.js +1 -1
  30. package/components/bal-switch.js +1 -74
  31. package/{dist/esm/bal-switch.entry.js → components/bal-switch2.js} +36 -8
  32. package/components/bal-tabs2.js +29 -17
  33. package/components/breakpoints.subject.js +1 -1
  34. package/components/element-states.decorator.js +1 -1
  35. package/components/floating-ui.js +1 -1
  36. package/components/focus.decorator.js +1 -1
  37. package/components/form-input.js +1 -1
  38. package/components/helpers.js +1 -1
  39. package/components/index.js +449 -5
  40. package/components/mutation.decorator.js +1 -1
  41. package/components/overlays.js +1 -1
  42. package/components/resize.decorator.js +1 -1
  43. package/components/swipe.subject.js +1 -1
  44. package/components/swiper.util.js +1 -1
  45. package/components/tokens.esm.js +1 -1
  46. package/components/visibility.decorator.js +1 -1
  47. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  48. package/dist/baloise-design-system/baloise-design-system.js +1 -1
  49. package/dist/baloise-design-system/index.esm.js +1 -1
  50. package/dist/baloise-design-system/{p-09d63730a7.entry.js → p-1bb5b8696e.entry.js} +1 -1
  51. package/dist/baloise-design-system/p-1d7406989c.system.entry.js +1 -0
  52. package/dist/baloise-design-system/{p-0b1aeaaed8.entry.js → p-3850595dd0.entry.js} +1 -1
  53. package/dist/baloise-design-system/{p-81c4b117a6.system.entry.js → p-43dd693355.system.entry.js} +1 -1
  54. package/dist/baloise-design-system/{p-8f510eed45.entry.js → p-477359bbf9.entry.js} +1 -1
  55. package/dist/baloise-design-system/{p-873a0bf9d9.system.entry.js → p-59129fb1d1.system.entry.js} +1 -1
  56. package/dist/baloise-design-system/{p-CIBedZ4h.js → p-5GEK9UQy.js} +1 -1
  57. package/dist/baloise-design-system/{p-8bc92b4b2e.system.entry.js → p-607125007c.system.entry.js} +1 -1
  58. package/dist/baloise-design-system/{p-38888ff243.system.entry.js → p-64d45da025.system.entry.js} +1 -1
  59. package/dist/baloise-design-system/{p-89a45b7719.system.entry.js → p-68baccfba9.system.entry.js} +1 -1
  60. package/dist/baloise-design-system/{p-8da007a406.entry.js → p-68f77714ab.entry.js} +1 -1
  61. package/dist/baloise-design-system/{p-9459a04689.system.entry.js → p-6c3d087d59.system.entry.js} +1 -1
  62. package/dist/baloise-design-system/{p-627def5e99.entry.js → p-74fe27789f.entry.js} +1 -1
  63. package/dist/baloise-design-system/{p-41e1ac82bb.entry.js → p-8268d61dd6.entry.js} +1 -1
  64. package/dist/baloise-design-system/{p-b273a2f73a.entry.js → p-8e3412d465.entry.js} +1 -1
  65. package/dist/baloise-design-system/p-BFRjY4w3.js +1 -1
  66. package/dist/baloise-design-system/p-BRAmUyPx.system.js +1 -1
  67. package/dist/baloise-design-system/p-Bk7UdnZ5.system.js +1 -0
  68. package/dist/baloise-design-system/p-CKN3W8qn.js +1 -0
  69. package/dist/baloise-design-system/{p-x0vPGP6t.system.js → p-CPHPFMUC.system.js} +1 -1
  70. package/dist/baloise-design-system/{p-3VlTyI5Z.system.js → p-CsPrCX4f.system.js} +1 -1
  71. package/dist/baloise-design-system/{p-CWajPM1f.system.js → p-DLLNm5Gs.system.js} +1 -1
  72. package/dist/baloise-design-system/{p-BQ-ZBPGz.js → p-DvLv1IDC.js} +1 -1
  73. package/dist/baloise-design-system/{p-DOmwcY8I.system.js → p-DxnFuP0T.system.js} +1 -1
  74. package/dist/baloise-design-system/{p-BeOuHPcP.js → p-Oz8SBVmc.js} +1 -1
  75. package/dist/baloise-design-system/p-aDM_iThE.system.js +1 -0
  76. package/dist/baloise-design-system/{p-bd8e1fd900.entry.js → p-af05694fd5.entry.js} +1 -1
  77. package/dist/baloise-design-system/{p-2bd8d02b81.entry.js → p-b670d9cae9.entry.js} +1 -1
  78. package/dist/baloise-design-system/{p-46986c305d.system.entry.js → p-b6e82651ef.system.entry.js} +1 -1
  79. package/dist/baloise-design-system/{p-4df7edd98f.entry.js → p-bac3d30df3.entry.js} +1 -1
  80. package/dist/baloise-design-system/{p-1922f177ca.system.entry.js → p-bbeeefc31a.system.entry.js} +1 -1
  81. package/dist/baloise-design-system/{p-b75d71bb54.entry.js → p-c31dc8146b.entry.js} +1 -1
  82. package/dist/baloise-design-system/{p-439f4eac54.system.entry.js → p-c4a244b558.system.entry.js} +1 -1
  83. package/dist/baloise-design-system/{p-4f5b4d3b9e.entry.js → p-c5ae87f18e.entry.js} +1 -1
  84. package/dist/baloise-design-system/{p-15a9d2bdb4.entry.js → p-c8b853074f.entry.js} +1 -1
  85. package/dist/baloise-design-system/{p-8058e17e38.system.entry.js → p-d21134a60b.system.entry.js} +1 -1
  86. package/dist/baloise-design-system/{p-c6f0c6f765.system.entry.js → p-d5bd821ab7.system.entry.js} +1 -1
  87. package/dist/baloise-design-system/p-d9349f5eb0.entry.js +1 -0
  88. package/dist/baloise-design-system/{p-7d611a8e60.entry.js → p-e6f03ecdd0.entry.js} +1 -1
  89. package/dist/baloise-design-system/{p-c72c874ad0.system.entry.js → p-eb2f5b22de.system.entry.js} +1 -1
  90. package/dist/baloise-design-system/{p-4b6f33ea10.system.entry.js → p-f2435a528c.system.entry.js} +1 -1
  91. package/dist/baloise-design-system/{p-2cab716afd.system.entry.js → p-fa728470a3.system.entry.js} +1 -1
  92. package/dist/cjs/{global-BOGOCc0T.js → app-globals-D4xKyILL.js} +4 -2
  93. package/dist/cjs/bal-carousel_2.cjs.entry.js +3 -3
  94. package/dist/cjs/{bal-dropdown_3.cjs.entry.js → bal-check_7.cjs.entry.js} +815 -9
  95. package/dist/cjs/bal-field_5.cjs.entry.js +3 -3
  96. package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
  97. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  98. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  99. package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
  100. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  101. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  102. package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
  103. package/dist/cjs/{bal-radio_2.cjs.entry.js → bal-radio_3.cjs.entry.js} +50 -0
  104. package/dist/cjs/bal-segment_2.cjs.entry.js +4 -4
  105. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  106. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  107. package/dist/cjs/bal-tab-item_2.cjs.entry.js +3 -3
  108. package/dist/cjs/baloise-design-system.cjs.js +2 -3
  109. package/dist/cjs/{breakpoints.decorator-CDD6cOv6.js → breakpoints.decorator-DPrGtqtk.js} +1 -1
  110. package/dist/cjs/{breakpoints.subject-DpuyBCjh.js → breakpoints.subject-C1p-ePFH.js} +1 -1
  111. package/dist/cjs/index.cjs.js +2 -2
  112. package/dist/cjs/initialize-BzrcZo6Y.js +1 -1
  113. package/dist/cjs/loader.cjs.js +2 -3
  114. package/dist/cjs/{tokens.esm-LV2Uuiay.js → tokens.esm-BWWYqtq4.js} +1 -1
  115. package/dist/cjs/{window-resize.decorator-C-w0-60C.js → window-resize.decorator-DRN0wiUR.js} +1 -1
  116. package/dist/collection/collection-manifest.json +15 -17
  117. package/dist/collection/components/bal-checkbox/bal-checkbox.js +2 -3
  118. package/dist/collection/utils/constants/version.constant.js +1 -1
  119. package/dist/esm/{global-Llrc69_N.js → app-globals-Blx--ecs.js} +4 -2
  120. package/dist/esm/bal-carousel_2.entry.js +3 -3
  121. package/dist/esm/{bal-dropdown_3.entry.js → bal-check_7.entry.js} +815 -13
  122. package/dist/esm/bal-field_5.entry.js +3 -3
  123. package/dist/esm/bal-hint_5.entry.js +3 -3
  124. package/dist/esm/bal-list_8.entry.js +3 -3
  125. package/dist/esm/bal-logo.entry.js +3 -3
  126. package/dist/esm/bal-nav_8.entry.js +3 -3
  127. package/dist/esm/bal-navbar_5.entry.js +3 -3
  128. package/dist/esm/bal-pagination.entry.js +3 -3
  129. package/dist/esm/bal-progress-bar.entry.js +4 -4
  130. package/dist/esm/{bal-radio_2.entry.js → bal-radio_3.entry.js} +50 -1
  131. package/dist/esm/bal-segment_2.entry.js +4 -4
  132. package/dist/esm/bal-shape.entry.js +1 -1
  133. package/dist/esm/bal-steps.entry.js +3 -3
  134. package/dist/esm/bal-tab-item_2.entry.js +3 -3
  135. package/dist/esm/baloise-design-system.js +2 -3
  136. package/dist/esm/{breakpoints.decorator-DcfCKRvu.js → breakpoints.decorator-DwhK_t2m.js} +1 -1
  137. package/dist/esm/{breakpoints.subject-9qUvMXOC.js → breakpoints.subject-PxavGndB.js} +1 -1
  138. package/dist/esm/index.js +3 -3
  139. package/dist/esm/initialize-W3od-FM9.js +1 -1
  140. package/dist/esm/loader.js +2 -3
  141. package/dist/esm/{tokens.esm-CvA86VZU.js → tokens.esm-Dk6PruGq.js} +1 -1
  142. package/dist/esm/{window-resize.decorator-DNh3w5KW.js → window-resize.decorator-DiNYHJee.js} +1 -1
  143. package/dist/esm-es5/app-globals-Blx--ecs.js +1 -0
  144. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  145. package/dist/esm-es5/bal-check_7.entry.js +1 -0
  146. package/dist/esm-es5/bal-field_5.entry.js +1 -1
  147. package/dist/esm-es5/bal-hint_5.entry.js +1 -1
  148. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  149. package/dist/esm-es5/bal-logo.entry.js +1 -1
  150. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  151. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  152. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  153. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  154. package/dist/esm-es5/{bal-radio_2.entry.js → bal-radio_3.entry.js} +1 -1
  155. package/dist/esm-es5/bal-segment_2.entry.js +1 -1
  156. package/dist/esm-es5/bal-shape.entry.js +1 -1
  157. package/dist/esm-es5/bal-steps.entry.js +1 -1
  158. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  159. package/dist/esm-es5/baloise-design-system.js +1 -1
  160. package/dist/esm-es5/{breakpoints.decorator-DcfCKRvu.js → breakpoints.decorator-DwhK_t2m.js} +1 -1
  161. package/dist/esm-es5/{breakpoints.subject-9qUvMXOC.js → breakpoints.subject-PxavGndB.js} +1 -1
  162. package/dist/esm-es5/index.js +1 -1
  163. package/dist/esm-es5/initialize-W3od-FM9.js +1 -1
  164. package/dist/esm-es5/loader.js +1 -1
  165. package/dist/esm-es5/{window-resize.decorator-DNh3w5KW.js → window-resize.decorator-DiNYHJee.js} +1 -1
  166. package/dist/types/components.d.ts +0 -75
  167. package/package.json +6 -6
  168. package/components/bal-app2.js +0 -104
  169. package/components/bal-doc-app.d.ts +0 -11
  170. package/components/bal-doc-app.js +0 -264
  171. package/components/initialize.js +0 -450
  172. package/dist/baloise-design-system/p-00d493e589.system.entry.js +0 -1
  173. package/dist/baloise-design-system/p-21ea7b32f1.system.entry.js +0 -1
  174. package/dist/baloise-design-system/p-24185181f1.system.entry.js +0 -1
  175. package/dist/baloise-design-system/p-2dbbdfb785.system.entry.js +0 -1
  176. package/dist/baloise-design-system/p-5965694a0f.entry.js +0 -1
  177. package/dist/baloise-design-system/p-75f3abf19e.system.entry.js +0 -1
  178. package/dist/baloise-design-system/p-90d225c57c.system.entry.js +0 -1
  179. package/dist/baloise-design-system/p-9ca0a9bf5c.entry.js +0 -1
  180. package/dist/baloise-design-system/p-BvSkuJ_n.js +0 -1
  181. package/dist/baloise-design-system/p-BzIZLOtt.system.js +0 -1
  182. package/dist/baloise-design-system/p-C_qvcMEM.system.js +0 -1
  183. package/dist/baloise-design-system/p-DrynNwPm.system.js +0 -1
  184. package/dist/baloise-design-system/p-Ectc3YAG.js +0 -1
  185. package/dist/baloise-design-system/p-a97c5309f7.entry.js +0 -1
  186. package/dist/baloise-design-system/p-f217ad88a9.entry.js +0 -1
  187. package/dist/baloise-design-system/p-f7b16f08ab.entry.js +0 -1
  188. package/dist/baloise-design-system/p-fc9a46b295.entry.js +0 -1
  189. package/dist/cjs/app-globals-DcKvQZAC.js +0 -7
  190. package/dist/cjs/bal-check.cjs.entry.js +0 -55
  191. package/dist/cjs/bal-checkbox_2.cjs.entry.js +0 -734
  192. package/dist/cjs/bal-doc-app.cjs.entry.js +0 -231
  193. package/dist/cjs/bal-radio-icon.cjs.entry.js +0 -55
  194. package/dist/cjs/bal-switch.cjs.entry.js +0 -50
  195. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +0 -1
  196. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +0 -248
  197. package/dist/esm/app-globals-CIj5uAPM.js +0 -5
  198. package/dist/esm/bal-check.entry.js +0 -53
  199. package/dist/esm/bal-checkbox_2.entry.js +0 -731
  200. package/dist/esm/bal-doc-app.entry.js +0 -229
  201. package/dist/esm/bal-radio-icon.entry.js +0 -53
  202. package/dist/esm-es5/app-globals-CIj5uAPM.js +0 -1
  203. package/dist/esm-es5/bal-check.entry.js +0 -1
  204. package/dist/esm-es5/bal-checkbox_2.entry.js +0 -1
  205. package/dist/esm-es5/bal-doc-app.entry.js +0 -1
  206. package/dist/esm-es5/bal-dropdown_3.entry.js +0 -1
  207. package/dist/esm-es5/bal-radio-icon.entry.js +0 -1
  208. package/dist/esm-es5/bal-switch.entry.js +0 -1
  209. package/dist/esm-es5/global-Llrc69_N.js +0 -1
  210. package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +0 -21
  211. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +0 -82
  212. /package/dist/baloise-design-system/{p-CvA86VZU.js → p-Dk6PruGq.js} +0 -0
  213. /package/dist/baloise-design-system/{p-BpG6m494.system.js → p-Nqmo3uHl.system.js} +0 -0
  214. /package/dist/esm-es5/{tokens.esm-CvA86VZU.js → tokens.esm-Dk6PruGq.js} +0 -0
@@ -1,731 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-BdVwMG9u.js';
2
- import { _ as __decorate, a as __metadata } from './tslib.es6-dfXERft2.js';
3
- import { a as ariaBooleanToString } from './aria-DBsOHTWj.js';
4
- import { i as inheritAttributes } from './attributes-C4sZQbkT.js';
5
- import { B as BEM } from './bem-ByiN-QjD.js';
6
- import { F as FOCUS_KEYS } from './focus-visible-DqCbGYzv.js';
7
- import { d as defaultBalAriaForm } from './form-FCLKfv6B.js';
8
- import { s as stopEventBubbling, c as inputSetFocus, d as inputSetBlur } from './form-input-DYvzaBlM.js';
9
- import { i as isDescendant, v as hasTagName } from './helpers-BNj87EbG.js';
10
- import { L as Logger } from './log-CwssmmaV.js';
11
- import { L as ListenToElementStates } from './element-states.decorator-B68ANq1p.js';
12
- import { i as isSpaceKey } from './keyboard.helpers-BERg8BNc.js';
13
- import { a as areArraysEqual } from './array-CDfSqLEo.js';
14
- import { L as ListenToFocus } from './focus.decorator-C1s3OoqI.js';
15
- import { L as ListenToMutation } from './mutation.decorator-DhVeNnnY.js';
16
- import './browser-B1u-Mq75.js';
17
- import './config.utils-B7jugjyM.js';
18
- import './listener-CClDIhvK.js';
19
- import './index-zWZxKBfo.js';
20
- import './_commonjsHelpers-BFTU3MAI.js';
21
- import './index-B4k_dH6V.js';
22
-
23
- const balCheckboxCss = "@media (hover: hover)and (pointer: fine){.bal-checkbox.bal-focused{-webkit-box-shadow:var(--bal-focus-shadow) !important;box-shadow:var(--bal-focus-shadow) !important}}:root{--bal-checkbox-symbol-size:1.5rem;--bal-checkbox-symbol-border-width:2px;--bal-checkbox-symbol-background:transparent;--bal-checkbox-label-min-height:1.5rem;--bal-checkbox-button-background-hover:var(--bal-color-grey-2);--bal-checkbox-button-background-active:var(--bal-color-grey-2);--bal-checkbox-button-background-checked:var(--bal-color-primary);--bal-checkbox-button-background-checked-hover:var(--bal-color-light-blue-5);--bal-checkbox-button-background-checked-active:var(--bal-color-primary-6);--bal-checkbox-button-background-invalid:var(--bal-color-danger-1);--bal-checkbox-button-background-invalid-hover:var(--bal-color-danger-1);--bal-checkbox-button-background-invalid-active:var(--bal-color-danger-1);--bal-checkbox-button-background-invalid-checked:var(--bal-color-border-danger);--bal-checkbox-button-background-invalid-checked-hover:var(--bal-color-danger-5);--bal-checkbox-button-background-invalid-checked-active:var(--bal-color-danger-6);--bal-checkbox-button-background-disabled-hover-active:var(--bal-color-grey-2);--bal-checkbox-button-background-disabled-checked-hover-active:var(--bal-color-border-grey-dark);--bal-checkbox-button-background:transparent;--bal-checkbox-button-background-checked-green:var(--bal-color-green-1);--bal-checkbox-button-background-checked-purple:var(--bal-color-purple-1);--bal-checkbox-button-background-checked-red:var(--bal-color-red-1);--bal-checkbox-button-background-checked-yellow:var(--bal-color-yellow-1);--bal-checkbox-button-background-disabled:var(--bal-color-grey-1);--bal-checkbox-button-background-hover:var(--bal-color-grey-1);--bal-checkbox-button-border-color:var(--bal-color-primary);--bal-checkbox-button-border-color-hover:var(--bal-color-light-blue-5);--bal-checkbox-button-border-color-active:var(--bal-color-primary-6);--bal-checkbox-button-border-color-invalid:var(--bal-color-border-danger);--bal-checkbox-button-border-color-invalid-hover:var(--bal-color-danger-5);--bal-checkbox-button-border-color-invalid-active:var(--bal-color-danger-6);--bal-checkbox-button-border-color-invalid-checked:var(--bal-color-border-danger);--bal-checkbox-button-border-color-invalid-checked-hover:var(--bal-color-danger-5);--bal-checkbox-button-border-color-invalid-checked-active:var(--bal-color-danger-6);--bal-checkbox-button-border-color-disabled-hover-active:var(--bal-color-border-grey-dark);--bal-checkbox-button-border-color-disabled-checked-hover-active:var(--bal-color-border-grey-dark);--bal-checkbox-tile-background:transparent;--bal-checkbox-tile-background-hover:var(--bal-color-grey-1);--bal-checkbox-tile-background-disabled:var(--bal-color-grey-1);--bal-checkbox-tile-background-invalid-hover:var(--bal-color-danger-1);--bal-checkbox-tile-background-invalid-active:var(--bal-color-danger-1);--bal-checkbox-tile-background-checked-green:var(--bal-color-green-1);--bal-checkbox-tile-background-checked-purple:var(--bal-color-purple-1);--bal-checkbox-tile-background-checked-red:var(--bal-color-red-1);--bal-checkbox-tile-background-checked-yellow:var(--bal-color-yellow-1);--bal-checkbox-tile-border-style:var(--bal-form-field-control-border-style);--bal-checkbox-tile-border-radius:var(--bal-form-field-control-radius);--bal-checkbox-tile-border-width:var(--bal-form-field-control-border-width);--bal-checkbox-tile-padding:var(--bal-text-size-medium);--bal-checkbox-tile-border-color:var(--bal-color-border);--bal-checkbox-tile-border-color-hover:var(--bal-color-border-primary-hovered);--bal-checkbox-tile-border-color-active:var(--bal-color-border-primary-pressed);--bal-checkbox-tile-border-color-invalid-hover:var(--bal-color-border-danger-hovered);--bal-checkbox-tile-border-color-invalid-active:var(--bal-color-border-danger-pressed);--bal-checkbox-tile-border-color-checked:var(--bal-color-border-primary);--bal-checkbox-tile-border-color-invalid:var(--bal-color-border-danger);--bal-checkbox-tile-border-color-disabled:var(--bal-color-border-grey-dark)}.bal-checkbox{position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;outline:none;min-width:var(--bal-checkbox-symbol-size);border-radius:var(--bal-radius-normal);cursor:pointer}.bal-checkbox .bal-checkbox__label{cursor:pointer}.bal-checkbox--invisible{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}.bal-checkbox.bal-checkbox--flat{min-height:var(--bal-checkbox-symbol-size)}.bal-checkbox:not(.bal-checkbox--flat){min-height:3rem}.bal-checkbox--invalid{color:var(--bal-form-field-label-danger-color)}.bal-checkbox--disabled,.bal-checkbox--disabled .bal-checkbox__label{color:var(--bal-form-field-label-disabled-color);cursor:default}.bal-checkbox__input{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden;width:100%;height:100%}.bal-checkbox__label{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;gap:.5rem;-ms-flex-direction:row;flex-direction:row}.bal-checkbox__label__text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:left;contain:layout style;font-family:var(--bal-font-family-text);padding-top:.25rem;padding-bottom:.25rem;width:100%}.bal-checkbox__label__text--hidden{display:none}.bal-checkbox__label__icon{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}@media (hover: hover)and (pointer: fine){.bal-checkbox:not(.bal-checkbox--button):not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--hovered .bal-checkbox__label__text,.bal-checkbox:not(.bal-checkbox--button):not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):hover .bal-checkbox__label__text{color:var(--bal-color-text-primary-hovered)}.bal-checkbox:not(.bal-checkbox--button):not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--hovered .bal-checkbox__label__icon,.bal-checkbox:not(.bal-checkbox--button):not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):hover .bal-checkbox__label__icon{color:var(--bal-color-text-primary-hovered)}}.bal-checkbox:not(.bal-checkbox--button):not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--pressed .bal-checkbox__label__text,.bal-checkbox:not(.bal-checkbox--button):not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):active .bal-checkbox__label__text{color:var(--bal-color-text-primary-pressed)}.bal-checkbox:not(.bal-checkbox--button):not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--pressed .bal-checkbox__label__icon,.bal-checkbox:not(.bal-checkbox--button):not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):active .bal-checkbox__label__icon{color:var(--bal-color-text-primary-pressed)}@media (hover: hover)and (pointer: fine){.bal-checkbox--invalid:not(.bal-checkbox--button):not(.bal-checkbox--disabled).bal-checkbox--hovered .bal-checkbox__label__text,.bal-checkbox--invalid:not(.bal-checkbox--button):not(.bal-checkbox--disabled):hover .bal-checkbox__label__text{color:var(--bal-color-text-danger-hovered)}.bal-checkbox--invalid:not(.bal-checkbox--button):not(.bal-checkbox--disabled).bal-checkbox--hovered .bal-checkbox__label__icon,.bal-checkbox--invalid:not(.bal-checkbox--button):not(.bal-checkbox--disabled):hover .bal-checkbox__label__icon{color:var(--bal-color-text-danger-hovered)}}.bal-checkbox--invalid:not(.bal-checkbox--button):not(.bal-checkbox--disabled).bal-checkbox--pressed .bal-checkbox__label__text,.bal-checkbox--invalid:not(.bal-checkbox--button):not(.bal-checkbox--disabled):active .bal-checkbox__label__text{color:var(--bal-color-text-danger-pressed)}.bal-checkbox--invalid:not(.bal-checkbox--button):not(.bal-checkbox--disabled).bal-checkbox--pressed .bal-checkbox__label__icon,.bal-checkbox--invalid:not(.bal-checkbox--button):not(.bal-checkbox--disabled):active .bal-checkbox__label__icon{color:var(--bal-color-text-danger-pressed)}.bal-checkbox--button{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--bal-space-x-small);-ms-flex-pack:center;justify-content:center;-ms-flex-align:start;align-items:flex-start;padding-left:.75rem;padding-right:.75rem;min-width:3rem;border-width:2px;border-style:var(--bal-form-field-control-border-style);border-radius:var(--bal-form-field-control-radius);border-color:var(--bal-checkbox-button-border-color)}.bal-checkbox--button.bal-checkbox--checked{background:var(--bal-checkbox-button-background-checked);color:var(--bal-color-white)}.bal-checkbox--button.bal-checkbox--checked .bal-checkbox__label__text,.bal-checkbox--button.bal-checkbox--checked .bal-checkbox__label__text .link{color:var(--bal-color-white)}.bal-checkbox--button.bal-checkbox--invalid{border-color:var(--bal-color-border-danger);color:var(--bal-color-text-danger-hovered);background:var(--bal-color-danger-1)}.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked{color:var(--bal-color-white);background:var(--bal-color-border-danger)}.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked .bal-checkbox__label__text,.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked .bal-checkbox__label__text .link{color:var(--bal-color-white)}.bal-checkbox--button.bal-checkbox--disabled{border-color:var(--bal-color-grey-4);background:var(--bal-color-grey-2)}.bal-checkbox--button.bal-checkbox--disabled .bal-checkbox__label__text{color:var(--bal-color-text-grey)}.bal-checkbox--button.bal-checkbox--disabled.bal-checkbox--checked{background:var(--bal-color-grey-4);color:var(--bal-color-white)}.bal-checkbox--button.bal-checkbox--disabled.bal-checkbox--checked .bal-checkbox__label__text,.bal-checkbox--button.bal-checkbox--disabled.bal-checkbox--checked .bal-checkbox__label__text .link{color:var(--bal-color-white)}@media (hover: hover)and (pointer: fine){.bal-checkbox--button:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--hovered,.bal-checkbox--button:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):hover{background:var(--bal-color-grey-2);border-color:var(--bal-color-border-primary-hovered)}.bal-checkbox--button:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--hovered .bal-checkbox__label__text,.bal-checkbox--button:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):hover .bal-checkbox__label__text{color:var(--bal-color-text-primary-hovered)}}.bal-checkbox--button:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--pressed,.bal-checkbox--button:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):active{background:var(--bal-color-grey-2);border-color:var(--bal-color-border-primary-pressed)}.bal-checkbox--button:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--pressed .bal-checkbox__label__text,.bal-checkbox--button:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):active .bal-checkbox__label__text{color:var(--bal-color-text-primary-pressed)}@media (hover: hover)and (pointer: fine){.bal-checkbox--button.bal-checkbox--checked:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--hovered,.bal-checkbox--button.bal-checkbox--checked:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):hover{background:var(--bal-color-border-primary-hovered);border-color:var(--bal-color-border-primary-hovered)}.bal-checkbox--button.bal-checkbox--checked:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--hovered .bal-checkbox__label__text,.bal-checkbox--button.bal-checkbox--checked:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):hover .bal-checkbox__label__text{color:var(--bal-color-white)}}.bal-checkbox--button.bal-checkbox--checked:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--pressed,.bal-checkbox--button.bal-checkbox--checked:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):active{background:var(--bal-color-border-primary-pressed);border-color:var(--bal-color-border-primary-pressed)}.bal-checkbox--button.bal-checkbox--checked:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--pressed .bal-checkbox__label__text,.bal-checkbox--button.bal-checkbox--checked:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):active .bal-checkbox__label__text{color:var(--bal-color-white)}@media (hover: hover)and (pointer: fine){.bal-checkbox--button.bal-checkbox--invalid:not(.bal-checkbox--disabled).bal-checkbox--hovered,.bal-checkbox--button.bal-checkbox--invalid:not(.bal-checkbox--disabled):hover{background:var(--bal-color-danger-1);border-color:var(--bal-color-border-danger-hovered)}.bal-checkbox--button.bal-checkbox--invalid:not(.bal-checkbox--disabled).bal-checkbox--hovered .bal-checkbox__label__text,.bal-checkbox--button.bal-checkbox--invalid:not(.bal-checkbox--disabled):hover .bal-checkbox__label__text{color:var(--bal-color-text-danger-hovered)}}.bal-checkbox--button.bal-checkbox--invalid:not(.bal-checkbox--disabled).bal-checkbox--pressed,.bal-checkbox--button.bal-checkbox--invalid:not(.bal-checkbox--disabled):active{background:var(--bal-color-danger-1);border-color:var(--bal-color-border-danger-pressed)}.bal-checkbox--button.bal-checkbox--invalid:not(.bal-checkbox--disabled).bal-checkbox--pressed .bal-checkbox__label__text,.bal-checkbox--button.bal-checkbox--invalid:not(.bal-checkbox--disabled):active .bal-checkbox__label__text{color:var(--bal-color-text-danger-pressed)}@media (hover: hover)and (pointer: fine){.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked:not(.bal-checkbox--disabled).bal-checkbox--hovered,.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked:not(.bal-checkbox--disabled):hover{background:var(--bal-color-border-danger-hovered);border-color:var(--bal-color-border-danger-hovered)}.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked:not(.bal-checkbox--disabled).bal-checkbox--hovered .bal-checkbox__label__text,.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked:not(.bal-checkbox--disabled):hover .bal-checkbox__label__text{color:var(--bal-color-white)}}.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked:not(.bal-checkbox--disabled).bal-checkbox--pressed,.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked:not(.bal-checkbox--disabled):active{background:var(--bal-color-border-danger-pressed);border-color:var(--bal-color-border-danger-pressed)}.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked:not(.bal-checkbox--disabled).bal-checkbox--pressed .bal-checkbox__label__text,.bal-checkbox--button.bal-checkbox--invalid.bal-checkbox--checked:not(.bal-checkbox--disabled):active .bal-checkbox__label__text{color:var(--bal-color-white)}.bal-checkbox--tile{display:block;-ms-flex:0 0 100%;flex:0 0 100%;background:var(--bal-checkbox-tile-background);border-style:var(--bal-checkbox-tile-border-style);border-radius:var(--bal-checkbox-tile-border-radius);border-width:var(--bal-checkbox-tile-border-width);border-color:var(--bal-checkbox-tile-border-color);padding:var(--bal-checkbox-tile-padding)}.bal-checkbox--tile .bal-checkbox__label{height:100%;-ms-flex-align:stretch;align-items:stretch}.bal-checkbox--tile.bal-checkbox--checked{border-color:var(--bal-checkbox-tile-border-color-checked)}.bal-checkbox--tile.bal-checkbox--invalid{border-color:var(--bal-checkbox-tile-border-color-invalid)}.bal-checkbox--tile.bal-checkbox--disabled{background:var(--bal-checkbox-tile-background-disabled);border-color:var(--bal-checkbox-tile-border-color-disabled);cursor:default}@media (hover: hover)and (pointer: fine){.bal-checkbox--tile:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--hovered,.bal-checkbox--tile:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):hover{background:var(--bal-checkbox-tile-background-hover);border-color:var(--bal-checkbox-tile-border-color-hover)}}.bal-checkbox--tile:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid).bal-checkbox--pressed,.bal-checkbox--tile:not(.bal-checkbox--disabled):not(.bal-checkbox--invalid):active{background:var(--bal-checkbox-tile-background-hover);border-color:var(--bal-checkbox-tile-border-color-active)}@media (hover: hover)and (pointer: fine){.bal-checkbox--tile.bal-checkbox--invalid:not(.bal-checkbox--disabled).bal-checkbox--hovered,.bal-checkbox--tile.bal-checkbox--invalid:not(.bal-checkbox--disabled):hover{background:var(--bal-checkbox-tile-background-invalid-hover);border-color:var(--bal-checkbox-tile-border-color-invalid-hover)}}.bal-checkbox--tile.bal-checkbox--invalid:not(.bal-checkbox--disabled).bal-checkbox--pressed,.bal-checkbox--tile.bal-checkbox--invalid:not(.bal-checkbox--disabled):active{background:var(--bal-checkbox-tile-background-invalid-active);border-color:var(--bal-checkbox-tile-border-color-invalid-active)}.bal-checkbox--tile-color-green:not(.bal-checkbox--disabled).bal-checkbox--checked,.bal-checkbox--tile-color-green:not(.bal-checkbox--disabled).bal-checkbox--checked.bal-checkbox--hovered,.bal-checkbox--tile-color-green:not(.bal-checkbox--disabled).bal-checkbox--checked:hover{background:var(--bal-checkbox-tile-background-checked-green)}.bal-checkbox--tile-color-red:not(.bal-checkbox--disabled).bal-checkbox--checked,.bal-checkbox--tile-color-red:not(.bal-checkbox--disabled).bal-checkbox--checked.bal-checkbox--hovered,.bal-checkbox--tile-color-red:not(.bal-checkbox--disabled).bal-checkbox--checked:hover{background:var(--bal-checkbox-tile-background-checked-red)}.bal-checkbox--tile-color-purple:not(.bal-checkbox--disabled).bal-checkbox--checked,.bal-checkbox--tile-color-purple:not(.bal-checkbox--disabled).bal-checkbox--checked.bal-checkbox--hovered,.bal-checkbox--tile-color-purple:not(.bal-checkbox--disabled).bal-checkbox--checked:hover{background:var(--bal-checkbox-tile-background-checked-purple)}.bal-checkbox--tile-color-yellow:not(.bal-checkbox--disabled).bal-checkbox--checked,.bal-checkbox--tile-color-yellow:not(.bal-checkbox--disabled).bal-checkbox--checked.bal-checkbox--hovered,.bal-checkbox--tile-color-yellow:not(.bal-checkbox--disabled).bal-checkbox--checked:hover{background:var(--bal-checkbox-tile-background-checked-yellow)}@media screen and (min-width: 769px),print{.bal-checkbox--column-2{-ms-flex:0 0 calc(50% - var(--bal-space-normal)*1/2);flex:0 0 calc(50% - var(--bal-space-normal)*1/2)}.bal-checkbox--column-3{-ms-flex:0 0 calc(33.3333333333% - var(--bal-space-normal)*2/3);flex:0 0 calc(33.3333333333% - var(--bal-space-normal)*2/3)}.bal-checkbox--column-4{-ms-flex:0 0 calc(25% - var(--bal-space-normal)*3/4);flex:0 0 calc(25% - var(--bal-space-normal)*3/4)}}@media screen and (max-width: 768px){.bal-checkbox--column-mobile-2{-ms-flex:0 0 calc(50% - var(--bal-space-normal)*1/2);flex:0 0 calc(50% - var(--bal-space-normal)*1/2)}.bal-checkbox--column-mobile-3{-ms-flex:0 0 calc(33.3333333333% - var(--bal-space-normal)*2/3);flex:0 0 calc(33.3333333333% - var(--bal-space-normal)*2/3)}.bal-checkbox--column-mobile-4{-ms-flex:0 0 calc(25% - var(--bal-space-normal)*3/4);flex:0 0 calc(25% - var(--bal-space-normal)*3/4)}}@media screen and (min-width: 769px),print{.bal-checkbox--column-tablet-2{-ms-flex:0 0 calc(50% - var(--bal-space-normal)*1/2);flex:0 0 calc(50% - var(--bal-space-normal)*1/2)}.bal-checkbox--column-tablet-3{-ms-flex:0 0 calc(33.3333333333% - var(--bal-space-normal)*2/3);flex:0 0 calc(33.3333333333% - var(--bal-space-normal)*2/3)}.bal-checkbox--column-tablet-4{-ms-flex:0 0 calc(25% - var(--bal-space-normal)*3/4);flex:0 0 calc(25% - var(--bal-space-normal)*3/4)}}@media screen and (min-width: 1024px){.bal-checkbox--column-2{-ms-flex:0 0 calc(50% - var(--bal-space-normal)*1/2);flex:0 0 calc(50% - var(--bal-space-normal)*1/2)}.bal-checkbox--column-3{-ms-flex:0 0 calc(33.3333333333% - var(--bal-space-normal)*2/3);flex:0 0 calc(33.3333333333% - var(--bal-space-normal)*2/3)}.bal-checkbox--column-4{-ms-flex:0 0 calc(25% - var(--bal-space-normal)*3/4);flex:0 0 calc(25% - var(--bal-space-normal)*3/4)}}";
24
-
25
- const Checkbox = class {
26
- constructor(hostRef) {
27
- registerInstance(this, hostRef);
28
- this.balFocus = createEvent(this, "balFocus");
29
- this.balBlur = createEvent(this, "balBlur");
30
- this.balChange = createEvent(this, "balChange");
31
- this.inputId = `bal-cb-${checkboxIds++}`;
32
- this.inheritedAttributes = {};
33
- this.keyboardMode = true;
34
- this.hasLabel = true;
35
- this.focused = false;
36
- this.ariaForm = defaultBalAriaForm;
37
- /**
38
- * Track focus state
39
- * If `true` checkbox needs to remain focused
40
- */
41
- this.wasFocused = false;
42
- this.outerElementState = {
43
- hovered: false,
44
- pressed: false,
45
- };
46
- this.innerElementState = {
47
- hovered: false,
48
- pressed: false,
49
- };
50
- this.mergedElementState = {
51
- hovered: false,
52
- pressed: false,
53
- };
54
- /**
55
- * PUBLIC PROPERTY API
56
- * ------------------------------------------------------
57
- */
58
- /**
59
- * The name of the control, which is submitted with the form data.
60
- */
61
- this.name = this.inputId;
62
- /**
63
- * Label of the radio item.
64
- */
65
- this.label = '';
66
- /**
67
- * If `true` the checkbox has no label
68
- */
69
- this.labelHidden = false;
70
- /**
71
- * If `true` the control is no padding
72
- */
73
- this.flat = false;
74
- /**
75
- * Defines the layout of the checkbox button
76
- */
77
- this.interface = 'checkbox';
78
- /**
79
- * A DOMString representing the value of the checkbox. This is not displayed on the
80
- * client-side, but on the server this is the value given to the data
81
- * submitted with the checkbox's name.
82
- */
83
- this.value = 'on';
84
- /**
85
- * If `true`, the checkbox is selected.
86
- */
87
- this.checked = false;
88
- this.initialValue = false;
89
- /**
90
- * If `true`, the element is not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants.
91
- */
92
- this.disabled = false;
93
- /**
94
- * If `true` the element can not mutated, meaning the user can not edit the control.
95
- */
96
- this.readonly = false;
97
- /**
98
- * If `true`, the user must fill in a value before submitting a form.
99
- */
100
- this.required = false;
101
- /**
102
- * If `true`, in Angular reactive forms the control will not be set invalid
103
- */
104
- this.autoInvalidOff = false;
105
- /**
106
- * If `true`, the value will not be send with a form submit
107
- */
108
- this.nonSubmit = false;
109
- /**
110
- * If `true` the component gets a invalid style.
111
- */
112
- this.invalid = false;
113
- /**
114
- * @internal
115
- */
116
- this.hovered = false;
117
- /**
118
- * @internal
119
- */
120
- this.pressed = false;
121
- /**
122
- * @internal
123
- */
124
- this.colSize = 1;
125
- /**
126
- * @internal
127
- */
128
- this.colSizeTablet = 1;
129
- /**
130
- * @internal
131
- */
132
- this.colSizeMobile = 1;
133
- this.setChecked = (state) => {
134
- this.checked = state;
135
- this.balChange.emit(this.checked);
136
- };
137
- this.toggleChecked = (ev) => {
138
- ev.preventDefault();
139
- this.setFocus();
140
- this.setChecked(!this.checked);
141
- };
142
- this.onClick = (ev) => {
143
- if (this.disabled) {
144
- return;
145
- }
146
- const element = ev.target;
147
- if (element && element.href) {
148
- return;
149
- }
150
- if (this.wasFocused) {
151
- this.focused = true;
152
- }
153
- this.toggleChecked(ev);
154
- };
155
- this.onFocus = (ev) => {
156
- if (this.disabled || this.readonly) {
157
- this.focused = false;
158
- return stopEventBubbling(ev);
159
- }
160
- this.balFocus.emit(ev);
161
- if (this.keyboardMode) {
162
- this.focused = true;
163
- this.wasFocused = true;
164
- }
165
- };
166
- this.onBlur = (ev) => {
167
- if (this.disabled || this.readonly) {
168
- return stopEventBubbling(ev);
169
- }
170
- this.balBlur.emit(ev);
171
- this.focused = false;
172
- };
173
- this.onPointerDown = () => (this.keyboardMode = false);
174
- this.onKeydown = (ev) => {
175
- if (!isSpaceKey(ev)) {
176
- this.wasFocused = false;
177
- }
178
- this.keyboardMode = FOCUS_KEYS.includes(ev.key);
179
- };
180
- }
181
- createLogger(log) {
182
- this.log = log;
183
- }
184
- hoveredChanged() {
185
- this.innerElementState = {
186
- hovered: this.hovered,
187
- pressed: this.pressed,
188
- };
189
- this.mergeElementState();
190
- }
191
- pressedChanged() {
192
- this.innerElementState = {
193
- hovered: this.hovered,
194
- pressed: this.pressed,
195
- };
196
- this.mergeElementState();
197
- }
198
- /**
199
- * LIFECYCLE
200
- * ------------------------------------------------------
201
- */
202
- connectedCallback() {
203
- this.hoveredChanged();
204
- if (this.group) {
205
- this.updateState();
206
- this.group.addEventListener('balChange', () => this.updateState());
207
- }
208
- this.initialValue = this.checked;
209
- this.el.addEventListener('keydown', this.onKeydown);
210
- this.el.addEventListener('touchstart', this.onPointerDown);
211
- this.el.addEventListener('mousedown', this.onPointerDown);
212
- }
213
- componentWillLoad() {
214
- this.inheritedAttributes = inheritAttributes(this.el, ['aria-label', 'tabindex', 'title']);
215
- }
216
- componentWillRender() {
217
- this.interactionChildElements.forEach(el => {
218
- el.disabled = this.disabled || this.readonly;
219
- el.invalid = this.invalid;
220
- el.checked = this.checked;
221
- });
222
- }
223
- disconnectedCallback() {
224
- if (this.group) {
225
- this.group.removeEventListener('balChange', () => this.updateState());
226
- }
227
- this.el.removeEventListener('keydown', this.onKeydown);
228
- this.el.removeEventListener('touchstart', this.onPointerDown);
229
- this.el.removeEventListener('mousedown', this.onPointerDown);
230
- }
231
- /**
232
- * LISTENERS
233
- * ------------------------------------------------------
234
- */
235
- listenOnClick(ev) {
236
- if ((this.disabled || this.readonly) &&
237
- ev.target &&
238
- (ev.target === this.el || isDescendant(this.el, ev.target))) {
239
- stopEventBubbling(ev);
240
- }
241
- }
242
- resetHandler(ev) {
243
- const formElement = ev.target;
244
- if (formElement === null || formElement === void 0 ? void 0 : formElement.contains(this.el)) {
245
- this.checked = this.initialValue;
246
- }
247
- }
248
- elementStateListener(info) {
249
- this.outerElementState = info;
250
- this.mergeElementState();
251
- }
252
- /**
253
- * PUBLIC METHODS
254
- * ------------------------------------------------------
255
- */
256
- /**
257
- * Sets the focus on the checkbox input element.
258
- */
259
- async setFocus() {
260
- inputSetFocus(this);
261
- }
262
- /**
263
- * Sets blur on the native `input`. Use this method instead of the global
264
- * `input.blur()`.
265
- * @internal
266
- */
267
- async setBlur() {
268
- inputSetBlur(this);
269
- }
270
- /**
271
- * Returns the native `<input>` element used under the hood.
272
- */
273
- getInputElement() {
274
- return Promise.resolve(this.nativeInput);
275
- }
276
- /**
277
- * Options of the tab like label, value etc.
278
- */
279
- async getOption() {
280
- return this.option;
281
- }
282
- /**
283
- * @internal
284
- */
285
- async updateState() {
286
- if (this.group && this.group.control && Array.isArray(this.group.value)) {
287
- const newChecked = this.group.value.includes(this.value);
288
- if (newChecked !== this.checked) {
289
- this.checked = newChecked;
290
- }
291
- }
292
- }
293
- /**
294
- * @internal
295
- */
296
- async setAriaForm(ariaForm) {
297
- this.ariaForm = Object.assign({}, ariaForm);
298
- }
299
- /**
300
- * GETTERS
301
- * ------------------------------------------------------
302
- */
303
- get group() {
304
- return this.el.closest('bal-checkbox-group');
305
- }
306
- get interactionChildElements() {
307
- return Array.from(this.el.querySelectorAll('bal-check, bal-switch, bal-icon'));
308
- }
309
- get option() {
310
- return {
311
- name: this.name,
312
- value: this.value,
313
- checked: this.checked,
314
- label: this.label,
315
- labelHidden: this.labelHidden,
316
- flat: this.flat,
317
- interface: this.interface,
318
- disabled: this.disabled,
319
- readonly: this.readonly,
320
- required: this.required,
321
- nonSubmit: this.nonSubmit,
322
- invalid: this.invalid,
323
- };
324
- }
325
- /**
326
- * EVENT HANDLERS
327
- * ------------------------------------------------------
328
- */
329
- mergeElementState() {
330
- this.mergedElementState = {
331
- hovered: this.outerElementState.hovered || this.innerElementState.hovered,
332
- pressed: this.outerElementState.pressed || this.innerElementState.pressed,
333
- };
334
- this.interactionChildElements.forEach(el => {
335
- el.hovered = this.mergedElementState.hovered;
336
- el.pressed = this.mergedElementState.pressed;
337
- });
338
- }
339
- /**
340
- * RENDER
341
- * ------------------------------------------------------
342
- */
343
- render() {
344
- const block = BEM.block('checkbox');
345
- const inputEl = block.element('input');
346
- const labelEl = block.element('label');
347
- const labelTextEl = labelEl.element('text');
348
- const labelIconEl = labelEl.element('icon');
349
- const focused = this.focused && this.buttonTabindex !== -1;
350
- const inputAttributes = this.inheritedAttributes;
351
- if (this.buttonTabindex !== undefined) {
352
- inputAttributes.tabIndex = this.buttonTabindex;
353
- }
354
- const hasFormControl = !this.nonSubmit;
355
- const id = this.ariaForm.controlId || this.inputId;
356
- const labelId = this.ariaForm.labelId || null;
357
- const LabelTag = hasFormControl ? 'label' : 'span';
358
- const Icon = this.interface === 'switch' ? 'bal-switch' : 'bal-check';
359
- return (h(Host, { key: 'eaa9cf2ba9de2a203b98515939ff117c89dc16cf', "aria-checked": `${this.checked}`, "aria-disabled": ariaBooleanToString(this.disabled), "aria-invalid": this.invalid === true ? 'true' : 'false', "aria-hidden": ariaBooleanToString(this.disabled || this.nonSubmit), "aria-focused": focused ? 'true' : null, "aria-labelledby": labelId, "aria-describedby": this.ariaForm.messageId, class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ 'bal-focused': focused }, block.class()), block.modifier('checkbox').class()), block.modifier('button').class(this.interface === 'button')), block.modifier('switch').class(this.interface === 'switch')), block.modifier('tile').class(this.interface === 'tile')), block.modifier(`tile-color-${this.color}`).class(this.interface === 'tile' && !!this.color)), block.modifier('focused').class(this.focused)), block.modifier('invalid').class(this.invalid)), block.modifier('checked').class(this.checked)), block.modifier('flat').class(this.flat)), block.modifier('disabled').class(this.disabled || this.readonly)), block.modifier('hovered').class(this.mergedElementState.hovered)), block.modifier('pressed').class(this.mergedElementState.pressed)), block.modifier(`column-${this.colSize}`).class(this.interface === 'tile' && this.colSize > 1)), block
360
- .modifier(`column-tablet-${this.colSizeTablet}`)
361
- .class(this.interface === 'tile' && this.colSizeTablet > 1)), block
362
- .modifier(`column-mobile-${this.colSizeMobile}`)
363
- .class(this.interface === 'tile' && this.colSizeMobile > 1)), onClick: this.onClick }, h(LabelTag, { key: '6fd849f4768bc7155eb5db297713bc82aeab6dfe', class: Object.assign({}, labelEl.class()), "data-testid": "bal-checkbox-label" }, hasFormControl ? (h("input", Object.assign({ id: id, type: "checkbox", "data-testid": "bal-checkbox-input", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled || this.nonSubmit, readonly: this.readonly, class: Object.assign({}, inputEl.class()), "aria-hidden": ariaBooleanToString(this.nonSubmit), "aria-invalid": this.invalid === true ? 'true' : 'false', "aria-describedby": this.ariaForm.messageId, onChange: ev => this.toggleChecked(ev), onFocus: ev => this.onFocus(ev), onBlur: ev => this.onBlur(ev), ref: inputEl => (this.nativeInput = inputEl) }, inputAttributes))) : (''), this.interface !== 'tile' ? (h("div", { class: Object.assign({}, labelIconEl.class()) }, h(Icon, { checked: this.checked, disabled: this.disabled || this.readonly, invalid: this.invalid, inverted: this.interface === 'button' && this.checked, hovered: this.mergedElementState.hovered, pressed: this.mergedElementState.pressed }))) : (''), h("div", { key: 'ca1ec209d9211082db1d0905e599eea5e6803244', class: Object.assign(Object.assign({}, labelTextEl.class()), labelTextEl.modifier('hidden').class(this.labelHidden)) }, h("slot", { key: 'a2a3c8124d7d47bf300b229fe01e62fa198961c0' })))));
364
- }
365
- get el() { return getElement(this); }
366
- static get watchers() { return {
367
- "hovered": ["hoveredChanged"],
368
- "pressed": ["pressedChanged"]
369
- }; }
370
- };
371
- __decorate([
372
- Logger('bal-checkbox'),
373
- __metadata("design:type", Function),
374
- __metadata("design:paramtypes", [Function]),
375
- __metadata("design:returntype", void 0)
376
- ], Checkbox.prototype, "createLogger", null);
377
- __decorate([
378
- ListenToElementStates(),
379
- __metadata("design:type", Function),
380
- __metadata("design:paramtypes", [Object]),
381
- __metadata("design:returntype", void 0)
382
- ], Checkbox.prototype, "elementStateListener", null);
383
- let checkboxIds = 0;
384
- Checkbox.style = balCheckboxCss;
385
-
386
- const balCheckboxGroupCss = ".bal-checkbox-group{display:inline-block;position:relative;width:100%}.bal-checkbox-group__inner{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:stretch;align-items:stretch;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:var(--bal-space-normal)}.bal-checkbox-group__inner--button{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex:1;flex:1;gap:var(--bal-space-x-small)}@media screen and (min-width: 769px),print{.bal-checkbox-group__inner--button{-ms-flex-direction:row;flex-direction:row}}.bal-checkbox-group__inner--expanded{-ms-flex-align:stretch;align-items:stretch}.bal-checkbox-group__inner--expanded .bal-checkbox{-ms-flex:1;flex:1}@media screen and (max-width: 768px){.bal-checkbox-group__inner--expanded .bal-checkbox{width:100%}}.bal-checkbox-group__inner--button.bal-checkbox-group__inner--vertical{gap:var(--bal-space-x-small)}.bal-checkbox-group__inner--vertical{-ms-flex-direction:column;flex-direction:column;border-radius:var(--bal-radius-normal);gap:0}@media screen and (min-width: 769px),print{.bal-checkbox-group__inner--vertical{-ms-flex-align:start;align-items:flex-start}}@media screen and (max-width: 768px){.bal-checkbox-group__inner--vertical-mobile{-ms-flex-direction:column;flex-direction:column;border-radius:var(--bal-radius-normal);gap:0}}";
387
-
388
- const CheckboxGroup = class {
389
- constructor(hostRef) {
390
- registerInstance(this, hostRef);
391
- this.balChange = createEvent(this, "balChange");
392
- this.balFocus = createEvent(this, "balFocus");
393
- this.balBlur = createEvent(this, "balBlur");
394
- this.inputId = `bal-cg-${checkboxGroupIds++}`;
395
- this.inheritedAttributes = {};
396
- this.ariaForm = defaultBalAriaForm;
397
- /**
398
- * Defines the layout of the checkbox button
399
- */
400
- this.interface = undefined;
401
- /**
402
- * If `true` it acts as the main form control
403
- */
404
- this.control = false;
405
- /**
406
- * The name of the control, which is submitted with the form data.
407
- */
408
- this.name = this.inputId;
409
- /**
410
- * Displays the checkboxes vertically
411
- */
412
- this.vertical = false;
413
- /**
414
- * If `true`, the controls will be vertically on mobile devices.
415
- */
416
- this.verticalOnMobile = false;
417
- /**
418
- * Uses the whole width
419
- */
420
- this.expanded = false;
421
- /**
422
- * If `true`, the element is not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants.
423
- */
424
- this.invalid = undefined;
425
- /**
426
- * If `true`, the user cannot interact with the checkboxes.
427
- */
428
- this.disabled = undefined;
429
- /**
430
- * If `true`, the user cannot interact with the checkboxes.
431
- */
432
- this.readonly = undefined;
433
- /**
434
- * The value of the control.
435
- */
436
- this.value = [];
437
- /**
438
- * Defines the column size like the grid.
439
- */
440
- this.columns = 1;
441
- /**
442
- * Defines the column size for tablet and bigger like the grid.
443
- */
444
- this.columnsTablet = 1;
445
- /**
446
- * Defines the column size for mobile and bigger like the grid.
447
- */
448
- this.columnsMobile = 1;
449
- /**
450
- * If `true`, in Angular reactive forms the control will not be set invalid
451
- */
452
- this.autoInvalidOff = false;
453
- /**
454
- * LISTENERS
455
- * ------------------------------------------------------
456
- */
457
- this.hasFocus = false;
458
- this.mutationObserverActive = true;
459
- /**
460
- * EVENT BINDING
461
- * ------------------------------------------------------
462
- */
463
- this.onClick = (ev) => {
464
- if (!this.control) {
465
- return;
466
- }
467
- const element = ev.target;
468
- if (element.href) {
469
- return;
470
- }
471
- const selectedCheckbox = ev.target && ev.target.closest('bal-checkbox');
472
- if (selectedCheckbox) {
473
- if (selectedCheckbox.disabled || selectedCheckbox.readonly) {
474
- return ev.stopPropagation();
475
- }
476
- }
477
- this.updateValues();
478
- };
479
- this.onOptionChange = async () => {
480
- this.sync();
481
- };
482
- }
483
- createLogger(log) {
484
- this.log = log;
485
- }
486
- async optionChanged() {
487
- if (this.control) {
488
- this.onOptionChange();
489
- this.mutationObserverActive = this.options === undefined;
490
- }
491
- }
492
- invalidChanged(value) {
493
- if (this.control) {
494
- if (value !== undefined) {
495
- this.getCheckboxes().forEach(child => {
496
- child.invalid = value;
497
- });
498
- }
499
- }
500
- }
501
- disabledChanged(value) {
502
- if (this.control) {
503
- if (value !== undefined) {
504
- this.getCheckboxes().forEach(child => {
505
- child.disabled = value;
506
- });
507
- }
508
- }
509
- }
510
- readonlyChanged(value) {
511
- if (this.control) {
512
- if (value !== undefined) {
513
- this.getCheckboxes().forEach(child => {
514
- child.readonly = value;
515
- });
516
- }
517
- }
518
- }
519
- valueChanged(_value, oldValue) {
520
- if (this.control) {
521
- if (!areArraysEqual(this.value, oldValue)) {
522
- this.onOptionChange();
523
- }
524
- }
525
- else {
526
- this.onOptionChange();
527
- }
528
- }
529
- columnsChanged(value) {
530
- this.getCheckboxes().forEach(checkbox => (checkbox.colSize = value));
531
- }
532
- columnsTabletChanged(value) {
533
- this.getCheckboxes().forEach(checkbox => (checkbox.colSizeTablet = value));
534
- }
535
- columnsMobileChanged(value) {
536
- this.getCheckboxes().forEach(checkbox => (checkbox.colSizeMobile = value));
537
- }
538
- /**
539
- * LIFECYCLE
540
- * ------------------------------------------------------
541
- */
542
- connectedCallback() {
543
- if (this.control) {
544
- this.mutationObserverActive = this.options === undefined;
545
- this.valueChanged(this.value, []);
546
- }
547
- }
548
- componentWillLoad() {
549
- if (this.control) {
550
- this.inheritedAttributes = inheritAttributes(this.el, ['aria-label', 'tabindex', 'title']);
551
- this.disabledChanged(this.disabled);
552
- this.invalidChanged(this.invalid);
553
- this.readonlyChanged(this.readonly);
554
- }
555
- this.columnsChanged(this.columns);
556
- this.columnsTabletChanged(this.columnsTablet);
557
- this.columnsMobileChanged(this.columnsMobile);
558
- this.onOptionChange();
559
- }
560
- focusInListener(ev) {
561
- this.balFocus.emit(ev);
562
- }
563
- focusOutListener(ev) {
564
- this.balBlur.emit(ev);
565
- }
566
- mutationListener() {
567
- if (this.control) {
568
- this.disabledChanged(this.disabled);
569
- this.readonlyChanged(this.readonly);
570
- }
571
- this.columnsChanged(this.columns);
572
- this.columnsTabletChanged(this.columnsTablet);
573
- this.columnsMobileChanged(this.columnsMobile);
574
- this.onOptionChange();
575
- }
576
- listenOnCheckboxChange(ev) {
577
- if (this.control) {
578
- if (isDescendant(this.el, ev.target)) {
579
- stopEventBubbling(ev);
580
- this.updateValues();
581
- }
582
- }
583
- }
584
- resetHandler(ev) {
585
- const formElement = ev.target;
586
- if (formElement === null || formElement === void 0 ? void 0 : formElement.contains(this.el)) {
587
- if (this.control) {
588
- this.value = [];
589
- }
590
- this.onOptionChange();
591
- }
592
- }
593
- checkboxFocusListener(ev) {
594
- const { target } = ev;
595
- if (target && isDescendant(this.el, target) && hasTagName(target, 'bal-checkbox')) {
596
- stopEventBubbling(ev);
597
- }
598
- }
599
- checkboxBlurListener(ev) {
600
- const { target } = ev;
601
- if (target && isDescendant(this.el, target) && hasTagName(target, 'bal-checkbox')) {
602
- stopEventBubbling(ev);
603
- }
604
- }
605
- /**
606
- * PUBLIC METHODS
607
- * ------------------------------------------------------
608
- */
609
- /** @internal */
610
- async setValue(value) {
611
- if (this.control) {
612
- this.value = value;
613
- }
614
- }
615
- /**
616
- * Find the options properties by its value
617
- */
618
- async getOptionByValue(value) {
619
- const options = this.options;
620
- if (options) {
621
- return options.find(option => option.value === value);
622
- }
623
- return undefined;
624
- }
625
- /**
626
- * @internal
627
- */
628
- async setAriaForm(ariaForm) {
629
- this.ariaForm = Object.assign({}, ariaForm);
630
- }
631
- /**
632
- * PRIVATE METHODS
633
- * ------------------------------------------------------
634
- */
635
- sync() {
636
- if (this.control) {
637
- const isChecked = (checkbox) => {
638
- for (let index = 0; index < this.value.length; index++) {
639
- const valueItem = this.value[index];
640
- if (valueItem !== undefined && valueItem.toString() === checkbox.value.toString()) {
641
- return true;
642
- }
643
- }
644
- return false;
645
- };
646
- this.getCheckboxes().forEach((checkbox) => {
647
- checkbox.checked = isChecked(checkbox);
648
- });
649
- }
650
- this.getCheckboxes().forEach((checkbox) => {
651
- if (this.interface) {
652
- checkbox.interface = this.interface;
653
- }
654
- });
655
- }
656
- /**
657
- * GETTERS
658
- * ------------------------------------------------------
659
- */
660
- getCheckboxes() {
661
- return Array.from(this.el.querySelectorAll('bal-checkbox'));
662
- }
663
- updateValues() {
664
- // generate new value array out of the checked checkboxes
665
- const newValue = [];
666
- this.getCheckboxes().forEach(cb => {
667
- if (cb.checked) {
668
- newValue.push(cb.value);
669
- }
670
- });
671
- if (!areArraysEqual(this.value, newValue)) {
672
- this.value = [...newValue];
673
- this.balChange.emit(this.value);
674
- }
675
- }
676
- /**
677
- * RENDER
678
- * ------------------------------------------------------
679
- */
680
- render() {
681
- const block = BEM.block('checkbox-group');
682
- const innerEl = block.element('inner');
683
- const rawOptions = this.options || [];
684
- const options = rawOptions.map(option => {
685
- if (typeof option.html === 'function') {
686
- return Object.assign(Object.assign({}, option), { html: option.html() });
687
- }
688
- return option;
689
- });
690
- return (h(Host, Object.assign({ class: Object.assign({}, block.class()), role: "group", "aria-labelledby": this.ariaForm.labelId, "aria-describedby": this.ariaForm.messageId, "aria-disabled": ariaBooleanToString(this.disabled), "aria-invalid": ariaBooleanToString(this.invalid), onClick: this.onClick }, this.inheritedAttributes), h("div", { class: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, innerEl.class()), innerEl.modifier('vertical-mobile').class(this.verticalOnMobile)), innerEl.modifier('vertical').class(this.vertical)), innerEl.modifier('expanded').class(this.expanded)), innerEl.modifier('button').class(this.interface === 'button')) }, h("slot", null), options.map(option => (h("bal-checkbox", { key: option.value, name: option.name, value: option.value, labelHidden: option.labelHidden, flat: option.flat, interface: option.interface, disabled: option.disabled, readonly: option.readonly, required: option.required, nonSubmit: !!option.nonSubmit, invalid: option.invalid, innerHTML: option.html }))))));
691
- }
692
- get el() { return getElement(this); }
693
- static get watchers() { return {
694
- "options": ["optionChanged"],
695
- "invalid": ["invalidChanged"],
696
- "disabled": ["disabledChanged"],
697
- "readonly": ["readonlyChanged"],
698
- "value": ["valueChanged"],
699
- "columns": ["columnsChanged"],
700
- "columnsTablet": ["columnsTabletChanged"],
701
- "columnsMobile": ["columnsMobileChanged"]
702
- }; }
703
- };
704
- __decorate([
705
- Logger('bal-checkbox-group'),
706
- __metadata("design:type", Function),
707
- __metadata("design:paramtypes", [Function]),
708
- __metadata("design:returntype", void 0)
709
- ], CheckboxGroup.prototype, "createLogger", null);
710
- __decorate([
711
- ListenToFocus(),
712
- __metadata("design:type", Function),
713
- __metadata("design:paramtypes", [Object]),
714
- __metadata("design:returntype", void 0)
715
- ], CheckboxGroup.prototype, "focusInListener", null);
716
- __decorate([
717
- ListenToFocus(),
718
- __metadata("design:type", Function),
719
- __metadata("design:paramtypes", [Object]),
720
- __metadata("design:returntype", void 0)
721
- ], CheckboxGroup.prototype, "focusOutListener", null);
722
- __decorate([
723
- ListenToMutation({ tags: ['bal-checkbox-group', 'bal-checkbox'], attributes: false, characterData: false }),
724
- __metadata("design:type", Function),
725
- __metadata("design:paramtypes", []),
726
- __metadata("design:returntype", void 0)
727
- ], CheckboxGroup.prototype, "mutationListener", null);
728
- let checkboxGroupIds = 0;
729
- CheckboxGroup.style = balCheckboxGroupCss;
730
-
731
- export { Checkbox as bal_checkbox, CheckboxGroup as bal_checkbox_group };