@shwfed/config 2.3.23 → 2.3.25

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.
Files changed (65) hide show
  1. package/dist/mcp.mjs +1426 -592
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-C-EOrL-v.js → config-BYTuKQZr.js} +1 -1
  4. package/dist/preview/assets/{config-BLxl7ROb.js → config-BoE06fMj.js} +1 -1
  5. package/dist/preview/assets/{config-BWMtPN22.js → config-CV5P2_b2.js} +1 -1
  6. package/dist/preview/assets/{config-CJADmi-_.js → config-CVAFGzPb.js} +1 -1
  7. package/dist/preview/assets/{config-5rB9Rnmf.js → config-CdH0Nxqa.js} +1 -1
  8. package/dist/preview/assets/{config-pVNUrcvS.js → config-CjlRnKnY.js} +1 -1
  9. package/dist/preview/assets/{config-DUNvg-mJ.js → config-CrvG15To.js} +1 -1
  10. package/dist/preview/assets/{config-EtlOM9yx.js → config-DZXC8YJ4.js} +1 -1
  11. package/dist/preview/assets/{config-f66PEpZ5.js → config-QaYy6DCp.js} +1 -1
  12. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-DUu-CoTZ.js → definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.js} +1 -1
  13. package/dist/preview/assets/{index-CJMxrUKZ.css → index-BCE-G4Ha.css} +1 -1
  14. package/dist/preview/assets/index-BbnG2cVz.js +643 -0
  15. package/dist/preview/assets/index-NFKAYzMi.js +1 -0
  16. package/dist/preview/assets/{runtime-P99-0gRD.js → runtime-1AP_-j3e.js} +1 -1
  17. package/dist/preview/assets/{runtime-CFPeFbAB.js → runtime-BQiYt6n7.js} +1 -1
  18. package/dist/preview/assets/{runtime-B9GkQToM.js → runtime-BsiLYYky.js} +1 -1
  19. package/dist/preview/assets/{runtime-qQ5mJdRv.js → runtime-C-h7PIyx.js} +1 -1
  20. package/dist/preview/assets/{runtime-DcqfhaaX.js → runtime-CGW3z1YJ.js} +1 -1
  21. package/dist/preview/assets/{runtime-DoLJtHV2.js → runtime-C_R-VCbd.js} +1 -1
  22. package/dist/preview/assets/{runtime-CUBGWRtC.js → runtime-DGdEDDUA.js} +1 -1
  23. package/dist/preview/assets/{runtime-CI38ypkY.js → runtime-DwXjew7j.js} +1 -1
  24. package/dist/preview/assets/{runtime-C0v-S40R.js → runtime-pM3u8QsQ.js} +1 -1
  25. package/dist/preview/index.html +2 -2
  26. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +4 -4
  27. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +4 -4
  28. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +4 -4
  29. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +4 -4
  30. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +163 -0
  31. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue +699 -0
  32. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +163 -0
  33. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
  34. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue +368 -0
  35. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
  36. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.d.ts +251 -0
  37. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.js +178 -0
  38. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +167 -0
  39. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue +732 -0
  40. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +167 -0
  41. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.d.vue.ts +9 -0
  42. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +402 -0
  43. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue.d.ts +9 -0
  44. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +253 -0
  45. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.js +230 -0
  46. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +163 -0
  47. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue +699 -0
  48. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +163 -0
  49. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.d.vue.ts +9 -0
  50. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.vue +349 -0
  51. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.vue.d.ts +9 -0
  52. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.d.ts +251 -0
  53. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.js +178 -0
  54. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +167 -0
  55. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue +732 -0
  56. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +167 -0
  57. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.d.vue.ts +9 -0
  58. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.vue +383 -0
  59. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.vue.d.ts +9 -0
  60. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +253 -0
  61. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.js +230 -0
  62. package/dist/runtime/components/table/config.vue +40 -0
  63. package/package.json +1 -1
  64. package/dist/preview/assets/index-B4xolIUJ.js +0 -643
  65. package/dist/preview/assets/index-DFYLO8qf.js +0 -1
