logitude-dashboard-library 3.2.27 → 3.2.29

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.
@@ -1200,4 +1200,18 @@ $dark-grey: #717585;
1200
1200
  color: #1E4AC4 !important;
1201
1201
  cursor: pointer;
1202
1202
  text-decoration: underline;
1203
+ }
1204
+
1205
+ .table-cell-datetime {
1206
+ font-family: 'Manrope';
1207
+ font-weight: 500;
1208
+ }
1209
+
1210
+ .date-time-value-container{
1211
+ display: flex;
1212
+ flex-direction: row;
1213
+ gap: 10px;
1214
+ display: block;
1215
+ overflow: hidden;
1216
+ text-overflow: ellipsis;
1203
1217
  }
package/dist/index.js CHANGED
@@ -1332,13 +1332,26 @@ var TableChart = function TableChart(props) {
1332
1332
  return _value.charAt(0).toUpperCase() + _value.slice(1);
1333
1333
  };
1334
1334
 
1335
- var getDateTimeValue = function getDateTimeValue(value) {
1335
+ var getDateTimeValue = function getDateTimeValue(value, datePart) {
1336
+ if (datePart === void 0) {
1337
+ datePart = null;
1338
+ }
1339
+
1336
1340
  if (!value) return value;
1337
1341
 
1338
1342
  var _date = moment(value);
1339
1343
 
1340
1344
  if (!_date || !_date.isValid()) return value;
1341
- return _date.format("DD MMM YYYY");
1345
+
1346
+ if (!datePart) {
1347
+ return _date.format("DD MMM YYYY") + " " + _date.format("HH:mm");
1348
+ }
1349
+
1350
+ if (datePart == 'Date') {
1351
+ return "" + _date.format("DD MMM YYYY");
1352
+ } else {
1353
+ return "" + _date.format("HH:mm");
1354
+ }
1342
1355
  };
1343
1356
 
1344
1357
  var fillTableData = function fillTableData(tableData) {
@@ -1577,26 +1590,46 @@ var TableChart = function TableChart(props) {
1577
1590
 
1578
1591
  var cellTemplateBody = function cellTemplateBody(data, column) {
1579
1592
  if (!column || !column.FieldCode) return "";
1580
- return column.DataTypeCode == "DateTime" || column.DataTypeCode == "Date" ? React__default.createElement("span", {
1581
- title: getDateTimeValue(data[column.FieldCode]),
1582
- className: "table-cell",
1583
- style: {
1584
- color: getTableFormattingPropertyValue("TableCellFontColor"),
1585
- fontSize: getTableFormattingPropertyValue("TableCellFontSize", "px")
1586
- }
1587
- }, getDateTimeValue(data[column.FieldCode])) : React__default.createElement("span", {
1588
- onClick: function onClick() {
1589
- return tableCellClicked(data, column.FieldCode);
1590
- },
1591
- title: getCellValue(data, column),
1592
- className: "table-cell " + (isClickableCell(column.FieldCode) ? 'table-link-cell' : ''),
1593
- style: {
1594
- color: getTableFormattingPropertyValue("TableCellFontColor"),
1595
- backgroundColor: getCellPropertyByRule(column, data[column.FieldCode], 'RuleBackgroundColor'),
1596
- fontSize: getTableFormattingPropertyValue("TableCellFontSize", "px"),
1597
- "float": getCellFloatAlignment(column)
1598
- }
1599
- }, getCellValue(data, column));
1593
+
1594
+ if (column.DataTypeCode == "DateTime" || column.DataTypeCode == "Date") {
1595
+ var fontColor = getTableFormattingPropertyValue("TableCellFontColor");
1596
+ var fontSizeWithoutUnit = getTableFormattingPropertyValue("TableCellFontSize");
1597
+ var fontSizeWitUnit = getTableFormattingPropertyValue("TableCellFontSize", "px");
1598
+ var width = fontSizeWithoutUnit ? fontSizeWithoutUnit * 6 + "px" : 70 + "px";
1599
+ return React__default.createElement("div", {
1600
+ title: getDateTimeValue(data[column.FieldCode]),
1601
+ className: "date-time-value-container",
1602
+ style: {
1603
+ color: fontColor
1604
+ }
1605
+ }, React__default.createElement("span", {
1606
+ className: "table-cell-datetime",
1607
+ style: {
1608
+ fontSize: fontSizeWitUnit,
1609
+ width: width,
1610
+ display: 'inline-block'
1611
+ }
1612
+ }, getDateTimeValue(data[column.FieldCode], 'Date')), React__default.createElement("span", {
1613
+ className: "table-cell-datetime",
1614
+ style: {
1615
+ fontSize: fontSizeWitUnit
1616
+ }
1617
+ }, getDateTimeValue(data[column.FieldCode], 'Time')));
1618
+ } else {
1619
+ return React__default.createElement("span", {
1620
+ onClick: function onClick() {
1621
+ return tableCellClicked(data, column.FieldCode);
1622
+ },
1623
+ title: getCellValue(data, column),
1624
+ className: "table-cell " + (isClickableCell(column.FieldCode) ? 'table-link-cell' : ''),
1625
+ style: {
1626
+ color: getTableFormattingPropertyValue("TableCellFontColor"),
1627
+ backgroundColor: getCellPropertyByRule(column, data[column.FieldCode], 'RuleBackgroundColor'),
1628
+ fontSize: getTableFormattingPropertyValue("TableCellFontSize", "px"),
1629
+ "float": getCellFloatAlignment(column)
1630
+ }
1631
+ }, getCellValue(data, column));
1632
+ }
1600
1633
  };
1601
1634
 
1602
1635
  var headerTemplate = function headerTemplate(column) {