@egose/shadcn-theme-ng-tw 0.1.0 → 0.3.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 (165) hide show
  1. package/README.md +2 -2
  2. package/accordion/README.md +405 -2
  3. package/alert/README.md +372 -2
  4. package/alert/fesm2022/alert.mjs +1 -1
  5. package/alert-dialog/README.md +471 -5
  6. package/aspect-ratio/README.md +272 -5
  7. package/autocomplete/README.md +502 -2
  8. package/autocomplete/fesm2022/autocomplete.mjs +1 -1
  9. package/avatar/README.md +357 -5
  10. package/badge/README.md +318 -2
  11. package/basic-alert/README.md +353 -2
  12. package/breadcrumb/README.md +406 -5
  13. package/button/README.md +482 -2
  14. package/button/fesm2022/button.mjs +85 -107
  15. package/button/types/button.d.ts +5 -8
  16. package/button-group/README.md +318 -5
  17. package/button-group/fesm2022/button-group.mjs +1 -1
  18. package/calendar/README.md +357 -2
  19. package/card/README.md +331 -5
  20. package/carousel/README.md +333 -5
  21. package/carousel/fesm2022/carousel.mjs +4 -1
  22. package/checkbox/README.md +320 -2
  23. package/checkbox/fesm2022/checkbox.mjs +6 -7
  24. package/checkbox/types/checkbox.d.ts +1 -1
  25. package/collapsible/README.md +332 -5
  26. package/combobox/README.md +507 -5
  27. package/combobox/fesm2022/combobox.mjs +5 -2
  28. package/command/README.md +435 -5
  29. package/confirmation-dialog/README.md +301 -2
  30. package/context-menu/README.md +366 -5
  31. package/date-picker/README.md +469 -2
  32. package/date-picker/fesm2022/date-picker.mjs +150 -32
  33. package/date-picker/types/date-picker.d.ts +102 -9
  34. package/dialog/README.md +448 -2
  35. package/drawer/README.md +395 -5
  36. package/dropdown-menu/README.md +417 -5
  37. package/empty/README.md +329 -5
  38. package/field/README.md +385 -5
  39. package/form-autocomplete/README.md +177 -0
  40. package/form-autocomplete/fesm2022/form-autocomplete.mjs +211 -0
  41. package/form-autocomplete/package.json +24 -0
  42. package/form-autocomplete/types/form-autocomplete.d.ts +61 -0
  43. package/form-checkbox/README.md +322 -2
  44. package/form-checkbox/fesm2022/form-checkbox.mjs +22 -9
  45. package/form-checkbox/types/form-checkbox.d.ts +23 -4
  46. package/form-combobox/README.md +202 -0
  47. package/form-combobox/fesm2022/form-combobox.mjs +273 -0
  48. package/form-combobox/package.json +24 -0
  49. package/form-combobox/types/form-combobox.d.ts +73 -0
  50. package/form-date-picker/README.md +348 -2
  51. package/form-date-picker/fesm2022/form-date-picker.mjs +60 -16
  52. package/form-date-picker/types/form-date-picker.d.ts +17 -1
  53. package/form-date-picker-multi/README.md +191 -0
  54. package/form-date-picker-multi/fesm2022/form-date-picker-multi.mjs +239 -0
  55. package/form-date-picker-multi/package.json +24 -0
  56. package/form-date-picker-multi/types/form-date-picker-multi.d.ts +58 -0
  57. package/form-date-range-picker/README.md +253 -0
  58. package/form-date-range-picker/fesm2022/form-date-range-picker.mjs +236 -0
  59. package/form-date-range-picker/package.json +24 -0
  60. package/form-date-range-picker/types/form-date-range-picker.d.ts +55 -0
  61. package/form-field/README.md +356 -2
  62. package/form-field-simple/README.md +340 -2
  63. package/form-input-otp/README.md +194 -0
  64. package/form-input-otp/fesm2022/form-input-otp.mjs +194 -0
  65. package/form-input-otp/package.json +24 -0
  66. package/form-input-otp/types/form-input-otp.d.ts +58 -0
  67. package/form-month-year-picker/README.md +188 -0
  68. package/form-month-year-picker/fesm2022/form-month-year-picker.mjs +229 -0
  69. package/form-month-year-picker/package.json +24 -0
  70. package/form-month-year-picker/types/form-month-year-picker.d.ts +53 -0
  71. package/form-native-select/README.md +205 -0
  72. package/form-native-select/fesm2022/form-native-select.mjs +187 -0
  73. package/form-native-select/package.json +24 -0
  74. package/form-native-select/types/form-native-select.d.ts +57 -0
  75. package/form-phone-input/README.md +188 -0
  76. package/form-phone-input/fesm2022/form-phone-input.mjs +203 -0
  77. package/form-phone-input/package.json +24 -0
  78. package/form-phone-input/types/form-phone-input.d.ts +58 -0
  79. package/form-radio-group/README.md +198 -0
  80. package/form-radio-group/fesm2022/form-radio-group.mjs +211 -0
  81. package/form-radio-group/package.json +24 -0
  82. package/form-radio-group/types/form-radio-group.d.ts +63 -0
  83. package/form-searchable-multiselect/README.md +371 -2
  84. package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +19 -10
  85. package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +18 -1
  86. package/form-select/README.md +360 -2
  87. package/form-select/fesm2022/form-select.mjs +24 -15
  88. package/form-select/types/form-select.d.ts +18 -1
  89. package/form-slider/README.md +182 -0
  90. package/form-slider/fesm2022/form-slider.mjs +186 -0
  91. package/form-slider/package.json +24 -0
  92. package/form-slider/types/form-slider.d.ts +60 -0
  93. package/form-switch/README.md +173 -0
  94. package/form-switch/fesm2022/form-switch.mjs +178 -0
  95. package/form-switch/package.json +24 -0
  96. package/form-switch/types/form-switch.d.ts +50 -0
  97. package/form-text-input/README.md +381 -2
  98. package/form-text-input/fesm2022/form-text-input.mjs +19 -10
  99. package/form-text-input/types/form-text-input.d.ts +18 -1
  100. package/form-textarea/README.md +357 -2
  101. package/form-textarea/fesm2022/form-textarea.mjs +19 -10
  102. package/form-textarea/types/form-textarea.d.ts +18 -1
  103. package/form-toggle/README.md +186 -0
  104. package/form-toggle/fesm2022/form-toggle.mjs +241 -0
  105. package/form-toggle/package.json +24 -0
  106. package/form-toggle/types/form-toggle.d.ts +82 -0
  107. package/form-toggle-group/README.md +176 -0
  108. package/form-toggle-group/fesm2022/form-toggle-group.mjs +216 -0
  109. package/form-toggle-group/package.json +24 -0
  110. package/form-toggle-group/types/form-toggle-group.d.ts +65 -0
  111. package/hover-card/README.md +256 -5
  112. package/icon/README.md +239 -2
  113. package/input/README.md +269 -2
  114. package/input-group/README.md +335 -5
  115. package/input-group/fesm2022/input-group.mjs +23 -13
  116. package/input-group/types/input-group.d.ts +4 -1
  117. package/input-otp/README.md +375 -5
  118. package/item/README.md +385 -5
  119. package/item/fesm2022/item.mjs +3 -3
  120. package/kbd/README.md +291 -5
  121. package/label/README.md +272 -2
  122. package/layout-simple/README.md +193 -2
  123. package/layout-simple/fesm2022/layout-simple.mjs +877 -409
  124. package/layout-simple/types/layout-simple.d.ts +174 -137
  125. package/menu/README.md +417 -2
  126. package/menubar/README.md +343 -5
  127. package/native-select/README.md +323 -5
  128. package/native-select/fesm2022/native-select.mjs +18 -6
  129. package/native-select/types/native-select.d.ts +7 -2
  130. package/navigation-menu/README.md +369 -5
  131. package/package.json +57 -1
  132. package/pagination/README.md +388 -5
  133. package/phone-input/README.md +114 -0
  134. package/phone-input/fesm2022/phone-input.mjs +191 -0
  135. package/phone-input/package.json +24 -0
  136. package/phone-input/types/phone-input.d.ts +67 -0
  137. package/popover/README.md +331 -2
  138. package/progress/README.md +311 -5
  139. package/radio-group/README.md +364 -2
  140. package/radio-group/fesm2022/radio-group.mjs +5 -1
  141. package/resizable/README.md +269 -5
  142. package/scroll-area/README.md +233 -5
  143. package/searchable-multiselect/README.md +323 -2
  144. package/select/README.md +437 -2
  145. package/separator/README.md +222 -2
  146. package/sheet/README.md +311 -2
  147. package/sheet/fesm2022/sheet.mjs +1 -1
  148. package/sidebar/README.md +457 -5
  149. package/skeleton/README.md +217 -5
  150. package/slider/README.md +273 -5
  151. package/slider/fesm2022/slider.mjs +17 -13
  152. package/sonner/README.md +346 -2
  153. package/spinner/README.md +284 -2
  154. package/switch/README.md +310 -2
  155. package/switch/fesm2022/switch.mjs +7 -5
  156. package/switch/types/switch.d.ts +2 -1
  157. package/table/README.md +423 -5
  158. package/tabs/README.md +411 -2
  159. package/tabs/fesm2022/tabs.mjs +12 -2
  160. package/textarea/README.md +282 -5
  161. package/toggle/README.md +270 -5
  162. package/toggle-group/README.md +340 -5
  163. package/tooltip/README.md +269 -2
  164. package/typography/README.md +271 -5
  165. package/utils/README.md +303 -2
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { InjectionToken, inject, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import * as i1 from '@angular/forms';
4
4
  import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
5
5
  import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
@@ -8,9 +8,18 @@ import { HlmFormIdGenerator, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw
8
8
  import { EgFormField } from '@egose/shadcn-theme-ng-tw/form-field-simple';
9
9
  import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
10
10
 
11
+ const EgFormCheckboxConfigToken = new InjectionToken('EgFormCheckboxConfig');
12
+ function provideEgFormCheckboxConfig(config) {
13
+ return { provide: EgFormCheckboxConfigToken, useValue: { ...config } };
14
+ }
15
+ function injectEgFormCheckboxConfig() {
16
+ return inject(EgFormCheckboxConfigToken, { optional: true }) ?? {};
17
+ }
18
+
11
19
  class EgFormCheckbox {
12
20
  formGroupDirective = inject(FormGroupDirective);
13
21
  generatedId = inject(HlmFormIdGenerator).generate('eg-form-checkbox');
22
+ _config = injectEgFormCheckboxConfig();
14
23
  // Classes
15
24
  userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
16
25
  _computedClass = computed(() => hlm('', this.userClass()), /* @ts-ignore */
@@ -55,17 +64,21 @@ class EgFormCheckbox {
55
64
  ...(ngDevMode ? [{ debugName: "checkboxClass" }] : /* istanbul ignore next */ []));
56
65
  labelClass = input('', /* @ts-ignore */
57
66
  ...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
58
- // Computed styling
59
- $checkboxClass = computed(() => hlm(this.checkboxClass()), /* @ts-ignore */
67
+ errorClass = input('', /* @ts-ignore */
68
+ ...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
69
+ hintClass = input('', /* @ts-ignore */
70
+ ...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
71
+ // Computed styling (library base < global config < per-instance)
72
+ $checkboxClass = computed(() => hlm(this._config.checkboxClass, this.checkboxClass()), /* @ts-ignore */
60
73
  ...(ngDevMode ? [{ debugName: "$checkboxClass" }] : /* istanbul ignore next */ []));
61
- $labelClass = computed(() => hlm(this.labelClass()), /* @ts-ignore */
74
+ $labelClass = computed(() => hlm(this._config.labelClass, this.labelClass()), /* @ts-ignore */
62
75
  ...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
63
- $errorClass = input('', /* @ts-ignore */
76
+ $errorClass = computed(() => hlm(this._config.errorClass, this.errorClass()), /* @ts-ignore */
64
77
  ...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
65
- $hintClass = input('', /* @ts-ignore */
78
+ $hintClass = computed(() => hlm(this._config.hintClass, this.hintClass()), /* @ts-ignore */
66
79
  ...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
67
80
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
68
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormCheckbox, isStandalone: true, selector: "eg-form-checkbox", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checkboxClass: { classPropertyName: "checkboxClass", publicName: "checkboxClass", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, $errorClass: { classPropertyName: "$errorClass", publicName: "$errorClass", isSignal: true, isRequired: false, transformFunction: null }, $hintClass: { classPropertyName: "$hintClass", publicName: "$hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
81
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormCheckbox, isStandalone: true, selector: "eg-form-checkbox", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checkboxClass: { classPropertyName: "checkboxClass", publicName: "checkboxClass", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
69
82
  @let lbl = label();
70
83
  @let cnm = controlName();
71
84
  @let err = error();
@@ -158,7 +171,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
158
171
  </eg-form-field>
159
172
  `,
160
173
  }]
161
- }], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checkboxClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxClass", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], $errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "$errorClass", required: false }] }], $hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "$hintClass", required: false }] }] } });
174
+ }], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checkboxClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxClass", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
162
175
 
163
176
  /*
164
177
  * Public API Surface of form-checkbox
@@ -168,5 +181,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
168
181
  * Generated bundle index. Do not edit.
169
182
  */
170
183
 
171
- export { EgFormCheckbox };
184
+ export { EgFormCheckbox, injectEgFormCheckboxConfig, provideEgFormCheckboxConfig };
172
185
 
@@ -1,9 +1,11 @@
1
1
  import * as _angular_core from '@angular/core';
2
+ import { ValueProvider } from '@angular/core';
2
3
  import { ClassValue } from 'clsx';
3
4
 
4
5
  declare class EgFormCheckbox {
5
6
  private readonly formGroupDirective;
6
7
  private readonly generatedId;
8
+ private readonly _config;
7
9
  readonly userClass: _angular_core.InputSignal<ClassValue>;
8
10
  protected readonly _computedClass: _angular_core.Signal<string>;
9
11
  label: _angular_core.InputSignal<string>;
@@ -22,12 +24,29 @@ declare class EgFormCheckbox {
22
24
  describedBy(): string | null;
23
25
  checkboxClass: _angular_core.InputSignal<string>;
24
26
  labelClass: _angular_core.InputSignal<string>;
27
+ errorClass: _angular_core.InputSignal<string>;
28
+ hintClass: _angular_core.InputSignal<string>;
25
29
  $checkboxClass: _angular_core.Signal<string>;
26
30
  $labelClass: _angular_core.Signal<string>;
27
- $errorClass: _angular_core.InputSignal<string>;
28
- $hintClass: _angular_core.InputSignal<string>;
31
+ $errorClass: _angular_core.Signal<string>;
32
+ $hintClass: _angular_core.Signal<string>;
29
33
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormCheckbox, never>;
30
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormCheckbox, "eg-form-checkbox", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "checkboxClass": { "alias": "checkboxClass"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "$errorClass": { "alias": "$errorClass"; "required": false; "isSignal": true; }; "$hintClass": { "alias": "$hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
34
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormCheckbox, "eg-form-checkbox", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "checkboxClass": { "alias": "checkboxClass"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
31
35
  }
32
36
 
33
- export { EgFormCheckbox };
37
+ interface EgFormCheckboxConfig {
38
+ /**
39
+ * Global class defaults for `eg-form-checkbox` styling slots.
40
+ * Each is merged under the matching per-instance `*Class` input
41
+ * (library base < global config < per-instance).
42
+ */
43
+ checkboxClass?: string;
44
+ labelClass?: string;
45
+ errorClass?: string;
46
+ hintClass?: string;
47
+ }
48
+ declare function provideEgFormCheckboxConfig(config: Partial<EgFormCheckboxConfig>): ValueProvider;
49
+ declare function injectEgFormCheckboxConfig(): EgFormCheckboxConfig;
50
+
51
+ export { EgFormCheckbox, injectEgFormCheckboxConfig, provideEgFormCheckboxConfig };
52
+ export type { EgFormCheckboxConfig };
@@ -0,0 +1,202 @@
1
+ # Form Combobox (`@egose/shadcn-theme-ng/form-combobox`)
2
+
3
+ A ready-made reactive-form combobox: label + searchable dropdown + validation error/hint display in one tag. Supports `multiple` mode (chips anchor, `string[]` model, the default) and `single` mode (trigger button, `string | null` model).
4
+
5
+ The Angular implementation is a standalone wrapper: it renders `HlmFormField` / `HlmError` / `HlmHint` from `@egose/shadcn-theme-ng/form-field`, `HlmLabel`, and the `HlmCombobox*` parts from `@egose/shadcn-theme-ng/combobox` (`HlmComboboxMultiple` + chips for multi, `HlmCombobox` + trigger for single). The picker root is bound with `[formControlName]="controlName()"` (both brain variants implement `ControlValueAccessor`), so the parent `FormGroup` owns the value. It must live inside a `FormGroupDirective` (`[formGroup]` parent); ids come from `HlmFormIdGenerator` unless overridden.
6
+
7
+ > **Ships as:** `@egose/shadcn-theme-ng/form-combobox` and `@egose/shadcn-theme-ng-tw/form-combobox`
8
+ > (the `tw:`-prefixed Tailwind variant). Both expose the identical TypeScript surface; only the
9
+ > emitted Tailwind class strings differ. See the [package README](../../README.md) for install
10
+ > steps, peer dependencies, and Tailwind setup. Do not publish this project directory independently.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ # Plain Tailwind (no prefix)
16
+ npm install @egose/shadcn-theme-ng
17
+
18
+ # tw:-prefixed Tailwind variant
19
+ npm install @egose/shadcn-theme-ng-tw
20
+ ```
21
+
22
+ Peer dependencies (Angular, `@spartan-ng/brain`, `@ng-icons/*`, `rxjs`, …) are documented in the
23
+ [package README](../../README.md#peer-dependencies). This subpath additionally relies at runtime on
24
+ `@egose/shadcn-theme-ng/combobox`, `@egose/shadcn-theme-ng/form-field`, and
25
+ `@egose/shadcn-theme-ng/label`.
26
+
27
+ ## Imports
28
+
29
+ Exported from the subpath root (`projects/form-combobox/src/public-api.ts`):
30
+
31
+ ```ts
32
+ import { EgFormCombobox, provideEgFormComboboxConfig } from '@egose/shadcn-theme-ng/form-combobox';
33
+ // tw variant: replace with '@egose/shadcn-theme-ng-tw/form-combobox'
34
+ ```
35
+
36
+ ## Anatomy / Structure
37
+
38
+ ```html
39
+ <form [formGroup]="form">
40
+ <eg-form-combobox controlName="tags" label="Tags" [options]="tags" [required]="true" error="Pick at least one." />
41
+ </form>
42
+ ```
43
+
44
+ Selector (from source): `eg-form-combobox` (standalone component, host `tw:w-full`).
45
+
46
+ ## API reference
47
+
48
+ ### `EgFormCombobox` — `eg-form-combobox`
49
+
50
+ | Input | Type | Default | Description |
51
+ | -------------- | ------------------------ | ------------------------ | ----------------------------------------------------------------------------------------------------------- |
52
+ | `controlName` | `string` | `''` | `formControlName` key inside the parent `FormGroup`. **Required.** |
53
+ | `mode` | `'single' \| 'multiple'` | `'multiple'` | `multiple` renders chips + multi-select (`string[]`); `single` renders a trigger button (`string \| null`). |
54
+ | `label` | `string \| undefined` | — | Label text (hidden when omitted). |
55
+ | `error` | `string \| undefined` | — | Error text shown when invalid. |
56
+ | `hint` | `string \| undefined` | — | Hint text shown otherwise. |
57
+ | `controlId` | `string \| undefined` | — | Explicit id (first priority for `effectiveId`). |
58
+ | `id` | `string \| undefined` | — | Fallback id (second priority). |
59
+ | `placeholder` | `string` | `'Pick…'` | Search input placeholder. |
60
+ | `emptyText` | `string` | `'Nothing left to add.'` | Text shown when no option matches. |
61
+ | `disabled` | `boolean` | `false` | Locks interaction (form control stays enabled). |
62
+ | `required` | `boolean` | `false` | Shows a red `*` next to the label. |
63
+ | `options` | `string[]` | `[]` | Rendered as `hlm-combobox-item` entries. |
64
+ | `class` | `ClassValue` | `''` | Extra host classes (base `tw:w-full`). |
65
+ | `labelClass` | `string` | `''` | Extra label classes (base `tw:mb-1`). |
66
+ | `controlClass` | `string` | `''` | Extra multi-root classes. |
67
+ | `chipsClass` | `string` | `''` | Extra chips-anchor classes. |
68
+ | `errorClass` | `string` | `''` | Extra error classes (base `tw:mt-0`). |
69
+ | `hintClass` | `string` | `''` | Extra hint classes (base `tw:mt-0`). |
70
+
71
+ | Member | Description |
72
+ | -------------------- | ---------------------------------------------------------------------------------- |
73
+ | `effectiveId` | `controlId() \|\| id() \|\| generated` — wired to chip-input `id` and label `for`. |
74
+ | `errorId` / `hintId` | `effectiveId + '-error' / '-hint'`. |
75
+ | `selectedValues` | Current selection read reactively from the brain model — drives chip rendering. |
76
+
77
+ Requires a `[formGroup]` ancestor (injects `FormGroupDirective`, provides `ControlContainer → FormGroupDirective`).
78
+
79
+ ## Examples
80
+
81
+ ### 1. Required multi-select
82
+
83
+ ```ts
84
+ import { Component, inject } from '@angular/core';
85
+ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
86
+ import { EgFormCombobox } from '@egose/shadcn-theme-ng/form-combobox';
87
+
88
+ @Component({
89
+ selector: 'app-tags',
90
+ standalone: true,
91
+ imports: [ReactiveFormsModule, EgFormCombobox],
92
+ template: `
93
+ <form [formGroup]="form" (ngSubmit)="submit()">
94
+ <eg-form-combobox controlName="tags" label="Tags" [options]="tags" [required]="true" error="Pick at least one." />
95
+ <button type="submit" [disabled]="form.invalid">Save</button>
96
+ </form>
97
+ `,
98
+ })
99
+ export class TagsComponent {
100
+ private readonly fb = inject(FormBuilder);
101
+ readonly form = this.fb.group({ tags: [<string[]>[], Validators.required] });
102
+ readonly tags = ['Angular', 'React', 'Vue', 'Svelte'];
103
+ submit() {
104
+ console.log(this.form.value.tags);
105
+ }
106
+ }
107
+ ```
108
+
109
+ ### 2. Preselected with hint
110
+
111
+ ```ts
112
+ import { Component, inject } from '@angular/core';
113
+ import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
114
+ import { EgFormCombobox } from '@egose/shadcn-theme-ng/form-combobox';
115
+
116
+ @Component({
117
+ selector: 'app-stack',
118
+ standalone: true,
119
+ imports: [ReactiveFormsModule, EgFormCombobox],
120
+ template: `
121
+ <form [formGroup]="form">
122
+ <eg-form-combobox
123
+ controlName="stack"
124
+ label="Stack"
125
+ [options]="options"
126
+ placeholder="Add tag…"
127
+ hint="Type to filter, click to add, × to remove."
128
+ />
129
+ </form>
130
+ `,
131
+ })
132
+ export class StackComponent {
133
+ private readonly fb = inject(FormBuilder);
134
+ readonly form = this.fb.group({ stack: [['Angular']] });
135
+ readonly options = ['Angular', 'React', 'Vue', 'Svelte', 'Solid'];
136
+ }
137
+ ```
138
+
139
+ ### 3. Single-select dropdown
140
+
141
+ ```ts
142
+ import { Component, inject } from '@angular/core';
143
+ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
144
+ import { EgFormCombobox } from '@egose/shadcn-theme-ng/form-combobox';
145
+
146
+ @Component({
147
+ selector: 'app-fruit-single',
148
+ standalone: true,
149
+ imports: [ReactiveFormsModule, EgFormCombobox],
150
+ template: `
151
+ <form [formGroup]="form" (ngSubmit)="submit()">
152
+ <eg-form-combobox
153
+ controlName="fruit"
154
+ label="Fruit"
155
+ mode="single"
156
+ [options]="options"
157
+ placeholder="Select a fruit…"
158
+ [required]="true"
159
+ error="Fruit is required."
160
+ />
161
+ <button type="submit" [disabled]="form.invalid">Save</button>
162
+ </form>
163
+ `,
164
+ })
165
+ export class FruitSingleComponent {
166
+ private readonly fb = inject(FormBuilder);
167
+ readonly form = this.fb.group({ fruit: [null as string | null, Validators.required] });
168
+ readonly options = ['Apple', 'Banana', 'Cherry'];
169
+ submit() {
170
+ console.log(this.form.value.fruit);
171
+ }
172
+ }
173
+ ```
174
+
175
+ ## Accessibility notes
176
+
177
+ - Label `for` ↔ chip-search-input `id` wiring is automatic via `effectiveId` — always pass a `label`.
178
+ - The chip search input exposes no `aria-describedby`, so error/hint ids render without an input-level link.
179
+ - The required `*` is visual; pair with `Validators.required` so assistive tech and validation agree.
180
+
181
+ ## Theming / CSS variables
182
+
183
+ No component-specific CSS variables. Style per-instance via `class` / `labelClass` / `controlClass` / `chipsClass` / `errorClass` / `hintClass` (precedence: library base < global config < per-instance).
184
+
185
+ Global defaults per styling slot via the wrapper config:
186
+
187
+ ```ts
188
+ import { provideEgFormComboboxConfig } from '@egose/shadcn-theme-ng/form-combobox';
189
+
190
+ await bootstrapApplication(App, {
191
+ providers: [provideEgFormComboboxConfig({ labelClass: 'tw:font-medium' })],
192
+ });
193
+ ```
194
+
195
+ The host keeps `tw:w-full`; constrain width with `class` or a wrapping container.
196
+
197
+ ## Related subpaths
198
+
199
+ - `@egose/shadcn-theme-ng/combobox` — raw `HlmCombobox*` parts (single + multi) for custom layouts.
200
+ - `@egose/shadcn-theme-ng/form-autocomplete` — single-value text-search counterpart (`eg-form-autocomplete`).
201
+ - `@egose/shadcn-theme-ng/form-searchable-multiselect` — alternative multi-select with popover checkboxes.
202
+ - `@egose/shadcn-theme-ng/form-field` — `hlm-form-field` / `hlm-error` / `hlm-hint` used internally.
@@ -0,0 +1,273 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, viewChild, input, computed, Component } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
5
+ import { HlmFormIdGenerator, HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
6
+ import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
7
+ import { HlmCombobox, HlmComboboxChip, HlmComboboxChipInput, HlmComboboxChips, HlmComboboxContent, HlmComboboxEmpty, HlmComboboxInput, HlmComboboxItem, HlmComboboxList, HlmComboboxMultiple, HlmComboboxPortal, HlmComboboxTrigger } from '@egose/shadcn-theme-ng-tw/combobox';
8
+ import { BrnComboboxMultiple, BrnCombobox } from '@spartan-ng/brain/combobox';
9
+ import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
10
+
11
+ const EgFormComboboxConfigToken = new InjectionToken('EgFormComboboxConfig');
12
+ function provideEgFormComboboxConfig(config) {
13
+ return { provide: EgFormComboboxConfigToken, useValue: { ...config } };
14
+ }
15
+ function injectEgFormComboboxConfig() {
16
+ return inject(EgFormComboboxConfigToken, { optional: true }) ?? {};
17
+ }
18
+
19
+ class EgFormCombobox {
20
+ formGroupDirective = inject(FormGroupDirective);
21
+ generatedId = inject(HlmFormIdGenerator).generate('eg-form-combobox');
22
+ _config = injectEgFormComboboxConfig();
23
+ _picker = viewChild((BrnComboboxMultiple), /* @ts-ignore */
24
+ ...(ngDevMode ? [{ debugName: "_picker" }] : /* istanbul ignore next */ []));
25
+ _single = viewChild((BrnCombobox), /* @ts-ignore */
26
+ ...(ngDevMode ? [{ debugName: "_single" }] : /* istanbul ignore next */ []));
27
+ label = input(undefined, /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
29
+ controlId = input(undefined, /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
31
+ controlName = input('', /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "controlName" }] : /* istanbul ignore next */ []));
33
+ error = input(undefined, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
35
+ hint = input(undefined, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
37
+ id = input(undefined, /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
39
+ placeholder = input('Pick…', /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
41
+ emptyText = input('Nothing left to add.', /* @ts-ignore */
42
+ ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
43
+ disabled = input(false, /* @ts-ignore */
44
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
45
+ required = input(false, /* @ts-ignore */
46
+ ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
47
+ /**
48
+ * Selection mode. `multiple` renders chips + checkbox-style multi-select
49
+ * (`string[]` model); `single` renders a trigger button + dropdown
50
+ * (`string | null` model). Defaults to `multiple` (original behavior).
51
+ */
52
+ mode = input('multiple', /* @ts-ignore */
53
+ ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
54
+ options = input([], /* @ts-ignore */
55
+ ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
56
+ effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
57
+ ...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
58
+ errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
59
+ ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
60
+ hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
61
+ ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
62
+ /** Selected values read reactively from the brain model so chips track selection. */
63
+ selectedValues = computed(() => this._picker()?.value() ?? [], /* @ts-ignore */
64
+ ...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
65
+ /** Single-mode display value read reactively from the brain model. */
66
+ singleDisplay = computed(() => this._single()?.value() ?? null, /* @ts-ignore */
67
+ ...(ngDevMode ? [{ debugName: "singleDisplay" }] : /* istanbul ignore next */ []));
68
+ /**
69
+ * Combined lock for the brain `linkedSignal`-based disabled state: the raw
70
+ * input write always carries the resolved value, so a same-pass
71
+ * wrapper-toggle + `control.disable()` cannot clobber CVA state.
72
+ */
73
+ effectiveDisabled() {
74
+ return this.disabled() || !!this.formGroupDirective.form.get(this.controlName())?.disabled;
75
+ }
76
+ // Styling
77
+ userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
78
+ labelClass = input('', /* @ts-ignore */
79
+ ...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
80
+ controlClass = input('', /* @ts-ignore */
81
+ ...(ngDevMode ? [{ debugName: "controlClass" }] : /* istanbul ignore next */ []));
82
+ chipsClass = input('', /* @ts-ignore */
83
+ ...(ngDevMode ? [{ debugName: "chipsClass" }] : /* istanbul ignore next */ []));
84
+ errorClass = input('', /* @ts-ignore */
85
+ ...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
86
+ hintClass = input('', /* @ts-ignore */
87
+ ...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
88
+ // Computed classes (library base < global config < per-instance).
89
+ // NOTE: the chip search input exposes no aria-describedby, so error/hint
90
+ // ids render without an input-level describedby link.
91
+ $userClass = computed(() => hlm('tw:w-full', this.userClass()), /* @ts-ignore */
92
+ ...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
93
+ $labelClass = computed(() => hlm('tw:mb-1', this._config.labelClass, this.labelClass()), /* @ts-ignore */
94
+ ...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
95
+ $controlClass = computed(() => hlm(this._config.controlClass, this.controlClass()), /* @ts-ignore */
96
+ ...(ngDevMode ? [{ debugName: "$controlClass" }] : /* istanbul ignore next */ []));
97
+ $chipsClass = computed(() => hlm(this._config.chipsClass, this.chipsClass()), /* @ts-ignore */
98
+ ...(ngDevMode ? [{ debugName: "$chipsClass" }] : /* istanbul ignore next */ []));
99
+ $errorClass = computed(() => hlm('tw:mt-0', this._config.errorClass, this.errorClass()), /* @ts-ignore */
100
+ ...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
101
+ $hintClass = computed(() => hlm('tw:mt-0', this._config.hintClass, this.hintClass()), /* @ts-ignore */
102
+ ...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
103
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormCombobox, deps: [], target: i0.ɵɵFactoryTarget.Component });
104
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormCombobox, isStandalone: true, selector: "eg-form-combobox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, controlClass: { classPropertyName: "controlClass", publicName: "controlClass", isSignal: true, isRequired: false, transformFunction: null }, chipsClass: { classPropertyName: "chipsClass", publicName: "chipsClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "$userClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], viewQueries: [{ propertyName: "_picker", first: true, predicate: (BrnComboboxMultiple), descendants: true, isSignal: true }, { propertyName: "_single", first: true, predicate: (BrnCombobox), descendants: true, isSignal: true }], ngImport: i0, template: `
105
+ @let lbl = label();
106
+ @let cnm = controlName();
107
+ @let err = error();
108
+ @let hnt = hint();
109
+ @let rqrd = required();
110
+
111
+ <hlm-form-field>
112
+ @if (lbl) {
113
+ <label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
114
+ >{{ lbl }}
115
+ @if (rqrd) {
116
+ <span class="tw:text-red-500">*</span>
117
+ }
118
+ </label>
119
+ }
120
+
121
+ @if (mode() === 'single') {
122
+ <hlm-combobox [formControlName]="cnm" [disabled]="effectiveDisabled()">
123
+ <hlm-combobox-trigger [buttonId]="effectiveId()" [class]="$controlClass()">
124
+ {{ singleDisplay() ?? placeholder() }}
125
+ </hlm-combobox-trigger>
126
+ <hlm-combobox-content *hlmComboboxPortal>
127
+ <hlm-combobox-input [inputId]="effectiveId()" [placeholder]="placeholder()" />
128
+ <div hlmComboboxList>
129
+ @for (option of options(); track option) {
130
+ <hlm-combobox-item [value]="option">{{ option }}</hlm-combobox-item>
131
+ }
132
+ </div>
133
+ <div hlmComboboxEmpty>{{ emptyText() }}</div>
134
+ </hlm-combobox-content>
135
+ </hlm-combobox>
136
+ } @else {
137
+ <hlm-combobox-multiple [formControlName]="cnm" [disabled]="effectiveDisabled()" [class]="$controlClass()">
138
+ <hlm-combobox-chips [class]="$chipsClass()">
139
+ @for (v of selectedValues(); track v) {
140
+ <hlm-combobox-chip [value]="v">{{ v }}</hlm-combobox-chip>
141
+ }
142
+ <input hlmComboboxChipInput [id]="effectiveId()" [placeholder]="placeholder()" />
143
+ </hlm-combobox-chips>
144
+ <hlm-combobox-content *hlmComboboxPortal>
145
+ <div hlmComboboxList>
146
+ @for (option of options(); track option) {
147
+ <hlm-combobox-item [value]="option">{{ option }}</hlm-combobox-item>
148
+ }
149
+ </div>
150
+ <div hlmComboboxEmpty>{{ emptyText() }}</div>
151
+ </hlm-combobox-content>
152
+ </hlm-combobox-multiple>
153
+ }
154
+
155
+ @if (err) {
156
+ <hlm-error [id]="errorId()" [class]="$errorClass()">
157
+ {{ err }}
158
+ </hlm-error>
159
+ }
160
+
161
+ @if (hnt) {
162
+ <hlm-hint [id]="hintId()" [class]="$hintClass()">
163
+ {{ hnt }}
164
+ </hlm-hint>
165
+ }
166
+ </hlm-form-field>
167
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: HlmFormField, selector: "hlm-form-field", inputs: ["class"] }, { kind: "directive", type: HlmError, selector: "hlm-error", inputs: ["class"] }, { kind: "directive", type: HlmHint, selector: "hlm-hint", inputs: ["class"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { kind: "directive", type: HlmCombobox, selector: "[hlmCombobox],hlm-combobox" }, { kind: "component", type: HlmComboboxChip, selector: "hlm-combobox-chip", inputs: ["showRemove"] }, { kind: "directive", type: HlmComboboxChipInput, selector: "input[hlmComboboxChipInput]" }, { kind: "directive", type: HlmComboboxChips, selector: "[hlmComboboxChips],hlm-combobox-chips", inputs: ["forceInvalid"] }, { kind: "directive", type: HlmComboboxContent, selector: "[hlmComboboxContent],hlm-combobox-content" }, { kind: "directive", type: HlmComboboxEmpty, selector: "[hlmComboboxEmpty],hlm-combobox-empty" }, { kind: "component", type: HlmComboboxInput, selector: "hlm-combobox-input", inputs: ["inputId", "placeholder", "showTrigger", "showClear", "forceInvalid", "aria-invalid"] }, { kind: "component", type: HlmComboboxItem, selector: "hlm-combobox-item" }, { kind: "directive", type: HlmComboboxList, selector: "[hlmComboboxList]" }, { kind: "directive", type: HlmComboboxMultiple, selector: "[hlmComboboxMultiple],hlm-combobox-multiple" }, { kind: "directive", type: HlmComboboxPortal, selector: "[hlmComboboxPortal]" }, { kind: "component", type: HlmComboboxTrigger, selector: "hlm-combobox-trigger", inputs: ["class", "buttonId", "variant", "forceInvalid"] }] });
168
+ }
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormCombobox, decorators: [{
170
+ type: Component,
171
+ args: [{
172
+ selector: 'eg-form-combobox',
173
+ standalone: true,
174
+ host: {
175
+ '[class]': '$userClass()',
176
+ },
177
+ imports: [
178
+ ReactiveFormsModule,
179
+ HlmFormField,
180
+ HlmError,
181
+ HlmHint,
182
+ HlmLabel,
183
+ HlmCombobox,
184
+ HlmComboboxChip,
185
+ HlmComboboxChipInput,
186
+ HlmComboboxChips,
187
+ HlmComboboxContent,
188
+ HlmComboboxEmpty,
189
+ HlmComboboxInput,
190
+ HlmComboboxItem,
191
+ HlmComboboxList,
192
+ HlmComboboxMultiple,
193
+ HlmComboboxPortal,
194
+ HlmComboboxTrigger,
195
+ ],
196
+ providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
197
+ template: `
198
+ @let lbl = label();
199
+ @let cnm = controlName();
200
+ @let err = error();
201
+ @let hnt = hint();
202
+ @let rqrd = required();
203
+
204
+ <hlm-form-field>
205
+ @if (lbl) {
206
+ <label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
207
+ >{{ lbl }}
208
+ @if (rqrd) {
209
+ <span class="tw:text-red-500">*</span>
210
+ }
211
+ </label>
212
+ }
213
+
214
+ @if (mode() === 'single') {
215
+ <hlm-combobox [formControlName]="cnm" [disabled]="effectiveDisabled()">
216
+ <hlm-combobox-trigger [buttonId]="effectiveId()" [class]="$controlClass()">
217
+ {{ singleDisplay() ?? placeholder() }}
218
+ </hlm-combobox-trigger>
219
+ <hlm-combobox-content *hlmComboboxPortal>
220
+ <hlm-combobox-input [inputId]="effectiveId()" [placeholder]="placeholder()" />
221
+ <div hlmComboboxList>
222
+ @for (option of options(); track option) {
223
+ <hlm-combobox-item [value]="option">{{ option }}</hlm-combobox-item>
224
+ }
225
+ </div>
226
+ <div hlmComboboxEmpty>{{ emptyText() }}</div>
227
+ </hlm-combobox-content>
228
+ </hlm-combobox>
229
+ } @else {
230
+ <hlm-combobox-multiple [formControlName]="cnm" [disabled]="effectiveDisabled()" [class]="$controlClass()">
231
+ <hlm-combobox-chips [class]="$chipsClass()">
232
+ @for (v of selectedValues(); track v) {
233
+ <hlm-combobox-chip [value]="v">{{ v }}</hlm-combobox-chip>
234
+ }
235
+ <input hlmComboboxChipInput [id]="effectiveId()" [placeholder]="placeholder()" />
236
+ </hlm-combobox-chips>
237
+ <hlm-combobox-content *hlmComboboxPortal>
238
+ <div hlmComboboxList>
239
+ @for (option of options(); track option) {
240
+ <hlm-combobox-item [value]="option">{{ option }}</hlm-combobox-item>
241
+ }
242
+ </div>
243
+ <div hlmComboboxEmpty>{{ emptyText() }}</div>
244
+ </hlm-combobox-content>
245
+ </hlm-combobox-multiple>
246
+ }
247
+
248
+ @if (err) {
249
+ <hlm-error [id]="errorId()" [class]="$errorClass()">
250
+ {{ err }}
251
+ </hlm-error>
252
+ }
253
+
254
+ @if (hnt) {
255
+ <hlm-hint [id]="hintId()" [class]="$hintClass()">
256
+ {{ hnt }}
257
+ </hlm-hint>
258
+ }
259
+ </hlm-form-field>
260
+ `,
261
+ }]
262
+ }], propDecorators: { _picker: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnComboboxMultiple), { isSignal: true }] }], _single: [{ type: i0.ViewChild, args: [i0.forwardRef(() => BrnCombobox), { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], controlClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlClass", required: false }] }], chipsClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "chipsClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
263
+
264
+ /*
265
+ * Public API Surface of form-combobox
266
+ */
267
+
268
+ /**
269
+ * Generated bundle index. Do not edit.
270
+ */
271
+
272
+ export { EgFormCombobox, injectEgFormComboboxConfig, provideEgFormComboboxConfig };
273
+