@true-engineering/true-react-common-ui-kit 3.50.1 → 3.51.0

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.
@@ -26335,7 +26335,7 @@
26335
26335
  return _array_like_to_array$7(o, minLen);
26336
26336
  }
26337
26337
  function FlexibleTableRowInner(param) {
26338
- var item = param.item, index = param.index, config = param.config, columns = param.columns, uniqueField = param.uniqueField, renderMode = param.renderMode, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isFocusable = param.isFocusable, isFocusable = _param_isFocusable === void 0 ? false : _param_isFocusable, _param_isFirstColumnSticky = param.isFirstColumnSticky, isFirstColumnSticky = _param_isFirstColumnSticky === void 0 ? false : _param_isFirstColumnSticky, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, rowAttributes = param.rowAttributes, _param_isExpandableRowComponentInitiallyOpen = param.isExpandableRowComponentInitiallyOpen, isExpandableRowComponentInitiallyOpen = _param_isExpandableRowComponentInitiallyOpen === void 0 ? false : _param_isExpandableRowComponentInitiallyOpen, rowRef = param.rowRef, tweakStyles = param.tweakStyles, expandableRowComponent = param.expandableRowComponent, onRowHover = param.onRowHover, onRowClick = param.onRowClick;
26338
+ var item = param.item, config = param.config, columns = param.columns, uniqueField = param.uniqueField, renderMode = param.renderMode, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isFocusable = param.isFocusable, isFocusable = _param_isFocusable === void 0 ? false : _param_isFocusable, _param_isFirstColumnSticky = param.isFirstColumnSticky, isFirstColumnSticky = _param_isFirstColumnSticky === void 0 ? false : _param_isFirstColumnSticky, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, rowAttributes = param.rowAttributes, _param_isExpandableRowComponentInitiallyOpen = param.isExpandableRowComponentInitiallyOpen, isExpandableRowComponentInitiallyOpen = _param_isExpandableRowComponentInitiallyOpen === void 0 ? false : _param_isExpandableRowComponentInitiallyOpen, rowRef = param.rowRef, tweakStyles = param.tweakStyles, expandableRowComponent = param.expandableRowComponent, onRowHover = param.onRowHover, onRowClick = param.onRowClick;
26339
26339
  var classes = useStyles$h({
26340
26340
  theme: tweakStyles
26341
26341
  });
@@ -26347,7 +26347,7 @@
26347
26347
  var _useState = _sliced_to_array$7(React.useState(false), 2), isFocused = _useState[0], setFocused = _useState[1];
26348
26348
  var _useState1 = _sliced_to_array$7(React.useState(function() {
26349
26349
  return {
26350
- isOpen: trueReactPlatformHelpers.applyAction(isExpandableRowComponentInitiallyOpen, item, index)
26350
+ isOpen: isExpandableRowComponentInitiallyOpen
26351
26351
  };
26352
26352
  }), 2), nestedComponent = _useState1[0], setNestedComponent = _useState1[1];
26353
26353
  var isEditable = !isLoading && (trueReactPlatformHelpers.isNotEmpty(onRowClick) || trueReactPlatformHelpers.isNotEmpty(onRowHover));
@@ -26540,7 +26540,7 @@
26540
26540
  return target;
26541
26541
  }
