@muziehdesign/forms 19.2.979 → 20.0.0-beta.1007
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/muziehdesign-forms.mjs +220 -78
- package/fesm2022/muziehdesign-forms.mjs.map +1 -1
- package/index.d.ts +802 -3
- package/package.json +4 -4
- package/lib/checkbox-group/checkbox-group.component.d.ts +0 -21
- package/lib/constants.d.ts +0 -1
- package/lib/date-value-accessor.directive.d.ts +0 -19
- package/lib/field/field.component.d.ts +0 -18
- package/lib/field-error.d.ts +0 -5
- package/lib/field-errors/field-errors.component.d.ts +0 -8
- package/lib/field-schema.d.ts +0 -88
- package/lib/form/form.directive.d.ts +0 -14
- package/lib/forms.module.d.ts +0 -20
- package/lib/masks.d.ts +0 -22
- package/lib/model-schema.d.ts +0 -21
- package/lib/model-schema.factory.d.ts +0 -20
- package/lib/model-state-options.d.ts +0 -4
- package/lib/model-state-result.d.ts +0 -6
- package/lib/ng-form-model-state.service.d.ts +0 -12
- package/lib/ngform-model-state.d.ts +0 -25
- package/lib/type-annotations.d.ts +0 -131
- package/public-api.d.ts +0 -15
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muziehdesign/forms",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0-beta.1007",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": ">=
|
|
6
|
-
"@angular/core": ">=
|
|
7
|
-
"@angular/forms": ">=
|
|
5
|
+
"@angular/common": ">=20.0.0",
|
|
6
|
+
"@angular/core": ">=20.0.0",
|
|
7
|
+
"@angular/forms": ">=20.0.0",
|
|
8
8
|
"date-fns": ">=4.1.0",
|
|
9
9
|
"angular-imask": ">=7.6.1",
|
|
10
10
|
"reflect-metadata": ">=0.1.13",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ControlValueAccessor } from '@angular/forms';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export type FieldOption = {
|
|
4
|
-
label: string;
|
|
5
|
-
value: any;
|
|
6
|
-
};
|
|
7
|
-
export declare class MzCheckboxGroup implements ControlValueAccessor {
|
|
8
|
-
options: FieldOption[];
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
selections: any[];
|
|
11
|
-
onChange: (value: string[]) => void;
|
|
12
|
-
onTouched: () => void;
|
|
13
|
-
writeValue(values: any[]): void;
|
|
14
|
-
registerOnChange(fn: any): void;
|
|
15
|
-
registerOnTouched(fn: any): void;
|
|
16
|
-
setDisabledState?(isDisabled: boolean): void;
|
|
17
|
-
isChecked(option: FieldOption): boolean;
|
|
18
|
-
onCheckboxChange(event: Event, option: FieldOption): void;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MzCheckboxGroup, never>;
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MzCheckboxGroup, "mz-checkbox-group", never, { "options": { "alias": "options"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
21
|
-
}
|
package/lib/constants.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SCHEMA_METADATA_NAMESPACE = "custom:muziehdesign:annotations";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
-
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class DateValueAccessor implements ControlValueAccessor {
|
|
5
|
-
private _renderer;
|
|
6
|
-
private _elementRef;
|
|
7
|
-
onChange: (_: any) => void;
|
|
8
|
-
onTouched: () => void;
|
|
9
|
-
constructor(_renderer: Renderer2, _elementRef: ElementRef);
|
|
10
|
-
writeValue(obj?: Date): void;
|
|
11
|
-
registerOnChange(fn: any): void;
|
|
12
|
-
registerOnTouched(fn: any): void;
|
|
13
|
-
setDisabledState?(isDisabled: boolean): void;
|
|
14
|
-
protected setProperty(key: string, value: any): void;
|
|
15
|
-
private parseDate;
|
|
16
|
-
private createDate;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DateValueAccessor, never>;
|
|
18
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DateValueAccessor, "[mzDateInput]", never, {}, {}, never, never, true, never>;
|
|
19
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AfterContentInit, ElementRef } from '@angular/core';
|
|
2
|
-
import { NgModel } from '@angular/forms';
|
|
3
|
-
import { FieldSchema } from '../field-schema';
|
|
4
|
-
import { FieldMetadata } from '../model-schema';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class MzField implements AfterContentInit {
|
|
7
|
-
private elementRef;
|
|
8
|
-
label?: string;
|
|
9
|
-
controlType: 'checkbox' | 'checkboxgroup' | 'other';
|
|
10
|
-
schema?: FieldSchema<any>;
|
|
11
|
-
ngModel?: NgModel;
|
|
12
|
-
fieldMetadata?: FieldMetadata;
|
|
13
|
-
constructor(elementRef: ElementRef);
|
|
14
|
-
ngAfterContentInit(): void;
|
|
15
|
-
getErrorMessage(): string | undefined;
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MzField, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MzField, "mz-field", never, { "label": { "alias": "label"; "required": false; }; "controlType": { "alias": "controlType"; "required": false; }; "schema": { "alias": "schema"; "required": false; }; }, {}, ["ngModel"], ["*"], true, never>;
|
|
18
|
-
}
|
package/lib/field-error.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { NgControl } from '@angular/forms';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class FieldErrorsComponent {
|
|
4
|
-
field?: NgControl;
|
|
5
|
-
get errorMessage(): string;
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FieldErrorsComponent, never>;
|
|
7
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FieldErrorsComponent, "mz-field-errors", never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, false, never>;
|
|
8
|
-
}
|
package/lib/field-schema.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { ArrayTypeAnnotations, BooleanTypeAnnotations, ConstraintAnnotations, DateTypeAnnotations, FileTypeAnnotations, NumberTypeAnnotations, ObjectTypeAnnotations, StringTypeAnnotations } from './type-annotations';
|
|
2
|
-
export declare enum FieldSchemaType {
|
|
3
|
-
string = "string",
|
|
4
|
-
boolean = "boolean",
|
|
5
|
-
date = "date",
|
|
6
|
-
object = "object",
|
|
7
|
-
number = "number",
|
|
8
|
-
array = "array",
|
|
9
|
-
file = "file"
|
|
10
|
-
}
|
|
11
|
-
export interface FieldSchema<T extends ConstraintAnnotations> {
|
|
12
|
-
name: string;
|
|
13
|
-
type: FieldSchemaType;
|
|
14
|
-
label?: string;
|
|
15
|
-
constraints: T;
|
|
16
|
-
}
|
|
17
|
-
export interface StringSchema extends FieldSchema<StringTypeAnnotations> {
|
|
18
|
-
type: FieldSchemaType.string;
|
|
19
|
-
}
|
|
20
|
-
export interface NumberSchema extends FieldSchema<NumberTypeAnnotations> {
|
|
21
|
-
type: FieldSchemaType.number;
|
|
22
|
-
}
|
|
23
|
-
export interface BooleanSchema extends FieldSchema<BooleanTypeAnnotations> {
|
|
24
|
-
type: FieldSchemaType.boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface DateSchema extends FieldSchema<DateTypeAnnotations> {
|
|
27
|
-
type: FieldSchemaType.date;
|
|
28
|
-
}
|
|
29
|
-
export interface ArraySchema extends FieldSchema<ArrayTypeAnnotations> {
|
|
30
|
-
type: FieldSchemaType.array;
|
|
31
|
-
}
|
|
32
|
-
export interface FileSchema extends FieldSchema<FileTypeAnnotations> {
|
|
33
|
-
type: FieldSchemaType.file;
|
|
34
|
-
}
|
|
35
|
-
export interface ObjectSchema extends FieldSchema<ObjectTypeAnnotations> {
|
|
36
|
-
type: FieldSchemaType.object;
|
|
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;
|
|
44
|
-
length?: import("./type-annotations").LengthAnnotation;
|
|
45
|
-
pattern?: import("./type-annotations").PatternAnnotation;
|
|
46
|
-
maxLength?: import("./type-annotations").MaxLengthAnnotation;
|
|
47
|
-
minLength?: import("./type-annotations").MinLengthAnnotation;
|
|
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;
|
|
56
|
-
equals?: import("./type-annotations").EqualsAnnotation<boolean>;
|
|
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;
|
|
65
|
-
min?: import("./type-annotations").MinimumAnnotation<number>;
|
|
66
|
-
max?: import("./type-annotations").MaximumAnnotation<number>;
|
|
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;
|
|
75
|
-
min?: import("./type-annotations").MinimumAnnotation<Date>;
|
|
76
|
-
max?: import("./type-annotations").MaximumAnnotation<Date>;
|
|
77
|
-
test?: import("./type-annotations").TestAnnotation<Date>;
|
|
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>;
|
|
86
|
-
max?: import("./type-annotations").MaximumAnnotation<number>;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AfterViewInit } from '@angular/core';
|
|
2
|
-
import { NgForm } from '@angular/forms';
|
|
3
|
-
import { ModelSchema } from '../model-schema';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class MzForm implements AfterViewInit {
|
|
6
|
-
private ngForm;
|
|
7
|
-
schema: ModelSchema<unknown>;
|
|
8
|
-
private modelState;
|
|
9
|
-
constructor(ngForm: NgForm);
|
|
10
|
-
ngAfterViewInit(): void;
|
|
11
|
-
onSubmit(event: Event): void;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MzForm, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MzForm, "[mzForm]", never, { "schema": { "alias": "schema"; "required": true; }; }, {}, never, never, true, never>;
|
|
14
|
-
}
|
package/lib/forms.module.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./field-errors/field-errors.component";
|
|
3
|
-
import * as i2 from "@angular/common";
|
|
4
|
-
import * as i3 from "./field/field.component";
|
|
5
|
-
import * as i4 from "./form/form.directive";
|
|
6
|
-
import * as i5 from "./date-value-accessor.directive";
|
|
7
|
-
import * as i6 from "./checkbox-group/checkbox-group.component";
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated
|
|
10
|
-
*/
|
|
11
|
-
export declare class FormsModule {
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormsModule, never>;
|
|
13
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<FormsModule, [typeof i1.FieldErrorsComponent], [typeof i2.CommonModule], [typeof i1.FieldErrorsComponent]>;
|
|
14
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<FormsModule>;
|
|
15
|
-
}
|
|
16
|
-
export declare class MzFormsModule {
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MzFormsModule, never>;
|
|
18
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MzFormsModule, never, [typeof i3.MzField, typeof i4.MzForm, typeof i5.DateValueAccessor, typeof i6.MzCheckboxGroup], [typeof i3.MzField, typeof i4.MzForm, typeof i5.DateValueAccessor, typeof i6.MzCheckboxGroup]>;
|
|
19
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<MzFormsModule>;
|
|
20
|
-
}
|
package/lib/masks.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const phoneNumberOptions: {
|
|
2
|
-
mask: string;
|
|
3
|
-
};
|
|
4
|
-
export declare const ssnOptions: {
|
|
5
|
-
mask: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const currencyOptions: {
|
|
8
|
-
mask: NumberConstructor;
|
|
9
|
-
scale: number;
|
|
10
|
-
thousandsSeparator: string;
|
|
11
|
-
padFractionalZeros: boolean;
|
|
12
|
-
radix: string;
|
|
13
|
-
mapToRadix: string[];
|
|
14
|
-
};
|
|
15
|
-
export declare const integerOptions: {
|
|
16
|
-
mask: NumberConstructor;
|
|
17
|
-
scale: number;
|
|
18
|
-
thousandsSeparator: string;
|
|
19
|
-
padFractionalZeros: boolean;
|
|
20
|
-
radix: string;
|
|
21
|
-
mapToRadix: string[];
|
|
22
|
-
};
|
package/lib/model-schema.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AnyObjectSchema } from 'yup';
|
|
2
|
-
import { FieldError } from './field-error';
|
|
3
|
-
import { FieldSchema } from './field-schema';
|
|
4
|
-
export declare class ModelSchema<T> {
|
|
5
|
-
private metadata;
|
|
6
|
-
private schema;
|
|
7
|
-
constructor(metadata: FieldSchema<any>[], schema: AnyObjectSchema);
|
|
8
|
-
getMetadata(paths: string[]): {
|
|
9
|
-
required: false;
|
|
10
|
-
} | {
|
|
11
|
-
required: true;
|
|
12
|
-
};
|
|
13
|
-
validate<T>(model: T): Promise<FieldError[]>;
|
|
14
|
-
cast(value: any): any;
|
|
15
|
-
}
|
|
16
|
-
export type SchemaDefinition<T> = {
|
|
17
|
-
[K in keyof Required<T>]: FieldSchema<any>;
|
|
18
|
-
};
|
|
19
|
-
export interface FieldMetadata {
|
|
20
|
-
required: boolean;
|
|
21
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ModelSchema } from './model-schema';
|
|
2
|
-
import { FieldSchema } from './field-schema';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ModelSchemaFactory {
|
|
5
|
-
constructor();
|
|
6
|
-
build<T extends object>(model: T): ModelSchema<T>;
|
|
7
|
-
buildUntyped(raw: FieldSchema<any>[]): ModelSchema<{
|
|
8
|
-
[key: string]: string;
|
|
9
|
-
}>;
|
|
10
|
-
private buildYupSchema;
|
|
11
|
-
private buildStringSchema;
|
|
12
|
-
private buildBooleanSchema;
|
|
13
|
-
private buildDateSchema;
|
|
14
|
-
private buildNumberSchema;
|
|
15
|
-
private buildArraySchema;
|
|
16
|
-
private buildNestedObjectSchema;
|
|
17
|
-
private buildFileSchema;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ModelSchemaFactory, never>;
|
|
19
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ModelSchemaFactory>;
|
|
20
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NgForm } from '@angular/forms';
|
|
2
|
-
import { ModelSchemaFactory } from './model-schema.factory';
|
|
3
|
-
import { ModelStateOptions } from './model-state-options';
|
|
4
|
-
import { NgFormModelState } from './ngform-model-state';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class NgFormModelStateFactory {
|
|
7
|
-
private factory;
|
|
8
|
-
constructor(factory: ModelSchemaFactory);
|
|
9
|
-
create<T extends object>(form: NgForm, model: T, options?: ModelStateOptions): NgFormModelState<T>;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgFormModelStateFactory, never>;
|
|
11
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<NgFormModelStateFactory>;
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { NgForm } from '@angular/forms';
|
|
2
|
-
import { FieldError } from './field-error';
|
|
3
|
-
import { ModelStateOptions } from './model-state-options';
|
|
4
|
-
import { ModelStateResult } from './model-state-result';
|
|
5
|
-
import { ModelSchema } from './model-schema';
|
|
6
|
-
export declare class NgFormModelState<T> {
|
|
7
|
-
private form;
|
|
8
|
-
private modelValidator;
|
|
9
|
-
private options?;
|
|
10
|
-
private changesSubject;
|
|
11
|
-
readonly changes: import("rxjs").Observable<ModelStateResult<T> | undefined>;
|
|
12
|
-
constructor(form: NgForm, modelValidator: ModelSchema<T>, options?: ModelStateOptions | undefined);
|
|
13
|
-
getCurrent(): ModelStateResult<T> | undefined;
|
|
14
|
-
setState(model: T, errors: FieldError[]): void;
|
|
15
|
-
setErrors(errors: FieldError[]): void;
|
|
16
|
-
appendErrors(errors: FieldError[], skipEmit?: boolean): void;
|
|
17
|
-
validate(): Promise<ModelStateResult<T>>;
|
|
18
|
-
private setStateInternal;
|
|
19
|
-
private deleteFormErrors;
|
|
20
|
-
private deleteErrors;
|
|
21
|
-
private deleteErrorsFromControl;
|
|
22
|
-
private isParentControl;
|
|
23
|
-
private loopFormArray;
|
|
24
|
-
private runValidations;
|
|
25
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
export interface ConstraintAnnotations {
|
|
3
|
-
}
|
|
4
|
-
export interface StringTypeConstraints {
|
|
5
|
-
required?: true;
|
|
6
|
-
requiredMessage?: string;
|
|
7
|
-
pattern?: RegExp;
|
|
8
|
-
patternMessage?: string;
|
|
9
|
-
length?: number;
|
|
10
|
-
lengthMessage?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface StringTypeAnnotations extends ConstraintAnnotations {
|
|
13
|
-
required?: RequiredAnnotation;
|
|
14
|
-
length?: LengthAnnotation;
|
|
15
|
-
pattern?: PatternAnnotation;
|
|
16
|
-
maxLength?: MaxLengthAnnotation;
|
|
17
|
-
minLength?: MinLengthAnnotation;
|
|
18
|
-
}
|
|
19
|
-
export interface BooleanTypeAnnotations extends ConstraintAnnotations {
|
|
20
|
-
required?: RequiredAnnotation;
|
|
21
|
-
equals?: EqualsAnnotation<boolean>;
|
|
22
|
-
}
|
|
23
|
-
export interface DateTypeAnnotations extends ConstraintAnnotations {
|
|
24
|
-
required?: RequiredAnnotation;
|
|
25
|
-
min?: MinimumAnnotation<Date>;
|
|
26
|
-
max?: MaximumAnnotation<Date>;
|
|
27
|
-
test?: TestAnnotation<Date>;
|
|
28
|
-
}
|
|
29
|
-
export interface ObjectTypeAnnotations extends ConstraintAnnotations {
|
|
30
|
-
required?: RequiredAnnotation;
|
|
31
|
-
getInstance: () => any;
|
|
32
|
-
}
|
|
33
|
-
export interface NumberTypeAnnotations extends ConstraintAnnotations {
|
|
34
|
-
required?: RequiredAnnotation;
|
|
35
|
-
min?: MinimumAnnotation<number>;
|
|
36
|
-
max?: MaximumAnnotation<number>;
|
|
37
|
-
}
|
|
38
|
-
export interface ArrayTypeAnnotations extends ConstraintAnnotations {
|
|
39
|
-
min?: MinimumAnnotation<number>;
|
|
40
|
-
max?: MaximumAnnotation<number>;
|
|
41
|
-
}
|
|
42
|
-
export interface FileTypeAnnotations extends ConstraintAnnotations {
|
|
43
|
-
required?: RequiredAnnotation;
|
|
44
|
-
}
|
|
45
|
-
export interface ValidationAnnotation {
|
|
46
|
-
message?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface RequiredAnnotation extends ValidationAnnotation {
|
|
49
|
-
required: boolean;
|
|
50
|
-
}
|
|
51
|
-
export interface LengthAnnotation extends ValidationAnnotation {
|
|
52
|
-
length: number;
|
|
53
|
-
}
|
|
54
|
-
export interface PatternAnnotation extends ValidationAnnotation {
|
|
55
|
-
pattern: RegExp;
|
|
56
|
-
}
|
|
57
|
-
export interface OfValuesAnnotation extends ValidationAnnotation {
|
|
58
|
-
values: [];
|
|
59
|
-
}
|
|
60
|
-
export interface EqualsAnnotation<T> extends ValidationAnnotation {
|
|
61
|
-
equals: T;
|
|
62
|
-
}
|
|
63
|
-
export interface MinimumAnnotation<T> extends ValidationAnnotation {
|
|
64
|
-
min: T;
|
|
65
|
-
}
|
|
66
|
-
export interface MaximumAnnotation<T> extends ValidationAnnotation {
|
|
67
|
-
max: T;
|
|
68
|
-
}
|
|
69
|
-
export interface TestAnnotation<T> extends ValidationAnnotation {
|
|
70
|
-
test: (d: T) => boolean;
|
|
71
|
-
name: string;
|
|
72
|
-
}
|
|
73
|
-
export interface MaxLengthAnnotation extends ValidationAnnotation {
|
|
74
|
-
maxLength: number;
|
|
75
|
-
}
|
|
76
|
-
export interface MinLengthAnnotation extends ValidationAnnotation {
|
|
77
|
-
minLength: number;
|
|
78
|
-
}
|
|
79
|
-
export declare function StringType(...annotations: {
|
|
80
|
-
[key: string]: ValidationAnnotation;
|
|
81
|
-
}[]): (target: Object, propertyKey: string) => void;
|
|
82
|
-
export declare function BooleanType(...annotations: {
|
|
83
|
-
[key: string]: ValidationAnnotation;
|
|
84
|
-
}[]): (target: Object, propertyKey: string) => void;
|
|
85
|
-
export declare function DateType(...annotations: {
|
|
86
|
-
[key: string]: ValidationAnnotation;
|
|
87
|
-
}[]): (target: Object, propertyKey: string) => void;
|
|
88
|
-
export declare function NumberType(...annotations: {
|
|
89
|
-
[key: string]: ValidationAnnotation;
|
|
90
|
-
}[]): (target: Object, propertyKey: string) => void;
|
|
91
|
-
export declare function ObjectType<T>(type: {
|
|
92
|
-
new (): T;
|
|
93
|
-
}, ...annotations: {
|
|
94
|
-
[key: string]: ValidationAnnotation;
|
|
95
|
-
}[]): (target: Object, propertyKey: string) => void;
|
|
96
|
-
export declare function ArrayType(...annotations: {
|
|
97
|
-
[key: string]: ValidationAnnotation;
|
|
98
|
-
}[]): (target: Object, propertyKey: string) => void;
|
|
99
|
-
export declare function FileType<T>(...annotations: {
|
|
100
|
-
[key: string]: ValidationAnnotation;
|
|
101
|
-
}[]): (target: Object, propertyKey: string) => void;
|
|
102
|
-
export declare function required(message?: string): {
|
|
103
|
-
[key: string]: RequiredAnnotation;
|
|
104
|
-
};
|
|
105
|
-
export declare function pattern(regex: RegExp, message?: string): {
|
|
106
|
-
[key: string]: PatternAnnotation;
|
|
107
|
-
};
|
|
108
|
-
export declare function length(length: number, message?: string): {
|
|
109
|
-
[key: string]: LengthAnnotation;
|
|
110
|
-
};
|
|
111
|
-
export declare function maxLength(maxLength: number, message?: string): {
|
|
112
|
-
[key: string]: MaxLengthAnnotation;
|
|
113
|
-
};
|
|
114
|
-
export declare function minLength(minLength: number, message?: string): {
|
|
115
|
-
[key: string]: MinLengthAnnotation;
|
|
116
|
-
};
|
|
117
|
-
export declare function ofValues(values: [], message?: string): {
|
|
118
|
-
[key: string]: OfValuesAnnotation;
|
|
119
|
-
};
|
|
120
|
-
export declare function equals<T>(value: T, message?: string): {
|
|
121
|
-
[key: string]: EqualsAnnotation<T>;
|
|
122
|
-
};
|
|
123
|
-
export declare function min<T>(value: T, message?: string): {
|
|
124
|
-
[key: string]: MinimumAnnotation<T>;
|
|
125
|
-
};
|
|
126
|
-
export declare function max<T>(value: T, message?: string): {
|
|
127
|
-
[key: string]: MaximumAnnotation<T>;
|
|
128
|
-
};
|
|
129
|
-
export declare function test<T>(name: string, test: (d: T) => boolean, message?: string): {
|
|
130
|
-
[key: string]: TestAnnotation<T>;
|
|
131
|
-
};
|
package/public-api.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './lib/field-error';
|
|
2
|
-
export * from './lib/model-state-result';
|
|
3
|
-
export * from './lib/model-schema.factory';
|
|
4
|
-
export { ModelSchema, SchemaDefinition } from './lib/model-schema';
|
|
5
|
-
export * from './lib/type-annotations';
|
|
6
|
-
export * from './lib/ng-form-model-state.service';
|
|
7
|
-
export * from './lib/ngform-model-state';
|
|
8
|
-
export * from './lib/field-errors/field-errors.component';
|
|
9
|
-
export * from './lib/masks';
|
|
10
|
-
export { DateValueAccessor } from './lib/date-value-accessor.directive';
|
|
11
|
-
export { FieldSchema, FieldSchemaType, StringSchema, NumberSchema, DateSchema, BooleanSchema, FileSchema, ObjectSchema, buildStringSchema, buildNumberSchema, buildDateSchema, buildBooleanSchema, buildArraySchema } from './lib/field-schema';
|
|
12
|
-
export { MzCheckboxGroup, FieldOption } from './lib/checkbox-group/checkbox-group.component';
|
|
13
|
-
export { FormsModule, MzFormsModule } from './lib/forms.module';
|
|
14
|
-
export { MzForm } from './lib/form/form.directive';
|
|
15
|
-
export { MzField } from './lib/field/field.component';
|