logitude-dashboard-library 3.2.14 → 3.2.15

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.
@@ -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,197 @@ 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
+ dataType: 'string',
1632
+ area: 'data',
1633
+ wordWrapEnabled: true,
1634
+ caption: measure.DisplayName
1635
+ };
1636
+ });
1637
+ var AllfieldsData = [].concat(pivotRowsAndColumnsFields, pivotDataCellsFields);
1638
+ setDataSource(new PivotGridDataSource({
1639
+ store: tabledata.current.PivotData,
1640
+ fields: AllfieldsData
1641
+ }));
1642
+ }
1643
+ };
1644
+
1645
+ return React__default.createElement(React__default.Fragment, null, isLoading ? React__default.createElement("div", {
1646
+ className: 'dl-full-hight dl-flex-content-center spinner-custome'
1647
+ }, React__default.createElement(progressspinner.ProgressSpinner, {
1648
+ style: {
1649
+ width: '40px',
1650
+ height: '40px'
1651
+ },
1652
+ strokeWidth: "4",
1653
+ animationDuration: "2s"
1654
+ })) : React__default.createElement(PivotGrid__default, {
1655
+ id: "pivotGridId",
1656
+ ref: pivotGridRef,
1657
+ dataSource: dataSource,
1658
+ allowExpandAll: true,
1659
+ showBorders: true,
1660
+ className: 'pivot-grid-element',
1661
+ onCellClick: onCellClick,
1662
+ showRowGrandTotals: false,
1663
+ showColumnGrandTotals: false,
1664
+ showRowTotals: false,
1665
+ showColumnTotals: false,
1666
+ wordWrapEnabled: true
1667
+ }, React__default.createElement(PivotGrid.FieldPanel, {
1668
+ showColumnFields: false,
1669
+ showDataFields: false,
1670
+ showFilterFields: false,
1671
+ showRowFields: true,
1672
+ texts: {
1673
+ rowFieldArea: ""
1674
+ },
1675
+ allowFieldDragging: false,
1676
+ visible: true
1677
+ }), React__default.createElement(PivotGrid.FieldChooser, {
1678
+ enabled: false
1679
+ }), React__default.createElement(PivotGrid.Scrolling, {
1680
+ mode: "virtual"
1681
+ })));
1682
+ });
1683
+
1473
1684
  var CustomChart = function CustomChart(props) {
1474
- var _props$widget2;
1685
+ var _props$widget2, _props$widget3;
1475
1686
 
1476
1687
  var project = function project() {
1477
1688
  var _props$widget;
@@ -1487,13 +1698,18 @@ var CustomChart = function CustomChart(props) {
1487
1698
  customChartProps: props
1488
1699
  });
1489
1700
 
1701
+ case "pivot":
1702
+ return React__default.createElement(PivotTable, {
1703
+ customChartProps: props
1704
+ });
1705
+
1490
1706
  default:
1491
1707
  return React__default.createElement("div", null, "Invalid Type");
1492
1708
  }
1493
1709
  };
1494
1710
 
1495
1711
  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' ? "dl-custom-chart-container dl-table-chart-container" : "dl-custom-chart-container"
1712
+ 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
1713
  }, project()));
1498
1714
  };
1499
1715
 
@@ -2415,6 +2631,10 @@ var FusionChart = React.forwardRef(function (props, comRef) {
2415
2631
  }, 100);
2416
2632
  };
2417
2633
 
2634
+ var isTargetWidget = function isTargetWidget(postWidget) {
2635
+ return postWidget && (postWidget.TypeCode == 'column' || postWidget.TypeCode == 'bar' || postWidget.TypeCode == 'line');
2636
+ };
2637
+
2418
2638
  var RefreshData = function RefreshData() {
2419
2639
  if (Session.Tenant == 0) {
2420
2640
  handleData(null);
@@ -2437,17 +2657,33 @@ var FusionChart = React.forwardRef(function (props, comRef) {
2437
2657
  signal = updatedAxiosController === null || updatedAxiosController === void 0 ? void 0 : updatedAxiosController.signal;
2438
2658
  }
2439
2659
 
2440
- dashboardAnalyticsService.getData(postWidget, signal).then(function (result) {
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;
2660
+ var isTargetUsed = isTargetWidget(postWidget) && postWidget.WidgetMeasures && postWidget.WidgetMeasures[1] && postWidget.WidgetMeasures[1].MeasureCode == 'Target';
2446
2661
 
2447
- console.log('error', error);
2448
- 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);
2449
- setDataLoaded(true);
2450
- });
2662
+ if (isTargetUsed) {
2663
+ dashboardAnalyticsService.getTargetAnalyticsData(postWidget, signal).then(function (result) {
2664
+ handleData(result === null || result === void 0 ? void 0 : result.data);
2665
+ chartData.current = result === null || result === void 0 ? void 0 : result.data;
2666
+ setDataLoaded(true);
2667
+ }, function (error) {
2668
+ var _error$response, _error$response$data, _error$response2, _error$response2$data;
2669
+
2670
+ console.log('error', error);
2671
+ 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);
2672
+ setDataLoaded(true);
2673
+ });
2674
+ } else {
2675
+ dashboardAnalyticsService.getData(postWidget, signal).then(function (result) {
2676
+ handleData(result === null || result === void 0 ? void 0 : result.data);
2677
+ chartData.current = result === null || result === void 0 ? void 0 : result.data;
2678
+ setDataLoaded(true);
2679
+ }, function (error) {
2680
+ var _error$response3, _error$response3$data, _error$response4, _error$response4$data;
2681
+
2682
+ console.log('error', error);
2683
+ 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);
2684
+ setDataLoaded(true);
2685
+ });
2686
+ }
2451
2687
  };
