@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-04-28/com.shwfed.form.field.switch/runtime.vue
CHANGED
|
@@ -10,14 +10,15 @@ import { Markdown } from "../../../../ui/markdown";
|
|
|
10
10
|
import { Switch } from "../../../../ui/switch";
|
|
11
11
|
import { useFieldValidation } from "../../../utils/validation";
|
|
12
12
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
13
|
-
import { useFormState } from "../../../utils/state";
|
|
13
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
14
14
|
defineOptions({ name: "ShwfedSwitchFieldRuntime" });
|
|
15
15
|
const props = defineProps({
|
|
16
16
|
fieldId: { type: String, required: true },
|
|
17
17
|
config: { type: null, required: true }
|
|
18
18
|
});
|
|
19
19
|
const { locale } = useI18n();
|
|
20
|
-
const {
|
|
20
|
+
const { getAt, setAt } = useFormState();
|
|
21
|
+
const formScope = useFormScope();
|
|
21
22
|
const inherited = injectCELContext();
|
|
22
23
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
23
24
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -33,7 +34,7 @@ const falseText = computed(
|
|
|
33
34
|
function evalBool(expression, label) {
|
|
34
35
|
if (!expression) return false;
|
|
35
36
|
try {
|
|
36
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
37
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
37
38
|
} catch (err) {
|
|
38
39
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
39
40
|
return false;
|
|
@@ -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: "ShwfedComboboxSingleFieldRuntime" });
|
|
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;
|
|
@@ -84,7 +85,7 @@ const entries = computed(
|
|
|
84
85
|
() => (props.config.items ?? []).map((item) => {
|
|
85
86
|
const labelTpl = getLocalizedText(item.label, locale.value) ?? "";
|
|
86
87
|
const tooltipTpl = item.tooltip ? getLocalizedText(item.tooltip, locale.value) : void 0;
|
|
87
|
-
const ctx = { form: state.value ?? {} };
|
|
88
|
+
const ctx = { form: formScope.state.value ?? {} };
|
|
88
89
|
return {
|
|
89
90
|
key: item.id,
|
|
90
91
|
value: item.value.value,
|
|
@@ -179,9 +180,10 @@ const anyHasTooltip = computed(
|
|
|
179
180
|
</FieldLabel>
|
|
180
181
|
<div
|
|
181
182
|
v-if="effectiveReadonly"
|
|
182
|
-
class="min-h-9 py-1.5 text-sm
|
|
183
|
+
class="min-h-9 py-1.5 text-sm"
|
|
184
|
+
:class="selectedLabel ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
183
185
|
>
|
|
184
|
-
{{ selectedLabel || "
|
|
186
|
+
{{ selectedLabel || "-" }}
|
|
185
187
|
</div>
|
|
186
188
|
<Popover
|
|
187
189
|
v-else
|
package/dist/runtime/components/form/fields/2026-05-12/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",
|
|
@@ -85,7 +85,8 @@ const { locale, t } = useI18n({
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
|
-
const {
|
|
88
|
+
const { getAt, setAt } = useFormState();
|
|
89
|
+
const formScope = useFormScope();
|
|
89
90
|
const inherited = injectCELContext();
|
|
90
91
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
91
92
|
const labelText = computed(
|
|
@@ -103,7 +104,7 @@ const templateLabelText = computed(
|
|
|
103
104
|
function evalBool(expression, label) {
|
|
104
105
|
if (!expression) return false;
|
|
105
106
|
try {
|
|
106
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
107
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
107
108
|
} catch (err) {
|
|
108
109
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
109
110
|
return false;
|
|
@@ -225,7 +226,7 @@ const templateIcon = computed(() => props.config.templateIcon ?? "fluent:arrow-d
|
|
|
225
226
|
async function onDownloadTemplate() {
|
|
226
227
|
const template = props.config.template;
|
|
227
228
|
if (!template) return;
|
|
228
|
-
const ctx = { form: state.value ?? {} };
|
|
229
|
+
const ctx = { form: formScope.state.value ?? {} };
|
|
229
230
|
const program = Effect.gen(function* () {
|
|
230
231
|
const requestBuilder = yield* $cel(template.request, ctx);
|
|
231
232
|
if (!template.download) {
|
|
@@ -25,7 +25,7 @@ import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../..
|
|
|
25
25
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
26
26
|
import { useFieldValidation } from "../../../utils/validation";
|
|
27
27
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
28
|
-
import { useFormState } from "../../../utils/state";
|
|
28
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
29
29
|
defineOptions({ name: "ShwfedComboboxSingleRemoteFieldRuntime" });
|
|
30
30
|
const props = defineProps({
|
|
31
31
|
fieldId: { type: String, required: true },
|
|
@@ -51,7 +51,8 @@ const { locale, t } = useI18n({
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
const {
|
|
54
|
+
const { getAt, setAt, setAtSilent } = useFormState();
|
|
55
|
+
const formScope = useFormScope();
|
|
55
56
|
const inherited = injectCELContext();
|
|
56
57
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
57
58
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -64,7 +65,7 @@ const tooltipText = computed(
|
|
|
64
65
|
function evalBool(expression, label) {
|
|
65
66
|
if (!expression) return false;
|
|
66
67
|
try {
|
|
67
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
68
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
68
69
|
} catch (err) {
|
|
69
70
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
70
71
|
return false;
|
|
@@ -84,7 +85,7 @@ const isReadonly = computed(
|
|
|
84
85
|
const effectiveReadonly = computed(() => isReadonly.value || props.config.derived?.mode === "formula");
|
|
85
86
|
function valueOf(option) {
|
|
86
87
|
try {
|
|
87
|
-
return Effect.runSync($cel(props.config.optionValue, { form: state.value ?? {}, option }));
|
|
88
|
+
return Effect.runSync($cel(props.config.optionValue, { form: formScope.state.value ?? {}, option }));
|
|
88
89
|
} catch (err) {
|
|
89
90
|
console.error(`[shwfed-form] failed to evaluate optionValue for ${props.fieldId}:`, err);
|
|
90
91
|
return void 0;
|
|
@@ -93,7 +94,7 @@ function valueOf(option) {
|
|
|
93
94
|
function labelOf(option) {
|
|
94
95
|
const tpl = getLocalizedText(props.config.optionLabel, locale.value) ?? "";
|
|
95
96
|
if (!tpl) return "";
|
|
96
|
-
return interpolateMarkdown(tpl, $cel, { form: state.value ?? {}, option });
|
|
97
|
+
return interpolateMarkdown(tpl, $cel, { form: formScope.state.value ?? {}, option });
|
|
97
98
|
}
|
|
98
99
|
const json = ref(null);
|
|
99
100
|
const isLoading = ref(false);
|
|
@@ -101,7 +102,7 @@ const requestSignature = computed(() => {
|
|
|
101
102
|
const expr = props.config.request;
|
|
102
103
|
if (!expr) return null;
|
|
103
104
|
try {
|
|
104
|
-
const req = asRequest(Effect.runSync($cel(expr, { form: state.value ?? {} })));
|
|
105
|
+
const req = asRequest(Effect.runSync($cel(expr, { form: formScope.state.value ?? {} })));
|
|
105
106
|
return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
|
|
106
107
|
} catch {
|
|
107
108
|
return null;
|
|
@@ -118,7 +119,7 @@ async function fetchOptions() {
|
|
|
118
119
|
const expr = props.config.request;
|
|
119
120
|
isLoading.value = true;
|
|
120
121
|
const program = Effect.gen(function* () {
|
|
121
|
-
const body = yield* fetchJsonOption(yield* $cel(expr, { form: state.value ?? {} }));
|
|
122
|
+
const body = yield* fetchJsonOption(yield* $cel(expr, { form: formScope.state.value ?? {} }));
|
|
122
123
|
return Option.getOrNull(body);
|
|
123
124
|
});
|
|
124
125
|
try {
|
|
@@ -133,7 +134,7 @@ async function fetchOptions() {
|
|
|
133
134
|
const entries = computed(() => {
|
|
134
135
|
let raw;
|
|
135
136
|
try {
|
|
136
|
-
raw = Effect.runSync($cel(props.config.options, { form: state.value ?? {}, json: json.value }));
|
|
137
|
+
raw = Effect.runSync($cel(props.config.options, { form: formScope.state.value ?? {}, json: json.value }));
|
|
137
138
|
} catch (err) {
|
|
138
139
|
console.error(`[shwfed-form] failed to evaluate options for ${props.fieldId}:`, err);
|
|
139
140
|
return [];
|
|
@@ -238,14 +239,15 @@ function handleClear() {
|
|
|
238
239
|
</FieldLabel>
|
|
239
240
|
<div
|
|
240
241
|
v-if="effectiveReadonly"
|
|
241
|
-
class="min-h-9 py-1.5 text-sm
|
|
242
|
+
class="min-h-9 py-1.5 text-sm"
|
|
243
|
+
:class="selectedLabel ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
242
244
|
>
|
|
243
245
|
<Markdown
|
|
244
246
|
v-if="selectedLabel"
|
|
245
247
|
:source="selectedLabel"
|
|
246
248
|
/>
|
|
247
249
|
<template v-else>
|
|
248
|
-
|
|
250
|
+
-
|
|
249
251
|
</template>
|
|
250
252
|
</div>
|
|
251
253
|
<Popover
|
package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue
CHANGED
|
@@ -15,7 +15,7 @@ import { Field, FieldLabel, FieldMessages } from "../../../../ui/field";
|
|
|
15
15
|
import { InputGroupButton } from "../../../../ui/input-group";
|
|
16
16
|
import { Markdown } from "../../../../ui/markdown";
|
|
17
17
|
import { useFieldValidation } from "../../../utils/validation";
|
|
18
|
-
import { SELF_BINDING, useFormState } from "../../../utils/state";
|
|
18
|
+
import { SELF_BINDING, useFormScope, useFormState } from "../../../utils/state";
|
|
19
19
|
import Row from "./row.vue";
|
|
20
20
|
defineOptions({ name: "ShwfedListFieldRuntime" });
|
|
21
21
|
const props = defineProps({
|
|
@@ -23,7 +23,8 @@ const props = defineProps({
|
|
|
23
23
|
config: { type: null, required: true }
|
|
24
24
|
});
|
|
25
25
|
const { locale } = useI18n();
|
|
26
|
-
const {
|
|
26
|
+
const { getAt, setAt } = useFormState();
|
|
27
|
+
const formScope = useFormScope();
|
|
27
28
|
const inherited = injectCELContext();
|
|
28
29
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
29
30
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -38,7 +39,7 @@ const collapsible = computed(() => !!summaryTemplate.value);
|
|
|
38
39
|
function evalBool(expression, label) {
|
|
39
40
|
if (!expression) return false;
|
|
40
41
|
try {
|
|
41
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
42
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
42
43
|
} catch (err) {
|
|
43
44
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
44
45
|
return false;
|
|
@@ -73,7 +74,7 @@ const rowSummaries = computed(() => {
|
|
|
73
74
|
(item, i) => interpolate(template, (expression) => {
|
|
74
75
|
try {
|
|
75
76
|
const out = Effect.runSync($cel(expression, {
|
|
76
|
-
form: state.value ?? {},
|
|
77
|
+
form: formScope.state.value ?? {},
|
|
77
78
|
item: item ?? {},
|
|
78
79
|
index: i
|
|
79
80
|
}));
|
|
@@ -11,7 +11,7 @@ import { Field, FieldLabel, FieldMessages } from "../../../../ui/field";
|
|
|
11
11
|
import { Markdown } from "../../../../ui/markdown";
|
|
12
12
|
import { useFieldValidation } from "../../../utils/validation";
|
|
13
13
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
14
|
-
import { useFormState } from "../../../utils/state";
|
|
14
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
15
15
|
defineOptions({ name: "ShwfedCheckboxGroupFieldRuntime" });
|
|
16
16
|
const props = defineProps({
|
|
17
17
|
fieldId: { type: String, required: true },
|
|
@@ -25,7 +25,8 @@ const { locale, t } = useI18n({
|
|
|
25
25
|
ja: { "checkbox-group-empty": "\u9078\u629E\u80A2\u306A\u3057" }
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
const {
|
|
28
|
+
const { getAt, setAt } = useFormState();
|
|
29
|
+
const formScope = useFormScope();
|
|
29
30
|
const inherited = injectCELContext();
|
|
30
31
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
31
32
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -35,7 +36,7 @@ const tooltipText = computed(
|
|
|
35
36
|
function evalBool(expression, label) {
|
|
36
37
|
if (!expression) return false;
|
|
37
38
|
try {
|
|
38
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
39
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
39
40
|
} catch (err) {
|
|
40
41
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
41
42
|
return false;
|
|
@@ -65,7 +66,7 @@ const entries = computed(
|
|
|
65
66
|
() => (props.config.items ?? []).map((item) => {
|
|
66
67
|
const labelTpl = getLocalizedText(item.label, locale.value) ?? "";
|
|
67
68
|
const tooltipTpl = item.tooltip ? getLocalizedText(item.tooltip, locale.value) : void 0;
|
|
68
|
-
const ctx = { form: state.value ?? {} };
|
|
69
|
+
const ctx = { form: formScope.state.value ?? {} };
|
|
69
70
|
return {
|
|
70
71
|
key: item.id,
|
|
71
72
|
value: item.value.value,
|
|
@@ -115,7 +116,7 @@ function toggle(entry) {
|
|
|
115
116
|
}
|
|
116
117
|
const readonlyText = computed(() => {
|
|
117
118
|
const labels = entries.value.filter(isChecked).map((e) => e.label).filter((l) => l.length > 0);
|
|
118
|
-
return labels.join("\u3001") ||
|
|
119
|
+
return labels.join("\u3001") || null;
|
|
119
120
|
});
|
|
120
121
|
</script>
|
|
121
122
|
|
|
@@ -145,9 +146,10 @@ const readonlyText = computed(() => {
|
|
|
145
146
|
</FieldLabel>
|
|
146
147
|
<div
|
|
147
148
|
v-if="effectiveReadonly"
|
|
148
|
-
class="min-h-9 py-1.5 text-sm
|
|
149
|
+
class="min-h-9 py-1.5 text-sm"
|
|
150
|
+
:class="readonlyText ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
149
151
|
>
|
|
150
|
-
{{ readonlyText }}
|
|
152
|
+
{{ readonlyText || "-" }}
|
|
151
153
|
</div>
|
|
152
154
|
<div
|
|
153
155
|
v-else-if="entries.length === 0"
|
package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue
CHANGED
|
@@ -11,7 +11,7 @@ import { Field, FieldLabel, FieldMessages } from "../../../../ui/field";
|
|
|
11
11
|
import { Markdown } from "../../../../ui/markdown";
|
|
12
12
|
import { useFieldValidation } from "../../../utils/validation";
|
|
13
13
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
14
|
-
import { useFormState } from "../../../utils/state";
|
|
14
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
15
15
|
defineOptions({ name: "ShwfedRadioGroupFieldRuntime" });
|
|
16
16
|
const props = defineProps({
|
|
17
17
|
fieldId: { type: String, required: true },
|
|
@@ -25,7 +25,8 @@ const { locale, t } = useI18n({
|
|
|
25
25
|
ja: { "radio-group-empty": "\u9078\u629E\u80A2\u306A\u3057" }
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
const {
|
|
28
|
+
const { getAt, setAt } = useFormState();
|
|
29
|
+
const formScope = useFormScope();
|
|
29
30
|
const inherited = injectCELContext();
|
|
30
31
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
31
32
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -35,7 +36,7 @@ const tooltipText = computed(
|
|
|
35
36
|
function evalBool(expression, label) {
|
|
36
37
|
if (!expression) return false;
|
|
37
38
|
try {
|
|
38
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
39
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
39
40
|
} catch (err) {
|
|
40
41
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
41
42
|
return false;
|
|
@@ -65,7 +66,7 @@ const entries = computed(
|
|
|
65
66
|
() => (props.config.items ?? []).map((item) => {
|
|
66
67
|
const labelTpl = getLocalizedText(item.label, locale.value) ?? "";
|
|
67
68
|
const tooltipTpl = item.tooltip ? getLocalizedText(item.tooltip, locale.value) : void 0;
|
|
68
|
-
const ctx = { form: state.value ?? {} };
|
|
69
|
+
const ctx = { form: formScope.state.value ?? {} };
|
|
69
70
|
return {
|
|
70
71
|
key: item.id,
|
|
71
72
|
value: item.value.value,
|
|
@@ -96,7 +97,7 @@ function onSelect(next) {
|
|
|
96
97
|
}
|
|
97
98
|
const readonlyText = computed(() => {
|
|
98
99
|
const selected = entries.value.find((e) => e.value === model.value);
|
|
99
|
-
return selected?.label ||
|
|
100
|
+
return selected?.label || null;
|
|
100
101
|
});
|
|
101
102
|
</script>
|
|
102
103
|
|
|
@@ -126,9 +127,10 @@ const readonlyText = computed(() => {
|
|
|
126
127
|
</FieldLabel>
|
|
127
128
|
<div
|
|
128
129
|
v-if="effectiveReadonly"
|
|
129
|
-
class="min-h-9 py-1.5 text-sm
|
|
130
|
+
class="min-h-9 py-1.5 text-sm"
|
|
131
|
+
:class="readonlyText ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
130
132
|
>
|
|
131
|
-
{{ readonlyText }}
|
|
133
|
+
{{ readonlyText || "-" }}
|
|
132
134
|
</div>
|
|
133
135
|
<div
|
|
134
136
|
v-else-if="entries.length === 0"
|
package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.d.vue.ts
CHANGED
|
@@ -25,6 +25,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
25
25
|
total?: string;
|
|
26
26
|
}>;
|
|
27
27
|
actions?: import("../../../../table/schema.js").TableActionsValue;
|
|
28
|
+
bottomActions?: import("../../../../table/schema.js").TableActionsValue;
|
|
28
29
|
query?: import("../../../schema.js").FormConfigValue;
|
|
29
30
|
rowKey?: string;
|
|
30
31
|
cellStyle?: string;
|
|
@@ -101,6 +102,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
101
102
|
total?: string;
|
|
102
103
|
}>;
|
|
103
104
|
actions?: import("../../../../table/schema.js").TableActionsValue;
|
|
105
|
+
bottomActions?: import("../../../../table/schema.js").TableActionsValue;
|
|
104
106
|
query?: import("../../../schema.js").FormConfigValue;
|
|
105
107
|
rowKey?: string;
|
|
106
108
|
cellStyle?: string;
|
package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
25
25
|
total?: string;
|
|
26
26
|
}>;
|
|
27
27
|
actions?: import("../../../../table/schema.js").TableActionsValue;
|
|
28
|
+
bottomActions?: import("../../../../table/schema.js").TableActionsValue;
|
|
28
29
|
query?: import("../../../schema.js").FormConfigValue;
|
|
29
30
|
rowKey?: string;
|
|
30
31
|
cellStyle?: string;
|
|
@@ -101,6 +102,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
101
102
|
total?: string;
|
|
102
103
|
}>;
|
|
103
104
|
actions?: import("../../../../table/schema.js").TableActionsValue;
|
|
105
|
+
bottomActions?: import("../../../../table/schema.js").TableActionsValue;
|
|
104
106
|
query?: import("../../../schema.js").FormConfigValue;
|
|
105
107
|
rowKey?: string;
|
|
106
108
|
cellStyle?: string;
|
package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
42
42
|
groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
|
|
43
43
|
dataSource?: import("../../../../table/schema.js").DataSourceValue;
|
|
44
44
|
actions?: import("../../../../table/schema.js").TableActionsValue;
|
|
45
|
+
bottomActions?: import("../../../../table/schema.js").TableActionsValue;
|
|
45
46
|
query?: import("../../../schema.js").FormConfigValue;
|
|
46
47
|
rowKey?: string;
|
|
47
48
|
cellStyle?: string;
|
|
@@ -78,6 +79,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
78
79
|
groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
|
|
79
80
|
dataSource?: import("../../../../table/schema.js").DataSourceValue;
|
|
80
81
|
actions?: import("../../../../table/schema.js").TableActionsValue;
|
|
82
|
+
bottomActions?: import("../../../../table/schema.js").TableActionsValue;
|
|
81
83
|
query?: import("../../../schema.js").FormConfigValue;
|
|
82
84
|
rowKey?: string;
|
|
83
85
|
cellStyle?: string;
|
package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue
CHANGED
|
@@ -15,7 +15,7 @@ import { Skeleton } from "../../../../ui/skeleton";
|
|
|
15
15
|
import { Tree as UiTree } from "../../../../ui/tree";
|
|
16
16
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
17
17
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
18
|
-
import { useFormState } from "../../../utils/state";
|
|
18
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
19
19
|
defineOptions({ name: "ShwfedTreeMultiFieldRuntime" });
|
|
20
20
|
const props = defineProps({
|
|
21
21
|
fieldId: { type: String, required: true },
|
|
@@ -29,7 +29,6 @@ const { locale, t } = useI18n({
|
|
|
29
29
|
"tree-multi-search-clear": "\u6E05\u9664\u641C\u7D22",
|
|
30
30
|
"tree-multi-load-error": "\u52A0\u8F7D\u5931\u8D25",
|
|
31
31
|
"tree-multi-empty": "\u65E0\u53EF\u9009\u9879",
|
|
32
|
-
"tree-multi-readonly-empty": "\u2014",
|
|
33
32
|
"tree-multi-readonly-separator": "\u3001"
|
|
34
33
|
},
|
|
35
34
|
en: {
|
|
@@ -37,7 +36,6 @@ const { locale, t } = useI18n({
|
|
|
37
36
|
"tree-multi-search-clear": "Clear search",
|
|
38
37
|
"tree-multi-load-error": "Failed to load",
|
|
39
38
|
"tree-multi-empty": "No options",
|
|
40
|
-
"tree-multi-readonly-empty": "\u2014",
|
|
41
39
|
"tree-multi-readonly-separator": ", "
|
|
42
40
|
},
|
|
43
41
|
ja: {
|
|
@@ -45,12 +43,12 @@ const { locale, t } = useI18n({
|
|
|
45
43
|
"tree-multi-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
|
|
46
44
|
"tree-multi-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
47
45
|
"tree-multi-empty": "\u9078\u629E\u80A2\u306A\u3057",
|
|
48
|
-
"tree-multi-readonly-empty": "\u2014",
|
|
49
46
|
"tree-multi-readonly-separator": "\u3001"
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
});
|
|
53
|
-
const {
|
|
50
|
+
const { getAt, setAt } = useFormState();
|
|
51
|
+
const formScope = useFormScope();
|
|
54
52
|
const inherited = injectCELContext();
|
|
55
53
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
56
54
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -60,7 +58,7 @@ const tooltipText = computed(
|
|
|
60
58
|
function evalBool(expression, label) {
|
|
61
59
|
if (!expression) return false;
|
|
62
60
|
try {
|
|
63
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
61
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
64
62
|
} catch (err) {
|
|
65
63
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
66
64
|
return false;
|
|
@@ -102,11 +100,11 @@ async function fetchTree() {
|
|
|
102
100
|
let jsonOpt = Option.none();
|
|
103
101
|
if (dataSource.request) {
|
|
104
102
|
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
105
|
-
form: state.value ?? {}
|
|
103
|
+
form: formScope.state.value ?? {}
|
|
106
104
|
}));
|
|
107
105
|
}
|
|
108
106
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
109
|
-
form: state.value ?? {},
|
|
107
|
+
form: formScope.state.value ?? {},
|
|
110
108
|
json: jsonOpt
|
|
111
109
|
});
|
|
112
110
|
return Array.isArray(dataRaw) ? dataRaw : [];
|
|
@@ -140,7 +138,7 @@ watch(
|
|
|
140
138
|
{ immediate: true }
|
|
141
139
|
);
|
|
142
140
|
function nodeCtx(node) {
|
|
143
|
-
return { form: state.value ?? {}, node };
|
|
141
|
+
return { form: formScope.state.value ?? {}, node };
|
|
144
142
|
}
|
|
145
143
|
function getKey(node) {
|
|
146
144
|
try {
|
|
@@ -177,7 +175,7 @@ function nodeSelectable(node, _depth) {
|
|
|
177
175
|
}
|
|
178
176
|
function safeInterpolate(tpl, node) {
|
|
179
177
|
try {
|
|
180
|
-
return interpolateMarkdown(tpl, $cel, { form: state.value ?? {}, node });
|
|
178
|
+
return interpolateMarkdown(tpl, $cel, { form: formScope.state.value ?? {}, node });
|
|
181
179
|
} catch (err) {
|
|
182
180
|
console.error(`[shwfed-form] failed to interpolate node text for ${props.fieldId}:`, err);
|
|
183
181
|
return tpl;
|
|
@@ -256,8 +254,7 @@ const filterLabelText = computed(() => {
|
|
|
256
254
|
});
|
|
257
255
|
const readonlyText = computed(() => {
|
|
258
256
|
const selected = new Set(model.value);
|
|
259
|
-
|
|
260
|
-
if (selected.size === 0) return empty;
|
|
257
|
+
if (selected.size === 0) return null;
|
|
261
258
|
const found = /* @__PURE__ */ new Map();
|
|
262
259
|
const stack = [...roots.value];
|
|
263
260
|
while (stack.length) {
|
|
@@ -268,7 +265,7 @@ const readonlyText = computed(() => {
|
|
|
268
265
|
if (kids && kids.length) stack.push(...kids);
|
|
269
266
|
}
|
|
270
267
|
const labels = model.value.map((id) => found.get(id) ?? id).filter((l) => l.length > 0);
|
|
271
|
-
return labels.length > 0 ? labels.join(t("tree-multi-readonly-separator")) :
|
|
268
|
+
return labels.length > 0 ? labels.join(t("tree-multi-readonly-separator")) : null;
|
|
272
269
|
});
|
|
273
270
|
</script>
|
|
274
271
|
|
|
@@ -295,9 +292,10 @@ const readonlyText = computed(() => {
|
|
|
295
292
|
|
|
296
293
|
<div
|
|
297
294
|
v-if="effectiveReadonly"
|
|
298
|
-
class="min-h-9 py-1.5 text-sm
|
|
295
|
+
class="min-h-9 py-1.5 text-sm"
|
|
296
|
+
:class="readonlyText ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
299
297
|
>
|
|
300
|
-
{{ readonlyText }}
|
|
298
|
+
{{ readonlyText || "-" }}
|
|
301
299
|
</div>
|
|
302
300
|
|
|
303
301
|
<template v-else>
|
package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue
CHANGED
|
@@ -12,14 +12,15 @@ import { Markdown } from "../../../../ui/markdown";
|
|
|
12
12
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
13
13
|
import { useFieldValidation } from "../../../utils/validation";
|
|
14
14
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
15
|
-
import { useFormState } from "../../../utils/state";
|
|
15
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
16
16
|
defineOptions({ name: "ShwfedMonthFieldRuntime" });
|
|
17
17
|
const props = defineProps({
|
|
18
18
|
fieldId: { type: String, required: true },
|
|
19
19
|
config: { type: null, required: true }
|
|
20
20
|
});
|
|
21
21
|
const { locale } = useI18n();
|
|
22
|
-
const {
|
|
22
|
+
const { getAt, setAt } = useFormState();
|
|
23
|
+
const formScope = useFormScope();
|
|
23
24
|
const inherited = injectCELContext();
|
|
24
25
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
25
26
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -32,7 +33,7 @@ const tooltipText = computed(
|
|
|
32
33
|
function evalBool(expression, label) {
|
|
33
34
|
if (!expression) return false;
|
|
34
35
|
try {
|
|
35
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
36
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
36
37
|
} catch (err) {
|
|
37
38
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
38
39
|
return false;
|
|
@@ -60,7 +61,7 @@ const shortcuts = computed(() => {
|
|
|
60
61
|
name: preset.label,
|
|
61
62
|
value: () => {
|
|
62
63
|
try {
|
|
63
|
-
const d = Effect.runSync($cel(preset.value, { form: state.value ?? {} }));
|
|
64
|
+
const d = Effect.runSync($cel(preset.value, { form: formScope.state.value ?? {} }));
|
|
64
65
|
return formatDate(d, resolvedValueFormat.value);
|
|
65
66
|
} catch (err) {
|
|
66
67
|
console.error(`[shwfed-form] failed to evaluate preset "${preset.value}" for ${props.fieldId}:`, err);
|
|
@@ -115,9 +116,10 @@ const model = computed({
|
|
|
115
116
|
</FieldLabel>
|
|
116
117
|
<div
|
|
117
118
|
v-if="effectiveReadonly"
|
|
118
|
-
class="min-h-9 py-1.5 text-sm
|
|
119
|
+
class="min-h-9 py-1.5 text-sm"
|
|
120
|
+
:class="model ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
119
121
|
>
|
|
120
|
-
{{ model || "
|
|
122
|
+
{{ model || "-" }}
|
|
121
123
|
</div>
|
|
122
124
|
<DatePicker
|
|
123
125
|
v-else
|
package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue
CHANGED
|
@@ -12,14 +12,15 @@ import { Markdown } from "../../../../ui/markdown";
|
|
|
12
12
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
13
13
|
import { useFieldValidation } from "../../../utils/validation";
|
|
14
14
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
15
|
-
import { useFormState } from "../../../utils/state";
|
|
15
|
+
import { useFormScope, useFormState } from "../../../utils/state";
|
|
16
16
|
defineOptions({ name: "ShwfedMonthRangeFieldRuntime" });
|
|
17
17
|
const props = defineProps({
|
|
18
18
|
fieldId: { type: String, required: true },
|
|
19
19
|
config: { type: null, required: true }
|
|
20
20
|
});
|
|
21
21
|
const { locale } = useI18n();
|
|
22
|
-
const {
|
|
22
|
+
const { getAt, setAt } = useFormState();
|
|
23
|
+
const formScope = useFormScope();
|
|
23
24
|
const inherited = injectCELContext();
|
|
24
25
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
25
26
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -35,7 +36,7 @@ const tooltipText = computed(
|
|
|
35
36
|
function evalBool(expression, label) {
|
|
36
37
|
if (!expression) return false;
|
|
37
38
|
try {
|
|
38
|
-
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
39
|
+
return Effect.runSync($cel(expression, { form: formScope.state.value ?? {} }));
|
|
39
40
|
} catch (err) {
|
|
40
41
|
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
41
42
|
return false;
|
|
@@ -63,8 +64,8 @@ const shortcuts = computed(() => {
|
|
|
63
64
|
name: preset.label,
|
|
64
65
|
value: () => {
|
|
65
66
|
try {
|
|
66
|
-
const start = Effect.runSync($cel(preset.start, { form: state.value ?? {} }));
|
|
67
|
-
const end = Effect.runSync($cel(preset.end, { form: state.value ?? {} }));
|
|
67
|
+
const start = Effect.runSync($cel(preset.start, { form: formScope.state.value ?? {} }));
|
|
68
|
+
const end = Effect.runSync($cel(preset.end, { form: formScope.state.value ?? {} }));
|
|
68
69
|
return [
|
|
69
70
|
formatDate(start, resolvedValueFormat.value),
|
|
70
71
|
formatDate(end, resolvedValueFormat.value)
|
|
@@ -113,7 +114,7 @@ const model = computed({
|
|
|
113
114
|
});
|
|
114
115
|
const readonlyText = computed(() => {
|
|
115
116
|
const v = model.value;
|
|
116
|
-
if (!v) return
|
|
117
|
+
if (!v) return null;
|
|
117
118
|
return `${v[0]} ~ ${v[1]}`;
|
|
118
119
|
});
|
|
119
120
|
</script>
|
|
@@ -145,9 +146,10 @@ const readonlyText = computed(() => {
|
|
|
145
146
|
</FieldLabel>
|
|
146
147
|
<div
|
|
147
148
|
v-if="effectiveReadonly"
|
|
148
|
-
class="min-h-9 py-1.5 text-sm
|
|
149
|
+
class="min-h-9 py-1.5 text-sm"
|
|
150
|
+
:class="readonlyText ? 'text-zinc-700' : 'font-mono text-zinc-300 select-none'"
|
|
149
151
|
>
|
|
150
|
-
{{ readonlyText }}
|
|
152
|
+
{{ readonlyText || "-" }}
|
|
151
153
|
</div>
|
|
152
154
|
<DateRangePicker
|
|
153
155
|
v-else
|