@ojiepermana/angular 22.1.14 → 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-COQ-60DS.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 -496
  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 -113
  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-Be3IqzG4.mjs +0 -91
  249. package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-Bc7DWK3R.mjs +0 -522
  250. package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-DA8VPEn7.mjs +0 -404
  251. package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-U2TJTzlW.mjs +0 -466
  252. package/fesm2022/ojiepermana-angular-navigation-ojiepermana-angular-navigation-CIUhmytH.mjs +0 -2668
@@ -1,319 +1,592 @@
1
- import * as i0 from '@angular/core';
2
- import { Directive, inject, model, input, signal, computed, forwardRef, Component, ElementRef } from '@angular/core';
3
- import { injectUniqueId, cn } from '@ojiepermana/angular/component/utils/core';
4
- import * as i1 from '@ojiepermana/angular/component/utils/scale';
5
- import { ComponentScaleDirective } from '@ojiepermana/angular/component/utils/scale';
6
-
7
- /**
8
- * Shared state for a tabs group. Children read the active value and register
9
- * themselves so the group can drive roving-tabindex keyboard navigation.
10
- */
11
- class TabsContextBase {
12
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsContextBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
13
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: TabsContextBase, isStandalone: true, ngImport: i0 });
14
- }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsContextBase, decorators: [{
16
- type: Directive
17
- }] });
18
- class TabsListContextBase {
19
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsListContextBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
20
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: TabsListContextBase, isStandalone: true, ngImport: i0 });
21
- }
22
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsListContextBase, decorators: [{
23
- type: Directive
24
- }] });
25
- class TabsComponent extends TabsContextBase {
26
- componentScale = inject(ComponentScaleDirective);
27
- radius = this.componentScale.radius;
28
- density = this.componentScale.density;
29
- value = model(null, /* @ts-ignore */
30
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
31
- orientation = input('horizontal', /* @ts-ignore */
32
- ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
33
- class = input('', /* @ts-ignore */
34
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
35
- idPrefix = injectUniqueId('Tabs');
36
- // Registered triggers, kept in DOM order by {@link register}. A signal rather
37
- // than a plain list because every trigger's roving `tabindex` is derived from
38
- // the whole set, so adding or removing one has to re-render the others.
39
- triggers = signal([], /* @ts-ignore */
40
- ...(ngDevMode ? [{ debugName: "triggers" }] : /* istanbul ignore next */ []));
41
- /**
42
- * The value the group actually renders.
43
- *
44
- * A group whose `value` is empty -- nothing bound at all, or a consumer signal
45
- * that starts at null -- still has to show a tab, so the first enabled trigger
46
- * stands in. Derived rather than written back: `value` is the consumer's
47
- * two-way binding to own, and filling it in on their behalf reported a
48
- * selection they never made, from inside a child's ngOnInit.
49
- */
50
- effectiveValue = computed(() => this.value() ?? this.enabledTriggers()[0]?.value() ?? null, /* @ts-ignore */
51
- ...(ngDevMode ? [{ debugName: "effectiveValue" }] : /* istanbul ignore next */ []));
52
- classes = computed(() => cn(this.orientation() === 'vertical' ? 'flex items-start gap-4' : 'block', this.class()), /* @ts-ignore */
53
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
54
- register(element, value, disabled) {
55
- this.triggers.update((triggers) => [...triggers.filter((trigger) => trigger.element !== element), { element, value, disabled }]
56
- // Sorted by document position, not by arrival. A trigger inside an @if
57
- // registers whenever its block renders, so a tab removed and put back
58
- // would otherwise land at the end of the list -- and everything derived
59
- // from the order (arrow direction, Home/End, the fallback tab stop)
60
- // would follow registration order instead of what the user sees.
61
- .sort((a, b) => a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
62
- }
63
- unregister(element) {
64
- this.triggers.update((triggers) => triggers.filter((trigger) => trigger.element !== element));
65
- }
66
- /**
67
- * The roving `tabindex` for one trigger.
68
- *
69
- * Normally the selected trigger is the single tab stop. When the bound value
70
- * matches no ENABLED trigger the first enabled one takes the tab stop instead.
71
- * Without that fallback a value nothing answers to -- a typo, a tab removed
72
- * from the DOM while it was selected, a selected tab that is disabled -- left
73
- * every trigger at `tabindex=-1`, which drops the whole tablist out of the tab
74
- * order and leaves a keyboard user with no way into it at all.
75
- *
76
- * The fallback is presentation only: it never rewrites `value`, because that
77
- * is the consumer's two-way binding to own.
78
- */
79
- tabIndexFor(element) {
80
- const enabledTriggers = this.enabledTriggers();
81
- const trigger = enabledTriggers.find((candidate) => candidate.element === element);
82
- if (!trigger) {
83
- return -1;
84
- }
85
- const selectedTrigger = enabledTriggers.find((candidate) => candidate.value() === this.effectiveValue());
86
- return (selectedTrigger ?? enabledTriggers[0]) === trigger ? 0 : -1;
87
- }
88
- activate(value, focus = false) {
89
- const trigger = this.triggerForValue(value);
90
- if (!trigger || trigger.disabled())
91
- return;
92
- this.value.set(value);
93
- if (focus) {
94
- trigger.element.focus();
95
- }
96
- }
97
- focusNext(from, offset) {
98
- const enabledTriggers = this.enabledTriggers();
99
- const currentIndex = enabledTriggers.findIndex((trigger) => trigger.element === from);
100
- if (currentIndex < 0 || enabledTriggers.length === 0)
101
- return;
102
- const nextTrigger = enabledTriggers[(currentIndex + offset + enabledTriggers.length) % enabledTriggers.length];
103
- this.activate(nextTrigger.value(), true);
104
- }
105
- focusFirst() {
106
- const firstTrigger = this.enabledTriggers()[0];
107
- if (firstTrigger)
108
- this.activate(firstTrigger.value(), true);
109
- }
110
- focusLast() {
111
- const enabledTriggers = this.enabledTriggers();
112
- const lastTrigger = enabledTriggers[enabledTriggers.length - 1];
113
- if (lastTrigger)
114
- this.activate(lastTrigger.value(), true);
115
- }
116
- triggerId(value) {
117
- return `${this.idPrefix}-trigger-${this.normalizeValue(value)}`;
118
- }
119
- contentId(value) {
120
- return `${this.idPrefix}-content-${this.normalizeValue(value)}`;
121
- }
122
- enabledTriggers() {
123
- return this.triggers().filter((trigger) => !trigger.disabled());
124
- }
125
- triggerForValue(value) {
126
- return this.triggers().find((trigger) => trigger.value() === value);
127
- }
128
- normalizeValue(value) {
129
- const normalized = value
130
- .toLowerCase()
131
- .replace(/[^a-z0-9_-]+/g, '-')
132
- .replace(/^-+|-+$/g, '');
133
- return normalized || 'tab';
134
- }
135
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
136
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: TabsComponent, isStandalone: true, selector: "Tabs", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "classes()", "attr.data-orientation": "orientation()" } }, providers: [{ provide: TabsContextBase, useExisting: forwardRef(() => TabsComponent) }], usesInheritance: true, hostDirectives: [{ directive: i1.ComponentScaleDirective, inputs: ["radius", "radius", "density", "density"] }], ngImport: i0, template: `<ng-content />`, isInline: true });
137
- }
138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsComponent, decorators: [{
139
- type: Component,
140
- args: [{
141
- selector: 'Tabs',
142
- hostDirectives: [
143
- {
144
- directive: ComponentScaleDirective,
145
- inputs: ['radius', 'density'],
146
- },
147
- ],
148
- providers: [{ provide: TabsContextBase, useExisting: forwardRef(() => TabsComponent) }],
149
- host: {
150
- '[class]': 'classes()',
151
- '[attr.data-orientation]': 'orientation()',
152
- },
153
- template: `<ng-content />`,
154
- }]
155
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
156
- class TabsListComponent extends TabsListContextBase {
157
- ctx = inject(TabsComponent);
158
- variant = input('default', /* @ts-ignore */
159
- ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
160
- class = input('', /* @ts-ignore */
161
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
162
- classes = computed(() => cn(this.variantClasses(), this.class()), /* @ts-ignore */
163
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
164
- listVariant() {
165
- return this.variant();
166
- }
167
- variantClasses() {
168
- if (this.variant() === 'line') {
169
- return this.ctx.orientation() === 'vertical'
170
- ? 'inline-flex flex-col items-stretch justify-start gap-1 border-e border-border bg-transparent p-0 pe-3 text-muted-foreground'
171
- : 'inline-flex h-control-md items-center justify-start gap-4 border-b border-border bg-transparent p-0 text-muted-foreground';
172
- }
173
- return this.ctx.orientation() === 'vertical'
174
- ? 'inline-flex flex-col items-stretch justify-start rounded-md bg-muted p-1 text-muted-foreground'
175
- : 'inline-flex h-control-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground';
176
- }
177
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
178
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: TabsListComponent, isStandalone: true, selector: "TabsList", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.role": "\"tablist\"", "attr.aria-orientation": "ctx.orientation()", "attr.data-variant": "variant()" } }, providers: [{ provide: TabsListContextBase, useExisting: forwardRef(() => TabsListComponent) }], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true });
179
- }
180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsListComponent, decorators: [{
181
- type: Component,
182
- args: [{
183
- selector: 'TabsList',
184
- providers: [{ provide: TabsListContextBase, useExisting: forwardRef(() => TabsListComponent) }],
185
- host: {
186
- '[class]': 'classes()',
187
- '[attr.role]': '"tablist"',
188
- '[attr.aria-orientation]': 'ctx.orientation()',
189
- '[attr.data-variant]': 'variant()',
190
- },
191
- template: `<ng-content />`,
192
- }]
193
- }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
194
- class TabsTriggerComponent {
195
- ctx = inject(TabsComponent);
196
- list = inject(TabsListContextBase, { optional: true });
197
- el = inject(ElementRef);
198
- value = input.required(/* @ts-ignore */
199
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
200
- disabled = input(false, /* @ts-ignore */
201
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
202
- class = input('', /* @ts-ignore */
203
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
204
- selected = computed(() => this.ctx.effectiveValue() === this.value(), /* @ts-ignore */
205
- ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
206
- tabIndex = computed(() => this.ctx.tabIndexFor(this.el.nativeElement), /* @ts-ignore */
207
- ...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
208
- triggerId = computed(() => this.ctx.triggerId(this.value()), /* @ts-ignore */
209
- ...(ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []));
210
- contentId = computed(() => this.ctx.contentId(this.value()), /* @ts-ignore */
211
- ...(ngDevMode ? [{ debugName: "contentId" }] : /* istanbul ignore next */ []));
212
- classes = computed(() => cn('inline-flex items-center justify-center gap-1.5 whitespace-nowrap text-sm font-medium', 'ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', 'disabled:pointer-events-none disabled:opacity-50', this.variantClasses(), this.class()), /* @ts-ignore */
213
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
214
- ngOnInit() {
215
- this.ctx.register(this.el.nativeElement, this.value, this.disabled);
216
- }
217
- ngOnDestroy() {
218
- this.ctx.unregister(this.el.nativeElement);
219
- }
220
- onClick() {
221
- if (this.disabled())
222
- return;
223
- this.ctx.activate(this.value());
224
- }
225
- onArrow(e, delta, axis) {
226
- if (this.ctx.orientation() !== axis)
227
- return;
228
- e.preventDefault();
229
- this.ctx.focusNext(this.el.nativeElement, delta);
230
- }
231
- onHome(e) {
232
- e.preventDefault();
233
- this.ctx.focusFirst();
234
- }
235
- onEnd(e) {
236
- e.preventDefault();
237
- this.ctx.focusLast();
238
- }
239
- variantClasses() {
240
- const variant = this.list?.listVariant() ?? 'default';
241
- if (variant === 'line') {
242
- return this.ctx.orientation() === 'vertical'
243
- ? 'w-full justify-start rounded-none border-e-2 border-transparent px-3 py-2 data-[state=active]:border-foreground data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none'
244
- : 'rounded-none border-b-2 border-transparent px-2 py-2 data-[state=active]:border-foreground data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none';
245
- }
246
- return cn('rounded-sm px-3 py-1.5 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm', this.ctx.orientation() === 'vertical' && 'w-full justify-start');
247
- }
248
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
249
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: TabsTriggerComponent, isStandalone: true, selector: "button[TabsTrigger]", 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()", "keydown.arrowRight": "onArrow($any($event), 1, \"horizontal\")", "keydown.arrowLeft": "onArrow($any($event), -1, \"horizontal\")", "keydown.arrowDown": "onArrow($any($event), 1, \"vertical\")", "keydown.arrowUp": "onArrow($any($event), -1, \"vertical\")", "keydown.home": "onHome($any($event))", "keydown.end": "onEnd($any($event))" }, properties: { "class": "classes()", "id": "triggerId()", "attr.role": "\"tab\"", "attr.aria-selected": "selected()", "attr.aria-controls": "contentId()", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.tabindex": "tabIndex()", "attr.data-state": "selected() ? \"active\" : \"inactive\"", "disabled": "disabled() || null" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
250
- }
251
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsTriggerComponent, decorators: [{
252
- type: Component,
253
- args: [{
254
- selector: 'button[TabsTrigger]',
255
- host: {
256
- '[class]': 'classes()',
257
- '[id]': 'triggerId()',
258
- type: 'button',
259
- '[attr.role]': '"tab"',
260
- '[attr.aria-selected]': 'selected()',
261
- '[attr.aria-controls]': 'contentId()',
262
- '[attr.aria-disabled]': 'disabled() ? "true" : null',
263
- '[attr.tabindex]': 'tabIndex()',
264
- '[attr.data-state]': 'selected() ? "active" : "inactive"',
265
- '[disabled]': 'disabled() || null',
266
- '(click)': 'onClick()',
267
- '(keydown.arrowRight)': 'onArrow($any($event), 1, "horizontal")',
268
- '(keydown.arrowLeft)': 'onArrow($any($event), -1, "horizontal")',
269
- '(keydown.arrowDown)': 'onArrow($any($event), 1, "vertical")',
270
- '(keydown.arrowUp)': 'onArrow($any($event), -1, "vertical")',
271
- '(keydown.home)': 'onHome($any($event))',
272
- '(keydown.end)': 'onEnd($any($event))',
273
- },
274
- template: `<ng-content />`,
275
- }]
276
- }], 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 }] }] } });
277
- class TabsContentComponent {
278
- ctx = inject(TabsComponent);
279
- value = input.required(/* @ts-ignore */
280
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
281
- class = input('', /* @ts-ignore */
282
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
283
- active = computed(() => this.ctx.effectiveValue() === this.value(), /* @ts-ignore */
284
- ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
285
- triggerId = computed(() => this.ctx.triggerId(this.value()), /* @ts-ignore */
286
- ...(ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []));
287
- contentId = computed(() => this.ctx.contentId(this.value()), /* @ts-ignore */
288
- ...(ngDevMode ? [{ debugName: "contentId" }] : /* istanbul ignore next */ []));
289
- classes = computed(() => cn('mt-2 block ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring', this.class()), /* @ts-ignore */
290
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
291
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
292
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: TabsContentComponent, isStandalone: true, selector: "TabsContent", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tabindex": "0" }, properties: { "class": "classes()", "id": "contentId()", "attr.role": "\"tabpanel\"", "attr.aria-labelledby": "triggerId()", "attr.data-state": "active() ? \"active\" : \"inactive\"", "hidden": "!active()" } }, ngImport: i0, template: `@if (active()) {
293
- <ng-content />
294
- }`, isInline: true });
295
- }
296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: TabsContentComponent, decorators: [{
297
- type: Component,
298
- args: [{
299
- selector: 'TabsContent',
300
- host: {
301
- '[class]': 'classes()',
302
- '[id]': 'contentId()',
303
- '[attr.role]': '"tabpanel"',
304
- '[attr.aria-labelledby]': 'triggerId()',
305
- '[attr.data-state]': 'active() ? "active" : "inactive"',
306
- '[hidden]': '!active()',
307
- tabindex: '0',
308
- },
309
- template: `@if (active()) {
1
+ import * as i0 from "@angular/core";
2
+ import { Component, Directive, ElementRef, computed, forwardRef, inject, input, model, signal } from "@angular/core";
3
+ import { cn, injectUniqueId } from "@ojiepermana/angular/component/utils/core";
4
+ import * as i1 from "@ojiepermana/angular/component/utils/scale";
5
+ import { ComponentScaleDirective } from "@ojiepermana/angular/component/utils/scale";
6
+ var TabsContextBase = class TabsContextBase {
7
+ static ɵfac = i0.ɵɵngDeclareFactory({
8
+ minVersion: "12.0.0",
9
+ version: "22.2.0",
10
+ ngImport: i0,
11
+ type: TabsContextBase,
12
+ deps: [],
13
+ target: i0.ɵɵFactoryTarget.Directive
14
+ });
15
+ static ɵdir = i0.ɵɵngDeclareDirective({
16
+ minVersion: "14.0.0",
17
+ version: "22.2.0",
18
+ type: TabsContextBase,
19
+ isStandalone: true,
20
+ ngImport: i0
21
+ });
22
+ };
23
+ i0.ɵɵngDeclareClassMetadata({
24
+ minVersion: "12.0.0",
25
+ version: "22.2.0",
26
+ ngImport: i0,
27
+ type: TabsContextBase,
28
+ decorators: [{ type: Directive }]
29
+ });
30
+ var TabsListContextBase = class TabsListContextBase {
31
+ static ɵfac = i0.ɵɵngDeclareFactory({
32
+ minVersion: "12.0.0",
33
+ version: "22.2.0",
34
+ ngImport: i0,
35
+ type: TabsListContextBase,
36
+ deps: [],
37
+ target: i0.ɵɵFactoryTarget.Directive
38
+ });
39
+ static ɵdir = i0.ɵɵngDeclareDirective({
40
+ minVersion: "14.0.0",
41
+ version: "22.2.0",
42
+ type: TabsListContextBase,
43
+ isStandalone: true,
44
+ ngImport: i0
45
+ });
46
+ };
47
+ i0.ɵɵngDeclareClassMetadata({
48
+ minVersion: "12.0.0",
49
+ version: "22.2.0",
50
+ ngImport: i0,
51
+ type: TabsListContextBase,
52
+ decorators: [{ type: Directive }]
53
+ });
54
+ var TabsComponent = class TabsComponent extends TabsContextBase {
55
+ componentScale = inject(ComponentScaleDirective);
56
+ radius = this.componentScale.radius;
57
+ density = this.componentScale.density;
58
+ value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
59
+ orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
60
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
61
+ idPrefix = injectUniqueId("Tabs");
62
+ triggers = signal([], ...ngDevMode ? [{ debugName: "triggers" }] : /* istanbul ignore next */ []);
63
+ effectiveValue = computed(() => this.value() ?? this.enabledTriggers()[0]?.value() ?? null, ...ngDevMode ? [{ debugName: "effectiveValue" }] : /* istanbul ignore next */ []);
64
+ classes = computed(() => cn(this.orientation() === "vertical" ? "flex items-start gap-4" : "block", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
65
+ register(element, value, disabled) {
66
+ this.triggers.update((triggers) => [...triggers.filter((trigger) => trigger.element !== element), {
67
+ element,
68
+ value,
69
+ disabled
70
+ }].sort((a, b) => a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
71
+ }
72
+ unregister(element) {
73
+ this.triggers.update((triggers) => triggers.filter((trigger) => trigger.element !== element));
74
+ }
75
+ tabIndexFor(element) {
76
+ const enabledTriggers = this.enabledTriggers();
77
+ const trigger = enabledTriggers.find((candidate) => candidate.element === element);
78
+ if (!trigger) return -1;
79
+ return (enabledTriggers.find((candidate) => candidate.value() === this.effectiveValue()) ?? enabledTriggers[0]) === trigger ? 0 : -1;
80
+ }
81
+ activate(value, focus = false) {
82
+ const trigger = this.triggerForValue(value);
83
+ if (!trigger || trigger.disabled()) return;
84
+ this.value.set(value);
85
+ if (focus) trigger.element.focus();
86
+ }
87
+ focusNext(from, offset) {
88
+ const enabledTriggers = this.enabledTriggers();
89
+ const currentIndex = enabledTriggers.findIndex((trigger) => trigger.element === from);
90
+ if (currentIndex < 0 || enabledTriggers.length === 0) return;
91
+ const nextTrigger = enabledTriggers[(currentIndex + offset + enabledTriggers.length) % enabledTriggers.length];
92
+ this.activate(nextTrigger.value(), true);
93
+ }
94
+ focusFirst() {
95
+ const firstTrigger = this.enabledTriggers()[0];
96
+ if (firstTrigger) this.activate(firstTrigger.value(), true);
97
+ }
98
+ focusLast() {
99
+ const enabledTriggers = this.enabledTriggers();
100
+ const lastTrigger = enabledTriggers[enabledTriggers.length - 1];
101
+ if (lastTrigger) this.activate(lastTrigger.value(), true);
102
+ }
103
+ triggerId(value) {
104
+ return `${this.idPrefix}-trigger-${this.normalizeValue(value)}`;
105
+ }
106
+ contentId(value) {
107
+ return `${this.idPrefix}-content-${this.normalizeValue(value)}`;
108
+ }
109
+ enabledTriggers() {
110
+ return this.triggers().filter((trigger) => !trigger.disabled());
111
+ }
112
+ triggerForValue(value) {
113
+ return this.triggers().find((trigger) => trigger.value() === value);
114
+ }
115
+ normalizeValue(value) {
116
+ return value.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || "tab";
117
+ }
118
+ static ɵfac = i0.ɵɵngDeclareFactory({
119
+ minVersion: "12.0.0",
120
+ version: "22.2.0",
121
+ ngImport: i0,
122
+ type: TabsComponent,
123
+ deps: null,
124
+ target: i0.ɵɵFactoryTarget.Component
125
+ });
126
+ static ɵcmp = i0.ɵɵngDeclareComponent({
127
+ minVersion: "17.1.0",
128
+ version: "22.2.0",
129
+ type: TabsComponent,
130
+ isStandalone: true,
131
+ selector: "Tabs",
132
+ inputs: {
133
+ value: {
134
+ classPropertyName: "value",
135
+ publicName: "value",
136
+ isSignal: true,
137
+ isRequired: false,
138
+ transformFunction: null
139
+ },
140
+ orientation: {
141
+ classPropertyName: "orientation",
142
+ publicName: "orientation",
143
+ isSignal: true,
144
+ isRequired: false,
145
+ transformFunction: null
146
+ },
147
+ class: {
148
+ classPropertyName: "class",
149
+ publicName: "class",
150
+ isSignal: true,
151
+ isRequired: false,
152
+ transformFunction: null
153
+ }
154
+ },
155
+ outputs: { value: "valueChange" },
156
+ host: { properties: {
157
+ "class": "classes()",
158
+ "attr.data-orientation": "orientation()"
159
+ } },
160
+ providers: [{
161
+ provide: TabsContextBase,
162
+ useExisting: forwardRef(() => TabsComponent)
163
+ }],
164
+ usesInheritance: true,
165
+ hostDirectives: [{
166
+ directive: i1.ComponentScaleDirective,
167
+ inputs: [
168
+ "radius",
169
+ "radius",
170
+ "density",
171
+ "density"
172
+ ]
173
+ }],
174
+ ngImport: i0,
175
+ template: `<ng-content />`,
176
+ isInline: true
177
+ });
178
+ };
179
+ i0.ɵɵngDeclareClassMetadata({
180
+ minVersion: "12.0.0",
181
+ version: "22.2.0",
182
+ ngImport: i0,
183
+ type: TabsComponent,
184
+ decorators: [{
185
+ type: Component,
186
+ args: [{
187
+ selector: "Tabs",
188
+ hostDirectives: [{
189
+ directive: ComponentScaleDirective,
190
+ inputs: ["radius", "density"]
191
+ }],
192
+ providers: [{
193
+ provide: TabsContextBase,
194
+ useExisting: forwardRef(() => TabsComponent)
195
+ }],
196
+ host: {
197
+ "[class]": "classes()",
198
+ "[attr.data-orientation]": "orientation()"
199
+ },
200
+ template: `<ng-content />`
201
+ }]
202
+ }],
203
+ propDecorators: {
204
+ value: [{
205
+ type: i0.Input,
206
+ args: [{
207
+ isSignal: true,
208
+ alias: "value",
209
+ required: false
210
+ }]
211
+ }, {
212
+ type: i0.Output,
213
+ args: ["valueChange"]
214
+ }],
215
+ orientation: [{
216
+ type: i0.Input,
217
+ args: [{
218
+ isSignal: true,
219
+ alias: "orientation",
220
+ required: false
221
+ }]
222
+ }],
223
+ class: [{
224
+ type: i0.Input,
225
+ args: [{
226
+ isSignal: true,
227
+ alias: "class",
228
+ required: false
229
+ }]
230
+ }]
231
+ }
232
+ });
233
+ var TabsListComponent = class TabsListComponent extends TabsListContextBase {
234
+ ctx = inject(TabsComponent);
235
+ variant = input("default", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
236
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
237
+ classes = computed(() => cn(this.variantClasses(), this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
238
+ listVariant() {
239
+ return this.variant();
240
+ }
241
+ variantClasses() {
242
+ if (this.variant() === "line") return this.ctx.orientation() === "vertical" ? "inline-flex flex-col items-stretch justify-start gap-1 border-e border-border bg-transparent p-0 pe-3 text-muted-foreground" : "inline-flex h-control-md items-center justify-start gap-4 border-b border-border bg-transparent p-0 text-muted-foreground";
243
+ return this.ctx.orientation() === "vertical" ? "inline-flex flex-col items-stretch justify-start rounded-md bg-muted p-1 text-muted-foreground" : "inline-flex h-control-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground";
244
+ }
245
+ static ɵfac = i0.ɵɵngDeclareFactory({
246
+ minVersion: "12.0.0",
247
+ version: "22.2.0",
248
+ ngImport: i0,
249
+ type: TabsListComponent,
250
+ deps: null,
251
+ target: i0.ɵɵFactoryTarget.Component
252
+ });
253
+ static ɵcmp = i0.ɵɵngDeclareComponent({
254
+ minVersion: "17.1.0",
255
+ version: "22.2.0",
256
+ type: TabsListComponent,
257
+ isStandalone: true,
258
+ selector: "TabsList",
259
+ inputs: {
260
+ variant: {
261
+ classPropertyName: "variant",
262
+ publicName: "variant",
263
+ isSignal: true,
264
+ isRequired: false,
265
+ transformFunction: null
266
+ },
267
+ class: {
268
+ classPropertyName: "class",
269
+ publicName: "class",
270
+ isSignal: true,
271
+ isRequired: false,
272
+ transformFunction: null
273
+ }
274
+ },
275
+ host: { properties: {
276
+ "class": "classes()",
277
+ "attr.role": "\"tablist\"",
278
+ "attr.aria-orientation": "ctx.orientation()",
279
+ "attr.data-variant": "variant()"
280
+ } },
281
+ providers: [{
282
+ provide: TabsListContextBase,
283
+ useExisting: forwardRef(() => TabsListComponent)
284
+ }],
285
+ usesInheritance: true,
286
+ ngImport: i0,
287
+ template: `<ng-content />`,
288
+ isInline: true
289
+ });
290
+ };
291
+ i0.ɵɵngDeclareClassMetadata({
292
+ minVersion: "12.0.0",
293
+ version: "22.2.0",
294
+ ngImport: i0,
295
+ type: TabsListComponent,
296
+ decorators: [{
297
+ type: Component,
298
+ args: [{
299
+ selector: "TabsList",
300
+ providers: [{
301
+ provide: TabsListContextBase,
302
+ useExisting: forwardRef(() => TabsListComponent)
303
+ }],
304
+ host: {
305
+ "[class]": "classes()",
306
+ "[attr.role]": "\"tablist\"",
307
+ "[attr.aria-orientation]": "ctx.orientation()",
308
+ "[attr.data-variant]": "variant()"
309
+ },
310
+ template: `<ng-content />`
311
+ }]
312
+ }],
313
+ propDecorators: {
314
+ variant: [{
315
+ type: i0.Input,
316
+ args: [{
317
+ isSignal: true,
318
+ alias: "variant",
319
+ required: false
320
+ }]
321
+ }],
322
+ class: [{
323
+ type: i0.Input,
324
+ args: [{
325
+ isSignal: true,
326
+ alias: "class",
327
+ required: false
328
+ }]
329
+ }]
330
+ }
331
+ });
332
+ var TabsTriggerComponent = class TabsTriggerComponent {
333
+ ctx = inject(TabsComponent);
334
+ list = inject(TabsListContextBase, { optional: true });
335
+ el = inject(ElementRef);
336
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
337
+ disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
338
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
339
+ selected = computed(() => this.ctx.effectiveValue() === this.value(), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
340
+ tabIndex = computed(() => this.ctx.tabIndexFor(this.el.nativeElement), ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
341
+ triggerId = computed(() => this.ctx.triggerId(this.value()), ...ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []);
342
+ contentId = computed(() => this.ctx.contentId(this.value()), ...ngDevMode ? [{ debugName: "contentId" }] : /* istanbul ignore next */ []);
343
+ classes = computed(() => cn("inline-flex items-center justify-center gap-1.5 whitespace-nowrap text-sm font-medium", "ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50", this.variantClasses(), this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
344
+ ngOnInit() {
345
+ this.ctx.register(this.el.nativeElement, this.value, this.disabled);
346
+ }
347
+ ngOnDestroy() {
348
+ this.ctx.unregister(this.el.nativeElement);
349
+ }
350
+ onClick() {
351
+ if (this.disabled()) return;
352
+ this.ctx.activate(this.value());
353
+ }
354
+ onArrow(e, delta, axis) {
355
+ if (this.ctx.orientation() !== axis) return;
356
+ e.preventDefault();
357
+ this.ctx.focusNext(this.el.nativeElement, delta);
358
+ }
359
+ onHome(e) {
360
+ e.preventDefault();
361
+ this.ctx.focusFirst();
362
+ }
363
+ onEnd(e) {
364
+ e.preventDefault();
365
+ this.ctx.focusLast();
366
+ }
367
+ variantClasses() {
368
+ if ((this.list?.listVariant() ?? "default") === "line") return this.ctx.orientation() === "vertical" ? "w-full justify-start rounded-none border-e-2 border-transparent px-3 py-2 data-[state=active]:border-foreground data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none" : "rounded-none border-b-2 border-transparent px-2 py-2 data-[state=active]:border-foreground data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none";
369
+ return cn("rounded-sm px-3 py-1.5 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm", this.ctx.orientation() === "vertical" && "w-full justify-start");
370
+ }
371
+ static ɵfac = i0.ɵɵngDeclareFactory({
372
+ minVersion: "12.0.0",
373
+ version: "22.2.0",
374
+ ngImport: i0,
375
+ type: TabsTriggerComponent,
376
+ deps: [],
377
+ target: i0.ɵɵFactoryTarget.Component
378
+ });
379
+ static ɵcmp = i0.ɵɵngDeclareComponent({
380
+ minVersion: "17.1.0",
381
+ version: "22.2.0",
382
+ type: TabsTriggerComponent,
383
+ isStandalone: true,
384
+ selector: "button[TabsTrigger]",
385
+ inputs: {
386
+ value: {
387
+ classPropertyName: "value",
388
+ publicName: "value",
389
+ isSignal: true,
390
+ isRequired: true,
391
+ transformFunction: null
392
+ },
393
+ disabled: {
394
+ classPropertyName: "disabled",
395
+ publicName: "disabled",
396
+ isSignal: true,
397
+ isRequired: false,
398
+ transformFunction: null
399
+ },
400
+ class: {
401
+ classPropertyName: "class",
402
+ publicName: "class",
403
+ isSignal: true,
404
+ isRequired: false,
405
+ transformFunction: null
406
+ }
407
+ },
408
+ host: {
409
+ attributes: { "type": "button" },
410
+ listeners: {
411
+ "click": "onClick()",
412
+ "keydown.arrowRight": "onArrow($any($event), 1, \"horizontal\")",
413
+ "keydown.arrowLeft": "onArrow($any($event), -1, \"horizontal\")",
414
+ "keydown.arrowDown": "onArrow($any($event), 1, \"vertical\")",
415
+ "keydown.arrowUp": "onArrow($any($event), -1, \"vertical\")",
416
+ "keydown.home": "onHome($any($event))",
417
+ "keydown.end": "onEnd($any($event))"
418
+ },
419
+ properties: {
420
+ "class": "classes()",
421
+ "id": "triggerId()",
422
+ "attr.role": "\"tab\"",
423
+ "attr.aria-selected": "selected()",
424
+ "attr.aria-controls": "contentId()",
425
+ "attr.aria-disabled": "disabled() ? \"true\" : null",
426
+ "attr.tabindex": "tabIndex()",
427
+ "attr.data-state": "selected() ? \"active\" : \"inactive\"",
428
+ "disabled": "disabled() || null"
429
+ }
430
+ },
431
+ ngImport: i0,
432
+ template: `<ng-content />`,
433
+ isInline: true
434
+ });
435
+ };
436
+ i0.ɵɵngDeclareClassMetadata({
437
+ minVersion: "12.0.0",
438
+ version: "22.2.0",
439
+ ngImport: i0,
440
+ type: TabsTriggerComponent,
441
+ decorators: [{
442
+ type: Component,
443
+ args: [{
444
+ selector: "button[TabsTrigger]",
445
+ host: {
446
+ "[class]": "classes()",
447
+ "[id]": "triggerId()",
448
+ type: "button",
449
+ "[attr.role]": "\"tab\"",
450
+ "[attr.aria-selected]": "selected()",
451
+ "[attr.aria-controls]": "contentId()",
452
+ "[attr.aria-disabled]": "disabled() ? \"true\" : null",
453
+ "[attr.tabindex]": "tabIndex()",
454
+ "[attr.data-state]": "selected() ? \"active\" : \"inactive\"",
455
+ "[disabled]": "disabled() || null",
456
+ "(click)": "onClick()",
457
+ "(keydown.arrowRight)": "onArrow($any($event), 1, \"horizontal\")",
458
+ "(keydown.arrowLeft)": "onArrow($any($event), -1, \"horizontal\")",
459
+ "(keydown.arrowDown)": "onArrow($any($event), 1, \"vertical\")",
460
+ "(keydown.arrowUp)": "onArrow($any($event), -1, \"vertical\")",
461
+ "(keydown.home)": "onHome($any($event))",
462
+ "(keydown.end)": "onEnd($any($event))"
463
+ },
464
+ template: `<ng-content />`
465
+ }]
466
+ }],
467
+ propDecorators: {
468
+ value: [{
469
+ type: i0.Input,
470
+ args: [{
471
+ isSignal: true,
472
+ alias: "value",
473
+ required: true
474
+ }]
475
+ }],
476
+ disabled: [{
477
+ type: i0.Input,
478
+ args: [{
479
+ isSignal: true,
480
+ alias: "disabled",
481
+ required: false
482
+ }]
483
+ }],
484
+ class: [{
485
+ type: i0.Input,
486
+ args: [{
487
+ isSignal: true,
488
+ alias: "class",
489
+ required: false
490
+ }]
491
+ }]
492
+ }
493
+ });
494
+ var TabsContentComponent = class TabsContentComponent {
495
+ ctx = inject(TabsComponent);
496
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
497
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
498
+ active = computed(() => this.ctx.effectiveValue() === this.value(), ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
499
+ triggerId = computed(() => this.ctx.triggerId(this.value()), ...ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []);
500
+ contentId = computed(() => this.ctx.contentId(this.value()), ...ngDevMode ? [{ debugName: "contentId" }] : /* istanbul ignore next */ []);
501
+ classes = computed(() => cn("mt-2 block ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
502
+ static ɵfac = i0.ɵɵngDeclareFactory({
503
+ minVersion: "12.0.0",
504
+ version: "22.2.0",
505
+ ngImport: i0,
506
+ type: TabsContentComponent,
507
+ deps: [],
508
+ target: i0.ɵɵFactoryTarget.Component
509
+ });
510
+ static ɵcmp = i0.ɵɵngDeclareComponent({
511
+ minVersion: "17.0.0",
512
+ version: "22.2.0",
513
+ type: TabsContentComponent,
514
+ isStandalone: true,
515
+ selector: "TabsContent",
516
+ inputs: {
517
+ value: {
518
+ classPropertyName: "value",
519
+ publicName: "value",
520
+ isSignal: true,
521
+ isRequired: true,
522
+ transformFunction: null
523
+ },
524
+ class: {
525
+ classPropertyName: "class",
526
+ publicName: "class",
527
+ isSignal: true,
528
+ isRequired: false,
529
+ transformFunction: null
530
+ }
531
+ },
532
+ host: {
533
+ attributes: { "tabindex": "0" },
534
+ properties: {
535
+ "class": "classes()",
536
+ "id": "contentId()",
537
+ "attr.role": "\"tabpanel\"",
538
+ "attr.aria-labelledby": "triggerId()",
539
+ "attr.data-state": "active() ? \"active\" : \"inactive\"",
540
+ "hidden": "!active()"
541
+ }
542
+ },
543
+ ngImport: i0,
544
+ template: `@if (active()) {
310
545
  <ng-content />
311
546
  }`,
312
- }]
313
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
314
-
315
- /**
316
- * Generated bundle index. Do not edit.
317
- */
318
-
319
- export { TabsComponent, TabsContentComponent, TabsContextBase, TabsListComponent, TabsListContextBase, TabsTriggerComponent };
547
+ isInline: true
548
+ });
549
+ };
550
+ i0.ɵɵngDeclareClassMetadata({
551
+ minVersion: "12.0.0",
552
+ version: "22.2.0",
553
+ ngImport: i0,
554
+ type: TabsContentComponent,
555
+ decorators: [{
556
+ type: Component,
557
+ args: [{
558
+ selector: "TabsContent",
559
+ host: {
560
+ "[class]": "classes()",
561
+ "[id]": "contentId()",
562
+ "[attr.role]": "\"tabpanel\"",
563
+ "[attr.aria-labelledby]": "triggerId()",
564
+ "[attr.data-state]": "active() ? \"active\" : \"inactive\"",
565
+ "[hidden]": "!active()",
566
+ tabindex: "0"
567
+ },
568
+ template: `@if (active()) {
569
+ <ng-content />
570
+ }`
571
+ }]
572
+ }],
573
+ propDecorators: {
574
+ value: [{
575
+ type: i0.Input,
576
+ args: [{
577
+ isSignal: true,
578
+ alias: "value",
579
+ required: true
580
+ }]
581
+ }],
582
+ class: [{
583
+ type: i0.Input,
584
+ args: [{
585
+ isSignal: true,
586
+ alias: "class",
587
+ required: false
588
+ }]
589
+ }]
590
+ }
591
+ });
592
+ export { TabsComponent, TabsContentComponent, TabsContextBase, TabsListComponent, TabsListContextBase, TabsTriggerComponent };