abdul-react 0.0.52 → 0.0.55

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 (39) hide show
  1. package/lib/_virtual/index11.js +2 -2
  2. package/lib/_virtual/index9.js +2 -2
  3. package/lib/components/Excel/Data.d.ts +60 -8
  4. package/lib/components/Excel/Data.js +19 -51
  5. package/lib/components/Excel/Data.js.map +1 -1
  6. package/lib/components/Excel/ExcelFile/ExcelFile.js +1 -1
  7. package/lib/components/Excel/ExcelFile/ExcelFile.js.map +1 -1
  8. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.d.ts +6 -0
  9. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js +11 -8
  10. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js.map +1 -1
  11. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Cell.js +3 -4
  12. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Cell.js.map +1 -1
  13. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js +12 -13
  14. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js.map +1 -1
  15. package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.js +0 -2
  16. package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.js.map +1 -1
  17. package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.js.map +1 -1
  18. package/lib/components/Excel/ExcelFile/ExcelFileComponents/EditableCell.js.map +1 -1
  19. package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js +7 -8
  20. package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js.map +1 -1
  21. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js +18 -38
  22. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js.map +1 -1
  23. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +1 -9
  24. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js +1 -11
  25. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js.map +1 -1
  26. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js +3 -93
  27. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js.map +1 -1
  28. package/lib/components/Excel/Types.d.ts +0 -2
  29. package/lib/components/Excel/dataConversion.js +2 -6
  30. package/lib/components/Excel/dataConversion.js.map +1 -1
  31. package/lib/index.cjs +53 -179
  32. package/lib/index.cjs.map +1 -1
  33. package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
  34. package/lib/node_modules/js-beautify/js/src/html/index.js +1 -1
  35. package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
  36. package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
  37. package/lib/node_modules/js-beautify/js/src/javascript/index.js +1 -1
  38. package/lib/node_modules/js-beautify/js/src/javascript/options.js +1 -1
  39. package/package.json +1 -1
package/lib/index.cjs CHANGED
@@ -37517,7 +37517,6 @@ const ADD_COLUMN_RIGHT = 'ADD_COLUMN_RIGHT';
37517
37517
  const DELETE_ROW = 'DELETE_ROW';
37518
37518
  const DELETE_COLUMN = 'DELETE_COLUMN';
37519
37519
  const SET_ROW_HEIGHT = 'SET_ROW_HEIGHT';
37520
- const SET_COLUMN_WIDTH = 'SET_COLUMN_WIDTH';
37521
37520
  const SET_COLUMN_POSITION = 'SET_COLUMN_POSITION';
37522
37521
  const SET_AUTO_FILL = 'SET_AUTO_FILL';
37523
37522
  const SET_EDITABLE = 'SET_EDITABLE';
@@ -37555,15 +37554,6 @@ function setRowHeight(row, height) {
37555
37554
  }
37556
37555
  };
37557
37556
  }
37558
- function setColumnWidth(column, width) {
37559
- return {
37560
- type: SET_COLUMN_WIDTH,
37561
- payload: {
37562
- column,
37563
- width
37564
- }
37565
- };
37566
- }
37567
37557
  function setColumnPosition(column, width) {
37568
37558
  return {
37569
37559
  type: SET_COLUMN_POSITION,
@@ -40325,7 +40315,7 @@ function reducer(state, action) {
40325
40315
  top: 0,
40326
40316
  height: 32
40327
40317
  }),
40328
- height: Math.max(maxHeight, newRowDimensions?.[rowIndex]?.height ?? 32)
40318
+ height: maxHeight
40329
40319
  };
40330
40320
  });
40331
40321
  }
@@ -40548,21 +40538,6 @@ function reducer(state, action) {
40548
40538
  lastChanged: active
40549
40539
  };
40550
40540
  }
