abdul-react 0.0.8 → 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 (65) hide show
  1. package/lib/_virtual/index10.js +2 -2
  2. package/lib/_virtual/index11.js +2 -2
  3. package/lib/_virtual/index9.js +2 -2
  4. package/lib/components/Charts/LineChart/LineChart.js +25 -25
  5. package/lib/components/Charts/LineChart/LineChart.js.map +1 -1
  6. package/lib/components/EditLabel/EditLabel.js +13 -2
  7. package/lib/components/EditLabel/EditLabel.js.map +1 -1
  8. package/lib/components/Editor/VariableDropdown.js +1 -1
  9. package/lib/components/Editor/VariableDropdown.js.map +1 -1
  10. package/lib/components/Excel/Data.d.ts +127 -0
  11. package/lib/components/Excel/Data.js +646 -0
  12. package/lib/components/Excel/Data.js.map +1 -0
  13. package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.d.ts +0 -1
  14. package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.js +3 -6
  15. package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.js.map +1 -1
  16. package/lib/components/Excel/ExcelFile/ExcelFile.d.ts +8 -20
  17. package/lib/components/Excel/ExcelFile/ExcelFile.js +36 -31
  18. package/lib/components/Excel/ExcelFile/ExcelFile.js.map +1 -1
  19. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.d.ts +1 -12
  20. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js +1 -0
  21. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js.map +1 -1
  22. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js +9 -15
  23. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js.map +1 -1
  24. package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js +10 -16
  25. package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js.map +1 -1
  26. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +2 -12
  27. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js +16 -5
  28. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js.map +1 -1
  29. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +19 -12
  30. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js +18 -12
  31. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js.map +1 -1
  32. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js +39 -21
  33. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js.map +1 -1
  34. package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +9 -6
  35. package/lib/components/Excel/Types.d.ts +1 -0
  36. package/lib/components/StepsLandingTable/Components/StepGroupAccordions.js +92 -69
  37. package/lib/components/StepsLandingTable/Components/StepGroupAccordions.js.map +1 -1
  38. package/lib/components/StepsLandingTable/Components/StepInnerTable.d.ts +1 -1
  39. package/lib/components/StepsLandingTable/Components/StepInnerTable.js +162 -14
  40. package/lib/components/StepsLandingTable/Components/StepInnerTable.js.map +1 -1
  41. package/lib/components/StepsLandingTable/Components/StepTableMainRow.js +18 -4
  42. package/lib/components/StepsLandingTable/Components/StepTableMainRow.js.map +1 -1
  43. package/lib/components/StepsLandingTable/Components/Types.d.ts +3 -0
  44. package/lib/components/StepsLandingTable/StepLandingTable.js +0 -2
  45. package/lib/components/StepsLandingTable/StepLandingTable.js.map +1 -1
  46. package/lib/index.cjs +454 -228
  47. package/lib/index.cjs.map +1 -1
  48. package/lib/index.d.ts +30 -27
  49. package/lib/node_modules/js-beautify/js/src/css/beautifier.js +1 -1
  50. package/lib/node_modules/js-beautify/js/src/css/index.js +1 -1
  51. package/lib/node_modules/js-beautify/js/src/css/options.js +1 -1
  52. package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
  53. package/lib/node_modules/js-beautify/js/src/html/index.js +1 -1
  54. package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
  55. package/lib/node_modules/js-beautify/js/src/html/tokenizer.js +1 -1
  56. package/lib/node_modules/js-beautify/js/src/javascript/index.js +1 -1
  57. package/lib/node_modules/js-beautify/js/src/javascript/options.js +1 -1
  58. package/lib/node_modules/js-beautify/js/src/javascript/tokenizer.js +1 -1
  59. package/lib/styles.css +1 -1
  60. package/lib/styles.css.map +1 -1
  61. package/lib/tsconfig.tsbuildinfo +1 -1
  62. package/lib/utils/ScrollToview/ScrollToView.d.ts +3 -1
  63. package/lib/utils/ScrollToview/ScrollToView.js +14 -9
  64. package/lib/utils/ScrollToview/ScrollToView.js.map +1 -1
  65. package/package.json +1 -1
