@mediusinc/mng-commons 3.0.0-rc.9 → 3.1.0-rc.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/dev-scripts/version-info.js +13 -6
- package/esm2022/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.mjs +22 -4
- package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +4 -4
- package/esm2022/lib/components/form/models/field-action-context.model.mjs +1 -1
- package/esm2022/lib/components/form/models/index.mjs +2 -1
- package/esm2022/lib/components/tableview/table/table.component.mjs +47 -50
- package/esm2022/lib/descriptors/action/action.descriptor.mjs +1 -1
- package/esm2022/lib/descriptors/editor/field.descriptor.mjs +13 -4
- package/esm2022/lib/models/version.model.mjs +1 -1
- package/esm2022/lib/pipes/json-path.pipe.mjs +3 -62
- package/esm2022/lib/services/action-executor.service.mjs +26 -14
- package/esm2022/lib/services/configuration.service.mjs +1 -1
- package/esm2022/lib/services/logger.service.mjs +2 -2
- package/esm2022/lib/services/version.service.mjs +1 -1
- package/esm2022/lib/utils/editor-formly.util.mjs +2 -1
- package/esm2022/lib/utils/object.util.mjs +50 -1
- package/fesm2022/mediusinc-mng-commons.mjs +157 -132
- package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.d.ts +3 -0
- package/lib/components/form/models/field-action-context.model.d.ts +7 -0
- package/lib/components/form/models/index.d.ts +1 -0
- package/lib/components/tableview/table/table.component.d.ts +1 -0
- package/lib/descriptors/action/action.descriptor.d.ts +6 -6
- package/lib/descriptors/editor/field.descriptor.d.ts +7 -5
- package/lib/models/version.model.d.ts +1 -1
- package/lib/pipes/json-path.pipe.d.ts +0 -1
- package/lib/utils/object.util.d.ts +1 -0
- package/package.json +4 -1
- package/scss/common/theme/designer/_components.scss +1 -1
- package/scss/mng-overrides/_theme_dialog.scss +7 -0
- package/scss/mng-overrides/_theme_tableview.scss +3 -0
package/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { FieldType } from '@ngx-formly/core';
|
|
3
3
|
import { FieldActionDescriptor } from '../../../../../descriptors/editor';
|
|
4
|
+
import { FieldActionResultMessage } from '../../../models';
|
|
4
5
|
import { MngFormlyFieldConfig } from '../../models';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class MngFormlyFieldActionComponent<ET> extends FieldType<MngFormlyFieldConfig> implements OnInit {
|
|
7
8
|
descriptor: FieldActionDescriptor<ET>;
|
|
8
9
|
buttonClass: string;
|
|
10
|
+
actionMessage?: FieldActionResultMessage;
|
|
9
11
|
ngOnInit(): void;
|
|
10
12
|
onClick(): void;
|
|
13
|
+
private processResult;
|
|
11
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldActionComponent<any>, never>;
|
|
12
15
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldActionComponent<any>, "mng-formly-field-action", never, {}, {}, never, never, true, never>;
|
|
13
16
|
}
|
|
@@ -15,3 +15,10 @@ export interface FieldActionContext<ET> {
|
|
|
15
15
|
formState: any;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
+
export interface FieldActionResult {
|
|
19
|
+
message?: FieldActionResultMessage;
|
|
20
|
+
}
|
|
21
|
+
export interface FieldActionResultMessage {
|
|
22
|
+
content: string;
|
|
23
|
+
severity?: 'success' | 'warn' | 'error';
|
|
24
|
+
}
|
|
@@ -123,6 +123,7 @@ export declare class MngTableComponent<T, S> implements OnInit, OnChanges, After
|
|
|
123
123
|
onTableColumnResize({ element }: any): void;
|
|
124
124
|
private loadTableWithDataProvider;
|
|
125
125
|
private loadTableFromRouteUpdate;
|
|
126
|
+
private setMainAndRelatedDescriptors;
|
|
126
127
|
private updatePrimeSortAndFilter;
|
|
127
128
|
private createFilterMeta;
|
|
128
129
|
private createSortMeta;
|
|
@@ -37,8 +37,8 @@ export declare class ActionDescriptor<T> {
|
|
|
37
37
|
protected _hasRunNotificationError: boolean;
|
|
38
38
|
protected _runNotificationErrorTitle?: string;
|
|
39
39
|
protected _runNotificationErrorMessage?: string;
|
|
40
|
-
protected _afterRunAction?: ActionDescriptor<unknown
|
|
41
|
-
protected _onRunErrorAction?: ActionDescriptor<T
|
|
40
|
+
protected _afterRunAction?: ActionDescriptor<unknown> | ((ctx: ActionContext<T, any>) => ActionDescriptor<unknown>);
|
|
41
|
+
protected _onRunErrorAction?: ActionDescriptor<T> | ((ctx: ActionContext<T, any>) => ActionDescriptor<T>);
|
|
42
42
|
protected _permissions?: APermissions;
|
|
43
43
|
protected _button: ActionButtonDescriptor;
|
|
44
44
|
protected _hasItemsSelection: boolean;
|
|
@@ -71,8 +71,8 @@ export declare class ActionDescriptor<T> {
|
|
|
71
71
|
get hasRunNotificationError(): boolean;
|
|
72
72
|
get runNotificationErrorTitle(): string | undefined;
|
|
73
73
|
get runNotificationErrorMessage(): string | undefined;
|
|
74
|
-
get afterRunAction(): ActionDescriptor<unknown> | undefined;
|
|
75
|
-
get onRunErrorAction(): ActionDescriptor<T> | undefined;
|
|
74
|
+
get afterRunAction(): ActionDescriptor<unknown> | ((ctx: ActionContext<T, any>) => ActionDescriptor<unknown>) | undefined;
|
|
75
|
+
get onRunErrorAction(): ActionDescriptor<T> | ((ctx: ActionContext<T, any>) => ActionDescriptor<T>) | undefined;
|
|
76
76
|
get permissions(): APermissions | undefined;
|
|
77
77
|
get tableviewCategory(): string | undefined;
|
|
78
78
|
get hasItemsSelection(): boolean;
|
|
@@ -100,8 +100,8 @@ export declare class ActionDescriptor<T> {
|
|
|
100
100
|
withRunConfirmationDescriptor(runConfirmationDialogDescriptor: ActionConfirmationDialogDescriptor<T>): this;
|
|
101
101
|
withRunNotificationSuccess(title?: string, message?: string, hasNotification?: boolean): this;
|
|
102
102
|
withRunNotificationError(title?: string, message?: string, hasNotification?: boolean): this;
|
|
103
|
-
withAfterRunAction<RT>(action: ActionDescriptor<RT>): this;
|
|
104
|
-
withOnRunErrorAction(action: ActionDescriptor<T>): this;
|
|
103
|
+
withAfterRunAction<RT, S = any>(action: ActionDescriptor<RT> | ((ctx: ActionContext<T, S>) => ActionDescriptor<RT>)): this;
|
|
104
|
+
withOnRunErrorAction<S = any>(action: ActionDescriptor<T> | ((ctx: ActionContext<T, S>) => ActionDescriptor<T>)): this;
|
|
105
105
|
withPermissions(permissions: APermissions): this;
|
|
106
106
|
withTableviewCategory(permissionsRouteType: string): this;
|
|
107
107
|
withButtonDescriptor(button: ActionButtonDescriptor): this;
|
|
@@ -5,8 +5,7 @@ import { Observable, Subject } from 'rxjs';
|
|
|
5
5
|
import { MediusQueryParam, MediusQueryResult } from '../../api/models';
|
|
6
6
|
import { AMngFormlyCustomFieldComponent } from '../../components/form/formly/fields/';
|
|
7
7
|
import { MngFormlyFieldConfig, MngFormlyHookFn } from '../../components/form/formly/models';
|
|
8
|
-
import { MngFormFieldEvent, MngFormFieldEventData, MngFormFieldEventTypeEnum } from '../../components/form/models';
|
|
9
|
-
import { FieldActionContext } from '../../components/form/models/field-action-context.model';
|
|
8
|
+
import { FieldActionContext, FieldActionResult, MngFormFieldEvent, MngFormFieldEventData, MngFormFieldEventTypeEnum } from '../../components/form/models';
|
|
10
9
|
import { ILookupDataProvider, ITableDataProvider } from '../../data-providers';
|
|
11
10
|
import { EnumValue } from '../../models';
|
|
12
11
|
import { StyleLevelEnum } from '../../styles/models';
|
|
@@ -216,7 +215,7 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
216
215
|
asFile(multiple?: boolean, maxFileSize?: number, accept?: string): this;
|
|
217
216
|
asImageFile(multiple?: boolean, maxFileSize?: number, accept?: string): this;
|
|
218
217
|
asImageUrl(multiple?: boolean, preview?: boolean, inputVisibleOnDisabled?: boolean): this;
|
|
219
|
-
asCustomComponent(customComponent: string | Type<AMngFormlyCustomFieldComponent>,
|
|
218
|
+
asCustomComponent(customComponent: string | Type<AMngFormlyCustomFieldComponent>, wrappers?: string[], componentInputs?: Record<string, any>): this;
|
|
220
219
|
withNumberValidation(min?: number, max?: number, step?: number, autoCorrect?: boolean): this;
|
|
221
220
|
withLocale(locale: string): this;
|
|
222
221
|
withNumberFractions(min?: number, max?: number): this;
|
|
@@ -230,13 +229,16 @@ export declare class FieldActionDescriptor<ET> extends AFieldDescriptor<void, ET
|
|
|
230
229
|
protected readonly _fieldActionName: string;
|
|
231
230
|
protected readonly _fieldActionNameLong: string;
|
|
232
231
|
protected _button: ActionButtonDescriptor;
|
|
233
|
-
protected _runFunction?: (ctx: FieldActionContext<ET>) => void
|
|
232
|
+
protected _runFunction?: (ctx: FieldActionContext<ET>) => void | FieldActionResult | Observable<FieldActionResult>;
|
|
233
|
+
private _wrappers;
|
|
234
234
|
constructor(editor: EditorDescriptor<ET>, property: string);
|
|
235
235
|
get button(): ActionButtonDescriptor;
|
|
236
|
-
get runFunction(): ((ctx: FieldActionContext<ET>) => void) | undefined;
|
|
236
|
+
get runFunction(): ((ctx: FieldActionContext<ET>) => void | FieldActionResult | Observable<FieldActionResult>) | undefined;
|
|
237
|
+
get wrappers(): string[];
|
|
237
238
|
withButtonDescriptor(button: ActionButtonDescriptor): this;
|
|
238
239
|
withButton(label?: string | null, icon?: string | null, styleLevel?: StyleLevelEnum, styleText?: boolean): this;
|
|
239
240
|
withRunFunction(fn: (ctx: FieldActionContext<ET>) => void): this;
|
|
241
|
+
withWrappers(wrappers: string[]): this;
|
|
240
242
|
copy(): FieldActionDescriptor<ET>;
|
|
241
243
|
}
|
|
242
244
|
export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET> implements ILookupDescriptor<T> {
|
|
@@ -7,7 +7,6 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
* - Array notation (e.g.: [0])
|
|
8
8
|
*/
|
|
9
9
|
export declare class JsonPathPipe implements PipeTransform {
|
|
10
|
-
private readonly logger;
|
|
11
10
|
transform(value: any, path?: string): any;
|
|
12
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<JsonPathPipe, never>;
|
|
13
12
|
static ɵpipe: i0.ɵɵPipeDeclaration<JsonPathPipe, "jsonPath", true>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediusinc/mng-commons",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0-rc.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/animations": "^16.0.0",
|
|
6
6
|
"@angular/common": "^16.0.0",
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"reflect-metadata": "^0.1.13",
|
|
17
17
|
"tslib": "^2.5.0"
|
|
18
18
|
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"directory": "dist"
|
|
21
|
+
},
|
|
19
22
|
"sideEffects": false,
|
|
20
23
|
"module": "fesm2022/mediusinc-mng-commons.mjs",
|
|
21
24
|
"typings": "index.d.ts",
|