@mediusinc/mng-commons 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/action/action.component.mjs +8 -8
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +41 -20
- package/esm2020/lib/components/action/route/action-route.component.mjs +3 -3
- package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +21 -3
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +29 -29
- package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +13 -15
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +5 -5
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +1 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +1 -1
- package/esm2020/lib/components/tableview/tableview.component.mjs +16 -14
- package/esm2020/lib/descriptors/action.descriptor.mjs +19 -12
- package/esm2020/lib/descriptors/editor.descriptor.mjs +5 -8
- package/esm2020/lib/descriptors/field.descriptor.mjs +13 -3
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +32 -32
- package/esm2020/lib/descriptors/types/editor.type.mjs +8 -8
- package/esm2020/lib/models/view-container.model.mjs +1 -1
- package/esm2020/lib/router/tableview-route-builder.mjs +2 -2
- package/esm2020/lib/security/model/permissions.model.mjs +1 -9
- package/esm2020/lib/services/view-container.component.service.mjs +21 -8
- package/fesm2015/mediusinc-mng-commons.mjs +587 -527
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +568 -510
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/action/editor/action-editor.component.d.ts +1 -2
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +7 -2
- package/lib/components/form/editor/form-editor.component.d.ts +1 -1
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +0 -3
- package/lib/components/tableview/tableview.component.d.ts +2 -2
- package/lib/descriptors/action.descriptor.d.ts +6 -4
- package/lib/descriptors/editor.descriptor.d.ts +5 -6
- package/lib/descriptors/field.descriptor.d.ts +5 -1
- package/lib/descriptors/tableview.descriptor.d.ts +5 -5
- package/lib/descriptors/types/editor.type.d.ts +2 -2
- package/lib/models/view-container.model.d.ts +31 -0
- package/lib/router/tableview-route-builder.d.ts +1 -1
- package/lib/security/model/permissions.model.d.ts +0 -7
- package/lib/services/view-container.component.service.d.ts +12 -6
- package/package.json +1 -1
- package/scss/mng-overrides/_layout_dialog.scss +1 -0
- package/scss/mng-overrides/_theme_autocomplete.scss +16 -0
- package/scss/mng-overrides/_theme_styles.scss +1 -0
- package/version-info.json +5 -5
|
@@ -32,10 +32,8 @@ export declare class MngActionEditorComponent<T, S> implements OnInit, OnDestroy
|
|
|
32
32
|
templates: QueryList<MngTemplateDirective>;
|
|
33
33
|
submitButtonElementRef: ElementRef;
|
|
34
34
|
editorComponent: MngFormEditorComponent<T>;
|
|
35
|
-
cmpId: string;
|
|
36
35
|
title?: string;
|
|
37
36
|
isDialog: boolean;
|
|
38
|
-
isSaveButton: boolean;
|
|
39
37
|
private instance?;
|
|
40
38
|
private previousActionInstance?;
|
|
41
39
|
toolbarLeftActions: ActionDescriptor<T>[];
|
|
@@ -59,6 +57,7 @@ export declare class MngActionEditorComponent<T, S> implements OnInit, OnDestroy
|
|
|
59
57
|
private loadItemWithDataProvider;
|
|
60
58
|
private setTitle;
|
|
61
59
|
private deactivateAction;
|
|
60
|
+
private placeActionsOnPositions;
|
|
62
61
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngActionEditorComponent<any, any>, [null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
63
62
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngActionEditorComponent<any, any>, "mng-action-editor", never, { "action": "action"; "itemId": "itemId"; "item": "item"; "actionData": "actionData"; "dataProvider": "dataProvider"; "viewContainerInit": "viewContainer"; }, { "actionRunEventEmitter": "actionSubmit"; "actionCancelEventEmitter": "actionCancel"; }, ["templates"], never, false>;
|
|
64
63
|
}
|
|
@@ -2,7 +2,7 @@ import { EventEmitter, ExistingProvider, Injector, OnDestroy, OnInit } from '@an
|
|
|
2
2
|
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
4
4
|
import { AutoComplete } from 'primeng/autocomplete';
|
|
5
|
-
import { Observable } from 'rxjs';
|
|
5
|
+
import { Observable, Subscription } from 'rxjs';
|
|
6
6
|
import { ILookupDataProvider } from '../../../data-providers';
|
|
7
7
|
import { MngFormlyFieldWrapperComponent } from '../formly/wrappers';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
@@ -22,6 +22,9 @@ export declare class MngAutocompleteComponent implements OnInit, OnDestroy, Cont
|
|
|
22
22
|
placeholder?: string;
|
|
23
23
|
className: string | null;
|
|
24
24
|
dropdownClassName: string | null;
|
|
25
|
+
showClear: boolean;
|
|
26
|
+
autoClear: boolean;
|
|
27
|
+
selectFirst: boolean;
|
|
25
28
|
valueChangeEventEmitter: EventEmitter<any>;
|
|
26
29
|
primeAutocomplete?: AutoComplete;
|
|
27
30
|
private isInited;
|
|
@@ -34,6 +37,7 @@ export declare class MngAutocompleteComponent implements OnInit, OnDestroy, Cont
|
|
|
34
37
|
itemsValueProperty?: string;
|
|
35
38
|
autocompleteFormControl: FormControl;
|
|
36
39
|
suggestions$: Observable<Array<any>>;
|
|
40
|
+
suggestionSubscription?: Subscription;
|
|
37
41
|
constructor(injector: Injector, translate: TranslateService, formlyWrapper: MngFormlyFieldWrapperComponent);
|
|
38
42
|
ngOnInit(): void;
|
|
39
43
|
ngOnDestroy(): void;
|
|
@@ -41,6 +45,7 @@ export declare class MngAutocompleteComponent implements OnInit, OnDestroy, Cont
|
|
|
41
45
|
onSelect(value: any): void;
|
|
42
46
|
onFocus(event: Event): void;
|
|
43
47
|
onBlur(event: any): void;
|
|
48
|
+
onClear(event: Event): void;
|
|
44
49
|
registerOnChange(fn: any): void;
|
|
45
50
|
registerOnTouched(fn: any): void;
|
|
46
51
|
setDisabledState(isDisabled: boolean): void;
|
|
@@ -52,5 +57,5 @@ export declare class MngAutocompleteComponent implements OnInit, OnDestroy, Cont
|
|
|
52
57
|
private i18nPopulateItems;
|
|
53
58
|
private setSuggestionsFromItems;
|
|
54
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngAutocompleteComponent, [null, null, { optional: true; }]>;
|
|
55
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MngAutocompleteComponent, "mng-autocomplete", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "itemsValuePropertyInit": "itemsValueProperty"; "itemsLabelPropertyInit": "itemsLabelProperty"; "itemsLabelTranslate": "itemsLabelTranslate"; "inlineSearch": "inlineSearch"; "openOnFocus": "openOnFocus"; "multiselect": "multiselect"; "placeholder": "placeholder"; "className": "className"; "dropdownClassName": "dropdownClassName"; }, { "valueChangeEventEmitter": "valueChange"; }, never, never, false>;
|
|
60
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MngAutocompleteComponent, "mng-autocomplete", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "itemsValuePropertyInit": "itemsValueProperty"; "itemsLabelPropertyInit": "itemsLabelProperty"; "itemsLabelTranslate": "itemsLabelTranslate"; "inlineSearch": "inlineSearch"; "openOnFocus": "openOnFocus"; "multiselect": "multiselect"; "placeholder": "placeholder"; "className": "className"; "dropdownClassName": "dropdownClassName"; "showClear": "showClear"; "autoClear": "autoClear"; "selectFirst": "selectFirst"; }, { "valueChangeEventEmitter": "valueChange"; }, never, never, false>;
|
|
56
61
|
}
|
|
@@ -32,13 +32,13 @@ export declare class MngFormEditorComponent<T> implements OnInit, OnDestroy {
|
|
|
32
32
|
submit(): void;
|
|
33
33
|
onSubmit(event: Event): void;
|
|
34
34
|
getFormValue(): T;
|
|
35
|
+
resetFormModel(item?: T): void;
|
|
35
36
|
getFormField(key: string): AbstractControl<any, any> | null;
|
|
36
37
|
setFormFieldValue(key: string, value: any): void;
|
|
37
38
|
patchFormFieldValue(key: string, value: any): void;
|
|
38
39
|
resetFormFieldValue(key: string, value?: any): void;
|
|
39
40
|
private findFormField;
|
|
40
41
|
private isAnyFieldInvalid;
|
|
41
|
-
private resetFormModel;
|
|
42
42
|
private updateFormState;
|
|
43
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngFormEditorComponent<any>, never>;
|
|
44
44
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngFormEditorComponent<any>, "mng-form-editor", never, { "descriptor": "descriptor"; "submitLoading": "submitLoading"; "item": "item"; "isSubmitButtonVisible": "isSubmitButtonVisible"; "isFormDisabled": "isFormDisabled"; }, { "formSubmitEventEmitter": "formSubmit"; }, ["templates"], never, false>;
|
|
@@ -2,10 +2,8 @@ import { AfterViewInit, 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
5
|
import * as i0 from "@angular/core";
|
|
7
6
|
export declare class MngFormlyFieldTableDialogFormComponent<T, ET> extends FieldType implements OnInit, AfterViewInit, OnDestroy {
|
|
8
|
-
private actionExecutor;
|
|
9
7
|
descriptor: FieldManyEditorDescriptor<T, ET>;
|
|
10
8
|
itemsSubject: Subject<Array<T>>;
|
|
11
9
|
items$: Observable<Array<T>>;
|
|
@@ -14,7 +12,6 @@ export declare class MngFormlyFieldTableDialogFormComponent<T, ET> extends Field
|
|
|
14
12
|
private subscriptions;
|
|
15
13
|
private isDisabledSubject;
|
|
16
14
|
private isEnabled$;
|
|
17
|
-
constructor(actionExecutor: MngActionExecutorService);
|
|
18
15
|
ngOnInit(): void;
|
|
19
16
|
ngAfterViewInit(): void;
|
|
20
17
|
ngOnDestroy(): void;
|
|
@@ -24,8 +24,7 @@ export declare class MngTableviewComponent<T, S> implements OnInit, OnDestroy, A
|
|
|
24
24
|
dataProvider?: ITableviewDataProvider<T, S>;
|
|
25
25
|
actions: Array<ActionDescriptor<T>>;
|
|
26
26
|
tableComponent?: MngTableComponent<T, S>;
|
|
27
|
-
|
|
28
|
-
rowInlineActions: ActionDescriptor<T>[];
|
|
27
|
+
tableActions: ActionDescriptor<T>[];
|
|
29
28
|
toolbarLeftActions: ActionDescriptor<T>[];
|
|
30
29
|
toolbarRightActions: ActionDescriptor<T>[];
|
|
31
30
|
tableQueryParam?: MediusQueryParam;
|
|
@@ -40,6 +39,7 @@ export declare class MngTableviewComponent<T, S> implements OnInit, OnDestroy, A
|
|
|
40
39
|
ngOnDestroy(): void;
|
|
41
40
|
getMessageService(): MessageService;
|
|
42
41
|
getDataProvider(): IDataProvider<T, S> | undefined;
|
|
42
|
+
getActions(): ActionDescriptor<T>[];
|
|
43
43
|
reloadTable(): void;
|
|
44
44
|
onTableLoad(event: MngTableLoadEvent): void;
|
|
45
45
|
selectionChange(selectedItems: Array<T>): void;
|
|
@@ -21,7 +21,8 @@ export declare class ActionDescriptor<T> {
|
|
|
21
21
|
protected _activationTrigger: ActionActivationTriggerEnum;
|
|
22
22
|
protected _position: ActionPositionEnum;
|
|
23
23
|
protected _level: StyleLevelEnum;
|
|
24
|
-
|
|
24
|
+
private _positionTableviewCategories?;
|
|
25
|
+
protected _tableviewCategory?: string;
|
|
25
26
|
protected _routeUrl: string | null;
|
|
26
27
|
protected _dataProvider?: IDataProvider<T, any>;
|
|
27
28
|
protected _runFunction?: (ctx: ActionContext<T, any>) => Observable<T | undefined | null>;
|
|
@@ -37,7 +38,6 @@ export declare class ActionDescriptor<T> {
|
|
|
37
38
|
protected _afterRunAction?: ActionDescriptor<unknown>;
|
|
38
39
|
protected _onRunErrorAction?: ActionDescriptor<unknown>;
|
|
39
40
|
protected _permissions?: APermissions;
|
|
40
|
-
protected _permissionsRouteType?: string;
|
|
41
41
|
protected _button: ActionButtonDescriptor;
|
|
42
42
|
protected _hasItemsSelection: boolean;
|
|
43
43
|
constructor(model: ModelDescriptor<T> | null, actionName: string, parentType?: ClassType<unknown>, parentProperty?: string);
|
|
@@ -69,9 +69,10 @@ export declare class ActionDescriptor<T> {
|
|
|
69
69
|
get afterRunAction(): ActionDescriptor<unknown> | undefined;
|
|
70
70
|
get onRunErrorAction(): ActionDescriptor<unknown> | undefined;
|
|
71
71
|
get permissions(): APermissions | undefined;
|
|
72
|
-
get
|
|
72
|
+
get tableviewCategory(): string | undefined;
|
|
73
73
|
get hasItemsSelection(): boolean;
|
|
74
74
|
get button(): ActionButtonDescriptor;
|
|
75
|
+
get positionTableviewCategories(): string[] | undefined;
|
|
75
76
|
withDataProvider(dataProvider: IDataProvider<T, any>): this;
|
|
76
77
|
withServiceType<S>(serviceType: Type<S>): this;
|
|
77
78
|
withRunFunction<S>(fn: (ctx: ActionContext<T, S>) => Observable<T | undefined | null>): this;
|
|
@@ -93,10 +94,11 @@ export declare class ActionDescriptor<T> {
|
|
|
93
94
|
withAfterRunAction<RT>(action: ActionDescriptor<RT>): this;
|
|
94
95
|
withOnRunErrorAction<RT>(action: ActionDescriptor<RT>): this;
|
|
95
96
|
withPermissions(permissions: APermissions): this;
|
|
96
|
-
|
|
97
|
+
withTableviewCategory(permissionsRouteType: string): this;
|
|
97
98
|
withButtonDescriptor(button: ActionButtonDescriptor): this;
|
|
98
99
|
withButton(label?: string | null, icon?: string | null, styleLevel?: StyleLevelEnum, styleText?: boolean): this;
|
|
99
100
|
withItemsSelection(hasSelection?: boolean): this;
|
|
101
|
+
withPositionTableviewCategories(positionTableviewCategories: string[]): this;
|
|
100
102
|
}
|
|
101
103
|
export declare class ActionSimpleDescriptor<T> extends ActionDescriptor<T> {
|
|
102
104
|
constructor(actionName: string, modelType?: ClassType<T>, idProperty?: string, titleProperty?: string);
|
|
@@ -2,19 +2,19 @@ import { ILookupDataProvider } from '../data-providers';
|
|
|
2
2
|
import { TableviewAttributeDef } from '../models/tableview-attr.model';
|
|
3
3
|
import { ClassType, EnumConstantType, EnumType, MngFieldValidationMessage, MngFieldValidator } from '../types';
|
|
4
4
|
import { AFieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, ModelDescriptor, TableDescriptor, TableviewDescriptor } from './';
|
|
5
|
-
import { FieldInputTypeEnum,
|
|
5
|
+
import { FieldInputTypeEnum, TableviewEditorTypeEnum } from './types';
|
|
6
6
|
export declare class EditorDescriptor<T> {
|
|
7
7
|
static readonly defaultGroupName = "_default";
|
|
8
8
|
protected readonly _model: ModelDescriptor<T>;
|
|
9
9
|
protected readonly _modelType: ClassType<T>;
|
|
10
|
-
protected readonly _tableviewEditorType:
|
|
10
|
+
protected readonly _tableviewEditorType: TableviewEditorTypeEnum;
|
|
11
11
|
protected readonly _tabs: Array<FieldTabGroupDescriptor<T>>;
|
|
12
12
|
protected readonly _groups: Array<FieldGroupDescriptor<T>>;
|
|
13
13
|
protected _fields: Array<AFieldDescriptor<any, T>>;
|
|
14
14
|
protected _currentTabGroup?: FieldTabGroupDescriptor<T>;
|
|
15
15
|
protected _currentGroup?: FieldGroupDescriptor<T>;
|
|
16
16
|
protected _disabled: boolean;
|
|
17
|
-
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, tableviewEditorType?:
|
|
17
|
+
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, tableviewEditorType?: TableviewEditorTypeEnum);
|
|
18
18
|
/**
|
|
19
19
|
* auto generated editor descriptor based on openapi definition
|
|
20
20
|
* generates all fields from definition
|
|
@@ -23,7 +23,7 @@ export declare class EditorDescriptor<T> {
|
|
|
23
23
|
* @param titleProperty
|
|
24
24
|
* @param tableEditorType
|
|
25
25
|
*/
|
|
26
|
-
static from<T>(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, tableEditorType?:
|
|
26
|
+
static from<T>(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, tableEditorType?: TableviewEditorTypeEnum): EditorDescriptor<T>;
|
|
27
27
|
/**
|
|
28
28
|
* auto generated editor descriptor based on openapi definition
|
|
29
29
|
* generates only selected fields
|
|
@@ -33,11 +33,10 @@ export declare class EditorDescriptor<T> {
|
|
|
33
33
|
* @param titleProperty
|
|
34
34
|
* @param tableEditorType
|
|
35
35
|
*/
|
|
36
|
-
static fromModelWithAttributes<T>(modelType: ClassType<T>, attributes: TableviewAttributeDef[], idProperty?: string, titleProperty?: string, tableEditorType?:
|
|
36
|
+
static fromModelWithAttributes<T>(modelType: ClassType<T>, attributes: TableviewAttributeDef[], idProperty?: string, titleProperty?: string, tableEditorType?: TableviewEditorTypeEnum): EditorDescriptor<T>;
|
|
37
37
|
get model(): ModelDescriptor<T>;
|
|
38
38
|
get tabs(): FieldTabGroupDescriptor<T>[];
|
|
39
39
|
get fields(): AFieldDescriptor<any, T>[];
|
|
40
|
-
get tableviewEditorType(): boolean;
|
|
41
40
|
get disabled(): boolean;
|
|
42
41
|
createTabGroup(name: string, title?: string): FieldTabGroupDescriptor<T>;
|
|
43
42
|
createFieldGroup(name: string, title?: string | null): FieldGroupDescriptor<T>;
|
|
@@ -185,6 +185,8 @@ export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET
|
|
|
185
185
|
protected _dropdownClassName: string;
|
|
186
186
|
protected _autocompleteOpenOnFocus: boolean;
|
|
187
187
|
protected _autocompleteInlineSearch: boolean;
|
|
188
|
+
protected _autocompleteAutoClear: boolean;
|
|
189
|
+
protected _autocompleteSelectFirst: boolean;
|
|
188
190
|
protected _dialogTableDescriptor?: TableDescriptor<T>;
|
|
189
191
|
protected _dialogTableDataProvider?: ITableDataProvider<T, any>;
|
|
190
192
|
constructor(editor: EditorDescriptor<ET>, property: string, modelType: ClassType<T> | null);
|
|
@@ -197,6 +199,8 @@ export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET
|
|
|
197
199
|
get dataProvider(): ILookupDataProvider<T, any> | undefined;
|
|
198
200
|
get autocompleteOpenOnFocus(): boolean;
|
|
199
201
|
get autocompleteInlineSearch(): boolean;
|
|
202
|
+
get autocompleteAutoClear(): boolean;
|
|
203
|
+
get autocompleteSelectFirst(): boolean;
|
|
200
204
|
get dropdownClassName(): string;
|
|
201
205
|
get modelType(): ClassType<T> | null;
|
|
202
206
|
get dialogTableDescriptor(): TableDescriptor<T> | undefined;
|
|
@@ -208,7 +212,7 @@ export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET
|
|
|
208
212
|
withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this;
|
|
209
213
|
withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this;
|
|
210
214
|
withConfig(config: FieldLookupConfig): this;
|
|
211
|
-
asAutocomplete(openOnFocus?: boolean, inlineSearch?: boolean): this;
|
|
215
|
+
asAutocomplete(openOnFocus?: boolean, inlineSearch?: boolean, selectFirst?: boolean, autoClear?: boolean): this;
|
|
212
216
|
asDialog(lookupTableDescriptor: TableDescriptor<T>, tableDataProvider?: ITableDataProvider<T, any>): this;
|
|
213
217
|
copy(): FieldLookupDescriptor<T, ET>;
|
|
214
218
|
}
|
|
@@ -5,12 +5,12 @@ import { IColumnValueComponent } from '../models';
|
|
|
5
5
|
import { TableviewAttributeDef } from '../models/tableview-attr.model';
|
|
6
6
|
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
7
7
|
import { AFieldDescriptor, ColumnDescriptor, EditorDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, ModelDescriptor, TableDescriptor, TableDynamicDescriptor } from './index';
|
|
8
|
-
import { ColumnTypeEnum, FieldInputTypeEnum,
|
|
8
|
+
import { ColumnTypeEnum, FieldInputTypeEnum, TableviewEditorTypeEnum } from './types';
|
|
9
9
|
export declare class TableviewDescriptor<T> {
|
|
10
10
|
private readonly _model;
|
|
11
11
|
private _modelType;
|
|
12
12
|
protected _table: TableDescriptor<T>;
|
|
13
|
-
protected
|
|
13
|
+
protected _detailsEditor: EditorDescriptor<T>;
|
|
14
14
|
protected _addEditor: EditorDescriptor<T>;
|
|
15
15
|
protected _editEditor: EditorDescriptor<T>;
|
|
16
16
|
protected _tableTitle?: string;
|
|
@@ -32,14 +32,14 @@ export declare class TableviewDescriptor<T> {
|
|
|
32
32
|
*/
|
|
33
33
|
static fromModelWithDefinition<T>(modelType: ClassType<T>, columnAttributes: TableviewAttributeDef[], fieldAttributes?: TableviewAttributeDef[] | null, idProperty?: string, titleProperty?: string): TableviewDescriptor<T>;
|
|
34
34
|
get table(): TableDescriptor<T>;
|
|
35
|
-
get
|
|
35
|
+
get detailsEditor(): EditorDescriptor<T>;
|
|
36
36
|
get addEditor(): EditorDescriptor<T>;
|
|
37
37
|
get editEditor(): EditorDescriptor<T>;
|
|
38
38
|
get tableTitle(): string | undefined;
|
|
39
39
|
get model(): ModelDescriptor<T>;
|
|
40
40
|
withTableDescriptor(descriptor: TableDescriptor<T>): this;
|
|
41
41
|
withEditorDescriptors(descriptor: EditorDescriptor<T>): this;
|
|
42
|
-
|
|
42
|
+
withDetailsDescriptor(descriptor: EditorDescriptor<T>): this;
|
|
43
43
|
withAddDescriptor(descriptor: EditorDescriptor<T>): this;
|
|
44
44
|
withEditDescriptor(descriptor: EditorDescriptor<T>): this;
|
|
45
45
|
withTableTitle(title: string): this;
|
|
@@ -47,7 +47,7 @@ export declare class TableviewDescriptor<T> {
|
|
|
47
47
|
addColumnDescriptor<CT>(column: ColumnDescriptor<CT, T>): TableDescriptor<T>;
|
|
48
48
|
addColumn(property: string): ColumnDescriptor<string, T>;
|
|
49
49
|
removeColumn(property: string): void;
|
|
50
|
-
getField(property: string, editorType:
|
|
50
|
+
getField(property: string, editorType: TableviewEditorTypeEnum): AFieldDescriptor<any, T> | null;
|
|
51
51
|
removeField(property: string): void;
|
|
52
52
|
addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T>;
|
|
53
53
|
addColumnDate(property: string, displayFormat?: string): ColumnDescriptor<Date, T>;
|
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
import { MessageService } from 'primeng/api';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { MediusQueryParam } from '../api/models';
|
|
2
4
|
import { IDataProvider } from '../data-providers';
|
|
5
|
+
import { ActionDescriptor } from '../descriptors';
|
|
3
6
|
export interface IViewContainer<T, S> {
|
|
4
7
|
getMessageService(): MessageService | undefined;
|
|
5
8
|
getDataProvider(): IDataProvider<T, S> | undefined;
|
|
9
|
+
getActions(): Array<ActionDescriptor<T>>;
|
|
10
|
+
}
|
|
11
|
+
export interface IViewContainerTable<T, S> extends IViewContainer<T, S> {
|
|
12
|
+
getTableReload$(): Observable<ViewContainerTableReloadEvent>;
|
|
13
|
+
reloadTable(event: ViewContainerTableReloadEvent): void;
|
|
14
|
+
}
|
|
15
|
+
export interface IViewContainerEditor<T, S> extends IViewContainer<T, S> {
|
|
16
|
+
getEditorReset$(): Observable<ViewContainerEditorResetEvent<T>>;
|
|
17
|
+
resetEditor(event?: ViewContainerEditorResetEvent<T>): void;
|
|
18
|
+
}
|
|
19
|
+
export interface ViewContainerTableReloadEvent {
|
|
20
|
+
emitEvent?: boolean;
|
|
21
|
+
resetParams?: boolean;
|
|
22
|
+
queryParam?: MediusQueryParam;
|
|
23
|
+
data?: {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface ViewContainerEditorResetEvent<T> {
|
|
28
|
+
emitEvent?: boolean;
|
|
29
|
+
fetch?: boolean;
|
|
30
|
+
item?: T;
|
|
31
|
+
fields?: {
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
};
|
|
34
|
+
data?: {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
};
|
|
6
37
|
}
|
|
@@ -28,7 +28,7 @@ export declare class TableviewRouteBuilder<C extends AMngTableviewRouteComponent
|
|
|
28
28
|
withEdit(hasEdit?: boolean, permissions?: APermissions, path?: string): this;
|
|
29
29
|
withDelete(hasDelete?: boolean, permissions?: APermissions): this;
|
|
30
30
|
withPermissions(read?: APermissions, add?: APermissions, edit?: APermissions, delet?: APermissions, details?: APermissions): this;
|
|
31
|
-
|
|
31
|
+
withPermissionByCategory(key: string, permissions: APermissions): this;
|
|
32
32
|
withPermissionsObject(permissions: {
|
|
33
33
|
[key: string]: APermissions;
|
|
34
34
|
}): this;
|
|
@@ -34,11 +34,4 @@ export declare namespace Permissions {
|
|
|
34
34
|
private constructor();
|
|
35
35
|
static of(service: Type<IPermissionService>): Service;
|
|
36
36
|
}
|
|
37
|
-
class ActionTypes {
|
|
38
|
-
static readonly READ = "read";
|
|
39
|
-
static readonly ADD = "add";
|
|
40
|
-
static readonly EDIT = "edit";
|
|
41
|
-
static readonly DELETE = "delete";
|
|
42
|
-
static readonly DETAILS = "details";
|
|
43
|
-
}
|
|
44
37
|
}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { MessageService } from 'primeng/api';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
2
3
|
import { IDataProvider } from '../data-providers';
|
|
3
4
|
import { ActionDescriptor } from '../descriptors';
|
|
4
|
-
import {
|
|
5
|
+
import { IViewContainerEditor, IViewContainerTable, ViewContainerEditorResetEvent, ViewContainerTableReloadEvent } from '../models';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
/**
|
|
7
8
|
* Should be used with providers defined within component.
|
|
8
9
|
*/
|
|
9
|
-
export declare class MngViewContainerComponentService<T, S> implements
|
|
10
|
+
export declare class MngViewContainerComponentService<T, S> implements IViewContainerTable<T, S>, IViewContainerEditor<T, S> {
|
|
10
11
|
private messageService;
|
|
11
12
|
private _dataProvider?;
|
|
12
|
-
actions
|
|
13
|
-
private
|
|
13
|
+
private actions;
|
|
14
|
+
private _tableReloadSubject;
|
|
15
|
+
private _editorResetSubject;
|
|
14
16
|
constructor(messageService: MessageService);
|
|
15
17
|
set dataProvider(dataProvider: IDataProvider<T, S>);
|
|
16
|
-
get reloadTable(): import("rxjs").Observable<any>;
|
|
17
|
-
triggerTableReload(event: any): void;
|
|
18
18
|
getMessageService(): MessageService;
|
|
19
19
|
getDataProvider(): IDataProvider<T, S> | undefined;
|
|
20
|
+
getActions(): Array<ActionDescriptor<T>>;
|
|
21
|
+
setActions(actions: Array<ActionDescriptor<T>>): void;
|
|
22
|
+
getTableReload$(): Observable<ViewContainerTableReloadEvent>;
|
|
23
|
+
reloadTable(event?: ViewContainerTableReloadEvent): void;
|
|
24
|
+
getEditorReset$(): Observable<ViewContainerEditorResetEvent<T>>;
|
|
25
|
+
resetEditor(event?: ViewContainerEditorResetEvent<T> | undefined): void;
|
|
20
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngViewContainerComponentService<any, any>, never>;
|
|
21
27
|
static ɵprov: i0.ɵɵInjectableDeclaration<MngViewContainerComponentService<any, any>>;
|
|
22
28
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//clear icon
|
|
2
|
+
p-autocomplete.p-autocomplete-clearable {
|
|
3
|
+
& .p-inputtext {
|
|
4
|
+
padding-right: 2rem;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
& .p-autocomplete-clear-icon {
|
|
8
|
+
color: $secondaryButtonTextColor;
|
|
9
|
+
right: 0.5rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
& .p-autocomplete-dd .p-autocomplete-clear-icon {
|
|
13
|
+
color: $secondaryButtonTextColor;
|
|
14
|
+
right: 2.857rem;
|
|
15
|
+
}
|
|
16
|
+
}
|
package/version-info.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediusinc/mng-commons",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"tag": "v0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
|
+
"tag": "v0.16.0",
|
|
5
5
|
"distance": 0,
|
|
6
|
-
"hash": "
|
|
6
|
+
"hash": "c9a14910",
|
|
7
7
|
"dirty": false,
|
|
8
|
-
"semver": "0.
|
|
9
|
-
"raw": "v0.
|
|
8
|
+
"semver": "0.16.0",
|
|
9
|
+
"raw": "v0.16.0-c9a14910"
|
|
10
10
|
}
|