package/lib/index.cjs CHANGED
@@ -16836,7 +16836,7 @@ const EditLabel = ({
16836
16836
  if (typeof handleOnChange === 'function') {
16837
16837
  handleOnChange(e);
16838
16838
  }
16839
- if (inlineValidationError && onChangeValidationError || isThrowingError) {
16839
+ if (inlineValidationError && onChangeValidationError && isThrowingError) {
16840
16840
  const errorMessage = handleCustomError ? handleCustomError(newValue) : '';
16841
16841
  if (errorMessage) {
16842
16842
  setShowError(errorMessage);
@@ -16882,7 +16882,12 @@ const EditLabel = ({
16882
16882
  setShouldShowToast(true);
16883
16883
  handleToastToggle('error');
16884
16884
  setShowError(errorMessage);
16885
+ return;
16885
16886
  } else {
16887
+ setShouldShowToast(false);
16888
+ setToasts({
16889
+ error: false
16890
+ });
16886
16891
  setIsEditing(false);
16887
16892
  setShowError('');
16888
16893
  if (onConfirm) onConfirm(text, currentSelectedOption);
@@ -16911,6 +16916,9 @@ const EditLabel = ({
16911
16916
  handleToastToggle('error');
16912
16917
  setShowError(errorMessage);
16913
16918
  setShouldShowToast(true);
16919
+ setToasts({
16920
+ error: true
16921
+ });
16914
16922
  return;
16915
16923
  }
16916
16924
  if (onCancel) {
@@ -16922,6 +16930,9 @@ const EditLabel = ({
16922
16930
  setShowError('');
16923
16931
  setIsEditable && setIsEditable(null);
16924
16932
  setShouldShowToast(false);
16933
+ setToasts({
16934
+ error: false
16935
+ });
16925
16936
  };
16926
16937
  const handleKeyDown = event => {
16927
16938
  if (event.key === 'Enter' && inputRef.current === document.activeElement) {
@@ -17103,7 +17114,7 @@ const EditLabel = ({
17103
17114
  fontSize: 8,
17104
17115
  className: "error-text",
17105
17116
  children: showError
17106
- }), !inlineValidationError && shouldShowToast && jsxRuntime.jsx(Toaster, {
17117
+ }), !inlineValidationError && shouldShowToast && !!showError && jsxRuntime.jsx(Toaster, {
17107
17118
  isOpen: toasts.error,
17108
17119
  variant: "info",
17109
17120
  toastTitle: "Info!",
@@ -36098,34 +36109,40 @@ function formatePainter(data) {
36098
36109
  }
36099
36110
  };
36100
36111
  }
36101
- function addRowTop() {
36112
+ function addRowTop(row) {
36102
36113
  return {
36103
- type: ADD_ROW_TOP
36114
+ type: ADD_ROW_TOP,
36115
+ row
36104
36116
  };
36105
36117
  }
36106
- function addRowBottom() {
36118
+ function addRowBottom(row) {
36107
36119
  return {
36108
- type: ADD_ROW_BOTTOM
36120
+ type: ADD_ROW_BOTTOM,
36121
+ row
36109
36122
  };
36110
36123
  }
36111
- function addColumnLeft() {
36124
+ function addColumnLeft(column) {
36112
36125
  return {
36113
- type: ADD_COLUMN_LEFT
36126
+ type: ADD_COLUMN_LEFT,
36127
+ column
36114
36128
  };
36115
36129
  }
36116
- function addColumnRight() {
36130
+ function addColumnRight(column) {
36117
36131
  return {
36118
- type: ADD_COLUMN_RIGHT
36132
+ type: ADD_COLUMN_RIGHT,
36133
+ column
36119
36134
  };
36120
36135
  }
36121
- function deleteRow() {
36136
+ function deleteRow(row) {
36122
36137
  return {
36123
- type: DELETE_ROW
36138
+ type: DELETE_ROW,
36139
+ row
36124
36140
  };
36125
36141
  }
36126
- function deleteColumn() {
36142
+ function deleteColumn(column) {
36127
36143
  return {
36128
- type: DELETE_COLUMN
36144
+ type: DELETE_COLUMN,
36145
+ column
36129
36146
  };
36130
36147
  }
36131
36148
  function keyPress(event) {
@@ -38215,18 +38232,21 @@ function reducer(state, action) {
38215
38232
  selectedColumn,
38216
38233
  model
38217
38234
  } = state;
38218
- if (checkEmpty(selectedRow)) {
38235
+ const {
38236
+ row
38237
+ } = action;
38238
+ if (checkEmpty(row ?? selectedRow)) {
38219
38239
  return state;
38220
38240
  }
38221
- selectedRow = selectedRow;
38241
+ selectedRow = row ?? selectedRow;
38222
38242
  let updatedData = [...model.data];
38223
38243
  const newRow = Array(updatedData[0]?.length || 0).fill(EmptyCell);
38224
- updatedData.splice(selectedRow, 0, newRow);
38244
+ updatedData.splice(row ?? selectedRow, 0, newRow);
38225
38245
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38226
38246
  return {
38227
38247
  ...state,
38228
38248
  model: updatedModel,
38229
- selectedRow: selectedRow,
38249
+ selectedRow: row ?? selectedRow,
38230
38250
  selectedColumn: selectedColumn
38231
38251
  };
38232
38252
  }
@@ -38237,18 +38257,21 @@ function reducer(state, action) {
38237
38257
  selectedColumn,
38238
38258
  model
38239
38259
  } = state;
38260
+ const {
38261
+ row
38262
+ } = action;
38240
38263
  if (checkEmpty(selectedRow)) {
38241
38264
  return state;
38242
38265
  }
38243
- selectedRow = selectedRow;
38266
+ selectedRow = row ?? selectedRow;
38244
38267
  let updatedData = [...model.data];
38245
38268
  const newRow = Array(updatedData[0]?.length || 0).fill(EmptyCell);
38246
- updatedData.splice(selectedRow + 1, 0, newRow);
38269
+ updatedData.splice((row ?? selectedRow) + 1, 0, newRow);
38247
38270
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38248
38271
  return {
38249
38272
  ...state,
38250
38273
  model: updatedModel,
38251
- selectedRow: selectedRow + 1,
38274
+ selectedRow: (row ?? selectedRow) + 1,
38252
38275
  selectedColumn: selectedColumn
38253
38276
  };
38254
38277
  }
@@ -38259,20 +38282,23 @@ function reducer(state, action) {
38259
38282
  selectedColumn,
38260
38283
  model
38261
38284
  } = state;
38262
- if (checkEmpty(selectedColumn)) {
38285
+ const {
38286
+ column
38287
+ } = action;
38288
+ if (checkEmpty(column ?? selectedColumn)) {
38263
38289
  return state;
38264
38290
  }
38265
- selectedColumn = selectedColumn;
38291
+ selectedColumn = column ?? selectedColumn;
38266
38292
  let updatedData = [...model.data];
38267
38293
  updatedData = updatedData.map(row => {
38268
- return [...row.slice(0, selectedColumn), EmptyCell, ...row.slice(selectedColumn)];
38294
+ return [...row.slice(0, column ?? selectedColumn), EmptyCell, ...row.slice(column ?? selectedColumn)];
38269
38295
  });
38270
38296
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38271
38297
  return {
38272
38298
  ...state,
38273
38299
  model: updatedModel,
38274
38300
  selectedRow: selectedRow,
38275
- selectedColumn: selectedColumn - 1
38301
+ selectedColumn: (column ?? selectedColumn) - 1
38276
38302
  };
38277
38303
  }
38278
38304
  case ADD_COLUMN_RIGHT:
@@ -38282,20 +38308,23 @@ function reducer(state, action) {
38282
38308
  selectedColumn,
38283
38309
  model
38284
38310
  } = state;
38285
- if (checkEmpty(selectedColumn)) {
38311
+ const {
38312
+ column
38313
+ } = action;
38314
+ if (checkEmpty(column ?? selectedColumn)) {
38286
38315
  return state;
38287
38316
  }
38288
- selectedColumn = selectedColumn;
38317
+ selectedColumn = column ?? selectedColumn;
38289
38318
  let updatedData = [...model.data];
38290
38319
  updatedData = updatedData.map(row => {
38291
- 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)];
38292
38321
  });
38293
38322
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38294
38323
  return {
38295
38324
  ...state,
38296
38325
  model: updatedModel,
38297
38326
  selectedRow: selectedRow,
38298
- selectedColumn: selectedColumn + 1
38327
+ selectedColumn: (column ?? selectedColumn) + 1
38299
38328
  };
38300
38329
  }
38301
38330
  case DELETE_ROW:
@@ -38305,14 +38334,17 @@ function reducer(state, action) {
38305
38334
  selectedColumn,
38306
38335
  model
38307
38336
  } = state;
38337
+ const {
38338
+ row
38339
+ } = action;
38308
38340
  if (checkEmpty(selectedRow)) {
38309
38341
  return state;
38310
38342
  }
38311
- selectedRow = selectedRow;
38343
+ selectedRow = row ?? selectedRow;
38312
38344
  let updatedData = [...model.data];
38313
- updatedData.splice(selectedRow, 1);
38345
+ updatedData.splice(row ?? selectedRow, 1);
38314
38346
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38315
- let newSelectedRow = selectedRow > 0 ? selectedRow - 1 : 0;
38347
+ let newSelectedRow = row ?? selectedRow > 0 ? row ?? selectedRow - 1 : 0;
38316
38348
  const newSelectedColumn = selectedColumn !== null ? selectedColumn : 0;
38317
38349
  const newActive = updatedData.length > 0 ? {
38318
38350
  row: newSelectedRow,
@@ -38320,7 +38352,7 @@ function reducer(state, action) {
38320
38352
  } : null;
38321
38353
  const newSelected = updatedData.length > 0 ? new EntireRowsSelection(newSelectedRow, newSelectedRow) : new EmptySelection();
38322
38354
  const {
38323
- [selectedRow]: _,
38355
+ [row ?? selectedRow]: _,
38324
38356
  ...cleanedRowDimensions
38325
38357
  } = state.rowDimensions;
38326
38358
  return {
@@ -38340,8 +38372,11 @@ function reducer(state, action) {
38340
38372
  selectedColumn,
38341
38373
  model
38342
38374
  } = state;
38343
- if (checkEmpty(selectedColumn)) return state;
38344
- const colIndex = selectedColumn;
38375
+ const {
38376
+ column
38377
+ } = action;
38378
+ if (checkEmpty(column ?? selectedColumn)) return state;
38379
+ const colIndex = column ?? selectedColumn;
38345
38380
  const updatedData = model.data.map(row => row.filter((_, cellIndex) => cellIndex !== colIndex));
38346
38381
  const updatedModel = new Model(model.createFormulaParser, updatedData);
38347
38382
  const newSelectedRow = selectedRow || 0;
@@ -40311,7 +40346,8 @@ const ColumnIndicator = ({
40311
40346
  cell,
40312
40347
  selectedColumn,
40313
40348
  minimumColumnWidth,
40314
- maxColLimit
40349
+ maxColLimit,
40350
+ disableDeleteOption
40315
40351
  }) => {
40316
40352
  const dispatch = useDispatch();
40317
40353
  const minColumnWidth = minimumColumnWidth;
@@ -40325,7 +40361,7 @@ const ColumnIndicator = ({
40325
40361
  label: 'Add Column Left',
40326
40362
  value: 'Add Column Left',
40327
40363
  iconName: 'plus_icon',
40328
- action: addColumnLeft,
40364
+ action: () => addColumnLeft(column),
40329
40365
  disableTooltip: 'Column limit reached',
40330
40366
  visible: cell?.contextDisable?.['Add Column Left'] ?? false,
40331
40367
  disable: columnCount >= maxColLimit
@@ -40333,19 +40369,19 @@ const ColumnIndicator = ({
40333
40369
  label: 'Add Column Right',
40334
40370
  value: 'Add Column Right',
40335
40371
  iconName: 'plus_icon',
40336
- action: addColumnRight,
40372
+ action: () => addColumnRight(column),
40337
40373
  disableTooltip: 'Column limit reached',
40338
40374
  visible: cell?.contextDisable?.['Add Column Right'] ?? false,
40339
40375
  disable: columnCount >= maxColLimit
40340
- }, {
40376
+ }, ...(!disableDeleteOption ? [{
40341
40377
  label: 'Delete Column',
40342
40378
  value: 'Delete Column',
40343
40379
  iconName: 'delete',
40344
- action: deleteColumn,
40345
- disableTooltip: 'Column limit reached',
40380
+ action: () => deleteColumn(column),
40381
+ disableTooltip: '',
40346
40382
  visible: cell?.contextDisable?.['Delete Column'] ?? false,
40347
40383
  disable: false
40348
- }];
40384
+ }] : [])];
40349
40385
  }, [selectedColumn, cell, addColumnLeft, addColumnRight, deleteColumn]);
40350
40386
  const onMouseDrag = React__namespace.useCallback((event, isRight) => {
40351
40387
  const getTargetColumn = isRight ? column - 1 : column;
@@ -40375,17 +40411,10 @@ const ColumnIndicator = ({
40375
40411
  onSelect(column, event.shiftKey);
40376
40412
  setContextMenu({
40377
40413
  open: columnContextEnable,
40414
+ contextType: 'column',
40378
40415
  options
40379
40416
  });
40380
40417
  }, [column, selectedColumn, columnContextEnable, options]);
40381
- React__namespace.useEffect(() => {
40382
- if (selectedColumn !== undefined) {
40383
- setContextMenu(prev => ({
40384
- open: prev.open,
40385
- options
40386
- }));
40387
- }
40388
- }, [column, selectedColumn, columnContextEnable, options]);
40389
40418
  return jsxRuntime.jsxs("th", {
40390
40419
  className: classNames('ff-spreadsheet-header', {
40391
40420
  'ff-spreadsheet-header--selected': selected
@@ -40457,7 +40486,8 @@ const RowIndicator = ({
40457
40486
  rowContextEnable,
40458
40487
  selectedRow,
40459
40488
  cell,
40460
- maxRowLimit
40489
+ maxRowLimit,
40490
+ disableDeleteOption
40461
40491
  }) => {
40462
40492
  const dispatch = useDispatch();
40463
40493
  const rowHeight = useSelector(state => state.rowDimensions[row]?.height || 32);
@@ -40470,7 +40500,7 @@ const RowIndicator = ({
40470
40500
  label: 'Add Row Top',
40471
40501
  value: 'Add Row Top',
40472
40502
  iconName: 'plus_icon',
40473
- action: addRowTop,
40503
+ action: () => addRowTop(row),
40474
40504
  disableTooltip: 'Row limit reached',
40475
40505
  visible: cell?.contextDisable?.['Add Row Top'] ?? false,
40476
40506
  disable: rowCount >= maxRowLimit
@@ -40478,20 +40508,20 @@ const RowIndicator = ({
40478
40508
  label: 'Add Row Bottom',
40479
40509
  value: 'Add Row Bottom',
40480
40510
  iconName: 'plus_icon',
40481
- action: addRowBottom,
40511
+ action: () => addRowBottom(row),
40482
40512
  disableTooltip: 'Row limit reached',
40483
40513
  visible: cell?.contextDisable?.['Add Row Bottom'] ?? false,
40484
40514
  disable: rowCount >= maxRowLimit
40485
- }, {
40515
+ }, ...(!disableDeleteOption ? [{
40486
40516
  label: 'Delete Row',
40487
40517
  value: 'Delete Row',
40488
40518
  iconName: 'delete',
40489
- action: deleteRow,
40490
- disableTooltip: 'Row limit reached',
40519
+ action: () => deleteRow(row),
40520
+ disableTooltip: '',
40491
40521
  visible: cell?.contextDisable?.['Delete Row'] ?? false,
40492
40522
  disable: false
40493
- }];
40494
- }, [selectedRow]);
40523
+ }] : [])];
40524
+ }, [selectedRow, row]);
40495
40525
  const handleMouseDrag = React__namespace.useCallback((event, isUp) => {
40496
40526
  const getTargetRow = isUp ? row : row - 1;
40497
40527
  const targetRow = Math.max(getTargetRow, 0);
@@ -40520,17 +40550,10 @@ const RowIndicator = ({
40520
40550
  onSelect(row, event.shiftKey);
40521
40551
  setContextMenu({
40522
40552
  open: rowContextEnable,
40553
+ contextType: 'row',
40523
40554
  options
40524
40555
  });
40525
40556
  }, [row, rowContextEnable, options, selectedRow]);
40526
- React__namespace.useEffect(() => {
40527
- if (selectedRow !== undefined) {
40528
- setContextMenu(prev => ({
40529
- open: prev.open,
40530
- options
40531
- }));
40532
- }
40533
- }, [row, rowContextEnable, options, selectedRow]);
40534
40557
  return jsxRuntime.jsxs("th", {
40535
40558
  className: classNames('ff-spreadsheet-header', {
40536
40559
  'ff-spreadsheet-header--selected': selected
@@ -41161,6 +41184,7 @@ const ActiveCell = props => {
41161
41184
  event.preventDefault();
41162
41185
  props.setContextMenu({
41163
41186
  open: props.contextOption?.open ?? false,
41187
+ contextType: props.contextOption?.contextType ?? null,
41164
41188
  options: props.contextOption?.options || []
41165
41189
  });
41166
41190
  }, [props]);
@@ -41831,7 +41855,8 @@ const Spreadsheet = props => {
41831
41855
  setContextMenu,
41832
41856
  showHider,
41833
41857
  maxRowLimit,
41834
- maxColLimit
41858
+ maxColLimit,
41859
+ disableDeleteOption
41835
41860
  } = props;
41836
41861
  const [sheetChange, setSheetChange] = React__namespace.useState(false);
41837
41862
  const [maxWidth, setMaxWidth] = React__namespace.useState(0);
@@ -42111,19 +42136,24 @@ const Spreadsheet = props => {
42111
42136
  const dynamicScroll = scrollHeight - offsetHeight;
42112
42137
  if (size.rows < 100) {
42113
42138
  updateVisibleRange(0, size.rows, 0);
42139
+ setScrollCount(0);
42114
42140
  } else if (scrollTop === 0 && scrollCount !== 0) {
42115
42141
  const newScroll = scrollCount - 1;
42116
42142
  updateVisibleRange(newScroll * rowHeight, newScroll * rowHeight + visibleRows, newScroll);
42143
+ setScrollCount(newScroll);
42117
42144
  } else if (scrollTop > dynamicScroll - 30 && scrollCount < totalScroll - 1) {
42118
42145
  const newScroll = scrollCount + 1;
42119
42146
  updateVisibleRange(newScroll * rowHeight, newScroll * rowHeight + visibleRows, newScroll);
42147
+ setScrollCount(newScroll);
42120
42148
  } else if (scrollTop > dynamicScroll - 30 && scrollCount < totalScroll) {
42121
42149
  updateVisibleRange((scrollCount + 1) * rowHeight, size.rows, scrollCount + 1);
42150
+ setScrollCount(scrollCount + 1);
42122
42151
  }
42123
42152
  setRenderReady(true);
42124
42153
  });
42125
42154
  setContextMenu({
42126
42155
  open: false,
42156
+ contextType: null,
42127
42157
  options: [{
42128
42158
  label: '',
42129
42159
  value: '',
@@ -42156,7 +42186,8 @@ const Spreadsheet = props => {
42156
42186
  addColumnLeft: addColumnLeft$1,
42157
42187
  addColumnRight: addColumnRight$1,
42158
42188
  columnContextEnable: props.columnContextEnable,
42159
- maxColLimit: maxColLimit
42189
+ maxColLimit: maxColLimit,
42190
+ disableDeleteOption: disableDeleteOption
42160
42191
  }, columnNumber) : jsxRuntime.jsx(ColumnIndicator, {
42161
42192
  column: columnNumber,
42162
42193
  minimumColumnWidth: minimumColumnWidth,
@@ -42165,7 +42196,8 @@ const Spreadsheet = props => {
42165
42196
  addColumnLeft: addColumnLeft$1,
42166
42197
  addColumnRight: addColumnRight$1,
42167
42198
  columnContextEnable: props.columnContextEnable,
42168
- maxColLimit: maxColLimit
42199
+ maxColLimit: maxColLimit,
42200
+ disableDeleteOption: disableDeleteOption
42169
42201
  }, columnNumber))]
42170
42202
  }), renderReady && scrollerFunction().map(rowNumber => jsxRuntime.jsxs(Row$1, {
42171
42203
  row: rowNumber,
@@ -42177,7 +42209,8 @@ const Spreadsheet = props => {
42177
42209
  deleteRow: deleteRow$1,
42178
42210
  setContextMenu: props.setContextMenu,
42179
42211
  rowContextEnable: props.rowContextEnable,
42180
- maxRowLimit: maxRowLimit
42212
+ maxRowLimit: maxRowLimit,
42213
+ disableDeleteOption: disableDeleteOption
42181
42214
  }, rowNumber) : jsxRuntime.jsx(RowIndicator$1, {
42182
42215
  row: rowNumber,
42183
42216
  addRowTop: addRowTop$1,
@@ -42185,7 +42218,8 @@ const Spreadsheet = props => {
42185
42218
  deleteRow: deleteRow$1,
42186
42219
  setContextMenu: props.setContextMenu,
42187
42220
  rowContextEnable: props.rowContextEnable,
42188
- maxRowLimit: maxRowLimit
42221
+ maxRowLimit: maxRowLimit,
42222
+ disableDeleteOption: disableDeleteOption
42189
42223
  }, rowNumber), range(size.columns).map(columnNumber => jsxRuntime.jsx(Cell$1, {
42190
42224
  row: rowNumber,
42191
42225
  column: columnNumber,
@@ -42249,6 +42283,7 @@ const Spreadsheet = props => {
42249
42283
  scrollOption && throttledHandleScroll(e);
42250
42284
  setContextMenu({
42251
42285
  open: false,
42286
+ contextType: null,
42252
42287
  options: [{
42253
42288
  label: '',
42254
42289
  value: '',
@@ -42272,15 +42307,12 @@ const Spreadsheet = props => {
42272
42307
  const ExcelContextMenu = ({
42273
42308
  contextMenu,
42274
42309
  position,
42275
- editable,
42276
- disableDeleteOption
42310
+ editable
42277
42311
  }) => {
42312
+ if (!contextMenu.open) return null;
42278
42313
  const checkDelete = label => {
42279
42314
  return label.includes('Delete');
42280
42315
  };
42281
- const isOptionDisabled = option => {
42282
- return option.disable || checkDelete(option.label) && disableDeleteOption;
42283
- };
42284
42316
  return editable && jsxRuntime.jsx("div", {
42285
42317
  onContextMenu: event => {
42286
42318
  event.preventDefault();
@@ -42295,7 +42327,7 @@ const ExcelContextMenu = ({
42295
42327
  },
42296
42328
  children: contextMenu.options.map(option => {
42297
42329
  if (!option.visible) {
42298
- const disabled = isOptionDisabled(option);
42330
+ const disabled = option.disable;
42299
42331
  return jsxRuntime.jsx(Tooltip, {
42300
42332
  title: disabled ? option.disableTooltip : '',
42301
42333
  children: jsxRuntime.jsxs("div", {
@@ -42375,6 +42407,7 @@ const ExcelFile = ({
42375
42407
  const [saveInfo, setSaveInfo] = React.useState('');
42376
42408
  const [contextMenu, setContextMenu] = React.useState({
42377
42409
  open: false,
42410
+ contextType: null,
42378
42411
  options: [{
42379
42412
  label: '',
42380
42413
  value: '',
@@ -42687,28 +42720,34 @@ const ExcelFile = ({
42687
42720
  selection?.removeAllRanges();
42688
42721
  selection?.addRange(range);
42689
42722
  };
42690
- const handleClickOutside = React.useCallback(event => {
42691
- if (contextMenu.open) {
42692
- event.preventDefault();
42693
- event.stopPropagation();
42694
- setContextMenu({
42695
- open: false,
42696
- options: [{
42697
- label: '',
42698
- value: '',
42699
- iconName: '',
42700
- action: () => {},
42701
- disableTooltip: '',
42702
- visible: false,
42703
- disable: false
42704
- }]
42705
- });
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
+ }
42706
42743
  }
42707
42744
  }, [contextMenu.open]);
42708
42745
  React.useEffect(() => {
42709
- document.addEventListener('click', handleClickOutside);
42746
+ document.addEventListener('contextmenu', handleClickOutside);
42747
+ document.addEventListener('click', e => handleClickOutside(e, true));
42710
42748
  return () => {
42711
- document.removeEventListener('click', handleClickOutside);
42749
+ document.removeEventListener('contextmenu', handleClickOutside);
42750
+ document.addEventListener('click', e => handleClickOutside(e, true));
42712
42751
  };
42713
42752
  }, [handleClickOutside]);
42714
42753
  const contextClick = (event, name, index) => {
@@ -42717,27 +42756,24 @@ const ExcelFile = ({
42717
42756
  label: 'Add Sheet',
42718
42757
  value: 'Add Sheet',
42719
42758
  iconName: 'plus_icon',
42720
- action: () => {
42721
- handleAddSheet();
42722
- },
42759
+ action: () => handleAddSheet(),
42723
42760
  disableTooltip: 'Sheet limit reached',
42724
42761
  visible: false,
42725
42762
  disable: addSheetIconDisable()
42726
- }, {
42763
+ }, ...(!disableDeleteOption ? [{
42727
42764
  label: 'Delete Sheet',
42728
42765
  value: 'Delete Sheet',
42729
42766
  iconName: 'delete',
42730
- action: () => {
42731
- handleDeleteSheet(name, index);
42732
- },
42767
+ action: () => handleDeleteSheet(name, index),
42733
42768
  disableTooltip: '',
42734
42769
  visible: false,
42735
42770
  disable: false
42736
- }];
42771
+ }] : [])];
42737
42772
  setContextMenu(prev => ({
42738
42773
  ...prev,
42739
42774
  open: true,
42740
- options: options
42775
+ contextType: 'sheet',
42776
+ options
42741
42777
  }));
42742
42778
  };
42743
42779
  const setContextPosition = event => {
@@ -42770,7 +42806,7 @@ const ExcelFile = ({
42770
42806
  if (event.target.classList.contains('ff-excel-tab-list')) {
42771
42807
  setPosition({
42772
42808
  x: sheetRefX,
42773
- y: sheetRefY - 65
42809
+ y: sheetRefY - (disableDeleteOption ? 32 : 65)
42774
42810
  });
42775
42811
  return;
42776
42812
  }
@@ -42791,6 +42827,7 @@ const ExcelFile = ({
42791
42827
  if (contextMenu.open) {
42792
42828
  setContextMenu({
42793
42829
  open: false,
42830
+ contextType: null,
42794
42831
  options: [{
42795
42832
  label: '',
42796
42833
  value: '',
@@ -42828,7 +42865,8 @@ const ExcelFile = ({
42828
42865
  scroller: scroller,
42829
42866
  showHider: showHider,
42830
42867
  maxRowLimit: maxRowLimit,
42831
- maxColLimit: maxColLimit
42868
+ maxColLimit: maxColLimit,
42869
+ disableDeleteOption: disableDeleteOption
42832
42870
  })
42833
42871
  }), sheetBar !== 'hide' && jsxRuntime.jsxs("div", {
42834
42872
  className: "ff-excel-sheet-bar",
@@ -42890,8 +42928,7 @@ const ExcelFile = ({
42890
42928
  }), contextMenu.open && jsxRuntime.jsx(ExcelContextMenu, {
42891
42929
  contextMenu: contextMenu,
42892
42930
  position: position,
42893
- editable: editable,
42894
- disableDeleteOption: disableDeleteOption
42931
+ editable: editable
42895
42932
  }), jsxRuntime.jsx(Toastify, {})]
42896
42933
  })
42897
42934
  });
@@ -46432,7 +46469,7 @@ const VariableDropdown = ({
46432
46469
  if (!option) return '';
46433
46470
  const variableId = option._id || option.id;
46434
46471
  if (variableId?.startsWith('PARAMETER')) return 'step_group_parameter';
46435
- 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';
46436
46473
  if (option.type === '_startforloop') return 'for_loop_variable';
46437
46474
  if (option.type === 'DATAPROVIDER') return 'data_provider_variable';
46438
46475
  return VARIABLE_ICON_MAP[option.type || ''] || '';
@@ -46535,6 +46572,31 @@ const LineChart = ({
46535
46572
  const xMax = width - margin * 2;
46536
46573
  const yMax = height - margin * 2;
46537
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
+ }, []);
46538
46600
  const hasData = data && data.length > 0 && data?.some(line => Array.isArray(line?.data) && line?.data?.length > 0);
46539
46601
  if (!hasData) {
46540
46602
  const defaultDates = [];
@@ -46800,31 +46862,6 @@ const LineChart = ({
46800
46862
  });
46801
46863
  }
46802
46864
  };
46803
- const [hoverState, setHoverState] = React.useState({
46804
- cursorX: null,
46805
- hoverValues: {},
46806
- dotPositions: {},
46807
- tooltip: {
46808
- visible: false,
46809
- left: 0,
46810
- top: 0
46811
- },
46812
- currentXValue: null
46813
- });
46814
- React.useEffect(() => {
46815
- const handleScroll = () => {
46816
- setTooltipVisible(false);
46817
- setHoverState(prev => ({
46818
- ...prev,
46819
- tooltip: {
46820
- ...prev.tooltip,
46821
- visible: false
46822
- }
46823
- }));
46824
- };
46825
- window.addEventListener('scroll', handleScroll, true);
46826
- return () => window.removeEventListener('scroll', handleScroll, true);
46827
- }, []);
46828
46865
  const handleMouseMove = e => {
46829
46866
  const svgRect = e.currentTarget.getBoundingClientRect();
46830
46867
  const mouseX = e.clientX - svgRect.left - margin;
@@ -78410,15 +78447,20 @@ const appendNewRow = (tableData, AddNlp) => {
78410
78447
  return updatedTreeData;
78411
78448
  };
78412
78449
 
78413
- const scrollToView = id => {
78414
- if (id) {
78415
- const element = document.getElementById(id);
78416
- if (element) {
78417
- element.scrollIntoView({
78418
- behavior: 'smooth',
78419
- block: 'nearest'
78420
- });
78421
- }
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.`);
78422
78464
  }
78423
78465
  };
78424
78466
 
@@ -78676,84 +78718,107 @@ const StepGroupAccordions = /*#__PURE__*/React.memo(({
78676
78718
  handleStepGroupExpand,
78677
78719
  isStepGroupExpanded,
78678
78720
  isViewPrivilegeMode,
78679
- columns = []
78721
+ columns = [],
78722
+ parentIndex,
78723
+ updateRowHeight
78680
78724
  }) => {
78725
+ const rowRefs = React.useRef([]);
78681
78726
  const typeSet = new Set(['Group', 'PRE', 'POST', 'Script']);
78682
78727
  const getPadding = type => typeSet.has(type) ? '6px 8px' : '7px 8px';
78683
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]);
78684
78742
  return jsxRuntime.jsx(jsxRuntime.Fragment, {
78685
- children: data?.map(item => jsxRuntime.jsxs(React.Fragment, {
78686
- children: [viewModeId === item?.stepId ? jsxRuntime.jsx("tr", {
78687
- className: "steps-edit-row",
78688
- id: "getInFocus",
78689
- children: jsxRuntime.jsx("td", {
78690
- colSpan: columnCount,
78691
- children: jsxRuntime.jsx("div", {
78692
- style: {
78693
- marginLeft: `${indent}px`
78694
- },
78695
- children: ViewComponent && jsxRuntime.jsx(ViewComponent, {})
78696
- })
78697
- })
78698
- }) : jsxRuntime.jsx("tr", {
78699
- children: columns.map((col, idx) => jsxRuntime.jsx("td", {
78700
- style: {
78701
- maxWidth: col.width,
78702
- padding: getPadding(item.type)
78703
- },
78704
- children: jsxRuntime.jsxs(Typography, {
78705
- as: "div",
78706
- className: "ff-data-checkbox-container",
78707
- children: [jsxRuntime.jsxs("div", {
78708
- 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", {
78709
78753
  style: {
78710
- marginLeft: idx === 0 ? `${indent}px` : 0
78711
- },
78712
- onClick: () => {
78713
- const isClickable = idx === 0 && !item?.displayName?.includes('End') && !item?.isDisabled;
78714
- if (isClickable) handleClick?.({
78715
- ...item,
78716
- tableType
78717
- });
78754
+ marginLeft: `${indent}px`
78718
78755
  },
78719
- 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",
78720
78771
  style: {
78721
- padding: '4px 18px'
78722
- }
78723
- }), prepareData({
78724
- ...item,
78725
- marginLeft: indent
78726
- }, col)]
78727
- }), idx === 0 && ['Group', 'PRE', 'POST', 'Script'].includes(item.type) && jsxRuntime.jsx("div", {
78728
- className: `ff-accordion-arrow ${isStepGroupExpanded?.(item.stepId) ? 'expanded' : ''}`,
78729
- children: jsxRuntime.jsx(Icon, {
78730
- name: "arrow_right",
78731
- color: isStepGroupExpanded?.(item.stepId) ? 'var(--brand-color)' : 'var(--default-color)',
78732
- className: "steps-arrow-svg",
78733
- width: 12,
78734
- height: 12,
78735
- 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({
78736
78786
  ...item,
78737
- 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
+ })
78738
78801
  })
78739
- })
78740
- })]
78741
- })
78742
- }, `${item.stepId}-${idx}`))
78743
- }), isStepGroupExpanded?.(item.stepId) && jsxRuntime.jsx(StepGroupAccordions, {
78744
- data: item.data,
78745
- level: indent,
78746
- columnCount: columnCount,
78747
- viewModeId: viewModeId,
78748
- ViewComponent: ViewComponent,
78749
- handleClick: handleClick,
78750
- tableType: tableType,
78751
- handleStepGroupExpand: handleStepGroupExpand,
78752
- isStepGroupExpanded: isStepGroupExpanded,
78753
- isViewPrivilegeMode: isViewPrivilegeMode,
78754
- columns: columns
78755
- })]
78756
- }, 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
+ })
78757
78822
  });
78758
78823
  });
78759
78824
  StepGroupAccordions.displayName = 'StepGroupAccordions';
@@ -78778,8 +78843,10 @@ const StepTableMainRow = ({
78778
78843
  dataLength,
78779
78844
  stepPartialSelect,
78780
78845
  isViewPrivilegeMode,
78781
- isClientSide
78846
+ isClientSide,
78847
+ updateRowHeight
78782
78848
  }) => {
78849
+ const rowRef = React.useRef(null);
78783
78850
  const isDisabled = React.useMemo(() => row?.isDisabled || (dataLength ?? 0) <= 1 || row.isSpecialNlp, [row, dataLength]);
78784
78851
  let serialNumber = (indexNumber + 1).toString();
78785
78852
  const {
@@ -78797,6 +78864,13 @@ const StepTableMainRow = ({
78797
78864
  transition
78798
78865
  }), [transform, transition]);
78799
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)]);
78800
78874
  const getPadding = index => {
78801
78875
  if (isViewPrivilegeMode || isClientSide) {
78802
78876
  if (['Group', 'PRE', 'POST', 'Script'].includes(row.type) && index === 0) {
@@ -78847,7 +78921,10 @@ const StepTableMainRow = ({
78847
78921
  });
78848
78922
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
78849
78923
  children: [jsxRuntime.jsx("tr", {
78850
- ref: setNodeRef,
78924
+ ref: el => {
78925
+ rowRef.current = el;
78926
+ setNodeRef(el);
78927
+ },
78851
78928
  style: style,
78852
78929
  className: classNames(tableBodyRowClass, {
78853
78930
  'disabled-inner-row': isDisabled
@@ -78891,7 +78968,9 @@ const StepTableMainRow = ({
78891
78968
  isStepGroupExpanded: isStepGroupExpanded,
78892
78969
  level: row?.marginLeft,
78893
78970
  isViewPrivilegeMode: isViewPrivilegeMode,
78894
- columns: columns
78971
+ columns: columns,
78972
+ parentIndex: indexNumber,
78973
+ updateRowHeight: updateRowHeight
78895
78974
  })]
78896
78975
  });
78897
78976
  };
@@ -78931,11 +79010,132 @@ const StepInnerTable = ({
78931
79010
  isClientSide
78932
79011
  }) => {
78933
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
78934
79021
  React.useEffect(() => {
78935
- 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;
78936
79137
  const firstNode = document.getElementById('ff-table-first-node');
78937
79138
  const lastNode = document.getElementById('ff-table-last-node');
78938
- // Exit early if data is empty or elements are missing
78939
79139
  if (!scrollContainer || !firstNode || !lastNode || !data?.length) {
78940
79140
  return;
78941
79141
  }
@@ -78954,7 +79154,6 @@ const StepInnerTable = ({
78954
79154
  observerRef.current.observe(firstNode);
78955
79155
  observerRef.current.observe(lastNode);
78956
79156
  return () => {
78957
- // Cleanup observer
78958
79157
  observerRef.current?.disconnect();
78959
79158
  };
78960
79159
  }, [data, loadMore]);
@@ -78992,15 +79191,18 @@ const StepInnerTable = ({
78992
79191
  items: data?.map(row => row._id || row.stepId),
78993
79192
  strategy: verticalListSortingStrategy,
78994
79193
  children: jsxRuntime.jsxs("div", {
79194
+ ref: containerRef,
78995
79195
  style: {
78996
79196
  height: height,
78997
- position: 'relative'
79197
+ position: 'relative',
79198
+ overflow: 'auto'
78998
79199
  },
78999
79200
  id: "ff-table-scroll-container",
79000
79201
  className: classNames(className, {
79001
79202
  'ff-fixed-header-steps-table': withFixedHeader,
79002
79203
  'steps-border-borderRadius': borderWithRadius
79003
79204
  }),
79205
+ onScroll: handleScroll,
79004
79206
  children: [jsxRuntime.jsxs("table", {
79005
79207
  className: classNames(`ff-table-steps`),
79006
79208
  cellSpacing: 0,
@@ -79017,30 +79219,43 @@ const StepInnerTable = ({
79017
79219
  }), jsxRuntime.jsxs("tbody", {
79018
79220
  className: "ff-steps-tbody",
79019
79221
  children: [jsxRuntime.jsx("tr", {
79020
- id: "ff-table-first-node"
79021
- }), 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;
79022
79236
  const isEdit = editMode === row.stepId;
79023
79237
  const isEditOrNew = isEdit || row.isNew;
79238
+ const isFocusRow = isEdit && row.stepId === focusRowId || row.isNew && focusRowId === 'new-row';
79024
79239
  const renderEditableRow = () => jsxRuntime.jsxs("tr", {
79025
79240
  className: "steps-edit-row",
79026
- id: "getInFocus",
79241
+ id: isFocusRow ? 'getInFocus' : undefined,
79027
79242
  children: [isEdit && /*#__PURE__*/React.isValidElement(editComponent) && jsxRuntime.jsx("td", {
79028
79243
  colSpan: columns.length,
79029
79244
  children: /*#__PURE__*/React.cloneElement(editComponent, {
79030
79245
  rowData: row,
79031
- rowIndex: index + 1
79246
+ rowIndex: absoluteIndex + 1
79032
79247
  })
79033
79248
  }), row.isNew && !isEdit && /*#__PURE__*/React.isValidElement(NlpComponent) && jsxRuntime.jsx("td", {
79034
79249
  colSpan: columns.length,
79035
79250
  children: /*#__PURE__*/React.cloneElement(NlpComponent, {
79036
- rowIndex: index,
79251
+ rowIndex: absoluteIndex,
79037
79252
  rowData: row
79038
79253
  })
79039
79254
  })]
79040
- }, row.stepId || index);
79255
+ }, row.stepId || absoluteIndex);
79041
79256
  const renderSortableRow = () => jsxRuntime.jsx(StepTableMainRow$1, {
79042
79257
  row: row,
79043
- indexNumber: index,
79258
+ indexNumber: absoluteIndex,
79044
79259
  columns: columns,
79045
79260
  tableBodyRowClass: tableBodyRowClass,
79046
79261
  handleOnclick: handleOnclick,
@@ -79058,11 +79273,23 @@ const StepInnerTable = ({
79058
79273
  dataLength: data?.length,
79059
79274
  stepPartialSelect: stepPartialSelect,
79060
79275
  isViewPrivilegeMode: isViewPrivilegeMode,
79061
- isClientSide: isClientSide
79276
+ isClientSide: isClientSide,
79277
+ updateRowHeight: updateRowHeight
79062
79278
  });
79063
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
+ })
79064
79288
  }), jsxRuntime.jsx("tr", {
79065
- id: "ff-table-last-node"
79289
+ id: "ff-table-last-node",
79290
+ style: {
79291
+ display: 'none'
79292
+ }
79066
79293
  })]
79067
79294
  })]
79068
79295
  }), data?.length <= 0 && jsxRuntime.jsx("div", {
@@ -79788,7 +80015,6 @@ const StepLandingTable = /*#__PURE__*/React.forwardRef(({
79788
80015
  }
79789
80016
  }));
79790
80017
  React.useEffect(() => {
79791
- scrollToView('getInFocus');
79792
80018
  if (!checkEmpty(AddNlp)) {
79793
80019
  setViewComponent(() => null);
79794
80020
  setViewModeId(null);