@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
|
@@ -21,7 +21,7 @@ import { Markdown } from "../../../../ui/markdown";
|
|
|
21
21
|
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
|
|
22
22
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
23
23
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
24
|
-
import { useFormState } from "../../../utils/state";
|
|
24
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
25
25
|
defineOptions({ name: "ShwfedComboboxMultiFieldRuntime" });
|
|
26
26
|
const props = defineProps({
|
|
27
27
|
fieldId: { type: String, required: true },
|
|
@@ -47,7 +47,8 @@ const { locale, t } = useI18n({
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
const {
|
|
50
|
+
const { getAt, setAt } = useFormState();
|
|
51
|
+
const formScope = useFormScope();
|
|
51
52
|
const inherited = injectCELContext();
|
|
52
53
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
53
54
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -60,7 +61,7 @@ const tooltipText = computed(
|
|
|
60
61
|
function evalBool(expression, label) {
|
|
61
62
|
if (!expression) return false;
|
|
62
63
|
try {
|
|
63
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
64
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
64
65
|
} catch (err) {
|
|
65
66
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
66
67
|
return false;
|
|
@@ -74,7 +75,7 @@ const isReadonly = computed(
|
|
|
74
75
|
const effectiveReadonly = computed(() => isReadonly.value || props.config.derived?.mode === "formula");
|
|
75
76
|
function valueOf(option) {
|
|
76
77
|
try {
|
|
77
|
-
return Effect.runSync($cel(props.config.optionValue, { form: state.value ?? {}, option }));
|
|
78
|
+
return Effect.runSync($cel(props.config.optionValue, { form: formScope.state.value ?? {}, option }));
|
|
78
79
|
} catch (err) {
|
|
79
80
|
console.error(`[shwfed-form] failed to evaluate optionValue for ${props.fieldId}:`, err);
|
|
80
81
|
return void 0;
|
|
@@ -83,12 +84,12 @@ function valueOf(option) {
|
|
|
83
84
|
function labelOf(option) {
|
|
84
85
|
const tpl = getLocalizedText(props.config.optionLabel, locale.value) ?? "";
|
|
85
86
|
if (!tpl) return "";
|
|
86
|
-
return interpolateMarkdown(tpl, $cel, { form: state.value ?? {}, option });
|
|
87
|
+
return interpolateMarkdown(tpl, $cel, { form: formScope.state.value ?? {}, option });
|
|
87
88
|
}
|
|
88
89
|
const entries = computed(() => {
|
|
89
90
|
let raw;
|
|
90
91
|
try {
|
|
91
|
-
raw = Effect.runSync($cel(props.config.options, { form: state.value ?? {} }));
|
|
92
|
+
raw = Effect.runSync($cel(props.config.options, { form: formScope.state.value ?? {} }));
|
|
92
93
|
} catch (err) {
|
|
93
94
|
console.error(`[shwfed-form] failed to evaluate options for ${props.fieldId}:`, err);
|
|
94
95
|
return [];
|
|
@@ -187,9 +188,10 @@ function handleClear() {
|
|
|
187
188
|
</FieldLabel>
|
|
188
189
|
<div
|
|
189
190
|
v-if="effectiveReadonly"
|
|
190
|
-
class="min-h-9 py-1.5 text-sm
|
|
191
|
+
class="min-h-9 py-1.5 text-sm"
|
|
192
|
+
:class="triggerLabel ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
191
193
|
>
|
|
192
|
-
{{ triggerLabel || "
|
|
194
|
+
{{ triggerLabel || "-" }}
|
|
193
195
|
</div>
|
|
194
196
|
<Popover
|
|
195
197
|
v-else
|
|
@@ -17,7 +17,7 @@ import { Tree as UiTree } from "../../../../ui/tree";
|
|
|
17
17
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
18
18
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
19
19
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
20
|
-
import { useFormState } from "../../../utils/state";
|
|
20
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
21
21
|
import {
|
|
22
22
|
findWrappedPath,
|
|
23
23
|
getWrappedChildren,
|
|
@@ -37,8 +37,7 @@ const { locale, t } = useI18n({
|
|
|
37
37
|
"tree-combobox-multi-search-clear": "\u6E05\u9664\u641C\u7D22",
|
|
38
38
|
"tree-combobox-multi-empty": "\u65E0\u53EF\u9009\u9879",
|
|
39
39
|
"tree-combobox-multi-load-error": "\u52A0\u8F7D\u5931\u8D25",
|
|
40
|
-
"tree-combobox-multi-retry": "\u91CD\u8BD5"
|
|
41
|
-
"tree-combobox-multi-readonly-empty": "\u2014"
|
|
40
|
+
"tree-combobox-multi-retry": "\u91CD\u8BD5"
|
|
42
41
|
},
|
|
43
42
|
en: {
|
|
44
43
|
"tree-combobox-multi-placeholder": "Select\u2026",
|
|
@@ -46,8 +45,7 @@ const { locale, t } = useI18n({
|
|
|
46
45
|
"tree-combobox-multi-search-clear": "Clear search",
|
|
47
46
|
"tree-combobox-multi-empty": "No options",
|
|
48
47
|
"tree-combobox-multi-load-error": "Failed to load",
|
|
49
|
-
"tree-combobox-multi-retry": "Retry"
|
|
50
|
-
"tree-combobox-multi-readonly-empty": "\u2014"
|
|
48
|
+
"tree-combobox-multi-retry": "Retry"
|
|
51
49
|
},
|
|
52
50
|
ja: {
|
|
53
51
|
"tree-combobox-multi-placeholder": "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
@@ -55,12 +53,12 @@ const { locale, t } = useI18n({
|
|
|
55
53
|
"tree-combobox-multi-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
|
|
56
54
|
"tree-combobox-multi-empty": "\u9078\u629E\u80A2\u306A\u3057",
|
|
57
55
|
"tree-combobox-multi-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
58
|
-
"tree-combobox-multi-retry": "\u518D\u8A66\u884C"
|
|
59
|
-
"tree-combobox-multi-readonly-empty": "\u2014"
|
|
56
|
+
"tree-combobox-multi-retry": "\u518D\u8A66\u884C"
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
});
|
|
63
|
-
const {
|
|
60
|
+
const { getAt, setAt } = useFormState();
|
|
61
|
+
const formScope = useFormScope();
|
|
64
62
|
const inherited = injectCELContext();
|
|
65
63
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
66
64
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -73,7 +71,7 @@ const placeholderText = computed(
|
|
|
73
71
|
function evalBool(expression, label) {
|
|
74
72
|
if (!expression) return false;
|
|
75
73
|
try {
|
|
76
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
74
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
77
75
|
} catch (err) {
|
|
78
76
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
79
77
|
return false;
|
|
@@ -103,7 +101,7 @@ const model = computed({
|
|
|
103
101
|
}
|
|
104
102
|
});
|
|
105
103
|
function nodeCtx(raw) {
|
|
106
|
-
return { form: state.value ?? {}, node: raw };
|
|
104
|
+
return { form: formScope.state.value ?? {}, node: raw };
|
|
107
105
|
}
|
|
108
106
|
function nodeKey(raw) {
|
|
109
107
|
try {
|
|
@@ -165,11 +163,11 @@ async function fetchTree() {
|
|
|
165
163
|
let jsonOpt = Option.none();
|
|
166
164
|
if (dataSource.request) {
|
|
167
165
|
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
168
|
-
form: state.value ?? {}
|
|
166
|
+
form: formScope.state.value ?? {}
|
|
169
167
|
}));
|
|
170
168
|
}
|
|
171
169
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
172
|
-
form: state.value ?? {},
|
|
170
|
+
form: formScope.state.value ?? {},
|
|
173
171
|
json: jsonOpt
|
|
174
172
|
});
|
|
175
173
|
return Array.isArray(dataRaw) ? dataRaw : [];
|
|
@@ -302,9 +300,10 @@ const hoveredTooltip = computed(() => {
|
|
|
302
300
|
|
|
303
301
|
<div
|
|
304
302
|
v-if="effectiveReadonly"
|
|
305
|
-
class="min-h-9 py-1.5 text-sm
|
|
303
|
+
class="min-h-9 py-1.5 text-sm"
|
|
304
|
+
:class="triggerLabel ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
306
305
|
>
|
|
307
|
-
{{ triggerLabel ||
|
|
306
|
+
{{ triggerLabel || "-" }}
|
|
308
307
|
</div>
|
|
309
308
|
|
|
310
309
|
<Popover
|
|
@@ -17,7 +17,7 @@ import { Tree as UiTree } from "../../../../ui/tree";
|
|
|
17
17
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
18
18
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
19
19
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
20
|
-
import { useFormState } from "../../../utils/state";
|
|
20
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
21
21
|
import {
|
|
22
22
|
findWrappedPath,
|
|
23
23
|
getWrappedChildren,
|
|
@@ -37,8 +37,7 @@ const { locale, t } = useI18n({
|
|
|
37
37
|
"tree-combobox-single-search-clear": "\u6E05\u9664\u641C\u7D22",
|
|
38
38
|
"tree-combobox-single-empty": "\u65E0\u53EF\u9009\u9879",
|
|
39
39
|
"tree-combobox-single-load-error": "\u52A0\u8F7D\u5931\u8D25",
|
|
40
|
-
"tree-combobox-single-retry": "\u91CD\u8BD5"
|
|
41
|
-
"tree-combobox-single-readonly-empty": "\u2014"
|
|
40
|
+
"tree-combobox-single-retry": "\u91CD\u8BD5"
|
|
42
41
|
},
|
|
43
42
|
en: {
|
|
44
43
|
"tree-combobox-single-placeholder": "Select\u2026",
|
|
@@ -46,8 +45,7 @@ const { locale, t } = useI18n({
|
|
|
46
45
|
"tree-combobox-single-search-clear": "Clear search",
|
|
47
46
|
"tree-combobox-single-empty": "No options",
|
|
48
47
|
"tree-combobox-single-load-error": "Failed to load",
|
|
49
|
-
"tree-combobox-single-retry": "Retry"
|
|
50
|
-
"tree-combobox-single-readonly-empty": "\u2014"
|
|
48
|
+
"tree-combobox-single-retry": "Retry"
|
|
51
49
|
},
|
|
52
50
|
ja: {
|
|
53
51
|
"tree-combobox-single-placeholder": "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
@@ -55,12 +53,12 @@ const { locale, t } = useI18n({
|
|
|
55
53
|
"tree-combobox-single-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
|
|
56
54
|
"tree-combobox-single-empty": "\u9078\u629E\u80A2\u306A\u3057",
|
|
57
55
|
"tree-combobox-single-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
58
|
-
"tree-combobox-single-retry": "\u518D\u8A66\u884C"
|
|
59
|
-
"tree-combobox-single-readonly-empty": "\u2014"
|
|
56
|
+
"tree-combobox-single-retry": "\u518D\u8A66\u884C"
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
});
|
|
63
|
-
const {
|
|
60
|
+
const { getAt, setAt } = useFormState();
|
|
61
|
+
const formScope = useFormScope();
|
|
64
62
|
const inherited = injectCELContext();
|
|
65
63
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
66
64
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -73,7 +71,7 @@ const placeholderText = computed(
|
|
|
73
71
|
function evalBool(expression, label) {
|
|
74
72
|
if (!expression) return false;
|
|
75
73
|
try {
|
|
76
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
74
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
77
75
|
} catch (err) {
|
|
78
76
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
79
77
|
return false;
|
|
@@ -104,7 +102,7 @@ const model = computed({
|
|
|
104
102
|
}
|
|
105
103
|
});
|
|
106
104
|
function nodeCtx(raw) {
|
|
107
|
-
return { form: state.value ?? {}, node: raw };
|
|
105
|
+
return { form: formScope.state.value ?? {}, node: raw };
|
|
108
106
|
}
|
|
109
107
|
function nodeKey(raw) {
|
|
110
108
|
try {
|
|
@@ -166,11 +164,11 @@ async function fetchTree() {
|
|
|
166
164
|
let jsonOpt = Option.none();
|
|
167
165
|
if (dataSource.request) {
|
|
168
166
|
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
169
|
-
form: state.value ?? {}
|
|
167
|
+
form: formScope.state.value ?? {}
|
|
170
168
|
}));
|
|
171
169
|
}
|
|
172
170
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
173
|
-
form: state.value ?? {},
|
|
171
|
+
form: formScope.state.value ?? {},
|
|
174
172
|
json: jsonOpt
|
|
175
173
|
});
|
|
176
174
|
return Array.isArray(dataRaw) ? dataRaw : [];
|
|
@@ -298,9 +296,10 @@ const hoveredTooltip = computed(() => {
|
|
|
298
296
|
|
|
299
297
|
<div
|
|
300
298
|
v-if="effectiveReadonly"
|
|
301
|
-
class="min-h-9 py-1.5 text-sm
|
|
299
|
+
class="min-h-9 py-1.5 text-sm"
|
|
300
|
+
:class="triggerLabel ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
302
301
|
>
|
|
303
|
-
{{ triggerLabel ||
|
|
302
|
+
{{ triggerLabel || "-" }}
|
|
304
303
|
</div>
|
|
305
304
|
|
|
306
305
|
<Popover
|
|
@@ -25,7 +25,7 @@ import { Markdown } from "../../../../ui/markdown";
|
|
|
25
25
|
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
|
|
26
26
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
27
27
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
28
|
-
import { useFormState } from "../../../utils/state";
|
|
28
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
29
29
|
import { useFieldValidation } from "../../../utils/validation";
|
|
30
30
|
defineOptions({ name: "ShwfedComboboxMultiFieldRuntime" });
|
|
31
31
|
const props = defineProps({
|
|
@@ -55,7 +55,8 @@ const { locale, t } = useI18n({
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
-
const {
|
|
58
|
+
const { getAt, setAt } = useFormState();
|
|
59
|
+
const formScope = useFormScope();
|
|
59
60
|
const inherited = injectCELContext();
|
|
60
61
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
61
62
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -68,7 +69,7 @@ const tooltipText = computed(
|
|
|
68
69
|
function evalBool(expression, label) {
|
|
69
70
|
if (!expression) return false;
|
|
70
71
|
try {
|
|
71
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
72
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
72
73
|
} catch (err) {
|
|
73
74
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
74
75
|
return false;
|
|
@@ -103,7 +104,7 @@ const requestSignature = computed(() => {
|
|
|
103
104
|
const expr = opts.request;
|
|
104
105
|
if (!expr) return null;
|
|
105
106
|
try {
|
|
106
|
-
const req = asRequest(Effect.runSync($cel(expr, { form: state.value ?? {} })));
|
|
107
|
+
const req = asRequest(Effect.runSync($cel(expr, { form: formScope.state.value ?? {} })));
|
|
107
108
|
return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
|
|
108
109
|
} catch {
|
|
109
110
|
return null;
|
|
@@ -126,7 +127,7 @@ async function fetchOptions() {
|
|
|
126
127
|
}
|
|
127
128
|
isLoading.value = true;
|
|
128
129
|
const program = Effect.gen(function* () {
|
|
129
|
-
const body = yield* fetchJsonOption(yield* $cel(expr, { form: state.value ?? {} }));
|
|
130
|
+
const body = yield* fetchJsonOption(yield* $cel(expr, { form: formScope.state.value ?? {} }));
|
|
130
131
|
return Option.getOrNull(body);
|
|
131
132
|
});
|
|
132
133
|
try {
|
|
@@ -142,7 +143,7 @@ function remoteValueOf(option) {
|
|
|
142
143
|
const opts = props.config.options;
|
|
143
144
|
if (opts.kind !== "remote") return void 0;
|
|
144
145
|
try {
|
|
145
|
-
return Effect.runSync($cel(opts.optionValue, { form: state.value ?? {}, option }));
|
|
146
|
+
return Effect.runSync($cel(opts.optionValue, { form: formScope.state.value ?? {}, option }));
|
|
146
147
|
} catch (err) {
|
|
147
148
|
console.error(`[shwfed-form] failed to evaluate optionValue for ${props.fieldId}:`, err);
|
|
148
149
|
return void 0;
|
|
@@ -153,13 +154,13 @@ function remoteLabelOf(option) {
|
|
|
153
154
|
if (opts.kind !== "remote") return "";
|
|
154
155
|
const tpl = getLocalizedText(opts.optionLabel, locale.value) ?? "";
|
|
155
156
|
if (!tpl) return "";
|
|
156
|
-
return interpolateMarkdown(tpl, $cel, { form: state.value ?? {}, option });
|
|
157
|
+
return interpolateMarkdown(tpl, $cel, { form: formScope.state.value ?? {}, option });
|
|
157
158
|
}
|
|
158
159
|
function remoteKeywordsOf(option) {
|
|
159
160
|
const opts = props.config.options;
|
|
160
161
|
if (opts.kind !== "remote" || !opts.optionKeywords) return void 0;
|
|
161
162
|
try {
|
|
162
|
-
const raw = Effect.runSync($cel(opts.optionKeywords, { form: state.value ?? {}, option }));
|
|
163
|
+
const raw = Effect.runSync($cel(opts.optionKeywords, { form: formScope.state.value ?? {}, option }));
|
|
163
164
|
if (!Array.isArray(raw)) return void 0;
|
|
164
165
|
const joined = raw.map((k) => k == null ? "" : String(k)).filter(Boolean).join(" ");
|
|
165
166
|
return joined.length > 0 ? joined : void 0;
|
|
@@ -173,7 +174,7 @@ const entries = computed(() => {
|
|
|
173
174
|
if (opts.kind === "static") {
|
|
174
175
|
return (opts.items ?? []).map((item) => {
|
|
175
176
|
const labelTpl = getLocalizedText(item.label, locale.value) ?? "";
|
|
176
|
-
const ctx = { form: state.value ?? {} };
|
|
177
|
+
const ctx = { form: formScope.state.value ?? {} };
|
|
177
178
|
const kw = (item.keywords ?? []).filter(Boolean).join(" ");
|
|
178
179
|
return {
|
|
179
180
|
key: item.id,
|
|
@@ -186,7 +187,7 @@ const entries = computed(() => {
|
|
|
186
187
|
}
|
|
187
188
|
let raw;
|
|
188
189
|
try {
|
|
189
|
-
raw = Effect.runSync($cel(opts.options, { form: state.value ?? {}, json: json.value }));
|
|
190
|
+
raw = Effect.runSync($cel(opts.options, { form: formScope.state.value ?? {}, json: json.value }));
|
|
190
191
|
} catch (err) {
|
|
191
192
|
console.error(`[shwfed-form] failed to evaluate options for ${props.fieldId}:`, err);
|
|
192
193
|
return [];
|
|
@@ -306,9 +307,10 @@ function handleClear() {
|
|
|
306
307
|
</FieldLabel>
|
|
307
308
|
<div
|
|
308
309
|
v-if="effectiveReadonly"
|
|
309
|
-
class="min-h-9 py-1.5 text-sm
|
|
310
|
+
class="min-h-9 py-1.5 text-sm"
|
|
311
|
+
:class="triggerLabel ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
310
312
|
>
|
|
311
|
-
{{ triggerLabel || "
|
|
313
|
+
{{ triggerLabel || "-" }}
|
|
312
314
|
</div>
|
|
313
315
|
<Popover
|
|
314
316
|
v-else
|
|
@@ -25,7 +25,7 @@ import { Markdown } from "../../../../ui/markdown";
|
|
|
25
25
|
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
|
|
26
26
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
27
27
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
28
|
-
import { useFormState } from "../../../utils/state";
|
|
28
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
29
29
|
import { useFieldValidation } from "../../../utils/validation";
|
|
30
30
|
defineOptions({ name: "ShwfedComboboxSingleFieldRuntime" });
|
|
31
31
|
const props = defineProps({
|
|
@@ -55,7 +55,8 @@ const { locale, t } = useI18n({
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
-
const {
|
|
58
|
+
const { getAt, setAt, setAtSilent } = useFormState();
|
|
59
|
+
const formScope = useFormScope();
|
|
59
60
|
const inherited = injectCELContext();
|
|
60
61
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
61
62
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -68,7 +69,7 @@ const tooltipText = computed(
|
|
|
68
69
|
function evalBool(expression, label) {
|
|
69
70
|
if (!expression) return false;
|
|
70
71
|
try {
|
|
71
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
72
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
72
73
|
} catch (err) {
|
|
73
74
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
74
75
|
return false;
|
|
@@ -103,7 +104,7 @@ const requestSignature = computed(() => {
|
|
|
103
104
|
const expr = opts.request;
|
|
104
105
|
if (!expr) return null;
|
|
105
106
|
try {
|
|
106
|
-
const req = asRequest(Effect.runSync($cel(expr, { form: state.value ?? {} })));
|
|
107
|
+
const req = asRequest(Effect.runSync($cel(expr, { form: formScope.state.value ?? {} })));
|
|
107
108
|
return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
|
|
108
109
|
} catch {
|
|
109
110
|
return null;
|
|
@@ -126,7 +127,7 @@ async function fetchOptions() {
|
|
|
126
127
|
}
|
|
127
128
|
isLoading.value = true;
|
|
128
129
|
const program = Effect.gen(function* () {
|
|
129
|
-
const body = yield* fetchJsonOption(yield* $cel(expr, { form: state.value ?? {} }));
|
|
130
|
+
const body = yield* fetchJsonOption(yield* $cel(expr, { form: formScope.state.value ?? {} }));
|
|
130
131
|
return Option.getOrNull(body);
|
|
131
132
|
});
|
|
132
133
|
try {
|
|
@@ -142,7 +143,7 @@ function remoteValueOf(option) {
|
|
|
142
143
|
const opts = props.config.options;
|
|
143
144
|
if (opts.kind !== "remote") return void 0;
|
|
144
145
|
try {
|
|
145
|
-
return Effect.runSync($cel(opts.optionValue, { form: state.value ?? {}, option }));
|
|
146
|
+
return Effect.runSync($cel(opts.optionValue, { form: formScope.state.value ?? {}, option }));
|
|
146
147
|
} catch (err) {
|
|
147
148
|
console.error(`[shwfed-form] failed to evaluate optionValue for ${props.fieldId}:`, err);
|
|
148
149
|
return void 0;
|
|
@@ -153,13 +154,13 @@ function remoteLabelOf(option) {
|
|
|
153
154
|
if (opts.kind !== "remote") return "";
|
|
154
155
|
const tpl = getLocalizedText(opts.optionLabel, locale.value) ?? "";
|
|
155
156
|
if (!tpl) return "";
|
|
156
|
-
return interpolateMarkdown(tpl, $cel, { form: state.value ?? {}, option });
|
|
157
|
+
return interpolateMarkdown(tpl, $cel, { form: formScope.state.value ?? {}, option });
|
|
157
158
|
}
|
|
158
159
|
function remoteKeywordsOf(option) {
|
|
159
160
|
const opts = props.config.options;
|
|
160
161
|
if (opts.kind !== "remote" || !opts.optionKeywords) return void 0;
|
|
161
162
|
try {
|
|
162
|
-
const raw = Effect.runSync($cel(opts.optionKeywords, { form: state.value ?? {}, option }));
|
|
163
|
+
const raw = Effect.runSync($cel(opts.optionKeywords, { form: formScope.state.value ?? {}, option }));
|
|
163
164
|
if (!Array.isArray(raw)) return void 0;
|
|
164
165
|
const joined = raw.map((k) => k == null ? "" : String(k)).filter(Boolean).join(" ");
|
|
165
166
|
return joined.length > 0 ? joined : void 0;
|
|
@@ -174,7 +175,7 @@ const entries = computed(() => {
|
|
|
174
175
|
return (opts.items ?? []).map((item) => {
|
|
175
176
|
const labelTpl = getLocalizedText(item.label, locale.value) ?? "";
|
|
176
177
|
const tooltipTpl = item.tooltip ? getLocalizedText(item.tooltip, locale.value) : void 0;
|
|
177
|
-
const ctx = { form: state.value ?? {} };
|
|
178
|
+
const ctx = { form: formScope.state.value ?? {} };
|
|
178
179
|
const kw = (item.keywords ?? []).filter(Boolean).join(" ");
|
|
179
180
|
return {
|
|
180
181
|
key: item.id,
|
|
@@ -188,7 +189,7 @@ const entries = computed(() => {
|
|
|
188
189
|
}
|
|
189
190
|
let raw;
|
|
190
191
|
try {
|
|
191
|
-
raw = Effect.runSync($cel(opts.options, { form: state.value ?? {}, json: json.value }));
|
|
192
|
+
raw = Effect.runSync($cel(opts.options, { form: formScope.state.value ?? {}, json: json.value }));
|
|
192
193
|
} catch (err) {
|
|
193
194
|
console.error(`[shwfed-form] failed to evaluate options for ${props.fieldId}:`, err);
|
|
194
195
|
return [];
|
|
@@ -311,14 +312,15 @@ const anyHasTooltip = computed(
|
|
|
311
312
|
</FieldLabel>
|
|
312
313
|
<div
|
|
313
314
|
v-if="effectiveReadonly"
|
|
314
|
-
class="min-h-9 py-1.5 text-sm
|
|
315
|
+
class="min-h-9 py-1.5 text-sm"
|
|
316
|
+
:class="selectedLabel ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
315
317
|
>
|
|
316
318
|
<Markdown
|
|
317
319
|
v-if="selectedLabel"
|
|
318
320
|
:source="selectedLabel"
|
|
319
321
|
/>
|
|
320
322
|
<template v-else>
|
|
321
|
-
|
|
323
|
+
-
|
|
322
324
|
</template>
|
|
323
325
|
</div>
|
|
324
326
|
<Popover
|
|
@@ -18,7 +18,7 @@ import { Tree as UiTree } from "../../../../ui/tree";
|
|
|
18
18
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
19
19
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
20
20
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
21
|
-
import { useFormState } from "../../../utils/state";
|
|
21
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
22
22
|
import { useFieldValidation } from "../../../utils/validation";
|
|
23
23
|
import {
|
|
24
24
|
findWrappedPath,
|
|
@@ -39,8 +39,7 @@ const { locale, t } = useI18n({
|
|
|
39
39
|
"tree-combobox-multi-search-clear": "\u6E05\u9664\u641C\u7D22",
|
|
40
40
|
"tree-combobox-multi-empty": "\u65E0\u53EF\u9009\u9879",
|
|
41
41
|
"tree-combobox-multi-load-error": "\u52A0\u8F7D\u5931\u8D25",
|
|
42
|
-
"tree-combobox-multi-retry": "\u91CD\u8BD5"
|
|
43
|
-
"tree-combobox-multi-readonly-empty": "\u2014"
|
|
42
|
+
"tree-combobox-multi-retry": "\u91CD\u8BD5"
|
|
44
43
|
},
|
|
45
44
|
en: {
|
|
46
45
|
"tree-combobox-multi-placeholder": "Select\u2026",
|
|
@@ -48,8 +47,7 @@ const { locale, t } = useI18n({
|
|
|
48
47
|
"tree-combobox-multi-search-clear": "Clear search",
|
|
49
48
|
"tree-combobox-multi-empty": "No options",
|
|
50
49
|
"tree-combobox-multi-load-error": "Failed to load",
|
|
51
|
-
"tree-combobox-multi-retry": "Retry"
|
|
52
|
-
"tree-combobox-multi-readonly-empty": "\u2014"
|
|
50
|
+
"tree-combobox-multi-retry": "Retry"
|
|
53
51
|
},
|
|
54
52
|
ja: {
|
|
55
53
|
"tree-combobox-multi-placeholder": "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
@@ -57,12 +55,12 @@ const { locale, t } = useI18n({
|
|
|
57
55
|
"tree-combobox-multi-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
|
|
58
56
|
"tree-combobox-multi-empty": "\u9078\u629E\u80A2\u306A\u3057",
|
|
59
57
|
"tree-combobox-multi-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
60
|
-
"tree-combobox-multi-retry": "\u518D\u8A66\u884C"
|
|
61
|
-
"tree-combobox-multi-readonly-empty": "\u2014"
|
|
58
|
+
"tree-combobox-multi-retry": "\u518D\u8A66\u884C"
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
});
|
|
65
|
-
const {
|
|
62
|
+
const { getAt, setAt } = useFormState();
|
|
63
|
+
const formScope = useFormScope();
|
|
66
64
|
const inherited = injectCELContext();
|
|
67
65
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
68
66
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -75,7 +73,7 @@ const placeholderText = computed(
|
|
|
75
73
|
function evalBool(expression, label) {
|
|
76
74
|
if (!expression) return false;
|
|
77
75
|
try {
|
|
78
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
76
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
79
77
|
} catch (err) {
|
|
80
78
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
81
79
|
return false;
|
|
@@ -111,7 +109,7 @@ const model = computed({
|
|
|
111
109
|
}
|
|
112
110
|
});
|
|
113
111
|
function nodeCtx(raw) {
|
|
114
|
-
return { form: state.value ?? {}, node: raw };
|
|
112
|
+
return { form: formScope.state.value ?? {}, node: raw };
|
|
115
113
|
}
|
|
116
114
|
function nodeKey(raw) {
|
|
117
115
|
try {
|
|
@@ -184,11 +182,11 @@ async function fetchTree() {
|
|
|
184
182
|
let jsonOpt = Option.none();
|
|
185
183
|
if (dataSource.request) {
|
|
186
184
|
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
187
|
-
form: state.value ?? {}
|
|
185
|
+
form: formScope.state.value ?? {}
|
|
188
186
|
}));
|
|
189
187
|
}
|
|
190
188
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
191
|
-
form: state.value ?? {},
|
|
189
|
+
form: formScope.state.value ?? {},
|
|
192
190
|
json: jsonOpt
|
|
193
191
|
});
|
|
194
192
|
return Array.isArray(dataRaw) ? dataRaw : [];
|
|
@@ -365,9 +363,10 @@ const hoveredTooltip = computed(() => {
|
|
|
365
363
|
|
|
366
364
|
<div
|
|
367
365
|
v-if="effectiveReadonly"
|
|
368
|
-
class="min-h-9 py-1.5 text-sm
|
|
366
|
+
class="min-h-9 py-1.5 text-sm"
|
|
367
|
+
:class="triggerLabel ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
369
368
|
>
|
|
370
|
-
{{ triggerLabel ||
|
|
369
|
+
{{ triggerLabel || "-" }}
|
|
371
370
|
</div>
|
|
372
371
|
|
|
373
372
|
<Popover
|
|
@@ -18,7 +18,7 @@ import { Tree as UiTree } from "../../../../ui/tree";
|
|
|
18
18
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
19
19
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
20
20
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
21
|
-
import { useFormState } from "../../../utils/state";
|
|
21
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
22
22
|
import { useFieldValidation } from "../../../utils/validation";
|
|
23
23
|
import {
|
|
24
24
|
findWrappedPath,
|
|
@@ -39,8 +39,7 @@ const { locale, t } = useI18n({
|
|
|
39
39
|
"tree-combobox-single-search-clear": "\u6E05\u9664\u641C\u7D22",
|
|
40
40
|
"tree-combobox-single-empty": "\u65E0\u53EF\u9009\u9879",
|
|
41
41
|
"tree-combobox-single-load-error": "\u52A0\u8F7D\u5931\u8D25",
|
|
42
|
-
"tree-combobox-single-retry": "\u91CD\u8BD5"
|
|
43
|
-
"tree-combobox-single-readonly-empty": "\u2014"
|
|
42
|
+
"tree-combobox-single-retry": "\u91CD\u8BD5"
|
|
44
43
|
},
|
|
45
44
|
en: {
|
|
46
45
|
"tree-combobox-single-placeholder": "Select\u2026",
|
|
@@ -48,8 +47,7 @@ const { locale, t } = useI18n({
|
|
|
48
47
|
"tree-combobox-single-search-clear": "Clear search",
|
|
49
48
|
"tree-combobox-single-empty": "No options",
|
|
50
49
|
"tree-combobox-single-load-error": "Failed to load",
|
|
51
|
-
"tree-combobox-single-retry": "Retry"
|
|
52
|
-
"tree-combobox-single-readonly-empty": "\u2014"
|
|
50
|
+
"tree-combobox-single-retry": "Retry"
|
|
53
51
|
},
|
|
54
52
|
ja: {
|
|
55
53
|
"tree-combobox-single-placeholder": "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
@@ -57,12 +55,12 @@ const { locale, t } = useI18n({
|
|
|
57
55
|
"tree-combobox-single-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
|
|
58
56
|
"tree-combobox-single-empty": "\u9078\u629E\u80A2\u306A\u3057",
|
|
59
57
|
"tree-combobox-single-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
60
|
-
"tree-combobox-single-retry": "\u518D\u8A66\u884C"
|
|
61
|
-
"tree-combobox-single-readonly-empty": "\u2014"
|
|
58
|
+
"tree-combobox-single-retry": "\u518D\u8A66\u884C"
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
});
|
|
65
|
-
const {
|
|
62
|
+
const { getAt, setAt } = useFormState();
|
|
63
|
+
const formScope = useFormScope();
|
|
66
64
|
const inherited = injectCELContext();
|
|
67
65
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
68
66
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -75,7 +73,7 @@ const placeholderText = computed(
|
|
|
75
73
|
function evalBool(expression, label) {
|
|
76
74
|
if (!expression) return false;
|
|
77
75
|
try {
|
|
78
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
76
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
79
77
|
} catch (err) {
|
|
80
78
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
81
79
|
return false;
|
|
@@ -112,7 +110,7 @@ const model = computed({
|
|
|
112
110
|
}
|
|
113
111
|
});
|
|
114
112
|
function nodeCtx(raw) {
|
|
115
|
-
return { form: state.value ?? {}, node: raw };
|
|
113
|
+
return { form: formScope.state.value ?? {}, node: raw };
|
|
116
114
|
}
|
|
117
115
|
function nodeKey(raw) {
|
|
118
116
|
try {
|
|
@@ -185,11 +183,11 @@ async function fetchTree() {
|
|
|
185
183
|
let jsonOpt = Option.none();
|
|
186
184
|
if (dataSource.request) {
|
|
187
185
|
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
188
|
-
form: state.value ?? {}
|
|
186
|
+
form: formScope.state.value ?? {}
|
|
189
187
|
}));
|
|
190
188
|
}
|
|
191
189
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
192
|
-
form: state.value ?? {},
|
|
190
|
+
form: formScope.state.value ?? {},
|
|
193
191
|
json: jsonOpt
|
|
194
192
|
});
|
|
195
193
|
return Array.isArray(dataRaw) ? dataRaw : [];
|
|
@@ -353,9 +351,10 @@ const hoveredTooltip = computed(() => {
|
|
|
353
351
|
|
|
354
352
|
<div
|
|
355
353
|
v-if="effectiveReadonly"
|
|
356
|
-
class="min-h-9 py-1.5 text-sm
|
|
354
|
+
class="min-h-9 py-1.5 text-sm"
|
|
355
|
+
:class="triggerLabel ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
357
356
|
>
|
|
358
|
-
{{ triggerLabel ||
|
|
357
|
+
{{ triggerLabel || "-" }}
|
|
359
358
|
</div>
|
|
360
359
|
|
|
361
360
|
<Popover
|