@vsn-ux/ngx-gaia 0.9.3 → 0.9.5
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/DOCS.md +995 -0
- package/fesm2022/vsn-ux-ngx-gaia.mjs +139 -50
- package/fesm2022/vsn-ux-ngx-gaia.mjs.map +1 -1
- package/index.d.ts +77 -18
- package/package.json +1 -1
package/DOCS.md
ADDED
|
@@ -0,0 +1,995 @@
|
|
|
1
|
+
# ngx-gaia
|
|
2
|
+
|
|
3
|
+
Angular component library providing common Gaia UI components built with Angular 20+ features including signals and new input syntax. Components use `ga-` prefix and require `@angular/cdk`, `@vsn-ux/gaia-styles`, and `lucide-angular` dependencies.
|
|
4
|
+
|
|
5
|
+
## Alert
|
|
6
|
+
|
|
7
|
+
Alert components for displaying contextual information with optional progress indicators and dismissal functionality.
|
|
8
|
+
|
|
9
|
+
**Angular module: GaAlertModule**
|
|
10
|
+
|
|
11
|
+
### `<ga-alert>`
|
|
12
|
+
|
|
13
|
+
Alert component for displaying notifications and contextual information.
|
|
14
|
+
|
|
15
|
+
#### Inputs:
|
|
16
|
+
|
|
17
|
+
- `variant: GaAlertVariant` - Alert type ('brand' | 'information' | 'error' | 'warning' | 'success', default: 'brand')
|
|
18
|
+
- `icon: GaIconData` - Custom icon override
|
|
19
|
+
- `dismissible: boolean` - Show dismiss button (default: false)
|
|
20
|
+
- `progress: number | 'indeterminate'` - Progress value 0-100 or indeterminate state
|
|
21
|
+
- `progressLabel: string` - Accessible label for progress bar
|
|
22
|
+
- `progressLabelledBy: string` - ID of element labeling progress bar
|
|
23
|
+
|
|
24
|
+
#### Outputs:
|
|
25
|
+
|
|
26
|
+
- `dismiss()` - Emitted when dismiss button is clicked
|
|
27
|
+
|
|
28
|
+
### `<ga-alert-title>`
|
|
29
|
+
|
|
30
|
+
Alert title component for structured alert content.
|
|
31
|
+
|
|
32
|
+
### `<ga-alert-title-actions>`
|
|
33
|
+
|
|
34
|
+
Alert title actions component for action buttons in alert header.
|
|
35
|
+
|
|
36
|
+
### GaAlertI18n
|
|
37
|
+
|
|
38
|
+
Service for alert internationalization.
|
|
39
|
+
|
|
40
|
+
#### Methods:
|
|
41
|
+
|
|
42
|
+
- `dismissLabel: string` - Label for dismiss button
|
|
43
|
+
|
|
44
|
+
### Providers:
|
|
45
|
+
|
|
46
|
+
- `provideGaAlertI18n(value: GaAlertI18n | (() => GaAlertI18n))` - Configure alert i18n labels
|
|
47
|
+
|
|
48
|
+
### Examples:
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<ga-alert variant="success" [dismissible]="true" (dismiss)="onDismiss()">
|
|
52
|
+
<ga-alert-title>Success!</ga-alert-title>
|
|
53
|
+
Operation completed successfully.
|
|
54
|
+
</ga-alert>
|
|
55
|
+
|
|
56
|
+
<ga-alert
|
|
57
|
+
variant="information"
|
|
58
|
+
[progress]="75"
|
|
59
|
+
progressLabel="Loading progress"
|
|
60
|
+
>
|
|
61
|
+
Processing data...
|
|
62
|
+
</ga-alert>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Badge
|
|
66
|
+
|
|
67
|
+
Badge component for displaying status indicators and labels.
|
|
68
|
+
|
|
69
|
+
**Angular module: GaBadgeModule**
|
|
70
|
+
|
|
71
|
+
### `<ga-badge>`
|
|
72
|
+
|
|
73
|
+
#### Inputs:
|
|
74
|
+
|
|
75
|
+
- `variant: 'default' | 'default-inverted' | 'information' | 'error' | 'warning' | 'success' | 'muted' | 'disabled'` - Badge variant (default: 'default')
|
|
76
|
+
- `type: 'text' | 'dot'` - Badge type (default: 'text')
|
|
77
|
+
|
|
78
|
+
### Examples:
|
|
79
|
+
|
|
80
|
+
Badge variants
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<ga-badge variant="information" type="text">42</ga-badge>
|
|
84
|
+
<ga-badge variant="error" type="dot"></ga-badge>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Button
|
|
88
|
+
|
|
89
|
+
Button directives for interactive elements with loading states and variants.
|
|
90
|
+
|
|
91
|
+
**Angular module: GaButtonModule**
|
|
92
|
+
|
|
93
|
+
### `[gaButton]`
|
|
94
|
+
|
|
95
|
+
Button directive for styling button and anchor elements.
|
|
96
|
+
|
|
97
|
+
#### Inputs:
|
|
98
|
+
|
|
99
|
+
- `gaButton: GaButtonType` - Button variant ('primary' | 'secondary' | 'ghost' | 'transparent')
|
|
100
|
+
- `gaButtonLoading: boolean` - Show loading state (default: false)
|
|
101
|
+
- `gaButtonLoadingLabel: string` - Loading state label
|
|
102
|
+
- `disabled: boolean` - Disabled state
|
|
103
|
+
|
|
104
|
+
### `[gaIconButton]`
|
|
105
|
+
|
|
106
|
+
Icon button directive for buttons with icons.
|
|
107
|
+
|
|
108
|
+
#### Inputs:
|
|
109
|
+
|
|
110
|
+
- `gaIconButton: GaIconData` - Icon to display (required)
|
|
111
|
+
- `gaIconButtonVariant: GaIconButtonVariant` - Button variant (default: 'secondary')
|
|
112
|
+
- `gaIconButtonLoading: boolean` - Show loading state (default: false)
|
|
113
|
+
- `gaIconButtonLoadingLabel: string` - Loading state label
|
|
114
|
+
- `disabled: boolean` - Disabled state
|
|
115
|
+
|
|
116
|
+
### GaButtonI18n
|
|
117
|
+
|
|
118
|
+
Service for button internationalization.
|
|
119
|
+
|
|
120
|
+
#### Methods:
|
|
121
|
+
|
|
122
|
+
- `loadingLabel: string` - Default loading label
|
|
123
|
+
|
|
124
|
+
### Providers:
|
|
125
|
+
|
|
126
|
+
- `provideGaButtonI18n(value: GaButtonI18n | (() => GaButtonI18n))` - Configure button i18n labels
|
|
127
|
+
|
|
128
|
+
### Examples:
|
|
129
|
+
|
|
130
|
+
```html
|
|
131
|
+
<button gaButton="primary">Primary Button</button>
|
|
132
|
+
<button gaButton="secondary" [gaButtonLoading]="isLoading">Save</button>
|
|
133
|
+
<button [gaIconButton]="PlusIcon" gaIconButtonVariant="primary">Add</button>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Card
|
|
137
|
+
|
|
138
|
+
Card component for grouping related content.
|
|
139
|
+
|
|
140
|
+
**Angular module: GaCardModule**
|
|
141
|
+
|
|
142
|
+
### `<ga-card>`
|
|
143
|
+
|
|
144
|
+
#### Inputs:
|
|
145
|
+
|
|
146
|
+
- `selectable: boolean` - Can be selected (default: false)
|
|
147
|
+
- `selected: boolean` - Is selected (default: false)
|
|
148
|
+
- `disabled: boolean` - Disabled state (default: false)
|
|
149
|
+
|
|
150
|
+
### Examples:
|
|
151
|
+
|
|
152
|
+
Selectable card
|
|
153
|
+
|
|
154
|
+
```html
|
|
155
|
+
<ga-card selectable [selected]="isSelected">
|
|
156
|
+
<h3>Card Title</h3>
|
|
157
|
+
<p>Card content</p>
|
|
158
|
+
</ga-card>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Checkbox
|
|
162
|
+
|
|
163
|
+
Checkbox component for boolean selections.
|
|
164
|
+
|
|
165
|
+
**Angular module: GaCheckboxModule**
|
|
166
|
+
|
|
167
|
+
### `<ga-checkbox>`
|
|
168
|
+
|
|
169
|
+
#### Inputs:
|
|
170
|
+
|
|
171
|
+
- `value: string | null` - Input value (default: null)
|
|
172
|
+
- `checked: boolean` - Checked state (default: false)
|
|
173
|
+
- `indeterminate: boolean` - Indeterminate state (default: false)
|
|
174
|
+
- `name: string | null` - Input name (default: null)
|
|
175
|
+
- `id: string | null` - Input ID (default: null)
|
|
176
|
+
- `disabled: boolean` - Disabled state (default: false)
|
|
177
|
+
- `required: boolean` - Required field (default: false)
|
|
178
|
+
|
|
179
|
+
#### Outputs:
|
|
180
|
+
|
|
181
|
+
- `change(value: boolean)` - Change event
|
|
182
|
+
|
|
183
|
+
### Examples:
|
|
184
|
+
|
|
185
|
+
Basic checkbox
|
|
186
|
+
|
|
187
|
+
```html
|
|
188
|
+
<ga-checkbox [(checked)]="isChecked">Accept terms</ga-checkbox>
|
|
189
|
+
<ga-checkbox [(ngModel)]="value" [indeterminate]="someChecked"
|
|
190
|
+
>Select all</ga-checkbox
|
|
191
|
+
>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Datepicker
|
|
195
|
+
|
|
196
|
+
Comprehensive datepicker with input integration, toggles, and multiple value adapters.
|
|
197
|
+
|
|
198
|
+
**Angular module: GaDatepickerModule**
|
|
199
|
+
|
|
200
|
+
### `<ga-datepicker>`
|
|
201
|
+
|
|
202
|
+
Inline datepicker component for date selection.
|
|
203
|
+
|
|
204
|
+
#### Inputs:
|
|
205
|
+
|
|
206
|
+
- `value: any` - Selected date value (model binding)
|
|
207
|
+
- `min: any` - Minimum selectable date
|
|
208
|
+
- `max: any` - Maximum selectable date
|
|
209
|
+
|
|
210
|
+
#### Outputs:
|
|
211
|
+
|
|
212
|
+
- `valueChange(value: any)` - Emitted when date is selected
|
|
213
|
+
|
|
214
|
+
### `[gaDatepicker]`
|
|
215
|
+
|
|
216
|
+
Input directive for datepicker integration.
|
|
217
|
+
|
|
218
|
+
#### Inputs:
|
|
219
|
+
|
|
220
|
+
- `gaDatepicker: GaDatepickerComponent` - Associated datepicker instance
|
|
221
|
+
- `min: any` - Minimum date constraint
|
|
222
|
+
- `max: any` - Maximum date constraint
|
|
223
|
+
|
|
224
|
+
### `<ga-datepicker-toggle>`
|
|
225
|
+
|
|
226
|
+
Toggle button component for opening datepicker.
|
|
227
|
+
|
|
228
|
+
#### Inputs:
|
|
229
|
+
|
|
230
|
+
- `for: GaDatepickerComponent` - Associated datepicker instance
|
|
231
|
+
|
|
232
|
+
### GaDatepickerI18n
|
|
233
|
+
|
|
234
|
+
Service for datepicker internationalization.
|
|
235
|
+
|
|
236
|
+
#### Methods:
|
|
237
|
+
|
|
238
|
+
- `weekDays: string[]` - Week day labels
|
|
239
|
+
- `monthNames: string[]` - Full month names
|
|
240
|
+
- `monthNamesShort: string[]` - Abbreviated month names
|
|
241
|
+
|
|
242
|
+
### GaDatepickerParserFormatter
|
|
243
|
+
|
|
244
|
+
Service for parsing and formatting date strings.
|
|
245
|
+
|
|
246
|
+
#### Methods:
|
|
247
|
+
|
|
248
|
+
- `parse(value: string): any` - Parse string to date value
|
|
249
|
+
- `format(value: any): string` - Format date value to string
|
|
250
|
+
|
|
251
|
+
### GaDatepickerValueAdapter
|
|
252
|
+
|
|
253
|
+
Abstract service for converting between external and internal date representations.
|
|
254
|
+
|
|
255
|
+
### Value Adapters:
|
|
256
|
+
|
|
257
|
+
- `GaDateStructAdapter` - Works with `{year, month, day}` objects
|
|
258
|
+
- `GaDateNativeUtcAdapter` - Works with native Date objects in UTC
|
|
259
|
+
- `GaDateNativeUtcIsoAdapter` - Works with ISO date strings
|
|
260
|
+
|
|
261
|
+
### Providers:
|
|
262
|
+
|
|
263
|
+
- `provideGaDatepickerI18n(value: GaDatepickerI18n)` - Configure datepicker i18n
|
|
264
|
+
- `provideGaDatepickerParserFormatter(value: GaDatepickerParserFormatter)` - Configure parser/formatter
|
|
265
|
+
- `provideGaDatepickerValueAdapter<T>(value: GaDatepickerValueAdapter<T>)` - Configure value adapter
|
|
266
|
+
|
|
267
|
+
### Examples:
|
|
268
|
+
|
|
269
|
+
```html
|
|
270
|
+
<ga-datepicker
|
|
271
|
+
[(value)]="selectedDate"
|
|
272
|
+
[min]="minDate"
|
|
273
|
+
[max]="maxDate"
|
|
274
|
+
></ga-datepicker>
|
|
275
|
+
|
|
276
|
+
<ga-form-field>
|
|
277
|
+
<label gaFieldLabel>Select Date</label>
|
|
278
|
+
<input gaInput [gaDatepicker]="picker" [(ngModel)]="date" />
|
|
279
|
+
<ga-datepicker-toggle [for]="picker"></ga-datepicker-toggle>
|
|
280
|
+
</ga-form-field>
|
|
281
|
+
<ga-datepicker #picker></ga-datepicker>
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Form Field
|
|
285
|
+
|
|
286
|
+
Form field components for creating accessible form inputs with labels and error handling.
|
|
287
|
+
|
|
288
|
+
**Angular module: GaFormFieldModule**
|
|
289
|
+
|
|
290
|
+
### `<ga-form-field>`
|
|
291
|
+
|
|
292
|
+
Form field wrapper component.
|
|
293
|
+
|
|
294
|
+
### `<ga-label>`
|
|
295
|
+
|
|
296
|
+
Form label component.
|
|
297
|
+
|
|
298
|
+
#### Inputs:
|
|
299
|
+
|
|
300
|
+
- `state: string` - Additional state text
|
|
301
|
+
- `definition: string | TemplateRef` - Help text or template
|
|
302
|
+
|
|
303
|
+
### `<ga-info>`
|
|
304
|
+
|
|
305
|
+
Information text component.
|
|
306
|
+
|
|
307
|
+
### `[gaFormControl]`
|
|
308
|
+
|
|
309
|
+
Form control directive.
|
|
310
|
+
|
|
311
|
+
### `[gaError]`
|
|
312
|
+
|
|
313
|
+
Error template directive.
|
|
314
|
+
|
|
315
|
+
### `[gaFormControlErrors]`
|
|
316
|
+
|
|
317
|
+
Custom errors directive for adding client-side validation errors.
|
|
318
|
+
|
|
319
|
+
#### Inputs:
|
|
320
|
+
|
|
321
|
+
- `gaFormControlErrors: ValidationErrors` - Custom validation errors (required)
|
|
322
|
+
|
|
323
|
+
### `[gaLabelledByFormField]`
|
|
324
|
+
|
|
325
|
+
Directive for connecting form controls to form field labels.
|
|
326
|
+
|
|
327
|
+
#### Inputs:
|
|
328
|
+
|
|
329
|
+
- `aria-labelledby: string | null` - Override aria-labelledby attribute
|
|
330
|
+
|
|
331
|
+
### Providers:
|
|
332
|
+
|
|
333
|
+
- `provideGaFormErrors(config: GaFormErrorsConfig)` - Configure global form error messages that display when no specific gaError directive template is provided
|
|
334
|
+
|
|
335
|
+
### Examples:
|
|
336
|
+
|
|
337
|
+
Complete form field
|
|
338
|
+
|
|
339
|
+
```html
|
|
340
|
+
<ga-form-field>
|
|
341
|
+
<ga-label state="(optional)" definition="Help text">Field Label</ga-label>
|
|
342
|
+
<input gaFormControl gaInput [(ngModel)]="value" required />
|
|
343
|
+
<ga-info>Additional information</ga-info>
|
|
344
|
+
<ng-template gaError="required">This field is required</ng-template>
|
|
345
|
+
</ga-form-field>
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Custom validation errors
|
|
349
|
+
|
|
350
|
+
```html
|
|
351
|
+
<ga-form-field>
|
|
352
|
+
<ga-label>Password</ga-label>
|
|
353
|
+
<input
|
|
354
|
+
gaFormControl
|
|
355
|
+
gaInput
|
|
356
|
+
[gaFormControlErrors]="{ weakPassword: isPasswordWeak ? 'Password too weak' : null }"
|
|
357
|
+
[(ngModel)]="password"
|
|
358
|
+
/>
|
|
359
|
+
<ng-template gaError="weakPassword" let-error>{{ error }}</ng-template>
|
|
360
|
+
</ga-form-field>
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Form control with custom labelling
|
|
364
|
+
|
|
365
|
+
```html
|
|
366
|
+
<input gaInput gaLabelledByFormField [(ngModel)]="value" />
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Global error messages configuration
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
// Static configuration
|
|
373
|
+
provideGaFormErrors({
|
|
374
|
+
required: 'This field is required',
|
|
375
|
+
email: 'Please enter a valid email address',
|
|
376
|
+
minlength: 'Input is too short',
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
// Dynamic configuration with error data access
|
|
380
|
+
provideGaFormErrors({
|
|
381
|
+
required: 'This field is required',
|
|
382
|
+
minlength: (error) => `Minimum ${error.requiredLength} characters required`,
|
|
383
|
+
pattern: (error) =>
|
|
384
|
+
`Input format is invalid. Expected pattern: ${error.requiredPattern}`,
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
// Factory function with injection context access
|
|
388
|
+
provideGaFormErrors(() => {
|
|
389
|
+
const translateService = inject(MyTranslateService);
|
|
390
|
+
return {
|
|
391
|
+
required: translateService.get('errors.required'),
|
|
392
|
+
email: translateService.get('errors.email'),
|
|
393
|
+
};
|
|
394
|
+
});
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Global error override behavior
|
|
398
|
+
|
|
399
|
+
```html
|
|
400
|
+
<ga-form-field>
|
|
401
|
+
<ga-label>Password</ga-label>
|
|
402
|
+
<input gaFormControl gaInput [(ngModel)]="password" required minlength="8" />
|
|
403
|
+
<!-- This custom template overrides the global 'required' error -->
|
|
404
|
+
<ng-template gaError="required">Password is required</ng-template>
|
|
405
|
+
<!-- The 'minlength' error will use the global message if configured -->
|
|
406
|
+
</ga-form-field>
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
## Icon
|
|
410
|
+
|
|
411
|
+
Icon component for displaying Lucide icons.
|
|
412
|
+
|
|
413
|
+
**Angular module: GaIconModule**
|
|
414
|
+
|
|
415
|
+
### `<ga-icon>`
|
|
416
|
+
|
|
417
|
+
#### Inputs:
|
|
418
|
+
|
|
419
|
+
- `icon: GaIconData | string` - Lucide icon (required)
|
|
420
|
+
- `size: string | number` - Icon size (default: 24)
|
|
421
|
+
- `color: string` - Icon color
|
|
422
|
+
- `strokeWidth: number` - Stroke width
|
|
423
|
+
|
|
424
|
+
### Examples:
|
|
425
|
+
|
|
426
|
+
Icon with custom styling
|
|
427
|
+
|
|
428
|
+
```html
|
|
429
|
+
<ga-icon [icon]="icons.Settings" size="32" color="var(--ga-color-primary)" />
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
## Input
|
|
433
|
+
|
|
434
|
+
Input components and directives for text input fields.
|
|
435
|
+
|
|
436
|
+
**Angular module: GaInputModule**
|
|
437
|
+
|
|
438
|
+
### `[gaInput]`
|
|
439
|
+
|
|
440
|
+
Input directive for styling input elements.
|
|
441
|
+
|
|
442
|
+
#### Inputs:
|
|
443
|
+
|
|
444
|
+
- `id: string` - Element ID
|
|
445
|
+
- `disabled: boolean` - Disabled state
|
|
446
|
+
- `invalid: boolean` - Invalid state styling
|
|
447
|
+
|
|
448
|
+
### `<ga-input>`
|
|
449
|
+
|
|
450
|
+
Input component wrapper.
|
|
451
|
+
|
|
452
|
+
### Examples:
|
|
453
|
+
|
|
454
|
+
```html
|
|
455
|
+
<input gaInput type="text" placeholder="Enter text" [(ngModel)]="value" />
|
|
456
|
+
|
|
457
|
+
<ga-input>
|
|
458
|
+
<input type="text" placeholder="Wrapped input" [(ngModel)]="value" />
|
|
459
|
+
</ga-input>
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
## Link
|
|
463
|
+
|
|
464
|
+
Link directive for styled navigation links.
|
|
465
|
+
|
|
466
|
+
**Angular module: GaLinkModule**
|
|
467
|
+
|
|
468
|
+
### `[gaLink]`
|
|
469
|
+
|
|
470
|
+
Link directive.
|
|
471
|
+
|
|
472
|
+
#### Inputs:
|
|
473
|
+
|
|
474
|
+
- `gaLink: 'inline' | ''` - Link variant (default: '')
|
|
475
|
+
- `gaLinkSize: 'small' | 'medium' | 'large'` - Link size (default: 'medium')
|
|
476
|
+
- `gaLinkDisabled: boolean` - Disabled state (default: false)
|
|
477
|
+
- `gaLinkLeadingIcon: GaIconData | string` - Leading icon (default: '')
|
|
478
|
+
- `gaLinkTrailingIcon: GaIconData | string` - Trailing icon (default: '')
|
|
479
|
+
|
|
480
|
+
### Examples:
|
|
481
|
+
|
|
482
|
+
Link variants
|
|
483
|
+
|
|
484
|
+
```html
|
|
485
|
+
<a gaLink href="/page">Standard link</a>
|
|
486
|
+
<a gaLink="inline" href="/page">Inline link</a>
|
|
487
|
+
<a gaLink [gaLinkTrailingIcon]="icons.ExternalLink" href="/external"
|
|
488
|
+
>External</a
|
|
489
|
+
>
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
## Menu
|
|
493
|
+
|
|
494
|
+
Menu components for dropdown navigation and actions.
|
|
495
|
+
|
|
496
|
+
**Angular module: GaMenuModule**
|
|
497
|
+
|
|
498
|
+
### `<ga-menu>`
|
|
499
|
+
|
|
500
|
+
Menu container component.
|
|
501
|
+
|
|
502
|
+
### `<ga-menu-title>`
|
|
503
|
+
|
|
504
|
+
Menu title component.
|
|
505
|
+
|
|
506
|
+
### `[gaMenuItem]`
|
|
507
|
+
|
|
508
|
+
Menu item directive.
|
|
509
|
+
|
|
510
|
+
#### Inputs:
|
|
511
|
+
|
|
512
|
+
- `gaMenuItemIcon: GaIconData` - Item icon
|
|
513
|
+
- `gaMenuItemDescription: string` - Item description
|
|
514
|
+
- `gaMenuItemShortcut: string` - Keyboard shortcut
|
|
515
|
+
|
|
516
|
+
### `<ga-menu-separator>`
|
|
517
|
+
|
|
518
|
+
Menu separator component.
|
|
519
|
+
|
|
520
|
+
### `<ga-menu-trigger-icon>`
|
|
521
|
+
|
|
522
|
+
Trigger icon component.
|
|
523
|
+
|
|
524
|
+
### `[gaMenuTrigger]`
|
|
525
|
+
|
|
526
|
+
Menu trigger directive.
|
|
527
|
+
|
|
528
|
+
#### Inputs:
|
|
529
|
+
|
|
530
|
+
- `gaMenuTrigger: TemplateRef` - Menu template (required)
|
|
531
|
+
|
|
532
|
+
#### Outputs:
|
|
533
|
+
|
|
534
|
+
- `gaMenuOpened()` - Opened event
|
|
535
|
+
- `gaMenuClosed()` - Closed event
|
|
536
|
+
|
|
537
|
+
### Examples:
|
|
538
|
+
|
|
539
|
+
Menu with trigger
|
|
540
|
+
|
|
541
|
+
```html
|
|
542
|
+
<button gaButton [gaMenuTrigger]="menu">Menu <ga-menu-trigger-icon /></button>
|
|
543
|
+
<ng-template #menu>
|
|
544
|
+
<ga-menu>
|
|
545
|
+
<ga-menu-title>Actions</ga-menu-title>
|
|
546
|
+
<button gaMenuItem [gaMenuItemIcon]="icons.Edit">Edit</button>
|
|
547
|
+
<ga-menu-separator />
|
|
548
|
+
<button gaMenuItem [gaMenuItemIcon]="icons.Trash2">Delete</button>
|
|
549
|
+
</ga-menu>
|
|
550
|
+
</ng-template>
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
## Modal
|
|
554
|
+
|
|
555
|
+
Modal service and components for creating overlay dialogs.
|
|
556
|
+
|
|
557
|
+
**Angular module: GaModalModule**
|
|
558
|
+
|
|
559
|
+
### `<ga-modal>`
|
|
560
|
+
|
|
561
|
+
Base modal component for creating dialog content.
|
|
562
|
+
|
|
563
|
+
#### Inputs:
|
|
564
|
+
|
|
565
|
+
- `data: any` - Modal data passed from service
|
|
566
|
+
|
|
567
|
+
#### Outputs:
|
|
568
|
+
|
|
569
|
+
- `afterClosed(): Observable<any>` - Emitted when modal closes
|
|
570
|
+
|
|
571
|
+
#### Methods:
|
|
572
|
+
|
|
573
|
+
- `close(result?: any): void` - Close the modal with optional result
|
|
574
|
+
|
|
575
|
+
### `<ga-modal-header>`
|
|
576
|
+
|
|
577
|
+
Modal header component.
|
|
578
|
+
|
|
579
|
+
### `<ga-modal-content>`
|
|
580
|
+
|
|
581
|
+
Modal content component for main dialog content.
|
|
582
|
+
|
|
583
|
+
### `<ga-modal-description>`
|
|
584
|
+
|
|
585
|
+
Modal description component for additional context.
|
|
586
|
+
|
|
587
|
+
### `<ga-modal-actions>`
|
|
588
|
+
|
|
589
|
+
Modal actions component for buttons and controls.
|
|
590
|
+
|
|
591
|
+
### GaModalService
|
|
592
|
+
|
|
593
|
+
Service for opening and managing modals.
|
|
594
|
+
|
|
595
|
+
#### Methods:
|
|
596
|
+
|
|
597
|
+
- `open<T>(component: ComponentType<T>, data?: any): T` - Open modal with component
|
|
598
|
+
- `closeAll(): void` - Close all open modals
|
|
599
|
+
|
|
600
|
+
### GaModalRef
|
|
601
|
+
|
|
602
|
+
Reference to an opened modal instance.
|
|
603
|
+
|
|
604
|
+
#### Methods:
|
|
605
|
+
|
|
606
|
+
- `close(result?: any): void` - Close the modal
|
|
607
|
+
|
|
608
|
+
### GaModalI18n
|
|
609
|
+
|
|
610
|
+
Service for modal internationalization.
|
|
611
|
+
|
|
612
|
+
### Providers:
|
|
613
|
+
|
|
614
|
+
- `provideGaModalI18n(value: GaModalI18n)` - Configure modal i18n
|
|
615
|
+
- `provideGaModalOptions(options: GaModalOptions)` - Configure modal options
|
|
616
|
+
|
|
617
|
+
### Examples:
|
|
618
|
+
|
|
619
|
+
```html
|
|
620
|
+
<ga-modal>
|
|
621
|
+
<ga-modal-header>Confirm Action</ga-modal-header>
|
|
622
|
+
<ga-modal-content>Are you sure you want to proceed?</ga-modal-content>
|
|
623
|
+
<ga-modal-actions>
|
|
624
|
+
<button gaButton="secondary" (click)="close()">Cancel</button>
|
|
625
|
+
<button gaButton="primary" (click)="confirm()">Confirm</button>
|
|
626
|
+
</ga-modal-actions>
|
|
627
|
+
</ga-modal>
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
```typescript
|
|
631
|
+
constructor(private modalService: GaModalService) {}
|
|
632
|
+
|
|
633
|
+
openDialog() {
|
|
634
|
+
const modal = this.modalService.open(ConfirmModalComponent, {
|
|
635
|
+
message: 'Are you sure?'
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
## Radio
|
|
641
|
+
|
|
642
|
+
Radio button components for single-choice selections.
|
|
643
|
+
|
|
644
|
+
**Angular module: GaRadioModule**
|
|
645
|
+
|
|
646
|
+
### `<ga-radio-group>`
|
|
647
|
+
|
|
648
|
+
Radio group component.
|
|
649
|
+
|
|
650
|
+
#### Inputs:
|
|
651
|
+
|
|
652
|
+
- `value: any` - Selected value
|
|
653
|
+
|
|
654
|
+
#### Outputs:
|
|
655
|
+
|
|
656
|
+
- `change(value: any)` - Change event
|
|
657
|
+
|
|
658
|
+
### `<ga-radio-button>`
|
|
659
|
+
|
|
660
|
+
Radio button component.
|
|
661
|
+
|
|
662
|
+
#### Inputs:
|
|
663
|
+
|
|
664
|
+
- `value: any` - Button value
|
|
665
|
+
|
|
666
|
+
### Examples:
|
|
667
|
+
|
|
668
|
+
Radio group
|
|
669
|
+
|
|
670
|
+
```html
|
|
671
|
+
<ga-radio-group [(value)]="selectedValue">
|
|
672
|
+
<ga-radio-button value="option1">Option 1</ga-radio-button>
|
|
673
|
+
<ga-radio-button value="option2">Option 2</ga-radio-button>
|
|
674
|
+
<ga-radio-button value="option3">Option 3</ga-radio-button>
|
|
675
|
+
</ga-radio-group>
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
## Segmented Control
|
|
679
|
+
|
|
680
|
+
Segmented control components for grouped button selections.
|
|
681
|
+
|
|
682
|
+
**Angular module: GaSegmentedControlModule**
|
|
683
|
+
|
|
684
|
+
### `<ga-segmented-control>`
|
|
685
|
+
|
|
686
|
+
Segmented control container component.
|
|
687
|
+
|
|
688
|
+
#### Inputs:
|
|
689
|
+
|
|
690
|
+
- `selected: any` - Selected value
|
|
691
|
+
|
|
692
|
+
#### Outputs:
|
|
693
|
+
|
|
694
|
+
- `change(value: any)` - Change event
|
|
695
|
+
|
|
696
|
+
### `<ga-segmented-control-text-button>`
|
|
697
|
+
|
|
698
|
+
Text button component.
|
|
699
|
+
|
|
700
|
+
#### Inputs:
|
|
701
|
+
|
|
702
|
+
- `value: any` - Button value
|
|
703
|
+
|
|
704
|
+
### `<ga-segmented-control-icon-button>`
|
|
705
|
+
|
|
706
|
+
Icon button component.
|
|
707
|
+
|
|
708
|
+
#### Inputs:
|
|
709
|
+
|
|
710
|
+
- `value: any` - Button value
|
|
711
|
+
- `icon: GaIconData` - Button icon
|
|
712
|
+
|
|
713
|
+
### Examples:
|
|
714
|
+
|
|
715
|
+
Text buttons
|
|
716
|
+
|
|
717
|
+
```html
|
|
718
|
+
<ga-segmented-control [(selected)]="view">
|
|
719
|
+
<ga-segmented-control-text-button value="list"
|
|
720
|
+
>List</ga-segmented-control-text-button
|
|
721
|
+
>
|
|
722
|
+
<ga-segmented-control-text-button value="grid"
|
|
723
|
+
>Grid</ga-segmented-control-text-button
|
|
724
|
+
>
|
|
725
|
+
</ga-segmented-control>
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
Icon buttons
|
|
729
|
+
|
|
730
|
+
```html
|
|
731
|
+
<ga-segmented-control [(selected)]="view">
|
|
732
|
+
<ga-segmented-control-icon-button [icon]="icons.List" value="list"
|
|
733
|
+
>List</ga-segmented-control-icon-button
|
|
734
|
+
>
|
|
735
|
+
<ga-segmented-control-icon-button [icon]="icons.Grid" value="grid"
|
|
736
|
+
>Grid</ga-segmented-control-icon-button
|
|
737
|
+
>
|
|
738
|
+
</ga-segmented-control>
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
## Select
|
|
742
|
+
|
|
743
|
+
Select components for dropdown selections with search and multi-select capabilities.
|
|
744
|
+
|
|
745
|
+
**Angular module: GaSelectModule**
|
|
746
|
+
|
|
747
|
+
### `<ga-select>`
|
|
748
|
+
|
|
749
|
+
Select component.
|
|
750
|
+
|
|
751
|
+
#### Inputs:
|
|
752
|
+
|
|
753
|
+
- `value: any` - Selected value (single/multiple)
|
|
754
|
+
- `placeholder: string` - Placeholder text
|
|
755
|
+
- `canSelectNullable: boolean` - Allow null selection
|
|
756
|
+
- `compareWith: (a: any, b: any) => boolean` - Value comparison function
|
|
757
|
+
- `leftIcon: GaIconData` - Left icon
|
|
758
|
+
- `multiple: boolean` - Multiple selection
|
|
759
|
+
- `searchable: boolean` - Enable search
|
|
760
|
+
- `clearable: boolean` - Show clear button
|
|
761
|
+
- `textValue: string` - Search text (searchable mode)
|
|
762
|
+
|
|
763
|
+
### `<ga-select-dropdown>`
|
|
764
|
+
|
|
765
|
+
Dropdown container component.
|
|
766
|
+
|
|
767
|
+
#### Inputs:
|
|
768
|
+
|
|
769
|
+
- `loading: boolean` - Loading state
|
|
770
|
+
|
|
771
|
+
### `<ga-option>`
|
|
772
|
+
|
|
773
|
+
Option component.
|
|
774
|
+
|
|
775
|
+
#### Inputs:
|
|
776
|
+
|
|
777
|
+
- `value: any` - Option value
|
|
778
|
+
- `withInput: boolean` - Include input
|
|
779
|
+
- `typeaheadLabel: string` - Typeahead label
|
|
780
|
+
- `hidden: boolean` - Hidden state
|
|
781
|
+
|
|
782
|
+
### `<ga-optgroup>`
|
|
783
|
+
|
|
784
|
+
Option group component.
|
|
785
|
+
|
|
786
|
+
#### Inputs:
|
|
787
|
+
|
|
788
|
+
- `label: string` - Group label
|
|
789
|
+
|
|
790
|
+
### `<ga-select-value>`
|
|
791
|
+
|
|
792
|
+
Custom trigger value display component.
|
|
793
|
+
|
|
794
|
+
### `<ga-select-dropdown-spinner>`
|
|
795
|
+
|
|
796
|
+
Loading spinner component.
|
|
797
|
+
|
|
798
|
+
### Providers:
|
|
799
|
+
|
|
800
|
+
- `provideGaSelectI18n` - Configure clear button label
|
|
801
|
+
|
|
802
|
+
### Examples:
|
|
803
|
+
|
|
804
|
+
Basic select
|
|
805
|
+
|
|
806
|
+
```html
|
|
807
|
+
<ga-select placeholder="Choose option" [(value)]="selected">
|
|
808
|
+
<ga-select-dropdown>
|
|
809
|
+
<ga-option value="1">Option 1</ga-option>
|
|
810
|
+
<ga-option value="2">Option 2</ga-option>
|
|
811
|
+
</ga-select-dropdown>
|
|
812
|
+
</ga-select>
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
Multi-select
|
|
816
|
+
|
|
817
|
+
```html
|
|
818
|
+
<ga-select multiple [(value)]="selectedItems">
|
|
819
|
+
<ga-select-dropdown>
|
|
820
|
+
<ga-option value="1">Item 1</ga-option>
|
|
821
|
+
<ga-option value="2">Item 2</ga-option>
|
|
822
|
+
</ga-select-dropdown>
|
|
823
|
+
</ga-select>
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
Searchable select
|
|
827
|
+
|
|
828
|
+
```html
|
|
829
|
+
<ga-select searchable clearable [(textValue)]="searchText" [(value)]="selected">
|
|
830
|
+
<ga-select-dropdown>
|
|
831
|
+
<ga-option *ngFor="let item of filteredItems" [value]="item"
|
|
832
|
+
>{{ item.name }}</ga-option
|
|
833
|
+
>
|
|
834
|
+
</ga-select-dropdown>
|
|
835
|
+
</ga-select>
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
Select with groups
|
|
839
|
+
|
|
840
|
+
```html
|
|
841
|
+
<ga-select [(value)]="selected">
|
|
842
|
+
<ga-select-dropdown>
|
|
843
|
+
<ga-optgroup label="Group 1">
|
|
844
|
+
<ga-option value="1">Option 1</ga-option>
|
|
845
|
+
</ga-optgroup>
|
|
846
|
+
<ga-optgroup label="Group 2">
|
|
847
|
+
<ga-option value="2">Option 2</ga-option>
|
|
848
|
+
</ga-optgroup>
|
|
849
|
+
</ga-select-dropdown>
|
|
850
|
+
</ga-select>
|
|
851
|
+
```
|
|
852
|
+
|
|
853
|
+
i18n configuration
|
|
854
|
+
|
|
855
|
+
```typescript
|
|
856
|
+
provideGaSelectI18n({ clearLabel: 'Clear selection' });
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
## Spinner
|
|
860
|
+
|
|
861
|
+
Spinner component for loading indicators.
|
|
862
|
+
|
|
863
|
+
**Angular module: GaSpinnerModule**
|
|
864
|
+
|
|
865
|
+
### `<ga-spinner>`
|
|
866
|
+
|
|
867
|
+
#### Inputs:
|
|
868
|
+
|
|
869
|
+
- `size: number` - Size in pixels (default: 32)
|
|
870
|
+
|
|
871
|
+
### Examples:
|
|
872
|
+
|
|
873
|
+
Custom sized spinner
|
|
874
|
+
|
|
875
|
+
```html
|
|
876
|
+
<ga-spinner size="48" />
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
## Switch
|
|
880
|
+
|
|
881
|
+
Switch component for boolean toggle controls.
|
|
882
|
+
|
|
883
|
+
**Angular module: GaSwitchModule**
|
|
884
|
+
|
|
885
|
+
### `<ga-switch>`
|
|
886
|
+
|
|
887
|
+
#### Inputs:
|
|
888
|
+
|
|
889
|
+
- `label: string` - Switch label (default: '')
|
|
890
|
+
- `checked: boolean` - Checked state (default: false)
|
|
891
|
+
- `disabled: boolean` - Disabled state (default: false)
|
|
892
|
+
|
|
893
|
+
#### Outputs:
|
|
894
|
+
|
|
895
|
+
- `checkedChange(value: boolean)` - Change event
|
|
896
|
+
|
|
897
|
+
### Examples:
|
|
898
|
+
|
|
899
|
+
Switch with label
|
|
900
|
+
|
|
901
|
+
```html
|
|
902
|
+
<ga-switch label="Enable notifications" [(checked)]="enabled" />
|
|
903
|
+
<ga-switch [(ngModel)]="value" label="Dark mode" />
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
## Text Area
|
|
907
|
+
|
|
908
|
+
Text area directive for multi-line text input.
|
|
909
|
+
|
|
910
|
+
**Angular module: GaTextAreaModule**
|
|
911
|
+
|
|
912
|
+
### `[gaTextArea]`
|
|
913
|
+
|
|
914
|
+
Text area directive.
|
|
915
|
+
|
|
916
|
+
#### Inputs:
|
|
917
|
+
|
|
918
|
+
- `invalid: boolean` - Invalid state
|
|
919
|
+
|
|
920
|
+
### Examples:
|
|
921
|
+
|
|
922
|
+
Basic text area
|
|
923
|
+
|
|
924
|
+
```html
|
|
925
|
+
<textarea gaTextArea rows="5" placeholder="Enter text"></textarea>
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
Text area in form field
|
|
929
|
+
|
|
930
|
+
```html
|
|
931
|
+
<ga-form-field>
|
|
932
|
+
<ga-label>Description</ga-label>
|
|
933
|
+
<textarea gaFormControl gaTextArea [(ngModel)]="description"></textarea>
|
|
934
|
+
</ga-form-field>
|
|
935
|
+
```
|
|
936
|
+
|
|
937
|
+
## Tooltip
|
|
938
|
+
|
|
939
|
+
Tooltip directive and component for contextual information overlays.
|
|
940
|
+
|
|
941
|
+
**Angular module: GaTooltipModule**
|
|
942
|
+
|
|
943
|
+
### `[gaTooltip]`
|
|
944
|
+
|
|
945
|
+
Tooltip directive for contextual information overlays.
|
|
946
|
+
|
|
947
|
+
#### Inputs:
|
|
948
|
+
|
|
949
|
+
- `gaTooltip: string | TemplateRef<any>` - Tooltip content
|
|
950
|
+
- `gaTooltipDisabled: boolean` - Disable tooltip (default: false)
|
|
951
|
+
- `gaTooltipControlMode: 'hover' | 'click' | 'none'` - Control mode (default: 'hover')
|
|
952
|
+
- `gaTooltipShowControlMode: 'hover' | 'click' | 'none'` - Show control mode
|
|
953
|
+
- `gaTooltipHideControlMode: 'hover' | 'click' | 'none'` - Hide control mode
|
|
954
|
+
- `gaTooltipOffsetSize: number` - Offset from target (default: 5)
|
|
955
|
+
- `gaTooltipPlacement: GaTooltipPlacement` - Preferred placement (default: 'right-center')
|
|
956
|
+
|
|
957
|
+
#### Methods:
|
|
958
|
+
|
|
959
|
+
- `show(): void` - Show tooltip programmatically
|
|
960
|
+
- `hide(): void` - Hide tooltip programmatically
|
|
961
|
+
- `toggle(): void` - Toggle tooltip visibility
|
|
962
|
+
|
|
963
|
+
### `<ga-tooltip>`
|
|
964
|
+
|
|
965
|
+
Tooltip component for rendering tooltip content.
|
|
966
|
+
|
|
967
|
+
### Examples:
|
|
968
|
+
|
|
969
|
+
```html
|
|
970
|
+
<button gaTooltip="This is a tooltip">Hover me</button>
|
|
971
|
+
<span [gaTooltip]="tooltipContent" gaTooltipPlacement="top-center"
|
|
972
|
+
>Top tooltip</span
|
|
973
|
+
>
|
|
974
|
+
<button gaTooltip="Click tooltip" gaTooltipControlMode="click">Click me</button>
|
|
975
|
+
```
|
|
976
|
+
|
|
977
|
+
## Utils
|
|
978
|
+
|
|
979
|
+
Utility tokens and providers for configuring library behavior.
|
|
980
|
+
|
|
981
|
+
### Providers:
|
|
982
|
+
|
|
983
|
+
- `provideGaBaseFontSize` - Configure base font size for rem calculations
|
|
984
|
+
|
|
985
|
+
### Tokens:
|
|
986
|
+
|
|
987
|
+
- `GA_BASE_FONT_SIZE` - Base font size injection token
|
|
988
|
+
|
|
989
|
+
### Examples:
|
|
990
|
+
|
|
991
|
+
Base font size configuration
|
|
992
|
+
|
|
993
|
+
```typescript
|
|
994
|
+
provideGaBaseFontSize(14); // Use 14px as base instead of default 16px
|
|
995
|
+
```
|