@mediusinc/mng-commons 0.2.20 → 0.2.23

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 (47) hide show
  1. package/assets/i18n/en.json +13 -12
  2. package/assets/i18n/sl.json +13 -12
  3. package/esm2020/lib/api/models/query-param.model.mjs +3 -3
  4. package/esm2020/lib/api/utils/object-serializer.util.mjs +7 -2
  5. package/esm2020/lib/components/action/action.component.mjs +3 -3
  6. package/esm2020/lib/components/action/editor/action-editor.component.mjs +2 -2
  7. package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +66 -15
  8. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
  9. package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +1 -1
  10. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +57 -21
  11. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +1 -1
  12. package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +2 -2
  13. package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +16 -3
  14. package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +3 -3
  15. package/esm2020/lib/components/tableview/table/table.component.mjs +7 -3
  16. package/esm2020/lib/components/tableview/tableview.component.mjs +3 -3
  17. package/esm2020/lib/descriptors/action.descriptor.mjs +6 -1
  18. package/esm2020/lib/descriptors/editor.descriptor.mjs +74 -16
  19. package/esm2020/lib/descriptors/table.descriptor.mjs +31 -6
  20. package/esm2020/lib/descriptors/tableview.descriptor.mjs +7 -6
  21. package/esm2020/lib/models/enum.model.mjs +1 -1
  22. package/esm2020/lib/pipes/boolean.pipe.mjs +8 -3
  23. package/esm2020/lib/router/route-builder.mjs +31 -25
  24. package/esm2020/lib/services/action-executor.service.mjs +4 -3
  25. package/esm2020/lib/services/commons.service.mjs +1 -2
  26. package/esm2020/lib/utils/model.util.mjs +9 -7
  27. package/fesm2015/mediusinc-mng-commons.mjs +332 -123
  28. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  29. package/fesm2020/mediusinc-mng-commons.mjs +332 -123
  30. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  31. package/lib/components/form/dropdown/dropdown.component.d.ts +10 -4
  32. package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +8 -2
  33. package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +1 -0
  34. package/lib/components/tableview/table/table.component.d.ts +2 -1
  35. package/lib/descriptors/action.descriptor.d.ts +2 -1
  36. package/lib/descriptors/editor.descriptor.d.ts +32 -9
  37. package/lib/descriptors/table.descriptor.d.ts +11 -3
  38. package/lib/descriptors/tableview.descriptor.d.ts +1 -1
  39. package/lib/models/enum.model.d.ts +1 -0
  40. package/lib/pipes/boolean.pipe.d.ts +1 -1
  41. package/lib/router/route-builder.d.ts +2 -0
  42. package/lib/services/action-executor.service.d.ts +3 -2
  43. package/lib/utils/model.util.d.ts +1 -1
  44. package/package.json +1 -1
  45. package/scss/mng-overrides/_layout_dialog.scss +0 -7
  46. package/scss/mng-overrides/_theme_dialog.scss +3 -1
  47. package/scss/mng-overrides/_theme_tableview.scss +10 -10
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter, ExistingProvider, Injector, OnDestroy, OnInit } from '@angular/core';
2
2
  import { ControlValueAccessor, FormControl } from '@angular/forms';
3
+ import { TranslateService } from '@ngx-translate/core';
3
4
  import { Dropdown } from 'primeng/dropdown';
4
5
  import { Observable } from 'rxjs';
5
6
  import { ILookupDataProvider } from '../../../data-providers';
@@ -7,10 +8,13 @@ import * as i0 from "@angular/core";
7
8
  export declare const MNG_DROPDOWN_VALUE_ACCESSOR: ExistingProvider;
