pixel-react-excel-sheet 1.0.34 → 1.0.35
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/components/Excel/ExcelFile/ExcelFile.d.ts +3 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.esm.js +13 -12
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +13 -12
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +18 -10
- package/src/components/Excel/ExcelFile.stories.tsx +3 -0
|
@@ -5,6 +5,7 @@ interface ExcelFileProps {
|
|
|
5
5
|
excelData: {
|
|
6
6
|
sheets: WorkSheet[];
|
|
7
7
|
};
|
|
8
|
+
heightType?: string;
|
|
8
9
|
/** Optional: Provide context menu options for actions like right-click */
|
|
9
10
|
contextOption?: {
|
|
10
11
|
name: string;
|
|
@@ -15,6 +16,8 @@ interface ExcelFileProps {
|
|
|
15
16
|
toolbar?: 'show' | 'disable' | 'hide';
|
|
16
17
|
/** Callback function to save the Excel data */
|
|
17
18
|
onSave?: (saveData: any) => void;
|
|
19
|
+
contextHeight?: number;
|
|
20
|
+
contextWidth?: number;
|
|
18
21
|
/** Set your dynamic sheet Height*/
|
|
19
22
|
sheetHeight?: string;
|
|
20
23
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -2484,6 +2484,7 @@ interface ExcelFileProps {
|
|
|
2484
2484
|
excelData: {
|
|
2485
2485
|
sheets: WorkSheet[];
|
|
2486
2486
|
};
|
|
2487
|
+
heightType?: string;
|
|
2487
2488
|
/** Optional: Provide context menu options for actions like right-click */
|
|
2488
2489
|
contextOption?: {
|
|
2489
2490
|
name: string;
|
|
@@ -2494,6 +2495,8 @@ interface ExcelFileProps {
|
|
|
2494
2495
|
toolbar?: 'show' | 'disable' | 'hide';
|
|
2495
2496
|
/** Callback function to save the Excel data */
|
|
2496
2497
|
onSave?: (saveData: any) => void;
|
|
2498
|
+
contextHeight?: number;
|
|
2499
|
+
contextWidth?: number;
|
|
2497
2500
|
/** Set your dynamic sheet Height*/
|
|
2498
2501
|
sheetHeight?: string;
|
|
2499
2502
|
}
|
package/lib/index.esm.js
CHANGED
|
@@ -33155,6 +33155,9 @@ const ExcelContextMenu = ({
|
|
|
33155
33155
|
const ExcelFile = ({
|
|
33156
33156
|
excelData,
|
|
33157
33157
|
sheetHeight = '100%',
|
|
33158
|
+
heightType = 'page',
|
|
33159
|
+
contextHeight = 0,
|
|
33160
|
+
contextWidth = 0,
|
|
33158
33161
|
onSave = saveData => {
|
|
33159
33162
|
saveData();
|
|
33160
33163
|
}
|
|
@@ -33499,32 +33502,30 @@ const ExcelFile = ({
|
|
|
33499
33502
|
handleSheetChange(name, index);
|
|
33500
33503
|
}
|
|
33501
33504
|
});
|
|
33502
|
-
setPosition({
|
|
33503
|
-
x: event.clientX - 350,
|
|
33504
|
-
y: event.clientY
|
|
33505
|
-
});
|
|
33506
33505
|
setContextMenu({
|
|
33507
33506
|
open: true,
|
|
33508
33507
|
position: {
|
|
33509
|
-
x: event.
|
|
33510
|
-
y: event.
|
|
33508
|
+
x: event.pageX,
|
|
33509
|
+
y: event.pageY
|
|
33511
33510
|
},
|
|
33512
33511
|
options: options
|
|
33513
33512
|
});
|
|
33514
33513
|
};
|
|
33515
33514
|
return jsx(Fragment, {
|
|
33516
33515
|
children: sheetNames.length > 0 && jsxs("div", {
|
|
33517
|
-
|
|
33516
|
+
style: {
|
|
33517
|
+
position: 'relative'
|
|
33518
|
+
},
|
|
33518
33519
|
onContextMenu: event => {
|
|
33520
|
+
const xPosition = heightType === 'page' ? event.pageX : event.clientX;
|
|
33521
|
+
const yPosition = heightType === 'page' ? event.pageY : event.clientY;
|
|
33519
33522
|
setPosition({
|
|
33520
|
-
x:
|
|
33521
|
-
y:
|
|
33523
|
+
x: xPosition + contextWidth,
|
|
33524
|
+
y: yPosition + contextHeight
|
|
33522
33525
|
});
|
|
33523
33526
|
},
|
|
33524
|
-
style: {
|
|
33525
|
-
position: 'relative'
|
|
33526
|
-
},
|
|
33527
33527
|
children: [jsx("div", {
|
|
33528
|
+
ref: sheetRef,
|
|
33528
33529
|
className: "ff-excel-sheet",
|
|
33529
33530
|
children: jsx(Spreadsheet, {
|
|
33530
33531
|
sheetHeight: sheetHeight,
|