@mapomodule/uikit 1.0.0 → 2.0.0-beta.1
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 +167 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +18 -0
- package/dist/module.d.cts +2 -0
- package/dist/module.d.mts +2 -0
- package/dist/module.d.ts +2 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +18 -0
- package/dist/types.d.mts +13 -0
- package/package.json +63 -12
- package/src/index.ts +10 -0
- package/src/module.ts +181 -0
- package/src/runtime/assets/main.css +59 -0
- package/src/runtime/components/MapoConfirmDialog.vue +34 -0
- package/src/runtime/components/MapoDetail.vue +861 -0
- package/src/runtime/components/MapoDetailLangSwitch.vue +166 -0
- package/src/runtime/components/MapoList.vue +339 -0
- package/src/runtime/components/MapoListActions.vue +152 -0
- package/src/runtime/components/MapoListFilters.vue +289 -0
- package/src/runtime/components/MapoListHead.vue +12 -0
- package/src/runtime/components/MapoListQuickEdit.vue +163 -0
- package/src/runtime/components/MapoListTable.vue +926 -0
- package/src/runtime/components/MapoListTabs.vue +48 -0
- package/src/runtime/components/MapoLogin.vue +209 -0
- package/src/runtime/components/MapoLogoutButton.vue +46 -0
- package/src/runtime/components/MapoRootComponents.vue +9 -0
- package/src/runtime/components/MapoSidebar.vue +112 -0
- package/src/runtime/components/MapoSidebarList.vue +35 -0
- package/src/runtime/components/MapoSidebarListItem.vue +79 -0
- package/src/runtime/components/MapoSidebarProfile.vue +57 -0
- package/src/runtime/components/MapoSnackBar.vue +42 -0
- package/src/runtime/components/MapoThemeToggle.vue +23 -0
- package/src/runtime/components/MapoTopbar.vue +36 -0
- package/src/runtime/layouts/default.vue +53 -0
- package/src/runtime/layouts/empty.vue +9 -0
- package/src/runtime/page-meta.nuxt.d.ts +45 -0
- package/src/runtime/pages/index.vue +14 -0
- package/src/runtime/pages/login.vue +7 -0
- package/src/runtime/types/list.ts +64 -0
- package/CHANGELOG.md +0 -1030
- package/assets/mixins.scss +0 -22
- package/assets/variables.scss +0 -18
- package/components/ConfirmDialog.vue +0 -173
- package/components/Detail/Detail.vue +0 -696
- package/components/Detail/DetailLangSwitch.vue +0 -79
- package/components/DropArea.vue +0 -257
- package/components/Form/Form.vue +0 -218
- package/components/Form/FormField.vue +0 -216
- package/components/Form/FormGroup.vue +0 -146
- package/components/Form/FormTabs.vue +0 -188
- package/components/Form/defaults.js +0 -98
- package/components/Form/fields/ColorField.vue +0 -79
- package/components/Form/fields/DateField.vue +0 -77
- package/components/Form/fields/DateTimeField.vue +0 -271
- package/components/Form/fields/EnhancedMediaField.vue +0 -224
- package/components/Form/fields/FileField.vue +0 -125
- package/components/Form/fields/FksField.vue +0 -115
- package/components/Form/fields/MediaField.vue +0 -159
- package/components/Form/fields/MediaM2mField.vue +0 -149
- package/components/Form/fields/Repeater.vue +0 -618
- package/components/Form/fields/SeoPreview.vue +0 -89
- package/components/Form/fields/TimeField.vue +0 -154
- package/components/Form/fields/mapField/leaflet.injector.js +0 -39
- package/components/Form/fields/mapField/mapField.vue +0 -350
- package/components/Form/fields/wygEditor/defaults.js +0 -25
- package/components/Form/fields/wygEditor/utils/events.js +0 -64
- package/components/Form/fields/wygEditor/utils/mapomedia.plugin.js +0 -32
- package/components/Form/fields/wygEditor/utils/tinymce.injector.js +0 -29
- package/components/Form/fields/wygEditor/wygEditor.vue +0 -285
- package/components/Form/fields/wygEditorCKE/defaults.js +0 -103
- package/components/Form/fields/wygEditorCKE/utils/ckeditor.injector.js +0 -29
- package/components/Form/fields/wygEditorCKE/wygEditorCKE.vue +0 -270
- package/components/LangSwitcher.vue +0 -44
- package/components/List/List.vue +0 -271
- package/components/List/ListActions.vue +0 -164
- package/components/List/ListFilters.vue +0 -372
- package/components/List/ListHead.vue +0 -67
- package/components/List/ListQuickEdit.vue +0 -228
- package/components/List/ListTable.vue +0 -484
- package/components/List/ListTabs.vue +0 -65
- package/components/Login.vue +0 -125
- package/components/Logo.vue +0 -79
- package/components/LogoutButton.vue +0 -54
- package/components/MediaManager/MediaBreadcrumbs.vue +0 -45
- package/components/MediaManager/MediaEditor.vue +0 -340
- package/components/MediaManager/MediaFileChanger.vue +0 -78
- package/components/MediaManager/MediaFolders.vue +0 -287
- package/components/MediaManager/MediaGallery.vue +0 -281
- package/components/MediaManager/MediaManager.vue +0 -159
- package/components/MediaManager/MediaManagerDialog.vue +0 -104
- package/components/MediaManager/MediaPreview.vue +0 -258
- package/components/MediaManager/MediaUploader.vue +0 -163
- package/components/MenuManager/MenuManager.vue +0 -332
- package/components/MenuManager/MenuNodeEditor.vue +0 -270
- package/components/MenuManager/MenuTreeview.vue +0 -237
- package/components/MenuManager/MenuTreeviewNode.vue +0 -208
- package/components/PagePreview.vue +0 -58
- package/components/RootComponents.vue +0 -25
- package/components/SnackBar.vue +0 -69
- package/components/ThemeToggle.vue +0 -13
- package/components/layout/Sidebar/Sidebar.vue +0 -89
- package/components/layout/Sidebar/SidebarList.vue +0 -49
- package/components/layout/Sidebar/SidebarListItem.vue +0 -185
- package/components/layout/Sidebar/SidebarProfile.vue +0 -42
- package/components/layout/Sidebar/SidebarTitle.vue +0 -45
- package/components/layout/Topbar/Topbar.vue +0 -29
- package/components/layout/routebuilder.js +0 -48
- package/defaults/i18n.js +0 -37
- package/defaults/vuetify.js +0 -34
- package/layouts/default.vue +0 -47
- package/layouts/empty.vue +0 -16
- package/module.js +0 -80
- package/pages/index.vue +0 -37
- package/pages/login.vue +0 -10
- package/static/mapo/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/dev/contents.css +0 -35
- package/static/mapo/ckeditor/plugins/image2/dev/image2.html +0 -338
- package/static/mapo/ckeditor/plugins/image2/dialogs/image2.js +0 -557
- package/static/mapo/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
- package/static/mapo/ckeditor/plugins/image2/icons/image.png +0 -0
- package/static/mapo/ckeditor/plugins/image2/lang/af.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ar.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/az.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/bg.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/bn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/bs.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ca.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/cs.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/cy.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/da.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/de-ch.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/de.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/el.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en-au.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en-ca.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en-gb.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/eo.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/es-mx.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/es.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/et.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/eu.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fa.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fi.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fo.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fr-ca.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/gl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/gu.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/he.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/hi.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/hr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/hu.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/id.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/is.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/it.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ja.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ka.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/km.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ko.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ku.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/lt.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/lv.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/mk.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/mn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ms.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/nb.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/nl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/no.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/oc.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/pl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/pt-br.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/pt.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ro.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ru.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/si.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sk.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sq.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sr-latn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sv.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/th.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/tr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/tt.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ug.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/uk.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/vi.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/zh-cn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/zh.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/plugin.js +0 -1798
- package/static/mapo/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/samples/image2.html +0 -68
- package/static/mapo/ckeditor/skins/moono/dev/icons16.png +0 -0
- package/static/mapo/ckeditor/skins/moono/dev/icons16.svg +0 -2374
- package/static/mapo/ckeditor/skins/moono/dev/icons32.png +0 -0
- package/static/mapo/ckeditor/skins/moono/dev/icons32.svg +0 -2722
- package/static/mapo/ckeditor/skins/moono/dev/locations.json +0 -144
- package/static/mapo/ckeditor/skins/moono/dialog.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_gecko.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono/icons.png +0 -0
- package/static/mapo/ckeditor/skins/moono/icons_hidpi.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/anchor.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/arrow.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/anchor.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/spinner.gif +0 -0
- package/static/mapo/ckeditor/skins/moono/readme.md +0 -49
- package/static/mapo/ckeditor/skins/moono/skin.js +0 -10
- package/static/mapo/ckeditor/skins/moono-dark/dialog.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_gecko.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/icons.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/icons_hidpi.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/arrow.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/readme.md +0 -51
- package/static/mapo/ckeditor/skins/moono-dark/skin.js +0 -5
- package/static/mapo/favicon.ico +0 -0
- package/static/mapo/tinymce-skins/mapo-dark/content.inline.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/content.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/content.mobile.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/skin.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/skin.mobile.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/content.inline.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/content.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/content.mobile.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/skin.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/skin.mobile.min.css +0 -7
- package/translations/en-US.js +0 -177
- package/translations/it-IT.js +0 -180
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-menu
|
|
4
|
-
v-model="menu"
|
|
5
|
-
:close-on-content-click="false"
|
|
6
|
-
transition="scale-transition"
|
|
7
|
-
offset-y
|
|
8
|
-
min-width="auto"
|
|
9
|
-
>
|
|
10
|
-
<template v-slot:activator="{ on, attrs }">
|
|
11
|
-
<v-text-field
|
|
12
|
-
v-model="model"
|
|
13
|
-
readonly
|
|
14
|
-
v-bind="{ ...$attrs, ...attrs }"
|
|
15
|
-
v-on="readonly ? undefined : on"
|
|
16
|
-
class="rounded-inherit"
|
|
17
|
-
>
|
|
18
|
-
<template v-if="model" v-slot:append>
|
|
19
|
-
<div class="color-picker-inner-icon" :style="`background-color: ${model}`"></div>
|
|
20
|
-
</template>
|
|
21
|
-
</v-text-field>
|
|
22
|
-
</template>
|
|
23
|
-
<v-card>
|
|
24
|
-
<v-color-picker
|
|
25
|
-
v-model="model"
|
|
26
|
-
mode="hexa"
|
|
27
|
-
hide-mode-switch
|
|
28
|
-
v-bind="$attrs"
|
|
29
|
-
v-on="$listeners"
|
|
30
|
-
></v-color-picker>
|
|
31
|
-
</v-card>
|
|
32
|
-
</v-menu>
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<style scoped>
|
|
37
|
-
.color-picker-inner-icon {
|
|
38
|
-
width: 20px;
|
|
39
|
-
height: 20px;
|
|
40
|
-
border-radius: 20px;
|
|
41
|
-
}
|
|
42
|
-
.rounded-inherit{
|
|
43
|
-
border-radius: inherit;
|
|
44
|
-
}
|
|
45
|
-
</style>
|
|
46
|
-
|
|
47
|
-
<script>
|
|
48
|
-
/**
|
|
49
|
-
* This component wraps vuetify's color picker as a Mapo field.
|
|
50
|
-
*/
|
|
51
|
-
export default {
|
|
52
|
-
name: "ColorField",
|
|
53
|
-
data() {
|
|
54
|
-
return {
|
|
55
|
-
model: this.value || "",
|
|
56
|
-
menu: null,
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
props: {
|
|
60
|
-
// V-model property. Color must be hex codified.
|
|
61
|
-
value: {
|
|
62
|
-
type: String,
|
|
63
|
-
},
|
|
64
|
-
// This set the component status to readonly, stopping the user interaction.
|
|
65
|
-
readonly: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: false,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
watch: {
|
|
71
|
-
value(val) {
|
|
72
|
-
this.model = val || "";
|
|
73
|
-
},
|
|
74
|
-
model(val) {
|
|
75
|
-
this.$emit("input", val);
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
</script>
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-menu
|
|
4
|
-
ref="menu"
|
|
5
|
-
v-model="menu"
|
|
6
|
-
:close-on-content-click="false"
|
|
7
|
-
:return-value.sync="model"
|
|
8
|
-
transition="scale-transition"
|
|
9
|
-
offset-y
|
|
10
|
-
min-width="auto"
|
|
11
|
-
>
|
|
12
|
-
<template v-slot:activator="{ on, attrs }">
|
|
13
|
-
<v-text-field
|
|
14
|
-
v-model="model"
|
|
15
|
-
prepend-inner-icon="mdi-calendar"
|
|
16
|
-
readonly
|
|
17
|
-
v-bind="{ ...$attrs, ...attrs }"
|
|
18
|
-
v-on="readonly ? undefined : on"
|
|
19
|
-
:clearable="!readonly"
|
|
20
|
-
class="rounded-inherit"
|
|
21
|
-
></v-text-field>
|
|
22
|
-
</template>
|
|
23
|
-
<v-date-picker v-model="model" :range="range" no-title>
|
|
24
|
-
<v-btn text color="primary" @click="menu = false">{{ $t("mapo.cancel") }}</v-btn>
|
|
25
|
-
<v-btn text color="primary" @click="$refs.menu.save(model)">{{ $t("mapo.ok") }}</v-btn>
|
|
26
|
-
</v-date-picker>
|
|
27
|
-
</v-menu>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<style scoped>
|
|
32
|
-
.rounded-inherit{
|
|
33
|
-
border-radius: inherit;
|
|
34
|
-
}
|
|
35
|
-
</style>
|
|
36
|
-
|
|
37
|
-
<script>
|
|
38
|
-
/**
|
|
39
|
-
* This component is used to edit a date in iso format. It is a combination of "v-text-field" and "v-date-picker".
|
|
40
|
-
*/
|
|
41
|
-
export default {
|
|
42
|
-
name: "DateField",
|
|
43
|
-
data() {
|
|
44
|
-
return {
|
|
45
|
-
model: this.value,
|
|
46
|
-
menu: null,
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
props: {
|
|
50
|
-
// V-model property. Is the date to be modified. It can be also array in case of date range.
|
|
51
|
-
value: {
|
|
52
|
-
// `String|Array`
|
|
53
|
-
type: String | Array,
|
|
54
|
-
},
|
|
55
|
-
// Determines if we need to work with date ranges.
|
|
56
|
-
range: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false
|
|
59
|
-
},
|
|
60
|
-
// This set the component status to readonly, stopping the user interaction.
|
|
61
|
-
readonly: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: false,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
watch: {
|
|
67
|
-
value(val) {
|
|
68
|
-
if (this.model !== val) this.model = val;
|
|
69
|
-
},
|
|
70
|
-
model(val) {
|
|
71
|
-
// Fired when the v-model changes
|
|
72
|
-
//@arg Emits the date or the date range edited.
|
|
73
|
-
this.$emit("input", val);
|
|
74
|
-
},
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
</script>
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-menu ref="menu" v-model="menu" :close-on-content-click="false" max-width="580">
|
|
4
|
-
<template v-slot:activator="{ on, attrs }">
|
|
5
|
-
<v-text-field
|
|
6
|
-
:value="textFieldString"
|
|
7
|
-
prepend-inner-icon="mdi-calendar"
|
|
8
|
-
readonly
|
|
9
|
-
v-bind="{ ...$attrs, ...attrs }"
|
|
10
|
-
v-on="readonly ? undefined : on"
|
|
11
|
-
:clearable="!readonly"
|
|
12
|
-
class="rounded-inherit"
|
|
13
|
-
></v-text-field>
|
|
14
|
-
</template>
|
|
15
|
-
<v-card>
|
|
16
|
-
<div class="d-flex flex-nowrap">
|
|
17
|
-
<v-date-picker
|
|
18
|
-
v-model="dateModel"
|
|
19
|
-
:range="range"
|
|
20
|
-
no-title
|
|
21
|
-
v-bind="datePickerAttrs"
|
|
22
|
-
class="rounded-0"
|
|
23
|
-
ref="datePicker"
|
|
24
|
-
>
|
|
25
|
-
</v-date-picker
|
|
26
|
-
><v-time-picker
|
|
27
|
-
v-model="timeModel"
|
|
28
|
-
no-title
|
|
29
|
-
v-bind="timePickerAttrs"
|
|
30
|
-
ref="timePicker"
|
|
31
|
-
class="rounded-0"
|
|
32
|
-
>
|
|
33
|
-
</v-time-picker>
|
|
34
|
-
</div>
|
|
35
|
-
<v-card-actions class="justify-center">
|
|
36
|
-
<input
|
|
37
|
-
v-model="startRawDateTime"
|
|
38
|
-
type="datetime-local"
|
|
39
|
-
class="primary--text text-h6 raw-input"
|
|
40
|
-
ref="startRawInput"
|
|
41
|
-
autofocus
|
|
42
|
-
@click="disableCalendar"
|
|
43
|
-
@keydown="disableCalendar"
|
|
44
|
-
/>
|
|
45
|
-
<v-divider class="mx-4" v-if="range"></v-divider>
|
|
46
|
-
<input
|
|
47
|
-
v-if="range"
|
|
48
|
-
:disabled="!startDateTime"
|
|
49
|
-
v-model="endRawDateTime"
|
|
50
|
-
type="datetime-local"
|
|
51
|
-
class="primary--text text-h6 raw-input"
|
|
52
|
-
ref="endRawInput"
|
|
53
|
-
autofocus
|
|
54
|
-
@click="disableCalendar"
|
|
55
|
-
@keydown="disableCalendar"
|
|
56
|
-
/>
|
|
57
|
-
<v-btn text @click="menu = false">{{ $t('mapo.ok') }}</v-btn>
|
|
58
|
-
</v-card-actions>
|
|
59
|
-
</v-card>
|
|
60
|
-
</v-menu>
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
|
|
64
|
-
<style scoped>
|
|
65
|
-
.rounded-inherit {
|
|
66
|
-
border-radius: inherit;
|
|
67
|
-
}
|
|
68
|
-
.raw-input {
|
|
69
|
-
outline: none;
|
|
70
|
-
}
|
|
71
|
-
</style>
|
|
72
|
-
|
|
73
|
-
<script>
|
|
74
|
-
import {
|
|
75
|
-
formatLocalTime,
|
|
76
|
-
formatLocalDate,
|
|
77
|
-
formatLocalDateTime,
|
|
78
|
-
mergeDate,
|
|
79
|
-
mergeTime,
|
|
80
|
-
cleanDateStr,
|
|
81
|
-
} from "@mapomodule/utils/helpers/datetime";
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* This component is used to edit a datetime in iso format. It is a combination of "v-text-field", "v-date-picker" and "v-time-picker".
|
|
85
|
-
* All dates are emitted using UTC timezone.
|
|
86
|
-
*/
|
|
87
|
-
export default {
|
|
88
|
-
name: "DateTimeField",
|
|
89
|
-
data() {
|
|
90
|
-
return {
|
|
91
|
-
startDateTime: null,
|
|
92
|
-
endDateTime: null,
|
|
93
|
-
menu: null,
|
|
94
|
-
isStartFocused: true,
|
|
95
|
-
focusinFunc: () => {
|
|
96
|
-
this.isStartFocused = document.activeElement !== this.$refs.endRawInput;
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
},
|
|
100
|
-
props: {
|
|
101
|
-
// V-model property. Is the date to be modified. It can be also array in case of date range.
|
|
102
|
-
value: {
|
|
103
|
-
// `String|Array`
|
|
104
|
-
type: String | Array,
|
|
105
|
-
},
|
|
106
|
-
// Determines if we need to work with date ranges.
|
|
107
|
-
range: {
|
|
108
|
-
type: Boolean,
|
|
109
|
-
default: false,
|
|
110
|
-
},
|
|
111
|
-
// This set the component status to readonly, stopping the user interaction.
|
|
112
|
-
readonly: {
|
|
113
|
-
type: Boolean,
|
|
114
|
-
default: false,
|
|
115
|
-
},
|
|
116
|
-
datePickerAttrs: {
|
|
117
|
-
type: Object,
|
|
118
|
-
default: () => {},
|
|
119
|
-
},
|
|
120
|
-
timePickerAttrs: {
|
|
121
|
-
type: Object,
|
|
122
|
-
default: () => {},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
watch: {
|
|
126
|
-
value(val) {
|
|
127
|
-
this.setupValue();
|
|
128
|
-
},
|
|
129
|
-
menu(val) {
|
|
130
|
-
if (val)
|
|
131
|
-
setTimeout(() => {
|
|
132
|
-
this.$refs.startRawInput?.focus();
|
|
133
|
-
this.$refs.timePicker.selecting = 1;
|
|
134
|
-
});
|
|
135
|
-
},
|
|
136
|
-
isStartFocused(val, old) {
|
|
137
|
-
if (val != old) this.$refs.timePicker.selecting = 1;
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
methods: {
|
|
141
|
-
disableCalendar(evt) {
|
|
142
|
-
if (!evt.keyCode || evt.keyCode == 13) {
|
|
143
|
-
evt.preventDefault();
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
selectTimePickerMethod(oldDateTime, newDateTime) {
|
|
148
|
-
const currentValue = oldDateTime?.split("T").splice(-1)[0]?.split(":") || [];
|
|
149
|
-
const nextValue = newDateTime?.split("T").splice(-1)[0].split(":") || [];
|
|
150
|
-
for (
|
|
151
|
-
let index = 0;
|
|
152
|
-
index < Math.min(currentValue.length, nextValue.length);
|
|
153
|
-
index++
|
|
154
|
-
) {
|
|
155
|
-
if (currentValue[index] != nextValue[index]) {
|
|
156
|
-
this.$refs.timePicker.selecting = index + 1;
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
emit() {
|
|
162
|
-
if (this.range) {
|
|
163
|
-
const start = this.startDateTime && new Date(this.startDateTime);
|
|
164
|
-
const end = this.endDateTime && new Date(this.endDateTime);
|
|
165
|
-
if (start && end && start > end)
|
|
166
|
-
[this.startDateTime, this.endDateTime] = [this.endDateTime, this.startDateTime];
|
|
167
|
-
}
|
|
168
|
-
this.$emit(
|
|
169
|
-
"input",
|
|
170
|
-
this.range
|
|
171
|
-
? [this.startDateTime, this.endDateTime].filter((d) => d)
|
|
172
|
-
: this.startDateTime
|
|
173
|
-
);
|
|
174
|
-
},
|
|
175
|
-
setupValue() {
|
|
176
|
-
const dates =
|
|
177
|
-
(typeof this.value == "string" && this.value
|
|
178
|
-
? this.value.split(",").filter((v) => v)
|
|
179
|
-
: this.value) || [];
|
|
180
|
-
this.startDateTime = dates.length > 0 ? cleanDateStr(dates[0]) : null;
|
|
181
|
-
this.endDateTime = dates.length > 1 ? cleanDateStr(dates[1]) : null;
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
computed: {
|
|
185
|
-
timeModel: {
|
|
186
|
-
get() {
|
|
187
|
-
const time = this.isStartFocused ? this.startDateTime : this.endDateTime;
|
|
188
|
-
if (!time) return null;
|
|
189
|
-
return formatLocalTime(time);
|
|
190
|
-
},
|
|
191
|
-
set(value) {
|
|
192
|
-
if (this.isStartFocused)
|
|
193
|
-
this.startDateTime = mergeTime(this.startDateTime, value).toISOString();
|
|
194
|
-
else this.endDateTime = mergeTime(this.endDateTime, value).toISOString();
|
|
195
|
-
this.emit();
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
dateModel: {
|
|
199
|
-
get() {
|
|
200
|
-
const d = [this.startDateTime, this.endDateTime]
|
|
201
|
-
.filter((d) => d)
|
|
202
|
-
.map((d) => formatLocalDate(d));
|
|
203
|
-
if (this.range) return d;
|
|
204
|
-
else if (d.length > 0) return d[0];
|
|
205
|
-
return null;
|
|
206
|
-
},
|
|
207
|
-
set(value) {
|
|
208
|
-
if (this.range && value.length == 2) {
|
|
209
|
-
this.endDateTime = mergeDate(this.endDateTime || null, value[1]).toISOString();
|
|
210
|
-
this.startDateTime = mergeDate(
|
|
211
|
-
this.startDateTime || null,
|
|
212
|
-
value[0]
|
|
213
|
-
).toISOString();
|
|
214
|
-
setTimeout(() => this.$refs.endRawInput?.focus());
|
|
215
|
-
} else {
|
|
216
|
-
this.endDateTime = null;
|
|
217
|
-
this.startDateTime = mergeDate(
|
|
218
|
-
this.startDateTime || null,
|
|
219
|
-
Array.isArray(value) ? value[0] : value
|
|
220
|
-
).toISOString();
|
|
221
|
-
}
|
|
222
|
-
this.emit();
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
startRawDateTime: {
|
|
226
|
-
get() {
|
|
227
|
-
if (!this.startDateTime) return null;
|
|
228
|
-
return formatLocalDateTime(this.startDateTime);
|
|
229
|
-
},
|
|
230
|
-
set(value) {
|
|
231
|
-
const oldDateTime = this.startDateTime;
|
|
232
|
-
if (value) this.startDateTime = new Date(value).toISOString();
|
|
233
|
-
this.selectTimePickerMethod(oldDateTime, this.startDateTime);
|
|
234
|
-
this.emit();
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
endRawDateTime: {
|
|
238
|
-
get() {
|
|
239
|
-
if (!this.endDateTime) return null;
|
|
240
|
-
return formatLocalDateTime(this.endDateTime);
|
|
241
|
-
},
|
|
242
|
-
set(value) {
|
|
243
|
-
const oldDateTime = this.endDateTime;
|
|
244
|
-
if (value) this.endDateTime = new Date(value).toISOString();
|
|
245
|
-
this.selectTimePickerMethod(oldDateTime, this.endDateTime);
|
|
246
|
-
setTimeout(() => this.$refs.endRawInput?.focus());
|
|
247
|
-
this.emit();
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
textFieldString() {
|
|
251
|
-
return this.range
|
|
252
|
-
? [this.startDateTime, this.endDateTime]
|
|
253
|
-
.filter((d) => d)
|
|
254
|
-
.map((d) => new Date(d).toLocaleString())
|
|
255
|
-
.join(", ")
|
|
256
|
-
: this.startDateTime && new Date(this.startDateTime).toLocaleString();
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
mounted() {
|
|
260
|
-
if (process.client) {
|
|
261
|
-
document.addEventListener("focusin", this.focusinFunc);
|
|
262
|
-
}
|
|
263
|
-
this.setupValue();
|
|
264
|
-
},
|
|
265
|
-
destroyed() {
|
|
266
|
-
if (process.client) {
|
|
267
|
-
document.removeEventListener("focusin", this.focusinFunc);
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
};
|
|
271
|
-
</script>
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-text-field
|
|
4
|
-
v-if="title"
|
|
5
|
-
v-model="title"
|
|
6
|
-
class="mb-n8 pb-0"
|
|
7
|
-
solo
|
|
8
|
-
readonly
|
|
9
|
-
v-bind="$attrs"
|
|
10
|
-
></v-text-field>
|
|
11
|
-
|
|
12
|
-
<!-- If the media is not avaible, it shows a btn to add new media -->
|
|
13
|
-
<v-card
|
|
14
|
-
class="rounded-0"
|
|
15
|
-
v-bind="{
|
|
16
|
-
height,
|
|
17
|
-
width,
|
|
18
|
-
maxWidth,
|
|
19
|
-
maxHeight,
|
|
20
|
-
minWidth,
|
|
21
|
-
minHeight,
|
|
22
|
-
...$attrs,
|
|
23
|
-
}"
|
|
24
|
-
>
|
|
25
|
-
<MediaPreview
|
|
26
|
-
class="media-preview"
|
|
27
|
-
:key="childKey"
|
|
28
|
-
v-if="mediaExists"
|
|
29
|
-
:media="internalValue"
|
|
30
|
-
:video-preview="internalValue.is_image ? false : true"
|
|
31
|
-
/>
|
|
32
|
-
|
|
33
|
-
<v-card-title>{{ label }}</v-card-title>
|
|
34
|
-
<v-card-text v-show="internalValue">
|
|
35
|
-
<h4>{{ $t("mapo.fileName") }}:</h4>
|
|
36
|
-
{{ fileName }}
|
|
37
|
-
<h4>{{ $t("mapo.created") }}:</h4>
|
|
38
|
-
{{ fileInfo.created }}
|
|
39
|
-
</v-card-text>
|
|
40
|
-
<v-card-actions>
|
|
41
|
-
<template v-if="!internalValue && !rmAddBtn">
|
|
42
|
-
<v-btn
|
|
43
|
-
tile
|
|
44
|
-
:disabled="readonly"
|
|
45
|
-
@click="editing = true"
|
|
46
|
-
block
|
|
47
|
-
:min-height="minHeight"
|
|
48
|
-
>
|
|
49
|
-
<v-icon size="80"> mdi-plus-circle-outline </v-icon>
|
|
50
|
-
</v-btn>
|
|
51
|
-
</template>
|
|
52
|
-
<template v-else>
|
|
53
|
-
<v-row >
|
|
54
|
-
<v-col align="center">
|
|
55
|
-
<v-btn
|
|
56
|
-
:disabled="readonly"
|
|
57
|
-
@click="editing = true"
|
|
58
|
-
block
|
|
59
|
-
>
|
|
60
|
-
<v-icon>mdi-pencil</v-icon>
|
|
61
|
-
</v-btn>
|
|
62
|
-
</v-col>
|
|
63
|
-
<v-col align="center">
|
|
64
|
-
<v-btn
|
|
65
|
-
:disabled="readonly"
|
|
66
|
-
@click="confirmDelete"
|
|
67
|
-
color="error"
|
|
68
|
-
block
|
|
69
|
-
>
|
|
70
|
-
<v-icon>mdi-delete</v-icon>
|
|
71
|
-
</v-btn>
|
|
72
|
-
</v-col>
|
|
73
|
-
</v-row>
|
|
74
|
-
</template>
|
|
75
|
-
</v-card-actions>
|
|
76
|
-
</v-card>
|
|
77
|
-
<!-- Select media dialog -->
|
|
78
|
-
<media-manager-dialog
|
|
79
|
-
v-model="editing"
|
|
80
|
-
select="single"
|
|
81
|
-
v-on:selectionChange="update"
|
|
82
|
-
v-bind="$attrs"
|
|
83
|
-
>
|
|
84
|
-
</media-manager-dialog>
|
|
85
|
-
|
|
86
|
-
<v-messages v-model="errorMessages" color="error" class="mt-2" />
|
|
87
|
-
</div>
|
|
88
|
-
</template>
|
|
89
|
-
|
|
90
|
-
<style scoped>
|
|
91
|
-
.media-preview {
|
|
92
|
-
cursor: pointer;
|
|
93
|
-
}
|
|
94
|
-
</style>
|
|
95
|
-
|
|
96
|
-
<script>
|
|
97
|
-
export default {
|
|
98
|
-
name: "EnhancedMediaField",
|
|
99
|
-
data() {
|
|
100
|
-
return {
|
|
101
|
-
internalValue: null,
|
|
102
|
-
editing: false,
|
|
103
|
-
childKey: 0,
|
|
104
|
-
};
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
props: {
|
|
108
|
-
value: Object,
|
|
109
|
-
label: String,
|
|
110
|
-
title: {
|
|
111
|
-
type: String,
|
|
112
|
-
default: () => "",
|
|
113
|
-
},
|
|
114
|
-
errorMessages: {
|
|
115
|
-
type: String | Array,
|
|
116
|
-
default: () => [],
|
|
117
|
-
},
|
|
118
|
-
rmAddBtn: {
|
|
119
|
-
type: Boolean,
|
|
120
|
-
default: false,
|
|
121
|
-
},
|
|
122
|
-
//image reflections
|
|
123
|
-
aspectRatio: {
|
|
124
|
-
type: String | Number,
|
|
125
|
-
default: undefined,
|
|
126
|
-
},
|
|
127
|
-
contain: {
|
|
128
|
-
type: Boolean,
|
|
129
|
-
default: false,
|
|
130
|
-
},
|
|
131
|
-
height: {
|
|
132
|
-
type: String | Number,
|
|
133
|
-
default: "100%",
|
|
134
|
-
},
|
|
135
|
-
width: {
|
|
136
|
-
type: String | Number,
|
|
137
|
-
default: "100%",
|
|
138
|
-
},
|
|
139
|
-
maxWidth: {
|
|
140
|
-
type: String | Number,
|
|
141
|
-
default: undefined,
|
|
142
|
-
},
|
|
143
|
-
maxHeight: {
|
|
144
|
-
type: String | Number,
|
|
145
|
-
default: undefined,
|
|
146
|
-
},
|
|
147
|
-
minWidth: {
|
|
148
|
-
type: String | Number,
|
|
149
|
-
default: undefined,
|
|
150
|
-
},
|
|
151
|
-
minHeight: {
|
|
152
|
-
type: String | Number,
|
|
153
|
-
default: 300,
|
|
154
|
-
},
|
|
155
|
-
// This set the component status to readonly, stopping the user interaction.
|
|
156
|
-
readonly: {
|
|
157
|
-
type: Boolean,
|
|
158
|
-
default: false,
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
computed: {
|
|
163
|
-
mediaExists() {
|
|
164
|
-
return !!this.internalValue?.file;
|
|
165
|
-
},
|
|
166
|
-
fileInfo() {
|
|
167
|
-
return {
|
|
168
|
-
title: this.internalValue?.title,
|
|
169
|
-
created: new Date(this.internalValue?.created).toLocaleDateString(
|
|
170
|
-
this.internalValue?.language_code
|
|
171
|
-
),
|
|
172
|
-
};
|
|
173
|
-
},
|
|
174
|
-
fileName() {
|
|
175
|
-
return (
|
|
176
|
-
this.internalValue &&
|
|
177
|
-
this.internalValue.file &&
|
|
178
|
-
this.internalValue.file.split("/").pop()
|
|
179
|
-
);
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
methods: {
|
|
184
|
-
update(val) {
|
|
185
|
-
this.updateChild();
|
|
186
|
-
this.internalValue = val;
|
|
187
|
-
},
|
|
188
|
-
confirmDelete() {
|
|
189
|
-
this.$mapo.$confirm
|
|
190
|
-
.open({
|
|
191
|
-
title: this.$t("mapo.remove"),
|
|
192
|
-
question: this.$t("mapo.mediaField.confirmRemove"),
|
|
193
|
-
approveButton: {
|
|
194
|
-
text: this.$t("mapo.remove"),
|
|
195
|
-
attrs: { color: "red", text: true },
|
|
196
|
-
},
|
|
197
|
-
})
|
|
198
|
-
.then((res) => (res ? (this.internalValue = null) : null));
|
|
199
|
-
},
|
|
200
|
-
updateChild() {
|
|
201
|
-
this.childKey += 1;
|
|
202
|
-
},
|
|
203
|
-
isImage(val) {
|
|
204
|
-
if (!val?.is_image && val?.mime_type.includes("image")) {
|
|
205
|
-
Object.assign(val, { is_image: true });
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
watch: {
|
|
210
|
-
value(val) {
|
|
211
|
-
if (val !== this.internalValue) {
|
|
212
|
-
this.internalValue = val;
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
internalValue(val) {
|
|
216
|
-
this.isImage(val);
|
|
217
|
-
this.$emit("input", val);
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
mounted() {
|
|
221
|
-
this.internalValue = this.value;
|
|
222
|
-
},
|
|
223
|
-
};
|
|
224
|
-
</script>
|