@mediusinc/mng-commons 0.3.2 → 0.4.1

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.
Files changed (76) hide show
  1. package/assets/i18n/en.json +1 -1
  2. package/assets/i18n/sl.json +1 -1
  3. package/esm2020/lib/api/models/builders/query-param.builder.mjs +7 -2
  4. package/esm2020/lib/api/services/api.abstract.service.mjs +21 -10
  5. package/esm2020/lib/api/utils/object-serializer.util.mjs +7 -1
  6. package/esm2020/lib/components/action/action.component.mjs +3 -3
  7. package/esm2020/lib/components/action/editor/action-editor.component.mjs +3 -3
  8. package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +186 -32
  9. package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +1 -1
  10. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
  11. package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +8 -8
  12. package/esm2020/lib/components/layout/main-layout.component.mjs +1 -1
  13. package/esm2020/lib/components/layout/topbar.component.mjs +1 -1
  14. package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +17 -5
  15. package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +9 -23
  16. package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +21 -7
  17. package/esm2020/lib/components/tableview/table/table.component.mjs +3 -3
  18. package/esm2020/lib/components/tableview/tableview.component.mjs +3 -3
  19. package/esm2020/lib/descriptors/column.descriptor.mjs +197 -0
  20. package/esm2020/lib/descriptors/editor.descriptor.mjs +3 -734
  21. package/esm2020/lib/descriptors/field.descriptor.interface.mjs +2 -0
  22. package/esm2020/lib/descriptors/field.descriptor.mjs +755 -0
  23. package/esm2020/lib/descriptors/filter.descriptor.mjs +237 -0
  24. package/esm2020/lib/descriptors/index.mjs +5 -1
  25. package/esm2020/lib/descriptors/table.descriptor.mjs +4 -385
  26. package/esm2020/lib/descriptors/tableview.descriptor.mjs +3 -3
  27. package/esm2020/lib/directives/component.directive.mjs +18 -2
  28. package/esm2020/lib/mng-commons.module.mjs +5 -5
  29. package/esm2020/lib/models/column-value.model.mjs +2 -0
  30. package/esm2020/lib/models/index.mjs +2 -1
  31. package/esm2020/lib/pipes/index.mjs +2 -2
  32. package/esm2020/lib/pipes/json-path.pipe.mjs +80 -0
  33. package/esm2020/lib/pipes/link-formatter.pipe.mjs +1 -1
  34. package/esm2020/lib/services/action-executor.service.mjs +1 -1
  35. package/esm2020/lib/utils/model.util.mjs +16 -15
  36. package/esm2020/public-api.mjs +2 -1
  37. package/fesm2015/mediusinc-mng-commons.mjs +1671 -1348
  38. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  39. package/fesm2020/mediusinc-mng-commons.mjs +1648 -1329
  40. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  41. package/lib/api/models/builders/query-param.builder.d.ts +2 -1
  42. package/lib/api/services/api.abstract.service.d.ts +10 -5
  43. package/lib/api/utils/object-serializer.util.d.ts +4 -2
  44. package/lib/components/form/autocomplete/autocomplete.component.d.ts +20 -5
  45. package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +1 -2
  46. package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +5 -1
  47. package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +1 -0
  48. package/lib/components/tableview/table/column-value/column-value.component.d.ts +5 -1
  49. package/lib/descriptors/column.descriptor.d.ts +66 -0
  50. package/lib/descriptors/editor.descriptor.d.ts +1 -292
  51. package/lib/descriptors/field.descriptor.d.ts +301 -0
  52. package/lib/descriptors/{editor.descriptor.interface.d.ts → field.descriptor.interface.d.ts} +0 -0
  53. package/lib/descriptors/filter.descriptor.d.ts +108 -0
  54. package/lib/descriptors/index.d.ts +4 -0
  55. package/lib/descriptors/table.descriptor.d.ts +5 -159
  56. package/lib/descriptors/tableview.descriptor.d.ts +4 -2
  57. package/lib/directives/component.directive.d.ts +5 -1
  58. package/lib/mng-commons.module.d.ts +2 -2
  59. package/lib/models/column-value.model.d.ts +4 -0
  60. package/lib/models/index.d.ts +1 -0
  61. package/lib/pipes/index.d.ts +1 -1
  62. package/lib/pipes/json-path.pipe.d.ts +13 -0
  63. package/lib/pipes/link-formatter.pipe.d.ts +1 -1
  64. package/lib/services/action-executor.service.d.ts +1 -1
  65. package/lib/utils/model.util.d.ts +1 -0
  66. package/package.json +1 -1
  67. package/public-api.d.ts +1 -0
  68. package/scss/mng-overrides/_layout_action.scss +7 -0
  69. package/scss/mng-overrides/_layout_dialog.scss +17 -6
  70. package/scss/mng-overrides/_mixins.scss +60 -0
  71. package/scss/theme/default/_mng-variables-theme-dark.scss +2 -3
  72. package/scss/theme/default/_mng-variables-theme-light.scss +2 -3
  73. package/scss/theme/default/_mng-variables.scss +12 -0
  74. package/esm2020/lib/descriptors/editor.descriptor.interface.mjs +0 -2
  75. package/esm2020/lib/pipes/property-path.pipe.mjs +0 -36
  76. package/lib/pipes/property-path.pipe.d.ts +0 -7
