abdul-react 0.0.33 → 0.0.36
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/ComponentProps/TreeNodeProps.d.ts +1 -0
- package/lib/_virtual/index10.js +2 -2
- package/lib/_virtual/index11.js +2 -2
- package/lib/_virtual/index9.js +2 -2
- package/lib/assets/icons/fia_ai_icon.svg.js +846 -0
- package/lib/assets/icons/fia_ai_icon.svg.js.map +1 -0
- package/lib/assets/icons/mac_white_icon.svg.js +6 -0
- package/lib/assets/icons/mac_white_icon.svg.js.map +1 -0
- package/lib/assets/icons/maximize_livetesting.svg.js +6 -0
- package/lib/assets/icons/maximize_livetesting.svg.js.map +1 -0
- package/lib/assets/icons/minimize_tree.svg.js +6 -0
- package/lib/assets/icons/minimize_tree.svg.js.map +1 -0
- package/lib/assets/icons/timer_icon.svg.js +6 -0
- package/lib/assets/icons/timer_icon.svg.js.map +1 -0
- package/lib/assets/icons/view_access_icon.svg.js +1 -1
- package/lib/assets/icons/view_access_icon.svg.js.map +1 -1
- package/lib/assets/icons/windows_blue_icon.svg.js +6 -0
- package/lib/assets/icons/windows_blue_icon.svg.js.map +1 -0
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.js +53 -13
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.js.map +1 -1
- package/lib/components/AppHeader/AppHeader.js +37 -4
- package/lib/components/AppHeader/AppHeader.js.map +1 -1
- package/lib/components/AppHeader/types.d.ts +11 -0
- package/lib/components/Comments/childComment/ChildComment.js +6 -6
- package/lib/components/Comments/childComment/ChildComment.js.map +1 -1
- package/lib/components/ConditionalDropdown/ConditionalDropdown.js +17 -5
- package/lib/components/ConditionalDropdown/ConditionalDropdown.js.map +1 -1
- package/lib/components/ConditionalDropdown/OptionsDropdown.js +16 -6
- package/lib/components/ConditionalDropdown/OptionsDropdown.js.map +1 -1
- package/lib/components/ConditionalDropdown/types.d.ts +12 -0
- package/lib/components/CreateVariable/CreateVariableSlider.js +3 -2
- package/lib/components/CreateVariable/CreateVariableSlider.js.map +1 -1
- package/lib/components/CreateVariable/types.d.ts +3 -2
- package/lib/components/DragAndDrop/DragAndDrop.d.ts +2 -0
- package/lib/components/DragAndDrop/DragAndDrop.js +3 -1
- package/lib/components/DragAndDrop/DragAndDrop.js.map +1 -1
- package/lib/components/Drawer/Drawer.js +7 -4
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/EditLabel/EditLabel.js +2 -2
- package/lib/components/EditLabel/EditLabel.js.map +1 -1
- package/lib/components/Editor/Editor.js +12 -5
- package/lib/components/Editor/Editor.js.map +1 -1
- package/lib/components/Editor/VariableDropdown.js +7 -7
- package/lib/components/Editor/VariableDropdown.js.map +1 -1
- package/lib/components/Editor/types.d.ts +12 -0
- package/lib/components/Excel/Data.d.ts +8 -0
- package/lib/components/Excel/Data.js +48 -6
- package/lib/components/Excel/Data.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js +28 -14
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Cell.js +8 -2
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Cell.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js +44 -20
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Copied.d.ts +0 -3
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Copied.js +4 -8
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Copied.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.js +45 -2
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.js +5 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js +11 -10
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Selected.d.ts +0 -3
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Selected.js +5 -9
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Selected.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js +160 -189
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Table.js +9 -13
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Table.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +17 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js +21 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/index.js +1 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/index.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js +400 -54
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.js +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.js.map +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +3 -5
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.d.ts +10 -18
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.js +157 -64
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.js.map +1 -1
- package/lib/components/Excel/ExcelToolBar/ExcelToolBar.js +26 -25
- package/lib/components/Excel/ExcelToolBar/ExcelToolBar.js.map +1 -1
- package/lib/components/Excel/Types.d.ts +2 -0
- package/lib/components/Excel/dataConversion.js +17 -4
- package/lib/components/Excel/dataConversion.js.map +1 -1
- package/lib/components/Icon/Icon.js +14 -1
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/iconList.js +18 -6
- package/lib/components/Icon/iconList.js.map +1 -1
- package/lib/components/Input/Input.js +3 -2
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/types.d.ts +1 -0
- package/lib/components/MachineInputField/MachineInputField.js +2 -2
- package/lib/components/MachineInputField/MachineInputField.js.map +1 -1
- package/lib/components/NLPInput/NlpInput.js +1 -1
- package/lib/components/NLPInput/components/NlpDropDown/NlpDropdown.js +1 -1
- package/lib/components/NLPInput/components/NlpDropDown/NlpDropdown.js.map +1 -1
- package/lib/components/PrePostTable/PrePostTable.js +2 -0
- package/lib/components/PrePostTable/PrePostTable.js.map +1 -1
- package/lib/components/Prompt/Prompt.js +17 -2
- package/lib/components/Prompt/Prompt.js.map +1 -1
- package/lib/components/Prompt/types.d.ts +4 -0
- package/lib/components/Select/Select.js +3 -1
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Select/components/Dropdown.js +2 -1
- package/lib/components/Select/components/Dropdown.js.map +1 -1
- package/lib/components/Select/types.d.ts +3 -2
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.js +14 -9
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.js.map +1 -1
- package/lib/components/SequentialConnectingBranch/components/Branches/Branches.js +4 -4
- package/lib/components/SequentialConnectingBranch/components/Branches/Branches.js.map +1 -1
- package/lib/components/StepsLandingTable/Components/StepGroupAccordions.js +92 -69
- package/lib/components/StepsLandingTable/Components/StepGroupAccordions.js.map +1 -1
- package/lib/components/StepsLandingTable/Components/StepInnerTable.d.ts +1 -1
- package/lib/components/StepsLandingTable/Components/StepInnerTable.js +189 -15
- package/lib/components/StepsLandingTable/Components/StepInnerTable.js.map +1 -1
- package/lib/components/StepsLandingTable/Components/StepTableMainRow.js +20 -4
- package/lib/components/StepsLandingTable/Components/StepTableMainRow.js.map +1 -1
- package/lib/components/StepsLandingTable/Components/Types.d.ts +6 -0
- package/lib/components/StepsLandingTable/StepLandingTable.js +12 -5
- package/lib/components/StepsLandingTable/StepLandingTable.js.map +1 -1
- package/lib/components/StepsLandingTable/types.d.ts +3 -0
- package/lib/components/Table/Table.js +184 -42
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/TableTreeFn/TableTreeFn.js +30 -0
- package/lib/components/TableTreeFn/TableTreeFn.js.map +1 -1
- package/lib/components/TableWithAccordion/TableWithAccordion.js +4 -3
- package/lib/components/TableWithAccordion/TableWithAccordion.js.map +1 -1
- package/lib/components/Toggle/Toggle.js +6 -2
- package/lib/components/Toggle/Toggle.js.map +1 -1
- package/lib/components/variableSuggestionInputDropDown/OptionsDropdown.js +7 -5
- package/lib/components/variableSuggestionInputDropDown/OptionsDropdown.js.map +1 -1
- package/lib/components/variableSuggestionInputDropDown/VariableSuggestionInputDropDown.js +1 -1
- package/lib/hooks/useFileDropzone.js +45 -17
- package/lib/hooks/useFileDropzone.js.map +1 -1
- package/lib/index.cjs +2737 -651
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +52 -4
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +106 -0
- package/lib/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js.map +1 -0
- package/lib/node_modules/js-beautify/js/src/css/index.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/lib/styles.css +1 -1
- package/lib/styles.css.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/useDeviceType/useDeviceType.d.ts +6 -0
- package/lib/utils/useDeviceType/useDeviceType.js +27 -0
- package/lib/utils/useDeviceType/useDeviceType.js.map +1 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataViewer.js","sources":["../../../../../src/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.tsx"],"sourcesContent":[null],"names":["TRUE_TEXT","FALSE_TEXT","DataViewer","cell","evaluatedCell","active","value","getValue","getFileList","checkEmpty","_jsx","fileList","JSON","parse","map","file","className","children","name","split","convertBooleanToText","classNames","hasLineBreaker","inputType","type","_jsxs","Icon","height","_Fragment","baseValue","toString"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataViewer.js","sources":["../../../../../src/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.tsx"],"sourcesContent":[null],"names":["TRUE_TEXT","FALSE_TEXT","DataViewer","cell","evaluatedCell","active","value","getValue","getFileList","checkEmpty","_jsx","fileList","JSON","parse","map","file","className","children","TruncatedTooltip","width","style","title","name","split","convertBooleanToText","classNames","hasLineBreaker","inputType","type","_jsxs","Icon","height","_Fragment","baseValue","toString"],"mappings":";;;;;;;AAQO,MAAMA,SAAS,GAAG;AAClB,MAAMC,UAAU,GAAG;AAE1B;AACMC,MAAAA,UAAU,GAAGA,CAA4C;EAC7DC,IAAI;EACJC,aAAa;AACbC,EAAAA;AAC4B,CAAA,KAAwB;AACpD,EAAA,MAAMC,KAAK,GAAGC,QAAQ,CAACJ,IAAI,EAAEC,aAAa,CAAC;EAE5C,MAAMI,WAAW,GAAIF,KAAa,IAAI;AACnC,IAAA,IAAIG,UAAU,CAACH,KAAK,CAAC,EAAE;AACrB,MAAA,OAAOI,iBAAK;AACd;AACA,IAAA,MAAMC,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACP,KAAK,CAAC;AAClC,IAAA,OAAOK,QAAQ,CAACG,GAAG,CAAEC,IAAsB,IAAI;MAC7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A8C;mBAC3DN,GAAC,CAAAoB,IAAI,EAAC;AAAAR,UAAAA,IAAI,EAAC;UAAoB,EAC3B,aAAA;AAAA,OAAA,CAAA,GAENd,WAAW,CAACF,KAAe;AAC5B,KAAA,CACA,GAEH,CAACD,MAAM,IAAIC;AAER,GAAA,CACR;AACH;AAIA,SAASC,QAAQA,CACfJ,IAAgC,EAChCC,aAAyC,EAAA;EAEzC,MAAM6B,SAAS,GAAG7B,aAAa,EAAEE,KAAK,IAAIH,IAAI,EAAEG,KAAK;AACrD,EAAA,IAAI2B,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;AAC9C,IAAA,OAAOA,SAAS,CAACC,QAAQ,EAAE;AAC7B;AACA,EAAA,OAAOD,SAAS;AAClB;AAEM,SAAUT,oBAAoBA,CAAClB,KAAc,EAAA;AACjD,EAAA,OAAOA,KAAK,GAAGN,SAAS,GAAGC,UAAU;AACvC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import classNames from '../../../../_virtual/index.js';
|
|
4
|
-
import { selectEntireRow,
|
|
4
|
+
import { selectEntireRow, activate, setRowHeight, dragEnd } from './actions.js';
|
|
5
5
|
import { get } from './matrix.js';
|
|
6
6
|
import useDispatch from './use-dispatch.js';
|
|
7
7
|
import useSelector from './use-selector.js';
|
|
@@ -38,8 +38,8 @@ const RowIndicator = ({
|
|
|
38
38
|
...prev,
|
|
39
39
|
end: action === 'increment' ? prev.end + 1 : prev.end - 1
|
|
40
40
|
};
|
|
41
|
-
if (
|
|
42
|
-
scrollToRow(
|
|
41
|
+
if (selectedRow) {
|
|
42
|
+
scrollToRow(selectedRow);
|
|
43
43
|
}
|
|
44
44
|
return value;
|
|
45
45
|
});
|
|
@@ -80,6 +80,7 @@ const RowIndicator = ({
|
|
|
80
80
|
disable: false
|
|
81
81
|
}] : [])];
|
|
82
82
|
}, [selectedRow, row]);
|
|
83
|
+
const MIN_ROW_HEIGHT = 32;
|
|
83
84
|
const handleMouseDrag = React.useCallback((event, isUp) => {
|
|
84
85
|
const getTargetRow = isUp ? row : row - 1;
|
|
85
86
|
const targetRow = Math.max(getTargetRow, 0);
|
|
@@ -87,17 +88,17 @@ const RowIndicator = ({
|
|
|
87
88
|
const startY = event.clientY;
|
|
88
89
|
const initialHeight = rowHeight;
|
|
89
90
|
const onMouseMove = moveEvent => {
|
|
90
|
-
const
|
|
91
|
+
const delta = moveEvent.clientY - startY;
|
|
92
|
+
const newHeight = Math.max(MIN_ROW_HEIGHT, initialHeight + delta);
|
|
91
93
|
dispatch(setRowHeight(targetRow, newHeight));
|
|
92
94
|
};
|
|
93
95
|
const onMouseUp = () => {
|
|
94
96
|
document.removeEventListener('mousemove', onMouseMove);
|
|
95
97
|
document.removeEventListener('mouseup', onMouseUp);
|
|
96
|
-
dispatch(dragEnd());
|
|
98
|
+
dispatch(dragEnd()); // only at end
|
|
97
99
|
};
|
|
98
100
|
document.addEventListener('mousemove', onMouseMove);
|
|
99
101
|
document.addEventListener('mouseup', onMouseUp);
|
|
100
|
-
dispatch(dragEnd());
|
|
101
102
|
}, [rowHeight, row]);
|
|
102
103
|
const activate$1 = React.useCallback(point => dispatch(activate(point)), [dispatch]);
|
|
103
104
|
const handleClick = React.useCallback(event => {
|
|
@@ -113,14 +114,14 @@ const RowIndicator = ({
|
|
|
113
114
|
});
|
|
114
115
|
}, [row, rowContextEnable, options, selectedRow]);
|
|
115
116
|
React.useEffect(() => {
|
|
116
|
-
if (selectedRow !== undefined
|
|
117
|
+
if (selectedRow !== undefined) {
|
|
117
118
|
setContextMenu(prev => ({
|
|
118
119
|
open: prev.open,
|
|
119
120
|
contextType: 'row',
|
|
120
121
|
options
|
|
121
122
|
}));
|
|
122
123
|
}
|
|
123
|
-
}, [row, rowContextEnable, options, selectedRow, contextMenu?.contextType]);
|
|
124
|
+
}, [row, rowContextEnable, options, selectedRow, contextMenu?.contextType === 'row']);
|
|
124
125
|
return jsxs("th", {
|
|
125
126
|
className: classNames('ff-spreadsheet-header', {
|
|
126
127
|
'ff-spreadsheet-header--selected': selected
|
|
@@ -138,7 +139,7 @@ const RowIndicator = ({
|
|
|
138
139
|
}), jsx("div", {
|
|
139
140
|
className: "drag-row-selector drag-row-down",
|
|
140
141
|
onMouseDown: e => handleMouseDrag(e, true),
|
|
141
|
-
onDoubleClick: () => dispatch(setRowHeight(row,
|
|
142
|
+
onDoubleClick: () => dispatch(setRowHeight(row, rowHeight)),
|
|
142
143
|
onClick: () => activate$1({
|
|
143
144
|
row,
|
|
144
145
|
column: -1
|
|
@@ -146,7 +147,7 @@ const RowIndicator = ({
|
|
|
146
147
|
}), jsx("div", {
|
|
147
148
|
className: "drag-row-selector drag-row-up",
|
|
148
149
|
onMouseDown: e => handleMouseDrag(e, false),
|
|
149
|
-
onDoubleClick: () => dispatch(setRowHeight(row,
|
|
150
|
+
onDoubleClick: () => dispatch(setRowHeight(row, rowHeight)),
|
|
150
151
|
onClick: () => activate$1({
|
|
151
152
|
row,
|
|
152
153
|
column: -1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowIndicator.js","sources":["../../../../../src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx"],"sourcesContent":[null],"names":["RowIndicator","row","label","selected","onSelect","setContextMenu","addRowTop","addRowBottom","deleteRow","rowContextEnable","selectedRow","cell","maxRowLimit","disableDeleteOption","contextMenu","setVisibleRange","scrollToRow","dispatch","useDispatch","rowHeight","useSelector","state","rowDimensions","height","matrixData","model","data","rowCount","getMatrixDimensions","updateVisibleRangeEnd","action","prev","value","end","options","React","useMemo","iconName","disableTooltip","visible","contextDisable","disable","handleMouseDrag","useCallback","event","isUp","getTargetRow","targetRow","Math","max","shiftKey","startY","clientY","initialHeight","onMouseMove","moveEvent","newHeight","Actions","onMouseUp","document","removeEventListener","addEventListener","activate","point","handleClick","contextClick","preventDefault","open","contextType","useEffect","undefined","_jsxs","className","classNames","style","minWidth","onClick","onContextMenu","tabIndex","children","_jsx","Typography","fontWeight","onMouseDown","e","onDoubleClick","column","enhance","RowIndicatorComponent","RowIndicatorWrapper","props","hasEntireRow","active","Matrix","selectEntireRow","extend"],"mappings":";;;;;;;;;;AAWMA,MAAAA,YAAY,GAAgCA,CAAC;EACjDC,GAAG;EACHC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,cAAc;EACdC,SAAS;EACTC,YAAY;EACZC,SAAS;EACTC,gBAAgB;EAChBC,WAAW;EACXC,IAAI;EACJC,WAAW;EACXC,mBAAmB;EACnBC,WAAW;EACXC,eAAe;AACfC,EAAAA;AAAW,CACZ,KAAI;AACH,EAAA,MAAMC,QAAQ,GAAGC,WAAW,EAAE;AAC9B,EAAA,MAAMC,SAAS,GAAGC,WAAW,CAC1BC,KAAK,IAAKA,KAAK,CAACC,aAAa,CAACrB,GAAG,CAAC,EAAEsB,MAAM,IAAI,EAAE,CAClD;EAED,MAAMC,UAAU,GAAGJ,WAAW,CAAEC,KAAK,IAAKA,KAAK,CAACI,KAAK,CAACC,IAAI,CAAC;EAE3D,MAAM;AAAEC,IAAAA;AAAU,GAAA,GAAGC,mBAAmB,CAACJ,UAAkB,CAAC;EAE5D,MAAMK,qBAAqB,GAAIC,MAAiC,IAAI;IAClEf,eAAe,CAAEgB,IAAI,IAAI;AACvB,MAAA,MAAMC,KAAK,GAAG;AACZ,QAAA,GAAGD,IAAI;AACPE,QAAAA,GAAG,EAAEH,MAAM,KAAK,WAAW,GAAGC,IAAI,CAACE,GAAG,GAAG,CAAC,GAAGF,IAAI,CAACE,GAAG,GAAG;OACzD;AACD,MAAA,
|
|
1
|
+
{"version":3,"file":"RowIndicator.js","sources":["../../../../../src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx"],"sourcesContent":[null],"names":["RowIndicator","row","label","selected","onSelect","setContextMenu","addRowTop","addRowBottom","deleteRow","rowContextEnable","selectedRow","cell","maxRowLimit","disableDeleteOption","contextMenu","setVisibleRange","scrollToRow","dispatch","useDispatch","rowHeight","useSelector","state","rowDimensions","height","matrixData","model","data","rowCount","getMatrixDimensions","updateVisibleRangeEnd","action","prev","value","end","options","React","useMemo","iconName","disableTooltip","visible","contextDisable","disable","MIN_ROW_HEIGHT","handleMouseDrag","useCallback","event","isUp","getTargetRow","targetRow","Math","max","shiftKey","startY","clientY","initialHeight","onMouseMove","moveEvent","delta","newHeight","Actions","onMouseUp","document","removeEventListener","addEventListener","activate","point","handleClick","contextClick","preventDefault","open","contextType","useEffect","undefined","_jsxs","className","classNames","style","minWidth","onClick","onContextMenu","tabIndex","children","_jsx","Typography","fontWeight","onMouseDown","e","onDoubleClick","column","enhance","RowIndicatorComponent","RowIndicatorWrapper","props","hasEntireRow","active","Matrix","selectEntireRow","extend"],"mappings":";;;;;;;;;;AAWMA,MAAAA,YAAY,GAAgCA,CAAC;EACjDC,GAAG;EACHC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,cAAc;EACdC,SAAS;EACTC,YAAY;EACZC,SAAS;EACTC,gBAAgB;EAChBC,WAAW;EACXC,IAAI;EACJC,WAAW;EACXC,mBAAmB;EACnBC,WAAW;EACXC,eAAe;AACfC,EAAAA;AAAW,CACZ,KAAI;AACH,EAAA,MAAMC,QAAQ,GAAGC,WAAW,EAAE;AAC9B,EAAA,MAAMC,SAAS,GAAGC,WAAW,CAC1BC,KAAK,IAAKA,KAAK,CAACC,aAAa,CAACrB,GAAG,CAAC,EAAEsB,MAAM,IAAI,EAAE,CAClD;EAED,MAAMC,UAAU,GAAGJ,WAAW,CAAEC,KAAK,IAAKA,KAAK,CAACI,KAAK,CAACC,IAAI,CAAC;EAE3D,MAAM;AAAEC,IAAAA;AAAU,GAAA,GAAGC,mBAAmB,CAACJ,UAAkB,CAAC;EAE5D,MAAMK,qBAAqB,GAAIC,MAAiC,IAAI;IAClEf,eAAe,CAAEgB,IAAI,IAAI;AACvB,MAAA,MAAMC,KAAK,GAAG;AACZ,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GAAA,CACC;AAET;AAIaC,MAAAA,OAAO,GAClBC,qBAAkD,IACkB;AACpE,EAAA,OAAO,SAASC,mBAAmBA,CAACC,KAAK,EAAA;AACvC,IAAA,MAAM3E,QAAQ,GAAGC,WAAW,EAAE;AAC9B,IAAA,MAAMf,QAAQ,GAAGiB,WAAW,CAAEC,KAAK,IACjCA,KAAK,CAAClB,QAAQ,CAAC0F,YAAY,CAACD,KAAK,CAAC3F,GAAG,CAAC,CACvC;IACD,MAAMU,IAAI,GAAGS,WAAW,CAAEC,KAAK,IAC7BA,KAAK,CAACyE,MAAM,GAAGC,GAAU,CAAC1E,KAAK,CAACyE,MAAM,EAAEzE,KAAK,CAACI,KAAK,CAACC,IAAI,CAAC,GAAG8C,SAAS,CACtE;IACD,MAAM9D,WAAW,GAAGU,WAAW,CAAEC,KAAK,IAAKA,KAAK,CAACX,WAAW,IAAI8D,SAAS,CAAC;IAE1E,MAAMwB,iBAAe,GAAG7D,KAAK,CAACS,WAAW,CACvC,CAAC3C,GAAW,EAAEgG,MAAe,KAC3BhF,QAAQ,CAAC0C,eAAuB,CAAC1D,GAAG,EAAEgG,MAAM,CAAC,CAAC,EAChD,CAAChF,QAAQ,CAAC,CACX;IAED,OACEiE,GAAA,CAACQ,qBAAqB,EAAA;AAAA,MAAA,GAChBE,KAAK;AACTzF,MAAAA,QAAQ,EAAEA,QAAQ;AAClBQ,MAAAA,IAAI,EAAEA,IAAI;AACVD,MAAAA,WAAW,EAAEA,WAAW;AACxBN,MAAAA,QAAQ,EAAE4F,iBAAe;MACzBhF,WAAW,EAAE4E,KAAK,CAAC5E;AAAW,KAAA,CAC9B;GAEL;AACH;;;;"}
|
|
@@ -2,28 +2,24 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import FloatingRect from './FloatingRect.js';
|
|
4
4
|
import useSelector from './use-selector.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getSelectedDimensions } from './util.js';
|
|
6
6
|
|
|
7
7
|
const Selected = ({
|
|
8
|
-
visibleRowRange,
|
|
9
|
-
visibleColRange,
|
|
10
8
|
scrollPos = {
|
|
11
9
|
top: 0,
|
|
12
10
|
left: 0
|
|
13
11
|
}
|
|
14
12
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
const columnDimensions = useSelector(state => state.columnDimensions);
|
|
13
|
+
const selected = useSelector(state => state.selected);
|
|
17
14
|
const dragging = useSelector(state => state.dragging);
|
|
18
15
|
const hidden = useSelector(state => state.selected.size(state.model.data) < 2);
|
|
19
|
-
const
|
|
20
|
-
const dimensions = React.useMemo(() => getVisibleRangeDimensions(fullRange, visibleRowRange, rowDimensions, columnDimensions, visibleColRange), [fullRange, visibleRowRange, rowDimensions, columnDimensions, visibleColRange]);
|
|
16
|
+
const dimensions = useSelector(state => selected && getSelectedDimensions(state.rowDimensions, state.columnDimensions, state.model.data, state.selected));
|
|
21
17
|
const adjustedDimensions = React.useMemo(() => {
|
|
22
18
|
if (!dimensions) return undefined;
|
|
23
19
|
return {
|
|
24
20
|
...dimensions,
|
|
25
|
-
top: dimensions.top
|
|
26
|
-
left: dimensions.left
|
|
21
|
+
top: dimensions.top,
|
|
22
|
+
left: dimensions.left,
|
|
27
23
|
height: dimensions.height - 1,
|
|
28
24
|
width: dimensions.width - 1
|
|
29
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selected.js","sources":["../../../../../src/components/Excel/ExcelFile/ExcelFileComponents/Selected.tsx"],"sourcesContent":[null],"names":["Selected","
|
|
1
|
+
{"version":3,"file":"Selected.js","sources":["../../../../../src/components/Excel/ExcelFile/ExcelFileComponents/Selected.tsx"],"sourcesContent":[null],"names":["Selected","scrollPos","top","left","selected","useSelector","state","dragging","hidden","size","model","data","dimensions","getSelectedDimensions","rowDimensions","columnDimensions","adjustedDimensions","React","useMemo","undefined","height","width","_jsx","FloatingRect","variant"],"mappings":";;;;;;AASMA,MAAAA,QAAQ,GAA4BA,CAAC;AACzC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@@ -7,7 +7,7 @@ import reducer, { INITIAL_STATE } from './reducer.js';
|
|
|
7
7
|
import context from './context.js';
|
|
8
8
|
import { Model } from './engine/engine.js';
|
|
9
9
|
import { createFormulaParser } from './engine/formula.js';
|
|
10
|
-
import { calculateSpreadsheetSize, isFocusedWithin, getCSV, writeTextToClipboard, shouldHandleClipboardEvent, readTextFromClipboard, range } from './util.js';
|
|
10
|
+
import { calculateSpreadsheetSize, INITIAL_ROW, INITIAL_COLUMN, isFocusedWithin, getCSV, writeTextToClipboard, shouldHandleClipboardEvent, readTextFromClipboard, ROW_BUFFER, COL_BUFFER, range } from './util.js';
|
|
11
11
|
import Table from './Table.js';
|
|
12
12
|
import Row from './Row.js';
|
|
13
13
|
import HeaderRow from './HeaderRow.js';
|
|
@@ -60,8 +60,7 @@ const Spreadsheet = /*#__PURE__*/React.forwardRef(function Spreadsheet(props, re
|
|
|
60
60
|
} = props;
|
|
61
61
|
const DEFAULT_ROW_HEIGHT = 32;
|
|
62
62
|
const DEFAULT_COLUMN_WIDTH = props.minimumColumnWidth || 100;
|
|
63
|
-
const
|
|
64
|
-
const COL_BUFFER = 30;
|
|
63
|
+
const initialized = React.useRef(false);
|
|
65
64
|
const [sheetChange, setSheetChange] = React.useState(false);
|
|
66
65
|
const [maxWidth, setMaxWidth] = React.useState(0);
|
|
67
66
|
const [maxHeight, setMaxHeight] = React.useState(0);
|
|
@@ -72,23 +71,19 @@ const Spreadsheet = /*#__PURE__*/React.forwardRef(function Spreadsheet(props, re
|
|
|
72
71
|
const resizeObserver = new ResizeObserver(entries => {
|
|
73
72
|
const entry = entries[0];
|
|
74
73
|
if (entry && rootRef.current) {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
const target = entry.target;
|
|
75
|
+
if (target) {
|
|
76
|
+
const {
|
|
77
|
+
clientWidth,
|
|
78
|
+
clientHeight
|
|
79
|
+
} = target;
|
|
80
|
+
setMaxHeight(Math.min(rootRef.current.clientHeight, clientHeight));
|
|
81
|
+
if (showHider) {
|
|
82
|
+
setMaxWidth(Math.min(rootRef.current.clientWidth, clientWidth));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
81
85
|
}
|
|
82
86
|
});
|
|
83
|
-
React.useEffect(() => {
|
|
84
|
-
if (rootRef.current) {
|
|
85
|
-
resizeObserver.observe(rootRef.current);
|
|
86
|
-
}
|
|
87
|
-
return () => {
|
|
88
|
-
resizeObserver.disconnect();
|
|
89
|
-
};
|
|
90
|
-
}, []);
|
|
91
|
-
// const scrollOption = props.scroller;
|
|
92
87
|
const initialState = React.useMemo(() => {
|
|
93
88
|
const createParser = props.createFormulaParser || createFormulaParser;
|
|
94
89
|
const model = new Model(createParser, props.data);
|
|
@@ -106,12 +101,32 @@ const Spreadsheet = /*#__PURE__*/React.forwardRef(function Spreadsheet(props, re
|
|
|
106
101
|
}, [state.model.data, rowLabels, columnLabels]);
|
|
107
102
|
const [visibleRowRange, setVisibleRowRange] = React.useState({
|
|
108
103
|
start: 0,
|
|
109
|
-
end: Math.min(
|
|
104
|
+
end: Math.min(INITIAL_ROW, size.rows)
|
|
110
105
|
});
|
|
111
106
|
const [visibleColRange, setVisibleColRange] = React.useState({
|
|
112
107
|
start: 0,
|
|
113
|
-
end: Math.min(
|
|
108
|
+
end: Math.min(INITIAL_COLUMN, size.columns)
|
|
114
109
|
});
|
|
110
|
+
const getCumulativeHeight = React.useCallback(row => {
|
|
111
|
+
let height = 0;
|
|
112
|
+
for (let r = 0; r < row; r++) {
|
|
113
|
+
height += state.rowDimensions[r]?.height || DEFAULT_ROW_HEIGHT;
|
|
114
|
+
}
|
|
115
|
+
return height;
|
|
116
|
+
}, [state.rowDimensions, DEFAULT_ROW_HEIGHT]);
|
|
117
|
+
const getCumulativeWidth = React.useCallback(col => {
|
|
118
|
+
let width = 0;
|
|
119
|
+
for (let c = 0; c < col; c++) {
|
|
120
|
+
width += state.columnDimensions[c]?.width || DEFAULT_COLUMN_WIDTH;
|
|
121
|
+
}
|
|
122
|
+
return width;
|
|
123
|
+
}, [state.columnDimensions, DEFAULT_COLUMN_WIDTH]);
|
|
124
|
+
const totalHeight = getCumulativeHeight(size.rows);
|
|
125
|
+
const totalWidth = getCumulativeWidth(size.columns);
|
|
126
|
+
const beforeRowHeight = getCumulativeHeight(visibleRowRange.start);
|
|
127
|
+
const afterRowHeight = totalHeight - getCumulativeHeight(visibleRowRange.end);
|
|
128
|
+
const beforeColWidth = getCumulativeWidth(visibleColRange.start);
|
|
129
|
+
const afterColWidth = totalWidth - getCumulativeWidth(visibleColRange.end);
|
|
115
130
|
const mode = state.mode;
|
|
116
131
|
const rootRef = React.useRef(null);
|
|
117
132
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -294,28 +309,7 @@ const Spreadsheet = /*#__PURE__*/React.forwardRef(function Spreadsheet(props, re
|
|
|
294
309
|
if (!table) return;
|
|
295
310
|
resizeObserver.observe(table);
|
|
296
311
|
};
|
|
297
|
-
const
|
|
298
|
-
let height = 0;
|
|
299
|
-
for (let r = 0; r < row; r++) {
|
|
300
|
-
height += state.rowDimensions[r]?.height || DEFAULT_ROW_HEIGHT;
|
|
301
|
-
}
|
|
302
|
-
return height;
|
|
303
|
-
}, [state.rowDimensions, DEFAULT_ROW_HEIGHT]);
|
|
304
|
-
const getCumulativeWidth = React.useCallback(col => {
|
|
305
|
-
let width = 0;
|
|
306
|
-
for (let c = 0; c < col; c++) {
|
|
307
|
-
width += state.columnDimensions[c]?.width || DEFAULT_COLUMN_WIDTH;
|
|
308
|
-
}
|
|
309
|
-
return width;
|
|
310
|
-
}, [state.columnDimensions, DEFAULT_COLUMN_WIDTH]);
|
|
311
|
-
// Total height and width for spacers
|
|
312
|
-
const totalHeight = getCumulativeHeight(size.rows);
|
|
313
|
-
const totalWidth = getCumulativeWidth(size.columns);
|
|
314
|
-
const beforeRowHeight = getCumulativeHeight(visibleRowRange.start);
|
|
315
|
-
const afterRowHeight = totalHeight - getCumulativeHeight(visibleRowRange.end);
|
|
316
|
-
const beforeColWidth = getCumulativeWidth(visibleColRange.start);
|
|
317
|
-
const afterColWidth = totalWidth - getCumulativeWidth(visibleColRange.end);
|
|
318
|
-
const throttledHandleScroll = React.useMemo(() => throttle(e => {
|
|
312
|
+
const handleScroll = React.useCallback(e => {
|
|
319
313
|
const target = e.target;
|
|
320
314
|
const {
|
|
321
315
|
scrollTop,
|
|
@@ -327,7 +321,7 @@ const Spreadsheet = /*#__PURE__*/React.forwardRef(function Spreadsheet(props, re
|
|
|
327
321
|
top: scrollTop,
|
|
328
322
|
left: scrollLeft
|
|
329
323
|
});
|
|
330
|
-
// For rows
|
|
324
|
+
// ----- For rows (NEW)-----
|
|
331
325
|
let newRowStart = 0;
|
|
332
326
|
while (newRowStart < size.rows && getCumulativeHeight(newRowStart) < scrollTop) {
|
|
333
327
|
newRowStart++;
|
|
@@ -342,9 +336,9 @@ const Spreadsheet = /*#__PURE__*/React.forwardRef(function Spreadsheet(props, re
|
|
|
342
336
|
start: newRowStart,
|
|
343
337
|
end: newRowEnd
|
|
344
338
|
});
|
|
345
|
-
// For columns
|
|
339
|
+
// ----- For columns (NEW) -----
|
|
346
340
|
let newColStart = 0;
|
|
347
|
-
while (newColStart < size.columns && getCumulativeWidth(newColStart) < scrollLeft
|
|
341
|
+
while (newColStart < size.columns && getCumulativeWidth(newColStart) < scrollLeft) {
|
|
348
342
|
newColStart++;
|
|
349
343
|
}
|
|
350
344
|
let newColEnd = newColStart;
|
|
@@ -358,89 +352,74 @@ const Spreadsheet = /*#__PURE__*/React.forwardRef(function Spreadsheet(props, re
|
|
|
358
352
|
end: newColEnd
|
|
359
353
|
});
|
|
360
354
|
// Close context menu on scroll
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
React.useEffect(() => {
|
|
376
|
-
setVisibleRowRange({
|
|
377
|
-
start: 0,
|
|
378
|
-
end: Math.min(50, size.rows)
|
|
379
|
-
});
|
|
380
|
-
setVisibleColRange({
|
|
381
|
-
start: 0,
|
|
382
|
-
end: Math.min(30, size.columns)
|
|
383
|
-
});
|
|
384
|
-
}, [size.rows, size.columns]);
|
|
385
|
-
console.log(visibleColRange, 'col range');
|
|
386
|
-
console.log(visibleRowRange, 'row range');
|
|
387
|
-
const visibleRows = range(visibleRowRange.end, visibleRowRange.start);
|
|
388
|
-
const visibleCols = range(visibleColRange.end, visibleColRange.start);
|
|
389
|
-
const scrollToRow = React.useCallback(row => {
|
|
390
|
-
const root = rootRef.current;
|
|
391
|
-
if (!root) return;
|
|
392
|
-
const rowStart = getCumulativeHeight(row);
|
|
393
|
-
const rowHeight = state.rowDimensions[row]?.height || DEFAULT_ROW_HEIGHT;
|
|
394
|
-
const viewportTop = root.scrollTop;
|
|
395
|
-
const viewportBottom = viewportTop + root.clientHeight;
|
|
396
|
-
const rowEnd = rowStart + rowHeight;
|
|
397
|
-
let targetTop = viewportTop;
|
|
398
|
-
const fullyVisible = rowStart >= viewportTop && rowEnd <= viewportBottom;
|
|
399
|
-
if (!fullyVisible) {
|
|
400
|
-
if (rowStart < viewportTop) {
|
|
401
|
-
targetTop = rowStart;
|
|
402
|
-
} else if (rowEnd > viewportBottom) {
|
|
403
|
-
targetTop = rowEnd - root.clientHeight;
|
|
404
|
-
}
|
|
355
|
+
if (contextMenu.open) {
|
|
356
|
+
setContextMenu({
|
|
357
|
+
open: false,
|
|
358
|
+
contextType: null,
|
|
359
|
+
options: [{
|
|
360
|
+
label: '',
|
|
361
|
+
value: '',
|
|
362
|
+
iconName: '',
|
|
363
|
+
action: () => {},
|
|
364
|
+
disableTooltip: '',
|
|
365
|
+
visible: false,
|
|
366
|
+
disable: false
|
|
367
|
+
}]
|
|
368
|
+
});
|
|
405
369
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
370
|
+
}, [size.rows, size.columns, getCumulativeHeight, getCumulativeWidth]);
|
|
371
|
+
const throttledHandleScroll = React.useMemo(() => throttle(handleScroll, 16), [handleScroll]);
|
|
372
|
+
const scrollToRow = row => {
|
|
373
|
+
initialized.current = true;
|
|
374
|
+
requestAnimationFrame(() => {
|
|
375
|
+
let scrollTop = 0;
|
|
376
|
+
for (let r = 0; r <= row; r++) {
|
|
377
|
+
scrollTop += state.rowDimensions?.[r]?.height || DEFAULT_ROW_HEIGHT;
|
|
378
|
+
}
|
|
379
|
+
requestAnimationFrame(() => {
|
|
380
|
+
if (!rootRef.current) return;
|
|
381
|
+
if (row >= size.rows - 1) {
|
|
382
|
+
rootRef?.current?.scrollTo({
|
|
383
|
+
top: scrollTop + DEFAULT_ROW_HEIGHT,
|
|
384
|
+
behavior: 'smooth'
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
});
|
|
410
388
|
});
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
const colEnd = colStart + colWidth;
|
|
420
|
-
let targetLeft = viewportLeft;
|
|
421
|
-
// If it's already fully visible, do nothing unless an explicit align was passed
|
|
422
|
-
const fullyVisible = colStart >= viewportLeft && colEnd <= viewportRight;
|
|
423
|
-
if (!fullyVisible) {
|
|
424
|
-
if (colStart < viewportLeft) {
|
|
425
|
-
targetLeft = colStart; // reveal from the left
|
|
426
|
-
} else if (colEnd > viewportRight) {
|
|
427
|
-
targetLeft = colEnd - root.clientWidth; // reveal from the right
|
|
389
|
+
// }
|
|
390
|
+
};
|
|
391
|
+
const scrollToColumn = column => {
|
|
392
|
+
initialized.current = true;
|
|
393
|
+
requestAnimationFrame(() => {
|
|
394
|
+
let scrollLeft = 0;
|
|
395
|
+
for (let c = 0; c <= column; c++) {
|
|
396
|
+
scrollLeft += state.columnDimensions?.[c]?.width || DEFAULT_COLUMN_WIDTH;
|
|
428
397
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
root.scrollTo({
|
|
439
|
-
left: targetLeft,
|
|
440
|
-
behavior: 'smooth'
|
|
398
|
+
requestAnimationFrame(() => {
|
|
399
|
+
if (!rootRef.current) return;
|
|
400
|
+
if (column >= size.columns - 1) {
|
|
401
|
+
rootRef.current.scrollTo({
|
|
402
|
+
left: scrollLeft + 60,
|
|
403
|
+
behavior: 'smooth'
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
});
|
|
441
407
|
});
|
|
442
|
-
}
|
|
443
|
-
|
|
408
|
+
};
|
|
409
|
+
React.useEffect(() => {
|
|
410
|
+
if (!initialized.current) {
|
|
411
|
+
setVisibleRowRange({
|
|
412
|
+
start: 0,
|
|
413
|
+
end: Math.min(INITIAL_ROW, size.rows)
|
|
414
|
+
});
|
|
415
|
+
setVisibleColRange({
|
|
416
|
+
start: 0,
|
|
417
|
+
end: Math.min(INITIAL_COLUMN, size.columns)
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}, [size.rows, size.columns, initialized.current]);
|
|
421
|
+
const visibleRows = range(visibleRowRange.end, visibleRowRange.start);
|
|
422
|
+
const visibleCols = range(visibleColRange.end, visibleColRange.start);
|
|
444
423
|
const colgroup = jsxs("colgroup", {
|
|
445
424
|
children: [jsx("col", {
|
|
446
425
|
style: {
|
|
@@ -461,70 +440,66 @@ const Spreadsheet = /*#__PURE__*/React.forwardRef(function Spreadsheet(props, re
|
|
|
461
440
|
}, "right-spacer"), ' ']
|
|
462
441
|
});
|
|
463
442
|
const tableNode = React.useMemo(() => jsxs(Table$1, {
|
|
464
|
-
columns: size.columns,
|
|
465
|
-
hideColumnIndicators: false,
|
|
466
443
|
useTableRef: useTableRef,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
},
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
row: rowNumber,
|
|
497
|
-
children: [jsx(RowIndicator$1, {
|
|
498
|
-
label: rowNumber in rowLabels ? rowLabels?.[rowNumber] : undefined,
|
|
499
|
-
row: rowNumber,
|
|
500
|
-
addRowTop: addRowTop$1,
|
|
501
|
-
addRowBottom: addRowBottom$1,
|
|
502
|
-
deleteRow: deleteRow$1,
|
|
503
|
-
setContextMenu: props.setContextMenu,
|
|
504
|
-
rowContextEnable: props.rowContextEnable,
|
|
505
|
-
maxRowLimit: maxRowLimit,
|
|
506
|
-
disableDeleteOption: disableDeleteOption,
|
|
507
|
-
contextMenu: contextMenu,
|
|
508
|
-
setVisibleRange: setVisibleRowRange,
|
|
509
|
-
scrollToRow: scrollToRow
|
|
510
|
-
}, rowNumber), jsx("td", {
|
|
511
|
-
className: "spacer left"
|
|
512
|
-
}), visibleCols.map(columnNumber => jsx(Cell$1, {
|
|
444
|
+
totalWidth: totalWidth,
|
|
445
|
+
children: [colgroup, jsxs("tbody", {
|
|
446
|
+
children: [jsxs(HeaderRow$1, {
|
|
447
|
+
children: [jsx(CornerIndicator$1, {}), jsx("div", {
|
|
448
|
+
className: "spacer left"
|
|
449
|
+
}), visibleCols.map(colNumber => jsx(ColumnIndicator, {
|
|
450
|
+
column: colNumber,
|
|
451
|
+
minimumColumnWidth: minimumColumnWidth,
|
|
452
|
+
setContextMenu: props.setContextMenu,
|
|
453
|
+
label: colNumber in columnLabels ? columnLabels[colNumber] : undefined,
|
|
454
|
+
deleteColumn: deleteColumn$1,
|
|
455
|
+
addColumnLeft: addColumnLeft$1,
|
|
456
|
+
addColumnRight: addColumnRight$1,
|
|
457
|
+
columnContextEnable: props.columnContextEnable,
|
|
458
|
+
maxColLimit: maxColLimit,
|
|
459
|
+
disableDeleteOption: disableDeleteOption,
|
|
460
|
+
contextMenu: contextMenu,
|
|
461
|
+
onAddColumn: onAddColumn,
|
|
462
|
+
onDeleteColumn: onDeleteColumn,
|
|
463
|
+
setVisibleRange: setVisibleColRange,
|
|
464
|
+
scrollToColumn: scrollToColumn
|
|
465
|
+
}, colNumber)), jsx("div", {
|
|
466
|
+
className: "spacer right"
|
|
467
|
+
})]
|
|
468
|
+
}), jsx("tr", {
|
|
469
|
+
style: {
|
|
470
|
+
height: `${beforeRowHeight}px`
|
|
471
|
+
}
|
|
472
|
+
}), visibleRows.map(rowNumber => jsxs(Row$1, {
|
|
513
473
|
row: rowNumber,
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
474
|
+
children: [jsx(RowIndicator$1, {
|
|
475
|
+
label: rowNumber in rowLabels ? rowLabels?.[rowNumber] : undefined,
|
|
476
|
+
row: rowNumber,
|
|
477
|
+
addRowTop: addRowTop$1,
|
|
478
|
+
addRowBottom: addRowBottom$1,
|
|
479
|
+
deleteRow: deleteRow$1,
|
|
480
|
+
setContextMenu: props.setContextMenu,
|
|
481
|
+
rowContextEnable: props.rowContextEnable,
|
|
482
|
+
maxRowLimit: maxRowLimit,
|
|
483
|
+
disableDeleteOption: disableDeleteOption,
|
|
484
|
+
contextMenu: contextMenu,
|
|
485
|
+
setVisibleRange: setVisibleRowRange,
|
|
486
|
+
scrollToRow: scrollToRow
|
|
487
|
+
}, rowNumber), jsx("div", {
|
|
488
|
+
className: "spacer left"
|
|
489
|
+
}), visibleCols.map(columnNumber => jsx(Cell$1, {
|
|
490
|
+
row: rowNumber,
|
|
491
|
+
column: columnNumber,
|
|
492
|
+
// @ts-ignore
|
|
493
|
+
DataViewer: DataViewer$1,
|
|
494
|
+
editable: editable$1
|
|
495
|
+
}, columnNumber)), jsx("div", {
|
|
496
|
+
className: "spacer right"
|
|
497
|
+
})]
|
|
498
|
+
}, rowNumber)), jsx("tr", {
|
|
499
|
+
style: {
|
|
500
|
+
height: `${afterRowHeight}px`
|
|
501
|
+
}
|
|
520
502
|
})]
|
|
521
|
-
}, rowNumber)), jsx("tr", {
|
|
522
|
-
style: {
|
|
523
|
-
height: `${afterRowHeight}px`
|
|
524
|
-
},
|
|
525
|
-
children: jsx("td", {
|
|
526
|
-
colSpan: spacerColSpan
|
|
527
|
-
})
|
|
528
503
|
})]
|
|
529
504
|
}), [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]);
|
|
530
505
|
const activeCellNode = React.useMemo(() => jsx(ActiveCell, {
|
|
@@ -584,12 +559,8 @@ const Spreadsheet = /*#__PURE__*/React.forwardRef(function Spreadsheet(props, re
|
|
|
584
559
|
onMouseMove: handleMouseMove,
|
|
585
560
|
onScroll: e => throttledHandleScroll(e),
|
|
586
561
|
children: [tableNode, activeCellNode, jsx(Selected, {
|
|
587
|
-
visibleRowRange: visibleRowRange,
|
|
588
|
-
visibleColRange: visibleColRange,
|
|
589
562
|
scrollPos: scrollPos
|
|
590
563
|
}), jsx(Copied, {
|
|
591
|
-
visibleRowRange: visibleRowRange,
|
|
592
|
-
visibleColRange: visibleColRange,
|
|
593
564
|
scrollPos: scrollPos
|
|
594
565
|
})]
|
|
595
566
|
})]
|