@bildvitta/quasar-ui-asteroid 3.17.0-beta.15 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.17.0-beta.15",
4
+ "version": "3.17.0-beta.16",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -1,21 +1,27 @@
1
1
  <template>
2
2
  <div>
3
3
  <!-- Single -->
4
- <q-checkbox v-if="isSingle" v-model="model" v-bind="attrs" dense>
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 :class="classes">
10
- <div v-for="(option, index) in props.options" :key="index">
11
- <!-- Com children -->
12
- <q-checkbox v-if="hasChildren(option)" :class="getCheckboxClass(option)" dense :label="option.label" :model-value="getModelValue(index)" @update:model-value="updateCheckbox($event, option, index)" />
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
- <!-- Com children -->
15
- <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)" />
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
- <!-- Sem children -->
18
- <q-option-group v-else v-model="model" v-bind="attrs" dense :options="[option]" type="checkbox" />
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
 
@@ -9,6 +9,11 @@ props:
9
9
  default: true
10
10
  type: Boolean
11
11
 
12
+ label:
13
+ desc: Label utilizada em casos de ser checkbox-group.
14
+ default: ''
15
+ type: String
16
+
12
17
  model-value:
13
18
  desc: Model do componente, usado para v-model.
14
19
  default: []
@@ -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
 
@@ -13,3 +13,8 @@ props:
13
13
  desc: Texto a ser copiado.
14
14
  type: String
15
15
 
16
+ use-text:
17
+ desc: Controla se o texto será exibo ao lado do botão ou não.
18
+ type: Boolean
19
+ default: true
20
+
@@ -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
- gridGeneratorProps: {
97
- type: Object,
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
- <component :is="component.is" v-bind="component.props" />
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
- ...(isOptionGroup && {
48
+ label: props.label,
49
+
50
+ ...(isOptionGroup.value && {
32
51
  inline,
33
52
  class: {
34
53
  'q-gutter-x-md': inline,
@@ -1,5 +1,11 @@
1
1
  type: component
2
2
 
3
+ props:
4
+ label:
5
+ desc: Label utilizada em casos de ser q-option-group.
6
+ default: ''
7
+ type: String
8
+
3
9
  meta:
4
10
  desc: Componente wrapper do QRadio.
5
11
 
@@ -138,6 +138,9 @@ export default {
138
138
 
139
139
  attributes () {
140
140
  const attributes = {
141
+ tableClass: {
142
+ 'overflow-hidden-y': !this.useStickyHeader
143
+ },
141
144
  class: this.tableClass,
142
145
  columns: this.columnsByFields,
143
146
  flat: true,
@@ -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