8
9
  export declare class MngDropdownComponent implements OnInit, OnDestroy, ControlValueAccessor {
9
10
  private injector;
11
+ private translate;
10
12
  dataProvider?: ILookupDataProvider<any, any>;
11
13
  dataKeyProperty?: string;
12
- itemsLabelProperty?: string;
13
- itemsValueProperty?: string;
14
+ itemsLabelPropertyInit?: string;
15
+ itemsLabelTranslate: boolean;
16
+ itemsValuePropertyInit?: string;
17
+ itemsDisabledProperty?: string;
14
18
  multiselect: boolean;
15
19
  placeholder?: string;
16
20
  showClear: boolean;
@@ -19,6 +23,8 @@ export declare class MngDropdownComponent implements OnInit, OnDestroy, ControlV
19
23
  dropdownClassName: string | null;
20
24
  valueChangeEventEmitter: EventEmitter<any>;
21
25
  primeDropdown?: Dropdown;
26
+ itemsLabelProperty?: string;
27
+ itemsValueProperty?: string;
22
28
  private itemsSubject;
23
29
  private dataProviderService;
24
30
  private onChangeFn;
@@ -26,7 +32,7 @@ export declare class MngDropdownComponent implements OnInit, OnDestroy, ControlV
26
32
  dropdownFormControl: FormControl;
27
33
  items$: Observable<Array<any>>;
28
34
  private itemsSubscription?;
29
- constructor(injector: Injector);
35
+ constructor(injector: Injector, translate: TranslateService);
30
36
  ngOnInit(): void;
31
37
  ngOnDestroy(): void;
32
38
  registerOnChange(fn: any): void;
@@ -34,5 +40,5 @@ export declare class MngDropdownComponent implements OnInit, OnDestroy, ControlV
34
40
  setDisabledState(isDisabled: boolean): void;
35
41
  writeValue(obj: any): void;
36
42
  static ɵfac: i0.ɵɵFactoryDeclaration<MngDropdownComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<MngDropdownComponent, "mng-dropdown", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "itemsLabelProperty": "itemsLabelProperty"; "itemsValueProperty": "itemsValueProperty"; "multiselect": "multiselect"; "placeholder": "placeholder"; "showClear": "showClear"; "selectFirstItem": "selectFirstItem"; "className": "className"; "dropdownClassName": "dropdownClassName"; }, { "valueChangeEventEmitter": "valueChange"; }, never, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<MngDropdownComponent, "mng-dropdown", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "itemsLabelPropertyInit": "itemsLabelProperty"; "itemsLabelTranslate": "itemsLabelTranslate"; "itemsValuePropertyInit": "itemsValueProperty"; "itemsDisabledProperty": "itemsDisabledProperty"; "multiselect": "multiselect"; "placeholder": "placeholder"; "showClear": "showClear"; "selectFirstItem": "selectFirstItem"; "className": "className"; "dropdownClassName": "dropdownClassName"; }, { "valueChangeEventEmitter": "valueChange"; }, never, never>;
38
44
  }
@@ -2,18 +2,24 @@ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { FieldType } from '@ngx-formly/core';
3
3
  import { Observable, Subject } from 'rxjs';
4
4
  import { ActionDescriptor, FieldManyEditorDescriptor } from '../../../../../descriptors';
5
+ import { MngActionExecutorService } from '../../../../../services';
6
+ import { MngTableCellClickEvent } from '../../../../tableview/models';
5
7
  import * as i0 from "@angular/core";
