@muziehdesign/forms 18.2.0-beta.762 → 18.2.0-beta.770
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.
|
@@ -8,4 +8,44 @@ export var FieldSchemaType;
|
|
|
8
8
|
FieldSchemaType["array"] = "array";
|
|
9
9
|
FieldSchemaType["file"] = "file";
|
|
10
10
|
})(FieldSchemaType || (FieldSchemaType = {}));
|
|
11
|
-
|
|
11
|
+
export const buildStringSchema = (path, constraints, label) => {
|
|
12
|
+
return {
|
|
13
|
+
name: path,
|
|
14
|
+
label: label,
|
|
15
|
+
type: FieldSchemaType.string,
|
|
16
|
+
constraints: { ...constraints },
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export const buildBooleanSchema = (path, constraints, label) => {
|
|
20
|
+
return {
|
|
21
|
+
name: path,
|
|
22
|
+
label: label,
|
|
23
|
+
type: FieldSchemaType.boolean,
|
|
24
|
+
constraints: { ...constraints },
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export const buildNumberSchema = (path, constraints, label) => {
|
|
28
|
+
return {
|
|
29
|
+
name: path,
|
|
30
|
+
label: label,
|
|
31
|
+
type: FieldSchemaType.number,
|
|
32
|
+
constraints: { ...constraints },
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export const buildDateSchema = (path, constraints, label) => {
|
|
36
|
+
return {
|
|
37
|
+
name: path,
|
|
38
|
+
label: label,
|
|
39
|
+
type: FieldSchemaType.date,
|
|
40
|
+
constraints: { ...constraints },
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export const buildArraySchema = (path, constraints, label) => {
|
|
44
|
+
return {
|
|
45
|
+
name: path,
|
|
46
|
+
label: label,
|
|
47
|
+
type: FieldSchemaType.array,
|
|
48
|
+
constraints: { ...constraints },
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoi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A9PiB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgbmFtZTogcGF0aCxcbiAgICAgICAgbGFiZWw6IGxhYmVsLFxuICAgICAgICB0eXBlOiBGaWVsZFNjaGVtYVR5cGUuYXJyYXksXG4gICAgICAgIGNvbnN0cmFpbnRzOiB7IC4uLmNvbnN0cmFpbnRzIH0sXG4gICAgfSBzYXRpc2ZpZXMgQXJyYXlTY2hlbWE7XG59O1xuIl19
|
package/esm2022/public-api.mjs
CHANGED
|
@@ -11,6 +11,6 @@ export * from './lib/ng-form-model-state.service';
|
|
|
11
11
|
export * from './lib/ngform-model-state';
|
|
12
12
|
export * from './lib/field-errors/field-errors.component';
|
|
13
13
|
export * from './lib/masks';
|
|
14
|
-
export { FieldSchemaType } from './lib/field-schema';
|
|
14
|
+
export { FieldSchemaType, buildStringSchema, buildNumberSchema, buildDateSchema, buildBooleanSchema } from './lib/field-schema';
|
|
15
15
|
export { MzCheckboxGroup } from './lib/checkbox-group/checkbox-group.component';
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL211emllaGRlc2lnbi9mb3Jtcy9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsbUNBQW1DLENBQUM7QUFDbEQsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLDJ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sIGJ1aWxkTnVtYmVyU2NoZW1hLCBidWlsZERhdGVTY2hlbWEsIGJ1aWxkQm9vbGVhblNjaGVtYVxuIH0gZnJvbSAnLi9saWIvZmllbGQtc2NoZW1hJztcbmV4cG9ydCB7IE16Q2hlY2tib3hHcm91cCwgRmllbGRPcHRpb24gfSBmcm9tICcuL2xpYi9jaGVja2JveC1ncm91cC9jaGVja2JveC1ncm91cC5jb21wb25lbnQnOyJdfQ==
|
|
@@ -49,6 +49,46 @@ var FieldSchemaType;
|
|
|
49
49
|
FieldSchemaType["array"] = "array";
|
|
50
50
|
FieldSchemaType["file"] = "file";
|
|
51
51
|
})(FieldSchemaType || (FieldSchemaType = {}));
|
|
52
|
+
const buildStringSchema = (path, constraints, label) => {
|
|
53
|
+
return {
|
|
54
|
+
name: path,
|
|
55
|
+
label: label,
|
|
56
|
+
type: FieldSchemaType.string,
|
|
57
|
+
constraints: { ...constraints },
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const buildBooleanSchema = (path, constraints, label) => {
|
|
61
|
+
return {
|
|
62
|
+
name: path,
|
|
63
|
+
label: label,
|
|
64
|
+
type: FieldSchemaType.boolean,
|
|
65
|
+
constraints: { ...constraints },
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
const buildNumberSchema = (path, constraints, label) => {
|
|
69
|
+
return {
|
|
70
|
+
name: path,
|
|
71
|
+
label: label,
|
|
72
|
+
type: FieldSchemaType.number,
|
|
73
|
+
constraints: { ...constraints },
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const buildDateSchema = (path, constraints, label) => {
|
|
77
|
+
return {
|
|
78
|
+
name: path,
|
|
79
|
+
label: label,
|
|
80
|
+
type: FieldSchemaType.date,
|
|
81
|
+
constraints: { ...constraints },
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
const buildArraySchema = (path, constraints, label) => {
|
|
85
|
+
return {
|
|
86
|
+
name: path,
|
|
87
|
+
label: label,
|
|
88
|
+
type: FieldSchemaType.array,
|
|
89
|
+
constraints: { ...constraints },
|
|
90
|
+
};
|
|
91
|
+
};
|
|
52
92
|
|
|
53
93
|
/*
|
|
54
94
|
Schema rules need to be built in the order they need to be evaluated in.
|
|
@@ -635,5 +675,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
635
675
|
* Generated bundle index. Do not edit.
|
|
636
676
|
*/
|
|
637
677
|
|
|
638
|
-
export { ArrayType, BooleanType, DateType, FieldErrorsComponent, FieldSchemaType, FileType, FormsModule, ModelSchemaFactory, ModelValidator, MzCheckboxGroup, NgFormModelState, NgFormModelStateFactory, NumberType, ObjectType, StringType, currencyOptions, dateMaskOptions, equals, integerOptions, length, max, maxLength, min, minLength, ofValues, pattern, phoneNumberOptions, required, ssnOptions, test };
|
|
678
|
+
export { ArrayType, BooleanType, DateType, FieldErrorsComponent, FieldSchemaType, FileType, FormsModule, ModelSchemaFactory, ModelValidator, MzCheckboxGroup, NgFormModelState, NgFormModelStateFactory, NumberType, ObjectType, StringType, buildBooleanSchema, buildDateSchema, buildNumberSchema, buildStringSchema, currencyOptions, dateMaskOptions, equals, integerOptions, length, max, maxLength, min, minLength, ofValues, pattern, phoneNumberOptions, required, ssnOptions, test };
|
|
639
679
|
//# sourceMappingURL=muziehdesign-forms.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"muziehdesign-forms.mjs","sources":["../../../../projects/muziehdesign/forms/src/lib/model-validator.ts","../../../../projects/muziehdesign/forms/src/lib/constants.ts","../../../../projects/muziehdesign/forms/src/lib/field-schema.ts","../../../../projects/muziehdesign/forms/src/lib/model-schema.factory.ts","../../../../projects/muziehdesign/forms/src/lib/type-annotations.ts","../../../../projects/muziehdesign/forms/src/lib/field-errors/field-errors.component.ts","../../../../projects/muziehdesign/forms/src/lib/field-errors/field-errors.component.html","../../../../projects/muziehdesign/forms/src/lib/forms.module.ts","../../../../projects/muziehdesign/forms/src/lib/ngform-model-state.ts","../../../../projects/muziehdesign/forms/src/lib/ng-form-model-state.service.ts","../../../../projects/muziehdesign/forms/src/lib/masks.ts","../../../../projects/muziehdesign/forms/src/lib/checkbox-group/checkbox-group.component.ts","../../../../projects/muziehdesign/forms/src/lib/checkbox-group/checkbox-group.component.html","../../../../projects/muziehdesign/forms/src/public-api.ts","../../../../projects/muziehdesign/forms/src/muziehdesign-forms.ts"],"sourcesContent":["import { AnyObjectSchema, SchemaOf, ValidationError } from 'yup';\nimport { FieldError } from './field-error';\nimport { ConstraintAnnotations } from './type-annotations';\n\nexport class ModelValidator<T> {\n constructor(private schema: AnyObjectSchema) {}\n\n\n get paths() {\n //return Array.from(this.metadata, ([key, value]) => ({ key, value }));\n return [];\n }\n\n keyValue(key: string) {\n return this.schema.fields[key];\n }\n\n validate<T>(model: T): Promise<FieldError[]> {\n return this.schema\n .validate(model, { abortEarly: false })\n .then(() => {\n return [];\n })\n .catch((e: ValidationError) => {\n return e.inner.map((error) => <FieldError>{ path: error.path, type: error.type, message: error.message });\n });\n }\n\n instantiate(): any {\n console.log(this.schema.fields);\n return this.schema.getDefault();\n }\n}\n","export const SCHEMA_METADATA_NAMESPACE = 'custom:muziehdesign:annotations';\n","import { ArrayTypeAnnotations, BooleanTypeAnnotations, ConstraintAnnotations, DateTypeAnnotations, FileTypeAnnotations, NumberTypeAnnotations, ObjectTypeAnnotations, StringTypeAnnotations } from './type-annotations';\n\nexport enum FieldSchemaType {\n string = 'string',\n boolean = 'boolean',\n date = 'date',\n object = 'object',\n number = 'number',\n array = 'array',\n file = 'file',\n}\n\nexport interface FieldSchema<T extends ConstraintAnnotations> {\n name: string;\n type: FieldSchemaType;\n label?: string;\n constraints: T;\n}\n\nexport interface StringSchema extends FieldSchema<StringTypeAnnotations> {\n type: FieldSchemaType.string;\n}\n\nexport interface NumberSchema extends FieldSchema<NumberTypeAnnotations> {\n type: FieldSchemaType.number;\n}\n\nexport interface BooleanSchema extends FieldSchema<BooleanTypeAnnotations> {\n type: FieldSchemaType.boolean;\n}\n\nexport interface DateSchema extends FieldSchema<DateTypeAnnotations> {\n type: FieldSchemaType.date;\n}\n\nexport interface ArraySchema extends FieldSchema<ArrayTypeAnnotations> {\n type: FieldSchemaType.array;\n}\n\nexport interface FileSchema extends FieldSchema<FileTypeAnnotations> {\n type: FieldSchemaType.file;\n}\n\nexport interface ObjectSchema extends FieldSchema<ObjectTypeAnnotations> {\n type: FieldSchemaType.object;\n}\n","import { Injectable } from '@angular/core';\nimport { object, SchemaOf } from 'yup';\nimport { ModelValidator } from './model-validator';\nimport { SCHEMA_METADATA_NAMESPACE } from './constants';\nimport { ObjectShape } from 'yup/lib/object';\nimport * as Yup from 'yup';\nimport { ArraySchema, BooleanSchema, DateSchema, FieldSchema, FieldSchemaType, FileSchema, NumberSchema, ObjectSchema, StringSchema } from './field-schema';\n\n/*\nSchema rules need to be built in the order they need to be evaluated in.\nFor example,\n ```\n schema.required().max(...).matches(...);\n ```\nevaluates the 3 rules in this order\n - required\n - max\n - matches\n*/\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ModelSchemaFactory {\n constructor() {}\n\n build<T extends object>(model: T): ModelValidator<T> {\n const metadata: Map<string, FieldSchema<any>> = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, model);\n const schema = this.buildYupSchema([...metadata.values()]);\n return new ModelValidator(schema);\n }\n\n buildUntyped(raw: FieldSchema<any>[]) : ModelValidator<{[key: string]: string}> {\n const schema = this.buildYupSchema(raw);\n return new ModelValidator(schema);\n }\n\n private buildYupSchema(fields: FieldSchema<any>[]) : Yup.AnyObjectSchema {\n let shape: ObjectShape = {};\n fields.forEach((value) => {\n if (value.type == FieldSchemaType.string) {\n shape[value.name] = this.buildStringSchema(value as StringSchema);\n } else if (value.type == FieldSchemaType.boolean) {\n shape[value.name] = this.buildBooleanSchema(value as BooleanSchema);\n } else if (value.type == FieldSchemaType.date) {\n shape[value.name] = this.buildDateSchema(value as DateSchema);\n } else if (value.type == FieldSchemaType.object) {\n shape[value.name] = this.buildNestedObjectSchema(value as ObjectSchema);\n } else if (value.type == FieldSchemaType.number) {\n shape[value.name] = this.buildNumberSchema(value as NumberSchema);\n } else if (value.type == FieldSchemaType.array) {\n shape[value.name] = this.buildArraySchema(value as ArraySchema);\n } else if (value.type == FieldSchemaType.file) {\n shape[value.name] = this.buildFileSchema(value as FileSchema);\n } else {\n throw new Error('Unrecognized field schema');\n }\n });\n\n return object(shape);\n }\n\n private buildStringSchema(original: StringSchema) {\n let schema = Yup.string();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n\n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.length) {\n schema = schema.length(options.length.length, options.length.message);\n }\n\n if (options.maxLength) {\n schema = schema.max(options.maxLength.maxLength, options.maxLength.message);\n }\n\n if (options.minLength) {\n schema = schema.min(options.minLength.minLength, options.minLength.message);\n }\n\n if (options.pattern) {\n schema = schema.matches(options.pattern.pattern, { message: options.pattern.message, excludeEmptyString: true });\n }\n\n return schema;\n }\n\n private buildBooleanSchema(original: BooleanSchema) {\n let schema = Yup.boolean();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.equals) {\n if (options.equals.equals) {\n schema = schema.isTrue(options.equals.message);\n } else {\n schema = schema.isFalse(options.equals.message);\n }\n }\n\n return schema;\n }\n\n private buildDateSchema(original: DateSchema) {\n let schema = Yup.date();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n if (options.test) {\n schema = schema.test({\n name: options.test.name,\n message: options.test.message,\n test: (d?: Date, context?: any) => {\n return options.test!.test(d!);\n },\n });\n }\n\n return schema;\n }\n\n private buildNumberSchema(original: NumberSchema) {\n let schema = Yup.number();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n\n return schema;\n }\n\n private buildArraySchema(original: ArraySchema) {\n let schema = Yup.array();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n\n return schema;\n }\n\n private buildNestedObjectSchema(original: ObjectSchema) {\n const metadata: Map<string, FieldSchema<any>> = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, original.constraints.getInstance());\n\n let nestedSchema = this.buildYupSchema([...metadata.values()]);\n if(original.label) {\n nestedSchema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n nestedSchema = nestedSchema.required();\n } else {\n nestedSchema = nestedSchema.notRequired().default(undefined);\n }\n\n return nestedSchema;\n }\n\n private buildFileSchema(original: FileSchema) {\n let schema = Yup.mixed().nullable().optional();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n\n return schema;\n }\n}\n","import 'reflect-metadata';\nimport { ArraySchema, BooleanSchema, DateSchema, FieldSchema, FieldSchemaType, FileSchema, NumberSchema, ObjectSchema, StringSchema } from './field-schema';\n\nconst METADATA_KEY = 'custom:muziehdesign:annotations';\n\nexport interface ConstraintAnnotations {\n\n}\n\nexport interface StringTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n length?: LengthAnnotation;\n pattern?: PatternAnnotation;\n maxLength?: MaxLengthAnnotation;\n minLength?: MinLengthAnnotation;\n}\n\nexport interface BooleanTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n equals?: EqualsAnnotation<boolean>;\n}\n\nexport interface DateTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n min?: MinimumAnnotation<Date>;\n max?: MaximumAnnotation<Date>;\n test?: TestAnnotation<Date>;\n}\n\nexport interface ObjectTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n getInstance: () => any;\n}\n\nexport interface NumberTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n min?: MinimumAnnotation<number>;\n max?: MaximumAnnotation<number>;\n}\n\nexport interface ArrayTypeAnnotations extends ConstraintAnnotations {\n min?: MinimumAnnotation<number>;\n max?: MaximumAnnotation<number>;\n}\n\nexport interface FileTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n}\n\nexport interface ValidationAnnotation {\n message?: string;\n}\n\nexport interface RequiredAnnotation extends ValidationAnnotation {\n required: boolean;\n}\n\nexport interface LengthAnnotation extends ValidationAnnotation {\n length: number;\n}\n\nexport interface PatternAnnotation extends ValidationAnnotation {\n pattern: RegExp;\n}\n\nexport interface OfValuesAnnotation extends ValidationAnnotation {\n values: [];\n}\n\nexport interface EqualsAnnotation<T> extends ValidationAnnotation {\n equals: T;\n}\n\nexport interface MinimumAnnotation<T> extends ValidationAnnotation {\n min: T;\n}\n\nexport interface MaximumAnnotation<T> extends ValidationAnnotation {\n max: T;\n}\n\nexport interface TestAnnotation<T> extends ValidationAnnotation {\n test: (d: T) => boolean;\n name: string;\n}\n\nexport interface MaxLengthAnnotation extends ValidationAnnotation {\n maxLength: number;\n}\n\nexport interface MinLengthAnnotation extends ValidationAnnotation {\n minLength: number;\n}\n\nconst registerMetadata = (target: Object, propertyKey: string, schema: FieldSchema<any>) => {\n const metadata: Map<string, FieldSchema<any>> = Reflect.getMetadata(METADATA_KEY, target) || new Map<string, FieldSchema<any>>();\n metadata.set(propertyKey, schema);\n Reflect.defineMetadata(METADATA_KEY, metadata, target);\n};\n\nexport function StringType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.string,\n constraints: Object.assign({}, ...annotations) as StringTypeAnnotations\n } satisfies StringSchema;\n\n console.log(schema.constraints);\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function BooleanType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.boolean,\n constraints: Object.assign({}, ...annotations) as BooleanTypeAnnotations\n } satisfies BooleanSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function DateType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.date,\n constraints: Object.assign({}, ...annotations) as DateTypeAnnotations\n } satisfies DateSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function NumberType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.number,\n constraints: Object.assign({}, ...annotations) as NumberTypeAnnotations\n } satisfies NumberSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function ObjectType<T>(type: { new (): T }, ...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.object,\n constraints: Object.assign({}, ...annotations, { getInstance: () => new type() } as Partial<ObjectTypeAnnotations>) as ObjectTypeAnnotations\n } satisfies ObjectSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function ArrayType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.array,\n constraints: Object.assign({}, ...annotations) as ArrayTypeAnnotations\n } satisfies ArraySchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function FileType<T>(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.file,\n constraints: Object.assign({}, ...annotations) as FileTypeAnnotations\n } satisfies FileSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function required(message?: string): { [key: string]: RequiredAnnotation } {\n return { required: { required: true, message: message } };\n}\n\nexport function pattern(regex: RegExp, message?: string): { [key: string]: PatternAnnotation } {\n return { pattern: { pattern: regex, message: message } };\n}\n\nexport function length(length: number, message?: string): { [key: string]: LengthAnnotation } {\n return { length: { length: length, message: message } };\n}\n\nexport function maxLength(maxLength: number, message?: string): { [key: string]: MaxLengthAnnotation } {\n return { maxLength: { maxLength: maxLength, message: message } };\n}\n\nexport function minLength(minLength: number, message?: string): { [key: string]: MinLengthAnnotation } {\n return { minLength: { minLength: minLength, message: message } };\n}\n\nexport function ofValues(values: [], message?: string): { [key: string]: OfValuesAnnotation } {\n return { ofValues: { values: values, message: message } };\n}\n\nexport function equals<T>(value: T, message?: string): { [key: string]: EqualsAnnotation<T> } {\n return { equals: { equals: value, message: message } };\n}\n\nexport function min<T>(value: T, message?: string): { [key: string]: MinimumAnnotation<T> } {\n return { min: { min: value, message: message } };\n}\n\nexport function max<T>(value: T, message?: string): { [key: string]: MaximumAnnotation<T> } {\n return { max: { max: value, message: message } };\n}\n\nexport function test<T>(name: string, test: (d: T) => boolean, message?: string): { [key: string]: TestAnnotation<T> } {\n return { test: { name: name, test: test, message: message } };\n}\n","import { Component, Input, OnInit } from '@angular/core';\nimport { NgControl, ValidationErrors } from '@angular/forms';\n\n@Component({\n selector: 'mz-field-errors',\n templateUrl: './field-errors.component.html',\n styleUrls: ['./field-errors.component.css'],\n})\nexport class FieldErrorsComponent {\n @Input() field?: NgControl;\n\n get errorMessage(): string {\n const errorKeys = Object.keys(this.field?.errors || {});\n return errorKeys.length > 0 ? (this.field?.errors as ValidationErrors)[errorKeys[0]] : '';\n }\n}\n","<div class=\"field-error\" *ngIf=\"errorMessage\">{{ errorMessage }}</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FieldErrorsComponent } from './field-errors/field-errors.component';\n\n\n\n@NgModule({\n providers: [],\n declarations: [\n FieldErrorsComponent\n ],\n exports: [\n FieldErrorsComponent\n ],\n imports: [\n CommonModule // TODO: can remove once done with temp error displaying\n ]\n})\nexport class FormsModule { }\n","import { AbstractControl, FormArray, FormGroup, NgForm, NgModelGroup, ValidationErrors } from '@angular/forms';\nimport { BehaviorSubject, distinctUntilChanged, from, switchMap } from 'rxjs';\nimport { FieldError } from './field-error';\nimport { ModelStateOptions } from './model-state-options';\nimport { ModelStateResult } from './model-state-result';\nimport { ModelValidator } from './model-validator';\n\nexport class NgFormModelState<T> {\n private changesSubject = new BehaviorSubject<ModelStateResult<T> | undefined>(undefined);\n public readonly changes = this.changesSubject.asObservable();\n\n constructor(private form: NgForm, private modelValidator: ModelValidator<T>, private options?: ModelStateOptions) {\n this.form.form.valueChanges\n .pipe(\n switchMap(async (x) => {\n return from(this.validate());\n })\n )\n .subscribe();\n }\n\n getCurrent(): ModelStateResult<T> | undefined {\n return this.changesSubject.value;\n }\n\n setState(model: T, errors: FieldError[]) {\n const state = {\n model: model,\n errors: errors,\n valid: errors.length === 0,\n } as ModelStateResult<T>;\n this.setStateInternal(state);\n }\n\n setErrors(errors: FieldError[]) {\n //this.errors.next(errors);\n throw new Error('needs implementation');\n }\n\n appendErrors(errors: FieldError[], skipEmit?: boolean) {\n const allErrors = [...(this.changesSubject.value?.errors || []), ...errors];\n const state = { ...this.changesSubject.value } as ModelStateResult<T>;\n state.errors = allErrors;\n this.setStateInternal(state);\n }\n\n async validate(): Promise<ModelStateResult<T>> {\n const model = this.form.value;\n const state = await this.runValidations(model, this.options?.onValidate);\n console.log('running validations, result:', state);\n this.setStateInternal(state);\n return state;\n }\n\n\n private setStateInternal(state: ModelStateResult<T>) {\n this.deleteFormErrors();\n\n const grouped = state.errors.reduce((grouped, v) => grouped.set(v.path, [...(grouped.get(v.path) || []), v]), new Map<string, FieldError[]>());\n grouped.forEach((value, path) => {\n let validationErrors = <ValidationErrors>{};\n value.forEach((v) => (validationErrors[v.type] = v.message));\n\n const control = this.form.form.get(path);\n if (!control) {\n // TODO: use actual logging service\n } else {\n control.setErrors(validationErrors);\n }\n });\n\n this.changesSubject.next(state);\n }\n\n private deleteFormErrors() {\n this.deleteErrors(this.form.form);\n }\n\n private deleteErrors(rootFormGroup: FormGroup) {\n Object.keys(rootFormGroup.controls).forEach((key) => {\n const control = rootFormGroup.controls[key];\n\n if (!this.isParentControl(control)) {\n this.deleteErrorsFromControl(key, control);\n } else if (control instanceof FormGroup) {\n this.deleteErrors(control as FormGroup);\n } else if (control instanceof FormArray) {\n this.loopFormArray(control as FormArray);\n }\n });\n }\n\n private deleteErrorsFromControl(key: string | number, control: AbstractControl) {\n control.setErrors(null);\n }\n\n private isParentControl(control: AbstractControl) {\n return control instanceof FormGroup || control instanceof FormArray;\n }\n\n private loopFormArray(formArray: FormArray) {\n formArray.controls.forEach((control, index) => {\n if (!this.isParentControl(control)) {\n this.deleteErrorsFromControl(index, control);\n } else if (control instanceof FormGroup) {\n this.deleteErrors(control as FormGroup);\n } else if (control instanceof FormArray) {\n this.loopFormArray(control as FormArray);\n }\n });\n }\n\n private async runValidations<T>(model: T, callback?: (list: FieldError[]) => Promise<FieldError[]>): Promise<ModelStateResult<T>> {\n const list = await this.modelValidator.validate(model);\n const final = callback ? (await callback?.(list)) : list;\n return {\n valid: final.length === 0,\n errors: final,\n model: model,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { NgForm } from '@angular/forms';\nimport { ModelSchemaFactory } from './model-schema.factory';\nimport { ModelStateOptions } from './model-state-options';\nimport { NgFormModelState } from './ngform-model-state';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgFormModelStateFactory {\n constructor(private factory: ModelSchemaFactory) {}\n\n create<T extends object>(form: NgForm, model: T, options?: ModelStateOptions) {\n const modelState = new NgFormModelState<T>(form, this.factory.build(model), options);\n return modelState;\n }\n}\n","import { format, isValid, parse } from 'date-fns';\nimport * as IMask from 'imask';\n\nexport const dateMaskOptions = {\n mask: 'MM/dd/yyyy',\n format: (date: Date | undefined): string => {\n if (!date) {\n return '';\n }\n return format(date, 'MM/dd/yyyy');\n },\n parse: (str: string): Date | undefined => {\n const dateRegex = /(0[1-9]|1[0-2])\\/(0[1-9]|[12]\\d|3[01])\\/([12]\\d{3})/;\n if (!str.match(dateRegex)) {\n return undefined;\n }\n const parsed = parse(str, 'MM/dd/yyyy', new Date());\n if (isValid(parsed)) {\n return parsed;\n }\n return undefined;\n },\n blocks: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MM: {\n mask: IMask.MaskedRange,\n from: 1,\n to: 12,\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n dd: {\n mask: IMask.MaskedRange,\n from: 1,\n to: 31,\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n yyyy: {\n mask: IMask.MaskedRange,\n from: 1000,\n to: 9999,\n },\n },\n};\n\nexport const phoneNumberOptions = {\n mask: '(000) 000-0000',\n};\n\nexport const ssnOptions = {\n mask: '000-00-0000',\n};\n\nexport const currencyOptions = {\n mask: Number,\n scale: 2,\n thousandsSeparator: ',',\n padFractionalZeros: true,\n radix: '.',\n mapToRadix: ['.'],\n};\n\nexport const integerOptions = {\n mask: Number,\n scale: 0,\n thousandsSeparator: ',',\n padFractionalZeros: true,\n radix: '.',\n mapToRadix: ['.'],\n};\n","import { Component, Input, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface FieldOption {\n label: string;\n value: any;\n}\n\n@Component({\n selector: 'mz-checkbox-group',\n standalone: true,\n imports: [FormsModule],\n templateUrl: './checkbox-group.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MzCheckboxGroup),\n multi: true\n }\n ]\n})\nexport class MzCheckboxGroup implements ControlValueAccessor {\n @Input({ required: true }) options!: FieldOption[];\n selections: any[] = [];\n\n onChange: (value: string[]) => void = () => {};\n onTouched: () => void = () => {};\n\n // Writes the selected values from the form model\n writeValue(values: any[]): void {\n this.selections = values || [];\n }\n\n // Registers the onChange function to propagate changes\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n // Registers the onTouched function\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n setDisabledState?(isDisabled: boolean): void {\n \n }\n\n // Checks if a checkbox is selected\n isChecked(option: FieldOption): boolean {\n return this.selections.includes(option.value);\n }\n\n // Handles changes when checkboxes are clicked\n onCheckboxChange(event: Event, option: FieldOption): void {\n const checked = (event.target as HTMLInputElement).checked;\n\n if (checked) {\n this.selections = [...this.selections, option.value];\n } else {\n this.selections = this.selections.filter((val) => val !== option.value);\n }\n\n this.onChange(this.selections);\n this.onTouched();\n }\n}\n\n","@for(option of options; track $index) {\n<label class=\"field\">\n <input type=\"checkbox\" [value]=\"option.value\" [checked]=\"isChecked(option)\" (change)=\"onCheckboxChange($event, option)\" />\n <span class=\"checkbox-label\">{{option.label}}</span>\n</label>\n}\n","/*\n * Public API Surface of forms\n */\nexport * from './lib/field-error';\nexport * from './lib/model-state-result';\nexport * from './lib/model-schema.factory';\nexport * from './lib/model-validator';\nexport * from './lib/type-annotations';\nexport * from './lib/forms.module';\nexport * from './lib/ng-form-model-state.service';\nexport * from './lib/ngform-model-state';\nexport * from './lib/field-errors/field-errors.component';\nexport * from './lib/masks';\n\nexport { FieldSchema, FieldSchemaType, StringSchema, NumberSchema, DateSchema, BooleanSchema, FileSchema, ObjectSchema } from './lib/field-schema';\nexport { MzCheckboxGroup, FieldOption } from './lib/checkbox-group/checkbox-group.component';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ModelSchemaFactory","FormsModule"],"mappings":";;;;;;;;;;;;MAIa,cAAc,CAAA;AACvB,IAAA,WAAA,CAAoB,MAAuB,EAAA;QAAvB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAiB;KAAI;AAG/C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A;kBAb3B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,cACjB,IAAI,EAAA,OAAA,EACP,CAACA,aAAW,CAAC,EAEX,SAAA,EAAA;AACP,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC;AAC9C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,qRAAA,EAAA,CAAA;8BAGwB,OAAO,EAAA,CAAA;sBAAjC,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;;;AEtB7B;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"muziehdesign-forms.mjs","sources":["../../../../projects/muziehdesign/forms/src/lib/model-validator.ts","../../../../projects/muziehdesign/forms/src/lib/constants.ts","../../../../projects/muziehdesign/forms/src/lib/field-schema.ts","../../../../projects/muziehdesign/forms/src/lib/model-schema.factory.ts","../../../../projects/muziehdesign/forms/src/lib/type-annotations.ts","../../../../projects/muziehdesign/forms/src/lib/field-errors/field-errors.component.ts","../../../../projects/muziehdesign/forms/src/lib/field-errors/field-errors.component.html","../../../../projects/muziehdesign/forms/src/lib/forms.module.ts","../../../../projects/muziehdesign/forms/src/lib/ngform-model-state.ts","../../../../projects/muziehdesign/forms/src/lib/ng-form-model-state.service.ts","../../../../projects/muziehdesign/forms/src/lib/masks.ts","../../../../projects/muziehdesign/forms/src/lib/checkbox-group/checkbox-group.component.ts","../../../../projects/muziehdesign/forms/src/lib/checkbox-group/checkbox-group.component.html","../../../../projects/muziehdesign/forms/src/public-api.ts","../../../../projects/muziehdesign/forms/src/muziehdesign-forms.ts"],"sourcesContent":["import { AnyObjectSchema, SchemaOf, ValidationError } from 'yup';\nimport { FieldError } from './field-error';\nimport { ConstraintAnnotations } from './type-annotations';\n\nexport class ModelValidator<T> {\n constructor(private schema: AnyObjectSchema) {}\n\n\n get paths() {\n //return Array.from(this.metadata, ([key, value]) => ({ key, value }));\n return [];\n }\n\n keyValue(key: string) {\n return this.schema.fields[key];\n }\n\n validate<T>(model: T): Promise<FieldError[]> {\n return this.schema\n .validate(model, { abortEarly: false })\n .then(() => {\n return [];\n })\n .catch((e: ValidationError) => {\n return e.inner.map((error) => <FieldError>{ path: error.path, type: error.type, message: error.message });\n });\n }\n\n instantiate(): any {\n console.log(this.schema.fields);\n return this.schema.getDefault();\n }\n}\n","export const SCHEMA_METADATA_NAMESPACE = 'custom:muziehdesign:annotations';\n","import { ArrayTypeAnnotations, BooleanTypeAnnotations, ConstraintAnnotations, DateTypeAnnotations, FileTypeAnnotations, NumberTypeAnnotations, ObjectTypeAnnotations, StringTypeAnnotations } from './type-annotations';\n\nexport enum FieldSchemaType {\n string = 'string',\n boolean = 'boolean',\n date = 'date',\n object = 'object',\n number = 'number',\n array = 'array',\n file = 'file',\n}\n\nexport interface FieldSchema<T extends ConstraintAnnotations> {\n name: string;\n type: FieldSchemaType;\n label?: string;\n constraints: T;\n}\n\nexport interface StringSchema extends FieldSchema<StringTypeAnnotations> {\n type: FieldSchemaType.string;\n}\n\nexport interface NumberSchema extends FieldSchema<NumberTypeAnnotations> {\n type: FieldSchemaType.number;\n}\n\nexport interface BooleanSchema extends FieldSchema<BooleanTypeAnnotations> {\n type: FieldSchemaType.boolean;\n}\n\nexport interface DateSchema extends FieldSchema<DateTypeAnnotations> {\n type: FieldSchemaType.date;\n}\n\nexport interface ArraySchema extends FieldSchema<ArrayTypeAnnotations> {\n type: FieldSchemaType.array;\n}\n\nexport interface FileSchema extends FieldSchema<FileTypeAnnotations> {\n type: FieldSchemaType.file;\n}\n\nexport interface ObjectSchema extends FieldSchema<ObjectTypeAnnotations> {\n type: FieldSchemaType.object;\n}\n\nexport const buildStringSchema = (path: string, constraints: StringTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.string,\n constraints: { ...constraints },\n } satisfies StringSchema;\n};\n\nexport const buildBooleanSchema = (path: string, constraints: BooleanTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.boolean,\n constraints: { ...constraints },\n } satisfies BooleanSchema;\n};\n\nexport const buildNumberSchema = (path: string, constraints: NumberTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.number,\n constraints: { ...constraints },\n } satisfies NumberSchema;\n};\n\nexport const buildDateSchema = (path: string, constraints: DateTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.date,\n constraints: { ...constraints },\n } satisfies DateSchema;\n};\n\nexport const buildArraySchema = (path: string, constraints: ArrayTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.array,\n constraints: { ...constraints },\n } satisfies ArraySchema;\n};\n","import { Injectable } from '@angular/core';\nimport { object, SchemaOf } from 'yup';\nimport { ModelValidator } from './model-validator';\nimport { SCHEMA_METADATA_NAMESPACE } from './constants';\nimport { ObjectShape } from 'yup/lib/object';\nimport * as Yup from 'yup';\nimport { ArraySchema, BooleanSchema, DateSchema, FieldSchema, FieldSchemaType, FileSchema, NumberSchema, ObjectSchema, StringSchema } from './field-schema';\n\n/*\nSchema rules need to be built in the order they need to be evaluated in.\nFor example,\n ```\n schema.required().max(...).matches(...);\n ```\nevaluates the 3 rules in this order\n - required\n - max\n - matches\n*/\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ModelSchemaFactory {\n constructor() {}\n\n build<T extends object>(model: T): ModelValidator<T> {\n const metadata: Map<string, FieldSchema<any>> = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, model);\n const schema = this.buildYupSchema([...metadata.values()]);\n return new ModelValidator(schema);\n }\n\n buildUntyped(raw: FieldSchema<any>[]) : ModelValidator<{[key: string]: string}> {\n const schema = this.buildYupSchema(raw);\n return new ModelValidator(schema);\n }\n\n private buildYupSchema(fields: FieldSchema<any>[]) : Yup.AnyObjectSchema {\n let shape: ObjectShape = {};\n fields.forEach((value) => {\n if (value.type == FieldSchemaType.string) {\n shape[value.name] = this.buildStringSchema(value as StringSchema);\n } else if (value.type == FieldSchemaType.boolean) {\n shape[value.name] = this.buildBooleanSchema(value as BooleanSchema);\n } else if (value.type == FieldSchemaType.date) {\n shape[value.name] = this.buildDateSchema(value as DateSchema);\n } else if (value.type == FieldSchemaType.object) {\n shape[value.name] = this.buildNestedObjectSchema(value as ObjectSchema);\n } else if (value.type == FieldSchemaType.number) {\n shape[value.name] = this.buildNumberSchema(value as NumberSchema);\n } else if (value.type == FieldSchemaType.array) {\n shape[value.name] = this.buildArraySchema(value as ArraySchema);\n } else if (value.type == FieldSchemaType.file) {\n shape[value.name] = this.buildFileSchema(value as FileSchema);\n } else {\n throw new Error('Unrecognized field schema');\n }\n });\n\n return object(shape);\n }\n\n private buildStringSchema(original: StringSchema) {\n let schema = Yup.string();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n\n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.length) {\n schema = schema.length(options.length.length, options.length.message);\n }\n\n if (options.maxLength) {\n schema = schema.max(options.maxLength.maxLength, options.maxLength.message);\n }\n\n if (options.minLength) {\n schema = schema.min(options.minLength.minLength, options.minLength.message);\n }\n\n if (options.pattern) {\n schema = schema.matches(options.pattern.pattern, { message: options.pattern.message, excludeEmptyString: true });\n }\n\n return schema;\n }\n\n private buildBooleanSchema(original: BooleanSchema) {\n let schema = Yup.boolean();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.equals) {\n if (options.equals.equals) {\n schema = schema.isTrue(options.equals.message);\n } else {\n schema = schema.isFalse(options.equals.message);\n }\n }\n\n return schema;\n }\n\n private buildDateSchema(original: DateSchema) {\n let schema = Yup.date();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n if (options.test) {\n schema = schema.test({\n name: options.test.name,\n message: options.test.message,\n test: (d?: Date, context?: any) => {\n return options.test!.test(d!);\n },\n });\n }\n\n return schema;\n }\n\n private buildNumberSchema(original: NumberSchema) {\n let schema = Yup.number();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n\n return schema;\n }\n\n private buildArraySchema(original: ArraySchema) {\n let schema = Yup.array();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n\n return schema;\n }\n\n private buildNestedObjectSchema(original: ObjectSchema) {\n const metadata: Map<string, FieldSchema<any>> = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, original.constraints.getInstance());\n\n let nestedSchema = this.buildYupSchema([...metadata.values()]);\n if(original.label) {\n nestedSchema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n nestedSchema = nestedSchema.required();\n } else {\n nestedSchema = nestedSchema.notRequired().default(undefined);\n }\n\n return nestedSchema;\n }\n\n private buildFileSchema(original: FileSchema) {\n let schema = Yup.mixed().nullable().optional();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n\n return schema;\n }\n}\n","import 'reflect-metadata';\nimport { ArraySchema, BooleanSchema, DateSchema, FieldSchema, FieldSchemaType, FileSchema, NumberSchema, ObjectSchema, StringSchema } from './field-schema';\n\nconst METADATA_KEY = 'custom:muziehdesign:annotations';\n\nexport interface ConstraintAnnotations {\n\n}\n\nexport interface StringTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n length?: LengthAnnotation;\n pattern?: PatternAnnotation;\n maxLength?: MaxLengthAnnotation;\n minLength?: MinLengthAnnotation;\n}\n\nexport interface BooleanTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n equals?: EqualsAnnotation<boolean>;\n}\n\nexport interface DateTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n min?: MinimumAnnotation<Date>;\n max?: MaximumAnnotation<Date>;\n test?: TestAnnotation<Date>;\n}\n\nexport interface ObjectTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n getInstance: () => any;\n}\n\nexport interface NumberTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n min?: MinimumAnnotation<number>;\n max?: MaximumAnnotation<number>;\n}\n\nexport interface ArrayTypeAnnotations extends ConstraintAnnotations {\n min?: MinimumAnnotation<number>;\n max?: MaximumAnnotation<number>;\n}\n\nexport interface FileTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n}\n\nexport interface ValidationAnnotation {\n message?: string;\n}\n\nexport interface RequiredAnnotation extends ValidationAnnotation {\n required: boolean;\n}\n\nexport interface LengthAnnotation extends ValidationAnnotation {\n length: number;\n}\n\nexport interface PatternAnnotation extends ValidationAnnotation {\n pattern: RegExp;\n}\n\nexport interface OfValuesAnnotation extends ValidationAnnotation {\n values: [];\n}\n\nexport interface EqualsAnnotation<T> extends ValidationAnnotation {\n equals: T;\n}\n\nexport interface MinimumAnnotation<T> extends ValidationAnnotation {\n min: T;\n}\n\nexport interface MaximumAnnotation<T> extends ValidationAnnotation {\n max: T;\n}\n\nexport interface TestAnnotation<T> extends ValidationAnnotation {\n test: (d: T) => boolean;\n name: string;\n}\n\nexport interface MaxLengthAnnotation extends ValidationAnnotation {\n maxLength: number;\n}\n\nexport interface MinLengthAnnotation extends ValidationAnnotation {\n minLength: number;\n}\n\nconst registerMetadata = (target: Object, propertyKey: string, schema: FieldSchema<any>) => {\n const metadata: Map<string, FieldSchema<any>> = Reflect.getMetadata(METADATA_KEY, target) || new Map<string, FieldSchema<any>>();\n metadata.set(propertyKey, schema);\n Reflect.defineMetadata(METADATA_KEY, metadata, target);\n};\n\nexport function StringType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.string,\n constraints: Object.assign({}, ...annotations) as StringTypeAnnotations\n } satisfies StringSchema;\n\n console.log(schema.constraints);\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function BooleanType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.boolean,\n constraints: Object.assign({}, ...annotations) as BooleanTypeAnnotations\n } satisfies BooleanSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function DateType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.date,\n constraints: Object.assign({}, ...annotations) as DateTypeAnnotations\n } satisfies DateSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function NumberType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.number,\n constraints: Object.assign({}, ...annotations) as NumberTypeAnnotations\n } satisfies NumberSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function ObjectType<T>(type: { new (): T }, ...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.object,\n constraints: Object.assign({}, ...annotations, { getInstance: () => new type() } as Partial<ObjectTypeAnnotations>) as ObjectTypeAnnotations\n } satisfies ObjectSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function ArrayType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.array,\n constraints: Object.assign({}, ...annotations) as ArrayTypeAnnotations\n } satisfies ArraySchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function FileType<T>(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.file,\n constraints: Object.assign({}, ...annotations) as FileTypeAnnotations\n } satisfies FileSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function required(message?: string): { [key: string]: RequiredAnnotation } {\n return { required: { required: true, message: message } };\n}\n\nexport function pattern(regex: RegExp, message?: string): { [key: string]: PatternAnnotation } {\n return { pattern: { pattern: regex, message: message } };\n}\n\nexport function length(length: number, message?: string): { [key: string]: LengthAnnotation } {\n return { length: { length: length, message: message } };\n}\n\nexport function maxLength(maxLength: number, message?: string): { [key: string]: MaxLengthAnnotation } {\n return { maxLength: { maxLength: maxLength, message: message } };\n}\n\nexport function minLength(minLength: number, message?: string): { [key: string]: MinLengthAnnotation } {\n return { minLength: { minLength: minLength, message: message } };\n}\n\nexport function ofValues(values: [], message?: string): { [key: string]: OfValuesAnnotation } {\n return { ofValues: { values: values, message: message } };\n}\n\nexport function equals<T>(value: T, message?: string): { [key: string]: EqualsAnnotation<T> } {\n return { equals: { equals: value, message: message } };\n}\n\nexport function min<T>(value: T, message?: string): { [key: string]: MinimumAnnotation<T> } {\n return { min: { min: value, message: message } };\n}\n\nexport function max<T>(value: T, message?: string): { [key: string]: MaximumAnnotation<T> } {\n return { max: { max: value, message: message } };\n}\n\nexport function test<T>(name: string, test: (d: T) => boolean, message?: string): { [key: string]: TestAnnotation<T> } {\n return { test: { name: name, test: test, message: message } };\n}\n","import { Component, Input, OnInit } from '@angular/core';\nimport { NgControl, ValidationErrors } from '@angular/forms';\n\n@Component({\n selector: 'mz-field-errors',\n templateUrl: './field-errors.component.html',\n styleUrls: ['./field-errors.component.css'],\n})\nexport class FieldErrorsComponent {\n @Input() field?: NgControl;\n\n get errorMessage(): string {\n const errorKeys = Object.keys(this.field?.errors || {});\n return errorKeys.length > 0 ? (this.field?.errors as ValidationErrors)[errorKeys[0]] : '';\n }\n}\n","<div class=\"field-error\" *ngIf=\"errorMessage\">{{ errorMessage }}</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FieldErrorsComponent } from './field-errors/field-errors.component';\n\n\n\n@NgModule({\n providers: [],\n declarations: [\n FieldErrorsComponent\n ],\n exports: [\n FieldErrorsComponent\n ],\n imports: [\n CommonModule // TODO: can remove once done with temp error displaying\n ]\n})\nexport class FormsModule { }\n","import { AbstractControl, FormArray, FormGroup, NgForm, NgModelGroup, ValidationErrors } from '@angular/forms';\nimport { BehaviorSubject, distinctUntilChanged, from, switchMap } from 'rxjs';\nimport { FieldError } from './field-error';\nimport { ModelStateOptions } from './model-state-options';\nimport { ModelStateResult } from './model-state-result';\nimport { ModelValidator } from './model-validator';\n\nexport class NgFormModelState<T> {\n private changesSubject = new BehaviorSubject<ModelStateResult<T> | undefined>(undefined);\n public readonly changes = this.changesSubject.asObservable();\n\n constructor(private form: NgForm, private modelValidator: ModelValidator<T>, private options?: ModelStateOptions) {\n this.form.form.valueChanges\n .pipe(\n switchMap(async (x) => {\n return from(this.validate());\n })\n )\n .subscribe();\n }\n\n getCurrent(): ModelStateResult<T> | undefined {\n return this.changesSubject.value;\n }\n\n setState(model: T, errors: FieldError[]) {\n const state = {\n model: model,\n errors: errors,\n valid: errors.length === 0,\n } as ModelStateResult<T>;\n this.setStateInternal(state);\n }\n\n setErrors(errors: FieldError[]) {\n //this.errors.next(errors);\n throw new Error('needs implementation');\n }\n\n appendErrors(errors: FieldError[], skipEmit?: boolean) {\n const allErrors = [...(this.changesSubject.value?.errors || []), ...errors];\n const state = { ...this.changesSubject.value } as ModelStateResult<T>;\n state.errors = allErrors;\n this.setStateInternal(state);\n }\n\n async validate(): Promise<ModelStateResult<T>> {\n const model = this.form.value;\n const state = await this.runValidations(model, this.options?.onValidate);\n console.log('running validations, result:', state);\n this.setStateInternal(state);\n return state;\n }\n\n\n private setStateInternal(state: ModelStateResult<T>) {\n this.deleteFormErrors();\n\n const grouped = state.errors.reduce((grouped, v) => grouped.set(v.path, [...(grouped.get(v.path) || []), v]), new Map<string, FieldError[]>());\n grouped.forEach((value, path) => {\n let validationErrors = <ValidationErrors>{};\n value.forEach((v) => (validationErrors[v.type] = v.message));\n\n const control = this.form.form.get(path);\n if (!control) {\n // TODO: use actual logging service\n } else {\n control.setErrors(validationErrors);\n }\n });\n\n this.changesSubject.next(state);\n }\n\n private deleteFormErrors() {\n this.deleteErrors(this.form.form);\n }\n\n private deleteErrors(rootFormGroup: FormGroup) {\n Object.keys(rootFormGroup.controls).forEach((key) => {\n const control = rootFormGroup.controls[key];\n\n if (!this.isParentControl(control)) {\n this.deleteErrorsFromControl(key, control);\n } else if (control instanceof FormGroup) {\n this.deleteErrors(control as FormGroup);\n } else if (control instanceof FormArray) {\n this.loopFormArray(control as FormArray);\n }\n });\n }\n\n private deleteErrorsFromControl(key: string | number, control: AbstractControl) {\n control.setErrors(null);\n }\n\n private isParentControl(control: AbstractControl) {\n return control instanceof FormGroup || control instanceof FormArray;\n }\n\n private loopFormArray(formArray: FormArray) {\n formArray.controls.forEach((control, index) => {\n if (!this.isParentControl(control)) {\n this.deleteErrorsFromControl(index, control);\n } else if (control instanceof FormGroup) {\n this.deleteErrors(control as FormGroup);\n } else if (control instanceof FormArray) {\n this.loopFormArray(control as FormArray);\n }\n });\n }\n\n private async runValidations<T>(model: T, callback?: (list: FieldError[]) => Promise<FieldError[]>): Promise<ModelStateResult<T>> {\n const list = await this.modelValidator.validate(model);\n const final = callback ? (await callback?.(list)) : list;\n return {\n valid: final.length === 0,\n errors: final,\n model: model,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { NgForm } from '@angular/forms';\nimport { ModelSchemaFactory } from './model-schema.factory';\nimport { ModelStateOptions } from './model-state-options';\nimport { NgFormModelState } from './ngform-model-state';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgFormModelStateFactory {\n constructor(private factory: ModelSchemaFactory) {}\n\n create<T extends object>(form: NgForm, model: T, options?: ModelStateOptions) {\n const modelState = new NgFormModelState<T>(form, this.factory.build(model), options);\n return modelState;\n }\n}\n","import { format, isValid, parse } from 'date-fns';\nimport * as IMask from 'imask';\n\nexport const dateMaskOptions = {\n mask: 'MM/dd/yyyy',\n format: (date: Date | undefined): string => {\n if (!date) {\n return '';\n }\n return format(date, 'MM/dd/yyyy');\n },\n parse: (str: string): Date | undefined => {\n const dateRegex = /(0[1-9]|1[0-2])\\/(0[1-9]|[12]\\d|3[01])\\/([12]\\d{3})/;\n if (!str.match(dateRegex)) {\n return undefined;\n }\n const parsed = parse(str, 'MM/dd/yyyy', new Date());\n if (isValid(parsed)) {\n return parsed;\n }\n return undefined;\n },\n blocks: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MM: {\n mask: IMask.MaskedRange,\n from: 1,\n to: 12,\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n dd: {\n mask: IMask.MaskedRange,\n from: 1,\n to: 31,\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n yyyy: {\n mask: IMask.MaskedRange,\n from: 1000,\n to: 9999,\n },\n },\n};\n\nexport const phoneNumberOptions = {\n mask: '(000) 000-0000',\n};\n\nexport const ssnOptions = {\n mask: '000-00-0000',\n};\n\nexport const currencyOptions = {\n mask: Number,\n scale: 2,\n thousandsSeparator: ',',\n padFractionalZeros: true,\n radix: '.',\n mapToRadix: ['.'],\n};\n\nexport const integerOptions = {\n mask: Number,\n scale: 0,\n thousandsSeparator: ',',\n padFractionalZeros: true,\n radix: '.',\n mapToRadix: ['.'],\n};\n","import { Component, Input, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface FieldOption {\n label: string;\n value: any;\n}\n\n@Component({\n selector: 'mz-checkbox-group',\n standalone: true,\n imports: [FormsModule],\n templateUrl: './checkbox-group.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MzCheckboxGroup),\n multi: true\n }\n ]\n})\nexport class MzCheckboxGroup implements ControlValueAccessor {\n @Input({ required: true }) options!: FieldOption[];\n selections: any[] = [];\n\n onChange: (value: string[]) => void = () => {};\n onTouched: () => void = () => {};\n\n // Writes the selected values from the form model\n writeValue(values: any[]): void {\n this.selections = values || [];\n }\n\n // Registers the onChange function to propagate changes\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n // Registers the onTouched function\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n setDisabledState?(isDisabled: boolean): void {\n \n }\n\n // Checks if a checkbox is selected\n isChecked(option: FieldOption): boolean {\n return this.selections.includes(option.value);\n }\n\n // Handles changes when checkboxes are clicked\n onCheckboxChange(event: Event, option: FieldOption): void {\n const checked = (event.target as HTMLInputElement).checked;\n\n if (checked) {\n this.selections = [...this.selections, option.value];\n } else {\n this.selections = this.selections.filter((val) => val !== option.value);\n }\n\n this.onChange(this.selections);\n this.onTouched();\n }\n}\n\n","@for(option of options; track $index) {\n<label class=\"field\">\n <input type=\"checkbox\" [value]=\"option.value\" [checked]=\"isChecked(option)\" (change)=\"onCheckboxChange($event, option)\" />\n <span class=\"checkbox-label\">{{option.label}}</span>\n</label>\n}\n","/*\n * Public API Surface of forms\n */\nexport * from './lib/field-error';\nexport * from './lib/model-state-result';\nexport * from './lib/model-schema.factory';\nexport * from './lib/model-validator';\nexport * from './lib/type-annotations';\nexport * from './lib/forms.module';\nexport * from './lib/ng-form-model-state.service';\nexport * from './lib/ngform-model-state';\nexport * from './lib/field-errors/field-errors.component';\nexport * from './lib/masks';\n\nexport { FieldSchema, FieldSchemaType, StringSchema, NumberSchema, DateSchema, BooleanSchema, FileSchema, ObjectSchema,\n buildStringSchema, buildNumberSchema, buildDateSchema, buildBooleanSchema\n } from './lib/field-schema';\nexport { MzCheckboxGroup, FieldOption } from './lib/checkbox-group/checkbox-group.component';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ModelSchemaFactory","FormsModule"],"mappings":";;;;;;;;;;;;MAIa,cAAc,CAAA;AACvB,IAAA,WAAA,CAAoB,MAAuB,EAAA;QAAvB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAiB;KAAI;AAG/C,IAAA,IAAI,KAAK,GAAA;;AAEL,QAAA,OAAO,EAAE,CAAC;KACb;AAED,IAAA,QAAQ,CAAC,GAAW,EAAA;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAClC;AAED,IAAA,QAAQ,CAAI,KAAQ,EAAA;QAChB,OAAO,IAAI,CAAC,MAAM;aACb,QAAQ,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;aACtC,IAAI,CAAC,MAAK;AACP,YAAA,OAAO,EAAE,CAAC;AACd,SAAC,CAAC;AACD,aAAA,KAAK,CAAC,CAAC,CAAkB,KAAI;AAC1B,YAAA,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,MAAiB,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAA,CAAC,CAAC;AAC9G,SAAC,CAAC,CAAC;KACV;IAED,WAAW,GAAA;QACP,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClC,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;KACjC;AACJ;;AChCM,MAAM,yBAAyB,GAAG,iCAAiC;;ICE9D,gBAQX;AARD,CAAA,UAAY,eAAe,EAAA;AACvB,IAAA,eAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AAC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A,SAAA,EAAA;AACP,YAAA;AACE,gBAAA,OAAO,EAAE,iBAAiB;AAC1B,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,eAAe,CAAC;AAC9C,gBAAA,KAAK,EAAE,IAAI;AACZ,aAAA;SACF,ECnBP,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,qRAMA,2CDKcC,aAAW,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAUZ,eAAe,EAAA,UAAA,EAAA,CAAA;kBAb3B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,cACjB,IAAI,EAAA,OAAA,EACP,CAACA,aAAW,CAAC,EAEX,SAAA,EAAA;AACP,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC;AAC9C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,qRAAA,EAAA,CAAA;8BAGwB,OAAO,EAAA,CAAA;sBAAjC,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;;;AEtB7B;;AAEG;;ACFH;;AAEG;;;;"}
|
package/lib/field-schema.d.ts
CHANGED
|
@@ -35,3 +35,54 @@ export interface FileSchema extends FieldSchema<FileTypeAnnotations> {
|
|
|
35
35
|
export interface ObjectSchema extends FieldSchema<ObjectTypeAnnotations> {
|
|
36
36
|
type: FieldSchemaType.object;
|
|
37
37
|
}
|
|
38
|
+
export declare const buildStringSchema: (path: string, constraints: StringTypeAnnotations, label?: string) => {
|
|
39
|
+
name: string;
|
|
40
|
+
label: string | undefined;
|
|
41
|
+
type: FieldSchemaType.string;
|
|
42
|
+
constraints: {
|
|
43
|
+
required?: import("./type-annotations").RequiredAnnotation | undefined;
|
|
44
|
+
length?: import("./type-annotations").LengthAnnotation | undefined;
|
|
45
|
+
pattern?: import("./type-annotations").PatternAnnotation | undefined;
|
|
46
|
+
maxLength?: import("./type-annotations").MaxLengthAnnotation | undefined;
|
|
47
|
+
minLength?: import("./type-annotations").MinLengthAnnotation | undefined;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export declare const buildBooleanSchema: (path: string, constraints: BooleanTypeAnnotations, label?: string) => {
|
|
51
|
+
name: string;
|
|
52
|
+
label: string | undefined;
|
|
53
|
+
type: FieldSchemaType.boolean;
|
|
54
|
+
constraints: {
|
|
55
|
+
required?: import("./type-annotations").RequiredAnnotation | undefined;
|
|
56
|
+
equals?: import("./type-annotations").EqualsAnnotation<boolean> | undefined;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export declare const buildNumberSchema: (path: string, constraints: NumberTypeAnnotations, label?: string) => {
|
|
60
|
+
name: string;
|
|
61
|
+
label: string | undefined;
|
|
62
|
+
type: FieldSchemaType.number;
|
|
63
|
+
constraints: {
|
|
64
|
+
required?: import("./type-annotations").RequiredAnnotation | undefined;
|
|
65
|
+
min?: import("./type-annotations").MinimumAnnotation<number> | undefined;
|
|
66
|
+
max?: import("./type-annotations").MaximumAnnotation<number> | undefined;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export declare const buildDateSchema: (path: string, constraints: DateTypeAnnotations, label?: string) => {
|
|
70
|
+
name: string;
|
|
71
|
+
label: string | undefined;
|
|
72
|
+
type: FieldSchemaType.date;
|
|
73
|
+
constraints: {
|
|
74
|
+
required?: import("./type-annotations").RequiredAnnotation | undefined;
|
|
75
|
+
min?: import("./type-annotations").MinimumAnnotation<Date> | undefined;
|
|
76
|
+
max?: import("./type-annotations").MaximumAnnotation<Date> | undefined;
|
|
77
|
+
test?: import("./type-annotations").TestAnnotation<Date> | undefined;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export declare const buildArraySchema: (path: string, constraints: ArrayTypeAnnotations, label?: string) => {
|
|
81
|
+
name: string;
|
|
82
|
+
label: string | undefined;
|
|
83
|
+
type: FieldSchemaType.array;
|
|
84
|
+
constraints: {
|
|
85
|
+
min?: import("./type-annotations").MinimumAnnotation<number> | undefined;
|
|
86
|
+
max?: import("./type-annotations").MaximumAnnotation<number> | undefined;
|
|
87
|
+
};
|
|
88
|
+
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muziehdesign/forms",
|
|
3
|
-
"version": "18.2.0-beta.
|
|
3
|
+
"version": "18.2.0-beta.770",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^18.2.13",
|
|
6
6
|
"@angular/core": "^18.2.13",
|
|
7
7
|
"@angular/forms": "^18.2.13",
|
|
8
|
-
"date-fns": "^
|
|
8
|
+
"date-fns": "^4.1.0",
|
|
9
9
|
"angular-imask": "^6.4.0",
|
|
10
10
|
"reflect-metadata": "^0.1.13",
|
|
11
11
|
"yup": "^0.32.11"
|
package/public-api.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export * from './lib/ng-form-model-state.service';
|
|
|
8
8
|
export * from './lib/ngform-model-state';
|
|
9
9
|
export * from './lib/field-errors/field-errors.component';
|
|
10
10
|
export * from './lib/masks';
|
|
11
|
-
export { FieldSchema, FieldSchemaType, StringSchema, NumberSchema, DateSchema, BooleanSchema, FileSchema, ObjectSchema } from './lib/field-schema';
|
|
11
|
+
export { FieldSchema, FieldSchemaType, StringSchema, NumberSchema, DateSchema, BooleanSchema, FileSchema, ObjectSchema, buildStringSchema, buildNumberSchema, buildDateSchema, buildBooleanSchema } from './lib/field-schema';
|
|
12
12
|
export { MzCheckboxGroup, FieldOption } from './lib/checkbox-group/checkbox-group.component';
|