pixel-react-excel-sheet 1.0.38 → 1.0.39
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/Button/Button.d.ts +2 -2
- package/lib/components/Charts/DashboardDonutChart/types.d.ts +3 -0
- package/lib/components/Charts/LineChart/types.d.ts +1 -0
- package/lib/components/ChooseFile/ChooseFile.d.ts +3 -2
- package/lib/components/Comment/Comments.d.ts +1 -1
- package/lib/components/Comment/type.d.ts +3 -3
- package/lib/components/ConditionalDropdown/types.d.ts +4 -0
- package/lib/components/DatePicker/types.d.ts +2 -0
- package/lib/components/Drawer/Types.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFile.d.ts +11 -10
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.d.ts +10 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.d.ts +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +9 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +0 -3
- package/lib/components/Excel/Types.d.ts +14 -10
- package/lib/components/FF_Captcha/Recaptcha.d.ts +2 -1
- package/lib/components/FF_Captcha/types.d.ts +11 -2
- package/lib/components/Input/types.d.ts +4 -0
- package/lib/components/LabelEditTextField/types.d.ts +2 -0
- package/lib/components/MobileSkin/MobileSkin.d.ts +5 -0
- package/lib/components/MobileSkin/MobileSkinInterface.d.ts +13 -0
- package/lib/components/MobileSkin/index.d.ts +1 -0
- package/lib/components/MobileSkin/types.d.ts +32 -0
- package/lib/components/Search/Search.d.ts +1 -1
- package/lib/components/Search/types.d.ts +1 -0
- package/lib/components/Select/components/types.d.ts +3 -2
- package/lib/components/Select/types.d.ts +10 -2
- package/lib/components/SequentialConnectingBranch/components/Branches/Branches.d.ts +1 -1
- package/lib/components/SequentialConnectingBranch/components/Branches/types.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.d.ts +1 -1
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/types.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/types.d.ts +1 -0
- package/lib/components/TableTree/types.d.ts +4 -4
- package/lib/components/Tabs/types.d.ts +1 -0
- package/lib/index.d.ts +96 -40
- package/lib/index.esm.js +4812 -1669
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +4825 -1669
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/formData/ConvertFormDataToObject.d.ts +1 -0
- package/lib/utils/keyBoardActionUtil/UseKeyboardActions.d.ts +2 -0
- package/lib/utils/keyBoardActionUtil/types.d.ts +4 -0
- package/lib/validations/regex.d.ts +11 -1
- package/package.json +6 -1
- package/src/assets/Themes/BaseTheme.scss +3 -1
- package/src/assets/Themes/DarkTheme.scss +10 -1
- package/src/assets/icons/clear_cache.svg +5 -0
- package/src/assets/icons/external_user.svg +13 -0
- package/src/assets/icons/group_user.svg +12 -0
- package/src/assets/icons/single_user.svg +12 -0
- package/src/assets/icons/test_freshers_logo.svg +8 -0
- package/src/assets/icons/unfollow_icon.svg +3 -0
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +7 -45
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +5 -0
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +76 -64
- package/src/components/Button/Button.scss +0 -1
- package/src/components/Button/Button.tsx +3 -4
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +38 -6
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +10 -4
- package/src/components/Charts/DashboardDonutChart/types.ts +4 -1
- package/src/components/Charts/LineChart/LineChart.stories.tsx +27 -88
- package/src/components/Charts/LineChart/LineChart.tsx +138 -42
- package/src/components/Charts/LineChart/types.ts +1 -0
- package/src/components/Charts/MultiRadialChart/MultiRadialChart.scss +3 -3
- package/src/components/Charts/MultiRadialChart/MultiRadialChart.tsx +47 -43
- package/src/components/ChooseFile/ChooseFile.tsx +3 -4
- package/src/components/Comment/Comments.scss +0 -1
- package/src/components/Comment/Comments.stories.tsx +22 -4
- package/src/components/Comment/Comments.tsx +20 -1
- package/src/components/Comment/type.ts +3 -3
- package/src/components/ConditionalDropdown/ConditionalDropdown.stories.tsx +1 -0
- package/src/components/ConditionalDropdown/ConditionalDropdown.tsx +2 -1
- package/src/components/ConditionalDropdown/types.ts +4 -0
- package/src/components/DatePicker/DatePicker.scss +307 -2
- package/src/components/DatePicker/DatePicker.tsx +27 -19
- package/src/components/DatePicker/types.ts +4 -0
- package/src/components/Drawer/Drawer.stories.tsx +1 -1
- package/src/components/Drawer/Types.ts +4 -2
- package/src/components/Editor/Editor.scss +23 -18
- package/src/components/Editor/Editor.tsx +2 -2
- package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.tsx +6 -3
- package/src/components/Excel/ExcelFile/ExcelFile.scss +45 -41
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +68 -64
- package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +29 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +0 -36
- package/src/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.tsx +1 -40
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +3 -3
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +12 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +8 -74
- package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +0 -5
- package/src/components/Excel/ExcelFile.stories.tsx +112 -125
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +10 -11
- package/src/components/Excel/Types.ts +17 -15
- package/src/components/FF_Captcha/Recaptcha.tsx +19 -9
- package/src/components/FF_Captcha/types.ts +12 -4
- package/src/components/Icon/Icon.stories.tsx +56 -8
- package/src/components/Icon/iconList.ts +13 -1
- package/src/components/Input/Input.stories.tsx +12 -0
- package/src/components/Input/Input.tsx +3 -1
- package/src/components/Input/types.ts +4 -0
- package/src/components/InputWithDropdown/types.ts +1 -1
- package/src/components/LabelEditTextField/LabelEditTextField.scss +4 -0
- package/src/components/LabelEditTextField/LabelEditTextField.stories.tsx +2 -1
- package/src/components/LabelEditTextField/LabelEditTextField.tsx +14 -10
- package/src/components/LabelEditTextField/types.ts +2 -0
- package/src/components/LazyLoad/LazyLoad.stories.tsx +1 -0
- package/src/components/LazyLoad/LazyLoading.tsx +10 -1
- package/src/components/MachineInputField/MachineInputField.scss +5 -1
- package/src/components/MachineInputField/MachineInputField.tsx +1 -0
- package/src/components/MobileSkin/MobileSkin.scss +67 -0
- package/src/components/MobileSkin/MobileSkin.stories.tsx +93 -0
- package/src/components/MobileSkin/MobileSkin.tsx +89 -0
- package/src/components/MobileSkin/MobileSkinInterface.ts +13 -0
- package/src/components/MobileSkin/index.ts +1 -0
- package/src/components/MobileSkin/types.ts +32 -0
- package/src/components/Modal/Modal.stories.tsx +7 -0
- package/src/components/Modal/Modal.tsx +17 -20
- package/src/components/Search/Search.scss +8 -0
- package/src/components/Search/Search.tsx +17 -6
- package/src/components/Search/types.ts +1 -0
- package/src/components/Select/Select.stories.tsx +85 -0
- package/src/components/Select/Select.tsx +10 -2
- package/src/components/Select/components/Dropdown.tsx +23 -15
- package/src/components/Select/components/types.ts +3 -2
- package/src/components/Select/types.ts +12 -2
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.tsx +2 -0
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +65 -57
- package/src/components/SequentialConnectingBranch/components/Branches/types.ts +1 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.tsx +2 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/types.ts +1 -0
- package/src/components/SequentialConnectingBranch/types.ts +5 -1
- package/src/components/TableTree/Components/TableCell.tsx +3 -3
- package/src/components/TableTree/TableTree.scss +0 -7
- package/src/components/TableTree/TableTree.tsx +3 -22
- package/src/components/TableTree/types.ts +4 -4
- package/src/components/Tabs/Tabs.scss +19 -0
- package/src/components/Tabs/Tabs.tsx +9 -0
- package/src/components/Tabs/types.ts +1 -0
- package/src/index.ts +27 -0
- package/src/utils/formData/ConvertFormDataToObject.stories.tsx +27 -0
- package/src/utils/formData/ConvertFormDataToObject.ts +14 -0
- package/src/utils/getExtension/getExtension.stories.tsx +1 -0
- package/src/utils/keyBoardActionUtil/UseKeyboardAction.stories.tsx +53 -0
- package/src/utils/keyBoardActionUtil/UseKeyboardActions.tsx +20 -0
- package/src/utils/keyBoardActionUtil/types.ts +4 -0
- package/src/validations/regex.stories.tsx +63 -0
- package/src/validations/regex.ts +34 -0
- package/src/assets/images/photo.png +0 -0
|
@@ -10,54 +10,15 @@ export const FALSE_TEXT = 'FALSE';
|
|
|
10
10
|
const DataViewer = <Cell extends Types.CellBase<Value>, Value>({
|
|
11
11
|
cell,
|
|
12
12
|
evaluatedCell,
|
|
13
|
-
setContextMenu,//Todo
|
|
14
13
|
}: Types.DataViewerProps<Cell>): React.ReactElement => {
|
|
15
|
-
|
|
16
14
|
const value = getValue(cell, evaluatedCell);
|
|
17
15
|
|
|
18
|
-
const options = [
|
|
19
|
-
{
|
|
20
|
-
label: 'Dynamic Cell One',
|
|
21
|
-
value: 'Dynamic Cell One',
|
|
22
|
-
iconName: 'plus_icon',
|
|
23
|
-
action: () => {
|
|
24
|
-
},
|
|
25
|
-
disable: false,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: 'Dynamic Cell Two',
|
|
29
|
-
value: 'Dynamic Cell Two',
|
|
30
|
-
iconName: 'plus_icon',
|
|
31
|
-
action: () => {
|
|
32
|
-
},
|
|
33
|
-
disable: false,
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
const contextClick = React.useCallback(
|
|
38
|
-
(event: React.MouseEvent) => {
|
|
39
|
-
event.preventDefault();
|
|
40
|
-
|
|
41
|
-
setContextMenu({
|
|
42
|
-
open: true,
|
|
43
|
-
position: {
|
|
44
|
-
x: event.pageX - 50,
|
|
45
|
-
y: event.pageY - 260,
|
|
46
|
-
},
|
|
47
|
-
options: options,
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
[ setContextMenu]
|
|
51
|
-
);
|
|
52
|
-
|
|
53
16
|
return typeof value === 'boolean' ? (
|
|
54
|
-
<span
|
|
55
|
-
className="ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean">
|
|
17
|
+
<span className="ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean">
|
|
56
18
|
{convertBooleanToText(value)}
|
|
57
19
|
</span>
|
|
58
20
|
) : (
|
|
59
21
|
<span
|
|
60
|
-
onContextMenu={contextClick}
|
|
61
22
|
className={classNames('ff-spreadsheet-data-viewer', {
|
|
62
23
|
'ff-spreadsheet-data-viewer--preserve-breaks': hasLineBreaker(value),
|
|
63
24
|
})}
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
.ff-spreadsheet-active-cell {
|
|
53
53
|
position: absolute;
|
|
54
|
-
border:
|
|
54
|
+
border: 2px solid var(--outline-color);
|
|
55
55
|
box-sizing: border-box;
|
|
56
56
|
z-index: 100;
|
|
57
57
|
}
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
|
|
189
189
|
.ff-spreadsheet-floating-rect--selected {
|
|
190
190
|
background: var(--outline-background-color);
|
|
191
|
-
border:
|
|
191
|
+
border: 2px var(--outline-color) solid;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
.ff-spreadsheet-floating-rect--dragging {
|
|
@@ -196,6 +196,6 @@
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
.ff-spreadsheet-floating-rect--copied {
|
|
199
|
-
border:
|
|
199
|
+
border: 2px var(--outline-color) dashed;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
@@ -101,6 +101,15 @@ export type Props<CellType extends Types.CellBase> = {
|
|
|
101
101
|
setContextMenu: React.Dispatch<React.SetStateAction<Types.ContextMenuState>>;
|
|
102
102
|
/** Set your dynamic sheet Height*/
|
|
103
103
|
sheetHeight: string;
|
|
104
|
+
contextOption?: {
|
|
105
|
+
open: boolean;
|
|
106
|
+
options: {
|
|
107
|
+
label: string;
|
|
108
|
+
value: string;
|
|
109
|
+
iconName: string;
|
|
110
|
+
action: () => void;
|
|
111
|
+
}[];
|
|
112
|
+
};
|
|
104
113
|
};
|
|
105
114
|
|
|
106
115
|
/**
|
|
@@ -123,6 +132,7 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
123
132
|
onSelect = () => {},
|
|
124
133
|
onActivate = () => {},
|
|
125
134
|
onEvaluatedDataChange = () => {},
|
|
135
|
+
contextOption,
|
|
126
136
|
} = props;
|
|
127
137
|
type State = Types.StoreState<CellType>;
|
|
128
138
|
|
|
@@ -440,7 +450,6 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
440
450
|
key={columnNumber}
|
|
441
451
|
row={rowNumber}
|
|
442
452
|
column={columnNumber}
|
|
443
|
-
setContextMenu={props.setContextMenu}
|
|
444
453
|
// @ts-ignore
|
|
445
454
|
DataViewer={DataViewer}
|
|
446
455
|
/>
|
|
@@ -468,6 +477,8 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
468
477
|
const activeCellNode = React.useMemo(
|
|
469
478
|
() => (
|
|
470
479
|
<ActiveCell
|
|
480
|
+
contextOption={contextOption}
|
|
481
|
+
setContextMenu={props.setContextMenu}
|
|
471
482
|
// @ts-ignore
|
|
472
483
|
DataEditor={DataEditor}
|
|
473
484
|
/>
|
|
@@ -193,8 +193,6 @@ export function applyBorderToCells(
|
|
|
193
193
|
let updatedData = currentData;
|
|
194
194
|
|
|
195
195
|
const { start, end } = selectedRange;
|
|
196
|
-
const startRow = start.row;
|
|
197
|
-
const startCol = start.column;
|
|
198
196
|
|
|
199
197
|
for (let row = start.row; row <= end.row; row++) {
|
|
200
198
|
for (let col = start.column; col <= end.column; col++) {
|
|
@@ -204,47 +202,17 @@ export function applyBorderToCells(
|
|
|
204
202
|
continue;
|
|
205
203
|
}
|
|
206
204
|
|
|
207
|
-
const adjacentCell = (
|
|
208
|
-
row: number,
|
|
209
|
-
col: number,
|
|
210
|
-
borderType: string,
|
|
211
|
-
borderColor: string
|
|
212
|
-
) => {
|
|
213
|
-
const adjacentCell = Matrix.get({ row: row, column: col }, updatedData);
|
|
214
|
-
if (adjacentCell) {
|
|
215
|
-
let updatedCell = { ...adjacentCell };
|
|
216
|
-
updatedCell.style = {
|
|
217
|
-
...adjacentCell.style,
|
|
218
|
-
[borderType]: `1px solid ${borderColor}`,
|
|
219
|
-
};
|
|
220
|
-
console.log(updatedCell);
|
|
221
|
-
updatedData = Matrix.set(
|
|
222
|
-
{ row: row, column: col },
|
|
223
|
-
updatedCell,
|
|
224
|
-
updatedData
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
|
|
229
205
|
let updatedCell = { ...currentCell };
|
|
230
206
|
|
|
231
207
|
switch (value) {
|
|
232
208
|
case 'border-all-sides':
|
|
233
209
|
updatedCell.style = {
|
|
234
210
|
...currentCell.style,
|
|
235
|
-
borderRight: `
|
|
236
|
-
borderLeft: `
|
|
237
|
-
borderTop: `
|
|
238
|
-
borderBottom: `
|
|
211
|
+
borderRight: `2px solid ${color}`,
|
|
212
|
+
borderLeft: `2px solid ${color}`,
|
|
213
|
+
borderTop: `2px solid ${color}`,
|
|
214
|
+
borderBottom: `2px solid ${color}`,
|
|
239
215
|
};
|
|
240
|
-
|
|
241
|
-
if (row === startRow) {
|
|
242
|
-
adjacentCell(row - 1, col, 'borderBottom', color);
|
|
243
|
-
}
|
|
244
|
-
if (col === startCol) {
|
|
245
|
-
adjacentCell(row, col - 1, 'borderRight', color);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
216
|
break;
|
|
249
217
|
case 'border-none':
|
|
250
218
|
updatedCell.style = {
|
|
@@ -254,64 +222,30 @@ export function applyBorderToCells(
|
|
|
254
222
|
borderTop: `1px solid var(--excel-sheet-border)`,
|
|
255
223
|
borderBottom: `1px solid var(--excel-sheet-border)`,
|
|
256
224
|
};
|
|
257
|
-
|
|
258
|
-
if (row === startRow) {
|
|
259
|
-
adjacentCell(
|
|
260
|
-
row - 1,
|
|
261
|
-
col,
|
|
262
|
-
'borderBottom',
|
|
263
|
-
'var(--excel-sheet-border)'
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
if (col === startCol) {
|
|
267
|
-
adjacentCell(
|
|
268
|
-
row,
|
|
269
|
-
col - 1,
|
|
270
|
-
'borderRight',
|
|
271
|
-
'var(--excel-sheet-border)'
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
225
|
break;
|
|
275
|
-
|
|
276
226
|
case 'border-right':
|
|
277
227
|
updatedCell.style = {
|
|
278
228
|
...currentCell.style,
|
|
279
|
-
borderRight: `
|
|
229
|
+
borderRight: `2px solid ${color}`,
|
|
280
230
|
};
|
|
281
231
|
break;
|
|
282
232
|
|
|
283
233
|
case 'border-left':
|
|
284
234
|
updatedCell.style = {
|
|
285
235
|
...currentCell.style,
|
|
286
|
-
borderLeft: `
|
|
236
|
+
borderLeft: `2px solid ${color}`,
|
|
287
237
|
};
|
|
288
|
-
if (col === startCol) {
|
|
289
|
-
adjacentCell(
|
|
290
|
-
row,
|
|
291
|
-
col - 1,
|
|
292
|
-
'borderRight',
|
|
293
|
-
'var(--excel-sheet-border)'
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
238
|
break;
|
|
297
239
|
case 'border-top':
|
|
298
240
|
updatedCell.style = {
|
|
299
241
|
...currentCell.style,
|
|
300
|
-
borderTop: `
|
|
242
|
+
borderTop: `2px solid ${color}`,
|
|
301
243
|
};
|
|
302
|
-
if (row === startRow) {
|
|
303
|
-
adjacentCell(
|
|
304
|
-
row - 1,
|
|
305
|
-
col,
|
|
306
|
-
'borderBottom',
|
|
307
|
-
'var(--excel-sheet-border)'
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
244
|
break;
|
|
311
245
|
case 'border-bottom':
|
|
312
246
|
updatedCell.style = {
|
|
313
247
|
...currentCell.style,
|
|
314
|
-
borderBottom: `
|
|
248
|
+
borderBottom: `2px solid ${color}`,
|
|
315
249
|
};
|
|
316
250
|
break;
|
|
317
251
|
default:
|
|
@@ -116,10 +116,6 @@ export type CellComponentProps<Cell extends CellBase = CellBase> = {
|
|
|
116
116
|
setCellDimensions: (point: Point, dimensions: Dimensions) => void;
|
|
117
117
|
/** Set data of the cell */
|
|
118
118
|
setCellData: (cell: Cell) => void;
|
|
119
|
-
|
|
120
|
-
setContextMenu: React.Dispatch<React.SetStateAction<ContextMenuState>>;
|
|
121
|
-
contextClick:(event: React.MouseEvent) => void
|
|
122
|
-
|
|
123
119
|
};
|
|
124
120
|
|
|
125
121
|
/** Type of the Spreadsheet Cell component */
|
|
@@ -136,7 +132,6 @@ export type DataViewerProps<Cell extends CellBase = CellBase> =
|
|
|
136
132
|
DataComponentProps<Cell> & {
|
|
137
133
|
/** Set data of the cell */
|
|
138
134
|
setCellData: (cell: Cell) => void;
|
|
139
|
-
setContextMenu: React.Dispatch<React.SetStateAction<ContextMenuState>>;
|
|
140
135
|
evaluatedCell: Cell | undefined;
|
|
141
136
|
};
|
|
142
137
|
|
|
@@ -27,143 +27,130 @@ type Story = StoryObj<typeof ExcelFile>;
|
|
|
27
27
|
|
|
28
28
|
export const Default: Story = {
|
|
29
29
|
args: {
|
|
30
|
-
excelData:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
wrapText: false,
|
|
56
|
-
},
|
|
30
|
+
excelData: [
|
|
31
|
+
{
|
|
32
|
+
sheetName: 'fireflink',
|
|
33
|
+
data: [
|
|
34
|
+
[
|
|
35
|
+
{
|
|
36
|
+
value: 'Test Sample Data 1',
|
|
37
|
+
style: {
|
|
38
|
+
name: 'Arial',
|
|
39
|
+
size: 11,
|
|
40
|
+
bold: true,
|
|
41
|
+
italic: false,
|
|
42
|
+
color: 'ffffff', // Sample data from backend without #
|
|
43
|
+
backgroundColor: '434db8', // Sample data from backend without #
|
|
44
|
+
borderColor: 'F2F2F2', // Sample data from backend without #
|
|
45
|
+
border: {
|
|
46
|
+
top: 'NONE',
|
|
47
|
+
bottom: 'NONE',
|
|
48
|
+
left: 'NONE',
|
|
49
|
+
right: 'NONE',
|
|
50
|
+
},
|
|
51
|
+
alignment: {
|
|
52
|
+
horizontal: 'GENERAL',
|
|
53
|
+
vertical: 'BOTTOM',
|
|
54
|
+
wrapText: false,
|
|
57
55
|
},
|
|
58
56
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
value: 'Test Data 2',
|
|
60
|
+
style: {
|
|
61
|
+
name: 'Arial',
|
|
62
|
+
size: 12,
|
|
63
|
+
bold: true,
|
|
64
|
+
italic: true,
|
|
65
|
+
color: 'EB5B00', // Sample data from backend without #
|
|
66
|
+
backgroundColor: '88C273', // Sample data from backend without #
|
|
67
|
+
borderColor: 'F2F2F2', // Sample data from backend without #
|
|
68
|
+
border: {
|
|
69
|
+
top: 'NONE',
|
|
70
|
+
bottom: 'NONE',
|
|
71
|
+
left: 'NONE',
|
|
72
|
+
right: 'NONE',
|
|
73
|
+
},
|
|
74
|
+
alignment: {
|
|
75
|
+
horizontal: 'GENERAL',
|
|
76
|
+
vertical: 'BOTTOM',
|
|
77
|
+
wrapText: false,
|
|
80
78
|
},
|
|
81
79
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
{
|
|
84
|
+
value: 'Test Data 3',
|
|
85
|
+
style: {
|
|
86
|
+
name: 'Arial',
|
|
87
|
+
size: 11,
|
|
88
|
+
bold: false,
|
|
89
|
+
italic: false,
|
|
90
|
+
color: '000000', // Sample data from backend without #
|
|
91
|
+
backgroundColor: 'EB5B00', // Sample data from backend without #
|
|
92
|
+
borderColor: 'F2F2F2', // Sample data from backend without #
|
|
93
|
+
border: {
|
|
94
|
+
top: 'NONE',
|
|
95
|
+
bottom: 'NONE',
|
|
96
|
+
left: 'NONE',
|
|
97
|
+
right: 'NONE',
|
|
98
|
+
},
|
|
99
|
+
alignment: {
|
|
100
|
+
horizontal: 'GENERAL',
|
|
101
|
+
vertical: 'BOTTOM',
|
|
102
|
+
wrapText: false,
|
|
105
103
|
},
|
|
106
104
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
value: 'Test Sample Data 4',
|
|
108
|
+
style: {
|
|
109
|
+
name: 'Arial',
|
|
110
|
+
size: 11,
|
|
111
|
+
bold: false,
|
|
112
|
+
italic: false,
|
|
113
|
+
color: '3D0301', // Sample data from backend without #
|
|
114
|
+
backgroundColor: 'C6E7FF', // Sample data from backend without #
|
|
115
|
+
borderColor: 'F2F2F2', // Sample data from backend without #
|
|
116
|
+
border: {
|
|
117
|
+
top: 'THIN',
|
|
118
|
+
bottom: 'THIN',
|
|
119
|
+
left: 'THIN',
|
|
120
|
+
right: 'THIN',
|
|
121
|
+
},
|
|
122
|
+
alignment: {
|
|
123
|
+
horizontal: 'GENERAL',
|
|
124
|
+
vertical: 'BOTTOM',
|
|
125
|
+
wrapText: false,
|
|
128
126
|
},
|
|
129
127
|
},
|
|
130
|
-
|
|
128
|
+
},
|
|
131
129
|
],
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
toolbar: 'show',
|
|
134
|
+
contextOption: {
|
|
135
|
+
open: true,
|
|
136
|
+
options: [
|
|
137
|
+
{
|
|
138
|
+
label: 'Get data from Header',
|
|
139
|
+
value: 'Get data from Header',
|
|
140
|
+
iconName: 'success',
|
|
141
|
+
action: () => {},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: 'Get Cell Value',
|
|
145
|
+
value: 'Get Cell Value',
|
|
146
|
+
iconName: 'success',
|
|
147
|
+
action: () => {},
|
|
132
148
|
},
|
|
133
149
|
],
|
|
134
150
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
name: 'first option',
|
|
139
|
-
title: 'Custom Option 1: Get Data',
|
|
140
|
-
action: () => {},
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
name: 'second option',
|
|
144
|
-
title: 'Custom Option 2',
|
|
145
|
-
action: () => {},
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
name: 'third option',
|
|
149
|
-
title: 'Custom Option 2',
|
|
150
|
-
action: () => {},
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
name: 'fourth option',
|
|
154
|
-
title: 'Custom Option 2',
|
|
155
|
-
action: () => {},
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: 'fifth option',
|
|
159
|
-
title: 'Custom Option 2',
|
|
160
|
-
action: () => {},
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
heightType:"page",
|
|
164
|
-
contextHeight:-220,
|
|
165
|
-
contextWidth:-180,
|
|
166
|
-
sheetHeight:"300px",
|
|
151
|
+
contextHeightPositioning: -220,
|
|
152
|
+
contextWidthPositioning: -180,
|
|
153
|
+
sheetHeight: '300px',
|
|
167
154
|
onSave: () => {},
|
|
168
155
|
},
|
|
169
156
|
};
|
|
@@ -123,7 +123,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
123
123
|
value: 'double_border',
|
|
124
124
|
label: 'Double Underline',
|
|
125
125
|
icon: 'double_underline',
|
|
126
|
-
}
|
|
126
|
+
},
|
|
127
127
|
];
|
|
128
128
|
|
|
129
129
|
const fontFamily = [
|
|
@@ -259,7 +259,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
259
259
|
<Tooltip placement="top" title={'Text Left'}>
|
|
260
260
|
<Icon
|
|
261
261
|
variant={cellStyle.textAlign === 'left' ? 'dark' : 'light'}
|
|
262
|
-
hoverEffect
|
|
262
|
+
hoverEffect={cellStyle.textAlign === 'left' ? false : true}
|
|
263
263
|
disabled={toolbar === 'disable'}
|
|
264
264
|
onClick={() => setTextAlign(data, 'left')}
|
|
265
265
|
name="text_align_left"
|
|
@@ -268,7 +268,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
268
268
|
<Tooltip placement="top" title={'Text Center'}>
|
|
269
269
|
<Icon
|
|
270
270
|
variant={cellStyle.textAlign === 'center' ? 'dark' : 'light'}
|
|
271
|
-
hoverEffect
|
|
271
|
+
hoverEffect={cellStyle.textAlign === 'center' ? false : true}
|
|
272
272
|
disabled={toolbar === 'disable'}
|
|
273
273
|
onClick={() => setTextAlign(data, 'center')}
|
|
274
274
|
name="text_align_center"
|
|
@@ -278,7 +278,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
278
278
|
<Tooltip placement="top" title={'Text Right'}>
|
|
279
279
|
<Icon
|
|
280
280
|
variant={cellStyle.textAlign === 'right' ? 'dark' : 'light'}
|
|
281
|
-
hoverEffect
|
|
281
|
+
hoverEffect={cellStyle.textAlign === 'right' ? false : true}
|
|
282
282
|
disabled={toolbar === 'disable'}
|
|
283
283
|
onClick={() => setTextAlign(data, 'right')}
|
|
284
284
|
name="text_align_right"
|
|
@@ -290,7 +290,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
290
290
|
<Tooltip placement="top" title={'Bold'}>
|
|
291
291
|
<Icon
|
|
292
292
|
variant={styleBackend.bold ? 'dark' : 'light'}
|
|
293
|
-
hoverEffect
|
|
293
|
+
hoverEffect={styleBackend.bold ? false : true}
|
|
294
294
|
disabled={toolbar === 'disable'}
|
|
295
295
|
onClick={() => onBold(data)}
|
|
296
296
|
name="bold"
|
|
@@ -298,8 +298,8 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
298
298
|
</Tooltip>
|
|
299
299
|
<Tooltip placement="top" title={'Italic'}>
|
|
300
300
|
<Icon
|
|
301
|
-
hoverEffect
|
|
302
301
|
variant={styleBackend.italic ? 'dark' : 'light'}
|
|
302
|
+
hoverEffect={styleBackend.italic ? false : true}
|
|
303
303
|
disabled={toolbar === 'disable'}
|
|
304
304
|
onClick={() => onItalic(data)}
|
|
305
305
|
name="italic"
|
|
@@ -311,7 +311,9 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
311
311
|
variant={
|
|
312
312
|
cellStyle.textDecoration === underLine ? 'dark' : 'light'
|
|
313
313
|
}
|
|
314
|
-
hoverEffect
|
|
314
|
+
hoverEffect={
|
|
315
|
+
cellStyle.textDecoration === underLine ? false : true
|
|
316
|
+
}
|
|
315
317
|
disabled={toolbar === 'disable'}
|
|
316
318
|
onClick={() => setUnderlineType(data, underLine, true)}
|
|
317
319
|
name={getUnderlineIcon()}
|
|
@@ -324,7 +326,6 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
324
326
|
iconSize={12}
|
|
325
327
|
options={underlineTypeIcon}
|
|
326
328
|
tooltipPlacement="top"
|
|
327
|
-
variant="light"
|
|
328
329
|
onOptionClick={(e) => {
|
|
329
330
|
let selectedValue = e.value as string;
|
|
330
331
|
setUnderlineType(data, selectedValue, true);
|
|
@@ -340,7 +341,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
340
341
|
<Tooltip placement="top" title={'Format Painter'}>
|
|
341
342
|
<Icon
|
|
342
343
|
variant={formattedStyle ? 'dark' : 'light'}
|
|
343
|
-
hoverEffect
|
|
344
|
+
hoverEffect={formattedStyle ? false : true}
|
|
344
345
|
disabled={toolbar === 'disable'}
|
|
345
346
|
onClick={() => {
|
|
346
347
|
setFormatePainter(data);
|
|
@@ -403,7 +404,6 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
403
404
|
zIndex={1000}
|
|
404
405
|
options={borderTypeIcon}
|
|
405
406
|
tooltipPlacement="top"
|
|
406
|
-
variant="light"
|
|
407
407
|
onOptionClick={(e) => {
|
|
408
408
|
let selectedValue = e.value as string;
|
|
409
409
|
setBorderType(data, selectedValue, 'black');
|
|
@@ -415,7 +415,6 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
415
415
|
</Tooltip>
|
|
416
416
|
</div>
|
|
417
417
|
|
|
418
|
-
|
|
419
418
|
{/* <div className="ff-excel-toolbar-divider"></div> TODO */}
|
|
420
419
|
{/* <div className="ff-excel-toolbar-menu">
|
|
421
420
|
<Tooltip placement="top" title={'Formula'}>
|
|
@@ -43,7 +43,7 @@ type BackendStyle = {
|
|
|
43
43
|
color: string;
|
|
44
44
|
backgroundColor: string;
|
|
45
45
|
borderColor: string;
|
|
46
|
-
underline:string;
|
|
46
|
+
underline: string;
|
|
47
47
|
border: {
|
|
48
48
|
top: string;
|
|
49
49
|
bottom: string;
|
|
@@ -79,20 +79,6 @@ interface ContextOption {
|
|
|
79
79
|
value: ContextAction[];
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
interface ContextMenuState {
|
|
83
|
-
/** Whether the context menu is visible */
|
|
84
|
-
visible: boolean;
|
|
85
|
-
|
|
86
|
-
/** X-coordinate position for the context menu */
|
|
87
|
-
x: number;
|
|
88
|
-
|
|
89
|
-
/** Y-coordinate position for the context menu */
|
|
90
|
-
y: number;
|
|
91
|
-
|
|
92
|
-
/** Type of the context menu ('cell', 'row', 'column', or 'sheet_options') */
|
|
93
|
-
type: 'cell' | 'row' | 'column' | 'sheet_options' | null;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
82
|
interface SelectedCell {
|
|
97
83
|
/** The row index of the selected cell */
|
|
98
84
|
row: number;
|
|
@@ -112,6 +98,22 @@ interface ColorContainer {
|
|
|
112
98
|
borderColor: string;
|
|
113
99
|
}
|
|
114
100
|
|
|
101
|
+
interface ContextMenuState {
|
|
102
|
+
open: boolean;
|
|
103
|
+
position: {
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
};
|
|
107
|
+
options: optionsType[];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface optionsType {
|
|
111
|
+
label: string;
|
|
112
|
+
value: string;
|
|
113
|
+
iconName: string;
|
|
114
|
+
action: () => void;
|
|
115
|
+
}
|
|
116
|
+
|
|
115
117
|
interface SelectedValue {
|
|
116
118
|
/** The value inside the selected cell */
|
|
117
119
|
value: string;
|