rez-table-listing-mui 0.0.26 → 1.0.27

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.
@@ -243,6 +243,30 @@ function TableWrapper<T>({
243
243
 
244
244
  return (
245
245
  <div className="ts__table__container" ref={tableRef}>
246
+ {enableTopbar && (
247
+ <Topbar
248
+ table={table}
249
+ topbarOptions={craftTopbarOptions}
250
+ isCompactTable={isCompactTable}
251
+ setIsCompactTable={setIsCompactTable}
252
+ isFullscreen={isFullscreen}
253
+ fullscreenToggle={handleFullscreenToggle}
254
+ paginationComponent={
255
+ craftPaginationOptions?.showPagination === true &&
256
+ craftPaginationOptions?.paginationPosition === "top" ? (
257
+ <DefaultPagination
258
+ table={table}
259
+ rowsPerPageArray={rowsPerPageArray}
260
+ paginationOptions={craftPaginationOptions}
261
+ />
262
+ ) : null
263
+ }
264
+ // searchValue={searchValue} // 👈 new
265
+ // onSearchChange={onSearchChange}
266
+ tableStates={tableStates}
267
+ />
268
+ )}
269
+
246
270
  {isLoading ? (
247
271
  loadingComponent ?? (
248
272
  <div className="ts__loader">
@@ -251,70 +275,44 @@ function TableWrapper<T>({
251
275
  </div>
252
276
  )
253
277
  ) : (
254
- <>
255
- {enableTopbar && (
256
- <Topbar
278
+ <div
279
+ // {...tableWrapperProps}
280
+ className={`ts__table__wrapper ${
281
+ isFullscreen ? "is-fullscreen" : ""
282
+ }`}
283
+ >
284
+ {enableColumnReordering ? (
285
+ <TableDND
257
286
  table={table}
258
- topbarOptions={craftTopbarOptions}
287
+ columnOrder={columnOrder}
288
+ featureOptions={craftFeatureOptions}
289
+ NestedComponent={nestedComponent}
290
+ setColumnOrder={setColumnOrder}
259
291
  isCompactTable={isCompactTable}
260
- setIsCompactTable={setIsCompactTable}
261
- isFullscreen={isFullscreen}
262
- fullscreenToggle={handleFullscreenToggle}
263
- paginationComponent={
264
- craftPaginationOptions?.showPagination === true &&
265
- craftPaginationOptions?.paginationPosition === "top" ? (
266
- <DefaultPagination
267
- table={table}
268
- rowsPerPageArray={rowsPerPageArray}
269
- paginationOptions={craftPaginationOptions}
270
- />
271
- ) : null
272
- }
273
- // searchValue={searchValue} // 👈 new
274
- // onSearchChange={onSearchChange}
275
292
  tableStates={tableStates}
276
293
  />
277
- )}
278
-
279
- <div
280
- // {...tableWrapperProps}
281
- className={`ts__table__wrapper ${
282
- isFullscreen ? "is-fullscreen" : ""
283
- }`}
284
- >
285
- {enableColumnReordering ? (
286
- <TableDND
287
- table={table}
288
- columnOrder={columnOrder}
289
- featureOptions={craftFeatureOptions}
290
- NestedComponent={nestedComponent}
291
- setColumnOrder={setColumnOrder}
292
- isCompactTable={isCompactTable}
293
- tableStates={tableStates}
294
- />
295
- ) : (
296
- <Table
297
- table={table}
298
- featureOptions={craftFeatureOptions}
299
- NestedComponent={nestedComponent}
300
- columnOrder={columnOrder}
301
- setColumnOrder={setColumnOrder}
302
- isCompactTable={isCompactTable}
303
- tableStates={tableStates}
304
- />
305
- )}
306
- </div>
307
-
308
- {craftPaginationOptions?.showPagination === true &&
309
- craftPaginationOptions?.paginationPosition === "bottom" ? (
310
- <DefaultPagination
294
+ ) : (
295
+ <Table
311
296
  table={table}
312
- rowsPerPageArray={rowsPerPageArray}
313
- paginationOptions={craftPaginationOptions}
297
+ featureOptions={craftFeatureOptions}
298
+ NestedComponent={nestedComponent}
299
+ columnOrder={columnOrder}
300
+ setColumnOrder={setColumnOrder}
301
+ isCompactTable={isCompactTable}
302
+ tableStates={tableStates}
314
303
  />
315
- ) : null}
316
- </>
304
+ )}
305
+ </div>
317
306
  )}
307
+
308
+ {craftPaginationOptions?.showPagination === true &&
309
+ craftPaginationOptions?.paginationPosition === "bottom" ? (
310
+ <DefaultPagination
311
+ table={table}
312
+ rowsPerPageArray={rowsPerPageArray}
313
+ paginationOptions={craftPaginationOptions}
314
+ />
315
+ ) : null}
318
316
  </div>
319
317
  );
320
318
  }
@@ -66,7 +66,7 @@ const entityListingCall = async ({
66
66
  export const useEntityTableAPI = ({
67
67
  page = 0,
68
68
  size = 50,
69
- quickFilter,
69
+ quickFilter = [],
70
70
  }: EntityTableAPIProps) => {
71
71
  const { data, isPending: isTableDataPending } = useQuery({
72
72
  queryKey: [page, size, quickFilter],
@@ -166,11 +166,13 @@ export const useCommonDropdownAPI = (
166
166
 
167
167
  // Step 2: Use useQueries to fetch them all in parallel
168
168
  const dropdownResults = useQueries({
169
- queries: dropdownConfigs.map((cfg) => ({
170
- queryKey: ["commonDropdown", cfg.dataSourceType],
171
- queryFn: () => commonGetDropdownDataAPI(cfg.dataSourceType, null),
172
- enabled: !!cfg.dataSourceType,
173
- })),
169
+ queries: dropdownConfigs.map((cfg) => {
170
+ return {
171
+ queryKey: ["commonDropdown", cfg.dataSourceType],
172
+ queryFn: () => commonGetDropdownDataAPI(cfg.dataSourceType, null),
173
+ enabled: !!cfg.dataSourceType,
174
+ };
175
+ }),
174
176
  });
175
177
 
176
178
  // Step 3: Map results to keys
@@ -1,6 +1,6 @@
1
1
  import { api } from "./common";
2
2
  import {
3
- createSavedFilterPaload,
3
+ createSavedFilterPayload,
4
4
  deleteSavedFilterPayload,
5
5
  updateSavedFilterPayload,
6
6
  } from "../../types/filter";
@@ -52,13 +52,13 @@ export const fetchDetailsByFilterId = async (filterId: string) => {
52
52
 
53
53
  export const commonGetDropdownDataAPI = async (
54
54
  entity_type: string,
55
- organization_id?: string | null,
55
+ // organization_id?: string | null,
56
56
  data?: any
57
57
  ) => {
58
58
  try {
59
59
  const requestBody = {
60
60
  status: "ACTIVE",
61
- organization_id: organization_id,
61
+ organization_id: 1,
62
62
  ...data,
63
63
  };
64
64
 
@@ -76,7 +76,7 @@ export const commonGetDropdownDataAPI = async (
76
76
 
77
77
  export const createSavedFilter = async (
78
78
  entity_type: string,
79
- payload: createSavedFilterPaload
79
+ payload: createSavedFilterPayload
80
80
  ) => {
81
81
  try {
82
82
  const response = await api.post(
@@ -124,7 +124,7 @@ interface FilterDetail {
124
124
  filter_value: string | string[];
125
125
  }
126
126
 
127
- export interface createSavedFilterPaload {
127
+ export interface createSavedFilterPayload {
128
128
  name: string;
129
129
  organization_id?: number;
130
130
  enterprise_id?: number;
@@ -155,14 +155,6 @@ export interface updateSavedFilterPayload {
155
155
  filterDetails: FilterDetail[];
156
156
  }
157
157
 
158
- export interface deleteSavedFilterPayload {
159
- name: string;
160
- is_default: boolean;
161
- id: string | number;
162
- status?: string;
163
- entity_type: string;
164
- mapped_entity_type: string;
165
- }
166
158
  interface FilterDetail {
167
159
  filter_attribute: string;
168
160
  filter_operator: string;
@@ -181,6 +173,7 @@ export interface FilterFormComponentProps {
181
173
  setEditMode?: React.Dispatch<React.SetStateAction<boolean>>;
182
174
  setDeleteFilterModalOpen?: React.Dispatch<React.SetStateAction<boolean>>;
183
175
  setSavedFilterModalOpen?: React.Dispatch<React.SetStateAction<boolean>>;
176
+ tabValue?: number;
184
177
  }
185
178
 
186
179
  export interface FilterMasterStateProps {
@@ -192,6 +185,7 @@ export interface FilterMasterStateProps {
192
185
  selectedId: string;
193
186
  selectedName: string;
194
187
  };
188
+ activeFilterTabIndex: number;
195
189
  }
196
190
 
197
191
  export interface AttributesFilterProps {
@@ -200,6 +194,7 @@ export interface AttributesFilterProps {
200
194
  dropdownData: FilterDropdownDataProps;
201
195
  searchTerm: string;
202
196
  setSearchTerm: React.Dispatch<React.SetStateAction<string>>;
197
+ tabValue?: number;
203
198
  }
204
199
 
205
200
  export interface AttributesFilterSelectProps {
@@ -208,4 +203,5 @@ export interface AttributesFilterSelectProps {
208
203
  dropdownData: FilterDropdownDataProps;
209
204
  searchTerm: string;
210
205
  setSearchTerm: React.Dispatch<React.SetStateAction<string>>;
206
+ tabValue?: number;
211
207
  }