abdul-react 0.0.9 → 0.0.11

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 (56) hide show
  1. package/lib/components/Charts/LineChart/LineChart.js +25 -25
  2. package/lib/components/Charts/LineChart/LineChart.js.map +1 -1
  3. package/lib/components/Editor/VariableDropdown.js +1 -1
  4. package/lib/components/Editor/VariableDropdown.js.map +1 -1
  5. package/lib/components/Excel/Data.d.ts +127 -0
  6. package/lib/components/Excel/Data.js +646 -0
  7. package/lib/components/Excel/Data.js.map +1 -0
  8. package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.d.ts +0 -1
  9. package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.js +3 -6
  10. package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.js.map +1 -1
  11. package/lib/components/Excel/ExcelFile/ExcelFile.d.ts +8 -20
  12. package/lib/components/Excel/ExcelFile/ExcelFile.js +36 -31
  13. package/lib/components/Excel/ExcelFile/ExcelFile.js.map +1 -1
  14. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.d.ts +1 -12
  15. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js +1 -0
  16. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js.map +1 -1
  17. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js +9 -15
  18. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js.map +1 -1
  19. package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js +10 -16
  20. package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js.map +1 -1
  21. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +2 -12
  22. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js +13 -17
  23. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js.map +1 -1
  24. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +19 -12
  25. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js +18 -12
  26. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js.map +1 -1
  27. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js +39 -21
  28. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js.map +1 -1
  29. package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +9 -6
  30. package/lib/components/Excel/Types.d.ts +1 -0
  31. package/lib/components/StepsLandingTable/Components/StepGroupAccordions.js +92 -69
  32. package/lib/components/StepsLandingTable/Components/StepGroupAccordions.js.map +1 -1
  33. package/lib/components/StepsLandingTable/Components/StepInnerTable.d.ts +1 -1
  34. package/lib/components/StepsLandingTable/Components/StepInnerTable.js +162 -14
  35. package/lib/components/StepsLandingTable/Components/StepInnerTable.js.map +1 -1
  36. package/lib/components/StepsLandingTable/Components/StepTableMainRow.js +18 -4
  37. package/lib/components/StepsLandingTable/Components/StepTableMainRow.js.map +1 -1
  38. package/lib/components/StepsLandingTable/Components/Types.d.ts +3 -0
  39. package/lib/components/StepsLandingTable/StepLandingTable.js +0 -2
  40. package/lib/components/StepsLandingTable/StepLandingTable.js.map +1 -1
  41. package/lib/index.cjs +438 -238
  42. package/lib/index.cjs.map +1 -1
  43. package/lib/index.d.ts +30 -27
  44. package/lib/node_modules/js-beautify/js/src/css/options.js +1 -1
  45. package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
  46. package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
  47. package/lib/node_modules/js-beautify/js/src/html/tokenizer.js +1 -1
  48. package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
  49. package/lib/node_modules/js-beautify/js/src/javascript/tokenizer.js +1 -1
  50. package/lib/styles.css +1 -1
  51. package/lib/styles.css.map +1 -1
  52. package/lib/tsconfig.tsbuildinfo +1 -1
  53. package/lib/utils/ScrollToview/ScrollToView.d.ts +3 -1
  54. package/lib/utils/ScrollToview/ScrollToView.js +14 -9
  55. package/lib/utils/ScrollToview/ScrollToView.js.map +1 -1
  56. package/package.json +1 -1
package/lib/index.cjs CHANGED
@@ -36109,34 +36109,40 @@ function formatePainter(data) {
36109
36109
  }
36110
36110
  };
36111
36111
  }
