@shwfed/config 2.9.12 → 2.10.0
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/dist/mcp.mjs +1610 -1107
- package/dist/module.json +1 -1
- package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-CpDhqXJp.js → FieldGroup.vue_vue_type_script_setup_true_lang-CCaOWk_7.js} +1 -1
- package/dist/preview/assets/{badge-Dsz2Rn8b.js → badge-D9_7atSJ.js} +1 -1
- package/dist/preview/assets/{config-vsMk-zRS.js → config-B2d8SiPi.js} +1 -1
- package/dist/preview/assets/{config-if9TvUw2.js → config-BLEovXei.js} +1 -1
- package/dist/preview/assets/{config-CRD1MpEn.js → config-Bf5Vckj3.js} +1 -1
- package/dist/preview/assets/{config-BePS5kQb.js → config-Bk2VSNeu.js} +1 -1
- package/dist/preview/assets/{config-X6-9yQmS.js → config-C8lCItmz.js} +1 -1
- package/dist/preview/assets/{config-CQLR1Zao.js → config-C9WPOoA7.js} +1 -1
- package/dist/preview/assets/{config-9-c5e5iP.js → config-CNKb25Qo.js} +1 -1
- package/dist/preview/assets/{config-DY7nQeRd.js → config-CQrqVV1U.js} +1 -1
- package/dist/preview/assets/{config-bFWnH6k3.js → config-DWA385pD.js} +1 -1
- package/dist/preview/assets/{config-Y2YuesjH.js → config-DYxMKhCU.js} +1 -1
- package/dist/preview/assets/{config-BCvaA0as.js → config-DZlaJUlF.js} +1 -1
- package/dist/preview/assets/{config-hrBgOr32.js → config-DyPl6K2G.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-CPrYbKjH.js → definition.vue_vue_type_script_setup_true_lang-CFzQ7icU.js} +1 -1
- package/dist/preview/assets/index-7BE56IYF.js +739 -0
- package/dist/preview/assets/{index-DJ5rzQJr.css → index-BnJ5p1Mx.css} +1 -1
- package/dist/preview/assets/index-Bwv0Yz_L.js +1 -0
- package/dist/preview/assets/{index-DFRXx_kG.js → index-CXOEVGFP.js} +1 -1
- package/dist/preview/assets/{item-auVJu6jy.js → item-DCVX69_o.js} +1 -1
- package/dist/preview/assets/{runtime-DyeSWij2.js → runtime-BD1A-g1h.js} +1 -1
- package/dist/preview/assets/{runtime-1DsatQOR.js → runtime-BNk4EliL.js} +1 -1
- package/dist/preview/assets/{runtime-Do_KQ5le.js → runtime-BO-KY3T_.js} +1 -1
- package/dist/preview/assets/{runtime-_5B97gRO.js → runtime-BsNSI1XP.js} +1 -1
- package/dist/preview/assets/{runtime-28a_li4U.js → runtime-Cbc5NH57.js} +1 -1
- package/dist/preview/assets/{runtime-DaaQn8fX.js → runtime-DEWGIyvr.js} +1 -1
- package/dist/preview/assets/{runtime-H7c112vi.js → runtime-DJ9ElxWB.js} +1 -1
- package/dist/preview/assets/{runtime-CBDARlsK.js → runtime-DSfMvph3.js} +1 -1
- package/dist/preview/assets/{runtime-CmgeUPz4.js → runtime-O6MNC3GA.js} +1 -1
- package/dist/preview/assets/{runtime-BDvuTpxY.js → runtime-r1wbrr4k.js} +1 -1
- package/dist/preview/assets/{schema-meta-Dc89aD6v.js → schema-meta-ovcuERKg.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.d.ts +15 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.js +57 -1
- package/dist/runtime/components/actions/components/triggers-field.vue +12 -12
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +134 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +134 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +134 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +134 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +195 -0
- package/dist/runtime/components/config/use-editor.js +1 -1
- package/dist/runtime/components/config/utils/validation-error.d.ts +1 -1
- package/dist/runtime/components/config/utils/validation-error.js +40 -7
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/runtime.vue +3 -3
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/runtime.vue +6 -5
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/runtime.vue +6 -5
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/runtime.vue +10 -8
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue +8 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue +10 -8
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue +8 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/runtime.vue +10 -8
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/runtime.vue +7 -5
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/runtime.vue +8 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/runtime.vue +7 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/runtime.vue +9 -7
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/runtime.vue +4 -3
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/runtime.vue +8 -6
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/runtime.vue +5 -4
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +12 -10
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +5 -4
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/runtime.vue +9 -7
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue +9 -7
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +13 -15
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue +8 -6
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue +10 -8
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue +10 -8
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.vue +13 -14
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.vue +13 -14
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +14 -12
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +14 -12
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +13 -14
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +13 -14
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +13 -15
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +15 -16
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/runtime.vue +8 -7
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.d.vue.ts +175 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.vue +782 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.vue.d.ts +175 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.vue +413 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.d.ts +214 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.js +191 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.d.vue.ts +175 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.vue +782 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.vue.d.ts +175 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.vue +426 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.d.ts +214 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.js +191 -0
- package/dist/runtime/components/form/fields/2026-06-14/combobox-migrate.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-06-14/combobox-migrate.js +36 -0
- package/dist/runtime/components/form/utils/state.d.ts +11 -0
- package/dist/runtime/components/form/utils/state.js +5 -0
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/runtime.js +5 -3
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.js +3 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/config.d.vue.ts +3 -3
- package/dist/runtime/components/table/config.vue +54 -20
- package/dist/runtime/components/table/config.vue.d.ts +3 -3
- package/dist/runtime/components/table/index.d.vue.ts +2 -0
- package/dist/runtime/components/table/index.vue +12 -3
- package/dist/runtime/components/table/index.vue.d.ts +2 -0
- package/dist/runtime/components/table/schema.d.ts +263 -0
- package/dist/runtime/components/table/schema.js +8 -4
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +1 -1
- package/dist/runtime/share/expression.js +1 -0
- package/package.json +1 -1
- package/dist/preview/assets/index-BoyzyftU.js +0 -1
- package/dist/preview/assets/index-Bvlt8fEt.js +0 -734
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue
CHANGED
|
@@ -17,7 +17,7 @@ import { Skeleton } from "../../../../ui/skeleton";
|
|
|
17
17
|
import { Tree as UiTree } from "../../../../ui/tree";
|
|
18
18
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
19
19
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
20
|
-
import { useFormState } from "../../../utils/state";
|
|
20
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
21
21
|
import { useFieldValidation } from "../../../utils/validation";
|
|
22
22
|
defineOptions({ name: "ShwfedTreeMultiFieldRuntime" });
|
|
23
23
|
const props = defineProps({
|
|
@@ -32,7 +32,6 @@ const { locale, t } = useI18n({
|
|
|
32
32
|
"tree-multi-search-clear": "\u6E05\u9664\u641C\u7D22",
|
|
33
33
|
"tree-multi-load-error": "\u52A0\u8F7D\u5931\u8D25",
|
|
34
34
|
"tree-multi-empty": "\u65E0\u53EF\u9009\u9879",
|
|
35
|
-
"tree-multi-readonly-empty": "\u2014",
|
|
36
35
|
"tree-multi-readonly-separator": "\u3001"
|
|
37
36
|
},
|
|
38
37
|
en: {
|
|
@@ -40,7 +39,6 @@ const { locale, t } = useI18n({
|
|
|
40
39
|
"tree-multi-search-clear": "Clear search",
|
|
41
40
|
"tree-multi-load-error": "Failed to load",
|
|
42
41
|
"tree-multi-empty": "No options",
|
|
43
|
-
"tree-multi-readonly-empty": "\u2014",
|
|
44
42
|
"tree-multi-readonly-separator": ", "
|
|
45
43
|
},
|
|
46
44
|
ja: {
|
|
@@ -48,12 +46,12 @@ const { locale, t } = useI18n({
|
|
|
48
46
|
"tree-multi-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
|
|
49
47
|
"tree-multi-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
50
48
|
"tree-multi-empty": "\u9078\u629E\u80A2\u306A\u3057",
|
|
51
|
-
"tree-multi-readonly-empty": "\u2014",
|
|
52
49
|
"tree-multi-readonly-separator": "\u3001"
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
});
|
|
56
|
-
const {
|
|
53
|
+
const { getAt, setAt } = useFormState();
|
|
54
|
+
const formScope = useFormScope();
|
|
57
55
|
const inherited = injectCELContext();
|
|
58
56
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
59
57
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -63,7 +61,7 @@ const tooltipText = computed(
|
|
|
63
61
|
function evalBool(expression, label) {
|
|
64
62
|
if (!expression) return false;
|
|
65
63
|
try {
|
|
66
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
64
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
67
65
|
} catch (err) {
|
|
68
66
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
69
67
|
return false;
|
|
@@ -111,11 +109,11 @@ async function fetchTree() {
|
|
|
111
109
|
let jsonOpt = Option.none();
|
|
112
110
|
if (dataSource.request) {
|
|
113
111
|
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
114
|
-
form: state.value ?? {}
|
|
112
|
+
form: formScope.state.value ?? {}
|
|
115
113
|
}));
|
|
116
114
|
}
|
|
117
115
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
118
|
-
form: state.value ?? {},
|
|
116
|
+
form: formScope.state.value ?? {},
|
|
119
117
|
json: jsonOpt
|
|
120
118
|
});
|
|
121
119
|
return Array.isArray(dataRaw) ? dataRaw : [];
|
|
@@ -149,7 +147,7 @@ watch(
|
|
|
149
147
|
{ immediate: true }
|
|
150
148
|
);
|
|
151
149
|
function nodeCtx(node) {
|
|
152
|
-
return { form: state.value ?? {}, node };
|
|
150
|
+
return { form: formScope.state.value ?? {}, node };
|
|
153
151
|
}
|
|
154
152
|
function getKey(node) {
|
|
155
153
|
try {
|
|
@@ -186,7 +184,7 @@ function nodeSelectable(node, _depth) {
|
|
|
186
184
|
}
|
|
187
185
|
function safeInterpolate(tpl, node) {
|
|
188
186
|
try {
|
|
189
|
-
return interpolateMarkdown(tpl, $cel, { form: state.value ?? {}, node });
|
|
187
|
+
return interpolateMarkdown(tpl, $cel, { form: formScope.state.value ?? {}, node });
|
|
190
188
|
} catch (err) {
|
|
191
189
|
console.error(`[shwfed-form] failed to interpolate node text for ${props.fieldId}:`, err);
|
|
192
190
|
return tpl;
|
|
@@ -289,14 +287,13 @@ publishSelection(
|
|
|
289
287
|
}
|
|
290
288
|
);
|
|
291
289
|
const readonlyText = computed(() => {
|
|
292
|
-
|
|
293
|
-
if (model.value.length === 0) return empty;
|
|
290
|
+
if (model.value.length === 0) return null;
|
|
294
291
|
const found = resolvedByKey.value;
|
|
295
292
|
const labels = model.value.map((id) => {
|
|
296
293
|
const n = found.get(id);
|
|
297
294
|
return n !== void 0 ? nodeLabelText(n) : id;
|
|
298
295
|
}).filter((l) => l.length > 0);
|
|
299
|
-
return labels.length > 0 ? labels.join(t("tree-multi-readonly-separator")) :
|
|
296
|
+
return labels.length > 0 ? labels.join(t("tree-multi-readonly-separator")) : null;
|
|
300
297
|
});
|
|
301
298
|
</script>
|
|
302
299
|
|
|
@@ -327,9 +324,10 @@ const readonlyText = computed(() => {
|
|
|
327
324
|
|
|
328
325
|
<div
|
|
329
326
|
v-if="effectiveReadonly"
|
|
330
|
-
class="min-h-9 py-1.5 text-sm
|
|
327
|
+
class="min-h-9 py-1.5 text-sm"
|
|
328
|
+
:class="readonlyText ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
331
329
|
>
|
|
332
|
-
{{ readonlyText }}
|
|
330
|
+
{{ readonlyText || "-" }}
|
|
333
331
|
</div>
|
|
334
332
|
|
|
335
333
|
<template v-else>
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue
CHANGED
|
@@ -16,7 +16,7 @@ import { Skeleton } from "../../../../ui/skeleton";
|
|
|
16
16
|
import { Tree as UiTree } from "../../../../ui/tree";
|
|
17
17
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
18
18
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
19
|
-
import { useFormState } from "../../../utils/state";
|
|
19
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
20
20
|
import { useFieldValidation } from "../../../utils/validation";
|
|
21
21
|
defineOptions({ name: "ShwfedTreeSingleFieldRuntime" });
|
|
22
22
|
const props = defineProps({
|
|
@@ -30,26 +30,24 @@ const { locale, t } = useI18n({
|
|
|
30
30
|
"tree-single-search-label": "\u641C\u7D22",
|
|
31
31
|
"tree-single-search-clear": "\u6E05\u9664\u641C\u7D22",
|
|
32
32
|
"tree-single-load-error": "\u52A0\u8F7D\u5931\u8D25",
|
|
33
|
-
"tree-single-empty": "\u65E0\u53EF\u9009\u9879"
|
|
34
|
-
"tree-single-readonly-empty": "\u2014"
|
|
33
|
+
"tree-single-empty": "\u65E0\u53EF\u9009\u9879"
|
|
35
34
|
},
|
|
36
35
|
en: {
|
|
37
36
|
"tree-single-search-label": "Search",
|
|
38
37
|
"tree-single-search-clear": "Clear search",
|
|
39
38
|
"tree-single-load-error": "Failed to load",
|
|
40
|
-
"tree-single-empty": "No options"
|
|
41
|
-
"tree-single-readonly-empty": "\u2014"
|
|
39
|
+
"tree-single-empty": "No options"
|
|
42
40
|
},
|
|
43
41
|
ja: {
|
|
44
42
|
"tree-single-search-label": "\u691C\u7D22",
|
|
45
43
|
"tree-single-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
|
|
46
44
|
"tree-single-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
47
|
-
"tree-single-empty": "\u9078\u629E\u80A2\u306A\u3057"
|
|
48
|
-
"tree-single-readonly-empty": "\u2014"
|
|
45
|
+
"tree-single-empty": "\u9078\u629E\u80A2\u306A\u3057"
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
});
|
|
52
|
-
const {
|
|
49
|
+
const { getAt, setAt } = useFormState();
|
|
50
|
+
const formScope = useFormScope();
|
|
53
51
|
const inherited = injectCELContext();
|
|
54
52
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
55
53
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -59,7 +57,7 @@ const tooltipText = computed(
|
|
|
59
57
|
function evalBool(expression, label) {
|
|
60
58
|
if (!expression) return false;
|
|
61
59
|
try {
|
|
62
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
60
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
63
61
|
} catch (err) {
|
|
64
62
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
65
63
|
return false;
|
|
@@ -107,11 +105,11 @@ async function fetchTree() {
|
|
|
107
105
|
let jsonOpt = Option.none();
|
|
108
106
|
if (dataSource.request) {
|
|
109
107
|
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
110
|
-
form: state.value ?? {}
|
|
108
|
+
form: formScope.state.value ?? {}
|
|
111
109
|
}));
|
|
112
110
|
}
|
|
113
111
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
114
|
-
form: state.value ?? {},
|
|
112
|
+
form: formScope.state.value ?? {},
|
|
115
113
|
json: jsonOpt
|
|
116
114
|
});
|
|
117
115
|
return Array.isArray(dataRaw) ? dataRaw : [];
|
|
@@ -145,7 +143,7 @@ watch(
|
|
|
145
143
|
{ immediate: true }
|
|
146
144
|
);
|
|
147
145
|
function nodeCtx(node) {
|
|
148
|
-
return { form: state.value ?? {}, node };
|
|
146
|
+
return { form: formScope.state.value ?? {}, node };
|
|
149
147
|
}
|
|
150
148
|
function getKey(node) {
|
|
151
149
|
try {
|
|
@@ -182,7 +180,7 @@ function nodeSelectable(node, _depth) {
|
|
|
182
180
|
}
|
|
183
181
|
function safeInterpolate(tpl, node) {
|
|
184
182
|
try {
|
|
185
|
-
return interpolateMarkdown(tpl, $cel, { form: state.value ?? {}, node });
|
|
183
|
+
return interpolateMarkdown(tpl, $cel, { form: formScope.state.value ?? {}, node });
|
|
186
184
|
} catch (err) {
|
|
187
185
|
console.error(`[shwfed-form] failed to interpolate node text for ${props.fieldId}:`, err);
|
|
188
186
|
return tpl;
|
|
@@ -278,7 +276,7 @@ publishSelection(
|
|
|
278
276
|
);
|
|
279
277
|
const readonlyText = computed(() => {
|
|
280
278
|
const selected = model.value;
|
|
281
|
-
if (selected == null) return
|
|
279
|
+
if (selected == null) return null;
|
|
282
280
|
const n = selectedNode.value;
|
|
283
281
|
if (n === void 0) return selected;
|
|
284
282
|
const label = nodeLabelText(n);
|
|
@@ -313,9 +311,10 @@ const readonlyText = computed(() => {
|
|
|
313
311
|
|
|
314
312
|
<div
|
|
315
313
|
v-if="effectiveReadonly"
|
|
316
|
-
class="min-h-9 py-1.5 text-sm
|
|
314
|
+
class="min-h-9 py-1.5 text-sm"
|
|
315
|
+
:class="readonlyText ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
317
316
|
>
|
|
318
|
-
{{ readonlyText }}
|
|
317
|
+
{{ readonlyText || "-" }}
|
|
319
318
|
</div>
|
|
320
319
|
|
|
321
320
|
<template v-else>
|
package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/runtime.vue
CHANGED
|
@@ -14,7 +14,7 @@ import { Markdown } from "../../../../ui/markdown";
|
|
|
14
14
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
15
15
|
import { useFieldValidation } from "../../../utils/validation";
|
|
16
16
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
17
|
-
import { useFormState } from "../../../utils/state";
|
|
17
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
18
18
|
const ICONS = {
|
|
19
19
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "vscode-icons:file-type-excel",
|
|
20
20
|
"application/vnd.ms-excel": "vscode-icons:file-type-excel",
|
|
@@ -91,7 +91,8 @@ const { locale, t } = useI18n({
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
const {
|
|
94
|
+
const { getAt, setAt } = useFormState();
|
|
95
|
+
const formScope = useFormScope();
|
|
95
96
|
const inherited = injectCELContext();
|
|
96
97
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
97
98
|
const labelText = computed(
|
|
@@ -106,7 +107,7 @@ const tooltipText = computed(
|
|
|
106
107
|
function evalBool(expression, label) {
|
|
107
108
|
if (!expression) return false;
|
|
108
109
|
try {
|
|
109
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
110
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
110
111
|
} catch (err) {
|
|
111
112
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
112
113
|
return false;
|
|
@@ -146,7 +147,7 @@ function entryName(entry) {
|
|
|
146
147
|
const expr = props.config.upload?.filename;
|
|
147
148
|
if (expr) {
|
|
148
149
|
try {
|
|
149
|
-
const name = Effect.runSync($cel(expr, { form: state.value ?? {}, file: entry }));
|
|
150
|
+
const name = Effect.runSync($cel(expr, { form: formScope.state.value ?? {}, file: entry }));
|
|
150
151
|
if (typeof name === "string" && name.length > 0) return name;
|
|
151
152
|
} catch (err) {
|
|
152
153
|
console.error(`[shwfed-form] failed to evaluate upload filename for ${props.fieldId}:`, err);
|
|
@@ -215,11 +216,11 @@ async function uploadFiles(accepted) {
|
|
|
215
216
|
if (!upload) return [];
|
|
216
217
|
const program = Effect.gen(function* () {
|
|
217
218
|
const builder = yield* $cel(upload.request, {
|
|
218
|
-
form: state.value ?? {},
|
|
219
|
+
form: formScope.state.value ?? {},
|
|
219
220
|
files: accepted
|
|
220
221
|
});
|
|
221
222
|
const json = yield* builder.json();
|
|
222
|
-
return yield* $cel(upload.handle, { form: state.value ?? {}, json });
|
|
223
|
+
return yield* $cel(upload.handle, { form: formScope.state.value ?? {}, json });
|
|
223
224
|
});
|
|
224
225
|
try {
|
|
225
226
|
const items = await Effect.runPromise(Effect.provide(program, Fetch.layer));
|
|
@@ -287,7 +288,7 @@ function templateLabelText(template) {
|
|
|
287
288
|
return (template.label ? getLocalizedText(template.label, locale.value) : void 0) ?? "\u4E0B\u8F7D\u6A21\u677F";
|
|
288
289
|
}
|
|
289
290
|
async function onDownloadTemplate(template) {
|
|
290
|
-
const ctx = { form: state.value ?? {} };
|
|
291
|
+
const ctx = { form: formScope.state.value ?? {} };
|
|
291
292
|
const program = Effect.gen(function* () {
|
|
292
293
|
const requestBuilder = yield* $cel(template.request, ctx);
|
|
293
294
|
if (!template.download) {
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: {
|
|
7
|
+
readonly label?: readonly [{
|
|
8
|
+
readonly locale: "zh";
|
|
9
|
+
readonly message: string;
|
|
10
|
+
}, ...{
|
|
11
|
+
readonly locale: "en" | "ja" | "ko";
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}[]] | undefined;
|
|
14
|
+
readonly disabled?: string | undefined;
|
|
15
|
+
readonly type: "com.shwfed.form.field.combobox.multi";
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly hidden?: string | undefined;
|
|
18
|
+
readonly tooltip?: readonly [{
|
|
19
|
+
readonly locale: "zh";
|
|
20
|
+
readonly message: string;
|
|
21
|
+
}, ...{
|
|
22
|
+
readonly locale: "en" | "ja" | "ko";
|
|
23
|
+
readonly message: string;
|
|
24
|
+
}[]] | undefined;
|
|
25
|
+
readonly required?: string | undefined;
|
|
26
|
+
readonly displayName?: string | undefined;
|
|
27
|
+
readonly compatibilityDate: "2026-06-14";
|
|
28
|
+
readonly orientation?: "vertical" | "floating" | undefined;
|
|
29
|
+
readonly placeholder?: readonly [{
|
|
30
|
+
readonly locale: "zh";
|
|
31
|
+
readonly message: string;
|
|
32
|
+
}, ...{
|
|
33
|
+
readonly locale: "en" | "ja" | "ko";
|
|
34
|
+
readonly message: string;
|
|
35
|
+
}[]] | undefined;
|
|
36
|
+
readonly readonly?: string | undefined;
|
|
37
|
+
readonly binding?: string | undefined;
|
|
38
|
+
readonly derived?: {
|
|
39
|
+
readonly mode: "formula" | "prefill";
|
|
40
|
+
readonly expression: string;
|
|
41
|
+
} | undefined;
|
|
42
|
+
readonly options: {
|
|
43
|
+
readonly kind: "remote";
|
|
44
|
+
readonly request?: string | undefined;
|
|
45
|
+
readonly options: string;
|
|
46
|
+
readonly optionValue: string;
|
|
47
|
+
readonly optionLabel: string;
|
|
48
|
+
readonly optionKeywords?: string | undefined;
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: "static";
|
|
51
|
+
readonly items: readonly {
|
|
52
|
+
readonly label: readonly [{
|
|
53
|
+
readonly locale: "zh";
|
|
54
|
+
readonly message: string;
|
|
55
|
+
}, ...{
|
|
56
|
+
readonly locale: "en" | "ja" | "ko";
|
|
57
|
+
readonly message: string;
|
|
58
|
+
}[]];
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly tooltip?: readonly [{
|
|
61
|
+
readonly locale: "zh";
|
|
62
|
+
readonly message: string;
|
|
63
|
+
}, ...{
|
|
64
|
+
readonly locale: "en" | "ja" | "ko";
|
|
65
|
+
readonly message: string;
|
|
66
|
+
}[]] | undefined;
|
|
67
|
+
readonly value: {
|
|
68
|
+
readonly value: string;
|
|
69
|
+
readonly kind: "text";
|
|
70
|
+
} | {
|
|
71
|
+
readonly value: number;
|
|
72
|
+
readonly kind: "number";
|
|
73
|
+
};
|
|
74
|
+
readonly keywords?: readonly string[] | undefined;
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
readonly validations?: readonly {
|
|
78
|
+
readonly message: readonly [{
|
|
79
|
+
readonly locale: "zh";
|
|
80
|
+
readonly message: string;
|
|
81
|
+
}, ...{
|
|
82
|
+
readonly locale: "en" | "ja" | "ko";
|
|
83
|
+
readonly message: string;
|
|
84
|
+
}[]];
|
|
85
|
+
readonly warning?: boolean | undefined;
|
|
86
|
+
readonly when: string;
|
|
87
|
+
}[] | undefined;
|
|
88
|
+
}) => any;
|
|
89
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
90
|
+
"onUpdate:modelValue"?: ((value: {
|
|
91
|
+
readonly label?: readonly [{
|
|
92
|
+
readonly locale: "zh";
|
|
93
|
+
readonly message: string;
|
|
94
|
+
}, ...{
|
|
95
|
+
readonly locale: "en" | "ja" | "ko";
|
|
96
|
+
readonly message: string;
|
|
97
|
+
}[]] | undefined;
|
|
98
|
+
readonly disabled?: string | undefined;
|
|
99
|
+
readonly type: "com.shwfed.form.field.combobox.multi";
|
|
100
|
+
readonly id: string;
|
|
101
|
+
readonly hidden?: string | undefined;
|
|
102
|
+
readonly tooltip?: readonly [{
|
|
103
|
+
readonly locale: "zh";
|
|
104
|
+
readonly message: string;
|
|
105
|
+
}, ...{
|
|
106
|
+
readonly locale: "en" | "ja" | "ko";
|
|
107
|
+
readonly message: string;
|
|
108
|
+
}[]] | undefined;
|
|
109
|
+
readonly required?: string | undefined;
|
|
110
|
+
readonly displayName?: string | undefined;
|
|
111
|
+
readonly compatibilityDate: "2026-06-14";
|
|
112
|
+
readonly orientation?: "vertical" | "floating" | undefined;
|
|
113
|
+
readonly placeholder?: readonly [{
|
|
114
|
+
readonly locale: "zh";
|
|
115
|
+
readonly message: string;
|
|
116
|
+
}, ...{
|
|
117
|
+
readonly locale: "en" | "ja" | "ko";
|
|
118
|
+
readonly message: string;
|
|
119
|
+
}[]] | undefined;
|
|
120
|
+
readonly readonly?: string | undefined;
|
|
121
|
+
readonly binding?: string | undefined;
|
|
122
|
+
readonly derived?: {
|
|
123
|
+
readonly mode: "formula" | "prefill";
|
|
124
|
+
readonly expression: string;
|
|
125
|
+
} | undefined;
|
|
126
|
+
readonly options: {
|
|
127
|
+
readonly kind: "remote";
|
|
128
|
+
readonly request?: string | undefined;
|
|
129
|
+
readonly options: string;
|
|
130
|
+
readonly optionValue: string;
|
|
131
|
+
readonly optionLabel: string;
|
|
132
|
+
readonly optionKeywords?: string | undefined;
|
|
133
|
+
} | {
|
|
134
|
+
readonly kind: "static";
|
|
135
|
+
readonly items: readonly {
|
|
136
|
+
readonly label: readonly [{
|
|
137
|
+
readonly locale: "zh";
|
|
138
|
+
readonly message: string;
|
|
139
|
+
}, ...{
|
|
140
|
+
readonly locale: "en" | "ja" | "ko";
|
|
141
|
+
readonly message: string;
|
|
142
|
+
}[]];
|
|
143
|
+
readonly id: string;
|
|
144
|
+
readonly tooltip?: readonly [{
|
|
145
|
+
readonly locale: "zh";
|
|
146
|
+
readonly message: string;
|
|
147
|
+
}, ...{
|
|
148
|
+
readonly locale: "en" | "ja" | "ko";
|
|
149
|
+
readonly message: string;
|
|
150
|
+
}[]] | undefined;
|
|
151
|
+
readonly value: {
|
|
152
|
+
readonly value: string;
|
|
153
|
+
readonly kind: "text";
|
|
154
|
+
} | {
|
|
155
|
+
readonly value: number;
|
|
156
|
+
readonly kind: "number";
|
|
157
|
+
};
|
|
158
|
+
readonly keywords?: readonly string[] | undefined;
|
|
159
|
+
}[];
|
|
160
|
+
};
|
|
161
|
+
readonly validations?: readonly {
|
|
162
|
+
readonly message: readonly [{
|
|
163
|
+
readonly locale: "zh";
|
|
164
|
+
readonly message: string;
|
|
165
|
+
}, ...{
|
|
166
|
+
readonly locale: "en" | "ja" | "ko";
|
|
167
|
+
readonly message: string;
|
|
168
|
+
}[]];
|
|
169
|
+
readonly warning?: boolean | undefined;
|
|
170
|
+
readonly when: string;
|
|
171
|
+
}[] | undefined;
|
|
172
|
+
}) => any) | undefined;
|
|
173
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
174
|
+
declare const _default: typeof __VLS_export;
|
|
175
|
+
export default _default;
|