@arkyn/components 1.3.103 → 1.3.104

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  import { GoogleSearchPlacesProps } from "@arkyn/types";
2
- declare function GoogleSearchPlaces({ onChange, options, ...rest }: GoogleSearchPlacesProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function GoogleSearchPlaces({ onChange, onPlaceChanged, options, ...rest }: GoogleSearchPlacesProps): import("react/jsx-runtime").JSX.Element;
3
3
  export { GoogleSearchPlaces };
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GoogleSearchPlaces/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAYvD,iBAAS,kBAAkB,CAAC,EAC1B,QAAQ,EACR,OAAO,EACP,GAAG,IAAI,EACR,EAAE,uBAAuB,2CAiDzB;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GoogleSearchPlaces/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAYvD,iBAAS,kBAAkB,CAAC,EAC1B,QAAQ,EACR,cAAc,EACd,OAAO,EACP,GAAG,IAAI,EACR,EAAE,uBAAuB,2CAiDzB;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { StandaloneSearchBox } from "@react-google-maps/api";
3
3
  import { useState } from "react";
4
4
  import { Input } from "../Input";
5
- function GoogleSearchPlaces({ onChange, options, ...rest }) {
5
+ function GoogleSearchPlaces({ onChange, onPlaceChanged, options, ...rest }) {
6
6
  const [searchBox, setSearchBox] = useState(null);
7
7
  const handleLoad = (ref) => setSearchBox(ref);
8
8
  const handlePlacesChanged = () => {
@@ -31,9 +31,9 @@ function GoogleSearchPlaces({ onChange, options, ...rest }) {
31
31
  cep,
32
32
  coordinates: { lat, lng },
33
33
  };
34
- onChange && onChange(sendPlace);
34
+ onPlaceChanged && onPlaceChanged(sendPlace);
35
35
  }
36
36
  };
37
- return (_jsx(StandaloneSearchBox, { onLoad: handleLoad, onPlacesChanged: handlePlacesChanged, options: options, children: _jsx(Input, { type: "text", ...rest }) }));
37
+ return (_jsx(StandaloneSearchBox, { onLoad: handleLoad, onPlacesChanged: handlePlacesChanged, options: options, children: _jsx(Input, { type: "text", onChange: (e) => onChange(e.target.value), ...rest }) }));
38
38
  }
39
39
  export { GoogleSearchPlaces };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/components",
3
- "version": "1.3.103",
3
+ "version": "1.3.104",
4
4
  "main": "./dist/bundle.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Lucas Gonçalves",
@@ -12,6 +12,7 @@ type AddressComponentsType = {
12
12
 
13
13
  function GoogleSearchPlaces({
14
14
  onChange,
15
+ onPlaceChanged,
15
16
  options,
16
17
  ...rest
17
18
  }: GoogleSearchPlacesProps) {
@@ -50,7 +51,7 @@ function GoogleSearchPlaces({
50
51
  coordinates: { lat, lng },
51
52
  };
52
53
 
53
- onChange && onChange(sendPlace);
54
+ onPlaceChanged && onPlaceChanged(sendPlace);
54
55
  }
55
56
  };
56
57
 
@@ -60,7 +61,7 @@ function GoogleSearchPlaces({
60
61
  onPlacesChanged={handlePlacesChanged}
61
62
  options={options}
62
63
  >
63
- <Input type="text" {...rest} />
64
+ <Input type="text" onChange={(e) => onChange(e.target.value)} {...rest} />
64
65
  </StandaloneSearchBox>
65
66
  );
66
67
  }