@schneideress/dashboardframework 0.0.270 → 0.0.272
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/bundles/schneideress-dashboardframework.umd.js +415 -115
- package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js +1 -15
- package/bundles/schneideress-dashboardframework.umd.min.js.map +1 -1
- package/esm2015/gridster/lib/gridsterItem.component.js +1 -1
- package/esm2015/gridster/lib/gridsterRenderer.service.js +1 -1
- package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +159 -61
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +55 -30
- package/esm2015/lib/ra.base.dashboard.template.js +4 -2
- package/esm2015/lib/ra.dashboard.responsive.service.js +12 -2
- package/esm2015/lib/ra.dashboard.service.js +7 -1
- package/esm2015/lib/ra.event.enum.js +7 -1
- package/esm2015/lib/ra.gridster.config.js +3 -3
- package/esm5/gridster/lib/gridsterItem.component.js +1 -1
- package/esm5/gridster/lib/gridsterRenderer.service.js +1 -1
- package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +160 -61
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +55 -30
- package/esm5/lib/ra.base.dashboard.template.js +4 -2
- package/esm5/lib/ra.dashboard.responsive.service.js +12 -2
- package/esm5/lib/ra.dashboard.service.js +7 -1
- package/esm5/lib/ra.event.enum.js +7 -1
- package/esm5/lib/ra.gridster.config.js +3 -3
- package/fesm2015/schneideress-dashboardframework.js +240 -93
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +242 -94
- package/fesm5/schneideress-dashboardframework.js.map +1 -1
- package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +23 -2
- package/lib/ra-widget-container/ra.widget.container.component.d.ts +5 -2
- package/lib/ra.base.dashboard.template.d.ts +4 -2
- package/lib/ra.dashboard.responsive.service.d.ts +1 -1
- package/lib/ra.event.enum.d.ts +7 -1
- package/package.json +1 -1
- package/schneideress-dashboardframework.metadata.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = global || self, factory((global.schneideress = global.schneideress || {}, global.schneideress.dashboardframework = {}), global.ng.core, global.rxjs, global.raCommon, global.rxjs.operators, global['ngx-ui-loader'], global['angular-notifier'], global.widgetframework, global.ng.platformBrowser, global.ng.common.http, global.ng.common, global.userControls, global.commonControls));
|
|
5
5
|
}(this, (function (exports, core, rxjs, raCommon, operators, ngxUiLoader, angularNotifier, widgetframework, platformBrowser, http, common, userControls, commonControls) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/******************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
9
9
|
|
|
10
10
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -18,16 +18,18 @@
|
|
|
18
18
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
19
|
PERFORMANCE OF THIS SOFTWARE.
|
|
20
20
|
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
21
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
22
22
|
|
|
23
23
|
var extendStatics = function(d, b) {
|
|
24
24
|
extendStatics = Object.setPrototypeOf ||
|
|
25
25
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (
|
|
26
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
27
27
|
return extendStatics(d, b);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
function __extends(d, b) {
|
|
31
|
+
if (typeof b !== "function" && b !== null)
|
|
32
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
31
33
|
extendStatics(d, b);
|
|
32
34
|
function __() { this.constructor = d; }
|
|
33
35
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -67,6 +69,51 @@
|
|
|
67
69
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
68
70
|
}
|
|
69
71
|
|
|
72
|
+
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
73
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
74
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
75
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
76
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
77
|
+
var _, done = false;
|
|
78
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
79
|
+
var context = {};
|
|
80
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
81
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
82
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
83
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
84
|
+
if (kind === "accessor") {
|
|
85
|
+
if (result === void 0) continue;
|
|
86
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
87
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
88
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
89
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
90
|
+
}
|
|
91
|
+
else if (_ = accept(result)) {
|
|
92
|
+
if (kind === "field") initializers.unshift(_);
|
|
93
|
+
else descriptor[key] = _;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
97
|
+
done = true;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
function __runInitializers(thisArg, initializers, value) {
|
|
101
|
+
var useValue = arguments.length > 2;
|
|
102
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
103
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
104
|
+
}
|
|
105
|
+
return useValue ? value : void 0;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
function __propKey(x) {
|
|
109
|
+
return typeof x === "symbol" ? x : "".concat(x);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
function __setFunctionName(f, name, prefix) {
|
|
113
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
114
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
115
|
+
};
|
|
116
|
+
|
|
70
117
|
function __metadata(metadataKey, metadataValue) {
|
|
71
118
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
72
119
|
}
|
|
@@ -87,7 +134,7 @@
|
|
|
87
134
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
88
135
|
function step(op) {
|
|
89
136
|
if (f) throw new TypeError("Generator is already executing.");
|
|
90
|
-
while (_) try {
|
|
137
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
91
138
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
92
139
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
93
140
|
switch (op[0]) {
|
|
@@ -109,13 +156,20 @@
|
|
|
109
156
|
}
|
|
110
157
|
}
|
|
111
158
|
|
|
112
|
-
|
|
159
|
+
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
|
160
|
+
if (k2 === undefined) k2 = k;
|
|
161
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
162
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
163
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
164
|
+
}
|
|
165
|
+
Object.defineProperty(o, k2, desc);
|
|
166
|
+
}) : (function(o, m, k, k2) {
|
|
113
167
|
if (k2 === undefined) k2 = k;
|
|
114
168
|
o[k2] = m[k];
|
|
115
|
-
}
|
|
169
|
+
});
|
|
116
170
|
|
|
117
|
-
function __exportStar(m,
|
|
118
|
-
for (var p in m) if (p !== "default" && !
|
|
171
|
+
function __exportStar(m, o) {
|
|
172
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
|
119
173
|
}
|
|
120
174
|
|
|
121
175
|
function __values(o) {
|
|
@@ -147,19 +201,31 @@
|
|
|
147
201
|
return ar;
|
|
148
202
|
}
|
|
149
203
|
|
|
204
|
+
/** @deprecated */
|
|
150
205
|
function __spread() {
|
|
151
206
|
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
152
207
|
ar = ar.concat(__read(arguments[i]));
|
|
153
208
|
return ar;
|
|
154
209
|
}
|
|
155
210
|
|
|
211
|
+
/** @deprecated */
|
|
156
212
|
function __spreadArrays() {
|
|
157
213
|
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
158
214
|
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
159
215
|
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
160
216
|
r[k] = a[j];
|
|
161
217
|
return r;
|
|
162
|
-
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function __spreadArray(to, from, pack) {
|
|
221
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
222
|
+
if (ar || !(i in from)) {
|
|
223
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
224
|
+
ar[i] = from[i];
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
228
|
+
}
|
|
163
229
|
|
|
164
230
|
function __await(v) {
|
|
165
231
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -180,7 +246,7 @@
|
|
|
180
246
|
function __asyncDelegator(o) {
|
|
181
247
|
var i, p;
|
|
182
248
|
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
183
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done:
|
|
249
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
184
250
|
}
|
|
185
251
|
|
|
186
252
|
function __asyncValues(o) {
|
|
@@ -196,11 +262,17 @@
|
|
|
196
262
|
return cooked;
|
|
197
263
|
};
|
|
198
264
|
|
|
265
|
+
var __setModuleDefault = Object.create ? (function(o, v) {
|
|
266
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
267
|
+
}) : function(o, v) {
|
|
268
|
+
o["default"] = v;
|
|
269
|
+
};
|
|
270
|
+
|
|
199
271
|
function __importStar(mod) {
|
|
200
272
|
if (mod && mod.__esModule) return mod;
|
|
201
273
|
var result = {};
|
|
202
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result
|
|
203
|
-
result
|
|
274
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
275
|
+
__setModuleDefault(result, mod);
|
|
204
276
|
return result;
|
|
205
277
|
}
|
|
206
278
|
|
|
@@ -208,20 +280,100 @@
|
|
|
208
280
|
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
209
281
|
}
|
|
210
282
|
|
|
211
|
-
function __classPrivateFieldGet(receiver,
|
|
212
|
-
if (!
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
283
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
284
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
285
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
286
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
290
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
291
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
292
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
293
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function __classPrivateFieldIn(state, receiver) {
|
|
297
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
|
298
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
216
299
|
}
|
|
217
300
|
|
|
218
|
-
function
|
|
219
|
-
if (
|
|
220
|
-
|
|
301
|
+
function __addDisposableResource(env, value, async) {
|
|
302
|
+
if (value !== null && value !== void 0) {
|
|
303
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
304
|
+
var dispose;
|
|
305
|
+
if (async) {
|
|
306
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
307
|
+
dispose = value[Symbol.asyncDispose];
|
|
308
|
+
}
|
|
309
|
+
if (dispose === void 0) {
|
|
310
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
311
|
+
dispose = value[Symbol.dispose];
|
|
312
|
+
}
|
|
313
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
314
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
315
|
+
}
|
|
316
|
+
else if (async) {
|
|
317
|
+
env.stack.push({ async: true });
|
|
221
318
|
}
|
|
222
|
-
privateMap.set(receiver, value);
|
|
223
319
|
return value;
|
|
224
|
-
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
323
|
+
var e = new Error(message);
|
|
324
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
function __disposeResources(env) {
|
|
328
|
+
function fail(e) {
|
|
329
|
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
330
|
+
env.hasError = true;
|
|
331
|
+
}
|
|
332
|
+
function next() {
|
|
333
|
+
while (env.stack.length) {
|
|
334
|
+
var rec = env.stack.pop();
|
|
335
|
+
try {
|
|
336
|
+
var result = rec.dispose && rec.dispose.call(rec.value);
|
|
337
|
+
if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
338
|
+
}
|
|
339
|
+
catch (e) {
|
|
340
|
+
fail(e);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (env.hasError) throw env.error;
|
|
344
|
+
}
|
|
345
|
+
return next();
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
var tslib_es6 = {
|
|
349
|
+
__extends: __extends,
|
|
350
|
+
__assign: __assign,
|
|
351
|
+
__rest: __rest,
|
|
352
|
+
__decorate: __decorate,
|
|
353
|
+
__param: __param,
|
|
354
|
+
__metadata: __metadata,
|
|
355
|
+
__awaiter: __awaiter,
|
|
356
|
+
__generator: __generator,
|
|
357
|
+
__createBinding: __createBinding,
|
|
358
|
+
__exportStar: __exportStar,
|
|
359
|
+
__values: __values,
|
|
360
|
+
__read: __read,
|
|
361
|
+
__spread: __spread,
|
|
362
|
+
__spreadArrays: __spreadArrays,
|
|
363
|
+
__spreadArray: __spreadArray,
|
|
364
|
+
__await: __await,
|
|
365
|
+
__asyncGenerator: __asyncGenerator,
|
|
366
|
+
__asyncDelegator: __asyncDelegator,
|
|
367
|
+
__asyncValues: __asyncValues,
|
|
368
|
+
__makeTemplateObject: __makeTemplateObject,
|
|
369
|
+
__importStar: __importStar,
|
|
370
|
+
__importDefault: __importDefault,
|
|
371
|
+
__classPrivateFieldGet: __classPrivateFieldGet,
|
|
372
|
+
__classPrivateFieldSet: __classPrivateFieldSet,
|
|
373
|
+
__classPrivateFieldIn: __classPrivateFieldIn,
|
|
374
|
+
__addDisposableResource: __addDisposableResource,
|
|
375
|
+
__disposeResources: __disposeResources,
|
|
376
|
+
};
|
|
225
377
|
|
|
226
378
|
var RaDashboardService = /** @class */ (function (_super) {
|
|
227
379
|
__extends(RaDashboardService, _super);
|
|
@@ -280,6 +432,12 @@
|
|
|
280
432
|
/**To Update widgetInfo in database */
|
|
281
433
|
RaDashboardService.prototype.updateWidget = function (widgetInfo, appConfig) {
|
|
282
434
|
this.baseUrl = appConfig.apiBaseUrl;
|
|
435
|
+
var info = {};
|
|
436
|
+
info.widgetConfigInfo = widgetInfo.widgetConfigInfo;
|
|
437
|
+
info.widgetInstanceId = widgetInfo.widgetInstanceId;
|
|
438
|
+
info.widgetTitle = widgetInfo.widgetTitle;
|
|
439
|
+
info.widgetType = widgetInfo.widgetType;
|
|
440
|
+
info.widgetId = widgetInfo.widgetId;
|
|
283
441
|
return this.post('widget/UpdateUserWidget', widgetInfo);
|
|
284
442
|
};
|
|
285
443
|
/** To Move or change position if current widget container*/
|
|
@@ -395,6 +553,12 @@
|
|
|
395
553
|
RAEvent["UpdateAppledFiterForInapplicableFilter"] = "UpdateAppledFiterForInapplicableFilter";
|
|
396
554
|
/**show inapplicable filter message in global filter flyout */
|
|
397
555
|
RAEvent["ShowInapplicableFilterMessage"] = "ShowInapplicableFilterMessage";
|
|
556
|
+
/** Bulk Action Clicked */
|
|
557
|
+
RAEvent["BulkActionClick"] = "BulkActionClick";
|
|
558
|
+
/** Global Filter Clicked */
|
|
559
|
+
/** When user change the curated filter(eg:data streams), system will create/delete widgets */
|
|
560
|
+
RAEvent["CuratedFilterChange"] = "CuratedFilterChange";
|
|
561
|
+
RAEvent["GlobalFilterClick"] = "GlobalFilterClick";
|
|
398
562
|
})(exports.RAEvent || (exports.RAEvent = {}));
|
|
399
563
|
|
|
400
564
|
(function (RAEventKey) {
|
|
@@ -408,9 +572,9 @@
|
|
|
408
572
|
margin: 10,
|
|
409
573
|
outerMargin: true,
|
|
410
574
|
outerMarginTop: 10,
|
|
411
|
-
outerMarginRight:
|
|
575
|
+
outerMarginRight: 0,
|
|
412
576
|
outerMarginBottom: 30,
|
|
413
|
-
outerMarginLeft:
|
|
577
|
+
outerMarginLeft: 0,
|
|
414
578
|
useTransformPositioning: true,
|
|
415
579
|
mobileBreakpoint: 640,
|
|
416
580
|
minCols: 10,
|
|
@@ -525,7 +689,7 @@
|
|
|
525
689
|
enumerable: true,
|
|
526
690
|
configurable: true
|
|
527
691
|
});
|
|
528
|
-
RADashboardResponsiveService.prototype.getGridsterConfig = function (isWidgetMgmnt) {
|
|
692
|
+
RADashboardResponsiveService.prototype.getGridsterConfig = function (isWidgetMgmnt, resize, canMove) {
|
|
529
693
|
var config = GridsterConfigDefaultSettings;
|
|
530
694
|
config.minCols = this.currentResInfo.maxCols;
|
|
531
695
|
config.maxCols = this.currentResInfo.maxCols;
|
|
@@ -547,6 +711,13 @@
|
|
|
547
711
|
config.swap = true;
|
|
548
712
|
config.draggable.enabled = true;
|
|
549
713
|
}
|
|
714
|
+
if (!resize) {
|
|
715
|
+
config.resizable.enabled = false;
|
|
716
|
+
config.swap = false;
|
|
717
|
+
}
|
|
718
|
+
if (!canMove) {
|
|
719
|
+
config.draggable.enabled = false;
|
|
720
|
+
}
|
|
550
721
|
return config;
|
|
551
722
|
};
|
|
552
723
|
/**To map IwidgetInfo object to gridsterItem */
|
|
@@ -554,6 +725,9 @@
|
|
|
554
725
|
if (widget.widgetSettings) {
|
|
555
726
|
widget.settings = JSON.parse(widget.widgetSettings);
|
|
556
727
|
}
|
|
728
|
+
if (widget.templateSettings) {
|
|
729
|
+
widget.templateWidgetSettings = JSON.parse(widget.templateSettings);
|
|
730
|
+
}
|
|
557
731
|
var gridsterItem = {
|
|
558
732
|
cols: this.getWidth(widget.width),
|
|
559
733
|
rows: this.getHeight(widget.height),
|
|
@@ -621,14 +795,21 @@
|
|
|
621
795
|
this.domResized = false;
|
|
622
796
|
this.showEmptyDashboard = false;
|
|
623
797
|
this.isWidgetMgmnt = false;
|
|
798
|
+
this.initialWidgetCount = 10;
|
|
799
|
+
this.currentLoadedIndex = 0;
|
|
800
|
+
this.loading = false;
|
|
624
801
|
this.widgetHeight = 2;
|
|
625
802
|
this.widgetWidth = 4;
|
|
626
803
|
this.hideDashboardBanner = new core.EventEmitter();
|
|
627
804
|
}
|
|
628
805
|
RADashboardArea.prototype.ngOnInit = function () {
|
|
629
806
|
var _this = this;
|
|
807
|
+
window.addEventListener('scroll', function () {
|
|
808
|
+
_this.loadNext();
|
|
809
|
+
});
|
|
630
810
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
631
811
|
this.initiateGridsterConfig();
|
|
812
|
+
this.setEmptyDashboardConfig();
|
|
632
813
|
this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
|
|
633
814
|
this.responsiveService.resized.subscribe(function (isDesktop) {
|
|
634
815
|
if (_this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
|
|
@@ -657,6 +838,11 @@
|
|
|
657
838
|
}, 100);
|
|
658
839
|
}
|
|
659
840
|
});
|
|
841
|
+
setTimeout(function () {
|
|
842
|
+
_this.bulkActionClick = _this.raDashboardEventBus.subscribe(exports.RAEvent.BulkActionClick).subscribe(function (data) {
|
|
843
|
+
_this.bulkActionData = JSON.parse(JSON.stringify(data)); // To create a new reference;
|
|
844
|
+
});
|
|
845
|
+
});
|
|
660
846
|
};
|
|
661
847
|
RADashboardArea.prototype.ngOnChanges = function (changes) {
|
|
662
848
|
this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
|
|
@@ -664,28 +850,41 @@
|
|
|
664
850
|
this.isWidgetLoaded = true;
|
|
665
851
|
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
666
852
|
}
|
|
853
|
+
this.initiateGridsterConfig();
|
|
667
854
|
if (changes.raDashboardEventBus && changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
|
|
668
855
|
this.inititateEventBusSubscritions();
|
|
669
856
|
}
|
|
670
857
|
};
|
|
858
|
+
RADashboardArea.prototype.setEmptyDashboardConfig = function () {
|
|
859
|
+
if (this.dashboardInfo && this.dashboardInfo.templateConfig.emptyDashboardHeader) {
|
|
860
|
+
this.emptyDashboardTitle = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.titleKey);
|
|
861
|
+
this.emptyDashboardMsg1 = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey1);
|
|
862
|
+
this.emptyDashboardMsg2 = (this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) ? this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) : '';
|
|
863
|
+
this.emptyDashboardButtonText = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonTextKey);
|
|
864
|
+
this.emptyDashboardButtonIcon = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon : '';
|
|
865
|
+
this.emptyDashboardButtonAction = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction : '';
|
|
866
|
+
}
|
|
867
|
+
};
|
|
671
868
|
/**To set GridsterConfig */
|
|
672
869
|
RADashboardArea.prototype.initiateGridsterConfig = function () {
|
|
673
870
|
var _this = this;
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
};
|
|
681
|
-
this.options.itemChangeCallback = function (item) {
|
|
682
|
-
if (_this.responsiveService.IsDesktopView) {
|
|
683
|
-
if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
|
|
684
|
-
_this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
871
|
+
if (this.dashboardInfo) {
|
|
872
|
+
/**To override default configuration values to the gridster control */
|
|
873
|
+
this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt, this.dashboardInfo.templateConfig.widget.canResize, this.dashboardInfo.templateConfig.widget.canMove);
|
|
874
|
+
this.options.initCallback = function (gridster) {
|
|
875
|
+
if (_this.options.api) {
|
|
876
|
+
_this.gridcellHeight = _this.options.api.getCurrentRowHeight();
|
|
685
877
|
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
|
|
878
|
+
};
|
|
879
|
+
this.options.itemChangeCallback = function (item) {
|
|
880
|
+
if (_this.responsiveService.IsDesktopView) {
|
|
881
|
+
if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
|
|
882
|
+
_this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
_this.setAreaHeight();
|
|
886
|
+
};
|
|
887
|
+
}
|
|
689
888
|
};
|
|
690
889
|
/** To initiate eventbus subsctiptions */
|
|
691
890
|
RADashboardArea.prototype.inititateEventBusSubscritions = function () {
|
|
@@ -705,6 +904,11 @@
|
|
|
705
904
|
_this.addWidget(e);
|
|
706
905
|
});
|
|
707
906
|
});
|
|
907
|
+
this.curatedFilterChange = this.raDashboardEventBus.subscribe(exports.RAEvent.CuratedFilterChange).subscribe(function (e) {
|
|
908
|
+
_this.ngZone.run(function () {
|
|
909
|
+
_this.loadWidgets(_this.userDashboardId, _this.areaKey);
|
|
910
|
+
});
|
|
911
|
+
});
|
|
708
912
|
this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(exports.RAEvent.RearrangeClicked).subscribe(function (e) {
|
|
709
913
|
_this.ngZone.run(function () {
|
|
710
914
|
_this.rearrangeWidgets();
|
|
@@ -753,6 +957,10 @@
|
|
|
753
957
|
this.widgetLibraryDoneClick.unsubscribe();
|
|
754
958
|
if (this.rearrangeWidgetClick)
|
|
755
959
|
this.rearrangeWidgetClick.unsubscribe();
|
|
960
|
+
if (this.curatedFilterChange)
|
|
961
|
+
this.curatedFilterChange.unsubscribe();
|
|
962
|
+
if (this.bulkActionClick)
|
|
963
|
+
this.bulkActionClick.unsubscribe();
|
|
756
964
|
};
|
|
757
965
|
/**To update position/dimention of all widgets in the area */
|
|
758
966
|
RADashboardArea.prototype.updateWidgets = function () {
|
|
@@ -789,6 +997,12 @@
|
|
|
789
997
|
/** To retrieve widgets based on userDashboardid and area name */
|
|
790
998
|
RADashboardArea.prototype.loadWidgets = function (userDashboarId, areaKey) {
|
|
791
999
|
var _this = this;
|
|
1000
|
+
if (this.templateConfig && this.templateConfig.initialWidgetCount)
|
|
1001
|
+
this.initialWidgetCount = this.templateConfig.initialWidgetCount;
|
|
1002
|
+
if (location.href.indexOf('loadAllWidgets') > -1)
|
|
1003
|
+
this.initialWidgetCount = 1000;
|
|
1004
|
+
this.currentLoadedIndex = 0;
|
|
1005
|
+
this.loading = false;
|
|
792
1006
|
var widgetInfo = {
|
|
793
1007
|
dashboardId: userDashboarId.toString(),
|
|
794
1008
|
dashboardAreaKey: areaKey
|
|
@@ -807,8 +1021,8 @@
|
|
|
807
1021
|
});
|
|
808
1022
|
_this.checkPAMWidgets();
|
|
809
1023
|
if (widgets && widgets.length > 0) {
|
|
810
|
-
_this.widgetList =
|
|
811
|
-
_this.
|
|
1024
|
+
_this.widgetList = [];
|
|
1025
|
+
_this.loadWidgetsDelta();
|
|
812
1026
|
_this.raDashboardEventBus.publish(exports.RAEvent.HideDashboardBanner, false);
|
|
813
1027
|
}
|
|
814
1028
|
else {
|
|
@@ -817,6 +1031,42 @@
|
|
|
817
1031
|
}
|
|
818
1032
|
});
|
|
819
1033
|
};
|
|
1034
|
+
RADashboardArea.prototype.loadWidgetsDelta = function () {
|
|
1035
|
+
var _a;
|
|
1036
|
+
if (!this.loading) {
|
|
1037
|
+
this.loading = true;
|
|
1038
|
+
var widgets = this.mapObjectListToGridsterItemList(this.userWidgets.slice(this.currentLoadedIndex, (this.currentLoadedIndex + this.initialWidgetCount)));
|
|
1039
|
+
this.currentLoadedIndex += this.initialWidgetCount;
|
|
1040
|
+
(_a = this.widgetList).push.apply(_a, __spread(widgets));
|
|
1041
|
+
this.setAreaHeight();
|
|
1042
|
+
this.loading = false;
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
RADashboardArea.prototype.dataLoaded = function (widgetElement) {
|
|
1046
|
+
this.loadNext();
|
|
1047
|
+
};
|
|
1048
|
+
RADashboardArea.prototype.loadNext = function () {
|
|
1049
|
+
if (this.divBottom) {
|
|
1050
|
+
if (this.elementInViewport(this.divBottom.nativeElement)) {
|
|
1051
|
+
this.loadWidgetsDelta();
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
RADashboardArea.prototype.elementInViewport = function (el) {
|
|
1056
|
+
var top = el.offsetTop;
|
|
1057
|
+
var left = el.offsetLeft;
|
|
1058
|
+
var width = el.offsetWidth;
|
|
1059
|
+
var height = el.offsetHeight;
|
|
1060
|
+
while (el.offsetParent) {
|
|
1061
|
+
el = el.offsetParent;
|
|
1062
|
+
top += el.offsetTop;
|
|
1063
|
+
left += el.offsetLeft;
|
|
1064
|
+
}
|
|
1065
|
+
return (top >= window.scrollY &&
|
|
1066
|
+
left >= window.scrollX &&
|
|
1067
|
+
(top + height) <= (window.scrollY + window.innerHeight) &&
|
|
1068
|
+
(left + width) <= (window.scrollX + window.innerWidth));
|
|
1069
|
+
};
|
|
820
1070
|
/** To set Area(Gridster) height dynamically as widgets are added/removed */
|
|
821
1071
|
RADashboardArea.prototype.setAreaHeight = function () {
|
|
822
1072
|
var _this = this;
|
|
@@ -860,22 +1110,22 @@
|
|
|
860
1110
|
/** To remove a widget instance from dashboard and to save info in database */
|
|
861
1111
|
RADashboardArea.prototype.deleteWidget = function (widgetInstanceId, isalertDisabled) {
|
|
862
1112
|
if (isalertDisabled === void 0) { isalertDisabled = false; }
|
|
1113
|
+
var widget = this.userWidgets.filter(function (item) {
|
|
1114
|
+
return item.widgetInstanceId === widgetInstanceId;
|
|
1115
|
+
});
|
|
1116
|
+
if (widget.length > 0) {
|
|
1117
|
+
this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
|
|
1118
|
+
}
|
|
1119
|
+
if (this.PAMWidgets.length > 0) {
|
|
1120
|
+
var indx = this.PAMWidgets.indexOf(widgetInstanceId);
|
|
1121
|
+
if (indx > -1)
|
|
1122
|
+
this.PAMWidgets.splice(indx, 1);
|
|
1123
|
+
this.checkPAMWidgets();
|
|
1124
|
+
}
|
|
863
1125
|
var gridsterItem = this.widgetList.filter(function (item) {
|
|
864
1126
|
return item.widgetInfo.widgetInstanceId === widgetInstanceId;
|
|
865
1127
|
});
|
|
866
1128
|
if (gridsterItem.length > 0) {
|
|
867
|
-
var widget = this.userWidgets.filter(function (item) {
|
|
868
|
-
return item.widgetInstanceId === widgetInstanceId;
|
|
869
|
-
});
|
|
870
|
-
if (widget.length > 0) {
|
|
871
|
-
this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
|
|
872
|
-
}
|
|
873
|
-
if (this.PAMWidgets.length > 0) {
|
|
874
|
-
var indx = this.PAMWidgets.indexOf(widgetInstanceId);
|
|
875
|
-
if (indx > -1)
|
|
876
|
-
this.PAMWidgets.splice(indx, 1);
|
|
877
|
-
this.checkPAMWidgets();
|
|
878
|
-
}
|
|
879
1129
|
this.widgetList.splice(this.widgetList.indexOf(gridsterItem[0]), 1);
|
|
880
1130
|
this.setAreaHeight();
|
|
881
1131
|
if (!isalertDisabled) {
|
|
@@ -890,11 +1140,15 @@
|
|
|
890
1140
|
/**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
|
|
891
1141
|
RADashboardArea.prototype.rearrangeWidgets = function () {
|
|
892
1142
|
var _this = this;
|
|
1143
|
+
this.currentLoadedIndex = 0;
|
|
1144
|
+
this.loading = false;
|
|
893
1145
|
for (var i = 0; i < this.userWidgets.length; i++) {
|
|
894
1146
|
this.userWidgets[i].position_x = 0;
|
|
895
1147
|
this.userWidgets[i].position_y = 0;
|
|
896
1148
|
}
|
|
897
|
-
this.widgetList =
|
|
1149
|
+
this.widgetList = [];
|
|
1150
|
+
this.loadWidgetsDelta();
|
|
1151
|
+
this.raDashboardEventBus.publish(exports.RAEvent.HideDashboardBanner, false);
|
|
898
1152
|
if (this.widgetList.length > 0)
|
|
899
1153
|
this.updateWidgetPosition(this.widgetList[0].widgetInfo.widgetInstanceId);
|
|
900
1154
|
setTimeout(function () {
|
|
@@ -927,29 +1181,31 @@
|
|
|
927
1181
|
this.ngxService.start();
|
|
928
1182
|
this.dashboardService.addWidget(data, this.appConfig).subscribe(function (widget) {
|
|
929
1183
|
_this.userWidgets.push(widget);
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
1184
|
+
if (_this.currentLoadedIndex >= _this.userWidgets.length) {
|
|
1185
|
+
var gridsterItem = _this.responsiveService.getGridsterItem(widget);
|
|
1186
|
+
_this.widgetList.push(gridsterItem);
|
|
1187
|
+
_this.setAreaHeight();
|
|
1188
|
+
if (_this.options.api) {
|
|
1189
|
+
var curRowHeight = Number(_this.options.api.getCurrentRowHeight());
|
|
1190
|
+
if (curRowHeight > 0) {
|
|
1191
|
+
widget.rowHeight = curRowHeight;
|
|
1192
|
+
_this.gridcellHeight = curRowHeight;
|
|
1193
|
+
}
|
|
938
1194
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
}
|
|
1195
|
+
var widgetInstanceId = 0;
|
|
1196
|
+
if (widget && widget.widgetInstanceId) {
|
|
1197
|
+
widgetInstanceId = widget.widgetInstanceId;
|
|
1198
|
+
/**To save added widget position in db */
|
|
1199
|
+
if (_this.responsiveService.IsDesktopView) {
|
|
1200
|
+
setTimeout(function () {
|
|
1201
|
+
_this.updateWidgetPosition(widgetInstanceId);
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
if (widget.settings && widget.settings.isPAMWidget) {
|
|
1206
|
+
_this.PAMWidgets.push(widget.widgetInstanceId);
|
|
1207
|
+
_this.checkPAMWidgets();
|
|
948
1208
|
}
|
|
949
|
-
}
|
|
950
|
-
if (widget.settings && widget.settings.isPAMWidget) {
|
|
951
|
-
_this.PAMWidgets.push(widget.widgetInstanceId);
|
|
952
|
-
_this.checkPAMWidgets();
|
|
953
1209
|
}
|
|
954
1210
|
_this.raDashboardEventBus.publish(exports.RAEvent.WidgetAdded, widget);
|
|
955
1211
|
});
|
|
@@ -979,12 +1235,14 @@
|
|
|
979
1235
|
});
|
|
980
1236
|
}
|
|
981
1237
|
this.userWidgets.push(data);
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1238
|
+
if (this.currentLoadedIndex >= this.userWidgets.length) {
|
|
1239
|
+
var gridsterItem = this.responsiveService.getGridsterItem(data);
|
|
1240
|
+
this.widgetList.push(gridsterItem);
|
|
1241
|
+
this.setAreaHeight();
|
|
1242
|
+
if (data.settings && data.settings.isPAMWidget) {
|
|
1243
|
+
this.PAMWidgets.push(data.widgetInstanceId);
|
|
1244
|
+
this.checkPAMWidgets();
|
|
1245
|
+
}
|
|
988
1246
|
}
|
|
989
1247
|
};
|
|
990
1248
|
RADashboardArea.prototype.mapObjectListToGridsterItemList = function (widgetList) {
|
|
@@ -1013,8 +1271,11 @@
|
|
|
1013
1271
|
});
|
|
1014
1272
|
return widgetListArray;
|
|
1015
1273
|
};
|
|
1016
|
-
RADashboardArea.prototype.
|
|
1017
|
-
this.
|
|
1274
|
+
RADashboardArea.prototype.buttonClick = function () {
|
|
1275
|
+
if (this.emptyDashboardButtonAction == "widgets")
|
|
1276
|
+
this.raDashboardEventBus.publish(exports.RAEvent.AddNewWidgetToDashboard, null);
|
|
1277
|
+
else if (this.emptyDashboardButtonAction == "filter")
|
|
1278
|
+
this.raDashboardEventBus.publish(exports.RAEvent.GlobalFilterClick, null);
|
|
1018
1279
|
};
|
|
1019
1280
|
RADashboardArea.prototype.updateAppliedFilters = function (data) {
|
|
1020
1281
|
this.raDashboardEventBus.publish(exports.RAEvent.UpdateAppledFiterForInapplicableFilter, data);
|
|
@@ -1064,6 +1325,14 @@
|
|
|
1064
1325
|
core.Input('app-config'),
|
|
1065
1326
|
__metadata("design:type", Object)
|
|
1066
1327
|
], RADashboardArea.prototype, "appConfig", void 0);
|
|
1328
|
+
__decorate([
|
|
1329
|
+
core.Input('dashboard-info'),
|
|
1330
|
+
__metadata("design:type", Object)
|
|
1331
|
+
], RADashboardArea.prototype, "dashboardInfo", void 0);
|
|
1332
|
+
__decorate([
|
|
1333
|
+
core.Input(),
|
|
1334
|
+
__metadata("design:type", Object)
|
|
1335
|
+
], RADashboardArea.prototype, "templateConfig", void 0);
|
|
1067
1336
|
__decorate([
|
|
1068
1337
|
core.Output(),
|
|
1069
1338
|
__metadata("design:type", Object)
|
|
@@ -1072,11 +1341,15 @@
|
|
|
1072
1341
|
core.ViewChild('gridWrapper', { static: false }),
|
|
1073
1342
|
__metadata("design:type", core.ElementRef)
|
|
1074
1343
|
], RADashboardArea.prototype, "gridWrapper", void 0);
|
|
1344
|
+
__decorate([
|
|
1345
|
+
core.ViewChild('divBottom', { static: false }),
|
|
1346
|
+
__metadata("design:type", core.ElementRef)
|
|
1347
|
+
], RADashboardArea.prototype, "divBottom", void 0);
|
|
1075
1348
|
RADashboardArea = __decorate([
|
|
1076
1349
|
core.Component({
|
|
1077
1350
|
selector: 'ra-dashboard-area',
|
|
1078
|
-
template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\"
|
|
1079
|
-
styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#
|
|
1351
|
+
template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\"\r\n [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container (dataLoaded)=\"dataLoaded($event)\"\r\n [bulk-action-data]=\"bulkActionData\" [dashboard-info]=\"dashboardInfo\" [app-config]=\"appConfig\"\r\n [event-bus]=\"raDashboardEventBus\" (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\"\r\n [global-filter]=\"globalFilter\" [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\"\r\n [widget-width]=\"item.cols\" [widget-height]=\"item.rows\" [widget-instance-id]=\"item.widgetInstanceId\"\r\n [dom-resized]=\"domResized\" (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"empty-prefix\">\r\n <!-- <i class=\"fal fa-edit edit-icon\"></i> -->\r\n <span>{{emptyDashboardTitle}}</span>\r\n </div>\r\n <hr class=\"horizontalLine-solid\" />\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{emptyDashboardMsg1}} <br />\r\n {{emptyDashboardMsg2}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm dashboard-button light\" (click)=\"buttonClick()\">\r\n <i class=\"{{emptyDashboardButtonIcon}}\"></i>{{emptyDashboardButtonText}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>\r\n<div #divBottom></div>",
|
|
1352
|
+
styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#fff;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;-moz-user-select:text;user-select:text;box-shadow:none}gridster-item:hover{box-shadow:0 1px 10px rgba(0,0,0,.15)!important}@media screen and (max-width:685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width:350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:15px 0;background-color:#fff;display:flex}.empty-wrapper{background-color:#fff;border:1px solid #9fa0a4;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:18px;padding:15px}.empty-content{color:#626469;width:100%;padding:15px}.empty-msg{padding:0 0 15px;font-size:16px}.horizontalLine-solid{border-top:1px solid #cbcbcb;margin:0 15px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-group-sm>.btn,.btn-sm{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width:600px){.empty-padding{padding:15px 0;background-color:#fff;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border:1px solid #9fa0a4;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:15px}.empty-content{color:#333;display:flex;padding:15px}.empty-msg{padding:0 0 15px;font-size:14px}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}"]
|
|
1080
1353
|
}),
|
|
1081
1354
|
__metadata("design:paramtypes", [RaDashboardService,
|
|
1082
1355
|
core.NgZone,
|
|
@@ -1181,6 +1454,8 @@
|
|
|
1181
1454
|
this.inapplicableFilters = [];
|
|
1182
1455
|
this.widgetDeleted = new core.EventEmitter();
|
|
1183
1456
|
this.updateAppliedFilters = new core.EventEmitter();
|
|
1457
|
+
this.dataLoaded = new core.EventEmitter();
|
|
1458
|
+
this.widgetLoaded = new core.EventEmitter();
|
|
1184
1459
|
this.isWidgetStateApplicable = false;
|
|
1185
1460
|
this.widgetEmptyState = '';
|
|
1186
1461
|
this.lockVisible = false;
|
|
@@ -1205,7 +1480,7 @@
|
|
|
1205
1480
|
configurable: true
|
|
1206
1481
|
});
|
|
1207
1482
|
RAWidgetContainer.prototype.ngOnInit = function () {
|
|
1208
|
-
this.WidgetDisplayName = this.
|
|
1483
|
+
this.WidgetDisplayName = this.translateService.translate('Common.' + this.data.widgetInfo.widgetTitle, true);
|
|
1209
1484
|
this.lockIconTitle = this.translateService.translate('Common.lockedfields');
|
|
1210
1485
|
this.lockIconFooter = this.translateService.translate('Common.lockedfieldseditinfo');
|
|
1211
1486
|
this.inapplicableIconTitle = this.translateService.translate('Common.InapplicableFilters');
|
|
@@ -1226,19 +1501,28 @@
|
|
|
1226
1501
|
});
|
|
1227
1502
|
});
|
|
1228
1503
|
}
|
|
1229
|
-
if (this.widgetElement
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1504
|
+
if (this.widgetElement) {
|
|
1505
|
+
if (changes.bulkActionData && changes.bulkActionData.currentValue != changes.bulkActionData.previousValue) {
|
|
1506
|
+
if (typeof this.widgetElement.bulkActionClicked === "function") {
|
|
1507
|
+
this.widgetElement.bulkActionClicked(this.bulkActionData);
|
|
1508
|
+
}
|
|
1234
1509
|
}
|
|
1235
|
-
|
|
1236
|
-
|
|
1510
|
+
if (changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
|
|
1511
|
+
if (!this.dashboardInfo.curatedFilters) {
|
|
1512
|
+
var filterObj = this.getParsedConfig(this.globalFilter);
|
|
1513
|
+
if (filterObj.WidgetInstanceId) {
|
|
1514
|
+
if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
|
|
1515
|
+
this.refreshWidget(this.data.widgetInfo);
|
|
1516
|
+
}
|
|
1517
|
+
else {
|
|
1518
|
+
//this.refreshWidget(this.data.widgetInfo);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1523
|
+
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1524
|
+
this.invokeWidgetResizedEvent();
|
|
1237
1525
|
}
|
|
1238
|
-
}
|
|
1239
|
-
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1240
|
-
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1241
|
-
this.invokeWidgetResizedEvent();
|
|
1242
1526
|
}
|
|
1243
1527
|
};
|
|
1244
1528
|
RAWidgetContainer.prototype.invokeWidgetResizedEvent = function () {
|
|
@@ -1430,6 +1714,10 @@
|
|
|
1430
1714
|
_this.showPanel = true;
|
|
1431
1715
|
else
|
|
1432
1716
|
_this.showPanel = false;
|
|
1717
|
+
if (!_this.data.dataLoaded) {
|
|
1718
|
+
_this.data.dataLoaded = true;
|
|
1719
|
+
_this.dataLoaded.emit(_this.widgetElement);
|
|
1720
|
+
}
|
|
1433
1721
|
break;
|
|
1434
1722
|
case 'onConfigEditClicked':
|
|
1435
1723
|
_this.editWidget();
|
|
@@ -1502,7 +1790,9 @@
|
|
|
1502
1790
|
widgetConfigFilter.configChanges = this.getConfigChanges(false);
|
|
1503
1791
|
widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
|
|
1504
1792
|
widgetConfigFilter.globalFilter = this.globalFilter;
|
|
1793
|
+
widgetConfigFilter.dashboardInfo = me.dashboardInfo;
|
|
1505
1794
|
this.widgetElement.loadContent(widgetConfigFilter);
|
|
1795
|
+
this.widgetLoaded.emit();
|
|
1506
1796
|
return [4 /*yield*/, this.setLock(widgetConfigFilter.config)];
|
|
1507
1797
|
case 1:
|
|
1508
1798
|
_a.sent();
|
|
@@ -1772,9 +2062,12 @@
|
|
|
1772
2062
|
var html = '<div id="ra-db-widget-menu"' + 'style="' + style + '" class="download-content dropdown-content widget-config-item dropdown-click" style="z-index: 1002;">';
|
|
1773
2063
|
var settings = '';
|
|
1774
2064
|
if (this.isWidgetMgmnt) {
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
2065
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideEdit)
|
|
2066
|
+
settings += this.getHtmlForButton('wcEditWidget', 'fal fa-edit', this.editText);
|
|
2067
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideCopy)
|
|
2068
|
+
settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
|
|
2069
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideMove)
|
|
2070
|
+
settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
|
|
1778
2071
|
}
|
|
1779
2072
|
var customPageParams = false;
|
|
1780
2073
|
if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
|
|
@@ -1783,14 +2076,14 @@
|
|
|
1783
2076
|
customPageParams = true;
|
|
1784
2077
|
}
|
|
1785
2078
|
}
|
|
1786
|
-
if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
|
|
2079
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideVisitPage && (this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
|
|
1787
2080
|
settings += '<a style="max-height: 30px;align-items: center;align-content: center; display: flex;" id="wcVisitWidget">';
|
|
1788
2081
|
settings += '<i style="padding-left: 4px;font-size: 27px !important;" class="fal fa-angle-right"></i> ';
|
|
1789
2082
|
settings += '<span style="padding-left: 11px;margin-top: 2px;" style="padding-left: 6px;">';
|
|
1790
2083
|
settings += this.translateService.translate('Common.visitpage');
|
|
1791
2084
|
settings += '</span></a>';
|
|
1792
2085
|
}
|
|
1793
|
-
if ((this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
|
|
2086
|
+
if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideVisitPage && (this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
|
|
1794
2087
|
html += '<div style="color: #9FA0A4;font-size: 12px;padding-top: 8px;padding-left: 12px;">';
|
|
1795
2088
|
html += this.translateService.translate('Common.settings') + '</div>';
|
|
1796
2089
|
html += settings;
|
|
@@ -1822,7 +2115,7 @@
|
|
|
1822
2115
|
if (this.isDownloadIconVisible && this.isWidgetMgmnt && this.showExcell) {
|
|
1823
2116
|
html += this.getHr();
|
|
1824
2117
|
}
|
|
1825
|
-
if (this.isWidgetMgmnt) {
|
|
2118
|
+
if (this.isWidgetMgmnt && !this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideDelete) {
|
|
1826
2119
|
html += '<a id="wcWidgetDelete"><i class="fal fa-times" style="padding-left: 3px;color: red;"></i><span>';
|
|
1827
2120
|
html += this.deleteText;
|
|
1828
2121
|
html += '</span></a>';
|
|
@@ -1903,17 +2196,6 @@
|
|
|
1903
2196
|
if (this.currentComponent)
|
|
1904
2197
|
this.popupInstance.removeMe(this.currentComponent);
|
|
1905
2198
|
};
|
|
1906
|
-
RAWidgetContainer.prototype.getwidgetTitleTranslation = function (item) {
|
|
1907
|
-
var rKey = 'DBW_' + this.translateService.makeCode(item);
|
|
1908
|
-
var translatedString = '';
|
|
1909
|
-
translatedString = this.translateService.translate('Common.' + rKey);
|
|
1910
|
-
if (translatedString.toLowerCase() === rKey.toLowerCase()) {
|
|
1911
|
-
return item;
|
|
1912
|
-
}
|
|
1913
|
-
else {
|
|
1914
|
-
return translatedString;
|
|
1915
|
-
}
|
|
1916
|
-
};
|
|
1917
2199
|
RAWidgetContainer.ctorParameters = function () { return [
|
|
1918
2200
|
{ type: RaDashboardService },
|
|
1919
2201
|
{ type: ngxUiLoader.NgxUiLoaderService },
|
|
@@ -1956,6 +2238,10 @@
|
|
|
1956
2238
|
core.Input('global-filter'),
|
|
1957
2239
|
__metadata("design:type", Object)
|
|
1958
2240
|
], RAWidgetContainer.prototype, "globalFilter", void 0);
|
|
2241
|
+
__decorate([
|
|
2242
|
+
core.Input('dashboard-info'),
|
|
2243
|
+
__metadata("design:type", Object)
|
|
2244
|
+
], RAWidgetContainer.prototype, "dashboardInfo", void 0);
|
|
1959
2245
|
__decorate([
|
|
1960
2246
|
core.Input('data'),
|
|
1961
2247
|
__metadata("design:type", Object)
|
|
@@ -1980,6 +2266,10 @@
|
|
|
1980
2266
|
core.Input('grid-cell-height'),
|
|
1981
2267
|
__metadata("design:type", Number)
|
|
1982
2268
|
], RAWidgetContainer.prototype, "gridCellHeight", void 0);
|
|
2269
|
+
__decorate([
|
|
2270
|
+
core.Input('bulk-action-data'),
|
|
2271
|
+
__metadata("design:type", Object)
|
|
2272
|
+
], RAWidgetContainer.prototype, "bulkActionData", void 0);
|
|
1983
2273
|
__decorate([
|
|
1984
2274
|
core.Output(),
|
|
1985
2275
|
__metadata("design:type", Object)
|
|
@@ -1988,6 +2278,14 @@
|
|
|
1988
2278
|
core.Output(),
|
|
1989
2279
|
__metadata("design:type", Object)
|
|
1990
2280
|
], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
|
|
2281
|
+
__decorate([
|
|
2282
|
+
core.Output(),
|
|
2283
|
+
__metadata("design:type", Object)
|
|
2284
|
+
], RAWidgetContainer.prototype, "dataLoaded", void 0);
|
|
2285
|
+
__decorate([
|
|
2286
|
+
core.Output(),
|
|
2287
|
+
__metadata("design:type", Object)
|
|
2288
|
+
], RAWidgetContainer.prototype, "widgetLoaded", void 0);
|
|
1991
2289
|
__decorate([
|
|
1992
2290
|
core.Input('dom-resized'),
|
|
1993
2291
|
__metadata("design:type", Boolean),
|
|
@@ -4986,11 +5284,13 @@
|
|
|
4986
5284
|
function RaBaseDashboardTemplate(ngZone) {
|
|
4987
5285
|
var _this = this;
|
|
4988
5286
|
this.ngZone = ngZone;
|
|
4989
|
-
this.initialize = function (eventBus, userDashboardId, appConfig) {
|
|
5287
|
+
this.initialize = function (eventBus, userDashboardId, appConfig, dashboardInfo, templateConfig) {
|
|
4990
5288
|
_this.ngZone.run(function () {
|
|
4991
5289
|
_this.userDashboardId = userDashboardId;
|
|
4992
5290
|
_this.appConfig = appConfig;
|
|
4993
5291
|
_this.raDashboardEventBus = eventBus;
|
|
5292
|
+
_this.dashboardInfo = dashboardInfo;
|
|
5293
|
+
_this.templateConfig = templateConfig;
|
|
4994
5294
|
});
|
|
4995
5295
|
_this.init();
|
|
4996
5296
|
};
|