@shwfed/config 2.9.4 → 2.9.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 +558 -102
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -0
- package/dist/preview/assets/FieldGroup.vue_vue_type_script_setup_true_lang-BZCeJsQD.js +1 -0
- package/dist/preview/assets/badge-muf_N5bh.js +1 -0
- package/dist/preview/assets/config-BDWlpbYr.js +1 -0
- package/dist/preview/assets/config-BbrX8RJn.js +1 -0
- package/dist/preview/assets/config-BeW9pIO6.js +1 -0
- package/dist/preview/assets/config-BmmWdZ8T.js +1 -0
- package/dist/preview/assets/config-CX1fFOhS.js +1 -0
- package/dist/preview/assets/config-CZHJLTaX.js +1 -0
- package/dist/preview/assets/config-CoEYHQXh.js +1 -0
- package/dist/preview/assets/config-DkiDpKM2.js +1 -0
- package/dist/preview/assets/config-DygE8cbP.js +1 -0
- package/dist/preview/assets/config-qlTY-CeE.js +1 -0
- package/dist/preview/assets/config-r9XM4u1X.js +1 -0
- package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-BFjgX5YL.js +1 -0
- package/dist/preview/assets/{index-CHkjJPVP.js → index-CHKIlDe0.js} +1 -1
- package/dist/preview/assets/{index-cyMSopN_.js → index-CJHF5AcW.js} +217 -186
- package/dist/preview/assets/index-OJPhCe6w.js +1 -0
- package/dist/preview/assets/index-vPcvbp7e.css +1 -0
- package/dist/preview/assets/item-9Thi-zcK.js +1 -0
- package/dist/preview/assets/runtime-B2Q3DRbZ.js +1 -0
- package/dist/preview/assets/{runtime-Dy1bI4VO.js → runtime-BnExhm-v.js} +1 -1
- package/dist/preview/assets/runtime-BrCQ7TVd.js +1 -0
- package/dist/preview/assets/runtime-BstyXj1z.js +1 -0
- package/dist/preview/assets/runtime-ByhubOtA.js +1 -0
- package/dist/preview/assets/runtime-CE6eAbTE.js +1 -0
- package/dist/preview/assets/runtime-CdDJ6rEl.js +1 -0
- package/dist/preview/assets/runtime-DEHzrByN.js +1 -0
- package/dist/preview/assets/runtime-DM9caqw1.js +1 -0
- package/dist/preview/assets/{runtime-lZLYBBgn.js → runtime-DkLPBvxW.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.d.vue.ts +20 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue.d.ts +20 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.d.ts +22 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.js +33 -1
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.d.vue.ts +20 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue.d.ts +20 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.d.ts +10 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.d.vue.ts +4 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.vue.d.ts +4 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.d.ts +2 -0
- package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.d.vue.ts +16 -0
- package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.vue.d.ts +16 -0
- package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.d.ts +8 -0
- package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.d.vue.ts +4 -0
- package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.vue.d.ts +4 -0
- package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.d.ts +2 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.d.vue.ts +51 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.vue +201 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/config.vue.d.ts +51 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/runtime.vue +37 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.d.ts +30 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.js +87 -0
- package/dist/runtime/components/actions/components/triggers-field.d.vue.ts +4 -0
- package/dist/runtime/components/actions/components/triggers-field.vue +65 -7
- package/dist/runtime/components/actions/components/triggers-field.vue.d.ts +4 -0
- package/dist/runtime/components/actions/config.vue +68 -1
- package/dist/runtime/components/actions/utils/resolve.d.ts +85 -2
- package/dist/runtime/components/actions/utils/resolve.js +122 -21
- package/dist/runtime/components/app.vue +59 -4
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +2 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +2 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +2 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +2 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +1 -1
- package/dist/runtime/components/config/index.vue +9 -2
- package/dist/runtime/components/config/schema.d.ts +6 -10
- package/dist/runtime/components/config/schema.js +12 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +1 -1
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.d.vue.ts +31 -0
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.vue +89 -0
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.vue.d.ts +31 -0
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/runtime.d.ts +2 -0
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/runtime.js +14 -0
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.d.ts +21 -0
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.js +36 -0
- package/dist/runtime/components/operations/utils/resolve.d.ts +48 -0
- package/dist/runtime/components/operations/utils/resolve.js +73 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +4 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +4 -0
- package/dist/runtime/components/table/schema.d.ts +2 -2
- package/dist/runtime/components/ui/progress/Progress.d.vue.ts +11 -0
- package/dist/runtime/components/ui/progress/Progress.vue +32 -0
- package/dist/runtime/components/ui/progress/Progress.vue.d.ts +11 -0
- package/dist/runtime/components/ui/progress/index.d.ts +1 -0
- package/dist/runtime/components/ui/progress/index.js +1 -0
- package/dist/runtime/composables/useOverlay.d.ts +35 -0
- package/dist/runtime/composables/useOverlay.js +52 -0
- package/dist/runtime/share/event-bus.d.ts +24 -2
- package/dist/runtime/share/event-bus.js +21 -3
- package/dist/runtime/share/interpolate.d.ts +12 -0
- package/dist/runtime/share/interpolate.js +18 -0
- package/dist/runtime/share/page-target.d.ts +16 -0
- package/dist/runtime/share/page-target.js +1 -0
- package/dist/runtime/share/schema-meta.d.ts +5 -0
- package/dist/runtime/share/schema-meta.js +48 -0
- package/dist/runtime/style.css +1 -1
- package/package.json +1 -1
- package/dist/preview/assets/badge-Nmf0QGvo.js +0 -1
- package/dist/preview/assets/config-BuBQPlju.js +0 -1
- package/dist/preview/assets/config-CBxDLjqQ.js +0 -1
- package/dist/preview/assets/config-CSU0Tuu4.js +0 -1
- package/dist/preview/assets/config-Cnu3ZCPF.js +0 -1
- package/dist/preview/assets/config-CzBP2y8L.js +0 -1
- package/dist/preview/assets/config-nczxdERQ.js +0 -1
- package/dist/preview/assets/config-qCPGn6mB.js +0 -1
- package/dist/preview/assets/config-vHYVnzyt.js +0 -1
- package/dist/preview/assets/config-w2mvI_4h.js +0 -1
- package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-DqE0YNVF.js +0 -1
- package/dist/preview/assets/index-BgvMBKzp.js +0 -1
- package/dist/preview/assets/index-COSjWreD.css +0 -1
- package/dist/preview/assets/item-DAL4Ui_l.js +0 -1
- package/dist/preview/assets/runtime-BcsMOkA2.js +0 -1
- package/dist/preview/assets/runtime-BzwoxDCd.js +0 -1
- package/dist/preview/assets/runtime-Cu2DKoI0.js +0 -1
- package/dist/preview/assets/runtime-Dp0JEFtU.js +0 -1
- package/dist/preview/assets/runtime-YE1oXXQN.js +0 -1
- package/dist/preview/assets/runtime-YRSxexBQ.js +0 -1
- package/dist/preview/assets/runtime-uwt0BxpS.js +0 -1
|
@@ -3,16 +3,7 @@ import type { Environment } from '../../vendor/cel-js/lib/index.js';
|
|
|
3
3
|
import { type LocaleValue } from '../../share/locale.js';
|
|
4
4
|
export { getStructFieldDescription, getStructFieldTitle } from '../table/utils/schema-meta.js';
|
|
5
5
|
declare const KIND = "shwfed.component.page";
|
|
6
|
-
|
|
7
|
-
* Reserved sentinel instance id for the singleton page operation target. The
|
|
8
|
-
* page is the outermost `ShwfedConfig` — there is only ever one per tree, so it
|
|
9
|
-
* needs no stored, per-config id (which would force a migration of every
|
|
10
|
-
* existing page config). The nil UUID can never collide with a block id:
|
|
11
|
-
* `crypto.randomUUID()` always sets version-4 + variant bits, so it never
|
|
12
|
-
* emits all-zeros. It also passes `Schema.UUID`'s lenient hex-layout regex, so
|
|
13
|
-
* stored triggers targeting it decode cleanly.
|
|
14
|
-
*/
|
|
15
|
-
export declare const PAGE_TARGET_ID = "00000000-0000-0000-0000-000000000000";
|
|
6
|
+
export { PAGE_TARGET_ID } from '../../share/page-target.js';
|
|
16
7
|
/**
|
|
17
8
|
* Capability manifest — type-level display info plus the operations the page
|
|
18
9
|
* instance exposes to op-requests bubbled up from its descendants. Mirrors the
|
|
@@ -26,6 +17,11 @@ export declare const metadata: {
|
|
|
26
17
|
readonly id: "close";
|
|
27
18
|
readonly name: "关闭标签页";
|
|
28
19
|
readonly icon: "fluent:dismiss-20-regular";
|
|
20
|
+
}, {
|
|
21
|
+
readonly id: "com.shwfed.operation.alert";
|
|
22
|
+
readonly compatibilityDate: "2026-06-09";
|
|
23
|
+
readonly name: "确认弹窗";
|
|
24
|
+
readonly icon: "fluent:chat-warning-20-regular";
|
|
29
25
|
}];
|
|
30
26
|
};
|
|
31
27
|
export declare function PageConfig(configure: (env: Environment) => void): Schema.Struct<{
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { Expression, Slot, defaultSlot } from "../../share/layout.js";
|
|
3
3
|
import { Locale } from "../../share/locale.js";
|
|
4
|
+
import * as alertOperation from "../operations/2026-06-09/com.shwfed.operation.alert/schema.js";
|
|
4
5
|
import { blockRef } from "./utils/resolve.js";
|
|
5
6
|
export { getStructFieldDescription, getStructFieldTitle } from "../table/utils/schema-meta.js";
|
|
6
7
|
const KIND = "shwfed.component.page";
|
|
7
|
-
export
|
|
8
|
+
export { PAGE_TARGET_ID } from "../../share/page-target.js";
|
|
8
9
|
export const metadata = {
|
|
9
10
|
name: "\u9875\u9762",
|
|
10
11
|
icon: "fluent:document-20-regular",
|
|
11
12
|
operations: [
|
|
12
|
-
{ id: "close", name: "\u5173\u95ED\u6807\u7B7E\u9875", icon: "fluent:dismiss-20-regular" }
|
|
13
|
+
{ id: "close", name: "\u5173\u95ED\u6807\u7B7E\u9875", icon: "fluent:dismiss-20-regular" },
|
|
14
|
+
// Parameterized op: `compatibilityDate` marks it as carrying params, so the
|
|
15
|
+
// trigger editor seeds `defaults()` and renders the alert's `config.vue`.
|
|
16
|
+
// `id` doubles as the operation-block `type`.
|
|
17
|
+
{
|
|
18
|
+
id: alertOperation.type,
|
|
19
|
+
compatibilityDate: alertOperation.compatibilityDate,
|
|
20
|
+
name: alertOperation.metadata.name,
|
|
21
|
+
icon: alertOperation.metadata.icon
|
|
22
|
+
}
|
|
13
23
|
]
|
|
14
24
|
};
|
|
15
25
|
export function PageConfig(configure) {
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts
CHANGED
|
@@ -24,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
24
24
|
}[]] | undefined;
|
|
25
25
|
readonly required?: string | undefined;
|
|
26
26
|
readonly displayName?: string | undefined;
|
|
27
|
+
readonly max?: string | undefined;
|
|
27
28
|
readonly compatibilityDate: "2026-04-28";
|
|
28
29
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
29
30
|
readonly placeholder?: readonly [{
|
|
@@ -34,7 +35,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
34
35
|
readonly message: string;
|
|
35
36
|
}[]] | undefined;
|
|
36
37
|
readonly min?: string | undefined;
|
|
37
|
-
readonly max?: string | undefined;
|
|
38
38
|
readonly step?: number | undefined;
|
|
39
39
|
readonly readonly?: string | undefined;
|
|
40
40
|
readonly binding?: string | undefined;
|
|
@@ -79,6 +79,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
79
79
|
}[]] | undefined;
|
|
80
80
|
readonly required?: string | undefined;
|
|
81
81
|
readonly displayName?: string | undefined;
|
|
82
|
+
readonly max?: string | undefined;
|
|
82
83
|
readonly compatibilityDate: "2026-04-28";
|
|
83
84
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
84
85
|
readonly placeholder?: readonly [{
|
|
@@ -89,7 +90,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
89
90
|
readonly message: string;
|
|
90
91
|
}[]] | undefined;
|
|
91
92
|
readonly min?: string | undefined;
|
|
92
|
-
readonly max?: string | undefined;
|
|
93
93
|
readonly step?: number | undefined;
|
|
94
94
|
readonly readonly?: string | undefined;
|
|
95
95
|
readonly binding?: string | undefined;
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
24
24
|
}[]] | undefined;
|
|
25
25
|
readonly required?: string | undefined;
|
|
26
26
|
readonly displayName?: string | undefined;
|
|
27
|
+
readonly max?: string | undefined;
|
|
27
28
|
readonly compatibilityDate: "2026-04-28";
|
|
28
29
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
29
30
|
readonly placeholder?: readonly [{
|
|
@@ -34,7 +35,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
34
35
|
readonly message: string;
|
|
35
36
|
}[]] | undefined;
|
|
36
37
|
readonly min?: string | undefined;
|
|
37
|
-
readonly max?: string | undefined;
|
|
38
38
|
readonly step?: number | undefined;
|
|
39
39
|
readonly readonly?: string | undefined;
|
|
40
40
|
readonly binding?: string | undefined;
|
|
@@ -79,6 +79,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
79
79
|
}[]] | undefined;
|
|
80
80
|
readonly required?: string | undefined;
|
|
81
81
|
readonly displayName?: string | undefined;
|
|
82
|
+
readonly max?: string | undefined;
|
|
82
83
|
readonly compatibilityDate: "2026-04-28";
|
|
83
84
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
84
85
|
readonly placeholder?: readonly [{
|
|
@@ -89,7 +90,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
89
90
|
readonly message: string;
|
|
90
91
|
}[]] | undefined;
|
|
91
92
|
readonly min?: string | undefined;
|
|
92
|
-
readonly max?: string | undefined;
|
|
93
93
|
readonly step?: number | undefined;
|
|
94
94
|
readonly readonly?: string | undefined;
|
|
95
95
|
readonly binding?: string | undefined;
|
|
@@ -24,10 +24,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
24
24
|
}[]] | undefined;
|
|
25
25
|
readonly required?: string | undefined;
|
|
26
26
|
readonly displayName?: string | undefined;
|
|
27
|
+
readonly max?: string | undefined;
|
|
27
28
|
readonly compatibilityDate: "2026-04-28";
|
|
28
29
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
29
30
|
readonly min?: string | undefined;
|
|
30
|
-
readonly max?: string | undefined;
|
|
31
31
|
readonly step?: number | undefined;
|
|
32
32
|
readonly readonly?: string | undefined;
|
|
33
33
|
readonly binding?: string | readonly [string, string] | undefined;
|
|
@@ -87,10 +87,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
87
87
|
}[]] | undefined;
|
|
88
88
|
readonly required?: string | undefined;
|
|
89
89
|
readonly displayName?: string | undefined;
|
|
90
|
+
readonly max?: string | undefined;
|
|
90
91
|
readonly compatibilityDate: "2026-04-28";
|
|
91
92
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
92
93
|
readonly min?: string | undefined;
|
|
93
|
-
readonly max?: string | undefined;
|
|
94
94
|
readonly step?: number | undefined;
|
|
95
95
|
readonly readonly?: string | undefined;
|
|
96
96
|
readonly binding?: string | readonly [string, string] | undefined;
|
|
@@ -24,10 +24,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
24
24
|
}[]] | undefined;
|
|
25
25
|
readonly required?: string | undefined;
|
|
26
26
|
readonly displayName?: string | undefined;
|
|
27
|
+
readonly max?: string | undefined;
|
|
27
28
|
readonly compatibilityDate: "2026-04-28";
|
|
28
29
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
29
30
|
readonly min?: string | undefined;
|
|
30
|
-
readonly max?: string | undefined;
|
|
31
31
|
readonly step?: number | undefined;
|
|
32
32
|
readonly readonly?: string | undefined;
|
|
33
33
|
readonly binding?: string | readonly [string, string] | undefined;
|
|
@@ -87,10 +87,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
87
87
|
}[]] | undefined;
|
|
88
88
|
readonly required?: string | undefined;
|
|
89
89
|
readonly displayName?: string | undefined;
|
|
90
|
+
readonly max?: string | undefined;
|
|
90
91
|
readonly compatibilityDate: "2026-04-28";
|
|
91
92
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
92
93
|
readonly min?: string | undefined;
|
|
93
|
-
readonly max?: string | undefined;
|
|
94
94
|
readonly step?: number | undefined;
|
|
95
95
|
readonly readonly?: string | undefined;
|
|
96
96
|
readonly binding?: string | readonly [string, string] | undefined;
|
package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts
CHANGED
|
@@ -31,9 +31,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
31
31
|
readonly message: string;
|
|
32
32
|
}[]] | undefined;
|
|
33
33
|
readonly displayName?: string | undefined;
|
|
34
|
+
readonly max?: number | undefined;
|
|
34
35
|
readonly compatibilityDate: "2026-05-13";
|
|
35
36
|
readonly min?: number | undefined;
|
|
36
|
-
readonly max?: number | undefined;
|
|
37
37
|
readonly unit: Readonly<{
|
|
38
38
|
fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
|
|
39
39
|
layouts: readonly Readonly<{
|
|
@@ -99,9 +99,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
99
99
|
readonly message: string;
|
|
100
100
|
}[]] | undefined;
|
|
101
101
|
readonly displayName?: string | undefined;
|
|
102
|
+
readonly max?: number | undefined;
|
|
102
103
|
readonly compatibilityDate: "2026-05-13";
|
|
103
104
|
readonly min?: number | undefined;
|
|
104
|
-
readonly max?: number | undefined;
|
|
105
105
|
readonly unit: Readonly<{
|
|
106
106
|
fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
|
|
107
107
|
layouts: readonly Readonly<{
|
package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts
CHANGED
|
@@ -31,9 +31,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
31
31
|
readonly message: string;
|
|
32
32
|
}[]] | undefined;
|
|
33
33
|
readonly displayName?: string | undefined;
|
|
34
|
+
readonly max?: number | undefined;
|
|
34
35
|
readonly compatibilityDate: "2026-05-13";
|
|
35
36
|
readonly min?: number | undefined;
|
|
36
|
-
readonly max?: number | undefined;
|
|
37
37
|
readonly unit: Readonly<{
|
|
38
38
|
fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
|
|
39
39
|
layouts: readonly Readonly<{
|
|
@@ -99,9 +99,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
99
99
|
readonly message: string;
|
|
100
100
|
}[]] | undefined;
|
|
101
101
|
readonly displayName?: string | undefined;
|
|
102
|
+
readonly max?: number | undefined;
|
|
102
103
|
readonly compatibilityDate: "2026-05-13";
|
|
103
104
|
readonly min?: number | undefined;
|
|
104
|
-
readonly max?: number | undefined;
|
|
105
105
|
readonly unit: Readonly<{
|
|
106
106
|
fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
|
|
107
107
|
layouts: readonly Readonly<{
|
package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts
CHANGED
|
@@ -46,9 +46,9 @@ export declare function schema(configure: (env: Environment) => void): Schema.re
|
|
|
46
46
|
readonly message: string;
|
|
47
47
|
}[]] | undefined;
|
|
48
48
|
readonly displayName?: string | undefined;
|
|
49
|
+
readonly max?: number | undefined;
|
|
49
50
|
readonly compatibilityDate: "2026-05-13";
|
|
50
51
|
readonly min?: number | undefined;
|
|
51
|
-
readonly max?: number | undefined;
|
|
52
52
|
readonly unit: Readonly<{
|
|
53
53
|
fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
|
|
54
54
|
layouts: ReadonlyArray<import("../../../schema.js").LayoutSetValue>;
|
package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.d.vue.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: {
|
|
7
|
+
readonly icon?: string | undefined;
|
|
8
|
+
readonly color?: string | undefined;
|
|
9
|
+
readonly message: readonly [{
|
|
10
|
+
readonly locale: "zh";
|
|
11
|
+
readonly message: string;
|
|
12
|
+
}, ...{
|
|
13
|
+
readonly locale: "en" | "ja" | "ko";
|
|
14
|
+
readonly message: string;
|
|
15
|
+
}[]];
|
|
16
|
+
}) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: {
|
|
19
|
+
readonly icon?: string | undefined;
|
|
20
|
+
readonly color?: string | undefined;
|
|
21
|
+
readonly message: readonly [{
|
|
22
|
+
readonly locale: "zh";
|
|
23
|
+
readonly message: string;
|
|
24
|
+
}, ...{
|
|
25
|
+
readonly locale: "en" | "ja" | "ko";
|
|
26
|
+
readonly message: string;
|
|
27
|
+
}[]];
|
|
28
|
+
}) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ColorPicker } from "../../../ui/color-picker";
|
|
3
|
+
import { Field, FieldGroup, FieldLabel } from "../../../ui/field";
|
|
4
|
+
import { IconPicker } from "../../../ui/icon-picker";
|
|
5
|
+
import { Locale as LocaleField } from "../../../ui/locale";
|
|
6
|
+
import { Markdown } from "../../../ui/markdown";
|
|
7
|
+
import { getStructFieldDescription, getStructFieldTitle } from "../../../../share/schema-meta";
|
|
8
|
+
import { schema } from "./schema";
|
|
9
|
+
defineOptions({ name: "ShwfedAlertOperationConfig" });
|
|
10
|
+
const value = defineModel({ type: null, ...{ required: true } });
|
|
11
|
+
const opSchema = schema(() => {
|
|
12
|
+
});
|
|
13
|
+
const fieldTitle = (f) => getStructFieldTitle(opSchema, f) ?? f;
|
|
14
|
+
const fieldDescription = (f) => getStructFieldDescription(opSchema, f);
|
|
15
|
+
function patch(patchValue) {
|
|
16
|
+
const next = { ...value.value, ...patchValue };
|
|
17
|
+
for (const [k, v] of Object.entries(patchValue)) {
|
|
18
|
+
if (v === void 0) Reflect.deleteProperty(next, k);
|
|
19
|
+
}
|
|
20
|
+
value.value = next;
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<FieldGroup>
|
|
26
|
+
<Field orientation="vertical">
|
|
27
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
28
|
+
<template
|
|
29
|
+
v-if="fieldDescription('message')"
|
|
30
|
+
#tooltip
|
|
31
|
+
>
|
|
32
|
+
<Markdown
|
|
33
|
+
:source="fieldDescription('message')"
|
|
34
|
+
block
|
|
35
|
+
class="prose prose-sm prose-zinc"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
{{ fieldTitle("message") }}
|
|
39
|
+
</FieldLabel>
|
|
40
|
+
<LocaleField
|
|
41
|
+
markdown
|
|
42
|
+
:model-value="value.message"
|
|
43
|
+
@update:model-value="(v) => patch({ message: v })"
|
|
44
|
+
/>
|
|
45
|
+
</Field>
|
|
46
|
+
|
|
47
|
+
<div class="grid grid-cols-2 gap-4">
|
|
48
|
+
<Field orientation="vertical">
|
|
49
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
50
|
+
<template
|
|
51
|
+
v-if="fieldDescription('icon')"
|
|
52
|
+
#tooltip
|
|
53
|
+
>
|
|
54
|
+
<Markdown
|
|
55
|
+
:source="fieldDescription('icon')"
|
|
56
|
+
block
|
|
57
|
+
class="prose prose-sm prose-zinc"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
60
|
+
{{ fieldTitle("icon") }}
|
|
61
|
+
</FieldLabel>
|
|
62
|
+
<IconPicker
|
|
63
|
+
:model-value="value.icon ?? ''"
|
|
64
|
+
@update:model-value="(v) => patch(v.trim() === '' ? { icon: void 0 } : { icon: v })"
|
|
65
|
+
/>
|
|
66
|
+
</Field>
|
|
67
|
+
|
|
68
|
+
<Field orientation="vertical">
|
|
69
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
70
|
+
<template
|
|
71
|
+
v-if="fieldDescription('color')"
|
|
72
|
+
#tooltip
|
|
73
|
+
>
|
|
74
|
+
<Markdown
|
|
75
|
+
:source="fieldDescription('color')"
|
|
76
|
+
block
|
|
77
|
+
class="prose prose-sm prose-zinc"
|
|
78
|
+
/>
|
|
79
|
+
</template>
|
|
80
|
+
{{ fieldTitle("color") }}
|
|
81
|
+
</FieldLabel>
|
|
82
|
+
<ColorPicker
|
|
83
|
+
:model-value="value.color ?? ''"
|
|
84
|
+
@update:model-value="(v) => patch(v.trim() === '' ? { color: void 0 } : { color: v })"
|
|
85
|
+
/>
|
|
86
|
+
</Field>
|
|
87
|
+
</div>
|
|
88
|
+
</FieldGroup>
|
|
89
|
+
</template>
|
package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/config.vue.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: {
|
|
7
|
+
readonly icon?: string | undefined;
|
|
8
|
+
readonly color?: string | undefined;
|
|
9
|
+
readonly message: readonly [{
|
|
10
|
+
readonly locale: "zh";
|
|
11
|
+
readonly message: string;
|
|
12
|
+
}, ...{
|
|
13
|
+
readonly locale: "en" | "ja" | "ko";
|
|
14
|
+
readonly message: string;
|
|
15
|
+
}[]];
|
|
16
|
+
}) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: {
|
|
19
|
+
readonly icon?: string | undefined;
|
|
20
|
+
readonly color?: string | undefined;
|
|
21
|
+
readonly message: readonly [{
|
|
22
|
+
readonly locale: "zh";
|
|
23
|
+
readonly message: string;
|
|
24
|
+
}, ...{
|
|
25
|
+
readonly locale: "en" | "ja" | "ko";
|
|
26
|
+
readonly message: string;
|
|
27
|
+
}[]];
|
|
28
|
+
}) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { getLocalizedText } from "../../../../share/locale.js";
|
|
3
|
+
import { interpolateMarkdown } from "../../../../share/interpolate.js";
|
|
4
|
+
import { reject } from "../../../../composables/useOverlay.js";
|
|
5
|
+
class AlertCancelled {
|
|
6
|
+
_tag = "AlertCancelled";
|
|
7
|
+
}
|
|
8
|
+
export const handler = (params, ctx) => Effect.gen(function* () {
|
|
9
|
+
const { message, icon, color } = params ?? {};
|
|
10
|
+
const raw = getLocalizedText(message, ctx.locale()) ?? "";
|
|
11
|
+
const content = interpolateMarkdown(raw, ctx.cel);
|
|
12
|
+
const cancelled = yield* reject({ content, icon, color });
|
|
13
|
+
if (cancelled) return yield* Effect.die(new AlertCancelled());
|
|
14
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import type { Environment } from '../../../../vendor/cel-js/lib/index.js';
|
|
3
|
+
export declare const type: "com.shwfed.operation.alert";
|
|
4
|
+
export declare const compatibilityDate: "2026-06-09";
|
|
5
|
+
export declare const metadata: {
|
|
6
|
+
readonly name: "确认弹窗";
|
|
7
|
+
readonly icon: "fluent:chat-warning-20-regular";
|
|
8
|
+
};
|
|
9
|
+
export declare function schema(_configure: (env: Environment) => void): Schema.Struct<{
|
|
10
|
+
message: Schema.TupleType<readonly [Schema.Struct<{
|
|
11
|
+
locale: Schema.Literal<["zh"]>;
|
|
12
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
13
|
+
}>], [Schema.Struct<{
|
|
14
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
15
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
16
|
+
}>]>;
|
|
17
|
+
icon: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
18
|
+
color: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
19
|
+
}>;
|
|
20
|
+
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
21
|
+
export declare function defaults(): Partial<Value>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Locale } from "../../../../share/locale.js";
|
|
3
|
+
import { md } from "../../../../share/markdown.js";
|
|
4
|
+
export const type = "com.shwfed.operation.alert";
|
|
5
|
+
export const compatibilityDate = "2026-06-09";
|
|
6
|
+
export const metadata = {
|
|
7
|
+
name: "\u786E\u8BA4\u5F39\u7A97",
|
|
8
|
+
icon: "fluent:chat-warning-20-regular"
|
|
9
|
+
};
|
|
10
|
+
export function schema(_configure) {
|
|
11
|
+
return Schema.Struct({
|
|
12
|
+
message: Locale.annotations({
|
|
13
|
+
title: "\u786E\u8BA4\u4FE1\u606F",
|
|
14
|
+
description: "\u5F39\u7A97\u786E\u8BA4\u4FE1\u606F\uFF0C\u652F\u6301 `{{ expression }}` \u63D2\u503C"
|
|
15
|
+
}),
|
|
16
|
+
icon: Schema.optional(Schema.String.annotations({
|
|
17
|
+
title: "\u56FE\u6807",
|
|
18
|
+
description: "\u5F39\u7A97\u5185\u7684\u56FE\u6807"
|
|
19
|
+
})),
|
|
20
|
+
color: Schema.optional(Schema.String.annotations({
|
|
21
|
+
title: "\u56FE\u6807\u989C\u8272",
|
|
22
|
+
description: "\u5F39\u7A97\u5185\u56FE\u6807\u7684\u989C\u8272\uFF08\u4EFB\u610F CSS \u989C\u8272\u503C\uFF09"
|
|
23
|
+
}))
|
|
24
|
+
}).annotations({
|
|
25
|
+
title: "AlertOperation",
|
|
26
|
+
description: md`
|
|
27
|
+
弹出确认弹窗。用户确认则继续执行后续操作;取消则中止本次触发链
|
|
28
|
+
(与表单「校验」未通过同样的中止语义)。
|
|
29
|
+
`
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export function defaults() {
|
|
33
|
+
return {
|
|
34
|
+
message: [{ locale: "zh", message: "" }]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { Effect, Schema } from 'effect';
|
|
3
|
+
import type { Environment } from '../../../vendor/cel-js/lib/index.js';
|
|
4
|
+
import type { CelEvaluator } from '../../../share/interpolate.js';
|
|
5
|
+
import type { OperationHandlers } from '../../../share/event-bus.js';
|
|
6
|
+
type AnySchema = Schema.Schema<any, any, never>;
|
|
7
|
+
type SchemaFactory = (configure: (env: Environment) => void) => AnySchema;
|
|
8
|
+
/** Context a host supplies when wiring operation handlers into its channel. */
|
|
9
|
+
export type OperationContext = Readonly<{
|
|
10
|
+
/** Evaluator for any CEL in an operation's params (host's bindings). */
|
|
11
|
+
cel: CelEvaluator;
|
|
12
|
+
/** Current UI locale, read live (handlers may run long after wiring). */
|
|
13
|
+
locale: () => string;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* The generic behaviour of a parameterized operation. Infallible on the error
|
|
17
|
+
* channel like every `OperationHandlers` entry; a handler MAY halt the trigger
|
|
18
|
+
* chain via `Effect.die` (the guard shape — e.g. an alert whose user cancels).
|
|
19
|
+
*/
|
|
20
|
+
export type OperationHandler = (params: unknown, ctx: OperationContext) => Effect.Effect<void>;
|
|
21
|
+
export type OperationMetadata = Readonly<{
|
|
22
|
+
name: string;
|
|
23
|
+
icon: string;
|
|
24
|
+
}>;
|
|
25
|
+
export type OperationEntry = Readonly<{
|
|
26
|
+
type: string;
|
|
27
|
+
compatibilityDate: string;
|
|
28
|
+
metadata: OperationMetadata;
|
|
29
|
+
schema: SchemaFactory;
|
|
30
|
+
defaults?: () => Record<string, unknown>;
|
|
31
|
+
config: Component;
|
|
32
|
+
handler: OperationHandler;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const OPERATIONS: ReadonlyArray<OperationEntry>;
|
|
35
|
+
export declare function findOperation(type: string, compatibilityDate: string): OperationEntry | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Build the `OperationHandlers` for a host's `provideEventTarget`, one per
|
|
38
|
+
* parameterized operation the host declares it exposes. Each handler keys on
|
|
39
|
+
* the operation `type` (what the trigger stores as `operation`) and forwards
|
|
40
|
+
* the request's `params` to the registered `handler` with `ctx`. Unknown
|
|
41
|
+
* refs are skipped. Hosts merge the result with any bespoke param-less
|
|
42
|
+
* handlers (e.g. the page's `close`).
|
|
43
|
+
*/
|
|
44
|
+
export declare function operationHandlers(exposed: ReadonlyArray<{
|
|
45
|
+
type: string;
|
|
46
|
+
compatibilityDate: string;
|
|
47
|
+
}>, ctx: OperationContext): OperationHandlers;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineAsyncComponent } from "vue";
|
|
2
|
+
const schemaModules = import.meta.glob(
|
|
3
|
+
"../*/*/schema.{ts,js}",
|
|
4
|
+
{ eager: true, exhaustive: true }
|
|
5
|
+
);
|
|
6
|
+
const runtimeModules = import.meta.glob(
|
|
7
|
+
"../*/*/runtime.{ts,js}",
|
|
8
|
+
{ eager: true, exhaustive: true }
|
|
9
|
+
);
|
|
10
|
+
const configModuleLoaders = import.meta.glob(
|
|
11
|
+
"../*/*/config.vue",
|
|
12
|
+
{ exhaustive: true }
|
|
13
|
+
);
|
|
14
|
+
const configModules = Object.fromEntries(
|
|
15
|
+
Object.entries(configModuleLoaders).map(([path, loader]) => [
|
|
16
|
+
path,
|
|
17
|
+
defineAsyncComponent(loader)
|
|
18
|
+
])
|
|
19
|
+
);
|
|
20
|
+
const PATH_RE = /\/([^/]+)\/([^/]+)\/schema\.(?:ts|js)$/;
|
|
21
|
+
function findSibling(map, date, type, file) {
|
|
22
|
+
const suffix = `/${date}/${type}/${file}`;
|
|
23
|
+
for (const [key, value] of Object.entries(map)) {
|
|
24
|
+
if (key.endsWith(suffix)) return value;
|
|
25
|
+
}
|
|
26
|
+
throw new Error(`[shwfed-operations] missing ${file} for ${type}@${date}`);
|
|
27
|
+
}
|
|
28
|
+
let cached = null;
|
|
29
|
+
function compute() {
|
|
30
|
+
if (cached) return cached;
|
|
31
|
+
const entries = [];
|
|
32
|
+
for (const [path, mod] of Object.entries(schemaModules)) {
|
|
33
|
+
const match = PATH_RE.exec(path);
|
|
34
|
+
if (!match) throw new Error(`[shwfed-operations] unrecognized schema path: ${path}`);
|
|
35
|
+
const date = match[1];
|
|
36
|
+
const type = match[2];
|
|
37
|
+
if (mod.type !== type) {
|
|
38
|
+
throw new Error(`[shwfed-operations] type "${mod.type}" does not match folder "${type}"`);
|
|
39
|
+
}
|
|
40
|
+
if (mod.compatibilityDate !== date) {
|
|
41
|
+
throw new Error(`[shwfed-operations] compatibilityDate "${mod.compatibilityDate}" does not match folder "${date}"`);
|
|
42
|
+
}
|
|
43
|
+
const runtime = findSibling(runtimeModules, date, type, "runtime.ts");
|
|
44
|
+
entries.push({
|
|
45
|
+
type: mod.type,
|
|
46
|
+
compatibilityDate: mod.compatibilityDate,
|
|
47
|
+
metadata: mod.metadata,
|
|
48
|
+
schema: mod.schema,
|
|
49
|
+
defaults: mod.defaults,
|
|
50
|
+
config: findSibling(configModules, date, type, "config.vue"),
|
|
51
|
+
handler: runtime.handler
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
cached = entries;
|
|
55
|
+
return cached;
|
|
56
|
+
}
|
|
57
|
+
export const OPERATIONS = new Proxy([], {
|
|
58
|
+
get(_t, prop, recv) {
|
|
59
|
+
return Reflect.get(compute(), prop, recv);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export function findOperation(type, compatibilityDate) {
|
|
63
|
+
return compute().find((o) => o.type === type && o.compatibilityDate === compatibilityDate);
|
|
64
|
+
}
|
|
65
|
+
export function operationHandlers(exposed, ctx) {
|
|
66
|
+
const handlers = {};
|
|
67
|
+
for (const { type, compatibilityDate } of exposed) {
|
|
68
|
+
const entry = findOperation(type, compatibilityDate);
|
|
69
|
+
if (!entry) continue;
|
|
70
|
+
handlers[type] = (params) => entry.handler(params, ctx);
|
|
71
|
+
}
|
|
72
|
+
return handlers;
|
|
73
|
+
}
|
package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
18
18
|
triggers: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
19
19
|
target: Schema.refine<string, typeof Schema.String>;
|
|
20
20
|
operation: Schema.SchemaClass<string, string, never>;
|
|
21
|
+
compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
22
|
+
params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
|
|
21
23
|
}>>>;
|
|
22
24
|
title: Schema.TupleType<readonly [Schema.Struct<{
|
|
23
25
|
locale: Schema.Literal<["zh"]>;
|
|
@@ -18,6 +18,8 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
18
18
|
triggers: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
19
19
|
target: Schema.refine<string, typeof Schema.String>;
|
|
20
20
|
operation: Schema.SchemaClass<string, string, never>;
|
|
21
|
+
compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
22
|
+
params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
|
|
21
23
|
}>>>;
|
|
22
24
|
title: Schema.TupleType<readonly [Schema.Struct<{
|
|
23
25
|
locale: Schema.Literal<["zh"]>;
|
|
@@ -26,6 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
26
26
|
}[]] | undefined;
|
|
27
27
|
readonly compatibilityDate: "2026-05-24";
|
|
28
28
|
readonly triggers?: readonly {
|
|
29
|
+
readonly params?: unknown;
|
|
30
|
+
readonly compatibilityDate?: string | undefined;
|
|
29
31
|
readonly target: string;
|
|
30
32
|
readonly operation: string;
|
|
31
33
|
}[] | undefined;
|
|
@@ -78,6 +80,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
78
80
|
}[]] | undefined;
|
|
79
81
|
readonly compatibilityDate: "2026-05-24";
|
|
80
82
|
readonly triggers?: readonly {
|
|
83
|
+
readonly params?: unknown;
|
|
84
|
+
readonly compatibilityDate?: string | undefined;
|
|
81
85
|
readonly target: string;
|
|
82
86
|
readonly operation: string;
|
|
83
87
|
}[] | undefined;
|
|
@@ -26,6 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
26
26
|
}[]] | undefined;
|
|
27
27
|
readonly compatibilityDate: "2026-05-24";
|
|
28
28
|
readonly triggers?: readonly {
|
|
29
|
+
readonly params?: unknown;
|
|
30
|
+
readonly compatibilityDate?: string | undefined;
|
|
29
31
|
readonly target: string;
|
|
30
32
|
readonly operation: string;
|
|
31
33
|
}[] | undefined;
|
|
@@ -78,6 +80,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
78
80
|
}[]] | undefined;
|
|
79
81
|
readonly compatibilityDate: "2026-05-24";
|
|
80
82
|
readonly triggers?: readonly {
|
|
83
|
+
readonly params?: unknown;
|
|
84
|
+
readonly compatibilityDate?: string | undefined;
|
|
81
85
|
readonly target: string;
|
|
82
86
|
readonly operation: string;
|
|
83
87
|
}[] | undefined;
|
|
@@ -57,6 +57,8 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
57
57
|
triggers: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
58
58
|
target: Schema.refine<string, typeof Schema.String>;
|
|
59
59
|
operation: Schema.SchemaClass<string, string, never>;
|
|
60
|
+
compatibilityDate: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
61
|
+
params: Schema.optional<Schema.SchemaClass<unknown, unknown, never>>;
|
|
60
62
|
}>>>;
|
|
61
63
|
title: Schema.TupleType<readonly [Schema.Struct<{
|
|
62
64
|
locale: Schema.Literal<["zh"]>;
|