pixel-react-excel-sheet 1.0.38 → 1.0.40
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/Button/Button.d.ts +2 -2
- package/lib/components/Charts/DashboardDonutChart/types.d.ts +3 -0
- package/lib/components/Charts/LineChart/types.d.ts +1 -0
- package/lib/components/ChooseFile/ChooseFile.d.ts +3 -2
- package/lib/components/Comment/Comments.d.ts +1 -1
- package/lib/components/Comment/type.d.ts +3 -3
- package/lib/components/ConditionalDropdown/types.d.ts +4 -0
- package/lib/components/DatePicker/types.d.ts +2 -0
- package/lib/components/Drawer/Types.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFile.d.ts +11 -10
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.d.ts +10 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.d.ts +1 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +9 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +0 -3
- package/lib/components/Excel/Types.d.ts +15 -11
- package/lib/components/FF_Captcha/Recaptcha.d.ts +2 -1
- package/lib/components/FF_Captcha/types.d.ts +11 -2
- package/lib/components/Input/types.d.ts +4 -0
- package/lib/components/LabelEditTextField/types.d.ts +2 -0
- package/lib/components/MobileSkin/MobileSkin.d.ts +5 -0
- package/lib/components/MobileSkin/MobileSkinInterface.d.ts +13 -0
- package/lib/components/MobileSkin/index.d.ts +1 -0
- package/lib/components/MobileSkin/types.d.ts +32 -0
- package/lib/components/Search/Search.d.ts +1 -1
- package/lib/components/Search/types.d.ts +1 -0
- package/lib/components/Select/components/types.d.ts +3 -2
- package/lib/components/Select/types.d.ts +10 -2
- package/lib/components/SequentialConnectingBranch/components/Branches/Branches.d.ts +1 -1
- package/lib/components/SequentialConnectingBranch/components/Branches/types.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.d.ts +1 -1
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/types.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/types.d.ts +1 -0
- package/lib/components/TableTree/types.d.ts +4 -4
- package/lib/components/Tabs/types.d.ts +1 -0
- package/lib/index.d.ts +96 -40
- package/lib/index.esm.js +4816 -1669
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +4829 -1669
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/formData/ConvertFormDataToObject.d.ts +1 -0
- package/lib/utils/keyBoardActionUtil/UseKeyboardActions.d.ts +2 -0
- package/lib/utils/keyBoardActionUtil/types.d.ts +4 -0
- package/lib/validations/regex.d.ts +11 -1
- package/package.json +6 -1
- package/src/assets/Themes/BaseTheme.scss +3 -1
- package/src/assets/Themes/DarkTheme.scss +10 -1
- package/src/assets/icons/clear_cache.svg +5 -0
- package/src/assets/icons/external_user.svg +13 -0
- package/src/assets/icons/group_user.svg +12 -0
- package/src/assets/icons/single_user.svg +12 -0
- package/src/assets/icons/test_freshers_logo.svg +8 -0
- package/src/assets/icons/unfollow_icon.svg +3 -0
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +7 -45
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +5 -0
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +76 -64
- package/src/components/Button/Button.scss +0 -1
- package/src/components/Button/Button.tsx +3 -4
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +38 -6
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +10 -4
- package/src/components/Charts/DashboardDonutChart/types.ts +4 -1
- package/src/components/Charts/LineChart/LineChart.stories.tsx +27 -88
- package/src/components/Charts/LineChart/LineChart.tsx +138 -42
- package/src/components/Charts/LineChart/types.ts +1 -0
- package/src/components/Charts/MultiRadialChart/MultiRadialChart.scss +3 -3
- package/src/components/Charts/MultiRadialChart/MultiRadialChart.tsx +47 -43
- package/src/components/ChooseFile/ChooseFile.tsx +3 -4
- package/src/components/Comment/Comments.scss +0 -1
- package/src/components/Comment/Comments.stories.tsx +22 -4
- package/src/components/Comment/Comments.tsx +20 -1
- package/src/components/Comment/type.ts +3 -3
- package/src/components/ConditionalDropdown/ConditionalDropdown.stories.tsx +1 -0
- package/src/components/ConditionalDropdown/ConditionalDropdown.tsx +2 -1
- package/src/components/ConditionalDropdown/types.ts +4 -0
- package/src/components/DatePicker/DatePicker.scss +307 -2
- package/src/components/DatePicker/DatePicker.tsx +27 -19
- package/src/components/DatePicker/types.ts +4 -0
- package/src/components/Drawer/Drawer.stories.tsx +1 -1
- package/src/components/Drawer/Types.ts +4 -2
- package/src/components/Editor/Editor.scss +23 -18
- package/src/components/Editor/Editor.tsx +2 -2
- package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.tsx +6 -3
- package/src/components/Excel/ExcelFile/ExcelFile.scss +45 -41
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +70 -64
- package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +29 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +1 -37
- package/src/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.tsx +1 -40
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +3 -3
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +14 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +3 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +8 -74
- package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +0 -5
- package/src/components/Excel/ExcelFile.stories.tsx +116 -125
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +10 -11
- package/src/components/Excel/Types.ts +18 -16
- package/src/components/FF_Captcha/Recaptcha.tsx +19 -9
- package/src/components/FF_Captcha/types.ts +12 -4
- package/src/components/Icon/Icon.stories.tsx +56 -8
- package/src/components/Icon/iconList.ts +13 -1
- package/src/components/Input/Input.stories.tsx +12 -0
- package/src/components/Input/Input.tsx +3 -1
- package/src/components/Input/types.ts +4 -0
- package/src/components/InputWithDropdown/types.ts +1 -1
- package/src/components/LabelEditTextField/LabelEditTextField.scss +4 -0
- package/src/components/LabelEditTextField/LabelEditTextField.stories.tsx +2 -1
- package/src/components/LabelEditTextField/LabelEditTextField.tsx +14 -10
- package/src/components/LabelEditTextField/types.ts +2 -0
- package/src/components/LazyLoad/LazyLoad.stories.tsx +1 -0
- package/src/components/LazyLoad/LazyLoading.tsx +10 -1
- package/src/components/MachineInputField/MachineInputField.scss +5 -1
- package/src/components/MachineInputField/MachineInputField.tsx +1 -0
- package/src/components/MobileSkin/MobileSkin.scss +67 -0
- package/src/components/MobileSkin/MobileSkin.stories.tsx +93 -0
- package/src/components/MobileSkin/MobileSkin.tsx +89 -0
- package/src/components/MobileSkin/MobileSkinInterface.ts +13 -0
- package/src/components/MobileSkin/index.ts +1 -0
- package/src/components/MobileSkin/types.ts +32 -0
- package/src/components/Modal/Modal.stories.tsx +7 -0
- package/src/components/Modal/Modal.tsx +17 -20
- package/src/components/Search/Search.scss +8 -0
- package/src/components/Search/Search.tsx +17 -6
- package/src/components/Search/types.ts +1 -0
- package/src/components/Select/Select.stories.tsx +85 -0
- package/src/components/Select/Select.tsx +10 -2
- package/src/components/Select/components/Dropdown.tsx +23 -15
- package/src/components/Select/components/types.ts +3 -2
- package/src/components/Select/types.ts +12 -2
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.tsx +2 -0
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +65 -57
- package/src/components/SequentialConnectingBranch/components/Branches/types.ts +1 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.tsx +2 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/types.ts +1 -0
- package/src/components/SequentialConnectingBranch/types.ts +5 -1
- package/src/components/TableTree/Components/TableCell.tsx +3 -3
- package/src/components/TableTree/TableTree.scss +0 -7
- package/src/components/TableTree/TableTree.tsx +3 -22
- package/src/components/TableTree/types.ts +4 -4
- package/src/components/Tabs/Tabs.scss +19 -0
- package/src/components/Tabs/Tabs.tsx +9 -0
- package/src/components/Tabs/types.ts +1 -0
- package/src/index.ts +27 -0
- package/src/utils/formData/ConvertFormDataToObject.stories.tsx +27 -0
- package/src/utils/formData/ConvertFormDataToObject.ts +14 -0
- package/src/utils/getExtension/getExtension.stories.tsx +1 -0
- package/src/utils/keyBoardActionUtil/UseKeyboardAction.stories.tsx +53 -0
- package/src/utils/keyBoardActionUtil/UseKeyboardActions.tsx +20 -0
- package/src/utils/keyBoardActionUtil/types.ts +4 -0
- package/src/validations/regex.stories.tsx +63 -0
- package/src/validations/regex.ts +34 -0
- package/src/assets/images/photo.png +0 -0
|
@@ -2,8 +2,6 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { MultiRadialChartProps, ChartItem, LegendType } from './types';
|
|
3
3
|
import './MultiRadialChart.scss';
|
|
4
4
|
import Typography from '../../Typography';
|
|
5
|
-
import { truncateText } from '../../../utils/truncateText/truncateText';
|
|
6
|
-
|
|
7
5
|
const calculateArc = (
|
|
8
6
|
centerX: number,
|
|
9
7
|
centerY: number,
|
|
@@ -16,10 +14,7 @@ const calculateArc = (
|
|
|
16
14
|
const endX = centerX + radius * Math.cos(endAngle);
|
|
17
15
|
const endY = centerY + radius * Math.sin(endAngle);
|
|
18
16
|
const largeArcFlag = endAngle - startAngle > Math.PI ? 1 : 0;
|
|
19
|
-
return `
|
|
20
|
-
M ${startX} ${startY}
|
|
21
|
-
A ${radius} ${radius} 0 ${largeArcFlag} 1 ${endX} ${endY}
|
|
22
|
-
`;
|
|
17
|
+
return `M ${startX} ${startY} A ${radius} ${radius} 0 ${largeArcFlag} 1 ${endX} ${endY}`;
|
|
23
18
|
};
|
|
24
19
|
|
|
25
20
|
const MultiRadialChart: React.FC<MultiRadialChartProps> = ({
|
|
@@ -86,7 +81,7 @@ const MultiRadialChart: React.FC<MultiRadialChartProps> = ({
|
|
|
86
81
|
|
|
87
82
|
case 'pillLegend':
|
|
88
83
|
return (
|
|
89
|
-
<div className=
|
|
84
|
+
<div className="ff-legend-container ff-pill-legend">
|
|
90
85
|
{legendData.reverse().map((item, index) => (
|
|
91
86
|
<div className="ff-legend-item" key={index}>
|
|
92
87
|
<span
|
|
@@ -95,12 +90,9 @@ const MultiRadialChart: React.FC<MultiRadialChartProps> = ({
|
|
|
95
90
|
backgroundColor: item.arcColor,
|
|
96
91
|
}}
|
|
97
92
|
>
|
|
98
|
-
<Typography fontSize={10}>{item.value}</Typography>
|
|
93
|
+
<Typography fontSize={10} color="var(--tooltip-text-color)">{item.value}</Typography>
|
|
99
94
|
</span>
|
|
100
|
-
<Typography
|
|
101
|
-
className="ff-legend-key"
|
|
102
|
-
color=" var(--text-color)"
|
|
103
|
-
>
|
|
95
|
+
<Typography className="ff-legend-key">
|
|
104
96
|
{item.label}
|
|
105
97
|
</Typography>
|
|
106
98
|
</div>
|
|
@@ -139,12 +131,16 @@ const MultiRadialChart: React.FC<MultiRadialChartProps> = ({
|
|
|
139
131
|
const textData = (text: string, maxLength: number) => {
|
|
140
132
|
return text.length > maxLength ? text.slice(0, maxLength) + '...' : text;
|
|
141
133
|
};
|
|
134
|
+
|
|
142
135
|
const getArcColorFromTooltip = () => {
|
|
143
136
|
if (!tooltip.visible) return '';
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
|
|
137
|
+
const valueString = tooltip.content.split(':')[1]?.trim();
|
|
138
|
+
const value = valueString ? Number(valueString) : undefined;
|
|
139
|
+
if (value === undefined) return '';
|
|
140
|
+
const matchingBar = barValues.find((val) => val.value === value);
|
|
141
|
+
return matchingBar?.arcColor || '';
|
|
147
142
|
};
|
|
143
|
+
|
|
148
144
|
return (
|
|
149
145
|
<div
|
|
150
146
|
className={`ff-multi-radial-chart-container ${
|
|
@@ -154,40 +150,51 @@ const MultiRadialChart: React.FC<MultiRadialChartProps> = ({
|
|
|
154
150
|
}`}
|
|
155
151
|
>
|
|
156
152
|
<div className="relative" style={{ width: svgSize, height: svgSize }}>
|
|
157
|
-
<svg
|
|
158
|
-
width={svgSize}
|
|
159
|
-
height={svgSize}
|
|
160
|
-
viewBox={`0 0 ${svgSize} ${svgSize}`}
|
|
161
|
-
className="absolute top-0 left-0"
|
|
162
|
-
>
|
|
153
|
+
<svg width={svgSize} height={svgSize} viewBox={`0 0 ${svgSize} ${svgSize}`} className="absolute top-0 left-0">
|
|
163
154
|
<g transform={`translate(${svgSize / 2}, ${svgSize / 2})`}>
|
|
164
155
|
{reversedBarValues.map((values, i) => {
|
|
165
156
|
const originalIndex = barValues.length - 1 - i;
|
|
166
157
|
const percentage = values.value / totalBarValue;
|
|
167
158
|
const angleIncrement = percentage * 2 * Math.PI;
|
|
168
|
-
let startAngle = -Math.PI / 2;
|
|
159
|
+
let startAngle = -Math.PI / 2;
|
|
169
160
|
let endAngle = startAngle + angleIncrement;
|
|
170
161
|
if (values.value === totalBarValue) {
|
|
171
162
|
startAngle = 0;
|
|
172
163
|
endAngle = 2 * Math.PI;
|
|
173
164
|
}
|
|
174
|
-
const currentRadius =
|
|
175
|
-
baseRadius + radiusIncrement * originalIndex;
|
|
176
|
-
const backGroundArcPath = calculateArc(
|
|
177
|
-
0,
|
|
178
|
-
0,
|
|
179
|
-
currentRadius,
|
|
180
|
-
0,
|
|
181
|
-
2 * Math.PI
|
|
182
|
-
);
|
|
165
|
+
const currentRadius = baseRadius + radiusIncrement * originalIndex;
|
|
183
166
|
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
167
|
+
const backGroundArcPath = calculateArc(0, 0, currentRadius, 0, 2 * Math.PI);
|
|
168
|
+
|
|
169
|
+
// If value is 0, render a dot at the top of the circle (angle = -Math.PI / 2)
|
|
170
|
+
if (values.value === 0) {
|
|
171
|
+
const dotX = currentRadius * Math.cos(-Math.PI / 2);
|
|
172
|
+
const dotY = currentRadius * Math.sin(-Math.PI / 2);
|
|
173
|
+
return (
|
|
174
|
+
<g key={originalIndex}>
|
|
175
|
+
<path
|
|
176
|
+
d={backGroundArcPath}
|
|
177
|
+
fill="none"
|
|
178
|
+
stroke={values.arcBackgroundColor}
|
|
179
|
+
strokeWidth={lineWidth}
|
|
180
|
+
className="transition-all duration-300"
|
|
181
|
+
/>
|
|
182
|
+
<circle
|
|
183
|
+
cx={dotX}
|
|
184
|
+
cy={dotY}
|
|
185
|
+
r={5}
|
|
186
|
+
fill={values.arcColor}
|
|
187
|
+
onMouseEnter={(e) =>
|
|
188
|
+
handleMouseEnter(e, `${values.barLabel || 'Data'}: ${values.value}`)
|
|
189
|
+
}
|
|
190
|
+
onMouseMove={handleMouseMove}
|
|
191
|
+
onMouseLeave={handleMouseLeave}
|
|
192
|
+
/>
|
|
193
|
+
</g>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const foregroundArcPath = calculateArc(0, 0, currentRadius, startAngle, endAngle);
|
|
191
198
|
return (
|
|
192
199
|
<g key={originalIndex}>
|
|
193
200
|
<path
|
|
@@ -204,10 +211,7 @@ const MultiRadialChart: React.FC<MultiRadialChartProps> = ({
|
|
|
204
211
|
strokeWidth={lineWidth}
|
|
205
212
|
strokeLinecap={lineCap === 'square' ? 'butt' : 'round'}
|
|
206
213
|
onMouseEnter={(e) =>
|
|
207
|
-
handleMouseEnter(
|
|
208
|
-
e,
|
|
209
|
-
`${values.barLabel || 'Data'}: ${values.value}`
|
|
210
|
-
)
|
|
214
|
+
handleMouseEnter(e, `${values.barLabel || 'Data'}: ${values.value}`)
|
|
211
215
|
}
|
|
212
216
|
onMouseMove={handleMouseMove}
|
|
213
217
|
onMouseLeave={handleMouseLeave}
|
|
@@ -294,7 +298,7 @@ const MultiRadialChart: React.FC<MultiRadialChartProps> = ({
|
|
|
294
298
|
renderLegend(
|
|
295
299
|
barValues.map((value) => ({
|
|
296
300
|
...value,
|
|
297
|
-
label:
|
|
301
|
+
label:value?.barLabel,
|
|
298
302
|
key: value.value.toString(),
|
|
299
303
|
})),
|
|
300
304
|
legendType
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type FC } from 'react'
|
|
2
2
|
import { ChooseFileProps } from './types'
|
|
3
3
|
import Button from '../Button'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
prevProps.selectedFile?.name === nextProps.selectedFile?.name;
|
|
5
|
+
|
|
7
6
|
|
|
8
7
|
const ChooseFile:FC<ChooseFileProps> = ({
|
|
9
8
|
variant = 'primary',
|
|
@@ -43,4 +42,4 @@ const ChooseFile:FC<ChooseFileProps> = ({
|
|
|
43
42
|
)
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
export default
|
|
45
|
+
export default ChooseFile;
|
|
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import Comments from './Comments';
|
|
3
3
|
import '../../assets/styles/_colors.scss';
|
|
4
4
|
import './Comments.scss';
|
|
5
|
+
import { CommentType } from './type';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
8
|
const meta: Meta<typeof Comments> = {
|
|
@@ -37,9 +38,26 @@ export const basicCommentWithOutData: Story = {
|
|
|
37
38
|
export const basicCommentWithData: Story = {
|
|
38
39
|
render: () => {
|
|
39
40
|
const handleCommentsDataChange = (inputValue: string) => {
|
|
40
|
-
//DEMO: we are getting that value from
|
|
41
|
+
//DEMO: we are getting that value from Comment
|
|
41
42
|
console.info('Confirmed input value:', inputValue);
|
|
42
43
|
};
|
|
44
|
+
const handleAddComment = (
|
|
45
|
+
newComment: CommentType,
|
|
46
|
+
parentNode: CommentType | null
|
|
47
|
+
) => {
|
|
48
|
+
console.info('Adding', newComment, parentNode);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const handleEditComment = (
|
|
52
|
+
commentId: string,
|
|
53
|
+
updatedDescription: string,
|
|
54
|
+
updatedNode: CommentType | null
|
|
55
|
+
) => {
|
|
56
|
+
console.info('Updated', commentId, updatedDescription, updatedNode);
|
|
57
|
+
};
|
|
58
|
+
const handleDelete = (id: string | number) => {
|
|
59
|
+
console.info('Delete Comment ID:', id);
|
|
60
|
+
};
|
|
43
61
|
return (
|
|
44
62
|
<Comments
|
|
45
63
|
onCommentsDataChange={handleCommentsDataChange}
|
|
@@ -201,9 +219,9 @@ export const basicCommentWithData: Story = {
|
|
|
201
219
|
},
|
|
202
220
|
],
|
|
203
221
|
}}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
handleDeleteComment={
|
|
222
|
+
handleEditComment={handleEditComment}
|
|
223
|
+
handleAddComment={handleAddComment}
|
|
224
|
+
handleDeleteComment={handleDelete}
|
|
207
225
|
/>
|
|
208
226
|
);
|
|
209
227
|
},
|
|
@@ -10,7 +10,9 @@ const initialComments: CommentType = {
|
|
|
10
10
|
|
|
11
11
|
const Comments = ({
|
|
12
12
|
commentsData,
|
|
13
|
-
|
|
13
|
+
handleAddComment,
|
|
14
|
+
handleEditComment,
|
|
15
|
+
handleDeleteComment,
|
|
14
16
|
onCommentsDataChange,
|
|
15
17
|
}: CommentsProps) => {
|
|
16
18
|
const [commentData, setCommentsData] = useState(
|
|
@@ -21,21 +23,38 @@ const Comments = ({
|
|
|
21
23
|
const handleInsertNode: HandleNodeFunction = (commentId, item) => {
|
|
22
24
|
const updatedTree = insertNode(commentData, commentId, item);
|
|
23
25
|
setCommentsData({ ...updatedTree });
|
|
26
|
+
const updatedNode = findNode(updatedTree, commentId);
|
|
27
|
+
if (handleAddComment) handleAddComment(item, updatedNode);
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
const handleEditNode: HandleNodeFunction = (commentId, value) => {
|
|
27
31
|
const updatedTree = editNode(commentData, commentId, value);
|
|
28
32
|
setCommentsData({ ...updatedTree });
|
|
33
|
+
const updatedNode = findNode(updatedTree, commentId);
|
|
34
|
+
if (handleEditComment) handleEditComment(commentId, value, updatedNode);
|
|
29
35
|
};
|
|
30
36
|
|
|
31
37
|
const handleDeleteNode = (commentId: number) => {
|
|
32
38
|
const updatedTree = deleteNode(commentData, commentId);
|
|
33
39
|
setCommentsData({ ...updatedTree });
|
|
40
|
+
if (handleDeleteComment) handleDeleteComment(commentId);
|
|
34
41
|
};
|
|
35
42
|
useEffect(() => {
|
|
36
43
|
onCommentsDataChange(commentData);
|
|
37
44
|
}, [commentData, onCommentsDataChange]);
|
|
45
|
+
const findNode = (
|
|
46
|
+
node: CommentType,
|
|
47
|
+
id: number | string
|
|
48
|
+
): CommentType | null => {
|
|
49
|
+
if (node.id === id) return node;
|
|
50
|
+
|
|
51
|
+
for (const child of node.comments) {
|
|
52
|
+
const found = findNode(child, id);
|
|
53
|
+
if (found) return found;
|
|
54
|
+
}
|
|
38
55
|
|
|
56
|
+
return null;
|
|
57
|
+
};
|
|
39
58
|
return (
|
|
40
59
|
<div className="ff-comments-container">
|
|
41
60
|
<Comment
|
|
@@ -29,8 +29,8 @@ export type HandleDeleteComment = (commentId: string) => void;
|
|
|
29
29
|
export type HandleNodeFunction = (commentId: string, value: string) => void;
|
|
30
30
|
export interface CommentsProps {
|
|
31
31
|
commentsData: any;
|
|
32
|
-
handleAddComment:
|
|
33
|
-
handleEditComment:
|
|
34
|
-
handleDeleteComment:
|
|
32
|
+
handleAddComment: any;
|
|
33
|
+
handleEditComment: any;
|
|
34
|
+
handleDeleteComment: any;
|
|
35
35
|
onCommentsDataChange: (data: any) => void;
|
|
36
36
|
}
|
|
@@ -30,6 +30,7 @@ const ConditionalDropdown = forwardRef<
|
|
|
30
30
|
dropdownWidth = 'inherit',
|
|
31
31
|
isHash = false,
|
|
32
32
|
dataFiles = [],
|
|
33
|
+
showAddVariableIcon = true,
|
|
33
34
|
...props
|
|
34
35
|
},
|
|
35
36
|
ref
|
|
@@ -122,7 +123,7 @@ const ConditionalDropdown = forwardRef<
|
|
|
122
123
|
label={label}
|
|
123
124
|
placeholder={placeholder}
|
|
124
125
|
/>
|
|
125
|
-
{!checkEmpty(value) && !isHash && showCreateVariableIcon && (
|
|
126
|
+
{!checkEmpty(value) && !isHash && showCreateVariableIcon && showAddVariableIcon && (
|
|
126
127
|
<Icon
|
|
127
128
|
onClick={onCreateVariableClick}
|
|
128
129
|
name="add_variable"
|
|
@@ -130,6 +130,10 @@ export interface ConditionalDropdownProps {
|
|
|
130
130
|
* Options for the dropdown when `isHash` is true.
|
|
131
131
|
*/
|
|
132
132
|
dataFiles?: dynamicObject[];
|
|
133
|
+
/**
|
|
134
|
+
* a boolean prop to show add variable icon or not.
|
|
135
|
+
*/
|
|
136
|
+
showAddVariableIcon?: boolean;
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
export interface OptionsDropdownProps {
|
|
@@ -85,14 +85,13 @@
|
|
|
85
85
|
.ff-date-picker-container {
|
|
86
86
|
display: flex;
|
|
87
87
|
flex-direction: column;
|
|
88
|
-
position:
|
|
88
|
+
position: fixed;
|
|
89
89
|
border-radius: 8px;
|
|
90
90
|
padding: 4px;
|
|
91
91
|
box-sizing: border-box;
|
|
92
92
|
background-color: var(--tab-bg-color);
|
|
93
93
|
box-shadow: 0 0 12px 0 #00000033;
|
|
94
94
|
gap: 8px;
|
|
95
|
-
z-index: 10;
|
|
96
95
|
|
|
97
96
|
.ff-calendar-container {
|
|
98
97
|
display: flex;
|
|
@@ -721,3 +720,309 @@
|
|
|
721
720
|
}
|
|
722
721
|
|
|
723
722
|
|
|
723
|
+
// Adding react day picker library node modules css here to get the css style available in platform
|
|
724
|
+
|
|
725
|
+
/* Variables declaration */
|
|
726
|
+
/* prettier-ignore */
|
|
727
|
+
.rdp-root {
|
|
728
|
+
--rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */
|
|
729
|
+
--rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */
|
|
730
|
+
--rdp-font-family: system-ui; /* The font family used by the calendar. Note that `inherit`does not work here. */
|
|
731
|
+
|
|
732
|
+
--rdp-day-font: inherit; /* The font used for the day cells. */
|
|
733
|
+
--rdp-day-height: 2.75rem; /* The height of the day cells. */
|
|
734
|
+
--rdp-day-width: 2.75rem; /* The width of the day cells. */
|
|
735
|
+
|
|
736
|
+
--rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */
|
|
737
|
+
--rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */
|
|
738
|
+
--rdp-day_button-height: var(--rdp-day-height); /* The height of the day cells. */
|
|
739
|
+
--rdp-day_button-width: var(--rdp-day-width); /* The width of the day cells. */
|
|
740
|
+
|
|
741
|
+
--rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */
|
|
742
|
+
--rdp-selected-font: bold large var(--rdp-font-family); /* The font of the selected days. */
|
|
743
|
+
--rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */
|
|
744
|
+
--rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */
|
|
745
|
+
--rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */
|
|
746
|
+
|
|
747
|
+
--rdp-dropdown-gap: 0.5rem;/* The gap between the dropdowns used in the month captons. */
|
|
748
|
+
|
|
749
|
+
--rdp-month_caption-font: bold larger var(--rdp-font-family); /* The font of the month caption. */
|
|
750
|
+
--rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */
|
|
751
|
+
|
|
752
|
+
--rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */
|
|
753
|
+
--rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */
|
|
754
|
+
--rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */
|
|
755
|
+
--rdp-nav-height: 2.75rem; /* The height of the navigation bar. */
|
|
756
|
+
|
|
757
|
+
--rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */
|
|
758
|
+
--rdp-range_middle-font: normal medium var(--rdp-font-family); /* The font for days in the middle of a range. */
|
|
759
|
+
--rdp-range_middle-foreground-color: white; /* The font for days in the middle of a range. */
|
|
760
|
+
--rdp-range_middle-color: inherit;/* The color of the range text. */
|
|
761
|
+
|
|
762
|
+
--rdp-range_start-color: white; /* The color of the range text. */
|
|
763
|
+
--rdp-range_start-background: linear-gradient(var(--rdp-gradient-direction), transparent 50%, var(--rdp-range_middle-background-color) 50%); /* Used for the background of the start of the selected range. */
|
|
764
|
+
--rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */
|
|
765
|
+
|
|
766
|
+
--rdp-range_end-background: linear-gradient(var(--rdp-gradient-direction), var(--rdp-range_middle-background-color) 50%, transparent 50%); /* Used for the background of the end of the selected range. */
|
|
767
|
+
--rdp-range_end-color: white;/* The color of the range text. */
|
|
768
|
+
--rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */
|
|
769
|
+
|
|
770
|
+
--rdp-week_number-border-radius: 100%; /* The border radius of the week number. */
|
|
771
|
+
--rdp-week_number-border: 2px solid transparent; /* The border of the week number. */
|
|
772
|
+
--rdp-week_number-font: 400 small var(--rdp-font-family); /* The font of the week number cells. */
|
|
773
|
+
--rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */
|
|
774
|
+
--rdp-week_number-opacity: 0.75; /* The opacity of the week number. */
|
|
775
|
+
--rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */
|
|
776
|
+
--rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */
|
|
777
|
+
|
|
778
|
+
--rdp-weekday-font: 500 smaller var(--rdp-font-family); /* The font of the weekday. */
|
|
779
|
+
--rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */
|
|
780
|
+
--rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */
|
|
781
|
+
--rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */
|
|
782
|
+
|
|
783
|
+
--rdp-gradient-direction: 90deg;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
.rdp-root[dir="rtl"] {
|
|
787
|
+
--rdp-gradient-direction: -90deg;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/* Root of the component. */
|
|
791
|
+
.rdp-root {
|
|
792
|
+
position: relative; /* Required to position the navigation toolbar. */
|
|
793
|
+
box-sizing: border-box;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.rdp-root * {
|
|
797
|
+
box-sizing: border-box;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.rdp-day {
|
|
801
|
+
width: var(--rdp-day-width);
|
|
802
|
+
height: var(--rdp-day-height);
|
|
803
|
+
font: var(--rdp-day-font);
|
|
804
|
+
text-align: center;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.rdp-day_button {
|
|
808
|
+
background: none;
|
|
809
|
+
padding: 0;
|
|
810
|
+
margin: 0;
|
|
811
|
+
cursor: pointer;
|
|
812
|
+
font: inherit;
|
|
813
|
+
color: inherit;
|
|
814
|
+
justify-content: center;
|
|
815
|
+
align-items: center;
|
|
816
|
+
display: flex;
|
|
817
|
+
|
|
818
|
+
width: var(--rdp-day_button-width);
|
|
819
|
+
height: var(--rdp-day_button-height);
|
|
820
|
+
border: var(--rdp-day_button-border);
|
|
821
|
+
border-radius: var(--rdp-day_button-border-radius);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
.rdp-day_button:disabled {
|
|
825
|
+
cursor: revert;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
.rdp-caption_label {
|
|
829
|
+
z-index: 1;
|
|
830
|
+
|
|
831
|
+
position: relative;
|
|
832
|
+
display: inline-flex;
|
|
833
|
+
align-items: center;
|
|
834
|
+
|
|
835
|
+
white-space: nowrap;
|
|
836
|
+
border: 0;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
.rdp-button_next,
|
|
840
|
+
.rdp-button_previous {
|
|
841
|
+
border: none;
|
|
842
|
+
background: none;
|
|
843
|
+
padding: 0;
|
|
844
|
+
margin: 0;
|
|
845
|
+
cursor: pointer;
|
|
846
|
+
font: inherit;
|
|
847
|
+
color: inherit;
|
|
848
|
+
-moz-appearance: none;
|
|
849
|
+
-webkit-appearance: none;
|
|
850
|
+
display: inline-flex;
|
|
851
|
+
align-items: center;
|
|
852
|
+
justify-content: center;
|
|
853
|
+
position: relative;
|
|
854
|
+
appearance: none;
|
|
855
|
+
|
|
856
|
+
width: var(--rdp-nav_button-width);
|
|
857
|
+
height: var(--rdp-nav_button-height);
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
.rdp-button_next:disabled,
|
|
861
|
+
.rdp-button_previous:disabled {
|
|
862
|
+
cursor: revert;
|
|
863
|
+
|
|
864
|
+
opacity: var(--rdp-nav_button-disabled-opacity);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.rdp-chevron {
|
|
868
|
+
display: inline-block;
|
|
869
|
+
fill: var(--rdp-accent-color);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.rdp-root[dir="rtl"] .rdp-nav .rdp-chevron {
|
|
873
|
+
transform: rotate(180deg);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
.rdp-root[dir="rtl"] .rdp-nav .rdp-chevron {
|
|
877
|
+
transform: rotate(180deg);
|
|
878
|
+
transform-origin: 50%;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
.rdp-dropdowns {
|
|
882
|
+
position: relative;
|
|
883
|
+
display: inline-flex;
|
|
884
|
+
align-items: center;
|
|
885
|
+
gap: var(--rdp-dropdown-gap);
|
|
886
|
+
}
|
|
887
|
+
.rdp-dropdown {
|
|
888
|
+
z-index: 2;
|
|
889
|
+
|
|
890
|
+
/* Reset */
|
|
891
|
+
opacity: 0;
|
|
892
|
+
appearance: none;
|
|
893
|
+
position: absolute;
|
|
894
|
+
inset-block-start: 0;
|
|
895
|
+
inset-block-end: 0;
|
|
896
|
+
inset-inline-start: 0;
|
|
897
|
+
width: 100%;
|
|
898
|
+
margin: 0;
|
|
899
|
+
padding: 0;
|
|
900
|
+
cursor: inherit;
|
|
901
|
+
border: none;
|
|
902
|
+
line-height: inherit;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
.rdp-dropdown_root {
|
|
906
|
+
position: relative;
|
|
907
|
+
display: inline-flex;
|
|
908
|
+
align-items: center;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
.rdp-dropdown_root[data-disabled="true"] .rdp-chevron {
|
|
912
|
+
opacity: var(--rdp-disabled-opacity);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
.rdp-month_caption {
|
|
916
|
+
display: flex;
|
|
917
|
+
align-content: center;
|
|
918
|
+
height: var(--rdp-nav-height);
|
|
919
|
+
font: var(--rdp-month_caption-font);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
.rdp-months {
|
|
923
|
+
position: relative;
|
|
924
|
+
display: flex;
|
|
925
|
+
flex-wrap: wrap;
|
|
926
|
+
gap: var(--rdp-months-gap);
|
|
927
|
+
max-width: fit-content;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.rdp-month_grid {
|
|
931
|
+
border-collapse: collapse;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.rdp-nav {
|
|
935
|
+
position: absolute;
|
|
936
|
+
inset-block-start: 0;
|
|
937
|
+
inset-inline-end: 0;
|
|
938
|
+
|
|
939
|
+
display: flex;
|
|
940
|
+
align-items: center;
|
|
941
|
+
|
|
942
|
+
height: var(--rdp-nav-height);
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.rdp-weekday {
|
|
946
|
+
opacity: var(--rdp-weekday-opacity);
|
|
947
|
+
padding: var(--rdp-weekday-padding);
|
|
948
|
+
font: var(--rdp-weekday-font);
|
|
949
|
+
text-align: var(--rdp-weekday-text-align);
|
|
950
|
+
text-transform: var(--rdp-weekday-text-transform);
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
.rdp-week_number {
|
|
954
|
+
opacity: var(--rdp-week_number-opacity);
|
|
955
|
+
font: var(--rdp-week_number-font);
|
|
956
|
+
height: var(--rdp-week_number-height);
|
|
957
|
+
width: var(--rdp-week_number-width);
|
|
958
|
+
border: var(--rdp-week_number-border);
|
|
959
|
+
border-radius: var(--rdp-week_number-border-radius);
|
|
960
|
+
text-align: var(--rdp-weeknumber-text-align);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
/* DAY MODIFIERS */
|
|
964
|
+
.rdp-today:not(.rdp-outside) {
|
|
965
|
+
color: var(--rdp-today-color);
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.rdp-selected {
|
|
969
|
+
font: var(--rdp-selected-font);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.rdp-selected .rdp-day_button {
|
|
973
|
+
border: var(--rdp-selected-border);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
.rdp-outside {
|
|
977
|
+
opacity: var(--rdp-outside-opacity);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.rdp-disabled {
|
|
981
|
+
opacity: var(--rdp-disabled-opacity);
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.rdp-hidden {
|
|
985
|
+
visibility: hidden;
|
|
986
|
+
color: var(--rdp-range_start-color);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
.rdp-range_start {
|
|
990
|
+
background: var(--rdp-range_start-background);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
.rdp-range_start .rdp-day_button {
|
|
994
|
+
background-color: var(--rdp-range_start-date-background-color);
|
|
995
|
+
color: var(--rdp-range_start-color);
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
.rdp-range_middle {
|
|
999
|
+
background-color: var(--rdp-range_middle-background-color);
|
|
1000
|
+
font: var(--rdp-range_middle-font);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
.rdp-range_middle .rdp-day_button {
|
|
1004
|
+
border-color: transparent;
|
|
1005
|
+
border: unset;
|
|
1006
|
+
border-radius: unset;
|
|
1007
|
+
color: var(--rdp-range_middle-color);
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.rdp-range_end {
|
|
1011
|
+
background: var(--rdp-range_end-background);
|
|
1012
|
+
color: var(--rdp-range_end-color);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
.rdp-range_end .rdp-day_button {
|
|
1016
|
+
color: var(--rdp-range_start-color);
|
|
1017
|
+
background-color: var(--rdp-range_end-date-background-color);
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
.rdp-range_start.rdp-range_end {
|
|
1021
|
+
background: revert;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.rdp-focusable {
|
|
1025
|
+
cursor: pointer;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
|