@banyan_cloud/roots 1.0.130 → 1.0.132

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.
package/dist/cjs/index.js CHANGED
@@ -47899,7 +47899,7 @@ var TableRow = /*#__PURE__*/React.forwardRef(function BaseTable(props, ref) {
47899
47899
  tabIndex: -1,
47900
47900
  "data-elem": "table-row",
47901
47901
  onClick: function onClick() {
47902
- return onRowClick(datum, setActiveId);
47902
+ return onRowClick(props);
47903
47903
  },
47904
47904
  className: classes(className, modules_f6618a87.root, modules_f6618a87["".concat(type, "-row")], modules_f6618a87["row-height-".concat(rowHeight)]),
47905
47905
  children: tableCells
@@ -47965,8 +47965,10 @@ var TableBody = function TableBody(props) {
47965
47965
  className = props.className,
47966
47966
  expandable = props.expandable,
47967
47967
  rowHeight = props.rowHeight,
47968
- onRowClick = props.onRowClick;
47968
+ onRowClick = props.onRowClick,
47969
+ defaultActiveIndex = props.defaultActiveIndex;
47969
47970
  var listRef = React.useRef([]);
47971
+ var isActiveRef = React.useRef(false);
47970
47972
  return /*#__PURE__*/jsxRuntime.jsx("tbody", {
47971
47973
  "data-elem": "table-body",
47972
47974
  className: classes(modules_82c0c387.root, className),
@@ -47977,6 +47979,7 @@ var TableBody = function TableBody(props) {
47977
47979
  var multiSelect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
47978
47980
  if (reset) {
47979
47981
  var _listRef$current, _listRef$current$_ind, _listRef$current$_ind2;
47982
+ isActiveRef.current = false;
47980
47983
  (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : (_listRef$current$_ind = _listRef$current[_index]) === null || _listRef$current$_ind === void 0 ? void 0 : (_listRef$current$_ind2 = _listRef$current$_ind.removeAttribute) === null || _listRef$current$_ind2 === void 0 ? void 0 : _listRef$current$_ind2.call(_listRef$current$_ind, 'data-active');
47981
47984
  } else {
47982
47985
  var _listRef$current3, _listRef$current3$_in, _listRef$current3$_in2;
@@ -47987,12 +47990,16 @@ var TableBody = function TableBody(props) {
47987
47990
  elem === null || elem === void 0 ? void 0 : (_elem$removeAttribute = elem.removeAttribute) === null || _elem$removeAttribute === void 0 ? void 0 : _elem$removeAttribute.call(elem, 'data-active');
47988
47991
  });
47989
47992
  }
47993
+ isActiveRef.current = true;
47990
47994
  (_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 ? void 0 : (_listRef$current3$_in = _listRef$current3[_index]) === null || _listRef$current3$_in === void 0 ? void 0 : (_listRef$current3$_in2 = _listRef$current3$_in.setAttribute) === null || _listRef$current3$_in2 === void 0 ? void 0 : _listRef$current3$_in2.call(_listRef$current3$_in, 'data-active', true);
47991
47995
  }
47992
47996
  };
47993
47997
  return /*#__PURE__*/jsxRuntime.jsx(TableRow, {
47994
47998
  ref: function ref(node) {
47995
47999
  listRef.current[_index] = node;
48000
+ if (!isActiveRef.current && defaultActiveIndex === _index) {
48001
+ node === null || node === void 0 ? void 0 : node.setAttribute('data-active', true);
48002
+ }
47996
48003
  },
47997
48004
  datum: datum,
47998
48005
  headerData: headerData,
@@ -48180,7 +48187,8 @@ var BaseTable = /*#__PURE__*/React.forwardRef(function BaseTable(props, ref) {
48180
48187
  expandable = props.expandable,
48181
48188
  onSort = props.onSort,
48182
48189
  rowHeight = props.rowHeight,
48183
- theme = props.theme;
48190
+ theme = props.theme,
48191
+ defaultActiveIndex = props.defaultActiveIndex;
48184
48192
  if (loading) {
48185
48193
  return /*#__PURE__*/jsxRuntime.jsx(BaseTableSkeleton, {
48186
48194
  theme: theme
@@ -48207,7 +48215,8 @@ var BaseTable = /*#__PURE__*/React.forwardRef(function BaseTable(props, ref) {
48207
48215
  tableData: tableData,
48208
48216
  expandable: expandable,
48209
48217
  rowHeight: rowHeight,
48210
- onRowClick: onRowClick
48218
+ onRowClick: onRowClick,
48219
+ defaultActiveIndex: defaultActiveIndex
48211
48220
  })]
48212
48221
  });
48213
48222
  });
@@ -49260,7 +49269,8 @@ var Table = function Table(props) {
49260
49269
  onSort = props.onSort,
49261
49270
  rowHeight = props.rowHeight,
49262
49271
  theme = props.theme,
49263
- onRowClick = props.onRowClick;
49272
+ onRowClick = props.onRowClick,
49273
+ defaultActiveIndex = props.defaultActiveIndex;
49264
49274
  var ref = React.useRef(null);
49265
49275
  var paginationRef = React.useRef(null);
49266
49276
  var _useState = React.useState(false),
@@ -49362,6 +49372,7 @@ var Table = function Table(props) {
49362
49372
  onSort: onSort,
49363
49373
  rowHeight: rowHeight,
49364
49374
  onRowClick: onRowClick,
49375
+ defaultActiveIndex: defaultActiveIndex,
49365
49376
  loading: loading
49366
49377
  }), paginationData != null && /*#__PURE__*/jsxRuntime.jsx(Pagination, _objectSpread2(_objectSpread2({
49367
49378
  className: classes(modules_2e8406c7.pagination, floating ? modules_2e8406c7.floating : ''),