@bildvitta/quasar-ui-asteroid 3.11.0-beta.15 → 3.11.0-beta.17
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/field/QasField.vue +3 -15
- package/src/components/input/QasInput.vue +13 -1
- 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/page-header/QasPageHeader.vue +2 -1
- package/src/components/select/QasSelect.vue +15 -0
- package/src/components/select/QasSelect.yml +10 -0
- package/src/components/welcome/QasWelcome.vue +22 -5
- package/src/components/welcome/QasWelcome.yml +9 -0
- package/src/helpers/get-required-label.js +3 -0
- package/src/helpers/index.js +1 -0
package/package.json
CHANGED
|
@@ -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
|
|
@@ -107,6 +113,12 @@ export default {
|
|
|
107
113
|
|
|
108
114
|
return this.$emit('update:modelValue', value)
|
|
109
115
|
}
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
formattedLabel () {
|
|
119
|
+
const { label } = this.$attrs
|
|
120
|
+
|
|
121
|
+
return getRequiredLabel({ label, required: this.required })
|
|
110
122
|
}
|
|
111
123
|
},
|
|
112
124
|
|
|
@@ -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
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<q-breadcrumbs v-if="useBreadcrumbs" class="text-caption" gutter="xs" separator-color="grey-8">
|
|
10
10
|
<q-breadcrumbs-el v-if="useHomeIcon" class="qas-page-header__breadcrumbs-el text-grey-8" icon="sym_r_home" :to="homeRoute" />
|
|
11
11
|
|
|
12
|
-
<q-breadcrumbs-el v-for="(item, index) in normalizedBreadcrumbs" :key="index" class="qas-page-header__breadcrumbs-el" :label="item.label" :to="item.route" />
|
|
12
|
+
<q-breadcrumbs-el v-for="(item, index) in normalizedBreadcrumbs" :key="index" class="ellipsis inline-block qas-page-header__breadcrumbs-el" :label="item.label" :to="item.route" />
|
|
13
13
|
</q-breadcrumbs>
|
|
14
14
|
</div>
|
|
15
15
|
|
|
@@ -142,6 +142,7 @@ export default {
|
|
|
142
142
|
<style lang="scss">
|
|
143
143
|
.qas-page-header {
|
|
144
144
|
&__breadcrumbs-el {
|
|
145
|
+
max-width: 180px;
|
|
145
146
|
transition: color var(--qas-generic-transition);
|
|
146
147
|
|
|
147
148
|
&.q-breadcrumbs__el:not(.q-router-link--exact-active):hover {
|
|
@@ -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
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="q-mb-xl qas-welcome text-left">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<div class="items-center justify-between row">
|
|
4
|
+
<div>
|
|
5
|
+
<h3 class="text-grey-9 text-h3">
|
|
6
|
+
{{ welcomeMessage }}<span v-if="firstName">, {{ firstName }}</span>
|
|
7
|
+
</h3>
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
<div class="text-caption text-grey-8">{{ currentDay }}</div>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<slot name="actions">
|
|
13
|
+
<qas-actions-menu v-if="hasActionsMenuProps" v-bind="actionsMenuProps" />
|
|
14
|
+
</slot>
|
|
15
|
+
</div>
|
|
8
16
|
|
|
9
17
|
<div v-if="hasShortcuts">
|
|
10
|
-
<
|
|
18
|
+
<qas-label class="q-mt-lg" label="Atalhos" />
|
|
11
19
|
|
|
12
20
|
<div class="qas-welcome__container">
|
|
13
21
|
<div ref="scrollArea" class="row" :class="contentClasses">
|
|
@@ -34,6 +42,11 @@ export default {
|
|
|
34
42
|
},
|
|
35
43
|
|
|
36
44
|
props: {
|
|
45
|
+
actionsMenuProps: {
|
|
46
|
+
default: () => ({}),
|
|
47
|
+
type: Object
|
|
48
|
+
},
|
|
49
|
+
|
|
37
50
|
name: {
|
|
38
51
|
default: '',
|
|
39
52
|
type: String
|
|
@@ -68,6 +81,10 @@ export default {
|
|
|
68
81
|
return this.name.split(' ')?.[0]
|
|
69
82
|
},
|
|
70
83
|
|
|
84
|
+
hasActionsMenuProps () {
|
|
85
|
+
return !!Object.keys(this.actionsMenuProps).length
|
|
86
|
+
},
|
|
87
|
+
|
|
71
88
|
hasShortcuts () {
|
|
72
89
|
return !!this.shortcuts.length
|
|
73
90
|
},
|
|
@@ -4,6 +4,11 @@ meta:
|
|
|
4
4
|
desc: Componente de boas-vindas para ser usado na Home dos sistemas.
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
|
+
actions-menu-props:
|
|
8
|
+
desc: Propriedades repassadas para o QasActionsMenu.
|
|
9
|
+
default: {}
|
|
10
|
+
type: Object
|
|
11
|
+
|
|
7
12
|
name:
|
|
8
13
|
desc: Nome do usuário a ser mostrado na tela.
|
|
9
14
|
type: String
|
|
@@ -12,3 +17,7 @@ props:
|
|
|
12
17
|
desc: Lista de cards de atalhos.
|
|
13
18
|
default: []
|
|
14
19
|
type: Array
|
|
20
|
+
|
|
21
|
+
slots:
|
|
22
|
+
actions:
|
|
23
|
+
desc: Slot para substituir o QasActionsMenu.
|
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'
|