pixel-react 1.16.4 → 1.17.1

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.
Files changed (95) hide show
  1. package/README.md +75 -75
  2. package/lib/components/AddResourceButton/AddResourceButton.js +20 -15
  3. package/lib/components/AddResourceButton/AddResourceButton.js.map +1 -1
  4. package/lib/components/Charts/BarChart/BarChart.js +8 -8
  5. package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.js +6 -6
  6. package/lib/components/Charts/IconRadialChart/IconRadialChart.js +4 -4
  7. package/lib/components/Charts/PieChart/PieChart.js +5 -5
  8. package/lib/components/Comments/Comments.js +14 -14
  9. package/lib/components/Comments/childComment/ChildComment.js +14 -14
  10. package/lib/components/EditTextField/EditTextField.js +2 -2
  11. package/lib/components/LabelEditTextField/LabelEditTextField.js +4 -4
  12. package/lib/components/StatusIndicator/StatusIndicator.js +5 -5
  13. package/lib/components/TableTreeFn/Components/TableBody.d.ts +1 -1
  14. package/lib/components/TableTreeFn/Components/TableBody.js +12 -7
  15. package/lib/components/TableTreeFn/Components/TableBody.js.map +1 -1
  16. package/lib/components/TableTreeFn/Components/TableCell.d.ts +1 -1
  17. package/lib/components/TableTreeFn/Components/TableCell.js +25 -17
  18. package/lib/components/TableTreeFn/Components/TableCell.js.map +1 -1
  19. package/lib/components/TableTreeFn/Components/TableHead.d.ts +1 -1
  20. package/lib/components/TableTreeFn/Components/TableHead.js +19 -17
  21. package/lib/components/TableTreeFn/Components/TableHead.js.map +1 -1
  22. package/lib/components/TableTreeFn/Components/TableRow.d.ts +1 -1
  23. package/lib/components/TableTreeFn/Components/TableRow.js +7 -2
  24. package/lib/components/TableTreeFn/Components/TableRow.js.map +1 -1
  25. package/lib/components/TableTreeFn/TableTreeFn.d.ts +1 -1
  26. package/lib/components/TableTreeFn/TableTreeFn.js +656 -247
  27. package/lib/components/TableTreeFn/TableTreeFn.js.map +1 -1
  28. package/lib/components/TableTreeFn/Utils/TableCell.js.map +1 -0
  29. package/lib/components/TableTreeFn/Utils/addLastChild.d.ts +1 -1
  30. package/lib/components/TableTreeFn/Utils/addLastChild.js +2 -2
  31. package/lib/components/TableTreeFn/Utils/addLastChild.js.map +1 -1
  32. package/lib/components/TableTreeFn/Utils/addNewRow.js +6 -5
  33. package/lib/components/TableTreeFn/Utils/addNewRow.js.map +1 -1
  34. package/lib/components/TableTreeFn/Utils/formatDataCell.js +1 -1
  35. package/lib/components/TableTreeFn/Utils/formatDataCell.js.map +1 -1
  36. package/lib/components/TableTreeFn/Utils/updateParentSibling.d.ts +1 -1
  37. package/lib/components/TableTreeFn/Utils/updateParentSibling.js +7 -7
  38. package/lib/components/TableTreeFn/Utils/updateParentSibling.js.map +1 -1
  39. package/lib/components/TableTreeFn/index.d.ts +2 -0
  40. package/lib/components/TableTreeFn/index.js +2 -0
  41. package/lib/components/TableTreeFn/index.js.map +1 -1
  42. package/lib/components/TableTreeFn/types.d.ts +30 -7
  43. package/lib/index.js +3 -3
  44. package/lib/index.js.map +1 -1
  45. package/lib/styles.css +1 -1
  46. package/lib/styles.css.map +1 -1
  47. package/lib/tsconfig.tsbuildinfo +1 -1
  48. package/lib/utils/getTopVisibleNodeKey/getTopVisibleNodeKey.js +8 -9
  49. package/lib/utils/getTopVisibleNodeKey/getTopVisibleNodeKey.js.map +1 -1
  50. package/package.json +106 -106
  51. package/lib/components/TreeV3/Components/TableBody.d.ts +0 -3
  52. package/lib/components/TreeV3/Components/TableBody.js +0 -17
  53. package/lib/components/TreeV3/Components/TableBody.js.map +0 -1
  54. package/lib/components/TreeV3/Components/TableCell.d.ts +0 -4
  55. package/lib/components/TreeV3/Components/TableCell.js +0 -89
  56. package/lib/components/TreeV3/Components/TableCell.js.map +0 -1
  57. package/lib/components/TreeV3/Components/TableHead.d.ts +0 -4
  58. package/lib/components/TreeV3/Components/TableHead.js +0 -53
  59. package/lib/components/TreeV3/Components/TableHead.js.map +0 -1
  60. package/lib/components/TreeV3/Components/TableRow.d.ts +0 -4
  61. package/lib/components/TreeV3/Components/TableRow.js +0 -14
  62. package/lib/components/TreeV3/Components/TableRow.js.map +0 -1
  63. package/lib/components/TreeV3/TableTreeFn.d.ts +0 -5
  64. package/lib/components/TreeV3/TableTreeFn.js +0 -724
  65. package/lib/components/TreeV3/TableTreeFn.js.map +0 -1
  66. package/lib/components/TreeV3/Utils/TableCell.js.map +0 -1
  67. package/lib/components/TreeV3/Utils/addLastChild.d.ts +0 -2
  68. package/lib/components/TreeV3/Utils/addLastChild.js +0 -24
  69. package/lib/components/TreeV3/Utils/addLastChild.js.map +0 -1
  70. package/lib/components/TreeV3/Utils/addNewRow.d.ts +0 -14
  71. package/lib/components/TreeV3/Utils/addNewRow.js +0 -80
  72. package/lib/components/TreeV3/Utils/addNewRow.js.map +0 -1
  73. package/lib/components/TreeV3/Utils/formatDataCell.d.ts +0 -2
  74. package/lib/components/TreeV3/Utils/formatDataCell.js +0 -15
  75. package/lib/components/TreeV3/Utils/formatDataCell.js.map +0 -1
  76. package/lib/components/TreeV3/Utils/getAllChildIds.d.ts +0 -2
  77. package/lib/components/TreeV3/Utils/getAllChildIds.js +0 -12
  78. package/lib/components/TreeV3/Utils/getAllChildIds.js.map +0 -1
  79. package/lib/components/TreeV3/Utils/renderSpaces.d.ts +0 -0
  80. package/lib/components/TreeV3/Utils/renderSpaces.js +0 -2
  81. package/lib/components/TreeV3/Utils/renderSpaces.js.map +0 -1
  82. package/lib/components/TreeV3/Utils/updateParentSibling.d.ts +0 -3
  83. package/lib/components/TreeV3/Utils/updateParentSibling.js +0 -65
  84. package/lib/components/TreeV3/Utils/updateParentSibling.js.map +0 -1
  85. package/lib/components/TreeV3/data.d.ts +0 -247
  86. package/lib/components/TreeV3/data.js +0 -529
  87. package/lib/components/TreeV3/data.js.map +0 -1
  88. package/lib/components/TreeV3/index.d.ts +0 -3
  89. package/lib/components/TreeV3/index.js +0 -4
  90. package/lib/components/TreeV3/index.js.map +0 -1
  91. package/lib/components/TreeV3/types.d.ts +0 -170
  92. package/lib/components/TreeV3/types.js +0 -2
  93. package/lib/components/TreeV3/types.js.map +0 -1
  94. /package/lib/components/{TreeV3 → TableTreeFn}/Utils/TableCell.d.ts +0 -0
  95. /package/lib/components/{TreeV3 → TableTreeFn}/Utils/TableCell.js +0 -0
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
+ ---
@@ -22,36 +22,41 @@ const AddResourceButton = ({ id = 'AddModule', variant = 'primary', directionalA
22
22
  },
23
23
  ], zIndex = 1400, menuOptionZIndex = 1400, treeRowRef, onMenuOptionClick, isFromTree = false, }) => {
24
24
  const [isHovered, setIsHovered] = useState(false);
25
- const [positionArrowContainer, setPositionArrowContainer] = useState({ left: 0, top: 0 });
25
+ const [positionArrowContainer, setPositionArrowContainer] = useState({
26
+ left: 0,
27
+ top: 0,
28
+ });
26
29
  const [activeArrow, setActiveArrow] = useState('');
27
30
  const arrowContainerRef = useRef(null);
31
+ const portalRef = useRef(null);
28
32
  const validArrows = validateArrows(directionalArrow);
29
33
  const portalPosition = usePortalPosition(arrowContainerRef, isHovered);
30
34
  const handleHover = () => {
31
- if (!activeArrow) {
32
- setIsHovered(true);
33
- }
35
+ setIsHovered(true);
34
36
  const { positionX, positionY } = portalPosition(arrowContainerRef);
35
37
  setPositionArrowContainer({ left: positionX, top: positionY });
36
- const parentNode = arrowContainerRef.current?.parentNode;
37
- if (treeRowRef !== null && parentNode) {
38
- const actionContainer = treeRowRef?.current?.querySelector('.table-tree-row-action');
38
+ if (treeRowRef?.current) {
39
+ const actionContainer = treeRowRef.current.querySelector('.table-tree-fn-row-action, .table-tree-row-action');
39
40
  actionContainer?.classList.add('table-row-add-button');
40
41
  }
41
42
  };
42
- const handleLeave = () => {
43
+ const handleLeave = (e) => {
44
+ const nextTarget = e.relatedTarget;
45
+ const isInsideButton = arrowContainerRef.current?.contains(nextTarget);
46
+ const isInsidePortal = portalRef.current?.contains(nextTarget);
47
+ if (isInsideButton || isInsidePortal)
48
+ return;
43
49
  setIsHovered(false);
44
50
  setActiveArrow('');
45
- const parentNode = arrowContainerRef.current?.parentNode;
46
- if (treeRowRef !== null && parentNode) {
47
- const actionContainer = treeRowRef?.current?.querySelector('.table-tree-row-action');
51
+ if (treeRowRef?.current) {
52
+ const actionContainer = treeRowRef.current.querySelector('.table-tree-fn-row-action, .table-tree-row-action');
48
53
  actionContainer?.classList.remove('table-row-add-button');
49
54
  }
50
55
  };
51
56
  const handleArrowClick = (direction) => {
52
57
  if (activeArrow === direction) {
53
58
  setActiveArrow('');
54
- setIsHovered(false);
59
+ setIsHovered(true);
55
60
  }
56
61
  else {
57
62
  setActiveArrow(direction);
@@ -66,13 +71,13 @@ const AddResourceButton = ({ id = 'AddModule', variant = 'primary', directionalA
66
71
  const arrowCountClass = validArrows.length === 2 ? 'ff-two-arrows' : '';
67
72
  return `ff-${directions} ${arrowCountClass}`;
68
73
  };
69
- return (_jsxs("div", { className: `${isFromTree ? 'ff-add-button-tree' : 'ff-add-button-container'} ${isHovered && !activeArrow ? `ff-hovered-add-button--${variant}` : ''}`, id: id, onMouseEnter: handleHover, onMouseLeave: handleLeave, ref: arrowContainerRef, children: [_jsx("span", { className: "ff-add-button", children: _jsx(Icon, { name: "plus_icon", width: 16, height: 16, className: isHovered
74
+ return (_jsxs("div", { id: id, ref: arrowContainerRef, className: `${isFromTree ? 'ff-add-button-tree' : 'ff-add-button-container'} ${isHovered ? `ff-hovered-add-button--${variant}` : ''}`, onMouseEnter: handleHover, onMouseLeave: handleLeave, children: [_jsx("span", { className: "ff-add-button", children: _jsx(Icon, { name: "plus_icon", width: 16, height: 16, className: isHovered
70
75
  ? `ff-hovered-add-icon--${variant}`
71
76
  : `ff-add-icon--${variant}` }) }), isHovered &&
72
- createPortal(_jsx("div", { id: `portal-123`, className: `ff-arrow-buttons-container ${getArrowButtonClass()}`, onMouseEnter: handleHover, onMouseLeave: handleLeave, style: {
77
+ createPortal(_jsx("div", { ref: portalRef, id: "portal-123", className: `ff-arrow-buttons-container ${getArrowButtonClass()}`, onMouseEnter: handleHover, onMouseLeave: handleLeave, style: {
73
78
  left: positionArrowContainer.left + (isFromTree ? 4 : 0),
74
79
  top: positionArrowContainer.top + (isFromTree ? 2 : 0),
75
- zIndex: zIndex,
80
+ zIndex,
76
81
  }, children: directionalArrow.map(({ direction, menuOptions }, index) => (_jsx(ArrowsButton, { direction: direction, onArrowClick: () => handleArrowClick(direction), menuOptions: menuOptions, isActive: activeArrow === direction, variant: variant, treeRowRef: treeRowRef, onMenuOptionClick: onMenuOptionClick, menuOptionZIndex: menuOptionZIndex }, index))) }), document.body)] }));
77
82
  };
78
83
  export default AddResourceButton;
@@ -1 +1 @@
1
- {"version":3,"file":"AddResourceButton.js","sourceRoot":"","sources":["../../../src/components/AddResourceButton/AddResourceButton.tsx"],"names":[],"mappings":";AAAA,OAAO,0BAA0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AU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBACtD,MAAM,EAAE,MAAM;qBACf,YAEA,gBAAgB,CAAC,GAAG,CACnB,CAAC,EAAE,SAAS,EAAE,WAAW,EAAoB,EAAE,KAAa,EAAE,EAAE,CAAC,CAC/D,KAAC,YAAY,IAEX,SAAS,EAAE,SAAqC,EAChD,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAC/C,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,WAAW,KAAK,SAAS,EACnC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,IAR7B,KAAK,CASV,CACH,CACF,GACG,EACN,QAAQ,CAAC,IAAI,CACd,IACC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"AddResourceButton.js","sourceRoot":"","sources":["../../../src/components/AddResourceButton/AddResourceButton.tsx"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAC;AAClC,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAGL,cAAc,GACf,MAAM,QAAQ,CAAC;AAChB,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAE9D,MAAM,iBAAiB,GAAG,CAAC,EACzB,EAAE,GAAG,WAAW,EAChB,OAAO,GAAG,SAAS,EACnB,gBAAgB,GAAG;IACjB;QACE,SAAS,EAAE,OAAO;QAClB,WAAW,EAAE;YACX;gBACE,KAAK,EAAE,YAAY;gBACnB,KAAK,EAAE,YAAY;gBACnB,IAAI,EAAE,EAAE;gBACR,OAAO,EAAE,KAAK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tB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,IAR7B,KAAK,CASV,CACH,CACF,GACG,EACN,QAAQ,CAAC,IAAI,CACd,IACC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -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;
@@ -1,3 +1,3 @@
1
1
  import type { TableBodyProps } from '../types';
2
- declare const TableBody: ({ flattenedTreeData, columnsData, selected, select, onRowClick, onToggleExpand, onCheckBoxChange, newNode, onAddConfirm, onAddCancel, handleEditFieldError, expanding, rootNode, selectedNode, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, }: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
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
3
  export default TableBody;
@@ -1,12 +1,17 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { addNewRow } from '../Utils/addNewRow';
3
2
  import TableRow from './TableRow';
4
- const TableBody = ({ flattenedTreeData, columnsData, selected, select, onRowClick, onToggleExpand, onCheckBoxChange, newNode, onAddConfirm, onAddCancel, handleEditFieldError, expanding, rootNode, selectedNode, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, }) => {
5
- // commenting this code to add editLabel component to rootnode when data is empty
6
- // if (checkEmpty(flattenedTreeData)) {
7
- // return null;
8
- // }
9
- return (_jsx("tbody", { className: "ff-table-tree-body", children: addNewRow(flattenedTreeData, newNode ?? {}, rootNode)?.map((node, index) => !node?.hide ? (_jsx(TableRow, { node: node, columnsData: columnsData, selected: selected, select: select, onRowClick: onRowClick, onToggleExpand: onToggleExpand, onCheckBoxChange: onCheckBoxChange, onAddConfirm: onAddConfirm, onAddCancel: onAddCancel, handleEditFieldError: handleEditFieldError, isExpanding: node.key === expanding, index: index, selectedNode: selectedNode, hideOnDisable: hideOnDisable, scriptLengthTruncate: scriptLengthTruncate, addModuleInputWidth: addModuleInputWidth, addModuleSelectWidth: addModuleSelectWidth, disableEditLabelConfirmIcon: disableEditLabelConfirmIcon }, node.key)) : null) }));
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-fn-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))) }));
10
15
  };
11
16
  export default TableBody;
12
17
  //# sourceMappingURL=TableBody.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../../src/components/TableTreeFn/Components/TableBody.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,SAAS,GAAG,CAAC,EACjB,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,GACZ,EAAE,EAAE;IACnB,iFAAiF;IACjF,uCAAuC;IACvC,iBAAiB;IACjB,IAAI;IAEJ,OAAO,CACL,gBAAO,SAAS,EAAC,oBAAoB,YAMlC,SAAS,CAAC,iBAAiB,EAAE,OAAO,IAAI,EAAE,EAAE,QAAQ,CAAC,EAAE,GAAG,CACzD,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACd,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CACZ,KAAC,QAAQ,IAEP,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,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,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,mBAAmB,EACxC,oBAAoB,EAAE,oBAAoB,EAC1C,2BAA2B,EAAE,2BAA2B,IAlBnD,IAAI,CAAC,GAAG,CAmBb,CACH,CAAC,CAAC,CAAC,IAAI,CACX,GAKK,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../../src/components/TableTreeFn/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,uBAAuB,EACjC,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"}
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { TableCellProps } from '../types';
3
- declare const TableCell: React.MemoExoticComponent<({ treeRowRef, col, node, selected, select, onCheckBoxChange, onToggleExpand, onAddConfirm, onAddCancel, handleEditFieldError, isExpanding, columnTextColor, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, }: TableCellProps) => import("react/jsx-runtime").JSX.Element>;
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
4
  export default TableCell;
@@ -1,38 +1,38 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { prepareData } from '../../../utils/TableCell/TableCell';
3
+ import { formatCellData } from '../Utils/formatDataCell';
4
+ import { prepareData } from '../Utils/TableCell';
5
+ import { checkEmpty } from '../../../utils/checkEmpty/checkEmpty';
6
+ import Tooltip from '../../Tooltip';
4
7
  import Checkbox from '../../Checkbox';
5
8
  import RadioButton from '../../RadioButton';
6
- import { checkEmpty } from '../../../utils/checkEmpty/checkEmpty';
7
9
  import AddModule from '../../EditLabel';
8
10
  import Arrow from '../../../assets/icons/arrows_down_icon.svg?react';
9
11
  import Spinner from '../../../assets/icons/spinner.svg?react';
10
- import Tooltip from '../../Tooltip';
11
- import { formatCellData } from '../Utils/formatDataCell';
12
12
  const renderSpaces = (level, parentSiblings = [], isLast, nextSibling, isContainer) => {
13
13
  let siblingsArray = parentSiblings;
14
- let isLastNode = nextSibling !== undefined ? !nextSibling : isLast;
14
+ const isLastNode = nextSibling !== undefined ? !nextSibling : isLast;
15
15
  if (checkEmpty(parentSiblings)) {
16
16
  if (!isNaN(level)) {
17
17
  siblingsArray = Array(level).fill(true);
18
18
  }
19
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))) }));
20
+ return (_jsx("div", { className: "tree-table-fn-space-container", children: siblingsArray?.map((line, i) => (_jsx("span", { className: `tree-table-fn-space-block tree-table-fn-space-block-${i} ${!line ? 'no-lines' : ''} ${isLastNode && i === level - 1 ? 'last-node' : ''} ${isContainer ? 'folder' : ''}` }, i))) }));
21
21
  };
22
- const TableCell = React.memo(({ treeRowRef, col, node, selected, select, onCheckBoxChange, onToggleExpand, onAddConfirm, onAddCancel, handleEditFieldError, isExpanding, columnTextColor, hideOnDisable, scriptLengthTruncate, addModuleInputWidth, addModuleSelectWidth, disableEditLabelConfirmIcon, }) => {
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
23
  //Todo uncomment the following code when we are highlighting the tree table nodes on hover
24
24
  // useEffect(() => {
25
25
  // const handleHover = (event: MouseEvent, isHovering: boolean) => {
26
26
  // const target = event.target as HTMLElement;
27
27
  // const levelClass = Array.from(target.classList).find((cls) =>
28
- // cls.startsWith('tree-table-space-block-')
28
+ // cls.startsWith('tree-table-fn-space-block-')
29
29
  // );
30
30
  // if (levelClass) {
31
31
  // const level = levelClass.split('-').pop();
32
32
  // // Check if level is valid before selecting elements
33
33
  // if (level) {
34
34
  // const sameLevelBlocks = document.querySelectorAll(
35
- // `.tree-table-space-block-${level}`
35
+ // `.tree-table-fn-space-block-${level}`
36
36
  // ) as NodeListOf<HTMLElement>;
37
37
  // sameLevelBlocks.forEach((block) => {
38
38
  // if (isHovering) {
@@ -45,7 +45,7 @@ const TableCell = React.memo(({ treeRowRef, col, node, selected, select, onCheck
45
45
  // }
46
46
  // };
47
47
  // const spaceBlocks = document.querySelectorAll(
48
- // '.tree-table-space-block'
48
+ // '.tree-table-fn-space-block'
49
49
  // ) as NodeListOf<HTMLElement>;
50
50
  // spaceBlocks.forEach((block) => {
51
51
  // block.addEventListener('mouseenter', (e) => handleHover(e, true));
@@ -58,12 +58,19 @@ const TableCell = React.memo(({ treeRowRef, col, node, selected, select, onCheck
58
58
  // });
59
59
  // };
60
60
  // }, []);
61
- return (_jsxs("td", { className: `ff-table-tree-td ${col.isTree && node.container ? 'folder' : ''}`, style: {
62
- color: `${columnTextColor || 'var(--ff-primary-text-color)'}`,
63
- }, children: [col.isTree &&
64
- 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 &&
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-fn-td ${col.isTree && node.container ? 'folder' : ''} ${columnMeta?.sticky ? 'sticky-tree-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-fn-title-container", children: [col.isTree && (_jsx("span", { className: `tree-table-fn-space-block last-tree-fn-block last-tree-fn-block tree-table-fn-space-block-${node.hierarchy} ${node?.expanded
70
+ ? 'tree-fn-row-expanded'
71
+ : 'tree-fn-row-collapsed'} ${node.container && node.expandable ? '' : 'no-tree-folder'}`, children: node.container && node.expandable && (_jsxs("span", { onClick: () => onToggleExpand(node), children: [' ', isExpanding ? _jsx(Spinner, {}) : _jsx(Arrow, {})] })) })), _jsxs("span", { className: `tree-table-fn-td-content ${col.isTree && node.container ? 'folder' : ''}`, children: [!node?.isNewNode && (_jsxs(_Fragment, { children: [col.isTree &&
65
72
  select === 'checkbox' &&
66
- !(hideOnDisable && node.unselectable) && (_jsx("span", { className: "tree-table-td-content-select", children: node.selectedStatus === 'none' ? (_jsx(Tooltip, { title: node?.currentEnvId &&
73
+ !(hideOnDisable && node.unselectable) && (_jsx("span", { className: "tree-table-fn-td-content-select", children: node.selectedStatus === 'none' ? (_jsx(Tooltip, { title: node?.currentEnvId &&
67
74
  node?.envId &&
68
75
  node?.currentEnvId !== node?.envId
69
76
  ? 'This script is assigned to another environment. Selecting it will reassign it to the current environment.'
@@ -73,11 +80,12 @@ const TableCell = React.memo(({ treeRowRef, col, node, selected, select, onCheck
73
80
  node.state === 'REVIEW' ||
74
81
  node?.isDisable === true })) })), col.isTree &&
75
82
  select === 'radio' &&
76
- !(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 ||
83
+ !(hideOnDisable && node.unselectable) && (_jsx("span", { className: "tree-table-fn-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 ||
77
84
  node.state === 'REVIEW' ||
78
- 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, isOnBlurTrue: true, 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: (() => {
85
+ 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-fn-td-content-text", children: formatCellData(prepareData(node, col), scriptLengthTruncate) }))] })] }), col.actions && !node?.isNewNode && (_jsx("div", { className: `table-tree-fn-row-action`, children: (() => {
79
86
  return col.actions(node, treeRowRef);
80
87
  })() }))] }));
81
88
  });
89
+ TableCell.displayName = 'TableCell';
82
90
  export default TableCell;
83
91
  //# sourceMappingURL=TableCell.js.map