@mediusinc/mng-commons 0.4.6 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/en.json +2 -2
- package/assets/i18n/sl.json +2 -2
- package/esm2020/lib/api/services/api.abstract.service.mjs +15 -4
- package/esm2020/lib/api/services/crud-api.abstract.service.mjs +4 -4
- package/esm2020/lib/components/action/action.component.mjs +54 -10
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +5 -5
- package/esm2020/lib/components/action/models/action-execution.model.mjs +3 -2
- package/esm2020/lib/components/action/route/action-route.component.mjs +3 -3
- package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +3 -3
- 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 +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +28 -4
- package/esm2020/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +14 -5
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +29 -4
- package/esm2020/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.mjs +17 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +11 -7
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +5 -5
- package/esm2020/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/index.mjs +2 -1
- package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +5 -5
- package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +5 -5
- package/esm2020/lib/components/layout/breadcrumb.component.mjs +3 -3
- package/esm2020/lib/components/layout/footer.component.mjs +3 -3
- package/esm2020/lib/components/layout/main-layout.component.mjs +3 -3
- package/esm2020/lib/components/layout/menu-item.component.mjs +3 -3
- package/esm2020/lib/components/layout/menu.component.mjs +3 -3
- package/esm2020/lib/components/layout/services/main-layout.component.service.mjs +3 -3
- package/esm2020/lib/components/layout/topbar.component.mjs +3 -3
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +3 -3
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/table.component.mjs +6 -7
- package/esm2020/lib/components/tableview/tableview.component.mjs +3 -3
- package/esm2020/lib/config/formly.config.mjs +9 -4
- package/esm2020/lib/data-providers/editor.data-provider.mjs +1 -1
- package/esm2020/lib/descriptors/action.descriptor.mjs +39 -20
- package/esm2020/lib/descriptors/editor.descriptor.mjs +3 -3
- package/esm2020/lib/descriptors/field-validation.descriptor.mjs +21 -0
- package/esm2020/lib/descriptors/field.descriptor.mjs +61 -23
- package/esm2020/lib/descriptors/index.mjs +2 -2
- package/esm2020/lib/descriptors/table.descriptor.mjs +23 -13
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +4 -4
- package/esm2020/lib/directives/component.directive.mjs +3 -3
- package/esm2020/lib/directives/template.directive.mjs +3 -3
- package/esm2020/lib/mng-commons.module.mjs +9 -6
- package/esm2020/lib/pipes/boolean.pipe.mjs +3 -3
- package/esm2020/lib/pipes/enum.pipe.mjs +5 -5
- package/esm2020/lib/pipes/i18n-property.pipe.mjs +3 -3
- package/esm2020/lib/pipes/json-path.pipe.mjs +3 -3
- package/esm2020/lib/pipes/link-formatter.pipe.mjs +3 -3
- package/esm2020/lib/services/action-executor.service.mjs +33 -10
- package/esm2020/lib/services/commons.service.mjs +3 -3
- package/esm2020/lib/services/internal/commons-init.service.mjs +3 -3
- package/esm2020/lib/services/navigation.service.mjs +3 -3
- package/esm2020/lib/services/view-container.component.service.mjs +3 -3
- package/esm2020/lib/types/type.model.mjs +1 -1
- package/esm2020/lib/utils/action-data-provider.util.mjs +116 -0
- package/esm2020/lib/utils/editor-formly.util.mjs +35 -15
- package/esm2020/lib/utils/index.mjs +2 -1
- package/fesm2015/mediusinc-mng-commons.mjs +610 -244
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +593 -236
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/services/api.abstract.service.d.ts +1 -1
- package/lib/api/services/crud-api.abstract.service.d.ts +15 -9
- package/lib/components/action/action.component.d.ts +13 -2
- package/lib/components/action/models/action-execution.model.d.ts +5 -3
- package/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +4 -2
- package/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +7 -1
- package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts +4 -2
- package/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.d.ts +6 -0
- package/lib/components/form/formly/fields/index.d.ts +1 -0
- package/lib/components/tableview/table/table.component.d.ts +1 -1
- package/lib/data-providers/editor.data-provider.d.ts +4 -4
- package/lib/descriptors/action.descriptor.d.ts +31 -6
- package/lib/descriptors/editor.descriptor.d.ts +2 -3
- package/lib/descriptors/field-validation.descriptor.d.ts +18 -0
- package/lib/descriptors/field.descriptor.d.ts +34 -21
- package/lib/descriptors/index.d.ts +1 -1
- package/lib/descriptors/table.descriptor.d.ts +5 -1
- package/lib/descriptors/tableview.descriptor.d.ts +2 -2
- package/lib/mng-commons.module.d.ts +58 -57
- package/lib/pipes/enum.pipe.d.ts +2 -1
- package/lib/types/type.model.d.ts +7 -0
- package/lib/utils/action-data-provider.util.d.ts +17 -0
- package/lib/utils/editor-formly.util.d.ts +2 -1
- package/lib/utils/index.d.ts +1 -0
- package/package.json +6 -6
- package/scss/mng-overrides/_layout_dialog.scss +44 -14
- package/scss/mng-overrides/_theme_dialog.scss +2 -3
- package/esm2020/lib/descriptors/field.validator.mjs +0 -21
- package/lib/descriptors/field.validator.d.ts +0 -18
|
@@ -7,7 +7,7 @@ export declare abstract class AMngBaseApiService {
|
|
|
7
7
|
protected readonly objectSerializer: ObjectSerializer;
|
|
8
8
|
protected constructor(http: HttpClient);
|
|
9
9
|
protected abstract getBasePath(): string;
|
|
10
|
-
protected abstract getServiceBasePath(): string;
|
|
10
|
+
protected abstract getServiceBasePath(): string | null;
|
|
11
11
|
protected getUrl(...pathSegments: Array<string>): string;
|
|
12
12
|
protected serializeQueryParam(queryParam: MediusQueryParam, type?: string): any;
|
|
13
13
|
protected deserializeQueryResult<QR>(item: any, qrType: ClassType<QR>): QR;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { ClassType } from '../../types';
|
|
3
|
+
import { ClassType, IdType } from '../../types';
|
|
4
4
|
import { MediusQueryResult } from '../models';
|
|
5
5
|
import { AMngGetAllApiService } from './get-all-api.abstract.service';
|
|
6
|
-
export
|
|
6
|
+
export interface IMngCrudApiService<T> {
|
|
7
|
+
createPost?(item: T, params?: HttpParams): Observable<T>;
|
|
8
|
+
getByIdGet?(id: IdType, params?: HttpParams): Observable<T>;
|
|
9
|
+
updatePut?(id: IdType, item: T, params?: HttpParams): Observable<T>;
|
|
10
|
+
removeDelete?(id: IdType, item?: T, params?: HttpParams): Observable<T | null>;
|
|
11
|
+
}
|
|
12
|
+
export declare abstract class AMngCrudApiService<T, QRT extends MediusQueryResult<any>> extends AMngGetAllApiService<T, QRT> implements IMngCrudApiService<T> {
|
|
7
13
|
protected constructor(type: ClassType<T>, queryResultType: ClassType<QRT>, http: HttpClient);
|
|
8
14
|
createPost(item: T, params?: HttpParams): Observable<T>;
|
|
9
|
-
getByIdGet(id:
|
|
10
|
-
updatePut(id:
|
|
11
|
-
removeDelete(id:
|
|
12
|
-
protected getCreatePostPath(): string;
|
|
13
|
-
protected getUpdatePutPath(id:
|
|
14
|
-
protected getGetByIdGetPath(id:
|
|
15
|
-
protected getRemoveDeletePath(id:
|
|
15
|
+
getByIdGet(id: IdType, params?: HttpParams): Observable<T>;
|
|
16
|
+
updatePut(id: IdType, item: T, params?: HttpParams): Observable<T>;
|
|
17
|
+
removeDelete(id: IdType, item?: T, params?: HttpParams): Observable<T | null>;
|
|
18
|
+
protected getCreatePostPath(item: T): string;
|
|
19
|
+
protected getUpdatePutPath(id: IdType, item: T): string;
|
|
20
|
+
protected getGetByIdGetPath(id: IdType): string;
|
|
21
|
+
protected getRemoveDeletePath(id: IdType, item?: T): string;
|
|
16
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter, OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute } from '@angular/router';
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
4
4
|
import { ConfirmationService } from 'primeng/api';
|
|
@@ -10,7 +10,7 @@ import { MngActionExecutorService, MngViewContainerComponentService } from '../.
|
|
|
10
10
|
import { IdType } from '../../types';
|
|
11
11
|
import { ActionData, ActionTriggerResult, IActionConfirmationService } from './models';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
|
-
export declare class MngActionComponent<T, S> implements OnInit, IActionConfirmationService {
|
|
13
|
+
export declare class MngActionComponent<T, S> implements OnInit, OnChanges, OnDestroy, IActionConfirmationService {
|
|
14
14
|
private route;
|
|
15
15
|
private translate;
|
|
16
16
|
private actionExecutor;
|
|
@@ -37,18 +37,29 @@ export declare class MngActionComponent<T, S> implements OnInit, IActionConfirma
|
|
|
37
37
|
private loadingSubject;
|
|
38
38
|
$loading: Observable<boolean>;
|
|
39
39
|
cmpId: string;
|
|
40
|
+
private isVisibleSubject;
|
|
41
|
+
private isVisibleSubscription?;
|
|
40
42
|
$isVisible: Observable<boolean>;
|
|
43
|
+
private isEnabledSubject;
|
|
44
|
+
private isEnabledSubscription?;
|
|
41
45
|
$isEnabled: Observable<boolean>;
|
|
46
|
+
private labelSubject;
|
|
47
|
+
private labelSubscription?;
|
|
42
48
|
$label: Observable<string | null>;
|
|
49
|
+
private tooltipSubject;
|
|
50
|
+
private tooltipSubscription?;
|
|
43
51
|
$tooltip: Observable<string | null>;
|
|
44
52
|
private viewContainer?;
|
|
45
53
|
actionLink?: ActionLinkDescriptor<T>;
|
|
46
54
|
hasNoTitle: boolean;
|
|
47
55
|
constructor(route: ActivatedRoute, translate: TranslateService, actionExecutor: MngActionExecutorService, confirmationService: ConfirmationService, viewContainerService: MngViewContainerComponentService<T, S> | null);
|
|
48
56
|
ngOnInit(): void;
|
|
57
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
58
|
+
ngOnDestroy(): void;
|
|
49
59
|
triggerAction(event: Event): void;
|
|
50
60
|
getConfirmationService(): ConfirmationService;
|
|
51
61
|
getConfirmationServiceInstanceKey(action: ActionDescriptor<any>): string;
|
|
62
|
+
private processSubscriptions;
|
|
52
63
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngActionComponent<any, any>, [null, null, null, null, { optional: true; }]>;
|
|
53
64
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngActionComponent<any, any>, "mng-action", never, { "action": "action"; "item": "item"; "itemId": "itemId"; "actionData": "actionData"; "dataProvider": "dataProvider"; "inputDisabled": "disabled"; "inputLoading": "loading"; "viewContainerInit": "viewContainer"; }, { "triggerEventEmitter": "trigger"; }, never, never>;
|
|
54
65
|
}
|
|
@@ -2,9 +2,11 @@ import { Message } from 'primeng/api';
|
|
|
2
2
|
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { IDataProvider } from '../../../data-providers';
|
|
5
|
+
import { ActionDescriptor } from '../../../descriptors';
|
|
5
6
|
import { IViewContainer } from '../../../models';
|
|
6
7
|
import { IdType } from '../../../types';
|
|
7
8
|
export declare class ActionExecContext<T, S, DP extends IDataProvider<T, S>> {
|
|
9
|
+
readonly action: ActionDescriptor<T>;
|
|
8
10
|
readonly dataProvider?: DP | undefined;
|
|
9
11
|
readonly serviceInstance?: S | undefined;
|
|
10
12
|
readonly data?: {
|
|
@@ -14,7 +16,7 @@ export declare class ActionExecContext<T, S, DP extends IDataProvider<T, S>> {
|
|
|
14
16
|
} | undefined;
|
|
15
17
|
readonly sourceComponent: any;
|
|
16
18
|
readonly viewContainer: IViewContainer<T, S> | null;
|
|
17
|
-
constructor(dataProvider?: DP | undefined, serviceInstance?: S | undefined, data?: {
|
|
19
|
+
constructor(action: ActionDescriptor<T>, dataProvider?: DP | undefined, serviceInstance?: S | undefined, data?: {
|
|
18
20
|
item?: T | undefined;
|
|
19
21
|
itemId?: IdType | undefined;
|
|
20
22
|
actionData?: ActionData | undefined;
|
|
@@ -28,10 +30,10 @@ export declare class ActionError {
|
|
|
28
30
|
}
|
|
29
31
|
export declare class ActionRunResult<T, S, DP extends IDataProvider<T, S>> {
|
|
30
32
|
readonly context?: ActionExecContext<T, S, DP> | undefined;
|
|
31
|
-
readonly result?: T | undefined;
|
|
33
|
+
readonly result?: T | null | undefined;
|
|
32
34
|
readonly error?: ActionError | undefined;
|
|
33
35
|
notification?: Message;
|
|
34
|
-
constructor(context?: ActionExecContext<T, S, DP> | undefined, result?: T | undefined, error?: ActionError | undefined);
|
|
36
|
+
constructor(context?: ActionExecContext<T, S, DP> | undefined, result?: T | null | undefined, error?: ActionError | undefined);
|
|
35
37
|
}
|
|
36
38
|
export declare class ActionActivationResult<T, S, DP extends IDataProvider<T, S>> {
|
|
37
39
|
readonly runResult?: ActionRunResult<T, S, DP> | undefined;
|
package/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { FormControl } from '@angular/forms';
|
|
3
3
|
import { FieldType } from '@ngx-formly/core';
|
|
4
4
|
import { FieldLookupDescriptor } from '../../../../../descriptors';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class MngFormlyFieldDropdownComponent<T> extends FieldType implements OnInit {
|
|
6
|
+
export declare class MngFormlyFieldDropdownComponent<T> extends FieldType implements OnInit, OnDestroy {
|
|
7
7
|
dFormControl: FormControl;
|
|
8
8
|
descriptor: FieldLookupDescriptor<T, any>;
|
|
9
|
+
private subscriptions;
|
|
9
10
|
ngOnInit(): void;
|
|
11
|
+
ngOnDestroy(): void;
|
|
10
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldDropdownComponent<any>, never>;
|
|
11
13
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldDropdownComponent<any>, "mng-formly-field-dropdown", never, {}, {}, never, never>;
|
|
12
14
|
}
|
package/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
1
2
|
import { FieldType } from '@ngx-formly/core';
|
|
3
|
+
import { FieldGroupDescriptor } from '../../../../../descriptors';
|
|
2
4
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class MngFormlyFieldFieldsetComponent extends FieldType {
|
|
5
|
+
export declare class MngFormlyFieldFieldsetComponent extends FieldType implements OnInit {
|
|
6
|
+
readonly typeFieldset = FieldGroupDescriptor.TypeEnum.Fieldset;
|
|
7
|
+
readonly typeLogical = FieldGroupDescriptor.TypeEnum.Logical;
|
|
8
|
+
descriptor?: FieldGroupDescriptor<any>;
|
|
9
|
+
ngOnInit(): void;
|
|
4
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldFieldsetComponent, never>;
|
|
5
11
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldFieldsetComponent, "mng-formly-field-fieldset", never, {}, {}, never, never>;
|
|
6
12
|
}
|
package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { FormControl } from '@angular/forms';
|
|
3
3
|
import { FieldType } from '@ngx-formly/core';
|
|
4
4
|
import { FieldInputDescriptor } from '../../../../../descriptors';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class MngFormlyFieldInputComponent extends FieldType implements OnInit {
|
|
6
|
+
export declare class MngFormlyFieldInputComponent extends FieldType implements OnInit, OnDestroy {
|
|
7
7
|
iFormControl: FormControl;
|
|
8
8
|
descriptor: FieldInputDescriptor<any>;
|
|
9
|
+
private subscriptions;
|
|
9
10
|
ngOnInit(): void;
|
|
11
|
+
ngOnDestroy(): void;
|
|
10
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldInputComponent, never>;
|
|
11
13
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldInputComponent, "mng-formly-field-input", never, {}, {}, never, never>;
|
|
12
14
|
}
|
package/lib/components/form/formly/fields/formly-field-label/formly-field-label.component.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class MngFormlyFieldLabelComponent {
|
|
3
|
+
className: string;
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldLabelComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldLabelComponent, "mng-formly-field-label", never, {}, {}, never, never>;
|
|
6
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './formly-field-autocomplete/formly-field-autocomplete.component';
|
|
2
2
|
export * from './formly-field-input/formly-field-input.component';
|
|
3
|
+
export * from './formly-field-label/formly-field-label.component';
|
|
3
4
|
export * from './formly-field-dropdown/formly-field-dropdown.component';
|
|
4
5
|
export * from './formly-field-lookup-dialog/formly-field-lookup-dialog.component';
|
|
5
6
|
export * from './formly-field-table-dialog-form/formly-field-table-dialog-form.component';
|
|
@@ -48,7 +48,7 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
|
|
|
48
48
|
queryResult$?: Observable<MediusQueryResult<T>>;
|
|
49
49
|
loading$?: Observable<boolean>;
|
|
50
50
|
dataProviderInfiniteScrollItems: Array<T>;
|
|
51
|
-
|
|
51
|
+
rowsPerPageOptions: Array<number>;
|
|
52
52
|
rows: number;
|
|
53
53
|
offset: number;
|
|
54
54
|
multiSortMeta: SortMeta[] | null;
|
|
@@ -6,20 +6,20 @@ export interface IEditorDataProvider<T, S> extends IDataProvider<T, S> {
|
|
|
6
6
|
fetch: (id: IdType, service?: S) => Observable<T>;
|
|
7
7
|
create?: (item?: T, service?: S) => Observable<T>;
|
|
8
8
|
update?: (id: IdType, item?: T, service?: S) => Observable<T>;
|
|
9
|
-
delete?: (id: IdType, item?: T, service?: S) => Observable<T>;
|
|
9
|
+
delete?: (id: IdType, item?: T, service?: S) => Observable<T | null>;
|
|
10
10
|
}
|
|
11
11
|
export declare class EditorDataProvider<T, S> extends DataProvider<T, S> implements IEditorDataProvider<T, S> {
|
|
12
12
|
protected _fetch: (id: IdType, service?: S) => Observable<T>;
|
|
13
13
|
protected _create?: (item?: T, service?: S) => Observable<T>;
|
|
14
14
|
protected _update?: (id: IdType, item?: T, service?: S) => Observable<T>;
|
|
15
|
-
protected _delete?: (id: IdType, item?: T, service?: S) => Observable<T>;
|
|
15
|
+
protected _delete?: (id: IdType, item?: T, service?: S) => Observable<T | null>;
|
|
16
16
|
constructor(modelType: ClassType<T>, serviceType?: Type<S>);
|
|
17
17
|
get fetch(): (id: IdType, service?: S | undefined) => Observable<T>;
|
|
18
18
|
get create(): ((item?: T | undefined, service?: S | undefined) => Observable<T>) | undefined;
|
|
19
19
|
get update(): ((id: IdType, item?: T | undefined, service?: S | undefined) => Observable<T>) | undefined;
|
|
20
|
-
get delete(): ((id: IdType, item?: T | undefined, service?: S | undefined) => Observable<T>) | undefined;
|
|
20
|
+
get delete(): ((id: IdType, item?: T | undefined, service?: S | undefined) => Observable<T | null>) | undefined;
|
|
21
21
|
withFetch(fetch: (id: IdType, service?: S) => Observable<T>): this;
|
|
22
22
|
withCreate(create: (item?: T, service?: S) => Observable<T>): this;
|
|
23
23
|
withUpdate(update: (id: IdType, item?: T, service?: S) => Observable<T>): this;
|
|
24
|
-
withDelete(deleteFn: (id: IdType, item?: T, service?: S) => Observable<T>): this;
|
|
24
|
+
withDelete(deleteFn: (id: IdType, item?: T, service?: S) => Observable<T | null>): this;
|
|
25
25
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
2
|
import { Params, QueryParamsHandling } from '@angular/router';
|
|
3
|
+
import { Confirmation } from 'primeng/api';
|
|
3
4
|
import { Observable } from 'rxjs';
|
|
4
5
|
import { ActionExecContext } from '../components/action/models';
|
|
5
6
|
import { IDataProvider, IEditorDataProvider } from '../data-providers';
|
|
@@ -26,7 +27,7 @@ export declare class ActionDescriptor<T> {
|
|
|
26
27
|
protected _isStyleOutlined: boolean;
|
|
27
28
|
protected _isStyleRaised: boolean;
|
|
28
29
|
protected _dataProvider?: IDataProvider<T, any>;
|
|
29
|
-
protected _runFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T | undefined>;
|
|
30
|
+
protected _runFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T | undefined | null>;
|
|
30
31
|
protected _isVisibleFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>;
|
|
31
32
|
protected _isEnabledFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>;
|
|
32
33
|
private _hasRunConfirmation;
|
|
@@ -35,6 +36,7 @@ export declare class ActionDescriptor<T> {
|
|
|
35
36
|
private _runConfirmationMessage?;
|
|
36
37
|
private _runConfirmationAcceptTitle?;
|
|
37
38
|
private _runConfirmationRejectTitle?;
|
|
39
|
+
private _runConfirmationConfigMapFn?;
|
|
38
40
|
protected _hasRunNotificationSuccess: boolean;
|
|
39
41
|
private _runNotificationSuccessTitle?;
|
|
40
42
|
private _runNotificationSuccessMessage?;
|
|
@@ -56,7 +58,7 @@ export declare class ActionDescriptor<T> {
|
|
|
56
58
|
get tooltip(): string | null | undefined;
|
|
57
59
|
get dataProvider(): IDataProvider<T, any> | undefined;
|
|
58
60
|
get hasRunFunction(): boolean;
|
|
59
|
-
get runFunction(): (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T | undefined>;
|
|
61
|
+
get runFunction(): (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T | undefined | null>;
|
|
60
62
|
get isVisibleFunction(): ((ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>) | undefined;
|
|
61
63
|
get isEnabledFunction(): ((ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>) | undefined;
|
|
62
64
|
get actionName(): string;
|
|
@@ -75,6 +77,7 @@ export declare class ActionDescriptor<T> {
|
|
|
75
77
|
get runConfirmationMessage(): string | undefined;
|
|
76
78
|
get runConfirmationAcceptTitle(): string | undefined;
|
|
77
79
|
get runConfirmationRejectTitle(): string | undefined;
|
|
80
|
+
get runConfirmationConfigMapFn(): ((ctx: ActionExecContext<T, any, IDataProvider<T, any>>, confirmConfig: Confirmation) => Confirmation) | undefined;
|
|
78
81
|
get hasRunNotificationSuccess(): boolean;
|
|
79
82
|
get runNotificationSuccessTitle(): string | undefined;
|
|
80
83
|
get runNotificationSuccessMessage(): string | undefined;
|
|
@@ -83,7 +86,7 @@ export declare class ActionDescriptor<T> {
|
|
|
83
86
|
get runNotificationErrorMessage(): string | undefined;
|
|
84
87
|
withDataProvider(dataProvider: IDataProvider<T, any>): this;
|
|
85
88
|
withServiceType<S>(serviceType: Type<S>): this;
|
|
86
|
-
withRunFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<T | undefined>): this;
|
|
89
|
+
withRunFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<T | undefined | null>): this;
|
|
87
90
|
withIsVisibleFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<boolean>): this;
|
|
88
91
|
withIsEnabledFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<boolean>): this;
|
|
89
92
|
withRouteTrigger(routeUrl: string): this;
|
|
@@ -103,7 +106,17 @@ export declare class ActionDescriptor<T> {
|
|
|
103
106
|
withSize(size?: ActionDescriptor.SizeEnum): this;
|
|
104
107
|
withStyle(styleText?: boolean, styleOutlined?: boolean, styleRaised?: boolean): this;
|
|
105
108
|
withPosition(position: ActionPositionEnum): this;
|
|
106
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Add a confirmation dialogue to the action
|
|
111
|
+
* @param icon the icon to display on the confirmation dialogue
|
|
112
|
+
* @param title the title of the confirmation dialogue
|
|
113
|
+
* @param message the message on the confirmation dialogue
|
|
114
|
+
* @param acceptTitle the title of the accepting button
|
|
115
|
+
* @param rejectTitle the title of the rejecting button
|
|
116
|
+
* @param runConfirmationConfigMapFn function used to generate the confirmation dialogue. **WARNING** changing the *accept* and *reject* methods of the *confirmConfig* parameter
|
|
117
|
+
* may lead to unexpected behaviour
|
|
118
|
+
*/
|
|
119
|
+
withRunConfirmation(icon?: string, title?: string, message?: string, acceptTitle?: string, rejectTitle?: string, runConfirmationConfigMapFn?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>, confirmConfig: Confirmation) => Confirmation): this;
|
|
107
120
|
withRunNotificationSuccess(title?: string, message?: string, hasNotification?: boolean): void;
|
|
108
121
|
withRunNotificationError(title?: string, message?: string, hasNotification?: boolean): void;
|
|
109
122
|
}
|
|
@@ -126,7 +139,8 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
126
139
|
protected _hasFetchNotificationSuccess: boolean;
|
|
127
140
|
protected _fetchNotificationSuccessTitle?: string;
|
|
128
141
|
protected _fetchNotificationSuccessMessage?: string;
|
|
129
|
-
protected
|
|
142
|
+
protected _dialogSize: ActionEditorDescriptor.DialogSizeEnum;
|
|
143
|
+
protected _dialogClassName?: string;
|
|
130
144
|
protected _dataProvider?: IEditorDataProvider<T, any>;
|
|
131
145
|
protected _fetchFunction?: (ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>;
|
|
132
146
|
protected _submitFunction?: (ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>;
|
|
@@ -134,7 +148,8 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
134
148
|
constructor(editorDescriptor: EditorDescriptor<T>, actionName: string, parentType?: ClassType<any>, parentProperty?: string);
|
|
135
149
|
get editorTitle(): string | null | undefined;
|
|
136
150
|
get editorDescriptor(): EditorDescriptor<T>;
|
|
137
|
-
get
|
|
151
|
+
get dialogSize(): ActionEditorDescriptor.DialogSizeEnum;
|
|
152
|
+
get dialogClassName(): string | undefined;
|
|
138
153
|
get hasFetchNotificationSuccess(): boolean;
|
|
139
154
|
get fetchNotificationSuccessTitle(): string | undefined;
|
|
140
155
|
get fetchNotificationSuccessMessage(): string | undefined;
|
|
@@ -147,6 +162,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
147
162
|
withEditorTitle(title: string | null): this;
|
|
148
163
|
withDataProvider(dataProvider: IEditorDataProvider<T, any>): this;
|
|
149
164
|
withServiceType<S>(serviceType: Type<S>): this;
|
|
165
|
+
withDialogSize(size?: ActionEditorDescriptor.DialogSizeEnum): this;
|
|
150
166
|
withDialogClassName(className: string): this;
|
|
151
167
|
withRunFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<T>): this;
|
|
152
168
|
withFetchFunction<S>(fn: (ctx: ActionExecContext<T, S, IEditorDataProvider<T, S>>) => Observable<T>): this;
|
|
@@ -156,6 +172,15 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
156
172
|
withEditorActions(actions: ActionDescriptor<T>[]): this;
|
|
157
173
|
withEditorComponent(editorComponent: Type<any>): this;
|
|
158
174
|
}
|
|
175
|
+
export declare namespace ActionEditorDescriptor {
|
|
176
|
+
enum DialogSizeEnum {
|
|
177
|
+
ExtraSmall = 0,
|
|
178
|
+
Small = 1,
|
|
179
|
+
Normal = 2,
|
|
180
|
+
Large = 3,
|
|
181
|
+
ExtraLarge = 4
|
|
182
|
+
}
|
|
183
|
+
}
|
|
159
184
|
export declare class ActionEditorSubmitDescriptor<T> extends ActionDescriptor<T> {
|
|
160
185
|
private readonly _editorAction;
|
|
161
186
|
private readonly _submitType;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
1
|
+
import { ClassType, EnumConstantType, EnumType, MngFieldValidationMessage, MngFieldValidator } from '../types';
|
|
3
2
|
import { AFieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, ModelDescriptor, TableDescriptor, TableviewDescriptor } from './';
|
|
4
3
|
export declare class EditorDescriptor<T> {
|
|
5
4
|
static readonly defaultGroupName = "_default";
|
|
@@ -28,7 +27,7 @@ export declare class EditorDescriptor<T> {
|
|
|
28
27
|
addFieldManyEditor<FT>(property: string, tableviewDescriptor: TableviewDescriptor<FT>): FieldManyEditorDescriptor<FT, T>;
|
|
29
28
|
addFieldManyToManyEditor<FT>(property: string, mainTableDescriptor: TableDescriptor<FT>, lookupTableDescriptor: TableDescriptor<FT>): FieldManyToManyEditorDescriptor<FT, T>;
|
|
30
29
|
withDisabled(disabled?: boolean): this;
|
|
31
|
-
|
|
30
|
+
addValidation(name: string, validator?: MngFieldValidator, message?: MngFieldValidationMessage): void;
|
|
32
31
|
copy(): EditorDescriptor<T>;
|
|
33
32
|
createFieldGroupDescriptor(fieldGroup: FieldGroupDescriptor<T>): this;
|
|
34
33
|
private createTabGroupDescriptor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { MngFieldValidationMessage, MngFieldValidator } from '../types';
|
|
4
|
+
export declare class FieldValidationDescriptor {
|
|
5
|
+
private readonly _name;
|
|
6
|
+
private readonly _validator?;
|
|
7
|
+
private readonly _message?;
|
|
8
|
+
private readonly _options?;
|
|
9
|
+
constructor(name: string, validator?: MngFieldValidator, message?: string | ((error: any, field: FormlyFieldConfig) => string | Observable<string>), options?: {
|
|
10
|
+
errorPath: string;
|
|
11
|
+
});
|
|
12
|
+
get name(): string;
|
|
13
|
+
get validator(): MngFieldValidator | undefined;
|
|
14
|
+
get message(): MngFieldValidationMessage | undefined;
|
|
15
|
+
get options(): {
|
|
16
|
+
errorPath: string;
|
|
17
|
+
} | undefined;
|
|
18
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
import { AbstractControl } from '@angular/forms';
|
|
3
2
|
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
4
3
|
import { Observable, Subject } from 'rxjs';
|
|
5
4
|
import { MediusQueryParam, MediusQueryResult } from '../api/models';
|
|
6
5
|
import { MngFormFieldEvent, MngFormFieldEventData, MngFormFieldEventTypeEnum } from '../components/form/models';
|
|
7
6
|
import { ILookupDataProvider, ITableDataProvider } from '../data-providers';
|
|
8
7
|
import { EnumValue } from '../models';
|
|
9
|
-
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
10
|
-
import { ActionDescriptor, EditorDescriptor,
|
|
8
|
+
import { ClassType, EnumConstantType, EnumType, MngFieldValidationMessage, MngFieldValidator } from '../types';
|
|
9
|
+
import { ActionDescriptor, EditorDescriptor, FieldValidationDescriptor, ILookupDescriptor, TableDescriptor, TableviewDescriptor } from './';
|
|
11
10
|
import { FieldConfig, FieldLookupConfig } from './field.descriptor.interface';
|
|
12
11
|
export declare abstract class AGenericFieldDescriptor<ET> {
|
|
13
12
|
protected readonly _editor: EditorDescriptor<ET>;
|
|
@@ -20,7 +19,7 @@ export declare abstract class AGenericFieldDescriptor<ET> {
|
|
|
20
19
|
export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescriptor<ET> {
|
|
21
20
|
protected readonly _property: string;
|
|
22
21
|
protected _group?: AFieldGroupDescriptor<ET>;
|
|
23
|
-
protected _label?: string;
|
|
22
|
+
protected _label?: string | null;
|
|
24
23
|
protected _placeholder?: string;
|
|
25
24
|
protected _helpText?: string;
|
|
26
25
|
protected _required: boolean;
|
|
@@ -28,11 +27,12 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
28
27
|
protected _defaultValue?: T;
|
|
29
28
|
protected _getter?: (item: ET) => T;
|
|
30
29
|
protected _setter?: (item: ET, value: T) => void;
|
|
31
|
-
protected
|
|
30
|
+
protected _validations: Array<FieldValidationDescriptor>;
|
|
32
31
|
protected _requiredExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
33
32
|
protected _disabledExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
34
33
|
protected _hiddenExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>;
|
|
35
34
|
protected _className: string;
|
|
35
|
+
protected _fieldClassName?: string;
|
|
36
36
|
protected _labelClassName: string;
|
|
37
37
|
protected _inputClassName: string;
|
|
38
38
|
protected _size: FieldDescriptor.SizeEnum;
|
|
@@ -40,7 +40,7 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
40
40
|
protected constructor(editor: EditorDescriptor<ET>, property: string);
|
|
41
41
|
get property(): string;
|
|
42
42
|
get group(): AFieldGroupDescriptor<ET> | undefined;
|
|
43
|
-
get label(): string | undefined;
|
|
43
|
+
get label(): string | null | undefined;
|
|
44
44
|
get placeholder(): string | undefined;
|
|
45
45
|
get helpText(): string | undefined;
|
|
46
46
|
get required(): boolean;
|
|
@@ -48,18 +48,19 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
48
48
|
get defaultValue(): T | undefined;
|
|
49
49
|
get getter(): ((item: ET) => T) | undefined;
|
|
50
50
|
get setter(): ((item: ET, value: T) => void) | undefined;
|
|
51
|
-
get
|
|
51
|
+
get validations(): FieldValidationDescriptor[];
|
|
52
52
|
get requiredExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
|
|
53
53
|
get disabledExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
|
|
54
54
|
get hiddenExpression(): string | Observable<boolean> | ((model: any, formState?: any, field?: FormlyFieldConfig | undefined) => boolean) | undefined;
|
|
55
55
|
get className(): string;
|
|
56
|
+
get fieldClassName(): string | undefined;
|
|
56
57
|
get labelClassName(): string;
|
|
57
58
|
get inputClassName(): string;
|
|
58
59
|
get size(): FieldDescriptor.SizeEnum;
|
|
59
60
|
get isSizeSmall(): boolean;
|
|
60
61
|
get isSizeLarge(): boolean;
|
|
61
62
|
abstract copy(): AFieldDescriptor<T, ET>;
|
|
62
|
-
withLabel(label: string): this;
|
|
63
|
+
withLabel(label: string | null): this;
|
|
63
64
|
withPlaceholder(placeholder: string): this;
|
|
64
65
|
withHelpText(helpText: string): this;
|
|
65
66
|
withRequired(required?: boolean, requiredExpression?: string | ((model: any, formState?: any, field?: FormlyFieldConfig) => boolean) | Observable<boolean>): this;
|
|
@@ -68,8 +69,8 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
68
69
|
withDefaultValue(defaultValue: T): this;
|
|
69
70
|
withGetter(getter: (item: ET) => T): this;
|
|
70
71
|
withSetter(setter: (item: ET, value: T) => void): this;
|
|
71
|
-
|
|
72
|
-
withClassName(className: string, labelClassName?: string, inputClassName?: string): this;
|
|
72
|
+
withValidation(name: string, validator?: MngFieldValidator, message?: MngFieldValidationMessage): this;
|
|
73
|
+
withClassName(className: string, labelClassName?: string, inputClassName?: string, fieldClassName?: string): this;
|
|
73
74
|
withSize(size?: FieldDescriptor.SizeEnum): this;
|
|
74
75
|
nextEvent(type: MngFormFieldEventTypeEnum, cmpType: Type<any>, cmpInstance: any, data?: MngFormFieldEventData<T, ET>): void;
|
|
75
76
|
get events$(): Observable<MngFormFieldEvent<T, ET>>;
|
|
@@ -123,6 +124,7 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
123
124
|
get slotChar(): string | undefined;
|
|
124
125
|
get customComponentName(): string | undefined;
|
|
125
126
|
asHidden(): this;
|
|
127
|
+
asLabel(): this;
|
|
126
128
|
asText(minLength?: number, maxLength?: number, pattern?: string | RegExp, isEmail?: boolean): this;
|
|
127
129
|
asTextarea(rows?: number, minLength?: number, maxLength?: number, pattern?: string | RegExp): this;
|
|
128
130
|
asNumber(step?: number, min?: number, max?: number, minFractionDigits?: number, maxFractionDigits?: number, numberUseGrouping?: boolean): this;
|
|
@@ -137,14 +139,15 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
137
139
|
export declare namespace FieldInputDescriptor {
|
|
138
140
|
enum TypeEnum {
|
|
139
141
|
Hidden = 0,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
Label = 1,
|
|
143
|
+
Text = 2,
|
|
144
|
+
Textarea = 3,
|
|
145
|
+
Number = 4,
|
|
146
|
+
Switch = 5,
|
|
147
|
+
Radio = 6,
|
|
148
|
+
Datepicker = 7,
|
|
149
|
+
Mask = 8,
|
|
150
|
+
Custom = 9
|
|
148
151
|
}
|
|
149
152
|
}
|
|
150
153
|
export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET> implements ILookupDescriptor<T> {
|
|
@@ -200,6 +203,7 @@ export declare class FieldLookupEnumDescriptor<ET> extends FieldLookupDescriptor
|
|
|
200
203
|
constructor(editor: EditorDescriptor<ET>, property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null);
|
|
201
204
|
get enumType(): EnumType;
|
|
202
205
|
withDisabledOptions(...disabledOptions: Array<EnumConstantType>): this;
|
|
206
|
+
withDefaultValueEnum(defaultValue: EnumConstantType): this;
|
|
203
207
|
asAutocomplete(openOnFocus?: boolean): this;
|
|
204
208
|
copy(): FieldLookupEnumDescriptor<ET>;
|
|
205
209
|
}
|
|
@@ -271,11 +275,11 @@ export declare abstract class AFieldGroupDescriptor<ET> extends AGenericFieldDes
|
|
|
271
275
|
protected readonly _default: boolean;
|
|
272
276
|
protected _title?: string;
|
|
273
277
|
protected _fields: AGenericFieldDescriptor<ET>[];
|
|
274
|
-
protected
|
|
278
|
+
protected _validations: Array<FieldValidationDescriptor>;
|
|
275
279
|
protected constructor(editor: EditorDescriptor<ET>, name: string);
|
|
276
280
|
get title(): string | undefined;
|
|
277
281
|
abstract get fields(): AGenericFieldDescriptor<ET>[];
|
|
278
|
-
get
|
|
282
|
+
get validations(): FieldValidationDescriptor[];
|
|
279
283
|
get baseName(): string;
|
|
280
284
|
get name(): string;
|
|
281
285
|
get default(): boolean;
|
|
@@ -283,7 +287,7 @@ export declare abstract class AFieldGroupDescriptor<ET> extends AGenericFieldDes
|
|
|
283
287
|
abstract addField(field: AGenericFieldDescriptor<ET>): this;
|
|
284
288
|
abstract copy(): AFieldGroupDescriptor<ET>;
|
|
285
289
|
withTitle(title: string): this;
|
|
286
|
-
|
|
290
|
+
withValidation(name: string, validator?: MngFieldValidator, message?: MngFieldValidationMessage): this;
|
|
287
291
|
}
|
|
288
292
|
export declare class FieldTabGroupDescriptor<ET> extends AFieldGroupDescriptor<ET> {
|
|
289
293
|
constructor(editor: EditorDescriptor<ET>, name: string);
|
|
@@ -293,9 +297,18 @@ export declare class FieldTabGroupDescriptor<ET> extends AFieldGroupDescriptor<E
|
|
|
293
297
|
copy(): FieldTabGroupDescriptor<ET>;
|
|
294
298
|
}
|
|
295
299
|
export declare class FieldGroupDescriptor<ET> extends AFieldGroupDescriptor<ET> {
|
|
300
|
+
private _type;
|
|
296
301
|
constructor(editor: EditorDescriptor<ET>, name: string);
|
|
302
|
+
get type(): FieldGroupDescriptor.TypeEnum;
|
|
297
303
|
get fields(): Array<AFieldDescriptor<any, ET>>;
|
|
298
304
|
groupName(): string;
|
|
299
305
|
addField(field: AFieldDescriptor<any, ET>): this;
|
|
306
|
+
asLogical(): this;
|
|
300
307
|
copy(): FieldGroupDescriptor<ET>;
|
|
301
308
|
}
|
|
309
|
+
export declare namespace FieldGroupDescriptor {
|
|
310
|
+
enum TypeEnum {
|
|
311
|
+
Fieldset = 0,
|
|
312
|
+
Logical = 1
|
|
313
|
+
}
|
|
314
|
+
}
|
|
@@ -3,7 +3,7 @@ export * from './column.descriptor';
|
|
|
3
3
|
export * from './editor.descriptor';
|
|
4
4
|
export * from './field.descriptor';
|
|
5
5
|
export * from './field.descriptor.interface';
|
|
6
|
-
export * from './field.
|
|
6
|
+
export * from './field-validation.descriptor';
|
|
7
7
|
export * from './filter.descriptor';
|
|
8
8
|
export * from './lookup.descriptor';
|
|
9
9
|
export * from './model.descriptor';
|
|
@@ -7,6 +7,8 @@ export declare class TableDescriptor<T> {
|
|
|
7
7
|
private readonly _model;
|
|
8
8
|
private _filterDisplay;
|
|
9
9
|
private _paginationMode;
|
|
10
|
+
private _rowsPerPageOptions;
|
|
11
|
+
private _defaultNumRows;
|
|
10
12
|
private _columns;
|
|
11
13
|
private _title?;
|
|
12
14
|
private _hideHeader;
|
|
@@ -19,6 +21,8 @@ export declare class TableDescriptor<T> {
|
|
|
19
21
|
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string);
|
|
20
22
|
get filterDisplay(): TableDescriptor.FilterDisplayEnum;
|
|
21
23
|
get paginationMode(): TableDescriptor.PaginationModeEnum;
|
|
24
|
+
get rowsPerPageOptions(): number[];
|
|
25
|
+
get defaultNumRows(): number;
|
|
22
26
|
get columns(): ColumnDescriptor<any, T>[];
|
|
23
27
|
get title(): string | undefined;
|
|
24
28
|
get hideHeader(): boolean;
|
|
@@ -38,6 +42,7 @@ export declare class TableDescriptor<T> {
|
|
|
38
42
|
addColumnCustomComponent(property: string, customComponentType: Type<IColumnValueComponent<T>>): ColumnDescriptor<any, T>;
|
|
39
43
|
withFilterDisplay(filterDisplayType: TableDescriptor.FilterDisplayEnum): this;
|
|
40
44
|
withPaginationMode(paginationMode: TableDescriptor.PaginationModeEnum): this;
|
|
45
|
+
withRowsPerPage(rows: number, options?: Array<number>): this;
|
|
41
46
|
withTitle(title: string): TableDescriptor<T>;
|
|
42
47
|
withHideHeader(hideHeader?: boolean): this;
|
|
43
48
|
withDataKeyProperty(property: string): TableDescriptor<T>;
|
|
@@ -45,7 +50,6 @@ export declare class TableDescriptor<T> {
|
|
|
45
50
|
withRowHeight(rowHeight: number): TableDescriptor<T>;
|
|
46
51
|
withTableFullHeightOffset(tableFullHeightOffset: number): TableDescriptor<T>;
|
|
47
52
|
copy(): TableDescriptor<T>;
|
|
48
|
-
private setDataKeyFromColumn;
|
|
49
53
|
}
|
|
50
54
|
export declare namespace TableDescriptor {
|
|
51
55
|
enum PaginationModeEnum {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldValidatorFn } from '@ngx-formly/core/lib/models/config';
|
|
3
3
|
import { IColumnValueComponent } from '../models';
|
|
4
4
|
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
5
5
|
import { AFieldDescriptor, ColumnDescriptor, EditorDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, ModelDescriptor, TableDescriptor } from './';
|
|
@@ -22,7 +22,7 @@ export declare class TableviewDescriptor<T> {
|
|
|
22
22
|
withAddDescriptor(descriptor: EditorDescriptor<T>): this;
|
|
23
23
|
withEditDescriptor(descriptor: EditorDescriptor<T>): this;
|
|
24
24
|
withTableTitle(title: string): this;
|
|
25
|
-
withValidator(name: string, expression:
|
|
25
|
+
withValidator(name: string, expression: FieldValidatorFn): this;
|
|
26
26
|
addColumnDescriptor<CT>(column: ColumnDescriptor<CT, T>): TableDescriptor<T>;
|
|
27
27
|
addColumn(property: string): ColumnDescriptor<string, T>;
|
|
28
28
|
addColumnNumber(property: string, displayFormat?: string): ColumnDescriptor<number, T>;
|