logitude-dashboard-library 3.2.10 → 3.2.12

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.
@@ -674,8 +674,7 @@ $dark-grey: #717585;
674
674
  font-size: 20px;
675
675
  line-height: 125%;
676
676
  color: #292D30;
677
- margin-left: 4.5px;
678
- margin-bottom: 2px;
677
+ margin-left: 5px;
679
678
  }
680
679
 
681
680
  .dl-kpi-abbreviationSymbol {
@@ -686,7 +685,6 @@ $dark-grey: #717585;
686
685
  line-height: 111%;
687
686
  color: #292D30;
688
687
  margin-left: 1px;
689
- margin-bottom: 2px;
690
688
  }
691
689
 
692
690
  .dl-kpi-ratio-container {
@@ -780,20 +778,23 @@ $dark-grey: #717585;
780
778
  font-weight: bold;
781
779
  font-size: 14px;
782
780
  white-space: nowrap;
781
+ padding: 0px !important;
782
+
783
+ .p-column-header-content {
784
+ padding: 0;
785
+ }
783
786
 
784
787
  .p-column-title {
785
788
  font-weight: bold !important;
786
- font-size: 14px !important;
787
-
788
- .pi {
789
- font-size: 14px !important;
790
- }
789
+ font-size: 14px;
790
+ flex: 1;
791
791
  }
792
792
 
793
793
  .header-content {
794
794
  display: flex;
795
795
  align-items: center;
796
796
  cursor: pointer;
797
+ padding: 1rem 1rem;
797
798
  }
798
799
  }
799
800
 
@@ -838,6 +839,10 @@ $dark-grey: #717585;
838
839
  }
839
840
  }
840
841
 
842
+ .header-content > .p-column-title > .pi::before {
843
+ font-size: inherit !important;
844
+ }
845
+
841
846
  .margin-auto {
842
847
  margin: auto;
843
848
  }
package/dist/index.js CHANGED
@@ -436,7 +436,13 @@ var KpiChart = function KpiChart(props) {
436
436
  fontSize: getKPIFormattingPropertyValue("ComparisonValueFontSize", "px")
437
437
  },
438
438
  className: "dl-kpi-prev-abbreviationSymbol"
439
- }, data === null || data === void 0 ? void 0 : data.ComparisonAbbreviationSymbol));
439
+ }, data === null || data === void 0 ? void 0 : data.ComparisonAbbreviationSymbol), widget.current && widget.current.ShowMeasureUnit && (data === null || data === void 0 ? void 0 : data.Unit) && React__default.createElement("div", {
440
+ style: {
441
+ color: getKPIFormattingPropertyValue("ComparisonValueFontColor"),
442
+ fontSize: getKPIFormattingPropertyValue("ComparisonValueFontSize", "px")
443
+ },
444
+ className: "dl-kpi-unit"
445
+ }, data === null || data === void 0 ? void 0 : data.Unit));
440
446
  }
441
447
 
