@mapomodule/uikit 1.0.0-alpha.24 → 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.
- package/CHANGELOG.md +19 -0
- package/components/Detail/Detail.vue +1 -1
- package/components/Form/fields/MediaField.vue +6 -0
- package/components/MediaManager/MediaUploader.vue +1 -1
- package/defaults/i18n.js +37 -0
- package/defaults/vuetify.js +33 -0
- package/module.js +3 -9
- package/package.json +2 -2
- package/defaults.js +0 -75
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.25](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.24...v1.0.0-alpha.25) (2022-08-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fix detail field language list ([1d290e6](https://github.com/lotrekagency/mapo/commit/1d290e69c180fe31c97dfb45e2c1afcdcb569f1d))
|
|
12
|
+
* fix mediauploader typo ([67e7e4e](https://github.com/lotrekagency/mapo/commit/67e7e4e8e2214580c99331d7c21eef551edf08cc))
|
|
13
|
+
* fixed bug on preview image ([f2878ee](https://github.com/lotrekagency/mapo/commit/f2878ee5d60bc74cab49ee0c055ace22f7d37076))
|
|
14
|
+
* removed some accidental trash from previous commit ([4a85da4](https://github.com/lotrekagency/mapo/commit/4a85da419bddaadfe6a08afa5f71fe5e76e346f7))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **i18n:** move i18n config to mapo defaults to enable mixed merges of user and mapo options. ([2190aa9](https://github.com/lotrekagency/mapo/commit/2190aa9ebf106d811a64e27502d3a45b75a3e9af))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [1.0.0-alpha.24](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2022-07-22)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -320,7 +320,7 @@ export default {
|
|
|
320
320
|
return !Object.keys(this.model).length;
|
|
321
321
|
},
|
|
322
322
|
langs() {
|
|
323
|
-
return this.modelLanguages.length ? this.modelLanguages : this.languages;
|
|
323
|
+
return (this.modelLanguages || []).length ? this.modelLanguages : this.languages;
|
|
324
324
|
},
|
|
325
325
|
slotBindings() {
|
|
326
326
|
return {
|
|
@@ -205,6 +205,11 @@ export default {
|
|
|
205
205
|
})
|
|
206
206
|
.then((res) => (res ? (this.internalValue = null) : null));
|
|
207
207
|
},
|
|
208
|
+
isImage(val) {
|
|
209
|
+
if (!val?.is_image && val?.mime_type.includes("image")) {
|
|
210
|
+
Object.assign(val, { is_image: true });
|
|
211
|
+
}
|
|
212
|
+
},
|
|
208
213
|
},
|
|
209
214
|
|
|
210
215
|
watch: {
|
|
@@ -214,6 +219,7 @@ export default {
|
|
|
214
219
|
}
|
|
215
220
|
},
|
|
216
221
|
internalValue(val) {
|
|
222
|
+
this.isImage(val)
|
|
217
223
|
this.$emit("input", val);
|
|
218
224
|
},
|
|
219
225
|
},
|
package/defaults/i18n.js
ADDED
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import colors from "vuetify/es5/util/colors";
|
|
2
|
+
import { it, en } from "vuetify/lib/locale";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
customVariables: ["@mapomodule/uikit/assets/variables.scss"],
|
|
6
|
+
theme: {
|
|
7
|
+
dark: true,
|
|
8
|
+
themes: {
|
|
9
|
+
dark: {
|
|
10
|
+
primary: "#51beaa",
|
|
11
|
+
accent: colors.grey.darken3,
|
|
12
|
+
secondary: colors.amber.darken3,
|
|
13
|
+
info: colors.teal.lighten1,
|
|
14
|
+
warning: colors.amber.base,
|
|
15
|
+
error: "#FF5252",
|
|
16
|
+
success: colors.green.accent3,
|
|
17
|
+
},
|
|
18
|
+
light: {
|
|
19
|
+
primary: "#51beaa",
|
|
20
|
+
accent: colors.indigo.accent1,
|
|
21
|
+
secondary: colors.amber.accent2,
|
|
22
|
+
info: colors.teal.lighten1,
|
|
23
|
+
warning: colors.amber.base,
|
|
24
|
+
error: "#FF5252",
|
|
25
|
+
success: colors.green.accent3,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
lang: {
|
|
30
|
+
locales: { en, it },
|
|
31
|
+
},
|
|
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,15 +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', {
|
|
24
|
-
|
|
25
|
-
lang: userModuleOptions.vuetify?.lang || mapoDefaults.vuetify.lang
|
|
26
|
-
}]);
|
|
22
|
+
this.requireModule(['@nuxtjs/vuetify', (this.options && this.options.vuetify) || userModuleOptions.vuetify || {}]);
|
|
23
|
+
|
|
27
24
|
// 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
|
-
}]);
|
|
25
|
+
this.requireModule(['@nuxtjs/i18n', (this.options && this.options.i18n) || userModuleOptions.i18n || {},]);
|
|
32
26
|
|
|
33
27
|
// INJECT ALL LAYOUTS
|
|
34
28
|
const layouts = (await resolver.resolveRelative(__dirname, 'layouts')).map(({ src }) => src)
|
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.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>",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "eadf1c2835aa6aba84870dc8d98308f10b257527"
|
|
19
19
|
}
|
package/defaults.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import colors from "vuetify/es5/util/colors";
|
|
2
|
-
import { it, en } from "vuetify/lib/locale";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
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
|
-
},
|
|
28
|
-
},
|
|
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;
|
|
70
|
-
}
|
|
71
|
-
context.app.vuetify.framework.lang.current = locale.iso ? locale.iso.split("-")[0] : locale.code;
|
|
72
|
-
context.app.vuetify.framework.rtl = isRTL;
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
};
|