pixel-react 1.2.1 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. package/lib/components/AppHeader/types.d.ts +11 -2
  2. package/lib/components/Avatar/Avatar.d.ts +5 -0
  3. package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
  4. package/lib/components/Avatar/index.d.ts +1 -0
  5. package/lib/components/Avatar/types.d.ts +26 -0
  6. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +2 -2
  7. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +2 -2
  8. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +1 -1
  9. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +2 -2
  10. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +2 -2
  11. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +2 -2
  12. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +2 -2
  13. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +1 -1
  14. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +1 -1
  15. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +2 -2
  16. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +1 -1
  17. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +6 -7
  18. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
  19. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +49 -5
  20. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +3 -3
  21. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +5 -5
  22. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +6 -6
  23. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -2
  24. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +2 -2
  25. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +1 -1
  26. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +1 -1
  27. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +11 -11
  28. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +1 -1
  29. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +1 -1
  30. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +5 -5
  31. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +3 -3
  32. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +11 -48
  33. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +1 -1
  34. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +1 -1
  35. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +11 -12
  36. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +16 -0
  37. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -3
  38. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +12 -0
  39. package/lib/components/ExcelFile/Types.d.ts +2 -49
  40. package/lib/components/Form/Form.d.ts +1 -15
  41. package/lib/components/Form/Form.stories.d.ts +6 -5
  42. package/lib/components/Form/Forms.d.ts +8 -0
  43. package/lib/components/Form/index.d.ts +1 -1
  44. package/lib/components/Icon/types.d.ts +1 -1
  45. package/lib/components/MenuOption/types.d.ts +7 -7
  46. package/lib/components/MiniModal/MiniModal.stories.d.ts +1 -0
  47. package/lib/components/MiniModal/types.d.ts +6 -6
  48. package/lib/components/ModulesChip/ModuleChip.d.ts +4 -0
  49. package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
  50. package/lib/components/ModulesChip/index.d.ts +1 -0
  51. package/lib/components/ModulesChip/types.d.ts +14 -0
  52. package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
  53. package/lib/components/Toastify/Toastify.d.ts +8 -0
  54. package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
  55. package/lib/components/Toastify/index.d.ts +1 -0
  56. package/lib/components/Toastify/types.d.ts +7 -0
  57. package/lib/components/Tooltip/types.d.ts +6 -0
  58. package/lib/components/Typography/types.d.ts +1 -0
  59. package/lib/index.d.ts +84 -31
  60. package/lib/index.esm.js +26720 -881
  61. package/lib/index.esm.js.map +1 -1
  62. package/lib/index.js +26718 -875
  63. package/lib/index.js.map +1 -1
  64. package/lib/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +1 -1
  66. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
  67. package/src/assets/Themes/BaseTheme.scss +2 -0
  68. package/src/assets/Themes/DarkTheme.scss +2 -0
  69. package/src/assets/icons/add_testcase.svg +3 -0
  70. package/src/assets/icons/add_variable_icon.svg +3 -4
  71. package/src/assets/icons/attachment_icon.svg +3 -0
  72. package/src/assets/icons/authorization_icon.svg +3 -0
  73. package/src/assets/icons/automation_testcase.svg +4 -0
  74. package/src/assets/icons/back_icon.svg +3 -0
  75. package/src/assets/icons/client_profile.svg +4 -0
  76. package/src/assets/icons/fireflink_finder_logo.svg +7 -0
  77. package/src/assets/icons/fireflink_platform.svg +4 -0
  78. package/src/assets/icons/license_expired.svg +20 -0
  79. package/src/assets/icons/manual_testcase.svg +3 -0
  80. package/src/assets/icons/variable_icon.svg +4 -0
  81. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +2 -2
  82. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +1 -1
  83. package/src/components/AppHeader/AppHeader.stories.tsx +24 -3
  84. package/src/components/AppHeader/AppHeader.tsx +29 -11
  85. package/src/components/AppHeader/types.ts +11 -3
  86. package/src/components/Avatar/Avatar.scss +24 -0
  87. package/src/components/Avatar/Avatar.stories.tsx +56 -0
  88. package/src/components/Avatar/Avatar.tsx +25 -0
  89. package/src/components/Avatar/index.ts +1 -0
  90. package/src/components/Avatar/types.ts +27 -0
  91. package/src/components/Button/types.ts +1 -1
  92. package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +0 -2
  93. package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +1 -4
  94. package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +0 -1
  95. package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +13 -13
  96. package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +13 -12
  97. package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +40 -32
  98. package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +4 -4
  99. package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +10 -10
  100. package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +5 -5
  101. package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +10 -10
  102. package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +6 -6
  103. package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +1 -1
  104. package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +1 -1
  105. package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +34 -27
  106. package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +5 -5
  107. package/src/components/ExcelFile/ExcelFile/Excel/{Spreadsheet.css → Spreadsheet.scss} +21 -37
  108. package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +87 -78
  109. package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +2 -2
  110. package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +121 -31
  111. package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +1 -1
  112. package/src/components/ExcelFile/ExcelFile/Excel/context.ts +4 -4
  113. package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +7 -7
  114. package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +11 -11
  115. package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -2
  116. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +3 -3
  117. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +2 -2
  118. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +2 -2
  119. package/src/components/ExcelFile/ExcelFile/Excel/index.ts +12 -11
  120. package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +18 -24
  121. package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +1 -1
  122. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +311 -41
  123. package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +5 -5
  124. package/src/components/ExcelFile/ExcelFile/Excel/types.ts +14 -66
  125. package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +8 -8
  126. package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +2 -2
  127. package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +3 -3
  128. package/src/components/ExcelFile/ExcelFile/Excel/util.ts +21 -22
  129. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -3
  130. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +45 -403
  131. package/src/components/ExcelFile/ExcelFile.stories.tsx +10 -29
  132. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +1 -12
  133. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -3
  134. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +147 -127
  135. package/src/components/ExcelFile/Types.ts +3 -70
  136. package/src/components/ExcelFile/index.ts +1 -1
  137. package/src/components/Form/Form.d.ts +3 -0
  138. package/src/components/Form/Form.scss +48 -4
  139. package/src/components/Form/Form.stories.tsx +244 -137
  140. package/src/components/Form/Form.ts +2 -0
  141. package/src/components/Form/Forms.tsx +25 -0
  142. package/src/components/Form/index.ts +1 -1
  143. package/src/components/Icon/iconList.ts +23 -0
  144. package/src/components/Icon/types.ts +1 -1
  145. package/src/components/IconButton/IconButton.scss +1 -1
  146. package/src/components/MenuOption/types.ts +7 -6
  147. package/src/components/MiniModal/MiniModal.scss +5 -0
  148. package/src/components/MiniModal/MiniModal.stories.tsx +95 -0
  149. package/src/components/MiniModal/MiniModal.tsx +11 -6
  150. package/src/components/MiniModal/types.ts +6 -6
  151. package/src/components/ModulesChip/ModuleChip.scss +20 -0
  152. package/src/components/ModulesChip/ModuleChip.stories.tsx +41 -0
  153. package/src/components/ModulesChip/ModuleChip.tsx +31 -0
  154. package/src/components/ModulesChip/index.ts +1 -0
  155. package/src/components/ModulesChip/types.ts +14 -0
  156. package/src/components/MultiSelect/Dropdown.tsx +6 -1
  157. package/src/components/MultiSelect/MultiSelect.scss +17 -10
  158. package/src/components/MultiSelect/MultiSelect.stories.tsx +16 -4
  159. package/src/components/MultiSelect/MultiSelect.tsx +11 -4
  160. package/src/components/MultiSelect/MultiSelectTypes.ts +4 -3
  161. package/src/components/Select/Select.scss +4 -0
  162. package/src/components/Select/Select.tsx +2 -2
  163. package/src/components/Toastify/Toastify.stories.tsx +52 -0
  164. package/src/components/Toastify/Toastify.tsx +66 -0
  165. package/src/components/Toastify/index.ts +1 -0
  166. package/src/components/Toastify/types.ts +8 -0
  167. package/src/components/Tooltip/Tooltip.tsx +2 -1
  168. package/src/components/Tooltip/types.ts +6 -0
  169. package/src/components/Typography/Typography.scss +12 -4
  170. package/src/components/Typography/Typography.stories.tsx +2 -0
  171. package/src/components/Typography/Typography.tsx +2 -0
  172. package/src/components/Typography/types.ts +1 -0
  173. package/src/index.ts +9 -1
  174. package/src/components/ExcelFile/ChangeExcelStyles.tsx +0 -78
  175. package/src/components/ExcelFile/ImportExcelStyles.tsx +0 -86
  176. package/src/components/Form/Form.tsx +0 -57
