pixel-react 1.2.7 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. package/lib/components/Drawer/Types.d.ts +23 -12
  2. package/lib/components/Editor/Editor.d.ts +5 -0
  3. package/lib/components/Editor/Editor.stories.d.ts +6 -0
  4. package/lib/components/Editor/VariableDropdown.d.ts +5 -0
  5. package/lib/components/Editor/constants.d.ts +3 -0
  6. package/lib/components/Editor/index.d.ts +1 -0
  7. package/lib/components/Editor/types.d.ts +71 -0
  8. package/lib/components/Excel/ContextMenu/ContextMenu.d.ts +4 -0
  9. package/lib/components/Excel/ExcelFile/ExcelFile.d.ts +20 -0
  10. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.d.ts +7 -0
  11. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Cell.d.ts +4 -0
  12. package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.d.ts +5 -0
  13. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Copied.d.ts +3 -0
  14. package/lib/components/Excel/ExcelFile/ExcelFileComponents/CornerIndicator.d.ts +5 -0
  15. package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.d.ts +5 -0
  16. package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.d.ts +8 -0
  17. package/lib/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.d.ts +10 -0
  18. package/lib/components/Excel/ExcelFile/ExcelFileComponents/HeaderRow.d.ts +3 -0
  19. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Row.d.ts +3 -0
  20. package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.d.ts +5 -0
  21. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Selected.d.ts +3 -0
  22. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +80 -0
  23. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Table.d.ts +3 -0
  24. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +203 -0
  25. package/lib/components/Excel/ExcelFile/ExcelFileComponents/areModelsEqual.d.ts +1 -0
  26. package/lib/components/Excel/ExcelFile/ExcelFileComponents/context.d.ts +8 -0
  27. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.d.ts +22 -0
  28. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.d.ts +17 -0
  29. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/index.d.ts +2 -0
  30. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.d.ts +21 -0
  31. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-hash.d.ts +3 -0
  32. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-set.d.ts +24 -0
  33. package/lib/components/Excel/ExcelFile/ExcelFileComponents/index.d.ts +13 -0
  34. package/lib/components/Excel/ExcelFile/ExcelFileComponents/matrix.d.ts +67 -0
  35. package/lib/components/Excel/ExcelFile/ExcelFileComponents/point-range.d.ts +22 -0
  36. package/lib/components/Excel/ExcelFile/ExcelFileComponents/point.d.ts +11 -0
  37. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.d.ts +4 -0
  38. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +40 -0
  39. package/lib/components/Excel/ExcelFile/ExcelFileComponents/selection.d.ts +95 -0
  40. package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +178 -0
  41. package/lib/components/Excel/ExcelFile/ExcelFileComponents/use-dispatch.d.ts +3 -0
  42. package/lib/components/Excel/ExcelFile/ExcelFileComponents/use-selector.d.ts +3 -0
  43. package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.d.ts +44 -0
  44. package/lib/components/Excel/ExcelFile.stories.d.ts +6 -0
  45. package/lib/components/Excel/ExcelToolBar/ExcelToolBar.d.ts +19 -0
  46. package/lib/components/Excel/Types.d.ts +129 -0
  47. package/lib/components/Excel/index.d.ts +1 -0
  48. package/lib/components/ExcelFile/ColorBarselector/ColorBarSelector.d.ts +8 -0
  49. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +2 -2
  50. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +2 -2
  51. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +1 -1
  52. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +2 -2
  53. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +2 -2
  54. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +2 -2
  55. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +2 -2
  56. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +1 -1
  57. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +1 -1
  58. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +2 -2
  59. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +1 -1
  60. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +7 -6
  61. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
  62. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +5 -49
  63. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +3 -3
  64. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +5 -5
  65. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +6 -6
  66. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -2
  67. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +2 -2
  68. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +1 -1
  69. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +1 -1
  70. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +11 -11
  71. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +1 -1
  72. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +1 -1
  73. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +5 -5
  74. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +3 -3
  75. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +48 -11
  76. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +1 -1
  77. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +1 -1
  78. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +12 -11
  79. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +0 -16
  80. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +3 -0
  81. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +0 -12
  82. package/lib/components/ExcelFile/Types.d.ts +49 -2
  83. package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
  84. package/lib/components/InputWithDropdown/types.d.ts +3 -1
  85. package/lib/components/MenuOption/MenuOption.d.ts +1 -1
  86. package/lib/components/MenuOption/types.d.ts +4 -0
  87. package/lib/components/Select/Select.d.ts +3 -2
  88. package/lib/components/Select/Select.stories.d.ts +1 -0
  89. package/lib/components/Select/components/Dropdown.d.ts +5 -0
  90. package/lib/components/Select/components/types.d.ts +18 -0
  91. package/lib/components/Select/types.d.ts +2 -42
  92. package/lib/components/Toastify/Toastify.d.ts +5 -4
  93. package/lib/components/Toastify/types.d.ts +1 -0
  94. package/lib/index.d.ts +75 -30
  95. package/lib/index.esm.js +1734 -1441
  96. package/lib/index.esm.js.map +1 -1
  97. package/lib/index.js +1734 -1440
  98. package/lib/index.js.map +1 -1
  99. package/lib/tsconfig.tsbuildinfo +1 -1
  100. package/lib/utils/getSequentialPayload/getSequentialPayload.d.ts +2 -0
  101. package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
  102. package/lib/utils/getSequentialPayload/types.d.ts +30 -0
  103. package/package.json +1 -1
  104. package/src/assets/Themes/BaseTheme.scss +5 -0
  105. package/src/assets/Themes/DarkTheme.scss +2 -0
  106. package/src/assets/icons/maximize_icon.svg +5 -0
  107. package/src/assets/styles/_fonts.scss +1 -1
  108. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +15 -6
  109. package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +0 -5
  110. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +20 -10
  111. package/src/components/Drawer/Drawer.scss +1 -0
  112. package/src/components/Drawer/Types.ts +24 -13
  113. package/src/components/Excel/ExcelFile/ExcelFile.scss +62 -0
  114. package/src/components/Excel/ExcelFile/ExcelFile.tsx +312 -0
  115. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.tsx +2 -2
  116. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.tsx +3 -3
  117. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.tsx +4 -4
  118. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.tsx +2 -2
  119. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.tsx +1 -1
  120. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.tsx +3 -3
  121. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.tsx +4 -4
  122. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.tsx +4 -4
  123. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.scss +26 -24
  124. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.tsx +13 -45
  125. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.tsx +1 -1
  126. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.ts +88 -20
  127. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +495 -0
  128. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +758 -0
  129. package/src/components/{ExcelFile → Excel}/ExcelFile.stories.tsx +45 -0
  130. package/src/components/Excel/ExcelToolBar/ExcelToolBar.scss +36 -0
  131. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +346 -0
  132. package/src/components/Form/Form.scss +54 -35
  133. package/src/components/Form/Form.stories.tsx +264 -225
  134. package/src/components/Icon/Icons.scss +4 -0
  135. package/src/components/Icon/iconList.ts +2 -1
  136. package/src/components/Input/Input.tsx +0 -1
  137. package/src/components/InputWithDropdown/InputWithDropdown.scss +30 -1
  138. package/src/components/InputWithDropdown/InputWithDropdown.tsx +45 -16
  139. package/src/components/InputWithDropdown/types.ts +5 -1
  140. package/src/components/MenuOption/MenuOption.scss +0 -1
  141. package/src/components/MenuOption/MenuOption.stories.tsx +3 -0
  142. package/src/components/MenuOption/MenuOption.tsx +5 -4
  143. package/src/components/MenuOption/types.ts +4 -0
  144. package/src/components/MultiSelect/MultiSelect.scss +5 -1
  145. package/src/components/MultiSelect/MultiSelect.stories.tsx +17 -13
  146. package/src/components/MultiSelect/MultiSelect.tsx +27 -14
  147. package/src/components/Select/Select.scss +121 -188
  148. package/src/components/Select/Select.stories.tsx +164 -18
  149. package/src/components/Select/Select.tsx +142 -290
  150. package/src/components/Select/components/Dropdown.scss +50 -0
  151. package/src/components/Select/components/Dropdown.tsx +94 -0
  152. package/src/components/Select/components/types.ts +20 -0
  153. package/src/components/Select/types.ts +15 -39
  154. package/src/components/Table/Table.scss +6 -5
  155. package/src/components/Table/Table.stories.tsx +0 -9
  156. package/src/components/Table/Table.tsx +2 -2
  157. package/src/components/TableTree/TableTree.scss +1 -1
  158. package/src/components/TableTree/TableTree.tsx +3 -1
  159. package/src/components/Toastify/Toastify.stories.tsx +29 -10
  160. package/src/components/Toastify/Toastify.tsx +42 -16
  161. package/src/components/Toastify/types.ts +2 -0
  162. package/src/index.ts +4 -2
  163. package/src/utils/getSelectOptionValue/getSelectOptionValue.ts +1 -1
  164. package/src/utils/getSequentialPayload/getSequentialPayload.stories.tsx +75 -0
  165. package/src/utils/getSequentialPayload/getSequentialPayload.ts +29 -0
  166. package/src/utils/getSequentialPayload/types.ts +35 -0
  167. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +0 -952
  168. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -24
  169. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +0 -162
  170. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +0 -16
  171. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +0 -68
  172. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -19
  173. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +0 -291
  174. package/src/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
  175. package/src/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  176. package/src/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
  177. package/src/fonts/Poppins/Poppins-Black.ttf +0 -0
  178. package/src/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
  179. package/src/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  180. package/src/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  181. package/src/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  182. package/src/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  183. package/src/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  184. package/src/fonts/Poppins/Poppins-Italic.ttf +0 -0
  185. package/src/fonts/Poppins/Poppins-Light.ttf +0 -0
  186. package/src/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  187. package/src/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  188. package/src/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  189. package/src/fonts/Poppins/Poppins-Thin.ttf +0 -0
  190. package/src/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  191. /package/lib/components/{ExcelFile → Excel}/ColorBarSelector/ColorBarSelector.d.ts +0 -0
  192. /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.scss +0 -0
  193. /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.tsx +0 -0
  194. /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.scss +0 -0
  195. /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.tsx +0 -0
  196. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.tsx +0 -0
  197. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.tsx +0 -0
  198. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.tsx +0 -0
  199. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.tsx +0 -0
  200. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.ts +0 -0
  201. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.ts +0 -0
  202. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.ts +0 -0
  203. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.ts +0 -0
  204. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.ts +0 -0
  205. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.ts +0 -0
  206. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.ts +0 -0
  207. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.ts +0 -0
  208. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.ts +0 -0
  209. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.ts +0 -0
  210. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.ts +0 -0
  211. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.ts +0 -0
  212. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.ts +0 -0
  213. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.ts +0 -0
  214. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/typings/fast-formula-parser.d.ts +0 -0
  215. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.ts +0 -0
  216. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.ts +0 -0
  217. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.ts +0 -0
  218. /package/src/components/{ExcelFile → Excel}/Types.ts +0 -0
  219. /package/src/components/{ExcelFile → Excel}/index.ts +0 -0
