@kirbydesign/designsystem 11.11.3-dev-e7cb27f → 12.0.0-dev-67d5287

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 (282) hide show
  1. package/fesm2022/kirbydesign-designsystem-accordion.mjs +246 -135
  2. package/fesm2022/kirbydesign-designsystem-accordion.mjs.map +1 -1
  3. package/fesm2022/kirbydesign-designsystem-action-group.mjs +229 -134
  4. package/fesm2022/kirbydesign-designsystem-action-group.mjs.map +1 -1
  5. package/fesm2022/kirbydesign-designsystem-avatar.mjs +102 -55
  6. package/fesm2022/kirbydesign-designsystem-avatar.mjs.map +1 -1
  7. package/fesm2022/kirbydesign-designsystem-badge.mjs +85 -42
  8. package/fesm2022/kirbydesign-designsystem-badge.mjs.map +1 -1
  9. package/fesm2022/kirbydesign-designsystem-button.mjs +203 -170
  10. package/fesm2022/kirbydesign-designsystem-button.mjs.map +1 -1
  11. package/fesm2022/kirbydesign-designsystem-calendar.mjs +524 -516
  12. package/fesm2022/kirbydesign-designsystem-calendar.mjs.map +1 -1
  13. package/fesm2022/kirbydesign-designsystem-card.mjs +439 -205
  14. package/fesm2022/kirbydesign-designsystem-card.mjs.map +1 -1
  15. package/fesm2022/kirbydesign-designsystem-chart.mjs +1388 -1469
  16. package/fesm2022/kirbydesign-designsystem-chart.mjs.map +1 -1
  17. package/fesm2022/kirbydesign-designsystem-checkbox.mjs +215 -176
  18. package/fesm2022/kirbydesign-designsystem-checkbox.mjs.map +1 -1
  19. package/fesm2022/kirbydesign-designsystem-config.mjs +50 -96
  20. package/fesm2022/kirbydesign-designsystem-config.mjs.map +1 -1
  21. package/fesm2022/kirbydesign-designsystem-data-table.mjs +180 -83
  22. package/fesm2022/kirbydesign-designsystem-data-table.mjs.map +1 -1
  23. package/fesm2022/kirbydesign-designsystem-divider.mjs +46 -19
  24. package/fesm2022/kirbydesign-designsystem-divider.mjs.map +1 -1
  25. package/fesm2022/kirbydesign-designsystem-dropdown.mjs +878 -752
  26. package/fesm2022/kirbydesign-designsystem-dropdown.mjs.map +1 -1
  27. package/fesm2022/kirbydesign-designsystem-empty-state.mjs +164 -91
  28. package/fesm2022/kirbydesign-designsystem-empty-state.mjs.map +1 -1
  29. package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs +213 -85
  30. package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs.map +1 -1
  31. package/fesm2022/kirbydesign-designsystem-flag.mjs +67 -33
  32. package/fesm2022/kirbydesign-designsystem-flag.mjs.map +1 -1
  33. package/fesm2022/kirbydesign-designsystem-form-field.mjs +1260 -901
  34. package/fesm2022/kirbydesign-designsystem-form-field.mjs.map +1 -1
  35. package/fesm2022/kirbydesign-designsystem-gesture.mjs +38 -23
  36. package/fesm2022/kirbydesign-designsystem-gesture.mjs.map +1 -1
  37. package/fesm2022/kirbydesign-designsystem-header.mjs +422 -182
  38. package/fesm2022/kirbydesign-designsystem-header.mjs.map +1 -1
  39. package/fesm2022/kirbydesign-designsystem-helpers-scss.mjs +16 -14
  40. package/fesm2022/kirbydesign-designsystem-helpers-scss.mjs.map +1 -1
  41. package/fesm2022/kirbydesign-designsystem-helpers.mjs +251 -361
  42. package/fesm2022/kirbydesign-designsystem-helpers.mjs.map +1 -1
  43. package/fesm2022/kirbydesign-designsystem-icon.mjs +881 -303
  44. package/fesm2022/kirbydesign-designsystem-icon.mjs.map +1 -1
  45. package/fesm2022/kirbydesign-designsystem-item-group.mjs +52 -23
  46. package/fesm2022/kirbydesign-designsystem-item-group.mjs.map +1 -1
  47. package/fesm2022/kirbydesign-designsystem-item-sliding.mjs +147 -43
  48. package/fesm2022/kirbydesign-designsystem-item-sliding.mjs.map +1 -1
  49. package/fesm2022/kirbydesign-designsystem-item.mjs +395 -151
  50. package/fesm2022/kirbydesign-designsystem-item.mjs.map +1 -1
  51. package/fesm2022/kirbydesign-designsystem-kirby-app.mjs +136 -54
  52. package/fesm2022/kirbydesign-designsystem-kirby-app.mjs.map +1 -1
  53. package/fesm2022/kirbydesign-designsystem-list.mjs +1185 -697
  54. package/fesm2022/kirbydesign-designsystem-list.mjs.map +1 -1
  55. package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs +166 -76
  56. package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs.map +1 -1
  57. package/fesm2022/kirbydesign-designsystem-menu.mjs +420 -311
  58. package/fesm2022/kirbydesign-designsystem-menu.mjs.map +1 -1
  59. package/fesm2022/kirbydesign-designsystem-modal.mjs +2467 -1912
  60. package/fesm2022/kirbydesign-designsystem-modal.mjs.map +1 -1
  61. package/fesm2022/kirbydesign-designsystem-page.mjs +1505 -923
  62. package/fesm2022/kirbydesign-designsystem-page.mjs.map +1 -1
  63. package/fesm2022/kirbydesign-designsystem-popover.mjs +203 -183
  64. package/fesm2022/kirbydesign-designsystem-popover.mjs.map +1 -1
  65. package/fesm2022/kirbydesign-designsystem-progress-circle.mjs +209 -121
  66. package/fesm2022/kirbydesign-designsystem-progress-circle.mjs.map +1 -1
  67. package/fesm2022/kirbydesign-designsystem-radio.mjs +537 -365
  68. package/fesm2022/kirbydesign-designsystem-radio.mjs.map +1 -1
  69. package/fesm2022/kirbydesign-designsystem-range.mjs +207 -150
  70. package/fesm2022/kirbydesign-designsystem-range.mjs.map +1 -1
  71. package/fesm2022/kirbydesign-designsystem-reorder-list.mjs +217 -104
  72. package/fesm2022/kirbydesign-designsystem-reorder-list.mjs.map +1 -1
  73. package/fesm2022/kirbydesign-designsystem-router-outlet.mjs +113 -38
  74. package/fesm2022/kirbydesign-designsystem-router-outlet.mjs.map +1 -1
  75. package/fesm2022/kirbydesign-designsystem-section-header.mjs +56 -18
  76. package/fesm2022/kirbydesign-designsystem-section-header.mjs.map +1 -1
  77. package/fesm2022/kirbydesign-designsystem-segmented-control.mjs +276 -232
  78. package/fesm2022/kirbydesign-designsystem-segmented-control.mjs.map +1 -1
  79. package/fesm2022/kirbydesign-designsystem-shared-floating.mjs +319 -382
  80. package/fesm2022/kirbydesign-designsystem-shared-floating.mjs.map +1 -1
  81. package/fesm2022/kirbydesign-designsystem-shared-portal.mjs +73 -84
  82. package/fesm2022/kirbydesign-designsystem-shared-portal.mjs.map +1 -1
  83. package/fesm2022/kirbydesign-designsystem-shared.mjs +665 -529
  84. package/fesm2022/kirbydesign-designsystem-shared.mjs.map +1 -1
  85. package/fesm2022/kirbydesign-designsystem-slide-button.mjs +140 -91
  86. package/fesm2022/kirbydesign-designsystem-slide-button.mjs.map +1 -1
  87. package/fesm2022/kirbydesign-designsystem-slide.mjs +360 -158
  88. package/fesm2022/kirbydesign-designsystem-slide.mjs.map +1 -1
  89. package/fesm2022/kirbydesign-designsystem-spinner.mjs +90 -32
  90. package/fesm2022/kirbydesign-designsystem-spinner.mjs.map +1 -1
  91. package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs +348 -181
  92. package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs.map +1 -1
  93. package/fesm2022/kirbydesign-designsystem-tabs.mjs +286 -121
  94. package/fesm2022/kirbydesign-designsystem-tabs.mjs.map +1 -1
  95. package/fesm2022/kirbydesign-designsystem-testing-base.mjs +6232 -3164
  96. package/fesm2022/kirbydesign-designsystem-testing-base.mjs.map +1 -1
  97. package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs +118 -95
  98. package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs.map +1 -1
  99. package/fesm2022/kirbydesign-designsystem-testing-jest.mjs +128 -101
  100. package/fesm2022/kirbydesign-designsystem-testing-jest.mjs.map +1 -1
  101. package/fesm2022/kirbydesign-designsystem-testing.mjs +236 -243
  102. package/fesm2022/kirbydesign-designsystem-testing.mjs.map +1 -1
  103. package/fesm2022/kirbydesign-designsystem-toast.mjs +98 -62
  104. package/fesm2022/kirbydesign-designsystem-toast.mjs.map +1 -1
  105. package/fesm2022/kirbydesign-designsystem-toggle-button.mjs +155 -127
  106. package/fesm2022/kirbydesign-designsystem-toggle-button.mjs.map +1 -1
  107. package/fesm2022/kirbydesign-designsystem-toggle.mjs +180 -150
  108. package/fesm2022/kirbydesign-designsystem-toggle.mjs.map +1 -1
  109. package/fesm2022/kirbydesign-designsystem-types.mjs +39 -24
  110. package/fesm2022/kirbydesign-designsystem-types.mjs.map +1 -1
  111. package/fesm2022/kirbydesign-designsystem.mjs +516 -407
  112. package/fesm2022/kirbydesign-designsystem.mjs.map +1 -1
  113. package/icons/svg/megaphone.svg +3 -0
  114. package/package.json +10 -10
  115. package/readme.md +37 -0
  116. package/types/kirbydesign-designsystem-accordion.d.ts +72 -39
  117. package/types/kirbydesign-designsystem-accordion.d.ts.map +1 -1
  118. package/types/kirbydesign-designsystem-action-group.d.ts +46 -39
  119. package/types/kirbydesign-designsystem-action-group.d.ts.map +1 -1
  120. package/types/kirbydesign-designsystem-avatar.d.ts +62 -26
  121. package/types/kirbydesign-designsystem-avatar.d.ts.map +1 -1
  122. package/types/kirbydesign-designsystem-badge.d.ts +30 -19
  123. package/types/kirbydesign-designsystem-badge.d.ts.map +1 -1
  124. package/types/kirbydesign-designsystem-button.d.ts +70 -45
  125. package/types/kirbydesign-designsystem-button.d.ts.map +1 -1
  126. package/types/kirbydesign-designsystem-calendar.d.ts +193 -132
  127. package/types/kirbydesign-designsystem-calendar.d.ts.map +1 -1
  128. package/types/kirbydesign-designsystem-card.d.ts +130 -66
  129. package/types/kirbydesign-designsystem-card.d.ts.map +1 -1
  130. package/types/kirbydesign-designsystem-chart.d.ts +198 -172
  131. package/types/kirbydesign-designsystem-chart.d.ts.map +1 -1
  132. package/types/kirbydesign-designsystem-checkbox.d.ts +96 -68
  133. package/types/kirbydesign-designsystem-checkbox.d.ts.map +1 -1
  134. package/types/kirbydesign-designsystem-config.d.ts +17 -21
  135. package/types/kirbydesign-designsystem-config.d.ts.map +1 -1
  136. package/types/kirbydesign-designsystem-data-table.d.ts +46 -26
  137. package/types/kirbydesign-designsystem-data-table.d.ts.map +1 -1
  138. package/types/kirbydesign-designsystem-divider.d.ts +11 -9
  139. package/types/kirbydesign-designsystem-divider.d.ts.map +1 -1
  140. package/types/kirbydesign-designsystem-dropdown.d.ts +219 -166
  141. package/types/kirbydesign-designsystem-dropdown.d.ts.map +1 -1
  142. package/types/kirbydesign-designsystem-empty-state.d.ts +47 -35
  143. package/types/kirbydesign-designsystem-empty-state.d.ts.map +1 -1
  144. package/types/kirbydesign-designsystem-fab-sheet.d.ts +34 -28
  145. package/types/kirbydesign-designsystem-fab-sheet.d.ts.map +1 -1
  146. package/types/kirbydesign-designsystem-flag.d.ts +18 -13
  147. package/types/kirbydesign-designsystem-flag.d.ts.map +1 -1
  148. package/types/kirbydesign-designsystem-form-field.d.ts +409 -242
  149. package/types/kirbydesign-designsystem-form-field.d.ts.map +1 -1
  150. package/types/kirbydesign-designsystem-gesture.d.ts +41 -46
  151. package/types/kirbydesign-designsystem-gesture.d.ts.map +1 -1
  152. package/types/kirbydesign-designsystem-header.d.ts +102 -64
  153. package/types/kirbydesign-designsystem-header.d.ts.map +1 -1
  154. package/types/kirbydesign-designsystem-helpers-scss.d.ts +6 -8
  155. package/types/kirbydesign-designsystem-helpers-scss.d.ts.map +1 -1
  156. package/types/kirbydesign-designsystem-helpers.d.ts +83 -97
  157. package/types/kirbydesign-designsystem-helpers.d.ts.map +1 -1
  158. package/types/kirbydesign-designsystem-icon.d.ts +63 -59
  159. package/types/kirbydesign-designsystem-icon.d.ts.map +1 -1
  160. package/types/kirbydesign-designsystem-item-group.d.ts +6 -9
  161. package/types/kirbydesign-designsystem-item-group.d.ts.map +1 -1
  162. package/types/kirbydesign-designsystem-item-sliding.d.ts +30 -26
  163. package/types/kirbydesign-designsystem-item-sliding.d.ts.map +1 -1
  164. package/types/kirbydesign-designsystem-item.d.ts +93 -54
  165. package/types/kirbydesign-designsystem-item.d.ts.map +1 -1
  166. package/types/kirbydesign-designsystem-kirby-app.d.ts +18 -19
  167. package/types/kirbydesign-designsystem-kirby-app.d.ts.map +1 -1
  168. package/types/kirbydesign-designsystem-list.d.ts +387 -263
  169. package/types/kirbydesign-designsystem-list.d.ts.map +1 -1
  170. package/types/kirbydesign-designsystem-loading-overlay.d.ts +35 -24
  171. package/types/kirbydesign-designsystem-loading-overlay.d.ts.map +1 -1
  172. package/types/kirbydesign-designsystem-menu.d.ts +119 -69
  173. package/types/kirbydesign-designsystem-menu.d.ts.map +1 -1
  174. package/types/kirbydesign-designsystem-modal.d.ts +577 -455
  175. package/types/kirbydesign-designsystem-modal.d.ts.map +1 -1
  176. package/types/kirbydesign-designsystem-page.d.ts +304 -229
  177. package/types/kirbydesign-designsystem-page.d.ts.map +1 -1
  178. package/types/kirbydesign-designsystem-popover.d.ts +48 -40
  179. package/types/kirbydesign-designsystem-popover.d.ts.map +1 -1
  180. package/types/kirbydesign-designsystem-progress-circle.d.ts +60 -38
  181. package/types/kirbydesign-designsystem-progress-circle.d.ts.map +1 -1
  182. package/types/kirbydesign-designsystem-radio.d.ts +147 -98
  183. package/types/kirbydesign-designsystem-radio.d.ts.map +1 -1
  184. package/types/kirbydesign-designsystem-range.d.ts +90 -45
  185. package/types/kirbydesign-designsystem-range.d.ts.map +1 -1
  186. package/types/kirbydesign-designsystem-reorder-list.d.ts +44 -32
  187. package/types/kirbydesign-designsystem-reorder-list.d.ts.map +1 -1
  188. package/types/kirbydesign-designsystem-router-outlet.d.ts +23 -18
  189. package/types/kirbydesign-designsystem-router-outlet.d.ts.map +1 -1
  190. package/types/kirbydesign-designsystem-section-header.d.ts +5 -8
  191. package/types/kirbydesign-designsystem-section-header.d.ts.map +1 -1
  192. package/types/kirbydesign-designsystem-segmented-control.d.ts +123 -100
  193. package/types/kirbydesign-designsystem-segmented-control.d.ts.map +1 -1
  194. package/types/kirbydesign-designsystem-shared-floating.d.ts +183 -128
  195. package/types/kirbydesign-designsystem-shared-floating.d.ts.map +1 -1
  196. package/types/kirbydesign-designsystem-shared-portal.d.ts +29 -28
  197. package/types/kirbydesign-designsystem-shared-portal.d.ts.map +1 -1
  198. package/types/kirbydesign-designsystem-shared.d.ts +143 -139
  199. package/types/kirbydesign-designsystem-shared.d.ts.map +1 -1
  200. package/types/kirbydesign-designsystem-slide-button.d.ts +43 -34
  201. package/types/kirbydesign-designsystem-slide-button.d.ts.map +1 -1
  202. package/types/kirbydesign-designsystem-slide.d.ts +80 -59
  203. package/types/kirbydesign-designsystem-slide.d.ts.map +1 -1
  204. package/types/kirbydesign-designsystem-spinner.d.ts +13 -14
  205. package/types/kirbydesign-designsystem-spinner.d.ts.map +1 -1
  206. package/types/kirbydesign-designsystem-tab-navigation.d.ts +78 -55
  207. package/types/kirbydesign-designsystem-tab-navigation.d.ts.map +1 -1
  208. package/types/kirbydesign-designsystem-tabs.d.ts +50 -45
  209. package/types/kirbydesign-designsystem-tabs.d.ts.map +1 -1
  210. package/types/kirbydesign-designsystem-testing-base.d.ts +2430 -815
  211. package/types/kirbydesign-designsystem-testing-base.d.ts.map +1 -1
  212. package/types/kirbydesign-designsystem-testing-jasmine.d.ts +9 -10
  213. package/types/kirbydesign-designsystem-testing-jasmine.d.ts.map +1 -1
  214. package/types/kirbydesign-designsystem-testing-jest.d.ts +9 -10
  215. package/types/kirbydesign-designsystem-testing-jest.d.ts.map +1 -1
  216. package/types/kirbydesign-designsystem-testing.d.ts +52 -58
  217. package/types/kirbydesign-designsystem-testing.d.ts.map +1 -1
  218. package/types/kirbydesign-designsystem-toast.d.ts +25 -31
  219. package/types/kirbydesign-designsystem-toast.d.ts.map +1 -1
  220. package/types/kirbydesign-designsystem-toggle-button.d.ts +62 -56
  221. package/types/kirbydesign-designsystem-toggle-button.d.ts.map +1 -1
  222. package/types/kirbydesign-designsystem-toggle.d.ts +71 -63
  223. package/types/kirbydesign-designsystem-toggle.d.ts.map +1 -1
  224. package/types/kirbydesign-designsystem-types.d.ts +15 -22
  225. package/types/kirbydesign-designsystem-types.d.ts.map +1 -1
  226. package/types/kirbydesign-designsystem.d.ts +135 -123
  227. package/types/kirbydesign-designsystem.d.ts.map +1 -1
  228. package/accordion/package.json +0 -4
  229. package/action-group/package.json +0 -4
  230. package/avatar/package.json +0 -4
  231. package/badge/package.json +0 -4
  232. package/button/package.json +0 -4
  233. package/calendar/package.json +0 -4
  234. package/card/package.json +0 -4
  235. package/chart/package.json +0 -4
  236. package/checkbox/package.json +0 -4
  237. package/config/package.json +0 -4
  238. package/data-table/package.json +0 -4
  239. package/divider/package.json +0 -4
  240. package/dropdown/package.json +0 -4
  241. package/empty-state/package.json +0 -4
  242. package/fab-sheet/package.json +0 -4
  243. package/flag/package.json +0 -4
  244. package/form-field/package.json +0 -4
  245. package/gesture/package.json +0 -4
  246. package/header/package.json +0 -4
  247. package/helpers/package.json +0 -4
  248. package/helpers/scss/package.json +0 -4
  249. package/icon/package.json +0 -4
  250. package/item/package.json +0 -4
  251. package/item-group/package.json +0 -4
  252. package/item-sliding/package.json +0 -4
  253. package/kirby-app/package.json +0 -4
  254. package/list/package.json +0 -4
  255. package/loading-overlay/package.json +0 -4
  256. package/menu/package.json +0 -4
  257. package/modal/package.json +0 -4
  258. package/page/package.json +0 -4
  259. package/popover/package.json +0 -4
  260. package/progress-circle/package.json +0 -4
  261. package/radio/package.json +0 -4
  262. package/range/package.json +0 -4
  263. package/reorder-list/package.json +0 -4
  264. package/router-outlet/package.json +0 -4
  265. package/section-header/package.json +0 -4
  266. package/segmented-control/package.json +0 -4
  267. package/shared/floating/package.json +0 -4
  268. package/shared/package.json +0 -4
  269. package/shared/portal/package.json +0 -4
  270. package/slide/package.json +0 -4
  271. package/slide-button/package.json +0 -4
  272. package/spinner/package.json +0 -4
  273. package/tab-navigation/package.json +0 -4
  274. package/tabs/package.json +0 -4
  275. package/testing/package.json +0 -4
  276. package/testing-base/package.json +0 -4
  277. package/testing-jasmine/package.json +0 -4
  278. package/testing-jest/package.json +0 -4
  279. package/toast/package.json +0 -4
  280. package/toggle/package.json +0 -4
  281. package/toggle-button/package.json +0 -4
  282. package/types/package.json +0 -4
