@bildvitta/quasar-ui-asteroid 2.13.0 → 2.15.0
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/package.json +1 -1
- package/src/components/app-menu/QasAppMenu.stories.js +4 -0
- package/src/components/app-menu/QasAppMenu.vue +35 -12
- package/src/components/layout/QasLayout.stories.js +1 -3
- package/src/components/layout/QasLayout.vue +10 -5
- package/src/components/list-items/QasListItems.stories.js +6 -1
- package/src/components/list-items/QasListItems.vue +6 -1
- package/src/components/resizer/QasResizer.vue +1 -1
- package/src/components/uploader/QasCustomUploader.vue +0 -1
- package/src/helpers/filters.js +1 -1
- package/src/helpers/index.js +4 -2
- package/src/helpers/isLocalDevelopment.js +3 -0
package/package.json
CHANGED
|
@@ -30,6 +30,10 @@ export default {
|
|
|
30
30
|
description: 'Controls drawer menu visibility.'
|
|
31
31
|
},
|
|
32
32
|
|
|
33
|
+
title: {
|
|
34
|
+
description: 'Title for displaying inside "modules" as label when is in development (local).'
|
|
35
|
+
},
|
|
36
|
+
|
|
33
37
|
// Events
|
|
34
38
|
input: {
|
|
35
39
|
description: 'Fires when opening or closing the drawer menu.'
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
Você está no modulo:
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
|
-
<qas-select v-model="module" :options="
|
|
10
|
+
<qas-select v-model="module" :options="defaultModules" @input="redirectHandler(currentModelOption)" />
|
|
11
11
|
</div>
|
|
12
12
|
|
|
13
13
|
<q-list class="text-grey-9 text-weight-medium">
|
|
14
14
|
<template v-for="(header, index) in items">
|
|
15
|
-
<q-expansion-item v-if="hasChildren(header)" :key="header.label" :ref="`item-${index}`" :default-opened="shouldExpand(header)" expand-icon="o_keyboard_arrow_down" expand-separator group="item" :icon="header.icon" :label="header.label" :to="header.to" @click="toggleItem(index)"
|
|
15
|
+
<q-expansion-item v-if="hasChildren(header)" :key="header.label" :ref="`item-${index}`" :active-class="activeItemClassesSecondary" :default-opened="shouldExpand(header)" expand-icon="o_keyboard_arrow_down" expand-separator group="item" :icon="header.icon" :label="header.label" :to="header.to" @click="toggleItem(index)">
|
|
16
16
|
<q-item v-for="(item, itemIndex) in header.children" :key="itemIndex" v-ripple :active-class="activeItemClasses" clickable :to="item.to">
|
|
17
17
|
<q-item-section v-if="item.icon" avatar>
|
|
18
18
|
<q-icon :name="item.icon" />
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
<script>
|
|
46
46
|
import { screenMixin } from '../../mixins'
|
|
47
|
+
import { isLocalDevelopment } from '../../helpers'
|
|
47
48
|
|
|
48
49
|
export default {
|
|
49
50
|
name: 'QasAppMenu',
|
|
@@ -66,14 +67,14 @@ export default {
|
|
|
66
67
|
type: Boolean
|
|
67
68
|
},
|
|
68
69
|
|
|
70
|
+
title: {
|
|
71
|
+
default: '',
|
|
72
|
+
type: String
|
|
73
|
+
},
|
|
74
|
+
|
|
69
75
|
modules: {
|
|
70
76
|
default: () => [],
|
|
71
77
|
type: Array
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
currentModule: {
|
|
75
|
-
default: '',
|
|
76
|
-
type: String
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
80
|
|
|
@@ -94,6 +95,22 @@ export default {
|
|
|
94
95
|
return 'text-primary bg-secondary-contrast'
|
|
95
96
|
},
|
|
96
97
|
|
|
98
|
+
defaultModules () {
|
|
99
|
+
if (!isLocalDevelopment()) return this.modules
|
|
100
|
+
|
|
101
|
+
const defaultModules = [...this.modules]
|
|
102
|
+
const { host, protocol } = window.location
|
|
103
|
+
const value = `${protocol}//${host}`
|
|
104
|
+
|
|
105
|
+
// if app is in development mode (local) it's added a default module
|
|
106
|
+
defaultModules.unshift({
|
|
107
|
+
label: `Localhost ${this.title ? `(${this.title})` : ''}`,
|
|
108
|
+
value
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
return defaultModules
|
|
112
|
+
},
|
|
113
|
+
|
|
97
114
|
model: {
|
|
98
115
|
get () {
|
|
99
116
|
return this.value
|
|
@@ -105,11 +122,17 @@ export default {
|
|
|
105
122
|
},
|
|
106
123
|
|
|
107
124
|
currentModelOption () {
|
|
108
|
-
return this.
|
|
125
|
+
return this.defaultModules.find(module => module?.value === this.module)
|
|
109
126
|
},
|
|
110
127
|
|
|
111
128
|
displayModuleSection () {
|
|
112
|
-
return !this.isMini && this.
|
|
129
|
+
return !this.isMini && this.defaultModules.length
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
currentModule () {
|
|
133
|
+
const hostname = window.location.hostname
|
|
134
|
+
|
|
135
|
+
return this.defaultModules.find(module => module?.value.includes(hostname))?.value
|
|
113
136
|
}
|
|
114
137
|
},
|
|
115
138
|
|
|
@@ -142,9 +165,9 @@ export default {
|
|
|
142
165
|
this.isMini = value
|
|
143
166
|
},
|
|
144
167
|
|
|
145
|
-
redirectHandler ({
|
|
146
|
-
if (!
|
|
147
|
-
window.location.href =
|
|
168
|
+
redirectHandler ({ value }) {
|
|
169
|
+
if (!value.includes(window.location.host)) {
|
|
170
|
+
window.location.href = value
|
|
148
171
|
}
|
|
149
172
|
},
|
|
150
173
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</slot>
|
|
6
6
|
|
|
7
7
|
<slot name="app-menu">
|
|
8
|
-
<qas-app-menu v-model="menuDrawer" v-bind="
|
|
8
|
+
<qas-app-menu v-model="menuDrawer" v-bind="defaultAppMenuProps" v-on="appMenuEvents" />
|
|
9
9
|
</slot>
|
|
10
10
|
|
|
11
11
|
<slot>
|
|
@@ -61,11 +61,16 @@ export default {
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
computed: {
|
|
65
|
+
defaultAppMenuProps () {
|
|
66
|
+
return {
|
|
67
|
+
...this.appMenuProps,
|
|
68
|
+
title: this.appBarProps?.title
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
68
72
|
|
|
73
|
+
watch: {
|
|
69
74
|
value: {
|
|
70
75
|
handler (value) {
|
|
71
76
|
this.menuDrawer = value
|
|
@@ -38,7 +38,12 @@ export default {
|
|
|
38
38
|
|
|
39
39
|
redirectKey: {
|
|
40
40
|
control: null,
|
|
41
|
-
description: '
|
|
41
|
+
description: 'Item key that will be the value of the redirect.'
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
paramKey: {
|
|
45
|
+
control: null,
|
|
46
|
+
description: 'Redirect parameter key.'
|
|
42
47
|
},
|
|
43
48
|
|
|
44
49
|
useIconRedirect: {
|
|
@@ -44,6 +44,11 @@ export default {
|
|
|
44
44
|
type: String
|
|
45
45
|
},
|
|
46
46
|
|
|
47
|
+
paramKey: {
|
|
48
|
+
default: 'id',
|
|
49
|
+
type: String
|
|
50
|
+
},
|
|
51
|
+
|
|
47
52
|
to: {
|
|
48
53
|
default: () => ({}),
|
|
49
54
|
type: Object
|
|
@@ -61,7 +66,7 @@ export default {
|
|
|
61
66
|
|
|
62
67
|
getRedirectPayload (item) {
|
|
63
68
|
return {
|
|
64
|
-
params: { [this.
|
|
69
|
+
params: { [this.paramKey]: item[this.redirectKey] },
|
|
65
70
|
...this.to
|
|
66
71
|
}
|
|
67
72
|
}
|
package/src/helpers/filters.js
CHANGED
package/src/helpers/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import base64ToBlob from './base64ToBlob.js'
|
|
2
|
+
import constructObject from './constructObject.js'
|
|
2
3
|
import filterObject from './filter-object.js'
|
|
3
4
|
import greatestCommonDivisor from './greatestCommonDivisor.js'
|
|
5
|
+
import isLocalDevelopment from './isLocalDevelopment.js'
|
|
4
6
|
import { history, handleHistory } from './historyHandler.js'
|
|
5
|
-
import constructObject from './constructObject.js'
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
asset,
|
|
@@ -53,5 +54,6 @@ export {
|
|
|
53
54
|
|
|
54
55
|
base64ToBlob,
|
|
55
56
|
filterObject,
|
|
56
|
-
greatestCommonDivisor
|
|
57
|
+
greatestCommonDivisor,
|
|
58
|
+
isLocalDevelopment
|
|
57
59
|
}
|