@sotoa-ui/dynamic-form 0.0.8 → 0.0.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/package.json
CHANGED
|
@@ -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';
|
|
@@ -345,12 +346,39 @@ interface AcFieldTextareaConfig extends AbstractControlConfig {
|
|
|
345
346
|
interface AcFieldDateConfig extends AbstractControlConfig {
|
|
346
347
|
type: 'date';
|
|
347
348
|
readonly?: boolean;
|
|
348
|
-
|
|
349
|
+
locale?: string;
|
|
349
350
|
format?: string;
|
|
350
351
|
minDate?: any;
|
|
351
352
|
maxDate?: any;
|
|
352
353
|
filter?: (d: any | null, field?: AcFieldDateConfig, group?: FormGroup) => boolean;
|
|
353
354
|
touchUi?: boolean;
|
|
355
|
+
closeCalendarLabel?: string;
|
|
356
|
+
suffixes?: AcAffix[];
|
|
357
|
+
prefixes?: AcAffix[];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
interface ConfirmDialogData {
|
|
361
|
+
title?: string;
|
|
362
|
+
message?: string;
|
|
363
|
+
confirmLabel?: string;
|
|
364
|
+
cancelLabel?: string;
|
|
365
|
+
closeLabel?: string;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
interface AcBadgeOptions {
|
|
369
|
+
position?: MatBadgePosition;
|
|
370
|
+
size?: MatBadgeSize;
|
|
371
|
+
description?: string;
|
|
372
|
+
disabled?: boolean;
|
|
373
|
+
hidden?: boolean;
|
|
374
|
+
noOverlap?: boolean;
|
|
375
|
+
}
|
|
376
|
+
type AcButtonType = 'submit' | 'reset' | 'button' | 'link';
|
|
377
|
+
type AcMaterialButtonType = 'outlined' | 'elevated' | 'filled' | 'tonal' | 'icon' | 'fab' | 'mini-fab' | 'menu';
|
|
378
|
+
interface MatIconConfig {
|
|
379
|
+
fontIcon: string;
|
|
380
|
+
fontSet?: string;
|
|
381
|
+
ariaLabel?: string;
|
|
354
382
|
}
|
|
355
383
|
|
|
356
384
|
interface AcFieldFileConfig extends AbstractControlConfig {
|
|
@@ -358,6 +386,24 @@ interface AcFieldFileConfig extends AbstractControlConfig {
|
|
|
358
386
|
multiple?: boolean;
|
|
359
387
|
maxNbRow?: number;
|
|
360
388
|
accept?: string;
|
|
389
|
+
addButton?: {
|
|
390
|
+
label?: string;
|
|
391
|
+
className?: string;
|
|
392
|
+
matButtonType?: AcMaterialButtonType;
|
|
393
|
+
matIcon?: string;
|
|
394
|
+
title?: string;
|
|
395
|
+
ariaLabel?: string;
|
|
396
|
+
};
|
|
397
|
+
deleteButton?: {
|
|
398
|
+
label?: string;
|
|
399
|
+
className?: string;
|
|
400
|
+
matButtonType?: AcMaterialButtonType;
|
|
401
|
+
matIcon?: string;
|
|
402
|
+
title?: string;
|
|
403
|
+
ariaLabel?: string;
|
|
404
|
+
};
|
|
405
|
+
confirmDelete?: boolean;
|
|
406
|
+
confirmDeleteData?: ConfirmDialogData;
|
|
361
407
|
onAddFile?: (file: File | null) => void;
|
|
362
408
|
onDeleteFile?: (file: File) => void;
|
|
363
409
|
}
|
|
@@ -413,7 +459,17 @@ interface AcFieldCustomConfig<T> extends AbstractControlConfig {
|
|
|
413
459
|
data?: T;
|
|
414
460
|
}
|
|
415
461
|
|
|
416
|
-
|
|
462
|
+
interface AcFieldChipsConfig extends AbstractControlConfig {
|
|
463
|
+
type: 'chips';
|
|
464
|
+
options?: string[];
|
|
465
|
+
separatorKeysCodes?: (number | SeparatorKey)[];
|
|
466
|
+
autocomplete?: AutocompleteAttribute;
|
|
467
|
+
readonly?: boolean;
|
|
468
|
+
suffixes?: AcAffix[];
|
|
469
|
+
prefixes?: AcAffix[];
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
type AcControlConfig = AcFieldCheckboxConfig | AcFieldInputConfig | AcFieldDateConfig | AcFieldTextareaConfig | AcFieldSelectConfig | AcFieldAutocompleteConfig | AcFieldRadioButtonConfig | AcFieldFileConfig | AcFieldEditorConfig | AcFieldToggleConfig | AcFieldPasswordConfig | AcFieldCustomConfig<any> | AcFieldChipsConfig;
|
|
417
473
|
|
|
418
474
|
declare class DynamicFormService {
|
|
419
475
|
private readonly fb;
|
|
@@ -464,22 +520,6 @@ declare class AbstractControlFieldComponent<T extends AbstractControlConfig> ext
|
|
|
464
520
|
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractControlFieldComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
465
521
|
}
|
|
466
522
|
|
|
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
523
|
interface AcDynamicForm {
|
|
484
524
|
fields: (AcFieldConfig | AcTextConfig)[];
|
|
485
525
|
buttons?: AcButton[];
|
|
@@ -563,6 +603,7 @@ declare class MaterialDynamicFormComponent {
|
|
|
563
603
|
formCancel: OutputEmitterRef<void>;
|
|
564
604
|
formSubmit: OutputEmitterRef<FormGroup>;
|
|
565
605
|
formChange: OutputEmitterRef<FormGroup>;
|
|
606
|
+
formInit: OutputEmitterRef<FormGroup>;
|
|
566
607
|
get form(): FormGroup | undefined;
|
|
567
608
|
get controls(): {
|
|
568
609
|
[key: string]: AbstractControl;
|
|
@@ -580,7 +621,7 @@ declare class MaterialDynamicFormComponent {
|
|
|
580
621
|
handleSubmit(event?: Event): void;
|
|
581
622
|
focusFirstInvalidControl(): void;
|
|
582
623
|
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>;
|
|
624
|
+
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
625
|
}
|
|
585
626
|
|
|
586
627
|
declare class MaterialDynamicFormModalComponent implements OnInit {
|
|
@@ -653,5 +694,5 @@ declare class ClassicDynamicFormComponent {
|
|
|
653
694
|
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
695
|
}
|
|
655
696
|
|
|
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 };
|
|
697
|
+
export { AbstractControlFieldComponent, AbstractFieldComponent, AcCustomComponentField, AutocompleteAttribute, ClassicDynamicFormComponent, ConditionsService, DsfrDynamicFormComponent, DynamicFormService, MaterialDynamicFormComponent, MaterialDynamicFormModalComponent };
|
|
698
|
+
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 };
|