@bildvitta/quasar-ui-asteroid 2.16.0 → 2.18.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/filters/QasFilters.stories.js +4 -0
- package/src/components/filters/QasFilters.vue +7 -2
- package/src/components/signature-pad/QasSignaturePad.vue +9 -9
- package/src/components/signature-uploader/QasSignatureUploader.stories.js +7 -0
- package/src/components/signature-uploader/QasSignatureUploader.vue +39 -2
- package/src/helpers/filters.js +7 -1
- package/src/helpers/index.js +2 -0
package/package.json
CHANGED
|
@@ -52,6 +52,10 @@ export default {
|
|
|
52
52
|
description: 'Ignore entity and specify another endpoint.'
|
|
53
53
|
},
|
|
54
54
|
|
|
55
|
+
forceRefetch: {
|
|
56
|
+
description: 'Force refetching of filters data.'
|
|
57
|
+
},
|
|
58
|
+
|
|
55
59
|
// Events
|
|
56
60
|
'fetch-error': {
|
|
57
61
|
description: 'Fires when occur an error fetching value.',
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
<slot v-if="showFilterButton" :filter="filter" name="filter-button">
|
|
18
18
|
<q-btn v-if="!noFilterButton" :color="filterButtonColor" flat icon="o_filter_list" :label="filterButtonLabel">
|
|
19
|
-
<q-menu
|
|
19
|
+
<q-menu>
|
|
20
20
|
<div v-if="isFetching" class="q-pa-xl text-center">
|
|
21
21
|
<q-spinner color="grey" size="2em" />
|
|
22
22
|
</div>
|
|
@@ -61,6 +61,7 @@ export default {
|
|
|
61
61
|
},
|
|
62
62
|
|
|
63
63
|
mixins: [contextMixin],
|
|
64
|
+
|
|
64
65
|
props: {
|
|
65
66
|
badges: {
|
|
66
67
|
default: true,
|
|
@@ -95,6 +96,10 @@ export default {
|
|
|
95
96
|
url: {
|
|
96
97
|
default: '',
|
|
97
98
|
type: String
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
forceRefetch: {
|
|
102
|
+
type: Boolean
|
|
98
103
|
}
|
|
99
104
|
},
|
|
100
105
|
|
|
@@ -220,7 +225,7 @@ export default {
|
|
|
220
225
|
},
|
|
221
226
|
|
|
222
227
|
async fetchFilters () {
|
|
223
|
-
if (this.hasFields || this.noFilterButton) {
|
|
228
|
+
if (!this.forceRefetch && (this.hasFields || this.noFilterButton)) {
|
|
224
229
|
return null
|
|
225
230
|
}
|
|
226
231
|
|
|
@@ -12,19 +12,19 @@ import { isEqual } from 'lodash'
|
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
props: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
height: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '250'
|
|
18
18
|
},
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
options: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: () => ({})
|
|
23
23
|
},
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
type: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'image/png'
|
|
28
28
|
},
|
|
29
29
|
|
|
30
30
|
isEmpty: {
|
|
@@ -26,6 +26,13 @@ export default {
|
|
|
26
26
|
description: 'Generated signature label.'
|
|
27
27
|
},
|
|
28
28
|
|
|
29
|
+
dialogProps: {
|
|
30
|
+
description: 'Set props in dialog',
|
|
31
|
+
table: {
|
|
32
|
+
defaultValue: { summary: JSON.stringify({}) }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
|
|
29
36
|
value: {
|
|
30
37
|
description: 'Model value.'
|
|
31
38
|
},
|
|
@@ -15,13 +15,15 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
</qas-uploader>
|
|
17
17
|
|
|
18
|
-
<qas-dialog v-model="isOpenedDialog">
|
|
18
|
+
<qas-dialog v-model="isOpenedDialog" v-bind="defaultDialogProps" >
|
|
19
19
|
<template #header>
|
|
20
20
|
<div class="text-bold text-center">Insira sua assinatura digital no campo abaixo</div>
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<template #description>
|
|
24
|
-
<
|
|
24
|
+
<div :style="signaturePadWidth">
|
|
25
|
+
<qas-signature-pad ref="signaturePadModal" :is-empty.sync="isEmpty" :height="signaturePadHeight" />
|
|
26
|
+
</div>
|
|
25
27
|
</template>
|
|
26
28
|
|
|
27
29
|
<template #actions>
|
|
@@ -36,10 +38,13 @@
|
|
|
36
38
|
import QasDialog from '../dialog/QasDialog.vue'
|
|
37
39
|
import QasUploader from '../uploader/QasUploader.vue'
|
|
38
40
|
import QasSignaturePad from '../signature-pad/QasSignaturePad.vue'
|
|
41
|
+
import { screenMixin } from '../../mixins'
|
|
39
42
|
import { base64ToBlob } from '../../helpers'
|
|
40
43
|
import { NotifyError } from '../../plugins'
|
|
41
44
|
|
|
42
45
|
export default {
|
|
46
|
+
mixins: [screenMixin],
|
|
47
|
+
|
|
43
48
|
components: {
|
|
44
49
|
QasDialog,
|
|
45
50
|
QasUploader,
|
|
@@ -47,6 +52,11 @@ export default {
|
|
|
47
52
|
},
|
|
48
53
|
|
|
49
54
|
props: {
|
|
55
|
+
dialogProps: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => ({})
|
|
58
|
+
},
|
|
59
|
+
|
|
50
60
|
uploadLabel: {
|
|
51
61
|
default: 'Assinatura digital',
|
|
52
62
|
type: String
|
|
@@ -93,6 +103,33 @@ export default {
|
|
|
93
103
|
|
|
94
104
|
headerClasses () {
|
|
95
105
|
return `q-pa-${this.readonly ? 'md' : 'sm'}`
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
defaultDialogProps () {
|
|
109
|
+
return {
|
|
110
|
+
maxWidth: '620px',
|
|
111
|
+
...this.dialogProps
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
signaturePadWidth () {
|
|
116
|
+
const sizes = {
|
|
117
|
+
[this.$_isSmall]: { width: '100%' },
|
|
118
|
+
[this.$_isMedium]: { width: '570px' },
|
|
119
|
+
[this.$_isLarge]: { width: '350px' }
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return sizes.true
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
signaturePadHeight () {
|
|
126
|
+
const sizes = {
|
|
127
|
+
[this.$_isSmall]: '250',
|
|
128
|
+
[this.$_isMedium]: '400',
|
|
129
|
+
[this.$_isLarge]: '250'
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return sizes.true
|
|
96
133
|
}
|
|
97
134
|
},
|
|
98
135
|
|
package/src/helpers/filters.js
CHANGED
|
@@ -54,6 +54,11 @@ function percent (value = 0, places = 2) {
|
|
|
54
54
|
return value ? (value / 100).toLocaleString('pt-BR', { style: 'percent', minimumFractionDigits: places }) : ''
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
function formatPercent (value = 0, places = 2) {
|
|
58
|
+
value = Number(value)
|
|
59
|
+
return value ? value.toLocaleString('pt-BR', { style: 'percent', minimumFractionDigits: places }) : ''
|
|
60
|
+
}
|
|
61
|
+
|
|
57
62
|
function squareArea (value = 0, suffix = 'm²') {
|
|
58
63
|
value = decimal(value)
|
|
59
64
|
return value ? `${value} ${suffix}` : ''
|
|
@@ -97,7 +102,6 @@ function handleMasks (value) {
|
|
|
97
102
|
// Labels
|
|
98
103
|
function humanize (field = {}, value) {
|
|
99
104
|
if (field.mask && !value) return value
|
|
100
|
-
|
|
101
105
|
const mappedMasks = handleMasks(value)
|
|
102
106
|
|
|
103
107
|
if (mappedMasks[field.mask]) {
|
|
@@ -111,6 +115,7 @@ function humanize (field = {}, value) {
|
|
|
111
115
|
case 'datetime': return dateTime(value)
|
|
112
116
|
case 'time': return time(value)
|
|
113
117
|
case 'radio': return selectLabel(field.options, value)
|
|
118
|
+
case 'percent': return formatPercent(value)
|
|
114
119
|
default: return value
|
|
115
120
|
}
|
|
116
121
|
}
|
|
@@ -143,6 +148,7 @@ export {
|
|
|
143
148
|
decimal,
|
|
144
149
|
formatCompanyDocument,
|
|
145
150
|
formatDocument,
|
|
151
|
+
formatPercent,
|
|
146
152
|
formatPersonalDocument,
|
|
147
153
|
formatPhone,
|
|
148
154
|
formatPostalCode,
|
package/src/helpers/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
decimal,
|
|
14
14
|
formatCompanyDocument,
|
|
15
15
|
formatDocument,
|
|
16
|
+
formatPercent,
|
|
16
17
|
formatPersonalDocument,
|
|
17
18
|
formatPhone,
|
|
18
19
|
formatPostalCode,
|
|
@@ -36,6 +37,7 @@ export {
|
|
|
36
37
|
decimal,
|
|
37
38
|
formatCompanyDocument,
|
|
38
39
|
formatDocument,
|
|
40
|
+
formatPercent,
|
|
39
41
|
formatPersonalDocument,
|
|
40
42
|
formatPhone,
|
|
41
43
|
formatPostalCode,
|