@spothero/ui 13.9.0 → 13.10.0-beta.1
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/CHANGELOG.md +16 -0
- package/CHANGELOG.tmp +3 -3
- package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +9 -2
- package/package.json +1 -1
- package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.jsx +33 -1
- package/v1/index-bundled-cjs/index.js +1 -1
- package/v1/index-bundled-cjs/index.js.map +1 -1
- package/v1/index-bundled-esm/index.js +1 -1
- package/v1/index-bundled-esm/index.js.map +1 -1
- package/v1/index-unbundled-cjs/index.js +35 -35
- package/v1/index-unbundled-esm/index.js +35 -35
- package/v2/index-bundled-cjs/{ImageCarousel-c8dddbb1.js → ImageCarousel-e8e079e8.js} +2 -2
- package/v2/index-bundled-cjs/{ImageCarousel-c8dddbb1.js.map → ImageCarousel-e8e079e8.js.map} +1 -1
- package/v2/index-bundled-cjs/{index-7c73c07d.js → index-e7e488ba.js} +4 -4
- package/v2/index-bundled-cjs/{index-7c73c07d.js.map → index-e7e488ba.js.map} +1 -1
- package/v2/index-bundled-cjs/index.js +1 -1
- package/v2/index-bundled-esm/{ImageCarousel-dc224d64.js → ImageCarousel-64780662.js} +2 -2
- package/v2/index-bundled-esm/{ImageCarousel-dc224d64.js.map → ImageCarousel-64780662.js.map} +1 -1
- package/v2/index-bundled-esm/{index-7ef77e69.js → index-0fa0fa5c.js} +4 -4
- package/v2/index-bundled-esm/{index-7ef77e69.js.map → index-0fa0fa5c.js.map} +1 -1
- package/v2/index-bundled-esm/index.js +1 -1
- package/v2/index-unbundled-cjs/{ImageCarousel-325df0c4.js → ImageCarousel-bc41393b.js} +4 -4
- package/v2/index-unbundled-cjs/{ImageCarousel-325df0c4.js.map → ImageCarousel-bc41393b.js.map} +1 -1
- package/v2/index-unbundled-cjs/{index-093f8806.js → index-beb87ca2.js} +148 -148
- package/v2/index-unbundled-cjs/{index-093f8806.js.map → index-beb87ca2.js.map} +1 -1
- package/v2/index-unbundled-cjs/index.js +1 -1
- package/v2/index-unbundled-esm/{ImageCarousel-653f3259.js → ImageCarousel-d3597a8c.js} +4 -4
- package/v2/index-unbundled-esm/{ImageCarousel-653f3259.js.map → ImageCarousel-d3597a8c.js.map} +1 -1
- package/v2/index-unbundled-esm/{index-1c95808d.js → index-0ea45e07.js} +148 -148
- package/v2/index-unbundled-esm/{index-1c95808d.js.map → index-0ea45e07.js.map} +1 -1
- package/v2/index-unbundled-esm/index.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# 13.10.0-beta.1 - 02/22/2022
|
|
2
|
+
|
|
3
|
+
## Miscellaneous Updates
|
|
4
|
+
* [[1f46e18](https://github.com/spothero/fe-ui/commit/1f46e18)] - `chore:` Added logging for suggestions, and added origin to biasing options (Nathan)
|
|
5
|
+
|
|
6
|
+
# 13.10.0-beta.0 - 02/22/2022
|
|
7
|
+
## Miscellaneous Updates
|
|
8
|
+
|
|
9
|
+
## New Features
|
|
10
|
+
* [[4193a26](https://github.com/spothero/fe-ui/commit/4193a26)] - Updated Autocomplete to accept biasing options (Nathan)
|
|
11
|
+
|
|
12
|
+
## Miscellaneous Updates
|
|
13
|
+
* [[3a93a18](https://github.com/spothero/fe-ui/commit/3a93a18)] - 13.9.0-beta.0 (sh-devtools-bot)
|
|
14
|
+
* [[e6ab74b](https://github.com/spothero/fe-ui/commit/e6ab74b)] - `chore:` Updated location options (Nathan)
|
|
15
|
+
* [[19f8451](https://github.com/spothero/fe-ui/commit/19f8451)] - `chore:` Updated PropTypes for geolocation biasing (Nathan)
|
|
16
|
+
|
|
1
17
|
# 13.9.0 - 02/17/2022
|
|
2
18
|
|
|
3
19
|
## New Features
|
package/CHANGELOG.tmp
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# 13.
|
|
1
|
+
# 13.10.0-beta.1 - 02/22/2022
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
* [[
|
|
3
|
+
## Miscellaneous Updates
|
|
4
|
+
* [[1f46e18](https://github.com/spothero/fe-ui/commit/1f46e18)] - `chore:` Added logging for suggestions, and added origin to biasing options (Nathan)
|
|
5
5
|
|
|
@@ -148,10 +148,11 @@ var GooglePlacesSearchInput = /*#__PURE__*/function (_Component) {
|
|
|
148
148
|
var _this$props = _this.props,
|
|
149
149
|
country = _this$props.country,
|
|
150
150
|
types = _this$props.types,
|
|
151
|
-
bounds = _this$props.bounds
|
|
151
|
+
bounds = _this$props.bounds,
|
|
152
|
+
biasOptions = _this$props.biasOptions;
|
|
152
153
|
var autocompleteSessionToken = _this.state.autocompleteSessionToken;
|
|
153
154
|
|
|
154
|
-
var options = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
155
|
+
var options = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
155
156
|
input: value
|
|
156
157
|
}, bounds && {
|
|
157
158
|
bounds: bounds
|
|
@@ -161,6 +162,10 @@ var GooglePlacesSearchInput = /*#__PURE__*/function (_Component) {
|
|
|
161
162
|
}
|
|
162
163
|
}), types && {
|
|
163
164
|
types: types
|
|
165
|
+
}), (biasOptions === null || biasOptions === void 0 ? void 0 : biasOptions.location) && {
|
|
166
|
+
location: new _this._gmaps.LatLng(location.latitude, location.longitude),
|
|
167
|
+
radius: biasOptions === null || biasOptions === void 0 ? void 0 : biasOptions.radius,
|
|
168
|
+
origin: new _this._gmaps.LatLng(location.latitude, location.longitude)
|
|
164
169
|
}), {}, {
|
|
165
170
|
sessionToken: autocompleteSessionToken
|
|
166
171
|
});
|
|
@@ -178,6 +183,8 @@ var GooglePlacesSearchInput = /*#__PURE__*/function (_Component) {
|
|
|
178
183
|
});
|
|
179
184
|
}
|
|
180
185
|
|
|
186
|
+
console.log('>>>>>>suggestions', suggestions);
|
|
187
|
+
|
|
181
188
|
_this.setState({
|
|
182
189
|
suggestions: suggestions
|
|
183
190
|
});
|
package/package.json
CHANGED
|
@@ -27,6 +27,25 @@ export default class GooglePlacesSearchInput extends Component {
|
|
|
27
27
|
googleMaps: PropTypes.object,
|
|
28
28
|
/** A custom element (typically a PoweredByGoogle component) to display at the bottom of the suggestion list. */
|
|
29
29
|
poweredByGoogleFooter: PropTypes.element.isRequired,
|
|
30
|
+
/** An object containing the bias options */
|
|
31
|
+
biasOptions: PropTypes.shape({
|
|
32
|
+
/** The location (lat and long), to bias the search results around.
|
|
33
|
+
* * @see https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest.location
|
|
34
|
+
*/
|
|
35
|
+
location: PropTypes.shape({
|
|
36
|
+
latitude: PropTypes.number,
|
|
37
|
+
longitude: PropTypes.number,
|
|
38
|
+
}),
|
|
39
|
+
/** The radius, in meters, to bias the search results within - required when providing a location for biasing */
|
|
40
|
+
radius: (props, propName) =>
|
|
41
|
+
props.biasOptions.location.latitude &&
|
|
42
|
+
props.biasOptions.location.longitude &&
|
|
43
|
+
(Boolean(props[propName]) === false ||
|
|
44
|
+
typeof props[propName] !== 'number') &&
|
|
45
|
+
new Error(
|
|
46
|
+
'A radius value is required when biasing autocomplete suggestions'
|
|
47
|
+
),
|
|
48
|
+
}),
|
|
30
49
|
};
|
|
31
50
|
static defaultProps = {
|
|
32
51
|
placeholder: 'Search Address or Venue',
|
|
@@ -114,7 +133,7 @@ export default class GooglePlacesSearchInput extends Component {
|
|
|
114
133
|
};
|
|
115
134
|
|
|
116
135
|
_searchSuggestions = value => {
|
|
117
|
-
const {country, types, bounds} = this.props;
|
|
136
|
+
const {country, types, bounds, biasOptions} = this.props;
|
|
118
137
|
const {autocompleteSessionToken} = this.state;
|
|
119
138
|
|
|
120
139
|
const options = {
|
|
@@ -126,6 +145,17 @@ export default class GooglePlacesSearchInput extends Component {
|
|
|
126
145
|
},
|
|
127
146
|
}),
|
|
128
147
|
...(types && {types}),
|
|
148
|
+
...(biasOptions?.location && {
|
|
149
|
+
location: new this._gmaps.LatLng(
|
|
150
|
+
location.latitude,
|
|
151
|
+
location.longitude
|
|
152
|
+
),
|
|
153
|
+
radius: biasOptions?.radius,
|
|
154
|
+
origin: new this._gmaps.LatLng(
|
|
155
|
+
location.latitude,
|
|
156
|
+
location.longitude
|
|
157
|
+
),
|
|
158
|
+
}),
|
|
129
159
|
sessionToken: autocompleteSessionToken,
|
|
130
160
|
};
|
|
131
161
|
|
|
@@ -142,6 +172,8 @@ export default class GooglePlacesSearchInput extends Component {
|
|
|
142
172
|
});
|
|
143
173
|
}
|
|
144
174
|
|
|
175
|
+
console.log('>>>>>>suggestions', suggestions);
|
|
176
|
+
|
|
145
177
|
this.setState({
|
|
146
178
|
suggestions,
|
|
147
179
|
});
|