@egose/shadcn-theme-ng-tw 0.1.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 +2 -2
- package/accordion/README.md +405 -2
- package/alert/README.md +372 -2
- package/alert/fesm2022/alert.mjs +1 -1
- package/alert-dialog/README.md +471 -5
- package/aspect-ratio/README.md +272 -5
- package/autocomplete/README.md +502 -2
- package/autocomplete/fesm2022/autocomplete.mjs +1 -1
- package/avatar/README.md +357 -5
- package/badge/README.md +318 -2
- package/basic-alert/README.md +353 -2
- package/breadcrumb/README.md +406 -5
- package/button/README.md +482 -2
- package/button/fesm2022/button.mjs +85 -107
- package/button/types/button.d.ts +5 -8
- package/button-group/README.md +318 -5
- package/button-group/fesm2022/button-group.mjs +1 -1
- package/calendar/README.md +357 -2
- package/card/README.md +331 -5
- package/carousel/README.md +333 -5
- package/carousel/fesm2022/carousel.mjs +4 -1
- package/checkbox/README.md +320 -2
- package/checkbox/fesm2022/checkbox.mjs +6 -7
- package/checkbox/types/checkbox.d.ts +1 -1
- package/collapsible/README.md +332 -5
- package/combobox/README.md +507 -5
- package/combobox/fesm2022/combobox.mjs +5 -2
- package/command/README.md +435 -5
- package/confirmation-dialog/README.md +301 -2
- package/context-menu/README.md +366 -5
- package/date-picker/README.md +469 -2
- package/date-picker/fesm2022/date-picker.mjs +150 -32
- package/date-picker/types/date-picker.d.ts +102 -9
- package/dialog/README.md +448 -2
- package/drawer/README.md +395 -5
- package/dropdown-menu/README.md +417 -5
- package/empty/README.md +329 -5
- package/field/README.md +385 -5
- 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 +322 -2
- 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 +348 -2
- 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-field/README.md +356 -2
- package/form-field-simple/README.md +340 -2
- 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 +371 -2
- 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 +360 -2
- 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 +381 -2
- 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 +357 -2
- 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/hover-card/README.md +256 -5
- package/icon/README.md +239 -2
- package/input/README.md +269 -2
- package/input-group/README.md +335 -5
- package/input-group/fesm2022/input-group.mjs +23 -13
- package/input-group/types/input-group.d.ts +4 -1
- package/input-otp/README.md +375 -5
- package/item/README.md +385 -5
- package/item/fesm2022/item.mjs +3 -3
- package/kbd/README.md +291 -5
- package/label/README.md +272 -2
- package/layout-simple/README.md +193 -2
- package/layout-simple/fesm2022/layout-simple.mjs +877 -409
- package/layout-simple/types/layout-simple.d.ts +174 -137
- package/menu/README.md +417 -2
- package/menubar/README.md +343 -5
- package/native-select/README.md +323 -5
- package/native-select/fesm2022/native-select.mjs +18 -6
- package/native-select/types/native-select.d.ts +7 -2
- package/navigation-menu/README.md +369 -5
- package/package.json +57 -1
- package/pagination/README.md +388 -5
- 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/popover/README.md +331 -2
- package/progress/README.md +311 -5
- package/radio-group/README.md +364 -2
- package/radio-group/fesm2022/radio-group.mjs +5 -1
- package/resizable/README.md +269 -5
- package/scroll-area/README.md +233 -5
- package/searchable-multiselect/README.md +323 -2
- package/select/README.md +437 -2
- package/separator/README.md +222 -2
- package/sheet/README.md +311 -2
- package/sheet/fesm2022/sheet.mjs +1 -1
- package/sidebar/README.md +457 -5
- package/skeleton/README.md +217 -5
- package/slider/README.md +273 -5
- package/slider/fesm2022/slider.mjs +17 -13
- package/sonner/README.md +346 -2
- package/spinner/README.md +284 -2
- package/switch/README.md +310 -2
- package/switch/fesm2022/switch.mjs +7 -5
- package/switch/types/switch.d.ts +2 -1
- package/table/README.md +423 -5
- package/tabs/README.md +411 -2
- package/tabs/fesm2022/tabs.mjs +12 -2
- package/textarea/README.md +282 -5
- package/toggle/README.md +270 -5
- package/toggle-group/README.md +340 -5
- package/tooltip/README.md +269 -2
- package/typography/README.md +271 -5
- package/utils/README.md +303 -2
package/form-select/README.md
CHANGED
|
@@ -1,3 +1,361 @@
|
|
|
1
|
-
# Form Select
|
|
1
|
+
# Form Select (`@egose/shadcn-theme-ng/form-select`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`EgFormSelect` is a reactive-forms wrapper around the shadcn/ui _Select_ composition (spartan-ng `BrnSelect` + `HlmSelect` parts). It renders a label, a single- or multi-select dropdown bound with `formControlName`, and error/hint text — the Angular equivalent of shadcn/ui's `<FormField> + <Select>` pattern for picking one option (or many) from a list.
|
|
4
|
+
|
|
5
|
+
> **Ships as:** `@egose/shadcn-theme-ng/form-select` (plain Tailwind) and `@egose/shadcn-theme-ng-tw/form-select` (`tw:`-prefixed variant). See the [package README](../../README.md) for installation, peer dependencies, and the Tailwind-variant contract. Do not publish this project directory independently.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Plain Tailwind (no prefix)
|
|
11
|
+
npm install @egose/shadcn-theme-ng
|
|
12
|
+
|
|
13
|
+
# Or the tw:-prefixed variant
|
|
14
|
+
npm install @egose/shadcn-theme-ng-tw
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Peer dependencies (Angular, CDK, `@spartan-ng/brain`, `rxjs`) are documented in the [package README](../../README.md#peer-dependencies). This subpath additionally pulls in `@egose/shadcn-theme-ng/select` at build time (already re-exported through the select subpath — no extra install needed).
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { EgFormSelect } from '@egose/shadcn-theme-ng/form-select';
|
|
21
|
+
// tw variant:
|
|
22
|
+
// import { EgFormSelect } from '@egose/shadcn-theme-ng-tw/form-select';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Imports
|
|
26
|
+
|
|
27
|
+
The public API (`src/public-api.ts`) exports exactly one symbol — the standalone component. There is no `*Imports` array and no `*Module` for this subpath; import the component class directly.
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { EgFormSelect } from '@egose/shadcn-theme-ng/form-select';
|
|
31
|
+
|
|
32
|
+
@Component({
|
|
33
|
+
standalone: true,
|
|
34
|
+
imports: [ReactiveFormsModule, EgFormSelect],
|
|
35
|
+
template: `
|
|
36
|
+
<form [formGroup]="form">
|
|
37
|
+
<eg-form-select controlName="country" label="Country" [options]="countries" placeholder="Select…" />
|
|
38
|
+
</form>
|
|
39
|
+
`,
|
|
40
|
+
})
|
|
41
|
+
export class MyForm {}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Requirements:
|
|
45
|
+
|
|
46
|
+
- Must sit inside a `<form [formGroup]>` (it injects `FormGroupDirective` and provides `ControlContainer`).
|
|
47
|
+
- `controlName` is required — forwarded as `[formControlName]` to the inner `brn-select` / `brn-select-multiple`.
|
|
48
|
+
- Single mode binds `string`; multi mode (`multiple`) binds `string[]`.
|
|
49
|
+
|
|
50
|
+
## Anatomy / Structure
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<eg-form-select controlName="country" label="Country" [options]="countries">
|
|
54
|
+
<!-- rendered internally (single mode) -->
|
|
55
|
+
<hlm-form-field>
|
|
56
|
+
<label hlmLabel for="<effectiveId>">Country <span>*</span></label>
|
|
57
|
+
<brn-select hlmSelect formControlName="country">
|
|
58
|
+
<hlm-select-trigger buttonId="<effectiveId>" ariaDescribedby="…">
|
|
59
|
+
<hlm-select-value placeholder="Select…" />
|
|
60
|
+
</hlm-select-trigger>
|
|
61
|
+
<hlm-select-content>
|
|
62
|
+
<hlm-select-label>Fruits</hlm-select-label>
|
|
63
|
+
<hlm-select-item value="apple">Apple</hlm-select-item>
|
|
64
|
+
</hlm-select-content>
|
|
65
|
+
</brn-select>
|
|
66
|
+
<hlm-error id="<effectiveId>-error">…</hlm-error>
|
|
67
|
+
<hlm-hint id="<effectiveId>-hint">…</hlm-hint>
|
|
68
|
+
</hlm-form-field>
|
|
69
|
+
</eg-form-select>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
In multi mode the inner `brn-select` becomes `brn-select-multiple`; everything else is identical. Real selectors: `eg-form-select`, `hlm-form-field`, `label[hlmLabel]`, `brn-select[hlmSelect]` / `brn-select-multiple[hlmSelect]`, `hlm-select-trigger`, `hlm-select-value`, `hlm-select-content`, `hlm-select-label`, `hlm-select-item`, `hlm-error`, `hlm-hint`.
|
|
73
|
+
|
|
74
|
+
## API reference
|
|
75
|
+
|
|
76
|
+
### `eg-form-select` — `EgFormSelect`
|
|
77
|
+
|
|
78
|
+
| Input | Type | Default | Description |
|
|
79
|
+
| --------------------- | --------------------- | ----------- | --------------------------------------------------------------------------------------------------------- |
|
|
80
|
+
| `label` | `string \| undefined` | `undefined` | Field label rendered as `<label hlmLabel>` bound to the trigger button id. |
|
|
81
|
+
| `controlName` | `string` | `''` | **Required.** Control name in the parent `FormGroup`; forwarded as `formControlName`. |
|
|
82
|
+
| `controlId` | `string \| undefined` | `undefined` | Explicit id; falls back to `id`, then generated `eg-form-select-…`. |
|
|
83
|
+
| `id` | `string \| undefined` | `undefined` | Alias for an explicit id (same fallback chain). Forwarded as `buttonId` to the select trigger. |
|
|
84
|
+
| `error` | `string \| undefined` | `undefined` | Error text rendered in `<hlm-error>`. |
|
|
85
|
+
| `hint` | `string \| undefined` | `undefined` | Hint text rendered in `<hlm-hint>`. |
|
|
86
|
+
| `placeholder` | `string` | `''` | Placeholder forwarded to `<hlm-select-value>`. |
|
|
87
|
+
| `disabled` | `boolean` | `false` | Forwarded as `wrapperDisabled` to `<hlm-select-trigger>`. |
|
|
88
|
+
| `required` | `boolean` | `false` | Renders a red `*` next to the label (pair with `Validators.required`). |
|
|
89
|
+
| `multiple` | `boolean` | `false` | When `true`, renders `brn-select-multiple` (value is `string[]`). |
|
|
90
|
+
| `options` | `SelectOption[]` | `[]` | `{ value: string; label: string }[]` rendered as `<hlm-select-item>` rows. Local interface, not exported. |
|
|
91
|
+
| `optionsLabel` | `string \| undefined` | `undefined` | Optional group heading rendered once as `<hlm-select-label>`. |
|
|
92
|
+
| `class` (`userClass`) | `ClassValue` | `''` | Extra host classes (merged over `tw:flex tw:flex-col`). |
|
|
93
|
+
| `labelClass` | `string` | `''` | Extra label classes (merged over `tw:mb-1 tw:gap-0`). |
|
|
94
|
+
| `selectClass` | `string` | `''` | Extra trigger classes (merged over `tw:w-full`). |
|
|
95
|
+
| `errorClass` | `string` | `''` | Extra error classes (merged over `tw:mt-0`). |
|
|
96
|
+
| `hintClass` | `string` | `''` | Extra hint classes (merged over `tw:mt-0`). |
|
|
97
|
+
|
|
98
|
+
No outputs. Readonly computeds/methods: `effectiveId()`, `errorId()`, `hintId()`, `describedBy(): string | null` (error id when invalid + dirty/touched, else hint id, else `null`).
|
|
99
|
+
|
|
100
|
+
## Examples
|
|
101
|
+
|
|
102
|
+
### 1. Basic single select
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { Component } from '@angular/core';
|
|
106
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
107
|
+
import { EgFormSelect } from '@egose/shadcn-theme-ng/form-select';
|
|
108
|
+
|
|
109
|
+
@Component({
|
|
110
|
+
standalone: true,
|
|
111
|
+
imports: [ReactiveFormsModule, EgFormSelect],
|
|
112
|
+
template: `
|
|
113
|
+
<form [formGroup]="form" (ngSubmit)="save()">
|
|
114
|
+
<eg-form-select controlName="fruit" label="Fruit" placeholder="Select a fruit" [options]="fruits" />
|
|
115
|
+
<button type="submit">Save</button>
|
|
116
|
+
</form>
|
|
117
|
+
`,
|
|
118
|
+
})
|
|
119
|
+
export class BasicExample {
|
|
120
|
+
readonly form = new FormGroup({
|
|
121
|
+
fruit: new FormControl<string>('', { nonNullable: true }),
|
|
122
|
+
});
|
|
123
|
+
readonly fruits = [
|
|
124
|
+
{ value: 'apple', label: 'Apple' },
|
|
125
|
+
{ value: 'banana', label: 'Banana' },
|
|
126
|
+
{ value: 'cherry', label: 'Cherry' },
|
|
127
|
+
];
|
|
128
|
+
|
|
129
|
+
save() {
|
|
130
|
+
console.log(this.form.value.fruit); // e.g. 'banana'
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 2. Grouped options with `optionsLabel`
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { Component } from '@angular/core';
|
|
139
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
140
|
+
import { EgFormSelect } from '@egose/shadcn-theme-ng/form-select';
|
|
141
|
+
|
|
142
|
+
@Component({
|
|
143
|
+
standalone: true,
|
|
144
|
+
imports: [ReactiveFormsModule, EgFormSelect],
|
|
145
|
+
template: `
|
|
146
|
+
<form [formGroup]="form">
|
|
147
|
+
<eg-form-select
|
|
148
|
+
controlName="city"
|
|
149
|
+
label="City"
|
|
150
|
+
placeholder="Select a city"
|
|
151
|
+
optionsLabel="Germany"
|
|
152
|
+
[options]="cities"
|
|
153
|
+
hint="Grouped under one heading"
|
|
154
|
+
/>
|
|
155
|
+
</form>
|
|
156
|
+
`,
|
|
157
|
+
})
|
|
158
|
+
export class GroupedExample {
|
|
159
|
+
readonly form = new FormGroup({
|
|
160
|
+
city: new FormControl<string>('', { nonNullable: true }),
|
|
161
|
+
});
|
|
162
|
+
readonly cities = [
|
|
163
|
+
{ value: 'berlin', label: 'Berlin' },
|
|
164
|
+
{ value: 'munich', label: 'Munich' },
|
|
165
|
+
{ value: 'hamburg', label: 'Hamburg' },
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
> Note: `optionsLabel` renders a single `<hlm-select-label>` heading above all options. For multiple groups, use the raw `HlmSelect*` parts from `@egose/shadcn-theme-ng/select` instead.
|
|
171
|
+
|
|
172
|
+
### 3. Multi-select (`multiple`)
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
import { Component } from '@angular/core';
|
|
176
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
177
|
+
import { EgFormSelect } from '@egose/shadcn-theme-ng/form-select';
|
|
178
|
+
|
|
179
|
+
@Component({
|
|
180
|
+
standalone: true,
|
|
181
|
+
imports: [ReactiveFormsModule, EgFormSelect],
|
|
182
|
+
template: `
|
|
183
|
+
<form [formGroup]="form">
|
|
184
|
+
<eg-form-select
|
|
185
|
+
controlName="toppings"
|
|
186
|
+
label="Toppings"
|
|
187
|
+
placeholder="Pick toppings"
|
|
188
|
+
[multiple]="true"
|
|
189
|
+
[options]="toppings"
|
|
190
|
+
hint="Hold Ctrl/Cmd or tap to toggle several"
|
|
191
|
+
/>
|
|
192
|
+
<p>Selected: {{ form.value.toppings?.join(', ') || 'none' }}</p>
|
|
193
|
+
</form>
|
|
194
|
+
`,
|
|
195
|
+
})
|
|
196
|
+
export class MultiExample {
|
|
197
|
+
readonly form = new FormGroup({
|
|
198
|
+
toppings: new FormControl<string[]>([], { nonNullable: true }),
|
|
199
|
+
});
|
|
200
|
+
readonly toppings = [
|
|
201
|
+
{ value: 'cheese', label: 'Extra cheese' },
|
|
202
|
+
{ value: 'mushrooms', label: 'Mushrooms' },
|
|
203
|
+
{ value: 'olives', label: 'Olives' },
|
|
204
|
+
];
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### 4. Required + validation error
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
import { Component } from '@angular/core';
|
|
212
|
+
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
213
|
+
import { EgFormSelect } from '@egose/shadcn-theme-ng/form-select';
|
|
214
|
+
|
|
215
|
+
@Component({
|
|
216
|
+
standalone: true,
|
|
217
|
+
imports: [ReactiveFormsModule, EgFormSelect],
|
|
218
|
+
template: `
|
|
219
|
+
<form [formGroup]="form" (ngSubmit)="submit()">
|
|
220
|
+
<eg-form-select
|
|
221
|
+
controlName="country"
|
|
222
|
+
label="Country"
|
|
223
|
+
placeholder="Select a country"
|
|
224
|
+
[options]="countries"
|
|
225
|
+
error="Country is required"
|
|
226
|
+
required
|
|
227
|
+
/>
|
|
228
|
+
<button type="submit">Continue</button>
|
|
229
|
+
</form>
|
|
230
|
+
`,
|
|
231
|
+
})
|
|
232
|
+
export class RequiredExample {
|
|
233
|
+
readonly form = new FormGroup({
|
|
234
|
+
country: new FormControl<string>('', { nonNullable: true, validators: Validators.required }),
|
|
235
|
+
});
|
|
236
|
+
readonly countries = [
|
|
237
|
+
{ value: 'de', label: 'Germany' },
|
|
238
|
+
{ value: 'fr', label: 'France' },
|
|
239
|
+
];
|
|
240
|
+
|
|
241
|
+
submit() {
|
|
242
|
+
if (this.form.invalid) {
|
|
243
|
+
this.form.markAllAsTouched(); // reveals the <hlm-error>
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### 5. Disabled + empty-options state
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
import { Component, signal } from '@angular/core';
|
|
254
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
255
|
+
import { EgFormSelect } from '@egose/shadcn-theme-ng/form-select';
|
|
256
|
+
|
|
257
|
+
@Component({
|
|
258
|
+
standalone: true,
|
|
259
|
+
imports: [ReactiveFormsModule, EgFormSelect],
|
|
260
|
+
template: `
|
|
261
|
+
<form [formGroup]="form">
|
|
262
|
+
<eg-form-select
|
|
263
|
+
controlName="plan"
|
|
264
|
+
label="Plan"
|
|
265
|
+
placeholder="Select a plan"
|
|
266
|
+
[options]="plans()"
|
|
267
|
+
[disabled]="loading()"
|
|
268
|
+
hint="Options arrive asynchronously"
|
|
269
|
+
/>
|
|
270
|
+
<button type="button" (click)="load()">Load plans</button>
|
|
271
|
+
</form>
|
|
272
|
+
`,
|
|
273
|
+
})
|
|
274
|
+
export class DisabledExample {
|
|
275
|
+
readonly form = new FormGroup({
|
|
276
|
+
plan: new FormControl<string>('', { nonNullable: true }),
|
|
277
|
+
});
|
|
278
|
+
readonly loading = signal(true);
|
|
279
|
+
readonly plans = signal<{ value: string; label: string }[]>([]);
|
|
280
|
+
|
|
281
|
+
load() {
|
|
282
|
+
setTimeout(() => {
|
|
283
|
+
this.plans.set([
|
|
284
|
+
{ value: 'free', label: 'Free' },
|
|
285
|
+
{ value: 'pro', label: 'Pro' },
|
|
286
|
+
]);
|
|
287
|
+
this.loading.set(false);
|
|
288
|
+
}, 800);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### 6. Programmatic control + custom ids/classes
|
|
294
|
+
|
|
295
|
+
```ts
|
|
296
|
+
import { Component } from '@angular/core';
|
|
297
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
298
|
+
import { EgFormSelect } from '@egose/shadcn-theme-ng/form-select';
|
|
299
|
+
|
|
300
|
+
@Component({
|
|
301
|
+
standalone: true,
|
|
302
|
+
imports: [ReactiveFormsModule, EgFormSelect],
|
|
303
|
+
template: `
|
|
304
|
+
<form [formGroup]="form">
|
|
305
|
+
<eg-form-select
|
|
306
|
+
#roleField
|
|
307
|
+
controlName="role"
|
|
308
|
+
controlId="user-role"
|
|
309
|
+
label="Role"
|
|
310
|
+
placeholder="Select a role"
|
|
311
|
+
[options]="roles"
|
|
312
|
+
class="tw:max-w-sm"
|
|
313
|
+
selectClass="tw:h-11"
|
|
314
|
+
/>
|
|
315
|
+
<div class="tw:flex tw:gap-2">
|
|
316
|
+
<button type="button" (click)="form.controls.role.setValue('admin')">Make admin</button>
|
|
317
|
+
<button type="button" (click)="form.controls.role.reset()">Reset</button>
|
|
318
|
+
</div>
|
|
319
|
+
<p>Trigger id: {{ roleField.effectiveId() }}</p>
|
|
320
|
+
</form>
|
|
321
|
+
`,
|
|
322
|
+
})
|
|
323
|
+
export class ProgrammaticExample {
|
|
324
|
+
readonly form = new FormGroup({
|
|
325
|
+
role: new FormControl<string>('editor', { nonNullable: true }),
|
|
326
|
+
});
|
|
327
|
+
readonly roles = [
|
|
328
|
+
{ value: 'admin', label: 'Admin' },
|
|
329
|
+
{ value: 'editor', label: 'Editor' },
|
|
330
|
+
{ value: 'viewer', label: 'Viewer' },
|
|
331
|
+
];
|
|
332
|
+
}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Accessibility notes
|
|
336
|
+
|
|
337
|
+
- The `<label [for]>` targets the trigger button (`buttonId`), so clicking the label opens the listbox.
|
|
338
|
+
- `aria-describedby` on the trigger points at the error element when invalid + dirty/touched, else the hint element — screen readers announce the right message without extra wiring.
|
|
339
|
+
- The dropdown itself is a spartan-ng listbox (roving `aria-activedescendant`, Escape to close, type-ahead). Keep option `label`s distinct and avoid stuffing status text into them.
|
|
340
|
+
- `required` only decorates the label with `*`; add `Validators.required` so the invalid state (and error announcement) actually triggers.
|
|
341
|
+
|
|
342
|
+
## Theming / CSS variables
|
|
343
|
+
|
|
344
|
+
No component-specific CSS variables; visuals come from the shared theme tokens via the `HlmSelect*` parts. Use `selectClass` / `labelClass` / `errorClass` / `hintClass` / `class` to adjust sizing and spacing.
|
|
345
|
+
|
|
346
|
+
Global defaults per styling slot via the wrapper config (precedence: library base < global config < per-instance):
|
|
347
|
+
|
|
348
|
+
```ts
|
|
349
|
+
import { provideEgFormSelectConfig } from '@egose/shadcn-theme-ng/form-select';
|
|
350
|
+
|
|
351
|
+
await bootstrapApplication(App, {
|
|
352
|
+
providers: [provideEgFormSelectConfig({ selectClass: 'tw:text-sm', labelClass: 'tw:font-medium' })],
|
|
353
|
+
});
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
## Related subpaths
|
|
357
|
+
|
|
358
|
+
- `@egose/shadcn-theme-ng/select` — raw `HlmSelect`, `HlmSelectTrigger`, `HlmSelectValue`, `HlmSelectContent`, `HlmSelectItem`, `HlmSelectLabel` for custom layouts and grouped sections.
|
|
359
|
+
- `@egose/shadcn-theme-ng/form-field` — `HlmFormField`, `HlmError`, `HlmHint`, `HlmFormIdGenerator`.
|
|
360
|
+
- `@egose/shadcn-theme-ng/label` — `HlmLabel`.
|
|
361
|
+
- `@egose/shadcn-theme-ng/form-searchable-multiselect` — searchable checkbox-popover alternative for long option lists.
|
|
@@ -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';
|
|
@@ -9,9 +9,18 @@ import { BrnSelectImports } from '@spartan-ng/brain/select';
|
|
|
9
9
|
import * as i2 from '@egose/shadcn-theme-ng-tw/select';
|
|
10
10
|
import { HlmSelectImports, HlmSelect, HlmSelectTrigger, HlmSelectValue, HlmSelectContent, HlmSelectItem, HlmSelectLabel } from '@egose/shadcn-theme-ng-tw/select';
|
|
11
11
|
|
|
12
|
+
const EgFormSelectConfigToken = new InjectionToken('EgFormSelectConfig');
|
|
13
|
+
function provideEgFormSelectConfig(config) {
|
|
14
|
+
return { provide: EgFormSelectConfigToken, useValue: { ...config } };
|
|
15
|
+
}
|
|
16
|
+
function injectEgFormSelectConfig() {
|
|
17
|
+
return inject(EgFormSelectConfigToken, { optional: true }) ?? {};
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
class EgFormSelect {
|
|
13
21
|
formGroupDirective = inject(FormGroupDirective);
|
|
14
22
|
generatedId = inject(HlmFormIdGenerator).generate('eg-form-select');
|
|
23
|
+
_config = injectEgFormSelectConfig();
|
|
15
24
|
label = input(undefined, /* @ts-ignore */
|
|
16
25
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
17
26
|
controlId = input(undefined, /* @ts-ignore */
|
|
@@ -62,19 +71,19 @@ class EgFormSelect {
|
|
|
62
71
|
...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
|
|
63
72
|
hintClass = input('', /* @ts-ignore */
|
|
64
73
|
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
65
|
-
// Computed classes
|
|
66
|
-
$userClass = computed(() => hlm('tw:
|
|
74
|
+
// Computed classes (library base < global config < per-instance)
|
|
75
|
+
$userClass = computed(() => hlm('tw:w-full', this.userClass()), /* @ts-ignore */
|
|
67
76
|
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
68
|
-
$labelClass = computed(() => hlm('tw:mb-1 tw:gap-0', this.labelClass()), /* @ts-ignore */
|
|
77
|
+
$labelClass = computed(() => hlm('tw:mb-1 tw:gap-0', this._config.labelClass, this.labelClass()), /* @ts-ignore */
|
|
69
78
|
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
70
|
-
$selectClass = computed(() => hlm('tw:w-full', this.selectClass()), /* @ts-ignore */
|
|
79
|
+
$selectClass = computed(() => hlm('tw:w-full', this._config.selectClass, this.selectClass()), /* @ts-ignore */
|
|
71
80
|
...(ngDevMode ? [{ debugName: "$selectClass" }] : /* istanbul ignore next */ []));
|
|
72
|
-
$errorClass = computed(() => hlm('tw:mt-0', this.errorClass()), /* @ts-ignore */
|
|
81
|
+
$errorClass = computed(() => hlm('tw:mt-0', this._config.errorClass, this.errorClass()), /* @ts-ignore */
|
|
73
82
|
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
74
|
-
$hintClass = computed(() => hlm('tw:mt-0', this.hintClass()), /* @ts-ignore */
|
|
83
|
+
$hintClass = computed(() => hlm('tw:mt-0', this._config.hintClass, this.hintClass()), /* @ts-ignore */
|
|
75
84
|
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
76
85
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
77
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormSelect, isStandalone: true, selector: "eg-form-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionsLabel: { classPropertyName: "optionsLabel", publicName: "optionsLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, selectClass: { classPropertyName: "selectClass", publicName: "selectClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: {
|
|
86
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormSelect, isStandalone: true, selector: "eg-form-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionsLabel: { classPropertyName: "optionsLabel", publicName: "optionsLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, selectClass: { classPropertyName: "selectClass", publicName: "selectClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "$userClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
|
|
78
87
|
@let lbl = label();
|
|
79
88
|
@let cnm = controlName();
|
|
80
89
|
@let err = error();
|
|
@@ -102,7 +111,7 @@ class EgFormSelect {
|
|
|
102
111
|
<hlm-select-value [placeholder]="placeholder()" />
|
|
103
112
|
</hlm-select-trigger>
|
|
104
113
|
|
|
105
|
-
<hlm-select-content>
|
|
114
|
+
<hlm-select-content *hlmSelectPortal>
|
|
106
115
|
@if (options().length) {
|
|
107
116
|
@if (optionsLabel()) {
|
|
108
117
|
<hlm-select-label>{{ optionsLabel() }}</hlm-select-label>
|
|
@@ -124,7 +133,7 @@ class EgFormSelect {
|
|
|
124
133
|
<hlm-select-value [placeholder]="placeholder()" />
|
|
125
134
|
</hlm-select-trigger>
|
|
126
135
|
|
|
127
|
-
<hlm-select-content>
|
|
136
|
+
<hlm-select-content *hlmSelectPortal>
|
|
128
137
|
@if (options().length) {
|
|
129
138
|
@if (optionsLabel()) {
|
|
130
139
|
<hlm-select-label>{{ optionsLabel() }}</hlm-select-label>
|
|
@@ -149,7 +158,7 @@ class EgFormSelect {
|
|
|
149
158
|
</hlm-hint>
|
|
150
159
|
}
|
|
151
160
|
</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: "directive", type: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectLabel, selector: "[hlmSelectLabel],hlm-select-label" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "ariaDescribedby", "wrapperDisabled", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }] });
|
|
161
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: HlmFormField, selector: "hlm-form-field", inputs: ["class"] }, { kind: "directive", type: HlmError, selector: "hlm-error", inputs: ["class"] }, { kind: "directive", type: HlmHint, selector: "hlm-hint", inputs: ["class"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { kind: "directive", type: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectLabel, selector: "[hlmSelectLabel],hlm-select-label" }, { kind: "directive", type: i2.HlmSelectPortal, selector: "[hlmSelectPortal]" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "ariaDescribedby", "wrapperDisabled", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }] });
|
|
153
162
|
}
|
|
154
163
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormSelect, decorators: [{
|
|
155
164
|
type: Component,
|
|
@@ -157,7 +166,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
157
166
|
selector: 'eg-form-select',
|
|
158
167
|
standalone: true,
|
|
159
168
|
host: {
|
|
160
|
-
class: '
|
|
169
|
+
'[class]': '$userClass()',
|
|
161
170
|
},
|
|
162
171
|
imports: [
|
|
163
172
|
ReactiveFormsModule,
|
|
@@ -203,7 +212,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
203
212
|
<hlm-select-value [placeholder]="placeholder()" />
|
|
204
213
|
</hlm-select-trigger>
|
|
205
214
|
|
|
206
|
-
<hlm-select-content>
|
|
215
|
+
<hlm-select-content *hlmSelectPortal>
|
|
207
216
|
@if (options().length) {
|
|
208
217
|
@if (optionsLabel()) {
|
|
209
218
|
<hlm-select-label>{{ optionsLabel() }}</hlm-select-label>
|
|
@@ -225,7 +234,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
225
234
|
<hlm-select-value [placeholder]="placeholder()" />
|
|
226
235
|
</hlm-select-trigger>
|
|
227
236
|
|
|
228
|
-
<hlm-select-content>
|
|
237
|
+
<hlm-select-content *hlmSelectPortal>
|
|
229
238
|
@if (options().length) {
|
|
230
239
|
@if (optionsLabel()) {
|
|
231
240
|
<hlm-select-label>{{ optionsLabel() }}</hlm-select-label>
|
|
@@ -262,5 +271,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
262
271
|
* Generated bundle index. Do not edit.
|
|
263
272
|
*/
|
|
264
273
|
|
|
265
|
-
export { EgFormSelect };
|
|
274
|
+
export { EgFormSelect, injectEgFormSelectConfig, provideEgFormSelectConfig };
|
|
266
275
|
|
|
@@ -1,4 +1,5 @@
|
|
|
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
|
interface SelectOption {
|
|
@@ -8,6 +9,7 @@ interface SelectOption {
|
|
|
8
9
|
declare class EgFormSelect {
|
|
9
10
|
private readonly formGroupDirective;
|
|
10
11
|
private readonly generatedId;
|
|
12
|
+
private readonly _config;
|
|
11
13
|
label: _angular_core.InputSignal<string | undefined>;
|
|
12
14
|
controlId: _angular_core.InputSignal<string | undefined>;
|
|
13
15
|
controlName: _angular_core.InputSignal<string>;
|
|
@@ -38,4 +40,19 @@ declare class EgFormSelect {
|
|
|
38
40
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormSelect, "eg-form-select", 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; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionsLabel": { "alias": "optionsLabel"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "selectClass": { "alias": "selectClass"; "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 EgFormSelectConfig {
|
|
44
|
+
/**
|
|
45
|
+
* Global class defaults for `eg-form-select` 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
|
+
selectClass?: string;
|
|
51
|
+
errorClass?: string;
|
|
52
|
+
hintClass?: string;
|
|
53
|
+
}
|
|
54
|
+
declare function provideEgFormSelectConfig(config: Partial<EgFormSelectConfig>): ValueProvider;
|
|
55
|
+
declare function injectEgFormSelectConfig(): EgFormSelectConfig;
|
|
56
|
+
|
|
57
|
+
export { EgFormSelect, injectEgFormSelectConfig, provideEgFormSelectConfig };
|
|
58
|
+
export type { EgFormSelectConfig };
|