@mapomodule/uikit 1.0.0-alpha.22 → 1.0.0-alpha.25

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 (40) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/components/ConfirmDialog.vue +10 -14
  3. package/components/Detail/Detail.vue +23 -15
  4. package/components/DropArea.vue +17 -33
  5. package/components/Form/Form.vue +15 -11
  6. package/components/Form/FormField.vue +3 -0
  7. package/components/Form/FormGroup.vue +23 -3
  8. package/components/Form/FormTabs.vue +20 -3
  9. package/components/Form/fields/DateField.vue +3 -3
  10. package/components/Form/fields/FksField.vue +2 -2
  11. package/components/Form/fields/MediaField.vue +10 -5
  12. package/components/Form/fields/MediaM2mField.vue +3 -3
  13. package/components/Form/fields/Repeater.vue +23 -10
  14. package/components/Form/fields/SeoPreview.vue +10 -10
  15. package/components/LangSwitcher.vue +44 -0
  16. package/components/List/List.vue +14 -15
  17. package/components/List/ListActions.vue +5 -5
  18. package/components/List/ListFilters.vue +9 -2
  19. package/components/List/ListHead.vue +1 -1
  20. package/components/List/ListQuickEdit.vue +4 -4
  21. package/components/List/ListTable.vue +11 -12
  22. package/components/Login.vue +5 -4
  23. package/components/LogoutButton.vue +43 -28
  24. package/components/MediaManager/MediaEditor.vue +20 -18
  25. package/components/MediaManager/MediaFolders.vue +14 -19
  26. package/components/MediaManager/MediaGallery.vue +1 -1
  27. package/components/MediaManager/MediaManager.vue +22 -15
  28. package/components/MediaManager/MediaManagerDialog.vue +2 -1
  29. package/components/MediaManager/MediaUploader.vue +6 -7
  30. package/components/SnackBar.vue +2 -3
  31. package/components/layout/Sidebar/SidebarFooter.vue +6 -25
  32. package/components/layout/Sidebar/SidebarListItem.vue +2 -2
  33. package/components/layout/Sidebar/SidebarProfile.vue +2 -2
  34. package/defaults/i18n.js +37 -0
  35. package/{defaults.js → defaults/vuetify.js} +16 -12
  36. package/module.js +6 -4
  37. package/package.json +4 -3
  38. package/pages/index.vue +1 -1
  39. package/translations/en-US.js +129 -0
  40. package/translations/it-IT.js +131 -0
@@ -33,29 +33,29 @@
33
33
  <v-col md="6" cols="12" class="info-media">
34
34
  <table class="text-caption fill-height pb-md-10">
35
35
  <tr>
36
- <td class="pr-3"><b>Filename:</b></td>
36
+ <td class="pr-3"><b>{{ $t("mapo.fileName") }}:</b></td>
37
37
  <td>{{ fileName }}</td>
38
38
  </tr>
39
39
  <tr>
40
- <td class="pr-3"><b>Mime type:</b></td>
40
+ <td class="pr-3"><b>{{ $t("mapo.mime") }}:</b></td>
41
41
  <td>{{ media.mime_type }}</td>
42
42
  </tr>
43
43
  <tr>
44
- <td class="pr-3"><b>Created:</b></td>
44
+ <td class="pr-3"><b>{{ $t("mapo.created") }}:</b></td>
45
45
  <td>{{ dateCreated }}</td>
46
46
  </tr>
47
47
  <tr>
48
- <td class="pr-3"><b>Size:</b></td>
48
+ <td class="pr-3"><b>{{ $t("mapo.size") }}:</b></td>
49
49
  <td>{{ fileSize }}</td>
50
50
  </tr>
51
51
  <tr>
52
- <td class="pr-3"><b>Url:</b></td>
52
+ <td class="pr-3"><b>URL:</b></td>
53
53
  <td>
54
54
  <a :href="media.file" target="_blank">{{ media.file }}</a>
55
55
  </td>
56
56
  </tr>
57
57
  <tr>
58
- <td class="pr-3"><b>Linked models:</b></td>
58
+ <td class="pr-3"><b>{{ $t("mapo.linkedModels") }}:</b></td>
59
59
  <td>
60
60
  <ul>
61
61
  <li v-for="link in media.links" :key="link.id">
