logitude-dashboard-library 1.4.27 → 1.4.29
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/assets/styles/dl-dashboard.scss +69 -0
- package/dist/index.js +32 -17
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +32 -17
- package/dist/index.modern.js.map +1 -1
- package/dist/types/KpiChart.d.ts +2 -0
- package/dist/types/widget.d.ts +5 -0
- package/package.json +2 -1
|
@@ -423,6 +423,16 @@ $dark-grey: #717585;
|
|
|
423
423
|
align-items: flex-end;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
+
.dl-kpi-center-sub-container {
|
|
427
|
+
display: flex;
|
|
428
|
+
align-content: center;
|
|
429
|
+
align-items: flex-end;
|
|
430
|
+
justify-content: center;
|
|
431
|
+
position: absolute;
|
|
432
|
+
width: 95%;
|
|
433
|
+
height: 50%;
|
|
434
|
+
}
|
|
435
|
+
|
|
426
436
|
.kpIHeader {
|
|
427
437
|
font-weight: bold;
|
|
428
438
|
}
|
|
@@ -531,6 +541,17 @@ $dark-grey: #717585;
|
|
|
531
541
|
margin-bottom: 2px;
|
|
532
542
|
}
|
|
533
543
|
|
|
544
|
+
.dl-kpi-abbreviationSymbol {
|
|
545
|
+
font-family: 'Manrope';
|
|
546
|
+
font-style: normal;
|
|
547
|
+
font-weight: 630;
|
|
548
|
+
font-size: 22px;
|
|
549
|
+
line-height: 111%;
|
|
550
|
+
color: #292D30;
|
|
551
|
+
margin-left: 1px;
|
|
552
|
+
margin-bottom: 2px;
|
|
553
|
+
}
|
|
554
|
+
|
|
534
555
|
.dl-kpi-ratio-container {
|
|
535
556
|
flex-direction: row;
|
|
536
557
|
box-sizing: border-box;
|
|
@@ -574,6 +595,34 @@ $dark-grey: #717585;
|
|
|
574
595
|
align-items: flex-start;
|
|
575
596
|
}
|
|
576
597
|
|
|
598
|
+
.dl-kpi-center-prev-container {
|
|
599
|
+
display: flex;
|
|
600
|
+
align-content: center;
|
|
601
|
+
align-items: flex-end;
|
|
602
|
+
place-content: flex-end flex-start;
|
|
603
|
+
justify-content: center;
|
|
604
|
+
font-family: 'Manrope';
|
|
605
|
+
font-style: normal;
|
|
606
|
+
font-weight: 500;
|
|
607
|
+
font-size: 11px;
|
|
608
|
+
color: #A4A4A4;
|
|
609
|
+
width: 95%;
|
|
610
|
+
height: 65%;
|
|
611
|
+
position: absolute;
|
|
612
|
+
}
|
|
613
|
+
.dl-kpi-prev-container {
|
|
614
|
+
display: flex;
|
|
615
|
+
align-content: flex-start;
|
|
616
|
+
align-items: flex-end;
|
|
617
|
+
place-content: flex-end flex-start;
|
|
618
|
+
justify-content: flex-start;
|
|
619
|
+
font-family: 'Manrope';
|
|
620
|
+
font-style: normal;
|
|
621
|
+
font-weight: 500;
|
|
622
|
+
font-size: 11px;
|
|
623
|
+
color: #A4A4A4;
|
|
624
|
+
}
|
|
625
|
+
|
|
577
626
|
.dl-kpi-prev-text {
|
|
578
627
|
font-family: 'Manrope';
|
|
579
628
|
font-style: normal;
|
|
@@ -581,4 +630,24 @@ $dark-grey: #717585;
|
|
|
581
630
|
font-size: 11px;
|
|
582
631
|
line-height: 15px;
|
|
583
632
|
color: #A4A4A4;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.dl-kpi-prev-abbreviationSymbol {
|
|
636
|
+
font-family: 'Manrope';
|
|
637
|
+
font-style: normal;
|
|
638
|
+
font-weight: 500;
|
|
639
|
+
font-size: 11px;
|
|
640
|
+
//line-height: 130%;
|
|
641
|
+
color: #A4A4A4;
|
|
642
|
+
margin-left: 1px;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.dl-kpi-center-prev-text {
|
|
646
|
+
|
|
647
|
+
font-family: 'Manrope';
|
|
648
|
+
font-style: normal;
|
|
649
|
+
font-weight: 500;
|
|
650
|
+
font-size: 11px;
|
|
651
|
+
//line-height: 15px;
|
|
652
|
+
color: #A4A4A4;
|
|
584
653
|
}
|
package/dist/index.js
CHANGED
|
@@ -69,6 +69,8 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
69
69
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
var Session = function Session() {};
|
|
73
|
+
|
|
72
74
|
var Tools = /*#__PURE__*/function () {
|
|
73
75
|
function Tools() {}
|
|
74
76
|
|
|
@@ -146,7 +148,7 @@ var ApiServices = /*#__PURE__*/function () {
|
|
|
146
148
|
};
|
|
147
149
|
|
|
148
150
|
_proto.getTokenFromStorage = function getTokenFromStorage() {
|
|
149
|
-
return
|
|
151
|
+
return Session.Token || '';
|
|
150
152
|
};
|
|
151
153
|
|
|
152
154
|
_proto.ConcatFiltersToURL = function ConcatFiltersToURL(filters, urlparameters) {
|
|
@@ -202,7 +204,7 @@ var DashboardAnalyticsService = /*#__PURE__*/function () {
|
|
|
202
204
|
}();
|
|
203
205
|
|
|
204
206
|
var KpiChart = function KpiChart(props) {
|
|
205
|
-
var _widget$
|
|
207
|
+
var _widget$current12;
|
|
206
208
|
|
|
207
209
|
var _useState = React.useState(false),
|
|
208
210
|
dataLoaded = _useState[0],
|
|
@@ -304,14 +306,32 @@ var KpiChart = function KpiChart(props) {
|
|
|
304
306
|
}
|
|
305
307
|
|
|
306
308
|
function getPreviousValueComponent() {
|
|
307
|
-
var _widget$current8;
|
|
309
|
+
var _widget$current8, _widget$current9, _widget$current10;
|
|
308
310
|
|
|
309
311
|
if (!((_widget$current8 = widget.current) !== null && _widget$current8 !== void 0 && _widget$current8.TimeOverTime)) return null;
|
|
310
312
|
var prevtext = !(data !== null && data !== void 0 && data.ComparisonValue) ? '' : data === null || data === void 0 ? void 0 : data.ComparisonValue;
|
|
311
313
|
prevtext = "Previous: " + prevtext;
|
|
312
|
-
return React__default.createElement("div",
|
|
313
|
-
className: "dl-kpi-prev-
|
|
314
|
-
},
|
|
314
|
+
return React__default.createElement("div", {
|
|
315
|
+
className: ((_widget$current9 = widget.current) === null || _widget$current9 === void 0 ? void 0 : _widget$current9.Alighnment) == "Left" ? "dl-kpi-prev-container" : "dl-kpi-center-prev-container"
|
|
316
|
+
}, React__default.createElement("div", {
|
|
317
|
+
className: ((_widget$current10 = widget.current) === null || _widget$current10 === void 0 ? void 0 : _widget$current10.Alighnment) == "Left" ? "dl-kpi-prev-text" : "dl-kpi-center-prev-text"
|
|
318
|
+
}, prevtext), (data === null || data === void 0 ? void 0 : data.ComparisonAbbreviationSymbol) && React__default.createElement("div", {
|
|
319
|
+
className: "dl-kpi-prev-abbreviationSymbol"
|
|
320
|
+
}, data === null || data === void 0 ? void 0 : data.ComparisonAbbreviationSymbol));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function getAlignmentValue() {
|
|
324
|
+
var _widget$current11;
|
|
325
|
+
|
|
326
|
+
return React__default.createElement("div", {
|
|
327
|
+
className: ((_widget$current11 = widget.current) === null || _widget$current11 === void 0 ? void 0 : _widget$current11.Alighnment) == "Left" ? "dl-kpi-sub-container" : "dl-kpi-center-sub-container"
|
|
328
|
+
}, React__default.createElement("div", {
|
|
329
|
+
className: "dl-kpi-value dl-kpi-textTrimming"
|
|
330
|
+
}, data === null || data === void 0 ? void 0 : data.Value), (data === null || data === void 0 ? void 0 : data.AbbreviationSymbol) && React__default.createElement("div", {
|
|
331
|
+
className: "dl-kpi-abbreviationSymbol"
|
|
332
|
+
}, data === null || data === void 0 ? void 0 : data.AbbreviationSymbol), (data === null || data === void 0 ? void 0 : data.Unit) && React__default.createElement("div", {
|
|
333
|
+
className: "dl-kpi-unit"
|
|
334
|
+
}, data === null || data === void 0 ? void 0 : data.Unit), getRatioComponent());
|
|
315
335
|
}
|
|
316
336
|
|
|
317
337
|
return !dataLoaded ? React__default.createElement("div", {
|
|
@@ -329,15 +349,9 @@ var KpiChart = function KpiChart(props) {
|
|
|
329
349
|
}, React__default.createElement("div", {
|
|
330
350
|
className: "dl-kpi-container",
|
|
331
351
|
style: {
|
|
332
|
-
marginTop: (_widget$
|
|
352
|
+
marginTop: (_widget$current12 = widget.current) !== null && _widget$current12 !== void 0 && _widget$current12.TimeOverTime ? '7px' : '15.4px'
|
|
333
353
|
}
|
|
334
|
-
}, React__default.createElement("div", {
|
|
335
|
-
className: "dl-kpi-sub-container"
|
|
336
|
-
}, React__default.createElement("div", {
|
|
337
|
-
className: "dl-kpi-value dl-kpi-textTrimming"
|
|
338
|
-
}, data === null || data === void 0 ? void 0 : data.Value), (data === null || data === void 0 ? void 0 : data.Unit) && React__default.createElement("div", {
|
|
339
|
-
className: "dl-kpi-unit"
|
|
340
|
-
}, data === null || data === void 0 ? void 0 : data.Unit), getRatioComponent()), getPreviousValueComponent())) : React__default.createElement("div", {
|
|
354
|
+
}, getAlignmentValue(), getPreviousValueComponent())) : React__default.createElement("div", {
|
|
341
355
|
className: "dl-flex-content-center dl-full-hight",
|
|
342
356
|
style: {
|
|
343
357
|
width: '100%'
|
|
@@ -830,6 +844,7 @@ var FusionChartHelper = /*#__PURE__*/function () {
|
|
|
830
844
|
}
|
|
831
845
|
|
|
832
846
|
var reducedValue = Math.floor((1700 - window.innerWidth) / 100) + 1;
|
|
847
|
+
if (reducedValue > 5) reducedValue = 5;
|
|
833
848
|
pieRadius = pieRadius - reducedValue * 5;
|
|
834
849
|
this.pieRadius = pieRadius;
|
|
835
850
|
chartInfo.pieRadius = pieRadius + "%";
|
|
@@ -1341,8 +1356,6 @@ var layoutGridProps = {
|
|
|
1341
1356
|
};
|
|
1342
1357
|
|
|
1343
1358
|
var Dashboard = function Dashboard(props) {
|
|
1344
|
-
var _props$token;
|
|
1345
|
-
|
|
1346
1359
|
var Widgetlayouts = React.useRef({
|
|
1347
1360
|
lg: []
|
|
1348
1361
|
});
|
|
@@ -1358,6 +1371,9 @@ var Dashboard = function Dashboard(props) {
|
|
|
1358
1371
|
setIsInEditMode = _useState2[1];
|
|
1359
1372
|
|
|
1360
1373
|
React.useEffect(function () {
|
|
1374
|
+
Session.CurrentUserId = props.userId;
|
|
1375
|
+
Session.Tenant = props.tenant;
|
|
1376
|
+
Session.Token = props === null || props === void 0 ? void 0 : props.token;
|
|
1361
1377
|
props.dataBinding.onGetLayouts.subscribe(function (layouts) {
|
|
1362
1378
|
Widgetlayouts.current = layouts;
|
|
1363
1379
|
setWidgetlayoutsState(deepClone(Widgetlayouts.current));
|
|
@@ -1370,7 +1386,6 @@ var Dashboard = function Dashboard(props) {
|
|
|
1370
1386
|
setWidgetlayoutsState(deepClone(Widgetlayouts.current));
|
|
1371
1387
|
});
|
|
1372
1388
|
}, []);
|
|
1373
|
-
if ((props === null || props === void 0 ? void 0 : (_props$token = props.token) === null || _props$token === void 0 ? void 0 : _props$token.length) > 0) localStorage.setItem("token", props === null || props === void 0 ? void 0 : props.token);
|
|
1374
1389
|
|
|
1375
1390
|
var updateWidgets = function updateWidgets(layouts) {
|
|
1376
1391
|
var layoutsDic = {};
|