pixel-react 1.2.6 → 1.2.8
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/Drawer/Types.d.ts +29 -17
- package/lib/components/{ExcelFile → Excel}/ExcelFile/ExcelFile.d.ts +1 -0
- package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.d.ts +39 -10
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.d.ts +4 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +40 -0
- package/lib/components/{ExcelFile → Excel}/ExcelToolBar/ExcelToolBar.d.ts +7 -3
- package/lib/components/MenuOption/MenuOption.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +4 -0
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
- package/lib/components/Select/Select.stories.d.ts +1 -0
- package/lib/components/Toastify/Toastify.d.ts +5 -4
- package/lib/components/Toastify/types.d.ts +1 -0
- package/lib/index.d.ts +76 -24
- package/lib/index.esm.js +1467 -1038
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1468 -1038
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/getSequentialPayload/getSequentialPayload.d.ts +2 -0
- package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
- package/lib/utils/getSequentialPayload/types.d.ts +30 -0
- package/package.json +3 -3
- package/src/assets/Themes/BaseTheme.scss +4 -0
- package/src/assets/icons/maximize_icon.svg +5 -0
- package/src/assets/styles/_fonts.scss +1 -1
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +15 -6
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +0 -5
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +20 -10
- package/src/components/Drawer/Drawer.scss +1 -0
- package/src/components/Drawer/Drawer.stories.tsx +8 -9
- package/src/components/Drawer/Drawer.tsx +8 -5
- package/src/components/Drawer/Types.ts +27 -14
- package/src/components/Excel/ExcelFile/ExcelFile.scss +62 -0
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +312 -0
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.tsx +2 -2
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.tsx +3 -3
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.tsx +4 -4
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.tsx +2 -2
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.tsx +1 -1
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.tsx +3 -3
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.tsx +4 -4
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.tsx +4 -4
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.scss +26 -24
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.tsx +13 -45
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.tsx +1 -1
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.ts +88 -20
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +495 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +758 -0
- package/src/components/{ExcelFile → Excel}/ExcelFile.stories.tsx +45 -0
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.scss +36 -0
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +346 -0
- package/src/components/Form/Form.scss +54 -35
- package/src/components/Form/Form.stories.tsx +264 -225
- package/src/components/Form/Forms.tsx +5 -1
- package/src/components/Icon/iconList.ts +2 -1
- package/src/components/Input/Input.tsx +0 -1
- package/src/components/MenuOption/MenuOption.scss +0 -1
- package/src/components/MenuOption/MenuOption.stories.tsx +3 -0
- package/src/components/MenuOption/MenuOption.tsx +5 -4
- package/src/components/MenuOption/types.ts +4 -0
- package/src/components/ModulesChip/ModuleChip.scss +2 -2
- package/src/components/ModulesChip/ModuleChip.tsx +4 -4
- package/src/components/MultiSelect/Dropdown.tsx +5 -2
- package/src/components/MultiSelect/MultiSelect.scss +16 -11
- package/src/components/MultiSelect/MultiSelect.stories.tsx +17 -13
- package/src/components/MultiSelect/MultiSelect.tsx +49 -26
- package/src/components/MultiSelect/MultiSelectTypes.ts +2 -1
- package/src/components/Select/Select.stories.tsx +161 -18
- package/src/components/Select/Select.tsx +41 -33
- package/src/components/Table/Table.scss +6 -5
- package/src/components/Table/Table.stories.tsx +0 -9
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/TableTree/TableTree.scss +1 -1
- package/src/components/TableTree/TableTree.tsx +3 -1
- package/src/components/Toastify/Toastify.stories.tsx +29 -10
- package/src/components/Toastify/Toastify.tsx +42 -16
- package/src/components/Toastify/types.ts +2 -0
- package/src/components/Tooltip/Tooltip.scss +1 -1
- package/src/index.ts +4 -2
- package/src/utils/getSequentialPayload/getSequentialPayload.stories.tsx +75 -0
- package/src/utils/getSequentialPayload/getSequentialPayload.ts +29 -0
- package/src/utils/getSequentialPayload/types.ts +35 -0
- package/lib/components/AddButton/AddButton.d.ts +0 -5
- package/lib/components/AddButton/AddButton.stories.d.ts +0 -6
- package/lib/components/AddButton/index.d.ts +0 -1
- package/lib/components/AddButton/types.d.ts +0 -4
- package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +0 -14
- package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +0 -27
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -12
- package/lib/components/ExcelFile/ImportExcelStyles.d.ts +0 -24
- package/lib/utils/find/findAndInsert.d.ts +0 -7
- package/lib/utils/find/findAndInsert.stories.d.ts +0 -7
- package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +0 -952
- package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -24
- package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +0 -162
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +0 -16
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +0 -68
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -19
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +0 -291
- package/src/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
- package/src/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/src/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Black.ttf +0 -0
- package/src/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Italic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Light.ttf +0 -0
- package/src/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Thin.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
- /package/lib/components/{ExcelFile → Excel}/ColorBarSelector/ColorBarSelector.d.ts +0 -0
- /package/lib/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.d.ts +0 -0
- /package/lib/components/{ExcelFile → Excel}/ExcelFile.stories.d.ts +0 -0
- /package/lib/components/{ExcelFile → Excel}/Types.d.ts +0 -0
- /package/lib/components/{ExcelFile → Excel}/index.d.ts +0 -0
- /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.scss +0 -0
- /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.tsx +0 -0
- /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.scss +0 -0
- /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/typings/fast-formula-parser.d.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.ts +0 -0
- /package/src/components/{ExcelFile → Excel}/Types.ts +0 -0
- /package/src/components/{ExcelFile → Excel}/index.ts +0 -0
@@ -75,6 +75,51 @@ export const Default: Story = {
|
|
75
75
|
],
|
76
76
|
],
|
77
77
|
},
|
78
|
+
{
|
79
|
+
sheetName: "Sheet2",
|
80
|
+
data: [
|
81
|
+
[
|
82
|
+
{
|
83
|
+
value: "Thanesh",
|
84
|
+
style: {
|
85
|
+
fontSize: "12px",
|
86
|
+
fontFamily: "Arial",
|
87
|
+
color: "var(--text-bg-highlight)",
|
88
|
+
backgroundColor: "var(--tooltip-bg-color)",
|
89
|
+
},
|
90
|
+
},
|
91
|
+
{
|
92
|
+
value: "waran",
|
93
|
+
style: {
|
94
|
+
fontSize: "12px",
|
95
|
+
fontFamily: "Arial",
|
96
|
+
color: "var(--text-bg-highlight)",
|
97
|
+
backgroundColor: "var(--brand-color)",
|
98
|
+
},
|
99
|
+
},
|
100
|
+
],
|
101
|
+
[
|
102
|
+
{
|
103
|
+
value: "Sheet",
|
104
|
+
style: {
|
105
|
+
fontSize: "12px",
|
106
|
+
fontFamily: "Arial",
|
107
|
+
color: "var(--drawer-footer-bg)",
|
108
|
+
backgroundColor: "var(--brand-color)",
|
109
|
+
},
|
110
|
+
},
|
111
|
+
{
|
112
|
+
value: "Two",
|
113
|
+
style: {
|
114
|
+
fontSize: "12px",
|
115
|
+
fontFamily: "Arial",
|
116
|
+
color: "var(--brand-color)",
|
117
|
+
backgroundColor: "var(--text-bg-highlight)",
|
118
|
+
},
|
119
|
+
},
|
120
|
+
],
|
121
|
+
],
|
122
|
+
},
|
78
123
|
],
|
79
124
|
},
|
80
125
|
toolbar: 'show',
|
@@ -0,0 +1,36 @@
|
|
1
|
+
.excel-row {
|
2
|
+
height: 42px;
|
3
|
+
align-items: center;
|
4
|
+
|
5
|
+
.excel-toolbar {
|
6
|
+
display: flex;
|
7
|
+
align-items: center;
|
8
|
+
justify-content: start;
|
9
|
+
width: 100%;
|
10
|
+
gap: 10px;
|
11
|
+
}
|
12
|
+
|
13
|
+
.excel-toolbar-center {
|
14
|
+
display: flex;
|
15
|
+
align-items: center;
|
16
|
+
justify-content: space-evenly;
|
17
|
+
width: 100%;
|
18
|
+
gap: 10px;
|
19
|
+
.menu-option {
|
20
|
+
display: flex;
|
21
|
+
flex-direction: column;
|
22
|
+
align-items: center;
|
23
|
+
justify-content: center;
|
24
|
+
cursor: pointer;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
.excel-toolbar-menu {
|
29
|
+
display: flex;
|
30
|
+
align-items: center;
|
31
|
+
}
|
32
|
+
|
33
|
+
.excel-toolbar-hide {
|
34
|
+
display: none;
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,346 @@
|
|
1
|
+
import { useEffect, useState } from 'react';
|
2
|
+
import './ExcelToolBar.scss';
|
3
|
+
import MenuOption from '../../MenuOption';
|
4
|
+
import Tooltip from '../../Tooltip';
|
5
|
+
import Icon from '../../Icon';
|
6
|
+
import Select from '../../Select';
|
7
|
+
import { CellBase } from '../ExcelFile/ExcelFileComponents';
|
8
|
+
import * as Matrix from '../ExcelFile/ExcelFileComponents/matrix';
|
9
|
+
import { Col, Row } from '../../GridLayout/GridLayout';
|
10
|
+
import ColorBarSelector from '../ColorBarSelector/ColorBarSelector';
|
11
|
+
|
12
|
+
interface ExcelToolBarProps {
|
13
|
+
toolbar?: 'show' | 'disable' | 'hide';
|
14
|
+
data: Matrix.Matrix<CellBase>;
|
15
|
+
onBold: (data: Matrix.Matrix<CellBase>) => void;
|
16
|
+
onItalic: (data: Matrix.Matrix<CellBase>) => void;
|
17
|
+
setUnderlineType: (
|
18
|
+
data: Matrix.Matrix<CellBase>,
|
19
|
+
value: string,
|
20
|
+
active: boolean
|
21
|
+
) => void;
|
22
|
+
setColor: (data: Matrix.Matrix<CellBase>, value: string) => void;
|
23
|
+
setBackgroundColor: (data: Matrix.Matrix<CellBase>, value: string) => void;
|
24
|
+
setFormatePainter: (data: Matrix.Matrix<CellBase>) => void;
|
25
|
+
setTextAlign: (data: Matrix.Matrix<CellBase>, value: string) => void;
|
26
|
+
setFontSize: (data: Matrix.Matrix<CellBase>, value: string) => void;
|
27
|
+
setFontFamily: (data: Matrix.Matrix<CellBase>, value: string) => void;
|
28
|
+
setBorderType: (
|
29
|
+
data: Matrix.Matrix<CellBase>,
|
30
|
+
value: string,
|
31
|
+
color: string
|
32
|
+
) => void;
|
33
|
+
}
|
34
|
+
|
35
|
+
const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
36
|
+
toolbar = 'show',
|
37
|
+
data,
|
38
|
+
onBold,
|
39
|
+
onItalic,
|
40
|
+
setUnderlineType,
|
41
|
+
setColor,
|
42
|
+
setFontSize,
|
43
|
+
setFontFamily,
|
44
|
+
setTextAlign,
|
45
|
+
setBackgroundColor,
|
46
|
+
setBorderType,
|
47
|
+
setFormatePainter,
|
48
|
+
}) => {
|
49
|
+
const [border, setBorder] = useState<string>('border-all-sides');
|
50
|
+
const [underLine, setUnderLine] = useState<string>('underline');
|
51
|
+
const [colorContainer, setColorPicker] = useState<ColorContainer>({
|
52
|
+
color: 'var(--error-light)',
|
53
|
+
backgroundColor: 'var(--error-light)',
|
54
|
+
borderColor: 'var(--text-color)',
|
55
|
+
});
|
56
|
+
|
57
|
+
const [formatePainterState, setFormatePainterState] =
|
58
|
+
useState<boolean>(false);
|
59
|
+
|
60
|
+
const borderTypeIcon = [
|
61
|
+
{ value: 'border-all-sides', label: 'All Border', icon: 'all_borders' },
|
62
|
+
{ value: 'border-bottom', label: 'Border Bottom', icon: 'border_bottom' },
|
63
|
+
{ value: 'border-left', label: 'Border Left', icon: 'border_left' },
|
64
|
+
{ value: 'border-right', label: 'Border Right', icon: 'border_right' },
|
65
|
+
{ value: 'border-top', label: 'Border Top', icon: 'border_top' },
|
66
|
+
{ value: 'border-none', label: 'No Border', icon: 'no_border' },
|
67
|
+
];
|
68
|
+
|
69
|
+
const underlineTypeIcon = [
|
70
|
+
{ value: 'underline', label: 'Underline', icon: 'underline' },
|
71
|
+
{
|
72
|
+
value: 'double_border',
|
73
|
+
label: 'Double Underline',
|
74
|
+
icon: 'double_underline',
|
75
|
+
},
|
76
|
+
{ value: 'line-through', label: 'Strikethrough', icon: 'strike_through' },
|
77
|
+
];
|
78
|
+
|
79
|
+
const fontFamily = [
|
80
|
+
{
|
81
|
+
label: 'Times New Roman',
|
82
|
+
value: '"Times New Roman"',
|
83
|
+
},
|
84
|
+
{
|
85
|
+
label: 'Arial',
|
86
|
+
value: 'Arial',
|
87
|
+
},
|
88
|
+
{
|
89
|
+
label: 'Courier New',
|
90
|
+
value: '"Courier New"',
|
91
|
+
},
|
92
|
+
];
|
93
|
+
|
94
|
+
const fontSize = [
|
95
|
+
{
|
96
|
+
label: '5',
|
97
|
+
value: '5',
|
98
|
+
},
|
99
|
+
{
|
100
|
+
label: '9',
|
101
|
+
value: '9',
|
102
|
+
},
|
103
|
+
{
|
104
|
+
label: '11',
|
105
|
+
value: '11',
|
106
|
+
},
|
107
|
+
{
|
108
|
+
label: '12',
|
109
|
+
value: '12',
|
110
|
+
},
|
111
|
+
{
|
112
|
+
label: '14',
|
113
|
+
value: '14',
|
114
|
+
},
|
115
|
+
{
|
116
|
+
label: '16',
|
117
|
+
value: '16',
|
118
|
+
},
|
119
|
+
{
|
120
|
+
label: '18',
|
121
|
+
value: '18',
|
122
|
+
},
|
123
|
+
];
|
124
|
+
|
125
|
+
const getTextColor = (color: string) => {
|
126
|
+
setColorPicker((prev) => ({ ...prev, color: color }));
|
127
|
+
};
|
128
|
+
|
129
|
+
const getBackgroundColor = (color: string) => {
|
130
|
+
setColorPicker((prev) => ({ ...prev, backgroundColor: color }));
|
131
|
+
};
|
132
|
+
|
133
|
+
useEffect(() => {
|
134
|
+
let timeGap = setTimeout(() => {
|
135
|
+
setColor(data, colorContainer.color);
|
136
|
+
}, 0);
|
137
|
+
return () => {
|
138
|
+
clearTimeout(timeGap);
|
139
|
+
};
|
140
|
+
}, [colorContainer.color]);
|
141
|
+
|
142
|
+
useEffect(() => {
|
143
|
+
let timeGap = setTimeout(() => {
|
144
|
+
setBackgroundColor(data, colorContainer.backgroundColor);
|
145
|
+
}, 0);
|
146
|
+
return () => {
|
147
|
+
clearTimeout(timeGap);
|
148
|
+
};
|
149
|
+
}, [colorContainer.backgroundColor]);
|
150
|
+
|
151
|
+
return (
|
152
|
+
<Row className="excel-row" gap="40px">
|
153
|
+
<Col size={3}>
|
154
|
+
<div className="excel-toolbar">
|
155
|
+
<Select
|
156
|
+
className="textType"
|
157
|
+
onChange={(e) => {
|
158
|
+
setFontFamily(data, e.value as string);
|
159
|
+
}}
|
160
|
+
optionsList={fontFamily}
|
161
|
+
selectedOption={{
|
162
|
+
label: 'Times New Roman',
|
163
|
+
value: '"Times New Roman"',
|
164
|
+
}}
|
165
|
+
/>
|
166
|
+
<Select
|
167
|
+
className="selectTag"
|
168
|
+
onChange={(e) => {
|
169
|
+
setFontSize(data, e.value as string);
|
170
|
+
}}
|
171
|
+
optionsList={fontSize}
|
172
|
+
selectedOption={{
|
173
|
+
label: '11',
|
174
|
+
value: '11',
|
175
|
+
}}
|
176
|
+
/>
|
177
|
+
</div>
|
178
|
+
</Col>
|
179
|
+
<Col size={2}>
|
180
|
+
<div className="excel-toolbar-center">
|
181
|
+
<Icon
|
182
|
+
hoverEffect
|
183
|
+
disabled={toolbar === 'disable'}
|
184
|
+
onClick={() => {
|
185
|
+
setTextAlign(data, 'left');
|
186
|
+
}}
|
187
|
+
name="text_align_left"
|
188
|
+
/>
|
189
|
+
<Icon
|
190
|
+
hoverEffect
|
191
|
+
disabled={toolbar === 'disable'}
|
192
|
+
onClick={() => {
|
193
|
+
setTextAlign(data, 'center');
|
194
|
+
}}
|
195
|
+
name="text_align_center"
|
196
|
+
/>
|
197
|
+
<Icon
|
198
|
+
hoverEffect
|
199
|
+
disabled={toolbar === 'disable'}
|
200
|
+
onClick={() => {
|
201
|
+
setTextAlign(data, 'right');
|
202
|
+
}}
|
203
|
+
name="text_align_right"
|
204
|
+
/>
|
205
|
+
</div>
|
206
|
+
</Col>
|
207
|
+
<Col size={2}>
|
208
|
+
<div className="excel-toolbar-center">
|
209
|
+
<Tooltip placement="top" title={'Bold'}>
|
210
|
+
<Icon
|
211
|
+
hoverEffect
|
212
|
+
disabled={toolbar === 'disable'}
|
213
|
+
onClick={() => {
|
214
|
+
onBold(data);
|
215
|
+
}}
|
216
|
+
name="bold"
|
217
|
+
/>
|
218
|
+
</Tooltip>
|
219
|
+
<Tooltip placement="top" title={'Italic'}>
|
220
|
+
<Icon
|
221
|
+
hoverEffect
|
222
|
+
disabled={toolbar === 'disable'}
|
223
|
+
onClick={() => {
|
224
|
+
onItalic(data);
|
225
|
+
}}
|
226
|
+
name="italic"
|
227
|
+
/>
|
228
|
+
</Tooltip>
|
229
|
+
<Tooltip placement="top" title={'Underline'}>
|
230
|
+
<div className="excel-toolbar-menu">
|
231
|
+
<Tooltip placement="top" title={'Formate Painter'}>
|
232
|
+
<div
|
233
|
+
className={
|
234
|
+
formatePainterState ? 'formate-painter-active' : ''
|
235
|
+
}
|
236
|
+
>
|
237
|
+
<Icon
|
238
|
+
hoverEffect
|
239
|
+
disabled={toolbar === 'disable'}
|
240
|
+
onClick={() => {
|
241
|
+
setUnderlineType(data, underLine, true);
|
242
|
+
}}
|
243
|
+
name="underline"
|
244
|
+
/>
|
245
|
+
</div>
|
246
|
+
</Tooltip>
|
247
|
+
<MenuOption
|
248
|
+
iconName="arrow_down"
|
249
|
+
options={underlineTypeIcon}
|
250
|
+
tooltipTitle="Border Type"
|
251
|
+
tooltipPlacement="top"
|
252
|
+
variant="light"
|
253
|
+
onOptionClick={(e) => {
|
254
|
+
setUnderlineType(data, e.value as string, true);
|
255
|
+
setUnderLine(e.value as string);
|
256
|
+
}}
|
257
|
+
/>
|
258
|
+
</div>
|
259
|
+
</Tooltip>
|
260
|
+
</div>
|
261
|
+
</Col>
|
262
|
+
<Col size={2}>
|
263
|
+
<div className="excel-toolbar-center">
|
264
|
+
<Tooltip placement="top" title={'Formate Painter'}>
|
265
|
+
<div
|
266
|
+
className={formatePainterState ? 'formate-painter-active' : ''}
|
267
|
+
>
|
268
|
+
<Icon
|
269
|
+
hoverEffect
|
270
|
+
disabled={toolbar === 'disable'}
|
271
|
+
onClick={() => {
|
272
|
+
setFormatePainter(data);
|
273
|
+
setFormatePainterState((prev) => !prev);
|
274
|
+
}}
|
275
|
+
name="formate_painter"
|
276
|
+
/>
|
277
|
+
</div>
|
278
|
+
</Tooltip>
|
279
|
+
<div className="menu-option">
|
280
|
+
<Tooltip placement="top" title={'Text Color'}>
|
281
|
+
<Icon
|
282
|
+
hoverEffect
|
283
|
+
disabled={toolbar === 'disable'}
|
284
|
+
onClick={() => {
|
285
|
+
setColor(data, colorContainer.color);
|
286
|
+
}}
|
287
|
+
name="text_color"
|
288
|
+
/>
|
289
|
+
<ColorBarSelector
|
290
|
+
disabled={toolbar === 'disable'}
|
291
|
+
getColorValue={getTextColor}
|
292
|
+
/>
|
293
|
+
</Tooltip>
|
294
|
+
</div>
|
295
|
+
<div className="menu-option">
|
296
|
+
<Tooltip placement="top" title={'Background Color'}>
|
297
|
+
<Icon
|
298
|
+
hoverEffect
|
299
|
+
disabled={toolbar === 'disable'}
|
300
|
+
onClick={() => {
|
301
|
+
setBackgroundColor(data, colorContainer.backgroundColor);
|
302
|
+
}}
|
303
|
+
name="fill_color"
|
304
|
+
/>
|
305
|
+
</Tooltip>
|
306
|
+
<ColorBarSelector
|
307
|
+
disabled={toolbar === 'disable'}
|
308
|
+
getColorValue={getBackgroundColor}
|
309
|
+
/>
|
310
|
+
</div>
|
311
|
+
</div>
|
312
|
+
</Col>
|
313
|
+
<Col size={1}>
|
314
|
+
<div className="excel-toolbar-menu">
|
315
|
+
<Tooltip placement="top" title={'Formate Painter'}>
|
316
|
+
<div
|
317
|
+
className={formatePainterState ? 'formate-painter-active' : ''}
|
318
|
+
>
|
319
|
+
<Icon
|
320
|
+
hoverEffect
|
321
|
+
disabled={toolbar === 'disable'}
|
322
|
+
onClick={() => {
|
323
|
+
setBorderType(data, border, 'black');
|
324
|
+
}}
|
325
|
+
name="all_borders"
|
326
|
+
/>
|
327
|
+
</div>
|
328
|
+
</Tooltip>
|
329
|
+
<MenuOption
|
330
|
+
iconName="arrow_down"
|
331
|
+
options={borderTypeIcon}
|
332
|
+
tooltipTitle="Border Type"
|
333
|
+
tooltipPlacement="top"
|
334
|
+
variant="light"
|
335
|
+
onOptionClick={(e) => {
|
336
|
+
setBorder(e.value as string);
|
337
|
+
setBorderType(data, e.value as string, 'black');
|
338
|
+
}}
|
339
|
+
/>
|
340
|
+
</div>
|
341
|
+
</Col>
|
342
|
+
</Row>
|
343
|
+
);
|
344
|
+
};
|
345
|
+
|
346
|
+
export default ExcelToolBar;
|
@@ -23,34 +23,42 @@
|
|
23
23
|
padding: 10px;
|
24
24
|
border: 1px solid var(--arrows-button-border-color);
|
25
25
|
border-radius: 8px;
|
26
|
+
|
26
27
|
&:focus {
|
27
28
|
border-color: var(--brand-color);
|
28
29
|
}
|
30
|
+
|
29
31
|
&.ff-error {
|
30
32
|
border-color: var(--ff-error-light);
|
31
33
|
}
|
32
34
|
}
|
35
|
+
|
33
36
|
.ff-error {
|
34
37
|
color: var(--error-light);
|
35
38
|
margin-top: 4px;
|
36
39
|
}
|
37
40
|
}
|
41
|
+
|
38
42
|
.ff-form-group {
|
39
43
|
margin-bottom: 16px;
|
44
|
+
|
40
45
|
.ff-label {
|
41
46
|
display: block;
|
42
47
|
margin-bottom: 4px;
|
43
48
|
font-weight: bold;
|
44
49
|
}
|
50
|
+
|
45
51
|
input,
|
46
52
|
select {
|
47
53
|
width: 94%;
|
48
54
|
padding: 10px;
|
49
55
|
border: 1px solid var(--arrows-button-border-color);
|
50
56
|
border-radius: 8px;
|
57
|
+
|
51
58
|
&:focus {
|
52
59
|
border-color: var(--brand-color);
|
53
60
|
}
|
61
|
+
|
54
62
|
&.ff-error {
|
55
63
|
border-color: var(--ff-error-light); // Ensure red border color
|
56
64
|
}
|
@@ -66,6 +74,7 @@
|
|
66
74
|
.ff-radio-group-wrapper {
|
67
75
|
display: flex;
|
68
76
|
}
|
77
|
+
|
69
78
|
.ff-radio-gender {
|
70
79
|
display: flex;
|
71
80
|
flex-direction: column;
|
@@ -75,17 +84,20 @@
|
|
75
84
|
margin-right: 0.5rem;
|
76
85
|
}
|
77
86
|
}
|
87
|
+
|
78
88
|
.ff-error {
|
79
89
|
padding-left: 12px;
|
80
90
|
color: var(--error-light);
|
81
91
|
margin-top: 4px;
|
82
92
|
}
|
83
93
|
}
|
94
|
+
|
84
95
|
.ff-button-layout {
|
85
96
|
width: 99%;
|
86
97
|
display: flex;
|
87
98
|
gap: 12px;
|
88
99
|
margin-top: 24px;
|
100
|
+
|
89
101
|
button {
|
90
102
|
width: 50%;
|
91
103
|
background-color: var(--brand-color);
|
@@ -98,45 +110,52 @@
|
|
98
110
|
}
|
99
111
|
}
|
100
112
|
|
101
|
-
.ff-
|
102
|
-
|
103
|
-
|
104
|
-
background-color: var(--tree-connecting-lines-color);
|
113
|
+
.ff-forms-container {
|
114
|
+
height: 450px;
|
115
|
+
overflow-y: scroll;
|
105
116
|
|
106
|
-
.ff-
|
107
|
-
padding
|
108
|
-
|
109
|
-
|
110
|
-
}
|
117
|
+
.ff-main {
|
118
|
+
padding: 40px;
|
119
|
+
border-radius: 10px;
|
120
|
+
background-color: var(--tree-connecting-lines-color);
|
111
121
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
}
|
122
|
+
.ff-error {
|
123
|
+
padding-left: 12px;
|
124
|
+
color: var(--error-light);
|
125
|
+
margin-top: 4px;
|
126
|
+
}
|
118
127
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
.ff-button-layout {
|
124
|
-
width: 99%;
|
125
|
-
display: flex;
|
126
|
-
gap: 12px;
|
127
|
-
margin-top: 24px;
|
128
|
+
.ff-radio {
|
129
|
+
margin-top: 8px;
|
130
|
+
}
|
128
131
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
132
|
+
.ff-check {
|
133
|
+
display: flex;
|
134
|
+
}
|
135
|
+
|
136
|
+
.ff-textarea {
|
137
|
+
margin-top: 8px;
|
138
|
+
}
|
139
|
+
|
140
|
+
.ff-button-layout {
|
141
|
+
width: 99%;
|
142
|
+
display: flex;
|
143
|
+
gap: 12px;
|
144
|
+
margin-top: 24px;
|
145
|
+
|
146
|
+
button {
|
147
|
+
// width: 50%;
|
148
|
+
background-color: var(--brand-color);
|
149
|
+
color: var(--primary-button-text-color);
|
150
|
+
border: none;
|
151
|
+
border-radius: 8px;
|
152
|
+
padding: 10px;
|
153
|
+
cursor: pointer;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
.ff-select {
|
158
|
+
width: 90%;
|
137
159
|
}
|
138
|
-
}
|
139
|
-
.ff-select {
|
140
|
-
width: 90%;
|
141
160
|
}
|
142
161
|
}
|