@egose/shadcn-theme-ng-tw 0.0.14 → 0.0.16
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/accordion/fesm2022/accordion.mjs +2 -2
- package/alert/fesm2022/alert.mjs +2 -2
- package/autocomplete/fesm2022/autocomplete.mjs +3 -3
- package/badge/fesm2022/badge.mjs +1 -1
- package/basic-alert/fesm2022/basic-alert.mjs +2 -2
- package/button/fesm2022/button.mjs +2 -2
- package/calendar/fesm2022/calendar.mjs +3 -3
- package/checkbox/README.md +64 -0
- package/checkbox/fesm2022/checkbox.mjs +146 -0
- package/checkbox/fesm2022/checkbox.mjs.map +1 -0
- package/checkbox/index.d.ts +55 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +4 -4
- package/date-picker/fesm2022/date-picker.mjs +4 -4
- package/dialog/fesm2022/dialog.mjs +2 -2
- package/exports.json +1 -1
- package/form-checkbox/README.md +64 -0
- package/form-checkbox/fesm2022/form-checkbox.mjs +134 -0
- package/form-checkbox/fesm2022/form-checkbox.mjs.map +1 -0
- package/form-checkbox/index.d.ts +26 -0
- package/form-date-picker/fesm2022/form-date-picker.mjs +4 -4
- package/form-field/fesm2022/form-field.mjs +1 -1
- package/form-field-simple/README.md +64 -0
- package/form-field-simple/fesm2022/form-field-simple.mjs +82 -0
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +1 -0
- package/form-field-simple/index.d.ts +22 -0
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +21 -14
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +1 -1
- package/form-select/fesm2022/form-select.mjs +5 -5
- package/form-text-input/fesm2022/form-text-input.mjs +4 -4
- package/form-textarea/fesm2022/form-textarea.mjs +4 -4
- package/input/fesm2022/input.mjs +1 -1
- package/label/fesm2022/label.mjs +1 -1
- package/package.json +13 -1
- package/popover/fesm2022/popover.mjs +1 -1
- package/radio-group/fesm2022/radio-group.mjs +1 -1
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +1 -1
- package/select/fesm2022/select.mjs +2 -2
- package/separator/fesm2022/separator.mjs +1 -1
- package/sonner/fesm2022/sonner.mjs +1 -1
- package/spinner/fesm2022/spinner.mjs +1 -1
- package/switch/fesm2022/switch.mjs +1 -1
- package/tabs/fesm2022/tabs.mjs +3 -3
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule, FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
5
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
6
|
+
import { HlmCheckbox } from '@egose/shadcn-theme-ng-tw/checkbox';
|
|
7
|
+
import { HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
8
|
+
import { EgFormField } from '@egose/shadcn-theme-ng-tw/form-field-simple';
|
|
9
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
10
|
+
|
|
11
|
+
class EgFormCheckbox {
|
|
12
|
+
// Classes
|
|
13
|
+
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
14
|
+
_computedClass = computed(() => hlm('', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
15
|
+
// Inputs
|
|
16
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
17
|
+
controlName = input('', ...(ngDevMode ? [{ debugName: "controlName" }] : [])); // must be provided
|
|
18
|
+
error = input(undefined, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
19
|
+
hint = input(undefined, ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
20
|
+
id = input(crypto.randomUUID(), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
21
|
+
name = input(undefined, ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
22
|
+
checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
23
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : []));
|
|
24
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
25
|
+
// Styling
|
|
26
|
+
checkboxClass = input('', ...(ngDevMode ? [{ debugName: "checkboxClass" }] : []));
|
|
27
|
+
labelClass = input('', ...(ngDevMode ? [{ debugName: "labelClass" }] : []));
|
|
28
|
+
// Computed styling
|
|
29
|
+
$checkboxClass = computed(() => hlm(this.checkboxClass()), ...(ngDevMode ? [{ debugName: "$checkboxClass" }] : []));
|
|
30
|
+
$labelClass = computed(() => hlm(this.labelClass()), ...(ngDevMode ? [{ debugName: "$labelClass" }] : []));
|
|
31
|
+
$errorClass = input('', ...(ngDevMode ? [{ debugName: "$errorClass" }] : []));
|
|
32
|
+
$hintClass = input('', ...(ngDevMode ? [{ debugName: "$hintClass" }] : []));
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgFormCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: EgFormCheckbox, isStandalone: true, selector: "eg-form-checkbox", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checkboxClass: { classPropertyName: "checkboxClass", publicName: "checkboxClass", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, $errorClass: { classPropertyName: "$errorClass", publicName: "$errorClass", isSignal: true, isRequired: false, transformFunction: null }, $hintClass: { classPropertyName: "$hintClass", publicName: "$hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
|
|
35
|
+
@let lbl = label();
|
|
36
|
+
@let nm = controlName();
|
|
37
|
+
@let err = error();
|
|
38
|
+
@let hnt = hint();
|
|
39
|
+
@let rqrd = required();
|
|
40
|
+
|
|
41
|
+
<eg-form-field>
|
|
42
|
+
<div class="tw:flex tw:items-center tw:gap-1">
|
|
43
|
+
<hlm-checkbox
|
|
44
|
+
[id]="id()"
|
|
45
|
+
[name]="nm || name() || null"
|
|
46
|
+
[formControlName]="nm"
|
|
47
|
+
[class]="$checkboxClass()"
|
|
48
|
+
[checked]="checked()"
|
|
49
|
+
[required]="rqrd"
|
|
50
|
+
/>
|
|
51
|
+
<label hlmLabel [for]="id()" [class]="$labelClass()">
|
|
52
|
+
{{ lbl }}
|
|
53
|
+
@if (rqrd) {
|
|
54
|
+
<span class="tw:text-red-500">*</span>
|
|
55
|
+
}
|
|
56
|
+
</label>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
@if (err) {
|
|
60
|
+
<hlm-error [class]="$errorClass()">
|
|
61
|
+
{{ err }}
|
|
62
|
+
</hlm-error>
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@if (hnt) {
|
|
66
|
+
<hlm-hint [class]="$hintClass()">
|
|
67
|
+
{{ hnt }}
|
|
68
|
+
</hlm-hint>
|
|
69
|
+
}
|
|
70
|
+
</eg-form-field>
|
|
71
|
+
`, 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: HlmCheckbox, selector: "hlm-checkbox", inputs: ["class", "id", "aria-label", "aria-labelledby", "aria-describedby", "checked", "name", "required", "disabled"], outputs: ["checkedChange", "changed"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
72
|
+
}
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgFormCheckbox, decorators: [{
|
|
74
|
+
type: Component,
|
|
75
|
+
args: [{
|
|
76
|
+
selector: 'eg-form-checkbox',
|
|
77
|
+
standalone: true,
|
|
78
|
+
host: {
|
|
79
|
+
'[class]': '_computedClass()',
|
|
80
|
+
},
|
|
81
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
82
|
+
imports: [ReactiveFormsModule, HlmCheckbox, HlmLabel, EgFormField, HlmError, HlmHint],
|
|
83
|
+
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
84
|
+
template: `
|
|
85
|
+
@let lbl = label();
|
|
86
|
+
@let nm = controlName();
|
|
87
|
+
@let err = error();
|
|
88
|
+
@let hnt = hint();
|
|
89
|
+
@let rqrd = required();
|
|
90
|
+
|
|
91
|
+
<eg-form-field>
|
|
92
|
+
<div class="tw:flex tw:items-center tw:gap-1">
|
|
93
|
+
<hlm-checkbox
|
|
94
|
+
[id]="id()"
|
|
95
|
+
[name]="nm || name() || null"
|
|
96
|
+
[formControlName]="nm"
|
|
97
|
+
[class]="$checkboxClass()"
|
|
98
|
+
[checked]="checked()"
|
|
99
|
+
[required]="rqrd"
|
|
100
|
+
/>
|
|
101
|
+
<label hlmLabel [for]="id()" [class]="$labelClass()">
|
|
102
|
+
{{ lbl }}
|
|
103
|
+
@if (rqrd) {
|
|
104
|
+
<span class="tw:text-red-500">*</span>
|
|
105
|
+
}
|
|
106
|
+
</label>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
@if (err) {
|
|
110
|
+
<hlm-error [class]="$errorClass()">
|
|
111
|
+
{{ err }}
|
|
112
|
+
</hlm-error>
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@if (hnt) {
|
|
116
|
+
<hlm-hint [class]="$hintClass()">
|
|
117
|
+
{{ hnt }}
|
|
118
|
+
</hlm-hint>
|
|
119
|
+
}
|
|
120
|
+
</eg-form-field>
|
|
121
|
+
`,
|
|
122
|
+
}]
|
|
123
|
+
}] });
|
|
124
|
+
|
|
125
|
+
/*
|
|
126
|
+
* Public API Surface of form-checkbox
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Generated bundle index. Do not edit.
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
export { EgFormCheckbox };
|
|
134
|
+
//# sourceMappingURL=form-checkbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-checkbox.mjs","sources":["../../../projects/form-checkbox/src/lib/form-checkbox.ts","../../../projects/form-checkbox/src/public-api.ts","../../../projects/form-checkbox/src/form-checkbox.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, OnInit, computed, input } from '@angular/core';\nimport { ControlContainer, FormGroupDirective, ReactiveFormsModule } from '@angular/forms';\nimport { HlmLabel } from '@egose/shadcn-theme-ng/label';\nimport { HlmCheckbox } from '@egose/shadcn-theme-ng/checkbox';\nimport { HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';\nimport { EgFormField } from '@egose/shadcn-theme-ng/form-field-simple';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\n@Component({\n selector: 'eg-form-checkbox',\n standalone: true,\n host: {\n '[class]': '_computedClass()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ReactiveFormsModule, HlmCheckbox, HlmLabel, EgFormField, HlmError, HlmHint],\n providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n template: `\n @let lbl = label();\n @let nm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <eg-form-field>\n <div class=\"tw:flex tw:items-center tw:gap-1\">\n <hlm-checkbox\n [id]=\"id()\"\n [name]=\"nm || name() || null\"\n [formControlName]=\"nm\"\n [class]=\"$checkboxClass()\"\n [checked]=\"checked()\"\n [required]=\"rqrd\"\n />\n <label hlmLabel [for]=\"id()\" [class]=\"$labelClass()\">\n {{ lbl }}\n @if (rqrd) {\n <span class=\"tw:text-red-500\">*</span>\n }\n </label>\n </div>\n\n @if (err) {\n <hlm-error [class]=\"$errorClass()\">\n {{ err }}\n </hlm-error>\n }\n\n @if (hnt) {\n <hlm-hint [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </eg-form-field>\n `,\n})\nexport class EgFormCheckbox {\n // Classes\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() => hlm('', this.userClass()));\n\n // Inputs\n label = input<string>('');\n controlName = input<string>(''); // must be provided\n error = input<string | undefined>(undefined);\n hint = input<string | undefined>(undefined);\n\n id = input<string>(crypto.randomUUID());\n name = input<string | undefined>(undefined);\n checked = input<boolean>(false);\n required = input<boolean>(false);\n disabled = input<boolean>(false);\n\n // Styling\n checkboxClass = input<string>('');\n labelClass = input<string>('');\n\n // Computed styling\n $checkboxClass = computed(() => hlm(this.checkboxClass()));\n $labelClass = computed(() => hlm(this.labelClass()));\n $errorClass = input<string>('');\n $hintClass = input<string>('');\n}\n","/*\n * Public API Surface of form-checkbox\n */\n\nexport * from './lib/form-checkbox';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAyDa,cAAc,CAAA;;AAET,IAAA,SAAS,GAAG,KAAK,CAAa,EAAE,6CAAI,KAAK,EAAE,OAAO,EAAA,CAAA,GAAA,CAAhB,EAAE,KAAK,EAAE,OAAO,EAAE,GAAC;AAClD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,0DAAC;;AAG7E,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;AACzB,IAAA,WAAW,GAAG,KAAK,CAAS,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC,CAAC;AAChC,IAAA,KAAK,GAAG,KAAK,CAAqB,SAAS,iDAAC;AAC5C,IAAA,IAAI,GAAG,KAAK,CAAqB,SAAS,gDAAC;IAE3C,EAAE,GAAG,KAAK,CAAS,MAAM,CAAC,UAAU,EAAE,8CAAC;AACvC,IAAA,IAAI,GAAG,KAAK,CAAqB,SAAS,gDAAC;AAC3C,IAAA,OAAO,GAAG,KAAK,CAAU,KAAK,mDAAC;AAC/B,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,oDAAC;AAChC,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,oDAAC;;AAGhC,IAAA,aAAa,GAAG,KAAK,CAAS,EAAE,yDAAC;AAC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|
|
5
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
6
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
7
|
+
label: _angular_core.InputSignal<string>;
|
|
8
|
+
controlName: _angular_core.InputSignal<string>;
|
|
9
|
+
error: _angular_core.InputSignal<string | undefined>;
|
|
10
|
+
hint: _angular_core.InputSignal<string | undefined>;
|
|
11
|
+
id: _angular_core.InputSignal<string>;
|
|
12
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
13
|
+
checked: _angular_core.InputSignal<boolean>;
|
|
14
|
+
required: _angular_core.InputSignal<boolean>;
|
|
15
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
16
|
+
checkboxClass: _angular_core.InputSignal<string>;
|
|
17
|
+
labelClass: _angular_core.InputSignal<string>;
|
|
18
|
+
$checkboxClass: _angular_core.Signal<string>;
|
|
19
|
+
$labelClass: _angular_core.Signal<string>;
|
|
20
|
+
$errorClass: _angular_core.InputSignal<string>;
|
|
21
|
+
$hintClass: _angular_core.InputSignal<string>;
|
|
22
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormCheckbox, never>;
|
|
23
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormCheckbox, "eg-form-checkbox", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "checkboxClass": { "alias": "checkboxClass"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "$errorClass": { "alias": "$errorClass"; "required": false; "isSignal": true; }; "$hintClass": { "alias": "$hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { EgFormCheckbox };
|
|
@@ -2,10 +2,10 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { ReactiveFormsModule, FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
5
|
-
import { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
6
|
-
import { HlmLabel } from '@egose/shadcn-theme-ng/label';
|
|
7
|
-
import { HlmDatePicker } from '@egose/shadcn-theme-ng/date-picker';
|
|
8
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
5
|
+
import { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
6
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
7
|
+
import { HlmDatePicker } from '@egose/shadcn-theme-ng-tw/date-picker';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
9
|
|
|
10
10
|
let nextId = 0;
|
|
11
11
|
class EgFormDatePicker {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, Directive, contentChild, contentChildren, effect, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
3
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
4
4
|
import { FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
5
5
|
import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
|
|
6
6
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# FormFieldSimple
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
|
|
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-field-simple
|
|
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-field-simple
|
|
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.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, contentChild, inject, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { FormControlName, FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
4
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
5
|
+
import { Subscription } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
class EgFormField {
|
|
8
|
+
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
9
|
+
_computedClass = computed(() => hlm('', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
10
|
+
control = contentChild(FormControlName, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
11
|
+
formGroupDirective = inject(FormGroupDirective);
|
|
12
|
+
form = this.formGroupDirective.form;
|
|
13
|
+
statusSignal = signal(null, ...(ngDevMode ? [{ debugName: "statusSignal" }] : []));
|
|
14
|
+
sub = new Subscription();
|
|
15
|
+
ngAfterContentInit() {
|
|
16
|
+
const ctrlDir = this.control();
|
|
17
|
+
if (ctrlDir) {
|
|
18
|
+
this.sub.add(ctrlDir.control.statusChanges.subscribe((status) => {
|
|
19
|
+
this.statusSignal.set(status);
|
|
20
|
+
}));
|
|
21
|
+
this.statusSignal.set(ctrlDir.control.status);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
ngOnDestroy() {
|
|
25
|
+
this.sub.unsubscribe();
|
|
26
|
+
}
|
|
27
|
+
hasError = computed(() => {
|
|
28
|
+
const ctrlDir = this.control();
|
|
29
|
+
if (!ctrlDir)
|
|
30
|
+
return false;
|
|
31
|
+
this.statusSignal();
|
|
32
|
+
return !!ctrlDir.control.errors && (ctrlDir.control.touched || ctrlDir.control.dirty);
|
|
33
|
+
}, ...(ngDevMode ? [{ debugName: "hasError" }] : []));
|
|
34
|
+
firstErrorKey = computed(() => {
|
|
35
|
+
const ctrlDir = this.control();
|
|
36
|
+
if (!ctrlDir || !ctrlDir.control.errors)
|
|
37
|
+
return null;
|
|
38
|
+
this.statusSignal();
|
|
39
|
+
return Object.keys(ctrlDir.control.errors)[0] ?? null;
|
|
40
|
+
}, ...(ngDevMode ? [{ debugName: "firstErrorKey" }] : []));
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgFormField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
42
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: EgFormField, isStandalone: true, selector: "eg-form-field", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], queries: [{ propertyName: "control", first: true, predicate: FormControlName, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
43
|
+
<ng-content></ng-content>
|
|
44
|
+
|
|
45
|
+
@if (hasError()) {
|
|
46
|
+
<ng-content select="hlm-error"></ng-content>
|
|
47
|
+
} @else {
|
|
48
|
+
<ng-content select="hlm-hint"></ng-content>
|
|
49
|
+
}
|
|
50
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
51
|
+
}
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgFormField, decorators: [{
|
|
53
|
+
type: Component,
|
|
54
|
+
args: [{
|
|
55
|
+
selector: 'eg-form-field',
|
|
56
|
+
template: `
|
|
57
|
+
<ng-content></ng-content>
|
|
58
|
+
|
|
59
|
+
@if (hasError()) {
|
|
60
|
+
<ng-content select="hlm-error"></ng-content>
|
|
61
|
+
} @else {
|
|
62
|
+
<ng-content select="hlm-hint"></ng-content>
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
65
|
+
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
66
|
+
host: {
|
|
67
|
+
'[class]': '_computedClass()',
|
|
68
|
+
},
|
|
69
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
70
|
+
}]
|
|
71
|
+
}] });
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* Public API Surface of form-field-simple
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Generated bundle index. Do not edit.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
export { EgFormField };
|
|
82
|
+
//# sourceMappingURL=form-field-simple.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-field-simple.mjs","sources":["../../../projects/form-field-simple/src/lib/form-field-simple.ts","../../../projects/form-field-simple/src/public-api.ts","../../../projects/form-field-simple/src/form-field-simple.ts"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n contentChild,\n signal,\n AfterContentInit,\n OnDestroy,\n} from '@angular/core';\nimport { ControlContainer, FormControlName, FormGroup, FormGroupDirective } from '@angular/forms';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'eg-form-field',\n template: `\n <ng-content></ng-content>\n\n @if (hasError()) {\n <ng-content select=\"hlm-error\"></ng-content>\n } @else {\n <ng-content select=\"hlm-hint\"></ng-content>\n }\n `,\n providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n host: {\n '[class]': '_computedClass()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EgFormField implements AfterContentInit, OnDestroy {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() => hlm('', this.userClass()));\n\n public readonly control = contentChild(FormControlName);\n\n private readonly formGroupDirective = inject(FormGroupDirective);\n public readonly form: FormGroup = this.formGroupDirective.form;\n\n private statusSignal = signal<string | null>(null);\n\n private sub = new Subscription();\n\n ngAfterContentInit() {\n const ctrlDir = this.control();\n if (ctrlDir) {\n this.sub.add(\n ctrlDir.control.statusChanges.subscribe((status) => {\n this.statusSignal.set(status);\n }),\n );\n\n this.statusSignal.set(ctrlDir.control.status);\n }\n }\n\n ngOnDestroy() {\n this.sub.unsubscribe();\n }\n\n public readonly hasError = computed(() => {\n const ctrlDir = this.control();\n if (!ctrlDir) return false;\n\n this.statusSignal();\n\n return !!ctrlDir.control.errors && (ctrlDir.control.touched || ctrlDir.control.dirty);\n });\n\n public readonly firstErrorKey = computed(() => {\n const ctrlDir = this.control();\n if (!ctrlDir || !ctrlDir.control.errors) return null;\n this.statusSignal();\n return Object.keys(ctrlDir.control.errors)[0] ?? null;\n });\n}\n","/*\n * Public API Surface of form-field-simple\n */\n\nexport * from './lib/form-field-simple';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAiCa,WAAW,CAAA;AACN,IAAA,SAAS,GAAG,KAAK,CAAa,EAAE,6CAAI,KAAK,EAAE,OAAO,EAAA,CAAA,GAAA,CAAhB,EAAE,KAAK,EAAE,OAAO,EAAE,GAAC;AAClD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,0DAAC;AAE7D,IAAA,OAAO,GAAG,YAAY,CAAC,eAAe,mDAAC;AAEtC,IAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAChD,IAAA,IAAI,GAAc,IAAI,CAAC,kBAAkB,CAAC,IAAI;AAEtD,IAAA,YAAY,GAAG,MAAM,CAAgB,IAAI,wDAAC;AAE1C,IAAA,GAAG,GAAG,IAAI,YAAY,EAAE;IAEhC,kBAAkB,GAAA;AAChB,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAA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import * as _angular_core from '@angular/core';
|
|
2
|
+
import { AfterContentInit, OnDestroy } from '@angular/core';
|
|
3
|
+
import { FormControlName, FormGroup } from '@angular/forms';
|
|
4
|
+
import { ClassValue } from 'clsx';
|
|
5
|
+
|
|
6
|
+
declare class EgFormField implements AfterContentInit, OnDestroy {
|
|
7
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
8
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
9
|
+
readonly control: _angular_core.Signal<FormControlName | undefined>;
|
|
10
|
+
private readonly formGroupDirective;
|
|
11
|
+
readonly form: FormGroup;
|
|
12
|
+
private statusSignal;
|
|
13
|
+
private sub;
|
|
14
|
+
ngAfterContentInit(): void;
|
|
15
|
+
ngOnDestroy(): void;
|
|
16
|
+
readonly hasError: _angular_core.Signal<boolean>;
|
|
17
|
+
readonly firstErrorKey: _angular_core.Signal<string | null>;
|
|
18
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormField, never>;
|
|
19
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormField, "eg-form-field", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, ["control"], ["*", "hlm-error", "hlm-hint"], true, never>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { EgFormField };
|
|
@@ -2,10 +2,11 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { ReactiveFormsModule, FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
6
|
+
import { EgFormField } from '@egose/shadcn-theme-ng-tw/form-field-simple';
|
|
7
|
+
import { HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
|
+
import { EgSearchableMultiselect } from '@egose/shadcn-theme-ng-tw/searchable-multiselect';
|
|
9
10
|
|
|
10
11
|
class EgFormSearchableMultiselect {
|
|
11
12
|
// Form field inputs
|
|
@@ -33,9 +34,13 @@ class EgFormSearchableMultiselect {
|
|
|
33
34
|
$hintClass = computed(() => hlm('tw:mt-0', this.hintClass()), ...(ngDevMode ? [{ debugName: "$hintClass" }] : []));
|
|
34
35
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgFormSearchableMultiselect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
35
36
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: EgFormSearchableMultiselect, isStandalone: true, selector: "eg-form-searchable-multiselect", inputs: { label: { classPropertyName: "label", publicName: "label", 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 }, 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: "tw:w-full" }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
|
|
36
|
-
@let lbl = label();
|
|
37
|
+
@let lbl = label();
|
|
38
|
+
@let nm = controlName();
|
|
39
|
+
@let err = error();
|
|
40
|
+
@let hnt = hint();
|
|
41
|
+
@let rqrd = required();
|
|
37
42
|
|
|
38
|
-
<
|
|
43
|
+
<eg-form-field>
|
|
39
44
|
@if (lbl) {
|
|
40
45
|
<span hlmLabel [class]="$labelClass()">
|
|
41
46
|
{{ lbl }}
|
|
@@ -49,7 +54,6 @@ class EgFormSearchableMultiselect {
|
|
|
49
54
|
[options]="options()"
|
|
50
55
|
[placeholder]="placeholder()"
|
|
51
56
|
[formControlName]="nm"
|
|
52
|
-
[disabled]="disabled()"
|
|
53
57
|
[required]="rqrd"
|
|
54
58
|
[class]="$controlClass()"
|
|
55
59
|
></eg-searchable-multiselect>
|
|
@@ -63,8 +67,8 @@ class EgFormSearchableMultiselect {
|
|
|
63
67
|
{{ hnt }}
|
|
64
68
|
</hlm-hint>
|
|
65
69
|
}
|
|
66
|
-
</
|
|
67
|
-
`, 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:
|
|
70
|
+
</eg-form-field>
|
|
71
|
+
`, 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", "value"], outputs: ["valueChange"] }] });
|
|
68
72
|
}
|
|
69
73
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgFormSearchableMultiselect, decorators: [{
|
|
70
74
|
type: Component,
|
|
@@ -74,12 +78,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
74
78
|
host: {
|
|
75
79
|
class: 'tw:w-full',
|
|
76
80
|
},
|
|
77
|
-
imports: [ReactiveFormsModule,
|
|
81
|
+
imports: [ReactiveFormsModule, EgFormField, HlmError, HlmHint, HlmLabel, EgSearchableMultiselect],
|
|
78
82
|
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
79
83
|
template: `
|
|
80
|
-
@let lbl = label();
|
|
84
|
+
@let lbl = label();
|
|
85
|
+
@let nm = controlName();
|
|
86
|
+
@let err = error();
|
|
87
|
+
@let hnt = hint();
|
|
88
|
+
@let rqrd = required();
|
|
81
89
|
|
|
82
|
-
<
|
|
90
|
+
<eg-form-field>
|
|
83
91
|
@if (lbl) {
|
|
84
92
|
<span hlmLabel [class]="$labelClass()">
|
|
85
93
|
{{ lbl }}
|
|
@@ -93,7 +101,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
93
101
|
[options]="options()"
|
|
94
102
|
[placeholder]="placeholder()"
|
|
95
103
|
[formControlName]="nm"
|
|
96
|
-
[disabled]="disabled()"
|
|
97
104
|
[required]="rqrd"
|
|
98
105
|
[class]="$controlClass()"
|
|
99
106
|
></eg-searchable-multiselect>
|
|
@@ -107,7 +114,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
107
114
|
{{ hnt }}
|
|
108
115
|
</hlm-hint>
|
|
109
116
|
}
|
|
110
|
-
</
|
|
117
|
+
</eg-form-field>
|
|
111
118
|
`,
|
|
112
119
|
}]
|
|
113
120
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-searchable-multiselect.mjs","sources":["../../../projects/form-searchable-multiselect/src/lib/form-searchable-multiselect.ts","../../../projects/form-searchable-multiselect/src/public-api.ts","../../../projects/form-searchable-multiselect/src/form-searchable-multiselect.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { ControlContainer, FormGroupDirective, ReactiveFormsModule } from '@angular/forms';\nimport {
|
|
1
|
+
{"version":3,"file":"form-searchable-multiselect.mjs","sources":["../../../projects/form-searchable-multiselect/src/lib/form-searchable-multiselect.ts","../../../projects/form-searchable-multiselect/src/public-api.ts","../../../projects/form-searchable-multiselect/src/form-searchable-multiselect.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { ControlContainer, FormGroupDirective, ReactiveFormsModule } from '@angular/forms';\nimport { HlmLabel } from '@egose/shadcn-theme-ng/label';\nimport { EgFormField } from '@egose/shadcn-theme-ng/form-field-simple';\nimport { HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\nimport { EgSearchableMultiselect, SelectOption } from '@egose/shadcn-theme-ng/searchable-multiselect';\n\n@Component({\n selector: 'eg-form-searchable-multiselect',\n standalone: true,\n host: {\n class: 'tw:w-full',\n },\n imports: [ReactiveFormsModule, EgFormField, HlmError, HlmHint, HlmLabel, EgSearchableMultiselect],\n providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n template: `\n @let lbl = label();\n @let nm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <eg-form-field>\n @if (lbl) {\n <span hlmLabel [class]=\"$labelClass()\">\n {{ lbl }}\n @if (rqrd) {\n <span class=\"tw:text-red-500\">*</span>\n }\n </span>\n }\n\n <eg-searchable-multiselect\n [options]=\"options()\"\n [placeholder]=\"placeholder()\"\n [formControlName]=\"nm\"\n [required]=\"rqrd\"\n [class]=\"$controlClass()\"\n ></eg-searchable-multiselect>\n\n @if (err) {\n <hlm-error [class]=\"$errorClass()\">\n {{ err }}\n </hlm-error>\n } @if (hnt) {\n <hlm-hint [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </eg-form-field>\n `,\n})\nexport class EgFormSearchableMultiselect {\n // Form field inputs\n label = input<string | undefined>(undefined);\n controlName = input<string>(''); // required for form binding\n error = input<string | undefined>(undefined);\n hint = input<string | undefined>(undefined);\n\n // HTML/control attributes\n placeholder = input<string>('Start typing to add…');\n disabled = input<boolean>(false);\n required = input<boolean>(false);\n\n // Multiselect-specific\n options = input<SelectOption[]>([]); // [{ label, value }]\n\n // Styling classes\n userClass = input<ClassValue>('', { alias: 'class' });\n labelClass = input<string>('');\n controlClass = input<string>(''); // for EgMultiselectAutocomplete\n errorClass = input<string>('');\n hintClass = input<string>('');\n\n // Computed class names\n $userClass = computed(() => hlm('tw:flex tw:flex-col', this.userClass()));\n $labelClass = computed(() => hlm('tw:mb-1 tw:gap-0', this.labelClass()));\n $controlClass = computed(() => hlm('tw:w-full', this.controlClass()));\n $errorClass = computed(() => hlm('tw:mt-0', this.errorClass()));\n $hintClass = computed(() => hlm('tw:mt-0', this.hintClass()));\n}\n","/*\n * Public API Surface of form-searchable-multiselect\n */\n\nexport * from './lib/form-searchable-multiselect';\n","/**\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AA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,uBAAuB,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,aAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAuCrF,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBA7CvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gCAAgC;AAC1C,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,WAAW;AACnB,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,mBAAmB,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,uBAAuB,CAAC;oBACjG,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;AAC3E,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCT,EAAA,CAAA;AACF,iBAAA;;;ACrDD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -2,13 +2,13 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { ReactiveFormsModule, FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
5
|
-
import { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
6
|
-
import { HlmLabel } from '@egose/shadcn-theme-ng/label';
|
|
7
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
5
|
+
import { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
6
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
7
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
8
8
|
import * as i2 from '@spartan-ng/brain/select';
|
|
9
9
|
import { BrnSelectImports } from '@spartan-ng/brain/select';
|
|
10
|
-
import * as i3 from '@egose/shadcn-theme-ng/select';
|
|
11
|
-
import { HlmSelectImports } from '@egose/shadcn-theme-ng/select';
|
|
10
|
+
import * as i3 from '@egose/shadcn-theme-ng-tw/select';
|
|
11
|
+
import { HlmSelectImports } from '@egose/shadcn-theme-ng-tw/select';
|
|
12
12
|
|
|
13
13
|
class EgFormSelect {
|
|
14
14
|
label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
@@ -2,10 +2,10 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, Directive, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { ReactiveFormsModule, FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
5
|
-
import { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
6
|
-
import { HlmLabel } from '@egose/shadcn-theme-ng/label';
|
|
7
|
-
import { HlmInput } from '@egose/shadcn-theme-ng/input';
|
|
8
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
5
|
+
import { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
6
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
7
|
+
import { HlmInput } from '@egose/shadcn-theme-ng-tw/input';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
9
|
|
|
10
10
|
// NOT USED
|
|
11
11
|
class SpreadAttrsDirective {
|
|
@@ -2,10 +2,10 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { ReactiveFormsModule, FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
5
|
-
import { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
6
|
-
import { HlmLabel } from '@egose/shadcn-theme-ng/label';
|
|
7
|
-
import { HlmInput } from '@egose/shadcn-theme-ng/input';
|
|
8
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
5
|
+
import { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
6
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
7
|
+
import { HlmInput } from '@egose/shadcn-theme-ng-tw/input';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
9
|
|
|
10
10
|
let nextId = 0;
|
|
11
11
|
class EgFormTextarea {
|
package/input/fesm2022/input.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { input, linkedSignal, computed, inject, Injector, effect, untracked, for
|
|
|
3
3
|
import { NgControl, NgForm, FormGroupDirective } from '@angular/forms';
|
|
4
4
|
import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
|
|
5
5
|
import { ErrorStateMatcher, ErrorStateTracker } from '@spartan-ng/brain/forms';
|
|
6
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
6
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
|
|
9
9
|
const inputVariants = cva('tw:file:text-foreground tw:placeholder:text-muted-foreground tw:selection:bg-primary tw:selection:text-primary-foreground tw:dark:bg-input/10 tw:border-input tw:shadow-xs tw:focus-visible:border-ring tw:focus-visible:ring-ring/50 tw:flex tw:h-9 tw:w-full tw:min-w-0 tw:rounded-md tw:border tw:bg-transparent tw:px-3 tw:py-1 tw:text-base tw:outline-none tw:transition-[color,box-shadow] tw:file:inline-flex tw:file:h-7 tw:file:border-0 tw:file:bg-transparent tw:file:text-sm tw:file:font-medium tw:focus-visible:ring-[3px] tw:disabled:pointer-events-none tw:disabled:cursor-not-allowed tw:disabled:opacity-50 md:text-sm', {
|
package/label/fesm2022/label.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, computed, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@spartan-ng/brain/label';
|
|
4
4
|
import { BrnLabel } from '@spartan-ng/brain/label';
|
|
5
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
5
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
6
6
|
|
|
7
7
|
class HlmLabel {
|
|
8
8
|
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|