6
8
  export declare class MngFormlyFieldTableDialogFormComponent<T, ET> extends FieldType implements OnInit, OnDestroy {
9
+ private actionExecutor;
7
10
  descriptor: FieldManyEditorDescriptor<T, ET>;
8
11
  itemsSubject: Subject<Array<T>>;
9
12
  items$: Observable<Array<T>>;
10
- toolbarActions: Array<ActionDescriptor<T>>;
11
- rowActions: Array<ActionDescriptor<T>>;
13
+ toolbarRightActions: Array<ActionDescriptor<T>>;
14
+ rowClickActions: Array<ActionDescriptor<T>>;
15
+ rowInlineActions: Array<ActionDescriptor<T>>;
12
16
  private subscriptions;
13
17
  private isDisabledSubject;
14
18
  private isEnabled$;
19
+ constructor(actionExecutor: MngActionExecutorService);
15
20
  ngOnInit(): void;
16
21
  ngOnDestroy(): void;
22
+ onTableCellClick(event: MngTableCellClickEvent<T>): void;
17
23
  static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldTableDialogFormComponent<any, any>, never>;
18
24
  static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldTableDialogFormComponent<any, any>, "mng-formly-table-dialog-form-field", never, {}, {}, never, never>;
19
25
  }
@@ -22,6 +22,7 @@ export declare class MngTableColumnFilterComponent<T> implements OnInit {
22
22
  constructor(primeConfig: PrimeNGConfig);
23
23
  ngOnInit(): void;
24
24
  autocompleteFilter(value: T, filterCallback: Function): void;
25
+ dropdownFilter(value: T, filterCallback: Function): void;
25
26
  static ɵfac: i0.ɵɵFactoryDeclaration<MngTableColumnFilterComponent<any>, never>;
26
27
  static ɵcmp: i0.ɵɵComponentDeclaration<MngTableColumnFilterComponent<any>, "mng-table-column-filter", never, { "descriptor": "descriptor"; "display": "display"; }, {}, never, never>;
27
28
  }
@@ -28,6 +28,7 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
28
28
  useQueryParams: boolean;
29
29
  selectionMode: string;
30
30
  selectionEnabled: boolean;
31
+ isColumnClickable: boolean;
31
32
  captionComponent?: Type<any>;
32
33
  columnActionComponent?: Type<any>;
33
34
  loadEventEmitter: EventEmitter<MngTableLoadEvent>;
@@ -85,5 +86,5 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
85
86
  private updatePrimeSortAndFilter;
86
87
  private getDefaultSortMeta;
87
88
  static ɵfac: i0.ɵɵFactoryDeclaration<MngTableComponent<any, any>, [null, null, null, null, { optional: true; }]>;
88
- static ɵcmp: i0.ɵɵComponentDeclaration<MngTableComponent<any, any>, "mng-table", never, { "descriptor": "descriptor"; "items": "items"; "queryResult": "queryResult"; "loading": "loading"; "dataProvider": "dataProvider"; "useQueryParams": "useQueryParams"; "selectionMode": "selectionMode"; "selectionEnabled": "selectionEnabled"; "captionComponent": "captionComponent"; "columnActionComponent": "columnActionComponent"; }, { "loadEventEmitter": "tableLoad"; "cellClickEventEmitter": "cellClick"; "selectionChangeEventEmitter": "selectionChange"; "captionCmpInstEventEmitter": "captionComponentInstance"; "columnActionCmpInstEventEmitter": "columnActionComponentInstance"; }, ["templates"], never>;
89
+ static ɵcmp: i0.ɵɵComponentDeclaration<MngTableComponent<any, any>, "mng-table", never, { "descriptor": "descriptor"; "items": "items"; "queryResult": "queryResult"; "loading": "loading"; "dataProvider": "dataProvider"; "useQueryParams": "useQueryParams"; "selectionMode": "selectionMode"; "selectionEnabled": "selectionEnabled"; "isColumnClickable": "isColumnClickable"; "captionComponent": "captionComponent"; "columnActionComponent": "columnActionComponent"; }, { "loadEventEmitter": "tableLoad"; "cellClickEventEmitter": "cellClick"; "selectionChangeEventEmitter": "selectionChange"; "captionCmpInstEventEmitter": "captionComponentInstance"; "columnActionCmpInstEventEmitter": "columnActionComponentInstance"; }, ["templates"], never>;
89
90
  }
@@ -110,7 +110,7 @@ export declare namespace ActionDescriptor {
110
110
  }
111
111
  export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
