@trudb/tru-common-lib 0.0.177 → 0.0.181

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.
Files changed (105) hide show
  1. package/esm2020/lib/components/confirm-dialog/tru-confirm-dialog-module.mjs +19 -0
  2. package/esm2020/lib/components/confirm-dialog/tru-confirm-dialog.mjs +36 -0
  3. package/esm2020/lib/components/desktop/directives/resizable/tru-desktop-resizable-module.mjs +19 -0
  4. package/esm2020/lib/components/desktop/directives/resizable/tru-desktop-resizable.mjs +109 -0
  5. package/esm2020/lib/components/desktop/menubar/tru-desktop-menubar-module.mjs +44 -0
  6. package/esm2020/lib/components/desktop/menubar/tru-desktop-menubar.mjs +29 -0
  7. package/esm2020/lib/components/desktop/services/tru-desktop-service.mjs +136 -0
  8. package/esm2020/lib/components/desktop/statusbar/tru-desktop-statusbar-module.mjs +19 -0
  9. package/esm2020/lib/components/desktop/statusbar/tru-desktop-statusbar.mjs +18 -0
  10. package/esm2020/lib/components/desktop/taskbar/tru-desktop-taskbar-module.mjs +21 -0
  11. package/esm2020/lib/components/desktop/taskbar/tru-desktop-taskbar.mjs +40 -0
  12. package/esm2020/lib/components/desktop/tru-desktop-module.mjs +72 -0
  13. package/esm2020/lib/components/desktop/tru-desktop.mjs +703 -0
  14. package/esm2020/lib/components/desktop/view/tru-desktop-view-module.mjs +19 -0
  15. package/esm2020/lib/components/desktop/view/tru-desktop-view.mjs +25 -0
  16. package/esm2020/lib/components/desktop/viewport/tru-desktop-viewport-module.mjs +20 -0
  17. package/esm2020/lib/components/desktop/viewport/tru-desktop-viewport.mjs +109 -0
  18. package/esm2020/lib/components/desktop/window/tru-desktop-window-module.mjs +58 -0
  19. package/esm2020/lib/components/desktop/window/tru-desktop-window.mjs +449 -0
  20. package/esm2020/lib/components/export-dialog/tru-export-dialog-module.mjs +20 -0
  21. package/esm2020/lib/components/export-dialog/tru-export-dialog.mjs +57 -0
  22. package/esm2020/lib/components/toolbar/button/tru-toolbar-button-module.mjs +32 -0
  23. package/esm2020/lib/components/toolbar/button/tru-toolbar-button.mjs +35 -0
  24. package/esm2020/lib/components/toolbar/context-filter/tru-toolbar-context-filter-module.mjs +40 -0
  25. package/esm2020/lib/components/toolbar/context-filter/tru-toolbar-context-filter.mjs +24 -0
  26. package/esm2020/lib/components/toolbar/dropdown/tru-toolbar-dropdown-module.mjs +32 -0
  27. package/esm2020/lib/components/toolbar/dropdown/tru-toolbar-dropdown.mjs +42 -0
  28. package/esm2020/lib/components/toolbar/menu/menu-button/tru-toolbar-menu-button-module.mjs +19 -0
  29. package/esm2020/lib/components/toolbar/menu/menu-button/tru-toolbar-menu-button.mjs +16 -0
  30. package/esm2020/lib/components/toolbar/menu/menu-item/tru-toolbar-menu-item-module.mjs +19 -0
  31. package/esm2020/lib/components/toolbar/menu/menu-item/tru-toolbar-menu-item.mjs +26 -0
  32. package/esm2020/lib/components/toolbar/menu/tru-toolbar-menu-module.mjs +32 -0
  33. package/esm2020/lib/components/toolbar/menu/tru-toolbar-menu.mjs +33 -0
  34. package/esm2020/lib/components/toolbar/separator/tru-toolbar-separator-module.mjs +19 -0
  35. package/esm2020/lib/components/toolbar/separator/tru-toolbar-separator.mjs +12 -0
  36. package/esm2020/lib/components/toolbar/text/tru-toolbar-text-module.mjs +32 -0
  37. package/esm2020/lib/components/toolbar/text/tru-toolbar-text.mjs +28 -0
  38. package/esm2020/lib/components/toolbar/tru-toolbar-module.mjs +66 -0
  39. package/esm2020/lib/components/toolbar/tru-toolbar.mjs +21 -0
  40. package/esm2020/lib/material.module.mjs +192 -0
  41. package/esm2020/lib/services/tru-app-environment.mjs +75 -0
  42. package/esm2020/lib/services/tru-breeze-context-factory.mjs +71 -0
  43. package/esm2020/lib/services/tru-data-context.mjs +207 -0
  44. package/esm2020/lib/services/tru-entity-accessor.mjs +188 -0
  45. package/esm2020/lib/services/tru-predicate-map.mjs +11 -0
  46. package/esm2020/lib/services/tru-search-group-event-handler.mjs +1 -1
  47. package/esm2020/lib/services/tru-text-manager.mjs +134 -0
  48. package/esm2020/lib/services/tru-ui-notification.mjs +90 -0
  49. package/esm2020/lib/services/tru-user.mjs +54 -0
  50. package/esm2020/lib/tru-common-module.mjs +1 -1
  51. package/esm2020/public-api.mjs +33 -2
  52. package/fesm2015/trudb-tru-common-lib.mjs +3203 -65
  53. package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
  54. package/fesm2020/trudb-tru-common-lib.mjs +3197 -65
  55. package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
  56. package/lib/components/confirm-dialog/tru-confirm-dialog-module.d.ts +9 -0
  57. package/lib/components/confirm-dialog/tru-confirm-dialog.d.ts +20 -0
  58. package/lib/components/desktop/directives/resizable/tru-desktop-resizable-module.d.ts +9 -0
  59. package/lib/components/desktop/directives/resizable/tru-desktop-resizable.d.ts +32 -0
  60. package/lib/components/desktop/menubar/tru-desktop-menubar-module.d.ts +14 -0
  61. package/lib/components/desktop/menubar/tru-desktop-menubar.d.ts +12 -0
  62. package/lib/components/desktop/services/tru-desktop-service.d.ts +110 -0
  63. package/lib/components/desktop/statusbar/tru-desktop-statusbar-module.d.ts +9 -0
  64. package/lib/components/desktop/statusbar/tru-desktop-statusbar.d.ts +10 -0
  65. package/lib/components/desktop/taskbar/tru-desktop-taskbar-module.d.ts +11 -0
  66. package/lib/components/desktop/taskbar/tru-desktop-taskbar.d.ts +15 -0
  67. package/lib/components/desktop/tru-desktop-module.d.ts +20 -0
  68. package/lib/components/desktop/tru-desktop.d.ts +334 -0
  69. package/lib/components/desktop/view/tru-desktop-view-module.d.ts +9 -0
  70. package/lib/components/desktop/view/tru-desktop-view.d.ts +13 -0
  71. package/lib/components/desktop/viewport/tru-desktop-viewport-module.d.ts +10 -0
  72. package/lib/components/desktop/viewport/tru-desktop-viewport.d.ts +46 -0
  73. package/lib/components/desktop/window/tru-desktop-window-module.d.ts +17 -0
  74. package/lib/components/desktop/window/tru-desktop-window.d.ts +184 -0
  75. package/lib/components/export-dialog/tru-export-dialog-module.d.ts +10 -0
  76. package/lib/components/export-dialog/tru-export-dialog.d.ts +26 -0
  77. package/lib/components/toolbar/button/tru-toolbar-button-module.d.ts +11 -0
  78. package/lib/components/toolbar/button/tru-toolbar-button.d.ts +14 -0
  79. package/lib/components/toolbar/context-filter/tru-toolbar-context-filter-module.d.ts +13 -0
  80. package/lib/components/toolbar/context-filter/tru-toolbar-context-filter.d.ts +11 -0
  81. package/lib/components/toolbar/dropdown/tru-toolbar-dropdown-module.d.ts +11 -0
  82. package/lib/components/toolbar/dropdown/tru-toolbar-dropdown.d.ts +18 -0
  83. package/lib/components/toolbar/menu/menu-button/tru-toolbar-menu-button-module.d.ts +9 -0
  84. package/lib/components/toolbar/menu/menu-button/tru-toolbar-menu-button.d.ts +7 -0
  85. package/lib/components/toolbar/menu/menu-item/tru-toolbar-menu-item-module.d.ts +9 -0
  86. package/lib/components/toolbar/menu/menu-item/tru-toolbar-menu-item.d.ts +8 -0
  87. package/lib/components/toolbar/menu/tru-toolbar-menu-module.d.ts +11 -0
  88. package/lib/components/toolbar/menu/tru-toolbar-menu.d.ts +10 -0
  89. package/lib/components/toolbar/separator/tru-toolbar-separator-module.d.ts +9 -0
  90. package/lib/components/toolbar/separator/tru-toolbar-separator.d.ts +6 -0
  91. package/lib/components/toolbar/text/tru-toolbar-text-module.d.ts +11 -0
  92. package/lib/components/toolbar/text/tru-toolbar-text.d.ts +12 -0
  93. package/lib/components/toolbar/tru-toolbar-module.d.ts +15 -0
  94. package/lib/components/toolbar/tru-toolbar.d.ts +13 -0
  95. package/lib/material.module.d.ts +50 -0
  96. package/lib/services/tru-app-environment.d.ts +48 -0
  97. package/lib/services/tru-breeze-context-factory.d.ts +30 -0
  98. package/lib/services/tru-data-context.d.ts +32 -0
  99. package/lib/services/tru-entity-accessor.d.ts +41 -0
  100. package/lib/services/tru-predicate-map.d.ts +6 -0
  101. package/lib/services/tru-text-manager.d.ts +68 -0
  102. package/lib/services/tru-ui-notification.d.ts +35 -0
  103. package/lib/services/tru-user.d.ts +21 -0
  104. package/package.json +1 -1
  105. package/public-api.d.ts +29 -1
