@shwfed/config 2.3.22 → 2.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp.mjs +1073 -624
- package/dist/module.json +1 -1
- package/dist/preview/assets/{config-B3mv60t8.js → config-5rB9Rnmf.js} +1 -1
- package/dist/preview/assets/{config-DY7n8WvE.js → config-BLxl7ROb.js} +1 -1
- package/dist/preview/assets/{config-CpvkgqGg.js → config-BWMtPN22.js} +1 -1
- package/dist/preview/assets/{config-DX6QxjI7.js → config-C-EOrL-v.js} +1 -1
- package/dist/preview/assets/{config-Cb9lQXQG.js → config-CJADmi-_.js} +1 -1
- package/dist/preview/assets/{config-D4fS9GYw.js → config-DUNvg-mJ.js} +1 -1
- package/dist/preview/assets/{config-CLjwrQXG.js → config-EtlOM9yx.js} +1 -1
- package/dist/preview/assets/{config-BiFAbTJq.js → config-f66PEpZ5.js} +1 -1
- package/dist/preview/assets/{config-DhwLB2Ee.js → config-pVNUrcvS.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-Hx2iV358.js → definition.vue_vue_type_script_setup_true_lang-DUu-CoTZ.js} +1 -1
- package/dist/preview/assets/index-B4xolIUJ.js +643 -0
- package/dist/preview/assets/{index-CDhwf1Dw.css → index-CJMxrUKZ.css} +1 -1
- package/dist/preview/assets/index-DFYLO8qf.js +1 -0
- package/dist/preview/assets/{runtime-CShAGyQk.js → runtime-B9GkQToM.js} +1 -1
- package/dist/preview/assets/{runtime-DIcMvC6H.js → runtime-C0v-S40R.js} +1 -1
- package/dist/preview/assets/{runtime-usxovPqT.js → runtime-CFPeFbAB.js} +1 -1
- package/dist/preview/assets/{runtime-ECoXJ0-J.js → runtime-CI38ypkY.js} +1 -1
- package/dist/preview/assets/{runtime-HQv4w652.js → runtime-CUBGWRtC.js} +1 -1
- package/dist/preview/assets/{runtime-Dl0d8KFj.js → runtime-DcqfhaaX.js} +1 -1
- package/dist/preview/assets/{runtime-BXZROm-z.js → runtime-DoLJtHV2.js} +1 -1
- package/dist/preview/assets/{runtime-BarNw942.js → runtime-P99-0gRD.js} +1 -1
- package/dist/preview/assets/{runtime-BazV3vOW.js → runtime-qQ5mJdRv.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +99 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue +329 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +99 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue +265 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.d.ts +79 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.js +71 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +133 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue +533 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +133 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue +247 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.d.ts +124 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.js +94 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +109 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue +426 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +109 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue +356 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +85 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.js +147 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +137 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue +586 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +137 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue +287 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +126 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.js +125 -0
- package/package.json +1 -1
- package/dist/preview/assets/index-B2gp2q3H.js +0 -643
- package/dist/preview/assets/index-Jytc_ICm.js +0 -1
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { Icon } from "@iconify/vue";
|
|
4
|
+
import { Button } from "../../../../ui/button";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../../../ui/dropdown-menu";
|
|
6
|
+
import { ExpressionEditor } from "../../../../ui/expression-editor";
|
|
7
|
+
import { Switch } from "../../../../ui/switch";
|
|
8
|
+
import { Separator } from "../../../../ui/separator";
|
|
9
|
+
import { Field, FieldLabel } from "../../../../ui/field";
|
|
10
|
+
import { Locale } from "../../../../ui/locale";
|
|
11
|
+
import {
|
|
12
|
+
InputGroup,
|
|
13
|
+
InputGroupAddon,
|
|
14
|
+
InputGroupButton,
|
|
15
|
+
InputGroupInput,
|
|
16
|
+
InputGroupNumberField
|
|
17
|
+
} from "../../../../ui/input-group";
|
|
18
|
+
import { getStructFieldDescription, getStructFieldTitle } from "../../../utils/schema-meta";
|
|
19
|
+
import { Markdown } from "../../../../ui/markdown";
|
|
20
|
+
import DerivedValueEditor from "../../../../form/DerivedValueEditor.vue";
|
|
21
|
+
import { itemSchema, schema } from "./schema";
|
|
22
|
+
defineOptions({ name: "ShwfedTableComboboxMultiRendererConfig" });
|
|
23
|
+
const value = defineModel({ type: null, ...{ required: true } });
|
|
24
|
+
const fieldSchema = schema(() => {
|
|
25
|
+
});
|
|
26
|
+
const fieldTitle = (field) => getStructFieldTitle(fieldSchema, field) ?? field;
|
|
27
|
+
const fieldDescription = (field) => getStructFieldDescription(fieldSchema, field);
|
|
28
|
+
const itemFieldSchema = itemSchema(() => {
|
|
29
|
+
});
|
|
30
|
+
const itemFieldTitle = (f) => getStructFieldTitle(itemFieldSchema, f) ?? f;
|
|
31
|
+
const itemFieldDescription = (f) => getStructFieldDescription(itemFieldSchema, f);
|
|
32
|
+
const ROW_VARS = {
|
|
33
|
+
row: { type: "dyn", label: "\u5F53\u524D\u884C\u6570\u636E" },
|
|
34
|
+
index: { type: "number", label: "\u884C\u7D22\u5F15" }
|
|
35
|
+
};
|
|
36
|
+
const bindingText = computed({
|
|
37
|
+
get: () => value.value.binding ?? "",
|
|
38
|
+
set: (v) => {
|
|
39
|
+
const trimmed = v.trim();
|
|
40
|
+
if (trimmed === "") {
|
|
41
|
+
const { binding: _omit, ...rest } = value.value;
|
|
42
|
+
value.value = rest;
|
|
43
|
+
} else {
|
|
44
|
+
value.value = { ...value.value, binding: trimmed };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const hiddenModel = computed({
|
|
49
|
+
get: () => value.value.hidden ?? "",
|
|
50
|
+
set: (v) => {
|
|
51
|
+
if (v === "") {
|
|
52
|
+
const { hidden: _omit, ...rest } = value.value;
|
|
53
|
+
value.value = rest;
|
|
54
|
+
} else {
|
|
55
|
+
value.value = { ...value.value, hidden: v };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const disabledModel = computed({
|
|
60
|
+
get: () => value.value.disabled ?? "",
|
|
61
|
+
set: (v) => {
|
|
62
|
+
if (v === "") {
|
|
63
|
+
const { disabled: _omit, ...rest } = value.value;
|
|
64
|
+
value.value = rest;
|
|
65
|
+
} else {
|
|
66
|
+
value.value = { ...value.value, disabled: v };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const readonlyModel = computed({
|
|
71
|
+
get: () => value.value.readonly ?? "",
|
|
72
|
+
set: (v) => {
|
|
73
|
+
if (v === "") {
|
|
74
|
+
const { readonly: _omit, ...rest } = value.value;
|
|
75
|
+
value.value = rest;
|
|
76
|
+
} else {
|
|
77
|
+
value.value = { ...value.value, readonly: v };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const derivedModel = computed({
|
|
82
|
+
get: () => value.value.derived,
|
|
83
|
+
set: (v) => {
|
|
84
|
+
if (v == null) {
|
|
85
|
+
const { derived: _omit, ...rest } = value.value;
|
|
86
|
+
value.value = rest;
|
|
87
|
+
} else {
|
|
88
|
+
value.value = { ...value.value, derived: v };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const items = computed(() => value.value.items ?? []);
|
|
93
|
+
function newId() {
|
|
94
|
+
return typeof crypto !== "undefined" && "randomUUID" in crypto ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
95
|
+
const r = Math.random() * 16 | 0;
|
|
96
|
+
const v = c === "x" ? r : r & 3 | 8;
|
|
97
|
+
return v.toString(16);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function newItem() {
|
|
101
|
+
return {
|
|
102
|
+
id: newId(),
|
|
103
|
+
label: [{ locale: "zh", message: "" }],
|
|
104
|
+
value: { kind: "text", value: "" }
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function patchItem(index, patch) {
|
|
108
|
+
const next = [...value.value.items ?? []];
|
|
109
|
+
const cur = next[index];
|
|
110
|
+
if (!cur) return;
|
|
111
|
+
next[index] = { ...cur, ...patch };
|
|
112
|
+
value.value = { ...value.value, items: next };
|
|
113
|
+
}
|
|
114
|
+
function addItem() {
|
|
115
|
+
value.value = { ...value.value, items: [...value.value.items ?? [], newItem()] };
|
|
116
|
+
}
|
|
117
|
+
function removeItem(index) {
|
|
118
|
+
const next = [...value.value.items ?? []];
|
|
119
|
+
next.splice(index, 1);
|
|
120
|
+
value.value = { ...value.value, items: next };
|
|
121
|
+
}
|
|
122
|
+
function setItemKind(index, kind) {
|
|
123
|
+
const cur = value.value.items?.[index];
|
|
124
|
+
if (!cur || cur.value.kind === kind) return;
|
|
125
|
+
patchItem(index, {
|
|
126
|
+
value: kind === "text" ? { kind: "text", value: "" } : { kind: "number", value: 0 }
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function setItemTextValue(index, text) {
|
|
130
|
+
patchItem(index, { value: { kind: "text", value: text } });
|
|
131
|
+
}
|
|
132
|
+
function setItemNumberValue(index, n) {
|
|
133
|
+
patchItem(index, {
|
|
134
|
+
value: {
|
|
135
|
+
kind: "number",
|
|
136
|
+
value: typeof n === "number" && Number.isFinite(n) ? n : 0
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function setItemLabel(index, label) {
|
|
141
|
+
patchItem(index, { label });
|
|
142
|
+
}
|
|
143
|
+
function setItemTooltip(index, tooltip) {
|
|
144
|
+
const isEmpty = !tooltip || tooltip.every((l) => l.message.trim().length === 0);
|
|
145
|
+
if (isEmpty) {
|
|
146
|
+
const cur = value.value.items?.[index];
|
|
147
|
+
if (!cur) return;
|
|
148
|
+
const { tooltip: _omit, ...rest } = cur;
|
|
149
|
+
const next = [...value.value.items ?? []];
|
|
150
|
+
next[index] = rest;
|
|
151
|
+
value.value = { ...value.value, items: next };
|
|
152
|
+
} else {
|
|
153
|
+
patchItem(index, { tooltip });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
</script>
|
|
157
|
+
|
|
158
|
+
<template>
|
|
159
|
+
<div class="space-y-5">
|
|
160
|
+
<div class="grid grid-cols-2 gap-x-6 gap-y-4">
|
|
161
|
+
<Field orientation="vertical">
|
|
162
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
163
|
+
<template
|
|
164
|
+
v-if="fieldDescription('title')"
|
|
165
|
+
#tooltip
|
|
166
|
+
>
|
|
167
|
+
<Markdown
|
|
168
|
+
:source="fieldDescription('title')"
|
|
169
|
+
block
|
|
170
|
+
class="prose prose-sm prose-zinc"
|
|
171
|
+
/>
|
|
172
|
+
</template>
|
|
173
|
+
{{ fieldTitle("title") }}
|
|
174
|
+
</FieldLabel>
|
|
175
|
+
<Locale v-model="value.title" />
|
|
176
|
+
</Field>
|
|
177
|
+
<Field orientation="vertical">
|
|
178
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
179
|
+
<template
|
|
180
|
+
v-if="fieldDescription('tooltip')"
|
|
181
|
+
#tooltip
|
|
182
|
+
>
|
|
183
|
+
<Markdown
|
|
184
|
+
:source="fieldDescription('tooltip')"
|
|
185
|
+
block
|
|
186
|
+
class="prose prose-sm prose-zinc"
|
|
187
|
+
/>
|
|
188
|
+
</template>
|
|
189
|
+
{{ fieldTitle("tooltip") }}
|
|
190
|
+
</FieldLabel>
|
|
191
|
+
<Locale
|
|
192
|
+
v-model="value.tooltip"
|
|
193
|
+
markdown
|
|
194
|
+
/>
|
|
195
|
+
</Field>
|
|
196
|
+
</div>
|
|
197
|
+
<div class="grid grid-cols-2 gap-x-6 gap-y-4">
|
|
198
|
+
<Field orientation="vertical">
|
|
199
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
200
|
+
<template
|
|
201
|
+
v-if="fieldDescription('binding')"
|
|
202
|
+
#tooltip
|
|
203
|
+
>
|
|
204
|
+
<Markdown
|
|
205
|
+
:source="fieldDescription('binding')"
|
|
206
|
+
block
|
|
207
|
+
class="prose prose-sm prose-zinc"
|
|
208
|
+
/>
|
|
209
|
+
</template>
|
|
210
|
+
{{ fieldTitle("binding") }}
|
|
211
|
+
</FieldLabel>
|
|
212
|
+
<InputGroup>
|
|
213
|
+
<InputGroupInput
|
|
214
|
+
v-model="bindingText"
|
|
215
|
+
placeholder="例:roles"
|
|
216
|
+
class="font-mono"
|
|
217
|
+
/>
|
|
218
|
+
</InputGroup>
|
|
219
|
+
</Field>
|
|
220
|
+
<Field orientation="vertical">
|
|
221
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
222
|
+
<template
|
|
223
|
+
v-if="fieldDescription('placeholder')"
|
|
224
|
+
#tooltip
|
|
225
|
+
>
|
|
226
|
+
<Markdown
|
|
227
|
+
:source="fieldDescription('placeholder')"
|
|
228
|
+
block
|
|
229
|
+
class="prose prose-sm prose-zinc"
|
|
230
|
+
/>
|
|
231
|
+
</template>
|
|
232
|
+
{{ fieldTitle("placeholder") }}
|
|
233
|
+
</FieldLabel>
|
|
234
|
+
<Locale v-model="value.placeholder" />
|
|
235
|
+
</Field>
|
|
236
|
+
<Field orientation="vertical">
|
|
237
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
238
|
+
<template
|
|
239
|
+
v-if="fieldDescription('size')"
|
|
240
|
+
#tooltip
|
|
241
|
+
>
|
|
242
|
+
<Markdown
|
|
243
|
+
:source="fieldDescription('size')"
|
|
244
|
+
block
|
|
245
|
+
class="prose prose-sm prose-zinc"
|
|
246
|
+
/>
|
|
247
|
+
</template>
|
|
248
|
+
{{ fieldTitle("size") }}
|
|
249
|
+
</FieldLabel>
|
|
250
|
+
<InputGroup>
|
|
251
|
+
<InputGroupNumberField
|
|
252
|
+
:model-value="value.size"
|
|
253
|
+
:disabled="value.grow"
|
|
254
|
+
:min="0"
|
|
255
|
+
@update:model-value="(v) => value = { ...value, size: v }"
|
|
256
|
+
/>
|
|
257
|
+
<InputGroupAddon align="inline-end">
|
|
258
|
+
<InputGroupButton
|
|
259
|
+
:variant="value.grow ? 'primary' : 'ghost'"
|
|
260
|
+
size="xs"
|
|
261
|
+
@click="value = { ...value, grow: !value.grow }"
|
|
262
|
+
>
|
|
263
|
+
<Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
|
|
264
|
+
{{ fieldTitle("grow") }}
|
|
265
|
+
</InputGroupButton>
|
|
266
|
+
</InputGroupAddon>
|
|
267
|
+
</InputGroup>
|
|
268
|
+
</Field>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<Field orientation="vertical">
|
|
272
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
273
|
+
<template #tooltip>
|
|
274
|
+
<Markdown
|
|
275
|
+
source="下拉框可选项列表"
|
|
276
|
+
block
|
|
277
|
+
class="prose prose-sm prose-zinc"
|
|
278
|
+
/>
|
|
279
|
+
</template>
|
|
280
|
+
{{ fieldTitle("items") }}
|
|
281
|
+
</FieldLabel>
|
|
282
|
+
|
|
283
|
+
<div class="flex flex-col gap-3">
|
|
284
|
+
<div
|
|
285
|
+
v-for="(item, index) in items"
|
|
286
|
+
:key="item.id"
|
|
287
|
+
data-slot="combobox-multi-item"
|
|
288
|
+
class="relative pt-8 grid grid-cols-3 gap-3 rounded border border-zinc-200 bg-zinc-50/40 p-3"
|
|
289
|
+
>
|
|
290
|
+
<InputGroupButton
|
|
291
|
+
variant="destructive"
|
|
292
|
+
size="icon-xs"
|
|
293
|
+
data-slot="combobox-multi-item-delete"
|
|
294
|
+
aria-label="删除选项"
|
|
295
|
+
class="absolute right-2 top-2 z-10"
|
|
296
|
+
@click="removeItem(index)"
|
|
297
|
+
>
|
|
298
|
+
<Icon icon="fluent:delete-20-regular" />
|
|
299
|
+
</InputGroupButton>
|
|
300
|
+
|
|
301
|
+
<Field orientation="vertical">
|
|
302
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
303
|
+
<template
|
|
304
|
+
v-if="itemFieldDescription('label')"
|
|
305
|
+
#tooltip
|
|
306
|
+
>
|
|
307
|
+
<Markdown
|
|
308
|
+
:source="itemFieldDescription('label')"
|
|
309
|
+
block
|
|
310
|
+
class="prose prose-sm prose-zinc"
|
|
311
|
+
/>
|
|
312
|
+
</template>
|
|
313
|
+
{{ itemFieldTitle("label") }}
|
|
314
|
+
</FieldLabel>
|
|
315
|
+
<Locale
|
|
316
|
+
markdown
|
|
317
|
+
translate-hint="combobox option label"
|
|
318
|
+
:model-value="item.label"
|
|
319
|
+
@update:model-value="(v) => setItemLabel(index, v)"
|
|
320
|
+
/>
|
|
321
|
+
</Field>
|
|
322
|
+
|
|
323
|
+
<Field orientation="vertical">
|
|
324
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
325
|
+
<template
|
|
326
|
+
v-if="itemFieldDescription('value')"
|
|
327
|
+
#tooltip
|
|
328
|
+
>
|
|
329
|
+
<Markdown
|
|
330
|
+
:source="itemFieldDescription('value')"
|
|
331
|
+
block
|
|
332
|
+
class="prose prose-sm prose-zinc"
|
|
333
|
+
/>
|
|
334
|
+
</template>
|
|
335
|
+
{{ itemFieldTitle("value") }}
|
|
336
|
+
</FieldLabel>
|
|
337
|
+
<InputGroup>
|
|
338
|
+
<InputGroupAddon align="inline-start">
|
|
339
|
+
<DropdownMenu>
|
|
340
|
+
<DropdownMenuTrigger as-child>
|
|
341
|
+
<InputGroupButton
|
|
342
|
+
size="icon-sm"
|
|
343
|
+
as-child
|
|
344
|
+
>
|
|
345
|
+
<button
|
|
346
|
+
type="button"
|
|
347
|
+
data-slot="combobox-multi-item-kind-trigger"
|
|
348
|
+
class="text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5"
|
|
349
|
+
aria-label="切换值类型"
|
|
350
|
+
>
|
|
351
|
+
<Icon
|
|
352
|
+
:icon="item.value.kind === 'number' ? 'fluent:number-symbol-20-regular' : 'fluent:textbox-20-regular'"
|
|
353
|
+
/>
|
|
354
|
+
</button>
|
|
355
|
+
</InputGroupButton>
|
|
356
|
+
</DropdownMenuTrigger>
|
|
357
|
+
<DropdownMenuContent align="start">
|
|
358
|
+
<DropdownMenuItem @select="setItemKind(index, 'text')">
|
|
359
|
+
<Icon icon="fluent:textbox-20-regular" />
|
|
360
|
+
<span>文本</span>
|
|
361
|
+
</DropdownMenuItem>
|
|
362
|
+
<DropdownMenuItem @select="setItemKind(index, 'number')">
|
|
363
|
+
<Icon icon="fluent:number-symbol-20-regular" />
|
|
364
|
+
<span>数字</span>
|
|
365
|
+
</DropdownMenuItem>
|
|
366
|
+
</DropdownMenuContent>
|
|
367
|
+
</DropdownMenu>
|
|
368
|
+
</InputGroupAddon>
|
|
369
|
+
|
|
370
|
+
<InputGroupInput
|
|
371
|
+
v-if="item.value.kind === 'text'"
|
|
372
|
+
:model-value="item.value.value"
|
|
373
|
+
placeholder="例:admin"
|
|
374
|
+
@update:model-value="(v) => setItemTextValue(index, String(v ?? ''))"
|
|
375
|
+
/>
|
|
376
|
+
<InputGroupNumberField
|
|
377
|
+
v-else
|
|
378
|
+
:model-value="item.value.value"
|
|
379
|
+
@update:model-value="(v) => setItemNumberValue(index, v)"
|
|
380
|
+
/>
|
|
381
|
+
</InputGroup>
|
|
382
|
+
</Field>
|
|
383
|
+
|
|
384
|
+
<Field orientation="vertical">
|
|
385
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
386
|
+
<template
|
|
387
|
+
v-if="itemFieldDescription('tooltip')"
|
|
388
|
+
#tooltip
|
|
389
|
+
>
|
|
390
|
+
<Markdown
|
|
391
|
+
:source="itemFieldDescription('tooltip')"
|
|
392
|
+
block
|
|
393
|
+
class="prose prose-sm prose-zinc"
|
|
394
|
+
/>
|
|
395
|
+
</template>
|
|
396
|
+
{{ itemFieldTitle("tooltip") }}
|
|
397
|
+
</FieldLabel>
|
|
398
|
+
<Locale
|
|
399
|
+
markdown
|
|
400
|
+
translate-hint="combobox option tooltip"
|
|
401
|
+
:model-value="item.tooltip"
|
|
402
|
+
@update:model-value="(v) => setItemTooltip(index, v)"
|
|
403
|
+
/>
|
|
404
|
+
</Field>
|
|
405
|
+
</div>
|
|
406
|
+
|
|
407
|
+
<Button
|
|
408
|
+
type="button"
|
|
409
|
+
data-slot="combobox-multi-add-item"
|
|
410
|
+
class="w-full justify-center"
|
|
411
|
+
@click="addItem"
|
|
412
|
+
>
|
|
413
|
+
<Icon icon="fluent:add-20-regular" />
|
|
414
|
+
<span>增加选项</span>
|
|
415
|
+
</Button>
|
|
416
|
+
</div>
|
|
417
|
+
</Field>
|
|
418
|
+
|
|
419
|
+
<div class="grid grid-cols-2 gap-x-6 gap-y-4">
|
|
420
|
+
<Field orientation="vertical">
|
|
421
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
422
|
+
<template
|
|
423
|
+
v-if="fieldDescription('hidden')"
|
|
424
|
+
#tooltip
|
|
425
|
+
>
|
|
426
|
+
<Markdown
|
|
427
|
+
:source="fieldDescription('hidden')"
|
|
428
|
+
block
|
|
429
|
+
class="prose prose-sm prose-zinc"
|
|
430
|
+
/>
|
|
431
|
+
</template>
|
|
432
|
+
{{ fieldTitle("hidden") }}
|
|
433
|
+
</FieldLabel>
|
|
434
|
+
<ExpressionEditor
|
|
435
|
+
v-model="hiddenModel"
|
|
436
|
+
placeholder="例:row.archived"
|
|
437
|
+
result-type="bool"
|
|
438
|
+
:extra-vars="ROW_VARS"
|
|
439
|
+
/>
|
|
440
|
+
</Field>
|
|
441
|
+
<Field orientation="vertical">
|
|
442
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
443
|
+
<template
|
|
444
|
+
v-if="fieldDescription('disabled')"
|
|
445
|
+
#tooltip
|
|
446
|
+
>
|
|
447
|
+
<Markdown
|
|
448
|
+
:source="fieldDescription('disabled')"
|
|
449
|
+
block
|
|
450
|
+
class="prose prose-sm prose-zinc"
|
|
451
|
+
/>
|
|
452
|
+
</template>
|
|
453
|
+
{{ fieldTitle("disabled") }}
|
|
454
|
+
</FieldLabel>
|
|
455
|
+
<ExpressionEditor
|
|
456
|
+
v-model="disabledModel"
|
|
457
|
+
placeholder="例:row.locked"
|
|
458
|
+
result-type="bool"
|
|
459
|
+
:extra-vars="ROW_VARS"
|
|
460
|
+
/>
|
|
461
|
+
</Field>
|
|
462
|
+
<Field orientation="vertical">
|
|
463
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
464
|
+
<template
|
|
465
|
+
v-if="fieldDescription('readonly')"
|
|
466
|
+
#tooltip
|
|
467
|
+
>
|
|
468
|
+
<Markdown
|
|
469
|
+
:source="fieldDescription('readonly')"
|
|
470
|
+
block
|
|
471
|
+
class="prose prose-sm prose-zinc"
|
|
472
|
+
/>
|
|
473
|
+
</template>
|
|
474
|
+
{{ fieldTitle("readonly") }}
|
|
475
|
+
</FieldLabel>
|
|
476
|
+
<ExpressionEditor
|
|
477
|
+
v-model="readonlyModel"
|
|
478
|
+
placeholder="例:row.id != null"
|
|
479
|
+
result-type="bool"
|
|
480
|
+
:extra-vars="ROW_VARS"
|
|
481
|
+
/>
|
|
482
|
+
</Field>
|
|
483
|
+
<Field
|
|
484
|
+
orientation="vertical"
|
|
485
|
+
class="col-span-2"
|
|
486
|
+
>
|
|
487
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
488
|
+
<template
|
|
489
|
+
v-if="fieldDescription('derived')"
|
|
490
|
+
#tooltip
|
|
491
|
+
>
|
|
492
|
+
<Markdown
|
|
493
|
+
:source="fieldDescription('derived')"
|
|
494
|
+
block
|
|
495
|
+
class="prose prose-sm prose-zinc"
|
|
496
|
+
/>
|
|
497
|
+
</template>
|
|
498
|
+
{{ fieldTitle("derived") }}
|
|
499
|
+
</FieldLabel>
|
|
500
|
+
<DerivedValueEditor
|
|
501
|
+
v-model="derivedModel"
|
|
502
|
+
result-type="dyn"
|
|
503
|
+
placeholder="例:form.defaults[row.kind]"
|
|
504
|
+
/>
|
|
505
|
+
</Field>
|
|
506
|
+
</div>
|
|
507
|
+
<Separator />
|
|
508
|
+
<div class="flex flex-wrap gap-x-8 gap-y-3">
|
|
509
|
+
<Field
|
|
510
|
+
orientation="horizontal"
|
|
511
|
+
class="w-auto gap-2"
|
|
512
|
+
>
|
|
513
|
+
<Switch
|
|
514
|
+
:model-value="value.enableSorting ?? false"
|
|
515
|
+
@update:model-value="(v) => value = { ...value, enableSorting: v }"
|
|
516
|
+
/>
|
|
517
|
+
<FieldLabel class="text-sm text-zinc-600">
|
|
518
|
+
<template
|
|
519
|
+
v-if="fieldDescription('enableSorting')"
|
|
520
|
+
#tooltip
|
|
521
|
+
>
|
|
522
|
+
<Markdown
|
|
523
|
+
:source="fieldDescription('enableSorting')"
|
|
524
|
+
block
|
|
525
|
+
class="prose prose-sm prose-zinc"
|
|
526
|
+
/>
|
|
527
|
+
</template>
|
|
528
|
+
{{ fieldTitle("enableSorting") }}
|
|
529
|
+
</FieldLabel>
|
|
530
|
+
</Field>
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
</template>
|
|
@@ -0,0 +1,133 @@
|
|
|
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 disabled?: string | undefined;
|
|
9
|
+
readonly type: "com.shwfed.table.column.combobox-multi";
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly title: readonly [{
|
|
12
|
+
readonly locale: "zh";
|
|
13
|
+
readonly message: string;
|
|
14
|
+
}, ...{
|
|
15
|
+
readonly locale: "en" | "ja" | "ko";
|
|
16
|
+
readonly message: string;
|
|
17
|
+
}[]];
|
|
18
|
+
readonly hidden?: string | undefined;
|
|
19
|
+
readonly tooltip?: readonly [{
|
|
20
|
+
readonly locale: "zh";
|
|
21
|
+
readonly message: string;
|
|
22
|
+
}, ...{
|
|
23
|
+
readonly locale: "en" | "ja" | "ko";
|
|
24
|
+
readonly message: string;
|
|
25
|
+
}[]] | undefined;
|
|
26
|
+
readonly compatibilityDate: "2026-05-25";
|
|
27
|
+
readonly items: readonly {
|
|
28
|
+
readonly label: readonly [{
|
|
29
|
+
readonly locale: "zh";
|
|
30
|
+
readonly message: string;
|
|
31
|
+
}, ...{
|
|
32
|
+
readonly locale: "en" | "ja" | "ko";
|
|
33
|
+
readonly message: string;
|
|
34
|
+
}[]];
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly tooltip?: readonly [{
|
|
37
|
+
readonly locale: "zh";
|
|
38
|
+
readonly message: string;
|
|
39
|
+
}, ...{
|
|
40
|
+
readonly locale: "en" | "ja" | "ko";
|
|
41
|
+
readonly message: string;
|
|
42
|
+
}[]] | undefined;
|
|
43
|
+
readonly value: {
|
|
44
|
+
readonly value: string;
|
|
45
|
+
readonly kind: "text";
|
|
46
|
+
} | {
|
|
47
|
+
readonly value: number;
|
|
48
|
+
readonly kind: "number";
|
|
49
|
+
};
|
|
50
|
+
}[];
|
|
51
|
+
readonly groupId?: string | undefined;
|
|
52
|
+
readonly placeholder?: readonly [{
|
|
53
|
+
readonly locale: "zh";
|
|
54
|
+
readonly message: string;
|
|
55
|
+
}, ...{
|
|
56
|
+
readonly locale: "en" | "ja" | "ko";
|
|
57
|
+
readonly message: string;
|
|
58
|
+
}[]] | undefined;
|
|
59
|
+
readonly readonly?: string | undefined;
|
|
60
|
+
readonly grow?: boolean | undefined;
|
|
61
|
+
readonly binding: string;
|
|
62
|
+
readonly derived?: {
|
|
63
|
+
readonly mode: "formula" | "prefill";
|
|
64
|
+
readonly expression: string;
|
|
65
|
+
} | undefined;
|
|
66
|
+
readonly enableSorting?: boolean | undefined;
|
|
67
|
+
}) => any;
|
|
68
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
69
|
+
"onUpdate:modelValue"?: ((value: {
|
|
70
|
+
readonly size?: number | undefined;
|
|
71
|
+
readonly disabled?: string | undefined;
|
|
72
|
+
readonly type: "com.shwfed.table.column.combobox-multi";
|
|
73
|
+
readonly id: string;
|
|
74
|
+
readonly title: readonly [{
|
|
75
|
+
readonly locale: "zh";
|
|
76
|
+
readonly message: string;
|
|
77
|
+
}, ...{
|
|
78
|
+
readonly locale: "en" | "ja" | "ko";
|
|
79
|
+
readonly message: string;
|
|
80
|
+
}[]];
|
|
81
|
+
readonly hidden?: string | undefined;
|
|
82
|
+
readonly tooltip?: readonly [{
|
|
83
|
+
readonly locale: "zh";
|
|
84
|
+
readonly message: string;
|
|
85
|
+
}, ...{
|
|
86
|
+
readonly locale: "en" | "ja" | "ko";
|
|
87
|
+
readonly message: string;
|
|
88
|
+
}[]] | undefined;
|
|
89
|
+
readonly compatibilityDate: "2026-05-25";
|
|
90
|
+
readonly items: readonly {
|
|
91
|
+
readonly label: readonly [{
|
|
92
|
+
readonly locale: "zh";
|
|
93
|
+
readonly message: string;
|
|
94
|
+
}, ...{
|
|
95
|
+
readonly locale: "en" | "ja" | "ko";
|
|
96
|
+
readonly message: string;
|
|
97
|
+
}[]];
|
|
98
|
+
readonly id: string;
|
|
99
|
+
readonly tooltip?: readonly [{
|
|
100
|
+
readonly locale: "zh";
|
|
101
|
+
readonly message: string;
|
|
102
|
+
}, ...{
|
|
103
|
+
readonly locale: "en" | "ja" | "ko";
|
|
104
|
+
readonly message: string;
|
|
105
|
+
}[]] | undefined;
|
|
106
|
+
readonly value: {
|
|
107
|
+
readonly value: string;
|
|
108
|
+
readonly kind: "text";
|
|
109
|
+
} | {
|
|
110
|
+
readonly value: number;
|
|
111
|
+
readonly kind: "number";
|
|
112
|
+
};
|
|
113
|
+
}[];
|
|
114
|
+
readonly groupId?: string | undefined;
|
|
115
|
+
readonly placeholder?: readonly [{
|
|
116
|
+
readonly locale: "zh";
|
|
117
|
+
readonly message: string;
|
|
118
|
+
}, ...{
|
|
119
|
+
readonly locale: "en" | "ja" | "ko";
|
|
120
|
+
readonly message: string;
|
|
121
|
+
}[]] | undefined;
|
|
122
|
+
readonly readonly?: string | undefined;
|
|
123
|
+
readonly grow?: boolean | undefined;
|
|
124
|
+
readonly binding: string;
|
|
125
|
+
readonly derived?: {
|
|
126
|
+
readonly mode: "formula" | "prefill";
|
|
127
|
+
readonly expression: string;
|
|
128
|
+
} | undefined;
|
|
129
|
+
readonly enableSorting?: boolean | undefined;
|
|
130
|
+
}) => any) | undefined;
|
|
131
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
132
|
+
declare const _default: typeof __VLS_export;
|
|
133
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CellContext } from '@tanstack/vue-table';
|
|
2
|
+
import type { Value } from './schema.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
column: Value;
|
|
5
|
+
ctx: CellContext<unknown, unknown>;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|