pixel-react 1.21.9 → 1.21.11
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/StatusBadge/StatusBadge.js +1 -1
- package/lib/components/StatusIndicator/StatusIndicator.js +5 -5
- package/lib/components/TableTreeFn/Components/TableHead.js +1 -1
- package/lib/components/TableTreeFn/Components/TableHead.js.map +1 -1
- package/lib/components/TableTreeFn/TableTreeFn.js +23 -25
- package/lib/components/TableTreeFn/TableTreeFn.js.map +1 -1
- package/lib/index.d.ts +8 -2
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/computeTreeCountsAndFormatNodes/computeTreeCountsAndFormatNodes.d.ts +8 -0
- package/lib/utils/computeTreeCountsAndFormatNodes/computeTreeCountsAndFormatNodes.js +262 -0
- package/lib/utils/computeTreeCountsAndFormatNodes/computeTreeCountsAndFormatNodes.js.map +1 -0
- package/package.json +118 -118
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;
|
|
@@ -29,7 +29,7 @@ const StatusBadge = ({ gap = 8, fontSize = 12, entityType, statusValues, }) => {
|
|
|
29
29
|
// };
|
|
30
30
|
return (_jsx("div", { className: "ff-statusbadge-container", style: {
|
|
31
31
|
gap: `${gap}px`,
|
|
32
|
-
}, children: statusValues.map((val, idx) => (_jsxs("div", { className: "ff-statusbadge-item", "data-tooltip": `${capitalize(val?.status)}${entityType ? ` ${entityType}` : ''} :
|
|
32
|
+
}, children: statusValues.map((val, idx) => (_jsxs("div", { className: "ff-statusbadge-item", "data-tooltip": `${capitalize(val?.status)}${entityType ? ` ${entityType}` : ''} :
|
|
33
33
|
${Number(val?.tooltipValue).toLocaleString('fullwide', {
|
|
34
34
|
useGrouping: false,
|
|
35
35
|
maximumSignificantDigits: 21,
|
|
@@ -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;
|
|
@@ -31,7 +31,7 @@ const TableHead = React.memo(({ columnsData, columnMeta, totalWidth, rootNode, s
|
|
|
31
31
|
rootNode.select === 'checkbox' &&
|
|
32
32
|
!(hideOnDisable && rootNode.node.isDisabled) && (_jsx(Checkbox, { checked: rootNode?.node?.selectedStatus !== 'partially' &&
|
|
33
33
|
(rootNode?.node?.selectedStatus === 'completely' ||
|
|
34
|
-
false), partial: rootNode
|
|
34
|
+
false), partial: rootNode?.node?.selectedStatus === 'partially', onChange: (e) => onCheckBoxChange(e, rootNode?.node), disabled: rootNode?.node?.isDisabled })), index === 0 &&
|
|
35
35
|
rootNode.select === 'radio' &&
|
|
36
36
|
!(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("div", { className: "tree-table-cell-flex", children: [_jsx(AutoTruncateText, { children: col.accessor === 'name'
|
|
37
37
|
? rootNode.node[col.accessor]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHead.js","sourceRoot":"","sources":["../../../../src/components/TableTreeFn/Components/TableHead.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,E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QAAQ,CAAC,IAAI,CAAC,UAAU,GAClC,CACH,EACH,eAAK,SAAS,EAAC,sBAAsB,aACnC,KAAC,gBAAgB,cACd,GAAG,CAAC,QAAQ,KAAK,MAAM;4CACtB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;4CAC7B,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,GAClB,EAElB,QAAQ,CAAC,IAAI,IAAI,KAAK,KAAK,CAAC,IAAI,CAC/B,eAAM,SAAS,EAAC,0BAA0B,YACvC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GACxB,CACR,EAEA,QAAQ,CAAC,OAAO;wCACf,KAAK,KAAK,CAAC;wCACX,SAAS;wCACT,cAAc,CAAC,OAAO,IAAI,CACxB,cAAK,SAAS,EAAC,0BAA0B,YACtC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,GAC5C,CACP,IACC,IACD,IAtDF,KAAK,CAuDN,CACP,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,eAAe,SAAS,CAAC"}
|
|
@@ -127,11 +127,11 @@ const prepareTreeRows = (treeData, rootNode) => {
|
|
|
127
127
|
const siblingIndex = new Map();
|
|
128
128
|
const loadedCountsByParent = new Map();
|
|
129
129
|
if (rootNode && rootNode.key) {
|
|
130
|
-
nodeById.set(rootNode.key, rootNode);
|
|
130
|
+
nodeById.set(String(rootNode.key), rootNode);
|
|
131
131
|
}
|
|
132
132
|
treeData.forEach((node) => {
|
|
133
|
-
nodeById.set(node.key, node);
|
|
134
|
-
const parentKey = node.parentId
|
|
133
|
+
nodeById.set(String(node.key), node);
|
|
134
|
+
const parentKey = node.parentId ? String(node.parentId) : ROOT_PARENT_ID;
|
|
135
135
|
if (!childrenByParent.has(parentKey)) {
|
|
136
136
|
childrenByParent.set(parentKey, []);
|
|
137
137
|
loadedCountsByParent.set(parentKey, { container: 0, resource: 0 });
|
|
@@ -149,15 +149,15 @@ const prepareTreeRows = (treeData, rootNode) => {
|
|
|
149
149
|
});
|
|
150
150
|
childrenByParent.forEach((children) => {
|
|
151
151
|
children.forEach((child, index) => {
|
|
152
|
-
siblingIndex.set(child.key, index);
|
|
152
|
+
siblingIndex.set(String(child.key), index);
|
|
153
153
|
});
|
|
154
154
|
});
|
|
155
155
|
const hasNextSibling = (node) => {
|
|
156
|
-
const parentKey = node.parentId
|
|
156
|
+
const parentKey = node.parentId ? String(node.parentId) : ROOT_PARENT_ID;
|
|
157
157
|
const siblings = childrenByParent.get(parentKey);
|
|
158
158
|
if (!siblings || siblings.length === 0)
|
|
159
159
|
return false;
|
|
160
|
-
const index = siblingIndex.get(node.key) ?? 0;
|
|
160
|
+
const index = siblingIndex.get(String(node.key)) ?? 0;
|
|
161
161
|
if (index < siblings.length - 1)
|
|
162
162
|
return true;
|
|
163
163
|
const parent = nodeById.get(parentKey);
|
|
@@ -181,34 +181,27 @@ const prepareTreeRows = (treeData, rootNode) => {
|
|
|
181
181
|
return false;
|
|
182
182
|
};
|
|
183
183
|
const buildParentSiblings = (node) => {
|
|
184
|
-
const
|
|
185
|
-
if (hierarchy <= 0)
|
|
186
|
-
return [];
|
|
187
|
-
const path = [];
|
|
184
|
+
const flags = [];
|
|
188
185
|
let current = node;
|
|
186
|
+
// Traverse upwards using parentId until we reach the top
|
|
189
187
|
while (current) {
|
|
190
|
-
|
|
188
|
+
// FIX: Only add the sibling status if this node has a parent.
|
|
189
|
+
// Top-level root nodes do NOT contribute an indentation block to the UI.
|
|
190
|
+
if (current.parentId) {
|
|
191
|
+
flags.unshift(hasNextSibling(current));
|
|
192
|
+
}
|
|
191
193
|
if (!current.parentId)
|
|
192
194
|
break;
|
|
193
|
-
|
|
194
|
-
if (!parent)
|
|
195
|
-
break;
|
|
196
|
-
current = parent;
|
|
195
|
+
current = nodeById.get(String(current.parentId));
|
|
197
196
|
}
|
|
198
|
-
|
|
199
|
-
if (flags.length === hierarchy)
|
|
200
|
-
return flags;
|
|
201
|
-
if (flags.length > hierarchy)
|
|
202
|
-
return flags.slice(flags.length - hierarchy);
|
|
203
|
-
const padding = new Array(hierarchy - flags.length).fill(false);
|
|
204
|
-
return padding.concat(flags);
|
|
197
|
+
return flags;
|
|
205
198
|
};
|
|
206
199
|
const resolveSelectedStatus = (node) => {
|
|
207
200
|
if (node.selectedStatus !== undefined)
|
|
208
201
|
return node.selectedStatus;
|
|
209
202
|
let current = node;
|
|
210
203
|
while (current?.parentId) {
|
|
211
|
-
const parent = nodeById.get(current.parentId);
|
|
204
|
+
const parent = nodeById.get(String(current.parentId));
|
|
212
205
|
if (!parent)
|
|
213
206
|
break;
|
|
214
207
|
if (parent.selectedStatus === 'completely')
|
|
@@ -225,14 +218,19 @@ const prepareTreeRows = (treeData, rootNode) => {
|
|
|
225
218
|
};
|
|
226
219
|
return treeData.map((node) => {
|
|
227
220
|
const nodeWithSiblings = node;
|
|
228
|
-
const
|
|
229
|
-
nodeWithSiblings.parentSiblings.length > 0
|
|
221
|
+
const hasApiSiblings = nodeWithSiblings.parentSiblings &&
|
|
222
|
+
nodeWithSiblings.parentSiblings.length > 0;
|
|
223
|
+
const finalParentSiblings = hasApiSiblings
|
|
230
224
|
? nodeWithSiblings.parentSiblings
|
|
231
225
|
: buildParentSiblings(node);
|
|
226
|
+
const finalHierarchy = hasApiSiblings
|
|
227
|
+
? nodeWithSiblings.hierarchy
|
|
228
|
+
: finalParentSiblings.length;
|
|
232
229
|
return {
|
|
233
230
|
...node,
|
|
234
231
|
lastChild: !hasNextSibling(node),
|
|
235
232
|
parentSiblings: finalParentSiblings,
|
|
233
|
+
hierarchy: finalHierarchy,
|
|
236
234
|
selectedStatus: resolveSelectedStatus(node),
|
|
237
235
|
};
|
|
238
236
|
});
|