@@ -72,28 +72,28 @@
72
72
  <v-text-field
73
73
  dense
74
74
  v-model="media.name"
75
- label="Name"
75
+ :label="$t('mapo.name')"
76
76
  ></v-text-field>
77
77
  </v-col>
78
78
  <v-col sm="6" md="12" cols="12">
79
79
  <v-text-field
80
80
  dense
81
81
  v-model="media.title"
82
- label="Title"
82
+ :label="$t('mapo.titleTag')"
83
83
  ></v-text-field>
84
84
  </v-col>
85
85
  <v-col sm="6" md="12" cols="12">
86
86
  <v-text-field
87
87
  dense
88
88
  v-model="media.description"
89
- label="Description"
89
+ :label="$t('mapo.description')"
90
90
  ></v-text-field>
91
91
  </v-col>
92
92
  <v-col sm="6" md="12" cols="12">
93
93
  <v-text-field
94
94
  dense
95
95
  v-model="media.alt_text"
96
- label="Alt name"
96
+ :label="$t('mapo.altTag')"
97
97
  ></v-text-field>
98
98
  </v-col>
99
99
  <v-col sm="6" md="12" cols="12" class="d-flex align-center">
@@ -101,7 +101,7 @@
101
101
  <v-file-input
102
102
  v-model="newFile"
103
103
  :accept="accept"
104
- label="New file"
104
+ :label="$t('mapo.mediaEditor.changeFile')"
105
105
  show-size
106
106
  dense
107
107
  prepend-icon
@@ -109,7 +109,7 @@
109
109
  <v-checkbox
110
110
  v-if="newFile"
111
111
  v-model="sameUrl"
112
- label="Maintain old url"
112
+ :label="$t('mapo.mediaEditor.maintainOldUrl')"
113
113
  class="ma-0"
114
114
  hide-details
115
115
  dense
@@ -149,11 +149,11 @@
149
149
  :class="{ 'pr-0': editing }"
150
150
  @click="editing = !editing"
151
151
  >
152
- <span>Edit</span>
152
+ <span>{{ $t("mapo.edit") }}</span>
153
153
  <v-icon :style="rotate">mdi-chevron-up</v-icon>
154
154
  <div class="edit_spacer" :class="{ 'flex-grow-1': editing }"></div>
155
155
  <v-btn v-if="editing" text tile color="primary" @click="saveMedia">
156
- save
156
+ {{ $t("mapo.save") }}
157
157
  </v-btn>
158
158
  <v-btn
159
159
  v-if="editing"
@@ -162,7 +162,7 @@
162
162
  color="error"
163
163
  @click.stop="deleteMedia"
164
164
  >
165
- delete
165
+ {{ $t("mapo.delete") }}
166
166
  </v-btn>
167
167
  </v-btn>
168
168
  </div>
@@ -170,6 +170,7 @@
170
170
  </v-container>
171
171
  </div>
172
172
  </template>
173
+
173
174
  <style lang="scss" scoped>
