pixel-react 1.4.6 → 1.4.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/StyleGuide/ColorPalette/ColorPalette.stories.d.ts +6 -0
  3. package/lib/StyleGuide/Typography/Typography.stories.d.ts +6 -0
  4. package/lib/components/Accordion/Accordion.stories.d.ts +6 -0
  5. package/lib/components/AddResourceButton/AddButton.stories.d.ts +8 -0
  6. package/lib/components/AllProjectsDropdown/AllProjectsDropdown.d.ts +1 -1
  7. package/lib/components/AllProjectsDropdown/AllProjectsDropdown.stories.d.ts +7 -0
  8. package/lib/components/AllProjectsDropdown/types.d.ts +2 -0
  9. package/lib/components/AppHeader/AppHeader.stories.d.ts +7 -0
  10. package/lib/components/AppHeader/types.d.ts +1 -0
  11. package/lib/components/AttachmentButton/AttachmentButton.stories.d.ts +9 -0
  12. package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
  13. package/lib/components/Button/Button.stories.d.ts +13 -0
  14. package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.d.ts +7 -0
  15. package/lib/components/Charts/DonutChart/DonutChart.stories.d.ts +6 -0
  16. package/lib/components/Charts/PieChart/PieChart.stories.d.ts +7 -0
  17. package/lib/components/Charts/RadialChart/RadialChart.stories.d.ts +6 -0
  18. package/lib/components/Checkbox/Checkbox.stories.d.ts +8 -0
  19. package/lib/components/Chip/Chip.stories.d.ts +14 -0
  20. package/lib/components/DatePicker/DatePicker.stories.d.ts +9 -0
  21. package/lib/components/DragAndDrop/DragAndDrop.stories.d.ts +6 -0
  22. package/lib/components/Drawer/Drawer.stories.d.ts +12 -0
  23. package/lib/components/ExcelFile/ColorBarselector/ColorBarSelector.d.ts +8 -0
  24. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +7 -0
  25. package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +4 -0
  26. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +5 -0
  27. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +3 -0
  28. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +5 -0
  29. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +5 -0
  30. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +8 -0
  31. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +10 -0
  32. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +3 -0
  33. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +3 -0
  34. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +5 -0
  35. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +3 -0
  36. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +80 -0
  37. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +3 -0
  38. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +174 -0
  39. package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +1 -0
  40. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +8 -0
  41. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +22 -0
  42. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +17 -0
  43. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -0
  44. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +21 -0
  45. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +3 -0
  46. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +24 -0
  47. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +13 -0
  48. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +67 -0
  49. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +22 -0
  50. package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +11 -0
  51. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +27 -0
  52. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +95 -0
  53. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +178 -0
  54. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +3 -0
  55. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +3 -0
  56. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +44 -0
  57. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +19 -0
  58. package/lib/components/ExcelFile/ExcelFile.stories.d.ts +6 -0
  59. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +12 -0
  60. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +15 -0
  61. package/lib/components/ExcelFile/Types.d.ts +129 -0
  62. package/lib/components/ExcelFile/index.d.ts +1 -0
  63. package/lib/components/ExpandableMenu/ExpandableMenu.stories.d.ts +7 -0
  64. package/lib/components/FF_Captcha/captcha.stories.d.ts +8 -0
  65. package/lib/components/FileDropzone/FileDropzone.stories.d.ts +8 -0
  66. package/lib/components/Form/Form.stories.d.ts +7 -0
  67. package/lib/components/Form/Forms.d.ts +3 -1
  68. package/lib/components/GridLayout/GridLayout.stories.d.ts +8 -0
  69. package/lib/components/HighlightText/HighlightText.stories.d.ts +6 -0
  70. package/lib/components/Icon/Icon.stories.d.ts +8 -0
  71. package/lib/components/IconButton/IconButton.stories.d.ts +7 -0
  72. package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +7 -0
  73. package/lib/components/Input/Input.d.ts +1 -1
  74. package/lib/components/Input/Input.stories.d.ts +9 -0
  75. package/lib/components/Input/types.d.ts +4 -0
  76. package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +9 -0
  77. package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +11 -0
  78. package/lib/components/LazyLoad/LazyLoad.stories.d.ts +6 -0
  79. package/lib/components/MachineInputField/MachineInputField.stories.d.ts +6 -0
  80. package/lib/components/MenuOption/MenuOption.stories.d.ts +16 -0
  81. package/lib/components/MenuOption/types.d.ts +1 -1
  82. package/lib/components/MiniModal/MiniModal.stories.d.ts +10 -0
  83. package/lib/components/Modal/Modal.stories.d.ts +7 -0
  84. package/lib/components/Modal/types.d.ts +4 -2
  85. package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
  86. package/lib/components/MultiSelect/MultiSelect.stories.d.ts +10 -0
  87. package/lib/components/NLPInput/NlpInput.stories.d.ts +7 -0
  88. package/lib/components/Paper/Paper.stories.d.ts +11 -0
  89. package/lib/components/RadioButton/RadioButton.stories.d.ts +10 -0
  90. package/lib/components/RadioGroup/RadioGroup.stories.d.ts +9 -0
  91. package/lib/components/Search/Search.stories.d.ts +6 -0
  92. package/lib/components/Select/Select.stories.d.ts +13 -0
  93. package/lib/components/Select/components/Dropdown/Dropdown.d.ts +4 -0
  94. package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +17 -0
  95. package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.d.ts +6 -0
  96. package/lib/components/StateDropdown/StateDropdown.stories.d.ts +10 -0
  97. package/lib/components/StatusButton/StatusButton.stories.d.ts +14 -0
  98. package/lib/components/Table/Table.stories.d.ts +13 -0
  99. package/lib/components/TableTree/TableTree.d.ts +2 -1
  100. package/lib/components/TableTree/TableTree.stories.d.ts +7 -0
  101. package/lib/components/Tabs/Tabs.stories.d.ts +9 -0
  102. package/lib/components/TextArea/Textarea.stories.d.ts +9 -0
  103. package/lib/components/Toast/Toast.stories.d.ts +6 -0
  104. package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
  105. package/lib/components/Toggle/Toggle.stories.d.ts +12 -0
  106. package/lib/components/Tooltip/Tooltip.stories.d.ts +15 -0
  107. package/lib/components/Typography/Typography.stories.d.ts +10 -0
  108. package/lib/components/VariableInput/VariableInput.stories.d.ts +6 -0
  109. package/lib/index.d.ts +17 -5
  110. package/lib/index.esm.js +212 -145
  111. package/lib/index.esm.js.map +1 -1
  112. package/lib/index.js +212 -145
  113. package/lib/index.js.map +1 -1
  114. package/lib/tsconfig.tsbuildinfo +1 -1
  115. package/lib/utils/capitalize/capitalize.d.ts +1 -0
  116. package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +6 -0
  117. package/lib/utils/compareArrays/compareArrays.stories.d.ts +6 -0
  118. package/lib/utils/compareObjects/compareObjects.stories.d.ts +6 -0
  119. package/lib/utils/debounce/debounce.stories.d.ts +6 -0
  120. package/lib/utils/ffID/ffID.stories.d.ts +6 -0
  121. package/lib/utils/find/findAndInsert.d.ts +7 -0
  122. package/lib/utils/find/findAndInsert.stories.d.ts +7 -0
  123. package/lib/utils/findAndInsert/findAndInsert.stories.d.ts +7 -0
  124. package/lib/utils/getEncryptedData/getEncryptedData.stories.d.ts +6 -0
  125. package/lib/utils/getExtension/getExtension.stories.d.ts +6 -0
  126. package/lib/utils/throttle/throttle.stories.d.ts +6 -0
  127. package/lib/utils/truncateText/truncateText.stories.d.ts +6 -0
  128. package/package.json +2 -2
  129. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +82 -12
  130. package/src/assets/Themes/BaseTheme.scss +38 -15
  131. package/src/assets/Themes/DarkTheme.scss +15 -1
  132. package/src/assets/fonts/Poppins-Bold.woff2 +0 -0
  133. package/src/assets/fonts/Poppins-Medium.woff2 +0 -0
  134. package/src/assets/fonts/Poppins-Regular.woff2 +0 -0
  135. package/src/assets/fonts/Poppins-SemiBold.woff2 +0 -0
  136. package/src/assets/icons/Header_preset.svg +13 -0
  137. package/src/assets/icons/add_file.svg +16 -4
  138. package/src/assets/icons/eye_open_icon.svg +2 -9
  139. package/src/assets/icons/hide_access_icon.svg +3 -0
  140. package/src/assets/icons/replace_icon.svg +6 -0
  141. package/src/assets/styles/_fonts.scss +7 -4
  142. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +58 -8
  143. package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +83 -75
  144. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +31 -18
  145. package/src/components/AllProjectsDropdown/types.ts +2 -0
  146. package/src/components/AppHeader/AppHeader.scss +2 -2
  147. package/src/components/AppHeader/AppHeader.stories.tsx +5 -1
  148. package/src/components/AppHeader/AppHeader.tsx +108 -101
  149. package/src/components/AppHeader/types.ts +1 -0
  150. package/src/components/AttachmentButton/AttachmentButton.tsx +10 -5
  151. package/src/components/EditTextField/EditTextField.tsx +3 -5
  152. package/src/components/Form/Form.stories.tsx +4 -8
  153. package/src/components/Form/Forms.tsx +11 -4
  154. package/src/components/Icon/iconList.ts +9 -3
  155. package/src/components/Input/Input.scss +5 -0
  156. package/src/components/Input/Input.stories.tsx +44 -0
  157. package/src/components/Input/Input.tsx +24 -19
  158. package/src/components/Input/types.ts +4 -0
  159. package/src/components/MenuOption/MenuOption.scss +24 -27
  160. package/src/components/MenuOption/MenuOption.stories.tsx +90 -35
  161. package/src/components/MenuOption/MenuOption.tsx +22 -20
  162. package/src/components/MenuOption/types.ts +1 -1
  163. package/src/components/Modal/Modal.stories.tsx +2 -2
  164. package/src/components/Modal/Modal.tsx +6 -2
  165. package/src/components/Modal/modal.scss +2 -3
  166. package/src/components/Modal/types.ts +4 -2
  167. package/src/components/TableTree/TableTree.scss +22 -7
  168. package/src/components/TableTree/TableTree.stories.tsx +41 -0
  169. package/src/components/TableTree/TableTree.tsx +55 -18
  170. package/src/components/Typography/Typography.scss +4 -4
  171. package/src/utils/capitalize/capitalize.stories.tsx +44 -0
  172. package/src/utils/capitalize/capitalize.tsx +4 -0
  173. package/lib/assets/fonts/Poppins-Bold.ttf +0 -0
  174. package/lib/assets/fonts/Poppins-Medium.ttf +0 -0
  175. package/lib/assets/fonts/Poppins-Regular.ttf +0 -0
  176. package/lib/assets/fonts/Poppins-SemiBold.ttf +0 -0
  177. /package/lib/components/{Excel → ExcelFile}/ContextMenu/ContextMenu.d.ts +0 -0
