@bildvitta/quasar-ui-asteroid 3.17.0 → 3.18.0-beta.0
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/components/badge/QasBadge.vue +1 -1
- package/src/components/checkbox/QasCheckbox.vue +12 -29
- package/src/components/error-message/QasErrorMessage.vue +23 -0
- package/src/components/error-message/QasErrorMessage.yml +9 -0
- package/src/components/expansion-item/QasExpansionItem.vue +14 -16
- package/src/components/input/QasInput.vue +3 -3
- package/src/components/label/QasLabel.vue +1 -1
- package/src/components/radio/QasRadio.vue +15 -2
- package/src/components/radio/QasRadio.yml +8 -1
- package/src/components/search-input/QasSearchInput.vue +14 -29
- package/src/components/select/QasSelect.vue +10 -22
- package/src/components/select-filter/QasSelectFilter.vue +1 -1
- package/src/components/table-generator/QasTableGenerator.vue +10 -5
- package/src/components/table-generator/QasTableGenerator.yml +9 -4
- package/src/components/uploader/QasUploader.vue +7 -14
- package/src/composables/private/index.js +3 -2
- package/src/composables/private/use-error-message.js +25 -0
- package/src/css/components/field.scss +68 -1
- package/src/css/mixins/index.scss +1 -0
- package/src/css/mixins/set-error-message.scss +8 -0
- package/src/vue-plugin.js +3 -0
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<!-- Group -->
|
|
9
9
|
<div v-else>
|
|
10
|
-
<div v-if="
|
|
10
|
+
<div v-if="props.label" class="q-mb-sm text-body1" :class="labelClasses">
|
|
11
11
|
{{ formattedLabel }}
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
|
-
<
|
|
29
|
-
{{ props.errorMessage }}
|
|
30
|
-
</div>
|
|
28
|
+
<qas-error-message v-if="props.errorMessage" :message="props.errorMessage" />
|
|
31
29
|
</div>
|
|
32
30
|
</template>
|
|
33
31
|
|
|
34
32
|
<script setup>
|
|
33
|
+
import useErrorMessage, { baseErrorProps } from '../../composables/private/use-error-message'
|
|
35
34
|
import { getRequiredLabel } from '../../helpers'
|
|
35
|
+
|
|
36
36
|
import { watch, computed, ref, onMounted, useAttrs } from 'vue'
|
|
37
37
|
|
|
38
38
|
defineOptions({
|
|
@@ -41,6 +41,8 @@ defineOptions({
|
|
|
41
41
|
})
|
|
42
42
|
|
|
43
43
|
const props = defineProps({
|
|
44
|
+
...baseErrorProps,
|
|
45
|
+
|
|
44
46
|
label: {
|
|
45
47
|
default: '',
|
|
46
48
|
type: String
|
|
@@ -61,35 +63,29 @@ const props = defineProps({
|
|
|
61
63
|
type: Boolean
|
|
62
64
|
},
|
|
63
65
|
|
|
64
|
-
errorMessage: {
|
|
65
|
-
type: String,
|
|
66
|
-
default: ''
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
error: {
|
|
70
|
-
type: Boolean
|
|
71
|
-
},
|
|
72
|
-
|
|
73
66
|
required: {
|
|
74
67
|
type: Boolean
|
|
75
68
|
}
|
|
76
69
|
})
|
|
77
70
|
|
|
71
|
+
// emits
|
|
78
72
|
const emit = defineEmits(['update:modelValue'])
|
|
79
73
|
|
|
74
|
+
// globals
|
|
80
75
|
const attrs = useAttrs()
|
|
81
76
|
|
|
77
|
+
// composables
|
|
78
|
+
const { labelClasses } = useErrorMessage(props)
|
|
79
|
+
|
|
82
80
|
// refs
|
|
83
81
|
const group = ref({})
|
|
84
82
|
|
|
85
|
-
//
|
|
83
|
+
// hooks
|
|
86
84
|
onMounted(handleParent)
|
|
87
85
|
|
|
88
86
|
// computed
|
|
89
87
|
const classes = computed(() => props.inline && 'flex q-gutter-x-sm')
|
|
90
88
|
|
|
91
|
-
const hasCheckboxLabel = computed(() => !!props.label)
|
|
92
|
-
|
|
93
89
|
const model = computed({
|
|
94
90
|
get () {
|
|
95
91
|
return props.modelValue
|
|
@@ -110,10 +106,6 @@ const singleAttributes = computed(() => {
|
|
|
110
106
|
}
|
|
111
107
|
})
|
|
112
108
|
|
|
113
|
-
const checkboxLabelClasses = computed(() => {
|
|
114
|
-
return { 'text-negative': props.error }
|
|
115
|
-
})
|
|
116
|
-
|
|
117
109
|
const formattedLabel = computed(() => {
|
|
118
110
|
return getRequiredLabel({ label: props.label, required: props.required })
|
|
119
111
|
})
|
|
@@ -174,12 +166,3 @@ function getModelValue (index) {
|
|
|
174
166
|
return group.value[index]
|
|
175
167
|
}
|
|
176
168
|
</script>
|
|
177
|
-
|
|
178
|
-
<style lang="scss">
|
|
179
|
-
.qas-checkbox {
|
|
180
|
-
&__error-message {
|
|
181
|
-
// Tamanho da fonte utilizada nos errors no q-field.
|
|
182
|
-
font-size: 11px;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="qas-error-message">
|
|
3
|
+
{{ props.message }}
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
defineOptions({ name: 'QasErrorMessage' })
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
message: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ''
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style lang="scss">
|
|
19
|
+
// $
|
|
20
|
+
.qas-error-message {
|
|
21
|
+
@include set-error-message;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
</q-expansion-item>
|
|
37
37
|
</qas-box>
|
|
38
38
|
|
|
39
|
-
<
|
|
40
|
-
{{ props.errorMessage }}
|
|
41
|
-
</div>
|
|
39
|
+
<qas-error-message v-if="hasError" :message="props.errorMessage" />
|
|
42
40
|
</div>
|
|
43
41
|
</template>
|
|
44
42
|
|
|
45
43
|
<script setup>
|
|
46
44
|
import QasBox from '../box/QasBox.vue'
|
|
47
45
|
|
|
46
|
+
import { baseErrorProps } from '../../composables/private/use-error-message'
|
|
47
|
+
|
|
48
48
|
import { computed, provide, inject, ref, useAttrs } from 'vue'
|
|
49
49
|
|
|
50
50
|
defineOptions({
|
|
@@ -53,6 +53,8 @@ defineOptions({
|
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
const props = defineProps({
|
|
56
|
+
...baseErrorProps,
|
|
57
|
+
|
|
56
58
|
badges: {
|
|
57
59
|
type: Array,
|
|
58
60
|
default: () => []
|
|
@@ -66,15 +68,6 @@ const props = defineProps({
|
|
|
66
68
|
type: Boolean
|
|
67
69
|
},
|
|
68
70
|
|
|
69
|
-
error: {
|
|
70
|
-
type: Boolean
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
errorMessage: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: ''
|
|
76
|
-
},
|
|
77
|
-
|
|
78
71
|
gridGeneratorProps: {
|
|
79
72
|
type: Object,
|
|
80
73
|
default: () => ({})
|
|
@@ -205,12 +198,17 @@ function setShowContent () {
|
|
|
205
198
|
}
|
|
206
199
|
|
|
207
200
|
&--error {
|
|
208
|
-
#{$root}
|
|
209
|
-
|
|
201
|
+
#{$root}__header {
|
|
202
|
+
color: $negative;
|
|
203
|
+
|
|
204
|
+
.qas-label,
|
|
205
|
+
.qas-btn {
|
|
206
|
+
color: $negative !important;
|
|
207
|
+
}
|
|
210
208
|
}
|
|
211
209
|
|
|
212
|
-
#{$root}
|
|
213
|
-
|
|
210
|
+
#{$root}__box {
|
|
211
|
+
border: 1px solid $negative !important;
|
|
214
212
|
}
|
|
215
213
|
}
|
|
216
214
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<q-input ref="input" v-model="model" :autogrow="isTextarea" bottom-slots :class="classes" :counter="hasCounter" :dense="dense" :error="errorData" v-bind="$attrs" :error-message="errorMessage" :inputmode="defaultInputmode" :label="formattedLabel" :mask="currentMask" no-error-icon :outlined="outlined" :placeholder="placeholder" :unmasked-value="unmaskedValue" @paste="onPaste">
|
|
3
|
-
<template v-if="icon" #
|
|
3
|
+
<template v-if="icon" #prepend>
|
|
4
4
|
<q-icon :name="icon" size="xs" />
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
|
-
<template v-if="iconRight" #
|
|
7
|
+
<template v-if="iconRight" #append>
|
|
8
8
|
<q-icon :name="iconRight" size="xs" />
|
|
9
9
|
</template>
|
|
10
10
|
|
|
@@ -163,7 +163,7 @@ export default {
|
|
|
163
163
|
},
|
|
164
164
|
|
|
165
165
|
hasPrepend () {
|
|
166
|
-
return !!this.$slots.prepend || this.
|
|
166
|
+
return !!this.$slots.prepend || this.icon
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div v-if="canShowOptionGroupLabel" class="q-mb-sm text-body1">
|
|
3
|
+
<div v-if="canShowOptionGroupLabel" class="q-mb-sm text-body1" :class="labelClasses">
|
|
4
4
|
{{ props.label }}
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<component :is="component.is" v-bind="component.props" />
|
|
8
|
+
|
|
9
|
+
<qas-error-message v-if="props.errorMessage" :message="props.errorMessage" />
|
|
8
10
|
</div>
|
|
9
11
|
</template>
|
|
10
12
|
|
|
11
13
|
<script setup>
|
|
14
|
+
import useErrorMessage, { baseErrorProps } from '../../composables/private/use-error-message'
|
|
15
|
+
|
|
12
16
|
import { computed, useAttrs } from 'vue'
|
|
13
17
|
|
|
14
18
|
defineOptions({
|
|
@@ -17,17 +21,26 @@ defineOptions({
|
|
|
17
21
|
})
|
|
18
22
|
|
|
19
23
|
const props = defineProps({
|
|
24
|
+
...baseErrorProps,
|
|
25
|
+
|
|
20
26
|
label: {
|
|
21
27
|
default: '',
|
|
22
28
|
type: String
|
|
23
29
|
}
|
|
24
30
|
})
|
|
25
31
|
|
|
32
|
+
// globals
|
|
26
33
|
const attrs = useAttrs()
|
|
27
34
|
|
|
35
|
+
// composables
|
|
36
|
+
const { labelClasses } = useErrorMessage(props)
|
|
37
|
+
|
|
38
|
+
// computeds
|
|
28
39
|
const isOptionGroup = computed(() => !!attrs.options?.length)
|
|
29
40
|
|
|
30
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Só mostra a label caso for q-option-group e tenha label vindo nas props
|
|
43
|
+
*/
|
|
31
44
|
const canShowOptionGroupLabel = computed(() => isOptionGroup.value && !!props.label)
|
|
32
45
|
|
|
33
46
|
/**
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
type: component
|
|
2
2
|
|
|
3
3
|
props:
|
|
4
|
+
error:
|
|
5
|
+
desc: Booleano que caso seja true a label passa a ter a cor vermelha.
|
|
6
|
+
type: Boolean
|
|
7
|
+
|
|
8
|
+
error-message:
|
|
9
|
+
desc: Mensagem de erro exibida na parte inferior do checkbox.
|
|
10
|
+
type: String
|
|
11
|
+
|
|
4
12
|
label:
|
|
5
13
|
desc: Label utilizada em casos de ser q-option-group.
|
|
6
14
|
default: ''
|
|
@@ -8,4 +16,3 @@ props:
|
|
|
8
16
|
|
|
9
17
|
meta:
|
|
10
18
|
desc: Componente wrapper do QRadio.
|
|
11
|
-
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<q-icon v-if="useSearchOnType" color="grey-8" name="sym_r_search" />
|
|
2
|
+
<qas-input ref="input" v-model="model" class="qas-search-input" :class="classes" v-bind="$attrs" data-cy="search-input" :debounce hide-bottom-space input-class="ellipsis text-grey-8" inputmode="search" outlined type="search">
|
|
3
|
+
<template #prepend>
|
|
4
|
+
<q-icon v-if="useSearchOnType" color="grey-8" name="sym_r_search" />
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
<qas-btn v-else color="grey-10" icon="sym_r_search" variant="tertiary" @click="$emit('filter')" />
|
|
7
|
+
</template>
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
<template #append>
|
|
10
|
+
<qas-btn v-if="hasSearch" color="grey-10" icon="sym_r_clear" variant="tertiary" @click="clear" />
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</component>
|
|
12
|
+
<slot name="after-clear" />
|
|
13
|
+
</template>
|
|
14
|
+
</qas-input>
|
|
17
15
|
</template>
|
|
18
16
|
|
|
19
17
|
<script>
|
|
@@ -51,20 +49,15 @@ export default {
|
|
|
51
49
|
],
|
|
52
50
|
|
|
53
51
|
computed: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
52
|
+
classes () {
|
|
53
|
+
const bordered = this.isBox || this.isDialog
|
|
57
54
|
|
|
58
|
-
containerClasses () {
|
|
59
55
|
return {
|
|
60
|
-
|
|
56
|
+
'qas-search-input--border': bordered,
|
|
57
|
+
'qas-search-input--shadow': !bordered
|
|
61
58
|
}
|
|
62
59
|
},
|
|
63
60
|
|
|
64
|
-
isBoxOrDialog () {
|
|
65
|
-
return this.isBox || this.isDialog
|
|
66
|
-
},
|
|
67
|
-
|
|
68
61
|
debounce () {
|
|
69
62
|
return this.useDebounce ? '1200' : ''
|
|
70
63
|
},
|
|
@@ -96,11 +89,3 @@ export default {
|
|
|
96
89
|
}
|
|
97
90
|
}
|
|
98
91
|
</script>
|
|
99
|
-
|
|
100
|
-
<style lang="scss">
|
|
101
|
-
.qas-search-input {
|
|
102
|
-
.qas-search-input__input .q-field__control:before {
|
|
103
|
-
border: 0;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
</style>
|
|
@@ -160,6 +160,8 @@ export default {
|
|
|
160
160
|
|
|
161
161
|
computed: {
|
|
162
162
|
attributes () {
|
|
163
|
+
const { useChips, ...attrs } = this.$attrs
|
|
164
|
+
|
|
163
165
|
return {
|
|
164
166
|
clearable: this.isSearchable,
|
|
165
167
|
emitValue: true,
|
|
@@ -171,7 +173,7 @@ export default {
|
|
|
171
173
|
popupContentClass: `qas-select__menu ${this.popupContentClass}`,
|
|
172
174
|
useChips: this.isMultiple && this.isPopupContentOpen,
|
|
173
175
|
|
|
174
|
-
...
|
|
176
|
+
...attrs,
|
|
175
177
|
|
|
176
178
|
label: this.formattedLabel,
|
|
177
179
|
error: this.hasError,
|
|
@@ -202,10 +204,6 @@ export default {
|
|
|
202
204
|
return this.hasFuse || this.useLazyLoading
|
|
203
205
|
},
|
|
204
206
|
|
|
205
|
-
isBordered () {
|
|
206
|
-
return (this.isBox || this.isDialog) && this.useFilterMode
|
|
207
|
-
},
|
|
208
|
-
|
|
209
207
|
hasError () {
|
|
210
208
|
return this.mx_hasFetchError || this.$attrs.error
|
|
211
209
|
},
|
|
@@ -261,11 +259,14 @@ export default {
|
|
|
261
259
|
|
|
262
260
|
// redesign
|
|
263
261
|
componentClasses () {
|
|
262
|
+
const isBordered = (this.isBox || this.isDialog) && this.useFilterMode
|
|
263
|
+
|
|
264
|
+
// estilos definidos no arquivo field.scss
|
|
264
265
|
return {
|
|
265
266
|
...(this.useFilterMode && {
|
|
266
|
-
'qas-select--filter
|
|
267
|
-
'
|
|
268
|
-
|
|
267
|
+
'qas-select--filter': true,
|
|
268
|
+
'qas-select--filter-border': isBordered,
|
|
269
|
+
'qas-select--filter-shadow': !isBordered
|
|
269
270
|
}),
|
|
270
271
|
|
|
271
272
|
'qas-select--has-icon': this.hasAppend || this.hasIcon,
|
|
@@ -470,12 +471,6 @@ export default {
|
|
|
470
471
|
}
|
|
471
472
|
}
|
|
472
473
|
|
|
473
|
-
&--filter {
|
|
474
|
-
.q-field__control:before {
|
|
475
|
-
border: 0;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
|
|
479
474
|
&__menu {
|
|
480
475
|
.q-item {
|
|
481
476
|
font-weight: 400 !important;
|
|
@@ -508,14 +503,7 @@ export default {
|
|
|
508
503
|
}
|
|
509
504
|
}
|
|
510
505
|
|
|
511
|
-
.q-field__focusable-action
|
|
512
|
-
opacity: 1;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
.q-chip {
|
|
516
|
-
font-size: 11px;
|
|
517
|
-
}
|
|
518
|
-
|
|
506
|
+
.q-field__focusable-action,
|
|
519
507
|
.q-chip__icon--remove {
|
|
520
508
|
opacity: 1;
|
|
521
509
|
}
|
|
@@ -40,7 +40,7 @@ const model = defineModel({ type: String, default: '' })
|
|
|
40
40
|
const internalModel = ref(route.query[props.name] || model.value)
|
|
41
41
|
|
|
42
42
|
// watch
|
|
43
|
-
watch(() => route.query[props.name], setModels)
|
|
43
|
+
watch(() => route.query[props.name], setModels, { immediate: true })
|
|
44
44
|
|
|
45
45
|
// functions
|
|
46
46
|
/**
|
|
@@ -52,6 +52,11 @@ export default {
|
|
|
52
52
|
type: Object
|
|
53
53
|
},
|
|
54
54
|
|
|
55
|
+
maxHeight: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: '528px'
|
|
58
|
+
},
|
|
59
|
+
|
|
55
60
|
results: {
|
|
56
61
|
default: () => [],
|
|
57
62
|
required: true,
|
|
@@ -86,9 +91,8 @@ export default {
|
|
|
86
91
|
type: Boolean
|
|
87
92
|
},
|
|
88
93
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
type: String
|
|
94
|
+
useVirtualScroll: {
|
|
95
|
+
type: Boolean
|
|
92
96
|
}
|
|
93
97
|
},
|
|
94
98
|
|
|
@@ -139,7 +143,7 @@ export default {
|
|
|
139
143
|
attributes () {
|
|
140
144
|
const attributes = {
|
|
141
145
|
tableClass: {
|
|
142
|
-
'overflow-hidden-y': !this.useStickyHeader
|
|
146
|
+
'overflow-hidden-y': !this.useStickyHeader && !this.useVirtualScroll
|
|
143
147
|
},
|
|
144
148
|
class: this.tableClass,
|
|
145
149
|
columns: this.columnsByFields,
|
|
@@ -149,6 +153,7 @@ export default {
|
|
|
149
153
|
rowKey: this.rowKey,
|
|
150
154
|
rows: this.resultsByFields,
|
|
151
155
|
style: this.tableStyle,
|
|
156
|
+
virtualScroll: this.useVirtualScroll,
|
|
152
157
|
|
|
153
158
|
// Eventos.
|
|
154
159
|
onRowClick: this.$attrs.onRowClick && this.onRowClick
|
|
@@ -234,7 +239,7 @@ export default {
|
|
|
234
239
|
|
|
235
240
|
tableStyle () {
|
|
236
241
|
return {
|
|
237
|
-
|
|
242
|
+
...((this.useStickyHeader || this.useVirtualScroll) && { maxHeight: this.maxHeight })
|
|
238
243
|
}
|
|
239
244
|
},
|
|
240
245
|
|
|
@@ -26,6 +26,11 @@ props:
|
|
|
26
26
|
type: Object
|
|
27
27
|
examples: ["{ description: 'Descrição', labelProps: { label: 'Titulo do header'} }"]
|
|
28
28
|
|
|
29
|
+
max-height:
|
|
30
|
+
desc: Usado para definir a altura máxima da tabela e exibir o scroll vertical. Somente funciona quando a propriedade "use-sticky-header" ou "use-virtual-scroll" é utilizada.
|
|
31
|
+
default: '528px'
|
|
32
|
+
type: String
|
|
33
|
+
|
|
29
34
|
results:
|
|
30
35
|
desc: Lista com resultados para serem mostrados na tabela.
|
|
31
36
|
default: {}
|
|
@@ -62,10 +67,10 @@ props:
|
|
|
62
67
|
default: false
|
|
63
68
|
type: Boolean
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
desc: Usado para
|
|
67
|
-
default:
|
|
68
|
-
type:
|
|
70
|
+
use-virtual-scroll:
|
|
71
|
+
desc: Usado para ativar o scroll virtual da tabela.
|
|
72
|
+
default: false
|
|
73
|
+
type: Boolean
|
|
69
74
|
|
|
70
75
|
slots:
|
|
71
76
|
body:
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
</qas-header>
|
|
17
17
|
|
|
18
|
-
<div v-if="errorMessage" class="q-mt-xs text-caption text-negative">
|
|
19
|
-
{{ errorMessage }}
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
18
|
<!-- ------------------------------------ tags hidden -------------------------------------- -->
|
|
23
19
|
<input ref="hiddenInput" :accept="attributes.accept" class="qas-uploader__input" :multiple="isMultiple" type="file">
|
|
24
20
|
<qas-btn ref="buttonCleanFiles" class="hidden" @click="scope.removeUploadedFiles" />
|
|
@@ -33,6 +29,8 @@
|
|
|
33
29
|
</div>
|
|
34
30
|
|
|
35
31
|
<qas-empty-result-text v-else />
|
|
32
|
+
|
|
33
|
+
<qas-error-message v-if="errorMessage" :message="errorMessage" />
|
|
36
34
|
</template>
|
|
37
35
|
</q-uploader>
|
|
38
36
|
|
|
@@ -44,9 +42,11 @@
|
|
|
44
42
|
import PvUploaderGalleryCard from './private/PvUploaderGalleryCard.vue'
|
|
45
43
|
import QasHeader from '../header/QasHeader.vue'
|
|
46
44
|
|
|
45
|
+
import { baseErrorProps } from '../../composables/private/use-error-message'
|
|
46
|
+
import { getImageSize, getResizeDimensions } from '../../helpers/images.js'
|
|
47
|
+
|
|
47
48
|
import { uid, extend } from 'quasar'
|
|
48
49
|
import { NotifyError } from '../../plugins'
|
|
49
|
-
import { getImageSize, getResizeDimensions } from '../../helpers/images.js'
|
|
50
50
|
|
|
51
51
|
import Pica from 'pica'
|
|
52
52
|
|
|
@@ -61,6 +61,8 @@ export default {
|
|
|
61
61
|
inheritAttrs: false,
|
|
62
62
|
|
|
63
63
|
props: {
|
|
64
|
+
...baseErrorProps,
|
|
65
|
+
|
|
64
66
|
addButtonFn: {
|
|
65
67
|
type: Function,
|
|
66
68
|
default: undefined
|
|
@@ -98,15 +100,6 @@ export default {
|
|
|
98
100
|
type: String
|
|
99
101
|
},
|
|
100
102
|
|
|
101
|
-
error: {
|
|
102
|
-
type: Boolean
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
errorMessage: {
|
|
106
|
-
default: '',
|
|
107
|
-
type: String
|
|
108
|
-
},
|
|
109
|
-
|
|
110
103
|
fields: {
|
|
111
104
|
default: () => ({}),
|
|
112
105
|
type: Object
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as useAuthUser } from './use-auth-user'
|
|
2
|
+
export { default as useErrorMessage } from './use-error-message'
|
|
2
3
|
export { default as useGenerator } from './use-generator'
|
|
3
4
|
export { default as useToggleVisibility } from './use-toggle-visibility'
|
|
4
|
-
export { default as
|
|
5
|
+
export { default as useView } from './use-view'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { computed } from 'vue'
|
|
2
|
+
|
|
3
|
+
export const baseErrorProps = {
|
|
4
|
+
errorMessage: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: ''
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
error: {
|
|
10
|
+
type: Boolean
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Composable para lidar com mensagens de erro
|
|
16
|
+
*
|
|
17
|
+
* @param {baseErrorProps} props
|
|
18
|
+
*/
|
|
19
|
+
export default function useErrorMessage (props) {
|
|
20
|
+
const labelClasses = computed(() => ({ 'text-negative': props.error }))
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
labelClasses
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -7,8 +7,21 @@
|
|
|
7
7
|
transition: transform var(--qas-generic-transition);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
&--standard &__control:hover::before {
|
|
11
|
+
border-color: var(--q-primary-contrast) !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&--standard &__control::after {
|
|
15
|
+
height: 1px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--outlined &__control::after,
|
|
19
|
+
&--outlined.q-field--highlighted &__control::after {
|
|
20
|
+
border-width: 1px !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
.q-field__label {
|
|
11
|
-
will-change: transform;
|
|
24
|
+
will-change: transform, font-size;
|
|
12
25
|
}
|
|
13
26
|
|
|
14
27
|
&__label,
|
|
@@ -16,6 +29,23 @@
|
|
|
16
29
|
@include set-typography($body2);
|
|
17
30
|
}
|
|
18
31
|
|
|
32
|
+
// pega o ícone imediato dos append e prepend, não os do q-chip por exemplo.
|
|
33
|
+
&--error {
|
|
34
|
+
.q-field__input,
|
|
35
|
+
.q-field__native {
|
|
36
|
+
color: $negative !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.q-field__marginal > .q-icon,
|
|
40
|
+
.q-field__marginal > .qas-btn .q-icon {
|
|
41
|
+
color: $negative !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.q-field__bottom {
|
|
45
|
+
@include set-error-message;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
19
49
|
&--dense {
|
|
20
50
|
.q-textarea {
|
|
21
51
|
height: 100%;
|
|
@@ -42,6 +72,7 @@
|
|
|
42
72
|
// Somente fields com label
|
|
43
73
|
&--float.q-field--labeled,
|
|
44
74
|
&--focused.q-field--labeled {
|
|
75
|
+
will-change: transform, font-size;
|
|
45
76
|
transition: transform var(--qas-generic-transition), font-size var(--qas-generic-transition);
|
|
46
77
|
|
|
47
78
|
&:not(&.qas-select--filter):not(&.qas-select--has-icon) .q-field__label {
|
|
@@ -85,4 +116,40 @@
|
|
|
85
116
|
background-color: white;
|
|
86
117
|
border-radius: $generic-border-radius;
|
|
87
118
|
}
|
|
119
|
+
|
|
120
|
+
// logica referente ao modo filtro
|
|
121
|
+
&.qas-search-input,
|
|
122
|
+
&.qas-select--filter {
|
|
123
|
+
.q-field__control::before {
|
|
124
|
+
transition: border var(--qas-generic-transition);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&:not(&.q-field--error):not(&.q-field--highlighted):hover {
|
|
128
|
+
.q-field__control::after {
|
|
129
|
+
border-color: var(--q-primary-contrast);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.q-field__control {
|
|
134
|
+
border-radius: $generic-border-radius;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.q-field__control::before {
|
|
138
|
+
border: 0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&.qas-search-input--shadow,
|
|
143
|
+
&.qas-select--filter-shadow {
|
|
144
|
+
.q-field__control {
|
|
145
|
+
box-shadow: $shadow-2;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&.qas-search-input--border,
|
|
150
|
+
&.qas-select--filter-border {
|
|
151
|
+
.q-field__control {
|
|
152
|
+
@extend .bordered;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
88
155
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
@import '../variables/typography.scss';
|
|
2
|
+
|
|
3
|
+
@mixin set-error-message ($important: false) {
|
|
4
|
+
@include set-typography($caption, $important);
|
|
5
|
+
|
|
6
|
+
padding-top: if($important, var(--qas-spacing-sm) !important, var(--qas-spacing-sm));
|
|
7
|
+
color: if($important, $negative !important, $negative);
|
|
8
|
+
}
|
package/src/vue-plugin.js
CHANGED
|
@@ -24,6 +24,7 @@ import QasDialog from './components/dialog/QasDialog.vue'
|
|
|
24
24
|
import QasDialogRouter from './components/dialog-router/QasDialogRouter.vue'
|
|
25
25
|
import QasDrawer from './components/drawer/QasDrawer.vue'
|
|
26
26
|
import QasEmptyResultText from './components/empty-result-text/QasEmptyResultText.vue'
|
|
27
|
+
import QasErrorMessage from './components/error-message/QasErrorMessage.vue'
|
|
27
28
|
import QasExpansionItem from './components/expansion-item/QasExpansionItem.vue'
|
|
28
29
|
import QasField from './components/field/QasField.vue'
|
|
29
30
|
import QasFilters from './components/filters/QasFilters.vue'
|
|
@@ -123,6 +124,7 @@ async function install (app) {
|
|
|
123
124
|
app.component('QasDialogRouter', QasDialogRouter)
|
|
124
125
|
app.component('QasDrawer', QasDrawer)
|
|
125
126
|
app.component('QasEmptyResultText', QasEmptyResultText)
|
|
127
|
+
app.component('QasErrorMessage', QasErrorMessage)
|
|
126
128
|
app.component('QasExpansionItem', QasExpansionItem)
|
|
127
129
|
app.component('QasField', QasField)
|
|
128
130
|
app.component('QasFilters', QasFilters)
|
|
@@ -224,6 +226,7 @@ export {
|
|
|
224
226
|
QasDialogRouter,
|
|
225
227
|
QasDrawer,
|
|
226
228
|
QasEmptyResultText,
|
|
229
|
+
QasErrorMessage,
|
|
227
230
|
QasExpansionItem,
|
|
228
231
|
QasField,
|
|
229
232
|
QasFilters,
|