40551
- case SET_CELL_DATA:
40552
- {
40553
- const {
40554
- active,
40555
- data: cellData
40556
- } = action.payload;
40557
- if (isActiveReadOnly(state) || !state.editable) {
40558
- return state;
40559
- }
40560
- return {
40561
- ...state,
40562
- model: updateCellValue(state.model, active, cellData),
40563
- lastChanged: active
40564
- };
40565
- }
40566
40541
  case SET_CELL_DIMENSIONS:
40567
40542
  {
40568
40543
  const {
@@ -40776,28 +40751,6 @@ function reducer(state, action) {
40776
40751
  } = action.payload;
40777
40752
  const prevDimensions = state.rowDimensions[row] || {
40778
40753
  top: 0};
40779
- let updatedData = state.model.data; // Start with original data
40780
- // Update all cells in the row with style.height
40781
- if (updatedData[row]) {
40782
- // Check if row exists
40783
- const len = updatedData?.[row]?.length;
40784
- for (let col = 0; col < len; col++) {
40785
- const point = {
40786
- row,
40787
- column: col
40788
- };
40789
- const cell = get$1(point, updatedData) || EmptyCell;
40790
- const newCell = {
40791
- ...cell,
40792
- style: {
40793
- ...cell.style,
40794
- height // Set the new height in cell style
40795
- }
40796
- };
40797
- updatedData = set$1(point, newCell, updatedData); // Immutable set
40798
- }
40799
- }
40800
- const updatedModel = new Model(state.model.createFormulaParser, updatedData);
40801
40754
  return {
40802
40755
  ...state,
40803
40756
  rowDimensions: {
@@ -40806,60 +40759,7 @@ function reducer(state, action) {
40806
40759
  top: prevDimensions.top,
40807
40760
  height
40808
40761
  }
40809
- },
40810
- model: updatedModel
40811
- };
40812
- }
40813
- case SET_COLUMN_WIDTH:
40814
- {
40815
- const {
40816
- column,
40817
- width
40818
- } = action.payload;
40819
- const prevDimensions = state.columnDimensions[column] || {
40820
- left: 0};
40821
- // Narrow first
40822
- if (!state.model.data) {
40823
- return {
40824
- ...state,
40825
- columnDimensions: {
40826
- ...state.columnDimensions,
40827
- [column]: {
40828
- left: prevDimensions.left,
40829
- width
40830
- }
40831
- }
40832
- };
40833
- }
40834
- let updatedData = state.model.data ?? [];
40835
- for (let r = 0; r < updatedData.length; r++) {
40836
- if (updatedData[r] && updatedData?.[r]?.length > column) {
40837
- const point = {
40838
- row: r,
40839
- column
40840
- };
40841
- const cell = get$1(point, updatedData) ?? EmptyCell;
40842
- const newCell = {
40843
- ...cell,
40844
- style: {
40845
- ...(cell.style ?? {}),
40846
- width
40847
- }
40848
- };
40849
- updatedData = set$1(point, newCell, updatedData);
40850
40762
  }
40851
- }
40852
- const updatedModel = new Model(state.model.createFormulaParser, updatedData);
40853
- return {
40854
- ...state,
40855
- columnDimensions: {
40856
- ...state.columnDimensions,
40857
- [column]: {
40858
- left: prevDimensions.left,
40859
- width
40860
- }
40861
- },
40862
- model: updatedModel
40863
40763
  };
40864
40764
  }
40865
40765
  case SET_COLUMN_POSITION:
@@ -42349,7 +42249,8 @@ const ColumnIndicator = ({
42349
42249
  const dispatch = useDispatch();
42350
42250
  const excelData = useSelector(state => state.model.data);
42351
42251
  const activeCell = useSelector(state => state.active);
42352
- const columnWidth = useSelector(state => state.columnDimensions[column]?.width ?? minimumColumnWidth);
42252
+ const minColumnWidth = minimumColumnWidth;
42253
+ const columnWidth = useSelector(state => state.columnDimensions[column]?.width || minColumnWidth);
42353
42254
  const matrixData = useSelector(state => state.model.data);
42354
42255
  const {
42355
42256
  columnCount
@@ -42386,7 +42287,7 @@ const ColumnIndicator = ({
42386
42287
  iconName: 'plus_icon',
42387
42288
  action: () => {
42388
42289
  updateVisibleRangeEnd('increment');
42389
- addColumnLeft(minimumColumnWidth);
42290
+ addColumnLeft(minColumnWidth);
42390
42291
  onAddColumn?.(selectedColumn ?? column, true);
42391
42292
  },
42392
42293
  disableTooltip: 'Column limit reached',
@@ -42398,7 +42299,7 @@ const ColumnIndicator = ({
42398
42299
  iconName: 'plus_icon',
42399
42300
  action: () => {
42400
42301
  updateVisibleRangeEnd('increment');
42401
- addColumnRight(minimumColumnWidth);
42302
+ addColumnRight(minColumnWidth);
42402
42303
  onAddColumn?.(selectedColumn ?? column, false);
42403
42304
  },
42404
42305
  disableTooltip: 'Column limit reached',
@@ -42417,17 +42318,16 @@ const ColumnIndicator = ({
42417
42318
  visible: checkVisible ? true : false,
42418
42319
  disable: false
42419
42320
  }] : [])];
42420
- }, [selectedColumn, cell, addColumnLeft, addColumnRight, deleteColumn, minimumColumnWidth, columnCount, maxColLimit, disableDeleteOption, onAddColumn, onDeleteColumn, column, isCellDataChanged]);
42321
+ }, [selectedColumn, cell, addColumnLeft, addColumnRight, deleteColumn, minColumnWidth, columnCount, maxColLimit, disableDeleteOption, onAddColumn, onDeleteColumn, column, isCellDataChanged]);
42421
42322
  const onMouseDrag = React__namespace.useCallback((event, isRight) => {
42422
42323
  const getTargetColumn = isRight ? column - 1 : column;
42423
42324
  const targetColumn = Math.max(getTargetColumn, 0);
42424
42325
  onSelect(targetColumn, event.shiftKey);
42425
42326
  const startX = event.clientX;
42426
- const initialWidth = Number(columnWidth);
42327
+ const initialWidth = columnWidth;
42427
42328
  const onMouseMove = moveEvent => {
42428
- const delta = moveEvent.clientX - startX;
42429
- const newWidth = Math.max(minimumColumnWidth, initialWidth + delta);
42430
- dispatch(setColumnWidth(targetColumn, newWidth));
42329
+ const newWidth = Math.max(minColumnWidth, initialWidth + (moveEvent.clientX - startX));
42330
+ dispatch(setColumnPosition(targetColumn, newWidth));
42431
42331
  };
42432
42332
  const onMouseUp = () => {
42433
42333
  document.removeEventListener('mousemove', onMouseMove);
@@ -42465,8 +42365,7 @@ const ColumnIndicator = ({
42465
42365
  'ff-spreadsheet-header--selected': selected
42466
42366
  }),
42467
42367
  style: {
42468
- width: `${columnWidth}px`,
42469
- minWidth: '100px'
42368
+ minWidth: `${columnWidth}px`
42470
42369
  },
42471
42370
  onClick: handleClick,
42472
42371
  onContextMenu: contextClick,
@@ -42477,7 +42376,7 @@ const ColumnIndicator = ({
42477
42376
  }), jsxRuntime.jsx("div", {
42478
42377
  className: "drag-column-selector drag-column-left",
42479
42378
  onMouseDown: e => onMouseDrag(e, false),
42480
- onDoubleClick: () => dispatch(setColumnPosition(column, columnWidth)),
42379
+ onDoubleClick: () => dispatch(setColumnPosition(column, minColumnWidth)),
42481
42380
  onClick: () => activate$1({
42482
42381
  row: -1,
42483
42382
  column
@@ -42485,7 +42384,7 @@ const ColumnIndicator = ({
42485
42384
  }), jsxRuntime.jsx("div", {
42486
42385
  className: "drag-column-selector drag-column-right",
42487
42386
  onMouseDown: e => onMouseDrag(e, true),
42488
- onDoubleClick: () => dispatch(setColumnPosition(column, columnWidth)),
42387
+ onDoubleClick: () => dispatch(setColumnPosition(column, minColumnWidth)),
42489
42388
  onClick: () => activate$1({
42490
42389
  row: -1,
42491
42390
  column
@@ -42593,7 +42492,6 @@ const RowIndicator = ({
42593
42492
  disable: false
42594
42493
  }] : [])];
42595
42494
  }, [selectedRow, row]);
42596
- const MIN_ROW_HEIGHT = 32;
42597
42495
  const handleMouseDrag = React__namespace.useCallback((event, isUp) => {
42598
42496
  const getTargetRow = isUp ? row : row - 1;
42599
42497
  const targetRow = Math.max(getTargetRow, 0);
@@ -42601,17 +42499,17 @@ const RowIndicator = ({
42601
42499
  const startY = event.clientY;
42602
42500
  const initialHeight = rowHeight;
42603
42501
  const onMouseMove = moveEvent => {
42604
- const delta = moveEvent.clientY - startY;
42605
- const newHeight = Math.max(MIN_ROW_HEIGHT, initialHeight + delta);
42502
+ const newHeight = Math.max(32, initialHeight + (moveEvent.clientY - startY));
42606
42503
  dispatch(setRowHeight(targetRow, newHeight));
42607
42504
  };
42608
42505
  const onMouseUp = () => {
42609
42506
  document.removeEventListener('mousemove', onMouseMove);
42610
42507
  document.removeEventListener('mouseup', onMouseUp);
42611
- dispatch(dragEnd()); // only at end
42508
+ dispatch(dragEnd());
42612
42509
  };
42613
42510
  document.addEventListener('mousemove', onMouseMove);
42614
42511
  document.addEventListener('mouseup', onMouseUp);
42512
+ dispatch(dragEnd());
42615
42513
  }, [rowHeight, row]);
42616
42514
  const activate$1 = React__namespace.useCallback(point => dispatch(activate(point)), [dispatch]);
42617
42515
  const handleClick = React__namespace.useCallback(event => {
@@ -42641,7 +42539,7 @@ const RowIndicator = ({
42641
42539
  }),
42642
42540
  style: {
42643
42541
  height: `${rowHeight}px`,
42644
- minHeight: '32px'
42542
+ minWidth: '60px'
42645
42543
  },
42646
42544
  onClick: handleClick,
42647
42545
  onContextMenu: contextClick,
@@ -42652,7 +42550,7 @@ const RowIndicator = ({
42652
42550
  }), jsxRuntime.jsx("div", {
42653
42551
  className: "drag-row-selector drag-row-down",
42654
42552
  onMouseDown: e => handleMouseDrag(e, true),
42655
- onDoubleClick: () => dispatch(setRowHeight(row, rowHeight)),
42553
+ onDoubleClick: () => dispatch(setRowHeight(row, 32)),
42656
42554
  onClick: () => activate$1({
42657
42555
  row,
42658
42556
  column: -1
@@ -42660,7 +42558,7 @@ const RowIndicator = ({
42660
42558
  }), jsxRuntime.jsx("div", {
42661
42559
  className: "drag-row-selector drag-row-up",
42662
42560
  onMouseDown: e => handleMouseDrag(e, false),
42663
- onDoubleClick: () => dispatch(setRowHeight(row, rowHeight)),
42561
+ onDoubleClick: () => dispatch(setRowHeight(row, 32)),
42664
42562
  onClick: () => activate$1({
42665
42563
  row,
42666
42564
  column: -1
@@ -42686,7 +42584,7 @@ const enhance$1 = RowIndicatorComponent => {
42686
42584
  };
42687
42585
  };
42688
42586
 
42689
- const Cell = /*#__PURE__*/React__namespace.memo(({
42587
+ const Cell = ({
42690
42588
  row,
42691
42589
  column,
42692
42590
  DataViewer,
@@ -42727,14 +42625,13 @@ const Cell = /*#__PURE__*/React__namespace.memo(({
42727
42625
  const root = rootRef.current;
42728
42626
  if (!root) return;
42729
42627
  const updateDimensions = () => {
42730
- if (dragging) return;
42731
42628
  setCellDimensions(point, getOffsetRect(root));
42732
42629
  };
42733
42630
  updateDimensions();
42734
42631
  const observer = new ResizeObserver(updateDimensions);
42735
42632
  observer.observe(root);
42736
42633
  return () => observer.disconnect();
42737
- }, [setCellDimensions, point, dragging]);
42634
+ }, [setCellDimensions, point]);
42738
42635
  if (data && data.DataViewer) {
42739
42636
  DataViewer = data.DataViewer;
42740
42637
  }
@@ -42762,7 +42659,7 @@ const Cell = /*#__PURE__*/React__namespace.memo(({
42762
42659
  inputValue: () => null
42763
42660
  })
42764
42661
  });
42765
- });
42662
+ };
42766
42663
  const enhance = CellComponent => {
42767
42664
  return function CellWrapper(props) {
42768
42665
  const {
@@ -42960,8 +42857,6 @@ const DataEditor = ({
42960
42857
  className: "ff-spreadsheet-cell-textarea",
42961
42858
  style: {
42962
42859
  ...cell?.style,
42963
- width: '100%',
42964
- height: '100%',
42965
42860
  borderTop: '',
42966
42861
  borderBottom: '',
42967
42862
  borderLeft: '',
@@ -43353,7 +43248,7 @@ const ActiveCell = props => {
43353
43248
  const handleMouseDown = React__namespace.useCallback(() => {
43354
43249
  if (active) {
43355
43250
  autoFill$1(true);
43356
- activate$1(active);
43251
+ // activate(active);
43357
43252
  }
43358
43253
  }, [activate$1, autoFill$1, active]);
43359
43254
  const contextClick = React__namespace.useCallback(event => {
@@ -43371,6 +43266,8 @@ const ActiveCell = props => {
43371
43266
  activate$1(active);
43372
43267
  }
43373
43268
  }, [active, isDragged]);
43269
+ const availableWidth = props.isAtRight ? props.maxWidth - (dimensions?.left - props.scrollPos.left) + 100 : props.maxWidth;
43270
+ const availableHeight = props.isAtBottom ? props.maxHeight - (dimensions?.top - props.scrollPos.top) + 64 : props.maxHeight;
43374
43271
  return jsxRuntime.jsxs("div", {
43375
43272
  ref: rootRef,
43376
43273
  className: classNames('ff-spreadsheet-active-cell', `ff-spreadsheet-active-cell--${mode}`, {
@@ -43382,10 +43279,13 @@ const ActiveCell = props => {
43382
43279
  ...dimensions,
43383
43280
  backgroundColor: cell?.style?.backgroundColor,
43384
43281
  ...(mode === 'edit' && active ? {
43385
- minWidth: dimensions?.width,
43386
- minHeight: dimensions?.height,
43282
+ minWidth: Math.min(dimensions?.width, props.maxWidth),
43283
+ minHeight: Math.min(dimensions?.height, props.maxHeight),
43387
43284
  height: 'auto',
43388
- width: 'auto'
43285
+ width: 'max-content',
43286
+ maxWidth: `${availableWidth}px`,
43287
+ maxHeight: `${availableHeight}px`,
43288
+ overflow: 'auto'
43389
43289
  } : {})
43390
43290
  },
43391
43291
  onContextMenu: contextClick,
@@ -43442,8 +43342,6 @@ const ActiveCell = props => {
43442
43342
  className: "ff-spreadsheet-cell-textarea",
43443
43343
  style: {
43444
43344
  ...cell?.style,
43445
- height: '100%',
43446
- width: '100%',
43447
43345
  textDecoration: cell?.style?.textDecoration === 'underline' ? 'underline' : 'none',
43448
43346
  backgroundColor: isDragged ? '#1e161f00' : cell?.style?.backgroundColor,
43449
43347
  pointerEvents: 'none',
@@ -43452,10 +43350,10 @@ const ActiveCell = props => {
43452
43350
  borderLeft: '',
43453
43351
  borderRight: ''
43454
43352
  }
43455
- }), !['file'].includes(cell?.inputType?.type ?? '') && jsxRuntime.jsx("div", {
43353
+ }), !['file'].includes(cell?.inputType?.type ?? '') && (mode === 'edit' || active && jsxRuntime.jsx("div", {
43456
43354
  onMouseDown: handleMouseDown,
43457
43355
  className: "select_dot"
43458
- })]
43356
+ }))]
43459
43357
  });
43460
43358
  };
43461
43359
 
@@ -43673,9 +43571,7 @@ function convertStyleToFrontend(backendStyle) {
43673
43571
  borderBottom: borderBottom,
43674
43572
  borderLeft: borderLeft,
43675
43573
  textAlign: getTextAlignment(backendStyle.alignment.horizontal),
43676
- alignContent: getTextAlignment(backendStyle.alignment.vertical),
43677
- height: backendStyle.height ?? 32,
43678
- width: backendStyle.width ?? 150
43574
+ alignContent: getTextAlignment(backendStyle.alignment.vertical)
43679
43575
  };
43680
43576
  }
43681
43577
  const getBorderStyle = border => {
@@ -43711,9 +43607,7 @@ const convertStyleToBackend = frontendStyle => {
43711
43607
  horizontal: getTextAlignmentBack(frontendStyle.textAlign),
43712
43608
  vertical: getTextAlignmentBack(frontendStyle.alignContent),
43713
43609
  wrapText: false
43714
- },
43715
- width: frontendStyle.width || 150,
43716
- height: frontendStyle.height || 32
43610
+ }
43717
43611
  };
43718
43612
  };
43719
43613
 
@@ -44123,48 +44017,18 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
44123
44017
  top: 0,
44124
44018
  left: 0
44125
44019
  });
44020
+ const [isAtBottom, setIsAtBottom] = React__namespace.useState(false);
44021
+ const [isAtRight, setIsAtRight] = React__namespace.useState(false);
44126
44022
  const initialState = React__namespace.useMemo(() => {
44127
44023
  const createParser = props.createFormulaParser || createFormulaParser;
44128
44024
  const model = new Model(createParser, props.data);
44129
- let newRowDimensions = {};
44130
- let newColumnDimensions = {};
44131
- props.data.forEach((rowData, rowIndex) => {
44132
- let maxHeight = DEFAULT_ROW_HEIGHT;
44133
- rowData.forEach(cell => {
44134
- if (cell) {
44135
- const cellHeight = parseFloat(String(cell.style?.height).replace('px', '')) || DEFAULT_ROW_HEIGHT;
44136
- maxHeight = Math.max(maxHeight, cellHeight);
44137
- }
44138
- });
44139
- newRowDimensions[rowIndex] = {
44140
- top: 0,
44141
- height: maxHeight
44142
- };
44143
- });
44144
- const columnCount = props.data[0] ? props.data[0].length : 0;
44145
- for (let col = 0; col < columnCount; col++) {
44146
- let maxWidth = DEFAULT_COLUMN_WIDTH;
44147
- props.data.forEach(rowData => {
44148
- const cell = rowData[col];
44149
- if (cell) {
44150
- const cellWidth = parseFloat(String(cell.style?.width).replace('px', '')) || DEFAULT_COLUMN_WIDTH;
44151
- maxWidth = Math.max(maxWidth, cellWidth);
44152
- }
44153
- });
44154
- newColumnDimensions[col] = {
44155
- left: 0,
44156
- width: maxWidth
44157
- };
44158
- }
44159
44025
  setSheetChange(prev => !prev);
44160
44026
  return {
44161
44027
  ...INITIAL_STATE,
44162
44028
  model,
44163
- selected: props.selected || INITIAL_STATE.selected,
44164
- rowDimensions: newRowDimensions,
44165
- columnDimensions: newColumnDimensions
44029
+ selected: props.selected || INITIAL_STATE.selected
44166
44030
  };
44167
- }, [props.createFormulaParser, props.data, props.selected, props.minimumColumnWidth]);
44031
+ }, [props.createFormulaParser, props.data, props.selected]);
44168
44032
  const reducerElements = React__namespace.useReducer(reducer, initialState);
44169
44033
  const [state, dispatch] = reducerElements;
44170
44034
  const size = React__namespace.useMemo(() => {
@@ -44277,10 +44141,10 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
44277
44141
  prevSelectedPropRef.current = props.selected;
44278
44142
  }, [props.selected, setSelection$1]);
44279
44143
  // Update data when props.data changes
44280
- let prevDataPropRef = React__namespace.useRef();
44144
+ let prevDataPropRef = React__namespace.useRef(props.data);
44281
44145
  React__namespace.useEffect(() => {
44282
44146
  setEditable(editable$1);
44283
- if (prevDataPropRef.current !== undefined && props.data !== prevDataPropRef.current) {
44147
+ if (props.data !== prevDataPropRef.current) {
44284
44148
  setData$1(props.data);
44285
44149
  }
44286
44150
  prevDataPropRef.current = props.data;
@@ -44423,6 +44287,8 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
44423
44287
  start: newRowStart,
44424
44288
  end: newRowEnd
44425
44289
  });
44290
+ const atBottom = newRowEnd === size.rows;
44291
+ setIsAtBottom(atBottom);
44426
44292
  // ----- For columns (NEW) -----
44427
44293
  let newColStart = 0;
44428
44294
  while (newColStart < size.columns && getCumulativeWidth(newColStart) < scrollLeft) {
@@ -44438,6 +44304,8 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
44438
44304
  start: newColStart,
44439
44305
  end: newColEnd
44440
44306
  });
44307
+ const atRight = newColEnd === size.columns;
44308
+ setIsAtRight(atRight);
44441
44309
  // Close context menu on scroll
44442
44310
  if (contextMenu.open) {
44443
44311
  setContextMenu({
@@ -44579,7 +44447,7 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
44579
44447
  // @ts-ignore
44580
44448
  DataViewer: DataViewer$1,
44581
44449
  editable: editable$1
44582
- }, `${rowNumber}-${columnNumber}`)), jsxRuntime.jsx("div", {
44450
+ }, columnNumber)), jsxRuntime.jsx("div", {
44583
44451
  className: "spacer right"
44584
44452
  })]
44585
44453
  }, rowNumber)), jsxRuntime.jsx("tr", {
@@ -44598,8 +44466,14 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
44598
44466
  DataEditor: DataEditor$1,
44599
44467
  visibleRowRange: visibleRowRange,
44600
44468
  visibleColRange: visibleColRange,
44469
+ maxHeight: maxHeight - 64,
44470
+ maxWidth: maxWidth - minimumColumnWidth,
44471
+ totalHeight: totalHeight,
44472
+ totalWidth: totalWidth,
44473
+ isAtBottom: isAtBottom,
44474
+ isAtRight: isAtRight,
44601
44475
  scrollPos: scrollPos
44602
- }), [DataEditor$1, visibleRowRange, visibleColRange, scrollPos]);
44476
+ }), [DataEditor$1, visibleRowRange, visibleColRange, state.active, maxHeight, maxWidth, totalHeight, totalWidth, isAtBottom, isAtRight]);
44603
44477
  const rootNode = React__namespace.useMemo(() => jsxRuntime.jsxs("div", {
44604
44478
  className: "ff-excel-spreadsheet-container",
44605
44479
  children: [jsxRuntime.jsx("div", {
@@ -45080,7 +44954,7 @@ const ExcelFile = ({
45080
44954
  };
45081
44955
  const handleNameChange = (event, index, name) => {
45082
44956
  const target = event.target;
45083
- if (!target || target?.textContent?.trim() === name?.trim()) {
44957
+ if (!target || target?.textContent?.trim()?.toLowerCase() === name?.trim()?.toLowerCase()) {
45084
44958
  setEditingSheet(null);
45085
44959
  return;
45086
44960
  }