@sotoa-ui/dynamic-form 0.0.9 → 0.0.11
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/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sotoa-ui/dynamic-form",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
5
|
+
"@angular/common": "^21.0.6",
|
|
6
|
+
"@angular/core": "^21.0.6"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"tslib": "^2.3.0"
|
|
@@ -3,6 +3,7 @@ import { Type, OnInit, DestroyRef, InputSignal, OutputEmitterRef } from '@angula
|
|
|
3
3
|
import { ValidatorFn, AsyncValidatorFn, FormGroup, FormControl, FormArray, ControlValueAccessor, AbstractControl } from '@angular/forms';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { MatBadgePosition, MatBadgeSize } from '@angular/material/badge';
|
|
6
|
+
import { SeparatorKey } from '@angular/material/chips';
|
|
6
7
|
|
|
7
8
|
interface AcCondition {
|
|
8
9
|
type: 'condition';
|
|
@@ -298,6 +299,7 @@ interface AcFieldCheckboxConfig extends AbstractControlConfig {
|
|
|
298
299
|
|
|
299
300
|
interface AcFieldSelectConfig extends AbstractControlConfig {
|
|
300
301
|
type: 'select';
|
|
302
|
+
multiple?: boolean;
|
|
301
303
|
options: any[] | Observable<any[]>;
|
|
302
304
|
groupLabelKey?: string;
|
|
303
305
|
groupOptionsKey?: string;
|
|
@@ -345,12 +347,39 @@ interface AcFieldTextareaConfig extends AbstractControlConfig {
|
|
|
345
347
|
interface AcFieldDateConfig extends AbstractControlConfig {
|
|
346
348
|
type: 'date';
|
|
347
349
|
readonly?: boolean;
|
|
348
|
-
|
|
350
|
+
locale?: string;
|
|
349
351
|
format?: string;
|
|
350
352
|
minDate?: any;
|
|
351
353
|
maxDate?: any;
|
|
352
354
|
filter?: (d: any | null, field?: AcFieldDateConfig, group?: FormGroup) => boolean;
|
|
353
355
|
touchUi?: boolean;
|
|
356
|
+
closeCalendarLabel?: string;
|
|
357
|
+
suffixes?: AcAffix[];
|
|
358
|
+
prefixes?: AcAffix[];
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
interface ConfirmDialogData {
|
|
362
|
+
title?: string;
|
|
363
|
+
message?: string;
|
|
364
|
+
confirmLabel?: string;
|
|
365
|
+
cancelLabel?: string;
|
|
366
|
+
closeLabel?: string;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
interface AcBadgeOptions {
|
|
370
|
+
position?: MatBadgePosition;
|
|
371
|
+
size?: MatBadgeSize;
|
|
372
|
+
description?: string;
|
|
373
|
+
disabled?: boolean;
|
|
374
|
+
hidden?: boolean;
|
|
375
|
+
noOverlap?: boolean;
|
|
376
|
+
}
|
|
377
|
+
type AcButtonType = 'submit' | 'reset' | 'button' | 'link';
|
|
378
|
+
type AcMaterialButtonType = 'outlined' | 'elevated' | 'filled' | 'tonal' | 'icon' | 'fab' | 'mini-fab' | 'menu';
|
|
379
|
+
interface MatIconConfig {
|
|
380
|
+
fontIcon: string;
|
|
381
|
+
fontSet?: string;
|
|
382
|
+
ariaLabel?: string;
|
|
354
383
|
}
|
|
355
384
|
|
|
356
385
|
interface AcFieldFileConfig extends AbstractControlConfig {
|
|
@@ -358,6 +387,24 @@ interface AcFieldFileConfig extends AbstractControlConfig {
|
|
|
358
387
|
multiple?: boolean;
|
|
359
388
|
maxNbRow?: number;
|
|
360
389
|
accept?: string;
|
|
390
|
+
addButton?: {
|
|
391
|
+
label?: string;
|
|
392
|
+
className?: string;
|
|
393
|
+
matButtonType?: AcMaterialButtonType;
|
|
394
|
+
matIcon?: string;
|
|
395
|
+
title?: string;
|
|
396
|
+
ariaLabel?: string;
|
|
397
|
+
};
|
|
398
|
+
deleteButton?: {
|
|
399
|
+
label?: string;
|
|
400
|
+
className?: string;
|
|
401
|
+
matButtonType?: AcMaterialButtonType;
|
|
402
|
+
matIcon?: string;
|
|
403
|
+
title?: string;
|
|
404
|
+
ariaLabel?: string;
|
|
405
|
+
};
|
|
406
|
+
confirmDelete?: boolean;
|
|
407
|
+
confirmDeleteData?: ConfirmDialogData;
|
|
361
408
|
onAddFile?: (file: File | null) => void;
|
|
362
409
|
onDeleteFile?: (file: File) => void;
|
|
363
410
|
}
|
|
@@ -413,7 +460,17 @@ interface AcFieldCustomConfig<T> extends AbstractControlConfig {
|
|
|
413
460
|
data?: T;
|
|
414
461
|
}
|
|
415
462
|
|
|
416
|
-
|
|
463
|
+
interface AcFieldChipsConfig extends AbstractControlConfig {
|
|
464
|
+
type: 'chips';
|
|
465
|
+
options?: string[];
|
|
466
|
+
separatorKeysCodes?: (number | SeparatorKey)[];
|
|
467
|
+
autocomplete?: AutocompleteAttribute;
|
|
468
|
+
readonly?: boolean;
|
|
469
|
+
suffixes?: AcAffix[];
|
|
470
|
+
prefixes?: AcAffix[];
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
type AcControlConfig = AcFieldCheckboxConfig | AcFieldInputConfig | AcFieldDateConfig | AcFieldTextareaConfig | AcFieldSelectConfig | AcFieldAutocompleteConfig | AcFieldRadioButtonConfig | AcFieldFileConfig | AcFieldEditorConfig | AcFieldToggleConfig | AcFieldPasswordConfig | AcFieldCustomConfig<any> | AcFieldChipsConfig;
|
|
417
474
|
|
|
418
475
|
declare class DynamicFormService {
|
|
419
476
|
private readonly fb;
|
|
@@ -464,22 +521,6 @@ declare class AbstractControlFieldComponent<T extends AbstractControlConfig> ext
|
|
|
464
521
|
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractControlFieldComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
465
522
|
}
|
|
466
523
|
|
|
467
|
-
interface AcBadgeOptions {
|
|
468
|
-
position?: MatBadgePosition;
|
|
469
|
-
size?: MatBadgeSize;
|
|
470
|
-
description?: string;
|
|
471
|
-
disabled?: boolean;
|
|
472
|
-
hidden?: boolean;
|
|
473
|
-
noOverlap?: boolean;
|
|
474
|
-
}
|
|
475
|
-
type AcButtonType = 'submit' | 'reset' | 'button' | 'link';
|
|
476
|
-
type AcMaterialButtonType = 'outlined' | 'elevated' | 'filled' | 'tonal' | 'icon' | 'fab' | 'mini-fab' | 'menu';
|
|
477
|
-
interface MatIconConfig {
|
|
478
|
-
fontIcon: string;
|
|
479
|
-
fontSet?: string;
|
|
480
|
-
ariaLabel?: string;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
524
|
interface AcDynamicForm {
|
|
484
525
|
fields: (AcFieldConfig | AcTextConfig)[];
|
|
485
526
|
buttons?: AcButton[];
|
|
@@ -563,6 +604,7 @@ declare class MaterialDynamicFormComponent {
|
|
|
563
604
|
formCancel: OutputEmitterRef<void>;
|
|
564
605
|
formSubmit: OutputEmitterRef<FormGroup>;
|
|
565
606
|
formChange: OutputEmitterRef<FormGroup>;
|
|
607
|
+
formInit: OutputEmitterRef<FormGroup>;
|
|
566
608
|
get form(): FormGroup | undefined;
|
|
567
609
|
get controls(): {
|
|
568
610
|
[key: string]: AbstractControl;
|
|
@@ -580,7 +622,7 @@ declare class MaterialDynamicFormComponent {
|
|
|
580
622
|
handleSubmit(event?: Event): void;
|
|
581
623
|
focusFirstInvalidControl(): void;
|
|
582
624
|
static ɵfac: i0.ɵɵFactoryDeclaration<MaterialDynamicFormComponent, never>;
|
|
583
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MaterialDynamicFormComponent, "sot-material-dynamic-form", ["dynamicForm"], { "config": { "alias": "config"; "required": true; "isSignal": true; }; "initialValues": { "alias": "initialValues"; "required": false; "isSignal": true; }; }, { "formCancel": "formCancel"; "formSubmit": "formSubmit"; "formChange": "formChange"; }, never, never, true, never>;
|
|
625
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MaterialDynamicFormComponent, "sot-material-dynamic-form", ["dynamicForm"], { "config": { "alias": "config"; "required": true; "isSignal": true; }; "initialValues": { "alias": "initialValues"; "required": false; "isSignal": true; }; }, { "formCancel": "formCancel"; "formSubmit": "formSubmit"; "formChange": "formChange"; "formInit": "formInit"; }, never, never, true, never>;
|
|
584
626
|
}
|
|
585
627
|
|
|
586
628
|
declare class MaterialDynamicFormModalComponent implements OnInit {
|
|
@@ -653,5 +695,5 @@ declare class ClassicDynamicFormComponent {
|
|
|
653
695
|
static ɵcmp: i0.ɵɵComponentDeclaration<ClassicDynamicFormComponent, "sot-classic-dynamic-form", ["dynamicForm"], { "config": { "alias": "config"; "required": true; "isSignal": true; }; "initialValues": { "alias": "initialValues"; "required": false; "isSignal": true; }; }, { "formCancel": "formCancel"; "formSubmit": "formSubmit"; "formChange": "formChange"; }, never, never, true, never>;
|
|
654
696
|
}
|
|
655
697
|
|
|
656
|
-
export { AbstractControlFieldComponent, AbstractFieldComponent, AutocompleteAttribute, ClassicDynamicFormComponent, ConditionsService, DsfrDynamicFormComponent, DynamicFormService, MaterialDynamicFormComponent, MaterialDynamicFormModalComponent };
|
|
657
|
-
export type { AbstractControlConfig, AbstractFieldConfig, AcAffix, AcArrayConfig, AcBadgeOptions, AcButton, AcButtonType, AcControlConfig, AcDynamicForm, AcDynamicFormModal, AcField, AcFieldCheckboxConfig, AcFieldConfig, AcFieldCustomConfig, AcFieldInputConfig, AcFieldPasswordConfig, AcFieldRadioButtonConfig, AcFieldSelectConfig, AcFieldTextareaConfig, AcFieldToggleConfig, AcGroupConfig, AcMaterialButtonType, AcModalFormButton, AcModalFormResponse, AcRowConfig, AcTextConfig, AcValidator, DynamicFormData, MatIconConfig, PathArrayInstance, UpdateOnType };
|
|
698
|
+
export { AbstractControlFieldComponent, AbstractFieldComponent, AcCustomComponentField, AutocompleteAttribute, ClassicDynamicFormComponent, ConditionsService, DsfrDynamicFormComponent, DynamicFormService, MaterialDynamicFormComponent, MaterialDynamicFormModalComponent };
|
|
699
|
+
export type { AbstractControlConfig, AbstractFieldConfig, AcAffix, AcArrayConfig, AcBadgeOptions, AcButton, AcButtonType, AcControlConfig, AcDynamicForm, AcDynamicFormModal, AcField, AcFieldCheckboxConfig, AcFieldChipsConfig, AcFieldConfig, AcFieldCustomConfig, AcFieldDateConfig, AcFieldFileConfig, AcFieldInputConfig, AcFieldPasswordConfig, AcFieldRadioButtonConfig, AcFieldSelectConfig, AcFieldTextareaConfig, AcFieldToggleConfig, AcGroupConfig, AcMaterialButtonType, AcModalFormButton, AcModalFormResponse, AcRowConfig, AcTextConfig, AcValidator, ConfirmDialogData, DynamicFormData, MatIconConfig, PathArrayInstance, UpdateOnType };
|