rez-table-listing-mui 1.2.13 → 1.2.15

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 (114) hide show
  1. package/dist/index.d.ts +15 -2
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +1 -1
  7. package/src/App.tsx +47 -405
  8. package/src/index.ts +10 -9
  9. package/src/kanban/components/LeadCard.tsx +130 -0
  10. package/src/kanban/constants/kanban-constants.ts +249 -0
  11. package/src/kanban/hooks/hooks.ts +16 -0
  12. package/src/kanban/index.tsx +340 -0
  13. package/src/kanban/services/service.ts +11 -0
  14. package/src/kanban/styles/styles.tsx +256 -0
  15. package/src/kanban/types/types.ts +59 -0
  16. package/src/{components → listing/components}/column-visibility-modal/column-list-item.tsx +1 -1
  17. package/src/{components → listing/components}/column-visibility-modal/index.tsx +1 -1
  18. package/src/{components → listing/components}/filter/components/forms/components/Filter-criteria.tsx +1 -1
  19. package/src/{components → listing/components}/filter/components/forms/index.tsx +1 -1
  20. package/src/{components → listing/components}/filter/components/saved-filter.tsx +2 -2
  21. package/src/{components → listing/components}/filter/components/search/index.tsx +1 -1
  22. package/src/{components → listing/components}/filter/components/tabs/index.tsx +1 -1
  23. package/src/{components → listing/components}/index-table.tsx +1 -1
  24. package/src/{components → listing/components}/pagination/default/index.tsx +1 -1
  25. package/src/{components → listing/components}/search/index.tsx +1 -1
  26. package/src/{components → listing/components}/sorting-modal.tsx/index.tsx +1 -1
  27. package/src/{components → listing/components}/sorting-modal.tsx/sorting-item.tsx +1 -1
  28. package/src/{components → listing/components}/table-change-layout.tsx +1 -1
  29. package/src/{components → listing/components}/table-head-dnd-cell.tsx +1 -1
  30. package/src/{components → listing/components}/table-head-pin.tsx +1 -1
  31. package/src/{components → listing/components}/table-head-popover.tsx +1 -1
  32. package/src/{components → listing/components}/table-head.tsx +1 -1
  33. package/src/{components → listing/components}/table-settings/common/listing-values.tsx +1 -1
  34. package/src/listing/components/table-settings/components/group-by.tsx +513 -0
  35. package/src/listing/components/table-settings/components/lane.tsx +512 -0
  36. package/src/{components → listing/components}/table-settings/components/sorting.tsx +1 -1
  37. package/src/{components → listing/components}/table-settings/constants.ts +12 -0
  38. package/src/{components → listing/components}/table-settings/index.tsx +61 -29
  39. package/src/{components → listing/components}/tabs/index.tsx +1 -1
  40. package/src/{components → listing/components}/topbar/index.tsx +7 -7
  41. package/src/{components → listing/components}/viewmore/index.tsx +1 -1
  42. package/src/{libs → listing/libs}/utils/common.ts +2 -5
  43. package/src/{types → listing/types}/filter-settings.ts +1 -0
  44. package/src/view/KanbanView.tsx +68 -0
  45. package/src/view/ListingView.tsx +421 -0
  46. /package/src/{components → listing/components}/column-visibility-modal/index.scss +0 -0
  47. /package/src/{components → listing/components}/common/confirm-modal/index.tsx +0 -0
  48. /package/src/{components → listing/components}/common/index.scss +0 -0
  49. /package/src/{components → listing/components}/common/index.tsx +0 -0
  50. /package/src/{components → listing/components}/common/loader/loader.tsx +0 -0
  51. /package/src/{components → listing/components}/dropdown/index.scss +0 -0
  52. /package/src/{components → listing/components}/dropdown/index.tsx +0 -0
  53. /package/src/{components → listing/components}/filter/components/attributes-filter.tsx +0 -0
  54. /package/src/{components → listing/components}/filter/components/forms/components/Date.tsx +0 -0
  55. /package/src/{components → listing/components}/filter/components/forms/components/Dropdown.tsx +0 -0
  56. /package/src/{components → listing/components}/filter/components/forms/components/Multi-Select.tsx +0 -0
  57. /package/src/{components → listing/components}/filter/components/forms/components/Select.tsx +0 -0
  58. /package/src/{components → listing/components}/filter/components/forms/components/Textfield.tsx +0 -0
  59. /package/src/{components → listing/components}/filter/components/forms/components/styles.tsx +0 -0
  60. /package/src/{components → listing/components}/filter/components/main-filter.tsx +0 -0
  61. /package/src/{components → listing/components}/filter/components/saved-edit-filter.tsx +0 -0
  62. /package/src/{components → listing/components}/filter/components/tabs/custom-tab-panel.tsx +0 -0
  63. /package/src/{components → listing/components}/filter/index.tsx +0 -0
  64. /package/src/{components → listing/components}/filter/style.ts +0 -0
  65. /package/src/{components → listing/components}/index.scss +0 -0
  66. /package/src/{components → listing/components}/inputs/checkbox/index.tsx +0 -0
  67. /package/src/{components → listing/components}/inputs/index.scss +0 -0
  68. /package/src/{components → listing/components}/inputs/switch.tsx +0 -0
  69. /package/src/{components → listing/components}/login/index.tsx +0 -0
  70. /package/src/{components → listing/components}/nestedcomponent/index.scss +0 -0
  71. /package/src/{components → listing/components}/nestedcomponent/index.tsx +0 -0
  72. /package/src/{components → listing/components}/pagination/default/index.scss +0 -0
  73. /package/src/{components → listing/components}/search/style.ts +0 -0
  74. /package/src/{components → listing/components}/table-body-dnd-cell.tsx +0 -0
  75. /package/src/{components → listing/components}/table-body.tsx +0 -0
  76. /package/src/{components → listing/components}/table-dnd.tsx +0 -0
  77. /package/src/{components → listing/components}/table-settings/common/draggable-listitem.tsx +0 -0
  78. /package/src/{components → listing/components}/table-settings/common/info-alert.tsx +0 -0
  79. /package/src/{components → listing/components}/table-settings/components/column.tsx +0 -0
  80. /package/src/{components → listing/components}/table-settings/components/custom-button.tsx +0 -0
  81. /package/src/{components → listing/components}/table-settings/components/custom-dialog.tsx +0 -0
  82. /package/src/{components → listing/components}/table-settings/components/quick-tab.tsx +0 -0
  83. /package/src/{components → listing/components}/table-settings/components/toggle-button-switch.tsx +0 -0
  84. /package/src/{components → listing/components}/table-settings/style.ts +0 -0
  85. /package/src/{components → listing/components}/table-settings/tabs/horizontal/index.tsx +0 -0
  86. /package/src/{components → listing/components}/table-settings/tabs/styles.ts +0 -0
  87. /package/src/{components → listing/components}/table-settings/tabs/vertical/custom-tab-panel.tsx +0 -0
  88. /package/src/{components → listing/components}/table-settings/tabs/vertical/index.tsx +0 -0
  89. /package/src/{components → listing/components}/table.tsx +0 -0
  90. /package/src/{components → listing/components}/tabs/index.scss +0 -0
  91. /package/src/{components → listing/components}/tabs/styles.ts +0 -0
  92. /package/src/{components → listing/components}/topbar/index.scss +0 -0
  93. /package/src/{components → listing/components}/viewmore/index.scss +0 -0
  94. /package/src/{libs → listing/libs}/hooks/useCraftTable.tsx +0 -0
  95. /package/src/{libs → listing/libs}/hooks/useCraftTableFilterSettings.tsx +0 -0
  96. /package/src/{libs → listing/libs}/hooks/useDefaultColumns.tsx +0 -0
  97. /package/src/{libs → listing/libs}/hooks/useElementWidth.tsx +0 -0
  98. /package/src/{libs → listing/libs}/hooks/useEntityTableAPI.tsx +0 -0
  99. /package/src/{libs → listing/libs}/hooks/useEntityTableHooks.ts +0 -0
  100. /package/src/{libs → listing/libs}/hooks/useFullScreen.tsx +0 -0
  101. /package/src/{libs → listing/libs}/hooks/useOutsideClick.tsx +0 -0
  102. /package/src/{libs → listing/libs}/utils/Data-format.ts +0 -0
  103. /package/src/{libs → listing/libs}/utils/amount-format.ts +0 -0
  104. /package/src/{libs → listing/libs}/utils/apiColumn.ts +0 -0
  105. /package/src/{libs → listing/libs}/utils/date-format.ts +0 -0
  106. /package/src/{libs → listing/libs}/utils/debounce.ts +0 -0
  107. /package/src/{libs → listing/libs}/utils/make-data.ts +0 -0
  108. /package/src/{libs → listing/libs}/utils/make-hierar-data.ts +0 -0
  109. /package/src/{libs → listing/libs}/utils/make-nested-data.ts +0 -0
  110. /package/src/{libs → listing/libs}/utils/rows-data.ts +0 -0
  111. /package/src/{types → listing/types}/common.ts +0 -0
  112. /package/src/{types → listing/types}/filter.ts +0 -0
  113. /package/src/{types → listing/types}/table-options.ts +0 -0
  114. /package/src/{types → listing/types}/table.ts +0 -0
