@opengis/cms 0.0.57 → 0.0.59
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/README.md +1 -1
- package/dist/AddNewItemInTree-05PSSEFi.js +76 -0
- package/dist/ArticlesPage-BjYzvTWM.js +298 -0
- package/dist/CollectionsBreadcrumb-HePNJb-d.js +4 -0
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-BJh-tjam.js +53 -0
- package/dist/CollectionsPage-DHfPNql6.js +124 -0
- package/dist/{CreateForm-BMOBeP4G.js → CreateForm-5FvT45vH.js} +1 -1
- package/dist/Dashboard-CXkg_pk8.js +358 -0
- package/dist/EditCollectionPage-CqYHpEON.js +187 -0
- package/dist/{EmptyData-DaZt_nAm.js → EmptyData-DxPrSXhV.js} +1 -1
- package/dist/{MenuAddPage-Bf48Z-ah.js → MenuAddPage-QTnwCoGh.js} +40 -35
- package/dist/MenuBody-Bi0ONVZf.js +125 -0
- package/dist/MenuItemPage-B7Y9KFyb.js +1027 -0
- package/dist/MenuList-BLIpeqSd.js +172 -0
- package/dist/MenuPage-3W6jZ15H.js +107 -0
- package/dist/MenuWrapper-OrOv6sOb.js +12 -0
- package/dist/MonacoEditor-ByPT8pnv.js +4 -0
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js +84 -0
- package/dist/{UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js → UniversalTable-GBd_pStq.js} +81 -81
- package/dist/{UniversalTablePagination.vue_vue_type_script_setup_true_lang-GYZd_gkA.js → UniversalTablePagination-Dw2hc0nc.js} +47 -47
- package/dist/VsFormTags-CMjiu9sY.js +114 -0
- package/dist/VsPreview-DwETkOpb.js +63 -0
- package/dist/contentForm-Buku-lel.js +489 -0
- package/dist/getField-CpwVE28P.js +179 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +72 -71
- package/dist/style.css +1 -1
- package/dist/vs-builder-edit-D-q1o8tF.js +604 -0
- package/dist/vs-builder-monaco-Cw-f19gc.js +33 -0
- package/dist/vs-builder-preview-BH4VAM3a.js +44 -0
- package/dist/vs-form-custom-datatable-BDZo48w3.js +317 -0
- package/dist/vs-form-integer-BZ855R3g.js +61 -0
- package/dist/vs-form-media-select-NY27EaG1.js +837 -0
- package/dist/vs-form-reference-list-Dtv8fJJU.js +1536 -0
- package/dist/vs-form-reletion-link-BhzNQszm.js +34 -0
- package/dist/vs-form-tiptap-DDFQjRjY.js +4 -0
- package/dist/vs-form-tiptap.vue_vue_type_script_setup_true_lang-DGgsqXwg.js +11 -0
- package/dist/vs-richtext-md-C098v_6Q.js +4 -0
- package/dist/vs-richtext-md.vue_vue_type_script_setup_true_lang-Ct8uTV-J.js +14 -0
- package/locales/en.json +1 -0
- package/locales/uk.json +1 -0
- package/package.json +69 -68
- package/server/functions/utils/mock.reply.js +7 -7
- package/server/routes/cms/controllers/getPermissions.js +15 -15
- package/server/routes/cms/controllers/setPermissions.js +49 -49
- package/server/templates/select/core.user_mentioned.sql +1 -1
- package/dist/ArticlesPage-BcR1hbds.js +0 -286
- package/dist/BuilderPage-CK_osM89.js +0 -386
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js +0 -45
- package/dist/CollectionsPage-JfmrHNR_.js +0 -110
- package/dist/EditCollectionPage-Cw3GQYRe.js +0 -809
- package/dist/MenuItemPage-CXn5HC8j.js +0 -1366
- package/dist/MenuPage-tJZtK46W.js +0 -106
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js +0 -84
- package/dist/contentForm-B6gHgGkz.js +0 -586
- package/dist/getField-Y5WXnRR0.js +0 -2948
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
import { useModel as V, ref as v, computed as z, openBlock as p, createElementBlock as f, createElementVNode as t, createVNode as b, unref as h, createTextVNode as D, toDisplayString as a, withCtx as _, mergeModels as E, defineAsyncComponent as P, onMounted as H, createCommentVNode as L, Fragment as G, createBlock as j, normalizeClass as R, resolveDynamicComponent as J, onBeforeUnmount as K } from "vue";
|
|
2
|
+
import { Type as k, Hash as O, Calendar as B, Clock as I, File as F, ListTree as $, List as N, Image as C, CheckSquare as M, ToggleRight as Q, Link as T, FileText as W, GitBranch as X, Files as Y, Tags as Z, Plus as ee, Edit as le, Trash as te, LayoutTemplate as ie } from "lucide-vue-next";
|
|
3
|
+
import { VForm as se } from "@opengis/form";
|
|
4
|
+
import { VsModal as S, notify as A, confirm as re } from "@opengis/core";
|
|
5
|
+
import { useI18n as U } from "vue-i18n";
|
|
6
|
+
import { d as oe } from "./vuedraggable-CoAPPFYd.js";
|
|
7
|
+
const x = (d = 0, e) => ({
|
|
8
|
+
name: {
|
|
9
|
+
type: "text",
|
|
10
|
+
label: e("cms.builder.fieldLabels.name"),
|
|
11
|
+
required: !0,
|
|
12
|
+
placeholder: e("cms.builder.fieldPlaceholders.name"),
|
|
13
|
+
validators: ["required"]
|
|
14
|
+
},
|
|
15
|
+
label: {
|
|
16
|
+
type: "text",
|
|
17
|
+
label: e("cms.builder.fieldLabels.label"),
|
|
18
|
+
required: !0,
|
|
19
|
+
placeholder: e("cms.builder.fieldPlaceholders.label"),
|
|
20
|
+
validators: ["required"]
|
|
21
|
+
},
|
|
22
|
+
placeholder: {
|
|
23
|
+
type: "text",
|
|
24
|
+
label: e("cms.builder.fieldLabels.placeholder"),
|
|
25
|
+
required: !0,
|
|
26
|
+
placeholder: e("cms.builder.fieldPlaceholders.placeholder")
|
|
27
|
+
},
|
|
28
|
+
help: {
|
|
29
|
+
type: "text",
|
|
30
|
+
label: e("cms.builder.fieldLabels.help"),
|
|
31
|
+
placeholder: e("cms.builder.fieldPlaceholders.help")
|
|
32
|
+
},
|
|
33
|
+
type: {
|
|
34
|
+
type: "combobox",
|
|
35
|
+
mode: "combo",
|
|
36
|
+
label: e("cms.builder.fieldLabels.type"),
|
|
37
|
+
required: !0,
|
|
38
|
+
maxHeight: "300",
|
|
39
|
+
slots: {
|
|
40
|
+
option: `<div class="flex items-center gap-2 p-2 py-1 rounded hover:bg-gray-100" :class="{ 'bg-gray-100': selectedNavIndex === ind, 'bg-gray-100': modelValue == ind }" ><div :class="\`flex items-center gap-2 p-1 bg-\${color }-100 rounded\`"><component :is="icon" class="block" height="24" width="30" /></div><span class="text-sm text-gray-700">{{ text }}</span></div>`
|
|
41
|
+
},
|
|
42
|
+
options: [
|
|
43
|
+
{ text: e("cms.builder.fieldOptions.text"), id: "text", color: "blue", icon: k },
|
|
44
|
+
{ text: e("cms.builder.fieldOptions.number"), id: "number", color: "green", icon: O },
|
|
45
|
+
{ text: e("cms.builder.fieldOptions.date"), id: "date", color: "red", icon: B },
|
|
46
|
+
{ text: e("cms.builder.fieldOptions.datetime"), id: "datetime", color: "purple", icon: I },
|
|
47
|
+
{ text: e("cms.builder.fieldOptions.file"), id: "file", color: "yellow", icon: F },
|
|
48
|
+
{ text: e("cms.builder.fieldOptions.select"), id: "select", color: "yellow", icon: $ },
|
|
49
|
+
{ text: e("cms.builder.fieldOptions.multiselect"), id: "multiselect", color: "blue", icon: N },
|
|
50
|
+
{ text: e("cms.builder.fieldOptions.mediaselect"), id: "mediaselect", color: "orange", icon: C },
|
|
51
|
+
{ text: e("cms.builder.fieldOptions.radio"), id: "radio", color: "blue", icon: M },
|
|
52
|
+
{ text: e("cms.builder.fieldOptions.boolean"), id: "boolean", color: "red", icon: Q },
|
|
53
|
+
{ text: e("cms.builder.fieldOptions.datalist"), id: "datalist", color: "orange", icon: $ },
|
|
54
|
+
{ text: e("cms.builder.fieldOptions.image"), id: "image", color: "blue", icon: C },
|
|
55
|
+
{ text: e("cms.builder.fieldOptions.slug"), id: "slug", color: "green", icon: T },
|
|
56
|
+
{ text: e("cms.builder.fieldOptions.richtext"), id: "richtext", color: "red", icon: k },
|
|
57
|
+
{ text: e("cms.builder.fieldOptions.reference"), id: "reference", color: "yellow", icon: W },
|
|
58
|
+
{ text: e("cms.builder.fieldOptions.relation"), id: "relation", color: "pink", icon: X },
|
|
59
|
+
{ text: e("cms.builder.fieldOptions.fileList"), id: "FileList", color: "orange", icon: Y },
|
|
60
|
+
{ text: e("cms.builder.fieldOptions.tags"), id: "tags", color: "blue", icon: Z }
|
|
61
|
+
].filter((m) => d > 1 ? m.id !== "datalist" : !0),
|
|
62
|
+
validators: ["required"]
|
|
63
|
+
},
|
|
64
|
+
subtype: {
|
|
65
|
+
type: "combobox",
|
|
66
|
+
mode: "combo",
|
|
67
|
+
label: e("cms.builder.fieldLabels.subtype"),
|
|
68
|
+
placeholder: e("cms.builder.fieldPlaceholders.subtype"),
|
|
69
|
+
options: [
|
|
70
|
+
{ text: e("cms.builder.fieldOptions.text"), id: "text" },
|
|
71
|
+
{ text: e("cms.builder.fieldOptions.number"), id: "number" },
|
|
72
|
+
{ text: e("cms.builder.fieldOptions.date"), id: "date" },
|
|
73
|
+
{ text: e("cms.builder.fieldOptions.datetime"), id: "datetime" }
|
|
74
|
+
],
|
|
75
|
+
conditions: ["type", "==", "array"]
|
|
76
|
+
},
|
|
77
|
+
parent: {
|
|
78
|
+
type: "text",
|
|
79
|
+
label: e("cms.builder.fieldLabels.parent"),
|
|
80
|
+
placeholder: e("cms.builder.fieldPlaceholders.parent"),
|
|
81
|
+
conditions: ["type", "in", ["slug", "select", "multiselect"]]
|
|
82
|
+
},
|
|
83
|
+
data: {
|
|
84
|
+
type: "text",
|
|
85
|
+
label: e("cms.builder.fieldLabels.data"),
|
|
86
|
+
placeholder: e("cms.builder.fieldPlaceholders.data"),
|
|
87
|
+
conditions: ["type", "in", ["select", "multiselect"]]
|
|
88
|
+
},
|
|
89
|
+
options: {
|
|
90
|
+
type: "datatable",
|
|
91
|
+
label: e("cms.builder.fieldLabels.options"),
|
|
92
|
+
conditions: ["type", "in", ["select", "multiselect", "radio"]],
|
|
93
|
+
colModel: [
|
|
94
|
+
{
|
|
95
|
+
key: "id",
|
|
96
|
+
label: "ID",
|
|
97
|
+
type: "text",
|
|
98
|
+
validators: ["required"],
|
|
99
|
+
col: 6
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: "text",
|
|
103
|
+
label: "Text",
|
|
104
|
+
type: "text",
|
|
105
|
+
validators: ["required"],
|
|
106
|
+
col: 6
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: "icon",
|
|
110
|
+
ua: "Icon",
|
|
111
|
+
type: "text",
|
|
112
|
+
col: 6
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
colModel: d <= 1 ? {
|
|
117
|
+
type: "datatable",
|
|
118
|
+
label: e("cms.builder.fieldLabels.colModel"),
|
|
119
|
+
conditions: ["type", "==", "datalist"],
|
|
120
|
+
colModel: Object.entries(x(d + 1, e)).map(([m, s]) => ({
|
|
121
|
+
key: m,
|
|
122
|
+
...s,
|
|
123
|
+
ua: (s == null ? void 0 : s.label) || (s == null ? void 0 : s.ua)
|
|
124
|
+
}))
|
|
125
|
+
} : {
|
|
126
|
+
type: "switcher",
|
|
127
|
+
label: e("cms.builder.fieldLabels.required"),
|
|
128
|
+
hidden: !0,
|
|
129
|
+
required: !0
|
|
130
|
+
},
|
|
131
|
+
multiple: {
|
|
132
|
+
type: "switcher",
|
|
133
|
+
label: e("cms.builder.fieldLabels.multiple"),
|
|
134
|
+
conditions: ["type", "==", "file"]
|
|
135
|
+
},
|
|
136
|
+
relation: {
|
|
137
|
+
type: "combobox",
|
|
138
|
+
data: "collection",
|
|
139
|
+
label: e("cms.builder.fieldLabels.relation"),
|
|
140
|
+
conditions: ["type", "==", "relation"]
|
|
141
|
+
},
|
|
142
|
+
required: {
|
|
143
|
+
type: "switcher",
|
|
144
|
+
label: e("cms.builder.fieldLabels.required"),
|
|
145
|
+
required: !0
|
|
146
|
+
},
|
|
147
|
+
localization: {
|
|
148
|
+
type: "switcher",
|
|
149
|
+
label: e("cms.builder.fieldLabels.localization"),
|
|
150
|
+
conditions: ["type", "in", ["richtext", "text", "reference", "multiselect", "datalist"]],
|
|
151
|
+
required: !0
|
|
152
|
+
}
|
|
153
|
+
}), ae = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, de = {
|
|
154
|
+
__name: "vs-builder-datatable-form",
|
|
155
|
+
props: {
|
|
156
|
+
modelValue: {
|
|
157
|
+
type: Array,
|
|
158
|
+
default: () => []
|
|
159
|
+
},
|
|
160
|
+
modelModifiers: {}
|
|
161
|
+
},
|
|
162
|
+
emits: ["update:modelValue"],
|
|
163
|
+
setup(d) {
|
|
164
|
+
const { t: e } = U(), m = V(d, "modelValue"), s = v(!1), l = v({}), r = v({}), g = z(() => (r.value, x(0, e))), n = async () => {
|
|
165
|
+
if (await l.value.validate()) {
|
|
166
|
+
A({
|
|
167
|
+
type: "warning",
|
|
168
|
+
title: e("cms.common.actions.warning"),
|
|
169
|
+
message: e("cms.builder.createFieldFailed")
|
|
170
|
+
});
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
m.value = [...m.value, r.value], r.value = {}, s.value = !1;
|
|
175
|
+
} catch (o) {
|
|
176
|
+
console.log(o);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return (i, o) => (p(), f("div", null, [
|
|
180
|
+
t("button", {
|
|
181
|
+
onClick: o[0] || (o[0] = (u) => s.value = !0),
|
|
182
|
+
class: "inline-flex items-center justify-center h-10 gap-2 px-4 py-2 text-sm font-medium transition-colors border rounded-md hover hover:bg-gray-200 whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring 0"
|
|
183
|
+
}, [
|
|
184
|
+
b(h(ee), { class: "w-4 h-4 mr-2" }),
|
|
185
|
+
D(" " + a(i.$t("cms.common.actions.addField")), 1)
|
|
186
|
+
]),
|
|
187
|
+
b(h(S), {
|
|
188
|
+
teleport: "#modal",
|
|
189
|
+
title: i.$t("cms.builder.createField"),
|
|
190
|
+
size: "small",
|
|
191
|
+
visible: s.value,
|
|
192
|
+
"onUpdate:visible": o[4] || (o[4] = (u) => s.value = u),
|
|
193
|
+
onClose: o[5] || (o[5] = (u) => s.value = !1)
|
|
194
|
+
}, {
|
|
195
|
+
footer: _(() => [
|
|
196
|
+
t("div", ae, [
|
|
197
|
+
t("button", {
|
|
198
|
+
class: "inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",
|
|
199
|
+
onClick: o[3] || (o[3] = (u) => s.value = !1)
|
|
200
|
+
}, a(i.$t("cms.common.actions.cancel")), 1),
|
|
201
|
+
t("button", {
|
|
202
|
+
onClick: n,
|
|
203
|
+
class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"
|
|
204
|
+
}, a(i.$t("cms.common.actions.save")), 1)
|
|
205
|
+
])
|
|
206
|
+
]),
|
|
207
|
+
default: _(() => [
|
|
208
|
+
b(h(se), {
|
|
209
|
+
modelValue: r.value,
|
|
210
|
+
"onUpdate:modelValue": o[1] || (o[1] = (u) => r.value = u),
|
|
211
|
+
schema: g.value,
|
|
212
|
+
form: l.value,
|
|
213
|
+
"onUpdate:form": o[2] || (o[2] = (u) => l.value = u)
|
|
214
|
+
}, null, 8, ["modelValue", "schema", "form"])
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
}, 8, ["title", "visible"])
|
|
218
|
+
]));
|
|
219
|
+
}
|
|
220
|
+
}, ne = { class: "flex items-center justify-end col-span-3 gap-2" }, ce = {
|
|
221
|
+
key: 2,
|
|
222
|
+
class: "w-8 h-4"
|
|
223
|
+
}, ue = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, me = {
|
|
224
|
+
__name: "vs-builder-datatable-controls",
|
|
225
|
+
props: /* @__PURE__ */ E({
|
|
226
|
+
index: {
|
|
227
|
+
type: Number,
|
|
228
|
+
required: !0
|
|
229
|
+
},
|
|
230
|
+
data: {
|
|
231
|
+
type: Object,
|
|
232
|
+
required: !0
|
|
233
|
+
}
|
|
234
|
+
}, {
|
|
235
|
+
columns: {
|
|
236
|
+
type: Array,
|
|
237
|
+
default: () => []
|
|
238
|
+
},
|
|
239
|
+
columnsModifiers: {}
|
|
240
|
+
}),
|
|
241
|
+
emits: ["update:columns"],
|
|
242
|
+
setup(d) {
|
|
243
|
+
const { t: e } = U(), m = P(() => import("@opengis/form")), s = d, l = V(d, "columns"), r = v(!1), g = v({}), n = v({ ...s.data || {} }), i = v({});
|
|
244
|
+
H(() => {
|
|
245
|
+
s.data.required ? i.value = {
|
|
246
|
+
...x(0, e),
|
|
247
|
+
name: {
|
|
248
|
+
...x(0, e).name,
|
|
249
|
+
disabled: !0
|
|
250
|
+
},
|
|
251
|
+
label: {
|
|
252
|
+
...x(0, e).label,
|
|
253
|
+
disabled: !0
|
|
254
|
+
},
|
|
255
|
+
type: {
|
|
256
|
+
...x(0, e).type,
|
|
257
|
+
disabled: !0
|
|
258
|
+
}
|
|
259
|
+
} : i.value = x(0, e);
|
|
260
|
+
});
|
|
261
|
+
const o = () => {
|
|
262
|
+
re({
|
|
263
|
+
title: e("cms.builder.deleteTitle"),
|
|
264
|
+
message: e("cms.builder.deleteField"),
|
|
265
|
+
type: "error",
|
|
266
|
+
onConfirm: () => {
|
|
267
|
+
u();
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
}, u = () => {
|
|
271
|
+
l.value = l.value.filter((y, c) => c !== s.index);
|
|
272
|
+
}, q = async () => {
|
|
273
|
+
if (await g.value.validate()) {
|
|
274
|
+
A({
|
|
275
|
+
type: "warning",
|
|
276
|
+
title: e("cms.common.actions.warning"),
|
|
277
|
+
message: e("cms.builder.editFieldFailed")
|
|
278
|
+
});
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
try {
|
|
282
|
+
l.value[s.index] = n.value, r.value = !1;
|
|
283
|
+
} catch (c) {
|
|
284
|
+
console.log(c);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
return (y, c) => (p(), f("div", ne, [
|
|
288
|
+
["status"].includes(d.data.name) ? L("", !0) : (p(), f("button", {
|
|
289
|
+
key: 0,
|
|
290
|
+
onClick: c[0] || (c[0] = (w) => r.value = !0),
|
|
291
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground h-8 w-8 rounded-full hover:bg-gray-100"
|
|
292
|
+
}, [
|
|
293
|
+
b(h(le), { class: "w-4 h-4" })
|
|
294
|
+
])),
|
|
295
|
+
d.data.required ? (p(), f("button", ce)) : (p(), f("button", {
|
|
296
|
+
key: 1,
|
|
297
|
+
onClick: o,
|
|
298
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 h-8 w-8 rounded-full hover:bg-red-100 text-red-600 hover:text-red-700"
|
|
299
|
+
}, [
|
|
300
|
+
b(h(te), { class: "w-4 h-4" })
|
|
301
|
+
])),
|
|
302
|
+
b(h(S), {
|
|
303
|
+
teleport: "#modal",
|
|
304
|
+
visible: r.value,
|
|
305
|
+
title: y.$t("cms.builder.editField"),
|
|
306
|
+
onClose: c[4] || (c[4] = (w) => r.value = !1)
|
|
307
|
+
}, {
|
|
308
|
+
footer: _(() => [
|
|
309
|
+
t("div", ue, [
|
|
310
|
+
t("button", {
|
|
311
|
+
class: "inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",
|
|
312
|
+
onClick: c[3] || (c[3] = (w) => r.value = !1)
|
|
313
|
+
}, a(y.$t("cms.common.actions.cancel")), 1),
|
|
314
|
+
t("button", {
|
|
315
|
+
class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300",
|
|
316
|
+
onClick: q
|
|
317
|
+
}, a(y.$t("cms.common.actions.save")), 1)
|
|
318
|
+
])
|
|
319
|
+
]),
|
|
320
|
+
default: _(() => [
|
|
321
|
+
b(h(m), {
|
|
322
|
+
modelValue: n.value,
|
|
323
|
+
"onUpdate:modelValue": c[1] || (c[1] = (w) => n.value = w),
|
|
324
|
+
schema: i.value,
|
|
325
|
+
form: g.value,
|
|
326
|
+
"onUpdate:form": c[2] || (c[2] = (w) => g.value = w)
|
|
327
|
+
}, null, 8, ["modelValue", "schema", "form"])
|
|
328
|
+
]),
|
|
329
|
+
_: 1
|
|
330
|
+
}, 8, ["visible", "title"])
|
|
331
|
+
]));
|
|
332
|
+
}
|
|
333
|
+
}, pe = { class: "flex items-center justify-between mb-6" }, be = { class: "text-xl font-semibold text-gray-900" }, fe = { class: "mt-1 text-sm text-gray-600" }, ge = { class: "flex items-center gap-2" }, he = { class: "overflow-hidden bg-white border border-gray-200 shadow-sm rounded-xl" }, ve = { class: "grid grid-cols-12 gap-4 px-6 py-4 border-b border-gray-200 bg-gray-50" }, ye = { class: "col-span-5 font-medium text-gray-700" }, xe = { class: "col-span-3 font-medium text-gray-700" }, we = { class: "col-span-2 font-medium text-gray-700" }, ke = { class: "col-span-2 font-medium text-right text-gray-700" }, Ve = { class: "divide-y divide-gray-100" }, _e = { class: "grid items-center grid-cols-12 gap-4 px-6 py-4 transition-colors hover:bg-gray-50/50" }, qe = { class: "flex items-center col-span-5 gap-3" }, $e = { class: "font-medium text-gray-900" }, Ce = { class: "text-xs text-gray-500" }, Le = {
|
|
334
|
+
key: 0,
|
|
335
|
+
class: "inline-flex items-center px-2 py-1 text-xs font-medium text-blue-700 rounded-full bg-blue-50 ring-1 ring-inset ring-blue-700/10"
|
|
336
|
+
}, Oe = { class: "col-span-3" }, Fe = { class: "inline-flex items-center px-2 py-1 text-sm font-medium text-gray-600 rounded-md bg-gray-50 ring-1 ring-inset ring-gray-500/10" }, Me = { class: "col-span-1" }, Te = {
|
|
337
|
+
key: 0,
|
|
338
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
339
|
+
width: "24",
|
|
340
|
+
height: "24",
|
|
341
|
+
viewBox: "0 0 24 24",
|
|
342
|
+
fill: "none",
|
|
343
|
+
stroke: "currentColor",
|
|
344
|
+
"stroke-width": "2",
|
|
345
|
+
"stroke-linecap": "round",
|
|
346
|
+
"stroke-linejoin": "round",
|
|
347
|
+
class: "lucide lucide-circle-check w-4 h-4 text-emerald-600"
|
|
348
|
+
}, Ue = {
|
|
349
|
+
key: 1,
|
|
350
|
+
class: "grid items-center grid-cols-12 gap-4 px-6 py-4 transition-colors hover:bg-gray-50/50"
|
|
351
|
+
}, je = { class: "col-span-5" }, ze = { class: "text-gray-500" }, Pe = {
|
|
352
|
+
__name: "vs-builder-datatable",
|
|
353
|
+
props: {
|
|
354
|
+
modelValue: {},
|
|
355
|
+
modelModifiers: {}
|
|
356
|
+
},
|
|
357
|
+
emits: ["update:modelValue"],
|
|
358
|
+
setup(d) {
|
|
359
|
+
const e = V(d, "modelValue"), m = (l) => l === "array" ? "purple" : l === "boolean" || l === "date" ? "red" : l === "datetime" ? "purple" : l === "number" ? "green" : l === "text" ? "blue" : l === "file" || l === "select" ? "yellow" : l === "slug" ? "green" : l === "image" ? "blue" : "gray", s = (l) => {
|
|
360
|
+
switch (l) {
|
|
361
|
+
case "text":
|
|
362
|
+
return k;
|
|
363
|
+
case "number":
|
|
364
|
+
return O;
|
|
365
|
+
case "integer":
|
|
366
|
+
return O;
|
|
367
|
+
case "date":
|
|
368
|
+
return B;
|
|
369
|
+
case "datetime":
|
|
370
|
+
return I;
|
|
371
|
+
case "file":
|
|
372
|
+
return F;
|
|
373
|
+
case "select":
|
|
374
|
+
return $;
|
|
375
|
+
case "multiselect":
|
|
376
|
+
return N;
|
|
377
|
+
case "mediaselect":
|
|
378
|
+
return C;
|
|
379
|
+
case "radio":
|
|
380
|
+
return M;
|
|
381
|
+
case "boolean":
|
|
382
|
+
return M;
|
|
383
|
+
case "datalist":
|
|
384
|
+
return $;
|
|
385
|
+
case "image":
|
|
386
|
+
return C;
|
|
387
|
+
case "slug":
|
|
388
|
+
return T;
|
|
389
|
+
case "richtext":
|
|
390
|
+
return k;
|
|
391
|
+
case "markdown":
|
|
392
|
+
return k;
|
|
393
|
+
case "reference":
|
|
394
|
+
return ie;
|
|
395
|
+
case "relation":
|
|
396
|
+
return T;
|
|
397
|
+
case "FileList":
|
|
398
|
+
return F;
|
|
399
|
+
default:
|
|
400
|
+
return k;
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
return (l, r) => {
|
|
404
|
+
var g, n;
|
|
405
|
+
return p(), f(G, null, [
|
|
406
|
+
t("div", pe, [
|
|
407
|
+
t("div", null, [
|
|
408
|
+
t("h2", be, a(l.$t("cms.builder.collectionStructure")), 1),
|
|
409
|
+
t("p", fe, a(l.$t("cms.builder.defineFields")), 1)
|
|
410
|
+
]),
|
|
411
|
+
t("div", ge, [
|
|
412
|
+
b(de, {
|
|
413
|
+
modelValue: e.value.columns,
|
|
414
|
+
"onUpdate:modelValue": r[0] || (r[0] = (i) => e.value.columns = i)
|
|
415
|
+
}, null, 8, ["modelValue"])
|
|
416
|
+
])
|
|
417
|
+
]),
|
|
418
|
+
t("div", he, [
|
|
419
|
+
t("div", ve, [
|
|
420
|
+
t("div", ye, a(l.$t("cms.builder.name")), 1),
|
|
421
|
+
t("div", xe, a(l.$t("cms.builder.type")), 1),
|
|
422
|
+
t("div", we, a(l.$t("cms.builder.localization")), 1),
|
|
423
|
+
t("div", ke, a(l.$t("cms.builder.actions")), 1)
|
|
424
|
+
]),
|
|
425
|
+
t("div", Ve, [
|
|
426
|
+
(n = (g = e.value) == null ? void 0 : g.columns) != null && n.length ? (p(), j(h(oe), {
|
|
427
|
+
key: 0,
|
|
428
|
+
modelValue: e.value.columns,
|
|
429
|
+
"onUpdate:modelValue": r[2] || (r[2] = (i) => e.value.columns = i),
|
|
430
|
+
"item-key": "name",
|
|
431
|
+
handle: ".drag-handle",
|
|
432
|
+
animation: 200
|
|
433
|
+
}, {
|
|
434
|
+
item: _(({ element: i, index: o }) => {
|
|
435
|
+
var u, q;
|
|
436
|
+
return [
|
|
437
|
+
t("div", _e, [
|
|
438
|
+
t("div", qe, [
|
|
439
|
+
r[3] || (r[3] = t("span", { class: "drag-handle cursor-move mr-2 text-gray-400" }, "☰", -1)),
|
|
440
|
+
t("div", {
|
|
441
|
+
class: R(["flex items-center justify-center p-1 rounded", `bg-${m((u = i.type) == null ? void 0 : u.toLowerCase())}-100`])
|
|
442
|
+
}, [
|
|
443
|
+
(p(), j(J(s((q = i.type) == null ? void 0 : q.toLowerCase())), { class: "w-4 h-4" }))
|
|
444
|
+
], 2),
|
|
445
|
+
t("div", null, [
|
|
446
|
+
t("p", $e, a(i.label), 1),
|
|
447
|
+
t("p", Ce, a(i.name), 1)
|
|
448
|
+
]),
|
|
449
|
+
i.required ? (p(), f("span", Le, a(l.$t("cms.builder.required")), 1)) : L("", !0)
|
|
450
|
+
]),
|
|
451
|
+
t("div", Oe, [
|
|
452
|
+
t("span", Fe, a(i.type), 1)
|
|
453
|
+
]),
|
|
454
|
+
t("div", Me, [
|
|
455
|
+
i.localization ? (p(), f("svg", Te, [...r[4] || (r[4] = [
|
|
456
|
+
t("circle", {
|
|
457
|
+
cx: "12",
|
|
458
|
+
cy: "12",
|
|
459
|
+
r: "10"
|
|
460
|
+
}, null, -1),
|
|
461
|
+
t("path", { d: "m9 12 2 2 4-4" }, null, -1)
|
|
462
|
+
])])) : L("", !0)
|
|
463
|
+
]),
|
|
464
|
+
b(me, {
|
|
465
|
+
columns: e.value.columns,
|
|
466
|
+
"onUpdate:columns": r[1] || (r[1] = (y) => e.value.columns = y),
|
|
467
|
+
data: e.value.columns[o],
|
|
468
|
+
index: o
|
|
469
|
+
}, null, 8, ["columns", "data", "index"])
|
|
470
|
+
])
|
|
471
|
+
];
|
|
472
|
+
}),
|
|
473
|
+
_: 1
|
|
474
|
+
}, 8, ["modelValue"])) : (p(), f("div", Ue, [
|
|
475
|
+
t("div", je, [
|
|
476
|
+
t("p", ze, a(l.$t("cms.builder.noColumnsFound")), 1)
|
|
477
|
+
])
|
|
478
|
+
]))
|
|
479
|
+
])
|
|
480
|
+
])
|
|
481
|
+
], 64);
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
}, Ee = {
|
|
485
|
+
__name: "vs-builder-edit",
|
|
486
|
+
props: {
|
|
487
|
+
data: {},
|
|
488
|
+
dataModifiers: {},
|
|
489
|
+
form: {},
|
|
490
|
+
formModifiers: {}
|
|
491
|
+
},
|
|
492
|
+
emits: ["update:data", "update:form"],
|
|
493
|
+
setup(d) {
|
|
494
|
+
const { t: e } = U(), m = P(() => import("@opengis/form")), s = V(d, "data"), l = V(d, "form");
|
|
495
|
+
v({});
|
|
496
|
+
const r = z(() => ({
|
|
497
|
+
name: {
|
|
498
|
+
type: "text",
|
|
499
|
+
disabled: !0,
|
|
500
|
+
readonly: !0,
|
|
501
|
+
label: e("cms.builder.scheme.name.label"),
|
|
502
|
+
required: !0,
|
|
503
|
+
placeholder: e("cms.builder.scheme.name.placeholder"),
|
|
504
|
+
validators: ["required"],
|
|
505
|
+
col: 3
|
|
506
|
+
},
|
|
507
|
+
title: {
|
|
508
|
+
type: "text",
|
|
509
|
+
label: e("cms.builder.scheme.title.label"),
|
|
510
|
+
required: !0,
|
|
511
|
+
placeholder: e("cms.builder.scheme.title.placeholder"),
|
|
512
|
+
validators: ["required"],
|
|
513
|
+
col: 3
|
|
514
|
+
},
|
|
515
|
+
preview_path: {
|
|
516
|
+
type: "text",
|
|
517
|
+
label: e("cms.builder.scheme.preview_path.label"),
|
|
518
|
+
placeholder: e("cms.builder.scheme.preview_path.placeholder"),
|
|
519
|
+
col: 3,
|
|
520
|
+
info: e("cms.builder.scheme.preview_path.info")
|
|
521
|
+
},
|
|
522
|
+
// slug: {
|
|
523
|
+
// type: "slug",
|
|
524
|
+
// label: "Title",
|
|
525
|
+
// parent: "title",
|
|
526
|
+
// required: true,
|
|
527
|
+
// placeholder: "Title",
|
|
528
|
+
// validators: ["required"],
|
|
529
|
+
// col: 4,
|
|
530
|
+
// },
|
|
531
|
+
type: {
|
|
532
|
+
hidden: !0,
|
|
533
|
+
type: "select",
|
|
534
|
+
label: e("cms.builder.scheme.type.label"),
|
|
535
|
+
required: !0,
|
|
536
|
+
placeholder: e("cms.builder.scheme.type.placeholder"),
|
|
537
|
+
validators: ["required"],
|
|
538
|
+
col: 4,
|
|
539
|
+
options: [
|
|
540
|
+
{
|
|
541
|
+
text: e("cms.builder.scheme.type.options.collection"),
|
|
542
|
+
id: "collection"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
text: e("cms.builder.scheme.type.options.single"),
|
|
546
|
+
id: "single"
|
|
547
|
+
}
|
|
548
|
+
]
|
|
549
|
+
},
|
|
550
|
+
status: {
|
|
551
|
+
hidden: !0,
|
|
552
|
+
type: "select",
|
|
553
|
+
label: e("cms.builder.scheme.status.label"),
|
|
554
|
+
required: !0,
|
|
555
|
+
placeholder: e("cms.builder.scheme.status.placeholder"),
|
|
556
|
+
col: 4,
|
|
557
|
+
options: [
|
|
558
|
+
{
|
|
559
|
+
text: e("cms.builder.scheme.status.options.published"),
|
|
560
|
+
id: "published"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
text: e("cms.builder.scheme.status.options.draft"),
|
|
564
|
+
id: "draft"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
text: e("cms.builder.scheme.status.options.archived"),
|
|
568
|
+
id: "archived"
|
|
569
|
+
}
|
|
570
|
+
]
|
|
571
|
+
},
|
|
572
|
+
include_search: {
|
|
573
|
+
type: "switcher",
|
|
574
|
+
label: e("cms.builder.scheme.include_search.label"),
|
|
575
|
+
placeholder: e("cms.builder.scheme.include_search.placeholder"),
|
|
576
|
+
col: 3
|
|
577
|
+
},
|
|
578
|
+
description: {
|
|
579
|
+
type: "textarea",
|
|
580
|
+
label: e("cms.builder.scheme.description.label"),
|
|
581
|
+
required: !0,
|
|
582
|
+
placeholder: e("cms.builder.scheme.description.placeholder")
|
|
583
|
+
}
|
|
584
|
+
}));
|
|
585
|
+
return K(() => {
|
|
586
|
+
l.value = null;
|
|
587
|
+
}), (g, n) => (p(), f("div", null, [
|
|
588
|
+
b(h(m), {
|
|
589
|
+
modelValue: s.value,
|
|
590
|
+
"onUpdate:modelValue": n[0] || (n[0] = (i) => s.value = i),
|
|
591
|
+
schema: r.value,
|
|
592
|
+
form: l.value,
|
|
593
|
+
"onUpdate:form": n[1] || (n[1] = (i) => l.value = i)
|
|
594
|
+
}, null, 8, ["modelValue", "schema", "form"]),
|
|
595
|
+
b(Pe, {
|
|
596
|
+
modelValue: s.value,
|
|
597
|
+
"onUpdate:modelValue": n[2] || (n[2] = (i) => s.value = i)
|
|
598
|
+
}, null, 8, ["modelValue"])
|
|
599
|
+
]));
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
export {
|
|
603
|
+
Ee as default
|
|
604
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ref as l, useModel as m, onMounted as u, openBlock as r, createElementBlock as d, createVNode as i, createCommentVNode as s } from "vue";
|
|
2
|
+
import { _ as c } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js";
|
|
3
|
+
const g = {
|
|
4
|
+
__name: "vs-builder-monaco",
|
|
5
|
+
props: {
|
|
6
|
+
yaml: { type: String, default: "" },
|
|
7
|
+
yamlModifiers: {}
|
|
8
|
+
},
|
|
9
|
+
emits: ["update:yaml"],
|
|
10
|
+
setup(o) {
|
|
11
|
+
const a = l("");
|
|
12
|
+
m(o, "yaml");
|
|
13
|
+
const e = l(null);
|
|
14
|
+
return u(() => {
|
|
15
|
+
e.value = Math.random().toString(36).substring(2, 15);
|
|
16
|
+
}), (p, t) => e.value ? (r(), d("div", { key: e.value }, [
|
|
17
|
+
i(c, {
|
|
18
|
+
modelValue: a.value,
|
|
19
|
+
"onUpdate:modelValue": t[0] || (t[0] = (n) => a.value = n),
|
|
20
|
+
language: "yaml",
|
|
21
|
+
theme: "vs-light",
|
|
22
|
+
height: "calc(100vh - 200px)",
|
|
23
|
+
width: "100%",
|
|
24
|
+
options: {
|
|
25
|
+
minimap: { enabled: !1 }
|
|
26
|
+
}
|
|
27
|
+
}, null, 8, ["modelValue"])
|
|
28
|
+
])) : s("", !0);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
g as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ref as c, useModel as s, computed as d, openBlock as u, createElementBlock as v, createBlock as _, unref as g, createCommentVNode as k } from "vue";
|
|
2
|
+
import { g as V } from "./getField-CpwVE28P.js";
|
|
3
|
+
import { inputs as e, VForm as $ } from "@opengis/form";
|
|
4
|
+
import h from "./vs-form-custom-datatable-BDZo48w3.js";
|
|
5
|
+
import x from "./vs-form-reference-list-Dtv8fJJU.js";
|
|
6
|
+
import { _ as B } from "./vs-form-tiptap.vue_vue_type_script_setup_true_lang-DGgsqXwg.js";
|
|
7
|
+
import r from "./vs-form-media-select-NY27EaG1.js";
|
|
8
|
+
import { _ as M } from "./vs-richtext-md.vue_vue_type_script_setup_true_lang-Ct8uTV-J.js";
|
|
9
|
+
import b from "./vs-form-integer-BZ855R3g.js";
|
|
10
|
+
import y from "./vs-form-reletion-link-BhzNQszm.js";
|
|
11
|
+
const A = {
|
|
12
|
+
__name: "vs-builder-preview",
|
|
13
|
+
props: {
|
|
14
|
+
data: {},
|
|
15
|
+
dataModifiers: {},
|
|
16
|
+
form: {},
|
|
17
|
+
formModifiers: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:data", "update:form"],
|
|
20
|
+
setup(o) {
|
|
21
|
+
e["vs-input-custom-datatable"] = h, e["vs-input-reference"] = x, e["vs-input-texteditor"] = B, e["vs-input-mediaselect"] = r, e["vs-input-file"] = r, e["vs-input-image"] = r, e["vs-input-richtext-md"] = M, e["vs-input-integer"] = b, e["vs-input-relation-link"] = y;
|
|
22
|
+
const a = c({}), f = s(o, "data"), l = s(o, "form"), i = d(() => {
|
|
23
|
+
var m, t;
|
|
24
|
+
return ((t = (m = f.value) == null ? void 0 : m.columns) == null ? void 0 : t.map(V)) || [];
|
|
25
|
+
});
|
|
26
|
+
return (m, t) => {
|
|
27
|
+
var n;
|
|
28
|
+
return u(), v("div", {
|
|
29
|
+
ref_key: "form",
|
|
30
|
+
ref: l
|
|
31
|
+
}, [
|
|
32
|
+
((n = i.value) == null ? void 0 : n.length) > 0 ? (u(), _(g($), {
|
|
33
|
+
key: 0,
|
|
34
|
+
modelValue: a.value,
|
|
35
|
+
"onUpdate:modelValue": t[0] || (t[0] = (p) => a.value = p),
|
|
36
|
+
schema: i.value
|
|
37
|
+
}, null, 8, ["modelValue", "schema"])) : k("", !0)
|
|
38
|
+
], 512);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
A as default
|
|
44
|
+
};
|