ngx-lite-form 1.4.9 → 1.4.10
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 +59 -4
- package/fesm2022/ngx-lite-form.mjs +68 -31
- package/fesm2022/ngx-lite-form.mjs.map +1 -1
- package/index.d.ts +22 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Lite Form: A Lightweight and Powerful Angular Form Library
|
|
2
2
|
|
|
3
|
-
**Lite Form is a comprehensive, open-source library of
|
|
3
|
+
**Lite Form is a comprehensive, open-source library of 16+ standalone components for building modern, reactive forms in Angular (v20+). It provides lightweight, customizable, and fully-typed form controls—from basic inputs to advanced data tables, loading indicators, and badge components—designed to accelerate development and improve user experience.**
|
|
4
4
|
|
|
5
5
|
This library is built for developers who need a robust, out-of-the-box solution for form-heavy applications without the overhead of heavy-weight dependencies. All components are standalone, tree-shakable, and integrate seamlessly with Angular's Reactive Forms module.
|
|
6
6
|
|
|
@@ -69,6 +69,7 @@ Lite Form provides 15+ form and UI components. Click on any component below for
|
|
|
69
69
|
- **[LitePanel](docs/lite-panel.md)** - Modal panel for dialogs and forms
|
|
70
70
|
- **[LiteLoading](docs/lite-loading.md)** - Loading spinner and progress bar
|
|
71
71
|
- **[LiteTabGroup](docs/lite-tab-group.md)** - Tabs with sliding track and Angular projection
|
|
72
|
+
- **[LiteBadge](docs/lite-badge.md)** - Badge and chip component for status indicators and tags
|
|
72
73
|
- **[LiteSnackbar](docs/lite-snackbar.md)** - Toast notifications service
|
|
73
74
|
|
|
74
75
|
---
|
|
@@ -98,7 +99,8 @@ import {
|
|
|
98
99
|
LiteTable,
|
|
99
100
|
LitePaginator,
|
|
100
101
|
LitePanel,
|
|
101
|
-
LiteLoading
|
|
102
|
+
LiteLoading,
|
|
103
|
+
LiteBadge
|
|
102
104
|
} from 'ngx-lite-form';
|
|
103
105
|
import { FormControl, Validators } from '@angular/forms';
|
|
104
106
|
|
|
@@ -111,7 +113,8 @@ import {
|
|
|
111
113
|
FileFieldDto,
|
|
112
114
|
TableFieldDto,
|
|
113
115
|
PaginatorFieldDto,
|
|
114
|
-
LitePanelAction
|
|
116
|
+
LitePanelAction,
|
|
117
|
+
BadgeFieldDto
|
|
115
118
|
} from 'ngx-lite-form';
|
|
116
119
|
|
|
117
120
|
@Component({
|
|
@@ -129,7 +132,8 @@ import {
|
|
|
129
132
|
LiteFile,
|
|
130
133
|
LiteTable,
|
|
131
134
|
LitePaginator,
|
|
132
|
-
LiteLoading
|
|
135
|
+
LiteLoading,
|
|
136
|
+
LiteBadge
|
|
133
137
|
],
|
|
134
138
|
templateUrl: './app.component.html',
|
|
135
139
|
styleUrl: './app.component.scss'
|
|
@@ -273,6 +277,21 @@ export class AppComponent {
|
|
|
273
277
|
this.panelResult.set(result);
|
|
274
278
|
this.basicPanelOpen.set(false);
|
|
275
279
|
}
|
|
280
|
+
|
|
281
|
+
// Badge examples
|
|
282
|
+
statusBadge = new BadgeFieldDto('Active', 'success');
|
|
283
|
+
warningBadge = new BadgeFieldDto('Pending', 'warning');
|
|
284
|
+
infoBadge = new BadgeFieldDto('New', 'info', 'small');
|
|
285
|
+
|
|
286
|
+
tags = signal<BadgeFieldDto[]>([
|
|
287
|
+
new BadgeFieldDto('Angular', 'primary', 'medium', true),
|
|
288
|
+
new BadgeFieldDto('TypeScript', 'info', 'medium', true),
|
|
289
|
+
new BadgeFieldDto('RxJS', 'success', 'medium', true)
|
|
290
|
+
]);
|
|
291
|
+
|
|
292
|
+
removeTag(index: number) {
|
|
293
|
+
this.tags.update(current => current.filter((_, i) => i !== index));
|
|
294
|
+
}
|
|
276
295
|
}
|
|
277
296
|
```
|
|
278
297
|
|
|
@@ -354,6 +373,17 @@ export class AppComponent {
|
|
|
354
373
|
|
|
355
374
|
<!-- Controlled visibility -->
|
|
356
375
|
<lite-loading [visible]="isLoading" [message]="'Please wait...'"></lite-loading>
|
|
376
|
+
|
|
377
|
+
<!-- Badges and Chips -->
|
|
378
|
+
<!-- Status badges -->
|
|
379
|
+
<lite-badge [badge]="statusBadge"></lite-badge>
|
|
380
|
+
<lite-badge [badge]="warningBadge"></lite-badge>
|
|
381
|
+
<lite-badge [badge]="infoBadge"></lite-badge>
|
|
382
|
+
|
|
383
|
+
<!-- Removable tags/chips -->
|
|
384
|
+
@for (tag of tags(); track $index) {
|
|
385
|
+
<lite-badge [badge]="tag" (remove)="removeTag($index)"></lite-badge>
|
|
386
|
+
}
|
|
357
387
|
```
|
|
358
388
|
---
|
|
359
389
|
|
|
@@ -376,6 +406,7 @@ For detailed API documentation, examples, and usage guides for each component, p
|
|
|
376
406
|
- [LitePanel Documentation](docs/lite-panel.md)
|
|
377
407
|
- [LiteLoading Documentation](docs/lite-loading.md)
|
|
378
408
|
- [LiteTabGroup Documentation](docs/lite-tab-group.md)
|
|
409
|
+
- [LiteBadge Documentation](docs/lite-badge.md)
|
|
379
410
|
- [LiteSnackbar Documentation](docs/lite-snackbar.md)
|
|
380
411
|
|
|
381
412
|
---
|
|
@@ -500,6 +531,30 @@ class PaginatorFieldDto {
|
|
|
500
531
|
}
|
|
501
532
|
```
|
|
502
533
|
|
|
534
|
+
### BadgeFieldDto
|
|
535
|
+
Badge and chip configuration for the LiteBadge component.
|
|
536
|
+
|
|
537
|
+
```typescript
|
|
538
|
+
type BadgeVariant = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
539
|
+
type BadgeSize = 'small' | 'medium' | 'large';
|
|
540
|
+
|
|
541
|
+
class BadgeFieldDto {
|
|
542
|
+
label: string;
|
|
543
|
+
variant?: BadgeVariant; // Color variant (default: 'default')
|
|
544
|
+
size?: BadgeSize; // Size option (default: 'medium')
|
|
545
|
+
removable?: boolean; // Show remove button (default: false)
|
|
546
|
+
icon?: string; // SVG or HTML string for icon
|
|
547
|
+
|
|
548
|
+
constructor(
|
|
549
|
+
label: string,
|
|
550
|
+
variant: BadgeVariant = 'default',
|
|
551
|
+
size: BadgeSize = 'medium',
|
|
552
|
+
removable: boolean = false,
|
|
553
|
+
icon?: string
|
|
554
|
+
)
|
|
555
|
+
}
|
|
556
|
+
```
|
|
557
|
+
|
|
503
558
|
---
|
|
504
559
|
|
|
505
560
|
## Validation
|