@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";
|
|
@@ -19,11 +20,16 @@ import {
|
|
|
19
20
|
} from "../../../../ui/select";
|
|
20
21
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../../ui/tabs";
|
|
21
22
|
import { Textarea } from "../../../../ui/textarea";
|
|
23
|
+
import { getLocalizedText } from "../../../../../share/locale";
|
|
24
|
+
import {
|
|
25
|
+
useTreeDnd
|
|
26
|
+
} from "../../../../../composables/useTreeDnd";
|
|
22
27
|
import { getStructFieldDescription, getStructFieldTitle } from "../../../schema";
|
|
23
28
|
import { DEFAULT_FIELD_ORIENTATION, FIELD_ORIENTATION_OPTIONS } from "../../../utils/common";
|
|
24
29
|
import { itemSchema, remoteOptionsSchema, schema } from "./schema";
|
|
25
30
|
defineOptions({ name: "ShwfedComboboxSingleFieldConfig" });
|
|
26
31
|
const value = defineModel({ type: null, ...{ required: true } });
|
|
32
|
+
const { locale } = useI18n();
|
|
27
33
|
const fieldSchema = schema(() => {
|
|
28
34
|
});
|
|
29
35
|
const fieldTitle = (f) => getStructFieldTitle(fieldSchema, f) ?? f;
|
|
@@ -121,6 +127,19 @@ const optionKeywordsModel = computed({
|
|
|
121
127
|
const items = computed(
|
|
122
128
|
() => value.value.options.kind === "static" ? value.value.options.items : []
|
|
123
129
|
);
|
|
130
|
+
const expandedIds = ref(/* @__PURE__ */ new Set());
|
|
131
|
+
function isExpanded(id) {
|
|
132
|
+
return expandedIds.value.has(id);
|
|
133
|
+
}
|
|
134
|
+
function toggleExpanded(id) {
|
|
135
|
+
const next = new Set(expandedIds.value);
|
|
136
|
+
if (next.has(id)) next.delete(id);
|
|
137
|
+
else next.add(id);
|
|
138
|
+
expandedIds.value = next;
|
|
139
|
+
}
|
|
140
|
+
function summaryFor(item) {
|
|
141
|
+
return getLocalizedText(item.label, locale.value) || "\u672A\u547D\u540D\u9009\u9879";
|
|
142
|
+
}
|
|
124
143
|
function newId() {
|
|
125
144
|
return typeof crypto !== "undefined" && "randomUUID" in crypto ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
126
145
|
const r = Math.random() * 16 | 0;
|
|
@@ -145,7 +164,9 @@ function patchItem(index, patch) {
|
|
|
145
164
|
}
|
|
146
165
|
function addItem() {
|
|
147
166
|
if (value.value.options.kind !== "static") return;
|
|
148
|
-
|
|
167
|
+
const item = newItem();
|
|
168
|
+
patchStatic({ items: [...value.value.options.items, item] });
|
|
169
|
+
expandedIds.value = new Set(expandedIds.value).add(item.id);
|
|
149
170
|
}
|
|
150
171
|
function removeItem(index) {
|
|
151
172
|
if (value.value.options.kind !== "static") return;
|
|
@@ -153,6 +174,39 @@ function removeItem(index) {
|
|
|
153
174
|
next.splice(index, 1);
|
|
154
175
|
patchStatic({ items: next });
|
|
155
176
|
}
|
|
177
|
+
function moveItem(from, to) {
|
|
178
|
+
if (value.value.options.kind !== "static") return;
|
|
179
|
+
const next = [...value.value.options.items];
|
|
180
|
+
if (from < 0 || to < 0 || from >= next.length || to >= next.length) return;
|
|
181
|
+
const [m] = next.splice(from, 1);
|
|
182
|
+
if (!m) return;
|
|
183
|
+
next.splice(to, 0, m);
|
|
184
|
+
patchStatic({ items: next });
|
|
185
|
+
}
|
|
186
|
+
const ROW_KIND = "combobox-single-option";
|
|
187
|
+
function onRowDrop(e) {
|
|
188
|
+
if (e.source.kind !== ROW_KIND || e.target.kind !== ROW_KIND) return;
|
|
189
|
+
const from = items.value.findIndex((it) => it.id === e.source.id);
|
|
190
|
+
const to = items.value.findIndex((it) => it.id === e.target.id);
|
|
191
|
+
if (from < 0 || to < 0) return;
|
|
192
|
+
if (e.instruction === "reorder-above") moveItem(from, from < to ? to - 1 : to);
|
|
193
|
+
else if (e.instruction === "reorder-below") moveItem(from, from <= to ? to : to + 1);
|
|
194
|
+
}
|
|
195
|
+
const dnd = useTreeDnd({ onRowDrop });
|
|
196
|
+
const pickDragHandle = (el) => el.querySelector(".drag-handle");
|
|
197
|
+
function rowConfig(index) {
|
|
198
|
+
const id = items.value[index]?.id ?? `idx-${index}`;
|
|
199
|
+
return {
|
|
200
|
+
kind: ROW_KIND,
|
|
201
|
+
canDrop: (src) => src.kind === ROW_KIND,
|
|
202
|
+
blockInstructions: (src) => {
|
|
203
|
+
const block = ["make-child", "reparent"];
|
|
204
|
+
if (src.id === id) block.push("reorder-above", "reorder-below");
|
|
205
|
+
return block;
|
|
206
|
+
},
|
|
207
|
+
dragHandle: pickDragHandle
|
|
208
|
+
};
|
|
209
|
+
}
|
|
156
210
|
function setItemKind(index, kind) {
|
|
157
211
|
if (value.value.options.kind !== "static") return;
|
|
158
212
|
const cur = value.value.options.items[index];
|
|
@@ -393,145 +447,178 @@ function setItemKeywords(index, text) {
|
|
|
393
447
|
<div
|
|
394
448
|
v-for="(item, index) in items"
|
|
395
449
|
:key="item.id"
|
|
450
|
+
:ref="dnd.rowRef(item.id, rowConfig(index))"
|
|
396
451
|
data-slot="combobox-single-item"
|
|
397
|
-
class="relative
|
|
452
|
+
class="relative rounded border border-zinc-200 bg-zinc-50/40"
|
|
453
|
+
:data-instruction="dnd.instructionFor(item.id) ?? void 0"
|
|
398
454
|
>
|
|
399
|
-
<
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
455
|
+
<div class="flex items-center gap-2 p-2">
|
|
456
|
+
<Icon
|
|
457
|
+
icon="fluent:re-order-dots-vertical-20-regular"
|
|
458
|
+
class="drag-handle size-4 shrink-0 cursor-grab text-zinc-400"
|
|
459
|
+
data-slot="combobox-single-item-drag-handle"
|
|
460
|
+
/>
|
|
461
|
+
<InputGroupButton
|
|
462
|
+
size="icon-xs"
|
|
463
|
+
class="shrink-0"
|
|
464
|
+
data-slot="combobox-single-item-collapse"
|
|
465
|
+
:aria-expanded="isExpanded(item.id)"
|
|
466
|
+
:aria-label="isExpanded(item.id) ? '\u6298\u53E0' : '\u5C55\u5F00'"
|
|
467
|
+
@click="toggleExpanded(item.id)"
|
|
468
|
+
>
|
|
469
|
+
<Icon
|
|
470
|
+
:icon="isExpanded(item.id) ? 'fluent:chevron-down-20-regular' : 'fluent:chevron-right-20-regular'"
|
|
471
|
+
/>
|
|
472
|
+
</InputGroupButton>
|
|
473
|
+
<div
|
|
474
|
+
class="min-w-0 flex-1 truncate text-sm text-zinc-700"
|
|
475
|
+
data-slot="combobox-single-item-summary"
|
|
476
|
+
>
|
|
477
|
+
{{ summaryFor(item) }}
|
|
478
|
+
</div>
|
|
479
|
+
<InputGroupButton
|
|
480
|
+
variant="destructive"
|
|
481
|
+
size="icon-xs"
|
|
482
|
+
data-slot="combobox-single-item-delete"
|
|
483
|
+
aria-label="删除选项"
|
|
484
|
+
class="shrink-0"
|
|
485
|
+
@click="removeItem(index)"
|
|
486
|
+
>
|
|
487
|
+
<Icon icon="fluent:delete-20-regular" />
|
|
488
|
+
</InputGroupButton>
|
|
489
|
+
</div>
|
|
490
|
+
|
|
491
|
+
<div
|
|
492
|
+
v-show="isExpanded(item.id)"
|
|
493
|
+
class="grid grid-cols-2 gap-3 px-3 pb-3"
|
|
494
|
+
data-slot="combobox-single-item-content"
|
|
406
495
|
>
|
|
407
|
-
<
|
|
408
|
-
|
|
496
|
+
<Field orientation="vertical">
|
|
497
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
498
|
+
<template
|
|
499
|
+
v-if="itemFieldDescription('label')"
|
|
500
|
+
#tooltip
|
|
501
|
+
>
|
|
502
|
+
<Markdown
|
|
503
|
+
:source="itemFieldDescription('label')"
|
|
504
|
+
block
|
|
505
|
+
class="prose prose-sm prose-zinc"
|
|
506
|
+
/>
|
|
507
|
+
</template>
|
|
508
|
+
{{ itemFieldTitle("label") }}
|
|
509
|
+
</FieldLabel>
|
|
510
|
+
<LocaleField
|
|
511
|
+
translate-hint="combobox option label"
|
|
512
|
+
:model-value="item.label"
|
|
513
|
+
@update:model-value="(v) => setItemLabel(index, v)"
|
|
514
|
+
/>
|
|
515
|
+
</Field>
|
|
409
516
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
517
|
+
<Field orientation="vertical">
|
|
518
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
519
|
+
<template
|
|
520
|
+
v-if="itemFieldDescription('value')"
|
|
521
|
+
#tooltip
|
|
522
|
+
>
|
|
523
|
+
<Markdown
|
|
524
|
+
:source="itemFieldDescription('value')"
|
|
525
|
+
block
|
|
526
|
+
class="prose prose-sm prose-zinc"
|
|
527
|
+
/>
|
|
528
|
+
</template>
|
|
529
|
+
{{ itemFieldTitle("value") }}
|
|
530
|
+
</FieldLabel>
|
|
531
|
+
<InputGroup>
|
|
532
|
+
<InputGroupAddon align="inline-start">
|
|
533
|
+
<DropdownMenu>
|
|
534
|
+
<DropdownMenuTrigger as-child>
|
|
535
|
+
<InputGroupButton
|
|
536
|
+
size="icon-sm"
|
|
537
|
+
as-child
|
|
538
|
+
>
|
|
539
|
+
<button
|
|
540
|
+
type="button"
|
|
541
|
+
data-slot="combobox-single-item-kind-trigger"
|
|
542
|
+
class="text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5"
|
|
543
|
+
aria-label="切换值类型"
|
|
544
|
+
>
|
|
545
|
+
<Icon
|
|
546
|
+
:icon="item.value.kind === 'number' ? 'fluent:number-symbol-20-regular' : 'fluent:textbox-20-regular'"
|
|
547
|
+
/>
|
|
548
|
+
</button>
|
|
549
|
+
</InputGroupButton>
|
|
550
|
+
</DropdownMenuTrigger>
|
|
551
|
+
<DropdownMenuContent align="start">
|
|
552
|
+
<DropdownMenuItem @select="setItemKind(index, 'text')">
|
|
553
|
+
<Icon icon="fluent:textbox-20-regular" />
|
|
554
|
+
<span>文本</span>
|
|
555
|
+
</DropdownMenuItem>
|
|
556
|
+
<DropdownMenuItem @select="setItemKind(index, 'number')">
|
|
557
|
+
<Icon icon="fluent:number-symbol-20-regular" />
|
|
558
|
+
<span>数字</span>
|
|
559
|
+
</DropdownMenuItem>
|
|
560
|
+
</DropdownMenuContent>
|
|
561
|
+
</DropdownMenu>
|
|
562
|
+
</InputGroupAddon>
|
|
430
563
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
>
|
|
437
|
-
<Markdown
|
|
438
|
-
:source="itemFieldDescription('value')"
|
|
439
|
-
block
|
|
440
|
-
class="prose prose-sm prose-zinc"
|
|
564
|
+
<InputGroupInput
|
|
565
|
+
v-if="item.value.kind === 'text'"
|
|
566
|
+
:model-value="item.value.value"
|
|
567
|
+
placeholder="例:admin"
|
|
568
|
+
@update:model-value="(v) => setItemTextValue(index, String(v ?? ''))"
|
|
441
569
|
/>
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
<InputGroupButton
|
|
450
|
-
size="icon-sm"
|
|
451
|
-
as-child
|
|
452
|
-
>
|
|
453
|
-
<button
|
|
454
|
-
type="button"
|
|
455
|
-
data-slot="combobox-single-item-kind-trigger"
|
|
456
|
-
class="text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5"
|
|
457
|
-
aria-label="切换值类型"
|
|
458
|
-
>
|
|
459
|
-
<Icon
|
|
460
|
-
:icon="item.value.kind === 'number' ? 'fluent:number-symbol-20-regular' : 'fluent:textbox-20-regular'"
|
|
461
|
-
/>
|
|
462
|
-
</button>
|
|
463
|
-
</InputGroupButton>
|
|
464
|
-
</DropdownMenuTrigger>
|
|
465
|
-
<DropdownMenuContent align="start">
|
|
466
|
-
<DropdownMenuItem @select="setItemKind(index, 'text')">
|
|
467
|
-
<Icon icon="fluent:textbox-20-regular" />
|
|
468
|
-
<span>文本</span>
|
|
469
|
-
</DropdownMenuItem>
|
|
470
|
-
<DropdownMenuItem @select="setItemKind(index, 'number')">
|
|
471
|
-
<Icon icon="fluent:number-symbol-20-regular" />
|
|
472
|
-
<span>数字</span>
|
|
473
|
-
</DropdownMenuItem>
|
|
474
|
-
</DropdownMenuContent>
|
|
475
|
-
</DropdownMenu>
|
|
476
|
-
</InputGroupAddon>
|
|
570
|
+
<InputGroupNumberField
|
|
571
|
+
v-else
|
|
572
|
+
:model-value="item.value.value"
|
|
573
|
+
@update:model-value="(v) => setItemNumberValue(index, v)"
|
|
574
|
+
/>
|
|
575
|
+
</InputGroup>
|
|
576
|
+
</Field>
|
|
477
577
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
578
|
+
<Field orientation="vertical">
|
|
579
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
580
|
+
<template
|
|
581
|
+
v-if="itemFieldDescription('tooltip')"
|
|
582
|
+
#tooltip
|
|
583
|
+
>
|
|
584
|
+
<Markdown
|
|
585
|
+
:source="itemFieldDescription('tooltip')"
|
|
586
|
+
block
|
|
587
|
+
class="prose prose-sm prose-zinc"
|
|
588
|
+
/>
|
|
589
|
+
</template>
|
|
590
|
+
{{ itemFieldTitle("tooltip") }}
|
|
591
|
+
</FieldLabel>
|
|
592
|
+
<LocaleField
|
|
593
|
+
markdown
|
|
594
|
+
translate-hint="combobox option tooltip"
|
|
595
|
+
:model-value="item.tooltip"
|
|
596
|
+
@update:model-value="(v) => setItemTooltip(index, v)"
|
|
483
597
|
/>
|
|
484
|
-
|
|
485
|
-
v-else
|
|
486
|
-
:model-value="item.value.value"
|
|
487
|
-
@update:model-value="(v) => setItemNumberValue(index, v)"
|
|
488
|
-
/>
|
|
489
|
-
</InputGroup>
|
|
490
|
-
</Field>
|
|
491
|
-
|
|
492
|
-
<Field orientation="vertical">
|
|
493
|
-
<FieldLabel class="text-xs text-zinc-500">
|
|
494
|
-
<template
|
|
495
|
-
v-if="itemFieldDescription('tooltip')"
|
|
496
|
-
#tooltip
|
|
497
|
-
>
|
|
498
|
-
<Markdown
|
|
499
|
-
:source="itemFieldDescription('tooltip')"
|
|
500
|
-
block
|
|
501
|
-
class="prose prose-sm prose-zinc"
|
|
502
|
-
/>
|
|
503
|
-
</template>
|
|
504
|
-
{{ itemFieldTitle("tooltip") }}
|
|
505
|
-
</FieldLabel>
|
|
506
|
-
<LocaleField
|
|
507
|
-
markdown
|
|
508
|
-
translate-hint="combobox option tooltip"
|
|
509
|
-
:model-value="item.tooltip"
|
|
510
|
-
@update:model-value="(v) => setItemTooltip(index, v)"
|
|
511
|
-
/>
|
|
512
|
-
</Field>
|
|
598
|
+
</Field>
|
|
513
599
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
600
|
+
<Field orientation="vertical">
|
|
601
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
602
|
+
<template
|
|
603
|
+
v-if="itemFieldDescription('keywords')"
|
|
604
|
+
#tooltip
|
|
605
|
+
>
|
|
606
|
+
<Markdown
|
|
607
|
+
:source="itemFieldDescription('keywords')"
|
|
608
|
+
block
|
|
609
|
+
class="prose prose-sm prose-zinc"
|
|
610
|
+
/>
|
|
611
|
+
</template>
|
|
612
|
+
{{ itemFieldTitle("keywords") }}
|
|
613
|
+
</FieldLabel>
|
|
614
|
+
<Textarea
|
|
615
|
+
data-slot="combobox-single-item-keywords"
|
|
616
|
+
placeholder="每行一个关键词"
|
|
617
|
+
:model-value="keywordsText(item)"
|
|
618
|
+
@update:model-value="(v) => setItemKeywords(index, String(v ?? ''))"
|
|
619
|
+
/>
|
|
620
|
+
</Field>
|
|
621
|
+
</div>
|
|
535
622
|
</div>
|
|
536
623
|
|
|
537
624
|
<Button
|
|
@@ -780,3 +867,7 @@ function setItemKeywords(index, text) {
|
|
|
780
867
|
</Field>
|
|
781
868
|
</div>
|
|
782
869
|
</template>
|
|
870
|
+
|
|
871
|
+
<style scoped>
|
|
872
|
+
[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}
|
|
873
|
+
</style>
|
package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/config.d.vue.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
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 type: "com.shwfed.form.field.tabs";
|
|
8
|
+
readonly style?: string | undefined;
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly displayName?: string | undefined;
|
|
11
|
+
readonly compatibilityDate: "2026-06-20";
|
|
12
|
+
readonly tabs: readonly {
|
|
13
|
+
readonly label: readonly [{
|
|
14
|
+
readonly locale: "zh";
|
|
15
|
+
readonly message: string;
|
|
16
|
+
}, ...{
|
|
17
|
+
readonly locale: "en" | "ja" | "ko";
|
|
18
|
+
readonly message: string;
|
|
19
|
+
}[]];
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly unit: Readonly<{
|
|
22
|
+
fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
|
|
23
|
+
layouts: readonly Readonly<{
|
|
24
|
+
name: string;
|
|
25
|
+
media?: string;
|
|
26
|
+
layout: import("../../../schema.js").LayoutValue;
|
|
27
|
+
}>[];
|
|
28
|
+
}>;
|
|
29
|
+
}[];
|
|
30
|
+
}) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: {
|
|
33
|
+
readonly type: "com.shwfed.form.field.tabs";
|
|
34
|
+
readonly style?: string | undefined;
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly displayName?: string | undefined;
|
|
37
|
+
readonly compatibilityDate: "2026-06-20";
|
|
38
|
+
readonly tabs: readonly {
|
|
39
|
+
readonly label: readonly [{
|
|
40
|
+
readonly locale: "zh";
|
|
41
|
+
readonly message: string;
|
|
42
|
+
}, ...{
|
|
43
|
+
readonly locale: "en" | "ja" | "ko";
|
|
44
|
+
readonly message: string;
|
|
45
|
+
}[]];
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly unit: Readonly<{
|
|
48
|
+
fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
|
|
49
|
+
layouts: readonly Readonly<{
|
|
50
|
+
name: string;
|
|
51
|
+
media?: string;
|
|
52
|
+
layout: import("../../../schema.js").LayoutValue;
|
|
53
|
+
}>[];
|
|
54
|
+
}>;
|
|
55
|
+
}[];
|
|
56
|
+
}) => any) | undefined;
|
|
57
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|