@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,84 +1,148 @@
1
- import * as i0 from '@angular/core';
2
- import { numberAttribute, input, booleanAttribute, output, computed, Component, inject, ElementRef, signal, forwardRef } from '@angular/core';
3
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
- import { cn } from '@ojiepermana/angular/component/utils/core';
5
-
6
- const COMPOSER_BASE = 'block w-full min-w-0 text-sm text-foreground';
1
+ import * as i0 from "@angular/core";
2
+ import { Component, ElementRef, booleanAttribute, computed, forwardRef, inject, input, numberAttribute, output, signal } from "@angular/core";
3
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
4
+ import { cn } from "@ojiepermana/angular/component/utils/core";
5
+ const COMPOSER_BASE = "block w-full min-w-0 text-sm text-foreground";
7
6
  const COMPOSER_SHELL_BASE = [
8
- 'relative min-w-0 border border-input bg-background shadow-sm',
9
- 'transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-1 focus-within:ring-ring',
10
- 'aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-within:ring-destructive',
11
- 'data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50',
12
- '[&>[data-slot=composer-input]]:min-w-0 [&>[data-slot=composer-input]]:flex-1',
13
- ].join(' ');
7
+ "relative min-w-0 border border-input bg-background shadow-sm",
8
+ "transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-1 focus-within:ring-ring",
9
+ "aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-within:ring-destructive",
10
+ "data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
11
+ "[&>[data-slot=composer-input]]:min-w-0 [&>[data-slot=composer-input]]:flex-1"
12
+ ].join(" ");
14
13
  const composerShellVariantClasses = {
15
- default: 'rounded-xl',
16
- input: 'rounded-md',
14
+ default: "rounded-xl",
15
+ input: "rounded-md"
17
16
  };
18
- const COMPOSER_BODY_BASE = '[&>[data-slot=composer-input]]:min-w-0 [&>[data-slot=composer-input]]:flex-1';
17
+ const COMPOSER_BODY_BASE = "[&>[data-slot=composer-input]]:min-w-0 [&>[data-slot=composer-input]]:flex-1";
19
18
  const nullableNumberAttribute = (value) => {
20
- if (value === null || value === undefined || value === '') {
21
- return null;
22
- }
23
- return numberAttribute(value);
19
+ if (value === null || value === void 0 || value === "") return null;
20
+ return numberAttribute(value);
24
21
  };
