@mapomodule/uikit 1.0.0-alpha.6 → 1.0.0-alpha.60

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 (231) hide show
  1. package/CHANGELOG.md +953 -0
  2. package/components/ConfirmDialog.vue +58 -37
  3. package/components/Detail/Detail.vue +421 -271
  4. package/components/Detail/DetailLangSwitch.vue +9 -2
  5. package/components/DropArea.vue +63 -56
  6. package/components/Form/Form.vue +218 -0
  7. package/components/Form/FormField.vue +216 -0
  8. package/components/Form/FormGroup.vue +146 -0
  9. package/components/Form/FormTabs.vue +188 -0
  10. package/components/Form/defaults.js +98 -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/DateTimeField.vue +271 -0
  14. package/components/Form/fields/EnhancedMediaField.vue +224 -0
  15. package/components/Form/fields/FileField.vue +125 -0
  16. package/components/Form/fields/FksField.vue +115 -0
  17. package/components/Form/fields/MediaField.vue +159 -0
  18. package/components/Form/fields/MediaM2mField.vue +149 -0
  19. package/components/Form/fields/Repeater.vue +618 -0
  20. package/components/{fields → Form/fields}/SeoPreview.vue +10 -10
  21. package/components/Form/fields/TimeField.vue +154 -0
  22. package/components/Form/fields/mapField/leaflet.injector.js +39 -0
  23. package/components/Form/fields/mapField/mapField.vue +350 -0
  24. package/components/Form/fields/wygEditor/defaults.js +25 -0
  25. package/components/{fields/TinyMce → Form/fields/wygEditor}/utils/mapomedia.plugin.js +7 -6
  26. package/components/Form/fields/wygEditor/wygEditor.vue +285 -0
  27. package/components/Form/fields/wygEditorCKE/defaults.js +103 -0
  28. package/components/Form/fields/wygEditorCKE/utils/ckeditor.injector.js +29 -0
  29. package/components/Form/fields/wygEditorCKE/wygEditorCKE.vue +270 -0
  30. package/components/LangSwitcher.vue +44 -0
  31. package/components/List/List.vue +34 -17
  32. package/components/List/ListActions.vue +22 -4
  33. package/components/List/ListFilters.vue +48 -10
  34. package/components/List/ListHead.vue +11 -3
  35. package/components/List/ListQuickEdit.vue +124 -64
  36. package/components/List/ListTable.vue +118 -18
  37. package/components/Login.vue +17 -7
  38. package/components/LogoutButton.vue +43 -28
  39. package/components/MediaManager/MediaBreadcrumbs.vue +45 -0
  40. package/components/MediaManager/MediaEditor.vue +297 -120
  41. package/components/MediaManager/MediaFileChanger.vue +78 -0
  42. package/components/MediaManager/MediaFolders.vue +224 -116
  43. package/components/MediaManager/MediaGallery.vue +224 -145
  44. package/components/MediaManager/MediaManager.vue +125 -159
  45. package/components/MediaManager/MediaManagerDialog.vue +36 -31
  46. package/components/MediaManager/MediaPreview.vue +258 -0
  47. package/components/MediaManager/MediaUploader.vue +91 -90
  48. package/components/MenuManager/MenuManager.vue +332 -0
  49. package/components/MenuManager/MenuNodeEditor.vue +270 -0
  50. package/components/MenuManager/MenuTreeview.vue +237 -0
  51. package/components/MenuManager/MenuTreeviewNode.vue +208 -0
  52. package/components/PagePreview.vue +58 -0
  53. package/components/SnackBar.vue +5 -7
  54. package/components/ThemeToggle.vue +13 -0
  55. package/components/layout/Sidebar/Sidebar.vue +48 -39
  56. package/components/layout/Sidebar/SidebarList.vue +11 -4
  57. package/components/layout/Sidebar/SidebarListItem.vue +113 -13
  58. package/components/layout/Sidebar/SidebarProfile.vue +42 -0
  59. package/components/layout/Sidebar/SidebarTitle.vue +45 -0
  60. package/components/layout/Topbar/Topbar.vue +11 -9
  61. package/components/layout/routebuilder.js +2 -2
  62. package/defaults/i18n.js +37 -0
  63. package/defaults/vuetify.js +34 -0
  64. package/layouts/default.vue +35 -11
  65. package/layouts/empty.vue +10 -0
  66. package/module.js +7 -5
  67. package/package.json +6 -4
  68. package/pages/index.vue +19 -17
  69. package/static/mapo/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
  70. package/static/mapo/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
  71. package/static/mapo/ckeditor/plugins/image2/dev/contents.css +35 -0
  72. package/static/mapo/ckeditor/plugins/image2/dev/image2.html +338 -0
  73. package/static/mapo/ckeditor/plugins/image2/dialogs/image2.js +557 -0
  74. package/static/mapo/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
  75. package/static/mapo/ckeditor/plugins/image2/icons/image.png +0 -0
  76. package/static/mapo/ckeditor/plugins/image2/lang/af.js +21 -0
  77. package/static/mapo/ckeditor/plugins/image2/lang/ar.js +21 -0
  78. package/static/mapo/ckeditor/plugins/image2/lang/az.js +21 -0
  79. package/static/mapo/ckeditor/plugins/image2/lang/bg.js +21 -0
  80. package/static/mapo/ckeditor/plugins/image2/lang/bn.js +21 -0
  81. package/static/mapo/ckeditor/plugins/image2/lang/bs.js +21 -0
  82. package/static/mapo/ckeditor/plugins/image2/lang/ca.js +21 -0
  83. package/static/mapo/ckeditor/plugins/image2/lang/cs.js +21 -0
  84. package/static/mapo/ckeditor/plugins/image2/lang/cy.js +21 -0
  85. package/static/mapo/ckeditor/plugins/image2/lang/da.js +21 -0
  86. package/static/mapo/ckeditor/plugins/image2/lang/de-ch.js +21 -0
  87. package/static/mapo/ckeditor/plugins/image2/lang/de.js +21 -0
  88. package/static/mapo/ckeditor/plugins/image2/lang/el.js +21 -0
  89. package/static/mapo/ckeditor/plugins/image2/lang/en-au.js +21 -0
  90. package/static/mapo/ckeditor/plugins/image2/lang/en-ca.js +21 -0
  91. package/static/mapo/ckeditor/plugins/image2/lang/en-gb.js +21 -0
  92. package/static/mapo/ckeditor/plugins/image2/lang/en.js +21 -0
  93. package/static/mapo/ckeditor/plugins/image2/lang/eo.js +21 -0
  94. package/static/mapo/ckeditor/plugins/image2/lang/es-mx.js +21 -0
  95. package/static/mapo/ckeditor/plugins/image2/lang/es.js +21 -0
  96. package/static/mapo/ckeditor/plugins/image2/lang/et.js +21 -0
  97. package/static/mapo/ckeditor/plugins/image2/lang/eu.js +21 -0
  98. package/static/mapo/ckeditor/plugins/image2/lang/fa.js +21 -0
  99. package/static/mapo/ckeditor/plugins/image2/lang/fi.js +21 -0
  100. package/static/mapo/ckeditor/plugins/image2/lang/fo.js +21 -0
  101. package/static/mapo/ckeditor/plugins/image2/lang/fr-ca.js +21 -0
  102. package/static/mapo/ckeditor/plugins/image2/lang/fr.js +21 -0
  103. package/static/mapo/ckeditor/plugins/image2/lang/gl.js +21 -0
  104. package/static/mapo/ckeditor/plugins/image2/lang/gu.js +21 -0
  105. package/static/mapo/ckeditor/plugins/image2/lang/he.js +21 -0
  106. package/static/mapo/ckeditor/plugins/image2/lang/hi.js +21 -0
  107. package/static/mapo/ckeditor/plugins/image2/lang/hr.js +21 -0
  108. package/static/mapo/ckeditor/plugins/image2/lang/hu.js +21 -0
  109. package/static/mapo/ckeditor/plugins/image2/lang/id.js +21 -0
  110. package/static/mapo/ckeditor/plugins/image2/lang/is.js +21 -0
  111. package/static/mapo/ckeditor/plugins/image2/lang/it.js +21 -0
  112. package/static/mapo/ckeditor/plugins/image2/lang/ja.js +21 -0
  113. package/static/mapo/ckeditor/plugins/image2/lang/ka.js +21 -0
  114. package/static/mapo/ckeditor/plugins/image2/lang/km.js +21 -0
  115. package/static/mapo/ckeditor/plugins/image2/lang/ko.js +21 -0
  116. package/static/mapo/ckeditor/plugins/image2/lang/ku.js +21 -0
  117. package/static/mapo/ckeditor/plugins/image2/lang/lt.js +21 -0
  118. package/static/mapo/ckeditor/plugins/image2/lang/lv.js +21 -0
  119. package/static/mapo/ckeditor/plugins/image2/lang/mk.js +21 -0
  120. package/static/mapo/ckeditor/plugins/image2/lang/mn.js +21 -0
  121. package/static/mapo/ckeditor/plugins/image2/lang/ms.js +21 -0
  122. package/static/mapo/ckeditor/plugins/image2/lang/nb.js +21 -0
  123. package/static/mapo/ckeditor/plugins/image2/lang/nl.js +21 -0
  124. package/static/mapo/ckeditor/plugins/image2/lang/no.js +21 -0
  125. package/static/mapo/ckeditor/plugins/image2/lang/oc.js +21 -0
  126. package/static/mapo/ckeditor/plugins/image2/lang/pl.js +21 -0
  127. package/static/mapo/ckeditor/plugins/image2/lang/pt-br.js +21 -0
  128. package/static/mapo/ckeditor/plugins/image2/lang/pt.js +21 -0
  129. package/static/mapo/ckeditor/plugins/image2/lang/ro.js +21 -0
  130. package/static/mapo/ckeditor/plugins/image2/lang/ru.js +21 -0
  131. package/static/mapo/ckeditor/plugins/image2/lang/si.js +21 -0
  132. package/static/mapo/ckeditor/plugins/image2/lang/sk.js +21 -0
  133. package/static/mapo/ckeditor/plugins/image2/lang/sl.js +21 -0
  134. package/static/mapo/ckeditor/plugins/image2/lang/sq.js +21 -0
  135. package/static/mapo/ckeditor/plugins/image2/lang/sr-latn.js +21 -0
  136. package/static/mapo/ckeditor/plugins/image2/lang/sr.js +21 -0
  137. package/static/mapo/ckeditor/plugins/image2/lang/sv.js +21 -0
  138. package/static/mapo/ckeditor/plugins/image2/lang/th.js +21 -0
  139. package/static/mapo/ckeditor/plugins/image2/lang/tr.js +21 -0
  140. package/static/mapo/ckeditor/plugins/image2/lang/tt.js +21 -0
  141. package/static/mapo/ckeditor/plugins/image2/lang/ug.js +21 -0
  142. package/static/mapo/ckeditor/plugins/image2/lang/uk.js +21 -0
  143. package/static/mapo/ckeditor/plugins/image2/lang/vi.js +21 -0
  144. package/static/mapo/ckeditor/plugins/image2/lang/zh-cn.js +21 -0
  145. package/static/mapo/ckeditor/plugins/image2/lang/zh.js +21 -0
  146. package/static/mapo/ckeditor/plugins/image2/plugin.js +1798 -0
  147. package/static/mapo/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
  148. package/static/mapo/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
  149. package/static/mapo/ckeditor/plugins/image2/samples/image2.html +68 -0
  150. package/static/mapo/ckeditor/skins/moono/dev/icons16.png +0 -0
  151. package/static/mapo/ckeditor/skins/moono/dev/icons16.svg +2374 -0
  152. package/static/mapo/ckeditor/skins/moono/dev/icons32.png +0 -0
  153. package/static/mapo/ckeditor/skins/moono/dev/icons32.svg +2722 -0
  154. package/static/mapo/ckeditor/skins/moono/dev/locations.json +144 -0
  155. package/static/mapo/ckeditor/skins/moono/dialog.css +5 -0
  156. package/static/mapo/ckeditor/skins/moono/dialog_ie.css +5 -0
  157. package/static/mapo/ckeditor/skins/moono/dialog_ie7.css +5 -0
  158. package/static/mapo/ckeditor/skins/moono/dialog_ie8.css +5 -0
  159. package/static/mapo/ckeditor/skins/moono/dialog_iequirks.css +5 -0
  160. package/static/mapo/ckeditor/skins/moono/editor.css +5 -0
  161. package/static/mapo/ckeditor/skins/moono/editor_gecko.css +5 -0
  162. package/static/mapo/ckeditor/skins/moono/editor_ie.css +5 -0
  163. package/static/mapo/ckeditor/skins/moono/editor_ie7.css +5 -0
  164. package/static/mapo/ckeditor/skins/moono/editor_ie8.css +5 -0
  165. package/static/mapo/ckeditor/skins/moono/editor_iequirks.css +5 -0
  166. package/static/mapo/ckeditor/skins/moono/icons.png +0 -0
  167. package/static/mapo/ckeditor/skins/moono/icons_hidpi.png +0 -0
  168. package/static/mapo/ckeditor/skins/moono/images/anchor.png +0 -0
  169. package/static/mapo/ckeditor/skins/moono/images/arrow.png +0 -0
  170. package/static/mapo/ckeditor/skins/moono/images/close.png +0 -0
  171. package/static/mapo/ckeditor/skins/moono/images/hidpi/anchor.png +0 -0
  172. package/static/mapo/ckeditor/skins/moono/images/hidpi/close.png +0 -0
  173. package/static/mapo/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
  174. package/static/mapo/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
  175. package/static/mapo/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
  176. package/static/mapo/ckeditor/skins/moono/images/lock-open.png +0 -0
  177. package/static/mapo/ckeditor/skins/moono/images/lock.png +0 -0
  178. package/static/mapo/ckeditor/skins/moono/images/refresh.png +0 -0
  179. package/static/mapo/ckeditor/skins/moono/images/spinner.gif +0 -0
  180. package/static/mapo/ckeditor/skins/moono/readme.md +49 -0
  181. package/static/mapo/ckeditor/skins/moono/skin.js +10 -0
  182. package/static/mapo/ckeditor/skins/moono-dark/dialog.css +5 -0
  183. package/static/mapo/ckeditor/skins/moono-dark/dialog_ie.css +5 -0
  184. package/static/mapo/ckeditor/skins/moono-dark/dialog_ie7.css +5 -0
  185. package/static/mapo/ckeditor/skins/moono-dark/dialog_ie8.css +5 -0
  186. package/static/mapo/ckeditor/skins/moono-dark/dialog_iequirks.css +5 -0
  187. package/static/mapo/ckeditor/skins/moono-dark/editor.css +5 -0
  188. package/static/mapo/ckeditor/skins/moono-dark/editor_gecko.css +5 -0
  189. package/static/mapo/ckeditor/skins/moono-dark/editor_ie.css +5 -0
  190. package/static/mapo/ckeditor/skins/moono-dark/editor_ie7.css +5 -0
  191. package/static/mapo/ckeditor/skins/moono-dark/editor_ie8.css +5 -0
  192. package/static/mapo/ckeditor/skins/moono-dark/editor_iequirks.css +5 -0
  193. package/static/mapo/ckeditor/skins/moono-dark/icons.png +0 -0
  194. package/static/mapo/ckeditor/skins/moono-dark/icons_hidpi.png +0 -0
  195. package/static/mapo/ckeditor/skins/moono-dark/images/arrow.png +0 -0
  196. package/static/mapo/ckeditor/skins/moono-dark/images/close.png +0 -0
  197. package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/close.png +0 -0
  198. package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/lock-open.png +0 -0
  199. package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/lock.png +0 -0
  200. package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/refresh.png +0 -0
  201. package/static/mapo/ckeditor/skins/moono-dark/images/lock-open.png +0 -0
  202. package/static/mapo/ckeditor/skins/moono-dark/images/lock.png +0 -0
  203. package/static/mapo/ckeditor/skins/moono-dark/images/refresh.png +0 -0
  204. package/static/mapo/ckeditor/skins/moono-dark/readme.md +51 -0
  205. package/static/mapo/ckeditor/skins/moono-dark/skin.js +5 -0
  206. package/static/mapo/tinymce-skins/mapo-dark/content.inline.min.css +7 -0
  207. package/static/mapo/tinymce-skins/mapo-dark/content.min.css +7 -0
  208. package/static/mapo/tinymce-skins/mapo-dark/content.mobile.min.css +7 -0
  209. package/static/mapo/tinymce-skins/mapo-dark/skin.min.css +7 -0
  210. package/static/mapo/tinymce-skins/mapo-dark/skin.mobile.min.css +7 -0
  211. package/static/mapo/tinymce-skins/mapo-light/content.inline.min.css +7 -0
  212. package/static/mapo/tinymce-skins/mapo-light/content.min.css +7 -0
  213. package/static/mapo/tinymce-skins/mapo-light/content.mobile.min.css +7 -0
  214. package/static/mapo/tinymce-skins/mapo-light/skin.min.css +7 -0
  215. package/static/mapo/tinymce-skins/mapo-light/skin.mobile.min.css +7 -0
  216. package/translations/en-US.js +177 -0
  217. package/translations/it-IT.js +180 -0
  218. package/LICENSE.md +0 -20
  219. package/components/Detail/DetailField.vue +0 -132
  220. package/components/Detail/defaults.js +0 -55
  221. package/components/fields/M2mField.vue +0 -95
  222. package/components/fields/MediaField.vue +0 -195
  223. package/components/fields/MediaM2mField.vue +0 -238
  224. package/components/fields/TinyMce/TinyMce.vue +0 -180
  225. package/components/fields/TinyMce/defaults.js +0 -55
  226. package/components/layout/Sidebar/SidebarFooter.vue +0 -70
  227. package/defaults.js +0 -29
  228. package/layouts/error.vue +0 -45
  229. /package/components/{fields/TinyMce → Form/fields/wygEditor}/utils/events.js +0 -0
  230. /package/components/{fields/TinyMce/utils/script.injector.js → Form/fields/wygEditor/utils/tinymce.injector.js} +0 -0
  231. /package/static/{favicon.ico → mapo/favicon.ico} +0 -0
