@mediusinc/mng-commons 0.3.1 → 0.4.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/api/models/builders/query-param.builder.mjs +7 -2
- package/esm2020/lib/api/services/api.abstract.service.mjs +21 -10
- package/esm2020/lib/api/utils/object-serializer.util.mjs +7 -1
- package/esm2020/lib/components/action/action.component.mjs +28 -6
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +7 -6
- package/esm2020/lib/components/action/models/action-execution.model.mjs +1 -1
- package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +186 -32
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +1 -1
- 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 +8 -8
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +4 -6
- package/esm2020/lib/components/layout/main-layout.component.mjs +1 -1
- package/esm2020/lib/components/layout/topbar.component.mjs +1 -1
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +17 -5
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +1 -1
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +9 -23
- package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +21 -7
- package/esm2020/lib/components/tableview/table/table.component.mjs +5 -5
- package/esm2020/lib/components/tableview/tableview.component.mjs +3 -3
- package/esm2020/lib/descriptors/action.descriptor.mjs +87 -4
- package/esm2020/lib/descriptors/column.descriptor.mjs +197 -0
- package/esm2020/lib/descriptors/editor.descriptor.mjs +3 -734
- package/esm2020/lib/descriptors/field.descriptor.interface.mjs +2 -0
- package/esm2020/lib/descriptors/field.descriptor.mjs +755 -0
- package/esm2020/lib/descriptors/filter.descriptor.mjs +237 -0
- package/esm2020/lib/descriptors/index.mjs +5 -1
- package/esm2020/lib/descriptors/table.descriptor.mjs +4 -385
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +3 -3
- package/esm2020/lib/directives/component.directive.mjs +18 -2
- package/esm2020/lib/mng-commons.module.mjs +9 -5
- package/esm2020/lib/models/column-value.model.mjs +2 -0
- package/esm2020/lib/models/error.model.mjs +1 -1
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/pipes/index.mjs +3 -2
- package/esm2020/lib/pipes/json-path.pipe.mjs +80 -0
- package/esm2020/lib/pipes/link-formatter.pipe.mjs +39 -0
- package/esm2020/lib/services/action-executor.service.mjs +33 -39
- package/esm2020/lib/utils/index.mjs +2 -2
- package/esm2020/lib/utils/model.util.mjs +16 -15
- package/esm2020/lib/utils/notification.util.mjs +47 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/mediusinc-mng-commons.mjs +1945 -1483
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +1938 -1480
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/models/builders/query-param.builder.d.ts +2 -1
- package/lib/api/services/api.abstract.service.d.ts +10 -5
- package/lib/api/utils/object-serializer.util.d.ts +4 -2
- package/lib/components/action/action.component.d.ts +12 -1
- package/lib/components/action/models/action-execution.model.d.ts +2 -0
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +20 -5
- package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +1 -2
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +5 -1
- package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +1 -0
- package/lib/components/tableview/table/column-value/column-value.component.d.ts +5 -1
- package/lib/descriptors/action.descriptor.d.ts +35 -1
- package/lib/descriptors/column.descriptor.d.ts +66 -0
- package/lib/descriptors/editor.descriptor.d.ts +1 -292
- package/lib/descriptors/field.descriptor.d.ts +301 -0
- package/lib/descriptors/{editor.descriptor.interface.d.ts → field.descriptor.interface.d.ts} +0 -0
- package/lib/descriptors/filter.descriptor.d.ts +108 -0
- package/lib/descriptors/index.d.ts +4 -0
- package/lib/descriptors/table.descriptor.d.ts +5 -159
- package/lib/descriptors/tableview.descriptor.d.ts +4 -2
- package/lib/directives/component.directive.d.ts +5 -1
- package/lib/mng-commons.module.d.ts +70 -69
- package/lib/models/column-value.model.d.ts +4 -0
- package/lib/models/error.model.d.ts +2 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/pipes/index.d.ts +2 -1
- package/lib/pipes/json-path.pipe.d.ts +13 -0
- package/lib/pipes/link-formatter.pipe.d.ts +11 -0
- package/lib/services/action-executor.service.d.ts +5 -3
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/model.util.d.ts +1 -0
- package/lib/utils/{toast.util.d.ts → notification.util.d.ts} +7 -10
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/scss/mng-overrides/_layout_action.scss +7 -0
- package/scss/mng-overrides/_layout_dialog.scss +17 -6
- package/scss/mng-overrides/_mixins.scss +60 -0
- package/scss/mng-overrides/_theme_button.scss +4 -0
- package/scss/theme/default/_mng-variables-theme-dark.scss +2 -3
- package/scss/theme/default/_mng-variables-theme-light.scss +2 -3
- package/scss/theme/default/_mng-variables.scss +12 -0
- package/esm2020/lib/descriptors/editor.descriptor.interface.mjs +0 -2
- package/esm2020/lib/pipes/property-path.pipe.mjs +0 -36
- package/esm2020/lib/utils/toast.util.mjs +0 -44
- package/lib/pipes/property-path.pipe.d.ts +0 -7
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { MediusFilterMatchType, MediusQueryParam } from '../';
|
|
1
|
+
import { MediusFilterMatchType, MediusQueryMode, MediusQueryParam } from '../';
|
|
2
2
|
export declare class MediusQueryParamBuilder {
|
|
3
3
|
private queryParam;
|
|
4
4
|
private constructor();
|
|
5
5
|
static create(itemsPerPage?: number, itemsOffset?: number): MediusQueryParamBuilder;
|
|
6
6
|
withItemsPerPage(itemsPerPage: number): MediusQueryParamBuilder;
|
|
7
7
|
withItemsOffset(itemsOffset: number): MediusQueryParamBuilder;
|
|
8
|
+
withQueryMode(queryMode: MediusQueryMode): MediusQueryParamBuilder;
|
|
8
9
|
withSort(property: string, asc?: boolean): MediusQueryParamBuilder;
|
|
9
10
|
withFilter(property: string, value: any, valueTo?: any, matchType?: MediusFilterMatchType, matchCaseSensitive?: boolean): MediusQueryParamBuilder;
|
|
10
11
|
build(): MediusQueryParam;
|
|
@@ -2,18 +2,23 @@ import { HttpClient } from '@angular/common/http';
|
|
|
2
2
|
import { ClassType } from '../../types';
|
|
3
3
|
import { MediusQueryParam } from '../models';
|
|
4
4
|
import { ObjectSerializer } from '../utils';
|
|
5
|
-
export declare abstract class
|
|
6
|
-
protected type: ClassType<T>;
|
|
5
|
+
export declare abstract class AMngBaseApiService {
|
|
7
6
|
protected http: HttpClient;
|
|
8
7
|
protected readonly objectSerializer: ObjectSerializer;
|
|
9
|
-
protected constructor(
|
|
8
|
+
protected constructor(http: HttpClient);
|
|
10
9
|
protected abstract getBasePath(): string;
|
|
11
10
|
protected abstract getServiceBasePath(): string;
|
|
12
11
|
protected getUrl(...pathSegments: Array<string>): string;
|
|
13
|
-
protected deserialize(item: any): T;
|
|
14
|
-
protected serialize(item: T): any;
|
|
15
12
|
protected serializeQueryParam(queryParam: MediusQueryParam, type?: string): any;
|
|
16
13
|
protected deserializeQueryResult<QR>(item: any, qrType: ClassType<QR>): QR;
|
|
17
14
|
protected deserializeClass<C>(item: any, type: ClassType<C>): C;
|
|
15
|
+
protected deserializeClassArray<C>(item: any, type: ClassType<C>): Array<C>;
|
|
18
16
|
protected serializeClass<C>(item: C, type: ClassType<C>): any;
|
|
17
|
+
protected serializeClassArray<C>(item: Array<C>, type: ClassType<C>): any;
|
|
18
|
+
}
|
|
19
|
+
export declare abstract class AMngApiService<T> extends AMngBaseApiService {
|
|
20
|
+
protected type: ClassType<T>;
|
|
21
|
+
protected constructor(type: ClassType<T>, http: HttpClient);
|
|
22
|
+
protected deserialize(item: any): T;
|
|
23
|
+
protected serialize(item: T): any;
|
|
19
24
|
}
|
|
@@ -24,8 +24,10 @@ export declare class ObjectSerializer {
|
|
|
24
24
|
registerEnums(enums: SerializableTypeMap): void;
|
|
25
25
|
registerEnum(enumType: any, enumName: string): void;
|
|
26
26
|
findCorrectType(data: any, expectedType: string): any;
|
|
27
|
-
serializeClass<T>(data:
|
|
27
|
+
serializeClass<T>(data: T, type: ClassType<T>): any;
|
|
28
|
+
serializeClassArray<T>(data: Array<T>, type: ClassType<T>): any;
|
|
28
29
|
serialize(data: any, type: string): any;
|
|
29
|
-
deserializeClass<T>(data: any, type: ClassType<T>):
|
|
30
|
+
deserializeClass<T>(data: any, type: ClassType<T>): T;
|
|
31
|
+
deserializeClassArray<T>(data: any, type: ClassType<T>): Array<T>;
|
|
30
32
|
deserialize(data: any, type: string): any;
|
|
31
33
|
}
|
|
@@ -4,7 +4,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|
|
4
4
|
import { ConfirmationService } from 'primeng/api';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
import { IDataProvider } from '../../data-providers';
|
|
7
|
-
import { ActionDescriptor } from '../../descriptors';
|
|
7
|
+
import { ActionDescriptor, ActionLevelEnum, ActionLinkDescriptor } from '../../descriptors';
|
|
8
8
|
import { IViewContainer } from '../../models';
|
|
9
9
|
import { MngActionExecutorService, MngViewContainerComponentService } from '../../services';
|
|
10
10
|
import { IdType } from '../../types';
|
|
@@ -16,6 +16,15 @@ export declare class MngActionComponent<T, S> implements OnInit, IActionConfirma
|
|
|
16
16
|
private actionExecutor;
|
|
17
17
|
private confirmationService;
|
|
18
18
|
private viewContainerService;
|
|
19
|
+
readonly levelDefault = ActionLevelEnum.Default;
|
|
20
|
+
readonly levelPrimary = ActionLevelEnum.Primary;
|
|
21
|
+
readonly levelSecondary = ActionLevelEnum.Secondary;
|
|
22
|
+
readonly levelInfo = ActionLevelEnum.Info;
|
|
23
|
+
readonly levelHelp = ActionLevelEnum.Help;
|
|
24
|
+
readonly levelSuccess = ActionLevelEnum.Success;
|
|
25
|
+
readonly levelWarning = ActionLevelEnum.Warning;
|
|
26
|
+
readonly levelDanger = ActionLevelEnum.Danger;
|
|
27
|
+
hostClass: string;
|
|
19
28
|
action: ActionDescriptor<T>;
|
|
20
29
|
item?: T;
|
|
21
30
|
itemId?: IdType;
|
|
@@ -33,6 +42,8 @@ export declare class MngActionComponent<T, S> implements OnInit, IActionConfirma
|
|
|
33
42
|
$label: Observable<string | null>;
|
|
34
43
|
$tooltip: Observable<string | null>;
|
|
35
44
|
private viewContainer?;
|
|
45
|
+
actionLink?: ActionLinkDescriptor<T>;
|
|
46
|
+
hasNoTitle: boolean;
|
|
36
47
|
constructor(route: ActivatedRoute, translate: TranslateService, actionExecutor: MngActionExecutorService, confirmationService: ConfirmationService, viewContainerService: MngViewContainerComponentService<T, S> | null);
|
|
37
48
|
ngOnInit(): void;
|
|
38
49
|
triggerAction(event: Event): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Message } from 'primeng/api';
|
|
1
2
|
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import { IDataProvider } from '../../../data-providers';
|
|
@@ -29,6 +30,7 @@ export declare class ActionRunResult<T, S, DP extends IDataProvider<T, S>> {
|
|
|
29
30
|
readonly context?: ActionExecContext<T, S, DP> | undefined;
|
|
30
31
|
readonly result?: T | undefined;
|
|
31
32
|
readonly error?: ActionError | undefined;
|
|
33
|
+
notification?: Message;
|
|
32
34
|
constructor(context?: ActionExecContext<T, S, DP> | undefined, result?: T | undefined, error?: ActionError | undefined);
|
|
33
35
|
}
|
|
34
36
|
export declare class ActionActivationResult<T, S, DP extends IDataProvider<T, S>> {
|
|
@@ -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 { AutoComplete } from 'primeng/autocomplete';
|
|
4
5
|
import { Observable } from 'rxjs';
|
|
5
6
|
import { ILookupDataProvider } from '../../../data-providers';
|
|
@@ -7,32 +8,46 @@ import * as i0 from "@angular/core";
|
|
|
7
8
|
export declare const MNG_AUTOCOMPLETE_VALUE_ACCESSOR: ExistingProvider;
|
|
8
9
|
export declare class MngAutocompleteComponent implements OnInit, OnDestroy, ControlValueAccessor {
|
|
9
10
|
private injector;
|
|
11
|
+
private translate;
|
|
10
12
|
dataProvider?: ILookupDataProvider<any, any>;
|
|
11
13
|
dataKeyProperty?: string;
|
|
12
|
-
|
|
14
|
+
itemsValuePropertyInit?: string;
|
|
15
|
+
itemsLabelPropertyInit?: string;
|
|
16
|
+
itemsLabelTranslate: boolean;
|
|
17
|
+
inlineSearch: boolean;
|
|
18
|
+
openOnFocus: boolean;
|
|
13
19
|
multiselect: boolean;
|
|
14
20
|
placeholder?: string;
|
|
15
21
|
className: string | null;
|
|
16
22
|
dropdownClassName: string | null;
|
|
17
23
|
valueChangeEventEmitter: EventEmitter<any>;
|
|
18
24
|
primeAutocomplete?: AutoComplete;
|
|
25
|
+
private isInited;
|
|
19
26
|
private suggestionsSubject;
|
|
20
27
|
private searchSubscription;
|
|
21
28
|
private dataProviderService;
|
|
22
29
|
private onChangeFn;
|
|
23
30
|
private onTouchedFn;
|
|
31
|
+
itemsLabelProperty?: string;
|
|
32
|
+
itemsValueProperty?: string;
|
|
24
33
|
autocompleteFormControl: FormControl;
|
|
25
34
|
suggestions$: Observable<Array<any>>;
|
|
26
|
-
|
|
27
|
-
constructor(injector: Injector);
|
|
35
|
+
constructor(injector: Injector, translate: TranslateService);
|
|
28
36
|
ngOnInit(): void;
|
|
29
37
|
ngOnDestroy(): void;
|
|
30
38
|
onSearch(event: any): void;
|
|
31
39
|
onSelect(value: any): void;
|
|
40
|
+
onFocus(event: Event): void;
|
|
32
41
|
registerOnChange(fn: any): void;
|
|
33
42
|
registerOnTouched(fn: any): void;
|
|
34
43
|
setDisabledState(isDisabled: boolean): void;
|
|
35
|
-
writeValue(
|
|
44
|
+
writeValue(value: any): void;
|
|
45
|
+
private setItemsAndDataProvider;
|
|
46
|
+
private setAutocompleteValueFromWrite;
|
|
47
|
+
private getLookup;
|
|
48
|
+
private i18nGetItemsKeys;
|
|
49
|
+
private i18nPopulateItems;
|
|
50
|
+
private setSuggestionsFromItems;
|
|
36
51
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngAutocompleteComponent, never>;
|
|
37
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MngAutocompleteComponent, "mng-autocomplete", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "
|
|
52
|
+
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>;
|
|
38
53
|
}
|
|
@@ -4,8 +4,7 @@ import { FieldType } from '@ngx-formly/core';
|
|
|
4
4
|
import { Message } from 'primeng/api';
|
|
5
5
|
import { Observable, Subject } from 'rxjs';
|
|
6
6
|
import { MediusQueryResult } from '../../../../../api/models';
|
|
7
|
-
import { FieldLookupDescriptor } from '../../../../../descriptors';
|
|
8
|
-
import { FieldLookupConfig } from '../../../../../descriptors/editor.descriptor.interface';
|
|
7
|
+
import { FieldLookupConfig, FieldLookupDescriptor } from '../../../../../descriptors';
|
|
9
8
|
import { MngTableComponent } from '../../../../tableview';
|
|
10
9
|
import * as i0 from "@angular/core";
|
|
11
10
|
export declare class MngFormlyFieldLookupDialogComponent<T, ET> extends FieldType implements OnInit, AfterViewInit, OnDestroy {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { ITableviewDataProvider } from '../../../data-providers';
|
|
3
|
-
import { ActionDescriptor, TableviewDescriptor } from '../../../descriptors';
|
|
3
|
+
import { ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, EditorDescriptor, ModelDescriptor, TableviewDescriptor } from '../../../descriptors';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare abstract class AMngTableviewRouteComponent<T, S> implements OnInit {
|
|
6
6
|
descriptor: TableviewDescriptor<T>;
|
|
@@ -10,6 +10,10 @@ export declare abstract class AMngTableviewRouteComponent<T, S> implements OnIni
|
|
|
10
10
|
protected abstract createTableviewDescriptor(): TableviewDescriptor<T>;
|
|
11
11
|
protected abstract createTableviewDataProvider(): ITableviewDataProvider<T, S>;
|
|
12
12
|
protected createActionDescriptors(): Array<ActionDescriptor<T>>;
|
|
13
|
+
protected createActionDescriptorForDetails(descriptor?: EditorDescriptor<T>): ActionEditorDetailsDescriptor<T>;
|
|
14
|
+
protected createActionDescriptorForAdd(descriptor?: EditorDescriptor<T>): ActionEditorAddDescriptor<T>;
|
|
15
|
+
protected createActionDescriptorForEdit(descriptor?: EditorDescriptor<T>): ActionEditorEditDescriptor<T>;
|
|
16
|
+
protected createActionDescriptorForDelete(descriptor?: ModelDescriptor<T>): ActionDeleteDescriptor<T>;
|
|
13
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<AMngTableviewRouteComponent<any, any>, never>;
|
|
14
18
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AMngTableviewRouteComponent<any, any>, never, never, {}, {}, never>;
|
|
15
19
|
}
|
|
@@ -23,6 +23,7 @@ export declare class MngTableColumnFilterComponent<T> implements OnInit {
|
|
|
23
23
|
ngOnInit(): void;
|
|
24
24
|
autocompleteFilter(value: T, filterCallback: Function): void;
|
|
25
25
|
dropdownFilter(value: T, filterCallback: Function): void;
|
|
26
|
+
toLookupFilterValue(value?: any): any;
|
|
26
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTableColumnFilterComponent<any>, never>;
|
|
27
28
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngTableColumnFilterComponent<any>, "mng-table-column-filter", never, { "descriptor": "descriptor"; "display": "display"; }, {}, never, never>;
|
|
28
29
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
1
2
|
import { ColumnDescriptor } from '../../../../descriptors';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class MngTableColumnValueComponent<T, TT> {
|
|
4
|
+
export declare class MngTableColumnValueComponent<T, TT> implements OnInit {
|
|
4
5
|
readonly columnTypeString: ColumnDescriptor.TypeEnum;
|
|
5
6
|
readonly columnTypeNumber: ColumnDescriptor.TypeEnum;
|
|
6
7
|
readonly columnTypeBoolean: ColumnDescriptor.TypeEnum;
|
|
7
8
|
readonly columnTypeDate: ColumnDescriptor.TypeEnum;
|
|
8
9
|
readonly columnTypeEnum: ColumnDescriptor.TypeEnum;
|
|
10
|
+
readonly columnTypeCustom: ColumnDescriptor.TypeEnum;
|
|
9
11
|
descriptor: ColumnDescriptor<T, TT>;
|
|
10
12
|
item: any;
|
|
13
|
+
jsonPath: string;
|
|
14
|
+
ngOnInit(): void;
|
|
11
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTableColumnValueComponent<any, any>, never>;
|
|
12
16
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngTableColumnValueComponent<any, any>, "mng-table-column-value", never, { "descriptor": "descriptor"; "item": "item"; }, {}, never, never>;
|
|
13
17
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
+
import { Params, QueryParamsHandling } from '@angular/router';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import { ActionExecContext } from '../components/action/models';
|
|
4
5
|
import { IDataProvider, IEditorDataProvider } from '../data-providers';
|
|
@@ -18,9 +19,12 @@ export declare class ActionDescriptor<T> {
|
|
|
18
19
|
protected _routeUrl: string | null;
|
|
19
20
|
protected _title?: string | null;
|
|
20
21
|
protected _icon?: string | null;
|
|
22
|
+
protected _tooltip?: string | null;
|
|
21
23
|
protected _className: string;
|
|
22
24
|
protected _size: ActionDescriptor.SizeEnum;
|
|
23
|
-
protected
|
|
25
|
+
protected _isStyleText: boolean;
|
|
26
|
+
protected _isStyleOutlined: boolean;
|
|
27
|
+
protected _isStyleRaised: boolean;
|
|
24
28
|
protected _dataProvider?: IDataProvider<T, any>;
|
|
25
29
|
protected _runFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T | undefined>;
|
|
26
30
|
protected _isVisibleFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>;
|
|
@@ -57,6 +61,9 @@ export declare class ActionDescriptor<T> {
|
|
|
57
61
|
get isEnabledFunction(): ((ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>) | undefined;
|
|
58
62
|
get actionName(): string;
|
|
59
63
|
get className(): string;
|
|
64
|
+
get isStyleText(): boolean;
|
|
65
|
+
get isStyleOutlined(): boolean;
|
|
66
|
+
get isStyleRaised(): boolean;
|
|
60
67
|
get size(): ActionDescriptor.SizeEnum;
|
|
61
68
|
get isSizeExtraSmall(): boolean;
|
|
62
69
|
get isSizeSmall(): boolean;
|
|
@@ -94,6 +101,7 @@ export declare class ActionDescriptor<T> {
|
|
|
94
101
|
withTooltip(tooltip: string | null): this;
|
|
95
102
|
withClassName(className: string): this;
|
|
96
103
|
withSize(size?: ActionDescriptor.SizeEnum): this;
|
|
104
|
+
withStyle(styleText?: boolean, styleOutlined?: boolean, styleRaised?: boolean): this;
|
|
97
105
|
withPosition(position: ActionPositionEnum): this;
|
|
98
106
|
withRunConfirmation(icon?: string, title?: string, message?: string, acceptTitle?: string, rejectTitle?: string): this;
|
|
99
107
|
withRunNotificationSuccess(title?: string, message?: string, hasNotification?: boolean): void;
|
|
@@ -115,6 +123,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
115
123
|
protected _hasFetchNotificationSuccess: boolean;
|
|
116
124
|
protected _fetchNotificationSuccessTitle?: string;
|
|
117
125
|
protected _fetchNotificationSuccessMessage?: string;
|
|
126
|
+
protected _dialogClassName: string;
|
|
118
127
|
protected _dataProvider?: IEditorDataProvider<T, any>;
|
|
119
128
|
protected _fetchFunction?: (ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>;
|
|
120
129
|
protected _submitFunction?: (ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>;
|
|
@@ -122,6 +131,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
122
131
|
constructor(editorDescriptor: EditorDescriptor<T>, actionName: string, parentType?: ClassType<any>, parentProperty?: string);
|
|
123
132
|
get editorTitle(): string | null | undefined;
|
|
124
133
|
get editorDescriptor(): EditorDescriptor<T>;
|
|
134
|
+
get dialogClassName(): string;
|
|
125
135
|
get hasFetchNotificationSuccess(): boolean;
|
|
126
136
|
get fetchNotificationSuccessTitle(): string | undefined;
|
|
127
137
|
get fetchNotificationSuccessMessage(): string | undefined;
|
|
@@ -134,6 +144,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
134
144
|
withEditorTitle(title: string | null): this;
|
|
135
145
|
withDataProvider(dataProvider: IEditorDataProvider<T, any>): this;
|
|
136
146
|
withServiceType<S>(serviceType: Type<S>): this;
|
|
147
|
+
withDialogClassName(className: string): this;
|
|
137
148
|
withRunFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<T>): this;
|
|
138
149
|
withFetchFunction<S>(fn: (ctx: ActionExecContext<T, S, IEditorDataProvider<T, S>>) => Observable<T>): this;
|
|
139
150
|
withSubmitFunction<S>(fn: (ctx: ActionExecContext<T, S, IEditorDataProvider<T, S>>) => Observable<T>): this;
|
|
@@ -174,6 +185,29 @@ export declare class ActionDeleteDescriptor<T> extends ActionDescriptor<T> {
|
|
|
174
185
|
withServiceType<S>(serviceType: Type<S>): this;
|
|
175
186
|
withServiceDeleteFunction<S>(serviceType: Type<S>, deleteFn?: (id: IdType, item?: T, service?: S) => Observable<T>): this;
|
|
176
187
|
}
|
|
188
|
+
export declare class ActionLinkDescriptor<T> extends ActionDescriptor<T> {
|
|
189
|
+
private _url;
|
|
190
|
+
private _pathSegments;
|
|
191
|
+
private _queryParams?;
|
|
192
|
+
private _queryParamsHandling?;
|
|
193
|
+
private _replaceUrl;
|
|
194
|
+
private _target;
|
|
195
|
+
private _isStyleLink;
|
|
196
|
+
constructor(model: ModelDescriptor<T>);
|
|
197
|
+
get url(): string;
|
|
198
|
+
get pathSegments(): string[];
|
|
199
|
+
get queryParams(): Params | undefined;
|
|
200
|
+
get queryParamsHandling(): QueryParamsHandling | undefined;
|
|
201
|
+
get replaceUrl(): boolean;
|
|
202
|
+
get target(): string;
|
|
203
|
+
get isStyleLink(): boolean;
|
|
204
|
+
withHref(url: string): this;
|
|
205
|
+
withRouterLink(...pathSegments: string[]): this;
|
|
206
|
+
withQueryParams(queryParams: Params, queryParamsHandling?: QueryParamsHandling): this;
|
|
207
|
+
withReplaceUrl(replaceUrl?: boolean): this;
|
|
208
|
+
withTarget(target?: '_self' | '_blank'): this;
|
|
209
|
+
withStyleLink(isStyleLink: boolean): this;
|
|
210
|
+
}
|
|
177
211
|
export declare enum ActionPositionEnum {
|
|
178
212
|
ToolbarLeft = 0,
|
|
179
213
|
ToolbarRight = 1,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { IColumnValueComponent } from '../models';
|
|
3
|
+
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
4
|
+
import { FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor } from './filter.descriptor';
|
|
5
|
+
import { TableDescriptor } from './table.descriptor';
|
|
6
|
+
export declare class ColumnDescriptor<T, TT> {
|
|
7
|
+
private readonly _table;
|
|
8
|
+
private readonly _property;
|
|
9
|
+
private _columnType;
|
|
10
|
+
private _title?;
|
|
11
|
+
private _jsonPath?;
|
|
12
|
+
private _isSortEnabled;
|
|
13
|
+
private _filterDescriptor?;
|
|
14
|
+
private _displayFormat?;
|
|
15
|
+
private _enumType?;
|
|
16
|
+
private _enumTitlePath?;
|
|
17
|
+
private _enumNameAsValue;
|
|
18
|
+
private _booleanAsIcon;
|
|
19
|
+
private _booleanYes?;
|
|
20
|
+
private _booleanNo?;
|
|
21
|
+
private _objectModelType?;
|
|
22
|
+
private _objectTitleProperty?;
|
|
23
|
+
private _customComponentType?;
|
|
24
|
+
constructor(table: TableDescriptor<TT>, property: string);
|
|
25
|
+
get columnType(): ColumnDescriptor.TypeEnum;
|
|
26
|
+
get title(): string | undefined;
|
|
27
|
+
get jsonPath(): string | undefined;
|
|
28
|
+
get isSortEnabled(): boolean;
|
|
29
|
+
get filterDescriptor(): FilterDescriptor<T> | undefined;
|
|
30
|
+
get displayFormat(): string | undefined;
|
|
31
|
+
get table(): TableDescriptor<TT>;
|
|
32
|
+
get property(): string;
|
|
33
|
+
get enumType(): EnumType | undefined;
|
|
34
|
+
get enumTitlePath(): string | null | undefined;
|
|
35
|
+
get enumNameAsValue(): boolean;
|
|
36
|
+
get booleanAsIcon(): boolean;
|
|
37
|
+
get booleanYes(): string | undefined;
|
|
38
|
+
get booleanNo(): string | undefined;
|
|
39
|
+
get objectModelType(): ClassType<any> | undefined;
|
|
40
|
+
get objectTitleProperty(): string | undefined;
|
|
41
|
+
get customComponentType(): Type<IColumnValueComponent<TT>> | undefined;
|
|
42
|
+
asType(type?: ColumnDescriptor.TypeEnum): this;
|
|
43
|
+
asNumber(displayFormat?: string): this;
|
|
44
|
+
asDate(displayFormat?: string): this;
|
|
45
|
+
asBoolean(yes?: string, no?: string, asIcon?: boolean): this;
|
|
46
|
+
asEnum(enumType: EnumType, nameAsValue?: boolean, titlePath?: string | null): this;
|
|
47
|
+
asCustomComponent(customComponentType: Type<IColumnValueComponent<TT>>): this;
|
|
48
|
+
withObjectProperty<MT>(modelType: ClassType<MT>, titleProperty?: string): this;
|
|
49
|
+
withTitle(title: string): this;
|
|
50
|
+
withJsonPath(path: string): this;
|
|
51
|
+
withFilter(forceSimple?: boolean): FilterDescriptor<T>;
|
|
52
|
+
withFilterLookup(): FilterLookupDescriptor<T>;
|
|
53
|
+
withFilterLookupEnum(options?: Array<EnumConstantType>): FilterLookupEnumDescriptor;
|
|
54
|
+
withSort(isEnabled?: boolean): this;
|
|
55
|
+
copy(): ColumnDescriptor<T, TT>;
|
|
56
|
+
}
|
|
57
|
+
export declare namespace ColumnDescriptor {
|
|
58
|
+
enum TypeEnum {
|
|
59
|
+
String = 0,
|
|
60
|
+
Number = 1,
|
|
61
|
+
Boolean = 2,
|
|
62
|
+
Date = 3,
|
|
63
|
+
Enum = 4,
|
|
64
|
+
Custom = 5
|
|
65
|
+
}
|
|
66
|
+
}
|