@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,92 +1,184 @@
1
- import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, TemplateRef, Directive, ElementRef, contentChild, input, booleanAttribute, output, computed, Component, numberAttribute, DestroyRef, signal, viewChild, contentChildren, forwardRef } from '@angular/core';
4
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
5
- import { cn, injectUniqueId } from '@ojiepermana/angular/component/utils/core';
6
-
7
- /**
8
- * What roving focus needs from one option, whichever kind of option it is.
9
- *
10
- * `Pillbox` renders two things with `role="option"` into the same listbox -- a
11
- * value option and the "create" affordance -- and a listbox owes exactly one tab
12
- * stop across all of them. Both kinds implement this, so the roving model can
13
- * treat them as one ordered list without caring which is which.
14
- */
15
- class PillboxRovingOption {
16
- }
17
- class PillboxContext {
18
- }
19
-
20
- class PillboxSelectedDirective {
21
- template = inject(TemplateRef);
22
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxSelectedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
23
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: PillboxSelectedDirective, isStandalone: true, selector: "ng-template[PillboxSelected]", exportAs: ["PillboxSelected"], ngImport: i0 });
24
- }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxSelectedDirective, decorators: [{
26
- type: Directive,
27
- args: [{
28
- selector: 'ng-template[PillboxSelected]',
29
- exportAs: 'PillboxSelected',
30
- }]
31
- }] });
32
- class PillboxOptionComponent extends PillboxRovingOption {
33
- context = inject(PillboxContext);
34
- element = inject(ElementRef);
35
- selectedTemplate = contentChild(PillboxSelectedDirective, /* @ts-ignore */
36
- ...(ngDevMode ? [{ debugName: "selectedTemplate" }] : /* istanbul ignore next */ []));
37
- value = input.required(/* @ts-ignore */
38
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
39
- label = input('', /* @ts-ignore */
40
- ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
41
- selectedLabel = input('', /* @ts-ignore */
42
- ...(ngDevMode ? [{ debugName: "selectedLabel" }] : /* istanbul ignore next */ []));
43
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
44
- filterable = input(true, { ...(ngDevMode ? { debugName: "filterable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
45
- class = input('', /* @ts-ignore */
46
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
47
- selectedChange = output();
48
- selected = computed(() => this.context.optionSelected(this), /* @ts-ignore */
49
- ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
50
- visible = computed(() => this.context.optionVisible(this), /* @ts-ignore */
51
- ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
52
- tabIndex = computed(() => this.context.optionTabIndex(this), /* @ts-ignore */
53
- ...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
54
- classes = computed(() => cn('relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors', 'hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground', 'data-[selected]:bg-accent data-[selected]:text-accent-foreground', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', this.class()), /* @ts-ignore */
55
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
56
- rovingVisible() {
57
- return this.visible();
58
- }
59
- nativeElement() {
60
- return this.element.nativeElement;
61
- }
62
- focus() {
63
- this.element.nativeElement.focus();
64
- }
65
- textLabel() {
66
- return (this.label() || this.element.nativeElement.textContent || String(this.value())).trim();
67
- }
68
- pillLabel() {
69
- return (this.selectedLabel() || this.textLabel()).trim();
70
- }
71
- pillTemplate() {
72
- return this.selectedTemplate()?.template ?? null;
73
- }
74
- handleClick(event) {
75
- this.context.chooseOption(this, event);
76
- }
77
- handleFocus() {
78
- this.context.activateOption(this);
79
- }
80
- handleKeydown(event) {
81
- if (event.key === 'Enter' || event.key === ' ') {
82
- event.preventDefault();
83
- this.context.chooseOption(this, event);
84
- return;
85
- }
86
- this.context.handleOptionKeydown(this, event);
87
- }
88
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxOptionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
89
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: PillboxOptionComponent, isStandalone: true, selector: "PillboxOption, button[PillboxOption]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, selectedLabel: { classPropertyName: "selectedLabel", publicName: "selectedLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, host: { attributes: { "type": "button" }, listeners: { "click": "handleClick($event)", "focus": "handleFocus()", "keydown": "handleKeydown($any($event))" }, properties: { "class": "classes()", "attr.data-slot": "\"pillbox-option\"", "attr.data-selected": "selected() ? \"\" : null", "attr.data-disabled": "disabled() ? \"\" : null", "attr.role": "\"option\"", "attr.aria-selected": "selected()", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.tabindex": "tabIndex()", "hidden": "!visible()" } }, queries: [{ propertyName: "selectedTemplate", first: true, predicate: PillboxSelectedDirective, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
1
+ import { DOCUMENT, NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, DestroyRef, Directive, ElementRef, TemplateRef, booleanAttribute, computed, contentChild, contentChildren, forwardRef, inject, input, numberAttribute, output, signal, viewChild } from "@angular/core";
4
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
5
+ import { cn, injectUniqueId } from "@ojiepermana/angular/component/utils/core";
6
+ var PillboxRovingOption = class {};
7
+ var PillboxContext = class {};
8
+ var PillboxSelectedDirective = class PillboxSelectedDirective {
9
+ template = inject(TemplateRef);
10
+ static ɵfac = i0.ɵɵngDeclareFactory({
11
+ minVersion: "12.0.0",
12
+ version: "22.2.0",
13
+ ngImport: i0,
14
+ type: PillboxSelectedDirective,
15
+ deps: [],
16
+ target: i0.ɵɵFactoryTarget.Directive
17
+ });
18
+ static ɵdir = i0.ɵɵngDeclareDirective({
19
+ minVersion: "14.0.0",
20
+ version: "22.2.0",
21
+ type: PillboxSelectedDirective,
22
+ isStandalone: true,
23
+ selector: "ng-template[PillboxSelected]",
24
+ exportAs: ["PillboxSelected"],
25
+ ngImport: i0
26
+ });
27
+ };
28
+ i0.ɵɵngDeclareClassMetadata({
29
+ minVersion: "12.0.0",
30
+ version: "22.2.0",
31
+ ngImport: i0,
32
+ type: PillboxSelectedDirective,
33
+ decorators: [{
34
+ type: Directive,
35
+ args: [{
36
+ selector: "ng-template[PillboxSelected]",
37
+ exportAs: "PillboxSelected"
38
+ }]
39
+ }]
40
+ });
41
+ var PillboxOptionComponent = class PillboxOptionComponent extends PillboxRovingOption {
42
+ context = inject(PillboxContext);
43
+ element = inject(ElementRef);
44
+ selectedTemplate = contentChild(PillboxSelectedDirective, ...ngDevMode ? [{ debugName: "selectedTemplate" }] : /* istanbul ignore next */ []);
45
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
46
+ label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
47
+ selectedLabel = input("", ...ngDevMode ? [{ debugName: "selectedLabel" }] : /* istanbul ignore next */ []);
48
+ disabled = input(false, {
49
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
50
+ transform: booleanAttribute
51
+ });
52
+ filterable = input(true, {
53
+ ...ngDevMode ? { debugName: "filterable" } : /* istanbul ignore next */ {},
54
+ transform: booleanAttribute
55
+ });
56
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
57
+ selectedChange = output();
58
+ selected = computed(() => this.context.optionSelected(this), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
59
+ visible = computed(() => this.context.optionVisible(this), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
60
+ tabIndex = computed(() => this.context.optionTabIndex(this), ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
61
+ classes = computed(() => cn("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors", "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground", "data-[selected]:bg-accent data-[selected]:text-accent-foreground", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
62
+ rovingVisible() {
63
+ return this.visible();
64
+ }
65
+ nativeElement() {
66
+ return this.element.nativeElement;
67
+ }
68
+ focus() {
69
+ this.element.nativeElement.focus();
70
+ }
71
+ textLabel() {
72
+ return (this.label() || this.element.nativeElement.textContent || String(this.value())).trim();
73
+ }
74
+ pillLabel() {
75
+ return (this.selectedLabel() || this.textLabel()).trim();
76
+ }
77
+ pillTemplate() {
78
+ return this.selectedTemplate()?.template ?? null;
79
+ }
80
+ handleClick(event) {
81
+ this.context.chooseOption(this, event);
82
+ }
83
+ handleFocus() {
84
+ this.context.activateOption(this);
85
+ }
86
+ handleKeydown(event) {
87
+ if (event.key === "Enter" || event.key === " ") {
88
+ event.preventDefault();
89
+ this.context.chooseOption(this, event);
90
+ return;
91
+ }
92
+ this.context.handleOptionKeydown(this, event);
93
+ }
94
+ static ɵfac = i0.ɵɵngDeclareFactory({
95
+ minVersion: "12.0.0",
96
+ version: "22.2.0",
97
+ ngImport: i0,
98
+ type: PillboxOptionComponent,
99
+ deps: null,
100
+ target: i0.ɵɵFactoryTarget.Component
101
+ });
102
+ static ɵcmp = i0.ɵɵngDeclareComponent({
103
+ minVersion: "17.0.0",
104
+ version: "22.2.0",
105
+ type: PillboxOptionComponent,
106
+ isStandalone: true,
107
+ selector: "PillboxOption, button[PillboxOption]",
108
+ inputs: {
109
+ value: {
110
+ classPropertyName: "value",
111
+ publicName: "value",
112
+ isSignal: true,
113
+ isRequired: true,
114
+ transformFunction: null
115
+ },
116
+ label: {
117
+ classPropertyName: "label",
118
+ publicName: "label",
119
+ isSignal: true,
120
+ isRequired: false,
121
+ transformFunction: null
122
+ },
123
+ selectedLabel: {
124
+ classPropertyName: "selectedLabel",
125
+ publicName: "selectedLabel",
126
+ isSignal: true,
127
+ isRequired: false,
128
+ transformFunction: null
129
+ },
130
+ disabled: {
131
+ classPropertyName: "disabled",
132
+ publicName: "disabled",
133
+ isSignal: true,
134
+ isRequired: false,
135
+ transformFunction: null
136
+ },
137
+ filterable: {
138
+ classPropertyName: "filterable",
139
+ publicName: "filterable",
140
+ isSignal: true,
141
+ isRequired: false,
142
+ transformFunction: null
143
+ },
144
+ class: {
145
+ classPropertyName: "class",
146
+ publicName: "class",
147
+ isSignal: true,
148
+ isRequired: false,
149
+ transformFunction: null
150
+ }
151
+ },
152
+ outputs: { selectedChange: "selectedChange" },
153
+ host: {
154
+ attributes: { "type": "button" },
155
+ listeners: {
156
+ "click": "handleClick($event)",
157
+ "focus": "handleFocus()",
158
+ "keydown": "handleKeydown($any($event))"
159
+ },
160
+ properties: {
161
+ "class": "classes()",
162
+ "attr.data-slot": "\"pillbox-option\"",
163
+ "attr.data-selected": "selected() ? \"\" : null",
164
+ "attr.data-disabled": "disabled() ? \"\" : null",
165
+ "attr.role": "\"option\"",
166
+ "attr.aria-selected": "selected()",
167
+ "attr.aria-disabled": "disabled() ? \"true\" : null",
168
+ "attr.tabindex": "tabIndex()",
169
+ "hidden": "!visible()"
170
+ }
171
+ },
172
+ queries: [{
173
+ propertyName: "selectedTemplate",
174
+ first: true,
175
+ predicate: PillboxSelectedDirective,
176
+ descendants: true,
177
+ isSignal: true
178
+ }],
179
+ usesInheritance: true,
180
+ ngImport: i0,
181
+ template: `
90
182
  <span class="min-w-0 flex-1 truncate text-left"><ng-content /></span>
91
183
  @if (selected()) {
92
184
  <svg
@@ -102,28 +194,35 @@ class PillboxOptionComponent extends PillboxRovingOption {
102
194
  <path d="M20 6 9 17l-5-5" />
103
195
  </svg>
104
196
  }
105
- `, isInline: true });
106
- }
107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxOptionComponent, decorators: [{
108
- type: Component,
109
- args: [{
110
- selector: 'PillboxOption, button[PillboxOption]',
111
- host: {
112
- type: 'button',
113
- '[class]': 'classes()',
114
- '[attr.data-slot]': '"pillbox-option"',
115
- '[attr.data-selected]': 'selected() ? "" : null',
116
- '[attr.data-disabled]': 'disabled() ? "" : null',
117
- '[attr.role]': '"option"',
118
- '[attr.aria-selected]': 'selected()',
119
- '[attr.aria-disabled]': 'disabled() ? "true" : null',
120
- '[attr.tabindex]': 'tabIndex()',
121
- '[hidden]': '!visible()',
122
- '(click)': 'handleClick($event)',
123
- '(focus)': 'handleFocus()',
124
- '(keydown)': 'handleKeydown($any($event))',
125
- },
126
- template: `
197
+ `,
198
+ isInline: true
199
+ });
200
+ };
201
+ i0.ɵɵngDeclareClassMetadata({
202
+ minVersion: "12.0.0",
203
+ version: "22.2.0",
204
+ ngImport: i0,
205
+ type: PillboxOptionComponent,
206
+ decorators: [{
207
+ type: Component,
208
+ args: [{
209
+ selector: "PillboxOption, button[PillboxOption]",
210
+ host: {
211
+ type: "button",
212
+ "[class]": "classes()",
213
+ "[attr.data-slot]": "\"pillbox-option\"",
214
+ "[attr.data-selected]": "selected() ? \"\" : null",
215
+ "[attr.data-disabled]": "disabled() ? \"\" : null",
216
+ "[attr.role]": "\"option\"",
217
+ "[attr.aria-selected]": "selected()",
218
+ "[attr.aria-disabled]": "disabled() ? \"true\" : null",
219
+ "[attr.tabindex]": "tabIndex()",
220
+ "[hidden]": "!visible()",
221
+ "(click)": "handleClick($event)",
222
+ "(focus)": "handleFocus()",
223
+ "(keydown)": "handleKeydown($any($event))"
224
+ },
225
+ template: `
127
226
  <span class="min-w-0 flex-1 truncate text-left"><ng-content /></span>
128
227
  @if (selected()) {
129
228
  <svg
@@ -139,484 +238,844 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
139
238
  <path d="M20 6 9 17l-5-5" />
140
239
  </svg>
141
240
  }
142
- `,
143
- }]
144
- }], propDecorators: { selectedTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PillboxSelectedDirective), { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], selectedLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedLabel", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }] } });
145
- class PillboxOptionCreateComponent extends PillboxRovingOption {
146
- context = inject(PillboxContext);
147
- element = inject(ElementRef);
148
- minLength = input(1, { ...(ngDevMode ? { debugName: "minLength" } : /* istanbul ignore next */ {}), transform: numberAttribute });
149
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
150
- class = input('', /* @ts-ignore */
151
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
152
- selected = output();
153
- visible = computed(() => this.context.createVisible(this), /* @ts-ignore */
154
- ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
155
- tabIndex = computed(() => this.context.optionTabIndex(this), /* @ts-ignore */
156
- ...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
157
- classes = computed(() => cn('relative flex w-full cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium text-primary outline-none transition-colors', 'hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground', 'aria-disabled:pointer-events-none aria-disabled:opacity-50', this.class()), /* @ts-ignore */
158
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
159
- rovingVisible() {
160
- return this.visible();
161
- }
162
- nativeElement() {
163
- return this.element.nativeElement;
164
- }
165
- focus() {
166
- this.element.nativeElement.focus();
167
- }
168
- handleClick(event) {
169
- this.context.chooseCreate(this, event);
170
- }
171
- handleFocus() {
172
- this.context.activateOption(this);
173
- }
174
- handleKeydown(event) {
175
- if (event.key === 'Enter' || event.key === ' ') {
176
- event.preventDefault();
177
- this.context.chooseCreate(this, event);
178
- return;
179
- }
180
- this.context.handleOptionKeydown(this, event);
181
- }
182
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxOptionCreateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
183
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: PillboxOptionCreateComponent, isStandalone: true, selector: "PillboxOptionCreate, button[PillboxOptionCreate]", inputs: { minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, host: { attributes: { "type": "button" }, listeners: { "click": "handleClick($event)", "focus": "handleFocus()", "keydown": "handleKeydown($any($event))" }, properties: { "class": "classes()", "attr.data-slot": "\"pillbox-option-create\"", "attr.role": "\"option\"", "attr.tabindex": "tabIndex()", "attr.aria-disabled": "disabled() ? \"true\" : null", "hidden": "!visible()" } }, usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true });
184
- }
185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxOptionCreateComponent, decorators: [{
186
- type: Component,
187
- args: [{
188
- selector: 'PillboxOptionCreate, button[PillboxOptionCreate]',
189
- host: {
190
- type: 'button',
191
- '[class]': 'classes()',
192
- '[attr.data-slot]': '"pillbox-option-create"',
193
- '[attr.role]': '"option"',
194
- '[attr.tabindex]': 'tabIndex()',
195
- '[attr.aria-disabled]': 'disabled() ? "true" : null',
196
- '[hidden]': '!visible()',
197
- '(click)': 'handleClick($event)',
198
- '(focus)': 'handleFocus()',
199
- '(keydown)': 'handleKeydown($any($event))',
200
- },
201
- template: `<ng-content />`,
202
- }]
203
- }], propDecorators: { minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] } });
204
- class PillboxOptionEmptyComponent {
205
- context = inject(PillboxContext);
206
- whenLoading = input('', /* @ts-ignore */
207
- ...(ngDevMode ? [{ debugName: "whenLoading" }] : /* istanbul ignore next */ []));
208
- class = input('', /* @ts-ignore */
209
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
210
- classes = computed(() => cn('px-2 py-6 text-center text-sm text-muted-foreground', this.class()), /* @ts-ignore */
211
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
212
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxOptionEmptyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
213
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: PillboxOptionEmptyComponent, isStandalone: true, selector: "PillboxOptionEmpty", inputs: { whenLoading: { classPropertyName: "whenLoading", publicName: "whenLoading", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "presentation" }, properties: { "class": "classes()", "attr.data-slot": "\"pillbox-option-empty\"", "hidden": "!context.emptyVisible()" } }, ngImport: i0, template: `
241
+ `
242
+ }]
243
+ }],
244
+ propDecorators: {
245
+ selectedTemplate: [{
246
+ type: i0.ContentChild,
247
+ args: [i0.forwardRef(() => PillboxSelectedDirective), { isSignal: true }]
248
+ }],
249
+ value: [{
250
+ type: i0.Input,
251
+ args: [{
252
+ isSignal: true,
253
+ alias: "value",
254
+ required: true
255
+ }]
256
+ }],
257
+ label: [{
258
+ type: i0.Input,
259
+ args: [{
260
+ isSignal: true,
261
+ alias: "label",
262
+ required: false
263
+ }]
264
+ }],
265
+ selectedLabel: [{
266
+ type: i0.Input,
267
+ args: [{
268
+ isSignal: true,
269
+ alias: "selectedLabel",
270
+ required: false
271
+ }]
272
+ }],
273
+ disabled: [{
274
+ type: i0.Input,
275
+ args: [{
276
+ isSignal: true,
277
+ alias: "disabled",
278
+ required: false
279
+ }]
280
+ }],
281
+ filterable: [{
282
+ type: i0.Input,
283
+ args: [{
284
+ isSignal: true,
285
+ alias: "filterable",
286
+ required: false
287
+ }]
288
+ }],
289
+ class: [{
290
+ type: i0.Input,
291
+ args: [{
292
+ isSignal: true,
293
+ alias: "class",
294
+ required: false
295
+ }]
296
+ }],
297
+ selectedChange: [{
298
+ type: i0.Output,
299
+ args: ["selectedChange"]
300
+ }]
301
+ }
302
+ });
303
+ var PillboxOptionCreateComponent = class PillboxOptionCreateComponent extends PillboxRovingOption {
304
+ context = inject(PillboxContext);
305
+ element = inject(ElementRef);
306
+ minLength = input(1, {
307
+ ...ngDevMode ? { debugName: "minLength" } : /* istanbul ignore next */ {},
308
+ transform: numberAttribute
309
+ });
310
+ disabled = input(false, {
311
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
312
+ transform: booleanAttribute
313
+ });
314
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
315
+ selected = output();
316
+ visible = computed(() => this.context.createVisible(this), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
317
+ tabIndex = computed(() => this.context.optionTabIndex(this), ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
318
+ classes = computed(() => cn("relative flex w-full cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium text-primary outline-none transition-colors", "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground", "aria-disabled:pointer-events-none aria-disabled:opacity-50", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
319
+ rovingVisible() {
320
+ return this.visible();
321
+ }
322
+ nativeElement() {
323
+ return this.element.nativeElement;
324
+ }
325
+ focus() {
326
+ this.element.nativeElement.focus();
327
+ }
328
+ handleClick(event) {
329
+ this.context.chooseCreate(this, event);
330
+ }
331
+ handleFocus() {
332
+ this.context.activateOption(this);
333
+ }
334
+ handleKeydown(event) {
335
+ if (event.key === "Enter" || event.key === " ") {
336
+ event.preventDefault();
337
+ this.context.chooseCreate(this, event);
338
+ return;
339
+ }
340
+ this.context.handleOptionKeydown(this, event);
341
+ }
342
+ static ɵfac = i0.ɵɵngDeclareFactory({
343
+ minVersion: "12.0.0",
344
+ version: "22.2.0",
345
+ ngImport: i0,
346
+ type: PillboxOptionCreateComponent,
347
+ deps: null,
348
+ target: i0.ɵɵFactoryTarget.Component
349
+ });
350
+ static ɵcmp = i0.ɵɵngDeclareComponent({
351
+ minVersion: "17.1.0",
352
+ version: "22.2.0",
353
+ type: PillboxOptionCreateComponent,
354
+ isStandalone: true,
355
+ selector: "PillboxOptionCreate, button[PillboxOptionCreate]",
356
+ inputs: {
357
+ minLength: {
358
+ classPropertyName: "minLength",
359
+ publicName: "minLength",
360
+ isSignal: true,
361
+ isRequired: false,
362
+ transformFunction: null
363
+ },
364
+ disabled: {
365
+ classPropertyName: "disabled",
366
+ publicName: "disabled",
367
+ isSignal: true,
368
+ isRequired: false,
369
+ transformFunction: null
370
+ },
371
+ class: {
372
+ classPropertyName: "class",
373
+ publicName: "class",
374
+ isSignal: true,
375
+ isRequired: false,
376
+ transformFunction: null
377
+ }
378
+ },
379
+ outputs: { selected: "selected" },
380
+ host: {
381
+ attributes: { "type": "button" },
382
+ listeners: {
383
+ "click": "handleClick($event)",
384
+ "focus": "handleFocus()",
385
+ "keydown": "handleKeydown($any($event))"
386
+ },
387
+ properties: {
388
+ "class": "classes()",
389
+ "attr.data-slot": "\"pillbox-option-create\"",
390
+ "attr.role": "\"option\"",
391
+ "attr.tabindex": "tabIndex()",
392
+ "attr.aria-disabled": "disabled() ? \"true\" : null",
393
+ "hidden": "!visible()"
394
+ }
395
+ },
396
+ usesInheritance: true,
397
+ ngImport: i0,
398
+ template: `<ng-content />`,
399
+ isInline: true
400
+ });
401
+ };
402
+ i0.ɵɵngDeclareClassMetadata({
403
+ minVersion: "12.0.0",
404
+ version: "22.2.0",
405
+ ngImport: i0,
406
+ type: PillboxOptionCreateComponent,
407
+ decorators: [{
408
+ type: Component,
409
+ args: [{
410
+ selector: "PillboxOptionCreate, button[PillboxOptionCreate]",
411
+ host: {
412
+ type: "button",
413
+ "[class]": "classes()",
414
+ "[attr.data-slot]": "\"pillbox-option-create\"",
415
+ "[attr.role]": "\"option\"",
416
+ "[attr.tabindex]": "tabIndex()",
417
+ "[attr.aria-disabled]": "disabled() ? \"true\" : null",
418
+ "[hidden]": "!visible()",
419
+ "(click)": "handleClick($event)",
420
+ "(focus)": "handleFocus()",
421
+ "(keydown)": "handleKeydown($any($event))"
422
+ },
423
+ template: `<ng-content />`
424
+ }]
425
+ }],
426
+ propDecorators: {
427
+ minLength: [{
428
+ type: i0.Input,
429
+ args: [{
430
+ isSignal: true,
431
+ alias: "minLength",
432
+ required: false
433
+ }]
434
+ }],
435
+ disabled: [{
436
+ type: i0.Input,
437
+ args: [{
438
+ isSignal: true,
439
+ alias: "disabled",
440
+ required: false
441
+ }]
442
+ }],
443
+ class: [{
444
+ type: i0.Input,
445
+ args: [{
446
+ isSignal: true,
447
+ alias: "class",
448
+ required: false
449
+ }]
450
+ }],
451
+ selected: [{
452
+ type: i0.Output,
453
+ args: ["selected"]
454
+ }]
455
+ }
456
+ });
457
+ var PillboxOptionEmptyComponent = class PillboxOptionEmptyComponent {
458
+ context = inject(PillboxContext);
459
+ whenLoading = input("", ...ngDevMode ? [{ debugName: "whenLoading" }] : /* istanbul ignore next */ []);
460
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
461
+ classes = computed(() => cn("px-2 py-6 text-center text-sm text-muted-foreground", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
462
+ static ɵfac = i0.ɵɵngDeclareFactory({
463
+ minVersion: "12.0.0",
464
+ version: "22.2.0",
465
+ ngImport: i0,
466
+ type: PillboxOptionEmptyComponent,
467
+ deps: [],
468
+ target: i0.ɵɵFactoryTarget.Component
469
+ });
470
+ static ɵcmp = i0.ɵɵngDeclareComponent({
471
+ minVersion: "17.0.0",
472
+ version: "22.2.0",
473
+ type: PillboxOptionEmptyComponent,
474
+ isStandalone: true,
475
+ selector: "PillboxOptionEmpty",
476
+ inputs: {
477
+ whenLoading: {
478
+ classPropertyName: "whenLoading",
479
+ publicName: "whenLoading",
480
+ isSignal: true,
481
+ isRequired: false,
482
+ transformFunction: null
483
+ },
484
+ class: {
485
+ classPropertyName: "class",
486
+ publicName: "class",
487
+ isSignal: true,
488
+ isRequired: false,
489
+ transformFunction: null
490
+ }
491
+ },
492
+ host: {
493
+ attributes: { "role": "presentation" },
494
+ properties: {
495
+ "class": "classes()",
496
+ "attr.data-slot": "\"pillbox-option-empty\"",
497
+ "hidden": "!context.emptyVisible()"
498
+ }
499
+ },
500
+ ngImport: i0,
501
+ template: `
214
502
  @if (context.emptyMessage()) {
215
503
  {{ context.emptyMessage() }}
216
504
  } @else {
217
505
  <ng-content />
218
506
  }
219
- `, isInline: true });
220
- }
221
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxOptionEmptyComponent, decorators: [{
222
- type: Component,
223
- args: [{
224
- selector: 'PillboxOptionEmpty',
225
- host: {
226
- '[class]': 'classes()',
227
- '[attr.data-slot]': '"pillbox-option-empty"',
228
- role: 'presentation',
229
- '[hidden]': '!context.emptyVisible()',
230
- },
231
- template: `
507
+ `,
508
+ isInline: true
509
+ });
510
+ };
511
+ i0.ɵɵngDeclareClassMetadata({
512
+ minVersion: "12.0.0",
513
+ version: "22.2.0",
514
+ ngImport: i0,
515
+ type: PillboxOptionEmptyComponent,
516
+ decorators: [{
517
+ type: Component,
518
+ args: [{
519
+ selector: "PillboxOptionEmpty",
520
+ host: {
521
+ "[class]": "classes()",
522
+ "[attr.data-slot]": "\"pillbox-option-empty\"",
523
+ role: "presentation",
524
+ "[hidden]": "!context.emptyVisible()"
525
+ },
526
+ template: `
232
527
  @if (context.emptyMessage()) {
233
528
  {{ context.emptyMessage() }}
234
529
  } @else {
235
530
  <ng-content />
236
531
  }
237
- `,
238
- }]
239
- }], propDecorators: { whenLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "whenLoading", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
240
-
532
+ `
533
+ }]
534
+ }],
535
+ propDecorators: {
536
+ whenLoading: [{
537
+ type: i0.Input,
538
+ args: [{
539
+ isSignal: true,
540
+ alias: "whenLoading",
541
+ required: false
542
+ }]
543
+ }],
544
+ class: [{
545
+ type: i0.Input,
546
+ args: [{
547
+ isSignal: true,
548
+ alias: "class",
549
+ required: false
550
+ }]
551
+ }]
552
+ }
553
+ });
241
554
  const pillboxTriggerSizeClasses = {
242
- default: 'min-h-10 px-3 py-2 text-sm',
243
- sm: 'min-h-8 px-2.5 py-1.5 text-xs',
555
+ default: "min-h-10 px-3 py-2 text-sm",
556
+ sm: "min-h-8 px-2.5 py-1.5 text-xs"
244
557
  };
245
558
  const pillboxPillSizeClasses = {
246
- default: 'min-h-6 px-2 text-xs',
247
- sm: 'min-h-5 px-1.5 text-2xs-plus',
559
+ default: "min-h-6 px-2 text-xs",
560
+ sm: "min-h-5 px-1.5 text-2xs-plus"
248
561
  };
249
- class PillboxComponent extends PillboxContext {
250
- element = inject(ElementRef);
251
- document = inject(DOCUMENT);
252
- destroyRef = inject(DestroyRef);
253
- id = input(null, /* @ts-ignore */
254
- ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
255
- placeholder = input('Choose options...', /* @ts-ignore */
256
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
257
- searchPlaceholder = input('Search...', /* @ts-ignore */
258
- ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
259
- size = input('default', /* @ts-ignore */
260
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
261
- variant = input('default', /* @ts-ignore */
262
- ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
263
- multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
264
- searchable = input(false, { ...(ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
265
- filter = input(true, { ...(ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
266
- clearable = input(true, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
267
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
268
- invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
269
- loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
270
- /**
271
- * How a bound value is matched against an option's value. The default is
272
- * identity, which never matches objects re-fetched from a server: pass a key
273
- * comparison there instead.
274
- */
275
- compareWith = input(Object.is, /* @ts-ignore */
276
- ...(ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []));
277
- emptyText = input('No options found.', /* @ts-ignore */
278
- ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
279
- loadingText = input('Loading...', /* @ts-ignore */
280
- ...(ngDevMode ? [{ debugName: "loadingText" }] : /* istanbul ignore next */ []));
281
- ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
282
- ariaDescribedby = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
283
- ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
284
- class = input('', /* @ts-ignore */
285
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
286
- valueChange = output();
287
- searchChange = output();
288
- create = output();
289
- openedChange = output();
290
- query = signal('', /* @ts-ignore */
291
- ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
292
- openState = signal(false, /* @ts-ignore */
293
- ...(ngDevMode ? [{ debugName: "openState" }] : /* istanbul ignore next */ []));
294
- selectedValues = signal([], /* @ts-ignore */
295
- ...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
296
- activeOption = signal(null, /* @ts-ignore */
297
- ...(ngDevMode ? [{ debugName: "activeOption" }] : /* istanbul ignore next */ []));
298
- disabledFromControl = signal(false, /* @ts-ignore */
299
- ...(ngDevMode ? [{ debugName: "disabledFromControl" }] : /* istanbul ignore next */ []));
300
- generatedId = injectUniqueId('Pillbox');
301
- trigger = viewChild.required('trigger', /* @ts-ignore */
302
- ...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
303
- inlineSearch = viewChild('inlineSearch', /* @ts-ignore */
304
- ...(ngDevMode ? [{ debugName: "inlineSearch" }] : /* istanbul ignore next */ []));
305
- panelSearch = viewChild('panelSearch', /* @ts-ignore */
306
- ...(ngDevMode ? [{ debugName: "panelSearch" }] : /* istanbul ignore next */ []));
307
- options = contentChildren(PillboxOptionComponent, { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), descendants: true });
308
- createOptions = contentChildren(PillboxOptionCreateComponent, { ...(ngDevMode ? { debugName: "createOptions" } : /* istanbul ignore next */ {}), descendants: true });
309
- emptyOptions = contentChildren(PillboxOptionEmptyComponent, { ...(ngDevMode ? { debugName: "emptyOptions" } : /* istanbul ignore next */ {}), descendants: true });
310
- removeDocumentListener = null;
311
- onChange = () => { };
312
- onTouched = () => { };
313
- panelId = `${this.generatedId}-panel`;
314
- resolvedId = computed(() => this.id() ?? this.generatedId, /* @ts-ignore */
315
- ...(ngDevMode ? [{ debugName: "resolvedId" }] : /* istanbul ignore next */ []));
316
- /**
317
- * Whether the widget renders a text input. When it does, that input is the
318
- * combobox -- ARIA puts the role on the field the user types into, and a
319
- * combobox-roled wrapper around it would leave the field itself unannounced
320
- * and add a second tab stop in front of it.
321
- */
322
- hasInlineSearch = computed(() => this.variant() === 'combobox', /* @ts-ignore */
323
- ...(ngDevMode ? [{ debugName: "hasInlineSearch" }] : /* istanbul ignore next */ []));
324
- disabledState = computed(() => this.disabled() || this.disabledFromControl(), /* @ts-ignore */
325
- ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
326
- classes = computed(() => cn('relative block w-full min-w-0 text-sm text-foreground', this.class()), /* @ts-ignore */
327
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
328
- triggerClasses = computed(() => cn('flex w-full min-w-0 cursor-default items-center gap-2 rounded-md border border-input bg-background shadow-sm transition-colors', 'focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background', 'hover:bg-accent/20', pillboxTriggerSizeClasses[this.size()], this.invalid() ? 'border-destructive ring-1 ring-destructive' : '', this.disabledState() ? 'pointer-events-none cursor-not-allowed opacity-50' : ''), /* @ts-ignore */
329
- ...(ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []));
330
- pillClasses = computed(() => cn('inline-flex max-w-full shrink-0 items-center gap-1 rounded-md border border-border bg-muted font-medium text-muted-foreground', pillboxPillSizeClasses[this.size()]), /* @ts-ignore */
331
- ...(ngDevMode ? [{ debugName: "pillClasses" }] : /* istanbul ignore next */ []));
332
- panelClasses = computed(() => cn('absolute left-0 right-0 z-50 mt-1 overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md', 'min-w-full'), /* @ts-ignore */
333
- ...(ngDevMode ? [{ debugName: "panelClasses" }] : /* istanbul ignore next */ []));
334
- selectedItems = computed(() => this.selectedValues().map((value) => {
335
- const option = this.findOption(value);
336
- return {
337
- value,
338
- label: option?.pillLabel() || String(value),
339
- template: option?.pillTemplate() ?? null,
340
- // Track by the option value (selected values are unique) so removing a
341
- // middle pill doesn't recreate the DOM of every pill after it.
342
- track: value,
343
- };
344
- }), /* @ts-ignore */
345
- ...(ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []));
346
- constructor() {
347
- super();
348
- this.destroyRef.onDestroy(() => this.removeOutsideListener());
349
- }
350
- /**
351
- * Every option the user can reach right now, in the order they are painted.
352
- *
353
- * Both kinds of `role="option"` live in the same listbox, so they rove as one
354
- * list. `contentChildren` only orders within a single type, hence the document
355
- * comparison: it is the rendered order that a roving model has to follow.
356
- */
357
- rovingOptions = computed(() => {
358
- const all = [...this.options(), ...this.createOptions()];
359
- return all
360
- .filter((option) => option.rovingVisible() && !option.disabled())
361
- .sort((left, right) => left.nativeElement().compareDocumentPosition(right.nativeElement()) &
362
- Node.DOCUMENT_POSITION_FOLLOWING
363
- ? -1
364
- : 1);
365
- }, /* @ts-ignore */
366
- ...(ngDevMode ? [{ debugName: "rovingOptions" }] : /* istanbul ignore next */ []));
367
- /**
368
- * A listbox carries exactly one tab stop, not one per option. The option that
369
- * last held focus keeps it, falling back to the first reachable option -- so
370
- * Tab enters the list once, and the arrows do the rest.
371
- */
372
- optionTabIndex(option) {
373
- const roving = this.rovingOptions();
374
- if (roving.length === 0) {
375
- return -1;
376
- }
377
- const active = this.activeOption();
378
- const owner = active && roving.includes(active) ? active : roving[0];
379
- return owner === option ? 0 : -1;
380
- }
381
- activateOption(option) {
382
- this.activeOption.set(option);
383
- }
384
- handleOptionKeydown(option, event) {
385
- if (event.key === 'Escape') {
386
- event.preventDefault();
387
- this.close();
388
- this.focus();
389
- return;
390
- }
391
- const roving = this.rovingOptions();
392
- if (roving.length === 0) {
393
- return;
394
- }
395
- const current = roving.indexOf(option);
396
- const next = this.rovingTarget(event.key, current, roving.length);
397
- if (next === null) {
398
- return;
399
- }
400
- event.preventDefault();
401
- const target = roving[next];
402
- if (!target) {
403
- return;
404
- }
405
- this.activateOption(target);
406
- target.focus();
407
- }
408
- /** Where one navigation key lands, or `null` when the key is not ours. */
409
- rovingTarget(key, current, length) {
410
- switch (key) {
411
- case 'ArrowDown':
412
- return current < 0 ? 0 : (current + 1) % length;
413
- case 'ArrowUp':
414
- return current < 0 ? length - 1 : (current - 1 + length) % length;
415
- case 'Home':
416
- return 0;
417
- case 'End':
418
- return length - 1;
419
- default:
420
- return null;
421
- }
422
- }
423
- optionVisible(option) {
424
- if (!this.filter() || !option.filterable()) {
425
- return true;
426
- }
427
- const query = this.query().trim().toLowerCase();
428
- if (!query) {
429
- return true;
430
- }
431
- return option.textLabel().toLowerCase().includes(query);
432
- }
433
- optionSelected(option) {
434
- return this.hasValue(option.value());
435
- }
436
- chooseOption(option, event) {
437
- event.preventDefault();
438
- event.stopPropagation();
439
- if (this.disabledState() || option.disabled()) {
440
- return;
441
- }
442
- if (this.multiple()) {
443
- const value = option.value();
444
- this.selectedValues.update((values) => values.some((entry) => this.sameValue(entry, value))
445
- ? values.filter((entry) => !this.sameValue(entry, value))
446
- : [...values, value]);
447
- }
448
- else {
449
- this.selectedValues.set([option.value()]);
450
- this.close();
451
- }
452
- option.selectedChange.emit(option.value());
453
- this.query.set('');
454
- this.emitValue();
455
- }
456
- createVisible(option) {
457
- const query = this.query().trim();
458
- if (option.disabled() || query.length < option.minLength()) {
459
- return false;
460
- }
461
- return !this.options().some((entry) => entry.textLabel().trim().toLowerCase() === query.toLowerCase());
462
- }
463
- chooseCreate(option, event) {
464
- event.preventDefault();
465
- event.stopPropagation();
466
- const query = this.query().trim();
467
- if (this.disabledState() || option.disabled() || !this.createVisible(option)) {
468
- return;
469
- }
470
- option.selected.emit(query);
471
- this.create.emit(query);
472
- }
473
- emptyVisible() {
474
- return this.options().length > 0 && !this.hasVisibleOptions() && !this.hasVisibleCreateOption();
475
- }
476
- emptyMessage() {
477
- const customEmptyOption = this.emptyOptions()[0];
478
- if (this.loading()) {
479
- return customEmptyOption?.whenLoading() || this.loadingText();
480
- }
481
- return customEmptyOption ? '' : this.emptyText();
482
- }
483
- handleTriggerClick() {
484
- this.open();
485
- }
486
- handleTriggerKeydown(event) {
487
- if (this.disabledState()) {
488
- return;
489
- }
490
- event.preventDefault();
491
- this.open();
492
- }
493
- handleSearchInput(event) {
494
- const inputElement = event.target;
495
- this.query.set(inputElement.value);
496
- this.searchChange.emit(inputElement.value);
497
- this.open();
498
- }
499
- handleInlineBackspace(event) {
500
- if (event.target.value.length > 0 || this.selectedValues().length === 0) {
501
- return;
502
- }
503
- event.preventDefault();
504
- this.selectedValues.update((values) => values.slice(0, -1));
505
- this.emitValue();
506
- }
507
- clearSearch(event) {
508
- event.preventDefault();
509
- event.stopPropagation();
510
- this.query.set('');
511
- this.searchChange.emit('');
512
- this.focusSearchInput();
513
- }
514
- clear(event) {
515
- event.preventDefault();
516
- event.stopPropagation();
517
- this.selectedValues.set([]);
518
- this.emitValue();
519
- }
520
- removeSelected(value, event) {
521
- event.preventDefault();
522
- event.stopPropagation();
523
- this.selectedValues.update((values) => values.filter((entry) => !this.sameValue(entry, value)));
524
- this.emitValue();
525
- }
526
- open() {
527
- if (this.disabledState() || this.openState()) {
528
- return;
529
- }
530
- this.openState.set(true);
531
- this.openedChange.emit(true);
532
- queueMicrotask(() => {
533
- this.focusSearchInput();
534
- this.bindOutsideListener();
535
- });
536
- }
537
- close() {
538
- if (!this.openState()) {
539
- return;
540
- }
541
- this.openState.set(false);
542
- this.openedChange.emit(false);
543
- this.removeOutsideListener();
544
- // Forget where the roving tab stop was. A panel that reopens starts at the
545
- // top, and the remembered option may not even be rendered next time.
546
- this.activeOption.set(null);
547
- this.onTouched();
548
- }
549
- focus() {
550
- const inlineSearch = this.inlineSearch()?.nativeElement;
551
- if (inlineSearch) {
552
- inlineSearch.focus();
553
- return;
554
- }
555
- this.trigger().nativeElement.focus();
556
- }
557
- writeValue(value) {
558
- if (this.multiple()) {
559
- this.selectedValues.set(Array.isArray(value) ? value : []);
560
- return;
561
- }
562
- this.selectedValues.set(value === null || value === undefined ? [] : [value]);
563
- }
564
- registerOnChange(fn) {
565
- this.onChange = fn;
566
- }
567
- registerOnTouched(fn) {
568
- this.onTouched = fn;
569
- }
570
- setDisabledState(disabled) {
571
- this.disabledFromControl.set(disabled);
572
- }
573
- emitValue() {
574
- const nextValue = this.multiple()
575
- ? [...this.selectedValues()]
576
- : (this.selectedValues()[0] ?? null);
577
- this.onChange(nextValue);
578
- this.valueChange.emit(nextValue);
579
- }
580
- hasValue(value) {
581
- return this.selectedValues().some((entry) => this.sameValue(entry, value));
582
- }
583
- findOption(value) {
584
- return this.options().find((option) => this.sameValue(option.value(), value));
585
- }
586
- hasVisibleOptions() {
587
- return this.options().some((option) => this.optionVisible(option));
588
- }
589
- hasVisibleCreateOption() {
590
- return this.createOptions().some((option) => this.createVisible(option));
591
- }
592
- sameValue(left, right) {
593
- return this.compareWith()(left, right);
594
- }
595
- focusSearchInput() {
596
- const searchInput = this.variant() === 'combobox'
597
- ? this.inlineSearch()?.nativeElement
598
- : this.panelSearch()?.nativeElement;
599
- searchInput?.focus();
600
- }
601
- bindOutsideListener() {
602
- this.removeOutsideListener();
603
- const listener = (event) => {
604
- if (!this.element.nativeElement.contains(event.target)) {
605
- this.close();
606
- }
607
- };
608
- this.document.addEventListener('pointerdown', listener, true);
609
- this.removeDocumentListener = () => this.document.removeEventListener('pointerdown', listener, true);
610
- }
611
- removeOutsideListener() {
612
- this.removeDocumentListener?.();
613
- this.removeDocumentListener = null;
614
- }
615
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
616
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: PillboxComponent, isStandalone: true, selector: "Pillbox", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", 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 }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, loadingText: { classPropertyName: "loadingText", publicName: "loadingText", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", searchChange: "searchChange", create: "create", openedChange: "openedChange" }, host: { properties: { "class": "classes()", "attr.data-slot": "\"pillbox\"", "attr.data-open": "openState() ? \"\" : null", "attr.data-size": "size()", "attr.data-variant": "variant()" } }, providers: [
617
- { provide: PillboxContext, useExisting: forwardRef(() => PillboxComponent) },
618
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => PillboxComponent), multi: true },
619
- ], queries: [{ propertyName: "options", predicate: PillboxOptionComponent, descendants: true, isSignal: true }, { propertyName: "createOptions", predicate: PillboxOptionCreateComponent, descendants: true, isSignal: true }, { propertyName: "emptyOptions", predicate: PillboxOptionEmptyComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "inlineSearch", first: true, predicate: ["inlineSearch"], descendants: true, isSignal: true }, { propertyName: "panelSearch", first: true, predicate: ["panelSearch"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
562
+ var PillboxComponent = class PillboxComponent extends PillboxContext {
563
+ element = inject(ElementRef);
564
+ document = inject(DOCUMENT);
565
+ destroyRef = inject(DestroyRef);
566
+ id = input(null, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
567
+ placeholder = input("Choose options...", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
568
+ searchPlaceholder = input("Search...", ...ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []);
569
+ size = input("default", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
570
+ variant = input("default", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
571
+ multiple = input(false, {
572
+ ...ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {},
573
+ transform: booleanAttribute
574
+ });
575
+ searchable = input(false, {
576
+ ...ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {},
577
+ transform: booleanAttribute
578
+ });
579
+ filter = input(true, {
580
+ ...ngDevMode ? { debugName: "filter" } : /* istanbul ignore next */ {},
581
+ transform: booleanAttribute
582
+ });
583
+ clearable = input(true, {
584
+ ...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
585
+ transform: booleanAttribute
586
+ });
587
+ disabled = input(false, {
588
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
589
+ transform: booleanAttribute
590
+ });
591
+ invalid = input(false, {
592
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
593
+ transform: booleanAttribute
594
+ });
595
+ loading = input(false, {
596
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
597
+ transform: booleanAttribute
598
+ });
599
+ compareWith = input(Object.is, ...ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []);
600
+ emptyText = input("No options found.", ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
601
+ loadingText = input("Loading...", ...ngDevMode ? [{ debugName: "loadingText" }] : /* istanbul ignore next */ []);
602
+ ariaLabel = input(null, {
603
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
604
+ alias: "aria-label"
605
+ });
606
+ ariaDescribedby = input(null, {
607
+ ...ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {},
608
+ alias: "aria-describedby"
609
+ });
610
+ ariaLabelledby = input(null, {
611
+ ...ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {},
612
+ alias: "aria-labelledby"
613
+ });
614
+ class = input("", ...ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []);
615
+ valueChange = output();
616
+ searchChange = output();
617
+ create = output();
618
+ openedChange = output();
619
+ query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
620
+ openState = signal(false, ...ngDevMode ? [{ debugName: "openState" }] : /* istanbul ignore next */ []);
621
+ selectedValues = signal([], ...ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []);
622
+ activeOption = signal(null, ...ngDevMode ? [{ debugName: "activeOption" }] : /* istanbul ignore next */ []);
623
+ disabledFromControl = signal(false, ...ngDevMode ? [{ debugName: "disabledFromControl" }] : /* istanbul ignore next */ []);
624
+ generatedId = injectUniqueId("Pillbox");
625
+ trigger = viewChild.required("trigger", ...ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []);
626
+ inlineSearch = viewChild("inlineSearch", ...ngDevMode ? [{ debugName: "inlineSearch" }] : /* istanbul ignore next */ []);
627
+ panelSearch = viewChild("panelSearch", ...ngDevMode ? [{ debugName: "panelSearch" }] : /* istanbul ignore next */ []);
628
+ options = contentChildren(PillboxOptionComponent, {
629
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
630
+ descendants: true
631
+ });
632
+ createOptions = contentChildren(PillboxOptionCreateComponent, {
633
+ ...ngDevMode ? { debugName: "createOptions" } : /* istanbul ignore next */ {},
634
+ descendants: true
635
+ });
636
+ emptyOptions = contentChildren(PillboxOptionEmptyComponent, {
637
+ ...ngDevMode ? { debugName: "emptyOptions" } : /* istanbul ignore next */ {},
638
+ descendants: true
639
+ });
640
+ removeDocumentListener = null;
641
+ onChange = () => {};
642
+ onTouched = () => {};
643
+ panelId = `${this.generatedId}-panel`;
644
+ resolvedId = computed(() => this.id() ?? this.generatedId, ...ngDevMode ? [{ debugName: "resolvedId" }] : /* istanbul ignore next */ []);
645
+ hasInlineSearch = computed(() => this.variant() === "combobox", ...ngDevMode ? [{ debugName: "hasInlineSearch" }] : /* istanbul ignore next */ []);
646
+ disabledState = computed(() => this.disabled() || this.disabledFromControl(), ...ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []);
647
+ classes = computed(() => cn("relative block w-full min-w-0 text-sm text-foreground", this.class()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
648
+ triggerClasses = computed(() => cn("flex w-full min-w-0 cursor-default items-center gap-2 rounded-md border border-input bg-background shadow-sm transition-colors", "focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background", "hover:bg-accent/20", pillboxTriggerSizeClasses[this.size()], this.invalid() ? "border-destructive ring-1 ring-destructive" : "", this.disabledState() ? "pointer-events-none cursor-not-allowed opacity-50" : ""), ...ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []);
649
+ pillClasses = computed(() => cn("inline-flex max-w-full shrink-0 items-center gap-1 rounded-md border border-border bg-muted font-medium text-muted-foreground", pillboxPillSizeClasses[this.size()]), ...ngDevMode ? [{ debugName: "pillClasses" }] : /* istanbul ignore next */ []);
650
+ panelClasses = computed(() => cn("absolute left-0 right-0 z-50 mt-1 overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md", "min-w-full"), ...ngDevMode ? [{ debugName: "panelClasses" }] : /* istanbul ignore next */ []);
651
+ selectedItems = computed(() => this.selectedValues().map((value) => {
652
+ const option = this.findOption(value);
653
+ return {
654
+ value,
655
+ label: option?.pillLabel() || String(value),
656
+ template: option?.pillTemplate() ?? null,
657
+ track: value
658
+ };
659
+ }), ...ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []);
660
+ constructor() {
661
+ super();
662
+ this.destroyRef.onDestroy(() => this.removeOutsideListener());
663
+ }
664
+ rovingOptions = computed(() => {
665
+ return [...this.options(), ...this.createOptions()].filter((option) => option.rovingVisible() && !option.disabled()).sort((left, right) => left.nativeElement().compareDocumentPosition(right.nativeElement()) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
666
+ }, ...ngDevMode ? [{ debugName: "rovingOptions" }] : /* istanbul ignore next */ []);
667
+ optionTabIndex(option) {
668
+ const roving = this.rovingOptions();
669
+ if (roving.length === 0) return -1;
670
+ const active = this.activeOption();
671
+ return (active && roving.includes(active) ? active : roving[0]) === option ? 0 : -1;
672
+ }
673
+ activateOption(option) {
674
+ this.activeOption.set(option);
675
+ }
676
+ handleOptionKeydown(option, event) {
677
+ if (event.key === "Escape") {
678
+ event.preventDefault();
679
+ this.close();
680
+ this.focus();
681
+ return;
682
+ }
683
+ const roving = this.rovingOptions();
684
+ if (roving.length === 0) return;
685
+ const current = roving.indexOf(option);
686
+ const next = this.rovingTarget(event.key, current, roving.length);
687
+ if (next === null) return;
688
+ event.preventDefault();
689
+ const target = roving[next];
690
+ if (!target) return;
691
+ this.activateOption(target);
692
+ target.focus();
693
+ }
694
+ rovingTarget(key, current, length) {
695
+ switch (key) {
696
+ case "ArrowDown": return current < 0 ? 0 : (current + 1) % length;
697
+ case "ArrowUp": return current < 0 ? length - 1 : (current - 1 + length) % length;
698
+ case "Home": return 0;
699
+ case "End": return length - 1;
700
+ default: return null;
701
+ }
702
+ }
703
+ optionVisible(option) {
704
+ if (!this.filter() || !option.filterable()) return true;
705
+ const query = this.query().trim().toLowerCase();
706
+ if (!query) return true;
707
+ return option.textLabel().toLowerCase().includes(query);
708
+ }
709
+ optionSelected(option) {
710
+ return this.hasValue(option.value());
711
+ }
712
+ chooseOption(option, event) {
713
+ event.preventDefault();
714
+ event.stopPropagation();
715
+ if (this.disabledState() || option.disabled()) return;
716
+ if (this.multiple()) {
717
+ const value = option.value();
718
+ this.selectedValues.update((values) => values.some((entry) => this.sameValue(entry, value)) ? values.filter((entry) => !this.sameValue(entry, value)) : [...values, value]);
719
+ } else {
720
+ this.selectedValues.set([option.value()]);
721
+ this.close();
722
+ }
723
+ option.selectedChange.emit(option.value());
724
+ this.query.set("");
725
+ this.emitValue();
726
+ }
727
+ createVisible(option) {
728
+ const query = this.query().trim();
729
+ if (option.disabled() || query.length < option.minLength()) return false;
730
+ return !this.options().some((entry) => entry.textLabel().trim().toLowerCase() === query.toLowerCase());
731
+ }
732
+ chooseCreate(option, event) {
733
+ event.preventDefault();
734
+ event.stopPropagation();
735
+ const query = this.query().trim();
736
+ if (this.disabledState() || option.disabled() || !this.createVisible(option)) return;
737
+ option.selected.emit(query);
738
+ this.create.emit(query);
739
+ }
740
+ emptyVisible() {
741
+ return this.options().length > 0 && !this.hasVisibleOptions() && !this.hasVisibleCreateOption();
742
+ }
743
+ emptyMessage() {
744
+ const customEmptyOption = this.emptyOptions()[0];
745
+ if (this.loading()) return customEmptyOption?.whenLoading() || this.loadingText();
746
+ return customEmptyOption ? "" : this.emptyText();
747
+ }
748
+ handleTriggerClick() {
749
+ this.open();
750
+ }
751
+ handleTriggerKeydown(event) {
752
+ if (this.disabledState()) return;
753
+ event.preventDefault();
754
+ this.open();
755
+ }
756
+ handleSearchInput(event) {
757
+ const inputElement = event.target;
758
+ this.query.set(inputElement.value);
759
+ this.searchChange.emit(inputElement.value);
760
+ this.open();
761
+ }
762
+ handleInlineBackspace(event) {
763
+ if (event.target.value.length > 0 || this.selectedValues().length === 0) return;
764
+ event.preventDefault();
765
+ this.selectedValues.update((values) => values.slice(0, -1));
766
+ this.emitValue();
767
+ }
768
+ clearSearch(event) {
769
+ event.preventDefault();
770
+ event.stopPropagation();
771
+ this.query.set("");
772
+ this.searchChange.emit("");
773
+ this.focusSearchInput();
774
+ }
775
+ clear(event) {
776
+ event.preventDefault();
777
+ event.stopPropagation();
778
+ this.selectedValues.set([]);
779
+ this.emitValue();
780
+ }
781
+ removeSelected(value, event) {
782
+ event.preventDefault();
783
+ event.stopPropagation();
784
+ this.selectedValues.update((values) => values.filter((entry) => !this.sameValue(entry, value)));
785
+ this.emitValue();
786
+ }
787
+ open() {
788
+ if (this.disabledState() || this.openState()) return;
789
+ this.openState.set(true);
790
+ this.openedChange.emit(true);
791
+ queueMicrotask(() => {
792
+ this.focusSearchInput();
793
+ this.bindOutsideListener();
794
+ });
795
+ }
796
+ close() {
797
+ if (!this.openState()) return;
798
+ this.openState.set(false);
799
+ this.openedChange.emit(false);
800
+ this.removeOutsideListener();
801
+ this.activeOption.set(null);
802
+ this.onTouched();
803
+ }
804
+ focus() {
805
+ const inlineSearch = this.inlineSearch()?.nativeElement;
806
+ if (inlineSearch) {
807
+ inlineSearch.focus();
808
+ return;
809
+ }
810
+ this.trigger().nativeElement.focus();
811
+ }
812
+ writeValue(value) {
813
+ if (this.multiple()) {
814
+ this.selectedValues.set(Array.isArray(value) ? value : []);
815
+ return;
816
+ }
817
+ this.selectedValues.set(value === null || value === void 0 ? [] : [value]);
818
+ }
819
+ registerOnChange(fn) {
820
+ this.onChange = fn;
821
+ }
822
+ registerOnTouched(fn) {
823
+ this.onTouched = fn;
824
+ }
825
+ setDisabledState(disabled) {
826
+ this.disabledFromControl.set(disabled);
827
+ }
828
+ emitValue() {
829
+ const nextValue = this.multiple() ? [...this.selectedValues()] : this.selectedValues()[0] ?? null;
830
+ this.onChange(nextValue);
831
+ this.valueChange.emit(nextValue);
832
+ }
833
+ hasValue(value) {
834
+ return this.selectedValues().some((entry) => this.sameValue(entry, value));
835
+ }
836
+ findOption(value) {
837
+ return this.options().find((option) => this.sameValue(option.value(), value));
838
+ }
839
+ hasVisibleOptions() {
840
+ return this.options().some((option) => this.optionVisible(option));
841
+ }
842
+ hasVisibleCreateOption() {
843
+ return this.createOptions().some((option) => this.createVisible(option));
844
+ }
845
+ sameValue(left, right) {
846
+ return this.compareWith()(left, right);
847
+ }
848
+ focusSearchInput() {
849
+ (this.variant() === "combobox" ? this.inlineSearch()?.nativeElement : this.panelSearch()?.nativeElement)?.focus();
850
+ }
851
+ bindOutsideListener() {
852
+ this.removeOutsideListener();
853
+ const listener = (event) => {
854
+ if (!this.element.nativeElement.contains(event.target)) this.close();
855
+ };
856
+ this.document.addEventListener("pointerdown", listener, true);
857
+ this.removeDocumentListener = () => this.document.removeEventListener("pointerdown", listener, true);
858
+ }
859
+ removeOutsideListener() {
860
+ this.removeDocumentListener?.();
861
+ this.removeDocumentListener = null;
862
+ }
863
+ static ɵfac = i0.ɵɵngDeclareFactory({
864
+ minVersion: "12.0.0",
865
+ version: "22.2.0",
866
+ ngImport: i0,
867
+ type: PillboxComponent,
868
+ deps: [],
869
+ target: i0.ɵɵFactoryTarget.Component
870
+ });
871
+ static ɵcmp = i0.ɵɵngDeclareComponent({
872
+ minVersion: "17.0.0",
873
+ version: "22.2.0",
874
+ type: PillboxComponent,
875
+ isStandalone: true,
876
+ selector: "Pillbox",
877
+ inputs: {
878
+ id: {
879
+ classPropertyName: "id",
880
+ publicName: "id",
881
+ isSignal: true,
882
+ isRequired: false,
883
+ transformFunction: null
884
+ },
885
+ placeholder: {
886
+ classPropertyName: "placeholder",
887
+ publicName: "placeholder",
888
+ isSignal: true,
889
+ isRequired: false,
890
+ transformFunction: null
891
+ },
892
+ searchPlaceholder: {
893
+ classPropertyName: "searchPlaceholder",
894
+ publicName: "searchPlaceholder",
895
+ isSignal: true,
896
+ isRequired: false,
897
+ transformFunction: null
898
+ },
899
+ size: {
900
+ classPropertyName: "size",
901
+ publicName: "size",
902
+ isSignal: true,
903
+ isRequired: false,
904
+ transformFunction: null
905
+ },
906
+ variant: {
907
+ classPropertyName: "variant",
908
+ publicName: "variant",
909
+ isSignal: true,
910
+ isRequired: false,
911
+ transformFunction: null
912
+ },
913
+ multiple: {
914
+ classPropertyName: "multiple",
915
+ publicName: "multiple",
916
+ isSignal: true,
917
+ isRequired: false,
918
+ transformFunction: null
919
+ },
920
+ searchable: {
921
+ classPropertyName: "searchable",
922
+ publicName: "searchable",
923
+ isSignal: true,
924
+ isRequired: false,
925
+ transformFunction: null
926
+ },
927
+ filter: {
928
+ classPropertyName: "filter",
929
+ publicName: "filter",
930
+ isSignal: true,
931
+ isRequired: false,
932
+ transformFunction: null
933
+ },
934
+ clearable: {
935
+ classPropertyName: "clearable",
936
+ publicName: "clearable",
937
+ isSignal: true,
938
+ isRequired: false,
939
+ transformFunction: null
940
+ },
941
+ disabled: {
942
+ classPropertyName: "disabled",
943
+ publicName: "disabled",
944
+ isSignal: true,
945
+ isRequired: false,
946
+ transformFunction: null
947
+ },
948
+ invalid: {
949
+ classPropertyName: "invalid",
950
+ publicName: "invalid",
951
+ isSignal: true,
952
+ isRequired: false,
953
+ transformFunction: null
954
+ },
955
+ loading: {
956
+ classPropertyName: "loading",
957
+ publicName: "loading",
958
+ isSignal: true,
959
+ isRequired: false,
960
+ transformFunction: null
961
+ },
962
+ compareWith: {
963
+ classPropertyName: "compareWith",
964
+ publicName: "compareWith",
965
+ isSignal: true,
966
+ isRequired: false,
967
+ transformFunction: null
968
+ },
969
+ emptyText: {
970
+ classPropertyName: "emptyText",
971
+ publicName: "emptyText",
972
+ isSignal: true,
973
+ isRequired: false,
974
+ transformFunction: null
975
+ },
976
+ loadingText: {
977
+ classPropertyName: "loadingText",
978
+ publicName: "loadingText",
979
+ isSignal: true,
980
+ isRequired: false,
981
+ transformFunction: null
982
+ },
983
+ ariaLabel: {
984
+ classPropertyName: "ariaLabel",
985
+ publicName: "aria-label",
986
+ isSignal: true,
987
+ isRequired: false,
988
+ transformFunction: null
989
+ },
990
+ ariaDescribedby: {
991
+ classPropertyName: "ariaDescribedby",
992
+ publicName: "aria-describedby",
993
+ isSignal: true,
994
+ isRequired: false,
995
+ transformFunction: null
996
+ },
997
+ ariaLabelledby: {
998
+ classPropertyName: "ariaLabelledby",
999
+ publicName: "aria-labelledby",
1000
+ isSignal: true,
1001
+ isRequired: false,
1002
+ transformFunction: null
1003
+ },
1004
+ class: {
1005
+ classPropertyName: "class",
1006
+ publicName: "class",
1007
+ isSignal: true,
1008
+ isRequired: false,
1009
+ transformFunction: null
1010
+ }
1011
+ },
1012
+ outputs: {
1013
+ valueChange: "valueChange",
1014
+ searchChange: "searchChange",
1015
+ create: "create",
1016
+ openedChange: "openedChange"
1017
+ },
1018
+ host: { properties: {
1019
+ "class": "classes()",
1020
+ "attr.data-slot": "\"pillbox\"",
1021
+ "attr.data-open": "openState() ? \"\" : null",
1022
+ "attr.data-size": "size()",
1023
+ "attr.data-variant": "variant()"
1024
+ } },
1025
+ providers: [{
1026
+ provide: PillboxContext,
1027
+ useExisting: forwardRef(() => PillboxComponent)
1028
+ }, {
1029
+ provide: NG_VALUE_ACCESSOR,
1030
+ useExisting: forwardRef(() => PillboxComponent),
1031
+ multi: true
1032
+ }],
1033
+ queries: [
1034
+ {
1035
+ propertyName: "options",
1036
+ predicate: PillboxOptionComponent,
1037
+ descendants: true,
1038
+ isSignal: true
1039
+ },
1040
+ {
1041
+ propertyName: "createOptions",
1042
+ predicate: PillboxOptionCreateComponent,
1043
+ descendants: true,
1044
+ isSignal: true
1045
+ },
1046
+ {
1047
+ propertyName: "emptyOptions",
1048
+ predicate: PillboxOptionEmptyComponent,
1049
+ descendants: true,
1050
+ isSignal: true
1051
+ }
1052
+ ],
1053
+ viewQueries: [
1054
+ {
1055
+ propertyName: "trigger",
1056
+ first: true,
1057
+ predicate: ["trigger"],
1058
+ descendants: true,
1059
+ isSignal: true
1060
+ },
1061
+ {
1062
+ propertyName: "inlineSearch",
1063
+ first: true,
1064
+ predicate: ["inlineSearch"],
1065
+ descendants: true,
1066
+ isSignal: true
1067
+ },
1068
+ {
1069
+ propertyName: "panelSearch",
1070
+ first: true,
1071
+ predicate: ["panelSearch"],
1072
+ descendants: true,
1073
+ isSignal: true
1074
+ }
1075
+ ],
1076
+ usesInheritance: true,
1077
+ ngImport: i0,
1078
+ template: `
620
1079
  <div
621
1080
  #trigger
622
1081
  [attr.id]="resolvedId()"
@@ -793,25 +1252,46 @@ class PillboxComponent extends PillboxContext {
793
1252
  <ng-content />
794
1253
  </div>
795
1254
  </div>
796
- `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
797
- }
798
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PillboxComponent, decorators: [{
799
- type: Component,
800
- args: [{
801
- selector: 'Pillbox',
802
- imports: [NgTemplateOutlet],
803
- providers: [
804
- { provide: PillboxContext, useExisting: forwardRef(() => PillboxComponent) },
805
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => PillboxComponent), multi: true },
806
- ],
807
- host: {
808
- '[class]': 'classes()',
809
- '[attr.data-slot]': '"pillbox"',
810
- '[attr.data-open]': 'openState() ? "" : null',
811
- '[attr.data-size]': 'size()',
812
- '[attr.data-variant]': 'variant()',
813
- },
814
- template: `
1255
+ `,
1256
+ isInline: true,
1257
+ dependencies: [{
1258
+ kind: "directive",
1259
+ type: NgTemplateOutlet,
1260
+ selector: "[ngTemplateOutlet]",
1261
+ inputs: [
1262
+ "ngTemplateOutletContext",
1263
+ "ngTemplateOutlet",
1264
+ "ngTemplateOutletInjector"
1265
+ ]
1266
+ }]
1267
+ });
1268
+ };
1269
+ i0.ɵɵngDeclareClassMetadata({
1270
+ minVersion: "12.0.0",
1271
+ version: "22.2.0",
1272
+ ngImport: i0,
1273
+ type: PillboxComponent,
1274
+ decorators: [{
1275
+ type: Component,
1276
+ args: [{
1277
+ selector: "Pillbox",
1278
+ imports: [NgTemplateOutlet],
1279
+ providers: [{
1280
+ provide: PillboxContext,
1281
+ useExisting: forwardRef(() => PillboxComponent)
1282
+ }, {
1283
+ provide: NG_VALUE_ACCESSOR,
1284
+ useExisting: forwardRef(() => PillboxComponent),
1285
+ multi: true
1286
+ }],
1287
+ host: {
1288
+ "[class]": "classes()",
1289
+ "[attr.data-slot]": "\"pillbox\"",
1290
+ "[attr.data-open]": "openState() ? \"\" : null",
1291
+ "[attr.data-size]": "size()",
1292
+ "[attr.data-variant]": "variant()"
1293
+ },
1294
+ template: `
815
1295
  <div
816
1296
  #trigger
817
1297
  [attr.id]="resolvedId()"
@@ -988,16 +1468,212 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
988
1468
  <ng-content />
989
1469
  </div>
990
1470
  </div>
991
- `,
992
- }]
993
- }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], loadingText: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingText", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], create: [{ type: i0.Output, args: ["create"] }], openedChange: [{ type: i0.Output, args: ["openedChange"] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], inlineSearch: [{ type: i0.ViewChild, args: ['inlineSearch', { isSignal: true }] }], panelSearch: [{ type: i0.ViewChild, args: ['panelSearch', { isSignal: true }] }], options: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PillboxOptionComponent), { ...{ descendants: true }, isSignal: true }] }], createOptions: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PillboxOptionCreateComponent), { ...{
994
- descendants: true,
995
- }, isSignal: true }] }], emptyOptions: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PillboxOptionEmptyComponent), { ...{
996
- descendants: true,
997
- }, isSignal: true }] }] } });
998
-
999
- /**
1000
- * Generated bundle index. Do not edit.
1001
- */
1002
-
1003
- export { PillboxComponent, PillboxOptionComponent, PillboxOptionCreateComponent, PillboxOptionEmptyComponent, PillboxSelectedDirective };
1471
+ `
1472
+ }]
1473
+ }],
1474
+ ctorParameters: () => [],
1475
+ propDecorators: {
1476
+ id: [{
1477
+ type: i0.Input,
1478
+ args: [{
1479
+ isSignal: true,
1480
+ alias: "id",
1481
+ required: false
1482
+ }]
1483
+ }],
1484
+ placeholder: [{
1485
+ type: i0.Input,
1486
+ args: [{
1487
+ isSignal: true,
1488
+ alias: "placeholder",
1489
+ required: false
1490
+ }]
1491
+ }],
1492
+ searchPlaceholder: [{
1493
+ type: i0.Input,
1494
+ args: [{
1495
+ isSignal: true,
1496
+ alias: "searchPlaceholder",
1497
+ required: false
1498
+ }]
1499
+ }],
1500
+ size: [{
1501
+ type: i0.Input,
1502
+ args: [{
1503
+ isSignal: true,
1504
+ alias: "size",
1505
+ required: false
1506
+ }]
1507
+ }],
1508
+ variant: [{
1509
+ type: i0.Input,
1510
+ args: [{
1511
+ isSignal: true,
1512
+ alias: "variant",
1513
+ required: false
1514
+ }]
1515
+ }],
1516
+ multiple: [{
1517
+ type: i0.Input,
1518
+ args: [{
1519
+ isSignal: true,
1520
+ alias: "multiple",
1521
+ required: false
1522
+ }]
1523
+ }],
1524
+ searchable: [{
1525
+ type: i0.Input,
1526
+ args: [{
1527
+ isSignal: true,
1528
+ alias: "searchable",
1529
+ required: false
1530
+ }]
1531
+ }],
1532
+ filter: [{
1533
+ type: i0.Input,
1534
+ args: [{
1535
+ isSignal: true,
1536
+ alias: "filter",
1537
+ required: false
1538
+ }]
1539
+ }],
1540
+ clearable: [{
1541
+ type: i0.Input,
1542
+ args: [{
1543
+ isSignal: true,
1544
+ alias: "clearable",
1545
+ required: false
1546
+ }]
1547
+ }],
1548
+ disabled: [{
1549
+ type: i0.Input,
1550
+ args: [{
1551
+ isSignal: true,
1552
+ alias: "disabled",
1553
+ required: false
1554
+ }]
1555
+ }],
1556
+ invalid: [{
1557
+ type: i0.Input,
1558
+ args: [{
1559
+ isSignal: true,
1560
+ alias: "invalid",
1561
+ required: false
1562
+ }]
1563
+ }],
1564
+ loading: [{
1565
+ type: i0.Input,
1566
+ args: [{
1567
+ isSignal: true,
1568
+ alias: "loading",
1569
+ required: false
1570
+ }]
1571
+ }],
1572
+ compareWith: [{
1573
+ type: i0.Input,
1574
+ args: [{
1575
+ isSignal: true,
1576
+ alias: "compareWith",
1577
+ required: false
1578
+ }]
1579
+ }],
1580
+ emptyText: [{
1581
+ type: i0.Input,
1582
+ args: [{
1583
+ isSignal: true,
1584
+ alias: "emptyText",
1585
+ required: false
1586
+ }]
1587
+ }],
1588
+ loadingText: [{
1589
+ type: i0.Input,
1590
+ args: [{
1591
+ isSignal: true,
1592
+ alias: "loadingText",
1593
+ required: false
1594
+ }]
1595
+ }],
1596
+ ariaLabel: [{
1597
+ type: i0.Input,
1598
+ args: [{
1599
+ isSignal: true,
1600
+ alias: "aria-label",
1601
+ required: false
1602
+ }]
1603
+ }],
1604
+ ariaDescribedby: [{
1605
+ type: i0.Input,
1606
+ args: [{
1607
+ isSignal: true,
1608
+ alias: "aria-describedby",
1609
+ required: false
1610
+ }]
1611
+ }],
1612
+ ariaLabelledby: [{
1613
+ type: i0.Input,
1614
+ args: [{
1615
+ isSignal: true,
1616
+ alias: "aria-labelledby",
1617
+ required: false
1618
+ }]
1619
+ }],
1620
+ class: [{
1621
+ type: i0.Input,
1622
+ args: [{
1623
+ isSignal: true,
1624
+ alias: "class",
1625
+ required: false
1626
+ }]
1627
+ }],
1628
+ valueChange: [{
1629
+ type: i0.Output,
1630
+ args: ["valueChange"]
1631
+ }],
1632
+ searchChange: [{
1633
+ type: i0.Output,
1634
+ args: ["searchChange"]
1635
+ }],
1636
+ create: [{
1637
+ type: i0.Output,
1638
+ args: ["create"]
1639
+ }],
1640
+ openedChange: [{
1641
+ type: i0.Output,
1642
+ args: ["openedChange"]
1643
+ }],
1644
+ trigger: [{
1645
+ type: i0.ViewChild,
1646
+ args: ["trigger", { isSignal: true }]
1647
+ }],
1648
+ inlineSearch: [{
1649
+ type: i0.ViewChild,
1650
+ args: ["inlineSearch", { isSignal: true }]
1651
+ }],
1652
+ panelSearch: [{
1653
+ type: i0.ViewChild,
1654
+ args: ["panelSearch", { isSignal: true }]
1655
+ }],
1656
+ options: [{
1657
+ type: i0.ContentChildren,
1658
+ args: [i0.forwardRef(() => PillboxOptionComponent), {
1659
+ descendants: true,
1660
+ isSignal: true
1661
+ }]
1662
+ }],
1663
+ createOptions: [{
1664
+ type: i0.ContentChildren,
1665
+ args: [i0.forwardRef(() => PillboxOptionCreateComponent), {
1666
+ descendants: true,
1667
+ isSignal: true
1668
+ }]
1669
+ }],
1670
+ emptyOptions: [{
1671
+ type: i0.ContentChildren,
1672
+ args: [i0.forwardRef(() => PillboxOptionEmptyComponent), {
1673
+ descendants: true,
1674
+ isSignal: true
1675
+ }]
1676
+ }]
1677
+ }
1678
+ });
1679
+ export { PillboxComponent, PillboxOptionComponent, PillboxOptionCreateComponent, PillboxOptionEmptyComponent, PillboxSelectedDirective };