@@ -0,0 +1,301 @@
1
+ import { Type } from '@angular/core';
2
+ import { AbstractControl } from '@angular/forms';
3
+ import { FormlyFieldConfig } from '@ngx-formly/core';
4
+ import { Observable, Subject } from 'rxjs';
5
+ import { MediusQueryParam, MediusQueryResult } from '../api/models';
6
+ import { MngFormFieldEvent, MngFormFieldEventData, MngFormFieldEventTypeEnum } from '../components/form/models';
7
+ import { ILookupDataProvider, ITableDataProvider } from '../data-providers';
8
+ import { EnumValue } from '../models';
9
+ import { ClassType, EnumConstantType, EnumType } from '../types';
10
+ import { ActionDescriptor, EditorDescriptor, FieldValidator, ILookupDescriptor, TableDescriptor, TableviewDescriptor } from './';
11
+ import { FieldConfig, FieldLookupConfig } from './field.descriptor.interface';
12
+ export declare abstract class AGenericFieldDescriptor<ET> {
13
+ protected readonly _editor: EditorDescriptor<ET>;
14
+ protected _config: FieldConfig;
15
+ protected constructor(editor: EditorDescriptor<ET>);
16
+ get editor(): EditorDescriptor<ET>;
17
+ get config(): FieldConfig;
18
+ withConfig(config: FieldConfig): this;
19
+ }
20
+ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescriptor<ET> {
21
+ protected readonly _property: string;
22
+ protected _group?: AFieldGroupDescriptor<ET>;
23
+ protected _label?: string;
24
+ protected _placeholder?: string;
25
+ protected _helpText?: string;
26
+ protected _required: boolean;
27
+ protected _disabled: boolean;
28
+ protected _defaultValue?: T;
29
+ protected _getter?: (item: ET) => T;
30
+ protected _setter?: (item: ET, value: T) => void;
31
+ protected _validators: Array<FieldValidator>;
32
+ protected _requiredExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
33
+ protected _disabledExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
34
+ protected _hiddenExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
35
+ protected _className: string;
36
+ protected _labelClassName: string;
37
+ protected _inputClassName: string;
38
+ protected _size: FieldDescriptor.SizeEnum;
39
+ protected readonly _eventsSubject: Subject<MngFormFieldEvent<T, ET>>;
40
+ protected constructor(editor: EditorDescriptor<ET>, property: string);
41
+ get property(): string;
42
+ get group(): AFieldGroupDescriptor<ET> | undefined;
43
+ get label(): string | undefined;
44
+ get placeholder(): string | undefined;
45
+ get helpText(): string | undefined;
46
+ get required(): boolean;
47
+ get disabled(): boolean;
48
+ get defaultValue(): T | undefined;
49
+ get getter(): ((item: ET) => T) | undefined;
50
+ get setter(): ((item: ET, value: T) => void) | undefined;
51
+ get validators(): FieldValidator[];
52
+ get requiredExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
53
+ get disabledExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
54
+ get hiddenExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
55
+ get className(): string;
56
+ get labelClassName(): string;
57
+ get inputClassName(): string;
58
+ get size(): FieldDescriptor.SizeEnum;
59
+ get isSizeSmall(): boolean;
60
+ get isSizeLarge(): boolean;
61
+ abstract copy(): AFieldDescriptor<T, ET>;
62
+ withLabel(label: string): this;
63
+ withPlaceholder(placeholder: string): this;
64
+ withHelpText(helpText: string): this;
65
+ withRequired(required?: boolean, requiredExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
66
+ withDisabled(disabled?: boolean, disabledExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
67
+ withHidden(hiddenExpression: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
68
+ withDefaultValue(defaultValue: T): this;
69
+ withGetter(getter: (item: ET) => T): this;
70
+ withSetter(setter: (item: ET, value: T) => void): this;
71
+ withValidator(name: string, expression: (control: AbstractControl) => boolean, message?: (err: any, field: FormlyFieldConfig) => string): this;
72
+ withClassName(className: string, labelClassName?: string, inputClassName?: string): this;
73
+ withSize(size?: FieldDescriptor.SizeEnum): this;
74
+ nextEvent(type: MngFormFieldEventTypeEnum, cmpType: Type<any>, cmpInstance: any, data?: MngFormFieldEventData<T, ET>): void;
75
+ get events$(): Observable<MngFormFieldEvent<T, ET>>;
76
+ protected copyFieldsTo(obj: AFieldDescriptor<T, ET>): void;
77
+ }
78
+ export declare namespace FieldDescriptor {
79
+ enum SizeEnum {
80
+ Small = 0,
81
+ Normal = 1,
82
+ Large = 2
83
+ }
84
+ }
85
+ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string | number | boolean | Date, ET> {
86
+ private _fieldType;
87
+ private _rows?;
88
+ private _numberMin?;
89
+ private _numberMax?;
90
+ private _numberStep?;
91
+ private _numberMinFractionDigits?;
92
+ private _numberMaxFractionDigits?;
93
+ private _numberUseGrouping;
94
+ private _radioOptions;
95
+ private _datePickerFormat?;
96
+ private _datePickerMin?;
97
+ private _datePickerMax?;
98
+ private _datePickerShowTime;
99
+ private _maxLength?;
100
+ private _minLength?;
101
+ private _pattern?;
102
+ private _mask?;
103
+ private _slotChar?;
104
+ private _customComponentName?;
105
+ constructor(editor: EditorDescriptor<ET>, property: string);
106
+ get fieldType(): FieldInputDescriptor.TypeEnum;
107
+ get rows(): number | undefined;
108
+ get numberMin(): number | undefined;
109
+ get numberMax(): number | undefined;
110
+ get numberStep(): number | undefined;
111
+ get numberMinFractionDigits(): number | undefined;
112
+ get numberMaxFractionDigits(): number | undefined;
113
+ get numberUseGrouping(): boolean;
114
+ get radioOptions(): EnumValue<string | number | boolean | Date>[];
115
+ get datePickerFormat(): string | undefined;
116
+ get datePickerMin(): Date | undefined;
117
+ get datePickerMax(): Date | undefined;
118
+ get datePickerShowTime(): boolean;
119
+ get maxLength(): number | undefined;
120
+ get minLength(): number | undefined;
121
+ get pattern(): string | RegExp | undefined;
122
+ get mask(): string | undefined;
123
+ get slotChar(): string | undefined;
124
+ get customComponentName(): string | undefined;
125
+ asHidden(): this;
126
+ asText(minLength?: number, maxLength?: number, pattern?: string | RegExp, isEmail?: boolean): this;
127
+ asTextarea(rows?: number, minLength?: number, maxLength?: number, pattern?: string | RegExp): this;
128
+ asNumber(step?: number, min?: number, max?: number, minFractionDigits?: number, maxFractionDigits?: number, numberUseGrouping?: boolean): this;
129
+ asSwitch(): this;
130
+ asRadio(options: Array<string | number>, optionsTitlePath?: string): this;
131
+ asRadioFromEnum(enumType: EnumType, optionsTitlePath?: string | null, values?: Array<EnumConstantType>, nameAsValue?: boolean): this;
132
+ asDatePicker(format?: string, min?: Date, max?: Date, showTime?: boolean): this;
133
+ asMask(mask: string, slotChar: string): this;
134
+ asCustomComponent(customComponentName: string): this;
135
+ copy(): FieldInputDescriptor<ET>;
136
+ }
137
+ export declare namespace FieldInputDescriptor {
138
+ enum TypeEnum {
139
+ Hidden = 0,
140
+ Text = 1,
141
+ Textarea = 2,
142
+ Number = 3,
143
+ Switch = 4,
144
+ Radio = 5,
145
+ Datepicker = 6,
146
+ Mask = 7,
147
+ Custom = 8
148
+ }
149
+ }
150
+ export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET> implements ILookupDescriptor<T> {
151
+ protected readonly _modelType: ClassType<T> | null;
152
+ protected _lookupType: FieldLookupDescriptor.LookupTypeEnum;
153
+ protected _itemsLabelProperty?: string;
154
+ protected _itemsLabelTranslate: boolean;
155
+ protected _itemsValueProperty?: string;
156
+ protected _itemsDisabledProperty?: string;
157
+ protected _dataKeyProperty?: string;
158
+ protected _dataProvider?: ILookupDataProvider<T, any>;
159
+ protected _dropdownClassName: string;
160
+ protected _autocompleteOpenOnFocus: boolean;
161
+ protected _autocompleteInlineSearch: boolean;
162
+ protected _dialogTableDescriptor?: TableDescriptor<T>;
163
+ protected _dialogTableDataProvider?: ITableDataProvider<T, any>;
164
+ constructor(editor: EditorDescriptor<ET>, property: string, modelType: ClassType<T> | null);
165
+ get lookupType(): FieldLookupDescriptor.LookupTypeEnum;
166
+ get itemsLabelProperty(): string | undefined;
167
+ get itemsLabelTranslate(): boolean;
168
+ get itemsValueProperty(): string | undefined;
169
+ get itemsDisabledProperty(): string | undefined;
170
+ get dataKeyProperty(): string | undefined;
171
+ get dataProvider(): ILookupDataProvider<T, any> | undefined;
172
+ get autocompleteOpenOnFocus(): boolean;
173
+ get autocompleteInlineSearch(): boolean;
174
+ get dropdownClassName(): string;
175
+ get modelType(): ClassType<T> | null;
176
+ get dialogTableDescriptor(): TableDescriptor<T> | undefined;
177
+ get dialogTableDataProvider(): ITableDataProvider<T, any> | undefined;
178
+ withItemsLabelProperty(itemsLabelProperty: string, translate?: boolean): this;
179
+ withItemsValueProperty(itemsValueProperty: string): this;
180
+ withItemsDisabledProperty(itemsDisabledProperty: string): this;
181
+ withDataKeyProperty(property: string): this;
182
+ withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this;
183
+ withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this;
184
+ withConfig(config: FieldLookupConfig): this;
185
+ asAutocomplete(openOnFocus?: boolean, inlineSearch?: boolean): this;
186
+ asDialog(lookupTableDescriptor: TableDescriptor<T>, tableDataProvider?: ITableDataProvider<T, any>): this;
187
+ copy(): FieldLookupDescriptor<T, ET>;
188
+ }
189
+ export declare namespace FieldLookupDescriptor {
190
+ enum LookupTypeEnum {
191
+ Dropdown = 0,
192
+ Autocomplete = 1,
193
+ Dialog = 2
194
+ }
195
+ }
196
+ export declare class FieldLookupEnumDescriptor<ET> extends FieldLookupDescriptor<EnumValue<string | number>, ET> {
197
+ private readonly _enumType;
198
+ private readonly _optionEnumValues;
199
+ private readonly _nameAsValue;
200
+ constructor(editor: EditorDescriptor<ET>, property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null);
201
+ get enumType(): EnumType;
202
+ withDisabledOptions(...disabledOptions: Array<EnumConstantType>): this;
203
+ asAutocomplete(openOnFocus?: boolean): this;
204
+ copy(): FieldLookupEnumDescriptor<ET>;
205
+ }
206
+ export declare class FieldManyToManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET> {
207
+ private readonly _mainTableDescriptor;
208
+ private readonly _lookupTableDescriptor;
209
+ private _fieldType;
210
+ private _lookupTableDataProvider;
211
+ private _actions;
212
+ private _hasLookupExcludeValues;
213
+ private _excludeFilterProperty;
214
+ private _excludeValueProperty;
215
+ constructor(editor: EditorDescriptor<ET>, property: string, mainTableDescriptor: TableDescriptor<T>, lookupTableDescriptor: TableDescriptor<T>);
216
+ get fieldType(): FieldManyToManyEditorDescriptor.TypeEnum;
217
+ get lookupTableDataProvider(): ITableDataProvider<T, any> | null;
218
+ get actions(): FieldManyToManyEditorDescriptor.ActionEnum[];
219
+ get hasLookupExcludeValues(): boolean;
220
+ get excludeFilterProperty(): string;
221
+ get excludeValueProperty(): string;
222
+ get mainTableDescriptor(): TableDescriptor<T>;
223
+ get lookupTableDescriptor(): TableDescriptor<T>;
224
+ withLookup<S>(getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>, serviceType?: Type<S>): this;
225
+ withLookupDataProvider(dataProvider: ITableDataProvider<T, any>): this;
226
+ withActions(actions?: Array<FieldManyToManyEditorDescriptor.ActionEnum>): this;
227
+ withLookupExclude(filterProperty: string, valueProperty: string, hasLookupExclude?: boolean): this;
228
+ copy(): FieldManyToManyEditorDescriptor<T, ET>;
229
+ }
230
+ export declare namespace FieldManyToManyEditorDescriptor {
231
+ enum TypeEnum {
232
+ DialogTableMultiselect = 0
233
+ }
234
+ enum ActionEnum {
235
+ Add = 0,
236
+ Delete = 1
237
+ }
238
+ }
239
+ export declare class FieldManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET> {
240
+ private readonly _tableviewDescriptor;
241
+ private _fieldType;
242
+ private _fieldActions;
243
+ private _actions;
244
+ constructor(editor: EditorDescriptor<ET>, property: string, tableviewDescriptor: TableviewDescriptor<T>);
245
+ get fieldType(): FieldManyEditorDescriptor.TypeEnum;
246
+ get fieldActions(): FieldManyEditorDescriptor.ActionEnum[];
247
+ get actions(): ActionDescriptor<T>[];
248
+ get tableviewDescriptor(): TableviewDescriptor<T>;
249
+ get tableDescriptor(): TableDescriptor<T>;
250
+ get editorForCreate(): EditorDescriptor<T>;
251
+ get editorForRead(): EditorDescriptor<T>;
252
+ get editorForUpdate(): EditorDescriptor<T>;
253
+ withFieldAction(action: FieldManyEditorDescriptor.ActionEnum): this;
254
+ withFieldActions(actions: FieldManyEditorDescriptor.ActionEnum[]): this;
255
+ withAction(action: ActionDescriptor<T>): this;
256
+ copy(): FieldManyEditorDescriptor<T, ET>;
257
+ }
258
+ export declare namespace FieldManyEditorDescriptor {
259
+ enum TypeEnum {
260
+ DialogEditor = 0
261
+ }
262
+ enum ActionEnum {
263
+ View = 0,
264
+ Add = 1,
265
+ Edit = 2,
266
+ Delete = 3
267
+ }
268
+ }
269
+ export declare abstract class AFieldGroupDescriptor<ET> extends AGenericFieldDescriptor<ET> {
270
+ protected readonly _name: string;
271
+ protected readonly _default: boolean;
272
+ protected _title?: string;
273
+ protected _fields: AGenericFieldDescriptor<ET>[];
274
+ protected _validators: Array<FieldValidator>;
275
+ protected constructor(editor: EditorDescriptor<ET>, name: string);
276
+ get title(): string | undefined;
277
+ abstract get fields(): AGenericFieldDescriptor<ET>[];
278
+ get validators(): FieldValidator[];
279
+ get baseName(): string;
280
+ get name(): string;
281
+ get default(): boolean;
282
+ abstract groupName(): string;
283
+ abstract addField(field: AGenericFieldDescriptor<ET>): this;
284
+ abstract copy(): AFieldGroupDescriptor<ET>;
285
+ withTitle(title: string): this;
286
+ withValidator(name: string, expression: (control: AbstractControl) => boolean): this;
287
+ }
288
+ export declare class FieldTabGroupDescriptor<ET> extends AFieldGroupDescriptor<ET> {
289
+ constructor(editor: EditorDescriptor<ET>, name: string);
290
+ get fields(): Array<FieldGroupDescriptor<ET>>;
291
+ groupName(): string;
292
+ addField(field: FieldGroupDescriptor<ET>): this;
293
+ copy(): FieldTabGroupDescriptor<ET>;
294
+ }
295
+ export declare class FieldGroupDescriptor<ET> extends AFieldGroupDescriptor<ET> {
296
+ constructor(editor: EditorDescriptor<ET>, name: string);
297
+ get fields(): Array<AFieldDescriptor<any, ET>>;
298
+ groupName(): string;
299
+ addField(field: AFieldDescriptor<any, ET>): this;
300
+ copy(): FieldGroupDescriptor<ET>;
301
+ }
@@ -0,0 +1,108 @@
1
+ import { Type } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { MediusQueryParam } from '../api/models';
4
+ import { ILookupDataProvider } from '../data-providers';
5
+ import { EnumValue } from '../models';
6
+ import { ClassType, EnumConstantType, EnumType } from '../types';
7
+ import { ILookupDescriptor } from './lookup.descriptor';
8
+ export declare class FilterDescriptor<T> {
9
+ protected readonly _property: string;
10
+ protected _filterType: FilterDescriptor.TypeEnum;
11
+ protected _filterProperty?: string;
12
+ protected _matchModes: string[] | null;
13
+ protected _placeholder?: string;
14
+ protected _className: string;
15
+ constructor(property: string);
16
+ get filterType(): FilterDescriptor.TypeEnum;
17
+ get filterProperty(): string | undefined;
18
+ get matchModes(): string[] | null;
19
+ get placeholder(): string | undefined;
20
+ get className(): string;
21
+ get property(): string;
22
+ asFilterType(filterType: FilterDescriptor.TypeEnum): this;
23
+ /**
24
+ * Sets different filter property name instead of default property. Use this if API requires different property provided to perform correct filter.
25
+ * @param filterProperty
26
+ */
27
+ withFilterProperty(filterProperty: string): this;
28
+ withPlaceholder(placeholder: string): this;
29
+ withClassName(className: string): this;
30
+ withMatchModes(matchModes: Array<FilterDescriptor.MatchModeEnum>): this;
31
+ copy(): FilterDescriptor<T>;
32
+ protected copyFieldsTo(descriptor: FilterDescriptor<T>): void;
33
+ }
34
+ export declare namespace FilterDescriptor {
35
+ enum TypeEnum {
36
+ String = 0,
37
+ Number = 1,
38
+ Boolean = 2,
39
+ Date = 3,
40
+ Lookup = 4,
41
+ LookupEnum = 5
42
+ }
43
+ enum MatchModeEnum {
44
+ StartsWith = "startsWith",
45
+ Contains = "contains",
46
+ EndsWith = "endsWith",
47
+ Equals = "equals",
48
+ NotEquals = "notEquals",
49
+ In = "in",
50
+ LessThan = "lt",
51
+ LessThanOrEqualTo = "lte",
52
+ GreaterThan = "gt",
53
+ GreaterThanOrEqualTo = "gte",
54
+ Between = "between",
55
+ DateIs = "dateIs",
56
+ DateIsNot = "dateIsNot",
57
+ DateBefore = "dateBefore",
58
+ DateAfter = "dateAfter"
59
+ }
60
+ }
61
+ export declare class FilterLookupDescriptor<T> extends FilterDescriptor<T> implements ILookupDescriptor<T> {
62
+ protected readonly _modelType: ClassType<T> | null;
63
+ protected _lookupType?: FilterLookupDescriptor.LookupTypeEnum;
64
+ protected _dataProvider?: ILookupDataProvider<T, any>;
65
+ protected _itemsLabelProperty?: string;
66
+ protected _itemsLabelTranslate: boolean;
67
+ protected _itemsValueProperty?: string;
68
+ protected _dataKeyProperty?: string;
69
+ protected _multiselect: boolean;
70
+ protected _dropdownClassName: string;
71
+ protected _autocompleteOpenOnFocus: boolean;
72
+ protected _autocompleteInlineSearch: boolean;
73
+ constructor(property: string, modelType: ClassType<T> | null);
74
+ get lookupType(): FilterLookupDescriptor.LookupTypeEnum | undefined;
75
+ get dataProvider(): ILookupDataProvider<T, any> | undefined;
76
+ get itemsLabelProperty(): string | undefined;
77
+ get itemsLabelTranslate(): boolean;
78
+ get itemsValueProperty(): string | undefined;
79
+ get dataKeyProperty(): string | undefined;
80
+ get multiselect(): boolean;
81
+ get autocompleteOpenOnFocus(): boolean;
82
+ get autocompleteInlineSearch(): boolean;
83
+ get dropdownClassName(): string;
84
+ get modelType(): ClassType<T> | null;
85
+ withItemsLabelProperty(itemsLabelProperty: string, translate?: boolean): this;
86
+ withItemsValueProperty(itemsValueProperty: string): this;
87
+ withDataKeyProperty(dataKeyProperty: string): this;
88
+ withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this;
89
+ withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this;
90
+ withMultiselect(multiselect?: boolean): this;
91
+ withDropdownClassName(dropdownClassName: string): this;
92
+ asAutocomplete(openOnFocus?: boolean, inlineSearch?: boolean): this;
93
+ copy(): FilterLookupDescriptor<T>;
94
+ protected copyFieldsTo(filter: FilterLookupDescriptor<T>): void;
95
+ }
96
+ export declare class FilterLookupEnumDescriptor extends FilterLookupDescriptor<EnumValue<string | number>> {
97
+ private readonly _enumType;
98
+ constructor(property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null);
99
+ get enumType(): EnumType;
100
+ asAutocomplete(openOnFocus?: boolean): this;
101
+ copy(): FilterLookupEnumDescriptor;
102
+ }
103
+ export declare namespace FilterLookupDescriptor {
104
+ enum LookupTypeEnum {
105
+ Dropdown = 0,
106
+ Autocomplete = 1
107
+ }
108
+ }
@@ -1,6 +1,10 @@
1
1
  export * from './action.descriptor';
2
+ export * from './column.descriptor';
2
3
  export * from './editor.descriptor';
4
+ export * from './field.descriptor';
5
+ export * from './field.descriptor.interface';
3
6
  export * from './field.validator';
7
+ export * from './filter.descriptor';
4
8
  export * from './lookup.descriptor';
5
9
  export * from './model.descriptor';
6
10
  export * from './table.descriptor';
@@ -1,10 +1,7 @@
1
1
  import { Type } from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import { MediusQueryParam } from '../api/models';
4
- import { ILookupDataProvider } from '../data-providers';
5
- import { EnumValue } from '../models';
6
- import { ClassType, EnumConstantType, EnumType } from '../types';
7
- import { ILookupDescriptor } from './lookup.descriptor';
2
+ import { IColumnValueComponent } from '../models';
3
+ import { ClassType, EnumType } from '../types';
4
+ import { ColumnDescriptor } from './column.descriptor';
8
5
  import { ModelDescriptor } from './model.descriptor';
9
6
  export declare class TableDescriptor<T> {
10
7
  private readonly _model;
@@ -37,8 +34,8 @@ export declare class TableDescriptor<T> {
37
34
  addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T>;
38
35
  addColumnDate(property: string, displayFormat?: string): ColumnDescriptor<Date, T>;
39
36
  addColumnBoolean(property: string, yes?: string, no?: string, asIcon?: boolean): ColumnDescriptor<boolean, T>;
40
- addColumnEnum(property: string, enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): ColumnDescriptor<boolean, T>;
41
- addColumnObject<CT>(property: string, modelType: ClassType<CT>, displayProperty: string): ColumnDescriptor<CT, T>;
37
+ addColumnEnum(property: string, enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): ColumnDescriptor<EnumType, T>;
38
+ addColumnCustomComponent(property: string, customComponentType: Type<IColumnValueComponent<T>>): ColumnDescriptor<any, T>;
42
39
  withFilterDisplay(filterDisplayType: TableDescriptor.FilterDisplayEnum): this;
43
40
  withPaginationMode(paginationMode: TableDescriptor.PaginationModeEnum): this;
44
41
  withTitle(title: string): TableDescriptor<T>;
@@ -60,154 +57,3 @@ export declare namespace TableDescriptor {
60
57
  Menu = 1
61
58
  }
62
59
  }
63
- export declare class ColumnDescriptor<T, TT> {
64
- private readonly _table;
65
- private readonly _property;
66
- private _modelType;
67
- private _columnType;
68
- private _title?;
69
- private _displayPropertyPath?;
70
- private _isSortEnabled;
71
- private _filterDescriptor?;
72
- private _displayFormat?;
73
- private _enumType?;
74
- private _enumTitlePath?;
75
- private _enumNameAsValue;
76
- private _booleanAsIcon;
77
- private _booleanYes?;
78
- private _booleanNo?;
79
- constructor(table: TableDescriptor<TT>, property: string);
80
- get modelType(): ClassType<T> | null;
81
- get columnType(): ColumnDescriptor.TypeEnum;
82
- get title(): string | undefined;
83
- get displayPropertyPath(): string | undefined;
84
- get isSortEnabled(): boolean;
85
- get filterDescriptor(): FilterDescriptor<T> | undefined;
86
- get displayFormat(): string | undefined;
87
- get table(): TableDescriptor<TT>;
88
- get property(): string;
89
- get enumType(): EnumType | undefined;
90
- get enumTitlePath(): string | null | undefined;
91
- get enumNameAsValue(): boolean;
92
- get booleanAsIcon(): boolean;
93
- get booleanYes(): string | undefined;
94
- get booleanNo(): string | undefined;
95
- asType(type?: ColumnDescriptor.TypeEnum): this;
96
- asNumber(displayFormat?: string): this;
97
- asDate(displayFormat?: string): this;
98
- asBoolean(yes?: string, no?: string, asIcon?: boolean): this;
99
- asEnum(enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): this;
100
- withModelType(modelType: ClassType<T>): this;
101
- withTitle(title: string): this;
102
- withDisplayPropertyPath(displayPropertyPath: string): this;
103
- withFilter(): FilterDescriptor<T>;
104
- withFilterLookup(): FilterLookupDescriptor<T>;
105
- withFilterLookupEnum(options?: Array<EnumConstantType>): FilterLookupEnumDescriptor;
106
- withSort(isEnabled?: boolean): this;
107
- copy(): ColumnDescriptor<T, TT>;
108
- }
109
- export declare namespace ColumnDescriptor {
110
- enum TypeEnum {
111
- String = 0,
112
- Number = 1,
113
- Boolean = 2,
114
- Date = 3,
115
- Enum = 4
116
- }
117
- }
118
- export declare class FilterDescriptor<T> {
119
- protected readonly _property: string;
120
- protected _filterType: FilterDescriptor.TypeEnum;
121
- protected _filterProperty?: string;
122
- protected _matchModes: string[] | null;
123
- protected _placeholder?: string;
124
- protected _className: string;
125
- constructor(property: string);
126
- get filterType(): FilterDescriptor.TypeEnum;
127
- get filterProperty(): string | undefined;
128
- get matchModes(): string[] | null;
129
- get placeholder(): string | undefined;
130
- get className(): string;
131
- get property(): string;
132
- asFilterType(filterType: FilterDescriptor.TypeEnum): this;
133
- /**
134
- * Sets different filter property name instead of default property. Use this if API requires different property provided to perform correct filter.
135
- * @param filterProperty
136
- */
137
- withFilterProperty(filterProperty: string): this;
138
- withPlaceholder(placeholder: string): this;
139
- withClassName(className: string): this;
140
- withMatchModes(matchModes: Array<FilterDescriptor.MatchModeEnum>): this;
141
- copy(): FilterDescriptor<T>;
142
- protected copyFieldsTo(descriptor: FilterDescriptor<T>): void;
143
- }
144
- export declare namespace FilterDescriptor {
145
- enum TypeEnum {
146
- String = 0,
147
- Number = 1,
148
- Boolean = 2,
149
- Date = 3,
150
- Lookup = 4,
151
- LookupEnum = 5
152
- }
153
- enum MatchModeEnum {
154
- StartsWith = "startsWith",
155
- Contains = "contains",
156
- EndsWith = "endsWith",
157
- Equals = "equals",
158
- NotEquals = "notEquals",
159
- In = "in",
160
- LessThan = "lt",
161
- LessThanOrEqualTo = "lte",
162
- GreaterThan = "gt",
163
- GreaterThanOrEqualTo = "gte",
164
- Between = "between",
165
- DateIs = "dateIs",
166
- DateIsNot = "dateIsNot",
167
- DateBefore = "dateBefore",
168
- DateAfter = "dateAfter"
169
- }
170
- }
171
- export declare class FilterLookupDescriptor<T> extends FilterDescriptor<T> implements ILookupDescriptor<T> {
172
- private readonly _modelType;
173
- private _lookupType?;
174
- private _dataProvider?;
175
- private _itemsLabelProperty?;
176
- private _itemsLabelTranslate;
177
- private _itemsValueProperty?;
178
- private _dataKeyProperty?;
179
- private _multiselect;
180
- protected _dropdownClassName: string;
181
- constructor(property: string, modelType: ClassType<T> | null);
182
- get lookupType(): FilterLookupDescriptor.LookupTypeEnum | undefined;
183
- get dataProvider(): ILookupDataProvider<T, any> | undefined;
184
- get itemsLabelProperty(): string | undefined;
185
- get itemsLabelTranslate(): boolean;
186
- get itemsValueProperty(): string | undefined;
187
- get dataKeyProperty(): string | undefined;
188
- get multiselect(): boolean;
189
- get dropdownClassName(): string;
190
- get modelType(): ClassType<T> | null;
191
- withItemsLabelProperty(itemsLabelProperty: string, translate?: boolean): this;
192
- withItemsValueProperty(itemsValueProperty: string): this;
193
- withDataKeyProperty(dataKeyProperty: string): this;
194
- withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this;
195
- withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this;
196
- withMultiselect(multiselect?: boolean): this;
197
- withDropdownClassName(dropdownClassName: string): this;
198
- asAutocomplete(): this;
199
- copy(): FilterLookupDescriptor<T>;
200
- protected copyFieldsTo(descriptor: FilterLookupDescriptor<T>): void;
201
- }
202
- export declare class FilterLookupEnumDescriptor extends FilterLookupDescriptor<EnumValue<string | number>> {
203
- private readonly _enumType;
204
- constructor(property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null);
205
- get enumType(): EnumType;
206
- copy(): FilterLookupEnumDescriptor;
207
- }
208
- export declare namespace FilterLookupDescriptor {
209
- enum LookupTypeEnum {
210
- Dropdown = 0,
211
- Autocomplete = 1
212
- }
213
- }
@@ -1,4 +1,6 @@
1
+ import { Type } from '@angular/core';
1
2
  import { AbstractControl } from '@angular/forms';
3
+ import { IColumnValueComponent } from '../models';
2
4
  import { ClassType, EnumConstantType, EnumType } from '../types';
3
5
  import { AFieldDescriptor, ColumnDescriptor, EditorDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, ModelDescriptor, TableDescriptor } from './';
4
6
  export declare class TableviewDescriptor<T> {
@@ -26,8 +28,8 @@ export declare class TableviewDescriptor<T> {
26
28
  addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T>;
27
29
  addColumnDate(property: string, displayFormat?: string): ColumnDescriptor<Date, T>;
28
30
  addColumnBoolean(property: string, yes?: string, no?: string, asIcon?: boolean): ColumnDescriptor<boolean, T>;
29
- addColumnEnum(property: string, enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): ColumnDescriptor<boolean, T>;
30
- addColumnObject<CT>(property: string, modelType: ClassType<CT>, displayProperty: string): ColumnDescriptor<CT, T>;
31
+ addColumnEnum(property: string, enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): ColumnDescriptor<EnumType, T>;
32
+ addColumnCustomComponent(property: string, customComponentType: Type<IColumnValueComponent<T>>): ColumnDescriptor<any, T>;
31
33
  createTabGroup(name: string, title?: string): this;
32
34
  createFieldGroup(name: string, title?: string): this;
33
35
  addFieldDescriptor<FT>(field: AFieldDescriptor<FT, T>): this;
@@ -3,10 +3,14 @@ import * as i0 from "@angular/core";
3
3
  export declare class MngComponentDirective<C> implements OnInit {
4
4
  viewContainerRef: ViewContainerRef;
5
5
  component: Type<C>;
6
+ inputs?: {
7
+ [key: string]: any;
8
+ };
6
9
  private componentInstanceEventEmitter;
7
10
  componentRef: ComponentRef<C>;
8
11
  constructor(viewContainerRef: ViewContainerRef);
9
12
  ngOnInit(): void;
13
+ private isCmpInstanceOfColumnValue;
10
14
  static ɵfac: i0.ɵɵFactoryDeclaration<MngComponentDirective<any>, never>;
11
- static ɵdir: i0.ɵɵDirectiveDeclaration<MngComponentDirective<any>, "[mngComponent]", never, { "component": "mngComponent"; }, { "componentInstanceEventEmitter": "instanceCreated"; }, never>;
15
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MngComponentDirective<any>, "[mngComponent]", never, { "component": "mngComponent"; "inputs": "inputs"; }, { "componentInstanceEventEmitter": "instanceCreated"; }, never>;
12
16
  }