@ojiepermana/angular 22.1.13 → 22.2.0

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 (252) hide show
  1. package/README.md +8 -6
  2. package/SUPPORT.md +3 -3
  3. package/chart/README.md +1 -1
  4. package/component/README.md +2 -2
  5. package/component/calendar/README.md +3 -15
  6. package/component/drawer/README.md +1 -2
  7. package/fesm2022/ojiepermana-angular-chart-area.mjs +352 -137
  8. package/fesm2022/ojiepermana-angular-chart-bar.mjs +744 -524
  9. package/fesm2022/ojiepermana-angular-chart-core.mjs +1140 -1344
  10. package/fesm2022/ojiepermana-angular-chart-line.mjs +393 -147
  11. package/fesm2022/ojiepermana-angular-chart-pie.mjs +408 -179
  12. package/fesm2022/ojiepermana-angular-chart-primitives.mjs +1262 -920
  13. package/fesm2022/ojiepermana-angular-chart-radar.mjs +473 -205
  14. package/fesm2022/ojiepermana-angular-chart-radial.mjs +425 -182
  15. package/fesm2022/ojiepermana-angular-chart-scatter.mjs +386 -210
  16. package/fesm2022/ojiepermana-angular-chart.mjs +3 -19
  17. package/fesm2022/ojiepermana-angular-component-accordion.mjs +485 -243
  18. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +963 -325
  19. package/fesm2022/ojiepermana-angular-component-alert.mjs +266 -103
  20. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +80 -35
  21. package/fesm2022/ojiepermana-angular-component-avatar.mjs +402 -135
  22. package/fesm2022/ojiepermana-angular-component-badge.mjs +109 -59
  23. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +410 -142
  24. package/fesm2022/ojiepermana-angular-component-button-group.mjs +249 -96
  25. package/fesm2022/ojiepermana-angular-component-button.mjs +153 -75
  26. package/fesm2022/ojiepermana-angular-component-calendar.mjs +531 -418
  27. package/fesm2022/ojiepermana-angular-component-card.mjs +457 -171
  28. package/fesm2022/ojiepermana-angular-component-carousel.mjs +642 -272
  29. package/fesm2022/ojiepermana-angular-component-checkbox.mjs +312 -108
  30. package/fesm2022/ojiepermana-angular-component-collapsible.mjs +299 -115
  31. package/fesm2022/ojiepermana-angular-component-combobox.mjs +396 -183
  32. package/fesm2022/ojiepermana-angular-component-command.mjs +807 -347
  33. package/fesm2022/ojiepermana-angular-component-composer.mjs +807 -330
  34. package/fesm2022/ojiepermana-angular-component-context-menu.mjs +196 -161
  35. package/fesm2022/ojiepermana-angular-component-date-picker.mjs +650 -338
  36. package/fesm2022/ojiepermana-angular-component-dialog.mjs +710 -316
  37. package/fesm2022/ojiepermana-angular-component-drawer.mjs +2 -5
  38. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +1212 -646
  39. package/fesm2022/ojiepermana-angular-component-editor.mjs +987 -502
  40. package/fesm2022/ojiepermana-angular-component-empty.mjs +350 -137
  41. package/fesm2022/ojiepermana-angular-component-form.mjs +813 -434
  42. package/fesm2022/ojiepermana-angular-component-hover-card.mjs +486 -277
  43. package/fesm2022/ojiepermana-angular-component-icon.mjs +241 -140
  44. package/fesm2022/ojiepermana-angular-component-input-group.mjs +449 -176
  45. package/fesm2022/ojiepermana-angular-component-input-otp.mjs +891 -488
  46. package/fesm2022/ojiepermana-angular-component-input.mjs +86 -55
  47. package/fesm2022/ojiepermana-angular-component-item.mjs +713 -261
  48. package/fesm2022/ojiepermana-angular-component-kanban.mjs +714 -216
  49. package/fesm2022/ojiepermana-angular-component-kbd.mjs +124 -52
  50. package/fesm2022/ojiepermana-angular-component-label.mjs +82 -31
  51. package/fesm2022/ojiepermana-angular-component-menubar.mjs +479 -329
  52. package/fesm2022/ojiepermana-angular-component-native-select.mjs +167 -65
  53. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +683 -380
  54. package/fesm2022/ojiepermana-angular-component-pagination.mjs +277 -94
  55. package/fesm2022/ojiepermana-angular-component-pillbox.mjs +1283 -607
  56. package/fesm2022/ojiepermana-angular-component-popover.mjs +291 -204
  57. package/fesm2022/ojiepermana-angular-component-progress.mjs +176 -53
  58. package/fesm2022/ojiepermana-angular-component-radio.mjs +449 -142
  59. package/fesm2022/ojiepermana-angular-component-resizable.mjs +659 -453
  60. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +117 -39
  61. package/fesm2022/ojiepermana-angular-component-segmented-control.mjs +351 -172
  62. package/fesm2022/ojiepermana-angular-component-select.mjs +475 -345
  63. package/fesm2022/ojiepermana-angular-component-separator.mjs +102 -35
  64. package/fesm2022/ojiepermana-angular-component-sheet.mjs +797 -347
  65. package/fesm2022/ojiepermana-angular-component-skeleton.mjs +62 -29
  66. package/fesm2022/ojiepermana-angular-component-slider.mjs +592 -376
  67. package/fesm2022/ojiepermana-angular-component-spinner.mjs +135 -38
  68. package/fesm2022/ojiepermana-angular-component-switch.mjs +315 -103
  69. package/fesm2022/ojiepermana-angular-component-table.mjs +440 -153
  70. package/fesm2022/ojiepermana-angular-component-tabs.mjs +590 -317
  71. package/fesm2022/ojiepermana-angular-component-textarea.mjs +85 -50
  72. package/fesm2022/ojiepermana-angular-component-timeline.mjs +609 -231
  73. package/fesm2022/ojiepermana-angular-component-toast.mjs +229 -243
  74. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +573 -288
  75. package/fesm2022/ojiepermana-angular-component-toggle.mjs +187 -78
  76. package/fesm2022/ojiepermana-angular-component-tooltip.mjs +798 -517
  77. package/fesm2022/ojiepermana-angular-component-utils-core.mjs +159 -292
  78. package/fesm2022/ojiepermana-angular-component-utils-overlay.mjs +46 -58
  79. package/fesm2022/ojiepermana-angular-component-utils-scale.mjs +76 -38
  80. package/fesm2022/ojiepermana-angular-component-utils.mjs +2 -8
  81. package/fesm2022/ojiepermana-angular-component.mjs +0 -10
  82. package/fesm2022/ojiepermana-angular-navigation-core.mjs +13 -23
  83. package/fesm2022/ojiepermana-angular-navigation-icon.mjs +35 -24
  84. package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-BKCeWzml.mjs +129 -0
  85. package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-DFEJK2jD.mjs +811 -0
  86. package/fesm2022/{ojiepermana-angular-navigation-navigation-entry-grid.component-Cd-jh6tg.mjs → ojiepermana-angular-navigation-navigation-entry-grid.component-mpK9Ar08.mjs} +387 -183
  87. package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-BPgH7FJk.mjs +650 -0
  88. package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-DMpYcD9t.mjs +662 -0
  89. package/fesm2022/ojiepermana-angular-navigation-navigation-item.component-Basp5SIk.mjs +1228 -0
  90. package/fesm2022/ojiepermana-angular-navigation-navigation-list.component-YUzHI9Pj.mjs +311 -0
  91. package/fesm2022/ojiepermana-angular-navigation-service.mjs +542 -724
  92. package/fesm2022/ojiepermana-angular-navigation-types.mjs +27 -56
  93. package/fesm2022/ojiepermana-angular-navigation.mjs +3052 -4
  94. package/fesm2022/ojiepermana-angular-sdk.mjs +91 -201
  95. package/fesm2022/ojiepermana-angular-theme-component-settings.mjs +1115 -737
  96. package/fesm2022/ojiepermana-angular-theme-layout-services.mjs +245 -328
  97. package/fesm2022/ojiepermana-angular-theme-layout-types.mjs +35 -38
  98. package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +1719 -552
  99. package/fesm2022/ojiepermana-angular-theme-layout.mjs +847 -491
  100. package/fesm2022/ojiepermana-angular-theme-page-core.mjs +288 -358
  101. package/fesm2022/ojiepermana-angular-theme-page-filter.mjs +362 -224
  102. package/fesm2022/ojiepermana-angular-theme-page-overview.mjs +88 -0
  103. package/fesm2022/ojiepermana-angular-theme-page-root.mjs +576 -254
  104. package/fesm2022/ojiepermana-angular-theme-page-side.mjs +317 -177
  105. package/fesm2022/ojiepermana-angular-theme-page-slots.mjs +256 -112
  106. package/fesm2022/ojiepermana-angular-theme-page.mjs +7 -12
  107. package/fesm2022/ojiepermana-angular-theme-shell-services.mjs +215 -326
  108. package/fesm2022/ojiepermana-angular-theme-shell-types.mjs +68 -129
  109. package/fesm2022/ojiepermana-angular-theme-shell.mjs +907 -378
  110. package/fesm2022/ojiepermana-angular-theme-styles.mjs +521 -720
  111. package/fesm2022/ojiepermana-angular-theme.mjs +0 -10
  112. package/fesm2022/ojiepermana-angular.mjs +5 -24
  113. package/navigation/README.md +1 -1
  114. package/package.json +16 -12
  115. package/sdk/README.md +1 -1
  116. package/sdk/src/writer/index.js +2 -2
  117. package/theme/README.md +1 -1
  118. package/theme/layout/README.md +2 -4
  119. package/theme/page/README.md +50 -0
  120. package/theme/styles/README.md +10 -10
  121. package/theme/styles/css/base/prefers-dark.css +1 -1
  122. package/theme/styles/css/base/status.css +1 -1
  123. package/theme/styles/css/color/amber.css +1 -1
  124. package/theme/styles/css/color/blue.css +1 -1
  125. package/theme/styles/css/color/cyan.css +1 -1
  126. package/theme/styles/css/color/emerald.css +1 -1
  127. package/theme/styles/css/color/fuchsia.css +1 -1
  128. package/theme/styles/css/color/green.css +1 -1
  129. package/theme/styles/css/color/indigo.css +1 -1
  130. package/theme/styles/css/color/lime.css +1 -1
  131. package/theme/styles/css/color/orange.css +1 -1
  132. package/theme/styles/css/color/pink.css +1 -1
  133. package/theme/styles/css/color/purple.css +1 -1
  134. package/theme/styles/css/color/red.css +1 -1
  135. package/theme/styles/css/color/rose.css +1 -1
  136. package/theme/styles/css/color/sky.css +1 -1
  137. package/theme/styles/css/color/teal.css +1 -1
  138. package/theme/styles/css/color/violet.css +1 -1
  139. package/theme/styles/css/color/yellow.css +1 -1
  140. package/theme/styles/css/neutral/gray.css +1 -1
  141. package/theme/styles/css/neutral/mauve.css +1 -1
  142. package/theme/styles/css/neutral/mist.css +1 -1
  143. package/theme/styles/css/neutral/neutral.css +1 -1
  144. package/theme/styles/css/neutral/olive.css +1 -1
  145. package/theme/styles/css/neutral/slate.css +1 -1
  146. package/theme/styles/css/neutral/stone.css +1 -1
  147. package/theme/styles/css/neutral/taupe.css +1 -1
  148. package/theme/styles/css/neutral/zinc.css +1 -1
  149. package/types/ojiepermana-angular-chart-area.d.ts +126 -63
  150. package/types/ojiepermana-angular-chart-bar.d.ts +244 -154
  151. package/types/ojiepermana-angular-chart-core.d.ts +409 -398
  152. package/types/ojiepermana-angular-chart-line.d.ts +141 -68
  153. package/types/ojiepermana-angular-chart-pie.d.ts +192 -121
  154. package/types/ojiepermana-angular-chart-primitives.d.ts +283 -214
  155. package/types/ojiepermana-angular-chart-radar.d.ts +189 -108
  156. package/types/ojiepermana-angular-chart-radial.d.ts +177 -106
  157. package/types/ojiepermana-angular-chart-scatter.d.ts +166 -110
  158. package/types/ojiepermana-angular-chart.d.ts +3 -2
  159. package/types/ojiepermana-angular-component-accordion.d.ts +135 -81
  160. package/types/ojiepermana-angular-component-alert-dialog.d.ts +271 -123
  161. package/types/ojiepermana-angular-component-alert.d.ts +69 -39
  162. package/types/ojiepermana-angular-component-aspect-ratio.d.ts +20 -12
  163. package/types/ojiepermana-angular-component-avatar.d.ts +103 -49
  164. package/types/ojiepermana-angular-component-badge.d.ts +36 -24
  165. package/types/ojiepermana-angular-component-breadcrumb.d.ts +79 -40
  166. package/types/ojiepermana-angular-component-button-group.d.ts +48 -24
  167. package/types/ojiepermana-angular-component-button.d.ts +44 -27
  168. package/types/ojiepermana-angular-component-calendar.d.ts +145 -107
  169. package/types/ojiepermana-angular-component-card.d.ts +112 -63
  170. package/types/ojiepermana-angular-component-carousel.d.ts +150 -81
  171. package/types/ojiepermana-angular-component-checkbox.d.ts +96 -38
  172. package/types/ojiepermana-angular-component-collapsible.d.ts +65 -39
  173. package/types/ojiepermana-angular-component-combobox.d.ts +100 -55
  174. package/types/ojiepermana-angular-component-command.d.ts +206 -121
  175. package/types/ojiepermana-angular-component-composer.d.ts +184 -84
  176. package/types/ojiepermana-angular-component-context-menu.d.ts +51 -41
  177. package/types/ojiepermana-angular-component-date-picker.d.ts +199 -109
  178. package/types/ojiepermana-angular-component-dialog.d.ts +200 -105
  179. package/types/ojiepermana-angular-component-drawer.d.ts +2 -1
  180. package/types/ojiepermana-angular-component-dropdown-menu.d.ts +324 -202
  181. package/types/ojiepermana-angular-component-editor.d.ts +215 -117
  182. package/types/ojiepermana-angular-component-empty.d.ts +80 -45
  183. package/types/ojiepermana-angular-component-form.d.ts +185 -121
  184. package/types/ojiepermana-angular-component-hover-card.d.ts +130 -72
  185. package/types/ojiepermana-angular-component-icon.d.ts +87 -57
  186. package/types/ojiepermana-angular-component-input-group.d.ts +93 -46
  187. package/types/ojiepermana-angular-component-input-otp.d.ts +243 -150
  188. package/types/ojiepermana-angular-component-input.d.ts +27 -17
  189. package/types/ojiepermana-angular-component-item.d.ts +160 -84
  190. package/types/ojiepermana-angular-component-kanban.d.ts +157 -62
  191. package/types/ojiepermana-angular-component-kbd.d.ts +24 -15
  192. package/types/ojiepermana-angular-component-label.d.ts +19 -11
  193. package/types/ojiepermana-angular-component-menubar.d.ts +120 -90
  194. package/types/ojiepermana-angular-component-native-select.d.ts +37 -24
  195. package/types/ojiepermana-angular-component-navigation-menu.d.ts +157 -98
  196. package/types/ojiepermana-angular-component-pagination.d.ts +78 -28
  197. package/types/ojiepermana-angular-component-pillbox.d.ts +361 -204
  198. package/types/ojiepermana-angular-component-popover.d.ts +94 -64
  199. package/types/ojiepermana-angular-component-progress.d.ts +45 -17
  200. package/types/ojiepermana-angular-component-radio.d.ts +129 -53
  201. package/types/ojiepermana-angular-component-resizable.d.ts +160 -112
  202. package/types/ojiepermana-angular-component-scroll-area.d.ts +33 -15
  203. package/types/ojiepermana-angular-component-segmented-control.d.ts +94 -50
  204. package/types/ojiepermana-angular-component-select.d.ts +94 -77
  205. package/types/ojiepermana-angular-component-separator.d.ts +26 -14
  206. package/types/ojiepermana-angular-component-sheet.d.ts +226 -116
  207. package/types/ojiepermana-angular-component-skeleton.d.ts +13 -10
  208. package/types/ojiepermana-angular-component-slider.d.ts +140 -75
  209. package/types/ojiepermana-angular-component-spinner.d.ts +31 -13
  210. package/types/ojiepermana-angular-component-switch.d.ts +97 -40
  211. package/types/ojiepermana-angular-component-table.d.ts +102 -50
  212. package/types/ojiepermana-angular-component-tabs.d.ts +174 -115
  213. package/types/ojiepermana-angular-component-textarea.d.ts +27 -17
  214. package/types/ojiepermana-angular-component-timeline.d.ts +141 -59
  215. package/types/ojiepermana-angular-component-toast.d.ts +51 -55
  216. package/types/ojiepermana-angular-component-toggle-group.d.ts +159 -88
  217. package/types/ojiepermana-angular-component-toggle.d.ts +47 -25
  218. package/types/ojiepermana-angular-component-tooltip.d.ts +222 -132
  219. package/types/ojiepermana-angular-component-utils-core.d.ts +81 -90
  220. package/types/ojiepermana-angular-component-utils-overlay.d.ts +7 -11
  221. package/types/ojiepermana-angular-component-utils-scale.d.ts +20 -12
  222. package/types/ojiepermana-angular-component-utils.d.ts +2 -2
  223. package/types/ojiepermana-angular-component.d.ts +1 -2
  224. package/types/ojiepermana-angular-navigation-core.d.ts +46 -50
  225. package/types/ojiepermana-angular-navigation-icon.d.ts +9 -12
  226. package/types/ojiepermana-angular-navigation-service.d.ts +112 -115
  227. package/types/ojiepermana-angular-navigation-types.d.ts +121 -125
  228. package/types/ojiepermana-angular-navigation.d.ts +663 -374
  229. package/types/ojiepermana-angular-sdk.d.ts +69 -71
  230. package/types/ojiepermana-angular-theme-component-settings.d.ts +115 -83
  231. package/types/ojiepermana-angular-theme-layout-services.d.ts +119 -124
  232. package/types/ojiepermana-angular-theme-layout-types.d.ts +27 -31
  233. package/types/ojiepermana-angular-theme-layout-wrapper.d.ts +399 -187
  234. package/types/ojiepermana-angular-theme-layout.d.ts +201 -112
  235. package/types/ojiepermana-angular-theme-page-core.d.ts +136 -142
  236. package/types/ojiepermana-angular-theme-page-filter.d.ts +112 -62
  237. package/types/ojiepermana-angular-theme-page-overview.d.ts +28 -0
  238. package/types/ojiepermana-angular-theme-page-root.d.ts +172 -88
  239. package/types/ojiepermana-angular-theme-page-side.d.ts +89 -49
  240. package/types/ojiepermana-angular-theme-page-slots.d.ts +58 -37
  241. package/types/ojiepermana-angular-theme-page.d.ts +7 -5
  242. package/types/ojiepermana-angular-theme-shell-services.d.ts +119 -125
  243. package/types/ojiepermana-angular-theme-shell-types.d.ts +38 -41
  244. package/types/ojiepermana-angular-theme-shell.d.ts +139 -61
  245. package/types/ojiepermana-angular-theme-styles.d.ts +184 -196
  246. package/types/ojiepermana-angular-theme.d.ts +1 -2
  247. package/types/ojiepermana-angular.d.ts +5 -5
  248. package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-CDBxQ8rk.mjs +0 -91
  249. package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-DBQHdvGa.mjs +0 -512
  250. package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-BCGvhoYj.mjs +0 -404
  251. package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-Dk_03e-6.mjs +0 -466
  252. package/fesm2022/ojiepermana-angular-navigation-ojiepermana-angular-navigation-DNKU6viC.mjs +0 -2642
