@desynova-digital/components 9.3.20 → 9.3.21

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.
@@ -80,7 +80,7 @@ var _InputText = function InputText(_ref) {
80
80
  value: props.value,
81
81
  theme: theme,
82
82
  error: props.error
83
- }, errorMesssage || "") : "", maxLength && showLengthCount && /*#__PURE__*/_react["default"].createElement(CountWrappper, null, props.value.length, "/", maxLength), type == "password" || passwordButton ? /*#__PURE__*/_react["default"].createElement(PasswordToggleButton, {
83
+ }, errorMesssage) : "", maxLength && showLengthCount && /*#__PURE__*/_react["default"].createElement(CountWrappper, null, props.value.length, "/", maxLength), type == "password" || passwordButton ? /*#__PURE__*/_react["default"].createElement(PasswordToggleButton, {
84
84
  type: "button",
85
85
  className: "password-toggle",
86
86
  onClick: function onClick() {
@@ -377,7 +377,8 @@ var Table = /*#__PURE__*/function (_Component) {
377
377
  });
378
378
  var allRegularColumns = (0, _toConsumableArray2["default"])(_this.columns);
379
379
  _this.defaultShowColumns = (0, _toConsumableArray2["default"])(allRegularColumns);
380
- _this.extraColumns = (0, _toConsumableArray2["default"])(allRegularColumns);
380
+ // Only truncated columns belong in the expanded row; avoid duplicating visible fields.
381
+ _this.extraColumns = [];
381
382
  var maxRegularColumns = _this.props.showActions ? _this.props.maxShowNoOfColumns - 1 : _this.props.maxShowNoOfColumns;
382
383
  var needsTruncation = _this.columns.length > maxRegularColumns;
383
384
  if (needsTruncation) {
@@ -387,7 +388,9 @@ var Table = /*#__PURE__*/function (_Component) {
387
388
  (_this$defaultShowColu2 = _this.defaultShowColumns).push.apply(_this$defaultShowColu2, (0, _toConsumableArray2["default"])(_this.actionIconCol));
388
389
  }
389
390
  _this.defaultShowColumns.push(extraColumnsSchema);
390
- _this.extraColumns.splice(0, maxRegularColumns);
391
+
392
+ // Keep overflow fields in schema order, after the main row's column limit.
393
+ _this.extraColumns = allRegularColumns.slice(maxRegularColumns);
391
394
  } else if (_this.props.showActions && _this.actionIconCol.length > 0) {
392
395
  var _this$defaultShowColu3;
393
396
  (_this$defaultShowColu3 = _this.defaultShowColumns).push.apply(_this$defaultShowColu3, (0, _toConsumableArray2["default"])(_this.actionIconCol));
@@ -548,21 +551,29 @@ var Table = /*#__PURE__*/function (_Component) {
548
551
  width: "100%"
549
552
  });
550
553
  }
551
- if (!_this.hasNestedRows(item)) {
554
+ // Plain overflow fields can expand even when the row has no nested table.
555
+ if (!_this.state.extraColumns.length && !_this.hasNestedRows(item)) {
552
556
  return null;
553
557
  }
554
558
  return /*#__PURE__*/_react["default"].createElement(ExpandToggle, {
559
+ $preserveActionPosition: _this.props.preserveActionPosition,
555
560
  className: "expand-toggle".concat(_this.state.showExtraRow === idx ? " is-expanded" : ""),
556
561
  onClick: function onClick(e) {
557
562
  _this.toggleExtraDetails(e, idx);
558
563
  }
559
- }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
564
+ }, _this.props.preserveActionPosition ? /*#__PURE__*/_react["default"].createElement(_icon["default"], {
560
565
  theme: _this.props.theme,
561
566
  name: "right-arrow-chevron",
562
567
  width: 12,
563
568
  height: 12,
564
569
  color: "none",
565
570
  stroke: _tokens.colors[_this.props.theme].table.tdColor
571
+ }) : /*#__PURE__*/_react["default"].createElement(_icon["default"], {
572
+ theme: _this.props.theme,
573
+ name: "triangle-carat",
574
+ width: 10,
575
+ height: 6,
576
+ color: _tokens.colors[_this.props.theme].table.tdColor
566
577
  }));
567
578
  }
