@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
package/dist/mcp.mjs
CHANGED
|
@@ -37700,6 +37700,57 @@ function register(registry2) {
|
|
|
37700
37700
|
}
|
|
37701
37701
|
})
|
|
37702
37702
|
);
|
|
37703
|
+
registry2.registerFunctionOverload(
|
|
37704
|
+
"optional<A>.flatMap(ast, ast): optional<dyn>",
|
|
37705
|
+
createFlatMapExpander()
|
|
37706
|
+
);
|
|
37707
|
+
}
|
|
37708
|
+
function createFlatMapExpander() {
|
|
37709
|
+
const functionDesc = "optional.flatMap(var, body)";
|
|
37710
|
+
const invalidVar2 = `${functionDesc} invalid iteration variable`;
|
|
37711
|
+
const invalidReceiver = `${functionDesc} receiver`;
|
|
37712
|
+
const invalidBody = `${functionDesc} body`;
|
|
37713
|
+
function ensureOptional(value, ast, description2) {
|
|
37714
|
+
if (isOption(value)) return value;
|
|
37715
|
+
throw evaluationError("optional_expected", `${description2} must be optional`, ast);
|
|
37716
|
+
}
|
|
37717
|
+
function ensureOptionalType(checker, node, ctx, description2) {
|
|
37718
|
+
const type2 = checker.check(node, ctx);
|
|
37719
|
+
if (type2.kind === "optional") return type2;
|
|
37720
|
+
if (type2.kind === "dyn") return checker.getType("optional");
|
|
37721
|
+
throw checker.createError("optional_expected", `${description2} must be optional, got '${type2}'`, node);
|
|
37722
|
+
}
|
|
37723
|
+
function typeCheck(checker, macro, ctx) {
|
|
37724
|
+
const receiverType = ensureOptionalType(checker, macro.receiver, ctx, invalidReceiver);
|
|
37725
|
+
const innerType = receiverType.valueType ?? checker.getType("dyn");
|
|
37726
|
+
macro.iterCtx = ctx.forkWithVariable(macro.iterVarName, innerType);
|
|
37727
|
+
return ensureOptionalType(checker, macro.body, macro.iterCtx, invalidBody);
|
|
37728
|
+
}
|
|
37729
|
+
function evaluate2(ev, macro, ctx) {
|
|
37730
|
+
return gen(function* () {
|
|
37731
|
+
const recv = yield* ev.eval(macro.receiver, ctx);
|
|
37732
|
+
const optional2 = ensureOptional(recv, macro.receiver, invalidReceiver);
|
|
37733
|
+
if (isNone(optional2)) return none$4();
|
|
37734
|
+
const iterCtx = macro.iterCtx.reuse(ctx);
|
|
37735
|
+
const result = yield* ev.eval(macro.body, iterCtx.setIterValue(optional2.value, ev));
|
|
37736
|
+
return ensureOptional(result, macro.body, invalidBody);
|
|
37737
|
+
});
|
|
37738
|
+
}
|
|
37739
|
+
return (opts) => {
|
|
37740
|
+
const { args: args2, receiver, ast } = opts;
|
|
37741
|
+
const iterVar = args2[0];
|
|
37742
|
+
if (iterVar.op !== "id") throw parseError("invalid_macro_argument", invalidVar2, iterVar);
|
|
37743
|
+
return {
|
|
37744
|
+
ast,
|
|
37745
|
+
receiver,
|
|
37746
|
+
functionDesc,
|
|
37747
|
+
iterVarName: iterVar.args,
|
|
37748
|
+
body: args2[1],
|
|
37749
|
+
iterCtx: void 0,
|
|
37750
|
+
evaluate: evaluate2,
|
|
37751
|
+
typeCheck
|
|
37752
|
+
};
|
|
37753
|
+
};
|
|
37703
37754
|
}
|
|
37704
37755
|
const hasOwn = Object.hasOwn;
|
|
37705
37756
|
const objKeys = Object.keys;
|
|
@@ -41268,7 +41319,7 @@ function registerFunctions(registry2) {
|
|
|
41268
41319
|
functionOverload("Date.format(string): string", (d, fmt) => format$2(d, fmt));
|
|
41269
41320
|
registry2.registerType("File", File);
|
|
41270
41321
|
registry2.registerType("URL", URL);
|
|
41271
|
-
functionOverload("URL.
|
|
41322
|
+
functionOverload("URL.query(string): optional<string>", (url, key) => optionalOf(url.searchParams.get(key) ?? void 0));
|
|
41272
41323
|
register(registry2);
|
|
41273
41324
|
}
|
|
41274
41325
|
function stringSize(str) {
|
|
@@ -45411,6 +45462,7 @@ const Locale = Tuple(
|
|
|
45411
45462
|
title: "Locale",
|
|
45412
45463
|
description: "本地化文本列表,zh 必须为首项"
|
|
45413
45464
|
});
|
|
45465
|
+
const HttpRequestResult = (t) => t === "HttpRequest" || t === "optional<HttpRequest>" || t === "optional<dyn>" || t === "dyn";
|
|
45414
45466
|
function matchesResultType(actual, expected) {
|
|
45415
45467
|
if (typeof expected === "string") return expected === "dyn" || actual === expected;
|
|
45416
45468
|
if (Array.isArray(expected)) return expected.includes("dyn") || expected.includes(actual);
|
|
@@ -89166,7 +89218,7 @@ function configureWithJson$2(configure) {
|
|
|
89166
89218
|
const isListType$c = (actual) => actual === "dyn" || actual.startsWith("list");
|
|
89167
89219
|
function schema$T(configure) {
|
|
89168
89220
|
const CelBool = Expression({ configure, resultType: "bool" });
|
|
89169
|
-
const CelHttpRequest = Expression({ configure, resultType:
|
|
89221
|
+
const CelHttpRequest = Expression({ configure, resultType: HttpRequestResult });
|
|
89170
89222
|
const CelOptions = Expression({ configure: configureWithJson$2(configure), resultType: isListType$c });
|
|
89171
89223
|
const CelOptionValue = Expression({ configure: configureWithOption$3(configure), resultType: "dyn" });
|
|
89172
89224
|
const LocaleOptionLabel = LocaleMarkdown({ configure: configureWithOption$3(configure) });
|
|
@@ -92237,7 +92289,7 @@ function schema$A(configure) {
|
|
|
92237
92289
|
configure(env);
|
|
92238
92290
|
registerRowVariablesIfAbsent(env);
|
|
92239
92291
|
},
|
|
92240
|
-
resultType:
|
|
92292
|
+
resultType: HttpRequestResult
|
|
92241
92293
|
});
|
|
92242
92294
|
const CelOptions = Expression({
|
|
92243
92295
|
configure: (env) => {
|
|
@@ -92507,7 +92559,7 @@ function schema$y(configure) {
|
|
|
92507
92559
|
configure(env);
|
|
92508
92560
|
registerRowVariablesIfAbsent(env);
|
|
92509
92561
|
},
|
|
92510
|
-
resultType:
|
|
92562
|
+
resultType: HttpRequestResult
|
|
92511
92563
|
});
|
|
92512
92564
|
const CelOptions = Expression({
|
|
92513
92565
|
configure: (env) => {
|
|
@@ -92888,7 +92940,7 @@ function remoteOptionsSchema$7(configure) {
|
|
|
92888
92940
|
configure(env);
|
|
92889
92941
|
registerRowVariablesIfAbsent(env);
|
|
92890
92942
|
},
|
|
92891
|
-
resultType:
|
|
92943
|
+
resultType: HttpRequestResult
|
|
92892
92944
|
});
|
|
92893
92945
|
const CelOptions = Expression({
|
|
92894
92946
|
configure: (env) => {
|
|
@@ -93120,7 +93172,7 @@ function remoteOptionsSchema$6(configure) {
|
|
|
93120
93172
|
configure(env);
|
|
93121
93173
|
registerRowVariablesIfAbsent(env);
|
|
93122
93174
|
},
|
|
93123
|
-
resultType:
|
|
93175
|
+
resultType: HttpRequestResult
|
|
93124
93176
|
});
|
|
93125
93177
|
const CelOptions = Expression({
|
|
93126
93178
|
configure: (env) => {
|
|
@@ -93299,7 +93351,7 @@ function remoteOptionsSchema$5(configure) {
|
|
|
93299
93351
|
configure(env);
|
|
93300
93352
|
registerRowVariablesIfAbsent(env);
|
|
93301
93353
|
},
|
|
93302
|
-
resultType:
|
|
93354
|
+
resultType: HttpRequestResult
|
|
93303
93355
|
});
|
|
93304
93356
|
const CelOptions = Expression({
|
|
93305
93357
|
configure: (env) => {
|
|
@@ -93531,7 +93583,7 @@ function remoteOptionsSchema$4(configure) {
|
|
|
93531
93583
|
configure(env);
|
|
93532
93584
|
registerRowVariablesIfAbsent(env);
|
|
93533
93585
|
},
|
|
93534
|
-
resultType:
|
|
93586
|
+
resultType: HttpRequestResult
|
|
93535
93587
|
});
|
|
93536
93588
|
const CelOptions = Expression({
|
|
93537
93589
|
configure: (env) => {
|
|
@@ -93695,7 +93747,7 @@ function schema$r(configure) {
|
|
|
93695
93747
|
};
|
|
93696
93748
|
const CelDataSourceRequest = Expression({
|
|
93697
93749
|
configure: dataSourceConfigure,
|
|
93698
|
-
resultType:
|
|
93750
|
+
resultType: HttpRequestResult
|
|
93699
93751
|
});
|
|
93700
93752
|
const CelDataSourceData = Expression({
|
|
93701
93753
|
configure: (env) => {
|
|
@@ -93836,7 +93888,7 @@ function schema$q(configure) {
|
|
|
93836
93888
|
};
|
|
93837
93889
|
const CelDataSourceRequest = Expression({
|
|
93838
93890
|
configure: dataSourceConfigure,
|
|
93839
|
-
resultType:
|
|
93891
|
+
resultType: HttpRequestResult
|
|
93840
93892
|
});
|
|
93841
93893
|
const CelDataSourceData = Expression({
|
|
93842
93894
|
configure: (env) => {
|
|
@@ -93989,7 +94041,7 @@ function remoteOptionsSchema$3(configure) {
|
|
|
93989
94041
|
configure(env);
|
|
93990
94042
|
registerRowVariablesIfAbsent(env);
|
|
93991
94043
|
},
|
|
93992
|
-
resultType:
|
|
94044
|
+
resultType: HttpRequestResult
|
|
93993
94045
|
});
|
|
93994
94046
|
const CelOptions = Expression({
|
|
93995
94047
|
configure: (env) => {
|
|
@@ -94275,7 +94327,7 @@ function remoteOptionsSchema$2(configure) {
|
|
|
94275
94327
|
configure(env);
|
|
94276
94328
|
registerRowVariablesIfAbsent(env);
|
|
94277
94329
|
},
|
|
94278
|
-
resultType:
|
|
94330
|
+
resultType: HttpRequestResult
|
|
94279
94331
|
});
|
|
94280
94332
|
const CelOptions = Expression({
|
|
94281
94333
|
configure: (env) => {
|
|
@@ -94542,7 +94594,7 @@ function schema$n(configure) {
|
|
|
94542
94594
|
};
|
|
94543
94595
|
const CelDataSourceRequest = Expression({
|
|
94544
94596
|
configure: dataSourceConfigure,
|
|
94545
|
-
resultType:
|
|
94597
|
+
resultType: HttpRequestResult
|
|
94546
94598
|
});
|
|
94547
94599
|
const CelDataSourceData = Expression({
|
|
94548
94600
|
configure: (env) => {
|
|
@@ -94706,7 +94758,7 @@ function schema$m(configure) {
|
|
|
94706
94758
|
};
|
|
94707
94759
|
const CelDataSourceRequest = Expression({
|
|
94708
94760
|
configure: dataSourceConfigure,
|
|
94709
|
-
resultType:
|
|
94761
|
+
resultType: HttpRequestResult
|
|
94710
94762
|
});
|
|
94711
94763
|
const CelDataSourceData = Expression({
|
|
94712
94764
|
configure: (env) => {
|
|
@@ -95224,7 +95276,7 @@ function DataSource(configure, extras) {
|
|
|
95224
95276
|
configure: (env) => {
|
|
95225
95277
|
configure(env);
|
|
95226
95278
|
},
|
|
95227
|
-
resultType:
|
|
95279
|
+
resultType: HttpRequestResult
|
|
95228
95280
|
});
|
|
95229
95281
|
const CelRows = Expression({
|
|
95230
95282
|
configure: (env) => {
|
|
@@ -95255,7 +95307,7 @@ function tableDataSource(configure) {
|
|
|
95255
95307
|
configure(env);
|
|
95256
95308
|
registerDataSourceRequestVars(env);
|
|
95257
95309
|
},
|
|
95258
|
-
resultType:
|
|
95310
|
+
resultType: HttpRequestResult
|
|
95259
95311
|
});
|
|
95260
95312
|
const CelRows = Expression({
|
|
95261
95313
|
configure: (env) => {
|
|
@@ -96178,7 +96230,7 @@ function itemSchema$2(configure) {
|
|
|
96178
96230
|
function remoteOptionsSchema$1(configure) {
|
|
96179
96231
|
const CelRequest = Union2(
|
|
96180
96232
|
Literal2(""),
|
|
96181
|
-
Expression({ configure, resultType:
|
|
96233
|
+
Expression({ configure, resultType: HttpRequestResult })
|
|
96182
96234
|
);
|
|
96183
96235
|
const CelOptions = Expression({ configure: configureWithJson$1(configure), resultType: isListType$2 });
|
|
96184
96236
|
const CelOptionValue = Expression({ configure: configureWithOption$1(configure), resultType: "dyn" });
|
|
@@ -96370,7 +96422,7 @@ function itemSchema$1(configure) {
|
|
|
96370
96422
|
function remoteOptionsSchema(configure) {
|
|
96371
96423
|
const CelRequest = Union2(
|
|
96372
96424
|
Literal2(""),
|
|
96373
|
-
Expression({ configure, resultType:
|
|
96425
|
+
Expression({ configure, resultType: HttpRequestResult })
|
|
96374
96426
|
);
|
|
96375
96427
|
const CelOptions = Expression({ configure: configureWithJson(configure), resultType: isListType$1 });
|
|
96376
96428
|
const CelOptionValue = Expression({ configure: configureWithOption(configure), resultType: "dyn" });
|
|
@@ -97303,7 +97355,7 @@ function FormConfig(configure) {
|
|
|
97303
97355
|
registerFormVariablesIfAbsent(env);
|
|
97304
97356
|
configure(env);
|
|
97305
97357
|
};
|
|
97306
|
-
const CelInitialRequest = Expression({ configure: formConfigure, resultType:
|
|
97358
|
+
const CelInitialRequest = Expression({ configure: formConfigure, resultType: HttpRequestResult });
|
|
97307
97359
|
const CelInitialData = Expression({
|
|
97308
97360
|
configure: (env) => {
|
|
97309
97361
|
formConfigure(env);
|
|
@@ -97810,7 +97862,7 @@ function registerJson$1(env) {
|
|
|
97810
97862
|
function dataSourceSchema(configure) {
|
|
97811
97863
|
const CelRequest = Expression({
|
|
97812
97864
|
configure,
|
|
97813
|
-
resultType:
|
|
97865
|
+
resultType: HttpRequestResult
|
|
97814
97866
|
});
|
|
97815
97867
|
const CelNumber = Expression({
|
|
97816
97868
|
configure: (env) => {
|
|
@@ -97937,7 +97989,7 @@ const BADGE_VARIANTS = ["default", "secondary", "destructive", "outline"];
|
|
|
97937
97989
|
function badgeSchema(configure) {
|
|
97938
97990
|
const CelRequest = Expression({
|
|
97939
97991
|
configure,
|
|
97940
|
-
resultType:
|
|
97992
|
+
resultType: HttpRequestResult
|
|
97941
97993
|
});
|
|
97942
97994
|
const Content = LocaleMarkdown({
|
|
97943
97995
|
configure: (env) => {
|
package/dist/module.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as M,G as $,u as z,o as E,w as p,a as f,z as F,c as w,A as x,b as m,_ as y,H as I,I as L,J as N,K as O,L as A,e as t,g as J,f as P,h as g,i as S,j as V,p as G,l as H,k as K,r as T,m as U,s as W,M as D,N as Q,t as R,q as X,v as Y}from"./index-CHzOsSTW.js";const ee=M({name:"ShwfedBlockCardBadge",inheritAttrs:!1,__name:"badge",props:{badge:{}},setup(n){const a=n,{locale:k}=$(),j=W(),o=T(void 0);function i(){return U(j)}const b=t(()=>o.value===void 0?X():Y(o.value)),l=t(()=>D(a.badge.content,k.value)||""),C=t(()=>l.value?Q(l.value,g,{...i(),json:b.value}):""),B=t(()=>{const e=a.badge.show;if(!e)return!0;try{return R(g(e,{...i(),json:b.value}))}catch(r){return console.warn("[shwfed-card-badge] show evaluation failed",r),!0}});async function s(){const e=a.badge.request;if(!e)return;const r=i(),q=J(function*(){const v=yield*P(yield*g(e,r));return S(v)});try{o.value=await V(G(q,H))}catch(v){console.warn("[shwfed-card-badge] fetch failed",v)}}const c=t(()=>!!a.badge.request&&(a.badge.interval??0)>0),_=t(()=>Math.max(1,a.badge.interval??1)*1e3),u=K(),{pause:h,resume:d}=z(()=>{s()},_,{immediate:!1});return E(()=>{s(),c.value&&u.value&&d()}),p(u,e=>{c.value&&(e?(s(),d()):h())}),p(()=>[a.badge.request??"",a.badge.interval??0].join("|"),()=>{s(),c.value&&u.value?d():h()}),(e,r)=>l.value&&B.value?(f(),F(O,{key:0},[n.badge.dot?(f(),w(m(y),x({key:0,variant:n.badge.variant??"default",class:"size-2.5 min-w-0 rounded-full p-0"},e.$attrs),null,16,["variant"])):(f(),w(m(y),x({key:1,variant:n.badge.variant??"default"},e.$attrs),{default:I(()=>[L(m(N),{source:C.value,class:"max-w-none text-inherit [&_*]:text-inherit [&_p]:m-0"},null,8,["source"])]),_:1},16,["variant"]))],64)):A("",!0)}});export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as x,Q as k,b1 as V,z as g,I as e,H as l,b as a,a as S,U as u,V as m,W as d,X as f,J as p,av as z,T as _,Z as $,a3 as b,a4 as w}from"./index-CHzOsSTW.js";const T={class:"flex flex-col gap-4"},y=x({name:"ShwfedMarkdownItemConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(v){const t=k(v,"modelValue"),c=V(),r=o=>b(c,o)??o,s=o=>w(c,o);return(o,n)=>(S(),g("div",T,[e(a(_),{orientation:"vertical"},{default:l(()=>[e(a(u),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(r("name")),1)]),_:2},[s("name")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("name"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(z),{"model-value":t.value.name,placeholder:"仅用于编辑器内识别","onUpdate:modelValue":n[0]||(n[0]=i=>t.value={...t.value,name:String(i)})},null,8,["model-value"])]),_:1}),e(a(_),{orientation:"vertical"},{default:l(()=>[e(a(u),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(r("content")),1)]),_:2},[s("content")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("content"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a($),{markdown:"",multiline:"","model-value":t.value.content,"onUpdate:modelValue":n[1]||(n[1]=i=>t.value={...t.value,content:i})},null,8,["model-value"])]),_:1})]))}});export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as
|
|
1
|
+
import{d as G,Q as ee,ak as le,al as te,w as I,am as A,z as v,c as H,I as n,H as s,b as l,an as ae,L as oe,K as W,ao as ne,X as p,S as c,ap as F,aq as R,ar as se,e as x,r as ie,y as K,a as d,as as O,at as h,a9 as j,au as q,U as B,V as b,W as L,J as U,Z as de,T as V,av as X,a3 as ue,a4 as ve,aw as ce,ax as re,ay as me,az as fe}from"./index-CHzOsSTW.js";const pe={key:0,class:"flex min-h-96 items-center justify-center p-8 text-sm text-zinc-400"},xe={key:1},ke={key:2,class:"p-6 text-sm text-red-500"},ye={key:2,class:"flex flex-col gap-4"},ge={class:"grid grid-cols-2 gap-4"},Ie={key:0,class:"flex gap-2 min-h-96"},Be={class:"flex w-56 shrink-0 flex-col"},be={class:"flex flex-1 flex-col gap-2"},Le={class:"flex-1"},Ue={key:1,class:"flex flex-col gap-2"},Ve={class:"h-96"},De=G({name:"ShwfedModalLayoutActionConfig",__name:"config",props:se({configure:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(_){const i=ee(_,"modelValue"),Y=_,D=x(()=>Y.configure??(()=>{})),E=le(()=>{}),k=a=>ue(E,a)??a,r=a=>ve(E,a),J=x({get:()=>i.value.slot??ce(),set:a=>{i.value={...i.value,slot:a}}}),t=te(J,{configure:D.value});function P(a){i.value={...i.value,modalTitle:a}}function T(a,e){const o=e.trim(),g={...i.value};o.length===0?Reflect.deleteProperty(g,a):g[a]=o,i.value=g}function S(){const a=t.layouts.value;t.layouts.value=[...a,{name:"新布局",layout:{columns:1,placements:{}}}],t.activeLayoutIndex.value=a.length}function z(a,e){t.addBlock(a,e)}function M(a){t.removeBlock(a)}function w(a){t.removeBlocks(a)}const u=ie(null),m=x(()=>{const a=u.value;return a?t.blocks.value.find(e=>e.id===a)??null:null}),$=x(()=>{const a=m.value;return a?re()?.(a.type,a.compatibilityDate)??null:null});function C(a){u.value=a}function Q(){u.value=null}I(()=>t.blocks.value.map(a=>a.id),a=>{const e=u.value;e&&!a.includes(e)&&(u.value=null)});function Z(a){const e=u.value;e&&t.updateBlock(e,a)}const N=K(me,null);if(N){const a=N.add();I(m,e=>{e?(a.label.value=t.getBlockLabel(e),a.back.value=Q):(a.label.value=null,a.back.value=null)},{immediate:!0}),A(()=>{a.dispose()})}const f=K(fe,null),y=x(()=>f?.target.value??null);return I(u,a=>{f?.drilled&&(f.drilled.value=!!a)},{immediate:!0}),A(()=>{f?.drilled&&(f.drilled.value=!1)}),(a,e)=>(d(),v(W,null,[y.value&&!u.value?(d(),H(ae,{key:0,to:y.value},[n(l(h),{class:"flex-1"},{default:s(()=>[n(O,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[0]||(e[0]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[1]||(e[1]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(q),{variant:"ghost",size:"sm",onClick:e[2]||(e[2]=o=>S())},{default:s(()=>[n(l(j),{icon:"fluent:add-20-regular",class:"size-4"}),e[17]||(e[17]=c("span",null,"新增布局",-1))]),_:1})],8,["to"])):oe("",!0),u.value?(d(),v(W,{key:1},[m.value?$.value?(d(),v("div",xe,[(d(),H(ne($.value.config),{"model-value":m.value,configure:D.value,"onUpdate:modelValue":e[3]||(e[3]=o=>Z(o))},null,8,["model-value","configure"]))])):(d(),v("div",ke," 未注册的块类型:"+p(m.value.type)+"@"+p(m.value.compatibilityDate),1)):(d(),v("div",pe," 块已不存在 "))],64)):(d(),v("div",ye,[n(l(V),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[L(" "+p(k("modalTitle")),1)]),_:2},[r("modalTitle")?{name:"tooltip",fn:s(()=>[n(l(U),{source:r("modalTitle"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(de),{markdown:"","model-value":i.value.modalTitle,"translate-hint":k("modalTitle"),"onUpdate:modelValue":P},null,8,["model-value","translate-hint"])]),_:1}),c("div",ge,[n(l(V),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[L(" "+p(k("modalWidth")),1)]),_:2},[r("modalWidth")?{name:"tooltip",fn:s(()=>[n(l(U),{source:r("modalWidth"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(X),{"model-value":i.value.modalWidth??"",placeholder:"例:720px / 60vw","onUpdate:modelValue":e[4]||(e[4]=o=>T("modalWidth",String(o)))},null,8,["model-value"])]),_:1}),n(l(V),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[L(" "+p(k("modalMinHeight")),1)]),_:2},[r("modalMinHeight")?{name:"tooltip",fn:s(()=>[n(l(U),{source:r("modalMinHeight"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(X),{"model-value":i.value.modalMinHeight??"",placeholder:"例:400px / 60vh","onUpdate:modelValue":e[5]||(e[5]=o=>T("modalMinHeight",String(o)))},null,8,["model-value"])]),_:1})]),y.value?(d(),v("div",Ue,[n(F,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[13]||(e[13]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",Ve,[n(R,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[14]||(e[14]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[15]||(e[15]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[16]||(e[16]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:z,onDrillDown:C,onDeleteItem:M,onDeleteItems:w},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])):(d(),v("div",Ie,[c("div",Be,[n(l(h),{class:"flex-1"},{default:s(()=>[n(O,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[6]||(e[6]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[7]||(e[7]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(q),{variant:"ghost",size:"sm",onClick:e[8]||(e[8]=o=>S())},{default:s(()=>[n(l(j),{icon:"fluent:add-20-regular",class:"size-4"}),e[18]||(e[18]=c("span",null,"新增布局",-1))]),_:1})]),c("div",be,[n(F,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[9]||(e[9]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",Le,[n(R,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[10]||(e[10]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[11]||(e[11]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[12]||(e[12]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:z,onDrillDown:C,onDeleteItem:M,onDeleteItems:w},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])]))]))],64))}});export{De as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as g,Q as d,a3 as u,aA as f,z as m,I as s,H as i,b as r,a as p,U as _,W as v,X as x,a2 as h,T,e as V}from"./index-CHzOsSTW.js";const C={class:"flex flex-col gap-3"},k=g({name:"ShwfedEventDispatchActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(l){const t=d(l,"modelValue"),o=u(f(),"triggers")??"触发的操作",n=V(()=>t.value.triggers??[]);function c(a){const e={...t.value};a.length===0?Reflect.deleteProperty(e,"triggers"):e.triggers=a,t.value=e}return(a,e)=>(p(),m("div",C,[s(r(T),{orientation:"vertical"},{default:i(()=>[s(r(_),{class:"text-xs text-zinc-500"},{default:i(()=>[v(x(r(o)),1)]),_:1}),s(h,{triggers:n.value,"onUpdate:triggers":c},null,8,["triggers"])]),_:1})]))}});export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as
|
|
1
|
+
import{d as y,Q as U,a5 as w,z as v,I as e,H as n,b as s,S as _,K as F,a1 as H,a as E,U as c,V as u,W as d,X as p,J as m,Y as f,T as x,a2 as N,a3 as R,a4 as j}from"./index-CHzOsSTW.js";const k={class:"flex flex-col gap-3"},D={class:"flex items-start gap-2"},$={class:"grid grid-cols-2 gap-3"},B=y({name:"ShwfedHttpRequestActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(h){const o=U(h,"modelValue"),g=w(()=>{}),i=t=>R(g,t)??t,r=t=>j(g,t),S=["onSuccess","onWarning","onError","onInfo"];function T(t){const l={...o.value};t.length===0?delete l.messageExpression:l.messageExpression=t,o.value=l}function b(t){const l={...o.value};t.length===0?delete l.resultExpression:l.resultExpression=t,o.value=l}function V(t,l){const a={...o.value};l.length===0?Reflect.deleteProperty(a,t):a[t]=l,o.value=a}return(t,l)=>(E(),v("div",k,[e(s(x),{orientation:"vertical"},{default:n(()=>[e(s(c),{class:"text-xs text-zinc-500"},u({default:n(()=>[d(" "+p(i("expression")),1)]),_:2},[r("expression")?{name:"tooltip",fn:n(()=>[e(s(m),{source:r("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(f),{"model-value":o.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":l[0]||(l[0]=a=>o.value={...o.value,expression:a})},null,8,["model-value"])]),_:1}),_("div",D,[e(s(x),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[e(s(c),{class:"text-xs text-zinc-500"},u({default:n(()=>[d(" "+p(i("messageExpression")),1)]),_:2},[r("messageExpression")?{name:"tooltip",fn:n(()=>[e(s(m),{source:r("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(f),{"model-value":o.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":T},null,8,["model-value"])]),_:1}),e(s(x),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[e(s(c),{class:"text-xs text-zinc-500"},u({default:n(()=>[d(" "+p(i("resultExpression")),1)]),_:2},[r("resultExpression")?{name:"tooltip",fn:n(()=>[e(s(m),{source:r("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(f),{"model-value":o.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":b},null,8,["model-value"])]),_:1})]),_("div",$,[(E(),v(F,null,H(S,a=>e(s(x),{key:a,orientation:"vertical",class:"min-w-0"},{default:n(()=>[e(s(c),{class:"text-xs text-zinc-500"},u({default:n(()=>[d(" "+p(i(a)),1)]),_:2},[r(a)?{name:"tooltip",fn:n(()=>[e(s(m),{source:r(a),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(N,{triggers:o.value[a]??[],"onUpdate:triggers":z=>V(a,z)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as y,a as z,z as E,x as V,O as T,b as e,P as U,Q as $,R as j,c as F,H as l,S as v,I as s,T as d,U as u,V as p,W as m,X as f,J as g,Y as b,Z as h,$ as B,a0 as C,K as H,a1 as N,a2 as O,a3 as R,a4 as D}from"./index-CHzOsSTW.js";const P=y({__name:"FieldGroup",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(_){const r=_;return(x,i)=>(z(),E("div",{"data-slot":"field-group",class:T(e(U)("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",r.class))},[V(x.$slots,"default")],2))}}),q={class:"grid grid-cols-2 gap-4"},I={class:"grid grid-cols-2 gap-4"},J={class:"flex items-start gap-2"},L={class:"grid grid-cols-2 gap-3"},M=y({name:"ShwfedHttpRequestConfirmActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const r=$(_,"modelValue"),x=j(()=>{}),i=n=>R(x,n)??n,a=n=>D(x,n);function c(n){const t={...r.value,...n};for(const[o,k]of Object.entries(n))k===void 0&&Reflect.deleteProperty(t,o);r.value=t}const S=["onSuccess","onWarning","onError","onInfo"];function w(n,t){c({[n]:t.length===0?void 0:t})}return(n,t)=>(z(),F(e(P),null,{default:l(()=>[v("div",q,[s(e(d),{orientation:"vertical"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("expression")),1)]),_:2},[a("expression")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(b),{"model-value":r.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":t[0]||(t[0]=o=>c({expression:o}))},null,8,["model-value"])]),_:1}),s(e(d),{orientation:"vertical"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("markdown")),1)]),_:2},[a("markdown")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("markdown"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(h),{markdown:"","model-value":r.value.markdown,"onUpdate:modelValue":t[1]||(t[1]=o=>c({markdown:o}))},null,8,["model-value"])]),_:1})]),v("div",I,[s(e(d),{orientation:"vertical"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("icon")),1)]),_:2},[a("icon")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("icon"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(B),{"model-value":r.value.icon??"","onUpdate:modelValue":t[2]||(t[2]=o=>c(o.trim()===""?{icon:void 0}:{icon:o}))},null,8,["model-value"])]),_:1}),s(e(d),{orientation:"vertical"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("color")),1)]),_:2},[a("color")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("color"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(C),{"model-value":r.value.color??"","onUpdate:modelValue":t[3]||(t[3]=o=>c(o.trim()===""?{color:void 0}:{color:o}))},null,8,["model-value"])]),_:1})]),v("div",J,[s(e(d),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("messageExpression")),1)]),_:2},[a("messageExpression")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(b),{"model-value":r.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[4]||(t[4]=o=>c({messageExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1}),s(e(d),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("resultExpression")),1)]),_:2},[a("resultExpression")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(b),{"model-value":r.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[5]||(t[5]=o=>c({resultExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1})]),v("div",L,[(z(),E(H,null,N(S,o=>s(e(d),{key:o,orientation:"vertical",class:"min-w-0"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i(o)),1)]),_:2},[a(o)?{name:"tooltip",fn:l(()=>[s(e(g),{source:a(o),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(O,{triggers:r.value[o]??[],"onUpdate:triggers":k=>w(o,k)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]),_:1}))}});export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as _,Q as y,a6 as x,a7 as b,z as c,S as i,I as n,H as o,b as t,a as l,a8 as v,a9 as u,aa as g,ab as D,K as S,a1 as h,c as $,ac as k,X as p,ad as w}from"./index-CHzOsSTW.js";const z={class:"flex flex-col gap-3"},B={class:"flex-1"},C={class:"ml-auto text-xs tabular-nums text-zinc-400"},I=_({name:"ShwfedPrototypeActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(m){const r=y(m,"modelValue"),d=(()=>{const s=new Map;for(const e of x){if(e.type===b||e.deprecated)continue;const a=s.get(e.type);(!a||e.compatibilityDate>a.compatibilityDate)&&s.set(e.type,{type:e.type,compatibilityDate:e.compatibilityDate,name:e.metadata.name,icon:e.metadata.icon})}return[...s.values()].sort((e,a)=>e.name.localeCompare(a.name,"zh"))})();function f(s,e){r.value={type:s,compatibilityDate:e}}return(s,e)=>(l(),c("div",z,[e[0]||(e[0]=i("p",{class:"text-xs text-zinc-500"}," 原型按钮点击后无任何副作用,用于占位。选择下方任意类型可将其转换为正式按钮 —— 此转换仅能进行一次。 ",-1)),n(t(w),null,{default:o(()=>[n(t(v),{align:"inline-start"},{default:o(()=>[n(t(u),{icon:"fluent:arrow-swap-20-regular"})]),_:1}),n(t(g),null,{default:o(()=>[n(t(D),null,{default:o(()=>[(l(!0),c(S,null,h(t(d),a=>(l(),$(t(k),{key:a.type,value:a.type,onSelect:V=>f(a.type,a.compatibilityDate)},{default:o(()=>[n(t(u),{icon:a.icon,class:"size-4 shrink-0"},null,8,["icon"]),i("span",B,p(a.name),1),i("span",C,p(a.compatibilityDate),1)]),_:2},1032,["value","onSelect"]))),128))]),_:1})]),_:1})]),_:1})]))}});export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as k,
|
|
1
|
+
import{d as k,Q as V,ae as b,z as m,I as e,H as l,b as a,a as f,U as _,V as v,W as u,X as r,J as p,Y as S,T as x,af as h,ag as y,ah as z,ai as T,K as w,a1 as D,aj as N,a3 as C,a4 as F}from"./index-CHzOsSTW.js";const M={class:"flex flex-col gap-3"},U=k({name:"ShwfedNavigationActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(g){const t=V(g,"modelValue"),c=b(()=>{}),d=o=>C(c,o)??o,n=o=>F(c,o),$=[{value:"_self",label:"当前页面打开"},{value:"_blank",label:"新页面打开"}];return(o,i)=>(f(),m("div",M,[e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[u(" "+r(d("url")),1)]),_:2},[n("url")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("url"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(S),{"model-value":t.value.url??"",placeholder:"例:'/detail/' + string(row.id)","result-type":"string",class:"min-h-10","onUpdate:modelValue":i[0]||(i[0]=s=>t.value={...t.value,url:s})},null,8,["model-value"])]),_:1}),e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[u(" "+r(d("mode")),1)]),_:2},[n("mode")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("mode"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(h),{"model-value":t.value.mode??"_self","onUpdate:modelValue":i[1]||(i[1]=s=>t.value={...t.value,mode:s})},{default:l(()=>[e(a(y),{class:"w-full"},{default:l(()=>[e(a(z))]),_:1}),e(a(T),null,{default:l(()=>[(f(),m(w,null,D($,s=>e(a(N),{key:s.value,value:s.value},{default:l(()=>[u(r(s.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])]),_:1})]))}});export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as
|
|
1
|
+
import{d as U,Q as k,aB as y,z as w,S as x,I as t,H as n,b as s,K as D,a1 as C,a as z,U as i,W as u,J as c,Y as d,T as p,aC as g,V as f,X as _,a2 as F,a3 as H,a4 as B,e as S}from"./index-CHzOsSTW.js";const L={class:"flex flex-col gap-3"},N={class:"grid grid-cols-2 gap-3"},$={class:"flex items-start gap-2"},I={class:"grid grid-cols-2 gap-3"},A=U({name:"ShwfedHttpDownloadActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(q){const l=k(q,"modelValue"),E=y(()=>{}),m=a=>H(E,a)??a,r=a=>B(E,a),T=["onSuccess","onWarning","onError","onInfo"],h=S({get:()=>l.value.template?.request??"",set:a=>{l.value={...l.value,template:{...l.value.template,request:a}}}}),V=S({get:()=>l.value.template?.download??"",set:a=>{const e=l.value.template??{request:""};if(a.length===0){const{download:o,...v}=e;l.value={...l.value,template:v}}else l.value={...l.value,template:{...e,download:a}}}});function b(a){const e={...l.value};a.length===0?delete e.messageExpression:e.messageExpression=a,l.value=e}function j(a){const e={...l.value};a.length===0?delete e.resultExpression:e.resultExpression=a,l.value=e}function R(a,e){const o={...l.value};e.length===0?Reflect.deleteProperty(o,a):o[a]=e,l.value=o}return(a,e)=>(z(),w("div",L,[x("div",N,[t(s(p),{orientation:"vertical"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},{tooltip:n(()=>[t(s(c),{source:r("template")??"返回 `HttpRequest` 的 CEL 表达式;未配置「下载请求」时直接下载其响应",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:n(()=>[e[2]||(e[2]=u(" 请求 ",-1))]),_:1}),t(s(d),{"model-value":h.value,multiline:"",placeholder:"例:http.get('https://api.example.com/files/123')","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":e[0]||(e[0]=o=>h.value=o)},null,8,["model-value"])]),_:1}),t(s(p),{orientation:"vertical"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},{tooltip:n(()=>[t(s(c),{source:"可选的第二步:用第一步响应 `json` 中的凭据构造真正的下载请求,例如 `json.data.key`",block:"",class:"prose prose-sm prose-zinc"})]),default:n(()=>[e[3]||(e[3]=u(" 下载请求 ",-1))]),_:1}),t(s(d),{"model-value":V.value,multiline:"",placeholder:"例:http.get('https://api.example.com/download').query('key', json.data.key)","result-type":"HttpRequest","extra-vars":{json:s(g)},class:"min-h-16","onUpdate:modelValue":e[1]||(e[1]=o=>V.value=o)},null,8,["model-value","extra-vars"])]),_:1})]),x("div",$,[t(s(p),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m("messageExpression")),1)]),_:2},[r("messageExpression")?{name:"tooltip",fn:n(()=>[t(s(c),{source:r("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(s(d),{"model-value":l.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:s(g)},"onUpdate:modelValue":b},null,8,["model-value","extra-vars"])]),_:1}),t(s(p),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m("resultExpression")),1)]),_:2},[r("resultExpression")?{name:"tooltip",fn:n(()=>[t(s(c),{source:r("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(s(d),{"model-value":l.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:s(g)},"onUpdate:modelValue":j},null,8,["model-value","extra-vars"])]),_:1})]),x("div",I,[(z(),w(D,null,C(T,o=>t(s(p),{key:o,orientation:"vertical",class:"min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m(o)),1)]),_:2},[r(o)?{name:"tooltip",fn:n(()=>[t(s(c),{source:r(o),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(F,{triggers:l.value[o]??[],"onUpdate:triggers":v=>R(o,v)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as v,
|
|
1
|
+
import{d as v,Q as S,aD as h,a as V,z as k,I as s,H as l,b as t,U as r,V as u,W as d,X as p,J as m,Y as T,T as f,a2 as y,a3 as z,a4 as w}from"./index-CHzOsSTW.js";const D={class:"flex flex-col gap-3"},b=v({name:"ShwfedStateWriteActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const o=S(_,"modelValue"),i=h(()=>{}),c=e=>z(i,e)??e,n=e=>w(i,e);function g(e){const a={...o.value};e.length===0?Reflect.deleteProperty(a,"onSuccess"):a.onSuccess=e,o.value=a}return(e,a)=>(V(),k("div",D,[s(t(f),{orientation:"vertical"},{default:l(()=>[s(t(r),{class:"text-xs text-zinc-500"},u({default:l(()=>[d(" "+p(c("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:l(()=>[s(t(m),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(t(T),{"model-value":o.value.expression,multiline:"",placeholder:"例:{ invoices: rows, totalAmount: rows.map(r, r.amount).sum() }","result-type":"map",class:"min-h-16","onUpdate:modelValue":a[0]||(a[0]=x=>o.value={...o.value,expression:x})},null,8,["model-value"])]),_:1}),s(t(f),{orientation:"vertical"},{default:l(()=>[s(t(r),{class:"text-xs text-zinc-500"},u({default:l(()=>[d(" "+p(c("onSuccess")),1)]),_:2},[n("onSuccess")?{name:"tooltip",fn:l(()=>[s(t(m),{source:n("onSuccess"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(y,{triggers:o.value.onSuccess??[],"onUpdate:triggers":g},null,8,["triggers"])]),_:1})]))}});export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as f,a_ as u,o as m,a$ as p,am as g,L as l,y,b0 as I}from"./index-CHzOsSTW.js";const w=f({name:"ShwfedActionDefinition",inheritAttrs:!1,__name:"definition",props:{actionId:{},effect:{}},setup(r){const n=r,a=u(),t=y(I,void 0),i=crypto.randomUUID(),c=import.meta.dev;let e,s=!1;function d(){!c||s||(s=!0,console.warn("[shwfed-action-definition] must be used inside <shwfed-actions>."))}function o(){if(!t){d();return}e&&e!==n.actionId&&t.unregisterAction(e,i),t.registerAction({ownerId:i,actionId:n.actionId,effect:n.effect,render:a.default}),e=n.actionId}return o(),m(()=>{o()}),p(()=>{o()}),g(()=>{!t||!e||t.unregisterAction(e,i)}),(_,A)=>l("",!0)}});export{w as _};
|