logitude-dashboard-library 3.2.14 → 3.2.16
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 +141 -0
- package/dist/features/Dashboard/ChartsComponents/CustomCharts/PivotGrid.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +280 -30
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +280 -31
- package/dist/index.modern.js.map +1 -1
- package/dist/services/DashboardAnalyticsService.d.ts +2 -0
- package/dist/styles/dl-dashboard.scss +141 -0
- package/dist/types/widget.d.ts +3 -0
- package/package.json +4 -1
|
@@ -276,6 +276,13 @@ $dark-grey: #717585;
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
+
.pivot-header {
|
|
280
|
+
&::after {
|
|
281
|
+
content: "";
|
|
282
|
+
border-bottom: 0px !important;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
279
286
|
.header-contents {
|
|
280
287
|
display: flex;
|
|
281
288
|
|
|
@@ -811,6 +818,136 @@ $dark-grey: #717585;
|
|
|
811
818
|
align-items: flex-start;
|
|
812
819
|
}
|
|
813
820
|
|
|
821
|
+
.force-overflow-hidden {
|
|
822
|
+
overflow: hidden !important;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.dl-pivot-chart-container {
|
|
826
|
+
overflow: auto;
|
|
827
|
+
height: calc(100% - 12px);
|
|
828
|
+
width: 100%;
|
|
829
|
+
margin: 0 auto;
|
|
830
|
+
display: block;
|
|
831
|
+
position: absolute;
|
|
832
|
+
top: 0;
|
|
833
|
+
right: 0;
|
|
834
|
+
left: 0;
|
|
835
|
+
bottom: 0;
|
|
836
|
+
|
|
837
|
+
.pivot-grid-element {
|
|
838
|
+
width: 100%;
|
|
839
|
+
height: 100%;
|
|
840
|
+
margin: 0 auto;
|
|
841
|
+
overflow-x: auto;
|
|
842
|
+
overflow-y: hidden;
|
|
843
|
+
scrollbar-color: initial;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.dx-scrollbar-hoverable .dx-scrollable-scroll.dx-state-invisible .dx-scrollable-scroll-content {
|
|
847
|
+
background-color: rgba(191,191,191,.7);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.dx-pivotgrid-fields-area-head td .dx-area-field,
|
|
851
|
+
.dx-pivotgrid-horizontal-headers td,
|
|
852
|
+
.dx-pivotgrid .dx-area-description-cell.dx-pivotgrid-background {
|
|
853
|
+
background-color: #F1F1F1;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.dx-pivotgrid-horizontal-headers td {
|
|
857
|
+
text-align: left;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
.dx-pivotgrid-fields-area-head td .dx-area-field {
|
|
861
|
+
border-bottom: 0;
|
|
862
|
+
border-right: 0;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
.dx-pivotgrid .dx-pivotgrid-area td {
|
|
866
|
+
padding: 4px 8px;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
.dx-pivotgrid-fields-area-head .dx-area-field-content,
|
|
870
|
+
.dx-pivotgrid-horizontal-headers tr td span {
|
|
871
|
+
font-family: "Manrope";
|
|
872
|
+
font-size: 13px;
|
|
873
|
+
font-weight: 600;
|
|
874
|
+
text-align: left;
|
|
875
|
+
color: #222222;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.dx-pivotgrid .dx-pivotgrid-vertical-headers td {
|
|
879
|
+
background: #FAFAFA;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
.dx-pivotgrid .dx-pivotgrid-vertical-headers td > span {
|
|
883
|
+
font-family: "Manrope";
|
|
884
|
+
font-size: 13px;
|
|
885
|
+
font-weight: 500;
|
|
886
|
+
text-align: left;
|
|
887
|
+
color: #46494A;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.dx-pivotgrid .dx-pivotgrid-vertical-headers td div > span {
|
|
891
|
+
font-weight: 600 !important;
|
|
892
|
+
color: #46494A !important;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.dx-pivotgrid .dx-pivotgrid-area-data tbody td {
|
|
896
|
+
font-family: "Manrope";
|
|
897
|
+
font-size: 13px;
|
|
898
|
+
font-weight: 500;
|
|
899
|
+
text-align: right;
|
|
900
|
+
color: #46494A;
|
|
901
|
+
border-left: 0px !important;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
.dx-widget {
|
|
905
|
+
&::-webkit-scrollbar {
|
|
906
|
+
width: 10px;
|
|
907
|
+
height: 10px
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
&::-webkit-scrollbar-thumb {
|
|
911
|
+
border: 1px solid rgba(0, 0, 0, 0);
|
|
912
|
+
background-clip: padding-box;
|
|
913
|
+
border-radius: 9999px;
|
|
914
|
+
background-color: #D9D9D9;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
&::-webkit-scrollbar-track {
|
|
918
|
+
background: #F3F3F3;
|
|
919
|
+
border: 1px solid white;
|
|
920
|
+
border-radius: 9999px;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
.dx-area-field-container {
|
|
925
|
+
.dx-pivotgrid-fields-area-head {
|
|
926
|
+
td {
|
|
927
|
+
padding: 0px !important;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
&::-webkit-scrollbar {
|
|
933
|
+
width: 10px;
|
|
934
|
+
height: 10px
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
&::-webkit-scrollbar-thumb {
|
|
938
|
+
border: 1px solid rgba(0, 0, 0, 0);
|
|
939
|
+
background-clip: padding-box;
|
|
940
|
+
border-radius: 9999px;
|
|
941
|
+
background-color: #D9D9D9;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
&::-webkit-scrollbar-track {
|
|
945
|
+
background: #F3F3F3;
|
|
946
|
+
border: 1px solid white;
|
|
947
|
+
border-radius: 9999px;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
814
951
|
.dl-table-chart-container {
|
|
815
952
|
overflow: auto;
|
|
816
953
|
position: absolute;
|
|
@@ -1006,6 +1143,10 @@ $dark-grey: #717585;
|
|
|
1006
1143
|
padding-left: 12px !important;
|
|
1007
1144
|
}
|
|
1008
1145
|
|
|
1146
|
+
.min-width-105 {
|
|
1147
|
+
min-width: 105px !important;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1009
1150
|
.table-link-cell {
|
|
1010
1151
|
color: #1E4AC4 !important;
|
|
1011
1152
|
cursor: pointer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CustomChartProps } from './CustomChart';
|
|
3
|
+
declare type PivotChartProps = {
|
|
4
|
+
customChartProps: CustomChartProps;
|
|
5
|
+
};
|
|
6
|
+
declare const PivotTable: React.ForwardRefExoticComponent<PivotChartProps & React.RefAttributes<unknown>>;
|
|
7
|
+
export default PivotTable;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import "./styles.module.css";
|
|
|
4
4
|
import { ReactWidgetPM } from './types/widget';
|
|
5
5
|
import { DashboardDataBinding } from './types/DashboardDataBinding';
|
|
6
6
|
import { DataPointSelection } from './types/SeriesMeasure';
|
|
7
|
+
import 'devextreme/dist/css/dx.light.css';
|
|
7
8
|
declare type DashboardProps = {
|
|
8
9
|
token: string;
|
|
9
10
|
tenant: number;
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,9 @@ var moment = _interopDefault(require('moment'));
|
|
|
9
9
|
var uuid = require('uuid');
|
|
10
10
|
var datatable = require('primereact/datatable');
|
|
11
11
|
var column = require('primereact/column');
|
|
12
|
+
var PivotGrid = require('devextreme-react/pivot-grid');
|
|
13
|
+
var PivotGrid__default = _interopDefault(PivotGrid);
|
|
14
|
+
var PivotGridDataSource = _interopDefault(require('devextreme/ui/pivot_grid/data_source'));
|
|
12
15
|
var ReactFC = _interopDefault(require('react-fusioncharts'));
|
|
13
16
|
var FusionCharts = _interopDefault(require('fusioncharts'));
|
|
14
17
|
var Charts = _interopDefault(require('fusioncharts/fusioncharts.charts'));
|
|
@@ -16,6 +19,7 @@ var FusionTheme = _interopDefault(require('fusioncharts/themes/fusioncharts.them
|
|
|
16
19
|
var useResizeObserver = _interopDefault(require('use-resize-observer'));
|
|
17
20
|
var Popup = _interopDefault(require('reactjs-popup'));
|
|
18
21
|
var Charts$1 = _interopDefault(require('fusioncharts/fusioncharts.widgets'));
|
|
22
|
+
require('devextreme/dist/css/dx.light.css');
|
|
19
23
|
|
|
20
24
|
function _extends() {
|
|
21
25
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -212,6 +216,14 @@ var DashboardAnalyticsService = /*#__PURE__*/function () {
|
|
|
212
216
|
return this._ApiServices.post("/api/" + this.controller + "/PostGetDataAnalytic", widget, signal);
|
|
213
217
|
};
|
|
214
218
|
|
|
219
|
+
_proto.getTargetAnalyticsData = function getTargetAnalyticsData(widget, signal) {
|
|
220
|
+
if (signal === void 0) {
|
|
221
|
+
signal = undefined;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return this._ApiServices.post("/api/" + this.controller + "/PostGetTargetDataAnalytic", widget, signal);
|
|
225
|
+
};
|
|
226
|
+
|
|
215
227
|
_proto.getKpiData = function getKpiData(widget) {
|
|
216
228
|
return this._ApiServices.post("/api/" + this.controller + "/PostGetKpiData", widget);
|
|
217
229
|
};
|
|
@@ -232,6 +244,10 @@ var DashboardAnalyticsService = /*#__PURE__*/function () {
|
|
|
232
244
|
return this._ApiServices.get("/api/analyticsfactsmetadatas/getsingle?id=" + entityId);
|
|
233
245
|
};
|
|
234
246
|
|
|
247
|
+
_proto.getPivotData = function getPivotData(widget) {
|
|
248
|
+
return this._ApiServices.post("/api/DashboardAnalytics/PostGetPivotData", widget);
|
|
249
|
+
};
|
|
250
|
+
|
|
235
251
|
return DashboardAnalyticsService;
|
|
236
252
|
}();
|
|
237
253
|
|
|
@@ -1320,6 +1336,12 @@ var TableChart = function TableChart(props) {
|
|
|
1320
1336
|
case "IsNotEmpty":
|
|
1321
1337
|
return !isValueEmpty(value);
|
|
1322
1338
|
|
|
1339
|
+
case "Contains":
|
|
1340
|
+
return !isValueEmpty(value) && !isValueEmpty(ruleValue1) && value.includes(ruleValue1);
|
|
1341
|
+
|
|
1342
|
+
case "NotContains":
|
|
1343
|
+
return !isValueEmpty(value) && !isValueEmpty(ruleValue1) && !value.includes(ruleValue1);
|
|
1344
|
+
|
|
1323
1345
|
default:
|
|
1324
1346
|
return null;
|
|
1325
1347
|
}
|
|
@@ -1470,8 +1492,198 @@ var TableChart = function TableChart(props) {
|
|
|
1470
1492
|
}));
|
|
1471
1493
|
};
|
|
1472
1494
|
|
|
1495
|
+
var PivotTable = React.forwardRef(function (props, comRef) {
|
|
1496
|
+
var _useState = React.useState(),
|
|
1497
|
+
setWidget = _useState[1];
|
|
1498
|
+
|
|
1499
|
+
var _useState2 = React.useState(true),
|
|
1500
|
+
isLoading = _useState2[0],
|
|
1501
|
+
setIsLoading = _useState2[1];
|
|
1502
|
+
|
|
1503
|
+
var widgetRefData = React.useRef(null);
|
|
1504
|
+
var tabledata = React.useRef();
|
|
1505
|
+
var pivotGridRef = React.useRef(null);
|
|
1506
|
+
|
|
1507
|
+
var _useState3 = React.useState(new PivotGridDataSource({
|
|
1508
|
+
store: [],
|
|
1509
|
+
fields: []
|
|
1510
|
+
})),
|
|
1511
|
+
dataSource = _useState3[0],
|
|
1512
|
+
setDataSource = _useState3[1];
|
|
1513
|
+
|
|
1514
|
+
React.useEffect(function () {
|
|
1515
|
+
var _props$customChartPro;
|
|
1516
|
+
|
|
1517
|
+
if (props.customChartProps && props.customChartProps.widget) {
|
|
1518
|
+
setWidget(props.customChartProps.widget);
|
|
1519
|
+
widgetRefData.current = props.customChartProps.widget;
|
|
1520
|
+
getPivotTableData();
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
(_props$customChartPro = props.customChartProps.dataBinding) === null || _props$customChartPro === void 0 ? void 0 : _props$customChartPro.widgetUpdated.subscribe(function (updatedWidget) {
|
|
1524
|
+
var _widgetRefData$curren;
|
|
1525
|
+
|
|
1526
|
+
if ((updatedWidget === null || updatedWidget === void 0 ? void 0 : updatedWidget.key) != ((_widgetRefData$curren = widgetRefData.current) === null || _widgetRefData$curren === void 0 ? void 0 : _widgetRefData$curren.key)) return;
|
|
1527
|
+
setWidget(_extends({}, updatedWidget));
|
|
1528
|
+
});
|
|
1529
|
+
document.addEventListener("resizeStop", handleResize);
|
|
1530
|
+
return function () {
|
|
1531
|
+
document.removeEventListener("resizeStop", handleResize);
|
|
1532
|
+
};
|
|
1533
|
+
}, []);
|
|
1534
|
+
React.useEffect(function () {
|
|
1535
|
+
if (props.customChartProps.isInEditMode) {
|
|
1536
|
+
var _pivotGridRef$current;
|
|
1537
|
+
|
|
1538
|
+
if (pivotGridRef.current && (_pivotGridRef$current = pivotGridRef.current) !== null && _pivotGridRef$current !== void 0 && _pivotGridRef$current.instance && pivotGridRef.current.instance.element && pivotGridRef.current.instance.element().classList) {
|
|
1539
|
+
pivotGridRef.current.instance.element().classList.add('force-overflow-hidden');
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
setTimeout(function () {
|
|
1543
|
+
var _pivotGridRef$current2;
|
|
1544
|
+
|
|
1545
|
+
handleResize();
|
|
1546
|
+
|
|
1547
|
+
if (pivotGridRef.current && (_pivotGridRef$current2 = pivotGridRef.current) !== null && _pivotGridRef$current2 !== void 0 && _pivotGridRef$current2.instance && pivotGridRef.current.instance.element && pivotGridRef.current.instance.element().classList) {
|
|
1548
|
+
pivotGridRef.current.instance.element().classList.remove('force-overflow-hidden');
|
|
1549
|
+
}
|
|
1550
|
+
}, 5);
|
|
1551
|
+
}
|
|
1552
|
+
}, [props.customChartProps.isInEditMode]);
|
|
1553
|
+
|
|
1554
|
+
var handleResize = function handleResize() {
|
|
1555
|
+
var _pivotGridRef$current3, _pivotGridRef$current4;
|
|
1556
|
+
|
|
1557
|
+
if (pivotGridRef.current && (_pivotGridRef$current3 = pivotGridRef.current) !== null && _pivotGridRef$current3 !== void 0 && _pivotGridRef$current3.instance && (_pivotGridRef$current4 = pivotGridRef.current) !== null && _pivotGridRef$current4 !== void 0 && _pivotGridRef$current4.instance.repaint) {
|
|
1558
|
+
var _pivotGridRef$current5;
|
|
1559
|
+
|
|
1560
|
+
(_pivotGridRef$current5 = pivotGridRef.current) === null || _pivotGridRef$current5 === void 0 ? void 0 : _pivotGridRef$current5.instance.repaint();
|
|
1561
|
+
}
|
|
1562
|
+
};
|
|
1563
|
+
|
|
1564
|
+
var getPivotTableData = function getPivotTableData(widget) {
|
|
1565
|
+
if (Session.Tenant == 0) {
|
|
1566
|
+
tabledata.current = [];
|
|
1567
|
+
setIsLoading(false);
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
var dashboardAnalyticsService = new DashboardAnalyticsService();
|
|
1572
|
+
dashboardAnalyticsService.getPivotData(props.customChartProps.widget).then(function (res) {
|
|
1573
|
+
tabledata.current = res.data;
|
|
1574
|
+
setPivotDataSourceFields();
|
|
1575
|
+
setIsLoading(false);
|
|
1576
|
+
})["catch"](function (err) {
|
|
1577
|
+
console.log("Error while Getting Pivot Table Data: ", err);
|
|
1578
|
+
tabledata.current = null;
|
|
1579
|
+
setPivotDataSourceFields();
|
|
1580
|
+
setIsLoading(false);
|
|
1581
|
+
});
|
|
1582
|
+
};
|
|
1583
|
+
|
|
1584
|
+
var customizeCells = React.useCallback(function (e) {
|
|
1585
|
+
if (e.cell.rowPath && e.cell.rowPath[0] === "Germany" && e.cell.columnPath && e.cell.columnPath[0] === "Export" && e.cell.columnPath[1] === "Air") {
|
|
1586
|
+
e.cellElement.children[0].style.padding = "6px";
|
|
1587
|
+
e.cellElement.children[0].style.borderRadius = "6px";
|
|
1588
|
+
e.cellElement.children[0].style.backgroundColor = "#f4433673";
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
if (e.cell.rowPath && e.cell.rowPath[0] === "USA" && e.cell.columnPath && e.cell.columnPath[0] === "Import" && e.cell.columnPath[1] === "Inland") {
|
|
1592
|
+
e.cellElement.children[0].style.padding = "6px";
|
|
1593
|
+
e.cellElement.children[0].style.borderRadius = "6px";
|
|
1594
|
+
e.cellElement.children[0].style.backgroundColor = "#03a9f4ad";
|
|
1595
|
+
}
|
|
1596
|
+
}, []);
|
|
1597
|
+
var onCellClick = React.useCallback(function (e) {
|
|
1598
|
+
if (e.area === 'data') {
|
|
1599
|
+
console.log("Pivot Cell Data", e);
|
|
1600
|
+
}
|
|
1601
|
+
}, []);
|
|
1602
|
+
|
|
1603
|
+
var getColumnNameByColumnId = function getColumnNameByColumnId(fieldName, dataField, datafieldValue) {
|
|
1604
|
+
var data = tabledata.current.PivotData.find(function (el) {
|
|
1605
|
+
return el[dataField] == datafieldValue;
|
|
1606
|
+
});
|
|
1607
|
+
return data ? data[fieldName] : '---';
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1610
|
+
var setPivotDataSourceFields = function setPivotDataSourceFields() {
|
|
1611
|
+
if (tabledata.current && tabledata.current.PivoFields && tabledata.current.PivotMeasures) {
|
|
1612
|
+
var pivotRowsAndColumnsFields = tabledata.current.PivoFields.map(function (field) {
|
|
1613
|
+
return {
|
|
1614
|
+
dataField: field.PivotCode,
|
|
1615
|
+
caption: field.DisplayName,
|
|
1616
|
+
name: field.PivotName,
|
|
1617
|
+
width: 150,
|
|
1618
|
+
allowSorting: false,
|
|
1619
|
+
allowFiltering: false,
|
|
1620
|
+
area: field.PivotCode && field.PivotCode.includes('Row') ? 'row' : 'column',
|
|
1621
|
+
expanded: true,
|
|
1622
|
+
wordWrapEnabled: true,
|
|
1623
|
+
customizeText: function customizeText(cellInfo) {
|
|
1624
|
+
return getColumnNameByColumnId(field.PivotName, field.PivotCode, cellInfo.value);
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
});
|
|
1628
|
+
var pivotDataCellsFields = tabledata.current.PivotMeasures.map(function (measure) {
|
|
1629
|
+
return {
|
|
1630
|
+
dataField: measure.PivotMeasureCode,
|
|
1631
|
+
area: 'data',
|
|
1632
|
+
dataType: 'number',
|
|
1633
|
+
summaryType: 'sum',
|
|
1634
|
+
wordWrapEnabled: true,
|
|
1635
|
+
caption: measure.DisplayName
|
|
1636
|
+
};
|
|
1637
|
+
});
|
|
1638
|
+
var AllfieldsData = [].concat(pivotRowsAndColumnsFields, pivotDataCellsFields);
|
|
1639
|
+
setDataSource(new PivotGridDataSource({
|
|
1640
|
+
store: tabledata.current.PivotData,
|
|
1641
|
+
fields: AllfieldsData
|
|
1642
|
+
}));
|
|
1643
|
+
}
|
|
1644
|
+
};
|
|
1645
|
+
|
|
1646
|
+
return React__default.createElement(React__default.Fragment, null, isLoading ? React__default.createElement("div", {
|
|
1647
|
+
className: 'dl-full-hight dl-flex-content-center spinner-custome'
|
|
1648
|
+
}, React__default.createElement(progressspinner.ProgressSpinner, {
|
|
1649
|
+
style: {
|
|
1650
|
+
width: '40px',
|
|
1651
|
+
height: '40px'
|
|
1652
|
+
},
|
|
1653
|
+
strokeWidth: "4",
|
|
1654
|
+
animationDuration: "2s"
|
|
1655
|
+
})) : React__default.createElement(PivotGrid__default, {
|
|
1656
|
+
id: "pivotGridId",
|
|
1657
|
+
ref: pivotGridRef,
|
|
1658
|
+
dataSource: dataSource,
|
|
1659
|
+
allowExpandAll: true,
|
|
1660
|
+
showBorders: true,
|
|
1661
|
+
className: 'pivot-grid-element',
|
|
1662
|
+
onCellClick: onCellClick,
|
|
1663
|
+
showRowGrandTotals: false,
|
|
1664
|
+
showColumnGrandTotals: false,
|
|
1665
|
+
showRowTotals: false,
|
|
1666
|
+
showColumnTotals: false,
|
|
1667
|
+
wordWrapEnabled: true
|
|
1668
|
+
}, React__default.createElement(PivotGrid.FieldPanel, {
|
|
1669
|
+
showColumnFields: false,
|
|
1670
|
+
showDataFields: false,
|
|
1671
|
+
showFilterFields: false,
|
|
1672
|
+
showRowFields: true,
|
|
1673
|
+
texts: {
|
|
1674
|
+
rowFieldArea: ""
|
|
1675
|
+
},
|
|
1676
|
+
allowFieldDragging: false,
|
|
1677
|
+
visible: true
|
|
1678
|
+
}), React__default.createElement(PivotGrid.FieldChooser, {
|
|
1679
|
+
enabled: false
|
|
1680
|
+
}), React__default.createElement(PivotGrid.Scrolling, {
|
|
1681
|
+
mode: "virtual"
|
|
1682
|
+
})));
|
|
1683
|
+
});
|
|
1684
|
+
|
|
1473
1685
|
var CustomChart = function CustomChart(props) {
|
|
1474
|
-
var _props$widget2;
|
|
1686
|
+
var _props$widget2, _props$widget3;
|
|
1475
1687
|
|
|
1476
1688
|
var project = function project() {
|
|
1477
1689
|
var _props$widget;
|
|
@@ -1487,13 +1699,18 @@ var CustomChart = function CustomChart(props) {
|
|
|
1487
1699
|
customChartProps: props
|
|
1488
1700
|
});
|
|
1489
1701
|
|
|
1702
|
+
case "pivot":
|
|
1703
|
+
return React__default.createElement(PivotTable, {
|
|
1704
|
+
customChartProps: props
|
|
1705
|
+
});
|
|
1706
|
+
|
|
1490
1707
|
default:
|
|
1491
1708
|
return React__default.createElement("div", null, "Invalid Type");
|
|
1492
1709
|
}
|
|
1493
1710
|
};
|
|
1494
1711
|
|
|
1495
1712
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
1496
|
-
className: props.widget && ((_props$widget2 = props.widget) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.TypeCode) == 'table' ?
|
|
1713
|
+
className: "dl-custom-chart-container " + (props.widget && ((_props$widget2 = props.widget) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.TypeCode) == 'table' ? 'dl-table-chart-container' : '') + " " + (props.widget && ((_props$widget3 = props.widget) === null || _props$widget3 === void 0 ? void 0 : _props$widget3.TypeCode) == 'pivot' ? 'dl-pivot-chart-container' : '')
|
|
1497
1714
|
}, project()));
|
|
1498
1715
|
};
|
|
1499
1716
|
|
|
@@ -2415,6 +2632,10 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
2415
2632
|
}, 100);
|
|
2416
2633
|
};
|
|
2417
2634
|
|
|
2635
|
+
var isTargetWidget = function isTargetWidget(postWidget) {
|
|
2636
|
+
return postWidget && (postWidget.TypeCode == 'column' || postWidget.TypeCode == 'bar' || postWidget.TypeCode == 'line');
|
|
2637
|
+
};
|
|
2638
|
+
|
|
2418
2639
|
var RefreshData = function RefreshData() {
|
|
2419
2640
|
if (Session.Tenant == 0) {
|
|
2420
2641
|
handleData(null);
|
|
@@ -2437,17 +2658,33 @@ var FusionChart = React.forwardRef(function (props, comRef) {
|
|
|
2437
2658
|
signal = updatedAxiosController === null || updatedAxiosController === void 0 ? void 0 : updatedAxiosController.signal;
|
|
2438
2659
|
}
|
|
2439
2660
|
|
|
2440
|
-
|
|
2441
|
-
handleData(result === null || result === void 0 ? void 0 : result.data);
|
|
2442
|
-
chartData.current = result === null || result === void 0 ? void 0 : result.data;
|
|
2443
|
-
setDataLoaded(true);
|
|
2444
|
-
}, function (error) {
|
|
2445
|
-
var _error$response, _error$response$data, _error$response2, _error$response2$data;
|
|
2661
|
+
var isTargetUsed = isTargetWidget(postWidget) && postWidget.WidgetMeasures && postWidget.WidgetMeasures[1] && postWidget.WidgetMeasures[1].MeasureCode == 'Target';
|
|
2446
2662
|
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2663
|
+
if (isTargetUsed) {
|
|
2664
|
+
dashboardAnalyticsService.getTargetAnalyticsData(postWidget, signal).then(function (result) {
|
|
2665
|
+
handleData(result === null || result === void 0 ? void 0 : result.data);
|
|
2666
|
+
chartData.current = result === null || result === void 0 ? void 0 : result.data;
|
|
2667
|
+
setDataLoaded(true);
|
|
2668
|
+
}, function (error) {
|
|
2669
|
+
var _error$response, _error$response$data, _error$response2, _error$response2$data;
|
|
2670
|
+
|
|
2671
|
+
console.log('error', error);
|
|
2672
|
+
if (error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && (_error$response$data = _error$response.data) !== null && _error$response$data !== void 0 && _error$response$data.ErrorMessage) setError(error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.ErrorMessage);else setError(error.message);
|
|
2673
|
+
setDataLoaded(true);
|
|
2674
|
+
});
|
|
2675
|
+
} else {
|
|
2676
|
+
dashboardAnalyticsService.getData(postWidget, signal).then(function (result) {
|
|
2677
|
+
handleData(result === null || result === void 0 ? void 0 : result.data);
|
|
2678
|
+
chartData.current = result === null || result === void 0 ? void 0 : result.data;
|
|
2679
|
+
setDataLoaded(true);
|
|
2680
|
+
}, function (error) {
|
|
2681
|
+
var _error$response3, _error$response3$data, _error$response4, _error$response4$data;
|
|
2682
|
+
|
|
2683
|
+
console.log('error', error);
|
|
2684
|
+
if (error !== null && error !== void 0 && (_error$response3 = error.response) !== null && _error$response3 !== void 0 && (_error$response3$data = _error$response3.data) !== null && _error$response3$data !== void 0 && _error$response3$data.ErrorMessage) setError(error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : _error$response4$data.ErrorMessage);else setError(error.message);
|
|
2685
|
+
setDataLoaded(true);
|
|
2686
|
+
});
|
|
2687
|
+
}
|
|
2451
2688
|
};
|
|
2452
2689
|
|
|
2453
2690
|
var handleData = function handleData(data, isDummyChange) {
|
|
@@ -2831,7 +3068,7 @@ var FusionChart$1 = React.forwardRef(function (props, comRef) {
|
|
|
2831
3068
|
});
|
|
2832
3069
|
|
|
2833
3070
|
var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
2834
|
-
var _widget$
|
|
3071
|
+
var _widget$current13, _widget$current14, _widget$current15;
|
|
2835
3072
|
|
|
2836
3073
|
var widget = React.useRef();
|
|
2837
3074
|
|
|
@@ -2900,10 +3137,10 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
2900
3137
|
};
|
|
2901
3138
|
|
|
2902
3139
|
var GetChartComponent = function GetChartComponent() {
|
|
2903
|
-
var _widget$current4, _widget$current5, _widget$current6, _widget$current7;
|
|
3140
|
+
var _widget$current4, _widget$current5, _widget$current6, _widget$current7, _widget$current8;
|
|
2904
3141
|
|
|
2905
3142
|
if (isLoading || !((_widget$current4 = widget.current) !== null && _widget$current4 !== void 0 && _widget$current4.TypeCode)) return "";
|
|
2906
|
-
if (((_widget$current5 = widget.current) === null || _widget$current5 === void 0 ? void 0 : _widget$current5.TypeCode) == "kpi" || ((_widget$current6 = widget.current) === null || _widget$current6 === void 0 ? void 0 : _widget$current6.TypeCode) == "table") return React__default.createElement(CustomChart, {
|
|
3143
|
+
if (((_widget$current5 = widget.current) === null || _widget$current5 === void 0 ? void 0 : _widget$current5.TypeCode) == "kpi" || ((_widget$current6 = widget.current) === null || _widget$current6 === void 0 ? void 0 : _widget$current6.TypeCode) == "table" || ((_widget$current7 = widget.current) === null || _widget$current7 === void 0 ? void 0 : _widget$current7.TypeCode) == "pivot") return React__default.createElement(CustomChart, {
|
|
2907
3144
|
isInEditMode: props.isInEditMode,
|
|
2908
3145
|
isPreviewModeActive: props.isPreviewModeActive,
|
|
2909
3146
|
dataBinding: props.dataBinding,
|
|
@@ -2911,7 +3148,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
2911
3148
|
widgetRef: props.widgetRef,
|
|
2912
3149
|
onSelectDataPoint: props.onSelectDataPoint
|
|
2913
3150
|
});
|
|
2914
|
-
if (((_widget$
|
|
3151
|
+
if (((_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.TypeCode) == "gauge") return React__default.createElement(FusionChart$1, {
|
|
2915
3152
|
ref: fusionChartRef,
|
|
2916
3153
|
dataBinding: props.dataBinding,
|
|
2917
3154
|
widget: widget.current,
|
|
@@ -2931,8 +3168,16 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
2931
3168
|
return widget && widget.current && widget.current.TypeCode == 'table';
|
|
2932
3169
|
};
|
|
2933
3170
|
|
|
3171
|
+
var isPivotWidget = function isPivotWidget() {
|
|
3172
|
+
return widget && widget.current && widget.current.TypeCode == 'pivot';
|
|
3173
|
+
};
|
|
3174
|
+
|
|
3175
|
+
var isTableOrPivotWidget = function isTableOrPivotWidget() {
|
|
3176
|
+
return widget && widget.current && (widget.current.TypeCode == 'table' || widget.current.TypeCode == 'pivot');
|
|
3177
|
+
};
|
|
3178
|
+
|
|
2934
3179
|
var getwidgetTitlesContainer = function getwidgetTitlesContainer() {
|
|
2935
|
-
return
|
|
3180
|
+
return isTableOrPivotWidget() ? "widget-table-titles-container" : "widget-titles-container";
|
|
2936
3181
|
};
|
|
2937
3182
|
|
|
2938
3183
|
var drilldownToTableData = function drilldownToTableData() {
|
|
@@ -2947,21 +3192,25 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
2947
3192
|
};
|
|
2948
3193
|
|
|
2949
3194
|
var isThereTitle = function isThereTitle() {
|
|
2950
|
-
var _widget$
|
|
3195
|
+
var _widget$current9, _widget$current10;
|
|
2951
3196
|
|
|
2952
|
-
return ((_widget$
|
|
3197
|
+
return ((_widget$current9 = widget.current) === null || _widget$current9 === void 0 ? void 0 : _widget$current9.Title) && ((_widget$current10 = widget.current) === null || _widget$current10 === void 0 ? void 0 : _widget$current10.Title.length) > 0;
|
|
2953
3198
|
};
|
|
2954
3199
|
|
|
2955
3200
|
var isThereSubtitle = function isThereSubtitle() {
|
|
2956
|
-
var _widget$
|
|
3201
|
+
var _widget$current11, _widget$current12;
|
|
2957
3202
|
|
|
2958
|
-
return ((_widget$
|
|
3203
|
+
return ((_widget$current11 = widget.current) === null || _widget$current11 === void 0 ? void 0 : _widget$current11.Subtitle) && ((_widget$current12 = widget.current) === null || _widget$current12 === void 0 ? void 0 : _widget$current12.Subtitle.length) > 0;
|
|
2959
3204
|
};
|
|
2960
3205
|
|
|
2961
3206
|
var tableHintMessage = function tableHintMessage() {
|
|
2962
3207
|
return React__default.createElement("span", {
|
|
2963
|
-
className: "table-hint-container " + (isTitleAligmentRight() ? "padding-left-12" : "")
|
|
2964
|
-
}, React__default.createElement("span",
|
|
3208
|
+
className: "table-hint-container " + (isPivotWidget() ? "min-width-105" : "") + " " + (isTitleAligmentRight() ? "padding-left-12" : "")
|
|
3209
|
+
}, React__default.createElement("span", {
|
|
3210
|
+
style: {
|
|
3211
|
+
visibility: isTableWidget() ? "visible" : "hidden"
|
|
3212
|
+
}
|
|
3213
|
+
}, isTableWidget() ? "Showing the first 100 rows" : ""), !props.isInEditMode && !props.isPreviewModeActive && isTableWidget() && React__default.createElement(React__default.Fragment, null, React__default.createElement("span", null, "("), React__default.createElement("span", {
|
|
2965
3214
|
onClick: drilldownToTableData,
|
|
2966
3215
|
className: "show-more-records"
|
|
2967
3216
|
}, " Show More Records "), React__default.createElement("span", null, ")")));
|
|
@@ -2976,13 +3225,13 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
2976
3225
|
key: props.el.i
|
|
2977
3226
|
}, React__default.createElement("header", {
|
|
2978
3227
|
key: triggerId,
|
|
2979
|
-
className: "widget-header"
|
|
3228
|
+
className: "widget-header " + (isPivotWidget() ? "pivot-header" : "")
|
|
2980
3229
|
}, React__default.createElement("div", {
|
|
2981
3230
|
className: "header-contents " + (isTableWidget() ? "border-bottom-light-white" : "")
|
|
2982
|
-
}, isTitleAligmentRight() &&
|
|
3231
|
+
}, isTitleAligmentRight() && isTableOrPivotWidget() && tableHintMessage(), React__default.createElement("div", {
|
|
2983
3232
|
style: {
|
|
2984
3233
|
cursor: props.isInEditMode ? "move" : "default",
|
|
2985
|
-
justifyContent:
|
|
3234
|
+
justifyContent: isTableOrPivotWidget() ? getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined) : undefined,
|
|
2986
3235
|
flexDirection: isTitleAligmentRight() ? "row-reverse" : "row"
|
|
2987
3236
|
},
|
|
2988
3237
|
className: getwidgetTitlesContainer()
|
|
@@ -3000,7 +3249,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
3000
3249
|
color: getCSSPropertyValue(widget.current, 'TitleFontColor', ''),
|
|
3001
3250
|
textAlign: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined)
|
|
3002
3251
|
}
|
|
3003
|
-
}, (_widget$
|
|
3252
|
+
}, (_widget$current13 = widget.current) === null || _widget$current13 === void 0 ? void 0 : _widget$current13.Title),
|
|
3004
3253
|
position: ['top center'],
|
|
3005
3254
|
arrowStyle: {
|
|
3006
3255
|
color: '#262626'
|
|
@@ -3009,7 +3258,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
3009
3258
|
on: ['hover', 'focus']
|
|
3010
3259
|
}, React__default.createElement("span", {
|
|
3011
3260
|
className: "widget-title-tooltip-text"
|
|
3012
|
-
}, (_widget$
|
|
3261
|
+
}, (_widget$current14 = widget.current) === null || _widget$current14 === void 0 ? void 0 : _widget$current14.Title))), isTableOrPivotWidget() && isThereTitle() && isThereSubtitle() && React__default.createElement("div", {
|
|
3013
3262
|
className: "titles-vertical-seeparator"
|
|
3014
3263
|
}), React__default.createElement("div", {
|
|
3015
3264
|
className: isThereSubtitle() ? "subtitle" : "subtitle margin-top-4",
|
|
@@ -3017,9 +3266,9 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
|
|
|
3017
3266
|
fontSize: getCSSPropertyValue(widget.current, 'SubtitleFontSize', 'px'),
|
|
3018
3267
|
textAlign: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined),
|
|
3019
3268
|
color: getCSSPropertyValue(widget.current, 'SubtitleFontColor', ''),
|
|
3020
|
-
minWidth: isThereSubtitle() &&
|
|
3269
|
+
minWidth: isThereSubtitle() && isTableOrPivotWidget() ? '5%' : undefined
|
|
3021
3270
|
}
|
|
3022
|
-
}, (_widget$
|
|
3271
|
+
}, (_widget$current15 = widget.current) === null || _widget$current15 === void 0 ? void 0 : _widget$current15.Subtitle)), !isTitleAligmentRight() && isTableOrPivotWidget() && tableHintMessage(), props.isInEditMode && React__default.createElement("div", {
|
|
3023
3272
|
className: isThereTitle() ? "widget-options-container" : "widget-options-container margin-top-6"
|
|
3024
3273
|
}, React__default.createElement(SvgEditIcon, {
|
|
3025
3274
|
onClick: function onClick() {
|
|
@@ -3145,6 +3394,7 @@ var DashboardDesigner = function DashboardDesigner(props) {
|
|
|
3145
3394
|
function onResizeStop(event, oldItem) {
|
|
3146
3395
|
var _widgetCardRef$curren, _widgetCardRef$curren2;
|
|
3147
3396
|
|
|
3397
|
+
document.dispatchEvent(new CustomEvent("resizeStop", {}));
|
|
3148
3398
|
widgetCardRef === null || widgetCardRef === void 0 ? void 0 : (_widgetCardRef$curren = widgetCardRef.current) === null || _widgetCardRef$curren === void 0 ? void 0 : (_widgetCardRef$curren2 = _widgetCardRef$curren.find(function (x) {
|
|
3149
3399
|
return x.i == oldItem.i;
|
|
3150
3400
|
})) === null || _widgetCardRef$curren2 === void 0 ? void 0 : _widgetCardRef$curren2.ref.onResizeFinish(widgetsDictionaryRef.current[oldItem.i].key);
|