pixel-react-excel-sheet 1.0.27 → 1.0.28

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.28",
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",
@@ -105,7 +105,7 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
105
105
 
106
106
  return (
107
107
  <th
108
- style={{ minWidth: `${columnWidth}px`}} //Dynamic value, Inline Styling required
108
+ style={{ minWidth: `${columnWidth}px`, position: 'sticky' }} //Dynamic value, Inline Styling required
109
109
  className={classNames('ff-spreadsheet-header', {
110
110
  'ff-spreadsheet-header--selected': selected,
111
111
  })}
@@ -113,11 +113,14 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
113
113
  onContextMenu={contextClick}
114
114
  tabIndex={0}
115
115
  >
116
- <div onClick={handleClick} onContextMenu={contextClick} tabIndex={0}>
117
- <Typography fontWeight="medium">
118
- {label !== undefined ? label : columnIndexToLabel(column)}
119
- </Typography>
116
+ <div
117
+ onClick={handleClick}
118
+ onContextMenu={contextClick}
119
+ tabIndex={0}>
120
120
  </div>
121
+ <Typography fontWeight='medium'>
122
+ {label !== undefined ? label : columnIndexToLabel(column)}
123
+ </Typography>
121
124
  <div
122
125
  onMouseDown={onMouseDown}
123
126
  onClick={() => activate({ row: -1, column })}
@@ -106,7 +106,7 @@ const RowIndicator: Types.RowIndicatorComponent = ({
106
106
  style={{
107
107
  height: `${rowHeight}px`,
108
108
  minWidth: '60px',
109
- }}
109
+ }} //Dynamic value, Inline Styling required
110
110
  className={classNames('ff-spreadsheet-header', {
111
111
  'ff-spreadsheet-header--selected': selected,
112
112
  })}
@@ -114,12 +114,9 @@ const RowIndicator: Types.RowIndicatorComponent = ({
114
114
  onContextMenu={contextClick}
115
115
  tabIndex={0}
116
116
  >
117
- <div style={{ position: 'sticky', zIndex: 2000 }}>
118
- <Typography fontWeight="medium">
119
- {label !== undefined ? label : row + 1}
120
- </Typography>
121
- </div>
122
-
117
+ <Typography fontWeight="medium">
118
+ {label !== undefined ? label : row + 1}
119
+ </Typography>
123
120
  <div
124
121
  onMouseDown={onMouseDown}
125
122
  onClick={() => activate({ row, column: -1 })}
@@ -3,6 +3,7 @@
3
3
  .ff-excel {
4
4
  display: flex;
5
5
  flex-direction: column;
6
+ width: 100%;
6
7
 
7
8
  .ff-excel-toolbar-container {
8
9
  position: relative;
@@ -28,6 +29,10 @@
28
29
  color: var(--text-color);
29
30
  scrollbar-width: none;
30
31
  display: inline-block;
32
+ width: 100%;
33
+ top: 0px;
34
+ left: 0px;
35
+
31
36
  }
32
37
 
33
38
  .ff-spreadsheet-active-cell {
@@ -43,6 +48,9 @@
43
48
 
44
49
  .ff-spreadsheet-table {
45
50
  overflow: scroll;
51
+ top: 0;
52
+ left: 0;
53
+ margin: 0;
46
54
  position: relative;
47
55
  &::-webkit-scrollbar {
48
56
  height: 0px;
@@ -89,11 +97,12 @@
89
97
  color: var(--readonly-text-color);
90
98
  text-align: center;
91
99
  z-index: 1000;
100
+ position: sticky;
92
101
  }
93
102
 
94
103
  .ff-spreadsheet-corner-header {
95
104
  position: fixed;
96
- z-index: 3000;
105
+ z-index: 2000;
97
106
  }
98
107
 
99
108
  .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}