@memberjunction/ng-explorer-core 0.9.200 → 0.9.204

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 (63) hide show
  1. package/dist/generic/Events.types.d.ts +142 -0
  2. package/dist/generic/Events.types.d.ts.map +1 -0
  3. package/dist/generic/Events.types.js +95 -0
  4. package/dist/generic/Item.types.d.ts +25 -0
  5. package/dist/generic/Item.types.d.ts.map +1 -0
  6. package/dist/generic/Item.types.js +36 -0
  7. package/dist/generic/PathData.types.d.ts +9 -0
  8. package/dist/generic/PathData.types.d.ts.map +1 -0
  9. package/dist/generic/PathData.types.js +9 -0
  10. package/dist/lib/base-browser-component/base-browser-component.d.ts +29 -0
  11. package/dist/lib/base-browser-component/base-browser-component.d.ts.map +1 -0
  12. package/dist/lib/base-browser-component/base-browser-component.js +133 -0
  13. package/dist/lib/dashboard-browser-component/dashboard-browser.component.d.ts +8 -9
  14. package/dist/lib/dashboard-browser-component/dashboard-browser.component.d.ts.map +1 -1
  15. package/dist/lib/dashboard-browser-component/dashboard-browser.component.js +51 -85
  16. package/dist/lib/data-browser-component/data-browser.component.js +12 -19
  17. package/dist/lib/favorites/favorites.component.js +1 -1
  18. package/dist/lib/generic-browse-list/generic-browse-list.component.d.ts +3 -0
  19. package/dist/lib/generic-browse-list/generic-browse-list.component.d.ts.map +1 -1
  20. package/dist/lib/generic-browse-list/generic-browse-list.component.js +102 -50
  21. package/dist/lib/generic-browser-list/components/resource/resource.d.ts +1 -0
  22. package/dist/lib/generic-browser-list/components/resource/resource.d.ts.map +1 -0
  23. package/dist/lib/generic-browser-list/components/resource/resource.js +1 -0
  24. package/dist/lib/generic-browser-list/generic-browser-list.component.d.ts +50 -0
  25. package/dist/lib/generic-browser-list/generic-browser-list.component.d.ts.map +1 -0
  26. package/dist/lib/generic-browser-list/generic-browser-list.component.js +366 -0
  27. package/dist/lib/header/header.component.js +25 -28
  28. package/dist/lib/home-component/home.component.js +2 -2
  29. package/dist/lib/navigation/navigation.component.js +2 -2
  30. package/dist/lib/query-browser-component/query-browser.component.d.ts +10 -7
  31. package/dist/lib/query-browser-component/query-browser.component.d.ts.map +1 -1
  32. package/dist/lib/query-browser-component/query-browser.component.js +55 -41
  33. package/dist/lib/report-browser-component/report-browser.component.d.ts +10 -4
  34. package/dist/lib/report-browser-component/report-browser.component.d.ts.map +1 -1
  35. package/dist/lib/report-browser-component/report-browser.component.js +57 -25
  36. package/dist/lib/settings/settings.component.js +1 -1
  37. package/dist/lib/single-dashboard/single-dashboard.component.d.ts.map +1 -1
  38. package/dist/lib/single-dashboard/single-dashboard.component.js +3 -0
  39. package/dist/lib/single-search-result/single-search-result.component.js +1 -1
  40. package/dist/lib/user-notifications/user-notifications.component.js +1 -1
  41. package/dist/module.d.ts +11 -11
  42. package/dist/module.d.ts.map +1 -1
  43. package/dist/module.js +5 -5
  44. package/dist/public-api.d.ts +0 -1
  45. package/dist/public-api.d.ts.map +1 -1
  46. package/dist/public-api.js +0 -1
  47. package/package.json +53 -52
  48. package/dist/lib/ask-skip/ask-skip.component.d.ts +0 -87
  49. package/dist/lib/ask-skip/ask-skip.component.js +0 -626
  50. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.d.ts +0 -12
  51. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.js +0 -50
  52. package/dist/lib/generic/base-resource-component.d.ts +0 -34
  53. package/dist/lib/generic/base-resource-component.js +0 -75
  54. package/dist/lib/generic/dynamic-chart.d.ts +0 -33
  55. package/dist/lib/generic/dynamic-chart.js +0 -252
  56. package/dist/lib/generic/dynamic-grid.d.ts +0 -25
  57. package/dist/lib/generic/dynamic-grid.js +0 -142
  58. package/dist/lib/generic/dynamic-report.d.ts +0 -38
  59. package/dist/lib/generic/dynamic-report.js +0 -405
  60. package/dist/shared/shared.service.d.ts +0 -94
  61. package/dist/shared/shared.service.js +0 -324
  62. package/dist/shared/urlPipe.d.ts +0 -7
  63. package/dist/shared/urlPipe.js +0 -16
