@bildvitta/quasar-ui-asteroid 2.12.4 → 3.0.0-alpha.1
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/dist/api/QasBox.json +16 -0
- package/dist/api/QasBreakline.json +32 -0
- package/dist/api/QasBtn.json +15 -0
- package/dist/api/QasDebugger.json +13 -0
- package/dist/asteroid.cjs.css +1 -0
- package/dist/asteroid.cjs.js +9154 -0
- package/dist/asteroid.cjs.min.js +6 -0
- package/dist/asteroid.esm.css +1 -0
- package/dist/asteroid.esm.js +9145 -0
- package/dist/asteroid.esm.min.js +6 -0
- package/dist/asteroid.umd.css +1 -0
- package/dist/asteroid.umd.js +9148 -0
- package/dist/asteroid.umd.min.js +6 -0
- package/dist/vetur/asteroid-attributes.json +30 -0
- package/dist/vetur/asteroid-tags.json +29 -0
- package/package.json +42 -56
- package/src/assets/logo-modular.svg +1 -0
- package/src/asteroid.js +1 -0
- package/src/components/actions/QasActions.vue +45 -0
- package/src/components/actions-menu/QasActionsMenu.vue +8 -19
- package/src/components/alert/QasAlert.vue +90 -0
- package/src/components/app-bar/QasAppBar.vue +59 -61
- package/src/components/app-menu/QasAppMenu.vue +128 -41
- package/src/components/avatar/QasAvatar.vue +7 -3
- package/src/components/box/QasBox.vue +12 -4
- package/src/components/box/QasBox.yml +13 -0
- package/src/components/breakline/QasBreakline.vue +37 -0
- package/src/components/breakline/QasBreakline.yml +25 -0
- package/src/components/btn/QasBtn.vue +27 -24
- package/src/components/btn/QasBtn.yml +12 -0
- package/src/components/card/QasCard.vue +29 -21
- package/src/components/checkbox-group/QasCheckboxGroup.vue +31 -17
- package/src/components/copy/QasCopy.vue +22 -11
- package/src/components/date-time-input/QasDateTimeInput.vue +16 -26
- package/src/components/debugger/QasDebugger.vue +2 -0
- package/src/components/debugger/QasDebugger.yml +10 -0
- package/src/components/delete/QasDelete.vue +28 -15
- package/src/components/dialog/QasDialog.vue +71 -67
- package/src/components/dialog-router/QasDialogRouter.vue +12 -4
- package/src/components/field/QasField.vue +22 -25
- package/src/components/filters/QasFilters.vue +31 -24
- package/src/components/form-generator/QasFormGenerator.vue +13 -15
- package/src/components/form-view/QasFormView.vue +117 -66
- package/src/components/gallery/QasGallery.vue +39 -26
- package/src/components/grid-generator/QasGridGenerator.vue +12 -6
- package/src/components/index.js +0 -0
- package/src/components/input/QasInput.vue +38 -36
- package/src/components/label/QasLabel.vue +14 -15
- package/src/components/layout/QasLayout.vue +81 -0
- package/src/components/list-items/QasListItems.vue +16 -8
- package/src/components/list-view/QasListView.vue +31 -28
- package/src/components/map/QasMap.vue +15 -25
- package/src/components/nested-fields/QasNestedFields.vue +39 -36
- package/src/components/numeric-input/QasNumericInput.vue +125 -0
- package/src/components/page-header/QasPageHeader.vue +19 -10
- package/src/components/password-input/QasPasswordInput.vue +20 -18
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.vue +52 -31
- package/src/components/profile/QasProfile.vue +14 -12
- package/src/components/resizer/QasResizer.vue +1 -1
- package/src/components/search-box/QasSearchBox.vue +36 -20
- package/src/components/select/QasSelect.vue +43 -44
- package/src/components/select-list/QasSelectList.vue +64 -51
- package/src/components/signature-pad/QasSignaturePad.vue +57 -41
- package/src/components/signature-uploader/QasSignatureUploader.vue +15 -13
- package/src/components/single-view/QasSingleView.vue +31 -17
- package/src/components/sortable/QasSortable.vue +45 -27
- package/src/components/table-generator/QasTableGenerator.vue +95 -22
- package/src/components/tabs-generator/QasTabsGenerator.vue +36 -24
- package/src/components/text-truncate/QasTextTruncate.vue +25 -17
- package/src/components/transfer/QasTransfer.vue +57 -53
- package/src/components/uploader/QasUploader.vue +169 -48
- package/src/css/background.scss +1 -1
- package/src/css/border.scss +7 -6
- package/src/css/design-system.scss +0 -43
- package/src/css/fonts.scss +2 -28
- package/src/css/opacity.scss +0 -4
- package/src/css/set-brand.scss +15 -0
- package/src/css/transitions.scss +1 -1
- package/src/helpers/add-counter-suffix.js +3 -0
- package/src/helpers/{base64ToBlob.js → base-64-to-blob.js} +0 -0
- package/src/helpers/{constructObject.js → construct-object.js} +0 -0
- package/src/helpers/filter-object.js +8 -6
- package/src/helpers/filters.js +3 -4
- package/src/helpers/get-slot-children-text.js +15 -0
- package/src/helpers/{greatestCommonDivisor.js → greatest-common-divisor.js} +0 -0
- package/src/helpers/images.js +28 -0
- package/src/helpers/index.js +11 -57
- package/src/helpers/is-local-development.js +3 -0
- package/src/helpers/scroll-on-grap.js +61 -0
- package/src/index.cjs.js +1 -0
- package/src/index.esm.js +4 -0
- package/src/index.scss +18 -20
- package/src/index.umd.js +2 -0
- package/src/mixins/context.js +1 -1
- package/src/mixins/dialog-router.js +17 -0
- package/src/mixins/form.js +4 -12
- package/src/mixins/generator.js +14 -14
- package/src/mixins/index.js +2 -8
- package/src/mixins/password.js +73 -11
- package/src/mixins/screen.js +8 -6
- package/src/mixins/view.js +57 -20
- package/src/plugins/Dialog.js +14 -0
- package/src/plugins/NotifySuccess.js +3 -3
- package/src/plugins/index.js +4 -2
- package/src/store/history.js +43 -0
- package/src/store/index.js +1 -0
- package/src/vue-plugin.js +185 -0
- package/.babelrc +0 -12
- package/.storybook/main.js +0 -35
- package/.storybook/preview.js +0 -26
- package/debug.log +0 -1
- package/index.js +0 -4
- package/jest-setup.js +0 -1
- package/jest.config.json +0 -22
- package/postcss.config.js +0 -5
- package/src/components/Introduction.stories.mdx +0 -12
- package/src/components/actions-menu/QasActionsMenu.stories.js +0 -73
- package/src/components/app-bar/QasAppBar.stories.js +0 -88
- package/src/components/app-menu/QasAppMenu.stories.js +0 -62
- package/src/components/apps-menu/QasAppsMenu.spec.js +0 -58
- package/src/components/apps-menu/QasAppsMenu.stories.js +0 -54
- package/src/components/apps-menu/QasAppsMenu.vue +0 -48
- package/src/components/avatar/QasAvatar.spec.js +0 -14
- package/src/components/avatar/QasAvatar.stories.js +0 -52
- package/src/components/box/QasBox.spec.js +0 -18
- package/src/components/box/QasBox.stories.js +0 -35
- package/src/components/break-line/QasBreakLine.stories.js +0 -57
- package/src/components/break-line/QasBreakLine.vue +0 -52
- package/src/components/btn/QasBtn.stories.js +0 -45
- package/src/components/btn-actions/QasBtnActions.stories.js +0 -77
- package/src/components/btn-actions/QasBtnActions.vue +0 -54
- package/src/components/card/QasCard.stories.js +0 -126
- package/src/components/checkbox-group/QasCheckboxGroup.stories.js +0 -59
- package/src/components/copy/QasCopy.stories.js +0 -41
- package/src/components/date-time-input/QasDateTimeInput.stories.js +0 -67
- package/src/components/debugger/QasDebugger.stories.js +0 -33
- package/src/components/decimal-input/QasDecimalInput.stories.js +0 -82
- package/src/components/decimal-input/QasDecimalInput.vue +0 -92
- package/src/components/delete/QasDelete.stories.js +0 -80
- package/src/components/dialog/QasDialog.stories.js +0 -139
- package/src/components/dialog-router/QasDialogRouter.stories.js +0 -38
- package/src/components/field/QasField.stories.js +0 -181
- package/src/components/filters/QasFilters.stories.js +0 -121
- package/src/components/form-generator/QasFormGenerator.stories.js +0 -115
- package/src/components/form-view/QasFormView.stories.js +0 -236
- package/src/components/gallery/QasGallery.stories.js +0 -91
- package/src/components/grid-generator/QasGridGenerator.stories.js +0 -138
- package/src/components/input/QasInput.stories.js +0 -78
- package/src/components/label/QasLabel.stories.js +0 -60
- package/src/components/list-items/QasListItems.stories.js +0 -130
- package/src/components/list-view/QasListView.stories.js +0 -168
- package/src/components/map/QasMap.stories.js +0 -75
- package/src/components/nested-fields/QasNestedFields.stories.js +0 -255
- package/src/components/page-header/QasPageHeader.stories.js +0 -61
- package/src/components/password-input/QasPasswordInput.stories.js +0 -76
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.stories.js +0 -54
- package/src/components/profile/QasProfile.stories.js +0 -131
- package/src/components/resizer/QasResizer.stories.js +0 -43
- package/src/components/search-box/QasSearchBox.stories.js +0 -111
- package/src/components/select/QasSelect.stories.js +0 -113
- package/src/components/select-list/QasSelectList.stories.js +0 -153
- package/src/components/signature-pad/QasSignaturePad.stories.js +0 -51
- package/src/components/signature-uploader/QasSignatureUploader.stories.js +0 -69
- package/src/components/single-view/QasSingleView.stories.js +0 -130
- package/src/components/sortable/QasSortable.stories.js +0 -80
- package/src/components/table-generator/QasTableGenerator.stories.js +0 -116
- package/src/components/tabs-generator/QasTabsGenerator.stories.js +0 -145
- package/src/components/text-truncate/QasTextTruncate.stories.js +0 -55
- package/src/components/tip/QasTip.stories.js +0 -57
- package/src/components/tip/QasTip.vue +0 -68
- package/src/components/tooltip/QasTooltip.stories.js +0 -63
- package/src/components/tooltip/QasTooltip.vue +0 -81
- package/src/components/transfer/QasTransfer.stories.js +0 -118
- package/src/components/uploader/QasCustomUploader.vue +0 -121
- package/src/components/uploader/QasUploader.stories.js +0 -139
- package/src/directives/Test.js +0 -13
- package/src/helpers/historyHandler.js +0 -52
- package/src/helpers/label.js +0 -3
- package/src/index.js +0 -245
- package/src/mixins/map-markers.js +0 -26
- package/src/mixins/unsaved-changes.js +0 -24
- package/src/mixins/uploader.js +0 -30
- package/src/mocks/json/user.json +0 -27
- package/src/mocks/json/users-new.json +0 -23
- package/src/mocks/json/users.json +0 -97
- package/src/mocks/storeModule.js +0 -71
- package/src/pages/Forbidden.vue +0 -6
- package/src/pages/NotFound.vue +0 -6
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classes">
|
|
3
|
+
<div class="col-12 col-sm-auto">
|
|
4
|
+
<slot name="secondary" />
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div class="col-12 col-sm-auto">
|
|
8
|
+
<slot name="primary" />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import { screenMixin } from '../../mixins'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'QasActions',
|
|
18
|
+
|
|
19
|
+
mixins: [screenMixin],
|
|
20
|
+
|
|
21
|
+
props: {
|
|
22
|
+
align: {
|
|
23
|
+
default: 'end',
|
|
24
|
+
type: String,
|
|
25
|
+
validator: value => ['start', 'around', 'between', 'center', 'end'].includes(value)
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
gutter: {
|
|
29
|
+
default: 'md',
|
|
30
|
+
type: String,
|
|
31
|
+
validator: value => ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
computed: {
|
|
36
|
+
classes () {
|
|
37
|
+
return [
|
|
38
|
+
`justify-${this.align}`,
|
|
39
|
+
`q-col-gutter-${this.gutter}`,
|
|
40
|
+
this.mx_isSmall ? 'column reverse' : 'row'
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<qas-btn class="qas-actions-menu" color="primary"
|
|
2
|
+
<qas-btn class="qas-actions-menu" color="primary" hide-label-on-small-screen :icon="icon" :label="label" outline>
|
|
3
3
|
<q-menu class="qas-actions-menu__menu">
|
|
4
4
|
<q-list class="qas-actions-menu__list" separator>
|
|
5
5
|
<slot v-for="(item, key) in list" :item="item" :name="key">
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script>
|
|
21
|
-
import QasBtn from '../btn/QasBtn'
|
|
21
|
+
import QasBtn from '../btn/QasBtn.vue'
|
|
22
22
|
|
|
23
23
|
export default {
|
|
24
24
|
name: 'QasActionsMenu',
|
|
@@ -28,23 +28,19 @@ export default {
|
|
|
28
28
|
},
|
|
29
29
|
|
|
30
30
|
props: {
|
|
31
|
+
icon: {
|
|
32
|
+
default: 'o_settings',
|
|
33
|
+
type: String
|
|
34
|
+
},
|
|
35
|
+
|
|
31
36
|
label: {
|
|
32
|
-
default: '
|
|
37
|
+
default: 'Configurações',
|
|
33
38
|
type: String
|
|
34
39
|
},
|
|
35
40
|
|
|
36
41
|
list: {
|
|
37
42
|
default: () => ({}),
|
|
38
43
|
type: Object
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
hideLabel: {
|
|
42
|
-
type: Boolean
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
icon: {
|
|
46
|
-
default: 'o_settings',
|
|
47
|
-
type: String
|
|
48
44
|
}
|
|
49
45
|
},
|
|
50
46
|
|
|
@@ -55,12 +51,6 @@ export default {
|
|
|
55
51
|
item.handler(filtered)
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
computed: {
|
|
61
|
-
labelValue () {
|
|
62
|
-
return this.hideLabel ? '' : this.label
|
|
63
|
-
}
|
|
64
54
|
}
|
|
65
55
|
}
|
|
66
56
|
</script>
|
|
@@ -70,7 +60,6 @@ export default {
|
|
|
70
60
|
&__list {
|
|
71
61
|
width: 265px;
|
|
72
62
|
z-index: 1;
|
|
73
|
-
|
|
74
63
|
}
|
|
75
64
|
}
|
|
76
65
|
</style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="model" class="q-pa-lg qas-alert relative-position rounded-borders" :class="classes">
|
|
3
|
+
<qas-btn class="absolute-top-right q-mr-md q-mt-sm" :color="color" dense flat icon="o_close" rounded @click="close" />
|
|
4
|
+
|
|
5
|
+
<div class="q-gutter-md q-mr-lg">
|
|
6
|
+
<slot name="header">
|
|
7
|
+
<h5 v-if="title" class="text-bold text-h5">{{ title }}</h5>
|
|
8
|
+
</slot>
|
|
9
|
+
|
|
10
|
+
<slot>
|
|
11
|
+
<qas-breakline tag="p" :text="text" />
|
|
12
|
+
</slot>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import QasBreakline from '../breakline/QasBreakline.vue'
|
|
19
|
+
import QasBtn from '../btn/QasBtn.vue'
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'QasAlert',
|
|
23
|
+
|
|
24
|
+
components: {
|
|
25
|
+
QasBreakline,
|
|
26
|
+
QasBtn
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
props: {
|
|
30
|
+
color: {
|
|
31
|
+
default: 'primary',
|
|
32
|
+
type: String
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
modelValue: {
|
|
36
|
+
default: true,
|
|
37
|
+
type: Boolean
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
text: {
|
|
41
|
+
default: '',
|
|
42
|
+
type: String
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
title: {
|
|
46
|
+
default: '',
|
|
47
|
+
type: String
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
emits: ['update:modelValue'],
|
|
52
|
+
|
|
53
|
+
data () {
|
|
54
|
+
return {
|
|
55
|
+
model: true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
computed: {
|
|
60
|
+
classes () {
|
|
61
|
+
return {
|
|
62
|
+
[`text-${this.color}`]: true,
|
|
63
|
+
[`bg-${this.color}-contrast`]: ['primary', 'secondary'].includes(this.color)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
watch: {
|
|
69
|
+
modelValue: {
|
|
70
|
+
handler (value) {
|
|
71
|
+
this.model = value
|
|
72
|
+
},
|
|
73
|
+
immediate: true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
methods: {
|
|
78
|
+
close () {
|
|
79
|
+
this.$emit('update:modelValue', false)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style lang="scss">
|
|
86
|
+
.qas-alert {
|
|
87
|
+
border-style: solid;
|
|
88
|
+
border-width: 0 10px;
|
|
89
|
+
}
|
|
90
|
+
</style>
|
|
@@ -1,82 +1,76 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-
|
|
3
|
-
<q-
|
|
2
|
+
<q-header class="bg-white qas-app-bar shadow-primary" height-hint="70">
|
|
3
|
+
<q-toolbar class="qas-app-bar__toolbar" color="bg-white">
|
|
4
|
+
<q-ajax-bar color="white" position="top" size="2px" />
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
<q-btn color="grey-7" dense flat icon="o_menu" round @click="toggleMenuDrawer" />
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
<q-toolbar-title class="flex">
|
|
9
|
+
<div class="cursor-pointer" @click="goToRoot">
|
|
10
|
+
<img v-if="brand" :alt="title" class="q-mr-sm qas-app-bar__brand" :src="brand">
|
|
11
|
+
<span v-if="showTitle" class="text-bold text-grey-9 text-subtitle1 text-uppercase">{{ title }}</span>
|
|
12
|
+
<q-badge v-if="hasDevelopmentBadge" align="middle" class="q-ml-sm" color="negative" :label="developmentBadgeLabel" />
|
|
13
|
+
</div>
|
|
14
|
+
</q-toolbar-title>
|
|
15
|
+
|
|
16
|
+
<div v-if="hasNotifications" class="q-mr-md">
|
|
17
|
+
<q-btn class="q-mr-md" dense icon="o_notifications" round unelevated>
|
|
18
|
+
<q-badge v-if="notifications" color="red" floating>{{ notifications.count }}</q-badge>
|
|
19
|
+
</q-btn>
|
|
12
20
|
</div>
|
|
13
|
-
</q-toolbar-title>
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<q-btn class="q-mr-md" dense icon="o_notifications" round unelevated>
|
|
18
|
-
<q-badge v-if="notifications" color="red" floating>{{ notifications.count }}</q-badge>
|
|
19
|
-
</q-btn>
|
|
20
|
-
</div>
|
|
22
|
+
<div class="items-center no-wrap q-gutter-md row">
|
|
23
|
+
<slot name="tools" />
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
<div v-if="isAuth" class="cursor-pointer items-center q-mr-sm qas-app-bar__user rounded-borders row text-grey-9" :title="user.name || user.givenName">
|
|
26
|
+
<qas-avatar class="rounded-borders-left" color="white" dark :image="user.photo" rounded size="42px" text-color="primary" :title="user.name || user.givenName" />
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
<div class="q-px-sm qas-app-bar__user-data qs-lh-lg text-caption">
|
|
29
|
+
<div class="ellipsis">{{ user.name || user.givenName }}</div>
|
|
30
|
+
<div class="ellipsis text-bold">{{ user.email }}</div>
|
|
31
|
+
</div>
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
<q-menu anchor="bottom end" class="shadow-primary" max-height="400px" :offset="[0, 5]" self="top end">
|
|
34
|
+
<div class="qas-app-bar__user-menu">
|
|
35
|
+
<div class="q-pa-lg text-center">
|
|
36
|
+
<button class="unset" @click="goToProfile">
|
|
37
|
+
<qas-avatar :image="user.photo" size="145px" :title="user.name || user.givenName" />
|
|
38
|
+
</button>
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class="ellipsis text-bold">{{ user.email }}</div>
|
|
33
|
-
</div>
|
|
40
|
+
<div class="ellipsis q-mt-lg qs-lh-sm text-bold text-subtitle1">{{ user.name || user.givenName }}</div>
|
|
41
|
+
<div class="ellipsis q-mt-xs text-caption">{{ user.email }}</div>
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<button class="unset" @click="goToProfile">
|
|
39
|
-
<qas-avatar :image="user.photo" size="145px" :title="user.name || user.givenName" />
|
|
40
|
-
</button>
|
|
43
|
+
<div class="q-mt-sm">
|
|
44
|
+
<qas-btn flat icon="o_edit" label="Editar" :to="user.to" />
|
|
45
|
+
</div>
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
<div class="q-mt-sm">
|
|
48
|
+
<qas-btn v-close-popup class="q-px-lg q-py-xs" dense icon="o_exit_to_app" label="Sair" outline @click="signOut" />
|
|
49
|
+
</div>
|
|
44
50
|
|
|
45
|
-
|
|
46
|
-
<qas-btn flat icon="o_edit" label="Editar" :to="user.to" />
|
|
51
|
+
<slot name="user" :user="user" />
|
|
47
52
|
</div>
|
|
48
|
-
|
|
49
|
-
<div class="q-mt-sm">
|
|
50
|
-
<qas-btn v-close-popup class="q-px-lg q-py-xs" dense icon="o_exit_to_app" label="Sair" outline @click="signOut" />
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<slot name="user" :user="user" />
|
|
54
53
|
</div>
|
|
55
|
-
</
|
|
56
|
-
</
|
|
54
|
+
</q-menu>
|
|
55
|
+
</div>
|
|
57
56
|
</div>
|
|
58
|
-
</
|
|
59
|
-
</q-
|
|
57
|
+
</q-toolbar>
|
|
58
|
+
</q-header>
|
|
60
59
|
</template>
|
|
61
60
|
|
|
62
61
|
<script>
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import QasBtn from '../btn/QasBtn'
|
|
62
|
+
import QasAvatar from '../avatar/QasAvatar.vue'
|
|
63
|
+
import QasBtn from '../btn/QasBtn.vue'
|
|
66
64
|
|
|
67
65
|
export default {
|
|
66
|
+
name: 'QasAppBar',
|
|
67
|
+
|
|
68
68
|
components: {
|
|
69
|
-
QasAppsMenu,
|
|
70
69
|
QasAvatar,
|
|
71
70
|
QasBtn
|
|
72
71
|
},
|
|
73
72
|
|
|
74
73
|
props: {
|
|
75
|
-
apps: {
|
|
76
|
-
default: () => [],
|
|
77
|
-
type: Array
|
|
78
|
-
},
|
|
79
|
-
|
|
80
74
|
brand: {
|
|
81
75
|
default: '',
|
|
82
76
|
type: String
|
|
@@ -103,6 +97,8 @@ export default {
|
|
|
103
97
|
}
|
|
104
98
|
},
|
|
105
99
|
|
|
100
|
+
emits: ['sign-out', 'toggle-menu'],
|
|
101
|
+
|
|
106
102
|
data () {
|
|
107
103
|
return {
|
|
108
104
|
menuDrawer: true
|
|
@@ -128,16 +124,16 @@ export default {
|
|
|
128
124
|
return current ? hosts[current] : ''
|
|
129
125
|
},
|
|
130
126
|
|
|
131
|
-
hasApps () {
|
|
132
|
-
return !!this.apps.length
|
|
133
|
-
},
|
|
134
|
-
|
|
135
127
|
hasDevelopmentBadge () {
|
|
136
128
|
return !!this.developmentBadgeLabel
|
|
137
129
|
},
|
|
138
130
|
|
|
139
131
|
hasNotifications () {
|
|
140
132
|
return !!Object.keys(this.notifications).length
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
showTitle () {
|
|
136
|
+
return this.title && !this.brand
|
|
141
137
|
}
|
|
142
138
|
},
|
|
143
139
|
|
|
@@ -162,18 +158,20 @@ export default {
|
|
|
162
158
|
</script>
|
|
163
159
|
|
|
164
160
|
<style lang="scss">
|
|
165
|
-
.qas-
|
|
166
|
-
|
|
161
|
+
.qas-app-bar {
|
|
162
|
+
&__toolbar {
|
|
163
|
+
height: 70px;
|
|
164
|
+
}
|
|
167
165
|
|
|
168
166
|
&__brand {
|
|
169
167
|
height: 24px;
|
|
170
|
-
margin-right:
|
|
168
|
+
margin-right: 8px;
|
|
171
169
|
position: relative;
|
|
172
170
|
top: 4px;
|
|
173
171
|
}
|
|
174
172
|
|
|
175
173
|
&__user {
|
|
176
|
-
background-color:
|
|
174
|
+
background-color: var(--qas-background-color);
|
|
177
175
|
transition: background-color $generic-hover-transition;
|
|
178
176
|
|
|
179
177
|
&:focus,
|
|
@@ -1,35 +1,55 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-drawer v-model="model"
|
|
3
|
-
<
|
|
4
|
-
<div
|
|
5
|
-
<
|
|
6
|
-
<q-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
<q-drawer v-model="model" class="qas-app-menu" :mini="miniMode" :width="230" @before-hide="beforeHide" @mini-state="setMiniState">
|
|
3
|
+
<div class="column flex full-height justify-between no-wrap overflow-x-hidden">
|
|
4
|
+
<div>
|
|
5
|
+
<div v-if="displayModuleSection" class="q-ma-md">
|
|
6
|
+
<div class="q-mb-sm text-caption text-grey-7 text-weight-medium">
|
|
7
|
+
Você está no modulo:
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<qas-select v-model="module" :options="defaultModules" @update:model-value="redirectHandler(currentModelOption)" />
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<q-list class="text-grey-9 text-weight-medium">
|
|
14
|
+
<template v-for="(header, index) in items">
|
|
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
|
+
<q-item v-for="(item, itemIndex) in header.children" :key="itemIndex" v-ripple :active-class="activeItemClasses" clickable :to="item.to">
|
|
17
|
+
<q-item-section v-if="item.icon" avatar>
|
|
18
|
+
<q-icon :name="item.icon" />
|
|
19
|
+
</q-item-section>
|
|
20
|
+
<q-item-section>
|
|
21
|
+
<q-item-label>{{ item.label }}</q-item-label>
|
|
22
|
+
</q-item-section>
|
|
23
|
+
</q-item>
|
|
24
|
+
</q-expansion-item>
|
|
25
|
+
|
|
26
|
+
<q-item v-else :key="index" v-ripple :active-class="activeItemClasses" clickable :to="header.to">
|
|
27
|
+
<q-item-section v-if="header.icon" avatar>
|
|
28
|
+
<q-icon :name="header.icon" />
|
|
29
|
+
</q-item-section>
|
|
30
|
+
<q-item-section>
|
|
31
|
+
<q-item-label>{{ header.label }}</q-item-label>
|
|
32
|
+
</q-item-section>
|
|
33
|
+
</q-item>
|
|
34
|
+
</template>
|
|
35
|
+
</q-list>
|
|
24
36
|
</div>
|
|
25
|
-
|
|
37
|
+
|
|
38
|
+
<div class="q-mx-md">
|
|
39
|
+
<!-- TODO: O Modular não é o Asteroid, então não podemos manter esse logo aqui. -->
|
|
40
|
+
<img v-if="!isMini" alt="Modular" class="block q-mb-md q-mx-auto" src="../../assets/logo-modular.svg">
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
26
43
|
</q-drawer>
|
|
27
44
|
</template>
|
|
28
45
|
|
|
29
46
|
<script>
|
|
30
47
|
import { screenMixin } from '../../mixins'
|
|
48
|
+
import { isLocalDevelopment } from '../../helpers'
|
|
31
49
|
|
|
32
50
|
export default {
|
|
51
|
+
name: 'QasAppMenu',
|
|
52
|
+
|
|
33
53
|
mixins: [screenMixin],
|
|
34
54
|
|
|
35
55
|
props: {
|
|
@@ -43,35 +63,88 @@ export default {
|
|
|
43
63
|
type: Array
|
|
44
64
|
},
|
|
45
65
|
|
|
46
|
-
|
|
66
|
+
modelValue: {
|
|
47
67
|
default: true,
|
|
48
68
|
type: Boolean
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
title: {
|
|
72
|
+
default: '',
|
|
73
|
+
type: String
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
modules: {
|
|
77
|
+
default: () => [],
|
|
78
|
+
type: Array
|
|
49
79
|
}
|
|
50
80
|
},
|
|
51
81
|
|
|
82
|
+
emits: ['update:modelValue'],
|
|
83
|
+
|
|
52
84
|
data () {
|
|
53
85
|
return {
|
|
54
|
-
miniMode: false
|
|
86
|
+
miniMode: false,
|
|
87
|
+
module: '',
|
|
88
|
+
isMini: false
|
|
55
89
|
}
|
|
56
90
|
},
|
|
57
91
|
|
|
58
92
|
computed: {
|
|
59
93
|
activeItemClasses () {
|
|
60
|
-
return 'bg-primary text-primary-
|
|
94
|
+
return 'bg-primary-contrast text-primary text-weight-bold'
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
activeItemClassesSecondary () {
|
|
98
|
+
return 'text-primary bg-secondary-contrast'
|
|
61
99
|
},
|
|
62
100
|
|
|
63
|
-
|
|
64
|
-
|
|
101
|
+
defaultModules () {
|
|
102
|
+
if (!isLocalDevelopment()) return this.modules
|
|
103
|
+
|
|
104
|
+
const defaultModules = [...this.modules]
|
|
105
|
+
const { host, protocol } = window.location
|
|
106
|
+
const value = `${protocol}//${host}`
|
|
107
|
+
|
|
108
|
+
// if app is in development mode (local) it's added a default module
|
|
109
|
+
defaultModules.unshift({
|
|
110
|
+
label: `Localhost ${this.title ? `(${this.title})` : ''}`,
|
|
111
|
+
value
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
return defaultModules
|
|
65
115
|
},
|
|
66
116
|
|
|
67
117
|
model: {
|
|
68
118
|
get () {
|
|
69
|
-
return this.
|
|
119
|
+
return this.modelValue
|
|
70
120
|
},
|
|
71
121
|
|
|
72
122
|
set (value) {
|
|
73
|
-
return this.$emit('
|
|
123
|
+
return this.$emit('update:modelValue', value)
|
|
74
124
|
}
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
currentModelOption () {
|
|
128
|
+
return this.defaultModules.find(module => module?.value === this.module)
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
displayModuleSection () {
|
|
132
|
+
return !this.isMini && this.defaultModules.length
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
currentModule () {
|
|
136
|
+
const hostname = window.location.hostname
|
|
137
|
+
|
|
138
|
+
return this.defaultModules.find(module => module?.value.includes(hostname))?.value
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
watch: {
|
|
143
|
+
currentModule: {
|
|
144
|
+
handler (value) {
|
|
145
|
+
this.module = value
|
|
146
|
+
},
|
|
147
|
+
immediate: true
|
|
75
148
|
}
|
|
76
149
|
},
|
|
77
150
|
|
|
@@ -81,29 +154,43 @@ export default {
|
|
|
81
154
|
},
|
|
82
155
|
|
|
83
156
|
shouldExpand ({ children, to }) {
|
|
84
|
-
return children?.length && this.$route.matched.some(item => item
|
|
157
|
+
return children?.length && this.$route.matched.some(item => item?.path === to?.path)
|
|
85
158
|
},
|
|
86
159
|
|
|
87
160
|
beforeHide () {
|
|
88
|
-
if (this
|
|
161
|
+
if (this.mx_isLarge) {
|
|
89
162
|
this.model = true
|
|
90
163
|
this.miniMode = !this.miniMode
|
|
91
164
|
}
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
setMiniState (value) {
|
|
168
|
+
this.isMini = value
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
redirectHandler ({ value }) {
|
|
172
|
+
if (!value.includes(window.location.host)) {
|
|
173
|
+
window.location.href = value
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
toggleItem (index) {
|
|
178
|
+
const component = this.getComponent(index)
|
|
179
|
+
|
|
180
|
+
component?.to && this.isMini && component.toggle()
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
getComponent (index) {
|
|
184
|
+
return this.$refs[`item-${index}`]?.[0]
|
|
92
185
|
}
|
|
93
186
|
}
|
|
94
187
|
}
|
|
95
188
|
</script>
|
|
96
189
|
|
|
97
190
|
<style lang="scss">
|
|
98
|
-
.
|
|
99
|
-
.
|
|
100
|
-
color:
|
|
101
|
-
opacity: 1;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.q-expansion-item__toggle-icon {
|
|
105
|
-
color: $primary;
|
|
106
|
-
opacity: 0.2;
|
|
191
|
+
.qas-app-menu {
|
|
192
|
+
.q-expansion-item--expanded .q-item:not(&--active.q-item) {
|
|
193
|
+
background-color: $grey-1;
|
|
107
194
|
}
|
|
108
195
|
}
|
|
109
196
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-avatar class="text-bold" :class="
|
|
2
|
+
<q-avatar class="text-bold" :class="avatarClass" rounded>
|
|
3
3
|
<q-img v-if="hasImage" :alt="title" :ratio="1" spinner-color="primary" spinner-size="16px" :src="image" @error="onImageLoadedError" />
|
|
4
4
|
<template v-else-if="hasTitle">{{ firstLetter }}</template>
|
|
5
5
|
<q-icon v-else :name="icon" />
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
10
|
export default {
|
|
11
|
+
name: 'QasAvatar',
|
|
12
|
+
|
|
11
13
|
props: {
|
|
12
14
|
color: {
|
|
13
15
|
default: 'primary',
|
|
@@ -46,8 +48,10 @@ export default {
|
|
|
46
48
|
},
|
|
47
49
|
|
|
48
50
|
computed: {
|
|
49
|
-
|
|
50
|
-
if (this.hasImage)
|
|
51
|
+
avatarClass () {
|
|
52
|
+
if (this.hasImage) {
|
|
53
|
+
return null
|
|
54
|
+
}
|
|
51
55
|
|
|
52
56
|
const contrastColor = this.textColor ? this.textColor : this.contrastColor
|
|
53
57
|
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div class="bg-white q-px-md q-py-lg rounded-borders" :class="boxClass">
|
|
3
3
|
<slot />
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
8
|
export default {
|
|
9
|
+
name: 'QasBox',
|
|
10
|
+
|
|
9
11
|
props: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
outlined: {
|
|
13
|
+
type: Boolean
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
unelevated: {
|
|
12
17
|
type: Boolean
|
|
13
18
|
}
|
|
14
19
|
},
|
|
15
20
|
|
|
16
21
|
computed: {
|
|
17
22
|
boxClass () {
|
|
18
|
-
return
|
|
23
|
+
return {
|
|
24
|
+
'border-primary-contrast': this.outlined,
|
|
25
|
+
'shadow-primary': !this.unelevated
|
|
26
|
+
}
|
|
19
27
|
}
|
|
20
28
|
}
|
|
21
29
|
}
|