pixel-react 1.1.8 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/AddButton/AddButton.d.ts +5 -0
- package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
- package/lib/components/AddButton/index.d.ts +1 -0
- package/lib/components/AddButton/types.d.ts +4 -0
- package/lib/components/AppHeader/types.d.ts +7 -7
- package/lib/components/Drawer/Drawer.stories.d.ts +2 -0
- package/lib/components/Drawer/Types.d.ts +11 -0
- package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +14 -0
- package/lib/components/ExcelFile/ColorBarSelector/ColorBarSelector.d.ts +8 -0
- package/lib/components/ExcelFile/ContextMenu/ContextMenu.d.ts +4 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +7 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +4 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +8 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +10 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +81 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +130 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +1 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +8 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +22 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +17 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +21 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +24 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +13 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +67 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +22 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +11 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +27 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +95 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +215 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +45 -0
- package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile.stories.d.ts +6 -0
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +15 -0
- package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +3 -0
- package/lib/components/ExcelFile/ImportExcelStyles.d.ts +24 -0
- package/lib/components/ExcelFile/Types.d.ts +176 -0
- package/lib/components/ExcelFile/index.d.ts +1 -0
- package/lib/components/Icon/Icon.stories.d.ts +1 -0
- package/lib/components/Icon/types.d.ts +1 -0
- package/lib/components/IconRadioGroup/IconRadioGroup.d.ts +5 -0
- package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +7 -0
- package/lib/components/IconRadioGroup/index.d.ts +1 -0
- package/lib/components/IconRadioGroup/type.d.ts +41 -0
- package/lib/components/Table/Table.d.ts +1 -1
- package/lib/components/Table/Table.stories.d.ts +2 -0
- package/lib/components/Table/Types.d.ts +16 -0
- package/lib/index.d.ts +81 -9
- package/lib/index.esm.js +739 -248
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +739 -247
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/find/findAndInsert.d.ts +7 -0
- package/lib/utils/find/findAndInsert.stories.d.ts +7 -0
- package/package.json +4 -2
- package/src/assets/Themes/BaseTheme.scss +4 -0
- package/src/assets/Themes/DarkTheme.scss +4 -0
- package/src/assets/icons/all_borders.svg +3 -0
- package/src/assets/icons/bold.svg +3 -0
- package/src/assets/icons/border_bottom.svg +3 -0
- package/src/assets/icons/border_left.svg +3 -0
- package/src/assets/icons/border_right.svg +3 -0
- package/src/assets/icons/border_top.svg +3 -0
- package/src/assets/icons/clone_icon.svg +3 -0
- package/src/assets/icons/double_underline.svg +5 -0
- package/src/assets/icons/eye_closed.svg +3 -0
- package/src/assets/icons/fill_color.svg +7 -0
- package/src/assets/icons/formate_painter.svg +5 -0
- package/src/assets/icons/full_access_icon.svg +4 -0
- package/src/assets/icons/history_icon.svg +19 -0
- package/src/assets/icons/italic.svg +3 -0
- package/src/assets/icons/jira.svg +3 -0
- package/src/assets/icons/linked_defects.svg +11 -0
- package/src/assets/icons/move_icon.svg +5 -0
- package/src/assets/icons/no_access_icon.svg +4 -0
- package/src/assets/icons/no_border.svg +3 -0
- package/src/assets/icons/strike_through.svg +3 -0
- package/src/assets/icons/text_align_center.svg +3 -0
- package/src/assets/icons/text_align_left.svg +3 -0
- package/src/assets/icons/text_align_right.svg +3 -0
- package/src/assets/icons/text_color.svg +3 -0
- package/src/assets/icons/underline.svg +4 -0
- package/src/assets/icons/view_access_icon.svg +4 -0
- package/src/components/AppHeader/AppHeader.scss +23 -10
- package/src/components/AppHeader/AppHeader.stories.tsx +29 -28
- package/src/components/AppHeader/AppHeader.tsx +18 -16
- package/src/components/AppHeader/types.ts +7 -7
- package/src/components/Button/Button.scss +1 -0
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/Drawer/Drawer.scss +13 -9
- package/src/components/Drawer/Drawer.stories.tsx +28 -0
- package/src/components/Drawer/Drawer.tsx +29 -6
- package/src/components/Drawer/Types.ts +11 -0
- package/src/components/ExcelFile/ChangeExcelStyles.tsx +78 -0
- package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +13 -0
- package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.tsx +43 -0
- package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +102 -0
- package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +104 -0
- package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +131 -0
- package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +201 -0
- package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +123 -0
- package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +25 -0
- package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +49 -0
- package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +37 -0
- package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +46 -0
- package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +31 -0
- package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +5 -0
- package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +5 -0
- package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +102 -0
- package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +32 -0
- package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.css +144 -0
- package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +494 -0
- package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +19 -0
- package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +302 -0
- package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +18 -0
- package/src/components/ExcelFile/ExcelFile/Excel/context.ts +12 -0
- package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +200 -0
- package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +137 -0
- package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -0
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +154 -0
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +10 -0
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +69 -0
- package/src/components/ExcelFile/ExcelFile/Excel/index.ts +48 -0
- package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +388 -0
- package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +82 -0
- package/src/components/ExcelFile/ExcelFile/Excel/point.ts +15 -0
- package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +682 -0
- package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +257 -0
- package/src/components/ExcelFile/ExcelFile/Excel/types.ts +269 -0
- package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +58 -0
- package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +8 -0
- package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +9 -0
- package/src/components/ExcelFile/ExcelFile/Excel/util.ts +173 -0
- package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +27 -0
- package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +520 -0
- package/src/components/ExcelFile/ExcelFile.stories.tsx +132 -0
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +16 -0
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +79 -0
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +22 -0
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +271 -0
- package/src/components/ExcelFile/ImportExcelStyles.tsx +86 -0
- package/src/components/ExcelFile/Types.ts +241 -0
- package/src/components/ExcelFile/index.ts +1 -0
- package/src/components/Icon/Icon.stories.tsx +27 -0
- package/src/components/Icon/Icon.tsx +5 -1
- package/src/components/Icon/Icons.scss +15 -5
- package/src/components/Icon/iconList.ts +52 -1
- package/src/components/Icon/types.ts +1 -0
- package/src/components/IconRadioGroup/IconRadioGroup.scss +60 -0
- package/src/components/IconRadioGroup/IconRadioGroup.stories.tsx +108 -0
- package/src/components/IconRadioGroup/IconRadioGroup.tsx +72 -0
- package/src/components/IconRadioGroup/index.ts +1 -0
- package/src/components/IconRadioGroup/type.ts +50 -0
- package/src/components/Modal/Modal.tsx +8 -1
- package/src/components/Modal/modal.scss +10 -2
- package/src/components/Table/Table.scss +16 -4
- package/src/components/Table/Table.stories.tsx +36 -12
- package/src/components/Table/Table.tsx +33 -16
- package/src/components/Table/Types.ts +121 -105
- package/src/index.ts +2 -0
@@ -28,79 +28,79 @@ const defaultArgs = {
|
|
28
28
|
};
|
29
29
|
|
30
30
|
const headerMenuItems = [
|
31
|
-
{
|
31
|
+
{ label: 'Dashboard', path: 'Dashboard', subMenuItems: [] },
|
32
32
|
{
|
33
|
-
|
34
|
-
|
33
|
+
label: 'Repo',
|
34
|
+
path: 'Repo',
|
35
35
|
subMenuItems: [
|
36
36
|
{
|
37
|
-
|
38
|
-
|
37
|
+
label: 'Elements',
|
38
|
+
path: 'Elements',
|
39
39
|
quickMenuItems: [],
|
40
40
|
},
|
41
41
|
{
|
42
|
-
|
43
|
-
|
42
|
+
label: 'Program Elements',
|
43
|
+
path: 'Program Elements',
|
44
44
|
quickMenuItems: [],
|
45
45
|
},
|
46
46
|
{
|
47
|
-
|
48
|
-
|
47
|
+
label: 'Step Groups',
|
48
|
+
path: 'Step Groups',
|
49
49
|
quickMenuItems: [
|
50
50
|
{
|
51
51
|
quickMenuName: 'Success Icon',
|
52
|
-
|
52
|
+
iconName: 'success',
|
53
53
|
},
|
54
54
|
{
|
55
55
|
quickMenuName: 'Warning Icon',
|
56
|
-
|
56
|
+
iconName: 'warning',
|
57
57
|
},
|
58
58
|
{
|
59
59
|
quickMenuName: 'Info Icon',
|
60
|
-
|
60
|
+
iconName: 'info',
|
61
61
|
},
|
62
62
|
],
|
63
63
|
},
|
64
64
|
],
|
65
65
|
},
|
66
66
|
{
|
67
|
-
|
68
|
-
|
67
|
+
label: 'Test Data',
|
68
|
+
path: 'Test Data',
|
69
69
|
subMenuItems: [],
|
70
70
|
},
|
71
71
|
{
|
72
|
-
|
73
|
-
|
72
|
+
label: 'Test Dev',
|
73
|
+
path: 'Test Dev',
|
74
74
|
subMenuItems: [
|
75
75
|
{
|
76
|
-
|
77
|
-
|
76
|
+
label: 'Scripts',
|
77
|
+
path: 'Scripts',
|
78
78
|
quickMenuItems: [
|
79
79
|
{
|
80
80
|
quickMenuName: 'Delete Icon',
|
81
|
-
|
81
|
+
iconName: 'delete',
|
82
82
|
},
|
83
83
|
{
|
84
84
|
quickMenuName: 'Details Icon',
|
85
|
-
|
85
|
+
iconName: 'details',
|
86
86
|
},
|
87
87
|
{
|
88
88
|
quickMenuName: 'Sun Icon',
|
89
|
-
|
89
|
+
iconName: 'sun_icon',
|
90
90
|
},
|
91
91
|
{
|
92
92
|
quickMenuName: 'Moon Stars Icon',
|
93
|
-
|
93
|
+
iconName: 'moon_stars_icon',
|
94
94
|
},
|
95
95
|
{
|
96
96
|
quickMenuName: 'Impact List Icon',
|
97
|
-
|
97
|
+
iconName: 'impactList',
|
98
98
|
},
|
99
99
|
],
|
100
100
|
},
|
101
101
|
{
|
102
|
-
|
103
|
-
|
102
|
+
label: 'Executions',
|
103
|
+
path: 'Executions',
|
104
104
|
quickMenuItems: [],
|
105
105
|
},
|
106
106
|
],
|
@@ -132,13 +132,13 @@ export const Controlled: Story = {
|
|
132
132
|
const [selectedSubMenuItem, setSelectedSubMenuItem] = useState('');
|
133
133
|
const [selectedQuickMenuItem, setSelectedQuickMenuItem] = useState('');
|
134
134
|
const handleMenuClick = (item: appHeaderMenuItemProps) => {
|
135
|
-
setSelectedMenuItem(item.
|
135
|
+
setSelectedMenuItem(item.label);
|
136
136
|
};
|
137
137
|
const handleSubMenuClick = (item: appHeaderSubMenuItemProps) => {
|
138
|
-
setSelectedSubMenuItem(item.
|
138
|
+
setSelectedSubMenuItem(item.label);
|
139
139
|
};
|
140
140
|
const handleQuickMenuClick = (item: appHeaderQuickMenuItemProps) => {
|
141
|
-
setSelectedQuickMenuItem(item.
|
141
|
+
setSelectedQuickMenuItem(item.iconName);
|
142
142
|
};
|
143
143
|
|
144
144
|
return (
|
@@ -146,6 +146,7 @@ export const Controlled: Story = {
|
|
146
146
|
<div>
|
147
147
|
<AppHeader
|
148
148
|
logoIconName="fireflink_icon"
|
149
|
+
leftContent={headerRightSideContent}
|
149
150
|
rightContent={headerRightSideContent}
|
150
151
|
appHeaderMenuItems={headerMenuItems}
|
151
152
|
appHeaderHiddenMenuItems={headerHiddenMenuItems}
|
@@ -22,12 +22,14 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
22
22
|
return (
|
23
23
|
<>
|
24
24
|
<div className="ff-app-header">
|
25
|
-
<div className=
|
26
|
-
<
|
25
|
+
<div className='ff-app-header-left-container'>
|
26
|
+
<div className="ff-app-header-logo-icon">
|
27
|
+
<Icon color="" name={logoIconName} height={24} width={21} />
|
28
|
+
</div>
|
29
|
+
{leftContent && (
|
30
|
+
<div className="ff-app-header-left-content">{leftContent}</div>
|
31
|
+
)}
|
27
32
|
</div>
|
28
|
-
{leftContent && (
|
29
|
-
<div className="ff-app-header-left-content">{leftContent}</div>
|
30
|
-
)}
|
31
33
|
<div className="ff-app-header-nav-bar">
|
32
34
|
{checkEmpty(projectsList) && (
|
33
35
|
<div>{/* <AllProjectsDropdown /> */}</div>
|
@@ -38,9 +40,9 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
38
40
|
<div
|
39
41
|
className={classNames('ff-app-header-nav-bar-item', {
|
40
42
|
['ff-app-header-nav-bar-item--selected']:
|
41
|
-
menuItem.
|
43
|
+
menuItem.label === selectedMenu,
|
42
44
|
})}
|
43
|
-
key={menuItem.
|
45
|
+
key={menuItem.label}
|
44
46
|
onClick={() => onMenuClick(menuItem)}
|
45
47
|
>
|
46
48
|
<Typography
|
@@ -48,14 +50,14 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
48
50
|
className="ff-app-header-nav-bar-item-label"
|
49
51
|
lineHeight="18px"
|
50
52
|
>
|
51
|
-
{menuItem.
|
53
|
+
{menuItem.label}
|
52
54
|
</Typography>
|
53
|
-
{menuItem.
|
55
|
+
{menuItem.label === selectedMenu &&
|
54
56
|
menuItem?.subMenuItems &&
|
55
57
|
menuItem.subMenuItems.map((subMenuItem) => {
|
56
58
|
return (
|
57
59
|
<div
|
58
|
-
key={subMenuItem.
|
60
|
+
key={subMenuItem.label}
|
59
61
|
onClick={() => onSubMenuClick(subMenuItem)}
|
60
62
|
className="ff-app-header-submenu-container"
|
61
63
|
>
|
@@ -65,14 +67,14 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
65
67
|
'ff-app-header-nav-bar-submenu-item',
|
66
68
|
{
|
67
69
|
['ff-app-header-nav-bar-submenu-item--selected']:
|
68
|
-
subMenuItem.
|
70
|
+
subMenuItem.label === selectedSubMenu,
|
69
71
|
}
|
70
72
|
)}
|
71
73
|
lineHeight="18px"
|
72
74
|
>
|
73
|
-
{subMenuItem.
|
75
|
+
{subMenuItem.label}
|
74
76
|
</Typography>
|
75
|
-
{subMenuItem.
|
77
|
+
{subMenuItem.label === selectedSubMenu &&
|
76
78
|
subMenuItem?.quickMenuItems && (
|
77
79
|
<div className="ff-app-header-quickmenu-container">
|
78
80
|
<div>
|
@@ -83,7 +85,7 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
83
85
|
return (
|
84
86
|
<>
|
85
87
|
<div
|
86
|
-
key={quickMenuItem.
|
88
|
+
key={quickMenuItem.iconName}
|
87
89
|
onClick={() =>
|
88
90
|
onQuickMenuClick(quickMenuItem)
|
89
91
|
}
|
@@ -91,14 +93,14 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
91
93
|
'ff-app-header-nav-bar-quickmenu-item',
|
92
94
|
{
|
93
95
|
['ff-app-header-nav-bar-quickmenu-item--selected']:
|
94
|
-
quickMenuItem.
|
96
|
+
quickMenuItem.path ===
|
95
97
|
selectedQuickMenu,
|
96
98
|
}
|
97
99
|
)}
|
98
100
|
>
|
99
101
|
<Icon
|
100
102
|
name={
|
101
|
-
quickMenuItem.
|
103
|
+
quickMenuItem.iconName
|
102
104
|
}
|
103
105
|
height={24}
|
104
106
|
width={24}
|
@@ -15,17 +15,17 @@ export interface AppHeaderProps {
|
|
15
15
|
onQuickMenuClick?: (text: any) => void;
|
16
16
|
}
|
17
17
|
export interface appHeaderMenuItemProps {
|
18
|
-
|
19
|
-
|
18
|
+
label: string;
|
19
|
+
path?: string;
|
20
20
|
subMenuItems?: appHeaderSubMenuItemProps[];
|
21
21
|
}
|
22
22
|
export interface appHeaderSubMenuItemProps {
|
23
|
-
|
24
|
-
|
23
|
+
label: string;
|
24
|
+
path?: string;
|
25
25
|
quickMenuItems?: appHeaderQuickMenuItemProps[];
|
26
26
|
}
|
27
27
|
export interface appHeaderQuickMenuItemProps {
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
label?: string;
|
29
|
+
path?: string;
|
30
|
+
iconName: string;
|
31
31
|
}
|
@@ -12,6 +12,7 @@
|
|
12
12
|
position: fixed;
|
13
13
|
right: 0;
|
14
14
|
bottom: 0;
|
15
|
+
top: 80px;
|
15
16
|
min-width: 450px;
|
16
17
|
background-color: var(--primary-button-text-color);
|
17
18
|
z-index: 999;
|
@@ -94,23 +95,21 @@
|
|
94
95
|
justify-content: center;
|
95
96
|
border-radius: 8px;
|
96
97
|
}
|
98
|
+
.ff-custom-header {
|
99
|
+
background-color: var(--drawer-footer-bg);
|
100
|
+
padding: 4px 8px;
|
101
|
+
}
|
97
102
|
}
|
98
103
|
}
|
99
104
|
}
|
100
105
|
|
101
106
|
.ff-drawer-body {
|
102
107
|
background-color: var(--drawer-footer-bg);
|
103
|
-
|
104
|
-
overflow: hidden auto;
|
105
|
-
}
|
106
|
-
|
107
|
-
.no-footer {
|
108
|
-
height: 100vh;
|
108
|
+
overflow-y: auto;
|
109
109
|
}
|
110
110
|
|
111
111
|
.ff-drawer-footer {
|
112
|
-
|
113
|
-
position: absolute;
|
112
|
+
position: fixed;
|
114
113
|
bottom: 0;
|
115
114
|
left: 0;
|
116
115
|
right: 0;
|
@@ -118,11 +117,16 @@
|
|
118
117
|
display: flex;
|
119
118
|
justify-content: space-between;
|
120
119
|
border-top: 1px solid var(--drawer-footer-border);
|
120
|
+
z-index: 1000;
|
121
121
|
|
122
122
|
.button-container {
|
123
123
|
display: flex;
|
124
124
|
justify-content: flex-end;
|
125
|
-
gap:
|
125
|
+
gap: 8px;
|
126
|
+
}
|
127
|
+
.ff-custom-footer {
|
128
|
+
background-color: var(--drawer-footer-bg);
|
129
|
+
padding: 4px 8px;
|
126
130
|
}
|
127
131
|
}
|
128
132
|
}
|
@@ -98,6 +98,34 @@ export const WithCustomFooter: Story = {
|
|
98
98
|
docs: { disable: true },
|
99
99
|
},
|
100
100
|
};
|
101
|
+
export const WithTertiaryButtons: Story = {
|
102
|
+
args: {
|
103
|
+
...defaultArgs,
|
104
|
+
tertiaryButtonProps: {
|
105
|
+
left: {
|
106
|
+
label: 'Help',
|
107
|
+
onClick: () => {},
|
108
|
+
},
|
109
|
+
right: {
|
110
|
+
label: 'More Info',
|
111
|
+
onClick: () => {},
|
112
|
+
},
|
113
|
+
},
|
114
|
+
},
|
115
|
+
parameters: {
|
116
|
+
docs: { disable: true },
|
117
|
+
},
|
118
|
+
};
|
119
|
+
|
120
|
+
export const WithCustomZIndex: Story = {
|
121
|
+
args: {
|
122
|
+
...defaultArgs,
|
123
|
+
zIndex: 1050,
|
124
|
+
},
|
125
|
+
parameters: {
|
126
|
+
docs: { disable: true },
|
127
|
+
},
|
128
|
+
};
|
101
129
|
|
102
130
|
export const Controlled: Story = {
|
103
131
|
render: () => {
|
@@ -30,6 +30,8 @@ const Drawer: FC<DrawerProps> = ({
|
|
30
30
|
onCloseIconClick,
|
31
31
|
customHeader,
|
32
32
|
customFooter,
|
33
|
+
tertiaryButtonProps = { left: {}, right: {} },
|
34
|
+
zIndex = 999,
|
33
35
|
}: DrawerProps) => {
|
34
36
|
const [isExpanded, setIsExpanded] = useState(_isExpanded);
|
35
37
|
|
@@ -72,11 +74,16 @@ const Drawer: FC<DrawerProps> = ({
|
|
72
74
|
className={classNames('ff-drawer', `ff-drawer--${drawerSize}`, {
|
73
75
|
'ff-drawer--open': isOpen,
|
74
76
|
})}
|
77
|
+
style={{ zIndex }}
|
75
78
|
>
|
76
79
|
{showHeader && (
|
77
|
-
<div
|
80
|
+
<div
|
81
|
+
className={classNames('ff-drawer-header', {
|
82
|
+
'ff-custom-header': customHeader,
|
83
|
+
})}
|
84
|
+
>
|
78
85
|
{customHeader ? (
|
79
|
-
customHeader
|
86
|
+
<div className="ff-custom-header">{customHeader}</div>
|
80
87
|
) : (
|
81
88
|
<div className="ff-drawer-action-section">
|
82
89
|
<div className="ff-action-button">
|
@@ -106,9 +113,7 @@ const Drawer: FC<DrawerProps> = ({
|
|
106
113
|
className="ff-expand-collapse-button"
|
107
114
|
onClick={onClose}
|
108
115
|
>
|
109
|
-
{backButtonIcon
|
110
|
-
backButtonIcon
|
111
|
-
) : (
|
116
|
+
{backButtonIcon || (
|
112
117
|
<Icon
|
113
118
|
name="error"
|
114
119
|
height={16}
|
@@ -146,7 +151,11 @@ const Drawer: FC<DrawerProps> = ({
|
|
146
151
|
</div>
|
147
152
|
|
148
153
|
{isFooterRequired && (
|
149
|
-
<div
|
154
|
+
<div
|
155
|
+
className={classNames('ff-drawer-footer', {
|
156
|
+
'ff-custom-footer': customFooter,
|
157
|
+
})}
|
158
|
+
>
|
150
159
|
{customFooter || footerContent || (
|
151
160
|
<>
|
152
161
|
<div className="button-container">
|
@@ -166,8 +175,22 @@ const Drawer: FC<DrawerProps> = ({
|
|
166
175
|
transparentBackground={true}
|
167
176
|
/>
|
168
177
|
)}
|
178
|
+
{tertiaryButtonProps.left?.label && (
|
179
|
+
<Button
|
180
|
+
{...tertiaryButtonProps.left}
|
181
|
+
variant="tertiary"
|
182
|
+
transparentBackground={true}
|
183
|
+
/>
|
184
|
+
)}
|
169
185
|
</div>
|
170
186
|
<div className="button-container">
|
187
|
+
{tertiaryButtonProps.right?.label && (
|
188
|
+
<Button
|
189
|
+
{...tertiaryButtonProps.right}
|
190
|
+
variant="tertiary"
|
191
|
+
transparentBackground={true}
|
192
|
+
/>
|
193
|
+
)}
|
171
194
|
{secondaryButtonProps.label && (
|
172
195
|
<Button
|
173
196
|
{...secondaryButtonProps}
|
@@ -109,4 +109,15 @@ export interface DrawerProps {
|
|
109
109
|
* If provided, this will render in place of the default footer.
|
110
110
|
*/
|
111
111
|
customFooter?: ReactNode;
|
112
|
+
/**
|
113
|
+
* Tertiary button properties (optional)
|
114
|
+
*/
|
115
|
+
tertiaryButtonProps?: {
|
116
|
+
left?: BtnPropsCommon;
|
117
|
+
right?: BtnPropsCommon;
|
118
|
+
};
|
119
|
+
/**
|
120
|
+
* Custom z-index for the drawer
|
121
|
+
*/
|
122
|
+
zIndex?: number;
|
112
123
|
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import { CellBase } from "./ExcelFile/Excel";
|
2
|
+
|
3
|
+
interface ChangeExcelStylesOptions {
|
4
|
+
sheetName: string;
|
5
|
+
styleType: string;
|
6
|
+
value: string;
|
7
|
+
selectedCell: { row: number; column: number }[];
|
8
|
+
}
|
9
|
+
|
10
|
+
export default function ChangeExcelStyles(
|
11
|
+
setWorksheetsData: React.Dispatch<React.SetStateAction<{ [key: string]: Matrix<CellBase>; }>>,
|
12
|
+
options: ChangeExcelStylesOptions
|
13
|
+
) {
|
14
|
+
const { sheetName, styleType, value, selectedCell } = options;
|
15
|
+
|
16
|
+
setWorksheetsData((prev) => {
|
17
|
+
if (!prev[sheetName]) {
|
18
|
+
return prev;
|
19
|
+
}
|
20
|
+
|
21
|
+
const sheetData = prev[sheetName]!;
|
22
|
+
const selectedCells = new Set(
|
23
|
+
selectedCell.map(({ row, column }) => `${row}-${column}`)
|
24
|
+
);
|
25
|
+
|
26
|
+
const updatedSheetData: Matrix<CellBase> = sheetData.map((row, rowIndex) =>
|
27
|
+
row.map((cell, columnIndex) => {
|
28
|
+
const isSelected = selectedCells.has(`${rowIndex}-${columnIndex}`);
|
29
|
+
if (isSelected&&cell!==undefined) {
|
30
|
+
let newStyle = { ...cell.style };
|
31
|
+
|
32
|
+
switch (styleType) {
|
33
|
+
// case 'border':
|
34
|
+
// newStyle = handleBorderChange(newStyle, value);
|
35
|
+
// break;
|
36
|
+
// case 'alignment':
|
37
|
+
// newStyle = handleAlignmentChange(newStyle, value);
|
38
|
+
// break;
|
39
|
+
// case 'bold':
|
40
|
+
// newStyle = handleBoldChange(newStyle);
|
41
|
+
// break;
|
42
|
+
// case 'italic':
|
43
|
+
// newStyle = handleItalicChange(newStyle);
|
44
|
+
// break;
|
45
|
+
case 'color':
|
46
|
+
newStyle = handleColorChange(newStyle, value);
|
47
|
+
break;
|
48
|
+
case 'backgroundColor':
|
49
|
+
newStyle = handleBackgroundColorChange(newStyle, value);
|
50
|
+
break;
|
51
|
+
default:
|
52
|
+
break;
|
53
|
+
}
|
54
|
+
|
55
|
+
const newValue = cell.value ?? "";
|
56
|
+
|
57
|
+
return { ...cell, style: newStyle, value: newValue };
|
58
|
+
}
|
59
|
+
return cell;
|
60
|
+
})
|
61
|
+
);
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
return { ...prev, [sheetName]: updatedSheetData };
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
69
|
+
function handleColorChange(style: CellStyle, value: string): CellStyle {
|
70
|
+
return { ...style, color: `#${value}` };
|
71
|
+
}
|
72
|
+
|
73
|
+
function handleBackgroundColorChange(
|
74
|
+
style: CellStyle,
|
75
|
+
value: string
|
76
|
+
): CellStyle {
|
77
|
+
return { ...style, backgroundColor: `#${value}` };
|
78
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
2
|
+
import './ColorBarSelector.scss';
|
3
|
+
|
4
|
+
interface ColorBarSelectorProps {
|
5
|
+
getColorValue: (color: string) => void;
|
6
|
+
disabled: boolean;
|
7
|
+
}
|
8
|
+
const ColorBarSelector: React.FC<ColorBarSelectorProps> = ({
|
9
|
+
getColorValue,
|
10
|
+
disabled,
|
11
|
+
}) => {
|
12
|
+
const colorInputRef = useRef<HTMLInputElement | null>(null);
|
13
|
+
const [color, setColor] = useState<string>('var(--error-light)');
|
14
|
+
|
15
|
+
const handleColorClick = () => {
|
16
|
+
if (colorInputRef.current) {
|
17
|
+
colorInputRef.current.click();
|
18
|
+
}
|
19
|
+
};
|
20
|
+
|
21
|
+
return (
|
22
|
+
<div
|
23
|
+
className="color-bar"
|
24
|
+
style={{
|
25
|
+
backgroundColor: `${color}`,
|
26
|
+
}}
|
27
|
+
onClick={handleColorClick}
|
28
|
+
>
|
29
|
+
<input
|
30
|
+
type="color"
|
31
|
+
disabled={disabled}
|
32
|
+
className="colorPicker"
|
33
|
+
ref={colorInputRef}
|
34
|
+
onChange={(e) => {
|
35
|
+
setColor(e.target.value);
|
36
|
+
getColorValue(e.target.value.replace('#', ''));
|
37
|
+
}}
|
38
|
+
/>
|
39
|
+
</div>
|
40
|
+
);
|
41
|
+
};
|
42
|
+
|
43
|
+
export default ColorBarSelector;
|
@@ -0,0 +1,102 @@
|
|
1
|
+
@import '../../../assets/styles/colors';
|
2
|
+
@import '../../../assets/styles/fonts';
|
3
|
+
|
4
|
+
.context-menu {
|
5
|
+
position: absolute;
|
6
|
+
z-index: 1;
|
7
|
+
outline: none;
|
8
|
+
background-color: var(--brand-color);
|
9
|
+
// box-shadow: 0px 0px 6px $shadow;
|
10
|
+
border-radius: 5px;
|
11
|
+
opacity: 1;
|
12
|
+
padding: 16px 0;
|
13
|
+
.menu-options {
|
14
|
+
overflow: auto;
|
15
|
+
min-height: 20px;
|
16
|
+
max-height: 175px;
|
17
|
+
min-width: 250px;
|
18
|
+
opacity: 1;
|
19
|
+
.options {
|
20
|
+
cursor: pointer;
|
21
|
+
display: flex;
|
22
|
+
align-items: center;
|
23
|
+
padding: 0 8px;
|
24
|
+
line-height: 35px;
|
25
|
+
gap: 16px;
|
26
|
+
.sheet-context-menu {
|
27
|
+
display: flex;
|
28
|
+
align-items: center;
|
29
|
+
justify-content: center;
|
30
|
+
}
|
31
|
+
&:hover {
|
32
|
+
// background-color: $primary;
|
33
|
+
.options-label {
|
34
|
+
background: var(--option-card-bg-color);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
.ff-icon-label {
|
42
|
+
display: flex;
|
43
|
+
align-items: center;
|
44
|
+
gap: 4px;
|
45
|
+
.ff-menuicon-container {
|
46
|
+
display: flex;
|
47
|
+
justify-content: center;
|
48
|
+
align-items: center;
|
49
|
+
cursor: pointer;
|
50
|
+
&:hover {
|
51
|
+
background-color: var(--brand-color);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
.ff-menuicon-container-clicked {
|
56
|
+
display: flex;
|
57
|
+
justify-content: center;
|
58
|
+
align-items: center;
|
59
|
+
background-color: var(--brand-color);
|
60
|
+
cursor: pointer;
|
61
|
+
&:hover {
|
62
|
+
background-color: var(--brand-color);
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
.ff-option-card {
|
68
|
+
position: absolute;
|
69
|
+
border: 1px solid var(--option-card-border-color);
|
70
|
+
background: var(--option-card-bg-color);
|
71
|
+
border-radius: 4px;
|
72
|
+
margin: 2px;
|
73
|
+
min-height: 32px;
|
74
|
+
min-width: 111px;
|
75
|
+
z-index: 100000;
|
76
|
+
white-space: nowrap;
|
77
|
+
|
78
|
+
.ff-options {
|
79
|
+
@extend .fontSm;
|
80
|
+
cursor: pointer;
|
81
|
+
border-radius: 4px;
|
82
|
+
display: flex;
|
83
|
+
align-items: center;
|
84
|
+
padding: 8px;
|
85
|
+
line-height: 16px;
|
86
|
+
gap: 8px;
|
87
|
+
&:hover {
|
88
|
+
background-color: var(--hover-color);
|
89
|
+
}
|
90
|
+
label {
|
91
|
+
cursor: pointer;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
.ff-disable-option {
|
96
|
+
opacity: 0.5;
|
97
|
+
cursor: no-drop;
|
98
|
+
label {
|
99
|
+
cursor: no-drop;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|