@visns-studio/visns-components 4.2.3 → 4.2.4
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.
|
@@ -29,6 +29,7 @@ function VisnsAsyncSelect({
|
|
|
29
29
|
return new Promise((resolve, reject) => {
|
|
30
30
|
let data = [];
|
|
31
31
|
|
|
32
|
+
// Prepare payload
|
|
32
33
|
let payload = {
|
|
33
34
|
where: [
|
|
34
35
|
{
|
|
@@ -38,14 +39,21 @@ function VisnsAsyncSelect({
|
|
|
38
39
|
],
|
|
39
40
|
};
|
|
40
41
|
|
|
41
|
-
if
|
|
42
|
+
// Check and set fields from settings if fields prop is null or empty
|
|
43
|
+
if (fields && fields.length > 0) {
|
|
42
44
|
payload.fields = fields;
|
|
45
|
+
} else if (settings.fields && settings.fields.length > 0) {
|
|
46
|
+
payload.fields = settings.fields;
|
|
43
47
|
}
|
|
44
48
|
|
|
49
|
+
// Check and set orderBy from settings if orderBy prop is null or empty
|
|
45
50
|
if (orderBy) {
|
|
46
51
|
payload.orderBy = orderBy;
|
|
52
|
+
} else if (settings.orderBy) {
|
|
53
|
+
payload.orderBy = settings.orderBy;
|
|
47
54
|
}
|
|
48
55
|
|
|
56
|
+
// Fetch data
|
|
49
57
|
CustomFetch(
|
|
50
58
|
settings.url,
|
|
51
59
|
'POST',
|
|
@@ -92,7 +100,9 @@ function VisnsAsyncSelect({
|
|
|
92
100
|
onChange(inputValue, action, settings.id);
|
|
93
101
|
}}
|
|
94
102
|
onKeyDown={(e) => {
|
|
95
|
-
onKeyDown
|
|
103
|
+
if (onKeyDown) {
|
|
104
|
+
onKeyDown(e);
|
|
105
|
+
}
|
|
96
106
|
}}
|
|
97
107
|
components={{ SelectList }}
|
|
98
108
|
styles={{
|
package/components/crm/Field.jsx
CHANGED
|
@@ -159,6 +159,14 @@ function Field({
|
|
|
159
159
|
],
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
+
if (a.fields) {
|
|
163
|
+
filter.fields = a.fields;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (a.orderBy) {
|
|
167
|
+
filter.orderBy = a.orderBy;
|
|
168
|
+
}
|
|
169
|
+
|
|
162
170
|
CustomFetch(
|
|
163
171
|
a.url,
|
|
164
172
|
'POST',
|
|
@@ -181,6 +189,14 @@ function Field({
|
|
|
181
189
|
],
|
|
182
190
|
};
|
|
183
191
|
|
|
192
|
+
if (settings.fields) {
|
|
193
|
+
filter.fields = settings.fields;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (settings.orderBy) {
|
|
197
|
+
filter.orderBy = settings.orderBy;
|
|
198
|
+
}
|
|
199
|
+
|
|
184
200
|
CustomFetch(
|
|
185
201
|
settings.child.url,
|
|
186
202
|
'POST',
|
package/package.json
CHANGED