pixel-react-excel-sheet 1.0.25 → 1.0.27

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.25",
4
+ "version": "1.0.27",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
7
7
  "types": "lib/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  flex: 1 1 auto;
37
37
  overflow: hidden;
38
38
  transition: flex-grow 1s ease, opacity 1s ease, max-width 1s ease;
39
- max-width: 100px; /* Initial max-width */
39
+ max-width: 150px; /* Initial max-width */
40
40
  &:not(.ff-app-header-nav-bar-item--selected):hover::after {
41
41
  animation: oscillate-border-width 0.5s ease-in-out forwards;
42
42
  }
@@ -60,7 +60,7 @@
60
60
  background-color: var(--primary-icon-color);
61
61
  border-radius: 20px;
62
62
  flex-grow: 12; /* Increase size on hover */
63
- max-width: 550px;
63
+ max-width: 700px;
64
64
  opacity: 1;
65
65
  .ff-app-header-nav-bar-item-label {
66
66
  box-shadow: 0px 4px 4px 0px #00000040 inset;
@@ -135,23 +135,22 @@ const ConditionalDropdown: React.FC<ConditionalDropdownProps> = ({
135
135
  />
136
136
  )}
137
137
  </div>
138
- {showDropdown && (
139
- isHash ? (
140
- <OptionsDropdown
141
- position="relative"
142
- width={dropdownWidth}
143
- filteredOptions={filteredOptions}
144
- onSelectVariable={handleDropdownClick}
145
- />
146
- ) : (
147
- <VariableDropdown
148
- position="relative"
149
- width={dropdownWidth}
150
- optionsList={variableList}
151
- onSelectVariable={handleDropdownClick}
152
- />
153
- )
154
- )}
138
+ {showDropdown &&
139
+ (isHash ? (
140
+ <OptionsDropdown
141
+ position="relative"
142
+ width={dropdownWidth}
143
+ filteredOptions={filteredOptions}
144
+ onSelectVariable={handleDropdownClick}
145
+ />
146
+ ) : (
147
+ <VariableDropdown
148
+ position="absolute"
149
+ width={dropdownWidth}
150
+ optionsList={variableList}
151
+ onSelectVariable={handleDropdownClick}
152
+ />
153
+ ))}
155
154
  </div>
156
155
  );
157
156
  };
@@ -99,7 +99,6 @@
99
99
  }
100
100
  .ff-custom-header {
101
101
  background-color: var(--drawer-footer-bg);
102
- padding: 4px 8px;
103
102
  width: 100%;
104
103
  }
105
104
  }
@@ -132,7 +131,8 @@
132
131
  }
133
132
  .ff-custom-footer {
134
133
  background-color: var(--drawer-footer-bg);
135
- padding: 4px 8px;
134
+ width: 100%;
135
+ border-radius: 0 0 8px 8px;
136
136
  }
137
137
  }
138
138
  }
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { Meta, StoryObj } from '@storybook/react';
2
3
  import Drawer from './Drawer';
3
4
  import { useState } from 'react';
