logitude-dashboard-library 1.4.8 → 1.4.10
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 +86 -40
- package/dist/index.js +11 -88
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +11 -88
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ $dark-grey: #717585;
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.spinner-custome {
|
|
51
|
-
|
|
51
|
+
width: 100%;
|
|
52
52
|
@keyframes p-progress-spinner-color {
|
|
53
53
|
|
|
54
54
|
100%,
|
|
@@ -144,10 +144,6 @@ $dark-grey: #717585;
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
.dl-custom-btn {
|
|
148
|
-
.p-button.p-button-lg {}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
147
|
.dl-relativ-container {
|
|
152
148
|
|
|
153
149
|
position: relative;
|
|
@@ -289,18 +285,24 @@ $dark-grey: #717585;
|
|
|
289
285
|
background-color: lightblue;
|
|
290
286
|
}
|
|
291
287
|
|
|
292
|
-
.panel {
|
|
288
|
+
.dl-panel {
|
|
293
289
|
background: white !important;
|
|
294
290
|
box-shadow: 0px 0px 3px 1px #6273842b;
|
|
295
291
|
box-sizing: border-box;
|
|
296
292
|
position: relative;
|
|
297
293
|
height: 100%;
|
|
294
|
+
flex-direction: column;
|
|
295
|
+
box-sizing: border-box;
|
|
296
|
+
display: flex;
|
|
297
|
+
place-content: flex-start;
|
|
298
|
+
align-items: flex-start;
|
|
298
299
|
|
|
299
300
|
header {
|
|
300
301
|
display: flex;
|
|
301
302
|
justify-content: space-between;
|
|
302
303
|
align-items: center;
|
|
303
304
|
position: unset;
|
|
305
|
+
width: 100%;
|
|
304
306
|
|
|
305
307
|
i {
|
|
306
308
|
font-size: 18px;
|
|
@@ -310,7 +312,6 @@ $dark-grey: #717585;
|
|
|
310
312
|
|
|
311
313
|
h1 {
|
|
312
314
|
text-transform: capitalize;
|
|
313
|
-
font-size: 15px;
|
|
314
315
|
font-family: 'Manrope', sans-serif;
|
|
315
316
|
font-style: normal;
|
|
316
317
|
color: #292D30;
|
|
@@ -342,8 +343,13 @@ $dark-grey: #717585;
|
|
|
342
343
|
|
|
343
344
|
|
|
344
345
|
.dl-dashboard-widget {
|
|
345
|
-
height:
|
|
346
|
-
|
|
346
|
+
height: 100%;
|
|
347
|
+
width: 100%;
|
|
348
|
+
position: relative;
|
|
349
|
+
flex-direction: column;
|
|
350
|
+
display: flex;
|
|
351
|
+
place-content: flex-start;
|
|
352
|
+
align-items: flex-start;
|
|
347
353
|
}
|
|
348
354
|
|
|
349
355
|
|
|
@@ -436,15 +442,23 @@ $dark-grey: #717585;
|
|
|
436
442
|
}
|
|
437
443
|
|
|
438
444
|
|
|
439
|
-
.
|
|
445
|
+
.dl-kpi-container-click {
|
|
440
446
|
width: 100%;
|
|
441
447
|
height: 100%;
|
|
448
|
+
cursor: pointer;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.dl-kpi-container {
|
|
452
|
+
margin-left: 12px;
|
|
453
|
+
margin-right: 12px;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.dl-kpi-sub-container {
|
|
442
457
|
flex-direction: row;
|
|
443
458
|
box-sizing: border-box;
|
|
444
|
-
display:
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
459
|
+
display: flex;
|
|
460
|
+
place-content: flex-end flex-start;
|
|
461
|
+
align-items: flex-end;
|
|
448
462
|
}
|
|
449
463
|
|
|
450
464
|
.kpIHeader {
|
|
@@ -457,7 +471,8 @@ $dark-grey: #717585;
|
|
|
457
471
|
|
|
458
472
|
.db-fc-container {
|
|
459
473
|
width: 100%;
|
|
460
|
-
height: 100
|
|
474
|
+
height: calc(100% - 5px);
|
|
475
|
+
padding-top: 12px;
|
|
461
476
|
}
|
|
462
477
|
|
|
463
478
|
.db-fc-container>*:first-child {
|
|
@@ -469,50 +484,59 @@ $dark-grey: #717585;
|
|
|
469
484
|
border-top: 1px solid #E7E7E7;
|
|
470
485
|
margin-left: 12px;
|
|
471
486
|
margin-right: 12px;
|
|
472
|
-
|
|
487
|
+
position: relative;
|
|
473
488
|
}
|
|
474
489
|
|
|
475
490
|
.dl-kpi-arrow-pic {
|
|
476
|
-
|
|
477
491
|
display: inline-block;
|
|
478
492
|
vertical-align: middle;
|
|
479
493
|
width: 0;
|
|
480
494
|
height: 0;
|
|
481
495
|
}
|
|
482
496
|
|
|
483
|
-
.dl-kpi-arrow-up {
|
|
497
|
+
.dl-kpi-arrow-up-green {
|
|
484
498
|
border-left: 5px solid transparent;
|
|
485
499
|
border-right: 5px solid transparent;
|
|
486
|
-
border-bottom:
|
|
500
|
+
border-bottom: 6px solid #4AC76F;
|
|
487
501
|
}
|
|
488
502
|
|
|
489
|
-
.dl-kpi-arrow-down {
|
|
503
|
+
.dl-kpi-arrow-down-green {
|
|
490
504
|
border-left: 5px solid transparent;
|
|
491
505
|
border-right: 5px solid transparent;
|
|
492
|
-
border-top:
|
|
506
|
+
border-top: 6px solid #4AC76F;
|
|
493
507
|
}
|
|
494
508
|
|
|
495
|
-
.dl-kpi-
|
|
496
|
-
|
|
497
|
-
|
|
509
|
+
.dl-kpi-arrow-up-red {
|
|
510
|
+
border-left: 5px solid transparent;
|
|
511
|
+
border-right: 5px solid transparent;
|
|
512
|
+
border-bottom: 6px solid red;
|
|
498
513
|
}
|
|
499
514
|
|
|
500
|
-
.dl-kpi-
|
|
501
|
-
|
|
515
|
+
.dl-kpi-arrow-down-red {
|
|
516
|
+
border-left: 5px solid transparent;
|
|
517
|
+
border-right: 5px solid transparent;
|
|
518
|
+
border-top: 6px solid red;
|
|
502
519
|
}
|
|
503
520
|
|
|
504
|
-
.dl-kpi-value{
|
|
505
|
-
height: 31px;
|
|
506
521
|
|
|
522
|
+
.dl-kpi-arrow-container {
|
|
523
|
+
flex-direction: column;
|
|
524
|
+
box-sizing: border-box;
|
|
525
|
+
display: flex;
|
|
526
|
+
place-content: flex-start flex-end;
|
|
527
|
+
align-items: flex-start;
|
|
528
|
+
margin-bottom: 2px;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.dl-kpi-value {
|
|
507
532
|
font-family: 'Manrope';
|
|
508
533
|
font-style: normal;
|
|
509
534
|
font-weight: 700;
|
|
510
535
|
font-size: 26px;
|
|
511
536
|
line-height: 120%;
|
|
512
537
|
color: #292D30;
|
|
513
|
-
padding-left: 12px;
|
|
514
|
-
|
|
515
538
|
}
|
|
539
|
+
|
|
516
540
|
.dl-kpi-unit {
|
|
517
541
|
font-family: 'Manrope';
|
|
518
542
|
font-style: normal;
|
|
@@ -520,27 +544,49 @@ $dark-grey: #717585;
|
|
|
520
544
|
font-size: 20px;
|
|
521
545
|
line-height: 125%;
|
|
522
546
|
color: #292D30;
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
547
|
+
margin-left: 4.5px;
|
|
548
|
+
margin-bottom: 2px;
|
|
526
549
|
}
|
|
527
550
|
|
|
528
|
-
.dl-kpi-ratio {
|
|
529
|
-
|
|
551
|
+
.dl-kpi-ratio-container {
|
|
552
|
+
flex-direction: row;
|
|
553
|
+
box-sizing: border-box;
|
|
554
|
+
display: flex;
|
|
555
|
+
place-content: flex-end flex-start;
|
|
556
|
+
align-items: flex-end;
|
|
530
557
|
font-family: 'Manrope';
|
|
531
558
|
font-style: normal;
|
|
532
559
|
font-weight: 500;
|
|
533
560
|
font-size: 11px;
|
|
534
561
|
line-height: 15px;
|
|
535
|
-
text-align: right;
|
|
536
|
-
|
|
537
562
|
color: #A4A4A4;
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
563
|
+
margin-left: 4.5px;
|
|
564
|
+
margin-bottom: 4px;
|
|
565
|
+
flex-shrink: 0;
|
|
541
566
|
}
|
|
567
|
+
|
|
542
568
|
.dl-kpi-textTrimming {
|
|
543
569
|
overflow: hidden;
|
|
544
570
|
white-space: nowrap;
|
|
545
571
|
text-overflow: ellipsis;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.dl-custom-chart-container {
|
|
575
|
+
position: relative;
|
|
576
|
+
height: 100%;
|
|
577
|
+
width: 100%;
|
|
578
|
+
flex-direction: column;
|
|
579
|
+
box-sizing: border-box;
|
|
580
|
+
display: flex;
|
|
581
|
+
place-content: flex-start;
|
|
582
|
+
align-items: flex-start;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.dl-kpi-prev-text {
|
|
586
|
+
font-family: 'Manrope';
|
|
587
|
+
font-style: normal;
|
|
588
|
+
font-weight: 600;
|
|
589
|
+
font-size: 11px;
|
|
590
|
+
line-height: 15px;
|
|
591
|
+
color: #292D30;
|
|
546
592
|
}
|
package/dist/index.js
CHANGED
|
@@ -203,29 +203,16 @@ var DashboardAnalyticsService = /*#__PURE__*/function () {
|
|
|
203
203
|
|
|
204
204
|
var KpiChart = function KpiChart(props) {
|
|
205
205
|
var _useState = React.useState(false),
|
|
206
|
-
dataLoaded = _useState[0],
|
|
207
206
|
setDataLoaded = _useState[1];
|
|
208
207
|
|
|
209
208
|
var _useState2 = React.useState(),
|
|
210
|
-
error = _useState2[0],
|
|
211
209
|
setError = _useState2[1];
|
|
212
210
|
|
|
213
211
|
var widget = React.useRef();
|
|
214
212
|
|
|
215
213
|
var _useState3 = React.useState(),
|
|
216
|
-
data = _useState3[0],
|
|
217
214
|
setData = _useState3[1];
|
|
218
215
|
|
|
219
|
-
var _useState4 = React.useState(),
|
|
220
|
-
arrowColorDirection = _useState4[0],
|
|
221
|
-
setArrowColorDirection = _useState4[1];
|
|
222
|
-
|
|
223
|
-
var _useState5 = React.useState(false),
|
|
224
|
-
checkValuesValidity = _useState5[0],
|
|
225
|
-
setCheckValuesValidity = _useState5[1];
|
|
226
|
-
|
|
227
|
-
var _useState6 = React.useState(false),
|
|
228
|
-
setVisibilityUnit = _useState6[1];
|
|
229
216
|
React.useEffect(function () {
|
|
230
217
|
widget.current = props.customChartProps.widget;
|
|
231
218
|
setDataLoaded(false);
|
|
@@ -243,9 +230,6 @@ var KpiChart = function KpiChart(props) {
|
|
|
243
230
|
dashboardAnalyticsService.getKpiData(postWidget).then(function (result) {
|
|
244
231
|
setData(result.data);
|
|
245
232
|
setDataLoaded(true);
|
|
246
|
-
setTimeOverTimeImage(result.data);
|
|
247
|
-
checkValues(result.data);
|
|
248
|
-
checkUnitVisible(result.data);
|
|
249
233
|
}, function (error) {
|
|
250
234
|
var _error$response, _error$response$data, _error$response2, _error$response2$data;
|
|
251
235
|
|
|
@@ -255,79 +239,16 @@ var KpiChart = function KpiChart(props) {
|
|
|
255
239
|
});
|
|
256
240
|
};
|
|
257
241
|
|
|
258
|
-
|
|
259
|
-
var _widget$current, _widget$current2, _widget$current2$Widg;
|
|
260
|
-
|
|
261
|
-
var measureFieldId;
|
|
262
|
-
if (widget !== null && widget !== void 0 && (_widget$current = widget.current) !== null && _widget$current !== void 0 && _widget$current.WidgetMeasures) measureFieldId = widget === null || widget === void 0 ? void 0 : (_widget$current2 = widget.current) === null || _widget$current2 === void 0 ? void 0 : (_widget$current2$Widg = _widget$current2.WidgetMeasures[0]) === null || _widget$current2$Widg === void 0 ? void 0 : _widget$current2$Widg.MeasureFieldId;
|
|
263
|
-
props.customChartProps.onSelectDataPoint({
|
|
264
|
-
MeasureFieldId: measureFieldId,
|
|
265
|
-
Widget: widget.current
|
|
266
|
-
});
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
var setTimeOverTimeImage = function setTimeOverTimeImage(data) {
|
|
270
|
-
var _widget$current3;
|
|
271
|
-
|
|
272
|
-
if (!(widget !== null && widget !== void 0 && (_widget$current3 = widget.current) !== null && _widget$current3 !== void 0 && _widget$current3.TimeOverTime)) return;
|
|
273
|
-
var ratio = data === null || data === void 0 ? void 0 : data.Ratio;
|
|
274
|
-
if (!ratio) return;
|
|
275
|
-
if (ratio >= 1) setArrowColorDirection(React__default.createElement("span", {
|
|
276
|
-
className: "dl-kpi-arrow-pic dl-kpi-arrow-up"
|
|
277
|
-
}));else if (ratio < 1) setArrowColorDirection(React__default.createElement("span", {
|
|
278
|
-
className: "dl-kpi-arrow-pic dl-kpi-arrow-down"
|
|
279
|
-
}));
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
var checkValues = function checkValues(data) {
|
|
283
|
-
var _widget$current4, _widget$current5;
|
|
284
|
-
|
|
285
|
-
setCheckValuesValidity(false);
|
|
286
|
-
if (!(widget !== null && widget !== void 0 && (_widget$current4 = widget.current) !== null && _widget$current4 !== void 0 && _widget$current4.TimeOverTime)) return;
|
|
287
|
-
if (widget !== null && widget !== void 0 && (_widget$current5 = widget.current) !== null && _widget$current5 !== void 0 && _widget$current5.TimeOverTime && ((data === null || data === void 0 ? void 0 : data.ComparisonValue) === 0 || (data === null || data === void 0 ? void 0 : data.ComparisonValue) === null) && ((data === null || data === void 0 ? void 0 : data.Value) === 0 || (data === null || data === void 0 ? void 0 : data.Value) === null)) return;
|
|
288
|
-
setCheckValuesValidity(true);
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
var checkUnitVisible = function checkUnitVisible(data) {
|
|
292
|
-
var _widget$current6;
|
|
293
|
-
|
|
294
|
-
setVisibilityUnit(false);
|
|
295
|
-
if (!(widget !== null && widget !== void 0 && (_widget$current6 = widget.current) !== null && _widget$current6 !== void 0 && _widget$current6.TimeOverTime) || (data === null || data === void 0 ? void 0 : data.ComparisonValue) == 0 || (data === null || data === void 0 ? void 0 : data.ComparisonValue) === null) return;
|
|
296
|
-
setVisibilityUnit(true);
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
return !dataLoaded ? React__default.createElement("div", {
|
|
242
|
+
return React__default.createElement("div", {
|
|
300
243
|
className: 'dl-full-hight dl-flex-content-center spinner-custome'
|
|
301
244
|
}, React__default.createElement(progressspinner.ProgressSpinner, {
|
|
302
245
|
style: {
|
|
303
|
-
width: '
|
|
304
|
-
height: '
|
|
246
|
+
width: '40px',
|
|
247
|
+
height: '40px'
|
|
305
248
|
},
|
|
306
249
|
strokeWidth: "4",
|
|
307
250
|
animationDuration: "2s"
|
|
308
|
-
}))
|
|
309
|
-
className: "kpIcontainer",
|
|
310
|
-
onClick: kpiClick
|
|
311
|
-
}, React__default.createElement("div", {
|
|
312
|
-
className: "dl-kpi-same-line"
|
|
313
|
-
}, React__default.createElement("div", {
|
|
314
|
-
className: "dl-kpi-value dl-kpi-textTrimming"
|
|
315
|
-
}, data === null || data === void 0 ? void 0 : data.Value), React__default.createElement("div", {
|
|
316
|
-
className: "dl-kpi-unit"
|
|
317
|
-
}, (data === null || data === void 0 ? void 0 : data.Value) != 0 && (data === null || data === void 0 ? void 0 : data.Unit)), checkValuesValidity ? React__default.createElement("div", {
|
|
318
|
-
className: "dl-kpi-same-line dl-kpi-ratio"
|
|
319
|
-
}, React__default.createElement("div", {
|
|
320
|
-
className: "dl-kpi-margin"
|
|
321
|
-
}, arrowColorDirection), React__default.createElement("div", null, data === null || data === void 0 ? void 0 : data.Ratio, " %")) : null)) : React__default.createElement("div", {
|
|
322
|
-
className: "dl-flex-content-center dl-full-hight "
|
|
323
|
-
}, React__default.createElement("div", {
|
|
324
|
-
className: "dl-tooltip"
|
|
325
|
-
}, React__default.createElement("img", {
|
|
326
|
-
width: 100,
|
|
327
|
-
src: "https://www.seekpng.com/png/full/334-3345964_error-icon-png.png"
|
|
328
|
-
}), React__default.createElement("span", {
|
|
329
|
-
className: "dl-tooltiptext"
|
|
330
|
-
}, error)));
|
|
251
|
+
}));
|
|
331
252
|
};
|
|
332
253
|
|
|
333
254
|
var CustomChart = function CustomChart(props) {
|
|
@@ -346,9 +267,7 @@ var CustomChart = function CustomChart(props) {
|
|
|
346
267
|
};
|
|
347
268
|
|
|
348
269
|
return React__default.createElement("div", {
|
|
349
|
-
|
|
350
|
-
height: '100%'
|
|
351
|
-
}
|
|
270
|
+
className: "dl-custom-chart-container"
|
|
352
271
|
}, project());
|
|
353
272
|
};
|
|
354
273
|
|
|
@@ -757,7 +676,7 @@ var WidgetCard = function WidgetCard(props, state) {
|
|
|
757
676
|
});
|
|
758
677
|
}, []);
|
|
759
678
|
return React__default.createElement("div", {
|
|
760
|
-
className: "panel",
|
|
679
|
+
className: "dl-panel",
|
|
761
680
|
key: props.el.i,
|
|
762
681
|
style: {
|
|
763
682
|
cursor: props.isInEditMode ? 'move' : 'default'
|
|
@@ -807,8 +726,12 @@ var WidgetCard = function WidgetCard(props, state) {
|
|
|
807
726
|
return props.deleteBtnClicked((_props$widget = props.widget) === null || _props$widget === void 0 ? void 0 : _props$widget.key);
|
|
808
727
|
}
|
|
809
728
|
}, "Remove")))), React__default.createElement("div", {
|
|
729
|
+
style: {
|
|
730
|
+
width: '100%'
|
|
731
|
+
}
|
|
732
|
+
}, React__default.createElement("div", {
|
|
810
733
|
className: "dl-line"
|
|
811
|
-
}), React__default.createElement("div", {
|
|
734
|
+
})), React__default.createElement("div", {
|
|
812
735
|
className: "dl-dashboard-widget"
|
|
813
736
|
}, " ", GetChartComponent(), " "));
|
|
814
737
|
|