Skip to content

Commit

Permalink
[#149] Update to v2.3.6 and update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
wayangalihpratama committed Apr 18, 2024
1 parent 798ee33 commit e372ac6
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 13 deletions.
25 changes: 20 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36507,7 +36507,8 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
setSelected = _useState2[1];
var endpoint = api.endpoint,
initial = api.initial,
list = api.list;
list = api.list,
query_params = api.query_params;
React.useEffect(function () {
if (autoSave !== null && autoSave !== void 0 && autoSave.name && selected.length) {
var _value;
Expand Down Expand Up @@ -36538,16 +36539,22 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
}, [id, meta, autoSave, cascade, selected]);
React.useEffect(function () {
var ep = typeof initial !== 'undefined' ? endpoint + "/" + initial : "" + endpoint;
if (query_params) {
ep = "" + ep + query_params;
}
axios.get(ep).then(function (res) {
var _res$data;
var data = list ? (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data[list] : res.data;
setCascade([data]);
});
}, [endpoint, initial, list]);
}, [endpoint, initial, list, query_params]);
React.useEffect(function () {
if (initialValue.length) {
var calls = [];
var ep = typeof initial !== 'undefined' ? endpoint + "/" + initial : "" + endpoint;
if (query_params) {
ep = "" + ep + query_params;
}
var initCall = new Promise(function (resolve, reject) {
axios.get(ep).then(function (res) {
var _res$data2;
Expand All @@ -36561,7 +36568,11 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
var _loop = function _loop() {
var id = _step.value;
var call = new Promise(function (resolve, reject) {
axios.get(endpoint + "/" + id).then(function (res) {
var ep = endpoint + "/" + id;
if (query_params) {
ep = "" + ep + query_params;
}
axios.get(ep).then(function (res) {
var _res$data3;
var data = list ? (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3[list] : res.data;
resolve(data);
Expand All @@ -36581,7 +36592,7 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
setSelected(initialValue);
});
}
}, [initialValue, endpoint, initial, list]);
}, [initialValue, endpoint, initial, list, query_params]);
var handleChange = function handleChange(value, index) {
if (!index) {
var _form$setFieldsValue;
Expand All @@ -36594,7 +36605,11 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
setSelected(result);
form.setFieldsValue((_form$setFieldsValue2 = {}, _form$setFieldsValue2[id] = result, _form$setFieldsValue2));
}
axios.get(endpoint + "/" + value).then(function (res) {
var ep = endpoint + "/" + value;
if (query_params) {
ep = "" + ep + query_params;
}
axios.get(ep).then(function (res) {
var _res$data4;
var data = list ? (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4[list] : res.data;
if (data.length) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions dist/index.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -36504,7 +36504,8 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
setSelected = _useState2[1];
var endpoint = api.endpoint,
initial = api.initial,
list = api.list;
list = api.list,
query_params = api.query_params;
useEffect(function () {
if (autoSave !== null && autoSave !== void 0 && autoSave.name && selected.length) {
var _value;
Expand Down Expand Up @@ -36535,16 +36536,22 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
}, [id, meta, autoSave, cascade, selected]);
useEffect(function () {
var ep = typeof initial !== 'undefined' ? endpoint + "/" + initial : "" + endpoint;
if (query_params) {
ep = "" + ep + query_params;
}
axios.get(ep).then(function (res) {
var _res$data;
var data = list ? (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data[list] : res.data;
setCascade([data]);
});
}, [endpoint, initial, list]);
}, [endpoint, initial, list, query_params]);
useEffect(function () {
if (initialValue.length) {
var calls = [];
var ep = typeof initial !== 'undefined' ? endpoint + "/" + initial : "" + endpoint;
if (query_params) {
ep = "" + ep + query_params;
}
var initCall = new Promise(function (resolve, reject) {
axios.get(ep).then(function (res) {
var _res$data2;
Expand All @@ -36558,7 +36565,11 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
var _loop = function _loop() {
var id = _step.value;
var call = new Promise(function (resolve, reject) {
axios.get(endpoint + "/" + id).then(function (res) {
var ep = endpoint + "/" + id;
if (query_params) {
ep = "" + ep + query_params;
}
axios.get(ep).then(function (res) {
var _res$data3;
var data = list ? (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3[list] : res.data;
resolve(data);
Expand All @@ -36578,7 +36589,7 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
setSelected(initialValue);
});
}
}, [initialValue, endpoint, initial, list]);
}, [initialValue, endpoint, initial, list, query_params]);
var handleChange = function handleChange(value, index) {
if (!index) {
var _form$setFieldsValue;
Expand All @@ -36591,7 +36602,11 @@ var TypeCascadeApi = function TypeCascadeApi(_ref) {
setSelected(result);
form.setFieldsValue((_form$setFieldsValue2 = {}, _form$setFieldsValue2[id] = result, _form$setFieldsValue2));
}
axios.get(endpoint + "/" + value).then(function (res) {
var ep = endpoint + "/" + value;
if (query_params) {
ep = "" + ep + query_params;
}
axios.get(ep).then(function (res) {
var _res$data4;
var data = list ? (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4[list] : res.data;
if (data.length) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.modern.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "akvo-react-form",
"version": "2.3.5",
"version": "2.3.6",
"description": "Simple react component for building webforms",
"license": "AGPL-3.0",
"repository": "akvo/akvo-react-form",
Expand Down

0 comments on commit e372ac6

Please sign in to comment.