@mediusinc/mng-commons 0.5.0 → 0.6.0
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/assets/i18n/en.json +2 -2
- package/assets/i18n/sl.json +2 -2
- package/esm2020/lib/components/action/action.component.mjs +3 -3
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +3 -3
- package/esm2020/lib/components/action/route/action-route.component.mjs +3 -3
- package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +3 -3
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +5 -5
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +3 -3
- package/esm2020/lib/components/layout/breadcrumb.component.mjs +3 -3
- package/esm2020/lib/components/layout/footer.component.mjs +3 -3
- package/esm2020/lib/components/layout/main-layout.component.mjs +3 -3
- package/esm2020/lib/components/layout/menu-item.component.mjs +3 -3
- package/esm2020/lib/components/layout/menu.component.mjs +3 -3
- package/esm2020/lib/components/layout/services/main-layout.component.service.mjs +3 -3
- package/esm2020/lib/components/layout/topbar.component.mjs +3 -3
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +3 -3
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/table.component.mjs +6 -7
- package/esm2020/lib/components/tableview/tableview.component.mjs +3 -3
- package/esm2020/lib/config/formly.config.mjs +3 -3
- package/esm2020/lib/descriptors/editor.descriptor.mjs +3 -3
- package/esm2020/lib/descriptors/field-validation.descriptor.mjs +21 -0
- package/esm2020/lib/descriptors/field.descriptor.mjs +14 -14
- package/esm2020/lib/descriptors/index.mjs +2 -2
- package/esm2020/lib/descriptors/table.descriptor.mjs +21 -1
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +4 -4
- package/esm2020/lib/directives/component.directive.mjs +3 -3
- package/esm2020/lib/directives/template.directive.mjs +3 -3
- package/esm2020/lib/mng-commons.module.mjs +4 -4
- package/esm2020/lib/pipes/boolean.pipe.mjs +3 -3
- package/esm2020/lib/pipes/enum.pipe.mjs +3 -3
- package/esm2020/lib/pipes/i18n-property.pipe.mjs +3 -3
- package/esm2020/lib/pipes/json-path.pipe.mjs +3 -3
- package/esm2020/lib/pipes/link-formatter.pipe.mjs +3 -3
- package/esm2020/lib/services/action-executor.service.mjs +3 -3
- package/esm2020/lib/services/commons.service.mjs +3 -3
- package/esm2020/lib/services/internal/commons-init.service.mjs +3 -3
- package/esm2020/lib/services/navigation.service.mjs +3 -3
- package/esm2020/lib/services/view-container.component.service.mjs +3 -3
- package/esm2020/lib/types/type.model.mjs +1 -1
- package/esm2020/lib/utils/editor-formly.util.mjs +71 -11
- package/fesm2015/mediusinc-mng-commons.mjs +248 -169
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +248 -169
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/tableview/table/table.component.d.ts +1 -1
- package/lib/descriptors/editor.descriptor.d.ts +2 -3
- package/lib/descriptors/field-validation.descriptor.d.ts +18 -0
- package/lib/descriptors/field.descriptor.d.ts +8 -9
- package/lib/descriptors/index.d.ts +1 -1
- package/lib/descriptors/table.descriptor.d.ts +5 -0
- package/lib/descriptors/tableview.descriptor.d.ts +2 -2
- package/lib/types/type.model.d.ts +7 -0
- package/lib/utils/editor-formly.util.d.ts +2 -1
- package/package.json +6 -6
- package/esm2020/lib/descriptors/field.validator.mjs +0 -21
- package/lib/descriptors/field.validator.d.ts +0 -18
|
@@ -48,7 +48,7 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
|
|
|
48
48
|
queryResult$?: Observable<MediusQueryResult<T>>;
|
|
49
49
|
loading$?: Observable<boolean>;
|
|
50
50
|
dataProviderInfiniteScrollItems: Array<T>;
|
|
51
|
-
|
|
51
|
+
rowsPerPageOptions: Array<number>;
|
|
52
52
|
rows: number;
|
|
53
53
|
offset: number;
|
|
54
54
|
multiSortMeta: SortMeta[] | null;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
1
|
+
import { ClassType, EnumConstantType, EnumType, MngFieldValidationMessage, MngFieldValidator } from '../types';
|
|
3
2
|
import { AFieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, ModelDescriptor, TableDescriptor, TableviewDescriptor } from './';
|
|
4
3
|
export declare class EditorDescriptor<T> {
|
|
5
4
|
static readonly defaultGroupName = "_default";
|
|
@@ -28,7 +27,7 @@ export declare class EditorDescriptor<T> {
|
|
|
28
27
|
addFieldManyEditor<FT>(property: string, tableviewDescriptor: TableviewDescriptor<FT>): FieldManyEditorDescriptor<FT, T>;
|
|
29
28
|
addFieldManyToManyEditor<FT>(property: string, mainTableDescriptor: TableDescriptor<FT>, lookupTableDescriptor: TableDescriptor<FT>): FieldManyToManyEditorDescriptor<FT, T>;
|
|
30
29
|
withDisabled(disabled?: boolean): this;
|
|
31
|
-
|
|
30
|
+
addValidation(name: string, validator?: MngFieldValidator, message?: MngFieldValidationMessage): void;
|
|
32
31
|
copy(): EditorDescriptor<T>;
|
|
33
32
|
createFieldGroupDescriptor(fieldGroup: FieldGroupDescriptor<T>): this;
|
|
34
33
|
private createTabGroupDescriptor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { MngFieldValidationMessage, MngFieldValidator } from '../types';
|
|
4
|
+
export declare class FieldValidationDescriptor {
|
|
5
|
+
private readonly _name;
|
|
6
|
+
private readonly _validator?;
|
|
7
|
+
private readonly _message?;
|
|
8
|
+
private readonly _options?;
|
|
9
|
+
constructor(name: string, validator?: MngFieldValidator, message?: string | ((error: any, field: FormlyFieldConfig) => string | Observable<string>), options?: {
|
|
10
|
+
errorPath: string;
|
|
11
|
+
});
|
|
12
|
+
get name(): string;
|
|
13
|
+
get validator(): MngFieldValidator | undefined;
|
|
14
|
+
get message(): MngFieldValidationMessage | undefined;
|
|
15
|
+
get options(): {
|
|
16
|
+
errorPath: string;
|
|
17
|
+
} | undefined;
|
|
18
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
import { AbstractControl } from '@angular/forms';
|
|
3
2
|
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
4
3
|
import { Observable, Subject } from 'rxjs';
|
|
5
4
|
import { MediusQueryParam, MediusQueryResult } from '../api/models';
|
|
6
5
|
import { MngFormFieldEvent, MngFormFieldEventData, MngFormFieldEventTypeEnum } from '../components/form/models';
|
|
7
6
|
import { ILookupDataProvider, ITableDataProvider } from '../data-providers';
|
|
8
7
|
import { EnumValue } from '../models';
|
|
9
|
-
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
10
|
-
import { ActionDescriptor, EditorDescriptor,
|
|
8
|
+
import { ClassType, EnumConstantType, EnumType, MngFieldValidationMessage, MngFieldValidator } from '../types';
|
|
9
|
+
import { ActionDescriptor, EditorDescriptor, FieldValidationDescriptor, ILookupDescriptor, TableDescriptor, TableviewDescriptor } from './';
|
|
11
10
|
import { FieldConfig, FieldLookupConfig } from './field.descriptor.interface';
|
|
12
11
|
export declare abstract class AGenericFieldDescriptor<ET> {
|
|
13
12
|
protected readonly _editor: EditorDescriptor<ET>;
|
|
@@ -28,7 +27,7 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
28
27
|
protected _defaultValue?: T;
|
|
29
28
|
protected _getter?: (item: ET) => T;
|
|
30
29
|
protected _setter?: (item: ET, value: T) => void;
|
|
31
|
-
protected
|
|
30
|
+
protected _validations: Array<FieldValidationDescriptor>;
|
|
32
31
|
protected _requiredExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
33
32
|
protected _disabledExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
34
33
|
protected _hiddenExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
@@ -49,7 +48,7 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
49
48
|
get defaultValue(): T | undefined;
|
|
50
49
|
get getter(): ((item: ET) => T) | undefined;
|
|
51
50
|
get setter(): ((item: ET, value: T) => void) | undefined;
|
|
52
|
-
get
|
|
51
|
+
get validations(): FieldValidationDescriptor[];
|
|
53
52
|
get requiredExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
|
|
54
53
|
get disabledExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
|
|
55
54
|
get hiddenExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
|
|
@@ -70,7 +69,7 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
70
69
|
withDefaultValue(defaultValue: T): this;
|
|
71
70
|
withGetter(getter: (item: ET) => T): this;
|
|
72
71
|
withSetter(setter: (item: ET, value: T) => void): this;
|
|
73
|
-
|
|
72
|
+
withValidation(name: string, validator?: MngFieldValidator, message?: MngFieldValidationMessage): this;
|
|
74
73
|
withClassName(className: string, labelClassName?: string, inputClassName?: string, fieldClassName?: string): this;
|
|
75
74
|
withSize(size?: FieldDescriptor.SizeEnum): this;
|
|
76
75
|
nextEvent(type: MngFormFieldEventTypeEnum, cmpType: Type<any>, cmpInstance: any, data?: MngFormFieldEventData<T, ET>): void;
|
|
@@ -276,11 +275,11 @@ export declare abstract class AFieldGroupDescriptor<ET> extends AGenericFieldDes
|
|
|
276
275
|
protected readonly _default: boolean;
|
|
277
276
|
protected _title?: string;
|
|
278
277
|
protected _fields: AGenericFieldDescriptor<ET>[];
|
|
279
|
-
protected
|
|
278
|
+
protected _validations: Array<FieldValidationDescriptor>;
|
|
280
279
|
protected constructor(editor: EditorDescriptor<ET>, name: string);
|
|
281
280
|
get title(): string | undefined;
|
|
282
281
|
abstract get fields(): AGenericFieldDescriptor<ET>[];
|
|
283
|
-
get
|
|
282
|
+
get validations(): FieldValidationDescriptor[];
|
|
284
283
|
get baseName(): string;
|
|
285
284
|
get name(): string;
|
|
286
285
|
get default(): boolean;
|
|
@@ -288,7 +287,7 @@ export declare abstract class AFieldGroupDescriptor<ET> extends AGenericFieldDes
|
|
|
288
287
|
abstract addField(field: AGenericFieldDescriptor<ET>): this;
|
|
289
288
|
abstract copy(): AFieldGroupDescriptor<ET>;
|
|
290
289
|
withTitle(title: string): this;
|
|
291
|
-
|
|
290
|
+
withValidation(name: string, validator?: MngFieldValidator, message?: MngFieldValidationMessage): this;
|
|
292
291
|
}
|
|
293
292
|
export declare class FieldTabGroupDescriptor<ET> extends AFieldGroupDescriptor<ET> {
|
|
294
293
|
constructor(editor: EditorDescriptor<ET>, name: string);
|
|
@@ -3,7 +3,7 @@ export * from './column.descriptor';
|
|
|
3
3
|
export * from './editor.descriptor';
|
|
4
4
|
export * from './field.descriptor';
|
|
5
5
|
export * from './field.descriptor.interface';
|
|
6
|
-
export * from './field.
|
|
6
|
+
export * from './field-validation.descriptor';
|
|
7
7
|
export * from './filter.descriptor';
|
|
8
8
|
export * from './lookup.descriptor';
|
|
9
9
|
export * from './model.descriptor';
|
|
@@ -7,6 +7,8 @@ export declare class TableDescriptor<T> {
|
|
|
7
7
|
private readonly _model;
|
|
8
8
|
private _filterDisplay;
|
|
9
9
|
private _paginationMode;
|
|
10
|
+
private _rowsPerPageOptions;
|
|
11
|
+
private _defaultNumRows;
|
|
10
12
|
private _columns;
|
|
11
13
|
private _title?;
|
|
12
14
|
private _hideHeader;
|
|
@@ -19,6 +21,8 @@ export declare class TableDescriptor<T> {
|
|
|
19
21
|
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
|
|
20
22
|
get filterDisplay(): TableDescriptor.FilterDisplayEnum;
|
|
21
23
|
get paginationMode(): TableDescriptor.PaginationModeEnum;
|
|
24
|
+
get rowsPerPageOptions(): number[];
|
|
25
|
+
get defaultNumRows(): number;
|
|
22
26
|
get columns(): ColumnDescriptor<any, T>[];
|
|
23
27
|
get title(): string | undefined;
|
|
24
28
|
get hideHeader(): boolean;
|
|
@@ -38,6 +42,7 @@ export declare class TableDescriptor<T> {
|
|
|
38
42
|
addColumnCustomComponent(property: string, customComponentType: Type<IColumnValueComponent<T>>): ColumnDescriptor<any, T>;
|
|
39
43
|
withFilterDisplay(filterDisplayType: TableDescriptor.FilterDisplayEnum): this;
|
|
40
44
|
withPaginationMode(paginationMode: TableDescriptor.PaginationModeEnum): this;
|
|
45
|
+
withRowsPerPage(rows: number, options?: Array<number>): this;
|
|
41
46
|
withTitle(title: string): TableDescriptor<T>;
|
|
42
47
|
withHideHeader(hideHeader?: boolean): this;
|
|
43
48
|
withDataKeyProperty(property: string): TableDescriptor<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldValidatorFn } from '@ngx-formly/core/lib/models/config';
|
|
3
3
|
import { IColumnValueComponent } from '../models';
|
|
4
4
|
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
5
5
|
import { AFieldDescriptor, ColumnDescriptor, EditorDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, ModelDescriptor, TableDescriptor } from './';
|
|
@@ -22,7 +22,7 @@ export declare class TableviewDescriptor<T> {
|
|
|
22
22
|
withAddDescriptor(descriptor: EditorDescriptor<T>): this;
|
|
23
23
|
withEditDescriptor(descriptor: EditorDescriptor<T>): this;
|
|
24
24
|
withTableTitle(title: string): this;
|
|
25
|
-
withValidator(name: string, expression:
|
|
25
|
+
withValidator(name: string, expression: FieldValidatorFn): this;
|
|
26
26
|
addColumnDescriptor<CT>(column: ColumnDescriptor<CT, T>): TableDescriptor<T>;
|
|
27
27
|
addColumn(property: string): ColumnDescriptor<string, T>;
|
|
28
28
|
addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { AbstractControl, ValidationErrors } from '@angular/forms';
|
|
2
|
+
import { FormlyFieldConfig } from '@ngx-formly/core/lib/models/fieldconfig';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
1
4
|
export interface ClassType<T> extends Function {
|
|
2
5
|
new (...args: any[]): T;
|
|
3
6
|
}
|
|
@@ -8,3 +11,7 @@ export declare type EnumConstantType = string | number;
|
|
|
8
11
|
export declare type IdType = number | string;
|
|
9
12
|
export declare type PrimitiveType = string | boolean | number;
|
|
10
13
|
export declare type PropertyType = PrimitiveType | Date | EnumType;
|
|
14
|
+
export declare type MngFieldValidator = (control: AbstractControl, field: FormlyFieldConfig, options?: {
|
|
15
|
+
[id: string]: any;
|
|
16
|
+
}) => ValidationErrors | boolean | null;
|
|
17
|
+
export declare type MngFieldValidationMessage = string | ((error: any, field: FormlyFieldConfig) => string | Observable<string>);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
|
-
import { AFieldDescriptor, EditorDescriptor, FieldGroupDescriptor, FieldTabGroupDescriptor } from '../descriptors';
|
|
2
|
+
import { AFieldDescriptor, EditorDescriptor, FieldGroupDescriptor, FieldTabGroupDescriptor, FieldValidationDescriptor } from '../descriptors';
|
|
3
3
|
export declare class EditorFormlyUtil {
|
|
4
4
|
static createFormlyConfigFromDescriptor(descriptor: EditorDescriptor<any>): FormlyFieldConfig[];
|
|
5
5
|
static createFormlyTabType(tabGroups: FieldTabGroupDescriptor<any>[]): FormlyFieldConfig[];
|
|
6
6
|
static createFormlyGroupType(groups: FieldGroupDescriptor<any>[]): FormlyFieldConfig[];
|
|
7
7
|
static createFormlyFields(descriptor: FieldGroupDescriptor<any>): FormlyFieldConfig[];
|
|
8
8
|
static createFormlyField(descriptor: AFieldDescriptor<any, any>): FormlyFieldConfig;
|
|
9
|
+
static addValidationsToFormlyField(config: FormlyFieldConfig, validations: Array<FieldValidationDescriptor>): void;
|
|
9
10
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediusinc/mng-commons",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^13.
|
|
6
|
-
"@angular/core": "^13.
|
|
7
|
-
"@angular/forms": "^13.
|
|
8
|
-
"@angular/router": "^13.
|
|
9
|
-
"@ngx-formly/core": "
|
|
5
|
+
"@angular/common": "^13.2.0",
|
|
6
|
+
"@angular/core": "^13.2.0",
|
|
7
|
+
"@angular/forms": "^13.2.0",
|
|
8
|
+
"@angular/router": "^13.2.0",
|
|
9
|
+
"@ngx-formly/core": "6.0.0-next.9",
|
|
10
10
|
"@ngx-translate/core": "^14.0.0",
|
|
11
11
|
"primeng": "^13.0.0"
|
|
12
12
|
},
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export class FieldValidator {
|
|
2
|
-
constructor(name, expression, message, options) {
|
|
3
|
-
this._name = name;
|
|
4
|
-
this._expression = expression;
|
|
5
|
-
this._message = message;
|
|
6
|
-
this._options = options;
|
|
7
|
-
}
|
|
8
|
-
get name() {
|
|
9
|
-
return this._name;
|
|
10
|
-
}
|
|
11
|
-
get expression() {
|
|
12
|
-
return this._expression;
|
|
13
|
-
}
|
|
14
|
-
get message() {
|
|
15
|
-
return this._message;
|
|
16
|
-
}
|
|
17
|
-
get options() {
|
|
18
|
-
return this._options;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGQudmFsaWRhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpYi9kZXNjcmlwdG9ycy9maWVsZC52YWxpZGF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS0EsTUFBTSxPQUFPLGNBQWM7SUFNdkIsWUFDSSxJQUFZLEVBQ1osVUFBa0QsRUFDbEQsT0FBNkUsRUFDN0UsT0FBNkI7UUFFN0IsSUFBSSxDQUFDLEtBQUssR0FBRyxJQUFJLENBQUM7UUFDbEIsSUFBSSxDQUFDLFdBQVcsR0FBRyxVQUFVLENBQUM7UUFDOUIsSUFBSSxDQUFDLFFBQVEsR0FBRyxPQUFPLENBQUM7UUFDeEIsSUFBSSxDQUFDLFFBQVEsR0FBRyxPQUFPLENBQUM7SUFDNUIsQ0FBQztJQUVELElBQVcsSUFBSTtRQUNYLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQztJQUN0QixDQUFDO0lBRUQsSUFBVyxVQUFVO1FBQ2pCLE9BQU8sSUFBSSxDQUFDLFdBQVcsQ0FBQztJQUM1QixDQUFDO0lBRUQsSUFBVyxPQUFPO1FBQ2QsT0FBTyxJQUFJLENBQUMsUUFBUSxDQUFDO0lBQ3pCLENBQUM7SUFFRCxJQUFXLE9BQU87UUFDZCxPQUFPLElBQUksQ0FBQyxRQUFRLENBQUM7SUFDekIsQ0FBQztDQUNKIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtBYnN0cmFjdENvbnRyb2x9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcblxuaW1wb3J0IHtGb3JtbHlGaWVsZENvbmZpZ30gZnJvbSAnQG5neC1mb3JtbHkvY29yZSc7XG5pbXBvcnQge09ic2VydmFibGV9IGZyb20gJ3J4anMnO1xuXG5leHBvcnQgY2xhc3MgRmllbGRWYWxpZGF0b3Ige1xuICAgIHByaXZhdGUgcmVhZG9ubHkgX25hbWU6IHN0cmluZztcbiAgICBwcml2YXRlIHJlYWRvbmx5IF9leHByZXNzaW9uPzogKGNvbnRyb2w6IEFic3RyYWN0Q29udHJvbCkgPT4gYm9vbGVhbjtcbiAgICBwcml2YXRlIHJlYWRvbmx5IF9tZXNzYWdlPzogKGVycjogYW55LCBmaWVsZDogRm9ybWx5RmllbGRDb25maWcpID0+IHN0cmluZyB8IE9ic2VydmFibGU8c3RyaW5nPjtcbiAgICBwcml2YXRlIHJlYWRvbmx5IF9vcHRpb25zPzoge2Vycm9yUGF0aDogc3RyaW5nfTtcblxuICAgIGNvbnN0cnVjdG9yKFxuICAgICAgICBuYW1lOiBzdHJpbmcsXG4gICAgICAgIGV4cHJlc3Npb24/OiAoY29udHJvbDogQWJzdHJhY3RDb250cm9sKSA9PiBib29sZWFuLFxuICAgICAgICBtZXNzYWdlPzogKGVycjogYW55LCBmaWVsZDogRm9ybWx5RmllbGRDb25maWcpID0+IHN0cmluZyB8IE9ic2VydmFibGU8c3RyaW5nPixcbiAgICAgICAgb3B0aW9ucz86IHtlcnJvclBhdGg6IHN0cmluZ31cbiAgICApIHtcbiAgICAgICAgdGhpcy5fbmFtZSA9IG5hbWU7XG4gICAgICAgIHRoaXMuX2V4cHJlc3Npb24gPSBleHByZXNzaW9uO1xuICAgICAgICB0aGlzLl9tZXNzYWdlID0gbWVzc2FnZTtcbiAgICAgICAgdGhpcy5fb3B0aW9ucyA9IG9wdGlvbnM7XG4gICAgfVxuXG4gICAgcHVibGljIGdldCBuYW1lKCk6IHN0cmluZyB7XG4gICAgICAgIHJldHVybiB0aGlzLl9uYW1lO1xuICAgIH1cblxuICAgIHB1YmxpYyBnZXQgZXhwcmVzc2lvbigpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2V4cHJlc3Npb247XG4gICAgfVxuXG4gICAgcHVibGljIGdldCBtZXNzYWdlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fbWVzc2FnZTtcbiAgICB9XG5cbiAgICBwdWJsaWMgZ2V0IG9wdGlvbnMoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9vcHRpb25zO1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AbstractControl } from '@angular/forms';
|
|
2
|
-
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
export declare class FieldValidator {
|
|
5
|
-
private readonly _name;
|
|
6
|
-
private readonly _expression?;
|
|
7
|
-
private readonly _message?;
|
|
8
|
-
private readonly _options?;
|
|
9
|
-
constructor(name: string, expression?: (control: AbstractControl) => boolean, message?: (err: any, field: FormlyFieldConfig) => string | Observable<string>, options?: {
|
|
10
|
-
errorPath: string;
|
|
11
|
-
});
|
|
12
|
-
get name(): string;
|
|
13
|
-
get expression(): ((control: AbstractControl) => boolean) | undefined;
|
|
14
|
-
get message(): ((err: any, field: FormlyFieldConfig) => string | Observable<string>) | undefined;
|
|
15
|
-
get options(): {
|
|
16
|
-
errorPath: string;
|
|
17
|
-
} | undefined;
|
|
18
|
-
}
|