@shwfed/config 2.3.22 → 2.3.24

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 (76) hide show
  1. package/dist/mcp.mjs +1503 -645
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-DhwLB2Ee.js → config-B-6Htwv0.js} +1 -1
  4. package/dist/preview/assets/{config-BiFAbTJq.js → config-B2KjxFl5.js} +1 -1
  5. package/dist/preview/assets/{config-B3mv60t8.js → config-B3at5Bue.js} +1 -1
  6. package/dist/preview/assets/{config-CLjwrQXG.js → config-Bi9uFh4Y.js} +1 -1
  7. package/dist/preview/assets/{config-D4fS9GYw.js → config-CBHKrOP5.js} +1 -1
  8. package/dist/preview/assets/{config-CpvkgqGg.js → config-CWZxlCMJ.js} +1 -1
  9. package/dist/preview/assets/{config-Cb9lQXQG.js → config-CaZpOvHG.js} +1 -1
  10. package/dist/preview/assets/{config-DY7n8WvE.js → config-D5Kfssb7.js} +1 -1
  11. package/dist/preview/assets/{config-DX6QxjI7.js → config-DYAEfkYR.js} +1 -1
  12. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-Hx2iV358.js → definition.vue_vue_type_script_setup_true_lang-8BVrrrak.js} +1 -1
  13. package/dist/preview/assets/index-B3wadvvl.js +1 -0
  14. package/dist/preview/assets/{index-CDhwf1Dw.css → index-CJMxrUKZ.css} +1 -1
  15. package/dist/preview/assets/index-DTsYYECD.js +643 -0
  16. package/dist/preview/assets/{runtime-BarNw942.js → runtime-C1iENPNJ.js} +1 -1
  17. package/dist/preview/assets/{runtime-HQv4w652.js → runtime-C5CCMnHt.js} +1 -1
  18. package/dist/preview/assets/{runtime-usxovPqT.js → runtime-CEP42oTV.js} +1 -1
  19. package/dist/preview/assets/{runtime-Dl0d8KFj.js → runtime-CRHn61GX.js} +1 -1
  20. package/dist/preview/assets/{runtime-BazV3vOW.js → runtime-CoRrnGx1.js} +1 -1
  21. package/dist/preview/assets/{runtime-DIcMvC6H.js → runtime-CqciI2ST.js} +1 -1
  22. package/dist/preview/assets/{runtime-BXZROm-z.js → runtime-Hvzx1ucy.js} +1 -1
  23. package/dist/preview/assets/{runtime-CShAGyQk.js → runtime-aBsBSCeg.js} +1 -1
  24. package/dist/preview/assets/{runtime-ECoXJ0-J.js → runtime-jrsJfwMb.js} +1 -1
  25. package/dist/preview/index.html +2 -2
  26. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +99 -0
  27. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue +329 -0
  28. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +99 -0
  29. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.d.vue.ts +8 -0
  30. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue +265 -0
  31. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue.d.ts +8 -0
  32. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.d.ts +79 -0
  33. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.js +71 -0
  34. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +133 -0
  35. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue +533 -0
  36. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +133 -0
  37. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
  38. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue +247 -0
  39. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
  40. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.d.ts +124 -0
  41. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.js +94 -0
  42. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +109 -0
  43. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue +426 -0
  44. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +109 -0
  45. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.d.vue.ts +9 -0
  46. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue +356 -0
  47. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue.d.ts +9 -0
  48. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +85 -0
  49. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.js +147 -0
  50. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +137 -0
  51. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue +586 -0
  52. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +137 -0
  53. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.d.vue.ts +9 -0
  54. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue +287 -0
  55. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue.d.ts +9 -0
  56. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +126 -0
  57. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.js +125 -0
  58. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +163 -0
  59. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue +709 -0
  60. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +163 -0
  61. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
  62. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue +368 -0
  63. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
  64. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.d.ts +225 -0
  65. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.js +175 -0
  66. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +167 -0
  67. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue +740 -0
  68. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +167 -0
  69. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.d.vue.ts +9 -0
  70. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +402 -0
  71. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue.d.ts +9 -0
  72. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +227 -0
  73. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.js +227 -0
  74. package/package.json +1 -1
  75. package/dist/preview/assets/index-B2gp2q3H.js +0 -643
  76. package/dist/preview/assets/index-Jytc_ICm.js +0 -1
