ngx-lite-form 1.2.1-pr.27.20250923095649 → 1.2.2-pr.28.20250923104029
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 +139 -112
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
A modern, lightweight Angular form components library with TypeScript support, built-in validation, and responsive design.
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
## Features
|
|
7
6
|
|
|
8
7
|
- 🎯 **Input Component** - Text input with floating labels
|
|
@@ -11,12 +10,14 @@ A modern, lightweight Angular form components library with TypeScript support, b
|
|
|
11
10
|
- ☑️ **Multi-Select Component** - Multi-selection with inline display
|
|
12
11
|
- 🔘 **Radio Component** - Radio button groups for single selection
|
|
13
12
|
- ✅ **Checkbox Component** - Boolean input with validation support
|
|
13
|
+
- 📅 **Date Picker Component** - Advanced date selection with custom formatting
|
|
14
14
|
- 📎 **File Upload Component** - Drag & drop, camera capture, file management
|
|
15
|
-
-
|
|
16
|
-
-
|
|
15
|
+
- 🕒 **DateTime Picker Component** - Combined date & time selection
|
|
16
|
+
- 🔧 **TypeScript Support** - Fully typed with generics
|
|
17
17
|
- ✅ **Form Validation** - Integrated Angular Reactive Forms validation
|
|
18
18
|
- 🎨 **Customizable Styling** - SCSS-based theming system
|
|
19
19
|
- 📱 **Responsive Design** - Mobile-friendly components
|
|
20
|
+
- 🏗️ **Standalone Components** - Modern Angular architecture
|
|
20
21
|
|
|
21
22
|
## Installation
|
|
22
23
|
|
|
@@ -27,136 +28,153 @@ npm install ngx-lite-form
|
|
|
27
28
|
## Quick Usage
|
|
28
29
|
|
|
29
30
|
```typescript
|
|
30
|
-
import {
|
|
31
|
+
import { LiteInput, LiteSelect, LiteCheckbox } from 'ngx-lite-form';
|
|
31
32
|
import { FormControl, Validators } from '@angular/forms';
|
|
32
33
|
|
|
33
|
-
import { FieldDto, SelectFieldDto
|
|
34
|
+
import { FieldDto, SelectFieldDto } from 'ngx-lite-form';
|
|
34
35
|
|
|
35
36
|
@Component({
|
|
36
37
|
standalone: true,
|
|
37
|
-
imports: [
|
|
38
|
+
imports: [LiteInput, LiteSelect, LiteCheckbox],
|
|
38
39
|
template: `
|
|
39
40
|
<lite-input [control]="nameField"></lite-input>
|
|
40
|
-
<lite-textarea [control]="descriptionField"></lite-textarea>
|
|
41
|
-
<lite-checkbox [control]="agreeField"></lite-checkbox>
|
|
42
41
|
<lite-select [control]="statusField"></lite-select>
|
|
43
|
-
<lite-
|
|
44
|
-
<lite-radio [control]="priorityField"></lite-radio>
|
|
45
|
-
<lite-file [control]="fileField"></lite-file>
|
|
46
|
-
<lite-datetime [control]="datetimeField"></lite-datetime>
|
|
42
|
+
<lite-checkbox [control]="agreeField"></lite-checkbox>
|
|
47
43
|
`
|
|
48
44
|
})
|
|
49
45
|
export class MyFormComponent {
|
|
50
|
-
nameField = new FieldDto('Name', new FormControl(''));
|
|
51
|
-
descriptionField = new FieldDto('Description', new FormControl(''), 4);
|
|
46
|
+
nameField = new FieldDto('Name', new FormControl('', [Validators.required]));
|
|
52
47
|
agreeField = new FieldDto('I agree to terms', new FormControl<boolean>(false, { nonNullable: true }));
|
|
53
|
-
|
|
48
|
+
|
|
54
49
|
statusField = new SelectFieldDto(
|
|
55
50
|
'Status',
|
|
56
51
|
new FormControl(''),
|
|
57
52
|
['Active', 'Inactive'],
|
|
58
53
|
(option) => option
|
|
59
54
|
);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
'Priority',
|
|
63
|
-
new FormControl('', [Validators.required]),
|
|
64
|
-
['Low', 'Medium', 'High'],
|
|
65
|
-
(option) => option
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
skillsField = new MultiSelectFieldDto(
|
|
69
|
-
'Skills',
|
|
70
|
-
new FormControl<string[]>([]),
|
|
71
|
-
['JavaScript', 'TypeScript', 'Angular'],
|
|
72
|
-
(option) => option
|
|
73
|
-
);
|
|
74
|
-
fileField = new FileFieldDto('Attachments', new FormControl([]), {
|
|
75
|
-
multiple: true,
|
|
76
|
-
accept: 'image/*,application/pdf',
|
|
77
|
-
maxFileSize: 5 * 1024 * 1024,
|
|
78
|
-
maxFiles: 5,
|
|
79
|
-
showPreview: true
|
|
80
|
-
});
|
|
81
|
-
datetimeField = new FieldDto('Event Date & Time', new FormControl(''));
|
|
82
|
-
### LiteDateTime
|
|
83
|
-
Date & time picker component for selecting both date and time, with custom formatting and time granularity.
|
|
55
|
+
}
|
|
56
|
+
```
|
|
84
57
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- Time selection with hour and minute granularity
|
|
90
|
-
- Validation and error display
|
|
91
|
-
- Responsive and accessible
|
|
58
|
+
## Components
|
|
59
|
+
|
|
60
|
+
### LiteInput
|
|
61
|
+
Basic text input with floating label animation and validation display.
|
|
92
62
|
|
|
93
|
-
**Example:**
|
|
94
63
|
```typescript
|
|
95
|
-
import { FieldDto } from 'ngx-lite-form';
|
|
96
|
-
|
|
64
|
+
import { LiteInput, FieldDto } from 'ngx-lite-form';
|
|
65
|
+
|
|
66
|
+
nameField = new FieldDto('Full Name', new FormControl('', [Validators.required]));
|
|
97
67
|
```
|
|
98
|
-
|
|
99
|
-
|
|
68
|
+
|
|
69
|
+
### LiteTextarea
|
|
70
|
+
Multi-line text input that supports configurable rows.
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { LiteTextarea, FieldDto } from 'ngx-lite-form';
|
|
74
|
+
|
|
75
|
+
descriptionField = new FieldDto('Description', new FormControl(''), 4);
|
|
100
76
|
```
|
|
101
|
-
}
|
|
102
|
-
### LiteFile
|
|
103
|
-
File upload component with drag & drop, badge, file management panel, and camera capture support.
|
|
104
77
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- File management panel with upload area and action buttons
|
|
109
|
-
- Camera capture on devices with a camera
|
|
110
|
-
- Validation: max files, max file size, file type restrictions
|
|
111
|
-
- Image preview for image files
|
|
112
|
-
- Progress tracking for uploads
|
|
113
|
-
- Accessibility: keyboard and screen reader friendly
|
|
114
|
-
|
|
115
|
-
**Example:**
|
|
78
|
+
### LitePassword
|
|
79
|
+
Password input with strength indicator, toggle visibility, and advanced validation.
|
|
80
|
+
|
|
116
81
|
```typescript
|
|
117
|
-
import {
|
|
118
|
-
|
|
82
|
+
import { LitePassword, FieldDto } from 'ngx-lite-form';
|
|
83
|
+
|
|
84
|
+
passwordField = new FieldDto('Password', new FormControl('', [
|
|
85
|
+
Validators.required,
|
|
86
|
+
Validators.minLength(8)
|
|
87
|
+
]));
|
|
119
88
|
```
|
|
120
|
-
|
|
121
|
-
|
|
89
|
+
|
|
90
|
+
### LiteSelect
|
|
91
|
+
Single-selection dropdown with search/filtering functionality.
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { LiteSelect, SelectFieldDto } from 'ngx-lite-form';
|
|
95
|
+
|
|
96
|
+
statusField = new SelectFieldDto(
|
|
97
|
+
'Status',
|
|
98
|
+
new FormControl(''),
|
|
99
|
+
['Active', 'Inactive', 'Pending'],
|
|
100
|
+
(option) => option
|
|
101
|
+
);
|
|
122
102
|
```
|
|
123
103
|
|
|
124
|
-
###
|
|
125
|
-
|
|
104
|
+
### LiteMultiSelect
|
|
105
|
+
Multi-selection dropdown with inline selected items display and dynamic height adjustment.
|
|
126
106
|
|
|
127
107
|
```typescript
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
108
|
+
import { LiteMultiSelect, MultiSelectFieldDto } from 'ngx-lite-form';
|
|
109
|
+
|
|
110
|
+
skillsField = new MultiSelectFieldDto(
|
|
111
|
+
'Skills',
|
|
112
|
+
new FormControl<string[]>([]),
|
|
113
|
+
['JavaScript', 'TypeScript', 'Angular'],
|
|
114
|
+
(option) => option
|
|
115
|
+
);
|
|
137
116
|
```
|
|
117
|
+
|
|
118
|
+
### LiteRadio
|
|
119
|
+
Radio button group component for single selection from multiple options.
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { LiteRadio, RadioFieldDto } from 'ngx-lite-form';
|
|
123
|
+
|
|
124
|
+
priorityField = new RadioFieldDto(
|
|
125
|
+
'Priority',
|
|
126
|
+
new FormControl('', [Validators.required]),
|
|
127
|
+
['Low', 'Medium', 'High'],
|
|
128
|
+
(option) => option
|
|
129
|
+
);
|
|
138
130
|
```
|
|
139
131
|
|
|
140
|
-
|
|
132
|
+
### LiteCheckbox
|
|
133
|
+
Checkbox component for boolean input with validation support.
|
|
141
134
|
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
```typescript
|
|
136
|
+
import { LiteCheckbox, FieldDto } from 'ngx-lite-form';
|
|
144
137
|
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
agreeField = new FieldDto('I agree to terms', new FormControl<boolean>(false, {
|
|
139
|
+
nonNullable: true,
|
|
140
|
+
validators: [Validators.requiredTrue]
|
|
141
|
+
}));
|
|
142
|
+
```
|
|
147
143
|
|
|
148
|
-
###
|
|
149
|
-
|
|
150
|
-
- Search/filtering functionality
|
|
151
|
-
- Custom display formatting
|
|
152
|
-
- Keyboard navigation
|
|
144
|
+
### LiteDate
|
|
145
|
+
Advanced date picker component with single date and date range selection, custom formatting, and intelligent calendar positioning.
|
|
153
146
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
147
|
+
```typescript
|
|
148
|
+
import { LiteDate, FieldDto } from 'ngx-lite-form';
|
|
149
|
+
|
|
150
|
+
birthDateField = new FieldDto('Birth Date', new FormControl(''));
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### LiteDateTime
|
|
154
|
+
Date & time picker component for selecting both date and time, with custom formatting and time granularity.
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
import { LiteDateTime, FieldDto } from 'ngx-lite-form';
|
|
158
|
+
|
|
159
|
+
eventDateTimeField = new FieldDto('Event Date & Time', new FormControl(''));
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### LiteFile
|
|
163
|
+
File upload component with drag & drop, badge, file management panel, and camera capture support.
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
import { LiteFile, FileFieldDto } from 'ngx-lite-form';
|
|
167
|
+
|
|
168
|
+
fileField = new FileFieldDto(
|
|
169
|
+
'Upload Files',
|
|
170
|
+
new FormControl([]),
|
|
171
|
+
true, // multiple
|
|
172
|
+
'image/*,application/pdf', // accept
|
|
173
|
+
5 * 1024 * 1024, // maxFileSize (5MB)
|
|
174
|
+
5, // maxFiles
|
|
175
|
+
true // showPreview
|
|
176
|
+
);
|
|
177
|
+
```
|
|
160
178
|
|
|
161
179
|
## Data Transfer Objects
|
|
162
180
|
|
|
@@ -189,6 +207,29 @@ class MultiSelectFieldDto<T> {
|
|
|
189
207
|
}
|
|
190
208
|
```
|
|
191
209
|
|
|
210
|
+
### RadioFieldDto<T>
|
|
211
|
+
```typescript
|
|
212
|
+
class RadioFieldDto<T> {
|
|
213
|
+
label: string;
|
|
214
|
+
formControl: FormControl<T>;
|
|
215
|
+
options: T[];
|
|
216
|
+
displayWith: (option: T) => string;
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### FileFieldDto
|
|
221
|
+
```typescript
|
|
222
|
+
class FileFieldDto {
|
|
223
|
+
label: string;
|
|
224
|
+
formControl: FormControl;
|
|
225
|
+
multiple?: boolean;
|
|
226
|
+
accept?: string;
|
|
227
|
+
maxFileSize?: number;
|
|
228
|
+
maxFiles?: number;
|
|
229
|
+
showPreview?: boolean;
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
192
233
|
## Validation
|
|
193
234
|
|
|
194
235
|
All components support Angular Reactive Forms validators:
|
|
@@ -220,7 +261,7 @@ The library includes comprehensive SCSS styling. To customize:
|
|
|
220
261
|
|
|
221
262
|
### Building the Library
|
|
222
263
|
```bash
|
|
223
|
-
ng build
|
|
264
|
+
ng build lite-form
|
|
224
265
|
```
|
|
225
266
|
|
|
226
267
|
### Publishing
|
|
@@ -231,7 +272,7 @@ npm publish
|
|
|
231
272
|
|
|
232
273
|
### Running Tests
|
|
233
274
|
```bash
|
|
234
|
-
ng test
|
|
275
|
+
ng test ui-sandbox
|
|
235
276
|
```
|
|
236
277
|
|
|
237
278
|
## Browser Support
|
|
@@ -247,17 +288,3 @@ MIT License
|
|
|
247
288
|
---
|
|
248
289
|
|
|
249
290
|
For complete documentation and examples, visit the [main repository](https://github.com/liangk/lite-form).
|
|
250
|
-
|
|
251
|
-
## Running end-to-end tests
|
|
252
|
-
|
|
253
|
-
For end-to-end (e2e) testing, run:
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
ng e2e
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
260
|
-
|
|
261
|
-
## Additional Resources
|
|
262
|
-
|
|
263
|
-
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-lite-form",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2-pr.28.20250923104029",
|
|
4
4
|
"description": "A lightweight Angular form library with reusable input, textarea, select, multi-select, radio, checkbox, date picker and password components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|