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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pixel-react-excel-sheet",
3
3
  "description": "Great for pixel-perfect, design-focused components in React",
4
- "version": "1.0.39",
4
+ "version": "1.0.40",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
7
7
  "types": "lib/index.d.ts",
@@ -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
- if (checkEmpty(sheetNames.length)) {
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?.style),
165
+ style: convertStyleToFrontend(cell?.styles), //TODO remove 's' for Style
164
166
  type: true,
165
167
  };
166
168
  }
@@ -70,7 +70,7 @@ export const Cell: React.FC<Types.CellComponentProps> = ({
70
70
  if (data && data.DataViewer) {
71
71
  // @ts-ignore
72
72
  DataViewer = data.DataViewer;
73
- }
73
+ }
74
74
 
75
75
  return (
76
76
  <td
@@ -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
- style: {
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
- style: {
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
- style: {
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
- style: {
111
+ styles: {
112
+ //TODO remove 's' for Style
109
113
  name: 'Arial',
110
114
  size: 11,
111
115
  bold: false,
@@ -31,7 +31,7 @@ interface WorkData {
31
31
  value: string;
32
32
 
33
33
  /** Styling options for the cell */
34
- style: BackendStyle;
34
+ styles: BackendStyle; //TODO remove 's' for Style
35
35
  type?: boolean;
36
36
  }
37
37