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.esm.js
CHANGED
|
@@ -52791,12 +52791,12 @@ const useStyles = makeStyles((theme) => ({
|
|
|
52791
52791
|
},
|
|
52792
52792
|
}));
|
|
52793
52793
|
const SingleSelectSearchApi = ({ props }) => {
|
|
52794
|
-
var _a, _b;
|
|
52794
|
+
var _a, _b, _c;
|
|
52795
52795
|
const classes = useStyles();
|
|
52796
52796
|
const [searchValue, setSearchValue] = useState("");
|
|
52797
52797
|
const [optionsFetched, setOptionsFetched] = useState([]);
|
|
52798
52798
|
const [isLoading, setIsLoading] = useState(false);
|
|
52799
|
-
console.log(props.getValues(props.item.name),
|
|
52799
|
+
console.log(props.getValues(props.item.name), "props.getValues(props.item.name)");
|
|
52800
52800
|
useEffect(() => {
|
|
52801
52801
|
var _a;
|
|
52802
52802
|
const controller = new AbortController();
|
|
@@ -52810,27 +52810,36 @@ const SingleSelectSearchApi = ({ props }) => {
|
|
|
52810
52810
|
}
|
|
52811
52811
|
// if(searchValue!==''){
|
|
52812
52812
|
setIsLoading(true);
|
|
52813
|
-
props.item.AxiosInstance
|
|
52814
|
-
|
|
52815
|
-
|
|
52816
|
-
|
|
52813
|
+
props.item.AxiosInstance.get(props.item.ApiInstance + `&${props.item.searchInstance}=${searchValue}`, {
|
|
52814
|
+
signal,
|
|
52815
|
+
headers: {
|
|
52816
|
+
Authorization: `Bearer ${props.item.tokenInstance}`,
|
|
52817
|
+
},
|
|
52818
|
+
})
|
|
52817
52819
|
.then((res) => {
|
|
52818
52820
|
setOptionsFetched(res.data);
|
|
52819
52821
|
setIsLoading(false);
|
|
52820
|
-
props.item.setLoadedPaginationOptions &&
|
|
52822
|
+
props.item.setLoadedPaginationOptions &&
|
|
52823
|
+
props.item.setLoadedPaginationOptions(res.data);
|
|
52821
52824
|
})
|
|
52822
52825
|
.catch((err) => {
|
|
52823
52826
|
console.log(err, "error");
|
|
52824
52827
|
});
|
|
52825
52828
|
return () => controller.abort();
|
|
52826
52829
|
// }
|
|
52827
|
-
}, [
|
|
52830
|
+
}, [
|
|
52831
|
+
searchValue,
|
|
52832
|
+
props.getValues(props.item.name),
|
|
52833
|
+
props.item.ApiInstance,
|
|
52834
|
+
(_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.autoFIll,
|
|
52835
|
+
(_b = props === null || props === void 0 ? void 0 : props.item) === null || _b === void 0 ? void 0 : _b.tokenInstance
|
|
52836
|
+
]);
|
|
52828
52837
|
useEffect(() => {
|
|
52829
52838
|
var _a;
|
|
52830
52839
|
if ((_a = props.item) === null || _a === void 0 ? void 0 : _a.ApiInstanceReferal) {
|
|
52831
52840
|
setSearchValue("");
|
|
52832
52841
|
}
|
|
52833
|
-
}, [(
|
|
52842
|
+
}, [(_c = props.item) === null || _c === void 0 ? void 0 : _c.ApiInstanceReferal]);
|
|
52834
52843
|
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
|
|
52835
52844
|
return (jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => {
|
|
52836
52845
|
var _a, _b;
|