@@ -0,0 +1,32 @@
1
+ import { Entity, EntityType } from "breeze-client";
2
+ import { TruBreezeContextFactory, TruBreezeContext } from './tru-breeze-context-factory';
3
+ import { TruEntityAccessor } from './tru-entity-accessor';
4
+ import { TruUiNotification } from './tru-ui-notification';
5
+ import { TruAppEnvironment } from './tru-app-environment';
6
+ import * as i0 from "@angular/core";
7
+ export declare class TruDataContext {
8
+ private breezeContextFactory;
9
+ private appEnvironment;
10
+ private entityAccessor;
11
+ private uiNotification;
12
+ private _breezeContext;
13
+ private _pendingDeleteEntities;
14
+ private _pendingCascadeDeleteEntities;
15
+ constructor(breezeContextFactory: TruBreezeContextFactory, appEnvironment: TruAppEnvironment, entityAccessor: TruEntityAccessor, uiNotification: TruUiNotification);
16
+ private getValidationErrors;
17
+ private formatValidationErrors;
18
+ private findCachedCascadeDeleteDescendants;
19
+ private markCachedDescendantsForDelete;
20
+ private markForDelete;
21
+ get breezeContext(): TruBreezeContext;
22
+ get entityManager(): import("breeze-client").EntityManager;
23
+ hasChanges: (entityTypes?: Array<EntityType>) => Entity[];
24
+ entityAccess: () => TruEntityAccessor;
25
+ exportCahce: () => void;
26
+ save: (entities?: Array<Entity> | null, deleteOperation?: boolean) => Promise<void>;
27
+ revert: () => void;
28
+ revertWithoutPrompt: () => void;
29
+ delete: (entities: Array<Entity>, confirmMsg: string, onSuccess?: Function | undefined) => void;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruDataContext, never>;
31
+ static ɵprov: i0.ɵɵInjectableDeclaration<TruDataContext>;
32
+ }
@@ -0,0 +1,41 @@
1
+ import { Entity } from "breeze-client";
2
+ import { TruEntityBase } from '../base-classes/tru-entity-base';
3
+ import { TruUiNotification } from "./tru-ui-notification";
4
+ import { TruDataContext } from "./tru-data-context";
5
+ import { HttpClient } from "@angular/common/http";
6
+ import { Observable } from 'rxjs';
7
+ import * as i0 from "@angular/core";
8
+ export declare class TruEntityAccessor {
9
+ private http;
10
+ private uiNotification;
11
+ private _breezeContext;
12
+ private _entityManager;
13
+ private _maxRecordCount;
14
+ constructor(http: HttpClient, uiNotification: TruUiNotification);
15
+ private getQueryServiceName;
16
+ private warnIfMaxRecords;
17
+ private formatQueryChoices;
18
+ set context(dataContext: TruDataContext);
19
+ set maxRecordCount(maxRecordCount: number);
20
+ add: (entity: typeof TruEntityBase, contextFilters?: any) => Entity;
21
+ search: (entity: typeof TruEntityBase, setupQuery: any | null, expands: [
22
+ ] | null, global: boolean) => Observable<Entity[]>;
23
+ searchCacheOnly: (entity: typeof TruEntityBase, setupQuery?: any | null, expands?: [
24
+ ] | null) => Observable<Entity[]>;
25
+ searchCacheOnlySynchronously: (entity: typeof TruEntityBase, setupQuery?: any | null, expands?: [
26
+ ] | null) => Array<any>;
27
+ searchQueryChoices: (entity: typeof TruEntityBase, setupQuery?: any | null, hid?: string | null, goToServer?: boolean) => Observable<{
28
+ label: string;
29
+ value: {
30
+ $: number;
31
+ };
32
+ }[]>;
33
+ getByRefCacheOnly: (entity: typeof TruEntityBase, ref: number | null | undefined, includeDeleted?: boolean) => any;
34
+ export: (entity: typeof TruEntityBase, gridSpec: string, setupQuery: any | null, entityRefs: string | null, options: any) => void;
35
+ private formatAsUrlParameters;
36
+ private downloadFromUrl;
37
+ private saveDownloadedFile;
38
+ private extractFilenameFromContentDisposition;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruEntityAccessor, never>;
40
+ static ɵprov: i0.ɵɵInjectableDeclaration<TruEntityAccessor>;
41
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class PredicateMap {
3
+ constructor();
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<PredicateMap, never>;
5
+ static ɵprov: i0.ɵɵInjectableDeclaration<PredicateMap>;
6
+ }
@@ -0,0 +1,68 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class TruTextManager {
3
+ readonly msgModifierKeyLabel: string;
4
+ readonly msgConfirmExitWithChangesPending: string;
5
+ readonly msgDeleteSuccessful: string;
6
+ readonly msgSaveSuccessful: string;
7
+ readonly msgNoChangesToSave: string;
8
+ readonly msgSaveInProgress: string;
9
+ readonly msgInvalidData: string;
10
+ readonly msgDirtyPreventsReadOnly: string;
11
+ readonly msgDirtyPreventsNavigate: string;
12
+ readonly msgDirtyPreventsClose: string;
13
+ readonly msgDirtyPreventsDeleteExistingRecord: string;
14
+ readonly msgNoDeleteAccess: string;
15
+ readonly msgCannotDeleteNewAndExistingRecords: string;
16
+ readonly msgDeleteReferencingRecordsFirst: string;
17
+ constructor();
18
+ /**
19
+ * If text.length exceeds length, then returns a string that is the first length chars
20
+ * of text plus suffix. Otherwise, returns text.
21
+ * @param {string} text
22
+ * @param {number} length
23
+ * @param {string} suffix
24
+ * @return {string}
25
+ */
26
+ private truncate;
27
+ isMac: () => boolean;
28
+ /**
29
+ * Formats the text to use for the window title.
30
+ * @param {string} text
31
+ * @return {string} - Window title.
32
+ */
33
+ formatWindowTitle: (text: string) => string;
34
+ /**
35
+ * Returns a message indicating that an entity or entities were deleted in another view.
36
+ * @param {string} entityTypeLabel - Description of the entity type.
37
+ * @param [{string}] entityTypePluralLabel - Description of more than one of the entity type.
38
+ * @param [{number}] count - Number of entities.
39
+ */
40
+ fmtEntityDeletedInOtherView: (entityTypeLabel: string, entityTypePluralLabel: string, count: number) => string;
41
+ /**
42
+ * Returns a message used to confirm deletion of an entity or entities.
43
+ * @param {string} entityTypeLabel - Description of the entity type.
44
+ * @param [{string}] entityTypePluralLabel - Description of more than one of the entity type.
45
+ * @param [{number}] count - Number of entities.
46
+ */
47
+ fmtDeleteConfirmation: (entityTypeLabel: string, entityTypePluralLabel?: string | null, count?: number | null) => string;
48
+ /**
49
+ * Returns a message formatted from an error object.
50
+ * @param {error|string} error
51
+ * @returns {string}
52
+ */
53
+ fmtErrorToShow: (error: any) => string;
54
+ /**
55
+ * Returns a message formatted from an exception object.
56
+ * @param {object} exception
57
+ * @returns {string}
58
+ */
59
+ fmtExceptionToShow: (exception: any) => string;
60
+ /**
61
+ * Returns a message for a data error type.
62
+ * @param {string} typeName
63
+ * @returns {string}
64
+ */
65
+ fmtDataError: (typeName: string) => string;
66
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruTextManager, never>;
67
+ static ɵprov: i0.ɵɵInjectableDeclaration<TruTextManager>;
68
+ }
@@ -0,0 +1,35 @@
1
+ import { MatDialog } from '@angular/material/dialog';
2
+ import { ToastrService } from 'ngx-toastr';
3
+ import * as i0 from "@angular/core";
4
+ export declare class TruUiNotification {
5
+ private toastr;
6
+ private dialog;
7
+ private _toastr;
8
+ private _dialog;
9
+ constructor(toastr: ToastrService, dialog: MatDialog);
10
+ showMessage: (popup: any, log: (message: string) => void, prefix: string, message: string, detail?: Array<string> | null) => void;
11
+ /**
12
+ * Shows as toast and logs to server an error message and optional detail information.
13
+ * @param {string} message - Displayed as toast.
14
+ * @param {string} [detail] - Logged to console.
15
+ */
16
+ error: (message: string, detail?: Array<string> | null) => void;
17
+ /**
18
+ * Same as error() but for info message.
19
+ */
20
+ info: (message: string, detail?: Array<string> | null) => void;
21
+ /**
22
+ * Same as error() but for success message.
23
+ */
24
+ success: (message: string, detail?: Array<string> | null) => void;
25
+ /**
26
+ * Same as error() but for warning message.
27
+ */
28
+ warning: (message: string, detail?: Array<string> | null) => void;
29
+ log: (message: string) => void;
30
+ showErrorDialog: (title: string, message: string) => void;
31
+ showExportDialog: () => Promise<boolean>;
32
+ confirm: (title: string, message: string) => Promise<boolean>;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruUiNotification, never>;
34
+ static ɵprov: i0.ɵɵInjectableDeclaration<TruUiNotification>;
35
+ }
@@ -0,0 +1,21 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class TruUser {
3
+ private _ref;
4
+ private _username;
5
+ private _firstName;
6
+ private _lastName;
7
+ private _roles;
8
+ constructor();
9
+ get activeUserRef(): number;
10
+ set activeUserRef(ref: number);
11
+ get username(): string | null;
12
+ set username(username: string | null);
13
+ get firstName(): string | null;
14
+ set firstName(firstName: string | null);
15
+ get lastName(): string | null;
16
+ set lastName(lastName: string | null);
17
+ set roles(roles: string[] | null);
18
+ hasRoles: (roles: string[]) => boolean;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruUser, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<TruUser>;
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trudb/tru-common-lib",
3
- "version": "0.0.177",
3
+ "version": "0.0.181",
4
4
  "type": "module",
5
5
  "peerDependencies": {},
6
6
  "dependencies": {
package/public-api.d.ts CHANGED
@@ -6,8 +6,36 @@ export * from "./lib/classes/tru-predicate";
6
6
  export * from "./lib/classes/tru-query-predicate-manager";
7
7
  export * from "./lib/classes/tru-window-event";
8
8
  export * from "./lib/classes/tru-window-add-view-event";
9
- export * from './lib/services/tru-search-group-event-handler';
9
+ export * from "./lib/components/confirm-dialog/tru-confirm-dialog";
10
+ export * from "./lib/components/confirm-dialog/tru-confirm-dialog-module";
11
+ export * from "./lib/components/desktop/tru-desktop";
12
+ export * from "./lib/components/desktop/tru-desktop-module";
13
+ export * from "./lib/components/export-dialog/tru-export-dialog";
14
+ export * from "./lib/components/export-dialog/tru-export-dialog-module";
15
+ export * from "./lib/components/toolbar/tru-toolbar";
16
+ export * from "./lib/components/toolbar/tru-toolbar-module";
17
+ export * from "./lib/components/toolbar/menu/tru-toolbar-menu";
18
+ export * from "./lib/components/toolbar/menu/tru-toolbar-menu-module";
19
+ export * from "./lib/components/toolbar/button/tru-toolbar-button";
20
+ export * from "./lib/components/toolbar/button/tru-toolbar-button-module";
21
+ export * from "./lib/components/toolbar/dropdown/tru-toolbar-dropdown";
22
+ export * from "./lib/components/toolbar/dropdown/tru-toolbar-dropdown-module";
23
+ export * from "./lib/components/toolbar/separator/tru-toolbar-separator";
24
+ export * from "./lib/components/toolbar/separator/tru-toolbar-separator-module";
25
+ export * from "./lib/components/toolbar/context-filter/tru-toolbar-context-filter";
26
+ export * from "./lib/components/toolbar/context-filter/tru-toolbar-context-filter-module";
27
+ export * from "./lib/components/toolbar/text/tru-toolbar-text";
28
+ export * from "./lib/components/toolbar/text/tru-toolbar-text-module";
29
+ export * from './lib/services/tru-app-environment';
30
+ export * from './lib/services/tru-breeze-context-factory';
10
31
  export * from './lib/services/tru-component-lookup';
32
+ export * from './lib/services/tru-data-context';
33
+ export * from './lib/services/tru-entity-accessor';
34
+ export * from './lib/services/tru-predicate-map';
35
+ export * from './lib/services/tru-text-manager';
36
+ export * from './lib/services/tru-ui-notification';
37
+ export * from './lib/services/tru-user';
38
+ export * from './lib/services/tru-search-group-event-handler';
11
39
  export * from './lib/services/tru-window-action-event-handler';
12
40
  export * from './lib/services/tru-window-event-handler';
13
41
  export * from "./lib/assets/tru-search-icon-module";