logitude-dashboard-library 3.2.11 → 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.
@@ -778,20 +778,23 @@ $dark-grey: #717585;
778
778
  font-weight: bold;
779
779
  font-size: 14px;
780
780
  white-space: nowrap;
781
+ padding: 0px !important;
782
+
783
+ .p-column-header-content {
784
+ padding: 0;
785
+ }
781
786
 
782
787
  .p-column-title {
783
788
  font-weight: bold !important;
784
- font-size: 14px !important;
785
-
786
- .pi {
787
- font-size: 14px !important;
788
- }
789
+ font-size: 14px;
790
+ flex: 1;
789
791
  }
790
792
 
791
793
  .header-content {
792
794
  display: flex;
793
795
  align-items: center;
794
796
  cursor: pointer;
797
+ padding: 1rem 1rem;
795
798
  }
796
799
  }
797
800
 
@@ -836,6 +839,10 @@ $dark-grey: #717585;
836
839
  }
837
840
  }
838
841
 
842
+ .header-content > .p-column-title > .pi::before {
843
+ font-size: inherit !important;
844
+ }
845
+
839
846
  .margin-auto {
840
847
  margin: auto;
841
848
  }
package/dist/index.js CHANGED
@@ -580,6 +580,7 @@ var TableChart = function TableChart(props) {
580
580
  setError = _useState3[1];
581
581
 
582
582
  var _useState4 = React.useState(),
583
+ widget = _useState4[0],
583
584
  setWidget = _useState4[1];
584
585
 
585
586
  var _useState5 = React.useState([]),
@@ -599,11 +600,22 @@ var TableChart = function TableChart(props) {
599
600
  setSortOrder = _useState8[1];
600
601
 
601
602
  var isDefaultSortOptionsUsed = React.useRef(false);
603
+ var widgetRefData = React.useRef(null);
602
604
  React.useEffect(function () {
605
+ var _props$customChartPro;
606
+
603
607
  if (props.customChartProps && props.customChartProps.widget) {
604
608
  setWidget(props.customChartProps.widget);
609
+ widgetRefData.current = props.customChartProps.widget;
605
610
  getTableData(props.customChartProps.widget);
606
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
+ });
607
619
  }, []);
608
620
 
609
621
  var getTableData = function getTableData(widget) {
@@ -753,9 +765,32 @@ var TableChart = function TableChart(props) {
753
765
  return false;
754
766
  };
755
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
+
756
781
  var cellTemplateBody = function cellTemplateBody(data, column) {
757
782
  if (!column || !column.FieldCode) return "";
758
- 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]);
759
794
  };
760
795
 
761
796
  var headerTemplate = function headerTemplate(column) {
@@ -763,15 +798,27 @@ var TableChart = function TableChart(props) {
763
798
 
764
799
  if (sortField != column.FieldCode) {
765
800
  return React__default.createElement("div", {
801
+ style: {
802
+ backgroundColor: getTableFormattingPropertyValue("TableHeaderBackgroundColor")
803
+ },
766
804
  onClick: function onClick() {
767
805
  return sortTableData(column.FieldCode);
768
806
  },
769
807
  className: "header-content"
770
808
  }, React__default.createElement("span", {
809
+ style: {
810
+ color: getTableFormattingPropertyValue("TableHeaderFontColor"),
811
+ fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
812
+ },
771
813
  className: "p-column-title"
772
- }, 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
+ },
773
820
  className: "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-alt"
774
- }));
821
+ })));
775
822
  }
776
823
 
777
824
  if (sortOrder == 1) {
@@ -783,15 +830,27 @@ var TableChart = function TableChart(props) {
783
830
  }
784
831
 
785
832
  return React__default.createElement("div", {
833
+ style: {
834
+ backgroundColor: getTableFormattingPropertyValue("TableHeaderBackgroundColor")
835
+ },
786
836
  onClick: function onClick() {
787
837
  return sortTableData(column.FieldCode);
788
838
  },
789
839
  className: "header-content"
790
840
  }, React__default.createElement("span", {
841
+ style: {
842
+ color: getTableFormattingPropertyValue("TableHeaderFontColor"),
843
+ fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
844
+ },
791
845
  className: "p-column-title"
792
- }, 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
+ },
793
852
  className: sortClassIcon
794
- }));
853
+ })));
795
854
  };
796
855
 
797
856
  return isLoading ? React__default.createElement("div", {