logitude-dashboard-library 3.1.26 → 3.1.27

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.
@@ -278,7 +278,7 @@ $dark-grey: #717585;
278
278
 
279
279
  .header-contents {
280
280
  display: flex;
281
-
281
+
282
282
  .widget-titles-container {
283
283
  display: flex;
284
284
  flex-wrap: wrap;
@@ -326,12 +326,90 @@ $dark-grey: #717585;
326
326
  width: 100%;
327
327
  }
328
328
  }
329
+
330
+ .widget-table-titles-container {
331
+ display: flex;
332
+ flex: 1;
333
+ align-items: center;
334
+ justify-content: flex-start;
335
+ width: calc(100% - 70px);
336
+ padding: 0px 12px;
337
+ min-height: 40px;
329
338
 
339
+ .title-container {
340
+ display: flex;
341
+ align-items: center;
342
+ justify-content: left;
343
+ white-space: nowrap;
344
+ overflow: hidden;
345
+ text-overflow: ellipsis;
346
+ width: auto;
347
+ max-width: 35%;
348
+
349
+ .title {
350
+ text-transform: capitalize;
351
+ font-family: 'Manrope', sans-serif;
352
+ font-style: normal;
353
+ color: #292D30;
354
+ font-size: 12px;
355
+ font-weight: 600;
356
+ white-space: nowrap;
357
+ overflow: hidden;
358
+ text-overflow: ellipsis;
359
+ width: auto;
360
+ }
361
+ }
362
+
363
+ .subtitle {
364
+ font-family: "Manrope", sans-serif;
365
+ font-style: normal;
366
+ color: #A4A4A4;
367
+ font-size: 12px;
368
+ font-weight: 600;
369
+ white-space: nowrap;
370
+ overflow: hidden;
371
+ text-overflow: ellipsis;
372
+ width: auto;
373
+ flex: 1;
374
+ }
375
+
376
+ .titles-vertical-seeparator {
377
+ width: 1px;
378
+ height: 14px;
379
+ background: #D9D9D9;
380
+ margin: 0px 6px;
381
+ }
382
+
383
+ .table-hint-container {
384
+ width: auto;
385
+ max-width: 300px;
386
+ text-overflow: ellipsis;
387
+ overflow: hidden;
388
+ white-space: nowrap;
389
+ min-width: 1px;
390
+ padding-top: 2px;
391
+ line-height: 11px;
392
+ font-size: 11px;
393
+ color: #A4A4A4;
394
+ padding-left: 12px;
395
+
396
+ .show-more-records {
397
+ color: #5FAFDA;
398
+ cursor: pointer;
399
+ }
400
+
401
+ & > span {
402
+ font-size: 12px;
403
+ }
404
+ }
405
+ }
406
+
330
407
  .widget-options-container {
331
408
  display: flex;
332
409
  align-items: center;
333
410
  width: 68px;
334
411
  column-gap: 6px;
412
+ padding-top: 6px;
335
413
 
336
414
  svg {
337
415
  width: 20px;
@@ -388,25 +466,6 @@ $dark-grey: #717585;
388
466
  align-items: flex-start;
389
467
  }
390
468
 
391
- .table-hint-container {
392
- display: flex;
393
- align-items: center;
394
- justify-content: flex-start;
395
-
396
- .table-rows-number-indicator {
397
- margin: 4px 0px 2px 0px;
398
- color: #939393;
399
- font-size: 11px;
400
- padding-left: 12px;
401
- }
402
- .show-more-records {
403
- font-size: 11px;
404
- color: #1967d2;
405
- cursor: pointer;
406
- margin: 3px 0px 2px 4px;
407
- }
408
- }
409
-
410
469
  .filter-label {
411
470
  font-size: 12px;
412
471
  color: $dark-grey;
@@ -688,9 +747,10 @@ $dark-grey: #717585;
688
747
  display: flex;
689
748
  width: 100%;
690
749
  height: 100%;
691
- padding: 0.5rem 1rem;
692
- white-space: normal;
750
+ padding: 7px 12px;
693
751
  align-items: center;
752
+ word-break: break-word;
753
+ white-space: pre-line;
694
754
  }
695
755
 
696
756
  .dl-kpi-abbreviationSymbol {
@@ -748,12 +808,12 @@ $dark-grey: #717585;
748
808
  .dl-table-chart-container {
749
809
  overflow: auto;
750
810
  position: absolute;
751
- top: 22px;
811
+ top: -1px;
752
812
  right: 0;
753
813
  left: 0;
754
814
  bottom: 0;
755
- height: calc(100% - 35px);
756
- width: calc(100% - 25px);
815
+ height: calc(100% - 10px);
816
+ width: 100%;
757
817
  margin: 0 auto;
758
818
 
759
819
  &::-webkit-scrollbar {
@@ -785,7 +845,7 @@ $dark-grey: #717585;
785
845
 
786
846
  td,
787
847
  th {
788
- border: 1px solid #ddd;
848
+ border-bottom: 1px solid #E7E7E6 !important;
789
849
  padding: 8px;
790
850
  }
791
851
 
@@ -810,10 +870,14 @@ $dark-grey: #717585;
810
870
  display: flex;
811
871
  align-items: center;
812
872
  cursor: pointer;
813
- padding: 1rem 1rem;
873
+ padding: 11px 12px;
814
874
  }
815
875
  }
816
876
 
877
+ th:not(:last-child) .header-content {
878
+ border-right: 1px solid #E7E7E6;
879
+ }
880
+
817
881
  td {
818
882
  border: 1px solid #ddd;
819
883
  padding: 0px !important;
@@ -832,16 +896,16 @@ $dark-grey: #717585;
832
896
  line-height: 10px;
833
897
  }
834
898
 
835
- tbody tr td{
836
- font-size: 14px;
899
+ tbody tr:last-child td {
900
+ border: 0px !important
837
901
  }
838
902
 
839
- tr:nth-child(even) {
840
- background-color: #f2f2f2;
903
+ tbody tr td{
904
+ font-size: 14px;
841
905
  }
842
906
 
843
907
  tr:hover {
844
- background-color: #ddd;
908
+ background-color: #f3f3f3;
845
909
  }
846
910
 
847
911
  .p-datatable .p-sortable-column.p-highlight:not(.p-sortable-disabled):hover,
@@ -925,4 +989,8 @@ $dark-grey: #717585;
925
989
 
926
990
  .fc__tooltip {
927
991
  max-width: 350px !important;
992
+ }
993
+
994
+ .border-bottom-light-white {
995
+ border-bottom: 1px solid #E7E7E6;
928
996
  }
package/dist/index.js CHANGED
@@ -729,6 +729,7 @@ var TableChart = function TableChart(props) {
729
729
  };
730
730
 
731
731
  var sortTableData = function sortTableData(sortedField) {
732
+ if (!canSort()) return;
732
733
  setSortField(sortedField);
733
734
 
734
735
  var _sortOrder = sortOrder == 1 ? -1 : sortOrder == -1 ? 1 : 1;
@@ -853,6 +854,14 @@ var TableChart = function TableChart(props) {
853
854
  return !isNullOrUndefinedOrEmpty(firstValidRule[propertyName]) ? firstValidRule[propertyName] : defaultValue ? getTableFormattingPropertyValue(defaultValue) : undefined;
854
855
  };
855
856
 
857
+ var getCellContentAlignment = function getCellContentAlignment(column) {
858
+ if (column.DataTypeCode == 'Decimal' || column.DataTypeCode == 'Integer' || column.DataTypeCode == 'Double' || column.DataTypeCode == 'SigDouble') {
859
+ return "flex-end";
860
+ }
861
+
862
+ return "flex-start";
863
+ };
864
+
856
865
  var cellTemplateBody = function cellTemplateBody(data, column) {
857
866
  if (!column || !column.FieldCode) return "";
858
867
  return column.DataTypeCode == "DateTime" || column.DataTypeCode == "Date" ? React__default.createElement("span", {
@@ -866,13 +875,13 @@ var TableChart = function TableChart(props) {
866
875
  style: {
867
876
  color: getCellPropertyByRule(column, data[column.FieldCode], 'RuleFontColor', 'TableCellFontColor'),
868
877
  backgroundColor: getCellPropertyByRule(column, data[column.FieldCode], 'RuleBackgroundColor'),
869
- fontSize: getTableFormattingPropertyValue("TableCellFontSize", "px")
878
+ fontSize: getTableFormattingPropertyValue("TableCellFontSize", "px"),
879
+ justifyContent: getCellContentAlignment(column)
870
880
  }
871
881
  }, data[column.FieldCode]);
872
882
  };
873
883
 
874
884
  var headerTemplate = function headerTemplate(column) {
875
- var sortClassIcon = "";
876
885
 
877
886
  if (sortField != column.FieldCode) {
878
887
  return React__default.createElement("div", {
@@ -889,22 +898,7 @@ var TableChart = function TableChart(props) {
889
898
  fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
890
899
  },
891
900
  className: "p-column-title"
892
- }, column.DisplayName, canSort() && React__default.createElement("span", {
893
- style: {
894
- fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px"),
895
- width: getTableFormattingPropertyValue("TableHeaderFontSize", "px"),
896
- height: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
897
- },
898
- className: "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-alt"
899
- })));
900
- }
901
-
902
- if (sortOrder == 1) {
903
- sortClassIcon = "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-amount-up-alt";
904
- } else if (sortOrder == -1) {
905
- sortClassIcon = "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-amount-down";
906
- } else {
907
- sortClassIcon = "p-sortable-column-icon p-ml-2 pi pi-fw pi-sort-alt";
901
+ }, column.DisplayName));
908
902
  }
909
903
 
910
904
  return React__default.createElement("div", {
@@ -921,14 +915,7 @@ var TableChart = function TableChart(props) {
921
915
  fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
922
916
  },
923
917
  className: "p-column-title"
924
- }, column.DisplayName, canSort() && React__default.createElement("span", {
925
- style: {
926
- fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px"),
927
- width: getTableFormattingPropertyValue("TableHeaderFontSize", "px"),
928
- height: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
929
- },
930
- className: sortClassIcon
931
- })));
918
+ }, column.DisplayName));
932
919
  };