@@ -0,0 +1,249 @@
1
+ export const rawData = {
2
+ lanes: [
3
+ { id: 1, name: "Enquiry", color: "#fff0f3", darkColor: "#fea3b4" },
4
+ { id: 2, name: "Qualified Lead", color: "#fffbed", darkColor: "#fde272" },
5
+ { id: 3, name: "Application", color: "#ebf9fc", darkColor: "#67e3f9" },
6
+ { id: 4, name: "Admission", color: "#edf9f3", darkColor: "#73e2a3" },
7
+ { id: 5, name: "Documents", color: "#edf9f3", darkColor: "#73e2a3" },
8
+ { id: 6, name: "Admission", color: "#edf9f3", darkColor: "#73e2a3" },
9
+ ],
10
+ swim_lanes: [
11
+ {
12
+ id: 12,
13
+ name: "Active",
14
+ sub_lanes: [
15
+ {
16
+ id: 1,
17
+ name: "Lead Assignment",
18
+ color: "red",
19
+ lane_id: 1,
20
+ expanded: true,
21
+ },
22
+ {
23
+ id: 2,
24
+ name: "Initial Outreach",
25
+ color: "green",
26
+ lane_id: 1,
27
+ expanded: true,
28
+ },
29
+ {
30
+ id: 3,
31
+ name: "Lead Assessment",
32
+ color: "yellow",
33
+ lane_id: 2,
34
+ expanded: true,
35
+ },
36
+ {
37
+ id: 4,
38
+ name: "Campus Visit",
39
+ color: "#FFE885",
40
+ lane_id: 2,
41
+ expanded: true,
42
+ },
43
+ {
44
+ id: 5,
45
+ name: "Application Collection",
46
+ color: "#90E0F3",
47
+ lane_id: 3,
48
+ expanded: true,
49
+ },
50
+ {
51
+ id: 6,
52
+ name: "Student Assessment",
53
+ color: "#90E0F3",
54
+ lane_id: 3,
55
+ expanded: true,
56
+ },
57
+ {
58
+ id: 7,
59
+ name: "Fee Collection",
60
+ color: "#90EE90",
61
+ lane_id: 4,
62
+ expanded: true,
63
+ },
64
+ {
65
+ id: 8,
66
+ name: "System Integration",
67
+ color: "#90EE90",
68
+ lane_id: 4,
69
+ expanded: true,
70
+ },
71
+ ],
72
+ },
73
+ {
74
+ id: 13,
75
+ name: "Dormant",
76
+ sub_lanes: [],
77
+ },
78
+ {
79
+ id: 14,
80
+ name: "Disqualify",
81
+ sub_lanes: [],
82
+ },
83
+ {
84
+ id: 15,
85
+ name: "Lost",
86
+ sub_lanes: [],
87
+ },
88
+ ],
89
+ data: [
90
+ // Lead Assignment
91
+ {
92
+ id: 1,
93
+ name: "Aditi Sharma",
94
+ sub_lane_id: 1,
95
+ email: "aditisharma@gmail.com",
96
+ phone: "+91 9846213495",
97
+ status: "Active",
98
+ progress: 0,
99
+ days: "10 Days",
100
+ reference_id: "INQ2024XY",
101
+ priority: null,
102
+ lost: false,
103
+ },
104
+ {
105
+ id: 2,
106
+ name: "Aditi Sharma",
107
+ sub_lane_id: 1,
108
+ email: "aditisharma@gmail.com",
109
+ phone: "+91 9846213495",
110
+ status: "Active",
111
+ progress: 0,
112
+ days: "10 Days",
113
+ reference_id: "INQ2024XY",
114
+ priority: null,
115
+ lost: false,
116
+ },
117
+ // Initial Outreach
118
+ {
119
+ id: 3,
120
+ name: "Rashmi Desai",
121
+ sub_lane_id: 2,
122
+ email: "aditisharma@gmail.com",
123
+ phone: "+91 9765874320",
124
+ status: "Active",
125
+ progress: 0,
126
+ days: "10 Days",
127
+ reference_id: "INQ2024XY",
128
+ priority: null,
129
+ lost: false,
130
+ },
131
+ // Lead Assessment
132
+ {
133
+ id: 4,
134
+ name: "Aditi Sharma",
135
+ sub_lane_id: 3,
136
+ email: "aditisharma@gmail.com",
137
+ phone: "+91 9846213495",
138
+ status: "Active",
139
+ progress: 0,
140
+ days: "10 Days",
141
+ reference_id: "INQ2024XY",
142
+ priority: null,
143
+ lost: false,
144
+ },
145
+ // Campus Visit
146
+ {
147
+ id: 5,
148
+ name: "Aditi Sharma",
149
+ sub_lane_id: 4,
150
+ email: "aditisharma@gmail.com",
151
+ phone: "+91 9846213495",
152
+ status: "Lost",
153
+ progress: 0,
154
+ days: "10 Days",
155
+ reference_id: "2DQ2024XY",
156
+ priority: null,
157
+ lost: true,
158
+ },
159
+ {
160
+ id: 6,
161
+ name: "Aditi Sharma",
162
+ sub_lane_id: 4,
163
+ email: "aditisharma@gmail.com",
164
+ phone: "+91 9846213495",
165
+ status: "Active",
166
+ progress: 0,
167
+ days: "10 Days",
168
+ reference_id: "INQ2024XY",
169
+ priority: null,
170
+ lost: false,
171
+ },
172
+ // Application Collection
173
+ {
174
+ id: 7,
175
+ name: "Aditi Sharma",
176
+ sub_lane_id: 5,
177
+ email: "aditisharma@gmail.com",
178
+ phone: "+91 9452013495",
179
+ status: "Active",
180
+ progress: 0,
181
+ days: "10 Days",
182
+ reference_id: "INQ2024XY",
183
+ priority: null,
184
+ lost: false,
185
+ },
186
+ {
187
+ id: 8,
188
+ name: "Aditi Sharma",
189
+ sub_lane_id: 5,
190
+ email: "aditisharma@gmail.com",
191
+ phone: "+91 9452013495",
192
+ status: "Active",
193
+ progress: 0,
194
+ days: "10 Days",
195
+ reference_id: "INQ2024XY",
196
+ priority: null,
197
+ lost: false,
198
+ },
199
+ // Student Assessment
200
+ {
201
+ id: 9,
202
+ name: "Aditi Sharma",
203
+ sub_lane_id: 6,
204
+ email: "aditisharma@gmail.com",
205
+ phone: "+91 9452013495",
206
+ status: "Active",
207
+ progress: 0,
208
+ days: "10 Days",
209
+ reference_id: "INQ2024XY",
210
+ priority: null,
211
+ lost: false,
212
+ },
213
+ // Fee Collection
214
+ {
215
+ id: 10,
216
+ name: "Aditi Sharma",
217
+ sub_lane_id: 7,
218
+ email: "aditisharma@gmail.com",
219
+ phone: "+91 9846015495",
220
+ status: "Active",
221
+ progress: 0,
222
+ days: "You",
223
+ reference_id: "INQ2024XY",
224
+ priority: "High",
225
+ lost: false,
226
+ },
227
+ // System Integration
228
+ {
229
+ id: 11,
230
+ name: "Aditi Sharma",
231
+ sub_lane_id: 8,
232
+ email: "aditisharma@gmail.com",
233
+ phone: "+91 9846015495",
234
+ status: "Lost",
235
+ progress: 0,
236
+ days: "You",
237
+ reference_id: "INQ2024XY",
238
+ priority: "Low",
239
+ lost: true,
240
+ },
241
+ ],
242
+ };
243
+
244
+ export const COLOR_CONSTANTS = [
245
+ { color: "#fff0f3", darkColor: "#fea3b4" },
246
+ { color: "#fffbed", darkColor: "#fde272" },
247
+ { color: "#ebf9fc", darkColor: "#67e3f9" },
248
+ { color: "#edf9f3", darkColor: "#73e2a3" },
249
+ ];
@@ -0,0 +1,16 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ import { getKanbanData } from "../services/service";
3
+
4
+ export const useGetKanbanData = (entity_type: string) => {
5
+ const {
6
+ data: metaData,
7
+ isPending,
8
+ isLoading,
9
+ error,
10
+ } = useQuery({
11
+ queryKey: ["stageGroupsOptions", entity_type],
12
+ queryFn: () => getKanbanData(entity_type),
13
+ enabled: !!entity_type, // Only fetch when workflowId is valid
14
+ });
15
+ return { metaData, isPending, isLoading, error };
16
+ };
@@ -0,0 +1,340 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import {
3
+ Box,
4
+ Typography,
5
+ Accordion,
6
+ AccordionSummary,
7
+ AccordionDetails,
8
+ IconButton,
9
+ } from "@mui/material";
10
+ import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
11
+ import {
12
+ ExpandMore as ExpandMoreIcon,
13
+ Settings as SettingsIcon,
14
+ } from "@mui/icons-material";
15
+ import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
16
+ import { kanbanStyles } from "./styles/styles";
17
+ import { Lane, SubLane, SwimLane } from "./types/types";
18
+ import { COLOR_CONSTANTS } from "./constants/kanban-constants";
19
+ import Loader from "../listing/components/common/loader/loader";
20
+
21
+ const Kanban = ({
22
+ metaData,
23
+ data,
24
+ isLoading,
25
+ KanbanCardComponent,
26
+ showSettings,
27
+ onOpenSettings,
28
+ }: {
29
+ metaData: any;
30
+ data: any;
31
+ isLoading?: boolean;
32
+ KanbanCardComponent: React.ComponentType<{
33
+ key: string | number;
34
+ cardData: any;
35
+ }>;
36
+ showSettings: boolean;
37
+ onOpenSettings?: () => void;
38
+ }) => {
39
+ const [expandedPanels, setExpandedPanels] = useState<{
40
+ [key: string]: boolean;
41
+ }>({
42
+ Active: true,
43
+ });
44
+
45
+ const [subLaneExpanded, setSubLaneExpanded] = useState<{
46
+ [key: string]: boolean;
47
+ }>({});
48
+
49
+ useEffect(() => {
50
+ if (metaData?.swim_lanes?.length) {
51
+ const initial: { [key: string]: boolean } = {};
52
+ metaData?.swim_lanes.forEach((swim_lane: SwimLane) => {
53
+ swim_lane?.sub_lanes?.forEach((sub_lane) => {
54
+ const key = `${swim_lane.id}-${sub_lane.lane_id}-${sub_lane.id}`;
55
+ initial[key] = sub_lane.expanded || false;
56
+ });
57
+ });
58
+ setSubLaneExpanded(initial);
59
+ }
60
+ }, [metaData]);
61
+
62
+ const handleAccordionChange =
63
+ (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => {
64
+ setExpandedPanels((prev) => ({
65
+ ...prev,
66
+ [panel]: isExpanded,
67
+ }));
68
+ };
69
+
70
+ const toggleSubLane = (subLaneId: number | string) => {
71
+ setSubLaneExpanded((prev) => ({
72
+ ...prev,
73
+ [subLaneId]: !prev[subLaneId],
74
+ }));
75
+ };
76
+
77
+ const getLeadCount = (laneId: number): number => {
78
+ if (!metaData?.swim_lanes || !data) return 0;
79
+
80
+ const seenLeadIds = new Set<number | string>();
81
+ let count = 0;
82
+
83
+ metaData?.swim_lanes.forEach((swimLane: SwimLane) => {
84
+ swimLane.sub_lanes
85
+ ?.filter((subLane) => subLane.lane_id === laneId)
86
+ ?.forEach((subLane) => {
87
+ data.forEach((lead: any) => {
88
+ if (lead?.stage_id === subLane?.id && !seenLeadIds.has(lead?.id)) {
89
+ seenLeadIds.add(lead.id);
90
+ count++;
91
+ }
92
+ });
93
+ });
94
+ });
95
+
96
+ return count;
97
+ };
98
+
99
+ return (
100
+ <>
101
+ {isLoading ? (
102
+ <Loader />
103
+ ) : (
104
+ <Box>
105
+ <Box sx={{ width: "100%", bgcolor: "white", overflowX: "auto" }}>
106
+ {/* Header */}
107
+ <Box sx={kanbanStyles.topHeader}>
108
+ <IconButton
109
+ onClick={onOpenSettings}
110
+ sx={{
111
+ ...kanbanStyles.settingStyle,
112
+ visibility: showSettings ? "visible" : "hidden",
113
+ }}
114
+ >
115
+ <SettingsOutlinedIcon />
116
+ </IconButton>
117
+
118
+ {/* Lane Headers - Replaced Grid with Flex */}
119
+ <Box
120
+ sx={{
121
+ ...kanbanStyles.syncingStyle,
122
+ flex: 1,
123
+ }}
124
+ >
125
+ {metaData?.lanes?.map((lane: Lane, index: number) => (
126
+ <Box
127
+ className="lane-header"
128
+ sx={{
129
+ ...kanbanStyles.laneHeader,
130
+
131
+ bgcolor: lane.color || COLOR_CONSTANTS[index % 4].color,
132
+ }}
133
+ key={lane.id}
134
+ >
135
+ <Box
136
+ sx={{
137
+ ...kanbanStyles.badge,
138
+
139
+ bgcolor:
140
+ lane.darkColor ||
141
+ COLOR_CONSTANTS[index % 4].darkColor,
142
+ }}
143
+ >
144
+ {getLeadCount(Number(lane.id))}
145
+ </Box>
146
+
147
+ <Typography variant="h6" fontWeight="bold" sx={{ px: 2 }}>
148
+ {lane.name}
149
+ </Typography>
150
+ </Box>
151
+ ))}
152
+ </Box>
153
+ </Box>
154
+
155
+ {/* Content */}
156
+ <Box
157
+ className="kanban-content"
158
+ id="kanban-content"
159
+ sx={{
160
+ maxHeight: "calc(100vh - 186px)",
161
+ // minWidth: "100%",
162
+
163
+ width: "fit-content",
164
+ }}
165
+ >
166
+ {/* Swim Lanes */}
167
+ {metaData?.swim_lanes?.map((swim_lane: SwimLane) => (
168
+ <Accordion
169
+ key={swim_lane.id}
170
+ expanded={!!expandedPanels[swim_lane.name]}
171
+ onChange={handleAccordionChange(swim_lane.name)}
172
+ sx={kanbanStyles.swimLaneAccordionStyle}
173
+ // disabled={getSwimLaneCount(swim_lane.id) === 0 ? true : false}
174
+ >
175
+ <AccordionSummary
176
+ disabled={swim_lane?.sub_lanes?.length > 0 ? false : true}
177
+ expandIcon={
178
+ <ArrowDropDownIcon
179
+ sx={{
180
+ color: "black",
181
+ }}
182
+ />
183
+ }
184
+ sx={kanbanStyles.swimlaneWrapperStyle}
185
+ >
186
+ <Typography
187
+ variant="body1"
188
+ fontWeight="medium"
189
+ sx={{ ml: 1.5 }}
190
+ >
191
+ {swim_lane.name} ({swim_lane?.count})
192
+ </Typography>
193
+ </AccordionSummary>
194
+
195
+ <AccordionDetails
196
+ sx={{ pl: "16px", pr: "8px", width: "fit-content", py: 0 }}
197
+ >
198
+ {/* Replaced Grid with Flex */}
199
+ <Box sx={{ ...kanbanStyles.syncingStyle, pl: 7 }}>
200
+ {metaData?.lanes?.map((lane: Lane, index: number) => (
201
+ <Box
202
+ className="column"
203
+ sx={{
204
+ ...kanbanStyles.columnStyle,
205
+ bgcolor:
206
+ lane.color || COLOR_CONSTANTS[index % 4].color,
207
+ }}
208
+ key={lane.id}
209
+ >
210
+ {/* Sub-lanes for this lane */}
211
+ {swim_lane?.sub_lanes
212
+ ?.filter(
213
+ (sub_lane: SubLane) =>
214
+ sub_lane.lane_id.toString() === lane.id
215
+ )
216
+ ?.map((sub_section: SubLane) => {
217
+ const subLaneKey = `${swim_lane.id}-${lane.id}-${sub_section.id}`;
218
+ return (
219
+ <Accordion
220
+ key={sub_section.id}
221
+ expanded={
222
+ data?.filter(
223
+ (lead: any) =>
224
+ lead.stage_id === sub_section.id &&
225
+ lead.lead_status_id == swim_lane.id
226
+ )?.length === 0
227
+ ? false
228
+ : subLaneExpanded[subLaneKey] || false
229
+ }
230
+ onChange={() => toggleSubLane(subLaneKey)}
231
+ sx={{
232
+ ...kanbanStyles.stageStyle,
233
+ borderLeft: `4px solid ${
234
+ lane.darkColor ||
235
+ COLOR_CONSTANTS[index % 4].darkColor
236
+ }`,
237
+ }}
238
+ // disabled={
239
+ // metaData?.data?.filter(
240
+ // (lead: LeadData) =>
241
+ // lead.sub_lane_id === sub_section.id &&
242
+ // !usedLeadIds.has(lead.id)
243
+ // )?.length === 0
244
+ // ? true
245
+ // : false
246
+ // }
247
+ >
248
+ <AccordionSummary
249
+ expandIcon={
250
+ <ExpandMoreIcon
251
+ sx={{
252
+ display:
253
+ data?.filter(
254
+ (lead: any) =>
255
+ lead.stage_id ===
256
+ sub_section.id &&
257
+ lead.lead_status_id ==
258
+ swim_lane.id
259
+ )?.length === 0
260
+ ? "none"
261
+ : "block",
262
+ }}
263
+ />
264
+ }
265
+ sx={kanbanStyles.subSectionAccordion}
266
+ >
267
+ <Box
268
+ sx={
269
+ kanbanStyles.subSectionHeaderContainer
270
+ }
271
+ >
272
+ <Box
273
+ className="sub-section-count"
274
+ sx={{
275
+ ...kanbanStyles.subSectionCountContainer,
276
+ bgcolor:
277
+ lane.darkColor ||
278
+ COLOR_CONSTANTS[index % 4]
279
+ .darkColor,
280
+ }}
281
+ >
282
+ {data?.filter(
283
+ (lead: any) =>
284
+ lead.stage_id === sub_section.id &&
285
+ lead.lead_status_id === swim_lane.id
286
+ )?.length || 0}
287
+ </Box>
288
+ <Typography
289
+ fontWeight="700"
290
+ color="#555354"
291
+ fontSize="12px"
292
+ >
293
+ {sub_section.name}
294
+ </Typography>
295
+ </Box>
296
+ </AccordionSummary>
297
+
298
+ <AccordionDetails
299
+ sx={kanbanStyles.cardsContainer}
300
+ >
301
+ {(() => {
302
+ const leadsForThisSubLane =
303
+ data?.filter(
304
+ (lead: any) =>
305
+ lead.stage_id === sub_section.id &&
306
+ lead.lead_status_id ==
307
+ swim_lane.id &&
308
+ lead.stage_group_id == lane.id
309
+ ) || [];
310
+
311
+ return leadsForThisSubLane.map(
312
+ (card: any) =>
313
+ (KanbanCardComponent && (
314
+ <KanbanCardComponent
315
+ key={card.id}
316
+ cardData={card}
317
+ />
318
+ )) ||
319
+ null
320
+ );
321
+ })()}
322
+ </AccordionDetails>
323
+ </Accordion>
324
+ );
325
+ })}
326
+ </Box>
327
+ ))}
328
+ </Box>
329
+ </AccordionDetails>
330
+ </Accordion>
331
+ ))}
332
+ </Box>
333
+ </Box>
334
+ </Box>
335
+ )}
336
+ </>
337
+ );
338
+ };
339
+
340
+ export default Kanban;
@@ -0,0 +1,11 @@
1
+ import { api } from "../../listing/libs/utils/common";
2
+
3
+ export const getKanbanData = async (entity_type: string) => {
4
+ try {
5
+ const response = await api.get(`/lead/getlanes?entity_type=${entity_type}`);
6
+ return response.data;
7
+ } catch (error) {
8
+ console.error("Failed to fetch action category:", error);
9
+ throw error;
10
+ }
11
+ };