@shwfed/config 2.3.24 → 2.3.26
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 +1059 -634
- package/dist/module.json +1 -1
- package/dist/preview/assets/{config-CWZxlCMJ.js → config-BATy87wV.js} +1 -1
- package/dist/preview/assets/{config-Bi9uFh4Y.js → config-BkimX91E.js} +1 -1
- package/dist/preview/assets/{config-CBHKrOP5.js → config-CO2iovZD.js} +1 -1
- package/dist/preview/assets/{config-DYAEfkYR.js → config-Cm9t0CvW.js} +1 -1
- package/dist/preview/assets/{config-B-6Htwv0.js → config-DPFHMkHc.js} +1 -1
- package/dist/preview/assets/{config-B2KjxFl5.js → config-DgZ4NYoA.js} +1 -1
- package/dist/preview/assets/{config-D5Kfssb7.js → config-Dzqe6v-x.js} +1 -1
- package/dist/preview/assets/{config-B3at5Bue.js → config-u1rl9w2L.js} +1 -1
- package/dist/preview/assets/{config-CaZpOvHG.js → config-ypYLVfRE.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-8BVrrrak.js → definition.vue_vue_type_script_setup_true_lang-CliXxe84.js} +1 -1
- package/dist/preview/assets/index-6rM4rqXR.js +1 -0
- package/dist/preview/assets/{index-CJMxrUKZ.css → index-BCE-G4Ha.css} +1 -1
- package/dist/preview/assets/index-wBVA0mNO.js +643 -0
- package/dist/preview/assets/{runtime-CoRrnGx1.js → runtime-BR6-W3u_.js} +1 -1
- package/dist/preview/assets/{runtime-CEP42oTV.js → runtime-BTROwcw4.js} +1 -1
- package/dist/preview/assets/{runtime-CRHn61GX.js → runtime-B_FMZ5eD.js} +1 -1
- package/dist/preview/assets/{runtime-C1iENPNJ.js → runtime-CTpsTb-X.js} +1 -1
- package/dist/preview/assets/{runtime-Hvzx1ucy.js → runtime-Cj0kLSqP.js} +1 -1
- package/dist/preview/assets/{runtime-C5CCMnHt.js → runtime-D1xLbTQ9.js} +1 -1
- package/dist/preview/assets/{runtime-jrsJfwMb.js → runtime-Dsx8Y56q.js} +1 -1
- package/dist/preview/assets/{runtime-CqciI2ST.js → runtime-Dtc1ETUF.js} +1 -1
- package/dist/preview/assets/{runtime-aBsBSCeg.js → runtime-T_tUqLxO.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue +1 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +26 -26
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue +4 -14
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +26 -26
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.d.ts +27 -1
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.js +14 -11
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +26 -26
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue +4 -12
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +26 -26
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +45 -12
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +27 -1
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.js +14 -11
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +163 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue +699 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +163 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.vue +349 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.d.ts +251 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.js +178 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +167 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue +732 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +167 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.vue +383 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +253 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.js +230 -0
- package/dist/runtime/components/table/config.vue +40 -0
- package/package.json +1 -1
- package/dist/preview/assets/index-B3wadvvl.js +0 -1
- package/dist/preview/assets/index-DTsYYECD.js +0 -643
|
@@ -0,0 +1,253 @@
|
|
|
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.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 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
|
+
options: Schema.optionalWith<Schema.Union<[Schema.Struct<{
|
|
151
|
+
kind: Schema.Literal<["static"]>;
|
|
152
|
+
items: Schema.optionalWith<Schema.Array$<Schema.Struct<{
|
|
153
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
154
|
+
label: Schema.refine<readonly [{
|
|
155
|
+
readonly locale: "zh";
|
|
156
|
+
readonly message: string;
|
|
157
|
+
}, ...{
|
|
158
|
+
readonly locale: "en" | "ja" | "ko";
|
|
159
|
+
readonly message: string;
|
|
160
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
161
|
+
locale: Schema.Literal<["zh"]>;
|
|
162
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
163
|
+
}>], [Schema.Struct<{
|
|
164
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
165
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
166
|
+
}>]>>;
|
|
167
|
+
value: Schema.Union<[Schema.Struct<{
|
|
168
|
+
kind: Schema.Literal<["text"]>;
|
|
169
|
+
value: typeof Schema.String;
|
|
170
|
+
}>, Schema.Struct<{
|
|
171
|
+
kind: Schema.Literal<["number"]>;
|
|
172
|
+
value: typeof Schema.Number;
|
|
173
|
+
}>]>;
|
|
174
|
+
tooltip: Schema.optional<Schema.refine<readonly [{
|
|
175
|
+
readonly locale: "zh";
|
|
176
|
+
readonly message: string;
|
|
177
|
+
}, ...{
|
|
178
|
+
readonly locale: "en" | "ja" | "ko";
|
|
179
|
+
readonly message: string;
|
|
180
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
181
|
+
locale: Schema.Literal<["zh"]>;
|
|
182
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
183
|
+
}>], [Schema.Struct<{
|
|
184
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
185
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
186
|
+
}>]>>>;
|
|
187
|
+
}>>, {
|
|
188
|
+
default: () => readonly [];
|
|
189
|
+
}>;
|
|
190
|
+
}>, Schema.Struct<{
|
|
191
|
+
kind: Schema.Literal<["remote"]>;
|
|
192
|
+
request: Schema.Schema<string, string, never>;
|
|
193
|
+
options: Schema.Schema<string, string, never>;
|
|
194
|
+
optionValue: Schema.optionalWith<Schema.Schema<string, string, never>, {
|
|
195
|
+
default: () => string;
|
|
196
|
+
}>;
|
|
197
|
+
optionLabel: Schema.optionalWith<Schema.refine<readonly [{
|
|
198
|
+
readonly locale: "zh";
|
|
199
|
+
readonly message: string;
|
|
200
|
+
}, ...{
|
|
201
|
+
readonly locale: "en" | "ja" | "ko";
|
|
202
|
+
readonly message: string;
|
|
203
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
204
|
+
locale: Schema.Literal<["zh"]>;
|
|
205
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
206
|
+
}>], [Schema.Struct<{
|
|
207
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
208
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
209
|
+
}>]>>, {
|
|
210
|
+
default: () => readonly [{
|
|
211
|
+
readonly locale: "zh";
|
|
212
|
+
readonly message: "";
|
|
213
|
+
}];
|
|
214
|
+
}>;
|
|
215
|
+
}>]>, {
|
|
216
|
+
default: () => {
|
|
217
|
+
kind: "static";
|
|
218
|
+
items: readonly [];
|
|
219
|
+
};
|
|
220
|
+
}>;
|
|
221
|
+
onChange: Schema.optional<Schema.Schema<string, string, never>>;
|
|
222
|
+
successMessage: Schema.optional<Schema.Schema<string, string, never>>;
|
|
223
|
+
triggers: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
224
|
+
target: Schema.refine<string, typeof Schema.String>;
|
|
225
|
+
operation: Schema.SchemaClass<string, string, never>;
|
|
226
|
+
}>>>;
|
|
227
|
+
title: Schema.TupleType<readonly [Schema.Struct<{
|
|
228
|
+
locale: Schema.Literal<["zh"]>;
|
|
229
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
230
|
+
}>], [Schema.Struct<{
|
|
231
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
232
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
233
|
+
}>]>;
|
|
234
|
+
accessor: Schema.Schema<string, string, never>;
|
|
235
|
+
enableSorting: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
236
|
+
size: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
|
|
237
|
+
grow: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
238
|
+
tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
239
|
+
locale: Schema.Literal<["zh"]>;
|
|
240
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
241
|
+
}>], [Schema.Struct<{
|
|
242
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
243
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
244
|
+
}>]>>;
|
|
245
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
246
|
+
groupId: Schema.optional<typeof Schema.UUID>;
|
|
247
|
+
type: Schema.Literal<["com.shwfed.table.column.combobox-single.remote"]>;
|
|
248
|
+
compatibilityDate: Schema.Literal<["2026-05-26"]>;
|
|
249
|
+
}>;
|
|
250
|
+
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
251
|
+
export declare const migrateFrom: ReadonlyArray<MigrateSource>;
|
|
252
|
+
export declare const migrate: MigrateFn;
|
|
253
|
+
export declare function toColumnDef(value: Value, { getLocaleText, $cel, inheritedContext }: ColumnDefDeps): Partial<ColumnDef<unknown, unknown>>;
|
|
@@ -0,0 +1,230 @@
|
|
|
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-single.remote";
|
|
13
|
+
export const compatibilityDate = "2026-05-26";
|
|
14
|
+
export const metadata = {
|
|
15
|
+
name: "\u5355\u9009\uFF08\u8FDC\u7A0B\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: "ComboboxSingleRemoteItem"
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export function remoteOptionsSchema(configure) {
|
|
49
|
+
const CelRequest = Expression({
|
|
50
|
+
configure: (env) => {
|
|
51
|
+
configure(env);
|
|
52
|
+
registerRowVariablesIfAbsent(env);
|
|
53
|
+
},
|
|
54
|
+
resultType: "HttpRequest"
|
|
55
|
+
});
|
|
56
|
+
const CelOptions = Expression({
|
|
57
|
+
configure: (env) => {
|
|
58
|
+
configure(env);
|
|
59
|
+
registerRowVariablesIfAbsent(env);
|
|
60
|
+
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`" });
|
|
61
|
+
},
|
|
62
|
+
resultType: isListType
|
|
63
|
+
});
|
|
64
|
+
const CelOptionValue = Expression({
|
|
65
|
+
configure: (env) => {
|
|
66
|
+
configure(env);
|
|
67
|
+
registerRowVariablesIfAbsent(env);
|
|
68
|
+
env.registerVariable("option", "dyn", { description: "`\u9009\u9879` \u8868\u8FBE\u5F0F\u4EA7\u51FA\u7684\u6570\u7EC4\u4E2D\u8FED\u4EE3\u5230\u7684\u5355\u4E2A\u5143\u7D20" });
|
|
69
|
+
},
|
|
70
|
+
resultType: "dyn"
|
|
71
|
+
});
|
|
72
|
+
const LocaleOptionLabel = LocaleMarkdown({
|
|
73
|
+
configure: (env) => {
|
|
74
|
+
configure(env);
|
|
75
|
+
registerRowVariablesIfAbsent(env);
|
|
76
|
+
env.registerVariable("option", "dyn", { description: "`\u9009\u9879` \u8868\u8FBE\u5F0F\u4EA7\u51FA\u7684\u6570\u7EC4\u4E2D\u8FED\u4EE3\u5230\u7684\u5355\u4E2A\u5143\u7D20" });
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return Schema.Struct({
|
|
80
|
+
kind: Schema.Literal("remote"),
|
|
81
|
+
request: CelRequest.annotations({
|
|
82
|
+
title: "\u8BF7\u6C42",
|
|
83
|
+
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"
|
|
84
|
+
}),
|
|
85
|
+
options: CelOptions.annotations({
|
|
86
|
+
title: "\u9009\u9879",
|
|
87
|
+
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`"
|
|
88
|
+
}),
|
|
89
|
+
optionValue: Schema.optionalWith(CelOptionValue.annotations({
|
|
90
|
+
title: "\u9009\u9879\u503C",
|
|
91
|
+
description: "\u4ECE\u5F53\u524D `option` \u63D0\u53D6\u5199\u5165\u503C\u7684 CEL\uFF1B\u4F8B\uFF1A`option.value`"
|
|
92
|
+
}), { default: () => "option" }),
|
|
93
|
+
optionLabel: Schema.optionalWith(LocaleOptionLabel.annotations({
|
|
94
|
+
title: "\u9009\u9879\u6807\u7B7E",
|
|
95
|
+
description: "\u6BCF\u4E2A\u9009\u9879\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 `{{ string(option.foo) }}` \u63D2\u503C"
|
|
96
|
+
}), { default: () => [{ locale: "zh", message: "" }] })
|
|
97
|
+
}).annotations({ title: "ComboboxSingleRemoteOptionsRemote", description: "\u8FDC\u7A0B\u52A0\u8F7D\u7684\u9009\u9879\u5217\u8868" });
|
|
98
|
+
}
|
|
99
|
+
export function optionsSchema(configure) {
|
|
100
|
+
const Item = itemSchema(configure);
|
|
101
|
+
const StaticSpec = Schema.Struct({
|
|
102
|
+
kind: Schema.Literal("static"),
|
|
103
|
+
items: Schema.optionalWith(Schema.Array(Item).annotations({
|
|
104
|
+
title: "\u9009\u9879",
|
|
105
|
+
description: "\u4E0B\u62C9\u6846\u53EF\u9009\u9879\u5217\u8868"
|
|
106
|
+
}), { default: () => [] })
|
|
107
|
+
}).annotations({ title: "ComboboxSingleRemoteOptionsStatic", description: "\u9759\u6001\u914D\u7F6E\u7684\u9009\u9879\u5217\u8868" });
|
|
108
|
+
const RemoteSpec = remoteOptionsSchema(configure);
|
|
109
|
+
return Schema.Union(StaticSpec, RemoteSpec).annotations({
|
|
110
|
+
title: "\u9009\u9879\u6765\u6E90",
|
|
111
|
+
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'
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
export function schema(configure) {
|
|
115
|
+
const CelBool = CelRowAccess(configure, { resultType: "bool" });
|
|
116
|
+
const Options = optionsSchema(configure);
|
|
117
|
+
const CelOnChange = Expression({
|
|
118
|
+
configure: (env) => {
|
|
119
|
+
configure(env);
|
|
120
|
+
registerRowVariablesIfAbsent(env);
|
|
121
|
+
env.registerVariable("value", "dyn", { description: "\u7528\u6237\u9009\u4E2D\u7684\u65B0\u503C\uFF08\u4E0E\u6240\u9009\u9879\u7684 `value` \u4E00\u81F4\uFF1B\u6E05\u7A7A\u65F6\u4E3A `null`\uFF09" });
|
|
122
|
+
},
|
|
123
|
+
resultType: "HttpRequest"
|
|
124
|
+
});
|
|
125
|
+
const CelMessage = Expression({
|
|
126
|
+
configure: (env) => {
|
|
127
|
+
configure(env);
|
|
128
|
+
env.registerVariable("json", "dyn", { description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09" });
|
|
129
|
+
},
|
|
130
|
+
resultType: "string"
|
|
131
|
+
});
|
|
132
|
+
return Schema.Struct({
|
|
133
|
+
type: Schema.Literal(type),
|
|
134
|
+
compatibilityDate: Schema.Literal(compatibilityDate),
|
|
135
|
+
...columnFields(configure),
|
|
136
|
+
placeholder: Schema.optional(Locale.annotations({
|
|
137
|
+
title: "\u5360\u4F4D\u7B26",
|
|
138
|
+
description: "\u672A\u9009\u4E2D\u4EFB\u4F55\u9009\u9879\u65F6\u8F93\u5165\u6846\u4E2D\u7684\u5360\u4F4D\u6587\u672C"
|
|
139
|
+
})),
|
|
140
|
+
hidden: Schema.optional(CelBool.annotations({
|
|
141
|
+
title: "\u9690\u85CF\u6761\u4EF6",
|
|
142
|
+
description: "\u8FD4\u56DE `true` \u65F6\u8BE5\u884C\u7684\u4E0B\u62C9\u6846\u4E0D\u6E32\u67D3\uFF08\u5176\u4F59\u884C\u4E0D\u53D7\u5F71\u54CD\uFF09"
|
|
143
|
+
})),
|
|
144
|
+
disabled: Schema.optional(CelBool.annotations({
|
|
145
|
+
title: "\u7981\u7528\u6761\u4EF6",
|
|
146
|
+
description: "\u8FD4\u56DE `true` \u65F6\u4E0B\u62C9\u6846\u4ECD\u7136\u6E32\u67D3\u4F46\u4E0D\u53EF\u9009\u62E9"
|
|
147
|
+
})),
|
|
148
|
+
readonly: Schema.optional(CelBool.annotations({
|
|
149
|
+
title: "\u53EA\u8BFB\u6761\u4EF6",
|
|
150
|
+
description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u9009\u9879\u7684\u6807\u7B7E"
|
|
151
|
+
})),
|
|
152
|
+
options: Schema.optionalWith(Options, {
|
|
153
|
+
default: () => ({ kind: "static", items: [] })
|
|
154
|
+
}),
|
|
155
|
+
onChange: Schema.optional(CelOnChange.annotations({
|
|
156
|
+
title: "\u5207\u6362\u8BF7\u6C42",
|
|
157
|
+
description: "\u7528\u6237\u9009\u62E9\u540E\u7ACB\u5373\u6C42\u503C\u5E76\u53D1\u8D77\u7684 HTTP \u8BF7\u6C42\uFF1B`value` \u4E3A\u65B0\u503C\u3002\u672A\u914D\u7F6E\u65F6\u4E0B\u62C9\u6846\u53EA\u8BFB"
|
|
158
|
+
})),
|
|
159
|
+
successMessage: Schema.optional(CelMessage.annotations({
|
|
160
|
+
title: "\u6210\u529F\u6D88\u606F",
|
|
161
|
+
description: "\u8BF7\u6C42\u6210\u529F\u540E\u5F39\u51FA\u7684 toast \u5185\u5BB9\uFF1B\u672A\u914D\u7F6E\u5219\u9759\u9ED8"
|
|
162
|
+
})),
|
|
163
|
+
triggers: Schema.optional(Triggers.annotations({
|
|
164
|
+
title: "\u6210\u529F\u540E\u89E6\u53D1",
|
|
165
|
+
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"
|
|
166
|
+
}))
|
|
167
|
+
}).annotations({
|
|
168
|
+
title: "ComboboxSingleRemoteRenderer",
|
|
169
|
+
description: "\u4E0B\u62C9\u5355\u9009\u6E32\u67D3\u5668\uFF08\u8FDC\u7A0B\u5199\u5165\uFF09"
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
export const migrateFrom = [
|
|
173
|
+
{ type: "com.shwfed.table.column.combobox-single.remote.options-static", compatibilityDate: "2026-05-24" },
|
|
174
|
+
{ type: "com.shwfed.table.column.combobox-single.remote.options-remote", compatibilityDate: "2026-05-24" }
|
|
175
|
+
];
|
|
176
|
+
export const migrate = (prev) => Effect.try({
|
|
177
|
+
try: () => {
|
|
178
|
+
if (!prev || typeof prev !== "object") {
|
|
179
|
+
throw new Error("\u4E0B\u62C9\u5355\u9009\uFF08\u8FDC\u7A0B\u5199\u5165\uFF09\u8FC1\u79FB\u5931\u8D25\uFF1A\u539F\u503C\u4E0D\u662F\u5BF9\u8C61");
|
|
180
|
+
}
|
|
181
|
+
const src = prev;
|
|
182
|
+
const srcType = src.type;
|
|
183
|
+
if (srcType === "com.shwfed.table.column.combobox-single.remote.options-static") {
|
|
184
|
+
const { items, type: _t, compatibilityDate: _c, ...rest } = src;
|
|
185
|
+
const itemsArr = Array.isArray(items) ? items : [];
|
|
186
|
+
return {
|
|
187
|
+
...rest,
|
|
188
|
+
type,
|
|
189
|
+
compatibilityDate,
|
|
190
|
+
options: { kind: "static", items: itemsArr }
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
if (srcType === "com.shwfed.table.column.combobox-single.remote.options-remote") {
|
|
194
|
+
const { request, options, optionValue, optionLabel, type: _t, compatibilityDate: _c, ...rest } = src;
|
|
195
|
+
const remote = { kind: "remote" };
|
|
196
|
+
if (typeof request === "string") remote.request = request;
|
|
197
|
+
if (typeof options === "string") remote.options = options;
|
|
198
|
+
if (typeof optionValue === "string") remote.optionValue = optionValue;
|
|
199
|
+
if (Array.isArray(optionLabel)) remote.optionLabel = optionLabel;
|
|
200
|
+
return {
|
|
201
|
+
...rest,
|
|
202
|
+
type,
|
|
203
|
+
compatibilityDate,
|
|
204
|
+
options: remote
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
throw new Error(`\u4E0B\u62C9\u5355\u9009\uFF08\u8FDC\u7A0B\u5199\u5165\uFF09\u8FC1\u79FB\u5931\u8D25\uFF1A\u672A\u8BC6\u522B\u7684\u6765\u6E90\u7C7B\u578B ${String(srcType)}`);
|
|
208
|
+
},
|
|
209
|
+
catch: (e) => e instanceof Error ? e : new Error(String(e))
|
|
210
|
+
});
|
|
211
|
+
export function toColumnDef(value, { getLocaleText, $cel, inheritedContext }) {
|
|
212
|
+
return {
|
|
213
|
+
header: editableHeader(getLocaleText(value.title)),
|
|
214
|
+
accessorFn: (row, index) => {
|
|
215
|
+
try {
|
|
216
|
+
return Effect.runSync($cel(value.accessor, { ...inheritedContext, row, index }));
|
|
217
|
+
} catch (e) {
|
|
218
|
+
console.error("[shwfed-table] combobox-single.remote accessor failed", e);
|
|
219
|
+
return void 0;
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
enableSorting: value.enableSorting ?? false,
|
|
223
|
+
sortingFn: "basic",
|
|
224
|
+
size: value.size,
|
|
225
|
+
meta: {
|
|
226
|
+
grow: value.grow ?? false,
|
|
227
|
+
tooltip: getLocaleText(value.tooltip)
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
}
|
|
@@ -484,6 +484,46 @@ function getColumnDefaults(id, type, compatibilityDate) {
|
|
|
484
484
|
return { id, type, compatibilityDate, title: [{ locale: "zh", message: "" }], markdown: [{ locale: "zh", message: "" }], size: 120 };
|
|
485
485
|
case "com.shwfed.table.column.actions":
|
|
486
486
|
return { id, type, compatibilityDate, title: [{ locale: "zh", message: "" }], size: 200, groups: [], items: [] };
|
|
487
|
+
case "com.shwfed.table.column.combobox-multi":
|
|
488
|
+
return {
|
|
489
|
+
id,
|
|
490
|
+
type,
|
|
491
|
+
compatibilityDate,
|
|
492
|
+
title: [{ locale: "zh", message: "" }],
|
|
493
|
+
binding: "",
|
|
494
|
+
size: 200,
|
|
495
|
+
options: { kind: "static", items: [] }
|
|
496
|
+
};
|
|
497
|
+
case "com.shwfed.table.column.combobox-multi.remote":
|
|
498
|
+
return {
|
|
499
|
+
id,
|
|
500
|
+
type,
|
|
501
|
+
compatibilityDate,
|
|
502
|
+
title: [{ locale: "zh", message: "" }],
|
|
503
|
+
accessor: "",
|
|
504
|
+
size: 200,
|
|
505
|
+
options: { kind: "static", items: [] }
|
|
506
|
+
};
|
|
507
|
+
case "com.shwfed.table.column.combobox-single":
|
|
508
|
+
return {
|
|
509
|
+
id,
|
|
510
|
+
type,
|
|
511
|
+
compatibilityDate,
|
|
512
|
+
title: [{ locale: "zh", message: "" }],
|
|
513
|
+
binding: "",
|
|
514
|
+
size: 200,
|
|
515
|
+
options: { kind: "static", items: [] }
|
|
516
|
+
};
|
|
517
|
+
case "com.shwfed.table.column.combobox-single.remote":
|
|
518
|
+
return {
|
|
519
|
+
id,
|
|
520
|
+
type,
|
|
521
|
+
compatibilityDate,
|
|
522
|
+
title: [{ locale: "zh", message: "" }],
|
|
523
|
+
accessor: "",
|
|
524
|
+
size: 200,
|
|
525
|
+
options: { kind: "static", items: [] }
|
|
526
|
+
};
|
|
487
527
|
default:
|
|
488
528
|
return { id, type, compatibilityDate };
|
|
489
529
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aL as e}from"./index-DTsYYECD.js";import{aM as r,aN as s,aO as t}from"./index-DTsYYECD.js";export{r as TableConfig,s as createTableConfig,e as default,t as getColumnTechnicalKey};
|