@bildvitta/quasar-ui-asteroid 3.17.0-beta.21 → 3.17.0-beta.22
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/asteroid.js +4 -4
- package/src/components/actions/QasActions.vue +81 -81
- package/src/components/actions/QasActions.yml +34 -34
- package/src/components/actions-menu/QasActionsMenu.vue +251 -251
- package/src/components/actions-menu/QasActionsMenu.yml +89 -89
- package/src/components/actions-menu/composables/use-delete.js +30 -30
- package/src/components/actions-menu/composables/use-double-split-actions.js +42 -42
- package/src/components/actions-menu/composables/use-options-actions.js +27 -27
- package/src/components/actions-menu/composables/use-single-action.js +17 -17
- package/src/components/actions-menu/composables/use-single-split-actions.js +35 -35
- package/src/components/actions-menu/composables/use-tooltips.js +43 -43
- package/src/components/actions-menu/utils/get-label.js +3 -3
- package/src/components/actions-menu/utils/set-click-handler.js +6 -6
- package/src/components/alert/QasAlert.test.js +43 -43
- package/src/components/alert/QasAlert.vue +110 -110
- package/src/components/alert/QasAlert.yml +39 -39
- package/src/components/app-bar/QasAppBar.vue +119 -119
- package/src/components/app-bar/QasAppBar.yml +44 -44
- package/src/components/app-menu/QasAppMenu.vue +392 -392
- package/src/components/app-menu/QasAppMenu.yml +73 -73
- package/src/components/app-menu/composables/use-app-menu-dropdown.js +71 -71
- package/src/components/app-menu/composables/use-app-user.js +49 -49
- package/src/components/app-menu/composables/use-development-badge.js +23 -23
- package/src/components/app-menu/private/PvAppMenuDropdown.vue +71 -71
- package/src/components/app-menu/private/PvAppMenuHelpChat.vue +222 -222
- package/src/components/app-user/QasAppUser.vue +281 -281
- package/src/components/app-user/QasAppUser.yml +56 -56
- package/src/components/avatar/QasAvatar.vue +95 -95
- package/src/components/avatar/QasAvatar.yml +38 -38
- package/src/components/avatar/enums/AvatarColors.js +10 -10
- package/src/components/badge/QasBadge.vue +87 -87
- package/src/components/badge/QasBadge.yml +55 -55
- package/src/components/board-generator/QasBoardGenerator.vue +712 -712
- package/src/components/board-generator/QasBoardGenerator.yml +167 -167
- package/src/components/box/QasBox.vue +51 -51
- package/src/components/box/QasBox.yml +29 -29
- package/src/components/breakline/QasBreakline.vue +38 -38
- package/src/components/breakline/QasBreakline.yml +25 -25
- package/src/components/btn/QasBtn.vue +148 -148
- package/src/components/btn/QasBtn.yml +48 -48
- package/src/components/btn-dropdown/QasBtnDropdown.vue +146 -146
- package/src/components/btn-dropdown/QasBtnDropdown.yml +59 -59
- package/src/components/card/QasCard.vue +132 -132
- package/src/components/card/QasCard.yml +44 -44
- package/src/components/card-image/QasCardImage.vue +95 -95
- package/src/components/card-image/QasCardImage.yml +48 -48
- package/src/components/chart-view/QasChartView.vue +441 -441
- package/src/components/chart-view/QasChartView.yml +109 -109
- package/src/components/chart-view/config/charts/bar.js +45 -45
- package/src/components/chart-view/config/charts/doughnut.js +43 -43
- package/src/components/chart-view/config/charts/index.js +9 -9
- package/src/components/chart-view/config/charts/line.js +57 -57
- package/src/components/chart-view/config/defaults/colors.js +19 -19
- package/src/components/chart-view/config/defaults/font.js +5 -5
- package/src/components/chart-view/config/defaults/index.js +2 -2
- package/src/components/chart-view/config/index.js +3 -3
- package/src/components/chart-view/config/plugins/index.js +3 -3
- package/src/components/chart-view/config/plugins/legend.js +9 -9
- package/src/components/chart-view/config/plugins/tooltip.js +15 -15
- package/src/components/chart-view/config/plugins/zoom.js +31 -31
- package/src/components/checkbox/QasCheckbox.vue +150 -150
- package/src/components/checkbox/QasCheckbox.yml +36 -36
- package/src/components/copy/QasCopy.vue +46 -46
- package/src/components/copy/QasCopy.yml +23 -23
- package/src/components/date/QasDate.vue +600 -600
- package/src/components/date/QasDate.yml +69 -69
- package/src/components/date/enums/DateMaskOptions.js +6 -6
- package/src/components/date-time-input/QasDateTimeInput.vue +269 -269
- package/src/components/date-time-input/QasDateTimeInput.yml +64 -64
- package/src/components/debugger/QasDebugger.vue +31 -31
- package/src/components/debugger/QasDebugger.yml +10 -10
- package/src/components/delete/QasDelete.vue +100 -100
- package/src/components/delete/QasDelete.yml +60 -60
- package/src/components/dialog/QasDialog.vue +217 -217
- package/src/components/dialog/QasDialog.yml +117 -117
- package/src/components/dialog/composables/use-cancel.js +40 -40
- package/src/components/dialog/composables/use-dynamic-components.js +86 -86
- package/src/components/dialog/composables/use-ok.js +45 -45
- package/src/components/dialog-router/QasDialogRouter.vue +86 -86
- package/src/components/dialog-router/QasDialogRouter.yml +23 -23
- package/src/components/drawer/QasDrawer.vue +118 -118
- package/src/components/drawer/QasDrawer.yml +58 -58
- package/src/components/empty-result-text/QasEmptyResultText.vue +18 -18
- package/src/components/empty-result-text/QasEmptyResultText.yml +14 -14
- package/src/components/expansion-item/QasExpansionItem.vue +291 -291
- package/src/components/expansion-item/QasExpansionItem.yml +76 -76
- package/src/components/field/QasField.vue +220 -220
- package/src/components/field/QasField.yml +36 -36
- package/src/components/filters/QasFilters.vue +472 -472
- package/src/components/filters/QasFilters.yml +171 -171
- package/src/components/filters/private/PvFiltersButton.vue +101 -101
- package/src/components/form-generator/QasFormGenerator.vue +274 -274
- package/src/components/form-generator/QasFormGenerator.yml +109 -109
- package/src/components/form-view/QasFormView.vue +484 -484
- package/src/components/form-view/QasFormView.yml +253 -253
- package/src/components/gallery/QasGallery.vue +243 -243
- package/src/components/gallery/QasGallery.yml +188 -188
- package/src/components/gallery/composables/use-delete.js +54 -54
- package/src/components/gallery/private/PvGalleryCarouselDialog.vue +92 -92
- package/src/components/gallery/private/PvGalleryDeleteDialog.vue +54 -54
- package/src/components/gallery-card/QasGalleryCard.vue +153 -153
- package/src/components/gallery-card/QasGalleryCard.yml +61 -61
- package/src/components/grabbable/QasGrabbable.vue +185 -185
- package/src/components/grabbable/QasGrabbable.yml +26 -26
- package/src/components/grid-generator/QasGridGenerator.vue +210 -210
- package/src/components/grid-generator/QasGridGenerator.yml +127 -127
- package/src/components/grid-item/QasGridItem.vue +89 -89
- package/src/components/grid-item/QasGridItem.yml +22 -22
- package/src/components/header/QasHeader.vue +152 -152
- package/src/components/header/QasHeader.yml +50 -50
- package/src/components/infinite-scroll/QasInfiniteScroll.vue +168 -168
- package/src/components/infinite-scroll/QasInfiniteScroll.yml +78 -78
- package/src/components/info/QasInfo.vue +155 -155
- package/src/components/info/QasInfo.yml +34 -34
- package/src/components/input/QasInput.vue +252 -252
- package/src/components/input/QasInput.yml +65 -65
- package/src/components/label/QasLabel.vue +61 -61
- package/src/components/label/QasLabel.yml +44 -44
- package/src/components/layout/QasLayout.vue +101 -101
- package/src/components/layout/QasLayout.yml +46 -46
- package/src/components/layout/private/PvLayoutNotificationCard.vue +86 -86
- package/src/components/layout/private/PvLayoutNotificationsDrawer.vue +140 -140
- package/src/components/list-items/QasListItems.vue +125 -125
- package/src/components/list-items/QasListItems.yml +71 -71
- package/src/components/list-view/QasListView.vue +302 -302
- package/src/components/list-view/QasListView.yml +169 -169
- package/src/components/map/QasMap.vue +75 -75
- package/src/components/map/QasMap.yml +33 -33
- package/src/components/nested-fields/QasNestedFields.vue +584 -584
- package/src/components/nested-fields/QasNestedFields.yml +296 -296
- package/src/components/numeric-input/QasNumericInput.vue +206 -206
- package/src/components/numeric-input/QasNumericInput.yml +85 -85
- package/src/components/option-group/QasOptionGroup.vue +54 -54
- package/src/components/option-group/QasOptionGroup.yml +30 -30
- package/src/components/page-header/QasPageHeader.vue +143 -143
- package/src/components/page-header/QasPageHeader.yml +42 -42
- package/src/components/pagination/QasPagination.vue +71 -71
- package/src/components/pagination/QasPagination.yml +4 -4
- package/src/components/password-input/QasPasswordInput.vue +110 -110
- package/src/components/password-input/QasPasswordInput.yml +111 -111
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.vue +71 -71
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.yml +103 -103
- package/src/components/profile/QasProfile.vue +98 -98
- package/src/components/profile/QasProfile.yml +60 -60
- package/src/components/radio/QasRadio.vue +62 -62
- package/src/components/radio/QasRadio.yml +11 -11
- package/src/components/resizer/QasResizer.vue +90 -90
- package/src/components/resizer/QasResizer.yml +24 -24
- package/src/components/search-box/QasSearchBox.vue +294 -294
- package/src/components/search-box/QasSearchBox.yml +154 -154
- package/src/components/search-input/QasSearchInput.vue +106 -106
- package/src/components/search-input/QasSearchInput.yml +48 -48
- package/src/components/select/QasSelect.vue +514 -514
- package/src/components/select/QasSelect.yml +157 -157
- package/src/components/select-list/QasSelectList.vue +238 -238
- package/src/components/select-list/QasSelectList.yml +108 -108
- package/src/components/select-list/private/PvSelectListCheckbox.vue +31 -31
- package/src/components/select-list-dialog/QasSelectListDialog.vue +395 -395
- package/src/components/select-list-dialog/QasSelectListDialog.yml +108 -108
- package/src/components/signature-pad/QasSignaturePad.vue +122 -122
- package/src/components/signature-pad/QasSignaturePad.yml +53 -53
- package/src/components/signature-uploader/QasSignatureUploader.vue +164 -164
- package/src/components/signature-uploader/QasSignatureUploader.yml +37 -37
- package/src/components/single-view/QasSingleView.vue +175 -175
- package/src/components/single-view/QasSingleView.yml +131 -131
- package/src/components/sortable/QasSortable.vue +151 -151
- package/src/components/sortable/QasSortable.yml +65 -65
- package/src/components/status/QasStatus.test.js +11 -11
- package/src/components/status/QasStatus.vue +29 -29
- package/src/components/status/QasStatus.yml +10 -10
- package/src/components/stepper/QasStepper.vue +199 -152
- package/src/components/stepper/QasStepper.yml +35 -35
- package/src/components/stepper-form-view/QasStepperFormView.vue +86 -84
- package/src/components/stepper-form-view/QasStepperFormView.yml +58 -58
- package/src/components/table-generator/QasTableGenerator.vue +416 -416
- package/src/components/table-generator/QasTableGenerator.yml +94 -94
- package/src/components/tabs-generator/QasTabsGenerator.vue +196 -196
- package/src/components/tabs-generator/QasTabsGenerator.yml +53 -53
- package/src/components/text-truncate/QasTextTruncate.vue +274 -274
- package/src/components/text-truncate/QasTextTruncate.yml +60 -60
- package/src/components/timeline/QasTimeline.vue +140 -140
- package/src/components/timeline/QasTimeline.yml +36 -36
- package/src/components/toggle/QasToggle.vue +14 -14
- package/src/components/toggle/QasToggle.yml +5 -5
- package/src/components/toggle-visibility/QasToggleVisibility.vue +79 -79
- package/src/components/toggle-visibility/QasToggleVisibility.yml +30 -30
- package/src/components/transfer/QasTransfer.vue +239 -239
- package/src/components/transfer/QasTransfer.yml +60 -60
- package/src/components/tree-generator/QasTreeForm.vue +62 -62
- package/src/components/tree-generator/QasTreeGenerator.vue +488 -488
- package/src/components/tree-generator/QasTreeGenerator.yml +81 -81
- package/src/components/uploader/QasUploader.vue +691 -645
- package/src/components/uploader/QasUploader.yml +206 -192
- package/src/components/uploader/private/PvUploaderGalleryCard.vue +357 -357
- package/src/components/welcome/QasWelcome.vue +125 -125
- package/src/components/welcome/QasWelcome.yml +23 -23
- package/src/components/welcome/private/PvWelcomeShortcutCard.vue +58 -58
- package/src/components/whatsapp-link/QasWhatsappLink.vue +34 -34
- package/src/components/whatsapp-link/QasWhatsappLink.yml +18 -18
- package/src/composables/index.js +8 -8
- package/src/composables/private/index.js +3 -3
- package/src/composables/private/use-generator.js +174 -174
- package/src/composables/private/use-toggle-visibility.js +48 -48
- package/src/composables/private/use-view.js +186 -186
- package/src/composables/use-context.js +15 -15
- package/src/composables/use-form.js +32 -32
- package/src/composables/use-history.js +46 -46
- package/src/composables/use-notifications.js +128 -128
- package/src/composables/use-query-cache.js +60 -60
- package/src/composables/use-screen.js +42 -42
- package/src/css/base/font-face.scss +28 -28
- package/src/css/base/index.scss +1 -1
- package/src/css/components/base.scss +12 -12
- package/src/css/components/button.scss +116 -116
- package/src/css/components/checkbox.scss +14 -14
- package/src/css/components/editor.scss +7 -7
- package/src/css/components/field.scss +88 -88
- package/src/css/components/index.scss +10 -10
- package/src/css/components/item.scss +52 -52
- package/src/css/components/radio.scss +18 -18
- package/src/css/components/scrollbar.scss +20 -20
- package/src/css/components/tabs.scss +3 -3
- package/src/css/components/toggle.scss +13 -13
- package/src/css/mixins/index.scss +3 -3
- package/src/css/mixins/set-brand.scss +15 -15
- package/src/css/mixins/set-button.scss +26 -26
- package/src/css/mixins/set-typography.scss +8 -8
- package/src/css/plugins/index.scss +2 -2
- package/src/css/plugins/loading.scss +5 -5
- package/src/css/plugins/notify.scss +100 -100
- package/src/css/utils/background.scss +34 -34
- package/src/css/utils/border-radius.scss +29 -29
- package/src/css/utils/border.scss +42 -42
- package/src/css/utils/container.scss +36 -36
- package/src/css/utils/fonts.scss +5 -5
- package/src/css/utils/index.scss +10 -10
- package/src/css/utils/line-height.scss +19 -19
- package/src/css/utils/opacity.scss +5 -5
- package/src/css/utils/scroll.scss +21 -21
- package/src/css/utils/text.scss +15 -15
- package/src/css/utils/unset.scss +8 -8
- package/src/css/variables/button.scss +4 -4
- package/src/css/variables/index.scss +6 -6
- package/src/css/variables/scrollbar.scss +11 -11
- package/src/css/variables/separator.scss +2 -2
- package/src/css/variables/shadow.scss +3 -3
- package/src/css/variables/spacing.scss +98 -98
- package/src/css/variables/typography.scss +149 -149
- package/src/directives/Test.js +13 -13
- package/src/enums/Align.js +7 -7
- package/src/enums/Spacing.js +98 -98
- package/src/enums/Status.js +33 -33
- package/src/helpers/add-counter-suffix.js +3 -3
- package/src/helpers/base-64-to-blob.js +21 -21
- package/src/helpers/camelize-fields-name.js +15 -15
- package/src/helpers/construct-object.js +29 -29
- package/src/helpers/copy-to-clipboard.js +15 -15
- package/src/helpers/destroy-nested-children-by-key.js +33 -33
- package/src/helpers/download-file.js +21 -21
- package/src/helpers/filter-list-by-handle.js +31 -31
- package/src/helpers/filter-object-to-array.js +29 -29
- package/src/helpers/filter-object.js +34 -34
- package/src/helpers/filters.js +163 -163
- package/src/helpers/find-children-by-key.js +14 -14
- package/src/helpers/get-greatest-common-divisor.js +16 -16
- package/src/helpers/get-normalized-options.js +20 -20
- package/src/helpers/get-placeholder.js +19 -19
- package/src/helpers/get-required-label.js +3 -3
- package/src/helpers/get-slot-children-text.js +15 -15
- package/src/helpers/handle-process.js +13 -13
- package/src/helpers/images.js +28 -28
- package/src/helpers/index.js +25 -25
- package/src/helpers/is-empty.js +3 -3
- package/src/helpers/is-local-development.js +3 -3
- package/src/helpers/private/gutter-validator.js +15 -15
- package/src/helpers/private/has-parent-by-class-name.js +15 -15
- package/src/helpers/promise-handler.js +40 -40
- package/src/helpers/rules.js +7 -7
- package/src/helpers/set-scroll-on-grab.js +128 -128
- package/src/index.cjs.js +1 -1
- package/src/index.esm.js +4 -4
- package/src/index.scss +38 -38
- package/src/index.umd.js +2 -2
- package/src/mixins/context.js +8 -8
- package/src/mixins/delete.js +48 -48
- package/src/mixins/dialog-router.js +17 -17
- package/src/mixins/form.js +11 -11
- package/src/mixins/generator.js +94 -94
- package/src/mixins/index.js +17 -17
- package/src/mixins/password.js +86 -86
- package/src/mixins/search-filter.js +354 -354
- package/src/mixins/view.js +156 -156
- package/src/pages/ErrorComponent.vue +74 -74
- package/src/pages/Forbidden.vue +29 -29
- package/src/pages/NotFound.vue +29 -29
- package/src/pages/ServerError.vue +29 -29
- package/src/pages/Unauthorized.vue +29 -29
- package/src/plugins/delete/Delete.js +107 -107
- package/src/plugins/delete/Delete.yml +75 -75
- package/src/plugins/dialog/Dialog.js +14 -14
- package/src/plugins/dialog/Dialog.yml +10 -10
- package/src/plugins/index.js +13 -13
- package/src/plugins/notify-error/NotifyError.js +13 -13
- package/src/plugins/notify-error/NotifyError.yml +11 -11
- package/src/plugins/notify-success/NotifySuccess.js +13 -13
- package/src/plugins/notify-success/NotifySuccess.yml +11 -11
- package/src/plugins/screen/Screen.js +35 -35
- package/src/plugins/screen/Screen.yml +16 -16
- package/src/shared/date-config.js +26 -26
- package/src/shared/fuse-config.js +4 -4
- package/src/shared/notify-config.js +7 -7
- package/src/vue-plugin/third-party-component-handler.js +29 -29
- package/src/vue-plugin.js +282 -282
|
@@ -1,392 +1,392 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="qas-app-menu">
|
|
3
|
-
<q-drawer :key="reRenderCount" 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="!screen.untilLarge" class="q-mb-xl q-pt-xl qas-app-menu__label" :class="classes.spacedItem">
|
|
8
|
-
<router-link class="column flex items-center justify-center relative-position text-no-decoration" :to="rootRoute">
|
|
9
|
-
<q-img v-if="normalizedBrand" :alt="props.title" class="qas-app-menu__brand qas-app-menu__label" fit="contain" height="27px" img-class="qas-app-menu__brand-img" no-spinner :src="normalizedBrand" />
|
|
10
|
-
|
|
11
|
-
<span v-else-if="!isMiniMode" class="ellipsis text-bold text-primary text-subtitle2">{{ props.title }}</span>
|
|
12
|
-
|
|
13
|
-
<q-badge v-if="hasDevelopmentBadge" class="q-mt-sm" color="red" :label="developmentBadgeLabel" />
|
|
14
|
-
</router-link>
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<div v-if="normalizedBrand" class="qas-app-menu__label" :class="classes.spacedItem">
|
|
18
|
-
<q-separator />
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div v-if="screen.untilLarge" class="q-pr-xl q-pt-md text-right">
|
|
22
|
-
<qas-btn color="grey-10" icon="sym_r_close" variant="tertiary" @click="closeDrawer" />
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<!-- Module -->
|
|
26
|
-
<div v-if="showAppMenuDropdown" class="items-center justify-between no-wrap q-mt-xl qas-app-menu__label qas-app-menu__module row" :class="classes.spacedItem">
|
|
27
|
-
<div class="full-width text-center">
|
|
28
|
-
<pv-app-menu-dropdown v-bind="appMenuDropdownProps" />
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<!-- List -->
|
|
33
|
-
<q-list v-if="props.items.length" class="q-mt-xl qas-app-menu__menu text-grey-10" :class="menuClasses">
|
|
34
|
-
<template v-for="(menuItem, index) in props.items">
|
|
35
|
-
<div v-if="hasChildren(menuItem)" :key="`children-${index}`" class="qas-app-menu__content" :class="classes.content">
|
|
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-10 text-subtitle2" :class="classes.spacedItem">
|
|
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
|
-
|
|
56
|
-
<div v-if="hasSeparator(index)" class="qas-app-menu__label" :class="classes.spacedItem">
|
|
57
|
-
<q-separator spaced />
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
|
|
61
|
-
<!-- quando tem children vazio, não deve mostrar label do item, e a label do item
|
|
62
|
-
não tem "to", então validar se tem "to" para mostrar o item -->
|
|
63
|
-
<q-item v-else-if="menuItem.to" :key="index" :active="isActive(menuItem)" active-class="q-router-link--active" class="qas-app-menu__item" :to="getRouterRedirect(menuItem)">
|
|
64
|
-
<q-item-section v-if="menuItem.icon" avatar>
|
|
65
|
-
<q-icon :name="menuItem.icon" />
|
|
66
|
-
</q-item-section>
|
|
67
|
-
|
|
68
|
-
<q-item-section>
|
|
69
|
-
<q-item-label>
|
|
70
|
-
<div class="ellipsis text-subtitle2">
|
|
71
|
-
{{ menuItem.label }}
|
|
72
|
-
</div>
|
|
73
|
-
</q-item-label>
|
|
74
|
-
</q-item-section>
|
|
75
|
-
</q-item>
|
|
76
|
-
</template>
|
|
77
|
-
</q-list>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div v-if="showAppUser">
|
|
81
|
-
<!-- Chat Ajuda -->
|
|
82
|
-
<q-list v-if="helpChatLink" class="q-mt-xl">
|
|
83
|
-
<q-item class="q-mb-md text-primary" clickable>
|
|
84
|
-
<q-item-section avatar>
|
|
85
|
-
<q-icon name="sym_r_chat" />
|
|
86
|
-
</q-item-section>
|
|
87
|
-
|
|
88
|
-
<q-item-section>
|
|
89
|
-
<q-item-label>
|
|
90
|
-
<div class="ellipsis text-subtitle2">
|
|
91
|
-
Solicitar ajuda
|
|
92
|
-
</div>
|
|
93
|
-
</q-item-label>
|
|
94
|
-
</q-item-section>
|
|
95
|
-
|
|
96
|
-
<pv-app-menu-help-chat :link="props.helpChatLink" :mini-brand="props.miniBrand" @update:model-value="setHasOpenedHelpChat" />
|
|
97
|
-
</q-item>
|
|
98
|
-
</q-list>
|
|
99
|
-
|
|
100
|
-
<!-- User -->
|
|
101
|
-
<div class="full-width q-pb-lg q-px-lg">
|
|
102
|
-
<qas-app-user v-bind="defaultAppUserProps" />
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
</q-drawer>
|
|
107
|
-
</div>
|
|
108
|
-
</template>
|
|
109
|
-
|
|
110
|
-
<script setup>
|
|
111
|
-
import PvAppMenuHelpChat from './private/PvAppMenuHelpChat.vue'
|
|
112
|
-
import PvAppMenuDropdown from './private/PvAppMenuDropdown.vue'
|
|
113
|
-
import QasAppUser from '../app-user/QasAppUser.vue'
|
|
114
|
-
|
|
115
|
-
import useAppMenuDropdown from './composables/use-app-menu-dropdown'
|
|
116
|
-
import useAppUser from './composables/use-app-user'
|
|
117
|
-
import useDevelopmentBadge from './composables/use-development-badge'
|
|
118
|
-
import { useScreen } from '../../composables'
|
|
119
|
-
|
|
120
|
-
import { ref, computed, watch } from 'vue'
|
|
121
|
-
import { useRouter } from 'vue-router'
|
|
122
|
-
|
|
123
|
-
defineOptions({
|
|
124
|
-
name: 'QasAppMenu',
|
|
125
|
-
inheritAttrs: false
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
const props = defineProps({
|
|
129
|
-
appUserProps: {
|
|
130
|
-
type: Object,
|
|
131
|
-
required: true,
|
|
132
|
-
default: () => ({})
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
brand: {
|
|
136
|
-
default: '',
|
|
137
|
-
required: true,
|
|
138
|
-
type: String
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
helpChatLink: {
|
|
142
|
-
type: String,
|
|
143
|
-
default: ''
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
items: {
|
|
147
|
-
default: () => [],
|
|
148
|
-
type: Array
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
miniBrand: {
|
|
152
|
-
type: String,
|
|
153
|
-
required: true,
|
|
154
|
-
default: ''
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
modelValue: {
|
|
158
|
-
default: true,
|
|
159
|
-
type: Boolean
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
modules: {
|
|
163
|
-
default: () => [],
|
|
164
|
-
type: Array
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
notifications: {
|
|
168
|
-
default: () => ({}),
|
|
169
|
-
type: Object
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
title: {
|
|
173
|
-
default: '',
|
|
174
|
-
type: String
|
|
175
|
-
}
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
const emit = defineEmits(['sign-out', 'update:modelValue', 'toggle-notifications'])
|
|
179
|
-
|
|
180
|
-
const screen = useScreen()
|
|
181
|
-
const router = useRouter()
|
|
182
|
-
|
|
183
|
-
const rootRoute = router.hasRoute('Root') ? { name: 'Root' } : { path: '/' }
|
|
184
|
-
|
|
185
|
-
const hasOpenedMenu = ref(false)
|
|
186
|
-
const hasOpenedHelpChat = ref(false)
|
|
187
|
-
const isMini = ref(screen.isLarge)
|
|
188
|
-
const reRenderCount = ref(0)
|
|
189
|
-
|
|
190
|
-
const composableParams = {
|
|
191
|
-
props,
|
|
192
|
-
onMenuUpdate: setHasOpenedMenu,
|
|
193
|
-
onSignOut: () => emit('sign-out'),
|
|
194
|
-
onToggleNotifications: () => emit('toggle-notifications')
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const { defaultAppUserProps, showAppUser } = useAppUser(composableParams)
|
|
198
|
-
const { appMenuDropdownProps, showAppMenuDropdown } = useAppMenuDropdown(composableParams)
|
|
199
|
-
const { developmentBadgeLabel, hasDevelopmentBadge } = useDevelopmentBadge()
|
|
200
|
-
|
|
201
|
-
const model = computed({
|
|
202
|
-
get () {
|
|
203
|
-
return props.modelValue
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
set (value) {
|
|
207
|
-
emit('update:modelValue', value)
|
|
208
|
-
}
|
|
209
|
-
})
|
|
210
|
-
|
|
211
|
-
const behavior = computed(() => screen.untilLarge ? 'mobile' : 'desktop')
|
|
212
|
-
const drawerWidth = computed(() => screen.untilLarge ? 320 : 280)
|
|
213
|
-
const normalizedBrand = computed(() => isMini.value ? props.miniBrand : props.brand)
|
|
214
|
-
|
|
215
|
-
const isMiniMode = computed(() => {
|
|
216
|
-
return screen.isLarge && isMini.value && !hasOpenedMenu.value && !hasOpenedHelpChat.value
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
const menuClasses = computed(() => ({ 'qas-app-menu__menu--spaced': !props.helpChatLink }))
|
|
220
|
-
|
|
221
|
-
const classes = computed(() => {
|
|
222
|
-
return {
|
|
223
|
-
content: {
|
|
224
|
-
'qas-app-menu__content--spaced': !isMiniMode.value
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
spacedItem: {
|
|
228
|
-
'qas-app-menu__label--spaced': !isMiniMode.value
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
})
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* @desc Recurso tecnológico temporário (ou definitivo), este bug ocorre por conta
|
|
235
|
-
* da atualização do vue para a versão `v3.4+`, onde tiveram mudanças referentes a
|
|
236
|
-
* reatividade, existem issues abertas no Quasar, porém sem expectativas
|
|
237
|
-
* de que um dia será resolvido por parte deles.
|
|
238
|
-
*
|
|
239
|
-
* @see {@link https://github.com/quasarframework/quasar/issues/16651}
|
|
240
|
-
*/
|
|
241
|
-
watch(() => behavior.value, value => {
|
|
242
|
-
/**
|
|
243
|
-
* @desc quando o comportamento passa a ser desktop novamente é porque aconteceu um
|
|
244
|
-
* resize na pagina, então é necessário renderizar o componente QDrawer novamente.
|
|
245
|
-
*/
|
|
246
|
-
if (value === 'desktop') {
|
|
247
|
-
reRenderCount.value += 1
|
|
248
|
-
}
|
|
249
|
-
})
|
|
250
|
-
|
|
251
|
-
// métodos
|
|
252
|
-
function closeDrawer () {
|
|
253
|
-
emit('update:modelValue', false)
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
function getNormalizedPath (path) {
|
|
257
|
-
return path.split('/').filter(Boolean)?.[0]
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
function getPathFromObject ({ path, name }) {
|
|
261
|
-
if (path) return getNormalizedPath(path)
|
|
262
|
-
|
|
263
|
-
const resolvedRoute = router.resolve({ name })
|
|
264
|
-
|
|
265
|
-
return getNormalizedPath(resolvedRoute.path)
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function getRouterRedirect ({ to }) {
|
|
269
|
-
return to || ''
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
function hasChildren ({ children }) {
|
|
273
|
-
return !!(children || []).length
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
function hasSeparator (index) {
|
|
277
|
-
return !!props.items[index + 1]
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function isActive ({ to }) {
|
|
281
|
-
// quando o children vem vazio, "to" é "undefined", então precisa ser feito esta trativa.
|
|
282
|
-
if (!to) return false
|
|
283
|
-
|
|
284
|
-
const currentPath = getNormalizedPath(router.currentRoute.value.path)
|
|
285
|
-
const itemPath = typeof to === 'string' ? getNormalizedPath(to) : getPathFromObject(to)
|
|
286
|
-
|
|
287
|
-
return currentPath === itemPath
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
function onMouseEvent ({ type }) {
|
|
291
|
-
if (!screen.isLarge) return
|
|
292
|
-
|
|
293
|
-
const isMouseLeave = type === 'mouseleave'
|
|
294
|
-
|
|
295
|
-
isMini.value = isMouseLeave
|
|
296
|
-
|
|
297
|
-
model.value = false
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
function setHasOpenedMenu (value) {
|
|
301
|
-
hasOpenedMenu.value = value
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
function setHasOpenedHelpChat (value) {
|
|
305
|
-
hasOpenedHelpChat.value = value
|
|
306
|
-
}
|
|
307
|
-
</script>
|
|
308
|
-
|
|
309
|
-
<style lang="scss" scoped>
|
|
310
|
-
.qas-app-menu {
|
|
311
|
-
// Workaround para alterar o padding interno do QSelect sem influenciar na caixa de opções.
|
|
312
|
-
&__module {
|
|
313
|
-
.q-field__native {
|
|
314
|
-
padding-left: var(--qas-spacing-md);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.q-field__append {
|
|
318
|
-
margin-right: var(--qas-spacing-sm);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
&__select {
|
|
323
|
-
border-radius: var(--qas-generic-border-radius);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
&__item {
|
|
327
|
-
&:not(&--label) + &:not(&--label) {
|
|
328
|
-
margin-top: var(--qas-spacing-sm);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
&--children.q-item {
|
|
332
|
-
& + & {
|
|
333
|
-
margin-top: var(--qas-spacing-sm);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
&__label {
|
|
339
|
-
padding-left: var(--qas-spacing-md) !important;
|
|
340
|
-
padding-right: var(--qas-spacing-md) !important;
|
|
341
|
-
transition: padding 120ms; // 120ms é o mesmo tempo utilizado na abertura do QDrawer.
|
|
342
|
-
will-change: auto;
|
|
343
|
-
|
|
344
|
-
&--spaced {
|
|
345
|
-
padding-left: var(--qas-spacing-xl) !important;
|
|
346
|
-
padding-right: var(--qas-spacing-xl) !important;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
&__brand {
|
|
351
|
-
:deep(.qas-app-menu__brand-img) {
|
|
352
|
-
transition: opacity 120ms ease-in; // 120ms é o mesmo tempo utilizado na abertura do QDrawer.
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
&__item--label-mini {
|
|
357
|
-
padding-left: 0 !important;
|
|
358
|
-
padding-right: 0 !important;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.q-item:not(&__item--label-mini) {
|
|
362
|
-
padding-left: var(--qas-spacing-xl) !important;
|
|
363
|
-
padding-right: var(--qas-spacing-xl) !important;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
&__content + &__content,
|
|
367
|
-
&__content + &__item,
|
|
368
|
-
&__item + &__content {
|
|
369
|
-
margin-top: var(--qas-spacing-sm);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
// User
|
|
373
|
-
.qas-app-user__data {
|
|
374
|
-
line-height: 1.25;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
// Media: untilLarge
|
|
378
|
-
@media (min-width: $breakpoint-sm-max) {
|
|
379
|
-
&__menu {
|
|
380
|
-
overflow-x: hidden;
|
|
381
|
-
|
|
382
|
-
&:not(&--spaced) {
|
|
383
|
-
max-height: calc(100vh - 365px);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
&__menu--spaced {
|
|
388
|
-
max-height: calc(100vh - 310px);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="qas-app-menu">
|
|
3
|
+
<q-drawer :key="reRenderCount" 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="!screen.untilLarge" class="q-mb-xl q-pt-xl qas-app-menu__label" :class="classes.spacedItem">
|
|
8
|
+
<router-link class="column flex items-center justify-center relative-position text-no-decoration" :to="rootRoute">
|
|
9
|
+
<q-img v-if="normalizedBrand" :alt="props.title" class="qas-app-menu__brand qas-app-menu__label" fit="contain" height="27px" img-class="qas-app-menu__brand-img" no-spinner :src="normalizedBrand" />
|
|
10
|
+
|
|
11
|
+
<span v-else-if="!isMiniMode" class="ellipsis text-bold text-primary text-subtitle2">{{ props.title }}</span>
|
|
12
|
+
|
|
13
|
+
<q-badge v-if="hasDevelopmentBadge" class="q-mt-sm" color="red" :label="developmentBadgeLabel" />
|
|
14
|
+
</router-link>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div v-if="normalizedBrand" class="qas-app-menu__label" :class="classes.spacedItem">
|
|
18
|
+
<q-separator />
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div v-if="screen.untilLarge" class="q-pr-xl q-pt-md text-right">
|
|
22
|
+
<qas-btn color="grey-10" icon="sym_r_close" variant="tertiary" @click="closeDrawer" />
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<!-- Module -->
|
|
26
|
+
<div v-if="showAppMenuDropdown" class="items-center justify-between no-wrap q-mt-xl qas-app-menu__label qas-app-menu__module row" :class="classes.spacedItem">
|
|
27
|
+
<div class="full-width text-center">
|
|
28
|
+
<pv-app-menu-dropdown v-bind="appMenuDropdownProps" />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<!-- List -->
|
|
33
|
+
<q-list v-if="props.items.length" class="q-mt-xl qas-app-menu__menu text-grey-10" :class="menuClasses">
|
|
34
|
+
<template v-for="(menuItem, index) in props.items">
|
|
35
|
+
<div v-if="hasChildren(menuItem)" :key="`children-${index}`" class="qas-app-menu__content" :class="classes.content">
|
|
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-10 text-subtitle2" :class="classes.spacedItem">
|
|
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
|
+
|
|
56
|
+
<div v-if="hasSeparator(index)" class="qas-app-menu__label" :class="classes.spacedItem">
|
|
57
|
+
<q-separator spaced />
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<!-- quando tem children vazio, não deve mostrar label do item, e a label do item
|
|
62
|
+
não tem "to", então validar se tem "to" para mostrar o item -->
|
|
63
|
+
<q-item v-else-if="menuItem.to" :key="index" :active="isActive(menuItem)" active-class="q-router-link--active" class="qas-app-menu__item" :to="getRouterRedirect(menuItem)">
|
|
64
|
+
<q-item-section v-if="menuItem.icon" avatar>
|
|
65
|
+
<q-icon :name="menuItem.icon" />
|
|
66
|
+
</q-item-section>
|
|
67
|
+
|
|
68
|
+
<q-item-section>
|
|
69
|
+
<q-item-label>
|
|
70
|
+
<div class="ellipsis text-subtitle2">
|
|
71
|
+
{{ menuItem.label }}
|
|
72
|
+
</div>
|
|
73
|
+
</q-item-label>
|
|
74
|
+
</q-item-section>
|
|
75
|
+
</q-item>
|
|
76
|
+
</template>
|
|
77
|
+
</q-list>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div v-if="showAppUser">
|
|
81
|
+
<!-- Chat Ajuda -->
|
|
82
|
+
<q-list v-if="helpChatLink" class="q-mt-xl">
|
|
83
|
+
<q-item class="q-mb-md text-primary" clickable>
|
|
84
|
+
<q-item-section avatar>
|
|
85
|
+
<q-icon name="sym_r_chat" />
|
|
86
|
+
</q-item-section>
|
|
87
|
+
|
|
88
|
+
<q-item-section>
|
|
89
|
+
<q-item-label>
|
|
90
|
+
<div class="ellipsis text-subtitle2">
|
|
91
|
+
Solicitar ajuda
|
|
92
|
+
</div>
|
|
93
|
+
</q-item-label>
|
|
94
|
+
</q-item-section>
|
|
95
|
+
|
|
96
|
+
<pv-app-menu-help-chat :link="props.helpChatLink" :mini-brand="props.miniBrand" @update:model-value="setHasOpenedHelpChat" />
|
|
97
|
+
</q-item>
|
|
98
|
+
</q-list>
|
|
99
|
+
|
|
100
|
+
<!-- User -->
|
|
101
|
+
<div class="full-width q-pb-lg q-px-lg">
|
|
102
|
+
<qas-app-user v-bind="defaultAppUserProps" />
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</q-drawer>
|
|
107
|
+
</div>
|
|
108
|
+
</template>
|
|
109
|
+
|
|
110
|
+
<script setup>
|
|
111
|
+
import PvAppMenuHelpChat from './private/PvAppMenuHelpChat.vue'
|
|
112
|
+
import PvAppMenuDropdown from './private/PvAppMenuDropdown.vue'
|
|
113
|
+
import QasAppUser from '../app-user/QasAppUser.vue'
|
|
114
|
+
|
|
115
|
+
import useAppMenuDropdown from './composables/use-app-menu-dropdown'
|
|
116
|
+
import useAppUser from './composables/use-app-user'
|
|
117
|
+
import useDevelopmentBadge from './composables/use-development-badge'
|
|
118
|
+
import { useScreen } from '../../composables'
|
|
119
|
+
|
|
120
|
+
import { ref, computed, watch } from 'vue'
|
|
121
|
+
import { useRouter } from 'vue-router'
|
|
122
|
+
|
|
123
|
+
defineOptions({
|
|
124
|
+
name: 'QasAppMenu',
|
|
125
|
+
inheritAttrs: false
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
const props = defineProps({
|
|
129
|
+
appUserProps: {
|
|
130
|
+
type: Object,
|
|
131
|
+
required: true,
|
|
132
|
+
default: () => ({})
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
brand: {
|
|
136
|
+
default: '',
|
|
137
|
+
required: true,
|
|
138
|
+
type: String
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
helpChatLink: {
|
|
142
|
+
type: String,
|
|
143
|
+
default: ''
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
items: {
|
|
147
|
+
default: () => [],
|
|
148
|
+
type: Array
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
miniBrand: {
|
|
152
|
+
type: String,
|
|
153
|
+
required: true,
|
|
154
|
+
default: ''
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
modelValue: {
|
|
158
|
+
default: true,
|
|
159
|
+
type: Boolean
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
modules: {
|
|
163
|
+
default: () => [],
|
|
164
|
+
type: Array
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
notifications: {
|
|
168
|
+
default: () => ({}),
|
|
169
|
+
type: Object
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
title: {
|
|
173
|
+
default: '',
|
|
174
|
+
type: String
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
const emit = defineEmits(['sign-out', 'update:modelValue', 'toggle-notifications'])
|
|
179
|
+
|
|
180
|
+
const screen = useScreen()
|
|
181
|
+
const router = useRouter()
|
|
182
|
+
|
|
183
|
+
const rootRoute = router.hasRoute('Root') ? { name: 'Root' } : { path: '/' }
|
|
184
|
+
|
|
185
|
+
const hasOpenedMenu = ref(false)
|
|
186
|
+
const hasOpenedHelpChat = ref(false)
|
|
187
|
+
const isMini = ref(screen.isLarge)
|
|
188
|
+
const reRenderCount = ref(0)
|
|
189
|
+
|
|
190
|
+
const composableParams = {
|
|
191
|
+
props,
|
|
192
|
+
onMenuUpdate: setHasOpenedMenu,
|
|
193
|
+
onSignOut: () => emit('sign-out'),
|
|
194
|
+
onToggleNotifications: () => emit('toggle-notifications')
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const { defaultAppUserProps, showAppUser } = useAppUser(composableParams)
|
|
198
|
+
const { appMenuDropdownProps, showAppMenuDropdown } = useAppMenuDropdown(composableParams)
|
|
199
|
+
const { developmentBadgeLabel, hasDevelopmentBadge } = useDevelopmentBadge()
|
|
200
|
+
|
|
201
|
+
const model = computed({
|
|
202
|
+
get () {
|
|
203
|
+
return props.modelValue
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
set (value) {
|
|
207
|
+
emit('update:modelValue', value)
|
|
208
|
+
}
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
const behavior = computed(() => screen.untilLarge ? 'mobile' : 'desktop')
|
|
212
|
+
const drawerWidth = computed(() => screen.untilLarge ? 320 : 280)
|
|
213
|
+
const normalizedBrand = computed(() => isMini.value ? props.miniBrand : props.brand)
|
|
214
|
+
|
|
215
|
+
const isMiniMode = computed(() => {
|
|
216
|
+
return screen.isLarge && isMini.value && !hasOpenedMenu.value && !hasOpenedHelpChat.value
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
const menuClasses = computed(() => ({ 'qas-app-menu__menu--spaced': !props.helpChatLink }))
|
|
220
|
+
|
|
221
|
+
const classes = computed(() => {
|
|
222
|
+
return {
|
|
223
|
+
content: {
|
|
224
|
+
'qas-app-menu__content--spaced': !isMiniMode.value
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
spacedItem: {
|
|
228
|
+
'qas-app-menu__label--spaced': !isMiniMode.value
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @desc Recurso tecnológico temporário (ou definitivo), este bug ocorre por conta
|
|
235
|
+
* da atualização do vue para a versão `v3.4+`, onde tiveram mudanças referentes a
|
|
236
|
+
* reatividade, existem issues abertas no Quasar, porém sem expectativas
|
|
237
|
+
* de que um dia será resolvido por parte deles.
|
|
238
|
+
*
|
|
239
|
+
* @see {@link https://github.com/quasarframework/quasar/issues/16651}
|
|
240
|
+
*/
|
|
241
|
+
watch(() => behavior.value, value => {
|
|
242
|
+
/**
|
|
243
|
+
* @desc quando o comportamento passa a ser desktop novamente é porque aconteceu um
|
|
244
|
+
* resize na pagina, então é necessário renderizar o componente QDrawer novamente.
|
|
245
|
+
*/
|
|
246
|
+
if (value === 'desktop') {
|
|
247
|
+
reRenderCount.value += 1
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
// métodos
|
|
252
|
+
function closeDrawer () {
|
|
253
|
+
emit('update:modelValue', false)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function getNormalizedPath (path) {
|
|
257
|
+
return path.split('/').filter(Boolean)?.[0]
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function getPathFromObject ({ path, name }) {
|
|
261
|
+
if (path) return getNormalizedPath(path)
|
|
262
|
+
|
|
263
|
+
const resolvedRoute = router.resolve({ name })
|
|
264
|
+
|
|
265
|
+
return getNormalizedPath(resolvedRoute.path)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function getRouterRedirect ({ to }) {
|
|
269
|
+
return to || ''
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function hasChildren ({ children }) {
|
|
273
|
+
return !!(children || []).length
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function hasSeparator (index) {
|
|
277
|
+
return !!props.items[index + 1]
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function isActive ({ to }) {
|
|
281
|
+
// quando o children vem vazio, "to" é "undefined", então precisa ser feito esta trativa.
|
|
282
|
+
if (!to) return false
|
|
283
|
+
|
|
284
|
+
const currentPath = getNormalizedPath(router.currentRoute.value.path)
|
|
285
|
+
const itemPath = typeof to === 'string' ? getNormalizedPath(to) : getPathFromObject(to)
|
|
286
|
+
|
|
287
|
+
return currentPath === itemPath
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function onMouseEvent ({ type }) {
|
|
291
|
+
if (!screen.isLarge) return
|
|
292
|
+
|
|
293
|
+
const isMouseLeave = type === 'mouseleave'
|
|
294
|
+
|
|
295
|
+
isMini.value = isMouseLeave
|
|
296
|
+
|
|
297
|
+
model.value = false
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function setHasOpenedMenu (value) {
|
|
301
|
+
hasOpenedMenu.value = value
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function setHasOpenedHelpChat (value) {
|
|
305
|
+
hasOpenedHelpChat.value = value
|
|
306
|
+
}
|
|
307
|
+
</script>
|
|
308
|
+
|
|
309
|
+
<style lang="scss" scoped>
|
|
310
|
+
.qas-app-menu {
|
|
311
|
+
// Workaround para alterar o padding interno do QSelect sem influenciar na caixa de opções.
|
|
312
|
+
&__module {
|
|
313
|
+
.q-field__native {
|
|
314
|
+
padding-left: var(--qas-spacing-md);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.q-field__append {
|
|
318
|
+
margin-right: var(--qas-spacing-sm);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
&__select {
|
|
323
|
+
border-radius: var(--qas-generic-border-radius);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
&__item {
|
|
327
|
+
&:not(&--label) + &:not(&--label) {
|
|
328
|
+
margin-top: var(--qas-spacing-sm);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&--children.q-item {
|
|
332
|
+
& + & {
|
|
333
|
+
margin-top: var(--qas-spacing-sm);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
&__label {
|
|
339
|
+
padding-left: var(--qas-spacing-md) !important;
|
|
340
|
+
padding-right: var(--qas-spacing-md) !important;
|
|
341
|
+
transition: padding 120ms; // 120ms é o mesmo tempo utilizado na abertura do QDrawer.
|
|
342
|
+
will-change: auto;
|
|
343
|
+
|
|
344
|
+
&--spaced {
|
|
345
|
+
padding-left: var(--qas-spacing-xl) !important;
|
|
346
|
+
padding-right: var(--qas-spacing-xl) !important;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
&__brand {
|
|
351
|
+
:deep(.qas-app-menu__brand-img) {
|
|
352
|
+
transition: opacity 120ms ease-in; // 120ms é o mesmo tempo utilizado na abertura do QDrawer.
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
&__item--label-mini {
|
|
357
|
+
padding-left: 0 !important;
|
|
358
|
+
padding-right: 0 !important;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.q-item:not(&__item--label-mini) {
|
|
362
|
+
padding-left: var(--qas-spacing-xl) !important;
|
|
363
|
+
padding-right: var(--qas-spacing-xl) !important;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
&__content + &__content,
|
|
367
|
+
&__content + &__item,
|
|
368
|
+
&__item + &__content {
|
|
369
|
+
margin-top: var(--qas-spacing-sm);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// User
|
|
373
|
+
.qas-app-user__data {
|
|
374
|
+
line-height: 1.25;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// Media: untilLarge
|
|
378
|
+
@media (min-width: $breakpoint-sm-max) {
|
|
379
|
+
&__menu {
|
|
380
|
+
overflow-x: hidden;
|
|
381
|
+
|
|
382
|
+
&:not(&--spaced) {
|
|
383
|
+
max-height: calc(100vh - 365px);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
&__menu--spaced {
|
|
388
|
+
max-height: calc(100vh - 310px);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
</style>
|