@shwfed/config 2.3.21 → 2.3.23
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 +1096 -641
- package/dist/module.json +1 -1
- package/dist/preview/assets/{config-BkTFAoSA.js → config-5rB9Rnmf.js} +1 -1
- package/dist/preview/assets/{config-__RnmfhP.js → config-BLxl7ROb.js} +1 -1
- package/dist/preview/assets/{config-Bo9NgVie.js → config-BWMtPN22.js} +1 -1
- package/dist/preview/assets/{config-BH2Cgm6Z.js → config-C-EOrL-v.js} +1 -1
- package/dist/preview/assets/{config-CIxAb4Oe.js → config-CJADmi-_.js} +1 -1
- package/dist/preview/assets/{config-D-6Tgeq0.js → config-DUNvg-mJ.js} +1 -1
- package/dist/preview/assets/{config--_6I2ueu.js → config-EtlOM9yx.js} +1 -1
- package/dist/preview/assets/{config-BdEFFxuI.js → config-f66PEpZ5.js} +1 -1
- package/dist/preview/assets/{config-MKO1-4J8.js → config-pVNUrcvS.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-DeVEbdbZ.js → definition.vue_vue_type_script_setup_true_lang-DUu-CoTZ.js} +1 -1
- package/dist/preview/assets/index-B4xolIUJ.js +643 -0
- package/dist/preview/assets/index-CJMxrUKZ.css +1 -0
- package/dist/preview/assets/index-DFYLO8qf.js +1 -0
- package/dist/preview/assets/{runtime-BsM6WFl4.js → runtime-B9GkQToM.js} +1 -1
- package/dist/preview/assets/{runtime-Be9JgLOm.js → runtime-C0v-S40R.js} +1 -1
- package/dist/preview/assets/{runtime-Cqi_SqJY.js → runtime-CFPeFbAB.js} +1 -1
- package/dist/preview/assets/{runtime-Cec8NzXu.js → runtime-CI38ypkY.js} +1 -1
- package/dist/preview/assets/{runtime-w4O6Z5Ly.js → runtime-CUBGWRtC.js} +1 -1
- package/dist/preview/assets/{runtime-BKO8_nF6.js → runtime-DcqfhaaX.js} +1 -1
- package/dist/preview/assets/{runtime-BrUg4LS5.js → runtime-DoLJtHV2.js} +1 -1
- package/dist/preview/assets/{runtime-H9vie18v.js → runtime-P99-0gRD.js} +1 -1
- package/dist/preview/assets/{runtime-C-k7G8_4.js → runtime-qQ5mJdRv.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/actions/schema.js +1 -1
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +52 -52
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +52 -52
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +52 -52
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +52 -52
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +99 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue +329 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +99 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue +265 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.d.ts +79 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.js +71 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +1 -1
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.js +3 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +1 -1
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.js +3 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +133 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue +533 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +133 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue +247 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.d.ts +124 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.js +94 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +109 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue +426 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +109 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue +356 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +85 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.js +147 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +137 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue +586 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +137 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue +287 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +126 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.js +125 -0
- package/dist/runtime/components/table/config.vue +2 -8
- package/dist/runtime/components/table/schema.d.ts +53 -52
- package/dist/runtime/components/table/schema.js +12 -6
- package/package.json +1 -1
- package/dist/preview/assets/index-Bfdy_BZY.js +0 -643
- package/dist/preview/assets/index-CzcHfDck.js +0 -1
- package/dist/preview/assets/index-DomLsyPH.css +0 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { Locale } from "../../../../../share/locale.js";
|
|
3
|
+
import { Expression } from "../../../../../share/expression.js";
|
|
4
|
+
import { Triggers } from "../../../../../share/event-bus.js";
|
|
5
|
+
import {
|
|
6
|
+
CelRowAccess,
|
|
7
|
+
columnFields,
|
|
8
|
+
editableHeader,
|
|
9
|
+
LocaleMarkdownWithRow,
|
|
10
|
+
registerRowVariablesIfAbsent
|
|
11
|
+
} from "../../../utils/shared.js";
|
|
12
|
+
export const type = "com.shwfed.table.column.combobox-multi.remote.options-static";
|
|
13
|
+
export const compatibilityDate = "2026-05-25";
|
|
14
|
+
export const metadata = {
|
|
15
|
+
name: "\u4E0B\u62C9\u591A\u9009",
|
|
16
|
+
icon: "fluent:chevron-down-20-regular"
|
|
17
|
+
};
|
|
18
|
+
export function itemSchema(configure) {
|
|
19
|
+
const LocaleMd = LocaleMarkdownWithRow(configure);
|
|
20
|
+
const TextValue = Schema.Struct({
|
|
21
|
+
kind: Schema.Literal("text"),
|
|
22
|
+
value: Schema.String
|
|
23
|
+
});
|
|
24
|
+
const NumberValue = Schema.Struct({
|
|
25
|
+
kind: Schema.Literal("number"),
|
|
26
|
+
value: Schema.Number
|
|
27
|
+
});
|
|
28
|
+
const ItemValue = Schema.Union(TextValue, NumberValue).annotations({
|
|
29
|
+
title: "\u503C",
|
|
30
|
+
description: "\u9009\u9879\u7ED1\u5B9A\u7684\u503C\uFF0C\u53EF\u4EE5\u662F\u6587\u672C\u6216\u6570\u5B57"
|
|
31
|
+
});
|
|
32
|
+
return Schema.Struct({
|
|
33
|
+
id: Schema.UUID.annotations({ description: "\u9009\u9879\u552F\u4E00\u6807\u8BC6\uFF0C\u7528\u4E8E\u7A33\u5B9A\u7684 v-for key" }),
|
|
34
|
+
label: LocaleMd.annotations({
|
|
35
|
+
title: "\u6807\u7B7E",
|
|
36
|
+
description: "\u9009\u9879\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 Markdown \u4E0E `{{ row.foo }}` / `{{ form.bar }}` \u63D2\u503C"
|
|
37
|
+
}),
|
|
38
|
+
value: ItemValue,
|
|
39
|
+
tooltip: Schema.optional(LocaleMd.annotations({
|
|
40
|
+
title: "\u63D0\u793A",
|
|
41
|
+
description: "\u9F20\u6807\u60AC\u505C\u5728\u9009\u9879\u4E0A\u65F6\u5C55\u793A\u7684\u672C\u5730\u5316\u63D0\u793A\uFF0C\u652F\u6301 Markdown"
|
|
42
|
+
}))
|
|
43
|
+
}).annotations({
|
|
44
|
+
title: "ComboboxMultiRemoteOptionsStaticItem"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export function schema(configure) {
|
|
48
|
+
const CelBool = CelRowAccess(configure, { resultType: "bool" });
|
|
49
|
+
const Item = itemSchema(configure);
|
|
50
|
+
const CelOnChange = Expression({
|
|
51
|
+
configure: (env) => {
|
|
52
|
+
configure(env);
|
|
53
|
+
registerRowVariablesIfAbsent(env);
|
|
54
|
+
env.registerVariable("value", "dyn", { description: "\u7528\u6237\u5F53\u524D\u9009\u4E2D\u9879 `value` \u7EC4\u6210\u7684\u6570\u7EC4\uFF1B\u6E05\u7A7A\u65F6\u4E3A\u7A7A\u6570\u7EC4 `[]`" });
|
|
55
|
+
},
|
|
56
|
+
resultType: "HttpRequest"
|
|
57
|
+
});
|
|
58
|
+
const CelMessage = Expression({
|
|
59
|
+
configure: (env) => {
|
|
60
|
+
configure(env);
|
|
61
|
+
env.registerVariable("json", "dyn", { description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09" });
|
|
62
|
+
},
|
|
63
|
+
resultType: "string"
|
|
64
|
+
});
|
|
65
|
+
return Schema.Struct({
|
|
66
|
+
type: Schema.Literal(type),
|
|
67
|
+
compatibilityDate: Schema.Literal(compatibilityDate),
|
|
68
|
+
...columnFields(configure),
|
|
69
|
+
placeholder: Schema.optional(Locale.annotations({
|
|
70
|
+
title: "\u5360\u4F4D\u7B26",
|
|
71
|
+
description: "\u672A\u9009\u4E2D\u4EFB\u4F55\u9009\u9879\u65F6\u8F93\u5165\u6846\u4E2D\u7684\u5360\u4F4D\u6587\u672C"
|
|
72
|
+
})),
|
|
73
|
+
hidden: Schema.optional(CelBool.annotations({
|
|
74
|
+
title: "\u9690\u85CF\u6761\u4EF6",
|
|
75
|
+
description: "\u8FD4\u56DE `true` \u65F6\u8BE5\u884C\u7684\u4E0B\u62C9\u6846\u4E0D\u6E32\u67D3\uFF08\u5176\u4F59\u884C\u4E0D\u53D7\u5F71\u54CD\uFF09"
|
|
76
|
+
})),
|
|
77
|
+
disabled: Schema.optional(CelBool.annotations({
|
|
78
|
+
title: "\u7981\u7528\u6761\u4EF6",
|
|
79
|
+
description: "\u8FD4\u56DE `true` \u65F6\u4E0B\u62C9\u6846\u4ECD\u7136\u6E32\u67D3\u4F46\u4E0D\u53EF\u9009\u62E9"
|
|
80
|
+
})),
|
|
81
|
+
readonly: Schema.optional(CelBool.annotations({
|
|
82
|
+
title: "\u53EA\u8BFB\u6761\u4EF6",
|
|
83
|
+
description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u5DF2\u9009\u9879\u7684\u6807\u7B7E"
|
|
84
|
+
})),
|
|
85
|
+
items: Schema.optionalWith(Schema.Array(Item).annotations({
|
|
86
|
+
title: "\u9009\u9879",
|
|
87
|
+
description: "\u4E0B\u62C9\u6846\u53EF\u9009\u9879\u5217\u8868"
|
|
88
|
+
}), { default: () => [] }),
|
|
89
|
+
onChange: Schema.optional(CelOnChange.annotations({
|
|
90
|
+
title: "\u5207\u6362\u8BF7\u6C42",
|
|
91
|
+
description: "\u7528\u6237\u9009\u62E9\u540E\u7ACB\u5373\u6C42\u503C\u5E76\u53D1\u8D77\u7684 HTTP \u8BF7\u6C42\uFF1B`value` \u4E3A\u65B0\u6570\u7EC4\u3002\u672A\u914D\u7F6E\u65F6\u4E0B\u62C9\u6846\u53EA\u8BFB"
|
|
92
|
+
})),
|
|
93
|
+
successMessage: Schema.optional(CelMessage.annotations({
|
|
94
|
+
title: "\u6210\u529F\u6D88\u606F",
|
|
95
|
+
description: "\u8BF7\u6C42\u6210\u529F\u540E\u5F39\u51FA\u7684 toast \u5185\u5BB9\uFF1B\u672A\u914D\u7F6E\u5219\u9759\u9ED8"
|
|
96
|
+
})),
|
|
97
|
+
triggers: Schema.optional(Triggers.annotations({
|
|
98
|
+
title: "\u6210\u529F\u540E\u89E6\u53D1",
|
|
99
|
+
description: "\u8BF7\u6C42\u6210\u529F\u540E\u6309\u5217\u8868\u987A\u5E8F\u5192\u6CE1\u7684\u64CD\u4F5C\u8BF7\u6C42\uFF1B\u672A\u914D\u7F6E\u5219\u4EC0\u4E48\u90FD\u4E0D\u505A"
|
|
100
|
+
}))
|
|
101
|
+
}).annotations({
|
|
102
|
+
title: "ComboboxMultiRemoteOptionsStaticRenderer",
|
|
103
|
+
description: "\u4E0B\u62C9\u591A\u9009\u6E32\u67D3\u5668\uFF08\u8FDC\u7A0B\u5199\u5165\xB7\u9759\u6001\u9009\u9879\uFF09"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
|
|
107
|
+
return {
|
|
108
|
+
header: editableHeader(getLocaleText(value.title)),
|
|
109
|
+
accessorFn: (row, index) => {
|
|
110
|
+
try {
|
|
111
|
+
return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
|
|
112
|
+
} catch (e) {
|
|
113
|
+
console.error("[shwfed-table] combobox-multi.remote.options-static accessor failed", e);
|
|
114
|
+
return void 0;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
enableSorting: value.enableSorting ?? false,
|
|
118
|
+
sortingFn: "basic",
|
|
119
|
+
size: value.size,
|
|
120
|
+
meta: {
|
|
121
|
+
grow: value.grow ?? false,
|
|
122
|
+
tooltip: getLocaleText(value.tooltip)
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
@@ -5,7 +5,7 @@ import { BREADCRUMB_EXTENSION_KEY } from "../config/breadcrumb-extension";
|
|
|
5
5
|
import { TABLE_COLUMN_LAYOUT_KEY } from "./column-layout";
|
|
6
6
|
import { Icon } from "@iconify/vue";
|
|
7
7
|
import { ParseResult, Schema } from "effect";
|
|
8
|
-
import { TableConfig, Pagination, ColumnGroup, tableDataSource, metadata as tableMetadata } from "./schema";
|
|
8
|
+
import { TableConfig, Pagination, ColumnGroup, tableDataSource, configureTableActionsScope, metadata as tableMetadata } from "./schema";
|
|
9
9
|
import { COLUMNS, findColumn as findColumnEntry } from "./utils/resolve";
|
|
10
10
|
import {
|
|
11
11
|
useTreeDnd
|
|
@@ -157,13 +157,7 @@ const props = defineProps({
|
|
|
157
157
|
const configure = props.configure ?? (() => {
|
|
158
158
|
});
|
|
159
159
|
function configureTableActions(env) {
|
|
160
|
-
|
|
161
|
-
env.registerVariable("selected", "list<dyn>", {
|
|
162
|
-
description: "\u5F53\u524D\u5DF2\u52FE\u9009\u7684\u6240\u6709\u884C\uFF08`row` \u7684\u6570\u7EC4\uFF09"
|
|
163
|
-
});
|
|
164
|
-
env.registerVariable("query", "dyn", {
|
|
165
|
-
description: "\u6E32\u67D3\u5728\u8868\u683C\u4E0A\u65B9\u7684\u641C\u7D22\u6761\u4EF6\u8868\u5355\u5F53\u524D\u72B6\u6001\uFF1B\u672A\u914D\u7F6E\u65F6\u4E3A\u7A7A\u5BF9\u8C61"
|
|
166
|
-
});
|
|
160
|
+
configureTableActionsScope(env, configure);
|
|
167
161
|
}
|
|
168
162
|
function configureTableQuery(env) {
|
|
169
163
|
configure(env);
|
|
@@ -95,6 +95,7 @@ export declare const ColumnGroup: Schema.Struct<{
|
|
|
95
95
|
message: Schema.SchemaClass<string, string, never>;
|
|
96
96
|
}>]>>;
|
|
97
97
|
}>;
|
|
98
|
+
export declare function configureTableActionsScope(env: Environment, configure: (env: Environment) => void): void;
|
|
98
99
|
export declare function DataSource(configure: (env: Environment) => void, extras?: {
|
|
99
100
|
request?: (env: Environment) => void;
|
|
100
101
|
data?: (env: Environment) => void;
|
|
@@ -130,6 +131,32 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
|
|
|
130
131
|
readonly message: string;
|
|
131
132
|
}[]] | undefined;
|
|
132
133
|
}[];
|
|
134
|
+
readonly query?: {
|
|
135
|
+
readonly initial?: {
|
|
136
|
+
readonly data: string;
|
|
137
|
+
readonly request?: string | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
readonly kind: "shwfed.component.form";
|
|
140
|
+
readonly fields: readonly any[];
|
|
141
|
+
readonly layouts: readonly {
|
|
142
|
+
readonly name: string;
|
|
143
|
+
readonly layout: {
|
|
144
|
+
readonly style?: string | undefined;
|
|
145
|
+
readonly columns: number;
|
|
146
|
+
readonly gap?: number | undefined;
|
|
147
|
+
readonly rows?: number | undefined;
|
|
148
|
+
readonly placements: {
|
|
149
|
+
readonly [x: string]: {
|
|
150
|
+
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
151
|
+
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
152
|
+
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
readonly media?: string | undefined;
|
|
157
|
+
}[];
|
|
158
|
+
readonly readonly?: string | undefined;
|
|
159
|
+
} | undefined;
|
|
133
160
|
readonly dataSource?: {
|
|
134
161
|
readonly data: string;
|
|
135
162
|
readonly request?: string | undefined;
|
|
@@ -202,32 +229,6 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
|
|
|
202
229
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
203
230
|
}[];
|
|
204
231
|
} | undefined;
|
|
205
|
-
readonly query?: {
|
|
206
|
-
readonly initial?: {
|
|
207
|
-
readonly data: string;
|
|
208
|
-
readonly request?: string | undefined;
|
|
209
|
-
} | undefined;
|
|
210
|
-
readonly kind: "shwfed.component.form";
|
|
211
|
-
readonly fields: readonly any[];
|
|
212
|
-
readonly layouts: readonly {
|
|
213
|
-
readonly name: string;
|
|
214
|
-
readonly layout: {
|
|
215
|
-
readonly style?: string | undefined;
|
|
216
|
-
readonly columns: number;
|
|
217
|
-
readonly gap?: number | undefined;
|
|
218
|
-
readonly rows?: number | undefined;
|
|
219
|
-
readonly placements: {
|
|
220
|
-
readonly [x: string]: {
|
|
221
|
-
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
222
|
-
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
223
|
-
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
readonly media?: string | undefined;
|
|
228
|
-
}[];
|
|
229
|
-
readonly readonly?: string | undefined;
|
|
230
|
-
} | undefined;
|
|
231
232
|
readonly rowKey?: string | undefined;
|
|
232
233
|
readonly cellStyle?: string | undefined;
|
|
233
234
|
readonly pagination?: {
|
|
@@ -569,6 +570,32 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
|
|
|
569
570
|
readonly message: string;
|
|
570
571
|
}[]] | undefined;
|
|
571
572
|
}[];
|
|
573
|
+
query?: {
|
|
574
|
+
readonly initial?: {
|
|
575
|
+
readonly data: string;
|
|
576
|
+
readonly request?: string | undefined;
|
|
577
|
+
} | undefined;
|
|
578
|
+
readonly kind: "shwfed.component.form";
|
|
579
|
+
readonly fields: readonly any[];
|
|
580
|
+
readonly layouts: readonly {
|
|
581
|
+
readonly name: string;
|
|
582
|
+
readonly layout: {
|
|
583
|
+
readonly style?: string | undefined;
|
|
584
|
+
readonly columns: number;
|
|
585
|
+
readonly gap?: number | undefined;
|
|
586
|
+
readonly rows?: number | undefined;
|
|
587
|
+
readonly placements: {
|
|
588
|
+
readonly [x: string]: {
|
|
589
|
+
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
590
|
+
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
591
|
+
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
};
|
|
595
|
+
readonly media?: string | undefined;
|
|
596
|
+
}[];
|
|
597
|
+
readonly readonly?: string | undefined;
|
|
598
|
+
} | undefined;
|
|
572
599
|
dataSource?: {
|
|
573
600
|
readonly data: string;
|
|
574
601
|
readonly request?: string | undefined;
|
|
@@ -641,32 +668,6 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
|
|
|
641
668
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
642
669
|
}[];
|
|
643
670
|
} | undefined;
|
|
644
|
-
query?: {
|
|
645
|
-
readonly initial?: {
|
|
646
|
-
readonly data: string;
|
|
647
|
-
readonly request?: string | undefined;
|
|
648
|
-
} | undefined;
|
|
649
|
-
readonly kind: "shwfed.component.form";
|
|
650
|
-
readonly fields: readonly any[];
|
|
651
|
-
readonly layouts: readonly {
|
|
652
|
-
readonly name: string;
|
|
653
|
-
readonly layout: {
|
|
654
|
-
readonly style?: string | undefined;
|
|
655
|
-
readonly columns: number;
|
|
656
|
-
readonly gap?: number | undefined;
|
|
657
|
-
readonly rows?: number | undefined;
|
|
658
|
-
readonly placements: {
|
|
659
|
-
readonly [x: string]: {
|
|
660
|
-
readonly area: readonly [readonly [number, number], readonly [number, number]];
|
|
661
|
-
readonly v?: "stretch" | "center" | "end" | "start" | undefined;
|
|
662
|
-
readonly h?: "stretch" | "center" | "end" | "start" | undefined;
|
|
663
|
-
};
|
|
664
|
-
};
|
|
665
|
-
};
|
|
666
|
-
readonly media?: string | undefined;
|
|
667
|
-
}[];
|
|
668
|
-
readonly readonly?: string | undefined;
|
|
669
|
-
} | undefined;
|
|
670
671
|
rowKey?: string | undefined;
|
|
671
672
|
cellStyle?: string | undefined;
|
|
672
673
|
pagination?: {
|
|
@@ -127,6 +127,17 @@ export const ColumnGroup = Schema.Struct({
|
|
|
127
127
|
description: "\u5217\u5206\u7EC4\u5B9A\u4E49"
|
|
128
128
|
});
|
|
129
129
|
const QUERY_VAR_DESCRIPTION = "\u641C\u7D22\u6761\u4EF6\u5F53\u524D\u72B6\u6001\uFF1B\u672A\u914D\u7F6E\u641C\u7D22\u6761\u4EF6\u65F6\u4E3A\u7A7A\u5BF9\u8C61";
|
|
130
|
+
export function configureTableActionsScope(env, configure) {
|
|
131
|
+
configure(env);
|
|
132
|
+
env.registerVariable("selected", "list<dyn>", {
|
|
133
|
+
label: "\u5DF2\u9009\u884C",
|
|
134
|
+
description: "\u5F53\u524D\u5DF2\u52FE\u9009\u7684\u6240\u6709\u884C\uFF08`row` \u7684\u6570\u7EC4\uFF09"
|
|
135
|
+
});
|
|
136
|
+
env.registerVariable("query", "dyn", {
|
|
137
|
+
label: "\u641C\u7D22\u6761\u4EF6",
|
|
138
|
+
description: QUERY_VAR_DESCRIPTION
|
|
139
|
+
});
|
|
140
|
+
}
|
|
130
141
|
export function DataSource(configure, extras) {
|
|
131
142
|
const CelRequest = Expression({
|
|
132
143
|
configure: (env) => {
|
|
@@ -215,12 +226,7 @@ export function TableConfig(configure) {
|
|
|
215
226
|
resultType: (type) => type === "string" || type === "number" || type === "dyn"
|
|
216
227
|
});
|
|
217
228
|
const dataSourceSchema = tableDataSource(configure);
|
|
218
|
-
const { fields: actionFields } = ActionSchemaFields((env) =>
|
|
219
|
-
configure(env);
|
|
220
|
-
env.registerVariable("selected", "list<dyn>", {
|
|
221
|
-
description: "\u5F53\u524D\u5DF2\u52FE\u9009\u7684\u6240\u6709\u884C\uFF08`row` \u7684\u6570\u7EC4\uFF09"
|
|
222
|
-
});
|
|
223
|
-
});
|
|
229
|
+
const { fields: actionFields } = ActionSchemaFields((env) => configureTableActionsScope(env, configure));
|
|
224
230
|
const TableActions = Schema.Struct(actionFields).annotations({
|
|
225
231
|
title: "TableActions",
|
|
226
232
|
description: "\u8868\u683C\u7EA7\u64CD\u4F5C\u6309\u94AE"
|