@mapomodule/uikit 1.0.0-alpha.21 → 1.0.0-alpha.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/components/ConfirmDialog.vue +10 -14
- package/components/Detail/Detail.vue +246 -365
- package/components/DropArea.vue +17 -33
- package/components/Form/Form.vue +228 -0
- package/components/{Detail/DetailField.vue → Form/FormField.vue} +35 -15
- package/components/Form/FormGroup.vue +108 -0
- package/components/Form/FormTabs.vue +151 -0
- package/components/{Detail → Form}/defaults.js +0 -0
- package/components/{fields → Form/fields}/DateField.vue +3 -3
- package/components/{fields → Form/fields}/FileField.vue +0 -0
- package/components/{fields → Form/fields}/FksField.vue +2 -2
- package/components/{fields → Form/fields}/MediaField.vue +4 -5
- package/components/{fields → Form/fields}/MediaM2mField.vue +3 -3
- package/components/Form/fields/Repeater.vue +575 -0
- package/components/{fields → Form/fields}/SeoPreview.vue +10 -10
- package/components/{fields → Form/fields}/wygEditor/defaults.js +0 -0
- package/components/{fields → Form/fields}/wygEditor/utils/events.js +0 -0
- package/components/{fields → Form/fields}/wygEditor/utils/mapomedia.plugin.js +0 -0
- package/components/{fields → Form/fields}/wygEditor/utils/script.injector.js +0 -0
- package/components/{fields → Form/fields}/wygEditor/wygEditor.vue +0 -0
- package/components/LangSwitcher.vue +44 -0
- package/components/List/List.vue +14 -15
- package/components/List/ListActions.vue +5 -5
- package/components/List/ListFilters.vue +9 -2
- package/components/List/ListHead.vue +1 -1
- package/components/List/ListQuickEdit.vue +21 -104
- package/components/List/ListTable.vue +15 -18
- package/components/Login.vue +5 -4
- package/components/LogoutButton.vue +43 -28
- package/components/MediaManager/MediaEditor.vue +20 -18
- package/components/MediaManager/MediaFolders.vue +14 -19
- package/components/MediaManager/MediaGallery.vue +1 -1
- package/components/MediaManager/MediaManager.vue +22 -15
- package/components/MediaManager/MediaManagerDialog.vue +2 -1
- package/components/MediaManager/MediaUploader.vue +6 -7
- package/components/SnackBar.vue +2 -3
- package/components/layout/Sidebar/SidebarFooter.vue +6 -25
- package/components/layout/Sidebar/SidebarListItem.vue +2 -2
- package/components/layout/Sidebar/SidebarProfile.vue +2 -2
- package/defaults.js +70 -24
- package/module.js +12 -4
- package/package.json +4 -3
- package/pages/index.vue +1 -1
- package/translations/en-US.js +129 -0
- package/translations/it-IT.js +131 -0
- package/components/fields/Repeater.vue +0 -338
|
@@ -58,18 +58,18 @@
|
|
|
58
58
|
</div>
|
|
59
59
|
</div>
|
|
60
60
|
<div class="flex-grow-1 text-center" v-if="!folders.length">
|
|
61
|
-
|
|
61
|
+
{{ $t("mapo.mediaFolders.noFolders") }}
|
|
62
62
|
</div>
|
|
63
63
|
<div class="ma-auto mr-2 mb-2">
|
|
64
|
-
<v-tooltip
|
|
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>
|
|
70
|
+
<span>{{ $t("mapo.mediaFolders.newFolder") }}</span>
|
|
71
71
|
</v-tooltip>
|
|
72
|
-
<v-tooltip v-if="folders.length"
|
|
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 ? "
|
|
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 ? "
|
|
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="
|
|
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">
|
|
116
|
-
<v-btn color="primary" text @click="saveFolder">
|
|
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: "
|
|
211
|
-
question:
|
|
212
|
-
approveButton: { text: "
|
|
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
|
},
|
|
@@ -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>
|
|
7
|
-
<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="
|
|
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: "
|
|
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">
|
|
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="
|
|
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="
|
|
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="
|
|
33
|
+
:label="$('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="
|
|
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="
|
|
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:
|
|
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();
|
package/components/SnackBar.vue
CHANGED
|
@@ -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
|
-
|
|
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
|
-
<
|
|
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
|
-
|
|
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">
|
|
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>
|
package/defaults.js
CHANGED
|
@@ -1,29 +1,75 @@
|
|
|
1
|
-
import colors from
|
|
1
|
+
import colors from "vuetify/es5/util/colors";
|
|
2
|
+
import { it, en } from "vuetify/lib/locale";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
vuetify: {
|
|
6
|
+
customVariables: ["@mapomodule/uikit/assets/variables.scss"],
|
|
7
|
+
theme: {
|
|
8
|
+
dark: true,
|
|
9
|
+
themes: {
|
|
10
|
+
dark: {
|
|
11
|
+
primary: "#51beaa",
|
|
12
|
+
accent: colors.grey.darken3,
|
|
13
|
+
secondary: colors.amber.darken3,
|
|
14
|
+
info: colors.teal.lighten1,
|
|
15
|
+
warning: colors.amber.base,
|
|
16
|
+
error: "#FF5252",
|
|
17
|
+
success: colors.green.accent3,
|
|
18
|
+
},
|
|
19
|
+
light: {
|
|
20
|
+
primary: "#51beaa",
|
|
21
|
+
accent: colors.indigo.accent1,
|
|
22
|
+
secondary: colors.amber.accent2,
|
|
23
|
+
info: colors.teal.lighten1,
|
|
24
|
+
warning: colors.amber.base,
|
|
25
|
+
error: "#FF5252",
|
|
26
|
+
success: colors.green.accent3,
|
|
27
|
+
},
|
|
16
28
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
},
|
|
30
|
+
lang: {
|
|
31
|
+
locales: { en, it },
|
|
32
|
+
},
|
|
33
|
+
treeShake: false,
|
|
34
|
+
},
|
|
35
|
+
i18n: {
|
|
36
|
+
detectBrowserLanguage: {
|
|
37
|
+
useCookie: true,
|
|
38
|
+
cookieKey: "i18n_redirected",
|
|
39
|
+
redirectOn: "root",
|
|
40
|
+
},
|
|
41
|
+
locales: [
|
|
42
|
+
{
|
|
43
|
+
code: "en",
|
|
44
|
+
name: "English",
|
|
45
|
+
file: "en-US.js",
|
|
46
|
+
iso: "en-US",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
code: "it",
|
|
50
|
+
name: "Italiano",
|
|
51
|
+
file: "it-IT.js",
|
|
52
|
+
iso: "it-IT",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
lazy: true,
|
|
56
|
+
langDir: __dirname + "/translations/",
|
|
57
|
+
defaultLocale: "en",
|
|
58
|
+
strategy: "no_prefix",
|
|
59
|
+
onBeforeLanguageSwitch: (
|
|
60
|
+
oldLocale,
|
|
61
|
+
newLocale,
|
|
62
|
+
isInitialSetup,
|
|
63
|
+
context
|
|
64
|
+
) => {
|
|
65
|
+
const locale =
|
|
66
|
+
context.i18n.locales.find((l) => l.code === newLocale) || {};
|
|
67
|
+
const isRTL = locale.dir === "rtl";
|
|
68
|
+
if (isInitialSetup) {
|
|
69
|
+
context.app.vuetify.preset.rtl = isRTL;
|
|
25
70
|
}
|
|
26
|
-
|
|
71
|
+
context.app.vuetify.framework.lang.current = locale.iso ? locale.iso.split("-")[0] : locale.code;
|
|
72
|
+
context.app.vuetify.framework.rtl = isRTL;
|
|
73
|
+
},
|
|
27
74
|
},
|
|
28
|
-
|
|
29
|
-
}
|
|
75
|
+
};
|
package/module.js
CHANGED
|
@@ -20,7 +20,15 @@ export default async function (moduleOptions) {
|
|
|
20
20
|
const userModuleOptions = Object.keys(moduleOptions).length === 0 ? (this.options['mapo'] || {}) : moduleOptions
|
|
21
21
|
|
|
22
22
|
// INJECT VUETIFY MODULE
|
|
23
|
-
this.requireModule(['@nuxtjs/vuetify',
|
|
23
|
+
this.requireModule(['@nuxtjs/vuetify', {
|
|
24
|
+
...((this.options && this.options.vuetify) || userModuleOptions.vuetify || mapoDefaults.vuetify || {}),
|
|
25
|
+
lang: userModuleOptions.vuetify?.lang || mapoDefaults.vuetify.lang
|
|
26
|
+
}]);
|
|
27
|
+
// INJECT I18N MODULE
|
|
28
|
+
this.requireModule(['@nuxtjs/i18n', {
|
|
29
|
+
...((this.options && this.options.i18n) || userModuleOptions.i18n || mapoDefaults.i18n || {}),
|
|
30
|
+
onBeforeLanguageSwitch: userModuleOptions.i18n?.onBeforeLanguageSwitch || mapoDefaults.i18n.onBeforeLanguageSwitch
|
|
31
|
+
}]);
|
|
24
32
|
|
|
25
33
|
// INJECT ALL LAYOUTS
|
|
26
34
|
const layouts = (await resolver.resolveRelative(__dirname, 'layouts')).map(({ src }) => src)
|
|
@@ -39,12 +47,12 @@ export default async function (moduleOptions) {
|
|
|
39
47
|
|
|
40
48
|
// INJECT COMPONENTS
|
|
41
49
|
this.nuxt.hook('components:dirs', (dirs) => {
|
|
42
|
-
const mapoComponents = ['components', 'components/fields', 'components/layout']
|
|
50
|
+
const mapoComponents = ['components', 'components/Form/fields', 'components/layout']
|
|
43
51
|
mapoComponents.forEach(d => dirs.unshift({ path: path.resolve(__dirname, d)}))
|
|
44
52
|
})
|
|
45
53
|
this.nuxt.hook('components:extend', (components) => {
|
|
46
54
|
const clearName = (name) => name.replace(/^Mapoverride/, '').replace(/^mapoverride-/, '')
|
|
47
|
-
const componentsOverride = Object.values(components.reduce((map, comp) => (
|
|
55
|
+
const componentsOverride = Object.values(components.reduce((map, comp) => (
|
|
48
56
|
{ ...map, [clearName(comp.pascalName)]: {...comp, pascalName:clearName(comp.pascalName), kebabName:clearName(comp.kebabName)} }
|
|
49
57
|
), {}))
|
|
50
58
|
components.length = 0
|
|
@@ -72,7 +80,7 @@ export default async function (moduleOptions) {
|
|
|
72
80
|
loader: require.resolve(path.resolve(__dirname, '../utils/loaders/dummy-loader.js'))
|
|
73
81
|
})
|
|
74
82
|
})
|
|
75
|
-
|
|
83
|
+
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
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.
|
|
3
|
+
"version": "1.0.0-alpha.24",
|
|
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.
|
|
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": "
|
|
18
|
+
"gitHead": "0d7a1d128b02ad74c49da6e89ee60a546fec21ba"
|
|
18
19
|
}
|