@@ -12,9 +12,8 @@
12
12
  }
13
13
 
14
14
  .ff-modal-container {
15
- box-shadow: 0px 1px 4px 0px #ffc600;
16
- border-radius: 12px; // Ensures box-shadow respects the rounded corners
17
- overflow: hidden; // Prevents content overflow
15
+ border-radius: 12px;
16
+ overflow: hidden;
18
17
  }
19
18
 
20
19
  .ff-modal-content {
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { ReactNode } from 'react';
2
2
 
3
3
  export interface ModalProps {
4
4
  isOpen: boolean;
@@ -37,5 +37,7 @@ export interface ModalProps {
37
37
  customWidth: string;
38
38
  customHeight?: string;
39
39
  zIndex?: number;
40
- boxShadow:string;
40
+ boxShadow?: string;
41
+ border?: string;
42
+ background?: string;
41
43
  }
@@ -1,15 +1,18 @@
1
1
  @use '../../assets/styles/fonts';
2
+
2
3
  .ff-tree-container {
3
4
  width: 100%;
4
5
  font-size: 12px;
5
6
  color: var(--brand-color);
6
7
  transition: all 0.3s ease;
7
8
  @extend .fontSm;
9
+
8
10
  table {
9
11
  border-collapse: collapse;
10
12
  width: 100%;
11
13
  text-align: left;
12
14
  }
15
+
13
16
  .ff-toggle-arrow-icon {
14
17
  height: 12px;
15
18
  width: 12px;
@@ -40,6 +43,7 @@
40
43
  overflow: hidden;
41
44
  text-overflow: ellipsis;
42
45
  }
46
+
43
47
  th {
44
48
  vertical-align: middle;
45
49
  height: 32px;
@@ -53,8 +57,10 @@
53
57
  .ff-action-section {
54
58
  display: none;
55
59
  }
60
+
56
61
  &:hover {
57
62
  background-color: var(--hover-color);
63
+
58
64
  .ff-title-action-container {
59
65
  display: flex;
60
66
  }
@@ -70,6 +76,7 @@
70
76
  display: flex;
71
77
  cursor: pointer;
72
78
  }
79
+
73
80
  &.ff-folder {
74
81
  font-weight: 600;
75
82
  }
@@ -77,6 +84,7 @@
77
84
  &.ff-file {
78
85
  font-weight: 400;
79
86
  }
87
+
80
88
  .ff-title {
81
89
  display: flex;
82
90
  gap: 4px;
@@ -96,12 +104,6 @@
96
104
  position: absolute;
97
105
  right: 10px;
98
106
  }
99
-
100
- // &:hover {
101
- // > .ff-title-action-container {
102
- // display: flex;
103
- // }
104
- // }
105
107
  }
106
108
  }
107
109
 
@@ -144,12 +146,25 @@
144
146
  height: calc(var(--node-height) / 2);
145
147
  }
146
148
 
147
- // Remove the lines for root level
149
+ // Remove the lines for root level
148
150
  &[style*='--level: 0']::before,
149
151
  &[style*='--level: 0']::after {
150
152
  content: none;
151
153
  }
152
154
  }
