pixel-react 1.3.7 → 1.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/index.esm.js +54 -59
  3. package/lib/index.esm.js.map +1 -1
  4. package/lib/index.js +54 -59
  5. package/lib/index.js.map +1 -1
  6. package/lib/tsconfig.tsbuildinfo +1 -1
  7. package/package.json +2 -1
  8. package/rollup.config.mjs +15 -4
  9. package/src/assets/fonts/Poppins-Bold.ttf +0 -0
  10. package/src/assets/fonts/Poppins-Medium.ttf +0 -0
  11. package/src/assets/fonts/Poppins-Regular.ttf +0 -0
  12. package/src/assets/fonts/Poppins-SemiBold.ttf +0 -0
  13. package/src/assets/styles/_fonts.scss +12 -8
  14. package/src/components/Icon/Icons.scss +1 -4
  15. package/tsconfig.json +2 -2
  16. package/dist/tsconfig.tsbuildinfo +0 -1
  17. package/lib/StyleGuide/ColorPalette/ColorPalette.stories.d.ts +0 -6
  18. package/lib/StyleGuide/Typography/Typography.stories.d.ts +0 -6
  19. package/lib/components/Accordion/Accordion.stories.d.ts +0 -6
  20. package/lib/components/AddButton/AddButton.d.ts +0 -5
  21. package/lib/components/AddButton/AddButton.stories.d.ts +0 -6
  22. package/lib/components/AddButton/index.d.ts +0 -1
  23. package/lib/components/AddButton/types.d.ts +0 -4
  24. package/lib/components/AddResourceButton/AddButton.stories.d.ts +0 -8
  25. package/lib/components/AllProjectsDropdown/AllProjectsDropdown.stories.d.ts +0 -7
  26. package/lib/components/AppHeader/AppHeader.stories.d.ts +0 -7
  27. package/lib/components/AttachImage/AttachImage.stories.d.ts +0 -7
  28. package/lib/components/AttachmentButton/AttachmentButton.stories.d.ts +0 -9
  29. package/lib/components/Avatar/Avatar.stories.d.ts +0 -10
  30. package/lib/components/Button/Button.stories.d.ts +0 -13
  31. package/lib/components/Charts/BarChart/BarChart.stories.d.ts +0 -6
  32. package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.d.ts +0 -7
  33. package/lib/components/Charts/DonutChart/DonutChart.stories.d.ts +0 -6
  34. package/lib/components/Charts/IconRadialChart/IconRadialChart.stories.d.ts +0 -8
  35. package/lib/components/Charts/LineChart/LineChart.stories.d.ts +0 -7
  36. package/lib/components/Charts/MultiRadialChart/MultiRadialChart.stories.d.ts +0 -8
  37. package/lib/components/Charts/PieChart/PieChart.stories.d.ts +0 -7
  38. package/lib/components/Charts/RadialChart/RadialChart.stories.d.ts +0 -6
  39. package/lib/components/Checkbox/Checkbox.stories.d.ts +0 -8
  40. package/lib/components/Chip/Chip.stories.d.ts +0 -14
  41. package/lib/components/ConnectingBranch/ConnectingBranch.stories.d.ts +0 -6
  42. package/lib/components/DatePicker/DatePicker.stories.d.ts +0 -9
  43. package/lib/components/DragAndDrop/DragAndDrop.stories.d.ts +0 -6
  44. package/lib/components/Drawer/Drawer.stories.d.ts +0 -12
  45. package/lib/components/EditTextField/EditTextField.stories.d.ts +0 -10
  46. package/lib/components/Editor/Editor.stories.d.ts +0 -6
  47. package/lib/components/Excel/ExcelFile.stories.d.ts +0 -6
  48. package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +0 -14
  49. package/lib/components/ExcelFile/ColorBarselector/ColorBarSelector.d.ts +0 -8
  50. package/lib/components/ExcelFile/ContextMenu/ContextMenu.d.ts +0 -4
  51. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +0 -7
  52. package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +0 -4
  53. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +0 -5
  54. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +0 -3
  55. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +0 -5
  56. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +0 -5
  57. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +0 -8
  58. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +0 -10
  59. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +0 -3
  60. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +0 -3
  61. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +0 -5
  62. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +0 -3
  63. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +0 -81
  64. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +0 -3
  65. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +0 -130
  66. package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +0 -1
  67. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +0 -8
  68. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +0 -22
  69. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +0 -17
  70. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +0 -2
  71. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +0 -21
  72. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +0 -3
  73. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +0 -24
  74. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +0 -13
  75. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +0 -67
  76. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +0 -22
  77. package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +0 -11
  78. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +0 -27
  79. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +0 -95
  80. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +0 -215
  81. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +0 -3
  82. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +0 -3
  83. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +0 -45
  84. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +0 -3
  85. package/lib/components/ExcelFile/ExcelFile.stories.d.ts +0 -6
  86. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -15
  87. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +0 -3
  88. package/lib/components/ExcelFile/ImportExcelStyles.d.ts +0 -24
  89. package/lib/components/ExcelFile/Types.d.ts +0 -176
  90. package/lib/components/ExcelFile/index.d.ts +0 -1
  91. package/lib/components/ExpandableMenu/ExpandableMenu.stories.d.ts +0 -7
  92. package/lib/components/FF_Captcha/captcha.stories.d.ts +0 -8
  93. package/lib/components/FileDropzone/FileDropzone.stories.d.ts +0 -8
  94. package/lib/components/Form/Form.stories.d.ts +0 -7
  95. package/lib/components/GridLayout/GridLayout.stories.d.ts +0 -8
  96. package/lib/components/HighlightText/HighlightText.stories.d.ts +0 -6
  97. package/lib/components/Icon/Icon.stories.d.ts +0 -8
  98. package/lib/components/IconButton/IconButton.stories.d.ts +0 -7
  99. package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +0 -7
  100. package/lib/components/Input/Input.stories.d.ts +0 -9
  101. package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +0 -9
  102. package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +0 -13
  103. package/lib/components/LazyLoad/LazyLoad.stories.d.ts +0 -6
  104. package/lib/components/MachineInputField/MachineInputField.stories.d.ts +0 -6
  105. package/lib/components/MenuOption/MenuOption.stories.d.ts +0 -16
  106. package/lib/components/MiniModal/MiniModal.stories.d.ts +0 -10
  107. package/lib/components/Modal/Modal.stories.d.ts +0 -7
  108. package/lib/components/ModulesChip/ModuleChip.stories.d.ts +0 -6
  109. package/lib/components/MultiSelect/MultiSelect.stories.d.ts +0 -12
  110. package/lib/components/NLPInput/NlpInput.stories.d.ts +0 -7
  111. package/lib/components/Paper/Paper.stories.d.ts +0 -11
  112. package/lib/components/RadioButton/RadioButton.stories.d.ts +0 -10
  113. package/lib/components/RadioGroup/RadioGroup.stories.d.ts +0 -9
  114. package/lib/components/Search/Search.stories.d.ts +0 -6
  115. package/lib/components/Select/Select.stories.d.ts +0 -14
  116. package/lib/components/Select/components/Dropdown/Dropdown.d.ts +0 -4
  117. package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +0 -17
  118. package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.d.ts +0 -6
  119. package/lib/components/StateDropdown/StateDropdown.stories.d.ts +0 -10
  120. package/lib/components/StatusButton/StatusButton.stories.d.ts +0 -14
  121. package/lib/components/StatusCard/StatusCard.stories.d.ts +0 -11
  122. package/lib/components/Table/Table.stories.d.ts +0 -13
  123. package/lib/components/TableTree/TableTree.stories.d.ts +0 -7
  124. package/lib/components/Tabs/Tabs.stories.d.ts +0 -9
  125. package/lib/components/TextArea/Textarea.stories.d.ts +0 -9
  126. package/lib/components/Toast/Toast.stories.d.ts +0 -6
  127. package/lib/components/Toastify/Toastify.stories.d.ts +0 -6
  128. package/lib/components/Toggle/Toggle.stories.d.ts +0 -12
  129. package/lib/components/Tooltip/Tooltip.stories.d.ts +0 -15
  130. package/lib/components/Typography/Typography.stories.d.ts +0 -10
  131. package/lib/components/VariableInput/VariableInput.stories.d.ts +0 -6
  132. package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +0 -6
  133. package/lib/utils/compareArrays/compareArrays.stories.d.ts +0 -6
  134. package/lib/utils/compareObjects/compareObjects.stories.d.ts +0 -6
  135. package/lib/utils/debounce/debounce.stories.d.ts +0 -6
  136. package/lib/utils/ffID/ffID.stories.d.ts +0 -6
  137. package/lib/utils/find/findAndInsert.d.ts +0 -7
  138. package/lib/utils/find/findAndInsert.stories.d.ts +0 -7
  139. package/lib/utils/findAndInsert/findAndInsert.stories.d.ts +0 -7
  140. package/lib/utils/getEncryptedData/getEncryptedData.stories.d.ts +0 -6
  141. package/lib/utils/getExtension/getExtension.stories.d.ts +0 -6
  142. package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +0 -10
  143. package/lib/utils/throttle/throttle.stories.d.ts +0 -6
  144. package/lib/utils/truncateText/truncateText.stories.d.ts +0 -6
  145. /package/{src/fonts/Poppins → lib/assets/fonts}/Poppins-Bold.ttf +0 -0
  146. /package/{src/fonts/Poppins → lib/assets/fonts}/Poppins-Medium.ttf +0 -0
  147. /package/{src/fonts/Poppins → lib/assets/fonts}/Poppins-Regular.ttf +0 -0
  148. /package/{src/fonts/Poppins → lib/assets/fonts}/Poppins-SemiBold.ttf +0 -0
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- import * as Types from "./types";
3
- declare const CornerIndicator: Types.CornerIndicatorComponent;
4
- export default CornerIndicator;
5
- export declare const enhance: (CornerIndicatorComponent: Types.CornerIndicatorComponent) => React.FC<Omit<Types.CornerIndicatorProps, "selected" | "onSelect">>;
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- import * as Types from "./types";
3
- /** The default Spreadsheet DataEditor component */
4
- declare const DataEditor: React.FC<Types.DataEditorProps>;
5
- export default DataEditor;
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- import * as Types from "./types";
3
- export declare const TRUE_TEXT = "TRUE";
4
- export declare const FALSE_TEXT = "FALSE";
5
- /** The default Spreadsheet DataViewer component */
6
- declare const DataViewer: <Cell extends Types.CellBase<Value>, Value>({ cell, evaluatedCell, }: Types.DataViewerProps<Cell>) => React.ReactElement;
7
- export default DataViewer;
8
- export declare function convertBooleanToText(value: boolean): string;
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- import * as Types from "./types";
3
- export type Props = {
4
- variant?: string;
5
- dimensions?: Types.Dimensions | null | undefined;
6
- hidden?: boolean;
7
- dragging?: boolean;
8
- };
9
- declare const FloatingRect: React.FC<Props>;
10
- export default FloatingRect;
@@ -1,3 +0,0 @@
1
- import * as Types from "./types";
2
- declare const HeaderRow: Types.HeaderRowComponent;
3
- export default HeaderRow;
@@ -1,3 +0,0 @@
1
- import * as Types from "./types";
2
- declare const Row: Types.RowComponent;
3
- export default Row;
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- import * as Types from "./types";
3
- declare const RowIndicator: Types.RowIndicatorComponent;
4
- export default RowIndicator;
5
- export declare const enhance: (RowIndicatorComponent: Types.RowIndicatorComponent) => React.FC<Omit<Types.RowIndicatorProps, "selected" | "onSelect">>;
@@ -1,3 +0,0 @@
1
- import * as React from "react";
2
- declare const Selected: React.FC;
3
- export default Selected;
@@ -1,81 +0,0 @@
1
- import * as React from "react";
2
- import * as Types from "./types";
3
- import * as Matrix from "./matrix";
4
- import * as Point from "./point";
5
- import { Selection } from "./selection";
6
- import "./Spreadsheet.css";
7
- /** The Spreadsheet component props */
8
- export type Props<CellType extends Types.CellBase> = {
9
- /** The spreadsheet's data */
10
- data: Matrix.Matrix<CellType>;
11
- /** Class name to be added to the spreadsheet's root element */
12
- className?: string;
13
- /**
14
- * Use dark colors that complement dark mode
15
- * @defaultValue `false`
16
- */
17
- darkMode?: boolean;
18
- /**
19
- * Function used to create the formula parser (instance of
20
- * "fast-formula-parser") used by the Spreadsheet by getting the spreadsheet's
21
- * data.
22
- * @defaultValue function which creates a formula parser bound to the
23
- * Spreadsheet's data.
24
- * @see `createFormulaParser`
25
- * @see https://www.npmjs.com/package/fast-formula-parser
26
- */
27
- createFormulaParser?: Types.CreateFormulaParser;
28
- /**
29
- * Labels to use in column indicators.
30
- * @defaultValue alphabetical labels.
31
- */
32
- columnLabels?: string[];
33
- /**
34
- * Labels to use in row indicators.
35
- * @defaultValue row index labels.
36
- */
37
- rowLabels?: string[];
38
- /**
39
- * If set to true, hides the row indicators of the spreadsheet.
40
- * @defaultValue `false`.
41
- */
42
- hideRowIndicators?: boolean;
43
- /**
44
- * If set to true, hides the column indicators of the spreadsheet.
45
- * @defaultValue `false`.
46
- */
47
- hideColumnIndicators?: boolean;
48
- /** The selected cells in the worksheet. */
49
- selected?: Selection;
50
- /** Component rendered above each column. */
51
- ColumnIndicator?: Types.ColumnIndicatorComponent;
52
- /** Component rendered in the corner of row and column indicators. */
53
- CornerIndicator?: Types.CornerIndicatorComponent;
54
- /** Component rendered next to each row. */
55
- RowIndicator?: Types.RowIndicatorComponent;
56
- /** The Spreadsheet's table component. */
57
- Table?: Types.TableComponent;
58
- /** The Spreadsheet's row component. */
59
- Row?: Types.RowComponent;
60
- /** The spreadsheet's header row component */
61
- HeaderRow?: Types.HeaderRowComponent;
62
- /** The Spreadsheet's cell component. */
63
- Cell?: Types.CellComponent<CellType>;
64
- /** Component rendered for cells in view mode. */
65
- DataViewer?: Types.DataViewerComponent<CellType>;
66
- /** Component rendered for cells in edit mode. */
67
- DataEditor?: Types.DataEditorComponent<CellType>;
68
- /** Callback called on key down inside the spreadsheet. */
69
- onKeyDown?: (event: React.KeyboardEvent) => void;
70
- /** Callback called when the Spreadsheet's selection changes. */
71
- onSelect?: (selected: Selection) => void;
72
- /** Callback called when Spreadsheet's active cell changes. */
73
- onActivate?: (active: Point.Point) => void;
74
- /** Callback called when the Spreadsheet's evaluated data changes. */
75
- onEvaluatedDataChange?: (data: Matrix.Matrix<CellType>) => void;
76
- };
77
- /**
78
- * The Spreadsheet component
79
- */
80
- declare const Spreadsheet: <CellType extends Types.CellBase>(props: Props<CellType>) => React.ReactElement;
81
- export default Spreadsheet;
@@ -1,3 +0,0 @@
1
- import * as Types from "./types";
2
- declare const Table: Types.TableComponent;
3
- export default Table;
@@ -1,130 +0,0 @@
1
- import { Matrix } from "./matrix";
2
- import { Point } from "./point";
3
- import { CellBase, Dimensions, CommitChanges, CreateFormulaParser } from "./types";
4
- import { Selection } from "./selection";
5
- export declare const SET_DATA = "SET_DATA";
6
- export declare const SET_CREATE_FORMULA_PARSER = "SET_CREATE_FORMULA_PARSER";
7
- export declare const SELECT_ENTIRE_ROW = "SELECT_ENTIRE_ROW";
8
- export declare const SELECT_ENTIRE_COLUMN = "SELECT_ENTIRE_COLUMN";
9
- export declare const SELECT_ENTIRE_WORKSHEET = "SELECT_ENTIRE_WORKSHEET";
10
- export declare const SET_SELECTION = "SET_SELECTION";
11
- export declare const SELECT = "SELECT";
12
- export declare const ACTIVATE = "ACTIVATE";
13
- export declare const SET_CELL_DATA = "SET_CELL_DATA";
14
- export declare const SET_CELL_DIMENSIONS = "SET_CELL_DIMENSIONS";
15
- export declare const COPY = "COPY";
16
- export declare const CUT = "CUT";
17
- export declare const PASTE = "PASTE";
18
- export declare const EDIT = "EDIT";
19
- export declare const VIEW = "VIEW";
20
- export declare const CLEAR = "CLEAR";
21
- export declare const BLUR = "BLUR";
22
- export declare const KEY_PRESS = "KEY_PRESS";
23
- export declare const KEY_DOWN = "KEY_DOWN";
24
- export declare const DRAG_START = "DRAG_START";
25
- export declare const DRAG_END = "DRAG_END";
26
- export declare const COMMIT = "COMMIT";
27
- export type BaseAction<T extends string> = {
28
- type: T;
29
- };
30
- export type SetDataAction = BaseAction<typeof SET_DATA> & {
31
- payload: {
32
- data: Matrix<CellBase>;
33
- };
34
- };
35
- export declare function setData(data: Matrix<CellBase>): SetDataAction;
36
- export type SetCreateFormulaParserAction = BaseAction<typeof SET_CREATE_FORMULA_PARSER> & {
37
- payload: {
38
- createFormulaParser: CreateFormulaParser;
39
- };
40
- };
41
- export declare function setCreateFormulaParser(createFormulaParser: CreateFormulaParser): SetCreateFormulaParserAction;
42
- export type SelectEntireRowAction = BaseAction<typeof SELECT_ENTIRE_ROW> & {
43
- payload: {
44
- row: number;
45
- extend: boolean;
46
- };
47
- };
48
- export declare function selectEntireRow(row: number, extend: boolean): SelectEntireRowAction;
49
- export type SelectEntireColumnAction = BaseAction<typeof SELECT_ENTIRE_COLUMN> & {
50
- payload: {
51
- column: number;
52
- extend: boolean;
53
- };
54
- };
55
- export declare function selectEntireColumn(column: number, extend: boolean): SelectEntireColumnAction;
56
- export type SelectEntireWorksheetAction = BaseAction<typeof SELECT_ENTIRE_WORKSHEET>;
57
- export declare function selectEntireWorksheet(): SelectEntireWorksheetAction;
58
- export type SetSelectionAction = BaseAction<typeof SET_SELECTION> & {
59
- payload: {
60
- selection: Selection;
61
- };
62
- };
63
- export declare function setSelection(selection: Selection): SetSelectionAction;
64
- export type SelectAction = BaseAction<typeof SELECT> & {
65
- payload: {
66
- point: Point;
67
- };
68
- };
69
- export declare function select(point: Point): SelectAction;
70
- export type ActivateAction = BaseAction<typeof ACTIVATE> & {
71
- payload: {
72
- point: Point;
73
- };
74
- };
75
- export declare function activate(point: Point): ActivateAction;
76
- export type SetCellDataAction = BaseAction<typeof SET_CELL_DATA> & {
77
- payload: {
78
- active: Point;
79
- data: CellBase;
80
- };
81
- };
82
- export declare function setCellData(active: Point, data: CellBase): SetCellDataAction;
83
- export type SetCellDimensionsAction = BaseAction<typeof SET_CELL_DIMENSIONS> & {
84
- payload: {
85
- point: Point;
86
- dimensions: Dimensions;
87
- };
88
- };
89
- export declare function setCellDimensions(point: Point, dimensions: Dimensions): SetCellDimensionsAction;
90
- export type PasteAction = BaseAction<typeof PASTE> & {
91
- payload: {
92
- data: string;
93
- };
94
- };
95
- export declare function paste(data: string): PasteAction;
96
- export type KeyPressAction = BaseAction<typeof KEY_PRESS> & {
97
- payload: {
98
- event: React.KeyboardEvent;
99
- };
100
- };
101
- export declare function keyPress(event: React.KeyboardEvent): KeyPressAction;
102
- export type KeyDownAction = BaseAction<typeof KEY_DOWN> & {
103
- payload: {
104
- event: React.KeyboardEvent;
105
- };
106
- };
107
- export declare function keyDown(event: React.KeyboardEvent): KeyDownAction;
108
- export type DragStartAction = BaseAction<typeof DRAG_START>;
109
- export declare function dragStart(): DragStartAction;
110
- export type DragEndAction = BaseAction<typeof DRAG_END>;
111
- export declare function dragEnd(): DragEndAction;
112
- export type CommitAction = BaseAction<typeof COMMIT> & {
113
- payload: {
114
- changes: CommitChanges;
115
- };
116
- };
117
- export declare function commit(changes: CommitChanges): CommitAction;
118
- export type CopyAction = BaseAction<typeof COPY>;
119
- export declare function copy(): CopyAction;
120
- export type CutAction = BaseAction<typeof CUT>;
121
- export declare function cut(): CutAction;
122
- export type EditAction = BaseAction<typeof EDIT>;
123
- export declare function edit(): EditAction;
124
- export type ViewAction = BaseAction<typeof VIEW>;
125
- export declare function view(): ViewAction;
126
- export type ClearAction = BaseAction<typeof CLEAR>;
127
- export declare function clear(): ClearAction;
128
- export type BlurAction = BaseAction<typeof BLUR>;
129
- export declare function blur(): BlurAction;
130
- export type Action = SetDataAction | SetCreateFormulaParserAction | SelectEntireRowAction | SelectEntireColumnAction | SelectEntireWorksheetAction | SetSelectionAction | SelectAction | ActivateAction | SetCellDataAction | SetCellDimensionsAction | PasteAction | KeyPressAction | KeyDownAction | DragStartAction | DragEndAction | CommitAction | CopyAction | CutAction | EditAction | ViewAction | ClearAction | BlurAction;
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- import reducer from "./reducer";
3
- import { Action } from "./actions";
4
- export type ReducerState = React.ReducerState<typeof reducer>;
5
- export type Dispatch = React.Dispatch<Action>;
6
- export type Value = [ReducerState, Dispatch];
7
- declare const context: import("use-context-selector").Context<Value>;
8
- export default context;
@@ -1,22 +0,0 @@
1
- import FormulaParser, { Value } from "fast-formula-parser";
2
- import * as Matrix from "../matrix";
3
- import { Point } from "../point";
4
- import { CellBase, CreateFormulaParser } from "../types";
5
- import { PointGraph } from "./point-graph";
6
- export declare class Model<Cell extends CellBase> {
7
- readonly data: Matrix.Matrix<Cell>;
8
- readonly evaluatedData: Matrix.Matrix<Cell>;
9
- readonly referenceGraph: PointGraph;
10
- readonly createFormulaParser: CreateFormulaParser;
11
- constructor(createFormulaParser: CreateFormulaParser, data: Matrix.Matrix<Cell>, referenceGraph?: PointGraph, evaluatedData?: Matrix.Matrix<Cell>);
12
- }
13
- export declare function updateCellValue<Cell extends CellBase>(model: Model<Cell>, point: Point, cell: Cell): Model<Cell>;
14
- /**
15
- *
16
- * @param data - the spreadsheet data
17
- * @returns the spreadsheet reference graph
18
- */
19
- export declare function createReferenceGraph(data: Matrix.Matrix<CellBase>): PointGraph;
20
- export declare function createEvaluatedData<Cell extends CellBase>(data: Matrix.Matrix<Cell>, referenceGraph: PointGraph, createFormulaParser: CreateFormulaParser): Matrix.Matrix<Cell>;
21
- /** Get the computed value of a formula cell */
22
- export declare function getFormulaComputedValue(value: string, point: Point, formulaParser: FormulaParser): Value;
@@ -1,17 +0,0 @@
1
- import FormulaParser, { FormulaParserConfig, Value } from "fast-formula-parser";
2
- import { Point } from "../point";
3
- import * as Matrix from "../matrix";
4
- import { CellBase } from "../types";
5
- import { PointSet } from "./point-set";
6
- export declare const FORMULA_VALUE_PREFIX = "=";
7
- /** Returns whether given value is a formula */
8
- export declare function isFormulaValue(value: unknown): value is string;
9
- /** Extracts formula from value */
10
- export declare function extractFormula(value: string): string;
11
- export declare function createFormulaParser(data: Matrix.Matrix<CellBase>, config?: Omit<FormulaParserConfig, "onCell" | "onRange">): FormulaParser;
12
- /**
13
- * For given formula returns the cell references
14
- * @param formula - formula to get references for
15
- */
16
- export declare function getReferences(formula: string, point: Point, data: Matrix.Matrix<CellBase>): PointSet;
17
- export declare function evaluate(formula: string, point: Point, formulaParser: FormulaParser): Value;
@@ -1,2 +0,0 @@
1
- export { Model, updateCellValue } from "./engine";
2
- export { createFormulaParser } from "./formula";
@@ -1,21 +0,0 @@
1
- import { Point } from "../point";
2
- import { PointSet } from "./point-set";
3
- /**
4
- * Immutable directed graph of points, where each point can have multiple
5
- * edges to other points.
6
- */
7
- export declare class PointGraph {
8
- private forwards;
9
- private constructor();
10
- /** Creates a new PointGraph instance from an array-like or iterable object */
11
- static from(pairs: Iterable<[Point, PointSet]>): PointGraph;
12
- set(node: Point, edges: PointSet): PointGraph;
13
- get(node: Point): PointSet;
14
- getBackwards(node: Point): PointSet;
15
- getBackwardsRecursive(node: Point, visited?: PointSet): PointSet;
16
- /** Determine whether the graph has a circular dependency, starting from given start point */
17
- hasCircularDependency(startPoint: Point): boolean;
18
- [Symbol.iterator](): Iterator<[Point, PointSet]>;
19
- /** Get the points in the graph in a breadth-first order */
20
- traverseBFSBackwards(): Generator<Point>;
21
- }
@@ -1,3 +0,0 @@
1
- import { Point } from "../point";
2
- export declare function toString(point: Point): string;
3
- export declare function fromString(point: string): Point;
@@ -1,24 +0,0 @@
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
- }
@@ -1,13 +0,0 @@
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";
@@ -1,67 +0,0 @@
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;
@@ -1,22 +0,0 @@
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
- }
@@ -1,11 +0,0 @@
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;
@@ -1,27 +0,0 @@
1
- import * as Matrix from "./matrix";
2
- import * as Types from "./types";
3
- import * as Point from "./point";
4
- import { Selection, RangeSelection, EntireColumnsSelection, EntireRowsSelection } from "./selection";
5
- import * as Actions from "./actions";
6
- export declare const INITIAL_STATE: Types.StoreState;
7
- export default function reducer(state: Types.StoreState, action: Actions.Action): Types.StoreState;
8
- export declare const go: (rowDelta: number, columnDelta: number) => KeyDownHandler;
9
- export type KeyDownHandler = (state: Types.StoreState, event: React.KeyboardEvent) => Types.StoreState | void;
10
- export declare enum Direction {
11
- Left = "Left",
12
- Right = "Right",
13
- Top = "Top",
14
- Bottom = "Bottom"
15
- }
16
- export declare function getKeyDownHandler(state: Types.StoreState, event: React.KeyboardEvent): KeyDownHandler | undefined;
17
- /** Returns whether the reducer has a handler for the given keydown event */
18
- export declare function hasKeyDownHandler(state: Types.StoreState, event: React.KeyboardEvent): boolean;
19
- /** Returns whether the active cell is read only */
20
- export declare function isActiveReadOnly(state: Types.StoreState): boolean;
21
- /** Gets active cell from given state */
22
- export declare function getActive(state: Types.StoreState): Types.CellBase | null;
23
- /** Modify given edge according to given active point and data */
24
- export declare function modifyEdge<T extends Selection>(selection: T, active: Point.Point | null, data: Matrix.Matrix<unknown>, direction: Direction): T;
25
- export declare function modifyRangeSelectionEdge(rangeSelection: RangeSelection, active: Point.Point, data: Matrix.Matrix<unknown>, edge: Direction): RangeSelection;
26
- export declare function modifyEntireRowsSelection(selection: EntireRowsSelection, active: Point.Point, data: Matrix.Matrix<unknown>, edge: Direction): EntireRowsSelection;
27
- export declare function modifyEntireColumnsSelection(selection: EntireColumnsSelection, active: Point.Point, data: Matrix.Matrix<unknown>, edge: Direction): EntireColumnsSelection;
@@ -1,95 +0,0 @@
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
- }