@@ -0,0 +1,56 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import Avatar from './Avatar';
3
+
4
+ const meta: Meta<typeof Avatar> = {
5
+ component: Avatar,
6
+ title: 'Components/Avatar',
7
+ tags: ['autodocs'],
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ argTypes: {
12
+ variant: {
13
+ control: { type: 'radio' },
14
+ options: ['small', 'medium', 'large'],
15
+ },
16
+ }
17
+ }
18
+ export default meta;
19
+
20
+ type Story = StoryObj<typeof meta>;
21
+
22
+ export const Small: Story = {
23
+ args: {
24
+ variant: 'small',
25
+ iconName: 'accordion_header_icon',
26
+ },
27
+ };
28
+
29
+ export const Medium: Story = {
30
+ args: {
31
+ variant: 'medium',
32
+ iconName: 'accordion_header_icon',
33
+ },
34
+ };
35
+
36
+ export const Large: Story = {
37
+ args: {
38
+ variant: 'large',
39
+ iconName: 'accordion_header_icon',
40
+ },
41
+ };
42
+
43
+ export const CustomAvatarSize: Story = {
44
+ args: {
45
+ customAvatarSize: 30,
46
+ iconName: 'accordion_header_icon',
47
+ },
48
+ };
49
+
50
+ export const CustomIconSize: Story = {
51
+ args: {
52
+ customIconSize: 30,
53
+ customAvatarSize: 40,
54
+ iconName: 'accordion_header_icon',
55
+ },
56
+ };
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import Icon from '../Icon';
3
+ import './Avatar.scss';
4
+ import { AvatarProps } from './types';
5
+
6
+ const Avatar: React.FC<AvatarProps> = ({
7
+ variant="small",
8
+ iconName,
9
+ iconColor= 'var(--avatar-icon-color)',
10
+ customAvatarSize,
11
+ customIconSize,
12
+ backgroundColor
13
+ }) => {
14
+
15
+ return (
16
+ <div
17
+ className={`ff-avatar ff-avatar--${variant}`}
18
+ style={{ height: `${customAvatarSize}px`, width: `${customAvatarSize}px`, backgroundColor }}
19
+ >
20
+ <Icon name={iconName} height={customIconSize} width={customIconSize} color={iconColor}/>
21
+ </div>
22
+ );
23
+ };
24
+
25
+ export default Avatar;
@@ -0,0 +1 @@
1
+ export { default } from './Avatar';
@@ -0,0 +1,27 @@
1
+ export interface AvatarProps {
2
+ /**
3
+ * This property determines the size of the avatar. It can be set to 'small', 'medium', or 'large'.
4
+ */
5
+ variant?: 'small' | 'medium' | 'large';
6
+ /**
7
+ * This property allows you to customize the background color of the avatar.
8
+ */
9
+ backgroundColor?: string;
10
+ /**
11
+ * This property specifies the name of the icon to be displayed within the avatar.
12
+ */
13
+ iconName: string;
14
+ /**
15
+ * This property allows you to customize the color of the icon within the avatar.
16
+ */
17
+ iconColor?: string;
18
+ /**
19
+ * This property allows you to set a custom size for the avatar, overriding the default size specified by the variant property.
20
+ */
21
+
22
+ customAvatarSize?: number;
23
+ /**
24
+ * This property allows you to set a custom size for the icon within the avatar.
25
+ */
26
+ customIconSize?: number;
27
+ }
@@ -4,7 +4,7 @@ export interface ButtonProps {
4
4
  /**
5
5
  * Variant of the button
6
6
  */
7
- variant: 'primary' | 'secondary' | 'tertiary' | 'delete'| 'warning';
7
+ variant: 'primary' | 'secondary' | 'tertiary' | 'delete' | 'warning';
8
8
  /**
9
9
  * What background color to use
10
10
  */
@@ -1,5 +1,3 @@
1
- @use '../../../assets/styles/colors';
2
-
3
1
  .color-bar {
4
2
  background-color: var(--error_light);
5
3
  width: 100%;
@@ -1,12 +1,10 @@
1
- @import '../../../assets/styles/colors';
2
- @import '../../../assets/styles/fonts';
1
+ @use '../../assets/styles/fonts';
3
2
 
4
3
  .context-menu {
5
4
  position: absolute;
6
5
  z-index: 1;
7
6
  outline: none;
8
7
  background-color: var(--brand-color);
9
- // box-shadow: 0px 0px 6px $shadow;
10
8
  border-radius: 5px;
11
9
  opacity: 1;
12
10
  padding: 16px 0;
@@ -29,7 +27,6 @@
29
27
  justify-content: center;
30
28
  }
31
29
  &:hover {
32
- // background-color: $primary;
33
30
  .options-label {
34
31
  background: var(--option-card-bg-color);
35
32
  }
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import './ContextMenu.scss';
3
3
  import Icon from '../../Icon';
4
- // import { colors } from '../../../colors/colorConstants';
5
4
 
6
5
  const ContextMenu: React.FC<ContextMenuProps> = ({
7
6
  customContext,
@@ -1,12 +1,12 @@
1
- import * as React from "react";
2
- import classnames from "classnames";
3
- import * as Actions from "./actions";
4
- import * as Types from "./types";
5
- import * as Point from "./point";
6
- import useSelector from "./use-selector";
7
- import useDispatch from "./use-dispatch";
8
- import { getCellDimensions } from "./util";
9
- import * as Matrix from "./matrix";
1
+ import * as React from 'react';
2
+ import classnames from 'classnames';
3
+ import * as Actions from './actions';
4
+ import * as Types from './types';
5
+ import * as Point from './point';
6
+ import useSelector from './use-selector';
7
+ import useDispatch from './use-dispatch';
8
+ import { getCellDimensions } from './util';
9
+ import * as Matrix from './matrix';
10
10
 
11
11
  type Props = {
12
12
  DataEditor: Types.DataEditorComponent;
@@ -77,7 +77,7 @@ const ActiveCell: React.FC<Props> = (props) => {
77
77
 
78
78
  const coordsChanged =
79
79
  active?.row !== prevActive.row || active?.column !== prevActive.column;
80
- const exitedEditMode = mode !== "edit";
80
+ const exitedEditMode = mode !== 'edit';
81
81
 
82
82
  if (coordsChanged || exitedEditMode) {
83
83
  const initialCell = initialCellRef.current;
@@ -107,14 +107,14 @@ const ActiveCell: React.FC<Props> = (props) => {
107
107
  <div
108
108
  ref={rootRef}
109
109
  className={classnames(
110
- "Spreadsheet__active-cell",
110
+ 'Spreadsheet__active-cell',
111
111
  `Spreadsheet__active-cell--${mode}`
112
112
  )}
113
113
  style={dimensions}
114
- onClick={mode === "view" && !readOnly ? edit : undefined}
114
+ onClick={mode === 'view' && !readOnly ? edit : undefined}
115
115
  tabIndex={0}
116
116
  >
117
- {mode === "edit" && active && (
117
+ {mode === 'edit' && active && (
118
118
  <DataEditor
119
119
  row={active.row}
120
120
  column={active.column}
@@ -51,7 +51,7 @@ export const Cell: React.FC<Types.CellComponentProps> = ({
51
51
 
52
52
  const handleMouseOver = React.useCallback(
53
53
  (event: React.MouseEvent<HTMLTableCellElement>) => {
54
- if (dragging && first && !isDotDragging) {
54
+ if (dragging && first && !isDotDragging) {
55
55
  setCellDimensions(point, getOffsetRect(event.currentTarget));
56
56
  select(point);
57
57
  }
@@ -102,10 +102,11 @@ export const Cell: React.FC<Types.CellComponentProps> = ({
102
102
  return (
103
103
  <td
104
104
  ref={rootRef}
105
+ // style={data?.style}
105
106
  className={classnames('Spreadsheet__cell', data?.className, {
106
107
  'Spreadsheet__active-cell': active || dragging,
107
108
  })}
108
- onMouseEnter={handleMouseOver} // Handle drag when mouse enters
109
+ onMouseEnter={handleMouseOver}
109
110
  onMouseDown={handleMouseDown}
110
111
  tabIndex={0}
111
112
  >
@@ -130,15 +131,15 @@ export const enhance = (
130
131
  ): React.FC<
131
132
  Omit<
132
133
  Types.CellComponentProps,
133
- | "selected"
134
- | "active"
135
- | "copied"
136
- | "dragging"
137
- | "mode"
138
- | "data"
139
- | "select"
140
- | "activate"
141
- | "setCellDimensions"
134
+ | 'selected'
135
+ | 'active'
136
+ | 'copied'
137
+ | 'dragging'
138
+ | 'mode'
139
+ | 'data'
140
+ | 'select'
141
+ | 'activate'
142
+ | 'setCellDimensions'
142
143
  >
143
144
  > => {
144
145
  return function CellWrapper(props) {
@@ -169,7 +170,7 @@ export const enhance = (
169
170
  [dispatch]
170
171
  );
171
172
  const active = useSelector((state) => isActive(state.active, point));
172
- const mode = useSelector((state) => (active ? state.mode : "view"));
173
+ const mode = useSelector((state) => (active ? state.mode : 'view'));
173
174
  const data = useSelector((state) => Matrix.get(point, state.model.data));
174
175
  const evaluatedData = useSelector((state) =>
175
176
  Matrix.get(point, state.model.evaluatedData)
@@ -1,10 +1,10 @@
1
- import * as React from "react";
2
- import classNames from "classnames";
3
- import * as Types from "./types";
4
- import * as Point from "./point";
5
- import * as Actions from "./actions";
6
- import useDispatch from "./use-dispatch";
7
- import useSelector from "./use-selector";
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ import * as Types from './types';
4
+ import * as Point from './point';
5
+ import * as Actions from './actions';
6
+ import useDispatch from './use-dispatch';
7
+ import useSelector from './use-selector';
8
8
 
9
9
  const ColumnIndicator: Types.ColumnIndicatorComponent = ({
10
10
  column,
@@ -14,7 +14,7 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
14
14
  }) => {
15
15
  const dispatch = useDispatch();
16
16
  const [width, setWidth] = React.useState(100);
17
-
17
+
18
18
  // Function to handle the start of the resize (mouse down)
19
19
  const onMouseDown = (e: React.MouseEvent) => {
20
20
  const startX = e.clientX;
@@ -23,26 +23,33 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
23
23
  const onMouseMove = (moveEvent: MouseEvent) => {
24
24
  const newWidth = width + (moveEvent.clientX - startX);
25
25
  setWidth(newWidth);
26
-
27
- // const selectedAllRow = document.querySelector(".Spreadsheet__floating-rect--selected");
28
- // const selectedSingleRow = document.querySelector(".Spreadsheet__active-cell");
29
26
 
30
- // // If the element exists, update its height
31
- // if (selectedAllRow instanceof HTMLElement&&selectedSingleRow instanceof HTMLElement) {
32
- // selectedAllRow.style.width = `${newWidth}px`; // Set the width
33
- // selectedSingleRow.style.width = `${newWidth}px`; // Set the width
34
- // }
27
+ const selectedAllRow = document.querySelector(
28
+ '.Spreadsheet__floating-rect--selected'
29
+ );
30
+ const selectedSingleRow = document.querySelector(
31
+ '.Spreadsheet__active-cell'
32
+ );
33
+
34
+ // If the element exists, update its height
35
+ if (
36
+ selectedAllRow instanceof HTMLElement &&
37
+ selectedSingleRow instanceof HTMLElement
38
+ ) {
39
+ selectedAllRow.style.width = `${newWidth}px`;
40
+ selectedSingleRow.style.width = `${newWidth}px`;
41
+ }
35
42
  };
36
43
 
37
44
  // Function to stop the resizing (mouse up)
38
45
  const onMouseUp = () => {
39
- document.removeEventListener("mousemove", onMouseMove);
40
- document.removeEventListener("mouseup", onMouseUp);
46
+ document.removeEventListener('mousemove', onMouseMove);
47
+ document.removeEventListener('mouseup', onMouseUp);
41
48
  };
42
49
 
43
50
  // Add event listeners for mouse move and mouse up
44
- document.addEventListener("mousemove", onMouseMove);
45
- document.addEventListener("mouseup", onMouseUp);
51
+ document.addEventListener('mousemove', onMouseMove);
52
+ document.addEventListener('mouseup', onMouseUp);
46
53
  };
47
54
 
48
55
  const activate = React.useCallback(
@@ -58,12 +65,11 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
58
65
  [onSelect, column]
59
66
  );
60
67
 
61
-
62
68
  return (
63
69
  <th
64
- style={{ minWidth: `${width}px`, position: "relative" }} // Use dynamic width
65
- className={classNames("Spreadsheet__header", {
66
- "Spreadsheet__header--selected": selected,
70
+ style={{ minWidth: `${width}px`, position: 'relative' }} // Use dynamic width
71
+ className={classNames('Spreadsheet__header', {
72
+ 'Spreadsheet__header--selected': selected,
67
73
  })}
68
74
  onClick={handleClick}
69
75
  tabIndex={0}
@@ -71,15 +77,17 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
71
77
  {label !== undefined ? label : columnIndexToLabel(column)}
72
78
  <div
73
79
  onMouseDown={onMouseDown}
74
- onClick={()=>{activate}}
80
+ onClick={() => {
81
+ activate;
82
+ }}
75
83
  style={{
76
- zIndex: "inherit",
77
- width: "2px",
78
- position: "absolute",
84
+ zIndex: 'inherit',
85
+ width: '2px',
86
+ position: 'absolute',
79
87
  right: 0,
80
88
  top: 0,
81
- height: "100%",
82
- cursor: "ew-resize",
89
+ height: '100%',
90
+ cursor: 'ew-resize',
83
91
  }}
84
92
  />
85
93
  </th>
@@ -90,7 +98,7 @@ export default ColumnIndicator;
90
98
 
91
99
  export const enhance = (
92
100
  ColumnIndicatorComponent: Types.ColumnIndicatorComponent
93
- ): React.FC<Omit<Types.ColumnIndicatorProps, "selected" | "onSelect">> => {
101
+ ): React.FC<Omit<Types.ColumnIndicatorProps, 'selected' | 'onSelect'>> => {
94
102
  return function ColumnIndicatorWrapper(props) {
95
103
  const dispatch = useDispatch();
96
104
  const selectEntireColumn = React.useCallback(
@@ -113,7 +121,7 @@ export const enhance = (
113
121
 
114
122
  // Utility function to convert column index to label (e.g., 0 -> A, 1 -> B, etc.)
115
123
  function columnIndexToLabel(column: number): string {
116
- let label = "";
124
+ let label = '';
117
125
  let index = column;
118
126
  while (index >= 0) {
119
127
  label = String.fromCharCode(65 + (index % 26)) + label;
@@ -1,7 +1,7 @@
1
- import * as React from "react";
2
- import FloatingRect from "./FloatingRect";
3
- import { getRangeDimensions } from "./util";
4
- import useSelector from "./use-selector";
1
+ import * as React from 'react';
2
+ import FloatingRect from './FloatingRect';
3
+ import { getRangeDimensions } from './util';
4
+ import useSelector from './use-selector';
5
5
 
6
6
  const Copied: React.FC = () => {
7
7
  const range = useSelector((state) => state.copied);
@@ -1,10 +1,10 @@
1
- import * as React from "react";
2
- import classNames from "classnames";
3
- import * as Actions from "./actions";
4
- import { EntireWorksheetSelection } from "./selection";
5
- import * as Types from "./types";
6
- import useDispatch from "./use-dispatch";
7
- import useSelector from "./use-selector";
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ import * as Actions from './actions';
4
+ import { EntireWorksheetSelection } from './selection';
5
+ import * as Types from './types';
6
+ import useDispatch from './use-dispatch';
7
+ import useSelector from './use-selector';
8
8
 
9
9
  const CornerIndicator: Types.CornerIndicatorComponent = ({
10
10
  selected,
@@ -15,8 +15,8 @@ const CornerIndicator: Types.CornerIndicatorComponent = ({
15
15
  }, [onSelect]);
16
16
  return (
17
17
  <th
18
- className={classNames("Spreadsheet__header", {
19
- "Spreadsheet__header--selected": selected,
18
+ className={classNames('Spreadsheet__header', {
19
+ 'Spreadsheet__header--selected': selected,
20
20
  })}
21
21
  onClick={handleClick}
22
22
  tabIndex={0}
@@ -28,7 +28,7 @@ export default CornerIndicator;
28
28
 
29
29
  export const enhance = (
30
30
  CornerIndicatorComponent: Types.CornerIndicatorComponent
31
- ): React.FC<Omit<Types.CornerIndicatorProps, "selected" | "onSelect">> => {
31
+ ): React.FC<Omit<Types.CornerIndicatorProps, 'selected' | 'onSelect'>> => {
32
32
  return function CornerIndicatorWrapper(props) {
33
33
  const dispatch = useDispatch();
34
34
  const selectEntireWorksheet = React.useCallback(
@@ -1,6 +1,6 @@
1
- import * as React from "react";
2
- import * as Types from "./types";
3
- import { moveCursorToEnd } from "./util";
1
+ import * as React from 'react';
2
+ import * as Types from './types';
3
+ import { moveCursorToEnd } from './util';
4
4
 
5
5
  /** The default Spreadsheet DataEditor component */
6
6
  const DataEditor: React.FC<Types.DataEditorProps> = ({ onChange, cell }) => {
@@ -8,7 +8,7 @@ const DataEditor: React.FC<Types.DataEditorProps> = ({ onChange, cell }) => {
8
8
 
9
9
  const handleChange = React.useCallback(
10
10
  (event: React.ChangeEvent<HTMLInputElement>) => {
11
- onChange({ ...cell, value: event.target.value,style:cell?.style});
11
+ onChange({ ...cell, value: event.target.value, style: cell?.style });
12
12
  },
13
13
  [onChange, cell]
14
14
  );
@@ -19,7 +19,7 @@ const DataEditor: React.FC<Types.DataEditorProps> = ({ onChange, cell }) => {
19
19
  }
20
20
  }, [inputRef]);
21
21
 
22
- const value = cell?.value ?? "";
22
+ const value = cell?.value ?? '';
23
23
 
24
24
  return (
25
25
  <div className="Spreadsheet__data-editor">
@@ -1,10 +1,10 @@
1
- import * as React from "react";
2
- import classNames from "classnames";
3
- import * as Types from "./types";
4
- import { hasLineBreaker } from "./util";
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ import * as Types from './types';
4
+ import { hasLineBreaker } from './util';
5
5
 
6
- export const TRUE_TEXT = "TRUE";
7
- export const FALSE_TEXT = "FALSE";
6
+ export const TRUE_TEXT = 'TRUE';
7
+ export const FALSE_TEXT = 'FALSE';
8
8
 
9
9
  /** The default Spreadsheet DataViewer component */
10
10
  const DataViewer = <Cell extends Types.CellBase<Value>, Value>({
@@ -13,14 +13,14 @@ const DataViewer = <Cell extends Types.CellBase<Value>, Value>({
13
13
  }: Types.DataViewerProps<Cell>): React.ReactElement => {
14
14
  const value = getValue(cell, evaluatedCell);
15
15
 
16
- return typeof value === "boolean" ? (
16
+ return typeof value === 'boolean' ? (
17
17
  <span className="Spreadsheet__data-viewer Spreadsheet__data-viewer--boolean">
18
18
  {convertBooleanToText(value)}
19
19
  </span>
20
20
  ) : (
21
21
  <span
22
- className={classNames("Spreadsheet__data-viewer", {
23
- "Spreadsheet__data-viewer--preserve-breaks": hasLineBreaker(value),
22
+ className={classNames('Spreadsheet__data-viewer', {
23
+ 'Spreadsheet__data-viewer--preserve-breaks': hasLineBreaker(value),
24
24
  })}
25
25
  >
26
26
  {value}
@@ -35,7 +35,7 @@ function getValue(
35
35
  evaluatedCell: Types.CellBase | undefined
36
36
  ) {
37
37
  const baseValue = evaluatedCell?.value ?? cell?.value;
38
- if (baseValue && typeof baseValue === "object") {
38
+ if (baseValue && typeof baseValue === 'object') {
39
39
  return baseValue.toString();
40
40
  }
41
41
  return baseValue;
@@ -1,6 +1,6 @@
1
- import * as React from "react";
2
- import classnames from "classnames";
3
- import * as Types from "./types";
1
+ import * as React from 'react';
2
+ import classnames from 'classnames';
3
+ import * as Types from './types';
4
4
 
5
5
  export type Props = {
6
6
  variant?: string;
@@ -18,10 +18,10 @@ const FloatingRect: React.FC<Props> = ({
18
18
  const { width, height, top, left } = dimensions || {};
19
19
  return (
20
20
  <div
21
- className={classnames("Spreadsheet__floating-rect", {
21
+ className={classnames('Spreadsheet__floating-rect', {
22
22
  [`Spreadsheet__floating-rect--${variant}`]: variant,
23
- "Spreadsheet__floating-rect--dragging": dragging,
24
- "Spreadsheet__floating-rect--hidden": hidden,
23
+ 'Spreadsheet__floating-rect--dragging': dragging,
24
+ 'Spreadsheet__floating-rect--hidden': hidden,
25
25
  })}
26
26
  style={{ width, height, top, left }}
27
27
  />
@@ -1,4 +1,4 @@
1
- import * as Types from "./types";
1
+ import * as Types from './types';
2
2
 
3
3
  const HeaderRow: Types.HeaderRowComponent = (props) => <tr {...props} />;
4
4
 
@@ -1,4 +1,4 @@
1
- import * as Types from "./types";
1
+ import * as Types from './types';
2
2
 
3
3
  const Row: Types.RowComponent = (props) => <tr {...props} />;
4
4