155
+
156
+ th:first-child {
157
+ position: sticky;
158
+ left: 0;
159
+ z-index: 999;
160
+ background-color: var(--slider-table-color);
161
+ }
162
+ td:first-child {
163
+ position: sticky;
164
+ left: 0;
165
+ z-index: 99;
166
+ background-color: var(--ff-status-card-text-color);
167
+ }
153
168
  }
154
169
 
155
170
  .ff-title-action-container {
@@ -4,6 +4,7 @@ import Button from '../Button';
4
4
  import treeData from './data';
5
5
  import Icon from '../Icon/Icon';
6
6
  import './TableTreeStories.scss';
7
+ import React from 'react';
7
8
 
8
9
  const meta: Meta<typeof TableTree> = {
9
10
  title: 'Components/Table tree',
@@ -19,6 +20,9 @@ type Story = StoryObj<typeof TableTree>;
19
20
 
20
21
  export const Default: Story = {
21
22
  args: {
23
+ onPagination: (node) => {
24
+ console.log(node);
25
+ },
22
26
  select: 'radio',
23
27
  onChange: (e: any, node: any) => {
24
28
  e.preventDefault();
@@ -45,6 +49,43 @@ export const Default: Story = {
45
49
  },
46
50
  },
47
51
 
52
+ {
53
+ name: 'Module Path',
54
+ accessor: 'path',
55
+ width: '200px',
56
+ isClickable: true,
57
+ },
58
+
59
+ {
60
+ name: 'Module Path',
61
+ accessor: 'path',
62
+ width: '200px',
63
+ isClickable: true,
64
+ },
65
+ {
66
+ name: 'Module Path',
67
+ accessor: 'path',
68
+ width: '200px',
69
+ isClickable: true,
70
+ },
71
+ {
72
+ name: 'Module Path',
73
+ accessor: 'path',
74
+ width: '200px',
75
+ isClickable: true,
76
+ },
77
+ {
78
+ name: 'Module Path',
79
+ accessor: 'path',
80
+ width: '200px',
81
+ isClickable: true,
82
+ },
83
+ {
84
+ name: 'Module Path',
85
+ accessor: 'path',
86
+ width: '200px',
87
+ isClickable: true,
88
+ },
48
89
  {
49
90
  name: 'Module Path',
50
91
  accessor: 'path',
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  // @ts-nocheck
3
- import React, { ReactNode, useLayoutEffect, useRef, useState } from 'react';
3
+ import React, { ReactNode, useEffect, useLayoutEffect, useRef, useState } from 'react';
4
4
  import { prepareData } from '../../utils/TableCell/TableCell';
5
5
  import Icon from '../Icon';
6
6
  import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
@@ -36,6 +36,7 @@ interface TableTreeProps {
36
36
  ) => void;
37
37
  onChange?: (e: any, node: any) => void;
38
38
  selected: Array<string>;
39
+ onPagination?: (node: ObjectProps) => void; // New prop for pagination
39
40
  }
40
41
 
41
42
  const TableTree = ({
@@ -45,10 +46,12 @@ const TableTree = ({
45
46
  onClick = () => {},
46
47
  onChange,
47
48
  selected,
49
+ onPagination,
48
50
  }: TableTreeProps) => {
49
51
  const [expandedNodes, setExpandedNodes] = useState<Set<ObjectProps>>(
50
52
  new Set()
51
53
  );
54
+ const triggeredPaginationNodes = useRef(new Set()); // Tracks nodes for which pagination is triggered
52
55
 
53
56
  useLayoutEffect(() => {
54
57
  const defaultExpanded: Set<ObjectProps> = new Set();
@@ -56,10 +59,8 @@ const TableTree = ({
56
59
  // Recursive function to add nodes and their children to the expanded set
57
60
  const expandNodeRecursively = (node: ObjectProps) => {
58
61
  if (node.expanded) {
59
- // Add the node to the expanded set
60
62
  defaultExpanded.add(node);
61
63
 
62
- // If the node has children, recursively expand them as well
63
64
  if (node.children) {
64
65
  node.children.forEach((child: ObjectProps) =>
65
66
  expandNodeRecursively(child)
@@ -68,20 +69,18 @@ const TableTree = ({
68
69
  }
69
70
  };
70
71
 
71
- // Iterate over the treeData to check which nodes should be expanded
72
72
  treeData.forEach((node) => {
73
73
  expandNodeRecursively(node);
74
74
  });
75
75
 
76
- // Set the expanded nodes state
77
76
  setExpandedNodes(defaultExpanded);
78
77
  }, [treeData]);
78
+
79
79
  // Function to calculate total children height
80
80
  const calculateTotalChildrenHeight = (node: any): number => {
81
81
  if (!node.children || node.children.length === 0) {
82
82
  return 1;
83
83
  }
84
- // Start with 1 for the current node and node itself is included in the height calculation before considering its children.
85
84
  let totalHeight = 1;
86
85
  if (expandedNodes.has(node)) {
87
86
  node.children.forEach((child: any) => {
@@ -93,30 +92,22 @@ const TableTree = ({
93
92
 
94
93
  const TreeNode = ({ node, level, isLast }: any) => {
95
94
  const nodeRef = useRef<HTMLTableRowElement | null>(null);
95
+ const lastChildRef = useRef<HTMLTableRowElement | null>(null); // Ref for pagination
96
96
  const [nodeHeight, setNodeHeight] = useState<number>(0);
97
97
  const [totalChildrenHeight, setTotalChildrenHeight] = useState<number>(0);
98
98
 
99
99
  const isExpanded = expandedNodes.has(node);
100
100
 
101
- const handleCheckBoxChange = (e, node) => {
102
- if (onChange) {
103
- onChange(e, node);
104
- }
105
- };
106
-
107
101
  useLayoutEffect(() => {
108
102
  if (nodeRef.current) {
109
103
  const observer = new ResizeObserver(() => {
110
- // Update nodeHeight when the size of the element changes
111
104
  const currentHeight = nodeRef.current?.offsetHeight || 0;
112
105
  setNodeHeight(currentHeight);
113
106
 
114
- // Calculate total children height
115
107
  const childrenHeight = calculateTotalChildrenHeight(node);
116
108
  setTotalChildrenHeight(childrenHeight);
117
109
  });
118
110
 
119
- // Start observing the current node
120
111
  observer.observe(nodeRef.current);
121
112
 
122
113
  return () => {
@@ -125,6 +116,30 @@ const TableTree = ({
125
116
  }
126
117
  }, [isExpanded, node]);
127
118
 
119
+ useEffect(() => {
120
+ if (!isExpanded || !lastChildRef.current || !onPagination) return;
121
+
122
+ const observer = new IntersectionObserver(
123
+ (entries) => {
124
+ if (
125
+ entries[0].isIntersecting &&
126
+ !triggeredPaginationNodes.current.has(node.key)
127
+ ) {
128
+ triggeredPaginationNodes.current.add(node.key); // Mark node as paginated
129
+ onPagination(node); // Trigger the pagination callback
130
+ }
131
+ },
132
+ {
133
+ root: null, // Use the viewport as the root
134
+ threshold: 1.0, // Trigger when fully visible
135
+ }
136
+ );
137
+
138
+ observer.observe(lastChildRef.current);
139
+
140
+ return () => observer.disconnect();
141
+ }, [isExpanded, onPagination, node]);
142
+
128
143
  const handleToggleExpand = () => {
129
144
  setExpandedNodes((prev) => {
130
145
  const newExpandedNodes = new Set(prev);
@@ -136,6 +151,13 @@ const TableTree = ({
136
151
  return newExpandedNodes;
137
152
  });
138
153
  };
154
+
155
+ const handleCheckBoxChange = (e, node) => {
156
+ if (onChange) {
157
+ onChange(e, node);
158
+ }
159
+ };
160
+
139
161
  const renderRowData = (columnsData: any) => {
140
162
  return columnsData.map((column: any) => {
141
163
  if (column.accessor === 'title') {
@@ -166,7 +188,6 @@ const TableTree = ({
166
188
  )}
167
189
  {select === 'radio' && (
168
190
  <RadioButton
169
- // checked={selected.includes(node.key)}
170
191
  name={node.title}
171
192
  value={node.key}
172
193
  onChange={(e) => handleCheckBoxChange(e, node)}
@@ -194,6 +215,23 @@ const TableTree = ({
194
215
  }
195
216
  });
196
217
  };
218
+
219
+ const renderTree = (nodes: any, level = 0) => {
220
+ return nodes.map((childNode: any, index: number) => {
221
+ const isChildLast = index === nodes.length - 1;
222
+ const ref = isChildLast ? lastChildRef : null;
223
+ return (
224
+ <TreeNode
225
+ key={childNode.key || index}
226
+ node={childNode}
227
+ level={level}
228
+ isLast={isChildLast}
229
+ ref={ref}
230
+ />
231
+ );
232
+ });
233
+ };
234
+
197
235
  return (
198
236
  <>
199
237
  <tr
@@ -214,7 +252,6 @@ const TableTree = ({
214
252
  {renderRowData(columnsData)}
215
253
  </tr>
216
254
 
217
- {/* Render children only if the node is expanded */}
218
255
  {isExpanded &&
219
256
  !checkEmpty(node?.children) &&
220
257
  renderTree(node.children, level + 1)}
@@ -225,7 +262,7 @@ const TableTree = ({
225
262
  const renderTree = (nodes: any, level = 0) => {
226
263
  return nodes.map((node: any, index: number) => {
227
264
  const isLast = index === nodes.length - 1;
228
- return <TreeNode key={index} node={node} level={level} isLast={isLast} />;
265
+ return <TreeNode key={node.key || index} node={node} level={level} isLast={isLast} />;
229
266
  });
230
267
  };
231
268
 
@@ -8,7 +8,7 @@
8
8
  font-weight: 400;
9
9
  src:
10
10
  local('Poppins-Regular'),
11
- url(../../fonts/Poppins/Poppins-Regular.ttf) format('truetype');
11
+ url(../../fonts/Poppins/Poppins-Regular.woff2) format('woff2');
12
12
  }
13
13
 
14
14
  @font-face {
@@ -16,7 +16,7 @@
16
16
  font-weight: 500;
17
17
  src:
18
18
  local('Poppins-Medium'),
19
- url(../../fonts/Poppins/Poppins-Medium.ttf) format('truetype');
19
+ url(../../fonts/Poppins/Poppins-Medium.woff2) format('woff2');
20
20
  }
21
21
 
22
22
  @font-face {
@@ -24,7 +24,7 @@
24
24
  font-weight: 600;
25
25
  src:
26
26
  local('Poppins-SemiBold'),
27
- url(../../fonts/Poppins/Poppins-SemiBold.ttf) format('truetype');
27
+ url(../../fonts/Poppins/Poppins-SemiBold.woff2) format('woff2');
28
28
  }
29
29
 
30
30
  @font-face {
@@ -32,7 +32,7 @@
32
32
  font-weight: 700;
33
33
  src:
34
34
  local('Poppins-Bold'),
35
- url(../../fonts/Poppins/Poppins-Bold.ttf) format('truetype');
35
+ url(../../fonts/Poppins/Poppins-Bold.woff2) format('woff2');
36
36
  }
37
37
 
38
38
  .ff-text {
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { capitalize } from './capitalize';
3
+
4
+ export default {
5
+ title: 'Utils/Capitalize', // Organize under the "Utils" category
6
+ component: capitalize,
7
+ };
8
+
9
+ export const Default = () => {
10
+ const examples = [
11
+ { input: 'hello', output: capitalize('hello') },
12
+ { input: 'world', output: capitalize('world') },
13
+ { input: '', output: capitalize('') },
14
+ { input: 'capitalize', output: capitalize('capitalize') },
15
+ ];
16
+
17
+ return (
18
+ <div>
19
+ <h3>Capitalize Function Examples</h3>
20
+ <table style={{ borderCollapse: 'collapse', width: '100%' }}>
21
+ <thead>
22
+ <tr>
23
+ <th style={{ border: '1px solid black', padding: '8px' }}>Input</th>
24
+ <th style={{ border: '1px solid black', padding: '8px' }}>
25
+ Output
26
+ </th>
27
+ </tr>
28
+ </thead>
29
+ <tbody>
30
+ {examples.map((example, index) => (
31
+ <tr key={index}>
32
+ <td style={{ border: '1px solid black', padding: '8px' }}>
33
+ {example.input}
34
+ </td>
35
+ <td style={{ border: '1px solid black', padding: '8px' }}>
36
+ {example.output}
37
+ </td>
38
+ </tr>
39
+ ))}
40
+ </tbody>
41
+ </table>
42
+ </div>
43
+ );
44
+ };
@@ -0,0 +1,4 @@
1
+ export const capitalize = (text: string): string => {
2
+ if (!text) return '';
3
+ return text.charAt(0).toUpperCase() + text.slice(1);
4
+ };
Binary file
Binary file