pixel-react-excel-sheet 1.0.14 → 1.0.16
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 +2 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.esm.js +29 -11
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +29 -11
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.scss +1 -1
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +8 -3
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +0 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +4 -1
- package/src/components/Excel/ExcelFile.stories.tsx +1 -0
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +19 -7
package/package.json
CHANGED
|
@@ -33,10 +33,14 @@ interface ExcelFileProps {
|
|
|
33
33
|
|
|
34
34
|
/** Callback function to save the Excel data */
|
|
35
35
|
onSave?: (saveData: any) => void;
|
|
36
|
+
|
|
37
|
+
/** Set your dynamic sheet Height*/
|
|
38
|
+
sheetHeight?: string;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
39
42
|
excelData,
|
|
43
|
+
sheetHeight = '100%',
|
|
40
44
|
onSave = (saveData) => {
|
|
41
45
|
saveData();
|
|
42
46
|
},
|
|
@@ -426,8 +430,8 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
426
430
|
setContextMenu({
|
|
427
431
|
open: true,
|
|
428
432
|
position: {
|
|
429
|
-
x: event.pageX -
|
|
430
|
-
y: event.pageY -
|
|
433
|
+
x: event.pageX - 0,
|
|
434
|
+
y: event.pageY - 50,
|
|
431
435
|
},
|
|
432
436
|
options: options,
|
|
433
437
|
});
|
|
@@ -440,6 +444,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
440
444
|
{contextMenu.open && <ExcelContextMenu contextMenu={contextMenu} />}
|
|
441
445
|
<div ref={sheetRef} className="ff-excel-sheet">
|
|
442
446
|
<Spreadsheet
|
|
447
|
+
sheetHeight={sheetHeight}
|
|
443
448
|
setContextMenu={setContextMenu}
|
|
444
449
|
data={selectedSheetData}
|
|
445
450
|
onEvaluatedDataChange={onEvaluateChange}
|
|
@@ -500,7 +505,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
500
505
|
<Toastify />
|
|
501
506
|
</div>
|
|
502
507
|
)}
|
|
503
|
-
|
|
508
|
+
</>
|
|
504
509
|
);
|
|
505
510
|
};
|
|
506
511
|
|
|
@@ -98,6 +98,8 @@ export type Props<CellType extends Types.CellBase> = {
|
|
|
98
98
|
/** Callback called when the Spreadsheet's evaluated data changes. */
|
|
99
99
|
onEvaluatedDataChange?: (data: Matrix.Matrix<CellType>) => void;
|
|
100
100
|
setContextMenu: React.Dispatch<React.SetStateAction<Types.ContextMenuState>>;
|
|
101
|
+
/** Set your dynamic sheet Height*/
|
|
102
|
+
sheetHeight: string;
|
|
101
103
|
};
|
|
102
104
|
|
|
103
105
|
/**
|
|
@@ -113,6 +115,7 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
113
115
|
onKeyDown,
|
|
114
116
|
Table = DefaultTable,
|
|
115
117
|
Row = DefaultRow,
|
|
118
|
+
sheetHeight,
|
|
116
119
|
HeaderRow = DefaultHeaderRow,
|
|
117
120
|
DataEditor = DefaultDataEditor,
|
|
118
121
|
DataViewer = DefaultDataViewer,
|
|
@@ -457,9 +460,9 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
457
460
|
setFormatePainter={setFormatePainter}
|
|
458
461
|
/>
|
|
459
462
|
</div>
|
|
460
|
-
|
|
461
463
|
<div
|
|
462
464
|
ref={rootRef}
|
|
465
|
+
style={{height:sheetHeight}}
|
|
463
466
|
className={classNames('ff-spreadsheet', className)}
|
|
464
467
|
onKeyDown={handleKeyDown}
|
|
465
468
|
onMouseMove={handleMouseMove}
|
|
@@ -91,7 +91,14 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
91
91
|
value: string;
|
|
92
92
|
}>({
|
|
93
93
|
label: 'Times New Roman',
|
|
94
|
-
value: '
|
|
94
|
+
value: 'Times New Roman',
|
|
95
|
+
});
|
|
96
|
+
const [selectedFontSize, setSelectedFontSize] = useState<{
|
|
97
|
+
label: string;
|
|
98
|
+
value: string;
|
|
99
|
+
}>({
|
|
100
|
+
label: '11',
|
|
101
|
+
value: '11',
|
|
95
102
|
});
|
|
96
103
|
const [colorContainer, setColorPicker] = useState<ColorContainer>({
|
|
97
104
|
color: 'var(--error-light)',
|
|
@@ -219,8 +226,10 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
219
226
|
<div className="ff-excel-toolbar-font-family">
|
|
220
227
|
<Select
|
|
221
228
|
showLabel={false}
|
|
229
|
+
optionZIndex={1000}
|
|
222
230
|
onChange={(e) => {
|
|
223
|
-
|
|
231
|
+
console.log(e);
|
|
232
|
+
setSelectedFontFamily({ label: e.label, value: e.label });
|
|
224
233
|
setFontFamily(data, e.label);
|
|
225
234
|
}}
|
|
226
235
|
required={false}
|
|
@@ -233,13 +242,14 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
233
242
|
<div className="ff-excel-toolbar-font-size">
|
|
234
243
|
<Select
|
|
235
244
|
showLabel={false}
|
|
245
|
+
optionZIndex={1000}
|
|
236
246
|
required={false}
|
|
237
|
-
onChange={(e) =>
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
label: '11',
|
|
241
|
-
value: '11',
|
|
247
|
+
onChange={(e) => {
|
|
248
|
+
setSelectedFontSize({ label: e.label, value: e.value });
|
|
249
|
+
setFontSize(data, e.value);
|
|
242
250
|
}}
|
|
251
|
+
optionsList={fontSize}
|
|
252
|
+
selectedOption={selectedFontSize}
|
|
243
253
|
/>
|
|
244
254
|
</div>
|
|
245
255
|
</Tooltip>
|
|
@@ -308,6 +318,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
308
318
|
/>
|
|
309
319
|
<MenuOption
|
|
310
320
|
iconName="arrow_down"
|
|
321
|
+
zIndex={1000}
|
|
311
322
|
iconSize={12}
|
|
312
323
|
options={underlineTypeIcon}
|
|
313
324
|
tooltipPlacement="top"
|
|
@@ -384,6 +395,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
384
395
|
<MenuOption
|
|
385
396
|
iconName="arrow_down"
|
|
386
397
|
iconSize={12}
|
|
398
|
+
zIndex={1000}
|
|
387
399
|
options={borderTypeIcon}
|
|
388
400
|
tooltipPlacement="top"
|
|
389
401
|
variant="light"
|