@awes-io/ui 2.145.7 → 2.145.9
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,29 @@
|
|
|
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.9](https://github.com/awes-io/client/compare/@awes-io/ui@2.145.8...@awes-io/ui@2.145.9) (2026-11-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui:** log why the address timezone came back empty ([abcebd2](https://github.com/awes-io/client/commit/abcebd250d8f25de0e6e16114799e816de0c0215))
|
|
12
|
+
* **ui:** tel field survives a country change with an empty value ([a2893c5](https://github.com/awes-io/client/commit/a2893c5e3bd8fa5f312619bc20c1b28f26d732b2))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [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)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **ui:** address timezone from the place, Time Zone API as fallback ([f1d4ded](https://github.com/awes-io/client/commit/f1d4ded75e54dbb439d68217636bed010ae8bee6))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
## [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
30
|
|
|
8
31
|
|
|
@@ -233,14 +233,15 @@ export default {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
if (this.timezone) {
|
|
236
|
-
return this._getTimeZone(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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,33 @@ export default {
|
|
|
256
257
|
}
|
|
257
258
|
},
|
|
258
259
|
|
|
259
|
-
_getTimeZone(
|
|
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
|
+
console.warn('AwAddress: place time zone request failed', e)
|
|
282
|
+
return undefined
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
_getTimeZoneByLocation({ lat, lng }) {
|
|
260
287
|
return axios
|
|
261
288
|
.request({
|
|
262
289
|
url: 'https://maps.googleapis.com/maps/api/timezone/json',
|
|
@@ -267,12 +294,22 @@ export default {
|
|
|
267
294
|
}
|
|
268
295
|
})
|
|
269
296
|
.then(({ data }) => {
|
|
297
|
+
if (data.status !== 'OK') {
|
|
298
|
+
console.warn(
|
|
299
|
+
'AwAddress: Time Zone API',
|
|
300
|
+
data.status,
|
|
301
|
+
data.errorMessage || ''
|
|
302
|
+
)
|
|
303
|
+
return { timezone: undefined, timezone_name: undefined }
|
|
304
|
+
}
|
|
305
|
+
|
|
270
306
|
return {
|
|
271
307
|
timezone: data.timeZoneId,
|
|
272
308
|
timezone_name: data.timeZoneName
|
|
273
309
|
}
|
|
274
310
|
})
|
|
275
|
-
.catch(() => {
|
|
311
|
+
.catch((e) => {
|
|
312
|
+
console.warn('AwAddress: Time Zone API request failed', e)
|
|
276
313
|
return {
|
|
277
314
|
timezone: undefined,
|
|
278
315
|
timezone_name: undefined
|
|
@@ -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
|
|
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, including a Time Zone API answer whose `status` is not `OK`, leaves `timezone` undefined and logs the reason with `console.warn`
|
|
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.
|
|
3
|
+
"version": "2.145.9",
|
|
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": "
|
|
119
|
+
"gitHead": "6ac7859ef3e2f2c3637e97c21a253ecdde2d15e8"
|
|
120
120
|
}
|