pixel-react-excel-sheet 1.0.31 → 1.0.32
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/Charts/DashboardDonutChart/types.d.ts +1 -0
- package/lib/components/ConditionalDropdown/types.d.ts +1 -1
- package/lib/components/ConnectingBranch/ConnectingBranch.d.ts +2 -1
- package/lib/components/ConnectingBranch/data.d.ts +19 -33
- package/lib/components/ConnectingBranch/types.d.ts +10 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +7 -1
- package/lib/components/FileDropzone/types.d.ts +12 -4
- package/lib/components/MachineInputField/MachineInputField.d.ts +4 -1
- package/lib/components/Select/types.d.ts +1 -1
- package/lib/components/TextArea/Textarea.d.ts +1 -1
- package/lib/components/TextArea/Types.d.ts +1 -0
- package/lib/components/ThemeProvider/types.d.ts +1 -1
- package/lib/index.d.ts +88 -66
- package/lib/index.esm.js +175 -103
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +175 -103
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/validateFile/validateFile.d.ts +2 -0
- package/package.json +2 -2
- package/src/assets/Themes/BaseTheme.scss +1 -0
- package/src/assets/Themes/BlueTheme.scss +279 -0
- package/src/assets/Themes/DarkTheme.scss +1 -0
- package/src/assets/Themes/Theme.scss +5 -0
- package/src/components/AppHeader/AppHeader.tsx +4 -2
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +1 -0
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +3 -1
- package/src/components/Charts/DashboardDonutChart/types.ts +1 -0
- package/src/components/ConditionalDropdown/ConditionalDropdown.stories.tsx +1 -1
- package/src/components/ConditionalDropdown/types.ts +1 -1
- package/src/components/ConnectingBranch/BranchComponents/MachineInstances.tsx +94 -79
- package/src/components/ConnectingBranch/ConnectingBranch.scss +31 -45
- package/src/components/ConnectingBranch/ConnectingBranch.stories.tsx +33 -1
- package/src/components/ConnectingBranch/ConnectingBranch.tsx +36 -23
- package/src/components/ConnectingBranch/{data.ts → data.tsx} +106 -17
- package/src/components/ConnectingBranch/types.ts +21 -0
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +1 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +7 -5
- package/src/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.tsx +6 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +30 -11
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +65 -19
- package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +14 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +16 -0
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +6 -5
- package/src/components/FileDropzone/Dropzone.tsx +3 -0
- package/src/components/FileDropzone/FileDropzone.scss +18 -0
- package/src/components/FileDropzone/FileDropzone.stories.tsx +75 -7
- package/src/components/FileDropzone/FileDropzone.tsx +2 -0
- package/src/components/FileDropzone/RadioFilePreview.tsx +7 -3
- package/src/components/FileDropzone/types.ts +13 -4
- package/src/components/Icon/iconList.ts +2 -2
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +1 -1
- package/src/components/MachineInputField/MachineInputField.tsx +67 -70
- package/src/components/Search/Search.tsx +3 -1
- package/src/components/Select/types.ts +1 -1
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.scss +1 -0
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +2 -8
- package/src/components/TextArea/Textarea.tsx +2 -0
- package/src/components/TextArea/Types.ts +3 -0
- package/src/components/ThemeProvider/types.ts +1 -1
- package/src/utils/validateFile/validateFile.stories.tsx +49 -0
- package/src/utils/validateFile/validateFile.ts +39 -0
- package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.scss +0 -51
- package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.tsx +0 -107
- package/src/components/SequentialConnectingBranch/components/AddBrowserModal/types.ts +0 -5
- package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.scss +0 -31
- package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.tsx +0 -85
- package/src/components/SequentialConnectingBranch/components/DatasetListModal/types.ts +0 -4
- /package/src/assets/icons/{impactList.svg → impact_list.svg} +0 -0
|
@@ -11,7 +11,15 @@ const machineData = {
|
|
|
11
11
|
globalVariableSetId: 'UUID',
|
|
12
12
|
testDataSetId: 'UUID',
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
machineInstances: [],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
clientId: 'flinko-client-win-daa67320-d70c-438e-b417-62d76669e7a2',
|
|
18
|
+
executionDataSet: {
|
|
19
|
+
peVariableSetId: 'UUID',
|
|
20
|
+
globalVariableSetId: 'UUID',
|
|
21
|
+
testDataSetId: 'UUID',
|
|
22
|
+
},
|
|
15
23
|
machineInstances: [
|
|
16
24
|
{
|
|
17
25
|
clientId:
|
|
@@ -26,7 +34,22 @@ const machineData = {
|
|
|
26
34
|
osVersion: '10.0.22000',
|
|
27
35
|
hostName: 'LAPTOP-T793RVQN',
|
|
28
36
|
},
|
|
29
|
-
deviceInfo: [
|
|
37
|
+
deviceInfo: [
|
|
38
|
+
{
|
|
39
|
+
version: '10.0',
|
|
40
|
+
name: 'Samsung Galaxy Note 20 Ultra',
|
|
41
|
+
type: 'local',
|
|
42
|
+
subType: 'device',
|
|
43
|
+
platform: 'android',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
version: '18',
|
|
47
|
+
name: 'iPhone 14',
|
|
48
|
+
type: 'local',
|
|
49
|
+
subType: 'device',
|
|
50
|
+
platform: 'ios',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
30
53
|
headless: false,
|
|
31
54
|
runLevelExecutionDataSets: [
|
|
32
55
|
{
|
|
@@ -34,18 +57,57 @@ const machineData = {
|
|
|
34
57
|
globalVariableSetId: 'UUID',
|
|
35
58
|
testDataSetId: 'UUID',
|
|
36
59
|
runScriptCount: 12,
|
|
60
|
+
browserRenderer: `<div>browser</div>`,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
clientId: 'flinko-client-win-daa67320-d70c-438e-b417-62d76669e7a2',
|
|
68
|
+
executionDataSet: {
|
|
69
|
+
peVariableSetId: 'UUID',
|
|
70
|
+
globalVariableSetId: 'UUID',
|
|
71
|
+
testDataSetId: 'UUID',
|
|
72
|
+
},
|
|
73
|
+
machineInstances: [
|
|
74
|
+
{
|
|
75
|
+
clientId:
|
|
76
|
+
'flinko-client-win-daa67320-d70c-438e-b417-62d76669e7a2',
|
|
77
|
+
numberOfRuns: '3',
|
|
78
|
+
executionEnv: 'Local',
|
|
79
|
+
browserName: 'Google Chrome',
|
|
80
|
+
browserVersion: '107.0.5304.88',
|
|
81
|
+
systemUrl: '',
|
|
82
|
+
machineInfo: {
|
|
83
|
+
osName: 'Windows 11 Home Single Language',
|
|
84
|
+
osVersion: '10.0.22000',
|
|
85
|
+
hostName: 'LAPTOP-T793RVQN',
|
|
86
|
+
},
|
|
87
|
+
deviceInfo: [
|
|
88
|
+
{
|
|
89
|
+
version: '10.0',
|
|
90
|
+
name: 'Samsung Galaxy Note 20 Ultra',
|
|
91
|
+
type: 'local',
|
|
92
|
+
subType: 'device',
|
|
93
|
+
platform: 'android',
|
|
37
94
|
},
|
|
38
95
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
96
|
+
version: '18',
|
|
97
|
+
name: 'iPhone 14',
|
|
98
|
+
type: 'local',
|
|
99
|
+
subType: 'device',
|
|
100
|
+
platform: 'ios',
|
|
43
101
|
},
|
|
102
|
+
],
|
|
103
|
+
headless: false,
|
|
104
|
+
runLevelExecutionDataSets: [
|
|
44
105
|
{
|
|
45
106
|
peVariableSetId: 'UUID_1',
|
|
46
107
|
globalVariableSetId: 'UUID',
|
|
47
108
|
testDataSetId: 'UUID',
|
|
48
109
|
runScriptCount: 12,
|
|
110
|
+
browserRenderer: `<div>browser</div>`,
|
|
49
111
|
},
|
|
50
112
|
],
|
|
51
113
|
},
|
|
@@ -62,13 +124,30 @@ const machineData = {
|
|
|
62
124
|
osVersion: '10.0.22000',
|
|
63
125
|
hostName: 'LAPTOP-T793RVQN',
|
|
64
126
|
},
|
|
65
|
-
deviceInfo: [
|
|
127
|
+
deviceInfo: [
|
|
128
|
+
{
|
|
129
|
+
version: '10.0',
|
|
130
|
+
name: 'Samsung Galaxy Note 20 Ultra',
|
|
131
|
+
type: 'local',
|
|
132
|
+
subType: 'device',
|
|
133
|
+
platform: 'android',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
version: '18',
|
|
137
|
+
name: 'iPhone 14',
|
|
138
|
+
type: 'local',
|
|
139
|
+
subType: 'device',
|
|
140
|
+
platform: 'ios',
|
|
141
|
+
},
|
|
142
|
+
],
|
|
66
143
|
headless: false,
|
|
67
144
|
runLevelExecutionDataSets: [
|
|
68
145
|
{
|
|
69
146
|
peVariableSetId: 'UUID_1',
|
|
70
147
|
globalVariableSetId: 'UUID',
|
|
71
148
|
testDataSetId: 'UUID',
|
|
149
|
+
runScriptCount: 12,
|
|
150
|
+
executionDataSetId: 'uuid',
|
|
72
151
|
},
|
|
73
152
|
],
|
|
74
153
|
},
|
|
@@ -81,7 +160,6 @@ const machineData = {
|
|
|
81
160
|
globalVariableSetId: 'UUID',
|
|
82
161
|
testDataSetId: 'UUID',
|
|
83
162
|
},
|
|
84
|
-
totalScript: 250,
|
|
85
163
|
machineInstances: [
|
|
86
164
|
{
|
|
87
165
|
clientId:
|
|
@@ -96,33 +174,44 @@ const machineData = {
|
|
|
96
174
|
osVersion: '10.0.22000',
|
|
97
175
|
hostName: 'LAPTOP-T793RVQN',
|
|
98
176
|
},
|
|
99
|
-
deviceInfo: [
|
|
100
|
-
headless: false,
|
|
101
|
-
runLevelExecutionDataSets: [
|
|
177
|
+
deviceInfo: [
|
|
102
178
|
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
179
|
+
version: '10.0',
|
|
180
|
+
name: 'Samsung Galaxy Note 20 Ultra',
|
|
181
|
+
type: 'local',
|
|
182
|
+
subType: 'device',
|
|
183
|
+
platform: 'android',
|
|
106
184
|
},
|
|
107
185
|
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
186
|
+
version: '18',
|
|
187
|
+
name: 'iPhone 14',
|
|
188
|
+
type: 'local',
|
|
189
|
+
subType: 'device',
|
|
190
|
+
platform: 'ios',
|
|
111
191
|
},
|
|
192
|
+
],
|
|
193
|
+
headless: false,
|
|
194
|
+
runLevelExecutionDataSets: [
|
|
112
195
|
{
|
|
113
196
|
peVariableSetId: 'UUID_1',
|
|
114
197
|
globalVariableSetId: 'UUID',
|
|
115
198
|
testDataSetId: 'UUID',
|
|
199
|
+
runScriptCount: 12,
|
|
200
|
+
browserRenderer: `<div>browser</div>`,
|
|
116
201
|
},
|
|
117
202
|
{
|
|
118
203
|
peVariableSetId: 'UUID_1',
|
|
119
204
|
globalVariableSetId: 'UUID',
|
|
120
205
|
testDataSetId: 'UUID',
|
|
206
|
+
runScriptCount: 12,
|
|
207
|
+
browserRenderer: `<div>browser</div>`,
|
|
121
208
|
},
|
|
122
209
|
{
|
|
123
210
|
peVariableSetId: 'UUID_1',
|
|
124
211
|
globalVariableSetId: 'UUID',
|
|
125
212
|
testDataSetId: 'UUID',
|
|
213
|
+
runScriptCount: 12,
|
|
214
|
+
browserRenderer: `<div>browser</div>`,
|
|
126
215
|
},
|
|
127
216
|
],
|
|
128
217
|
},
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
|
|
1
3
|
type MachineInstanceData = any;
|
|
2
4
|
export interface MachineInstance {
|
|
3
5
|
[key: string]: MachineInstanceData;
|
|
@@ -9,13 +11,32 @@ export interface MachineData {
|
|
|
9
11
|
[key: string]: machineDataObj;
|
|
10
12
|
}
|
|
11
13
|
export interface MachineInstancesProps {
|
|
14
|
+
parentNode: number;
|
|
12
15
|
data: MachineData;
|
|
13
16
|
verticalLineHeight: number;
|
|
14
17
|
datasetHeight: number;
|
|
15
18
|
curveHeights: number[];
|
|
16
19
|
itemRefs: React.MutableRefObject<(HTMLDivElement | null)[]>;
|
|
17
20
|
datasetRef: React.RefObject<HTMLDivElement>;
|
|
21
|
+
getChildNodeComponent: (
|
|
22
|
+
isButton: boolean,
|
|
23
|
+
...args: any[]
|
|
24
|
+
) => ReactElement<any, any>;
|
|
18
25
|
}
|
|
19
26
|
|
|
20
27
|
export type indexType = number;
|
|
21
28
|
export type rowType = number;
|
|
29
|
+
|
|
30
|
+
export interface ConnectBranchProps {
|
|
31
|
+
data: MachineData;
|
|
32
|
+
childNodeCurveHeight?: number;
|
|
33
|
+
getParentNodeComponent: (
|
|
34
|
+
isMultiSelect: boolean,
|
|
35
|
+
...args: any[]
|
|
36
|
+
) => ReactElement<any, any>;
|
|
37
|
+
getParentNodeComponentActionItems: (...args: any[]) => ReactElement<any, any>;
|
|
38
|
+
getChildNodeComponent: (
|
|
39
|
+
isButton: boolean,
|
|
40
|
+
...args: any[]
|
|
41
|
+
) => ReactElement<any, any>;
|
|
42
|
+
}
|
|
@@ -118,7 +118,12 @@ const ActiveCell: React.FC<Props> = (props) => {
|
|
|
118
118
|
'ff-spreadsheet-active-cell',
|
|
119
119
|
`ff-spreadsheet-active-cell--${mode}`
|
|
120
120
|
)}
|
|
121
|
-
style={
|
|
121
|
+
style={{
|
|
122
|
+
top: dimensions?.top || 0,
|
|
123
|
+
height: (dimensions?.height ?? 0) + 1,
|
|
124
|
+
left: dimensions?.left || 0,
|
|
125
|
+
width: (dimensions?.width ?? 0) + 1,
|
|
126
|
+
}}
|
|
122
127
|
onClick={mode === 'view' && !readOnly ? edit : undefined}
|
|
123
128
|
tabIndex={0}
|
|
124
129
|
>
|
|
@@ -132,10 +137,7 @@ const ActiveCell: React.FC<Props> = (props) => {
|
|
|
132
137
|
exitEditMode={view}
|
|
133
138
|
/>
|
|
134
139
|
)}
|
|
135
|
-
<div
|
|
136
|
-
onMouseDown={handleMouseDown}
|
|
137
|
-
className="select_dot"
|
|
138
|
-
></div>
|
|
140
|
+
<div onMouseDown={handleMouseDown} className="select_dot"></div>
|
|
139
141
|
</div>
|
|
140
142
|
);
|
|
141
143
|
};
|
|
@@ -48,7 +48,12 @@ const FloatingRect: React.FC<Props> = ({
|
|
|
48
48
|
'ff-spreadsheet-floating-rect--dragging': dragging,
|
|
49
49
|
'ff-spreadsheet-floating-rect--hidden': hidden,
|
|
50
50
|
})}
|
|
51
|
-
style={{
|
|
51
|
+
style={{
|
|
52
|
+
width: (adjustedWidth ?? 0) + 1,
|
|
53
|
+
height: (adjustedHeight ?? 0) + 1,
|
|
54
|
+
top,
|
|
55
|
+
left,
|
|
56
|
+
}}
|
|
52
57
|
/>
|
|
53
58
|
);
|
|
54
59
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
.ff-excel {
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
|
+
height: 100%;
|
|
6
7
|
|
|
7
8
|
.ff-excel-toolbar-container {
|
|
8
9
|
position: relative;
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
margin-bottom: 20px;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
.ff-spreadsheet {
|
|
16
|
+
.ff-excel-spreadsheet {
|
|
16
17
|
--background-color: var(--drawer-footer-bg);
|
|
17
18
|
--text-color: var(--text-color);
|
|
18
19
|
--readonly-text-color: var(--toggle-strip-active);
|
|
@@ -30,10 +31,29 @@
|
|
|
30
31
|
display: inline-block;
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
.ff-excel-header-hider {
|
|
35
|
+
position: absolute;
|
|
36
|
+
background-color: var(--excel-header-border);
|
|
37
|
+
z-index: 500;
|
|
38
|
+
left: -1px;
|
|
39
|
+
top: 59px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ff-excel-header-column-hider {
|
|
43
|
+
height: 34px;
|
|
44
|
+
width: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ff-excel-header-row-hider {
|
|
48
|
+
bottom: 0px;
|
|
49
|
+
width: 60px;
|
|
50
|
+
}
|
|
51
|
+
|
|
33
52
|
.ff-spreadsheet-active-cell {
|
|
34
53
|
position: absolute;
|
|
35
|
-
border:
|
|
54
|
+
border: 1px solid var(--outline-color);
|
|
36
55
|
box-sizing: border-box;
|
|
56
|
+
z-index: 100;
|
|
37
57
|
}
|
|
38
58
|
|
|
39
59
|
.ff-spreadsheet-active-cell--edit {
|
|
@@ -87,7 +107,6 @@
|
|
|
87
107
|
}
|
|
88
108
|
|
|
89
109
|
.ff-spreadsheet-header {
|
|
90
|
-
border: 0.1px solid var(--border-color);
|
|
91
110
|
background-color: var(--header-background-color);
|
|
92
111
|
color: var(--readonly-text-color);
|
|
93
112
|
text-align: center;
|
|
@@ -99,7 +118,8 @@
|
|
|
99
118
|
|
|
100
119
|
.ff-spreadsheet-corner-header {
|
|
101
120
|
position: fixed;
|
|
102
|
-
z-index:
|
|
121
|
+
z-index: 2000;
|
|
122
|
+
border: 2px solid var(--border-color);
|
|
103
123
|
}
|
|
104
124
|
|
|
105
125
|
.ff-spreadsheet-row-header {
|
|
@@ -107,16 +127,15 @@
|
|
|
107
127
|
}
|
|
108
128
|
|
|
109
129
|
.corner-header {
|
|
110
|
-
border: 1px solid var(--border-color);
|
|
111
130
|
background-color: var(--header-background-color);
|
|
112
131
|
position: absolute;
|
|
113
132
|
display: flex;
|
|
114
133
|
align-items: center;
|
|
115
134
|
justify-content: center;
|
|
116
|
-
z-index:
|
|
117
|
-
top: -
|
|
118
|
-
width:
|
|
119
|
-
height:
|
|
135
|
+
z-index: 1500;
|
|
136
|
+
top: -2px;
|
|
137
|
+
width: 58px;
|
|
138
|
+
height: 32px;
|
|
120
139
|
left: -1px;
|
|
121
140
|
}
|
|
122
141
|
|
|
@@ -169,7 +188,7 @@
|
|
|
169
188
|
|
|
170
189
|
.ff-spreadsheet-floating-rect--selected {
|
|
171
190
|
background: var(--outline-background-color);
|
|
172
|
-
border:
|
|
191
|
+
border: 1px var(--outline-color) solid;
|
|
173
192
|
}
|
|
174
193
|
|
|
175
194
|
.ff-spreadsheet-floating-rect--dragging {
|
|
@@ -177,6 +196,6 @@
|
|
|
177
196
|
}
|
|
178
197
|
|
|
179
198
|
.ff-spreadsheet-floating-rect--copied {
|
|
180
|
-
border:
|
|
199
|
+
border: 1px var(--outline-color) dashed;
|
|
181
200
|
}
|
|
182
201
|
}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
calculateSpreadsheetSize,
|
|
16
16
|
getCSV,
|
|
17
17
|
shouldHandleClipboardEvent,
|
|
18
|
+
isFocusedWithin,
|
|
18
19
|
} from './util';
|
|
19
20
|
|
|
20
21
|
import DefaultTable from './Table';
|
|
@@ -98,7 +99,7 @@ export type Props<CellType extends Types.CellBase> = {
|
|
|
98
99
|
/** Callback called when the Spreadsheet's evaluated data changes. */
|
|
99
100
|
onEvaluatedDataChange?: (data: Matrix.Matrix<CellType>) => void;
|
|
100
101
|
setContextMenu: React.Dispatch<React.SetStateAction<Types.ContextMenuState>>;
|
|
101
|
-
|
|
102
|
+
/** Set your dynamic sheet Height*/
|
|
102
103
|
sheetHeight: string;
|
|
103
104
|
};
|
|
104
105
|
|
|
@@ -119,6 +120,8 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
119
120
|
HeaderRow = DefaultHeaderRow,
|
|
120
121
|
DataEditor = DefaultDataEditor,
|
|
121
122
|
DataViewer = DefaultDataViewer,
|
|
123
|
+
onSelect = () => {},
|
|
124
|
+
onActivate = () => {},
|
|
122
125
|
onEvaluatedDataChange = () => {},
|
|
123
126
|
} = props;
|
|
124
127
|
type State = Types.StoreState<CellType>;
|
|
@@ -162,6 +165,7 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
162
165
|
const copy = useAction(Actions.copy);
|
|
163
166
|
const paste = useAction(Actions.paste);
|
|
164
167
|
const onKeyDownAction = useAction(Actions.keyDown);
|
|
168
|
+
const onKeyPress = useAction(Actions.keyPress);
|
|
165
169
|
const onDragStart = useAction(Actions.dragStart);
|
|
166
170
|
const onDragEnd = useAction(Actions.dragEnd);
|
|
167
171
|
const setData = useAction(Actions.setData);
|
|
@@ -183,6 +187,23 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
183
187
|
const deleteRow = useAction(Actions.deleteRow);
|
|
184
188
|
const deleteColumn = useAction(Actions.deleteColumn);
|
|
185
189
|
|
|
190
|
+
// Track active
|
|
191
|
+
const prevActiveRef = React.useRef<Point.Point | null>(state.active);
|
|
192
|
+
React.useEffect(() => {
|
|
193
|
+
if (state.active !== prevActiveRef.current) {
|
|
194
|
+
if (state.active) {
|
|
195
|
+
onActivate(state.active);
|
|
196
|
+
} else {
|
|
197
|
+
const root = rootRef.current;
|
|
198
|
+
if (root && isFocusedWithin(root) && document.activeElement) {
|
|
199
|
+
(document.activeElement as HTMLElement).blur();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
prevActiveRef.current = state.active;
|
|
205
|
+
}, [onActivate, state.active]);
|
|
206
|
+
|
|
186
207
|
const prevEvaluatedDataRef = React.useRef<Matrix.Matrix<CellType>>(
|
|
187
208
|
state.model.evaluatedData
|
|
188
209
|
);
|
|
@@ -194,6 +215,17 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
194
215
|
prevEvaluatedDataRef.current = state.model.evaluatedData;
|
|
195
216
|
}, [state?.model?.evaluatedData, onEvaluatedDataChange]);
|
|
196
217
|
|
|
218
|
+
const prevSelectedRef = React.useRef<Selection>(state.selected);
|
|
219
|
+
React.useEffect(() => {
|
|
220
|
+
if (!state.selected.equals(prevSelectedRef.current)) {
|
|
221
|
+
if (!props.selected || !state.selected.equals(props.selected)) {
|
|
222
|
+
onSelect(state.selected);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
prevSelectedRef.current = state.selected;
|
|
227
|
+
}, [state.selected, onSelect, props.selected]);
|
|
228
|
+
|
|
197
229
|
// Update selection when props.selected changes
|
|
198
230
|
const prevSelectedPropRef = React.useRef<Selection | undefined>(
|
|
199
231
|
props.selected
|
|
@@ -446,25 +478,32 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
446
478
|
const rootNode = React.useMemo(
|
|
447
479
|
() => (
|
|
448
480
|
<div className="ff-excel">
|
|
449
|
-
|
|
450
|
-
<
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
481
|
+
<div className="ff-excel-header-hider ff-excel-header-column-hider"></div>
|
|
482
|
+
<div className="ff-excel-header-hider ff-excel-header-row-hider"></div>
|
|
483
|
+
<div className="ff-excel-toolbar-container">
|
|
484
|
+
<ExcelToolBar
|
|
485
|
+
onBold={onBold}
|
|
486
|
+
onItalic={onItalic}
|
|
487
|
+
setUnderlineType={setUnderlineType}
|
|
488
|
+
setColor={setColor}
|
|
489
|
+
setBorderType={setBorderType}
|
|
490
|
+
setFontSize={setFontSize}
|
|
491
|
+
setFontFamily={setFontFamily}
|
|
492
|
+
setTextAlign={setTextAlign}
|
|
493
|
+
setBackgroundColor={setBackgroundColor}
|
|
494
|
+
setFormatePainter={setFormatePainter}
|
|
495
|
+
/>
|
|
496
|
+
</div>
|
|
463
497
|
<div
|
|
464
498
|
ref={rootRef}
|
|
465
|
-
style={{height:sheetHeight}}
|
|
466
|
-
className={classNames('ff-spreadsheet', className)}
|
|
467
|
-
|
|
499
|
+
style={{ height: sheetHeight }}
|
|
500
|
+
className={classNames('ff-excel-spreadsheet', className)}
|
|
501
|
+
onKeyPress={(e) => {
|
|
502
|
+
onKeyPress(e);
|
|
503
|
+
}}
|
|
504
|
+
onKeyDown={(e) => {
|
|
505
|
+
handleKeyDown(e);
|
|
506
|
+
}}
|
|
468
507
|
onMouseMove={handleMouseMove}
|
|
469
508
|
>
|
|
470
509
|
{tableNode}
|
|
@@ -474,7 +513,14 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
474
513
|
</div>
|
|
475
514
|
</div>
|
|
476
515
|
),
|
|
477
|
-
[
|
|
516
|
+
[
|
|
517
|
+
className,
|
|
518
|
+
onKeyPress,
|
|
519
|
+
handleKeyDown,
|
|
520
|
+
handleMouseMove,
|
|
521
|
+
tableNode,
|
|
522
|
+
activeCellNode,
|
|
523
|
+
]
|
|
478
524
|
);
|
|
479
525
|
|
|
480
526
|
return (
|
|
@@ -298,6 +298,19 @@ export type SetDataAction = BaseAction<typeof SET_DATA> & {
|
|
|
298
298
|
};
|
|
299
299
|
};
|
|
300
300
|
|
|
301
|
+
export type KeyPressAction = BaseAction<typeof KEY_PRESS> & {
|
|
302
|
+
payload: {
|
|
303
|
+
event: React.KeyboardEvent;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export function keyPress(event: React.KeyboardEvent): KeyPressAction {
|
|
308
|
+
return {
|
|
309
|
+
type: KEY_PRESS,
|
|
310
|
+
payload: { event },
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
|
|
301
314
|
export function setData(data: Matrix<CellBase>): SetDataAction {
|
|
302
315
|
return {
|
|
303
316
|
type: SET_DATA,
|
|
@@ -544,6 +557,7 @@ export type Action =
|
|
|
544
557
|
| UnderlineTypeStyle
|
|
545
558
|
| FontSize
|
|
546
559
|
| FontFamily
|
|
560
|
+
| KeyPressAction
|
|
547
561
|
| TextAlignType
|
|
548
562
|
| BorderType
|
|
549
563
|
| ItalicStyle
|
|
@@ -582,6 +582,22 @@ export default function reducer(
|
|
|
582
582
|
return blur(state);
|
|
583
583
|
}
|
|
584
584
|
|
|
585
|
+
case Actions.KEY_PRESS: {
|
|
586
|
+
const { event } = action.payload;
|
|
587
|
+
|
|
588
|
+
if (isActiveReadOnly(state) || event.metaKey) {
|
|
589
|
+
return state;
|
|
590
|
+
}
|
|
591
|
+
if (state.mode === 'view' && state.active) {
|
|
592
|
+
const selectedRange = state.selected.toRange(state.model.data);
|
|
593
|
+
if (selectedRange?.size() === 1) {
|
|
594
|
+
return edit(clear(state));
|
|
595
|
+
}
|
|
596
|
+
return edit(state);
|
|
597
|
+
}
|
|
598
|
+
return state;
|
|
599
|
+
}
|
|
600
|
+
|
|
585
601
|
case Actions.KEY_DOWN: {
|
|
586
602
|
const { event } = action.payload;
|
|
587
603
|
const handler = getKeyDownHandler(state, event);
|
|
@@ -123,8 +123,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
123
123
|
value: 'double_border',
|
|
124
124
|
label: 'Double Underline',
|
|
125
125
|
icon: 'double_underline',
|
|
126
|
-
}
|
|
127
|
-
{ value: 'line-through', label: 'Strikethrough', icon: 'strike_through' },
|
|
126
|
+
}
|
|
128
127
|
];
|
|
129
128
|
|
|
130
129
|
const fontFamily = [
|
|
@@ -415,8 +414,10 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
415
414
|
</div>
|
|
416
415
|
</Tooltip>
|
|
417
416
|
</div>
|
|
418
|
-
|
|
419
|
-
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
{/* <div className="ff-excel-toolbar-divider"></div> TODO */}
|
|
420
|
+
{/* <div className="ff-excel-toolbar-menu">
|
|
420
421
|
<Tooltip placement="top" title={'Formula'}>
|
|
421
422
|
<Icon
|
|
422
423
|
hoverEffect
|
|
@@ -425,7 +426,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
425
426
|
name="formula_icon"
|
|
426
427
|
/>
|
|
427
428
|
</Tooltip>
|
|
428
|
-
</div>
|
|
429
|
+
</div> TODO */}
|
|
429
430
|
</div>
|
|
430
431
|
);
|
|
431
432
|
};
|
|
@@ -24,6 +24,7 @@ const Dropzone: FC<DroppableProps> = ({
|
|
|
24
24
|
setSelectedFile,
|
|
25
25
|
handleRemoveFile,
|
|
26
26
|
isDisable,
|
|
27
|
+
setShowDrawer,
|
|
27
28
|
}) => {
|
|
28
29
|
const isWebServiceFile = selectedFile?.name && isWebServiceFileDropZone;
|
|
29
30
|
return (
|
|
@@ -42,6 +43,8 @@ const Dropzone: FC<DroppableProps> = ({
|
|
|
42
43
|
onFileRemoveClick={handleRemoveFile}
|
|
43
44
|
onFileReplaceClick={setSelectedFile}
|
|
44
45
|
setSelectedFile={setSelectedFile}
|
|
46
|
+
selectedRadioOption={selectedRadioOption}
|
|
47
|
+
setShowDrawer={setShowDrawer}
|
|
45
48
|
/>
|
|
46
49
|
) : (
|
|
47
50
|
<>
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
gap: $gap;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
@mixin flex-center {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
7
13
|
@mixin center {
|
|
8
14
|
display: grid;
|
|
9
15
|
place-items: center;
|
|
@@ -160,4 +166,16 @@
|
|
|
160
166
|
.ff-disable-file-dropzone-wrapper {
|
|
161
167
|
opacity: 0.5;
|
|
162
168
|
cursor: not-allowed;
|
|
169
|
+
}
|
|
170
|
+
.footer_basic_button {
|
|
171
|
+
width: 100%;
|
|
172
|
+
position: absolute;
|
|
173
|
+
bottom: 0;
|
|
174
|
+
right: 0;
|
|
175
|
+
@include flex-center;
|
|
176
|
+
justify-content: flex-end;
|
|
177
|
+
gap: 16px;
|
|
178
|
+
border-top: 1px solid var(--border-color);
|
|
179
|
+
padding: 4px 8px;
|
|
180
|
+
background-color: var(--primary-icon-color);
|
|
163
181
|
}
|