@bildvitta/quasar-ui-asteroid 3.8.0-beta.3 → 3.8.0-beta.5
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 +2 -2
- package/src/components/app-menu/QasAppMenu.vue +220 -77
- package/src/components/app-menu/QasAppMenu.yml +8 -2
- package/src/components/app-menu/private/PvAppMenuDropdown.vue +75 -0
- package/src/components/btn/QasBtn.vue +14 -8
- package/src/components/btn/QasBtn.yml +5 -0
- package/src/components/btn-dropdown/QasBtnDropdown.vue +35 -3
- package/src/components/btn-dropdown/QasBtnDropdown.yml +16 -3
- package/src/components/form-view/QasFormView.vue +2 -2
- package/src/components/layout/QasLayout.vue +2 -2
- package/src/components/list-view/QasListView.vue +2 -2
- package/src/components/single-view/QasSingleView.vue +2 -2
- package/src/css/components/button.scss +14 -0
- package/src/css/mixins/set-button.scss +11 -1
- package/src/css/utils/container.scss +1 -1
- package/src/mixins/view.js +0 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bildvitta/quasar-ui-asteroid",
|
|
3
3
|
"description": "Asteroid",
|
|
4
|
-
"version": "3.8.0-beta.
|
|
4
|
+
"version": "3.8.0-beta.5",
|
|
5
5
|
"author": "Bild & Vitta <systemteam@bild.com.br>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/asteroid.cjs.min.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"autoprefixer": "^10.4.2",
|
|
36
36
|
"core-js": "^3.20.2",
|
|
37
37
|
"postcss": "^8.4.5",
|
|
38
|
-
"quasar": "^2.11.
|
|
38
|
+
"quasar": "^2.11.10",
|
|
39
39
|
"rimraf": "^3.0.2",
|
|
40
40
|
"rollup": "^2.66.0",
|
|
41
41
|
"rollup-plugin-local-resolve": "^1.0.7",
|
|
@@ -1,81 +1,106 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<div class="full-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
<div class="qas-app-menu">
|
|
3
|
+
<q-drawer v-model="model" :behavior="behavior" class="shadow-2" :mini="isMiniMode" :mini-width="88" show-if-above :width="drawerWidth" @mouseenter="onMouseEvent" @mouseleave="onMouseEvent">
|
|
4
|
+
<div class="column full-height justify-between no-wrap">
|
|
5
|
+
<div class="full-width">
|
|
6
|
+
<!-- Brand -->
|
|
7
|
+
<div v-if="!isUntilLarge" class="q-mb-xl q-pt-xl qas-app-menu__label" :class="spacedItemClass">
|
|
8
|
+
<router-link class="flex relative-position text-no-decoration" :class="brandPositionClass" :to="rootRoute">
|
|
9
|
+
<q-img v-if="normalizedBrand" :alt="title" class="qas-app-menu__brand qas-app-menu__label" :class="brandClass" height="40px" no-spinner :src="normalizedBrand" />
|
|
10
|
+
|
|
11
|
+
<span v-else-if="!isMiniMode" class="ellipsis text-bold text-primary text-subtitle2">{{ title }}</span>
|
|
12
|
+
|
|
13
|
+
<q-badge v-if="hasDevelopmentBadge" color="red" floating :label="developmentBadgeLabel" />
|
|
14
|
+
</router-link>
|
|
15
|
+
</div>
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<div class="full-width">
|
|
17
|
-
<qas-select v-model="module" borderless class="q-py-xs qas-app-menu__select shadow-2" dense input-class="q-px-md" :options="defaultModules" :outlined="false" :use-search="false" @update:model-value="redirectHandler(currentModelOption)" />
|
|
17
|
+
<div v-if="normalizedBrand" class="qas-app-menu__label" :class="spacedItemClass">
|
|
18
|
+
<q-separator />
|
|
18
19
|
</div>
|
|
19
20
|
|
|
20
|
-
<div v-if="
|
|
21
|
+
<div v-if="isUntilLarge" class="q-pr-xl q-pt-md text-right">
|
|
21
22
|
<qas-btn color="grey-9" icon="sym_r_close" variant="tertiary" @click="closeDrawer" />
|
|
22
23
|
</div>
|
|
23
|
-
</div>
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</q-item>
|
|
25
|
+
<!-- Module -->
|
|
26
|
+
<div v-if="displayModuleSection" class="items-center justify-between no-wrap q-mt-xl qas-app-menu__label qas-app-menu__module row" :class="spacedItemClass">
|
|
27
|
+
<div class="full-width text-center">
|
|
28
|
+
<pv-app-menu-dropdown v-bind="appMenuDropdownProps" />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
<!-- List -->
|
|
33
|
+
<q-list v-if="items.length" class="q-mt-xl qas-app-menu__menu text-grey-9">
|
|
34
|
+
<template v-for="(menuItem, index) in items">
|
|
35
|
+
<div v-if="hasChildren(menuItem)" :key="`children-${index}`" class="qas-app-menu__content" :class="contentClass">
|
|
36
|
+
<q-item class="ellipsis items-center q-py-none qas-app-menu__item qas-app-menu__item--label-mini text-weight-bold">
|
|
37
|
+
<div class="ellipsis qas-app-menu__label text-grey-9 text-subtitle2" :class="spacedItemClass">
|
|
38
|
+
{{ menuItem.label }}
|
|
39
|
+
</div>
|
|
40
|
+
</q-item>
|
|
41
|
+
|
|
42
|
+
<q-item v-for="(menuChildItem, childIndex) in menuItem.children" :key="childIndex" :active="isActive(menuChildItem)" class="qas-app-menu__children qas-app-menu__item qas-app-menu__item--children" :to="getRouterRedirect(menuChildItem)">
|
|
43
|
+
<q-item-section v-if="menuChildItem.icon" avatar>
|
|
44
|
+
<q-icon :name="menuChildItem.icon" />
|
|
45
|
+
</q-item-section>
|
|
46
|
+
|
|
47
|
+
<q-item-section>
|
|
48
|
+
<q-item-label>
|
|
49
|
+
<div class="ellipsis text-subtitle2">
|
|
50
|
+
{{ menuChildItem.label }}
|
|
51
|
+
</div>
|
|
52
|
+
</q-item-label>
|
|
53
|
+
</q-item-section>
|
|
54
|
+
</q-item>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<q-item v-else :key="index" :active="isActive(menuItem)" active-class="q-router-link--active" class="qas-app-menu__item" :to="getRouterRedirect(menuItem)">
|
|
58
|
+
<q-item-section v-if="menuItem.icon" avatar>
|
|
59
|
+
<q-icon :name="menuItem.icon" />
|
|
36
60
|
</q-item-section>
|
|
37
61
|
|
|
38
62
|
<q-item-section>
|
|
39
|
-
<q-item-label>
|
|
63
|
+
<q-item-label>
|
|
64
|
+
<div class="ellipsis text-subtitle2">
|
|
65
|
+
{{ menuItem.label }}
|
|
66
|
+
</div>
|
|
67
|
+
</q-item-label>
|
|
40
68
|
</q-item-section>
|
|
41
69
|
</q-item>
|
|
42
|
-
</
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<q-item-section v-if="menuItem.icon" avatar>
|
|
46
|
-
<q-icon :name="menuItem.icon" />
|
|
47
|
-
</q-item-section>
|
|
48
|
-
|
|
49
|
-
<q-item-section>
|
|
50
|
-
<q-item-label>{{ menuItem.label }}</q-item-label>
|
|
51
|
-
</q-item-section>
|
|
52
|
-
</q-item>
|
|
53
|
-
</template>
|
|
54
|
-
</q-list>
|
|
55
|
-
</div>
|
|
70
|
+
</template>
|
|
71
|
+
</q-list>
|
|
72
|
+
</div>
|
|
56
73
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
<!-- User -->
|
|
75
|
+
<div v-if="showUser" class="full-width q-pb-lg q-px-lg">
|
|
76
|
+
<qas-app-user v-bind="appUserProps" />
|
|
77
|
+
</div>
|
|
60
78
|
</div>
|
|
61
|
-
</
|
|
62
|
-
</
|
|
79
|
+
</q-drawer>
|
|
80
|
+
</div>
|
|
63
81
|
</template>
|
|
64
82
|
|
|
65
83
|
<script>
|
|
84
|
+
import PvAppMenuDropdown from './private/PvAppMenuDropdown.vue'
|
|
85
|
+
|
|
66
86
|
import QasAppUser from '../app-user/QasAppUser.vue'
|
|
87
|
+
|
|
67
88
|
import { isLocalDevelopment } from '../../helpers'
|
|
68
89
|
|
|
69
90
|
export default {
|
|
70
91
|
name: 'QasAppMenu',
|
|
71
92
|
|
|
72
93
|
components: {
|
|
94
|
+
PvAppMenuDropdown,
|
|
73
95
|
QasAppUser
|
|
74
96
|
},
|
|
75
97
|
|
|
98
|
+
inheritAttrs: false,
|
|
99
|
+
|
|
76
100
|
props: {
|
|
77
101
|
brand: {
|
|
78
102
|
default: '',
|
|
103
|
+
required: true,
|
|
79
104
|
type: String
|
|
80
105
|
},
|
|
81
106
|
|
|
@@ -84,6 +109,12 @@ export default {
|
|
|
84
109
|
type: Array
|
|
85
110
|
},
|
|
86
111
|
|
|
112
|
+
miniBrand: {
|
|
113
|
+
type: String,
|
|
114
|
+
required: true,
|
|
115
|
+
default: ''
|
|
116
|
+
},
|
|
117
|
+
|
|
87
118
|
modelValue: {
|
|
88
119
|
default: true,
|
|
89
120
|
type: Boolean
|
|
@@ -101,7 +132,6 @@ export default {
|
|
|
101
132
|
|
|
102
133
|
title: {
|
|
103
134
|
default: '',
|
|
104
|
-
required: true,
|
|
105
135
|
type: String
|
|
106
136
|
},
|
|
107
137
|
|
|
@@ -116,13 +146,58 @@ export default {
|
|
|
116
146
|
|
|
117
147
|
data () {
|
|
118
148
|
return {
|
|
149
|
+
hasOpenedMenu: false,
|
|
150
|
+
isMini: this.$qas.screen.isLarge,
|
|
119
151
|
module: ''
|
|
120
152
|
}
|
|
121
153
|
},
|
|
122
154
|
|
|
123
155
|
computed: {
|
|
156
|
+
appMenuDropdownProps () {
|
|
157
|
+
return {
|
|
158
|
+
buttonDropdownProps: {
|
|
159
|
+
'onUpdate:menu': this.setHasOpenedMenu
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
currentModule: this.currentModelOption,
|
|
163
|
+
modules: this.defaultModules
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
appUserProps () {
|
|
168
|
+
return {
|
|
169
|
+
avatarSize: '40px',
|
|
170
|
+
user: this.user,
|
|
171
|
+
|
|
172
|
+
menuProps: {
|
|
173
|
+
'onUpdate:modelValue': this.setHasOpenedMenu
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
// eventos
|
|
177
|
+
onSignOut: this.signOut
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
|
|
124
181
|
behavior () {
|
|
125
|
-
return this
|
|
182
|
+
return this.isUntilLarge ? 'mobile' : 'desktop'
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
brandClass () {
|
|
186
|
+
return {
|
|
187
|
+
'qas-app-menu__brand--spaced': !this.isMiniMode
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
brandPositionClass () {
|
|
192
|
+
return {
|
|
193
|
+
'justify-center': this.isMiniMode
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
contentClass () {
|
|
198
|
+
return {
|
|
199
|
+
'qas-app-menu__content--spaced': !this.isMiniMode
|
|
200
|
+
}
|
|
126
201
|
},
|
|
127
202
|
|
|
128
203
|
currentModelOption () {
|
|
@@ -144,6 +219,7 @@ export default {
|
|
|
144
219
|
// Add a default module called "Localhost" when app is running in local development.
|
|
145
220
|
defaultModules.unshift({
|
|
146
221
|
label: `Localhost ${this.title ? `(${this.title})` : ''}`,
|
|
222
|
+
icon: 'sym_r_home',
|
|
147
223
|
value
|
|
148
224
|
})
|
|
149
225
|
|
|
@@ -172,13 +248,25 @@ export default {
|
|
|
172
248
|
},
|
|
173
249
|
|
|
174
250
|
drawerWidth () {
|
|
175
|
-
return this
|
|
251
|
+
return this.isUntilLarge ? 320 : 280
|
|
176
252
|
},
|
|
177
253
|
|
|
178
254
|
hasDevelopmentBadge () {
|
|
179
255
|
return !!this.developmentBadgeLabel
|
|
180
256
|
},
|
|
181
257
|
|
|
258
|
+
isLargeScreen () {
|
|
259
|
+
return this.$qas.screen.isLarge
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
isMiniMode () {
|
|
263
|
+
return this.isLargeScreen && this.isMini && !this.hasOpenedMenu
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
isUntilLarge () {
|
|
267
|
+
return this.$qas.screen.untilLarge
|
|
268
|
+
},
|
|
269
|
+
|
|
182
270
|
model: {
|
|
183
271
|
get () {
|
|
184
272
|
return this.modelValue
|
|
@@ -189,12 +277,22 @@ export default {
|
|
|
189
277
|
}
|
|
190
278
|
},
|
|
191
279
|
|
|
280
|
+
normalizedBrand () {
|
|
281
|
+
return this.isMiniMode ? this.miniBrand : this.brand
|
|
282
|
+
},
|
|
283
|
+
|
|
192
284
|
rootRoute () {
|
|
193
285
|
return this.$router.hasRoute('Root') ? { name: 'Root' } : { path: '/' }
|
|
194
286
|
},
|
|
195
287
|
|
|
196
288
|
showUser () {
|
|
197
|
-
return this.hasUser && !this
|
|
289
|
+
return this.hasUser && !this.isUntilLarge
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
spacedItemClass () {
|
|
293
|
+
return {
|
|
294
|
+
'qas-app-menu__label--spaced': !this.isMiniMode
|
|
295
|
+
}
|
|
198
296
|
}
|
|
199
297
|
},
|
|
200
298
|
|
|
@@ -209,6 +307,10 @@ export default {
|
|
|
209
307
|
},
|
|
210
308
|
|
|
211
309
|
methods: {
|
|
310
|
+
closeDrawer () {
|
|
311
|
+
this.$emit('update:modelValue', false)
|
|
312
|
+
},
|
|
313
|
+
|
|
212
314
|
getNormalizedPath (path) {
|
|
213
315
|
return path.split('/').filter(Boolean)?.[0]
|
|
214
316
|
},
|
|
@@ -239,24 +341,28 @@ export default {
|
|
|
239
341
|
return currentPath === itemPath
|
|
240
342
|
},
|
|
241
343
|
|
|
242
|
-
|
|
243
|
-
if (!
|
|
244
|
-
|
|
245
|
-
|
|
344
|
+
onMouseEvent ({ type }) {
|
|
345
|
+
if (!this.isLargeScreen) return
|
|
346
|
+
|
|
347
|
+
const isMouseLeave = type === 'mouseleave'
|
|
348
|
+
|
|
349
|
+
this.isMini = isMouseLeave
|
|
350
|
+
|
|
351
|
+
this.model = false
|
|
246
352
|
},
|
|
247
353
|
|
|
248
354
|
signOut () {
|
|
249
355
|
this.$emit('sign-out')
|
|
250
356
|
},
|
|
251
357
|
|
|
252
|
-
|
|
253
|
-
this
|
|
358
|
+
setHasOpenedMenu (value) {
|
|
359
|
+
this.hasOpenedMenu = value
|
|
254
360
|
}
|
|
255
361
|
}
|
|
256
362
|
}
|
|
257
363
|
</script>
|
|
258
364
|
|
|
259
|
-
<style lang="scss">
|
|
365
|
+
<style lang="scss" scoped>
|
|
260
366
|
.qas-app-menu {
|
|
261
367
|
// Workaround para alterar o padding interno do QSelect sem influenciar na caixa de opções.
|
|
262
368
|
&__module {
|
|
@@ -269,15 +375,6 @@ export default {
|
|
|
269
375
|
}
|
|
270
376
|
}
|
|
271
377
|
|
|
272
|
-
&__brand {
|
|
273
|
-
max-width: 208px;
|
|
274
|
-
width: 100%;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
&__menu .q-item {
|
|
278
|
-
padding-left: var(--qas-spacing-lg);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
378
|
&__select {
|
|
282
379
|
border-radius: var(--qas-generic-border-radius);
|
|
283
380
|
}
|
|
@@ -287,25 +384,72 @@ export default {
|
|
|
287
384
|
margin-top: var(--qas-spacing-sm);
|
|
288
385
|
}
|
|
289
386
|
|
|
290
|
-
&--label {
|
|
291
|
-
margin-bottom: var(--qas-spacing-md);
|
|
292
|
-
min-height: 0;
|
|
293
|
-
padding-top: 0;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
387
|
&--children.q-item {
|
|
297
|
-
padding-left: calc(var(--qas-spacing-xl) + var(--qas-spacing-sm));
|
|
298
|
-
|
|
299
388
|
& + & {
|
|
300
389
|
margin-top: var(--qas-spacing-sm);
|
|
301
390
|
}
|
|
302
391
|
}
|
|
303
392
|
}
|
|
304
393
|
|
|
394
|
+
&__label {
|
|
395
|
+
padding-left: var(--qas-spacing-md) !important;
|
|
396
|
+
padding-right: var(--qas-spacing-md) !important;
|
|
397
|
+
transition: padding 120ms; // 120ms é o mesmo tempo utilizado na abertura do QDrawer.
|
|
398
|
+
will-change: auto;
|
|
399
|
+
|
|
400
|
+
&--spaced {
|
|
401
|
+
padding-left: var(--qas-spacing-xl) !important;
|
|
402
|
+
padding-right: var(--qas-spacing-xl) !important;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
&__brand {
|
|
407
|
+
width: 40px;
|
|
408
|
+
|
|
409
|
+
&--spaced {
|
|
410
|
+
width: 208px;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
&__item--label-mini {
|
|
415
|
+
padding-left: 0 !important;
|
|
416
|
+
padding-right: 0 !important;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.q-item:not(&__item--label-mini) {
|
|
420
|
+
padding-left: var(--qas-spacing-xl) !important;
|
|
421
|
+
padding-right: var(--qas-spacing-xl) !important;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
&__content .q-item {
|
|
425
|
+
// padding-top: 0;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
&__content + &__content {
|
|
429
|
+
position: relative;
|
|
430
|
+
transition: left 120ms, right 120ms;
|
|
431
|
+
|
|
432
|
+
&--spaced::before {
|
|
433
|
+
left: var(--qas-spacing-xl) !important;
|
|
434
|
+
right: var(--qas-spacing-xl) !important;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
&::before {
|
|
438
|
+
background-color: $separator-color;
|
|
439
|
+
content: '';
|
|
440
|
+
height: 1px;
|
|
441
|
+
left: var(--qas-spacing-md);
|
|
442
|
+
position: absolute;
|
|
443
|
+
right: var(--qas-spacing-md);
|
|
444
|
+
top: calc(var(--qas-spacing-xs) * -1);
|
|
445
|
+
transition: left 120ms, right 120ms;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
305
449
|
&__content + &__content,
|
|
306
450
|
&__item + &__content,
|
|
307
451
|
&__content + &__item {
|
|
308
|
-
margin-top: var(--qas-spacing-
|
|
452
|
+
margin-top: var(--qas-spacing-sm);
|
|
309
453
|
}
|
|
310
454
|
|
|
311
455
|
// User
|
|
@@ -315,7 +459,6 @@ export default {
|
|
|
315
459
|
|
|
316
460
|
// Media: untilLarge
|
|
317
461
|
@media (min-width: $breakpoint-sm-max) {
|
|
318
|
-
// Menu
|
|
319
462
|
&__menu {
|
|
320
463
|
max-height: calc(100vh - 310px);
|
|
321
464
|
overflow-x: auto;
|
|
@@ -5,13 +5,20 @@ meta:
|
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
7
|
brand:
|
|
8
|
-
desc:
|
|
8
|
+
desc: Logotipo quando menu esta aberto.
|
|
9
9
|
type: String
|
|
10
|
+
required: true
|
|
11
|
+
|
|
10
12
|
items:
|
|
11
13
|
desc: Itens do menu.
|
|
12
14
|
type: Array
|
|
13
15
|
default: []
|
|
14
16
|
|
|
17
|
+
mini-brand:
|
|
18
|
+
desc: Logotipo quando em modo "mini".
|
|
19
|
+
type: String
|
|
20
|
+
required: true
|
|
21
|
+
|
|
15
22
|
model-value:
|
|
16
23
|
desc: Model do componente, controla quando o menu lateral é aberto e fechado.
|
|
17
24
|
default: true
|
|
@@ -29,7 +36,6 @@ props:
|
|
|
29
36
|
|
|
30
37
|
title:
|
|
31
38
|
desc: Título que vai ficar no label do select de módulos.
|
|
32
|
-
required: true
|
|
33
39
|
type: String
|
|
34
40
|
|
|
35
41
|
user:
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pv-app-menu-dropdown">
|
|
3
|
+
<qas-btn-dropdown v-bind="defaultButtonDropdownProps">
|
|
4
|
+
<q-list>
|
|
5
|
+
<q-item v-for="item in modules" :key="item" :active="isActive(item)" active-class="text-primary" :href="item.value">
|
|
6
|
+
<q-item-section v-if="item.icon" avatar>
|
|
7
|
+
<q-icon :name="item.icon" />
|
|
8
|
+
</q-item-section>
|
|
9
|
+
|
|
10
|
+
<q-item-section>
|
|
11
|
+
<div>{{ item.label }}</div>
|
|
12
|
+
</q-item-section>
|
|
13
|
+
</q-item>
|
|
14
|
+
</q-list>
|
|
15
|
+
</qas-btn-dropdown>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'PvAppMenuDropdown',
|
|
22
|
+
|
|
23
|
+
props: {
|
|
24
|
+
buttonDropdownProps: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default: () => ({})
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
currentModule: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: () => ({})
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
modules: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default: () => []
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
computed: {
|
|
41
|
+
defaultButtonDropdownProps () {
|
|
42
|
+
return {
|
|
43
|
+
...this.buttonDropdownProps,
|
|
44
|
+
|
|
45
|
+
buttonProps: {
|
|
46
|
+
align: 'between',
|
|
47
|
+
class: 'text-subtitle2',
|
|
48
|
+
color: 'primary',
|
|
49
|
+
iconRight: 'sym_r_expand_more',
|
|
50
|
+
label: this.currentModule.label,
|
|
51
|
+
useEllipsis: true,
|
|
52
|
+
useLabelOnSmallScreen: true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
methods: {
|
|
59
|
+
isActive ({ value }) {
|
|
60
|
+
const { host, protocol } = window.location
|
|
61
|
+
const url = `${protocol}//${host}`
|
|
62
|
+
|
|
63
|
+
return url.includes(value)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style lang="scss">
|
|
70
|
+
.pv-app-menu-dropdown {
|
|
71
|
+
.qas-btn .q-icon {
|
|
72
|
+
font-size: 1.125rem !important;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-btn class="qas-btn" v-bind="attributes">
|
|
2
|
+
<q-btn ref="button" class="qas-btn" v-bind="attributes">
|
|
3
3
|
<slot />
|
|
4
4
|
|
|
5
5
|
<template v-for="(_, name) in slots" #[name]="context">
|
|
@@ -36,11 +36,6 @@ export default {
|
|
|
36
36
|
type: Boolean
|
|
37
37
|
},
|
|
38
38
|
|
|
39
|
-
useHoverOnWhiteColor: {
|
|
40
|
-
default: true,
|
|
41
|
-
type: Boolean
|
|
42
|
-
},
|
|
43
|
-
|
|
44
39
|
label: {
|
|
45
40
|
default: '',
|
|
46
41
|
type: String
|
|
@@ -54,13 +49,21 @@ export default {
|
|
|
54
49
|
|
|
55
50
|
return variants.includes(value)
|
|
56
51
|
}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
useEllipsis: {
|
|
55
|
+
type: Boolean
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
useHoverOnWhiteColor: {
|
|
59
|
+
default: true,
|
|
60
|
+
type: Boolean
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
|
|
60
64
|
computed: {
|
|
61
65
|
attributes () {
|
|
62
66
|
const {
|
|
63
|
-
align,
|
|
64
67
|
dense,
|
|
65
68
|
fab,
|
|
66
69
|
fabMini,
|
|
@@ -116,7 +119,10 @@ export default {
|
|
|
116
119
|
'qas-btn--tertiary-icon-only': this.hasIconOnly && this.isTertiary,
|
|
117
120
|
|
|
118
121
|
// hover
|
|
119
|
-
'qas-btn--no-hover-on-white': !this.useHoverOnWhiteColor
|
|
122
|
+
'qas-btn--no-hover-on-white': !this.useHoverOnWhiteColor,
|
|
123
|
+
|
|
124
|
+
// ellipsis
|
|
125
|
+
'qas-btn--ellipsis': this.useEllipsis
|
|
120
126
|
}
|
|
121
127
|
},
|
|
122
128
|
|
|
@@ -21,6 +21,11 @@ props:
|
|
|
21
21
|
desc: Ícone a direita.
|
|
22
22
|
type: String
|
|
23
23
|
|
|
24
|
+
use-ellipsis:
|
|
25
|
+
desc: adiciona ellipsis no label caso o label seja maior que a área total do botão.
|
|
26
|
+
default: false
|
|
27
|
+
type: Boolean
|
|
28
|
+
|
|
24
29
|
use-hover-on-white-color:
|
|
25
30
|
desc: Quando usamos a cor branca para contrast, em alguns casos podemos não querer ter um hover de outra cor justamente por conta do contraste, esta propriedade só funciona com variante "tertiary" e cor "white", para remover o hover sete o valor para "false".
|
|
26
31
|
default: true
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="qas-btn-dropdown" :class="classes">
|
|
3
3
|
<div v-if="hasLeftButton" :class="leftSideClasses">
|
|
4
4
|
<slot name="left-button">
|
|
5
5
|
<qas-btn variant="tertiary" v-bind="defaultButtonProps" @click="$emit('click', $event)">
|
|
6
|
-
<q-menu v-if="hasMenuOnLeftSide" anchor="bottom right" auto-close self="top right">
|
|
6
|
+
<q-menu v-if="hasMenuOnLeftSide" v-model="isMenuOpened" anchor="bottom right" auto-close self="top right" @update:model-value="onUpdateMenuValue">
|
|
7
7
|
<div :class="menuContentClasses">
|
|
8
8
|
<slot />
|
|
9
9
|
</div>
|
|
@@ -49,12 +49,28 @@ export default {
|
|
|
49
49
|
|
|
50
50
|
useMenuPadding: {
|
|
51
51
|
type: Boolean
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
menu: {
|
|
55
|
+
type: Boolean
|
|
52
56
|
}
|
|
53
57
|
},
|
|
54
58
|
|
|
55
|
-
emits: ['click'],
|
|
59
|
+
emits: ['click', 'update:menu'],
|
|
60
|
+
|
|
61
|
+
data () {
|
|
62
|
+
return {
|
|
63
|
+
isMenuOpened: false
|
|
64
|
+
}
|
|
65
|
+
},
|
|
56
66
|
|
|
57
67
|
computed: {
|
|
68
|
+
classes () {
|
|
69
|
+
return {
|
|
70
|
+
'flex inline items-center': this.useSplit
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
|
|
58
74
|
leftSideClasses () {
|
|
59
75
|
return {
|
|
60
76
|
'q-mr-sm': this.useSplit
|
|
@@ -107,6 +123,22 @@ export default {
|
|
|
107
123
|
hasSeparator () {
|
|
108
124
|
return !this.isSmall && this.useSplit
|
|
109
125
|
}
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
watch: {
|
|
129
|
+
menu: {
|
|
130
|
+
handler (value) {
|
|
131
|
+
this.isMenuOpened = value
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
immediate: true
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
methods: {
|
|
139
|
+
onUpdateMenuValue (value) {
|
|
140
|
+
this.$emit('update:menu', value)
|
|
141
|
+
}
|
|
110
142
|
}
|
|
111
143
|
}
|
|
112
144
|
</script>
|
|
@@ -15,16 +15,22 @@ props:
|
|
|
15
15
|
default: sym_r_more_vert
|
|
16
16
|
type: String
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
desc:
|
|
18
|
+
menu:
|
|
19
|
+
desc: Model do menu de dropdown.
|
|
20
20
|
default: false
|
|
21
21
|
type: Boolean
|
|
22
|
+
model: true
|
|
22
23
|
|
|
23
24
|
use-menu-padding:
|
|
24
25
|
desc: Habilita o espaçamento dentro do menu de 16px (q-pa-md).
|
|
25
26
|
default: false
|
|
26
27
|
type: Boolean
|
|
27
28
|
|
|
29
|
+
use-split:
|
|
30
|
+
desc: Divide o componente em 2 ações, o primeiro (direita) é um botão padrão, o segundo (esquerda) é um botão com ícone que abre o dropdown, criando uma separação com o QSeparator.
|
|
31
|
+
default: false
|
|
32
|
+
type: Boolean
|
|
33
|
+
|
|
28
34
|
slots:
|
|
29
35
|
default:
|
|
30
36
|
desc: Slot para passar o conteúdo do dropdown (menu)
|
|
@@ -33,10 +39,17 @@ slots:
|
|
|
33
39
|
desc: Slot para substituir o botão a esquerda.
|
|
34
40
|
|
|
35
41
|
events:
|
|
36
|
-
'click':
|
|
42
|
+
'@click -> function (event)':
|
|
37
43
|
desc: Caso não tenha "useSplit", o evento é disparado ao clicar no componente como um todo, caso tenha "useSplit", o evento é disparado ao clicar no botão a esquerda.
|
|
38
44
|
params:
|
|
39
45
|
event:
|
|
40
46
|
desc: Evento nativo de click.
|
|
41
47
|
type: Object
|
|
42
48
|
|
|
49
|
+
'@update:menu -> function (isMenuOpened)':
|
|
50
|
+
desc: Retorna toda vez que o menu é aberto ou fechado
|
|
51
|
+
params:
|
|
52
|
+
isMenuOpened:
|
|
53
|
+
desc: Estado do menu.
|
|
54
|
+
default: false
|
|
55
|
+
type: Boolean
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div class="qas-form-view" :class="mx_componentClass">
|
|
3
3
|
<header v-if="mx_hasHeaderSlot">
|
|
4
4
|
<slot name="header" />
|
|
5
5
|
</header>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<q-inner-loading :showing="mx_isFetching">
|
|
30
30
|
<q-spinner color="grey" size="3em" />
|
|
31
31
|
</q-inner-loading>
|
|
32
|
-
</
|
|
32
|
+
</div>
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-layout view="hHh Lpr
|
|
2
|
+
<q-layout view="hHh Lpr lff">
|
|
3
3
|
<slot v-if="$qas.screen.untilLarge" name="app-bar">
|
|
4
4
|
<qas-app-bar v-bind="appBarProps" @sign-out="signOut" @toggle-menu="toggleMenuDrawer" />
|
|
5
5
|
</slot>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<slot>
|
|
12
12
|
<q-page-container>
|
|
13
|
-
<q-page
|
|
13
|
+
<q-page>
|
|
14
14
|
<router-view />
|
|
15
15
|
</q-page>
|
|
16
16
|
</q-page-container>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div :class="mx_componentClass">
|
|
3
3
|
<q-pull-to-refresh :disable="!useRefresh" @refresh="refresh">
|
|
4
4
|
<header v-if="hasHeaderSlot">
|
|
5
5
|
<slot name="header" />
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</q-pull-to-refresh>
|
|
38
38
|
|
|
39
39
|
<slot name="footer" />
|
|
40
|
-
</
|
|
40
|
+
</div>
|
|
41
41
|
</template>
|
|
42
42
|
|
|
43
43
|
<script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div :class="mx_componentClass">
|
|
3
3
|
<header v-if="mx_hasHeaderSlot">
|
|
4
4
|
<slot name="header" />
|
|
5
5
|
</header>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<q-inner-loading :showing="mx_isFetching">
|
|
21
21
|
<q-spinner color="grey" size="3em" />
|
|
22
22
|
</q-inner-loading>
|
|
23
|
-
</
|
|
23
|
+
</div>
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
@@ -81,6 +81,20 @@
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
&--ellipsis {
|
|
85
|
+
width: 100%;
|
|
86
|
+
|
|
87
|
+
.q-btn__content {
|
|
88
|
+
flex-wrap: nowrap;
|
|
89
|
+
|
|
90
|
+
.block {
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
84
98
|
&.q-btn {
|
|
85
99
|
&::before {
|
|
86
100
|
display: none;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
@mixin set-button(
|
|
1
|
+
@mixin set-button(
|
|
2
|
+
$variant,
|
|
3
|
+
$icon-only: false,
|
|
4
|
+
$no-hover-on-white: false,
|
|
5
|
+
$color: false,
|
|
6
|
+
$ellipsis: false
|
|
7
|
+
) {
|
|
2
8
|
@extend .qas-btn;
|
|
3
9
|
@extend .qas-btn--#{$variant};
|
|
4
10
|
|
|
@@ -13,4 +19,8 @@
|
|
|
13
19
|
@if $no-hover-on-white {
|
|
14
20
|
@extend .qas-btn--no-hover-on-white;
|
|
15
21
|
}
|
|
22
|
+
|
|
23
|
+
@if $ellipsis {
|
|
24
|
+
@extend .qas-btn--ellipsis;
|
|
25
|
+
}
|
|
16
26
|
}
|