@bildvitta/quasar-ui-asteroid 3.17.0-beta.14 → 3.17.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/avatar/QasAvatar.vue +7 -8
- package/src/components/chart-view/QasChartView.vue +1 -1
- package/src/components/checkbox/QasCheckbox.vue +30 -9
- package/src/components/checkbox/QasCheckbox.yml +5 -0
- package/src/components/copy/QasCopy.vue +6 -1
- package/src/components/copy/QasCopy.yml +5 -0
- package/src/components/expansion-item/QasExpansionItem.vue +14 -4
- package/src/components/expansion-item/QasExpansionItem.yml +5 -0
- package/src/components/radio/QasRadio.vue +24 -5
- package/src/components/radio/QasRadio.yml +6 -0
- package/src/components/table-generator/QasTableGenerator.vue +3 -0
- package/src/helpers/set-scroll-on-grab.js +1 -1
package/package.json
CHANGED
|
@@ -19,12 +19,7 @@ defineOptions({
|
|
|
19
19
|
const props = defineProps({
|
|
20
20
|
color: {
|
|
21
21
|
type: String,
|
|
22
|
-
default: AvatarColors.Primary
|
|
23
|
-
validator: value => {
|
|
24
|
-
const availableColors = Object.values(AvatarColors)
|
|
25
|
-
|
|
26
|
-
return availableColors.includes(value)
|
|
27
|
-
}
|
|
22
|
+
default: AvatarColors.Primary
|
|
28
23
|
},
|
|
29
24
|
|
|
30
25
|
size: {
|
|
@@ -42,6 +37,11 @@ const props = defineProps({
|
|
|
42
37
|
type: String
|
|
43
38
|
},
|
|
44
39
|
|
|
40
|
+
textColor: {
|
|
41
|
+
default: '',
|
|
42
|
+
type: String
|
|
43
|
+
},
|
|
44
|
+
|
|
45
45
|
title: {
|
|
46
46
|
default: '',
|
|
47
47
|
type: String
|
|
@@ -62,7 +62,6 @@ const attributes = computed(() => {
|
|
|
62
62
|
rounded,
|
|
63
63
|
square,
|
|
64
64
|
fontSize,
|
|
65
|
-
textColor,
|
|
66
65
|
...attributes
|
|
67
66
|
} = attrs
|
|
68
67
|
|
|
@@ -76,7 +75,7 @@ const attributes = computed(() => {
|
|
|
76
75
|
return {
|
|
77
76
|
size: props.size,
|
|
78
77
|
color: props.color,
|
|
79
|
-
textColor: colors[props.color],
|
|
78
|
+
textColor: colors[props.color] || props.textColor,
|
|
80
79
|
...attributes
|
|
81
80
|
}
|
|
82
81
|
})
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<!-- Single -->
|
|
4
|
-
<q-checkbox v-if="isSingle" v-model="model" v-bind="
|
|
4
|
+
<q-checkbox v-if="isSingle" v-model="model" v-bind="singleAttributes" dense>
|
|
5
5
|
<slot />
|
|
6
6
|
</q-checkbox>
|
|
7
7
|
|
|
8
8
|
<!-- Group -->
|
|
9
|
-
<div v-else
|
|
10
|
-
<div v-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
<div v-else>
|
|
10
|
+
<div v-if="hasCheckboxLabel" class="q-mb-sm text-body1">
|
|
11
|
+
{{ props.label }}
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div :class="classes">
|
|
15
|
+
<div v-for="(option, index) in props.options" :key="index">
|
|
16
|
+
<!-- Com children -->
|
|
17
|
+
<q-checkbox v-if="hasChildren(option)" :class="getCheckboxClass(option)" dense :label="option.label" :model-value="getModelValue(index)" @update:model-value="updateCheckbox($event, option, index)" />
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
<!-- Com children -->
|
|
20
|
+
<q-option-group v-if="hasChildren(option)" class="q-ml-xs q-mt-xs" dense :inline="props.inline" :model-value="props.modelValue" :options="option.children" type="checkbox" @update:model-value="updateChildren($event, option, index)" />
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
<!-- Sem children -->
|
|
23
|
+
<q-option-group v-else v-model="model" v-bind="attrs" dense :options="[option]" type="checkbox" />
|
|
24
|
+
</div>
|
|
19
25
|
</div>
|
|
20
26
|
</div>
|
|
21
27
|
</div>
|
|
@@ -30,6 +36,11 @@ defineOptions({
|
|
|
30
36
|
})
|
|
31
37
|
|
|
32
38
|
const props = defineProps({
|
|
39
|
+
label: {
|
|
40
|
+
default: '',
|
|
41
|
+
type: String
|
|
42
|
+
},
|
|
43
|
+
|
|
33
44
|
options: {
|
|
34
45
|
default: () => [],
|
|
35
46
|
type: Array
|
|
@@ -59,6 +70,8 @@ onMounted(handleParent)
|
|
|
59
70
|
// computed
|
|
60
71
|
const classes = computed(() => props.inline && 'flex q-gutter-x-sm')
|
|
61
72
|
|
|
73
|
+
const hasCheckboxLabel = computed(() => !!props.label)
|
|
74
|
+
|
|
62
75
|
const model = computed({
|
|
63
76
|
get () {
|
|
64
77
|
return props.modelValue
|
|
@@ -71,6 +84,14 @@ const model = computed({
|
|
|
71
84
|
|
|
72
85
|
const isSingle = computed(() => !props.options.length)
|
|
73
86
|
|
|
87
|
+
const singleAttributes = computed(() => {
|
|
88
|
+
return {
|
|
89
|
+
...attrs,
|
|
90
|
+
|
|
91
|
+
label: props.label
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
74
95
|
// watch
|
|
75
96
|
watch(() => props.options, handleParent)
|
|
76
97
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span>
|
|
3
|
-
<slot>{{ props.text }}</slot>
|
|
3
|
+
<slot v-if="props.useText">{{ props.text }}</slot>
|
|
4
4
|
|
|
5
5
|
<qas-btn class="q-ml-xs" color="primary" :icon="props.icon" :loading="isLoading" variant="tertiary" @click.stop.prevent="copy">
|
|
6
6
|
<q-tooltip>Copiar</q-tooltip>
|
|
@@ -23,6 +23,11 @@ const props = defineProps({
|
|
|
23
23
|
text: {
|
|
24
24
|
required: true,
|
|
25
25
|
type: String
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
useText: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
26
31
|
}
|
|
27
32
|
})
|
|
28
33
|
|
|
@@ -83,6 +83,11 @@ const props = defineProps({
|
|
|
83
83
|
default: ''
|
|
84
84
|
},
|
|
85
85
|
|
|
86
|
+
gridGeneratorProps: {
|
|
87
|
+
type: Object,
|
|
88
|
+
default: () => ({})
|
|
89
|
+
},
|
|
90
|
+
|
|
86
91
|
group: {
|
|
87
92
|
type: String,
|
|
88
93
|
default: undefined
|
|
@@ -93,9 +98,9 @@ const props = defineProps({
|
|
|
93
98
|
default: ''
|
|
94
99
|
},
|
|
95
100
|
|
|
96
|
-
|
|
97
|
-
type:
|
|
98
|
-
default:
|
|
101
|
+
maxContentHeight: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: ''
|
|
99
104
|
},
|
|
100
105
|
|
|
101
106
|
useHeaderSeparator: {
|
|
@@ -156,7 +161,8 @@ const classes = computed(() => {
|
|
|
156
161
|
const contentClasses = computed(() => {
|
|
157
162
|
return {
|
|
158
163
|
'q-mt-sm': isNestedExpansionItem,
|
|
159
|
-
'q-mt-md': !isNestedExpansionItem && !props.useHeaderSeparator
|
|
164
|
+
'q-mt-md': !isNestedExpansionItem && !props.useHeaderSeparator,
|
|
165
|
+
'qas-expansion-item__content overflow-auto': !!props.maxContentHeight
|
|
160
166
|
}
|
|
161
167
|
})
|
|
162
168
|
|
|
@@ -250,6 +256,10 @@ function setHasNextSibling (value) {
|
|
|
250
256
|
}
|
|
251
257
|
}
|
|
252
258
|
|
|
259
|
+
&__content {
|
|
260
|
+
max-height: v-bind("props.maxContentHeight");
|
|
261
|
+
}
|
|
262
|
+
|
|
253
263
|
// em alguns casos quando usado com grid, o espaçamento afetava o header, com z-index o problema é resolvido
|
|
254
264
|
&__header {
|
|
255
265
|
position: relative;
|
|
@@ -40,6 +40,11 @@ props:
|
|
|
40
40
|
default: false
|
|
41
41
|
type: Boolean
|
|
42
42
|
|
|
43
|
+
max-content-height:
|
|
44
|
+
desc: Define um tamanho máximo de altura do conteúdo.
|
|
45
|
+
default: ''
|
|
46
|
+
type: String
|
|
47
|
+
|
|
43
48
|
grid-generator-props:
|
|
44
49
|
desc: Propriedades que serão repassadas para o QasGridGenerator.
|
|
45
50
|
type: Object
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div>
|
|
3
|
+
<div v-if="canShowOptionGroupLabel" class="q-mb-sm text-body1">
|
|
4
|
+
{{ props.label }}
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<component :is="component.is" v-bind="component.props" />
|
|
8
|
+
</div>
|
|
3
9
|
</template>
|
|
4
10
|
|
|
5
11
|
<script setup>
|
|
@@ -10,8 +16,20 @@ defineOptions({
|
|
|
10
16
|
inheritAttrs: false
|
|
11
17
|
})
|
|
12
18
|
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
label: {
|
|
21
|
+
default: '',
|
|
22
|
+
type: String
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
|
|
13
26
|
const attrs = useAttrs()
|
|
14
27
|
|
|
28
|
+
const isOptionGroup = computed(() => !!attrs.options?.length)
|
|
29
|
+
|
|
30
|
+
// Só mostra a label caso for q-option-group e tenha label vindo nas props
|
|
31
|
+
const canShowOptionGroupLabel = computed(() => isOptionGroup.value && !!props.label)
|
|
32
|
+
|
|
15
33
|
/**
|
|
16
34
|
* - quando é um grupo de opções, o componente é 'QOptionGroup', caso contrário,
|
|
17
35
|
* é 'QRadio'.
|
|
@@ -19,16 +37,17 @@ const attrs = useAttrs()
|
|
|
19
37
|
* - todos os casos é usado o dense.
|
|
20
38
|
*/
|
|
21
39
|
const component = computed(() => {
|
|
22
|
-
const isOptionGroup = !!attrs.options?.length
|
|
23
|
-
|
|
24
40
|
const { inline = true, ...payloadProps } = attrs
|
|
25
41
|
|
|
26
42
|
return {
|
|
27
|
-
is: isOptionGroup ? 'q-option-group' : 'q-radio',
|
|
43
|
+
is: isOptionGroup.value ? 'q-option-group' : 'q-radio',
|
|
44
|
+
|
|
28
45
|
props: {
|
|
29
46
|
...payloadProps,
|
|
30
47
|
|
|
31
|
-
|
|
48
|
+
label: props.label,
|
|
49
|
+
|
|
50
|
+
...(isOptionGroup.value && {
|
|
32
51
|
inline,
|
|
33
52
|
class: {
|
|
34
53
|
'q-gutter-x-md': inline,
|
|
@@ -50,7 +50,7 @@ export default function (element, options = {}, cancelMouseDownTarget) {
|
|
|
50
50
|
/**
|
|
51
51
|
* closest busca ancestral mais próximo de um elemento, ou seja, verifica se no event que recebo, tenho a classe no qual nao se deve aplicar o grab.
|
|
52
52
|
*/
|
|
53
|
-
const targetElement = event.target.closest(`.${cancelMouseDownTarget}`)
|
|
53
|
+
const targetElement = cancelMouseDownTarget ? event.target.closest(`.${cancelMouseDownTarget}`) : null
|
|
54
54
|
|
|
55
55
|
if (!!cancelMouseDownTarget && !!targetElement) return null
|
|
56
56
|
|