pixel-react-excel-sheet 1.0.27 → 1.0.29

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,13 +1,13 @@
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.27",
4
+ "version": "1.0.29",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "author": {
9
9
  "name": "thaneshwaran"
10
- },
10
+ },
11
11
  "license": "MIT",
12
12
  "devDependencies": {
13
13
  "@babel/preset-react": "^7.25.9",
@@ -5,7 +5,6 @@ import * as Point from './point';
5
5
  import * as Actions from './actions';
6
6
  import useDispatch from './use-dispatch';
7
7
  import useSelector from './use-selector';
8
- import Typography from '../../../Typography';
9
8
 
10
9
  const ColumnIndicator: Types.ColumnIndicatorComponent = ({
11
10
  column,
@@ -113,11 +112,7 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
113
112
  onContextMenu={contextClick}
114
113
  tabIndex={0}
115
114
  >
116
- <div onClick={handleClick} onContextMenu={contextClick} tabIndex={0}>
117
- <Typography fontWeight="medium">
118
- {label !== undefined ? label : columnIndexToLabel(column)}
119
- </Typography>
120
- </div>
115
+ {label !== undefined ? label : columnIndexToLabel(column)}
121
116
  <div
122
117
  onMouseDown={onMouseDown}
123
118
  onClick={() => activate({ row: -1, column })}
@@ -132,6 +127,31 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
132
127
  }}
133
128
  />
134
129
  </th>
130
+
131
+ // <th
132
+ // style={{ minWidth: `${columnWidth}px`}} //Dynamic value, Inline Styling required
133
+ // className={classNames('ff-spreadsheet-header', {
134
+ // 'ff-spreadsheet-header--selected': selected,
135
+ // })}
136
+ // onClick={handleClick}
137
+ // onContextMenu={contextClick}
138
+ // tabIndex={0}
139
+ // >
140
+ // {label !== undefined ? label : columnIndexToLabel(column)}
141
+ // <div
142
+ // onMouseDown={onMouseDown}
143
+ // onClick={() => activate({ row: -1, column })}
144
+ // style={{
145
+ // zIndex: 'inherit',
146
+ // width: '2px',
147
+ // position: 'absolute',
148
+ // right: 0,
149
+ // top: 0,
150
+ // height: '100%',
151
+ // cursor: 'ew-resize',
152
+ // }}
153
+ // />
154
+ // </th>
135
155
  );
136
156
  };
137
157
 
@@ -106,7 +106,8 @@ const RowIndicator: Types.RowIndicatorComponent = ({
106
106
  style={{
107
107
  height: `${rowHeight}px`,
108
108
  minWidth: '60px',
109
- }}
109
+ position: 'relative',
110
+ }} //Dynamic value, Inline Styling required
110
111
  className={classNames('ff-spreadsheet-header', {
111
112
  'ff-spreadsheet-header--selected': selected,
112
113
  })}
@@ -114,12 +115,9 @@ const RowIndicator: Types.RowIndicatorComponent = ({
114
115
  onContextMenu={contextClick}
115
116
  tabIndex={0}
116
117
  >
117
- <div style={{ position: 'sticky', zIndex: 2000 }}>
118
- <Typography fontWeight="medium">
119
- {label !== undefined ? label : row + 1}
120
- </Typography>
121
- </div>
122
-
118
+ <Typography fontWeight="medium">
119
+ {label !== undefined ? label : row + 1}
120
+ </Typography>
123
121
  <div
124
122
  onMouseDown={onMouseDown}
125
123
  onClick={() => activate({ row, column: -1 })}
@@ -43,6 +43,9 @@
43
43
 
44
44
  .ff-spreadsheet-table {
45
45
  overflow: scroll;
46
+ top: 0;
47
+ left: 0;
48
+ margin: 0;
46
49
  position: relative;
47
50
  &::-webkit-scrollbar {
48
51
  height: 0px;
@@ -89,11 +92,12 @@
89
92
  color: var(--readonly-text-color);
90
93
  text-align: center;
91
94
  z-index: 1000;
95
+ position: sticky;
92
96
  }
93
97
 
94
98
  .ff-spreadsheet-corner-header {
95
99
  position: fixed;
96
- z-index: 3000;
100
+ z-index: 2000;
97
101
  }
98
102
 
99
103
  .ff-spreadsheet-row-header {
@@ -98,7 +98,7 @@ 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*/
101
+ /** Set your dynamic sheet Height*/
102
102
  sheetHeight: string;
103
103
  };
104
104
 
@@ -446,23 +446,23 @@ const Spreadsheet = <CellType extends Types.CellBase>(
446
446
  const rootNode = React.useMemo(
447
447
  () => (
448
448
  <div className="ff-excel">
449
- <div className="ff-excel-toolbar-container">
450
- <ExcelToolBar
451
- onBold={onBold}
452
- onItalic={onItalic}
453
- setUnderlineType={setUnderlineType}
454
- setColor={setColor}
455
- setBorderType={setBorderType}
456
- setFontSize={setFontSize}
457
- setFontFamily={setFontFamily}
458
- setTextAlign={setTextAlign}
459
- setBackgroundColor={setBackgroundColor}
460
- setFormatePainter={setFormatePainter}
461
- />
462
- </div>
449
+ <div className="ff-excel-toolbar-container">
450
+ <ExcelToolBar
451
+ onBold={onBold}
452
+ onItalic={onItalic}
453
+ setUnderlineType={setUnderlineType}
454
+ setColor={setColor}
455
+ setBorderType={setBorderType}
456
+ setFontSize={setFontSize}
457
+ setFontFamily={setFontFamily}
458
+ setTextAlign={setTextAlign}
459
+ setBackgroundColor={setBackgroundColor}
460
+ setFormatePainter={setFormatePainter}
461
+ />
462
+ </div>
463
463
  <div
464
464
  ref={rootRef}
465
- style={{ height: sheetHeight }}
465
+ style={{height:sheetHeight}}
466
466
  className={classNames('ff-spreadsheet', className)}
467
467
  onKeyDown={handleKeyDown}
468
468
  onMouseMove={handleMouseMove}