933
920
 
934
921
  return isLoading ? React__default.createElement("div", {
@@ -969,7 +956,7 @@ var TableChart = function TableChart(props) {
969
956
  };
970
957
 
971
958
  var CustomChart = function CustomChart(props) {
972
- var _props$widget2, _props$widget3, _props$widget4;
959
+ var _props$widget2;
973
960
 
974
961
  var project = function project() {
975
962
  var _props$widget;
@@ -990,26 +977,8 @@ var CustomChart = function CustomChart(props) {
990
977
  }
991
978
  };
992
979
 
993
- var drilldownToTableData = function drilldownToTableData() {
994
- props.onSelectDataPoint({
995
- GroupById: undefined,
996
- MeasureFieldId: undefined,
997
- MeasureCode: undefined,
998
- Formula: undefined,
999
- Widget: props.widget,
1000
- GroupByIdSec: undefined
1001
- });
1002
- };
1003
-
1004
- return React__default.createElement(React__default.Fragment, null, ((_props$widget2 = props.widget) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.TypeCode) && ((_props$widget3 = props.widget) === null || _props$widget3 === void 0 ? void 0 : _props$widget3.TypeCode) == 'table' && React__default.createElement("div", {
1005
- className: "table-hint-container"
1006
- }, React__default.createElement("div", {
1007
- className: "table-rows-number-indicator"
1008
- }, "Showing the first 100 rows"), !props.isInEditMode && !props.isPreviewModeActive && React__default.createElement("div", {
1009
- onClick: drilldownToTableData,
1010
- className: "show-more-records"
1011
- }, "( Show More Records )")), React__default.createElement("div", {
1012
- className: props.widget && ((_props$widget4 = props.widget) === null || _props$widget4 === void 0 ? void 0 : _props$widget4.TypeCode) == 'table' ? "dl-custom-chart-container dl-table-chart-container" : "dl-custom-chart-container"
980
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
981
+ 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"
1013
982
  }, project()));
1014
983
  };
1015
984
 
@@ -2154,7 +2123,7 @@ function SvgCopyIcon(props) {
2154
2123
  }
2155
2124
 
2156
2125
  var WidgetCard = React.forwardRef(function (props, comRef) {
2157
- var _widget$current7, _widget$current8, _widget$current9, _widget$current10, _widget$current11, _widget$current12, _widget$current13;
2126
+ var _widget$current7, _widget$current8, _widget$current9, _widget$current10, _widget$current11, _widget$current12, _widget$current13, _widget$current14, _widget$current15, _widget$current16, _widget$current17;
2158
2127
 
2159
2128
  var widget = React.useRef();
2160
2129
 
@@ -2243,6 +2212,25 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
2243
2212
  });
2244
2213
  };
2245
2214
 
2215
+ var isTableWidget = function isTableWidget() {
2216
+ return widget && widget.current && widget.current.TypeCode == 'table';
2217
+ };
2218
+
2219
+ var getwidgetTitlesContainer = function getwidgetTitlesContainer() {
2220
+ return isTableWidget() ? "widget-table-titles-container" : "widget-titles-container";
2221
+ };
2222
+
2223
+ var drilldownToTableData = function drilldownToTableData() {
2224
+ props.onSelectDataPoint({
2225
+ GroupById: undefined,
2226
+ MeasureFieldId: undefined,
2227
+ MeasureCode: undefined,
2228
+ Formula: undefined,
2229
+ Widget: widget.current,
2230
+ GroupByIdSec: undefined
2231
+ });
2232
+ };
2233
+
2246
2234
  return React__default.createElement("div", {
2247
2235
  className: "dl-panel",
2248
2236
  key: props.el.i
@@ -2250,12 +2238,12 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
2250
2238
  key: triggerId,
2251
2239
  className: "widget-header"
2252
2240
  }, React__default.createElement("div", {
2253
- className: "header-contents"
2241
+ className: "header-contents " + (isTableWidget() ? "border-bottom-light-white" : "")
2254
2242
  }, React__default.createElement("div", {
2255
2243
  style: {
2256
2244
  cursor: props.isInEditMode ? "move" : "default"
2257
2245
  },
2258
- className: "widget-titles-container"
2246
+ className: getwidgetTitlesContainer()
2259
2247
  }, React__default.createElement("div", {
2260
2248
  className: "title-container",
2261
2249
  style: {
@@ -2279,16 +2267,24 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
2279
2267
  on: ['hover', 'focus']
2280
2268
  }, React__default.createElement("span", {
2281
2269
  className: "widget-title-tooltip-text"
2282
- }, (_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.Title))), React__default.createElement("div", {
2283
- className: (_widget$current9 = widget.current) !== null && _widget$current9 !== void 0 && _widget$current9.Subtitle && ((_widget$current10 = widget.current) === null || _widget$current10 === void 0 ? void 0 : _widget$current10.Subtitle.length) > 0 ? "subtitle" : "subtitle margin-top-4",
2270
+ }, (_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.Title))), isTableWidget() && ((_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 && React__default.createElement("div", {
2271
+ className: "titles-vertical-seeparator"
2272
+ }), React__default.createElement("div", {
2273
+ className: (_widget$current11 = widget.current) !== null && _widget$current11 !== void 0 && _widget$current11.Subtitle && ((_widget$current12 = widget.current) === null || _widget$current12 === void 0 ? void 0 : _widget$current12.Subtitle.length) > 0 ? "subtitle" : "subtitle margin-top-4",
2284
2274
  style: {
2285
2275
  fontSize: getCSSPropertyValue(widget.current, 'SubtitleFontSize', 'px'),
2286
2276
  textAlign: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined),
2287
- color: getCSSPropertyValue(widget.current, 'SubtitleFontColor', '')
2277
+ color: getCSSPropertyValue(widget.current, 'SubtitleFontColor', ''),
2278
+ minWidth: (_widget$current13 = widget.current) !== null && _widget$current13 !== void 0 && _widget$current13.Subtitle && ((_widget$current14 = widget.current) === null || _widget$current14 === void 0 ? void 0 : _widget$current14.Subtitle.length) > 0 && isTableWidget() ? '5%' : undefined
2288
2279
  }
2289
- }, (_widget$current11 = widget.current) === null || _widget$current11 === void 0 ? void 0 : _widget$current11.Subtitle)), React__default.createElement("div", {
2290
- className: (_widget$current12 = widget.current) !== null && _widget$current12 !== void 0 && _widget$current12.Title && ((_widget$current13 = widget.current) === null || _widget$current13 === void 0 ? void 0 : _widget$current13.Title.length) > 0 ? "widget-options-container" : "widget-options-container margin-top-6"
2291
- }, props.isInEditMode ? React__default.createElement(React__default.Fragment, null, React__default.createElement(SvgEditIcon, {
2280
+ }, (_widget$current15 = widget.current) === null || _widget$current15 === void 0 ? void 0 : _widget$current15.Subtitle), isTableWidget() && React__default.createElement("span", {
2281
+ className: "table-hint-container"
2282
+ }, 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", {
2283
+ onClick: drilldownToTableData,
2284
+ className: "show-more-records"
2285
+ }, " Show More Records "), React__default.createElement("span", null, ")")))), props.isInEditMode && React__default.createElement("div", {
2286
+ className: (_widget$current16 = widget.current) !== null && _widget$current16 !== void 0 && _widget$current16.Title && ((_widget$current17 = widget.current) === null || _widget$current17 === void 0 ? void 0 : _widget$current17.Title.length) > 0 ? "widget-options-container" : "widget-options-container margin-top-6"
2287
+ }, React__default.createElement(SvgEditIcon, {
2292
2288
  onClick: function onClick() {
2293
2289
  return editWidget();
2294
2290
  }
@@ -2302,7 +2298,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
2302
2298
 
2303
2299
  return props.deleteBtnClicked((_props$widget = props.widget) === null || _props$widget === void 0 ? void 0 : _props$widget.key);
2304
2300
  }
2305
- })) : null))), React__default.createElement("div", {
2301
+ })))), React__default.createElement("div", {
2306
2302
  className: "dl-dashboard-widget"
2307
2303
  }, GetChartComponent()));
2308
2304
  });