@opengis/cms 0.0.21 → 0.0.22
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/package.json +2 -2
- package/src/App.css +52 -0
- package/src/App.vue +62 -0
- package/src/assets/image.png +0 -0
- package/src/assets/main.css +3 -0
- package/src/assets/tailwind-3.4.17.js +113 -0
- package/src/components/LanguageSwitcher.vue +73 -0
- package/src/components/SettingsCard.vue +40 -0
- package/src/components/builder/CreateForm.vue +128 -0
- package/src/components/builder/formTypeSchema.js +145 -0
- package/src/components/builder/tabs/index.ts +9 -0
- package/src/components/builder/tabs/vs-builder-edit.vue +133 -0
- package/src/components/builder/tabs/vs-builder-monaco.vue +29 -0
- package/src/components/builder/tabs/vs-builder-preview.vue +39 -0
- package/src/components/builder/vs-builder-datatable-controls.vue +138 -0
- package/src/components/builder/vs-builder-datatable-form.vue +80 -0
- package/src/components/builder/vs-builder-datatable.vue +191 -0
- package/src/components/builder/vs-builder-list-item.vue +110 -0
- package/src/components/collections/CollectionsBreadcrumb.vue +52 -0
- package/src/components/collections/CollectionsGrid.vue +176 -0
- package/src/components/collections/ContentBlock.vue +75 -0
- package/src/components/collections/formWrapper.vue +156 -0
- package/src/components/dashboard/ContentItem.vue +82 -0
- package/src/components/dashboard/DashboardHeader.vue +33 -0
- package/src/components/dashboard/QuickActions.vue +84 -0
- package/src/components/dashboard/RecentContent.vue +54 -0
- package/src/components/dashboard/StatCard.vue +63 -0
- package/src/components/dashboard/StatsGrid.vue +28 -0
- package/src/components/form-components/MonacoEditor.vue +104 -0
- package/src/components/form-components/VsFormMeta.vue +40 -0
- package/src/components/form-components/VsFormTags.vue +150 -0
- package/src/components/form-components/custom-datatable/vs-form-custom-datatable-add.vue +84 -0
- package/src/components/form-components/custom-datatable/vs-form-custom-datatable-controls.vue +106 -0
- package/src/components/form-components/index.js +23 -0
- package/src/components/form-components/reference/vs-form-reference-add.vue +92 -0
- package/src/components/form-components/reference/vs-form-reference-controls.vue +101 -0
- package/src/components/form-components/reference-list/referenceOptionList.js +78 -0
- package/src/components/form-components/reference-list/vs-form-reference-add.vue +145 -0
- package/src/components/form-components/reference-list/vs-form-reference-choce.vue +39 -0
- package/src/components/form-components/reference-list/vs-form-reference-controls.vue +110 -0
- package/src/components/form-components/reference-skeleton/about-skeleton.vue +37 -0
- package/src/components/form-components/reference-skeleton/banner-skeleton.vue +29 -0
- package/src/components/form-components/reference-skeleton/body-skeleton.vue +56 -0
- package/src/components/form-components/reference-skeleton/cards-skeleton.vue +47 -0
- package/src/components/form-components/reference-skeleton/documents-skeleton.vue +64 -0
- package/src/components/form-components/reference-skeleton/faq-skeleton.vue +64 -0
- package/src/components/form-components/reference-skeleton/form-skeleton.vue +41 -0
- package/src/components/form-components/reference-skeleton/index.js +36 -0
- package/src/components/form-components/reference-skeleton/infoLine-skeleton.vue +37 -0
- package/src/components/form-components/reference-skeleton/news-skeleton.vue +54 -0
- package/src/components/form-components/reference-skeleton/slider-skeleton.vue +41 -0
- package/src/components/form-components/reference-skeleton/tabs-skeleton.vue +40 -0
- package/src/components/form-components/reference-skeleton/team-skeleton.vue +103 -0
- package/src/components/form-components/reference-skeleton/usefulLinks-skeleton.vue +52 -0
- package/src/components/form-components/reference-skeleton/video-skeleton.vue +36 -0
- package/src/components/form-components/testReferenceTypes.js +773 -0
- package/src/components/form-components/vs-form-color-picker.vue +29 -0
- package/src/components/form-components/vs-form-custom-datatable.vue +214 -0
- package/src/components/form-components/vs-form-integer.vue +86 -0
- package/src/components/form-components/vs-form-key-value.vue +201 -0
- package/src/components/form-components/vs-form-marcdown-md.vue +3 -0
- package/src/components/form-components/vs-form-media-select.vue +780 -0
- package/src/components/form-components/vs-form-reference-list.vue +97 -0
- package/src/components/form-components/vs-form-reference.vue +59 -0
- package/src/components/form-components/vs-form-relation.vue +30 -0
- package/src/components/form-components/vs-form-reletion-link.vue +34 -0
- package/src/components/form-components/vs-form-select-collection.vue +0 -0
- package/src/components/form-components/vs-form-slug.vue +72 -0
- package/src/components/form-components/vs-form-tiptap.vue +7 -0
- package/src/components/form-components/vs-richtext-md.vue +3 -0
- package/src/components/icons/BellIcon.vue +17 -0
- package/src/components/icons/GlobeIcon.vue +18 -0
- package/src/components/icons/KeyIcon.vue +20 -0
- package/src/components/icons/PaletteIcon.vue +22 -0
- package/src/components/icons/SettingsIcon.vue +19 -0
- package/src/components/icons/ShieldIcon.vue +18 -0
- package/src/components/icons/UsersIcon.vue +19 -0
- package/src/components/icons/icon-chevron-right.vue +16 -0
- package/src/components/icons/icon-drag.vue +20 -0
- package/src/components/icons/icon-file-text.vue +21 -0
- package/src/components/icons/icon-folder.vue +18 -0
- package/src/components/icons/icon-grid.vue +17 -0
- package/src/components/icons/icon-group.vue +19 -0
- package/src/components/icons/icon-home.vue +16 -0
- package/src/components/icons/icon-image.vue +18 -0
- package/src/components/icons/icon-list.vue +20 -0
- package/src/components/icons/icon-more.vue +17 -0
- package/src/components/icons/icon-plus.vue +17 -0
- package/src/components/icons-types/icon-array.vue +22 -0
- package/src/components/icons-types/icon-boolean.vue +18 -0
- package/src/components/icons-types/icon-datalist.vue +22 -0
- package/src/components/icons-types/icon-date.vue +20 -0
- package/src/components/icons-types/icon-datetime.vue +20 -0
- package/src/components/icons-types/icon-file.vue +21 -0
- package/src/components/icons-types/icon-gallery.vue +18 -0
- package/src/components/icons-types/icon-image.vue +19 -0
- package/src/components/icons-types/icon-integer.vue +20 -0
- package/src/components/icons-types/icon-merkdown.vue +18 -0
- package/src/components/icons-types/icon-multiselect.vue +22 -0
- package/src/components/icons-types/icon-number.vue +20 -0
- package/src/components/icons-types/icon-radio.vue +22 -0
- package/src/components/icons-types/icon-reference-list.vue +22 -0
- package/src/components/icons-types/icon-reference.vue +20 -0
- package/src/components/icons-types/icon-relation.vue +22 -0
- package/src/components/icons-types/icon-richtext.vue +18 -0
- package/src/components/icons-types/icon-select.vue +22 -0
- package/src/components/icons-types/icon-slug.vue +19 -0
- package/src/components/icons-types/icon-text.vue +19 -0
- package/src/components/icons-types/index.js +43 -0
- package/src/components/layout/Layout.vue +67 -0
- package/src/components/layout/Sidebar.vue +128 -0
- package/src/components/media/FileUploadProgress.vue +29 -0
- package/src/components/media/MediaBreadcrumb.vue +42 -0
- package/src/components/media/MediaCreateFolder.vue +59 -0
- package/src/components/media/MediaFileInfo.vue +148 -0
- package/src/components/media/MediaGrid.vue +148 -0
- package/src/components/media/MediaList.vue +148 -0
- package/src/components/media/MediaViewControls.vue +38 -0
- package/src/components/media/TypeTag.vue +23 -0
- package/src/components/menu/AddNewItemInTree.vue +75 -0
- package/src/components/menu/MenuBody.vue +149 -0
- package/src/components/menu/MenuItem.vue +73 -0
- package/src/components/menu/MenuList.vue +101 -0
- package/src/components/referencec/index.ts +7 -0
- package/src/components/referencec/vs-reference-faq.vue +61 -0
- package/src/components/referencec/vs-reference-user-card.vue +40 -0
- package/src/components/settings/NotificationSettings.vue +32 -0
- package/src/components/settings/SettingsTable.vue +50 -0
- package/src/components/settings/SettingsTitle.vue +33 -0
- package/src/components/settings/SettingsToggleItem.vue +25 -0
- package/src/components/sidebar/DropdownMenu.vue +34 -0
- package/src/components/sidebar/SettingsSidebar.vue +121 -0
- package/src/components/sidebar/SidebarFooter.vue +52 -0
- package/src/components/sidebar/SidebarHeader.vue +57 -0
- package/src/components/sidebar/SidebarMenu.vue +78 -0
- package/src/components/ui/EmptyData.vue +76 -0
- package/src/components/ui/UniversalTable.vue +310 -0
- package/src/components/ui/UniversalTableFilters.vue +0 -0
- package/src/components/ui/UniversalTablePagination.vue +118 -0
- package/src/components/ui/VsPreview.vue +75 -0
- package/src/composables/useCollectionView.ts +21 -0
- package/src/composables/useDebounce.ts +26 -0
- package/src/composables/useMonaco.ts +28 -0
- package/src/composables/useTheme.ts +40 -0
- package/src/content/test-slug/metadata.json +1 -0
- package/src/i18n.ts +75 -0
- package/src/index.css +3 -0
- package/src/locales/en.json +778 -0
- package/src/locales/uk.json +797 -0
- package/src/main.ts +41 -0
- package/src/pages/Dashboard.vue +168 -0
- package/src/pages/EmailPage.vue +183 -0
- package/src/pages/FeedbackPage.vue +232 -0
- package/src/pages/MediaPage.vue +372 -0
- package/src/pages/TagsPage.vue +207 -0
- package/src/pages/builder/BuilderPage.vue +195 -0
- package/src/pages/builder/EditCollectionPage.vue +163 -0
- package/src/pages/collections/ArticlesPage.vue +385 -0
- package/src/pages/collections/CollectionsPage.vue +146 -0
- package/src/pages/collections/SingletonsPage.vue +119 -0
- package/src/pages/collections/contentForm.vue +484 -0
- package/src/pages/collections/schema/seo.ts +27 -0
- package/src/pages/menu/MenuAddPage.vue +123 -0
- package/src/pages/menu/MenuItemPage.vue +183 -0
- package/src/pages/menu/MenuPage.vue +133 -0
- package/src/pages/settings/ApiKeys.vue +75 -0
- package/src/pages/settings/Appearance.vue +80 -0
- package/src/pages/settings/Logs.vue +260 -0
- package/src/pages/settings/PermissionsPage.vue +237 -0
- package/src/pages/settings/Settings.vue +186 -0
- package/src/pages/settings/Users.vue +109 -0
- package/src/pages/settings/general.vue +154 -0
- package/src/pages/settings/generalScheme.js +132 -0
- package/src/pages/users/AddUser.vue +106 -0
- package/src/pages/users/UsersPage.vue +98 -0
- package/src/props/builder.ts +67 -0
- package/src/props/content.ts +56 -0
- package/src/props/media.ts +63 -0
- package/src/router/index.ts +181 -0
- package/src/types/fastify-auth.d.ts +4 -0
- package/src/utils/getField.js +270 -0
- package/src/utils/translit.js +19 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex space-x-1 z-10"
|
|
4
|
+
>
|
|
5
|
+
<button
|
|
6
|
+
@click="isOpen = !isOpen"
|
|
7
|
+
class="p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"
|
|
8
|
+
>
|
|
9
|
+
<Edit class="h-4 w-4 text-gray-400" />
|
|
10
|
+
</button>
|
|
11
|
+
<button
|
|
12
|
+
@click="model = {}"
|
|
13
|
+
class="p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors"
|
|
14
|
+
>
|
|
15
|
+
<Trash2 class="h-4 w-4 text-red-500" />
|
|
16
|
+
</button>
|
|
17
|
+
<VsDrower v-model:visible="isOpen" @close="isOpen = false" :title="title">
|
|
18
|
+
<VsForm
|
|
19
|
+
v-model:form="form"
|
|
20
|
+
v-if="schema"
|
|
21
|
+
:schema="schema"
|
|
22
|
+
v-model="formValue"
|
|
23
|
+
class="-mr-[10px] ml-[10px] mt-[10px]"
|
|
24
|
+
/>
|
|
25
|
+
<template #footer>
|
|
26
|
+
<div
|
|
27
|
+
class="flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700"
|
|
28
|
+
>
|
|
29
|
+
<button
|
|
30
|
+
class="px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600"
|
|
31
|
+
>
|
|
32
|
+
{{ $t("common.actions.cancel") }}
|
|
33
|
+
</button>
|
|
34
|
+
<button
|
|
35
|
+
@click="handleSave"
|
|
36
|
+
class="px-4 py-2 bg-sky-600 text-white rounded-md text-sm font-medium hover:bg-sky-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500"
|
|
37
|
+
>
|
|
38
|
+
{{ $t("common.actions.save") }}
|
|
39
|
+
</button>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
</VsDrower>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script setup>
|
|
47
|
+
import { Edit, Trash2 } from "lucide-vue-next";
|
|
48
|
+
import { ref, watch } from "vue";
|
|
49
|
+
import VsForm from "@opengis/form";
|
|
50
|
+
import { notify } from '@opengis/core';
|
|
51
|
+
import { useI18n } from "vue-i18n";
|
|
52
|
+
|
|
53
|
+
const { t } = useI18n();
|
|
54
|
+
|
|
55
|
+
const props = defineProps({
|
|
56
|
+
title: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: true,
|
|
59
|
+
},
|
|
60
|
+
schema: {
|
|
61
|
+
type: Object,
|
|
62
|
+
required: true,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const model = defineModel({
|
|
67
|
+
type: Object,
|
|
68
|
+
default: () => ({}),
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const isOpen = ref(false);
|
|
72
|
+
const formValue = ref({});
|
|
73
|
+
|
|
74
|
+
const form = ref({});
|
|
75
|
+
|
|
76
|
+
watch(isOpen, (newVal) => {
|
|
77
|
+
if (newVal) {
|
|
78
|
+
formValue.value = { ...model.value };
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const handleSave = async () => {
|
|
83
|
+
try {
|
|
84
|
+
let result = await form.value.validate();
|
|
85
|
+
if (result) {
|
|
86
|
+
notify({
|
|
87
|
+
type: "warning",
|
|
88
|
+
title: t("common.actions.warning"),
|
|
89
|
+
message: t("builder.editFieldFailed"),
|
|
90
|
+
});
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
model.value = { ...formValue.value };
|
|
94
|
+
isOpen.value = false;
|
|
95
|
+
} catch (error) {
|
|
96
|
+
console.log(error);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
text: "reference.faq",
|
|
4
|
+
id: "faq",
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
text: "reference.banner",
|
|
8
|
+
id: "banner",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
text: "reference.slider",
|
|
12
|
+
id: "slider",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
text: "reference.photoGrid",
|
|
16
|
+
id: "photoGrid",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
text: "reference.video",
|
|
20
|
+
id: "video",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
text: "reference.about",
|
|
24
|
+
id: "about",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
text: "reference.cards",
|
|
28
|
+
id: "cards",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
text: "reference.usefulLinks",
|
|
32
|
+
id: "usefulLinks",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
text: "reference.team",
|
|
36
|
+
id: "team",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
text: "reference.body",
|
|
40
|
+
id: "body",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
text: "reference.news",
|
|
44
|
+
id: "news",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
text: "reference.form",
|
|
48
|
+
id: "form",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
text: "reference.tabs",
|
|
52
|
+
id: "tabs",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
text: "reference.vertical_tabs",
|
|
56
|
+
id: "vertical_tabs",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
text: "reference.documents",
|
|
60
|
+
id: "documents",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
text: "reference.infoLine",
|
|
64
|
+
id: "infoLine",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
text: "reference.interested",
|
|
68
|
+
id: "interested",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
text: "reference.contact",
|
|
72
|
+
id: "contact",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
text: "reference.iframe",
|
|
76
|
+
id: "iframe",
|
|
77
|
+
},
|
|
78
|
+
]
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<button
|
|
4
|
+
type="button"
|
|
5
|
+
class="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500"
|
|
6
|
+
@click="isOpen = !isOpen"
|
|
7
|
+
>
|
|
8
|
+
{{ $t("builder.create") }}
|
|
9
|
+
</button>
|
|
10
|
+
<VsDrawer
|
|
11
|
+
v-model:visible="isOpen"
|
|
12
|
+
position="right"
|
|
13
|
+
:closeClickBackdrop="false"
|
|
14
|
+
@close="isOpen = false"
|
|
15
|
+
:title="reference_type ? $t('builder.' + reference_type) : $t('builder.selectType')"
|
|
16
|
+
:size="'50vw'"
|
|
17
|
+
>
|
|
18
|
+
<VsFormReferenceChoce
|
|
19
|
+
v-if="!reference_type"
|
|
20
|
+
v-model="reference_type"
|
|
21
|
+
:options="referenceOptionList"
|
|
22
|
+
/>
|
|
23
|
+
<template v-else>
|
|
24
|
+
<div class="flex gap-4">
|
|
25
|
+
<div
|
|
26
|
+
class="text-sm text-gray-500 dark:text-gray-400 border flex items-center h-10 px-4 rounded-lg w-full"
|
|
27
|
+
>
|
|
28
|
+
<span>
|
|
29
|
+
{{ referenceOptionList.find((item) => item.id === reference_type)?.text }}
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
32
|
+
<button
|
|
33
|
+
class="py-2.5 px-3 mb-4 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"
|
|
34
|
+
@click="reference_type = null"
|
|
35
|
+
>
|
|
36
|
+
{{ $t("builder.changeType") }}
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
<VForm
|
|
40
|
+
v-if="scheme"
|
|
41
|
+
:key="reference_type"
|
|
42
|
+
:schema="scheme"
|
|
43
|
+
v-model="formValue"
|
|
44
|
+
v-model:form="form"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
<template #footer>
|
|
48
|
+
<div
|
|
49
|
+
class="flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700"
|
|
50
|
+
>
|
|
51
|
+
<button
|
|
52
|
+
@click="isOpen = false"
|
|
53
|
+
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"
|
|
54
|
+
>
|
|
55
|
+
{{ $t("builder.cancel") }}
|
|
56
|
+
</button>
|
|
57
|
+
<button
|
|
58
|
+
@click="handleCreate"
|
|
59
|
+
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"
|
|
60
|
+
>
|
|
61
|
+
{{ $t("builder.create") }}
|
|
62
|
+
</button>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
</VsDrawer>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script setup>
|
|
70
|
+
import { ref, computed, watch } from "vue";
|
|
71
|
+
import { testReferenceTypes } from "../testReferenceTypes";
|
|
72
|
+
import VsFormReferenceChoce from "./vs-form-reference-choce.vue";
|
|
73
|
+
import referenceOptionList from "./referenceOptionList";
|
|
74
|
+
import { notify } from '@opengis/core';
|
|
75
|
+
import VsEditor from "@/components/form-components/vs-form-tiptap.vue";
|
|
76
|
+
import {VForm,inputs} from "@opengis/form";
|
|
77
|
+
// import {VForm,inputs} from "../../../../../form/src/index";
|
|
78
|
+
import { VsDrawer } from "@opengis/core";
|
|
79
|
+
import { useI18n } from "vue-i18n";
|
|
80
|
+
import VsReference from "../vs-form-reference-list.vue";
|
|
81
|
+
|
|
82
|
+
const { t } = useI18n();
|
|
83
|
+
|
|
84
|
+
inputs['vs-input-reference'] = VsReference;
|
|
85
|
+
inputs['vs-input-tiptap-editor'] = VsEditor;
|
|
86
|
+
|
|
87
|
+
const props = defineProps({
|
|
88
|
+
title: {
|
|
89
|
+
type: String,
|
|
90
|
+
required: true,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const model = defineModel({
|
|
95
|
+
type: Array,
|
|
96
|
+
default: () => [],
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const isOpen = ref(false);
|
|
100
|
+
const form = ref({});
|
|
101
|
+
const reference_type = ref(null);
|
|
102
|
+
const formValue = ref({});
|
|
103
|
+
|
|
104
|
+
const scheme = computed(() => {
|
|
105
|
+
return testReferenceTypes[reference_type.value]?.schema || null;
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const handleCreate = async () => {
|
|
109
|
+
let result = await form.value.validate();
|
|
110
|
+
if (result) {
|
|
111
|
+
notify({
|
|
112
|
+
type: "warning",
|
|
113
|
+
title: t("common.actions.warning"),
|
|
114
|
+
message: t("builder.editFieldFailed"),
|
|
115
|
+
});
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
if (Object.keys(formValue.value).length !== 0) {
|
|
120
|
+
model.value = [
|
|
121
|
+
...(model.value || []),
|
|
122
|
+
{
|
|
123
|
+
...formValue.value,
|
|
124
|
+
id: Math.random().toString(36).substring(2, 15),
|
|
125
|
+
reference_type: reference_type.value,
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
isOpen.value = false;
|
|
130
|
+
reference_type.value = null;
|
|
131
|
+
formValue.value = {};
|
|
132
|
+
} catch (error) {
|
|
133
|
+
console.log(error);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
watch(isOpen, () => {
|
|
138
|
+
if (!isOpen.value) {
|
|
139
|
+
reference_type.value = null;
|
|
140
|
+
formValue.value = {};
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
</script>
|
|
144
|
+
|
|
145
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="grid grid-cols-1 md:grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-4">
|
|
3
|
+
<div
|
|
4
|
+
v-for="item in referenceOptionList"
|
|
5
|
+
:key="item.id"
|
|
6
|
+
@click="model = item.id"
|
|
7
|
+
class="relative"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class="wireframe-block h-[240px] !p-4 border-2 border-dashed bg-white relative overflow-hidden transition-all rounded-lg shadow-sm border-gray-300 hover:border-gray-400 cursor-pointer"
|
|
11
|
+
>
|
|
12
|
+
<component
|
|
13
|
+
v-if="referenceSkeleton[item.id]"
|
|
14
|
+
:is="referenceSkeleton[item.id]"
|
|
15
|
+
:text="item?.text"
|
|
16
|
+
:count="item?.data || 0"
|
|
17
|
+
/>
|
|
18
|
+
<img
|
|
19
|
+
v-else
|
|
20
|
+
:src="icon"
|
|
21
|
+
alt="Team collaboration"
|
|
22
|
+
class="w-full h-full object-cover"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script setup>
|
|
30
|
+
import icon from "../../../assets/image.png";
|
|
31
|
+
import referenceOptionList from "./referenceOptionList";
|
|
32
|
+
import referenceSkeleton from "../reference-skeleton";
|
|
33
|
+
|
|
34
|
+
const model = defineModel({
|
|
35
|
+
type: String,
|
|
36
|
+
required: true,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex space-x-1 z-10"
|
|
4
|
+
>
|
|
5
|
+
<button
|
|
6
|
+
@click="isOpen = !isOpen"
|
|
7
|
+
class="p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors border border-gray-200 dark:border-gray-700"
|
|
8
|
+
>
|
|
9
|
+
<Edit class="h-4 w-4 text-gray-400" />
|
|
10
|
+
</button>
|
|
11
|
+
<button
|
|
12
|
+
@click="parent = parent.filter((item) => item.id !== model.id)"
|
|
13
|
+
class="p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors border border-gray-200 dark:border-gray-700"
|
|
14
|
+
>
|
|
15
|
+
<Trash2 class="h-4 w-4 text-red-500" />
|
|
16
|
+
</button>
|
|
17
|
+
<VsDrawer v-model:visible="isOpen" @close="isOpen = false" :title="title" :width="'50vw'">
|
|
18
|
+
<VForm
|
|
19
|
+
v-model:form="form"
|
|
20
|
+
v-if="schema"
|
|
21
|
+
:schema="schema"
|
|
22
|
+
v-model="formValue"
|
|
23
|
+
class="-mr-[10px] ml-[10px] mt-[10px]"
|
|
24
|
+
/>
|
|
25
|
+
<template #footer>
|
|
26
|
+
<div
|
|
27
|
+
class="flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700"
|
|
28
|
+
>
|
|
29
|
+
<button
|
|
30
|
+
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"
|
|
31
|
+
@click="isOpen = false"
|
|
32
|
+
>
|
|
33
|
+
{{ $t("common.actions.cancel") }}
|
|
34
|
+
</button>
|
|
35
|
+
<button
|
|
36
|
+
@click="handleSave"
|
|
37
|
+
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"
|
|
38
|
+
>
|
|
39
|
+
{{ $t("common.actions.save") }}
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
</VsDrawer>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup>
|
|
48
|
+
import { Edit, Trash2 } from "lucide-vue-next";
|
|
49
|
+
import { ref, watch, computed } from "vue";
|
|
50
|
+
import { testReferenceTypes } from "../testReferenceTypes";
|
|
51
|
+
import { VForm, inputs } from "@opengis/form";
|
|
52
|
+
|
|
53
|
+
import { VsDrawer } from "@opengis/core";
|
|
54
|
+
import { notify } from '@opengis/core';
|
|
55
|
+
import { useI18n } from "vue-i18n";
|
|
56
|
+
|
|
57
|
+
const { t } = useI18n();
|
|
58
|
+
|
|
59
|
+
const props = defineProps({
|
|
60
|
+
title: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: true,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const model = defineModel({
|
|
67
|
+
type: Object,
|
|
68
|
+
default: () => ({}),
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const parent = defineModel("parent", {
|
|
72
|
+
type: Array,
|
|
73
|
+
default: () => [],
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const isOpen = ref(false);
|
|
77
|
+
const formValue = ref({});
|
|
78
|
+
|
|
79
|
+
const form = ref({});
|
|
80
|
+
|
|
81
|
+
const schema = computed(() => {
|
|
82
|
+
return testReferenceTypes[model.value.reference_type]?.schema || null;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
watch(isOpen, (newVal) => {
|
|
86
|
+
if (newVal) {
|
|
87
|
+
formValue.value = { ...model.value };
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const handleSave = async () => {
|
|
92
|
+
try {
|
|
93
|
+
let result = await form.value.validate();
|
|
94
|
+
if (result) {
|
|
95
|
+
notify({
|
|
96
|
+
type: "warning",
|
|
97
|
+
title: t("common.actions.warning"),
|
|
98
|
+
message: t("builder.editFieldFailed"),
|
|
99
|
+
});
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
model.value = { ...formValue.value };
|
|
103
|
+
isOpen.value = false;
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.log(error);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="h-full w-full flex flex-col">
|
|
3
|
+
<div class="flex flex-1">
|
|
4
|
+
<div class="flex-1 pr-2">
|
|
5
|
+
<div class="h-4 bg-gray-400 rounded mb-2"></div>
|
|
6
|
+
<div class="space-y-1.5">
|
|
7
|
+
<div class="h-2 bg-gray-300 rounded"></div>
|
|
8
|
+
<div class="h-2 bg-gray-300 rounded"></div>
|
|
9
|
+
<div class="h-2 bg-gray-300 rounded w-4/5"></div>
|
|
10
|
+
<div class="h-2 bg-gray-300 rounded"></div>
|
|
11
|
+
<div class="h-2 bg-gray-300 rounded w-3/4"></div>
|
|
12
|
+
<div class="h-2 bg-gray-300 rounded"></div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="w-16 h-20 bg-gray-200 rounded flex items-center justify-center">
|
|
16
|
+
<div class="w-6 h-6 bg-gray-300 rounded-full"></div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="flex justify-between items-center mt-2 pt-2 border-t border-gray-300">
|
|
20
|
+
<div class="text-xs font-medium text-gray-600">{{ $t(text) }}</div>
|
|
21
|
+
<div class="text-xs text-gray-500" v-if="count && count > 0">{{ count }}</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup>
|
|
27
|
+
defineProps({
|
|
28
|
+
text: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
count: {
|
|
33
|
+
type: Number,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="h-full w-full flex flex-col">
|
|
3
|
+
<div class="flex-1 bg-gray-200 rounded relative">
|
|
4
|
+
<div class="absolute inset-0 flex items-center justify-center">
|
|
5
|
+
<div class="w-16 h-10 bg-gray-300 rounded"></div>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="absolute bottom-2 left-2">
|
|
8
|
+
<div class="h-3 bg-gray-400 rounded w-16"></div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="flex justify-between items-center mt-2 pt-2 border-t border-gray-300">
|
|
12
|
+
<div class="text-xs font-medium text-gray-600">{{ $t(text) }}</div>
|
|
13
|
+
<div class="text-xs text-gray-500" v-if="count && count > 0">{{ count }}</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
defineProps({
|
|
20
|
+
text: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
count: {
|
|
25
|
+
type: Number,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="h-full flex flex-col">
|
|
3
|
+
<div class="grid grid-cols-3 gap-2 flex-1">
|
|
4
|
+
<div class="flex flex-col">
|
|
5
|
+
<div class="h-3 bg-gray-400 rounded mb-2"></div>
|
|
6
|
+
<div class="space-y-1.5">
|
|
7
|
+
<div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5">
|
|
8
|
+
<div class="h-1.5 bg-gray-300 rounded w-3/4"></div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5">
|
|
11
|
+
<div class="h-1.5 bg-gray-300 rounded w-3/4"></div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="flex flex-col">
|
|
16
|
+
<div class="h-3 bg-gray-400 rounded mb-2"></div>
|
|
17
|
+
<div class="space-y-1.5">
|
|
18
|
+
<div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5">
|
|
19
|
+
<div class="h-1.5 bg-gray-300 rounded w-3/4"></div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5">
|
|
22
|
+
<div class="h-1.5 bg-gray-300 rounded w-3/4"></div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="flex flex-col">
|
|
27
|
+
<div class="h-3 bg-gray-400 rounded mb-2"></div>
|
|
28
|
+
<div class="space-y-1.5">
|
|
29
|
+
<div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5">
|
|
30
|
+
<div class="h-1.5 bg-gray-300 rounded w-3/4"></div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5">
|
|
33
|
+
<div class="h-1.5 bg-gray-300 rounded w-3/4"></div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="flex justify-between items-center mt-2 pt-2 border-t border-gray-300">
|
|
39
|
+
<div class="text-xs font-medium text-gray-600">{{ $t(text) }}</div>
|
|
40
|
+
<div class="text-xs text-gray-500" v-if="count && count > 0">{{ count }}</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup>
|
|
46
|
+
defineProps({
|
|
47
|
+
text: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
count: {
|
|
52
|
+
type: Number,
|
|
53
|
+
required: true,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="h-full w-full flex flex-col">
|
|
3
|
+
<div class="flex-1 grid grid-cols-3 gap-1.5">
|
|
4
|
+
<div class="bg-gray-200 rounded p-1.5 flex flex-col">
|
|
5
|
+
<div class="flex-1 bg-gray-300 rounded mb-1"></div>
|
|
6
|
+
<div class="h-1.5 bg-gray-400 rounded"></div>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="bg-gray-200 rounded p-1.5 flex flex-col">
|
|
9
|
+
<div class="flex-1 bg-gray-300 rounded mb-1"></div>
|
|
10
|
+
<div class="h-1.5 bg-gray-400 rounded"></div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="bg-gray-200 rounded p-1.5 flex flex-col">
|
|
13
|
+
<div class="flex-1 bg-gray-300 rounded mb-1"></div>
|
|
14
|
+
<div class="h-1.5 bg-gray-400 rounded"></div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="bg-gray-200 rounded p-1.5 flex flex-col">
|
|
17
|
+
<div class="flex-1 bg-gray-300 rounded mb-1"></div>
|
|
18
|
+
<div class="h-1.5 bg-gray-400 rounded"></div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="bg-gray-200 rounded p-1.5 flex flex-col">
|
|
21
|
+
<div class="flex-1 bg-gray-300 rounded mb-1"></div>
|
|
22
|
+
<div class="h-1.5 bg-gray-400 rounded"></div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="bg-gray-200 rounded p-1.5 flex flex-col">
|
|
25
|
+
<div class="flex-1 bg-gray-300 rounded mb-1"></div>
|
|
26
|
+
<div class="h-1.5 bg-gray-400 rounded"></div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="flex justify-between items-center mt-2 pt-2 border-t border-gray-300">
|
|
30
|
+
<div class="text-xs font-medium text-gray-600">{{ $t(text) }}</div>
|
|
31
|
+
<div class="text-xs text-gray-500" v-if="count && count > 0">{{ count }}</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup>
|
|
37
|
+
defineProps({
|
|
38
|
+
text: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
count: {
|
|
43
|
+
type: Number,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
</script>
|