@mediusinc/mng-commons 0.2.8 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -0
- package/assets/i18n/en.json +202 -151
- package/assets/i18n/sl.json +202 -151
- package/esm2020/lib/api/utils/object-serializer.util.mjs +12 -7
- package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +2 -2
- package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +2 -4
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +1 -1
- 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-input/formly-field-input.component.mjs +9 -8
- package/esm2020/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +3 -3
- package/esm2020/lib/components/layout/menu-item.component.mjs +59 -17
- package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +1 -1
- 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 +2 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +5 -4
- package/esm2020/lib/components/tableview/tableview.component.mjs +1 -1
- package/esm2020/lib/config/formly.config.mjs +10 -1
- package/esm2020/lib/data-providers/base.data-provider.mjs +1 -8
- package/esm2020/lib/descriptors/editor.descriptor.mjs +113 -66
- package/esm2020/lib/descriptors/table.descriptor.mjs +130 -42
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +9 -6
- package/esm2020/lib/mng-commons.module.mjs +8 -2
- package/esm2020/lib/models/enum.model.mjs +2 -0
- package/esm2020/lib/models/index.mjs +3 -1
- package/esm2020/lib/models/menu.model.mjs +2 -0
- package/esm2020/lib/pipes/enum.pipe.mjs +22 -0
- package/esm2020/lib/pipes/i18n-property.pipe.mjs +18 -0
- package/esm2020/lib/pipes/index.mjs +3 -1
- package/esm2020/lib/router/route-builder.mjs +86 -17
- package/esm2020/lib/services/commons.service.mjs +1 -1
- package/esm2020/lib/types/type.decorator.mjs +7 -1
- package/esm2020/lib/types/type.model.mjs +1 -1
- package/esm2020/lib/utils/editor-formly.util.mjs +10 -1
- package/esm2020/lib/utils/enum.util.mjs +82 -0
- package/esm2020/lib/utils/i18n.util.mjs +38 -26
- package/esm2020/lib/utils/index.mjs +2 -1
- package/esm2020/lib/utils/type.util.mjs +39 -2
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/mediusinc-mng-commons.mjs +643 -197
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +637 -196
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/utils/object-serializer.util.d.ts +1 -0
- package/lib/components/layout/menu-item.component.d.ts +13 -5
- package/lib/components/tableview/table/column-value/column-value.component.d.ts +1 -0
- package/lib/data-providers/base.data-provider.d.ts +0 -3
- package/lib/descriptors/editor.descriptor.d.ts +43 -28
- package/lib/descriptors/table.descriptor.d.ts +37 -16
- package/lib/descriptors/tableview.descriptor.d.ts +9 -8
- package/lib/mng-commons.module.d.ts +70 -68
- package/lib/models/enum.model.d.ts +5 -0
- package/lib/models/index.d.ts +2 -0
- package/lib/models/menu.model.d.ts +25 -0
- package/lib/pipes/enum.pipe.d.ts +7 -0
- package/lib/pipes/i18n-property.pipe.d.ts +8 -0
- package/lib/pipes/index.d.ts +2 -0
- package/lib/router/route-builder.d.ts +9 -5
- package/lib/services/commons.service.d.ts +6 -6
- package/lib/types/type.decorator.d.ts +2 -0
- package/lib/types/type.model.d.ts +2 -2
- package/lib/utils/enum.util.d.ts +50 -0
- package/lib/utils/i18n.util.d.ts +6 -2
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/type.util.d.ts +22 -1
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
- package/scss/mng-overrides/_layout_forms.scss +5 -0
|
@@ -22,6 +22,7 @@ export declare class ObjectSerializer {
|
|
|
22
22
|
registerTypes(types: SerializableTypeMap): void;
|
|
23
23
|
registerType(type: ClassType<any>, optTypeName?: string): void;
|
|
24
24
|
registerEnums(enums: SerializableTypeMap): void;
|
|
25
|
+
registerEnum(enumType: any, enumName: string): void;
|
|
25
26
|
findCorrectType(data: any, expectedType: string): any;
|
|
26
27
|
serializeClass<T>(data: any, type: ClassType<T>): any;
|
|
27
28
|
serialize(data: any, type: string): any;
|
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
1
|
+
import { Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { MngMenuItem } from '../../models';
|
|
3
5
|
import { MngCommonsService } from '../../services';
|
|
4
6
|
import { MngMainLayoutComponentService } from './services';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
8
|
export declare class MngMenuItemComponent implements OnInit, OnDestroy {
|
|
7
|
-
|
|
9
|
+
private injector;
|
|
10
|
+
private router;
|
|
11
|
+
private route;
|
|
8
12
|
mngCommons: MngCommonsService;
|
|
9
13
|
mainLayoutService: MngMainLayoutComponentService;
|
|
10
|
-
item:
|
|
14
|
+
item: MngMenuItem;
|
|
11
15
|
index: number;
|
|
12
16
|
root: boolean;
|
|
13
17
|
parentKey: string | null;
|
|
14
18
|
key: string;
|
|
15
19
|
active: boolean;
|
|
16
20
|
hover: boolean;
|
|
21
|
+
private isAllowedSubject;
|
|
22
|
+
isAllowed$: Observable<boolean>;
|
|
17
23
|
private itemUrl?;
|
|
18
24
|
private menuSourceSubscription?;
|
|
19
25
|
private menuResetSubscription?;
|
|
20
26
|
private routerEventsSubscription?;
|
|
21
|
-
|
|
27
|
+
private guardsSubscription?;
|
|
28
|
+
constructor(injector: Injector, router: Router, route: ActivatedRoute, mngCommons: MngCommonsService, mainLayoutService: MngMainLayoutComponentService);
|
|
22
29
|
ngOnInit(): void;
|
|
23
30
|
updateActiveStateFromRoute(): void;
|
|
24
31
|
itemClick(event: Event): void;
|
|
25
32
|
onMouseEnter(): void;
|
|
26
33
|
ngOnDestroy(): void;
|
|
34
|
+
private checkIfMenuItemIsAllowedFromGuard;
|
|
27
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngMenuItemComponent, never>;
|
|
28
36
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngMenuItemComponent, "[mng-menuitem]", never, { "item": "item"; "index": "index"; "root": "root"; "parentKey": "parentKey"; }, {}, never, never>;
|
|
29
37
|
}
|
|
@@ -5,6 +5,7 @@ export declare class MngTableColumnValueComponent<T, TT> {
|
|
|
5
5
|
readonly columnTypeNumber: ColumnDescriptor.TypeEnum;
|
|
6
6
|
readonly columnTypeBoolean: ColumnDescriptor.TypeEnum;
|
|
7
7
|
readonly columnTypeDate: ColumnDescriptor.TypeEnum;
|
|
8
|
+
readonly columnTypeEnum: ColumnDescriptor.TypeEnum;
|
|
8
9
|
descriptor: ColumnDescriptor<T, TT>;
|
|
9
10
|
item: any;
|
|
10
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTableColumnValueComponent<any, any>, never>;
|
|
@@ -7,11 +7,8 @@ export interface IDataProvider<T, S> {
|
|
|
7
7
|
export declare class DataProvider<T, S> {
|
|
8
8
|
protected _modelType: ClassType<T> | null;
|
|
9
9
|
protected _serviceType?: Type<S>;
|
|
10
|
-
protected _enumName?: string;
|
|
11
10
|
constructor(modelType: ClassType<T> | null, serviceType?: Type<S>);
|
|
12
11
|
get serviceType(): Type<S> | undefined;
|
|
13
12
|
get modelType(): ClassType<T> | null;
|
|
14
|
-
get enumName(): string | undefined;
|
|
15
13
|
withServiceType(type: Type<S>): this;
|
|
16
|
-
withEnumName(enumName: string): this;
|
|
17
14
|
}
|
|
@@ -4,7 +4,8 @@ import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { MediusQueryParam, MediusQueryResult } from '../api/models';
|
|
6
6
|
import { ILookupDataProvider, ITableDataProvider } from '../data-providers';
|
|
7
|
-
import {
|
|
7
|
+
import { EnumValue } from '../models';
|
|
8
|
+
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
8
9
|
import { FieldValidator, ILookupDescriptor, ModelDescriptor, TableDescriptor, TableviewDescriptor } from './';
|
|
9
10
|
export declare class EditorDescriptor<T> {
|
|
10
11
|
static readonly defaultGroupName = "_default";
|
|
@@ -14,27 +15,27 @@ export declare class EditorDescriptor<T> {
|
|
|
14
15
|
private readonly _fields;
|
|
15
16
|
private _currentTabGroup?;
|
|
16
17
|
private _currentGroup?;
|
|
17
|
-
private _disabled;
|
|
18
18
|
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
|
|
19
|
+
private _disabled;
|
|
20
|
+
get disabled(): boolean;
|
|
19
21
|
get model(): ModelDescriptor<T>;
|
|
20
22
|
get tabs(): FieldTabGroupDescriptor<T>[];
|
|
21
|
-
get disabled(): boolean;
|
|
22
23
|
get fields(): AFieldDescriptor<any, T>[];
|
|
23
24
|
createTabGroup(name: string, title?: string): FieldTabGroupDescriptor<T>;
|
|
24
|
-
createFieldGroup(name: string, title?: string): FieldGroupDescriptor<T>;
|
|
25
|
+
createFieldGroup(name: string, title?: string | null): FieldGroupDescriptor<T>;
|
|
25
26
|
addFieldDescriptor<FT>(field: AFieldDescriptor<FT, T>): this;
|
|
26
27
|
addField(property: string): FieldInputDescriptor<T>;
|
|
27
28
|
removeField(property: string): this;
|
|
28
29
|
getField(property: string): AFieldDescriptor<any, T> | null;
|
|
29
30
|
addFieldLookup<FT>(property: string, modelType: ClassType<FT>): FieldLookupDescriptor<FT, T>;
|
|
30
|
-
addFieldLookupEnum(property: string,
|
|
31
|
+
addFieldLookupEnum(property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null): FieldLookupEnumDescriptor<T>;
|
|
31
32
|
addFieldManyEditor<FT>(property: string, type: ClassType<FT>, tableviewDescriptor: TableviewDescriptor<FT>): FieldManyEditorDescriptor<FT, T>;
|
|
32
33
|
addFieldManyToManyEditor<FT>(property: string, type: ClassType<FT>, mainTableDescriptor: TableDescriptor<FT>, lookupTableDescriptor: TableDescriptor<FT>): FieldManyToManyEditorDescriptor<FT, T>;
|
|
33
34
|
withDisabled(disabled?: boolean): this;
|
|
34
35
|
addValidator(name: string, expression: (control: AbstractControl) => boolean): void;
|
|
35
36
|
copy(): EditorDescriptor<T>;
|
|
36
|
-
private createTabGroupDescriptor;
|
|
37
37
|
createFieldGroupDescriptor(fieldGroup: FieldGroupDescriptor<T>): this;
|
|
38
|
+
private createTabGroupDescriptor;
|
|
38
39
|
private createDefaultGroup;
|
|
39
40
|
private createDefaultTabGroup;
|
|
40
41
|
}
|
|
@@ -50,28 +51,31 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
50
51
|
protected _placeholder?: string;
|
|
51
52
|
protected _required: boolean;
|
|
52
53
|
protected _disabled: boolean;
|
|
54
|
+
protected _defaultValue?: T;
|
|
53
55
|
protected _className: string;
|
|
54
56
|
protected _getter?: (item: ET) => T;
|
|
55
57
|
protected _setter?: (item: ET, value: T) => void;
|
|
56
58
|
protected _validators: Array<FieldValidator>;
|
|
57
59
|
protected _disabledFunction?: (model: any) => boolean;
|
|
58
60
|
protected constructor(editor: EditorDescriptor<ET>, property: string);
|
|
59
|
-
abstract copy(): AFieldDescriptor<T, ET>;
|
|
60
|
-
get property(): string;
|
|
61
61
|
get group(): AFieldGroupDescriptor<ET> | undefined;
|
|
62
62
|
get label(): string | undefined;
|
|
63
63
|
get placeholder(): string | undefined;
|
|
64
64
|
get required(): boolean;
|
|
65
65
|
get disabled(): boolean;
|
|
66
|
+
get defaultValue(): T | undefined;
|
|
66
67
|
get className(): string;
|
|
67
68
|
get getter(): ((item: ET) => T) | undefined;
|
|
68
69
|
get setter(): ((item: ET, value: T) => void) | undefined;
|
|
69
70
|
get validators(): FieldValidator[];
|
|
70
71
|
get disabledFunction(): ((model: any) => boolean) | undefined;
|
|
72
|
+
get property(): string;
|
|
73
|
+
abstract copy(): AFieldDescriptor<T, ET>;
|
|
71
74
|
withLabel(label: string): this;
|
|
72
75
|
withPlaceholder(placeholder: string): this;
|
|
73
76
|
withRequired(required?: boolean): this;
|
|
74
77
|
withDisabled(disabled?: boolean, disabledFunction?: (model: any) => boolean): this;
|
|
78
|
+
withDefaultValue(defaultValue: T): this;
|
|
75
79
|
withClassName(className: string): this;
|
|
76
80
|
withGetter(getter: (item: ET) => T): this;
|
|
77
81
|
withSetter(setter: (item: ET, value: T) => void): this;
|
|
@@ -94,15 +98,18 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
94
98
|
private _maxLength?;
|
|
95
99
|
private _minLength?;
|
|
96
100
|
private _pattern?;
|
|
101
|
+
private _mask?;
|
|
102
|
+
private _slotChar?;
|
|
103
|
+
private _customComponentName?;
|
|
97
104
|
constructor(editor: EditorDescriptor<ET>, property: string);
|
|
98
105
|
get fieldType(): FieldInputDescriptor.TypeEnum;
|
|
99
|
-
get
|
|
106
|
+
get rows(): number | undefined;
|
|
100
107
|
get numberMin(): number | undefined;
|
|
101
108
|
get numberMax(): number | undefined;
|
|
102
|
-
get
|
|
109
|
+
get numberStep(): number | undefined;
|
|
103
110
|
get numberMinFractionDigits(): number | undefined;
|
|
104
111
|
get numberMaxFractionDigits(): number | undefined;
|
|
105
|
-
get radioOptions(): string[];
|
|
112
|
+
get radioOptions(): EnumValue<string | number | boolean | Date>[];
|
|
106
113
|
get datePickerFormat(): string | undefined;
|
|
107
114
|
get datePickerMin(): Date | undefined;
|
|
108
115
|
get datePickerMax(): Date | undefined;
|
|
@@ -110,12 +117,18 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
110
117
|
get maxLength(): number | undefined;
|
|
111
118
|
get minLength(): number | undefined;
|
|
112
119
|
get pattern(): string | RegExp | undefined;
|
|
120
|
+
get mask(): string | undefined;
|
|
121
|
+
get slotChar(): string | undefined;
|
|
122
|
+
get customComponentName(): string | undefined;
|
|
113
123
|
asText(minLength?: number, maxLength?: number, pattern?: string | RegExp, isEmail?: boolean): this;
|
|
114
124
|
asTextarea(rows?: number, minLength?: number, maxLength?: number, pattern?: string | RegExp): this;
|
|
115
125
|
asNumber(step?: number, min?: number, max?: number, minFractionDigits?: number, maxFractionDigits?: number): this;
|
|
116
126
|
asSwitch(): this;
|
|
117
|
-
asRadio(options: Array<string
|
|
127
|
+
asRadio(options: Array<string | number>, optionsTitlePath?: string): this;
|
|
128
|
+
asRadioFromEnum(enumType: EnumType, optionsTitlePath?: string | null, values?: Array<EnumConstantType>, nameAsValue?: boolean): this;
|
|
118
129
|
asDatePicker(format?: string, min?: Date, max?: Date, showTime?: boolean): this;
|
|
130
|
+
asMask(mask: string, slotChar: string): this;
|
|
131
|
+
asCustomComponent(customComponentName: string): this;
|
|
119
132
|
copy(): FieldInputDescriptor<ET>;
|
|
120
133
|
}
|
|
121
134
|
export declare namespace FieldInputDescriptor {
|
|
@@ -125,7 +138,9 @@ export declare namespace FieldInputDescriptor {
|
|
|
125
138
|
Number = 2,
|
|
126
139
|
Switch = 3,
|
|
127
140
|
Radio = 4,
|
|
128
|
-
Datepicker = 5
|
|
141
|
+
Datepicker = 5,
|
|
142
|
+
Mask = 6,
|
|
143
|
+
Custom = 7
|
|
129
144
|
}
|
|
130
145
|
}
|
|
131
146
|
export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET> implements ILookupDescriptor<T> {
|
|
@@ -136,12 +151,12 @@ export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET
|
|
|
136
151
|
protected _dataKeyProperty?: string;
|
|
137
152
|
protected _dataProvider?: ILookupDataProvider<T, any>;
|
|
138
153
|
constructor(editor: EditorDescriptor<ET>, property: string, modelType: ClassType<T> | null);
|
|
139
|
-
get modelType(): ClassType<T> | null;
|
|
140
154
|
get lookupType(): FieldLookupDescriptor.LookupTypeEnum;
|
|
141
155
|
get itemsLabelProperty(): string | undefined;
|
|
142
156
|
get itemsValueProperty(): string | undefined;
|
|
143
157
|
get dataKeyProperty(): string | undefined;
|
|
144
158
|
get dataProvider(): ILookupDataProvider<T, any> | undefined;
|
|
159
|
+
get modelType(): ClassType<T> | null;
|
|
145
160
|
withItemsLabelProperty(itemsLabelProperty: string): this;
|
|
146
161
|
withItemsValueProperty(itemsValueProperty: string): this;
|
|
147
162
|
withDataKeyProperty(property: string): this;
|
|
@@ -156,10 +171,10 @@ export declare namespace FieldLookupDescriptor {
|
|
|
156
171
|
Autocomplete = 1
|
|
157
172
|
}
|
|
158
173
|
}
|
|
159
|
-
export declare class FieldLookupEnumDescriptor<ET> extends FieldLookupDescriptor<
|
|
160
|
-
private readonly
|
|
161
|
-
constructor(editor: EditorDescriptor<ET>, property: string,
|
|
162
|
-
get
|
|
174
|
+
export declare class FieldLookupEnumDescriptor<ET> extends FieldLookupDescriptor<EnumValue<string | number>, ET> {
|
|
175
|
+
private readonly _enumType;
|
|
176
|
+
constructor(editor: EditorDescriptor<ET>, property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null);
|
|
177
|
+
get enumType(): EnumType;
|
|
163
178
|
copy(): FieldLookupEnumDescriptor<ET>;
|
|
164
179
|
}
|
|
165
180
|
export declare class FieldManyToManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET> {
|
|
@@ -173,14 +188,14 @@ export declare class FieldManyToManyEditorDescriptor<T, ET> extends AFieldDescri
|
|
|
173
188
|
private _excludeFilterProperty;
|
|
174
189
|
private _excludeValueProperty;
|
|
175
190
|
constructor(editor: EditorDescriptor<ET>, property: string, modelType: ClassType<T>, mainTableDescriptor: TableDescriptor<T>, lookupTableDescriptor: TableDescriptor<T>);
|
|
176
|
-
get
|
|
177
|
-
get lookupTableDescriptor(): TableDescriptor<T>;
|
|
191
|
+
get fieldType(): FieldManyToManyEditorDescriptor.TypeEnum;
|
|
178
192
|
get lookupTableDataProvider(): ITableDataProvider<T, any> | null;
|
|
179
193
|
get actions(): FieldManyToManyEditorDescriptor.ActionEnum[];
|
|
180
|
-
get fieldType(): FieldManyToManyEditorDescriptor.TypeEnum;
|
|
181
194
|
get hasLookupExcludeValues(): boolean;
|
|
182
195
|
get excludeFilterProperty(): string;
|
|
183
196
|
get excludeValueProperty(): string;
|
|
197
|
+
get mainTableDescriptor(): TableDescriptor<T>;
|
|
198
|
+
get lookupTableDescriptor(): TableDescriptor<T>;
|
|
184
199
|
withLookup<S>(getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>, serviceType?: Type<S>): this;
|
|
185
200
|
withLookupDataProvider(dataProvider: ITableDataProvider<T, any>): this;
|
|
186
201
|
withActions(actions?: Array<FieldManyToManyEditorDescriptor.ActionEnum>): this;
|
|
@@ -202,13 +217,13 @@ export declare class FieldManyEditorDescriptor<T, ET> extends AFieldDescriptor<T
|
|
|
202
217
|
private _fieldType;
|
|
203
218
|
private _actions;
|
|
204
219
|
constructor(editor: EditorDescriptor<ET>, property: string, modelType: ClassType<T>, tableviewDescriptor: TableviewDescriptor<T>);
|
|
220
|
+
get fieldType(): FieldManyEditorDescriptor.TypeEnum;
|
|
221
|
+
get actions(): FieldManyEditorDescriptor.ActionEnum[];
|
|
205
222
|
get tableviewDescriptor(): TableviewDescriptor<T>;
|
|
206
223
|
get tableDescriptor(): TableDescriptor<T>;
|
|
207
224
|
get editorForCreate(): EditorDescriptor<T>;
|
|
208
225
|
get editorForRead(): EditorDescriptor<T>;
|
|
209
226
|
get editorForUpdate(): EditorDescriptor<T>;
|
|
210
|
-
get fieldType(): FieldManyEditorDescriptor.TypeEnum;
|
|
211
|
-
get actions(): FieldManyEditorDescriptor.ActionEnum[];
|
|
212
227
|
withActions(actions?: Array<FieldManyToManyEditorDescriptor.ActionEnum>): this;
|
|
213
228
|
copy(): FieldManyEditorDescriptor<T, ET>;
|
|
214
229
|
}
|
|
@@ -229,15 +244,15 @@ export declare abstract class AFieldGroupDescriptor<ET> extends AGenericFieldDes
|
|
|
229
244
|
protected _fields: AGenericFieldDescriptor<ET>[];
|
|
230
245
|
protected _validators: Array<FieldValidator>;
|
|
231
246
|
protected constructor(editor: EditorDescriptor<ET>, name: string);
|
|
247
|
+
get title(): string | undefined;
|
|
232
248
|
abstract get fields(): AGenericFieldDescriptor<ET>[];
|
|
233
|
-
|
|
234
|
-
abstract addField(field: AGenericFieldDescriptor<ET>): this;
|
|
235
|
-
abstract copy(): AFieldGroupDescriptor<ET>;
|
|
249
|
+
get validators(): FieldValidator[];
|
|
236
250
|
get baseName(): string;
|
|
237
251
|
get name(): string;
|
|
238
252
|
get default(): boolean;
|
|
239
|
-
|
|
240
|
-
|
|
253
|
+
abstract groupName(): string;
|
|
254
|
+
abstract addField(field: AGenericFieldDescriptor<ET>): this;
|
|
255
|
+
abstract copy(): AFieldGroupDescriptor<ET>;
|
|
241
256
|
withTitle(title: string): this;
|
|
242
257
|
withValidator(name: string, expression: (control: AbstractControl) => boolean): this;
|
|
243
258
|
}
|
|
@@ -2,7 +2,8 @@ import { Type } from '@angular/core';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { MediusQueryParam } from '../api/models';
|
|
4
4
|
import { ILookupDataProvider } from '../data-providers';
|
|
5
|
-
import {
|
|
5
|
+
import { EnumValue } from '../models';
|
|
6
|
+
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
6
7
|
import { ILookupDescriptor } from './lookup.descriptor';
|
|
7
8
|
import { ModelDescriptor } from './model.descriptor';
|
|
8
9
|
export declare class TableDescriptor<T> {
|
|
@@ -11,6 +12,7 @@ export declare class TableDescriptor<T> {
|
|
|
11
12
|
private _paginationMode;
|
|
12
13
|
private _columns;
|
|
13
14
|
private _title?;
|
|
15
|
+
private _hideHeader;
|
|
14
16
|
private _dataKeyProperty?;
|
|
15
17
|
private _hasDefaultSort;
|
|
16
18
|
private _defaultSortProperty;
|
|
@@ -18,32 +20,35 @@ export declare class TableDescriptor<T> {
|
|
|
18
20
|
private _rowHeight;
|
|
19
21
|
private _tableFullHeightOffset;
|
|
20
22
|
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
|
|
21
|
-
get model(): ModelDescriptor<T>;
|
|
22
23
|
get filterDisplay(): TableDescriptor.FilterDisplayEnum;
|
|
23
24
|
get paginationMode(): TableDescriptor.PaginationModeEnum;
|
|
24
25
|
get columns(): ColumnDescriptor<any, T>[];
|
|
25
26
|
get title(): string | undefined;
|
|
27
|
+
get hideHeader(): boolean;
|
|
26
28
|
get dataKeyProperty(): string | undefined;
|
|
27
29
|
get hasDefaultSort(): boolean;
|
|
28
30
|
get defaultSortProperty(): string[];
|
|
29
31
|
get defaultSortAsc(): boolean[];
|
|
30
32
|
get rowHeight(): number;
|
|
31
33
|
get tableFullHeightOffset(): number;
|
|
34
|
+
get model(): ModelDescriptor<T>;
|
|
32
35
|
addColumnDescriptor<CT>(column: ColumnDescriptor<CT, T>): TableDescriptor<T>;
|
|
33
36
|
addColumn(property: string): ColumnDescriptor<string, T>;
|
|
34
37
|
addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T>;
|
|
35
38
|
addColumnDate(property: string, displayFormat?: string): ColumnDescriptor<Date, T>;
|
|
36
39
|
addColumnBoolean(property: string): ColumnDescriptor<boolean, T>;
|
|
40
|
+
addColumnEnum(property: string, enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): ColumnDescriptor<boolean, T>;
|
|
37
41
|
addColumnObject<CT>(property: string, modelType: ClassType<CT>, displayProperty: string): ColumnDescriptor<CT, T>;
|
|
38
42
|
withFilterDisplay(filterDisplayType: TableDescriptor.FilterDisplayEnum): this;
|
|
39
43
|
withPaginationMode(paginationMode: TableDescriptor.PaginationModeEnum): this;
|
|
40
44
|
withTitle(title: string): TableDescriptor<T>;
|
|
45
|
+
withHideHeader(hideHeader?: boolean): this;
|
|
41
46
|
withDataKeyProperty(property: string): TableDescriptor<T>;
|
|
42
47
|
withDefaultSort(property: string, asc?: boolean): TableDescriptor<T>;
|
|
43
48
|
withRowHeight(rowHeight: number): TableDescriptor<T>;
|
|
44
49
|
withTableFullHeightOffset(tableFullHeightOffset: number): TableDescriptor<T>;
|
|
45
|
-
private setDataKeyFromColumn;
|
|
46
50
|
copy(): TableDescriptor<T>;
|
|
51
|
+
private setDataKeyFromColumn;
|
|
47
52
|
}
|
|
48
53
|
export declare namespace TableDescriptor {
|
|
49
54
|
enum PaginationModeEnum {
|
|
@@ -65,25 +70,33 @@ export declare class ColumnDescriptor<T, TT> {
|
|
|
65
70
|
private _isSortEnabled;
|
|
66
71
|
private _filterDescriptor?;
|
|
67
72
|
private _displayFormat?;
|
|
73
|
+
private _enumType?;
|
|
74
|
+
private _enumTitlePath?;
|
|
75
|
+
private _enumNameAsValue;
|
|
68
76
|
constructor(table: TableDescriptor<TT>, property: string);
|
|
69
|
-
get table(): TableDescriptor<TT>;
|
|
70
|
-
get property(): string;
|
|
71
77
|
get modelType(): ClassType<T> | null;
|
|
72
|
-
get
|
|
78
|
+
get columnType(): ColumnDescriptor.TypeEnum;
|
|
73
79
|
get title(): string | undefined;
|
|
80
|
+
get displayPropertyPath(): string | undefined;
|
|
74
81
|
get isSortEnabled(): boolean;
|
|
75
|
-
get columnType(): ColumnDescriptor.TypeEnum;
|
|
76
82
|
get filterDescriptor(): FilterDescriptor<T> | undefined;
|
|
77
83
|
get displayFormat(): string | undefined;
|
|
84
|
+
get table(): TableDescriptor<TT>;
|
|
85
|
+
get property(): string;
|
|
86
|
+
get enumType(): EnumType | undefined;
|
|
87
|
+
get enumTitlePath(): string | null | undefined;
|
|
88
|
+
get enumNameAsValue(): boolean;
|
|
78
89
|
asType(type?: ColumnDescriptor.TypeEnum): this;
|
|
79
90
|
asNumber(displayFormat?: string): this;
|
|
80
91
|
asDate(displayFormat?: string): this;
|
|
81
92
|
asBoolean(): this;
|
|
93
|
+
asEnum(enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): this;
|
|
82
94
|
withModelType(modelType: ClassType<T>): this;
|
|
83
95
|
withTitle(title: string): this;
|
|
84
96
|
withDisplayPropertyPath(displayPropertyPath: string): this;
|
|
85
97
|
withFilter(): FilterDescriptor<T>;
|
|
86
98
|
withFilterLookup(): FilterLookupDescriptor<T>;
|
|
99
|
+
withFilterLookupEnum(options?: Array<EnumConstantType>): FilterLookupEnumDescriptor;
|
|
87
100
|
withSort(isEnabled?: boolean): this;
|
|
88
101
|
copy(): ColumnDescriptor<T, TT>;
|
|
89
102
|
}
|
|
@@ -92,7 +105,8 @@ export declare namespace ColumnDescriptor {
|
|
|
92
105
|
String = 0,
|
|
93
106
|
Number = 1,
|
|
94
107
|
Boolean = 2,
|
|
95
|
-
Date = 3
|
|
108
|
+
Date = 3,
|
|
109
|
+
Enum = 4
|
|
96
110
|
}
|
|
97
111
|
}
|
|
98
112
|
export declare class FilterDescriptor<T> {
|
|
@@ -103,13 +117,13 @@ export declare class FilterDescriptor<T> {
|
|
|
103
117
|
protected _placeholder?: string;
|
|
104
118
|
protected _className: string;
|
|
105
119
|
constructor(property: string);
|
|
106
|
-
get property(): string;
|
|
107
120
|
get filterType(): FilterDescriptor.TypeEnum;
|
|
108
121
|
get filterProperty(): string | undefined;
|
|
109
122
|
get matchModes(): string[] | null;
|
|
110
123
|
get placeholder(): string | undefined;
|
|
111
124
|
get className(): string;
|
|
112
|
-
|
|
125
|
+
get property(): string;
|
|
126
|
+
asFilterType(filterType: FilterDescriptor.TypeEnum): this;
|
|
113
127
|
/**
|
|
114
128
|
* Sets different filter property name instead of default property. Use this if API requires different property provided to perform correct filter.
|
|
115
129
|
* @param filterProperty
|
|
@@ -118,8 +132,8 @@ export declare class FilterDescriptor<T> {
|
|
|
118
132
|
withPlaceholder(placeholder: string): this;
|
|
119
133
|
withClassName(className: string): this;
|
|
120
134
|
withMatchModes(matchModes: Array<FilterDescriptor.MatchModeEnum>): this;
|
|
121
|
-
protected copyFieldsTo(descriptor: FilterDescriptor<T>): void;
|
|
122
135
|
copy(): FilterDescriptor<T>;
|
|
136
|
+
protected copyFieldsTo(descriptor: FilterDescriptor<T>): void;
|
|
123
137
|
}
|
|
124
138
|
export declare namespace FilterDescriptor {
|
|
125
139
|
enum TypeEnum {
|
|
@@ -127,7 +141,8 @@ export declare namespace FilterDescriptor {
|
|
|
127
141
|
Number = 1,
|
|
128
142
|
Boolean = 2,
|
|
129
143
|
Date = 3,
|
|
130
|
-
Lookup = 4
|
|
144
|
+
Lookup = 4,
|
|
145
|
+
LookupEnum = 5
|
|
131
146
|
}
|
|
132
147
|
enum MatchModeEnum {
|
|
133
148
|
StartsWith = "startsWith",
|
|
@@ -157,24 +172,30 @@ export declare class FilterLookupDescriptor<T> extends FilterDescriptor<T> imple
|
|
|
157
172
|
private _multiselect;
|
|
158
173
|
protected _dropdownClassName: string;
|
|
159
174
|
constructor(property: string, modelType: ClassType<T> | null);
|
|
160
|
-
get modelType(): ClassType<T> | null;
|
|
161
175
|
get lookupType(): FilterLookupDescriptor.LookupTypeEnum | undefined;
|
|
176
|
+
get dataProvider(): ILookupDataProvider<T, any> | undefined;
|
|
162
177
|
get itemsLabelProperty(): string | undefined;
|
|
163
178
|
get itemsValueProperty(): string | undefined;
|
|
164
179
|
get dataKeyProperty(): string | undefined;
|
|
165
|
-
get dataProvider(): ILookupDataProvider<T, any> | undefined;
|
|
166
180
|
get multiselect(): boolean;
|
|
181
|
+
get dropdownClassName(): string;
|
|
182
|
+
get modelType(): ClassType<T> | null;
|
|
167
183
|
withItemsLabelProperty(itemsLabelProperty: string): this;
|
|
168
184
|
withItemsValueProperty(itemsValueProperty: string): this;
|
|
169
185
|
withDataKeyProperty(dataKeyProperty: string): this;
|
|
170
|
-
get dropdownClassName(): string;
|
|
171
186
|
withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this;
|
|
172
187
|
withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this;
|
|
173
188
|
withMultiselect(multiselect?: boolean): this;
|
|
174
189
|
withDropdownClassName(dropdownClassName: string): this;
|
|
175
190
|
asAutocomplete(): this;
|
|
176
|
-
protected copyFieldsTo(descriptor: FilterLookupDescriptor<T>): void;
|
|
177
191
|
copy(): FilterLookupDescriptor<T>;
|
|
192
|
+
protected copyFieldsTo(descriptor: FilterLookupDescriptor<T>): void;
|
|
193
|
+
}
|
|
194
|
+
export declare class FilterLookupEnumDescriptor extends FilterLookupDescriptor<EnumValue<string | number>> {
|
|
195
|
+
private readonly _enumType;
|
|
196
|
+
constructor(property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null);
|
|
197
|
+
get enumType(): EnumType;
|
|
198
|
+
copy(): FilterLookupEnumDescriptor;
|
|
178
199
|
}
|
|
179
200
|
export declare namespace FilterLookupDescriptor {
|
|
180
201
|
enum LookupTypeEnum {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { AbstractControl } from '@angular/forms';
|
|
2
|
-
import { ClassType,
|
|
2
|
+
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
3
3
|
import { AFieldDescriptor, ColumnDescriptor, EditorDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, ModelDescriptor, TableDescriptor } from './';
|
|
4
4
|
export declare class TableviewDescriptor<T> {
|
|
5
5
|
private readonly _model;
|
|
6
|
-
private _table;
|
|
7
|
-
private _viewEditor;
|
|
8
|
-
private _addEditor;
|
|
9
|
-
private _editEditor;
|
|
10
|
-
private _tableTitle;
|
|
11
6
|
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
|
|
12
|
-
|
|
7
|
+
private _table;
|
|
13
8
|
get table(): TableDescriptor<T>;
|
|
9
|
+
private _viewEditor;
|
|
14
10
|
get viewEditor(): EditorDescriptor<T>;
|
|
11
|
+
private _addEditor;
|
|
15
12
|
get addEditor(): EditorDescriptor<T>;
|
|
13
|
+
private _editEditor;
|
|
16
14
|
get editEditor(): EditorDescriptor<T>;
|
|
15
|
+
private _tableTitle;
|
|
17
16
|
get tableTitle(): string;
|
|
17
|
+
get model(): ModelDescriptor<T>;
|
|
18
18
|
withTableDescriptor(descriptor: TableDescriptor<T>): this;
|
|
19
19
|
withViewDescriptor(descriptor: EditorDescriptor<T>): this;
|
|
20
20
|
withAddDescriptor(descriptor: EditorDescriptor<T>): this;
|
|
@@ -26,13 +26,14 @@ export declare class TableviewDescriptor<T> {
|
|
|
26
26
|
addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T>;
|
|
27
27
|
addColumnDate(property: string, displayFormat?: string): ColumnDescriptor<Date, T>;
|
|
28
28
|
addColumnBoolean(property: string): ColumnDescriptor<boolean, T>;
|
|
29
|
+
addColumnEnum(property: string, enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): ColumnDescriptor<boolean, T>;
|
|
29
30
|
addColumnObject<CT>(property: string, modelType: ClassType<CT>, displayProperty: string): ColumnDescriptor<CT, T>;
|
|
30
31
|
createTabGroup(name: string, title?: string): this;
|
|
31
32
|
createFieldGroup(name: string, title?: string): this;
|
|
32
33
|
addFieldDescriptor<FT>(field: AFieldDescriptor<FT, T>): this;
|
|
33
34
|
addField(property: string): FieldInputDescriptor<T>;
|
|
34
35
|
addFieldLookup<FT>(property: string, modelType: ClassType<FT>): FieldLookupDescriptor<FT, T>;
|
|
35
|
-
addFieldLookupEnum(property: string,
|
|
36
|
+
addFieldLookupEnum(property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null): FieldLookupEnumDescriptor<T>;
|
|
36
37
|
addFieldManyEditor<FT>(property: string, type: ClassType<FT>, tableviewDescriptor: TableviewDescriptor<FT>): FieldManyEditorDescriptor<FT, T>;
|
|
37
38
|
addFieldManyToManyEditor<FT>(property: string, type: ClassType<FT>, mainTableDescriptor: TableDescriptor<FT>, lookupTableDescriptor: TableDescriptor<FT>): FieldManyToManyEditorDescriptor<FT, T>;
|
|
38
39
|
copy(): TableviewDescriptor<T>;
|