@bildvitta/quasar-ui-asteroid 3.11.0-beta.14 → 3.11.0-beta.16
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/date-time-input/QasDateTimeInput.vue +12 -2
- package/src/components/date-time-input/QasDateTimeInput.yml +10 -0
- package/src/components/field/QasField.vue +3 -15
- package/src/components/input/QasInput.vue +20 -7
- package/src/components/input/QasInput.yml +5 -0
- package/src/components/label/QasLabel.vue +13 -5
- package/src/components/label/QasLabel.yml +5 -0
- package/src/components/numeric-input/QasNumericInput.vue +15 -1
- package/src/components/numeric-input/QasNumericInput.yml +10 -0
- package/src/components/select/QasSelect.vue +15 -0
- package/src/components/select/QasSelect.yml +10 -0
- package/src/helpers/get-required-label.js +3 -0
- package/src/helpers/index.js +1 -0
package/package.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
<qas-input ref="input" v-bind="attributes" v-model="currentValue" inputmode="numeric" :unmasked-value="false" @blur="validateDateTimeOnBlur" @focus="resetError" @update:model-value="updateModelValue">
|
|
3
3
|
<template #append>
|
|
4
4
|
<qas-btn v-if="!useTimeOnly" color="grey-9" :disable="$attrs.readonly" icon="sym_r_event" variant="tertiary">
|
|
5
|
-
<q-popup-proxy ref="dateProxy" transition-hide="scale" transition-show="scale">
|
|
5
|
+
<q-popup-proxy ref="dateProxy" transition-hide="scale" transition-show="scale" v-bind="datePopupProxyProps">
|
|
6
6
|
<qas-date v-model="currentValue" v-bind="defaultDateProps" :mask="maskDate" width="290px" @update:model-value="updateModelValue" />
|
|
7
7
|
</q-popup-proxy>
|
|
8
8
|
</qas-btn>
|
|
9
9
|
|
|
10
10
|
<qas-btn v-if="!useDateOnly" class="q-ml-sm" color="grey-9" :disable="$attrs.readonly" icon="sym_r_access_time">
|
|
11
|
-
<q-popup-proxy ref="timeProxy" transition-hide="scale" transition-show="scale">
|
|
11
|
+
<q-popup-proxy ref="timeProxy" transition-hide="scale" transition-show="scale" v-bind="timePopupProxyProps">
|
|
12
12
|
<q-time v-model="currentValue" v-bind="defaultTimeProps" format24h :mask="maskDate" @update:model-value="updateModelValue" />
|
|
13
13
|
</q-popup-proxy>
|
|
14
14
|
</qas-btn>
|
|
@@ -36,6 +36,11 @@ export default {
|
|
|
36
36
|
type: Object
|
|
37
37
|
},
|
|
38
38
|
|
|
39
|
+
datePopupProxyProps: {
|
|
40
|
+
default: () => ({}),
|
|
41
|
+
type: Object
|
|
42
|
+
},
|
|
43
|
+
|
|
39
44
|
timeMask: {
|
|
40
45
|
default: 'HH:mm',
|
|
41
46
|
type: String
|
|
@@ -46,6 +51,11 @@ export default {
|
|
|
46
51
|
type: Object
|
|
47
52
|
},
|
|
48
53
|
|
|
54
|
+
timePopupProxyProps: {
|
|
55
|
+
default: () => ({}),
|
|
56
|
+
type: Object
|
|
57
|
+
},
|
|
58
|
+
|
|
49
59
|
useIso: {
|
|
50
60
|
type: Boolean
|
|
51
61
|
},
|
|
@@ -17,6 +17,11 @@ props:
|
|
|
17
17
|
default: {}
|
|
18
18
|
type: Object
|
|
19
19
|
|
|
20
|
+
date-popup-proxy-props:
|
|
21
|
+
desc: Propriedades do QPopupProxy para o popup do QDate (https://quasar.dev/vue-components/popup-proxy#qpopupproxy-api).
|
|
22
|
+
default: {}
|
|
23
|
+
type: Object
|
|
24
|
+
|
|
20
25
|
model-value:
|
|
21
26
|
desc: Model do componente, usado para v-model.
|
|
22
27
|
default: ''
|
|
@@ -33,6 +38,11 @@ props:
|
|
|
33
38
|
default: {}
|
|
34
39
|
type: Object
|
|
35
40
|
|
|
41
|
+
time-popup-proxy-props:
|
|
42
|
+
desc: Propriedades do QPopupProxy para o popup do QTime (https://quasar.dev/vue-components/popup-proxy#qpopupproxy-api).
|
|
43
|
+
default: {}
|
|
44
|
+
type: Object
|
|
45
|
+
|
|
36
46
|
use-time-only:
|
|
37
47
|
desc: Habilita o componente para usar somente hora.
|
|
38
48
|
type: Boolean
|
|
@@ -70,6 +70,7 @@ export default {
|
|
|
70
70
|
name,
|
|
71
71
|
options,
|
|
72
72
|
readonly,
|
|
73
|
+
required,
|
|
73
74
|
disable,
|
|
74
75
|
filled = readonly,
|
|
75
76
|
suffix,
|
|
@@ -96,6 +97,7 @@ export default {
|
|
|
96
97
|
outlined: true,
|
|
97
98
|
...error,
|
|
98
99
|
readonly,
|
|
100
|
+
required,
|
|
99
101
|
disable,
|
|
100
102
|
filled,
|
|
101
103
|
maxlength,
|
|
@@ -152,8 +154,7 @@ export default {
|
|
|
152
154
|
|
|
153
155
|
return {
|
|
154
156
|
...(profiles[type] || profiles.default),
|
|
155
|
-
...this.$attrs
|
|
156
|
-
label: this.formattedLabel
|
|
157
|
+
...this.$attrs
|
|
157
158
|
}
|
|
158
159
|
},
|
|
159
160
|
|
|
@@ -161,19 +162,6 @@ export default {
|
|
|
161
162
|
return Array.isArray(this.error) ? this.error.join(' ') : this.error
|
|
162
163
|
},
|
|
163
164
|
|
|
164
|
-
formattedLabel () {
|
|
165
|
-
const nonRequiredFieldsLabel = ['boolean', 'checkbox', 'radio']
|
|
166
|
-
|
|
167
|
-
const label = this.$attrs.label || this.formattedField.label
|
|
168
|
-
const { required, type } = this.formattedField
|
|
169
|
-
|
|
170
|
-
if (required && label && !nonRequiredFieldsLabel.includes(type)) {
|
|
171
|
-
return `${label}*`
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return label
|
|
175
|
-
},
|
|
176
|
-
|
|
177
165
|
// This computed will change the key name when the server sends different key.
|
|
178
166
|
formattedField () {
|
|
179
167
|
const field = {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-input ref="input" v-model="model" bottom-slots :error="errorData" v-bind="$attrs" :error-message="errorMessage" :inputmode="defaultInputmode" :mask="currentMask" :outlined="outlined" :unmasked-value="unmaskedValue" @paste="onPaste">
|
|
2
|
+
<q-input ref="input" v-model="model" bottom-slots :error="errorData" v-bind="$attrs" :error-message="errorMessage" :inputmode="defaultInputmode" :label="formattedLabel" :mask="currentMask" :outlined="outlined" :unmasked-value="unmaskedValue" @paste="onPaste">
|
|
3
3
|
<template v-for="(_, name) in $slots" #[name]="context">
|
|
4
4
|
<slot :name="name" v-bind="context || {}" />
|
|
5
5
|
</template>
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
|
+
import { getRequiredLabel } from '../../helpers'
|
|
11
|
+
|
|
10
12
|
const Masks = {
|
|
11
13
|
CompanyDocument: 'company-document',
|
|
12
14
|
Document: 'document',
|
|
@@ -45,6 +47,10 @@ export default {
|
|
|
45
47
|
type: Boolean
|
|
46
48
|
},
|
|
47
49
|
|
|
50
|
+
required: {
|
|
51
|
+
type: Boolean
|
|
52
|
+
},
|
|
53
|
+
|
|
48
54
|
unmaskedValue: {
|
|
49
55
|
default: true,
|
|
50
56
|
type: Boolean
|
|
@@ -60,7 +66,8 @@ export default {
|
|
|
60
66
|
data () {
|
|
61
67
|
return {
|
|
62
68
|
errorData: false,
|
|
63
|
-
currentMask: ''
|
|
69
|
+
currentMask: '',
|
|
70
|
+
inputReference: null
|
|
64
71
|
}
|
|
65
72
|
},
|
|
66
73
|
|
|
@@ -69,10 +76,6 @@ export default {
|
|
|
69
76
|
return this.inputReference.hasError
|
|
70
77
|
},
|
|
71
78
|
|
|
72
|
-
inputReference () {
|
|
73
|
-
return this.$refs.input
|
|
74
|
-
},
|
|
75
|
-
|
|
76
79
|
masks () {
|
|
77
80
|
return {
|
|
78
81
|
[Masks.CompanyDocument]: () => '##.###.###/####-##',
|
|
@@ -110,11 +113,17 @@ export default {
|
|
|
110
113
|
|
|
111
114
|
return this.$emit('update:modelValue', value)
|
|
112
115
|
}
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
formattedLabel () {
|
|
119
|
+
const { label } = this.$attrs
|
|
120
|
+
|
|
121
|
+
return getRequiredLabel({ label, required: this.required })
|
|
113
122
|
}
|
|
114
123
|
},
|
|
115
124
|
|
|
116
125
|
watch: {
|
|
117
|
-
|
|
126
|
+
currentMask (value) {
|
|
118
127
|
if (!value) return
|
|
119
128
|
|
|
120
129
|
const input = this.getInput()
|
|
@@ -140,6 +149,10 @@ export default {
|
|
|
140
149
|
}
|
|
141
150
|
},
|
|
142
151
|
|
|
152
|
+
mounted () {
|
|
153
|
+
this.inputReference = this.$refs.input
|
|
154
|
+
},
|
|
155
|
+
|
|
143
156
|
methods: {
|
|
144
157
|
focus () {
|
|
145
158
|
return this.inputReference.focus()
|
|
@@ -32,6 +32,11 @@ props:
|
|
|
32
32
|
default: true
|
|
33
33
|
type: Boolean
|
|
34
34
|
|
|
35
|
+
required:
|
|
36
|
+
desc: Controla label do campo, se for "true" adiciona sufixo "*".
|
|
37
|
+
default: false
|
|
38
|
+
type: Boolean
|
|
39
|
+
|
|
35
40
|
use-remove-error-on-type:
|
|
36
41
|
desc: Limpa os erros do campo caso os mesmos existam toda vez que o model atualiza.
|
|
37
42
|
type: Boolean
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="text-h4" :class="classes">
|
|
3
|
-
<slot :label-with-suffix="
|
|
3
|
+
<slot :label-with-suffix="formattedLabel">{{ formattedLabel }}</slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
import { addCounterSuffix } from '../../helpers'
|
|
8
|
+
import { addCounterSuffix, getRequiredLabel } from '../../helpers'
|
|
9
9
|
import { Spacing } from '../../enums/Spacing'
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
name: 'QasLabel',
|
|
13
13
|
|
|
14
14
|
props: {
|
|
15
|
+
color: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: 'grey-9'
|
|
18
|
+
},
|
|
19
|
+
|
|
15
20
|
count: {
|
|
16
21
|
default: 0,
|
|
17
22
|
type: [Number, String]
|
|
@@ -32,9 +37,8 @@ export default {
|
|
|
32
37
|
}
|
|
33
38
|
},
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
type:
|
|
37
|
-
default: 'grey-9'
|
|
40
|
+
required: {
|
|
41
|
+
type: Boolean
|
|
38
42
|
}
|
|
39
43
|
},
|
|
40
44
|
|
|
@@ -43,6 +47,10 @@ export default {
|
|
|
43
47
|
return addCounterSuffix(this.label, parseFloat(this.count))
|
|
44
48
|
},
|
|
45
49
|
|
|
50
|
+
formattedLabel () {
|
|
51
|
+
return getRequiredLabel({ label: this.labelWithSuffix, required: this.required })
|
|
52
|
+
},
|
|
53
|
+
|
|
46
54
|
classes () {
|
|
47
55
|
return [
|
|
48
56
|
`q-mb-${this.margin}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-field :model-value="modelValue" outlined>
|
|
2
|
+
<q-field :label="formattedLabel" :model-value="modelValue" outlined>
|
|
3
3
|
<template #control="{ floatingLabel, id }">
|
|
4
4
|
<input v-show="floatingLabel" :id="id" ref="input" class="q-field__input" inputmode="numeric" @blur="emitValue" @click="setSelect" @input="emitUpdateModel($event.target.value)">
|
|
5
5
|
</template>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
10
|
import AutoNumeric from 'autonumeric'
|
|
11
|
+
import { getRequiredLabel } from '../../helpers'
|
|
11
12
|
|
|
12
13
|
const defaultModes = {
|
|
13
14
|
decimal: 'commaDecimalCharDotSeparator',
|
|
@@ -30,6 +31,11 @@ export default {
|
|
|
30
31
|
type: Number
|
|
31
32
|
},
|
|
32
33
|
|
|
34
|
+
label: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ''
|
|
37
|
+
},
|
|
38
|
+
|
|
33
39
|
mode: {
|
|
34
40
|
default: 'integer',
|
|
35
41
|
type: String,
|
|
@@ -54,6 +60,10 @@ export default {
|
|
|
54
60
|
type: [Boolean, String]
|
|
55
61
|
},
|
|
56
62
|
|
|
63
|
+
required: {
|
|
64
|
+
type: Boolean
|
|
65
|
+
},
|
|
66
|
+
|
|
57
67
|
useNegative: {
|
|
58
68
|
type: Boolean
|
|
59
69
|
},
|
|
@@ -78,6 +88,10 @@ export default {
|
|
|
78
88
|
computed: {
|
|
79
89
|
defaultMode () {
|
|
80
90
|
return defaultModes[this.mode]
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
formattedLabel () {
|
|
94
|
+
return getRequiredLabel({ label: this.label, required: this.required })
|
|
81
95
|
}
|
|
82
96
|
},
|
|
83
97
|
|
|
@@ -17,6 +17,11 @@ props:
|
|
|
17
17
|
default: 2
|
|
18
18
|
type: Number
|
|
19
19
|
|
|
20
|
+
label:
|
|
21
|
+
desc: Label do componente.
|
|
22
|
+
type: String
|
|
23
|
+
default: ''
|
|
24
|
+
|
|
20
25
|
mode:
|
|
21
26
|
desc: Modo do componente.
|
|
22
27
|
default: integer
|
|
@@ -33,6 +38,11 @@ props:
|
|
|
33
38
|
desc: Propriedade preset serve para usar configuração de predefinição/nacionalidade da moeda pré setada pelo autonumeric (Brasil é o padrão).
|
|
34
39
|
type: [Boolean, String]
|
|
35
40
|
|
|
41
|
+
required:
|
|
42
|
+
desc: Controla label do campo, se for "true" adiciona sufixo "*".
|
|
43
|
+
default: false
|
|
44
|
+
type: Boolean
|
|
45
|
+
|
|
36
46
|
use-negative:
|
|
37
47
|
desc: Controla se pode ou não números negativos.
|
|
38
48
|
default: false
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
|
+
import { getRequiredLabel } from '../../helpers'
|
|
32
33
|
import { uid } from 'quasar'
|
|
33
34
|
import { searchFilterMixin } from '../../mixins'
|
|
34
35
|
import Fuse from 'fuse.js'
|
|
@@ -45,6 +46,11 @@ export default {
|
|
|
45
46
|
type: Object
|
|
46
47
|
},
|
|
47
48
|
|
|
49
|
+
label: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ''
|
|
52
|
+
},
|
|
53
|
+
|
|
48
54
|
modelValue: {
|
|
49
55
|
default: () => [],
|
|
50
56
|
type: [Array, Object, String, Number, Boolean]
|
|
@@ -60,6 +66,10 @@ export default {
|
|
|
60
66
|
type: Array
|
|
61
67
|
},
|
|
62
68
|
|
|
69
|
+
required: {
|
|
70
|
+
type: Boolean
|
|
71
|
+
},
|
|
72
|
+
|
|
63
73
|
useFetchOptionsOnCreate: {
|
|
64
74
|
default: true,
|
|
65
75
|
type: Boolean
|
|
@@ -92,6 +102,7 @@ export default {
|
|
|
92
102
|
|
|
93
103
|
...this.$attrs,
|
|
94
104
|
|
|
105
|
+
label: this.formattedLabel,
|
|
95
106
|
error: this.hasError,
|
|
96
107
|
inputDebounce: this.useLazyLoading ? 1200 : 0,
|
|
97
108
|
loading: this.hasLoading,
|
|
@@ -155,6 +166,10 @@ export default {
|
|
|
155
166
|
|
|
156
167
|
popupContentClass () {
|
|
157
168
|
return `qas-select__popup-content-${uid()}`
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
formattedLabel () {
|
|
172
|
+
return getRequiredLabel({ label: this.label, required: this.required })
|
|
158
173
|
}
|
|
159
174
|
},
|
|
160
175
|
|
|
@@ -29,6 +29,11 @@ props:
|
|
|
29
29
|
keys: [label, value]
|
|
30
30
|
threshold: 0.4
|
|
31
31
|
|
|
32
|
+
label:
|
|
33
|
+
desc: Label do componente.
|
|
34
|
+
type: String
|
|
35
|
+
default: ''
|
|
36
|
+
|
|
32
37
|
label-key:
|
|
33
38
|
desc: O componente internamente espera receber na propriedade "options" um array de objeto contendo "label" e "value", caso o seu objeto não tenha "label" mas um "name" por exemplo, você pode definir esta prop "label-key" como "name".
|
|
34
39
|
type: String
|
|
@@ -66,6 +71,11 @@ props:
|
|
|
66
71
|
default: []
|
|
67
72
|
type: Array
|
|
68
73
|
|
|
74
|
+
required:
|
|
75
|
+
desc: Controla label do campo, se for "true" adiciona sufixo "*".
|
|
76
|
+
default: false
|
|
77
|
+
type: Boolean
|
|
78
|
+
|
|
69
79
|
value-key:
|
|
70
80
|
desc: O componente internamente espera receber na propriedade "options" um array de objeto contendo "label" e "value", caso o seu objeto não tenha "value" mas um "uuid" por exemplo, você pode definir esta prop "label-value" como "uuid".
|
|
71
81
|
type: String
|
package/src/helpers/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export { default as filterObjectToArray } from './filter-object-to-array.js'
|
|
|
11
11
|
export { default as findChildrenByKey } from './find-children-by-key.js'
|
|
12
12
|
export { default as getGreatestCommonDivisor } from './get-greatest-common-divisor.js'
|
|
13
13
|
export { default as getNormalizedOptions } from './get-normalized-options.js'
|
|
14
|
+
export { default as getRequiredLabel } from './get-required-label.js'
|
|
14
15
|
export { default as getSlotChildrenText } from './get-slot-children-text.js'
|
|
15
16
|
export { default as handleProcess } from './handle-process.js'
|
|
16
17
|
export { default as isEmpty } from './is-empty.js'
|