tp-react-elements-dev 1.6.0 → 1.6.2

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.js CHANGED
@@ -52816,6 +52816,7 @@ const SingleSelectSearchApi = ({ props }) => {
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), 'props.getValues(props.item.name)');
52819
52820
  React$1.useEffect(() => {
52820
52821
  var _a;
52821
52822
  const controller = new AbortController();
@@ -52825,11 +52826,14 @@ const SingleSelectSearchApi = ({ props }) => {
52825
52826
  setOptionsFetched([]);
52826
52827
  }
52827
52828
  else if (props.getValues(props.item.name)) {
52828
- setSearchValue('');
52829
+ setSearchValue(props.getValues(props.item.name));
52829
52830
  }
52831
+ // if(searchValue!==''){
52830
52832
  setIsLoading(true);
52831
52833
  props.item.AxiosInstance
52832
- .get(props.item.ApiInstance + `&${props.item.searchInstance}=${searchValue}`, { signal })
52834
+ .get(props.item.ApiInstance + `&${props.item.searchInstance}=${searchValue}`, { signal, headers: {
52835
+ Authorization: `Bearer ${'eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoidHAwMjAiLCJVc2VyTmFtZSI6InRwMDIwIiwiVXNlcklkIjoiMjkiLCJBcHBsaWNhdGlvblR5cGUiOiJUQ0EiLCJSb2xlSWQiOiIxIiwiZXhwIjoxNzMwODc0NTcyfQ.ggDsISUnLFA6m2Bu2aOiyKasSmI2WFzw-gxO0umUpyoICDrZLXoJ15OsyKGrf9y6dy41D9Q0RvX__xU09zJRgA'}`
52836
+ } })
52833
52837
  .then((res) => {
52834
52838
  setOptionsFetched(res.data);
52835
52839
  setIsLoading(false);
@@ -52837,12 +52841,15 @@ const SingleSelectSearchApi = ({ props }) => {
52837
52841
  })
52838
52842
  .catch((err) => {
52839
52843
  console.log(err, "error");
52840
- setIsLoading(false);
52841
52844
  });
52842
52845
  return () => controller.abort();
52843
- }, [searchValue, props.item.ApiInstance, props.getValues(props.item.name), (_a = props === null || props === void 0 ? void 0 : props.item) === null || _a === void 0 ? void 0 : _a.autoFIll]);
52846
+ // }
52847
+ }, [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]);
52844
52848
  React$1.useEffect(() => {
52845
- setSearchValue("");
52849
+ var _a;
52850
+ if ((_a = props.item) === null || _a === void 0 ? void 0 : _a.ApiInstanceReferal) {
52851
+ setSearchValue("");
52852
+ }
52846
52853
  }, [(_b = props.item) === null || _b === void 0 ? void 0 : _b.ApiInstanceReferal]);
52847
52854
  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
52848
52855
  return (jsxRuntimeExports.jsx(Controller, { control: props.control, name: props.item.name, render: ({ field }) => {