@jskit-ai/http-web 0.2.11 → 0.2.12
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
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- CRUD list filters show the presence choices and the default filter chips through the app's translator, from resource-crud-core's new catalog (registered with http-web's own). The English is unchanged.
|
|
6
|
+
|
|
3
7
|
## 0.2.0 - 2026-10-29
|
|
4
8
|
|
|
5
9
|
- Translation ready: every user-visible text is a message key with its English in `locales/en.json`, so an app translates it by supplying translation files only. With no translations, texts and behaviour are unchanged. See the guide "Translating a JSKIT app".
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/http-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test --test-concurrency=1"
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"./locales/en.json": "./locales/en.json"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
50
|
+
"@jskit-ai/resource-crud-core": "0.1.197",
|
|
51
51
|
"@mdi/js": "^7.4.47"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@jskit-ai/http-runtime": "0.2.
|
|
55
|
-
"@jskit-ai/kernel": "0.2.
|
|
56
|
-
"@jskit-ai/realtime": "0.2.
|
|
57
|
-
"@jskit-ai/shell-web": "0.2.
|
|
54
|
+
"@jskit-ai/http-runtime": "0.2.6",
|
|
55
|
+
"@jskit-ai/kernel": "0.2.6",
|
|
56
|
+
"@jskit-ai/realtime": "0.2.10",
|
|
57
|
+
"@jskit-ai/shell-web": "0.2.7",
|
|
58
58
|
"@tanstack/vue-query": "^5.90.5",
|
|
59
59
|
"vue": "^3.5.13",
|
|
60
60
|
"vue-router": "^5.0.4",
|
|
@@ -21,8 +21,11 @@ const props = defineProps({
|
|
|
21
21
|
const { t, text } = useJskitText();
|
|
22
22
|
const runtimeValues = computed(() => props.runtime.values);
|
|
23
23
|
|
|
24
|
+
// Option labels may be message keys, such as the presence filter's.
|
|
24
25
|
function optionItems(filter = {}) {
|
|
25
|
-
return Array.isArray(filter.options)
|
|
26
|
+
return Array.isArray(filter.options)
|
|
27
|
+
? filter.options.map((option) => ({ ...option, label: text(option.label) }))
|
|
28
|
+
: [];
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
// Filter labels and placeholders may be message keys.
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import { formatCrudListDateFilterChipLabel } from "../support/crudListDateFilterSupport.js";
|
|
20
20
|
import { useJskitText } from "../i18n.js";
|
|
21
21
|
|
|
22
|
-
const { text } = useJskitText();
|
|
22
|
+
const { t, text } = useJskitText();
|
|
23
23
|
|
|
24
24
|
function normalizeFunctionMap(value = {}) {
|
|
25
25
|
const source = value && typeof value === "object" && !Array.isArray(value)
|
|
@@ -172,9 +172,9 @@ function resolveAtomicValueLabel(filter = {}, value = "", labelResolvers = {}) {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
return resolveCrudListFilterOptionLabel(filter, value, {
|
|
175
|
+
return text(resolveCrudListFilterOptionLabel(filter, value, {
|
|
176
176
|
fallback: String(value || "")
|
|
177
|
-
});
|
|
177
|
+
}));
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
// A filter label may be a message key; dates use the active language.
|
|
@@ -183,7 +183,8 @@ function formatDefaultChipLabel(filter = {}, chipValue, labelResolvers = {}) {
|
|
|
183
183
|
|| formatCrudListFilterDefaultChipLabel({ ...filter, label: text(filter.label) }, chipValue, {
|
|
184
184
|
resolveAtomicValue(value) {
|
|
185
185
|
return resolveAtomicValueLabel(filter, value, labelResolvers);
|
|
186
|
-
}
|
|
186
|
+
},
|
|
187
|
+
t
|
|
187
188
|
});
|
|
188
189
|
}
|
|
189
190
|
|
package/src/client/i18n.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { createTextError, registerJskitMessages, useJskitText } from "@jskit-ai/kernel/client/i18n";
|
|
2
|
+
import crudEnglish from "@jskit-ai/resource-crud-core/locales/en.json" with { type: "json" };
|
|
2
3
|
import en from "../../locales/en.json" with { type: "json" };
|
|
3
4
|
|
|
4
|
-
// http-web's English
|
|
5
|
-
// translate in fixtures and tests as well as in a
|
|
5
|
+
// http-web's English and the CRUD filter words it renders, registered on import
|
|
6
|
+
// so its screens and composables translate in fixtures and tests as well as in a
|
|
7
|
+
// bootstrapped app.
|
|
8
|
+
registerJskitMessages(crudEnglish);
|
|
6
9
|
registerJskitMessages(en);
|
|
7
10
|
|
|
8
11
|
export { createTextError, useJskitText };
|