rez-table-listing-mui 1.0.30 → 1.0.31

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/src/App.tsx CHANGED
@@ -24,7 +24,7 @@ function App() {
24
24
  const [columns, setColumns] = useState<any[]>([]);
25
25
  const [searchTerm, setSearchTerm] = useState("");
26
26
  // const [data, setData] = useState<Person[]>(() => makeData(50, 3, 2));
27
- // const [entity_type] = useState(ENTITY_TYPE); //OR UPR BRD
27
+ // const [entity_type] = useState(ENTITY_TYPE); //OR NTM BRD
28
28
 
29
29
  const [selectedTab, setSelectedTab] = useState("ALL");
30
30
 
@@ -33,7 +33,7 @@ function App() {
33
33
 
34
34
  const { defaultColumns } = useDefaultColumns();
35
35
 
36
- const { metaQuery } = useFetchData("UPR");
36
+ const { metaQuery } = useFetchData("NTM");
37
37
  const { detailsQuery } = useDetailsQueryAPI(
38
38
  filterMaster?.saved_filters?.selectedId
39
39
  ? filterMaster?.saved_filters?.selectedId
@@ -58,7 +58,7 @@ function App() {
58
58
 
59
59
  const fetchMeta = async () => {
60
60
  try {
61
- const { res } = await entityTableMetaMaster("UPR");
61
+ const { res } = await entityTableMetaMaster("NTM");
62
62
  setColumns(res);
63
63
  } catch (error) {
64
64
  console.error("Failed to fetch metadata:", error);
@@ -77,7 +77,7 @@ function App() {
77
77
  const { tableData, isTableDataPending } = useEntityTableAPI({
78
78
  page: 0,
79
79
  size: 50,
80
- entity_type: "UPR",
80
+ entity_type: "NTM",
81
81
  tabs: {
82
82
  columnName: "status",
83
83
  sortBy: "ASC",
@@ -156,7 +156,7 @@ function App() {
156
156
  const payload = {
157
157
  name,
158
158
  is_default: false,
159
- mapped_entity_type: "UPR", // For that entity type
159
+ mapped_entity_type: "NTM", // For that entity type
160
160
  status: "ACTIVE",
161
161
  entity_type: "SFM", // FIXED entity type
162
162
  filterDetails: quickFilter,
@@ -171,7 +171,7 @@ function App() {
171
171
  name: filterToDelete?.label,
172
172
  id: filterToDelete?.value,
173
173
  is_default: false,
174
- mapped_entity_type: "UPR",
174
+ mapped_entity_type: "NTM",
175
175
  status: "INACTIVE",
176
176
  entity_type: "SFM",
177
177
  };
@@ -192,7 +192,7 @@ function App() {
192
192
  name: filterMaster?.saved_filters?.selectedName, // Name of the filter
193
193
  is_default: false,
194
194
  id: filterMaster?.saved_filters?.selectedId,
195
- mapped_entity_type: "UPR",
195
+ mapped_entity_type: "NTM",
196
196
  status: "ACTIVE",
197
197
  entity_type: "SFM",
198
198
  filterDetails: quickFilter,
@@ -218,10 +218,10 @@ function App() {
218
218
  enableRowSelection: false,
219
219
  enableServerSideSorting: enableServerSideSorting,
220
220
  }}
221
- loadingOptions={{
222
- isLoading: isTableDataPending || detailsQuery.isPending,
223
- // loaderText: "Loading, Please wait...",
224
- }}
221
+ // loadingOptions={{
222
+ // isLoading: isTableDataPending || detailsQuery.isPending,
223
+ // // loaderText: "Loading, Please wait...",
224
+ // }}
225
225
  topbarOptions={{
226
226
  tableStates,
227
227
  leftSideComponent: (
@@ -9,12 +9,14 @@ import { SxProps, Theme } from "@mui/material";
9
9
  const FormDatePicker = ({
10
10
  filter,
11
11
  control,
12
- sx,
13
12
  }: {
14
13
  filter: UpdatedFilterStateProps;
15
14
  control: any;
16
15
  sx?: SxProps<Theme>;
17
16
  }) => {
17
+ const range = filter.filter_operator === "between";
18
+ console.log("range+++", range);
19
+
18
20
  return (
19
21
  <Controller
20
22
  name={`${filter?.name}.value`} // or use a consistent structure like `filters.${index}.filter_value`
@@ -16,6 +16,7 @@ import {
16
16
  UpdatedFilterStateProps,
17
17
  } from "../../../../../types/filter";
18
18
  import { CraftTableOptionsProps } from "../../../../../types/table-options";
19
+ import CustomSearch from "../../search";
19
20
 
20
21
  const FilterCriteria = ({
21
22
  columnsData,
@@ -45,11 +46,20 @@ const FilterCriteria = ({
45
46
 
46
47
  const handleAddFilter = (column: FilterColumnsListProps) => {
47
48
  const dropdownOptions = columnsData.operation_list[column.data_type];
49
+
50
+ // console.log("dropdownOptionssssss", dropdownOptions);
51
+
48
52
  const defaultValue = column.data_type === "multiselect" ? [] : "";
53
+ console.log("defaultValue", defaultValue);
54
+
49
55
  const defaultOperator = dropdownOptions?.[0]?.value || "";
56
+ // console.log("defaultOperator", defaultOperator);
57
+
50
58
  const matchingDropdownList =
51
59
  columnsData.operation_list[column.data_type] || [];
52
60
 
61
+ // console.log("matchingDropdownList", matchingDropdownList);
62
+
53
63
  const newFilter = {
54
64
  filter_attribute: column.attribute_key,
55
65
  filter_operator: defaultOperator,
@@ -129,7 +139,8 @@ const FilterCriteria = ({
129
139
  borderRadius: "6px",
130
140
  }}
131
141
  >
132
- Filter by...
142
+ {/* Filter by... */}
143
+ {/* <CustomSearch placeholder="Filter by..." /> */}
133
144
  </ListSubheader>
134
145
  }
135
146
  >
@@ -241,6 +241,8 @@ const FilterForm = ({
241
241
  columnsData={columnsData}
242
242
  tableStates={tableStates}
243
243
  setSelectedFilters={setSelectedFilters}
244
+ // searchTerm={searchTerm}
245
+ // setSearchTerm={setSearchTerm}
244
246
  />
245
247
 
246
248
  {/* Render search input */}
@@ -306,9 +308,8 @@ const FilterForm = ({
306
308
  sx={{ marginLeft: "auto" }}
307
309
  onClick={() => {
308
310
  const fieldName = `${filter.name}.value`;
309
- unregister(fieldName); // ✅ Unregister field manually
311
+ unregister(fieldName);
310
312
 
311
- // ✅ Trigger dirty manually (optional, but safe fallback)
312
313
  setValue("filterName", formValues.filterName, {
313
314
  shouldDirty: true,
314
315
  });
@@ -438,7 +439,7 @@ const FilterForm = ({
438
439
  },
439
440
  }}
440
441
  // onClick={() => setSaveFilterModalOpen(true)}
441
- disabled={editMode && !isDirty}
442
+ // disabled={editMode && !isDirty}
442
443
  onClick={() => {
443
444
  setSavedFilterModalOpen && setSavedFilterModalOpen(true);
444
445
  }}
@@ -14,7 +14,7 @@ import {
14
14
 
15
15
  export function useCraftTable(paginationPageSize: number = 25) {
16
16
  const [pagination, setPagination] = useState<PaginationState>({
17
- pageIndex: 0,
17
+ pageIndex: 1,
18
18
  pageSize: paginationPageSize,
19
19
  });
20
20
  const [sorting, setSorting] = useState<SortingState>([]);
@@ -101,4 +101,4 @@ api.interceptors.request.use(
101
101
  }
102
102
  );
103
103
 
104
- export const ENTITY_TYPE = "UPR";
104
+ export const ENTITY_TYPE = "NTM";