ngx-lite-form 1.4.5 → 1.4.9
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 +21 -9
- package/fesm2022/ngx-lite-form.mjs +45 -39
- package/fesm2022/ngx-lite-form.mjs.map +1 -1
- package/index.d.ts +9 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -136,7 +136,11 @@ import {
|
|
|
136
136
|
})
|
|
137
137
|
export class AppComponent {
|
|
138
138
|
// Basic input
|
|
139
|
-
nameField
|
|
139
|
+
nameField: FieldDto = {
|
|
140
|
+
label: 'Full Name',
|
|
141
|
+
formControl: new FormControl(''),
|
|
142
|
+
hint: 'Enter your full legal name'
|
|
143
|
+
} as FieldDto;
|
|
140
144
|
|
|
141
145
|
// Number input
|
|
142
146
|
ageField = new FieldDto('Age', new FormControl(0), 2, 'number');
|
|
@@ -159,7 +163,8 @@ export class AppComponent {
|
|
|
159
163
|
'Country',
|
|
160
164
|
new FormControl(''),
|
|
161
165
|
['USA', 'Canada', 'Mexico'],
|
|
162
|
-
(option) => option
|
|
166
|
+
(option) => option,
|
|
167
|
+
'Select your country of residence'
|
|
163
168
|
);
|
|
164
169
|
|
|
165
170
|
// Multi-select
|
|
@@ -191,13 +196,16 @@ export class AppComponent {
|
|
|
191
196
|
};
|
|
192
197
|
|
|
193
198
|
// File upload
|
|
194
|
-
fileField = new FileFieldDto(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
fileField = new FileFieldDto(
|
|
200
|
+
'Attachments',
|
|
201
|
+
new FormControl([]),
|
|
202
|
+
true, // multiple
|
|
203
|
+
'image/*,application/pdf', // accept
|
|
204
|
+
5 * 1024 * 1024, // maxFileSize
|
|
205
|
+
5, // maxFiles
|
|
206
|
+
true, // showPreview
|
|
207
|
+
'Upload up to 5 files (max 5MB each).' // hint
|
|
208
|
+
);
|
|
201
209
|
|
|
202
210
|
// Table with custom columns, sorting, and row selection
|
|
203
211
|
employeeTable = new TableFieldDto(
|
|
@@ -391,6 +399,8 @@ class FieldDto {
|
|
|
391
399
|
label: string;
|
|
392
400
|
formControl: FormControl;
|
|
393
401
|
rows?: number; // For textarea only
|
|
402
|
+
type?: 'text' | 'number';
|
|
403
|
+
hint?: string; // Helper text displayed below the field
|
|
394
404
|
}
|
|
395
405
|
```
|
|
396
406
|
|
|
@@ -402,6 +412,7 @@ abstract class BaseSelectFieldDto<T> {
|
|
|
402
412
|
label: string;
|
|
403
413
|
options: T[];
|
|
404
414
|
displayWith: (option: T) => string;
|
|
415
|
+
hint?: string; // Helper text displayed below the field
|
|
405
416
|
}
|
|
406
417
|
```
|
|
407
418
|
|
|
@@ -444,6 +455,7 @@ class FileFieldDto {
|
|
|
444
455
|
maxFileSize?: number; // Maximum file size in bytes (default: 10MB)
|
|
445
456
|
maxFiles?: number; // Maximum number of files allowed (default: 10)
|
|
446
457
|
showPreview?: boolean; // Show image previews (default: true)
|
|
458
|
+
hint?: string; // Helper text displayed below the field
|
|
447
459
|
}
|
|
448
460
|
```
|
|
449
461
|
|