@@ -39,6 +39,7 @@ const Drawer: FC<DrawerProps> = ({
39
39
  height,
40
40
  width,
41
41
  right = 0,
42
+ overflow,
42
43
  }: DrawerProps) => {
43
44
  const [isExpanded, setIsExpanded] = useState(false);
44
45
 
@@ -88,7 +89,7 @@ const Drawer: FC<DrawerProps> = ({
88
89
  className={classNames('ff-drawer', `ff-drawer--${drawerSize}`, {
89
90
  'ff-drawer--open': isOpen,
90
91
  })}
91
- style={{ zIndex, top, height, width, right }}
92
+ style={{ zIndex, top, height, width, right, overflow }}
92
93
  >
93
94
  {showHeader && (
94
95
  <div
@@ -154,4 +154,8 @@ export interface DrawerProps {
154
154
  * Position from right
155
155
  */
156
156
  right?: string | number;
157
+ /**
158
+ * Custom overflow for the drawer
159
+ */
160
+ overflow?: string;
157
161
  }
@@ -10,6 +10,7 @@
10
10
  overflow-y: auto;
11
11
  &.absolute {
12
12
  position: absolute;
13
+ top: 34px;
13
14
  }
14
15
  &.relative {
15
16
  position: relative;
@@ -105,7 +105,7 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
105
105
 
106
106
  return (
107
107
  <th
108
- style={{ minWidth: `${columnWidth}px`, position: 'sticky' }} //Dynamic value, Inline Styling required
108
+ style={{ minWidth: `${columnWidth}px`}} //Dynamic value, Inline Styling required
109
109
  className={classNames('ff-spreadsheet-header', {
110
110
  'ff-spreadsheet-header--selected': selected,
111
111
  })}
@@ -113,14 +113,11 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
113
113
  onContextMenu={contextClick}
114
114
  tabIndex={0}
115
115
  >
116
- <div
117
- onClick={handleClick}
118
- onContextMenu={contextClick}
119
- tabIndex={0}>
116
+ <div onClick={handleClick} onContextMenu={contextClick} tabIndex={0}>
117
+ <Typography fontWeight="medium">
118
+ {label !== undefined ? label : columnIndexToLabel(column)}
119
+ </Typography>
120
120
  </div>
121
- <Typography fontWeight='medium'>
122
- {label !== undefined ? label : columnIndexToLabel(column)}
123
- </Typography>
124
121
  <div
125
122
  onMouseDown={onMouseDown}
126
123
  onClick={() => activate({ row: -1, column })}
@@ -1,5 +1,7 @@
1
1
  import * as Types from './types';
2
2
 
3
- const HeaderRow: Types.HeaderRowComponent = (props) => <tr style={{position:'relative',height:"34px"}} {...props} />;
3
+ const HeaderRow: Types.HeaderRowComponent = (props) => (
4
+ <tr className="ff-spreadsheet-row-header" {...props} />
5
+ );
4
6
 
5
7
  export default HeaderRow;
@@ -106,8 +106,7 @@ const RowIndicator: Types.RowIndicatorComponent = ({
106
106
  style={{
107
107
  height: `${rowHeight}px`,
108
108
  minWidth: '60px',
109
- position: 'relative',
110
- }} //Dynamic value, Inline Styling required
109
+ }}
111
110
  className={classNames('ff-spreadsheet-header', {
112
111
  'ff-spreadsheet-header--selected': selected,
113
112
  })}
@@ -115,9 +114,12 @@ const RowIndicator: Types.RowIndicatorComponent = ({
115
114
  onContextMenu={contextClick}
116
115
  tabIndex={0}
117
116
  >
118
- <Typography fontWeight="medium">
119
- {label !== undefined ? label : row + 1}
120
- </Typography>
117
+ <div style={{ position: 'sticky', zIndex: 2000 }}>
118
+ <Typography fontWeight="medium">
119
+ {label !== undefined ? label : row + 1}
120
+ </Typography>
121
+ </div>
122
+
121
123
  <div
122
124
  onMouseDown={onMouseDown}
123
125
  onClick={() => activate({ row, column: -1 })}
@@ -24,8 +24,6 @@
24
24
 
25
25
  position: relative;
26
26
  overflow: scroll;
27
- left: 0;
28
- top: 0;
29
27
  background: var(--background-color);
30
28
  color: var(--text-color);
31
29
  scrollbar-width: none;
@@ -45,135 +43,135 @@
45
43
 
46
44
  .ff-spreadsheet-table {
47
45
  overflow: scroll;
48
- top: 0;
49
- left: 0;
50
- margin: 0;
51
46
  position: relative;
52
47
  &::-webkit-scrollbar {
53
48
  height: 0px;
54
49
  }
55
50
  border-collapse: collapse;
56
51
  table-layout: fixed;
52
+ }
53
+ .ff-spreadsheet-cell {
54
+ outline: none;
55
+ position: relative;
56
+ z-index: 0;
57
+ }
57
58
 
58
- .ff-spreadsheet-cell {
59
- outline: none;
60
- position: relative;
61
- z-index: 0;
62
- }
59
+ .ff-spreadsheet-active-cell .select_dot {
60
+ background-color: var(--elevation);
61
+ height: 10px;
62
+ width: 10px;
63
+ border-radius: 50%;
64
+ position: absolute;
65
+ bottom: -5px;
66
+ right: -5px;
67
+ cursor: crosshair;
68
+ z-index: 1000;
69
+ }
63
70
 
64
- .ff-spreadsheet-active-cell .select_dot {
65
- background-color: var(--elevation);
66
- height: 10px;
67
- width: 10px;
68
- border-radius: 50%;
69
- position: absolute;
70
- bottom: -5px;
71
- right: -5px;
72
- cursor: crosshair;
73
- z-index: 1000;
74
- }
71
+ .ff-spreadsheet-cell--readonly {
72
+ color: var(--readonly-text-color);
73
+ }
75
74
 
76
- .ff-spreadsheet-cell--readonly {
77
- color: var(--readonly-text-color);
78
- }
75
+ .ff-spreadsheet-cell,
76
+ .ff-spreadsheet-header {
77
+ border: 0.1px solid var(--border-color);
78
+ overflow: hidden;
79
+ word-break: keep-all;
80
+ white-space: nowrap;
81
+ text-align: left;
82
+ box-sizing: border-box;
83
+ user-select: none;
84
+ }
79
85
 
80
- .ff-spreadsheet-cell,
81
- .ff-spreadsheet-header {
82
- border: 0.1px solid var(--border-color);
83
- overflow: hidden;
84
- word-break: keep-all;
85
- white-space: nowrap;
86
- text-align: left;
87
- box-sizing: border-box;
88
- user-select: none;
89
- }
86
+ .ff-spreadsheet-header {
87
+ border: 0.1px solid var(--border-color);
88
+ background-color: var(--header-background-color);
89
+ color: var(--readonly-text-color);
90
+ text-align: center;
91
+ z-index: 1000;
92
+ }
90
93
 
91
- .ff-spreadsheet-header {
92
- border: 0.1px solid var(--border-color);
93
- background-color: var(--header-background-color);
94
- color: var(--readonly-text-color);
95
- text-align: center;
96
- z-index: 1000;
97
- position: sticky;
98
- }
94
+ .ff-spreadsheet-corner-header {
95
+ position: fixed;
96
+ z-index: 3000;
97
+ }
99
98
 
100
- .ff-spreadsheet-corner-header {
101
- position: fixed;
102
- z-index: 2000;
103
- }
99
+ .ff-spreadsheet-row-header {
100
+ // position: relative;
101
+ height: 34px;
102
+ }
104
103
 
105
- .corner-header {
106
- border: 0.1px solid var(--border-color);
107
- background-color: var(--header-background-color);
108
- position: absolute;
109
- display: flex;
110
- align-items: center;
111
- justify-content: center;
112
- z-index: 1100;
113
- top: -1px;
114
- width: 60px;
115
- height: 34px;
116
- left: -1px;
117
- }
104
+ .corner-header {
105
+ border: 0.1px solid var(--border-color);
106
+ background-color: var(--header-background-color);
107
+ position: absolute;
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ z-index: 1100;
112
+ top: -1px;
113
+ width: 60px;
114
+ height: 34px;
115
+ left: -1px;
116
+ }
118
117
 
119
- .ff-spreadsheet-header--selected {
120
- background: var(--brand-color);
121
- color: var(--tooltip-text-color);
122
- }
118
+ .ff-spreadsheet-header--selected {
119
+ background: var(--brand-color);
120
+ color: var(--tooltip-text-color);
121
+ }
123
122
 
124
- .ff-spreadsheet-data-viewer,
125
- .ff-spreadsheet-data-editor input {
126
- padding: 4px;
127
- box-sizing: border-box;
128
- }
129
- .ff-spreadsheet-header {
130
- box-sizing: border-box;
131
- }
123
+ .ff-spreadsheet-data-viewer,
124
+ .ff-spreadsheet-data-editor input {
125
+ padding: 4px;
126
+ box-sizing: border-box;
127
+ }
128
+ .ff-spreadsheet-header {
129
+ box-sizing: border-box;
130
+ }
132
131
 
133
- .ff-spreadsheet-data-viewer--preserve-breaks {
134
- white-space: pre-wrap;
135
- }
132
+ .ff-spreadsheet-data-viewer--preserve-breaks {
133
+ white-space: pre-wrap;
134
+ }
136
135
 
137
- .ff-spreadsheet-data-editor,
138
- .ff-spreadsheet-data-editor input {
139
- width: 100%;
140
- height: 100%;
141
- }
136
+ .ff-spreadsheet-data-editor,
137
+ .ff-spreadsheet-data-editor input {
138
+ width: 100%;
139
+ height: 100%;
140
+ }
142
141
 
143
- .ff-spreadsheet-data-editor input {
144
- font: inherit;
145
- color: inherit;
146
- background: none;
147
- border: none;
148
- outline: none;
149
- margin: 0;
150
- }
142
+ .ff-spreadsheet-data-editor input {
143
+ font: inherit;
144
+ color: inherit;
145
+ background: none;
146
+ border: none;
147
+ outline: none;
148
+ margin: 0;
149
+ }
151
150
 
152
- .ff-spreadsheet-data-viewer--boolean {
153
- text-align: center;
154
- }
151
+ .ff-spreadsheet-data-viewer--boolean {
152
+ text-align: center;
153
+ }
155
154
 
156
- .ff-spreadsheet-floating-rect {
157
- position: absolute;
158
- pointer-events: none;
159
- box-sizing: border-box;
160
- }
155
+ .ff-spreadsheet-floating-rect {
156
+ position: absolute;
157
+ pointer-events: none;
158
+ box-sizing: border-box;
159
+ }
161
160
 
162
- .ff-spreadsheet-floating-rect--hidden {
163
- display: none;
164
- }
161
+ .ff-spreadsheet-floating-rect--hidden {
162
+ display: none;
163
+ }
165
164
 
166
- .ff-spreadsheet-floating-rect--selected {
167
- background: var(--outline-background-color);
168
- border: 2px var(--outline-color) solid;
169
- }
165
+ .ff-spreadsheet-floating-rect--selected {
166
+ background: var(--outline-background-color);
167
+ border: 2px var(--outline-color) solid;
168
+ }
170
169
 
171
- .ff-spreadsheet-floating-rect--dragging {
172
- border: none;
173
- }
170
+ .ff-spreadsheet-floating-rect--dragging {
171
+ border: none;
172
+ }
174
173
 
175
- .ff-spreadsheet-floating-rect--copied {
176
- border: 2px var(--outline-color) dashed;
177
- }
174
+ .ff-spreadsheet-floating-rect--copied {
175
+ border: 2px var(--outline-color) dashed;
178
176
  }
179
177
  }
@@ -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}
@@ -82,7 +82,6 @@ import IpkFileType from '../../assets/icons/ipk_file_type.svg?react';
82
82
  import TxtFileType from '../../assets/icons/txt_file_type.svg?react';
83
83
  import GifFileType from '../../assets/icons/gif_file_type.svg?react';
84
84
  import JpgFileType from '../../assets/icons/jpg_file_type.svg?react';
85
-
86
85
  import InfoIcon from '../../assets/icons/info_icon.svg?react';
87
86
  import CalendarIcon from '../../assets/icons/calendar_icon.svg?react';
88
87
  import HideIcon from '../../assets/icons/hide_icon.svg?react';
@@ -421,7 +420,6 @@ Components['add_testcase'] = AddTestCaseIcon;
421
420
  Components['automation_testcase'] = AutomationTestCaseIcon;
422
421
  Components['manual_testcase'] = ManualTestCaseIcon;
423
422
  Components['back_icon'] = BackIcon;
424
-
425
423
  Components['sause_lab'] = SauseLabIcon;
426
424
  Components['local'] = LocalIcon;
427
425
  Components['internet_explorer'] = InternetExplorerIcon;