@bildvitta/quasar-ui-asteroid 3.16.1 → 3.17.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 +51 -3
- package/src/components/badge/QasBadge.yml +29 -2
- package/src/components/box/QasBox.vue +26 -3
- package/src/components/box/QasBox.yml +16 -0
- package/src/components/card/QasCard.vue +38 -25
- package/src/components/chart-view/QasChartView.vue +13 -13
- package/src/components/{checkbox-group/QasCheckboxGroup.vue → checkbox/QasCheckbox.vue} +34 -12
- package/src/components/date-time-input/QasDateTimeInput.vue +13 -3
- package/src/components/field/QasField.vue +18 -13
- package/src/components/filters/QasFilters.vue +16 -7
- package/src/components/filters/private/PvFiltersButton.vue +2 -1
- package/src/components/form-generator/QasFormGenerator.vue +62 -26
- package/src/components/form-generator/QasFormGenerator.yml +21 -2
- package/src/components/gallery-card/QasGalleryCard.vue +10 -3
- package/src/components/grid-generator/QasGridGenerator.vue +22 -13
- package/src/components/grid-generator/QasGridGenerator.yml +18 -2
- package/src/components/grid-item/QasGridItem.vue +89 -0
- package/src/components/grid-item/QasGridItem.yml +22 -0
- package/src/components/header/QasHeader.vue +106 -0
- package/src/components/header/QasHeader.yml +45 -0
- package/src/components/info/QasInfo.vue +155 -0
- package/src/components/info/QasInfo.yml +34 -0
- package/src/components/input/QasInput.vue +48 -3
- package/src/components/input/QasInput.yml +10 -0
- package/src/components/nested-fields/QasNestedFields.vue +58 -47
- package/src/components/nested-fields/QasNestedFields.yml +5 -0
- package/src/components/numeric-input/QasNumericInput.vue +38 -3
- package/src/components/numeric-input/QasNumericInput.yml +10 -0
- package/src/components/page-header/QasPageHeader.vue +5 -5
- package/src/components/page-header/QasPageHeader.yml +2 -2
- package/src/components/radio/QasRadio.vue +43 -0
- package/src/components/radio/QasRadio.yml +5 -0
- package/src/components/search-input/QasSearchInput.vue +7 -19
- package/src/components/select/QasSelect.vue +82 -10
- package/src/components/table-generator/QasTableGenerator.vue +2 -5
- package/src/components/tabs-generator/QasTabsGenerator.vue +3 -1
- package/src/components/toggle/QasToggle.vue +14 -0
- package/src/components/toggle/QasToggle.yml +5 -0
- package/src/composables/private/use-generator.js +9 -1
- package/src/css/components/checkbox.scss +2 -0
- package/src/css/components/field.scss +59 -2
- package/src/css/components/radio.scss +3 -1
- package/src/css/components/toggle.scss +3 -1
- package/src/helpers/get-placeholder.js +19 -0
- package/src/helpers/index.js +1 -0
- package/src/vue-plugin.js +18 -6
- package/src/components/header-actions/QasHeaderActions.vue +0 -76
- package/src/components/header-actions/QasHeaderActions.yml +0 -38
- /package/src/components/{checkbox-group/QasCheckboxGroup.yml → checkbox/QasCheckbox.yml} +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex items-center no-wrap qas-info text-body1 text-grey-8">
|
|
3
|
+
<qas-avatar v-bind="defaultAvatarProps" />
|
|
4
|
+
|
|
5
|
+
<component
|
|
6
|
+
:is="textComponent"
|
|
7
|
+
v-if="useRegex"
|
|
8
|
+
class="q-ml-sm"
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<span
|
|
12
|
+
v-else
|
|
13
|
+
class="q-ml-sm"
|
|
14
|
+
>
|
|
15
|
+
{{ props.text }}
|
|
16
|
+
</span>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { h, computed } from 'vue'
|
|
22
|
+
import { RouterLink } from 'vue-router'
|
|
23
|
+
import { QasBtn } from 'asteroid'
|
|
24
|
+
|
|
25
|
+
defineOptions({ name: 'QasInfo' })
|
|
26
|
+
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
avatarProps: {
|
|
29
|
+
type: Object,
|
|
30
|
+
default: () => ({})
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
buttonProps: {
|
|
34
|
+
type: Object,
|
|
35
|
+
default: () => ({})
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
routerLinkProps: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: () => ({})
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
text: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: true
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
useRegex: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const defaultAvatarProps = computed(() => {
|
|
55
|
+
return {
|
|
56
|
+
color: 'red-14',
|
|
57
|
+
...props.avatarProps,
|
|
58
|
+
icon: 'sym_r_priority_high',
|
|
59
|
+
size: 'sm'
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const textComponent = computed(() => {
|
|
64
|
+
/**
|
|
65
|
+
* regex para encontrar caracteres que estiverem dentro de [].
|
|
66
|
+
*/
|
|
67
|
+
const regex = /\[.*?\]/g
|
|
68
|
+
|
|
69
|
+
const [content] = props.text.match(regex)
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* dado o texto: Para saber mais, [Clique aqui].
|
|
73
|
+
*
|
|
74
|
+
* retorna: 'Clique aqui'
|
|
75
|
+
*/
|
|
76
|
+
const routerLabel = content.replaceAll(/[[\]]/g, '')
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* dado o texto: Para saber mais, [Clique aqui].
|
|
80
|
+
*
|
|
81
|
+
* retorna: 'Para saber mais, $.'
|
|
82
|
+
*/
|
|
83
|
+
const replacedText = props.text.replaceAll(regex, '$')
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* É necessário usar o regex ao invés de '$' para ele não remover o carácter
|
|
87
|
+
* ao fazer o split
|
|
88
|
+
*
|
|
89
|
+
* dado o texto: 'Para saber mais, [Clique aqui].'
|
|
90
|
+
*
|
|
91
|
+
* retorna: ['Para saber mais,', '$', '.']
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
const splitted = replacedText.split(/(\$)/)
|
|
95
|
+
|
|
96
|
+
const index = splitted.findIndex(item => item === '$')
|
|
97
|
+
|
|
98
|
+
const hasButtonProps = !!Object.keys(props.buttonProps).length
|
|
99
|
+
|
|
100
|
+
const getRouterLinkRender = () => {
|
|
101
|
+
return h(
|
|
102
|
+
RouterLink,
|
|
103
|
+
{
|
|
104
|
+
...props.routerLinkProps,
|
|
105
|
+
class: 'text-primary text-subtitle1 qas-info__link'
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
default: () => routerLabel
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const getQasBtnRender = () => {
|
|
114
|
+
return h(
|
|
115
|
+
QasBtn,
|
|
116
|
+
{
|
|
117
|
+
variant: 'tertiary',
|
|
118
|
+
label: routerLabel,
|
|
119
|
+
...props.buttonProps
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Cria um render do router link ou QasBtn
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
*
|
|
129
|
+
* ```html
|
|
130
|
+
* <router-link
|
|
131
|
+
* class="text-primary text-subtitle1 qas-info__link"
|
|
132
|
+
* :to="props.route"
|
|
133
|
+
* >
|
|
134
|
+
* Clique aqui
|
|
135
|
+
* </router-link>
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
const renderComponent = hasButtonProps ? getQasBtnRender() : getRouterLinkRender()
|
|
139
|
+
|
|
140
|
+
splitted.splice(index, 1, renderComponent)
|
|
141
|
+
|
|
142
|
+
return h(
|
|
143
|
+
'span',
|
|
144
|
+
splitted
|
|
145
|
+
)
|
|
146
|
+
})
|
|
147
|
+
</script>
|
|
148
|
+
|
|
149
|
+
<style lang="scss">
|
|
150
|
+
.qas-info {
|
|
151
|
+
&__link {
|
|
152
|
+
text-decoration: none;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type: component
|
|
2
|
+
|
|
3
|
+
meta:
|
|
4
|
+
desc: Componente para informações.
|
|
5
|
+
|
|
6
|
+
props:
|
|
7
|
+
avatar-props:
|
|
8
|
+
desc: Props do componente QasAvatar.
|
|
9
|
+
default:
|
|
10
|
+
color: 'red-14'
|
|
11
|
+
icon: 'sym_r_priority_high'
|
|
12
|
+
size: 'sm'
|
|
13
|
+
type: Object
|
|
14
|
+
|
|
15
|
+
buttonProps:
|
|
16
|
+
desc: Props do componente QasBtn.
|
|
17
|
+
default:
|
|
18
|
+
variant: primary
|
|
19
|
+
type: Object
|
|
20
|
+
|
|
21
|
+
router-link-props:
|
|
22
|
+
desc: Propriedades do componente RouterLink.
|
|
23
|
+
default: {}
|
|
24
|
+
type: Object
|
|
25
|
+
|
|
26
|
+
text:
|
|
27
|
+
desc: Texto a ser exibido.
|
|
28
|
+
type: String
|
|
29
|
+
default: ''
|
|
30
|
+
|
|
31
|
+
use-regex:
|
|
32
|
+
desc: Faz a busca pelos "[]" dentro da propriedade "text" para substituir pelo QasBtn ou RouterLink.
|
|
33
|
+
default: true
|
|
34
|
+
type: Boolean
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template>
|
|
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">
|
|
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" #append>
|
|
4
|
+
<q-icon :name="icon" size="xs" />
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<template v-if="iconRight" #prepend>
|
|
8
|
+
<q-icon :name="iconRight" size="xs" />
|
|
9
|
+
</template>
|
|
10
|
+
|
|
3
11
|
<template v-for="(_, name) in $slots" #[name]="context">
|
|
4
12
|
<slot :name="name" v-bind="context || {}" />
|
|
5
13
|
</template>
|
|
@@ -7,7 +15,7 @@
|
|
|
7
15
|
</template>
|
|
8
16
|
|
|
9
17
|
<script>
|
|
10
|
-
import { getRequiredLabel } from '../../helpers'
|
|
18
|
+
import { getRequiredLabel, getPlaceholder } from '../../helpers'
|
|
11
19
|
|
|
12
20
|
const Masks = {
|
|
13
21
|
CompanyDocument: 'company-document',
|
|
@@ -23,6 +31,11 @@ export default {
|
|
|
23
31
|
inheritAttrs: false,
|
|
24
32
|
|
|
25
33
|
props: {
|
|
34
|
+
dense: {
|
|
35
|
+
default: true,
|
|
36
|
+
type: Boolean
|
|
37
|
+
},
|
|
38
|
+
|
|
26
39
|
error: {
|
|
27
40
|
type: Boolean
|
|
28
41
|
},
|
|
@@ -43,7 +56,6 @@ export default {
|
|
|
43
56
|
},
|
|
44
57
|
|
|
45
58
|
outlined: {
|
|
46
|
-
default: true,
|
|
47
59
|
type: Boolean
|
|
48
60
|
},
|
|
49
61
|
|
|
@@ -58,6 +70,16 @@ export default {
|
|
|
58
70
|
|
|
59
71
|
useRemoveErrorOnType: {
|
|
60
72
|
type: Boolean
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
icon: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: ''
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
iconRight: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: ''
|
|
61
83
|
}
|
|
62
84
|
},
|
|
63
85
|
|
|
@@ -119,6 +141,29 @@ export default {
|
|
|
119
141
|
const { label } = this.$attrs
|
|
120
142
|
|
|
121
143
|
return getRequiredLabel({ label, required: this.required })
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
// redesign
|
|
147
|
+
classes () {
|
|
148
|
+
return {
|
|
149
|
+
'qas-input--has-icon': this.hasPrepend
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
isTextarea () {
|
|
154
|
+
return this.$attrs.type === 'textarea'
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
placeholder () {
|
|
158
|
+
return this.$attrs.placeholder || getPlaceholder(this.mask || this.$attrs.type)
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
hasCounter () {
|
|
162
|
+
return this.$attrs.counter ?? (this.$attrs.maxlength && this.isTextarea)
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
hasPrepend () {
|
|
166
|
+
return !!this.$slots.prepend || this.iconRight
|
|
122
167
|
}
|
|
123
168
|
},
|
|
124
169
|
|
|
@@ -15,6 +15,16 @@ props:
|
|
|
15
15
|
desc: Controla cor da borda do input.
|
|
16
16
|
type: Boolean
|
|
17
17
|
|
|
18
|
+
icon:
|
|
19
|
+
desc: Ícone a esquerda.
|
|
20
|
+
type: String
|
|
21
|
+
default: ''
|
|
22
|
+
|
|
23
|
+
icon-right:
|
|
24
|
+
desc: Ícone a direita.
|
|
25
|
+
type: String
|
|
26
|
+
default: ''
|
|
27
|
+
|
|
18
28
|
mask:
|
|
19
29
|
desc: Máscara do input, é possível passar um slug de mascara ou um pattern personalizado.
|
|
20
30
|
type: String
|
|
@@ -1,61 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :id="fieldName" class="qas-nested-fields" :data-cy="`nested-fields-${fieldName}`">
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
3
|
+
<component :is="containerComponent">
|
|
4
|
+
<div v-if="useSingleLabel" class="text-left">
|
|
5
|
+
<qas-label :label="fieldLabel" typography="h5" />
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div ref="inputContent">
|
|
9
|
+
<component :is="componentTag" v-bind="componentProps">
|
|
10
|
+
<template v-for="(row, index) in nested" :key="`row-${index}`">
|
|
11
|
+
<div v-if="!row[destroyKey]" :id="`row-${index}`" class="full-width qas-nested-fields__field-item" data-cy="nested-fields-item">
|
|
12
|
+
<header v-if="hasHeader" class="flex items-center q-pb-md" :class="headerClasses">
|
|
13
|
+
<qas-label v-if="!useSingleLabel" :label="getRowLabel(index)" margin="none" typography="h5" />
|
|
14
|
+
|
|
15
|
+
<qas-actions-menu v-if="hasBlockActions(row)" v-bind="getActionsMenuProps(index, row)" :use-label="false" />
|
|
16
|
+
</header>
|
|
17
|
+
|
|
18
|
+
<slot :errors="transformedErrors" :fields="getFields(index, row)" :index="index" :model="nested[index]" name="before-fields" :update-value="updateValuesFromInput" />
|
|
19
|
+
|
|
20
|
+
<div ref="formGenerator" class="col-12 justify-between q-col-gutter-x-md row">
|
|
21
|
+
<slot :errors="transformedErrors" :fields="getFields(index, row)" :index="index" name="fields" :update-value="updateValuesFromInput">
|
|
22
|
+
<qas-form-generator v-model="nested[index]" class="col" :columns="formColumns" :disable="isDisabledRow(row)" :errors="transformedErrors[index]" :fields="getFields(index, row)" :fields-props="getFieldsProps(index, row)" :gutter="formGutter" @update:model-value="updateValuesFromInput($event, index)">
|
|
23
|
+
<template v-for="(slot, key) in $slots" #[key]="scope">
|
|
24
|
+
<slot v-bind="scope" :disabled="isDisabledRow(row)" :errors="transformedErrors" :index="index" :name="key" />
|
|
25
|
+
</template>
|
|
26
|
+
</qas-form-generator>
|
|
27
|
+
</slot>
|
|
28
|
+
|
|
29
|
+
<div v-if="hasInlineActions(row)" class="flex items-center qas-nested-fields__actions">
|
|
30
|
+
<qas-actions-menu v-bind="getActionsMenuProps(index, row)" :use-label="false" />
|
|
31
|
+
</div>
|
|
29
32
|
</div>
|
|
33
|
+
|
|
34
|
+
<slot :errors="transformedErrors" :fields="getFields(index, row)" :index="index" :model="nested[index]" name="after-fields" :update-value="updateValuesFromInput" />
|
|
30
35
|
</div>
|
|
36
|
+
</template>
|
|
37
|
+
</component>
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
<div v-if="useAdd">
|
|
40
|
+
<slot :add="add" name="add-input">
|
|
41
|
+
<div v-if="showAddFirstInputButton" class="text-left">
|
|
42
|
+
<qas-btn class="q-px-sm" color="primary" data-cy="nested-fields-add-btn" :label="addFirstInputLabel" variant="tertiary" @click="add()" />
|
|
43
|
+
</div>
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</div>
|
|
45
|
+
<div v-else-if="useInlineActions" class="cursor-pointer items-center q-col-gutter-x-md q-mt-md row" data-cy="nested-fields-add-btn" @click="add()">
|
|
46
|
+
<div class="col">
|
|
47
|
+
<qas-input class="disabled no-pointer-events" hide-bottom-space :label="addInputLabel" @focus="add()" />
|
|
48
|
+
</div>
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
<div class="col-auto">
|
|
51
|
+
<qas-btn color="primary" icon="sym_r_add_circle_outline" variant="tertiary" />
|
|
52
|
+
</div>
|
|
46
53
|
</div>
|
|
47
54
|
|
|
48
|
-
<div class="
|
|
49
|
-
<qas-btn color="primary" icon="
|
|
55
|
+
<div v-else class="text-left">
|
|
56
|
+
<qas-btn class="q-px-sm" color="primary" data-cy="nested-fields-add-btn" icon="sym_r_add" :label="addInputLabel" variant="tertiary" @click="add()" />
|
|
50
57
|
</div>
|
|
51
|
-
</
|
|
52
|
-
|
|
53
|
-
<div v-else class="text-left">
|
|
54
|
-
<qas-btn class="q-px-sm" color="primary" data-cy="nested-fields-add-btn" icon="sym_r_add" :label="addInputLabel" variant="tertiary" @click="add()" />
|
|
55
|
-
</div>
|
|
56
|
-
</slot>
|
|
58
|
+
</slot>
|
|
59
|
+
</div>
|
|
57
60
|
</div>
|
|
58
|
-
</
|
|
61
|
+
</component>
|
|
59
62
|
</div>
|
|
60
63
|
</template>
|
|
61
64
|
|
|
@@ -195,6 +198,10 @@ export default {
|
|
|
195
198
|
default: true
|
|
196
199
|
},
|
|
197
200
|
|
|
201
|
+
useBox: {
|
|
202
|
+
type: Boolean
|
|
203
|
+
},
|
|
204
|
+
|
|
198
205
|
useDestroyAlways: {
|
|
199
206
|
type: Boolean,
|
|
200
207
|
default: undefined
|
|
@@ -252,6 +259,10 @@ export default {
|
|
|
252
259
|
return this.field?.children
|
|
253
260
|
},
|
|
254
261
|
|
|
262
|
+
containerComponent () {
|
|
263
|
+
return this.useBox ? 'qas-box' : 'div'
|
|
264
|
+
},
|
|
265
|
+
|
|
255
266
|
componentTag () {
|
|
256
267
|
return this.useAnimation ? 'transition-group' : 'div'
|
|
257
268
|
},
|
|
@@ -113,6 +113,11 @@ props:
|
|
|
113
113
|
default: true
|
|
114
114
|
type: Boolean
|
|
115
115
|
|
|
116
|
+
use-box:
|
|
117
|
+
desc: Controla o QasBox.
|
|
118
|
+
default: false
|
|
119
|
+
type: Boolean
|
|
120
|
+
|
|
116
121
|
use-destroy-always:
|
|
117
122
|
desc: Controla o botão de remover em todas linhas, incluindo a primeira.
|
|
118
123
|
type: Boolean
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-field :label="formattedLabel" :model-value="modelValue"
|
|
2
|
+
<q-field class="qas-numeric-input" :class="classes" dense :label="formattedLabel" :model-value="modelValue" no-error-icon>
|
|
3
3
|
<template #control="{ floatingLabel, id, editable }">
|
|
4
|
-
<input v-show="floatingLabel" :id="id" ref="input" class="q-field__input" :disabled="!editable" inputmode="numeric" @blur="emitValue" @click="setSelect" @input="emitUpdateModel($event.target.value)">
|
|
4
|
+
<input v-show="floatingLabel" :id="id" ref="input" class="q-field__input" :disabled="!editable" inputmode="numeric" :placeholder @blur="emitValue" @click="setSelect" @input="emitUpdateModel($event.target.value)">
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<template v-if="icon" #append>
|
|
8
|
+
<q-icon :name="icon" size="xs" />
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<template v-if="iconRight" #prepend>
|
|
12
|
+
<q-icon :name="iconRight" size="xs" />
|
|
5
13
|
</template>
|
|
6
14
|
</q-field>
|
|
7
15
|
</template>
|
|
8
16
|
|
|
9
17
|
<script>
|
|
10
18
|
import AutoNumeric from 'autonumeric'
|
|
11
|
-
import { getRequiredLabel } from '../../helpers'
|
|
19
|
+
import { getRequiredLabel, getPlaceholder } from '../../helpers'
|
|
12
20
|
|
|
13
21
|
const defaultModes = {
|
|
14
22
|
decimal: 'commaDecimalCharDotSeparator',
|
|
@@ -71,6 +79,16 @@ export default {
|
|
|
71
79
|
usePositive: {
|
|
72
80
|
default: true,
|
|
73
81
|
type: Boolean
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
icon: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: ''
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
iconRight: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: ''
|
|
74
92
|
}
|
|
75
93
|
},
|
|
76
94
|
|
|
@@ -92,6 +110,23 @@ export default {
|
|
|
92
110
|
|
|
93
111
|
formattedLabel () {
|
|
94
112
|
return getRequiredLabel({ label: this.label, required: this.required })
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
// redesign
|
|
116
|
+
classes () {
|
|
117
|
+
return {
|
|
118
|
+
'qas-numeric-input--has-icon': this.hasPrepend
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
hasPrepend () {
|
|
123
|
+
return !!this.$slots.prepend || this.iconRight
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
placeholder () {
|
|
127
|
+
const { placeholder } = this.$attrs
|
|
128
|
+
|
|
129
|
+
return placeholder || getPlaceholder(this.mode)
|
|
95
130
|
}
|
|
96
131
|
},
|
|
97
132
|
|
|
@@ -12,6 +12,16 @@ props:
|
|
|
12
12
|
default: {}
|
|
13
13
|
type: Object
|
|
14
14
|
|
|
15
|
+
icon:
|
|
16
|
+
desc: Ícone a esquerda.
|
|
17
|
+
type: String
|
|
18
|
+
default: ''
|
|
19
|
+
|
|
20
|
+
icon-right:
|
|
21
|
+
desc: Ícone a direita.
|
|
22
|
+
type: String
|
|
23
|
+
default: ''
|
|
24
|
+
|
|
15
25
|
places:
|
|
16
26
|
desc: Quantidade de casas decimais.
|
|
17
27
|
default: 2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<q-toolbar class="justify-between q-mb-
|
|
3
|
+
<q-toolbar class="justify-between q-mb-md q-px-none qas-page-header">
|
|
4
4
|
<div class="ellipsis">
|
|
5
5
|
<q-toolbar-title v-if="props.title" class="text-h3">
|
|
6
6
|
{{ props.title }}
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
|
|
19
19
|
<div>
|
|
20
20
|
<slot name="bottom">
|
|
21
|
-
<qas-header
|
|
21
|
+
<qas-header v-if="hasHeader" v-bind="props.headerProps" />
|
|
22
22
|
</slot>
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script setup>
|
|
28
|
-
import
|
|
28
|
+
import QasHeader from '../header/QasHeader.vue'
|
|
29
29
|
|
|
30
30
|
import { castArray } from 'lodash-es'
|
|
31
31
|
import { computed } from 'vue'
|
|
@@ -40,7 +40,7 @@ const props = defineProps({
|
|
|
40
40
|
type: [Array, String]
|
|
41
41
|
},
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
headerProps: {
|
|
44
44
|
default: () => ({}),
|
|
45
45
|
type: Object
|
|
46
46
|
},
|
|
@@ -111,7 +111,7 @@ const normalizedBreadcrumbs = computed(() => {
|
|
|
111
111
|
]
|
|
112
112
|
})
|
|
113
113
|
|
|
114
|
-
const
|
|
114
|
+
const hasHeader = computed(() => !!Object.keys(props.headerProps).length)
|
|
115
115
|
|
|
116
116
|
const homeRoute = computed(() => router.hasRoute('Root') ? { name: 'Root' } : '/')
|
|
117
117
|
</script>
|
|
@@ -15,7 +15,7 @@ props:
|
|
|
15
15
|
desc: Título do cabeçalho.
|
|
16
16
|
type: String
|
|
17
17
|
|
|
18
|
-
header-
|
|
18
|
+
header-props:
|
|
19
19
|
desc: Propriedades do QasHeaderActions.
|
|
20
20
|
default: {}
|
|
21
21
|
type: Object
|
|
@@ -39,4 +39,4 @@ slots:
|
|
|
39
39
|
desc: slot para acessar abaixo do titulo e breadcrumbs.
|
|
40
40
|
|
|
41
41
|
default:
|
|
42
|
-
desc: slot para acessar lado direito do titulo e breadcrumbs.
|
|
42
|
+
desc: slot para acessar lado direito do titulo e breadcrumbs.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="component.is" v-bind="component.props" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, useAttrs } from 'vue'
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'QasRadio',
|
|
10
|
+
inheritAttrs: false
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const attrs = useAttrs()
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* - quando é um grupo de opções, o componente é 'QOptionGroup', caso contrário,
|
|
17
|
+
* é 'QRadio'.
|
|
18
|
+
* - a propriedade inline só é usada no caso do QOptionGroup.
|
|
19
|
+
* - todos os casos é usado o dense.
|
|
20
|
+
*/
|
|
21
|
+
const component = computed(() => {
|
|
22
|
+
const isOptionGroup = !!attrs.options?.length
|
|
23
|
+
|
|
24
|
+
const { inline = true, ...payloadProps } = attrs
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
is: isOptionGroup ? 'q-option-group' : 'q-radio',
|
|
28
|
+
props: {
|
|
29
|
+
...payloadProps,
|
|
30
|
+
|
|
31
|
+
...(isOptionGroup && {
|
|
32
|
+
inline,
|
|
33
|
+
class: {
|
|
34
|
+
'q-gutter-x-md': inline,
|
|
35
|
+
'q-gutter-y-md': !inline
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
|
|
39
|
+
dense: true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
</script>
|