@@ -1,294 +1,579 @@
1
- import * as i0 from '@angular/core';
2
- import { Directive, input, model, numberAttribute, inject, ElementRef, signal, computed, forwardRef, Component } from '@angular/core';
3
- import { toggleVariants } from '@ojiepermana/angular/component/toggle';
4
- import { cn } from '@ojiepermana/angular/component/utils/core';
5
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, Directive, ElementRef, computed, forwardRef, inject, input, model, numberAttribute, signal } from "@angular/core";
3
+ import { toggleVariants } from "@ojiepermana/angular/component/toggle";
4
+ import { cn } from "@ojiepermana/angular/component/utils/core";
6
5
  const spacingClasses = {
7
- 0: '',
8
- 1: 'gap-1',
9
- 2: 'gap-2',
10
- 3: 'gap-3',
11
- 4: 'gap-4',
6
+ 0: "",
7
+ 1: "gap-1",
8
+ 2: "gap-2",
9
+ 3: "gap-3",
10
+ 4: "gap-4"
12
11
  };
13
12
  const connectedItemClasses = {
14
- horizontal: [
15
- '[&>[data-slot=toggle-group-item]:not(:first-child)]:rounded-s-none',
16
- '[&>[data-slot=toggle-group-item]:not(:first-child)]:[border-inline-start-width:0]',
17
- '[&>[data-slot=toggle-group-item]:not(:last-child)]:rounded-e-none',
18
- ].join(' '),
19
- vertical: [
20
- '[&>[data-slot=toggle-group-item]:not(:first-child)]:rounded-t-none',
21
- '[&>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0',
22
- '[&>[data-slot=toggle-group-item]:not(:last-child)]:rounded-b-none',
23
- ].join(' '),
13
+ horizontal: [
14
+ "[&>[data-slot=toggle-group-item]:not(:first-child)]:rounded-s-none",
15
+ "[&>[data-slot=toggle-group-item]:not(:first-child)]:[border-inline-start-width:0]",
16
+ "[&>[data-slot=toggle-group-item]:not(:last-child)]:rounded-e-none"
17
+ ].join(" "),
18
+ vertical: [
19
+ "[&>[data-slot=toggle-group-item]:not(:first-child)]:rounded-t-none",
20
+ "[&>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0",
21
+ "[&>[data-slot=toggle-group-item]:not(:last-child)]:rounded-b-none"
22
+ ].join(" ")
24
23
  };
