@shwfed/config 2.10.8 → 2.10.10
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 +1143 -1024
- package/dist/module.json +1 -1
- package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-BX_UfcPb.js → FieldGroup.vue_vue_type_script_setup_true_lang-CsPU4iZU.js} +1 -1
- package/dist/preview/assets/{badge-obDKnV3E.js → badge-B953zx7V.js} +1 -1
- package/dist/preview/assets/{config-DbdgS5Ng.js → config-B-o7DV04.js} +1 -1
- package/dist/preview/assets/{config-C6IfQR2K.js → config-BajA-dJ1.js} +1 -1
- package/dist/preview/assets/{config-jBRCpIX5.js → config-BjdMNJwa.js} +1 -1
- package/dist/preview/assets/{config-CaaIte9f.js → config-C0xCcVfy.js} +1 -1
- package/dist/preview/assets/{config-BYhrPimZ.js → config-C2-lrcCq.js} +1 -1
- package/dist/preview/assets/{config-DGJLbdm3.js → config-C3v6QvLS.js} +1 -1
- package/dist/preview/assets/{config-DSD3RZZt.js → config-C4Twz5UA.js} +1 -1
- package/dist/preview/assets/{config-9weuJKPA.js → config-CFWXRIOe.js} +1 -1
- package/dist/preview/assets/{config-BKVK2els.js → config-CqMqqE_9.js} +1 -1
- package/dist/preview/assets/{config-DxmfhxW9.js → config-D5m2C0xK.js} +1 -1
- package/dist/preview/assets/{config-xdKDKKAa.js → config-DAJ25V43.js} +1 -1
- package/dist/preview/assets/{config-CnpY7wA_.js → config-DmgHMdSz.js} +1 -1
- package/dist/preview/assets/{config-CYdIN2D7.js → config-DpEkjTKt.js} +1 -1
- package/dist/preview/assets/{config-B27gvYuN.js → config-DqAigk_E.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-C97mjLAr.js → definition.vue_vue_type_script_setup_true_lang-WNrh1xWy.js} +1 -1
- package/dist/preview/assets/index-BdS7dokp.js +763 -0
- package/dist/preview/assets/index-BkwnC_tl.js +1 -0
- package/dist/preview/assets/{index-BWc0rZ2y.js → index-Bv_Ig-Tl.js} +1 -1
- package/dist/preview/assets/index-Cc4BT5dc.css +1 -0
- package/dist/preview/assets/{item-BRGONTEu.js → item-caTb4x-x.js} +1 -1
- package/dist/preview/assets/{runtime-Czg0F_NN.js → runtime-7ThCZ17X.js} +1 -1
- package/dist/preview/assets/{runtime-CJVZpawP.js → runtime-B-tUuLEY.js} +1 -1
- package/dist/preview/assets/{runtime-D-9NZJ0Z.js → runtime-Bnaxoocd.js} +1 -1
- package/dist/preview/assets/{runtime-BGRgWBLF.js → runtime-C8_u1NyC.js} +1 -1
- package/dist/preview/assets/{runtime-DqhT5NCm.js → runtime-C9lZq_oo.js} +1 -1
- package/dist/preview/assets/{runtime-CHOWqPGP.js → runtime-CIWhgS6a.js} +1 -1
- package/dist/preview/assets/{runtime-DcQjFFJx.js → runtime-CZrQz2RJ.js} +1 -1
- package/dist/preview/assets/{runtime-BoiTEUZt.js → runtime-D6EIpId9.js} +1 -1
- package/dist/preview/assets/{runtime-Ci3L--AW.js → runtime-DELhNsaH.js} +1 -1
- package/dist/preview/assets/{runtime-DZtGKJgS.js → runtime-d4XHvjgW.js} +1 -1
- package/dist/preview/assets/{schema-meta-xFd44RnL.js → schema-meta-Cf59HabB.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/actions/components/group.d.vue.ts +9 -0
- package/dist/runtime/components/actions/components/group.vue +20 -1
- package/dist/runtime/components/actions/components/group.vue.d.ts +9 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/runtime.vue +1 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue +32 -1
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +2 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +4 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.vue +202 -112
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.vue +202 -112
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.vue +223 -132
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.vue +223 -132
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/config.d.vue.ts +59 -0
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/config.vue +345 -0
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/config.vue.d.ts +59 -0
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/runtime.vue +113 -0
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/schema.d.ts +79 -0
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/schema.js +86 -0
- package/dist/runtime/components/form/unit-config.d.vue.ts +27 -0
- package/dist/runtime/components/form/unit-config.vue +117 -73
- package/dist/runtime/components/form/unit-config.vue.d.ts +27 -0
- 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-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
- 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-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/ui/markdown/Markdown.vue +19 -16
- package/dist/runtime/style.css +1 -1
- package/dist/runtime/utils/markdown.d.ts +5 -2
- package/dist/runtime/utils/markdown.js +22 -1
- package/package.json +1 -1
- package/dist/preview/assets/index-ADrQrdaQ.js +0 -1
- package/dist/preview/assets/index-Cj7bRG7B.css +0 -1
- package/dist/preview/assets/index-DFmBrVzd.js +0 -763
package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.vue
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Icon } from "@iconify/vue";
|
|
3
|
-
import { computed } from "vue";
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
|
+
import { useI18n } from "vue-i18n";
|
|
4
5
|
import { Button } from "../../../../ui/button";
|
|
5
6
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../../../ui/dropdown-menu";
|
|
6
7
|
import { ExpressionEditor } from "../../../../ui/expression-editor";
|
|
@@ -10,10 +11,15 @@ import { Field, FieldLabel } from "../../../../ui/field";
|
|
|
10
11
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupNumberField } from "../../../../ui/input-group";
|
|
11
12
|
import { Locale as LocaleField } from "../../../../ui/locale";
|
|
12
13
|
import { Markdown } from "../../../../ui/markdown";
|
|
14
|
+
import { getLocalizedText } from "../../../../../share/locale";
|
|
15
|
+
import {
|
|
16
|
+
useTreeDnd
|
|
17
|
+
} from "../../../../../composables/useTreeDnd";
|
|
13
18
|
import { getStructFieldDescription, getStructFieldTitle } from "../../../schema";
|
|
14
19
|
import { itemSchema, schema } from "./schema";
|
|
15
20
|
defineOptions({ name: "ShwfedRadioGroupFieldConfig" });
|
|
16
21
|
const value = defineModel({ type: null, ...{ required: true } });
|
|
22
|
+
const { locale } = useI18n();
|
|
17
23
|
const fieldSchema = schema(() => {
|
|
18
24
|
});
|
|
19
25
|
const fieldTitle = (f) => getStructFieldTitle(fieldSchema, f) ?? f;
|
|
@@ -35,6 +41,19 @@ const pathText = computed({
|
|
|
35
41
|
}
|
|
36
42
|
});
|
|
37
43
|
const items = computed(() => value.value.items ?? []);
|
|
44
|
+
const expandedIds = ref(/* @__PURE__ */ new Set());
|
|
45
|
+
function isExpanded(id) {
|
|
46
|
+
return expandedIds.value.has(id);
|
|
47
|
+
}
|
|
48
|
+
function toggleExpanded(id) {
|
|
49
|
+
const next = new Set(expandedIds.value);
|
|
50
|
+
if (next.has(id)) next.delete(id);
|
|
51
|
+
else next.add(id);
|
|
52
|
+
expandedIds.value = next;
|
|
53
|
+
}
|
|
54
|
+
function summaryFor(item) {
|
|
55
|
+
return getLocalizedText(item.label, locale.value) || "\u672A\u547D\u540D\u9009\u9879";
|
|
56
|
+
}
|
|
38
57
|
function newId() {
|
|
39
58
|
return typeof crypto !== "undefined" && "randomUUID" in crypto ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
40
59
|
const r = Math.random() * 16 | 0;
|
|
@@ -57,13 +76,47 @@ function patchItem(index, patch) {
|
|
|
57
76
|
value.value = { ...value.value, items: next };
|
|
58
77
|
}
|
|
59
78
|
function addItem() {
|
|
60
|
-
|
|
79
|
+
const item = newItem();
|
|
80
|
+
value.value = { ...value.value, items: [...value.value.items ?? [], item] };
|
|
81
|
+
expandedIds.value = new Set(expandedIds.value).add(item.id);
|
|
61
82
|
}
|
|
62
83
|
function removeItem(index) {
|
|
63
84
|
const next = [...value.value.items ?? []];
|
|
64
85
|
next.splice(index, 1);
|
|
65
86
|
value.value = { ...value.value, items: next };
|
|
66
87
|
}
|
|
88
|
+
function moveItem(from, to) {
|
|
89
|
+
const next = [...value.value.items ?? []];
|
|
90
|
+
if (from < 0 || to < 0 || from >= next.length || to >= next.length) return;
|
|
91
|
+
const [m] = next.splice(from, 1);
|
|
92
|
+
if (!m) return;
|
|
93
|
+
next.splice(to, 0, m);
|
|
94
|
+
value.value = { ...value.value, items: next };
|
|
95
|
+
}
|
|
96
|
+
const ROW_KIND = "radio-group-option";
|
|
97
|
+
function onRowDrop(e) {
|
|
98
|
+
if (e.source.kind !== ROW_KIND || e.target.kind !== ROW_KIND) return;
|
|
99
|
+
const from = items.value.findIndex((it) => it.id === e.source.id);
|
|
100
|
+
const to = items.value.findIndex((it) => it.id === e.target.id);
|
|
101
|
+
if (from < 0 || to < 0) return;
|
|
102
|
+
if (e.instruction === "reorder-above") moveItem(from, from < to ? to - 1 : to);
|
|
103
|
+
else if (e.instruction === "reorder-below") moveItem(from, from <= to ? to : to + 1);
|
|
104
|
+
}
|
|
105
|
+
const dnd = useTreeDnd({ onRowDrop });
|
|
106
|
+
const pickDragHandle = (el) => el.querySelector(".drag-handle");
|
|
107
|
+
function rowConfig(index) {
|
|
108
|
+
const id = items.value[index]?.id ?? `idx-${index}`;
|
|
109
|
+
return {
|
|
110
|
+
kind: ROW_KIND,
|
|
111
|
+
canDrop: (src) => src.kind === ROW_KIND,
|
|
112
|
+
blockInstructions: (src) => {
|
|
113
|
+
const block = ["make-child", "reparent"];
|
|
114
|
+
if (src.id === id) block.push("reorder-above", "reorder-below");
|
|
115
|
+
return block;
|
|
116
|
+
},
|
|
117
|
+
dragHandle: pickDragHandle
|
|
118
|
+
};
|
|
119
|
+
}
|
|
67
120
|
function setItemKind(index, kind) {
|
|
68
121
|
const cur = value.value.items?.[index];
|
|
69
122
|
if (!cur || cur.value.kind === kind) return;
|
|
@@ -211,124 +264,157 @@ function setItemTooltip(index, tooltip) {
|
|
|
211
264
|
<div
|
|
212
265
|
v-for="(item, index) in items"
|
|
213
266
|
:key="item.id"
|
|
267
|
+
:ref="dnd.rowRef(item.id, rowConfig(index))"
|
|
214
268
|
data-slot="radio-group-item"
|
|
215
|
-
class="relative
|
|
269
|
+
class="relative rounded border border-zinc-200 bg-zinc-50/40"
|
|
270
|
+
:data-instruction="dnd.instructionFor(item.id) ?? void 0"
|
|
216
271
|
>
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
272
|
+
<div class="flex items-center gap-2 p-2">
|
|
273
|
+
<Icon
|
|
274
|
+
icon="fluent:re-order-dots-vertical-20-regular"
|
|
275
|
+
class="drag-handle size-4 shrink-0 cursor-grab text-zinc-400"
|
|
276
|
+
data-slot="radio-group-item-drag-handle"
|
|
277
|
+
/>
|
|
278
|
+
<InputGroupButton
|
|
279
|
+
size="icon-xs"
|
|
280
|
+
class="shrink-0"
|
|
281
|
+
data-slot="radio-group-item-collapse"
|
|
282
|
+
:aria-expanded="isExpanded(item.id)"
|
|
283
|
+
:aria-label="isExpanded(item.id) ? '\u6298\u53E0' : '\u5C55\u5F00'"
|
|
284
|
+
@click="toggleExpanded(item.id)"
|
|
285
|
+
>
|
|
286
|
+
<Icon
|
|
287
|
+
:icon="isExpanded(item.id) ? 'fluent:chevron-down-20-regular' : 'fluent:chevron-right-20-regular'"
|
|
288
|
+
/>
|
|
289
|
+
</InputGroupButton>
|
|
290
|
+
<div
|
|
291
|
+
class="min-w-0 flex-1 truncate text-sm text-zinc-700"
|
|
292
|
+
data-slot="radio-group-item-summary"
|
|
293
|
+
>
|
|
294
|
+
{{ summaryFor(item) }}
|
|
295
|
+
</div>
|
|
296
|
+
<InputGroupButton
|
|
297
|
+
variant="destructive"
|
|
298
|
+
size="icon-xs"
|
|
299
|
+
data-slot="radio-group-item-delete"
|
|
300
|
+
aria-label="删除选项"
|
|
301
|
+
class="shrink-0"
|
|
302
|
+
@click="removeItem(index)"
|
|
303
|
+
>
|
|
304
|
+
<Icon icon="fluent:delete-20-regular" />
|
|
305
|
+
</InputGroupButton>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
<div
|
|
309
|
+
v-show="isExpanded(item.id)"
|
|
310
|
+
class="grid grid-cols-3 gap-3 px-3 pb-3"
|
|
311
|
+
data-slot="radio-group-item-content"
|
|
224
312
|
>
|
|
225
|
-
<
|
|
226
|
-
|
|
313
|
+
<Field orientation="vertical">
|
|
314
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
315
|
+
<template
|
|
316
|
+
v-if="itemFieldDescription('label')"
|
|
317
|
+
#tooltip
|
|
318
|
+
>
|
|
319
|
+
<Markdown
|
|
320
|
+
:source="itemFieldDescription('label')"
|
|
321
|
+
block
|
|
322
|
+
class="prose prose-sm prose-zinc"
|
|
323
|
+
/>
|
|
324
|
+
</template>
|
|
325
|
+
{{ itemFieldTitle("label") }}
|
|
326
|
+
</FieldLabel>
|
|
327
|
+
<LocaleField
|
|
328
|
+
markdown
|
|
329
|
+
translate-hint="radio option label"
|
|
330
|
+
:model-value="item.label"
|
|
331
|
+
@update:model-value="(v) => setItemLabel(index, v)"
|
|
332
|
+
/>
|
|
333
|
+
</Field>
|
|
227
334
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
335
|
+
<Field orientation="vertical">
|
|
336
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
337
|
+
<template
|
|
338
|
+
v-if="itemFieldDescription('value')"
|
|
339
|
+
#tooltip
|
|
340
|
+
>
|
|
341
|
+
<Markdown
|
|
342
|
+
:source="itemFieldDescription('value')"
|
|
343
|
+
block
|
|
344
|
+
class="prose prose-sm prose-zinc"
|
|
345
|
+
/>
|
|
346
|
+
</template>
|
|
347
|
+
{{ itemFieldTitle("value") }}
|
|
348
|
+
</FieldLabel>
|
|
349
|
+
<InputGroup>
|
|
350
|
+
<InputGroupAddon align="inline-start">
|
|
351
|
+
<DropdownMenu>
|
|
352
|
+
<DropdownMenuTrigger as-child>
|
|
353
|
+
<InputGroupButton
|
|
354
|
+
size="icon-sm"
|
|
355
|
+
as-child
|
|
356
|
+
>
|
|
357
|
+
<button
|
|
358
|
+
type="button"
|
|
359
|
+
data-slot="radio-group-item-kind-trigger"
|
|
360
|
+
class="text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5"
|
|
361
|
+
aria-label="切换值类型"
|
|
362
|
+
>
|
|
363
|
+
<Icon
|
|
364
|
+
:icon="item.value.kind === 'number' ? 'fluent:number-symbol-20-regular' : 'fluent:textbox-20-regular'"
|
|
365
|
+
/>
|
|
366
|
+
</button>
|
|
367
|
+
</InputGroupButton>
|
|
368
|
+
</DropdownMenuTrigger>
|
|
369
|
+
<DropdownMenuContent align="start">
|
|
370
|
+
<DropdownMenuItem @select="setItemKind(index, 'text')">
|
|
371
|
+
<Icon icon="fluent:textbox-20-regular" />
|
|
372
|
+
<span>文本</span>
|
|
373
|
+
</DropdownMenuItem>
|
|
374
|
+
<DropdownMenuItem @select="setItemKind(index, 'number')">
|
|
375
|
+
<Icon icon="fluent:number-symbol-20-regular" />
|
|
376
|
+
<span>数字</span>
|
|
377
|
+
</DropdownMenuItem>
|
|
378
|
+
</DropdownMenuContent>
|
|
379
|
+
</DropdownMenu>
|
|
380
|
+
</InputGroupAddon>
|
|
249
381
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
>
|
|
256
|
-
<Markdown
|
|
257
|
-
:source="itemFieldDescription('value')"
|
|
258
|
-
block
|
|
259
|
-
class="prose prose-sm prose-zinc"
|
|
382
|
+
<InputGroupInput
|
|
383
|
+
v-if="item.value.kind === 'text'"
|
|
384
|
+
:model-value="item.value.value"
|
|
385
|
+
placeholder="例:cny"
|
|
386
|
+
@update:model-value="(v) => setItemTextValue(index, String(v ?? ''))"
|
|
260
387
|
/>
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
<InputGroupButton
|
|
269
|
-
size="icon-sm"
|
|
270
|
-
as-child
|
|
271
|
-
>
|
|
272
|
-
<button
|
|
273
|
-
type="button"
|
|
274
|
-
data-slot="radio-group-item-kind-trigger"
|
|
275
|
-
class="text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5"
|
|
276
|
-
aria-label="切换值类型"
|
|
277
|
-
>
|
|
278
|
-
<Icon
|
|
279
|
-
:icon="item.value.kind === 'number' ? 'fluent:number-symbol-20-regular' : 'fluent:textbox-20-regular'"
|
|
280
|
-
/>
|
|
281
|
-
</button>
|
|
282
|
-
</InputGroupButton>
|
|
283
|
-
</DropdownMenuTrigger>
|
|
284
|
-
<DropdownMenuContent align="start">
|
|
285
|
-
<DropdownMenuItem @select="setItemKind(index, 'text')">
|
|
286
|
-
<Icon icon="fluent:textbox-20-regular" />
|
|
287
|
-
<span>文本</span>
|
|
288
|
-
</DropdownMenuItem>
|
|
289
|
-
<DropdownMenuItem @select="setItemKind(index, 'number')">
|
|
290
|
-
<Icon icon="fluent:number-symbol-20-regular" />
|
|
291
|
-
<span>数字</span>
|
|
292
|
-
</DropdownMenuItem>
|
|
293
|
-
</DropdownMenuContent>
|
|
294
|
-
</DropdownMenu>
|
|
295
|
-
</InputGroupAddon>
|
|
388
|
+
<InputGroupNumberField
|
|
389
|
+
v-else
|
|
390
|
+
:model-value="item.value.value"
|
|
391
|
+
@update:model-value="(v) => setItemNumberValue(index, v)"
|
|
392
|
+
/>
|
|
393
|
+
</InputGroup>
|
|
394
|
+
</Field>
|
|
296
395
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
396
|
+
<Field orientation="vertical">
|
|
397
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
398
|
+
<template
|
|
399
|
+
v-if="itemFieldDescription('tooltip')"
|
|
400
|
+
#tooltip
|
|
401
|
+
>
|
|
402
|
+
<Markdown
|
|
403
|
+
:source="itemFieldDescription('tooltip')"
|
|
404
|
+
block
|
|
405
|
+
class="prose prose-sm prose-zinc"
|
|
406
|
+
/>
|
|
407
|
+
</template>
|
|
408
|
+
{{ itemFieldTitle("tooltip") }}
|
|
409
|
+
</FieldLabel>
|
|
410
|
+
<LocaleField
|
|
411
|
+
markdown
|
|
412
|
+
translate-hint="radio option tooltip"
|
|
413
|
+
:model-value="item.tooltip"
|
|
414
|
+
@update:model-value="(v) => setItemTooltip(index, v)"
|
|
307
415
|
/>
|
|
308
|
-
</
|
|
309
|
-
</
|
|
310
|
-
|
|
311
|
-
<Field orientation="vertical">
|
|
312
|
-
<FieldLabel class="text-xs text-zinc-500">
|
|
313
|
-
<template
|
|
314
|
-
v-if="itemFieldDescription('tooltip')"
|
|
315
|
-
#tooltip
|
|
316
|
-
>
|
|
317
|
-
<Markdown
|
|
318
|
-
:source="itemFieldDescription('tooltip')"
|
|
319
|
-
block
|
|
320
|
-
class="prose prose-sm prose-zinc"
|
|
321
|
-
/>
|
|
322
|
-
</template>
|
|
323
|
-
{{ itemFieldTitle("tooltip") }}
|
|
324
|
-
</FieldLabel>
|
|
325
|
-
<LocaleField
|
|
326
|
-
markdown
|
|
327
|
-
translate-hint="radio option tooltip"
|
|
328
|
-
:model-value="item.tooltip"
|
|
329
|
-
@update:model-value="(v) => setItemTooltip(index, v)"
|
|
330
|
-
/>
|
|
331
|
-
</Field>
|
|
416
|
+
</Field>
|
|
417
|
+
</div>
|
|
332
418
|
</div>
|
|
333
419
|
|
|
334
420
|
<Button
|
|
@@ -462,3 +548,7 @@ function setItemTooltip(index, tooltip) {
|
|
|
462
548
|
</Field>
|
|
463
549
|
</div>
|
|
464
550
|
</template>
|
|
551
|
+
|
|
552
|
+
<style scoped>
|
|
553
|
+
[data-instruction=reorder-above]:before,[data-instruction=reorder-below]:after{background:var(--primary,#2563eb);content:"";height:2px;left:0;pointer-events:none;position:absolute;right:0;z-index:1}[data-instruction=reorder-above]:before{top:-7px}[data-instruction=reorder-below]:after{bottom:-7px}
|
|
554
|
+
</style>
|
|
@@ -40,14 +40,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
42
|
readonly options: string;
|
|
43
|
-
readonly optionValue: string;
|
|
44
|
-
readonly optionLabel: readonly [{
|
|
45
|
-
readonly locale: "zh";
|
|
46
|
-
readonly message: string;
|
|
47
|
-
}, ...{
|
|
48
|
-
readonly locale: "en" | "ja" | "ko";
|
|
49
|
-
readonly message: string;
|
|
50
|
-
}[]];
|
|
51
43
|
readonly validations?: readonly {
|
|
52
44
|
readonly message: readonly [{
|
|
53
45
|
readonly locale: "zh";
|
|
@@ -59,6 +51,14 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
59
51
|
readonly warning?: boolean | undefined;
|
|
60
52
|
readonly when: string;
|
|
61
53
|
}[] | undefined;
|
|
54
|
+
readonly optionValue: string;
|
|
55
|
+
readonly optionLabel: readonly [{
|
|
56
|
+
readonly locale: "zh";
|
|
57
|
+
readonly message: string;
|
|
58
|
+
}, ...{
|
|
59
|
+
readonly locale: "en" | "ja" | "ko";
|
|
60
|
+
readonly message: string;
|
|
61
|
+
}[]];
|
|
62
62
|
}) => any;
|
|
63
63
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
64
64
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -98,14 +98,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
98
98
|
readonly expression: string;
|
|
99
99
|
} | undefined;
|
|
100
100
|
readonly options: string;
|
|
101
|
-
readonly optionValue: string;
|
|
102
|
-
readonly optionLabel: readonly [{
|
|
103
|
-
readonly locale: "zh";
|
|
104
|
-
readonly message: string;
|
|
105
|
-
}, ...{
|
|
106
|
-
readonly locale: "en" | "ja" | "ko";
|
|
107
|
-
readonly message: string;
|
|
108
|
-
}[]];
|
|
109
101
|
readonly validations?: readonly {
|
|
110
102
|
readonly message: readonly [{
|
|
111
103
|
readonly locale: "zh";
|
|
@@ -117,6 +109,14 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
117
109
|
readonly warning?: boolean | undefined;
|
|
118
110
|
readonly when: string;
|
|
119
111
|
}[] | undefined;
|
|
112
|
+
readonly optionValue: string;
|
|
113
|
+
readonly optionLabel: readonly [{
|
|
114
|
+
readonly locale: "zh";
|
|
115
|
+
readonly message: string;
|
|
116
|
+
}, ...{
|
|
117
|
+
readonly locale: "en" | "ja" | "ko";
|
|
118
|
+
readonly message: string;
|
|
119
|
+
}[]];
|
|
120
120
|
}) => any) | undefined;
|
|
121
121
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
122
122
|
declare const _default: typeof __VLS_export;
|
|
@@ -40,14 +40,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
42
|
readonly options: string;
|
|
43
|
-
readonly optionValue: string;
|
|
44
|
-
readonly optionLabel: readonly [{
|
|
45
|
-
readonly locale: "zh";
|
|
46
|
-
readonly message: string;
|
|
47
|
-
}, ...{
|
|
48
|
-
readonly locale: "en" | "ja" | "ko";
|
|
49
|
-
readonly message: string;
|
|
50
|
-
}[]];
|
|
51
43
|
readonly validations?: readonly {
|
|
52
44
|
readonly message: readonly [{
|
|
53
45
|
readonly locale: "zh";
|
|
@@ -59,6 +51,14 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
59
51
|
readonly warning?: boolean | undefined;
|
|
60
52
|
readonly when: string;
|
|
61
53
|
}[] | undefined;
|
|
54
|
+
readonly optionValue: string;
|
|
55
|
+
readonly optionLabel: readonly [{
|
|
56
|
+
readonly locale: "zh";
|
|
57
|
+
readonly message: string;
|
|
58
|
+
}, ...{
|
|
59
|
+
readonly locale: "en" | "ja" | "ko";
|
|
60
|
+
readonly message: string;
|
|
61
|
+
}[]];
|
|
62
62
|
}) => any;
|
|
63
63
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
64
64
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -98,14 +98,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
98
98
|
readonly expression: string;
|
|
99
99
|
} | undefined;
|
|
100
100
|
readonly options: string;
|
|
101
|
-
readonly optionValue: string;
|
|
102
|
-
readonly optionLabel: readonly [{
|
|
103
|
-
readonly locale: "zh";
|
|
104
|
-
readonly message: string;
|
|
105
|
-
}, ...{
|
|
106
|
-
readonly locale: "en" | "ja" | "ko";
|
|
107
|
-
readonly message: string;
|
|
108
|
-
}[]];
|
|
109
101
|
readonly validations?: readonly {
|
|
110
102
|
readonly message: readonly [{
|
|
111
103
|
readonly locale: "zh";
|
|
@@ -117,6 +109,14 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
117
109
|
readonly warning?: boolean | undefined;
|
|
118
110
|
readonly when: string;
|
|
119
111
|
}[] | undefined;
|
|
112
|
+
readonly optionValue: string;
|
|
113
|
+
readonly optionLabel: readonly [{
|
|
114
|
+
readonly locale: "zh";
|
|
115
|
+
readonly message: string;
|
|
116
|
+
}, ...{
|
|
117
|
+
readonly locale: "en" | "ja" | "ko";
|
|
118
|
+
readonly message: string;
|
|
119
|
+
}[]];
|
|
120
120
|
}) => any) | undefined;
|
|
121
121
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
122
122
|
declare const _default: typeof __VLS_export;
|