tp-react-elements-dev 1.6.9 → 1.6.10
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.esm.js +18 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52811,12 +52811,12 @@ const useStyles = makeStyles((theme) => ({
|
|
|
52811
52811
|
},
|
|
52812
52812
|
}));
|
|
52813
52813
|
const SingleSelectSearchApi = ({ props }) => {
|
|
52814
|
-
var _a, _b;
|
|
52814
|
+
var _a, _b, _c;
|
|
52815
52815
|
const classes = useStyles();
|
|
52816
52816
|
const [searchValue, setSearchValue] = React$1.useState("");
|
|
52817
52817
|
const [optionsFetched, setOptionsFetched] = React$1.useState([]);
|
|
52818
52818
|
const [isLoading, setIsLoading] = React$1.useState(false);
|
|
52819
|
-
console.log(props.getValues(props.item.name),
|
|
52819
|
+
console.log(props.getValues(props.item.name), "props.getValues(props.item.name)");
|
|
52820
52820
|
React$1.useEffect(() => {
|
|
52821
52821
|
var _a;
|
|
52822
52822
|
const controller = new AbortController();
|
|
@@ -52830,27 +52830,36 @@ const SingleSelectSearchApi = ({ props }) => {
|
|
|
52830
52830
|
}
|
|
52831
52831
|
// if(searchValue!==''){
|
|
52832
52832
|
setIsLoading(true);
|
|
52833
|
-
props.item.AxiosInstance
|
|
52834
|
-
|
|
52835
|
-
|
|
52836
|
-
|
|
52833
|
+
props.item.AxiosInstance.get(props.item.ApiInstance + `&${props.item.searchInstance}=${searchValue}`, {
|
|
52834
|
+
signal,
|
|
52835
|
+
headers: {
|
|
52836
|
+
Authorization: `Bearer ${props.item.tokenInstance}`,
|
|
52837
|
+
},
|
|
52838
|
+
})
|
|
52837
52839
|
.then((res) => {
|
|
52838
52840
|
setOptionsFetched(res.data);
|
|
52839
52841
|
setIsLoading(false);
|
|
52840
|
-
props.item.setLoadedPaginationOptions &&
|
|
52842
|
+
props.item.setLoadedPaginationOptions &&
|
|
52843
|
+
props.item.setLoadedPaginationOptions(res.data);
|
|
52841
52844
|
})
|
|
52842
52845
|
.catch((err) => {
|
|
52843
52846
|
console.log(err, "error");
|
|
52844
52847
|
});
|
|
52845
52848
|
return () => controller.abort();
|
|
52846
52849
|
// }
|
|
52847
|
-
}, [
|
|
52850
|
+
}, [
|
|
52851
|
+
searchValue,
|
|
52852
|
+
props.getValues(props.item.name),
|
|
52853
|
+
props.item.ApiInstance,
|
|
52854
|
+
(_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.autoFIll,
|
|
52855
|
+
(_b = props === null || props === void 0 ? void 0 : props.item) === null || _b === void 0 ? void 0 : _b.tokenInstance
|
|
52856
|
+
]);
|
|
52848
52857
|
React$1.useEffect(() => {
|
|
52849
52858
|
var _a;
|
|
52850
52859
|
if ((_a = props.item) === null || _a === void 0 ? void 0 : _a.ApiInstanceReferal) {
|
|
52851
52860
|
setSearchValue("");
|
|
52852
52861
|
}
|
|
52853
|
-
}, [(
|
|
52862
|
+
}, [(_c = props.item) === null || _c === void 0 ? void 0 : _c.ApiInstanceReferal]);
|
|
52854
52863
|
const isOptionEqualToValue = (option, value) => (option === null || option === void 0 ? void 0 : option.value) === (value === null || value === void 0 ? void 0 : value.value); // Assuming there's a 'value' property in your options
|
|
52855
52864
|
return (jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => {
|
|
52856
52865
|
var _a, _b;
|