ngx-lite-form 1.1.9 → 1.2.1-pr.26.20250923091817
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/fesm2022/ngx-lite-form.mjs +780 -645
- package/fesm2022/ngx-lite-form.mjs.map +1 -1
- package/index.d.ts +118 -74
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import { FormControl, AbstractControl } from '@angular/forms';
|
|
1
2
|
import * as _angular_core from '@angular/core';
|
|
2
3
|
import { ElementRef, AfterViewInit } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
|
-
import * as i2 from '@angular/forms';
|
|
5
|
-
import { FormControl, AbstractControl } from '@angular/forms';
|
|
6
4
|
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
7
5
|
|
|
8
6
|
declare class FieldDto {
|
|
@@ -15,20 +13,20 @@ declare class FieldDto {
|
|
|
15
13
|
declare abstract class BaseSelectFieldDto<T = any> {
|
|
16
14
|
label: string;
|
|
17
15
|
options: T[];
|
|
18
|
-
displayWith: (
|
|
19
|
-
constructor(label: string, options: T[], displayWith: (
|
|
16
|
+
displayWith: (_option: T) => string;
|
|
17
|
+
constructor(label: string, options: T[], displayWith: (_option: T) => string);
|
|
20
18
|
}
|
|
21
19
|
declare class SelectFieldDto<T = any> extends BaseSelectFieldDto<T> {
|
|
22
20
|
formControl: FormControl<T>;
|
|
23
|
-
constructor(label: string, formControl: FormControl<T>, options: T[], displayWith: (
|
|
21
|
+
constructor(label: string, formControl: FormControl<T>, options: T[], displayWith: (_option: T) => string);
|
|
24
22
|
}
|
|
25
23
|
declare class MultiSelectFieldDto<T = any> extends BaseSelectFieldDto<T> {
|
|
26
24
|
formControl: FormControl<T[]>;
|
|
27
|
-
constructor(label: string, formControl: FormControl<T[]>, options: T[], displayWith: (
|
|
25
|
+
constructor(label: string, formControl: FormControl<T[]>, options: T[], displayWith: (_option: T) => string);
|
|
28
26
|
}
|
|
29
27
|
declare class RadioFieldDto<T = any> extends BaseSelectFieldDto<T> {
|
|
30
28
|
formControl: FormControl<T>;
|
|
31
|
-
constructor(label: string, formControl: FormControl<T>, options: T[], displayWith: (
|
|
29
|
+
constructor(label: string, formControl: FormControl<T>, options: T[], displayWith: (_option: T) => string);
|
|
32
30
|
}
|
|
33
31
|
declare class FileFieldDto {
|
|
34
32
|
label: string;
|
|
@@ -42,6 +40,26 @@ declare class FileFieldDto {
|
|
|
42
40
|
maxFiles?: number, showPreview?: boolean);
|
|
43
41
|
}
|
|
44
42
|
type SnackbarType = 'done' | 'warn' | 'error';
|
|
43
|
+
declare class PaginatorFieldDto {
|
|
44
|
+
currentPage: number;
|
|
45
|
+
totalItems: number;
|
|
46
|
+
itemsPerPage: number;
|
|
47
|
+
constructor(currentPage?: number, totalItems?: number, itemsPerPage?: number);
|
|
48
|
+
}
|
|
49
|
+
interface TableColumn {
|
|
50
|
+
key: string;
|
|
51
|
+
label: string;
|
|
52
|
+
flex?: string;
|
|
53
|
+
sortable?: boolean;
|
|
54
|
+
cellTemplate?: (value: any, row: any) => string;
|
|
55
|
+
}
|
|
56
|
+
declare class TableFieldDto<T = any> {
|
|
57
|
+
columns: TableColumn[];
|
|
58
|
+
data: T[];
|
|
59
|
+
showPaginator?: boolean;
|
|
60
|
+
paginatorConfig: PaginatorFieldDto;
|
|
61
|
+
constructor(columns: TableColumn[], data: T[], showPaginator?: boolean, paginatorConfig?: PaginatorFieldDto);
|
|
62
|
+
}
|
|
45
63
|
|
|
46
64
|
/**
|
|
47
65
|
* Utility class for form-related helper functions
|
|
@@ -122,13 +140,13 @@ declare class LiteTextarea {
|
|
|
122
140
|
}
|
|
123
141
|
|
|
124
142
|
declare class LiteSelect {
|
|
125
|
-
private
|
|
143
|
+
private _elementRef;
|
|
126
144
|
inEdit: _angular_core.InputSignal<boolean>;
|
|
127
145
|
control: _angular_core.InputSignal<SelectFieldDto<any>>;
|
|
128
146
|
showOptions: string;
|
|
129
147
|
inputText: string;
|
|
130
148
|
readonly FormUtils: typeof FormUtils;
|
|
131
|
-
constructor(
|
|
149
|
+
constructor(_elementRef: ElementRef);
|
|
132
150
|
onDocumentClick(event: MouseEvent): void;
|
|
133
151
|
isRequired(): boolean;
|
|
134
152
|
hasErrors(): boolean;
|
|
@@ -145,7 +163,7 @@ declare class LiteSelect {
|
|
|
145
163
|
}
|
|
146
164
|
|
|
147
165
|
declare class LiteMultiSelect implements AfterViewInit {
|
|
148
|
-
private
|
|
166
|
+
private _elementRef;
|
|
149
167
|
inEdit: _angular_core.InputSignal<boolean>;
|
|
150
168
|
control: _angular_core.InputSignal<MultiSelectFieldDto<any>>;
|
|
151
169
|
showOptions: string;
|
|
@@ -155,7 +173,7 @@ declare class LiteMultiSelect implements AfterViewInit {
|
|
|
155
173
|
containerHeight: string;
|
|
156
174
|
selectedItemsRef?: ElementRef;
|
|
157
175
|
readonly FormUtils: typeof FormUtils;
|
|
158
|
-
constructor(
|
|
176
|
+
constructor(_elementRef: ElementRef);
|
|
159
177
|
ngAfterViewInit(): void;
|
|
160
178
|
onDocumentClick(event: MouseEvent): void;
|
|
161
179
|
isRequired(): boolean;
|
|
@@ -223,7 +241,7 @@ interface DateRangeFieldDto extends Omit<FieldDto, 'formControl'> {
|
|
|
223
241
|
formControl: FormControl<string[]>;
|
|
224
242
|
}
|
|
225
243
|
declare class LiteDate {
|
|
226
|
-
private
|
|
244
|
+
private _elementRef;
|
|
227
245
|
inEdit: _angular_core.InputSignal<boolean>;
|
|
228
246
|
control: _angular_core.InputSignal<FieldDto | DateRangeFieldDto>;
|
|
229
247
|
format: _angular_core.InputSignal<string>;
|
|
@@ -237,7 +255,7 @@ declare class LiteDate {
|
|
|
237
255
|
secondCalendarDays: _angular_core.Signal<CalendarDay[]>;
|
|
238
256
|
private getMonthDays;
|
|
239
257
|
readonly FormUtils: typeof FormUtils;
|
|
240
|
-
constructor(
|
|
258
|
+
constructor(_elementRef: ElementRef);
|
|
241
259
|
onDocumentClick(event: Event): void;
|
|
242
260
|
isRequired(): boolean;
|
|
243
261
|
hasErrors(): boolean;
|
|
@@ -261,6 +279,56 @@ declare class LiteDate {
|
|
|
261
279
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LiteDate, "lite-date", never, { "inEdit": { "alias": "inEdit"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "range": { "alias": "range"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
262
280
|
}
|
|
263
281
|
|
|
282
|
+
interface CalendarDateTime {
|
|
283
|
+
date: Date;
|
|
284
|
+
day: number;
|
|
285
|
+
isOtherMonth: boolean;
|
|
286
|
+
isToday: boolean;
|
|
287
|
+
isSelected: boolean;
|
|
288
|
+
}
|
|
289
|
+
declare class LiteDateTime {
|
|
290
|
+
private _elementRef;
|
|
291
|
+
inEdit: _angular_core.InputSignal<boolean>;
|
|
292
|
+
control: _angular_core.InputSignal<FieldDto>;
|
|
293
|
+
format: _angular_core.InputSignal<string>;
|
|
294
|
+
currentMonth: _angular_core.WritableSignal<Date>;
|
|
295
|
+
showCalendar: _angular_core.WritableSignal<boolean>;
|
|
296
|
+
calendarPosition: _angular_core.WritableSignal<"bottom" | "top">;
|
|
297
|
+
formattedValue: _angular_core.WritableSignal<string>;
|
|
298
|
+
hourSet: number[];
|
|
299
|
+
minSet: number[];
|
|
300
|
+
selectedHour: number;
|
|
301
|
+
selectedMinute: number;
|
|
302
|
+
selectedDateTime: CalendarDateTime | null;
|
|
303
|
+
calendarDays: _angular_core.Signal<CalendarDateTime[]>;
|
|
304
|
+
private getMonthDays;
|
|
305
|
+
readonly FormUtils: typeof FormUtils;
|
|
306
|
+
constructor(_elementRef: ElementRef);
|
|
307
|
+
onDocumentClick(event: Event): void;
|
|
308
|
+
isRequired(): boolean;
|
|
309
|
+
hasErrors(): boolean;
|
|
310
|
+
getErrorMessage(): string[];
|
|
311
|
+
onDateChange(event: Event): void;
|
|
312
|
+
onSelectHour(hour: number): void;
|
|
313
|
+
onSelectMinute(minute: number): void;
|
|
314
|
+
private setDateTimeSelected;
|
|
315
|
+
private parseFormattedDate;
|
|
316
|
+
getDisplayValue(): string;
|
|
317
|
+
private formatDate;
|
|
318
|
+
toggleCalendar(): void;
|
|
319
|
+
closeCalendar(): void;
|
|
320
|
+
private setCalendarToSelectedDate;
|
|
321
|
+
private calculateCalendarPosition;
|
|
322
|
+
getMonthYearDisplay(): string;
|
|
323
|
+
previousMonth(): void;
|
|
324
|
+
nextMonth(): void;
|
|
325
|
+
selectDate(day: CalendarDateTime): void;
|
|
326
|
+
private isSameDay;
|
|
327
|
+
private toLocalISOString;
|
|
328
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LiteDateTime, never>;
|
|
329
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LiteDateTime, "lite-datetime", never, { "inEdit": { "alias": "inEdit"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
330
|
+
}
|
|
331
|
+
|
|
264
332
|
declare class LitePassword {
|
|
265
333
|
inEdit: _angular_core.InputSignal<boolean>;
|
|
266
334
|
control: _angular_core.InputSignal<FieldDto>;
|
|
@@ -296,7 +364,7 @@ interface FileItem {
|
|
|
296
364
|
error?: string;
|
|
297
365
|
}
|
|
298
366
|
declare class LiteFile {
|
|
299
|
-
private
|
|
367
|
+
private _sanitizer;
|
|
300
368
|
file_icon: string;
|
|
301
369
|
fileInput: ElementRef<HTMLInputElement>;
|
|
302
370
|
cameraInput: ElementRef<HTMLInputElement>;
|
|
@@ -315,7 +383,7 @@ declare class LiteFile {
|
|
|
315
383
|
maxFileSize: _angular_core.Signal<number>;
|
|
316
384
|
maxFiles: _angular_core.Signal<number>;
|
|
317
385
|
showPreview: _angular_core.Signal<boolean>;
|
|
318
|
-
constructor(
|
|
386
|
+
constructor(_sanitizer: DomSanitizer);
|
|
319
387
|
isRequired(): boolean;
|
|
320
388
|
hasFormErrors(): boolean;
|
|
321
389
|
getErrorMessage(): string[];
|
|
@@ -342,62 +410,6 @@ declare class LiteFile {
|
|
|
342
410
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LiteFile, "lite-file", never, { "inEdit": { "alias": "inEdit"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
343
411
|
}
|
|
344
412
|
|
|
345
|
-
interface CalendarDateTime {
|
|
346
|
-
date: Date;
|
|
347
|
-
day: number;
|
|
348
|
-
isOtherMonth: boolean;
|
|
349
|
-
isToday: boolean;
|
|
350
|
-
isSelected: boolean;
|
|
351
|
-
}
|
|
352
|
-
declare class LiteDateTime {
|
|
353
|
-
private elementRef;
|
|
354
|
-
inEdit: _angular_core.InputSignal<boolean>;
|
|
355
|
-
control: _angular_core.InputSignal<FieldDto>;
|
|
356
|
-
format: _angular_core.InputSignal<string>;
|
|
357
|
-
currentMonth: _angular_core.WritableSignal<Date>;
|
|
358
|
-
showCalendar: _angular_core.WritableSignal<boolean>;
|
|
359
|
-
calendarPosition: _angular_core.WritableSignal<"bottom" | "top">;
|
|
360
|
-
formattedValue: _angular_core.WritableSignal<string>;
|
|
361
|
-
hourSet: number[];
|
|
362
|
-
minSet: number[];
|
|
363
|
-
selectedHour: number;
|
|
364
|
-
selectedMinute: number;
|
|
365
|
-
selectedDateTime: CalendarDateTime | null;
|
|
366
|
-
calendarDays: _angular_core.Signal<CalendarDateTime[]>;
|
|
367
|
-
private getMonthDays;
|
|
368
|
-
readonly FormUtils: typeof FormUtils;
|
|
369
|
-
constructor(elementRef: ElementRef);
|
|
370
|
-
onDocumentClick(event: Event): void;
|
|
371
|
-
isRequired(): boolean;
|
|
372
|
-
hasErrors(): boolean;
|
|
373
|
-
getErrorMessage(): string[];
|
|
374
|
-
onDateChange(event: Event): void;
|
|
375
|
-
onSelectHour(hour: number): void;
|
|
376
|
-
onSelectMinute(minute: number): void;
|
|
377
|
-
private setDateTimeSelected;
|
|
378
|
-
private parseFormattedDate;
|
|
379
|
-
getDisplayValue(): string;
|
|
380
|
-
private formatDate;
|
|
381
|
-
toggleCalendar(): void;
|
|
382
|
-
closeCalendar(): void;
|
|
383
|
-
private setCalendarToSelectedDate;
|
|
384
|
-
private calculateCalendarPosition;
|
|
385
|
-
getMonthYearDisplay(): string;
|
|
386
|
-
previousMonth(): void;
|
|
387
|
-
nextMonth(): void;
|
|
388
|
-
selectDate(day: CalendarDateTime): void;
|
|
389
|
-
private isSameDay;
|
|
390
|
-
private toLocalISOString;
|
|
391
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LiteDateTime, never>;
|
|
392
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LiteDateTime, "lite-datetime", never, { "inEdit": { "alias": "inEdit"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
declare class LiteFormModule {
|
|
396
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LiteFormModule, never>;
|
|
397
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<LiteFormModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof LiteInput, typeof LiteTextarea, typeof LiteSelect, typeof LiteMultiSelect, typeof LiteRadio, typeof LiteCheckbox, typeof LiteDate, typeof LitePassword, typeof LiteFile, typeof LiteDateTime], [typeof LiteInput, typeof LiteTextarea, typeof LiteSelect, typeof LiteMultiSelect, typeof LiteRadio, typeof LiteCheckbox, typeof LiteDate, typeof LitePassword, typeof LiteFile, typeof LiteDateTime]>;
|
|
398
|
-
static ɵinj: _angular_core.ɵɵInjectorDeclaration<LiteFormModule>;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
413
|
declare class LiteSnackbarService {
|
|
402
414
|
private timeoutId;
|
|
403
415
|
private snackbarElem;
|
|
@@ -410,5 +422,37 @@ declare class LiteSnackbarService {
|
|
|
410
422
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<LiteSnackbarService>;
|
|
411
423
|
}
|
|
412
424
|
|
|
413
|
-
|
|
414
|
-
|
|
425
|
+
declare class LitePaginator {
|
|
426
|
+
paginator: _angular_core.InputSignal<PaginatorFieldDto>;
|
|
427
|
+
pageChange: _angular_core.OutputEmitterRef<number>;
|
|
428
|
+
itemsPerPageChange: _angular_core.OutputEmitterRef<number>;
|
|
429
|
+
totalPages: _angular_core.Signal<number>;
|
|
430
|
+
hasPrevious: _angular_core.Signal<boolean>;
|
|
431
|
+
hasNext: _angular_core.Signal<boolean>;
|
|
432
|
+
startItem: _angular_core.Signal<number>;
|
|
433
|
+
endItem: _angular_core.Signal<number>;
|
|
434
|
+
constructor();
|
|
435
|
+
goToPrevious(): void;
|
|
436
|
+
goToNext(): void;
|
|
437
|
+
goToPage(page: number): void;
|
|
438
|
+
changeItemsPerPage(itemsPerPage: number): void;
|
|
439
|
+
getPageNumbers(): number[];
|
|
440
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LitePaginator, never>;
|
|
441
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LitePaginator, "lite-paginator", never, { "paginator": { "alias": "paginator"; "required": true; "isSignal": true; }; }, { "pageChange": "pageChange"; "itemsPerPageChange": "itemsPerPageChange"; }, never, never, true, never>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
declare class LiteTable<T = any> {
|
|
445
|
+
table: _angular_core.InputSignal<TableFieldDto<T>>;
|
|
446
|
+
pageChange: _angular_core.OutputEmitterRef<number>;
|
|
447
|
+
itemsPerPageChange: _angular_core.OutputEmitterRef<number>;
|
|
448
|
+
paginatedData: _angular_core.Signal<T[]>;
|
|
449
|
+
getCellValue(row: any, column: TableColumn): string;
|
|
450
|
+
private getValue;
|
|
451
|
+
onPageChange(page: number): void;
|
|
452
|
+
onItemsPerPageChange(itemsPerPage: number): void;
|
|
453
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LiteTable<any>, never>;
|
|
454
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LiteTable<any>, "lite-table", never, { "table": { "alias": "table"; "required": true; "isSignal": true; }; }, { "pageChange": "pageChange"; "itemsPerPageChange": "itemsPerPageChange"; }, never, never, true, never>;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export { BaseSelectFieldDto, FieldDto, FileFieldDto, FormUtils, LiteCheckbox, LiteDate, LiteDateTime, LiteFile, LiteInput, LiteMultiSelect, LitePaginator, LitePassword, LiteRadio, LiteSelect, LiteSnackbarService, LiteTable, LiteTextarea, MultiSelectFieldDto, PaginatorFieldDto, RadioFieldDto, SelectFieldDto, TableFieldDto };
|
|
458
|
+
export type { DateRangeFieldDto, FileItem, SnackbarType, TableColumn };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-lite-form",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.2.1-pr.26.20250923091817",
|
|
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",
|