174
175
  table tr td:nth-child(2) {
175
176
  overflow-wrap: anywhere;
@@ -287,6 +288,7 @@ export default {
287
288
  alt_text: this.media.alt_text,
288
289
  file: this.newFile || undefined,
289
290
  same_url: (this.newFile && this.sameUrl) || undefined,
291
+ language_code: this.$i18n.locale
290
292
  };
291
293
  this.newFile = null;
292
294
  this.sameUrl = false;
@@ -295,9 +297,9 @@ export default {
295
297
  deleteMedia() {
296
298
  this.$mapo.$confirm
297
299
  .open({
298
- title: "Delete",
299
- question: "Are you sure you want to delete this media?",
300
- approveButton: { text: "Delete", attrs: { color: "red", text: true } },
300
+ title: this.$t("mapo.delete"),
301
+ question: this.$t("mapo.mediaEditor.confirmDelete"),
302
+ approveButton: { text: this.$t("mapo.delete"), attrs: { color: "red", text: true } },
301
303
  })
302
304
  .then((res) => res && this.$emit("deleteMedia", this.media));
303
305
  },
@@ -58,18 +58,18 @@
58
58
  </div>
59
59
  </div>
60
60
  <div class="flex-grow-1 text-center" v-if="!folders.length">
61
- No folders there.. Create a new one!
61
+ {{ $t("mapo.mediaFolders.noFolders") }}
62
62
  </div>
63
63
  <div class="ma-auto mr-2 mb-2">
64
- <v-tooltip disabled left>
64
+ <v-tooltip left>
65
65
  <template v-slot:activator="{ on, attrs }">
66
66
  <v-icon v-bind="attrs" v-on="on" @click.stop="createFolder">
67
67
  mdi-plus
68
68
  </v-icon>
69
69
  </template>
70
- <span>Add folder</span>
70
+ <span>{{ $t("mapo.mediaFolders.newFolder") }}</span>
71
71
  </v-tooltip>
72
- <v-tooltip v-if="folders.length" disabled bottom>
72
+ <v-tooltip v-if="folders.length" bottom>
73
73
  <template v-slot:activator="{ on, attrs }">
74
74
  <v-icon
75
75
  v-bind="attrs"
@@ -80,7 +80,7 @@
80
80
  mdi-chevron-down
81
81
  </v-icon>
82
82
  </template>
83
- <span>{{ expanded ? "Collapse" : "Expand" }} view</span>
83
+ <span>{{ expanded ? $t("mapo.collapse") : $t("mapo.expand") }}</span>
84
84
  </v-tooltip>
85
85
  </div>
86
86
  </v-card-actions>
@@ -94,7 +94,7 @@
94
94
  <v-dialog v-model="dialog" max-width="300px">
95
95
  <v-card>
96
96
  <v-card-title>
97
- {{ folderEdit.id ? "Edit Folder" : "New Folder" }}
97
+ {{ folderEdit.id ? $t("mapo.mediaFolders.editFolder") : $t("mapo.mediaFolders.newFolder") }}
98
98
  </v-card-title>
99
99
 
100
100
  <v-card-text>
@@ -103,7 +103,7 @@
103
103
  <v-col cols="12">
104
104
  <v-text-field
105
105
  v-model="folderEdit.title"
106
- label="Folder name"
106
+ :label="$t('mapo.mediaFolders.folderName')"
107
107
  ></v-text-field>
108
108
  </v-col>
109
109
  </v-row>
@@ -112,13 +112,14 @@
112
112
 
113
113
  <v-card-actions>
114
114
  <v-spacer></v-spacer>
115
- <v-btn color="primary" text @click="closeEdit"> Cancel </v-btn>
116
- <v-btn color="primary" text @click="saveFolder"> Save </v-btn>
115
+ <v-btn color="primary" text @click="closeEdit">{{ $t('mapo.cancel') }}</v-btn>
116
+ <v-btn color="primary" text @click="saveFolder">{{ $t('mapo.create') }}</v-btn>
117
117
  </v-card-actions>
118
118
  </v-card>
119
119
  </v-dialog>
120
120
  </div>
121
121
  </template>
122
+
122
123
  <style lang="scss" scoped>
123
124
  .media-folders-wrapper{
124
125
  width: 100%;
@@ -173,13 +174,7 @@ export default {
173
174
  return {
174
175
  expanded: false,
175
176
  dialog: false,
176
- folderEdit: {},
177
- actions: [
178
- {
179
- label: "Create folder",
180
- action: this.createFolder
181
- }
182
- ]
177
+ folderEdit: {}
183
178
  };
184
179
  },
185
180
  props: {
@@ -207,9 +202,9 @@ export default {
207
202
  deleteFolder(folder) {
208
203
  this.$mapo.$confirm
209
204
  .open({
210
- title: "Delete",
211
- question: "Are you sure to delelete this folder and all its content?",
212
- approveButton: { text: "Delete", attrs: { color: "red", text: true } }
205
+ title: this.$t("mapo.delete"),
206
+ question: this.$t("mapo.mediaFolders.confirmDelete"),
207
+ approveButton: { text: this.$t("mapo.delete"), attrs: { color: "red", text: true } }
213
208
  })
214
209
  .then(res => res && this.$emit("deleteFolder", folder));
215
210
  },
@@ -25,7 +25,7 @@
25
25
  justify="center"
26
26
  >
27
27
  <v-icon size="60"> mdi-alert-circle-outline </v-icon>
28
- <p>No media fund...</p>
28
+ <p>{{ $t("mapo.mediaGallery.noMediaFound") }}</p>
29
29
  </v-row>
30
30
  <v-row v-if="medias.length">
31
31
  <v-col
@@ -3,8 +3,8 @@
3
3
  <v-card-title class="d-flex flex-wrap pa-0">
4
4
  <div>
5
5
  <v-tabs v-model="tab" right background-color="transparent">
6
- <v-tab>Gallery</v-tab>
7
- <v-tab>Uploader</v-tab>
6
+ <v-tab>{{ $t("mapo.mediaManager.gallery") }}</v-tab>
7
+ <v-tab>{{ $t("mapo.mediaManager.uploader") }}</v-tab>
8
8
  </v-tabs>
9
9
  </div>
10
10
  <v-btn v-show="$vuetify.breakpoint.xs" class="ma-2 ml-auto" @click="getRoot" icon>
@@ -19,7 +19,7 @@
19
19
  search();
20
20
  "
21
21
  prepend-inner-icon="mdi-magnify"
22
- label="Search"
22
+ :label="$t('mapo.search')"
23
23
  single-line
24
24
  hide-details
25
25
  outlined
@@ -118,6 +118,12 @@ export default {
118
118
  required: false,
119
119
  },
120
120
  },
121
+ watch: {
122
+ '$i18n.locale': async function(locale) {
123
+ if (this.editMedia)
124
+ this.editMedia = await this.detailMedia(this.editMedia.id);
125
+ }
126
+ },
121
127
  computed: {
122
128
  mediaFolderCrud() {
123
129
  this._mediaFolderCrud =
@@ -125,8 +131,7 @@ export default {
125
131
  return this._mediaFolderCrud;
126
132
  },
127
133
  mediaFileCrud() {
128
- this._mediaFileCrud =
129
- this._mediaFileCrud || this.$mapo.$api.crud("api/media");
134
+ this._mediaFileCrud = this._mediaFileCrud || this.$mapo.$api.crud("api/media");
130
135
  return this._mediaFileCrud;
131
136
  },
132
137
  parentFolder: {
@@ -168,7 +173,7 @@ export default {
168
173
  ? await this.mediaFolderCrud.detail(id, { params })
169
174
  : await this.mediaFolderCrud.list({ params });
170
175
  } catch (error) {
171
- console.error({ code: error.response.status, response: error.response.data})
176
+ console.error({ code: error.response.status, response: error.response.data });
172
177
  }
173
178
 
174
179
  this.processResponse(response);
@@ -191,23 +196,25 @@ export default {
191
196
  },
192
197
 
193
198
  detailMedia(media_id) {
194
- return this.mediaFileCrud.detail(media_id);
199
+ return this.mediaFileCrud.detail(media_id, {
200
+ params: { language_code: this.$i18n.locale },
201
+ });
195
202
  },
196
203
 
197
204
  async updateMedia(media) {
198
205
  const files = ["file", "objectURL", "thumbnail"];
199
206
  const payload = this.$mapo.$api.multipart(media, files);
200
207
  const conf = { headers: { "Content-Type": "multipart/form-data" } };
201
- const res = await this.mediaFileCrud.partialUpdate(media.id, payload, conf)
202
- if (media.file){
203
- this.medias = []
204
- await this.getRoot()
208
+ const res = await this.mediaFileCrud.partialUpdate(media.id, payload, conf);
209
+ if (media.file) {
210
+ this.medias = [];
211
+ await this.getRoot();
205
212
  }
206
- this.editMedia = res
213
+ this.editMedia = res;
207
214
  this.$mapo.$snack.open({
208
- message: "File info succesfully updated."
209
- })
210
- return res
215
+ message: this.$t("mapo.mediaManager.fileInfo"),
216
+ });
217
+ return res;
211
218
  },
212
219
  processResponse(resp) {
213
220
  this.medias = resp?.media?.items || [];
@@ -12,12 +12,13 @@
12
12
  >
13
13
  <template v-slot:actions>
14
14
  <v-spacer></v-spacer>
15
- <v-btn v-if="select == 'multi'" color="primary" text @click="done">done</v-btn>
15
+ <v-btn v-if="select == 'multi'" color="primary" text @click="done">{{ $t("mapo.apply") }}</v-btn>
16
16
  </template>
17
17
  </media-manager>
18
18
  </v-dialog>
19
19
  </div>
20
20
  </template>
21
+
21
22
  <script>
22
23
  export default {
23
24
  name: "MediaManagerDialog",
@@ -18,31 +18,31 @@
18
18
  <v-select
19
19
  v-model="editedItem.folder"
20
20
  :items="folderOptions"
21
- label="Folder"
21
+ :label="$t('mapo.folder')"
22
22
  ></v-select>
23
23
  </v-col>
24
24
  <v-col cols="12">
25
25
  <v-text-field
26
26
  v-model="editedItem.name"
27
- label="Name"
27
+ :label="$t('mapo.name')"
28
28
  ></v-text-field>
29
29
  </v-col>
30
30
  <v-col cols="12">
31
31
  <v-text-field
32
32
  v-model="editedItem.title"
33
- label="Title"
33
+ :label="$t('titleTag')"
34
34
  ></v-text-field>
35
35
  </v-col>
36
36
  <v-col cols="12">
37
37
  <v-text-field
38
38
  v-model="editedItem.description"
39
- label="Description"
39
+ :label="$t('mapo.description')"
40
40
  ></v-text-field>
41
41
  </v-col>
42
42
  <v-col cols="12">
43
43
  <v-text-field
44
44
  v-model="editedItem.alt_text"
45
- label="Alt name"
45
+ :label="$t('mapo.altTag')"
46
46
  ></v-text-field>
47
47
  </v-col>
48
48
  </v-row>
@@ -132,8 +132,7 @@ export default {
132
132
  ).then(response => {
133
133
  if (this.mediaList && this.mediaList.length) {
134
134
  this.$mapo.$snack.open({
135
- message: `${response.length ||
136
- this.mediaList.length} files succesfully uploaded`
135
+ message: this.$t("mapo.mediaUploader.success", {numberFiles: response.length || this.mediaList.length})
137
136
  });
138
137
  this.$emit("Upload", (response.length && response) || this.mediaList);
139
138
  this.$refs.closeButton.$el.click();
@@ -3,7 +3,7 @@
3
3
  {{ message }}
4
4
  <template v-slot:action="{ attrs }">
5
5
  <v-btn :color="color" text v-bind="attrs" @click="closeSnack">
6
- Close
6
+ {{ $t("mapo.close") }}
7
7
  </v-btn>
8
8
  </template>
9
9
  </v-snackbar>
@@ -56,7 +56,6 @@ export default {
56
56
  };
57
57
  </script>
58
58
 
59
-
60
59
  <docs>
61
60
  ### Example usage:
62
61
 
@@ -67,4 +66,4 @@ this.$mapo.$snack.open({
67
66
  });
68
67
  ```
69
68
 
70
- </docs>
69
+ </docs>
@@ -14,26 +14,10 @@
14
14
  />
15
15
  </v-list>
16
16
  <v-divider></v-divider>
17
- <v-list-item v-if="$mapo.$auth.user.isLoggedIn" dense class="logout__button" link @click.native="logout">
18
- <v-list-item-icon>
19
- <v-icon>mdi-logout</v-icon>
20
- </v-list-item-icon>
21
- <v-list-item-title> Logout </v-list-item-title>
22
- </v-list-item>
17
+ <LogoutButton></LogoutButton>
23
18
  </div>
24
19
  </template>
25
20
 
26
- <style lang="scss" scoped>
27
- .logout__button{
28
- &.theme--light{
29
- background: #ffffffd6;
30
- filter: invert(1);
31
- }
32
- &.theme--dark{
33
- background: #121212;
34
- }
35
- }
36
- </style>
37
21
  <script>
38
22
  import { buildRoutes } from "../routebuilder";
39
23
 
@@ -43,19 +27,19 @@ export default {
43
27
  props: {
44
28
  forceCollapse: {
45
29
  type: Boolean,
46
- default: false
47
- }
30
+ default: false,
31
+ },
48
32
  },
49
33
  data() {
50
34
  return {
51
35
  defaultIcon: ({ label }) => `mdi-alpha-${label[0]}-box`.toLowerCase(),
52
- routes: this.routes
36
+ routes: this.routes,
53
37
  };
54
38
  },
55
39
  mounted() {
56
40
  this.routes = this.buildRoutes(
57
41
  this.$router.options.routes.filter(
58
- route => route.meta && route.meta.sidebarFooter === true
42
+ (route) => route.meta && route.meta.sidebarFooter === true
59
43
  )
60
44
  );
61
45
  },
@@ -63,9 +47,6 @@ export default {
63
47
  buildRoutes(routes) {
64
48
  return buildRoutes(routes, this.defaultIcon);
65
49
  },
66
- logout() {
67
- this.$store.dispatch("mapo/user/logout");
68
- }
69
- }
50
+ },
70
51
  };
71
52
  </script>
@@ -12,7 +12,7 @@
12
12
  <v-icon>{{ icon }}</v-icon>
13
13
  </v-list-item-icon>
14
14
  <v-list-item-title>
15
- {{ label }}
15
+ {{ label.translate ? $t(label.translate) : label }}
16
16
  </v-list-item-title>
17
17
  <v-icon
18
18
  class="expand-icon"
@@ -149,7 +149,7 @@ export default {
149
149
  },
150
150
  props: {
151
151
  link: String,
152
- label: String,
152
+ label: String | Object,
153
153
  icon: String,
154
154
  childrens: Array,
155
155
  meta: Object,
@@ -10,7 +10,7 @@
10
10
  <span v-if="isLoggedIn">
11
11
  {{ username }}
12
12
  </span>
13
- <NuxtLink v-else to="/login"> Login </NuxtLink>
13
+ <NuxtLink v-else to="/login">{{ $t("mapo.login") }}</NuxtLink>
14
14
  </v-list-item-title>
15
15
  <v-btn icon @click.stop="toggleMiniVariant">
16
16
  <v-icon>mdi-chevron-left</v-icon>
@@ -39,4 +39,4 @@ export default {
39
39
  },
40
40
  },
41
41
  };
42
- </script>
42
+ </script>
@@ -0,0 +1,37 @@
1
+ export default {
2
+ detectBrowserLanguage: {
3
+ useCookie: true,
4
+ cookieKey: "i18n_redirected",
5
+ redirectOn: "root",
6
+ },
7
+ locales: [
8
+ {
9
+ code: "en",
10
+ name: "English",
11
+ file: "en-US.js",
12
+ iso: "en-US",
13
+ },
14
+ {
15
+ code: "it",
16
+ name: "Italiano",
17
+ file: "it-IT.js",
18
+ iso: "it-IT",
19
+ },
20
+ ],
21
+ lazy: true,
22
+ langDir: __dirname + "/translations/",
23
+ defaultLocale: "en",
24
+ strategy: "no_prefix",
25
+ onBeforeLanguageSwitch: (oldLocale, newLocale, isInitialSetup, context) => {
26
+ const locale =
27
+ context.i18n.locales.find((l) => l.code === newLocale) || {};
28
+ const isRTL = locale.dir === "rtl";
29
+ if (isInitialSetup) {
30
+ context.app.vuetify.preset.rtl = isRTL;
31
+ }
32
+ context.app.vuetify.framework.lang.current = locale.iso
33
+ ? locale.iso.split("-")[0]
34
+ : locale.code;
35
+ context.app.vuetify.framework.rtl = isRTL;
36
+ },
37
+ };
@@ -1,29 +1,33 @@
1
- import colors from 'vuetify/es5/util/colors'
1
+ import colors from "vuetify/es5/util/colors";
2
+ import { it, en } from "vuetify/lib/locale";
2
3
 
3
4
  export default {
4
- customVariables: ['@mapomodule/uikit/assets/variables.scss'],
5
+ customVariables: ["@mapomodule/uikit/assets/variables.scss"],
5
6
  theme: {
6
7
  dark: true,
7
8
  themes: {
8
9
  dark: {
9
- primary: '#51beaa',
10
+ primary: "#51beaa",
10
11
  accent: colors.grey.darken3,
11
12
  secondary: colors.amber.darken3,
12
13
  info: colors.teal.lighten1,
13
14
  warning: colors.amber.base,
14
- error: '#FF5252',
15
- success: colors.green.accent3
15
+ error: "#FF5252",
16
+ success: colors.green.accent3,
16
17
  },
17
18
  light: {
18
- primary: '#51beaa',
19
+ primary: "#51beaa",
19
20
  accent: colors.indigo.accent1,
20
21
  secondary: colors.amber.accent2,
21
22
  info: colors.teal.lighten1,
22
23
  warning: colors.amber.base,
23
- error: '#FF5252',
24
- success: colors.green.accent3
25
- }
26
- }
24
+ error: "#FF5252",
25
+ success: colors.green.accent3,
26
+ },
27
+ },
28
+ },
29
+ lang: {
30
+ locales: { en, it },
27
31
  },
28
- treeShake: false
29
- }
32
+ treeShake: false,
33
+ };
package/module.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { createRoutes } from '@nuxt/utils'
2
2
  import serveStatic from 'serve-static'
3
3
  import path from 'path'
4
- import mapoDefaults from './defaults'
5
4
  import Glob from 'glob'
6
5
  import pify from 'pify'
7
6
  const glob = pify(Glob)
@@ -20,7 +19,10 @@ export default async function (moduleOptions) {
20
19
  const userModuleOptions = Object.keys(moduleOptions).length === 0 ? (this.options['mapo'] || {}) : moduleOptions
21
20
 
22
21
  // INJECT VUETIFY MODULE
23
- this.requireModule(['@nuxtjs/vuetify', (this.options && this.options.vuetify) || userModuleOptions.vuetify || mapoDefaults.vuetify || {}])
22
+ this.requireModule(['@nuxtjs/vuetify', (this.options && this.options.vuetify) || userModuleOptions.vuetify || {}]);
23
+
24
+ // INJECT I18N MODULE
25
+ this.requireModule(['@nuxtjs/i18n', (this.options && this.options.i18n) || userModuleOptions.i18n || {},]);
24
26
 
25
27
  // INJECT ALL LAYOUTS
26
28
  const layouts = (await resolver.resolveRelative(__dirname, 'layouts')).map(({ src }) => src)
@@ -44,7 +46,7 @@ export default async function (moduleOptions) {
44
46
  })
45
47
  this.nuxt.hook('components:extend', (components) => {
46
48
  const clearName = (name) => name.replace(/^Mapoverride/, '').replace(/^mapoverride-/, '')
47
- const componentsOverride = Object.values(components.reduce((map, comp) => (
49
+ const componentsOverride = Object.values(components.reduce((map, comp) => (
48
50
  { ...map, [clearName(comp.pascalName)]: {...comp, pascalName:clearName(comp.pascalName), kebabName:clearName(comp.kebabName)} }
49
51
  ), {}))
50
52
  components.length = 0
@@ -72,7 +74,7 @@ export default async function (moduleOptions) {
72
74
  loader: require.resolve(path.resolve(__dirname, '../utils/loaders/dummy-loader.js'))
73
75
  })
74
76
  })
75
-
77
+
76
78
  }
77
79
 
78
80
  module.exports.meta = require('./package.json')
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@mapomodule/uikit",
3
- "version": "1.0.0-alpha.22",
3
+ "version": "1.0.0-alpha.25",
4
4
  "license": "MIT",
5
5
  "description": "This is part of Mapo nuxt module. Injects Mapo ui components in the nuxt component discovery system.",
6
6
  "author": "bnznamco <gabriele.baldi.01@gmail.com>",
7
7
  "repository": "https://github.com/lotrekagency/mapo",
8
8
  "main": "./module.js",
9
9
  "dependencies": {
10
- "@mapomodule/utils": "^1.0.0-alpha.22",
10
+ "@mapomodule/utils": "^1.0.0-alpha.23",
11
+ "@nuxtjs/i18n": "^7.2.2",
11
12
  "@nuxtjs/vuetify": "^1.12.3",
12
13
  "vuedraggable": "^2.24.3"
13
14
  },
14
15
  "publishConfig": {
15
16
  "access": "public"
16
17
  },
17
- "gitHead": "49f5a6c1ed148cfdaf80a6b610ffc4233aa177cb"
18
+ "gitHead": "eadf1c2835aa6aba84870dc8d98308f10b257527"
18
19
  }
package/pages/index.vue CHANGED
@@ -7,7 +7,7 @@
7
7
  </h1>
8
8
  <br>
9
9
  <br>
10
- <code>Congratulations!! 🥳 You succesfully installed Mapo! </code>
10
+ <code>{{ $t('mapo.index.welcomeMessage') }}</code>
11
11
  <br>
12
12
  <br>
13
13
  <code>