@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,229 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, computed, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
|
|
5
|
+
import { HlmFormIdGenerator, HlmFormField, HlmError, HlmHint } from '@egose/shadcn-theme-ng-tw/form-field';
|
|
6
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng-tw/label';
|
|
7
|
+
import { injectHlmMonthYearPickerConfig, HlmMonthYearPicker, HlmMonthYearInput } from '@egose/shadcn-theme-ng-tw/date-picker';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
|
+
|
|
10
|
+
class EgFormMonthYearPicker {
|
|
11
|
+
formGroupDirective = inject(FormGroupDirective);
|
|
12
|
+
generatedId = inject(HlmFormIdGenerator).generate('eg-form-month-year-picker');
|
|
13
|
+
_config = injectHlmMonthYearPickerConfig();
|
|
14
|
+
label = input(undefined, /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
16
|
+
controlId = input(undefined, /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
18
|
+
controlName = input('', /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "controlName" }] : /* istanbul ignore next */ []));
|
|
20
|
+
error = input(undefined, /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
22
|
+
hint = input(undefined, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
24
|
+
id = input(undefined, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
26
|
+
name = input(undefined, /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
28
|
+
placeholder = input('MM/YYYY', /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
30
|
+
readonly = input(false, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
32
|
+
disabled = input(false, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
34
|
+
required = input(false, /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
36
|
+
min = input(null, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
38
|
+
max = input(null, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
40
|
+
// Picker behavior (defaults fall back to the injected HlmMonthYearPickerConfig)
|
|
41
|
+
autoCloseOnSelect = input(this._config.autoCloseOnSelect, /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "autoCloseOnSelect" }] : /* istanbul ignore next */ []));
|
|
43
|
+
formatDate = input(this._config.formatDate, /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "formatDate" }] : /* istanbul ignore next */ []));
|
|
45
|
+
transformDate = input(this._config.transformDate, /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "transformDate" }] : /* istanbul ignore next */ []));
|
|
47
|
+
parseDate = input(this._config.parseDate, /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "parseDate" }] : /* istanbul ignore next */ []));
|
|
49
|
+
formatInputDate = input(this._config.formatInputDate, /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "formatInputDate" }] : /* istanbul ignore next */ []));
|
|
51
|
+
effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
|
|
53
|
+
errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
55
|
+
hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
57
|
+
/**
|
|
58
|
+
* Bounds projected onto the picker's `Date` model. The cast keeps the
|
|
59
|
+
* template's generic inference on `Date` while passing runtime values
|
|
60
|
+
* through untouched.
|
|
61
|
+
*/
|
|
62
|
+
$min = computed(() => this.min(), /* @ts-ignore */
|
|
63
|
+
...(ngDevMode ? [{ debugName: "$min" }] : /* istanbul ignore next */ []));
|
|
64
|
+
$max = computed(() => this.max(), /* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [{ debugName: "$max" }] : /* istanbul ignore next */ []));
|
|
66
|
+
describedBy() {
|
|
67
|
+
const control = this.formGroupDirective.form.get(this.controlName());
|
|
68
|
+
return this.error() && control?.invalid && (control.dirty || control.touched)
|
|
69
|
+
? this.errorId()
|
|
70
|
+
: this.hint()
|
|
71
|
+
? this.hintId()
|
|
72
|
+
: null;
|
|
73
|
+
}
|
|
74
|
+
// Styling
|
|
75
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
76
|
+
labelClass = input('', /* @ts-ignore */
|
|
77
|
+
...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
|
|
78
|
+
pickerClass = input('', /* @ts-ignore */
|
|
79
|
+
...(ngDevMode ? [{ debugName: "pickerClass" }] : /* istanbul ignore next */ []));
|
|
80
|
+
inputClass = input('', /* @ts-ignore */
|
|
81
|
+
...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
|
|
82
|
+
errorClass = input('', /* @ts-ignore */
|
|
83
|
+
...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
|
|
84
|
+
hintClass = input('', /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
86
|
+
// Computed classes (library base < global config < per-instance)
|
|
87
|
+
$userClass = computed(() => hlm('tw:w-full', this.userClass()), /* @ts-ignore */
|
|
88
|
+
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
89
|
+
$labelClass = computed(() => hlm('tw:mb-1', this._config.labelClass, this.labelClass()), /* @ts-ignore */
|
|
90
|
+
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
91
|
+
$pickerClass = computed(() => hlm('tw:mb-1', this._config.pickerClass, this.pickerClass()), /* @ts-ignore */
|
|
92
|
+
...(ngDevMode ? [{ debugName: "$pickerClass" }] : /* istanbul ignore next */ []));
|
|
93
|
+
$inputClass = computed(() => hlm(this._config.inputClass, this.inputClass()), /* @ts-ignore */
|
|
94
|
+
...(ngDevMode ? [{ debugName: "$inputClass" }] : /* istanbul ignore next */ []));
|
|
95
|
+
$errorClass = computed(() => hlm('tw:mt-0', this._config.errorClass, this.errorClass()), /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
97
|
+
$hintClass = computed(() => hlm('tw:mt-0', this._config.hintClass, this.hintClass()), /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
99
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormMonthYearPicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
100
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormMonthYearPicker, isStandalone: true, selector: "eg-form-month-year-picker", 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 }, 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 }, formatDate: { classPropertyName: "formatDate", publicName: "formatDate", isSignal: true, isRequired: false, transformFunction: null }, transformDate: { classPropertyName: "transformDate", publicName: "transformDate", isSignal: true, isRequired: false, transformFunction: null }, parseDate: { classPropertyName: "parseDate", publicName: "parseDate", isSignal: true, isRequired: false, transformFunction: null }, formatInputDate: { classPropertyName: "formatInputDate", publicName: "formatInputDate", 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 }, 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: `
|
|
101
|
+
@let lbl = label();
|
|
102
|
+
@let cnm = controlName();
|
|
103
|
+
@let err = error();
|
|
104
|
+
@let hnt = hint();
|
|
105
|
+
@let rqrd = required();
|
|
106
|
+
|
|
107
|
+
<hlm-form-field>
|
|
108
|
+
@if (lbl) {
|
|
109
|
+
<label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
|
|
110
|
+
>{{ lbl }}
|
|
111
|
+
@if (rqrd) {
|
|
112
|
+
<span class="tw:text-red-500">*</span>
|
|
113
|
+
}
|
|
114
|
+
</label>
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
<hlm-month-year-picker
|
|
118
|
+
[min]="$min()"
|
|
119
|
+
[max]="$max()"
|
|
120
|
+
[disabled]="disabled()"
|
|
121
|
+
[autoCloseOnSelect]="autoCloseOnSelect()"
|
|
122
|
+
[formatDate]="formatDate()"
|
|
123
|
+
[transformDate]="transformDate()"
|
|
124
|
+
[formControlName]="cnm"
|
|
125
|
+
[class]="$pickerClass()"
|
|
126
|
+
>
|
|
127
|
+
<hlm-month-year-input
|
|
128
|
+
[inputId]="effectiveId()"
|
|
129
|
+
[name]="cnm || name()"
|
|
130
|
+
[readonly]="readonly()"
|
|
131
|
+
[ariaLabel]="lbl"
|
|
132
|
+
[ariaDescribedby]="describedBy()"
|
|
133
|
+
[placeholder]="placeholder()"
|
|
134
|
+
[parseDate]="parseDate()"
|
|
135
|
+
[formatInputDate]="formatInputDate()"
|
|
136
|
+
[inputClass]="$inputClass()"
|
|
137
|
+
/>
|
|
138
|
+
</hlm-month-year-picker>
|
|
139
|
+
|
|
140
|
+
@if (err) {
|
|
141
|
+
<hlm-error [id]="errorId()" [class]="$errorClass()">
|
|
142
|
+
{{ err }}
|
|
143
|
+
</hlm-error>
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@if (hnt) {
|
|
147
|
+
<hlm-hint [id]="hintId()" [class]="$hintClass()">
|
|
148
|
+
{{ hnt }}
|
|
149
|
+
</hlm-hint>
|
|
150
|
+
}
|
|
151
|
+
</hlm-form-field>
|
|
152
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: HlmFormField, selector: "hlm-form-field", inputs: ["class"] }, { kind: "directive", type: HlmError, selector: "hlm-error", inputs: ["class"] }, { kind: "directive", type: HlmHint, selector: "hlm-hint", inputs: ["class"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { kind: "component", type: HlmMonthYearPicker, selector: "hlm-month-year-picker", inputs: ["min", "max", "disabled", "date", "defaultFocusedDate", "autoCloseOnSelect", "formatDate", "transformDate"], outputs: ["dateChange"] }, { kind: "component", type: HlmMonthYearInput, selector: "hlm-month-year-input", inputs: ["name", "readonly", "ariaLabel", "ariaDescribedby", "class", "inputClass", "parseDate", "formatInputDate"] }] });
|
|
153
|
+
}
|
|
154
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormMonthYearPicker, decorators: [{
|
|
155
|
+
type: Component,
|
|
156
|
+
args: [{
|
|
157
|
+
selector: 'eg-form-month-year-picker',
|
|
158
|
+
standalone: true,
|
|
159
|
+
host: {
|
|
160
|
+
'[class]': '$userClass()',
|
|
161
|
+
},
|
|
162
|
+
imports: [ReactiveFormsModule, HlmFormField, HlmError, HlmHint, HlmLabel, HlmMonthYearPicker, HlmMonthYearInput],
|
|
163
|
+
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
164
|
+
template: `
|
|
165
|
+
@let lbl = label();
|
|
166
|
+
@let cnm = controlName();
|
|
167
|
+
@let err = error();
|
|
168
|
+
@let hnt = hint();
|
|
169
|
+
@let rqrd = required();
|
|
170
|
+
|
|
171
|
+
<hlm-form-field>
|
|
172
|
+
@if (lbl) {
|
|
173
|
+
<label hlmLabel [for]="effectiveId()" [class]="$labelClass()"
|
|
174
|
+
>{{ lbl }}
|
|
175
|
+
@if (rqrd) {
|
|
176
|
+
<span class="tw:text-red-500">*</span>
|
|
177
|
+
}
|
|
178
|
+
</label>
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
<hlm-month-year-picker
|
|
182
|
+
[min]="$min()"
|
|
183
|
+
[max]="$max()"
|
|
184
|
+
[disabled]="disabled()"
|
|
185
|
+
[autoCloseOnSelect]="autoCloseOnSelect()"
|
|
186
|
+
[formatDate]="formatDate()"
|
|
187
|
+
[transformDate]="transformDate()"
|
|
188
|
+
[formControlName]="cnm"
|
|
189
|
+
[class]="$pickerClass()"
|
|
190
|
+
>
|
|
191
|
+
<hlm-month-year-input
|
|
192
|
+
[inputId]="effectiveId()"
|
|
193
|
+
[name]="cnm || name()"
|
|
194
|
+
[readonly]="readonly()"
|
|
195
|
+
[ariaLabel]="lbl"
|
|
196
|
+
[ariaDescribedby]="describedBy()"
|
|
197
|
+
[placeholder]="placeholder()"
|
|
198
|
+
[parseDate]="parseDate()"
|
|
199
|
+
[formatInputDate]="formatInputDate()"
|
|
200
|
+
[inputClass]="$inputClass()"
|
|
201
|
+
/>
|
|
202
|
+
</hlm-month-year-picker>
|
|
203
|
+
|
|
204
|
+
@if (err) {
|
|
205
|
+
<hlm-error [id]="errorId()" [class]="$errorClass()">
|
|
206
|
+
{{ err }}
|
|
207
|
+
</hlm-error>
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@if (hnt) {
|
|
211
|
+
<hlm-hint [id]="hintId()" [class]="$hintClass()">
|
|
212
|
+
{{ hnt }}
|
|
213
|
+
</hlm-hint>
|
|
214
|
+
}
|
|
215
|
+
</hlm-form-field>
|
|
216
|
+
`,
|
|
217
|
+
}]
|
|
218
|
+
}], 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 }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], autoCloseOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCloseOnSelect", required: false }] }], formatDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatDate", required: false }] }], transformDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "transformDate", required: false }] }], parseDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "parseDate", required: false }] }], formatInputDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatInputDate", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], pickerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "pickerClass", required: false }] }], inputClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
|
|
219
|
+
|
|
220
|
+
/*
|
|
221
|
+
* Public API Surface of form-month-year-picker
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Generated bundle index. Do not edit.
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
export { EgFormMonthYearPicker };
|
|
229
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "form-month-year-picker",
|
|
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-month-year-picker.mjs",
|
|
13
|
+
"typings": "types/form-month-year-picker.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/form-month-year-picker.d.ts",
|
|
20
|
+
"default": "./fesm2022/form-month-year-picker.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "module"
|
|
24
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ClassValue } from 'clsx';
|
|
3
|
+
|
|
4
|
+
declare class EgFormMonthYearPicker {
|
|
5
|
+
private readonly formGroupDirective;
|
|
6
|
+
private readonly generatedId;
|
|
7
|
+
private readonly _config;
|
|
8
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
9
|
+
controlId: _angular_core.InputSignal<string | undefined>;
|
|
10
|
+
controlName: _angular_core.InputSignal<string>;
|
|
11
|
+
error: _angular_core.InputSignal<string | undefined>;
|
|
12
|
+
hint: _angular_core.InputSignal<string | undefined>;
|
|
13
|
+
id: _angular_core.InputSignal<string | undefined>;
|
|
14
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
15
|
+
placeholder: _angular_core.InputSignal<string>;
|
|
16
|
+
readonly: _angular_core.InputSignal<boolean>;
|
|
17
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
18
|
+
required: _angular_core.InputSignal<boolean>;
|
|
19
|
+
min: _angular_core.InputSignal<string | Date | null>;
|
|
20
|
+
max: _angular_core.InputSignal<string | Date | null>;
|
|
21
|
+
autoCloseOnSelect: _angular_core.InputSignal<boolean>;
|
|
22
|
+
formatDate: _angular_core.InputSignal<(date: Date) => string>;
|
|
23
|
+
transformDate: _angular_core.InputSignal<(date: Date) => Date>;
|
|
24
|
+
parseDate: _angular_core.InputSignal<(value: string) => Date | null>;
|
|
25
|
+
formatInputDate: _angular_core.InputSignal<(date: Date) => string>;
|
|
26
|
+
readonly effectiveId: _angular_core.Signal<string>;
|
|
27
|
+
readonly errorId: _angular_core.Signal<string>;
|
|
28
|
+
readonly hintId: _angular_core.Signal<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Bounds projected onto the picker's `Date` model. The cast keeps the
|
|
31
|
+
* template's generic inference on `Date` while passing runtime values
|
|
32
|
+
* through untouched.
|
|
33
|
+
*/
|
|
34
|
+
protected readonly $min: _angular_core.Signal<Date | undefined>;
|
|
35
|
+
protected readonly $max: _angular_core.Signal<Date | undefined>;
|
|
36
|
+
describedBy(): string | null;
|
|
37
|
+
userClass: _angular_core.InputSignal<ClassValue>;
|
|
38
|
+
labelClass: _angular_core.InputSignal<string>;
|
|
39
|
+
pickerClass: _angular_core.InputSignal<string>;
|
|
40
|
+
inputClass: _angular_core.InputSignal<string>;
|
|
41
|
+
errorClass: _angular_core.InputSignal<string>;
|
|
42
|
+
hintClass: _angular_core.InputSignal<string>;
|
|
43
|
+
$userClass: _angular_core.Signal<string>;
|
|
44
|
+
$labelClass: _angular_core.Signal<string>;
|
|
45
|
+
$pickerClass: _angular_core.Signal<string>;
|
|
46
|
+
$inputClass: _angular_core.Signal<string>;
|
|
47
|
+
$errorClass: _angular_core.Signal<string>;
|
|
48
|
+
$hintClass: _angular_core.Signal<string>;
|
|
49
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormMonthYearPicker, never>;
|
|
50
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormMonthYearPicker, "eg-form-month-year-picker", 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; }; "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; }; "formatDate": { "alias": "formatDate"; "required": false; "isSignal": true; }; "transformDate": { "alias": "transformDate"; "required": false; "isSignal": true; }; "parseDate": { "alias": "parseDate"; "required": false; "isSignal": true; }; "formatInputDate": { "alias": "formatInputDate"; "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; }; "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>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { EgFormMonthYearPicker };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Form Native Select (`@egose/shadcn-theme-ng/form-native-select`)
|
|
2
|
+
|
|
3
|
+
A ready-made reactive-form select field using the platform `<select>`: label + `hlm-native-select` + validation error/hint display in one tag. Prefer `eg-form-select` for the popover experience; use this where a native control is required (mobile, no-JS fallbacks, minimal bundles).
|
|
4
|
+
|
|
5
|
+
The Angular implementation is a standalone wrapper: it renders `HlmFormField` / `HlmError` / `HlmHint` from `@egose/shadcn-theme-ng/form-field`, `HlmLabel`, and `HlmNativeSelect` from `@egose/shadcn-theme-ng/native-select`. The inner select is bound with `[formControlName]="controlName()"`, so the parent `FormGroup` owns the `string` value. It must live inside a `FormGroupDirective` (`[formGroup]` parent); ids come from `HlmFormIdGenerator` unless overridden.
|
|
6
|
+
|
|
7
|
+
> **Ships as:** `@egose/shadcn-theme-ng/form-native-select` and `@egose/shadcn-theme-ng-tw/form-native-select`
|
|
8
|
+
> (the `tw:`-prefixed Tailwind variant). Both expose the identical TypeScript surface; only the
|
|
9
|
+
> emitted Tailwind class strings differ. See the [package README](../../README.md) for install
|
|
10
|
+
> steps, peer dependencies, and Tailwind setup. Do not publish this project directory independently.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Plain Tailwind (no prefix)
|
|
16
|
+
npm install @egose/shadcn-theme-ng
|
|
17
|
+
|
|
18
|
+
# tw:-prefixed Tailwind variant
|
|
19
|
+
npm install @egose/shadcn-theme-ng-tw
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Peer dependencies (Angular, `@spartan-ng/brain`, `@ng-icons/*`, `rxjs`, …) are documented in the
|
|
23
|
+
[package README](../../README.md#peer-dependencies). This subpath additionally relies at runtime on
|
|
24
|
+
`@egose/shadcn-theme-ng/native-select`, `@egose/shadcn-theme-ng/form-field`, and
|
|
25
|
+
`@egose/shadcn-theme-ng/label`.
|
|
26
|
+
|
|
27
|
+
## Imports
|
|
28
|
+
|
|
29
|
+
Exported from the subpath root (`projects/form-native-select/src/public-api.ts`):
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { EgFormNativeSelect, provideEgFormNativeSelectConfig } from '@egose/shadcn-theme-ng/form-native-select';
|
|
33
|
+
// tw variant: replace with '@egose/shadcn-theme-ng-tw/form-native-select'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Standalone usage:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { Component } from '@angular/core';
|
|
40
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
41
|
+
import { EgFormNativeSelect } from '@egose/shadcn-theme-ng/form-native-select';
|
|
42
|
+
|
|
43
|
+
@Component({
|
|
44
|
+
selector: 'app-demo',
|
|
45
|
+
standalone: true,
|
|
46
|
+
imports: [ReactiveFormsModule, EgFormNativeSelect],
|
|
47
|
+
template: `...`,
|
|
48
|
+
})
|
|
49
|
+
export class DemoComponent {}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
NgModule-based consumer: add `EgFormNativeSelect` (and `ReactiveFormsModule`) to the module's
|
|
53
|
+
`imports` — it is a standalone component, not a module.
|
|
54
|
+
|
|
55
|
+
`ControlValueAccessor` behavior: `eg-form-native-select` itself is not a `ControlValueAccessor`; the
|
|
56
|
+
inner `hlm-native-select` is (bound via `formControlName`), so `formControlName`/`formGroup` handling,
|
|
57
|
+
`Validators`, and `disabled` state from the control all flow through the parent form.
|
|
58
|
+
|
|
59
|
+
## Anatomy / Structure
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<form [formGroup]="form">
|
|
63
|
+
<eg-form-native-select
|
|
64
|
+
controlName="country"
|
|
65
|
+
label="Country"
|
|
66
|
+
[options]="countries"
|
|
67
|
+
[required]="true"
|
|
68
|
+
error="Country is required."
|
|
69
|
+
/>
|
|
70
|
+
</form>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Selector (from source): `eg-form-native-select` (standalone component, host `tw:w-full`).
|
|
74
|
+
|
|
75
|
+
## API reference
|
|
76
|
+
|
|
77
|
+
### `EgFormNativeSelect` — `eg-form-native-select`
|
|
78
|
+
|
|
79
|
+
| Input | Type | Default | Description |
|
|
80
|
+
| ------------- | ------------------------------- | ------- | ---------------------------------------------------------------------- |
|
|
81
|
+
| `controlName` | `string` | `''` | `formControlName` key inside the parent `FormGroup`. **Required.** |
|
|
82
|
+
| `label` | `string \| undefined` | — | Label text (hidden when omitted). |
|
|
83
|
+
| `error` | `string \| undefined` | — | Error text shown when invalid. |
|
|
84
|
+
| `hint` | `string \| undefined` | — | Hint text shown otherwise. |
|
|
85
|
+
| `controlId` | `string \| undefined` | — | Explicit id (first priority for `effectiveId`). |
|
|
86
|
+
| `id` | `string \| undefined` | — | Fallback id (second priority). |
|
|
87
|
+
| `name` | `string \| undefined` | — | Native `name` forwarded to the inner `<select>` (`controlName` wins). |
|
|
88
|
+
| `disabled` | `boolean` | `false` | Locks interaction (form control stays enabled). |
|
|
89
|
+
| `required` | `boolean` | `false` | Shows a red `*` next to the label. |
|
|
90
|
+
| `options` | `{ value, label, disabled? }[]` | `[]` | Rendered as native `<option>` elements. |
|
|
91
|
+
| `class` | `ClassValue` | `''` | Extra host classes (base `tw:w-full`). |
|
|
92
|
+
| `labelClass` | `string` | `''` | Extra label classes (base `tw:mb-1 tw:gap-0`). |
|
|
93
|
+
| `selectClass` | `string` | `''` | Extra inner-select classes, merged into `HlmNativeSelect.selectClass`. |
|
|
94
|
+
| `errorClass` | `string` | `''` | Extra error classes (base `tw:mt-0`). |
|
|
95
|
+
| `hintClass` | `string` | `''` | Extra hint classes (base `tw:mt-0`). |
|
|
96
|
+
|
|
97
|
+
| Member | Description |
|
|
98
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
99
|
+
| `effectiveId` | `controlId() \|\| id() \|\| generated` — wired to select `selectId` and label `for`. |
|
|
100
|
+
| `errorId` / `hintId` | `effectiveId + '-error' / '-hint'`. |
|
|
101
|
+
| `describedBy()` | `errorId` when `error()` is set and control is invalid + dirty/touched, else `hintId` when `hint()` is set, else `null` — wired to select `ariaDescribedby`. |
|
|
102
|
+
|
|
103
|
+
Requires a `[formGroup]` ancestor (injects `FormGroupDirective`, provides `ControlContainer → FormGroupDirective`).
|
|
104
|
+
|
|
105
|
+
## Examples
|
|
106
|
+
|
|
107
|
+
### 1. Basic required select
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { Component, inject } from '@angular/core';
|
|
111
|
+
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
112
|
+
import { EgFormNativeSelect } from '@egose/shadcn-theme-ng/form-native-select';
|
|
113
|
+
|
|
114
|
+
@Component({
|
|
115
|
+
selector: 'app-country',
|
|
116
|
+
standalone: true,
|
|
117
|
+
imports: [ReactiveFormsModule, EgFormNativeSelect],
|
|
118
|
+
template: `
|
|
119
|
+
<form [formGroup]="form" (ngSubmit)="submit()">
|
|
120
|
+
<eg-form-native-select
|
|
121
|
+
controlName="country"
|
|
122
|
+
label="Country"
|
|
123
|
+
[options]="countries"
|
|
124
|
+
[required]="true"
|
|
125
|
+
error="Country is required."
|
|
126
|
+
/>
|
|
127
|
+
<button type="submit" [disabled]="form.invalid">Continue</button>
|
|
128
|
+
</form>
|
|
129
|
+
`,
|
|
130
|
+
})
|
|
131
|
+
export class CountryComponent {
|
|
132
|
+
private readonly fb = inject(FormBuilder);
|
|
133
|
+
readonly form = this.fb.group({ country: ['', Validators.required] });
|
|
134
|
+
readonly countries = [
|
|
135
|
+
{ value: '', label: 'Select…' },
|
|
136
|
+
{ value: 'de', label: 'Germany' },
|
|
137
|
+
{ value: 'fr', label: 'France' },
|
|
138
|
+
];
|
|
139
|
+
submit() {
|
|
140
|
+
console.log(this.form.value.country);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 2. Hint + custom styling
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
import { Component, inject } from '@angular/core';
|
|
149
|
+
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
|
150
|
+
import { EgFormNativeSelect } from '@egose/shadcn-theme-ng/form-native-select';
|
|
151
|
+
|
|
152
|
+
@Component({
|
|
153
|
+
selector: 'app-locale',
|
|
154
|
+
standalone: true,
|
|
155
|
+
imports: [ReactiveFormsModule, EgFormNativeSelect],
|
|
156
|
+
template: `
|
|
157
|
+
<form [formGroup]="form">
|
|
158
|
+
<eg-form-native-select
|
|
159
|
+
controlName="locale"
|
|
160
|
+
label="Language"
|
|
161
|
+
[options]="locales"
|
|
162
|
+
selectClass="tw:text-lg"
|
|
163
|
+
hint="Used for emails and invoices."
|
|
164
|
+
/>
|
|
165
|
+
</form>
|
|
166
|
+
`,
|
|
167
|
+
})
|
|
168
|
+
export class LocaleComponent {
|
|
169
|
+
private readonly fb = inject(FormBuilder);
|
|
170
|
+
readonly form = this.fb.group({ locale: ['en'] });
|
|
171
|
+
readonly locales = [
|
|
172
|
+
{ value: 'en', label: 'English' },
|
|
173
|
+
{ value: 'de', label: 'Deutsch' },
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Accessibility notes
|
|
179
|
+
|
|
180
|
+
- Label `for` ↔ select `selectId` wiring is automatic via `effectiveId`; the select also receives `name` and `ariaDescribedby` (error/hint id) — always pass a `label`.
|
|
181
|
+
- The required `*` is visual; pair with `Validators.required` so assistive tech and validation agree.
|
|
182
|
+
- Native `<select>` brings platform keyboard/screen-reader behavior for free.
|
|
183
|
+
|
|
184
|
+
## Theming / CSS variables
|
|
185
|
+
|
|
186
|
+
No component-specific CSS variables. Style per-instance via `class` / `labelClass` / `selectClass` / `errorClass` / `hintClass` (precedence: library base < global config < per-instance).
|
|
187
|
+
|
|
188
|
+
Global defaults per styling slot via the wrapper config:
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
import { provideEgFormNativeSelectConfig } from '@egose/shadcn-theme-ng/form-native-select';
|
|
192
|
+
|
|
193
|
+
await bootstrapApplication(App, {
|
|
194
|
+
providers: [provideEgFormNativeSelectConfig({ selectClass: 'tw:text-sm', labelClass: 'tw:font-medium' })],
|
|
195
|
+
});
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The host keeps `tw:w-full`; constrain width with `class` (e.g. `tw:max-w-xs`) or a wrapping container.
|
|
199
|
+
|
|
200
|
+
## Related subpaths
|
|
201
|
+
|
|
202
|
+
- `@egose/shadcn-theme-ng/native-select` — raw `hlm-native-select` for custom layouts.
|
|
203
|
+
- `@egose/shadcn-theme-ng/form-select` — the popover-based counterpart (`eg-form-select`).
|
|
204
|
+
- `@egose/shadcn-theme-ng/form-field` — `hlm-form-field` / `hlm-error` / `hlm-hint` used internally.
|
|
205
|
+
- `@egose/shadcn-theme-ng/form-field-simple` — alternative minimal wrapper when you compose controls by hand.
|