@@ -1,195 +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
- <v-hover v-model="isHovered">
12
- <div style="position: relative">
13
- <v-img
14
- v-if="mediaExists"
15
- :src="internalValue.file"
16
- :lazy-src="internalValue.thumbnail"
17
- v-bind="{
18
- aspectRatio,
19
- contain,
20
- height,
21
- width,
22
- maxWidth,
23
- maxHeight,
24
- minWidth,
25
- minHeight,
26
- }"
27
- >
28
- <template v-slot:placeholder>
29
- <v-row
30
- v-if="internalValue"
31
- class="fill-height ma-0"
32
- align="center"
33
- justify="center"
34
- >
35
- <v-progress-circular
36
- indeterminate
37
- color="grey"
38
- ></v-progress-circular>
39
- </v-row>
40
- </template>
41
- </v-img>
42
-
43
- <!-- If the media is not avaible, it shows a btn to add new media -->
44
- <v-card
45
- v-else-if="!rmAddBtn"
46
- v-bind="{
47
- height,
48
- width,
49
- maxWidth,
50
- maxHeight,
51
- minWidth,
52
- minHeight,
53
- ...$attrs,
54
- }"
55
- >
56
- <v-card-title>{{ label }}</v-card-title>
57
-
58
- <v-card-actions>
59
- <v-btn @click="editing = true" block :min-height="minHeight">
60
- <v-icon size="80"> mdi-plus-circle-outline </v-icon>
61
- </v-btn>
62
- </v-card-actions>
63
- </v-card>
64
-
65
- <!-- Shows darkening overlay on image with buttons on top while hovered -->
66
- <v-overlay opacity="0.3" absolute :value="overlay">
67
- <v-row>
68
- <v-col cols="12">
69
- <h3>{{ label }}</h3>
70
- </v-col>
71
- </v-row>
72
- <v-row>
73
- <v-col cols="6">
74
- <v-btn @click="editing = true" fab v-bind="$attrs">
75
- <v-icon>mdi-pencil</v-icon>
76
- </v-btn>
77
- </v-col>
78
-
79
- <v-col cols="6">
80
- <v-btn @click="confirmDelete" fab v-bind="$attrs">
81
- <v-icon>mdi-delete</v-icon>
82
- </v-btn>
83
- </v-col>
84
- </v-row>
85
- </v-overlay>
86
-
87
- <!-- Select media dialog -->
88
- <media-manager-dialog
89
- v-model="editing"
90
- select="single"
91
- v-on:selectionChange="update"
92
- v-bind="$attrs"
93
- >
94
- </media-manager-dialog>
95
-
96
- </div>
97
- </v-hover>
98
- </div>
99
- </template>
100
-
101
- <style scoped>
102
- </style>
103
-
104
- <script>
105
- export default {
106
- name: "MediaField",
107
- data() {
108
- return {
109
- internalValue: null,
110
- editing: false,
111
- isHovered: false,
112
- };
113
- },
114
-
115
- props: {
116
- value: Object,
117
- label: String,
118
- title: {
119
- type: String,
120
- default: () => "",
121
- },
122
- rmAddBtn: {
123
- type: Boolean,
124
- default: false,
125
- },
126
- //image reflections
127
- aspectRatio: {
128
- type: String | Number,
129
- default: undefined,
130
- },
131
- contain: {
132
- type: Boolean,
133
- default: false,
134
- },
135
- height: {
136
- type: String | Number,
137
- default: "100%",
138
- },
139
- width: {
140
- type: String | Number,
141
- default: "100%",
142
- },
143
- maxWidth: {
144
- type: String | Number,
145
- default: undefined,
146
- },
147
- maxHeight: {
148
- type: String | Number,
149
- default: undefined,
150
- },
151
- minWidth: {
152
- type: String | Number,
153
- default: undefined,
154
- },
155
- minHeight: {
156
- type: String | Number,
157
- default: 300,
158
- },
159
- },
160
-
161
- computed: {
162
- mediaExists() {
163
- return !!this.internalValue?.file;
164
- },
165
- overlay() {
166
- return this.isHovered && this.mediaExists;
167
- },
168
- },
169
-
170
- methods: {
171
- update(val) {
172
- this.internalValue = val;
173
- },
174
- confirmDelete() {
175
- this.$mapo.$confirm
176
- .open({
177
- title: "Remove",
178
- question: "Are you sure to want to remove this media?"
179
- })
180
- .then((res) => (res ? (this.internalValue = null) : null));
181
- },
182
- },
183
-
184
- watch: {
185
- value(val) {
186
- if (val !== this.internalValue) {
187
- this.internalValue = val;
188
- }
189
- },
190
- internalValue(val) {
191
- this.$emit("input", val);
192
- },
193
- },
194
- };
195
- </script>
@@ -1,238 +0,0 @@
1
- <template>
2
- <div>
3
- <v-card
4
- v-bind="{
5
- minWidth,
6
- minHeight,
7
- height,
8
- width,
9
- maxHeight,
10
- maxWidth,
11
- elevation,
12
- dark,
13
- light: !dark,
14
- }"
15
- >
16
- <v-card-title v-if="!pages">Media Carousel</v-card-title>
17
- <v-card-actions>
18
- <v-row justify="center" class="ma-1" no-gutters>
19
- <v-col>
20
- <v-btn
21
- @click="mmdialog = true"
22
- block
23
- outlined
24
- :min-height="pages ? undefined : minHeight"
25
- >
26
- <div v-if="pages">New Selection</div>
27
- <v-icon v-else size="80"> mdi-plus-circle-outline </v-icon>
28
- </v-btn>
29
- </v-col>
30
- </v-row>
31
- </v-card-actions>
32
-
33
- <v-window v-model="page">
34
- <v-window-item
35
- class="page"
36
- v-for="(pageMedias, i) in paginatedMedias"
37
- :key="i"
38
- >
39
- <v-container class="pa-0">
40
- <v-row
41
- v-for="row in rows"
42
- :key="row"
43
- align="center"
44
- align-content="center"
45
- justify="center"
46
- >
47
- <v-col v-for="col in cols" :key="col">
48
- <MediaElement
49
- v-if="pageMedias[getIndexFromGrid(row, col)]"
50
- v-model="pageMedias[getIndexFromGrid(row, col)]"
51
- :aspect-ratio="1"
52
- :dark="dark"
53
- rm-add-btn
54
- @changed-media="checkMediaEdit($event, i, row, col)"
55
- />
56
- <div v-else class="placeholder"></div>
57
- </v-col>
58
- </v-row>
59
- </v-container>
60
- </v-window-item>
61
- </v-window>
62
-
63
- <v-card-actions class="paginator mt-auto" v-if="pages">
64
- <v-row justify="center" class="py-2">
65
- <v-btn text @click="prev">
66
- <v-icon>mdi-chevron-left</v-icon>
67
- </v-btn>
68
- <v-item-group v-model="page" class="text-center mx-1" mandatory>
69
- <v-item
70
- v-for="n in pages"
71
- :key="`btn-${n}`"
72
- v-slot="{ active, toggle }"
73
- >
74
- <v-btn :input-value="active" icon @click="toggle">
75
- <v-icon>mdi-record</v-icon>
76
- </v-btn>
77
- </v-item>
78
- </v-item-group>
79
- <v-btn text @click="next">
80
- <v-icon>mdi-chevron-right</v-icon>
81
- </v-btn>
82
- </v-row>
83
- </v-card-actions>
84
- </v-card>
85
-
86
- <media-manager-dialog
87
- v-model="mmdialog"
88
- select="multi"
89
- v-on:selectionChange="update"
90
- :light="!dark"
91
- :dark="dark"
92
- >
93
- </media-manager-dialog>
94
- </div>
95
- </template>
96
-
97
- <style scoped>
98
- .v-card {
99
- display: flex;
100
- flex-direction: column;
101
- }
102
-
103
- .v-window {
104
- overflow: hidden;
105
- position: relative;
106
- width: 100%;
107
- }
108
-
109
- .placeholder {
110
- padding-bottom: 100%;
111
- }
112
- </style>
113
-
114
- <script>
115
- export default {
116
- name: "MediaM2mField",
117
- transition: "tasks-transition",
118
- data() {
119
- return {
120
- child_medias: [],
121
-
122
- page: 0,
123
- mmdialog: false,
124
- };
125
- },
126
-
127
- props: {
128
- medias: {
129
- type: Array,
130
- default: () => [],
131
- },
132
- cols: {
133
- type: Number,
134
- default: 2,
135
- },
136
- rows: {
137
- type: Number,
138
- default: 2,
139
- },
140
-
141
- //reflections
142
- minWidth: {
143
- type: Number | String,
144
- default: 300,
145
- },
146
- minHeight: {
147
- type: Number | String,
148
- default: 300,
149
- },
150
- height: {
151
- type: Number | String,
152
- },
153
- width: {
154
- type: Number | String,
155
- },
156
- maxHeight: {
157
- type: Number | String,
158
- },
159
- maxWidth: {
160
- type: Number | String,
161
- },
162
-
163
- elevation: {
164
- type: Number | String,
165
- default: undefined,
166
- },
167
- flat: {
168
- type: Boolean,
169
- default: false,
170
- },
171
-
172
- dark: {
173
- type: Boolean,
174
- default: false,
175
- },
176
- },
177
-
178
- model: {
179
- prop: "medias",
180
- event: "changed-selection",
181
- },
182
-
183
- mounted() {
184
- if (this.medias) this.child_medias = this.medias;
185
- },
186
-
187
- computed: {
188
- mediasPerPage() {
189
- return this.cols * this.rows;
190
- },
191
- pages() {
192
- return Math.ceil(this.child_medias.length / this.mediasPerPage);
193
- },
194
- paginatedMedias() {
195
- var array = new Array(this.pages);
196
- for (let i = 0; i < array.length; i++) {
197
- array[i] = this.child_medias.slice(
198
- i * this.mediasPerPage,
199
- (i + 1) * this.mediasPerPage
200
- );
201
- }
202
- return array;
203
- },
204
- },
205
-
206
- methods: {
207
- getIndexFromGrid(row, col) {
208
- return (row - 1) * this.cols + col - 1;
209
- },
210
- update(selection) {
211
- this.child_medias = [...selection];
212
- this.$emit("changed-selection", [...selection]);
213
- },
214
- checkMediaEdit(event, page, row, col) {
215
- //if event is not empty, then exit
216
- let index = this.mediasPerPage * page + this.getIndexFromGrid(row, col);
217
- if (event) {
218
- this.child_medias[index] = event;
219
- } else {
220
- this.child_medias.splice(index, 1);
221
- }
222
- this.update(this.child_medias);
223
- },
224
- next() {
225
- this.page = this.page + 1 === this.length ? 0 : this.page + 1;
226
- },
227
- prev() {
228
- this.page = this.page - 1 < 0 ? this.length - 1 : this.page - 1;
229
- },
230
- },
231
-
232
- watch: {
233
- medias(val) {
234
- this.child_medias = val;
235
- },
236
- },
237
- };
238
- </script>
@@ -1,180 +0,0 @@
1
- <template>
2
- <div>
3
- <media-manager-dialog ref="mediaManager"></media-manager-dialog>
4
- <span v-if="label" class="v-label" :class="{'error--text': errorMessages && errorMessages.length}">{{ label }}:</span>
5
- <div ref="editorNode">
6
- <v-skeleton-loader
7
- type="table-heading, list-item-two-line, list-item-avatar-two-line, list-item-three-lineimage, table-tfoot"
8
- ></v-skeleton-loader>
9
- </div>
10
- <div class="mt-2">
11
- <v-messages :value="errorMessages" color="error"></v-messages>
12
- </div>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- import initMapoMedia from "./utils/mapomedia.plugin.js";
18
- import injectScript from "./utils/script.injector.js";
19
- import defaults from "./defaults.js";
20
- import validEvents from "./utils/events.js";
21
-
22
- /**
23
- * This component wraps a [TinyMce](https://www.tiny.cloud/) instance. With the use of the v-model you can use this component to edit any content you like.
24
- */
25
-
26
- export default {
27
- name: "TinyMce",
28
- props: {
29
- // V-model property. Is the content that will populate the TinyMce instance.
30
- value: {
31
- type: String,
32
- default: "",
33
- },
34
- // This is the main configuration of TinyMce. If setted will be merged with this component defaults.
35
- conf: {
36
- type: Object,
37
- default: () => ({}),
38
- },
39
- // This label will be shown at the top of the editor.
40
- label: String,
41
- // This is an array of validation errors that will be displayed under the editor.
42
- errorMessages: Array,
43
- // This set the component status to disabled, stopping the user interaction.
44
- disabled: {
45
- type: Boolean,
46
- default: false,
47
- },
48
- // Use this prop to bind events. If set to true the component will emit every [TinyMce Event](https://www.tiny.cloud/docs/advanced/events/).
49
- bindevents: {
50
- type: Boolean,
51
- default: false,
52
- },
53
- },
54
-
55
- data() {
56
- return {
57
- editorInstance: null,
58
- editorContent: "",
59
- };
60
- },
61
-
62
- computed: {
63
- editor: {
64
- cache: false,
65
- get() {
66
- return this.editorInstance;
67
- },
68
- },
69
- },
70
-
71
- mounted() {
72
- injectScript().then(this.initEditor);
73
- },
74
-
75
- methods: {
76
- initEditor() {
77
- initMapoMedia(this.insertImgCallback);
78
- window.tinymce.init(
79
- Object.assign(defaults, this.conf, {
80
- target: this.$refs.editorNode,
81
- readonly: this.disabled,
82
- setup: (ctx) => this.setupEditor(ctx),
83
- })
84
- );
85
- },
86
- setupEditor(editor) {
87
- this.editorInstance = editor;
88
- editor.on("init", () => {
89
- editor.setContent(this.value || "");
90
- this.emitContent(editor);
91
- editor.on("change input undo redo keyup", () =>
92
- this.emitContent(editor)
93
- );
94
- });
95
- this.bindEvents(editor);
96
- },
97
- emitContent(editor) {
98
- this.editorContent = editor.getContent();
99
- // Fired when the v-model changes
100
- //@arg Emits the content of the editor
101
- this.$emit("input", this.editorContent);
102
- },
103
- bindEvents(editor) {
104
- if (this.bindevents) {
105
- validEvents.forEach((eventName) => {
106
- // This is a dynamic event emitter. If you activate the bindevents prop, you will be able to listen to every [TinyMce Event](https://www.tiny.cloud/docs/advanced/events/).
107
- editor.on(eventName, (event) => this.$emit(eventName, event));
108
- });
109
- }
110
- },
111
- insertImgCallback: async function () {
112
- return new Promise((resolve, reject) => {
113
- this.$refs.mediaManager
114
- .open()
115
- .then((result) =>
116
- result
117
- ? resolve(`<img width="50%" src="${result.file}">`)
118
- : reject("No image selected")
119
- )
120
- .catch((error) => reject(error));
121
- });
122
- },
123
- },
124
- beforeDestroy() {
125
- window && window.tinymce && window.tinymce.remove(this.editor);
126
- },
127
- watch: {
128
- value(val) {
129
- if (this.editor && this.editor.initialized && val !== this.editorContent) {
130
- this.editorContent = val
131
- this.editor.setContent(val);
132
- }
133
- },
134
- disabled(val) {
135
- if (this.editor && this.editor.initialized) {
136
- this.editor.setMode(val ? "readonly" : "design");
137
- }
138
- },
139
- },
140
- };
141
- </script>
142
-
143
- <style>
144
- .tox-notifications-container,
145
- .tox-statusbar__branding {
146
- display: none;
147
- }
148
- .v-label.error--text{
149
- animation: v-shake 0.6s cubic-bezier(0.25, 0.8, 0.5, 1);
150
- }
151
- </style>
152
-
153
- <docs>
154
-
155
- ### Defaults
156
-
157
- This is the default [TinyMce configuration](https://www.tiny.cloud/docs/configure/).
158
-
159
- ```js
160
- {
161
- plugins: 'mapomedia preview paste importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable help charmap quickbars emoticons',
162
- menubar: 'file edit view insert format tools table help',
163
- toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview | insertfile image mapomedia media template link anchor codesample | ltr rtl',
164
- toolbar_sticky: true,
165
- image_advtab: true,
166
- importcss_append: true,
167
- template_cdate_format: '[Date Created (CDATE): %m/%d/%Y : %H:%M:%S]',
168
- template_mdate_format: '[Date Modified (MDATE): %m/%d/%Y : %H:%M:%S]',
169
- height: 600,
170
- image_caption: true,
171
- quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
172
- noneditable_noneditable_class: 'mceNonEditable',
173
- toolbar_mode: 'sliding',
174
- contextmenu: 'link image imagetools table',
175
- skin: useDarkMode ? 'oxide-dark' : 'oxide',
176
- content_css: useDarkMode ? 'dark' : 'default',
177
- content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
178
- }
179
- ```
180
- </docs>
@@ -1,55 +0,0 @@
1
- var useDarkMode = false;
2
-
3
- export default {
4
- plugins: 'mapomedia preview paste importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable help charmap quickbars emoticons',
5
- // imagetools_cors_hosts: ['picsum.photos'],
6
- menubar: 'file edit view insert format tools table help',
7
- toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview | insertfile image mapomedia media template link anchor codesample | ltr rtl',
8
- toolbar_sticky: true,
9
- image_advtab: true,
10
- // link_list: [
11
- // { title: 'My page 1', value: 'https://www.tiny.cloud' },
12
- // { title: 'My page 2', value: 'http://www.moxiecode.com' }
13
- // ],
14
- // image_list: [
15
- // { title: 'My page 1', value: 'https://www.tiny.cloud' },
16
- // { title: 'My page 2', value: 'http://www.moxiecode.com' }
17
- // ],
18
- // image_class_list: [
19
- // { title: 'None', value: '' },
20
- // { title: 'Some class', value: 'class-name' }
21
- // ],
22
- importcss_append: true,
23
- // file_picker_callback: function (callback, value, meta) {
24
- // /* Provide file and text for the link dialog */
25
- // if (meta.filetype === 'file') {
26
- // callback('https://www.google.com/logos/google.jpg', { text: 'My text' });
27
- // }
28
-
29
- // /* Provide image and alt text for the image dialog */
30
- // if (meta.filetype === 'image') {
31
- // callback('https://www.google.com/logos/google.jpg', { alt: 'My alt text' });
32
- // }
33
-
34
- // /* Provide alternative source and posted for the media dialog */
35
- // if (meta.filetype === 'media') {
36
- // callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.google.com/logos/google.jpg' });
37
- // }
38
- // },
39
- // templates: [
40
- // { title: 'New Table', description: 'creates a new table', content: '<div class="mceTmpl"><table width="98%%" border="0" cellspacing="0" cellpadding="0"><tr><th scope="col"> </th><th scope="col"> </th></tr><tr><td> </td><td> </td></tr></table></div>' },
41
- // { title: 'Starting my story', description: 'A cure for writers block', content: 'Once upon a time...' },
42
- // { title: 'New list with dates', description: 'New List with dates', content: '<div class="mceTmpl"><span class="cdate">cdate</span><br /><span class="mdate">mdate</span><h2>My List</h2><ul><li></li><li></li></ul></div>' }
43
- // ],
44
- template_cdate_format: '[Date Created (CDATE): %m/%d/%Y : %H:%M:%S]',
45
- template_mdate_format: '[Date Modified (MDATE): %m/%d/%Y : %H:%M:%S]',
46
- height: 400,
47
- image_caption: true,
48
- quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
49
- noneditable_noneditable_class: 'mceNonEditable',
50
- toolbar_mode: 'sliding',
51
- contextmenu: 'link image imagetools table',
52
- skin: useDarkMode ? 'oxide-dark' : 'oxide',
53
- content_css: useDarkMode ? 'dark' : 'default',
54
- content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
55
- }