@@ -0,0 +1,227 @@
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-multi.remote";
6
+ export declare const compatibilityDate: "2026-05-26";
7
+ export declare const metadata: {
8
+ readonly name: "下拉多选(远程写入)";
9
+ readonly icon: "fluent:cloud-arrow-up-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 optionsSchema(configure: (env: Environment) => void): Schema.Union<[Schema.Struct<{
48
+ kind: Schema.Literal<["static"]>;
49
+ items: Schema.optionalWith<Schema.Array$<Schema.Struct<{
50
+ id: Schema.refine<string, typeof Schema.String>;
51
+ label: Schema.refine<readonly [{
52
+ readonly locale: "zh";
53
+ readonly message: string;
54
+ }, ...{
55
+ readonly locale: "en" | "ja" | "ko";
56
+ readonly message: string;
57
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
58
+ locale: Schema.Literal<["zh"]>;
59
+ message: Schema.SchemaClass<string, string, never>;
60
+ }>], [Schema.Struct<{
61
+ locale: Schema.Literal<["ja", "en", "ko"]>;
62
+ message: Schema.SchemaClass<string, string, never>;
63
+ }>]>>;
64
+ value: Schema.Union<[Schema.Struct<{
65
+ kind: Schema.Literal<["text"]>;
66
+ value: typeof Schema.String;
67
+ }>, Schema.Struct<{
68
+ kind: Schema.Literal<["number"]>;
69
+ value: typeof Schema.Number;
70
+ }>]>;
71
+ tooltip: Schema.optional<Schema.refine<readonly [{
72
+ readonly locale: "zh";
73
+ readonly message: string;
74
+ }, ...{
75
+ readonly locale: "en" | "ja" | "ko";
76
+ readonly message: string;
77
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
78
+ locale: Schema.Literal<["zh"]>;
79
+ message: Schema.SchemaClass<string, string, never>;
80
+ }>], [Schema.Struct<{
81
+ locale: Schema.Literal<["ja", "en", "ko"]>;
82
+ message: Schema.SchemaClass<string, string, never>;
83
+ }>]>>>;
84
+ }>>, {
85
+ default: () => readonly [];
86
+ }>;
87
+ }>, Schema.Struct<{
88
+ kind: Schema.Literal<["remote"]>;
89
+ request: Schema.Schema<string, string, never>;
90
+ options: Schema.Schema<string, string, never>;
91
+ optionValue: Schema.optionalWith<Schema.Schema<string, string, never>, {
92
+ default: () => string;
93
+ }>;
94
+ optionLabel: Schema.optionalWith<Schema.refine<readonly [{
95
+ readonly locale: "zh";
96
+ readonly message: string;
97
+ }, ...{
98
+ readonly locale: "en" | "ja" | "ko";
99
+ readonly message: string;
100
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
101
+ locale: Schema.Literal<["zh"]>;
102
+ message: Schema.SchemaClass<string, string, never>;
103
+ }>], [Schema.Struct<{
104
+ locale: Schema.Literal<["ja", "en", "ko"]>;
105
+ message: Schema.SchemaClass<string, string, never>;
106
+ }>]>>, {
107
+ default: () => readonly [{
108
+ readonly locale: "zh";
109
+ readonly message: "";
110
+ }];
111
+ }>;
112
+ }>]>;
113
+ export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
114
+ placeholder: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
115
+ locale: Schema.Literal<["zh"]>;
116
+ message: Schema.SchemaClass<string, string, never>;
117
+ }>], [Schema.Struct<{
118
+ locale: Schema.Literal<["ja", "en", "ko"]>;
119
+ message: Schema.SchemaClass<string, string, never>;
120
+ }>]>>;
121
+ hidden: Schema.optional<Schema.Schema<string, string, never>>;
122
+ disabled: Schema.optional<Schema.Schema<string, string, never>>;
123
+ readonly: Schema.optional<Schema.Schema<string, string, never>>;
124
+ options: Schema.optionalWith<Schema.Union<[Schema.Struct<{
125
+ kind: Schema.Literal<["static"]>;
126
+ items: Schema.optionalWith<Schema.Array$<Schema.Struct<{
127
+ id: Schema.refine<string, typeof Schema.String>;
128
+ label: Schema.refine<readonly [{
129
+ readonly locale: "zh";
130
+ readonly message: string;
131
+ }, ...{
132
+ readonly locale: "en" | "ja" | "ko";
133
+ readonly message: string;
134
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
135
+ locale: Schema.Literal<["zh"]>;
136
+ message: Schema.SchemaClass<string, string, never>;
137
+ }>], [Schema.Struct<{
138
+ locale: Schema.Literal<["ja", "en", "ko"]>;
139
+ message: Schema.SchemaClass<string, string, never>;
140
+ }>]>>;
141
+ value: Schema.Union<[Schema.Struct<{
142
+ kind: Schema.Literal<["text"]>;
143
+ value: typeof Schema.String;
144
+ }>, Schema.Struct<{
145
+ kind: Schema.Literal<["number"]>;
146
+ value: typeof Schema.Number;
147
+ }>]>;
148
+ tooltip: Schema.optional<Schema.refine<readonly [{
149
+ readonly locale: "zh";
150
+ readonly message: string;
151
+ }, ...{
152
+ readonly locale: "en" | "ja" | "ko";
153
+ readonly message: string;
154
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
155
+ locale: Schema.Literal<["zh"]>;
156
+ message: Schema.SchemaClass<string, string, never>;
157
+ }>], [Schema.Struct<{
158
+ locale: Schema.Literal<["ja", "en", "ko"]>;
159
+ message: Schema.SchemaClass<string, string, never>;
160
+ }>]>>>;
161
+ }>>, {
162
+ default: () => readonly [];
163
+ }>;
164
+ }>, Schema.Struct<{
165
+ kind: Schema.Literal<["remote"]>;
166
+ request: Schema.Schema<string, string, never>;
167
+ options: Schema.Schema<string, string, never>;
168
+ optionValue: Schema.optionalWith<Schema.Schema<string, string, never>, {
169
+ default: () => string;
170
+ }>;
171
+ optionLabel: Schema.optionalWith<Schema.refine<readonly [{
172
+ readonly locale: "zh";
173
+ readonly message: string;
174
+ }, ...{
175
+ readonly locale: "en" | "ja" | "ko";
176
+ readonly message: string;
177
+ }[]], Schema.TupleType<readonly [Schema.Struct<{
178
+ locale: Schema.Literal<["zh"]>;
179
+ message: Schema.SchemaClass<string, string, never>;
180
+ }>], [Schema.Struct<{
181
+ locale: Schema.Literal<["ja", "en", "ko"]>;
182
+ message: Schema.SchemaClass<string, string, never>;
183
+ }>]>>, {
184
+ default: () => readonly [{
185
+ readonly locale: "zh";
186
+ readonly message: "";
187
+ }];
188
+ }>;
189
+ }>]>, {
190
+ default: () => {
191
+ kind: "static";
192
+ items: readonly [];
193
+ };
194
+ }>;
195
+ onChange: Schema.optional<Schema.Schema<string, string, never>>;
196
+ successMessage: Schema.optional<Schema.Schema<string, string, never>>;
197
+ triggers: Schema.optional<Schema.Array$<Schema.Struct<{
198
+ target: Schema.refine<string, typeof Schema.String>;
199
+ operation: Schema.SchemaClass<string, string, never>;
200
+ }>>>;
201
+ title: Schema.TupleType<readonly [Schema.Struct<{
202
+ locale: Schema.Literal<["zh"]>;
203
+ message: Schema.SchemaClass<string, string, never>;
204
+ }>], [Schema.Struct<{
205
+ locale: Schema.Literal<["ja", "en", "ko"]>;
206
+ message: Schema.SchemaClass<string, string, never>;
207
+ }>]>;
208
+ accessor: Schema.Schema<string, string, never>;
209
+ enableSorting: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
210
+ size: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
211
+ grow: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
212
+ tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
213
+ locale: Schema.Literal<["zh"]>;
214
+ message: Schema.SchemaClass<string, string, never>;
215
+ }>], [Schema.Struct<{
216
+ locale: Schema.Literal<["ja", "en", "ko"]>;
217
+ message: Schema.SchemaClass<string, string, never>;
218
+ }>]>>;
219
+ id: Schema.refine<string, typeof Schema.String>;
220
+ groupId: Schema.optional<typeof Schema.UUID>;
221
+ type: Schema.Literal<["com.shwfed.table.column.combobox-multi.remote"]>;
222
+ compatibilityDate: Schema.Literal<["2026-05-26"]>;
223
+ }>;
224
+ export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
225
+ export declare const migrateFrom: ReadonlyArray<MigrateSource>;
226
+ export declare const migrate: MigrateFn;
227
+ export declare function toColumnDef(value: Value, { getLocaleText, $cel, inheritedContext }: ColumnDefDeps): Partial<ColumnDef<unknown, unknown>>;
@@ -0,0 +1,227 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
3
+ import { Locale } from "../../../../../share/locale.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";
13
+ export const compatibilityDate = "2026-05-26";
14
+ export const metadata = {
15
+ name: "\u4E0B\u62C9\u591A\u9009\uFF08\u8FDC\u7A0B\u5199\u5165\uFF09",
16
+ icon: "fluent:cloud-arrow-up-20-regular"
17
+ };
18
+ const isListType = (actual) => actual === "dyn" || actual.startsWith("list");
19
+ export function itemSchema(configure) {
20
+ const LocaleMd = LocaleMarkdownWithRow(configure);
21
+ const TextValue = Schema.Struct({
22
+ kind: Schema.Literal("text"),
23
+ value: Schema.String
24
+ });
25
+ const NumberValue = Schema.Struct({
26
+ kind: Schema.Literal("number"),
27
+ value: Schema.Number
28
+ });
29
+ const ItemValue = Schema.Union(TextValue, NumberValue).annotations({
30
+ title: "\u503C",
31
+ description: "\u9009\u9879\u7ED1\u5B9A\u7684\u503C\uFF0C\u53EF\u4EE5\u662F\u6587\u672C\u6216\u6570\u5B57"
32
+ });
33
+ return Schema.Struct({
34
+ id: Schema.UUID.annotations({ description: "\u9009\u9879\u552F\u4E00\u6807\u8BC6\uFF0C\u7528\u4E8E\u7A33\u5B9A\u7684 v-for key" }),
35
+ label: LocaleMd.annotations({
36
+ title: "\u6807\u7B7E",
37
+ description: "\u9009\u9879\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 Markdown \u4E0E `{{ row.foo }}` / `{{ form.bar }}` \u63D2\u503C"
38
+ }),
39
+ value: ItemValue,
40
+ tooltip: Schema.optional(LocaleMd.annotations({
41
+ title: "\u63D0\u793A",
42
+ description: "\u9F20\u6807\u60AC\u505C\u5728\u9009\u9879\u4E0A\u65F6\u5C55\u793A\u7684\u672C\u5730\u5316\u63D0\u793A\uFF0C\u652F\u6301 Markdown"
43
+ }))
44
+ }).annotations({
45
+ title: "ComboboxMultiRemoteItem"
46
+ });
47
+ }
48
+ export function optionsSchema(configure) {
49
+ const Item = itemSchema(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
+ const StaticSpec = Schema.Struct({
81
+ kind: Schema.Literal("static"),
82
+ items: Schema.optionalWith(Schema.Array(Item).annotations({
83
+ title: "\u9009\u9879",
84
+ description: "\u4E0B\u62C9\u6846\u53EF\u9009\u9879\u5217\u8868"
85
+ }), { default: () => [] })
86
+ }).annotations({ title: "ComboboxMultiRemoteOptionsStatic", description: "\u9759\u6001\u914D\u7F6E\u7684\u9009\u9879\u5217\u8868" });
87
+ const RemoteSpec = Schema.Struct({
88
+ kind: Schema.Literal("remote"),
89
+ request: CelRequest.annotations({
90
+ title: "\u8BF7\u6C42",
91
+ 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"
92
+ }),
93
+ options: CelOptions.annotations({
94
+ title: "\u9009\u9879",
95
+ 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`"
96
+ }),
97
+ optionValue: Schema.optionalWith(CelOptionValue.annotations({
98
+ title: "\u9009\u9879\u503C",
99
+ description: "\u4ECE\u5F53\u524D `option` \u63D0\u53D6\u5199\u5165\u503C\u7684 CEL\uFF1B\u4F8B\uFF1A`option.value`"
100
+ }), { default: () => "option" }),
101
+ optionLabel: Schema.optionalWith(LocaleOptionLabel.annotations({
102
+ title: "\u9009\u9879\u6807\u7B7E",
103
+ description: "\u6BCF\u4E2A\u9009\u9879\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 `{{ string(option.foo) }}` \u63D2\u503C"
104
+ }), { default: () => [{ locale: "zh", message: "" }] })
105
+ }).annotations({ title: "ComboboxMultiRemoteOptionsRemote", description: "\u8FDC\u7A0B\u52A0\u8F7D\u7684\u9009\u9879\u5217\u8868" });
106
+ return Schema.Union(StaticSpec, RemoteSpec).annotations({
107
+ title: "\u9009\u9879\u6765\u6E90",
108
+ 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'
109
+ });
110
+ }
111
+ export function schema(configure) {
112
+ const CelBool = CelRowAccess(configure, { resultType: "bool" });
113
+ const Options = optionsSchema(configure);
114
+ const CelOnChange = Expression({
115
+ configure: (env) => {
116
+ configure(env);
117
+ registerRowVariablesIfAbsent(env);
118
+ 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 `[]`" });
119
+ },
120
+ resultType: "HttpRequest"
121
+ });
122
+ const CelMessage = Expression({
123
+ configure: (env) => {
124
+ configure(env);
125
+ env.registerVariable("json", "dyn", { description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09" });
126
+ },
127
+ resultType: "string"
128
+ });
129
+ return Schema.Struct({
130
+ type: Schema.Literal(type),
131
+ compatibilityDate: Schema.Literal(compatibilityDate),
132
+ ...columnFields(configure),
133
+ placeholder: Schema.optional(Locale.annotations({
134
+ title: "\u5360\u4F4D\u7B26",
135
+ description: "\u672A\u9009\u4E2D\u4EFB\u4F55\u9009\u9879\u65F6\u8F93\u5165\u6846\u4E2D\u7684\u5360\u4F4D\u6587\u672C"
136
+ })),
137
+ hidden: Schema.optional(CelBool.annotations({
138
+ title: "\u9690\u85CF\u6761\u4EF6",
139
+ description: "\u8FD4\u56DE `true` \u65F6\u8BE5\u884C\u7684\u4E0B\u62C9\u6846\u4E0D\u6E32\u67D3\uFF08\u5176\u4F59\u884C\u4E0D\u53D7\u5F71\u54CD\uFF09"
140
+ })),
141
+ disabled: Schema.optional(CelBool.annotations({
142
+ title: "\u7981\u7528\u6761\u4EF6",
143
+ description: "\u8FD4\u56DE `true` \u65F6\u4E0B\u62C9\u6846\u4ECD\u7136\u6E32\u67D3\u4F46\u4E0D\u53EF\u9009\u62E9"
144
+ })),
145
+ readonly: Schema.optional(CelBool.annotations({
146
+ title: "\u53EA\u8BFB\u6761\u4EF6",
147
+ description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u5DF2\u9009\u9879\u7684\u6807\u7B7E"
148
+ })),
149
+ options: Schema.optionalWith(Options, {
150
+ default: () => ({ kind: "static", items: [] })
151
+ }),
152
+ onChange: Schema.optional(CelOnChange.annotations({
153
+ title: "\u5207\u6362\u8BF7\u6C42",
154
+ 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"
155
+ })),
156
+ successMessage: Schema.optional(CelMessage.annotations({
157
+ title: "\u6210\u529F\u6D88\u606F",
158
+ description: "\u8BF7\u6C42\u6210\u529F\u540E\u5F39\u51FA\u7684 toast \u5185\u5BB9\uFF1B\u672A\u914D\u7F6E\u5219\u9759\u9ED8"
159
+ })),
160
+ triggers: Schema.optional(Triggers.annotations({
161
+ title: "\u6210\u529F\u540E\u89E6\u53D1",
162
+ 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"
163
+ }))
164
+ }).annotations({
165
+ title: "ComboboxMultiRemoteRenderer",
166
+ description: "\u4E0B\u62C9\u591A\u9009\u6E32\u67D3\u5668\uFF08\u8FDC\u7A0B\u5199\u5165\uFF09"
167
+ });
168
+ }
169
+ export const migrateFrom = [
170
+ { type: "com.shwfed.table.column.combobox-multi.remote.options-static", compatibilityDate: "2026-05-25" },
171
+ { type: "com.shwfed.table.column.combobox-multi.remote.options-remote", compatibilityDate: "2026-05-25" }
172
+ ];
173
+ export const migrate = (prev) => Effect.try({
174
+ try: () => {
175
+ if (!prev || typeof prev !== "object") {
176
+ throw new Error("\u4E0B\u62C9\u591A\u9009\uFF08\u8FDC\u7A0B\u5199\u5165\uFF09\u8FC1\u79FB\u5931\u8D25\uFF1A\u539F\u503C\u4E0D\u662F\u5BF9\u8C61");
177
+ }
178
+ const src = prev;
179
+ const srcType = src.type;
180
+ if (srcType === "com.shwfed.table.column.combobox-multi.remote.options-static") {
181
+ const { items, type: _t, compatibilityDate: _c, ...rest } = src;
182
+ const itemsArr = Array.isArray(items) ? items : [];
183
+ return {
184
+ ...rest,
185
+ type,
186
+ compatibilityDate,
187
+ options: { kind: "static", items: itemsArr }
188
+ };
189
+ }
190
+ if (srcType === "com.shwfed.table.column.combobox-multi.remote.options-remote") {
191
+ const { request, options, optionValue, optionLabel, type: _t, compatibilityDate: _c, ...rest } = src;
192
+ const remote = { kind: "remote" };
193
+ if (typeof request === "string") remote.request = request;
194
+ if (typeof options === "string") remote.options = options;
195
+ if (typeof optionValue === "string") remote.optionValue = optionValue;
196
+ if (Array.isArray(optionLabel)) remote.optionLabel = optionLabel;
197
+ return {
198
+ ...rest,
199
+ type,
200
+ compatibilityDate,
201
+ options: remote
202
+ };
203
+ }
204
+ throw new Error(`\u4E0B\u62C9\u591A\u9009\uFF08\u8FDC\u7A0B\u5199\u5165\uFF09\u8FC1\u79FB\u5931\u8D25\uFF1A\u672A\u8BC6\u522B\u7684\u6765\u6E90\u7C7B\u578B ${String(srcType)}`);
205
+ },
206
+ catch: (e) => e instanceof Error ? e : new Error(String(e))
207
+ });
208
+ export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
209
+ return {
210
+ header: editableHeader(getLocaleText(value.title)),
211
+ accessorFn: (row, index) => {
212
+ try {
213
+ return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
214
+ } catch (e) {
215
+ console.error("[shwfed-table] combobox-multi.remote accessor failed", e);
216
+ return void 0;
217
+ }
218
+ },
219
+ enableSorting: value.enableSorting ?? false,
220
+ sortingFn: "basic",
221
+ size: value.size,
222
+ meta: {
223
+ grow: value.grow ?? false,
224
+ tooltip: getLocaleText(value.tooltip)
225
+ }
226
+ };
227
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "2.3.22",
3
+ "version": "2.3.24",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {