pixel-react 1.9.8 → 1.10.0
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/1fb4472b34e4fe07.css +1 -0
- package/lib/StyleGuide/ColorPalette/ColorPalette.stories.d.ts +6 -0
- package/lib/StyleGuide/Typography/Typography.stories.d.ts +6 -0
- package/lib/assets/fonts/Poppins-Bold.ttf +0 -0
- package/lib/assets/fonts/Poppins-Medium.ttf +0 -0
- package/lib/assets/fonts/Poppins-Regular.ttf +0 -0
- package/lib/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/lib/components/Accordion/Accordion.d.ts +1 -1
- package/lib/components/Accordion/Accordion.stories.d.ts +6 -0
- package/lib/components/Accordion/types.d.ts +10 -2
- 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/AddResourceButton/AddButton.stories.d.ts +8 -0
- package/lib/components/AddVariables/AddVariables.d.ts +5 -0
- package/lib/components/AddVariables/index.d.ts +1 -0
- package/lib/components/AddVariables/types.d.ts +35 -0
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.stories.d.ts +7 -0
- package/lib/components/AppHeader/AppHeader.stories.d.ts +7 -0
- package/lib/components/AppHeader/types.d.ts +1 -1
- package/lib/components/AttachImage/AttachImage.stories.d.ts +7 -0
- package/lib/components/AttachmentButton/AttachmentButton.stories.d.ts +9 -0
- package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
- package/lib/components/Button/Button.stories.d.ts +13 -0
- package/lib/components/Charts/BarChart/BarChart.d.ts +2 -0
- package/lib/components/Charts/BarChart/BarChart.stories.d.ts +6 -0
- package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.d.ts +7 -0
- package/lib/components/Charts/DonutChart/DonutChart.stories.d.ts +6 -0
- package/lib/components/Charts/IconRadialChart/IconRadialChart.stories.d.ts +8 -0
- package/lib/components/Charts/IconRadialChart/types.d.ts +4 -3
- package/lib/components/Charts/LineChart/LineChart.stories.d.ts +7 -0
- package/lib/components/Charts/LineChart/types.d.ts +1 -0
- package/lib/components/Charts/MultiRadialChart/MultiRadialChart.stories.d.ts +8 -0
- package/lib/components/Charts/MultiRadialChart/types.d.ts +3 -2
- package/lib/components/Charts/PieChart/PieChart.stories.d.ts +7 -0
- package/lib/components/Charts/RadialChart/RadialChart.stories.d.ts +6 -0
- package/lib/components/Checkbox/Checkbox.stories.d.ts +8 -0
- package/lib/components/Chip/Chip.stories.d.ts +14 -0
- package/lib/components/ConnectingBranch/ConnectingBranch.stories.d.ts +6 -0
- package/lib/components/DatePicker/DatePicker.stories.d.ts +9 -0
- package/lib/components/DragAndDrop/DragAndDrop.stories.d.ts +6 -0
- package/lib/components/Drawer/Drawer.stories.d.ts +12 -0
- package/lib/components/EditTextField/EditTextField.stories.d.ts +10 -0
- package/lib/components/Editor/Editor.stories.d.ts +6 -0
- package/lib/components/Excel/ContextMenu/ContextMenu.d.ts +4 -0
- package/lib/components/Excel/ExcelFile.stories.d.ts +6 -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 +80 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +174 -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 +178 -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 +44 -0
- package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +19 -0
- package/lib/components/ExcelFile/ExcelFile.stories.d.ts +6 -0
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +12 -0
- package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +15 -0
- package/lib/components/ExcelFile/ImportExcelStyles.d.ts +24 -0
- package/lib/components/ExcelFile/Types.d.ts +129 -0
- package/lib/components/ExcelFile/index.d.ts +1 -0
- package/lib/components/ExpandableMenu/ExpandableMenu.stories.d.ts +7 -0
- package/lib/components/FF_Captcha/captcha.stories.d.ts +8 -0
- package/lib/components/FileDropzone/FileDropzone.stories.d.ts +8 -0
- package/lib/components/Form/Form.stories.d.ts +7 -0
- package/lib/components/GridLayout/GridLayout.stories.d.ts +8 -0
- package/lib/components/HighlightText/HighlightText.stories.d.ts +6 -0
- package/lib/components/Icon/Icon.stories.d.ts +8 -0
- package/lib/components/IconButton/IconButton.stories.d.ts +7 -0
- package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +7 -0
- package/lib/components/Input/Input.stories.d.ts +9 -0
- package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +9 -0
- package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +13 -0
- package/lib/components/LazyLoad/LazyLoad.stories.d.ts +6 -0
- package/lib/components/MachineInputField/MachineInputField.stories.d.ts +6 -0
- package/lib/components/MenuOption/MenuOption.stories.d.ts +16 -0
- package/lib/components/MiniModal/MiniModal.stories.d.ts +10 -0
- package/lib/components/Modal/Modal.stories.d.ts +7 -0
- package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
- package/lib/components/MultiSelect/MultiSelect.stories.d.ts +11 -0
- package/lib/components/NLPInput/NlpInput.stories.d.ts +7 -0
- package/lib/components/NLPInput/type.d.ts +70 -0
- package/lib/components/Paper/Paper.stories.d.ts +11 -0
- package/lib/components/RadioButton/RadioButton.stories.d.ts +10 -0
- package/lib/components/RadioGroup/RadioGroup.stories.d.ts +9 -0
- package/lib/components/Search/Search.stories.d.ts +6 -0
- package/lib/components/Select/Select.stories.d.ts +14 -0
- package/lib/components/Select/components/Dropdown/Dropdown.d.ts +4 -0
- package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +17 -0
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.d.ts +6 -0
- package/lib/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/AddBrowserModal/types.d.ts +3 -0
- package/lib/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/DatasetListModal/types.d.ts +3 -0
- package/lib/components/StateDropdown/StateDropdown.stories.d.ts +10 -0
- package/lib/components/StatusButton/StatusButton.stories.d.ts +14 -0
- package/lib/components/StatusCard/StatusCard.d.ts +1 -1
- package/lib/components/StatusCard/StatusCard.stories.d.ts +11 -0
- package/lib/components/StatusCard/types.d.ts +1 -1
- package/lib/components/Table/Table.stories.d.ts +13 -0
- package/lib/components/TableTree/Components/TableCell.d.ts +1 -1
- package/lib/components/TableTree/Components/TableRow.d.ts +1 -1
- package/lib/components/TableTree/TableTree.stories.d.ts +7 -0
- package/lib/components/TableTree/types.d.ts +2 -0
- package/lib/components/Tabs/Tabs.stories.d.ts +9 -0
- package/lib/components/TextArea/Textarea.stories.d.ts +9 -0
- package/lib/components/Toast/Toast.stories.d.ts +6 -0
- package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
- package/lib/components/Toggle/Toggle.stories.d.ts +12 -0
- package/lib/components/Tooltip/Tooltip.stories.d.ts +15 -0
- package/lib/components/Typography/Typography.stories.d.ts +10 -0
- package/lib/components/VariableInput/VariableInput.stories.d.ts +6 -0
- package/lib/index.d.ts +23 -10
- package/lib/index.esm.js +1287 -1064
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1287 -1064
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +6 -0
- package/lib/utils/compareArrays/compareArrays.stories.d.ts +6 -0
- package/lib/utils/compareObjects/compareObjects.stories.d.ts +6 -0
- package/lib/utils/debounce/debounce.stories.d.ts +6 -0
- package/lib/utils/ffID/ffID.stories.d.ts +6 -0
- package/lib/utils/find/findAndInsert.d.ts +7 -0
- package/lib/utils/find/findAndInsert.stories.d.ts +7 -0
- package/lib/utils/findAndInsert/findAndInsert.stories.d.ts +7 -0
- package/lib/utils/getEncryptedData/getEncryptedData.stories.d.ts +6 -0
- package/lib/utils/getExtension/getExtension.stories.d.ts +6 -0
- package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
- package/lib/utils/throttle/throttle.stories.d.ts +6 -0
- package/lib/utils/truncateText/truncateText.stories.d.ts +6 -0
- package/package.json +1 -1
- package/src/assets/Themes/BaseTheme.scss +32 -11
- package/src/assets/Themes/BlueTheme.scss +3 -0
- package/src/assets/Themes/DarkTheme.scss +32 -13
- package/src/assets/icons/approval_pending.svg +8 -8
- package/src/assets/icons/close_defects_icon.svg +12 -0
- package/src/assets/icons/configuration.svg +3 -3
- package/src/assets/icons/defect_density_icon.svg +12 -0
- package/src/assets/icons/defects.svg +8 -8
- package/src/assets/icons/element.svg +4 -4
- package/src/assets/icons/open_defects_icon.svg +12 -0
- package/src/assets/icons/project_element.svg +4 -4
- package/src/assets/icons/quality_score_icon.svg +12 -0
- package/src/assets/icons/sause_lab_icon.svg +3 -0
- package/src/assets/icons/step_group.svg +10 -10
- package/src/assets/icons/total_defects_status_icon.svg +13 -0
- package/src/assets/icons/variable.svg +3 -3
- package/src/assets/icons/web_service_icon.svg +3 -3
- package/src/components/Accordion/Accordion.stories.tsx +14 -4
- package/src/components/Accordion/Accordion.tsx +22 -11
- package/src/components/Accordion/types.ts +14 -6
- package/src/components/AppHeader/AppHeader.tsx +1 -1
- package/src/components/AppHeader/types.ts +1 -1
- package/src/components/Charts/BarChart/BarChart.scss +1 -0
- package/src/components/Charts/BarChart/BarChart.stories.tsx +91 -1
- package/src/components/Charts/BarChart/BarChart.tsx +91 -86
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +2 -0
- package/src/components/Charts/IconRadialChart/IconRadialChart.stories.tsx +1 -0
- package/src/components/Charts/IconRadialChart/IconRadialChart.tsx +2 -1
- package/src/components/Charts/IconRadialChart/types.ts +4 -3
- package/src/components/Charts/LineChart/LineChart.stories.tsx +3 -2
- package/src/components/Charts/LineChart/LineChart.tsx +7 -3
- package/src/components/Charts/LineChart/types.ts +1 -0
- package/src/components/Charts/MultiRadialChart/MultiRadialChart.scss +1 -0
- package/src/components/Charts/MultiRadialChart/MultiRadialChart.stories.tsx +53 -6
- package/src/components/Charts/MultiRadialChart/MultiRadialChart.tsx +74 -34
- package/src/components/Charts/MultiRadialChart/types.ts +5 -4
- package/src/components/Checkbox/Checkbox.scss +4 -5
- package/src/components/Checkbox/Checkbox.stories.tsx +40 -10
- package/src/components/Icon/iconList.ts +14 -0
- package/src/components/StatusCard/StatusCard.scss +56 -93
- package/src/components/StatusCard/StatusCard.stories.tsx +77 -4
- package/src/components/StatusCard/StatusCard.tsx +89 -35
- package/src/components/StatusCard/types.ts +1 -1
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/TableTree/Components/TableBody.tsx +2 -1
- package/src/components/TableTree/Components/TableCell.tsx +29 -18
- package/src/components/TableTree/Components/TableRow.tsx +2 -0
- package/src/components/TableTree/types.ts +2 -0
- package/src/components/TextArea/Textarea.scss +6 -7
- package/src/utils/handleTreeNodeSelect/handleTreeNodeSelect.ts +0 -3
@@ -1,8 +1,8 @@
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
2
|
-
import './StatusCard.scss';
|
3
2
|
import { CardProps } from './types';
|
4
3
|
import Typography from '../Typography';
|
5
4
|
import Icon from '../Icon';
|
5
|
+
import './StatusCard.scss';
|
6
6
|
|
7
7
|
const StatusCard: React.FC<CardProps> = ({
|
8
8
|
icon,
|
@@ -15,7 +15,22 @@ const StatusCard: React.FC<CardProps> = ({
|
|
15
15
|
}) => {
|
16
16
|
const [isToggled, setIsToggled] = useState<boolean>(false);
|
17
17
|
|
18
|
+
const hideStatusText = [
|
19
|
+
'total defects',
|
20
|
+
'defect density',
|
21
|
+
'open defects',
|
22
|
+
'closed defects',
|
23
|
+
'quality score',
|
24
|
+
];
|
25
|
+
|
26
|
+
const swapCountAndText = hideStatusText.includes(status.toLowerCase());
|
27
|
+
|
28
|
+
const redBackground = hideStatusText.includes(status.toLowerCase());
|
29
|
+
|
18
30
|
const handleSelectStatus = (status: string) => {
|
31
|
+
if (hideStatusText.includes(status.toLowerCase())) {
|
32
|
+
return;
|
33
|
+
}
|
19
34
|
setIsToggled(true);
|
20
35
|
onSelectedStatus(status);
|
21
36
|
};
|
@@ -26,10 +41,27 @@ const StatusCard: React.FC<CardProps> = ({
|
|
26
41
|
}
|
27
42
|
}, [resetToggle]);
|
28
43
|
|
44
|
+
const handleStaticCard = () => {
|
45
|
+
if (status.toLowerCase() === 'defect density') {
|
46
|
+
return (
|
47
|
+
<>
|
48
|
+
{count.toString().padStart(2, '0')}
|
49
|
+
<Typography fontSize="15px" fontWeight="semi-bold">
|
50
|
+
/ Modules
|
51
|
+
</Typography>
|
52
|
+
</>
|
53
|
+
);
|
54
|
+
} else if (status.toLowerCase() === 'quality score') {
|
55
|
+
return `${parseFloat(count.toString()).toFixed(2)}%`;
|
56
|
+
} else {
|
57
|
+
return count.toString().padStart(2, '0');
|
58
|
+
}
|
59
|
+
};
|
60
|
+
|
29
61
|
return (
|
30
62
|
<div
|
31
63
|
className={`ff-card-container ${status.toLowerCase()} ${
|
32
|
-
isToggled ?
|
64
|
+
isToggled ? 'toggled' : ''
|
33
65
|
}`}
|
34
66
|
style={style}
|
35
67
|
onClick={() => handleSelectStatus(status)}
|
@@ -38,40 +70,62 @@ const StatusCard: React.FC<CardProps> = ({
|
|
38
70
|
<div>
|
39
71
|
<Icon name={icon} height={20} width={20} hoverEffect={false} />
|
40
72
|
</div>
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
73
|
+
{!hideStatusText.includes(status.toLowerCase()) && (
|
74
|
+
<Typography
|
75
|
+
fontWeight="semi-bold"
|
76
|
+
fontSize="10px"
|
77
|
+
textAlign="center"
|
78
|
+
lineHeight="15px"
|
79
|
+
className="ff-status-text"
|
80
|
+
as="div"
|
81
|
+
>
|
82
|
+
{status.charAt(0).toUpperCase() + status.slice(1).toLowerCase()}
|
83
|
+
</Typography>
|
84
|
+
)}
|
51
85
|
</div>
|
52
|
-
<div className=
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
86
|
+
<div className={`ff-content ${redBackground ? 'red-background' : ''}`}>
|
87
|
+
{swapCountAndText ? (
|
88
|
+
<>
|
89
|
+
<Typography
|
90
|
+
fontWeight="semi-bold"
|
91
|
+
fontSize="10px"
|
92
|
+
className="ff-text"
|
93
|
+
lineHeight="15px"
|
94
|
+
color='var(--ff-chip-text-color)'
|
95
|
+
>
|
96
|
+
{text}
|
97
|
+
</Typography>
|
98
|
+
<Typography
|
99
|
+
fontWeight="semi-bold"
|
100
|
+
fontSize="24px"
|
101
|
+
className="ff-number"
|
102
|
+
lineHeight="36px"
|
103
|
+
>
|
104
|
+
{handleStaticCard()}
|
105
|
+
</Typography>
|
106
|
+
</>
|
107
|
+
) : (
|
108
|
+
<>
|
109
|
+
<Typography
|
110
|
+
fontWeight="semi-bold"
|
111
|
+
fontSize="24px"
|
112
|
+
className="ff-number"
|
113
|
+
lineHeight="24px"
|
114
|
+
color={isToggled ? 'var(--base-bg-color)' : ''}
|
115
|
+
>
|
116
|
+
{count.toString().padStart(2, '0')}
|
117
|
+
</Typography>
|
118
|
+
<Typography
|
119
|
+
className="ff-text"
|
120
|
+
lineHeight="18px"
|
121
|
+
color={
|
122
|
+
isToggled ? 'var(--base-bg-color)' : 'var(--ff-chip-text-color)'
|
123
|
+
}
|
124
|
+
>
|
125
|
+
{text}
|
126
|
+
</Typography>
|
127
|
+
</>
|
128
|
+
)}
|
75
129
|
</div>
|
76
130
|
</div>
|
77
131
|
);
|
@@ -2,7 +2,7 @@ export interface CardProps {
|
|
2
2
|
/** The icon to display in the card */
|
3
3
|
icon: string;
|
4
4
|
/** The status of the card (Passed, Failed, Warning, Skipped, Flaky) */
|
5
|
-
status: 'Passed' | 'Failed' | 'Warning' | 'Skipped' | 'Flaky' | '
|
5
|
+
status: 'Passed' | 'Failed' | 'Warning' | 'Skipped' | 'Flaky' | 'Total Defects' | 'Defect Density' | 'Open Defects' | 'Closed Defects' | 'Quality Score';
|
6
6
|
/** The number displayed in the card */
|
7
7
|
count: number | string;
|
8
8
|
/** The description text displayed at the bottom of the card */
|
@@ -31,7 +31,7 @@ const SortableRow = ({
|
|
31
31
|
}: any) => {
|
32
32
|
const { attributes, listeners, setNodeRef, transform, transition } =
|
33
33
|
useSortable({
|
34
|
-
id: row
|
34
|
+
id: row?._id || row?.id,
|
35
35
|
disabled: row.disabled,
|
36
36
|
});
|
37
37
|
|
@@ -242,4 +242,4 @@ const Table = ({
|
|
242
242
|
);
|
243
243
|
};
|
244
244
|
|
245
|
-
export default Table;
|
245
|
+
export default Table;
|
@@ -19,7 +19,7 @@ const TableBody = React.memo(
|
|
19
19
|
{flattenedTreeData?.map((node, index) => {
|
20
20
|
return (
|
21
21
|
<TableRow
|
22
|
-
key={node.
|
22
|
+
key={node.key}
|
23
23
|
node={node}
|
24
24
|
columnsData={columnsData}
|
25
25
|
selected={selected}
|
@@ -27,6 +27,7 @@ const TableBody = React.memo(
|
|
27
27
|
onRowClick={onRowClick}
|
28
28
|
onToggleExpand={(node) => onToggleExpand(node, index)}
|
29
29
|
onCheckBoxChange={onCheckBoxChange}
|
30
|
+
index={index}
|
30
31
|
/>
|
31
32
|
);
|
32
33
|
})}
|
@@ -5,6 +5,7 @@ import { TableCellProps } from '../types';
|
|
5
5
|
import Arrow from '../../../assets/icons/arrows_down_icon.svg?react';
|
6
6
|
import React from 'react';
|
7
7
|
import { checkEmpty } from '../../../utils/checkEmpty/checkEmpty';
|
8
|
+
import LabelEditTextField from '../../LabelEditTextField';
|
8
9
|
|
9
10
|
const renderSpaces = (
|
10
11
|
level: number,
|
@@ -43,6 +44,7 @@ const TableCell = React.memo(
|
|
43
44
|
select,
|
44
45
|
onCheckBoxChange,
|
45
46
|
onToggleExpand,
|
47
|
+
index,
|
46
48
|
}: TableCellProps) => (
|
47
49
|
<td className={`${col.isTree && node.folder ? 'folder' : ''}`}>
|
48
50
|
{col.isTree &&
|
@@ -69,28 +71,37 @@ const TableCell = React.memo(
|
|
69
71
|
col.isTree && node.folder ? 'folder' : ''
|
70
72
|
}`}
|
71
73
|
>
|
72
|
-
{
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
74
|
+
{!node?.showInput && (
|
75
|
+
<>
|
76
|
+
{col.isTree && select === 'checkbox' && (
|
77
|
+
<Checkbox
|
78
|
+
checked={node?.checked || false}
|
79
|
+
partial={node?.checked === 'partial'}
|
80
|
+
onChange={(e) => onCheckBoxChange(e, node)}
|
81
|
+
/>
|
82
|
+
)}
|
83
|
+
{col.isTree && select === 'radio' && (
|
84
|
+
<RadioButton
|
85
|
+
name={node.title}
|
86
|
+
checked={selected.includes(node.id)}
|
87
|
+
value={node.id}
|
88
|
+
onChange={(e) => onCheckBoxChange(e, node)}
|
89
|
+
/>
|
90
|
+
)}
|
91
|
+
</>
|
78
92
|
)}
|
79
|
-
{
|
80
|
-
<
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
/>
|
93
|
+
{node.showInput && col.isTree ? (
|
94
|
+
<LabelEditTextField isOpen={true} />
|
95
|
+
) : (
|
96
|
+
<span className="tree-table-td-content-text">
|
97
|
+
{prepareData(node, col)}
|
98
|
+
</span>
|
86
99
|
)}
|
87
|
-
<span className="tree-table-td-content-text">
|
88
|
-
{prepareData(node, col)}
|
89
|
-
</span>
|
90
100
|
</span>
|
91
101
|
</div>
|
92
|
-
|
93
|
-
|
102
|
+
|
103
|
+
{col.actions && !node?.showInput && (
|
104
|
+
<div className="table-tree-row-action">{col.actions(node, index)}</div>
|
94
105
|
)}
|
95
106
|
</td>
|
96
107
|
)
|
@@ -11,6 +11,7 @@ const TableRow = React.memo(
|
|
11
11
|
onRowClick,
|
12
12
|
onToggleExpand,
|
13
13
|
onCheckBoxChange,
|
14
|
+
index,
|
14
15
|
}: TableRowProps) => (
|
15
16
|
<tr
|
16
17
|
data-level={node.hierarchy}
|
@@ -26,6 +27,7 @@ const TableRow = React.memo(
|
|
26
27
|
select={select}
|
27
28
|
onCheckBoxChange={onCheckBoxChange}
|
28
29
|
onToggleExpand={onToggleExpand}
|
30
|
+
index={index}
|
29
31
|
/>
|
30
32
|
))}
|
31
33
|
</tr>
|
@@ -10,6 +10,7 @@ export interface TableCellProps {
|
|
10
10
|
select: string | null;
|
11
11
|
onCheckBoxChange: (e: any, node: string[] | any) => void;
|
12
12
|
onToggleExpand: (node: any) => void;
|
13
|
+
index: number;
|
13
14
|
}
|
14
15
|
|
15
16
|
export interface TableHeadProps {
|
@@ -34,6 +35,7 @@ export interface TableRowProps {
|
|
34
35
|
onRowClick: (e: any, node: any) => void;
|
35
36
|
onToggleExpand: (node: TreeNode) => void;
|
36
37
|
onCheckBoxChange: (e: any, node: string[] | any) => void;
|
38
|
+
index: number;
|
37
39
|
}
|
38
40
|
|
39
41
|
export interface Column {
|
@@ -23,17 +23,16 @@
|
|
23
23
|
outline: none;
|
24
24
|
line-height: 18px;
|
25
25
|
font-weight: 400;
|
26
|
-
overflow: auto;
|
27
|
-
|
28
|
-
|
29
|
-
}
|
26
|
+
overflow: auto;
|
27
|
+
-ms-overflow-style: none;
|
28
|
+
scrollbar-width: none;
|
30
29
|
|
31
30
|
::-webkit-scrollbar {
|
32
31
|
display: none;
|
33
32
|
}
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
&--resize {
|
34
|
+
resize: none;
|
35
|
+
}
|
37
36
|
|
38
37
|
&:disabled {
|
39
38
|
opacity: 0.5;
|
@@ -47,13 +47,10 @@ export const handleTreeNodeSect = (
|
|
47
47
|
}
|
48
48
|
}
|
49
49
|
|
50
|
-
// Find the target node and update its state
|
51
50
|
const targetNode = nodesMap.get(key);
|
52
51
|
if (targetNode) {
|
53
52
|
targetNode.checked = isChecked;
|
54
|
-
// Update children recursively
|
55
53
|
updateChildren(key, isChecked);
|
56
|
-
// Update parents recursively
|
57
54
|
updateParents(key);
|
58
55
|
}
|
59
56
|
|