36112
- function addRowTop() {
36112
+ function addRowTop(row) {
36113
36113
  return {
36114
- type: ADD_ROW_TOP
36114
+ type: ADD_ROW_TOP,
36115
+ row
36115
36116
  };
36116
36117
  }
36117
- function addRowBottom() {
36118
+ function addRowBottom(row) {
36118
36119
  return {
36119
- type: ADD_ROW_BOTTOM
36120
+ type: ADD_ROW_BOTTOM,
36121
+ row
36120
36122
  };
36121
36123
  }
36122
- function addColumnLeft() {
36124
+ function addColumnLeft(column) {
36123
36125
  return {
36124
- type: ADD_COLUMN_LEFT
36126
+ type: ADD_COLUMN_LEFT,
36127
+ column
36125
36128
  };
36126
36129
  }
36127
- function addColumnRight() {
36130
+ function addColumnRight(column) {
36128
36131
  return {
36129
- type: ADD_COLUMN_RIGHT
36132
+ type: ADD_COLUMN_RIGHT,
36133
+ column
36130
36134
  };
36131
36135
  }
36132
- function deleteRow() {
36136
+ function deleteRow(row) {
36133
36137
  return {
36134
- type: DELETE_ROW
36138
+ type: DELETE_ROW,
36139
+ row
36135
36140
  };
36136
36141
  }
36137
- function deleteColumn() {
36142
+ function deleteColumn(column) {
36138
36143
  return {
36139
- type: DELETE_COLUMN
36144
+ type: DELETE_COLUMN,
36145
+ column
36140
36146
  };
36141
36147
  }
36142
36148
  function keyPress(event) {
@@ -38226,18 +38232,21 @@ function reducer(state, action) {
38226
38232
  selectedColumn,
38227
38233
  model
38228
38234
  } = state;
38229
- if (checkEmpty(selectedRow)) {
38235
+ const {
38236
+ row
38237
+ } = action;
38238
+ if (checkEmpty(row ?? selectedRow)) {
38230
38239
  return state;
38231
38240
  }
38232
- selectedRow = selectedRow;
38241
+ selectedRow = row ?? selectedRow;
38233
38242
  let updatedData = [...model.data];
38234
38243
  const newRow = Array(updatedData[0]?.length || 0).fill(EmptyCell);
38235
- updatedData.splice(selectedRow, 0, newRow);
38244
+ updatedData.splice(row ?? selectedRow, 0, newRow);
38236
38245
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38237
38246
  return {
38238
38247
  ...state,
38239
38248
  model: updatedModel,
38240
- selectedRow: selectedRow,
38249
+ selectedRow: row ?? selectedRow,
38241
38250
  selectedColumn: selectedColumn
38242
38251
  };
38243
38252
  }
@@ -38248,18 +38257,21 @@ function reducer(state, action) {
38248
38257
  selectedColumn,
38249
38258
  model
38250
38259
  } = state;
38260
+ const {
38261
+ row
38262
+ } = action;
38251
38263
  if (checkEmpty(selectedRow)) {
38252
38264
  return state;
38253
38265
  }
38254
- selectedRow = selectedRow;
38266
+ selectedRow = row ?? selectedRow;
38255
38267
  let updatedData = [...model.data];
38256
38268
  const newRow = Array(updatedData[0]?.length || 0).fill(EmptyCell);
38257
- updatedData.splice(selectedRow + 1, 0, newRow);
38269
+ updatedData.splice((row ?? selectedRow) + 1, 0, newRow);
38258
38270
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38259
38271
  return {
38260
38272
  ...state,
38261
38273
  model: updatedModel,
38262
- selectedRow: selectedRow + 1,
38274
+ selectedRow: (row ?? selectedRow) + 1,
38263
38275
  selectedColumn: selectedColumn
38264
38276
  };
38265
38277
  }
@@ -38270,20 +38282,23 @@ function reducer(state, action) {
38270
38282
  selectedColumn,
38271
38283
  model
38272
38284
  } = state;
38273
- if (checkEmpty(selectedColumn)) {
38285
+ const {
38286
+ column
38287
+ } = action;
38288
+ if (checkEmpty(column ?? selectedColumn)) {
38274
38289
  return state;
38275
38290
  }
38276
- selectedColumn = selectedColumn;
38291
+ selectedColumn = column ?? selectedColumn;
38277
38292
  let updatedData = [...model.data];
38278
38293
  updatedData = updatedData.map(row => {
38279
- return [...row.slice(0, selectedColumn), EmptyCell, ...row.slice(selectedColumn)];
38294
+ return [...row.slice(0, column ?? selectedColumn), EmptyCell, ...row.slice(column ?? selectedColumn)];
38280
38295
  });
38281
38296
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38282
38297
  return {
38283
38298
  ...state,
38284
38299
  model: updatedModel,
38285
38300
  selectedRow: selectedRow,
38286
- selectedColumn: selectedColumn - 1
38301
+ selectedColumn: (column ?? selectedColumn) - 1
38287
38302
  };
38288
38303
  }
38289
38304
  case ADD_COLUMN_RIGHT:
@@ -38293,20 +38308,23 @@ function reducer(state, action) {
38293
38308
  selectedColumn,
38294
38309
  model
38295
38310
  } = state;
38296
- if (checkEmpty(selectedColumn)) {
38311
+ const {
38312
+ column
38313
+ } = action;
38314
+ if (checkEmpty(column ?? selectedColumn)) {
38297
38315
  return state;
38298
38316
  }
38299
- selectedColumn = selectedColumn;
38317
+ selectedColumn = column ?? selectedColumn;
38300
38318
  let updatedData = [...model.data];
38301
38319
  updatedData = updatedData.map(row => {
38302
- return [...row.slice(0, selectedColumn + 1), EmptyCell, ...row.slice(selectedColumn + 1)];
38320
+ return [...row.slice(0, (column ?? selectedColumn) + 1), EmptyCell, ...row.slice((column ?? selectedColumn) + 1)];
38303
38321
  });
38304
38322
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38305
38323
  return {
38306
38324
  ...state,
38307
38325
  model: updatedModel,
38308
38326
  selectedRow: selectedRow,
38309
- selectedColumn: selectedColumn + 1
38327
+ selectedColumn: (column ?? selectedColumn) + 1
38310
38328
  };
38311
38329
  }
38312
38330
  case DELETE_ROW:
@@ -38316,14 +38334,17 @@ function reducer(state, action) {
38316
38334
  selectedColumn,
38317
38335
  model
38318
38336
  } = state;
38337
+ const {
38338
+ row
38339
+ } = action;
38319
38340
  if (checkEmpty(selectedRow)) {
38320
38341
  return state;
38321
38342
  }
38322
- selectedRow = selectedRow;
38343
+ selectedRow = row ?? selectedRow;
38323
38344
  let updatedData = [...model.data];
38324
- updatedData.splice(selectedRow, 1);
38345
+ updatedData.splice(row ?? selectedRow, 1);
38325
38346
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38326
- let newSelectedRow = selectedRow > 0 ? selectedRow - 1 : 0;
38347
+ let newSelectedRow = row ?? selectedRow > 0 ? row ?? selectedRow - 1 : 0;
38327
38348
  const newSelectedColumn = selectedColumn !== null ? selectedColumn : 0;
38328
38349
  const newActive = updatedData.length > 0 ? {
38329
38350
  row: newSelectedRow,
@@ -38331,7 +38352,7 @@ function reducer(state, action) {
38331
38352
  } : null;
38332
38353
  const newSelected = updatedData.length > 0 ? new EntireRowsSelection(newSelectedRow, newSelectedRow) : new EmptySelection();
38333
38354
  const {
38334
- [selectedRow]: _,
38355
+ [row ?? selectedRow]: _,
38335
38356
  ...cleanedRowDimensions
38336
38357
  } = state.rowDimensions;
38337
38358
  return {
@@ -38351,8 +38372,11 @@ function reducer(state, action) {
38351
38372
  selectedColumn,
38352
38373
  model
38353
38374
  } = state;
38354
- if (checkEmpty(selectedColumn)) return state;
38355
- const colIndex = selectedColumn;
38375
+ const {
38376
+ column
38377
+ } = action;
38378
+ if (checkEmpty(column ?? selectedColumn)) return state;
38379
+ const colIndex = column ?? selectedColumn;
38356
38380
  const updatedData = model.data.map(row => row.filter((_, cellIndex) => cellIndex !== colIndex));
38357
38381
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38358
38382
  const newSelectedRow = selectedRow || 0;
@@ -40322,7 +40346,8 @@ const ColumnIndicator = ({
40322
40346
  cell,
40323
40347
  selectedColumn,
40324
40348
  minimumColumnWidth,
40325
- maxColLimit
40349
+ maxColLimit,
40350
+ disableDeleteOption
40326
40351
  }) => {
40327
40352
  const dispatch = useDispatch();
40328
40353
  const minColumnWidth = minimumColumnWidth;
@@ -40336,7 +40361,7 @@ const ColumnIndicator = ({
40336
40361
  label: 'Add Column Left',
40337
40362
  value: 'Add Column Left',
40338
40363
  iconName: 'plus_icon',
40339
- action: addColumnLeft,
40364
+ action: () => addColumnLeft(column),
40340
40365
  disableTooltip: 'Column limit reached',
40341
40366
  visible: cell?.contextDisable?.['Add Column Left'] ?? false,
40342
40367
  disable: columnCount >= maxColLimit
@@ -40344,19 +40369,19 @@ const ColumnIndicator = ({
40344
40369
  label: 'Add Column Right',
40345
40370
  value: 'Add Column Right',
40346
40371
  iconName: 'plus_icon',
40347
- action: addColumnRight,
40372
+ action: () => addColumnRight(column),
40348
40373
  disableTooltip: 'Column limit reached',
40349
40374
  visible: cell?.contextDisable?.['Add Column Right'] ?? false,
40350
40375
  disable: columnCount >= maxColLimit
40351
- }, {
40376
+ }, ...(!disableDeleteOption ? [{
40352
40377
  label: 'Delete Column',
40353
40378
  value: 'Delete Column',
40354
40379
  iconName: 'delete',
40355
- action: deleteColumn,
40356
- disableTooltip: 'Column limit reached',
40380
+ action: () => deleteColumn(column),
40381
+ disableTooltip: '',
40357
40382
  visible: cell?.contextDisable?.['Delete Column'] ?? false,
40358
40383
  disable: false
40359
- }];
40384
+ }] : [])];
40360
40385
  }, [selectedColumn, cell, addColumnLeft, addColumnRight, deleteColumn]);
40361
40386
  const onMouseDrag = React__namespace.useCallback((event, isRight) => {
40362
40387
  const getTargetColumn = isRight ? column - 1 : column;
@@ -40386,17 +40411,10 @@ const ColumnIndicator = ({
40386
40411
  onSelect(column, event.shiftKey);
40387
40412
  setContextMenu({
40388
40413
  open: columnContextEnable,
40414
+ contextType: 'column',
40389
40415
  options
40390
40416
  });
40391
40417
  }, [column, selectedColumn, columnContextEnable, options]);
40392
- React__namespace.useEffect(() => {
40393
- if (selectedColumn !== undefined) {
40394
- setContextMenu(prev => ({
40395
- open: prev.open,
40396
- options
40397
- }));
40398
- }
40399
- }, [column, selectedColumn, columnContextEnable, options]);
40400
40418
  return jsxRuntime.jsxs("th", {
40401
40419
  className: classNames('ff-spreadsheet-header', {
40402
40420
  'ff-spreadsheet-header--selected': selected
@@ -40468,7 +40486,8 @@ const RowIndicator = ({
40468
40486
  rowContextEnable,
40469
40487
  selectedRow,
40470
40488
  cell,
40471
- maxRowLimit
40489
+ maxRowLimit,
40490
+ disableDeleteOption
40472
40491
  }) => {
40473
40492
  const dispatch = useDispatch();
40474
40493
  const rowHeight = useSelector(state => state.rowDimensions[row]?.height || 32);
@@ -40481,7 +40500,7 @@ const RowIndicator = ({
40481
40500
  label: 'Add Row Top',
40482
40501
  value: 'Add Row Top',
40483
40502
  iconName: 'plus_icon',
40484
- action: addRowTop,
40503
+ action: () => addRowTop(row),
40485
40504
  disableTooltip: 'Row limit reached',
40486
40505
  visible: cell?.contextDisable?.['Add Row Top'] ?? false,
40487
40506
  disable: rowCount >= maxRowLimit
@@ -40489,20 +40508,20 @@ const RowIndicator = ({
40489
40508
  label: 'Add Row Bottom',
40490
40509
  value: 'Add Row Bottom',
40491
40510
  iconName: 'plus_icon',
40492
- action: addRowBottom,
40511
+ action: () => addRowBottom(row),
40493
40512
  disableTooltip: 'Row limit reached',
40494
40513
  visible: cell?.contextDisable?.['Add Row Bottom'] ?? false,
40495
40514
  disable: rowCount >= maxRowLimit
40496
- }, {
40515
+ }, ...(!disableDeleteOption ? [{
40497
40516
  label: 'Delete Row',
40498
40517
  value: 'Delete Row',
40499
40518
  iconName: 'delete',
40500
- action: deleteRow,
40501
- disableTooltip: 'Row limit reached',
40519
+ action: () => deleteRow(row),
40520
+ disableTooltip: '',
40502
40521
  visible: cell?.contextDisable?.['Delete Row'] ?? false,
40503
40522
  disable: false
40504
- }];
40505
- }, [selectedRow]);
40523
+ }] : [])];
40524
+ }, [selectedRow, row]);
40506
40525
  const handleMouseDrag = React__namespace.useCallback((event, isUp) => {
40507
40526
  const getTargetRow = isUp ? row : row - 1;
40508
40527
  const targetRow = Math.max(getTargetRow, 0);
@@ -40531,17 +40550,10 @@ const RowIndicator = ({
40531
40550
  onSelect(row, event.shiftKey);
40532
40551
  setContextMenu({
40533
40552
  open: rowContextEnable,
40553
+ contextType: 'row',
40534
40554
  options
40535
40555
  });
40536
40556
  }, [row, rowContextEnable, options, selectedRow]);
40537
- React__namespace.useEffect(() => {
40538
- if (selectedRow !== undefined) {
40539
- setContextMenu(prev => ({
40540
- open: prev.open,
40541
- options
40542
- }));
40543
- }
40544
- }, [row, rowContextEnable, options, selectedRow]);
40545
40557
  return jsxRuntime.jsxs("th", {
40546
40558
  className: classNames('ff-spreadsheet-header', {
40547
40559
  'ff-spreadsheet-header--selected': selected
@@ -41172,6 +41184,7 @@ const ActiveCell = props => {
41172
41184
  event.preventDefault();
41173
41185
  props.setContextMenu({
41174
41186
  open: props.contextOption?.open ?? false,
41187
+ contextType: props.contextOption?.contextType ?? null,
41175
41188
  options: props.contextOption?.options || []
41176
41189
  });
41177
41190
  }, [props]);
@@ -41842,7 +41855,8 @@ const Spreadsheet = props => {
41842
41855
  setContextMenu,
41843
41856
  showHider,
41844
41857
  maxRowLimit,
41845
- maxColLimit
41858
+ maxColLimit,
41859
+ disableDeleteOption
41846
41860
  } = props;
41847
41861
  const [sheetChange, setSheetChange] = React__namespace.useState(false);
41848
41862
  const [maxWidth, setMaxWidth] = React__namespace.useState(0);
@@ -41936,18 +41950,6 @@ const Spreadsheet = props => {
41936
41950
  }
41937
41951
  prevActiveRef.current = state.active;
41938
41952
  }, [onActivate, state.active]);
41939
- React__namespace.useEffect(() => {
41940
- // When rows are added/removed, reset visible range if needed
41941
- if (prevDataPropRef.current && props.data.length !== prevDataPropRef.current.length) {
41942
- if (visibleRange.end >= props.data.length) {
41943
- setVisibleRange({
41944
- start: Math.max(0, props.data.length - 100),
41945
- end: props.data.length
41946
- });
41947
- }
41948
- }
41949
- prevDataPropRef.current = props.data;
41950
- }, [props.data, visibleRange]);
41951
41953
  const prevEvaluatedDataRef = React__namespace.useRef(state.model.evaluatedData);
41952
41954
  React__namespace.useEffect(() => {
41953
41955
  if (state?.model?.evaluatedData !== prevEvaluatedDataRef?.current) {
@@ -42134,6 +42136,7 @@ const Spreadsheet = props => {
42134
42136
  const dynamicScroll = scrollHeight - offsetHeight;
42135
42137
  if (size.rows < 100) {
42136
42138
  updateVisibleRange(0, size.rows, 0);
42139
+ setScrollCount(0);
42137
42140
  } else if (scrollTop === 0 && scrollCount !== 0) {
42138
42141
  const newScroll = scrollCount - 1;
42139
42142
  updateVisibleRange(newScroll * rowHeight, newScroll * rowHeight + visibleRows, newScroll);
@@ -42150,6 +42153,7 @@ const Spreadsheet = props => {
42150
42153
  });
42151
42154
  setContextMenu({
42152
42155
  open: false,
42156
+ contextType: null,
42153
42157
  options: [{
42154
42158
  label: '',
42155
42159
  value: '',
@@ -42182,7 +42186,8 @@ const Spreadsheet = props => {
42182
42186
  addColumnLeft: addColumnLeft$1,
42183
42187
  addColumnRight: addColumnRight$1,
42184
42188
  columnContextEnable: props.columnContextEnable,
42185
- maxColLimit: maxColLimit
42189
+ maxColLimit: maxColLimit,
42190
+ disableDeleteOption: disableDeleteOption
42186
42191
  }, columnNumber) : jsxRuntime.jsx(ColumnIndicator, {
42187
42192
  column: columnNumber,
42188
42193
  minimumColumnWidth: minimumColumnWidth,
@@ -42191,7 +42196,8 @@ const Spreadsheet = props => {
42191
42196
  addColumnLeft: addColumnLeft$1,
42192
42197
  addColumnRight: addColumnRight$1,
42193
42198
  columnContextEnable: props.columnContextEnable,
42194
- maxColLimit: maxColLimit
42199
+ maxColLimit: maxColLimit,
42200
+ disableDeleteOption: disableDeleteOption
42195
42201
  }, columnNumber))]
42196
42202
  }), renderReady && scrollerFunction().map(rowNumber => jsxRuntime.jsxs(Row$1, {
42197
42203
  row: rowNumber,
@@ -42203,7 +42209,8 @@ const Spreadsheet = props => {
42203
42209
  deleteRow: deleteRow$1,
42204
42210
  setContextMenu: props.setContextMenu,
42205
42211
  rowContextEnable: props.rowContextEnable,
42206
- maxRowLimit: maxRowLimit
42212
+ maxRowLimit: maxRowLimit,
42213
+ disableDeleteOption: disableDeleteOption
42207
42214
  }, rowNumber) : jsxRuntime.jsx(RowIndicator$1, {
42208
42215
  row: rowNumber,
42209
42216
  addRowTop: addRowTop$1,
@@ -42211,7 +42218,8 @@ const Spreadsheet = props => {
42211
42218
  deleteRow: deleteRow$1,
42212
42219
  setContextMenu: props.setContextMenu,
42213
42220
  rowContextEnable: props.rowContextEnable,
42214
- maxRowLimit: maxRowLimit
42221
+ maxRowLimit: maxRowLimit,
42222
+ disableDeleteOption: disableDeleteOption
42215
42223
  }, rowNumber), range(size.columns).map(columnNumber => jsxRuntime.jsx(Cell$1, {
42216
42224
  row: rowNumber,
42217
42225
  column: columnNumber,
@@ -42275,6 +42283,7 @@ const Spreadsheet = props => {
42275
42283
  scrollOption && throttledHandleScroll(e);
42276
42284
  setContextMenu({
42277
42285
  open: false,
42286
+ contextType: null,
42278
42287
  options: [{
42279
42288
  label: '',
42280
42289
  value: '',
@@ -42298,15 +42307,12 @@ const Spreadsheet = props => {
42298
42307
  const ExcelContextMenu = ({
42299
42308
  contextMenu,
42300
42309
  position,
42301
- editable,
42302
- disableDeleteOption
42310
+ editable
42303
42311
  }) => {
42312
+ if (!contextMenu.open) return null;
42304
42313
  const checkDelete = label => {
42305
42314
  return label.includes('Delete');
42306
42315
  };
42307
- const isOptionDisabled = option => {
42308
- return option.disable || checkDelete(option.label) && disableDeleteOption;
42309
- };
42310
42316
  return editable && jsxRuntime.jsx("div", {
42311
42317
  onContextMenu: event => {
42312
42318
  event.preventDefault();
@@ -42321,7 +42327,7 @@ const ExcelContextMenu = ({
42321
42327
  },
42322
42328
  children: contextMenu.options.map(option => {
42323
42329
  if (!option.visible) {
42324
- const disabled = isOptionDisabled(option);
42330
+ const disabled = option.disable;
42325
42331
  return jsxRuntime.jsx(Tooltip, {
42326
42332
  title: disabled ? option.disableTooltip : '',
42327
42333
  children: jsxRuntime.jsxs("div", {
@@ -42401,6 +42407,7 @@ const ExcelFile = ({
42401
42407
  const [saveInfo, setSaveInfo] = React.useState('');
42402
42408
  const [contextMenu, setContextMenu] = React.useState({
42403
42409
  open: false,
42410
+ contextType: null,
42404
42411
  options: [{
42405
42412
  label: '',
42406
42413
  value: '',
@@ -42713,28 +42720,34 @@ const ExcelFile = ({
42713
42720
  selection?.removeAllRanges();
42714
42721
  selection?.addRange(range);
42715
42722
  };
42716
- const handleClickOutside = React.useCallback(event => {
42717
- if (contextMenu.open) {
42718
- event.preventDefault();
42719
- event.stopPropagation();
42720
- setContextMenu({
42721
- open: false,
42722
- options: [{
42723
- label: '',
42724
- value: '',
42725
- iconName: '',
42726
- action: () => {},
42727
- disableTooltip: '',
42728
- visible: false,
42729
- disable: false
42730
- }]
42731
- });
42723
+ const handleClickOutside = React.useCallback((event, isLeftClick = false) => {
42724
+ const target = event.target;
42725
+ if (!(target.closest('.ff-excel-tab-list') || target.closest('.ff-excel-sheet')) || isLeftClick) {
42726
+ if (contextMenu.open) {
42727
+ event.preventDefault();
42728
+ event.stopPropagation();
42729
+ setContextMenu({
42730
+ open: false,
42731
+ contextType: null,
42732
+ options: [{
42733
+ label: '',
42734
+ value: '',
42735
+ iconName: '',
42736
+ action: () => {},
42737
+ disableTooltip: '',
42738
+ visible: false,
42739
+ disable: false
42740
+ }]
42741
+ });
42742
+ }
42732
42743
  }
42733
42744
  }, [contextMenu.open]);
42734
42745
  React.useEffect(() => {
42735
- document.addEventListener('click', handleClickOutside);
42746
+ document.addEventListener('contextmenu', handleClickOutside);
42747
+ document.addEventListener('click', e => handleClickOutside(e, true));
42736
42748
  return () => {
42737
- document.removeEventListener('click', handleClickOutside);
42749
+ document.removeEventListener('contextmenu', handleClickOutside);
42750
+ document.addEventListener('click', e => handleClickOutside(e, true));
42738
42751
  };
42739
42752
  }, [handleClickOutside]);
42740
42753
  const contextClick = (event, name, index) => {
@@ -42743,27 +42756,24 @@ const ExcelFile = ({
42743
42756
  label: 'Add Sheet',
42744
42757
  value: 'Add Sheet',
42745
42758
  iconName: 'plus_icon',
42746
- action: () => {
42747
- handleAddSheet();
42748
- },
42759
+ action: () => handleAddSheet(),
42749
42760
  disableTooltip: 'Sheet limit reached',
42750
42761
  visible: false,
42751
42762
  disable: addSheetIconDisable()
42752
- }, {
42763
+ }, ...(!disableDeleteOption ? [{
42753
42764
  label: 'Delete Sheet',
42754
42765
  value: 'Delete Sheet',
42755
42766
  iconName: 'delete',
42756
- action: () => {
42757
- handleDeleteSheet(name, index);
42758
- },
42767
+ action: () => handleDeleteSheet(name, index),
42759
42768
  disableTooltip: '',
42760
42769
  visible: false,
42761
42770
  disable: false
42762
- }];
42771
+ }] : [])];
42763
42772
  setContextMenu(prev => ({
42764
42773
  ...prev,
42765
42774
  open: true,
42766
- options: options
42775
+ contextType: 'sheet',
42776
+ options
42767
42777
  }));
42768
42778
  };
42769
42779
  const setContextPosition = event => {
@@ -42796,7 +42806,7 @@ const ExcelFile = ({
42796
42806
  if (event.target.classList.contains('ff-excel-tab-list')) {
42797
42807
  setPosition({
42798
42808
  x: sheetRefX,
42799
- y: sheetRefY - 65
42809
+ y: sheetRefY - (disableDeleteOption ? 32 : 65)
42800
42810
  });
42801
42811
  return;
42802
42812
  }
@@ -42817,6 +42827,7 @@ const ExcelFile = ({
42817
42827
  if (contextMenu.open) {
42818
42828
  setContextMenu({
42819
42829
  open: false,
42830
+ contextType: null,
42820
42831
  options: [{
42821
42832
  label: '',
42822
42833
  value: '',
@@ -42854,7 +42865,8 @@ const ExcelFile = ({
42854
42865
  scroller: scroller,
42855
42866
  showHider: showHider,
42856
42867
  maxRowLimit: maxRowLimit,
42857
- maxColLimit: maxColLimit
42868
+ maxColLimit: maxColLimit,
42869
+ disableDeleteOption: disableDeleteOption
42858
42870
  })
42859
42871
  }), sheetBar !== 'hide' && jsxRuntime.jsxs("div", {
42860
42872
  className: "ff-excel-sheet-bar",
@@ -42916,8 +42928,7 @@ const ExcelFile = ({
42916
42928
  }), contextMenu.open && jsxRuntime.jsx(ExcelContextMenu, {
42917
42929
  contextMenu: contextMenu,
42918
42930
  position: position,
42919
- editable: editable,
42920
- disableDeleteOption: disableDeleteOption
42931
+ editable: editable
42921
42932
  }), jsxRuntime.jsx(Toastify, {})]
42922
42933
  })
42923
42934
  });
@@ -46458,7 +46469,7 @@ const VariableDropdown = ({
46458
46469
  if (!option) return '';
46459
46470
  const variableId = option._id || option.id;
46460
46471
  if (variableId?.startsWith('PARAMETER')) return 'step_group_parameter';
46461
- if (option.type === 'LOCAL' && option?.parentVariableType === 'STEPGROUP') return 'step_group_variable';
46472
+ if (option?.parentVariableType === 'STEPGROUP' && (option.type === 'LOCAL' || option?.type === 'STEPGROUP')) return 'step_group_variable';
46462
46473
  if (option.type === '_startforloop') return 'for_loop_variable';
46463
46474
  if (option.type === 'DATAPROVIDER') return 'data_provider_variable';
46464
46475
  return VARIABLE_ICON_MAP[option.type || ''] || '';
@@ -46561,6 +46572,31 @@ const LineChart = ({
46561
46572
  const xMax = width - margin * 2;
46562
46573
  const yMax = height - margin * 2;
46563
46574
  const [tooltipVisible, setTooltipVisible] = React.useState(false);
46575
+ const [hoverState, setHoverState] = React.useState({
46576
+ cursorX: null,
46577
+ hoverValues: {},
46578
+ dotPositions: {},
46579
+ tooltip: {
46580
+ visible: false,
46581
+ left: 0,
46582
+ top: 0
46583
+ },
46584
+ currentXValue: null
46585
+ });
46586
+ React.useEffect(() => {
46587
+ const handleScroll = () => {
46588
+ setTooltipVisible(false);
46589
+ setHoverState(prev => ({
46590
+ ...prev,
46591
+ tooltip: {
46592
+ ...prev.tooltip,
46593
+ visible: false
46594
+ }
46595
+ }));
46596
+ };
46597
+ window.addEventListener('scroll', handleScroll, true);
46598
+ return () => window.removeEventListener('scroll', handleScroll, true);
46599
+ }, []);
46564
46600
  const hasData = data && data.length > 0 && data?.some(line => Array.isArray(line?.data) && line?.data?.length > 0);
46565
46601
  if (!hasData) {
46566
46602
  const defaultDates = [];
@@ -46826,31 +46862,6 @@ const LineChart = ({
46826
46862
  });
46827
46863
  }
46828
46864
  };
46829
- const [hoverState, setHoverState] = React.useState({
46830
- cursorX: null,
46831
- hoverValues: {},
46832
- dotPositions: {},
46833
- tooltip: {
46834
- visible: false,
46835
- left: 0,
46836
- top: 0
46837
- },
46838
- currentXValue: null
46839
- });
46840
- React.useEffect(() => {
46841
- const handleScroll = () => {
46842
- setTooltipVisible(false);
46843
- setHoverState(prev => ({
46844
- ...prev,
46845
- tooltip: {
46846
- ...prev.tooltip,
46847
- visible: false
46848
- }
46849
- }));
46850
- };
46851
- window.addEventListener('scroll', handleScroll, true);
46852
- return () => window.removeEventListener('scroll', handleScroll, true);
46853
- }, []);
46854
46865
  const handleMouseMove = e => {
46855
46866
  const svgRect = e.currentTarget.getBoundingClientRect();
46856
46867
  const mouseX = e.clientX - svgRect.left - margin;
@@ -78436,15 +78447,20 @@ const appendNewRow = (tableData, AddNlp) => {
78436
78447
  return updatedTreeData;
78437
78448
  };
78438
78449
 
78439
- const scrollToView = id => {
78440
- if (id) {
78441
- const element = document.getElementById(id);
78442
- if (element) {
78443
- element.scrollIntoView({
78444
- behavior: 'smooth',
78445
- block: 'nearest'
78446
- });
78447
- }
78450
+ const scrollToView = (id, block = 'nearest', retries = 5) => {
78451
+ if (!id) return;
78452
+ const element = document.getElementById(id);
78453
+ if (element) {
78454
+ element.scrollIntoView({
78455
+ behavior: 'smooth',
78456
+ block
78457
+ });
78458
+ } else if (retries > 0) {
78459
+ setTimeout(() => {
78460
+ scrollToView(id, block, retries - 1);
78461
+ }, 300);
78462
+ } else {
78463
+ console.warn(`Element with id - "${id}" not found after multiple retries.`);
78448
78464
  }
78449
78465
  };
78450
78466
 
@@ -78702,84 +78718,107 @@ const StepGroupAccordions = /*#__PURE__*/React.memo(({
78702
78718
  handleStepGroupExpand,
78703
78719
  isStepGroupExpanded,
78704
78720
  isViewPrivilegeMode,
78705
- columns = []
78721
+ columns = [],
78722
+ parentIndex,
78723
+ updateRowHeight
78706
78724
  }) => {
78725
+ const rowRefs = React.useRef([]);
78707
78726
  const typeSet = new Set(['Group', 'PRE', 'POST', 'Script']);
78708
78727
  const getPadding = type => typeSet.has(type) ? '6px 8px' : '7px 8px';
78709
78728
  const indent = level + 8;
78729
+ // Measure and report height when expanded
78730
+ React.useEffect(() => {
78731
+ if (!updateRowHeight) return;
78732
+ let totalHeight = 0;
78733
+ rowRefs.current.forEach(ref => {
78734
+ if (ref) {
78735
+ totalHeight += ref.getBoundingClientRect().height;
78736
+ }
78737
+ });
78738
+ if (totalHeight > 0) {
78739
+ updateRowHeight(parentIndex ?? 0, totalHeight);
78740
+ }
78741
+ }, [data, updateRowHeight, parentIndex, isStepGroupExpanded]);
78710
78742
  return jsxRuntime.jsx(jsxRuntime.Fragment, {
78711
- children: data?.map(item => jsxRuntime.jsxs(React.Fragment, {
78712
- children: [viewModeId === item?.stepId ? jsxRuntime.jsx("tr", {
78713
- className: "steps-edit-row",
78714
- id: "getInFocus",
78715
- children: jsxRuntime.jsx("td", {
78716
- colSpan: columnCount,
78717
- children: jsxRuntime.jsx("div", {
78718
- style: {
78719
- marginLeft: `${indent}px`
78720
- },
78721
- children: ViewComponent && jsxRuntime.jsx(ViewComponent, {})
78722
- })
78723
- })
78724
- }) : jsxRuntime.jsx("tr", {
78725
- children: columns.map((col, idx) => jsxRuntime.jsx("td", {
78726
- style: {
78727
- maxWidth: col.width,
78728
- padding: getPadding(item.type)
78729
- },
78730
- children: jsxRuntime.jsxs(Typography, {
78731
- as: "div",
78732
- className: "ff-data-checkbox-container",
78733
- children: [jsxRuntime.jsxs("div", {
78734
- className: "ff-data-checkbox-container-content",
78743
+ children: data?.map((item, itemIndex) => {
78744
+ const absoluteIndex = parentIndex ?? 0 + itemIndex + 1;
78745
+ return jsxRuntime.jsxs(React.Fragment, {
78746
+ children: [viewModeId === item?.stepId ? jsxRuntime.jsx("tr", {
78747
+ ref: el => rowRefs.current[itemIndex] = el,
78748
+ className: "steps-edit-row",
78749
+ id: "getInFocus",
78750
+ children: jsxRuntime.jsx("td", {
78751
+ colSpan: columnCount,
78752
+ children: jsxRuntime.jsx("div", {
78735
78753
  style: {
78736
- marginLeft: idx === 0 ? `${indent}px` : 0
78737
- },
78738
- onClick: () => {
78739
- const isClickable = idx === 0 && !item?.displayName?.includes('End') && !item?.isDisabled;
78740
- if (isClickable) handleClick?.({
78741
- ...item,
78742
- tableType
78743
- });
78754
+ marginLeft: `${indent}px`
78744
78755
  },
78745
- children: [!isViewPrivilegeMode && idx === 0 && jsxRuntime.jsx("div", {
78756
+ children: ViewComponent && jsxRuntime.jsx(ViewComponent, {})
78757
+ })
78758
+ })
78759
+ }) : jsxRuntime.jsx("tr", {
78760
+ ref: el => rowRefs.current[itemIndex] = el,
78761
+ children: columns.map((col, idx) => jsxRuntime.jsx("td", {
78762
+ style: {
78763
+ maxWidth: col.width,
78764
+ padding: getPadding(item.type)
78765
+ },
78766
+ children: jsxRuntime.jsxs(Typography, {
78767
+ as: "div",
78768
+ className: "ff-data-checkbox-container",
78769
+ children: [jsxRuntime.jsxs("div", {
78770
+ className: "ff-data-checkbox-container-content",
78746
78771
  style: {
78747
- padding: '4px 18px'
78748
- }
78749
- }), prepareData({
78750
- ...item,
78751
- marginLeft: indent
78752
- }, col)]
78753
- }), idx === 0 && ['Group', 'PRE', 'POST', 'Script'].includes(item.type) && jsxRuntime.jsx("div", {
78754
- className: `ff-accordion-arrow ${isStepGroupExpanded?.(item.stepId) ? 'expanded' : ''}`,
78755
- children: jsxRuntime.jsx(Icon, {
78756
- name: "arrow_right",
78757
- color: isStepGroupExpanded?.(item.stepId) ? 'var(--brand-color)' : 'var(--default-color)',
78758
- className: "steps-arrow-svg",
78759
- width: 12,
78760
- height: 12,
78761
- onClick: () => handleStepGroupExpand?.({
78772
+ marginLeft: idx === 0 ? `${indent}px` : 0
78773
+ },
78774
+ onClick: () => {
78775
+ const isClickable = idx === 0 && !item?.displayName?.includes('End') && !item?.isDisabled;
78776
+ if (isClickable) handleClick?.({
78777
+ ...item,
78778
+ tableType
78779
+ });
78780
+ },
78781
+ children: [!isViewPrivilegeMode && idx === 0 && jsxRuntime.jsx("div", {
78782
+ style: {
78783
+ padding: '4px 18px'
78784
+ }
78785
+ }), prepareData({
78762
78786
  ...item,
78763
- tableType
78787
+ marginLeft: indent
78788
+ }, col)]
78789
+ }), idx === 0 && ['Group', 'PRE', 'POST', 'Script'].includes(item.type) && jsxRuntime.jsx("div", {
78790
+ className: `ff-accordion-arrow ${isStepGroupExpanded?.(item.stepId) ? 'expanded' : ''}`,
78791
+ children: jsxRuntime.jsx(Icon, {
78792
+ name: "arrow_right",
78793
+ color: isStepGroupExpanded?.(item.stepId) ? 'var(--brand-color)' : 'var(--default-color)',
78794
+ className: "steps-arrow-svg",
78795
+ width: 12,
78796
+ height: 12,
78797
+ onClick: () => handleStepGroupExpand?.({
78798
+ ...item,
78799
+ tableType
78800
+ })
78764
78801
  })
78765
- })
78766
- })]
78767
- })
78768
- }, `${item.stepId}-${idx}`))
78769
- }), isStepGroupExpanded?.(item.stepId) && jsxRuntime.jsx(StepGroupAccordions, {
78770
- data: item.data,
78771
- level: indent,
78772
- columnCount: columnCount,
78773
- viewModeId: viewModeId,
78774
- ViewComponent: ViewComponent,
78775
- handleClick: handleClick,
78776
- tableType: tableType,
78777
- handleStepGroupExpand: handleStepGroupExpand,
78778
- isStepGroupExpanded: isStepGroupExpanded,
78779
- isViewPrivilegeMode: isViewPrivilegeMode,
78780
- columns: columns
78781
- })]
78782
- }, item.stepId))
78802
+ })]
78803
+ })
78804
+ }, `${item.stepId}-${idx}`))
78805
+ }), isStepGroupExpanded?.(item.stepId) && jsxRuntime.jsx(StepGroupAccordions, {
78806
+ data: item.data,
78807
+ level: indent,
78808
+ columnCount: columnCount,
78809
+ viewModeId: viewModeId,
78810
+ ViewComponent: ViewComponent,
78811
+ handleClick: handleClick,
78812
+ tableType: tableType,
78813
+ handleStepGroupExpand: handleStepGroupExpand,
78814
+ isStepGroupExpanded: isStepGroupExpanded,
78815
+ isViewPrivilegeMode: isViewPrivilegeMode,
78816
+ columns: columns,
78817
+ parentIndex: absoluteIndex,
78818
+ updateRowHeight: updateRowHeight
78819
+ })]
78820
+ }, item.stepId);
78821
+ })
78783
78822
  });
78784
78823
  });
78785
78824
  StepGroupAccordions.displayName = 'StepGroupAccordions';
@@ -78804,8 +78843,10 @@ const StepTableMainRow = ({
78804
78843
  dataLength,
78805
78844
  stepPartialSelect,
78806
78845
  isViewPrivilegeMode,
78807
- isClientSide
78846
+ isClientSide,
78847
+ updateRowHeight
78808
78848
  }) => {
78849
+ const rowRef = React.useRef(null);
78809
78850
  const isDisabled = React.useMemo(() => row?.isDisabled || (dataLength ?? 0) <= 1 || row.isSpecialNlp, [row, dataLength]);
78810
78851
  let serialNumber = (indexNumber + 1).toString();
78811
78852
  const {
@@ -78823,6 +78864,13 @@ const StepTableMainRow = ({
78823
78864
  transition
78824
78865
  }), [transform, transition]);
78825
78866
  const key = row?._id || row?.stepId;
78867
+ // Measure row height and report to parent
78868
+ React.useEffect(() => {
78869
+ if (rowRef.current && updateRowHeight) {
78870
+ const height = rowRef.current.getBoundingClientRect().height;
78871
+ updateRowHeight(indexNumber, height);
78872
+ }
78873
+ }, [row, updateRowHeight, indexNumber, isStepGroupExpanded?.(row?.stepId)]);
78826
78874
  const getPadding = index => {
78827
78875
  if (isViewPrivilegeMode || isClientSide) {
78828
78876
  if (['Group', 'PRE', 'POST', 'Script'].includes(row.type) && index === 0) {
@@ -78873,7 +78921,10 @@ const StepTableMainRow = ({
78873
78921
  });
78874
78922
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
78875
78923
  children: [jsxRuntime.jsx("tr", {
78876
- ref: setNodeRef,
78924
+ ref: el => {
78925
+ rowRef.current = el;
78926
+ setNodeRef(el);
78927
+ },
78877
78928
  style: style,
78878
78929
  className: classNames(tableBodyRowClass, {
78879
78930
  'disabled-inner-row': isDisabled
@@ -78917,7 +78968,9 @@ const StepTableMainRow = ({
78917
78968
  isStepGroupExpanded: isStepGroupExpanded,
78918
78969
  level: row?.marginLeft,
78919
78970
  isViewPrivilegeMode: isViewPrivilegeMode,
78920
- columns: columns
78971
+ columns: columns,
78972
+ parentIndex: indexNumber,
78973
+ updateRowHeight: updateRowHeight
78921
78974
  })]
78922
78975
  });
78923
78976
  };
@@ -78957,11 +79010,132 @@ const StepInnerTable = ({
78957
79010
  isClientSide
78958
79011
  }) => {
78959
79012
  const observerRef = React.useRef(null);
79013
+ const containerRef = React.useRef(null);
79014
+ const [scrollTop, setScrollTop] = React.useState(0);
79015
+ const [containerHeight, setContainerHeight] = React.useState(0);
79016
+ const [rowHeights, setRowHeights] = React.useState([]);
79017
+ const [focusRowId, setFocusRowId] = React.useState(null);
79018
+ const buffer = 5;
79019
+ const estimatedRowHeight = 50;
79020
+ // Reset row heights when data changes
78960
79021
  React.useEffect(() => {
78961
- const scrollContainer = document.getElementById('ff-table-scroll-container');
79022
+ if (containerRef.current) {
79023
+ setContainerHeight(containerRef.current.clientHeight);
79024
+ }
79025
+ const fullData = appendNewRow(data, AddNlp ?? {});
79026
+ setRowHeights(new Array(fullData.length).fill(estimatedRowHeight));
79027
+ }, [data, AddNlp]);
79028
+ // Track focus row for edit/new rows
79029
+ React.useEffect(() => {
79030
+ if (editMode) {
79031
+ setFocusRowId(editMode);
79032
+ } else if (AddNlp && Object.keys(AddNlp).length > 0) {
79033
+ const newRow = appendNewRow(data, AddNlp).find(row => row.isNew);
79034
+ if (newRow) {
79035
+ setFocusRowId(newRow.stepId || 'new-row');
79036
+ }
79037
+ } else {
79038
+ setFocusRowId(null);
79039
+ }
79040
+ }, [editMode, AddNlp, data]);
79041
+ // Improved scroll-to-focus with rendering delay
79042
+ React.useEffect(() => {
79043
+ if (focusRowId && containerRef.current) {
79044
+ const timer = setTimeout(() => {
79045
+ const focusElement = containerRef.current?.querySelector('#getInFocus');
79046
+ if (focusElement) {
79047
+ focusElement.scrollIntoView({
79048
+ behavior: 'smooth',
79049
+ block: 'nearest'
79050
+ });
79051
+ }
79052
+ }, 100);
79053
+ return () => clearTimeout(timer);
79054
+ }
79055
+ // Explicitly return undefined when condition isn't met
79056
+ return () => {};
79057
+ }, [focusRowId, rowHeights]);
79058
+ // Handle scroll
79059
+ const handleScroll = e => {
79060
+ setScrollTop(e.currentTarget.scrollTop);
79061
+ };
79062
+ // Update row height callback
79063
+ const updateRowHeight = React.useCallback((index, height) => {
79064
+ setRowHeights(prev => {
79065
+ const newHeights = [...prev];
79066
+ if (index < newHeights.length && newHeights[index] !== height) {
79067
+ newHeights[index] = height;
79068
+ return newHeights;
79069
+ }
79070
+ return prev;
79071
+ });
79072
+ }, []);
79073
+ // Calculate visible rows
79074
+ const fullData = appendNewRow(data, AddNlp ?? {});
79075
+ const totalRows = fullData.length;
79076
+ let startIndex = 0;
79077
+ let endIndex = totalRows - 1;
79078
+ let paddingTop = 0;
79079
+ let paddingBottom = 0;
79080
+ if (rowHeights.length === totalRows && containerHeight > 0) {
79081
+ let cumulativeHeight = 0;
79082
+ // Find start index
79083
+ for (let i = 0; i < totalRows; i++) {
79084
+ if (cumulativeHeight <= scrollTop) {
79085
+ startIndex = i;
79086
+ }
79087
+ cumulativeHeight += rowHeights[i] ?? 0;
79088
+ }
79089
+ // Find end index
79090
+ cumulativeHeight = 0;
79091
+ for (let i = 0; i < totalRows; i++) {
79092
+ cumulativeHeight += rowHeights[i] ?? 0;
79093
+ if (cumulativeHeight >= scrollTop + containerHeight && endIndex === totalRows - 1) {
79094
+ endIndex = i;
79095
+ break;
79096
+ }
79097
+ }
79098
+ // Apply buffer
79099
+ startIndex = Math.max(0, startIndex - buffer);
79100
+ endIndex = Math.min(totalRows - 1, endIndex + buffer);
79101
+ // Expand range to include focus row if needed
79102
+ if (focusRowId) {
79103
+ const focusIndex = fullData.findIndex(row => row.stepId === focusRowId || row.isNew && focusRowId === 'new-row');
79104
+ if (focusIndex >= 0) {
79105
+ if (focusIndex < startIndex) {
79106
+ startIndex = focusIndex;
79107
+ } else if (focusIndex > endIndex) {
79108
+ endIndex = focusIndex;
79109
+ }
79110
+ }
79111
+ }
79112
+ // Calculate padding
79113
+ paddingTop = rowHeights.slice(0, startIndex).reduce((sum, height) => sum + height, 0);
79114
+ paddingBottom = rowHeights.slice(endIndex + 1).reduce((sum, height) => sum + height, 0);
79115
+ } else {
79116
+ // Fallback to estimated virtualization
79117
+ startIndex = Math.max(0, Math.floor(scrollTop / estimatedRowHeight) - buffer);
79118
+ endIndex = Math.min(totalRows - 1, startIndex + Math.ceil(containerHeight / estimatedRowHeight) + buffer);
79119
+ // Expand range to include focus row if needed
79120
+ if (focusRowId) {
79121
+ const focusIndex = fullData.findIndex(row => row.stepId === focusRowId || row.isNew && focusRowId === 'new-row');
79122
+ if (focusIndex >= 0) {
79123
+ if (focusIndex < startIndex) {
79124
+ startIndex = focusIndex;
79125
+ } else if (focusIndex > endIndex) {
79126
+ endIndex = focusIndex;
79127
+ }
79128
+ }
79129
+ }
79130
+ paddingTop = startIndex * estimatedRowHeight;
79131
+ paddingBottom = (totalRows - endIndex - 1) * estimatedRowHeight;
79132
+ }
79133
+ const visibleRows = fullData.slice(startIndex, endIndex + 1);
79134
+ // Infinite scroll observer
79135
+ React.useEffect(() => {
79136
+ const scrollContainer = containerRef.current;
78962
79137
  const firstNode = document.getElementById('ff-table-first-node');
78963
79138
  const lastNode = document.getElementById('ff-table-last-node');
78964
- // Exit early if data is empty or elements are missing
78965
79139
  if (!scrollContainer || !firstNode || !lastNode || !data?.length) {
78966
79140
  return;
78967
79141
  }
@@ -78980,7 +79154,6 @@ const StepInnerTable = ({
78980
79154
  observerRef.current.observe(firstNode);
78981
79155
  observerRef.current.observe(lastNode);
78982
79156
  return () => {
78983
- // Cleanup observer
78984
79157
  observerRef.current?.disconnect();
78985
79158
  };
78986
79159
  }, [data, loadMore]);
@@ -79018,15 +79191,18 @@ const StepInnerTable = ({
79018
79191
  items: data?.map(row => row._id || row.stepId),
79019
79192
  strategy: verticalListSortingStrategy,
79020
79193
  children: jsxRuntime.jsxs("div", {
79194
+ ref: containerRef,
79021
79195
  style: {
79022
79196
  height: height,
79023
- position: 'relative'
79197
+ position: 'relative',
79198
+ overflow: 'auto'
79024
79199
  },
79025
79200
  id: "ff-table-scroll-container",
79026
79201
  className: classNames(className, {
79027
79202
  'ff-fixed-header-steps-table': withFixedHeader,
79028
79203
  'steps-border-borderRadius': borderWithRadius
79029
79204
  }),
79205
+ onScroll: handleScroll,
79030
79206
  children: [jsxRuntime.jsxs("table", {
79031
79207
  className: classNames(`ff-table-steps`),
79032
79208
  cellSpacing: 0,
@@ -79043,30 +79219,43 @@ const StepInnerTable = ({
79043
79219
  }), jsxRuntime.jsxs("tbody", {
79044
79220
  className: "ff-steps-tbody",
79045
79221
  children: [jsxRuntime.jsx("tr", {
79046
- id: "ff-table-first-node"
79047
- }), appendNewRow(data, AddNlp ?? {})?.map((row, index) => {
79222
+ id: "ff-table-first-node",
79223
+ style: {
79224
+ display: 'none'
79225
+ }
79226
+ }), paddingTop > 0 && jsxRuntime.jsx("tr", {
79227
+ children: jsxRuntime.jsx("td", {
79228
+ style: {
79229
+ height: paddingTop,
79230
+ padding: 0
79231
+ },
79232
+ colSpan: columns.length
79233
+ })
79234
+ }), visibleRows.map((row, index) => {
79235
+ const absoluteIndex = startIndex + index;
79048
79236
  const isEdit = editMode === row.stepId;
79049
79237
  const isEditOrNew = isEdit || row.isNew;
79238
+ const isFocusRow = isEdit && row.stepId === focusRowId || row.isNew && focusRowId === 'new-row';
79050
79239
  const renderEditableRow = () => jsxRuntime.jsxs("tr", {
79051
79240
  className: "steps-edit-row",
79052
- id: "getInFocus",
79241
+ id: isFocusRow ? 'getInFocus' : undefined,
79053
79242
  children: [isEdit && /*#__PURE__*/React.isValidElement(editComponent) && jsxRuntime.jsx("td", {
79054
79243
  colSpan: columns.length,
79055
79244
  children: /*#__PURE__*/React.cloneElement(editComponent, {
79056
79245
  rowData: row,
79057
- rowIndex: index + 1
79246
+ rowIndex: absoluteIndex + 1
79058
79247
  })
79059
79248
  }), row.isNew && !isEdit && /*#__PURE__*/React.isValidElement(NlpComponent) && jsxRuntime.jsx("td", {
79060
79249
  colSpan: columns.length,
79061
79250
  children: /*#__PURE__*/React.cloneElement(NlpComponent, {
79062
- rowIndex: index,
79251
+ rowIndex: absoluteIndex,
79063
79252
  rowData: row
79064
79253
  })
79065
79254
  })]
79066
- }, row.stepId || index);
79255
+ }, row.stepId || absoluteIndex);
79067
79256
  const renderSortableRow = () => jsxRuntime.jsx(StepTableMainRow$1, {
79068
79257
  row: row,
79069
- indexNumber: index,
79258
+ indexNumber: absoluteIndex,
79070
79259
  columns: columns,
79071
79260
  tableBodyRowClass: tableBodyRowClass,
79072
79261
  handleOnclick: handleOnclick,
@@ -79084,11 +79273,23 @@ const StepInnerTable = ({
79084
79273
  dataLength: data?.length,
79085
79274
  stepPartialSelect: stepPartialSelect,
79086
79275
  isViewPrivilegeMode: isViewPrivilegeMode,
79087
- isClientSide: isClientSide
79276
+ isClientSide: isClientSide,
79277
+ updateRowHeight: updateRowHeight
79088
79278
  });
79089
79279
  return isEditOrNew ? renderEditableRow() : renderSortableRow();
79280
+ }), paddingBottom > 0 && jsxRuntime.jsx("tr", {
79281
+ children: jsxRuntime.jsx("td", {
79282
+ style: {
79283
+ height: paddingBottom,
79284
+ padding: 0
79285
+ },
79286
+ colSpan: columns.length
79287
+ })
79090
79288
  }), jsxRuntime.jsx("tr", {
79091
- id: "ff-table-last-node"
79289
+ id: "ff-table-last-node",
79290
+ style: {
79291
+ display: 'none'
79292
+ }
79092
79293
  })]
79093
79294
  })]
79094
79295
  }), data?.length <= 0 && jsxRuntime.jsx("div", {
@@ -79814,7 +80015,6 @@ const StepLandingTable = /*#__PURE__*/React.forwardRef(({
79814
80015
  }
79815
80016
  }));
79816
80017
  React.useEffect(() => {
79817
- scrollToView('getInFocus');
79818
80018
  if (!checkEmpty(AddNlp)) {
79819
80019
  setViewComponent(() => null);
79820
80020
  setViewModeId(null);