@egose/shadcn-theme-ng-tw 0.2.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.
- package/README.md +1 -1
- package/alert/fesm2022/alert.mjs +1 -1
- package/autocomplete/fesm2022/autocomplete.mjs +1 -1
- package/button/fesm2022/button.mjs +3 -3
- package/checkbox/fesm2022/checkbox.mjs +6 -7
- package/checkbox/types/checkbox.d.ts +1 -1
- package/combobox/fesm2022/combobox.mjs +1 -1
- package/date-picker/README.md +15 -11
- package/date-picker/fesm2022/date-picker.mjs +148 -30
- package/date-picker/types/date-picker.d.ts +102 -9
- package/form-autocomplete/README.md +177 -0
- package/form-autocomplete/fesm2022/form-autocomplete.mjs +211 -0
- package/form-autocomplete/package.json +24 -0
- package/form-autocomplete/types/form-autocomplete.d.ts +61 -0
- package/form-checkbox/README.md +13 -3
- package/form-checkbox/fesm2022/form-checkbox.mjs +22 -9
- package/form-checkbox/types/form-checkbox.d.ts +23 -4
- package/form-combobox/README.md +202 -0
- package/form-combobox/fesm2022/form-combobox.mjs +273 -0
- package/form-combobox/package.json +24 -0
- package/form-combobox/types/form-combobox.d.ts +73 -0
- package/form-date-picker/README.md +48 -22
- package/form-date-picker/fesm2022/form-date-picker.mjs +60 -16
- package/form-date-picker/types/form-date-picker.d.ts +17 -1
- package/form-date-picker-multi/README.md +191 -0
- package/form-date-picker-multi/fesm2022/form-date-picker-multi.mjs +239 -0
- package/form-date-picker-multi/package.json +24 -0
- package/form-date-picker-multi/types/form-date-picker-multi.d.ts +58 -0
- package/form-date-range-picker/README.md +253 -0
- package/form-date-range-picker/fesm2022/form-date-range-picker.mjs +236 -0
- package/form-date-range-picker/package.json +24 -0
- package/form-date-range-picker/types/form-date-range-picker.d.ts +55 -0
- package/form-input-otp/README.md +194 -0
- package/form-input-otp/fesm2022/form-input-otp.mjs +194 -0
- package/form-input-otp/package.json +24 -0
- package/form-input-otp/types/form-input-otp.d.ts +58 -0
- package/form-month-year-picker/README.md +188 -0
- package/form-month-year-picker/fesm2022/form-month-year-picker.mjs +229 -0
- package/form-month-year-picker/package.json +24 -0
- package/form-month-year-picker/types/form-month-year-picker.d.ts +53 -0
- package/form-native-select/README.md +205 -0
- package/form-native-select/fesm2022/form-native-select.mjs +187 -0
- package/form-native-select/package.json +24 -0
- package/form-native-select/types/form-native-select.d.ts +57 -0
- package/form-phone-input/README.md +188 -0
- package/form-phone-input/fesm2022/form-phone-input.mjs +203 -0
- package/form-phone-input/package.json +24 -0
- package/form-phone-input/types/form-phone-input.d.ts +58 -0
- package/form-radio-group/README.md +198 -0
- package/form-radio-group/fesm2022/form-radio-group.mjs +211 -0
- package/form-radio-group/package.json +24 -0
- package/form-radio-group/types/form-radio-group.d.ts +63 -0
- package/form-searchable-multiselect/README.md +11 -1
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +19 -10
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +18 -1
- package/form-select/README.md +10 -0
- package/form-select/fesm2022/form-select.mjs +24 -15
- package/form-select/types/form-select.d.ts +18 -1
- package/form-slider/README.md +182 -0
- package/form-slider/fesm2022/form-slider.mjs +186 -0
- package/form-slider/package.json +24 -0
- package/form-slider/types/form-slider.d.ts +60 -0
- package/form-switch/README.md +173 -0
- package/form-switch/fesm2022/form-switch.mjs +178 -0
- package/form-switch/package.json +24 -0
- package/form-switch/types/form-switch.d.ts +50 -0
- package/form-text-input/README.md +10 -0
- package/form-text-input/fesm2022/form-text-input.mjs +19 -10
- package/form-text-input/types/form-text-input.d.ts +18 -1
- package/form-textarea/README.md +11 -1
- package/form-textarea/fesm2022/form-textarea.mjs +19 -10
- package/form-textarea/types/form-textarea.d.ts +18 -1
- package/form-toggle/README.md +186 -0
- package/form-toggle/fesm2022/form-toggle.mjs +241 -0
- package/form-toggle/package.json +24 -0
- package/form-toggle/types/form-toggle.d.ts +82 -0
- package/form-toggle-group/README.md +176 -0
- package/form-toggle-group/fesm2022/form-toggle-group.mjs +216 -0
- package/form-toggle-group/package.json +24 -0
- package/form-toggle-group/types/form-toggle-group.d.ts +65 -0
- package/input-group/fesm2022/input-group.mjs +20 -10
- package/input-group/types/input-group.d.ts +4 -1
- package/native-select/fesm2022/native-select.mjs +18 -6
- package/native-select/types/native-select.d.ts +7 -2
- package/package.json +57 -1
- package/phone-input/README.md +114 -0
- package/phone-input/fesm2022/phone-input.mjs +191 -0
- package/phone-input/package.json +24 -0
- package/phone-input/types/phone-input.d.ts +67 -0
- package/sheet/fesm2022/sheet.mjs +1 -1
- package/switch/fesm2022/switch.mjs +7 -5
- package/switch/types/switch.d.ts +2 -1
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { ValueProvider } from '@angular/core';
|
|
3
3
|
import { BrnDateInput, BrnDatePickerTriggerBase, BrnDatePickerBase } from '@spartan-ng/brain/date-picker';
|
|
4
|
-
import * as i1 from '@egose/shadcn-theme-ng-tw/input-group';
|
|
5
4
|
import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
|
5
|
+
import { ClassValue } from 'clsx';
|
|
6
|
+
import * as i1 from '@egose/shadcn-theme-ng-tw/input-group';
|
|
6
7
|
import { ControlValueAccessor } from '@angular/forms';
|
|
7
8
|
import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
8
9
|
import { BrnOverlayState } from '@spartan-ng/brain/overlay';
|
|
9
10
|
import * as _spartan_ng_brain_popover from '@spartan-ng/brain/popover';
|
|
10
11
|
import { BrnPopover } from '@spartan-ng/brain/popover';
|
|
11
12
|
import * as i1$1 from '@spartan-ng/brain/field';
|
|
12
|
-
import { ClassValue } from 'clsx';
|
|
13
13
|
|
|
14
14
|
declare class HlmDateMultiInput<T> extends BrnDateInput<T[]> implements BrnDatePickerTriggerBase {
|
|
15
15
|
private readonly _config;
|
|
16
|
+
/** Native `name` attribute forwarded to the inner `<input>`. */
|
|
17
|
+
readonly name: _angular_core.InputSignal<string | undefined>;
|
|
18
|
+
/** Native `readonly` state forwarded to the inner `<input>`. */
|
|
19
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
20
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
21
|
+
readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
|
|
22
|
+
/** Extra classes merged onto the host group container (over the `HlmInputGroup` base). */
|
|
23
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
24
|
+
/** Extra classes merged onto the inner `<input>` (over the input-group input base). */
|
|
25
|
+
readonly inputClass: _angular_core.InputSignal<ClassValue>;
|
|
26
|
+
protected readonly $inputClass: _angular_core.Signal<string>;
|
|
27
|
+
constructor();
|
|
16
28
|
/**
|
|
17
29
|
* Parses input text into dates. Return `null` for invalid input - the
|
|
18
30
|
* picker's dates are cleared while the text is preserved so the user can
|
|
@@ -31,7 +43,7 @@ declare class HlmDateMultiInput<T> extends BrnDateInput<T[]> implements BrnDateP
|
|
|
31
43
|
protected parseValue(value: string): T[] | null;
|
|
32
44
|
protected formatInputValue(value: T[]): string;
|
|
33
45
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmDateMultiInput<any>, never>;
|
|
34
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDateMultiInput<any>, "hlm-date-multi-input", never, { "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDates": { "alias": "formatInputDates"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
|
|
46
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDateMultiInput<any>, "hlm-date-multi-input", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDates": { "alias": "formatInputDates"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
declare const HLM_DATE_PICKER_VALUE_ACCESSOR: {
|
|
@@ -112,6 +124,16 @@ declare class HlmDatePickerInput<T> extends BrnDateInput<T> implements BrnDatePi
|
|
|
112
124
|
private readonly _config;
|
|
113
125
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
114
126
|
readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
|
|
127
|
+
/** Native `name` attribute forwarded to the inner `<input>`. */
|
|
128
|
+
readonly name: _angular_core.InputSignal<string | undefined>;
|
|
129
|
+
/** Native `readonly` state forwarded to the inner `<input>`. */
|
|
130
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
131
|
+
/** Extra classes merged onto the host group container (over the `HlmInputGroup` base). */
|
|
132
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
133
|
+
/** Extra classes merged onto the inner `<input>` (over the input-group input base). */
|
|
134
|
+
readonly inputClass: _angular_core.InputSignal<ClassValue>;
|
|
135
|
+
protected readonly $inputClass: _angular_core.Signal<string>;
|
|
136
|
+
constructor();
|
|
115
137
|
/**
|
|
116
138
|
* Parses input text into a date value. Return `null` for invalid
|
|
117
139
|
* input - the picker's date is cleared while the text is preserved so
|
|
@@ -130,7 +152,7 @@ declare class HlmDatePickerInput<T> extends BrnDateInput<T> implements BrnDatePi
|
|
|
130
152
|
protected parseValue(value: string): T | null;
|
|
131
153
|
protected formatInputValue(value: T): string;
|
|
132
154
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmDatePickerInput<any>, never>;
|
|
133
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDatePickerInput<any>, "hlm-date-picker-input", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDate": { "alias": "formatInputDate"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
|
|
155
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDatePickerInput<any>, "hlm-date-picker-input", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDate": { "alias": "formatInputDate"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
|
|
134
156
|
}
|
|
135
157
|
|
|
136
158
|
declare const HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR: {
|
|
@@ -164,9 +186,10 @@ declare class HlmDatePickerMulti<T> implements BrnDatePickerBase<T[]>, ControlVa
|
|
|
164
186
|
/** Defines how the date should be transformed before saving to model/form. */
|
|
165
187
|
readonly transformDates: _angular_core.InputSignal<(date: T[]) => T[]>;
|
|
166
188
|
protected readonly _popoverState: _angular_core.WritableSignal<BrnOverlayState | null>;
|
|
167
|
-
|
|
189
|
+
private readonly _formDisabled;
|
|
168
190
|
/** @internal The disabled state as a readonly signal */
|
|
169
191
|
readonly disabledState: _angular_core.Signal<boolean>;
|
|
192
|
+
protected readonly _disabled: _angular_core.Signal<boolean>;
|
|
170
193
|
readonly formattedDate: _angular_core.Signal<string | undefined>;
|
|
171
194
|
readonly dateChange: _angular_core.OutputEmitterRef<T[]>;
|
|
172
195
|
readonly labelableId: _angular_core.Signal<string | undefined>;
|
|
@@ -225,6 +248,18 @@ declare class HlmDatePickerTrigger implements BrnDatePickerTriggerBase {
|
|
|
225
248
|
|
|
226
249
|
declare class HlmDateRangeInput<T> extends BrnDateInput<[T, T]> implements BrnDatePickerTriggerBase {
|
|
227
250
|
private readonly _config;
|
|
251
|
+
/** Native `name` attribute forwarded to the inner `<input>`. */
|
|
252
|
+
readonly name: _angular_core.InputSignal<string | undefined>;
|
|
253
|
+
/** Native `readonly` state forwarded to the inner `<input>`. */
|
|
254
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
255
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
256
|
+
readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
|
|
257
|
+
/** Extra classes merged onto the host group container (over the `HlmInputGroup` base). */
|
|
258
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
259
|
+
/** Extra classes merged onto the inner `<input>` (over the input-group input base). */
|
|
260
|
+
readonly inputClass: _angular_core.InputSignal<ClassValue>;
|
|
261
|
+
protected readonly $inputClass: _angular_core.Signal<string>;
|
|
262
|
+
constructor();
|
|
228
263
|
/**
|
|
229
264
|
* Parses input text into a date range. Return `null` for invalid
|
|
230
265
|
* input - the picker's range is cleared while the text is preserved so
|
|
@@ -243,7 +278,7 @@ declare class HlmDateRangeInput<T> extends BrnDateInput<[T, T]> implements BrnDa
|
|
|
243
278
|
protected parseValue(value: string): [T, T] | null;
|
|
244
279
|
protected formatInputValue(value: [T, T]): string;
|
|
245
280
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmDateRangeInput<any>, never>;
|
|
246
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDateRangeInput<any>, "hlm-date-range-input", never, { "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDates": { "alias": "formatInputDates"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
|
|
281
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmDateRangeInput<any>, "hlm-date-range-input", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDates": { "alias": "formatInputDates"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
|
|
247
282
|
}
|
|
248
283
|
|
|
249
284
|
declare const HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR: {
|
|
@@ -275,9 +310,10 @@ declare class HlmDateRangePicker<T> implements BrnDatePickerBase<[T, T]>, Contro
|
|
|
275
310
|
/** Defines how the date should be transformed before saving to model/form. */
|
|
276
311
|
readonly transformDates: _angular_core.InputSignal<(date: [T, T]) => [T, T]>;
|
|
277
312
|
protected readonly _popoverState: _angular_core.WritableSignal<BrnOverlayState | null>;
|
|
278
|
-
|
|
313
|
+
private readonly _formDisabled;
|
|
279
314
|
/** @internal The disabled state as a readonly signal */
|
|
280
315
|
readonly disabledState: _angular_core.Signal<boolean>;
|
|
316
|
+
protected readonly _disabled: _angular_core.Signal<boolean>;
|
|
281
317
|
readonly formattedDate: _angular_core.Signal<string | undefined>;
|
|
282
318
|
readonly dateChange: _angular_core.OutputEmitterRef<[T, T] | null>;
|
|
283
319
|
readonly labelableId: _angular_core.Signal<string | undefined>;
|
|
@@ -311,6 +347,18 @@ declare class HlmDateRangePicker<T> implements BrnDatePickerBase<[T, T]>, Contro
|
|
|
311
347
|
|
|
312
348
|
declare class HlmMonthYearInput<T> extends BrnDateInput<T> implements BrnDatePickerTriggerBase {
|
|
313
349
|
private readonly _config;
|
|
350
|
+
/** Native `name` attribute forwarded to the inner `<input>`. */
|
|
351
|
+
readonly name: _angular_core.InputSignal<string | undefined>;
|
|
352
|
+
/** Native `readonly` state forwarded to the inner `<input>`. */
|
|
353
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
354
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
355
|
+
readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
|
|
356
|
+
/** Extra classes merged onto the host group container (over the `HlmInputGroup` base). */
|
|
357
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
358
|
+
/** Extra classes merged onto the inner `<input>` (over the input-group input base). */
|
|
359
|
+
readonly inputClass: _angular_core.InputSignal<ClassValue>;
|
|
360
|
+
protected readonly $inputClass: _angular_core.Signal<string>;
|
|
361
|
+
constructor();
|
|
314
362
|
/**
|
|
315
363
|
* Parses input text into a date value. Return `null` for invalid
|
|
316
364
|
* input - the picker's date is cleared while the text is preserved so
|
|
@@ -329,7 +377,7 @@ declare class HlmMonthYearInput<T> extends BrnDateInput<T> implements BrnDatePic
|
|
|
329
377
|
protected parseValue(value: string): T | null;
|
|
330
378
|
protected formatInputValue(value: T): string;
|
|
331
379
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmMonthYearInput<any>, never>;
|
|
332
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmMonthYearInput<any>, "hlm-month-year-input", never, { "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDate": { "alias": "formatInputDate"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
|
|
380
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmMonthYearInput<any>, "hlm-month-year-input", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDate": { "alias": "formatInputDate"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmInputGroup; inputs: {}; outputs: {}; }]>;
|
|
333
381
|
}
|
|
334
382
|
|
|
335
383
|
declare const HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR: {
|
|
@@ -359,9 +407,10 @@ declare class HlmMonthYearPicker<T> implements BrnDatePickerBase<T>, ControlValu
|
|
|
359
407
|
/** Defines how the date should be transformed before saving to model/form. */
|
|
360
408
|
readonly transformDate: _angular_core.InputSignal<(date: T) => T>;
|
|
361
409
|
protected readonly _popoverState: _angular_core.WritableSignal<BrnOverlayState | null>;
|
|
362
|
-
|
|
410
|
+
private readonly _formDisabled;
|
|
363
411
|
/** @internal The disabled state as a readonly signal */
|
|
364
412
|
readonly disabledState: _angular_core.Signal<boolean>;
|
|
413
|
+
protected readonly _disabled: _angular_core.Signal<boolean>;
|
|
365
414
|
readonly formattedDate: _angular_core.Signal<string | undefined>;
|
|
366
415
|
readonly dateChange: _angular_core.OutputEmitterRef<T | null>;
|
|
367
416
|
readonly labelableId: _angular_core.Signal<string | undefined>;
|
|
@@ -426,6 +475,17 @@ interface HlmDatePickerMultiConfig<T> {
|
|
|
426
475
|
* @returns the parsed date, or `null` when the value can't be parsed
|
|
427
476
|
*/
|
|
428
477
|
parseDate: (value: string) => T[] | null;
|
|
478
|
+
/**
|
|
479
|
+
* Global class defaults for form-wrapper styling slots.
|
|
480
|
+
* Each is merged under the matching per-instance `*Class` input
|
|
481
|
+
* (library base < global config < per-instance), mirroring how
|
|
482
|
+
* `formatDates` provides a global behavior default.
|
|
483
|
+
*/
|
|
484
|
+
labelClass?: string;
|
|
485
|
+
pickerClass?: string;
|
|
486
|
+
inputClass?: string;
|
|
487
|
+
errorClass?: string;
|
|
488
|
+
hintClass?: string;
|
|
429
489
|
}
|
|
430
490
|
declare function provideHlmDatePickerMultiConfig<T>(config: Partial<HlmDatePickerMultiConfig<T>>): ValueProvider;
|
|
431
491
|
declare function injectHlmDatePickerMultiConfig<T>(): HlmDatePickerMultiConfig<T>;
|
|
@@ -464,6 +524,17 @@ interface HlmDatePickerConfig<T> {
|
|
|
464
524
|
* @returns the parsed date, or `null` when the value can't be parsed
|
|
465
525
|
*/
|
|
466
526
|
parseDate: (value: string) => T | null;
|
|
527
|
+
/**
|
|
528
|
+
* Global class defaults for `eg-form-date-picker` styling slots.
|
|
529
|
+
* Each is merged under the matching per-instance `*Class` input
|
|
530
|
+
* (library base < global config < per-instance), mirroring how
|
|
531
|
+
* `formatDate` provides a global behavior default.
|
|
532
|
+
*/
|
|
533
|
+
labelClass?: string;
|
|
534
|
+
pickerClass?: string;
|
|
535
|
+
inputClass?: string;
|
|
536
|
+
errorClass?: string;
|
|
537
|
+
hintClass?: string;
|
|
467
538
|
}
|
|
468
539
|
declare function provideHlmDatePickerConfig<T>(config: Partial<HlmDatePickerConfig<T>>): ValueProvider;
|
|
469
540
|
declare function injectHlmDatePickerConfig<T>(): HlmDatePickerConfig<T>;
|
|
@@ -502,6 +573,17 @@ interface HlmDateRangePickerConfig<T> {
|
|
|
502
573
|
* @returns the parsed range, or `null` when the value can't be parsed
|
|
503
574
|
*/
|
|
504
575
|
parseDate: (value: string) => [T, T] | null;
|
|
576
|
+
/**
|
|
577
|
+
* Global class defaults for form-wrapper styling slots.
|
|
578
|
+
* Each is merged under the matching per-instance `*Class` input
|
|
579
|
+
* (library base < global config < per-instance), mirroring how
|
|
580
|
+
* `formatDates` provides a global behavior default.
|
|
581
|
+
*/
|
|
582
|
+
labelClass?: string;
|
|
583
|
+
pickerClass?: string;
|
|
584
|
+
inputClass?: string;
|
|
585
|
+
errorClass?: string;
|
|
586
|
+
hintClass?: string;
|
|
505
587
|
}
|
|
506
588
|
declare function provideHlmDateRangePickerConfig<T>(config: Partial<HlmDateRangePickerConfig<T>>): ValueProvider;
|
|
507
589
|
declare function injectHlmDateRangePickerConfig<T>(): HlmDateRangePickerConfig<T>;
|
|
@@ -540,6 +622,17 @@ interface HlmMonthYearPickerConfig<T> {
|
|
|
540
622
|
* @returns the parsed date, or `null` when the value can't be parsed
|
|
541
623
|
*/
|
|
542
624
|
parseDate: (value: string) => T | null;
|
|
625
|
+
/**
|
|
626
|
+
* Global class defaults for form-wrapper styling slots.
|
|
627
|
+
* Each is merged under the matching per-instance `*Class` input
|
|
628
|
+
* (library base < global config < per-instance), mirroring how
|
|
629
|
+
* `formatDate` provides a global behavior default.
|
|
630
|
+
*/
|
|
631
|
+
labelClass?: string;
|
|
632
|
+
pickerClass?: string;
|
|
633
|
+
inputClass?: string;
|
|
634
|
+
errorClass?: string;
|
|
635
|
+
hintClass?: string;
|
|
543
636
|
}
|
|
544
637
|
declare function provideHlmMonthYearPickerConfig<T>(config: Partial<HlmMonthYearPickerConfig<T>>): ValueProvider;
|
|
545
638
|
declare function injectHlmMonthYearPickerConfig<T>(): HlmMonthYearPickerConfig<T>;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Form Autocomplete (`@egose/shadcn-theme-ng/form-autocomplete`)
|
|
2
|
+
|
|
3
|
+
A ready-made reactive-form autocomplete field: label + `hlm-autocomplete` text input with suggestion list + validation error/hint display in one tag. The model is a `string`.
|
|
4
|
+
|
|
5
|
+
The Angular implementation is a standalone wrapper: it renders `HlmFormField` / `HlmError` / `HlmHint` from `@egose/shadcn-theme-ng/form-field`, `HlmLabel`, and the `HlmAutocomplete*` parts from `@egose/shadcn-theme-ng/autocomplete`. The autocomplete root is bound with `[formControlName]="controlName()"` (`BrnAutocomplete` implements `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-autocomplete` and `@egose/shadcn-theme-ng-tw/form-autocomplete`
|
|
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/autocomplete`, `@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-autocomplete/src/public-api.ts`):
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { EgFormAutocomplete, provideEgFormAutocompleteConfig } from '@egose/shadcn-theme-ng/form-autocomplete';
|
|
33
|
+
// tw variant: replace with '@egose/shadcn-theme-ng-tw/form-autocomplete'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Anatomy / Structure
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<form [formGroup]="form">
|
|
40
|
+
<eg-form-autocomplete
|
|
41
|
+
controlName="fruit"
|
|
42
|
+
label="Fruit"
|
|
43
|
+
[options]="fruits"
|
|
44
|
+
[required]="true"
|
|
45
|
+
error="Fruit is required."
|
|
46
|
+
/>
|
|
47
|
+
</form>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Selector (from source): `eg-form-autocomplete` (standalone component, host `tw:w-full`).
|
|
51
|
+
|
|
52
|
+
## API reference
|
|
53
|
+
|
|
54
|
+
### `EgFormAutocomplete` — `eg-form-autocomplete`
|
|
55
|
+
|
|
56
|
+
| Input | Type | Default | Description |
|
|
57
|
+
| -------------- | --------------------- | ------------------- | ------------------------------------------------------------------ |
|
|
58
|
+
| `controlName` | `string` | `''` | `formControlName` key inside the parent `FormGroup`. **Required.** |
|
|
59
|
+
| `label` | `string \| undefined` | — | Label text (hidden when omitted). |
|
|
60
|
+
| `error` | `string \| undefined` | — | Error text shown when invalid. |
|
|
61
|
+
| `hint` | `string \| undefined` | — | Hint text shown otherwise. |
|
|
62
|
+
| `controlId` | `string \| undefined` | — | Explicit id (first priority for `effectiveId`). |
|
|
63
|
+
| `id` | `string \| undefined` | — | Fallback id (second priority). |
|
|
64
|
+
| `placeholder` | `string` | `'Type to search…'` | Input placeholder. |
|
|
65
|
+
| `emptyText` | `string` | `'No result.'` | Text shown when no option matches. |
|
|
66
|
+
| `disabled` | `boolean` | `false` | Locks interaction (form control stays enabled). |
|
|
67
|
+
| `required` | `boolean` | `false` | Shows a red `*` next to the label. |
|
|
68
|
+
| `options` | `string[]` | `[]` | Rendered as `hlm-autocomplete-item` entries. |
|
|
69
|
+
| `class` | `ClassValue` | `''` | Extra host classes (base `tw:w-full`). |
|
|
70
|
+
| `labelClass` | `string` | `''` | Extra label classes (base `tw:mb-1`). |
|
|
71
|
+
| `controlClass` | `string` | `''` | Extra autocomplete-root classes. |
|
|
72
|
+
| `inputClass` | `string` | `''` | Extra text-input classes. |
|
|
73
|
+
| `errorClass` | `string` | `''` | Extra error classes (base `tw:mt-0`). |
|
|
74
|
+
| `hintClass` | `string` | `''` | Extra hint classes (base `tw:mt-0`). |
|
|
75
|
+
|
|
76
|
+
| Member | Description |
|
|
77
|
+
| -------------------- | ---------------------------------------------------------------------------------- |
|
|
78
|
+
| `effectiveId` | `controlId() \|\| id() \|\| generated` — wired to input `inputId` and label `for`. |
|
|
79
|
+
| `errorId` / `hintId` | `effectiveId + '-error' / '-hint'`. |
|
|
80
|
+
|
|
81
|
+
Requires a `[formGroup]` ancestor (injects `FormGroupDirective`, provides `ControlContainer → FormGroupDirective`).
|
|
82
|
+
|
|
83
|
+
## Examples
|
|
84
|
+
|
|
85
|
+
### 1. Basic required autocomplete
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import { Component, inject } from '@angular/core';
|
|
89
|
+
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
90
|
+
import { EgFormAutocomplete } from '@egose/shadcn-theme-ng/form-autocomplete';
|
|
91
|
+
|
|
92
|
+
@Component({
|
|
93
|
+
selector: 'app-fruit',
|
|
94
|
+
standalone: true,
|
|
95
|
+
imports: [ReactiveFormsModule, EgFormAutocomplete],
|
|
96
|
+
template: `
|
|
97
|
+
<form [formGroup]="form" (ngSubmit)="submit()">
|
|
98
|
+
<eg-form-autocomplete
|
|
99
|
+
controlName="fruit"
|
|
100
|
+
label="Fruit"
|
|
101
|
+
[options]="fruits"
|
|
102
|
+
[required]="true"
|
|
103
|
+
error="Fruit is required."
|
|
104
|
+
/>
|
|
105
|
+
<button type="submit" [disabled]="form.invalid">Continue</button>
|
|
106
|
+
</form>
|
|
107
|
+
`,
|
|
108
|
+
})
|
|
109
|
+
export class FruitComponent {
|
|
110
|
+
private readonly fb = inject(FormBuilder);
|
|
111
|
+
readonly form = this.fb.group({ fruit: ['', Validators.required] });
|
|
112
|
+
readonly fruits = ['Apple', 'Banana', 'Cherry'];
|
|
113
|
+
submit() {
|
|
114
|
+
console.log(this.form.value.fruit);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 2. Custom empty text + hint
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
import { Component, inject } from '@angular/core';
|
|
123
|
+
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
|
124
|
+
import { EgFormAutocomplete } from '@egose/shadcn-theme-ng/form-autocomplete';
|
|
125
|
+
|
|
126
|
+
@Component({
|
|
127
|
+
selector: 'app-city',
|
|
128
|
+
standalone: true,
|
|
129
|
+
imports: [ReactiveFormsModule, EgFormAutocomplete],
|
|
130
|
+
template: `
|
|
131
|
+
<form [formGroup]="form">
|
|
132
|
+
<eg-form-autocomplete
|
|
133
|
+
controlName="city"
|
|
134
|
+
label="City"
|
|
135
|
+
[options]="cities"
|
|
136
|
+
placeholder="Start typing…"
|
|
137
|
+
emptyText="No matching city."
|
|
138
|
+
hint="We ship to these cities."
|
|
139
|
+
/>
|
|
140
|
+
</form>
|
|
141
|
+
`,
|
|
142
|
+
})
|
|
143
|
+
export class CityComponent {
|
|
144
|
+
private readonly fb = inject(FormBuilder);
|
|
145
|
+
readonly form = this.fb.group({ city: [''] });
|
|
146
|
+
readonly cities = ['Berlin', 'Paris', 'Rome'];
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Accessibility notes
|
|
151
|
+
|
|
152
|
+
- Label `for` ↔ input `inputId` wiring is automatic via `effectiveId` — always pass a `label`.
|
|
153
|
+
- The autocomplete input exposes no `aria-describedby`, so error/hint ids render without an input-level link.
|
|
154
|
+
- The required `*` is visual; pair with `Validators.required` so assistive tech and validation agree.
|
|
155
|
+
|
|
156
|
+
## Theming / CSS variables
|
|
157
|
+
|
|
158
|
+
No component-specific CSS variables. Style per-instance via `class` / `labelClass` / `controlClass` / `inputClass` / `errorClass` / `hintClass` (precedence: library base < global config < per-instance).
|
|
159
|
+
|
|
160
|
+
Global defaults per styling slot via the wrapper config:
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
import { provideEgFormAutocompleteConfig } from '@egose/shadcn-theme-ng/form-autocomplete';
|
|
164
|
+
|
|
165
|
+
await bootstrapApplication(App, {
|
|
166
|
+
providers: [provideEgFormAutocompleteConfig({ inputClass: 'tw:text-sm', labelClass: 'tw:font-medium' })],
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
The host keeps `tw:w-full`; constrain width with `class` (e.g. `tw:max-w-sm`) or a wrapping container.
|
|
171
|
+
|
|
172
|
+
## Related subpaths
|
|
173
|
+
|
|
174
|
+
- `@egose/shadcn-theme-ng/autocomplete` — raw `HlmAutocomplete*` parts for custom layouts.
|
|
175
|
+
- `@egose/shadcn-theme-ng/form-combobox` — multi-select counterpart with chips (`eg-form-combobox`).
|
|
176
|
+
- `@egose/shadcn-theme-ng/form-field` — `hlm-form-field` / `hlm-error` / `hlm-hint` used internally.
|
|
177
|
+
- `@egose/shadcn-theme-ng/form-field-simple` — alternative minimal wrapper when you compose controls by hand.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, 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 { HlmAutocomplete, HlmAutocompleteContent, HlmAutocompleteEmpty, HlmAutocompleteGroup, HlmAutocompleteInput, HlmAutocompleteItem, HlmAutocompleteList, HlmAutocompleteLabel } from '@egose/shadcn-theme-ng-tw/autocomplete';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
|
+
|
|
10
|
+
const EgFormAutocompleteConfigToken = new InjectionToken('EgFormAutocompleteConfig');
|
|
11
|
+
function provideEgFormAutocompleteConfig(config) {
|
|
12
|
+
return { provide: EgFormAutocompleteConfigToken, useValue: { ...config } };
|
|
13
|
+
}
|
|
14
|
+
function injectEgFormAutocompleteConfig() {
|
|
15
|
+
return inject(EgFormAutocompleteConfigToken, { optional: true }) ?? {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class EgFormAutocomplete {
|
|
19
|
+
formGroupDirective = inject(FormGroupDirective);
|
|
20
|
+
generatedId = inject(HlmFormIdGenerator).generate('eg-form-autocomplete');
|
|
21
|
+
_config = injectEgFormAutocompleteConfig();
|
|
22
|
+
label = input(undefined, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
24
|
+
controlId = input(undefined, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
26
|
+
controlName = input('', /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "controlName" }] : /* istanbul ignore next */ []));
|
|
28
|
+
error = input(undefined, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
30
|
+
hint = input(undefined, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
32
|
+
id = input(undefined, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
34
|
+
placeholder = input('Type to search…', /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
36
|
+
emptyText = input('No result.', /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
38
|
+
disabled = input(false, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
40
|
+
required = input(false, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
42
|
+
options = input([], /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
44
|
+
effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
|
|
46
|
+
errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
48
|
+
hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
50
|
+
/**
|
|
51
|
+
* Combined lock for the brain `linkedSignal`-based disabled state: the raw
|
|
52
|
+
* input write always carries the resolved value, so a same-pass
|
|
53
|
+
* wrapper-toggle + `control.disable()` cannot clobber CVA state.
|
|
54
|
+
*/
|
|
55
|
+
effectiveDisabled() {
|
|
56
|
+
return this.disabled() || !!this.formGroupDirective.form.get(this.controlName())?.disabled;
|
|
57
|
+
}
|
|
58
|
+
// Styling
|
|
59
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
60
|
+
labelClass = input('', /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
|
|
62
|
+
controlClass = input('', /* @ts-ignore */
|
|
63
|
+
...(ngDevMode ? [{ debugName: "controlClass" }] : /* istanbul ignore next */ []));
|
|
64
|
+
inputClass = input('', /* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
|
|
66
|
+
errorClass = input('', /* @ts-ignore */
|
|
67
|
+
...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
|
|
68
|
+
hintClass = input('', /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
70
|
+
// Computed classes (library base < global config < per-instance).
|
|
71
|
+
// NOTE: the autocomplete input exposes no aria-describedby, so error/hint
|
|
72
|
+
// ids render without an input-level describedby link.
|
|
73
|
+
$userClass = computed(() => hlm('tw:w-full', this.userClass()), /* @ts-ignore */
|
|
74
|
+
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
75
|
+
$labelClass = computed(() => hlm('tw:mb-1', this._config.labelClass, this.labelClass()), /* @ts-ignore */
|
|
76
|
+
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
77
|
+
$controlClass = computed(() => hlm(this._config.controlClass, this.controlClass()), /* @ts-ignore */
|
|
78
|
+
...(ngDevMode ? [{ debugName: "$controlClass" }] : /* istanbul ignore next */ []));
|
|
79
|
+
$inputClass = computed(() => hlm(this._config.inputClass, this.inputClass()), /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "$inputClass" }] : /* istanbul ignore next */ []));
|
|
81
|
+
$errorClass = computed(() => hlm('tw:mt-0', this._config.errorClass, this.errorClass()), /* @ts-ignore */
|
|
82
|
+
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
83
|
+
$hintClass = computed(() => hlm('tw:mt-0', this._config.hintClass, this.hintClass()), /* @ts-ignore */
|
|
84
|
+
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
85
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormAutocomplete, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
86
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormAutocomplete, isStandalone: true, selector: "eg-form-autocomplete", 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 }, 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 }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", 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 }], ngImport: i0, template: `
|
|
87
|
+
@let lbl = label();
|
|
88
|
+
@let cnm = controlName();
|
|
89
|
+
@let err = error();
|
|
90
|
+
@let hnt = hint();
|
|
91
|
+
@let rqrd = required();
|
|
92
|
+
|
|
93
|
+
<hlm-form-field>
|
|
94
|
+
@if (lbl) {
|
|
95
|
+
<label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
|
|
96
|
+
>{{ lbl }}
|
|
97
|
+
@if (rqrd) {
|
|
98
|
+
<span class="tw:text-red-500">*</span>
|
|
99
|
+
}
|
|
100
|
+
</label>
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
<div hlmAutocomplete [formControlName]="cnm" [disabled]="effectiveDisabled()" [class]="$controlClass()">
|
|
104
|
+
<hlm-autocomplete-input [inputId]="effectiveId()" [placeholder]="placeholder()" [class]="$inputClass()" />
|
|
105
|
+
<hlm-autocomplete-content>
|
|
106
|
+
<div hlmAutocompleteList>
|
|
107
|
+
<div hlmAutocompleteGroup>
|
|
108
|
+
@for (option of options(); track option) {
|
|
109
|
+
<hlm-autocomplete-item [value]="option">{{ option }}</hlm-autocomplete-item>
|
|
110
|
+
}
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div hlmAutocompleteEmpty>{{ emptyText() }}</div>
|
|
114
|
+
</hlm-autocomplete-content>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
@if (err) {
|
|
118
|
+
<hlm-error [id]="errorId()" [class]="$errorClass()">
|
|
119
|
+
{{ err }}
|
|
120
|
+
</hlm-error>
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@if (hnt) {
|
|
124
|
+
<hlm-hint [id]="hintId()" [class]="$hintClass()">
|
|
125
|
+
{{ hnt }}
|
|
126
|
+
</hlm-hint>
|
|
127
|
+
}
|
|
128
|
+
</hlm-form-field>
|
|
129
|
+
`, 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: HlmAutocomplete, selector: "[hlmAutocomplete],hlm-autocomplete" }, { kind: "directive", type: HlmAutocompleteContent, selector: "[hlmAutocompleteContent],hlm-autocomplete-content" }, { kind: "directive", type: HlmAutocompleteEmpty, selector: "[hlmAutocompleteEmpty],hlm-autocomplete-empty" }, { kind: "directive", type: HlmAutocompleteGroup, selector: "[hlmAutocompleteGroup]" }, { kind: "component", type: HlmAutocompleteInput, selector: "hlm-autocomplete-input", inputs: ["inputId", "placeholder", "showSearch", "showClear", "forceInvalid", "aria-invalid"] }, { kind: "component", type: HlmAutocompleteItem, selector: "hlm-autocomplete-item" }, { kind: "directive", type: HlmAutocompleteList, selector: "[hlmAutocompleteList]" }] });
|
|
130
|
+
}
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormAutocomplete, decorators: [{
|
|
132
|
+
type: Component,
|
|
133
|
+
args: [{
|
|
134
|
+
selector: 'eg-form-autocomplete',
|
|
135
|
+
standalone: true,
|
|
136
|
+
host: {
|
|
137
|
+
'[class]': '$userClass()',
|
|
138
|
+
},
|
|
139
|
+
imports: [
|
|
140
|
+
ReactiveFormsModule,
|
|
141
|
+
HlmFormField,
|
|
142
|
+
HlmError,
|
|
143
|
+
HlmHint,
|
|
144
|
+
HlmLabel,
|
|
145
|
+
HlmAutocomplete,
|
|
146
|
+
HlmAutocompleteContent,
|
|
147
|
+
HlmAutocompleteEmpty,
|
|
148
|
+
HlmAutocompleteGroup,
|
|
149
|
+
HlmAutocompleteInput,
|
|
150
|
+
HlmAutocompleteItem,
|
|
151
|
+
HlmAutocompleteLabel,
|
|
152
|
+
HlmAutocompleteList,
|
|
153
|
+
],
|
|
154
|
+
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
155
|
+
template: `
|
|
156
|
+
@let lbl = label();
|
|
157
|
+
@let cnm = controlName();
|
|
158
|
+
@let err = error();
|
|
159
|
+
@let hnt = hint();
|
|
160
|
+
@let rqrd = required();
|
|
161
|
+
|
|
162
|
+
<hlm-form-field>
|
|
163
|
+
@if (lbl) {
|
|
164
|
+
<label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
|
|
165
|
+
>{{ lbl }}
|
|
166
|
+
@if (rqrd) {
|
|
167
|
+
<span class="tw:text-red-500">*</span>
|
|
168
|
+
}
|
|
169
|
+
</label>
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
<div hlmAutocomplete [formControlName]="cnm" [disabled]="effectiveDisabled()" [class]="$controlClass()">
|
|
173
|
+
<hlm-autocomplete-input [inputId]="effectiveId()" [placeholder]="placeholder()" [class]="$inputClass()" />
|
|
174
|
+
<hlm-autocomplete-content>
|
|
175
|
+
<div hlmAutocompleteList>
|
|
176
|
+
<div hlmAutocompleteGroup>
|
|
177
|
+
@for (option of options(); track option) {
|
|
178
|
+
<hlm-autocomplete-item [value]="option">{{ option }}</hlm-autocomplete-item>
|
|
179
|
+
}
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
<div hlmAutocompleteEmpty>{{ emptyText() }}</div>
|
|
183
|
+
</hlm-autocomplete-content>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
@if (err) {
|
|
187
|
+
<hlm-error [id]="errorId()" [class]="$errorClass()">
|
|
188
|
+
{{ err }}
|
|
189
|
+
</hlm-error>
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@if (hnt) {
|
|
193
|
+
<hlm-hint [id]="hintId()" [class]="$hintClass()">
|
|
194
|
+
{{ hnt }}
|
|
195
|
+
</hlm-hint>
|
|
196
|
+
}
|
|
197
|
+
</hlm-form-field>
|
|
198
|
+
`,
|
|
199
|
+
}]
|
|
200
|
+
}], propDecorators: { 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 }] }], 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 }] }], inputClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
|
|
201
|
+
|
|
202
|
+
/*
|
|
203
|
+
* Public API Surface of form-autocomplete
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Generated bundle index. Do not edit.
|
|
208
|
+
*/
|
|
209
|
+
|
|
210
|
+
export { EgFormAutocomplete, injectEgFormAutocompleteConfig, provideEgFormAutocompleteConfig };
|
|
211
|
+
|