@@ -1,177 +1,216 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, ElementRef, forwardRef, Output, HostBinding, Input, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
- import * as i1 from '@kirbydesign/designsystem/helpers';
5
- import { IonicElementPartHelper } from '@kirbydesign/designsystem/helpers';
6
- import { IonCheckbox } from '@ionic/angular';
7
- import { inheritAriaLabelText, setAccessibleLabel } from '@kirbydesign/designsystem/shared';
8
-
9
- class CheckboxComponent {
10
- get _isDisabled() {
11
- return this.disabled ? 'disabled' : null;
12
- }
13
- get isAttentionLevel1() {
14
- return this.attentionLevel === '1';
15
- }
16
- get isAttentionLevel2() {
17
- return this.attentionLevel === '2';
18
- }
19
- constructor(element, ionicElementPartHelper, cdr) {
20
- this.element = element;
21
- this.ionicElementPartHelper = ionicElementPartHelper;
22
- this.cdr = cdr;
23
- this.checked = false;
24
- this.indeterminate = false;
25
- this.attentionLevel = '2';
26
- this.size = 'md';
27
- this.hasError = false;
28
- this.disabled = false;
29
- this.checkedChange = new EventEmitter();
30
- this._justify = 'start';
31
- this._labelPlacement = 'end';
32
- // Initialize default ControlValueAccessor callback functions (noop)
33
- // eslint-disable-next-line no-empty-function
34
- this._onChange = () => { };
35
- // eslint-disable-next-line no-empty-function
36
- this._onTouched = () => { };
37
- }
38
- ngOnInit() {
39
- /**
40
- * We cannot query ion-checkbox for slotted content at this point as the slot has not been rendered.
41
- * But we need to know if content is slotted to set justify and labelPlacement BEFORE ion-checkbox is rendered.
42
- * So it has to be done by querying an additional wrapper around the default content slot like this.
43
- */
44
- this._hasSlottedContent = this.element.nativeElement
45
- .querySelector('.default-content')
46
- .hasChildNodes();
47
- const slot = this.element.nativeElement.getAttribute('slot');
48
- if (slot === 'end' && this._hasSlottedContent) {
49
- this._justify = 'space-between';
50
- this._labelPlacement = 'start';
51
- }
52
- }
53
- ngAfterViewInit() {
54
- this.ionicElementPartHelper.setPart('label', this.ionCheckboxElement, '.checkbox-wrapper');
55
- this.ionicElementPartHelper.setPart('label-text-wrapper', this.ionCheckboxElement, '.label-text-wrapper');
56
- this.ionicElementPartHelper.setPart('native-wrapper', this.ionCheckboxElement, '.native-wrapper');
57
- }
58
- ngAfterContentInit() {
59
- this._labelText = inheritAriaLabelText(this.element.nativeElement);
60
- if (!this.text && !this._labelText && !this._hasSlottedContent) {
61
- // if no label has been set try to find a label in an item and use its text content
62
- this._labelText = setAccessibleLabel(this.element.nativeElement);
63
- }
64
- }
65
- onChecked(checked) {
66
- this.checked = checked;
67
- this._onChange(this.checked);
68
- this.checkedChange.emit(this.checked);
69
- }
70
- onBlur() {
71
- this._onTouched();
72
- }
73
- /**
74
- * Sets the checkbox's value. Part of the ControlValueAccessor interface
75
- * required to integrate with Angular's core forms API.
76
- *
77
- * @param value New value to be written to the model.
78
- */
79
- writeValue(value) {
80
- this.checked = value;
81
- this.cdr.markForCheck();
82
- }
83
- /**
84
- * Saves a callback function to be invoked when the checkbox's value
85
- * changes from user input. Part of the ControlValueAccessor interface
86
- * required to integrate with Angular's core forms API.
87
- *
88
- * @param fn Callback to be triggered when the value changes.
89
- */
90
- registerOnChange(fn) {
91
- this._onChange = fn;
92
- }
93
- /**
94
- * Saves a callback function to be invoked when the checkbox is blurred
95
- * by the user. Part of the ControlValueAccessor interface required
96
- * to integrate with Angular's core forms API.
97
- *
98
- * @param fn Callback to be triggered when the component has been touched.
99
- */
100
- registerOnTouched(fn) {
101
- this._onTouched = fn;
102
- }
103
- /**
104
- * Disables the checkbox. Part of the ControlValueAccessor interface required
105
- * to integrate with Angular's core forms API.
106
- *
107
- * @param isDisabled Sets whether the component is disabled.
108
- */
109
- setDisabledState(isDisabled) {
110
- this.disabled = isDisabled;
111
- this.cdr.markForCheck();
112
- }
113
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: CheckboxComponent, deps: [{ token: i0.ElementRef }, { token: i1.IonicElementPartHelper }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
114
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: CheckboxComponent, isStandalone: true, selector: "kirby-checkbox", inputs: { checked: "checked", indeterminate: "indeterminate", attentionLevel: "attentionLevel", text: "text", size: "size", hasError: "hasError", disabled: "disabled" }, outputs: { checkedChange: "checkedChange" }, host: { properties: { "class": "this.size", "class.error": "this.hasError", "attr.disabled": "this._isDisabled", "class.attention-level1": "this.isAttentionLevel1", "class.attention-level2": "this.isAttentionLevel2", "class.has-hidden-label": "this._labelText" } }, providers: [
115
- IonicElementPartHelper,
116
- {
117
- provide: NG_VALUE_ACCESSOR,
118
- useExisting: forwardRef((() => CheckboxComponent)),
119
- multi: true,
120
- },
121
- ], viewQueries: [{ propertyName: "ionCheckboxElement", first: true, predicate: IonCheckbox, descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<ion-checkbox\n mode=\"md\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [indeterminate]=\"indeterminate\"\n (ionChange)=\"onChecked($event.detail.checked)\"\n (ionBlur)=\"onBlur()\"\n [labelPlacement]=\"_labelPlacement\"\n [justify]=\"_justify\"\n>\n @if (_labelText) {\n <span class=\"hidden-label\">{{ _labelText }}</span>\n }\n @if (text) {\n <span [attr.aria-hidden]=\"_labelText ? true : undefined\">{{ text }}</span>\n }\n <span class=\"default-content\" [attr.aria-hidden]=\"_labelText ? true : undefined\">\n <ng-content></ng-content>\n </span>\n</ion-checkbox>\n", styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex}:host.attention-level1 ion-checkbox{--checkmark-color: var(--kirby-black);--checkbox-background-checked: var(--kirby-success);--border-color-checked: var(--kirby-success)}@media(hover:hover){:host.attention-level1 ion-checkbox:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;--checkbox-background-checked: rgb(17.6590826639%, 75.5644467479%, 44.7637211713%);--border-color-checked: rgb(17.6590826639%, 75.5644467479%, 44.7637211713%)}}:host.attention-level1 ion-checkbox:active,:host.attention-level1 ion-checkbox.interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);--checkbox-background-checked: rgb(15.9772652673%, 68.3678327719%, 40.5005096312%);--border-color-checked: rgb(15.9772652673%, 68.3678327719%, 40.5005096312%)}:host.attention-level2 ion-checkbox{--checkmark-color: var(--kirby-white);--checkbox-background-checked: var(--kirby-black);--border-color-checked: var(--kirby-black)}@media(hover:hover){:host.attention-level2 ion-checkbox:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;--checkbox-background-checked: rgb(35.9058823529%, 35.9058823529%, 35.9058823529%);--border-color-checked: rgb(35.9058823529%, 35.9058823529%, 35.9058823529%)}}:host.attention-level2 ion-checkbox:active,:host.attention-level2 ion-checkbox.interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);--checkmark-color: rgb(92%, 92%, 92%);--checkbox-background-checked: rgb(43.0274509804%, 43.0274509804%, 43.0274509804%);--border-color-checked: rgb(43.0274509804%, 43.0274509804%, 43.0274509804%)}:host.error ion-checkbox{--border-color: var(--kirby-danger)}:host[disabled]{color:var(--kirby-text-color-semi-dark)}:host[disabled] ion-checkbox{--checkmark-color: var(--kirby-semi-dark);--checkbox-background: var(--kirby-semi-light);--checkbox-background-checked: var(--kirby-semi-light);--border-color: var(--kirby-medium);--border-color-checked: var(--kirby-medium)}:host[disabled] ion-checkbox::part(label-text-wrapper){opacity:1}:host[disabled] ion-checkbox::part(native-wrapper){opacity:1}:host:has(ion-checkbox.in-item.checkbox-justify-space-between){width:100%}:host.xs ion-checkbox:not(.in-item)::part(label){padding-block:4px}:host.sm ion-checkbox:not(.in-item)::part(label){padding-block:10px}:host.md ion-checkbox:not(.in-item)::part(label){padding-block:16px}:host.xs ion-checkbox::part(label){line-height:var(--kirby-relative-size-s);font-size:var(--kirby-font-size-s)}:host.xs ion-checkbox{--size: 16px;--border-radius: var(--kirby-spacing-xxxs);--kirby-checkbox-container-padding: var(--kirby-spacing-xxxxs)}:host.xs ion-checkbox::part(container){padding:var(--kirby-checkbox-container-padding)}:host.xs ion-checkbox::part(native-wrapper){height:var(--kirby-relative-size-s)}:host ion-checkbox:focus-visible{outline:none;--border-width: 0;--border-color: transparent;--border-color-checked: transparent}:host ion-checkbox:focus-visible::part(container){padding:calc(var(--kirby-checkbox-container-padding) + 1px);transition:box-shadow 80ms linear;box-shadow:var(--kirby-focus-ring-sm-inset)}@media(hover:hover){:host ion-checkbox:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;--checkbox-background: rgb(92%, 92%, 92%)}}:host ion-checkbox:active,:host ion-checkbox.interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);--checkbox-background: rgb(88%, 88%, 88%)}:host ion-checkbox{--transition: border-color 80ms linear, background-color 80ms linear;--size: 24px;--checkmark-width: var(--kirby-spacing-xxxs);--kirby-checkbox-container-padding: var(--kirby-spacing-xxxs);--checkbox-background: var(--kirby-white);--border-width: 1px;--border-color: var(--kirby-semi-dark);--border-radius: 6px}:host ion-checkbox::part(container){padding:var(--kirby-checkbox-container-padding)}:host ion-checkbox::part(label){align-items:start;padding-inline:16px;line-height:var(--kirby-line-height-n)}:host ion-checkbox::part(label-text-wrapper){margin-inline:12px 0;white-space:pre-line}:host ion-checkbox::part(native-wrapper){height:var(--kirby-relative-size-m)}:host ion-checkbox.in-item::part(label){align-items:center;padding-inline:0}:host ion-checkbox.in-item::part(label-text-wrapper){margin-block:0}:host ion-checkbox.in-item.checkbox-label-placement-start::part(label-text-wrapper){margin-inline:0 12px}:host ion-checkbox.in-item.checkbox-label-placement-end::part(label-text-wrapper){margin-inline:12px 0}:host.has-hidden-label:has(ion-checkbox.in-item){position:initial}:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox{position:initial}:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox.checkbox-label-placement-start::part(label-text-wrapper),:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox.checkbox-label-placement-end::part(label-text-wrapper){margin-inline:0}:host.has-hidden-label[slot=end] ion-checkbox{margin-inline-start:12px}:host.has-hidden-label .hidden-label{position:absolute;inset:0;opacity:0}:host :host-context(kirby-item){z-index:var(--kirby-z-index-default)}:host :host-context(kirby-item) ion-checkbox{margin:0}:host :host-context(kirby-item)[slot=start]{margin-block:0;margin-inline-end:12px}\n"], dependencies: [{ kind: "component", type: IonCheckbox, selector: "ion-checkbox", inputs: ["checked", "color", "disabled", "errorText", "helperText", "indeterminate", "justify", "labelPlacement", "mode", "name", "value"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
122
- }
123
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: CheckboxComponent, decorators: [{
124
- type: Component,
125
- args: [{ imports: [IonCheckbox], selector: 'kirby-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
126
- IonicElementPartHelper,
127
- {
128
- provide: NG_VALUE_ACCESSOR,
129
- useExisting: forwardRef((() => CheckboxComponent)),
130
- multi: true,
131
- },
132
- ], template: "<ion-checkbox\n mode=\"md\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [indeterminate]=\"indeterminate\"\n (ionChange)=\"onChecked($event.detail.checked)\"\n (ionBlur)=\"onBlur()\"\n [labelPlacement]=\"_labelPlacement\"\n [justify]=\"_justify\"\n>\n @if (_labelText) {\n <span class=\"hidden-label\">{{ _labelText }}</span>\n }\n @if (text) {\n <span [attr.aria-hidden]=\"_labelText ? true : undefined\">{{ text }}</span>\n }\n <span class=\"default-content\" [attr.aria-hidden]=\"_labelText ? true : undefined\">\n <ng-content></ng-content>\n </span>\n</ion-checkbox>\n", styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex}:host.attention-level1 ion-checkbox{--checkmark-color: var(--kirby-black);--checkbox-background-checked: var(--kirby-success);--border-color-checked: var(--kirby-success)}@media(hover:hover){:host.attention-level1 ion-checkbox:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;--checkbox-background-checked: rgb(17.6590826639%, 75.5644467479%, 44.7637211713%);--border-color-checked: rgb(17.6590826639%, 75.5644467479%, 44.7637211713%)}}:host.attention-level1 ion-checkbox:active,:host.attention-level1 ion-checkbox.interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);--checkbox-background-checked: rgb(15.9772652673%, 68.3678327719%, 40.5005096312%);--border-color-checked: rgb(15.9772652673%, 68.3678327719%, 40.5005096312%)}:host.attention-level2 ion-checkbox{--checkmark-color: var(--kirby-white);--checkbox-background-checked: var(--kirby-black);--border-color-checked: var(--kirby-black)}@media(hover:hover){:host.attention-level2 ion-checkbox:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;--checkbox-background-checked: rgb(35.9058823529%, 35.9058823529%, 35.9058823529%);--border-color-checked: rgb(35.9058823529%, 35.9058823529%, 35.9058823529%)}}:host.attention-level2 ion-checkbox:active,:host.attention-level2 ion-checkbox.interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);--checkmark-color: rgb(92%, 92%, 92%);--checkbox-background-checked: rgb(43.0274509804%, 43.0274509804%, 43.0274509804%);--border-color-checked: rgb(43.0274509804%, 43.0274509804%, 43.0274509804%)}:host.error ion-checkbox{--border-color: var(--kirby-danger)}:host[disabled]{color:var(--kirby-text-color-semi-dark)}:host[disabled] ion-checkbox{--checkmark-color: var(--kirby-semi-dark);--checkbox-background: var(--kirby-semi-light);--checkbox-background-checked: var(--kirby-semi-light);--border-color: var(--kirby-medium);--border-color-checked: var(--kirby-medium)}:host[disabled] ion-checkbox::part(label-text-wrapper){opacity:1}:host[disabled] ion-checkbox::part(native-wrapper){opacity:1}:host:has(ion-checkbox.in-item.checkbox-justify-space-between){width:100%}:host.xs ion-checkbox:not(.in-item)::part(label){padding-block:4px}:host.sm ion-checkbox:not(.in-item)::part(label){padding-block:10px}:host.md ion-checkbox:not(.in-item)::part(label){padding-block:16px}:host.xs ion-checkbox::part(label){line-height:var(--kirby-relative-size-s);font-size:var(--kirby-font-size-s)}:host.xs ion-checkbox{--size: 16px;--border-radius: var(--kirby-spacing-xxxs);--kirby-checkbox-container-padding: var(--kirby-spacing-xxxxs)}:host.xs ion-checkbox::part(container){padding:var(--kirby-checkbox-container-padding)}:host.xs ion-checkbox::part(native-wrapper){height:var(--kirby-relative-size-s)}:host ion-checkbox:focus-visible{outline:none;--border-width: 0;--border-color: transparent;--border-color-checked: transparent}:host ion-checkbox:focus-visible::part(container){padding:calc(var(--kirby-checkbox-container-padding) + 1px);transition:box-shadow 80ms linear;box-shadow:var(--kirby-focus-ring-sm-inset)}@media(hover:hover){:host ion-checkbox:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer;--checkbox-background: rgb(92%, 92%, 92%)}}:host ion-checkbox:active,:host ion-checkbox.interaction-state-active{--state-layer-opacity: .12;--state-layer-background-color: var(--kirby-black);--checkbox-background: rgb(88%, 88%, 88%)}:host ion-checkbox{--transition: border-color 80ms linear, background-color 80ms linear;--size: 24px;--checkmark-width: var(--kirby-spacing-xxxs);--kirby-checkbox-container-padding: var(--kirby-spacing-xxxs);--checkbox-background: var(--kirby-white);--border-width: 1px;--border-color: var(--kirby-semi-dark);--border-radius: 6px}:host ion-checkbox::part(container){padding:var(--kirby-checkbox-container-padding)}:host ion-checkbox::part(label){align-items:start;padding-inline:16px;line-height:var(--kirby-line-height-n)}:host ion-checkbox::part(label-text-wrapper){margin-inline:12px 0;white-space:pre-line}:host ion-checkbox::part(native-wrapper){height:var(--kirby-relative-size-m)}:host ion-checkbox.in-item::part(label){align-items:center;padding-inline:0}:host ion-checkbox.in-item::part(label-text-wrapper){margin-block:0}:host ion-checkbox.in-item.checkbox-label-placement-start::part(label-text-wrapper){margin-inline:0 12px}:host ion-checkbox.in-item.checkbox-label-placement-end::part(label-text-wrapper){margin-inline:12px 0}:host.has-hidden-label:has(ion-checkbox.in-item){position:initial}:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox{position:initial}:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox.checkbox-label-placement-start::part(label-text-wrapper),:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox.checkbox-label-placement-end::part(label-text-wrapper){margin-inline:0}:host.has-hidden-label[slot=end] ion-checkbox{margin-inline-start:12px}:host.has-hidden-label .hidden-label{position:absolute;inset:0;opacity:0}:host :host-context(kirby-item){z-index:var(--kirby-z-index-default)}:host :host-context(kirby-item) ion-checkbox{margin:0}:host :host-context(kirby-item)[slot=start]{margin-block:0;margin-inline-end:12px}\n"] }]
133
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.IonicElementPartHelper }, { type: i0.ChangeDetectorRef }], propDecorators: { ionCheckboxElement: [{
134
- type: ViewChild,
135
- args: [IonCheckbox, { read: ElementRef, static: true }]
136
- }], checked: [{
137
- type: Input
138
- }], indeterminate: [{
139
- type: Input
140
- }], attentionLevel: [{
141
- type: Input
142
- }], text: [{
143
- type: Input
144
- }], size: [{
145
- type: HostBinding,
146
- args: ['class']
147
- }, {
148
- type: Input
149
- }], hasError: [{
150
- type: HostBinding,
151
- args: ['class.error']
152
- }, {
153
- type: Input
154
- }], disabled: [{
155
- type: Input
156
- }], _isDisabled: [{
157
- type: HostBinding,
158
- args: ['attr.disabled']
159
- }], isAttentionLevel1: [{
160
- type: HostBinding,
161
- args: ['class.attention-level1']
162
- }], isAttentionLevel2: [{
163
- type: HostBinding,
164
- args: ['class.attention-level2']
165
- }], _labelText: [{
166
- type: HostBinding,
167
- args: ['class.has-hidden-label']
168
- }], checkedChange: [{
169
- type: Output
170
- }] } });
171
-
172
- /**
173
- * Generated bundle index. Do not edit.
174
- */
175
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostBinding, Input, Output, ViewChild, forwardRef } from "@angular/core";
3
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
4
+ import * as i1 from "@kirbydesign/designsystem/helpers";
5
+ import { IonicElementPartHelper } from "@kirbydesign/designsystem/helpers";
6
+ import { IonCheckbox } from "@ionic/angular";
7
+ import { inheritAriaLabelText, setAccessibleLabel } from "@kirbydesign/designsystem/shared";
8
+ var CheckboxComponent = class CheckboxComponent {
9
+ get _isDisabled() {
10
+ return this.disabled ? "disabled" : null;
11
+ }
12
+ get isAttentionLevel1() {
13
+ return this.attentionLevel === "1";
14
+ }
15
+ get isAttentionLevel2() {
16
+ return this.attentionLevel === "2";
17
+ }
18
+ constructor(element, ionicElementPartHelper, cdr) {
19
+ this.element = element;
20
+ this.ionicElementPartHelper = ionicElementPartHelper;
21
+ this.cdr = cdr;
22
+ this.checked = false;
23
+ this.indeterminate = false;
24
+ this.attentionLevel = "2";
25
+ this.size = "md";
26
+ this.hasError = false;
27
+ this.disabled = false;
28
+ this.checkedChange = new EventEmitter();
29
+ this._justify = "start";
30
+ this._labelPlacement = "end";
31
+ this._onChange = () => {};
32
+ this._onTouched = () => {};
33
+ }
34
+ ngOnInit() {
35
+ this._hasSlottedContent = this.element.nativeElement.querySelector(".default-content").hasChildNodes();
36
+ if (this.element.nativeElement.getAttribute("slot") === "end" && this._hasSlottedContent) {
37
+ this._justify = "space-between";
38
+ this._labelPlacement = "start";
39
+ }
40
+ }
41
+ ngAfterViewInit() {
42
+ this.ionicElementPartHelper.setPart("label", this.ionCheckboxElement, ".checkbox-wrapper");
43
+ this.ionicElementPartHelper.setPart("label-text-wrapper", this.ionCheckboxElement, ".label-text-wrapper");
44
+ this.ionicElementPartHelper.setPart("native-wrapper", this.ionCheckboxElement, ".native-wrapper");
45
+ }
46
+ ngAfterContentInit() {
47
+ this._labelText = inheritAriaLabelText(this.element.nativeElement);
48
+ if (!this.text && !this._labelText && !this._hasSlottedContent) this._labelText = setAccessibleLabel(this.element.nativeElement);
49
+ }
50
+ onChecked(checked) {
51
+ this.checked = checked;
52
+ this._onChange(this.checked);
53
+ this.checkedChange.emit(this.checked);
54
+ }
55
+ onBlur() {
56
+ this._onTouched();
57
+ }
58
+ writeValue(value) {
59
+ this.checked = value;
60
+ this.cdr.markForCheck();
61
+ }
62
+ registerOnChange(fn) {
63
+ this._onChange = fn;
64
+ }
65
+ registerOnTouched(fn) {
66
+ this._onTouched = fn;
67
+ }
68
+ setDisabledState(isDisabled) {
69
+ this.disabled = isDisabled;
70
+ this.cdr.markForCheck();
71
+ }
72
+ static {
73
+ this.ɵfac = i0.ɵɵngDeclareFactory({
74
+ minVersion: "12.0.0",
75
+ version: "22.2.2",
76
+ ngImport: i0,
77
+ type: CheckboxComponent,
78
+ deps: [
79
+ { token: i0.ElementRef },
80
+ { token: i1.IonicElementPartHelper },
81
+ { token: i0.ChangeDetectorRef }
82
+ ],
83
+ target: i0.ɵɵFactoryTarget.Component
84
+ });
85
+ }
86
+ static {
87
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
88
+ minVersion: "17.0.0",
89
+ version: "22.2.2",
90
+ type: CheckboxComponent,
91
+ isStandalone: true,
92
+ selector: "kirby-checkbox",
93
+ inputs: {
94
+ checked: "checked",
95
+ indeterminate: "indeterminate",
96
+ attentionLevel: "attentionLevel",
97
+ text: "text",
98
+ size: "size",
99
+ hasError: "hasError",
100
+ disabled: "disabled"
101
+ },
102
+ outputs: { checkedChange: "checkedChange" },
103
+ host: { properties: {
104
+ "class": "this.size",
105
+ "class.error": "this.hasError",
106
+ "attr.disabled": "this._isDisabled",
107
+ "class.attention-level1": "this.isAttentionLevel1",
108
+ "class.attention-level2": "this.isAttentionLevel2",
109
+ "class.has-hidden-label": "this._labelText"
110
+ } },
111
+ providers: [IonicElementPartHelper, {
112
+ provide: NG_VALUE_ACCESSOR,
113
+ useExisting: forwardRef((() => CheckboxComponent)),
114
+ multi: true
115
+ }],
116
+ viewQueries: [{
117
+ propertyName: "ionCheckboxElement",
118
+ first: true,
119
+ predicate: IonCheckbox,
120
+ descendants: true,
121
+ read: ElementRef,
122
+ static: true
123
+ }],
124
+ ngImport: i0,
125
+ template: "<ion-checkbox\n mode=\"md\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [indeterminate]=\"indeterminate\"\n (ionChange)=\"onChecked($event.detail.checked)\"\n (ionBlur)=\"onBlur()\"\n [labelPlacement]=\"_labelPlacement\"\n [justify]=\"_justify\"\n>\n @if (_labelText) {\n <span class=\"hidden-label\">{{ _labelText }}</span>\n }\n @if (text) {\n <span [attr.aria-hidden]=\"_labelText ? true : undefined\">{{ text }}</span>\n }\n <span class=\"default-content\" [attr.aria-hidden]=\"_labelText ? true : undefined\">\n <ng-content></ng-content>\n </span>\n</ion-checkbox>\n",
126
+ styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex}:host[disabled] ion-checkbox::part(label-text-wrapper),:host[disabled] ion-checkbox::part(native-wrapper){opacity:.4}:host:has(ion-checkbox.in-item.checkbox-justify-space-between){width:100%}:host.xs ion-checkbox:not(.in-item)::part(label){padding-block:4px}:host.sm ion-checkbox:not(.in-item)::part(label){padding-block:10px}:host.md ion-checkbox:not(.in-item)::part(label){padding-block:16px}:host.xs ion-checkbox::part(label){line-height:var(--kirby-relative-size-s);font-size:var(--kirby-font-size-s)}:host.xs ion-checkbox{--size: 16px;--border-radius: var(--kirby-spacing-xxxs);--kirby-checkbox-container-padding: var(--kirby-spacing-xxxxs)}:host.xs ion-checkbox::part(container){padding:var(--kirby-checkbox-container-padding)}:host.xs ion-checkbox::part(native-wrapper){height:var(--kirby-relative-size-s)}@media(hover:hover){:host ion-checkbox:hover{--checkbox-background: var(--kirby-color-fill-raised-hover);--checkbox-background-checked: var(--kirby-color-fill-engaged-hover);--checkmark-color: var(--kirby-color-content-engaged-hover);--border-color: var(--kirby-color-border-raised-hover);--border-color-checked: var(--kirby-color-border-engaged-hover)}}:host ion-checkbox:active{--checkbox-background: var(--kirby-color-fill-raised-active);--checkbox-background-checked: var(--kirby-color-fill-engaged-active);--checkmark-color: var(--kirby-color-content-engaged-active);--border-color: var(--kirby-color-border-raised-active);--border-color-checked: var(--kirby-color-border-engaged-active)}:host ion-checkbox:focus-visible{outline:none;--border-color: var(--kirby-color-border-focus);--border-color-checked: var(--kirby-color-border-focus)}:host ion-checkbox:focus-visible::part(container){transition:box-shadow 80ms linear;box-shadow:var(--kirby-focus-ring-sm-combined-inset)}:host ion-checkbox{--transition: border-color 80ms linear, background-color 80ms linear;--size: 24px;--checkmark-width: var(--kirby-spacing-xxxs);--kirby-checkbox-container-padding: var(--kirby-spacing-xxxs);--checkbox-background: var(--kirby-color-fill-raised);--checkbox-background-checked: var(--kirby-color-fill-engaged);--checkmark-color: var(--kirby-color-content-engaged);--border-width: 1px;--border-color: var(--kirby-color-border-raised);--border-color-checked: var(--kirby-color-border-engaged);--border-radius: 6px}:host ion-checkbox::part(container){padding:var(--kirby-checkbox-container-padding)}:host ion-checkbox::part(label){align-items:start;padding-inline:16px;line-height:var(--kirby-line-height-n)}:host ion-checkbox::part(label-text-wrapper){margin-inline:12px 0;white-space:pre-line}:host ion-checkbox::part(native-wrapper){height:var(--kirby-relative-size-m)}:host ion-checkbox.in-item::part(label){align-items:center;padding-inline:0}:host ion-checkbox.in-item::part(label-text-wrapper){margin-block:0}:host ion-checkbox.in-item.checkbox-label-placement-start::part(label-text-wrapper){margin-inline:0 12px}:host ion-checkbox.in-item.checkbox-label-placement-end::part(label-text-wrapper){margin-inline:12px 0}:host.has-hidden-label:has(ion-checkbox.in-item){position:initial}:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox{position:initial}:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox.checkbox-label-placement-start::part(label-text-wrapper),:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox.checkbox-label-placement-end::part(label-text-wrapper){margin-inline:0}:host.has-hidden-label[slot=end] ion-checkbox{margin-inline-start:12px}:host.has-hidden-label .hidden-label{position:absolute;inset:0;opacity:0}:host.error ion-checkbox{--border-color: var(--kirby-color-border-raised-danger);--border-color-checked: var(--kirby-color-border-raised-danger)}:host.error ion-checkbox::part(container){box-shadow:var(--kirby-error-ring-combined-inset)}:host.error ion-checkbox:focus-visible{--border-color: var(--kirby-color-border-focus);--border-color-checked: var(--kirby-color-border-focus)}:host.error ion-checkbox:focus-visible::part(container){box-shadow:var(--kirby-focus-ring-sm-combined-inset)}:host :host-context(kirby-item){z-index:var(--kirby-z-index-default)}:host :host-context(kirby-item) ion-checkbox{margin:0}:host :host-context(kirby-item)[slot=start]{margin-block:0;margin-inline-end:12px}\n"],
127
+ dependencies: [{
128
+ kind: "component",
129
+ type: IonCheckbox,
130
+ selector: "ion-checkbox",
131
+ inputs: [
132
+ "checked",
133
+ "color",
134
+ "disabled",
135
+ "errorText",
136
+ "helperText",
137
+ "indeterminate",
138
+ "justify",
139
+ "labelPlacement",
140
+ "mode",
141
+ "name",
142
+ "value"
143
+ ]
144
+ }],
145
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
146
+ });
147
+ }
148
+ };
149
+ i0.ɵɵngDeclareClassMetadata({
150
+ minVersion: "12.0.0",
151
+ version: "22.2.2",
152
+ ngImport: i0,
153
+ type: CheckboxComponent,
154
+ decorators: [{
155
+ type: Component,
156
+ args: [{
157
+ imports: [IonCheckbox],
158
+ selector: "kirby-checkbox",
159
+ changeDetection: ChangeDetectionStrategy.OnPush,
160
+ providers: [IonicElementPartHelper, {
161
+ provide: NG_VALUE_ACCESSOR,
162
+ useExisting: forwardRef((() => CheckboxComponent)),
163
+ multi: true
164
+ }],
165
+ template: "<ion-checkbox\n mode=\"md\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [indeterminate]=\"indeterminate\"\n (ionChange)=\"onChecked($event.detail.checked)\"\n (ionBlur)=\"onBlur()\"\n [labelPlacement]=\"_labelPlacement\"\n [justify]=\"_justify\"\n>\n @if (_labelText) {\n <span class=\"hidden-label\">{{ _labelText }}</span>\n }\n @if (text) {\n <span [attr.aria-hidden]=\"_labelText ? true : undefined\">{{ text }}</span>\n }\n <span class=\"default-content\" [attr.aria-hidden]=\"_labelText ? true : undefined\">\n <ng-content></ng-content>\n </span>\n</ion-checkbox>\n",
166
+ styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex}:host[disabled] ion-checkbox::part(label-text-wrapper),:host[disabled] ion-checkbox::part(native-wrapper){opacity:.4}:host:has(ion-checkbox.in-item.checkbox-justify-space-between){width:100%}:host.xs ion-checkbox:not(.in-item)::part(label){padding-block:4px}:host.sm ion-checkbox:not(.in-item)::part(label){padding-block:10px}:host.md ion-checkbox:not(.in-item)::part(label){padding-block:16px}:host.xs ion-checkbox::part(label){line-height:var(--kirby-relative-size-s);font-size:var(--kirby-font-size-s)}:host.xs ion-checkbox{--size: 16px;--border-radius: var(--kirby-spacing-xxxs);--kirby-checkbox-container-padding: var(--kirby-spacing-xxxxs)}:host.xs ion-checkbox::part(container){padding:var(--kirby-checkbox-container-padding)}:host.xs ion-checkbox::part(native-wrapper){height:var(--kirby-relative-size-s)}@media(hover:hover){:host ion-checkbox:hover{--checkbox-background: var(--kirby-color-fill-raised-hover);--checkbox-background-checked: var(--kirby-color-fill-engaged-hover);--checkmark-color: var(--kirby-color-content-engaged-hover);--border-color: var(--kirby-color-border-raised-hover);--border-color-checked: var(--kirby-color-border-engaged-hover)}}:host ion-checkbox:active{--checkbox-background: var(--kirby-color-fill-raised-active);--checkbox-background-checked: var(--kirby-color-fill-engaged-active);--checkmark-color: var(--kirby-color-content-engaged-active);--border-color: var(--kirby-color-border-raised-active);--border-color-checked: var(--kirby-color-border-engaged-active)}:host ion-checkbox:focus-visible{outline:none;--border-color: var(--kirby-color-border-focus);--border-color-checked: var(--kirby-color-border-focus)}:host ion-checkbox:focus-visible::part(container){transition:box-shadow 80ms linear;box-shadow:var(--kirby-focus-ring-sm-combined-inset)}:host ion-checkbox{--transition: border-color 80ms linear, background-color 80ms linear;--size: 24px;--checkmark-width: var(--kirby-spacing-xxxs);--kirby-checkbox-container-padding: var(--kirby-spacing-xxxs);--checkbox-background: var(--kirby-color-fill-raised);--checkbox-background-checked: var(--kirby-color-fill-engaged);--checkmark-color: var(--kirby-color-content-engaged);--border-width: 1px;--border-color: var(--kirby-color-border-raised);--border-color-checked: var(--kirby-color-border-engaged);--border-radius: 6px}:host ion-checkbox::part(container){padding:var(--kirby-checkbox-container-padding)}:host ion-checkbox::part(label){align-items:start;padding-inline:16px;line-height:var(--kirby-line-height-n)}:host ion-checkbox::part(label-text-wrapper){margin-inline:12px 0;white-space:pre-line}:host ion-checkbox::part(native-wrapper){height:var(--kirby-relative-size-m)}:host ion-checkbox.in-item::part(label){align-items:center;padding-inline:0}:host ion-checkbox.in-item::part(label-text-wrapper){margin-block:0}:host ion-checkbox.in-item.checkbox-label-placement-start::part(label-text-wrapper){margin-inline:0 12px}:host ion-checkbox.in-item.checkbox-label-placement-end::part(label-text-wrapper){margin-inline:12px 0}:host.has-hidden-label:has(ion-checkbox.in-item){position:initial}:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox{position:initial}:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox.checkbox-label-placement-start::part(label-text-wrapper),:host.has-hidden-label:has(ion-checkbox.in-item) ion-checkbox.checkbox-label-placement-end::part(label-text-wrapper){margin-inline:0}:host.has-hidden-label[slot=end] ion-checkbox{margin-inline-start:12px}:host.has-hidden-label .hidden-label{position:absolute;inset:0;opacity:0}:host.error ion-checkbox{--border-color: var(--kirby-color-border-raised-danger);--border-color-checked: var(--kirby-color-border-raised-danger)}:host.error ion-checkbox::part(container){box-shadow:var(--kirby-error-ring-combined-inset)}:host.error ion-checkbox:focus-visible{--border-color: var(--kirby-color-border-focus);--border-color-checked: var(--kirby-color-border-focus)}:host.error ion-checkbox:focus-visible::part(container){box-shadow:var(--kirby-focus-ring-sm-combined-inset)}:host :host-context(kirby-item){z-index:var(--kirby-z-index-default)}:host :host-context(kirby-item) ion-checkbox{margin:0}:host :host-context(kirby-item)[slot=start]{margin-block:0;margin-inline-end:12px}\n"]
167
+ }]
168
+ }],
169
+ ctorParameters: () => [
170
+ { type: i0.ElementRef },
171
+ { type: i1.IonicElementPartHelper },
172
+ { type: i0.ChangeDetectorRef }
173
+ ],
174
+ propDecorators: {
175
+ ionCheckboxElement: [{
176
+ type: ViewChild,
177
+ args: [IonCheckbox, {
178
+ read: ElementRef,
179
+ static: true
180
+ }]
181
+ }],
182
+ checked: [{ type: Input }],
183
+ indeterminate: [{ type: Input }],
184
+ attentionLevel: [{ type: Input }],
185
+ text: [{ type: Input }],
186
+ size: [{
187
+ type: HostBinding,
188
+ args: ["class"]
189
+ }, { type: Input }],
190
+ hasError: [{
191
+ type: HostBinding,
192
+ args: ["class.error"]
193
+ }, { type: Input }],
194
+ disabled: [{ type: Input }],
195
+ _isDisabled: [{
196
+ type: HostBinding,
197
+ args: ["attr.disabled"]
198
+ }],
199
+ isAttentionLevel1: [{
200
+ type: HostBinding,
201
+ args: ["class.attention-level1"]
202
+ }],
203
+ isAttentionLevel2: [{
204
+ type: HostBinding,
205
+ args: ["class.attention-level2"]
206
+ }],
207
+ _labelText: [{
208
+ type: HostBinding,
209
+ args: ["class.has-hidden-label"]
210
+ }],
211
+ checkedChange: [{ type: Output }]
212
+ }
213
+ });
176
214
  export { CheckboxComponent };