2452
2688
 
2453
2689
  var handleData = function handleData(data, isDummyChange) {
@@ -2831,7 +3067,7 @@ var FusionChart$1 = React.forwardRef(function (props, comRef) {
2831
3067
  });
2832
3068
 
2833
3069
  var WidgetCard = React.forwardRef(function (props, comRef) {
2834
- var _widget$current12, _widget$current13, _widget$current14;
3070
+ var _widget$current13, _widget$current14, _widget$current15;
2835
3071
 
2836
3072
  var widget = React.useRef();
2837
3073
 
@@ -2900,10 +3136,10 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
2900
3136
  };
2901
3137
 
2902
3138
  var GetChartComponent = function GetChartComponent() {
2903
- var _widget$current4, _widget$current5, _widget$current6, _widget$current7;
3139
+ var _widget$current4, _widget$current5, _widget$current6, _widget$current7, _widget$current8;
2904
3140
 
2905
3141
  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, {
3142
+ 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
3143
  isInEditMode: props.isInEditMode,
2908
3144
  isPreviewModeActive: props.isPreviewModeActive,
2909
3145
  dataBinding: props.dataBinding,
@@ -2911,7 +3147,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
2911
3147
  widgetRef: props.widgetRef,
2912
3148
  onSelectDataPoint: props.onSelectDataPoint
2913
3149
  });
2914
- if (((_widget$current7 = widget.current) === null || _widget$current7 === void 0 ? void 0 : _widget$current7.TypeCode) == "gauge") return React__default.createElement(FusionChart$1, {
3150
+ if (((_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.TypeCode) == "gauge") return React__default.createElement(FusionChart$1, {
2915
3151
  ref: fusionChartRef,
2916
3152
  dataBinding: props.dataBinding,
2917
3153
  widget: widget.current,
@@ -2931,8 +3167,16 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
2931
3167
  return widget && widget.current && widget.current.TypeCode == 'table';
2932
3168
  };
2933
3169
 
3170
+ var isPivotWidget = function isPivotWidget() {
3171
+ return widget && widget.current && widget.current.TypeCode == 'pivot';
3172
+ };
3173
+
3174
+ var isTableOrPivotWidget = function isTableOrPivotWidget() {
3175
+ return widget && widget.current && (widget.current.TypeCode == 'table' || widget.current.TypeCode == 'pivot');
3176
+ };
3177
+
2934
3178
  var getwidgetTitlesContainer = function getwidgetTitlesContainer() {
2935
- return isTableWidget() ? "widget-table-titles-container" : "widget-titles-container";
3179
+ return isTableOrPivotWidget() ? "widget-table-titles-container" : "widget-titles-container";
2936
3180
  };
2937
3181
 
2938
3182
  var drilldownToTableData = function drilldownToTableData() {
@@ -2947,21 +3191,25 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
2947
3191
  };
2948
3192
 
2949
3193
  var isThereTitle = function isThereTitle() {
2950
- var _widget$current8, _widget$current9;
3194
+ var _widget$current9, _widget$current10;
2951
3195
 
2952
- return ((_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.Title) && ((_widget$current9 = widget.current) === null || _widget$current9 === void 0 ? void 0 : _widget$current9.Title.length) > 0;
3196
+ 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
3197
  };
2954
3198
 
2955
3199
  var isThereSubtitle = function isThereSubtitle() {
2956
- var _widget$current10, _widget$current11;
3200
+ var _widget$current11, _widget$current12;
2957
3201
 
2958
- return ((_widget$current10 = widget.current) === null || _widget$current10 === void 0 ? void 0 : _widget$current10.Subtitle) && ((_widget$current11 = widget.current) === null || _widget$current11 === void 0 ? void 0 : _widget$current11.Subtitle.length) > 0;
3202
+ 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
3203
  };
2960
3204
 
2961
3205
  var tableHintMessage = function tableHintMessage() {
2962
3206
  return React__default.createElement("span", {
2963
- className: "table-hint-container " + (isTitleAligmentRight() ? "padding-left-12" : "")
2964
- }, React__default.createElement("span", null, "Showing the first 100 rows"), !props.isInEditMode && !props.isPreviewModeActive && React__default.createElement(React__default.Fragment, null, React__default.createElement("span", null, "("), React__default.createElement("span", {
3207
+ className: "table-hint-container " + (isPivotWidget() ? "min-width-105" : "") + " " + (isTitleAligmentRight() ? "padding-left-12" : "")
3208
+ }, React__default.createElement("span", {
3209
+ style: {
3210
+ visibility: isTableWidget() ? "visible" : "hidden"
3211
+ }
3212
+ }, 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
3213
  onClick: drilldownToTableData,
2966
3214
  className: "show-more-records"
2967
3215
  }, " Show More Records "), React__default.createElement("span", null, ")")));
@@ -2976,13 +3224,13 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
2976
3224
  key: props.el.i
2977
3225
  }, React__default.createElement("header", {
2978
3226
  key: triggerId,
2979
- className: "widget-header"
3227
+ className: "widget-header " + (isPivotWidget() ? "pivot-header" : "")
2980
3228
  }, React__default.createElement("div", {
2981
3229
  className: "header-contents " + (isTableWidget() ? "border-bottom-light-white" : "")
2982
- }, isTitleAligmentRight() && isTableWidget() && tableHintMessage(), React__default.createElement("div", {
3230
+ }, isTitleAligmentRight() && isTableOrPivotWidget() && tableHintMessage(), React__default.createElement("div", {
2983
3231
  style: {
2984
3232
  cursor: props.isInEditMode ? "move" : "default",
2985
- justifyContent: isTableWidget() ? getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined) : undefined,
3233
+ justifyContent: isTableOrPivotWidget() ? getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined) : undefined,
2986
3234
  flexDirection: isTitleAligmentRight() ? "row-reverse" : "row"
2987
3235
  },
2988
3236
  className: getwidgetTitlesContainer()
@@ -3000,7 +3248,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
3000
3248
  color: getCSSPropertyValue(widget.current, 'TitleFontColor', ''),
3001
3249
  textAlign: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined)
3002
3250
  }
3003
- }, (_widget$current12 = widget.current) === null || _widget$current12 === void 0 ? void 0 : _widget$current12.Title),
3251
+ }, (_widget$current13 = widget.current) === null || _widget$current13 === void 0 ? void 0 : _widget$current13.Title),
3004
3252
  position: ['top center'],
3005
3253
  arrowStyle: {
3006
3254
  color: '#262626'
@@ -3009,7 +3257,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
3009
3257
  on: ['hover', 'focus']
3010
3258
  }, React__default.createElement("span", {
3011
3259
  className: "widget-title-tooltip-text"
3012
- }, (_widget$current13 = widget.current) === null || _widget$current13 === void 0 ? void 0 : _widget$current13.Title))), isTableWidget() && isThereTitle() && isThereSubtitle() && React__default.createElement("div", {
3260
+ }, (_widget$current14 = widget.current) === null || _widget$current14 === void 0 ? void 0 : _widget$current14.Title))), isTableOrPivotWidget() && isThereTitle() && isThereSubtitle() && React__default.createElement("div", {
3013
3261
  className: "titles-vertical-seeparator"
3014
3262
  }), React__default.createElement("div", {
3015
3263
  className: isThereSubtitle() ? "subtitle" : "subtitle margin-top-4",
@@ -3017,9 +3265,9 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
3017
3265
  fontSize: getCSSPropertyValue(widget.current, 'SubtitleFontSize', 'px'),
3018
3266
  textAlign: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined),
3019
3267
  color: getCSSPropertyValue(widget.current, 'SubtitleFontColor', ''),
3020
- minWidth: isThereSubtitle() && isTableWidget() ? '5%' : undefined
3268
+ minWidth: isThereSubtitle() && isTableOrPivotWidget() ? '5%' : undefined
3021
3269
  }
