datastake-daf 0.6.230 → 0.6.232
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/components/index.js
CHANGED
|
@@ -9898,6 +9898,7 @@ const AjaxSelect$2 = ({
|
|
|
9898
9898
|
const [initFetch, setInitFetch] = React.useState(false);
|
|
9899
9899
|
const filterValues = React.useMemo(() => typeof config.filters === "function" ? config.filters(filters) : {}, [config, filters]);
|
|
9900
9900
|
const [lastFilterValues, setLastFilterValues] = React.useState(filterValues);
|
|
9901
|
+
const _app = config?.app || app;
|
|
9901
9902
|
const disabled = React.useMemo(() => typeof config.disabled === "function" ? config.disabled(filters) : true, [config, filters]);
|
|
9902
9903
|
const value = React.useMemo(() => filters[k] || null, [k, filters]);
|
|
9903
9904
|
const label = React.useMemo(() => {
|
|
@@ -9911,7 +9912,7 @@ const AjaxSelect$2 = ({
|
|
|
9911
9912
|
if (Object.keys(lastFilterValues) && !disabled) {
|
|
9912
9913
|
getAjaxData({
|
|
9913
9914
|
apiUrl,
|
|
9914
|
-
app,
|
|
9915
|
+
app: _app,
|
|
9915
9916
|
entity: config.entity,
|
|
9916
9917
|
filterValues: lastFilterValues,
|
|
9917
9918
|
mapper: config.mapper,
|
|
@@ -12692,8 +12693,8 @@ const useHeader = _ref => {
|
|
|
12692
12693
|
setShowFilters(p => !p);
|
|
12693
12694
|
}
|
|
12694
12695
|
}];
|
|
12695
|
-
const actionButtons = onDownload && _actionButtons.length < 3 ? [..._actionButtons, ...(hasFilters ? filterButton : []), downloadButton] : _actionButtons;
|
|
12696
|
-
const extraButtons = onDownload && _actionButtons.length >= 3 ? [..._extraButtons, downloadButtonAction] : _extraButtons;
|
|
12696
|
+
const actionButtons = onDownload && _actionButtons.length < 3 ? [..._actionButtons, ...(hasFilters ? filterButton : []), downloadButton] : [..._actionButtons, ...(hasFilters ? filterButton : [])];
|
|
12697
|
+
const extraButtons = onDownload && _actionButtons.length >= 3 ? [..._extraButtons, ...(hasFilters ? filterButton : []), downloadButtonAction] : [..._extraButtons, ...(hasFilters ? filterButton : [])];
|
|
12697
12698
|
const mainCont = React.useRef();
|
|
12698
12699
|
const buttonCont = React.useRef();
|
|
12699
12700
|
const [mainContWidth, setMainContWidth] = React.useState(600);
|
package/package.json
CHANGED
|
@@ -53,6 +53,7 @@ export const AjaxSelect = ({
|
|
|
53
53
|
[config, filters]
|
|
54
54
|
);
|
|
55
55
|
const [lastFilterValues, setLastFilterValues] = useState(filterValues);
|
|
56
|
+
const _app = config?.app || app;
|
|
56
57
|
|
|
57
58
|
const disabled = useMemo(
|
|
58
59
|
() =>
|
|
@@ -73,7 +74,7 @@ export const AjaxSelect = ({
|
|
|
73
74
|
if (Object.keys(lastFilterValues) && !disabled) {
|
|
74
75
|
getAjaxData({
|
|
75
76
|
apiUrl,
|
|
76
|
-
app,
|
|
77
|
+
app: _app,
|
|
77
78
|
entity: config.entity,
|
|
78
79
|
filterValues: lastFilterValues,
|
|
79
80
|
mapper: config.mapper,
|
|
@@ -179,38 +179,43 @@ export const WithFilters = {
|
|
|
179
179
|
filtersConfig: {
|
|
180
180
|
"language": "en",
|
|
181
181
|
"filtersConfig": {
|
|
182
|
-
"
|
|
182
|
+
"region": {
|
|
183
183
|
"type": "select",
|
|
184
|
-
"label": "
|
|
184
|
+
"label": "Region",
|
|
185
185
|
"style": {
|
|
186
186
|
"flex": 1
|
|
187
187
|
},
|
|
188
188
|
"labelStyle": {
|
|
189
189
|
"flex": 1
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"technicalPartner": {
|
|
193
|
+
"type": "ajaxSelect",
|
|
194
|
+
"label": "Technical Partner",
|
|
195
|
+
"style": {
|
|
196
|
+
"flex": 1
|
|
190
197
|
},
|
|
191
|
-
"
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
"options": {
|
|
195
|
-
"country": [
|
|
196
|
-
{
|
|
197
|
-
"label": "Peru",
|
|
198
|
-
"value": "PE"
|
|
198
|
+
"labelStyle": {
|
|
199
|
+
"flex": 1
|
|
199
200
|
},
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
"entity": "STAKEHOLDER",
|
|
202
|
+
"method": "getOptions",
|
|
203
|
+
"mapper": {
|
|
204
|
+
"label": "name",
|
|
205
|
+
"value": "id"
|
|
203
206
|
}
|
|
204
|
-
|
|
205
|
-
},
|
|
206
|
-
"selectedFilters": {
|
|
207
|
-
"country": [
|
|
208
|
-
"PE",
|
|
209
|
-
"CO"
|
|
210
|
-
]
|
|
207
|
+
}
|
|
211
208
|
},
|
|
212
209
|
"type": "small",
|
|
213
|
-
|
|
210
|
+
"options": [],
|
|
211
|
+
"selectedFilters": {
|
|
212
|
+
"name": "",
|
|
213
|
+
"datastakeId": "",
|
|
214
|
+
"type": "",
|
|
215
|
+
"category": "",
|
|
216
|
+
"position": "",
|
|
217
|
+
"country": ""
|
|
218
|
+
}
|
|
214
219
|
}
|
|
215
220
|
},
|
|
216
221
|
};
|
|
@@ -63,12 +63,19 @@ export const useHeader = ({
|
|
|
63
63
|
..._actionButtons,
|
|
64
64
|
...(hasFilters ? filterButton : []),
|
|
65
65
|
downloadButton
|
|
66
|
-
] :
|
|
66
|
+
] : [
|
|
67
|
+
..._actionButtons,
|
|
68
|
+
...(hasFilters ? filterButton : [])
|
|
69
|
+
];
|
|
67
70
|
|
|
68
71
|
const extraButtons = onDownload && _actionButtons.length >= 3 ? [
|
|
69
72
|
..._extraButtons,
|
|
73
|
+
...(hasFilters ? filterButton : []),
|
|
70
74
|
downloadButtonAction,
|
|
71
|
-
] :
|
|
75
|
+
] : [
|
|
76
|
+
..._extraButtons,
|
|
77
|
+
...(hasFilters ? filterButton : [])
|
|
78
|
+
];
|
|
72
79
|
|
|
73
80
|
const mainCont = useRef()
|
|
74
81
|
const buttonCont = useRef()
|