rez-table-listing-mui 1.3.17 → 1.3.19
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 +18 -5
- 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/kanban/index.tsx +8 -10
- package/src/listing/components/filter/components/forms/components/Dropdown.tsx +135 -0
- package/src/listing/components/filter/components/forms/index.tsx +538 -66
- package/src/listing/components/filter/components/forms/utils/filter-date-input-resolver.tsx +127 -0
- package/src/listing/components/login/index.tsx +66 -24
- package/src/listing/components/table-settings/common/listing-values.tsx +22 -19
- package/src/listing/components/table-settings/components/column.tsx +13 -8
- package/src/listing/components/table-settings/components/group-by.tsx +1 -1
- package/src/listing/components/table-settings/components/lane.tsx +1 -1
- package/src/listing/components/table-settings/components/quick-tab.tsx +45 -35
- package/src/listing/components/table-settings/components/sorting.tsx +90 -68
- package/src/listing/components/table-settings/index.tsx +6 -2
- package/src/listing/libs/hooks/useEntityTableAPI.tsx +22 -1
- package/src/listing/libs/services/getLayoutAPI.tsx +1 -1
- package/src/listing/libs/utils/apiColumn.ts +18 -0
- package/src/listing/libs/utils/common.ts +2 -2
- package/src/listing/types/filter-settings.ts +13 -9
- package/src/view/KanbanView.tsx +1 -1
- package/src/view/ListingView.tsx +55 -11
package/package.json
CHANGED
package/src/kanban/index.tsx
CHANGED
|
@@ -82,10 +82,10 @@ const Kanban = ({
|
|
|
82
82
|
|
|
83
83
|
metaData?.swim_lanes.forEach((swimLane: SwimLane) => {
|
|
84
84
|
swimLane.sub_lanes
|
|
85
|
-
?.filter((subLane) => subLane.lane_id
|
|
85
|
+
?.filter((subLane) => subLane.lane_id == laneId)
|
|
86
86
|
?.forEach((subLane) => {
|
|
87
87
|
data?.forEach((lead: any) => {
|
|
88
|
-
if (lead?.stage_id
|
|
88
|
+
if (lead?.stage_id == subLane?.id && !seenLeadIds.has(lead?.id)) {
|
|
89
89
|
seenLeadIds.add(lead.id);
|
|
90
90
|
count++;
|
|
91
91
|
}
|
|
@@ -220,7 +220,7 @@ const Kanban = ({
|
|
|
220
220
|
{swim_lane?.sub_lanes
|
|
221
221
|
?.filter(
|
|
222
222
|
(sub_lane: SubLane) =>
|
|
223
|
-
sub_lane.lane_id.toString()
|
|
223
|
+
sub_lane.lane_id.toString() == lane?.id
|
|
224
224
|
)
|
|
225
225
|
?.map((sub_section: SubLane) => {
|
|
226
226
|
const subLaneKey = `${swim_lane?.id}-${lane?.id}-${sub_section?.id}`;
|
|
@@ -230,7 +230,7 @@ const Kanban = ({
|
|
|
230
230
|
expanded={
|
|
231
231
|
data?.filter(
|
|
232
232
|
(lead: any) =>
|
|
233
|
-
lead?.stage_id
|
|
233
|
+
lead?.stage_id == sub_section?.id &&
|
|
234
234
|
lead?.lead_status_id == swim_lane?.id
|
|
235
235
|
)?.length === 0
|
|
236
236
|
? false
|
|
@@ -261,7 +261,7 @@ const Kanban = ({
|
|
|
261
261
|
display:
|
|
262
262
|
data?.filter(
|
|
263
263
|
(lead: any) =>
|
|
264
|
-
lead?.stage_id
|
|
264
|
+
lead?.stage_id ==
|
|
265
265
|
sub_section?.id &&
|
|
266
266
|
lead?.lead_status_id ==
|
|
267
267
|
swim_lane?.id
|
|
@@ -290,9 +290,8 @@ const Kanban = ({
|
|
|
290
290
|
>
|
|
291
291
|
{data?.filter(
|
|
292
292
|
(lead: any) =>
|
|
293
|
-
lead?.stage_id
|
|
294
|
-
|
|
295
|
-
lead?.lead_status_id ===
|
|
293
|
+
lead?.stage_id == sub_section?.id &&
|
|
294
|
+
lead?.lead_status_id ==
|
|
296
295
|
swim_lane?.id
|
|
297
296
|
)?.length || 0}
|
|
298
297
|
</Box>
|
|
@@ -313,8 +312,7 @@ const Kanban = ({
|
|
|
313
312
|
const leadsForThisSubLane =
|
|
314
313
|
data?.filter(
|
|
315
314
|
(lead: any) =>
|
|
316
|
-
lead?.stage_id
|
|
317
|
-
sub_section?.id &&
|
|
315
|
+
lead?.stage_id == sub_section?.id &&
|
|
318
316
|
lead?.lead_status_id ==
|
|
319
317
|
swim_lane?.id &&
|
|
320
318
|
lead?.stage_group_id == lane?.id
|
|
@@ -16,6 +16,24 @@ interface FormDropdownProps {
|
|
|
16
16
|
onValueChange?: () => void;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
// Allowed date-based operators
|
|
20
|
+
const DATE_ALLOWED_OPERATORS = [
|
|
21
|
+
"equal",
|
|
22
|
+
"before",
|
|
23
|
+
"after",
|
|
24
|
+
"between",
|
|
25
|
+
"is",
|
|
26
|
+
"today",
|
|
27
|
+
"is_day_before",
|
|
28
|
+
"is_day_after",
|
|
29
|
+
"is_month_before",
|
|
30
|
+
"is_month_after",
|
|
31
|
+
"is_before",
|
|
32
|
+
"is_after",
|
|
33
|
+
"is_on_or_before",
|
|
34
|
+
"is_on_or_after",
|
|
35
|
+
];
|
|
36
|
+
|
|
19
37
|
const FormDropdown = ({
|
|
20
38
|
filter,
|
|
21
39
|
control,
|
|
@@ -56,6 +74,19 @@ const FormDropdown = ({
|
|
|
56
74
|
|
|
57
75
|
field.onChange(e);
|
|
58
76
|
|
|
77
|
+
// Reset value if operator switches date → non-date or non-date → date
|
|
78
|
+
if (filter.filter_attribute_data_type === "date") {
|
|
79
|
+
const wasDateOp = DATE_ALLOWED_OPERATORS.includes(oldOperator);
|
|
80
|
+
const isDateOpNow =
|
|
81
|
+
DATE_ALLOWED_OPERATORS.includes(newOperator);
|
|
82
|
+
|
|
83
|
+
if (wasDateOp !== isDateOpNow) {
|
|
84
|
+
setValue(`${filter?.filter_attribute_name}.value`, "", {
|
|
85
|
+
shouldDirty: true,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
59
90
|
if (
|
|
60
91
|
(filter?.filter_attribute_data_type === "date" ||
|
|
61
92
|
filter?.filter_attribute_data_type === "year") &&
|
|
@@ -99,3 +130,107 @@ const FormDropdown = ({
|
|
|
99
130
|
};
|
|
100
131
|
|
|
101
132
|
export default FormDropdown;
|
|
133
|
+
|
|
134
|
+
// !! DON'T DELETE THIS OLD CODE !! //
|
|
135
|
+
|
|
136
|
+
// import { FormControl, MenuItem, Select, SxProps, Theme } from "@mui/material";
|
|
137
|
+
// import { Controller, UseFormSetValue } from "react-hook-form";
|
|
138
|
+
// import { FilterStateProps } from "../../../../../types/filter";
|
|
139
|
+
// import moment from "moment";
|
|
140
|
+
|
|
141
|
+
// interface FormDropdownProps {
|
|
142
|
+
// filter: FilterStateProps;
|
|
143
|
+
// control: any;
|
|
144
|
+
// setValue: UseFormSetValue<any>;
|
|
145
|
+
// dropdownList: {
|
|
146
|
+
// label?: string;
|
|
147
|
+
// value?: string;
|
|
148
|
+
// }[];
|
|
149
|
+
// isLoading?: boolean;
|
|
150
|
+
// sx?: SxProps<Theme>;
|
|
151
|
+
// onValueChange?: () => void;
|
|
152
|
+
// }
|
|
153
|
+
|
|
154
|
+
// const FormDropdown = ({
|
|
155
|
+
// filter,
|
|
156
|
+
// control,
|
|
157
|
+
// setValue,
|
|
158
|
+
// dropdownList,
|
|
159
|
+
// isLoading = false,
|
|
160
|
+
// sx,
|
|
161
|
+
// onValueChange,
|
|
162
|
+
// }: FormDropdownProps) => {
|
|
163
|
+
// return (
|
|
164
|
+
// <Controller
|
|
165
|
+
// name={`${filter?.filter_attribute_name}.operator`}
|
|
166
|
+
// control={control}
|
|
167
|
+
// defaultValue={filter?.filter_operator || dropdownList?.[0]?.value || ""}
|
|
168
|
+
// render={({ field }) => (
|
|
169
|
+
// <FormControl sx={sx} size="small">
|
|
170
|
+
// <Select
|
|
171
|
+
// {...field}
|
|
172
|
+
// variant="standard"
|
|
173
|
+
// sx={{
|
|
174
|
+
// fontSize: "0.875rem",
|
|
175
|
+
// minWidth: 50,
|
|
176
|
+
// border: "none",
|
|
177
|
+
// boxShadow: "none",
|
|
178
|
+
// "& .MuiSelect-icon": {
|
|
179
|
+
// top: "45%",
|
|
180
|
+
// transform: "translateY(-50%)",
|
|
181
|
+
// "& .MuiOutlinedInput-input": {
|
|
182
|
+
// padding: "12px 20px",
|
|
183
|
+
// },
|
|
184
|
+
// },
|
|
185
|
+
// }}
|
|
186
|
+
// disabled={isLoading}
|
|
187
|
+
// disableUnderline
|
|
188
|
+
// onChange={(e) => {
|
|
189
|
+
// const newOperator = e.target.value;
|
|
190
|
+
// const oldOperator = field.value;
|
|
191
|
+
|
|
192
|
+
// field.onChange(e);
|
|
193
|
+
|
|
194
|
+
// if (
|
|
195
|
+
// (filter?.filter_attribute_data_type === "date" ||
|
|
196
|
+
// filter?.filter_attribute_data_type === "year") &&
|
|
197
|
+
// newOperator !== oldOperator
|
|
198
|
+
// ) {
|
|
199
|
+
// if (newOperator === "today") {
|
|
200
|
+
// setValue(
|
|
201
|
+
// `${filter?.filter_attribute_name}.value`,
|
|
202
|
+
// moment().format("YYYY-MM-DD"),
|
|
203
|
+
// {
|
|
204
|
+
// shouldDirty: true,
|
|
205
|
+
// }
|
|
206
|
+
// );
|
|
207
|
+
// } else if (newOperator === "between") {
|
|
208
|
+
// setValue(`${filter?.filter_attribute_name}.value`, ["", ""], {
|
|
209
|
+
// shouldDirty: true,
|
|
210
|
+
// });
|
|
211
|
+
// } else if (
|
|
212
|
+
// oldOperator === "between" ||
|
|
213
|
+
// oldOperator === "today"
|
|
214
|
+
// ) {
|
|
215
|
+
// setValue(`${filter?.filter_attribute_name}.value`, "", {
|
|
216
|
+
// shouldDirty: true,
|
|
217
|
+
// });
|
|
218
|
+
// }
|
|
219
|
+
// }
|
|
220
|
+
|
|
221
|
+
// onValueChange?.();
|
|
222
|
+
// }}
|
|
223
|
+
// >
|
|
224
|
+
// {dropdownList?.map((item, idx) => (
|
|
225
|
+
// <MenuItem key={idx} value={item.value}>
|
|
226
|
+
// {item.label}
|
|
227
|
+
// </MenuItem>
|
|
228
|
+
// ))}
|
|
229
|
+
// </Select>
|
|
230
|
+
// </FormControl>
|
|
231
|
+
// )}
|
|
232
|
+
// />
|
|
233
|
+
// );
|
|
234
|
+
// };
|
|
235
|
+
|
|
236
|
+
// export default FormDropdown;
|