@@ -0,0 +1,251 @@
1
+ import { Schema } from 'effect';
2
+ import type { ColumnDef } from '@tanstack/vue-table';
3
+ import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
4
+ import type { ColumnDefDeps, MigrateFn, MigrateSource } from '../../../utils/resolve.js';
5
+ export declare const type: "com.shwfed.table.column.combobox-single";
6
+ export declare const compatibilityDate: "2026-05-26";
7
+ export declare const metadata: {
8
+ readonly name: "单选";
9
+ readonly icon: "fluent:chevron-down-20-regular";
10
+ };
11
+ export declare function itemSchema(configure: (env: Environment) => void): Schema.Struct<{
12
+ id: Schema.refine<string, typeof Schema.String>;
13
+ label: Schema.refine<readonly [{
14
+ readonly locale: "zh";
15
+ readonly message: string;
16
+ }, ...{
17
+ readonly locale: "en" | "ja" | "ko";
18
+ readonly message: string;
19
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
20
+ locale: Schema.Literal<["zh"]>;
21
+ message: Schema.SchemaClass<string, string, never>;
22
+ }>], [Schema.Struct<{
23
+ locale: Schema.Literal<["ja", "en", "ko"]>;
24
+ message: Schema.SchemaClass<string, string, never>;
25
+ }>]>>;
26
+ value: Schema.Union<[Schema.Struct<{
27
+ kind: Schema.Literal<["text"]>;
28
+ value: typeof Schema.String;
29
+ }>, Schema.Struct<{
30
+ kind: Schema.Literal<["number"]>;
31
+ value: typeof Schema.Number;
32
+ }>]>;
33
+ tooltip: Schema.optional<Schema.refine<readonly [{
34
+ readonly locale: "zh";
35
+ readonly message: string;
36
+ }, ...{
37
+ readonly locale: "en" | "ja" | "ko";
38
+ readonly message: string;
39
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
40
+ locale: Schema.Literal<["zh"]>;
41
+ message: Schema.SchemaClass<string, string, never>;
42
+ }>], [Schema.Struct<{
43
+ locale: Schema.Literal<["ja", "en", "ko"]>;
44
+ message: Schema.SchemaClass<string, string, never>;
45
+ }>]>>>;
46
+ }>;
47
+ export declare function remoteOptionsSchema(configure: (env: Environment) => void): Schema.Struct<{
48
+ kind: Schema.Literal<["remote"]>;
49
+ request: Schema.Schema<string, string, never>;
50
+ options: Schema.Schema<string, string, never>;
51
+ optionValue: Schema.optionalWith<Schema.Schema<string, string, never>, {
52
+ default: () => string;
53
+ }>;
54
+ optionLabel: Schema.optionalWith<Schema.refine<readonly [{
55
+ readonly locale: "zh";
56
+ readonly message: string;
57
+ }, ...{
58
+ readonly locale: "en" | "ja" | "ko";
59
+ readonly message: string;
60
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
61
+ locale: Schema.Literal<["zh"]>;
62
+ message: Schema.SchemaClass<string, string, never>;
63
+ }>], [Schema.Struct<{
64
+ locale: Schema.Literal<["ja", "en", "ko"]>;
65
+ message: Schema.SchemaClass<string, string, never>;
66
+ }>]>>, {
67
+ default: () => readonly [{
68
+ readonly locale: "zh";
69
+ readonly message: "";
70
+ }];
71
+ }>;
72
+ }>;
73
+ export declare function optionsSchema(configure: (env: Environment) => void): Schema.Union<[Schema.Struct<{
74
+ kind: Schema.Literal<["static"]>;
75
+ items: Schema.optionalWith<Schema.Array$<Schema.Struct<{
76
+ id: Schema.refine<string, typeof Schema.String>;
77
+ label: Schema.refine<readonly [{
78
+ readonly locale: "zh";
79
+ readonly message: string;
80
+ }, ...{
81
+ readonly locale: "en" | "ja" | "ko";
82
+ readonly message: string;
83
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
84
+ locale: Schema.Literal<["zh"]>;
85
+ message: Schema.SchemaClass<string, string, never>;
86
+ }>], [Schema.Struct<{
87
+ locale: Schema.Literal<["ja", "en", "ko"]>;
88
+ message: Schema.SchemaClass<string, string, never>;
89
+ }>]>>;
90
+ value: Schema.Union<[Schema.Struct<{
91
+ kind: Schema.Literal<["text"]>;
92
+ value: typeof Schema.String;
93
+ }>, Schema.Struct<{
94
+ kind: Schema.Literal<["number"]>;
95
+ value: typeof Schema.Number;
96
+ }>]>;
97
+ tooltip: Schema.optional<Schema.refine<readonly [{
98
+ readonly locale: "zh";
99
+ readonly message: string;
100
+ }, ...{
101
+ readonly locale: "en" | "ja" | "ko";
102
+ readonly message: string;
103
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
104
+ locale: Schema.Literal<["zh"]>;
105
+ message: Schema.SchemaClass<string, string, never>;
106
+ }>], [Schema.Struct<{
107
+ locale: Schema.Literal<["ja", "en", "ko"]>;
108
+ message: Schema.SchemaClass<string, string, never>;
109
+ }>]>>>;
110
+ }>>, {
111
+ default: () => readonly [];
112
+ }>;
113
+ }>, Schema.Struct<{
114
+ kind: Schema.Literal<["remote"]>;
115
+ request: Schema.Schema<string, string, never>;
116
+ options: Schema.Schema<string, string, never>;
117
+ optionValue: Schema.optionalWith<Schema.Schema<string, string, never>, {
118
+ default: () => string;
119
+ }>;
120
+ optionLabel: Schema.optionalWith<Schema.refine<readonly [{
121
+ readonly locale: "zh";
122
+ readonly message: string;
123
+ }, ...{
124
+ readonly locale: "en" | "ja" | "ko";
125
+ readonly message: string;
126
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
127
+ locale: Schema.Literal<["zh"]>;
128
+ message: Schema.SchemaClass<string, string, never>;
129
+ }>], [Schema.Struct<{
130
+ locale: Schema.Literal<["ja", "en", "ko"]>;
131
+ message: Schema.SchemaClass<string, string, never>;
132
+ }>]>>, {
133
+ default: () => readonly [{
134
+ readonly locale: "zh";
135
+ readonly message: "";
136
+ }];
137
+ }>;
138
+ }>]>;
139
+ export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
140
+ placeholder: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
141
+ locale: Schema.Literal<["zh"]>;
142
+ message: Schema.SchemaClass<string, string, never>;
143
+ }>], [Schema.Struct<{
144
+ locale: Schema.Literal<["ja", "en", "ko"]>;
145
+ message: Schema.SchemaClass<string, string, never>;
146
+ }>]>>;
147
+ hidden: Schema.optional<Schema.Schema<string, string, never>>;
148
+ disabled: Schema.optional<Schema.Schema<string, string, never>>;
149
+ readonly: Schema.optional<Schema.Schema<string, string, never>>;
150
+ derived: Schema.optional<Schema.Struct<{
151
+ mode: Schema.Literal<["formula", "prefill"]>;
152
+ expression: Schema.Schema<string, string, never>;
153
+ }>>;
154
+ options: Schema.optionalWith<Schema.Union<[Schema.Struct<{
155
+ kind: Schema.Literal<["static"]>;
156
+ items: Schema.optionalWith<Schema.Array$<Schema.Struct<{
157
+ id: Schema.refine<string, typeof Schema.String>;
158
+ label: Schema.refine<readonly [{
159
+ readonly locale: "zh";
160
+ readonly message: string;
161
+ }, ...{
162
+ readonly locale: "en" | "ja" | "ko";
163
+ readonly message: string;
164
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
165
+ locale: Schema.Literal<["zh"]>;
166
+ message: Schema.SchemaClass<string, string, never>;
167
+ }>], [Schema.Struct<{
168
+ locale: Schema.Literal<["ja", "en", "ko"]>;
169
+ message: Schema.SchemaClass<string, string, never>;
170
+ }>]>>;
171
+ value: Schema.Union<[Schema.Struct<{
172
+ kind: Schema.Literal<["text"]>;
173
+ value: typeof Schema.String;
174
+ }>, Schema.Struct<{
175
+ kind: Schema.Literal<["number"]>;
176
+ value: typeof Schema.Number;
177
+ }>]>;
178
+ tooltip: Schema.optional<Schema.refine<readonly [{
179
+ readonly locale: "zh";
180
+ readonly message: string;
181
+ }, ...{
182
+ readonly locale: "en" | "ja" | "ko";
183
+ readonly message: string;
184
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
185
+ locale: Schema.Literal<["zh"]>;
186
+ message: Schema.SchemaClass<string, string, never>;
187
+ }>], [Schema.Struct<{
188
+ locale: Schema.Literal<["ja", "en", "ko"]>;
189
+ message: Schema.SchemaClass<string, string, never>;
190
+ }>]>>>;
191
+ }>>, {
192
+ default: () => readonly [];
193
+ }>;
194
+ }>, Schema.Struct<{
195
+ kind: Schema.Literal<["remote"]>;
196
+ request: Schema.Schema<string, string, never>;
197
+ options: Schema.Schema<string, string, never>;
198
+ optionValue: Schema.optionalWith<Schema.Schema<string, string, never>, {
199
+ default: () => string;
200
+ }>;
201
+ optionLabel: Schema.optionalWith<Schema.refine<readonly [{
202
+ readonly locale: "zh";
203
+ readonly message: string;
204
+ }, ...{
205
+ readonly locale: "en" | "ja" | "ko";
206
+ readonly message: string;
207
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
208
+ locale: Schema.Literal<["zh"]>;
209
+ message: Schema.SchemaClass<string, string, never>;
210
+ }>], [Schema.Struct<{
211
+ locale: Schema.Literal<["ja", "en", "ko"]>;
212
+ message: Schema.SchemaClass<string, string, never>;
213
+ }>]>>, {
214
+ default: () => readonly [{
215
+ readonly locale: "zh";
216
+ readonly message: "";
217
+ }];
218
+ }>;
219
+ }>]>, {
220
+ default: () => {
221
+ kind: "static";
222
+ items: readonly [];
223
+ };
224
+ }>;
225
+ title: Schema.TupleType<readonly [Schema.Struct<{
226
+ locale: Schema.Literal<["zh"]>;
227
+ message: Schema.SchemaClass<string, string, never>;
228
+ }>], [Schema.Struct<{
229
+ locale: Schema.Literal<["ja", "en", "ko"]>;
230
+ message: Schema.SchemaClass<string, string, never>;
231
+ }>]>;
232
+ binding: Schema.refine<string, typeof Schema.String>;
233
+ enableSorting: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
234
+ size: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
235
+ grow: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
236
+ tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
237
+ locale: Schema.Literal<["zh"]>;
238
+ message: Schema.SchemaClass<string, string, never>;
239
+ }>], [Schema.Struct<{
240
+ locale: Schema.Literal<["ja", "en", "ko"]>;
241
+ message: Schema.SchemaClass<string, string, never>;
242
+ }>]>>;
243
+ id: Schema.refine<string, typeof Schema.String>;
244
+ groupId: Schema.optional<typeof Schema.UUID>;
245
+ type: Schema.Literal<["com.shwfed.table.column.combobox-single"]>;
246
+ compatibilityDate: Schema.Literal<["2026-05-26"]>;
247
+ }>;
248
+ export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
249
+ export declare const migrateFrom: ReadonlyArray<MigrateSource>;
250
+ export declare const migrate: MigrateFn;
251
+ export declare function toColumnDef(value: Value, { getLocaleText }: ColumnDefDeps): Partial<ColumnDef<unknown, unknown>>;
@@ -0,0 +1,178 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { getProperty } from "dot-prop";
3
+ import { Locale } from "../../../../../share/locale.js";
4
+ import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
5
+ import {
6
+ CelRowAccess,
7
+ derivedRowField,
8
+ editableColumnFields,
9
+ editableHeader,
10
+ LocaleMarkdownWithRow,
11
+ registerRowVariablesIfAbsent
12
+ } from "../../../utils/shared.js";
13
+ export const type = "com.shwfed.table.column.combobox-single";
14
+ export const compatibilityDate = "2026-05-26";
15
+ export const metadata = {
16
+ name: "\u5355\u9009",
17
+ icon: "fluent:chevron-down-20-regular"
18
+ };
19
+ const isListType = (actual) => actual === "dyn" || actual.startsWith("list");
20
+ export function itemSchema(configure) {
21
+ const LocaleMd = LocaleMarkdownWithRow(configure);
22
+ const TextValue = Schema.Struct({
23
+ kind: Schema.Literal("text"),
24
+ value: Schema.String
25
+ });
26
+ const NumberValue = Schema.Struct({
27
+ kind: Schema.Literal("number"),
28
+ value: Schema.Number
29
+ });
30
+ const ItemValue = Schema.Union(TextValue, NumberValue).annotations({
31
+ title: "\u503C",
32
+ description: "\u9009\u9879\u7ED1\u5B9A\u7684\u503C\uFF0C\u53EF\u4EE5\u662F\u6587\u672C\u6216\u6570\u5B57"
33
+ });
34
+ return Schema.Struct({
35
+ id: Schema.UUID.annotations({ description: "\u9009\u9879\u552F\u4E00\u6807\u8BC6\uFF0C\u7528\u4E8E\u7A33\u5B9A\u7684 v-for key" }),
36
+ label: LocaleMd.annotations({
37
+ title: "\u6807\u7B7E",
38
+ description: "\u9009\u9879\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 Markdown \u4E0E `{{ row.foo }}` / `{{ form.bar }}` \u63D2\u503C"
39
+ }),
40
+ value: ItemValue,
41
+ tooltip: Schema.optional(LocaleMd.annotations({
42
+ title: "\u63D0\u793A",
43
+ description: "\u9F20\u6807\u60AC\u505C\u5728\u9009\u9879\u4E0A\u65F6\u5C55\u793A\u7684\u672C\u5730\u5316\u63D0\u793A\uFF0C\u652F\u6301 Markdown"
44
+ }))
45
+ }).annotations({
46
+ title: "ComboboxSingleItem"
47
+ });
48
+ }
49
+ export function remoteOptionsSchema(configure) {
50
+ const CelRequest = Expression({
51
+ configure: (env) => {
52
+ configure(env);
53
+ registerRowVariablesIfAbsent(env);
54
+ },
55
+ resultType: "HttpRequest"
56
+ });
57
+ const CelOptions = Expression({
58
+ configure: (env) => {
59
+ configure(env);
60
+ registerRowVariablesIfAbsent(env);
61
+ env.registerVariable("json", "dyn", { description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09\uFF1B\u8BF7\u6C42\u5931\u8D25\u6216\u5C1A\u672A\u5B8C\u6210\u65F6\u4E3A `null`" });
62
+ },
63
+ resultType: isListType
64
+ });
65
+ const CelOptionValue = Expression({
66
+ configure: (env) => {
67
+ configure(env);
68
+ registerRowVariablesIfAbsent(env);
69
+ env.registerVariable("option", "dyn", { description: "`\u9009\u9879` \u8868\u8FBE\u5F0F\u4EA7\u51FA\u7684\u6570\u7EC4\u4E2D\u8FED\u4EE3\u5230\u7684\u5355\u4E2A\u5143\u7D20" });
70
+ },
71
+ resultType: "dyn"
72
+ });
73
+ const LocaleOptionLabel = LocaleMarkdown({
74
+ configure: (env) => {
75
+ configure(env);
76
+ registerRowVariablesIfAbsent(env);
77
+ env.registerVariable("option", "dyn", { description: "`\u9009\u9879` \u8868\u8FBE\u5F0F\u4EA7\u51FA\u7684\u6570\u7EC4\u4E2D\u8FED\u4EE3\u5230\u7684\u5355\u4E2A\u5143\u7D20" });
78
+ }
79
+ });
80
+ return Schema.Struct({
81
+ kind: Schema.Literal("remote"),
82
+ request: CelRequest.annotations({
83
+ title: "\u8BF7\u6C42",
84
+ description: "\u8FD4\u56DE `HttpRequest` \u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u53EF\u8BBF\u95EE `row` \u4E0E `index`\u3002\u76F8\u540C\u7B7E\u540D\u7684\u8BF7\u6C42\u4F1A\u5728\u8BE5\u8868\u683C\u5185\u81EA\u52A8\u53BB\u91CD"
85
+ }),
86
+ options: CelOptions.annotations({
87
+ title: "\u9009\u9879",
88
+ description: "\u4ECE HTTP \u54CD\u5E94\u4F53\u63D0\u53D6\u9009\u9879\u6570\u7EC4\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u53EF\u8BBF\u95EE `row`\u3001`index` \u4E0E `json`\u3002\u4F8B\uFF1A`json.data`"
89
+ }),
90
+ optionValue: Schema.optionalWith(CelOptionValue.annotations({
91
+ title: "\u9009\u9879\u503C",
92
+ description: "\u4ECE\u5F53\u524D `option` \u63D0\u53D6\u5199\u5165\u503C\u7684 CEL\uFF1B\u4F8B\uFF1A`option.value`"
93
+ }), { default: () => "option" }),
94
+ optionLabel: Schema.optionalWith(LocaleOptionLabel.annotations({
95
+ title: "\u9009\u9879\u6807\u7B7E",
96
+ description: "\u6BCF\u4E2A\u9009\u9879\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 `{{ string(option.foo) }}` \u63D2\u503C"
97
+ }), { default: () => [{ locale: "zh", message: "" }] })
98
+ }).annotations({ title: "ComboboxSingleOptionsRemote", description: "\u8FDC\u7A0B\u52A0\u8F7D\u7684\u9009\u9879\u5217\u8868" });
99
+ }
100
+ export function optionsSchema(configure) {
101
+ const Item = itemSchema(configure);
102
+ const StaticSpec = Schema.Struct({
103
+ kind: Schema.Literal("static"),
104
+ items: Schema.optionalWith(Schema.Array(Item).annotations({
105
+ title: "\u9009\u9879",
106
+ description: "\u4E0B\u62C9\u6846\u53EF\u9009\u9879\u5217\u8868"
107
+ }), { default: () => [] })
108
+ }).annotations({ title: "ComboboxSingleOptionsStatic", description: "\u9759\u6001\u914D\u7F6E\u7684\u9009\u9879\u5217\u8868" });
109
+ const RemoteSpec = remoteOptionsSchema(configure);
110
+ return Schema.Union(StaticSpec, RemoteSpec).annotations({
111
+ title: "\u9009\u9879\u6765\u6E90",
112
+ description: '\u9009\u9879\u53EF\u4EE5\u662F\u9759\u6001\u914D\u7F6E\uFF08`kind: "static"`\uFF09\u6216\u7531\u8FDC\u7A0B\u63A5\u53E3\u52A0\u8F7D\uFF08`kind: "remote"`\uFF09'
113
+ });
114
+ }
115
+ export function schema(configure) {
116
+ const CelBool = CelRowAccess(configure, { resultType: "bool" });
117
+ const Options = optionsSchema(configure);
118
+ return Schema.Struct({
119
+ type: Schema.Literal(type),
120
+ compatibilityDate: Schema.Literal(compatibilityDate),
121
+ ...editableColumnFields(),
122
+ placeholder: Schema.optional(Locale.annotations({
123
+ title: "\u5360\u4F4D\u7B26",
124
+ description: "\u672A\u9009\u4E2D\u4EFB\u4F55\u9009\u9879\u65F6\u8F93\u5165\u6846\u4E2D\u7684\u5360\u4F4D\u6587\u672C"
125
+ })),
126
+ hidden: Schema.optional(CelBool.annotations({
127
+ title: "\u9690\u85CF\u6761\u4EF6",
128
+ description: "\u8FD4\u56DE `true` \u65F6\u8BE5\u884C\u7684\u4E0B\u62C9\u6846\u4E0D\u6E32\u67D3\uFF08\u5176\u4F59\u884C\u4E0D\u53D7\u5F71\u54CD\uFF09"
129
+ })),
130
+ disabled: Schema.optional(CelBool.annotations({
131
+ title: "\u7981\u7528\u6761\u4EF6",
132
+ description: "\u8FD4\u56DE `true` \u65F6\u4E0B\u62C9\u6846\u4ECD\u7136\u6E32\u67D3\u4F46\u4E0D\u53EF\u9009\u62E9"
133
+ })),
134
+ readonly: Schema.optional(CelBool.annotations({
135
+ title: "\u53EA\u8BFB\u6761\u4EF6",
136
+ description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u9009\u9879\u7684\u6807\u7B7E"
137
+ })),
138
+ derived: derivedRowField(configure, "dyn"),
139
+ options: Schema.optionalWith(Options, {
140
+ default: () => ({ kind: "static", items: [] })
141
+ })
142
+ }).annotations({ title: "ComboboxSingleRenderer", description: "\u4E0B\u62C9\u5355\u9009\u6E32\u67D3\u5668\uFF08\u53EF\u7F16\u8F91\uFF09" });
143
+ }
144
+ export const migrateFrom = [
145
+ { type: "com.shwfed.table.column.combobox-single", compatibilityDate: "2026-05-20" }
146
+ ];
147
+ export const migrate = (prev) => Effect.try({
148
+ try: () => {
149
+ if (!prev || typeof prev !== "object") {
150
+ throw new Error("\u4E0B\u62C9\u5355\u9009\u8FC1\u79FB\u5931\u8D25\uFF1A\u539F\u503C\u4E0D\u662F\u5BF9\u8C61");
151
+ }
152
+ const { items, ...rest } = prev;
153
+ const itemsArr = Array.isArray(items) ? items : [];
154
+ return {
155
+ ...rest,
156
+ type,
157
+ compatibilityDate,
158
+ options: { kind: "static", items: itemsArr }
159
+ };
160
+ },
161
+ catch: (e) => e instanceof Error ? e : new Error(String(e))
162
+ });
163
+ export function toColumnDef(value, { getLocaleText }) {
164
+ return {
165
+ header: editableHeader(getLocaleText(value.title)),
166
+ accessorFn: (row) => {
167
+ if (!row || typeof row !== "object") return void 0;
168
+ return getProperty(row, value.binding);
169
+ },
170
+ enableSorting: value.enableSorting ?? false,
171
+ sortingFn: "basic",
172
+ size: value.size,
173
+ meta: {
174
+ grow: value.grow ?? false,
175
+ tooltip: getLocaleText(value.tooltip)
176
+ }
177
+ };
178
+ }
@@ -0,0 +1,167 @@
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 size?: number | undefined;
8
+ readonly onChange?: string | undefined;
9
+ readonly disabled?: string | undefined;
10
+ readonly type: "com.shwfed.table.column.combobox-single.remote";
11
+ readonly id: string;
12
+ readonly title: readonly [{
13
+ readonly locale: "zh";
14
+ readonly message: string;
15
+ }, ...{
16
+ readonly locale: "en" | "ja" | "ko";
17
+ readonly message: string;
18
+ }[]];
19
+ readonly hidden?: string | undefined;
20
+ readonly tooltip?: readonly [{
21
+ readonly locale: "zh";
22
+ readonly message: string;
23
+ }, ...{
24
+ readonly locale: "en" | "ja" | "ko";
25
+ readonly message: string;
26
+ }[]] | undefined;
27
+ readonly compatibilityDate: "2026-05-26";
28
+ readonly triggers?: readonly {
29
+ readonly target: string;
30
+ readonly operation: string;
31
+ }[] | undefined;
32
+ readonly groupId?: string | undefined;
33
+ readonly placeholder?: readonly [{
34
+ readonly locale: "zh";
35
+ readonly message: string;
36
+ }, ...{
37
+ readonly locale: "en" | "ja" | "ko";
38
+ readonly message: string;
39
+ }[]] | undefined;
40
+ readonly readonly?: string | undefined;
41
+ readonly grow?: boolean | undefined;
42
+ readonly accessor: string;
43
+ readonly options: {
44
+ readonly kind: "remote";
45
+ readonly request: string;
46
+ readonly options: string;
47
+ readonly optionValue: string;
48
+ readonly optionLabel: readonly [{
49
+ readonly locale: "zh";
50
+ readonly message: string;
51
+ }, ...{
52
+ readonly locale: "en" | "ja" | "ko";
53
+ readonly message: string;
54
+ }[]];
55
+ } | {
56
+ readonly kind: "static";
57
+ readonly items: readonly {
58
+ readonly label: readonly [{
59
+ readonly locale: "zh";
60
+ readonly message: string;
61
+ }, ...{
62
+ readonly locale: "en" | "ja" | "ko";
63
+ readonly message: string;
64
+ }[]];
65
+ readonly id: string;
66
+ readonly tooltip?: readonly [{
67
+ readonly locale: "zh";
68
+ readonly message: string;
69
+ }, ...{
70
+ readonly locale: "en" | "ja" | "ko";
71
+ readonly message: string;
72
+ }[]] | undefined;
73
+ readonly value: {
74
+ readonly value: string;
75
+ readonly kind: "text";
76
+ } | {
77
+ readonly value: number;
78
+ readonly kind: "number";
79
+ };
80
+ }[];
81
+ };
82
+ readonly enableSorting?: boolean | undefined;
83
+ readonly successMessage?: string | undefined;
84
+ }) => any;
85
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
86
+ "onUpdate:modelValue"?: ((value: {
87
+ readonly size?: number | undefined;
88
+ readonly onChange?: string | undefined;
89
+ readonly disabled?: string | undefined;
90
+ readonly type: "com.shwfed.table.column.combobox-single.remote";
91
+ readonly id: string;
92
+ readonly title: readonly [{
93
+ readonly locale: "zh";
94
+ readonly message: string;
95
+ }, ...{
96
+ readonly locale: "en" | "ja" | "ko";
97
+ readonly message: string;
98
+ }[]];
99
+ readonly hidden?: string | undefined;
100
+ readonly tooltip?: readonly [{
101
+ readonly locale: "zh";
102
+ readonly message: string;
103
+ }, ...{
104
+ readonly locale: "en" | "ja" | "ko";
105
+ readonly message: string;
106
+ }[]] | undefined;
107
+ readonly compatibilityDate: "2026-05-26";
108
+ readonly triggers?: readonly {
109
+ readonly target: string;
110
+ readonly operation: string;
111
+ }[] | undefined;
112
+ readonly groupId?: string | undefined;
113
+ readonly placeholder?: readonly [{
114
+ readonly locale: "zh";
115
+ readonly message: string;
116
+ }, ...{
117
+ readonly locale: "en" | "ja" | "ko";
118
+ readonly message: string;
119
+ }[]] | undefined;
120
+ readonly readonly?: string | undefined;
121
+ readonly grow?: boolean | undefined;
122
+ readonly accessor: string;
123
+ readonly options: {
124
+ readonly kind: "remote";
125
+ readonly request: string;
126
+ readonly options: string;
127
+ readonly optionValue: string;
128
+ readonly optionLabel: readonly [{
129
+ readonly locale: "zh";
130
+ readonly message: string;
131
+ }, ...{
132
+ readonly locale: "en" | "ja" | "ko";
133
+ readonly message: string;
134
+ }[]];
135
+ } | {
136
+ readonly kind: "static";
137
+ readonly items: readonly {
138
+ readonly label: readonly [{
139
+ readonly locale: "zh";
140
+ readonly message: string;
141
+ }, ...{
142
+ readonly locale: "en" | "ja" | "ko";
143
+ readonly message: string;
144
+ }[]];
145
+ readonly id: string;
146
+ readonly tooltip?: readonly [{
147
+ readonly locale: "zh";
148
+ readonly message: string;
149
+ }, ...{
150
+ readonly locale: "en" | "ja" | "ko";
151
+ readonly message: string;
152
+ }[]] | undefined;
153
+ readonly value: {
154
+ readonly value: string;
155
+ readonly kind: "text";
156
+ } | {
157
+ readonly value: number;
158
+ readonly kind: "number";
159
+ };
160
+ }[];
161
+ };
162
+ readonly enableSorting?: boolean | undefined;
163
+ readonly successMessage?: string | undefined;
164
+ }) => any) | undefined;
165
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
166
+ declare const _default: typeof __VLS_export;
167
+ export default _default;