112
112
  private readonly _editorDescriptor;
113
- private readonly _editorActions;
113
+ protected _editorActions: ActionDescriptor<T>[];
114
114
  protected _editorTitle?: string | null;
115
115
  protected _hasFetchNotificationSuccess: boolean;
116
116
  protected _fetchNotificationSuccessTitle?: string;
@@ -139,6 +139,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
139
139
  withSubmitFunction<S>(fn: (ctx: ActionExecContext<T, S, IEditorDataProvider<T, S>>) => Observable<T>): this;
140
140
  withFetchNotificationError(title?: string, message?: string, hasNotification?: boolean): this;
141
141
  withEditorAction(action: ActionDescriptor<T>): this;
142
+ withEditorActions(actions: ActionDescriptor<T>[]): this;
142
143
  withEditorComponent(editorComponent: Type<any>): this;
143
144
  }
144
145
  export declare class ActionEditorSubmitDescriptor<T> extends ActionDescriptor<T> {
@@ -7,22 +7,24 @@ import { MngFormFieldEvent, MngFormFieldEventData, MngFormFieldEventTypeEnum } f
7
7
  import { ILookupDataProvider, ITableDataProvider } from '../data-providers';
8
8
  import { EnumValue } from '../models';
9
9
  import { ClassType, EnumConstantType, EnumType } from '../types';
10
- import { FieldValidator, ILookupDescriptor, ModelDescriptor, TableDescriptor, TableviewDescriptor } from './';
10
+ import { ActionDescriptor, FieldValidator, ILookupDescriptor, ModelDescriptor, TableDescriptor, TableviewDescriptor } from './';
11
11
  import { FieldConfig, FieldLookupConfig } from './editor.descriptor.interface';
12
12
  export declare class EditorDescriptor<T> {
13
13
  static readonly defaultGroupName = "_default";
14
14
  private readonly _model;
15
+ private readonly _tableviewEditorType;
15
16
  private readonly _tabs;
16
17
  private readonly _groups;
17
18
  private readonly _fields;
18
19
  private _currentTabGroup?;
19
20
  private _currentGroup?;
20
- constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
21
21
  private _disabled;
22
- get disabled(): boolean;
22
+ constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, tableviewEditorType?: EditorDescriptor.TableviewEditorTypeEnum);
23
23
  get model(): ModelDescriptor<T>;
24
24
  get tabs(): FieldTabGroupDescriptor<T>[];
25
25
  get fields(): AFieldDescriptor<any, T>[];
26
+ get tableviewEditorType(): boolean;
27
+ get disabled(): boolean;
26
28
  createTabGroup(name: string, title?: string): FieldTabGroupDescriptor<T>;
27
29
  createFieldGroup(name: string, title?: string | null): FieldGroupDescriptor<T>;
28
30
  addFieldDescriptor<FT>(field: AFieldDescriptor<FT, T>): this;
@@ -41,6 +43,14 @@ export declare class EditorDescriptor<T> {
41
43
  private createDefaultGroup;
42
44
  private createDefaultTabGroup;
43
45
  }
46
+ export declare namespace EditorDescriptor {
47
+ enum TableviewEditorTypeEnum {
48
+ None = 0,
49
+ View = 1,
50
+ Edit = 2,
51
+ Add = 3
52
+ }
53
+ }
44
54
  export declare abstract class AGenericFieldDescriptor<ET> {
45
55
  protected readonly _editor: EditorDescriptor<ET>;
46
56
  protected _config: FieldConfig;
@@ -183,7 +193,9 @@ export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET
183
193
  protected readonly _modelType: ClassType<T> | null;
184
194
  protected _lookupType: FieldLookupDescriptor.LookupTypeEnum;
185
195
  protected _itemsLabelProperty?: string;
196
+ protected _itemsLabelTranslate: boolean;
186
197
  protected _itemsValueProperty?: string;
198
+ protected _itemsDisabledProperty?: string;
187
199
  protected _dataKeyProperty?: string;
188
200
  protected _dataProvider?: ILookupDataProvider<T, any>;
189
201
  protected _lookupTableDescriptor?: TableDescriptor<T>;
@@ -191,14 +203,17 @@ export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET
191
203
  constructor(editor: EditorDescriptor<ET>, property: string, modelType: ClassType<T> | null);
192
204
  get lookupType(): FieldLookupDescriptor.LookupTypeEnum;
193
205
  get itemsLabelProperty(): string | undefined;
206
+ get itemsLabelTranslate(): boolean;
194
207
  get itemsValueProperty(): string | undefined;
208
+ get itemsDisabledProperty(): string | undefined;
195
209
  get dataKeyProperty(): string | undefined;
196
210
  get dataProvider(): ILookupDataProvider<T, any> | undefined;
197
211
  get lookupTableDataProvider(): ITableDataProvider<T, any> | undefined;
198
212
  get modelType(): ClassType<T> | null;
199
213
  get lookupTableDescriptor(): TableDescriptor<T> | undefined;
200
- withItemsLabelProperty(itemsLabelProperty: string): this;
214
+ withItemsLabelProperty(itemsLabelProperty: string, translate?: boolean): this;
201
215
  withItemsValueProperty(itemsValueProperty: string): this;
216
+ withItemsDisabledProperty(itemsDisabledProperty: string): this;
202
217
  withDataKeyProperty(property: string): this;
203
218
  withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this;
204
219
  withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this;
@@ -216,8 +231,11 @@ export declare namespace FieldLookupDescriptor {
216
231
  }
217
232
  export declare class FieldLookupEnumDescriptor<ET> extends FieldLookupDescriptor<EnumValue<string | number>, ET> {
218
233
  private readonly _enumType;
234
+ private readonly _optionEnumValues;
235
+ private readonly _nameAsValue;
219
236
  constructor(editor: EditorDescriptor<ET>, property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null);
220
237
  get enumType(): EnumType;
238
+ withDisabledOptions(...disabledOptions: Array<EnumConstantType>): this;
221
239
  copy(): FieldLookupEnumDescriptor<ET>;
222
240
  }
223
241
  export declare class FieldManyToManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET> {
@@ -258,16 +276,20 @@ export declare class FieldManyEditorDescriptor<T, ET> extends AFieldDescriptor<T
258
276
  private readonly _modelType;
259
277
  private readonly _tableviewDescriptor;
260
278
  private _fieldType;
279
+ private _fieldActions;
261
280
  private _actions;
262
281
  constructor(editor: EditorDescriptor<ET>, property: string, modelType: ClassType<T>, tableviewDescriptor: TableviewDescriptor<T>);
263
282
  get fieldType(): FieldManyEditorDescriptor.TypeEnum;
264
- get actions(): FieldManyEditorDescriptor.ActionEnum[];
283
+ get fieldActions(): FieldManyEditorDescriptor.ActionEnum[];
284
+ get actions(): ActionDescriptor<T>[];
265
285
  get tableviewDescriptor(): TableviewDescriptor<T>;
266
286
  get tableDescriptor(): TableDescriptor<T>;
267
287
  get editorForCreate(): EditorDescriptor<T>;
268
288
  get editorForRead(): EditorDescriptor<T>;
269
289
  get editorForUpdate(): EditorDescriptor<T>;
270
- withActions(actions?: Array<FieldManyToManyEditorDescriptor.ActionEnum>): this;
290
+ withFieldAction(action: FieldManyEditorDescriptor.ActionEnum): this;
291
+ withFieldActions(actions: FieldManyEditorDescriptor.ActionEnum[]): this;
292
+ withAction(action: ActionDescriptor<T>): this;
271
293
  copy(): FieldManyEditorDescriptor<T, ET>;
272
294
  }
273
295
  export declare namespace FieldManyEditorDescriptor {
@@ -275,9 +297,10 @@ export declare namespace FieldManyEditorDescriptor {
275
297
  DialogEditor = 0
276
298
  }
277
299
  enum ActionEnum {
278
- Add = 0,
279
- Edit = 1,
280
- Delete = 2
300
+ View = 0,
301
+ Add = 1,
302
+ Edit = 2,
303
+ Delete = 3
281
304
  }
282
305
  }
283
306
  export declare abstract class AFieldGroupDescriptor<ET> extends AGenericFieldDescriptor<ET> {
@@ -36,7 +36,7 @@ export declare class TableDescriptor<T> {
36
36
  addColumn(property: string): ColumnDescriptor<string, T>;
37
37
  addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T>;
38
38
  addColumnDate(property: string, displayFormat?: string): ColumnDescriptor<Date, T>;
39
- addColumnBoolean(property: string): ColumnDescriptor<boolean, T>;
39
+ addColumnBoolean(property: string, yes?: string, no?: string, asIcon?: boolean): ColumnDescriptor<boolean, T>;
40
40
  addColumnEnum(property: string, enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): ColumnDescriptor<boolean, T>;
41
41
  addColumnObject<CT>(property: string, modelType: ClassType<CT>, displayProperty: string): ColumnDescriptor<CT, T>;
42
42
  withFilterDisplay(filterDisplayType: TableDescriptor.FilterDisplayEnum): this;
@@ -73,6 +73,9 @@ export declare class ColumnDescriptor<T, TT> {
73
73
  private _enumType?;
74
74
  private _enumTitlePath?;
75
75
  private _enumNameAsValue;
76
+ private _booleanAsIcon;
77
+ private _booleanYes?;
78
+ private _booleanNo?;
76
79
  constructor(table: TableDescriptor<TT>, property: string);
77
80
  get modelType(): ClassType<T> | null;
78
81
  get columnType(): ColumnDescriptor.TypeEnum;
@@ -86,10 +89,13 @@ export declare class ColumnDescriptor<T, TT> {
86
89
  get enumType(): EnumType | undefined;
87
90
  get enumTitlePath(): string | null | undefined;
88
91
  get enumNameAsValue(): boolean;
92
+ get booleanAsIcon(): boolean;
93
+ get booleanYes(): string | undefined;
94
+ get booleanNo(): string | undefined;
89
95
  asType(type?: ColumnDescriptor.TypeEnum): this;
90
96
  asNumber(displayFormat?: string): this;
91
97
  asDate(displayFormat?: string): this;
92
- asBoolean(): this;
98
+ asBoolean(yes?: string, no?: string, asIcon?: boolean): this;
93
99
  asEnum(enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): this;
94
100
  withModelType(modelType: ClassType<T>): this;
95
101
  withTitle(title: string): this;
@@ -167,6 +173,7 @@ export declare class FilterLookupDescriptor<T> extends FilterDescriptor<T> imple
167
173
  private _lookupType?;
168
174
  private _dataProvider?;
169
175
  private _itemsLabelProperty?;
176
+ private _itemsLabelTranslate;
170
177
  private _itemsValueProperty?;
171
178
  private _dataKeyProperty?;
172
179
  private _multiselect;
@@ -175,12 +182,13 @@ export declare class FilterLookupDescriptor<T> extends FilterDescriptor<T> imple
175
182
  get lookupType(): FilterLookupDescriptor.LookupTypeEnum | undefined;
176
183
  get dataProvider(): ILookupDataProvider<T, any> | undefined;
177
184
  get itemsLabelProperty(): string | undefined;
185
+ get itemsLabelTranslate(): boolean;
178
186
  get itemsValueProperty(): string | undefined;
179
187
  get dataKeyProperty(): string | undefined;
180
188
  get multiselect(): boolean;
181
189
  get dropdownClassName(): string;
182
190
  get modelType(): ClassType<T> | null;
183
- withItemsLabelProperty(itemsLabelProperty: string): this;
191
+ withItemsLabelProperty(itemsLabelProperty: string, translate?: boolean): this;
184
192
  withItemsValueProperty(itemsValueProperty: string): this;
185
193
  withDataKeyProperty(dataKeyProperty: string): this;
186
194
  withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this;
@@ -25,7 +25,7 @@ export declare class TableviewDescriptor<T> {
25
25
  addColumn(property: string): ColumnDescriptor<string, T>;
26
26
  addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T>;
27
27
  addColumnDate(property: string, displayFormat?: string): ColumnDescriptor<Date, T>;
28
- addColumnBoolean(property: string): ColumnDescriptor<boolean, T>;
28
+ addColumnBoolean(property: string, yes?: string, no?: string, asIcon?: boolean): ColumnDescriptor<boolean, T>;
29
29
  addColumnEnum(property: string, enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): ColumnDescriptor<boolean, T>;
30
30
  addColumnObject<CT>(property: string, modelType: ClassType<CT>, displayProperty: string): ColumnDescriptor<CT, T>;
31
31
  createTabGroup(name: string, title?: string): this;
@@ -2,4 +2,5 @@ export interface EnumValue<T> {
2
2
  name?: string;
3
3
  value: T;
4
4
  title: string;
5
+ disabled?: boolean;
5
6
  }
@@ -1,7 +1,7 @@
1
1
  import { PipeTransform } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class MngBooleanPipe implements PipeTransform {
4
- transform(value: any): any;
4
+ transform(value: any, yes?: string, no?: string, icon?: boolean): any;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<MngBooleanPipe, never>;
6
6
  static ɵpipe: i0.ɵɵPipeDeclaration<MngBooleanPipe, "boolean">;
7
7
  }
@@ -36,7 +36,9 @@ export declare class RouteBuilder {
36
36
  private constructor();
37
37
  static create(path: string, component: Type<any>): RouteBuilder;
38
38
  static createRedirect(path: string, redirectTo: string, pathMatch?: 'full' | 'prefix'): RouteBuilder;
39
+ static createLazyRoute(path: string, loadChildren: LoadChildren, canLoad?: Array<any>): RouteBuilder;
39
40
  static createFromRoute(route: Route): RouteBuilder;
41
+ static createLayoutRoute(path: string, layoutComponent?: typeof MngMainLayoutComponent, topbarComponent?: Type<any>, breadcrumbComponent?: Type<any>, menuComponent?: Type<any>, footerComponent?: Type<any>): RouteBuilder;
40
42
  static createTableviewRoutes<T, S>(path: string, descriptor: TableviewDescriptor<T>, dataProvider: ITableviewDataProvider<T, S>, actions?: Array<ActionDescriptor<T>>, hasDetails?: boolean, hasEdit?: boolean, hasAdd?: boolean): RouteBuilder;
41
43
  static createTableviewRoutesFromComponent(path: string, component: Type<any>, hasDetails?: boolean, hasEdit?: boolean, hasAdd?: boolean): RouteBuilder;
42
44
  private static addActionsSubroutesToTableviewParent;
@@ -41,13 +41,14 @@ export declare class MngActionExecutorService {
41
41
  * Runs editor action fetch function.
42
42
  *
43
43
  * @param action Action descriptor.
44
+ * @param item Item instance (if exists).
44
45
  * @param itemId Item id.
45
46
  * @param dataProvider Data provider
46
47
  * @param sourceComponent Source component from where the fetch function was called.
47
48
  * @param viewContainer View container/service. Tableview component.
48
49
  * @param actionData Additional action data.
49
50
  */
50
- runEditorFetch<T, S>(action: ActionEditorDescriptor<T>, itemId?: IdType, dataProvider?: IEditorDataProvider<T, S>, sourceComponent?: any, viewContainer?: IViewContainer<T, S>, actionData?: ActionData): Observable<ActionRunResult<T, S, IEditorDataProvider<T, S>>>;
51
+ runEditorFetch<T, S>(action: ActionEditorDescriptor<T>, item?: T, itemId?: IdType, dataProvider?: IEditorDataProvider<T, S>, sourceComponent?: any, viewContainer?: IViewContainer<T, S>, actionData?: ActionData): Observable<ActionRunResult<T, S, IEditorDataProvider<T, S>>>;
51
52
  /**
52
53
  * Prepares action exec context for action of type editor.
53
54
  *
@@ -83,7 +84,7 @@ export declare class MngActionExecutorService {
83
84
  * @param event Target table click event.
84
85
  * @param route Currently activate route.
85
86
  */
86
- triggerRowClickAction<T>(action: ActionDescriptor<T>, event: MngTableCellClickEvent<T>, route: ActivatedRoute): Observable<ActionTriggerResult<T, unknown, IDataProvider<T, unknown>>>;
87
+ triggerRowClickAction<T>(action: ActionDescriptor<T>, event: MngTableCellClickEvent<T>, route?: ActivatedRoute): Observable<ActionTriggerResult<T, unknown, IDataProvider<T, unknown>>>;
87
88
  /**
88
89
  * Triggers action with optional data (item, itemId, ...) and currently activated route.
89
90
  *
@@ -3,5 +3,5 @@ import { ClassType } from '../types';
3
3
  export declare class ModelUtil {
4
4
  static findIdAttribute<T>(classType: ClassType<T>): string | null;
5
5
  static findTitleAttribute<T>(classType: ClassType<T>): string | null;
6
- static trySetLookupItemsProperties<T>(lookup: ILookupDescriptor<T>): void;
6
+ static trySetLookupItemsProperties<T>(lookup: ILookupDescriptor<T>, idAsDataKey?: boolean): void;
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "0.2.20",
3
+ "version": "0.2.23",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^13.1.0",
6
6
  "@angular/core": "^13.1.0",
@@ -25,11 +25,4 @@
25
25
  width: 80%;
26
26
  }
27
27
  }
28
-
29
- //&.mng-details-dynamic-dialog {
30
- // .p-dialog-content {
31
- // border-bottom-left-radius: $dialogBorderRadius;
32
- // border-bottom-right-radius: $dialogBorderRadius;
33
- // }
34
- //}
35
28
  }
@@ -1,5 +1,7 @@
1
1
  .p-dialog {
2
- &.mng-details-dynamic-dialog {
2
+ &.mng-details-dynamic-dialog,
3
+ &.mng-formly-field-table-multiselect-dialog,
4
+ &.mng-formly-field-table-form-dialog {
3
5
  .p-dialog-content {
4
6
  border-bottom-left-radius: $dialogBorderRadius;
5
7
  border-bottom-right-radius: $dialogBorderRadius;
@@ -34,16 +34,6 @@
34
34
  }
35
35
  }
36
36
 
37
- .p-datatable:not(.p-datatable-gridlines) {
38
- .p-datatable-tbody > tr > td {
39
- cursor: auto;
40
- }
41
-
42
- .p-datatable-tbody > tr > td.clickable {
43
- cursor: pointer;
44
- }
45
- }
46
-
47
37
  /* Responsive */
48
38
  .p-datatable-tbody > tr > td .p-column-title {
49
39
  display: none;
@@ -92,3 +82,13 @@
92
82
  }
93
83
  }
94
84
  }
85
+
86
+ .p-datatable:not(.p-datatable-gridlines) {
87
+ .p-datatable-tbody > tr > td {
88
+ cursor: auto;
89
+ }
90
+
91
+ .p-datatable-tbody > tr > td.clickable {
92
+ cursor: pointer;
93
+ }
94
+ }