@awes-io/ui 2.144.2 → 2.144.4
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.144.4](https://github.com/awes-io/client/compare/@awes-io/ui@2.144.3...@awes-io/ui@2.144.4) (2026-03-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **aw-search:** react only on search param change ([b260651](https://github.com/awes-io/client/commit/b260651d822f71a01b93f793c4ef4477fc280dae))
|
|
12
|
+
* **lang:** browser lang detection improved to handle extended locales ([1be916e](https://github.com/awes-io/client/commit/1be916e92303c8cb84896c2907a6726c1acd9493))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [2.144.3](https://github.com/awes-io/client/compare/@awes-io/ui@2.144.2...@awes-io/ui@2.144.3) (2026-02-24)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* fix card badge ([ebe04a7](https://github.com/awes-io/client/commit/ebe04a7cb670339714c8c0ed378541593017c31f))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
## [2.144.2](https://github.com/awes-io/client/compare/@awes-io/ui@2.144.1...@awes-io/ui@2.144.2) (2026-02-17)
|
|
7
30
|
|
|
8
31
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
<script>
|
|
31
31
|
import { cleanRouteQuery } from '@AwUtils/router'
|
|
32
|
-
import { pick } from 'rambdax'
|
|
32
|
+
import { pick, pathOr } from 'rambdax'
|
|
33
33
|
|
|
34
34
|
const INPUT_ELEMENTS = ['input', 'textarea']
|
|
35
35
|
|
|
@@ -96,7 +96,13 @@ export default {
|
|
|
96
96
|
|
|
97
97
|
'$route.query': {
|
|
98
98
|
immediate: true,
|
|
99
|
-
handler(query) {
|
|
99
|
+
handler(query, oldQuery) {
|
|
100
|
+
if (
|
|
101
|
+
pathOr('', this.param, oldQuery) ===
|
|
102
|
+
pathOr('', this.param, query)
|
|
103
|
+
)
|
|
104
|
+
return
|
|
105
|
+
|
|
100
106
|
clearTimeout(this._tm)
|
|
101
107
|
this.text = query[this.param] || ''
|
|
102
108
|
}
|
|
@@ -39,6 +39,42 @@ const langCookie = langOptions.langCookie
|
|
|
39
39
|
|
|
40
40
|
const toLocale = (lang = '') => lang.slice(0, 2).toLowerCase()
|
|
41
41
|
|
|
42
|
+
const findRelevantLocale = (localeCodes, browserLanguages) => {
|
|
43
|
+
const normalizedCodes = localeCodes.map((code) => code.toLowerCase())
|
|
44
|
+
|
|
45
|
+
const tryLocale = (lang) => {
|
|
46
|
+
if (!lang) return null
|
|
47
|
+
|
|
48
|
+
const lower = lang.toLowerCase()
|
|
49
|
+
const exactIndex = normalizedCodes.indexOf(lower)
|
|
50
|
+
|
|
51
|
+
if (exactIndex !== -1) {
|
|
52
|
+
return localeCodes[exactIndex]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const base = toLocale(lang)
|
|
56
|
+
if (!base) return null
|
|
57
|
+
|
|
58
|
+
const baseIndex = normalizedCodes.findIndex((code) => code.startsWith(base))
|
|
59
|
+
|
|
60
|
+
if (baseIndex !== -1) {
|
|
61
|
+
return localeCodes[baseIndex]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return null
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
for (const lang of browserLanguages) {
|
|
68
|
+
const match = tryLocale(lang)
|
|
69
|
+
|
|
70
|
+
if (match) {
|
|
71
|
+
return match
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return null
|
|
76
|
+
}
|
|
77
|
+
|
|
42
78
|
const i18nOptions = mergeDeepRight(
|
|
43
79
|
{
|
|
44
80
|
formatFallbackMessages: true,
|
|
@@ -98,19 +134,18 @@ export default async ({ app, $axios }) => {
|
|
|
98
134
|
return remove
|
|
99
135
|
}
|
|
100
136
|
|
|
101
|
-
|
|
102
|
-
* Detect browser language
|
|
103
|
-
*/
|
|
104
|
-
let _browserLang = toLocale(navigator.language)
|
|
137
|
+
const browserLanguages = []
|
|
105
138
|
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
navigator.languages.find(locale =>
|
|
109
|
-
localeCodes.includes(toLocale(locale))
|
|
110
|
-
)
|
|
111
|
-
)
|
|
139
|
+
if (navigator.language) {
|
|
140
|
+
browserLanguages.push(navigator.language)
|
|
112
141
|
}
|
|
113
142
|
|
|
143
|
+
if (Array.isArray(navigator.languages)) {
|
|
144
|
+
browserLanguages.push(...navigator.languages)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const _browserLang = findRelevantLocale(localeCodes, browserLanguages)
|
|
148
|
+
|
|
114
149
|
/**
|
|
115
150
|
* Restore saved lang
|
|
116
151
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awes-io/ui",
|
|
3
|
-
"version": "2.144.
|
|
3
|
+
"version": "2.144.4",
|
|
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": "d03e9bd5033a1ec195b63e1fb09979c89901fb68"
|
|
120
120
|
}
|