pixel-react 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- package/.yarn/install-state.gz +0 -0
- package/lib/components/AddResourceButton/type.d.ts +1 -1
- package/lib/components/Drawer/Types.d.ts +4 -0
- package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.d.ts +13 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +0 -13
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +29 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.d.ts +3 -9
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.d.ts +2 -10
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.d.ts +0 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +27 -2
- package/lib/components/Form/Forms.d.ts +4 -2
- package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
- package/lib/components/MenuOption/MenuOption.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +49 -15
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelectTypes.d.ts +4 -5
- package/lib/components/MultiSelect/dropdownTypes.d.ts +2 -0
- package/lib/components/RadioButton/RadioButton.d.ts +1 -0
- package/lib/components/RadioButton/radioButtonTypes.d.ts +3 -1
- package/lib/components/Select/components/types.d.ts +4 -2
- package/lib/components/Table/Table.d.ts +1 -1
- package/lib/components/ToggleSwitch/ToggleSwitch.d.ts +10 -0
- package/lib/components/ToggleSwitch/index.d.ts +1 -0
- package/lib/index.d.ts +109 -23
- package/lib/index.esm.js +5711 -635
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +5707 -629
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
- package/src/assets/Themes/BaseTheme.scss +17 -23
- package/src/assets/Themes/DarkTheme.scss +25 -38
- package/src/assets/icons/apk_file_type.svg +4 -0
- package/src/assets/icons/compressed_file_type.svg +4 -0
- package/src/assets/icons/csv_file_type.svg +4 -0
- package/src/assets/icons/excel_corner_menu.svg +3 -0
- package/src/assets/icons/formula_icon.svg +3 -0
- package/src/assets/icons/gif_file_type.svg +4 -0
- package/src/assets/icons/html_file_type.svg +4 -0
- package/src/assets/icons/ipk_file_type.svg +4 -0
- package/src/assets/icons/jpg_file_type.svg +4 -0
- package/src/assets/icons/json_file_type.svg +4 -0
- package/src/assets/icons/pdf_file_type.svg +4 -0
- package/src/assets/icons/png_file_type.svg +4 -0
- package/src/assets/icons/quick_run_setting_icon.svg +5 -0
- package/src/assets/icons/run_automation_scripts_icon.svg +33 -0
- package/src/assets/icons/run_manual_testcase_icon.svg +4 -0
- package/src/assets/icons/search.svg +2 -2
- package/src/assets/icons/txt_file_type.svg +4 -0
- package/src/assets/icons/xls_file_type.svg +4 -0
- package/src/assets/icons/xlsx_file_type.svg +4 -0
- package/src/assets/icons/xml_file_type.svg +4 -0
- package/src/components/AddResourceButton/AddButton.tsx +7 -7
- package/src/components/AddResourceButton/type.ts +1 -1
- package/src/components/AttachmentButton/AttachmentButton.scss +1 -1
- package/src/components/AttachmentButton/AttachmentButton.stories.tsx +1 -0
- package/src/components/Button/Button.scss +22 -20
- package/src/components/Button/Button.tsx +8 -1
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +2 -2
- package/src/components/Drawer/Drawer.scss +4 -3
- package/src/components/Drawer/Drawer.tsx +14 -18
- package/src/components/Drawer/Types.ts +4 -0
- package/src/components/Editor/Editor.tsx +9 -11
- package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.scss +39 -0
- package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.tsx +51 -0
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +7 -8
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +35 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +44 -7
- package/src/components/Excel/ExcelFile/ExcelFileComponents/CornerIndicator.tsx +8 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +45 -6
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +37 -2
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +69 -24
- package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +59 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.ts +18 -65
- package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.ts +5 -110
- package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.ts +0 -2
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +105 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +670 -673
- package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +38 -2
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +0 -4
- package/src/components/FileDropzone/FileDropzone.scss +4 -2
- package/src/components/FileDropzone/FileDropzone.tsx +1 -1
- package/src/components/FileDropzone/FilePreview.tsx +3 -1
- package/src/components/Form/Form.scss +2 -0
- package/src/components/Form/Form.stories.tsx +195 -6
- package/src/components/Form/Forms.tsx +15 -8
- package/src/components/Icon/iconList.ts +46 -0
- package/src/components/IconRadioGroup/IconRadioGroup.scss +3 -0
- package/src/components/IconRadioGroup/IconRadioGroup.tsx +20 -17
- package/src/components/Input/Input.scss +14 -15
- package/src/components/Input/Input.stories.tsx +2 -1
- package/src/components/InputWithDropdown/InputWithDropdown.scss +12 -13
- package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +3 -2
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +22 -19
- package/src/components/MenuOption/MenuOption.scss +11 -10
- package/src/components/MenuOption/MenuOption.stories.tsx +51 -232
- package/src/components/MenuOption/MenuOption.tsx +131 -52
- package/src/components/MenuOption/types.ts +55 -14
- package/src/components/MiniModal/MiniModal.stories.tsx +2 -3
- package/src/components/MultiSelect/Dropdown.tsx +11 -12
- package/src/components/MultiSelect/MultiSelect.scss +1 -0
- package/src/components/MultiSelect/MultiSelect.stories.tsx +45 -10
- package/src/components/MultiSelect/MultiSelect.tsx +29 -13
- package/src/components/MultiSelect/MultiSelectTypes.ts +7 -5
- package/src/components/MultiSelect/dropdownTypes.ts +2 -0
- package/src/components/RadioButton/RadioButton.scss +3 -1
- package/src/components/RadioButton/RadioButton.tsx +3 -1
- package/src/components/RadioButton/radioButtonTypes.tsx +5 -1
- package/src/components/Search/Search.scss +25 -6
- package/src/components/Search/Search.tsx +45 -24
- package/src/components/Select/Select.scss +12 -12
- package/src/components/Select/Select.stories.tsx +2 -0
- package/src/components/Select/Select.tsx +11 -5
- package/src/components/Select/components/Dropdown.scss +2 -0
- package/src/components/Select/components/Dropdown.tsx +19 -4
- package/src/components/Select/components/types.ts +4 -2
- package/src/components/StatusButton/StatusButton.tsx +26 -20
- package/src/components/Table/Table.scss +1 -3
- package/src/components/Table/Table.stories.tsx +1 -0
- package/src/components/Table/Table.tsx +7 -3
- package/src/components/ToggleSwitch/ToggleSwitch.scss +59 -0
- package/src/components/ToggleSwitch/ToggleSwitch.stories.tsx +52 -0
- package/src/components/ToggleSwitch/ToggleSwitch.tsx +30 -0
- package/src/components/ToggleSwitch/index.ts +1 -0
- package/src/hooks/useFileDropzone.tsx +1 -0
- package/src/index.ts +4 -2
- package/src/components/Excel/ContextMenu/ContextMenu.scss +0 -99
- package/src/components/Excel/ContextMenu/ContextMenu.tsx +0 -103
package/.yarn/install-state.gz
CHANGED
Binary file
|
@@ -49,7 +49,7 @@ export interface AddResourceButtonProps {
|
|
49
49
|
* @property {boolean} isActive - Specifies if the button is in an active state (highlighted when selected).
|
50
50
|
*/
|
51
51
|
export interface DirectionalArrowButtonProps {
|
52
|
-
direction:
|
52
|
+
direction: 'top' | 'right' | 'down';
|
53
53
|
menuOptions: {
|
54
54
|
label: string;
|
55
55
|
value: string | string[];
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import './ExcelContextMenu.scss';
|
2
|
+
import * as Matrix from '../ExcelFile/ExcelFileComponents/matrix';
|
3
|
+
import { CellBase, ContextMenuState } from '../ExcelFile/ExcelFileComponents/types';
|
4
|
+
type ExcelContextMenuProps = {
|
5
|
+
data: Matrix.Matrix<CellBase>;
|
6
|
+
contextMenu: ContextMenuState;
|
7
|
+
addRowTop: (data: Matrix.Matrix<CellBase>) => void;
|
8
|
+
addColumnLeft: (data: Matrix.Matrix<CellBase>) => void;
|
9
|
+
deleteRow: (data: Matrix.Matrix<CellBase>) => void;
|
10
|
+
deleteColumn: (data: Matrix.Matrix<CellBase>) => void;
|
11
|
+
};
|
12
|
+
declare const ExcelContextMenu: React.FC<ExcelContextMenuProps>;
|
13
|
+
export default ExcelContextMenu;
|
@@ -10,19 +10,6 @@ export type Props<CellType extends Types.CellBase> = {
|
|
10
10
|
data: Matrix.Matrix<CellType>;
|
11
11
|
/** Class name to be added to the spreadsheet's root element */
|
12
12
|
className?: string;
|
13
|
-
/**
|
14
|
-
* Use dark colors that complement dark mode
|
15
|
-
* @defaultValue `false`
|
16
|
-
*/
|
17
|
-
/**
|
18
|
-
* Function used to create the formula parser (instance of
|
19
|
-
* "fast-formula-parser") used by the Spreadsheet by getting the spreadsheet's
|
20
|
-
* data.
|
21
|
-
* @defaultValue function which creates a formula parser bound to the
|
22
|
-
* Spreadsheet's data.
|
23
|
-
* @see `createFormulaParser`
|
24
|
-
* @see https://www.npmjs.com/package/fast-formula-parser
|
25
|
-
*/
|
26
13
|
createFormulaParser?: Types.CreateFormulaParser;
|
27
14
|
/**
|
28
15
|
* Labels to use in column indicators.
|
@@ -34,6 +34,10 @@ export declare const BORDER_TYPE = "BORDER_TYPE";
|
|
34
34
|
export declare const COLOR = "COLOR";
|
35
35
|
export declare const BACKGROUND_COLOR = "BACKGROUND_COLOR";
|
36
36
|
export declare const FORMATE_PAINTER = "FORMATE_PAINTER";
|
37
|
+
export declare const ADD_ROW_TOP = "ADD_ROW_TOP";
|
38
|
+
export declare const ADD_COLUMN_LEFT = "ADD_COLUMN_LEFT";
|
39
|
+
export declare const DELETE_ROW = "DELETE_ROW";
|
40
|
+
export declare const DELETE_COLUMN = "DELETE_COLUMN";
|
37
41
|
export type BaseAction<T extends string> = {
|
38
42
|
type: T;
|
39
43
|
};
|
@@ -106,6 +110,30 @@ export type FormatePainterStyle = BaseAction<typeof FORMATE_PAINTER> & {
|
|
106
110
|
};
|
107
111
|
};
|
108
112
|
export declare function formatePainter(data: Matrix<CellBase>): FormatePainterStyle;
|
113
|
+
export type AddRowTop = BaseAction<typeof ADD_ROW_TOP> & {
|
114
|
+
payload: {
|
115
|
+
data: Matrix<CellBase>;
|
116
|
+
};
|
117
|
+
};
|
118
|
+
export declare function addRowTop(data: Matrix<CellBase>): AddRowTop;
|
119
|
+
export type AddColumnLeft = BaseAction<typeof ADD_COLUMN_LEFT> & {
|
120
|
+
payload: {
|
121
|
+
data: Matrix<CellBase>;
|
122
|
+
};
|
123
|
+
};
|
124
|
+
export declare function addColumnLeft(data: Matrix<CellBase>): AddColumnLeft;
|
125
|
+
export type DeleteRow = BaseAction<typeof DELETE_ROW> & {
|
126
|
+
payload: {
|
127
|
+
data: Matrix<CellBase>;
|
128
|
+
};
|
129
|
+
};
|
130
|
+
export declare function deleteRow(data: Matrix<CellBase>): DeleteRow;
|
131
|
+
export type DeleteColumn = BaseAction<typeof DELETE_COLUMN> & {
|
132
|
+
payload: {
|
133
|
+
data: Matrix<CellBase>;
|
134
|
+
};
|
135
|
+
};
|
136
|
+
export declare function deleteColumn(data: Matrix<CellBase>): DeleteColumn;
|
109
137
|
export type SetDataAction = BaseAction<typeof SET_DATA> & {
|
110
138
|
payload: {
|
111
139
|
data: Matrix<CellBase>;
|
@@ -200,4 +228,4 @@ export type ClearAction = BaseAction<typeof CLEAR>;
|
|
200
228
|
export declare function clear(): ClearAction;
|
201
229
|
export type BlurAction = BaseAction<typeof BLUR>;
|
202
230
|
export declare function blur(): BlurAction;
|
203
|
-
export type Action = SetDataAction | SetCreateFormulaParserAction | SelectEntireRowAction | SelectEntireColumnAction | SelectEntireWorksheetAction | SetSelectionAction | SelectAction | ActivateAction | SetCellDataAction | SetCellDimensionsAction | PasteAction | KeyDownAction | DragStartAction | DragEndAction | CommitAction | CopyAction | CutAction | EditAction | ViewAction | ClearAction | UnderlineTypeStyle | FontSize | FontFamily | TextAlignType | BorderType | ItalicStyle | BoldStyle | ColorStyle | BackgroundStyle | FormatePainterStyle | BlurAction;
|
231
|
+
export type Action = SetDataAction | SetCreateFormulaParserAction | SelectEntireRowAction | SelectEntireColumnAction | SelectEntireWorksheetAction | SetSelectionAction | SelectAction | ActivateAction | SetCellDataAction | SetCellDimensionsAction | PasteAction | KeyDownAction | DragStartAction | DragEndAction | CommitAction | CopyAction | CutAction | EditAction | ViewAction | ClearAction | UnderlineTypeStyle | FontSize | FontFamily | TextAlignType | BorderType | ItalicStyle | BoldStyle | ColorStyle | BackgroundStyle | FormatePainterStyle | AddRowTop | AddColumnLeft | DeleteRow | DeleteColumn | BlurAction;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import FormulaParser, { Value } from 'fast-formula-parser';
|
2
1
|
import * as Matrix from '../matrix';
|
3
2
|
import { Point } from '../point';
|
4
3
|
import { CellBase, CreateFormulaParser } from '../types';
|
@@ -11,12 +10,7 @@ export declare class Model<Cell extends CellBase> {
|
|
11
10
|
constructor(createFormulaParser: CreateFormulaParser, data: Matrix.Matrix<Cell>, referenceGraph?: PointGraph, evaluatedData?: Matrix.Matrix<Cell>);
|
12
11
|
}
|
13
12
|
export declare function updateCellValue<Cell extends CellBase>(model: Model<Cell>, point: Point, cell: Cell): Model<Cell>;
|
14
|
-
|
15
|
-
|
16
|
-
* @param data - the spreadsheet data
|
17
|
-
* @returns the spreadsheet reference graph
|
18
|
-
*/
|
19
|
-
export declare function createReferenceGraph(data: Matrix.Matrix<CellBase>): PointGraph;
|
20
|
-
export declare function createEvaluatedData<Cell extends CellBase>(data: Matrix.Matrix<Cell>, referenceGraph: PointGraph, createFormulaParser: CreateFormulaParser): Matrix.Matrix<Cell>;
|
13
|
+
export declare function createReferenceGraph(): PointGraph;
|
14
|
+
export declare function createEvaluatedData<Cell extends CellBase>(data: Matrix.Matrix<Cell>, referenceGraph: PointGraph): Matrix.Matrix<Cell>;
|
21
15
|
/** Get the computed value of a formula cell */
|
22
|
-
export declare function getFormulaComputedValue(
|
16
|
+
export declare function getFormulaComputedValue(): string;
|
@@ -1,17 +1,9 @@
|
|
1
|
-
import FormulaParser, { FormulaParserConfig, Value } from 'fast-formula-parser';
|
2
|
-
import { Point } from '../point';
|
3
1
|
import * as Matrix from '../matrix';
|
4
2
|
import { CellBase } from '../types';
|
5
|
-
import { PointSet } from './point-set';
|
6
3
|
export declare const FORMULA_VALUE_PREFIX = "=";
|
7
4
|
/** Returns whether given value is a formula */
|
8
5
|
export declare function isFormulaValue(value: unknown): value is string;
|
9
6
|
/** Extracts formula from value */
|
10
7
|
export declare function extractFormula(value: string): string;
|
11
|
-
export declare function createFormulaParser(data: Matrix.Matrix<CellBase
|
12
|
-
|
13
|
-
* For given formula returns the cell references
|
14
|
-
* @param formula - formula to get references for
|
15
|
-
*/
|
16
|
-
export declare function getReferences(formula: string, point: Point, data: Matrix.Matrix<CellBase>): PointSet;
|
17
|
-
export declare function evaluate(formula: string, point: Point, formulaParser: FormulaParser): Value;
|
8
|
+
export declare function createFormulaParser(data: Matrix.Matrix<CellBase>): Matrix.Matrix<CellBase>;
|
9
|
+
export declare function evaluate(): string;
|
@@ -13,7 +13,6 @@ export declare class PointGraph {
|
|
13
13
|
get(node: Point): PointSet;
|
14
14
|
getBackwards(node: Point): PointSet;
|
15
15
|
getBackwardsRecursive(node: Point, visited?: PointSet): PointSet;
|
16
|
-
/** Determine whether the graph has a circular dependency, starting from given start point */
|
17
16
|
hasCircularDependency(startPoint: Point): boolean;
|
18
17
|
[Symbol.iterator](): Iterator<[Point, PointSet]>;
|
19
18
|
/** Get the points in the graph in a breadth-first order */
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import FormulaParser from 'fast-formula-parser';
|
3
2
|
import { Point } from './point';
|
4
3
|
import { Selection } from './selection';
|
5
4
|
import { Model } from './engine';
|
6
5
|
import { PointRange } from './point-range';
|
7
6
|
import { Matrix } from './matrix';
|
7
|
+
import * as MatrixValue 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 */
|
@@ -54,6 +54,8 @@ export type StoreState<Cell extends CellBase = CellBase> = {
|
|
54
54
|
dragging: boolean;
|
55
55
|
lastChanged: Point | null;
|
56
56
|
lastCommit: null | CellChange<Cell>[];
|
57
|
+
selectedRow: null | number;
|
58
|
+
selectedColumn: null | number;
|
57
59
|
};
|
58
60
|
export type CellChange<Cell extends CellBase = CellBase> = {
|
59
61
|
prevCell: Cell | null;
|
@@ -89,6 +91,7 @@ export type CellComponentProps<Cell extends CellBase = CellBase> = {
|
|
89
91
|
setCellDimensions: (point: Point, dimensions: Dimensions) => void;
|
90
92
|
/** Set data of the cell */
|
91
93
|
setCellData: (cell: Cell) => void;
|
94
|
+
setContextMenu: React.Dispatch<React.SetStateAction<ContextMenuState>>;
|
92
95
|
};
|
93
96
|
/** Type of the Spreadsheet Cell component */
|
94
97
|
export type CellComponent<Cell extends CellBase = CellBase> = React.ComponentType<CellComponentProps<Cell>>;
|
@@ -143,6 +146,24 @@ export type RowIndicatorProps = {
|
|
143
146
|
selected: boolean;
|
144
147
|
/** Callback to be called when the row is selected */
|
145
148
|
onSelect: (row: number, extend: boolean) => void;
|
149
|
+
setContextMenu: React.Dispatch<React.SetStateAction<ContextMenuState>>;
|
150
|
+
deleteRow: (data: MatrixValue.Matrix<CellBase>) => void;
|
151
|
+
addRowTop: (data: MatrixValue.Matrix<CellBase>) => void;
|
152
|
+
data: MatrixValue.Matrix<CellBase>;
|
153
|
+
};
|
154
|
+
export type ContextMenuState = {
|
155
|
+
open: boolean;
|
156
|
+
position: {
|
157
|
+
x: number;
|
158
|
+
y: number;
|
159
|
+
};
|
160
|
+
options: optionsType[];
|
161
|
+
};
|
162
|
+
type optionsType = {
|
163
|
+
label: string;
|
164
|
+
value: string;
|
165
|
+
iconName: string;
|
166
|
+
action: () => void;
|
146
167
|
};
|
147
168
|
/** Type of the RowIndicator component */
|
148
169
|
export type RowIndicatorComponent = React.ComponentType<RowIndicatorProps>;
|
@@ -158,6 +179,10 @@ export type ColumnIndicatorProps = {
|
|
158
179
|
fixed?: boolean;
|
159
180
|
/** Callback to be called when the column is selected */
|
160
181
|
onSelect: (column: number, extend: boolean) => void;
|
182
|
+
setContextMenu: React.Dispatch<React.SetStateAction<ContextMenuState>>;
|
183
|
+
deleteColumn: (data: MatrixValue.Matrix<CellBase>) => void;
|
184
|
+
addColumnLeft: (data: MatrixValue.Matrix<CellBase>) => void;
|
185
|
+
data: MatrixValue.Matrix<CellBase>;
|
161
186
|
};
|
162
187
|
/** Type of the ColumnIndicator component */
|
163
188
|
export type ColumnIndicatorComponent = React.ComponentType<ColumnIndicatorProps>;
|
@@ -174,5 +199,5 @@ export type CommitChanges<Cell extends CellBase = CellBase> = Array<{
|
|
174
199
|
prevCell: Cell | null;
|
175
200
|
nextCell: Cell | null;
|
176
201
|
}>;
|
177
|
-
export type CreateFormulaParser = (data: Matrix<CellBase>) =>
|
202
|
+
export type CreateFormulaParser = (data: Matrix<CellBase>) => void;
|
178
203
|
export {};
|
@@ -5,5 +5,7 @@ interface FormProps<T extends Form.FieldValues> extends Form.UseFormProps<T> {
|
|
5
5
|
onSubmit: Form.SubmitHandler<T>;
|
6
6
|
children: (methods: ReturnType<typeof Form.useForm<T>>) => React.ReactNode;
|
7
7
|
}
|
8
|
-
declare const
|
9
|
-
|
8
|
+
declare const ForwardedForms: <T extends Form.FieldValues>(props: FormProps<T> & {
|
9
|
+
ref?: React.Ref<any>;
|
10
|
+
}) => JSX.Element;
|
11
|
+
export default ForwardedForms;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import './InputWithDropdown.scss';
|
2
2
|
import { InputWithDropdownProps } from './types';
|
3
|
-
declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, dropdownPosition, type, }: InputWithDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
3
|
+
declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, autoComplete, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, dropdownPosition, type, }: InputWithDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
4
4
|
export default InputWithDropdown;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import './MenuOption.scss';
|
2
2
|
import { MenuOptionProps } from './types';
|
3
|
-
declare const MenuOption: ({ labelName, iconName, tooltipTitle, tooltipPlacement, options,
|
3
|
+
declare const MenuOption: ({ labelName, iconName, tooltipTitle, tooltipPlacement, options, onClick, onOptionClick, iconButtonSize, iconButtonBorderRadius, iconSize, variant, zIndex, dropdownPlacement, }: MenuOptionProps) => import("react/jsx-runtime").JSX.Element;
|
4
4
|
export default MenuOption;
|
@@ -10,15 +10,17 @@ interface OptionClick {
|
|
10
10
|
* @type {Array<string> | string}
|
11
11
|
* @required
|
12
12
|
*/
|
13
|
-
value:
|
13
|
+
value: any;
|
14
14
|
}
|
15
15
|
interface OptionType extends OptionClick {
|
16
16
|
/**
|
17
17
|
* The name of the icon associated with the option.
|
18
18
|
* @type {string}
|
19
|
-
* @
|
19
|
+
* @optional
|
20
20
|
*/
|
21
21
|
icon?: string;
|
22
|
+
iconColor?: string;
|
23
|
+
name?: string;
|
22
24
|
/**
|
23
25
|
* Indicates whether the option is disabled.
|
24
26
|
* @type {boolean}
|
@@ -35,17 +37,47 @@ interface OptionCardProps {
|
|
35
37
|
options: Array<OptionType>;
|
36
38
|
/**
|
37
39
|
* Callback function triggered when an option is clicked.
|
38
|
-
* @param {
|
40
|
+
* @param {OptionClick} data - The data associated with the clicked option.
|
39
41
|
* @type {function}
|
40
42
|
* @required
|
41
43
|
*/
|
42
|
-
onClick: (data
|
44
|
+
onClick: (data: OptionClick) => void;
|
43
45
|
/**
|
44
46
|
* Optional styles applied to the card.
|
45
47
|
* @type {React.CSSProperties}
|
46
48
|
* @optional
|
47
49
|
*/
|
48
50
|
styles?: React.CSSProperties;
|
51
|
+
/**
|
52
|
+
* The z-index of the option card.
|
53
|
+
* @type {number}
|
54
|
+
* @optional
|
55
|
+
*/
|
56
|
+
zIndex?: number;
|
57
|
+
/**
|
58
|
+
* The position of the menu relative to the triggering element.
|
59
|
+
* @type {dropdownPosition}
|
60
|
+
* @required
|
61
|
+
*/
|
62
|
+
menuPosition: any;
|
63
|
+
/**
|
64
|
+
* Reference to the menu DOM element.
|
65
|
+
* @type {React.RefObject<HTMLElement>}
|
66
|
+
* @required
|
67
|
+
*/
|
68
|
+
menuRef: React.RefObject<HTMLElement>;
|
69
|
+
/**
|
70
|
+
* Callback function to close the dropdown.
|
71
|
+
* @type {() => void}
|
72
|
+
* @required
|
73
|
+
*/
|
74
|
+
closeDropdown: () => void;
|
75
|
+
/**
|
76
|
+
* Placement of the dropdown menu relative to the icon.
|
77
|
+
* @type {dropdownPosition}
|
78
|
+
* @optional
|
79
|
+
*/
|
80
|
+
dropdownPosition?: 'top' | 'down' | 'left' | 'right';
|
49
81
|
}
|
50
82
|
interface MenuOptionProps {
|
51
83
|
/**
|
@@ -80,27 +112,27 @@ interface MenuOptionProps {
|
|
80
112
|
tooltipPlacement?: 'bottom' | 'left' | 'right' | 'top' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
81
113
|
/**
|
82
114
|
* The placement of the dropdown menu relative to the icon.
|
83
|
-
* @type {
|
115
|
+
* @type {dropdownPosition}
|
84
116
|
* @optional
|
85
117
|
*/
|
86
|
-
dropdownPlacement?:
|
118
|
+
dropdownPlacement?: 'top' | 'down' | 'left' | 'right';
|
87
119
|
/**
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
120
|
+
* The variant of the menu option, either 'dark' or 'light'.
|
121
|
+
* @type {'dark' | 'light'}
|
122
|
+
* @default 'light'
|
123
|
+
* @optional
|
124
|
+
*/
|
93
125
|
variant?: 'dark' | 'light';
|
94
126
|
/**
|
95
127
|
* Callback function triggered when the icon is clicked.
|
96
|
-
* @type {
|
128
|
+
* @type {() => void}
|
97
129
|
* @optional
|
98
130
|
*/
|
99
131
|
onClick?: () => void;
|
100
132
|
/**
|
101
133
|
* Callback function triggered when an option is clicked.
|
102
134
|
* @param {OptionClick} option - The option that was clicked.
|
103
|
-
* @type {
|
135
|
+
* @type {(option: OptionClick) => void}
|
104
136
|
* @optional
|
105
137
|
*/
|
106
138
|
onOptionClick?: (option: OptionClick) => void;
|
@@ -117,13 +149,15 @@ interface MenuOptionProps {
|
|
117
149
|
*/
|
118
150
|
iconSize?: number;
|
119
151
|
/**
|
120
|
-
* The border radius of the icon.
|
152
|
+
* The border radius of the icon button.
|
121
153
|
* @type {number}
|
122
154
|
* @default 7
|
123
155
|
*/
|
124
156
|
iconButtonBorderRadius?: number;
|
125
157
|
/**
|
126
158
|
* Providing z-index for the options card.
|
159
|
+
* @type {number}
|
160
|
+
* @optional
|
127
161
|
*/
|
128
162
|
zIndex?: number;
|
129
163
|
}
|
@@ -137,7 +171,7 @@ interface OptionProps {
|
|
137
171
|
/**
|
138
172
|
* Callback function triggered when the option is clicked.
|
139
173
|
* @param {OptionClick} option - The clicked option.
|
140
|
-
* @type {
|
174
|
+
* @type {(option: OptionClick) => void}
|
141
175
|
* @required
|
142
176
|
*/
|
143
177
|
onClick: (option: OptionClick) => void;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import './MultiSelect.scss';
|
2
2
|
import { MultiSelectProps } from './MultiSelectTypes';
|
3
|
-
declare const MultiSelect: ({ options, type, selectedOptions, onChange, acceptNewOption, zIndex, label, onSearch, required, disabled, errorMessage, displayCount, placeholderForSearching, variant, onLabelPlusIconClick, onManageLabelsClick, className, highlightedMachine, onSelectButtonClick, withSelectButton, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
3
|
+
declare const MultiSelect: ({ options, type, selectedOptions, onChange, acceptNewOption, zIndex, label, onSearch, required, disabled, errorMessage, displayCount, placeholderForSearching, variant, onLabelPlusIconClick, onManageLabelsClick, className, highlightedMachine, onSelectButtonClick, labelAccessor, valueAccessor, withSelectButton, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
4
4
|
export default MultiSelect;
|
@@ -1,10 +1,7 @@
|
|
1
1
|
import { ReactElement } from 'react';
|
2
|
+
type OptionValue = any;
|
2
3
|
interface Option {
|
3
|
-
|
4
|
-
value?: string;
|
5
|
-
accessor?: string;
|
6
|
-
isChecked?: boolean;
|
7
|
-
isDisabled?: boolean;
|
4
|
+
[key: string]: OptionValue;
|
8
5
|
}
|
9
6
|
interface MultiSelectProps {
|
10
7
|
options: Option[];
|
@@ -32,5 +29,7 @@ interface MultiSelectProps {
|
|
32
29
|
className?: string;
|
33
30
|
/** Machine Name to be displayed */
|
34
31
|
highlightedMachine?: string | ReactElement;
|
32
|
+
labelAccessor?: string;
|
33
|
+
valueAccessor?: string;
|
35
34
|
}
|
36
35
|
export { Option, MultiSelectProps };
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ReactElement } from 'react';
|
1
2
|
/**
|
2
3
|
* Props for the RadioButton component.
|
3
4
|
*/
|
@@ -6,7 +7,7 @@ interface RadioButtonProps {
|
|
6
7
|
* The display label for the radio button.
|
7
8
|
* Optional.
|
8
9
|
*/
|
9
|
-
label?: string;
|
10
|
+
label?: string | ReactElement;
|
10
11
|
/**
|
11
12
|
* The name attribute for the radio button, used for grouping.
|
12
13
|
*/
|
@@ -48,3 +49,4 @@ interface RadioButtonProps {
|
|
48
49
|
*/
|
49
50
|
tooltipTitle?: React.ReactNode;
|
50
51
|
}
|
52
|
+
export default RadioButtonProps;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { DrowdownPosition, Option } from '../types';
|
2
|
+
import { RefObject } from 'react';
|
2
3
|
export interface DropdownProps {
|
3
4
|
options: Option[];
|
4
5
|
dropdownPosition: DrowdownPosition;
|
@@ -7,9 +8,10 @@ export interface DropdownProps {
|
|
7
8
|
valueAccessor?: string;
|
8
9
|
onSelectBlur: () => void;
|
9
10
|
onSelectOptionSelector: (option: Option) => void;
|
10
|
-
inputRef?:
|
11
|
-
selectArrowRef?:
|
11
|
+
inputRef?: RefObject<HTMLInputElement>;
|
12
|
+
selectArrowRef?: RefObject<HTMLDivElement>;
|
12
13
|
heightFromTop: number;
|
14
|
+
selectedOption?: Option;
|
13
15
|
}
|
14
16
|
export declare const dropdownDefaultCSSData: {
|
15
17
|
margin: number;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import './Table.scss';
|
2
2
|
import { TableProps } from './Types';
|
3
|
-
declare const Table: ({ data, columns, headerType, withCheckbox, onSelect, allSelected, partialSelected, withFixedHeader, borderWithRadius, headerCheckboxDisabled, noDataContent, height, className, tableHeadClass, tableBodyRowClass, headerTextColor, tableDataTextColor, headerIconName, headerIconOnClick, }: TableProps) => import("react/jsx-runtime").JSX.Element
|
3
|
+
declare const Table: ({ data, columns, headerType, withCheckbox, onSelect, allSelected, partialSelected, withFixedHeader, borderWithRadius, headerCheckboxDisabled, noDataContent, height, className, tableHeadClass, tableBodyRowClass, headerTextColor, tableDataTextColor, headerIconName, headerIconOnClick, }: TableProps) => import("react/jsx-runtime").JSX.Element;
|
4
4
|
export default Table;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import "./ToggleSwitch.scss";
|
3
|
+
interface ToggleSwitchProps {
|
4
|
+
firstButton: string;
|
5
|
+
secondButton: string;
|
6
|
+
handleClick: (selected: string) => void;
|
7
|
+
selected: string;
|
8
|
+
}
|
9
|
+
declare const ToggleSwitch: React.FC<ToggleSwitchProps>;
|
10
|
+
export default ToggleSwitch;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './ToggleSwitch';
|