25
- class ComposerComponent {
26
- variant = input('default', /* @ts-ignore */
27
- ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
28
- inline = input(false, { ...(ngDevMode ? { debugName: "inline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
29
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
30
- invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
31
- submit = input('cmd-enter', /* @ts-ignore */
32
- ...(ngDevMode ? [{ debugName: "submit" }] : /* istanbul ignore next */ []));
33
- submitForm = input(true, { ...(ngDevMode ? { debugName: "submitForm" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
34
- class = input('', /* @ts-ignore */
35
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
36
- submitRequested = output();
37
- classes = computed(() => cn(COMPOSER_BASE, this.class()), /* @ts-ignore */
38
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
39
- shellClasses = computed(() => cn(COMPOSER_SHELL_BASE, composerShellVariantClasses[this.variant()]), /* @ts-ignore */
40
- ...(ngDevMode ? [{ debugName: "shellClasses" }] : /* istanbul ignore next */ []));
41
- bodyClasses = computed(() => cn(COMPOSER_BODY_BASE, this.inline()
42
- ? [
43
- 'flex items-end gap-1 px-1 py-1',
44
- '[&>[data-slot=composer-actions-leading]]:order-10',
45
- '[&>[data-slot=composer-input]]:order-20',
46
- '[&>[data-slot=composer-actions-trailing]]:order-30',
47
- ].join(' ')
48
- : [
49
- 'flex flex-wrap items-end gap-1.5 px-2 py-1.5',
50
- '[&>[data-slot=composer-input]]:order-10 [&>[data-slot=composer-input]]:basis-full',
51
- '[&>[data-slot=composer-actions-leading]]:order-20',
52
- '[&>[data-slot=composer-actions-trailing]]:order-30 [&>[data-slot=composer-actions-trailing]]:ml-auto',
53
- ].join(' ')), /* @ts-ignore */
54
- ...(ngDevMode ? [{ debugName: "bodyClasses" }] : /* istanbul ignore next */ []));
55
- handleInputKeydown(event) {
56
- if (this.disabled() || event.key !== 'Enter' || event.defaultPrevented) {
57
- return;
58
- }
59
- const shouldSubmit = this.submit() === 'enter'
60
- ? !event.shiftKey && !event.isComposing
61
- : event.metaKey || event.ctrlKey;
62
- if (!shouldSubmit) {
63
- return;
64
- }
65
- event.preventDefault();
66
- this.submitRequested.emit(event);
67
- if (this.submitForm()) {
68
- this.requestNearestFormSubmit(event.target);
69
- }
70
- }
71
- requestNearestFormSubmit(target) {
72
- if (!(target instanceof Element)) {
73
- return;
74
- }
75
- const form = target.closest('form');
76
- if (form && typeof form.requestSubmit === 'function') {
77
- form.requestSubmit();
78
- }
79
- }
80
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
81
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: ComposerComponent, isStandalone: true, selector: "Composer", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, submit: { classPropertyName: "submit", publicName: "submit", isSignal: true, isRequired: false, transformFunction: null }, submitForm: { classPropertyName: "submitForm", publicName: "submitForm", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitRequested: "submitRequested" }, host: { properties: { "class": "classes()", "attr.data-slot": "\"composer\"", "attr.data-variant": "variant()", "attr.data-inline": "inline() ? \"true\" : null", "attr.data-disabled": "disabled() ? \"true\" : null", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.aria-invalid": "invalid() ? \"true\" : null", "attr.inert": "disabled() ? \"\" : null" } }, ngImport: i0, template: `
22
+ var ComposerComponent = class ComposerComponent {
23
+ variant = input("default", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
24
+ inline = input(false, {
25
+ ...ngDevMode ? { debugName: "inline" } : /* istanbul ignore next */ {},
26
+ transform: booleanAttribute
27
+ });
28
+ disabled = input(false, {
29
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
30
+ transform: booleanAttribute
31
+ });
32
+ invalid = input(false, {
33
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
34
+ transform: booleanAttribute
35
+ });
36
+ submit = input("cmd-enter", ...ngDevMode ? [{ debugName: "submit" }] : /* istanbul ignore next */ []);
37
+ submitForm = input(true, {
38
+ ...ngDevMode ? { debugName: "submitForm" } : /* istanbul ignore next */ {},
39
+ transform: booleanAttribute
40
+ });
41
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
42
+ submitRequested = output();
43
+ classes = computed(() => cn(COMPOSER_BASE, this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
44
+ shellClasses = computed(() => cn(COMPOSER_SHELL_BASE, composerShellVariantClasses[this.variant()]), ...ngDevMode ? [{ debugName: "shellClasses" }] : /* istanbul ignore next */ []);
45
+ bodyClasses = computed(() => cn(COMPOSER_BODY_BASE, this.inline() ? [
46
+ "flex items-end gap-1 px-1 py-1",
47
+ "[&>[data-slot=composer-actions-leading]]:order-10",
48
+ "[&>[data-slot=composer-input]]:order-20",
49
+ "[&>[data-slot=composer-actions-trailing]]:order-30"
50
+ ].join(" ") : [
51
+ "flex flex-wrap items-end gap-1.5 px-2 py-1.5",
52
+ "[&>[data-slot=composer-input]]:order-10 [&>[data-slot=composer-input]]:basis-full",
53
+ "[&>[data-slot=composer-actions-leading]]:order-20",
54
+ "[&>[data-slot=composer-actions-trailing]]:order-30 [&>[data-slot=composer-actions-trailing]]:ml-auto"
55
+ ].join(" ")), ...ngDevMode ? [{ debugName: "bodyClasses" }] : /* istanbul ignore next */ []);
56
+ handleInputKeydown(event) {
57
+ if (this.disabled() || event.key !== "Enter" || event.defaultPrevented) return;
58
+ if (!(this.submit() === "enter" ? !event.shiftKey && !event.isComposing : event.metaKey || event.ctrlKey)) return;
59
+ event.preventDefault();
60
+ this.submitRequested.emit(event);
61
+ if (this.submitForm()) this.requestNearestFormSubmit(event.target);
62
+ }
63
+ requestNearestFormSubmit(target) {
64
+ if (!(target instanceof Element)) return;
65
+ const form = target.closest("form");
66
+ if (form && typeof form.requestSubmit === "function") form.requestSubmit();
67
+ }
68
+ static ɵfac = i0.ɵɵngDeclareFactory({
69
+ minVersion: "12.0.0",
70
+ version: "22.2.0",
71
+ ngImport: i0,
72
+ type: ComposerComponent,
73
+ deps: [],
74
+ target: i0.ɵɵFactoryTarget.Component
75
+ });
76
+ static ɵcmp = i0.ɵɵngDeclareComponent({
77
+ minVersion: "17.1.0",
78
+ version: "22.2.0",
79
+ type: ComposerComponent,
80
+ isStandalone: true,
81
+ selector: "Composer",
82
+ inputs: {
83
+ variant: {
84
+ classPropertyName: "variant",
85
+ publicName: "variant",
86
+ isSignal: true,
87
+ isRequired: false,
88
+ transformFunction: null
89
+ },
90
+ inline: {
91
+ classPropertyName: "inline",
92
+ publicName: "inline",
93
+ isSignal: true,
94
+ isRequired: false,
95
+ transformFunction: null
96
+ },
97
+ disabled: {
98
+ classPropertyName: "disabled",
99
+ publicName: "disabled",
100
+ isSignal: true,
101
+ isRequired: false,
102
+ transformFunction: null
103
+ },
104
+ invalid: {
105
+ classPropertyName: "invalid",
106
+ publicName: "invalid",
107
+ isSignal: true,
108
+ isRequired: false,
109
+ transformFunction: null
110
+ },
111
+ submit: {
112
+ classPropertyName: "submit",
113
+ publicName: "submit",
114
+ isSignal: true,
115
+ isRequired: false,
116
+ transformFunction: null
117
+ },
118
+ submitForm: {
119
+ classPropertyName: "submitForm",
120
+ publicName: "submitForm",
121
+ isSignal: true,
122
+ isRequired: false,
123
+ transformFunction: null
124
+ },
125
+ class: {
126
+ classPropertyName: "class",
127
+ publicName: "class",
128
+ isSignal: true,
129
+ isRequired: false,
130
+ transformFunction: null
131
+ }
132
+ },
133
+ outputs: { submitRequested: "submitRequested" },
134
+ host: { properties: {
135
+ "class": "classes()",
136
+ "attr.data-slot": "\"composer\"",
137
+ "attr.data-variant": "variant()",
138
+ "attr.data-inline": "inline() ? \"true\" : null",
139
+ "attr.data-disabled": "disabled() ? \"true\" : null",
140
+ "attr.aria-disabled": "disabled() ? \"true\" : null",
141
+ "attr.aria-invalid": "invalid() ? \"true\" : null",
142
+ "attr.inert": "disabled() ? \"\" : null"
143
+ } },
144
+ ngImport: i0,
145
+ template: `
82
146
  <div
83
147
  data-slot="composer-shell"
84
148
  [class]="shellClasses()"
@@ -93,23 +157,30 @@ class ComposerComponent {
93
157
  </div>
94
158
  <ng-content select="ComposerFooter" />
95
159
  </div>
96
- `, isInline: true });
97
- }
98
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerComponent, decorators: [{
99
- type: Component,
100
- args: [{
101
- selector: 'Composer',
102
- host: {
103
- '[class]': 'classes()',
104
- '[attr.data-slot]': '"composer"',
105
- '[attr.data-variant]': 'variant()',
106
- '[attr.data-inline]': 'inline() ? "true" : null',
107
- '[attr.data-disabled]': 'disabled() ? "true" : null',
108
- '[attr.aria-disabled]': 'disabled() ? "true" : null',
109
- '[attr.aria-invalid]': 'invalid() ? "true" : null',
110
- '[attr.inert]': 'disabled() ? "" : null',
111
- },
112
- template: `
160
+ `,
161
+ isInline: true
162
+ });
163
+ };
164
+ i0.ɵɵngDeclareClassMetadata({
165
+ minVersion: "12.0.0",
166
+ version: "22.2.0",
167
+ ngImport: i0,
168
+ type: ComposerComponent,
169
+ decorators: [{
170
+ type: Component,
171
+ args: [{
172
+ selector: "Composer",
173
+ host: {
174
+ "[class]": "classes()",
175
+ "[attr.data-slot]": "\"composer\"",
176
+ "[attr.data-variant]": "variant()",
177
+ "[attr.data-inline]": "inline() ? \"true\" : null",
178
+ "[attr.data-disabled]": "disabled() ? \"true\" : null",
179
+ "[attr.aria-disabled]": "disabled() ? \"true\" : null",
180
+ "[attr.aria-invalid]": "invalid() ? \"true\" : null",
181
+ "[attr.inert]": "disabled() ? \"\" : null"
182
+ },
183
+ template: `
113
184
  <div
114
185
  data-slot="composer-shell"
115
186
  [class]="shellClasses()"
@@ -124,240 +195,646 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
124
195
  </div>
125
196
  <ng-content select="ComposerFooter" />
126
197
  </div>
127
- `,
128
- }]
129
- }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], submit: [{ type: i0.Input, args: [{ isSignal: true, alias: "submit", required: false }] }], submitForm: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitForm", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], submitRequested: [{ type: i0.Output, args: ["submitRequested"] }] } });
130
- class ComposerHeaderComponent {
131
- class = input('', /* @ts-ignore */
132
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
133
- classes = computed(() => cn('flex min-w-0 flex-wrap gap-2 border-b border-[hsl(var(--border)/var(--opacity-70))] px-2.5 py-2', this.class()), /* @ts-ignore */
134
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
135
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
136
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: ComposerHeaderComponent, isStandalone: true, selector: "ComposerHeader", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-slot": "\"composer-header\"" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
137
- }
138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerHeaderComponent, decorators: [{
139
- type: Component,
140
- args: [{
141
- selector: 'ComposerHeader',
142
- host: {
143
- '[class]': 'classes()',
144
- '[attr.data-slot]': '"composer-header"',
145
- },
146
- template: `<ng-content />`,
147
- }]
148
- }], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
149
- class ComposerFooterComponent {
150
- class = input('', /* @ts-ignore */
151
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
152
- classes = computed(() => cn('border-t border-[hsl(var(--border)/var(--opacity-70))] px-2.5 py-1.5 text-xs leading-5 text-muted-foreground', this.class()), /* @ts-ignore */
153
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
154
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
155
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: ComposerFooterComponent, isStandalone: true, selector: "ComposerFooter", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-slot": "\"composer-footer\"" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
156
- }
157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerFooterComponent, decorators: [{
158
- type: Component,
159
- args: [{
160
- selector: 'ComposerFooter',
161
- host: {
162
- '[class]': 'classes()',
163
- '[attr.data-slot]': '"composer-footer"',
164
- },
165
- template: `<ng-content />`,
166
- }]
167
- }], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
168
- class ComposerActionsLeadingComponent {
169
- class = input('', /* @ts-ignore */
170
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
171
- classes = computed(() => cn('flex min-h-control-sm shrink-0 items-center gap-1', this.class()), /* @ts-ignore */
172
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
173
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerActionsLeadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
174
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: ComposerActionsLeadingComponent, isStandalone: true, selector: "ComposerActionsLeading", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-slot": "\"composer-actions-leading\"" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
175
- }
176
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerActionsLeadingComponent, decorators: [{
177
- type: Component,
178
- args: [{
179
- selector: 'ComposerActionsLeading',
180
- host: {
181
- '[class]': 'classes()',
182
- '[attr.data-slot]': '"composer-actions-leading"',
183
- },
184
- template: `<ng-content />`,
185
- }]
186
- }], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
187
- class ComposerActionsTrailingComponent {
188
- class = input('', /* @ts-ignore */
189
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
190
- classes = computed(() => cn('flex min-h-control-sm shrink-0 items-center justify-end gap-1', this.class()), /* @ts-ignore */
191
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
192
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerActionsTrailingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
193
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: ComposerActionsTrailingComponent, isStandalone: true, selector: "ComposerActionsTrailing", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-slot": "\"composer-actions-trailing\"" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
194
- }
195
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerActionsTrailingComponent, decorators: [{
196
- type: Component,
197
- args: [{
198
- selector: 'ComposerActionsTrailing',
199
- host: {
200
- '[class]': 'classes()',
201
- '[attr.data-slot]': '"composer-actions-trailing"',
202
- },
203
- template: `<ng-content />`,
204
- }]
205
- }], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
206
- class ComposerInputComponent {
207
- composer = inject(ComposerComponent, { optional: true });
208
- disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled', transform: booleanAttribute });
209
- invalidInput = input(false, { ...(ngDevMode ? { debugName: "invalidInput" } : /* istanbul ignore next */ {}), alias: 'aria-invalid', transform: booleanAttribute });
210
- class = input('', /* @ts-ignore */
211
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
212
- disabled = computed(() => this.disabledInput() || this.composer?.disabled() === true, /* @ts-ignore */
213
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
214
- invalid = computed(() => this.invalidInput() || this.composer?.invalid() === true, /* @ts-ignore */
215
- ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
216
- classes = computed(() => cn('min-h-control-10 w-full rounded-sm bg-transparent px-2 py-2 text-sm leading-6 outline-none', 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50', this.class()), /* @ts-ignore */
217
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
218
- // The key was typed INTO this slot, so this slot's disabled state is the one
219
- // that decides. Asking the parent `Composer` alone let a disabled slot inside
220
- // an enabled composer submit anyway, which is the very thing its disabled
221
- // state promises not to do. `disabled()` here already folds in the parent, so
222
- // both ways of turning the slot off are covered by one check.
223
- handleKeydown(event) {
224
- if (this.disabled()) {
225
- return;
226
- }
227
- this.composer?.handleInputKeydown(event);
228
- }
229
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
230
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: ComposerInputComponent, isStandalone: true, selector: "ComposerInput", inputs: { disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalidInput: { classPropertyName: "invalidInput", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "handleKeydown($event)" }, properties: { "class": "classes()", "attr.data-slot": "\"composer-input\"", "attr.data-disabled": "disabled() ? \"true\" : null", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.aria-invalid": "invalid() ? \"true\" : null" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
231
- }
232
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerInputComponent, decorators: [{
233
- type: Component,
234
- args: [{
235
- selector: 'ComposerInput',
236
- host: {
237
- '[class]': 'classes()',
238
- '[attr.data-slot]': '"composer-input"',
239
- '[attr.data-disabled]': 'disabled() ? "true" : null',
240
- '[attr.aria-disabled]': 'disabled() ? "true" : null',
241
- '[attr.aria-invalid]': 'invalid() ? "true" : null',
242
- '(keydown)': 'handleKeydown($event)',
243
- },
244
- template: `<ng-content />`,
245
- }]
246
- }], propDecorators: { disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalidInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
247
- class ComposerTextareaComponent {
248
- el = inject(ElementRef);
249
- composer = inject(ComposerComponent, { optional: true });
250
- rows = input(2, { ...(ngDevMode ? { debugName: "rows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
251
- maxRows = input(null, { ...(ngDevMode ? { debugName: "maxRows" } : /* istanbul ignore next */ {}), transform: nullableNumberAttribute });
252
- disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled', transform: booleanAttribute });
253
- invalidInput = input(false, { ...(ngDevMode ? { debugName: "invalidInput" } : /* istanbul ignore next */ {}), alias: 'aria-invalid', transform: booleanAttribute });
254
- class = input('', /* @ts-ignore */
255
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
256
- disabledState = signal(false, /* @ts-ignore */
257
- ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
258
- disabled = computed(() => this.disabledInput() || this.disabledState() || this.composer?.disabled() === true, /* @ts-ignore */
259
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
260
- invalid = computed(() => this.invalidInput() || this.composer?.invalid() === true, /* @ts-ignore */
261
- ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
262
- classes = computed(() => cn([
263
- 'max-h-none min-h-control-10 w-full resize-none bg-transparent px-2 py-2 text-sm leading-6 text-foreground shadow-none outline-none',
264
- 'placeholder:text-muted-foreground',
265
- 'disabled:cursor-not-allowed disabled:opacity-50',
266
- ].join(' '), this.class()), /* @ts-ignore */
267
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
268
- onChange = () => { };
269
- onTouched = () => { };
270
- ngAfterViewInit() {
271
- queueMicrotask(() => this.resizeToContent());
272
- }
273
- writeValue(value) {
274
- this.el.nativeElement.value = value ?? '';
275
- queueMicrotask(() => this.resizeToContent());
276
- }
277
- registerOnChange(fn) {
278
- this.onChange = fn;
279
- }
280
- registerOnTouched(fn) {
281
- this.onTouched = fn;
282
- }
283
- setDisabledState(isDisabled) {
284
- this.disabledState.set(isDisabled);
285
- }
286
- resizeToContent() {
287
- const textarea = this.el.nativeElement;
288
- textarea.style.height = 'auto';
289
- const maxRows = this.maxRows();
290
- if (!maxRows) {
291
- textarea.style.height = `${textarea.scrollHeight}px`;
292
- textarea.style.overflowY = 'hidden';
293
- return;
294
- }
295
- const lineHeight = this.getLineHeight(textarea);
296
- const maxHeight = lineHeight * Math.max(maxRows, this.rows());
297
- const nextHeight = Math.min(textarea.scrollHeight, maxHeight);
298
- textarea.style.height = `${nextHeight}px`;
299
- textarea.style.overflowY = textarea.scrollHeight > maxHeight ? 'auto' : 'hidden';
300
- }
301
- focus() {
302
- this.el.nativeElement.focus();
303
- }
304
- handleInput() {
305
- this.resizeToContent();
306
- this.onChange(this.el.nativeElement.value);
307
- }
308
- handleBlur() {
309
- this.onTouched();
310
- }
311
- // Same rule as the slot part: this textarea's own disabled state decides. A
312
- // native `disabled` textarea does not fire keydown in a browser, but one
313
- // disabled through a reactive control is reached by anything that dispatches
314
- // the event directly, and the guard costs nothing.
315
- handleKeydown(event) {
316
- if (this.disabled()) {
317
- return;
318
- }
319
- this.composer?.handleInputKeydown(event);
320
- }
321
- getLineHeight(textarea) {
322
- const lineHeight = Number.parseFloat(getComputedStyle(textarea).lineHeight);
323
- return Number.isFinite(lineHeight) ? lineHeight : 24;
324
- }
325
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
326
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: ComposerTextareaComponent, isStandalone: true, selector: "textarea[ComposerInput]", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalidInput: { classPropertyName: "invalidInput", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "handleInput()", "blur": "handleBlur()", "keydown": "handleKeydown($event)" }, properties: { "class": "classes()", "attr.data-slot": "\"composer-input\"", "attr.rows": "rows()", "attr.disabled": "disabled() ? \"\" : null", "attr.aria-invalid": "invalid() ? \"true\" : null" } }, providers: [
327
- {
328
- provide: NG_VALUE_ACCESSOR,
329
- useExisting: forwardRef(() => ComposerTextareaComponent),
330
- multi: true,
331
- },
332
- ], ngImport: i0, template: '', isInline: true });
333
- }
334
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ComposerTextareaComponent, decorators: [{
335
- type: Component,
336
- args: [{
337
- selector: 'textarea[ComposerInput]',
338
- providers: [
339
- {
340
- provide: NG_VALUE_ACCESSOR,
341
- useExisting: forwardRef(() => ComposerTextareaComponent),
342
- multi: true,
343
- },
344
- ],
345
- host: {
346
- '[class]': 'classes()',
347
- '[attr.data-slot]': '"composer-input"',
348
- '[attr.rows]': 'rows()',
349
- '[attr.disabled]': 'disabled() ? "" : null',
350
- '[attr.aria-invalid]': 'invalid() ? "true" : null',
351
- '(input)': 'handleInput()',
352
- '(blur)': 'handleBlur()',
353
- '(keydown)': 'handleKeydown($event)',
354
- },
355
- template: '',
356
- }]
357
- }], propDecorators: { rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], maxRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxRows", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalidInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
358
-
359
- /**
360
- * Generated bundle index. Do not edit.
361
- */
362
-
363
- export { ComposerActionsLeadingComponent, ComposerActionsTrailingComponent, ComposerComponent, ComposerFooterComponent, ComposerHeaderComponent, ComposerInputComponent, ComposerTextareaComponent };
198
+ `
199
+ }]
200
+ }],
201
+ propDecorators: {
202
+ variant: [{
203
+ type: i0.Input,
204
+ args: [{
205
+ isSignal: true,
206
+ alias: "variant",
207
+ required: false
208
+ }]
209
+ }],
210
+ inline: [{
211
+ type: i0.Input,
212
+ args: [{
213
+ isSignal: true,
214
+ alias: "inline",
215
+ required: false
216
+ }]
217
+ }],
218
+ disabled: [{
219
+ type: i0.Input,
220
+ args: [{
221
+ isSignal: true,
222
+ alias: "disabled",
223
+ required: false
224
+ }]
225
+ }],
226
+ invalid: [{
227
+ type: i0.Input,
228
+ args: [{
229
+ isSignal: true,
230
+ alias: "invalid",
231
+ required: false
232
+ }]
233
+ }],
234
+ submit: [{
235
+ type: i0.Input,
236
+ args: [{
237
+ isSignal: true,
238
+ alias: "submit",
239
+ required: false
240
+ }]
241
+ }],
242
+ submitForm: [{
243
+ type: i0.Input,
244
+ args: [{
245
+ isSignal: true,
246
+ alias: "submitForm",
247
+ required: false
248
+ }]
249
+ }],
250
+ class: [{
251
+ type: i0.Input,
252
+ args: [{
253
+ isSignal: true,
254
+ alias: "class",
255
+ required: false
256
+ }]
257
+ }],
258
+ submitRequested: [{
259
+ type: i0.Output,
260
+ args: ["submitRequested"]
261
+ }]
262
+ }
263
+ });
264
+ var ComposerHeaderComponent = class ComposerHeaderComponent {
265
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
266
+ classes = computed(() => cn("flex min-w-0 flex-wrap gap-2 border-b border-[hsl(var(--border)/var(--opacity-70))] px-2.5 py-2", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
267
+ static ɵfac = i0.ɵɵngDeclareFactory({
268
+ minVersion: "12.0.0",
269
+ version: "22.2.0",
270
+ ngImport: i0,
271
+ type: ComposerHeaderComponent,
272
+ deps: [],
273
+ target: i0.ɵɵFactoryTarget.Component
274
+ });
275
+ static ɵcmp = i0.ɵɵngDeclareComponent({
276
+ minVersion: "17.1.0",
277
+ version: "22.2.0",
278
+ type: ComposerHeaderComponent,
279
+ isStandalone: true,
280
+ selector: "ComposerHeader",
281
+ inputs: { class: {
282
+ classPropertyName: "class",
283
+ publicName: "class",
284
+ isSignal: true,
285
+ isRequired: false,
286
+ transformFunction: null
287
+ } },
288
+ host: { properties: {
289
+ "class": "classes()",
290
+ "attr.data-slot": "\"composer-header\""
291
+ } },
292
+ ngImport: i0,
293
+ template: `<ng-content />`,
294
+ isInline: true
295
+ });
296
+ };
297
+ i0.ɵɵngDeclareClassMetadata({
298
+ minVersion: "12.0.0",
299
+ version: "22.2.0",
300
+ ngImport: i0,
301
+ type: ComposerHeaderComponent,
302
+ decorators: [{
303
+ type: Component,
304
+ args: [{
305
+ selector: "ComposerHeader",
306
+ host: {
307
+ "[class]": "classes()",
308
+ "[attr.data-slot]": "\"composer-header\""
309
+ },
310
+ template: `<ng-content />`
311
+ }]
312
+ }],
313
+ propDecorators: { class: [{
314
+ type: i0.Input,
315
+ args: [{
316
+ isSignal: true,
317
+ alias: "class",
318
+ required: false
319
+ }]
320
+ }] }
321
+ });
322
+ var ComposerFooterComponent = class ComposerFooterComponent {
323
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
324
+ classes = computed(() => cn("border-t border-[hsl(var(--border)/var(--opacity-70))] px-2.5 py-1.5 text-xs leading-5 text-muted-foreground", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
325
+ static ɵfac = i0.ɵɵngDeclareFactory({
326
+ minVersion: "12.0.0",
327
+ version: "22.2.0",
328
+ ngImport: i0,
329
+ type: ComposerFooterComponent,
330
+ deps: [],
331
+ target: i0.ɵɵFactoryTarget.Component
332
+ });
333
+ static ɵcmp = i0.ɵɵngDeclareComponent({
334
+ minVersion: "17.1.0",
335
+ version: "22.2.0",
336
+ type: ComposerFooterComponent,
337
+ isStandalone: true,
338
+ selector: "ComposerFooter",
339
+ inputs: { class: {
340
+ classPropertyName: "class",
341
+ publicName: "class",
342
+ isSignal: true,
343
+ isRequired: false,
344
+ transformFunction: null
345
+ } },
346
+ host: { properties: {
347
+ "class": "classes()",
348
+ "attr.data-slot": "\"composer-footer\""
349
+ } },
350
+ ngImport: i0,
351
+ template: `<ng-content />`,
352
+ isInline: true
353
+ });
354
+ };
355
+ i0.ɵɵngDeclareClassMetadata({
356
+ minVersion: "12.0.0",
357
+ version: "22.2.0",
358
+ ngImport: i0,
359
+ type: ComposerFooterComponent,
360
+ decorators: [{
361
+ type: Component,
362
+ args: [{
363
+ selector: "ComposerFooter",
364
+ host: {
365
+ "[class]": "classes()",
366
+ "[attr.data-slot]": "\"composer-footer\""
367
+ },
368
+ template: `<ng-content />`
369
+ }]
370
+ }],
371
+ propDecorators: { class: [{
372
+ type: i0.Input,
373
+ args: [{
374
+ isSignal: true,
375
+ alias: "class",
376
+ required: false
377
+ }]
378
+ }] }
379
+ });
380
+ var ComposerActionsLeadingComponent = class ComposerActionsLeadingComponent {
381
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
382
+ classes = computed(() => cn("flex min-h-control-sm shrink-0 items-center gap-1", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
383
+ static ɵfac = i0.ɵɵngDeclareFactory({
384
+ minVersion: "12.0.0",
385
+ version: "22.2.0",
386
+ ngImport: i0,
387
+ type: ComposerActionsLeadingComponent,
388
+ deps: [],
389
+ target: i0.ɵɵFactoryTarget.Component
390
+ });
391
+ static ɵcmp = i0.ɵɵngDeclareComponent({
392
+ minVersion: "17.1.0",
393
+ version: "22.2.0",
394
+ type: ComposerActionsLeadingComponent,
395
+ isStandalone: true,
396
+ selector: "ComposerActionsLeading",
397
+ inputs: { class: {
398
+ classPropertyName: "class",
399
+ publicName: "class",
400
+ isSignal: true,
401
+ isRequired: false,
402
+ transformFunction: null
403
+ } },
404
+ host: { properties: {
405
+ "class": "classes()",
406
+ "attr.data-slot": "\"composer-actions-leading\""
407
+ } },
408
+ ngImport: i0,
409
+ template: `<ng-content />`,
410
+ isInline: true
411
+ });
412
+ };
413
+ i0.ɵɵngDeclareClassMetadata({
414
+ minVersion: "12.0.0",
415
+ version: "22.2.0",
416
+ ngImport: i0,
417
+ type: ComposerActionsLeadingComponent,
418
+ decorators: [{
419
+ type: Component,
420
+ args: [{
421
+ selector: "ComposerActionsLeading",
422
+ host: {
423
+ "[class]": "classes()",
424
+ "[attr.data-slot]": "\"composer-actions-leading\""
425
+ },
426
+ template: `<ng-content />`
427
+ }]
428
+ }],
429
+ propDecorators: { class: [{
430
+ type: i0.Input,
431
+ args: [{
432
+ isSignal: true,
433
+ alias: "class",
434
+ required: false
435
+ }]
436
+ }] }
437
+ });
438
+ var ComposerActionsTrailingComponent = class ComposerActionsTrailingComponent {
439
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
440
+ classes = computed(() => cn("flex min-h-control-sm shrink-0 items-center justify-end gap-1", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
441
+ static ɵfac = i0.ɵɵngDeclareFactory({
442
+ minVersion: "12.0.0",
443
+ version: "22.2.0",
444
+ ngImport: i0,
445
+ type: ComposerActionsTrailingComponent,
446
+ deps: [],
447
+ target: i0.ɵɵFactoryTarget.Component
448
+ });
449
+ static ɵcmp = i0.ɵɵngDeclareComponent({
450
+ minVersion: "17.1.0",
451
+ version: "22.2.0",
452
+ type: ComposerActionsTrailingComponent,
453
+ isStandalone: true,
454
+ selector: "ComposerActionsTrailing",
455
+ inputs: { class: {
456
+ classPropertyName: "class",
457
+ publicName: "class",
458
+ isSignal: true,
459
+ isRequired: false,
460
+ transformFunction: null
461
+ } },
462
+ host: { properties: {
463
+ "class": "classes()",
464
+ "attr.data-slot": "\"composer-actions-trailing\""
465
+ } },
466
+ ngImport: i0,
467
+ template: `<ng-content />`,
468
+ isInline: true
469
+ });
470
+ };
471
+ i0.ɵɵngDeclareClassMetadata({
472
+ minVersion: "12.0.0",
473
+ version: "22.2.0",
474
+ ngImport: i0,
475
+ type: ComposerActionsTrailingComponent,
476
+ decorators: [{
477
+ type: Component,
478
+ args: [{
479
+ selector: "ComposerActionsTrailing",
480
+ host: {
481
+ "[class]": "classes()",
482
+ "[attr.data-slot]": "\"composer-actions-trailing\""
483
+ },
484
+ template: `<ng-content />`
485
+ }]
486
+ }],
487
+ propDecorators: { class: [{
488
+ type: i0.Input,
489
+ args: [{
490
+ isSignal: true,
491
+ alias: "class",
492
+ required: false
493
+ }]
494
+ }] }
495
+ });
496
+ var ComposerInputComponent = class ComposerInputComponent {
497
+ composer = inject(ComposerComponent, { optional: true });
498
+ disabledInput = input(false, {
499
+ ...ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {},
500
+ alias: "disabled",
501
+ transform: booleanAttribute
502
+ });
503
+ invalidInput = input(false, {
504
+ ...ngDevMode ? { debugName: "invalidInput" } : /* istanbul ignore next */ {},
505
+ alias: "aria-invalid",
506
+ transform: booleanAttribute
507
+ });
508
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
509
+ disabled = computed(() => this.disabledInput() || this.composer?.disabled() === true, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
510
+ invalid = computed(() => this.invalidInput() || this.composer?.invalid() === true, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
511
+ classes = computed(() => cn("min-h-control-10 w-full rounded-sm bg-transparent px-2 py-2 text-sm leading-6 outline-none", "data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
512
+ handleKeydown(event) {
513
+ if (this.disabled()) return;
514
+ this.composer?.handleInputKeydown(event);
515
+ }
516
+ static ɵfac = i0.ɵɵngDeclareFactory({
517
+ minVersion: "12.0.0",
518
+ version: "22.2.0",
519
+ ngImport: i0,
520
+ type: ComposerInputComponent,
521
+ deps: [],
522
+ target: i0.ɵɵFactoryTarget.Component
523
+ });
524
+ static ɵcmp = i0.ɵɵngDeclareComponent({
525
+ minVersion: "17.1.0",
526
+ version: "22.2.0",
527
+ type: ComposerInputComponent,
528
+ isStandalone: true,
529
+ selector: "ComposerInput",
530
+ inputs: {
531
+ disabledInput: {
532
+ classPropertyName: "disabledInput",
533
+ publicName: "disabled",
534
+ isSignal: true,
535
+ isRequired: false,
536
+ transformFunction: null
537
+ },
538
+ invalidInput: {
539
+ classPropertyName: "invalidInput",
540
+ publicName: "aria-invalid",
541
+ isSignal: true,
542
+ isRequired: false,
543
+ transformFunction: null
544
+ },
545
+ class: {
546
+ classPropertyName: "class",
547
+ publicName: "class",
548
+ isSignal: true,
549
+ isRequired: false,
550
+ transformFunction: null
551
+ }
552
+ },
553
+ host: {
554
+ listeners: { "keydown": "handleKeydown($event)" },
555
+ properties: {
556
+ "class": "classes()",
557
+ "attr.data-slot": "\"composer-input\"",
558
+ "attr.data-disabled": "disabled() ? \"true\" : null",
559
+ "attr.aria-disabled": "disabled() ? \"true\" : null",
560
+ "attr.aria-invalid": "invalid() ? \"true\" : null"
561
+ }
562
+ },
563
+ ngImport: i0,
564
+ template: `<ng-content />`,
565
+ isInline: true
566
+ });
567
+ };
568
+ i0.ɵɵngDeclareClassMetadata({
569
+ minVersion: "12.0.0",
570
+ version: "22.2.0",
571
+ ngImport: i0,
572
+ type: ComposerInputComponent,
573
+ decorators: [{
574
+ type: Component,
575
+ args: [{
576
+ selector: "ComposerInput",
577
+ host: {
578
+ "[class]": "classes()",
579
+ "[attr.data-slot]": "\"composer-input\"",
580
+ "[attr.data-disabled]": "disabled() ? \"true\" : null",
581
+ "[attr.aria-disabled]": "disabled() ? \"true\" : null",
582
+ "[attr.aria-invalid]": "invalid() ? \"true\" : null",
583
+ "(keydown)": "handleKeydown($event)"
584
+ },
585
+ template: `<ng-content />`
586
+ }]
587
+ }],
588
+ propDecorators: {
589
+ disabledInput: [{
590
+ type: i0.Input,
591
+ args: [{
592
+ isSignal: true,
593
+ alias: "disabled",
594
+ required: false
595
+ }]
596
+ }],
597
+ invalidInput: [{
598
+ type: i0.Input,
599
+ args: [{
600
+ isSignal: true,
601
+ alias: "aria-invalid",
602
+ required: false
603
+ }]
604
+ }],
605
+ class: [{
606
+ type: i0.Input,
607
+ args: [{
608
+ isSignal: true,
609
+ alias: "class",
610
+ required: false
611
+ }]
612
+ }]
613
+ }
614
+ });
615
+ var ComposerTextareaComponent = class ComposerTextareaComponent {
616
+ el = inject(ElementRef);
617
+ composer = inject(ComposerComponent, { optional: true });
618
+ rows = input(2, {
619
+ ...ngDevMode ? { debugName: "rows" } : /* istanbul ignore next */ {},
620
+ transform: numberAttribute
621
+ });
622
+ maxRows = input(null, {
623
+ ...ngDevMode ? { debugName: "maxRows" } : /* istanbul ignore next */ {},
624
+ transform: nullableNumberAttribute
625
+ });
626
+ disabledInput = input(false, {
627
+ ...ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {},
628
+ alias: "disabled",
629
+ transform: booleanAttribute
630
+ });
631
+ invalidInput = input(false, {
632
+ ...ngDevMode ? { debugName: "invalidInput" } : /* istanbul ignore next */ {},
633
+ alias: "aria-invalid",
634
+ transform: booleanAttribute
635
+ });
636
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
637
+ disabledState = signal(false, ...ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []);
638
+ disabled = computed(() => this.disabledInput() || this.disabledState() || this.composer?.disabled() === true, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
639
+ invalid = computed(() => this.invalidInput() || this.composer?.invalid() === true, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
640
+ classes = computed(() => cn([
641
+ "max-h-none min-h-control-10 w-full resize-none bg-transparent px-2 py-2 text-sm leading-6 text-foreground shadow-none outline-none",
642
+ "placeholder:text-muted-foreground",
643
+ "disabled:cursor-not-allowed disabled:opacity-50"
644
+ ].join(" "), this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
645
+ onChange = () => {};
646
+ onTouched = () => {};
647
+ ngAfterViewInit() {
648
+ queueMicrotask(() => this.resizeToContent());
649
+ }
650
+ writeValue(value) {
651
+ this.el.nativeElement.value = value ?? "";
652
+ queueMicrotask(() => this.resizeToContent());
653
+ }
654
+ registerOnChange(fn) {
655
+ this.onChange = fn;
656
+ }
657
+ registerOnTouched(fn) {
658
+ this.onTouched = fn;
659
+ }
660
+ setDisabledState(isDisabled) {
661
+ this.disabledState.set(isDisabled);
662
+ }
663
+ resizeToContent() {
664
+ const textarea = this.el.nativeElement;
665
+ textarea.style.height = "auto";
666
+ const maxRows = this.maxRows();
667
+ if (!maxRows) {
668
+ textarea.style.height = `${textarea.scrollHeight}px`;
669
+ textarea.style.overflowY = "hidden";
670
+ return;
671
+ }
672
+ const maxHeight = this.getLineHeight(textarea) * Math.max(maxRows, this.rows());
673
+ const nextHeight = Math.min(textarea.scrollHeight, maxHeight);
674
+ textarea.style.height = `${nextHeight}px`;
675
+ textarea.style.overflowY = textarea.scrollHeight > maxHeight ? "auto" : "hidden";
676
+ }
677
+ focus() {
678
+ this.el.nativeElement.focus();
679
+ }
680
+ handleInput() {
681
+ this.resizeToContent();
682
+ this.onChange(this.el.nativeElement.value);
683
+ }
684
+ handleBlur() {
685
+ this.onTouched();
686
+ }
687
+ handleKeydown(event) {
688
+ if (this.disabled()) return;
689
+ this.composer?.handleInputKeydown(event);
690
+ }
691
+ getLineHeight(textarea) {
692
+ const lineHeight = Number.parseFloat(getComputedStyle(textarea).lineHeight);
693
+ return Number.isFinite(lineHeight) ? lineHeight : 24;
694
+ }
695
+ static ɵfac = i0.ɵɵngDeclareFactory({
696
+ minVersion: "12.0.0",
697
+ version: "22.2.0",
698
+ ngImport: i0,
699
+ type: ComposerTextareaComponent,
700
+ deps: [],
701
+ target: i0.ɵɵFactoryTarget.Component
702
+ });
703
+ static ɵcmp = i0.ɵɵngDeclareComponent({
704
+ minVersion: "17.1.0",
705
+ version: "22.2.0",
706
+ type: ComposerTextareaComponent,
707
+ isStandalone: true,
708
+ selector: "textarea[ComposerInput]",
709
+ inputs: {
710
+ rows: {
711
+ classPropertyName: "rows",
712
+ publicName: "rows",
713
+ isSignal: true,
714
+ isRequired: false,
715
+ transformFunction: null
716
+ },
717
+ maxRows: {
718
+ classPropertyName: "maxRows",
719
+ publicName: "maxRows",
720
+ isSignal: true,
721
+ isRequired: false,
722
+ transformFunction: null
723
+ },
724
+ disabledInput: {
725
+ classPropertyName: "disabledInput",
726
+ publicName: "disabled",
727
+ isSignal: true,
728
+ isRequired: false,
729
+ transformFunction: null
730
+ },
731
+ invalidInput: {
732
+ classPropertyName: "invalidInput",
733
+ publicName: "aria-invalid",
734
+ isSignal: true,
735
+ isRequired: false,
736
+ transformFunction: null
737
+ },
738
+ class: {
739
+ classPropertyName: "class",
740
+ publicName: "class",
741
+ isSignal: true,
742
+ isRequired: false,
743
+ transformFunction: null
744
+ }
745
+ },
746
+ host: {
747
+ listeners: {
748
+ "input": "handleInput()",
749
+ "blur": "handleBlur()",
750
+ "keydown": "handleKeydown($event)"
751
+ },
752
+ properties: {
753
+ "class": "classes()",
754
+ "attr.data-slot": "\"composer-input\"",
755
+ "attr.rows": "rows()",
756
+ "attr.disabled": "disabled() ? \"\" : null",
757
+ "attr.aria-invalid": "invalid() ? \"true\" : null"
758
+ }
759
+ },
760
+ providers: [{
761
+ provide: NG_VALUE_ACCESSOR,
762
+ useExisting: forwardRef(() => ComposerTextareaComponent),
763
+ multi: true
764
+ }],
765
+ ngImport: i0,
766
+ template: "",
767
+ isInline: true
768
+ });
769
+ };
770
+ i0.ɵɵngDeclareClassMetadata({
771
+ minVersion: "12.0.0",
772
+ version: "22.2.0",
773
+ ngImport: i0,
774
+ type: ComposerTextareaComponent,
775
+ decorators: [{
776
+ type: Component,
777
+ args: [{
778
+ selector: "textarea[ComposerInput]",
779
+ providers: [{
780
+ provide: NG_VALUE_ACCESSOR,
781
+ useExisting: forwardRef(() => ComposerTextareaComponent),
782
+ multi: true
783
+ }],
784
+ host: {
785
+ "[class]": "classes()",
786
+ "[attr.data-slot]": "\"composer-input\"",
787
+ "[attr.rows]": "rows()",
788
+ "[attr.disabled]": "disabled() ? \"\" : null",
789
+ "[attr.aria-invalid]": "invalid() ? \"true\" : null",
790
+ "(input)": "handleInput()",
791
+ "(blur)": "handleBlur()",
792
+ "(keydown)": "handleKeydown($event)"
793
+ },
794
+ template: ""
795
+ }]
796
+ }],
797
+ propDecorators: {
798
+ rows: [{
799
+ type: i0.Input,
800
+ args: [{
801
+ isSignal: true,
802
+ alias: "rows",
803
+ required: false
804
+ }]
805
+ }],
806
+ maxRows: [{
807
+ type: i0.Input,
808
+ args: [{
809
+ isSignal: true,
810
+ alias: "maxRows",
811
+ required: false
812
+ }]
813
+ }],
814
+ disabledInput: [{
815
+ type: i0.Input,
816
+ args: [{
817
+ isSignal: true,
818
+ alias: "disabled",
819
+ required: false
820
+ }]
821
+ }],
822
+ invalidInput: [{
823
+ type: i0.Input,
824
+ args: [{
825
+ isSignal: true,
826
+ alias: "aria-invalid",
827
+ required: false
828
+ }]
829
+ }],
830
+ class: [{
831
+ type: i0.Input,
832
+ args: [{
833
+ isSignal: true,
834
+ alias: "class",
835
+ required: false
836
+ }]
837
+ }]
838
+ }
839
+ });
840
+ export { ComposerActionsLeadingComponent, ComposerActionsTrailingComponent, ComposerComponent, ComposerFooterComponent, ComposerHeaderComponent, ComposerInputComponent, ComposerTextareaComponent };