@mapomodule/uikit 1.0.0-alpha.4 → 1.0.0-alpha.41
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/CHANGELOG.md +749 -0
- package/components/ConfirmDialog.vue +12 -16
- package/components/Detail/Detail.vue +406 -272
- package/components/Detail/DetailLangSwitch.vue +7 -2
- package/components/DropArea.vue +63 -56
- package/components/Form/Form.vue +218 -0
- package/components/Form/FormField.vue +213 -0
- package/components/Form/FormGroup.vue +146 -0
- package/components/Form/FormTabs.vue +188 -0
- package/components/Form/defaults.js +91 -0
- package/components/Form/fields/ColorField.vue +79 -0
- package/components/{fields → Form/fields}/DateField.vue +20 -11
- package/components/Form/fields/EnhancedMediaField.vue +224 -0
- package/components/Form/fields/FileField.vue +125 -0
- package/components/Form/fields/FksField.vue +88 -0
- package/components/Form/fields/MediaField.vue +159 -0
- package/components/Form/fields/MediaM2mField.vue +149 -0
- package/components/Form/fields/Repeater.vue +593 -0
- package/components/Form/fields/SeoPreview.vue +89 -0
- package/components/Form/fields/wygEditor/defaults.js +25 -0
- package/components/{fields/TinyMce → Form/fields/wygEditor}/utils/events.js +0 -0
- package/components/{fields/TinyMce → Form/fields/wygEditor}/utils/mapomedia.plugin.js +7 -6
- package/components/{fields/TinyMce → Form/fields/wygEditor}/utils/script.injector.js +0 -0
- package/components/Form/fields/wygEditor/wygEditor.vue +285 -0
- package/components/LangSwitcher.vue +44 -0
- package/components/List/List.vue +119 -42
- package/components/List/ListActions.vue +60 -21
- package/components/List/ListFilters.vue +166 -114
- package/components/List/ListHead.vue +30 -12
- package/components/List/ListQuickEdit.vue +130 -61
- package/components/List/ListTable.vue +292 -80
- package/components/Login.vue +17 -7
- package/components/LogoutButton.vue +43 -28
- package/components/MediaManager/MediaBreadcrumbs.vue +45 -0
- package/components/MediaManager/MediaEditor.vue +330 -122
- package/components/MediaManager/MediaFolders.vue +169 -116
- package/components/MediaManager/MediaGallery.vue +151 -146
- package/components/MediaManager/MediaManager.vue +117 -159
- package/components/MediaManager/MediaManagerDialog.vue +36 -31
- package/components/MediaManager/MediaPreview.vue +203 -0
- package/components/MediaManager/MediaUploader.vue +55 -43
- package/components/SnackBar.vue +5 -7
- package/components/ThemeToggle.vue +13 -0
- package/components/layout/Sidebar/Sidebar.vue +61 -30
- package/components/layout/Sidebar/SidebarList.vue +19 -15
- package/components/layout/Sidebar/SidebarListItem.vue +122 -38
- package/components/layout/Sidebar/SidebarProfile.vue +42 -0
- package/components/layout/Sidebar/SidebarTitle.vue +45 -0
- package/components/layout/Topbar/Topbar.vue +11 -42
- package/components/layout/routebuilder.js +3 -3
- package/defaults/i18n.js +37 -0
- package/defaults/vuetify.js +34 -0
- package/layouts/default.vue +33 -18
- package/layouts/empty.vue +10 -0
- package/module.js +7 -5
- package/package.json +6 -4
- package/pages/index.vue +19 -18
- package/static/{favicon.ico → mapo/favicon.ico} +0 -0
- package/static/mapo/tinymce-skins/mapo-dark/content.inline.min.css +7 -0
- package/static/mapo/tinymce-skins/mapo-dark/content.min.css +7 -0
- package/static/mapo/tinymce-skins/mapo-dark/content.mobile.min.css +7 -0
- package/static/mapo/tinymce-skins/mapo-dark/skin.min.css +7 -0
- package/static/mapo/tinymce-skins/mapo-dark/skin.mobile.min.css +7 -0
- package/static/mapo/tinymce-skins/mapo-light/content.inline.min.css +7 -0
- package/static/mapo/tinymce-skins/mapo-light/content.min.css +7 -0
- package/static/mapo/tinymce-skins/mapo-light/content.mobile.min.css +7 -0
- package/static/mapo/tinymce-skins/mapo-light/skin.min.css +7 -0
- package/static/mapo/tinymce-skins/mapo-light/skin.mobile.min.css +7 -0
- package/translations/en-US.js +135 -0
- package/translations/it-IT.js +137 -0
- package/components/Detail/DetailField.vue +0 -129
- package/components/Detail/defaults.js +0 -50
- package/components/fields/M2mField.vue +0 -95
- package/components/fields/MediaField.vue +0 -195
- package/components/fields/MediaM2mField.vue +0 -238
- package/components/fields/TinyMce/TinyMce.vue +0 -177
- package/components/fields/TinyMce/defaults.js +0 -55
- package/components/layout/Sidebar/SidebarFooter.vue +0 -75
- package/defaults.js +0 -29
- package/layouts/error.vue +0 -45
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="media-m2m--wrapper">
|
|
3
|
+
<v-text-field
|
|
4
|
+
readonly
|
|
5
|
+
hide-details
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
@click="!hasSelection && editSelection()"
|
|
8
|
+
class="media-m2m--card"
|
|
9
|
+
:class="{ 'media-m2m--selected': !!hasSelection }"
|
|
10
|
+
:value="hasSelection ? ' ' : ''"
|
|
11
|
+
>
|
|
12
|
+
<template v-slot:append>
|
|
13
|
+
<v-virtual-scroll
|
|
14
|
+
v-if="hasSelection"
|
|
15
|
+
:items="model"
|
|
16
|
+
:height="model.length * 64 > 256 ? 256 : model.length * 64"
|
|
17
|
+
item-height="64"
|
|
18
|
+
class="mb-4"
|
|
19
|
+
>
|
|
20
|
+
<template v-slot:default="{ item }">
|
|
21
|
+
<v-divider></v-divider>
|
|
22
|
+
<v-list-item class="media-m2m--item" :key="item.id">
|
|
23
|
+
<v-list-item-avatar tile>
|
|
24
|
+
<MediaPreview
|
|
25
|
+
:media="item"
|
|
26
|
+
:video-preview="!item.is_image"
|
|
27
|
+
class="media-m2m--preview"
|
|
28
|
+
icon-size="30"
|
|
29
|
+
/>
|
|
30
|
+
</v-list-item-avatar>
|
|
31
|
+
|
|
32
|
+
<v-list-item-content>
|
|
33
|
+
<v-list-item-title class="text--secondary">
|
|
34
|
+
{{ item.file.split("/").pop() }}
|
|
35
|
+
</v-list-item-title>
|
|
36
|
+
<v-list-item-subtitle>
|
|
37
|
+
{{ item.mime_type || "type/unknow" }},
|
|
38
|
+
{{ humanFileSize(item.size) }},
|
|
39
|
+
{{ formatDate(item.created) }}
|
|
40
|
+
</v-list-item-subtitle>
|
|
41
|
+
</v-list-item-content>
|
|
42
|
+
|
|
43
|
+
<v-list-item-action>
|
|
44
|
+
<v-btn @click.stop="removeItem(item)" small icon>
|
|
45
|
+
<v-icon class="text--secondary"> mdi-close-circle </v-icon>
|
|
46
|
+
</v-btn>
|
|
47
|
+
</v-list-item-action>
|
|
48
|
+
</v-list-item>
|
|
49
|
+
|
|
50
|
+
<v-divider></v-divider>
|
|
51
|
+
</template>
|
|
52
|
+
</v-virtual-scroll>
|
|
53
|
+
</template>
|
|
54
|
+
</v-text-field>
|
|
55
|
+
<v-btn v-if="hasSelection" @click="editSelection" tile small block>{{
|
|
56
|
+
$t("mapo.mediaM2MField.editSelection")
|
|
57
|
+
}}</v-btn>
|
|
58
|
+
<v-messages v-if="!$attrs.hideDetails" class="mt-2" :value="$attrs.errorMessages" color="error"/>
|
|
59
|
+
<media-manager-dialog
|
|
60
|
+
v-model="dialog"
|
|
61
|
+
select="multi"
|
|
62
|
+
:selected.sync="model"
|
|
63
|
+
>
|
|
64
|
+
</media-manager-dialog>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<style lang="scss">
|
|
69
|
+
.media-m2m--card.v-text-field > .v-input__control > .v-input__slot {
|
|
70
|
+
input {
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
.v-text-field__slot {
|
|
75
|
+
cursor: default;
|
|
76
|
+
}
|
|
77
|
+
.media-m2m--selected {
|
|
78
|
+
.v-text-field__slot {
|
|
79
|
+
position: absolute !important;
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100%;
|
|
82
|
+
cursor: default;
|
|
83
|
+
}
|
|
84
|
+
.v-input__append-inner {
|
|
85
|
+
cursor: default;
|
|
86
|
+
margin-left: 0;
|
|
87
|
+
width: 100%;
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
}
|
|
91
|
+
&.media-m2m--card.v-text-field > .v-input__control > .v-input__slot input {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
.media-m2m--card {
|
|
96
|
+
border-radius: inherit;
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
99
|
+
|
|
100
|
+
<script>
|
|
101
|
+
import { humanFileSize } from "@mapomodule/utils/helpers/formatters";
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* This component is made to manage media fields for multiple selection.
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
export default {
|
|
108
|
+
name: "MediaM2mField",
|
|
109
|
+
data() {
|
|
110
|
+
return {
|
|
111
|
+
model: this.value,
|
|
112
|
+
dialog: false,
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
props: {
|
|
116
|
+
// V-model property. It is the attribute to be modified.
|
|
117
|
+
value: {
|
|
118
|
+
type: Array | null,
|
|
119
|
+
required: true,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
computed: {
|
|
123
|
+
hasSelection() {
|
|
124
|
+
return this.model && this.model.length > 0;
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
methods: {
|
|
128
|
+
humanFileSize,
|
|
129
|
+
formatDate(val) {
|
|
130
|
+
return val && new Date(val).toLocaleString();
|
|
131
|
+
},
|
|
132
|
+
removeItem(media) {
|
|
133
|
+
this.model = this.model.filter(({ id }) => id != media.id);
|
|
134
|
+
},
|
|
135
|
+
editSelection(){
|
|
136
|
+
if (!this.readonly)
|
|
137
|
+
this.dialog = true;
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
watch: {
|
|
141
|
+
value(val) {
|
|
142
|
+
this.model = val;
|
|
143
|
+
},
|
|
144
|
+
model(val) {
|
|
145
|
+
this.$emit("input", val);
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
</script>
|