@kirbydesign/designsystem 11.11.3 → 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 -905
  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 -226
  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 +1 @@
1
- {"version":3,"file":"kirbydesign-designsystem-helpers.mjs","sources":["../../helpers/src/element-ancestor-utils.ts","../../helpers/src/content-mutation-observer.ts","../../helpers/src/platform.service.ts","../../helpers/src/chart-config-has-type.ts","../../helpers/src/deep-copy.ts","../../helpers/src/merge-deep.ts","../../helpers/src/unique-id-generator.helper.ts","../../helpers/src/string-search.helper.ts","../../helpers/src/line-clamp-helper.ts","../../helpers/src/kirby-animation.ts","../../helpers/src/ionic-element-part-helper.ts","../../helpers/src/value-accessor-helper.ts","../../helpers/src/public_api.ts","../../helpers/src/kirbydesign-designsystem-helpers.ts"],"sourcesContent":["/* \n Utility function to check if a given element \n has an ancestor with a specific node name. \n\n Can be given a 'stopNodeName' to limit the search\n as to not climb all the way up through the DOM tree. \n\n Returns true when element has the ancestorNodeName \n or an ancestor has the ancestorNodeName. \n\n Returns false otherwise.\n*/\n\nexport const elementHasAncestor = (\n element: HTMLElement,\n ancestorNodeName: string,\n stopNodeName?: string\n) => {\n switch (element?.nodeName) {\n case undefined:\n case stopNodeName?.toUpperCase():\n return false;\n case ancestorNodeName.toUpperCase():\n return true;\n default:\n return elementHasAncestor(element.parentElement, ancestorNodeName, stopNodeName);\n }\n};\n\n/*\n * Utility function to find the closest ancestor modal and\n * get the element with a dialog role from within its shadow root.\n */\nexport function getIonModalDialogAncestor(currentElement: HTMLElement): HTMLElement | undefined {\n const ionModalElement = currentElement.closest('ion-modal');\n const modalElementDialog = ionModalElement?.shadowRoot?.querySelector(\n '[role=\"dialog\"]'\n ) as HTMLElement;\n return modalElementDialog;\n}\n","import { UnobserveFn } from '@kirbydesign/designsystem/types';\n\n/* Function based on https://github.com/angular/components/blob/main/src/cdk/observers/observe-content.ts\n * Angular may add, remove, or edit comment nodes during change detection. We don't care about\n * these changes because they don't affect the user-preceived content, and worse it can cause\n * infinite change detection cycles where the change detection updates a comment, triggering the\n * MutationObserver, triggering another change detection and kicking the cycle off again. */\nfunction shouldIgnoreMutationRecord(record: MutationRecord) {\n // Ignore changes to comment text.\n if (record.type === 'characterData' && record.target instanceof Comment) {\n return true;\n }\n // Ignore addition / removal of comments.\n if (record.type === 'childList') {\n for (let i = 0; i < record.addedNodes.length; i++) {\n if (!(record.addedNodes[i] instanceof Comment)) {\n return false;\n }\n }\n for (let i = 0; i < record.removedNodes.length; i++) {\n if (!(record.removedNodes[i] instanceof Comment)) {\n return false;\n }\n }\n return true;\n }\n // Observe everything else.\n return false;\n}\n\n/**\n * Creates a MutationObserver and observes content changes in a given element.\n * The provided callback is called when changes are detected.\n *\n * @returns function - an unobserve function that can be called to disconnect the created observer.\n */\nexport function observeContent(\n observedElement: HTMLElement,\n contentChangedCallback: () => void\n): UnobserveFn {\n const mutationObserver = new MutationObserver((mutations) => {\n const filteredMutations = mutations.filter((mutation) => !shouldIgnoreMutationRecord(mutation));\n if (filteredMutations.length > 0) {\n contentChangedCallback();\n }\n });\n\n mutationObserver.observe(observedElement, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n };\n}\n","import { Injectable } from '@angular/core';\n\nimport { WindowRef } from '@kirbydesign/designsystem/types';\nimport { DesignTokenHelper } from './design-token-helper';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PlatformService {\n constructor(private windowRef: WindowRef) {}\n\n isTouch() {\n const isTouchDeviceQuery = '(pointer: coarse)'; // No check for `hover: none`, as Samsung Galaxy will return false on `hover: none` media query\n return this.windowRef.nativeWindow.matchMedia(isTouchDeviceQuery).matches;\n }\n\n isPhabletOrBigger() {\n const query = `(min-width: ${DesignTokenHelper.breakpoints.medium})`;\n return this.windowRef.nativeWindow.matchMedia(query).matches;\n }\n}\n","import { ChartConfiguration, ChartConfigurationCustomTypesPerDataset } from 'chart.js';\n\n/* \n Type guard is needed as of chart.js@3.8.1. The config type has been updated to a union type, \n and the newly added type 'ChartConfigurationCustomTypesPerDataset' does not contain the 'type' property.\n Typescript will throw an error, when trying to access a property that doesn't exist on all union types,\n unless a type guard is used. \n*/\n\nexport const chartConfigHasType = (\n config: ChartConfiguration | ChartConfigurationCustomTypesPerDataset\n): config is ChartConfiguration => {\n return 'type' in config;\n};\n","/*\nCopied from https://github.com/ykdr8/ts-deepcopy.\n\nMIT License\n\nCopyright (c) 2017 ykdr2017\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n */\nexport function deepCopy<Tp>(tgt: Tp): Tp {\n let cp: Tp;\n if (tgt === null) {\n cp = tgt;\n } else if (tgt instanceof Date) {\n cp = new Date((tgt as any).getTime()) as any;\n } else if (Array.isArray(tgt)) {\n cp = [] as any;\n (tgt as any[]).forEach((v) => {\n (cp as any).push(v);\n });\n cp = (cp as any).map((n: any) => deepCopy<any>(n));\n } else if (typeof tgt === 'object') {\n cp = { ...(tgt as Tp) } as Tp;\n Object.keys(cp).forEach((k) => {\n (cp as any)[k] = deepCopy<any>((cp as any)[k]);\n });\n } else {\n cp = tgt;\n }\n return cp;\n}\n","/**\n * Performs a deep merge of objects and returns new object. Does not modify\n * objects (immutable).\n * It merges from into object to the left\n * eg. mergeDeep({a: 'will be overridden', b: 'some val'}, {a: 'new val'}) => {a: 'new val', b: 'some val'}\n *\n * @param originalObject object - Object to override,\n * @param overrideObject object - Object to override \"toOverride\" values with\n * @param config object - Configuration for how to merge.\n * mergeArrays determines if it should merge or override arrays\n * @returns object - New object with merged key/values\n */\nexport function mergeDeep(originalObject, overrideObject, config = { mergeArrays: false }) {\n const isObject = (obj) => obj && typeof obj === 'object';\n\n return [originalObject, overrideObject].reduce((mergedObject, obj) => {\n Object.keys(obj).forEach((key) => {\n const mergedObjectValue = mergedObject[key];\n const overrideObjectValue = obj[key];\n\n if (Array.isArray(mergedObjectValue) && Array.isArray(overrideObjectValue)) {\n mergedObject[key] = config.mergeArrays\n ? mergedObjectValue.concat(overrideObjectValue)\n : overrideObjectValue;\n } else if (isObject(mergedObjectValue) && isObject(overrideObjectValue)) {\n mergedObject[key] = mergeDeep(mergedObjectValue, overrideObjectValue);\n } else {\n mergedObject[key] = overrideObjectValue;\n }\n });\n\n return mergedObject;\n }, {});\n}\n\nexport function mergeDeepAll(...objects: object[]): object {\n const objectsWithoutUndefined = objects.filter((object) => object !== undefined);\n return objectsWithoutUndefined.reduce((originalObject, overrideObject) =>\n mergeDeep(originalObject, overrideObject)\n );\n}\n","export class UniqueIdGenerator {\n private static registry = new Map<string, UniqueIdGenerator>();\n private id = 0;\n\n private constructor(private scope: string) {}\n\n static scopedTo(scope: string) {\n let scopedGenerator = UniqueIdGenerator.registry.get(scope);\n if (!scopedGenerator) {\n scopedGenerator = new UniqueIdGenerator(scope);\n UniqueIdGenerator.registry.set(scope, scopedGenerator);\n }\n return scopedGenerator;\n }\n\n next(): string {\n return `${this.scope}-${this.id++}`;\n }\n}\n","export class StringSearchHelper {\n static getIndexByFirstMatchingStartString(\n searchString: string,\n words: string[],\n startIndex: number\n ): number {\n searchString = searchString.toLowerCase();\n\n const wordsStartingWithMatchString = words\n .map((word, index) => {\n return { word: word.toLowerCase(), index };\n })\n .filter((match) => match.word.startsWith(searchString));\n\n if (wordsStartingWithMatchString.length === 0) {\n return -1;\n }\n\n const firstWordStartingWithChar = wordsStartingWithMatchString[0];\n const nextWordStartingWithChar = wordsStartingWithMatchString.find(\n (wordAndIndex) => wordAndIndex.index >= startIndex\n );\n\n return nextWordStartingWithChar?.index ?? firstWordStartingWithChar.index;\n }\n\n static isPrintableCharacter(key: string): boolean {\n return key.length === 1 && /\\S/.test(key);\n }\n}\n","import { Injectable, Renderer2, RendererStyleFlags2 } from '@angular/core';\n\nconst config = Object.freeze({\n className: 'kirby-line-clamp',\n lineClamp: '--line-clamp',\n lineHeight: '--line-height',\n});\n\n@Injectable()\nexport class LineClampHelper {\n constructor(private renderer: Renderer2) {}\n\n setMaxLines(element: Element, maxLines: number): void {\n this.renderer.setStyle(element, config.lineClamp, maxLines, RendererStyleFlags2.DashCase);\n this.renderer.addClass(element, config.className);\n }\n\n setLineHeight(element: Element, lineHeight: string): void {\n // Only necessary for the fallback solution to work\n this.renderer.setStyle(element, config.lineHeight, lineHeight, RendererStyleFlags2.DashCase);\n }\n\n removeLineClamp(element: Element) {\n this.renderer.removeClass(element, config.className);\n this.renderer.removeStyle(element, config.lineClamp);\n this.renderer.removeStyle(element, config.lineHeight);\n }\n}\n","/* eslint-disable @typescript-eslint/no-namespace */\nimport { DesignTokenHelper } from './design-token-helper';\n\nexport namespace KirbyAnimation {\n export enum Duration {\n // Duration in milliseconds\n QUICK = parseInt(DesignTokenHelper.transitionDuration('quick')),\n SHORT = parseInt(DesignTokenHelper.transitionDuration('short')),\n LONG = parseInt(DesignTokenHelper.transitionDuration('long')),\n EXTRA_LONG = parseInt(DesignTokenHelper.transitionDuration('extraLong')),\n }\n export const Easing = DesignTokenHelper.transitionEasings();\n}\n","import { ElementRef, Injectable, Renderer2 } from '@angular/core';\nimport { componentOnReady } from '@ionic/core';\n\n@Injectable()\nexport class IonicElementPartHelper {\n constructor(private renderer: Renderer2) {}\n\n public async setPart(partName: string, ionicElementRef: ElementRef, selector: string) {\n // Ensure custom element has been defined and rendered\n await customElements.whenDefined(ionicElementRef.nativeElement.localName);\n const customElement = await new Promise<HTMLElement>((resolve) => {\n componentOnReady(ionicElementRef.nativeElement, (element) => resolve(element));\n });\n\n const partElement: HTMLElement = customElement.shadowRoot.querySelector(selector);\n if (!partElement) return;\n\n this.renderer.setAttribute(partElement, 'part', partName);\n }\n}\n","import { ControlValueAccessor } from '@angular/forms';\n\n/**\n * Configuration for extending a ControlValueAccessor's `writeValue` method.\n * @typeParam T - The type of value being written\n */\nexport interface WriteValueExtension<T = unknown> {\n /**\n * Callback invoked after `writeValue` is called on each accessor.\n * @param value - The value being written\n */\n afterWriteValue: (value: T) => void;\n}\n\n/**\n * Configuration for extending a ControlValueAccessor's `registerOnChange` method.\n * @typeParam TInput - The type of value received from the input\n * @typeParam TOutput - The type of value passed to the form control\n */\nexport interface RegisterOnChangeExtension<TInput = unknown, TOutput = unknown> {\n /**\n * Transform the value before it's passed to the original onChange function.\n * @param value - The original value from the input event\n * @returns The transformed value to pass to the form control\n */\n transformValue: (value: TInput) => TOutput;\n}\n\n/**\n * Configuration options for extending ControlValueAccessor methods.\n * @typeParam TWrite - The type of value for writeValue\n * @typeParam TChangeInput - The type of value received in registerOnChange\n * @typeParam TChangeOutput - The type of value output from registerOnChange\n */\nexport interface ValueAccessorExtensionConfig<\n TWrite = unknown,\n TChangeInput = unknown,\n TChangeOutput = unknown,\n> {\n /**\n * Configuration for extending `writeValue`.\n * When provided, the `afterWriteValue` callback will be invoked after each accessor's\n * `writeValue` method is called.\n */\n writeValue?: WriteValueExtension<TWrite>;\n\n /**\n * Configuration for extending `registerOnChange`.\n * When provided, the `transformValue` function will be used to transform values\n * before they're passed to the form control's onChange handler.\n */\n registerOnChange?: RegisterOnChangeExtension<TChangeInput, TChangeOutput>;\n}\n\n/**\n * Extends the methods of provided ControlValueAccessors.\n *\n * This utility wraps the control value accessor methods to add custom behavior while preserving\n * the original functionality. Its used to:\n * - Emit kirbyChange when values are written programmatically\n * - Transform or normalize values before they're passed to form controls to work with inputmasking\n *\n * @param accessors - Array of ControlValueAccessors to extend, typically injected via `NG_VALUE_ACCESSOR`\n * @param config - Configuration specifying which methods to extend and how\n *\n * @example\n * // Simple usage - emit changes when writeValue is called\n * extendValueAccessors(this.valueAccessors, {\n * writeValue: {\n * afterWriteValue: (value) => this.kirbyChange.emit(value)\n * }\n * });\n *\n * @example\n * // Advanced usage - transform values in registerOnChange\n * extendValueAccessors(this.valueAccessors, {\n * writeValue: {\n * afterWriteValue: (value) => this.updateDisplay(value)\n * },\n * registerOnChange: {\n * transformValue: (value) => this.normalizeValue(value)\n * }\n * });\n */\nexport function extendValueAccessors<\n TWrite = unknown,\n TChangeInput = unknown,\n TChangeOutput = unknown,\n>(\n accessors: ControlValueAccessor[] | null | undefined,\n config: ValueAccessorExtensionConfig<TWrite, TChangeInput, TChangeOutput>\n): void {\n if (!accessors) return;\n\n accessors.forEach((accessor) => {\n if (config.writeValue) {\n extendWriteValue(accessor, config.writeValue);\n }\n\n if (config.registerOnChange) {\n extendRegisterOnChange(accessor, config.registerOnChange);\n }\n });\n}\n\nfunction extendWriteValue<T>(\n accessor: ControlValueAccessor,\n extension: WriteValueExtension<T>\n): void {\n const originalWriteValue = accessor.writeValue?.bind(accessor);\n\n accessor.writeValue = (value: T) => {\n if (originalWriteValue) {\n originalWriteValue(value);\n }\n extension.afterWriteValue(value);\n };\n}\n\nfunction extendRegisterOnChange<TInput, TOutput>(\n accessor: ControlValueAccessor,\n extension: RegisterOnChangeExtension<TInput, TOutput>\n): void {\n const originalRegisterOnChange = accessor.registerOnChange?.bind(accessor);\n\n if (originalRegisterOnChange) {\n accessor.registerOnChange = (fn: (value: TOutput) => void) => {\n const wrappedFn = (value: TInput) => {\n fn(extension.transformValue(value));\n };\n originalRegisterOnChange(wrappedFn);\n };\n }\n}\n","// re-export helpers from core, to preserve backwards compatability\n// of 'designsystem' library\nexport * from './element-ancestor-utils';\nexport * from './color-helper';\nexport * from './content-mutation-observer';\nexport * from './design-token-helper';\nexport * from './string-helper';\nexport * from './theme-color.type';\nexport * from './platform.service';\nexport * from './chart-config-has-type';\nexport * from './deep-copy';\nexport * from './merge-deep';\nexport * from './unique-id-generator.helper';\nexport * from './string-search.helper';\nexport * from './line-clamp-helper';\nexport * from './kirby-animation';\nexport * from './ionic-element-part-helper';\nexport * from './value-accessor-helper';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;AAWE;AAEK,MAAM,kBAAkB,GAAG,CAChC,OAAoB,EACpB,gBAAwB,EACxB,YAAqB,KACnB;AACF,IAAA,QAAQ,OAAO,EAAE,QAAQ;AACvB,QAAA,KAAK,SAAS;QACd,KAAK,YAAY,EAAE,WAAW,EAAE;AAC9B,YAAA,OAAO,KAAK;QACd,KAAK,gBAAgB,CAAC,WAAW,EAAE;AACjC,YAAA,OAAO,IAAI;AACb,QAAA;YACE,OAAO,kBAAkB,CAAC,OAAO,CAAC,aAAa,EAAE,gBAAgB,EAAE,YAAY,CAAC;;AAEtF;AAEA;;;AAGG;AACG,SAAU,yBAAyB,CAAC,cAA2B,EAAA;IACnE,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC;IAC3D,MAAM,kBAAkB,GAAG,eAAe,EAAE,UAAU,EAAE,aAAa,CACnE,iBAAiB,CACH;AAChB,IAAA,OAAO,kBAAkB;AAC3B;;ACrCA;;;;AAI4F;AAC5F,SAAS,0BAA0B,CAAC,MAAsB,EAAA;;AAExD,IAAA,IAAI,MAAM,CAAC,IAAI,KAAK,eAAe,IAAI,MAAM,CAAC,MAAM,YAAY,OAAO,EAAE;AACvE,QAAA,OAAO,IAAI;IACb;;AAEA,IAAA,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE;AAC/B,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACjD,YAAA,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,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AAC;AACrC,YAAA,CAAC;YACD,wBAAwB,CAAC,SAAS,CAAC;AACrC,QAAA,CAAC;IACH;AACF;;ACrIA;AACA;;ACDA;;AAEG;;;;"}
1
+ {"version":3,"file":"kirbydesign-designsystem-helpers.mjs","names":[],"sources":["../../helpers/src/element-ancestor-utils.ts","../../helpers/src/content-mutation-observer.ts","../../helpers/src/platform.service.ts","../../helpers/src/chart-config-has-type.ts","../../helpers/src/deep-copy.ts","../../helpers/src/merge-deep.ts","../../helpers/src/unique-id-generator.helper.ts","../../helpers/src/string-search.helper.ts","../../helpers/src/line-clamp-helper.ts","../../helpers/src/kirby-animation.ts","../../helpers/src/ionic-element-part-helper.ts","../../helpers/src/value-accessor-helper.ts"],"sourcesContent":["/* \n Utility function to check if a given element \n has an ancestor with a specific node name. \n\n Can be given a 'stopNodeName' to limit the search\n as to not climb all the way up through the DOM tree. \n\n Returns true when element has the ancestorNodeName \n or an ancestor has the ancestorNodeName. \n\n Returns false otherwise.\n*/\n\nexport const elementHasAncestor = (\n element: HTMLElement | null,\n ancestorNodeName: string,\n stopNodeName?: string\n): boolean => {\n if (!element) return false;\n switch (element?.nodeName) {\n case undefined:\n case stopNodeName?.toUpperCase():\n return false;\n case ancestorNodeName.toUpperCase():\n return true;\n default:\n return elementHasAncestor(element.parentElement, ancestorNodeName, stopNodeName);\n }\n};\n\n/*\n * Utility function to find the closest ancestor modal and\n * get the element with a dialog role from within its shadow root.\n */\nexport function getIonModalDialogAncestor(currentElement: HTMLElement): HTMLElement | undefined {\n const ionModalElement = currentElement.closest('ion-modal');\n const modalElementDialog =\n ionModalElement?.shadowRoot?.querySelector<HTMLElement>('[role=\"dialog\"]');\n return modalElementDialog ?? undefined;\n}\n","import { UnobserveFn } from '@kirbydesign/designsystem/types';\n\n/* Function based on https://github.com/angular/components/blob/main/src/cdk/observers/observe-content.ts\n * Angular may add, remove, or edit comment nodes during change detection. We don't care about\n * these changes because they don't affect the user-preceived content, and worse it can cause\n * infinite change detection cycles where the change detection updates a comment, triggering the\n * MutationObserver, triggering another change detection and kicking the cycle off again. */\nfunction shouldIgnoreMutationRecord(record: MutationRecord) {\n // Ignore changes to comment text.\n if (record.type === 'characterData' && record.target instanceof Comment) {\n return true;\n }\n // Ignore addition / removal of comments.\n if (record.type === 'childList') {\n for (let i = 0; i < record.addedNodes.length; i++) {\n if (!(record.addedNodes[i] instanceof Comment)) {\n return false;\n }\n }\n for (let i = 0; i < record.removedNodes.length; i++) {\n if (!(record.removedNodes[i] instanceof Comment)) {\n return false;\n }\n }\n return true;\n }\n // Observe everything else.\n return false;\n}\n\n/**\n * Creates a MutationObserver and observes content changes in a given element.\n * The provided callback is called when changes are detected.\n *\n * @returns function - an unobserve function that can be called to disconnect the created observer.\n */\nexport function observeContent(\n observedElement: HTMLElement,\n contentChangedCallback: () => void\n): UnobserveFn {\n const mutationObserver = new MutationObserver((mutations) => {\n const filteredMutations = mutations.filter((mutation) => !shouldIgnoreMutationRecord(mutation));\n if (filteredMutations.length > 0) {\n contentChangedCallback();\n }\n });\n\n mutationObserver.observe(observedElement, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n };\n}\n","import { Injectable } from '@angular/core';\n\nimport { WindowRef } from '@kirbydesign/designsystem/types';\nimport { DesignTokenHelper } from './design-token-helper';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PlatformService {\n constructor(private windowRef: WindowRef) {}\n\n isTouch() {\n const isTouchDeviceQuery = '(pointer: coarse)'; // No check for `hover: none`, as Samsung Galaxy will return false on `hover: none` media query\n return this.windowRef.nativeWindow.matchMedia(isTouchDeviceQuery).matches;\n }\n\n isPhabletOrBigger() {\n const query = `(min-width: ${DesignTokenHelper.breakpoints.medium})`;\n return this.windowRef.nativeWindow.matchMedia(query).matches;\n }\n}\n","import { ChartConfiguration, ChartConfigurationCustomTypesPerDataset } from 'chart.js';\n\n/* \n Type guard is needed as of chart.js@3.8.1. The config type has been updated to a union type, \n and the newly added type 'ChartConfigurationCustomTypesPerDataset' does not contain the 'type' property.\n Typescript will throw an error, when trying to access a property that doesn't exist on all union types,\n unless a type guard is used. \n*/\n\nexport const chartConfigHasType = (\n config: ChartConfiguration | ChartConfigurationCustomTypesPerDataset\n): config is ChartConfiguration => {\n return 'type' in config;\n};\n","/*\nCopied from https://github.com/ykdr8/ts-deepcopy.\n\nMIT License\n\nCopyright (c) 2017 ykdr2017\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n */\nexport function deepCopy<Tp>(tgt: Tp): Tp {\n let cp: Tp;\n if (tgt === null) {\n cp = tgt;\n } else if (tgt instanceof Date) {\n cp = new Date((tgt as any).getTime()) as any;\n } else if (Array.isArray(tgt)) {\n cp = [] as any;\n (tgt as any[]).forEach((v) => {\n (cp as any).push(v);\n });\n cp = (cp as any).map((n: any) => deepCopy<any>(n));\n } else if (typeof tgt === 'object') {\n cp = { ...(tgt as object) } as Tp;\n Object.keys(cp as object).forEach((k) => {\n (cp as any)[k] = deepCopy<any>((cp as any)[k]);\n });\n } else {\n cp = tgt;\n }\n return cp;\n}\n","/**\n * Performs a deep merge of objects and returns new object. Does not modify\n * objects (immutable).\n * It merges from into object to the left\n * eg. mergeDeep({a: 'will be overridden', b: 'some val'}, {a: 'new val'}) => {a: 'new val', b: 'some val'}\n *\n * @param originalObject object - Object to override,\n * @param overrideObject object - Object to override \"toOverride\" values with\n * @param config object - Configuration for how to merge.\n * mergeArrays determines if it should merge or override arrays\n * @returns object - New object with merged key/values\n */\nexport function mergeDeep(\n originalObject: Record<string, any>,\n overrideObject: Record<string, any>,\n config: { mergeArrays: boolean } = { mergeArrays: false }\n): Record<string, any> {\n const isObject = (obj: any) => obj && typeof obj === 'object';\n\n return [originalObject, overrideObject].reduce((mergedObject, obj) => {\n Object.keys(obj).forEach((key) => {\n const mergedObjectValue = mergedObject[key];\n const overrideObjectValue = obj[key];\n\n if (Array.isArray(mergedObjectValue) && Array.isArray(overrideObjectValue)) {\n mergedObject[key] = config.mergeArrays\n ? mergedObjectValue.concat(overrideObjectValue)\n : overrideObjectValue;\n } else if (isObject(mergedObjectValue) && isObject(overrideObjectValue)) {\n mergedObject[key] = mergeDeep(mergedObjectValue, overrideObjectValue);\n } else {\n mergedObject[key] = overrideObjectValue;\n }\n });\n\n return mergedObject;\n }, {});\n}\n\nexport function mergeDeepAll(...objects: object[]): object {\n const objectsWithoutUndefined = objects.filter((object) => object !== undefined);\n return objectsWithoutUndefined.reduce((originalObject, overrideObject) =>\n mergeDeep(originalObject, overrideObject)\n );\n}\n","export class UniqueIdGenerator {\n private static registry = new Map<string, UniqueIdGenerator>();\n private id = 0;\n\n private constructor(private scope: string) {}\n\n static scopedTo(scope: string) {\n let scopedGenerator = UniqueIdGenerator.registry.get(scope);\n if (!scopedGenerator) {\n scopedGenerator = new UniqueIdGenerator(scope);\n UniqueIdGenerator.registry.set(scope, scopedGenerator);\n }\n return scopedGenerator;\n }\n\n next(): string {\n return `${this.scope}-${this.id++}`;\n }\n}\n","export class StringSearchHelper {\n static getIndexByFirstMatchingStartString(\n searchString: string,\n words: string[],\n startIndex: number\n ): number {\n searchString = searchString.toLowerCase();\n\n const wordsStartingWithMatchString = words\n .map((word, index) => {\n return { word: word.toLowerCase(), index };\n })\n .filter((match) => match.word.startsWith(searchString));\n\n if (wordsStartingWithMatchString.length === 0) {\n return -1;\n }\n\n const firstWordStartingWithChar = wordsStartingWithMatchString[0];\n const nextWordStartingWithChar = wordsStartingWithMatchString.find(\n (wordAndIndex) => wordAndIndex.index >= startIndex\n );\n\n return nextWordStartingWithChar?.index ?? firstWordStartingWithChar.index;\n }\n\n static isPrintableCharacter(key: string): boolean {\n return key.length === 1 && /\\S/.test(key);\n }\n}\n","import { Injectable, Renderer2, RendererStyleFlags2 } from '@angular/core';\n\nconst config = Object.freeze({\n className: 'kirby-line-clamp',\n lineClamp: '--line-clamp',\n lineHeight: '--line-height',\n});\n\n@Injectable()\nexport class LineClampHelper {\n constructor(private renderer: Renderer2) {}\n\n setMaxLines(element: Element, maxLines: number): void {\n this.renderer.setStyle(element, config.lineClamp, maxLines, RendererStyleFlags2.DashCase);\n this.renderer.addClass(element, config.className);\n }\n\n setLineHeight(element: Element, lineHeight: string): void {\n // Only necessary for the fallback solution to work\n this.renderer.setStyle(element, config.lineHeight, lineHeight, RendererStyleFlags2.DashCase);\n }\n\n removeLineClamp(element: Element) {\n this.renderer.removeClass(element, config.className);\n this.renderer.removeStyle(element, config.lineClamp);\n this.renderer.removeStyle(element, config.lineHeight);\n }\n}\n","/* eslint-disable @typescript-eslint/no-namespace */\nimport { DesignTokenHelper } from './design-token-helper';\n\nexport namespace KirbyAnimation {\n export enum Duration {\n // Duration in milliseconds\n QUICK = parseInt(DesignTokenHelper.transitionDuration('quick')),\n SHORT = parseInt(DesignTokenHelper.transitionDuration('short')),\n LONG = parseInt(DesignTokenHelper.transitionDuration('long')),\n EXTRA_LONG = parseInt(DesignTokenHelper.transitionDuration('extraLong')),\n }\n export const Easing = DesignTokenHelper.transitionEasings();\n}\n","import { ElementRef, Injectable, Renderer2 } from '@angular/core';\nimport { componentOnReady } from '@ionic/core';\n\n@Injectable()\nexport class IonicElementPartHelper {\n constructor(private renderer: Renderer2) {}\n\n public async setPart(partName: string, ionicElementRef: ElementRef, selector: string) {\n // Ensure custom element has been defined and rendered\n await customElements.whenDefined(ionicElementRef.nativeElement.localName);\n const customElement = await new Promise<HTMLElement>((resolve) => {\n componentOnReady(ionicElementRef.nativeElement, (element: HTMLElement) => resolve(element));\n });\n\n const partElement = customElement.shadowRoot?.querySelector<HTMLElement>(selector);\n if (!partElement) return;\n\n this.renderer.setAttribute(partElement, 'part', partName);\n }\n}\n","import { ControlValueAccessor } from '@angular/forms';\n\n/**\n * Configuration for extending a ControlValueAccessor's `writeValue` method.\n * @typeParam T - The type of value being written\n */\nexport interface WriteValueExtension<T = unknown> {\n /**\n * Callback invoked after `writeValue` is called on each accessor.\n * @param value - The value being written\n */\n afterWriteValue: (value: T) => void;\n}\n\n/**\n * Configuration for extending a ControlValueAccessor's `registerOnChange` method.\n * @typeParam TInput - The type of value received from the input\n * @typeParam TOutput - The type of value passed to the form control\n */\nexport interface RegisterOnChangeExtension<TInput = unknown, TOutput = unknown> {\n /**\n * Transform the value before it's passed to the original onChange function.\n * @param value - The original value from the input event\n * @returns The transformed value to pass to the form control\n */\n transformValue: (value: TInput) => TOutput;\n}\n\n/**\n * Configuration options for extending ControlValueAccessor methods.\n * @typeParam TWrite - The type of value for writeValue\n * @typeParam TChangeInput - The type of value received in registerOnChange\n * @typeParam TChangeOutput - The type of value output from registerOnChange\n */\nexport interface ValueAccessorExtensionConfig<\n TWrite = unknown,\n TChangeInput = unknown,\n TChangeOutput = unknown,\n> {\n /**\n * Configuration for extending `writeValue`.\n * When provided, the `afterWriteValue` callback will be invoked after each accessor's\n * `writeValue` method is called.\n */\n writeValue?: WriteValueExtension<TWrite>;\n\n /**\n * Configuration for extending `registerOnChange`.\n * When provided, the `transformValue` function will be used to transform values\n * before they're passed to the form control's onChange handler.\n */\n registerOnChange?: RegisterOnChangeExtension<TChangeInput, TChangeOutput>;\n}\n\n/**\n * Extends the methods of provided ControlValueAccessors.\n *\n * This utility wraps the control value accessor methods to add custom behavior while preserving\n * the original functionality. Its used to:\n * - Emit kirbyChange when values are written programmatically\n * - Transform or normalize values before they're passed to form controls to work with inputmasking\n *\n * @param accessors - Array of ControlValueAccessors to extend, typically injected via `NG_VALUE_ACCESSOR`\n * @param config - Configuration specifying which methods to extend and how\n *\n * @example\n * // Simple usage - emit changes when writeValue is called\n * extendValueAccessors(this.valueAccessors, {\n * writeValue: {\n * afterWriteValue: (value) => this.kirbyChange.emit(value)\n * }\n * });\n *\n * @example\n * // Advanced usage - transform values in registerOnChange\n * extendValueAccessors(this.valueAccessors, {\n * writeValue: {\n * afterWriteValue: (value) => this.updateDisplay(value)\n * },\n * registerOnChange: {\n * transformValue: (value) => this.normalizeValue(value)\n * }\n * });\n */\nexport function extendValueAccessors<\n TWrite = unknown,\n TChangeInput = unknown,\n TChangeOutput = unknown,\n>(\n accessors: ControlValueAccessor[] | null | undefined,\n config: ValueAccessorExtensionConfig<TWrite, TChangeInput, TChangeOutput>\n): void {\n if (!accessors) return;\n\n accessors.forEach((accessor) => {\n if (config.writeValue) {\n extendWriteValue(accessor, config.writeValue);\n }\n\n if (config.registerOnChange) {\n extendRegisterOnChange(accessor, config.registerOnChange);\n }\n });\n}\n\nfunction extendWriteValue<T>(\n accessor: ControlValueAccessor,\n extension: WriteValueExtension<T>\n): void {\n const originalWriteValue = accessor.writeValue?.bind(accessor);\n\n accessor.writeValue = (value: T) => {\n if (originalWriteValue) {\n originalWriteValue(value);\n }\n extension.afterWriteValue(value);\n };\n}\n\nfunction extendRegisterOnChange<TInput, TOutput>(\n accessor: ControlValueAccessor,\n extension: RegisterOnChangeExtension<TInput, TOutput>\n): void {\n const originalRegisterOnChange = accessor.registerOnChange?.bind(accessor);\n\n if (originalRegisterOnChange) {\n accessor.registerOnChange = (fn: (value: TOutput) => void) => {\n const wrappedFn = (value: TInput) => {\n fn(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