rez-table-listing-mui 2.0.13 → 2.0.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.
- package/dist/index.d.ts +51 -2
- 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/hooks/hooks.ts +38 -1
- package/src/listing/components/filter/components/attributes-filter.tsx +1 -1
- package/src/listing/components/filter/components/forms/components/Filter-criteria.tsx +4 -2
- package/src/listing/components/filter/components/forms/utils/filter-date-input-resolver.tsx +36 -1
- package/src/listing/components/login/index.tsx +3 -3
- package/src/listing/components/table-settings/components/lane.tsx +313 -366
- package/src/listing/components/table-settings/components/swim-lane.tsx +424 -0
- package/src/listing/components/table-settings/constants.ts +2 -1
- package/src/listing/components/table-settings/index.tsx +74 -31
- package/src/listing/libs/hooks/useCraftTableFilterSettings.tsx +5 -0
- package/src/listing/libs/hooks/useEntityTableAPI.tsx +20 -6
- package/src/listing/libs/utils/apiColumn.ts +61 -6
- package/src/listing/libs/utils/common.ts +5 -3
- package/src/listing/types/common.ts +1 -0
- package/src/listing/types/filter-settings.ts +31 -0
- package/src/listing/types/filter.ts +2 -1
- package/src/listing/types/table-options.ts +3 -0
- package/src/view/KanbanView.tsx +70 -7
- package/src/view/ListingView.tsx +5 -20
- package/src/listing/components/table-settings/components/group-by.tsx +0 -511
package/package.json
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
|
-
import { useQuery } from "@tanstack/react-query";
|
|
1
|
+
import { useQueries, useQuery } from "@tanstack/react-query";
|
|
2
2
|
import { getKanbanData } from "../services/service";
|
|
3
|
+
import {
|
|
4
|
+
commonFetchDropdownDataAPI,
|
|
5
|
+
newCommonGetDropdownDataAPI,
|
|
6
|
+
} from "../../listing/libs/utils/apiColumn";
|
|
7
|
+
|
|
8
|
+
export const kanbanDropdownResults = (
|
|
9
|
+
entity_type: string,
|
|
10
|
+
enterprise_id: string
|
|
11
|
+
) => {
|
|
12
|
+
return useQueries({
|
|
13
|
+
queries: [
|
|
14
|
+
{
|
|
15
|
+
queryKey: ["commonDropdown", entity_type, enterprise_id],
|
|
16
|
+
queryFn: () =>
|
|
17
|
+
commonFetchDropdownDataAPI({
|
|
18
|
+
entity_type,
|
|
19
|
+
enterprise_id,
|
|
20
|
+
}),
|
|
21
|
+
enabled: !!enterprise_id,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const useGetAttributeDropdown = (
|
|
28
|
+
entity_type: string,
|
|
29
|
+
attribute_key: string
|
|
30
|
+
) =>
|
|
31
|
+
useQuery({
|
|
32
|
+
queryKey: ["commonDropdown", entity_type, attribute_key],
|
|
33
|
+
queryFn: () =>
|
|
34
|
+
newCommonGetDropdownDataAPI({
|
|
35
|
+
entity_type,
|
|
36
|
+
attribute_key,
|
|
37
|
+
}),
|
|
38
|
+
enabled: Boolean(entity_type && attribute_key),
|
|
39
|
+
});
|
|
3
40
|
|
|
4
41
|
export const useGetKanbanData = (entity_type: string) => {
|
|
5
42
|
const {
|
|
@@ -174,7 +174,7 @@ const AttributesFilter = ({
|
|
|
174
174
|
}}
|
|
175
175
|
>
|
|
176
176
|
{columnsData?.column_list
|
|
177
|
-
?.filter((column) => column
|
|
177
|
+
?.filter((column) => column?.element_type?.includes("select"))
|
|
178
178
|
.map((column, index) => (
|
|
179
179
|
<MenuItem
|
|
180
180
|
key={index}
|
|
@@ -12,6 +12,7 @@ import useElementWidth from "../../../../../libs/hooks/useElementWidth";
|
|
|
12
12
|
import { onFilterChangeFunctionProps } from "../../../../../types/common";
|
|
13
13
|
import FilterCriteriaEntityList from "./filter-criteria-entity-list";
|
|
14
14
|
import FilterCriteriaList from "./filter-criteria-list";
|
|
15
|
+
import { getOperationKeyByElementType } from "../utils/filter-date-input-resolver";
|
|
15
16
|
|
|
16
17
|
const FilterCriteria = ({
|
|
17
18
|
columnsData,
|
|
@@ -67,10 +68,11 @@ const FilterCriteria = ({
|
|
|
67
68
|
|
|
68
69
|
const defaultValue = attribute.element_type === "multiselect" ? [] : "";
|
|
69
70
|
|
|
70
|
-
const
|
|
71
|
+
const operationKey = getOperationKeyByElementType(attribute?.element_type);
|
|
71
72
|
|
|
72
73
|
const matchingDropdownList =
|
|
73
|
-
columnsData?.operation_list[
|
|
74
|
+
columnsData?.operation_list?.[operationKey] || [];
|
|
75
|
+
const defaultOperator = matchingDropdownList[0]?.value || "";
|
|
74
76
|
|
|
75
77
|
const newFilter = {
|
|
76
78
|
filter_attribute: attribute.attribute_key,
|
|
@@ -38,7 +38,7 @@ export const resolveFilterInput = ({
|
|
|
38
38
|
const dataType = filter?.filter_attribute_data_type;
|
|
39
39
|
|
|
40
40
|
// TEXT / NUMBER → always textfield
|
|
41
|
-
if (dataType === "text" || dataType === "number") {
|
|
41
|
+
if (dataType === "text" || dataType === "number" || dataType === "label") {
|
|
42
42
|
return (
|
|
43
43
|
<FormTextfield
|
|
44
44
|
filter={filter}
|
|
@@ -104,3 +104,38 @@ export const resolveFilterInput = ({
|
|
|
104
104
|
|
|
105
105
|
return <FormControl fullWidth size="small" />;
|
|
106
106
|
};
|
|
107
|
+
|
|
108
|
+
export const getOperationKeyByElementType = (elementType: string) => {
|
|
109
|
+
switch (elementType) {
|
|
110
|
+
case "text":
|
|
111
|
+
case "textarea":
|
|
112
|
+
case "email":
|
|
113
|
+
case "phone":
|
|
114
|
+
case "password":
|
|
115
|
+
case "url":
|
|
116
|
+
case "label":
|
|
117
|
+
return "text";
|
|
118
|
+
|
|
119
|
+
case "number":
|
|
120
|
+
case "decimal":
|
|
121
|
+
case "file-upload":
|
|
122
|
+
return "number";
|
|
123
|
+
|
|
124
|
+
case "date":
|
|
125
|
+
case "datetime":
|
|
126
|
+
return "date";
|
|
127
|
+
|
|
128
|
+
case "select":
|
|
129
|
+
case "radio":
|
|
130
|
+
case "multiselect":
|
|
131
|
+
case "multicheckbox":
|
|
132
|
+
case "checkbox":
|
|
133
|
+
return "select";
|
|
134
|
+
|
|
135
|
+
case "year":
|
|
136
|
+
return "year";
|
|
137
|
+
|
|
138
|
+
default:
|
|
139
|
+
return "text";
|
|
140
|
+
}
|
|
141
|
+
};
|
|
@@ -8,10 +8,10 @@ const LoginButton = () => {
|
|
|
8
8
|
const handleLogin = async () => {
|
|
9
9
|
setLoading(true);
|
|
10
10
|
// const api_url = "https://api.eth-qa.rezolut.in/api/enrol/auth";
|
|
11
|
-
const api_url = "http://localhost:
|
|
12
|
-
const email_id = "
|
|
11
|
+
const api_url = "http://localhost:6011/api/auth";
|
|
12
|
+
const email_id = "yash.joshi@rezolut.in";
|
|
13
13
|
const verify_otp = "123456";
|
|
14
|
-
const sub_domain = "
|
|
14
|
+
const sub_domain = "demo1";
|
|
15
15
|
|
|
16
16
|
setLoading(true);
|
|
17
17
|
|