442
448
  function getValueData() {
@@ -574,6 +580,7 @@ var TableChart = function TableChart(props) {
574
580
  setError = _useState3[1];
575
581
 
576
582
  var _useState4 = React.useState(),
583
+ widget = _useState4[0],
577
584
  setWidget = _useState4[1];
578
585
 
579
586
  var _useState5 = React.useState([]),
@@ -593,11 +600,22 @@ var TableChart = function TableChart(props) {
593
600
  setSortOrder = _useState8[1];
594
601
 
595
602
  var isDefaultSortOptionsUsed = React.useRef(false);
603
+ var widgetRefData = React.useRef(null);
596
604
  React.useEffect(function () {
605
+ var _props$customChartPro;
606
+
597
607
  if (props.customChartProps && props.customChartProps.widget) {
598
608
  setWidget(props.customChartProps.widget);
609
+ widgetRefData.current = props.customChartProps.widget;
599
610
  getTableData(props.customChartProps.widget);
600
611
  }
612
+
613
+ (_props$customChartPro = props.customChartProps.dataBinding) === null || _props$customChartPro === void 0 ? void 0 : _props$customChartPro.widgetUpdated.subscribe(function (updatedWidget) {
614
+ var _widgetRefData$curren;
615
+
616
+ 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;
617
+ setWidget(_extends({}, updatedWidget));
618
+ });
601
619
  }, []);
602
620
 
603
621
  var getTableData = function getTableData(widget) {
@@ -747,9 +765,32 @@ var TableChart = function TableChart(props) {
747
765
  return false;
748
766
  };
749
767
 
768
+ var getTableFormattingData = function getTableFormattingData() {
769
+ return widget && isNullOrUndefinedOrEmpty(widget.TableFormatSettings) ? {} : JSON.parse(widget === null || widget === void 0 ? void 0 : widget.TableFormatSettings);
770
+ };
771
+
772
+ var getTableFormattingPropertyValue = function getTableFormattingPropertyValue(propertyName, unit) {
773
+ if (unit === void 0) {
774
+ unit = "";
775
+ }
776
+
777
+ var tableFormattingData = getTableFormattingData();
778
+ return tableFormattingData && tableFormattingData[propertyName] ? tableFormattingData[propertyName] + unit : undefined;
779
+ };
780
+
750
781
  var cellTemplateBody = function cellTemplateBody(data, column) {
751
782
  if (!column || !column.FieldCode) return "";
752
- return column.DataTypeCode == "DateTime" || column.DataTypeCode == "Date" ? getDateTimeValue(data[column.FieldCode]) : data[column.FieldCode];
783
+ return column.DataTypeCode == "DateTime" || column.DataTypeCode == "Date" ? React__default.createElement("span", {
784
+ style: {
785
+ color: getTableFormattingPropertyValue("TableCellFontColor"),
786
+ fontSize: getTableFormattingPropertyValue("TableCellFontSize", "px")
787
+ }
788
+ }, getDateTimeValue(data[column.FieldCode])) : React__default.createElement("span", {
789
+ style: {
790
+ color: getTableFormattingPropertyValue("TableCellFontColor"),
791
+ fontSize: getTableFormattingPropertyValue("TableCellFontSize", "px")
792
+ }
793
+ }, data[column.FieldCode]);
753
794
  };
754
795
 
755
796
  var headerTemplate = function headerTemplate(column) {
@@ -757,15 +798,27 @@ var TableChart = function TableChart(props) {
757
798
 
758
799
  if (sortField != column.FieldCode) {
759
800
  return React__default.createElement("div", {
801
+ style: {
802
+ backgroundColor: getTableFormattingPropertyValue("TableHeaderBackgroundColor")
803
+ },
760
804
  onClick: function onClick() {
761
805
  return sortTableData(column.FieldCode);
762
806
  },
763
807
  className: "header-content"
764
808
  }, React__default.createElement("span", {
809
+ style: {
810
+ color: getTableFormattingPropertyValue("TableHeaderFontColor"),
811
+ fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
812
+ },
765
813
  className: "p-column-title"
766
- }, column.DisplayName), canSort() && React__default.createElement("span", {
814
+ }, column.DisplayName, canSort() && React__default.createElement("span", {
815
+ style: {
816
+ fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px"),
817
+ width: getTableFormattingPropertyValue("TableHeaderFontSize", "px"),
818
+ height: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
819
+ },
767
820
  className: "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-alt"
768
- }));
821
+ })));
769
822
  }
770
823
 
771
824
  if (sortOrder == 1) {
@@ -777,15 +830,27 @@ var TableChart = function TableChart(props) {
777
830
  }
778
831
 
779
832
  return React__default.createElement("div", {
833
+ style: {
834
+ backgroundColor: getTableFormattingPropertyValue("TableHeaderBackgroundColor")
835
+ },
780
836
  onClick: function onClick() {
781
837
  return sortTableData(column.FieldCode);
782
838
  },
783
839
  className: "header-content"
784
840
  }, React__default.createElement("span", {
841
+ style: {
842
+ color: getTableFormattingPropertyValue("TableHeaderFontColor"),
843
+ fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
844
+ },
785
845
  className: "p-column-title"
786
- }, column.DisplayName), canSort() && React__default.createElement("span", {
846
+ }, column.DisplayName, canSort() && React__default.createElement("span", {
847
+ style: {
848
+ fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px"),
849
+ width: getTableFormattingPropertyValue("TableHeaderFontSize", "px"),
850
+ height: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
851
+ },
787
852
  className: sortClassIcon
788
- }));
853
+ })));
789
854
  };
790
855
 
791
856
  return isLoading ? React__default.createElement("div", {