logitude-dashboard-library 1.2.60 → 1.2.63
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/dist/index.js +194 -105
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +195 -106
- package/dist/index.modern.js.map +1 -1
- package/dist/services/ApiServices.d.ts +1 -1
- package/dist/services/DashBoardService.d.ts +1 -1
- package/dist/services/DashboardAnalyticsService.d.ts +9 -0
- package/dist/types/ReactWidgetMeasurePM.d.ts +3 -3
- package/dist/types/SeriesMeasure.d.ts +7 -0
- package/dist/types/widget.d.ts +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,15 +33,139 @@ var Tools = /*#__PURE__*/function () {
|
|
|
33
33
|
return Tools;
|
|
34
34
|
}();
|
|
35
35
|
|
|
36
|
+
var ApiServices = /*#__PURE__*/function () {
|
|
37
|
+
function ApiServices() {
|
|
38
|
+
this._apiUrl = Tools.GetLogitudeURL();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var _proto = ApiServices.prototype;
|
|
42
|
+
|
|
43
|
+
_proto.getByFilters = function getByFilters(api, filters) {
|
|
44
|
+
var token = this.getTokenFromStorage();
|
|
45
|
+
var apiURL = "" + this._apiUrl + api;
|
|
46
|
+
apiURL = this.ConcatFiltersToURL(filters, apiURL);
|
|
47
|
+
return axios.get(apiURL, {
|
|
48
|
+
headers: {
|
|
49
|
+
'Content-Type': 'application/json',
|
|
50
|
+
'Token': token
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
_proto.get = function get(api) {
|
|
56
|
+
var token = this.getTokenFromStorage();
|
|
57
|
+
var apiURL = "" + this._apiUrl + api;
|
|
58
|
+
return axios.get(apiURL, {
|
|
59
|
+
headers: {
|
|
60
|
+
'Content-Type': 'application/json',
|
|
61
|
+
'Token': token
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
_proto.post = function post(api, date) {
|
|
67
|
+
var token = this.getTokenFromStorage();
|
|
68
|
+
var apiURL = "" + this._apiUrl + api;
|
|
69
|
+
return axios.post(apiURL, date, {
|
|
70
|
+
headers: {
|
|
71
|
+
'Content-Type': 'application/json',
|
|
72
|
+
'Token': token
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
_proto.getTokenFromStorage = function getTokenFromStorage() {
|
|
78
|
+
return window.localStorage.getItem("token") || '';
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
_proto.ConcatFiltersToURL = function ConcatFiltersToURL(filters, urlparameters) {
|
|
82
|
+
var mykeys = Object.keys(filters);
|
|
83
|
+
var addtionalFiltersValues = null;
|
|
84
|
+
|
|
85
|
+
for (var i in mykeys) {
|
|
86
|
+
var propName = mykeys[i];
|
|
87
|
+
var propValue = filters[propName];
|
|
88
|
+
var ignoreFilter = propName.indexOf("Operator") > 0 && propValue == "Equals" || propName == "AdditionalFilters";
|
|
89
|
+
|
|
90
|
+
if (urlparameters != "?") {
|
|
91
|
+
urlparameters = urlparameters.concat('&');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!ignoreFilter) {
|
|
95
|
+
propValue = propValue ? encodeURIComponent(propValue) : '';
|
|
96
|
+
urlparameters = urlparameters.concat(propName.concat('=').concat(propValue));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (propName == "AdditionalFilters" && propValue.length > 0) {
|
|
100
|
+
addtionalFiltersValues = JSON.stringify(propValue);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (addtionalFiltersValues) {
|
|
105
|
+
urlparameters = urlparameters.concat("&AdditionalFilters=").concat(addtionalFiltersValues);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return urlparameters;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return ApiServices;
|
|
112
|
+
}();
|
|
113
|
+
|
|
114
|
+
var DashboardAnalyticsService = /*#__PURE__*/function () {
|
|
115
|
+
function DashboardAnalyticsService() {
|
|
116
|
+
this.controller = 'DashboardAnalytics';
|
|
117
|
+
this._ApiServices = new ApiServices();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
var _proto = DashboardAnalyticsService.prototype;
|
|
121
|
+
|
|
122
|
+
_proto.getData = function getData(widget) {
|
|
123
|
+
return this._ApiServices.post("/api/" + this.controller + "/PostGetDataAnalytic", widget);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return DashboardAnalyticsService;
|
|
127
|
+
}();
|
|
128
|
+
|
|
36
129
|
var ApexChart = function ApexChart(props) {
|
|
37
130
|
var _props$widget2;
|
|
38
131
|
|
|
39
|
-
var
|
|
132
|
+
var _useState = React.useState({
|
|
133
|
+
series: [],
|
|
134
|
+
options: {}
|
|
135
|
+
}),
|
|
136
|
+
args = _useState[0],
|
|
137
|
+
serArgs = _useState[1];
|
|
138
|
+
|
|
139
|
+
React.useEffect(function () {
|
|
140
|
+
var dashboardAnalyticsService = new DashboardAnalyticsService();
|
|
141
|
+
dashboardAnalyticsService.getData(props.widget).then(function (result) {
|
|
142
|
+
var data = getChartOptions(result.data);
|
|
143
|
+
serArgs(data);
|
|
144
|
+
});
|
|
145
|
+
}, []);
|
|
146
|
+
|
|
147
|
+
var lineOptoins = function lineOptoins(values) {
|
|
148
|
+
var series = [];
|
|
149
|
+
var categories = [];
|
|
150
|
+
|
|
151
|
+
if (values && values[0]) {
|
|
152
|
+
var s = values[0].SeriesMeasureVulues.map(function (z) {
|
|
153
|
+
return z.Value;
|
|
154
|
+
});
|
|
155
|
+
series = values.map(function (e) {
|
|
156
|
+
return {
|
|
157
|
+
data: e.SeriesMeasureVulues.map(function (z) {
|
|
158
|
+
return z.Value;
|
|
159
|
+
})
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
categories = values[0].SeriesMeasureVulues.map(function (e) {
|
|
163
|
+
return e.Label;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
40
167
|
return {
|
|
41
|
-
series:
|
|
42
|
-
name: "Desktops",
|
|
43
|
-
data: [10, 41, 35, 51, 49, 62, 69, 91, 148]
|
|
44
|
-
}],
|
|
168
|
+
series: series,
|
|
45
169
|
options: {
|
|
46
170
|
chart: {
|
|
47
171
|
height: 350,
|
|
@@ -67,19 +191,36 @@ var ApexChart = function ApexChart(props) {
|
|
|
67
191
|
}
|
|
68
192
|
},
|
|
69
193
|
xaxis: {
|
|
70
|
-
categories:
|
|
194
|
+
categories: categories
|
|
71
195
|
}
|
|
72
196
|
}
|
|
73
197
|
};
|
|
74
198
|
};
|
|
75
199
|
|
|
76
|
-
var barOptoins = function barOptoins() {
|
|
200
|
+
var barOptoins = function barOptoins(values) {
|
|
201
|
+
var series = [{
|
|
202
|
+
data: []
|
|
203
|
+
}];
|
|
204
|
+
var categories = [];
|
|
205
|
+
|
|
206
|
+
if (values && values[0]) {
|
|
207
|
+
var s = values[0].SeriesMeasureVulues.map(function (z) {
|
|
208
|
+
return z.Value;
|
|
209
|
+
});
|
|
210
|
+
series = values.map(function (e) {
|
|
211
|
+
return {
|
|
212
|
+
data: e.SeriesMeasureVulues.map(function (z) {
|
|
213
|
+
return z.Value;
|
|
214
|
+
})
|
|
215
|
+
};
|
|
216
|
+
});
|
|
217
|
+
categories = values[0].SeriesMeasureVulues.map(function (e) {
|
|
218
|
+
return e.Label;
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
77
222
|
return {
|
|
78
|
-
series:
|
|
79
|
-
data: [44, 55, 41, 64, 22, 43, 21]
|
|
80
|
-
}, {
|
|
81
|
-
data: [53, 32, 33, 52, 13, 44, 32]
|
|
82
|
-
}],
|
|
223
|
+
series: series,
|
|
83
224
|
options: {
|
|
84
225
|
chart: {
|
|
85
226
|
type: 'bar',
|
|
@@ -111,27 +252,51 @@ var ApexChart = function ApexChart(props) {
|
|
|
111
252
|
intersect: false
|
|
112
253
|
},
|
|
113
254
|
xaxis: {
|
|
114
|
-
categories:
|
|
255
|
+
categories: categories
|
|
115
256
|
}
|
|
116
257
|
}
|
|
117
258
|
};
|
|
118
259
|
};
|
|
119
260
|
|
|
120
|
-
var pieOptoins = function pieOptoins() {
|
|
261
|
+
var pieOptoins = function pieOptoins(values) {
|
|
262
|
+
var series = [];
|
|
263
|
+
var labels = [];
|
|
264
|
+
|
|
265
|
+
if (values && values[0]) {
|
|
266
|
+
series = values[0].SeriesMeasureVulues.map(function (e) {
|
|
267
|
+
return e.Value;
|
|
268
|
+
});
|
|
269
|
+
labels = values[0].SeriesMeasureVulues.map(function (e) {
|
|
270
|
+
return e.Label;
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
121
274
|
return {
|
|
122
|
-
series:
|
|
275
|
+
series: series,
|
|
123
276
|
options: {
|
|
124
277
|
chart: {
|
|
125
278
|
type: 'pie'
|
|
126
279
|
},
|
|
127
|
-
labels:
|
|
280
|
+
labels: labels
|
|
128
281
|
}
|
|
129
282
|
};
|
|
130
283
|
};
|
|
131
284
|
|
|
132
|
-
var donutOptoins = function donutOptoins() {
|
|
285
|
+
var donutOptoins = function donutOptoins(values) {
|
|
286
|
+
var series = [];
|
|
287
|
+
var labels = [];
|
|
288
|
+
|
|
289
|
+
if (values && values[0]) {
|
|
290
|
+
series = values[0].SeriesMeasureVulues.map(function (e) {
|
|
291
|
+
return e.Value;
|
|
292
|
+
});
|
|
293
|
+
labels = values[0].SeriesMeasureVulues.map(function (e) {
|
|
294
|
+
return e.Label;
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
|
|
133
298
|
return {
|
|
134
|
-
series:
|
|
299
|
+
series: series,
|
|
135
300
|
options: {
|
|
136
301
|
chart: {
|
|
137
302
|
width: 380,
|
|
@@ -155,32 +320,32 @@ var ApexChart = function ApexChart(props) {
|
|
|
155
320
|
position: 'right',
|
|
156
321
|
offsetY: 0,
|
|
157
322
|
height: 230
|
|
158
|
-
}
|
|
323
|
+
},
|
|
324
|
+
labels: labels
|
|
159
325
|
}
|
|
160
326
|
};
|
|
161
327
|
};
|
|
162
328
|
|
|
163
|
-
var getChartOptions = function getChartOptions() {
|
|
329
|
+
var getChartOptions = function getChartOptions(values) {
|
|
164
330
|
var _props$widget;
|
|
165
331
|
|
|
166
332
|
switch ((_props$widget = props.widget) === null || _props$widget === void 0 ? void 0 : _props$widget.TypeCode) {
|
|
167
333
|
case 'bar':
|
|
168
|
-
return barOptoins();
|
|
334
|
+
return barOptoins(values);
|
|
169
335
|
|
|
170
336
|
case 'line':
|
|
171
|
-
return lineOptoins();
|
|
337
|
+
return lineOptoins(values);
|
|
172
338
|
|
|
173
339
|
case 'pie':
|
|
174
|
-
return pieOptoins();
|
|
340
|
+
return pieOptoins(values);
|
|
175
341
|
|
|
176
342
|
case 'donut':
|
|
177
|
-
return donutOptoins();
|
|
343
|
+
return donutOptoins(values);
|
|
178
344
|
}
|
|
179
345
|
|
|
180
|
-
return barOptoins();
|
|
346
|
+
return barOptoins(values);
|
|
181
347
|
};
|
|
182
348
|
|
|
183
|
-
var args = getChartOptions();
|
|
184
349
|
return React__default.createElement(ReactApexChart, {
|
|
185
350
|
options: args === null || args === void 0 ? void 0 : args.options,
|
|
186
351
|
series: args === null || args === void 0 ? void 0 : args.series,
|
|
@@ -329,6 +494,7 @@ var DashboardDesigner = function DashboardDesigner(props) {
|
|
|
329
494
|
}
|
|
330
495
|
|
|
331
496
|
function editWidget(widget) {
|
|
497
|
+
widget.ChangeSetOp = 'Update';
|
|
332
498
|
props.openEditWidget(widget);
|
|
333
499
|
}
|
|
334
500
|
|
|
@@ -406,84 +572,6 @@ var layoutGridProps = {
|
|
|
406
572
|
useCSSTransforms: true
|
|
407
573
|
};
|
|
408
574
|
|
|
409
|
-
var ApiServices = /*#__PURE__*/function () {
|
|
410
|
-
function ApiServices() {
|
|
411
|
-
this._apiUrl = Tools.GetLogitudeURL();
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
var _proto = ApiServices.prototype;
|
|
415
|
-
|
|
416
|
-
_proto.getByFilters = function getByFilters(api, filters) {
|
|
417
|
-
var token = this.getTokenFromStorage();
|
|
418
|
-
var apiURL = "" + this._apiUrl + api;
|
|
419
|
-
apiURL = this.ConcatFiltersToURL(filters, apiURL);
|
|
420
|
-
return axios.get(apiURL, {
|
|
421
|
-
headers: {
|
|
422
|
-
'Content-Type': 'application/json',
|
|
423
|
-
'Token': token
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
_proto.get = function get(api) {
|
|
429
|
-
var token = this.getTokenFromStorage();
|
|
430
|
-
var apiURL = "" + this._apiUrl + api;
|
|
431
|
-
return axios.get(apiURL, {
|
|
432
|
-
headers: {
|
|
433
|
-
'Content-Type': 'application/json',
|
|
434
|
-
'Token': token
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
_proto.post = function post(api, date) {
|
|
440
|
-
var token = this.getTokenFromStorage();
|
|
441
|
-
var apiURL = "" + this._apiUrl + api;
|
|
442
|
-
return axios.post(apiURL, date, {
|
|
443
|
-
headers: {
|
|
444
|
-
'Content-Type': 'application/json',
|
|
445
|
-
'Token': token
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
_proto.getTokenFromStorage = function getTokenFromStorage() {
|
|
451
|
-
return window.localStorage.getItem("token") || '';
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
_proto.ConcatFiltersToURL = function ConcatFiltersToURL(filters, urlparameters) {
|
|
455
|
-
var mykeys = Object.keys(filters);
|
|
456
|
-
var addtionalFiltersValues = null;
|
|
457
|
-
|
|
458
|
-
for (var i in mykeys) {
|
|
459
|
-
var propName = mykeys[i];
|
|
460
|
-
var propValue = filters[propName];
|
|
461
|
-
var ignoreFilter = propName.indexOf("Operator") > 0 && propValue == "Equals" || propName == "AdditionalFilters";
|
|
462
|
-
|
|
463
|
-
if (urlparameters != "?") {
|
|
464
|
-
urlparameters = urlparameters.concat('&');
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
if (!ignoreFilter) {
|
|
468
|
-
propValue = propValue ? encodeURIComponent(propValue) : '';
|
|
469
|
-
urlparameters = urlparameters.concat(propName.concat('=').concat(propValue));
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
if (propName == "AdditionalFilters" && propValue.length > 0) {
|
|
473
|
-
addtionalFiltersValues = JSON.stringify(propValue);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
if (addtionalFiltersValues) {
|
|
478
|
-
urlparameters = urlparameters.concat("&AdditionalFilters=").concat(addtionalFiltersValues);
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
return urlparameters;
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
return ApiServices;
|
|
485
|
-
}();
|
|
486
|
-
|
|
487
575
|
var DashBoardService = /*#__PURE__*/function () {
|
|
488
576
|
function DashBoardService() {
|
|
489
577
|
this.tableName = 'DashBoard';
|
|
@@ -604,7 +692,8 @@ var Dashboard = function Dashboard(props) {
|
|
|
604
692
|
props.openAddEditWidget({
|
|
605
693
|
TypeCode: widgetCode,
|
|
606
694
|
StartPotistion: position.x + "," + position.y,
|
|
607
|
-
EndPosition: position.w + "," + position.h
|
|
695
|
+
EndPosition: position.w + "," + position.h,
|
|
696
|
+
ChangeSetOp: 'Insert'
|
|
608
697
|
});
|
|
609
698
|
};
|
|
610
699
|
|