@shwfed/nuxt 0.7.9 → 0.7.11
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/module.json +1 -1
- package/dist/runtime/components/app.d.vue.ts +7 -56
- package/dist/runtime/components/app.vue +17 -404
- package/dist/runtime/components/app.vue.d.ts +7 -56
- package/dist/runtime/components/fields.d.vue.ts +154 -132
- package/dist/runtime/components/fields.vue +30 -295
- package/dist/runtime/components/fields.vue.d.ts +154 -132
- package/dist/runtime/components/table.d.vue.ts +129 -59
- package/dist/runtime/components/table.vue +51 -617
- package/dist/runtime/components/table.vue.d.ts +129 -59
- package/dist/runtime/components/ui/app/App.d.vue.ts +86 -0
- package/dist/runtime/components/ui/app/App.vue +414 -0
- package/dist/runtime/components/ui/app/App.vue.d.ts +86 -0
- package/dist/runtime/components/ui/checkbox/Checkbox.vue +6 -2
- package/dist/runtime/components/ui/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +30 -0
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +87 -0
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +30 -0
- package/dist/runtime/components/ui/expression-editor/index.d.ts +1 -0
- package/dist/runtime/components/ui/expression-editor/index.js +1 -0
- package/dist/runtime/components/ui/field/FieldContent.vue +1 -1
- package/dist/runtime/components/ui/field/FieldError.vue +2 -2
- package/dist/runtime/components/ui/field/FieldLabel.vue +1 -1
- package/dist/runtime/components/ui/fields/Fields.d.vue.ts +376 -0
- package/dist/runtime/components/ui/fields/Fields.vue +441 -0
- package/dist/runtime/components/ui/fields/Fields.vue.d.ts +376 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +163 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +363 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +163 -0
- package/dist/runtime/components/ui/icon-picker/IconPicker.d.vue.ts +15 -0
- package/dist/runtime/components/ui/icon-picker/IconPicker.vue +178 -0
- package/dist/runtime/components/ui/icon-picker/IconPicker.vue.d.ts +15 -0
- package/dist/runtime/components/ui/icon-picker/index.d.ts +1 -0
- package/dist/runtime/components/ui/icon-picker/index.js +1 -0
- package/dist/runtime/components/ui/input/Input.d.vue.ts +1 -0
- package/dist/runtime/components/ui/input/Input.vue +2 -0
- package/dist/runtime/components/ui/input/Input.vue.d.ts +1 -0
- package/dist/runtime/components/ui/input-group/InputGroupAddon.vue +4 -1
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.d.vue.ts +8 -3
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue +8 -3
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue.d.ts +8 -3
- package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.d.vue.ts +8 -1
- package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue +11 -2
- package/dist/runtime/components/ui/input-group/InputGroupComboboxInput.vue.d.ts +8 -1
- package/dist/runtime/components/ui/input-group/InputGroupInput.vue +1 -1
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.d.vue.ts +5 -2
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +10 -4
- package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue.d.ts +5 -2
- package/dist/runtime/components/ui/input-group/InputGroupTextarea.vue +1 -1
- package/dist/runtime/components/ui/input-group/index.js +1 -1
- package/dist/runtime/components/ui/locale/Locale.d.vue.ts +20 -0
- package/dist/runtime/components/ui/locale/Locale.vue +291 -0
- package/dist/runtime/components/ui/locale/Locale.vue.d.ts +20 -0
- package/dist/runtime/components/ui/locale/index.d.ts +1 -0
- package/dist/runtime/components/ui/locale/index.js +1 -0
- package/dist/runtime/components/ui/native-select/NativeSelect.d.vue.ts +2 -2
- package/dist/runtime/components/ui/native-select/NativeSelect.vue +1 -1
- package/dist/runtime/components/ui/native-select/NativeSelect.vue.d.ts +2 -2
- package/dist/runtime/components/ui/native-select/NativeSelectOption.d.vue.ts +1 -0
- package/dist/runtime/components/ui/native-select/NativeSelectOption.vue +4 -1
- package/dist/runtime/components/ui/native-select/NativeSelectOption.vue.d.ts +1 -0
- package/dist/runtime/components/ui/number-field/NumberFieldInput.vue +1 -1
- package/dist/runtime/components/ui/switch/Switch.vue +2 -2
- package/dist/runtime/components/ui/table/Table.d.vue.ts +147 -0
- package/dist/runtime/components/ui/table/Table.vue +952 -0
- package/dist/runtime/components/ui/table/Table.vue.d.ts +147 -0
- package/dist/runtime/components/ui/table/schema.d.ts +151 -0
- package/dist/runtime/components/ui/table/schema.js +142 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.d.vue.ts +128 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +2719 -0
- package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue.d.ts +128 -0
- package/dist/runtime/components/ui/table-configurator/menu.d.ts +37 -0
- package/dist/runtime/components/ui/table-configurator/menu.js +227 -0
- package/dist/runtime/components/ui/tabs/Tabs.d.vue.ts +24 -0
- package/dist/runtime/components/ui/tabs/Tabs.vue +30 -0
- package/dist/runtime/components/ui/tabs/Tabs.vue.d.ts +24 -0
- package/dist/runtime/components/ui/tabs/TabsContent.d.vue.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsContent.vue +23 -0
- package/dist/runtime/components/ui/tabs/TabsContent.vue.d.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsList.d.vue.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsList.vue +25 -0
- package/dist/runtime/components/ui/tabs/TabsList.vue.d.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsTrigger.d.vue.ts +18 -0
- package/dist/runtime/components/ui/tabs/TabsTrigger.vue +27 -0
- package/dist/runtime/components/ui/tabs/TabsTrigger.vue.d.ts +18 -0
- package/dist/runtime/components/ui/tabs/index.d.ts +4 -0
- package/dist/runtime/components/ui/tabs/index.js +4 -0
- package/dist/runtime/components/ui/textarea/Textarea.d.vue.ts +1 -0
- package/dist/runtime/components/ui/textarea/Textarea.vue +4 -2
- package/dist/runtime/components/ui/textarea/Textarea.vue.d.ts +1 -0
- package/dist/runtime/components/ui/toggle/Toggle.d.vue.ts +34 -0
- package/dist/runtime/components/ui/toggle/Toggle.vue +32 -0
- package/dist/runtime/components/ui/toggle/Toggle.vue.d.ts +34 -0
- package/dist/runtime/components/ui/toggle/index.d.ts +7 -0
- package/dist/runtime/components/ui/toggle/index.js +22 -0
- package/dist/runtime/composables/useTableRenderers.d.ts +2 -1
- package/dist/runtime/composables/useTableRenderers.js +2 -1
- package/dist/runtime/plugins/toast/index.d.ts +2 -2
- package/dist/runtime/style.css +1 -1
- package/dist/runtime/table-renderers/builtins.js +328 -137
- package/dist/runtime/table-renderers/registry.d.ts +2 -1
- package/dist/runtime/table-renderers/registry.js +3 -0
- package/dist/runtime/utils/coders.d.ts +29 -2
- package/dist/runtime/utils/coders.js +40 -2
- package/package.json +8 -6
- /package/dist/runtime/components/{logo.d.vue.ts → ui/logo/Logo.d.vue.ts} +0 -0
- /package/dist/runtime/components/{logo.vue → ui/logo/Logo.vue} +0 -0
- /package/dist/runtime/components/{logo.vue.d.ts → ui/logo/Logo.vue.d.ts} +0 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useSortable } from "@vueuse/integrations/useSortable";
|
|
3
|
+
import { Icon } from "@iconify/vue";
|
|
4
|
+
import { computed, nextTick, ref, watch } from "vue";
|
|
5
|
+
import { useI18n } from "vue-i18n";
|
|
6
|
+
import { cn } from "../../../utils/cn";
|
|
7
|
+
import { Button } from "../button";
|
|
8
|
+
import {
|
|
9
|
+
Dialog,
|
|
10
|
+
DialogContent,
|
|
11
|
+
DialogDescription,
|
|
12
|
+
DialogFooter,
|
|
13
|
+
DialogHeader,
|
|
14
|
+
DialogTitle
|
|
15
|
+
} from "../dialog";
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
fields: { type: Array, required: true }
|
|
18
|
+
});
|
|
19
|
+
const emit = defineEmits(["confirm"]);
|
|
20
|
+
const open = defineModel("open", { type: Boolean, ...{
|
|
21
|
+
default: false
|
|
22
|
+
} });
|
|
23
|
+
const { t, locale } = useI18n();
|
|
24
|
+
const selectedItemId = ref("general");
|
|
25
|
+
const draftFields = ref([]);
|
|
26
|
+
const sortableListRef = ref(null);
|
|
27
|
+
const sortableItemIds = ref([]);
|
|
28
|
+
const generalItem = computed(() => ({
|
|
29
|
+
id: "general",
|
|
30
|
+
label: t("general")
|
|
31
|
+
}));
|
|
32
|
+
function getFieldLabel(field) {
|
|
33
|
+
const localizedTitle = field.title.find((item) => item.locale === locale.value && item.message.trim().length > 0);
|
|
34
|
+
return localizedTitle?.message ?? field.path;
|
|
35
|
+
}
|
|
36
|
+
const fieldItems = computed(() => draftFields.value.map((field) => ({
|
|
37
|
+
itemId: field.path,
|
|
38
|
+
label: getFieldLabel(field),
|
|
39
|
+
path: field.path
|
|
40
|
+
})));
|
|
41
|
+
const selectedField = computed(() => draftFields.value.find((field) => field.path === selectedItemId.value));
|
|
42
|
+
const selectedItemLabel = computed(() => selectedField.value ? getFieldLabel(selectedField.value) : generalItem.value.label);
|
|
43
|
+
function cloneFields(fields) {
|
|
44
|
+
return fields.slice();
|
|
45
|
+
}
|
|
46
|
+
function resetDraftFields() {
|
|
47
|
+
draftFields.value = cloneFields(props.fields);
|
|
48
|
+
selectedItemId.value = "general";
|
|
49
|
+
}
|
|
50
|
+
watch(() => props.fields, (fields) => {
|
|
51
|
+
if (!open.value) {
|
|
52
|
+
draftFields.value = cloneFields(fields);
|
|
53
|
+
selectedItemId.value = "general";
|
|
54
|
+
}
|
|
55
|
+
}, { immediate: true });
|
|
56
|
+
const sortable = useSortable(sortableListRef, sortableItemIds);
|
|
57
|
+
function syncSortableItemIds() {
|
|
58
|
+
sortableItemIds.value = draftFields.value.map((field) => field.path);
|
|
59
|
+
}
|
|
60
|
+
function moveField(fields, oldIndex, newIndex) {
|
|
61
|
+
if (oldIndex < 0 || newIndex < 0 || oldIndex >= fields.length || newIndex >= fields.length) {
|
|
62
|
+
return fields.slice();
|
|
63
|
+
}
|
|
64
|
+
const nextFields = fields.slice();
|
|
65
|
+
const movedField = nextFields[oldIndex];
|
|
66
|
+
if (!movedField) {
|
|
67
|
+
return fields.slice();
|
|
68
|
+
}
|
|
69
|
+
nextFields.splice(oldIndex, 1);
|
|
70
|
+
nextFields.splice(newIndex, 0, movedField);
|
|
71
|
+
return nextFields;
|
|
72
|
+
}
|
|
73
|
+
function handleSortableUpdate(event) {
|
|
74
|
+
const oldIndex = event.oldIndex;
|
|
75
|
+
const newIndex = event.newIndex;
|
|
76
|
+
if (oldIndex === void 0 || newIndex === void 0 || oldIndex === newIndex) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
draftFields.value = moveField(draftFields.value, oldIndex, newIndex);
|
|
80
|
+
}
|
|
81
|
+
function configureSortable() {
|
|
82
|
+
sortable.option("animation", 150);
|
|
83
|
+
sortable.option("handle", '[data-slot="fields-configurator-drag-handle"]');
|
|
84
|
+
sortable.option("onUpdate", handleSortableUpdate);
|
|
85
|
+
}
|
|
86
|
+
async function refreshSortable() {
|
|
87
|
+
sortable.stop();
|
|
88
|
+
if (!open.value || draftFields.value.length === 0) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
await nextTick();
|
|
92
|
+
sortable.start();
|
|
93
|
+
configureSortable();
|
|
94
|
+
}
|
|
95
|
+
watch(draftFields, () => {
|
|
96
|
+
syncSortableItemIds();
|
|
97
|
+
}, { immediate: true });
|
|
98
|
+
watch(open, async (value) => {
|
|
99
|
+
if (value) {
|
|
100
|
+
resetDraftFields();
|
|
101
|
+
await refreshSortable();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
sortable.stop();
|
|
105
|
+
}, { immediate: true });
|
|
106
|
+
watch(fieldItems, async (items) => {
|
|
107
|
+
if (selectedItemId.value === "general") {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (!items.some((item) => item.itemId === selectedItemId.value)) {
|
|
111
|
+
selectedItemId.value = "general";
|
|
112
|
+
}
|
|
113
|
+
if (open.value) {
|
|
114
|
+
await refreshSortable();
|
|
115
|
+
}
|
|
116
|
+
}, { immediate: true });
|
|
117
|
+
function discardChanges() {
|
|
118
|
+
resetDraftFields();
|
|
119
|
+
open.value = false;
|
|
120
|
+
}
|
|
121
|
+
function handleOpenChange(value) {
|
|
122
|
+
if (value) {
|
|
123
|
+
open.value = true;
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
discardChanges();
|
|
127
|
+
}
|
|
128
|
+
function selectGeneral() {
|
|
129
|
+
selectedItemId.value = "general";
|
|
130
|
+
}
|
|
131
|
+
function selectItem(itemId) {
|
|
132
|
+
selectedItemId.value = itemId;
|
|
133
|
+
}
|
|
134
|
+
function deleteField(itemId) {
|
|
135
|
+
const deleteIndex = draftFields.value.findIndex((field) => field.path === itemId);
|
|
136
|
+
if (deleteIndex < 0) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const nextFields = draftFields.value.filter((field) => field.path !== itemId);
|
|
140
|
+
draftFields.value = nextFields;
|
|
141
|
+
if (selectedItemId.value !== itemId) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const nextField = nextFields[deleteIndex] ?? nextFields[deleteIndex - 1];
|
|
145
|
+
selectedItemId.value = nextField?.path ?? "general";
|
|
146
|
+
}
|
|
147
|
+
function confirmChanges() {
|
|
148
|
+
emit("confirm", draftFields.value.slice());
|
|
149
|
+
open.value = false;
|
|
150
|
+
}
|
|
151
|
+
</script>
|
|
152
|
+
|
|
153
|
+
<template>
|
|
154
|
+
<Dialog
|
|
155
|
+
:open="open"
|
|
156
|
+
@update:open="handleOpenChange"
|
|
157
|
+
>
|
|
158
|
+
<DialogContent
|
|
159
|
+
class="flex h-[min(42rem,calc(100vh-4rem))] w-[calc(100%-2rem)] max-h-[calc(100vh-4rem)] max-w-[calc(100%-2rem)] flex-col overflow-hidden p-0 sm:w-[80vw] sm:max-w-[80vw]"
|
|
160
|
+
:show-close-button="true"
|
|
161
|
+
>
|
|
162
|
+
<DialogHeader class="gap-1 border-b border-zinc-200 px-6 py-5">
|
|
163
|
+
<DialogTitle class="text-xl font-semibold text-zinc-800">
|
|
164
|
+
{{ t("configure-fields") }}
|
|
165
|
+
</DialogTitle>
|
|
166
|
+
<DialogDescription class="text-sm text-zinc-500">
|
|
167
|
+
{{ t("configure-fields-description") }}
|
|
168
|
+
</DialogDescription>
|
|
169
|
+
</DialogHeader>
|
|
170
|
+
|
|
171
|
+
<div class="grid min-h-0 flex-1 grid-cols-[19rem_minmax(0,1fr)]">
|
|
172
|
+
<section class="flex min-h-0 flex-col border-r border-zinc-200 px-4 py-4">
|
|
173
|
+
<div class="flex min-h-0 flex-1 flex-col overflow-hidden">
|
|
174
|
+
<div class="flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto pr-1">
|
|
175
|
+
<button
|
|
176
|
+
type="button"
|
|
177
|
+
data-slot="fields-configurator-item"
|
|
178
|
+
data-item-id="general"
|
|
179
|
+
:data-selected="selectedItemId === 'general' ? 'true' : 'false'"
|
|
180
|
+
:class="cn(
|
|
181
|
+
'flex w-full items-center rounded-md border p-1 text-left transition-colors',
|
|
182
|
+
selectedItemId === 'general' ? 'border-(--primary)/25 bg-[color-mix(in_srgb,var(--primary)_10%,white)]' : 'border-transparent hover:border-zinc-200 hover:bg-zinc-50'
|
|
183
|
+
)"
|
|
184
|
+
@click="selectGeneral"
|
|
185
|
+
>
|
|
186
|
+
<span
|
|
187
|
+
data-slot="fields-configurator-item-label"
|
|
188
|
+
class="truncate px-2 py-2 text-sm font-medium text-zinc-800"
|
|
189
|
+
>
|
|
190
|
+
{{ generalItem.label }}
|
|
191
|
+
</span>
|
|
192
|
+
</button>
|
|
193
|
+
|
|
194
|
+
<div
|
|
195
|
+
v-if="fieldItems.length > 0"
|
|
196
|
+
ref="sortableListRef"
|
|
197
|
+
data-slot="fields-configurator-list"
|
|
198
|
+
class="flex flex-col gap-1"
|
|
199
|
+
>
|
|
200
|
+
<div
|
|
201
|
+
v-for="item in fieldItems"
|
|
202
|
+
:key="item.itemId"
|
|
203
|
+
data-slot="fields-configurator-field-item"
|
|
204
|
+
:data-item-id="item.itemId"
|
|
205
|
+
:data-selected="selectedItemId === item.itemId ? 'true' : 'false'"
|
|
206
|
+
:class="cn(
|
|
207
|
+
'flex w-full items-center gap-2 rounded-md border p-1 transition-colors',
|
|
208
|
+
selectedItemId === item.itemId ? 'border-(--primary)/25 bg-[color-mix(in_srgb,var(--primary)_10%,white)]' : 'border-transparent hover:border-zinc-200 hover:bg-zinc-50'
|
|
209
|
+
)"
|
|
210
|
+
>
|
|
211
|
+
<button
|
|
212
|
+
type="button"
|
|
213
|
+
data-slot="fields-configurator-drag-handle"
|
|
214
|
+
class="flex size-8 shrink-0 cursor-grab items-center justify-center rounded-sm text-zinc-400 active:cursor-grabbing"
|
|
215
|
+
:aria-label="t('drag-field', { field: item.label })"
|
|
216
|
+
@click.stop
|
|
217
|
+
>
|
|
218
|
+
<Icon icon="fluent:re-order-dots-vertical-20-regular" />
|
|
219
|
+
</button>
|
|
220
|
+
|
|
221
|
+
<button
|
|
222
|
+
type="button"
|
|
223
|
+
data-slot="fields-configurator-item-select"
|
|
224
|
+
class="min-w-0 flex-1 px-2 py-2 text-left"
|
|
225
|
+
@click="selectItem(item.itemId)"
|
|
226
|
+
>
|
|
227
|
+
<span
|
|
228
|
+
data-slot="fields-configurator-field-label"
|
|
229
|
+
class="block truncate text-sm font-medium text-zinc-800"
|
|
230
|
+
>
|
|
231
|
+
{{ item.label }}
|
|
232
|
+
</span>
|
|
233
|
+
<span
|
|
234
|
+
data-slot="fields-configurator-field-path"
|
|
235
|
+
class="block truncate text-xs text-zinc-400"
|
|
236
|
+
>
|
|
237
|
+
{{ item.path }}
|
|
238
|
+
</span>
|
|
239
|
+
</button>
|
|
240
|
+
|
|
241
|
+
<button
|
|
242
|
+
type="button"
|
|
243
|
+
data-slot="fields-configurator-delete"
|
|
244
|
+
class="flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-sm text-zinc-400 transition-colors hover:bg-red-50 hover:text-red-600"
|
|
245
|
+
:aria-label="t('delete-field', { field: item.label })"
|
|
246
|
+
@click.stop="deleteField(item.itemId)"
|
|
247
|
+
>
|
|
248
|
+
<Icon icon="fluent:delete-20-regular" />
|
|
249
|
+
</button>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
<p
|
|
254
|
+
v-else
|
|
255
|
+
data-slot="fields-configurator-empty"
|
|
256
|
+
class="px-1 pt-2 text-xs text-zinc-400"
|
|
257
|
+
>
|
|
258
|
+
{{ t("no-fields") }}
|
|
259
|
+
</p>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</section>
|
|
263
|
+
|
|
264
|
+
<section class="flex min-h-0 flex-col overflow-y-auto px-6 py-6">
|
|
265
|
+
<h3
|
|
266
|
+
data-slot="fields-configurator-detail-title"
|
|
267
|
+
class="text-lg font-semibold text-zinc-800"
|
|
268
|
+
>
|
|
269
|
+
{{ selectedItemLabel }}
|
|
270
|
+
</h3>
|
|
271
|
+
<p
|
|
272
|
+
v-if="selectedItemId === 'general'"
|
|
273
|
+
data-slot="fields-configurator-detail-description"
|
|
274
|
+
class="mt-2 text-sm text-zinc-500"
|
|
275
|
+
>
|
|
276
|
+
{{ t("general-placeholder") }}
|
|
277
|
+
</p>
|
|
278
|
+
|
|
279
|
+
<div
|
|
280
|
+
v-if="selectedItemId === 'general'"
|
|
281
|
+
data-slot="fields-configurator-general-placeholder"
|
|
282
|
+
class="mt-6 flex min-h-48 items-center justify-center rounded-lg border border-dashed border-zinc-200 bg-zinc-50/60 px-6 text-center text-sm text-zinc-400"
|
|
283
|
+
>
|
|
284
|
+
{{ t("general-empty") }}
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
<div
|
|
288
|
+
v-else-if="selectedField"
|
|
289
|
+
data-slot="fields-configurator-field-placeholder"
|
|
290
|
+
class="mt-6 flex min-h-48 items-center justify-center rounded-lg border border-dashed border-zinc-200 bg-zinc-50/60 px-6 text-center text-sm text-zinc-400"
|
|
291
|
+
>
|
|
292
|
+
{{ t("field-placeholder", { field: selectedItemLabel }) }}
|
|
293
|
+
</div>
|
|
294
|
+
</section>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
<DialogFooter class="border-t border-zinc-200 px-6 py-4">
|
|
298
|
+
<Button
|
|
299
|
+
type="button"
|
|
300
|
+
data-slot="fields-configurator-cancel"
|
|
301
|
+
variant="default"
|
|
302
|
+
@click="discardChanges"
|
|
303
|
+
>
|
|
304
|
+
<Icon icon="fluent:dismiss-20-regular" />
|
|
305
|
+
{{ t("cancel") }}
|
|
306
|
+
</Button>
|
|
307
|
+
<Button
|
|
308
|
+
type="button"
|
|
309
|
+
data-slot="fields-configurator-confirm"
|
|
310
|
+
variant="primary"
|
|
311
|
+
@click="confirmChanges"
|
|
312
|
+
>
|
|
313
|
+
<Icon icon="fluent:checkmark-20-regular" />
|
|
314
|
+
{{ t("confirm") }}
|
|
315
|
+
</Button>
|
|
316
|
+
</DialogFooter>
|
|
317
|
+
</DialogContent>
|
|
318
|
+
</Dialog>
|
|
319
|
+
</template>
|
|
320
|
+
|
|
321
|
+
<i18n lang="json">
|
|
322
|
+
{
|
|
323
|
+
"zh": {
|
|
324
|
+
"configure-fields": "配置字段",
|
|
325
|
+
"configure-fields-description": "在这里浏览通用项和字段配置项。",
|
|
326
|
+
"general": "通用",
|
|
327
|
+
"general-placeholder": "这里会放置字段集合的通用配置。",
|
|
328
|
+
"general-empty": "通用配置区域预留中。",
|
|
329
|
+
"field-placeholder": "字段“{field}”的配置区域预留中。",
|
|
330
|
+
"no-fields": "还没有字段。",
|
|
331
|
+
"drag-field": "拖拽调整字段顺序:{field}",
|
|
332
|
+
"delete-field": "删除字段:{field}",
|
|
333
|
+
"cancel": "取消",
|
|
334
|
+
"confirm": "确认"
|
|
335
|
+
},
|
|
336
|
+
"ja": {
|
|
337
|
+
"configure-fields": "フィールドを設定",
|
|
338
|
+
"configure-fields-description": "共通項目とフィールド設定をここで確認できます。",
|
|
339
|
+
"general": "共通",
|
|
340
|
+
"general-placeholder": "ここにはフィールド群の共通設定を配置します。",
|
|
341
|
+
"general-empty": "共通設定エリアはまだ準備中です。",
|
|
342
|
+
"field-placeholder": "フィールド「{field}」の設定エリアはまだ準備中です。",
|
|
343
|
+
"no-fields": "フィールドがありません。",
|
|
344
|
+
"drag-field": "{field} の順序をドラッグで変更",
|
|
345
|
+
"delete-field": "{field} を削除",
|
|
346
|
+
"cancel": "キャンセル",
|
|
347
|
+
"confirm": "確認"
|
|
348
|
+
},
|
|
349
|
+
"en": {
|
|
350
|
+
"configure-fields": "Configure Fields",
|
|
351
|
+
"configure-fields-description": "Browse the shared and field-level settings here.",
|
|
352
|
+
"general": "General",
|
|
353
|
+
"general-placeholder": "Shared settings for this field group will live here.",
|
|
354
|
+
"general-empty": "The shared settings area is reserved for now.",
|
|
355
|
+
"field-placeholder": "The configuration area for \"{field}\" is reserved for now.",
|
|
356
|
+
"no-fields": "No fields yet.",
|
|
357
|
+
"drag-field": "Drag to reorder field {field}",
|
|
358
|
+
"delete-field": "Delete field {field}",
|
|
359
|
+
"cancel": "Cancel",
|
|
360
|
+
"confirm": "Confirm"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
</i18n>
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { Field } from '../fields/Fields.vue.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
fields: ReadonlyArray<Field>;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_ModelProps = {
|
|
6
|
+
'open'?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:open": (value: boolean) => any;
|
|
11
|
+
confirm: (args_0: readonly ({
|
|
12
|
+
type: "string";
|
|
13
|
+
path: string;
|
|
14
|
+
title: readonly {
|
|
15
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
16
|
+
message: string;
|
|
17
|
+
}[];
|
|
18
|
+
icon?: string | undefined;
|
|
19
|
+
style?: string | undefined;
|
|
20
|
+
discardEmptyString?: boolean | undefined;
|
|
21
|
+
maxLength?: string | undefined;
|
|
22
|
+
hidden?: string | undefined;
|
|
23
|
+
disabled?: string | undefined;
|
|
24
|
+
validation?: readonly Readonly<{
|
|
25
|
+
expression: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}>[] | undefined;
|
|
28
|
+
} | {
|
|
29
|
+
type: "number";
|
|
30
|
+
path: string;
|
|
31
|
+
title: readonly {
|
|
32
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
33
|
+
message: string;
|
|
34
|
+
}[];
|
|
35
|
+
icon?: string | undefined;
|
|
36
|
+
style?: string | undefined;
|
|
37
|
+
min?: string | undefined;
|
|
38
|
+
max?: string | undefined;
|
|
39
|
+
step?: string | undefined;
|
|
40
|
+
hidden?: string | undefined;
|
|
41
|
+
disabled?: string | undefined;
|
|
42
|
+
validation?: readonly Readonly<{
|
|
43
|
+
expression: string;
|
|
44
|
+
message: string;
|
|
45
|
+
}>[] | undefined;
|
|
46
|
+
} | {
|
|
47
|
+
type: "select";
|
|
48
|
+
path: string;
|
|
49
|
+
title: readonly {
|
|
50
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
51
|
+
message: string;
|
|
52
|
+
}[];
|
|
53
|
+
options: string;
|
|
54
|
+
label: string;
|
|
55
|
+
value: string;
|
|
56
|
+
key: string;
|
|
57
|
+
icon?: string | undefined;
|
|
58
|
+
style?: string | undefined;
|
|
59
|
+
hidden?: string | undefined;
|
|
60
|
+
disabled?: string | undefined;
|
|
61
|
+
validation?: readonly Readonly<{
|
|
62
|
+
expression: string;
|
|
63
|
+
message: string;
|
|
64
|
+
}>[] | undefined;
|
|
65
|
+
} | {
|
|
66
|
+
type: "calendar";
|
|
67
|
+
path: string;
|
|
68
|
+
title: readonly {
|
|
69
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
70
|
+
message: string;
|
|
71
|
+
}[];
|
|
72
|
+
mode: "year" | "month" | "date";
|
|
73
|
+
value: string;
|
|
74
|
+
icon?: string | undefined;
|
|
75
|
+
style?: string | undefined;
|
|
76
|
+
display?: string | undefined;
|
|
77
|
+
disableDate?: string | undefined;
|
|
78
|
+
hidden?: string | undefined;
|
|
79
|
+
disabled?: string | undefined;
|
|
80
|
+
validation?: readonly Readonly<{
|
|
81
|
+
expression: string;
|
|
82
|
+
message: string;
|
|
83
|
+
}>[] | undefined;
|
|
84
|
+
})[]) => any;
|
|
85
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
86
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
87
|
+
onConfirm?: ((args_0: readonly ({
|
|
88
|
+
type: "string";
|
|
89
|
+
path: string;
|
|
90
|
+
title: readonly {
|
|
91
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
92
|
+
message: string;
|
|
93
|
+
}[];
|
|
94
|
+
icon?: string | undefined;
|
|
95
|
+
style?: string | undefined;
|
|
96
|
+
discardEmptyString?: boolean | undefined;
|
|
97
|
+
maxLength?: string | undefined;
|
|
98
|
+
hidden?: string | undefined;
|
|
99
|
+
disabled?: string | undefined;
|
|
100
|
+
validation?: readonly Readonly<{
|
|
101
|
+
expression: string;
|
|
102
|
+
message: string;
|
|
103
|
+
}>[] | undefined;
|
|
104
|
+
} | {
|
|
105
|
+
type: "number";
|
|
106
|
+
path: string;
|
|
107
|
+
title: readonly {
|
|
108
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
109
|
+
message: string;
|
|
110
|
+
}[];
|
|
111
|
+
icon?: string | undefined;
|
|
112
|
+
style?: string | undefined;
|
|
113
|
+
min?: string | undefined;
|
|
114
|
+
max?: string | undefined;
|
|
115
|
+
step?: string | undefined;
|
|
116
|
+
hidden?: string | undefined;
|
|
117
|
+
disabled?: string | undefined;
|
|
118
|
+
validation?: readonly Readonly<{
|
|
119
|
+
expression: string;
|
|
120
|
+
message: string;
|
|
121
|
+
}>[] | undefined;
|
|
122
|
+
} | {
|
|
123
|
+
type: "select";
|
|
124
|
+
path: string;
|
|
125
|
+
title: readonly {
|
|
126
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
127
|
+
message: string;
|
|
128
|
+
}[];
|
|
129
|
+
options: string;
|
|
130
|
+
label: string;
|
|
131
|
+
value: string;
|
|
132
|
+
key: string;
|
|
133
|
+
icon?: string | undefined;
|
|
134
|
+
style?: string | undefined;
|
|
135
|
+
hidden?: string | undefined;
|
|
136
|
+
disabled?: string | undefined;
|
|
137
|
+
validation?: readonly Readonly<{
|
|
138
|
+
expression: string;
|
|
139
|
+
message: string;
|
|
140
|
+
}>[] | undefined;
|
|
141
|
+
} | {
|
|
142
|
+
type: "calendar";
|
|
143
|
+
path: string;
|
|
144
|
+
title: readonly {
|
|
145
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
146
|
+
message: string;
|
|
147
|
+
}[];
|
|
148
|
+
mode: "year" | "month" | "date";
|
|
149
|
+
value: string;
|
|
150
|
+
icon?: string | undefined;
|
|
151
|
+
style?: string | undefined;
|
|
152
|
+
display?: string | undefined;
|
|
153
|
+
disableDate?: string | undefined;
|
|
154
|
+
hidden?: string | undefined;
|
|
155
|
+
disabled?: string | undefined;
|
|
156
|
+
validation?: readonly Readonly<{
|
|
157
|
+
expression: string;
|
|
158
|
+
message: string;
|
|
159
|
+
}>[] | undefined;
|
|
160
|
+
})[]) => any) | undefined;
|
|
161
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
162
|
+
declare const _default: typeof __VLS_export;
|
|
163
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
class?: HTMLAttributes['class'];
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:modelValue": (args_0: string | undefined) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:modelValue"?: ((args_0: string | undefined) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|