3022
- }, (_widget$current14 = widget.current) === null || _widget$current14 === void 0 ? void 0 : _widget$current14.Subtitle)), !isTitleAligmentRight() && isTableWidget() && tableHintMessage(), props.isInEditMode && React__default.createElement("div", {
3270
+ }, (_widget$current15 = widget.current) === null || _widget$current15 === void 0 ? void 0 : _widget$current15.Subtitle)), !isTitleAligmentRight() && isTableOrPivotWidget() && tableHintMessage(), props.isInEditMode && React__default.createElement("div", {
3023
3271
  className: isThereTitle() ? "widget-options-container" : "widget-options-container margin-top-6"
3024
3272
  }, React__default.createElement(SvgEditIcon, {
3025
3273
  onClick: function onClick() {
@@ -3145,6 +3393,7 @@ var DashboardDesigner = function DashboardDesigner(props) {
3145
3393
  function onResizeStop(event, oldItem) {
3146
3394
  var _widgetCardRef$curren, _widgetCardRef$curren2;
3147
3395
 
3396
+ document.dispatchEvent(new CustomEvent("resizeStop", {}));
3148
3397
  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
3398
  return x.i == oldItem.i;
3150
3399
  })) === null || _widgetCardRef$curren2 === void 0 ? void 0 : _widgetCardRef$curren2.ref.onResizeFinish(widgetsDictionaryRef.current[oldItem.i].key);