pixel-react 1.2.7 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Drawer/Types.d.ts +23 -12
- package/lib/components/Editor/Editor.d.ts +5 -0
- package/lib/components/Editor/Editor.stories.d.ts +6 -0
- package/lib/components/Editor/VariableDropdown.d.ts +5 -0
- package/lib/components/Editor/constants.d.ts +3 -0
- package/lib/components/Editor/index.d.ts +1 -0
- package/lib/components/Editor/types.d.ts +71 -0
- package/lib/components/Excel/ContextMenu/ContextMenu.d.ts +4 -0
- package/lib/components/Excel/ExcelFile/ExcelFile.d.ts +20 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.d.ts +7 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Cell.d.ts +4 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.d.ts +5 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Copied.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/CornerIndicator.d.ts +5 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.d.ts +5 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.d.ts +8 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.d.ts +10 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/HeaderRow.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Row.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.d.ts +5 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Selected.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +80 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Table.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +203 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/areModelsEqual.d.ts +1 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/context.d.ts +8 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.d.ts +22 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.d.ts +17 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/index.d.ts +2 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.d.ts +21 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-hash.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-set.d.ts +24 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/index.d.ts +13 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/matrix.d.ts +67 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/point-range.d.ts +22 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/point.d.ts +11 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.d.ts +4 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +40 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/selection.d.ts +95 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +178 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/use-dispatch.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/use-selector.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.d.ts +44 -0
- package/lib/components/Excel/ExcelFile.stories.d.ts +6 -0
- package/lib/components/Excel/ExcelToolBar/ExcelToolBar.d.ts +19 -0
- package/lib/components/Excel/Types.d.ts +129 -0
- package/lib/components/Excel/index.d.ts +1 -0
- package/lib/components/ExcelFile/ColorBarselector/ColorBarSelector.d.ts +8 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +7 -6
- package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +5 -49
- package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +3 -3
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +5 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +6 -6
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +11 -11
- package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +5 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +3 -3
- package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +48 -11
- package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +12 -11
- package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +0 -16
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +0 -12
- package/lib/components/ExcelFile/Types.d.ts +49 -2
- package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
- package/lib/components/InputWithDropdown/types.d.ts +3 -1
- package/lib/components/MenuOption/MenuOption.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +4 -0
- package/lib/components/Select/Select.d.ts +3 -2
- package/lib/components/Select/Select.stories.d.ts +1 -0
- package/lib/components/Select/components/Dropdown.d.ts +5 -0
- package/lib/components/Select/components/types.d.ts +18 -0
- package/lib/components/Select/types.d.ts +2 -42
- package/lib/components/Toastify/Toastify.d.ts +5 -4
- package/lib/components/Toastify/types.d.ts +1 -0
- package/lib/index.d.ts +75 -30
- package/lib/index.esm.js +1734 -1441
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1734 -1440
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/getSequentialPayload/getSequentialPayload.d.ts +2 -0
- package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
- package/lib/utils/getSequentialPayload/types.d.ts +30 -0
- package/package.json +1 -1
- package/src/assets/Themes/BaseTheme.scss +5 -0
- package/src/assets/Themes/DarkTheme.scss +2 -0
- package/src/assets/icons/maximize_icon.svg +5 -0
- package/src/assets/styles/_fonts.scss +1 -1
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +15 -6
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +0 -5
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +20 -10
- package/src/components/Drawer/Drawer.scss +1 -0
- package/src/components/Drawer/Types.ts +24 -13
- package/src/components/Excel/ExcelFile/ExcelFile.scss +62 -0
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +312 -0
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.tsx +2 -2
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.tsx +3 -3
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.tsx +4 -4
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.tsx +2 -2
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.tsx +1 -1
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.tsx +3 -3
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.tsx +4 -4
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.tsx +4 -4
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.scss +26 -24
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.tsx +13 -45
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.tsx +1 -1
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.ts +88 -20
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +495 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +758 -0
- package/src/components/{ExcelFile → Excel}/ExcelFile.stories.tsx +45 -0
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.scss +36 -0
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +346 -0
- package/src/components/Form/Form.scss +54 -35
- package/src/components/Form/Form.stories.tsx +264 -225
- package/src/components/Icon/Icons.scss +4 -0
- package/src/components/Icon/iconList.ts +2 -1
- package/src/components/Input/Input.tsx +0 -1
- package/src/components/InputWithDropdown/InputWithDropdown.scss +30 -1
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +45 -16
- package/src/components/InputWithDropdown/types.ts +5 -1
- package/src/components/MenuOption/MenuOption.scss +0 -1
- package/src/components/MenuOption/MenuOption.stories.tsx +3 -0
- package/src/components/MenuOption/MenuOption.tsx +5 -4
- package/src/components/MenuOption/types.ts +4 -0
- package/src/components/MultiSelect/MultiSelect.scss +5 -1
- package/src/components/MultiSelect/MultiSelect.stories.tsx +17 -13
- package/src/components/MultiSelect/MultiSelect.tsx +27 -14
- package/src/components/Select/Select.scss +121 -188
- package/src/components/Select/Select.stories.tsx +164 -18
- package/src/components/Select/Select.tsx +142 -290
- package/src/components/Select/components/Dropdown.scss +50 -0
- package/src/components/Select/components/Dropdown.tsx +94 -0
- package/src/components/Select/components/types.ts +20 -0
- package/src/components/Select/types.ts +15 -39
- package/src/components/Table/Table.scss +6 -5
- package/src/components/Table/Table.stories.tsx +0 -9
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/TableTree/TableTree.scss +1 -1
- package/src/components/TableTree/TableTree.tsx +3 -1
- package/src/components/Toastify/Toastify.stories.tsx +29 -10
- package/src/components/Toastify/Toastify.tsx +42 -16
- package/src/components/Toastify/types.ts +2 -0
- package/src/index.ts +4 -2
- package/src/utils/getSelectOptionValue/getSelectOptionValue.ts +1 -1
- package/src/utils/getSequentialPayload/getSequentialPayload.stories.tsx +75 -0
- package/src/utils/getSequentialPayload/getSequentialPayload.ts +29 -0
- package/src/utils/getSequentialPayload/types.ts +35 -0
- package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +0 -952
- package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -24
- package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +0 -162
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +0 -16
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +0 -68
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -19
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +0 -291
- package/src/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
- package/src/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/src/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Black.ttf +0 -0
- package/src/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Italic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Light.ttf +0 -0
- package/src/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Thin.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
- /package/lib/components/{ExcelFile → Excel}/ColorBarSelector/ColorBarSelector.d.ts +0 -0
- /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.scss +0 -0
- /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.tsx +0 -0
- /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.scss +0 -0
- /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/typings/fast-formula-parser.d.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.ts +0 -0
- /package/src/components/{ExcelFile → Excel}/Types.ts +0 -0
- /package/src/components/{ExcelFile → Excel}/index.ts +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
interface ExcelFileProps {
|
|
2
|
+
/** The Excel data containing sheets and their content */
|
|
3
|
+
excelData: {
|
|
4
|
+
sheets: WorkSheet[];
|
|
5
|
+
};
|
|
6
|
+
/** Optional: Provide context menu options for actions like right-click */
|
|
7
|
+
contextOption?: {
|
|
8
|
+
name: string;
|
|
9
|
+
title: React.ReactNode;
|
|
10
|
+
action: () => void;
|
|
11
|
+
}[];
|
|
12
|
+
/** Controls whether the toolbar is shown, disabled, or hidden */
|
|
13
|
+
toolbar?: 'show' | 'disable' | 'hide';
|
|
14
|
+
/** Callback function to save the Excel data */
|
|
15
|
+
onSave?: (excelData?: any) => void;
|
|
16
|
+
}
|
|
17
|
+
interface WorkSheet {
|
|
18
|
+
/** The name of the worksheet */
|
|
19
|
+
sheetName: string;
|
|
20
|
+
/** 2D array of worksheet data (cells) */
|
|
21
|
+
data: WorkData[][];
|
|
22
|
+
}
|
|
23
|
+
interface WorkData {
|
|
24
|
+
/** Value of the cell */
|
|
25
|
+
value: string;
|
|
26
|
+
/** Styling options for the cell */
|
|
27
|
+
style: React.CSSProperties;
|
|
28
|
+
type?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** A generic type to represent a 2D matrix of any type (or undefined values) */
|
|
31
|
+
type Matrix<T> = (T | undefined)[][];
|
|
32
|
+
interface ContextAction {
|
|
33
|
+
/** Name of the right-click option */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Display title of the right-click menu option */
|
|
36
|
+
title: React.ReactNode;
|
|
37
|
+
/** The action that occurs when the right-click menu option is selected */
|
|
38
|
+
action: () => void;
|
|
39
|
+
}
|
|
40
|
+
interface ContextOption {
|
|
41
|
+
/** Type of the context option ('cell', 'row', 'column') */
|
|
42
|
+
name: string;
|
|
43
|
+
/** Array of context menu actions for right-click options */
|
|
44
|
+
value: ContextAction[];
|
|
45
|
+
}
|
|
46
|
+
interface ContextMenuState {
|
|
47
|
+
/** Whether the context menu is visible */
|
|
48
|
+
visible: boolean;
|
|
49
|
+
/** X-coordinate position for the context menu */
|
|
50
|
+
x: number;
|
|
51
|
+
/** Y-coordinate position for the context menu */
|
|
52
|
+
y: number;
|
|
53
|
+
/** Type of the context menu ('cell', 'row', 'column', or 'sheet_options') */
|
|
54
|
+
type: 'cell' | 'row' | 'column' | 'sheet_options' | null;
|
|
55
|
+
}
|
|
56
|
+
interface SelectedCell {
|
|
57
|
+
/** The row index of the selected cell */
|
|
58
|
+
row: number;
|
|
59
|
+
/** The column index of the selected cell */
|
|
60
|
+
column: number;
|
|
61
|
+
}
|
|
62
|
+
interface ColorContainer {
|
|
63
|
+
/** The color used for the text (hex code) */
|
|
64
|
+
color: string;
|
|
65
|
+
/** The background color used for the cell (hex code) */
|
|
66
|
+
backgroundColor: string;
|
|
67
|
+
/** The border color used for the cell (hex code) */
|
|
68
|
+
borderColor: string;
|
|
69
|
+
}
|
|
70
|
+
interface SelectedValue {
|
|
71
|
+
/** The value inside the selected cell */
|
|
72
|
+
value: string;
|
|
73
|
+
/** The row index of the selected cell */
|
|
74
|
+
row: number;
|
|
75
|
+
/** The column index of the selected cell */
|
|
76
|
+
column: number;
|
|
77
|
+
/** The column represented as an alphabetical string ('A', 'B') */
|
|
78
|
+
alphaCol: string;
|
|
79
|
+
/** The style applied to the selected cell */
|
|
80
|
+
style: React.CSSProperties;
|
|
81
|
+
/** The sheet name where the cell is located */
|
|
82
|
+
sheet: string;
|
|
83
|
+
}
|
|
84
|
+
interface ExcelSheetBarProps {
|
|
85
|
+
/** Object containing details about the file, including sheet names */
|
|
86
|
+
fileDetails: {
|
|
87
|
+
sheetNames: string[];
|
|
88
|
+
};
|
|
89
|
+
/** Function to handle sheet change events */
|
|
90
|
+
handleSheetChange: (name: string, index: number) => void;
|
|
91
|
+
/** Function to open the context menu on a sheet */
|
|
92
|
+
contextMenu: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, name: string, index: number) => void;
|
|
93
|
+
/** Function to add a new sheet */
|
|
94
|
+
addSheet: () => void;
|
|
95
|
+
/** Object representing the currently selected sheet */
|
|
96
|
+
selectedSheet: {
|
|
97
|
+
name: string;
|
|
98
|
+
index: number;
|
|
99
|
+
};
|
|
100
|
+
/** Function to update the context Type */
|
|
101
|
+
contextSelect: (event: React.MouseEvent) => void;
|
|
102
|
+
}
|
|
103
|
+
interface ContextMenuProps {
|
|
104
|
+
/** Custom context menu options */
|
|
105
|
+
customContext: {
|
|
106
|
+
name: string;
|
|
107
|
+
title: React.ReactNode;
|
|
108
|
+
action: () => void;
|
|
109
|
+
}[];
|
|
110
|
+
/** Object that holds different context actions based on the type (cell, row, column, sheet_options) */
|
|
111
|
+
contextAction: {
|
|
112
|
+
/** Function to add a row */
|
|
113
|
+
addRow: () => void;
|
|
114
|
+
/** Function to delete a row */
|
|
115
|
+
deleteRow: () => void;
|
|
116
|
+
/** Function to add a column */
|
|
117
|
+
addColumn: () => void;
|
|
118
|
+
/** Function to delete a column */
|
|
119
|
+
deleteColumn: () => void;
|
|
120
|
+
/** Function to add a new sheet */
|
|
121
|
+
addSheet: () => void;
|
|
122
|
+
/** Function to delete a sheet */
|
|
123
|
+
deleteSheet: () => void;
|
|
124
|
+
};
|
|
125
|
+
/** The state of the context menu, controlling its visibility and position */
|
|
126
|
+
contextData: ContextMenuState;
|
|
127
|
+
/** Function to update the context menu state */
|
|
128
|
+
setContextData: React.Dispatch<React.SetStateAction<ContextMenuState>>;
|
|
129
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ExcelFile/ExcelFile';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './ColorBarSelector.scss';
|
|
3
|
+
interface ColorBarSelectorProps {
|
|
4
|
+
getColorValue: (color: string) => void;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const ColorBarSelector: React.FC<ColorBarSelectorProps>;
|
|
8
|
+
export default ColorBarSelector;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as Types from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Types from "./types";
|
|
3
3
|
declare const ColumnIndicator: Types.ColumnIndicatorComponent;
|
|
4
4
|
export default ColumnIndicator;
|
|
5
5
|
export declare const enhance: (ColumnIndicatorComponent: Types.ColumnIndicatorComponent) => React.FC<Omit<Types.ColumnIndicatorProps, "selected" | "onSelect">>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as Types from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Types from "./types";
|
|
3
3
|
declare const CornerIndicator: Types.CornerIndicatorComponent;
|
|
4
4
|
export default CornerIndicator;
|
|
5
5
|
export declare const enhance: (CornerIndicatorComponent: Types.CornerIndicatorComponent) => React.FC<Omit<Types.CornerIndicatorProps, "selected" | "onSelect">>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as Types from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Types from "./types";
|
|
3
3
|
/** The default Spreadsheet DataEditor component */
|
|
4
4
|
declare const DataEditor: React.FC<Types.DataEditorProps>;
|
|
5
5
|
export default DataEditor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as Types from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Types from "./types";
|
|
3
3
|
export declare const TRUE_TEXT = "TRUE";
|
|
4
4
|
export declare const FALSE_TEXT = "FALSE";
|
|
5
5
|
/** The default Spreadsheet DataViewer component */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as Types from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Types from "./types";
|
|
3
3
|
declare const RowIndicator: Types.RowIndicatorComponent;
|
|
4
4
|
export default RowIndicator;
|
|
5
5
|
export declare const enhance: (RowIndicatorComponent: Types.RowIndicatorComponent) => React.FC<Omit<Types.RowIndicatorProps, "selected" | "onSelect">>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as Types from
|
|
3
|
-
import * as Matrix from
|
|
4
|
-
import * as Point from
|
|
5
|
-
import { Selection } from
|
|
6
|
-
import
|
|
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
7
|
/** The Spreadsheet component props */
|
|
8
8
|
export type Props<CellType extends Types.CellBase> = {
|
|
9
9
|
/** The spreadsheet's data */
|
|
@@ -14,6 +14,7 @@ export type Props<CellType extends Types.CellBase> = {
|
|
|
14
14
|
* Use dark colors that complement dark mode
|
|
15
15
|
* @defaultValue `false`
|
|
16
16
|
*/
|
|
17
|
+
darkMode?: boolean;
|
|
17
18
|
/**
|
|
18
19
|
* Function used to create the formula parser (instance of
|
|
19
20
|
* "fast-formula-parser") used by the Spreadsheet by getting the spreadsheet's
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Matrix } from
|
|
2
|
-
import { Point } from
|
|
3
|
-
import { CellBase, Dimensions, CommitChanges, CreateFormulaParser } from
|
|
4
|
-
import { Selection } from
|
|
1
|
+
import { Matrix } from "./matrix";
|
|
2
|
+
import { Point } from "./point";
|
|
3
|
+
import { CellBase, Dimensions, CommitChanges, CreateFormulaParser } from "./types";
|
|
4
|
+
import { Selection } from "./selection";
|
|
5
5
|
export declare const SET_DATA = "SET_DATA";
|
|
6
6
|
export declare const SET_CREATE_FORMULA_PARSER = "SET_CREATE_FORMULA_PARSER";
|
|
7
7
|
export declare const SELECT_ENTIRE_ROW = "SELECT_ENTIRE_ROW";
|
|
@@ -24,53 +24,9 @@ export declare const KEY_DOWN = "KEY_DOWN";
|
|
|
24
24
|
export declare const DRAG_START = "DRAG_START";
|
|
25
25
|
export declare const DRAG_END = "DRAG_END";
|
|
26
26
|
export declare const COMMIT = "COMMIT";
|
|
27
|
-
export declare const BOLD = "BOLD";
|
|
28
|
-
export declare const ITALIC = "ITALIC";
|
|
29
|
-
export declare const UNDERLINE = "UNDERLINE";
|
|
30
|
-
export declare const COLOR = "COLOR";
|
|
31
|
-
export declare const BACKGROUND_COLOR = "BACKGROUND_COLOR";
|
|
32
|
-
export declare const FORMATE_PAINTER = "FORMATE_PAINTER";
|
|
33
27
|
export type BaseAction<T extends string> = {
|
|
34
28
|
type: T;
|
|
35
29
|
};
|
|
36
|
-
export type BoldStyle = BaseAction<typeof BOLD> & {
|
|
37
|
-
payload: {
|
|
38
|
-
data: Matrix<CellBase>;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
export declare function bold(data: Matrix<CellBase>): BoldStyle;
|
|
42
|
-
export type ItalicStyle = BaseAction<typeof ITALIC> & {
|
|
43
|
-
payload: {
|
|
44
|
-
data: Matrix<CellBase>;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export declare function italic(data: Matrix<CellBase>): ItalicStyle;
|
|
48
|
-
export type UnderlineStyle = BaseAction<typeof UNDERLINE> & {
|
|
49
|
-
payload: {
|
|
50
|
-
data: Matrix<CellBase>;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
export declare function underline(data: Matrix<CellBase>): UnderlineStyle;
|
|
54
|
-
export type ColorStyle = BaseAction<typeof COLOR> & {
|
|
55
|
-
payload: {
|
|
56
|
-
data: Matrix<CellBase>;
|
|
57
|
-
value: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
export declare function color(data: Matrix<CellBase>, value: string): ColorStyle;
|
|
61
|
-
export type BackgroundStyle = BaseAction<typeof BACKGROUND_COLOR> & {
|
|
62
|
-
payload: {
|
|
63
|
-
data: Matrix<CellBase>;
|
|
64
|
-
value: string;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
export declare function backgroundStyle(data: Matrix<CellBase>, value: string): BackgroundStyle;
|
|
68
|
-
export type FormatePainterStyle = BaseAction<typeof FORMATE_PAINTER> & {
|
|
69
|
-
payload: {
|
|
70
|
-
data: Matrix<CellBase>;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
export declare function formatePainter(data: Matrix<CellBase>): FormatePainterStyle;
|
|
74
30
|
export type SetDataAction = BaseAction<typeof SET_DATA> & {
|
|
75
31
|
payload: {
|
|
76
32
|
data: Matrix<CellBase>;
|
|
@@ -171,4 +127,4 @@ export type ClearAction = BaseAction<typeof CLEAR>;
|
|
|
171
127
|
export declare function clear(): ClearAction;
|
|
172
128
|
export type BlurAction = BaseAction<typeof BLUR>;
|
|
173
129
|
export declare function blur(): BlurAction;
|
|
174
|
-
export type Action = SetDataAction | SetCreateFormulaParserAction | SelectEntireRowAction | SelectEntireColumnAction | SelectEntireWorksheetAction | SetSelectionAction | SelectAction | ActivateAction | SetCellDataAction | SetCellDimensionsAction | PasteAction | KeyPressAction | KeyDownAction | DragStartAction | DragEndAction | CommitAction | CopyAction | CutAction | EditAction | ViewAction | ClearAction |
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import reducer from
|
|
3
|
-
import { Action } from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import reducer from "./reducer";
|
|
3
|
+
import { Action } from "./actions";
|
|
4
4
|
export type ReducerState = React.ReducerState<typeof reducer>;
|
|
5
5
|
export type Dispatch = React.Dispatch<Action>;
|
|
6
6
|
export type Value = [ReducerState, Dispatch];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import FormulaParser, { Value } from
|
|
2
|
-
import * as Matrix from
|
|
3
|
-
import { Point } from
|
|
4
|
-
import { CellBase, CreateFormulaParser } from
|
|
5
|
-
import { PointGraph } from
|
|
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
6
|
export declare class Model<Cell extends CellBase> {
|
|
7
7
|
readonly data: Matrix.Matrix<Cell>;
|
|
8
8
|
readonly evaluatedData: Matrix.Matrix<Cell>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import FormulaParser, { FormulaParserConfig, Value } from
|
|
2
|
-
import { Point } from
|
|
3
|
-
import * as Matrix from
|
|
4
|
-
import { CellBase } from
|
|
5
|
-
import { PointSet } from
|
|
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
6
|
export declare const FORMULA_VALUE_PREFIX = "=";
|
|
7
7
|
/** Returns whether given value is a formula */
|
|
8
8
|
export declare function isFormulaValue(value: unknown): value is string;
|
|
9
9
|
/** Extracts formula from value */
|
|
10
10
|
export declare function extractFormula(value: string): string;
|
|
11
|
-
export declare function createFormulaParser(data: Matrix.Matrix<CellBase>, config?: Omit<FormulaParserConfig,
|
|
11
|
+
export declare function createFormulaParser(data: Matrix.Matrix<CellBase>, config?: Omit<FormulaParserConfig, "onCell" | "onRange">): FormulaParser;
|
|
12
12
|
/**
|
|
13
13
|
* For given formula returns the cell references
|
|
14
14
|
* @param formula - formula to get references for
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Model, updateCellValue } from
|
|
2
|
-
export { createFormulaParser } from
|
|
1
|
+
export { Model, updateCellValue } from "./engine";
|
|
2
|
+
export { createFormulaParser } from "./formula";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import Spreadsheet from
|
|
2
|
-
import DataEditor from
|
|
3
|
-
import DataViewer from
|
|
1
|
+
import Spreadsheet from "./Spreadsheet";
|
|
2
|
+
import DataEditor from "./DataEditor";
|
|
3
|
+
import DataViewer from "./DataViewer";
|
|
4
4
|
export default Spreadsheet;
|
|
5
5
|
export { Spreadsheet, DataEditor, DataViewer };
|
|
6
|
-
export type { Props } from
|
|
7
|
-
export { createEmpty as createEmptyMatrix } from
|
|
8
|
-
export type { Matrix } from
|
|
9
|
-
export { Selection, EmptySelection, EntireAxisSelection, EntireColumnsSelection, EntireRowsSelection, EntireSelection, EntireWorksheetSelection, InvalidIndexError, RangeSelection, } from
|
|
10
|
-
export { PointRange } from
|
|
11
|
-
export type { Point } from
|
|
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
|
|
13
|
-
export { createFormulaParser, Model } from
|
|
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,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Interface for ranges between two points
|
|
3
3
|
*/
|
|
4
|
-
import * as Point from
|
|
4
|
+
import * as Point from "./point";
|
|
5
5
|
/** Range between two points. Creates a normalized range between two given points */
|
|
6
6
|
export declare class PointRange {
|
|
7
7
|
/** The top-left point */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as Matrix from
|
|
2
|
-
import * as Types from
|
|
3
|
-
import * as Point from
|
|
4
|
-
import { Selection, RangeSelection, EntireColumnsSelection, EntireRowsSelection } from
|
|
5
|
-
import * as Actions from
|
|
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
6
|
export declare const INITIAL_STATE: Types.StoreState;
|
|
7
7
|
export default function reducer(state: Types.StoreState, action: Actions.Action): Types.StoreState;
|
|
8
8
|
export declare const go: (rowDelta: number, columnDelta: number) => KeyDownHandler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PointRange } from
|
|
2
|
-
import * as Point from
|
|
3
|
-
import * as Matrix from
|
|
1
|
+
import { PointRange } from "./point-range";
|
|
2
|
+
import * as Point from "./point";
|
|
3
|
+
import * as Matrix from "./matrix";
|
|
4
4
|
/** Selection from a spreadsheet */
|
|
5
5
|
export declare abstract class Selection {
|
|
6
6
|
/** Get concrete range of the selection in the given data */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import FormulaParser from
|
|
3
|
-
import { Point } from
|
|
4
|
-
import { Selection } from
|
|
5
|
-
import { Model } from
|
|
6
|
-
import { PointRange } from
|
|
7
|
-
import { Matrix } from
|
|
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
8
|
/** The base type of cell data in Spreadsheet */
|
|
9
9
|
export type CellBase<Value = any> = {
|
|
10
10
|
/** Whether the cell should not be editable */
|
|
@@ -13,13 +13,50 @@ export type CellBase<Value = any> = {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
/** The value of the cell */
|
|
15
15
|
value: Value;
|
|
16
|
-
style?:
|
|
16
|
+
style?: CellStyle;
|
|
17
17
|
type?: boolean;
|
|
18
18
|
/** Custom component to render when the cell is edited, if not defined would default to the component defined for the Spreadsheet */
|
|
19
19
|
DataEditor?: DataEditorComponent<CellBase<Value>>;
|
|
20
20
|
/** Custom component to render when the cell is viewed, if not defined would default to the component defined for the Spreadsheet */
|
|
21
21
|
DataViewer?: DataViewerComponent<CellBase<Value>>;
|
|
22
22
|
};
|
|
23
|
+
interface CellStyle {
|
|
24
|
+
/** Font name for the cell text */
|
|
25
|
+
name?: string;
|
|
26
|
+
/** Font size of the cell text */
|
|
27
|
+
size?: number;
|
|
28
|
+
position?: string;
|
|
29
|
+
/** Whether the text is bold */
|
|
30
|
+
bold?: boolean;
|
|
31
|
+
/** Whether the text is italicized */
|
|
32
|
+
italic?: boolean;
|
|
33
|
+
/** Text color in the cell (hex code) */
|
|
34
|
+
color?: string;
|
|
35
|
+
/** Background color of the cell (hex code) */
|
|
36
|
+
backgroundColor?: string;
|
|
37
|
+
/** Border color of the cell (hex code) */
|
|
38
|
+
borderColor?: string;
|
|
39
|
+
/** Border styles for each side of the cell */
|
|
40
|
+
border?: {
|
|
41
|
+
/** Border style for the top side of the cell */
|
|
42
|
+
top: string;
|
|
43
|
+
/** Border style for the bottom side of the cell */
|
|
44
|
+
bottom: string;
|
|
45
|
+
/** Border style for the left side of the cell */
|
|
46
|
+
left: string;
|
|
47
|
+
/** Border style for the right side of the cell */
|
|
48
|
+
right: string;
|
|
49
|
+
};
|
|
50
|
+
/** Text alignment and wrapping properties */
|
|
51
|
+
alignment?: {
|
|
52
|
+
/** Horizontal text alignment ('left', 'center', or 'right') */
|
|
53
|
+
horizontal: string;
|
|
54
|
+
/** Vertical text alignment ('top', 'middle', or 'bottom') */
|
|
55
|
+
vertical: string;
|
|
56
|
+
/** Whether the text is wrapped within the cell */
|
|
57
|
+
wrapText: boolean;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
23
60
|
/**
|
|
24
61
|
* A cell with it's coordinates
|
|
25
62
|
* @deprecated the component does not use cell descriptors anymore. Instead it passes cell point and cell value explicitly.
|
|
@@ -29,7 +66,7 @@ export type CellDescriptor<Cell extends CellBase> = {
|
|
|
29
66
|
data: Cell | undefined;
|
|
30
67
|
} & Point;
|
|
31
68
|
/** The spreadsheet's write mode */
|
|
32
|
-
export type Mode =
|
|
69
|
+
export type Mode = "view" | "edit";
|
|
33
70
|
/** Dimensions of an element */
|
|
34
71
|
export type Dimensions = {
|
|
35
72
|
/** The element's width in pixels */
|
|
@@ -49,8 +86,8 @@ export type StoreState<Cell extends CellBase = CellBase> = {
|
|
|
49
86
|
cut: boolean;
|
|
50
87
|
active: Point | null;
|
|
51
88
|
mode: Mode;
|
|
52
|
-
rowDimensions: Record<number, Pick<Dimensions,
|
|
53
|
-
columnDimensions: Record<number, Pick<Dimensions,
|
|
89
|
+
rowDimensions: Record<number, Pick<Dimensions, "height" | "top"> | undefined>;
|
|
90
|
+
columnDimensions: Record<number, Pick<Dimensions, "width" | "left"> | undefined>;
|
|
54
91
|
dragging: boolean;
|
|
55
92
|
lastChanged: Point | null;
|
|
56
93
|
lastCommit: null | CellChange<Cell>[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as Types from
|
|
2
|
-
import * as Matrix from
|
|
3
|
-
import * as Point from
|
|
4
|
-
import { PointRange } from
|
|
5
|
-
import { Selection } from
|
|
6
|
-
export { createEmpty as createEmptyMatrix } from
|
|
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
7
|
export declare const PLAIN_TEXT_MIME = "text/plain";
|
|
8
8
|
export declare const FOCUS_WITHIN_SELECTOR = ":focus-within";
|
|
9
9
|
/** Move the cursor of given input element to the input's end */
|
|
@@ -12,10 +12,11 @@ export declare function moveCursorToEnd(el: HTMLInputElement): void;
|
|
|
12
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
13
|
* @param end - an integer number specifying at which position to stop (not included).
|
|
14
14
|
* @param start - An integer number specifying at which position to start.
|
|
15
|
-
* @param step - An integer number specifying the
|
|
15
|
+
* @param step - An integer number specifying the incrementation
|
|
16
|
+
*/
|
|
16
17
|
export declare function range(end: number, start?: number, step?: number): number[];
|
|
17
18
|
/** Return whether given point is active */
|
|
18
|
-
export declare function isActive(active: Types.StoreState[
|
|
19
|
+
export declare function isActive(active: Types.StoreState["active"], point: Point.Point): boolean;
|
|
19
20
|
/** Get the offset values of given element */
|
|
20
21
|
export declare function getOffsetRect(element: HTMLElement): Types.Dimensions;
|
|
21
22
|
/** Write given data to clipboard with given event */
|
|
@@ -23,11 +24,11 @@ export declare function writeTextToClipboard(event: ClipboardEvent, data: string
|
|
|
23
24
|
/** Read text from given clipboard event */
|
|
24
25
|
export declare function readTextFromClipboard(event: ClipboardEvent): string;
|
|
25
26
|
/** Get the dimensions of cell at point from state */
|
|
26
|
-
export declare function getCellDimensions(point: Point.Point, rowDimensions: Types.StoreState[
|
|
27
|
+
export declare function getCellDimensions(point: Point.Point, rowDimensions: Types.StoreState["rowDimensions"] | undefined, columnDimensions: Types.StoreState["columnDimensions"] | undefined): Types.Dimensions | undefined;
|
|
27
28
|
/** Get the dimensions of a range of cells */
|
|
28
|
-
export declare function getRangeDimensions(rowDimensions: Types.StoreState[
|
|
29
|
+
export declare function getRangeDimensions(rowDimensions: Types.StoreState["rowDimensions"], columnDimensions: Types.StoreState["columnDimensions"], range: PointRange): Types.Dimensions | undefined;
|
|
29
30
|
/** Get the dimensions of selected */
|
|
30
|
-
export declare function getSelectedDimensions(rowDimensions: Types.StoreState[
|
|
31
|
+
export declare function getSelectedDimensions(rowDimensions: Types.StoreState["rowDimensions"], columnDimensions: Types.StoreState["columnDimensions"], data: Matrix.Matrix<unknown>, selected: Selection): Types.Dimensions | undefined;
|
|
31
32
|
/** Get given data as CSV */
|
|
32
33
|
export declare function getCSV(data: Matrix.Matrix<Types.CellBase>): string;
|
|
33
34
|
/**
|