@shwfed/config 2.10.8 → 2.10.9
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-CysVgnB5.js} +1 -1
- package/dist/preview/assets/{badge-obDKnV3E.js → badge-DdxT1J-1.js} +1 -1
- package/dist/preview/assets/{config-CYdIN2D7.js → config-073z__NM.js} +1 -1
- package/dist/preview/assets/{config-DxmfhxW9.js → config-91HQEKhM.js} +1 -1
- package/dist/preview/assets/{config-xdKDKKAa.js → config-B8k8y1J1.js} +1 -1
- package/dist/preview/assets/{config-BKVK2els.js → config-BK8WZ3pm.js} +1 -1
- package/dist/preview/assets/{config-jBRCpIX5.js → config-BX05eMo3.js} +1 -1
- package/dist/preview/assets/{config-DbdgS5Ng.js → config-BXP8aJwW.js} +1 -1
- package/dist/preview/assets/{config-CaaIte9f.js → config-BhPAyftm.js} +1 -1
- package/dist/preview/assets/{config-BYhrPimZ.js → config-BzHBSkht.js} +1 -1
- package/dist/preview/assets/{config-9weuJKPA.js → config-C3eoRHUo.js} +1 -1
- package/dist/preview/assets/{config-DSD3RZZt.js → config-CJ-NzxkH.js} +1 -1
- package/dist/preview/assets/{config-C6IfQR2K.js → config-CYRj2ZVL.js} +1 -1
- package/dist/preview/assets/{config-CnpY7wA_.js → config-DLNjjMZY.js} +1 -1
- package/dist/preview/assets/{config-DGJLbdm3.js → config-DudxzmzF.js} +1 -1
- package/dist/preview/assets/{config-B27gvYuN.js → config-cwlK3BMD.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-l59C6Dgs.js} +1 -1
- package/dist/preview/assets/index-BL58N7_5.js +763 -0
- package/dist/preview/assets/index-CA4hsfRv.js +1 -0
- package/dist/preview/assets/index-CyVzfRGQ.css +1 -0
- package/dist/preview/assets/{index-BWc0rZ2y.js → index-uAwC9Itb.js} +1 -1
- package/dist/preview/assets/{item-BRGONTEu.js → item-C79mwh5T.js} +1 -1
- package/dist/preview/assets/{runtime-Ci3L--AW.js → runtime-1_EaFcPI.js} +1 -1
- package/dist/preview/assets/{runtime-D-9NZJ0Z.js → runtime-2yzxOLnF.js} +1 -1
- package/dist/preview/assets/{runtime-DZtGKJgS.js → runtime-8Fe67mkZ.js} +1 -1
- package/dist/preview/assets/{runtime-BoiTEUZt.js → runtime-8oME8Env.js} +1 -1
- package/dist/preview/assets/{runtime-Czg0F_NN.js → runtime-CCMixJjP.js} +1 -1
- package/dist/preview/assets/{runtime-BGRgWBLF.js → runtime-CD1Q4rZ3.js} +1 -1
- package/dist/preview/assets/{runtime-DcQjFFJx.js → runtime-Cb-qIo5p.js} +1 -1
- package/dist/preview/assets/{runtime-CHOWqPGP.js → runtime-CvgAq3mp.js} +1 -1
- package/dist/preview/assets/{runtime-DqhT5NCm.js → runtime-DkWCpjKe.js} +1 -1
- package/dist/preview/assets/{runtime-CJVZpawP.js → runtime-mYNyG7UH.js} +1 -1
- package/dist/preview/assets/{schema-meta-xFd44RnL.js → schema-meta-BlTKRs15.js} +1 -1
- package/dist/preview/index.html +2 -2
- 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-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
- 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-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +4 -4
- 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-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +22 -22
- 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/date-picker/DatePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
- package/dist/runtime/components/ui/markdown/Markdown.vue +19 -16
- 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
|
@@ -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: "ShwfedCheckboxGroupFieldConfig" });
|
|
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 = "checkbox-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="checkbox-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="checkbox-group-item-drag-handle"
|
|
277
|
+
/>
|
|
278
|
+
<InputGroupButton
|
|
279
|
+
size="icon-xs"
|
|
280
|
+
class="shrink-0"
|
|
281
|
+
data-slot="checkbox-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="checkbox-group-item-summary"
|
|
293
|
+
>
|
|
294
|
+
{{ summaryFor(item) }}
|
|
295
|
+
</div>
|
|
296
|
+
<InputGroupButton
|
|
297
|
+
variant="destructive"
|
|
298
|
+
size="icon-xs"
|
|
299
|
+
data-slot="checkbox-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="checkbox-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="checkbox 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="checkbox-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="checkbox-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="checkbox 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="checkbox 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>
|