@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.
Files changed (80) hide show
  1. package/CHANGELOG.md +749 -0
  2. package/components/ConfirmDialog.vue +12 -16
  3. package/components/Detail/Detail.vue +406 -272
  4. package/components/Detail/DetailLangSwitch.vue +7 -2
  5. package/components/DropArea.vue +63 -56
  6. package/components/Form/Form.vue +218 -0
  7. package/components/Form/FormField.vue +213 -0
  8. package/components/Form/FormGroup.vue +146 -0
  9. package/components/Form/FormTabs.vue +188 -0
  10. package/components/Form/defaults.js +91 -0
  11. package/components/Form/fields/ColorField.vue +79 -0
  12. package/components/{fields → Form/fields}/DateField.vue +20 -11
  13. package/components/Form/fields/EnhancedMediaField.vue +224 -0
  14. package/components/Form/fields/FileField.vue +125 -0
  15. package/components/Form/fields/FksField.vue +88 -0
  16. package/components/Form/fields/MediaField.vue +159 -0
  17. package/components/Form/fields/MediaM2mField.vue +149 -0
  18. package/components/Form/fields/Repeater.vue +593 -0
  19. package/components/Form/fields/SeoPreview.vue +89 -0
  20. package/components/Form/fields/wygEditor/defaults.js +25 -0
  21. package/components/{fields/TinyMce → Form/fields/wygEditor}/utils/events.js +0 -0
  22. package/components/{fields/TinyMce → Form/fields/wygEditor}/utils/mapomedia.plugin.js +7 -6
  23. package/components/{fields/TinyMce → Form/fields/wygEditor}/utils/script.injector.js +0 -0
  24. package/components/Form/fields/wygEditor/wygEditor.vue +285 -0
  25. package/components/LangSwitcher.vue +44 -0
  26. package/components/List/List.vue +119 -42
  27. package/components/List/ListActions.vue +60 -21
  28. package/components/List/ListFilters.vue +166 -114
  29. package/components/List/ListHead.vue +30 -12
  30. package/components/List/ListQuickEdit.vue +130 -61
  31. package/components/List/ListTable.vue +292 -80
  32. package/components/Login.vue +17 -7
  33. package/components/LogoutButton.vue +43 -28
  34. package/components/MediaManager/MediaBreadcrumbs.vue +45 -0
  35. package/components/MediaManager/MediaEditor.vue +330 -122
  36. package/components/MediaManager/MediaFolders.vue +169 -116
  37. package/components/MediaManager/MediaGallery.vue +151 -146
  38. package/components/MediaManager/MediaManager.vue +117 -159
  39. package/components/MediaManager/MediaManagerDialog.vue +36 -31
  40. package/components/MediaManager/MediaPreview.vue +203 -0
  41. package/components/MediaManager/MediaUploader.vue +55 -43
  42. package/components/SnackBar.vue +5 -7
  43. package/components/ThemeToggle.vue +13 -0
  44. package/components/layout/Sidebar/Sidebar.vue +61 -30
  45. package/components/layout/Sidebar/SidebarList.vue +19 -15
  46. package/components/layout/Sidebar/SidebarListItem.vue +122 -38
  47. package/components/layout/Sidebar/SidebarProfile.vue +42 -0
  48. package/components/layout/Sidebar/SidebarTitle.vue +45 -0
  49. package/components/layout/Topbar/Topbar.vue +11 -42
  50. package/components/layout/routebuilder.js +3 -3
  51. package/defaults/i18n.js +37 -0
  52. package/defaults/vuetify.js +34 -0
  53. package/layouts/default.vue +33 -18
  54. package/layouts/empty.vue +10 -0
  55. package/module.js +7 -5
  56. package/package.json +6 -4
  57. package/pages/index.vue +19 -18
  58. package/static/{favicon.ico → mapo/favicon.ico} +0 -0
  59. package/static/mapo/tinymce-skins/mapo-dark/content.inline.min.css +7 -0
  60. package/static/mapo/tinymce-skins/mapo-dark/content.min.css +7 -0
  61. package/static/mapo/tinymce-skins/mapo-dark/content.mobile.min.css +7 -0
  62. package/static/mapo/tinymce-skins/mapo-dark/skin.min.css +7 -0
  63. package/static/mapo/tinymce-skins/mapo-dark/skin.mobile.min.css +7 -0
  64. package/static/mapo/tinymce-skins/mapo-light/content.inline.min.css +7 -0
  65. package/static/mapo/tinymce-skins/mapo-light/content.min.css +7 -0
  66. package/static/mapo/tinymce-skins/mapo-light/content.mobile.min.css +7 -0
  67. package/static/mapo/tinymce-skins/mapo-light/skin.min.css +7 -0
  68. package/static/mapo/tinymce-skins/mapo-light/skin.mobile.min.css +7 -0
  69. package/translations/en-US.js +135 -0
  70. package/translations/it-IT.js +137 -0
  71. package/components/Detail/DetailField.vue +0 -129
  72. package/components/Detail/defaults.js +0 -50
  73. package/components/fields/M2mField.vue +0 -95
  74. package/components/fields/MediaField.vue +0 -195
  75. package/components/fields/MediaM2mField.vue +0 -238
  76. package/components/fields/TinyMce/TinyMce.vue +0 -177
  77. package/components/fields/TinyMce/defaults.js +0 -55
  78. package/components/layout/Sidebar/SidebarFooter.vue +0 -75
  79. package/defaults.js +0 -29
  80. 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>