pixel-react-excel-sheet 1.0.30 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Charts/BarChart/BarChart.d.ts +1 -0
- package/lib/components/MenuOption/types.d.ts +1 -1
- package/lib/components/PopUpModal/types.d.ts +2 -1
- package/lib/components/StatusCard/types.d.ts +7 -1
- package/lib/index.d.ts +11 -3
- package/lib/index.esm.js +70 -38
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +70 -38
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Charts/BarChart/BarChart.stories.tsx +3 -0
- package/src/components/Charts/BarChart/BarChart.tsx +7 -0
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.scss +4 -0
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +1 -1
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +35 -27
- package/src/components/MenuOption/MenuOption.stories.tsx +2 -3
- package/src/components/MenuOption/MenuOption.tsx +9 -2
- package/src/components/MenuOption/types.ts +1 -1
- package/src/components/PopUpModal/types.ts +4 -3
- package/src/components/Search/Search.stories.tsx +1 -2
- package/src/components/Search/Search.tsx +1 -3
- package/src/components/StatusCard/StatusCard.scss +47 -4
- package/src/components/StatusCard/StatusCard.stories.tsx +1 -0
- package/src/components/StatusCard/StatusCard.tsx +28 -5
- package/src/components/StatusCard/types.ts +15 -10
- package/src/components/Toastify/Toastify.tsx +1 -0
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ type BarChartProps = {
|
|
|
22
22
|
backgroundColor?: string;
|
|
23
23
|
legendPosition?: 'top' | 'bottom';
|
|
24
24
|
legendGap?: number;
|
|
25
|
+
onSelectedBar?: (_label: string) => void;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
const BarChart: React.FC<BarChartProps> = ({
|
|
@@ -41,6 +42,7 @@ const BarChart: React.FC<BarChartProps> = ({
|
|
|
41
42
|
iconSize,
|
|
42
43
|
legendPosition = 'bottom',
|
|
43
44
|
legendGap = 5,
|
|
45
|
+
onSelectedBar = (_label) => {},
|
|
44
46
|
}) => {
|
|
45
47
|
const [tooltip, setTooltip] = useState<{
|
|
46
48
|
visible: boolean;
|
|
@@ -120,6 +122,10 @@ const BarChart: React.FC<BarChartProps> = ({
|
|
|
120
122
|
});
|
|
121
123
|
};
|
|
122
124
|
|
|
125
|
+
const handleSelectLabel = (label: string) => {
|
|
126
|
+
onSelectedBar(label);
|
|
127
|
+
};
|
|
128
|
+
|
|
123
129
|
return (
|
|
124
130
|
<div className="ff-bar-chart-container" style={{ width: chartWidth }}>
|
|
125
131
|
{legend && legendPosition === 'top' && (
|
|
@@ -232,6 +238,7 @@ const BarChart: React.FC<BarChartProps> = ({
|
|
|
232
238
|
}
|
|
233
239
|
onMouseMove={handleMouseMove}
|
|
234
240
|
onMouseLeave={handleMouseLeave}
|
|
241
|
+
onClick={() => handleSelectLabel(item.label)}
|
|
235
242
|
></rect>
|
|
236
243
|
|
|
237
244
|
{showXAxisLabels && (
|
|
@@ -314,7 +314,7 @@ const DashboardDonutChart: React.FC<DashboardDonutChartProps> = ({
|
|
|
314
314
|
return (
|
|
315
315
|
<div className="ff-legend-table-wrapper">
|
|
316
316
|
<table className="ff-legend-table">
|
|
317
|
-
<thead>
|
|
317
|
+
<thead className='ff-legend-table-thead'>
|
|
318
318
|
<tr>
|
|
319
319
|
<th className="ff-table-header" style={{ width: tableWidth }}>
|
|
320
320
|
Name
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import './ExcelToolBar.scss';
|
|
3
3
|
import MenuOption from '../../MenuOption';
|
|
4
4
|
import Tooltip from '../../Tooltip';
|
|
@@ -69,6 +69,8 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
const [cellStyle, setCellStyle] = useState(cell?.style || basicStyle);
|
|
72
|
+
const underLineMenuRef = useRef<HTMLSpanElement>(null);
|
|
73
|
+
const borderMenuRef = useRef<HTMLSpanElement>(null);
|
|
72
74
|
|
|
73
75
|
useEffect(() => {
|
|
74
76
|
setCellStyle(cell?.style || basicStyle);
|
|
@@ -315,19 +317,22 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
315
317
|
onClick={() => setUnderlineType(data, underLine, true)}
|
|
316
318
|
name={getUnderlineIcon()}
|
|
317
319
|
/>
|
|
318
|
-
<
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
320
|
+
<span ref={underLineMenuRef}>
|
|
321
|
+
<MenuOption
|
|
322
|
+
targetRef={underLineMenuRef}
|
|
323
|
+
iconName="arrow_down"
|
|
324
|
+
zIndex={1000}
|
|
325
|
+
iconSize={12}
|
|
326
|
+
options={underlineTypeIcon}
|
|
327
|
+
tooltipPlacement="top"
|
|
328
|
+
variant="light"
|
|
329
|
+
onOptionClick={(e) => {
|
|
330
|
+
let selectedValue = e.value as string;
|
|
331
|
+
setUnderlineType(data, selectedValue, true);
|
|
332
|
+
setUnderLine(selectedValue);
|
|
333
|
+
}}
|
|
334
|
+
/>
|
|
335
|
+
</span>
|
|
331
336
|
</div>
|
|
332
337
|
</Tooltip>
|
|
333
338
|
</div>
|
|
@@ -391,19 +396,22 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
|
|
|
391
396
|
onClick={() => setBorderType(data, border, 'black')}
|
|
392
397
|
name={getBorderIcon()}
|
|
393
398
|
/>
|
|
394
|
-
<
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
399
|
+
<span ref={borderMenuRef}>
|
|
400
|
+
<MenuOption
|
|
401
|
+
iconName="arrow_down"
|
|
402
|
+
targetRef={borderMenuRef}
|
|
403
|
+
iconSize={12}
|
|
404
|
+
zIndex={1000}
|
|
405
|
+
options={borderTypeIcon}
|
|
406
|
+
tooltipPlacement="top"
|
|
407
|
+
variant="light"
|
|
408
|
+
onOptionClick={(e) => {
|
|
409
|
+
let selectedValue = e.value as string;
|
|
410
|
+
setBorderType(data, selectedValue, 'black');
|
|
411
|
+
setBorder(selectedValue);
|
|
412
|
+
}}
|
|
413
|
+
/>
|
|
414
|
+
</span>
|
|
407
415
|
</div>
|
|
408
416
|
</Tooltip>
|
|
409
417
|
</div>
|
|
@@ -135,13 +135,12 @@ export const MenuOptionBottom: Story = {
|
|
|
135
135
|
dropdownPlacement: 'down',
|
|
136
136
|
},
|
|
137
137
|
render: (args) => {
|
|
138
|
-
const moreRef = useRef<HTMLDivElement>(null);
|
|
139
138
|
return (
|
|
140
|
-
<div
|
|
139
|
+
<div id="more">
|
|
141
140
|
<MenuOption
|
|
142
141
|
{...args}
|
|
143
142
|
options={options}
|
|
144
|
-
targetRef={
|
|
143
|
+
targetRef={'more'}
|
|
145
144
|
onOptionClick={handleOptionClick}
|
|
146
145
|
/>
|
|
147
146
|
</div>
|
|
@@ -153,9 +153,15 @@ const MenuOption = ({
|
|
|
153
153
|
};
|
|
154
154
|
|
|
155
155
|
const calculateDims = () => {
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
let targetElement: HTMLElement | null = null;
|
|
157
|
+
if (typeof targetRef === 'string') {
|
|
158
|
+
targetElement = document.getElementById(targetRef);
|
|
159
|
+
} else if (targetRef && targetRef.current) {
|
|
160
|
+
targetElement = targetRef.current;
|
|
161
|
+
}
|
|
158
162
|
|
|
163
|
+
if (targetElement) {
|
|
164
|
+
const rect = targetElement.getBoundingClientRect();
|
|
159
165
|
setMenuPosition({
|
|
160
166
|
top: rect.top + window.scrollY,
|
|
161
167
|
left: rect.left + window.scrollX,
|
|
@@ -164,6 +170,7 @@ const MenuOption = ({
|
|
|
164
170
|
});
|
|
165
171
|
}
|
|
166
172
|
};
|
|
173
|
+
|
|
167
174
|
return (
|
|
168
175
|
<div className="ff-menu-option-container" ref={menuRef}>
|
|
169
176
|
<Tooltip title={tooltipTitle} placement={tooltipPlacement}>
|
|
@@ -5,12 +5,13 @@ export interface PopUpModalProps {
|
|
|
5
5
|
titleMessage: string;
|
|
6
6
|
subTitleMessage?: string;
|
|
7
7
|
iconName: string;
|
|
8
|
-
modalMessage: string;
|
|
8
|
+
modalMessage: string | React.ReactNode;
|
|
9
|
+
secondaryMessage?: string | React.ReactNode;
|
|
9
10
|
firstButtonLabel?: string;
|
|
10
11
|
secondButtonLabel: string;
|
|
11
12
|
buttonVariant: any;
|
|
12
13
|
border: string;
|
|
13
|
-
|
|
14
|
+
popupWidth?: string;
|
|
14
15
|
colorForTitleMessage?: string;
|
|
15
|
-
footerContent?:React.ReactNode;
|
|
16
|
+
footerContent?: React.ReactNode;
|
|
16
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import Search from './Search';
|
|
3
|
-
import React,{ useState } from 'react';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
4
|
const meta: Meta<typeof Search> = {
|
|
5
5
|
title: 'Components/Search',
|
|
6
6
|
component: Search,
|
|
@@ -17,7 +17,6 @@ export const Default: Story = {
|
|
|
17
17
|
const [searchValue, setSearchValue] = useState('');
|
|
18
18
|
|
|
19
19
|
const handleSearch = (value: string) => {
|
|
20
|
-
alert(`Searching for: ${value}`);
|
|
21
20
|
setSearchValue(value);
|
|
22
21
|
};
|
|
23
22
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.ff-card-container {
|
|
2
|
-
|
|
3
|
-
height: 93px;
|
|
2
|
+
height: 78px;
|
|
4
3
|
display: flex;
|
|
5
4
|
align-items: center;
|
|
6
5
|
border: 1px solid var(--border-color);
|
|
@@ -31,14 +30,14 @@
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
.ff-status-bar {
|
|
34
|
-
width:
|
|
33
|
+
width: 12%;
|
|
35
34
|
height: 100%;
|
|
36
35
|
display: flex;
|
|
37
36
|
flex-direction: column;
|
|
38
37
|
justify-content: start;
|
|
39
38
|
align-items: center;
|
|
40
39
|
border-right: 1px solid var(--border-color);
|
|
41
|
-
gap:
|
|
40
|
+
gap: 17px;
|
|
42
41
|
|
|
43
42
|
.ff-status-text {
|
|
44
43
|
transform: rotate(-90deg);
|
|
@@ -49,18 +48,23 @@
|
|
|
49
48
|
|
|
50
49
|
&.passed .ff-status-bar {
|
|
51
50
|
background-color: var(--ff-card-passed-status-bg-color);
|
|
51
|
+
color: var(--base-bg-color);
|
|
52
52
|
}
|
|
53
53
|
&.failed .ff-status-bar {
|
|
54
54
|
background-color: var(--ff-card-failed-status-bg-color);
|
|
55
|
+
color: var(--base-bg-color);
|
|
55
56
|
}
|
|
56
57
|
&.warning .ff-status-bar {
|
|
57
58
|
background-color: var(--ff-card-warning-status-bg-color);
|
|
59
|
+
color: var(--base-bg-color);
|
|
58
60
|
}
|
|
59
61
|
&.skipped .ff-status-bar {
|
|
60
62
|
background-color: var(--ff-card-skipped-status-bg-color);
|
|
63
|
+
color: var(--base-bg-color);
|
|
61
64
|
}
|
|
62
65
|
&.flaky .ff-status-bar {
|
|
63
66
|
background-color: var(--ff-card-flaky-status-bg-color);
|
|
67
|
+
color: var(--base-bg-color);
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
.ff-content {
|
|
@@ -91,4 +95,43 @@
|
|
|
91
95
|
&.flaky .ff-number {
|
|
92
96
|
color: var(--ff-card-flaky-status-bg-color);
|
|
93
97
|
}
|
|
98
|
+
|
|
99
|
+
&.toggled {
|
|
100
|
+
&.passed .ff-status-bar {
|
|
101
|
+
background-color: var(--base-bg-color);
|
|
102
|
+
color: var(--ff-card-passed-status-bg-color);
|
|
103
|
+
}
|
|
104
|
+
&.failed .ff-status-bar {
|
|
105
|
+
background-color: var(--base-bg-color);
|
|
106
|
+
color: var(--ff-card-failed-status-bg-color);
|
|
107
|
+
}
|
|
108
|
+
&.warning .ff-status-bar {
|
|
109
|
+
background-color: var(--base-bg-color);
|
|
110
|
+
color: var(--ff-card-warning-status-bg-color);
|
|
111
|
+
}
|
|
112
|
+
&.skipped .ff-status-bar {
|
|
113
|
+
background-color: var(--base-bg-color);
|
|
114
|
+
color: var(--ff-card-skipped-status-bg-color);
|
|
115
|
+
}
|
|
116
|
+
&.flaky .ff-status-bar {
|
|
117
|
+
background-color: var(--base-bg-color);
|
|
118
|
+
color: var(--ff-card-flaky-status-bg-color);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&.passed .ff-content {
|
|
122
|
+
background-color: var(--ff-card-passed-status-bg-color);
|
|
123
|
+
}
|
|
124
|
+
&.failed .ff-content {
|
|
125
|
+
background-color: var(--ff-card-failed-status-bg-color);
|
|
126
|
+
}
|
|
127
|
+
&.warning .ff-content {
|
|
128
|
+
background-color: var(--ff-card-warning-status-bg-color);
|
|
129
|
+
}
|
|
130
|
+
&.skipped .ff-content {
|
|
131
|
+
background-color: var(--ff-card-skipped-status-bg-color);
|
|
132
|
+
}
|
|
133
|
+
&.flaky .ff-content {
|
|
134
|
+
background-color: var(--ff-card-flaky-status-bg-color);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
94
137
|
}
|
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import './StatusCard.scss';
|
|
3
3
|
import { CardProps } from './types';
|
|
4
4
|
import Typography from '../Typography';
|
|
5
5
|
import Icon from '../Icon';
|
|
6
6
|
|
|
7
|
-
const StatusCard: React.FC<CardProps> = ({
|
|
7
|
+
const StatusCard: React.FC<CardProps> = ({
|
|
8
|
+
icon,
|
|
9
|
+
status,
|
|
10
|
+
count,
|
|
11
|
+
text,
|
|
12
|
+
style = { width: '196.4px' },
|
|
13
|
+
onSelectedStatus = (_status) => {},
|
|
14
|
+
}) => {
|
|
15
|
+
const [isToggled, setIsToggled] = useState<boolean>(false);
|
|
16
|
+
|
|
17
|
+
const handleSelectStatus = (status: string) => {
|
|
18
|
+
setIsToggled(true);
|
|
19
|
+
onSelectedStatus(status);
|
|
20
|
+
};
|
|
8
21
|
return (
|
|
9
|
-
<div
|
|
22
|
+
<div
|
|
23
|
+
className={`ff-card-container ${status.toLowerCase()} ${
|
|
24
|
+
isToggled ? 'toggled' : ''
|
|
25
|
+
}`}
|
|
26
|
+
style={style}
|
|
27
|
+
onClick={() => handleSelectStatus(status)}
|
|
28
|
+
>
|
|
10
29
|
<div className="ff-status-bar">
|
|
11
30
|
<div>
|
|
12
31
|
<Icon name={icon} height={20} width={20} hoverEffect={false} />
|
|
@@ -14,7 +33,6 @@ const StatusCard: React.FC<CardProps> = ({ icon, status, count, text }) => {
|
|
|
14
33
|
<Typography
|
|
15
34
|
fontWeight="semi-bold"
|
|
16
35
|
fontSize="10px"
|
|
17
|
-
color="var(--ff-status-card-text-color)"
|
|
18
36
|
textAlign="center"
|
|
19
37
|
lineHeight="15px"
|
|
20
38
|
className="ff-status-text"
|
|
@@ -29,6 +47,7 @@ const StatusCard: React.FC<CardProps> = ({ icon, status, count, text }) => {
|
|
|
29
47
|
fontSize="24px"
|
|
30
48
|
className="ff-number"
|
|
31
49
|
lineHeight="36px"
|
|
50
|
+
color={isToggled ? 'var(--base-bg-color)' : ''}
|
|
32
51
|
>
|
|
33
52
|
{count}
|
|
34
53
|
</Typography>
|
|
@@ -37,7 +56,11 @@ const StatusCard: React.FC<CardProps> = ({ icon, status, count, text }) => {
|
|
|
37
56
|
fontSize="10px"
|
|
38
57
|
className="ff-text"
|
|
39
58
|
lineHeight="15px"
|
|
40
|
-
color=
|
|
59
|
+
color={
|
|
60
|
+
isToggled
|
|
61
|
+
? 'var(--base-bg-color)'
|
|
62
|
+
: 'var(--ff-card-status-text-color)'
|
|
63
|
+
}
|
|
41
64
|
>
|
|
42
65
|
{text}
|
|
43
66
|
</Typography>
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export interface CardProps {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
/** The icon to display in the card */
|
|
3
|
+
icon: string;
|
|
4
|
+
/** The status of the card (Passed, Failed, Warning, Skipped, Flaky) */
|
|
5
|
+
status: 'Passed' | 'Failed' | 'Warning' | 'Skipped' | 'Flaky' | 'PASSED' | 'FAIL' | 'WARNING' | 'SKIPPED' | 'FLAKY';
|
|
6
|
+
/** The number displayed in the card */
|
|
7
|
+
count: number | string;
|
|
8
|
+
/** The description text displayed at the bottom of the card */
|
|
9
|
+
text: string;
|
|
10
|
+
/** Inline Styling */
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
/** toggle update */
|
|
13
|
+
handleToggleStatus?: (_status: boolean) => void;
|
|
14
|
+
/** call back */
|
|
15
|
+
onSelectedStatus?: (_status: string) => void;
|
|
16
|
+
}
|