igniteui-angular 21.1.0-rc.4 → 21.1.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 +29 -0
- package/fesm2022/igniteui-angular-grids-core.mjs +5 -3
- package/fesm2022/igniteui-angular-grids-core.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-grid.mjs +6 -1
- package/fesm2022/igniteui-angular-grids-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs +1 -0
- package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-lite.mjs +2 -0
- package/fesm2022/igniteui-angular-grids-lite.mjs.map +1 -1
- package/fesm2022/igniteui-angular-simple-combo.mjs +1 -1
- package/fesm2022/igniteui-angular-simple-combo.mjs.map +1 -1
- package/lib/core/styles/components/grid/_grid-theme.scss +4 -1
- package/migrations/migration-collection.json +7 -0
- package/migrations/update-21_1_0_add-agent-skills/index.d.ts +3 -0
- package/migrations/update-21_1_0_add-agent-skills/index.js +46 -0
- package/package.json +4 -4
- package/skills/igniteui-angular-components/SKILL.md +71 -0
- package/skills/igniteui-angular-components/references/charts.md +447 -0
- package/skills/igniteui-angular-components/references/data-display.md +347 -0
- package/skills/igniteui-angular-components/references/directives.md +149 -0
- package/skills/igniteui-angular-components/references/feedback.md +141 -0
- package/skills/igniteui-angular-components/references/form-controls.md +298 -0
- package/skills/igniteui-angular-components/references/layout-manager.md +415 -0
- package/skills/igniteui-angular-components/references/layout.md +216 -0
- package/skills/igniteui-angular-components/references/setup.md +157 -0
- package/skills/igniteui-angular-grids/SKILL.md +110 -0
- package/skills/igniteui-angular-grids/references/data-operations.md +436 -0
- package/skills/igniteui-angular-grids/references/editing.md +480 -0
- package/skills/igniteui-angular-grids/references/features.md +218 -0
- package/skills/igniteui-angular-grids/references/paging-remote.md +388 -0
- package/skills/igniteui-angular-grids/references/state.md +448 -0
- package/skills/igniteui-angular-grids/references/structure.md +290 -0
- package/skills/igniteui-angular-grids/references/types.md +428 -0
- package/skills/igniteui-angular-theming/SKILL.md +530 -0
- package/styles/igniteui-angular-dark.css +1 -1
- package/styles/igniteui-angular.css +1 -1
- package/styles/igniteui-bootstrap-dark.css +1 -1
- package/styles/igniteui-bootstrap-light.css +1 -1
- package/styles/igniteui-dark-green.css +1 -1
- package/styles/igniteui-fluent-dark-excel.css +1 -1
- package/styles/igniteui-fluent-dark-word.css +1 -1
- package/styles/igniteui-fluent-dark.css +1 -1
- package/styles/igniteui-fluent-light-excel.css +1 -1
- package/styles/igniteui-fluent-light-word.css +1 -1
- package/styles/igniteui-fluent-light.css +1 -1
- package/styles/igniteui-indigo-dark.css +1 -1
- package/styles/igniteui-indigo-light.css +1 -1
- package/styles/maps/igniteui-angular-dark.css.map +1 -1
- package/styles/maps/igniteui-angular.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-dark.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-light.css.map +1 -1
- package/styles/maps/igniteui-dark-green.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-light.css.map +1 -1
- package/styles/maps/igniteui-indigo-dark.css.map +1 -1
- package/styles/maps/igniteui-indigo-light.css.map +1 -1
- package/types/igniteui-angular-grids-lite.d.ts +2 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# Form Controls & Reactive Forms Integration
|
|
2
|
+
|
|
3
|
+
> **Part of the [`igniteui-angular-components`](../SKILL.md) skill hub.**
|
|
4
|
+
> For app setup, providers, and import patterns — see [`setup.md`](./setup.md).
|
|
5
|
+
|
|
6
|
+
## Input Group
|
|
7
|
+
|
|
8
|
+
> **Docs:** [Input Group](https://www.infragistics.com/products/ignite-ui-angular/angular/components/input-group)
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
import { IGX_INPUT_GROUP_DIRECTIVES } from 'igniteui-angular/input-group';
|
|
12
|
+
import { IgxIconComponent } from 'igniteui-angular/icon';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<igx-input-group type="border">
|
|
17
|
+
<igx-prefix><igx-icon>person</igx-icon></igx-prefix>
|
|
18
|
+
<label igxLabel>Username</label>
|
|
19
|
+
<input igxInput name="username" type="text" [(ngModel)]="username" />
|
|
20
|
+
<igx-suffix><igx-icon>clear</igx-icon></igx-suffix>
|
|
21
|
+
<igx-hint>Enter your username</igx-hint>
|
|
22
|
+
</igx-input-group>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Types: `line` (default), `border`, `box`, `search`.
|
|
26
|
+
|
|
27
|
+
## Combo (Multi-Select Dropdown)
|
|
28
|
+
|
|
29
|
+
> **Docs:** [Combo Component](https://www.infragistics.com/products/ignite-ui-angular/angular/components/combo)
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { IgxComboComponent } from 'igniteui-angular/combo';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<igx-combo
|
|
37
|
+
[data]="cities"
|
|
38
|
+
[valueKey]="'id'"
|
|
39
|
+
[displayKey]="'name'"
|
|
40
|
+
[groupKey]="'region'"
|
|
41
|
+
placeholder="Select cities"
|
|
42
|
+
[allowCustomValues]="false"
|
|
43
|
+
[(ngModel)]="selectedCityIds">
|
|
44
|
+
</igx-combo>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Key inputs: `[data]`, `[valueKey]`, `[displayKey]`, `[groupKey]`, `[placeholder]`, `[allowCustomValues]`, `[filterFunction]`, `[itemsMaxHeight]`, `[type]`.
|
|
48
|
+
|
|
49
|
+
Events: `(opening)`, `(opened)`, `(closing)`, `(closed)`, `(selectionChanging)`, `(addition)`, `(searchInputUpdate)`.
|
|
50
|
+
|
|
51
|
+
## Simple Combo (Single-Select)
|
|
52
|
+
|
|
53
|
+
> **Docs:** [Combo — Single Selection](https://www.infragistics.com/products/ignite-ui-angular/angular/components/combo#single-selection)
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { IgxSimpleComboComponent } from 'igniteui-angular/simple-combo';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<igx-simple-combo
|
|
61
|
+
[data]="countries"
|
|
62
|
+
[valueKey]="'code'"
|
|
63
|
+
[displayKey]="'name'"
|
|
64
|
+
placeholder="Select country"
|
|
65
|
+
[(ngModel)]="selectedCountry">
|
|
66
|
+
</igx-simple-combo>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Same API as `igx-combo` but restricted to single selection.
|
|
70
|
+
|
|
71
|
+
## Select
|
|
72
|
+
|
|
73
|
+
> **Docs:** [Select Component](https://www.infragistics.com/products/ignite-ui-angular/angular/components/select)
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { IgxSelectComponent, IgxSelectItemComponent } from 'igniteui-angular/select';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```html
|
|
80
|
+
<igx-select [(ngModel)]="selectedRole" placeholder="Choose role">
|
|
81
|
+
@for (role of roles; track role.id) {
|
|
82
|
+
<igx-select-item [value]="role.id">{{ role.name }}</igx-select-item>
|
|
83
|
+
}
|
|
84
|
+
</igx-select>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Date Picker
|
|
88
|
+
|
|
89
|
+
> **Docs:** [Date Picker](https://www.infragistics.com/products/ignite-ui-angular/angular/components/date-picker)
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { IgxDatePickerComponent } from 'igniteui-angular/date-picker';
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<igx-date-picker
|
|
97
|
+
[(ngModel)]="selectedDate"
|
|
98
|
+
[minValue]="minDate"
|
|
99
|
+
[maxValue]="maxDate"
|
|
100
|
+
[hideOutsideDays]="true"
|
|
101
|
+
[displayMonthsCount]="2">
|
|
102
|
+
</igx-date-picker>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Implements `ControlValueAccessor` and `Validator`. Works with both reactive and template-driven forms.
|
|
106
|
+
|
|
107
|
+
## Date Range Picker
|
|
108
|
+
|
|
109
|
+
> **Docs:** [Date Range Picker](https://www.infragistics.com/products/ignite-ui-angular/angular/components/date-range-picker)
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { IgxDateRangePickerComponent } from 'igniteui-angular/date-picker';
|
|
113
|
+
import { IgxDateTimeEditorDirective } from 'igniteui-angular/directives';
|
|
114
|
+
import { IGX_INPUT_GROUP_DIRECTIVES } from 'igniteui-angular/input-group';
|
|
115
|
+
|
|
116
|
+
// import { IgxDateTimeEditorDirective, IGX_INPUT_GROUP_DIRECTIVES } from '@infragistics/igniteui-angular'; for licensed package
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<igx-date-range-picker [(ngModel)]="dateRange">
|
|
121
|
+
<igx-date-range-start>
|
|
122
|
+
<input igxInput igxDateTimeEditor type="text" />
|
|
123
|
+
</igx-date-range-start>
|
|
124
|
+
<igx-date-range-end>
|
|
125
|
+
<input igxInput igxDateTimeEditor type="text" />
|
|
126
|
+
</igx-date-range-end>
|
|
127
|
+
</igx-date-range-picker>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Time Picker
|
|
131
|
+
|
|
132
|
+
> **Docs:** [Time Picker](https://www.infragistics.com/products/ignite-ui-angular/angular/components/time-picker)
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
import { IgxTimePickerComponent } from 'igniteui-angular/time-picker';
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
```html
|
|
139
|
+
<igx-time-picker
|
|
140
|
+
[(ngModel)]="selectedTime"
|
|
141
|
+
[inputFormat]="'HH:mm'"
|
|
142
|
+
[is24HourFormat]="true">
|
|
143
|
+
</igx-time-picker>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Calendar
|
|
147
|
+
|
|
148
|
+
> **Docs:** [Calendar Component](https://www.infragistics.com/products/ignite-ui-angular/angular/components/calendar)
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import { IgxCalendarComponent } from 'igniteui-angular/calendar';
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```html
|
|
155
|
+
<igx-calendar
|
|
156
|
+
[(ngModel)]="selectedDate"
|
|
157
|
+
[selection]="'single'"
|
|
158
|
+
[hideOutsideDays]="true"
|
|
159
|
+
[weekStart]="1">
|
|
160
|
+
</igx-calendar>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Selection modes: `'single'`, `'multi'`, `'range'`.
|
|
164
|
+
|
|
165
|
+
## Checkbox, Radio, Switch
|
|
166
|
+
|
|
167
|
+
> **Docs:** [Checkbox](https://www.infragistics.com/products/ignite-ui-angular/angular/components/checkbox) · [Radio Button](https://www.infragistics.com/products/ignite-ui-angular/angular/components/radio-button) · [Switch](https://www.infragistics.com/products/ignite-ui-angular/angular/components/switch)
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
import { IgxCheckboxComponent } from 'igniteui-angular/checkbox';
|
|
171
|
+
import { IgxRadioComponent, IgxRadioGroupDirective } from 'igniteui-angular/radio';
|
|
172
|
+
import { IgxSwitchComponent } from 'igniteui-angular/switch';
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
```html
|
|
176
|
+
<igx-checkbox [(ngModel)]="rememberMe">Remember me</igx-checkbox>
|
|
177
|
+
|
|
178
|
+
<igx-radio-group>
|
|
179
|
+
<igx-radio name="plan" value="basic" [(ngModel)]="plan">Basic</igx-radio>
|
|
180
|
+
<igx-radio name="plan" value="pro" [(ngModel)]="plan">Pro</igx-radio>
|
|
181
|
+
</igx-radio-group>
|
|
182
|
+
|
|
183
|
+
<igx-switch [(ngModel)]="darkMode">Dark mode</igx-switch>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Slider
|
|
187
|
+
|
|
188
|
+
> **Docs:** [Slider Component](https://www.infragistics.com/products/ignite-ui-angular/angular/components/slider/slider)
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
import { IgxSliderComponent, IgxSliderType } from 'igniteui-angular/slider';
|
|
192
|
+
|
|
193
|
+
public sliderType = IgxSliderType;
|
|
194
|
+
public priceRange = {
|
|
195
|
+
lower: 200,
|
|
196
|
+
upper: 800
|
|
197
|
+
};
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```html
|
|
201
|
+
<!-- Single value -->
|
|
202
|
+
<igx-slider [minValue]="0" [maxValue]="100" [(ngModel)]="volume"></igx-slider>
|
|
203
|
+
|
|
204
|
+
<!-- Range slider -->
|
|
205
|
+
<igx-slider
|
|
206
|
+
[type]="sliderType.RANGE"
|
|
207
|
+
[minValue]="0"
|
|
208
|
+
[maxValue]="100"
|
|
209
|
+
[lowerBound]="20"
|
|
210
|
+
[upperBound]="80">
|
|
211
|
+
</igx-slider>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Reactive Forms Integration
|
|
215
|
+
|
|
216
|
+
All form controls implement `ControlValueAccessor` and work with both reactive and template-driven forms.
|
|
217
|
+
|
|
218
|
+
> **Docs:** [Angular Reactive Form Validation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/angular-reactive-form-validation)
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
222
|
+
import { FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
223
|
+
import { IgxComboComponent } from 'igniteui-angular/combo';
|
|
224
|
+
import { IGX_INPUT_GROUP_DIRECTIVES } from 'igniteui-angular/input-group';
|
|
225
|
+
import { IgxDatePickerComponent } from 'igniteui-angular/date-picker';
|
|
226
|
+
import { IgxSelectComponent, IgxSelectItemComponent } from 'igniteui-angular/select';
|
|
227
|
+
|
|
228
|
+
@Component({
|
|
229
|
+
selector: 'app-my-form',
|
|
230
|
+
imports: [
|
|
231
|
+
ReactiveFormsModule,
|
|
232
|
+
IGX_INPUT_GROUP_DIRECTIVES,
|
|
233
|
+
IgxComboComponent,
|
|
234
|
+
IgxDatePickerComponent,
|
|
235
|
+
IgxSelectComponent,
|
|
236
|
+
IgxSelectItemComponent
|
|
237
|
+
],
|
|
238
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
239
|
+
template: `
|
|
240
|
+
<form [formGroup]="form" (ngSubmit)="submit()">
|
|
241
|
+
<igx-input-group>
|
|
242
|
+
<label igxLabel>Name</label>
|
|
243
|
+
<input igxInput formControlName="name" />
|
|
244
|
+
@if (form.controls.name.invalid && form.controls.name.touched) {
|
|
245
|
+
<igx-hint>Name is required</igx-hint>
|
|
246
|
+
}
|
|
247
|
+
</igx-input-group>
|
|
248
|
+
|
|
249
|
+
<igx-combo
|
|
250
|
+
[data]="skills"
|
|
251
|
+
formControlName="skills"
|
|
252
|
+
[valueKey]="'id'"
|
|
253
|
+
[displayKey]="'name'"
|
|
254
|
+
placeholder="Select skills">
|
|
255
|
+
</igx-combo>
|
|
256
|
+
|
|
257
|
+
<igx-date-picker formControlName="startDate"></igx-date-picker>
|
|
258
|
+
|
|
259
|
+
<igx-select formControlName="role" placeholder="Choose role">
|
|
260
|
+
@for (r of roles; track r.id) {
|
|
261
|
+
<igx-select-item [value]="r.id">{{ r.name }}</igx-select-item>
|
|
262
|
+
}
|
|
263
|
+
</igx-select>
|
|
264
|
+
</form>
|
|
265
|
+
`
|
|
266
|
+
})
|
|
267
|
+
export class MyFormComponent {
|
|
268
|
+
form = new FormGroup({
|
|
269
|
+
name: new FormControl('', Validators.required),
|
|
270
|
+
skills: new FormControl<number[]>([]),
|
|
271
|
+
startDate: new FormControl<Date | null>(null),
|
|
272
|
+
role: new FormControl<string | null>(null)
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
skills = [{ id: 1, name: 'Angular' }, { id: 2, name: 'TypeScript' }];
|
|
276
|
+
roles = [{ id: 'admin', name: 'Admin' }, { id: 'user', name: 'User' }];
|
|
277
|
+
|
|
278
|
+
submit() {
|
|
279
|
+
if (this.form.valid) {
|
|
280
|
+
console.log(this.form.value);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Key Rules
|
|
287
|
+
|
|
288
|
+
- **Always check `app.config.ts` first** — add `provideAnimations()` before using Combo, Select, Date Picker, or any overlay component
|
|
289
|
+
- **Import from specific entry points** — avoid the root `igniteui-angular` barrel
|
|
290
|
+
- Date/Time pickers implement both `ControlValueAccessor` and `Validator` — they integrate with reactive forms natively
|
|
291
|
+
|
|
292
|
+
## See Also
|
|
293
|
+
|
|
294
|
+
- [`setup.md`](./setup.md) — App providers, architecture, all entry points
|
|
295
|
+
- [`layout.md`](./layout.md) — Tabs, Stepper, Accordion, Splitter, Navigation Drawer
|
|
296
|
+
- [`data-display.md`](./data-display.md) — List, Tree, Card and other display components
|
|
297
|
+
- [`feedback.md`](./feedback.md) — Dialog, Snackbar, Toast, Banner
|
|
298
|
+
- [`directives.md`](./directives.md) — Button, Ripple, Tooltip, Drag and Drop
|