@mediusinc/mng-commons 0.2.15 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/en.json +4 -2
- package/assets/i18n/sl.json +4 -2
- package/esm2020/lib/api/models/filter-param.model.mjs +1 -1
- package/esm2020/lib/api/models/query-param.model.mjs +1 -1
- package/esm2020/lib/api/services/crud-api.abstract.service.mjs +17 -12
- package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +13 -14
- package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +13 -15
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +56 -4
- package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +179 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +23 -8
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +14 -10
- package/esm2020/lib/components/form/formly/fields/index.mjs +2 -1
- package/esm2020/lib/components/form/models/form-editor.event.mjs +28 -1
- package/esm2020/lib/components/layout/main-layout.component.mjs +2 -4
- package/esm2020/lib/components/layout/topbar.component.mjs +2 -4
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +1 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +37 -14
- package/esm2020/lib/components/tableview/tableview.component.mjs +1 -1
- package/esm2020/lib/config/formly.config.mjs +7 -2
- package/esm2020/lib/data-providers/table.data-provider.mjs +17 -2
- package/esm2020/lib/descriptors/editor.descriptor.interface.mjs +2 -0
- package/esm2020/lib/descriptors/editor.descriptor.mjs +77 -19
- package/esm2020/lib/descriptors/table.descriptor.mjs +1 -2
- package/esm2020/lib/directives/component.directive.mjs +8 -3
- package/esm2020/lib/mng-commons.module.mjs +5 -2
- package/esm2020/lib/router/models/router.model.mjs +1 -1
- package/esm2020/lib/router/route-builder.mjs +75 -11
- package/esm2020/lib/services/configuration.service.mjs +3 -3
- package/esm2020/lib/utils/editor-formly.util.mjs +14 -3
- package/fesm2015/mediusinc-mng-commons.mjs +724 -273
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +710 -274
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/models/filter-param.model.d.ts +1 -1
- package/lib/api/models/query-param.model.d.ts +1 -1
- package/lib/api/services/crud-api.abstract.service.d.ts +9 -8
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +3 -2
- package/lib/components/form/dropdown/dropdown.component.d.ts +6 -3
- package/lib/components/form/editor/form-editor.component.d.ts +7 -2
- package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +45 -0
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +2 -0
- package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +1 -0
- package/lib/components/form/formly/fields/index.d.ts +1 -0
- package/lib/components/form/models/form-editor.event.d.ts +32 -0
- package/lib/components/layout/main-layout.component.d.ts +2 -3
- package/lib/components/layout/topbar.component.d.ts +2 -3
- package/lib/components/tableview/table/table.component.d.ts +11 -3
- package/lib/data-providers/table.data-provider.d.ts +9 -1
- package/lib/descriptors/editor.descriptor.d.ts +39 -15
- package/lib/descriptors/editor.descriptor.interface.d.ts +9 -0
- package/lib/directives/component.directive.d.ts +5 -4
- package/lib/mng-commons.module.d.ts +55 -54
- package/lib/router/models/router.model.d.ts +2 -2
- package/lib/router/route-builder.d.ts +18 -4
- package/package.json +1 -1
- package/scss/mng-overrides/_theme_dropdown.scss +17 -0
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import { AttributeDef } from './serialization.model';
|
|
13
12
|
import { MediusFilterMatchType } from './filter-match-type.model';
|
|
13
|
+
import { AttributeDef } from './serialization.model';
|
|
14
14
|
export declare class MediusFilterParam {
|
|
15
15
|
property?: string;
|
|
16
16
|
filterValue?: object;
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import { AttributeDef } from './serialization.model';
|
|
13
12
|
import { MediusFilterParam } from './filter-param.model';
|
|
14
13
|
import { MediusQueryMode } from './query-mode.model';
|
|
14
|
+
import { AttributeDef } from './serialization.model';
|
|
15
15
|
export declare class MediusQueryParam {
|
|
16
16
|
sortProperty?: Array<string>;
|
|
17
17
|
sortAsc?: Array<boolean>;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
1
|
+
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { ClassType } from '../../types';
|
|
4
4
|
import { MediusQueryParam, MediusQueryResult } from '../models';
|
|
5
|
+
import { ObjectSerializer } from '../utils';
|
|
5
6
|
export declare abstract class AMngCrudApiService<T, QRT extends MediusQueryResult<T>> {
|
|
6
7
|
protected type: ClassType<T>;
|
|
7
8
|
protected queryResultType: ClassType<QRT>;
|
|
8
9
|
protected http: HttpClient;
|
|
9
|
-
|
|
10
|
+
protected readonly objectSerializer: ObjectSerializer;
|
|
10
11
|
protected constructor(type: ClassType<T>, queryResultType: ClassType<QRT>, http: HttpClient);
|
|
11
|
-
createPost(item: T): Observable<T>;
|
|
12
|
-
getAllPost(
|
|
13
|
-
getByIdGet(id: any): Observable<T>;
|
|
14
|
-
updatePut(id: any, item: T): Observable<T>;
|
|
15
|
-
removeDelete(id: any, item
|
|
12
|
+
createPost(item: T, params?: HttpParams): Observable<T>;
|
|
13
|
+
getAllPost(queryParamBody?: MediusQueryParam, params?: HttpParams): Observable<QRT>;
|
|
14
|
+
getByIdGet(id: any, params?: HttpParams): Observable<T>;
|
|
15
|
+
updatePut(id: any, item: T, params?: HttpParams): Observable<T>;
|
|
16
|
+
removeDelete(id: any, item?: T, params?: HttpParams): Observable<any>;
|
|
16
17
|
protected abstract getBasePath(): string;
|
|
17
18
|
protected abstract getServiceBasePath(): string;
|
|
18
19
|
protected getGetAllPostPath(): string;
|
|
19
20
|
protected getCreatePostPath(): string;
|
|
20
21
|
protected getUpdatePutPath(id: any, item: T): string;
|
|
21
22
|
protected getGetByIdGetPath(id: any): string;
|
|
22
|
-
protected getRemoveDeletePath(id: any, item
|
|
23
|
+
protected getRemoveDeletePath(id: any, item?: T): string;
|
|
23
24
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EventEmitter, ExistingProvider, Injector, OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, ExistingProvider, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
3
3
|
import { AutoComplete } from 'primeng/autocomplete';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { ILookupDataProvider } from '../../../data-providers';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare const MNG_AUTOCOMPLETE_VALUE_ACCESSOR: ExistingProvider;
|
|
8
|
-
export declare class MngAutocompleteComponent implements OnInit, ControlValueAccessor {
|
|
8
|
+
export declare class MngAutocompleteComponent implements OnInit, OnDestroy, ControlValueAccessor {
|
|
9
9
|
private injector;
|
|
10
10
|
dataProvider?: ILookupDataProvider<any, any>;
|
|
11
11
|
dataKeyProperty?: string;
|
|
@@ -26,6 +26,7 @@ export declare class MngAutocompleteComponent implements OnInit, ControlValueAcc
|
|
|
26
26
|
isLoading: boolean;
|
|
27
27
|
constructor(injector: Injector);
|
|
28
28
|
ngOnInit(): void;
|
|
29
|
+
ngOnDestroy(): void;
|
|
29
30
|
onSearch(event: any): void;
|
|
30
31
|
onSelect(value: any): void;
|
|
31
32
|
registerOnChange(fn: any): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EventEmitter, ExistingProvider, Injector, OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, ExistingProvider, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
3
3
|
import { Dropdown } from 'primeng/dropdown';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { ILookupDataProvider } from '../../../data-providers';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare const MNG_DROPDOWN_VALUE_ACCESSOR: ExistingProvider;
|
|
8
|
-
export declare class MngDropdownComponent implements OnInit, ControlValueAccessor {
|
|
8
|
+
export declare class MngDropdownComponent implements OnInit, OnDestroy, ControlValueAccessor {
|
|
9
9
|
private injector;
|
|
10
10
|
dataProvider?: ILookupDataProvider<any, any>;
|
|
11
11
|
dataKeyProperty?: string;
|
|
@@ -14,6 +14,7 @@ export declare class MngDropdownComponent implements OnInit, ControlValueAccesso
|
|
|
14
14
|
multiselect: boolean;
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
showClear: boolean;
|
|
17
|
+
selectFirstItem: boolean;
|
|
17
18
|
className: string | null;
|
|
18
19
|
dropdownClassName: string | null;
|
|
19
20
|
valueChangeEventEmitter: EventEmitter<any>;
|
|
@@ -24,12 +25,14 @@ export declare class MngDropdownComponent implements OnInit, ControlValueAccesso
|
|
|
24
25
|
private onTouchedFn;
|
|
25
26
|
dropdownFormControl: FormControl;
|
|
26
27
|
items$: Observable<Array<any>>;
|
|
28
|
+
private itemsSubscription?;
|
|
27
29
|
constructor(injector: Injector);
|
|
28
30
|
ngOnInit(): void;
|
|
31
|
+
ngOnDestroy(): void;
|
|
29
32
|
registerOnChange(fn: any): void;
|
|
30
33
|
registerOnTouched(fn: any): void;
|
|
31
34
|
setDisabledState(isDisabled: boolean): void;
|
|
32
35
|
writeValue(obj: any): void;
|
|
33
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngDropdownComponent, never>;
|
|
34
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MngDropdownComponent, "mng-dropdown", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "itemsLabelProperty": "itemsLabelProperty"; "itemsValueProperty": "itemsValueProperty"; "multiselect": "multiselect"; "placeholder": "placeholder"; "showClear": "showClear"; "className": "className"; "dropdownClassName": "dropdownClassName"; }, { "valueChangeEventEmitter": "valueChange"; }, never, 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>;
|
|
35
38
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
2
|
+
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
3
3
|
import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core';
|
|
4
4
|
import { TranslateService } from '@ngx-translate/core';
|
|
5
5
|
import { Message } from 'primeng/api';
|
|
@@ -32,8 +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
|
+
getFormField(key: string): AbstractControl | null;
|
|
36
|
+
setFormFieldValue(key: string, value: any): void;
|
|
37
|
+
patchFormFieldValue(key: string, value: any): void;
|
|
38
|
+
resetFormFieldValue(key: string, value?: any): void;
|
|
39
|
+
private findFormField;
|
|
35
40
|
private isAnyFieldInvalid;
|
|
36
|
-
private
|
|
41
|
+
private resetFormModel;
|
|
37
42
|
private updateFormState;
|
|
38
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngFormEditorComponent<any>, never>;
|
|
39
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>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AfterViewInit, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { FieldType } from '@ngx-formly/core';
|
|
4
|
+
import { Message } from 'primeng/api';
|
|
5
|
+
import { Observable, Subject } from 'rxjs';
|
|
6
|
+
import { MediusQueryResult } from '../../../../../api/models';
|
|
7
|
+
import { FieldLookupDescriptor } from '../../../../../descriptors';
|
|
8
|
+
import { FieldLookupConfig } from '../../../../../descriptors/editor.descriptor.interface';
|
|
9
|
+
import { MngTableComponent } from '../../../../tableview';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export declare class MngFormlyFieldLookupDialogComponent<T, ET> extends FieldType implements OnInit, AfterViewInit, OnDestroy {
|
|
12
|
+
private injector;
|
|
13
|
+
mngTable?: MngTableComponent<any, any>;
|
|
14
|
+
descriptor: FieldLookupDescriptor<T, ET>;
|
|
15
|
+
config: FieldLookupConfig;
|
|
16
|
+
fieldLabelFormControl: FormControl;
|
|
17
|
+
itemsSubject: Subject<T>;
|
|
18
|
+
itemsAsync: Observable<T>;
|
|
19
|
+
addItemsSubject: Subject<MediusQueryResult<T>>;
|
|
20
|
+
addItemsAsync: Observable<MediusQueryResult<T>>;
|
|
21
|
+
dialogUseDataProvider: boolean;
|
|
22
|
+
private dialogDataProviderService;
|
|
23
|
+
private dialogIsLoadingSubject;
|
|
24
|
+
isDialogVisible: boolean;
|
|
25
|
+
dialogAreItemsLoaded: boolean;
|
|
26
|
+
dialogSelectedItem: any;
|
|
27
|
+
dialogMessages: Message[];
|
|
28
|
+
dialogIsLoading$: Observable<boolean>;
|
|
29
|
+
private lookupDataProviderSubscription?;
|
|
30
|
+
private subscriptions;
|
|
31
|
+
constructor(injector: Injector);
|
|
32
|
+
ngOnInit(): void;
|
|
33
|
+
ngAfterViewInit(): void;
|
|
34
|
+
ngOnDestroy(): void;
|
|
35
|
+
openSelectDialog(): void;
|
|
36
|
+
onSelectionChange(item: any): void;
|
|
37
|
+
onCaptionCmpInst(instance: any): void;
|
|
38
|
+
onColumnActionCmpInst(instance: any): void;
|
|
39
|
+
clear(): void;
|
|
40
|
+
hideDialog(): void;
|
|
41
|
+
addItem(): void;
|
|
42
|
+
private setFieldLabelValue;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldLookupDialogComponent<any, any>, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldLookupDialogComponent<any, any>, "mng-formly-field-lookup-dialog", never, {}, {}, never, never>;
|
|
45
|
+
}
|
|
@@ -10,6 +10,8 @@ export declare class MngFormlyFieldTableDialogFormComponent<T, ET> extends Field
|
|
|
10
10
|
toolbarActions: Array<ActionDescriptor<T>>;
|
|
11
11
|
rowActions: Array<ActionDescriptor<T>>;
|
|
12
12
|
private subscriptions;
|
|
13
|
+
private isDisabledSubject;
|
|
14
|
+
private isEnabled$;
|
|
13
15
|
ngOnInit(): void;
|
|
14
16
|
ngOnDestroy(): void;
|
|
15
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldTableDialogFormComponent<any, any>, never>;
|
|
@@ -22,6 +22,7 @@ export declare class MngFormlyFieldTableDialogMultiselectComponent<T, ET> extend
|
|
|
22
22
|
dialogIsLoading$: Observable<boolean>;
|
|
23
23
|
hasAddAction: boolean;
|
|
24
24
|
hasDeleteAction: boolean;
|
|
25
|
+
private lookupDataProviderSubscription?;
|
|
25
26
|
private subscriptions;
|
|
26
27
|
constructor(injector: Injector);
|
|
27
28
|
ngOnInit(): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './formly-field-autocomplete/formly-field-autocomplete.component';
|
|
2
2
|
export * from './formly-field-input/formly-field-input.component';
|
|
3
3
|
export * from './formly-field-dropdown/formly-field-dropdown.component';
|
|
4
|
+
export * from './formly-field-lookup-dialog/formly-field-lookup-dialog.component';
|
|
4
5
|
export * from './formly-field-table-dialog-form/formly-field-table-dialog-form.component';
|
|
5
6
|
export * from './formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component';
|
|
6
7
|
export * from './formly-field-tabs/formly-field-tabs.component';
|
|
@@ -1,5 +1,37 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
1
2
|
export declare class MngFormEditorSubmitEvent<T> {
|
|
2
3
|
readonly formItem: T;
|
|
3
4
|
success: boolean;
|
|
4
5
|
constructor(formItem: T);
|
|
5
6
|
}
|
|
7
|
+
export declare enum MngFormFieldEventTypeEnum {
|
|
8
|
+
Component = 0,
|
|
9
|
+
ValueChange = 1,
|
|
10
|
+
DataProvider = 2,
|
|
11
|
+
Dialog = 3,
|
|
12
|
+
Other = 4
|
|
13
|
+
}
|
|
14
|
+
export declare class MngFormFieldEventComponentSubtype {
|
|
15
|
+
static readonly ON_INIT = "Component.OnInit";
|
|
16
|
+
static readonly ON_VIEW_INIT = "Component.OnViewInit";
|
|
17
|
+
static readonly ON_CONTENT_INIT = "Component.OnContentInit";
|
|
18
|
+
static readonly ON_DESTROY = "Component.OnDestroy";
|
|
19
|
+
}
|
|
20
|
+
export declare class MngFormFieldEventDialogSubtype {
|
|
21
|
+
static readonly VISIBILITY = "Dialog.Visibility";
|
|
22
|
+
static readonly TABLE_CAPTION_COMPONENT_INSTANCE = "Dialog.MngTable.CaptionComponentInstance";
|
|
23
|
+
static readonly TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = "Dialog.MngTable.ColumnActionsComponentInstance";
|
|
24
|
+
}
|
|
25
|
+
export interface MngFormFieldEventData<T, ET> {
|
|
26
|
+
eventSubtype?: string;
|
|
27
|
+
value?: T;
|
|
28
|
+
formValue?: ET;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
export declare class MngFormFieldEvent<T, ET> {
|
|
32
|
+
readonly type: MngFormFieldEventTypeEnum;
|
|
33
|
+
readonly componentType: Type<any>;
|
|
34
|
+
readonly componentInstance: any;
|
|
35
|
+
readonly data: MngFormFieldEventData<T, ET>;
|
|
36
|
+
constructor(type: MngFormFieldEventTypeEnum, componentType: Type<any>, componentInstance: any, data?: MngFormFieldEventData<T, ET>);
|
|
37
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnInit, QueryList, Type } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute } from '@angular/router';
|
|
3
3
|
import { MngTemplateDirective } from '../../directives';
|
|
4
4
|
import { MngCommonsService } from '../../services';
|
|
5
5
|
import { MngMainLayoutComponentService } from './services';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class MngMainLayoutComponent implements OnInit
|
|
7
|
+
export declare class MngMainLayoutComponent implements OnInit {
|
|
8
8
|
private route;
|
|
9
9
|
mngCommons: MngCommonsService;
|
|
10
10
|
mainLayoutService: MngMainLayoutComponentService;
|
|
@@ -14,7 +14,6 @@ export declare class MngMainLayoutComponent implements OnInit, AfterViewInit {
|
|
|
14
14
|
footerComponent: Type<any>;
|
|
15
15
|
constructor(route: ActivatedRoute, mngCommons: MngCommonsService, mainLayoutService: MngMainLayoutComponentService);
|
|
16
16
|
ngOnInit(): void;
|
|
17
|
-
ngAfterViewInit(): void;
|
|
18
17
|
onWindowResize(event: UIEvent): void;
|
|
19
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngMainLayoutComponent, never>;
|
|
20
19
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngMainLayoutComponent, "mng-main-layout", never, {}, {}, never, never>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnInit, QueryList, Type } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute } from '@angular/router';
|
|
3
3
|
import { MngTemplateDirective } from '../../directives';
|
|
4
4
|
import { IUser } from '../../models';
|
|
5
5
|
import { MngCommonsService } from '../../services';
|
|
6
6
|
import { MngMainLayoutComponentService } from './services';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class MngTopbarComponent implements OnInit
|
|
8
|
+
export declare class MngTopbarComponent implements OnInit {
|
|
9
9
|
private route;
|
|
10
10
|
mngCommons: MngCommonsService;
|
|
11
11
|
mainLayoutService: MngMainLayoutComponentService;
|
|
@@ -17,7 +17,6 @@ export declare class MngTopbarComponent implements OnInit, AfterViewInit {
|
|
|
17
17
|
user?: IUser;
|
|
18
18
|
constructor(route: ActivatedRoute, mngCommons: MngCommonsService, mainLayoutService: MngMainLayoutComponentService);
|
|
19
19
|
ngOnInit(): void;
|
|
20
|
-
ngAfterViewInit(): void;
|
|
21
20
|
switchLanguage(language: string): void;
|
|
22
21
|
logout(user: IUser, event: Event): void;
|
|
23
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTopbarComponent, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AfterContentInit, EventEmitter, Injector, OnDestroy, OnInit, QueryList, TemplateRef } from '@angular/core';
|
|
1
|
+
import { AfterContentInit, EventEmitter, Injector, OnDestroy, OnInit, QueryList, TemplateRef, Type } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
4
4
|
import { LazyLoadEvent, SortMeta } from 'primeng/api';
|
|
@@ -8,7 +8,7 @@ import { Observable } from 'rxjs';
|
|
|
8
8
|
import { MediusQueryResult } from '../../../api/models';
|
|
9
9
|
import { ITableDataProvider } from '../../../data-providers';
|
|
10
10
|
import { ColumnDescriptor, TableDescriptor } from '../../../descriptors';
|
|
11
|
-
import { MngTemplateDirective } from '../../../directives';
|
|
11
|
+
import { MngComponentDirective, MngTemplateDirective } from '../../../directives';
|
|
12
12
|
import { MngTableCellClickEvent, MngTableLoadEvent } from '../models';
|
|
13
13
|
import { TableviewComponentService } from '../services';
|
|
14
14
|
import * as i0 from "@angular/core";
|
|
@@ -26,11 +26,17 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
|
|
|
26
26
|
loading?: Observable<boolean> | boolean;
|
|
27
27
|
dataProvider?: ITableDataProvider<T, any>;
|
|
28
28
|
useQueryParams: boolean;
|
|
29
|
+
selectionMode: string;
|
|
29
30
|
selectionEnabled: boolean;
|
|
31
|
+
captionComponent?: Type<any>;
|
|
32
|
+
columnActionComponent?: Type<any>;
|
|
30
33
|
loadEventEmitter: EventEmitter<MngTableLoadEvent>;
|
|
31
34
|
cellClickEventEmitter: EventEmitter<MngTableCellClickEvent<T>>;
|
|
32
35
|
selectionChangeEventEmitter: EventEmitter<T[]>;
|
|
36
|
+
captionCmpInstEventEmitter: EventEmitter<any>;
|
|
37
|
+
columnActionCmpInstEventEmitter: EventEmitter<any>;
|
|
33
38
|
templates: QueryList<MngTemplateDirective>;
|
|
39
|
+
components: QueryList<MngComponentDirective<any>>;
|
|
34
40
|
primeTable: Table;
|
|
35
41
|
captionTemplate?: TemplateRef<any>;
|
|
36
42
|
columnActionTemplate?: TemplateRef<any>;
|
|
@@ -72,10 +78,12 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
|
|
|
72
78
|
onTableFilter(event: any): void;
|
|
73
79
|
onCellClick(col: ColumnDescriptor<any, T>, item: T, idx: number): void;
|
|
74
80
|
onSelectionChange(event: Array<T>): void;
|
|
81
|
+
onCaptionCmpInst<C>(instance: C): void;
|
|
82
|
+
onColumnActionCmpInst<C>(instance: C): void;
|
|
75
83
|
private loadTableWithDataProvider;
|
|
76
84
|
private loadTableFromRouteUpdate;
|
|
77
85
|
private updatePrimeSortAndFilter;
|
|
78
86
|
private getDefaultSortMeta;
|
|
79
87
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTableComponent<any, any>, [null, null, null, null, { optional: true; }]>;
|
|
80
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MngTableComponent<any, any>, "mng-table", never, { "descriptor": "descriptor"; "items": "items"; "queryResult": "queryResult"; "loading": "loading"; "dataProvider": "dataProvider"; "useQueryParams": "useQueryParams"; "selectionEnabled": "selectionEnabled"; }, { "loadEventEmitter": "tableLoad"; "cellClickEventEmitter": "cellClick"; "selectionChangeEventEmitter": "selectionChange"; }, ["templates"], never>;
|
|
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>;
|
|
81
89
|
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
1
2
|
import { Observable } from 'rxjs';
|
|
2
3
|
import { MediusQueryParam, MediusQueryResult } from '../api/models';
|
|
3
|
-
import {
|
|
4
|
+
import { ClassType } from '../types';
|
|
5
|
+
import { DataProvider, IDataProvider } from './base.data-provider';
|
|
4
6
|
export interface ITableDataProvider<T, S> extends IDataProvider<T, S> {
|
|
5
7
|
getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
|
|
6
8
|
}
|
|
9
|
+
export declare class TableDataProvider<T, S> extends DataProvider<T, S> implements ITableDataProvider<T, S> {
|
|
10
|
+
protected _getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
|
|
11
|
+
constructor(modelType: ClassType<T>, serviceType?: Type<S>);
|
|
12
|
+
get getAll(): (queryParam: MediusQueryParam, service?: S | undefined) => Observable<MediusQueryResult<T>>;
|
|
13
|
+
withGetAll(getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>): this;
|
|
14
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
2
|
import { AbstractControl } from '@angular/forms';
|
|
3
3
|
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
4
|
+
import { Observable, Subject } from 'rxjs';
|
|
5
5
|
import { MediusQueryParam, MediusQueryResult } from '../api/models';
|
|
6
|
+
import { MngFormFieldEvent, MngFormFieldEventData, MngFormFieldEventTypeEnum } from '../components/form/models';
|
|
6
7
|
import { ILookupDataProvider, ITableDataProvider } from '../data-providers';
|
|
7
8
|
import { EnumValue } from '../models';
|
|
8
9
|
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
9
10
|
import { FieldValidator, ILookupDescriptor, ModelDescriptor, TableDescriptor, TableviewDescriptor } from './';
|
|
11
|
+
import { FieldConfig, FieldLookupConfig } from './editor.descriptor.interface';
|
|
10
12
|
export declare class EditorDescriptor<T> {
|
|
11
13
|
static readonly defaultGroupName = "_default";
|
|
12
14
|
private readonly _model;
|
|
@@ -41,8 +43,11 @@ export declare class EditorDescriptor<T> {
|
|
|
41
43
|
}
|
|
42
44
|
export declare abstract class AGenericFieldDescriptor<ET> {
|
|
43
45
|
protected readonly _editor: EditorDescriptor<ET>;
|
|
46
|
+
protected _config: FieldConfig;
|
|
44
47
|
protected constructor(editor: EditorDescriptor<ET>);
|
|
45
48
|
get editor(): EditorDescriptor<ET>;
|
|
49
|
+
get config(): FieldConfig;
|
|
50
|
+
withConfig(config: FieldConfig): this;
|
|
46
51
|
}
|
|
47
52
|
export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescriptor<ET> {
|
|
48
53
|
protected readonly _property: string;
|
|
@@ -56,7 +61,10 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
56
61
|
protected _getter?: (item: ET) => T;
|
|
57
62
|
protected _setter?: (item: ET, value: T) => void;
|
|
58
63
|
protected _validators: Array<FieldValidator>;
|
|
59
|
-
protected
|
|
64
|
+
protected _requiredExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
65
|
+
protected _disabledExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
66
|
+
protected _hiddenExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
67
|
+
protected readonly _eventsSubject: Subject<MngFormFieldEvent<T, ET>>;
|
|
60
68
|
protected constructor(editor: EditorDescriptor<ET>, property: string);
|
|
61
69
|
get group(): AFieldGroupDescriptor<ET> | undefined;
|
|
62
70
|
get label(): string | undefined;
|
|
@@ -68,18 +76,23 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
68
76
|
get getter(): ((item: ET) => T) | undefined;
|
|
69
77
|
get setter(): ((item: ET, value: T) => void) | undefined;
|
|
70
78
|
get validators(): FieldValidator[];
|
|
71
|
-
get
|
|
79
|
+
get requiredExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
|
|
80
|
+
get disabledExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
|
|
81
|
+
get hiddenExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
|
|
72
82
|
get property(): string;
|
|
73
83
|
abstract copy(): AFieldDescriptor<T, ET>;
|
|
74
84
|
withLabel(label: string): this;
|
|
75
85
|
withPlaceholder(placeholder: string): this;
|
|
76
|
-
withRequired(required?: boolean): this;
|
|
77
|
-
withDisabled(disabled?: boolean,
|
|
86
|
+
withRequired(required?: boolean, requiredExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
|
|
87
|
+
withDisabled(disabled?: boolean, disabledExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
|
|
88
|
+
withHidden(hiddenExpression: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
|
|
78
89
|
withDefaultValue(defaultValue: T): this;
|
|
79
90
|
withClassName(className: string): this;
|
|
80
91
|
withGetter(getter: (item: ET) => T): this;
|
|
81
92
|
withSetter(setter: (item: ET, value: T) => void): this;
|
|
82
93
|
withValidator(name: string, expression: (control: AbstractControl) => boolean, message?: (err: any, field: FormlyFieldConfig) => string): this;
|
|
94
|
+
nextEvent(type: MngFormFieldEventTypeEnum, cmpType: Type<any>, cmpInstance: any, data?: MngFormFieldEventData<T, ET>): void;
|
|
95
|
+
get events$(): Observable<MngFormFieldEvent<T, ET>>;
|
|
83
96
|
protected copyFieldsTo(obj: AFieldDescriptor<T, ET>): void;
|
|
84
97
|
}
|
|
85
98
|
export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string | number | boolean | Date, ET> {
|
|
@@ -90,6 +103,7 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
90
103
|
private _numberStep?;
|
|
91
104
|
private _numberMinFractionDigits?;
|
|
92
105
|
private _numberMaxFractionDigits?;
|
|
106
|
+
private _numberUseGrouping;
|
|
93
107
|
private _radioOptions;
|
|
94
108
|
private _datePickerFormat?;
|
|
95
109
|
private _datePickerMin?;
|
|
@@ -109,6 +123,7 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
109
123
|
get numberStep(): number | undefined;
|
|
110
124
|
get numberMinFractionDigits(): number | undefined;
|
|
111
125
|
get numberMaxFractionDigits(): number | undefined;
|
|
126
|
+
get numberUseGrouping(): boolean;
|
|
112
127
|
get radioOptions(): EnumValue<string | number | boolean | Date>[];
|
|
113
128
|
get datePickerFormat(): string | undefined;
|
|
114
129
|
get datePickerMin(): Date | undefined;
|
|
@@ -120,9 +135,10 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
120
135
|
get mask(): string | undefined;
|
|
121
136
|
get slotChar(): string | undefined;
|
|
122
137
|
get customComponentName(): string | undefined;
|
|
138
|
+
asHidden(): this;
|
|
123
139
|
asText(minLength?: number, maxLength?: number, pattern?: string | RegExp, isEmail?: boolean): this;
|
|
124
140
|
asTextarea(rows?: number, minLength?: number, maxLength?: number, pattern?: string | RegExp): this;
|
|
125
|
-
asNumber(step?: number, min?: number, max?: number, minFractionDigits?: number, maxFractionDigits?: number): this;
|
|
141
|
+
asNumber(step?: number, min?: number, max?: number, minFractionDigits?: number, maxFractionDigits?: number, numberUseGrouping?: boolean): this;
|
|
126
142
|
asSwitch(): this;
|
|
127
143
|
asRadio(options: Array<string | number>, optionsTitlePath?: string): this;
|
|
128
144
|
asRadioFromEnum(enumType: EnumType, optionsTitlePath?: string | null, values?: Array<EnumConstantType>, nameAsValue?: boolean): this;
|
|
@@ -133,14 +149,15 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
133
149
|
}
|
|
134
150
|
export declare namespace FieldInputDescriptor {
|
|
135
151
|
enum TypeEnum {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
152
|
+
Hidden = 0,
|
|
153
|
+
Text = 1,
|
|
154
|
+
Textarea = 2,
|
|
155
|
+
Number = 3,
|
|
156
|
+
Switch = 4,
|
|
157
|
+
Radio = 5,
|
|
158
|
+
Datepicker = 6,
|
|
159
|
+
Mask = 7,
|
|
160
|
+
Custom = 8
|
|
144
161
|
}
|
|
145
162
|
}
|
|
146
163
|
export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET> implements ILookupDescriptor<T> {
|
|
@@ -150,25 +167,32 @@ export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET
|
|
|
150
167
|
protected _itemsValueProperty?: string;
|
|
151
168
|
protected _dataKeyProperty?: string;
|
|
152
169
|
protected _dataProvider?: ILookupDataProvider<T, any>;
|
|
170
|
+
protected _lookupTableDescriptor?: TableDescriptor<T>;
|
|
171
|
+
protected _lookupTableDataProvider?: ITableDataProvider<T, any>;
|
|
153
172
|
constructor(editor: EditorDescriptor<ET>, property: string, modelType: ClassType<T> | null);
|
|
154
173
|
get lookupType(): FieldLookupDescriptor.LookupTypeEnum;
|
|
155
174
|
get itemsLabelProperty(): string | undefined;
|
|
156
175
|
get itemsValueProperty(): string | undefined;
|
|
157
176
|
get dataKeyProperty(): string | undefined;
|
|
158
177
|
get dataProvider(): ILookupDataProvider<T, any> | undefined;
|
|
178
|
+
get lookupTableDataProvider(): ITableDataProvider<T, any> | undefined;
|
|
159
179
|
get modelType(): ClassType<T> | null;
|
|
180
|
+
get lookupTableDescriptor(): TableDescriptor<T> | undefined;
|
|
160
181
|
withItemsLabelProperty(itemsLabelProperty: string): this;
|
|
161
182
|
withItemsValueProperty(itemsValueProperty: string): this;
|
|
162
183
|
withDataKeyProperty(property: string): this;
|
|
163
184
|
withLookup<S>(lookup: (queryParam?: MediusQueryParam, service?: S, search?: string) => Observable<Array<T>>, serviceType?: Type<S>): this;
|
|
164
185
|
withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this;
|
|
186
|
+
withConfig(config: FieldLookupConfig): this;
|
|
165
187
|
asAutocomplete(): this;
|
|
188
|
+
asDialog(lookupTableDescriptor: TableDescriptor<T>, tableDataProvider?: ITableDataProvider<T, any>): this;
|
|
166
189
|
copy(): FieldLookupDescriptor<T, ET>;
|
|
167
190
|
}
|
|
168
191
|
export declare namespace FieldLookupDescriptor {
|
|
169
192
|
enum LookupTypeEnum {
|
|
170
193
|
Dropdown = 0,
|
|
171
|
-
Autocomplete = 1
|
|
194
|
+
Autocomplete = 1,
|
|
195
|
+
Dialog = 2
|
|
172
196
|
}
|
|
173
197
|
}
|
|
174
198
|
export declare class FieldLookupEnumDescriptor<ET> extends FieldLookupDescriptor<EnumValue<string | number>, ET> {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ComponentRef, OnInit, Type, ViewContainerRef } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class MngComponentDirective<
|
|
3
|
+
export declare class MngComponentDirective<C> implements OnInit {
|
|
4
4
|
viewContainerRef: ViewContainerRef;
|
|
5
|
-
component: Type<
|
|
6
|
-
|
|
5
|
+
component: Type<C>;
|
|
6
|
+
private componentInstanceEventEmitter;
|
|
7
|
+
componentRef: ComponentRef<C>;
|
|
7
8
|
constructor(viewContainerRef: ViewContainerRef);
|
|
8
9
|
ngOnInit(): void;
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngComponentDirective<any>, never>;
|
|
10
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MngComponentDirective<any>, "[mngComponent]", never, { "component": "mngComponent"; }, {}, never>;
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MngComponentDirective<any>, "[mngComponent]", never, { "component": "mngComponent"; }, { "componentInstanceEventEmitter": "instanceCreated"; }, never>;
|
|
11
12
|
}
|