568
579
  /**
@@ -956,7 +967,9 @@ var Table = /*#__PURE__*/function (_Component) {
956
967
  var lastLeftField = null;
957
968
  for (var i = 0; i < visibleColumns.length; i += 1) {
958
969
  var column = visibleColumns[i];
959
- var structural = STRUCTURAL_LEFT_FIELDS.includes(column.field);
970
+ // Only the leading nested-table toggle is structural; the trailing toggle after Actions
971
+ // should use normal cell styling instead of the left-pinned background and shadow.
972
+ var structural = STRUCTURAL_LEFT_FIELDS.includes(column.field) && (column.field !== "extra_columns" || _this.props.preserveActionPosition);
960
973
  if (structural || isPinned(column.pinned_left)) {
961
974
  var width = toPxNumber(_this.getColumnWidth(column));
962
975
  if (width === undefined) {
@@ -1900,7 +1913,7 @@ var Table = /*#__PURE__*/function (_Component) {
1900
1913
  }, cellRenderer(item, column, index)));
1901
1914
  }
1902
1915
  return filler;
1903
- }), fillerIndex >= _this5.defaultShowColumns.length && _this5.renderFillerCell("".concat(index, "-filler-end"))), (_this5.state.showExtraRow === index || _this5.state.closingExtraRow === index) && _this5.hasNestedRows(item) ? /*#__PURE__*/_react["default"].createElement(Table.Row, {
1916
+ }), fillerIndex >= _this5.defaultShowColumns.length && _this5.renderFillerCell("".concat(index, "-filler-end"))), (_this5.state.showExtraRow === index || _this5.state.closingExtraRow === index) && (_this5.state.extraColumns.length > 0 || _this5.hasNestedRows(item)) ? /*#__PURE__*/_react["default"].createElement(Table.Row, {
1904
1917
  theme: _this5.props.theme,
1905
1918
  key: "row-" + index + "extra"
1906
1919
  }, /*#__PURE__*/_react["default"].createElement(Table.Cell, {
@@ -1912,7 +1925,26 @@ var Table = /*#__PURE__*/function (_Component) {
1912
1925
  // className="tableHolder"
1913
1926
  }, /*#__PURE__*/_react["default"].createElement(NestedRowReveal, {
1914
1927
  open: _this5.state.showExtraRow === index
1915
- }, _this5.hasNestedRows(item) ? /*#__PURE__*/_react["default"].createElement(NestedTableHolder, {
1928
+ }, _this5.state.extraColumns.length > 0 && /*#__PURE__*/_react["default"].createElement(NestedTableHolder, null, /*#__PURE__*/_react["default"].createElement(Table.Card, {
1929
+ theme: theme,
1930
+ width: "100%"
1931
+ }, /*#__PURE__*/_react["default"].createElement(TableInner.Element, {
1932
+ theme: theme
1933
+ }, /*#__PURE__*/_react["default"].createElement(Table.Header, {
1934
+ theme: theme,
1935
+ columns: _this5.state.extraColumns,
1936
+ selectedColumns: _this5.getFieldArr(_this5.state.extraColumns),
1937
+ onSort: _this5.props.onSort,
1938
+ displayAs: "extraDetails"
1939
+ }), /*#__PURE__*/_react["default"].createElement(Table.Body, null, /*#__PURE__*/_react["default"].createElement(Table.Row, {
1940
+ theme: theme
1941
+ }, _this5.state.extraColumns.map(function (column) {
1942
+ return /*#__PURE__*/_react["default"].createElement(TableInner.Cell, {
1943
+ theme: theme,
1944
+ key: column.field,
1945
+ column: column
1946
+ }, (column.children || _this5.defaultCellRenderer)(item, column, index));
1947
+ })))))), _this5.hasNestedRows(item) ? /*#__PURE__*/_react["default"].createElement(NestedTableHolder, {
1916
1948
  className: "nested-table-holder",
1917
1949
  style: _this5.state.viewportWidth ? {
1918
1950
  width: "".concat(_this5.state.viewportWidth, "px")
@@ -2268,7 +2300,13 @@ TableInner.Cell = _styledComponents["default"].td(_templateObject10 || (_templat
2268
2300
  }, function (props) {
2269
2301
  return props.maxWidth || "175px";
2270
2302
  });
2271
- var ExpandToggle = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n svg {\n transform: rotate(0deg);\n transform-origin: 50% 50%;\n transition: transform 0.25s ease-in-out;\n }\n\n &.is-expanded svg {\n transform: rotate(90deg);\n }\n\n\n @media (prefers-reduced-motion: reduce) {\n svg {\n transition: none;\n }\n }\n\n path {\n stroke-linecap: round;\n stroke-linejoin: round;\n transition: stroke 0.3s ease-out;\n }\n\n &:hover path {\n stroke: #60bef8;\n }\n"])));
2303
+ var ExpandToggle = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n svg {\n transform: rotate(0deg);\n transform-origin: 50% 50%;\n transition: transform 0.25s ease-in-out;\n }\n\n &.is-expanded svg {\n transform: rotate(", "deg);\n }\n\n\n @media (prefers-reduced-motion: reduce) {\n svg {\n transition: none;\n }\n }\n\n path {\n stroke-linecap: round;\n stroke-linejoin: round;\n transition: ", " 0.3s ease-out;\n }\n\n &:hover path {\n ", ": #60bef8;\n }\n"])), function (props) {
2304
+ return props.$preserveActionPosition ? 90 : 180;
2305
+ }, function (props) {
2306
+ return props.$preserveActionPosition ? "stroke" : "fill";
2307
+ }, function (props) {
2308
+ return props.$preserveActionPosition ? "stroke" : "fill";
2309
+ });
2272
2310
  var NestedReveal = _styledComponents["default"].div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n transition: height ", "ms ease,\n opacity ", "ms ease;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n"])), NESTED_REVEAL_MS, NESTED_REVEAL_MS);
2273
2311
  var NestedRowReveal = /*#__PURE__*/function (_Component2) {
2274
2312
  function NestedRowReveal(props) {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@desynova-digital/components",
3
- "version": "9.3.20",
3
+ "version": "9.3.21",
4
4
  "description": "Components for Desynova Digital",
5
5
  "main": "index.js",
6
6
  "author": "desynova-digital",
7
7
  "license": "MIT",
8
8
  "repository": "desynova-digital",
9
9
  "dependencies": {
10
- "@desynova-digital/tokens": "9.3.20",
10
+ "@desynova-digital/tokens": "9.3.21",
11
11
  "prop-types": "^15.7.2",
12
12
  "styled-components": "^4.3.2"
13
13
  },