@egose/shadcn-theme-ng 0.0.9 → 0.0.11
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 +55 -55
- package/accordion/fesm2022/accordion.mjs.map +1 -1
- package/accordion/index.d.ts +21 -21
- package/alert/fesm2022/alert.mjs +125 -49
- package/alert/fesm2022/alert.mjs.map +1 -1
- package/alert/index.d.ts +23 -20
- package/badge/fesm2022/badge.mjs +8 -8
- package/badge/fesm2022/badge.mjs.map +1 -1
- package/badge/index.d.ts +4 -4
- package/basic-alert/README.md +64 -0
- package/basic-alert/fesm2022/basic-alert.mjs +111 -0
- package/basic-alert/fesm2022/basic-alert.mjs.map +1 -0
- package/basic-alert/index.d.ts +14 -0
- package/button/fesm2022/button.mjs +25 -25
- package/button/fesm2022/button.mjs.map +1 -1
- package/button/index.d.ts +9 -9
- package/calendar/README.md +64 -0
- package/calendar/fesm2022/calendar.mjs +637 -0
- package/calendar/fesm2022/calendar.mjs.map +1 -0
- package/calendar/index.d.ts +111 -0
- package/confirmation-dialog/README.md +64 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +93 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +1 -0
- package/confirmation-dialog/index.d.ts +24 -0
- package/date-picker/README.md +64 -0
- package/date-picker/fesm2022/date-picker.mjs +599 -0
- package/date-picker/fesm2022/date-picker.mjs.map +1 -0
- package/date-picker/index.d.ts +227 -0
- package/dialog/README.md +64 -0
- package/dialog/fesm2022/dialog.mjs +278 -0
- package/dialog/fesm2022/dialog.mjs.map +1 -0
- package/dialog/index.d.ts +89 -0
- package/exports.json +1 -1
- package/form-date-picker/README.md +64 -0
- package/form-date-picker/fesm2022/form-date-picker.mjs +146 -0
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +1 -0
- package/form-date-picker/index.d.ts +32 -0
- package/form-field/fesm2022/form-field.mjs +36 -34
- package/form-field/fesm2022/form-field.mjs.map +1 -1
- package/form-field/index.d.ts +16 -16
- package/form-select/README.md +64 -0
- package/form-select/fesm2022/form-select.mjs +165 -0
- package/form-select/fesm2022/form-select.mjs.map +1 -0
- package/form-select/index.d.ts +33 -0
- package/form-text-input/README.md +64 -0
- package/form-text-input/fesm2022/form-text-input.mjs +197 -0
- package/form-text-input/fesm2022/form-text-input.mjs.map +1 -0
- package/form-text-input/index.d.ts +47 -0
- package/form-textarea/README.md +64 -0
- package/form-textarea/fesm2022/form-textarea.mjs +156 -0
- package/form-textarea/fesm2022/form-textarea.mjs.map +1 -0
- package/form-textarea/index.d.ts +33 -0
- package/icon/fesm2022/icon.mjs +20 -20
- package/icon/fesm2022/icon.mjs.map +1 -1
- package/icon/index.d.ts +13 -13
- package/input/fesm2022/input.mjs +20 -20
- package/input/fesm2022/input.mjs.map +1 -1
- package/input/index.d.ts +9 -9
- package/label/fesm2022/label.mjs +16 -16
- package/label/fesm2022/label.mjs.map +1 -1
- package/label/index.d.ts +9 -9
- package/package.json +41 -15
- package/popover/README.md +64 -0
- package/popover/fesm2022/popover.mjs +69 -0
- package/popover/fesm2022/popover.mjs.map +1 -0
- package/popover/index.d.ts +30 -0
- package/radio-group/fesm2022/radio-group.mjs +30 -30
- package/radio-group/fesm2022/radio-group.mjs.map +1 -1
- package/radio-group/index.d.ts +15 -15
- package/select/fesm2022/select.mjs +108 -108
- package/select/fesm2022/select.mjs.map +1 -1
- package/select/index.d.ts +35 -35
- package/sonner/fesm2022/sonner.mjs +16 -16
- package/sonner/fesm2022/sonner.mjs.map +1 -1
- package/sonner/index.d.ts +9 -9
- package/spinner/fesm2022/spinner.mjs +17 -17
- package/spinner/fesm2022/spinner.mjs.map +1 -1
- package/spinner/index.d.ts +9 -9
- package/switch/fesm2022/switch.mjs +27 -27
- package/switch/fesm2022/switch.mjs.map +1 -1
- package/switch/index.d.ts +12 -12
- package/tabs/fesm2022/tabs.mjs +53 -53
- package/tabs/fesm2022/tabs.mjs.map +1 -1
- package/tabs/index.d.ts +21 -21
- package/tooltip/fesm2022/tooltip.mjs +22 -22
- package/tooltip/fesm2022/tooltip.mjs.map +1 -1
- package/tooltip/index.d.ts +12 -12
- package/utils/fesm2022/utils.mjs +2 -2
- package/utils/fesm2022/utils.mjs.map +1 -1
- package/utils/index.d.ts +2 -2
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
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';
|
|
9
|
+
|
|
10
|
+
let nextId = 0;
|
|
11
|
+
class EgFormDatePicker {
|
|
12
|
+
// Inputs
|
|
13
|
+
label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
14
|
+
controlName = input('', ...(ngDevMode ? [{ debugName: "controlName" }] : []));
|
|
15
|
+
error = input(undefined, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
16
|
+
hint = input(undefined, ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
17
|
+
// HTML attributes
|
|
18
|
+
id = input(`eg-form-date-picker-${nextId++}`, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
19
|
+
name = input(undefined, ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
20
|
+
placeholder = input('Pick a date', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
21
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
|
|
22
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
23
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : []));
|
|
24
|
+
min = input(null, ...(ngDevMode ? [{ debugName: "min" }] : []));
|
|
25
|
+
max = input(null, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
26
|
+
autoCloseOnSelect = input(true, ...(ngDevMode ? [{ debugName: "autoCloseOnSelect" }] : []));
|
|
27
|
+
// Styling
|
|
28
|
+
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
29
|
+
labelClass = input('', ...(ngDevMode ? [{ debugName: "labelClass" }] : []));
|
|
30
|
+
pickerClass = input('', ...(ngDevMode ? [{ debugName: "pickerClass" }] : []));
|
|
31
|
+
errorClass = input('', ...(ngDevMode ? [{ debugName: "errorClass" }] : []));
|
|
32
|
+
hintClass = input('', ...(ngDevMode ? [{ debugName: "hintClass" }] : []));
|
|
33
|
+
// Computed classes
|
|
34
|
+
$userClass = computed(() => hlm('tw:flex tw:flex-col', this.userClass()), ...(ngDevMode ? [{ debugName: "$userClass" }] : []));
|
|
35
|
+
$labelClass = computed(() => hlm('tw:mb-1', this.labelClass()), ...(ngDevMode ? [{ debugName: "$labelClass" }] : []));
|
|
36
|
+
$pickerClass = computed(() => hlm('tw:mb-1', this.pickerClass()), ...(ngDevMode ? [{ debugName: "$pickerClass" }] : []));
|
|
37
|
+
$errorClass = computed(() => hlm('tw:mt-0', this.errorClass()), ...(ngDevMode ? [{ debugName: "$errorClass" }] : []));
|
|
38
|
+
$hintClass = computed(() => hlm('tw:mt-0', this.hintClass()), ...(ngDevMode ? [{ debugName: "$hintClass" }] : []));
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: EgFormDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: EgFormDatePicker, isStandalone: true, selector: "eg-form-date-picker", 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 }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", 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 }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, autoCloseOnSelect: { classPropertyName: "autoCloseOnSelect", publicName: "autoCloseOnSelect", 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 }, pickerClass: { classPropertyName: "pickerClass", publicName: "pickerClass", 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: `
|
|
41
|
+
@let lbl = label();
|
|
42
|
+
@let nm = controlName();
|
|
43
|
+
@let err = error();
|
|
44
|
+
@let hnt = hint();
|
|
45
|
+
@let rqrd = required();
|
|
46
|
+
|
|
47
|
+
<hlm-form-field>
|
|
48
|
+
@if (lbl) {
|
|
49
|
+
<span hlmLabel [class]="$labelClass()">{{ lbl }}
|
|
50
|
+
@if (rqrd) {
|
|
51
|
+
<span class="tw:text-red-500">*</span>
|
|
52
|
+
}
|
|
53
|
+
</span>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
<hlm-date-picker
|
|
57
|
+
[buttonId]="id()"
|
|
58
|
+
[min]="min()"
|
|
59
|
+
[max]="max()"
|
|
60
|
+
[formControlName]="nm"
|
|
61
|
+
[autoCloseOnSelect]="autoCloseOnSelect()"
|
|
62
|
+
[required]="rqrd"
|
|
63
|
+
[class]="$pickerClass()"
|
|
64
|
+
>
|
|
65
|
+
<span>{{ placeholder() }}</span>
|
|
66
|
+
</hlm-date-picker>
|
|
67
|
+
|
|
68
|
+
@if (err) {
|
|
69
|
+
<hlm-error [class]="$errorClass()">
|
|
70
|
+
{{ err }}
|
|
71
|
+
</hlm-error>
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@if (hnt) {
|
|
75
|
+
<hlm-hint [class]="$hintClass()">
|
|
76
|
+
{{ hnt }}
|
|
77
|
+
</hlm-hint>
|
|
78
|
+
}
|
|
79
|
+
</hlm-form-field>
|
|
80
|
+
`, 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: 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: "component", type: HlmDatePicker, selector: "hlm-date-picker", inputs: ["class", "buttonId", "min", "max", "disabled", "date", "autoCloseOnSelect", "formatDate", "transformDate"], outputs: ["dateChange"] }] });
|
|
81
|
+
}
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: EgFormDatePicker, decorators: [{
|
|
83
|
+
type: Component,
|
|
84
|
+
args: [{
|
|
85
|
+
selector: 'eg-form-date-picker',
|
|
86
|
+
standalone: true,
|
|
87
|
+
host: {
|
|
88
|
+
class: 'tw:w-full',
|
|
89
|
+
},
|
|
90
|
+
imports: [ReactiveFormsModule, HlmFormField, HlmError, HlmHint, HlmLabel, HlmDatePicker],
|
|
91
|
+
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
92
|
+
// prettier-ignore
|
|
93
|
+
template: `
|
|
94
|
+
@let lbl = label();
|
|
95
|
+
@let nm = controlName();
|
|
96
|
+
@let err = error();
|
|
97
|
+
@let hnt = hint();
|
|
98
|
+
@let rqrd = required();
|
|
99
|
+
|
|
100
|
+
<hlm-form-field>
|
|
101
|
+
@if (lbl) {
|
|
102
|
+
<span hlmLabel [class]="$labelClass()">{{ lbl }}
|
|
103
|
+
@if (rqrd) {
|
|
104
|
+
<span class="tw:text-red-500">*</span>
|
|
105
|
+
}
|
|
106
|
+
</span>
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
<hlm-date-picker
|
|
110
|
+
[buttonId]="id()"
|
|
111
|
+
[min]="min()"
|
|
112
|
+
[max]="max()"
|
|
113
|
+
[formControlName]="nm"
|
|
114
|
+
[autoCloseOnSelect]="autoCloseOnSelect()"
|
|
115
|
+
[required]="rqrd"
|
|
116
|
+
[class]="$pickerClass()"
|
|
117
|
+
>
|
|
118
|
+
<span>{{ placeholder() }}</span>
|
|
119
|
+
</hlm-date-picker>
|
|
120
|
+
|
|
121
|
+
@if (err) {
|
|
122
|
+
<hlm-error [class]="$errorClass()">
|
|
123
|
+
{{ err }}
|
|
124
|
+
</hlm-error>
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@if (hnt) {
|
|
128
|
+
<hlm-hint [class]="$hintClass()">
|
|
129
|
+
{{ hnt }}
|
|
130
|
+
</hlm-hint>
|
|
131
|
+
}
|
|
132
|
+
</hlm-form-field>
|
|
133
|
+
`,
|
|
134
|
+
}]
|
|
135
|
+
}] });
|
|
136
|
+
|
|
137
|
+
/*
|
|
138
|
+
* Public API Surface of form-date-picker
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Generated bundle index. Do not edit.
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
export { EgFormDatePicker };
|
|
146
|
+
//# sourceMappingURL=form-date-picker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-date-picker.mjs","sources":["../../../projects/form-date-picker/src/lib/form-date-picker.ts","../../../projects/form-date-picker/src/public-api.ts","../../../projects/form-date-picker/src/form-date-picker.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { ControlContainer, FormGroupDirective, ReactiveFormsModule } from '@angular/forms';\nimport { HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';\nimport { HlmLabel } from '@egose/shadcn-theme-ng/label';\nimport { HlmDatePicker } from '@egose/shadcn-theme-ng/date-picker';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\nlet nextId = 0;\n\n@Component({\n selector: 'eg-form-date-picker',\n standalone: true,\n host: {\n class: 'tw:w-full',\n },\n imports: [ReactiveFormsModule, HlmFormField, HlmError, HlmHint, HlmLabel, HlmDatePicker],\n providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n // prettier-ignore\n template: `\n @let lbl = label();\n @let nm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <hlm-form-field>\n @if (lbl) {\n <span hlmLabel [class]=\"$labelClass()\">{{ lbl }}\n @if (rqrd) {\n <span class=\"tw:text-red-500\">*</span>\n }\n </span>\n }\n\n <hlm-date-picker\n [buttonId]=\"id()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [formControlName]=\"nm\"\n [autoCloseOnSelect]=\"autoCloseOnSelect()\"\n [required]=\"rqrd\"\n [class]=\"$pickerClass()\"\n >\n <span>{{ placeholder() }}</span>\n </hlm-date-picker>\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 </hlm-form-field>\n `,\n})\nexport class EgFormDatePicker {\n // Inputs\n label = input<string | undefined>(undefined);\n controlName = input<string>('');\n error = input<string | undefined>(undefined);\n hint = input<string | undefined>(undefined);\n\n // HTML attributes\n id = input<string>(`eg-form-date-picker-${nextId++}`);\n name = input<string | undefined>(undefined);\n placeholder = input<string>('Pick a date');\n readonly = input<boolean>(false);\n disabled = input<boolean>(false);\n required = input<boolean>(false);\n min = input<Date | string | null>(null);\n max = input<Date | string | null>(null);\n autoCloseOnSelect = input<boolean>(true);\n\n // Styling\n userClass = input<ClassValue>('', { alias: 'class' });\n labelClass = input<string>('');\n pickerClass = input<string>('');\n errorClass = input<string>('');\n hintClass = input<string>('');\n\n // Computed classes\n $userClass = computed(() => hlm('tw:flex tw:flex-col', this.userClass()));\n $labelClass = computed(() => hlm('tw:mb-1', this.labelClass()));\n $pickerClass = computed(() => hlm('tw:mb-1', this.pickerClass()));\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-date-picker\n */\n\nexport * from './lib/form-date-picker';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAQA,IAAI,MAAM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A,KAAK,EAAE,WAAW;AACnB,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,CAAC;oBACxF,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;;AAE3E,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCT,EAAA,CAAA;AACF,iBAAA;;;AC5DD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ClassValue } from 'clsx';
|
|
3
|
+
|
|
4
|
+
declare class EgFormDatePicker {
|
|
5
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
6
|
+
controlName: _angular_core.InputSignal<string>;
|
|
7
|
+
error: _angular_core.InputSignal<string | undefined>;
|
|
8
|
+
hint: _angular_core.InputSignal<string | undefined>;
|
|
9
|
+
id: _angular_core.InputSignal<string>;
|
|
10
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
11
|
+
placeholder: _angular_core.InputSignal<string>;
|
|
12
|
+
readonly: _angular_core.InputSignal<boolean>;
|
|
13
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
14
|
+
required: _angular_core.InputSignal<boolean>;
|
|
15
|
+
min: _angular_core.InputSignal<string | Date | null>;
|
|
16
|
+
max: _angular_core.InputSignal<string | Date | null>;
|
|
17
|
+
autoCloseOnSelect: _angular_core.InputSignal<boolean>;
|
|
18
|
+
userClass: _angular_core.InputSignal<ClassValue>;
|
|
19
|
+
labelClass: _angular_core.InputSignal<string>;
|
|
20
|
+
pickerClass: _angular_core.InputSignal<string>;
|
|
21
|
+
errorClass: _angular_core.InputSignal<string>;
|
|
22
|
+
hintClass: _angular_core.InputSignal<string>;
|
|
23
|
+
$userClass: _angular_core.Signal<string>;
|
|
24
|
+
$labelClass: _angular_core.Signal<string>;
|
|
25
|
+
$pickerClass: _angular_core.Signal<string>;
|
|
26
|
+
$errorClass: _angular_core.Signal<string>;
|
|
27
|
+
$hintClass: _angular_core.Signal<string>;
|
|
28
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormDatePicker, never>;
|
|
29
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormDatePicker, "eg-form-date-picker", never, { "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; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "autoCloseOnSelect": { "alias": "autoCloseOnSelect"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "pickerClass": { "alias": "pickerClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { EgFormDatePicker };
|
|
@@ -1,67 +1,69 @@
|
|
|
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 {
|
|
3
|
+
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
4
|
+
import { FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
4
5
|
import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
|
|
5
6
|
|
|
6
|
-
class
|
|
7
|
+
class HlmError {
|
|
7
8
|
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
8
|
-
_computedClass = computed(() =>
|
|
9
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
10
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
9
|
+
_computedClass = computed(() => hlm('tw:text-destructive tw:block tw:text-sm tw:font-medium', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmError, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
11
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.0", type: HlmError, isStandalone: true, selector: "hlm-error", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
|
|
11
12
|
}
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmError, decorators: [{
|
|
13
14
|
type: Directive,
|
|
14
15
|
args: [{
|
|
15
|
-
selector: '
|
|
16
|
+
selector: 'hlm-error',
|
|
16
17
|
host: {
|
|
17
18
|
'[class]': '_computedClass()',
|
|
18
19
|
},
|
|
19
20
|
}]
|
|
20
21
|
}] });
|
|
21
22
|
|
|
22
|
-
class
|
|
23
|
+
class HlmFormField {
|
|
23
24
|
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
24
|
-
_computedClass = computed(() =>
|
|
25
|
+
_computedClass = computed(() => hlm('tw:block tw:space-y-2', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
25
26
|
control = contentChild(BrnFormFieldControl, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
26
|
-
errorChildren = contentChildren(
|
|
27
|
+
errorChildren = contentChildren(HlmError, ...(ngDevMode ? [{ debugName: "errorChildren" }] : []));
|
|
27
28
|
_hasDisplayedMessage = computed(() => this.errorChildren() && this.errorChildren().length > 0 && this.control()?.errorState() ? 'error' : 'hint', ...(ngDevMode ? [{ debugName: "_hasDisplayedMessage" }] : []));
|
|
28
29
|
constructor() {
|
|
29
30
|
effect(() => {
|
|
30
31
|
if (!this.control()) {
|
|
31
|
-
throw new Error('
|
|
32
|
+
throw new Error('hlm-form-field must contain a BrnFormFieldControl.');
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
36
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
36
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
37
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: HlmFormField, isStandalone: true, selector: "hlm-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: BrnFormFieldControl, descendants: true, isSignal: true }, { propertyName: "errorChildren", predicate: HlmError, isSignal: true }], ngImport: i0, template: `
|
|
37
38
|
<ng-content />
|
|
38
39
|
|
|
39
40
|
@switch (_hasDisplayedMessage()) {
|
|
40
41
|
@case ('error') {
|
|
41
|
-
<ng-content select="
|
|
42
|
+
<ng-content select="hlm-error" />
|
|
42
43
|
}
|
|
43
44
|
@default {
|
|
44
|
-
<ng-content select="
|
|
45
|
+
<ng-content select="hlm-hint" />
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
49
|
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormField, decorators: [{
|
|
50
51
|
type: Component,
|
|
51
52
|
args: [{
|
|
52
|
-
selector: '
|
|
53
|
+
selector: 'hlm-form-field',
|
|
53
54
|
template: `
|
|
54
55
|
<ng-content />
|
|
55
56
|
|
|
56
57
|
@switch (_hasDisplayedMessage()) {
|
|
57
58
|
@case ('error') {
|
|
58
|
-
<ng-content select="
|
|
59
|
+
<ng-content select="hlm-error" />
|
|
59
60
|
}
|
|
60
61
|
@default {
|
|
61
|
-
<ng-content select="
|
|
62
|
+
<ng-content select="hlm-hint" />
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
`,
|
|
66
|
+
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
65
67
|
host: {
|
|
66
68
|
'[class]': '_computedClass()',
|
|
67
69
|
},
|
|
@@ -69,16 +71,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
69
71
|
}]
|
|
70
72
|
}], ctorParameters: () => [] });
|
|
71
73
|
|
|
72
|
-
class
|
|
74
|
+
class HlmHint {
|
|
73
75
|
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
74
|
-
_computedClass = computed(() =>
|
|
75
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
76
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
76
|
+
_computedClass = computed(() => hlm('tw:text-muted-foreground tw:block tw:text-sm', this.userClass()), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
77
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmHint, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
78
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.0", type: HlmHint, isStandalone: true, selector: "hlm-hint", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
|
|
77
79
|
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmHint, decorators: [{
|
|
79
81
|
type: Directive,
|
|
80
82
|
args: [{
|
|
81
|
-
selector: '
|
|
83
|
+
selector: 'hlm-hint',
|
|
82
84
|
host: {
|
|
83
85
|
'[class]': '_computedClass()',
|
|
84
86
|
},
|
|
@@ -88,17 +90,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
88
90
|
/*
|
|
89
91
|
* Public API Surface of form-field
|
|
90
92
|
*/
|
|
91
|
-
const
|
|
92
|
-
class
|
|
93
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
94
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
95
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
93
|
+
const HlmFormFieldImports = [HlmFormField, HlmError, HlmHint];
|
|
94
|
+
class HlmFormFieldModule {
|
|
95
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
96
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: HlmFormFieldModule, imports: [HlmFormField, HlmError, HlmHint], exports: [HlmFormField, HlmError, HlmHint] });
|
|
97
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormFieldModule });
|
|
96
98
|
}
|
|
97
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: HlmFormFieldModule, decorators: [{
|
|
98
100
|
type: NgModule,
|
|
99
101
|
args: [{
|
|
100
|
-
imports: [...
|
|
101
|
-
exports: [...
|
|
102
|
+
imports: [...HlmFormFieldImports],
|
|
103
|
+
exports: [...HlmFormFieldImports],
|
|
102
104
|
}]
|
|
103
105
|
}] });
|
|
104
106
|
|
|
@@ -106,5 +108,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
106
108
|
* Generated bundle index. Do not edit.
|
|
107
109
|
*/
|
|
108
110
|
|
|
109
|
-
export {
|
|
111
|
+
export { HlmError, HlmFormField, HlmFormFieldImports, HlmFormFieldModule, HlmHint };
|
|
110
112
|
//# sourceMappingURL=form-field.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.mjs","sources":["../../../projects/form-field/src/lib/error.ts","../../../projects/form-field/src/lib/form-field.ts","../../../projects/form-field/src/lib/hint.ts","../../../projects/form-field/src/public-api.ts","../../../projects/form-field/src/form-field.ts"],"sourcesContent":["import { computed, Directive, input } from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"form-field.mjs","sources":["../../../projects/form-field/src/lib/error.ts","../../../projects/form-field/src/lib/form-field.ts","../../../projects/form-field/src/lib/hint.ts","../../../projects/form-field/src/public-api.ts","../../../projects/form-field/src/form-field.ts"],"sourcesContent":["import { computed, Directive, input } from '@angular/core';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\n@Directive({\n selector: 'hlm-error',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmError {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() =>\n hlm('tw:text-destructive tw:block tw:text-sm tw:font-medium', this.userClass()),\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n effect,\n input,\n} from '@angular/core';\nimport { ControlContainer, FormGroupDirective } from '@angular/forms';\nimport { BrnFormFieldControl } from '@spartan-ng/brain/form-field';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\nimport { HlmError } from './error';\n\n@Component({\n selector: 'hlm-form-field',\n template: `\n <ng-content />\n\n @switch (_hasDisplayedMessage()) {\n @case ('error') {\n <ng-content select=\"hlm-error\" />\n }\n @default {\n <ng-content select=\"hlm-hint\" />\n }\n }\n `,\n providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n host: {\n '[class]': '_computedClass()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HlmFormField {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() => hlm('tw:block tw:space-y-2', this.userClass()));\n public readonly control = contentChild(BrnFormFieldControl);\n\n public readonly errorChildren = contentChildren(HlmError);\n\n protected readonly _hasDisplayedMessage = computed<'error' | 'hint'>(() =>\n this.errorChildren() && this.errorChildren().length > 0 && this.control()?.errorState() ? 'error' : 'hint',\n );\n\n constructor() {\n effect(() => {\n if (!this.control()) {\n throw new Error('hlm-form-field must contain a BrnFormFieldControl.');\n }\n });\n }\n}\n","import { computed, Directive, input } from '@angular/core';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\n@Directive({\n selector: 'hlm-hint',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmHint {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() =>\n hlm('tw:text-muted-foreground tw:block tw:text-sm', this.userClass()),\n );\n}\n","/*\n * Public API Surface of form-field\n */\n\nimport { NgModule } from '@angular/core';\nimport { HlmError } from './lib/error';\nimport { HlmFormField } from './lib/form-field';\nimport { HlmHint } from './lib/hint';\n\nexport * from './lib/error';\nexport * from './lib/form-field';\nexport * from './lib/hint';\n\nexport const HlmFormFieldImports = [HlmFormField, HlmError, HlmHint];\n\n@NgModule({\n imports: [...HlmFormFieldImports],\n exports: [...HlmFormFieldImports],\n})\nexport class HlmFormFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAUa,QAAQ,CAAA;AACH,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,MAC3C,GAAG,CAAC,wDAAwD,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,0DAChF;uGAJU,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAR,QAAQ,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBA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package/form-field/index.d.ts
CHANGED
|
@@ -2,36 +2,36 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { ClassValue } from 'clsx';
|
|
3
3
|
import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
|
|
4
4
|
|
|
5
|
-
declare class
|
|
5
|
+
declare class HlmError {
|
|
6
6
|
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
7
7
|
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
8
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
9
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<
|
|
8
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmError, never>;
|
|
9
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HlmError, "hlm-error", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
declare class
|
|
12
|
+
declare class HlmFormField {
|
|
13
13
|
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
14
14
|
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
15
15
|
readonly control: _angular_core.Signal<BrnFormFieldControl | undefined>;
|
|
16
|
-
readonly errorChildren: _angular_core.Signal<readonly
|
|
16
|
+
readonly errorChildren: _angular_core.Signal<readonly HlmError[]>;
|
|
17
17
|
protected readonly _hasDisplayedMessage: _angular_core.Signal<"error" | "hint">;
|
|
18
18
|
constructor();
|
|
19
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
20
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<
|
|
19
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmFormField, never>;
|
|
20
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmFormField, "hlm-form-field", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, ["control", "errorChildren"], ["*", "hlm-error", "hlm-hint"], true, never>;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
declare class
|
|
23
|
+
declare class HlmHint {
|
|
24
24
|
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
25
25
|
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
26
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
27
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<
|
|
26
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmHint, never>;
|
|
27
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HlmHint, "hlm-hint", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
declare const
|
|
31
|
-
declare class
|
|
32
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
33
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<
|
|
34
|
-
static ɵinj: _angular_core.ɵɵInjectorDeclaration<
|
|
30
|
+
declare const HlmFormFieldImports: (typeof HlmError | typeof HlmFormField | typeof HlmHint)[];
|
|
31
|
+
declare class HlmFormFieldModule {
|
|
32
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmFormFieldModule, never>;
|
|
33
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmFormFieldModule, never, [typeof HlmFormField, typeof HlmError, typeof HlmHint], [typeof HlmFormField, typeof HlmError, typeof HlmHint]>;
|
|
34
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<HlmFormFieldModule>;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export {
|
|
37
|
+
export { HlmError, HlmFormField, HlmFormFieldImports, HlmFormFieldModule, HlmHint };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# FormSelect
|
|
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-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.
|