@trudb/tru-common-lib 0.1.161 → 0.1.164
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/esm2022/lib/classes/tru-report.mjs +3 -0
- package/esm2022/lib/components/data-grid/tru-data-grid.mjs +7 -3
- package/esm2022/lib/components/desktop/services/tru-desktop-manager.mjs +4 -1
- package/esm2022/lib/components/validation-dialog/tru-validation-dialog.mjs +2 -2
- package/esm2022/lib/services/tru-action-invoke.mjs +139 -0
- package/esm2022/lib/services/tru-entity-accessor.mjs +24 -1
- package/esm2022/lib/services/tru-global-data-context.mjs +24 -0
- package/esm2022/lib/services/tru-report-manager.mjs +125 -0
- package/esm2022/lib/services/tru-text-manager.mjs +23 -1
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/trudb-tru-common-lib.mjs +323 -5
- package/fesm2022/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/classes/tru-report.d.ts +8 -0
- package/lib/components/data-grid/tru-data-grid.d.ts +4 -0
- package/lib/components/desktop/services/tru-desktop-manager.d.ts +1 -0
- package/lib/services/tru-action-invoke.d.ts +71 -0
- package/lib/services/tru-entity-accessor.d.ts +10 -1
- package/lib/services/tru-global-data-context.d.ts +10 -0
- package/lib/services/tru-report-manager.d.ts +20 -0
- package/lib/services/tru-text-manager.d.ts +7 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -11,6 +11,7 @@ import { TruConnectionHub } from '../../services/tru-connection-hub';
|
|
|
11
11
|
import { ColDef } from 'ag-grid-community';
|
|
12
12
|
import { TruTabGroupEventNotifier } from '../layout/tab/services/tru-tab-group-event-notifier';
|
|
13
13
|
import { TruDesktopViewEventNotifier } from '../desktop/services/tru-desktop-view-event-notifier';
|
|
14
|
+
import { TruReport } from '../../classes/tru-report';
|
|
14
15
|
import * as i0 from "@angular/core";
|
|
15
16
|
export declare class TruDataGrid implements OnInit, OnChanges, AfterViewInit {
|
|
16
17
|
private dataContext;
|
|
@@ -33,6 +34,8 @@ export declare class TruDataGrid implements OnInit, OnChanges, AfterViewInit {
|
|
|
33
34
|
selectedViewChoice: any;
|
|
34
35
|
unassociatedChoices: Array<any>;
|
|
35
36
|
selectedUnassociatedChoice: any;
|
|
37
|
+
reports: Array<TruReport>;
|
|
38
|
+
selectedReport: TruReport | null;
|
|
36
39
|
gridType: TruDataGridTypes;
|
|
37
40
|
unsavedEntities: Array<any>;
|
|
38
41
|
loadedEntities: Array<any>;
|
|
@@ -69,6 +72,7 @@ export declare class TruDataGrid implements OnInit, OnChanges, AfterViewInit {
|
|
|
69
72
|
onCellMouseOut(e: any): void;
|
|
70
73
|
onSearch: (setupQuery: any) => void;
|
|
71
74
|
onUnassociatedChoiceChanged: (option: ITruToolbarDropdownOption | null) => void;
|
|
75
|
+
onSelectedReportChanged: (option: TruReport) => void;
|
|
72
76
|
canAdd: () => boolean;
|
|
73
77
|
onAdd: () => void;
|
|
74
78
|
onDelete: () => void;
|
|
@@ -17,6 +17,7 @@ export declare class TruDesktopManager {
|
|
|
17
17
|
* directive, then shows its window instead of creating a new one.
|
|
18
18
|
*/
|
|
19
19
|
addWindow: (tableName: string, tablePluralName: string, tablePluralLabel: string, componentName: string, entities?: Array<TruEntityBase>, openAsDetaiView?: boolean, showNavigation?: boolean, showIfExists?: boolean) => void;
|
|
20
|
+
addWindowForQueryResult: (tableName: string, tablePluralName: string, tablePluralLabel: string, componentName: string, entities?: Array<TruEntityBase>, openAsDetaiView?: boolean, showNavigation?: boolean, showIfExists?: boolean) => void;
|
|
20
21
|
windowTitlesByBaseText: any;
|
|
21
22
|
/**
|
|
22
23
|
* Returns a unique string for the base name of a window. At first, returns the input.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { TruGlobalDataContext } from './tru-global-data-context';
|
|
2
|
+
import { TruUser } from './tru-user';
|
|
3
|
+
import { TruDataContext } from './tru-data-context';
|
|
4
|
+
import { TruModelTypeLookup } from './tru-model-type-lookup';
|
|
5
|
+
import { TruTextManager } from './tru-text-manager';
|
|
6
|
+
import { TruDesktopManager } from '../components/desktop/services/tru-desktop-manager';
|
|
7
|
+
import { TruUiNotification } from './tru-ui-notification';
|
|
8
|
+
import { TruWindowEventHandler } from '../components/desktop/services/tru-window-event-handler';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class TruActionInvoke {
|
|
11
|
+
private dataContext;
|
|
12
|
+
private textManager;
|
|
13
|
+
private desktopManager;
|
|
14
|
+
private windowEventHandler;
|
|
15
|
+
private uiNotification;
|
|
16
|
+
private modelTypeLookup;
|
|
17
|
+
private globalDataContext;
|
|
18
|
+
private user;
|
|
19
|
+
constructor(dataContext: TruDataContext, textManager: TruTextManager, desktopManager: TruDesktopManager, windowEventHandler: TruWindowEventHandler, uiNotification: TruUiNotification, modelTypeLookup: TruModelTypeLookup, globalDataContext: TruGlobalDataContext, user: TruUser);
|
|
20
|
+
/**
|
|
21
|
+
* Creates an array of menu item config objects.
|
|
22
|
+
* @param {object[]} menuItemConfigs - Menu item config configs(!)
|
|
23
|
+
* @returns {object[]} - Configs.
|
|
24
|
+
*/
|
|
25
|
+
createMenuConfigs: (menuItemConfigs: any) => any[];
|
|
26
|
+
/**
|
|
27
|
+
* Post to a URL that results in a file download.
|
|
28
|
+
* @param {string} url
|
|
29
|
+
* @param {string} entityRefs - Comma separated list of record refs.
|
|
30
|
+
*/
|
|
31
|
+
executeHttpPostActionForDownload: (url: any, entityRefs: any) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Execute an action that downloads a file.
|
|
34
|
+
* @param {string} actionName
|
|
35
|
+
* @param {string} entityRefs - Comma separated list of record refs.
|
|
36
|
+
*/
|
|
37
|
+
executeActionForDownload: (actionName: any, entityRefs: any) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Execute an action and show the resulting message.
|
|
40
|
+
* @param {string} actionName - Name of an action.
|
|
41
|
+
* @param {string} entityRefs - Comma separated list of record refs.
|
|
42
|
+
*/
|
|
43
|
+
executeActionForMessage: (actionName: any, entityRefs: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Queue the execution of an action.
|
|
46
|
+
* @param {string} actionName - Name of an action.
|
|
47
|
+
* @param {string} entityRefs - Comma separated list of record refs.
|
|
48
|
+
* @param {string} actionLabel - Display name of the action.
|
|
49
|
+
*/
|
|
50
|
+
queueAction: (actionName: string, entityRefs: string, actionLabel: string) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Open a new window with a query function to an action that accepts a list of
|
|
53
|
+
* record refs.
|
|
54
|
+
* @param {string} actionName - Name of an action.
|
|
55
|
+
* @param {string} entityRefs - Comma separated list of record refs.
|
|
56
|
+
* @param {string} componentName - Name of the directive for the window view.
|
|
57
|
+
* @param {object} data - Passed to view.
|
|
58
|
+
*/
|
|
59
|
+
openWindowForQueryResultFromAction: (actionName: string, entityRefs: string, componentName: string, data: any) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Open a new view with a URL and a list of record refs.
|
|
62
|
+
* @param {string} url
|
|
63
|
+
* @param {string} entityRefs - Comma separated list of record refs.
|
|
64
|
+
* @param {string} actionLabel - Action label.
|
|
65
|
+
* @param {string} windowCtrl - window manager.
|
|
66
|
+
*/
|
|
67
|
+
openViewForReportFromUrl: (url: string, entityRefs: string, actionLabel: string, windowCtrl: string) => void;
|
|
68
|
+
processCustomReport: (reportRef: string, entityRefs: string, mimeRef: string) => void;
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TruActionInvoke, never>;
|
|
70
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TruActionInvoke>;
|
|
71
|
+
}
|
|
@@ -43,7 +43,16 @@ export declare class TruEntityAccessor {
|
|
|
43
43
|
searchUserByRefCacheOnly: (ref: number | null | undefined, includeDeleted?: boolean) => any;
|
|
44
44
|
export: (entity: typeof TruEntityBase, gridSpec: string, setupQuery: any | null, entityRefs: string | null, options: any) => void;
|
|
45
45
|
private formatAsUrlParameters;
|
|
46
|
-
|
|
46
|
+
downloadFromUrl: (url: string, data: any) => void;
|
|
47
|
+
downloadFromService: (serviceName: string, data: any) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Request an action.
|
|
50
|
+
* @param {string} actionName - Name of the action.
|
|
51
|
+
* @param {string} entityRefs - Comma separated list of entity pkey values.
|
|
52
|
+
* @returns {promise} on success, passes the results to success handler;
|
|
53
|
+
* on failure, passes exception to fail handler.
|
|
54
|
+
*/
|
|
55
|
+
requestAction: (actionName: string, entityRefs: string) => Observable<any>;
|
|
47
56
|
private saveDownloadedFile;
|
|
48
57
|
private extractFilenameFromContentDisposition;
|
|
49
58
|
static ɵfac: i0.ɵɵFactoryDeclaration<TruEntityAccessor, never>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TruDataContext } from './tru-data-context';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TruGlobalDataContext {
|
|
4
|
+
private _dataContext;
|
|
5
|
+
constructor();
|
|
6
|
+
get dataContext(): TruDataContext | null;
|
|
7
|
+
set dataContext(dataContext: TruDataContext | null);
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TruGlobalDataContext, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TruGlobalDataContext>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TruGlobalDataContext } from './tru-global-data-context';
|
|
2
|
+
import { TruUser } from './tru-user';
|
|
3
|
+
import { TruDataContext } from './tru-data-context';
|
|
4
|
+
import { TruModelTypeLookup } from './tru-model-type-lookup';
|
|
5
|
+
import { TruActionInvoke } from './tru-action-invoke';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class TruReportManager {
|
|
8
|
+
private dataContext;
|
|
9
|
+
private actionInvoke;
|
|
10
|
+
private modelTypeLookup;
|
|
11
|
+
private globalDataContext;
|
|
12
|
+
private user;
|
|
13
|
+
constructor(dataContext: TruDataContext, actionInvoke: TruActionInvoke, modelTypeLookup: TruModelTypeLookup, globalDataContext: TruGlobalDataContext, user: TruUser);
|
|
14
|
+
private setupMenuImpl;
|
|
15
|
+
get(url: string, method: string, callback: (o: any) => any, params?: null): XMLHttpRequest;
|
|
16
|
+
private setupMenu;
|
|
17
|
+
queryReports: (tableName: string, menu: any, getActionRefs: [], enabled: () => {}) => void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TruReportManager, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TruReportManager>;
|
|
20
|
+
}
|
|
@@ -63,6 +63,13 @@ export declare class TruTextManager {
|
|
|
63
63
|
* @returns {string}
|
|
64
64
|
*/
|
|
65
65
|
fmtDataError: (typeName: string) => string;
|
|
66
|
+
/**
|
|
67
|
+
* Serializes an object as URL parameters. The object should be a base type or have
|
|
68
|
+
* properties that are each base types. Does not support a property with structure.
|
|
69
|
+
* @param {Object} data
|
|
70
|
+
* @returns {String}
|
|
71
|
+
*/
|
|
72
|
+
formatAsUrlParameters: (data: any) => any;
|
|
66
73
|
static ɵfac: i0.ɵɵFactoryDeclaration<TruTextManager, never>;
|
|
67
74
|
static ɵprov: i0.ɵɵInjectableDeclaration<TruTextManager>;
|
|
68
75
|
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ export * from './lib/directives/search-panel-position-manager/tru-search-panel-p
|
|
|
107
107
|
export * from './lib/directives/select-panel/tru-mat-select-panel';
|
|
108
108
|
export * from './lib/directives/select-panel/tru-mat-select-panel-module';
|
|
109
109
|
export * from './lib/interfaces/tru-value';
|
|
110
|
+
export * from './lib/services/tru-action-invoke';
|
|
110
111
|
export * from './lib/services/tru-app-environment';
|
|
111
112
|
export * from './lib/services/tru-breeze-context-factory';
|
|
112
113
|
export * from './lib/services/tru-breeze-metadata-provider';
|
|
@@ -119,6 +120,7 @@ export * from './lib/services/tru-entity-accessor';
|
|
|
119
120
|
export * from './lib/services/tru-model-property-lookup';
|
|
120
121
|
export * from './lib/services/tru-model-type-lookup';
|
|
121
122
|
export * from './lib/services/tru-predicate-map';
|
|
123
|
+
export * from './lib/services/tru-report-manager';
|
|
122
124
|
export * from './lib/services/tru-search-result-view-manager';
|
|
123
125
|
export * from './lib/services/tru-sort';
|
|
124
126
|
export * from './lib/services/tru-table-registry';
|