@mapomodule/uikit 1.0.0-alpha.46 → 1.0.0-alpha.48
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 +28 -0
- package/components/Form/fields/Repeater.vue +5 -2
- package/components/Form/fields/TimeField.vue +1 -0
- package/components/MediaManager/MediaGallery.vue +4 -4
- package/components/MediaManager/MediaUploader.vue +49 -66
- package/components/MenuManager/MenuNodeEditor.vue +3 -3
- package/package.json +2 -2
- package/translations/en-US.js +1 -1
- package/translations/it-IT.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
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.48](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.47...v1.0.0-alpha.48) (2023-07-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fix repeater not emitting internal values to form field ([c118eb3](https://github.com/lotrekagency/mapo/commit/c118eb3f4814fc203aaa33bd9232aaa9f76a428b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [1.0.0-alpha.47](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.46...v1.0.0-alpha.47) (2023-06-24)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* fix media gallery keys ([f9fb666](https://github.com/lotrekagency/mapo/commit/f9fb6664456488b0b32b730ef7236d2e8bddea80))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* improve media uloader progress ([bbc9628](https://github.com/lotrekagency/mapo/commit/bbc9628653c18ebbcb37011302e698d9dc8f29a8))
|
|
28
|
+
* update translations ([a51ae6d](https://github.com/lotrekagency/mapo/commit/a51ae6d86da32248b6377f1d4ce6bfab7fc413d1))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
# [1.0.0-alpha.46](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.45...v1.0.0-alpha.46) (2023-06-24)
|
|
7
35
|
|
|
8
36
|
|
|
@@ -326,8 +326,11 @@ export default {
|
|
|
326
326
|
if (val.length != this.collapsedStack.length)
|
|
327
327
|
this.collapsedStack = (val || []).map(() => !!this.collapsable);
|
|
328
328
|
},
|
|
329
|
-
items
|
|
330
|
-
|
|
329
|
+
items: {
|
|
330
|
+
handler(val) {
|
|
331
|
+
this.$emit("input", deepClone(val));
|
|
332
|
+
},
|
|
333
|
+
deep: true
|
|
331
334
|
},
|
|
332
335
|
tModalOpen(val) {
|
|
333
336
|
!val && this.tModalCallback();
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
>
|
|
9
9
|
<MediaPreview
|
|
10
10
|
v-for="media in selection"
|
|
11
|
-
:key="media.
|
|
11
|
+
:key="media.id"
|
|
12
12
|
@click.native.stop="select(media)"
|
|
13
13
|
:media="media"
|
|
14
14
|
icon-size="20px"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<div ref="masonry" class="media-gallery--masonry" v-if="medias.length">
|
|
54
54
|
<div
|
|
55
55
|
v-for="media in medias"
|
|
56
|
-
:key="media.
|
|
56
|
+
:key="media.id"
|
|
57
57
|
class="media-gallery--card"
|
|
58
58
|
>
|
|
59
59
|
<v-btn
|
|
@@ -179,7 +179,7 @@ $wcol: calc(100% / 6 - 12px);
|
|
|
179
179
|
.media-gallery--masonry{
|
|
180
180
|
grid-template-columns: $wcol $wcol;
|
|
181
181
|
}
|
|
182
|
-
}
|
|
182
|
+
}
|
|
183
183
|
|
|
184
184
|
.media-gallery--empty{
|
|
185
185
|
height: 100%;
|
|
@@ -224,7 +224,7 @@ $wcol: calc(100% / 6 - 12px);
|
|
|
224
224
|
color: white;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
|
|
228
228
|
}
|
|
229
229
|
.media-gallery--selected {
|
|
230
230
|
&::after {
|
|
@@ -12,43 +12,30 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
14
14
|
<template v-slot:list-item.content.after="{ item }">
|
|
15
|
-
<v-chip dense v-if="isTooLarge(item)" color="error">{{$t("mapo.mediaUploader.tooLarge")}}</v-chip>
|
|
15
|
+
<v-chip dense v-if="isTooLarge(item)" color="error">{{ $t("mapo.mediaUploader.tooLarge") }}</v-chip>
|
|
16
16
|
</template>
|
|
17
17
|
<template v-slot:editContent="{ editedItem }">
|
|
18
18
|
<v-container>
|
|
19
19
|
<v-row>
|
|
20
20
|
<v-col cols="12">
|
|
21
|
-
<v-select
|
|
22
|
-
v-model="editedItem.folder"
|
|
23
|
-
:items="folderOptions"
|
|
24
|
-
:label="$t('mapo.folder')"
|
|
25
|
-
></v-select>
|
|
21
|
+
<v-select v-model="editedItem.folder" :items="folderOptions" :label="$t('mapo.folder')"></v-select>
|
|
26
22
|
</v-col>
|
|
27
23
|
<v-col cols="12">
|
|
28
|
-
<v-text-field
|
|
29
|
-
v-model="editedItem.title"
|
|
30
|
-
:label="$t('titleTag')"
|
|
31
|
-
></v-text-field>
|
|
24
|
+
<v-text-field v-model="editedItem.title" :label="$t('titleTag')"></v-text-field>
|
|
32
25
|
</v-col>
|
|
33
26
|
<v-col cols="12">
|
|
34
|
-
<v-text-field
|
|
35
|
-
v-model="editedItem.description"
|
|
36
|
-
:label="$t('mapo.description')"
|
|
37
|
-
></v-text-field>
|
|
27
|
+
<v-text-field v-model="editedItem.description" :label="$t('mapo.description')"></v-text-field>
|
|
38
28
|
</v-col>
|
|
39
29
|
<v-col cols="12">
|
|
40
|
-
<v-text-field
|
|
41
|
-
v-model="editedItem.alt_text"
|
|
42
|
-
:label="$t('mapo.altTag')"
|
|
43
|
-
></v-text-field>
|
|
30
|
+
<v-text-field v-model="editedItem.alt_text" :label="$t('mapo.altTag')"></v-text-field>
|
|
44
31
|
</v-col>
|
|
45
32
|
</v-row>
|
|
46
33
|
</v-container>
|
|
47
34
|
</template>
|
|
48
35
|
</drop-area>
|
|
49
36
|
<div v-if="mediaList.length" class="mt-3">
|
|
50
|
-
<p class="text-right mr-3 mb-2">{{ completed }}</p>
|
|
51
|
-
<v-progress-linear :value="progress"></v-progress-linear>
|
|
37
|
+
<p class="text-right mr-3 mb-2">{{ bufferProgress >= 100 ? $t('mapo.mediaUploader.optimizingFiles') : (progress > 0 ? $t('mapo.mediaUploader.uploadingFiles'):'')}} {{ completed }}</p>
|
|
38
|
+
<v-progress-linear :stream="stream" :indeterminate="progress == 100" :value="progress" :buffer-value="bufferProgress"></v-progress-linear>
|
|
52
39
|
</div>
|
|
53
40
|
</v-container>
|
|
54
41
|
</template>
|
|
@@ -69,8 +56,9 @@ export default {
|
|
|
69
56
|
name: "MediaUploader",
|
|
70
57
|
data() {
|
|
71
58
|
return {
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
buffer : 0,
|
|
60
|
+
stream: false,
|
|
61
|
+
responses: [],
|
|
74
62
|
mediaList: [],
|
|
75
63
|
_mediaFileCrud: null
|
|
76
64
|
};
|
|
@@ -84,7 +72,7 @@ export default {
|
|
|
84
72
|
return this._mediaFileCrud;
|
|
85
73
|
},
|
|
86
74
|
completed() {
|
|
87
|
-
return `${this.
|
|
75
|
+
return `${this.responses.length}/${this.mediaList.length}`;
|
|
88
76
|
},
|
|
89
77
|
folderOptions() {
|
|
90
78
|
return [
|
|
@@ -97,11 +85,17 @@ export default {
|
|
|
97
85
|
value: folder.id
|
|
98
86
|
}))
|
|
99
87
|
];
|
|
88
|
+
},
|
|
89
|
+
progress(){
|
|
90
|
+
return this.responses.length/this.mediaList.length * 100;
|
|
91
|
+
},
|
|
92
|
+
bufferProgress(){
|
|
93
|
+
return this.buffer/this.mediaList.length * 100;
|
|
100
94
|
}
|
|
101
95
|
},
|
|
102
96
|
methods: {
|
|
103
|
-
isTooLarge({ info }){
|
|
104
|
-
const {type} = info;
|
|
97
|
+
isTooLarge({ info }) {
|
|
98
|
+
const { type } = info;
|
|
105
99
|
switch (type.split("/")[0]) {
|
|
106
100
|
case "image":
|
|
107
101
|
return info.rawsize > MAX_IMAGE_SIZE;
|
|
@@ -122,58 +116,47 @@ export default {
|
|
|
122
116
|
(this.parentFolder && this.parentFolder.id) ||
|
|
123
117
|
null;
|
|
124
118
|
});
|
|
125
|
-
this.
|
|
126
|
-
this.
|
|
119
|
+
this.responses = [];
|
|
120
|
+
this.buffer = 0;
|
|
121
|
+
this.stream = false
|
|
127
122
|
},
|
|
128
|
-
updateAll() {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
123
|
+
async updateAll() {
|
|
124
|
+
this.stream = true
|
|
125
|
+
for (const media of this.mediaList) {
|
|
126
|
+
await this.uploadMedia(
|
|
127
|
+
Object.assign(
|
|
128
|
+
{ file: media.blob },
|
|
129
|
+
{
|
|
130
|
+
title: media.info.title,
|
|
131
|
+
alt_text: media.info.alt_text,
|
|
132
|
+
description: media.info.description,
|
|
133
|
+
folder: media.info.folder
|
|
134
|
+
}
|
|
141
135
|
)
|
|
142
|
-
)
|
|
143
|
-
).then(response => {
|
|
144
|
-
if (this.mediaList && this.mediaList.length) {
|
|
136
|
+
).then(r => this.responses.push(r)).catch(error => {
|
|
145
137
|
this.$mapo.$snack.open({
|
|
146
|
-
message: this.$t("mapo.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this.$refs.closeButton.$el.click();
|
|
150
|
-
}
|
|
151
|
-
}).catch(error => {
|
|
152
|
-
this.$mapo.$snack.open({
|
|
153
|
-
message: error.response?.data?.detail || this.$t("mapo.genericError"),
|
|
154
|
-
color: "error",
|
|
138
|
+
message: error.response?.data?.detail || this.$t("mapo.genericError"),
|
|
139
|
+
color: "error",
|
|
140
|
+
})
|
|
155
141
|
})
|
|
156
|
-
}
|
|
142
|
+
}
|
|
143
|
+
if (this.mediaList && this.mediaList.length) {
|
|
144
|
+
this.$mapo.$snack.open({
|
|
145
|
+
message: this.$t("mapo.mediaUploader.success", { numberFiles: this.responses.length || this.mediaList.length })
|
|
146
|
+
});
|
|
147
|
+
this.$emit("Upload", (this.responses.length && this.responses) || this.mediaList);
|
|
148
|
+
this.$refs.closeButton.$el.click();
|
|
149
|
+
}
|
|
157
150
|
},
|
|
158
|
-
uploadMedia(media) {
|
|
159
|
-
const index = this.mediaList.findIndex(el => el.blob === media.file);
|
|
151
|
+
async uploadMedia(media) {
|
|
160
152
|
const payload = this.$mapo.$api.multipart(media, ["file"]);
|
|
161
153
|
const conf = {
|
|
162
154
|
headers: { "Content-Type": "multipart/form-data" },
|
|
163
155
|
onUploadProgress: function(event) {
|
|
164
|
-
this.
|
|
165
|
-
(event.loaded / event.total) * 100
|
|
166
|
-
);
|
|
167
|
-
this.progress =
|
|
168
|
-
this.mediaList.reduce((acc, media) => acc + media.progress, 0) /
|
|
169
|
-
this.mediaList.length;
|
|
170
|
-
this.count = this.mediaList.reduce(
|
|
171
|
-
(acc, media) => acc + (media.progress === 100),
|
|
172
|
-
0
|
|
173
|
-
);
|
|
156
|
+
this.buffer = Math.ceil(this.buffer) + (event.loaded / event.total)
|
|
174
157
|
}.bind(this)
|
|
175
158
|
};
|
|
176
|
-
return this.mediaFileCrud.create(payload, conf);
|
|
159
|
+
return await this.mediaFileCrud.create(payload, conf);
|
|
177
160
|
}
|
|
178
161
|
}
|
|
179
162
|
};
|
|
@@ -198,7 +198,7 @@ export default {
|
|
|
198
198
|
synci18n: true,
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
|
-
value: "link.
|
|
201
|
+
value: "link.content_type",
|
|
202
202
|
label: this.$t("mapo.menuNodeEditor.relContentTypeLabel"),
|
|
203
203
|
vShow: ({ model }) => model.link.link_type == "RE",
|
|
204
204
|
onChange: this.loadPages,
|
|
@@ -213,7 +213,7 @@ export default {
|
|
|
213
213
|
},
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
|
-
value: "link.
|
|
216
|
+
value: "link.page_id",
|
|
217
217
|
label: this.$t("mapo.menuNodeEditor.relPageIdLabel"),
|
|
218
218
|
vShow: ({ model }) => model.link.link_type == "RE",
|
|
219
219
|
class: "col-md-6",
|
|
@@ -240,7 +240,7 @@ export default {
|
|
|
240
240
|
},
|
|
241
241
|
methods: {
|
|
242
242
|
async loadPages() {
|
|
243
|
-
const { content_type } = this.model?.link
|
|
243
|
+
const { content_type } = this.model?.link || {};
|
|
244
244
|
if (content_type) {
|
|
245
245
|
const options = { params: { language_code: this.lang } };
|
|
246
246
|
this.availablePages = await this.$mapo.$api
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapomodule/uikit",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.48",
|
|
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>",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "f6b486d9f3533cf24df29c092d521496c32c9625"
|
|
19
19
|
}
|
package/translations/en-US.js
CHANGED
|
@@ -162,6 +162,6 @@ export default {
|
|
|
162
162
|
fileInfo: "File info succesfully updated",
|
|
163
163
|
},
|
|
164
164
|
// MediaManager/MediaUploader.vue
|
|
165
|
-
mediaUploader: { success: "{numberFiles} files succesfully uploaded", tooLarge: "Warning! Optimize before upload!" },
|
|
165
|
+
mediaUploader: { optimizingFiles: "Optimizing files..", uploadingFiles: "Uploading files..", success: "{numberFiles} files succesfully uploaded", tooLarge: "Warning! Optimize before upload!" },
|
|
166
166
|
},
|
|
167
167
|
};
|
package/translations/it-IT.js
CHANGED
|
@@ -165,6 +165,6 @@ export default {
|
|
|
165
165
|
fileInfo: "File info succesfully updated",
|
|
166
166
|
},
|
|
167
167
|
// MediaManager/MediaUploader.vue
|
|
168
|
-
mediaUploader: { success: "{numberFiles} file caricati", tooLarge: "Attenzione! Ottimizza prima di caricare!" },
|
|
168
|
+
mediaUploader: { optimizingFiles: "Ottimizzazione dei file..", uploadingFiles: "Upload dei file..", success: "{numberFiles} file caricati", tooLarge: "Attenzione! Ottimizza prima di caricare!" },
|
|
169
169
|
},
|
|
170
170
|
};
|