pixel-react 1.4.5 → 1.4.7
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/assets/fonts/Poppins-Bold.ttf +0 -0
- package/lib/assets/fonts/Poppins-Medium.ttf +0 -0
- package/lib/assets/fonts/Poppins-Regular.ttf +0 -0
- package/lib/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.d.ts +1 -1
- package/lib/components/AllProjectsDropdown/types.d.ts +2 -0
- package/lib/components/AppHeader/types.d.ts +1 -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 +6 -7
- package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +49 -5
- 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 +11 -48
- 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 +11 -12
- package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +16 -0
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -3
- package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +12 -0
- package/lib/components/ExcelFile/Types.d.ts +2 -49
- package/lib/components/MachineInputField/types.d.ts +1 -0
- package/lib/components/MenuOption/types.d.ts +1 -1
- package/lib/components/Modal/types.d.ts +4 -2
- package/lib/components/MultiSelect/MultiSelect.stories.d.ts +0 -1
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.d.ts +1 -1
- package/lib/components/SequentialConnectingBranch/types.d.ts +7 -4
- package/lib/index.d.ts +19 -12
- package/lib/index.esm.js +266 -464
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +266 -464
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/capitalize/capitalize.d.ts +1 -0
- package/lib/utils/getSequentialPayload/getSequentialPayload.d.ts +2 -2
- package/lib/utils/getSequentialPayload/types.d.ts +2 -4
- package/package.json +1 -1
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +82 -12
- package/src/assets/Themes/BaseTheme.scss +36 -15
- package/src/assets/Themes/DarkTheme.scss +15 -1
- package/src/assets/icons/add_file.svg +4 -13
- package/src/assets/icons/eye_open_icon.svg +10 -0
- package/src/assets/icons/hide_access_icon.svg +3 -0
- package/src/assets/icons/windows.svg +8 -4
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +58 -8
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +83 -75
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +31 -18
- package/src/components/AllProjectsDropdown/types.ts +2 -0
- package/src/components/AppHeader/AppHeader.scss +2 -2
- package/src/components/AppHeader/AppHeader.stories.tsx +5 -1
- package/src/components/AppHeader/AppHeader.tsx +107 -101
- package/src/components/AppHeader/types.ts +1 -0
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +2 -2
- package/src/components/Checkbox/Checkbox.scss +1 -1
- package/src/components/EditTextField/EditTextField.tsx +3 -5
- package/src/components/Icon/iconList.ts +4 -2
- package/src/components/MachineInputField/MachineInputField.scss +4 -2
- package/src/components/MachineInputField/MachineInputField.tsx +2 -0
- package/src/components/MachineInputField/types.ts +1 -0
- package/src/components/MenuOption/MenuOption.scss +24 -27
- package/src/components/MenuOption/MenuOption.stories.tsx +90 -35
- package/src/components/MenuOption/MenuOption.tsx +19 -18
- package/src/components/MenuOption/types.ts +1 -1
- package/src/components/Modal/Modal.stories.tsx +2 -2
- package/src/components/Modal/Modal.tsx +6 -2
- package/src/components/Modal/modal.scss +2 -3
- package/src/components/Modal/types.ts +4 -2
- package/src/components/MultiSelect/MultiSelect.scss +50 -45
- package/src/components/MultiSelect/MultiSelect.tsx +1 -1
- package/src/components/Select/components/Dropdown.tsx +22 -8
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.scss +34 -32
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.tsx +34 -40
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.tsx +27 -100
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.scss +5 -5
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +5 -3
- package/src/components/SequentialConnectingBranch/types.ts +7 -4
- package/src/components/Tooltip/Tooltip.scss +1 -0
- package/src/components/Tooltip/Tooltip.tsx +1 -2
- package/src/utils/capitalize/capitalize.stories.tsx +44 -0
- package/src/utils/capitalize/capitalize.tsx +4 -0
- package/src/utils/getSequentialPayload/getSequentialPayload.stories.tsx +2 -5
- package/src/utils/getSequentialPayload/getSequentialPayload.ts +11 -24
- package/src/utils/getSequentialPayload/types.ts +3 -6
- /package/lib/components/ExcelFile/{ColorBarselector → ColorBarSelector}/ColorBarSelector.d.ts +0 -0
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import './AllProjectsDropdown.scss';
|
2
2
|
import { AllProjectsDropdownProps } from './types';
|
3
|
-
declare const AllProjectsDropdown: ({ onClick, options, selectedOption, }: AllProjectsDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
3
|
+
declare const AllProjectsDropdown: ({ onClick, onMenuClick, options, selectedOption, selected, }: AllProjectsDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
4
4
|
export default AllProjectsDropdown;
|
@@ -20,6 +20,7 @@ export interface AppHeaderProps {
|
|
20
20
|
onSubMenuClick?: (text: any) => void;
|
21
21
|
onQuickMenuClick?: (text: any) => void;
|
22
22
|
onProjectMenuClick?: (text: any) => void;
|
23
|
+
onProjectDropdownLabelClick?: () => void;
|
23
24
|
onMoreMenuOptionClick?: (text: any) => void;
|
24
25
|
}
|
25
26
|
export interface appHeaderMenuItemProps {
|
@@ -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.scss';
|
7
7
|
/** The Spreadsheet component props */
|
8
8
|
export type Props<CellType extends Types.CellBase> = {
|
9
9
|
/** The spreadsheet's data */
|
@@ -14,7 +14,6 @@ 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;
|
18
17
|
/**
|
19
18
|
* Function used to create the formula parser (instance of
|
20
19
|
* "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,9 +24,53 @@ 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";
|
27
33
|
export type BaseAction<T extends string> = {
|
28
34
|
type: T;
|
29
35
|
};
|
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;
|
30
74
|
export type SetDataAction = BaseAction<typeof SET_DATA> & {
|
31
75
|
payload: {
|
32
76
|
data: Matrix<CellBase>;
|
@@ -127,4 +171,4 @@ export type ClearAction = BaseAction<typeof CLEAR>;
|
|
127
171
|
export declare function clear(): ClearAction;
|
128
172
|
export type BlurAction = BaseAction<typeof BLUR>;
|
129
173
|
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;
|
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 | UnderlineStyle | ItalicStyle | BoldStyle | ColorStyle | BackgroundStyle | FormatePainterStyle | 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,50 +13,13 @@ export type CellBase<Value = any> = {
|
|
13
13
|
className?: string;
|
14
14
|
/** The value of the cell */
|
15
15
|
value: Value;
|
16
|
-
style?:
|
16
|
+
style?: React.CSSProperties | undefined;
|
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
|
-
}
|
60
23
|
/**
|
61
24
|
* A cell with it's coordinates
|
62
25
|
* @deprecated the component does not use cell descriptors anymore. Instead it passes cell point and cell value explicitly.
|
@@ -66,7 +29,7 @@ export type CellDescriptor<Cell extends CellBase> = {
|
|
66
29
|
data: Cell | undefined;
|
67
30
|
} & Point;
|
68
31
|
/** The spreadsheet's write mode */
|
69
|
-
export type Mode =
|
32
|
+
export type Mode = 'view' | 'edit';
|
70
33
|
/** Dimensions of an element */
|
71
34
|
export type Dimensions = {
|
72
35
|
/** The element's width in pixels */
|
@@ -86,8 +49,8 @@ export type StoreState<Cell extends CellBase = CellBase> = {
|
|
86
49
|
cut: boolean;
|
87
50
|
active: Point | null;
|
88
51
|
mode: Mode;
|
89
|
-
rowDimensions: Record<number, Pick<Dimensions,
|
90
|
-
columnDimensions: Record<number, Pick<Dimensions,
|
52
|
+
rowDimensions: Record<number, Pick<Dimensions, 'height' | 'top'> | undefined>;
|
53
|
+
columnDimensions: Record<number, Pick<Dimensions, 'width' | 'left'> | undefined>;
|
91
54
|
dragging: boolean;
|
92
55
|
lastChanged: Point | null;
|
93
56
|
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,11 +12,10 @@ 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
|
16
|
-
*/
|
15
|
+
* @param step - An integer number specifying the Increment */
|
17
16
|
export declare function range(end: number, start?: number, step?: number): number[];
|
18
17
|
/** Return whether given point is active */
|
19
|
-
export declare function isActive(active: Types.StoreState[
|
18
|
+
export declare function isActive(active: Types.StoreState['active'], point: Point.Point): boolean;
|
20
19
|
/** Get the offset values of given element */
|
21
20
|
export declare function getOffsetRect(element: HTMLElement): Types.Dimensions;
|
22
21
|
/** Write given data to clipboard with given event */
|
@@ -24,11 +23,11 @@ export declare function writeTextToClipboard(event: ClipboardEvent, data: string
|
|
24
23
|
/** Read text from given clipboard event */
|
25
24
|
export declare function readTextFromClipboard(event: ClipboardEvent): string;
|
26
25
|
/** Get the dimensions of cell at point from state */
|
27
|
-
export declare function getCellDimensions(point: Point.Point, rowDimensions: Types.StoreState[
|
26
|
+
export declare function getCellDimensions(point: Point.Point, rowDimensions: Types.StoreState['rowDimensions'] | undefined, columnDimensions: Types.StoreState['columnDimensions'] | undefined): Types.Dimensions | undefined;
|
28
27
|
/** Get the dimensions of a range of cells */
|
29
|
-
export declare function getRangeDimensions(rowDimensions: Types.StoreState[
|
28
|
+
export declare function getRangeDimensions(rowDimensions: Types.StoreState['rowDimensions'], columnDimensions: Types.StoreState['columnDimensions'], range: PointRange): Types.Dimensions | undefined;
|
30
29
|
/** Get the dimensions of selected */
|
31
|
-
export declare function getSelectedDimensions(rowDimensions: Types.StoreState[
|
30
|
+
export declare function getSelectedDimensions(rowDimensions: Types.StoreState['rowDimensions'], columnDimensions: Types.StoreState['columnDimensions'], data: Matrix.Matrix<unknown>, selected: Selection): Types.Dimensions | undefined;
|
32
31
|
/** Get given data as CSV */
|
33
32
|
export declare function getCSV(data: Matrix.Matrix<Types.CellBase>): string;
|
34
33
|
/**
|
@@ -1,3 +1,19 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
interface ExcelFileProps {
|
3
|
+
/** The Excel data containing sheets and their content */
|
4
|
+
excelData: {
|
5
|
+
sheets: WorkSheet[];
|
6
|
+
};
|
7
|
+
/** Optional: Provide context menu options for actions like right-click */
|
8
|
+
contextOption?: {
|
9
|
+
name: string;
|
10
|
+
title: React.ReactNode;
|
11
|
+
action: () => void;
|
12
|
+
}[];
|
13
|
+
/** Controls whether the toolbar is shown, disabled, or hidden */
|
14
|
+
toolbar?: 'show' | 'disable' | 'hide';
|
15
|
+
/** Callback function to save the Excel data */
|
16
|
+
onSave?: (excelData?: any) => void;
|
17
|
+
}
|
2
18
|
declare const ExcelFile: React.FC<ExcelFileProps>;
|
3
19
|
export default ExcelFile;
|
@@ -4,12 +4,9 @@ interface ExcelSheetBarProps {
|
|
4
4
|
sheetNames: string[];
|
5
5
|
};
|
6
6
|
handleSheetChange: (name: string, index: number) => void;
|
7
|
-
contextMenu: (e: React.MouseEvent, name: string, index: number) => void;
|
8
|
-
addSheet: () => void;
|
9
7
|
selectedSheet: {
|
10
8
|
name: string;
|
11
9
|
};
|
12
|
-
contextSelect: (e: React.MouseEvent) => void;
|
13
10
|
}
|
14
11
|
declare const ExcelSheetBar: React.FC<ExcelSheetBarProps>;
|
15
12
|
export default ExcelSheetBar;
|
@@ -1,3 +1,15 @@
|
|
1
1
|
import './ExcelToolBar.scss';
|
2
|
+
import { CellBase } from '../ExcelFile/Excel';
|
3
|
+
import * as Matrix from '../ExcelFile/Excel/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
|
+
onUnderline: (data: Matrix.Matrix<CellBase>) => 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
|
+
}
|
2
14
|
declare const ExcelToolBar: React.FC<ExcelToolBarProps>;
|
3
15
|
export default ExcelToolBar;
|