rez-table-listing-mui 1.3.62 → 2.0.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.
- package/dist/index.d.ts +5 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/listing/components/index.scss +0 -144
- package/src/listing/components/login/index.tsx +4 -4
- package/src/listing/components/pagination/default/index.tsx +108 -138
- package/src/listing/components/pagination/default/pagination.styles.ts +115 -0
- package/src/listing/components/search/index.tsx +4 -8
- package/src/listing/components/{table-body-dnd-cell.tsx → table-body/table-body-dnd-cell.tsx} +18 -25
- package/src/listing/components/table-body/table-body.styles.ts +64 -0
- package/src/listing/components/{table-body.tsx → table-body/table-body.tsx} +35 -32
- package/src/listing/components/table-head/table-head-dnd-cell.tsx +112 -0
- package/src/listing/components/table-head/table-head-pin.tsx +29 -0
- package/src/listing/components/{table-head-popover.tsx → table-head/table-head-popover.tsx} +4 -16
- package/src/listing/components/table-head/table-head-resizer.tsx +22 -0
- package/src/listing/components/table-head/table-head.styles.ts +113 -0
- package/src/listing/components/{table-head.tsx → table-head/table-head.tsx} +36 -69
- package/src/listing/components/table.tsx +2 -2
- package/src/listing/components/tabs/index.tsx +31 -49
- package/src/listing/components/tabs/tabs.styles.ts +49 -0
- package/src/listing/components/topbar/index.scss +2 -4
- package/src/listing/components/topbar/index.tsx +169 -175
- package/src/listing/libs/hooks/useEntityTableHooks.ts +3 -3
- package/src/listing/libs/utils/apiColumn.ts +7 -3
- package/src/listing/libs/utils/common.ts +44 -0
- package/src/listing/types/table.ts +2 -2
- package/src/view/ListingView.tsx +38 -87
- package/src/listing/components/table-head-dnd-cell.tsx +0 -150
- package/src/listing/components/table-head-pin.tsx +0 -22
- package/src/listing/components/tabs/index.scss +0 -42
- package/src/listing/components/tabs/styles.ts +0 -34
|
@@ -5,9 +5,8 @@ import {
|
|
|
5
5
|
FilterationIcon,
|
|
6
6
|
HideColumnIcon,
|
|
7
7
|
} from "../../../assets/svg.tsx";
|
|
8
|
-
import { Popover } from "@mui/material";
|
|
8
|
+
import { Box, Popover } from "@mui/material";
|
|
9
9
|
import LayoutSelector from "../table-change-layout.tsx";
|
|
10
|
-
import useOutsideClick from "../../libs/hooks/useOutsideClick.tsx";
|
|
11
10
|
import { Table } from "@tanstack/react-table";
|
|
12
11
|
import { TopbarOptionsProps } from "../../types/table.ts";
|
|
13
12
|
import "./index.scss";
|
|
@@ -48,7 +47,6 @@ function Topbar<T>({
|
|
|
48
47
|
const [sortAnchorEl, setSortAnchorEl] = useState<HTMLElement | null>(null);
|
|
49
48
|
const [groupBy, setGroupBy] = useState<string>("None");
|
|
50
49
|
|
|
51
|
-
const [showColumnHiding, setShowColumnHiding] = useState(false);
|
|
52
50
|
const [layoutAnchorEl, setLayoutAnchorEl] = useState<null | HTMLElement>(
|
|
53
51
|
null
|
|
54
52
|
);
|
|
@@ -60,10 +58,6 @@ function Topbar<T>({
|
|
|
60
58
|
table.getAllLeafColumns().map((col) => col.id)
|
|
61
59
|
);
|
|
62
60
|
|
|
63
|
-
const { setShowTableFilter } = tableStates;
|
|
64
|
-
|
|
65
|
-
// search
|
|
66
|
-
const [showSearchInput, setShowSearchInput] = useState(false);
|
|
67
61
|
const searchContainerRef = useRef<HTMLDivElement>(null);
|
|
68
62
|
|
|
69
63
|
// sync column order with table instance
|
|
@@ -78,7 +72,6 @@ function Topbar<T>({
|
|
|
78
72
|
setSortAnchorEl(null);
|
|
79
73
|
setColumnAnchorEl(null);
|
|
80
74
|
setViewMoreAnchorEl(null);
|
|
81
|
-
setShowColumnHiding(false);
|
|
82
75
|
}
|
|
83
76
|
}, [isFullscreen]);
|
|
84
77
|
|
|
@@ -96,22 +89,11 @@ function Topbar<T>({
|
|
|
96
89
|
|
|
97
90
|
const { container: fullscreenContainer } = useFullscreenPopoverContainer();
|
|
98
91
|
|
|
99
|
-
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
100
|
-
useOutsideClick({
|
|
101
|
-
ref: dropdownRef,
|
|
102
|
-
handler: () => setShowColumnHiding(false),
|
|
103
|
-
});
|
|
104
|
-
|
|
105
92
|
const handleLayoutSelect = (layout: string) => {
|
|
106
93
|
setSelectedLayout(layout);
|
|
107
94
|
setLayoutAnchorEl(null);
|
|
108
95
|
};
|
|
109
96
|
|
|
110
|
-
useOutsideClick({
|
|
111
|
-
ref: searchContainerRef,
|
|
112
|
-
handler: () => setShowSearchInput(false),
|
|
113
|
-
});
|
|
114
|
-
|
|
115
97
|
useEffect(() => {
|
|
116
98
|
const handleExternalLayoutTrigger = (e: Event) => {
|
|
117
99
|
const target = (e as CustomEvent).detail?.target as HTMLElement;
|
|
@@ -128,7 +110,6 @@ function Topbar<T>({
|
|
|
128
110
|
};
|
|
129
111
|
|
|
130
112
|
const handleExternalSearchTrigger = () => {
|
|
131
|
-
setShowSearchInput(true);
|
|
132
113
|
setTimeout(() => {
|
|
133
114
|
searchContainerRef.current?.querySelector("input")?.focus();
|
|
134
115
|
}, 100);
|
|
@@ -180,96 +161,107 @@ function Topbar<T>({
|
|
|
180
161
|
{rightSideComponent}
|
|
181
162
|
{paginationComponent}
|
|
182
163
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
164
|
+
<Box
|
|
165
|
+
sx={{
|
|
166
|
+
display: "flex",
|
|
167
|
+
alignItems: "center",
|
|
168
|
+
justifyContent: "center",
|
|
169
|
+
gap: 0.5,
|
|
170
|
+
}}
|
|
171
|
+
>
|
|
172
|
+
{showSearch && (
|
|
173
|
+
<Box
|
|
174
|
+
title="Search"
|
|
175
|
+
className="external-search-trigger"
|
|
176
|
+
onClick={() => {
|
|
177
|
+
const customEvent = new CustomEvent("triggerSearchInput");
|
|
178
|
+
window.dispatchEvent(customEvent);
|
|
179
|
+
}}
|
|
180
|
+
ref={searchContainerRef}
|
|
181
|
+
>
|
|
182
|
+
<TableSearch
|
|
183
|
+
value={searchValue ?? ""}
|
|
184
|
+
onChange={onSearchChange ?? (() => {})}
|
|
185
|
+
/>
|
|
186
|
+
</Box>
|
|
187
|
+
)}
|
|
188
|
+
|
|
189
|
+
{showChangeLayoutToggle && (
|
|
190
|
+
<>
|
|
191
|
+
<div className="change-layout ts--button" title="Layout">
|
|
192
|
+
<div
|
|
193
|
+
onClick={(e) => {
|
|
194
|
+
const customEvent = new CustomEvent(
|
|
195
|
+
"triggerLayoutPopover",
|
|
196
|
+
{
|
|
197
|
+
detail: { target: e.currentTarget },
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
window.dispatchEvent(customEvent);
|
|
201
|
+
}}
|
|
202
|
+
className="external-layout-trigger"
|
|
203
|
+
>
|
|
204
|
+
<ChangeLayoutIcon />
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
</>
|
|
208
|
+
)}
|
|
209
|
+
<Popover
|
|
210
|
+
open={Boolean(layoutAnchorEl)}
|
|
211
|
+
anchorEl={layoutAnchorEl}
|
|
212
|
+
onClose={() => setLayoutAnchorEl(null)}
|
|
213
|
+
anchorOrigin={{ vertical: "bottom", horizontal: "left" }}
|
|
214
|
+
container={fullscreenContainer}
|
|
215
|
+
sx={{
|
|
216
|
+
mt: 2.2,
|
|
190
217
|
}}
|
|
191
|
-
ref={searchContainerRef}
|
|
192
218
|
>
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
219
|
+
<LayoutSelector
|
|
220
|
+
onSelect={handleLayoutSelect}
|
|
221
|
+
selectedLayout={selectedLayout}
|
|
196
222
|
/>
|
|
197
|
-
</
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
{showChangeLayoutToggle && (
|
|
201
|
-
<>
|
|
202
|
-
<div className="change-layout ts--button" title="Layout">
|
|
223
|
+
</Popover>
|
|
224
|
+
{showColumnToggle && (
|
|
225
|
+
<>
|
|
203
226
|
<div
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
});
|
|
208
|
-
window.dispatchEvent(customEvent);
|
|
209
|
-
}}
|
|
210
|
-
className="external-layout-trigger"
|
|
227
|
+
className="hide-column ts--button"
|
|
228
|
+
onClick={(e) => setColumnAnchorEl(e.currentTarget)}
|
|
229
|
+
title="Column"
|
|
211
230
|
>
|
|
212
|
-
<
|
|
231
|
+
<HideColumnIcon />
|
|
213
232
|
</div>
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
sx={{
|
|
224
|
-
mt: 2.2,
|
|
225
|
-
}}
|
|
226
|
-
>
|
|
227
|
-
<LayoutSelector
|
|
228
|
-
onSelect={handleLayoutSelect}
|
|
229
|
-
selectedLayout={selectedLayout}
|
|
230
|
-
/>
|
|
231
|
-
</Popover>
|
|
232
|
-
{showColumnToggle && (
|
|
233
|
-
<>
|
|
234
|
-
<div
|
|
235
|
-
className="hide-column ts--button"
|
|
236
|
-
onClick={(e) => setColumnAnchorEl(e.currentTarget)}
|
|
237
|
-
title="Column"
|
|
238
|
-
>
|
|
239
|
-
<HideColumnIcon />
|
|
240
|
-
</div>
|
|
241
|
-
<ColumnToggle
|
|
242
|
-
anchorEl={columnAnchorEl}
|
|
243
|
-
onClose={() => setColumnAnchorEl(null)}
|
|
244
|
-
table={table}
|
|
245
|
-
columnOrder={columnOrder}
|
|
246
|
-
setColumnOrder={setColumnOrder}
|
|
247
|
-
/>
|
|
248
|
-
</>
|
|
249
|
-
)}
|
|
233
|
+
<ColumnToggle
|
|
234
|
+
anchorEl={columnAnchorEl}
|
|
235
|
+
onClose={() => setColumnAnchorEl(null)}
|
|
236
|
+
table={table}
|
|
237
|
+
columnOrder={columnOrder}
|
|
238
|
+
setColumnOrder={setColumnOrder}
|
|
239
|
+
/>
|
|
240
|
+
</>
|
|
241
|
+
)}
|
|
250
242
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
243
|
+
{showSortingToggle && (
|
|
244
|
+
<>
|
|
245
|
+
<div
|
|
246
|
+
className="filter ts--button"
|
|
247
|
+
title="Sort"
|
|
248
|
+
onClick={(e) => setSortAnchorEl(e.currentTarget)}
|
|
249
|
+
>
|
|
250
|
+
<SortingIcon />
|
|
251
|
+
</div>
|
|
252
|
+
<SortPopover
|
|
253
|
+
anchorEl={sortAnchorEl}
|
|
254
|
+
onClose={() => setSortAnchorEl(null)}
|
|
255
|
+
columns={table.getAllLeafColumns().map((col) => ({
|
|
256
|
+
id: col.id,
|
|
257
|
+
label: (col.columnDef.meta as any)?.label || col.id,
|
|
258
|
+
}))}
|
|
259
|
+
onChange={(sortingRules) => table.setSorting(sortingRules)}
|
|
260
|
+
/>
|
|
261
|
+
</>
|
|
262
|
+
)}
|
|
271
263
|
|
|
272
|
-
|
|
264
|
+
{/* {showFilterToggle && (
|
|
273
265
|
<div
|
|
274
266
|
className="filter ts--button"
|
|
275
267
|
title="Filter"
|
|
@@ -298,51 +290,52 @@ function Topbar<T>({
|
|
|
298
290
|
</div>
|
|
299
291
|
)} */}
|
|
300
292
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
/>
|
|
328
|
-
|
|
329
|
-
{tableStates.filters.length > 0 && !tableStates.showTableFilter && (
|
|
330
|
-
<span
|
|
331
|
-
style={{
|
|
332
|
-
position: "absolute",
|
|
333
|
-
top: "1px",
|
|
334
|
-
right: "1px",
|
|
335
|
-
width: "6px",
|
|
336
|
-
height: "6px",
|
|
337
|
-
borderRadius: "50%",
|
|
338
|
-
backgroundColor: "#F63D68",
|
|
339
|
-
}}
|
|
293
|
+
{showFilterToggle && (
|
|
294
|
+
<div
|
|
295
|
+
className="filter ts--button"
|
|
296
|
+
title="Filter"
|
|
297
|
+
onClick={onFilterButtonClick}
|
|
298
|
+
style={{
|
|
299
|
+
position: "relative",
|
|
300
|
+
display: "flex",
|
|
301
|
+
justifyContent: "center",
|
|
302
|
+
alignItems: "center",
|
|
303
|
+
backgroundColor:
|
|
304
|
+
tableStates.showTableFilter || tableStates.filters.length > 0
|
|
305
|
+
? "#eae4fe"
|
|
306
|
+
: "transparent",
|
|
307
|
+
height: "25px",
|
|
308
|
+
width: "25px",
|
|
309
|
+
borderRadius: "6px",
|
|
310
|
+
cursor: "pointer",
|
|
311
|
+
}}
|
|
312
|
+
>
|
|
313
|
+
<FilterationIcon
|
|
314
|
+
color={
|
|
315
|
+
tableStates.showTableFilter || tableStates.filters.length > 0
|
|
316
|
+
? "#7A5AF8"
|
|
317
|
+
: "#1C1B1F"
|
|
318
|
+
}
|
|
340
319
|
/>
|
|
341
|
-
)}
|
|
342
|
-
</div>
|
|
343
|
-
)}
|
|
344
320
|
|
|
345
|
-
|
|
321
|
+
{tableStates.filters.length > 0 &&
|
|
322
|
+
!tableStates.showTableFilter && (
|
|
323
|
+
<span
|
|
324
|
+
style={{
|
|
325
|
+
position: "absolute",
|
|
326
|
+
top: "1px",
|
|
327
|
+
right: "1px",
|
|
328
|
+
width: "6px",
|
|
329
|
+
height: "6px",
|
|
330
|
+
borderRadius: "50%",
|
|
331
|
+
backgroundColor: "#F63D68",
|
|
332
|
+
}}
|
|
333
|
+
/>
|
|
334
|
+
)}
|
|
335
|
+
</div>
|
|
336
|
+
)}
|
|
337
|
+
|
|
338
|
+
{/* {viewMoreToggle && (
|
|
346
339
|
<div className="view-more ts--button" title="View More">
|
|
347
340
|
<ViewMore
|
|
348
341
|
compactMode={isCompactTable}
|
|
@@ -357,7 +350,7 @@ function Topbar<T>({
|
|
|
357
350
|
/>
|
|
358
351
|
</div>
|
|
359
352
|
)} */}
|
|
360
|
-
|
|
353
|
+
{/* {viewMoreToggle && (
|
|
361
354
|
<div
|
|
362
355
|
className="view-more ts--button view-more-trigger"
|
|
363
356
|
title="View More"
|
|
@@ -375,36 +368,37 @@ function Topbar<T>({
|
|
|
375
368
|
/>
|
|
376
369
|
</div>
|
|
377
370
|
)} */}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
onClose={() => setViewMoreAnchorEl(null)}
|
|
382
|
-
anchorOrigin={{ vertical: "bottom", horizontal: "left" }}
|
|
383
|
-
transformOrigin={{ vertical: "top", horizontal: "left" }}
|
|
384
|
-
container={fullscreenContainer}
|
|
385
|
-
// PaperProps={{
|
|
386
|
-
// sx: {
|
|
387
|
-
// mt: 2,
|
|
388
|
-
// padding: 0,
|
|
389
|
-
// width: 380,
|
|
390
|
-
// borderRadius: 1,
|
|
391
|
-
// boxShadow: 4,
|
|
392
|
-
// },
|
|
393
|
-
// }}
|
|
394
|
-
>
|
|
395
|
-
<ViewMore
|
|
396
|
-
compactMode={isCompactTable}
|
|
397
|
-
onCompactToggle={(value: string) =>
|
|
398
|
-
setIsCompactTable(value === "Compact")
|
|
399
|
-
}
|
|
400
|
-
isFullscreen={isFullscreen}
|
|
401
|
-
onFullscreenToggle={fullscreenToggle}
|
|
402
|
-
groupBy={groupBy}
|
|
403
|
-
onGroupByChange={(value: string) => setGroupBy(value)}
|
|
404
|
-
tableStates={tableStates}
|
|
371
|
+
<Popover
|
|
372
|
+
open={isViewMoreOpen}
|
|
373
|
+
anchorEl={viewMoreAnchorEl}
|
|
405
374
|
onClose={() => setViewMoreAnchorEl(null)}
|
|
406
|
-
|
|
407
|
-
|
|
375
|
+
anchorOrigin={{ vertical: "bottom", horizontal: "left" }}
|
|
376
|
+
transformOrigin={{ vertical: "top", horizontal: "left" }}
|
|
377
|
+
container={fullscreenContainer}
|
|
378
|
+
// PaperProps={{
|
|
379
|
+
// sx: {
|
|
380
|
+
// mt: 2,
|
|
381
|
+
// padding: 0,
|
|
382
|
+
// width: 380,
|
|
383
|
+
// borderRadius: 1,
|
|
384
|
+
// boxShadow: 4,
|
|
385
|
+
// },
|
|
386
|
+
// }}
|
|
387
|
+
>
|
|
388
|
+
<ViewMore
|
|
389
|
+
compactMode={isCompactTable}
|
|
390
|
+
onCompactToggle={(value: string) =>
|
|
391
|
+
setIsCompactTable(value === "Compact")
|
|
392
|
+
}
|
|
393
|
+
isFullscreen={isFullscreen}
|
|
394
|
+
onFullscreenToggle={fullscreenToggle}
|
|
395
|
+
groupBy={groupBy}
|
|
396
|
+
onGroupByChange={(value: string) => setGroupBy(value)}
|
|
397
|
+
tableStates={tableStates}
|
|
398
|
+
onClose={() => setViewMoreAnchorEl(null)}
|
|
399
|
+
/>
|
|
400
|
+
</Popover>
|
|
401
|
+
</Box>
|
|
408
402
|
</div>
|
|
409
403
|
</div>
|
|
410
404
|
);
|
|
@@ -14,11 +14,11 @@ export const useDetailsQueryAPI = (value: string | undefined) => {
|
|
|
14
14
|
return { detailsQuery };
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export const useFetchData = (entity_type: string) => {
|
|
17
|
+
export const useFetchData = (entity_type: string, payload?: any) => {
|
|
18
18
|
// First query to get meta data
|
|
19
19
|
const metaQuery = useQuery({
|
|
20
|
-
queryKey: ["meta", entity_type],
|
|
21
|
-
queryFn: () => entityTableFilterMaster(entity_type),
|
|
20
|
+
queryKey: ["meta", entity_type, payload],
|
|
21
|
+
queryFn: () => entityTableFilterMaster(entity_type, payload),
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
return { metaQuery };
|
|
@@ -27,10 +27,14 @@ export const entityTableMetaMaster = async (entity_type: string) => {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
export const entityTableFilterMaster = async (
|
|
30
|
+
export const entityTableFilterMaster = async (
|
|
31
|
+
entity_type: string,
|
|
32
|
+
payload?: any
|
|
33
|
+
) => {
|
|
31
34
|
try {
|
|
32
35
|
const response = await api.post(
|
|
33
|
-
`/meta/get-table-data?entity_type=${entity_type}&list_type=${entity_type}
|
|
36
|
+
`/meta/get-table-data?entity_type=${entity_type}&list_type=${entity_type}`,
|
|
37
|
+
payload
|
|
34
38
|
);
|
|
35
39
|
|
|
36
40
|
// const filteredData = {
|
|
@@ -215,6 +219,6 @@ export const getAttributes = async (entity_type: string) => {
|
|
|
215
219
|
};
|
|
216
220
|
|
|
217
221
|
export const getTableTabs = async (payload: any) => {
|
|
218
|
-
const response = await api.post(`filter/
|
|
222
|
+
const response = await api.post(`filter/adm/tabs`, payload);
|
|
219
223
|
return response.data;
|
|
220
224
|
};
|
|
@@ -111,3 +111,47 @@ api.interceptors.request.use(
|
|
|
111
111
|
return Promise.reject(error);
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
|
+
|
|
115
|
+
export const formatTableHeaders = (columns: any) => {
|
|
116
|
+
const mapped = columns.map((col: any) => {
|
|
117
|
+
const meta =
|
|
118
|
+
col.attribute_key === "status" ||
|
|
119
|
+
col.attribute_key === "lead_status" ||
|
|
120
|
+
col.attribute_key === "flag" ||
|
|
121
|
+
col.attribute_key === "invitation_status"
|
|
122
|
+
? { type: "custom", propName: "renderStatus", align: col.align }
|
|
123
|
+
: col.attribute_key === "profile_image" ||
|
|
124
|
+
col.attribute_key === "short_logo"
|
|
125
|
+
? {
|
|
126
|
+
type: "custom",
|
|
127
|
+
propName: "profileImageFetch",
|
|
128
|
+
align: col.align,
|
|
129
|
+
}
|
|
130
|
+
: col.attribute_key === "start_date" || col.attribute_key === "end_date"
|
|
131
|
+
? { type: "custom", propName: "dateFormater", align: col.align }
|
|
132
|
+
: col.attribute_key === "action"
|
|
133
|
+
? { type: "custom", propName: "renderAction", align: col.align }
|
|
134
|
+
: col.attribute_key === "code"
|
|
135
|
+
? {
|
|
136
|
+
type: "custom",
|
|
137
|
+
propName: "drillCellRenderer",
|
|
138
|
+
align: col.align,
|
|
139
|
+
}
|
|
140
|
+
: col.attribute_key === "primary_mobile"
|
|
141
|
+
? {
|
|
142
|
+
type: "custom",
|
|
143
|
+
propName: "apiCallonClick",
|
|
144
|
+
align: col.align,
|
|
145
|
+
}
|
|
146
|
+
: undefined;
|
|
147
|
+
|
|
148
|
+
return {
|
|
149
|
+
header: col.name ?? "",
|
|
150
|
+
accessorKey: col.attribute_key ?? "",
|
|
151
|
+
size: col.size,
|
|
152
|
+
meta,
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
return mapped;
|
|
157
|
+
};
|
|
@@ -95,7 +95,7 @@ export interface CraftTableProps<T> {
|
|
|
95
95
|
filterOptions?: FilterOptionsProps;
|
|
96
96
|
settingsOptions?: settingsOptionsProps;
|
|
97
97
|
craftTableFilterSettingsOptions?: craftTableFilterSettingsOptionsProps;
|
|
98
|
-
activeTab?:
|
|
98
|
+
activeTab?: any;
|
|
99
99
|
}
|
|
100
100
|
export interface CraftTableComponentProps<T> {
|
|
101
101
|
table: Table<T>;
|
|
@@ -115,6 +115,6 @@ export interface TableHeaderProps<T> {
|
|
|
115
115
|
activeTab?: string;
|
|
116
116
|
featureOptions: CraftTableFeatureProps;
|
|
117
117
|
tableStates: CraftTableOptionsProps;
|
|
118
|
-
filterSettingStates
|
|
118
|
+
filterSettingStates?: craftTableFilterSettingsOptionsProps;
|
|
119
119
|
onSaveSettings?: (columnId: string) => void;
|
|
120
120
|
}
|