pixel-react 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/AppHeader/types.d.ts +11 -2
- package/lib/components/Avatar/Avatar.d.ts +5 -0
- package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
- package/lib/components/Avatar/index.d.ts +1 -0
- package/lib/components/Avatar/types.d.ts +26 -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/Form/Form.d.ts +1 -15
- package/lib/components/Form/Form.stories.d.ts +6 -5
- package/lib/components/Form/Forms.d.ts +8 -0
- package/lib/components/Form/index.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +7 -7
- package/lib/components/ModulesChip/ModuleChip.d.ts +4 -0
- package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
- package/lib/components/ModulesChip/index.d.ts +1 -0
- package/lib/components/ModulesChip/types.d.ts +14 -0
- package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
- package/lib/components/Toastify/Toastify.d.ts +8 -0
- package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
- package/lib/components/Toastify/index.d.ts +1 -0
- package/lib/components/Toastify/types.d.ts +7 -0
- package/lib/components/Tooltip/types.d.ts +6 -0
- package/lib/components/Typography/types.d.ts +1 -0
- package/lib/index.d.ts +75 -22
- package/lib/index.esm.js +26686 -870
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +26684 -864
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
- package/src/assets/Themes/BaseTheme.scss +2 -0
- package/src/assets/Themes/DarkTheme.scss +2 -0
- package/src/assets/icons/client_profile.svg +4 -0
- package/src/assets/icons/fireflink_finder_logo.svg +7 -0
- package/src/assets/icons/fireflink_platform.svg +4 -0
- package/src/assets/icons/license_expired.svg +20 -0
- package/src/components/AppHeader/AppHeader.stories.tsx +24 -3
- package/src/components/AppHeader/AppHeader.tsx +29 -11
- package/src/components/AppHeader/types.ts +11 -3
- package/src/components/Avatar/Avatar.scss +24 -0
- package/src/components/Avatar/Avatar.stories.tsx +56 -0
- package/src/components/Avatar/Avatar.tsx +25 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Avatar/types.ts +27 -0
- package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +0 -2
- package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +1 -4
- package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +0 -1
- package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +13 -13
- package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +13 -12
- package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +40 -32
- package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +4 -4
- package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +10 -10
- package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +5 -5
- package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +10 -10
- package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +6 -6
- package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +34 -27
- package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +5 -5
- package/src/components/ExcelFile/ExcelFile/Excel/{Spreadsheet.css → Spreadsheet.scss} +21 -37
- package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +87 -78
- package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +121 -31
- package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/context.ts +4 -4
- package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +7 -7
- package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +11 -11
- package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +3 -3
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/index.ts +12 -11
- package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +18 -24
- package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +311 -41
- package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +5 -5
- package/src/components/ExcelFile/ExcelFile/Excel/types.ts +14 -66
- package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +8 -8
- package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +3 -3
- package/src/components/ExcelFile/ExcelFile/Excel/util.ts +21 -22
- package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -3
- package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +45 -403
- package/src/components/ExcelFile/ExcelFile.stories.tsx +10 -29
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +1 -12
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -3
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +147 -127
- package/src/components/ExcelFile/Types.ts +3 -70
- package/src/components/ExcelFile/index.ts +1 -1
- package/src/components/Form/Form.d.ts +3 -0
- package/src/components/Form/Form.scss +31 -4
- package/src/components/Form/Form.stories.tsx +172 -138
- package/src/components/Form/Form.ts +2 -0
- package/src/components/Form/Forms.tsx +25 -0
- package/src/components/Form/index.ts +1 -1
- package/src/components/Icon/iconList.ts +8 -0
- package/src/components/IconButton/IconButton.scss +1 -1
- package/src/components/MenuOption/types.ts +7 -6
- package/src/components/ModulesChip/ModuleChip.scss +20 -0
- package/src/components/ModulesChip/ModuleChip.stories.tsx +41 -0
- package/src/components/ModulesChip/ModuleChip.tsx +31 -0
- package/src/components/ModulesChip/index.ts +1 -0
- package/src/components/ModulesChip/types.ts +14 -0
- package/src/components/MultiSelect/Dropdown.tsx +6 -1
- package/src/components/MultiSelect/MultiSelect.scss +17 -10
- package/src/components/MultiSelect/MultiSelect.stories.tsx +16 -4
- package/src/components/MultiSelect/MultiSelect.tsx +11 -4
- package/src/components/MultiSelect/MultiSelectTypes.ts +4 -3
- package/src/components/Select/Select.scss +4 -0
- package/src/components/Select/Select.tsx +2 -2
- package/src/components/Toastify/Toastify.stories.tsx +52 -0
- package/src/components/Toastify/Toastify.tsx +66 -0
- package/src/components/Toastify/index.ts +1 -0
- package/src/components/Toastify/types.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +2 -1
- package/src/components/Tooltip/types.ts +6 -0
- package/src/components/Typography/Typography.scss +12 -4
- package/src/components/Typography/Typography.stories.tsx +2 -0
- package/src/components/Typography/Typography.tsx +2 -0
- package/src/components/Typography/types.ts +1 -0
- package/src/index.ts +10 -2
- package/src/components/ExcelFile/ChangeExcelStyles.tsx +0 -78
- package/src/components/ExcelFile/ImportExcelStyles.tsx +0 -86
- package/src/components/Form/Form.tsx +0 -57
@@ -1,17 +1,26 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
+
import { optionsType } from '../AllProjectsDropdown/types';
|
2
3
|
export interface AppHeaderProps {
|
3
4
|
logoIconName: string;
|
4
5
|
leftContent?: ReactNode;
|
5
6
|
rightContent?: ReactNode;
|
6
|
-
projectsList?:
|
7
|
+
projectsList?: optionsType[];
|
7
8
|
appHeaderMenuItems: appHeaderMenuItemProps[];
|
8
|
-
appHeaderHiddenMenuItems?:
|
9
|
+
appHeaderHiddenMenuItems?: {
|
10
|
+
label: string;
|
11
|
+
value: string | string[];
|
12
|
+
icon: string;
|
13
|
+
disable?: boolean;
|
14
|
+
}[];
|
9
15
|
selectedMenu: string;
|
10
16
|
selectedSubMenu?: string;
|
11
17
|
selectedQuickMenu?: string;
|
18
|
+
selectedProject?: optionsType;
|
12
19
|
onMenuClick?: (text: any) => void;
|
13
20
|
onSubMenuClick?: (text: any) => void;
|
14
21
|
onQuickMenuClick?: (text: any) => void;
|
22
|
+
onProjectMenuClick?: (text: any) => void;
|
23
|
+
onMoreMenuOptionClick?: (text: any) => void;
|
15
24
|
}
|
16
25
|
export interface appHeaderMenuItemProps {
|
17
26
|
label: string;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
2
|
+
import Avatar from './Avatar';
|
3
|
+
declare const meta: Meta<typeof Avatar>;
|
4
|
+
export default meta;
|
5
|
+
type Story = StoryObj<typeof meta>;
|
6
|
+
export declare const Small: Story;
|
7
|
+
export declare const Medium: Story;
|
8
|
+
export declare const Large: Story;
|
9
|
+
export declare const CustomAvatarSize: Story;
|
10
|
+
export declare const CustomIconSize: Story;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Avatar';
|
@@ -0,0 +1,26 @@
|
|
1
|
+
export interface AvatarProps {
|
2
|
+
/**
|
3
|
+
* This property determines the size of the avatar. It can be set to 'small', 'medium', or 'large'.
|
4
|
+
*/
|
5
|
+
variant?: 'small' | 'medium' | 'large';
|
6
|
+
/**
|
7
|
+
* This property allows you to customize the background color of the avatar.
|
8
|
+
*/
|
9
|
+
backgroundColor?: string;
|
10
|
+
/**
|
11
|
+
* This property specifies the name of the icon to be displayed within the avatar.
|
12
|
+
*/
|
13
|
+
iconName: string;
|
14
|
+
/**
|
15
|
+
* This property allows you to customize the color of the icon within the avatar.
|
16
|
+
*/
|
17
|
+
iconColor?: string;
|
18
|
+
/**
|
19
|
+
* This property allows you to set a custom size for the avatar, overriding the default size specified by the variant property.
|
20
|
+
*/
|
21
|
+
customAvatarSize?: number;
|
22
|
+
/**
|
23
|
+
* This property allows you to set a custom size for the icon within the avatar.
|
24
|
+
*/
|
25
|
+
customIconSize?: number;
|
26
|
+
}
|
@@ -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;
|