logitude-dashboard-library 3.2.6 → 3.2.8
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 +19 -14
- package/dist/index.js +192 -90
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +192 -90
- package/dist/index.modern.js.map +1 -1
- package/dist/styles/dl-dashboard.scss +19 -14
- package/dist/types/widget.d.ts +1 -0
- package/package.json +1 -1
|
@@ -348,11 +348,11 @@ $dark-grey: #717585;
|
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
.kpi-custom-size {
|
|
351
|
-
-webkit-transform: scale(0.
|
|
352
|
-
-ms-transform: scale(0.
|
|
353
|
-
-o-transform: scale(0.
|
|
354
|
-
transform: scale(0.
|
|
355
|
-
margin-top: -
|
|
351
|
+
-webkit-transform: scale(0.62);
|
|
352
|
+
-ms-transform: scale(0.62);
|
|
353
|
+
-o-transform: scale(0.62);
|
|
354
|
+
transform: scale(0.62);
|
|
355
|
+
margin-top: -12px;
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
.margin-top-6 {
|
|
@@ -547,7 +547,7 @@ $dark-grey: #717585;
|
|
|
547
547
|
box-sizing: border-box;
|
|
548
548
|
display: flex;
|
|
549
549
|
place-content: flex-end flex-start;
|
|
550
|
-
align-items:
|
|
550
|
+
align-items: center;
|
|
551
551
|
max-width: 100%;
|
|
552
552
|
}
|
|
553
553
|
|
|
@@ -558,7 +558,6 @@ $dark-grey: #717585;
|
|
|
558
558
|
.dl-kpi-label-span{
|
|
559
559
|
font-family: "Manrope";
|
|
560
560
|
font-style: normal;
|
|
561
|
-
font-weight: 700;
|
|
562
561
|
font-size: 16px;
|
|
563
562
|
line-height: 120%;
|
|
564
563
|
color: #292D30;
|
|
@@ -702,8 +701,7 @@ $dark-grey: #717585;
|
|
|
702
701
|
font-size: 11px;
|
|
703
702
|
line-height: 15px;
|
|
704
703
|
color: #A4A4A4;
|
|
705
|
-
margin-left:
|
|
706
|
-
margin-bottom: 6px;
|
|
704
|
+
margin-left: 5px;
|
|
707
705
|
flex-shrink: 0;
|
|
708
706
|
}
|
|
709
707
|
|
|
@@ -786,6 +784,16 @@ $dark-grey: #717585;
|
|
|
786
784
|
.p-column-title {
|
|
787
785
|
font-weight: bold !important;
|
|
788
786
|
font-size: 14px !important;
|
|
787
|
+
|
|
788
|
+
.pi {
|
|
789
|
+
font-size: 14px !important;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.header-content {
|
|
794
|
+
display: flex;
|
|
795
|
+
align-items: center;
|
|
796
|
+
cursor: pointer;
|
|
789
797
|
}
|
|
790
798
|
}
|
|
791
799
|
|
|
@@ -836,10 +844,8 @@ $dark-grey: #717585;
|
|
|
836
844
|
|
|
837
845
|
.dl-kpi-prev-container {
|
|
838
846
|
display: flex;
|
|
839
|
-
align-
|
|
840
|
-
|
|
841
|
-
place-content: flex-end flex-start;
|
|
842
|
-
justify-content: flex-start;
|
|
847
|
+
align-items: center;
|
|
848
|
+
justify-content: center;
|
|
843
849
|
font-family: 'Manrope';
|
|
844
850
|
font-style: normal;
|
|
845
851
|
font-weight: 500;
|
|
@@ -852,7 +858,6 @@ $dark-grey: #717585;
|
|
|
852
858
|
font-style: normal;
|
|
853
859
|
font-weight: 500;
|
|
854
860
|
font-size: 12px;
|
|
855
|
-
line-height: 15px;
|
|
856
861
|
color: #292D30;
|
|
857
862
|
}
|
|
858
863
|
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@ var React__default = _interopDefault(React);
|
|
|
5
5
|
var reactGridLayout = require('react-grid-layout');
|
|
6
6
|
var progressspinner = require('primereact/progressspinner');
|
|
7
7
|
var axios = _interopDefault(require('axios'));
|
|
8
|
-
var moment = _interopDefault(require('moment'));
|
|
9
8
|
var uuid = require('uuid');
|
|
9
|
+
var moment = _interopDefault(require('moment'));
|
|
10
10
|
var datatable = require('primereact/datatable');
|
|
11
11
|
var column = require('primereact/column');
|
|
12
12
|
var ReactFC = _interopDefault(require('react-fusioncharts'));
|
|
@@ -253,70 +253,6 @@ function SvgRedWarning(props) {
|
|
|
253
253
|
})));
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
var DateGroupCodes = {
|
|
257
|
-
Full_Date: 'Full Date',
|
|
258
|
-
Month: 'Month',
|
|
259
|
-
Quarter: 'Quarter',
|
|
260
|
-
Year: 'Year',
|
|
261
|
-
Month_Year: 'Month & Year',
|
|
262
|
-
Quarter_Year: 'Quarter & Year'
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
var getDateFormat = function getDateFormat(label, _format) {
|
|
266
|
-
if (!label) return label;
|
|
267
|
-
|
|
268
|
-
var _date = moment(label);
|
|
269
|
-
|
|
270
|
-
if (!_date || !_date.isValid()) return label;
|
|
271
|
-
return _date.format(_format);
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
var getQuarterYearFormat = function getQuarterYearFormat(label) {
|
|
275
|
-
if (!label) return label;
|
|
276
|
-
|
|
277
|
-
if (label.includes("/")) {
|
|
278
|
-
var result = label.split("/");
|
|
279
|
-
var quarterVal = result && result[1] ? result[1] : "";
|
|
280
|
-
var yearVal = result && result[0] ? result[0] : "";
|
|
281
|
-
return quarterVal + " " + yearVal;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
return label;
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
var getLabelFormatByDateGroupType = function getLabelFormatByDateGroupType(label, widget, isSecondGrouping) {
|
|
288
|
-
if (isSecondGrouping === void 0) {
|
|
289
|
-
isSecondGrouping = false;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
if (!widget) return label;
|
|
293
|
-
var groupFieldDataType = isSecondGrouping ? widget.SecondaryDateGroupCode : widget.DateGroupCode;
|
|
294
|
-
if (!groupFieldDataType) return label;
|
|
295
|
-
|
|
296
|
-
switch (groupFieldDataType) {
|
|
297
|
-
case DateGroupCodes.Full_Date:
|
|
298
|
-
return getDateFormat(label, "DD MMM YYYY");
|
|
299
|
-
|
|
300
|
-
case DateGroupCodes.Month:
|
|
301
|
-
return getDateFormat(label, "MMM");
|
|
302
|
-
|
|
303
|
-
case DateGroupCodes.Quarter:
|
|
304
|
-
return label;
|
|
305
|
-
|
|
306
|
-
case DateGroupCodes.Year:
|
|
307
|
-
return getDateFormat(label, "YYYY");
|
|
308
|
-
|
|
309
|
-
case DateGroupCodes.Month_Year:
|
|
310
|
-
return getDateFormat(label, "MMM YYYY");
|
|
311
|
-
|
|
312
|
-
case DateGroupCodes.Quarter_Year:
|
|
313
|
-
return getQuarterYearFormat(label);
|
|
314
|
-
|
|
315
|
-
default:
|
|
316
|
-
return label;
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
|
|
320
256
|
var isNullOrUndefined = function isNullOrUndefined(val) {
|
|
321
257
|
return val == null || val == undefined;
|
|
322
258
|
};
|
|
@@ -326,7 +262,7 @@ var isNullOrUndefinedOrEmpty = function isNullOrUndefinedOrEmpty(val) {
|
|
|
326
262
|
};
|
|
327
263
|
|
|
328
264
|
var KpiChart = function KpiChart(props) {
|
|
329
|
-
var _widget$
|
|
265
|
+
var _widget$current16;
|
|
330
266
|
|
|
331
267
|
var _useState = React.useState(true),
|
|
332
268
|
isLoading = _useState[0],
|
|
@@ -437,6 +373,9 @@ var KpiChart = function KpiChart(props) {
|
|
|
437
373
|
return React__default.createElement("div", {
|
|
438
374
|
className: "dl-kpi-ratio-container"
|
|
439
375
|
}, getArrowComponent(), React__default.createElement("div", {
|
|
376
|
+
style: {
|
|
377
|
+
fontSize: getKPIFormattingPropertyValue("PercentageFontSize", "px")
|
|
378
|
+
},
|
|
440
379
|
className: 'dl-kpi-ratio-text'
|
|
441
380
|
}, data === null || data === void 0 ? void 0 : data.Ratio, " %"));
|
|
442
381
|
}
|
|
@@ -480,14 +419,22 @@ var KpiChart = function KpiChart(props) {
|
|
|
480
419
|
|
|
481
420
|
function getPreviousValueComponent() {
|
|
482
421
|
if (isNullOrUndefined(data) || isNullOrUndefined(data === null || data === void 0 ? void 0 : data.ComparisonValue) || isNullOrUndefined(data === null || data === void 0 ? void 0 : data.ComparisonLabel)) return "";
|
|
483
|
-
var
|
|
484
|
-
var
|
|
485
|
-
var prevtext = labelFormated ? labelFormated + ": " + (data === null || data === void 0 ? void 0 : data.ComparisonValue) : "";
|
|
422
|
+
var formatedValue = data ? data.ComparisonLabel : "";
|
|
423
|
+
var comparisonValue = data ? data === null || data === void 0 ? void 0 : data.ComparisonValue : "";
|
|
486
424
|
return React__default.createElement("div", {
|
|
487
425
|
className: "dl-kpi-prev-container"
|
|
488
426
|
}, React__default.createElement("div", {
|
|
427
|
+
style: {
|
|
428
|
+
color: getKPIFormattingPropertyValue("ComparisonValueFontColor"),
|
|
429
|
+
fontSize: getKPIFormattingPropertyValue("ComparisonValueFontSize", "px")
|
|
430
|
+
},
|
|
431
|
+
title: formatedValue,
|
|
489
432
|
className: "dl-kpi-prev-text"
|
|
490
|
-
},
|
|
433
|
+
}, comparisonValue), (data === null || data === void 0 ? void 0 : data.ComparisonAbbreviationSymbol) && React__default.createElement("div", {
|
|
434
|
+
style: {
|
|
435
|
+
color: getKPIFormattingPropertyValue("ComparisonValueFontColor"),
|
|
436
|
+
fontSize: getKPIFormattingPropertyValue("ComparisonValueFontSize", "px")
|
|
437
|
+
},
|
|
491
438
|
className: "dl-kpi-prev-abbreviationSymbol"
|
|
492
439
|
}, data === null || data === void 0 ? void 0 : data.ComparisonAbbreviationSymbol));
|
|
493
440
|
}
|
|
@@ -497,6 +444,10 @@ var KpiChart = function KpiChart(props) {
|
|
|
497
444
|
className: "dl-kpi-no-data"
|
|
498
445
|
}, "No data to display.");
|
|
499
446
|
return React__default.createElement("div", {
|
|
447
|
+
style: {
|
|
448
|
+
color: getKPIFormattingPropertyValue("MainValueFontColor"),
|
|
449
|
+
fontSize: getKPIFormattingPropertyValue("MainValueFontSize", "px")
|
|
450
|
+
},
|
|
500
451
|
className: "dl-kpi-value dl-kpi-textTrimming"
|
|
501
452
|
}, data === null || data === void 0 ? void 0 : data.Value);
|
|
502
453
|
}
|
|
@@ -505,19 +456,66 @@ var KpiChart = function KpiChart(props) {
|
|
|
505
456
|
return React__default.createElement("div", {
|
|
506
457
|
className: "dl-kpi-sub-container"
|
|
507
458
|
}, getValueData(), (data === null || data === void 0 ? void 0 : data.AbbreviationSymbol) && React__default.createElement("div", {
|
|
459
|
+
style: {
|
|
460
|
+
color: getKPIFormattingPropertyValue("MainValueFontColor"),
|
|
461
|
+
fontSize: getKPIFormattingPropertyValue("MainValueFontSize", "px")
|
|
462
|
+
},
|
|
508
463
|
className: "dl-kpi-abbreviationSymbol"
|
|
509
464
|
}, data === null || data === void 0 ? void 0 : data.AbbreviationSymbol), widget.current && widget.current.ShowMeasureUnit && (data === null || data === void 0 ? void 0 : data.Unit) && React__default.createElement("div", {
|
|
465
|
+
style: {
|
|
466
|
+
color: getKPIFormattingPropertyValue("MainValueFontColor"),
|
|
467
|
+
fontSize: getKPIFormattingPropertyValue("MainValueFontSize", "px")
|
|
468
|
+
},
|
|
510
469
|
className: "dl-kpi-unit"
|
|
511
470
|
}, data === null || data === void 0 ? void 0 : data.Unit), getRatioComponent());
|
|
512
471
|
}
|
|
513
472
|
|
|
473
|
+
var getPeriodLabelByPeriodCode = function getPeriodLabelByPeriodCode(code) {
|
|
474
|
+
if (!isNullOrUndefinedOrEmpty(code)) {
|
|
475
|
+
return code.replaceAll("_", " ");
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
return "";
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
var getLabelFromKPISettings = function getLabelFromKPISettings() {
|
|
482
|
+
if (widget.current && widget.current.KPIComparisonSettings && widget.current.KPIComparisonSettings.length) {
|
|
483
|
+
var kpiSettings = JSON.parse(widget.current.KPIComparisonSettings);
|
|
484
|
+
var PeriodDateFilter = kpiSettings ? kpiSettings.PeriodDateFilter : null;
|
|
485
|
+
return PeriodDateFilter && PeriodDateFilter.DateTimeValueCode ? getPeriodLabelByPeriodCode(PeriodDateFilter.DateTimeValueCode) : "";
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
return "";
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
var getKPIFormattingData = function getKPIFormattingData() {
|
|
492
|
+
var _widget$current14, _widget$current15;
|
|
493
|
+
|
|
494
|
+
return isNullOrUndefinedOrEmpty((_widget$current14 = widget.current) === null || _widget$current14 === void 0 ? void 0 : _widget$current14.KPIFormatSettings) ? {} : JSON.parse((_widget$current15 = widget.current) === null || _widget$current15 === void 0 ? void 0 : _widget$current15.KPIFormatSettings);
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
var getKPIFormattingPropertyValue = function getKPIFormattingPropertyValue(propertyName, unit) {
|
|
498
|
+
if (unit === void 0) {
|
|
499
|
+
unit = "";
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
var kpiFormattingData = getKPIFormattingData();
|
|
503
|
+
return kpiFormattingData && kpiFormattingData[propertyName] ? kpiFormattingData[propertyName] + unit : undefined;
|
|
504
|
+
};
|
|
505
|
+
|
|
514
506
|
function getLabel() {
|
|
515
|
-
var
|
|
507
|
+
var formatedValue = data ? data.Label : "";
|
|
508
|
+
var label = getLabelFromKPISettings();
|
|
516
509
|
return React__default.createElement("div", {
|
|
517
510
|
className: "dl-kpi-label-container"
|
|
518
511
|
}, React__default.createElement("span", {
|
|
512
|
+
style: {
|
|
513
|
+
color: getKPIFormattingPropertyValue("MainPeriodFontColor"),
|
|
514
|
+
fontSize: getKPIFormattingPropertyValue("MainPeriodFontSize", "px")
|
|
515
|
+
},
|
|
516
|
+
title: formatedValue,
|
|
519
517
|
className: "dl-kpi-label-span dl-kpi-textTrimming"
|
|
520
|
-
},
|
|
518
|
+
}, label));
|
|
521
519
|
}
|
|
522
520
|
|
|
523
521
|
var getIsKPIHasSmallestHeight = function getIsKPIHasSmallestHeight() {
|
|
@@ -527,13 +525,9 @@ var KpiChart = function KpiChart(props) {
|
|
|
527
525
|
};
|
|
528
526
|
|
|
529
527
|
var isKPICustomResizeNeeded = function isKPICustomResizeNeeded() {
|
|
530
|
-
var _widget$current14, _widget$current15, _widget$current16, _widget$current17;
|
|
531
|
-
|
|
532
528
|
if (!widget || !widget.current) return;
|
|
533
|
-
var isThereTitle = !isNullOrUndefined((_widget$current14 = widget.current) === null || _widget$current14 === void 0 ? void 0 : _widget$current14.Title) && ((_widget$current15 = widget.current) === null || _widget$current15 === void 0 ? void 0 : _widget$current15.Title.length) > 0;
|
|
534
|
-
var isThereSubTitle = !isNullOrUndefined((_widget$current16 = widget.current) === null || _widget$current16 === void 0 ? void 0 : _widget$current16.Subtitle) && ((_widget$current17 = widget.current) === null || _widget$current17 === void 0 ? void 0 : _widget$current17.Subtitle.length) > 0;
|
|
535
529
|
var isKPIHasSmallestHeight = getIsKPIHasSmallestHeight();
|
|
536
|
-
return
|
|
530
|
+
return isKPIHasSmallestHeight;
|
|
537
531
|
};
|
|
538
532
|
|
|
539
533
|
return isLoading || !widget.current ? React__default.createElement("div", {
|
|
@@ -548,7 +542,7 @@ var KpiChart = function KpiChart(props) {
|
|
|
548
542
|
})) : !error && widget.current ? React__default.createElement("div", {
|
|
549
543
|
key: triggerId,
|
|
550
544
|
onClick: kpiClick,
|
|
551
|
-
className: ((_widget$
|
|
545
|
+
className: ((_widget$current16 = widget.current) === null || _widget$current16 === void 0 ? void 0 : _widget$current16.Alighnment) == "Left" ? "dl-kpi-container-click db-justify-content-flex-start" : "dl-kpi-container-click"
|
|
552
546
|
}, React__default.createElement("div", {
|
|
553
547
|
className: isKPICustomSizeNeeded ? "dl-kpi-container kpi-custom-size" : "dl-kpi-container"
|
|
554
548
|
}, getLabel(), getValueComponent(), getPreviousValueComponent())) : React__default.createElement("div", {
|
|
@@ -664,7 +658,7 @@ var TableChart = function TableChart(props) {
|
|
|
664
658
|
var key = field.FieldCode;
|
|
665
659
|
var valueType = field.DataTypeCode;
|
|
666
660
|
|
|
667
|
-
var _value = valueType &&
|
|
661
|
+
var _value = valueType && valueType == "Boolean" ? getBooleanStringValue(item[key]) : item[key];
|
|
668
662
|
|
|
669
663
|
_tableRow[key] = isNullOrUndefined(_value) ? "" : _value;
|
|
670
664
|
});
|
|
@@ -715,16 +709,19 @@ var TableChart = function TableChart(props) {
|
|
|
715
709
|
return field ? field.Id : null;
|
|
716
710
|
};
|
|
717
711
|
|
|
718
|
-
var sortTableData = function sortTableData(
|
|
719
|
-
setSortField(
|
|
720
|
-
|
|
712
|
+
var sortTableData = function sortTableData(sortedField) {
|
|
713
|
+
setSortField(sortedField);
|
|
714
|
+
|
|
715
|
+
var _sortOrder = sortOrder == 1 ? -1 : sortOrder == -1 ? 1 : 1;
|
|
716
|
+
|
|
717
|
+
setSortOrder(_sortOrder);
|
|
721
718
|
var _widget = props.customChartProps.widget;
|
|
722
719
|
var dashboardAnalyticsService = new DashboardAnalyticsService();
|
|
723
720
|
_widget.onChange = undefined;
|
|
724
721
|
_widget.PageIndex = 0;
|
|
725
722
|
_widget.PageSize = 100;
|
|
726
|
-
_widget.ScreenSortBy = getSortFieldIdBySortFieldCode(
|
|
727
|
-
_widget.ScreenSortDirection =
|
|
723
|
+
_widget.ScreenSortBy = getSortFieldIdBySortFieldCode(sortedField);
|
|
724
|
+
_widget.ScreenSortDirection = _sortOrder == 1 ? 'asc' : _sortOrder == -1 ? 'desc' : null;
|
|
728
725
|
_widget.EntityId = !isNullOrUndefinedOrEmpty(_widget.RelatedToEntityId) ? _widget.RelatedToEntityId : _widget.EntityId;
|
|
729
726
|
setIsTableLoading(true);
|
|
730
727
|
dashboardAnalyticsService.getTableData(_widget).then(function (res) {
|
|
@@ -749,6 +746,47 @@ var TableChart = function TableChart(props) {
|
|
|
749
746
|
return false;
|
|
750
747
|
};
|
|
751
748
|
|
|
749
|
+
var cellTemplateBody = function cellTemplateBody(data, column) {
|
|
750
|
+
if (!column || !column.FieldCode) return "";
|
|
751
|
+
return column.DataTypeCode == "DateTime" || column.DataTypeCode == "Date" ? getDateTimeValue(data[column.FieldCode]) : data[column.FieldCode];
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
var headerTemplate = function headerTemplate(column) {
|
|
755
|
+
var sortClassIcon = "";
|
|
756
|
+
|
|
757
|
+
if (sortField != column.FieldCode) {
|
|
758
|
+
return React__default.createElement("div", {
|
|
759
|
+
onClick: function onClick() {
|
|
760
|
+
return sortTableData(column.FieldCode);
|
|
761
|
+
},
|
|
762
|
+
className: "header-content"
|
|
763
|
+
}, React__default.createElement("span", {
|
|
764
|
+
className: "p-column-title"
|
|
765
|
+
}, column.DisplayName), canSort() && React__default.createElement("span", {
|
|
766
|
+
className: "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-alt"
|
|
767
|
+
}));
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
if (sortOrder == 1) {
|
|
771
|
+
sortClassIcon = "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-amount-up-alt";
|
|
772
|
+
} else if (sortOrder == -1) {
|
|
773
|
+
sortClassIcon = "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-amount-down";
|
|
774
|
+
} else {
|
|
775
|
+
sortClassIcon = "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-alt";
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
return React__default.createElement("div", {
|
|
779
|
+
onClick: function onClick() {
|
|
780
|
+
return sortTableData(column.FieldCode);
|
|
781
|
+
},
|
|
782
|
+
className: "header-content"
|
|
783
|
+
}, React__default.createElement("span", {
|
|
784
|
+
className: "p-column-title"
|
|
785
|
+
}, column.DisplayName), canSort() && React__default.createElement("span", {
|
|
786
|
+
className: sortClassIcon
|
|
787
|
+
}));
|
|
788
|
+
};
|
|
789
|
+
|
|
752
790
|
return isLoading ? React__default.createElement("div", {
|
|
753
791
|
className: 'dl-full-hight dl-flex-content-center spinner-custome'
|
|
754
792
|
}, React__default.createElement(progressspinner.ProgressSpinner, {
|
|
@@ -771,17 +809,17 @@ var TableChart = function TableChart(props) {
|
|
|
771
809
|
className: "dl-tooltiptext"
|
|
772
810
|
}, error))) : React__default.createElement(datatable.DataTable, {
|
|
773
811
|
loading: isTableLoading,
|
|
774
|
-
sortField: sortField,
|
|
775
|
-
sortOrder: sortOrder,
|
|
776
|
-
onSort: sortTableData,
|
|
777
812
|
value: tableData,
|
|
778
813
|
responsiveLayout: "scroll"
|
|
779
814
|
}, tableColumns.map(function (column$1, index) {
|
|
780
815
|
return React__default.createElement(column.Column, {
|
|
781
|
-
sortable: canSort(),
|
|
782
816
|
key: column$1.FieldCode + "_" + index,
|
|
783
|
-
|
|
784
|
-
|
|
817
|
+
header: function header() {
|
|
818
|
+
return headerTemplate(column$1);
|
|
819
|
+
},
|
|
820
|
+
body: function body(data) {
|
|
821
|
+
return cellTemplateBody(data, column$1);
|
|
822
|
+
}
|
|
785
823
|
});
|
|
786
824
|
}));
|
|
787
825
|
};
|
|
@@ -831,6 +869,70 @@ var CustomChart = function CustomChart(props) {
|
|
|
831
869
|
}, project()));
|
|
832
870
|
};
|
|
833
871
|
|
|
872
|
+
var DateGroupCodes = {
|
|
873
|
+
Full_Date: 'Full Date',
|
|
874
|
+
Month: 'Month',
|
|
875
|
+
Quarter: 'Quarter',
|
|
876
|
+
Year: 'Year',
|
|
877
|
+
Month_Year: 'Month & Year',
|
|
878
|
+
Quarter_Year: 'Quarter & Year'
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
var getDateFormat = function getDateFormat(label, _format) {
|
|
882
|
+
if (!label) return label;
|
|
883
|
+
|
|
884
|
+
var _date = moment(label);
|
|
885
|
+
|
|
886
|
+
if (!_date || !_date.isValid()) return label;
|
|
887
|
+
return _date.format(_format);
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
var getQuarterYearFormat = function getQuarterYearFormat(label) {
|
|
891
|
+
if (!label) return label;
|
|
892
|
+
|
|
893
|
+
if (label.includes("/")) {
|
|
894
|
+
var result = label.split("/");
|
|
895
|
+
var quarterVal = result && result[1] ? result[1] : "";
|
|
896
|
+
var yearVal = result && result[0] ? result[0] : "";
|
|
897
|
+
return quarterVal + " " + yearVal;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
return label;
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
var getLabelFormatByDateGroupType = function getLabelFormatByDateGroupType(label, widget, isSecondGrouping) {
|
|
904
|
+
if (isSecondGrouping === void 0) {
|
|
905
|
+
isSecondGrouping = false;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
if (!widget) return label;
|
|
909
|
+
var groupFieldDataType = isSecondGrouping ? widget.SecondaryDateGroupCode : widget.DateGroupCode;
|
|
910
|
+
if (!groupFieldDataType) return label;
|
|
911
|
+
|
|
912
|
+
switch (groupFieldDataType) {
|
|
913
|
+
case DateGroupCodes.Full_Date:
|
|
914
|
+
return getDateFormat(label, "DD MMM YYYY");
|
|
915
|
+
|
|
916
|
+
case DateGroupCodes.Month:
|
|
917
|
+
return getDateFormat(label, "MMM");
|
|
918
|
+
|
|
919
|
+
case DateGroupCodes.Quarter:
|
|
920
|
+
return label;
|
|
921
|
+
|
|
922
|
+
case DateGroupCodes.Year:
|
|
923
|
+
return getDateFormat(label, "YYYY");
|
|
924
|
+
|
|
925
|
+
case DateGroupCodes.Month_Year:
|
|
926
|
+
return getDateFormat(label, "MMM YYYY");
|
|
927
|
+
|
|
928
|
+
case DateGroupCodes.Quarter_Year:
|
|
929
|
+
return getQuarterYearFormat(label);
|
|
930
|
+
|
|
931
|
+
default:
|
|
932
|
+
return label;
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
|
|
834
936
|
function buildToolTip(widget, value, seriesName, label, index) {
|
|
835
937
|
var padding = widget.TypeCode == 'line' && index > 0 ? 'padding-top: 3px' : '';
|
|
836
938
|
return "\n <div style=\"min-width: 108px;" + padding + "\">\n <div style=\"display: flex;align-items: center;margin-bottom: 6px;\">\n <span style=\"margin: 0; min-height: 10px; min-width: 10px; height: 10px; width: 10px; background-color: transparent; border-radius: 50%; display: inline-block;\"></span>\n <p style=\" margin: 0; margin-left: 4px; white-space: pre-line; font-family: 'Manrope'; font-style: normal;font-weight: 400; font-size: 11px; line-height: 100%; color: #323232;\"> " + getTooltiplabel(label, seriesName) + "</p>\n </div>\n <hr style=\"margin: 0;border-top: 1px solid #F0F0F0;\">\n <div style=\"display: flex;align-items: center;margin:0;margin-top: 6px;\">\n <p style=\"margin: 0;font-family: 'Manrope'; white-space: pre-line; font-style: normal;font-weight: 400; font-size: 11px;line-height: 100%;color: #A4A4A4;\"> " + getMeasureType(seriesName) + "</p>\n <p style=\"margin: 0;margin-left: 6px; white-space: pre-line; font-family: 'Manrope';font-style: normal;font-weight: 500;font-size: 11px;line-height: 100%; color: #323232;\">" + getTooltipValue(value) + "</p>\n " + getTooltipPercentage(widget) + " </div>\n </div>\n ";
|