@oliasoft-open-source/react-ui-library 3.3.0-beta-1 → 3.3.0-beta-3

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -35169,7 +35169,8 @@ const InputCell = (props) => {
35169
35169
  maxTooltipWidth: cell.maxTooltipWidth,
35170
35170
  right: columnAlignment === "right",
35171
35171
  testId,
35172
- tabIndex: cell.disabled ? -1 : 0
35172
+ tabIndex: cell.disabled ? -1 : 0,
35173
+ tooltip: cell.tooltip
35173
35174
  });
35174
35175
  };
35175
35176
  const SelectCell = (props) => {
@@ -35935,6 +35936,7 @@ const TableScrollWrapper = ({
35935
35936
  });
35936
35937
  };
35937
35938
  const Table = (props) => {
35939
+ var _a, _b, _c, _d;
35938
35940
  const {
35939
35941
  onListReorder,
35940
35942
  table: table2
@@ -35953,9 +35955,7 @@ const Table = (props) => {
35953
35955
  striped: striped2 = true,
35954
35956
  testId,
35955
35957
  draggable: draggable2,
35956
- hasAutoEmptyRow = false,
35957
- onChangeAutoEmptyRow = () => {
35958
- }
35958
+ onChangeAutoEmptyRow = null
35959
35959
  } = table2;
35960
35960
  const targetRef = useRef();
35961
35961
  const [dimensions, setDimensions] = useState({
@@ -35976,7 +35976,8 @@ const Table = (props) => {
35976
35976
  const colSpan = columnCount + (rowActions ? 1 : 0);
35977
35977
  const [rowsMetaData, setRowsMetaData] = useState([]);
35978
35978
  const allRows = rows;
35979
- if (hasAutoEmptyRow) {
35979
+ const isLastPage = footer2 ? ((_a = footer2 == null ? void 0 : footer2.pagination) == null ? void 0 : _a.selectedPage) >= ((_b = footer2 == null ? void 0 : footer2.pagination) == null ? void 0 : _b.rowCount) / ((_d = (_c = footer2 == null ? void 0 : footer2.pagination) == null ? void 0 : _c.rowsPerPage) == null ? void 0 : _d.value) : true;
35980
+ if (onChangeAutoEmptyRow) {
35980
35981
  const lastRowCells = rows[rows.length - 1].cells;
35981
35982
  const newEmptyRowIndex = rows.length;
35982
35983
  const newEmptyCells = lastRowCells.map((cell, i) => {
@@ -35986,7 +35987,8 @@ const Table = (props) => {
35986
35987
  value: "",
35987
35988
  onChange: (evt) => onChangeAutoEmptyRow(evt, newEmptyRowIndex, i),
35988
35989
  error: void 0,
35989
- disabled: i === 0 ? false : cell.disabled
35990
+ disabled: isLastPage ? i === 0 ? false : cell.disabled : true,
35991
+ tooltip: !isLastPage && "Just allowed in last page"
35990
35992
  };
35991
35993
  }
35992
35994
  return {
@@ -36007,9 +36009,9 @@ const Table = (props) => {
36007
36009
  ref: targetRef,
36008
36010
  children: /* @__PURE__ */ jsx(DragDropContext, {
36009
36011
  onDragEnd: (result) => {
36010
- var _a, _b;
36011
- const from = (_a = result == null ? void 0 : result.source) == null ? void 0 : _a.index;
36012
- const to = (_b = result == null ? void 0 : result.destination) == null ? void 0 : _b.index;
36012
+ var _a2, _b2;
36013
+ const from = (_a2 = result == null ? void 0 : result.source) == null ? void 0 : _a2.index;
36014
+ const to = (_b2 = result == null ? void 0 : result.destination) == null ? void 0 : _b2.index;
36013
36015
  onListReorder({
36014
36016
  from,
36015
36017
  to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "3.3.0-beta-1",
3
+ "version": "3.3.0-beta-3",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.js",