@egose/shadcn-theme-ng 0.0.28 → 0.1.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 +130 -13
- package/accordion/README.md +2 -63
- package/accordion/fesm2022/accordion.mjs +27 -39
- package/alert/README.md +2 -63
- package/alert/fesm2022/alert.mjs +47 -47
- package/alert-dialog/fesm2022/alert-dialog.mjs +47 -47
- package/aspect-ratio/fesm2022/aspect-ratio.mjs +9 -9
- package/autocomplete/README.md +2 -63
- package/autocomplete/fesm2022/autocomplete.mjs +53 -71
- package/avatar/fesm2022/avatar.mjs +32 -32
- package/badge/README.md +2 -63
- package/badge/fesm2022/badge.mjs +57 -57
- package/basic-alert/README.md +2 -63
- package/basic-alert/fesm2022/basic-alert.mjs +6 -18
- package/breadcrumb/fesm2022/breadcrumb.mjs +33 -39
- package/button/README.md +2 -63
- package/button/fesm2022/button.mjs +126 -176
- package/button/types/button.d.ts +2 -2
- package/button-group/fesm2022/button-group.mjs +20 -20
- package/calendar/README.md +2 -63
- package/calendar/fesm2022/calendar.mjs +29 -743
- package/card/fesm2022/card.mjs +33 -33
- package/carousel/fesm2022/carousel.mjs +36 -78
- package/checkbox/README.md +2 -63
- package/checkbox/fesm2022/checkbox.mjs +20 -58
- package/checkbox/types/checkbox.d.ts +5 -4
- package/collapsible/fesm2022/collapsible.mjs +15 -15
- package/combobox/fesm2022/combobox.mjs +88 -224
- package/command/fesm2022/command.mjs +49 -109
- package/confirmation-dialog/README.md +2 -63
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +15 -40
- package/confirmation-dialog/types/confirmation-dialog.d.ts +8 -4
- package/context-menu/fesm2022/context-menu.mjs +9 -9
- package/date-picker/README.md +2 -63
- package/date-picker/fesm2022/date-picker.mjs +63 -266
- package/date-picker/types/date-picker.d.ts +7 -3
- package/dialog/README.md +2 -63
- package/dialog/fesm2022/dialog.mjs +45 -71
- package/drawer/fesm2022/drawer.mjs +44 -54
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +82 -70
- package/dropdown-menu/types/dropdown-menu.d.ts +4 -0
- package/empty/fesm2022/empty.mjs +30 -30
- package/field/fesm2022/field.mjs +56 -72
- package/form-checkbox/README.md +2 -63
- package/form-checkbox/fesm2022/form-checkbox.mjs +25 -85
- package/form-checkbox/types/form-checkbox.d.ts +7 -1
- package/form-date-picker/README.md +2 -63
- package/form-date-picker/fesm2022/form-date-picker.mjs +31 -84
- package/form-date-picker/types/form-date-picker.d.ts +7 -1
- package/form-field/README.md +2 -63
- package/form-field/fesm2022/form-field.mjs +33 -19
- package/form-field/types/form-field.d.ts +28 -20
- package/form-field-simple/README.md +2 -63
- package/form-field-simple/fesm2022/form-field-simple.mjs +4 -4
- package/form-searchable-multiselect/README.md +2 -63
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +31 -91
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +7 -1
- package/form-select/README.md +2 -63
- package/form-select/fesm2022/form-select.mjs +32 -149
- package/form-select/types/form-select.d.ts +7 -1
- package/form-text-input/README.md +2 -63
- package/form-text-input/fesm2022/form-text-input.mjs +35 -149
- package/form-text-input/types/form-text-input.d.ts +9 -12
- package/form-textarea/README.md +2 -63
- package/form-textarea/fesm2022/form-textarea.mjs +34 -109
- package/form-textarea/types/form-textarea.d.ts +8 -1
- package/hover-card/fesm2022/hover-card.mjs +19 -19
- package/icon/README.md +2 -63
- package/icon/fesm2022/icon.mjs +8 -8
- package/input/README.md +2 -63
- package/input/fesm2022/input.mjs +17 -12
- package/input/types/input.d.ts +2 -1
- package/input-group/fesm2022/input-group.mjs +33 -33
- package/input-otp/fesm2022/input-otp.mjs +26 -26
- package/item/fesm2022/item.mjs +53 -53
- package/kbd/fesm2022/kbd.mjs +12 -12
- package/label/README.md +2 -63
- package/label/fesm2022/label.mjs +10 -10
- package/label/types/label.d.ts +1 -1
- package/layout-simple/README.md +2 -63
- package/layout-simple/fesm2022/layout-simple.mjs +98 -429
- package/layout-simple/types/layout-simple.d.ts +25 -11
- package/menu/README.md +3 -0
- package/menu/fesm2022/menu.mjs +455 -0
- package/menu/package.json +24 -0
- package/menu/types/menu.d.ts +137 -0
- package/menubar/fesm2022/menubar.mjs +13 -13
- package/native-select/fesm2022/native-select.mjs +19 -19
- package/navigation-menu/fesm2022/navigation-menu.mjs +35 -47
- package/package.json +183 -154
- package/pagination/fesm2022/pagination.mjs +45 -331
- package/popover/README.md +2 -63
- package/popover/fesm2022/popover.mjs +30 -30
- package/progress/fesm2022/progress.mjs +13 -13
- package/radio-group/README.md +2 -63
- package/radio-group/fesm2022/radio-group.mjs +22 -19
- package/resizable/fesm2022/resizable.mjs +18 -26
- package/scroll-area/fesm2022/scroll-area.mjs +9 -9
- package/searchable-multiselect/README.md +2 -63
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +28 -117
- package/searchable-multiselect/types/searchable-multiselect.d.ts +8 -2
- package/select/README.md +2 -63
- package/select/fesm2022/select.mjs +71 -111
- package/select/types/select.d.ts +3 -1
- package/separator/README.md +2 -63
- package/separator/fesm2022/separator.mjs +9 -9
- package/separator/types/separator.d.ts +1 -1
- package/sheet/README.md +2 -63
- package/sheet/fesm2022/sheet.mjs +41 -53
- package/sidebar/fesm2022/sidebar.mjs +125 -227
- package/skeleton/fesm2022/skeleton.mjs +9 -9
- package/slider/fesm2022/slider.mjs +10 -80
- package/sonner/README.md +2 -63
- package/sonner/fesm2022/sonner.mjs +13 -13
- package/spinner/README.md +2 -63
- package/spinner/fesm2022/spinner.mjs +11 -11
- package/switch/README.md +2 -63
- package/switch/fesm2022/switch.mjs +13 -15
- package/table/fesm2022/table.mjs +41 -41
- package/tabs/README.md +2 -63
- package/tabs/fesm2022/tabs.mjs +35 -111
- package/textarea/fesm2022/textarea.mjs +9 -9
- package/toggle/fesm2022/toggle.mjs +13 -13
- package/toggle-group/fesm2022/toggle-group.mjs +13 -13
- package/toggle-group/types/toggle-group.d.ts +13 -7
- package/tooltip/README.md +2 -63
- package/tooltip/fesm2022/tooltip.mjs +14 -14
- package/typography/fesm2022/typography.mjs +53 -53
- package/typography/types/typography.d.ts +12 -12
- package/utils/README.md +2 -63
- package/utils/fesm2022/utils.mjs +68 -44
- package/accordion/fesm2022/accordion.mjs.map +0 -1
- package/alert/fesm2022/alert.mjs.map +0 -1
- package/alert-dialog/fesm2022/alert-dialog.mjs.map +0 -1
- package/aspect-ratio/fesm2022/aspect-ratio.mjs.map +0 -1
- package/autocomplete/fesm2022/autocomplete.mjs.map +0 -1
- package/avatar/fesm2022/avatar.mjs.map +0 -1
- package/badge/fesm2022/badge.mjs.map +0 -1
- package/basic-alert/fesm2022/basic-alert.mjs.map +0 -1
- package/breadcrumb/fesm2022/breadcrumb.mjs.map +0 -1
- package/button/fesm2022/button.mjs.map +0 -1
- package/button-group/fesm2022/button-group.mjs.map +0 -1
- package/calendar/fesm2022/calendar.mjs.map +0 -1
- package/card/fesm2022/card.mjs.map +0 -1
- package/carousel/fesm2022/carousel.mjs.map +0 -1
- package/checkbox/fesm2022/checkbox.mjs.map +0 -1
- package/collapsible/fesm2022/collapsible.mjs.map +0 -1
- package/combobox/fesm2022/combobox.mjs.map +0 -1
- package/command/fesm2022/command.mjs.map +0 -1
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +0 -1
- package/context-menu/fesm2022/context-menu.mjs.map +0 -1
- package/date-picker/fesm2022/date-picker.mjs.map +0 -1
- package/dialog/fesm2022/dialog.mjs.map +0 -1
- package/drawer/fesm2022/drawer.mjs.map +0 -1
- package/dropdown-menu/fesm2022/dropdown-menu.mjs.map +0 -1
- package/empty/fesm2022/empty.mjs.map +0 -1
- package/field/fesm2022/field.mjs.map +0 -1
- package/form-checkbox/fesm2022/form-checkbox.mjs.map +0 -1
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +0 -1
- package/form-field/fesm2022/form-field.mjs.map +0 -1
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +0 -1
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +0 -1
- package/form-select/fesm2022/form-select.mjs.map +0 -1
- package/form-text-input/fesm2022/form-text-input.mjs.map +0 -1
- package/form-textarea/fesm2022/form-textarea.mjs.map +0 -1
- package/hover-card/fesm2022/hover-card.mjs.map +0 -1
- package/icon/fesm2022/icon.mjs.map +0 -1
- package/input/fesm2022/input.mjs.map +0 -1
- package/input-group/fesm2022/input-group.mjs.map +0 -1
- package/input-otp/fesm2022/input-otp.mjs.map +0 -1
- package/item/fesm2022/item.mjs.map +0 -1
- package/kbd/fesm2022/kbd.mjs.map +0 -1
- package/label/fesm2022/label.mjs.map +0 -1
- package/layout-simple/fesm2022/layout-simple.mjs.map +0 -1
- package/menubar/fesm2022/menubar.mjs.map +0 -1
- package/native-select/fesm2022/native-select.mjs.map +0 -1
- package/navigation-menu/fesm2022/navigation-menu.mjs.map +0 -1
- package/pagination/fesm2022/pagination.mjs.map +0 -1
- package/popover/fesm2022/popover.mjs.map +0 -1
- package/progress/fesm2022/progress.mjs.map +0 -1
- package/radio-group/fesm2022/radio-group.mjs.map +0 -1
- package/resizable/fesm2022/resizable.mjs.map +0 -1
- package/scroll-area/fesm2022/scroll-area.mjs.map +0 -1
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +0 -1
- package/select/fesm2022/select.mjs.map +0 -1
- package/separator/fesm2022/separator.mjs.map +0 -1
- package/sheet/fesm2022/sheet.mjs.map +0 -1
- package/sidebar/fesm2022/sidebar.mjs.map +0 -1
- package/skeleton/fesm2022/skeleton.mjs.map +0 -1
- package/slider/fesm2022/slider.mjs.map +0 -1
- package/sonner/fesm2022/sonner.mjs.map +0 -1
- package/spinner/fesm2022/spinner.mjs.map +0 -1
- package/switch/fesm2022/switch.mjs.map +0 -1
- package/table/fesm2022/table.mjs.map +0 -1
- package/tabs/fesm2022/tabs.mjs.map +0 -1
- package/textarea/fesm2022/textarea.mjs.map +0 -1
- package/toggle/fesm2022/toggle.mjs.map +0 -1
- package/toggle-group/fesm2022/toggle-group.mjs.map +0 -1
- package/tooltip/fesm2022/tooltip.mjs.map +0 -1
- package/typography/fesm2022/typography.mjs.map +0 -1
- package/utils/fesm2022/utils.mjs.map +0 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, Component } from '@angular/core';
|
|
2
|
+
import { inject, input, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
|
-
import {
|
|
4
|
+
import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
|
|
5
5
|
import { HlmLabel } from '@egose/shadcn-theme-ng/label';
|
|
6
6
|
import { EgFormField } from '@egose/shadcn-theme-ng/form-field-simple';
|
|
7
|
-
import { HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
7
|
+
import { HlmFormIdGenerator, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
8
8
|
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
9
9
|
import { EgSearchableMultiselect } from '@egose/shadcn-theme-ng/searchable-multiselect';
|
|
10
10
|
|
|
11
11
|
class EgFormSearchableMultiselect {
|
|
12
|
+
formGroupDirective = inject(FormGroupDirective);
|
|
13
|
+
generatedId = inject(HlmFormIdGenerator).generate('eg-form-searchable-multiselect');
|
|
12
14
|
// Form field inputs
|
|
13
15
|
label = input(undefined, /* @ts-ignore */
|
|
14
16
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -21,7 +23,7 @@ class EgFormSearchableMultiselect {
|
|
|
21
23
|
hint = input(undefined, /* @ts-ignore */
|
|
22
24
|
...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
23
25
|
// HTML/control attributes
|
|
24
|
-
id = input(
|
|
26
|
+
id = input(undefined, /* @ts-ignore */
|
|
25
27
|
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
26
28
|
placeholder = input('Start typing to add…', /* @ts-ignore */
|
|
27
29
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
@@ -29,6 +31,20 @@ class EgFormSearchableMultiselect {
|
|
|
29
31
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
30
32
|
required = input(false, /* @ts-ignore */
|
|
31
33
|
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
34
|
+
effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
|
|
36
|
+
errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
38
|
+
hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
40
|
+
describedBy() {
|
|
41
|
+
const control = this.formGroupDirective.form.get(this.controlName());
|
|
42
|
+
return this.error() && control?.invalid && (control.dirty || control.touched)
|
|
43
|
+
? this.errorId()
|
|
44
|
+
: this.hint()
|
|
45
|
+
? this.hintId()
|
|
46
|
+
: null;
|
|
47
|
+
}
|
|
32
48
|
// Multiselect-specific
|
|
33
49
|
options = input([], /* @ts-ignore */
|
|
34
50
|
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ [])); // [{ label, value }]
|
|
@@ -43,106 +59,30 @@ class EgFormSearchableMultiselect {
|
|
|
43
59
|
hintClass = input('', /* @ts-ignore */
|
|
44
60
|
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
45
61
|
// Computed class names
|
|
46
|
-
$userClass = computed(() => hlm(
|
|
62
|
+
$userClass = computed(() => hlm("flex flex-col", this.userClass()), /* @ts-ignore */
|
|
47
63
|
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
48
|
-
$labelClass = computed(() => hlm(
|
|
64
|
+
$labelClass = computed(() => hlm("mb-1 gap-0", this.labelClass()), /* @ts-ignore */
|
|
49
65
|
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
50
|
-
$controlClass = computed(() => hlm(
|
|
66
|
+
$controlClass = computed(() => hlm("w-full", this.controlClass()), /* @ts-ignore */
|
|
51
67
|
...(ngDevMode ? [{ debugName: "$controlClass" }] : /* istanbul ignore next */ []));
|
|
52
|
-
$errorClass = computed(() => hlm(
|
|
68
|
+
$errorClass = computed(() => hlm("mt-0", this.errorClass()), /* @ts-ignore */
|
|
53
69
|
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
54
|
-
$hintClass = computed(() => hlm(
|
|
70
|
+
$hintClass = computed(() => hlm("mt-0", this.hintClass()), /* @ts-ignore */
|
|
55
71
|
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
56
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
57
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
58
|
-
@let lbl = label();
|
|
59
|
-
@let cid = controlId();
|
|
60
|
-
@let cnm = controlName();
|
|
61
|
-
@let err = error();
|
|
62
|
-
@let hnt = hint();
|
|
63
|
-
@let rqrd = required();
|
|
64
|
-
|
|
65
|
-
<eg-form-field>
|
|
66
|
-
@if (lbl) {
|
|
67
|
-
<span hlmLabel [class]="$labelClass()">
|
|
68
|
-
{{ lbl }}
|
|
69
|
-
@if (rqrd) {
|
|
70
|
-
<span class="text-red-500">*</span>
|
|
71
|
-
}
|
|
72
|
-
</span>
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
<eg-searchable-multiselect
|
|
76
|
-
[id]="cid || id()"
|
|
77
|
-
[options]="options()"
|
|
78
|
-
[placeholder]="placeholder()"
|
|
79
|
-
[formControlName]="cnm"
|
|
80
|
-
[required]="rqrd"
|
|
81
|
-
[class]="$controlClass()"
|
|
82
|
-
></eg-searchable-multiselect>
|
|
83
|
-
|
|
84
|
-
@if (err) {
|
|
85
|
-
<hlm-error [class]="$errorClass()">
|
|
86
|
-
{{ err }}
|
|
87
|
-
</hlm-error>
|
|
88
|
-
}
|
|
89
|
-
@if (hnt) {
|
|
90
|
-
<hlm-hint [class]="$hintClass()">
|
|
91
|
-
{{ hnt }}
|
|
92
|
-
</hlm-hint>
|
|
93
|
-
}
|
|
94
|
-
</eg-form-field>
|
|
95
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: EgFormField, selector: "eg-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: "component", type: EgSearchableMultiselect, selector: "eg-searchable-multiselect", inputs: ["options", "placeholder", "class", "value"], outputs: ["valueChange"] }] });
|
|
72
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSearchableMultiselect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormSearchableMultiselect, isStandalone: true, selector: "eg-form-searchable-multiselect", 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 }, 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 }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: "\n @let lbl = label();\n @let cnm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <eg-form-field>\n @if (lbl) {\n <label hlmLabel [for]=\"effectiveId()\" [class]=\"$labelClass()\">\n {{ lbl }}\n @if (rqrd) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n }\n\n <eg-searchable-multiselect\n [id]=\"effectiveId()\"\n [options]=\"options()\"\n [placeholder]=\"placeholder()\"\n [formControlName]=\"cnm\"\n [required]=\"rqrd\"\n [wrapperDisabled]=\"disabled()\"\n [ariaLabel]=\"lbl\"\n [ariaDescribedby]=\"describedBy()\"\n [class]=\"$controlClass()\"\n ></eg-searchable-multiselect>\n\n @if (err) {\n <hlm-error [id]=\"errorId()\" [class]=\"$errorClass()\">\n {{ err }}\n </hlm-error>\n }\n @if (hnt) {\n <hlm-hint [id]=\"hintId()\" [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </eg-form-field>\n ", isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: EgFormField, selector: "eg-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: "component", type: EgSearchableMultiselect, selector: "eg-searchable-multiselect", inputs: ["options", "placeholder", "id", "disabled", "wrapperDisabled", "ariaLabel", "ariaDescribedby", "class", "value"], outputs: ["valueChange"] }] });
|
|
96
74
|
}
|
|
97
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSearchableMultiselect, decorators: [{
|
|
98
76
|
type: Component,
|
|
99
77
|
args: [{
|
|
100
78
|
selector: 'eg-form-searchable-multiselect',
|
|
101
79
|
standalone: true,
|
|
102
80
|
host: {
|
|
103
|
-
class:
|
|
81
|
+
class: "w-full",
|
|
104
82
|
},
|
|
105
83
|
imports: [ReactiveFormsModule, EgFormField, HlmError, HlmHint, HlmLabel, EgSearchableMultiselect],
|
|
106
84
|
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
107
|
-
template:
|
|
108
|
-
@let lbl = label();
|
|
109
|
-
@let cid = controlId();
|
|
110
|
-
@let cnm = controlName();
|
|
111
|
-
@let err = error();
|
|
112
|
-
@let hnt = hint();
|
|
113
|
-
@let rqrd = required();
|
|
114
|
-
|
|
115
|
-
<eg-form-field>
|
|
116
|
-
@if (lbl) {
|
|
117
|
-
<span hlmLabel [class]="$labelClass()">
|
|
118
|
-
{{ lbl }}
|
|
119
|
-
@if (rqrd) {
|
|
120
|
-
<span class="text-red-500">*</span>
|
|
121
|
-
}
|
|
122
|
-
</span>
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
<eg-searchable-multiselect
|
|
126
|
-
[id]="cid || id()"
|
|
127
|
-
[options]="options()"
|
|
128
|
-
[placeholder]="placeholder()"
|
|
129
|
-
[formControlName]="cnm"
|
|
130
|
-
[required]="rqrd"
|
|
131
|
-
[class]="$controlClass()"
|
|
132
|
-
></eg-searchable-multiselect>
|
|
133
|
-
|
|
134
|
-
@if (err) {
|
|
135
|
-
<hlm-error [class]="$errorClass()">
|
|
136
|
-
{{ err }}
|
|
137
|
-
</hlm-error>
|
|
138
|
-
}
|
|
139
|
-
@if (hnt) {
|
|
140
|
-
<hlm-hint [class]="$hintClass()">
|
|
141
|
-
{{ hnt }}
|
|
142
|
-
</hlm-hint>
|
|
143
|
-
}
|
|
144
|
-
</eg-form-field>
|
|
145
|
-
`,
|
|
85
|
+
template: "\n @let lbl = label();\n @let cnm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <eg-form-field>\n @if (lbl) {\n <label hlmLabel [for]=\"effectiveId()\" [class]=\"$labelClass()\">\n {{ lbl }}\n @if (rqrd) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n }\n\n <eg-searchable-multiselect\n [id]=\"effectiveId()\"\n [options]=\"options()\"\n [placeholder]=\"placeholder()\"\n [formControlName]=\"cnm\"\n [required]=\"rqrd\"\n [wrapperDisabled]=\"disabled()\"\n [ariaLabel]=\"lbl\"\n [ariaDescribedby]=\"describedBy()\"\n [class]=\"$controlClass()\"\n ></eg-searchable-multiselect>\n\n @if (err) {\n <hlm-error [id]=\"errorId()\" [class]=\"$errorClass()\">\n {{ err }}\n </hlm-error>\n }\n @if (hnt) {\n <hlm-hint [id]=\"hintId()\" [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </eg-form-field>\n ",
|
|
146
86
|
}]
|
|
147
87
|
}], 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 }] }], 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 }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
|
|
148
88
|
|
|
@@ -155,4 +95,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
155
95
|
*/
|
|
156
96
|
|
|
157
97
|
export { EgFormSearchableMultiselect };
|
|
158
|
-
|
|
98
|
+
|
|
@@ -3,15 +3,21 @@ import { ClassValue } from 'clsx';
|
|
|
3
3
|
import { SelectOption } from '@egose/shadcn-theme-ng/searchable-multiselect';
|
|
4
4
|
|
|
5
5
|
declare class EgFormSearchableMultiselect {
|
|
6
|
+
private readonly formGroupDirective;
|
|
7
|
+
private readonly generatedId;
|
|
6
8
|
label: _angular_core.InputSignal<string | undefined>;
|
|
7
9
|
controlId: _angular_core.InputSignal<string | undefined>;
|
|
8
10
|
controlName: _angular_core.InputSignal<string>;
|
|
9
11
|
error: _angular_core.InputSignal<string | undefined>;
|
|
10
12
|
hint: _angular_core.InputSignal<string | undefined>;
|
|
11
|
-
id: _angular_core.InputSignal<string>;
|
|
13
|
+
id: _angular_core.InputSignal<string | undefined>;
|
|
12
14
|
placeholder: _angular_core.InputSignal<string>;
|
|
13
15
|
disabled: _angular_core.InputSignal<boolean>;
|
|
14
16
|
required: _angular_core.InputSignal<boolean>;
|
|
17
|
+
readonly effectiveId: _angular_core.Signal<string>;
|
|
18
|
+
readonly errorId: _angular_core.Signal<string>;
|
|
19
|
+
readonly hintId: _angular_core.Signal<string>;
|
|
20
|
+
describedBy(): string | null;
|
|
15
21
|
options: _angular_core.InputSignal<SelectOption[]>;
|
|
16
22
|
userClass: _angular_core.InputSignal<ClassValue>;
|
|
17
23
|
labelClass: _angular_core.InputSignal<string>;
|
package/form-select/README.md
CHANGED
|
@@ -1,64 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Form Select Subpath
|
|
2
2
|
|
|
3
|
-
This project
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
ng generate component component-name
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
ng generate --help
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Building
|
|
20
|
-
|
|
21
|
-
To build the library, run:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
ng build form-select
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
-
|
|
29
|
-
### Publishing the Library
|
|
30
|
-
|
|
31
|
-
Once the project is built, you can publish your library by following these steps:
|
|
32
|
-
|
|
33
|
-
1. Navigate to the `dist` directory:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
cd dist/form-select
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
-
```bash
|
|
41
|
-
npm publish
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Running unit tests
|
|
45
|
-
|
|
46
|
-
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
ng test
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Running end-to-end tests
|
|
53
|
-
|
|
54
|
-
For end-to-end (e2e) testing, run:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
ng e2e
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
61
|
-
|
|
62
|
-
## Additional Resources
|
|
63
|
-
|
|
64
|
-
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
3
|
+
This project ships only as `@egose/shadcn-theme-ng/form-select` or `@egose/shadcn-theme-ng-tw/form-select`. See the [package README](../../README.md) for installation, compatibility, Tailwind variant, test, and release guidance. Do not publish this project directory independently.
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, Component } from '@angular/core';
|
|
2
|
+
import { inject, input, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
|
-
import {
|
|
5
|
-
import { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
4
|
+
import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
|
|
5
|
+
import { HlmFormIdGenerator, HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
6
6
|
import { HlmLabel } from '@egose/shadcn-theme-ng/label';
|
|
7
7
|
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
8
8
|
import { BrnSelectImports } from '@spartan-ng/brain/select';
|
|
9
9
|
import * as i2 from '@egose/shadcn-theme-ng/select';
|
|
10
|
-
import { HlmSelectImports, HlmSelect, HlmSelectTrigger, HlmSelectValue, HlmSelectContent, HlmSelectItem, HlmSelectLabel
|
|
10
|
+
import { HlmSelectImports, HlmSelect, HlmSelectTrigger, HlmSelectValue, HlmSelectContent, HlmSelectItem, HlmSelectLabel } from '@egose/shadcn-theme-ng/select';
|
|
11
11
|
|
|
12
12
|
class EgFormSelect {
|
|
13
|
+
formGroupDirective = inject(FormGroupDirective);
|
|
14
|
+
generatedId = inject(HlmFormIdGenerator).generate('eg-form-select');
|
|
13
15
|
label = input(undefined, /* @ts-ignore */
|
|
14
16
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
15
17
|
controlId = input(undefined, /* @ts-ignore */
|
|
@@ -21,7 +23,7 @@ class EgFormSelect {
|
|
|
21
23
|
hint = input(undefined, /* @ts-ignore */
|
|
22
24
|
...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
23
25
|
// HTML/select attributes
|
|
24
|
-
id = input(
|
|
26
|
+
id = input(undefined, /* @ts-ignore */
|
|
25
27
|
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
26
28
|
placeholder = input('', /* @ts-ignore */
|
|
27
29
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
@@ -29,6 +31,20 @@ class EgFormSelect {
|
|
|
29
31
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
30
32
|
required = input(false, /* @ts-ignore */
|
|
31
33
|
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
34
|
+
effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
|
|
36
|
+
errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
38
|
+
hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
40
|
+
describedBy() {
|
|
41
|
+
const control = this.formGroupDirective.form.get(this.controlName());
|
|
42
|
+
return this.error() && control?.invalid && (control.dirty || control.touched)
|
|
43
|
+
? this.errorId()
|
|
44
|
+
: this.hint()
|
|
45
|
+
? this.hintId()
|
|
46
|
+
: null;
|
|
47
|
+
}
|
|
32
48
|
// Select-specific
|
|
33
49
|
multiple = input(false, /* @ts-ignore */
|
|
34
50
|
...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
@@ -47,92 +63,26 @@ class EgFormSelect {
|
|
|
47
63
|
hintClass = input('', /* @ts-ignore */
|
|
48
64
|
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
49
65
|
// Computed classes
|
|
50
|
-
$userClass = computed(() => hlm(
|
|
66
|
+
$userClass = computed(() => hlm("flex flex-col", this.userClass()), /* @ts-ignore */
|
|
51
67
|
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
52
|
-
$labelClass = computed(() => hlm(
|
|
68
|
+
$labelClass = computed(() => hlm("mb-1 gap-0", this.labelClass()), /* @ts-ignore */
|
|
53
69
|
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
54
|
-
$selectClass = computed(() => hlm(
|
|
70
|
+
$selectClass = computed(() => hlm("w-full", this.selectClass()), /* @ts-ignore */
|
|
55
71
|
...(ngDevMode ? [{ debugName: "$selectClass" }] : /* istanbul ignore next */ []));
|
|
56
|
-
$errorClass = computed(() => hlm(
|
|
72
|
+
$errorClass = computed(() => hlm("mt-0", this.errorClass()), /* @ts-ignore */
|
|
57
73
|
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
58
|
-
$hintClass = computed(() => hlm(
|
|
74
|
+
$hintClass = computed(() => hlm("mt-0", this.hintClass()), /* @ts-ignore */
|
|
59
75
|
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
60
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
61
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
62
|
-
@let lbl = label();
|
|
63
|
-
@let cid = controlId();
|
|
64
|
-
@let cnm = controlName();
|
|
65
|
-
@let err = error();
|
|
66
|
-
@let hnt = hint();
|
|
67
|
-
@let rqrd = required();
|
|
68
|
-
|
|
69
|
-
<hlm-form-field>
|
|
70
|
-
@if (lbl) {
|
|
71
|
-
<span hlmLabel [class]="$labelClass()"
|
|
72
|
-
>{{ lbl }}
|
|
73
|
-
@if (rqrd) {
|
|
74
|
-
<span class="text-red-500">*</span>
|
|
75
|
-
}
|
|
76
|
-
</span>
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
@if (multiple()) {
|
|
80
|
-
<brn-select-multiple hlmSelect [id]="cid || id()" [formControlName]="cnm">
|
|
81
|
-
<hlm-select-trigger [class]="$selectClass()">
|
|
82
|
-
<hlm-select-value [placeholder]="placeholder()" />
|
|
83
|
-
</hlm-select-trigger>
|
|
84
|
-
|
|
85
|
-
<hlm-select-content>
|
|
86
|
-
@if (options().length) {
|
|
87
|
-
@if (optionsLabel()) {
|
|
88
|
-
<hlm-select-label>{{ optionsLabel() }}</hlm-select-label>
|
|
89
|
-
}
|
|
90
|
-
@for (option of options(); track option.value) {
|
|
91
|
-
<hlm-select-item [value]="option.value">{{ option.label }}</hlm-select-item>
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
</hlm-select-content>
|
|
95
|
-
</brn-select-multiple>
|
|
96
|
-
} @else {
|
|
97
|
-
<brn-select hlmSelect [id]="cid || id()" [formControlName]="cnm">
|
|
98
|
-
<hlm-select-trigger [class]="$selectClass()">
|
|
99
|
-
<hlm-select-value [placeholder]="placeholder()" />
|
|
100
|
-
</hlm-select-trigger>
|
|
101
|
-
|
|
102
|
-
<hlm-select-content>
|
|
103
|
-
@if (options().length) {
|
|
104
|
-
@if (optionsLabel()) {
|
|
105
|
-
<hlm-select-label>{{ optionsLabel() }}</hlm-select-label>
|
|
106
|
-
}
|
|
107
|
-
@for (option of options(); track option.value) {
|
|
108
|
-
<hlm-select-item [value]="option.value">{{ option.label }}</hlm-select-item>
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
</hlm-select-content>
|
|
112
|
-
</brn-select>
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
@if (err) {
|
|
116
|
-
<hlm-error [class]="$errorClass()">
|
|
117
|
-
{{ err }}
|
|
118
|
-
</hlm-error>
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
@if (hnt) {
|
|
122
|
-
<hlm-hint [class]="$hintClass()">
|
|
123
|
-
{{ hnt }}
|
|
124
|
-
</hlm-hint>
|
|
125
|
-
}
|
|
126
|
-
</hlm-form-field>
|
|
127
|
-
`, 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: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectLabel, selector: "[hlmSelectLabel],hlm-select-label" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }] });
|
|
76
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
77
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormSelect, isStandalone: true, selector: "eg-form-select", 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 }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionsLabel: { classPropertyName: "optionsLabel", publicName: "optionsLabel", 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 }, selectClass: { classPropertyName: "selectClass", publicName: "selectClass", 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: { classAttribute: "w-full" }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: "\n @let lbl = label();\n @let cnm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <hlm-form-field>\n @if (lbl) {\n <label hlmLabel [for]=\"effectiveId()\" [class]=\"$labelClass()\"\n >{{ lbl }}\n @if (rqrd) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n }\n\n @if (multiple()) {\n <brn-select-multiple hlmSelect [formControlName]=\"cnm\">\n <hlm-select-trigger\n [buttonId]=\"effectiveId()\"\n [ariaDescribedby]=\"describedBy()\"\n [wrapperDisabled]=\"disabled()\"\n [class]=\"$selectClass()\"\n >\n <hlm-select-value [placeholder]=\"placeholder()\" />\n </hlm-select-trigger>\n\n <hlm-select-content>\n @if (options().length) {\n @if (optionsLabel()) {\n <hlm-select-label>{{ optionsLabel() }}</hlm-select-label>\n }\n @for (option of options(); track option.value) {\n <hlm-select-item [value]=\"option.value\">{{ option.label }}</hlm-select-item>\n }\n }\n </hlm-select-content>\n </brn-select-multiple>\n } @else {\n <brn-select hlmSelect [formControlName]=\"cnm\">\n <hlm-select-trigger\n [buttonId]=\"effectiveId()\"\n [ariaDescribedby]=\"describedBy()\"\n [wrapperDisabled]=\"disabled()\"\n [class]=\"$selectClass()\"\n >\n <hlm-select-value [placeholder]=\"placeholder()\" />\n </hlm-select-trigger>\n\n <hlm-select-content>\n @if (options().length) {\n @if (optionsLabel()) {\n <hlm-select-label>{{ optionsLabel() }}</hlm-select-label>\n }\n @for (option of options(); track option.value) {\n <hlm-select-item [value]=\"option.value\">{{ option.label }}</hlm-select-item>\n }\n }\n </hlm-select-content>\n </brn-select>\n }\n\n @if (err) {\n <hlm-error [id]=\"errorId()\" [class]=\"$errorClass()\">\n {{ err }}\n </hlm-error>\n }\n\n @if (hnt) {\n <hlm-hint [id]=\"hintId()\" [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </hlm-form-field>\n ", 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: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectLabel, selector: "[hlmSelectLabel],hlm-select-label" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "ariaDescribedby", "wrapperDisabled", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }] });
|
|
128
78
|
}
|
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSelect, decorators: [{
|
|
130
80
|
type: Component,
|
|
131
81
|
args: [{
|
|
132
82
|
selector: 'eg-form-select',
|
|
133
83
|
standalone: true,
|
|
134
84
|
host: {
|
|
135
|
-
class:
|
|
85
|
+
class: "w-full",
|
|
136
86
|
},
|
|
137
87
|
imports: [
|
|
138
88
|
ReactiveFormsModule,
|
|
@@ -148,76 +98,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
148
98
|
HlmSelectContent,
|
|
149
99
|
HlmSelectItem,
|
|
150
100
|
HlmSelectLabel,
|
|
151
|
-
HlmSelectPlaceholder,
|
|
152
101
|
],
|
|
153
102
|
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
154
|
-
template:
|
|
155
|
-
@let lbl = label();
|
|
156
|
-
@let cid = controlId();
|
|
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
|
-
<span hlmLabel [class]="$labelClass()"
|
|
165
|
-
>{{ lbl }}
|
|
166
|
-
@if (rqrd) {
|
|
167
|
-
<span class="text-red-500">*</span>
|
|
168
|
-
}
|
|
169
|
-
</span>
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
@if (multiple()) {
|
|
173
|
-
<brn-select-multiple hlmSelect [id]="cid || id()" [formControlName]="cnm">
|
|
174
|
-
<hlm-select-trigger [class]="$selectClass()">
|
|
175
|
-
<hlm-select-value [placeholder]="placeholder()" />
|
|
176
|
-
</hlm-select-trigger>
|
|
177
|
-
|
|
178
|
-
<hlm-select-content>
|
|
179
|
-
@if (options().length) {
|
|
180
|
-
@if (optionsLabel()) {
|
|
181
|
-
<hlm-select-label>{{ optionsLabel() }}</hlm-select-label>
|
|
182
|
-
}
|
|
183
|
-
@for (option of options(); track option.value) {
|
|
184
|
-
<hlm-select-item [value]="option.value">{{ option.label }}</hlm-select-item>
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
</hlm-select-content>
|
|
188
|
-
</brn-select-multiple>
|
|
189
|
-
} @else {
|
|
190
|
-
<brn-select hlmSelect [id]="cid || id()" [formControlName]="cnm">
|
|
191
|
-
<hlm-select-trigger [class]="$selectClass()">
|
|
192
|
-
<hlm-select-value [placeholder]="placeholder()" />
|
|
193
|
-
</hlm-select-trigger>
|
|
194
|
-
|
|
195
|
-
<hlm-select-content>
|
|
196
|
-
@if (options().length) {
|
|
197
|
-
@if (optionsLabel()) {
|
|
198
|
-
<hlm-select-label>{{ optionsLabel() }}</hlm-select-label>
|
|
199
|
-
}
|
|
200
|
-
@for (option of options(); track option.value) {
|
|
201
|
-
<hlm-select-item [value]="option.value">{{ option.label }}</hlm-select-item>
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
</hlm-select-content>
|
|
205
|
-
</brn-select>
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
@if (err) {
|
|
209
|
-
<hlm-error [class]="$errorClass()">
|
|
210
|
-
{{ err }}
|
|
211
|
-
</hlm-error>
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
@if (hnt) {
|
|
215
|
-
<hlm-hint [class]="$hintClass()">
|
|
216
|
-
{{ hnt }}
|
|
217
|
-
</hlm-hint>
|
|
218
|
-
}
|
|
219
|
-
</hlm-form-field>
|
|
220
|
-
`,
|
|
103
|
+
template: "\n @let lbl = label();\n @let cnm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <hlm-form-field>\n @if (lbl) {\n <label hlmLabel [for]=\"effectiveId()\" [class]=\"$labelClass()\"\n >{{ lbl }}\n @if (rqrd) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n }\n\n @if (multiple()) {\n <brn-select-multiple hlmSelect [formControlName]=\"cnm\">\n <hlm-select-trigger\n [buttonId]=\"effectiveId()\"\n [ariaDescribedby]=\"describedBy()\"\n [wrapperDisabled]=\"disabled()\"\n [class]=\"$selectClass()\"\n >\n <hlm-select-value [placeholder]=\"placeholder()\" />\n </hlm-select-trigger>\n\n <hlm-select-content>\n @if (options().length) {\n @if (optionsLabel()) {\n <hlm-select-label>{{ optionsLabel() }}</hlm-select-label>\n }\n @for (option of options(); track option.value) {\n <hlm-select-item [value]=\"option.value\">{{ option.label }}</hlm-select-item>\n }\n }\n </hlm-select-content>\n </brn-select-multiple>\n } @else {\n <brn-select hlmSelect [formControlName]=\"cnm\">\n <hlm-select-trigger\n [buttonId]=\"effectiveId()\"\n [ariaDescribedby]=\"describedBy()\"\n [wrapperDisabled]=\"disabled()\"\n [class]=\"$selectClass()\"\n >\n <hlm-select-value [placeholder]=\"placeholder()\" />\n </hlm-select-trigger>\n\n <hlm-select-content>\n @if (options().length) {\n @if (optionsLabel()) {\n <hlm-select-label>{{ optionsLabel() }}</hlm-select-label>\n }\n @for (option of options(); track option.value) {\n <hlm-select-item [value]=\"option.value\">{{ option.label }}</hlm-select-item>\n }\n }\n </hlm-select-content>\n </brn-select>\n }\n\n @if (err) {\n <hlm-error [id]=\"errorId()\" [class]=\"$errorClass()\">\n {{ err }}\n </hlm-error>\n }\n\n @if (hnt) {\n <hlm-hint [id]=\"hintId()\" [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </hlm-form-field>\n ",
|
|
221
104
|
}]
|
|
222
105
|
}], 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 }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], selectClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
|
|
223
106
|
|
|
@@ -230,4 +113,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
230
113
|
*/
|
|
231
114
|
|
|
232
115
|
export { EgFormSelect };
|
|
233
|
-
|
|
116
|
+
|
|
@@ -6,15 +6,21 @@ interface SelectOption {
|
|
|
6
6
|
label: string;
|
|
7
7
|
}
|
|
8
8
|
declare class EgFormSelect {
|
|
9
|
+
private readonly formGroupDirective;
|
|
10
|
+
private readonly generatedId;
|
|
9
11
|
label: _angular_core.InputSignal<string | undefined>;
|
|
10
12
|
controlId: _angular_core.InputSignal<string | undefined>;
|
|
11
13
|
controlName: _angular_core.InputSignal<string>;
|
|
12
14
|
error: _angular_core.InputSignal<string | undefined>;
|
|
13
15
|
hint: _angular_core.InputSignal<string | undefined>;
|
|
14
|
-
id: _angular_core.InputSignal<string>;
|
|
16
|
+
id: _angular_core.InputSignal<string | undefined>;
|
|
15
17
|
placeholder: _angular_core.InputSignal<string>;
|
|
16
18
|
disabled: _angular_core.InputSignal<boolean>;
|
|
17
19
|
required: _angular_core.InputSignal<boolean>;
|
|
20
|
+
readonly effectiveId: _angular_core.Signal<string>;
|
|
21
|
+
readonly errorId: _angular_core.Signal<string>;
|
|
22
|
+
readonly hintId: _angular_core.Signal<string>;
|
|
23
|
+
describedBy(): string | null;
|
|
18
24
|
multiple: _angular_core.InputSignal<boolean>;
|
|
19
25
|
options: _angular_core.InputSignal<SelectOption[]>;
|
|
20
26
|
optionsLabel: _angular_core.InputSignal<string | undefined>;
|
|
@@ -1,64 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Form Text Input Subpath
|
|
2
2
|
|
|
3
|
-
This project
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
ng generate component component-name
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
ng generate --help
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Building
|
|
20
|
-
|
|
21
|
-
To build the library, run:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
ng build form-text-input
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
-
|
|
29
|
-
### Publishing the Library
|
|
30
|
-
|
|
31
|
-
Once the project is built, you can publish your library by following these steps:
|
|
32
|
-
|
|
33
|
-
1. Navigate to the `dist` directory:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
cd dist/form-text-input
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
-
```bash
|
|
41
|
-
npm publish
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Running unit tests
|
|
45
|
-
|
|
46
|
-
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
ng test
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Running end-to-end tests
|
|
53
|
-
|
|
54
|
-
For end-to-end (e2e) testing, run:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
ng e2e
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
61
|
-
|
|
62
|
-
## Additional Resources
|
|
63
|
-
|
|
64
|
-
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
3
|
+
This project ships only as `@egose/shadcn-theme-ng/form-text-input` or `@egose/shadcn-theme-ng-tw/form-text-input`. See the [package README](../../README.md) for installation, compatibility, Tailwind variant, test, and release guidance. Do not publish this project directory independently.
|