@bildvitta/quasar-ui-asteroid 2.16.0 → 3.0.0-alpha.2
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/QasActions.json +40 -0
- package/dist/api/QasActionsMenu.json +64 -0
- package/dist/api/QasAlert.json +40 -0
- package/dist/api/QasAppBar.json +52 -0
- package/dist/api/QasAppMenu.json +38 -0
- package/dist/api/QasAvatar.json +44 -0
- package/dist/api/QasBox.json +16 -0
- package/dist/api/QasBreakline.json +32 -0
- package/dist/api/QasBtn.json +16 -0
- package/dist/api/QasCard.json +52 -0
- package/dist/api/QasCheckboxGroup.json +38 -0
- package/dist/api/QasCopy.json +29 -0
- package/dist/api/QasDateTimeInput.json +60 -0
- package/dist/api/QasDebugger.json +13 -0
- package/dist/api/QasDelete.json +64 -0
- package/dist/api/QasDialog.json +109 -0
- package/dist/api/QasDialogRouter.json +31 -0
- package/dist/api/QasField.json +56 -0
- package/dist/api/QasFilters.json +111 -0
- package/dist/api/QasFormGenerator.json +92 -0
- package/dist/api/QasFormView.json +228 -0
- package/dist/api/QasGallery.json +54 -0
- package/dist/api/QasGridGenerator.json +108 -0
- package/dist/api/QasInput.json +40 -0
- package/dist/api/QasLabel.json +40 -0
- package/dist/api/QasLayout.json +47 -0
- package/dist/api/QasListItems.json +72 -0
- package/dist/api/QasListView.json +161 -0
- package/dist/api/QasMap.json +41 -0
- package/dist/api/QasNestedFields.json +223 -0
- package/dist/api/QasNumericInput.json +68 -0
- package/dist/api/QasPageHeader.json +36 -0
- package/dist/api/QasPasswordInput.json +121 -0
- package/dist/api/QasPasswordStrengthChecker.json +126 -0
- package/dist/api/QasProfile.json +74 -0
- package/dist/api/QasResizer.json +34 -0
- package/dist/api/QasSearchBox.json +91 -0
- package/dist/api/QasSelect.json +88 -0
- package/dist/api/QasSelectList.json +134 -0
- package/dist/api/QasSignaturePad.json +63 -0
- package/dist/api/QasSignatureUploader.json +41 -0
- package/dist/api/QasSingleView.json +147 -0
- package/dist/api/QasSortable.json +80 -0
- package/dist/api/QasTableGenerator.json +56 -0
- package/dist/api/QasTabsGenerator.json +90 -0
- package/dist/api/QasTextTruncate.json +38 -0
- package/dist/api/QasTransfer.json +70 -0
- package/dist/api/QasUploader.json +143 -0
- package/dist/asteroid.cjs.css +1 -0
- package/dist/asteroid.cjs.js +9307 -0
- package/dist/asteroid.cjs.min.js +6 -0
- package/dist/asteroid.esm.css +1 -0
- package/dist/asteroid.esm.js +9298 -0
- package/dist/asteroid.esm.min.js +6 -0
- package/dist/asteroid.umd.css +1 -0
- package/dist/asteroid.umd.js +9301 -0
- package/dist/asteroid.umd.min.js +6 -0
- package/dist/vetur/asteroid-attributes.json +1178 -0
- package/dist/vetur/asteroid-tags.json +535 -0
- package/package.json +41 -56
- package/src/assets/logo-modular.svg +1 -1
- package/src/asteroid.js +1 -0
- package/src/components/actions/QasActions.vue +45 -0
- package/src/components/actions/QasActions.yml +24 -0
- package/src/components/actions-menu/QasActionsMenu.vue +41 -14
- package/src/components/actions-menu/QasActionsMenu.yml +63 -0
- package/src/components/alert/QasAlert.vue +90 -0
- package/src/components/alert/QasAlert.yml +33 -0
- package/src/components/app-bar/QasAppBar.vue +16 -13
- package/src/components/app-bar/QasAppBar.yml +51 -0
- package/src/components/app-menu/QasAppMenu.vue +10 -12
- package/src/components/app-menu/QasAppMenu.yml +32 -0
- package/src/components/avatar/QasAvatar.vue +17 -9
- package/src/components/avatar/QasAvatar.yml +38 -0
- 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 +13 -0
- package/src/components/card/QasCard.vue +32 -33
- package/src/components/card/QasCard.yml +42 -0
- package/src/components/checkbox-group/QasCheckboxGroup.vue +50 -17
- package/src/components/checkbox-group/QasCheckboxGroup.yml +30 -0
- package/src/components/copy/QasCopy.vue +22 -11
- package/src/components/copy/QasCopy.yml +20 -0
- package/src/components/date-time-input/QasDateTimeInput.vue +18 -26
- package/src/components/date-time-input/QasDateTimeInput.yml +54 -0
- package/src/components/debugger/QasDebugger.vue +2 -0
- package/src/components/debugger/QasDebugger.yml +10 -0
- package/src/components/delete/QasDelete.vue +43 -16
- package/src/components/delete/QasDelete.yml +52 -0
- package/src/components/dialog/QasDialog.vue +63 -67
- package/src/components/dialog/QasDialog.yml +86 -0
- package/src/components/dialog-router/QasDialogRouter.vue +14 -4
- package/src/components/dialog-router/QasDialogRouter.yml +23 -0
- package/src/components/field/QasField.vue +21 -24
- package/src/components/field/QasField.yml +31 -0
- package/src/components/filters/QasFilters.vue +33 -26
- package/src/components/filters/QasFilters.yml +91 -0
- package/src/components/form-generator/QasFormGenerator.vue +13 -15
- package/src/components/form-generator/QasFormGenerator.yml +64 -0
- package/src/components/form-view/QasFormView.vue +129 -69
- package/src/components/form-view/QasFormView.yml +179 -0
- package/src/components/gallery/QasGallery.vue +47 -30
- package/src/components/gallery/QasGallery.yml +51 -0
- package/src/components/grid-generator/QasGridGenerator.vue +15 -7
- package/src/components/grid-generator/QasGridGenerator.yml +73 -0
- package/src/components/index.js +0 -0
- package/src/components/input/QasInput.vue +43 -36
- package/src/components/input/QasInput.yml +32 -0
- package/src/components/label/QasLabel.vue +14 -15
- package/src/components/label/QasLabel.yml +28 -0
- package/src/components/layout/QasLayout.vue +13 -21
- package/src/components/layout/QasLayout.yml +38 -0
- package/src/components/list-items/QasListItems.vue +15 -12
- package/src/components/list-items/QasListItems.yml +57 -0
- package/src/components/list-view/QasListView.vue +57 -31
- package/src/components/list-view/QasListView.yml +132 -0
- package/src/components/map/QasMap.vue +15 -31
- package/src/components/map/QasMap.yml +33 -0
- package/src/components/nested-fields/QasNestedFields.vue +57 -47
- package/src/components/nested-fields/QasNestedFields.yml +180 -0
- package/src/components/numeric-input/QasNumericInput.vue +31 -22
- package/src/components/numeric-input/QasNumericInput.yml +51 -0
- package/src/components/page-header/QasPageHeader.vue +20 -11
- package/src/components/page-header/QasPageHeader.yml +24 -0
- package/src/components/password-input/QasPasswordInput.vue +24 -21
- package/src/components/password-input/QasPasswordInput.yml +103 -0
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.vue +51 -34
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.yml +103 -0
- package/src/components/profile/QasProfile.vue +15 -13
- package/src/components/profile/QasProfile.yml +60 -0
- package/src/components/resizer/QasResizer.vue +3 -3
- package/src/components/resizer/QasResizer.yml +23 -0
- package/src/components/search-box/QasSearchBox.vue +50 -21
- package/src/components/search-box/QasSearchBox.yml +76 -0
- package/src/components/select/QasSelect.vue +51 -50
- package/src/components/select/QasSelect.yml +62 -0
- package/src/components/select-list/QasSelectList.vue +72 -53
- package/src/components/select-list/QasSelectList.yml +116 -0
- package/src/components/signature-pad/QasSignaturePad.vue +60 -40
- package/src/components/signature-pad/QasSignaturePad.yml +53 -0
- package/src/components/signature-uploader/QasSignatureUploader.vue +19 -17
- package/src/components/signature-uploader/QasSignatureUploader.yml +36 -0
- package/src/components/single-view/QasSingleView.vue +41 -22
- package/src/components/single-view/QasSingleView.yml +116 -0
- package/src/components/sortable/QasSortable.vue +51 -30
- package/src/components/sortable/QasSortable.yml +65 -0
- package/src/components/table-generator/QasTableGenerator.vue +112 -21
- package/src/components/table-generator/QasTableGenerator.yml +46 -0
- package/src/components/tabs-generator/QasTabsGenerator.vue +37 -25
- package/src/components/tabs-generator/QasTabsGenerator.yml +67 -0
- package/src/components/text-truncate/QasTextTruncate.vue +25 -17
- package/src/components/text-truncate/QasTextTruncate.yml +32 -0
- package/src/components/transfer/QasTransfer.vue +48 -49
- package/src/components/transfer/QasTransfer.yml +59 -0
- package/src/components/uploader/QasUploader.vue +169 -48
- package/src/components/uploader/QasUploader.yml +117 -0
- 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 +8 -4
- package/src/helpers/{greatestCommonDivisor.js → get-greatest-common-divisor.js} +0 -0
- package/src/helpers/get-slot-children-text.js +15 -0
- package/src/helpers/images.js +28 -0
- package/src/helpers/index.js +11 -59
- package/src/helpers/{isLocalDevelopment.js → is-local-development.js} +0 -0
- package/src/helpers/set-scroll-on-grab.js +61 -0
- package/src/index.cjs.js +1 -0
- package/src/index.esm.js +4 -0
- package/src/index.scss +19 -21
- 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 +62 -22
- package/src/plugins/dialog/Dialog.js +14 -0
- package/src/plugins/dialog/Dialog.yml +10 -0
- package/src/plugins/index.js +4 -2
- package/src/plugins/{NotifyError.js → notify-error/NotifyError.js} +0 -0
- package/src/plugins/notify-error/NotifyError.yml +11 -0
- package/src/plugins/{NotifySuccess.js → notify-success/NotifySuccess.js} +3 -3
- package/src/plugins/notify-success/NotifySuccess.yml +11 -0
- 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 -84
- package/src/components/app-menu/QasAppMenu.stories.js +0 -66
- 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/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 -142
- package/src/components/input/QasInput.stories.js +0 -78
- package/src/components/label/QasLabel.stories.js +0 -60
- package/src/components/layout/QasLayout.stories.js +0 -104
- package/src/components/list-items/QasListItems.stories.js +0 -135
- 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/numeric-input/QasNumericInput.stories.js +0 -92
- 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 -120
- 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 -120
- 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 -249
- 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
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
|
|
1
2
|
<template>
|
|
2
|
-
<qas-box class="
|
|
3
|
+
<qas-box class="gallery">
|
|
3
4
|
<div class="q-col-gutter-md row">
|
|
4
|
-
<div v-for="(
|
|
5
|
-
<q-img class="cursor-pointer rounded-borders" :height="
|
|
5
|
+
<div v-for="(image, index) in initialImages()" :key="index" :class="galleryColumnsClasses">
|
|
6
|
+
<q-img class="cursor-pointer rounded-borders" :height="imageHeight" :src="image" @click="toggleCarouselDialog(index)" @error="onError(image)" />
|
|
6
7
|
</div>
|
|
7
|
-
<slot
|
|
8
|
+
<slot>
|
|
8
9
|
<div v-if="!hideShowMore" class="full-width text-center">
|
|
9
|
-
<
|
|
10
|
+
<qas-btn class="text-weight-bolder" color="primary" flat @click="showMore">{{ showMoreLabel }}</qas-btn>
|
|
10
11
|
</div>
|
|
11
12
|
</slot>
|
|
12
13
|
<qas-dialog v-model="carouselDialog" :cancel="false" class="q-pa-xl" min-width="1100px" :ok="false" :persistent="false">
|
|
@@ -16,9 +17,9 @@
|
|
|
16
17
|
</div>
|
|
17
18
|
</template>
|
|
18
19
|
<template #description>
|
|
19
|
-
<q-carousel v-model="
|
|
20
|
-
<q-carousel-slide v-for="(
|
|
21
|
-
<div v-if="
|
|
20
|
+
<q-carousel v-model="imageIndex" animated :arrows="!mx_isSmall" control-text-color="primary" :fullscreen="mx_isSmall" :height="carouselImageHeight" :next-icon="carouselNextIcon" :prev-icon="carouselPreviousIcon" swipeable :thumbnails="showThumbnails">
|
|
21
|
+
<q-carousel-slide v-for="(image, index) in clonedImages" :key="index" class="bg-no-repeat bg-size-contain" :img-src="image" :name="index">
|
|
22
|
+
<div v-if="mx_isSmall" class="full-width justify-end row">
|
|
22
23
|
<qas-btn dense flat icon="o_close" @click="toggleCarouselDialog" />
|
|
23
24
|
</div>
|
|
24
25
|
</q-carousel-slide>
|
|
@@ -33,6 +34,8 @@
|
|
|
33
34
|
import screenMixin from '../../mixins/screen'
|
|
34
35
|
|
|
35
36
|
export default {
|
|
37
|
+
name: 'QasGallery',
|
|
38
|
+
|
|
36
39
|
mixins: [screenMixin],
|
|
37
40
|
|
|
38
41
|
props: {
|
|
@@ -51,17 +54,17 @@ export default {
|
|
|
51
54
|
default: ''
|
|
52
55
|
},
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
initialSize: {
|
|
55
58
|
type: Number,
|
|
56
59
|
default: 6
|
|
57
60
|
},
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
images: {
|
|
60
63
|
type: Array,
|
|
61
64
|
default: () => []
|
|
62
65
|
},
|
|
63
66
|
|
|
64
|
-
|
|
67
|
+
loadSize: {
|
|
65
68
|
type: Number,
|
|
66
69
|
default: 6
|
|
67
70
|
},
|
|
@@ -69,70 +72,84 @@ export default {
|
|
|
69
72
|
showMoreLabel: {
|
|
70
73
|
type: String,
|
|
71
74
|
default: 'Ver mais'
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
useLoadAll: {
|
|
78
|
+
type: Boolean
|
|
72
79
|
}
|
|
73
80
|
},
|
|
74
81
|
|
|
75
82
|
data () {
|
|
76
83
|
return {
|
|
77
84
|
carouselDialog: false,
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
clonedImages: [],
|
|
86
|
+
imageIndex: [],
|
|
87
|
+
displayedImages: this.initialSize
|
|
80
88
|
}
|
|
81
89
|
},
|
|
82
90
|
|
|
83
91
|
computed: {
|
|
84
|
-
|
|
85
|
-
if (this.
|
|
92
|
+
imageHeight () {
|
|
93
|
+
if (this.isSingleImage) {
|
|
86
94
|
return this.height || 'auto'
|
|
87
95
|
}
|
|
88
96
|
|
|
89
|
-
return this
|
|
97
|
+
return this.mx_isSmall ? '90px' : '120px'
|
|
90
98
|
},
|
|
91
99
|
|
|
92
100
|
galleryColumnsClasses () {
|
|
93
|
-
if (this.
|
|
101
|
+
if (this.isSingleImage) return 'col-12'
|
|
94
102
|
|
|
95
|
-
return this
|
|
103
|
+
return this.mx_isSmall ? 'col-6' : 'col-2'
|
|
96
104
|
},
|
|
97
105
|
|
|
98
106
|
hideShowMore () {
|
|
99
|
-
return this.
|
|
107
|
+
return (this.clonedImages.length <= this.displayedImages) || this.useLoadAll
|
|
100
108
|
},
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
carouselImageHeight () {
|
|
103
111
|
return 'calc((500/976) * 100vh)'
|
|
104
112
|
},
|
|
105
113
|
|
|
106
114
|
showThumbnails () {
|
|
107
|
-
return !this.
|
|
115
|
+
return !this.isSingleImage
|
|
108
116
|
},
|
|
109
117
|
|
|
110
|
-
|
|
111
|
-
return this.
|
|
118
|
+
isSingleImage () {
|
|
119
|
+
return this.clonedImages.length === 1
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
watch: {
|
|
124
|
+
images: {
|
|
125
|
+
handler (value) {
|
|
126
|
+
this.clonedImages = [...value]
|
|
127
|
+
},
|
|
128
|
+
immediate: true
|
|
112
129
|
}
|
|
113
130
|
},
|
|
114
131
|
|
|
115
132
|
methods: {
|
|
116
|
-
toggleCarouselDialog (
|
|
117
|
-
this.
|
|
133
|
+
toggleCarouselDialog (image) {
|
|
134
|
+
this.imageIndex = image
|
|
118
135
|
this.carouselDialog = !this.carouselDialog
|
|
119
136
|
},
|
|
120
137
|
|
|
121
138
|
showMore () {
|
|
122
|
-
this.
|
|
139
|
+
this.displayedImages += this.loadSize
|
|
123
140
|
},
|
|
124
141
|
|
|
125
142
|
onError (error) {
|
|
126
|
-
const index = this.
|
|
143
|
+
const index = this.clonedImages.findIndex(image => image === error)
|
|
127
144
|
|
|
128
145
|
if (~index) {
|
|
129
|
-
this
|
|
146
|
+
this.clonedImages.splice(index, 1)
|
|
130
147
|
this.$forceUpdate()
|
|
131
148
|
}
|
|
132
149
|
},
|
|
133
150
|
|
|
134
|
-
|
|
135
|
-
return this.
|
|
151
|
+
initialImages () {
|
|
152
|
+
return this.useLoadAll ? this.clonedImages : this.clonedImages.slice(0, this.displayedImages)
|
|
136
153
|
}
|
|
137
154
|
}
|
|
138
155
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
type: component
|
|
2
|
+
|
|
3
|
+
mixins:
|
|
4
|
+
- '@bildvitta/quasar-ui-asteroid/dist/api/QasBox.json'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
meta:
|
|
8
|
+
desc: Componente para galeria, mostrando images dentro de um "QasDialog" ao clicar nelas.
|
|
9
|
+
|
|
10
|
+
props:
|
|
11
|
+
carousel-next-icon:
|
|
12
|
+
desc: Ícone dentro do carousel para passar para próxima imagem.
|
|
13
|
+
default: o_chevron_right
|
|
14
|
+
type: String
|
|
15
|
+
|
|
16
|
+
carousel-previous-icon:
|
|
17
|
+
desc: Ícone dentro do carousel para passar para a imagem anterior.
|
|
18
|
+
default: o_chevron_left
|
|
19
|
+
type: String
|
|
20
|
+
|
|
21
|
+
height:
|
|
22
|
+
desc: Altura da imagem (fora do dialog).
|
|
23
|
+
type: String
|
|
24
|
+
|
|
25
|
+
initial-size:
|
|
26
|
+
desc: Quantidade de imagens iniciais.
|
|
27
|
+
default: 6
|
|
28
|
+
type: Number
|
|
29
|
+
|
|
30
|
+
images:
|
|
31
|
+
desc: Imagens a serem exibidas.
|
|
32
|
+
default: 6
|
|
33
|
+
type: Number
|
|
34
|
+
|
|
35
|
+
load-size:
|
|
36
|
+
desc: Quantidade de fotos carregadas por vez.
|
|
37
|
+
default: 6
|
|
38
|
+
type: Number
|
|
39
|
+
|
|
40
|
+
show-more-label:
|
|
41
|
+
desc: Rótulo do botão de "mostrar mais".
|
|
42
|
+
default: Ver mais
|
|
43
|
+
type: String
|
|
44
|
+
|
|
45
|
+
use-load-all:
|
|
46
|
+
desc: Carrega todas imagens de uma única vez.
|
|
47
|
+
type: Boolean
|
|
48
|
+
|
|
49
|
+
slots:
|
|
50
|
+
default:
|
|
51
|
+
desc: Slot para todo conteúdo onde fica o botão "mostrar mais".
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="
|
|
3
|
-
<div v-for="(field, key) in formattedFields" :key="key" :class="
|
|
2
|
+
<div :class="mx_classes">
|
|
3
|
+
<div v-for="(field, key) in formattedFields" :key="key" :class="mx_getFieldClass(key, true)">
|
|
4
4
|
<slot :field="slotValue[key]" :name="`field-${field.name}`">
|
|
5
5
|
<slot :field="slotValue[key]" name="header">
|
|
6
|
-
<
|
|
6
|
+
<header :class="headerClass">{{ field.label }}</header>
|
|
7
7
|
</slot>
|
|
8
8
|
|
|
9
9
|
<slot :field="slotValue[key]" name="content">
|
|
@@ -15,12 +15,14 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
|
-
import generatorMixin from '../../mixins
|
|
18
|
+
import { generatorMixin } from '../../mixins'
|
|
19
19
|
import { humanize } from '../../helpers/filters'
|
|
20
20
|
import { extend } from 'quasar'
|
|
21
|
-
import { isObject } from 'lodash'
|
|
21
|
+
import { isObject } from 'lodash-es'
|
|
22
22
|
|
|
23
23
|
export default {
|
|
24
|
+
name: 'QasGridGenerator',
|
|
25
|
+
|
|
24
26
|
mixins: [generatorMixin],
|
|
25
27
|
|
|
26
28
|
props: {
|
|
@@ -79,16 +81,22 @@ export default {
|
|
|
79
81
|
},
|
|
80
82
|
|
|
81
83
|
resultsByFields () {
|
|
84
|
+
return this.getResultsByFields()
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
methods: {
|
|
89
|
+
getResultsByFields () {
|
|
82
90
|
const formattedResult = {}
|
|
83
91
|
const result = extend(true, {}, this.result)
|
|
92
|
+
|
|
84
93
|
for (const key in result) {
|
|
85
94
|
if (this.formattedFields[key]?.type) {
|
|
86
95
|
formattedResult[key] = humanize(this.formattedFields[key], result[key]) || this.emptyResultText
|
|
87
|
-
// TODO: Rever.
|
|
88
|
-
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
89
96
|
this.slotValue[key] = { ...this.formattedFields[key], formattedResult: formattedResult[key] }
|
|
90
97
|
}
|
|
91
98
|
}
|
|
99
|
+
|
|
92
100
|
return formattedResult
|
|
93
101
|
}
|
|
94
102
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
type: component
|
|
2
|
+
|
|
3
|
+
meta:
|
|
4
|
+
desc: Componente para criação de textos dinâmicos.
|
|
5
|
+
|
|
6
|
+
props:
|
|
7
|
+
content-class:
|
|
8
|
+
desc: Classe de cada "div" pai referente ao resultado.
|
|
9
|
+
default: ''
|
|
10
|
+
type: [Array, Object, String]
|
|
11
|
+
|
|
12
|
+
header-class:
|
|
13
|
+
desc: Classe de cada "header" pai referente ao "label".
|
|
14
|
+
default: 'text-bold'
|
|
15
|
+
type: [Array, Object, String]
|
|
16
|
+
|
|
17
|
+
hide-empty-result:
|
|
18
|
+
desc: Se o resultado de algum campo for vazio, ele remove todo o campo.
|
|
19
|
+
type: Boolean
|
|
20
|
+
|
|
21
|
+
empty-result-text:
|
|
22
|
+
desc: Se o resultado de algum campo for vazio, esta prop define qual será o valor padrão.
|
|
23
|
+
default: '-'
|
|
24
|
+
type: String
|
|
25
|
+
|
|
26
|
+
result:
|
|
27
|
+
desc: Resultado contendo todas informações para serem exibidas na tela.
|
|
28
|
+
default: {}
|
|
29
|
+
type: Object
|
|
30
|
+
examples: ["{ 'joah@examples.com' }"]
|
|
31
|
+
|
|
32
|
+
fields:
|
|
33
|
+
desc: Lista de field contendo informações necessárias para a criação do campo correspondente.
|
|
34
|
+
default: {}
|
|
35
|
+
type: Object
|
|
36
|
+
examples: ["{ email: { name: 'email', type: 'email', label: 'E-mail' } }"]
|
|
37
|
+
|
|
38
|
+
columns:
|
|
39
|
+
desc: Colunas do grid de cada campo.
|
|
40
|
+
default: col-6
|
|
41
|
+
type: [Array, String, Object]
|
|
42
|
+
examples: ["{ name: { sm: 6, md: 12 } }", "[{ sm: 6, md: 12 }]"]
|
|
43
|
+
|
|
44
|
+
gutter:
|
|
45
|
+
desc: Espaçamento entre colunas.
|
|
46
|
+
default: md
|
|
47
|
+
type: String
|
|
48
|
+
examples: [xs, sm, md, lg, xl]
|
|
49
|
+
|
|
50
|
+
slots:
|
|
51
|
+
'field-[nome-da-chave]':
|
|
52
|
+
desc: Slot para todo o conteúdo dentro de cada grid (header e content).
|
|
53
|
+
scope:
|
|
54
|
+
field:
|
|
55
|
+
desc: Conteúdo do field atual mais o resultado formatado.
|
|
56
|
+
default: {}
|
|
57
|
+
type: Object
|
|
58
|
+
|
|
59
|
+
header:
|
|
60
|
+
desc: Slot para o header.
|
|
61
|
+
scope:
|
|
62
|
+
field:
|
|
63
|
+
desc: Conteúdo do field atual mais o resultado formatado.
|
|
64
|
+
default: {}
|
|
65
|
+
type: Object
|
|
66
|
+
|
|
67
|
+
content:
|
|
68
|
+
desc: Slot para o conteúdo (content).
|
|
69
|
+
scope:
|
|
70
|
+
field:
|
|
71
|
+
desc: Conteúdo do field atual mais o resultado formatado.
|
|
72
|
+
default: {}
|
|
73
|
+
type: Object
|
|
File without changes
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<q-input ref="
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
<slot :name="key" v-bind="scope" />
|
|
3
|
+
<q-input ref="input" v-model="model" bottom-slots v-bind="$attrs" :mask="mask" :outlined="outlined" :unmasked-value="unmaskedValue">
|
|
4
|
+
<template v-for="(_, name) in $slots" #[name]="context">
|
|
5
|
+
<slot :name="name" v-bind="context || {}" />
|
|
7
6
|
</template>
|
|
8
7
|
</q-input>
|
|
9
8
|
</div>
|
|
@@ -13,43 +12,41 @@
|
|
|
13
12
|
export default {
|
|
14
13
|
name: 'QasInput',
|
|
15
14
|
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
|
|
16
17
|
props: {
|
|
17
|
-
|
|
18
|
+
modelValue: {
|
|
18
19
|
default: '',
|
|
19
20
|
type: String
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
computed: {
|
|
24
|
-
model: {
|
|
25
|
-
get () {
|
|
26
|
-
return this.value
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
set (value) {
|
|
30
|
-
return this.$emit('input', value)
|
|
31
|
-
}
|
|
32
21
|
},
|
|
33
22
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
unmaskedValue: {
|
|
24
|
+
default: true,
|
|
25
|
+
type: Boolean
|
|
37
26
|
},
|
|
38
27
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
outlined: {
|
|
29
|
+
default: true,
|
|
30
|
+
type: Boolean
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
emits: ['update:modelValue'],
|
|
42
35
|
|
|
36
|
+
computed: {
|
|
43
37
|
hasError () {
|
|
44
38
|
return this.inputReference.hasError
|
|
45
39
|
},
|
|
46
40
|
|
|
41
|
+
inputReference () {
|
|
42
|
+
return this.$refs.input
|
|
43
|
+
},
|
|
44
|
+
|
|
47
45
|
mask () {
|
|
48
46
|
const { mask } = this.$attrs
|
|
47
|
+
const hasDefaultMask = Object.prototype.hasOwnProperty.call(this.masks, mask)
|
|
49
48
|
|
|
50
|
-
return
|
|
51
|
-
? this.masks[mask]()
|
|
52
|
-
: mask
|
|
49
|
+
return hasDefaultMask ? this.masks[mask]() : mask
|
|
53
50
|
},
|
|
54
51
|
|
|
55
52
|
masks () {
|
|
@@ -60,12 +57,22 @@ export default {
|
|
|
60
57
|
phone: () => this.toggleMask('(##) ####-#####', '(##) #####-####'),
|
|
61
58
|
'postal-code': () => '#####-###'
|
|
62
59
|
}
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
model: {
|
|
63
|
+
get () {
|
|
64
|
+
return this.modelValue
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
set (value) {
|
|
68
|
+
return this.$emit('update:modelValue', value)
|
|
69
|
+
}
|
|
63
70
|
}
|
|
64
71
|
},
|
|
65
72
|
|
|
66
73
|
watch: {
|
|
67
74
|
mask () {
|
|
68
|
-
const input = this
|
|
75
|
+
const input = this.inputReference.$el?.querySelector('input')
|
|
69
76
|
|
|
70
77
|
requestAnimationFrame(() => {
|
|
71
78
|
input.selectionStart = input.value ? input.value.length : ''
|
|
@@ -74,21 +81,21 @@ export default {
|
|
|
74
81
|
},
|
|
75
82
|
|
|
76
83
|
methods: {
|
|
77
|
-
toggleMask (first, second) {
|
|
78
|
-
const length = first.split('#').length - 2
|
|
79
|
-
return this.value?.length > length ? second : first
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
validate (value) {
|
|
83
|
-
return this.inputReference.validate(value)
|
|
84
|
-
},
|
|
85
|
-
|
|
86
84
|
focus () {
|
|
87
85
|
return this.inputReference.focus()
|
|
88
86
|
},
|
|
89
87
|
|
|
90
88
|
resetValidation () {
|
|
91
89
|
return this.inputReference.resetValidation()
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
toggleMask (first, second) {
|
|
93
|
+
const length = first.split('#').length - 2
|
|
94
|
+
return this.modelValue?.length > length ? second : first
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
validate (value) {
|
|
98
|
+
return this.inputReference.validate(value)
|
|
92
99
|
}
|
|
93
100
|
}
|
|
94
101
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
type: component
|
|
2
|
+
|
|
3
|
+
mixins:
|
|
4
|
+
- quasar/dist/api/QInput.json
|
|
5
|
+
|
|
6
|
+
meta:
|
|
7
|
+
desc: Componente para input que implementa o "QInput" repassando propriedades, slots e eventos.
|
|
8
|
+
|
|
9
|
+
props:
|
|
10
|
+
model-value:
|
|
11
|
+
desc: Model do componente.
|
|
12
|
+
type: String
|
|
13
|
+
examples: [v-model="value"]
|
|
14
|
+
model: true
|
|
15
|
+
|
|
16
|
+
unmasked-value:
|
|
17
|
+
desc: Remove a mascara do v-model.
|
|
18
|
+
default: true
|
|
19
|
+
type: Boolean
|
|
20
|
+
|
|
21
|
+
outlined:
|
|
22
|
+
desc: Controla borda do input.
|
|
23
|
+
default: true
|
|
24
|
+
type: Boolean
|
|
25
|
+
|
|
26
|
+
events:
|
|
27
|
+
'@update:model-value -> function (value)':
|
|
28
|
+
desc: Dispara toda vez que o model é atualizado, também utilizado para v-model.
|
|
29
|
+
params:
|
|
30
|
+
value:
|
|
31
|
+
desc: Novo valor do v-model
|
|
32
|
+
type: String
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="text-bold text-subtitle2" :class="
|
|
3
|
-
|
|
4
|
-
<slot :formattedLabel="formattedLabel">
|
|
5
|
-
{{ formattedLabel }}
|
|
6
|
-
</slot>
|
|
2
|
+
<div class="text-bold text-subtitle2" :class="labelClass">
|
|
3
|
+
<slot :label-with-suffix="labelWithSuffix">{{ labelWithSuffix }}</slot>
|
|
7
4
|
</div>
|
|
8
5
|
</template>
|
|
9
6
|
|
|
10
7
|
<script>
|
|
11
|
-
import
|
|
8
|
+
import { addCounterSuffix } from '../../helpers'
|
|
12
9
|
|
|
13
10
|
export default {
|
|
11
|
+
name: 'QasLabel',
|
|
12
|
+
|
|
14
13
|
props: {
|
|
14
|
+
count: {
|
|
15
|
+
default: 0,
|
|
16
|
+
type: [Number, String]
|
|
17
|
+
},
|
|
18
|
+
|
|
15
19
|
label: {
|
|
16
20
|
default: '',
|
|
17
21
|
type: String
|
|
@@ -20,21 +24,16 @@ export default {
|
|
|
20
24
|
margin: {
|
|
21
25
|
default: 'sm',
|
|
22
26
|
type: String
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
quantity: {
|
|
26
|
-
default: 0,
|
|
27
|
-
type: Number
|
|
28
27
|
}
|
|
29
28
|
},
|
|
30
29
|
|
|
31
30
|
computed: {
|
|
32
|
-
|
|
33
|
-
return
|
|
31
|
+
labelClass () {
|
|
32
|
+
return `q-mb-${this.margin}`
|
|
34
33
|
},
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
return
|
|
35
|
+
labelWithSuffix () {
|
|
36
|
+
return addCounterSuffix(this.label, parseFloat(this.count))
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type: component
|
|
2
|
+
|
|
3
|
+
meta:
|
|
4
|
+
desc: Componente para controlar textos que separam conteúdos, formatando com um sufixo quando existe um contador.
|
|
5
|
+
|
|
6
|
+
props:
|
|
7
|
+
count:
|
|
8
|
+
desc: Contador que vai ficar ao lado do texto.
|
|
9
|
+
default: 0
|
|
10
|
+
type: Number
|
|
11
|
+
|
|
12
|
+
label:
|
|
13
|
+
desc: Texto a ser exibido.
|
|
14
|
+
type: String
|
|
15
|
+
|
|
16
|
+
margin:
|
|
17
|
+
desc: Espaçamento entre o texto e o contador.
|
|
18
|
+
default: sm
|
|
19
|
+
type: String
|
|
20
|
+
examples: [xs, sm, md, lg, xl]
|
|
21
|
+
|
|
22
|
+
slots:
|
|
23
|
+
default:
|
|
24
|
+
desc: Slot para acessar elemento do texto.
|
|
25
|
+
scope:
|
|
26
|
+
label-with-suffix:
|
|
27
|
+
desc: Objeto com texto formatado contendo ou não um sufixo
|
|
28
|
+
type: String
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<q-layout view="hHh Lpr lFf">
|
|
3
3
|
<slot name="app-bar">
|
|
4
|
-
<qas-app-bar v-bind="appBarProps"
|
|
4
|
+
<qas-app-bar v-bind="appBarProps" @toggle-menu="toggleMenuDrawer" />
|
|
5
5
|
</slot>
|
|
6
6
|
|
|
7
7
|
<slot name="app-menu">
|
|
8
|
-
<qas-app-menu v-model="menuDrawer" v-bind="defaultAppMenuProps"
|
|
8
|
+
<qas-app-menu v-model="menuDrawer" v-bind="defaultAppMenuProps" />
|
|
9
9
|
</slot>
|
|
10
10
|
|
|
11
11
|
<slot>
|
|
@@ -17,28 +17,18 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
|
-
import
|
|
21
|
-
import
|
|
20
|
+
import QasAppBar from '../app-bar/QasAppBar.vue'
|
|
21
|
+
import QasAppMenu from '../app-menu/QasAppMenu.vue'
|
|
22
22
|
|
|
23
23
|
export default {
|
|
24
24
|
name: 'QasLayout',
|
|
25
25
|
|
|
26
26
|
components: {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
QasAppBar,
|
|
28
|
+
QasAppMenu
|
|
29
29
|
},
|
|
30
30
|
|
|
31
31
|
props: {
|
|
32
|
-
value: {
|
|
33
|
-
default: true,
|
|
34
|
-
type: Boolean
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
appBarEvents: {
|
|
38
|
-
default: () => ({}),
|
|
39
|
-
type: Object
|
|
40
|
-
},
|
|
41
|
-
|
|
42
32
|
appBarProps: {
|
|
43
33
|
default: () => ({}),
|
|
44
34
|
type: Object
|
|
@@ -49,12 +39,14 @@ export default {
|
|
|
49
39
|
type: Object
|
|
50
40
|
},
|
|
51
41
|
|
|
52
|
-
|
|
53
|
-
default:
|
|
54
|
-
type:
|
|
42
|
+
modelValue: {
|
|
43
|
+
default: true,
|
|
44
|
+
type: Boolean
|
|
55
45
|
}
|
|
56
46
|
},
|
|
57
47
|
|
|
48
|
+
emits: ['update:modelValue'],
|
|
49
|
+
|
|
58
50
|
data () {
|
|
59
51
|
return {
|
|
60
52
|
menuDrawer: true
|
|
@@ -71,7 +63,7 @@ export default {
|
|
|
71
63
|
},
|
|
72
64
|
|
|
73
65
|
watch: {
|
|
74
|
-
|
|
66
|
+
modelValue: {
|
|
75
67
|
handler (value) {
|
|
76
68
|
this.menuDrawer = value
|
|
77
69
|
},
|
|
@@ -82,7 +74,7 @@ export default {
|
|
|
82
74
|
methods: {
|
|
83
75
|
toggleMenuDrawer () {
|
|
84
76
|
this.menuDrawer = !this.menuDrawer
|
|
85
|
-
this.$emit('
|
|
77
|
+
this.$emit('update:modelValue', this.menuDrawer)
|
|
86
78
|
}
|
|
87
79
|
}
|
|
88
80
|
}
|