pixel-react 1.16.3 → 1.16.4
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/README.md +75 -75
- package/lib/components/Charts/BarChart/BarChart.js +8 -8
- package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.js +6 -6
- package/lib/components/Charts/IconRadialChart/IconRadialChart.js +4 -4
- package/lib/components/Charts/PieChart/PieChart.js +5 -5
- package/lib/components/Comments/Comments.js +14 -14
- package/lib/components/Comments/childComment/ChildComment.js +14 -14
- package/lib/components/EditTextField/EditTextField.js +2 -2
- package/lib/components/LabelEditTextField/LabelEditTextField.js +4 -4
- package/lib/components/StatusIndicator/StatusIndicator.js +5 -5
- package/lib/components/TreeV3/Components/TableBody.d.ts +3 -0
- package/lib/components/TreeV3/Components/TableBody.js +17 -0
- package/lib/components/TreeV3/Components/TableBody.js.map +1 -0
- package/lib/components/TreeV3/Components/TableCell.d.ts +4 -0
- package/lib/components/TreeV3/Components/TableCell.js +89 -0
- package/lib/components/TreeV3/Components/TableCell.js.map +1 -0
- package/lib/components/TreeV3/Components/TableHead.d.ts +4 -0
- package/lib/components/TreeV3/Components/TableHead.js +53 -0
- package/lib/components/TreeV3/Components/TableHead.js.map +1 -0
- package/lib/components/TreeV3/Components/TableRow.d.ts +4 -0
- package/lib/components/TreeV3/Components/TableRow.js +14 -0
- package/lib/components/TreeV3/Components/TableRow.js.map +1 -0
- package/lib/components/TreeV3/TableTreeFn.d.ts +5 -0
- package/lib/components/TreeV3/TableTreeFn.js +724 -0
- package/lib/components/TreeV3/TableTreeFn.js.map +1 -0
- package/lib/components/TreeV3/Utils/TableCell.d.ts +1 -0
- package/lib/components/TreeV3/Utils/TableCell.js +24 -0
- package/lib/components/TreeV3/Utils/TableCell.js.map +1 -0
- package/lib/components/TreeV3/Utils/addLastChild.d.ts +2 -0
- package/lib/components/TreeV3/Utils/addLastChild.js +24 -0
- package/lib/components/TreeV3/Utils/addLastChild.js.map +1 -0
- package/lib/components/TreeV3/Utils/addNewRow.d.ts +14 -0
- package/lib/components/TreeV3/Utils/addNewRow.js +80 -0
- package/lib/components/TreeV3/Utils/addNewRow.js.map +1 -0
- package/lib/components/TreeV3/Utils/formatDataCell.d.ts +2 -0
- package/lib/components/TreeV3/Utils/formatDataCell.js +15 -0
- package/lib/components/TreeV3/Utils/formatDataCell.js.map +1 -0
- package/lib/components/TreeV3/Utils/getAllChildIds.d.ts +2 -0
- package/lib/components/TreeV3/Utils/getAllChildIds.js +12 -0
- package/lib/components/TreeV3/Utils/getAllChildIds.js.map +1 -0
- package/lib/components/TreeV3/Utils/renderSpaces.d.ts +0 -0
- package/lib/components/TreeV3/Utils/renderSpaces.js +2 -0
- package/lib/components/TreeV3/Utils/renderSpaces.js.map +1 -0
- package/lib/components/TreeV3/Utils/updateParentSibling.d.ts +3 -0
- package/lib/components/TreeV3/Utils/updateParentSibling.js +65 -0
- package/lib/components/TreeV3/Utils/updateParentSibling.js.map +1 -0
- package/lib/components/TreeV3/data.d.ts +247 -0
- package/lib/components/TreeV3/data.js +529 -0
- package/lib/components/TreeV3/data.js.map +1 -0
- package/lib/components/TreeV3/index.d.ts +3 -0
- package/lib/components/TreeV3/index.js +4 -0
- package/lib/components/TreeV3/index.js.map +1 -0
- package/lib/components/TreeV3/types.d.ts +170 -0
- package/lib/components/TreeV3/types.js +2 -0
- package/lib/components/TreeV3/types.js.map +1 -0
- package/lib/index.js +7 -7
- package/lib/index.js.map +1 -1
- package/lib/styles.css +1 -1
- package/lib/styles.css.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +106 -106
package/README.md
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: PixelReact UI
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
import { Button, Input } from 'pixel-react';
|
|
6
|
-
|
|
7
|
-
<h1 align="center">PixelReact UI</h1>
|
|
8
|
-
|
|
9
|
-
<p align="center">
|
|
10
|
-
<strong>PixelReact UI</strong> is an open-source React component library, designed to offer a sleek, customizable, and easy-to-use collection of components for building modern user interfaces.
|
|
11
|
-
</p>
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Table of Contents
|
|
16
|
-
|
|
17
|
-
- [Installation](#installation)
|
|
18
|
-
- [Usage](#usage)
|
|
19
|
-
- [Documentation](#documentation)
|
|
20
|
-
- [Contributing](#contributing)
|
|
21
|
-
- [License](#license)
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Installation
|
|
26
|
-
|
|
27
|
-
Install PixelReact UI in your project directory with:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm install pixel-react
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
or with Yarn:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
yarn add pixel-react
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Usage
|
|
40
|
-
|
|
41
|
-
Once installed, you can start importing and using PixelReact components in your React application. Here's a quick example:
|
|
42
|
-
|
|
43
|
-
```jsx
|
|
44
|
-
import { Button } from 'pixel-react';
|
|
45
|
-
|
|
46
|
-
function App() {
|
|
47
|
-
return (
|
|
48
|
-
<div>
|
|
49
|
-
<Button label="Button Label" variant="primary" />
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default App;
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Documentation
|
|
58
|
-
|
|
59
|
-
For detailed documentation and live examples, [click here](https://main--65d5ca6d09c1eaf0731601fc.chromatic.com/).
|
|
60
|
-
|
|
61
|
-
## Example
|
|
62
|
-
|
|
63
|
-
```jsx
|
|
64
|
-
import { Button } from 'pixel-react';
|
|
65
|
-
|
|
66
|
-
function ExampleComponent() {
|
|
67
|
-
return <Button label="Click Me!" variant="primary" />;
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## License
|
|
72
|
-
|
|
73
|
-
PixelReact UI is licensed under the [MIT License](LICENSE). Feel free to use it in your projects, both personal and commercial.
|
|
74
|
-
|
|
75
|
-
---
|
|
1
|
+
---
|
|
2
|
+
title: PixelReact UI
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { Button, Input } from 'pixel-react';
|
|
6
|
+
|
|
7
|
+
<h1 align="center">PixelReact UI</h1>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>PixelReact UI</strong> is an open-source React component library, designed to offer a sleek, customizable, and easy-to-use collection of components for building modern user interfaces.
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Table of Contents
|
|
16
|
+
|
|
17
|
+
- [Installation](#installation)
|
|
18
|
+
- [Usage](#usage)
|
|
19
|
+
- [Documentation](#documentation)
|
|
20
|
+
- [Contributing](#contributing)
|
|
21
|
+
- [License](#license)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
Install PixelReact UI in your project directory with:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install pixel-react
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
or with Yarn:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn add pixel-react
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
Once installed, you can start importing and using PixelReact components in your React application. Here's a quick example:
|
|
42
|
+
|
|
43
|
+
```jsx
|
|
44
|
+
import { Button } from 'pixel-react';
|
|
45
|
+
|
|
46
|
+
function App() {
|
|
47
|
+
return (
|
|
48
|
+
<div>
|
|
49
|
+
<Button label="Button Label" variant="primary" />
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default App;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
For detailed documentation and live examples, [click here](https://main--65d5ca6d09c1eaf0731601fc.chromatic.com/).
|
|
60
|
+
|
|
61
|
+
## Example
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
import { Button } from 'pixel-react';
|
|
65
|
+
|
|
66
|
+
function ExampleComponent() {
|
|
67
|
+
return <Button label="Click Me!" variant="primary" />;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
PixelReact UI is licensed under the [MIT License](LICENSE). Feel free to use it in your projects, both personal and commercial.
|
|
74
|
+
|
|
75
|
+
---
|
|
@@ -118,20 +118,20 @@ const BarChart = ({ data, isYaxisSticky = false, barWidth, height, barGap = 20,
|
|
|
118
118
|
if (tooltip) {
|
|
119
119
|
tooltip.style.display = 'block';
|
|
120
120
|
if (customToolTip) {
|
|
121
|
-
tooltip.innerHTML = `<div>
|
|
122
|
-
<div><Typography fontWeight='semi-bold'>${label}</Typography></div>
|
|
123
|
-
<div><Typography>${id ? id : ''}</Typography></div>
|
|
124
|
-
<div><Typography>${totalLabel} : ${value} ${percent ? '(' + percent + '%)' : ''}</Typography></div>
|
|
121
|
+
tooltip.innerHTML = `<div>
|
|
122
|
+
<div><Typography fontWeight='semi-bold'>${label}</Typography></div>
|
|
123
|
+
<div><Typography>${id ? id : ''}</Typography></div>
|
|
124
|
+
<div><Typography>${totalLabel} : ${value} ${percent ? '(' + percent + '%)' : ''}</Typography></div>
|
|
125
125
|
</div>`;
|
|
126
126
|
}
|
|
127
127
|
else if (isDashboardVersions) {
|
|
128
128
|
const versionsList = versions ? versions.join(', ') : '';
|
|
129
|
-
tooltip.innerHTML = `
|
|
130
|
-
<div>
|
|
131
|
-
<div><Typography>${totalLabel} : ${value}</Typography></div>
|
|
129
|
+
tooltip.innerHTML = `
|
|
130
|
+
<div>
|
|
131
|
+
<div><Typography>${totalLabel} : ${value}</Typography></div>
|
|
132
132
|
${versionsList
|
|
133
133
|
? `<div><Typography>Versions : ${versionsList}</Typography></div>`
|
|
134
|
-
: ''}
|
|
134
|
+
: ''}
|
|
135
135
|
</div>`;
|
|
136
136
|
}
|
|
137
137
|
else {
|
|
@@ -47,12 +47,12 @@ const calculateDonutSegmentBorderPath = (innerR, outerR, startAngle, endAngle) =
|
|
|
47
47
|
const startInnerX = outerR * Math.cos(startAngle);
|
|
48
48
|
const startInnerY = outerR * Math.sin(startAngle);
|
|
49
49
|
const largeArcFlag = endAngle - startAngle > Math.PI ? 1 : 0;
|
|
50
|
-
return `
|
|
51
|
-
M ${startOuterX} ${startOuterY}
|
|
52
|
-
A ${innerR} ${innerR} 0 ${largeArcFlag} 1 ${endOuterX} ${endOuterY}
|
|
53
|
-
L ${endInnerX} ${endInnerY}
|
|
54
|
-
A ${outerR} ${outerR} 0 ${largeArcFlag} 0 ${startInnerX} ${startInnerY}
|
|
55
|
-
Z
|
|
50
|
+
return `
|
|
51
|
+
M ${startOuterX} ${startOuterY}
|
|
52
|
+
A ${innerR} ${innerR} 0 ${largeArcFlag} 1 ${endOuterX} ${endOuterY}
|
|
53
|
+
L ${endInnerX} ${endInnerY}
|
|
54
|
+
A ${outerR} ${outerR} 0 ${largeArcFlag} 0 ${startInnerX} ${startInnerY}
|
|
55
|
+
Z
|
|
56
56
|
`;
|
|
57
57
|
};
|
|
58
58
|
const colorMapping = [
|
|
@@ -12,10 +12,10 @@ const calculateArc = ({ x, y, radius, startAngle, endAngle, }) => {
|
|
|
12
12
|
const largeArcFlag = endAngle - startAngle > Math.PI ? 1 : 0;
|
|
13
13
|
if (endAngle - startAngle >= 2 * Math.PI) {
|
|
14
14
|
// Special case for a full circle
|
|
15
|
-
return `
|
|
16
|
-
M ${x + radius} ${y}
|
|
17
|
-
A ${radius} ${radius} 0 1 1 ${x - radius} ${y}
|
|
18
|
-
A ${radius} ${radius} 0 1 1 ${x + radius} ${y}
|
|
15
|
+
return `
|
|
16
|
+
M ${x + radius} ${y}
|
|
17
|
+
A ${radius} ${radius} 0 1 1 ${x - radius} ${y}
|
|
18
|
+
A ${radius} ${radius} 0 1 1 ${x + radius} ${y}
|
|
19
19
|
`;
|
|
20
20
|
}
|
|
21
21
|
return `M ${startX} ${startY} A ${radius} ${radius} 0 ${largeArcFlag} 1 ${endX} ${endY}`;
|
|
@@ -24,11 +24,11 @@ const calculateArcAngles = (value, total, currentAngle, radius) => {
|
|
|
24
24
|
const startAngle = currentAngle;
|
|
25
25
|
const endAngle = startAngle + angleIncrement;
|
|
26
26
|
if (percentage === 1) {
|
|
27
|
-
const path = `
|
|
28
|
-
M ${radius} 0
|
|
29
|
-
A ${radius} ${radius} 0 1 1 ${-radius} 0
|
|
30
|
-
A ${radius} ${radius} 0 1 1 ${radius} 0
|
|
31
|
-
Z
|
|
27
|
+
const path = `
|
|
28
|
+
M ${radius} 0
|
|
29
|
+
A ${radius} ${radius} 0 1 1 ${-radius} 0
|
|
30
|
+
A ${radius} ${radius} 0 1 1 ${radius} 0
|
|
31
|
+
Z
|
|
32
32
|
`;
|
|
33
33
|
return {
|
|
34
34
|
endAngle,
|
|
@@ -136,20 +136,20 @@ const Comments = ({ commentsData, handleAddComment, handleEditComment, handleDel
|
|
|
136
136
|
const getCaretCoordinates = (element, position) => {
|
|
137
137
|
const div = document.createElement('div');
|
|
138
138
|
const copyStyle = getComputedStyle(element);
|
|
139
|
-
div.style.cssText = `
|
|
140
|
-
position: absolute;
|
|
141
|
-
visibility: hidden;
|
|
142
|
-
white-space: pre-wrap;
|
|
143
|
-
word-wrap: break-word;
|
|
144
|
-
overflow: auto;
|
|
145
|
-
width: ${element.offsetWidth}px;
|
|
146
|
-
height: ${element.offsetHeight}px;
|
|
147
|
-
font-family: ${copyStyle.fontFamily};
|
|
148
|
-
font-size: ${copyStyle.fontSize};
|
|
149
|
-
padding: ${copyStyle.padding};
|
|
150
|
-
border: ${copyStyle.border};
|
|
151
|
-
box-sizing: ${copyStyle.boxSizing};
|
|
152
|
-
line-height: ${copyStyle.lineHeight};
|
|
139
|
+
div.style.cssText = `
|
|
140
|
+
position: absolute;
|
|
141
|
+
visibility: hidden;
|
|
142
|
+
white-space: pre-wrap;
|
|
143
|
+
word-wrap: break-word;
|
|
144
|
+
overflow: auto;
|
|
145
|
+
width: ${element.offsetWidth}px;
|
|
146
|
+
height: ${element.offsetHeight}px;
|
|
147
|
+
font-family: ${copyStyle.fontFamily};
|
|
148
|
+
font-size: ${copyStyle.fontSize};
|
|
149
|
+
padding: ${copyStyle.padding};
|
|
150
|
+
border: ${copyStyle.border};
|
|
151
|
+
box-sizing: ${copyStyle.boxSizing};
|
|
152
|
+
line-height: ${copyStyle.lineHeight};
|
|
153
153
|
`;
|
|
154
154
|
div.scrollTop = element.scrollTop;
|
|
155
155
|
div.scrollLeft = element.scrollLeft;
|
|
@@ -93,20 +93,20 @@ const ChildComment = ({ handleInsertNode, handleEditNode, handleDeleteNode, comm
|
|
|
93
93
|
const getCaretCoordinates = (element, position) => {
|
|
94
94
|
const div = document.createElement('div');
|
|
95
95
|
const copyStyle = getComputedStyle(element);
|
|
96
|
-
div.style.cssText = `
|
|
97
|
-
position: absolute;
|
|
98
|
-
visibility: hidden;
|
|
99
|
-
white-space: pre-wrap;
|
|
100
|
-
word-wrap: break-word;
|
|
101
|
-
overflow: auto;
|
|
102
|
-
width: ${element.offsetWidth}px;
|
|
103
|
-
height: ${element.offsetHeight}px;
|
|
104
|
-
font-family: ${copyStyle.fontFamily};
|
|
105
|
-
font-size: ${copyStyle.fontSize};
|
|
106
|
-
padding: ${copyStyle.padding};
|
|
107
|
-
border: ${copyStyle.border};
|
|
108
|
-
box-sizing: ${copyStyle.boxSizing};
|
|
109
|
-
line-height: ${copyStyle.lineHeight};
|
|
96
|
+
div.style.cssText = `
|
|
97
|
+
position: absolute;
|
|
98
|
+
visibility: hidden;
|
|
99
|
+
white-space: pre-wrap;
|
|
100
|
+
word-wrap: break-word;
|
|
101
|
+
overflow: auto;
|
|
102
|
+
width: ${element.offsetWidth}px;
|
|
103
|
+
height: ${element.offsetHeight}px;
|
|
104
|
+
font-family: ${copyStyle.fontFamily};
|
|
105
|
+
font-size: ${copyStyle.fontSize};
|
|
106
|
+
padding: ${copyStyle.padding};
|
|
107
|
+
border: ${copyStyle.border};
|
|
108
|
+
box-sizing: ${copyStyle.boxSizing};
|
|
109
|
+
line-height: ${copyStyle.lineHeight};
|
|
110
110
|
`;
|
|
111
111
|
div.scrollTop = element.scrollTop;
|
|
112
112
|
div.scrollLeft = element.scrollLeft;
|
|
@@ -77,8 +77,8 @@ isOpen = false, confirmAction, onClick, nameTooltipTitle, }) => {
|
|
|
77
77
|
{ key: 'Enter', action: () => handleKeyBoard('Enter') },
|
|
78
78
|
{ key: 'Escape', action: () => handleKeyBoard('Escape') },
|
|
79
79
|
], containerRef);
|
|
80
|
-
return (_jsxs("div", { className: "ff-label-edit-text-field", ref: containerRef, children: [isEditing ? (_jsxs("div", { className: "ff-label-text-field", children: [_jsx("div", { className: "ff-label-text-field-without-dropdown", children: _jsx(Input, { name: "input", label: label ? label : '', disabled: false, error: isThrowingError, placeholder: "Enter your name", value: inputValue, onChange: handleTextFieldChange, className: `
|
|
81
|
-
|
|
80
|
+
return (_jsxs("div", { className: "ff-label-edit-text-field", ref: containerRef, children: [isEditing ? (_jsxs("div", { className: "ff-label-text-field", children: [_jsx("div", { className: "ff-label-text-field-without-dropdown", children: _jsx(Input, { name: "input", label: label ? label : '', disabled: false, error: isThrowingError, placeholder: "Enter your name", value: inputValue, onChange: handleTextFieldChange, className: `
|
|
81
|
+
|
|
82
82
|
${isTextFieldModified ? 'modified' : ''}`, type: "text" }) }), _jsxs("div", { className: "ff-icon-container", children: [confirmIcon && (_jsx(Tooltip, { title: "confirm", placement: 'bottom', children: _jsx(Icon, { color: confirmIcon?.color ?? 'var(--default-confirm-icon-color)', height: confirmIcon?.height ?? 20, disabled: disabled, width: confirmIcon?.width ?? 20, name: confirmIcon?.name ?? 'default-confirm-icon', className: `${confirmIcon?.className ?? 'default-confirm-class'} ${disabled ? 'disabled-confirm-icon' : 'confirm-icon'}`, onClick: handleConfirm }) })), cancelIcon && (_jsx(Tooltip, { title: "cancel", placement: 'bottom', children: _jsx(Icon, { color: cancelIcon?.color ?? 'var(--label-edit-cancel-icon)', height: cancelIcon?.height ?? 12, width: cancelIcon?.width ?? 20, name: cancelIcon?.name ?? 'default-cancel-icon', className: cancelIcon?.className ?? 'cancel-icon', onClick: handleCancel, ref: cancelRef }) }))] })] })) : (_jsxs("div", { className: "display-text-container", children: [nameTooltipTitle ? (_jsx(Tooltip, { title: nameTooltipTitle, children: _jsx("span", { className: "display-text", onClick: onClick, children: _jsx(HighlightText, { text: inputValue, highlight: highlightText }) }) })) : (_jsx("span", { className: "display-text", onClick: onClick, children: _jsx(HighlightText, { text: inputValue, highlight: highlightText }) })), _jsx(Tooltip, { title: capitalize(editIcon?.name ?? 'Edit'), children: _jsx(Icon, { color: editIcon?.color ?? 'var(--label-edit-cancel-icon)', height: editIcon?.height ?? 20, width: editIcon?.width ?? 20, name: editIcon?.name ?? 'edit', className: editIcon?.className ?? 'edit-icon', onClick: handleEditButtonClick }) })] })), showError && isEditing && (_jsx(Typography, { as: "p", fontSize: 8, className: "error-text", children: showError }))] }));
|
|
83
83
|
};
|
|
84
84
|
export default EditTextField;
|
|
@@ -158,10 +158,10 @@ className, height, isOpen = false, confirmAction, onClick, tooltip, onDoubleClic
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
useKeyboardActions([{ key: 'Enter', action: () => handleKeyBoard('Enter') }], containerRef);
|
|
161
|
-
return (_jsxs("div", { className: "ff-label-edit-text-field", ref: containerRef, children: [isEditing ? (_jsxs("div", { className: "ff-label-text-field", children: [variant === 'textFieldWithDropdown' ? (_jsxs("div", { className: `ff-label-text-field-with-dropdown ${isEditing ? 'open' : ''}`, style: { height }, children: [_jsx(Input, { name: "input", type: "text", label: label ? label : '', disabled: false, error: isThrowingError, placeholder: placeholder ? placeholder : '', value: inputValue, onChange: handleTextFieldChange, className: `${className}
|
|
162
|
-
|
|
163
|
-
${isTextFieldModified ? 'modified' : ''}` }), _jsx(Select, { label: '', optionsList: dropdownData, selectedOption: { value: dropdownValue, label: dropdownValue }, onChange: (option) => setDropdownValue(option.value) })] })) : (_jsx("div", { className: "ff-label-text-field-without-dropdown", children: _jsx(Input, { name: "input", type: "text", label: label ? label : '', disabled: false, error: isThrowingError, placeholder: placeholder ? placeholder : '', value: inputValue, onChange: handleTextFieldChange, className: `${className}
|
|
164
|
-
|
|
161
|
+
return (_jsxs("div", { className: "ff-label-edit-text-field", ref: containerRef, children: [isEditing ? (_jsxs("div", { className: "ff-label-text-field", children: [variant === 'textFieldWithDropdown' ? (_jsxs("div", { className: `ff-label-text-field-with-dropdown ${isEditing ? 'open' : ''}`, style: { height }, children: [_jsx(Input, { name: "input", type: "text", label: label ? label : '', disabled: false, error: isThrowingError, placeholder: placeholder ? placeholder : '', value: inputValue, onChange: handleTextFieldChange, className: `${className}
|
|
162
|
+
|
|
163
|
+
${isTextFieldModified ? 'modified' : ''}` }), _jsx(Select, { label: '', optionsList: dropdownData, selectedOption: { value: dropdownValue, label: dropdownValue }, onChange: (option) => setDropdownValue(option.value) })] })) : (_jsx("div", { className: "ff-label-text-field-without-dropdown", children: _jsx(Input, { name: "input", type: "text", label: label ? label : '', disabled: false, error: isThrowingError, placeholder: placeholder ? placeholder : '', value: inputValue, onChange: handleTextFieldChange, className: `${className}
|
|
164
|
+
|
|
165
165
|
${isTextFieldModified ? 'modified' : ''}` }) })), _jsxs("div", { className: "ff-icon-container", children: [confirmIcon && (_jsx(Tooltip, { title: "Confirm", placement: 'bottom', children: _jsx(Icon, { color: "var(--label-edit-confirm-icon)", height: 20, width: 20, name: confirmIcon.name, disabled: disabled, className: `${disabled ? 'disabled-confirm-icon' : 'confirm-icon'}`, onClick: handleConfirm }) })), cancelIcon && (_jsx(Tooltip, { title: "Cancel", placement: 'bottom', children: _jsx(Icon, { color: "var(--label-edit-cancel-icon)", height: 12, width: 20, name: cancelIcon.name, className: "cancel-icon", onClick: handleCancel, ref: cancelRef }) }))] })] })) : (_jsx(Tooltip, { title: tooltip?.tooltipTitle ? tooltip?.tooltipTitle : '', placement: 'bottom', children: showText && (_jsx("span", { className: "display-text", onDoubleClick: handleDoubleClick, role: "button", onClick: handleClick, children: _jsx(HighlightText, { text: inputValue, highlight: highlightText }) })) })), showError && isEditing && (_jsx(Typography, { as: "p", fontSize: 8, className: "error-text", children: showError }))] }));
|
|
166
166
|
};
|
|
167
167
|
export default LabelEditTextField;
|
|
@@ -11,15 +11,15 @@ const StatusIndicator = forwardRef(({ label = 'Status', iconName = 'update_icon'
|
|
|
11
11
|
danger: 'var(--ff-delete-button-attachment)',
|
|
12
12
|
};
|
|
13
13
|
const iconColor = variantColorMap[variant] || variantColorMap.default;
|
|
14
|
-
return (_jsx("button", { disabled: isDisable, onClick: onClick, className: `
|
|
15
|
-
ff-status-indicator
|
|
16
|
-
ff-status-indicator--${variant}
|
|
14
|
+
return (_jsx("button", { disabled: isDisable, onClick: onClick, className: `
|
|
15
|
+
ff-status-indicator
|
|
16
|
+
ff-status-indicator--${variant}
|
|
17
17
|
${backgroundColor
|
|
18
18
|
? `ff-status-indicator--with-bg ff-status-indicator--${variant}-bg`
|
|
19
|
-
: ''}
|
|
19
|
+
: ''}
|
|
20
20
|
${border
|
|
21
21
|
? `ff-status-indicator--with-border ff-status-indicator--${variant}-border`
|
|
22
|
-
: ''}
|
|
22
|
+
: ''}
|
|
23
23
|
`, ref: ref, children: _jsxs("div", { className: "ff-status-indicator__content", children: [_jsx(Icon, { name: resolvedIconName, color: iconColor, className: `ff-status-indicator__icon ff-status-indicator__icon--${variant}` }), _jsx(Typography, { as: "div", fontSize: 12, className: `ff-status-indicator__label ff-status-indicator__label--${variant}`, fontWeight: "medium", lineHeight: "20px", children: label })] }) }));
|
|
24
24
|
});
|
|
25
25
|
export default StatusIndicator;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TableBodyProps } from '../types';
|
|
2
|
+
declare const TableBody: ({ flattenedTreeData, columnsData, columnMeta, rowHeight, startIndex, totalHeight, selected, select, onRowClick, onToggleExpand, onCheckBoxChange, onAddConfirm, onAddCancel, handleEditFieldError, expanding, selectedNode, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, isEditable, setIsEditable, }: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default TableBody;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import TableRow from './TableRow';
|
|
3
|
+
const TableBody = ({ flattenedTreeData, columnsData, columnMeta, rowHeight = 32, startIndex = 0, totalHeight = 0, selected, select, onRowClick, onToggleExpand, onCheckBoxChange, onAddConfirm, onAddCancel, handleEditFieldError, expanding, selectedNode, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, isEditable, setIsEditable, }) => {
|
|
4
|
+
return (_jsx("div", { className: "ff-table-tree-body", style: {
|
|
5
|
+
height: `${totalHeight}px`,
|
|
6
|
+
position: 'relative',
|
|
7
|
+
}, children: flattenedTreeData?.map((node, index) => (_jsx(TableRow, { node: node, columnsData: columnsData, columnMeta: columnMeta, selected: selected, select: select, onRowClick: onRowClick, onToggleExpand: onToggleExpand, onCheckBoxChange: onCheckBoxChange, onAddConfirm: onAddConfirm, onAddCancel: onAddCancel, handleEditFieldError: handleEditFieldError, isExpanding: node.key === expanding, index: startIndex + index, selectedNode: selectedNode, hideOnDisable: hideOnDisable, scriptLengthTruncate: scriptLengthTruncate, addModuleInputWidth: addModuleInputWidth, addModuleSelectWidth: addModuleSelectWidth, disableEditLabelConfirmIcon: disableEditLabelConfirmIcon, isEditable: isEditable, setIsEditable: setIsEditable, style: {
|
|
8
|
+
transform: `translateY(${(startIndex + index) * rowHeight}px)`,
|
|
9
|
+
height: `${rowHeight}px`,
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
top: 0,
|
|
12
|
+
left: 0,
|
|
13
|
+
right: 0,
|
|
14
|
+
} }, node.key))) }));
|
|
15
|
+
};
|
|
16
|
+
export default TableBody;
|
|
17
|
+
//# sourceMappingURL=TableBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../../src/components/TreeV3/Components/TableBody.tsx"],"names":[],"mappings":";AACA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,SAAS,GAAG,CAAC,EACjB,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,SAAS,GAAG,EAAE,EACd,UAAU,GAAG,CAAC,EACd,WAAW,GAAG,CAAC,EACf,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,UAAU,EACV,aAAa,GACE,EAAE,EAAE;IACnB,OAAO,CACL,cACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE;YACL,MAAM,EAAE,GAAG,WAAW,IAAI;YAC1B,QAAQ,EAAE,UAAU;SACrB,YAEA,iBAAiB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACvC,KAAC,QAAQ,IAEP,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,EAC1C,WAAW,EAAE,IAAI,CAAC,GAAG,KAAK,SAAS,EACnC,KAAK,EAAE,UAAU,GAAG,KAAK,EACzB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,mBAAmB,EACxC,oBAAoB,EAAE,oBAAoB,EAC1C,2BAA2B,EAAE,2BAA2B,EACxD,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE;gBACL,SAAS,EAAE,cAAc,CAAC,UAAU,GAAG,KAAK,CAAC,GAAG,SAAS,KAAK;gBAC9D,MAAM,EAAE,GAAG,SAAS,IAAI;gBACxB,QAAQ,EAAE,UAAU;gBACpB,GAAG,EAAE,CAAC;gBACN,IAAI,EAAE,CAAC;gBACP,KAAK,EAAE,CAAC;aACT,IA7BI,IAAI,CAAC,GAAG,CA8Bb,CACH,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TableCellProps } from '../types';
|
|
3
|
+
declare const TableCell: React.MemoExoticComponent<({ treeRowRef, col, colIndex, columnMeta, node, selected, select, onCheckBoxChange, onToggleExpand, onAddConfirm, onAddCancel, handleEditFieldError, isExpanding, columnTextColor, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, isEditable, setIsEditable, }: TableCellProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
+
export default TableCell;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { formatCellData } from '../Utils/formatDataCell';
|
|
4
|
+
import { prepareData } from '../Utils/TableCell';
|
|
5
|
+
import { checkEmpty } from '../../../utils/checkEmpty/checkEmpty';
|
|
6
|
+
import Tooltip from '../../Tooltip';
|
|
7
|
+
import Checkbox from '../../Checkbox';
|
|
8
|
+
import RadioButton from '../../RadioButton';
|
|
9
|
+
import AddModule from '../../EditLabel';
|
|
10
|
+
import Arrow from '../../../assets/icons/arrows_down_icon.svg?react';
|
|
11
|
+
import Spinner from '../../../assets/icons/spinner.svg?react';
|
|
12
|
+
const renderSpaces = (level, parentSiblings = [], isLast, nextSibling, isContainer) => {
|
|
13
|
+
let siblingsArray = parentSiblings;
|
|
14
|
+
const isLastNode = nextSibling !== undefined ? !nextSibling : isLast;
|
|
15
|
+
if (checkEmpty(parentSiblings)) {
|
|
16
|
+
if (!isNaN(level)) {
|
|
17
|
+
siblingsArray = Array(level).fill(true);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return (_jsx("div", { className: "tree-table-space-container", children: siblingsArray?.map((line, i) => (_jsx("span", { className: `tree-table-space-block tree-table-space-block-${i} ${!line ? 'no-lines' : ''} ${isLastNode && i === level - 1 ? 'last-node' : ''} ${isContainer ? 'folder' : ''}` }, i))) }));
|
|
21
|
+
};
|
|
22
|
+
const TableCell = React.memo(({ treeRowRef, col, colIndex, columnMeta, node, selected, select, onCheckBoxChange, onToggleExpand, onAddConfirm, onAddCancel, handleEditFieldError, isExpanding, columnTextColor, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, isEditable, setIsEditable, }) => {
|
|
23
|
+
//Todo uncomment the following code when we are highlighting the tree table nodes on hover
|
|
24
|
+
// useEffect(() => {
|
|
25
|
+
// const handleHover = (event: MouseEvent, isHovering: boolean) => {
|
|
26
|
+
// const target = event.target as HTMLElement;
|
|
27
|
+
// const levelClass = Array.from(target.classList).find((cls) =>
|
|
28
|
+
// cls.startsWith('tree-table-space-block-')
|
|
29
|
+
// );
|
|
30
|
+
// if (levelClass) {
|
|
31
|
+
// const level = levelClass.split('-').pop();
|
|
32
|
+
// // Check if level is valid before selecting elements
|
|
33
|
+
// if (level) {
|
|
34
|
+
// const sameLevelBlocks = document.querySelectorAll(
|
|
35
|
+
// `.tree-table-space-block-${level}`
|
|
36
|
+
// ) as NodeListOf<HTMLElement>;
|
|
37
|
+
// sameLevelBlocks.forEach((block) => {
|
|
38
|
+
// if (isHovering) {
|
|
39
|
+
// block.classList.add('tree-table-hovered');
|
|
40
|
+
// } else {
|
|
41
|
+
// block.classList.remove('tree-table-hovered');
|
|
42
|
+
// }
|
|
43
|
+
// });
|
|
44
|
+
// }
|
|
45
|
+
// }
|
|
46
|
+
// };
|
|
47
|
+
// const spaceBlocks = document.querySelectorAll(
|
|
48
|
+
// '.tree-table-space-block'
|
|
49
|
+
// ) as NodeListOf<HTMLElement>;
|
|
50
|
+
// spaceBlocks.forEach((block) => {
|
|
51
|
+
// block.addEventListener('mouseenter', (e) => handleHover(e, true));
|
|
52
|
+
// block.addEventListener('mouseleave', (e) => handleHover(e, false));
|
|
53
|
+
// });
|
|
54
|
+
// return () => {
|
|
55
|
+
// spaceBlocks.forEach((block) => {
|
|
56
|
+
// block.removeEventListener('mouseenter', (e) => handleHover(e, true));
|
|
57
|
+
// block.removeEventListener('mouseleave', (e) => handleHover(e, false));
|
|
58
|
+
// });
|
|
59
|
+
// };
|
|
60
|
+
// }, []);
|
|
61
|
+
const cellStyle = {
|
|
62
|
+
color: `${columnTextColor || 'var(--ff-primary-text-color)'}`,
|
|
63
|
+
width: columnMeta?.width ?? col?.width,
|
|
64
|
+
position: columnMeta?.sticky ? 'sticky' : undefined,
|
|
65
|
+
left: columnMeta?.sticky ? columnMeta.left : undefined,
|
|
66
|
+
zIndex: columnMeta?.sticky ? columnMeta.zIndex : undefined,
|
|
67
|
+
};
|
|
68
|
+
return (_jsxs("div", { className: `ff-table-tree-td ${col.isTree && node.container ? 'folder' : ''} ${columnMeta?.sticky ? 'sticky-column' : ''}`, "data-col-index": colIndex, style: cellStyle, children: [col.isTree &&
|
|
69
|
+
renderSpaces(node.hierarchy, node.parentSiblings, node.lastChild, node.nextSibling, node.container), _jsxs("div", { className: "tree-title-container", children: [col.isTree && (_jsx("span", { className: `tree-table-space-block last-block last-block tree-table-space-block-${node.hierarchy} ${node?.expanded ? 'tree-row-expanded' : 'tree-row-collapsed'} ${node.container && node.expandable ? '' : 'no-folder'}`, children: node.container && node.expandable && (_jsxs("span", { onClick: () => onToggleExpand(node), children: [' ', isExpanding ? _jsx(Spinner, {}) : _jsx(Arrow, {})] })) })), _jsxs("span", { className: `tree-table-td-content ${col.isTree && node.container ? 'folder' : ''}`, children: [!node?.isNewNode && (_jsxs(_Fragment, { children: [col.isTree &&
|
|
70
|
+
select === 'checkbox' &&
|
|
71
|
+
!(hideOnDisable && node.unselectable) && (_jsx("span", { className: "tree-table-td-content-select", children: node.selectedStatus === 'none' ? (_jsx(Tooltip, { title: node?.currentEnvId &&
|
|
72
|
+
node?.envId &&
|
|
73
|
+
node?.currentEnvId !== node?.envId
|
|
74
|
+
? 'This script is assigned to another environment. Selecting it will reassign it to the current environment.'
|
|
75
|
+
: undefined, children: _jsx(Checkbox, { checked: node.selectedStatus === 'completely', partial: node.selectedStatus === 'partially', onChange: (e) => onCheckBoxChange(e, node), disabled: node.unselectable ||
|
|
76
|
+
node.state === 'REVIEW' ||
|
|
77
|
+
node?.isDisable === true, isDefaultHover: node.selectedStatus === 'none' && !!node.machine }) })) : (_jsx(Checkbox, { checked: node.selectedStatus === 'completely', partial: node.selectedStatus === 'partially', onChange: (e) => onCheckBoxChange(e, node), disabled: node.unselectable ||
|
|
78
|
+
node.state === 'REVIEW' ||
|
|
79
|
+
node?.isDisable === true })) })), col.isTree &&
|
|
80
|
+
select === 'radio' &&
|
|
81
|
+
!(hideOnDisable && node.unselectable) && (_jsx("span", { className: "tree-table-td-content-select", children: _jsx(RadioButton, { name: node.key, checked: selected.includes(node.key), value: node.key, onChange: (e) => onCheckBoxChange(e, node), disabled: node.unselectable ||
|
|
82
|
+
node.state === 'REVIEW' ||
|
|
83
|
+
node?.isDisable === true }) }))] })), node.isNewNode && col.isTree ? (_jsx(AddModule, { onCancel: onAddCancel, onConfirm: onAddConfirm, value: node.value, label: node?.label, optionsList: node.options, selectedOption: node.selectedOption, withDropdown: node.type === 'inputWithDropdown', handleCustomError: handleEditFieldError, inputFieldWidth: addModuleInputWidth, selectFieldWidth: addModuleSelectWidth, confirmIconTooltip: node.confirmIconTooltip, cancelIconTooltip: node.cancelIconTooltip, isEditable: isEditable, setIsEditable: setIsEditable, isOnBlurTrue: false, isDisable: { confirm: disableEditLabelConfirmIcon } })) : (_jsx("span", { className: "tree-table-td-content-text", children: formatCellData(prepareData(node, col), scriptLengthTruncate) }))] })] }), col.actions && !node?.isNewNode && (_jsx("div", { className: `table-tree-row-action`, children: (() => {
|
|
84
|
+
return col.actions(node, treeRowRef);
|
|
85
|
+
})() }))] }));
|
|
86
|
+
});
|
|
87
|
+
TableCell.displayName = 'TableCell';
|
|
88
|
+
export default TableCell;
|
|
89
|
+
//# sourceMappingURL=TableCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../../src/components/TreeV3/Components/TableCell.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,OAAO,MAAM,yCAAyC,CAAC;AAE9D,MAAM,YAAY,GAAG,CACnB,KAAa,EACb,iBAA4B,EAAE,EAC9B,MAA4B,EAC5B,WAAiC,EACjC,WAAiC,EACjC,EAAE;IACF,IAAI,a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,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAE,YAAY,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,EAAE,KAAK,EAClB,WAAW,EAAE,IAAI,CAAC,OAAO,EACzB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,YAAY,EAAE,IAAI,CAAC,IAAI,KAAK,mBAAmB,EAC/C,iBAAiB,EAAE,oBAAoB,EACvC,eAAe,EAAE,mBAAmB,EACpC,gBAAgB,EAAE,oBAAoB,EACtC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAC3C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE,GACnD,CACH,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,4BAA4B,YACzC,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,oBAAoB,CAAC,GACxD,CACR,IACI,IACH,EACL,GAAG,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,IAAI,CAClC,cAAK,SAAS,EAAE,uBAAuB,YACpC,CAAC,GAAG,EAAE;oBACL,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBACvC,CAAC,CAAC,EAAE,GACA,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TableHeadProps } from '../types';
|
|
3
|
+
declare const TableHead: React.MemoExoticComponent<({ columnsData, columnMeta, totalWidth, rootNode, selected, onCheckBoxChange, selectedNode, tableHeaderBgColor, hideOnDisable, transparentHeader, scriptLengthTruncate, showHeader, }: TableHeadProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
+
export default TableHead;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
3
|
+
import { formatCellData } from '../Utils/formatDataCell';
|
|
4
|
+
import { prepareData } from '../Utils/TableCell';
|
|
5
|
+
import Checkbox from '../../Checkbox';
|
|
6
|
+
import RadioButton from '../../RadioButton';
|
|
7
|
+
const TableHead = React.memo(({ columnsData, columnMeta, totalWidth, rootNode, selected, onCheckBoxChange, selectedNode, tableHeaderBgColor, hideOnDisable, transparentHeader, scriptLengthTruncate = 25, showHeader = true, }) => {
|
|
8
|
+
const rootNodeRowRef = useRef(null);
|
|
9
|
+
const [isMounted, setIsMounted] = useState(false);
|
|
10
|
+
const [didMouseEntered, setDidMouseEntered] = useState(false);
|
|
11
|
+
const handleMouseEnter = (e) => {
|
|
12
|
+
e.stopPropagation();
|
|
13
|
+
setDidMouseEntered(true);
|
|
14
|
+
};
|
|
15
|
+
const handleMouseLeave = (e) => {
|
|
16
|
+
e.stopPropagation();
|
|
17
|
+
setDidMouseEntered(false);
|
|
18
|
+
};
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setIsMounted(true);
|
|
21
|
+
}, []);
|
|
22
|
+
const getCellStyle = (index, width) => {
|
|
23
|
+
const meta = columnMeta?.[index];
|
|
24
|
+
return {
|
|
25
|
+
width: meta?.width ?? width,
|
|
26
|
+
position: meta?.sticky ? 'sticky' : undefined,
|
|
27
|
+
left: meta?.sticky ? meta.left : undefined,
|
|
28
|
+
zIndex: meta?.sticky ? meta.zIndex : undefined,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
return (_jsxs("div", { className: "ff-table-tree-head", children: [showHeader && (_jsx("div", { className: "ff-table-tree-row no-hover", style: { minWidth: totalWidth }, children: columnsData.map(({ name, width }, index) => (_jsx("div", { className: `ff-table-tree-th ${columnMeta?.[index]?.sticky ? 'sticky-column' : ''}`, "data-col-index": index, style: {
|
|
32
|
+
...getCellStyle(index, width),
|
|
33
|
+
backgroundColor: transparentHeader
|
|
34
|
+
? 'transparent'
|
|
35
|
+
: tableHeaderBgColor,
|
|
36
|
+
pointerEvents: transparentHeader ? 'none' : 'auto',
|
|
37
|
+
}, children: name }, name))) })), rootNode && (_jsx("div", { className: `ff-table-tree-row show ${selectedNode && selectedNode === rootNode?.node?.key
|
|
38
|
+
? 'hover'
|
|
39
|
+
: ''}`, ref: rootNodeRowRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: columnsData.map((col, index) => (_jsx("div", { className: `ff-table-tree-td ${columnMeta?.[index]?.sticky ? 'sticky-column' : ''}`, "data-col-index": index, style: getCellStyle(index, col.width), children: _jsxs("span", { className: "tree-table-default-content", children: [index === 0 &&
|
|
40
|
+
rootNode.select === 'checkbox' &&
|
|
41
|
+
!(hideOnDisable && rootNode.node.isDisabled) && (_jsx(Checkbox, { checked: rootNode?.node?.selectedStatus !== 'partially' &&
|
|
42
|
+
(rootNode?.node?.selectedStatus === 'completely' ||
|
|
43
|
+
false), partial: rootNode.node.selectedStatus === 'partially', onChange: (e) => onCheckBoxChange(e, rootNode.node), disabled: rootNode.node.isDisabled })), index === 0 &&
|
|
44
|
+
rootNode.select === 'radio' &&
|
|
45
|
+
!(hideOnDisable && rootNode.node.isDisabled) && (_jsx(RadioButton, { name: rootNode.node.key, checked: selected.includes(rootNode.node.key), value: rootNode.node.key, onChange: (e) => onCheckBoxChange(e, rootNode.node), disabled: rootNode.node.isDisabled })), _jsxs("span", { className: "tree-table-td-content-text", children: [col.accessor === 'name' ? (_jsx("span", { children: rootNode.node[col.accessor] })) : (_jsx("span", { children: formatCellData(prepareData(rootNode.node, col), scriptLengthTruncate) })), rootNode.cell && index === 0 && (_jsx("span", { className: "table-tree-root-cell", children: rootNode.cell(rootNode.node) }))] }), didMouseEntered &&
|
|
46
|
+
rootNode.actions &&
|
|
47
|
+
index === 0 &&
|
|
48
|
+
isMounted &&
|
|
49
|
+
rootNodeRowRef.current && (_jsx("div", { className: "table-tree-row-action", children: rootNode.actions(rootNode.node, rootNodeRowRef) }))] }) }, index))) }))] }));
|
|
50
|
+
});
|
|
51
|
+
TableHead.displayName = 'TableHead';
|
|
52
|
+
export default TableHead;
|
|
53
|
+
//# sourceMappingURL=TableHead.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHead.js","sourceRoot":"","sources":["../../../../src/components/TreeV3/Components/TableHead.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAE5C,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAC1B,CAAC,EACC,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,GAAG,EAAE,EACzB,UAAU,GAAG,IAAI,GACF,EAAE,EAAE;IACnB,MAAM,cAAc,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IAC3D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9D,MAAM,gBAAgB,GAAG,CAAC,CAAgC,EAAE,EAAE;QAC5D,CAAC,CAAC,eAAe,EAAE,CAAC;QACpB,kBAAkB,CAAC,IAAI,CAAC,CAA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CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TableRowProps } from '../types';
|
|
3
|
+
declare const TableRow: React.MemoExoticComponent<({ node, columnsData, columnMeta, selected, select, onRowClick, onToggleExpand, onCheckBoxChange, onAddConfirm, onAddCancel, handleEditFieldError, isExpanding, index, selectedNode, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, isEditable, setIsEditable, style, }: TableRowProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
+
export default TableRow;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import TableCell from './TableCell';
|
|
4
|
+
const TableRow = React.memo(({ node, columnsData, columnMeta, selected, select, onRowClick, onToggleExpand, onCheckBoxChange, onAddConfirm, onAddCancel, handleEditFieldError, isExpanding, index, selectedNode, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, isEditable, setIsEditable, style, }) => {
|
|
5
|
+
const treeRowRef = useRef(null);
|
|
6
|
+
return (_jsx("div", { "data-level": node.hierarchy, ref: treeRowRef, className: `ff-table-tree-row show ${selectedNode && selectedNode === node.key ? 'selected-node' : ''}`, onClick: (e) => onRowClick(e, node), onKeyDown: (e) => {
|
|
7
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
8
|
+
onRowClick(e, node);
|
|
9
|
+
}
|
|
10
|
+
}, role: "button", tabIndex: 0, id: index === 0 ? 'table-first-row' : node.key, style: style, children: columnsData.map((col, colIndex) => (_jsx(TableCell, { treeRowRef: treeRowRef, col: col, colIndex: colIndex, node: node, selected: selected, select: select, onCheckBoxChange: onCheckBoxChange, onToggleExpand: onToggleExpand, onAddConfirm: onAddConfirm, onAddCancel: onAddCancel, handleEditFieldError: handleEditFieldError, isExpanding: isExpanding, hideOnDisable: hideOnDisable, scriptLengthTruncate: scriptLengthTruncate, addModuleInputWidth: addModuleInputWidth, addModuleSelectWidth: addModuleSelectWidth, disableEditLabelConfirmIcon: disableEditLabelConfirmIcon, isEditable: isEditable, setIsEditable: setIsEditable, columnMeta: columnMeta?.[colIndex] }, col.name))) }));
|
|
11
|
+
});
|
|
12
|
+
TableRow.displayName = 'TableRow';
|
|
13
|
+
export default TableRow;
|
|
14
|
+
//# sourceMappingURL=TableRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableRow.js","sourceRoot":"","sources":["../../../../src/components/TreeV3/Components/TableRow.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CACzB,CAAC,EACC,IAAI,EACJ,WAAW,EACX,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,KAAK,EACL,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,UAAU,EACV,aAAa,EACb,KAAK,GACS,EAAE,EAAE;IAClB,MAAM,UAAU,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACvD,OAAO,CACL,4BACc,IAAI,CAAC,SAAS,EAC1B,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,0BACT,YAAY,IAAI,YAAY,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAChE,EAAE,EACF,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CA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