@awes-io/ui 2.145.7 → 2.145.8

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.145.8](https://github.com/awes-io/client/compare/@awes-io/ui@2.145.7...@awes-io/ui@2.145.8) (2026-11-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui:** address timezone from the place, Time Zone API as fallback ([f1d4ded](https://github.com/awes-io/client/commit/f1d4ded75e54dbb439d68217636bed010ae8bee6))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.145.7](https://github.com/awes-io/client/compare/@awes-io/ui@2.145.6...@awes-io/ui@2.145.7) (2026-11-17)
7
18
 
8
19
 
@@ -233,14 +233,15 @@ export default {
233
233
  }
234
234
 
235
235
  if (this.timezone) {
236
- return this._getTimeZone(response.location).then(
237
- (timezone) => {
238
- return {
239
- ...response,
240
- ...timezone
241
- }
236
+ return this._getTimeZone(
237
+ details.place_id,
238
+ response.location
239
+ ).then((timezone) => {
240
+ return {
241
+ ...response,
242
+ ...timezone
242
243
  }
243
- )
244
+ })
244
245
  } else {
245
246
  return Promise.resolve(response)
246
247
  }
@@ -256,7 +257,32 @@ export default {
256
257
  }
257
258
  },
258
259
 
259
- _getTimeZone({ lat, lng }) {
260
+ async _getTimeZone(placeId, location) {
261
+ const timezone = await this._getPlaceTimeZone(placeId)
262
+
263
+ if (timezone) {
264
+ return { timezone }
265
+ }
266
+
267
+ return this._getTimeZoneByLocation(location)
268
+ },
269
+
270
+ async _getPlaceTimeZone(placeId) {
271
+ try {
272
+ const { Place } = await window.google.maps.importLibrary(
273
+ 'places'
274
+ )
275
+ const place = new Place({ id: placeId })
276
+
277
+ await place.fetchFields({ fields: ['timeZone'] })
278
+
279
+ return place.timeZone ? place.timeZone.id : undefined
280
+ } catch (e) {
281
+ return undefined
282
+ }
283
+ },
284
+
285
+ _getTimeZoneByLocation({ lat, lng }) {
260
286
  return axios
261
287
  .request({
262
288
  url: 'https://maps.googleapis.com/maps/api/timezone/json',
@@ -129,7 +129,7 @@ This component uses `AwSelectObject` slots internally. All `AwSelectObject` slot
129
129
  - Session tokens are used for billing optimization
130
130
  - Address types are filtered (removes political, intersection, sublocality types)
131
131
  - Google branding is automatically displayed
132
- - Timezone requires additional API call (may incur extra cost)
132
+ - Timezone comes from the place's `timeZone` field via `Place.fetchFields` (Places API (New)), which works with a key restricted to websites. Only when the place has no time zone does the component fall back to the Time Zone API (it rejects website-restricted keys); any failure leaves `timezone` undefined
133
133
  - Component handles Google Maps script loading and initialization
134
134
  - Search is debounced and handled by `AwSelectObject`
135
135
  - Selected address triggers Places API details request
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.145.7",
3
+ "version": "2.145.8",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -116,5 +116,5 @@
116
116
  "peerDependencies": {
117
117
  "nuxt": "^2.18.1"
118
118
  },
119
- "gitHead": "ca9b29f152232eea62fbdd511191ce78de8c69ea"
119
+ "gitHead": "89ba4dea9d0837bac551be8e9339f8079d5cb830"
120
120
  }