abdul-react 0.0.31 → 0.0.33
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.
- package/lib/_virtual/index10.js +2 -2
- package/lib/_virtual/index11.js +2 -2
- package/lib/_virtual/index9.js +2 -2
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.d.ts +9 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js +7 -21
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js +2 -2
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Copied.d.ts +2 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Copied.js +5 -4
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Copied.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Selected.d.ts +2 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Selected.js +5 -4
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Selected.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js +118 -142
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +12 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.d.ts +23 -3
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.js +46 -82
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.js.map +1 -1
- package/lib/index.cjs +186 -258
- package/lib/index.cjs.map +1 -1
- package/lib/node_modules/js-beautify/js/src/css/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/css/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/css/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/options.js +1 -1
- package/package.json +2 -2
package/lib/index.cjs
CHANGED
|
@@ -11932,7 +11932,7 @@ const getColumnLeftPosition = (index, columns, freezeColumns) => {
|
|
|
11932
11932
|
for (let i = 0; i < index; i++) {
|
|
11933
11933
|
const width = columns[i]?.width;
|
|
11934
11934
|
// Add column width plus left padding only
|
|
11935
|
-
leftPosition += width ? parseInt(width.toString(), 10) : DEFAULT_COLUMN_WIDTH;
|
|
11935
|
+
leftPosition += width ? parseInt(width.toString(), 10) : DEFAULT_COLUMN_WIDTH$1;
|
|
11936
11936
|
// Add padding between frozen columns
|
|
11937
11937
|
if (freezeColumns && i < freezeColumns - 1) {
|
|
11938
11938
|
leftPosition += CELL_PADDING;
|
|
@@ -11940,9 +11940,9 @@ const getColumnLeftPosition = (index, columns, freezeColumns) => {
|
|
|
11940
11940
|
}
|
|
11941
11941
|
return `${leftPosition}px`;
|
|
11942
11942
|
};
|
|
11943
|
-
const DEFAULT_COLUMN_WIDTH = 400;
|
|
11943
|
+
const DEFAULT_COLUMN_WIDTH$1 = 400;
|
|
11944
11944
|
const calculateFrozenWidth = (columnData, freezeColumns) => {
|
|
11945
|
-
return columnData.slice(0, freezeColumns).reduce((acc, col) => acc + parseInt(col.width?.toString() || `${DEFAULT_COLUMN_WIDTH}`, 10), 1) + 8 * (freezeColumns - 0.17);
|
|
11945
|
+
return columnData.slice(0, freezeColumns).reduce((acc, col) => acc + parseInt(col.width?.toString() || `${DEFAULT_COLUMN_WIDTH$1}`, 10), 1) + 8 * (freezeColumns - 0.17);
|
|
11946
11946
|
};
|
|
11947
11947
|
const SortableRow = ({
|
|
11948
11948
|
row,
|
|
@@ -36952,6 +36952,11 @@ class InvalidIndexError extends Error {
|
|
|
36952
36952
|
|
|
36953
36953
|
const PLAIN_TEXT_MIME = 'text/plain';
|
|
36954
36954
|
const FOCUS_WITHIN_SELECTOR = ':focus-within';
|
|
36955
|
+
/** Constants for defaults */
|
|
36956
|
+
const DEFAULT_ROW_HEIGHT = 32;
|
|
36957
|
+
const DEFAULT_COLUMN_WIDTH = 100;
|
|
36958
|
+
const HEADER_HEIGHT = 32;
|
|
36959
|
+
const ROW_INDICATOR_WIDTH = 60;
|
|
36955
36960
|
/** Move the cursor of given input element to the input's end */
|
|
36956
36961
|
function moveCursorToEnd(el) {
|
|
36957
36962
|
el.selectionStart = el.selectionEnd = el.value.length;
|
|
@@ -37132,22 +37137,38 @@ function deleteColumnDimension(columns, deleteIndex) {
|
|
|
37132
37137
|
}
|
|
37133
37138
|
return updated;
|
|
37134
37139
|
}
|
|
37140
|
+
/** Get the row top position (cumulative) */
|
|
37141
|
+
function getRowTop(row, rowDimensions) {
|
|
37142
|
+
const rowDim = rowDimensions[row];
|
|
37143
|
+
if (rowDim) {
|
|
37144
|
+
return rowDim.top || row * DEFAULT_ROW_HEIGHT;
|
|
37145
|
+
}
|
|
37146
|
+
return row * DEFAULT_ROW_HEIGHT;
|
|
37147
|
+
}
|
|
37148
|
+
/** Get the row height */
|
|
37149
|
+
function getRowHeight(row, rowDimensions) {
|
|
37150
|
+
const rowDim = rowDimensions[row];
|
|
37151
|
+
return rowDim ? rowDim.height || DEFAULT_ROW_HEIGHT : DEFAULT_ROW_HEIGHT;
|
|
37152
|
+
}
|
|
37153
|
+
/** Get the column left position (cumulative) */
|
|
37154
|
+
function getColumnLeft(column, columnDimensions) {
|
|
37155
|
+
const colDim = columnDimensions[column];
|
|
37156
|
+
if (colDim) {
|
|
37157
|
+
return colDim.left || column * DEFAULT_COLUMN_WIDTH;
|
|
37158
|
+
}
|
|
37159
|
+
return column * DEFAULT_COLUMN_WIDTH;
|
|
37160
|
+
}
|
|
37161
|
+
/** Get the column width */
|
|
37162
|
+
function getColumnWidth(column, columnDimensions) {
|
|
37163
|
+
const colDim = columnDimensions[column];
|
|
37164
|
+
return colDim ? colDim.width || DEFAULT_COLUMN_WIDTH : DEFAULT_COLUMN_WIDTH;
|
|
37165
|
+
}
|
|
37135
37166
|
/** Get the dimensions of cell at point from state */
|
|
37136
37167
|
function getCellDimensions(point, rowDimensions, columnDimensions) {
|
|
37137
|
-
const
|
|
37138
|
-
const
|
|
37139
|
-
const
|
|
37140
|
-
const
|
|
37141
|
-
let top = HEADER_HEIGHT;
|
|
37142
|
-
for (let r = 0; r < point.row; r++) {
|
|
37143
|
-
top += (rowDimensions?.[r] ? rowDimensions?.[r]?.height : DEFAULT_ROW_HEIGHT) || DEFAULT_ROW_HEIGHT;
|
|
37144
|
-
}
|
|
37145
|
-
const height = (rowDimensions?.[point.row] ? rowDimensions?.[point.row]?.height : DEFAULT_ROW_HEIGHT) || DEFAULT_ROW_HEIGHT;
|
|
37146
|
-
let left = ROW_INDICATOR_WIDTH;
|
|
37147
|
-
for (let c = 0; c < point.column; c++) {
|
|
37148
|
-
left += (columnDimensions?.[c] ? columnDimensions?.[c]?.width : DEFAULT_COLUMN_WIDTH) || DEFAULT_COLUMN_WIDTH;
|
|
37149
|
-
}
|
|
37150
|
-
const width = (columnDimensions?.[point.column] ? columnDimensions?.[point.column]?.width : DEFAULT_COLUMN_WIDTH) || DEFAULT_COLUMN_WIDTH;
|
|
37168
|
+
const top = HEADER_HEIGHT + getRowTop(point.row, rowDimensions);
|
|
37169
|
+
const height = getRowHeight(point.row, rowDimensions);
|
|
37170
|
+
const left = ROW_INDICATOR_WIDTH + getColumnLeft(point.column, columnDimensions);
|
|
37171
|
+
const width = getColumnWidth(point.column, columnDimensions);
|
|
37151
37172
|
return {
|
|
37152
37173
|
top,
|
|
37153
37174
|
height,
|
|
@@ -37229,63 +37250,6 @@ const EmptyCell = {
|
|
|
37229
37250
|
const fontFamilyList = [{
|
|
37230
37251
|
label: 'Times New Roman',
|
|
37231
37252
|
value: 'Times New Roman'
|
|
37232
|
-
}, {
|
|
37233
|
-
label: 'Arial',
|
|
37234
|
-
value: 'Arial'
|
|
37235
|
-
}, {
|
|
37236
|
-
label: 'fantasy',
|
|
37237
|
-
value: 'fantasy'
|
|
37238
|
-
}, {
|
|
37239
|
-
label: 'cursive',
|
|
37240
|
-
value: 'cursive'
|
|
37241
|
-
}, {
|
|
37242
|
-
label: 'Poppins',
|
|
37243
|
-
value: 'Poppins'
|
|
37244
|
-
}, {
|
|
37245
|
-
label: 'Courier New',
|
|
37246
|
-
value: '"Courier New"'
|
|
37247
|
-
}, {
|
|
37248
|
-
label: 'Verdana',
|
|
37249
|
-
value: 'Verdana'
|
|
37250
|
-
}, {
|
|
37251
|
-
label: 'Tahoma',
|
|
37252
|
-
value: 'Tahoma'
|
|
37253
|
-
}, {
|
|
37254
|
-
label: 'Trebuchet MS',
|
|
37255
|
-
value: 'Trebuchet MS'
|
|
37256
|
-
}, {
|
|
37257
|
-
label: 'Comic Sans MS',
|
|
37258
|
-
value: 'Comic Sans MS'
|
|
37259
|
-
}, {
|
|
37260
|
-
label: 'Impact',
|
|
37261
|
-
value: 'Impact'
|
|
37262
|
-
}, {
|
|
37263
|
-
label: 'Arial Black',
|
|
37264
|
-
value: 'Arial Black'
|
|
37265
|
-
}, {
|
|
37266
|
-
label: 'Lucida Console',
|
|
37267
|
-
value: 'Lucida Console'
|
|
37268
|
-
}, {
|
|
37269
|
-
label: 'Lucida Sans Unicode',
|
|
37270
|
-
value: 'Lucida Sans Unicode'
|
|
37271
|
-
}, {
|
|
37272
|
-
label: 'Courier',
|
|
37273
|
-
value: 'Courier'
|
|
37274
|
-
}, {
|
|
37275
|
-
label: 'Arial Rounded MT Bold',
|
|
37276
|
-
value: 'Arial Rounded MT Bold'
|
|
37277
|
-
}, {
|
|
37278
|
-
label: 'Georgia',
|
|
37279
|
-
value: 'Georgia'
|
|
37280
|
-
}, {
|
|
37281
|
-
label: 'sans-serif',
|
|
37282
|
-
value: 'sans-serif'
|
|
37283
|
-
}, {
|
|
37284
|
-
label: 'serif',
|
|
37285
|
-
value: 'serif'
|
|
37286
|
-
}, {
|
|
37287
|
-
label: 'monospace',
|
|
37288
|
-
value: 'monospace'
|
|
37289
37253
|
}];
|
|
37290
37254
|
const fontSizeList = [5, 6, 8, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 32, 36, 40, 48, 56, 72];
|
|
37291
37255
|
const isPasteAllowed = currentCell => {
|
|
@@ -37300,30 +37264,30 @@ function getMatrixDimensions(matrixData) {
|
|
|
37300
37264
|
columnCount
|
|
37301
37265
|
};
|
|
37302
37266
|
}
|
|
37303
|
-
function getVisibleRangeDimensions(fullRange, visibleRange, rowDimensions, columnDimensions) {
|
|
37304
|
-
const DEFAULT_ROW_HEIGHT = 32;
|
|
37305
|
-
const DEFAULT_COLUMN_WIDTH = 100;
|
|
37267
|
+
function getVisibleRangeDimensions(fullRange, visibleRange, rowDimensions, columnDimensions, visibleColRange) {
|
|
37306
37268
|
if (!fullRange) return undefined;
|
|
37307
37269
|
const clippedStartRow = Math.max(fullRange?.start?.row, visibleRange?.start);
|
|
37308
37270
|
const clippedEndRow = Math.min(fullRange?.end?.row, visibleRange?.end - 1);
|
|
37309
|
-
|
|
37271
|
+
const clippedStartCol = Math.max(fullRange?.start?.column, visibleColRange.start);
|
|
37272
|
+
const clippedEndCol = Math.min(fullRange?.end?.column, visibleColRange.end - 1);
|
|
37273
|
+
if (clippedStartRow > clippedEndRow || clippedStartCol > clippedEndCol) {
|
|
37310
37274
|
return undefined;
|
|
37311
37275
|
}
|
|
37312
37276
|
let top = 0;
|
|
37313
37277
|
for (let row = visibleRange?.start; row < clippedStartRow; row++) {
|
|
37314
|
-
top +=
|
|
37278
|
+
top += getRowHeight(row, rowDimensions);
|
|
37315
37279
|
}
|
|
37316
37280
|
let height = 0;
|
|
37317
37281
|
for (let row = clippedStartRow; row <= clippedEndRow; row++) {
|
|
37318
|
-
height +=
|
|
37282
|
+
height += getRowHeight(row, rowDimensions);
|
|
37319
37283
|
}
|
|
37320
37284
|
let left = 0;
|
|
37321
|
-
for (let col =
|
|
37322
|
-
left +=
|
|
37285
|
+
for (let col = visibleColRange.start; col < clippedStartCol; col++) {
|
|
37286
|
+
left += getColumnWidth(col, columnDimensions);
|
|
37323
37287
|
}
|
|
37324
37288
|
let width = 0;
|
|
37325
|
-
for (let col =
|
|
37326
|
-
width +=
|
|
37289
|
+
for (let col = clippedStartCol; col <= clippedEndCol; col++) {
|
|
37290
|
+
width += getColumnWidth(col, columnDimensions);
|
|
37327
37291
|
}
|
|
37328
37292
|
return {
|
|
37329
37293
|
top,
|
|
@@ -40876,7 +40840,7 @@ const ColumnIndicator = ({
|
|
|
40876
40840
|
tabIndex: 0,
|
|
40877
40841
|
children: [jsxRuntime.jsx(Typography, {
|
|
40878
40842
|
fontWeight: "medium",
|
|
40879
|
-
children: label
|
|
40843
|
+
children: label ?? columnIndexToLabel(column)
|
|
40880
40844
|
}), jsxRuntime.jsx("div", {
|
|
40881
40845
|
className: "drag-column-selector drag-column-left",
|
|
40882
40846
|
onMouseDown: e => onMouseDrag(e, false),
|
|
@@ -40894,7 +40858,7 @@ const ColumnIndicator = ({
|
|
|
40894
40858
|
column
|
|
40895
40859
|
})
|
|
40896
40860
|
})]
|
|
40897
|
-
});
|
|
40861
|
+
}, column);
|
|
40898
40862
|
};
|
|
40899
40863
|
const enhance$2 = ColumnIndicatorComponent => {
|
|
40900
40864
|
return function ColumnIndicatorWrapper(props) {
|
|
@@ -41301,37 +41265,23 @@ const ActiveCell = props => {
|
|
|
41301
41265
|
const view = React__namespace.useCallback(() => {
|
|
41302
41266
|
dispatch(view$1());
|
|
41303
41267
|
}, [dispatch]);
|
|
41304
|
-
const rowDimensions = useSelector(state => state.rowDimensions);
|
|
41305
41268
|
const active = useSelector(state => state.active);
|
|
41306
41269
|
const mode = useSelector(state => state.mode);
|
|
41307
41270
|
const cell = useSelector(state => state.active ? get$1(state.active, state.model.data) : undefined);
|
|
41308
41271
|
const dimensions = useSelector(state => {
|
|
41309
41272
|
let dimensionValue = active ? getCellDimensions(active, state.rowDimensions, state.columnDimensions) : undefined;
|
|
41310
|
-
dimensionValue = {
|
|
41311
|
-
top: dimensionValue?.top ? dimensionValue?.top : 0,
|
|
41312
|
-
height: dimensionValue?.height ? dimensionValue?.height : 0,
|
|
41313
|
-
left: dimensionValue?.left ? dimensionValue?.left : 0,
|
|
41314
|
-
// Note: +1 Because of Active cell width is 2px
|
|
41315
|
-
width: dimensionValue?.width ? dimensionValue?.width : 0
|
|
41316
|
-
};
|
|
41317
41273
|
return dimensionValue;
|
|
41318
41274
|
});
|
|
41319
|
-
const offset = React__namespace.useMemo(() => {
|
|
41320
|
-
let sum = 0;
|
|
41321
|
-
const DEFAULT_ROW_HEIGHT = 32;
|
|
41322
|
-
for (let r = 0; r < props.visibleRange.start; r++) {
|
|
41323
|
-
sum += rowDimensions[r]?.height || DEFAULT_ROW_HEIGHT;
|
|
41324
|
-
}
|
|
41325
|
-
return sum;
|
|
41326
|
-
}, [rowDimensions, props.visibleRange.start]);
|
|
41327
41275
|
const adjustedDimensions = React__namespace.useMemo(() => {
|
|
41328
41276
|
if (!dimensions) return undefined;
|
|
41329
41277
|
return {
|
|
41330
|
-
|
|
41331
|
-
|
|
41278
|
+
top: dimensions.top - 32,
|
|
41279
|
+
height: dimensions.height,
|
|
41280
|
+
left: dimensions.left - 60,
|
|
41281
|
+
width: dimensions.width
|
|
41332
41282
|
};
|
|
41333
|
-
}, [dimensions,
|
|
41334
|
-
const hidden = React__namespace.useMemo(() => !active || !dimensions || active.row < props.
|
|
41283
|
+
}, [dimensions, props.scrollPos]);
|
|
41284
|
+
const hidden = React__namespace.useMemo(() => !active || !dimensions || active.row < props.visibleRowRange.start || active.row >= props.visibleRowRange.end || active.column < props.visibleColRange.start || active.column >= props.visibleColRange.end, [active, dimensions, props.visibleRowRange, props.visibleColRange]);
|
|
41335
41285
|
const initialCellRef = React__namespace.useRef(undefined);
|
|
41336
41286
|
const prevActiveRef = React__namespace.useRef(null);
|
|
41337
41287
|
const prevCellRef = React__namespace.useRef(undefined);
|
|
@@ -41743,7 +41693,7 @@ const ActiveCell = props => {
|
|
|
41743
41693
|
selectedFileMessage: "Duplicate attachments not allowed within the same row",
|
|
41744
41694
|
addAttachmentButton: true,
|
|
41745
41695
|
isInfoIconRequired: false,
|
|
41746
|
-
truncateMaxLimit:
|
|
41696
|
+
truncateMaxLimit: adjustedDimensions?.width ?? 0 - 60
|
|
41747
41697
|
}) : mode === 'edit' && active ? jsxRuntime.jsx(DataEditor, {
|
|
41748
41698
|
row: active.row,
|
|
41749
41699
|
column: active.column,
|
|
@@ -41814,7 +41764,8 @@ const FloatingRect = ({
|
|
|
41814
41764
|
};
|
|
41815
41765
|
|
|
41816
41766
|
const Selected = ({
|
|
41817
|
-
|
|
41767
|
+
visibleRowRange,
|
|
41768
|
+
visibleColRange,
|
|
41818
41769
|
scrollPos = {
|
|
41819
41770
|
top: 0,
|
|
41820
41771
|
left: 0
|
|
@@ -41825,13 +41776,13 @@ const Selected = ({
|
|
|
41825
41776
|
const dragging = useSelector(state => state.dragging);
|
|
41826
41777
|
const hidden = useSelector(state => state.selected.size(state.model.data) < 2);
|
|
41827
41778
|
const fullRange = useSelector(state => state.selected.toRange(state.model.data));
|
|
41828
|
-
const dimensions = React__namespace.useMemo(() => getVisibleRangeDimensions(fullRange,
|
|
41779
|
+
const dimensions = React__namespace.useMemo(() => getVisibleRangeDimensions(fullRange, visibleRowRange, rowDimensions, columnDimensions, visibleColRange), [fullRange, visibleRowRange, rowDimensions, columnDimensions, visibleColRange]);
|
|
41829
41780
|
const adjustedDimensions = React__namespace.useMemo(() => {
|
|
41830
41781
|
if (!dimensions) return undefined;
|
|
41831
41782
|
return {
|
|
41832
41783
|
...dimensions,
|
|
41833
|
-
top: dimensions.top +
|
|
41834
|
-
left: dimensions.left +
|
|
41784
|
+
top: dimensions.top + 34,
|
|
41785
|
+
left: dimensions.left + 62,
|
|
41835
41786
|
height: dimensions.height - 1,
|
|
41836
41787
|
width: dimensions.width - 1
|
|
41837
41788
|
};
|
|
@@ -41845,7 +41796,8 @@ const Selected = ({
|
|
|
41845
41796
|
};
|
|
41846
41797
|
|
|
41847
41798
|
const Copied = ({
|
|
41848
|
-
|
|
41799
|
+
visibleRowRange,
|
|
41800
|
+
visibleColRange,
|
|
41849
41801
|
scrollPos = {
|
|
41850
41802
|
top: 0,
|
|
41851
41803
|
left: 0
|
|
@@ -41855,13 +41807,13 @@ const Copied = ({
|
|
|
41855
41807
|
const columnDimensions = useSelector(state => state.columnDimensions);
|
|
41856
41808
|
const fullRange = useSelector(state => state.copied);
|
|
41857
41809
|
const hidden = fullRange === null;
|
|
41858
|
-
const dimensions = React__namespace.useMemo(() => getVisibleRangeDimensions(fullRange,
|
|
41810
|
+
const dimensions = React__namespace.useMemo(() => getVisibleRangeDimensions(fullRange, visibleRowRange, rowDimensions, columnDimensions, visibleColRange), [fullRange, visibleRowRange, rowDimensions, columnDimensions, visibleColRange]);
|
|
41859
41811
|
const adjustedDimensions = React__namespace.useMemo(() => {
|
|
41860
41812
|
if (!dimensions) return undefined;
|
|
41861
41813
|
return {
|
|
41862
41814
|
...dimensions,
|
|
41863
|
-
top: dimensions.top
|
|
41864
|
-
left: dimensions.left
|
|
41815
|
+
top: dimensions.top - scrollPos.top,
|
|
41816
|
+
left: dimensions.left - scrollPos.left,
|
|
41865
41817
|
height: dimensions.height - 1,
|
|
41866
41818
|
width: dimensions.width - 1
|
|
41867
41819
|
};
|
|
@@ -42388,8 +42340,8 @@ const throttle = (func, limit) => {
|
|
|
42388
42340
|
const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadsheet(props, ref) {
|
|
42389
42341
|
const {
|
|
42390
42342
|
className,
|
|
42391
|
-
columnLabels,
|
|
42392
|
-
rowLabels,
|
|
42343
|
+
columnLabels = [],
|
|
42344
|
+
rowLabels = [],
|
|
42393
42345
|
toolbar,
|
|
42394
42346
|
editable: editable$1,
|
|
42395
42347
|
onKeyDown,
|
|
@@ -42416,6 +42368,10 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42416
42368
|
onAddColumn,
|
|
42417
42369
|
onDeleteColumn
|
|
42418
42370
|
} = props;
|
|
42371
|
+
const DEFAULT_ROW_HEIGHT = 32;
|
|
42372
|
+
const DEFAULT_COLUMN_WIDTH = props.minimumColumnWidth || 100;
|
|
42373
|
+
const ROW_BUFFER = 20;
|
|
42374
|
+
const COL_BUFFER = 30;
|
|
42419
42375
|
const [sheetChange, setSheetChange] = React__namespace.useState(false);
|
|
42420
42376
|
const [maxWidth, setMaxWidth] = React__namespace.useState(0);
|
|
42421
42377
|
const [maxHeight, setMaxHeight] = React__namespace.useState(0);
|
|
@@ -42426,20 +42382,23 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42426
42382
|
const resizeObserver = new ResizeObserver(entries => {
|
|
42427
42383
|
const entry = entries[0];
|
|
42428
42384
|
if (entry && rootRef.current) {
|
|
42429
|
-
const
|
|
42430
|
-
|
|
42431
|
-
|
|
42432
|
-
|
|
42433
|
-
|
|
42434
|
-
|
|
42435
|
-
setMaxHeight(Math.min(rootRef.current.clientHeight, clientHeight));
|
|
42436
|
-
if (showHider) {
|
|
42437
|
-
setMaxWidth(Math.min(rootRef.current.clientWidth, clientWidth));
|
|
42438
|
-
}
|
|
42439
|
-
}
|
|
42385
|
+
const {
|
|
42386
|
+
clientWidth,
|
|
42387
|
+
clientHeight
|
|
42388
|
+
} = rootRef.current;
|
|
42389
|
+
setMaxHeight(clientHeight);
|
|
42390
|
+
setMaxWidth(showHider ? clientWidth : entry.contentRect.width);
|
|
42440
42391
|
}
|
|
42441
42392
|
});
|
|
42442
|
-
|
|
42393
|
+
React__namespace.useEffect(() => {
|
|
42394
|
+
if (rootRef.current) {
|
|
42395
|
+
resizeObserver.observe(rootRef.current);
|
|
42396
|
+
}
|
|
42397
|
+
return () => {
|
|
42398
|
+
resizeObserver.disconnect();
|
|
42399
|
+
};
|
|
42400
|
+
}, []);
|
|
42401
|
+
// const scrollOption = props.scroller;
|
|
42443
42402
|
const initialState = React__namespace.useMemo(() => {
|
|
42444
42403
|
const createParser = props.createFormulaParser || createFormulaParser;
|
|
42445
42404
|
const model = new Model(createParser, props.data);
|
|
@@ -42452,13 +42411,17 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42452
42411
|
}, [props.createFormulaParser, props.data, props.selected]);
|
|
42453
42412
|
const reducerElements = React__namespace.useReducer(reducer, initialState);
|
|
42454
42413
|
const [state, dispatch] = reducerElements;
|
|
42455
|
-
const [visibleRange, setVisibleRange] = React__namespace.useState({
|
|
42456
|
-
start: 0,
|
|
42457
|
-
end: 100
|
|
42458
|
-
});
|
|
42459
42414
|
const size = React__namespace.useMemo(() => {
|
|
42460
42415
|
return calculateSpreadsheetSize(state.model.data, rowLabels, columnLabels);
|
|
42461
42416
|
}, [state.model.data, rowLabels, columnLabels]);
|
|
42417
|
+
const [visibleRowRange, setVisibleRowRange] = React__namespace.useState({
|
|
42418
|
+
start: 0,
|
|
42419
|
+
end: Math.min(50, size.rows)
|
|
42420
|
+
});
|
|
42421
|
+
const [visibleColRange, setVisibleColRange] = React__namespace.useState({
|
|
42422
|
+
start: 0,
|
|
42423
|
+
end: Math.min(30, size.columns) // Initial visible columns
|
|
42424
|
+
});
|
|
42462
42425
|
const mode = state.mode;
|
|
42463
42426
|
const rootRef = React__namespace.useRef(null);
|
|
42464
42427
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -42494,18 +42457,6 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42494
42457
|
const addColumnRight$1 = useAction(addColumnRight);
|
|
42495
42458
|
const deleteRow$1 = useAction(deleteRow);
|
|
42496
42459
|
const deleteColumn$1 = useAction(deleteColumn);
|
|
42497
|
-
const DEFAULT_ROW_HEIGHT = 32;
|
|
42498
|
-
const DEFAULT_COLUMN_WIDTH = props.minimumColumnWidth || 100;
|
|
42499
|
-
const ROW_BUFFER = 20;
|
|
42500
|
-
const COL_BUFFER = 10;
|
|
42501
|
-
const [visibleRowRange, setVisibleRowRange] = React__namespace.useState({
|
|
42502
|
-
start: 0,
|
|
42503
|
-
end: Math.min(50, size.rows)
|
|
42504
|
-
});
|
|
42505
|
-
const [visibleColRange, setVisibleColRange] = React__namespace.useState({
|
|
42506
|
-
start: 0,
|
|
42507
|
-
end: Math.min(30, size.columns) // Initial visible columns
|
|
42508
|
-
});
|
|
42509
42460
|
// Expose removeSelect
|
|
42510
42461
|
React__namespace.useImperativeHandle(ref, () => ({
|
|
42511
42462
|
removeSelect
|
|
@@ -42653,22 +42604,20 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42653
42604
|
if (!table) return;
|
|
42654
42605
|
resizeObserver.observe(table);
|
|
42655
42606
|
};
|
|
42656
|
-
// Function to calculate cumulative height up to a row
|
|
42657
42607
|
const getCumulativeHeight = React__namespace.useCallback(row => {
|
|
42658
42608
|
let height = 0;
|
|
42659
42609
|
for (let r = 0; r < row; r++) {
|
|
42660
42610
|
height += state.rowDimensions[r]?.height || DEFAULT_ROW_HEIGHT;
|
|
42661
42611
|
}
|
|
42662
42612
|
return height;
|
|
42663
|
-
}, [state.rowDimensions]);
|
|
42664
|
-
// Function to calculate cumulative width up to a column
|
|
42613
|
+
}, [state.rowDimensions, DEFAULT_ROW_HEIGHT]);
|
|
42665
42614
|
const getCumulativeWidth = React__namespace.useCallback(col => {
|
|
42666
42615
|
let width = 0;
|
|
42667
42616
|
for (let c = 0; c < col; c++) {
|
|
42668
42617
|
width += state.columnDimensions[c]?.width || DEFAULT_COLUMN_WIDTH;
|
|
42669
42618
|
}
|
|
42670
42619
|
return width;
|
|
42671
|
-
}, [state.columnDimensions]);
|
|
42620
|
+
}, [state.columnDimensions, DEFAULT_COLUMN_WIDTH]);
|
|
42672
42621
|
// Total height and width for spacers
|
|
42673
42622
|
const totalHeight = getCumulativeHeight(size.rows);
|
|
42674
42623
|
const totalWidth = getCumulativeWidth(size.columns);
|
|
@@ -42676,7 +42625,6 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42676
42625
|
const afterRowHeight = totalHeight - getCumulativeHeight(visibleRowRange.end);
|
|
42677
42626
|
const beforeColWidth = getCumulativeWidth(visibleColRange.start);
|
|
42678
42627
|
const afterColWidth = totalWidth - getCumulativeWidth(visibleColRange.end);
|
|
42679
|
-
// Throttled scroll handler for both vertical and horizontal virtualization
|
|
42680
42628
|
const throttledHandleScroll = React__namespace.useMemo(() => throttle(e => {
|
|
42681
42629
|
const target = e.target;
|
|
42682
42630
|
const {
|
|
@@ -42685,6 +42633,10 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42685
42633
|
scrollLeft,
|
|
42686
42634
|
clientWidth
|
|
42687
42635
|
} = target;
|
|
42636
|
+
setScrollPos({
|
|
42637
|
+
top: scrollTop,
|
|
42638
|
+
left: scrollLeft
|
|
42639
|
+
});
|
|
42688
42640
|
// For rows
|
|
42689
42641
|
let newRowStart = 0;
|
|
42690
42642
|
while (newRowStart < size.rows && getCumulativeHeight(newRowStart) < scrollTop) {
|
|
@@ -42702,7 +42654,7 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42702
42654
|
});
|
|
42703
42655
|
// For columns
|
|
42704
42656
|
let newColStart = 0;
|
|
42705
|
-
while (newColStart < size.columns && getCumulativeWidth(newColStart) < scrollLeft) {
|
|
42657
|
+
while (newColStart < size.columns && getCumulativeWidth(newColStart) < scrollLeft + 100) {
|
|
42706
42658
|
newColStart++;
|
|
42707
42659
|
}
|
|
42708
42660
|
let newColEnd = newColStart;
|
|
@@ -42729,8 +42681,7 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42729
42681
|
disable: false
|
|
42730
42682
|
}]
|
|
42731
42683
|
});
|
|
42732
|
-
},
|
|
42733
|
-
// Update visible ranges when size changes (e.g., data update)
|
|
42684
|
+
}, 0), [size.rows, size.columns, getCumulativeHeight, getCumulativeWidth]);
|
|
42734
42685
|
React__namespace.useEffect(() => {
|
|
42735
42686
|
setVisibleRowRange({
|
|
42736
42687
|
start: 0,
|
|
@@ -42741,42 +42692,65 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42741
42692
|
end: Math.min(30, size.columns)
|
|
42742
42693
|
});
|
|
42743
42694
|
}, [size.rows, size.columns]);
|
|
42744
|
-
|
|
42745
|
-
|
|
42746
|
-
|
|
42747
|
-
|
|
42748
|
-
|
|
42749
|
-
|
|
42750
|
-
|
|
42751
|
-
|
|
42752
|
-
|
|
42753
|
-
|
|
42754
|
-
|
|
42755
|
-
|
|
42756
|
-
|
|
42757
|
-
|
|
42758
|
-
|
|
42759
|
-
|
|
42760
|
-
|
|
42761
|
-
|
|
42762
|
-
|
|
42695
|
+
console.log(visibleColRange, 'col range');
|
|
42696
|
+
console.log(visibleRowRange, 'row range');
|
|
42697
|
+
const visibleRows = range(visibleRowRange.end, visibleRowRange.start);
|
|
42698
|
+
const visibleCols = range(visibleColRange.end, visibleColRange.start);
|
|
42699
|
+
const scrollToRow = React__namespace.useCallback(row => {
|
|
42700
|
+
const root = rootRef.current;
|
|
42701
|
+
if (!root) return;
|
|
42702
|
+
const rowStart = getCumulativeHeight(row);
|
|
42703
|
+
const rowHeight = state.rowDimensions[row]?.height || DEFAULT_ROW_HEIGHT;
|
|
42704
|
+
const viewportTop = root.scrollTop;
|
|
42705
|
+
const viewportBottom = viewportTop + root.clientHeight;
|
|
42706
|
+
const rowEnd = rowStart + rowHeight;
|
|
42707
|
+
let targetTop = viewportTop;
|
|
42708
|
+
const fullyVisible = rowStart >= viewportTop && rowEnd <= viewportBottom;
|
|
42709
|
+
if (!fullyVisible) {
|
|
42710
|
+
if (rowStart < viewportTop) {
|
|
42711
|
+
targetTop = rowStart;
|
|
42712
|
+
} else if (rowEnd > viewportBottom) {
|
|
42713
|
+
targetTop = rowEnd - root.clientHeight;
|
|
42714
|
+
}
|
|
42715
|
+
}
|
|
42716
|
+
targetTop = Math.max(0, targetTop);
|
|
42717
|
+
root.scrollTo({
|
|
42718
|
+
top: targetTop,
|
|
42719
|
+
behavior: 'smooth'
|
|
42763
42720
|
});
|
|
42764
|
-
};
|
|
42765
|
-
const scrollToColumn = column => {
|
|
42766
|
-
|
|
42767
|
-
|
|
42768
|
-
|
|
42769
|
-
|
|
42770
|
-
|
|
42771
|
-
|
|
42772
|
-
|
|
42773
|
-
|
|
42774
|
-
|
|
42775
|
-
|
|
42776
|
-
|
|
42777
|
-
|
|
42721
|
+
}, [getCumulativeHeight, state.rowDimensions, DEFAULT_ROW_HEIGHT]);
|
|
42722
|
+
const scrollToColumn = React__namespace.useCallback((column, align = 'start') => {
|
|
42723
|
+
const root = rootRef.current;
|
|
42724
|
+
if (!root) return;
|
|
42725
|
+
const colStart = getCumulativeWidth(column);
|
|
42726
|
+
const colWidth = state.columnDimensions[column]?.width || DEFAULT_COLUMN_WIDTH;
|
|
42727
|
+
const viewportLeft = root.scrollLeft;
|
|
42728
|
+
const viewportRight = viewportLeft + root.clientWidth;
|
|
42729
|
+
const colEnd = colStart + colWidth;
|
|
42730
|
+
let targetLeft = viewportLeft;
|
|
42731
|
+
// If it's already fully visible, do nothing unless an explicit align was passed
|
|
42732
|
+
const fullyVisible = colStart >= viewportLeft && colEnd <= viewportRight;
|
|
42733
|
+
if (!fullyVisible) {
|
|
42734
|
+
if (colStart < viewportLeft) {
|
|
42735
|
+
targetLeft = colStart; // reveal from the left
|
|
42736
|
+
} else if (colEnd > viewportRight) {
|
|
42737
|
+
targetLeft = colEnd - root.clientWidth; // reveal from the right
|
|
42738
|
+
}
|
|
42739
|
+
}
|
|
42740
|
+
// Optional alignment overrides
|
|
42741
|
+
if (align === 'center') {
|
|
42742
|
+
targetLeft = colStart - (root.clientWidth - colWidth) / 2;
|
|
42743
|
+
} else if (align === 'end') {
|
|
42744
|
+
targetLeft = colEnd - root.clientWidth;
|
|
42745
|
+
}
|
|
42746
|
+
// Clamp and scroll
|
|
42747
|
+
targetLeft = Math.max(0, targetLeft);
|
|
42748
|
+
root.scrollTo({
|
|
42749
|
+
left: targetLeft,
|
|
42750
|
+
behavior: 'smooth'
|
|
42778
42751
|
});
|
|
42779
|
-
};
|
|
42752
|
+
}, [getCumulativeWidth, state.columnDimensions, DEFAULT_COLUMN_WIDTH]);
|
|
42753
|
+
const spacerColSpan = 1 + 1 + visibleCols.length + 1;
|
|
42780
42754
|
const colgroup = jsxRuntime.jsxs("colgroup", {
|
|
42781
42755
|
children: [jsxRuntime.jsx("col", {
|
|
42782
42756
|
style: {
|
|
@@ -42786,7 +42760,7 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42786
42760
|
style: {
|
|
42787
42761
|
width: `${beforeColWidth}px`
|
|
42788
42762
|
}
|
|
42789
|
-
}, "left-spacer"), ' ',
|
|
42763
|
+
}, "left-spacer"), ' ', visibleCols.map(colNumber => jsxRuntime.jsx("col", {
|
|
42790
42764
|
style: {
|
|
42791
42765
|
width: `${state.columnDimensions[colNumber]?.width || DEFAULT_COLUMN_WIDTH}px`
|
|
42792
42766
|
}
|
|
@@ -42796,10 +42770,6 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42796
42770
|
}
|
|
42797
42771
|
}, "right-spacer"), ' ']
|
|
42798
42772
|
});
|
|
42799
|
-
// Visible columns array
|
|
42800
|
-
const visibleCols = range(visibleColRange.end, visibleColRange.start);
|
|
42801
|
-
// Total colspan for spacer rows (row indicator + left spacer + visible cols + right spacer)
|
|
42802
|
-
const spacerColSpan = 1 + 1 + visibleCols.length + 1;
|
|
42803
42773
|
const tableNode = React__namespace.useMemo(() => jsxRuntime.jsxs(Table$1, {
|
|
42804
42774
|
columns: size.columns,
|
|
42805
42775
|
hideColumnIndicators: false,
|
|
@@ -42807,25 +42777,11 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42807
42777
|
children: [colgroup, jsxRuntime.jsxs(HeaderRow$1, {
|
|
42808
42778
|
children: [jsxRuntime.jsx(CornerIndicator$1, {}), jsxRuntime.jsx("th", {
|
|
42809
42779
|
className: "spacer left"
|
|
42810
|
-
}),
|
|
42811
|
-
column:
|
|
42812
|
-
minimumColumnWidth: minimumColumnWidth,
|
|
42813
|
-
setContextMenu: props.setContextMenu,
|
|
42814
|
-
label: columnNumber in columnLabels ? columnLabels[columnNumber] : null,
|
|
42815
|
-
deleteColumn: deleteColumn$1,
|
|
42816
|
-
addColumnLeft: addColumnLeft$1,
|
|
42817
|
-
addColumnRight: addColumnRight$1,
|
|
42818
|
-
columnContextEnable: props.columnContextEnable,
|
|
42819
|
-
maxColLimit: maxColLimit,
|
|
42820
|
-
disableDeleteOption: disableDeleteOption,
|
|
42821
|
-
contextMenu: contextMenu,
|
|
42822
|
-
onAddColumn: onAddColumn,
|
|
42823
|
-
onDeleteColumn: onDeleteColumn,
|
|
42824
|
-
scrollToColumn: scrollToColumn
|
|
42825
|
-
}, columnNumber) : jsxRuntime.jsx(ColumnIndicator, {
|
|
42826
|
-
column: columnNumber,
|
|
42780
|
+
}), visibleCols.map(colNumber => jsxRuntime.jsx(ColumnIndicator, {
|
|
42781
|
+
column: colNumber,
|
|
42827
42782
|
minimumColumnWidth: minimumColumnWidth,
|
|
42828
42783
|
setContextMenu: props.setContextMenu,
|
|
42784
|
+
label: colNumber in columnLabels ? columnLabels[colNumber] : undefined,
|
|
42829
42785
|
deleteColumn: deleteColumn$1,
|
|
42830
42786
|
addColumnLeft: addColumnLeft$1,
|
|
42831
42787
|
addColumnRight: addColumnRight$1,
|
|
@@ -42836,9 +42792,9 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42836
42792
|
onAddColumn: onAddColumn,
|
|
42837
42793
|
onDeleteColumn: onDeleteColumn,
|
|
42838
42794
|
scrollToColumn: scrollToColumn
|
|
42839
|
-
},
|
|
42795
|
+
}, colNumber)), jsxRuntime.jsx("th", {
|
|
42840
42796
|
className: "spacer right"
|
|
42841
|
-
})
|
|
42797
|
+
})]
|
|
42842
42798
|
}), jsxRuntime.jsxs("tr", {
|
|
42843
42799
|
style: {
|
|
42844
42800
|
height: `${beforeRowHeight}px`
|
|
@@ -42846,10 +42802,10 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42846
42802
|
children: [jsxRuntime.jsx("td", {
|
|
42847
42803
|
colSpan: spacerColSpan
|
|
42848
42804
|
}), " "]
|
|
42849
|
-
}),
|
|
42805
|
+
}), visibleRows.map(rowNumber => jsxRuntime.jsxs(Row$1, {
|
|
42850
42806
|
row: rowNumber,
|
|
42851
|
-
children: [
|
|
42852
|
-
label: rowNumber in rowLabels ? rowLabels[rowNumber] :
|
|
42807
|
+
children: [jsxRuntime.jsx(RowIndicator$1, {
|
|
42808
|
+
label: rowNumber in rowLabels ? rowLabels?.[rowNumber] : undefined,
|
|
42853
42809
|
row: rowNumber,
|
|
42854
42810
|
addRowTop: addRowTop$1,
|
|
42855
42811
|
addRowBottom: addRowBottom$1,
|
|
@@ -42859,23 +42815,11 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42859
42815
|
maxRowLimit: maxRowLimit,
|
|
42860
42816
|
disableDeleteOption: disableDeleteOption,
|
|
42861
42817
|
contextMenu: contextMenu,
|
|
42862
|
-
setVisibleRange:
|
|
42863
|
-
scrollToRow: scrollToRow
|
|
42864
|
-
}, rowNumber) : jsxRuntime.jsx(RowIndicator$1, {
|
|
42865
|
-
row: rowNumber,
|
|
42866
|
-
addRowTop: addRowTop$1,
|
|
42867
|
-
addRowBottom: addRowBottom$1,
|
|
42868
|
-
deleteRow: deleteRow$1,
|
|
42869
|
-
setContextMenu: props.setContextMenu,
|
|
42870
|
-
rowContextEnable: props.rowContextEnable,
|
|
42871
|
-
maxRowLimit: maxRowLimit,
|
|
42872
|
-
disableDeleteOption: disableDeleteOption,
|
|
42873
|
-
contextMenu: contextMenu,
|
|
42874
|
-
setVisibleRange: setVisibleRange,
|
|
42818
|
+
setVisibleRange: setVisibleRowRange,
|
|
42875
42819
|
scrollToRow: scrollToRow
|
|
42876
42820
|
}, rowNumber), jsxRuntime.jsx("td", {
|
|
42877
42821
|
className: "spacer left"
|
|
42878
|
-
}),
|
|
42822
|
+
}), visibleCols.map(columnNumber => jsxRuntime.jsx(Cell$1, {
|
|
42879
42823
|
row: rowNumber,
|
|
42880
42824
|
column: columnNumber,
|
|
42881
42825
|
// @ts-ignore
|
|
@@ -42883,16 +42827,16 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42883
42827
|
editable: editable$1
|
|
42884
42828
|
}, columnNumber)), jsxRuntime.jsx("td", {
|
|
42885
42829
|
className: "spacer right"
|
|
42886
|
-
})
|
|
42887
|
-
}, rowNumber)), jsxRuntime.
|
|
42830
|
+
})]
|
|
42831
|
+
}, rowNumber)), jsxRuntime.jsx("tr", {
|
|
42888
42832
|
style: {
|
|
42889
42833
|
height: `${afterRowHeight}px`
|
|
42890
42834
|
},
|
|
42891
|
-
children:
|
|
42835
|
+
children: jsxRuntime.jsx("td", {
|
|
42892
42836
|
colSpan: spacerColSpan
|
|
42893
|
-
})
|
|
42837
|
+
})
|
|
42894
42838
|
})]
|
|
42895
|
-
}), [Table$1, size.rows, size.columns, Row$1, HeaderRow$1, CornerIndicator$1, columnLabels, ColumnIndicator, rowLabels, RowIndicator$1, Cell$1, DataViewer$1,
|
|
42839
|
+
}), [Table$1, size.rows, size.columns, Row$1, HeaderRow$1, CornerIndicator$1, columnLabels, ColumnIndicator, rowLabels, RowIndicator$1, Cell$1, DataViewer$1, visibleRowRange, visibleColRange, beforeRowHeight, afterRowHeight, beforeColWidth, afterColWidth, state.rowDimensions, state.columnDimensions]);
|
|
42896
42840
|
const activeCellNode = React__namespace.useMemo(() => jsxRuntime.jsx(ActiveCell, {
|
|
42897
42841
|
attachmentAction: attachmentAction,
|
|
42898
42842
|
contextOption: contextOption,
|
|
@@ -42900,8 +42844,10 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42900
42844
|
setContextMenu: props.setContextMenu,
|
|
42901
42845
|
// @ts-ignore
|
|
42902
42846
|
DataEditor: DataEditor$1,
|
|
42903
|
-
|
|
42904
|
-
|
|
42847
|
+
visibleRowRange: visibleRowRange,
|
|
42848
|
+
visibleColRange: visibleColRange,
|
|
42849
|
+
scrollPos: scrollPos
|
|
42850
|
+
}), [DataEditor$1, visibleRowRange, visibleColRange, scrollPos]);
|
|
42905
42851
|
const rootNode = React__namespace.useMemo(() => jsxRuntime.jsxs("div", {
|
|
42906
42852
|
className: "ff-excel-spreadsheet-container",
|
|
42907
42853
|
children: [jsxRuntime.jsx("div", {
|
|
@@ -42946,32 +42892,14 @@ const Spreadsheet = /*#__PURE__*/React__namespace.forwardRef(function Spreadshee
|
|
|
42946
42892
|
onKeyDown: handleKeyDown,
|
|
42947
42893
|
onClick: handleClick,
|
|
42948
42894
|
onMouseMove: handleMouseMove,
|
|
42949
|
-
onScroll: e =>
|
|
42950
|
-
const target = e.target;
|
|
42951
|
-
setScrollPos({
|
|
42952
|
-
top: target.scrollTop,
|
|
42953
|
-
left: target.scrollLeft
|
|
42954
|
-
});
|
|
42955
|
-
scrollOption && throttledHandleScroll(e);
|
|
42956
|
-
setContextMenu({
|
|
42957
|
-
open: false,
|
|
42958
|
-
contextType: null,
|
|
42959
|
-
options: [{
|
|
42960
|
-
label: '',
|
|
42961
|
-
value: '',
|
|
42962
|
-
iconName: '',
|
|
42963
|
-
action: () => {},
|
|
42964
|
-
disableTooltip: '',
|
|
42965
|
-
visible: false,
|
|
42966
|
-
disable: false
|
|
42967
|
-
}]
|
|
42968
|
-
});
|
|
42969
|
-
},
|
|
42895
|
+
onScroll: e => throttledHandleScroll(e),
|
|
42970
42896
|
children: [tableNode, activeCellNode, jsxRuntime.jsx(Selected, {
|
|
42971
|
-
|
|
42897
|
+
visibleRowRange: visibleRowRange,
|
|
42898
|
+
visibleColRange: visibleColRange,
|
|
42972
42899
|
scrollPos: scrollPos
|
|
42973
42900
|
}), jsxRuntime.jsx(Copied, {
|
|
42974
|
-
|
|
42901
|
+
visibleRowRange: visibleRowRange,
|
|
42902
|
+
visibleColRange: visibleColRange,
|
|
42975
42903
|
scrollPos: scrollPos
|
|
42976
42904
|
})]
|
|
42977
42905
|
})]
|