26542
26542
  function FlexibleTable(_param) {
26543
- var content = _param.content, headerContent = _param.headerContent, config = _param.config, enabledColumns = _param.enabledColumns, activeRows = _param.activeRows, uniqueField = _param.uniqueField, _param_isLoading = _param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_isFirstColumnSticky = _param.isFirstColumnSticky, isFirstColumnSticky = _param_isFirstColumnSticky === void 0 ? false : _param_isFirstColumnSticky, _param_isHorizontallyScrollable = _param.isHorizontallyScrollable, isHorizontallyScrollable = _param_isHorizontallyScrollable === void 0 ? false : _param_isHorizontallyScrollable, _param_isRowFocusable = _param.isRowFocusable, isRowFocusable = _param_isRowFocusable === void 0 ? false : _param_isRowFocusable, infinityScrollConfig = _param.infinityScrollConfig, _param_renderMode = _param.renderMode, renderMode = _param_renderMode === void 0 ? "table" : _param_renderMode, refForScroll = _param.refForScroll, nothingFoundContent = _param.nothingFoundContent, data = _param.data, testId = _param.testId, tweakStyles = _param.tweakStyles, _param_shouldRenderHeader = _param.shouldRenderHeader, shouldRenderHeader = _param_shouldRenderHeader === void 0 ? true : _param_shouldRenderHeader, onHeadClick = _param.onHeadClick, restProps = _object_without_properties$7(_param, [
26543
+ var content = _param.content, headerContent = _param.headerContent, config = _param.config, enabledColumns = _param.enabledColumns, activeRows = _param.activeRows, uniqueField = _param.uniqueField, _param_isLoading = _param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_isFirstColumnSticky = _param.isFirstColumnSticky, isFirstColumnSticky = _param_isFirstColumnSticky === void 0 ? false : _param_isFirstColumnSticky, _param_isHorizontallyScrollable = _param.isHorizontallyScrollable, isHorizontallyScrollable = _param_isHorizontallyScrollable === void 0 ? false : _param_isHorizontallyScrollable, _param_isRowFocusable = _param.isRowFocusable, isRowFocusable = _param_isRowFocusable === void 0 ? false : _param_isRowFocusable, infinityScrollConfig = _param.infinityScrollConfig, _param_renderMode = _param.renderMode, renderMode = _param_renderMode === void 0 ? "table" : _param_renderMode, refForScroll = _param.refForScroll, nothingFoundContent = _param.nothingFoundContent, data = _param.data, testId = _param.testId, tweakStyles = _param.tweakStyles, _param_shouldRenderHeader = _param.shouldRenderHeader, shouldRenderHeader = _param_shouldRenderHeader === void 0 ? true : _param_shouldRenderHeader, onHeadClick = _param.onHeadClick, isRowInitiallyOpen = _param.isExpandableRowComponentInitiallyOpen, restProps = _object_without_properties$7(_param, [
26544
26544
  "content",
26545
26545
  "headerContent",
26546
26546
  "config",
@@ -26559,7 +26559,8 @@
26559
26559
  "testId",
26560
26560
  "tweakStyles",
26561
26561
  "shouldRenderHeader",
26562
- "onHeadClick"
26562
+ "onHeadClick",
26563
+ "isExpandableRowComponentInitiallyOpen"
26563
26564
  ]);
26564
26565
  var classes = useStyles$j({
26565
26566
  theme: tweakStyles
@@ -26578,16 +26579,20 @@
26578
26579
  config
26579
26580
  ]);
26580
26581
  var hasInfiniteScroll = trueReactPlatformHelpers.isNotEmpty(infinityScrollConfig);
26581
- var tableRowProps = _object_spread_props$j(_object_spread$k({}, restProps), {
26582
- renderMode,
26583
- config,
26584
- columns,
26585
- uniqueField,
26586
- isLoading,
26587
- isFirstColumnSticky,
26588
- isFocusable: isRowFocusable,
26589
- tweakStyles: tweakTableRowStyles
26590
- });
26582
+ var getTableRowProps = function(item, index) {
26583
+ return _object_spread_props$j(_object_spread$k({}, restProps), {
26584
+ item,
26585
+ renderMode,
26586
+ config,
26587
+ columns,
26588
+ uniqueField,
26589
+ isLoading,
26590
+ isFirstColumnSticky,
26591
+ isFocusable: isRowFocusable,
26592
+ tweakStyles: tweakTableRowStyles,
26593
+ isExpandableRowComponentInitiallyOpen: trueReactPlatformHelpers.applyAction(isRowInitiallyOpen, item, index)
26594
+ });
26595
+ };
26591
26596
  var getDataScrollAttributeSetter = React.useCallback(function(key, setter) {
26592
26597
  return function(el) {
26593
26598
  if (isHorizontallyScrollable && trueReactPlatformHelpers.isNotEmpty(el) && setter(el)) {
@@ -26713,10 +26718,8 @@
26713
26718
  /* @__PURE__ */ jsx(Table.Body, {
26714
26719
  className: classes.body,
26715
26720
  children: isLoading ? trueReactPlatformHelpers.indexMap(6, function(i) {
26716
- return /* @__PURE__ */ React.createElement(FlexibleTableRow, _object_spread_props$j(_object_spread$k({}, tableRowProps), {
26717
- key: i,
26718
- item: {},
26719
- index: i
26721
+ return /* @__PURE__ */ React.createElement(FlexibleTableRow, _object_spread_props$j(_object_spread$k({}, getTableRowProps({}, i)), {
26722
+ key: i
26720
26723
  }));
26721
26724
  }) : /* @__PURE__ */ jsxs(Fragment, {
26722
26725
  children: [
@@ -26729,11 +26732,9 @@
26729
26732
  })
26730
26733
  }),
26731
26734
  content.map(function(item, i) {
26732
- return /* @__PURE__ */ React.createElement(FlexibleTableRow, _object_spread_props$j(_object_spread$k({}, tableRowProps), {
26735
+ return /* @__PURE__ */ React.createElement(FlexibleTableRow, _object_spread_props$j(_object_spread$k({}, getTableRowProps(item, i)), {
26733
26736
  isActive: activeRowsSet.has(i),
26734
- key: trueReactPlatformHelpers.isNotEmpty(uniqueField) ? item[uniqueField] : i,
26735
- item,
26736
- index: i
26737
+ key: trueReactPlatformHelpers.isNotEmpty(uniqueField) ? item[uniqueField] : i
26737
26738
  }));
26738
26739
  }),
26739
26740
  hasInfiniteScroll && !infinityScrollConfig.isLastPage && /* @__PURE__ */ jsx(Table.Row, {