@shwfed/config 2.11.1 → 2.11.5
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 +1592 -1220
- package/dist/module.json +1 -1
- package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-CosmpPSu.js → FieldGroup.vue_vue_type_script_setup_true_lang-BK4nj6mF.js} +1 -1
- package/dist/preview/assets/{badge-BkYCxTFK.js → badge-Df9KgnrB.js} +1 -1
- package/dist/preview/assets/config-B3NwVBxT.js +1 -0
- package/dist/preview/assets/{config-Dt8k1gnT.js → config-BrtNnMlJ.js} +1 -1
- package/dist/preview/assets/{config-Cbp7aAAw.js → config-CUJNegvX.js} +1 -1
- package/dist/preview/assets/{config-C_Ia1CDq.js → config-ChrXUmKf.js} +1 -1
- package/dist/preview/assets/{config-B62b9dMF.js → config-CmEXMpIU.js} +1 -1
- package/dist/preview/assets/{config-Dk9OegYx.js → config-CrBoFiYB.js} +1 -1
- package/dist/preview/assets/{config-74YmXQsH.js → config-D-Hf0dls.js} +1 -1
- package/dist/preview/assets/{config-Bt6--diX.js → config-D4cXwy75.js} +1 -1
- package/dist/preview/assets/{config-BcZe-bR9.js → config-DCj5Qyiq.js} +1 -1
- package/dist/preview/assets/{config-sCP15_0f.js → config-DPfx03nM.js} +1 -1
- package/dist/preview/assets/{config-Bbbyd5lB.js → config-DWF0bcmF.js} +1 -1
- package/dist/preview/assets/{config-CPsd0ppi.js → config-Do4K9hI7.js} +1 -1
- package/dist/preview/assets/config-DwblM1r8.js +1 -0
- package/dist/preview/assets/{config-CYVafGLc.js → config-MW5Hs8yE.js} +1 -1
- package/dist/preview/assets/{config-COr2MFhN.js → config-uNoNEc-1.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-C3NiB99t.js → definition.vue_vue_type_script_setup_true_lang-CbtpddWK.js} +1 -1
- package/dist/preview/assets/index-Bm7I4Tr0.css +1 -0
- package/dist/preview/assets/{index-DjG-VVR4.js → index-CkyV576r.js} +217 -205
- package/dist/preview/assets/{index-BMOizF8g.js → index-CtW2E0ME.js} +1 -1
- package/dist/preview/assets/index-xDmBF3zO.js +1 -0
- package/dist/preview/assets/{item-C1efxuFt.js → item-D0e9Cx1Q.js} +1 -1
- package/dist/preview/assets/{runtime-Du0ghzR2.js → runtime-3tGIbclh.js} +1 -1
- package/dist/preview/assets/{runtime-7z9N9JGG.js → runtime-BCePD3XR.js} +1 -1
- package/dist/preview/assets/runtime-BMyFUaSM.js +1 -0
- package/dist/preview/assets/runtime-BXZU3EqA.js +1 -0
- package/dist/preview/assets/{runtime-LgZuN2Tf.js → runtime-BySNFNSO.js} +1 -1
- package/dist/preview/assets/{runtime-Dz7SCudL.js → runtime-CI02gDFj.js} +1 -1
- package/dist/preview/assets/{runtime-DoLpKFu-.js → runtime-DCo1Qp8a.js} +1 -1
- package/dist/preview/assets/runtime-DDSKV70N.js +1 -0
- package/dist/preview/assets/runtime-Dc7pytUy.js +1 -0
- package/dist/preview/assets/{runtime-S9eZ2nJS.js → runtime-ckLrkTMm.js} +1 -1
- package/dist/preview/assets/runtime-y4oJ8VkY.js +1 -0
- package/dist/preview/assets/{schema-meta-CYKPEnu9.js → schema-meta-D0y0sKal.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/config.d.vue.ts +39 -0
- package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/config.vue +127 -0
- package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/config.vue.d.ts +39 -0
- package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/runtime.vue +62 -0
- package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/schema.d.ts +25 -0
- package/dist/runtime/components/actions/buttons/2026-06-25/com.shwfed.actions.button.state.write/schema.js +41 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.vue +5 -22
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/config.d.vue.ts +70 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/config.vue +349 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/config.vue.d.ts +70 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/loop-item.d.vue.ts +33 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/loop-item.vue +37 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/loop-item.vue.d.ts +33 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/loop-scope-provider.d.vue.ts +13 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/loop-scope-provider.vue +22 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/loop-scope-provider.vue.d.ts +13 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/runtime.d.vue.ts +70 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/runtime.vue +62 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/runtime.vue.d.ts +70 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/schema.d.ts +85 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/schema.js +60 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +4 -4
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +2 -19
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +5 -22
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/config.d.vue.ts +2 -0
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/config.vue +49 -22
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/config.vue.d.ts +2 -0
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/runtime.js +17 -10
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.d.ts +1 -0
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.js +25 -3
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/runtime.vue +5 -1
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/runtime.vue +5 -1
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.vue +81 -2
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.vue +35 -1
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.d.ts +132 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.js +28 -2
- package/dist/runtime/components/ui/date-picker/DatePicker.d.vue.ts +11 -1
- package/dist/runtime/components/ui/date-picker/DatePicker.vue +8 -1
- package/dist/runtime/components/ui/date-picker/DatePicker.vue.d.ts +11 -1
- package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +12 -2
- package/dist/runtime/components/ui/date-picker/DatePickerInput.vue +4 -0
- package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +12 -2
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +1 -1
- package/dist/runtime/share/loop-item-var.d.ts +21 -0
- package/dist/runtime/share/loop-item-var.js +13 -0
- package/dist/runtime/vendor/cel-js/CLAUDE.md +2 -2
- package/dist/runtime/vendor/cel-js/PROMPT.md +7 -0
- package/dist/runtime/vendor/cel-js/lib/functions.js +25 -1
- package/dist/runtime/vendor/cel-js/lib/http-builder.d.ts +38 -3
- package/dist/runtime/vendor/cel-js/lib/http-builder.js +33 -0
- package/package.json +1 -1
- package/dist/preview/assets/config-BHYlKhDX.js +0 -1
- package/dist/preview/assets/index-C9G8y6qZ.js +0 -1
- package/dist/preview/assets/index-DqRQ67sX.css +0 -1
- package/dist/preview/assets/runtime-Bpa1zRxG.js +0 -1
- package/dist/preview/assets/runtime-Csv04MYG.js +0 -1
- package/dist/preview/assets/runtime-D0bjM4NL.js +0 -1
- package/dist/preview/assets/runtime-Dz3ZQYdq.js +0 -1
|
@@ -11,6 +11,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
11
11
|
readonly locale: "en" | "ja" | "ko";
|
|
12
12
|
readonly message: string;
|
|
13
13
|
}[]] | undefined;
|
|
14
|
+
readonly resultExpression?: string | undefined;
|
|
14
15
|
readonly expression: string;
|
|
15
16
|
readonly titleExpression?: string | undefined;
|
|
16
17
|
}) => any;
|
|
@@ -23,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
23
24
|
readonly locale: "en" | "ja" | "ko";
|
|
24
25
|
readonly message: string;
|
|
25
26
|
}[]] | undefined;
|
|
27
|
+
readonly resultExpression?: string | undefined;
|
|
26
28
|
readonly expression: string;
|
|
27
29
|
readonly titleExpression?: string | undefined;
|
|
28
30
|
}) => any) | undefined;
|
package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/runtime.js
CHANGED
|
@@ -10,6 +10,7 @@ class HttpRequestHalted {
|
|
|
10
10
|
}
|
|
11
11
|
_tag = "HttpRequestHalted";
|
|
12
12
|
}
|
|
13
|
+
const TOAST_STYLES = /* @__PURE__ */ new Set(["success", "error", "warning", "info"]);
|
|
13
14
|
function saveFile(file) {
|
|
14
15
|
const url = URL.createObjectURL(file);
|
|
15
16
|
const a = document.createElement("a");
|
|
@@ -21,28 +22,34 @@ function saveFile(file) {
|
|
|
21
22
|
URL.revokeObjectURL(url);
|
|
22
23
|
}
|
|
23
24
|
export const handler = (params, ctx) => {
|
|
24
|
-
const { expression, titleExpression, description } = params ?? {};
|
|
25
|
+
const { expression, resultExpression, titleExpression, description } = params ?? {};
|
|
25
26
|
if (!expression || expression.trim().length === 0) return Effect.void;
|
|
26
27
|
const program = Effect.gen(function* () {
|
|
27
28
|
const steps = ctx.step?.outputs() ?? {};
|
|
28
29
|
const evaluated = yield* ctx.cel(expression, { steps });
|
|
29
30
|
const request = asRequest(evaluated);
|
|
30
31
|
if (Option.isNone(request)) return;
|
|
31
|
-
const outcome = yield* Effect.either(request.value.
|
|
32
|
-
const
|
|
32
|
+
const outcome = yield* Effect.either(request.value.fileOrJson());
|
|
33
|
+
const json = Either.isRight(outcome) && outcome.right._tag === "json" ? outcome.right.json : null;
|
|
34
|
+
const result = Either.isLeft(outcome) ? "error" : outcome.right._tag === "file" ? "success" : resultExpression === void 0 ? "error" : yield* ctx.cel(resultExpression, { json, steps });
|
|
35
|
+
const kind = TOAST_STYLES.has(result) ? result : "success";
|
|
33
36
|
if (titleExpression !== void 0) {
|
|
34
|
-
const title = yield* ctx.cel(titleExpression, { result, steps });
|
|
37
|
+
const title = yield* ctx.cel(titleExpression, { json, result, steps });
|
|
35
38
|
if (title.length > 0) {
|
|
36
39
|
const raw = getLocalizedText(description, ctx.locale()) ?? "";
|
|
37
|
-
const body = raw.length === 0 ? void 0 : interpolateMarkdown(raw, ctx.cel, { result, steps });
|
|
38
|
-
toast[
|
|
40
|
+
const body = raw.length === 0 ? void 0 : interpolateMarkdown(raw, ctx.cel, { json, result, steps });
|
|
41
|
+
toast[kind](title, body === void 0 ? void 0 : { description: body });
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
if (Either.isLeft(outcome)) {
|
|
42
45
|
if (import.meta.dev) console.warn("[shwfed-operations] http download failed", outcome.left);
|
|
43
46
|
return yield* Effect.die(new HttpRequestHalted(outcome.left));
|
|
44
47
|
}
|
|
45
|
-
yield* Effect.
|
|
48
|
+
if (kind === "error") return yield* Effect.die(new HttpRequestHalted("error result"));
|
|
49
|
+
if (outcome.right._tag === "file") {
|
|
50
|
+
const { file } = outcome.right;
|
|
51
|
+
yield* Effect.sync(() => saveFile(file));
|
|
52
|
+
}
|
|
46
53
|
});
|
|
47
54
|
return program.pipe(
|
|
48
55
|
// The bus's handler contract has no requirements channel, so the host can't
|
|
@@ -50,9 +57,9 @@ export const handler = (params, ctx) => {
|
|
|
50
57
|
// button runner uses.
|
|
51
58
|
Effect.provide(Fetch.layer),
|
|
52
59
|
// What remains on the error channel is CEL evaluation failure (request /
|
|
53
|
-
// title expression) — a config bug, not a runtime outcome. Mirror
|
|
54
|
-
// request op: silent in prod, console in dev; the chain still halts so
|
|
55
|
-
// operations don't fire off a broken step.
|
|
60
|
+
// result / title expression) — a config bug, not a runtime outcome. Mirror
|
|
61
|
+
// the request op: silent in prod, console in dev; the chain still halts so
|
|
62
|
+
// later operations don't fire off a broken step.
|
|
56
63
|
Effect.catchAll((error) => Effect.zipRight(
|
|
57
64
|
Effect.sync(() => {
|
|
58
65
|
if (import.meta.dev) console.warn("[shwfed-operations] http download op failed", error);
|
package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const metadata: {
|
|
|
8
8
|
};
|
|
9
9
|
export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
|
|
10
10
|
expression: Schema.Schema<string, string, never>;
|
|
11
|
+
resultExpression: Schema.optional<Schema.Schema<string, string, never>>;
|
|
11
12
|
titleExpression: Schema.optional<Schema.Schema<string, string, never>>;
|
|
12
13
|
description: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
13
14
|
locale: Schema.Literal<["zh"]>;
|
package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.js
CHANGED
|
@@ -18,10 +18,20 @@ export function schema(configure) {
|
|
|
18
18
|
registerStepsVariableIfAbsent(env);
|
|
19
19
|
};
|
|
20
20
|
const CelHttpRequest = Expression({ configure: withSteps, resultType: "HttpRequest" });
|
|
21
|
+
const withJson = (env) => {
|
|
22
|
+
withSteps(env);
|
|
23
|
+
env.registerVariable("json", "dyn", {
|
|
24
|
+
description: "\u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF1B\u4EC5\u5F53\u54CD\u5E94\u4E3A JSON \u65F6\u5B58\u5728\uFF09"
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const CelResultString = Expression({ configure: withJson, resultType: "string" });
|
|
21
28
|
const withOutcome = (env) => {
|
|
22
29
|
withSteps(env);
|
|
30
|
+
env.registerVariable("json", "dyn", {
|
|
31
|
+
description: "\u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF1B\u54CD\u5E94\u975E JSON \u6216\u8BF7\u6C42\u5931\u8D25\u65F6\u4E3A null\uFF09"
|
|
32
|
+
});
|
|
23
33
|
env.registerVariable("result", "string", {
|
|
24
|
-
description: "\u6267\u884C\u7ED3\u679C\
|
|
34
|
+
description: "\u300C\u6267\u884C\u7ED3\u679C\u300D\u8868\u8FBE\u5F0F\u7684\u503C\uFF08\u8BF7\u6C42\u5931\u8D25\u65F6\u4E3A error\uFF09"
|
|
25
35
|
});
|
|
26
36
|
};
|
|
27
37
|
const CelToastString = Expression({ configure: withOutcome, resultType: "string" });
|
|
@@ -34,6 +44,17 @@ export function schema(configure) {
|
|
|
34
44
|
\`发送请求\` 行取得的凭据用于构造真正的下载请求。
|
|
35
45
|
`
|
|
36
46
|
}),
|
|
47
|
+
resultExpression: Schema.optional(CelResultString.annotations({
|
|
48
|
+
title: "\u6267\u884C\u7ED3\u679C",
|
|
49
|
+
description: md`
|
|
50
|
+
仅当响应为 JSON(\`application/json\`)时求值——下载本应返回二进制文件,
|
|
51
|
+
响应为 JSON 通常意味着后端返回了错误信封(常见为 HTTP 200 + \`{ "code": -1 }\`)。
|
|
52
|
+
需返回 \`'success' | 'warning' | 'error' | 'info'\` 中的**一个**,如
|
|
53
|
+
\`json.code == 0 ? 'success' : 'error'\`。\`error\` 中止本次触发链。
|
|
54
|
+
不配置时,JSON 响应一律按 \`error\` 处理(多数情况即如此,但你可经此表达式自行裁定)。
|
|
55
|
+
网络错误 / 非 2xx 等情况下,恒按 \`error\` 处理。
|
|
56
|
+
`
|
|
57
|
+
})),
|
|
37
58
|
titleExpression: Schema.optional(CelToastString.annotations({
|
|
38
59
|
title: "\u63D0\u793A\u6807\u9898",
|
|
39
60
|
description: md`
|
|
@@ -50,8 +71,9 @@ export function schema(configure) {
|
|
|
50
71
|
}).annotations({
|
|
51
72
|
title: "HttpDownloadOperation",
|
|
52
73
|
description: md`
|
|
53
|
-
发起一次 HTTP
|
|
54
|
-
|
|
74
|
+
发起一次 HTTP 请求:若响应是二进制(非 JSON)则保存为本地文件;若响应是 JSON,
|
|
75
|
+
则视为后端返回的状态信封,经「执行结果」裁定成败而**不**保存。下载失败(网络错误 / 非 2xx)
|
|
76
|
+
或「执行结果」为 \`error\` 会中止本次触发链——其后排队的操作不再执行。把本操作接在一个
|
|
55
77
|
\`发送请求\` 行之后、并经 \`steps["<步骤标识>"]\` 引用其响应,即可实现
|
|
56
78
|
“先取凭据再下载”的两步式。toast 完全由「提示标题」「提示内容」决定(含失败场景);
|
|
57
79
|
不配置标题、或标题求值为空字符串则静默。
|
|
@@ -53,9 +53,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
53
|
readonly locale: "en" | "ja" | "ko";
|
|
54
54
|
readonly message: string;
|
|
55
55
|
}[]];
|
|
56
|
-
readonly sortKey?: string | undefined;
|
|
57
56
|
readonly successMessage?: string | undefined;
|
|
58
57
|
readonly accessor?: string | undefined;
|
|
58
|
+
readonly sortKey?: string | undefined;
|
|
59
59
|
}) => any;
|
|
60
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
61
61
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -108,9 +108,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
108
|
readonly locale: "en" | "ja" | "ko";
|
|
109
109
|
readonly message: string;
|
|
110
110
|
}[]];
|
|
111
|
-
readonly sortKey?: string | undefined;
|
|
112
111
|
readonly successMessage?: string | undefined;
|
|
113
112
|
readonly accessor?: string | undefined;
|
|
113
|
+
readonly sortKey?: string | undefined;
|
|
114
114
|
}) => any) | undefined;
|
|
115
115
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
116
116
|
declare const _default: typeof __VLS_export;
|
|
@@ -53,9 +53,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
53
|
readonly locale: "en" | "ja" | "ko";
|
|
54
54
|
readonly message: string;
|
|
55
55
|
}[]];
|
|
56
|
-
readonly sortKey?: string | undefined;
|
|
57
56
|
readonly successMessage?: string | undefined;
|
|
58
57
|
readonly accessor?: string | undefined;
|
|
58
|
+
readonly sortKey?: string | undefined;
|
|
59
59
|
}) => any;
|
|
60
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
61
61
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -108,9 +108,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
108
|
readonly locale: "en" | "ja" | "ko";
|
|
109
109
|
readonly message: string;
|
|
110
110
|
}[]];
|
|
111
|
-
readonly sortKey?: string | undefined;
|
|
112
111
|
readonly successMessage?: string | undefined;
|
|
113
112
|
readonly accessor?: string | undefined;
|
|
113
|
+
readonly sortKey?: string | undefined;
|
|
114
114
|
}) => any) | undefined;
|
|
115
115
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
116
116
|
declare const _default: typeof __VLS_export;
|
|
@@ -67,9 +67,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
67
67
|
}[]] | undefined;
|
|
68
68
|
readonly readonly?: string | undefined;
|
|
69
69
|
readonly enableSorting?: boolean | undefined;
|
|
70
|
-
readonly sortKey?: string | undefined;
|
|
71
70
|
readonly successMessage?: string | undefined;
|
|
72
71
|
readonly accessor?: string | undefined;
|
|
72
|
+
readonly sortKey?: string | undefined;
|
|
73
73
|
}) => any;
|
|
74
74
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
75
75
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -136,9 +136,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
136
136
|
}[]] | undefined;
|
|
137
137
|
readonly readonly?: string | undefined;
|
|
138
138
|
readonly enableSorting?: boolean | undefined;
|
|
139
|
-
readonly sortKey?: string | undefined;
|
|
140
139
|
readonly successMessage?: string | undefined;
|
|
141
140
|
readonly accessor?: string | undefined;
|
|
141
|
+
readonly sortKey?: string | undefined;
|
|
142
142
|
}) => any) | undefined;
|
|
143
143
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
144
144
|
declare const _default: typeof __VLS_export;
|
|
@@ -67,9 +67,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
67
67
|
}[]] | undefined;
|
|
68
68
|
readonly readonly?: string | undefined;
|
|
69
69
|
readonly enableSorting?: boolean | undefined;
|
|
70
|
-
readonly sortKey?: string | undefined;
|
|
71
70
|
readonly successMessage?: string | undefined;
|
|
72
71
|
readonly accessor?: string | undefined;
|
|
72
|
+
readonly sortKey?: string | undefined;
|
|
73
73
|
}) => any;
|
|
74
74
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
75
75
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -136,9 +136,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
136
136
|
}[]] | undefined;
|
|
137
137
|
readonly readonly?: string | undefined;
|
|
138
138
|
readonly enableSorting?: boolean | undefined;
|
|
139
|
-
readonly sortKey?: string | undefined;
|
|
140
139
|
readonly successMessage?: string | undefined;
|
|
141
140
|
readonly accessor?: string | undefined;
|
|
141
|
+
readonly sortKey?: string | undefined;
|
|
142
142
|
}) => any) | undefined;
|
|
143
143
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
144
144
|
declare const _default: typeof __VLS_export;
|
|
@@ -53,9 +53,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
53
|
readonly locale: "en" | "ja" | "ko";
|
|
54
54
|
readonly message: string;
|
|
55
55
|
}[]];
|
|
56
|
-
readonly sortKey?: string | undefined;
|
|
57
56
|
readonly successMessage?: string | undefined;
|
|
58
57
|
readonly accessor?: string | undefined;
|
|
58
|
+
readonly sortKey?: string | undefined;
|
|
59
59
|
}) => any;
|
|
60
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
61
61
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -108,9 +108,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
108
|
readonly locale: "en" | "ja" | "ko";
|
|
109
109
|
readonly message: string;
|
|
110
110
|
}[]];
|
|
111
|
-
readonly sortKey?: string | undefined;
|
|
112
111
|
readonly successMessage?: string | undefined;
|
|
113
112
|
readonly accessor?: string | undefined;
|
|
113
|
+
readonly sortKey?: string | undefined;
|
|
114
114
|
}) => any) | undefined;
|
|
115
115
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
116
116
|
declare const _default: typeof __VLS_export;
|
|
@@ -53,9 +53,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
53
53
|
readonly locale: "en" | "ja" | "ko";
|
|
54
54
|
readonly message: string;
|
|
55
55
|
}[]];
|
|
56
|
-
readonly sortKey?: string | undefined;
|
|
57
56
|
readonly successMessage?: string | undefined;
|
|
58
57
|
readonly accessor?: string | undefined;
|
|
58
|
+
readonly sortKey?: string | undefined;
|
|
59
59
|
}) => any;
|
|
60
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
61
61
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -108,9 +108,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
108
|
readonly locale: "en" | "ja" | "ko";
|
|
109
109
|
readonly message: string;
|
|
110
110
|
}[]];
|
|
111
|
-
readonly sortKey?: string | undefined;
|
|
112
111
|
readonly successMessage?: string | undefined;
|
|
113
112
|
readonly accessor?: string | undefined;
|
|
113
|
+
readonly sortKey?: string | undefined;
|
|
114
114
|
}) => any) | undefined;
|
|
115
115
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
116
116
|
declare const _default: typeof __VLS_export;
|
|
@@ -67,9 +67,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
67
67
|
}[]] | undefined;
|
|
68
68
|
readonly readonly?: string | undefined;
|
|
69
69
|
readonly enableSorting?: boolean | undefined;
|
|
70
|
-
readonly sortKey?: string | undefined;
|
|
71
70
|
readonly successMessage?: string | undefined;
|
|
72
71
|
readonly accessor?: string | undefined;
|
|
72
|
+
readonly sortKey?: string | undefined;
|
|
73
73
|
}) => any;
|
|
74
74
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
75
75
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -136,9 +136,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
136
136
|
}[]] | undefined;
|
|
137
137
|
readonly readonly?: string | undefined;
|
|
138
138
|
readonly enableSorting?: boolean | undefined;
|
|
139
|
-
readonly sortKey?: string | undefined;
|
|
140
139
|
readonly successMessage?: string | undefined;
|
|
141
140
|
readonly accessor?: string | undefined;
|
|
141
|
+
readonly sortKey?: string | undefined;
|
|
142
142
|
}) => any) | undefined;
|
|
143
143
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
144
144
|
declare const _default: typeof __VLS_export;
|
|
@@ -67,9 +67,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
67
67
|
}[]] | undefined;
|
|
68
68
|
readonly readonly?: string | undefined;
|
|
69
69
|
readonly enableSorting?: boolean | undefined;
|
|
70
|
-
readonly sortKey?: string | undefined;
|
|
71
70
|
readonly successMessage?: string | undefined;
|
|
72
71
|
readonly accessor?: string | undefined;
|
|
72
|
+
readonly sortKey?: string | undefined;
|
|
73
73
|
}) => any;
|
|
74
74
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
75
75
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -136,9 +136,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
136
136
|
}[]] | undefined;
|
|
137
137
|
readonly readonly?: string | undefined;
|
|
138
138
|
readonly enableSorting?: boolean | undefined;
|
|
139
|
-
readonly sortKey?: string | undefined;
|
|
140
139
|
readonly successMessage?: string | undefined;
|
|
141
140
|
readonly accessor?: string | undefined;
|
|
141
|
+
readonly sortKey?: string | undefined;
|
|
142
142
|
}) => any) | undefined;
|
|
143
143
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
144
144
|
declare const _default: typeof __VLS_export;
|
|
@@ -82,9 +82,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
82
82
|
};
|
|
83
83
|
}[];
|
|
84
84
|
};
|
|
85
|
-
readonly sortKey?: string | undefined;
|
|
86
85
|
readonly successMessage?: string | undefined;
|
|
87
86
|
readonly accessor?: string | undefined;
|
|
87
|
+
readonly sortKey?: string | undefined;
|
|
88
88
|
}) => any;
|
|
89
89
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
90
90
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -166,9 +166,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
166
166
|
};
|
|
167
167
|
}[];
|
|
168
168
|
};
|
|
169
|
-
readonly sortKey?: string | undefined;
|
|
170
169
|
readonly successMessage?: string | undefined;
|
|
171
170
|
readonly accessor?: string | undefined;
|
|
171
|
+
readonly sortKey?: string | undefined;
|
|
172
172
|
}) => any) | undefined;
|
|
173
173
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
174
174
|
declare const _default: typeof __VLS_export;
|
|
@@ -82,9 +82,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
82
82
|
};
|
|
83
83
|
}[];
|
|
84
84
|
};
|
|
85
|
-
readonly sortKey?: string | undefined;
|
|
86
85
|
readonly successMessage?: string | undefined;
|
|
87
86
|
readonly accessor?: string | undefined;
|
|
87
|
+
readonly sortKey?: string | undefined;
|
|
88
88
|
}) => any;
|
|
89
89
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
90
90
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -166,9 +166,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
166
166
|
};
|
|
167
167
|
}[];
|
|
168
168
|
};
|
|
169
|
-
readonly sortKey?: string | undefined;
|
|
170
169
|
readonly successMessage?: string | undefined;
|
|
171
170
|
readonly accessor?: string | undefined;
|
|
171
|
+
readonly sortKey?: string | undefined;
|
|
172
172
|
}) => any) | undefined;
|
|
173
173
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
174
174
|
declare const _default: typeof __VLS_export;
|
|
@@ -82,9 +82,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
82
82
|
};
|
|
83
83
|
}[];
|
|
84
84
|
};
|
|
85
|
-
readonly sortKey?: string | undefined;
|
|
86
85
|
readonly successMessage?: string | undefined;
|
|
87
86
|
readonly accessor?: string | undefined;
|
|
87
|
+
readonly sortKey?: string | undefined;
|
|
88
88
|
}) => any;
|
|
89
89
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
90
90
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -166,9 +166,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
166
166
|
};
|
|
167
167
|
}[];
|
|
168
168
|
};
|
|
169
|
-
readonly sortKey?: string | undefined;
|
|
170
169
|
readonly successMessage?: string | undefined;
|
|
171
170
|
readonly accessor?: string | undefined;
|
|
171
|
+
readonly sortKey?: string | undefined;
|
|
172
172
|
}) => any) | undefined;
|
|
173
173
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
174
174
|
declare const _default: typeof __VLS_export;
|
|
@@ -82,9 +82,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
82
82
|
};
|
|
83
83
|
}[];
|
|
84
84
|
};
|
|
85
|
-
readonly sortKey?: string | undefined;
|
|
86
85
|
readonly successMessage?: string | undefined;
|
|
87
86
|
readonly accessor?: string | undefined;
|
|
87
|
+
readonly sortKey?: string | undefined;
|
|
88
88
|
}) => any;
|
|
89
89
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
90
90
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -166,9 +166,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
166
166
|
};
|
|
167
167
|
}[];
|
|
168
168
|
};
|
|
169
|
-
readonly sortKey?: string | undefined;
|
|
170
169
|
readonly successMessage?: string | undefined;
|
|
171
170
|
readonly accessor?: string | undefined;
|
|
171
|
+
readonly sortKey?: string | undefined;
|
|
172
172
|
}) => any) | undefined;
|
|
173
173
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
174
174
|
declare const _default: typeof __VLS_export;
|
|
@@ -125,11 +125,15 @@ const requestSignature = computed(() => {
|
|
|
125
125
|
});
|
|
126
126
|
async function fetchOptions() {
|
|
127
127
|
const seq = ++fetchSeq;
|
|
128
|
-
if (props.column.options.kind !== "remote"
|
|
128
|
+
if (props.column.options.kind !== "remote") {
|
|
129
129
|
remoteJson.value = null;
|
|
130
130
|
remoteLoading.value = false;
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
+
if (requestSignature.value == null) {
|
|
134
|
+
remoteLoading.value = false;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
133
137
|
const expr = props.column.options.request;
|
|
134
138
|
remoteLoading.value = true;
|
|
135
139
|
const program = Effect.gen(function* () {
|
|
@@ -125,11 +125,15 @@ const requestSignature = computed(() => {
|
|
|
125
125
|
});
|
|
126
126
|
async function fetchOptions() {
|
|
127
127
|
const seq = ++fetchSeq;
|
|
128
|
-
if (props.column.options.kind !== "remote"
|
|
128
|
+
if (props.column.options.kind !== "remote") {
|
|
129
129
|
remoteJson.value = null;
|
|
130
130
|
remoteLoading.value = false;
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
+
if (requestSignature.value == null) {
|
|
134
|
+
remoteLoading.value = false;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
133
137
|
const expr = props.column.options.request;
|
|
134
138
|
remoteLoading.value = true;
|
|
135
139
|
const program = Effect.gen(function* () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed } from "vue";
|
|
2
|
+
import { computed, inject, onBeforeUnmount, ref, watch } from "vue";
|
|
3
3
|
import { Icon } from "@iconify/vue";
|
|
4
4
|
import { format as formatDate } from "date-fns";
|
|
5
5
|
import { ExpressionEditor } from "../../../../ui/expression-editor";
|
|
@@ -22,9 +22,13 @@ import {
|
|
|
22
22
|
DropdownMenuItem,
|
|
23
23
|
DropdownMenuTrigger
|
|
24
24
|
} from "../../../../ui/dropdown-menu";
|
|
25
|
+
import ActionsConfigEditor from "../../../../actions/config.vue";
|
|
25
26
|
import { getStructFieldDescription, getStructFieldTitle } from "../../../utils/schema-meta";
|
|
26
27
|
import { Markdown } from "../../../../ui/markdown";
|
|
27
28
|
import DerivedValueEditor from "../../../../form/DerivedValueEditor.vue";
|
|
29
|
+
import { TABLE_COLUMN_LAYOUT_KEY } from "../../../column-layout";
|
|
30
|
+
import { BREADCRUMB_EXTENSION_KEY } from "../../../../config/breadcrumb-extension";
|
|
31
|
+
import { registerRowVariablesIfAbsent } from "../../../utils/shared";
|
|
28
32
|
import { presetSchema, schema } from "./schema";
|
|
29
33
|
defineOptions({ name: "ShwfedTableDateInputRendererConfig" });
|
|
30
34
|
const value = defineModel({ type: Object, ...{ required: true } });
|
|
@@ -48,6 +52,47 @@ const ROW_VARS = {
|
|
|
48
52
|
row: { type: "dyn", label: "\u5F53\u524D\u884C\u6570\u636E" },
|
|
49
53
|
index: { type: "number", label: "\u884C\u7D22\u5F15" }
|
|
50
54
|
};
|
|
55
|
+
const layout = inject(TABLE_COLUMN_LAYOUT_KEY, null);
|
|
56
|
+
const breadcrumbExt = inject(BREADCRUMB_EXTENSION_KEY, null);
|
|
57
|
+
const editingAddon = ref(false);
|
|
58
|
+
function closeAddon() {
|
|
59
|
+
editingAddon.value = false;
|
|
60
|
+
}
|
|
61
|
+
const addonCrumb = breadcrumbExt?.add();
|
|
62
|
+
watch(editingAddon, (on) => {
|
|
63
|
+
if (layout) layout.fullPane.value = on;
|
|
64
|
+
if (addonCrumb) {
|
|
65
|
+
addonCrumb.label.value = on ? "\u8F93\u5165\u6846\u5185\u6309\u94AE" : null;
|
|
66
|
+
addonCrumb.back.value = on ? closeAddon : null;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
onBeforeUnmount(() => {
|
|
70
|
+
if (layout) layout.fullPane.value = false;
|
|
71
|
+
addonCrumb?.dispose();
|
|
72
|
+
});
|
|
73
|
+
const addonItemCount = computed(() => value.value.addon?.items.length ?? 0);
|
|
74
|
+
const addonValue = computed({
|
|
75
|
+
get: () => ({
|
|
76
|
+
kind: "shwfed.component.action",
|
|
77
|
+
size: value.value.addon?.size ?? "xs",
|
|
78
|
+
gap: value.value.addon?.gap ?? 4,
|
|
79
|
+
style: value.value.addon?.style,
|
|
80
|
+
groups: value.value.addon?.groups ?? [],
|
|
81
|
+
items: value.value.addon?.items ?? []
|
|
82
|
+
}),
|
|
83
|
+
set: (next) => {
|
|
84
|
+
const { size, gap, style, groups, items } = next;
|
|
85
|
+
if (groups.length === 0 && items.length === 0) {
|
|
86
|
+
const { addon: _omit, ...rest } = value.value;
|
|
87
|
+
value.value = rest;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
value.value = {
|
|
91
|
+
...value.value,
|
|
92
|
+
addon: { size, gap, groups, items, ...style === void 0 ? {} : { style } }
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
51
96
|
const presets = computed(() => value.value.presets ?? []);
|
|
52
97
|
function newId() {
|
|
53
98
|
return typeof crypto !== "undefined" && "randomUUID" in crypto ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
@@ -170,7 +215,17 @@ const derivedModel = computed({
|
|
|
170
215
|
</script>
|
|
171
216
|
|
|
172
217
|
<template>
|
|
173
|
-
<
|
|
218
|
+
<ActionsConfigEditor
|
|
219
|
+
v-if="editingAddon"
|
|
220
|
+
v-model="addonValue"
|
|
221
|
+
:configure="registerRowVariablesIfAbsent"
|
|
222
|
+
hide-size
|
|
223
|
+
/>
|
|
224
|
+
|
|
225
|
+
<div
|
|
226
|
+
v-else
|
|
227
|
+
class="space-y-5"
|
|
228
|
+
>
|
|
174
229
|
<div class="grid grid-cols-2 gap-x-6 gap-y-4">
|
|
175
230
|
<Field orientation="vertical">
|
|
176
231
|
<FieldLabel class="text-xs text-zinc-500">
|
|
@@ -574,5 +629,29 @@ const derivedModel = computed({
|
|
|
574
629
|
</div>
|
|
575
630
|
</Field>
|
|
576
631
|
</div>
|
|
632
|
+
<Separator />
|
|
633
|
+
<Field orientation="vertical">
|
|
634
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
635
|
+
<template
|
|
636
|
+
v-if="fieldDescription('addon')"
|
|
637
|
+
#tooltip
|
|
638
|
+
>
|
|
639
|
+
<Markdown
|
|
640
|
+
:source="fieldDescription('addon')"
|
|
641
|
+
block
|
|
642
|
+
class="prose prose-sm prose-zinc"
|
|
643
|
+
/>
|
|
644
|
+
</template>
|
|
645
|
+
{{ fieldTitle("addon") }}
|
|
646
|
+
</FieldLabel>
|
|
647
|
+
<Button
|
|
648
|
+
type="button"
|
|
649
|
+
class="w-full justify-center"
|
|
650
|
+
@click="editingAddon = true"
|
|
651
|
+
>
|
|
652
|
+
<Icon icon="fluent:add-20-regular" />
|
|
653
|
+
<span>{{ addonItemCount > 0 ? "\u914D\u7F6E\u6309\u94AE" : "\u6DFB\u52A0\u6309\u94AE" }}</span>
|
|
654
|
+
</Button>
|
|
655
|
+
</Field>
|
|
577
656
|
</div>
|
|
578
657
|
</template>
|
|
@@ -8,6 +8,8 @@ import { celBindings, injectCELContext } from "../../../../../utils/cel-context"
|
|
|
8
8
|
import { useFormReadonly } from "../../../../form/utils/readonly";
|
|
9
9
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
10
10
|
import { DATE_PICKER_DEFAULT_FORMATS, DatePicker } from "../../../../ui/date-picker";
|
|
11
|
+
import { InputGroupAddon } from "../../../../ui/input-group";
|
|
12
|
+
import ShwfedActions from "../../../../actions/components/group.vue";
|
|
11
13
|
import { useFormState } from "../../../../form/utils/state";
|
|
12
14
|
import { JUSTIFY_CLASS, TEXT_ALIGN_CLASS } from "../../../utils/runtime";
|
|
13
15
|
defineOptions({ name: "ShwfedTableDateInputRendererRuntime" });
|
|
@@ -59,6 +61,18 @@ const shortcuts = computed(() => {
|
|
|
59
61
|
}
|
|
60
62
|
}));
|
|
61
63
|
});
|
|
64
|
+
const addonConfig = computed(() => {
|
|
65
|
+
const addon = props.column.addon;
|
|
66
|
+
if (!addon || addon.items.length === 0) return null;
|
|
67
|
+
return {
|
|
68
|
+
kind: "shwfed.component.action",
|
|
69
|
+
size: addon.size ?? "xs",
|
|
70
|
+
gap: addon.gap,
|
|
71
|
+
style: addon.style,
|
|
72
|
+
groups: addon.groups.map((group) => ({ ...group, variant: group.variant ?? "ghost" })),
|
|
73
|
+
items: addon.items
|
|
74
|
+
};
|
|
75
|
+
});
|
|
62
76
|
const model = computed({
|
|
63
77
|
get: () => {
|
|
64
78
|
const v = formState.getAt(props.column.binding);
|
|
@@ -111,6 +125,26 @@ const model = computed({
|
|
|
111
125
|
:placeholder="placeholderText"
|
|
112
126
|
:disabled="isDisabled"
|
|
113
127
|
:shortcuts="shortcuts"
|
|
114
|
-
|
|
128
|
+
>
|
|
129
|
+
<!-- `mr-[-0.45rem]` mirrors the clear addon's `has-[>button]:mr-[-0.45rem]`
|
|
130
|
+
pull-back: that compensation only fires when the addon's direct child
|
|
131
|
+
is a `<button>`, but `ShwfedActions` roots a `<div>`, so without it the
|
|
132
|
+
`inline-end` `pr-3` would leave a ~12px dead gap before the border. -->
|
|
133
|
+
<template
|
|
134
|
+
v-if="addonConfig"
|
|
135
|
+
#trailing
|
|
136
|
+
>
|
|
137
|
+
<InputGroupAddon
|
|
138
|
+
align="inline-end"
|
|
139
|
+
class="field-addon-actions mr-[-0.45rem]"
|
|
140
|
+
>
|
|
141
|
+
<ShwfedActions :config="addonConfig" />
|
|
142
|
+
</InputGroupAddon>
|
|
143
|
+
</template>
|
|
144
|
+
</DatePicker>
|
|
115
145
|
</div>
|
|
116
146
|
</template>
|
|
147
|
+
|
|
148
|
+
<style scoped>
|
|
149
|
+
.field-addon-actions :deep([data-slot=buttons]){align-items:center;gap:.125rem}.field-addon-actions :deep([data-slot=buttons-dropdown-trigger]),.field-addon-actions :deep([data-slot=buttons-item]){border-radius:.125rem;color:#71717a;height:1rem;min-width:1rem;padding:0}.field-addon-actions :deep([data-slot=buttons-dropdown-trigger] svg),.field-addon-actions :deep([data-slot=buttons-item] svg){height:.75rem;width:.75rem}.field-addon-actions :deep([data-slot=buttons-dropdown-trigger]:hover:not(:disabled)),.field-addon-actions :deep([data-slot=buttons-item]:hover:not(:disabled)){color:#3f3f46}
|
|
150
|
+
</style>
|