@egose/shadcn-theme-ng-tw 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/alert/fesm2022/alert.mjs +1 -1
- package/autocomplete/fesm2022/autocomplete.mjs +1 -1
- package/button/fesm2022/button.mjs +3 -3
- package/checkbox/fesm2022/checkbox.mjs +6 -7
- package/checkbox/types/checkbox.d.ts +1 -1
- package/combobox/fesm2022/combobox.mjs +1 -1
- package/date-picker/README.md +15 -11
- package/date-picker/fesm2022/date-picker.mjs +148 -30
- package/date-picker/types/date-picker.d.ts +102 -9
- package/form-autocomplete/README.md +177 -0
- package/form-autocomplete/fesm2022/form-autocomplete.mjs +211 -0
- package/form-autocomplete/package.json +24 -0
- package/form-autocomplete/types/form-autocomplete.d.ts +61 -0
- package/form-checkbox/README.md +13 -3
- package/form-checkbox/fesm2022/form-checkbox.mjs +22 -9
- package/form-checkbox/types/form-checkbox.d.ts +23 -4
- package/form-combobox/README.md +202 -0
- package/form-combobox/fesm2022/form-combobox.mjs +273 -0
- package/form-combobox/package.json +24 -0
- package/form-combobox/types/form-combobox.d.ts +73 -0
- package/form-date-picker/README.md +48 -22
- package/form-date-picker/fesm2022/form-date-picker.mjs +60 -16
- package/form-date-picker/types/form-date-picker.d.ts +17 -1
- package/form-date-picker-multi/README.md +191 -0
- package/form-date-picker-multi/fesm2022/form-date-picker-multi.mjs +239 -0
- package/form-date-picker-multi/package.json +24 -0
- package/form-date-picker-multi/types/form-date-picker-multi.d.ts +58 -0
- package/form-date-range-picker/README.md +253 -0
- package/form-date-range-picker/fesm2022/form-date-range-picker.mjs +236 -0
- package/form-date-range-picker/package.json +24 -0
- package/form-date-range-picker/types/form-date-range-picker.d.ts +55 -0
- package/form-input-otp/README.md +194 -0
- package/form-input-otp/fesm2022/form-input-otp.mjs +194 -0
- package/form-input-otp/package.json +24 -0
- package/form-input-otp/types/form-input-otp.d.ts +58 -0
- package/form-month-year-picker/README.md +188 -0
- package/form-month-year-picker/fesm2022/form-month-year-picker.mjs +229 -0
- package/form-month-year-picker/package.json +24 -0
- package/form-month-year-picker/types/form-month-year-picker.d.ts +53 -0
- package/form-native-select/README.md +205 -0
- package/form-native-select/fesm2022/form-native-select.mjs +187 -0
- package/form-native-select/package.json +24 -0
- package/form-native-select/types/form-native-select.d.ts +57 -0
- package/form-phone-input/README.md +188 -0
- package/form-phone-input/fesm2022/form-phone-input.mjs +203 -0
- package/form-phone-input/package.json +24 -0
- package/form-phone-input/types/form-phone-input.d.ts +58 -0
- package/form-radio-group/README.md +198 -0
- package/form-radio-group/fesm2022/form-radio-group.mjs +211 -0
- package/form-radio-group/package.json +24 -0
- package/form-radio-group/types/form-radio-group.d.ts +63 -0
- package/form-searchable-multiselect/README.md +11 -1
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +19 -10
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +18 -1
- package/form-select/README.md +10 -0
- package/form-select/fesm2022/form-select.mjs +24 -15
- package/form-select/types/form-select.d.ts +18 -1
- package/form-slider/README.md +182 -0
- package/form-slider/fesm2022/form-slider.mjs +186 -0
- package/form-slider/package.json +24 -0
- package/form-slider/types/form-slider.d.ts +60 -0
- package/form-switch/README.md +173 -0
- package/form-switch/fesm2022/form-switch.mjs +178 -0
- package/form-switch/package.json +24 -0
- package/form-switch/types/form-switch.d.ts +50 -0
- package/form-text-input/README.md +10 -0
- package/form-text-input/fesm2022/form-text-input.mjs +19 -10
- package/form-text-input/types/form-text-input.d.ts +18 -1
- package/form-textarea/README.md +11 -1
- package/form-textarea/fesm2022/form-textarea.mjs +19 -10
- package/form-textarea/types/form-textarea.d.ts +18 -1
- package/form-toggle/README.md +186 -0
- package/form-toggle/fesm2022/form-toggle.mjs +241 -0
- package/form-toggle/package.json +24 -0
- package/form-toggle/types/form-toggle.d.ts +82 -0
- package/form-toggle-group/README.md +176 -0
- package/form-toggle-group/fesm2022/form-toggle-group.mjs +216 -0
- package/form-toggle-group/package.json +24 -0
- package/form-toggle-group/types/form-toggle-group.d.ts +65 -0
- package/input-group/fesm2022/input-group.mjs +20 -10
- package/input-group/types/input-group.d.ts +4 -1
- package/native-select/fesm2022/native-select.mjs +18 -6
- package/native-select/types/native-select.d.ts +7 -2
- package/package.json +57 -1
- package/phone-input/README.md +114 -0
- package/phone-input/fesm2022/phone-input.mjs +191 -0
- package/phone-input/package.json +24 -0
- package/phone-input/types/phone-input.d.ts +67 -0
- package/sheet/fesm2022/sheet.mjs +1 -1
- package/switch/fesm2022/switch.mjs +7 -5
- package/switch/types/switch.d.ts +2 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, computed, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
|
|
5
|
+
import { HlmFormIdGenerator, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
6
|
+
import { EgFormField } from '@egose/shadcn-theme-ng-tw/form-field-simple';
|
|
7
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
8
|
+
import { HlmSwitch } from '@egose/shadcn-theme-ng-tw/switch';
|
|
9
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
10
|
+
|
|
11
|
+
const EgFormSwitchConfigToken = new InjectionToken('EgFormSwitchConfig');
|
|
12
|
+
function provideEgFormSwitchConfig(config) {
|
|
13
|
+
return { provide: EgFormSwitchConfigToken, useValue: { ...config } };
|
|
14
|
+
}
|
|
15
|
+
function injectEgFormSwitchConfig() {
|
|
16
|
+
return inject(EgFormSwitchConfigToken, { optional: true }) ?? {};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
class EgFormSwitch {
|
|
20
|
+
formGroupDirective = inject(FormGroupDirective);
|
|
21
|
+
generatedId = inject(HlmFormIdGenerator).generate('eg-form-switch');
|
|
22
|
+
_config = injectEgFormSwitchConfig();
|
|
23
|
+
label = input(undefined, /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
25
|
+
controlId = input(undefined, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
27
|
+
controlName = input('', /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "controlName" }] : /* istanbul ignore next */ []));
|
|
29
|
+
error = input(undefined, /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
31
|
+
hint = input(undefined, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
33
|
+
id = input(undefined, /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
35
|
+
disabled = input(false, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
37
|
+
required = input(false, /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
39
|
+
effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
|
|
41
|
+
errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
43
|
+
hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
45
|
+
describedBy() {
|
|
46
|
+
const control = this.formGroupDirective.form.get(this.controlName());
|
|
47
|
+
return this.error() && control?.invalid && (control.dirty || control.touched)
|
|
48
|
+
? this.errorId()
|
|
49
|
+
: this.hint()
|
|
50
|
+
? this.hintId()
|
|
51
|
+
: null;
|
|
52
|
+
}
|
|
53
|
+
// Styling
|
|
54
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
55
|
+
switchClass = input('', /* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "switchClass" }] : /* istanbul ignore next */ []));
|
|
57
|
+
labelClass = input('', /* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
|
|
59
|
+
errorClass = input('', /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
|
|
61
|
+
hintClass = input('', /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
63
|
+
// Computed classes (library base < global config < per-instance)
|
|
64
|
+
$userClass = computed(() => hlm('tw:w-full', this.userClass()), /* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
66
|
+
$switchClass = computed(() => hlm(this._config.switchClass, this.switchClass()), /* @ts-ignore */
|
|
67
|
+
...(ngDevMode ? [{ debugName: "$switchClass" }] : /* istanbul ignore next */ []));
|
|
68
|
+
$labelClass = computed(() => hlm(this._config.labelClass, this.labelClass()), /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
70
|
+
$errorClass = computed(() => hlm('tw:mt-0', this._config.errorClass, this.errorClass()), /* @ts-ignore */
|
|
71
|
+
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
72
|
+
$hintClass = computed(() => hlm('tw:mt-0', this._config.hintClass, this.hintClass()), /* @ts-ignore */
|
|
73
|
+
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
74
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSwitch, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
75
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormSwitch, isStandalone: true, selector: "eg-form-switch", 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 }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, switchClass: { classPropertyName: "switchClass", publicName: "switchClass", 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": "$userClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
|
|
76
|
+
@let lbl = label();
|
|
77
|
+
@let cnm = controlName();
|
|
78
|
+
@let err = error();
|
|
79
|
+
@let hnt = hint();
|
|
80
|
+
@let rqrd = required();
|
|
81
|
+
|
|
82
|
+
<eg-form-field>
|
|
83
|
+
<div class="tw:flex tw:items-center tw:gap-1">
|
|
84
|
+
<hlm-switch
|
|
85
|
+
[id]="effectiveId()"
|
|
86
|
+
[formControlName]="cnm"
|
|
87
|
+
[required]="rqrd"
|
|
88
|
+
[disabled]="disabled()"
|
|
89
|
+
[aria-describedby]="describedBy()"
|
|
90
|
+
[class]="$switchClass()"
|
|
91
|
+
/>
|
|
92
|
+
@if (lbl) {
|
|
93
|
+
<label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
|
|
94
|
+
>{{ lbl }}
|
|
95
|
+
@if (rqrd) {
|
|
96
|
+
<span class="tw:text-red-500">*</span>
|
|
97
|
+
}
|
|
98
|
+
</label>
|
|
99
|
+
}
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
@if (err) {
|
|
103
|
+
<hlm-error [id]="errorId()" [class]="$errorClass()">
|
|
104
|
+
{{ err }}
|
|
105
|
+
</hlm-error>
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@if (hnt) {
|
|
109
|
+
<hlm-hint [id]="hintId()" [class]="$hintClass()">
|
|
110
|
+
{{ hnt }}
|
|
111
|
+
</hlm-hint>
|
|
112
|
+
}
|
|
113
|
+
</eg-form-field>
|
|
114
|
+
`, 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: "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: HlmSwitch, selector: "hlm-switch", inputs: ["class", "checked", "disabled", "id", "aria-label", "aria-labelledby", "aria-describedby"], outputs: ["checkedChange", "changed"] }, { kind: "component", type: EgFormField, selector: "eg-form-field", inputs: ["class"] }] });
|
|
115
|
+
}
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSwitch, decorators: [{
|
|
117
|
+
type: Component,
|
|
118
|
+
args: [{
|
|
119
|
+
selector: 'eg-form-switch',
|
|
120
|
+
standalone: true,
|
|
121
|
+
host: {
|
|
122
|
+
'[class]': '$userClass()',
|
|
123
|
+
},
|
|
124
|
+
imports: [ReactiveFormsModule, HlmError, HlmHint, HlmLabel, HlmSwitch, EgFormField],
|
|
125
|
+
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
126
|
+
template: `
|
|
127
|
+
@let lbl = label();
|
|
128
|
+
@let cnm = controlName();
|
|
129
|
+
@let err = error();
|
|
130
|
+
@let hnt = hint();
|
|
131
|
+
@let rqrd = required();
|
|
132
|
+
|
|
133
|
+
<eg-form-field>
|
|
134
|
+
<div class="tw:flex tw:items-center tw:gap-1">
|
|
135
|
+
<hlm-switch
|
|
136
|
+
[id]="effectiveId()"
|
|
137
|
+
[formControlName]="cnm"
|
|
138
|
+
[required]="rqrd"
|
|
139
|
+
[disabled]="disabled()"
|
|
140
|
+
[aria-describedby]="describedBy()"
|
|
141
|
+
[class]="$switchClass()"
|
|
142
|
+
/>
|
|
143
|
+
@if (lbl) {
|
|
144
|
+
<label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
|
|
145
|
+
>{{ lbl }}
|
|
146
|
+
@if (rqrd) {
|
|
147
|
+
<span class="tw:text-red-500">*</span>
|
|
148
|
+
}
|
|
149
|
+
</label>
|
|
150
|
+
}
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
@if (err) {
|
|
154
|
+
<hlm-error [id]="errorId()" [class]="$errorClass()">
|
|
155
|
+
{{ err }}
|
|
156
|
+
</hlm-error>
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@if (hnt) {
|
|
160
|
+
<hlm-hint [id]="hintId()" [class]="$hintClass()">
|
|
161
|
+
{{ hnt }}
|
|
162
|
+
</hlm-hint>
|
|
163
|
+
}
|
|
164
|
+
</eg-form-field>
|
|
165
|
+
`,
|
|
166
|
+
}]
|
|
167
|
+
}], 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 }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], switchClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "switchClass", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
|
|
168
|
+
|
|
169
|
+
/*
|
|
170
|
+
* Public API Surface of form-switch
|
|
171
|
+
*/
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Generated bundle index. Do not edit.
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
export { EgFormSwitch, injectEgFormSwitchConfig, provideEgFormSwitchConfig };
|
|
178
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "form-switch",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^20.3.0 || ^22.0.0",
|
|
6
|
+
"@angular/core": "^20.3.0 || ^22.0.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/form-switch.mjs",
|
|
13
|
+
"typings": "types/form-switch.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/form-switch.d.ts",
|
|
20
|
+
"default": "./fesm2022/form-switch.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "module"
|
|
24
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ValueProvider } from '@angular/core';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
4
|
+
|
|
5
|
+
declare class EgFormSwitch {
|
|
6
|
+
private readonly formGroupDirective;
|
|
7
|
+
private readonly generatedId;
|
|
8
|
+
private readonly _config;
|
|
9
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
10
|
+
controlId: _angular_core.InputSignal<string | undefined>;
|
|
11
|
+
controlName: _angular_core.InputSignal<string>;
|
|
12
|
+
error: _angular_core.InputSignal<string | undefined>;
|
|
13
|
+
hint: _angular_core.InputSignal<string | undefined>;
|
|
14
|
+
id: _angular_core.InputSignal<string | undefined>;
|
|
15
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
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;
|
|
21
|
+
userClass: _angular_core.InputSignal<ClassValue>;
|
|
22
|
+
switchClass: _angular_core.InputSignal<string>;
|
|
23
|
+
labelClass: _angular_core.InputSignal<string>;
|
|
24
|
+
errorClass: _angular_core.InputSignal<string>;
|
|
25
|
+
hintClass: _angular_core.InputSignal<string>;
|
|
26
|
+
$userClass: _angular_core.Signal<string>;
|
|
27
|
+
$switchClass: _angular_core.Signal<string>;
|
|
28
|
+
$labelClass: _angular_core.Signal<string>;
|
|
29
|
+
$errorClass: _angular_core.Signal<string>;
|
|
30
|
+
$hintClass: _angular_core.Signal<string>;
|
|
31
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormSwitch, never>;
|
|
32
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormSwitch, "eg-form-switch", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "switchClass": { "alias": "switchClass"; "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>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface EgFormSwitchConfig {
|
|
36
|
+
/**
|
|
37
|
+
* Global class defaults for `eg-form-switch` styling slots.
|
|
38
|
+
* Each is merged under the matching per-instance `*Class` input
|
|
39
|
+
* (library base < global config < per-instance).
|
|
40
|
+
*/
|
|
41
|
+
switchClass?: string;
|
|
42
|
+
labelClass?: string;
|
|
43
|
+
errorClass?: string;
|
|
44
|
+
hintClass?: string;
|
|
45
|
+
}
|
|
46
|
+
declare function provideEgFormSwitchConfig(config: Partial<EgFormSwitchConfig>): ValueProvider;
|
|
47
|
+
declare function injectEgFormSwitchConfig(): EgFormSwitchConfig;
|
|
48
|
+
|
|
49
|
+
export { EgFormSwitch, injectEgFormSwitchConfig, provideEgFormSwitchConfig };
|
|
50
|
+
export type { EgFormSwitchConfig };
|
|
@@ -364,6 +364,16 @@ export class ProfileExample {
|
|
|
364
364
|
|
|
365
365
|
No component-specific CSS variables; the input look comes from the shared theme tokens consumed by `HlmInput`. Adjust density with `inputClass` (e.g. `tw:h-11`), label/error/hint spacing with their `*Class` inputs.
|
|
366
366
|
|
|
367
|
+
Global defaults per styling slot via the wrapper config (precedence: library base < global config < per-instance):
|
|
368
|
+
|
|
369
|
+
```ts
|
|
370
|
+
import { provideEgFormTextInputConfig } from '@egose/shadcn-theme-ng/form-text-input';
|
|
371
|
+
|
|
372
|
+
await bootstrapApplication(App, {
|
|
373
|
+
providers: [provideEgFormTextInputConfig({ inputClass: 'tw:text-sm', labelClass: 'tw:font-medium' })],
|
|
374
|
+
});
|
|
375
|
+
```
|
|
376
|
+
|
|
367
377
|
## Related subpaths
|
|
368
378
|
|
|
369
379
|
- `@egose/shadcn-theme-ng/input` — the raw `HlmInput` directive for non-form or template-driven inputs.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, computed, Component } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
|
|
5
5
|
import { HlmFormIdGenerator, HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
@@ -7,9 +7,18 @@ import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
|
7
7
|
import { HlmInput } from '@egose/shadcn-theme-ng-tw/input';
|
|
8
8
|
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
9
|
|
|
10
|
+
const EgFormTextInputConfigToken = new InjectionToken('EgFormTextInputConfig');
|
|
11
|
+
function provideEgFormTextInputConfig(config) {
|
|
12
|
+
return { provide: EgFormTextInputConfigToken, useValue: { ...config } };
|
|
13
|
+
}
|
|
14
|
+
function injectEgFormTextInputConfig() {
|
|
15
|
+
return inject(EgFormTextInputConfigToken, { optional: true }) ?? {};
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
class EgFormTextInput {
|
|
11
19
|
formGroupDirective = inject(FormGroupDirective);
|
|
12
20
|
generatedId = inject(HlmFormIdGenerator).generate('eg-form-text-input');
|
|
21
|
+
_config = injectEgFormTextInputConfig();
|
|
13
22
|
label = input(undefined, /* @ts-ignore */
|
|
14
23
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
15
24
|
controlId = input(undefined, /* @ts-ignore */
|
|
@@ -76,19 +85,19 @@ class EgFormTextInput {
|
|
|
76
85
|
...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
|
|
77
86
|
hintClass = input('', /* @ts-ignore */
|
|
78
87
|
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
79
|
-
// Computed class bindings
|
|
80
|
-
$userClass = computed(() => hlm('tw:
|
|
88
|
+
// Computed class bindings (library base < global config < per-instance)
|
|
89
|
+
$userClass = computed(() => hlm('tw:w-full', this.userClass()), /* @ts-ignore */
|
|
81
90
|
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
82
|
-
$labelClass = computed(() => hlm('tw:mb-1 tw:gap-0', this.labelClass()), /* @ts-ignore */
|
|
91
|
+
$labelClass = computed(() => hlm('tw:mb-1 tw:gap-0', this._config.labelClass, this.labelClass()), /* @ts-ignore */
|
|
83
92
|
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
84
|
-
$inputClass = computed(() => hlm('tw:mb-1', this.inputClass()), /* @ts-ignore */
|
|
93
|
+
$inputClass = computed(() => hlm('tw:mb-1', this._config.inputClass, this.inputClass()), /* @ts-ignore */
|
|
85
94
|
...(ngDevMode ? [{ debugName: "$inputClass" }] : /* istanbul ignore next */ []));
|
|
86
|
-
$errorClass = computed(() => hlm('tw:mt-0', this.errorClass()), /* @ts-ignore */
|
|
95
|
+
$errorClass = computed(() => hlm('tw:mt-0', this._config.errorClass, this.errorClass()), /* @ts-ignore */
|
|
87
96
|
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
88
|
-
$hintClass = computed(() => hlm('tw:mt-0', this.hintClass()), /* @ts-ignore */
|
|
97
|
+
$hintClass = computed(() => hlm('tw:mt-0', this._config.hintClass, this.hintClass()), /* @ts-ignore */
|
|
89
98
|
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
90
99
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormTextInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
91
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormTextInput, isStandalone: true, selector: "eg-form-text-input", 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 }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", 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 }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "pattern", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", 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 }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: {
|
|
100
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormTextInput, isStandalone: true, selector: "eg-form-text-input", 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 }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", 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 }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "pattern", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", 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 }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "$userClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
|
|
92
101
|
@let lbl = label();
|
|
93
102
|
@let cnm = controlName();
|
|
94
103
|
@let err = error();
|
|
@@ -147,7 +156,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
147
156
|
selector: 'eg-form-text-input',
|
|
148
157
|
standalone: true,
|
|
149
158
|
host: {
|
|
150
|
-
class: '
|
|
159
|
+
'[class]': '$userClass()',
|
|
151
160
|
},
|
|
152
161
|
imports: [ReactiveFormsModule, HlmFormField, HlmError, HlmHint, HlmLabel, HlmInput],
|
|
153
162
|
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
@@ -214,5 +223,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
214
223
|
* Generated bundle index. Do not edit.
|
|
215
224
|
*/
|
|
216
225
|
|
|
217
|
-
export { EgFormTextInput };
|
|
226
|
+
export { EgFormTextInput, injectEgFormTextInputConfig, provideEgFormTextInputConfig };
|
|
218
227
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ValueProvider } from '@angular/core';
|
|
2
3
|
import { ClassValue } from 'clsx';
|
|
3
4
|
|
|
4
5
|
declare class EgFormTextInput {
|
|
5
6
|
private readonly formGroupDirective;
|
|
6
7
|
private readonly generatedId;
|
|
8
|
+
private readonly _config;
|
|
7
9
|
label: _angular_core.InputSignal<string | undefined>;
|
|
8
10
|
controlId: _angular_core.InputSignal<string | undefined>;
|
|
9
11
|
controlName: _angular_core.InputSignal<string>;
|
|
@@ -42,4 +44,19 @@ declare class EgFormTextInput {
|
|
|
42
44
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormTextInput, "eg-form-text-input", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "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; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "minlength": { "alias": "minlength"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "pattern": { "alias": "pattern"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
interface EgFormTextInputConfig {
|
|
48
|
+
/**
|
|
49
|
+
* Global class defaults for `eg-form-text-input` styling slots.
|
|
50
|
+
* Each is merged under the matching per-instance `*Class` input
|
|
51
|
+
* (library base < global config < per-instance).
|
|
52
|
+
*/
|
|
53
|
+
labelClass?: string;
|
|
54
|
+
inputClass?: string;
|
|
55
|
+
errorClass?: string;
|
|
56
|
+
hintClass?: string;
|
|
57
|
+
}
|
|
58
|
+
declare function provideEgFormTextInputConfig(config: Partial<EgFormTextInputConfig>): ValueProvider;
|
|
59
|
+
declare function injectEgFormTextInputConfig(): EgFormTextInputConfig;
|
|
60
|
+
|
|
61
|
+
export { EgFormTextInput, injectEgFormTextInputConfig, provideEgFormTextInputConfig };
|
|
62
|
+
export type { EgFormTextInputConfig };
|
package/form-textarea/README.md
CHANGED
|
@@ -92,7 +92,7 @@ Real selectors: `eg-form-textarea`, `hlm-form-field`, `label[hlmLabel]`, `textar
|
|
|
92
92
|
| `required` | `boolean` | `false` | Native `required` + red `*` on the label. |
|
|
93
93
|
| `rows` | `string \| number \| undefined` | `3` | Native `rows` (visible height). |
|
|
94
94
|
| `cols` | `string \| number \| undefined` | `undefined` | Native `cols` (visible width). |
|
|
95
|
-
| `class` (`userClass`) | `ClassValue` | `''` | Extra host classes (merged over `tw:
|
|
95
|
+
| `class` (`userClass`) | `ClassValue` | `''` | Extra host classes (merged over `tw:w-full`). |
|
|
96
96
|
| `labelClass` | `string` | `''` | Extra label classes (merged over `tw:mb-1 tw:gap-0`). |
|
|
97
97
|
| `textareaClass` | `string` | `''` | Extra textarea classes (merged over `tw:mb-1`). |
|
|
98
98
|
| `errorClass` | `string` | `''` | Extra error classes (merged over `tw:mt-0`). |
|
|
@@ -340,6 +340,16 @@ export class ProgrammaticExample {
|
|
|
340
340
|
|
|
341
341
|
No component-specific CSS variables; visuals come from the shared theme tokens via the `hlmInput` class hook. Control height with `rows` and `textareaClass` (`tw:min-h-*`, `tw:resize-y` / `tw:resize-none`).
|
|
342
342
|
|
|
343
|
+
Global defaults per styling slot via the wrapper config (precedence: library base < global config < per-instance):
|
|
344
|
+
|
|
345
|
+
```ts
|
|
346
|
+
import { provideEgFormTextareaConfig } from '@egose/shadcn-theme-ng/form-textarea';
|
|
347
|
+
|
|
348
|
+
await bootstrapApplication(App, {
|
|
349
|
+
providers: [provideEgFormTextareaConfig({ textareaClass: 'tw:text-sm', labelClass: 'tw:font-medium' })],
|
|
350
|
+
});
|
|
351
|
+
```
|
|
352
|
+
|
|
343
353
|
## Related subpaths
|
|
344
354
|
|
|
345
355
|
- `@egose/shadcn-theme-ng/form-text-input` — the single-line sibling.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, computed, Component } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
|
|
5
5
|
import { HlmFormIdGenerator, HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
@@ -7,9 +7,18 @@ import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
|
7
7
|
import { HlmInput } from '@egose/shadcn-theme-ng-tw/input';
|
|
8
8
|
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
9
|
|
|
10
|
+
const EgFormTextareaConfigToken = new InjectionToken('EgFormTextareaConfig');
|
|
11
|
+
function provideEgFormTextareaConfig(config) {
|
|
12
|
+
return { provide: EgFormTextareaConfigToken, useValue: { ...config } };
|
|
13
|
+
}
|
|
14
|
+
function injectEgFormTextareaConfig() {
|
|
15
|
+
return inject(EgFormTextareaConfigToken, { optional: true }) ?? {};
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
class EgFormTextarea {
|
|
11
19
|
formGroupDirective = inject(FormGroupDirective);
|
|
12
20
|
generatedId = inject(HlmFormIdGenerator).generate('eg-form-textarea');
|
|
21
|
+
_config = injectEgFormTextareaConfig();
|
|
13
22
|
// General props
|
|
14
23
|
label = input(undefined, /* @ts-ignore */
|
|
15
24
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -69,19 +78,19 @@ class EgFormTextarea {
|
|
|
69
78
|
...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
|
|
70
79
|
hintClass = input('', /* @ts-ignore */
|
|
71
80
|
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
72
|
-
// Computed class bindings
|
|
73
|
-
$userClass = computed(() => hlm('tw:
|
|
81
|
+
// Computed class bindings (library base < global config < per-instance)
|
|
82
|
+
$userClass = computed(() => hlm('tw:w-full', this.userClass()), /* @ts-ignore */
|
|
74
83
|
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
75
|
-
$labelClass = computed(() => hlm('tw:mb-1 tw:gap-0', this.labelClass()), /* @ts-ignore */
|
|
84
|
+
$labelClass = computed(() => hlm('tw:mb-1 tw:gap-0', this._config.labelClass, this.labelClass()), /* @ts-ignore */
|
|
76
85
|
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
77
|
-
$textareaClass = computed(() => hlm('tw:mb-1', this.textareaClass()), /* @ts-ignore */
|
|
86
|
+
$textareaClass = computed(() => hlm('tw:mb-1', this._config.textareaClass, this.textareaClass()), /* @ts-ignore */
|
|
78
87
|
...(ngDevMode ? [{ debugName: "$textareaClass" }] : /* istanbul ignore next */ []));
|
|
79
|
-
$errorClass = computed(() => hlm('tw:mt-0', this.errorClass()), /* @ts-ignore */
|
|
88
|
+
$errorClass = computed(() => hlm('tw:mt-0', this._config.errorClass, this.errorClass()), /* @ts-ignore */
|
|
80
89
|
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
81
|
-
$hintClass = computed(() => hlm('tw:mt-0', this.hintClass()), /* @ts-ignore */
|
|
90
|
+
$hintClass = computed(() => hlm('tw:mt-0', this._config.hintClass, this.hintClass()), /* @ts-ignore */
|
|
82
91
|
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
83
92
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormTextarea, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
84
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormTextarea, isStandalone: true, selector: "eg-form-textarea", 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 }, 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 }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, cols: { classPropertyName: "cols", publicName: "cols", 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 }, textareaClass: { classPropertyName: "textareaClass", publicName: "textareaClass", 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: {
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormTextarea, isStandalone: true, selector: "eg-form-textarea", 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 }, 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 }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, cols: { classPropertyName: "cols", publicName: "cols", 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 }, textareaClass: { classPropertyName: "textareaClass", publicName: "textareaClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "$userClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
|
|
85
94
|
@let lbl = label();
|
|
86
95
|
@let cnm = controlName();
|
|
87
96
|
@let err = error();
|
|
@@ -136,7 +145,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
136
145
|
selector: 'eg-form-textarea',
|
|
137
146
|
standalone: true,
|
|
138
147
|
host: {
|
|
139
|
-
class: '
|
|
148
|
+
'[class]': '$userClass()',
|
|
140
149
|
},
|
|
141
150
|
imports: [ReactiveFormsModule, HlmFormField, HlmError, HlmHint, HlmLabel, HlmInput],
|
|
142
151
|
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
@@ -199,5 +208,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
199
208
|
* Generated bundle index. Do not edit.
|
|
200
209
|
*/
|
|
201
210
|
|
|
202
|
-
export { EgFormTextarea };
|
|
211
|
+
export { EgFormTextarea, injectEgFormTextareaConfig, provideEgFormTextareaConfig };
|
|
203
212
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ValueProvider } from '@angular/core';
|
|
2
3
|
import { ClassValue } from 'clsx';
|
|
3
4
|
|
|
4
5
|
declare class EgFormTextarea {
|
|
5
6
|
private readonly formGroupDirective;
|
|
6
7
|
private readonly generatedId;
|
|
8
|
+
private readonly _config;
|
|
7
9
|
label: _angular_core.InputSignal<string | undefined>;
|
|
8
10
|
controlId: _angular_core.InputSignal<string | undefined>;
|
|
9
11
|
controlName: _angular_core.InputSignal<string>;
|
|
@@ -38,4 +40,19 @@ declare class EgFormTextarea {
|
|
|
38
40
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormTextarea, "eg-form-textarea", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "minlength": { "alias": "minlength"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "cols": { "alias": "cols"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "textareaClass": { "alias": "textareaClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
interface EgFormTextareaConfig {
|
|
44
|
+
/**
|
|
45
|
+
* Global class defaults for `eg-form-textarea` styling slots.
|
|
46
|
+
* Each is merged under the matching per-instance `*Class` input
|
|
47
|
+
* (library base < global config < per-instance).
|
|
48
|
+
*/
|
|
49
|
+
labelClass?: string;
|
|
50
|
+
textareaClass?: string;
|
|
51
|
+
errorClass?: string;
|
|
52
|
+
hintClass?: string;
|
|
53
|
+
}
|
|
54
|
+
declare function provideEgFormTextareaConfig(config: Partial<EgFormTextareaConfig>): ValueProvider;
|
|
55
|
+
declare function injectEgFormTextareaConfig(): EgFormTextareaConfig;
|
|
56
|
+
|
|
57
|
+
export { EgFormTextarea, injectEgFormTextareaConfig, provideEgFormTextareaConfig };
|
|
58
|
+
export type { EgFormTextareaConfig };
|