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
|
@@ -26,6 +26,7 @@ const Branches = ({
|
|
|
26
26
|
addInstanceLabel = '',
|
|
27
27
|
scriptType = '',
|
|
28
28
|
projectType = '',
|
|
29
|
+
readOnly,
|
|
29
30
|
}: BranchesProps) => {
|
|
30
31
|
const evenRow = rowIndex % 2 === 0;
|
|
31
32
|
const lastMachineInstance = checkEmpty(
|
|
@@ -192,72 +193,79 @@ const Branches = ({
|
|
|
192
193
|
) as MachineType[]
|
|
193
194
|
}
|
|
194
195
|
contentReverse={!evenRow}
|
|
195
|
-
modalId={`${machineInstanceId}-runCount-${
|
|
196
|
+
modalId={`${machineInstanceId}-runCount-${
|
|
197
|
+
numberOfRuns - 1
|
|
198
|
+
}`}
|
|
196
199
|
onClick={() =>
|
|
197
200
|
onUpdateAddBrowserInstance(
|
|
198
201
|
`${machineInstanceId}-runCount-0`,
|
|
199
|
-
|
|
202
|
+
machineInstance as ExecutionContext
|
|
200
203
|
)
|
|
201
204
|
}
|
|
202
205
|
/>
|
|
203
206
|
</div>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
207
|
+
{!readOnly && (
|
|
208
|
+
<div
|
|
209
|
+
className={classNames({
|
|
210
|
+
'ff-connecting-branch-datalist': evenRow,
|
|
211
|
+
'ff-connecting-branch-datalist-reverse': !evenRow,
|
|
212
|
+
})}
|
|
213
|
+
>
|
|
214
|
+
{hideDataSet && (
|
|
215
|
+
<>
|
|
216
|
+
<div
|
|
217
|
+
id={`ff-sequential-branch-dataset-${machineInstanceId}-${numberOfRuns}`}
|
|
218
|
+
className="ff-dataset-list-branch"
|
|
219
|
+
onClick={() =>
|
|
220
|
+
onUpdateDataSetList(
|
|
221
|
+
`ff-sequential-branch-dataset-${machineInstanceId}-${numberOfRuns}`,
|
|
222
|
+
{
|
|
223
|
+
peVariableSetId: peVariableSetId,
|
|
224
|
+
globalVariableSetId: globalVariableSetId,
|
|
225
|
+
testDataSetId: testDataSetId,
|
|
226
|
+
},
|
|
227
|
+
true,
|
|
228
|
+
numberOfRuns,
|
|
229
|
+
machineInstanceId
|
|
230
|
+
)
|
|
231
|
+
}
|
|
232
|
+
>
|
|
233
|
+
<Icon
|
|
234
|
+
name="datalist_icon"
|
|
235
|
+
className="ff-connecting-icon"
|
|
236
|
+
/>
|
|
237
|
+
<Typography
|
|
238
|
+
className="ff-connecting-text"
|
|
239
|
+
color="var(--ff-connecting-branch-color)"
|
|
240
|
+
>
|
|
241
|
+
Dataset List
|
|
242
|
+
</Typography>
|
|
243
|
+
</div>
|
|
244
|
+
|
|
245
|
+
<Icon
|
|
246
|
+
name="plus_icon"
|
|
247
|
+
className="ff-connecting-icon"
|
|
248
|
+
onClick={() => onAddRunBrowser(machineInstanceId)}
|
|
249
|
+
color="var(--ff-connecting-branch-color)"
|
|
250
|
+
/>
|
|
251
|
+
<Typography
|
|
252
|
+
className="ff-connecting-text"
|
|
253
|
+
color="var(--ff-connecting-branch-color)"
|
|
254
|
+
>
|
|
255
|
+
Run
|
|
256
|
+
</Typography>
|
|
257
|
+
</>
|
|
258
|
+
)}
|
|
259
|
+
<Icon
|
|
260
|
+
name="delete"
|
|
261
|
+
className="ff-connecting-delete-icon"
|
|
214
262
|
onClick={() =>
|
|
215
|
-
|
|
216
|
-
`ff-sequential-branch-dataset-${machineInstanceId}-${numberOfRuns}`,
|
|
217
|
-
{
|
|
218
|
-
peVariableSetId: peVariableSetId,
|
|
219
|
-
globalVariableSetId: globalVariableSetId,
|
|
220
|
-
testDataSetId: testDataSetId,
|
|
221
|
-
},
|
|
222
|
-
true,
|
|
223
|
-
numberOfRuns,
|
|
224
|
-
machineInstanceId
|
|
225
|
-
)
|
|
263
|
+
onDeleteBrowser(machineInstanceId, numberOfRuns)
|
|
226
264
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
/>
|
|
232
|
-
<Typography
|
|
233
|
-
className="ff-connecting-text"
|
|
234
|
-
color="var(--ff-connecting-branch-color)"
|
|
235
|
-
>
|
|
236
|
-
Dataset List
|
|
237
|
-
</Typography>
|
|
238
|
-
</div>
|
|
239
|
-
)}
|
|
240
|
-
<Icon
|
|
241
|
-
name="plus_icon"
|
|
242
|
-
className="ff-connecting-icon"
|
|
243
|
-
onClick={() => onAddRunBrowser(machineInstanceId)}
|
|
244
|
-
color="var(--ff-connecting-branch-color)"
|
|
245
|
-
/>
|
|
246
|
-
<Typography
|
|
247
|
-
className="ff-connecting-text"
|
|
248
|
-
color="var(--ff-connecting-branch-color)"
|
|
249
|
-
>
|
|
250
|
-
Run
|
|
251
|
-
</Typography>
|
|
252
|
-
<Icon
|
|
253
|
-
name="delete"
|
|
254
|
-
className="ff-connecting-delete-icon"
|
|
255
|
-
onClick={() =>
|
|
256
|
-
onDeleteBrowser(machineInstanceId, numberOfRuns)
|
|
257
|
-
}
|
|
258
|
-
color="var(--ff-connecting-branch-delete-color)"
|
|
259
|
-
/>
|
|
260
|
-
</div>
|
|
265
|
+
color="var(--ff-connecting-branch-delete-color)"
|
|
266
|
+
/>
|
|
267
|
+
</div>
|
|
268
|
+
)}
|
|
261
269
|
</div>
|
|
262
270
|
) : (
|
|
263
271
|
<div className="ff-connecting-branch-browser-button">
|
|
@@ -18,6 +18,7 @@ const ConnectingBranches = ({
|
|
|
18
18
|
addInstanceLabel = '',
|
|
19
19
|
scriptType = '',
|
|
20
20
|
projectType = 'Web',
|
|
21
|
+
readOnly = false
|
|
21
22
|
}: ConnectingBranchesProps) => {
|
|
22
23
|
const [machineInstance, setMachineInstance] = useState<
|
|
23
24
|
ExecutionContext[] | {}[]
|
|
@@ -66,6 +67,7 @@ const ConnectingBranches = ({
|
|
|
66
67
|
addInstanceLabel={addInstanceLabel}
|
|
67
68
|
scriptType={scriptType}
|
|
68
69
|
projectType={projectType}
|
|
70
|
+
readOnly={readOnly}
|
|
69
71
|
/>
|
|
70
72
|
</Fragment>
|
|
71
73
|
))}
|
|
@@ -8,7 +8,10 @@ export interface SequentialConnectingBranchProps {
|
|
|
8
8
|
machineOptionsList?: Option[];
|
|
9
9
|
onHandleSelect?: (option: Option) => void;
|
|
10
10
|
onAddBrowserInstance?: (modalId: string) => void;
|
|
11
|
-
onUpdateAddBrowserInstance: (
|
|
11
|
+
onUpdateAddBrowserInstance: (
|
|
12
|
+
modalId: string,
|
|
13
|
+
machineInstance: ExecutionContext
|
|
14
|
+
) => void;
|
|
12
15
|
onDeleteBrowserInstance?: (id: string, runCount: number) => void;
|
|
13
16
|
onAddRunBrowserInstance?: (machineInstanceId: string) => void;
|
|
14
17
|
onDeleteMachineInstance?: () => void;
|
|
@@ -23,6 +26,7 @@ export interface SequentialConnectingBranchProps {
|
|
|
23
26
|
addInstanceLabel?: string;
|
|
24
27
|
scriptType?: string;
|
|
25
28
|
projectType?: string;
|
|
29
|
+
readOnly?: boolean;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
// Type for machine information
|
|
@@ -15,7 +15,7 @@ const renderSpaces = (
|
|
|
15
15
|
<span
|
|
16
16
|
key={i}
|
|
17
17
|
className={`tree-table-space-block ${!line ? 'no-lines' : ''} ${
|
|
18
|
-
isLast && i === level-1 ? 'last-node' : ''
|
|
18
|
+
isLast && i === level - 1 ? 'last-node' : ''
|
|
19
19
|
}`}
|
|
20
20
|
/>
|
|
21
21
|
))}
|
|
@@ -51,7 +51,7 @@ const TableCell = React.memo(
|
|
|
51
51
|
{col.isTree && select === 'checkbox' && (
|
|
52
52
|
<Checkbox
|
|
53
53
|
checked={selected.includes(node.id)}
|
|
54
|
-
onChange={() => onCheckBoxChange(
|
|
54
|
+
onChange={(e) => onCheckBoxChange(e, node)}
|
|
55
55
|
/>
|
|
56
56
|
)}
|
|
57
57
|
{col.isTree && select === 'radio' && (
|
|
@@ -59,7 +59,7 @@ const TableCell = React.memo(
|
|
|
59
59
|
name={node.title}
|
|
60
60
|
checked={selected.includes(node.id)}
|
|
61
61
|
value={node.id}
|
|
62
|
-
onChange={() => onCheckBoxChange(
|
|
62
|
+
onChange={(e) => onCheckBoxChange(e, node)}
|
|
63
63
|
/>
|
|
64
64
|
)}
|
|
65
65
|
{prepareData(node, col)}
|
|
@@ -199,13 +199,6 @@
|
|
|
199
199
|
transition: transform 0.3s ease;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
tr:after {
|
|
203
|
-
content: ' ';
|
|
204
|
-
display: block;
|
|
205
|
-
visibility: hidden;
|
|
206
|
-
clear: both;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
202
|
.tree-table-space-container {
|
|
210
203
|
display: inline-flex;
|
|
211
204
|
// flex-direction: row-reverse;
|
|
@@ -4,7 +4,6 @@ import { TreeTableProps } from './types';
|
|
|
4
4
|
import TableHead from './Components/TableHead';
|
|
5
5
|
import TableBody from './Components/TableBody';
|
|
6
6
|
import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';
|
|
7
|
-
import getAllChildIds from './Utils/getAllChildIds';
|
|
8
7
|
import functionCheck from '../../utils/functionCheck/functionCheck';
|
|
9
8
|
|
|
10
9
|
const TreeTable: React.FC<TreeTableProps> = ({
|
|
@@ -41,28 +40,10 @@ const TreeTable: React.FC<TreeTableProps> = ({
|
|
|
41
40
|
);
|
|
42
41
|
|
|
43
42
|
const handleCheckBoxChange = useCallback(
|
|
44
|
-
(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (type === 'radio') {
|
|
48
|
-
onChange?.('true', [nodeId]);
|
|
49
|
-
} else {
|
|
50
|
-
let updatedSelected = [...selected];
|
|
51
|
-
|
|
52
|
-
if (!updatedSelected.includes(nodeId)) {
|
|
53
|
-
const childIds = getAllChildIds(nodeId, treeData);
|
|
54
|
-
updatedSelected = [...new Set([...updatedSelected, ...childIds])]; // Add children
|
|
55
|
-
} else {
|
|
56
|
-
const childIds = getAllChildIds(nodeId, treeData);
|
|
57
|
-
updatedSelected = updatedSelected.filter(
|
|
58
|
-
(id) => !childIds.includes(id)
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
onChange?.('true', updatedSelected);
|
|
63
|
-
}
|
|
43
|
+
(e: any, node: any) => {
|
|
44
|
+
onChange?.(e, node);
|
|
64
45
|
},
|
|
65
|
-
[
|
|
46
|
+
[onChange]
|
|
66
47
|
);
|
|
67
48
|
|
|
68
49
|
const handleRowClick = useCallback(
|
|
@@ -15,7 +15,7 @@ export interface TableCellProps {
|
|
|
15
15
|
level: number;
|
|
16
16
|
selected: string[];
|
|
17
17
|
select: string | null;
|
|
18
|
-
onCheckBoxChange: (
|
|
18
|
+
onCheckBoxChange: (e: any, node: string[] | any) => void;
|
|
19
19
|
onToggleExpand: (node: any) => void;
|
|
20
20
|
parentSiblings: boolean[];
|
|
21
21
|
isLast: boolean | undefined;
|
|
@@ -32,7 +32,7 @@ export interface TableBodyProps {
|
|
|
32
32
|
select: string | null;
|
|
33
33
|
onRowClick: (e: any, node: any) => void;
|
|
34
34
|
onToggleExpand: (node: any) => void;
|
|
35
|
-
onCheckBoxChange: (
|
|
35
|
+
onCheckBoxChange: (e: any, node: string[] | any) => void;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export interface TableRowProps {
|
|
@@ -43,7 +43,7 @@ export interface TableRowProps {
|
|
|
43
43
|
select: string | null;
|
|
44
44
|
onRowClick: (e: any, node: any) => void;
|
|
45
45
|
onToggleExpand: (node: any) => void;
|
|
46
|
-
onCheckBoxChange: (
|
|
46
|
+
onCheckBoxChange: (e: any, node: string[] | any) => void;
|
|
47
47
|
parentSiblings: boolean[];
|
|
48
48
|
isLast: boolean | undefined;
|
|
49
49
|
}
|
|
@@ -65,7 +65,7 @@ export interface TreeTableProps {
|
|
|
65
65
|
columnsData: Column[];
|
|
66
66
|
selected?: string[];
|
|
67
67
|
select?: 'radio' | 'checkbox' | 'none';
|
|
68
|
-
onChange?: (e: any, node: string[]) => void;
|
|
68
|
+
onChange?: (e: any, node: string[] | any) => void;
|
|
69
69
|
onClick?: (e: React.MouseEvent<HTMLDivElement>, row: TreeNode) => void;
|
|
70
70
|
onExpand?: (_isExpanded: boolean, node: string) => void;
|
|
71
71
|
loadMore?: (_direction?: string) => void;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
.ff-tab-button {
|
|
15
15
|
&--default {
|
|
16
|
+
position: relative;
|
|
16
17
|
border: none;
|
|
17
18
|
background: none;
|
|
18
19
|
padding: 0 4px;
|
|
@@ -129,4 +130,22 @@
|
|
|
129
130
|
.ff-tab-content {
|
|
130
131
|
width: inherit;
|
|
131
132
|
}
|
|
133
|
+
.ff-defaultStatus {
|
|
134
|
+
position: absolute;
|
|
135
|
+
top: 2px;
|
|
136
|
+
right: 0px;
|
|
137
|
+
width: 6px;
|
|
138
|
+
height: 6px;
|
|
139
|
+
background-color: transparent;
|
|
140
|
+
border-radius: 50%;
|
|
141
|
+
|
|
142
|
+
&.ff-successStatus {
|
|
143
|
+
background-color: var(--confirm-tick-icon-color);
|
|
144
|
+
box-shadow: 0px 1px 1px 0px var(--toggle-strip-shadow);
|
|
145
|
+
}
|
|
146
|
+
&.ff-dangerStatus {
|
|
147
|
+
background-color: var(--delete-text-color);
|
|
148
|
+
box-shadow: 0px 1px 1px 0px var(--toggle-strip-shadow);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
132
151
|
}
|
|
@@ -58,6 +58,15 @@ const Tabs = ({
|
|
|
58
58
|
'ff-tab-bar--active': activeTabId === tab.id,
|
|
59
59
|
})}
|
|
60
60
|
></div>
|
|
61
|
+
<span
|
|
62
|
+
className={`ff-defaultStatus ${
|
|
63
|
+
tab.status === 'success'
|
|
64
|
+
? 'ff-successStatus'
|
|
65
|
+
: tab.status === 'error'
|
|
66
|
+
? 'ff-dangerStatus'
|
|
67
|
+
: ''
|
|
68
|
+
}`}
|
|
69
|
+
></span>
|
|
61
70
|
</button>
|
|
62
71
|
))}
|
|
63
72
|
</div>
|
package/src/index.ts
CHANGED
|
@@ -74,6 +74,7 @@ import ProgressBar from './components/ProgressBar';
|
|
|
74
74
|
import ChooseFile from './components/ChooseFile/ChooseFile';
|
|
75
75
|
import ScriptSwitchButton from './components/ScriptSwitchButton';
|
|
76
76
|
|
|
77
|
+
import MobileSkin from './components/MobileSkin';
|
|
77
78
|
// Utils imports
|
|
78
79
|
import { checkEmpty } from './utils/checkEmpty/checkEmpty';
|
|
79
80
|
import {
|
|
@@ -97,11 +98,13 @@ import { saveFileFromBlob } from './utils/downloadFile/saveFileFromBlob';
|
|
|
97
98
|
import { capitalize } from './utils/capitalize/capitalize';
|
|
98
99
|
import Comments from './components/Comment/Comments';
|
|
99
100
|
import useFileDropzone from './hooks/useFileDropzone';
|
|
101
|
+
import useClickOutside from './hooks/useClickOutside';
|
|
100
102
|
import PopUpModal from './components/PopUpModal/PopUpModal';
|
|
101
103
|
import FormatString from './utils/FormatString/FormatString';
|
|
102
104
|
import ConditionalDropdown from './components/ConditionalDropdown/ConditionalDropdown';
|
|
103
105
|
import { hasDuplicateFile } from './utils/checkDuplicates/checkDuplicates';
|
|
104
106
|
import PhoneInputField from './components/PhoneInput';
|
|
107
|
+
import { useKeyboardActions } from './utils/keyBoardActionUtil/UseKeyboardActions';
|
|
105
108
|
import {
|
|
106
109
|
EMAIL_REGEX,
|
|
107
110
|
URL_REGEX,
|
|
@@ -115,6 +118,7 @@ import {
|
|
|
115
118
|
ALPHABET_ONLY_REGEX,
|
|
116
119
|
NUMBERS_ONLY_REGEX,
|
|
117
120
|
ALPHANUMERIC_REGEX,
|
|
121
|
+
ALPHANUMERIC_WITH_ROUND_BRACES_REGEX,
|
|
118
122
|
DATE_REGEX,
|
|
119
123
|
TIME_REGEX,
|
|
120
124
|
FILE_EXTENSION_REGEX,
|
|
@@ -148,6 +152,15 @@ import {
|
|
|
148
152
|
CURRENCY_GENERIC_REGEX,
|
|
149
153
|
LINKEDIN_PROFILE_REGEX,
|
|
150
154
|
TWITTER_HANDLE_REGEX,
|
|
155
|
+
UNIT_REGEX,
|
|
156
|
+
NUMBER_REGEX,
|
|
157
|
+
MEMORY_VALIDATION_REGEX,
|
|
158
|
+
STEP_GROUP_NAME_REGEX,
|
|
159
|
+
NLP_DESCRIPTION_REGEX,
|
|
160
|
+
FILE_NAME_REGEX,
|
|
161
|
+
ELEMENTS_TRAILING_SPACE_REGEX,
|
|
162
|
+
ELEMENTS_WHITE_SPACE_REGEX,
|
|
163
|
+
PARAMETER_ALPHANUMERIC_REGEX,
|
|
151
164
|
} from './validations/regex';
|
|
152
165
|
|
|
153
166
|
export {
|
|
@@ -235,6 +248,7 @@ export {
|
|
|
235
248
|
ProgressBar,
|
|
236
249
|
ChooseFile,
|
|
237
250
|
ScriptSwitchButton,
|
|
251
|
+
MobileSkin,
|
|
238
252
|
|
|
239
253
|
// utils exports
|
|
240
254
|
checkEmpty,
|
|
@@ -252,8 +266,11 @@ export {
|
|
|
252
266
|
saveFileFromBlob,
|
|
253
267
|
capitalize,
|
|
254
268
|
useFileDropzone,
|
|
269
|
+
useClickOutside,
|
|
255
270
|
FormatString,
|
|
256
271
|
hasDuplicateFile,
|
|
272
|
+
useKeyboardActions,
|
|
273
|
+
|
|
257
274
|
EMAIL_REGEX,
|
|
258
275
|
URL_REGEX,
|
|
259
276
|
PHONE_REGEX,
|
|
@@ -266,6 +283,7 @@ export {
|
|
|
266
283
|
ALPHABET_ONLY_REGEX,
|
|
267
284
|
NUMBERS_ONLY_REGEX,
|
|
268
285
|
ALPHANUMERIC_REGEX,
|
|
286
|
+
ALPHANUMERIC_WITH_ROUND_BRACES_REGEX,
|
|
269
287
|
DATE_REGEX,
|
|
270
288
|
TIME_REGEX,
|
|
271
289
|
FILE_EXTENSION_REGEX,
|
|
@@ -299,4 +317,13 @@ export {
|
|
|
299
317
|
CURRENCY_GENERIC_REGEX,
|
|
300
318
|
LINKEDIN_PROFILE_REGEX,
|
|
301
319
|
TWITTER_HANDLE_REGEX,
|
|
320
|
+
UNIT_REGEX,
|
|
321
|
+
NUMBER_REGEX,
|
|
322
|
+
MEMORY_VALIDATION_REGEX,
|
|
323
|
+
STEP_GROUP_NAME_REGEX,
|
|
324
|
+
NLP_DESCRIPTION_REGEX,
|
|
325
|
+
FILE_NAME_REGEX,
|
|
326
|
+
ELEMENTS_TRAILING_SPACE_REGEX,
|
|
327
|
+
ELEMENTS_WHITE_SPACE_REGEX,
|
|
328
|
+
PARAMETER_ALPHANUMERIC_REGEX,
|
|
302
329
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { convertFormDataToObject } from './ConvertFormDataToObject';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Utils/convertFormDataToObject',
|
|
6
|
+
component: convertFormDataToObject,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Default = () => {
|
|
10
|
+
const formData = new FormData();
|
|
11
|
+
formData.append('username', 'Md Imran');
|
|
12
|
+
formData.append('email', 'im@xyz.com');
|
|
13
|
+
formData.append('age', '23');
|
|
14
|
+
|
|
15
|
+
const result = convertFormDataToObject(formData);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div>
|
|
19
|
+
<h3>Test convertFormDataToObject</h3>
|
|
20
|
+
<pre>
|
|
21
|
+
Convertion to an Array to show existing FormData:
|
|
22
|
+
{JSON.stringify(Array.from(formData.entries()), null, 2)}
|
|
23
|
+
</pre>
|
|
24
|
+
<pre>Result: {JSON.stringify(result, null, 2)}</pre>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const convertFormDataToObject = (formData: FormData): Record<string, any> => {
|
|
2
|
+
const obj: Record<string, any> = {};
|
|
3
|
+
formData.forEach((value, key) => {
|
|
4
|
+
if (obj[key]) {
|
|
5
|
+
// If the key already exists, convert it to an array
|
|
6
|
+
obj[key] = Array.isArray(obj[key])
|
|
7
|
+
? [...obj[key], value]
|
|
8
|
+
: [obj[key], value];
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return obj;
|
|
14
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { useKeyboardActions } from './UseKeyboardActions';
|
|
4
|
+
|
|
5
|
+
// A demonstration component to showcase the `useKeyboardAction` utility
|
|
6
|
+
const UseKeyboardActionComponent: React.FC = () => {
|
|
7
|
+
const [message, setMessage] = useState<string>(
|
|
8
|
+
'Press Escape or Enter to see actions.'
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
// Registering keyboard actions using the `useKeyboardAction` utility
|
|
12
|
+
useKeyboardActions([
|
|
13
|
+
{
|
|
14
|
+
key: 'Escape',
|
|
15
|
+
action: () => setMessage('Escape key was pressed.'),
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: 'Enter',
|
|
19
|
+
action: () => setMessage('Enter key was pressed.'),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
key: 'ArrowUp',
|
|
23
|
+
action: () => setMessage('ArrowUp key was pressed.'),
|
|
24
|
+
},
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
style={{ textAlign: 'center', padding: '20px', border: '1px solid #ddd' }}
|
|
30
|
+
>
|
|
31
|
+
<h3>Keyboard Action Utility</h3>
|
|
32
|
+
<p>{message}</p>
|
|
33
|
+
<p>Try pressing Escape, Enter, or ArrowUp keys.</p>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Meta configuration for the story
|
|
39
|
+
const meta: Meta<typeof UseKeyboardActionComponent> = {
|
|
40
|
+
title: 'Utils/UseKeyboardAction',
|
|
41
|
+
component: UseKeyboardActionComponent,
|
|
42
|
+
parameters: {
|
|
43
|
+
layout: 'centered',
|
|
44
|
+
},
|
|
45
|
+
tags: ['autodocs'],
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default meta;
|
|
49
|
+
|
|
50
|
+
type Story = StoryObj<typeof UseKeyboardActionComponent>;
|
|
51
|
+
|
|
52
|
+
// Default story for the component
|
|
53
|
+
export const Primary: Story = {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { KeyboardAction } from "./types";
|
|
3
|
+
|
|
4
|
+
export const useKeyboardActions = (actions: KeyboardAction[]) => {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
7
|
+
actions.forEach(({ key, action }) => {
|
|
8
|
+
if (event.key === key) {
|
|
9
|
+
action();
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
15
|
+
|
|
16
|
+
return () => {
|
|
17
|
+
window.removeEventListener('keydown', handleKeyDown);
|
|
18
|
+
};
|
|
19
|
+
}, [actions]);
|
|
20
|
+
};
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
ALPHABET_ONLY_REGEX,
|
|
14
14
|
NUMBERS_ONLY_REGEX,
|
|
15
15
|
ALPHANUMERIC_REGEX,
|
|
16
|
+
ALPHANUMERIC_WITH_ROUND_BRACES_REGEX,
|
|
16
17
|
DATE_REGEX,
|
|
17
18
|
TIME_REGEX,
|
|
18
19
|
FILE_EXTENSION_REGEX,
|
|
@@ -46,6 +47,15 @@ import {
|
|
|
46
47
|
CURRENCY_GENERIC_REGEX,
|
|
47
48
|
LINKEDIN_PROFILE_REGEX,
|
|
48
49
|
TWITTER_HANDLE_REGEX,
|
|
50
|
+
NUMBER_REGEX,
|
|
51
|
+
UNIT_REGEX,
|
|
52
|
+
MEMORY_VALIDATION_REGEX,
|
|
53
|
+
STEP_GROUP_NAME_REGEX,
|
|
54
|
+
NLP_DESCRIPTION_REGEX,
|
|
55
|
+
FILE_NAME_REGEX,
|
|
56
|
+
ELEMENTS_TRAILING_SPACE_REGEX,
|
|
57
|
+
ELEMENTS_WHITE_SPACE_REGEX,
|
|
58
|
+
PARAMETER_ALPHANUMERIC_REGEX,
|
|
49
59
|
} from './regex';
|
|
50
60
|
|
|
51
61
|
export default {
|
|
@@ -119,6 +129,12 @@ export const Playground = () => {
|
|
|
119
129
|
regex: ALPHANUMERIC_REGEX,
|
|
120
130
|
description: 'Validates alphanumeric values (e.g. abc123)',
|
|
121
131
|
},
|
|
132
|
+
|
|
133
|
+
{
|
|
134
|
+
name: 'ALPHANUMERIC_WITH_ROUND_BRACES_REGEX',
|
|
135
|
+
regex: ALPHANUMERIC_WITH_ROUND_BRACES_REGEX,
|
|
136
|
+
description: 'Validates alphanumeric values with Underscore and RoundBraces Inclusive (e.g. abc123()_)',
|
|
137
|
+
},
|
|
122
138
|
{
|
|
123
139
|
name: 'DATE_REGEX',
|
|
124
140
|
regex: DATE_REGEX,
|
|
@@ -287,8 +303,55 @@ export const Playground = () => {
|
|
|
287
303
|
regex: TWITTER_HANDLE_REGEX,
|
|
288
304
|
description: 'Validates Twitter handle (e.g. @username)',
|
|
289
305
|
},
|
|
306
|
+
{
|
|
307
|
+
name: 'NUMBER_REGEX',
|
|
308
|
+
regex: NUMBER_REGEX,
|
|
309
|
+
description: 'Validates a number (integer or float)',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: 'UNIT_REGEX',
|
|
313
|
+
regex: UNIT_REGEX,
|
|
314
|
+
description: 'Validates a string of letters (unit)',
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: 'MEMORY_VALIDATION_REGEX',
|
|
318
|
+
regex: MEMORY_VALIDATION_REGEX,
|
|
319
|
+
description: 'Regular expression to match a number with an optional unit (GB, MB, or KB)',
|
|
320
|
+
},{
|
|
321
|
+
name: 'STEP_GROUP_NAME_REGEX',
|
|
322
|
+
regex: STEP_GROUP_NAME_REGEX,
|
|
323
|
+
description:
|
|
324
|
+
'Step group name accept only ( ,) ,-,_ special characters(e.g,step-group_one(test))',
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: 'NLP_DESCRIPTION_REGEX',
|
|
328
|
+
regex: NLP_DESCRIPTION_REGEX,
|
|
329
|
+
description:
|
|
330
|
+
'NLP Description should allow _ and $ only (e.g ,$nlpName_test)',
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: 'FILE_NAME_REGEX',
|
|
334
|
+
regex: FILE_NAME_REGEX,
|
|
335
|
+
description: `It should include a valid file extension (e.g.,'.txt', '.jpg') without special characters like '@' or multiple dots after the extension.`,
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: 'ELEMENTS_TRAILING_SPACE_REGEX',
|
|
339
|
+
regex: ELEMENTS_TRAILING_SPACE_REGEX,
|
|
340
|
+
description: `Element Name should not have space in the initial and end.`,
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: 'ELEMENTS_WHITE_SPACE_REGEX',
|
|
344
|
+
regex: ELEMENTS_WHITE_SPACE_REGEX,
|
|
345
|
+
description: `Elements name should not have only white space.`,
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
name: 'PARAMETER_ALPHANUMERIC_REGEX,',
|
|
349
|
+
regex: PARAMETER_ALPHANUMERIC_REGEX,
|
|
350
|
+
description: `Parameter name should be alphanumeric.`,
|
|
351
|
+
},
|
|
290
352
|
];
|
|
291
353
|
|
|
354
|
+
|
|
292
355
|
const validateInput = () => {
|
|
293
356
|
const validator = validators.find(
|
|
294
357
|
(validator) => validator.name === selectedRegex
|