logitude-dashboard-library 1.4.63 → 1.4.65
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 +24 -9
- package/dist/features/Dashboard/ChartsComponents/CustomCharts/CustomChart.d.ts +1 -0
- package/dist/features/Dashboard/ChartsComponents/FusionCharts/FusionChartTooltip.d.ts +2 -1
- package/dist/features/Dashboard/WidgetCard.d.ts +1 -0
- package/dist/index.js +43 -13
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +43 -13
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -275,7 +275,8 @@ $dark-grey: #717585;
|
|
|
275
275
|
display: flex;
|
|
276
276
|
flex-wrap: wrap;
|
|
277
277
|
width: calc(100% - 70px);
|
|
278
|
-
padding: 0px 12px
|
|
278
|
+
padding: 0px 12px 6px 12px;
|
|
279
|
+
min-height: 28px;
|
|
279
280
|
|
|
280
281
|
.title-container {
|
|
281
282
|
display: flex;
|
|
@@ -292,7 +293,8 @@ $dark-grey: #717585;
|
|
|
292
293
|
font-family: 'Manrope', sans-serif;
|
|
293
294
|
font-style: normal;
|
|
294
295
|
color: #292D30;
|
|
295
|
-
padding-top:
|
|
296
|
+
padding-top: 6px;
|
|
297
|
+
line-height: 100%;
|
|
296
298
|
margin-top: 0;
|
|
297
299
|
margin-bottom: 0;
|
|
298
300
|
font-size: 12px;
|
|
@@ -308,7 +310,8 @@ $dark-grey: #717585;
|
|
|
308
310
|
font-family: 'Manrope', sans-serif;
|
|
309
311
|
font-style: normal;
|
|
310
312
|
color: #292D30;
|
|
311
|
-
margin-top:
|
|
313
|
+
margin-top: 2px;
|
|
314
|
+
line-height: 100%;
|
|
312
315
|
font-size: 12px;
|
|
313
316
|
font-weight: 600;
|
|
314
317
|
white-space: nowrap;
|
|
@@ -336,6 +339,14 @@ $dark-grey: #717585;
|
|
|
336
339
|
}
|
|
337
340
|
}
|
|
338
341
|
|
|
342
|
+
.kpi-custom-size {
|
|
343
|
+
-webkit-transform: scale(0.7);
|
|
344
|
+
-ms-transform: scale(0.7);
|
|
345
|
+
-o-transform: scale(0.7);
|
|
346
|
+
transform: scale(0.7);
|
|
347
|
+
margin-top: -4px;
|
|
348
|
+
}
|
|
349
|
+
|
|
339
350
|
.margin-top-6 {
|
|
340
351
|
margin-top: 6px;
|
|
341
352
|
}
|
|
@@ -467,6 +478,9 @@ $dark-grey: #717585;
|
|
|
467
478
|
|
|
468
479
|
|
|
469
480
|
.dl-kpi-container-click {
|
|
481
|
+
display: flex;
|
|
482
|
+
align-items: center;
|
|
483
|
+
justify-content: center;
|
|
470
484
|
width: 100%;
|
|
471
485
|
height: 100%;
|
|
472
486
|
cursor: pointer;
|
|
@@ -484,12 +498,12 @@ $dark-grey: #717585;
|
|
|
484
498
|
margin-left: 12px;
|
|
485
499
|
margin-right: 12px;
|
|
486
500
|
max-width: calc(100% - 24px);
|
|
487
|
-
height:
|
|
501
|
+
height: 100%;
|
|
488
502
|
flex-direction: column;
|
|
489
503
|
box-sizing: border-box;
|
|
490
504
|
display: flex;
|
|
491
|
-
place-content: flex-start center;
|
|
492
505
|
align-items: center;
|
|
506
|
+
justify-content: center;
|
|
493
507
|
}
|
|
494
508
|
|
|
495
509
|
.dl-kpi-center-container {
|
|
@@ -511,10 +525,7 @@ $dark-grey: #717585;
|
|
|
511
525
|
}
|
|
512
526
|
|
|
513
527
|
.dl-kpi-label-container{
|
|
514
|
-
|
|
515
|
-
display: flex;
|
|
516
|
-
justify-content: center;
|
|
517
|
-
align-items: center;
|
|
528
|
+
line-height: 100%;
|
|
518
529
|
}
|
|
519
530
|
|
|
520
531
|
.dl-kpi-label-span{
|
|
@@ -729,4 +740,8 @@ $dark-grey: #717585;
|
|
|
729
740
|
width: 100%;
|
|
730
741
|
height: 100%;
|
|
731
742
|
min-height: 25px;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.db-justify-content-flex-start {
|
|
746
|
+
justify-content: flex-start;
|
|
732
747
|
}
|
|
@@ -6,6 +6,7 @@ export declare type CustomChartProps = {
|
|
|
6
6
|
widget: ReactWidgetPM | undefined;
|
|
7
7
|
widgetRef: ReactWidgetPM | undefined;
|
|
8
8
|
dataBinding: DashboardDataBinding;
|
|
9
|
+
isPreviewModeActive?: boolean;
|
|
9
10
|
onSelectDataPoint: (dataPointSelection: DataPointSelection) => void;
|
|
10
11
|
};
|
|
11
12
|
declare const CustomChart: (props: CustomChartProps) => React.JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { SeriesMeasure } from "../../../../types/SeriesMeasure";
|
|
1
2
|
import { ReactWidgetPM } from "../../../../types/widget";
|
|
2
|
-
export declare function buildToolTip(widget: ReactWidgetPM, value: any, seriesName:
|
|
3
|
+
export declare function buildToolTip(widget: ReactWidgetPM, value: any, seriesName: SeriesMeasure, label: any, index: number): string;
|
|
@@ -12,6 +12,7 @@ declare type WidgetCardProps = {
|
|
|
12
12
|
dateFilter: any;
|
|
13
13
|
dataBinding: DashboardDataBinding;
|
|
14
14
|
isInEditMode: boolean;
|
|
15
|
+
isPreviewModeActive?: boolean;
|
|
15
16
|
onSelectDataPoint: (dataPointSelection: DataPointSelection) => void;
|
|
16
17
|
};
|
|
17
18
|
declare const WidgetCard: React.ForwardRefExoticComponent<WidgetCardProps & React.RefAttributes<unknown>>;
|
package/dist/index.js
CHANGED
|
@@ -245,8 +245,12 @@ var getLabelFormatByDateGroupType = function getLabelFormatByDateGroupType(label
|
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
+
var isNullOrUndefined = function isNullOrUndefined(val) {
|
|
249
|
+
return val == null || val == undefined;
|
|
250
|
+
};
|
|
251
|
+
|
|
248
252
|
var KpiChart = function KpiChart(props) {
|
|
249
|
-
var _widget$
|
|
253
|
+
var _widget$current8;
|
|
250
254
|
var _useState = React.useState(false),
|
|
251
255
|
dataLoaded = _useState[0],
|
|
252
256
|
setDataLoaded = _useState[1];
|
|
@@ -257,13 +261,25 @@ var KpiChart = function KpiChart(props) {
|
|
|
257
261
|
var _useState3 = React.useState(),
|
|
258
262
|
data = _useState3[0],
|
|
259
263
|
setData = _useState3[1];
|
|
264
|
+
var _useState4 = React.useState(false),
|
|
265
|
+
isKPICustomSizeNeeded = _useState4[0],
|
|
266
|
+
setIsKPICustomSizeNeeded = _useState4[1];
|
|
260
267
|
React.useEffect(function () {
|
|
261
268
|
widget.current = props.customChartProps.widget;
|
|
269
|
+
HandleKPICustomSize();
|
|
262
270
|
setDataLoaded(false);
|
|
263
271
|
setTimeout(function () {
|
|
264
272
|
RefreshData();
|
|
265
273
|
}, 500);
|
|
266
274
|
}, []);
|
|
275
|
+
React.useEffect(function () {
|
|
276
|
+
HandleKPICustomSize();
|
|
277
|
+
}, [props.customChartProps]);
|
|
278
|
+
var HandleKPICustomSize = function HandleKPICustomSize() {
|
|
279
|
+
var _isPreviewModeActive = props.customChartProps && props.customChartProps.isPreviewModeActive;
|
|
280
|
+
var _isKPICustomResizeNeeded = isKPICustomResizeNeeded();
|
|
281
|
+
setIsKPICustomSizeNeeded(_isKPICustomResizeNeeded && !_isPreviewModeActive);
|
|
282
|
+
};
|
|
267
283
|
var RefreshData = function RefreshData() {
|
|
268
284
|
if (Session.Tenant == 0) {
|
|
269
285
|
var emptyData = {};
|
|
@@ -378,6 +394,18 @@ var KpiChart = function KpiChart(props) {
|
|
|
378
394
|
className: "dl-kpi-label-span dl-kpi-textTrimming"
|
|
379
395
|
}, labelFormated));
|
|
380
396
|
}
|
|
397
|
+
var getIsKPIHasSmallestHeight = function getIsKPIHasSmallestHeight() {
|
|
398
|
+
var _props$customChartPro, _props$customChartPro2;
|
|
399
|
+
return props.customChartProps.widgetRef && ((_props$customChartPro = props.customChartProps.widgetRef) === null || _props$customChartPro === void 0 ? void 0 : _props$customChartPro.Layout) && ((_props$customChartPro2 = props.customChartProps.widgetRef.Layout) === null || _props$customChartPro2 === void 0 ? void 0 : _props$customChartPro2.h) == 2;
|
|
400
|
+
};
|
|
401
|
+
var isKPICustomResizeNeeded = function isKPICustomResizeNeeded() {
|
|
402
|
+
var _widget$current4, _widget$current5, _widget$current6, _widget$current7;
|
|
403
|
+
if (!widget || !widget.current) return;
|
|
404
|
+
var isThereTitle = !isNullOrUndefined((_widget$current4 = widget.current) === null || _widget$current4 === void 0 ? void 0 : _widget$current4.Title) && ((_widget$current5 = widget.current) === null || _widget$current5 === void 0 ? void 0 : _widget$current5.Title.length) > 0;
|
|
405
|
+
var isThereSubTitle = !isNullOrUndefined((_widget$current6 = widget.current) === null || _widget$current6 === void 0 ? void 0 : _widget$current6.Subtitle) && ((_widget$current7 = widget.current) === null || _widget$current7 === void 0 ? void 0 : _widget$current7.Subtitle.length) > 0;
|
|
406
|
+
var isKPIHasSmallestHeight = getIsKPIHasSmallestHeight();
|
|
407
|
+
return isThereTitle && isThereSubTitle && isKPIHasSmallestHeight;
|
|
408
|
+
};
|
|
381
409
|
return !dataLoaded ? React__default.createElement("div", {
|
|
382
410
|
className: 'dl-full-hight dl-flex-content-center spinner-custome'
|
|
383
411
|
}, React__default.createElement(progressspinner.ProgressSpinner, {
|
|
@@ -389,9 +417,9 @@ var KpiChart = function KpiChart(props) {
|
|
|
389
417
|
animationDuration: "2s"
|
|
390
418
|
})) : !error ? React__default.createElement("div", {
|
|
391
419
|
onClick: kpiClick,
|
|
392
|
-
className: ((_widget$
|
|
420
|
+
className: ((_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.Alighnment) == "Left" ? "dl-kpi-container-click db-justify-content-flex-start" : "dl-kpi-container-click"
|
|
393
421
|
}, React__default.createElement("div", {
|
|
394
|
-
className: "dl-kpi-container"
|
|
422
|
+
className: isKPICustomSizeNeeded ? "dl-kpi-container kpi-custom-size" : "dl-kpi-container"
|
|
395
423
|
}, getLabel(), getValueComponent(), getPreviousValueComponent())) : React__default.createElement("div", {
|
|
396
424
|
className: "dl-flex-content-center dl-full-hight",
|
|
397
425
|
style: {
|
|
@@ -468,9 +496,13 @@ function getTooltipValue(value) {
|
|
|
468
496
|
if (value) return value;
|
|
469
497
|
return '$dataValue';
|
|
470
498
|
}
|
|
471
|
-
function getMeasureType(
|
|
472
|
-
if (!
|
|
473
|
-
|
|
499
|
+
function getMeasureType(seriesMeasure) {
|
|
500
|
+
if (!seriesMeasure.Name) return "Count:";
|
|
501
|
+
if (seriesMeasure.MeasureCode == "Formula") {
|
|
502
|
+
var formula = JSON.parse(seriesMeasure.Formula);
|
|
503
|
+
return formula.Name;
|
|
504
|
+
}
|
|
505
|
+
return seriesMeasure.Name.replace(/ .*/, '') + ":";
|
|
474
506
|
}
|
|
475
507
|
|
|
476
508
|
function getCategoriesBasedDataSource(chartInfo, seriesMeasures, widget) {
|
|
@@ -528,7 +560,7 @@ function buildDataSource(values, widget) {
|
|
|
528
560
|
MeasureCode: series.MeasureCode,
|
|
529
561
|
Formula: series.Formula
|
|
530
562
|
},
|
|
531
|
-
tooltext: buildToolTip(widget, null, series
|
|
563
|
+
tooltext: buildToolTip(widget, null, series, e.Label, 0),
|
|
532
564
|
color: getSeriesPositionColor(index + 1)
|
|
533
565
|
};
|
|
534
566
|
return item;
|
|
@@ -548,7 +580,7 @@ function buildDataSet(seriesMeasures, widget) {
|
|
|
548
580
|
MeasureCode: seriesMeasure.MeasureCode,
|
|
549
581
|
Formula: seriesMeasure.Formula
|
|
550
582
|
},
|
|
551
|
-
tooltext: buildToolTip(widget, e.Value, seriesMeasure
|
|
583
|
+
tooltext: buildToolTip(widget, e.Value, seriesMeasure, null, index)
|
|
552
584
|
};
|
|
553
585
|
});
|
|
554
586
|
var color = getSeriesPositionColor(seriesPosition);
|
|
@@ -605,7 +637,7 @@ function buildStackedGroupData(secGroup, series, widget) {
|
|
|
605
637
|
MeasureFieldId: series.MeasureFieldId,
|
|
606
638
|
GroupByIdSec: secGroup.code
|
|
607
639
|
},
|
|
608
|
-
tooltext: buildToolTip(widget, null, series
|
|
640
|
+
tooltext: buildToolTip(widget, null, series, group.label + " - " + secGroup.label, 0)
|
|
609
641
|
});
|
|
610
642
|
});
|
|
611
643
|
return data;
|
|
@@ -1123,10 +1155,6 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
1123
1155
|
}, error)));
|
|
1124
1156
|
});
|
|
1125
1157
|
|
|
1126
|
-
var isNullOrUndefined = function isNullOrUndefined(val) {
|
|
1127
|
-
return val == null || val == undefined;
|
|
1128
|
-
};
|
|
1129
|
-
|
|
1130
1158
|
var _path$1;
|
|
1131
1159
|
function _extends$2() {
|
|
1132
1160
|
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -1328,6 +1356,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
1328
1356
|
var _widget$current10, _widget$current11;
|
|
1329
1357
|
if (isLoading || !((_widget$current10 = widget.current) !== null && _widget$current10 !== void 0 && _widget$current10.TypeCode)) return null;
|
|
1330
1358
|
if (((_widget$current11 = widget.current) === null || _widget$current11 === void 0 ? void 0 : _widget$current11.TypeCode) == "kpi") return React__default.createElement(CustomChart, {
|
|
1359
|
+
isPreviewModeActive: props.isPreviewModeActive,
|
|
1331
1360
|
dataBinding: props.dataBinding,
|
|
1332
1361
|
widget: widget.current,
|
|
1333
1362
|
widgetRef: props.widgetRef,
|
|
@@ -1637,6 +1666,7 @@ var Dashboard = function Dashboard(props) {
|
|
|
1637
1666
|
key: "widget-" + (previewWidget === null || previewWidget === void 0 ? void 0 : (_previewWidget$Layout = previewWidget.Layout) === null || _previewWidget$Layout === void 0 ? void 0 : _previewWidget$Layout.i)
|
|
1638
1667
|
}, React.createElement(WidgetCard, {
|
|
1639
1668
|
isInEditMode: isInEditMode,
|
|
1669
|
+
isPreviewModeActive: isPreviewModeActive,
|
|
1640
1670
|
key: previewWidget === null || previewWidget === void 0 ? void 0 : (_previewWidget$Layout2 = previewWidget.Layout) === null || _previewWidget$Layout2 === void 0 ? void 0 : _previewWidget$Layout2.i,
|
|
1641
1671
|
widget: previewWidget,
|
|
1642
1672
|
widgetRef: previewWidget,
|