@mapomodule/uikit 1.0.0-alpha.23 → 1.0.0-alpha.26

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 (38) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/components/ConfirmDialog.vue +10 -14
  3. package/components/Detail/Detail.vue +12 -12
  4. package/components/DropArea.vue +17 -33
  5. package/components/Form/FormGroup.vue +15 -1
  6. package/components/Form/FormTabs.vue +13 -1
  7. package/components/Form/fields/DateField.vue +3 -3
  8. package/components/Form/fields/FksField.vue +2 -2
  9. package/components/Form/fields/MediaField.vue +10 -5
  10. package/components/Form/fields/MediaM2mField.vue +3 -3
  11. package/components/Form/fields/Repeater.vue +7 -7
  12. package/components/Form/fields/SeoPreview.vue +5 -9
  13. package/components/LangSwitcher.vue +44 -0
  14. package/components/List/List.vue +14 -15
  15. package/components/List/ListActions.vue +5 -5
  16. package/components/List/ListFilters.vue +9 -2
  17. package/components/List/ListHead.vue +1 -1
  18. package/components/List/ListQuickEdit.vue +4 -4
  19. package/components/List/ListTable.vue +11 -12
  20. package/components/Login.vue +5 -4
  21. package/components/LogoutButton.vue +43 -28
  22. package/components/MediaManager/MediaEditor.vue +20 -18
  23. package/components/MediaManager/MediaFolders.vue +14 -19
  24. package/components/MediaManager/MediaGallery.vue +1 -1
  25. package/components/MediaManager/MediaManager.vue +22 -15
  26. package/components/MediaManager/MediaManagerDialog.vue +2 -1
  27. package/components/MediaManager/MediaUploader.vue +6 -7
  28. package/components/SnackBar.vue +2 -3
  29. package/components/layout/Sidebar/SidebarFooter.vue +6 -25
  30. package/components/layout/Sidebar/SidebarListItem.vue +2 -2
  31. package/components/layout/Sidebar/SidebarProfile.vue +2 -2
  32. package/defaults/i18n.js +37 -0
  33. package/{defaults.js → defaults/vuetify.js} +16 -12
  34. package/module.js +6 -4
  35. package/package.json +3 -2
  36. package/pages/index.vue +1 -1
  37. package/translations/en-US.js +129 -0
  38. package/translations/it-IT.js +131 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,62 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.26](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.25...v1.0.0-alpha.26) (2022-08-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * correct langDir path on i18n defaults ([100239f](https://github.com/lotrekagency/mapo/commit/100239fb11b268baa67e6549a0a68e98348e8301))
12
+
13
+
14
+
15
+
16
+
17
+ # [1.0.0-alpha.25](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.24...v1.0.0-alpha.25) (2022-08-02)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * fix detail field language list ([1d290e6](https://github.com/lotrekagency/mapo/commit/1d290e69c180fe31c97dfb45e2c1afcdcb569f1d))
23
+ * fix mediauploader typo ([67e7e4e](https://github.com/lotrekagency/mapo/commit/67e7e4e8e2214580c99331d7c21eef551edf08cc))
24
+ * fixed bug on preview image ([f2878ee](https://github.com/lotrekagency/mapo/commit/f2878ee5d60bc74cab49ee0c055ace22f7d37076))
25
+ * removed some accidental trash from previous commit ([4a85da4](https://github.com/lotrekagency/mapo/commit/4a85da419bddaadfe6a08afa5f71fe5e76e346f7))
26
+
27
+
28
+ ### Features
29
+
30
+ * **i18n:** move i18n config to mapo defaults to enable mixed merges of user and mapo options. ([2190aa9](https://github.com/lotrekagency/mapo/commit/2190aa9ebf106d811a64e27502d3a45b75a3e9af))
31
+
32
+
33
+
34
+
35
+
36
+ # [1.0.0-alpha.24](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2022-07-22)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * **i18n:** use iso code for vuetify language code ([0683c78](https://github.com/lotrekagency/mapo/commit/0683c78ecf3f3e196b0fb6e7c8d007e20f12bf62))
42
+ * fixed login screen ([f925672](https://github.com/lotrekagency/mapo/commit/f92567288c07ae6162bfc14f2ac220aff193ad5f))
43
+ * **list:** pass selectionQuery to list actions ([7385daa](https://github.com/lotrekagency/mapo/commit/7385daaf6ef727123c966dec3747c1c18c54f73a))
44
+ * **listfilters:** added watch on list filters ([753f40e](https://github.com/lotrekagency/mapo/commit/753f40e7776935bc0f3e499c573868d5e7e0502d))
45
+
46
+
47
+ ### Features
48
+
49
+ * **i18:** handle i18n on images' alt title tags ([3fb3f62](https://github.com/lotrekagency/mapo/commit/3fb3f62ae045b6610c881f90e31f0b5a242ce46b))
50
+ * **i18n:** handle translations on meta router ([2e20afe](https://github.com/lotrekagency/mapo/commit/2e20afedd34b42adb7d9cc53235a7e469ae67e9d))
51
+ * added language switcher ([6995542](https://github.com/lotrekagency/mapo/commit/6995542228acc8c603d28b29edf1abee02f23404))
52
+ * refactored translations, added vuetify translations ([bd37682](https://github.com/lotrekagency/mapo/commit/bd376820ad05a00f49088b9585b7bb26371e09f8))
53
+ * **form:** added vShow on tabs and groups ([631e43f](https://github.com/lotrekagency/mapo/commit/631e43f10c7614e87a393a688fa1339092ef0cb7))
54
+ * **i18n:** i18n for detail and form fields ([74760b1](https://github.com/lotrekagency/mapo/commit/74760b1c72314df34f3bb7e5dbaf95037d9c40fe))
55
+ * **i18n:** i18n on sidebar and list components ([64fb9a1](https://github.com/lotrekagency/mapo/commit/64fb9a152836b5620f52b1a448dc00ecafcd9ea3))
56
+ * **i18n:** setup on generic and media components ([f38588f](https://github.com/lotrekagency/mapo/commit/f38588f56aedbf9466af5c40296e35bf2765d036))
57
+
58
+
59
+
60
+
61
+
6
62
  # [1.0.0-alpha.23](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2022-05-04)
7
63
 
8
64
 
@@ -15,15 +15,15 @@
15
15
  </v-dialog>
16
16
  </div>
17
17
  </template>
18
- <script>
19
18
 
19
+ <script>
20
20
  /**
21
- * This component is embedded in the default layout.
21
+ * This component is embedded in the default layout.
22
22
  * It's a dynamic dialog which is used to ask the user for confirmation before performing an operation.<br>
23
23
  * For example: `Do you really want to delete the content 'abcd'?` <br><br>
24
24
  * It can be globally accessed with [this.$mapo.$confirm](/core/#confirm)
25
- *
26
- */
25
+ *
26
+ */
27
27
  export default {
28
28
  name: "ConfirmDialog",
29
29
  data() {
@@ -32,10 +32,10 @@ export default {
32
32
  dialog: false,
33
33
  optionsBk: null,
34
34
  options: {
35
- title: this.title,
36
- question: this.question,
37
- dismissButton: this.dismissButton,
38
- approveButton: this.approveButton,
35
+ title: this.title || this.$t("mapo.confirm"),
36
+ question: this.question || this.$t("mapo.confirmDialog.areYouSure"),
37
+ dismissButton: this.dismissButton || { text: this.$t("mapo.cancel"), attrs: { text: true } },
38
+ approveButton: this.approveButton || { text: this.$t("mapo.ok"), attrs: { color: "primary", text: true } },
39
39
  attrs: { ...this.$attrs }
40
40
  },
41
41
  on: {
@@ -56,35 +56,31 @@ export default {
56
56
  // The text in the body of the dialog.
57
57
  question: {
58
58
  type: String,
59
- default: "Are you sure of what you are doing?"
60
59
  },
61
60
  // The title of the dialog.
62
61
  title: {
63
62
  type: String,
64
- default: "Confirm"
65
63
  },
66
64
  // The text plus props passed to the dismiss Button.
67
65
  dismissButton: {
68
66
  // `{ text: String, attrs: Object }`
69
67
  type: Object,
70
- default: () => ({ text: "Cancel", attrs: { text: true } })
71
68
  },
72
69
  // The text plus props passed to the approve Button.
73
70
  approveButton: {
74
71
  // `{ text: String, attrs: Object }`
75
72
  type: Object,
76
- default: () => ({ text: "Ok", attrs: { color: "primary", text: true } })
77
73
  }
78
74
  },
79
75
  computed: {
80
76
  approveTxt() {
81
- return this.options.approveButton?.text || "Ok";
77
+ return this.options.approveButton?.text || this.$t("mapo.ok");
82
78
  },
83
79
  approveAttrs() {
84
80
  return this.options.approveButton?.attrs || {};
85
81
  },
86
82
  dismissTxt() {
87
- return this.options.dismissButton?.text || "Cancel";
83
+ return this.options.dismissButton?.text || this.$t("mapo.cancel");
88
84
  },
89
85
  dismissAttrs() {
90
86
  return this.options.dismissButton?.attrs || {};
@@ -9,7 +9,7 @@
9
9
  ></v-progress-linear>
10
10
  <span class="detail-component-loading ">
11
11
  <v-icon size="30">mdi-timer-sand</v-icon>
12
- Fetching data..
12
+ {{ $t('mapo.fetchingData') }}
13
13
  </span>
14
14
  </div>
15
15
  <div v-else>
@@ -17,7 +17,7 @@
17
17
  <slot name="title" v-bind="slotBindings">
18
18
  <!-- `<h1> "Create | Edit" + modelName </h1>` -->
19
19
  <v-row class="mb-5">
20
- <v-col col="12"><h1 class="display-1">{{ isNew ? "Create" : "Edit" }} {{ modelName }}</h1></v-col>
20
+ <v-col col="12"><h1 class="display-1">{{ isNew ? $t("mapo.create") : $t("mapo.edit") }} {{ modelName }}</h1></v-col>
21
21
  </v-row>
22
22
  </slot>
23
23
  <v-form ref="form">
@@ -74,21 +74,21 @@
74
74
  <slot name="button.save" v-bind="slotBindings">
75
75
  <!-- The Save button. -->
76
76
  <v-btn v-show="canGoBack" :disabled="isReadonly" class="mb-2" tile block @click="saveItem(true)">{{
77
- isNew ? "Create" : "Save"
77
+ isNew ? $t("mapo.create") : $t("mapo.save")
78
78
  }}</v-btn>
79
79
  </slot>
80
80
  <!-- Use this to override the Save and continue button. -->
81
81
  <slot name="button.savecontinue" v-bind="slotBindings">
82
82
  <!-- The Save and continue button. -->
83
83
  <v-btn :disabled="isReadonly" class="mb-2" tile block @click="saveItem(false)"
84
- >{{ isNew ? "Create" : "Save" }} and continue</v-btn
84
+ >{{ isNew ? $t("mapo.createContinue") : $t("mapo.saveContinue") }}</v-btn
85
85
  >
86
86
  </slot>
87
87
  <!-- Use this to override the Back button. -->
88
88
  <slot name="button.back" v-bind="slotBindings">
89
89
  <!-- The Back button. -->
90
90
  <v-btn v-show="canGoBack" class="mb-2" tile block @click="back"
91
- >Back</v-btn
91
+ >{{ $t("mapo.back") }}</v-btn
92
92
  >
93
93
  </slot>
94
94
  <!-- Use this to override the Delete button. -->
@@ -102,7 +102,7 @@
102
102
  block
103
103
  :disabled="!canDelete"
104
104
  @click="deleteItem"
105
- >Delete</v-btn
105
+ >{{ $t("mapo.delete") }}</v-btn
106
106
  >
107
107
  </slot>
108
108
  </div>
@@ -235,7 +235,7 @@ export default {
235
235
  this.errors =
236
236
  (error.response.status == 400 && error.response.data) || null;
237
237
  this.$mapo.$snack.open({
238
- message: error.response?.data?.detail || "Something whent bad, please try again later...",
238
+ message: error.response?.data?.detail || this.$t("mapo.genericError"),
239
239
  color: "error"
240
240
  });
241
241
  });
@@ -244,8 +244,8 @@ export default {
244
244
  this.$mapo.$confirm
245
245
  .open({
246
246
  title: "Delete",
247
- question: "Are you sure you want to delete this item?",
248
- approveButton: { text: "Delete", attrs: { color: "red", text: true } }
247
+ question: this.$t("mapo.confirmDelete"),
248
+ approveButton: { text: this.$t("mapo.delete"), attrs: { color: "red", text: true } }
249
249
  })
250
250
  .then(res => {
251
251
  if (res) {
@@ -253,7 +253,7 @@ export default {
253
253
  .delete(this.identifier)
254
254
  .then(() => this.back())
255
255
  .catch(error => this.$mapo.$snack.open({
256
- message: error.response?.data?.detail || "Something whent bad, please try again later...",
256
+ message: error.response?.data?.detail || this.$t("mapo.genericError"),
257
257
  color: "error"
258
258
  }));
259
259
  }
@@ -320,7 +320,7 @@ export default {
320
320
  return !Object.keys(this.model).length;
321
321
  },
322
322
  langs() {
323
- return this.modelLanguages || this.languages;
323
+ return (this.modelLanguages || []).length ? this.modelLanguages : this.languages;
324
324
  },
325
325
  slotBindings() {
326
326
  return {
@@ -351,7 +351,7 @@ export default {
351
351
  this.model = res;
352
352
  this.modelLanguages = this.model?.lang_info?.site_languages.map(l => l.id);
353
353
  }).catch(error => {
354
- this.$nuxt.error({ statusCode: error.response.status, message: error.response.data?.detail || "Ops some error occurred.." });
354
+ this.$nuxt.error({ statusCode: error.response.status, message: error.response.data?.detail || this.$t("mapo.genericError") });
355
355
  });
356
356
  }
357
357
  else if (this.value) {
@@ -19,7 +19,7 @@
19
19
  <v-icon :class="[dragover ? 'mt-2, mb-6' : 'mt-5']" size="60">
20
20
  mdi-cloud-upload
21
21
  </v-icon>
22
- <p>Drop your file(s) here, or click to select them.</p>
22
+ <p>{{ $t("mapo.dropArea.dropOrClick") }}</p>
23
23
  <input
24
24
  type="file"
25
25
  style="display: none"
@@ -30,9 +30,7 @@
30
30
  </v-row>
31
31
  <v-virtual-scroll
32
32
  :items="uploadedFiles"
33
- :height="
34
- uploadedFiles.length * 64 > 256 ? 256 : uploadedFiles.length * 64
35
- "
33
+ :height="uploadedFiles.length * 64 > 256 ? 256 : uploadedFiles.length * 64"
36
34
  item-height="64"
37
35
  >
38
36
  <template v-slot:default="{ item }">
@@ -41,10 +39,7 @@
41
39
  <v-img :src="item.info.objectURL"></v-img>
42
40
  </v-list-item-avatar>
43
41
 
44
- <v-list-item-content
45
- class="cursor-pointer"
46
- @click.stop="editItem(item)"
47
- >
42
+ <v-list-item-content class="cursor-pointer" @click.stop="editItem(item)">
48
43
  <v-list-item-title>
49
44
  {{ item.info.name }}
50
45
  </v-list-item-title>
@@ -74,11 +69,7 @@
74
69
  </v-btn>
75
70
  </slot>
76
71
  </v-card-actions>
77
- <v-dialog
78
- v-model="editDialog"
79
- v-bind="{ light, dark, elevation }"
80
- max-width="500px"
81
- >
72
+ <v-dialog v-model="editDialog" v-bind="{ light, dark, elevation }" max-width="500px">
82
73
  <v-card v-if="editedItem">
83
74
  <v-card-title>
84
75
  <!-- Slot to provide custom edit card title. Exposes `editedItem`. -->
@@ -102,7 +93,7 @@
102
93
  <v-col cols="12">
103
94
  <v-text-field
104
95
  v-model="editedItem.name"
105
- label="File name"
96
+ :label="$t('mapo.fileName')"
106
97
  ></v-text-field>
107
98
  </v-col>
108
99
  </v-row>
@@ -112,8 +103,8 @@
112
103
 
113
104
  <v-card-actions>
114
105
  <v-spacer></v-spacer>
115
- <v-btn color="primary" text @click="closeEdit"> Cancel </v-btn>
116
- <v-btn color="primary" text @click="saveEdit"> Save </v-btn>
106
+ <v-btn color="primary" text @click="closeEdit">{{ $t("mapo.cancel") }}</v-btn>
107
+ <v-btn color="primary" text @click="saveEdit">{{ $t("mapo.save") }}</v-btn>
117
108
  </v-card-actions>
118
109
  </v-card>
119
110
  </v-dialog>
@@ -133,8 +124,8 @@ import { humanFileSize } from "@mapomodule/utils/helpers/formatters";
133
124
  * You can drag and drop over the button or click it to load the files.
134
125
  * When files are loaded into the component it will emit an event containing all the files.
135
126
  * This component will not take care of the actual file upload.
136
- *
137
- */
127
+ *
128
+ */
138
129
  export default {
139
130
  name: "DropArea",
140
131
  props: {
@@ -174,9 +165,7 @@ export default {
174
165
  this.uploadedFiles = [];
175
166
  },
176
167
  removeFile(fileName) {
177
- const index = this.uploadedFiles.findIndex(
178
- (file) => file.info.name === fileName
179
- );
168
+ const index = this.uploadedFiles.findIndex((file) => file.info.name === fileName);
180
169
  if (index > -1) this.uploadedFiles.splice(index, 1);
181
170
  },
182
171
  pickFile() {
@@ -193,7 +182,7 @@ export default {
193
182
  if (this.uploadedFiles.length > 0) this.uploadedFiles = [];
194
183
  if (!this.multiple && files.length > 1) {
195
184
  this.$mapo.$snack.open({
196
- message: "Only one file can be uploaded at a time..",
185
+ message: this.$t("mapo.dropArea.onlyOneFile"),
197
186
  color: "error",
198
187
  });
199
188
  } else {
@@ -207,9 +196,7 @@ export default {
207
196
  processFile(blob) {
208
197
  return {
209
198
  info: {
210
- objectURL: blob.type.startsWith("image/")
211
- ? URL.createObjectURL(blob)
212
- : null,
199
+ objectURL: blob.type.startsWith("image/") ? URL.createObjectURL(blob) : null,
213
200
  name: blob.name,
214
201
  size: humanFileSize(blob.size, true, 2),
215
202
  type: blob.type,
@@ -223,10 +210,7 @@ export default {
223
210
  this.editDialog = true;
224
211
  },
225
212
  saveEdit() {
226
- this.uploadedFiles[this.editedIndex].info = Object.assign(
227
- {},
228
- this.editedItem
229
- );
213
+ this.uploadedFiles[this.editedIndex].info = Object.assign({}, this.editedItem);
230
214
  this.closeEdit();
231
215
  },
232
216
  closeEdit() {
@@ -240,11 +224,11 @@ export default {
240
224
  watch: {
241
225
  uploadedFiles(val) {
242
226
  /** Fires when the list of files loaded changes
243
- * @arg This emits a list of files in the format {info, blob} where the blob is a
244
- * [File](https://developer.mozilla.org/en-US/docs/Web/API/File) and info are some custom info about the file.
245
- */
227
+ * @arg This emits a list of files in the format {info, blob} where the blob is a
228
+ * [File](https://developer.mozilla.org/en-US/docs/Web/API/File) and info are some custom info about the file.
229
+ */
246
230
  this.$emit("change", val);
247
231
  },
248
232
  },
249
233
  };
250
- </script>
234
+ </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <v-card v-if="conf" class="my-2 rounded-0 elevation-0 group-card">
2
+ <v-card v-if="conf" v-show="show(conf.group)" class="my-2 rounded-0 elevation-0 group-card">
3
3
  <v-card-title :class="conf.group.titleClass">
4
4
  <slot name="title.before" v-bind="slotBindings" />
5
5
  <slot name="title" v-bind="slotBindings">
@@ -87,6 +87,20 @@ export default {
87
87
  };
88
88
  },
89
89
  },
90
+ methods: {
91
+ show(conf, type = "display"){
92
+ const prop = type == "visibility" ? "vVisible" : "vShow"
93
+ if (typeof conf[prop] == "function") {
94
+ return conf[prop]({
95
+ model: this.model,
96
+ errors: this.errors,
97
+ languages: this.languages,
98
+ currentLang: this.currentLang
99
+ })
100
+ }
101
+ return true
102
+ },
103
+ },
90
104
  created() {
91
105
  this.model = this.value;
92
106
  },
@@ -10,7 +10,7 @@
10
10
  </v-card-title>
11
11
  <div class="container">
12
12
  <v-tabs v-model="tabIndex" class="tab-wrapper">
13
- <v-tab v-for="(tab, index) in conf.tabs" :key="index">
13
+ <v-tab v-for="(tab, index) in conf.tabs" :key="index" v-show="show(tab)">
14
14
  <v-badge :value="hasErrors(tab)" color="error" dot>
15
15
  {{ tab.label }} <v-icon v-if="tab.icon">{{ tab.icon }}</v-icon>
16
16
  </v-badge>
@@ -131,6 +131,18 @@ export default {
131
131
  Array.isArray(val)
132
132
  ).some((k) => tab.fields.some((f) => k.startsWith(f.value)));
133
133
  },
134
+ show(conf, type = "display"){
135
+ const prop = type == "visibility" ? "vVisible" : "vShow"
136
+ if (typeof conf[prop] == "function") {
137
+ return conf[prop]({
138
+ model: this.model,
139
+ errors: this.errors,
140
+ languages: this.languages,
141
+ currentLang: this.currentLang
142
+ })
143
+ }
144
+ return true
145
+ },
134
146
  },
135
147
  created() {
136
148
  this.model = this.value;
@@ -21,8 +21,8 @@
21
21
  ></v-text-field>
22
22
  </template>
23
23
  <v-date-picker v-model="model" :range="range" no-title>
24
- <v-btn text color="primary" @click="menu = false"> Cancel </v-btn>
25
- <v-btn text color="primary" @click="$refs.menu.save(model)"> OK </v-btn>
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
26
  </v-date-picker>
27
27
  </v-menu>
28
28
  </div>
@@ -71,4 +71,4 @@ export default {
71
71
  this.model = this.value;
72
72
  },
73
73
  };
74
- </script>
74
+ </script>
@@ -40,7 +40,7 @@ export default {
40
40
  chips: this.$attrs.multiple === false ? false : true,
41
41
  multiple: true,
42
42
  loading: this.loading,
43
- noDataText: this.loading ? "Fetching data.." : undefined,
43
+ noDataText: this.loading ? this.$t("mapo.fetchingData") : undefined,
44
44
  ...this.$attrs,
45
45
  };
46
46
  },
@@ -85,4 +85,4 @@ export default {
85
85
  }
86
86
  },
87
87
  };
88
- </script>
88
+ </script>
@@ -14,7 +14,6 @@
14
14
  v-if="mediaExists"
15
15
  :src="internalValue.is_image && internalValue.file || null"
16
16
  :lazy-src="internalValue.is_image && internalValue.thumbnail || null"
17
-
18
17
  :class="{'grey lighten-2': !internalValue.is_image}"
19
18
  v-bind="{
20
19
  aspectRatio,
@@ -200,12 +199,17 @@ export default {
200
199
  confirmDelete() {
201
200
  this.$mapo.$confirm
202
201
  .open({
203
- title: "Remove",
204
- question: "Are you sure to want to remove this media?",
205
- approveButton: { text: "Remove", attrs: { color: "red", text: true } }
202
+ title: this.$t("mapo.remove"),
203
+ question: this.$t("mapo.mediaField.confirmRemove"),
204
+ approveButton: { text: this.$t("mapo.remove"), attrs: { color: "red", text: true } }
206
205
  })
207
206
  .then((res) => (res ? (this.internalValue = null) : null));
208
207
  },
208
+ isImage(val) {
209
+ if (!val?.is_image && val?.mime_type.includes("image")) {
210
+ Object.assign(val, { is_image: true });
211
+ }
212
+ },
209
213
  },
210
214
 
211
215
  watch: {
@@ -215,6 +219,7 @@ export default {
215
219
  }
216
220
  },
217
221
  internalValue(val) {
222
+ this.isImage(val)
218
223
  this.$emit("input", val);
219
224
  },
220
225
  },
@@ -222,4 +227,4 @@ export default {
222
227
  this.internalValue = this.val
223
228
  }
224
229
  };
225
- </script>
230
+ </script>
@@ -13,7 +13,7 @@
13
13
  light: !dark,
14
14
  }"
15
15
  >
16
- <v-card-title v-if="!pages">Media Carousel</v-card-title>
16
+ <v-card-title v-if="!pages">{{ $t("mapo.mediaM2MField.mediaCarousel") }}</v-card-title>
17
17
  <v-card-actions>
18
18
  <v-row justify="center" class="ma-1" no-gutters>
19
19
  <v-col>
@@ -23,7 +23,7 @@
23
23
  outlined
24
24
  :min-height="pages ? undefined : minHeight"
25
25
  >
26
- <div v-if="pages">New Selection</div>
26
+ <div v-if="pages">{{ $t("mapo.mediaM2MField.newSelection") }}</div>
27
27
  <v-icon v-else size="80"> mdi-plus-circle-outline </v-icon>
28
28
  </v-btn>
29
29
  </v-col>
@@ -240,4 +240,4 @@ export default {
240
240
  },
241
241
  },
242
242
  };
243
- </script>
243
+ </script>
@@ -3,7 +3,7 @@
3
3
  <div class="d-flex justify-space-between">
4
4
  <span class="repeater-label">{{ label }}:</span>
5
5
  <v-btn v-if="collapsable" outlined tile text small @click="collapseAll"
6
- >Collapse all</v-btn
6
+ >{{ $t("mapo.collapse") }}</v-btn
7
7
  >
8
8
  </div>
9
9
  <draggable
@@ -70,7 +70,7 @@
70
70
  >mdi-plus-circle-outline</v-icon
71
71
  >
72
72
  </template>
73
- <span>Add here</span>
73
+ <span>{{ $t("mapo.repeater.addHere") }}</span>
74
74
  </v-tooltip>
75
75
  <v-tooltip right>
76
76
  <template v-slot:activator="{ on, attrs }">
@@ -86,7 +86,7 @@
86
86
  >
87
87
  </v-hover>
88
88
  </template>
89
- <span>Remove</span>
89
+ <span>{{ $t("mapo.remove") }}</span>
90
90
  </v-tooltip>
91
91
  <v-icon
92
92
  v-if="!readonly && sortable"
@@ -108,12 +108,12 @@
108
108
  tile
109
109
  text
110
110
  >
111
- <v-icon>mdi-plus</v-icon> Add</v-btn
111
+ <v-icon>mdi-plus</v-icon> {{ $t("mapo.add") }}</v-btn
112
112
  >
113
113
  </div>
114
114
  <v-dialog v-if="hasTemplates" v-model="tModalOpen" width="600" scrollable>
115
115
  <v-card>
116
- <v-card-title class="text-h5"> Select template </v-card-title>
116
+ <v-card-title class="text-h5">{{ $t("mapo.repeater.selectTemplate") }}</v-card-title>
117
117
  <v-card-text>
118
118
  <div class="row mt-4">
119
119
  <div
@@ -177,7 +177,7 @@
177
177
  }
178
178
  .theme--light .repeater-line-wrapper { border-color: rgba(0, 0, 0, 0.12); }
179
179
  .repeater-line-wrapper {
180
- border: 1px solid;
180
+ border: 1px solid;
181
181
  border-bottom: none;
182
182
  border-color: rgba(255, 255, 255, 0.12);
183
183
  &:hover {
@@ -384,7 +384,7 @@ export default {
384
384
  return Object.keys(slots).reduce((acc, v) => ({ [v]: v, ...acc }), {});
385
385
  },
386
386
  getCollapsedLabel(model, index) {
387
- const fallback = `Item ${index + 1}`;
387
+ const fallback = this.$t("mapo.repeater.item", {numberItem: index + 1});
388
388
  switch (typeof this.collapsedLabel) {
389
389
  case "string":
390
390
  return getPointed(model, this.collapsedLabel, fallback);
@@ -51,9 +51,7 @@ export default {
51
51
  },
52
52
  // Seo title
53
53
  title: {
54
- type: String,
55
- default:
56
- "It was the best of times, it was the blurst of times, it was the ..."
54
+ type: String
57
55
  },
58
56
  // Seo permalink
59
57
  permalink: {
@@ -62,9 +60,7 @@ export default {
62
60
  },
63
61
  // Seo description
64
62
  description: {
65
- type: String,
66
- default:
67
- "This is an example description that will get replaced when you start typing. Make sure to keep descriptions mobile-friendly and keyword-rich!"
63
+ type: String
68
64
  },
69
65
  domain: {
70
66
  type: String,
@@ -75,7 +71,7 @@ export default {
75
71
  getTitle(){
76
72
  if (this.value && this.value.title)
77
73
  return this.value.title
78
- return this.title
74
+ return this.title || this.$t("mapo.seoPreview.title")
79
75
  },
80
76
  getPermalink(){
81
77
  if (this.value && this.value.permalink)
@@ -85,9 +81,9 @@ export default {
85
81
  getDescription(){
86
82
  if (this.value && this.value.description)
87
83
  return this.value.description
88
- return this.description
84
+ return this.description || this.$t("mapo.seoPreview.description")
89
85
  }
90
86
  },
91
87
 
92
88
  };
93
- </script>
89
+ </script>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <v-select
3
+ :items="$i18n.locales"
4
+ :value="$i18n.locale"
5
+ @input="$i18n.setLocale($event)"
6
+ dense
7
+ flat
8
+ hide-details
9
+ solo
10
+ background-color="transparent"
11
+ item-value="code"
12
+ >
13
+ <template v-slot:selection="{ item }">
14
+ {{ item.iso ? getFlag(item.iso) : item.name }}
15
+ </template>
16
+ <template v-slot:item="{ item, on, attrs }">
17
+ <v-list-item v-on="on" v-bind="attrs">
18
+ <v-list-item-icon class="mr-2">
19
+ {{ item.iso ? getFlag(item.iso) : item.name }}
20
+ </v-list-item-icon>
21
+ <v-list-item-title>
22
+ {{ item.name }}
23
+ </v-list-item-title>
24
+ </v-list-item>
25
+ </template>
26
+ </v-select>
27
+ </template>
28
+
29
+ <script>
30
+ export default {
31
+ name: "LangSwitcher",
32
+ methods: {
33
+ getFlag(isoCode) {
34
+ const codePoints = isoCode
35
+ .split("-")
36
+ .slice(-1)[0]
37
+ .toUpperCase()
38
+ .split("")
39
+ .map((char) => 127397 + char.charCodeAt());
40
+ return String.fromCodePoint(...codePoints);
41
+ },
42
+ },
43
+ };
44
+ </script>