@shwfed/config 2.7.5 → 2.7.7
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 +73 -21
- package/dist/module.json +1 -1
- package/dist/preview/assets/badge-B0tiCpa_.js +1 -0
- package/dist/preview/assets/config-BG9TRQcv.js +1 -0
- package/dist/preview/assets/{config-ulTPyAGw.js → config-Bfb2sH6S.js} +1 -1
- package/dist/preview/assets/config-C-XJ-8Rs.js +1 -0
- package/dist/preview/assets/{config-ISM4vT-S.js → config-CGvnv-5x.js} +1 -1
- package/dist/preview/assets/config-DDPihojt.js +1 -0
- package/dist/preview/assets/config-Dafqx9xC.js +1 -0
- package/dist/preview/assets/{config-DBviu6U0.js → config-DqMRy1WL.js} +1 -1
- package/dist/preview/assets/{config-CtPQb6dK.js → config-GCvXe12z.js} +1 -1
- package/dist/preview/assets/{config-CYixJlBY.js → config-jDPbLgBr.js} +1 -1
- package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-DBXfCj4Q.js +1 -0
- package/dist/preview/assets/{index-CqWUukUH.css → index-B0PL01fm.css} +1 -1
- package/dist/preview/assets/index-CHzOsSTW.js +680 -0
- package/dist/preview/assets/index-CSfKAdi7.js +1 -0
- package/dist/preview/assets/{index-D6fhWrrp.js → index-D7jDE3kp.js} +1 -1
- package/dist/preview/assets/item-DV-Garrg.js +1 -0
- package/dist/preview/assets/runtime-BovPWken.js +1 -0
- package/dist/preview/assets/runtime-BxBBFFHA.js +1 -0
- package/dist/preview/assets/{runtime-B7NcvR9y.js → runtime-CwmJ9MLQ.js} +1 -1
- package/dist/preview/assets/runtime-Cyjx6haa.js +1 -0
- package/dist/preview/assets/runtime-D-LBi56N.js +1 -0
- package/dist/preview/assets/{runtime-BqlrYWt_.js → runtime-DA77AmOP.js} +1 -1
- package/dist/preview/assets/{runtime-jVzpCkuu.js → runtime-DHTqFEQI.js} +1 -1
- package/dist/preview/assets/runtime-DKtlQWwc.js +1 -0
- package/dist/preview/assets/runtime-UmLaEUGf.js +1 -0
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/runtime.vue +16 -2
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/runtime.vue +2 -2
- package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/item.vue +2 -2
- package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/schema.js +2 -2
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/badge.vue +3 -2
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.js +2 -2
- package/dist/runtime/components/config/config.vue +9 -1
- package/dist/runtime/components/config/index.vue +11 -1
- package/dist/runtime/components/config/schema.d.ts +25 -0
- package/dist/runtime/components/config/schema.js +8 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +6 -5
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +3 -4
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.vue +3 -4
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.vue +3 -4
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +6 -5
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +6 -5
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.js +2 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +3 -4
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +3 -4
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +3 -4
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +3 -4
- package/dist/runtime/components/form/schema.js +2 -2
- package/dist/runtime/components/form/utils/initial.d.ts +5 -4
- package/dist/runtime/components/form/utils/initial.js +2 -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-remote/runtime.vue +7 -6
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.js +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-remote/runtime.vue +7 -6
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.js +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/runtime.vue +7 -6
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.js +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-multi.remote/runtime.vue +7 -6
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.js +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.vue +7 -6
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.js +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-26/com.shwfed.table.column.combobox-single.remote/runtime.vue +7 -6
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.js +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/runtime.vue +3 -4
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/runtime.vue +3 -4
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.js +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-multi/runtime.vue +7 -6
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.js +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/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +7 -6
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.js +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue +3 -4
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue +3 -4
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +2 -2
- package/dist/runtime/components/table/index.vue +3 -4
- package/dist/runtime/components/table/schema.js +3 -3
- package/dist/runtime/share/event-bus.d.ts +23 -4
- package/dist/runtime/share/expression.d.ts +13 -0
- package/dist/runtime/share/expression.js +1 -0
- package/dist/runtime/share/request.d.ts +29 -0
- package/dist/runtime/share/request.js +11 -0
- package/dist/runtime/vendor/cel-js/CLAUDE.md +2 -2
- package/dist/runtime/vendor/cel-js/PROMPT.md +35 -3
- package/dist/runtime/vendor/cel-js/lib/functions.js +2 -2
- package/dist/runtime/vendor/cel-js/lib/optional.js +52 -1
- package/package.json +1 -1
- package/dist/preview/assets/badge-DamXUB_x.js +0 -1
- package/dist/preview/assets/config-CXgHZFVu.js +0 -1
- package/dist/preview/assets/config-Dtj6xvFB.js +0 -1
- package/dist/preview/assets/config-DyKtOYYU.js +0 -1
- package/dist/preview/assets/config-v7KXfP3A.js +0 -1
- package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js +0 -1
- package/dist/preview/assets/index-CzxZSeNm.js +0 -680
- package/dist/preview/assets/index-DUSkLHHf.js +0 -1
- package/dist/preview/assets/item-BAj_4_7-.js +0 -1
- package/dist/preview/assets/runtime-CiWg_Jub.js +0 -1
- package/dist/preview/assets/runtime-CpMT9U1z.js +0 -1
- package/dist/preview/assets/runtime-CswN1gKf.js +0 -1
- package/dist/preview/assets/runtime-DOK5OTJn.js +0 -1
- package/dist/preview/assets/runtime-DldmFxn1.js +0 -1
- package/dist/preview/assets/runtime-WZBVKYom.js +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Icon } from "@iconify/vue";
|
|
3
3
|
import { watchDebounced } from "@vueuse/core";
|
|
4
|
-
import { Effect } from "effect";
|
|
4
|
+
import { Effect, Option } from "effect";
|
|
5
5
|
import { Fetch } from "fx-fetch";
|
|
6
6
|
import { computed, nextTick, ref, watch } from "vue";
|
|
7
7
|
import { useI18n } from "vue-i18n";
|
|
8
|
+
import { asRequest, fetchJsonOption } from "../../../../../share/request";
|
|
8
9
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
9
10
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
10
11
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
@@ -101,8 +102,8 @@ const requestSignature = computed(() => {
|
|
|
101
102
|
const expr = opts.request;
|
|
102
103
|
if (!expr) return null;
|
|
103
104
|
try {
|
|
104
|
-
const
|
|
105
|
-
return JSON.stringify(
|
|
105
|
+
const req = asRequest(Effect.runSync($cel(expr, { form: state.value ?? {} })));
|
|
106
|
+
return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
|
|
106
107
|
} catch {
|
|
107
108
|
return null;
|
|
108
109
|
}
|
|
@@ -124,8 +125,8 @@ async function fetchOptions() {
|
|
|
124
125
|
}
|
|
125
126
|
isLoading.value = true;
|
|
126
127
|
const program = Effect.gen(function* () {
|
|
127
|
-
const
|
|
128
|
-
return
|
|
128
|
+
const body = yield* fetchJsonOption(yield* $cel(expr, { form: state.value ?? {} }));
|
|
129
|
+
return Option.getOrNull(body);
|
|
129
130
|
});
|
|
130
131
|
try {
|
|
131
132
|
const result = await Effect.runPromise(Effect.provide(program, Fetch.layer));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
2
|
+
import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
3
3
|
import { Locale } from "../../../../../share/locale.js";
|
|
4
4
|
import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
|
|
5
5
|
export const type = "com.shwfed.form.field.combobox.single";
|
|
@@ -59,7 +59,7 @@ export function itemSchema(configure) {
|
|
|
59
59
|
export function remoteOptionsSchema(configure) {
|
|
60
60
|
const CelRequest = Schema.Union(
|
|
61
61
|
Schema.Literal(""),
|
|
62
|
-
Expression({ configure, resultType:
|
|
62
|
+
Expression({ configure, resultType: HttpRequestResult })
|
|
63
63
|
);
|
|
64
64
|
const CelOptions = Expression({ configure: configureWithJson(configure), resultType: isListType });
|
|
65
65
|
const CelOptionValue = Expression({ configure: configureWithOption(configure), resultType: "dyn" });
|
|
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
|
|
|
4
4
|
import { Fetch } from "fx-fetch";
|
|
5
5
|
import { computed, ref, shallowRef, watch } from "vue";
|
|
6
6
|
import { useI18n } from "vue-i18n";
|
|
7
|
+
import { fetchJsonOption } from "../../../../../share/request";
|
|
7
8
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
8
9
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
9
10
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
@@ -181,11 +182,9 @@ async function fetchTree() {
|
|
|
181
182
|
const effect = Effect.gen(function* () {
|
|
182
183
|
let jsonOpt = Option.none();
|
|
183
184
|
if (dataSource.request) {
|
|
184
|
-
|
|
185
|
+
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
185
186
|
form: state.value ?? {}
|
|
186
|
-
});
|
|
187
|
-
const response = yield* builder.json();
|
|
188
|
-
jsonOpt = Option.some(response);
|
|
187
|
+
}));
|
|
189
188
|
}
|
|
190
189
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
191
190
|
form: state.value ?? {},
|
|
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
|
|
|
4
4
|
import { Fetch } from "fx-fetch";
|
|
5
5
|
import { computed, ref, shallowRef, watch } from "vue";
|
|
6
6
|
import { useI18n } from "vue-i18n";
|
|
7
|
+
import { fetchJsonOption } from "../../../../../share/request";
|
|
7
8
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
8
9
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
9
10
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
@@ -182,11 +183,9 @@ async function fetchTree() {
|
|
|
182
183
|
const effect = Effect.gen(function* () {
|
|
183
184
|
let jsonOpt = Option.none();
|
|
184
185
|
if (dataSource.request) {
|
|
185
|
-
|
|
186
|
+
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
186
187
|
form: state.value ?? {}
|
|
187
|
-
});
|
|
188
|
-
const response = yield* builder.json();
|
|
189
|
-
jsonOpt = Option.some(response);
|
|
188
|
+
}));
|
|
190
189
|
}
|
|
191
190
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
192
191
|
form: state.value ?? {},
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue
CHANGED
|
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
|
|
|
4
4
|
import { Fetch } from "fx-fetch";
|
|
5
5
|
import { computed, ref, shallowRef, watch } from "vue";
|
|
6
6
|
import { useI18n } from "vue-i18n";
|
|
7
|
+
import { fetchJsonOption } from "../../../../../share/request";
|
|
7
8
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
8
9
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
9
10
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
@@ -108,11 +109,9 @@ async function fetchTree() {
|
|
|
108
109
|
const effect = Effect.gen(function* () {
|
|
109
110
|
let jsonOpt = Option.none();
|
|
110
111
|
if (dataSource.request) {
|
|
111
|
-
|
|
112
|
+
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
112
113
|
form: state.value ?? {}
|
|
113
|
-
});
|
|
114
|
-
const response = yield* builder.json();
|
|
115
|
-
jsonOpt = Option.some(response);
|
|
114
|
+
}));
|
|
116
115
|
}
|
|
117
116
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
118
117
|
form: state.value ?? {},
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue
CHANGED
|
@@ -4,6 +4,7 @@ import { Effect, Fiber, Option } from "effect";
|
|
|
4
4
|
import { Fetch } from "fx-fetch";
|
|
5
5
|
import { computed, ref, shallowRef, watch } from "vue";
|
|
6
6
|
import { useI18n } from "vue-i18n";
|
|
7
|
+
import { fetchJsonOption } from "../../../../../share/request";
|
|
7
8
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
8
9
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
9
10
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
@@ -104,11 +105,9 @@ async function fetchTree() {
|
|
|
104
105
|
const effect = Effect.gen(function* () {
|
|
105
106
|
let jsonOpt = Option.none();
|
|
106
107
|
if (dataSource.request) {
|
|
107
|
-
|
|
108
|
+
jsonOpt = yield* fetchJsonOption(yield* $cel(dataSource.request, {
|
|
108
109
|
form: state.value ?? {}
|
|
109
|
-
});
|
|
110
|
-
const response = yield* builder.json();
|
|
111
|
-
jsonOpt = Option.some(response);
|
|
110
|
+
}));
|
|
112
111
|
}
|
|
113
112
|
const dataRaw = yield* $cel(dataSource.data, {
|
|
114
113
|
form: state.value ?? {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { Expression } from "../../share/expression.js";
|
|
2
|
+
import { Expression, HttpRequestResult } from "../../share/expression.js";
|
|
3
3
|
import { allFieldSchemas } from "./utils/resolve.js";
|
|
4
4
|
import { registerFormVariablesIfAbsent } from "./utils/form-vars.js";
|
|
5
5
|
import { md } from "../../share/markdown.js";
|
|
@@ -53,7 +53,7 @@ export function FormConfig(configure) {
|
|
|
53
53
|
registerFormVariablesIfAbsent(env);
|
|
54
54
|
configure(env);
|
|
55
55
|
};
|
|
56
|
-
const CelInitialRequest = Expression({ configure: formConfigure, resultType:
|
|
56
|
+
const CelInitialRequest = Expression({ configure: formConfigure, resultType: HttpRequestResult });
|
|
57
57
|
const CelInitialData = Expression({
|
|
58
58
|
configure: (env) => {
|
|
59
59
|
formConfigure(env);
|
|
@@ -18,9 +18,10 @@ export type InitialSource = Readonly<{
|
|
|
18
18
|
export type CelEvaluator = <T>(expression: string, context?: Record<string, unknown>) => Effect.Effect<T, unknown, never>;
|
|
19
19
|
/**
|
|
20
20
|
* Resolve an `InitialSource` to the seed value. When `request` is set it is
|
|
21
|
-
* built by CEL, then issued here as `.json()` —
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
21
|
+
* built by CEL, then issued here as `.json()` — issued only when the expression
|
|
22
|
+
* produces a request (it may opt out, yielding `None`). The host owns the IO,
|
|
23
|
+
* CEL only describes it. The response is exposed to `data` as the `json`
|
|
24
|
+
* variable (an `Option`, so a missing response is `None`, never a crash). The
|
|
25
|
+
* returned Effect needs a `Fetch` layer.
|
|
25
26
|
*/
|
|
26
27
|
export declare function evaluateInitial(initial: InitialSource, cel: CelEvaluator, context: Record<string, unknown>): Effect.Effect<unknown, unknown, Fetch.Fetch>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect, Option } from "effect";
|
|
2
|
+
import { fetchJsonOption } from "../../../share/request.js";
|
|
2
3
|
export function evaluateInitial(initial, cel, context) {
|
|
3
4
|
return Effect.gen(function* () {
|
|
4
5
|
let json = Option.none();
|
|
5
6
|
if (initial.request) {
|
|
6
|
-
|
|
7
|
-
json = Option.some(yield* builder.json());
|
|
7
|
+
json = yield* fetchJsonOption(yield* cel(initial.request, context));
|
|
8
8
|
}
|
|
9
9
|
return yield* cel(initial.data, { ...context, json });
|
|
10
10
|
});
|
|
@@ -50,9 +50,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
50
|
readonly locale: "en" | "ja" | "ko";
|
|
51
51
|
readonly message: string;
|
|
52
52
|
}[]];
|
|
53
|
-
readonly successMessage?: string | undefined;
|
|
54
53
|
readonly accessor: string;
|
|
55
54
|
readonly sortKey?: string | undefined;
|
|
55
|
+
readonly successMessage?: string | undefined;
|
|
56
56
|
}) => any;
|
|
57
57
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
58
58
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -102,9 +102,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
102
102
|
readonly locale: "en" | "ja" | "ko";
|
|
103
103
|
readonly message: string;
|
|
104
104
|
}[]];
|
|
105
|
-
readonly successMessage?: string | undefined;
|
|
106
105
|
readonly accessor: string;
|
|
107
106
|
readonly sortKey?: string | undefined;
|
|
107
|
+
readonly successMessage?: string | undefined;
|
|
108
108
|
}) => any) | undefined;
|
|
109
109
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
110
110
|
declare const _default: typeof __VLS_export;
|
|
@@ -50,9 +50,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
50
|
readonly locale: "en" | "ja" | "ko";
|
|
51
51
|
readonly message: string;
|
|
52
52
|
}[]];
|
|
53
|
-
readonly successMessage?: string | undefined;
|
|
54
53
|
readonly accessor: string;
|
|
55
54
|
readonly sortKey?: string | undefined;
|
|
55
|
+
readonly successMessage?: string | undefined;
|
|
56
56
|
}) => any;
|
|
57
57
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
58
58
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -102,9 +102,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
102
102
|
readonly locale: "en" | "ja" | "ko";
|
|
103
103
|
readonly message: string;
|
|
104
104
|
}[]];
|
|
105
|
-
readonly successMessage?: string | undefined;
|
|
106
105
|
readonly accessor: string;
|
|
107
106
|
readonly sortKey?: string | undefined;
|
|
107
|
+
readonly successMessage?: string | undefined;
|
|
108
108
|
}) => any) | undefined;
|
|
109
109
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
110
110
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Icon } from "@iconify/vue";
|
|
3
3
|
import { watchDebounced } from "@vueuse/core";
|
|
4
|
-
import { Effect } from "effect";
|
|
4
|
+
import { Effect, Option } from "effect";
|
|
5
5
|
import { Fetch } from "fx-fetch";
|
|
6
6
|
import { toast } from "vue-sonner";
|
|
7
7
|
import { computed, nextTick, ref, watch } from "vue";
|
|
8
8
|
import { useI18n } from "vue-i18n";
|
|
9
|
+
import { asRequest, fetchJsonOption } from "../../../../../share/request";
|
|
9
10
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
10
11
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
11
12
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
@@ -80,10 +81,10 @@ const requestSignature = computed(() => {
|
|
|
80
81
|
const expr = props.column.request;
|
|
81
82
|
if (!expr) return null;
|
|
82
83
|
try {
|
|
83
|
-
const
|
|
84
|
+
const req = asRequest(Effect.runSync(
|
|
84
85
|
$cel(expr, { row: row.value, index: rowIndex.value })
|
|
85
|
-
);
|
|
86
|
-
return JSON.stringify(
|
|
86
|
+
));
|
|
87
|
+
return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
|
|
87
88
|
} catch {
|
|
88
89
|
return null;
|
|
89
90
|
}
|
|
@@ -99,8 +100,8 @@ async function fetchOptions() {
|
|
|
99
100
|
const expr = props.column.request;
|
|
100
101
|
isLoading.value = true;
|
|
101
102
|
const program = Effect.gen(function* () {
|
|
102
|
-
const
|
|
103
|
-
return
|
|
103
|
+
const json2 = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
|
|
104
|
+
return Option.getOrNull(json2);
|
|
104
105
|
});
|
|
105
106
|
try {
|
|
106
107
|
const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
2
|
+
import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
3
3
|
import { Locale } from "../../../../../share/locale.js";
|
|
4
4
|
import { Triggers } from "../../../../../share/event-bus.js";
|
|
5
5
|
import {
|
|
@@ -32,7 +32,7 @@ export function schema(configure) {
|
|
|
32
32
|
configure(env);
|
|
33
33
|
registerRowVariablesIfAbsent(env);
|
|
34
34
|
},
|
|
35
|
-
resultType:
|
|
35
|
+
resultType: HttpRequestResult
|
|
36
36
|
});
|
|
37
37
|
const CelOptions = Expression({
|
|
38
38
|
configure: (env) => {
|
|
@@ -64,9 +64,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
64
64
|
readonly readonly?: string | undefined;
|
|
65
65
|
readonly grow?: boolean | undefined;
|
|
66
66
|
readonly enableSorting?: boolean | undefined;
|
|
67
|
-
readonly successMessage?: string | undefined;
|
|
68
67
|
readonly accessor: string;
|
|
69
68
|
readonly sortKey?: string | undefined;
|
|
69
|
+
readonly successMessage?: string | undefined;
|
|
70
70
|
}) => any;
|
|
71
71
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
72
72
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -130,9 +130,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
130
130
|
readonly readonly?: string | undefined;
|
|
131
131
|
readonly grow?: boolean | undefined;
|
|
132
132
|
readonly enableSorting?: boolean | undefined;
|
|
133
|
-
readonly successMessage?: string | undefined;
|
|
134
133
|
readonly accessor: string;
|
|
135
134
|
readonly sortKey?: string | undefined;
|
|
135
|
+
readonly successMessage?: string | undefined;
|
|
136
136
|
}) => any) | undefined;
|
|
137
137
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
138
138
|
declare const _default: typeof __VLS_export;
|
|
@@ -64,9 +64,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
64
64
|
readonly readonly?: string | undefined;
|
|
65
65
|
readonly grow?: boolean | undefined;
|
|
66
66
|
readonly enableSorting?: boolean | undefined;
|
|
67
|
-
readonly successMessage?: string | undefined;
|
|
68
67
|
readonly accessor: string;
|
|
69
68
|
readonly sortKey?: string | undefined;
|
|
69
|
+
readonly successMessage?: string | undefined;
|
|
70
70
|
}) => any;
|
|
71
71
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
72
72
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -130,9 +130,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
130
130
|
readonly readonly?: string | undefined;
|
|
131
131
|
readonly grow?: boolean | undefined;
|
|
132
132
|
readonly enableSorting?: boolean | undefined;
|
|
133
|
-
readonly successMessage?: string | undefined;
|
|
134
133
|
readonly accessor: string;
|
|
135
134
|
readonly sortKey?: string | undefined;
|
|
135
|
+
readonly successMessage?: string | undefined;
|
|
136
136
|
}) => any) | undefined;
|
|
137
137
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
138
138
|
declare const _default: typeof __VLS_export;
|
|
@@ -50,9 +50,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
50
|
readonly locale: "en" | "ja" | "ko";
|
|
51
51
|
readonly message: string;
|
|
52
52
|
}[]];
|
|
53
|
-
readonly successMessage?: string | undefined;
|
|
54
53
|
readonly accessor: string;
|
|
55
54
|
readonly sortKey?: string | undefined;
|
|
55
|
+
readonly successMessage?: string | undefined;
|
|
56
56
|
}) => any;
|
|
57
57
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
58
58
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -102,9 +102,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
102
102
|
readonly locale: "en" | "ja" | "ko";
|
|
103
103
|
readonly message: string;
|
|
104
104
|
}[]];
|
|
105
|
-
readonly successMessage?: string | undefined;
|
|
106
105
|
readonly accessor: string;
|
|
107
106
|
readonly sortKey?: string | undefined;
|
|
107
|
+
readonly successMessage?: string | undefined;
|
|
108
108
|
}) => any) | undefined;
|
|
109
109
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
110
110
|
declare const _default: typeof __VLS_export;
|
|
@@ -50,9 +50,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
50
|
readonly locale: "en" | "ja" | "ko";
|
|
51
51
|
readonly message: string;
|
|
52
52
|
}[]];
|
|
53
|
-
readonly successMessage?: string | undefined;
|
|
54
53
|
readonly accessor: string;
|
|
55
54
|
readonly sortKey?: string | undefined;
|
|
55
|
+
readonly successMessage?: string | undefined;
|
|
56
56
|
}) => any;
|
|
57
57
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
58
58
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -102,9 +102,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
102
102
|
readonly locale: "en" | "ja" | "ko";
|
|
103
103
|
readonly message: string;
|
|
104
104
|
}[]];
|
|
105
|
-
readonly successMessage?: string | undefined;
|
|
106
105
|
readonly accessor: string;
|
|
107
106
|
readonly sortKey?: string | undefined;
|
|
107
|
+
readonly successMessage?: string | undefined;
|
|
108
108
|
}) => any) | undefined;
|
|
109
109
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
110
110
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Icon } from "@iconify/vue";
|
|
3
3
|
import { watchDebounced } from "@vueuse/core";
|
|
4
|
-
import { Effect } from "effect";
|
|
4
|
+
import { Effect, Option } from "effect";
|
|
5
5
|
import { Fetch } from "fx-fetch";
|
|
6
6
|
import { toast } from "vue-sonner";
|
|
7
7
|
import { computed, ref, watch } from "vue";
|
|
8
8
|
import { useI18n } from "vue-i18n";
|
|
9
|
+
import { asRequest, fetchJsonOption } from "../../../../../share/request";
|
|
9
10
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
10
11
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
11
12
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
@@ -80,10 +81,10 @@ const requestSignature = computed(() => {
|
|
|
80
81
|
const expr = props.column.request;
|
|
81
82
|
if (!expr) return null;
|
|
82
83
|
try {
|
|
83
|
-
const
|
|
84
|
+
const req = asRequest(Effect.runSync(
|
|
84
85
|
$cel(expr, { row: row.value, index: rowIndex.value })
|
|
85
|
-
);
|
|
86
|
-
return JSON.stringify(
|
|
86
|
+
));
|
|
87
|
+
return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
|
|
87
88
|
} catch {
|
|
88
89
|
return null;
|
|
89
90
|
}
|
|
@@ -99,8 +100,8 @@ async function fetchOptions() {
|
|
|
99
100
|
const expr = props.column.request;
|
|
100
101
|
isLoading.value = true;
|
|
101
102
|
const program = Effect.gen(function* () {
|
|
102
|
-
const
|
|
103
|
-
return
|
|
103
|
+
const json2 = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
|
|
104
|
+
return Option.getOrNull(json2);
|
|
104
105
|
});
|
|
105
106
|
try {
|
|
106
107
|
const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
2
|
+
import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
3
3
|
import { Locale } from "../../../../../share/locale.js";
|
|
4
4
|
import { Triggers } from "../../../../../share/event-bus.js";
|
|
5
5
|
import {
|
|
@@ -32,7 +32,7 @@ export function schema(configure) {
|
|
|
32
32
|
configure(env);
|
|
33
33
|
registerRowVariablesIfAbsent(env);
|
|
34
34
|
},
|
|
35
|
-
resultType:
|
|
35
|
+
resultType: HttpRequestResult
|
|
36
36
|
});
|
|
37
37
|
const CelOptions = Expression({
|
|
38
38
|
configure: (env) => {
|
|
@@ -64,9 +64,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
64
64
|
readonly readonly?: string | undefined;
|
|
65
65
|
readonly grow?: boolean | undefined;
|
|
66
66
|
readonly enableSorting?: boolean | undefined;
|
|
67
|
-
readonly successMessage?: string | undefined;
|
|
68
67
|
readonly accessor: string;
|
|
69
68
|
readonly sortKey?: string | undefined;
|
|
69
|
+
readonly successMessage?: string | undefined;
|
|
70
70
|
}) => any;
|
|
71
71
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
72
72
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -130,9 +130,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
130
130
|
readonly readonly?: string | undefined;
|
|
131
131
|
readonly grow?: boolean | undefined;
|
|
132
132
|
readonly enableSorting?: boolean | undefined;
|
|
133
|
-
readonly successMessage?: string | undefined;
|
|
134
133
|
readonly accessor: string;
|
|
135
134
|
readonly sortKey?: string | undefined;
|
|
135
|
+
readonly successMessage?: string | undefined;
|
|
136
136
|
}) => any) | undefined;
|
|
137
137
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
138
138
|
declare const _default: typeof __VLS_export;
|
|
@@ -64,9 +64,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
64
64
|
readonly readonly?: string | undefined;
|
|
65
65
|
readonly grow?: boolean | undefined;
|
|
66
66
|
readonly enableSorting?: boolean | undefined;
|
|
67
|
-
readonly successMessage?: string | undefined;
|
|
68
67
|
readonly accessor: string;
|
|
69
68
|
readonly sortKey?: string | undefined;
|
|
69
|
+
readonly successMessage?: string | undefined;
|
|
70
70
|
}) => any;
|
|
71
71
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
72
72
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -130,9 +130,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
130
130
|
readonly readonly?: string | undefined;
|
|
131
131
|
readonly grow?: boolean | undefined;
|
|
132
132
|
readonly enableSorting?: boolean | undefined;
|
|
133
|
-
readonly successMessage?: string | undefined;
|
|
134
133
|
readonly accessor: string;
|
|
135
134
|
readonly sortKey?: string | undefined;
|
|
135
|
+
readonly successMessage?: string | undefined;
|
|
136
136
|
}) => any) | undefined;
|
|
137
137
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
138
138
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Icon } from "@iconify/vue";
|
|
3
|
-
import { Effect } from "effect";
|
|
3
|
+
import { Effect, Option } from "effect";
|
|
4
4
|
import { watchDebounced } from "@vueuse/core";
|
|
5
5
|
import { computed, ref, watch } from "vue";
|
|
6
6
|
import { useI18n } from "vue-i18n";
|
|
7
|
+
import { asRequest, fetchJsonOption } from "../../../../../share/request";
|
|
7
8
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
8
9
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
9
10
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
@@ -102,10 +103,10 @@ const requestSignature = computed(() => {
|
|
|
102
103
|
const expr = props.column.options.request;
|
|
103
104
|
if (!expr) return null;
|
|
104
105
|
try {
|
|
105
|
-
const
|
|
106
|
+
const req = asRequest(Effect.runSync(
|
|
106
107
|
$cel(expr, { row: row.value, index: rowIndex.value })
|
|
107
|
-
);
|
|
108
|
-
return JSON.stringify(
|
|
108
|
+
));
|
|
109
|
+
return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
|
|
109
110
|
} catch {
|
|
110
111
|
return null;
|
|
111
112
|
}
|
|
@@ -120,8 +121,8 @@ async function fetchOptions() {
|
|
|
120
121
|
const expr = props.column.options.request;
|
|
121
122
|
remoteLoading.value = true;
|
|
122
123
|
const program = Effect.gen(function* () {
|
|
123
|
-
const
|
|
124
|
-
return
|
|
124
|
+
const json = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
|
|
125
|
+
return Option.getOrNull(json);
|
|
125
126
|
});
|
|
126
127
|
try {
|
|
127
128
|
const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { getProperty } from "dot-prop";
|
|
3
3
|
import { Locale } from "../../../../../share/locale.js";
|
|
4
|
-
import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
4
|
+
import { Expression, HttpRequestResult, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
5
5
|
import {
|
|
6
6
|
CelRowAccess,
|
|
7
7
|
derivedRowField,
|
|
@@ -52,7 +52,7 @@ export function remoteOptionsSchema(configure) {
|
|
|
52
52
|
configure(env);
|
|
53
53
|
registerRowVariablesIfAbsent(env);
|
|
54
54
|
},
|
|
55
|
-
resultType:
|
|
55
|
+
resultType: HttpRequestResult
|
|
56
56
|
});
|
|
57
57
|
const CelOptions = Expression({
|
|
58
58
|
configure: (env) => {
|
|
@@ -79,9 +79,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
79
79
|
};
|
|
80
80
|
}[];
|
|
81
81
|
};
|
|
82
|
-
readonly successMessage?: string | undefined;
|
|
83
82
|
readonly accessor: string;
|
|
84
83
|
readonly sortKey?: string | undefined;
|
|
84
|
+
readonly successMessage?: string | undefined;
|
|
85
85
|
}) => any;
|
|
86
86
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
87
87
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -160,9 +160,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
160
160
|
};
|
|
161
161
|
}[];
|
|
162
162
|
};
|
|
163
|
-
readonly successMessage?: string | undefined;
|
|
164
163
|
readonly accessor: string;
|
|
165
164
|
readonly sortKey?: string | undefined;
|
|
165
|
+
readonly successMessage?: string | undefined;
|
|
166
166
|
}) => any) | undefined;
|
|
167
167
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
168
168
|
declare const _default: typeof __VLS_export;
|
|
@@ -79,9 +79,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
79
79
|
};
|
|
80
80
|
}[];
|
|
81
81
|
};
|
|
82
|
-
readonly successMessage?: string | undefined;
|
|
83
82
|
readonly accessor: string;
|
|
84
83
|
readonly sortKey?: string | undefined;
|
|
84
|
+
readonly successMessage?: string | undefined;
|
|
85
85
|
}) => any;
|
|
86
86
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
87
87
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -160,9 +160,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
160
160
|
};
|
|
161
161
|
}[];
|
|
162
162
|
};
|
|
163
|
-
readonly successMessage?: string | undefined;
|
|
164
163
|
readonly accessor: string;
|
|
165
164
|
readonly sortKey?: string | undefined;
|
|
165
|
+
readonly successMessage?: string | undefined;
|
|
166
166
|
}) => any) | undefined;
|
|
167
167
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
168
168
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Icon } from "@iconify/vue";
|
|
3
|
-
import { Effect } from "effect";
|
|
3
|
+
import { Effect, Option } from "effect";
|
|
4
4
|
import { Fetch } from "fx-fetch";
|
|
5
5
|
import { watchDebounced } from "@vueuse/core";
|
|
6
6
|
import { toast } from "vue-sonner";
|
|
7
7
|
import { computed, ref } from "vue";
|
|
8
8
|
import { useI18n } from "vue-i18n";
|
|
9
|
+
import { asRequest, fetchJsonOption } from "../../../../../share/request";
|
|
9
10
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
10
11
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
11
12
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
@@ -103,10 +104,10 @@ const requestSignature = computed(() => {
|
|
|
103
104
|
const expr = props.column.options.request;
|
|
104
105
|
if (!expr) return null;
|
|
105
106
|
try {
|
|
106
|
-
const
|
|
107
|
+
const req = asRequest(Effect.runSync(
|
|
107
108
|
$cel(expr, { row: row.value, index: rowIndex.value })
|
|
108
|
-
);
|
|
109
|
-
return JSON.stringify(
|
|
109
|
+
));
|
|
110
|
+
return Option.isSome(req) ? JSON.stringify(req.value.describe()) : null;
|
|
110
111
|
} catch {
|
|
111
112
|
return null;
|
|
112
113
|
}
|
|
@@ -121,8 +122,8 @@ async function fetchOptions() {
|
|
|
121
122
|
const expr = props.column.options.request;
|
|
122
123
|
remoteLoading.value = true;
|
|
123
124
|
const program = Effect.gen(function* () {
|
|
124
|
-
const
|
|
125
|
-
return
|
|
125
|
+
const json = yield* fetchJsonOption(yield* $cel(expr, { row: row.value, index: rowIndex.value }));
|
|
126
|
+
return Option.getOrNull(json);
|
|
126
127
|
});
|
|
127
128
|
try {
|
|
128
129
|
const result = await Effect.runPromise(Effect.provide(program, sharedFetchLayer));
|