@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.
@@ -0,0 +1,8 @@
1
+ export declare abstract class TruReport {
2
+ abstract label: string;
3
+ abstract value: {
4
+ $: string | number | null | undefined;
5
+ };
6
+ abstract checked?: boolean | null | undefined;
7
+ abstract notAnOption?: boolean | undefined;
8
+ }
@@ -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
- private downloadFromUrl;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trudb/tru-common-lib",
3
- "version": "0.1.161",
3
+ "version": "0.1.164",
4
4
  "type": "module",
5
5
  "peerDependencies": {},
6
6
  "dependencies": {
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';