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 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), '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
- .get(props.item.ApiInstance + `&${props.item.searchInstance}=${searchValue}`, { signal, headers: {
52815
- Authorization: `Bearer ${'eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoidHAwMjAiLCJVc2VyTmFtZSI6InRwMDIwIiwiVXNlcklkIjoiMjkiLCJBcHBsaWNhdGlvblR5cGUiOiJUQ0EiLCJSb2xlSWQiOiIxIiwiZXhwIjoxNzMwODc0NTcyfQ.ggDsISUnLFA6m2Bu2aOiyKasSmI2WFzw-gxO0umUpyoICDrZLXoJ15OsyKGrf9y6dy41D9Q0RvX__xU09zJRgA'}`
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 && props.item.setLoadedPaginationOptions(res.data);
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
- }, [searchValue, props.getValues(props.item.name), props.item.ApiInstance, (_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.autoFIll]);
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
- }, [(_b = props.item) === null || _b === void 0 ? void 0 : _b.ApiInstanceReferal]);
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;