@suntelecoms/ngx-dynamic-form 1.6.4 → 1.6.6
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 +16 -2
- package/fesm2022/suntelecoms-ngx-dynamic-form.mjs +47 -6
- package/fesm2022/suntelecoms-ngx-dynamic-form.mjs.map +1 -1
- package/lib/components/dynamic-field/dynamic-field.component.d.ts +8 -0
- package/lib/models/form-field.model.d.ts +5 -0
- package/lib/services/dynamic-form-builder.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -70,6 +70,14 @@ export declare class DynamicFieldComponent implements OnInit {
|
|
|
70
70
|
get hasOptions(): boolean;
|
|
71
71
|
get hasError(): boolean;
|
|
72
72
|
get errorMessage(): string | null;
|
|
73
|
+
/** field.minDate/maxDate ('today' or an ISO 'YYYY-MM-DD' string) resolved to a Date, for the mat-datepicker's [min]/[max]. */
|
|
74
|
+
get minDate(): Date | undefined;
|
|
75
|
+
get maxDate(): Date | undefined;
|
|
76
|
+
/** Same bound, as 'YYYY-MM-DD' for the native <input type="date"> min/max attributes (simple appearance). */
|
|
77
|
+
get minDateAttr(): string | undefined;
|
|
78
|
+
get maxDateAttr(): string | undefined;
|
|
79
|
+
private resolveFieldDate;
|
|
80
|
+
private toIsoDateString;
|
|
73
81
|
private setupRequiredWhen;
|
|
74
82
|
private updateRequiredFromConditions;
|
|
75
83
|
onLookupBlur(): void;
|
|
@@ -36,6 +36,9 @@ export interface FieldValidation {
|
|
|
36
36
|
email?: string;
|
|
37
37
|
maxField?: string;
|
|
38
38
|
minField?: string;
|
|
39
|
+
/** type: 'date' — shown when the value is before field.minDate / after field.maxDate */
|
|
40
|
+
minDate?: string;
|
|
41
|
+
maxDate?: string;
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
44
|
/** Auto-populate sibling fields from an API call when this field loses focus */
|
|
@@ -88,6 +91,8 @@ export interface DynamicFormField {
|
|
|
88
91
|
accept?: string;
|
|
89
92
|
multiple?: boolean;
|
|
90
93
|
rows?: number;
|
|
94
|
+
minDate?: string;
|
|
95
|
+
maxDate?: string;
|
|
91
96
|
min?: number;
|
|
92
97
|
max?: number;
|
|
93
98
|
step?: number;
|
|
@@ -8,6 +8,7 @@ export declare class DynamicFormBuilderService {
|
|
|
8
8
|
buildGroupValidators(fields: DynamicFormField[], atLeastOneOf?: string[], atLeastOneOfMessage?: string): ValidatorFn[];
|
|
9
9
|
buildValidators(validation?: FieldValidation): ValidatorFn[];
|
|
10
10
|
getErrorMessage(control: AbstractControl, validation?: FieldValidation): string | null;
|
|
11
|
+
private formatDateFr;
|
|
11
12
|
/**
|
|
12
13
|
* Cross-field bound validator: sets an error on `fieldKey` when:
|
|
13
14
|
* mode 'max': field value > other field value
|
package/package.json
CHANGED