@@ -0,0 +1,24 @@
1
+ import * as Point from '../point';
2
+ /**
3
+ * Immutable Set like interface of points
4
+ */
5
+ export declare class PointSet {
6
+ private set;
7
+ private constructor();
8
+ /** Creates a new PointSet instance from an array-like or iterable object */
9
+ static from(points: Iterable<Point.Point>): PointSet;
10
+ /** Returns a boolean asserting whether an point is present with the given value in the Set object or not */
11
+ has(point: Point.Point): boolean;
12
+ /** Returns the number of points in a PointSet object */
13
+ get size(): number;
14
+ /** Add the given point to given set */
15
+ add(point: Point.Point): PointSet;
16
+ /** Remove the given point from the given set */
17
+ delete(point: Point.Point): PointSet;
18
+ /** Returns a new PointSet with points common to the set and other */
19
+ difference(other: PointSet): PointSet;
20
+ /** Returns a new PointSet with all points in both sets */
21
+ union(other: PointSet): PointSet;
22
+ /** Creates an iterator of points in the set */
23
+ [Symbol.iterator](): Iterator<Point.Point>;
24
+ }
@@ -0,0 +1,13 @@
1
+ import Spreadsheet from './Spreadsheet';
2
+ import DataEditor from './DataEditor';
3
+ import DataViewer from './DataViewer';
4
+ export default Spreadsheet;
5
+ export { Spreadsheet, DataEditor, DataViewer };
6
+ export type { Props } from './Spreadsheet';
7
+ export { createEmpty as createEmptyMatrix } from './matrix';
8
+ export type { Matrix } from './matrix';
9
+ export { Selection, EmptySelection, EntireAxisSelection, EntireColumnsSelection, EntireRowsSelection, EntireSelection, EntireWorksheetSelection, InvalidIndexError, RangeSelection, } from './selection';
10
+ export { PointRange } from './point-range';
11
+ export type { Point } from './point';
12
+ export type { CellBase, CellDescriptor, Mode, Dimensions, CellChange, CellComponentProps, CellComponent, DataViewerProps, DataViewerComponent, DataEditorProps, DataEditorComponent, ColumnIndicatorComponent, ColumnIndicatorProps, RowIndicatorComponent, RowIndicatorProps, CornerIndicatorComponent, CornerIndicatorProps, RowComponent, RowProps, TableComponent, TableProps, HeaderRowProps, HeaderRowComponent, } from './types';
13
+ export { createFormulaParser, Model } from './engine';
@@ -0,0 +1,67 @@
1
+ import * as Point from './point';
2
+ /** A two-dimensional array of given type T in rows and columns */
3
+ export type Matrix<T> = Array<Array<T | undefined>>;
4
+ /**
5
+ * Creates an empty matrix with given rows and columns
6
+ * @param rows - integer, the amount of rows the matrix should have
7
+ * @param columns - integer, the amount of columns the matrix should have
8
+ * @returns an empty matrix with given rows and columns
9
+ */
10
+ export declare function createEmpty<T>(rows: number, columns: number): Matrix<T>;
11
+ /** Gets the value at row and column of matrix. */
12
+ export declare function get<T>(point: Point.Point, matrix: Matrix<T>): T | undefined;
13
+ /** Creates a slice of matrix from startPoint up to, but not including, endPoint. */
14
+ export declare function slice<T>(startPoint: Point.Point, endPoint: Point.Point, matrix: Matrix<T>): Matrix<T>;
15
+ /** Sets the value at row and column of matrix. If a row doesn't exist, it's created. */
16
+ export declare function set<T>(point: Point.Point, value: T, matrix: Matrix<T>): Matrix<T>;
17
+ /** Like Matrix.set() but mutates the matrix */
18
+ export declare function mutableSet<T>(point: Point.Point, value: T, matrix: Matrix<T>): void;
19
+ /** Removes the coordinate of matrix */
20
+ export declare function unset<T>(point: Point.Point, matrix: Matrix<T>): Matrix<T>;
21
+ /** Creates an array of values by running each element in collection thru iteratee. */
22
+ export declare function map<T, T2>(func: (value: T | undefined, point: Point.Point) => T2, matrix: Matrix<T>): Matrix<T2>;
23
+ /** Create an iterator over the cells in the matrix */
24
+ export declare function entries<T>(matrix: Matrix<T>): IterableIterator<[Point.Point, T | undefined]>;
25
+ /**
26
+ * Converts all elements in row into a string separated by horizontalSeparator and each row string
27
+ * to string separated by verticalSeparator
28
+ */
29
+ export declare function join(matrix: Matrix<unknown>, horizontalSeparator?: string, verticalSeparator?: string): string;
30
+ /**
31
+ * Parses a CSV separated by a horizontalSeparator and verticalSeparator into a
32
+ * Matrix using a transform function
33
+ */
34
+ export declare function split<T>(csv: string, transform: (value: string) => T, horizontalSeparator?: string, verticalSeparator?: string | RegExp): Matrix<T>;
35
+ /** Returns whether the point exists in the matrix or not. */
36
+ export declare function has(point: Point.Point, matrix: Matrix<unknown>): boolean;
37
+ /** Counts of the rows and column in a matrix */
38
+ export type Size = {
39
+ /** Count of the rows in the matrix */
40
+ rows: number;
41
+ /** Count of the columns in the matrix */
42
+ columns: number;
43
+ };
44
+ /** Gets the count of rows and columns of given matrix */
45
+ export declare function getSize(matrix: Matrix<unknown>): Size;
46
+ /** Gets the count of rows of given matrix */
47
+ export declare function getRowsCount(matrix: Matrix<unknown>): number;
48
+ /** Gets the count of columns of given matrix */
49
+ export declare function getColumnsCount(matrix: Matrix<unknown>): number;
50
+ /**
51
+ * Pads matrix with empty rows to match given total rows
52
+ * @param matrix - matrix to pad
53
+ * @param totalRows - number of rows the matrix should have
54
+ * @returns the updated matrix
55
+ */
56
+ export declare function padRows<T>(matrix: Matrix<T>, totalRows: number): Matrix<T>;
57
+ /**
58
+ * Pads matrix with empty columns to match given total columns
59
+ * @param matrix - matrix to pad
60
+ * @param size - minimum size of the matrix after padding.
61
+ * @returns the updated matrix
62
+ */
63
+ export declare function pad<T>(matrix: Matrix<T>, size: Size): Matrix<T>;
64
+ export declare function toArray<T>(matrix: Matrix<T>): T[];
65
+ export declare function toArray<T1, T2>(matrix: Matrix<T1>, transform: (cell: T1 | undefined, coords: Point.Point) => T2): T2[];
66
+ /** Returns the maximum point in the matrix */
67
+ export declare function maxPoint(matrix: Matrix<unknown>): Point.Point;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Interface for ranges between two points
3
+ */
4
+ import * as Point from './point';
5
+ /** Range between two points. Creates a normalized range between two given points */
6
+ export declare class PointRange {
7
+ /** The top-left point */
8
+ start: Point.Point;
9
+ /** The bottom-right point */
10
+ end: Point.Point;
11
+ constructor(source: Point.Point, target: Point.Point);
12
+ /** Iterates through all the existing points in given range */
13
+ [Symbol.iterator](): Iterator<Point.Point>;
14
+ /** Returns the size (rows x columns) of the given range */
15
+ size(): number;
16
+ /** Returns whether given point exists in given range */
17
+ has(point: Point.Point): boolean;
18
+ /** Limits given masked range with given mask */
19
+ mask(mask: PointRange): PointRange;
20
+ /** Returns whether given range is equal to this range */
21
+ equals(range: PointRange): boolean;
22
+ }
@@ -0,0 +1,11 @@
1
+ /** A cell coordinates in the spreadsheet */
2
+ export type Point = {
3
+ /** The cell's column */
4
+ column: number;
5
+ /** The cell's row */
6
+ row: number;
7
+ };
8
+ /** Return whether two given points are the equal */
9
+ export declare function isEqual(source: Point, target: Point): boolean;
10
+ /** The origin point in matrices */
11
+ export declare const ORIGIN: Point;
@@ -0,0 +1,4 @@
1
+ import * as Types from './types';
2
+ import * as Actions from './actions';
3
+ export declare const INITIAL_STATE: Types.StoreState;
4
+ export default function reducer(state: Types.StoreState, action: Actions.Action): Types.StoreState;
@@ -0,0 +1,40 @@
1
+ import { PointRange } from './point-range';
2
+ import * as Matrix from './matrix';
3
+ import * as Types from './types';
4
+ import * as Point from './point';
5
+ import { Selection, RangeSelection, EntireColumnsSelection, EntireRowsSelection } from './selection';
6
+ export declare function applyBoldToCells(currentData: Matrix.Matrix<Types.CellBase<any>>, selectedRange: PointRange): Matrix.Matrix<Types.CellBase<any>>;
7
+ export declare function applyItalicToCells(currentData: Matrix.Matrix<Types.CellBase<any>>, selectedRange: PointRange): Matrix.Matrix<Types.CellBase<any>>;
8
+ export declare function applyFontFamily(currentData: Matrix.Matrix<Types.CellBase<any>>, selectedRange: PointRange, value: string): Matrix.Matrix<Types.CellBase<any>>;
9
+ export declare function applyFontSize(currentData: Matrix.Matrix<Types.CellBase<any>>, selectedRange: PointRange, value: string): Matrix.Matrix<Types.CellBase<any>>;
10
+ export declare function applyBorderToCells(currentData: Matrix.Matrix<Types.CellBase<any>>, selectedRange: PointRange, value: string, color: string): Matrix.Matrix<Types.CellBase<any>>;
11
+ export declare function applyTextAlign(currentData: Matrix.Matrix<Types.CellBase<any>>, selectedRange: PointRange, value: string): Matrix.Matrix<Types.CellBase<any>>;
12
+ export declare function applyUnderlineToCells(currentData: Matrix.Matrix<Types.CellBase<any>>, selectedRange: PointRange, value: string, active: boolean): Matrix.Matrix<Types.CellBase<any>>;
13
+ export declare function isValidHexColor(color: string): boolean;
14
+ export declare function applyColorToCells(currentData: Matrix.Matrix<Types.CellBase<any>>, selectedRange: PointRange | null, color: string): Matrix.Matrix<Types.CellBase<any>>;
15
+ export declare function applyBackgroundColorToCells(currentData: Matrix.Matrix<Types.CellBase<any>>, selectedRange: PointRange | null, backgroundColor: string): Matrix.Matrix<Types.CellBase<any>>;
16
+ export declare function edit(state: Types.StoreState): Types.StoreState;
17
+ export declare function clear(state: Types.StoreState): Types.StoreState;
18
+ export declare function blur(state: Types.StoreState): Types.StoreState;
19
+ export declare function view(state: Types.StoreState): Types.StoreState;
20
+ export declare function commit(changes: Types.CommitChanges): Partial<Types.StoreState>;
21
+ export declare const go: (rowDelta: number, columnDelta: number) => KeyDownHandler;
22
+ export type KeyDownHandler = (state: Types.StoreState, event: React.KeyboardEvent) => Types.StoreState | void;
23
+ export declare enum Direction {
24
+ Left = "Left",
25
+ Right = "Right",
26
+ Top = "Top",
27
+ Bottom = "Bottom"
28
+ }
29
+ export declare function getKeyDownHandler(state: Types.StoreState, event: React.KeyboardEvent): KeyDownHandler | undefined;
30
+ /** Returns whether the reducer has a handler for the given keydown event */
31
+ export declare function hasKeyDownHandler(state: Types.StoreState, event: React.KeyboardEvent): boolean;
32
+ /** Returns whether the active cell is read only */
33
+ export declare function isActiveReadOnly(state: Types.StoreState): boolean;
34
+ /** Gets active cell from given state */
35
+ export declare function getActive(state: Types.StoreState): Types.CellBase | null;
36
+ /** Modify given edge according to given active point and data */
37
+ export declare function modifyEdge<T extends Selection>(selection: T, active: Point.Point | null, data: Matrix.Matrix<unknown>, direction: Direction): T;
38
+ export declare function modifyRangeSelectionEdge(rangeSelection: RangeSelection, active: Point.Point, data: Matrix.Matrix<unknown>, edge: Direction): RangeSelection;
39
+ export declare function modifyEntireRowsSelection(selection: EntireRowsSelection, active: Point.Point, data: Matrix.Matrix<unknown>, edge: Direction): EntireRowsSelection;
40
+ export declare function modifyEntireColumnsSelection(selection: EntireColumnsSelection, active: Point.Point, data: Matrix.Matrix<unknown>, edge: Direction): EntireColumnsSelection;
@@ -0,0 +1,95 @@
1
+ import { PointRange } from './point-range';
2
+ import * as Point from './point';
3
+ import * as Matrix from './matrix';
4
+ /** Selection from a spreadsheet */
5
+ export declare abstract class Selection {
6
+ /** Get concrete range of the selection in the given data */
7
+ abstract toRange(data: Matrix.Matrix<unknown>): PointRange | null;
8
+ /** Normalize the selection according to the given data */
9
+ abstract normalizeTo(data: Matrix.Matrix<unknown>): this;
10
+ /** Determines whether the given row is entirely selected in given selection */
11
+ abstract hasEntireRow(row: number): boolean;
12
+ /** Determines whether the given column is entirely selected in given selection */
13
+ abstract hasEntireColumn(column: number): boolean;
14
+ /** Get the number of selected points according to given data */
15
+ abstract size(data: Matrix.Matrix<unknown>): number;
16
+ /** Determines whether the given point is within the selection */
17
+ abstract has(data: Matrix.Matrix<unknown>, point: Point.Point): boolean;
18
+ /** Determines whether the given selection is equal to this selection */
19
+ abstract equals(selection: Selection): boolean;
20
+ }
21
+ /** Selection of no cells */
22
+ export declare class EmptySelection extends Selection {
23
+ toRange(data: Matrix.Matrix<unknown>): PointRange | null;
24
+ normalizeTo(_: Matrix.Matrix<unknown>): this;
25
+ hasEntireRow(): boolean;
26
+ hasEntireColumn(): boolean;
27
+ size(): number;
28
+ has(): boolean;
29
+ equals(selection: Selection): boolean;
30
+ }
31
+ /** Selection of a range of cells */
32
+ export declare class RangeSelection extends Selection {
33
+ range: PointRange;
34
+ constructor(range: PointRange);
35
+ toRange(_: Matrix.Matrix<unknown>): PointRange | null;
36
+ normalizeTo(data: Matrix.Matrix<unknown>): this;
37
+ hasEntireRow(): boolean;
38
+ hasEntireColumn(): boolean;
39
+ size(data: Matrix.Matrix<unknown>): number;
40
+ has(data: Matrix.Matrix<unknown>, point: Point.Point): boolean;
41
+ equals(selection: Selection): boolean;
42
+ }
43
+ /** Selection of an entire part of the spreadsheet */
44
+ export declare abstract class EntireSelection extends Selection {
45
+ }
46
+ /** Selection of the entire worksheet */
47
+ export declare class EntireWorksheetSelection extends EntireSelection {
48
+ toRange(data: Matrix.Matrix<unknown>): PointRange;
49
+ normalizeTo(): this;
50
+ hasEntireColumn(): boolean;
51
+ hasEntireRow(): boolean;
52
+ size(data: Matrix.Matrix<unknown>): number;
53
+ has(): boolean;
54
+ equals(selection: Selection): boolean;
55
+ }
56
+ /** Selection of an entire axis in the spreadsheet */
57
+ export declare abstract class EntireAxisSelection extends EntireSelection {
58
+ /** Selection start index, integer */
59
+ readonly start: number;
60
+ /** Selection end index, integer */
61
+ readonly end: number;
62
+ /**
63
+ * @param start - row index where the selection starts, integer
64
+ * @param end - row index where the selection ends, integer
65
+ * @throws {@link InvalidIndexError}
66
+ */
67
+ constructor(start: number, end: number);
68
+ equals(selection: Selection): boolean;
69
+ }
70
+ /** Selection of entire rows in the spreadsheet */
71
+ export declare class EntireRowsSelection extends EntireAxisSelection {
72
+ toRange(data: Matrix.Matrix<unknown>): PointRange;
73
+ normalizeTo(data: Matrix.Matrix<unknown>): this;
74
+ hasEntireRow(row: number): boolean;
75
+ hasEntireColumn(): boolean;
76
+ size(data: Matrix.Matrix<unknown>): number;
77
+ has(_: Matrix.Matrix<unknown>, point: Point.Point): boolean;
78
+ }
79
+ /** Selection of entire columns in the spreadsheet */
80
+ export declare class EntireColumnsSelection extends EntireAxisSelection {
81
+ toRange(data: Matrix.Matrix<unknown>): PointRange;
82
+ normalizeTo(data: Matrix.Matrix<unknown>): this;
83
+ hasEntireRow(): boolean;
84
+ hasEntireColumn(column: number): boolean;
85
+ size(data: Matrix.Matrix<unknown>): number;
86
+ has(_: Matrix.Matrix<unknown>, point: Point.Point): boolean;
87
+ }
88
+ /** Get the point range of given matrix */
89
+ export declare function getMatrixRange(data: Matrix.Matrix<unknown>): PointRange;
90
+ /** Determines whether the given value is a valid index */
91
+ export declare function isIndex(value: number): boolean;
92
+ /** Error thrown when passing a non-index value where an index value is expected */
93
+ export declare class InvalidIndexError extends Error {
94
+ constructor(name: string);
95
+ }
@@ -0,0 +1,178 @@
1
+ import * as React from 'react';
2
+ import FormulaParser from 'fast-formula-parser';
3
+ import { Point } from './point';
4
+ import { Selection } from './selection';
5
+ import { Model } from './engine';
6
+ import { PointRange } from './point-range';
7
+ import { Matrix } from './matrix';
8
+ /** The base type of cell data in Spreadsheet */
9
+ export type CellBase<Value = any> = {
10
+ /** Whether the cell should not be editable */
11
+ readOnly?: boolean;
12
+ /** Class to be given for the cell element */
13
+ className?: string;
14
+ /** The value of the cell */
15
+ value: Value;
16
+ style?: React.CSSProperties | undefined;
17
+ type?: boolean;
18
+ /** Custom component to render when the cell is edited, if not defined would default to the component defined for the Spreadsheet */
19
+ DataEditor?: DataEditorComponent<CellBase<Value>>;
20
+ /** Custom component to render when the cell is viewed, if not defined would default to the component defined for the Spreadsheet */
21
+ DataViewer?: DataViewerComponent<CellBase<Value>>;
22
+ };
23
+ /**
24
+ * A cell with it's coordinates
25
+ * @deprecated the component does not use cell descriptors anymore. Instead it passes cell point and cell value explicitly.
26
+ */
27
+ export type CellDescriptor<Cell extends CellBase> = {
28
+ /** The cell's data */
29
+ data: Cell | undefined;
30
+ } & Point;
31
+ /** The spreadsheet's write mode */
32
+ export type Mode = 'view' | 'edit';
33
+ /** Dimensions of an element */
34
+ export type Dimensions = {
35
+ /** The element's width in pixels */
36
+ width: number;
37
+ /** The element's height in pixels */
38
+ height: number;
39
+ /** The distance of the element from it's container top border in pixels */
40
+ top: number;
41
+ /** The distance of the element from it's container left border in pixels */
42
+ left: number;
43
+ };
44
+ export type StoreState<Cell extends CellBase = CellBase> = {
45
+ model: Model<Cell>;
46
+ selected: Selection;
47
+ copied: PointRange | null;
48
+ hasPasted: boolean;
49
+ cut: boolean;
50
+ active: Point | null;
51
+ mode: Mode;
52
+ rowDimensions: Record<number, Pick<Dimensions, 'height' | 'top'> | undefined>;
53
+ columnDimensions: Record<number, Pick<Dimensions, 'width' | 'left'> | undefined>;
54
+ dragging: boolean;
55
+ lastChanged: Point | null;
56
+ lastCommit: null | CellChange<Cell>[];
57
+ };
58
+ export type CellChange<Cell extends CellBase = CellBase> = {
59
+ prevCell: Cell | null;
60
+ nextCell: Cell | null;
61
+ };
62
+ /** Type of Spreadsheet Cell component props */
63
+ export type CellComponentProps<Cell extends CellBase = CellBase> = {
64
+ /** The row of the cell */
65
+ row: number;
66
+ /** The column of the cell */
67
+ column: number;
68
+ /** The DataViewer component to be used by the cell */
69
+ DataViewer: DataViewerComponent<Cell>;
70
+ /** Whether the cell is selected */
71
+ selected: boolean;
72
+ /** Whether the cell is active */
73
+ active: boolean;
74
+ /** Whether the cell is copied */
75
+ copied: boolean;
76
+ /** Whether the user is dragging */
77
+ dragging: boolean;
78
+ /** The mode of the cell */
79
+ mode: Mode;
80
+ /** The data of the cell */
81
+ data: Cell | undefined;
82
+ /** The evaluated data of the cell */
83
+ evaluatedData: Cell | undefined;
84
+ /** Select the cell at the given point */
85
+ select: (point: Point) => void;
86
+ /** Activate the cell at the given point */
87
+ activate: (point: Point) => void;
88
+ /** Set the dimensions of the cell at the given point with the given dimensions */
89
+ setCellDimensions: (point: Point, dimensions: Dimensions) => void;
90
+ /** Set data of the cell */
91
+ setCellData: (cell: Cell) => void;
92
+ };
93
+ /** Type of the Spreadsheet Cell component */
94
+ export type CellComponent<Cell extends CellBase = CellBase> = React.ComponentType<CellComponentProps<Cell>>;
95
+ type DataComponentProps<Cell extends CellBase> = {
96
+ /** The rendered cell by the component */
97
+ cell: Cell | undefined;
98
+ } & Point;
99
+ /** Type of the Spreadsheet DataViewer component props */
100
+ export type DataViewerProps<Cell extends CellBase = CellBase> = DataComponentProps<Cell> & {
101
+ /** Set data of the cell */
102
+ setCellData: (cell: Cell) => void;
103
+ evaluatedCell: Cell | undefined;
104
+ };
105
+ /** Type of the Spreadsheet DataViewer component */
106
+ export type DataViewerComponent<Cell extends CellBase = CellBase> = React.ComponentType<DataViewerProps<Cell>>;
107
+ /** Type of the Spreadsheet DataEditor component props */
108
+ export type DataEditorProps<Cell extends CellBase = CellBase> = DataComponentProps<Cell> & {
109
+ /** Callback to be called when the cell's value is changed */
110
+ onChange: (cell: Cell) => void;
111
+ /** Callback to be called when edit mode should be exited */
112
+ exitEditMode: () => void;
113
+ };
114
+ /** Type of the Spreadsheet DataEditor component */
115
+ export type DataEditorComponent<Cell extends CellBase = CellBase> = React.ComponentType<DataEditorProps<Cell>>;
116
+ /** Type of the Spreadsheet Table component props */
117
+ export type TableProps = React.PropsWithChildren<{
118
+ /** Number of columns the table should render */
119
+ columns: number;
120
+ /** Whether column indicators are hidden */
121
+ hideColumnIndicators?: boolean | null;
122
+ }>;
123
+ /** Type of the Spreadsheet Table component */
124
+ export type TableComponent = React.ComponentType<TableProps>;
125
+ /** Type of the Spreadsheet Row component props */
126
+ export type RowProps = React.PropsWithChildren<{
127
+ /** The row index of the table */
128
+ row: number;
129
+ }>;
130
+ /** Type of the Row component */
131
+ export type RowComponent = React.ComponentType<RowProps>;
132
+ /** Type of the Spreadsheet HeaderRow component props */
133
+ export type HeaderRowProps = React.PropsWithChildren<{}>;
134
+ /** Type of the HeaderRow component */
135
+ export type HeaderRowComponent = React.ComponentType<HeaderRowProps>;
136
+ /** Type of the Spreadsheet RowIndicator component props */
137
+ export type RowIndicatorProps = {
138
+ /** The row the indicator indicates */
139
+ row: number;
140
+ /** A custom label for the indicator as provided in rowLabels */
141
+ label?: React.ReactNode | null;
142
+ /** Whether the entire row is selected */
143
+ selected: boolean;
144
+ /** Callback to be called when the row is selected */
145
+ onSelect: (row: number, extend: boolean) => void;
146
+ };
147
+ /** Type of the RowIndicator component */
148
+ export type RowIndicatorComponent = React.ComponentType<RowIndicatorProps>;
149
+ /** Type of the Spreadsheet ColumnIndicator component props */
150
+ export type ColumnIndicatorProps = {
151
+ /** The column the indicator indicates */
152
+ column: number;
153
+ /** A custom label for the indicator as provided in columnLabels */
154
+ label?: React.ReactNode | null;
155
+ /** Whether the entire column in selected */
156
+ selected: boolean;
157
+ /** Whether the entire column in Fixed */
158
+ fixed?: boolean;
159
+ /** Callback to be called when the column is selected */
160
+ onSelect: (column: number, extend: boolean) => void;
161
+ };
162
+ /** Type of the ColumnIndicator component */
163
+ export type ColumnIndicatorComponent = React.ComponentType<ColumnIndicatorProps>;
164
+ /** Type of the Spreadsheet CornerIndicator component props */
165
+ export type CornerIndicatorProps = {
166
+ /** Whether the entire table is selected */
167
+ selected: boolean;
168
+ /** Callback to select the entire table */
169
+ onSelect: () => void;
170
+ };
171
+ /** Type of the CornerIndicator component */
172
+ export type CornerIndicatorComponent = React.ComponentType<CornerIndicatorProps>;
173
+ export type CommitChanges<Cell extends CellBase = CellBase> = Array<{
174
+ prevCell: Cell | null;
175
+ nextCell: Cell | null;
176
+ }>;
177
+ export type CreateFormulaParser = (data: Matrix<CellBase>) => FormulaParser;
178
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Dispatch } from './context';
2
+ declare function useDispatch(): Dispatch;
3
+ export default useDispatch;
@@ -0,0 +1,3 @@
1
+ import * as Types from './types';
2
+ declare function useSelector<T>(selector: (state: Types.StoreState) => T): T;
3
+ export default useSelector;
@@ -0,0 +1,44 @@
1
+ import * as Types from './types';
2
+ import * as Matrix from './matrix';
3
+ import * as Point from './point';
4
+ import { PointRange } from './point-range';
5
+ import { Selection } from './selection';
6
+ export { createEmpty as createEmptyMatrix } from './matrix';
7
+ export declare const PLAIN_TEXT_MIME = "text/plain";
8
+ export declare const FOCUS_WITHIN_SELECTOR = ":focus-within";
9
+ /** Move the cursor of given input element to the input's end */
10
+ export declare function moveCursorToEnd(el: HTMLInputElement): void;
11
+ /**
12
+ * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. A step of -1 is used if a negative start is specified without an end or step. If end is not specified, it's set to start with start then set to 0.
13
+ * @param end - an integer number specifying at which position to stop (not included).
14
+ * @param start - An integer number specifying at which position to start.
15
+ * @param step - An integer number specifying the Increment */
16
+ export declare function range(end: number, start?: number, step?: number): number[];
17
+ /** Return whether given point is active */
18
+ export declare function isActive(active: Types.StoreState['active'], point: Point.Point): boolean;
19
+ /** Get the offset values of given element */
20
+ export declare function getOffsetRect(element: HTMLElement): Types.Dimensions;
21
+ /** Write given data to clipboard with given event */
22
+ export declare function writeTextToClipboard(event: ClipboardEvent, data: string): void;
23
+ /** Read text from given clipboard event */
24
+ export declare function readTextFromClipboard(event: ClipboardEvent): string;
25
+ /** Get the dimensions of cell at point from state */
26
+ export declare function getCellDimensions(point: Point.Point, rowDimensions: Types.StoreState['rowDimensions'] | undefined, columnDimensions: Types.StoreState['columnDimensions'] | undefined): Types.Dimensions | undefined;
27
+ /** Get the dimensions of a range of cells */
28
+ export declare function getRangeDimensions(rowDimensions: Types.StoreState['rowDimensions'], columnDimensions: Types.StoreState['columnDimensions'], range: PointRange): Types.Dimensions | undefined;
29
+ /** Get the dimensions of selected */
30
+ export declare function getSelectedDimensions(rowDimensions: Types.StoreState['rowDimensions'], columnDimensions: Types.StoreState['columnDimensions'], data: Matrix.Matrix<unknown>, selected: Selection): Types.Dimensions | undefined;
31
+ /** Get given data as CSV */
32
+ export declare function getCSV(data: Matrix.Matrix<Types.CellBase>): string;
33
+ /**
34
+ * Calculate the rows and columns counts of a spreadsheet
35
+ * @param data - the spreadsheet's data
36
+ * @param rowLabels - the spreadsheet's row labels (if defined)
37
+ * @param columnLabels - the spreadsheet's column labels (if defined)
38
+ * @returns the rows and columns counts of a spreadsheet
39
+ */
40
+ export declare function calculateSpreadsheetSize(data: Matrix.Matrix<unknown>, rowLabels?: string[], columnLabels?: string[]): Matrix.Size;
41
+ /** Should spreadsheet handle clipboard event */
42
+ export declare function shouldHandleClipboardEvent(root: Element | null, mode: Types.Mode): boolean;
43
+ export declare function isFocusedWithin(element: Element): boolean;
44
+ export declare function hasLineBreaker(value: unknown): boolean;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import ExcelFile from './ExcelFile/ExcelFile';
3
+ declare const meta: Meta<typeof ExcelFile>;
4
+ type Story = StoryObj<typeof ExcelFile>;
5
+ export declare const Default: Story;
6
+ export default meta;
@@ -0,0 +1,19 @@
1
+ import './ExcelToolBar.scss';
2
+ import { CellBase } from '../ExcelFile/ExcelFileComponents';
3
+ import * as Matrix from '../ExcelFile/ExcelFileComponents/matrix';
4
+ interface ExcelToolBarProps {
5
+ toolbar?: 'show' | 'disable' | 'hide';
6
+ data: Matrix.Matrix<CellBase>;
7
+ onBold: (data: Matrix.Matrix<CellBase>) => void;
8
+ onItalic: (data: Matrix.Matrix<CellBase>) => void;
9
+ setUnderlineType: (data: Matrix.Matrix<CellBase>, value: string, active: boolean) => void;
10
+ setColor: (data: Matrix.Matrix<CellBase>, value: string) => void;
11
+ setBackgroundColor: (data: Matrix.Matrix<CellBase>, value: string) => void;
12
+ setFormatePainter: (data: Matrix.Matrix<CellBase>) => void;
13
+ setTextAlign: (data: Matrix.Matrix<CellBase>, value: string) => void;
14
+ setFontSize: (data: Matrix.Matrix<CellBase>, value: string) => void;
15
+ setFontFamily: (data: Matrix.Matrix<CellBase>, value: string) => void;
16
+ setBorderType: (data: Matrix.Matrix<CellBase>, value: string, color: string) => void;
17
+ }
18
+ declare const ExcelToolBar: React.FC<ExcelToolBarProps>;
19
+ export default ExcelToolBar;