@bildvitta/quasar-ui-asteroid 3.15.0-beta.12 → 3.15.0-beta.14
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/actions-menu/QasActionsMenu.vue +19 -1
- package/src/components/actions-menu/composables/use-options-actions.js +0 -1
- package/src/components/expansion-item/QasExpansionItem.vue +100 -0
- package/src/components/expansion-item/QasExpansionItem.yml +35 -0
- package/src/components/grid-generator/QasGridGenerator.vue +14 -27
- package/src/vue-plugin.js +3 -0
package/package.json
CHANGED
|
@@ -139,9 +139,27 @@ const primaryKey = computed(() => {
|
|
|
139
139
|
return props.splitName in fullList.value ? props.splitName : Object.keys(fullList.value)?.[0]
|
|
140
140
|
})
|
|
141
141
|
|
|
142
|
+
const defaultButtonPropsList = computed(() => {
|
|
143
|
+
const defaultButtonPropsList = {
|
|
144
|
+
useHoverOnWhiteColor: true,
|
|
145
|
+
useLabelOnSmallScreen: false
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const normalizedButtonPropsList = {}
|
|
149
|
+
|
|
150
|
+
for (const key in formattedList.value.buttonsList) {
|
|
151
|
+
normalizedButtonPropsList[key] = {
|
|
152
|
+
...defaultButtonPropsList,
|
|
153
|
+
...formattedList.value.buttonsList[key]
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return normalizedButtonPropsList
|
|
158
|
+
})
|
|
159
|
+
|
|
142
160
|
const btnDropdownProps = computed(() => {
|
|
143
161
|
return {
|
|
144
|
-
buttonsPropsList:
|
|
162
|
+
buttonsPropsList: defaultButtonPropsList.value,
|
|
145
163
|
disable: props.disable,
|
|
146
164
|
useSplit: hasSplit.value
|
|
147
165
|
}
|
|
@@ -15,7 +15,6 @@ export default function useOptionsActions ({ props, color }) {
|
|
|
15
15
|
options: {
|
|
16
16
|
color,
|
|
17
17
|
iconRight: 'sym_r_more_vert',
|
|
18
|
-
useLabelOnSmallScreen: false,
|
|
19
18
|
...props.buttonProps,
|
|
20
19
|
label: getLabel({ useLabel: props.useLabel, label: 'Opções' }) // label não pode ser sobrescrita.
|
|
21
20
|
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="qas-expansion-item" :class="errorClasses">
|
|
3
|
+
<qas-box class="qas-expansion-item__box">
|
|
4
|
+
<q-expansion-item header-class="text-bold q-mt-sm q-pa-none" :label="props.label">
|
|
5
|
+
<template #header>
|
|
6
|
+
<slot name="header">
|
|
7
|
+
<div class="full-width">
|
|
8
|
+
<div class="items-center q-col-gutter-sm row">
|
|
9
|
+
<slot name="label">
|
|
10
|
+
<h5 class="col-auto text-h5 text-weight-medium">
|
|
11
|
+
{{ props.label }}
|
|
12
|
+
</h5>
|
|
13
|
+
</slot>
|
|
14
|
+
|
|
15
|
+
<div class="col-auto items-center q-col-gutter-sm row">
|
|
16
|
+
<div v-for="(badge, badgeIndex) in props.badges" :key="badgeIndex" class="col-auto">
|
|
17
|
+
<qas-badge v-bind="badge" />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</slot>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<q-separator class="q-my-md" />
|
|
26
|
+
|
|
27
|
+
<slot name="content">
|
|
28
|
+
<qas-grid-generator v-if="hasGridGenerator" v-bind="gridGeneratorProps" use-inline />
|
|
29
|
+
</slot>
|
|
30
|
+
</q-expansion-item>
|
|
31
|
+
</qas-box>
|
|
32
|
+
|
|
33
|
+
<div v-if="hasError" class="q-pt-sm qas-expansion-item__error-message text-caption text-negative">
|
|
34
|
+
{{ props.errorMessage }}
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script setup>
|
|
40
|
+
import { computed } from 'vue'
|
|
41
|
+
|
|
42
|
+
defineOptions({ name: 'QasExpansionItem' })
|
|
43
|
+
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
badges: {
|
|
46
|
+
type: Array,
|
|
47
|
+
default: () => []
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
error: {
|
|
51
|
+
type: Boolean
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
errorMessage: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ''
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
label: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ''
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
gridGeneratorProps: {
|
|
65
|
+
type: Object,
|
|
66
|
+
default: () => ({})
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const hasError = computed(() => props.error || !!props.errorMessage)
|
|
71
|
+
|
|
72
|
+
const errorClasses = computed(() => ({ 'qas-expansion-item--error': hasError.value }))
|
|
73
|
+
|
|
74
|
+
const hasGridGenerator = computed(() => !!Object.keys(props.gridGeneratorProps).length)
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style lang="scss">
|
|
78
|
+
.qas-expansion-item {
|
|
79
|
+
$root: &;
|
|
80
|
+
|
|
81
|
+
&--error {
|
|
82
|
+
#{$root}__box {
|
|
83
|
+
border: 2px solid $negative;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#{$root}__error-message {
|
|
87
|
+
padding-left: 12px; // espaçamento igual ao de erro do quasar.
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.q-item {
|
|
92
|
+
margin-top: 0;
|
|
93
|
+
min-height: auto;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.q-item:hover {
|
|
97
|
+
color: initial !important;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type: component
|
|
2
|
+
|
|
3
|
+
meta:
|
|
4
|
+
desc: Componente de card expansivo, wrapper do QExpansionItem(https://quasar.dev/vue-components/expansion-item)
|
|
5
|
+
|
|
6
|
+
props:
|
|
7
|
+
badges:
|
|
8
|
+
desc: Lista de badges que serão exibidas na parte superior do card.
|
|
9
|
+
type: Array
|
|
10
|
+
|
|
11
|
+
error:
|
|
12
|
+
desc: Booleano que caso seja true o card passa a ter uma borda vermelha.
|
|
13
|
+
type: Boolean
|
|
14
|
+
|
|
15
|
+
error-message:
|
|
16
|
+
desc: Mensagem de erro onde será exibida na parte inferior do card.
|
|
17
|
+
type: String
|
|
18
|
+
|
|
19
|
+
label:
|
|
20
|
+
desc: Titulo exibido na parte superior do card.
|
|
21
|
+
type: String
|
|
22
|
+
|
|
23
|
+
grid-generator-props:
|
|
24
|
+
desc: Propriedades que serão repassadas para o QasGridGenerator.
|
|
25
|
+
type: Object
|
|
26
|
+
|
|
27
|
+
slots:
|
|
28
|
+
header:
|
|
29
|
+
desc: 'Slot para substituir o conteúdo do header'
|
|
30
|
+
|
|
31
|
+
label:
|
|
32
|
+
desc: 'Slot para substituir o conteúdo da label do header.'
|
|
33
|
+
|
|
34
|
+
content:
|
|
35
|
+
desc: 'Slot para substituir o conteúdo principal do card.'
|
|
@@ -40,7 +40,7 @@ const props = defineProps({
|
|
|
40
40
|
},
|
|
41
41
|
|
|
42
42
|
headerClass: {
|
|
43
|
-
default: '
|
|
43
|
+
default: '',
|
|
44
44
|
type: [Array, Object, String]
|
|
45
45
|
},
|
|
46
46
|
|
|
@@ -77,37 +77,24 @@ const hasResult = computed(() => Object.keys(props.result).length)
|
|
|
77
77
|
const hasFields = computed(() => Object.keys(props.fields).length)
|
|
78
78
|
|
|
79
79
|
const contentClass = computed(() => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (Array.isArray(props.contentClass)) {
|
|
83
|
-
return [...props.contentClass, 'ellipsis']
|
|
84
|
-
}
|
|
80
|
+
return [
|
|
81
|
+
props.contentClass,
|
|
85
82
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
...props.contentClass,
|
|
92
|
-
ellipsis: true
|
|
93
|
-
}
|
|
83
|
+
{
|
|
84
|
+
ellipsis: !screen.isSmall && props.useEllipsis
|
|
85
|
+
}
|
|
86
|
+
]
|
|
94
87
|
})
|
|
95
88
|
|
|
96
89
|
const headerClass = computed(() => {
|
|
97
|
-
|
|
90
|
+
return [
|
|
91
|
+
props.headerClass,
|
|
98
92
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return `${props.headerClass} ellipsis`
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
...props.headerClass,
|
|
109
|
-
ellipsis: true
|
|
110
|
-
}
|
|
93
|
+
{
|
|
94
|
+
ellipsis: !screen.isSmall && props.useEllipsis,
|
|
95
|
+
'text-bold': screen.isSmall || !props.useInline
|
|
96
|
+
}
|
|
97
|
+
]
|
|
111
98
|
})
|
|
112
99
|
|
|
113
100
|
const classes = computed(() => {
|
package/src/vue-plugin.js
CHANGED
|
@@ -23,6 +23,7 @@ import QasDialog from './components/dialog/QasDialog.vue'
|
|
|
23
23
|
import QasDialogRouter from './components/dialog-router/QasDialogRouter.vue'
|
|
24
24
|
import QasDrawer from './components/drawer/QasDrawer.vue'
|
|
25
25
|
import QasEmptyResultText from './components/empty-result-text/QasEmptyResultText.vue'
|
|
26
|
+
import QasExpansionItem from './components/expansion-item/QasExpansionItem.vue'
|
|
26
27
|
import QasField from './components/field/QasField.vue'
|
|
27
28
|
import QasFilters from './components/filters/QasFilters.vue'
|
|
28
29
|
import QasFormGenerator from './components/form-generator/QasFormGenerator.vue'
|
|
@@ -115,6 +116,7 @@ async function install (app) {
|
|
|
115
116
|
app.component('QasDialogRouter', QasDialogRouter)
|
|
116
117
|
app.component('QasDrawer', QasDrawer)
|
|
117
118
|
app.component('QasEmptyResultText', QasEmptyResultText)
|
|
119
|
+
app.component('QasExpansionItem', QasExpansionItem)
|
|
118
120
|
app.component('QasField', QasField)
|
|
119
121
|
app.component('QasFilters', QasFilters)
|
|
120
122
|
app.component('QasFormGenerator', QasFormGenerator)
|
|
@@ -208,6 +210,7 @@ export {
|
|
|
208
210
|
QasDialogRouter,
|
|
209
211
|
QasDrawer,
|
|
210
212
|
QasEmptyResultText,
|
|
213
|
+
QasExpansionItem,
|
|
211
214
|
QasField,
|
|
212
215
|
QasFilters,
|
|
213
216
|
QasFormGenerator,
|