25
- class ToggleGroupContextBase {
26
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToggleGroupContextBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
27
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: ToggleGroupContextBase, isStandalone: true, ngImport: i0 });
28
- }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToggleGroupContextBase, decorators: [{
30
- type: Directive
31
- }] });
32
- class ToggleGroupComponent extends ToggleGroupContextBase {
33
- type = input.required(/* @ts-ignore */
34
- ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
35
- value = model(null, /* @ts-ignore */
36
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
37
- values = model([], /* @ts-ignore */
38
- ...(ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []));
39
- orientation = input('horizontal', /* @ts-ignore */
40
- ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
41
- variant = input('default', /* @ts-ignore */
42
- ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
43
- size = input('default', /* @ts-ignore */
44
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
45
- spacing = input(2, { ...(ngDevMode ? { debugName: "spacing" } : /* istanbul ignore next */ {}), transform: numberAttribute });
46
- loop = input(true, /* @ts-ignore */
47
- ...(ngDevMode ? [{ debugName: "loop" }] : /* istanbul ignore next */ []));
48
- disabled = input(false, /* @ts-ignore */
49
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
50
- dir = input(null, /* @ts-ignore */
51
- ...(ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []));
52
- class = input('', /* @ts-ignore */
53
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
54
- host = inject(ElementRef);
55
- focusedValue = signal(null, /* @ts-ignore */
56
- ...(ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []));
57
- registrationVersion = signal(0, /* @ts-ignore */
58
- ...(ngDevMode ? [{ debugName: "registrationVersion" }] : /* istanbul ignore next */ []));
59
- items = new Map();
60
- resolvedSpacing = computed(() => normalizeSpacing(this.spacing()), /* @ts-ignore */
61
- ...(ngDevMode ? [{ debugName: "resolvedSpacing" }] : /* istanbul ignore next */ []));
62
- tabStopValue = computed(() => {
63
- this.registrationVersion();
64
- const enabledItems = this.enabledItems();
65
- if (enabledItems.length === 0)
66
- return null;
67
- const current = this.focusedValue();
68
- if (current && enabledItems.some((item) => item.value() === current)) {
69
- return current;
70
- }
71
- const selected = enabledItems.find((item) => this.isSelected(item.value()));
72
- return selected?.value() ?? enabledItems[0].value();
73
- }, /* @ts-ignore */
74
- ...(ngDevMode ? [{ debugName: "tabStopValue" }] : /* istanbul ignore next */ []));
75
- classes = computed(() => cn('inline-flex w-fit', this.orientation() === 'vertical' ? 'flex-col items-stretch' : 'items-center', spacingClasses[this.resolvedSpacing()], this.resolvedSpacing() === 0 && connectedItemClasses[this.orientation()], this.class()), /* @ts-ignore */
76
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
77
- groupType() {
78
- return this.type();
79
- }
80
- groupOrientation() {
81
- return this.orientation();
82
- }
83
- groupVariant() {
84
- return this.variant();
85
- }
86
- groupSize() {
87
- return this.size();
88
- }
89
- groupDisabled() {
90
- return this.disabled();
91
- }
92
- isRtl() {
93
- const explicitDir = this.dir();
94
- if (explicitDir)
95
- return explicitDir === 'rtl';
96
- const host = this.host.nativeElement;
97
- const nearestDir = host.closest('[dir]')?.getAttribute('dir');
98
- if (nearestDir === 'rtl' || nearestDir === 'ltr') {
99
- return nearestDir === 'rtl';
100
- }
101
- return getComputedStyle(host).direction === 'rtl';
102
- }
103
- register(element, value, disabled) {
104
- this.items.set(element, { element, value, disabled });
105
- this.bumpRegistrationVersion();
106
- }
107
- unregister(element) {
108
- this.items.delete(element);
109
- this.bumpRegistrationVersion();
110
- }
111
- isSelected(value) {
112
- return this.type() === 'multiple' ? this.values().includes(value) : this.value() === value;
113
- }
114
- toggle(value) {
115
- const item = this.itemForValue(value);
116
- if (!item || this.disabled() || item.disabled())
117
- return;
118
- this.focusedValue.set(value);
119
- if (this.type() === 'multiple') {
120
- this.values.update((current) => current.includes(value)
121
- ? current.filter((itemValue) => itemValue !== value)
122
- : [...current, value]);
123
- return;
124
- }
125
- this.value.set(this.value() === value ? null : value);
126
- }
127
- tabindexFor(value, disabled) {
128
- if (this.disabled() || disabled)
129
- return -1;
130
- return this.tabStopValue() === value ? 0 : -1;
131
- }
132
- markFocused(value) {
133
- const item = this.itemForValue(value);
134
- if (!item || this.disabled() || item.disabled())
135
- return;
136
- this.focusedValue.set(value);
137
- }
138
- focusNext(from, offset) {
139
- const enabledItems = this.enabledItems();
140
- const currentIndex = enabledItems.findIndex((item) => item.element === from);
141
- if (currentIndex < 0 || enabledItems.length === 0)
142
- return;
143
- let nextIndex = currentIndex + offset;
144
- if (this.loop()) {
145
- nextIndex = (nextIndex + enabledItems.length) % enabledItems.length;
146
- }
147
- else if (nextIndex < 0 || nextIndex >= enabledItems.length) {
148
- return;
149
- }
150
- const next = enabledItems[nextIndex];
151
- this.focusedValue.set(next.value());
152
- next.element.focus();
153
- }
154
- focusFirst() {
155
- const first = this.enabledItems()[0];
156
- if (!first)
157
- return;
158
- this.focusedValue.set(first.value());
159
- first.element.focus();
160
- }
161
- focusLast() {
162
- const enabledItems = this.enabledItems();
163
- const last = enabledItems[enabledItems.length - 1];
164
- if (!last)
165
- return;
166
- this.focusedValue.set(last.value());
167
- last.element.focus();
168
- }
169
- enabledItems() {
170
- return [...this.items.values()].filter((item) => !item.disabled());
171
- }
172
- itemForValue(value) {
173
- return [...this.items.values()].find((item) => item.value() === value);
174
- }
175
- bumpRegistrationVersion() {
176
- this.registrationVersion.update((version) => version + 1);
177
- }
178
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToggleGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
179
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: ToggleGroupComponent, isStandalone: true, selector: "ToggleGroup", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, spacing: { classPropertyName: "spacing", publicName: "spacing", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", values: "valuesChange" }, host: { properties: { "class": "classes()", "attr.role": "\"group\"", "attr.dir": "dir() ?? null", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-orientation": "orientation()", "attr.data-slot": "\"toggle-group\"", "attr.data-type": "type()" } }, providers: [
180
- { provide: ToggleGroupContextBase, useExisting: forwardRef(() => ToggleGroupComponent) },
181
- ], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true });
182
- }
183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToggleGroupComponent, decorators: [{
184
- type: Component,
185
- args: [{
186
- selector: 'ToggleGroup',
187
- providers: [
188
- { provide: ToggleGroupContextBase, useExisting: forwardRef(() => ToggleGroupComponent) },
189
- ],
190
- host: {
191
- '[class]': 'classes()',
192
- '[attr.role]': '"group"',
193
- '[attr.dir]': 'dir() ?? null',
194
- // aria-orientation is not allowed on role="group" (axe aria-allowed-attr);
195
- // data-orientation below drives the visual layout instead.
196
- '[attr.data-disabled]': 'disabled() ? "" : null',
197
- '[attr.data-orientation]': 'orientation()',
198
- '[attr.data-slot]': '"toggle-group"',
199
- '[attr.data-type]': 'type()',
200
- },
201
- template: `<ng-content />`,
202
- }]
203
- }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], spacing: [{ type: i0.Input, args: [{ isSignal: true, alias: "spacing", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
204
- class ToggleGroupItemDirective {
205
- ctx = inject(ToggleGroupContextBase);
206
- element = inject(ElementRef);
207
- value = input.required(/* @ts-ignore */
208
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
209
- disabled = input(false, /* @ts-ignore */
210
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
211
- class = input('', /* @ts-ignore */
212
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
213
- selected = computed(() => this.ctx.isSelected(this.value()), /* @ts-ignore */
214
- ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
215
- classes = computed(() => cn(toggleVariants({ variant: this.ctx.groupVariant(), size: this.ctx.groupSize() }), this.class()), /* @ts-ignore */
216
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
217
- ngOnInit() {
218
- this.ctx.register(this.element.nativeElement, this.value, this.disabled);
219
- }
220
- ngOnDestroy() {
221
- this.ctx.unregister(this.element.nativeElement);
222
- }
223
- isDisabled() {
224
- return this.ctx.groupDisabled() || this.disabled();
225
- }
226
- onClick() {
227
- if (this.isDisabled())
228
- return;
229
- this.ctx.toggle(this.value());
230
- }
231
- onFocus() {
232
- if (this.isDisabled())
233
- return;
234
- this.ctx.markFocused(this.value());
235
- }
236
- onArrow(event, offset) {
237
- event.preventDefault();
238
- this.ctx.focusNext(this.element.nativeElement, offset);
239
- }
240
- onHorizontalArrow(event, offset) {
241
- event.preventDefault();
242
- this.ctx.focusNext(this.element.nativeElement, this.ctx.isRtl() ? offset * -1 : offset);
243
- }
244
- onHome(event) {
245
- event.preventDefault();
246
- this.ctx.focusFirst();
247
- }
248
- onEnd(event) {
249
- event.preventDefault();
250
- this.ctx.focusLast();
251
- }
252
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToggleGroupItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
253
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: ToggleGroupItemDirective, isStandalone: true, selector: "button[ToggleGroupItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "onClick()", "focus": "onFocus()", "keydown.arrowDown": "onArrow($any($event), 1)", "keydown.arrowLeft": "onHorizontalArrow($any($event), -1)", "keydown.arrowRight": "onHorizontalArrow($any($event), 1)", "keydown.arrowUp": "onArrow($any($event), -1)", "keydown.end": "onEnd($any($event))", "keydown.home": "onHome($any($event))" }, properties: { "class": "classes()", "attr.aria-disabled": "isDisabled() ? \"true\" : null", "attr.aria-pressed": "selected()", "attr.data-disabled": "isDisabled() ? \"\" : null", "attr.data-orientation": "ctx.groupOrientation()", "attr.data-size": "ctx.groupSize()", "attr.data-slot": "\"toggle-group-item\"", "attr.data-state": "selected() ? \"on\" : \"off\"", "attr.data-variant": "ctx.groupVariant()", "attr.tabindex": "ctx.tabindexFor(value(), isDisabled())", "disabled": "isDisabled() || null" } }, ngImport: i0 });
254
- }
255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ToggleGroupItemDirective, decorators: [{
256
- type: Directive,
257
- args: [{
258
- selector: 'button[ToggleGroupItem]',
259
- host: {
260
- '[class]': 'classes()',
261
- type: 'button',
262
- '[attr.aria-disabled]': 'isDisabled() ? "true" : null',
263
- '[attr.aria-pressed]': 'selected()',
264
- '[attr.data-disabled]': 'isDisabled() ? "" : null',
265
- '[attr.data-orientation]': 'ctx.groupOrientation()',
266
- '[attr.data-size]': 'ctx.groupSize()',
267
- '[attr.data-slot]': '"toggle-group-item"',
268
- '[attr.data-state]': 'selected() ? "on" : "off"',
269
- '[attr.data-variant]': 'ctx.groupVariant()',
270
- '[attr.tabindex]': 'ctx.tabindexFor(value(), isDisabled())',
271
- '[disabled]': 'isDisabled() || null',
272
- '(click)': 'onClick()',
273
- '(focus)': 'onFocus()',
274
- '(keydown.arrowDown)': 'onArrow($any($event), 1)',
275
- '(keydown.arrowLeft)': 'onHorizontalArrow($any($event), -1)',
276
- '(keydown.arrowRight)': 'onHorizontalArrow($any($event), 1)',
277
- '(keydown.arrowUp)': 'onArrow($any($event), -1)',
278
- '(keydown.end)': 'onEnd($any($event))',
279
- '(keydown.home)': 'onHome($any($event))',
280
- },
281
- }]
282
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
24
+ var ToggleGroupContextBase = class ToggleGroupContextBase {
25
+ static ɵfac = i0.ɵɵngDeclareFactory({
26
+ minVersion: "12.0.0",
27
+ version: "22.2.0",
28
+ ngImport: i0,
29
+ type: ToggleGroupContextBase,
30
+ deps: [],
31
+ target: i0.ɵɵFactoryTarget.Directive
32
+ });
33
+ static ɵdir = i0.ɵɵngDeclareDirective({
34
+ minVersion: "14.0.0",
35
+ version: "22.2.0",
36
+ type: ToggleGroupContextBase,
37
+ isStandalone: true,
38
+ ngImport: i0
39
+ });
40
+ };
41
+ i0.ɵɵngDeclareClassMetadata({
42
+ minVersion: "12.0.0",
43
+ version: "22.2.0",
44
+ ngImport: i0,
45
+ type: ToggleGroupContextBase,
46
+ decorators: [{ type: Directive }]
47
+ });
48
+ var ToggleGroupComponent = class ToggleGroupComponent extends ToggleGroupContextBase {
49
+ type = input.required(...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
50
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
51
+ values = model([], ...ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []);
52
+ orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
53
+ variant = input("default", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
54
+ size = input("default", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
55
+ spacing = input(2, {
56
+ ...ngDevMode ? { debugName: "spacing" } : /* istanbul ignore next */ {},
57
+ transform: numberAttribute
58
+ });
59
+ loop = input(true, ...ngDevMode ? [{ debugName: "loop" }] : /* istanbul ignore next */ []);
60
+ disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
61
+ dir = input(null, ...ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []);
62
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
63
+ host = inject(ElementRef);
64
+ focusedValue = signal(null, ...ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []);
65
+ registrationVersion = signal(0, ...ngDevMode ? [{ debugName: "registrationVersion" }] : /* istanbul ignore next */ []);
66
+ items = /* @__PURE__ */ new Map();
67
+ resolvedSpacing = computed(() => normalizeSpacing(this.spacing()), ...ngDevMode ? [{ debugName: "resolvedSpacing" }] : /* istanbul ignore next */ []);
68
+ tabStopValue = computed(() => {
69
+ this.registrationVersion();
70
+ const enabledItems = this.enabledItems();
71
+ if (enabledItems.length === 0) return null;
72
+ const current = this.focusedValue();
73
+ if (current && enabledItems.some((item) => item.value() === current)) return current;
74
+ return enabledItems.find((item) => this.isSelected(item.value()))?.value() ?? enabledItems[0].value();
75
+ }, ...ngDevMode ? [{ debugName: "tabStopValue" }] : /* istanbul ignore next */ []);
76
+ classes = computed(() => cn("inline-flex w-fit", this.orientation() === "vertical" ? "flex-col items-stretch" : "items-center", spacingClasses[this.resolvedSpacing()], this.resolvedSpacing() === 0 && connectedItemClasses[this.orientation()], this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
77
+ groupType() {
78
+ return this.type();
79
+ }
80
+ groupOrientation() {
81
+ return this.orientation();
82
+ }
83
+ groupVariant() {
84
+ return this.variant();
85
+ }
86
+ groupSize() {
87
+ return this.size();
88
+ }
89
+ groupDisabled() {
90
+ return this.disabled();
91
+ }
92
+ isRtl() {
93
+ const explicitDir = this.dir();
94
+ if (explicitDir) return explicitDir === "rtl";
95
+ const host = this.host.nativeElement;
96
+ const nearestDir = host.closest("[dir]")?.getAttribute("dir");
97
+ if (nearestDir === "rtl" || nearestDir === "ltr") return nearestDir === "rtl";
98
+ return getComputedStyle(host).direction === "rtl";
99
+ }
100
+ register(element, value, disabled) {
101
+ this.items.set(element, {
102
+ element,
103
+ value,
104
+ disabled
105
+ });
106
+ this.bumpRegistrationVersion();
107
+ }
108
+ unregister(element) {
109
+ this.items.delete(element);
110
+ this.bumpRegistrationVersion();
111
+ }
112
+ isSelected(value) {
113
+ return this.type() === "multiple" ? this.values().includes(value) : this.value() === value;
114
+ }
115
+ toggle(value) {
116
+ const item = this.itemForValue(value);
117
+ if (!item || this.disabled() || item.disabled()) return;
118
+ this.focusedValue.set(value);
119
+ if (this.type() === "multiple") {
120
+ this.values.update((current) => current.includes(value) ? current.filter((itemValue) => itemValue !== value) : [...current, value]);
121
+ return;
122
+ }
123
+ this.value.set(this.value() === value ? null : value);
124
+ }
125
+ tabindexFor(value, disabled) {
126
+ if (this.disabled() || disabled) return -1;
127
+ return this.tabStopValue() === value ? 0 : -1;
128
+ }
129
+ markFocused(value) {
130
+ const item = this.itemForValue(value);
131
+ if (!item || this.disabled() || item.disabled()) return;
132
+ this.focusedValue.set(value);
133
+ }
134
+ focusNext(from, offset) {
135
+ const enabledItems = this.enabledItems();
136
+ const currentIndex = enabledItems.findIndex((item) => item.element === from);
137
+ if (currentIndex < 0 || enabledItems.length === 0) return;
138
+ let nextIndex = currentIndex + offset;
139
+ if (this.loop()) nextIndex = (nextIndex + enabledItems.length) % enabledItems.length;
140
+ else if (nextIndex < 0 || nextIndex >= enabledItems.length) return;
141
+ const next = enabledItems[nextIndex];
142
+ this.focusedValue.set(next.value());
143
+ next.element.focus();
144
+ }
145
+ focusFirst() {
146
+ const first = this.enabledItems()[0];
147
+ if (!first) return;
148
+ this.focusedValue.set(first.value());
149
+ first.element.focus();
150
+ }
151
+ focusLast() {
152
+ const enabledItems = this.enabledItems();
153
+ const last = enabledItems[enabledItems.length - 1];
154
+ if (!last) return;
155
+ this.focusedValue.set(last.value());
156
+ last.element.focus();
157
+ }
158
+ enabledItems() {
159
+ return [...this.items.values()].filter((item) => !item.disabled());
160
+ }
161
+ itemForValue(value) {
162
+ return [...this.items.values()].find((item) => item.value() === value);
163
+ }
164
+ bumpRegistrationVersion() {
165
+ this.registrationVersion.update((version) => version + 1);
166
+ }
167
+ static ɵfac = i0.ɵɵngDeclareFactory({
168
+ minVersion: "12.0.0",
169
+ version: "22.2.0",
170
+ ngImport: i0,
171
+ type: ToggleGroupComponent,
172
+ deps: null,
173
+ target: i0.ɵɵFactoryTarget.Component
174
+ });
175
+ static ɵcmp = i0.ɵɵngDeclareComponent({
176
+ minVersion: "17.1.0",
177
+ version: "22.2.0",
178
+ type: ToggleGroupComponent,
179
+ isStandalone: true,
180
+ selector: "ToggleGroup",
181
+ inputs: {
182
+ type: {
183
+ classPropertyName: "type",
184
+ publicName: "type",
185
+ isSignal: true,
186
+ isRequired: true,
187
+ transformFunction: null
188
+ },
189
+ value: {
190
+ classPropertyName: "value",
191
+ publicName: "value",
192
+ isSignal: true,
193
+ isRequired: false,
194
+ transformFunction: null
195
+ },
196
+ values: {
197
+ classPropertyName: "values",
198
+ publicName: "values",
199
+ isSignal: true,
200
+ isRequired: false,
201
+ transformFunction: null
202
+ },
203
+ orientation: {
204
+ classPropertyName: "orientation",
205
+ publicName: "orientation",
206
+ isSignal: true,
207
+ isRequired: false,
208
+ transformFunction: null
209
+ },
210
+ variant: {
211
+ classPropertyName: "variant",
212
+ publicName: "variant",
213
+ isSignal: true,
214
+ isRequired: false,
215
+ transformFunction: null
216
+ },
217
+ size: {
218
+ classPropertyName: "size",
219
+ publicName: "size",
220
+ isSignal: true,
221
+ isRequired: false,
222
+ transformFunction: null
223
+ },
224
+ spacing: {
225
+ classPropertyName: "spacing",
226
+ publicName: "spacing",
227
+ isSignal: true,
228
+ isRequired: false,
229
+ transformFunction: null
230
+ },
231
+ loop: {
232
+ classPropertyName: "loop",
233
+ publicName: "loop",
234
+ isSignal: true,
235
+ isRequired: false,
236
+ transformFunction: null
237
+ },
238
+ disabled: {
239
+ classPropertyName: "disabled",
240
+ publicName: "disabled",
241
+ isSignal: true,
242
+ isRequired: false,
243
+ transformFunction: null
244
+ },
245
+ dir: {
246
+ classPropertyName: "dir",
247
+ publicName: "dir",
248
+ isSignal: true,
249
+ isRequired: false,
250
+ transformFunction: null
251
+ },
252
+ class: {
253
+ classPropertyName: "class",
254
+ publicName: "class",
255
+ isSignal: true,
256
+ isRequired: false,
257
+ transformFunction: null
258
+ }
259
+ },
260
+ outputs: {
261
+ value: "valueChange",
262
+ values: "valuesChange"
263
+ },
264
+ host: { properties: {
265
+ "class": "classes()",
266
+ "attr.role": "\"group\"",
267
+ "attr.dir": "dir() ?? null",
268
+ "attr.data-disabled": "disabled() ? \"\" : null",
269
+ "attr.data-orientation": "orientation()",
270
+ "attr.data-slot": "\"toggle-group\"",
271
+ "attr.data-type": "type()"
272
+ } },
273
+ providers: [{
274
+ provide: ToggleGroupContextBase,
275
+ useExisting: forwardRef(() => ToggleGroupComponent)
276
+ }],
277
+ usesInheritance: true,
278
+ ngImport: i0,
279
+ template: `<ng-content />`,
280
+ isInline: true
281
+ });
282
+ };
283
+ i0.ɵɵngDeclareClassMetadata({
284
+ minVersion: "12.0.0",
285
+ version: "22.2.0",
286
+ ngImport: i0,
287
+ type: ToggleGroupComponent,
288
+ decorators: [{
289
+ type: Component,
290
+ args: [{
291
+ selector: "ToggleGroup",
292
+ providers: [{
293
+ provide: ToggleGroupContextBase,
294
+ useExisting: forwardRef(() => ToggleGroupComponent)
295
+ }],
296
+ host: {
297
+ "[class]": "classes()",
298
+ "[attr.role]": "\"group\"",
299
+ "[attr.dir]": "dir() ?? null",
300
+ "[attr.data-disabled]": "disabled() ? \"\" : null",
301
+ "[attr.data-orientation]": "orientation()",
302
+ "[attr.data-slot]": "\"toggle-group\"",
303
+ "[attr.data-type]": "type()"
304
+ },
305
+ template: `<ng-content />`
306
+ }]
307
+ }],
308
+ propDecorators: {
309
+ type: [{
310
+ type: i0.Input,
311
+ args: [{
312
+ isSignal: true,
313
+ alias: "type",
314
+ required: true
315
+ }]
316
+ }],
317
+ value: [{
318
+ type: i0.Input,
319
+ args: [{
320
+ isSignal: true,
321
+ alias: "value",
322
+ required: false
323
+ }]
324
+ }, {
325
+ type: i0.Output,
326
+ args: ["valueChange"]
327
+ }],
328
+ values: [{
329
+ type: i0.Input,
330
+ args: [{
331
+ isSignal: true,
332
+ alias: "values",
333
+ required: false
334
+ }]
335
+ }, {
336
+ type: i0.Output,
337
+ args: ["valuesChange"]
338
+ }],
339
+ orientation: [{
340
+ type: i0.Input,
341
+ args: [{
342
+ isSignal: true,
343
+ alias: "orientation",
344
+ required: false
345
+ }]
346
+ }],
347
+ variant: [{
348
+ type: i0.Input,
349
+ args: [{
350
+ isSignal: true,
351
+ alias: "variant",
352
+ required: false
353
+ }]
354
+ }],
355
+ size: [{
356
+ type: i0.Input,
357
+ args: [{
358
+ isSignal: true,
359
+ alias: "size",
360
+ required: false
361
+ }]
362
+ }],
363
+ spacing: [{
364
+ type: i0.Input,
365
+ args: [{
366
+ isSignal: true,
367
+ alias: "spacing",
368
+ required: false
369
+ }]
370
+ }],
371
+ loop: [{
372
+ type: i0.Input,
373
+ args: [{
374
+ isSignal: true,
375
+ alias: "loop",
376
+ required: false
377
+ }]
378
+ }],
379
+ disabled: [{
380
+ type: i0.Input,
381
+ args: [{
382
+ isSignal: true,
383
+ alias: "disabled",
384
+ required: false
385
+ }]
386
+ }],
387
+ dir: [{
388
+ type: i0.Input,
389
+ args: [{
390
+ isSignal: true,
391
+ alias: "dir",
392
+ required: false
393
+ }]
394
+ }],
395
+ class: [{
396
+ type: i0.Input,
397
+ args: [{
398
+ isSignal: true,
399
+ alias: "class",
400
+ required: false
401
+ }]
402
+ }]
403
+ }
404
+ });
405
+ var ToggleGroupItemDirective = class ToggleGroupItemDirective {
406
+ ctx = inject(ToggleGroupContextBase);
407
+ element = inject(ElementRef);
408
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
409
+ disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
410
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
411
+ selected = computed(() => this.ctx.isSelected(this.value()), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
412
+ classes = computed(() => cn(toggleVariants({
413
+ variant: this.ctx.groupVariant(),
414
+ size: this.ctx.groupSize()
415
+ }), this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
416
+ ngOnInit() {
417
+ this.ctx.register(this.element.nativeElement, this.value, this.disabled);
418
+ }
419
+ ngOnDestroy() {
420
+ this.ctx.unregister(this.element.nativeElement);
421
+ }
422
+ isDisabled() {
423
+ return this.ctx.groupDisabled() || this.disabled();
424
+ }
425
+ onClick() {
426
+ if (this.isDisabled()) return;
427
+ this.ctx.toggle(this.value());
428
+ }
429
+ onFocus() {
430
+ if (this.isDisabled()) return;
431
+ this.ctx.markFocused(this.value());
432
+ }
433
+ onArrow(event, offset) {
434
+ event.preventDefault();
435
+ this.ctx.focusNext(this.element.nativeElement, offset);
436
+ }
437
+ onHorizontalArrow(event, offset) {
438
+ event.preventDefault();
439
+ this.ctx.focusNext(this.element.nativeElement, this.ctx.isRtl() ? offset * -1 : offset);
440
+ }
441
+ onHome(event) {
442
+ event.preventDefault();
443
+ this.ctx.focusFirst();
444
+ }
445
+ onEnd(event) {
446
+ event.preventDefault();
447
+ this.ctx.focusLast();
448
+ }
449
+ static ɵfac = i0.ɵɵngDeclareFactory({
450
+ minVersion: "12.0.0",
451
+ version: "22.2.0",
452
+ ngImport: i0,
453
+ type: ToggleGroupItemDirective,
454
+ deps: [],
455
+ target: i0.ɵɵFactoryTarget.Directive
456
+ });
457
+ static ɵdir = i0.ɵɵngDeclareDirective({
458
+ minVersion: "17.1.0",
459
+ version: "22.2.0",
460
+ type: ToggleGroupItemDirective,
461
+ isStandalone: true,
462
+ selector: "button[ToggleGroupItem]",
463
+ inputs: {
464
+ value: {
465
+ classPropertyName: "value",
466
+ publicName: "value",
467
+ isSignal: true,
468
+ isRequired: true,
469
+ transformFunction: null
470
+ },
471
+ disabled: {
472
+ classPropertyName: "disabled",
473
+ publicName: "disabled",
474
+ isSignal: true,
475
+ isRequired: false,
476
+ transformFunction: null
477
+ },
478
+ class: {
479
+ classPropertyName: "class",
480
+ publicName: "class",
481
+ isSignal: true,
482
+ isRequired: false,
483
+ transformFunction: null
484
+ }
485
+ },
486
+ host: {
487
+ attributes: { "type": "button" },
488
+ listeners: {
489
+ "click": "onClick()",
490
+ "focus": "onFocus()",
491
+ "keydown.arrowDown": "onArrow($any($event), 1)",
492
+ "keydown.arrowLeft": "onHorizontalArrow($any($event), -1)",
493
+ "keydown.arrowRight": "onHorizontalArrow($any($event), 1)",
494
+ "keydown.arrowUp": "onArrow($any($event), -1)",
495
+ "keydown.end": "onEnd($any($event))",
496
+ "keydown.home": "onHome($any($event))"
497
+ },
498
+ properties: {
499
+ "class": "classes()",
500
+ "attr.aria-disabled": "isDisabled() ? \"true\" : null",
501
+ "attr.aria-pressed": "selected()",
502
+ "attr.data-disabled": "isDisabled() ? \"\" : null",
503
+ "attr.data-orientation": "ctx.groupOrientation()",
504
+ "attr.data-size": "ctx.groupSize()",
505
+ "attr.data-slot": "\"toggle-group-item\"",
506
+ "attr.data-state": "selected() ? \"on\" : \"off\"",
507
+ "attr.data-variant": "ctx.groupVariant()",
508
+ "attr.tabindex": "ctx.tabindexFor(value(), isDisabled())",
509
+ "disabled": "isDisabled() || null"
510
+ }
511
+ },
512
+ ngImport: i0
513
+ });
514
+ };
515
+ i0.ɵɵngDeclareClassMetadata({
516
+ minVersion: "12.0.0",
517
+ version: "22.2.0",
518
+ ngImport: i0,
519
+ type: ToggleGroupItemDirective,
520
+ decorators: [{
521
+ type: Directive,
522
+ args: [{
523
+ selector: "button[ToggleGroupItem]",
524
+ host: {
525
+ "[class]": "classes()",
526
+ type: "button",
527
+ "[attr.aria-disabled]": "isDisabled() ? \"true\" : null",
528
+ "[attr.aria-pressed]": "selected()",
529
+ "[attr.data-disabled]": "isDisabled() ? \"\" : null",
530
+ "[attr.data-orientation]": "ctx.groupOrientation()",
531
+ "[attr.data-size]": "ctx.groupSize()",
532
+ "[attr.data-slot]": "\"toggle-group-item\"",
533
+ "[attr.data-state]": "selected() ? \"on\" : \"off\"",
534
+ "[attr.data-variant]": "ctx.groupVariant()",
535
+ "[attr.tabindex]": "ctx.tabindexFor(value(), isDisabled())",
536
+ "[disabled]": "isDisabled() || null",
537
+ "(click)": "onClick()",
538
+ "(focus)": "onFocus()",
539
+ "(keydown.arrowDown)": "onArrow($any($event), 1)",
540
+ "(keydown.arrowLeft)": "onHorizontalArrow($any($event), -1)",
541
+ "(keydown.arrowRight)": "onHorizontalArrow($any($event), 1)",
542
+ "(keydown.arrowUp)": "onArrow($any($event), -1)",
543
+ "(keydown.end)": "onEnd($any($event))",
544
+ "(keydown.home)": "onHome($any($event))"
545
+ }
546
+ }]
547
+ }],
548
+ propDecorators: {
549
+ value: [{
550
+ type: i0.Input,
551
+ args: [{
552
+ isSignal: true,
553
+ alias: "value",
554
+ required: true
555
+ }]
556
+ }],
557
+ disabled: [{
558
+ type: i0.Input,
559
+ args: [{
560
+ isSignal: true,
561
+ alias: "disabled",
562
+ required: false
563
+ }]
564
+ }],
565
+ class: [{
566
+ type: i0.Input,
567
+ args: [{
568
+ isSignal: true,
569
+ alias: "class",
570
+ required: false
571
+ }]
572
+ }]
573
+ }
574
+ });
283
575
  function normalizeSpacing(value) {
284
- if (value in spacingClasses) {
285
- return value;
286
- }
287
- return 2;
576
+ if (value in spacingClasses) return value;
577
+ return 2;
288
578
  }
289
-
290
- /**
291
- * Generated bundle index. Do not edit.
292
- */
293
-
294
- export { ToggleGroupComponent, ToggleGroupContextBase, ToggleGroupItemDirective };
579
+ export { ToggleGroupComponent, ToggleGroupContextBase, ToggleGroupItemDirective };