pixel-react-excel-sheet 1.0.39 → 1.0.40
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/Types.d.ts +1 -1
- package/lib/index.esm.js +6 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +6 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +4 -2
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +1 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +2 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +3 -0
- package/src/components/Excel/ExcelFile.stories.tsx +8 -4
- package/src/components/Excel/Types.ts +1 -1
package/package.json
CHANGED
|
@@ -131,7 +131,8 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
131
131
|
if (payload) {
|
|
132
132
|
const sheetNames = payload.map((e) => e.sheetName);
|
|
133
133
|
setSheetNames(sheetNames);
|
|
134
|
-
|
|
134
|
+
|
|
135
|
+
if (!checkEmpty(sheetNames.length)) {
|
|
135
136
|
pageRef.current = sheetNames[0] ? sheetNames[0] : ''; //Ternary is required, must use ''
|
|
136
137
|
setSelectedSheet({
|
|
137
138
|
name: sheetNames[0] ? sheetNames[0] : '', //Ternary is required, must use ''
|
|
@@ -152,6 +153,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
152
153
|
{ length: maxRows },
|
|
153
154
|
() => Array.from({ length: maxCols }, () => EmptyRow)
|
|
154
155
|
);
|
|
156
|
+
|
|
155
157
|
json.forEach((row, rowIndex) => {
|
|
156
158
|
row.forEach((cell, colIndex) => {
|
|
157
159
|
if (rowIndex < maxRows && colIndex < maxCols) {
|
|
@@ -160,7 +162,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
160
162
|
}
|
|
161
163
|
spreadsheetData[rowIndex][colIndex] = {
|
|
162
164
|
value: checkVal(cell.value),
|
|
163
|
-
style: convertStyleToFrontend(cell?.
|
|
165
|
+
style: convertStyleToFrontend(cell?.styles), //TODO remove 's' for Style
|
|
164
166
|
type: true,
|
|
165
167
|
};
|
|
166
168
|
}
|
|
@@ -136,6 +136,8 @@ const Spreadsheet = <CellType extends Types.CellBase>(
|
|
|
136
136
|
} = props;
|
|
137
137
|
type State = Types.StoreState<CellType>;
|
|
138
138
|
|
|
139
|
+
console.log(props.data);
|
|
140
|
+
|
|
139
141
|
const initialState = React.useMemo(() => {
|
|
140
142
|
const createParser = (props.createFormulaParser ||
|
|
141
143
|
createFormulaParser) as Types.CreateFormulaParser;
|
|
@@ -58,6 +58,9 @@ export default function reducer(
|
|
|
58
58
|
state: Types.StoreState,
|
|
59
59
|
action: Actions.Action
|
|
60
60
|
): Types.StoreState {
|
|
61
|
+
console.log(state.model);
|
|
62
|
+
console.log(action.type);
|
|
63
|
+
|
|
61
64
|
switch (action.type) {
|
|
62
65
|
case Actions.SET_AUTO_FILL: {
|
|
63
66
|
const { autofill } = action.payload;
|
|
@@ -34,7 +34,8 @@ export const Default: Story = {
|
|
|
34
34
|
[
|
|
35
35
|
{
|
|
36
36
|
value: 'Test Sample Data 1',
|
|
37
|
-
|
|
37
|
+
styles: {
|
|
38
|
+
//TODO remove 's' for Style
|
|
38
39
|
name: 'Arial',
|
|
39
40
|
size: 11,
|
|
40
41
|
bold: true,
|
|
@@ -57,7 +58,8 @@ export const Default: Story = {
|
|
|
57
58
|
},
|
|
58
59
|
{
|
|
59
60
|
value: 'Test Data 2',
|
|
60
|
-
|
|
61
|
+
styles: {
|
|
62
|
+
//TODO remove 's' for Style
|
|
61
63
|
name: 'Arial',
|
|
62
64
|
size: 12,
|
|
63
65
|
bold: true,
|
|
@@ -82,7 +84,8 @@ export const Default: Story = {
|
|
|
82
84
|
[
|
|
83
85
|
{
|
|
84
86
|
value: 'Test Data 3',
|
|
85
|
-
|
|
87
|
+
styles: {
|
|
88
|
+
//TODO remove 's' for Style
|
|
86
89
|
name: 'Arial',
|
|
87
90
|
size: 11,
|
|
88
91
|
bold: false,
|
|
@@ -105,7 +108,8 @@ export const Default: Story = {
|
|
|
105
108
|
},
|
|
106
109
|
{
|
|
107
110
|
value: 'Test Sample Data 4',
|
|
108
|
-
|
|
111
|
+
styles: {
|
|
112
|
+
//TODO remove 's' for Style
|
|
109
113
|
name: 'Arial',
|
|
110
114
|
size: 11,
|
|
111
115
|
bold: false,
|