@@ -1,324 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { Injectable } from '@angular/core';
11
- import { LogError, Metadata, RunView } from '@memberjunction/core';
12
- import { MJEventType, MJGlobal } from '@memberjunction/global';
13
- import { Subject } from 'rxjs';
14
- import { kendoSVGIcon } from '@memberjunction/ng-shared';
15
- import * as i0 from "@angular/core";
16
- import * as i1 from "@progress/kendo-angular-notification";
17
- export class SharedService {
18
- constructor(notificationService) {
19
- this.notificationService = notificationService;
20
- this.tabChange = new Subject();
21
- this.tabChange$ = this.tabChange.asObservable();
22
- this._currentUserImage = '/assets/user.png';
23
- this._resourceTypeMap = [
24
- { routeSegment: 'record', name: 'records' },
25
- { routeSegment: 'view', name: 'user views' },
26
- { routeSegment: 'search', name: 'search results' },
27
- { routeSegment: 'report', name: 'reports' },
28
- { routeSegment: 'query', name: 'queries' },
29
- { routeSegment: 'dashboard', name: 'dashboards' }
30
- ];
31
- if (SharedService._instance) {
32
- // return existing instance which will short circuit the creation of a new instance
33
- return SharedService._instance;
34
- }
35
- // first time this has been called, so return ourselves since we're in the constructor
36
- SharedService._instance = this;
37
- MJGlobal.Instance.GetEventListener(true).subscribe((event) => {
38
- switch (event.event) {
39
- case MJEventType.DisplaySimpleNotificationRequest:
40
- // received the message to display a notification to the user, so do that...
41
- const messageData = event.args;
42
- this.CreateSimpleNotification(messageData.message, messageData.style, messageData.DisplayDuration);
43
- break;
44
- case MJEventType.ComponentEvent:
45
- if (event.eventCode === EventCodes.UserNotificationsUpdated) {
46
- // refresh the user notifications
47
- SharedService.RefreshUserNotifications();
48
- }
49
- break;
50
- case MJEventType.LoggedIn:
51
- if (SharedService._loaded === false)
52
- SharedService.RefreshData();
53
- // got the login, now subscribe to push status updates here so we can then raise them as events in MJ Global locally
54
- this.PushStatusUpdates().subscribe((status) => {
55
- var _a, _b;
56
- const statusObj = JSON.parse(status.message);
57
- // pass along as an event so anyone else who wants to know about the push status update can do stuff
58
- MJGlobal.Instance.RaiseEvent({
59
- event: MJEventType.ComponentEvent,
60
- eventCode: EventCodes.PushStatusUpdates,
61
- args: statusObj,
62
- component: this
63
- });
64
- if (((_a = statusObj.type) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === 'usernotifications') {
65
- if (statusObj.details && ((_b = statusObj.details.action) === null || _b === void 0 ? void 0 : _b.trim().toLowerCase()) === 'create') {
66
- // we have changes to user notifications, so refresh them
67
- this.CreateSimpleNotification('New Notification Available', "success", 2000);
68
- SharedService.RefreshUserNotifications();
69
- }
70
- }
71
- else {
72
- // otherwise just post it as a simple notification
73
- this.CreateSimpleNotification(statusObj.message, "success", 2500);
74
- }
75
- });
76
- break;
77
- }
78
- });
79
- }
80
- static get Instance() {
81
- return SharedService._instance;
82
- }
83
- /**
84
- * Returns the current session ID, which is automatically created when the service is instantiated.
85
- */
86
- get SessionId() {
87
- return Metadata.Provider.sessionId;
88
- }
89
- get ResourceTypes() {
90
- return SharedService._resourceTypes;
91
- }
92
- get ViewResourceType() {
93
- return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'user views');
94
- }
95
- get RecordResourceType() {
96
- return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'records');
97
- }
98
- get DashboardResourceType() {
99
- return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'dashboards');
100
- }
101
- get ReportResourceType() {
102
- return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'reports');
103
- }
104
- get SearchResultsResourceType() {
105
- return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'search results');
106
- }
107
- ResourceTypeByID(id) {
108
- return SharedService._resourceTypes.find(rt => rt.ID === id);
109
- }
110
- ResourceTypeByName(name) {
111
- return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === name.trim().toLowerCase());
112
- }
113
- static RefreshData() {
114
- return __awaiter(this, void 0, void 0, function* () {
115
- // if we have a provider, then we can load the data, otherwise load isn't done yet
116
- const md = new Metadata();
117
- const rtResult = yield md.GetAndCacheDatasetByName('ResourceTypes');
118
- if (rtResult && rtResult.Success) {
119
- const data = rtResult.Results.find(r => r.EntityName === 'Resource Types');
120
- if (data) {
121
- SharedService._resourceTypes = data.Results;
122
- SharedService._loaded = true;
123
- }
124
- }
125
- SharedService.RefreshUserNotifications(); // also call this initially when refreshing the dataset...
126
- });
127
- }
128
- static GeneratePrimaryKeyValueString(pkVals) {
129
- return pkVals.map(pk => pk.FieldName + '|' + pk.Value).join('||');
130
- }
131
- static ParsePrimaryKeys(entity, routeSegment) {
132
- if (!routeSegment.includes('|')) {
133
- // If not, return a single element array with a default field name
134
- return [{ FieldName: entity.PrimaryKey.Name, Value: routeSegment }];
135
- }
136
- else {
137
- const parts = routeSegment.split('||');
138
- const pkVals = [];
139
- for (let p of parts) {
140
- const kv = p.split('|');
141
- pkVals.push({ FieldName: kv[0], Value: kv[1] });
142
- }
143
- return pkVals;
144
- }
145
- }
146
- FormatColumnValue(col, value, maxLength = 0, trailingChars = "...") {
147
- if (value === null || value === undefined)
148
- return value;
149
- try {
150
- const retVal = col.EntityField.FormatValue(value, 0);
151
- if (maxLength > 0 && retVal && retVal.length > maxLength)
152
- return retVal.substring(0, maxLength) + trailingChars;
153
- else
154
- return retVal;
155
- }
156
- catch (e) {
157
- LogError(e);
158
- return value;
159
- }
160
- }
161
- ConvertMarkdownStringToHtmlList(listType, text) {
162
- const listTag = listType === HtmlListType.Unordered ? 'ul' : 'ol';
163
- if (!text.includes('\n')) {
164
- return text;
165
- }
166
- const listItems = text.split('\n').map(line => `<li>${line.trim().replace(/^-\s*/, '')}</li>`).join('');
167
- return `<${listTag}>${listItems}</${listTag}>`;
168
- }
169
- InvokeManualResize(delay = 50) {
170
- setTimeout(() => {
171
- MJGlobal.Instance.RaiseEvent({
172
- event: MJEventType.ManualResizeRequest,
173
- eventCode: '',
174
- args: null,
175
- component: this
176
- });
177
- }, delay); // give the tabstrip time to render
178
- }
179
- PushStatusUpdates() {
180
- const gp = Metadata.Provider;
181
- return gp.PushStatusUpdates();
182
- }
183
- get CurrentUserImage() {
184
- return this._currentUserImage;
185
- }
186
- set CurrentUserImage(value) {
187
- this._currentUserImage = value;
188
- }
189
- static get UserNotifications() {
190
- return SharedService._userNotifications;
191
- }
192
- static get UnreadUserNotifications() {
193
- return SharedService._userNotifications.filter(n => n.Unread);
194
- }
195
- static get UnreadUserNotificationCount() {
196
- return SharedService.UnreadUserNotifications.length;
197
- }
198
- /**
199
- * Creates a notification in the database and refreshes the UI. Returns the notification object.
200
- * @param title
201
- * @param message
202
- * @param resourceTypeId
203
- * @param resourceRecordId
204
- * @param resourceConfiguration Any object, it is converted to a string by JSON.stringify and stored in the database
205
- * @returns
206
- */
207
- CreateNotification(title, message, resourceTypeId, resourceRecordId, resourceConfiguration) {
208
- return __awaiter(this, void 0, void 0, function* () {
209
- const md = new Metadata();
210
- const notification = yield md.GetEntityObject('User Notifications');
211
- notification.Title = title;
212
- notification.Message = message;
213
- if (resourceTypeId)
214
- notification.ResourceTypeID = resourceTypeId;
215
- if (resourceRecordId)
216
- notification.ResourceRecordID = resourceRecordId;
217
- if (resourceConfiguration)
218
- notification.ResourceConfiguration = JSON.stringify(resourceConfiguration);
219
- notification.UserID = md.CurrentUser.ID;
220
- notification.Unread = true;
221
- const result = yield notification.Save();
222
- if (result) {
223
- SharedService.RefreshUserNotifications();
224
- }
225
- // test
226
- this.CreateSimpleNotification(notification.Message, "success", 2500);
227
- return notification;
228
- });
229
- }
230
- static RefreshUserNotifications() {
231
- return __awaiter(this, void 0, void 0, function* () {
232
- try {
233
- const rv = new RunView();
234
- const md = new Metadata();
235
- const result = yield rv.RunView({
236
- EntityName: 'User Notifications',
237
- ExtraFilter: 'UserID=' + md.CurrentUser.ID,
238
- OrderBy: 'CreatedAt DESC'
239
- });
240
- if (result && result.Success) {
241
- SharedService._userNotifications = result.Results;
242
- }
243
- }
244
- catch (e) {
245
- LogError(e);
246
- }
247
- });
248
- }
249
- /**
250
- * Creates a message that is not saved to the User Notifications table, but is displayed to the user.
251
- * @param message - text to display
252
- * @param style - display styling
253
- * @param hideAfter - option to auto hide after the specified delay in milliseconds
254
- */
255
- CreateSimpleNotification(message, style = "success", hideAfter) {
256
- const props = {
257
- content: message,
258
- cssClass: "button-notification",
259
- animation: { type: "slide", duration: 400 },
260
- position: { horizontal: "center", vertical: "top" },
261
- type: { style: style, icon: true }
262
- };
263
- if (hideAfter)
264
- props.hideAfter = hideAfter;
265
- else
266
- props.closable = true;
267
- this.notificationService.show(props);
268
- }
269
- /**
270
- * Maps a Resource Type record Name column to the corresponding route segment
271
- * @param resourceTypeName
272
- * @returns
273
- */
274
- mapResourceTypeNameToRouteSegment(resourceTypeName) {
275
- const item = this._resourceTypeMap.find(rt => rt.name.trim().toLowerCase() === resourceTypeName.trim().toLowerCase());
276
- if (item)
277
- return item.routeSegment;
278
- else
279
- return null;
280
- }
281
- /**
282
- * Maps a route segment to the corresponding Resource Type record Name column
283
- * @param resourceRouteSegment
284
- * @returns
285
- */
286
- mapResourceTypeRouteSegmentToName(resourceRouteSegment) {
287
- const item = this._resourceTypeMap.find(rt => rt.routeSegment.trim().toLowerCase() === resourceRouteSegment.trim().toLowerCase());
288
- if (item)
289
- return item.name;
290
- else
291
- return null;
292
- }
293
- kendoSVGIcon(iconName) {
294
- return kendoSVGIcon(iconName);
295
- }
296
- }
297
- SharedService._loaded = false;
298
- SharedService._resourceTypes = [];
299
- SharedService._userNotifications = [];
300
- SharedService.ɵfac = function SharedService_Factory(t) { return new (t || SharedService)(i0.ɵɵinject(i1.NotificationService)); };
301
- SharedService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SharedService, factory: SharedService.ɵfac, providedIn: 'root' });
302
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SharedService, [{
303
- type: Injectable,
304
- args: [{
305
- providedIn: 'root'
306
- }]
307
- }], () => [{ type: i1.NotificationService }], null); })();
308
- export const HtmlListType = {
309
- Unordered: 'Unordered',
310
- Ordered: 'Ordered',
311
- };
312
- export const EventCodes = {
313
- ViewClicked: "ViewClicked",
314
- EntityRecordClicked: "EntityRecordClicked",
315
- AddDashboard: "AddDashboard",
316
- AddReport: "AddReport",
317
- AddQuery: "AddQuery",
318
- ViewCreated: "ViewCreated",
319
- ViewUpdated: "ViewUpdated",
320
- RunSearch: "RunSearch",
321
- ViewNotifications: "ViewNotifications",
322
- PushStatusUpdates: "PushStatusUpdates",
323
- UserNotificationsUpdated: "UserNotificationsUpdated"
324
- };
@@ -1,7 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class URLPipe implements PipeTransform {
4
- transform(value: string): string;
5
- static ɵfac: i0.ɵɵFactoryDeclaration<URLPipe, never>;
6
- static ɵpipe: i0.ɵɵPipeDeclaration<URLPipe, "formatUrl", false>;
7
- }
@@ -1,16 +0,0 @@
1
- import { Pipe } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export class URLPipe {
4
- transform(value) {
5
- if (value && !value.includes('http'))
6
- return 'https://' + value;
7
- else
8
- return value;
9
- }
10
- }
11
- URLPipe.ɵfac = function URLPipe_Factory(t) { return new (t || URLPipe)(); };
12
- URLPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "formatUrl", type: URLPipe, pure: true });
13
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(URLPipe, [{
14
- type: Pipe,
15
- args: [{ name: 'formatUrl' }]
16
- }], null, null); })();