@bildvitta/quasar-ui-asteroid 3.0.0-beta.2 → 3.0.0-beta.20
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/QasActionsMenu.json +15 -15
- package/dist/api/QasAppBar.json +4 -8
- package/dist/api/QasAppMenu.json +11 -7
- package/dist/api/QasBtn.json +8 -4
- package/dist/api/QasCard.json +17 -13
- package/dist/api/QasCheckboxGroup.json +8 -8
- package/dist/api/QasCopy.json +4 -4
- package/dist/api/QasDateTimeInput.json +16 -16
- package/dist/api/QasDelete.json +17 -17
- package/dist/api/QasDialog.json +24 -20
- package/dist/api/QasFilters.json +14 -14
- package/dist/api/QasFormGenerator.json +57 -26
- package/dist/api/QasFormView.json +115 -87
- package/dist/api/QasGallery.json +4 -4
- package/dist/api/QasGridGenerator.json +40 -39
- package/dist/api/QasInput.json +13 -13
- package/dist/api/QasListItems.json +18 -17
- package/dist/api/QasListView.json +67 -53
- package/dist/api/QasNestedFields.json +45 -35
- package/dist/api/QasNumericInput.json +31 -12
- package/dist/api/QasPageHeader.json +7 -7
- package/dist/api/QasPasswordInput.json +13 -13
- package/dist/api/QasPasswordStrengthChecker.json +12 -12
- package/dist/api/QasProfile.json +5 -5
- package/dist/api/QasResizer.json +11 -11
- package/dist/api/QasSearchBox.json +90 -8
- package/dist/api/QasSelect.json +92 -25
- package/dist/api/QasSelectList.json +16 -14
- package/dist/api/QasSignaturePad.json +1 -1
- package/dist/api/QasSignatureUploader.json +9 -9
- package/dist/api/QasSingleView.json +52 -43
- package/dist/api/QasSortable.json +20 -20
- package/dist/api/QasTableGenerator.json +5 -5
- package/dist/api/QasTabsGenerator.json +5 -2
- package/dist/api/QasTransfer.json +9 -9
- package/dist/api/QasUploader.json +22 -17
- package/dist/asteroid.cjs.css +1 -1
- package/dist/asteroid.cjs.js +3904 -3102
- package/dist/asteroid.cjs.min.js +2 -2
- package/dist/asteroid.esm.css +1 -1
- package/dist/asteroid.esm.js +3908 -3106
- package/dist/asteroid.esm.min.js +2 -2
- package/dist/asteroid.umd.css +1 -1
- package/dist/asteroid.umd.js +3907 -3106
- package/dist/asteroid.umd.min.js +2 -2
- package/dist/vetur/asteroid-attributes.json +387 -303
- package/dist/vetur/asteroid-tags.json +129 -108
- package/package.json +1 -1
- package/src/assets/gear.svg +27 -0
- package/src/components/actions/QasActions.vue +1 -5
- package/src/components/actions-menu/QasActionsMenu.vue +4 -10
- package/src/components/actions-menu/QasActionsMenu.yml +15 -15
- package/src/components/app-bar/QasAppBar.vue +18 -14
- package/src/components/app-bar/QasAppBar.yml +4 -8
- package/src/components/app-menu/QasAppMenu.vue +8 -7
- package/src/components/app-menu/QasAppMenu.yml +11 -7
- package/src/components/avatar/QasAvatar.vue +0 -4
- package/src/components/box/QasBox.vue +1 -1
- package/src/components/btn/QasBtn.vue +11 -15
- package/src/components/btn/QasBtn.yml +7 -3
- package/src/components/card/QasCard.vue +18 -9
- package/src/components/card/QasCard.yml +17 -13
- package/src/components/checkbox-group/QasCheckboxGroup.yml +9 -8
- package/src/components/copy/QasCopy.vue +1 -1
- package/src/components/copy/QasCopy.yml +4 -3
- package/src/components/date-time-input/QasDateTimeInput.vue +39 -41
- package/src/components/date-time-input/QasDateTimeInput.yml +16 -16
- package/src/components/delete/QasDelete.vue +15 -1
- package/src/components/delete/QasDelete.yml +15 -15
- package/src/components/dialog/QasDialog.vue +28 -9
- package/src/components/dialog/QasDialog.yml +22 -18
- package/src/components/dialog-router/QasDialogRouter.vue +1 -1
- package/src/components/field/QasField.vue +15 -14
- package/src/components/filters/QasFilters.vue +30 -13
- package/src/components/filters/QasFilters.yml +14 -14
- package/src/components/form-generator/QasFormGenerator.vue +87 -12
- package/src/components/form-generator/QasFormGenerator.yml +32 -18
- package/src/components/form-view/QasFormView.vue +142 -60
- package/src/components/form-view/QasFormView.yml +91 -67
- package/src/components/gallery/QasGallery.vue +4 -8
- package/src/components/gallery/QasGallery.yml +4 -4
- package/src/components/grid-generator/QasGridGenerator.vue +23 -7
- package/src/components/grid-generator/QasGridGenerator.yml +29 -27
- package/src/components/input/QasInput.vue +37 -21
- package/src/components/input/QasInput.yml +13 -13
- package/src/components/layout/QasLayout.vue +4 -0
- package/src/components/list-items/QasListItems.vue +16 -24
- package/src/components/list-items/QasListItems.yml +14 -15
- package/src/components/list-view/QasListView.vue +48 -20
- package/src/components/list-view/QasListView.yml +58 -46
- package/src/components/map/QasMap.vue +5 -5
- package/src/components/nested-fields/QasNestedFields.vue +29 -21
- package/src/components/nested-fields/QasNestedFields.yml +35 -28
- package/src/components/numeric-input/QasNumericInput.vue +45 -27
- package/src/components/numeric-input/QasNumericInput.yml +26 -12
- package/src/components/page-header/QasPageHeader.vue +14 -11
- package/src/components/page-header/QasPageHeader.yml +4 -4
- package/src/components/password-input/QasPasswordInput.vue +17 -16
- package/src/components/password-input/QasPasswordInput.yml +11 -11
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.yml +10 -10
- package/src/components/profile/QasProfile.vue +3 -6
- package/src/components/profile/QasProfile.yml +5 -5
- package/src/components/resizer/QasResizer.vue +1 -1
- package/src/components/resizer/QasResizer.yml +6 -5
- package/src/components/search-box/QasSearchBox.vue +138 -42
- package/src/components/search-box/QasSearchBox.yml +74 -7
- package/src/components/select/QasSelect.vue +63 -53
- package/src/components/select/QasSelect.yml +68 -17
- package/src/components/select-list/QasSelectList.vue +13 -32
- package/src/components/select-list/QasSelectList.yml +13 -14
- package/src/components/signature-pad/QasSignaturePad.vue +1 -1
- package/src/components/signature-pad/QasSignaturePad.yml +1 -1
- package/src/components/signature-uploader/QasSignatureUploader.vue +13 -14
- package/src/components/signature-uploader/QasSignatureUploader.yml +9 -9
- package/src/components/single-view/QasSingleView.vue +24 -8
- package/src/components/single-view/QasSingleView.yml +45 -38
- package/src/components/sortable/QasSortable.yml +17 -17
- package/src/components/table-generator/QasTableGenerator.vue +14 -6
- package/src/components/table-generator/QasTableGenerator.yml +5 -5
- package/src/components/tabs-generator/QasTabsGenerator.vue +2 -2
- package/src/components/tabs-generator/QasTabsGenerator.yml +2 -2
- package/src/components/text-truncate/QasTextTruncate.vue +2 -5
- package/src/components/transfer/QasTransfer.vue +5 -7
- package/src/components/transfer/QasTransfer.yml +9 -9
- package/src/components/uploader/QasUploader.vue +63 -16
- package/src/components/uploader/QasUploader.yml +17 -12
- package/src/composables/index.js +1 -1
- package/src/composables/{useHistory.js → use-history.js} +0 -0
- package/src/css/components/base.scss +3 -0
- package/src/css/components/field.scss +4 -0
- package/src/css/components/index.scss +4 -0
- package/src/css/components/radio.scss +3 -0
- package/src/css/components/tabs.scss +3 -0
- package/src/css/mixins/index.scss +1 -0
- package/src/css/{set-brand.scss → mixins/set-brand.scss} +0 -0
- package/src/css/{background.scss → utils/background.scss} +0 -0
- package/src/css/{border-radius.scss → utils/border-radius.scss} +0 -0
- package/src/css/{border.scss → utils/border.scss} +0 -0
- package/src/css/{container.scss → utils/container.scss} +0 -0
- package/src/css/{fonts.scss → utils/fonts.scss} +0 -0
- package/src/css/utils/index.scss +9 -0
- package/src/css/{line-height.scss → utils/line-height.scss} +0 -0
- package/src/css/{opacity.scss → utils/opacity.scss} +0 -0
- package/src/css/{text.scss → utils/text.scss} +0 -0
- package/src/css/{unset.scss → utils/unset.scss} +0 -0
- package/src/css/variables/button.scss +3 -0
- package/src/css/variables/index.scss +3 -0
- package/src/css/variables/shadow.scss +33 -0
- package/src/css/variables/typography.scss +139 -0
- package/src/helpers/camelize-fields-name.js +15 -0
- package/src/helpers/filters.js +2 -0
- package/src/helpers/get-normalized-options.js +20 -0
- package/src/helpers/handle-process.js +13 -0
- package/src/helpers/index.js +3 -0
- package/src/index.scss +11 -12
- package/src/mixins/generator.js +10 -2
- package/src/mixins/index.js +3 -3
- package/src/mixins/search-filter.js +227 -0
- package/src/mixins/view.js +35 -13
- package/src/pages/ErrorComponent.vue +56 -0
- package/src/pages/Forbidden.vue +21 -5
- package/src/pages/NotFound.vue +21 -5
- package/src/pages/ServerError.vue +25 -0
- package/src/pages/Unauthorized.vue +28 -0
- package/src/plugins/index.js +4 -2
- package/src/plugins/logger/Logger.js +44 -0
- package/src/plugins/logger/Logger.yml +9 -0
- package/src/plugins/screen/Screen.js +5 -0
- package/src/vue-plugin.js +6 -3
- package/src/assets/logo-modular.svg +0 -1
- package/src/css/design-system.scss +0 -18
- package/src/css/shadow.scss +0 -7
- package/src/mixins/screen.js +0 -34
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
<template #description>
|
|
20
|
-
<q-carousel v-model="imageIndex" animated :arrows="
|
|
20
|
+
<q-carousel v-model="imageIndex" animated :arrows="!$qas.screen.isSmall" control-text-color="primary" :fullscreen="$qas.screen.isSmall" :height="carouselImageHeight" :next-icon="carouselNextIcon" :prev-icon="carouselPreviousIcon" swipeable :thumbnails="showThumbnails">
|
|
21
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="
|
|
22
|
+
<div v-if="$qas.screen.isSmall" class="full-width justify-end row">
|
|
23
23
|
<qas-btn dense flat icon="o_close" @click="toggleCarouselDialog" />
|
|
24
24
|
</div>
|
|
25
25
|
</q-carousel-slide>
|
|
@@ -31,13 +31,9 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script>
|
|
34
|
-
import screenMixin from '../../mixins/screen'
|
|
35
|
-
|
|
36
34
|
export default {
|
|
37
35
|
name: 'QasGallery',
|
|
38
36
|
|
|
39
|
-
mixins: [screenMixin],
|
|
40
|
-
|
|
41
37
|
props: {
|
|
42
38
|
carouselNextIcon: {
|
|
43
39
|
type: String,
|
|
@@ -94,13 +90,13 @@ export default {
|
|
|
94
90
|
return this.height || 'auto'
|
|
95
91
|
}
|
|
96
92
|
|
|
97
|
-
return this.
|
|
93
|
+
return this.$qas.screen.isSmall ? '90px' : '120px'
|
|
98
94
|
},
|
|
99
95
|
|
|
100
96
|
galleryColumnsClasses () {
|
|
101
97
|
if (this.isSingleImage) return 'col-12'
|
|
102
98
|
|
|
103
|
-
return this.
|
|
99
|
+
return this.$qas.screen.isSmall ? 'col-6' : 'col-2'
|
|
104
100
|
},
|
|
105
101
|
|
|
106
102
|
hideShowMore () {
|
|
@@ -22,13 +22,13 @@ props:
|
|
|
22
22
|
desc: Altura da imagem (fora do dialog).
|
|
23
23
|
type: String
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
desc:
|
|
25
|
+
images:
|
|
26
|
+
desc: Imagens a serem exibidas.
|
|
27
27
|
default: 6
|
|
28
28
|
type: Number
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
desc:
|
|
30
|
+
initial-size:
|
|
31
|
+
desc: Quantidade de imagens iniciais.
|
|
32
32
|
default: 6
|
|
33
33
|
type: Number
|
|
34
34
|
|
|
@@ -36,10 +36,6 @@ export default {
|
|
|
36
36
|
type: [Array, Object, String]
|
|
37
37
|
},
|
|
38
38
|
|
|
39
|
-
hideEmptyResult: {
|
|
40
|
-
type: Boolean
|
|
41
|
-
},
|
|
42
|
-
|
|
43
39
|
emptyResultText: {
|
|
44
40
|
default: '-',
|
|
45
41
|
type: String
|
|
@@ -48,6 +44,11 @@ export default {
|
|
|
48
44
|
result: {
|
|
49
45
|
default: () => ({}),
|
|
50
46
|
type: Object
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
useEmptyResult: {
|
|
50
|
+
default: true,
|
|
51
|
+
type: Boolean
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
54
|
|
|
@@ -59,7 +60,12 @@ export default {
|
|
|
59
60
|
|
|
60
61
|
computed: {
|
|
61
62
|
formattedFields () {
|
|
62
|
-
if (
|
|
63
|
+
if (this.useEmptyResult) {
|
|
64
|
+
this.$qas.logger.group(
|
|
65
|
+
'QasGridGenerator - formattedFields -> this.useEmptyResult tem valor "true"',
|
|
66
|
+
[this.fields]
|
|
67
|
+
)
|
|
68
|
+
|
|
63
69
|
return this.fields
|
|
64
70
|
}
|
|
65
71
|
|
|
@@ -77,6 +83,8 @@ export default {
|
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
|
|
86
|
+
this.$qas.logger.group('QasGridGenerator - formattedFields', [fields])
|
|
87
|
+
|
|
80
88
|
return fields
|
|
81
89
|
},
|
|
82
90
|
|
|
@@ -92,11 +100,19 @@ export default {
|
|
|
92
100
|
|
|
93
101
|
for (const key in result) {
|
|
94
102
|
if (this.formattedFields[key]?.type) {
|
|
95
|
-
formattedResult[key] =
|
|
96
|
-
|
|
103
|
+
formattedResult[key] = (
|
|
104
|
+
humanize(this.formattedFields[key], result[key]) || this.emptyResultText
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
this.slotValue[key] = {
|
|
108
|
+
...this.formattedFields[key],
|
|
109
|
+
formattedResult: formattedResult[key]
|
|
110
|
+
}
|
|
97
111
|
}
|
|
98
112
|
}
|
|
99
113
|
|
|
114
|
+
this.$qas.logger.group('QasGridGenerator - getResultsByFields', [formattedResult])
|
|
115
|
+
|
|
100
116
|
return formattedResult
|
|
101
117
|
}
|
|
102
118
|
}
|
|
@@ -4,70 +4,72 @@ meta:
|
|
|
4
4
|
desc: Componente para criação de textos dinâmicos.
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
|
+
columns:
|
|
8
|
+
desc: Colunas do grid de cada campo.
|
|
9
|
+
default: col-6
|
|
10
|
+
type: [Array, String, Object]
|
|
11
|
+
examples: ["{ name: { sm: 6, md: 12 } }", "[{ sm: 6, md: 12 }]"]
|
|
12
|
+
|
|
7
13
|
content-class:
|
|
8
14
|
desc: Classe de cada "div" pai referente ao resultado.
|
|
9
15
|
default: ''
|
|
10
16
|
type: [Array, Object, String]
|
|
11
17
|
|
|
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
18
|
empty-result-text:
|
|
22
19
|
desc: Se o resultado de algum campo for vazio, esta prop define qual será o valor padrão.
|
|
23
20
|
default: '-'
|
|
24
21
|
type: String
|
|
25
22
|
|
|
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
23
|
fields:
|
|
33
24
|
desc: Lista de field contendo informações necessárias para a criação do campo correspondente.
|
|
34
25
|
default: {}
|
|
35
26
|
type: Object
|
|
36
27
|
examples: ["{ email: { name: 'email', type: 'email', label: 'E-mail' } }"]
|
|
37
28
|
|
|
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
29
|
gutter:
|
|
45
30
|
desc: Espaçamento entre colunas.
|
|
46
31
|
default: md
|
|
47
32
|
type: String
|
|
48
33
|
examples: [xs, sm, md, lg, xl]
|
|
49
34
|
|
|
35
|
+
header-class:
|
|
36
|
+
desc: Classe de cada "header" pai referente ao "label".
|
|
37
|
+
default: 'text-bold'
|
|
38
|
+
type: [Array, Object, String]
|
|
39
|
+
|
|
40
|
+
result:
|
|
41
|
+
desc: Resultado contendo todas informações para serem exibidas na tela.
|
|
42
|
+
default: {}
|
|
43
|
+
type: Object
|
|
44
|
+
examples: ["{ 'joah@examples.com' }"]
|
|
45
|
+
|
|
46
|
+
use-empty-result:
|
|
47
|
+
desc: Se o resultado de algum campo for vazio e esta propriedade for "false", ele remove todo o campo.
|
|
48
|
+
default: true
|
|
49
|
+
type: Boolean
|
|
50
|
+
|
|
50
51
|
slots:
|
|
51
|
-
|
|
52
|
-
desc: Slot para
|
|
52
|
+
content:
|
|
53
|
+
desc: Slot para o conteúdo (content).
|
|
53
54
|
scope:
|
|
54
55
|
field:
|
|
55
56
|
desc: Conteúdo do field atual mais o resultado formatado.
|
|
56
57
|
default: {}
|
|
57
58
|
type: Object
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
desc: Slot para o header.
|
|
60
|
+
'field-[nome-da-chave]':
|
|
61
|
+
desc: Slot para todo o conteúdo dentro de cada grid (header e content).
|
|
61
62
|
scope:
|
|
62
63
|
field:
|
|
63
64
|
desc: Conteúdo do field atual mais o resultado formatado.
|
|
64
65
|
default: {}
|
|
65
66
|
type: Object
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
desc: Slot para o
|
|
68
|
+
header:
|
|
69
|
+
desc: Slot para o header.
|
|
69
70
|
scope:
|
|
70
71
|
field:
|
|
71
72
|
desc: Conteúdo do field atual mais o resultado formatado.
|
|
72
73
|
default: {}
|
|
73
74
|
type: Object
|
|
75
|
+
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</q-input>
|
|
8
|
-
</div>
|
|
2
|
+
<q-input ref="input" v-model="model" bottom-slots :error="errorData" v-bind="$attrs" :error-message="errorMessageData" :mask="mask" :outlined="outlined" :unmasked-value="unmaskedValue" @paste="onPaste">
|
|
3
|
+
<template v-for="(_, name) in $slots" #[name]="context">
|
|
4
|
+
<slot :name="name" v-bind="context || {}" />
|
|
5
|
+
</template>
|
|
6
|
+
</q-input>
|
|
9
7
|
</template>
|
|
10
8
|
|
|
11
9
|
<script>
|
|
@@ -15,32 +13,32 @@ export default {
|
|
|
15
13
|
inheritAttrs: false,
|
|
16
14
|
|
|
17
15
|
props: {
|
|
16
|
+
error: {
|
|
17
|
+
type: Boolean
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
errorMessage: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ''
|
|
23
|
+
},
|
|
24
|
+
|
|
18
25
|
modelValue: {
|
|
19
26
|
default: '',
|
|
20
27
|
type: [String, Number]
|
|
21
28
|
},
|
|
22
29
|
|
|
23
|
-
unmaskedValue: {
|
|
24
|
-
default: true,
|
|
25
|
-
type: Boolean
|
|
26
|
-
},
|
|
27
|
-
|
|
28
30
|
outlined: {
|
|
29
31
|
default: true,
|
|
30
32
|
type: Boolean
|
|
31
33
|
},
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
unmaskedValue: {
|
|
36
|
+
default: true,
|
|
34
37
|
type: Boolean
|
|
35
38
|
},
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
useRemoveErrorOnType: {
|
|
38
41
|
type: Boolean
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
errorMessage: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: ''
|
|
44
42
|
}
|
|
45
43
|
},
|
|
46
44
|
|
|
@@ -85,7 +83,7 @@ export default {
|
|
|
85
83
|
},
|
|
86
84
|
|
|
87
85
|
set (value) {
|
|
88
|
-
if (this.
|
|
86
|
+
if (this.useRemoveErrorOnType && this.error) {
|
|
89
87
|
this.errorData = false
|
|
90
88
|
this.errorMessageData = ''
|
|
91
89
|
}
|
|
@@ -97,7 +95,7 @@ export default {
|
|
|
97
95
|
|
|
98
96
|
watch: {
|
|
99
97
|
mask () {
|
|
100
|
-
const input = this.
|
|
98
|
+
const input = this.getInput()
|
|
101
99
|
|
|
102
100
|
requestAnimationFrame(() => {
|
|
103
101
|
input.selectionStart = input.value ? input.value.length : ''
|
|
@@ -131,12 +129,30 @@ export default {
|
|
|
131
129
|
},
|
|
132
130
|
|
|
133
131
|
toggleMask (first, second) {
|
|
132
|
+
if (!this.modelValue?.length) return
|
|
133
|
+
|
|
134
134
|
const length = first.split('#').length - 2
|
|
135
135
|
return this.modelValue?.length > length ? second : first
|
|
136
136
|
},
|
|
137
137
|
|
|
138
138
|
validate (value) {
|
|
139
139
|
return this.inputReference.validate(value)
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
onPaste (event) {
|
|
143
|
+
if (!this.mask) return
|
|
144
|
+
|
|
145
|
+
const value = event.clipboardData.getData('text')
|
|
146
|
+
const input = this.getInput()
|
|
147
|
+
|
|
148
|
+
requestAnimationFrame(() => {
|
|
149
|
+
this.$emit('update:modelValue', value)
|
|
150
|
+
input.selectionStart = input.value ? input.value.length : ''
|
|
151
|
+
})
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
getInput () {
|
|
155
|
+
return this.inputReference.$el?.querySelector('input')
|
|
140
156
|
}
|
|
141
157
|
}
|
|
142
158
|
}
|
|
@@ -7,32 +7,32 @@ meta:
|
|
|
7
7
|
desc: Componente para input que implementa o "QInput" repassando propriedades, slots e eventos.
|
|
8
8
|
|
|
9
9
|
props:
|
|
10
|
+
error-message:
|
|
11
|
+
desc: Controla mensagem de erro (apenas quando "error" for "true").
|
|
12
|
+
type: String
|
|
13
|
+
|
|
14
|
+
error:
|
|
15
|
+
desc: Controla cor da borda do input.
|
|
16
|
+
type: Boolean
|
|
17
|
+
|
|
10
18
|
model-value:
|
|
11
19
|
desc: Model do componente.
|
|
12
20
|
type: [String, Input]
|
|
13
21
|
examples: [v-model="value"]
|
|
14
22
|
model: true
|
|
15
23
|
|
|
16
|
-
unmasked-value:
|
|
17
|
-
desc: Remove a mascara do v-model.
|
|
18
|
-
default: true
|
|
19
|
-
type: Boolean
|
|
20
|
-
|
|
21
24
|
outlined:
|
|
22
25
|
desc: Controla borda do input.
|
|
23
26
|
default: true
|
|
24
27
|
type: Boolean
|
|
25
28
|
|
|
26
|
-
error:
|
|
27
|
-
desc:
|
|
29
|
+
use-remove-error-on-type:
|
|
30
|
+
desc: Limpa os erros do campo caso os mesmos existam toda vez que o model atualiza.
|
|
28
31
|
type: Boolean
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
desc:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
remove-error-on-type:
|
|
35
|
-
desc: Limpa os erros do campo caso os mesmos existam toda vez que o model atualiza.
|
|
33
|
+
unmasked-value:
|
|
34
|
+
desc: Remove a mascara do v-model.
|
|
35
|
+
default: true
|
|
36
36
|
type: Boolean
|
|
37
37
|
|
|
38
38
|
events:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="qas-list-items shadow-
|
|
2
|
+
<div class="qas-list-items shadow-14">
|
|
3
3
|
<q-list bordered class="rounded-borders" separator>
|
|
4
|
-
<q-item v-for="(item, index) in list" :key="index" v-ripple :clickable="
|
|
4
|
+
<q-item v-for="(item, index) in list" :key="index" v-ripple :clickable="useClickableItem" @click="onClick({ item, index }, true)">
|
|
5
5
|
<slot :index="index" :item="item" name="item">
|
|
6
6
|
<q-item-section>
|
|
7
|
-
<slot :index="index" :item="item" name="item-section
|
|
7
|
+
<slot :index="index" :item="item" name="item-section" />
|
|
8
8
|
</q-item-section>
|
|
9
9
|
|
|
10
10
|
<q-item-section v-if="useSectionActions" side>
|
|
11
11
|
<slot :index="index" :item="item" name="item-section-side">
|
|
12
|
-
<qas-btn flat round
|
|
12
|
+
<qas-btn flat round @click="onClick({ item, index })">
|
|
13
13
|
<q-icon v-bind="iconProps" />
|
|
14
14
|
</qas-btn>
|
|
15
15
|
</slot>
|
|
@@ -41,37 +41,29 @@ export default {
|
|
|
41
41
|
type: Array
|
|
42
42
|
},
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
default: 'uuid',
|
|
46
|
-
type: String
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
redirectOnIcon: {
|
|
50
|
-
default: true,
|
|
44
|
+
useClickableItem: {
|
|
51
45
|
type: Boolean
|
|
52
46
|
},
|
|
53
47
|
|
|
54
|
-
to: {
|
|
55
|
-
default: () => ({}),
|
|
56
|
-
type: Object
|
|
57
|
-
},
|
|
58
|
-
|
|
59
48
|
useSectionActions: {
|
|
60
49
|
default: true,
|
|
61
50
|
type: Boolean
|
|
62
51
|
}
|
|
63
52
|
},
|
|
64
53
|
|
|
54
|
+
emits: ['click-item'],
|
|
55
|
+
|
|
65
56
|
methods: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
onClick ({ item, index }, fromItem) {
|
|
58
|
+
/**
|
|
59
|
+
* se o click veio do q-item e "useClickableItem" for "false", ou
|
|
60
|
+
* se o click não veio do q-item e "useClickableItem" for "true", então retorna sem emitir.
|
|
61
|
+
*/
|
|
62
|
+
if (
|
|
63
|
+
(fromItem && !this.useClickableItem) || (!fromItem && this.useClickableItem)
|
|
64
|
+
) return
|
|
72
65
|
|
|
73
|
-
|
|
74
|
-
return this.redirectOnIcon ? undefined : this.getRedirectPayload(item)
|
|
66
|
+
this.$emit('click-item', { item, index })
|
|
75
67
|
}
|
|
76
68
|
}
|
|
77
69
|
}
|
|
@@ -14,29 +14,17 @@ props:
|
|
|
14
14
|
default: []
|
|
15
15
|
type: Array
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
desc:
|
|
19
|
-
default: uuid
|
|
20
|
-
type: String
|
|
21
|
-
|
|
22
|
-
redirect-on-icon:
|
|
23
|
-
desc: Controla se o redirecionamento vai acontecer quando clicar no item inteiro ou somente no icon.
|
|
24
|
-
default: true
|
|
17
|
+
use-clickable-item:
|
|
18
|
+
desc: Controla se o item inteiro é clicável ou somente o button dentro do item.
|
|
25
19
|
type: Boolean
|
|
26
20
|
|
|
27
|
-
to:
|
|
28
|
-
desc: Configuração passada para o vue-router.
|
|
29
|
-
default: {}
|
|
30
|
-
type: Object
|
|
31
|
-
examples: ["{ name: 'Root' }"]
|
|
32
|
-
|
|
33
21
|
use-section-actions:
|
|
34
22
|
desc: Controla se exibe ou não seção de actions, onde fica o Ícone de redirecionamento.
|
|
35
23
|
default: true
|
|
36
24
|
type: Boolean
|
|
37
25
|
|
|
38
26
|
slots:
|
|
39
|
-
item-section
|
|
27
|
+
item-section:
|
|
40
28
|
desc: Slot para acessar seção da esquerda.
|
|
41
29
|
scope:
|
|
42
30
|
item:
|
|
@@ -55,3 +43,14 @@ slots:
|
|
|
55
43
|
index:
|
|
56
44
|
desc: Posição do item na lista.
|
|
57
45
|
type: Number
|
|
46
|
+
|
|
47
|
+
events:
|
|
48
|
+
'@click-item -> function ({ item, index })':
|
|
49
|
+
desc: Dispara toda vez que o item ou button (dependendo da prop "use-section-actions") é clicado.
|
|
50
|
+
params:
|
|
51
|
+
item:
|
|
52
|
+
desc: Item clicado
|
|
53
|
+
type: Object
|
|
54
|
+
index:
|
|
55
|
+
desc: Posição do item
|
|
56
|
+
type: Number
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component :is="mx_componentTag" :class="mx_componentClass">
|
|
3
|
-
<q-pull-to-refresh :disable="
|
|
3
|
+
<q-pull-to-refresh :disable="!useRefresh" @refresh="refresh">
|
|
4
4
|
<header v-if="hasHeaderSlot">
|
|
5
5
|
<slot name="header" />
|
|
6
6
|
</header>
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
</slot>
|
|
11
11
|
|
|
12
12
|
<main class="relative-position">
|
|
13
|
-
<div v-if="
|
|
13
|
+
<div v-if="showResults">
|
|
14
14
|
<slot />
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
<div v-else-if="!mx_isFetching">
|
|
18
18
|
<slot name="empty-results">
|
|
19
19
|
<div class="q-my-xl text-center">
|
|
20
|
-
<q-icon class="q-mb-sm text-center" color="grey-
|
|
21
|
-
<div class="text-grey-
|
|
20
|
+
<q-icon class="q-mb-sm text-center" color="grey-7" name="o_search" size="38px" />
|
|
21
|
+
<div class="text-grey-7">Nenhum item encontrado.</div>
|
|
22
22
|
</div>
|
|
23
23
|
</slot>
|
|
24
24
|
</div>
|
|
@@ -54,15 +54,6 @@ export default {
|
|
|
54
54
|
mixins: [contextMixin, viewMixin],
|
|
55
55
|
|
|
56
56
|
props: {
|
|
57
|
-
disableRefresh: {
|
|
58
|
-
type: Boolean
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
useFilter: {
|
|
62
|
-
default: true,
|
|
63
|
-
type: Boolean
|
|
64
|
-
},
|
|
65
|
-
|
|
66
57
|
filtersProps: {
|
|
67
58
|
default: () => ({}),
|
|
68
59
|
type: Object
|
|
@@ -71,6 +62,20 @@ export default {
|
|
|
71
62
|
results: {
|
|
72
63
|
default: () => [],
|
|
73
64
|
type: Array
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
useRefresh: {
|
|
68
|
+
default: true,
|
|
69
|
+
type: Boolean
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
useFilter: {
|
|
73
|
+
default: true,
|
|
74
|
+
type: Boolean
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
useResultsAreaOnly: {
|
|
78
|
+
type: Boolean
|
|
74
79
|
}
|
|
75
80
|
},
|
|
76
81
|
|
|
@@ -106,13 +111,17 @@ export default {
|
|
|
106
111
|
|
|
107
112
|
totalPages () {
|
|
108
113
|
return this.$store.getters[`${this.entity}/totalPages`]
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
showResults () {
|
|
117
|
+
return this.hasResults || this.useResultsAreaOnly
|
|
109
118
|
}
|
|
110
119
|
},
|
|
111
120
|
|
|
112
121
|
watch: {
|
|
113
122
|
$route (to, from) {
|
|
114
123
|
if (to.name === from.name) {
|
|
115
|
-
this.fetchList
|
|
124
|
+
this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList)
|
|
116
125
|
this.setCurrentPage()
|
|
117
126
|
}
|
|
118
127
|
},
|
|
@@ -121,12 +130,14 @@ export default {
|
|
|
121
130
|
handler (value) {
|
|
122
131
|
this.$emit('update:results', extend([], true, value))
|
|
123
132
|
},
|
|
133
|
+
deep: true,
|
|
124
134
|
immediate: true
|
|
125
135
|
}
|
|
126
136
|
},
|
|
127
137
|
|
|
128
138
|
created () {
|
|
129
|
-
this.fetchList
|
|
139
|
+
this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList)
|
|
140
|
+
|
|
130
141
|
this.setCurrentPage()
|
|
131
142
|
},
|
|
132
143
|
|
|
@@ -136,15 +147,22 @@ export default {
|
|
|
136
147
|
this.$router.push({ query })
|
|
137
148
|
},
|
|
138
149
|
|
|
139
|
-
async fetchList (
|
|
150
|
+
async fetchList (externalPayload = {}) {
|
|
140
151
|
this.mx_isFetching = true
|
|
141
152
|
|
|
142
153
|
try {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
154
|
+
const payload = {
|
|
155
|
+
...this.mx_context,
|
|
156
|
+
url: this.url,
|
|
157
|
+
...externalPayload
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
this.$qas.logger.group(
|
|
161
|
+
`QasListView - fetchList -> Payload do parâmetro do ${this.entity}/fetchList`, [payload]
|
|
146
162
|
)
|
|
147
163
|
|
|
164
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchList`, payload)
|
|
165
|
+
|
|
148
166
|
const { errors, fields, metadata } = response.data
|
|
149
167
|
|
|
150
168
|
this.mx_setErrors(errors)
|
|
@@ -158,17 +176,27 @@ export default {
|
|
|
158
176
|
})
|
|
159
177
|
|
|
160
178
|
this.$emit('fetch-success', response)
|
|
179
|
+
|
|
180
|
+
this.$qas.logger.group(
|
|
181
|
+
`QasListView - fetchList -> resposta da action ${this.entity}/fetchList`, [response]
|
|
182
|
+
)
|
|
161
183
|
} catch (error) {
|
|
162
184
|
this.mx_fetchError(error)
|
|
163
185
|
this.$emit('update:errors', error)
|
|
164
186
|
this.$emit('fetch-error', error)
|
|
187
|
+
|
|
188
|
+
this.$qas.logger.group(
|
|
189
|
+
`QasListView - fetchSingle -> exceção da action ${this.entity}/fetchList`,
|
|
190
|
+
[error],
|
|
191
|
+
{ error: true }
|
|
192
|
+
)
|
|
165
193
|
} finally {
|
|
166
194
|
this.mx_isFetching = false
|
|
167
195
|
}
|
|
168
196
|
},
|
|
169
197
|
|
|
170
198
|
async refresh (done) {
|
|
171
|
-
await this.fetchList
|
|
199
|
+
await this.mx_fetchHandler({ ...this.mx_context, url: this.url }, this.fetchList)
|
|
172
200
|
|
|
173
201
|
if (typeof done === 'function') {
|
|
174
202
|
done()
|