177
- //# sourceMappingURL=kirbydesign-designsystem-checkbox.mjs.map
215
+
216
+ //# sourceMappingURL=kirbydesign-designsystem-checkbox.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"kirbydesign-designsystem-checkbox.mjs","sources":["../../checkbox/src/checkbox.component.ts","../../checkbox/src/checkbox.component.html","../../checkbox/src/kirbydesign-designsystem-checkbox.ts"],"sourcesContent":["import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n Input,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { IonicElementPartHelper } from '@kirbydesign/designsystem/helpers';\nimport { IonCheckbox } from '@ionic/angular';\nimport { inheritAriaLabelText, setAccessibleLabel } from '@kirbydesign/designsystem/shared';\n\n@Component({\n imports: [IonCheckbox],\n selector: 'kirby-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrls: ['./checkbox.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n IonicElementPartHelper,\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckboxComponent),\n multi: true,\n },\n ],\n})\nexport class CheckboxComponent\n implements AfterViewInit, ControlValueAccessor, OnInit, AfterContentInit\n{\n @ViewChild(IonCheckbox, { read: ElementRef, static: true })\n private ionCheckboxElement?: ElementRef<HTMLIonCheckboxElement>;\n\n @Input() checked: boolean = false;\n @Input() indeterminate: boolean = false;\n @Input() attentionLevel: '1' | '2' = '2';\n\n @Input()\n text: string;\n\n @HostBinding('class')\n @Input()\n size: 'xs' | 'sm' | 'md' = 'md';\n\n @HostBinding('class.error')\n @Input()\n hasError: boolean = false;\n\n @Input() disabled = false;\n @HostBinding('attr.disabled')\n get _isDisabled() {\n return this.disabled ? 'disabled' : null;\n }\n\n @HostBinding('class.attention-level1') get isAttentionLevel1() {\n return this.attentionLevel === '1';\n }\n @HostBinding('class.attention-level2') get isAttentionLevel2() {\n return this.attentionLevel === '2';\n }\n\n @HostBinding('class.has-hidden-label') _labelText: string;\n\n @Output() checkedChange = new EventEmitter<boolean>();\n\n _justify: 'start' | 'end' | 'space-between' = 'start';\n _labelPlacement: 'end' | 'fixed' | 'stacked' | 'start' = 'end';\n _hasSlottedContent: boolean;\n\n constructor(\n private element: ElementRef<HTMLElement>,\n private ionicElementPartHelper: IonicElementPartHelper,\n private cdr: ChangeDetectorRef\n ) {}\n\n ngOnInit(): void {\n /**\n * We cannot query ion-checkbox for slotted content at this point as the slot has not been rendered.\n * But we need to know if content is slotted to set justify and labelPlacement BEFORE ion-checkbox is rendered.\n * So it has to be done by querying an additional wrapper around the default content slot like this.\n */\n this._hasSlottedContent = this.element.nativeElement\n .querySelector('.default-content')\n .hasChildNodes();\n\n const slot = this.element.nativeElement.getAttribute('slot');\n if (slot === 'end' && this._hasSlottedContent) {\n this._justify = 'space-between';\n this._labelPlacement = 'start';\n }\n }\n\n ngAfterViewInit(): void {\n this.ionicElementPartHelper.setPart('label', this.ionCheckboxElement, '.checkbox-wrapper');\n this.ionicElementPartHelper.setPart(\n 'label-text-wrapper',\n this.ionCheckboxElement,\n '.label-text-wrapper'\n );\n this.ionicElementPartHelper.setPart(\n 'native-wrapper',\n this.ionCheckboxElement,\n '.native-wrapper'\n );\n }\n\n ngAfterContentInit(): void {\n this._labelText = inheritAriaLabelText(this.element.nativeElement);\n\n if (!this.text && !this._labelText && !this._hasSlottedContent) {\n // if no label has been set try to find a label in an item and use its text content\n this._labelText = setAccessibleLabel(this.element.nativeElement);\n }\n }\n\n onChecked(checked: boolean): void {\n this.checked = checked;\n this._onChange(this.checked);\n this.checkedChange.emit(this.checked);\n }\n\n onBlur() {\n this._onTouched();\n }\n\n // Initialize default ControlValueAccessor callback functions (noop)\n // eslint-disable-next-line no-empty-function\n private _onChange: (value: boolean) => void = () => {};\n // eslint-disable-next-line no-empty-function\n private _onTouched = () => {};\n\n /**\n * Sets the checkbox's value. Part of the ControlValueAccessor interface\n * required to integrate with Angular's core forms API.\n *\n * @param value New value to be written to the model.\n */\n writeValue(value: boolean): void {\n this.checked = value;\n this.cdr.markForCheck();\n }\n\n /**\n * Saves a callback function to be invoked when the checkbox's value\n * changes from user input. Part of the ControlValueAccessor interface\n * required to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the value changes.\n */\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n /**\n * Saves a callback function to be invoked when the checkbox is blurred\n * by the user. Part of the ControlValueAccessor interface required\n * to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the component has been touched.\n */\n registerOnTouched(fn: any): void {\n this._onTouched = fn;\n }\n\n /**\n * Disables the checkbox. Part of the ControlValueAccessor interface required\n * to integrate with Angular's core forms API.\n *\n * @param isDisabled Sets whether the component is disabled.\n */\n setDisabledState?(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n }\n}\n","<ion-checkbox\n mode=\"md\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [indeterminate]=\"indeterminate\"\n (ionChange)=\"onChecked($event.detail.checked)\"\n (ionBlur)=\"onBlur()\"\n [labelPlacement]=\"_labelPlacement\"\n [justify]=\"_justify\"\n>\n @if (_labelText) {\n <span class=\"hidden-label\">{{ _labelText }}</span>\n }\n @if (text) {\n <span [attr.aria-hidden]=\"_labelText ? true : undefined\">{{ text }}</span>\n }\n <span class=\"default-content\" [attr.aria-hidden]=\"_labelText ? true : undefined\">\n <ng-content></ng-content>\n </span>\n</ion-checkbox>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAoCa,iBAAiB,CAAA;AAsB5B,IAAA,IACI,WAAW,GAAA;QACb,OAAO,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,IAAI;IAC1C;AAEA,IAAA,IAA2C,iBAAiB,GAAA;AAC1D,QAAA,OAAO,IAAI,CAAC,cAAc,KAAK,GAAG;IACpC;AACA,IAAA,IAA2C,iBAAiB,GAAA;AAC1D,QAAA,OAAO,IAAI,CAAC,cAAc,KAAK,GAAG;IACpC;AAUA,IAAA,WAAA,CACU,OAAgC,EAChC,sBAA8C,EAC9C,GAAsB,EAAA;QAFtB,IAAA,CAAA,OAAO,GAAP,OAAO;QACP,IAAA,CAAA,sBAAsB,GA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AAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,OAAA,EAAA,UAAA,EAAA,WAAA,EAAA,YAAA,EAAA,eAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAcV,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAf7B,SAAS;8BACC,CAAC,WAAW,CAAC,EAAA,QAAA,EACZ,gBAAgB,mBAGT,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;wBACT,sBAAsB;AACtB,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,EAAC,uBAAuB,EAAC;AAChD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,4lBAAA,EAAA,MAAA,EAAA,CAAA,43KAAA,CAAA,EAAA;;sBAKA,SAAS;uBAAC,WAAW,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;;sBAGzD;;sBACA;;sBACA;;sBAEA;;sBAGA,WAAW;uBAAC,OAAO;;sBACnB;;sBAGA,WAAW;uBAAC,aAAa;;sBACzB;;sBAGA;;sBACA,WAAW;uBAAC,eAAe;;sBAK3B,WAAW;uBAAC,wBAAwB;;sBAGpC,WAAW;uBAAC,wBAAwB;;sBAIpC,WAAW;uBAAC,wBAAwB;;sBAEpC;;;AExEH;;AAEG;;;;"}
1
+ {"version":3,"file":"kirbydesign-designsystem-checkbox.mjs","names":[],"sources":["../../checkbox/src/checkbox.component.ts","../../checkbox/src/checkbox.component.html"],"sourcesContent":["import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n Input,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { IonicElementPartHelper } from '@kirbydesign/designsystem/helpers';\nimport { IonCheckbox } from '@ionic/angular';\nimport { inheritAriaLabelText, setAccessibleLabel } from '@kirbydesign/designsystem/shared';\n\n@Component({\n imports: [IonCheckbox],\n selector: 'kirby-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrls: ['./checkbox.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n IonicElementPartHelper,\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => CheckboxComponent),\n multi: true,\n },\n ],\n})\nexport class CheckboxComponent\n implements AfterViewInit, ControlValueAccessor, OnInit, AfterContentInit\n{\n @ViewChild(IonCheckbox, { read: ElementRef, static: true })\n private ionCheckboxElement?: ElementRef<HTMLIonCheckboxElement>;\n\n @Input() checked: boolean = false;\n @Input() indeterminate: boolean = false;\n @Input() attentionLevel: '1' | '2' = '2';\n\n @Input()\n text: string;\n\n @HostBinding('class')\n @Input()\n size: 'xs' | 'sm' | 'md' = 'md';\n\n @HostBinding('class.error')\n @Input()\n hasError: boolean = false;\n\n @Input() disabled = false;\n @HostBinding('attr.disabled')\n get _isDisabled() {\n return this.disabled ? 'disabled' : null;\n }\n\n @HostBinding('class.attention-level1') get isAttentionLevel1() {\n return this.attentionLevel === '1';\n }\n @HostBinding('class.attention-level2') get isAttentionLevel2() {\n return this.attentionLevel === '2';\n }\n\n @HostBinding('class.has-hidden-label') _labelText: string;\n\n @Output() checkedChange = new EventEmitter<boolean>();\n\n _justify: 'start' | 'end' | 'space-between' = 'start';\n _labelPlacement: 'end' | 'fixed' | 'stacked' | 'start' = 'end';\n _hasSlottedContent: boolean;\n\n constructor(\n private element: ElementRef<HTMLElement>,\n private ionicElementPartHelper: IonicElementPartHelper,\n private cdr: ChangeDetectorRef\n ) {}\n\n ngOnInit(): void {\n /**\n * We cannot query ion-checkbox for slotted content at this point as the slot has not been rendered.\n * But we need to know if content is slotted to set justify and labelPlacement BEFORE ion-checkbox is rendered.\n * So it has to be done by querying an additional wrapper around the default content slot like this.\n */\n this._hasSlottedContent = this.element.nativeElement\n .querySelector('.default-content')\n .hasChildNodes();\n\n const slot = this.element.nativeElement.getAttribute('slot');\n if (slot === 'end' && this._hasSlottedContent) {\n this._justify = 'space-between';\n this._labelPlacement = 'start';\n }\n }\n\n ngAfterViewInit(): void {\n this.ionicElementPartHelper.setPart('label', this.ionCheckboxElement, '.checkbox-wrapper');\n this.ionicElementPartHelper.setPart(\n 'label-text-wrapper',\n this.ionCheckboxElement,\n '.label-text-wrapper'\n );\n this.ionicElementPartHelper.setPart(\n 'native-wrapper',\n this.ionCheckboxElement,\n '.native-wrapper'\n );\n }\n\n ngAfterContentInit(): void {\n this._labelText = inheritAriaLabelText(this.element.nativeElement);\n\n if (!this.text && !this._labelText && !this._hasSlottedContent) {\n // if no label has been set try to find a label in an item and use its text content\n this._labelText = setAccessibleLabel(this.element.nativeElement);\n }\n }\n\n onChecked(checked: boolean): void {\n this.checked = checked;\n this._onChange(this.checked);\n this.checkedChange.emit(this.checked);\n }\n\n onBlur() {\n this._onTouched();\n }\n\n // Initialize default ControlValueAccessor callback functions (noop)\n // eslint-disable-next-line no-empty-function\n private _onChange: (value: boolean) => void = () => {};\n // eslint-disable-next-line no-empty-function\n private _onTouched = () => {};\n\n /**\n * Sets the checkbox's value. Part of the ControlValueAccessor interface\n * required to integrate with Angular's core forms API.\n *\n * @param value New value to be written to the model.\n */\n writeValue(value: boolean): void {\n this.checked = value;\n this.cdr.markForCheck();\n }\n\n /**\n * Saves a callback function to be invoked when the checkbox's value\n * changes from user input. Part of the ControlValueAccessor interface\n * required to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the value changes.\n */\n registerOnChange(fn: any): void {\n this._onChange = fn;\n }\n\n /**\n * Saves a callback function to be invoked when the checkbox is blurred\n * by the user. Part of the ControlValueAccessor interface required\n * to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the component has been touched.\n */\n registerOnTouched(fn: any): void {\n this._onTouched = fn;\n }\n\n /**\n * Disables the checkbox. Part of the ControlValueAccessor interface required\n * to integrate with Angular's core forms API.\n *\n * @param isDisabled Sets whether the component is disabled.\n */\n setDisabledState?(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n }\n}\n","<ion-checkbox\n mode=\"md\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [indeterminate]=\"indeterminate\"\n (ionChange)=\"onChecked($event.detail.checked)\"\n (ionBlur)=\"onBlur()\"\n [labelPlacement]=\"_labelPlacement\"\n [justify]=\"_justify\"\n>\n @if (_labelText) {\n <span class=\"hidden-label\">{{ _labelText }}</span>\n }\n @if (text) {\n <span [attr.aria-hidden]=\"_labelText ? true : undefined\">{{ text }}</span>\n }\n <span class=\"default-content\" [attr.aria-hidden]=\"_labelText ? true : undefined\">\n <ng-content></ng-content>\n </span>\n</ion-checkbox>\n"],"mappings":";;;;;;;AAoCA,IAAa,oBAAb,MAAa,kBAAiB;CAsB5B,IACI,cAAW;EACb,OAAO,KAAK,WAAW,aAAa;CACtC;CAEA,IAA2C,oBAAiB;EAC1D,OAAO,KAAK,mBAAmB;CACjC;CACA,IAA2C,oBAAiB;EAC1D,OAAO,KAAK,mBAAmB;CACjC;CAUA,YACU,SACA,wBACA,KAAsB;EAFtB,KAAA,UAAA;EACA,KAAA,yBAAA;EACA,KAAA,MAAA;EAvCD,KAAA,UAAmB;EACnB,KAAA,gBAAyB;EACzB,KAAA,iBAA4B;EAOrC,KAAA,OAA2B;EAI3B,KAAA,WAAoB;EAEX,KAAA,WAAW;EAeV,KAAA,gBAAgB,IAAI,aAAY;EAE1C,KAAA,WAA8C;EAC9C,KAAA,kBAAyD;EA6DjD,KAAA,kBAA2C,CAAE;EAE7C,KAAA,mBAAkB,CAAE;CAxDzB;CAEH,WAAQ;EAMN,KAAK,qBAAqB,KAAK,QAAQ,cACpC,c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