@shwfed/nuxt 0.8.2 → 0.9.0
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/fields.d.vue.ts +161 -158
- package/dist/runtime/components/fields.vue +12 -7
- package/dist/runtime/components/fields.vue.d.ts +161 -158
- package/dist/runtime/components/ui/fields/Fields.d.vue.ts +311 -159
- package/dist/runtime/components/ui/fields/Fields.vue +32 -20
- package/dist/runtime/components/ui/fields/Fields.vue.d.ts +311 -159
- package/dist/runtime/components/ui/fields/schema.d.ts +111 -0
- package/dist/runtime/components/ui/fields/schema.js +5 -0
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +156 -150
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +64 -21
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +156 -150
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type FieldsConfig } from '../fields/schema.js';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
|
|
3
|
+
config: FieldsConfig;
|
|
4
4
|
};
|
|
5
5
|
type __VLS_ModelProps = {
|
|
6
6
|
'open'?: boolean;
|
|
@@ -8,156 +8,162 @@ type __VLS_ModelProps = {
|
|
|
8
8
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
10
|
"update:open": (value: boolean) => any;
|
|
11
|
-
confirm: (args_0:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
11
|
+
confirm: (args_0: Readonly<{
|
|
12
|
+
orientation: "vertical" | "horizontal" | "floating";
|
|
13
|
+
fields: readonly ({
|
|
14
|
+
type: "string";
|
|
15
|
+
path: string;
|
|
16
|
+
title: readonly {
|
|
17
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
18
|
+
message: string;
|
|
19
|
+
}[];
|
|
20
|
+
icon?: string | undefined;
|
|
21
|
+
style?: string | undefined;
|
|
22
|
+
discardEmptyString?: boolean | undefined;
|
|
23
|
+
maxLength?: string | undefined;
|
|
24
|
+
hidden?: string | undefined;
|
|
25
|
+
disabled?: string | undefined;
|
|
26
|
+
validation?: readonly Readonly<{
|
|
27
|
+
expression: string;
|
|
28
|
+
message: string;
|
|
29
|
+
}>[] | undefined;
|
|
30
|
+
} | {
|
|
31
|
+
type: "number";
|
|
32
|
+
path: string;
|
|
33
|
+
title: readonly {
|
|
34
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
35
|
+
message: string;
|
|
36
|
+
}[];
|
|
37
|
+
icon?: string | undefined;
|
|
38
|
+
style?: string | undefined;
|
|
39
|
+
min?: string | undefined;
|
|
40
|
+
max?: string | undefined;
|
|
41
|
+
step?: string | undefined;
|
|
42
|
+
hidden?: string | undefined;
|
|
43
|
+
disabled?: string | undefined;
|
|
44
|
+
validation?: readonly Readonly<{
|
|
45
|
+
expression: string;
|
|
46
|
+
message: string;
|
|
47
|
+
}>[] | undefined;
|
|
48
|
+
} | {
|
|
49
|
+
type: "select";
|
|
50
|
+
path: string;
|
|
51
|
+
title: readonly {
|
|
52
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
53
|
+
message: string;
|
|
54
|
+
}[];
|
|
55
|
+
options: string;
|
|
56
|
+
label: string;
|
|
57
|
+
value: string;
|
|
58
|
+
key: string;
|
|
59
|
+
icon?: string | undefined;
|
|
60
|
+
style?: string | undefined;
|
|
61
|
+
hidden?: string | undefined;
|
|
62
|
+
disabled?: string | undefined;
|
|
63
|
+
validation?: readonly Readonly<{
|
|
64
|
+
expression: string;
|
|
65
|
+
message: string;
|
|
66
|
+
}>[] | undefined;
|
|
67
|
+
} | {
|
|
68
|
+
type: "calendar";
|
|
69
|
+
path: string;
|
|
70
|
+
title: readonly {
|
|
71
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
72
|
+
message: string;
|
|
73
|
+
}[];
|
|
74
|
+
mode: "date" | "month" | "year";
|
|
75
|
+
value: string;
|
|
76
|
+
icon?: string | undefined;
|
|
77
|
+
style?: string | undefined;
|
|
78
|
+
display?: string | undefined;
|
|
79
|
+
disableDate?: string | undefined;
|
|
80
|
+
hidden?: string | undefined;
|
|
81
|
+
disabled?: string | undefined;
|
|
82
|
+
validation?: readonly Readonly<{
|
|
83
|
+
expression: string;
|
|
84
|
+
message: string;
|
|
85
|
+
}>[] | undefined;
|
|
86
|
+
})[];
|
|
87
|
+
}>) => any;
|
|
85
88
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
86
89
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
87
|
-
onConfirm?: ((args_0:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
90
|
+
onConfirm?: ((args_0: Readonly<{
|
|
91
|
+
orientation: "vertical" | "horizontal" | "floating";
|
|
92
|
+
fields: readonly ({
|
|
93
|
+
type: "string";
|
|
94
|
+
path: string;
|
|
95
|
+
title: readonly {
|
|
96
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
97
|
+
message: string;
|
|
98
|
+
}[];
|
|
99
|
+
icon?: string | undefined;
|
|
100
|
+
style?: string | undefined;
|
|
101
|
+
discardEmptyString?: boolean | undefined;
|
|
102
|
+
maxLength?: string | undefined;
|
|
103
|
+
hidden?: string | undefined;
|
|
104
|
+
disabled?: string | undefined;
|
|
105
|
+
validation?: readonly Readonly<{
|
|
106
|
+
expression: string;
|
|
107
|
+
message: string;
|
|
108
|
+
}>[] | undefined;
|
|
109
|
+
} | {
|
|
110
|
+
type: "number";
|
|
111
|
+
path: string;
|
|
112
|
+
title: readonly {
|
|
113
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
114
|
+
message: string;
|
|
115
|
+
}[];
|
|
116
|
+
icon?: string | undefined;
|
|
117
|
+
style?: string | undefined;
|
|
118
|
+
min?: string | undefined;
|
|
119
|
+
max?: string | undefined;
|
|
120
|
+
step?: string | undefined;
|
|
121
|
+
hidden?: string | undefined;
|
|
122
|
+
disabled?: string | undefined;
|
|
123
|
+
validation?: readonly Readonly<{
|
|
124
|
+
expression: string;
|
|
125
|
+
message: string;
|
|
126
|
+
}>[] | undefined;
|
|
127
|
+
} | {
|
|
128
|
+
type: "select";
|
|
129
|
+
path: string;
|
|
130
|
+
title: readonly {
|
|
131
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
132
|
+
message: string;
|
|
133
|
+
}[];
|
|
134
|
+
options: string;
|
|
135
|
+
label: string;
|
|
136
|
+
value: string;
|
|
137
|
+
key: string;
|
|
138
|
+
icon?: string | undefined;
|
|
139
|
+
style?: string | undefined;
|
|
140
|
+
hidden?: string | undefined;
|
|
141
|
+
disabled?: string | undefined;
|
|
142
|
+
validation?: readonly Readonly<{
|
|
143
|
+
expression: string;
|
|
144
|
+
message: string;
|
|
145
|
+
}>[] | undefined;
|
|
146
|
+
} | {
|
|
147
|
+
type: "calendar";
|
|
148
|
+
path: string;
|
|
149
|
+
title: readonly {
|
|
150
|
+
locale: "zh" | "ja" | "en" | "ko";
|
|
151
|
+
message: string;
|
|
152
|
+
}[];
|
|
153
|
+
mode: "date" | "month" | "year";
|
|
154
|
+
value: string;
|
|
155
|
+
icon?: string | undefined;
|
|
156
|
+
style?: string | undefined;
|
|
157
|
+
display?: string | undefined;
|
|
158
|
+
disableDate?: string | undefined;
|
|
159
|
+
hidden?: string | undefined;
|
|
160
|
+
disabled?: string | undefined;
|
|
161
|
+
validation?: readonly Readonly<{
|
|
162
|
+
expression: string;
|
|
163
|
+
message: string;
|
|
164
|
+
}>[] | undefined;
|
|
165
|
+
})[];
|
|
166
|
+
}>) => any) | undefined;
|
|
161
167
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
162
168
|
declare const _default: typeof __VLS_export;
|
|
163
169
|
export default _default;
|
|
@@ -32,13 +32,14 @@ import { NativeSelect, NativeSelectOption } from "../native-select";
|
|
|
32
32
|
import { Switch } from "../switch";
|
|
33
33
|
import { Textarea } from "../textarea";
|
|
34
34
|
const props = defineProps({
|
|
35
|
-
|
|
35
|
+
config: { type: null, required: true }
|
|
36
36
|
});
|
|
37
37
|
const emit = defineEmits(["confirm"]);
|
|
38
38
|
const open = defineModel("open", { type: Boolean, ...{
|
|
39
39
|
default: false
|
|
40
40
|
} });
|
|
41
41
|
const { t } = useI18n();
|
|
42
|
+
const draftOrientation = ref("horizontal");
|
|
42
43
|
const selectedItemId = ref("general");
|
|
43
44
|
const draftFields = ref([]);
|
|
44
45
|
const sortableListRef = ref(null);
|
|
@@ -71,6 +72,12 @@ function createDraftField(field) {
|
|
|
71
72
|
function cloneFields(fields) {
|
|
72
73
|
return fields.map(createDraftField);
|
|
73
74
|
}
|
|
75
|
+
function normalizeOrientation(value) {
|
|
76
|
+
if (value === "vertical" || value === "floating") {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
return "horizontal";
|
|
80
|
+
}
|
|
74
81
|
function getFieldTypeLabel(type) {
|
|
75
82
|
return t(`field-type-${type}`);
|
|
76
83
|
}
|
|
@@ -239,8 +246,9 @@ function createField(type) {
|
|
|
239
246
|
};
|
|
240
247
|
}
|
|
241
248
|
}
|
|
242
|
-
function
|
|
243
|
-
|
|
249
|
+
function resetDraftConfig() {
|
|
250
|
+
draftOrientation.value = props.config.orientation;
|
|
251
|
+
draftFields.value = cloneFields(props.config.fields);
|
|
244
252
|
selectedItemId.value = "general";
|
|
245
253
|
validationErrors.value = {};
|
|
246
254
|
}
|
|
@@ -282,11 +290,9 @@ async function refreshSortable() {
|
|
|
282
290
|
sortable.start();
|
|
283
291
|
configureSortable();
|
|
284
292
|
}
|
|
285
|
-
watch(() => props.
|
|
293
|
+
watch(() => props.config, () => {
|
|
286
294
|
if (!open.value) {
|
|
287
|
-
|
|
288
|
-
selectedItemId.value = "general";
|
|
289
|
-
validationErrors.value = {};
|
|
295
|
+
resetDraftConfig();
|
|
290
296
|
}
|
|
291
297
|
}, { immediate: true });
|
|
292
298
|
watch(draftFields, () => {
|
|
@@ -294,7 +300,7 @@ watch(draftFields, () => {
|
|
|
294
300
|
}, { immediate: true });
|
|
295
301
|
watch(open, async (value) => {
|
|
296
302
|
if (value) {
|
|
297
|
-
|
|
303
|
+
resetDraftConfig();
|
|
298
304
|
await refreshSortable();
|
|
299
305
|
return;
|
|
300
306
|
}
|
|
@@ -313,7 +319,7 @@ watch(fieldItems, async (items) => {
|
|
|
313
319
|
}
|
|
314
320
|
}, { immediate: true });
|
|
315
321
|
function discardChanges() {
|
|
316
|
-
|
|
322
|
+
resetDraftConfig();
|
|
317
323
|
open.value = false;
|
|
318
324
|
}
|
|
319
325
|
function handleOpenChange(value) {
|
|
@@ -329,6 +335,9 @@ function selectGeneral() {
|
|
|
329
335
|
function selectItem(itemId) {
|
|
330
336
|
selectedItemId.value = itemId;
|
|
331
337
|
}
|
|
338
|
+
function updateDraftOrientation(value) {
|
|
339
|
+
draftOrientation.value = normalizeOrientation(value);
|
|
340
|
+
}
|
|
332
341
|
function updateDraftField(draftId, updater) {
|
|
333
342
|
draftFields.value = draftFields.value.map((item) => item.draftId === draftId ? {
|
|
334
343
|
draftId: item.draftId,
|
|
@@ -815,7 +824,10 @@ function confirmChanges() {
|
|
|
815
824
|
return;
|
|
816
825
|
}
|
|
817
826
|
draftFields.value = normalizedFields.map((item) => createDraftField(item.field));
|
|
818
|
-
emit("confirm",
|
|
827
|
+
emit("confirm", {
|
|
828
|
+
orientation: draftOrientation.value,
|
|
829
|
+
fields: normalizedFields.map((item) => item.field)
|
|
830
|
+
});
|
|
819
831
|
open.value = false;
|
|
820
832
|
}
|
|
821
833
|
</script>
|
|
@@ -973,13 +985,35 @@ function confirmChanges() {
|
|
|
973
985
|
{{ t("general-description") }}
|
|
974
986
|
</p>
|
|
975
987
|
|
|
976
|
-
<
|
|
988
|
+
<section
|
|
977
989
|
v-if="selectedItemId === 'general'"
|
|
978
|
-
data-slot="fields-configurator-general-
|
|
979
|
-
class="mt-6
|
|
990
|
+
data-slot="fields-configurator-general-options"
|
|
991
|
+
class="mt-6 grid gap-4 md:grid-cols-2"
|
|
980
992
|
>
|
|
981
|
-
|
|
982
|
-
|
|
993
|
+
<label
|
|
994
|
+
data-slot="fields-configurator-general-orientation-section"
|
|
995
|
+
class="flex flex-col gap-2"
|
|
996
|
+
>
|
|
997
|
+
<span class="text-xs font-medium text-zinc-500">
|
|
998
|
+
{{ t("fields-orientation") }}
|
|
999
|
+
</span>
|
|
1000
|
+
<NativeSelect
|
|
1001
|
+
data-slot="fields-configurator-general-orientation-select"
|
|
1002
|
+
:model-value="draftOrientation"
|
|
1003
|
+
@update:model-value="updateDraftOrientation"
|
|
1004
|
+
>
|
|
1005
|
+
<NativeSelectOption value="horizontal">
|
|
1006
|
+
{{ t("fields-orientation-horizontal") }}
|
|
1007
|
+
</NativeSelectOption>
|
|
1008
|
+
<NativeSelectOption value="vertical">
|
|
1009
|
+
{{ t("fields-orientation-vertical") }}
|
|
1010
|
+
</NativeSelectOption>
|
|
1011
|
+
<NativeSelectOption value="floating">
|
|
1012
|
+
{{ t("fields-orientation-floating") }}
|
|
1013
|
+
</NativeSelectOption>
|
|
1014
|
+
</NativeSelect>
|
|
1015
|
+
</label>
|
|
1016
|
+
</section>
|
|
983
1017
|
|
|
984
1018
|
<div
|
|
985
1019
|
v-else-if="selectedField"
|
|
@@ -1565,8 +1599,11 @@ function confirmChanges() {
|
|
|
1565
1599
|
"configure-fields-description": "在这里浏览通用项和字段配置项。",
|
|
1566
1600
|
"field-list": "字段列表",
|
|
1567
1601
|
"general": "通用",
|
|
1568
|
-
"general-description": "
|
|
1569
|
-
"
|
|
1602
|
+
"general-description": "在这里配置字段集合级别的公共选项。",
|
|
1603
|
+
"fields-orientation": "布局方向",
|
|
1604
|
+
"fields-orientation-horizontal": "水平",
|
|
1605
|
+
"fields-orientation-vertical": "垂直",
|
|
1606
|
+
"fields-orientation-floating": "浮动标签",
|
|
1570
1607
|
"add-field": "新增字段",
|
|
1571
1608
|
"field-type": "字段类型",
|
|
1572
1609
|
"field-type-string": "文本",
|
|
@@ -1636,8 +1673,11 @@ function confirmChanges() {
|
|
|
1636
1673
|
"configure-fields-description": "共通項目とフィールド設定をここで確認できます。",
|
|
1637
1674
|
"field-list": "フィールド一覧",
|
|
1638
1675
|
"general": "共通",
|
|
1639
|
-
"general-description": "
|
|
1640
|
-
"
|
|
1676
|
+
"general-description": "ここではフィールド群全体に適用される共通設定を編集できます。",
|
|
1677
|
+
"fields-orientation": "レイアウト方向",
|
|
1678
|
+
"fields-orientation-horizontal": "横並び",
|
|
1679
|
+
"fields-orientation-vertical": "縦並び",
|
|
1680
|
+
"fields-orientation-floating": "フローティングラベル",
|
|
1641
1681
|
"add-field": "フィールドを追加",
|
|
1642
1682
|
"field-type": "フィールド種別",
|
|
1643
1683
|
"field-type-string": "テキスト",
|
|
@@ -1707,8 +1747,11 @@ function confirmChanges() {
|
|
|
1707
1747
|
"configure-fields-description": "Browse the shared and field-level settings here.",
|
|
1708
1748
|
"field-list": "Field list",
|
|
1709
1749
|
"general": "General",
|
|
1710
|
-
"general-description": "
|
|
1711
|
-
"
|
|
1750
|
+
"general-description": "Edit the shared settings that apply to the whole field group here.",
|
|
1751
|
+
"fields-orientation": "Layout orientation",
|
|
1752
|
+
"fields-orientation-horizontal": "Horizontal",
|
|
1753
|
+
"fields-orientation-vertical": "Vertical",
|
|
1754
|
+
"fields-orientation-floating": "Floating label",
|
|
1712
1755
|
"add-field": "Add field",
|
|
1713
1756
|
"field-type": "Field type",
|
|
1714
1757
|
"field-type-string": "Text",
|