@bildvitta/quasar-ui-asteroid 3.4.0 → 3.5.0-beta.1
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 +2 -2
- package/src/components/actions-menu/QasActionsMenu.vue +86 -37
- package/src/components/actions-menu/QasActionsMenu.yml +6 -6
- package/src/components/app-menu/QasAppMenu.vue +1 -1
- package/src/components/copy/QasCopy.vue +1 -1
- package/src/components/delete/QasDelete.vue +1 -1
- package/src/components/field/QasField.vue +14 -6
- package/src/components/filters/QasFilters.vue +6 -1
- package/src/components/filters/QasFilters.yml +6 -0
- package/src/components/form-generator/QasFormGenerator.yml +1 -1
- package/src/components/grid-generator/QasGridGenerator.yml +1 -1
- package/src/components/list-view/QasListView.vue +67 -8
- package/src/components/list-view/QasListView.yml +4 -0
- package/src/components/nested-fields/QasNestedFields.vue +101 -41
- package/src/components/nested-fields/QasNestedFields.yml +30 -10
- package/src/components/option-group/QasOptionGroup.vue +54 -0
- package/src/components/option-group/QasOptionGroup.yml +30 -0
- package/src/components/pagination/QasPagination.vue +27 -0
- package/src/components/pagination/QasPagination.yml +4 -0
- package/src/components/select/QasSelect.vue +15 -8
- package/src/components/select/QasSelect.yml +0 -4
- package/src/components/table-generator/QasTableGenerator.vue +10 -2
- package/src/components/table-generator/QasTableGenerator.yml +14 -0
- package/src/components/text-truncate/QasTextTruncate.vue +1 -1
- package/src/css/components/item.scss +4 -0
- package/src/css/plugins/index.scss +1 -0
- package/src/css/plugins/notify.scss +40 -0
- package/src/css/variables/button.scss +2 -2
- package/src/css/variables/spacing.scss +5 -5
- package/src/css/variables/typography.scss +24 -24
- package/src/helpers/set-scroll-on-grab.js +13 -4
- package/src/index.scss +4 -1
- package/src/mixins/generator.js +1 -1
- package/src/plugins/notify-error/NotifyError.js +7 -5
- package/src/plugins/notify-success/NotifySuccess.js +7 -5
- package/src/shared/notify-config.js +7 -0
- package/src/vue-plugin.js +6 -0
|
@@ -11,11 +11,7 @@
|
|
|
11
11
|
<div>
|
|
12
12
|
<div class="flex items-center justify-between q-py-xs">
|
|
13
13
|
<qas-label v-if="!useSingleLabel" :label="getRowLabel(index)" />
|
|
14
|
-
|
|
15
|
-
<div v-if="hasBlockActions(row)" class="q-gutter-x-sm">
|
|
16
|
-
<qas-btn v-if="useDuplicate" v-bind="buttonDuplicateProps" @click="add(row)" />
|
|
17
|
-
<qas-btn v-if="showDestroyBtn" v-bind="buttonDestroyProps" @click="destroy(index, row)" />
|
|
18
|
-
</div>
|
|
14
|
+
<qas-actions-menu v-if="hasBlockActions(row)" :list="getActionsList(index, row)" :use-label-on-small-screen="false" />
|
|
19
15
|
</div>
|
|
20
16
|
|
|
21
17
|
<div ref="formGenerator" class="col-12 justify-between q-col-gutter-x-md row">
|
|
@@ -28,12 +24,7 @@
|
|
|
28
24
|
</slot>
|
|
29
25
|
|
|
30
26
|
<div v-if="hasInlineActions(row)" class="flex items-center qas-nested-fields__actions">
|
|
31
|
-
<
|
|
32
|
-
<qas-btn v-if="useDuplicate" color="primary" flat icon="o_content_copy" round @click="add(row)" />
|
|
33
|
-
</div>
|
|
34
|
-
<div class="col-auto">
|
|
35
|
-
<qas-btn v-if="showDestroyBtn" color="negative" flat icon="o_cancel" round @click="destroy(index, row)" />
|
|
36
|
-
</div>
|
|
27
|
+
<qas-actions-menu :list="getActionsList(index, row)" :use-label-on-small-screen="false" />
|
|
37
28
|
</div>
|
|
38
29
|
</div>
|
|
39
30
|
|
|
@@ -47,18 +38,22 @@
|
|
|
47
38
|
|
|
48
39
|
<div v-if="useAdd" class="q-mt-md">
|
|
49
40
|
<slot :add="add" name="add-input">
|
|
50
|
-
<div v-if="
|
|
41
|
+
<div v-if="showAddFirstInputButton" class="text-left">
|
|
42
|
+
<qas-btn class="q-px-sm" color="dark" flat @click="add()">{{ addFirstInputLabel }}</qas-btn>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div v-else-if="useInlineActions" class="cursor-pointer items-center q-col-gutter-x-md q-mt-md row" @click="add()">
|
|
51
46
|
<div class="col">
|
|
52
47
|
<qas-input class="disabled no-pointer-events" hide-bottom-space :label="addInputLabel" outlined @focus="add()" />
|
|
53
48
|
</div>
|
|
54
49
|
|
|
55
50
|
<div class="col-auto">
|
|
56
|
-
<qas-btn color="
|
|
51
|
+
<qas-btn color="dark" flat icon="o_add_circle_outline" round />
|
|
57
52
|
</div>
|
|
58
53
|
</div>
|
|
59
54
|
|
|
60
|
-
<div v-else class="
|
|
61
|
-
<qas-btn class="
|
|
55
|
+
<div v-else class="text-left">
|
|
56
|
+
<qas-btn class="q-px-sm" color="dark" flat icon="o_add" @click="add()">{{ addInputLabel }}</qas-btn>
|
|
62
57
|
</div>
|
|
63
58
|
</slot>
|
|
64
59
|
</div>
|
|
@@ -67,6 +62,7 @@
|
|
|
67
62
|
</template>
|
|
68
63
|
|
|
69
64
|
<script>
|
|
65
|
+
import QasActionsMenu from '../actions-menu/QasActionsMenu.vue'
|
|
70
66
|
import QasBtn from '../btn/QasBtn.vue'
|
|
71
67
|
import QasFormGenerator from '../form-generator/QasFormGenerator.vue'
|
|
72
68
|
import QasInput from '../input/QasInput.vue'
|
|
@@ -80,27 +76,38 @@ export default {
|
|
|
80
76
|
name: 'QasNestedFields',
|
|
81
77
|
|
|
82
78
|
components: {
|
|
79
|
+
QasActionsMenu,
|
|
83
80
|
QasBtn,
|
|
84
81
|
QasFormGenerator,
|
|
85
82
|
QasInput,
|
|
86
83
|
QasLabel,
|
|
87
84
|
|
|
88
|
-
//
|
|
85
|
+
// Vue
|
|
89
86
|
TransitionGroup
|
|
90
87
|
},
|
|
91
88
|
|
|
92
89
|
props: {
|
|
90
|
+
actionsMenuProps: {
|
|
91
|
+
type: Object,
|
|
92
|
+
default: () => ({})
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
addFirstInputLabel: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: 'Clique aqui para adicionar'
|
|
98
|
+
},
|
|
99
|
+
|
|
93
100
|
addInputLabel: {
|
|
94
101
|
type: String,
|
|
95
|
-
default: '
|
|
102
|
+
default: 'Adicionar'
|
|
96
103
|
},
|
|
97
104
|
|
|
98
105
|
buttonDestroyProps: {
|
|
99
106
|
type: Object,
|
|
100
107
|
default: () => {
|
|
101
108
|
return {
|
|
102
|
-
label: '
|
|
103
|
-
icon: '
|
|
109
|
+
label: 'Excluir',
|
|
110
|
+
icon: 'o_delete',
|
|
104
111
|
flat: true,
|
|
105
112
|
dense: true
|
|
106
113
|
}
|
|
@@ -190,7 +197,8 @@ export default {
|
|
|
190
197
|
},
|
|
191
198
|
|
|
192
199
|
useDestroyAlways: {
|
|
193
|
-
type: Boolean
|
|
200
|
+
type: Boolean,
|
|
201
|
+
default: undefined
|
|
194
202
|
},
|
|
195
203
|
|
|
196
204
|
useDuplicate: {
|
|
@@ -198,6 +206,11 @@ export default {
|
|
|
198
206
|
default: true
|
|
199
207
|
},
|
|
200
208
|
|
|
209
|
+
useFirstInputButton: {
|
|
210
|
+
type: Boolean,
|
|
211
|
+
default: true
|
|
212
|
+
},
|
|
213
|
+
|
|
201
214
|
useIndexLabel: {
|
|
202
215
|
type: Boolean
|
|
203
216
|
},
|
|
@@ -215,6 +228,11 @@ export default {
|
|
|
215
228
|
default: true
|
|
216
229
|
},
|
|
217
230
|
|
|
231
|
+
useStartsEmpty: {
|
|
232
|
+
default: true,
|
|
233
|
+
type: Boolean
|
|
234
|
+
},
|
|
235
|
+
|
|
218
236
|
modelValue: {
|
|
219
237
|
type: Array,
|
|
220
238
|
default: () => []
|
|
@@ -225,25 +243,35 @@ export default {
|
|
|
225
243
|
|
|
226
244
|
data () {
|
|
227
245
|
return {
|
|
228
|
-
nested: []
|
|
246
|
+
nested: [],
|
|
247
|
+
hasDestroyAlways: true
|
|
229
248
|
}
|
|
230
249
|
},
|
|
231
250
|
|
|
232
251
|
computed: {
|
|
233
|
-
|
|
234
|
-
return this.field?.
|
|
252
|
+
children () {
|
|
253
|
+
return this.field?.children
|
|
235
254
|
},
|
|
236
255
|
|
|
237
|
-
|
|
238
|
-
return this.
|
|
256
|
+
componentTag () {
|
|
257
|
+
return this.useAnimation ? 'transition-group' : 'div'
|
|
239
258
|
},
|
|
240
259
|
|
|
241
|
-
|
|
242
|
-
|
|
260
|
+
componentProps () {
|
|
261
|
+
if (!this.useAnimation) return {}
|
|
262
|
+
|
|
263
|
+
return {
|
|
264
|
+
tag: 'div',
|
|
265
|
+
enterActiveClass: 'animated slideInDown'
|
|
266
|
+
}
|
|
243
267
|
},
|
|
244
268
|
|
|
245
|
-
|
|
246
|
-
return this.
|
|
269
|
+
fieldLabel () {
|
|
270
|
+
return this.field?.label
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
fieldName () {
|
|
274
|
+
return this.field?.name
|
|
247
275
|
},
|
|
248
276
|
|
|
249
277
|
formClasses () {
|
|
@@ -253,21 +281,16 @@ export default {
|
|
|
253
281
|
}
|
|
254
282
|
},
|
|
255
283
|
|
|
256
|
-
|
|
257
|
-
return
|
|
284
|
+
showDestroyBtn () {
|
|
285
|
+
return this.nested.filter(item => !item[this.destroyKey]).length > 1 || this.useDestroyAlways
|
|
258
286
|
},
|
|
259
287
|
|
|
260
|
-
|
|
261
|
-
return this.
|
|
288
|
+
transformedErrors () {
|
|
289
|
+
return Array.isArray(this.errors) ? this.errors : constructObject(this.fieldName, this.errors)
|
|
262
290
|
},
|
|
263
291
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return {
|
|
268
|
-
tag: 'div',
|
|
269
|
-
enterActiveClass: 'animated slideInDown'
|
|
270
|
-
}
|
|
292
|
+
showAddFirstInputButton () {
|
|
293
|
+
return this.useFirstInputButton && !this.nested.length
|
|
271
294
|
}
|
|
272
295
|
},
|
|
273
296
|
|
|
@@ -282,13 +305,49 @@ export default {
|
|
|
282
305
|
|
|
283
306
|
rowObject: {
|
|
284
307
|
handler () {
|
|
285
|
-
|
|
308
|
+
this.setDefaultNestedValue()
|
|
309
|
+
},
|
|
310
|
+
immediate: true
|
|
311
|
+
},
|
|
312
|
+
|
|
313
|
+
useDestroyAlways: {
|
|
314
|
+
handler (value) {
|
|
315
|
+
this.hasDestroyAlways = value ?? this.useStartsEmpty
|
|
286
316
|
},
|
|
287
317
|
immediate: true
|
|
288
318
|
}
|
|
289
319
|
},
|
|
290
320
|
|
|
291
321
|
methods: {
|
|
322
|
+
getActionsList (index, row) {
|
|
323
|
+
const list = {}
|
|
324
|
+
|
|
325
|
+
if (this.useDuplicate) {
|
|
326
|
+
list.duplicate = {
|
|
327
|
+
...this.buttonDuplicateProps,
|
|
328
|
+
handler: () => this.add(row)
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (this.showDestroyBtn) {
|
|
333
|
+
list.destroy = {
|
|
334
|
+
...this.buttonDestroyProps,
|
|
335
|
+
handler: () => this.destroy(index, row)
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
for (const key in this.actionsMenuProps.list) {
|
|
340
|
+
const { handler, ...content } = this.actionsMenuProps.list[key] || {}
|
|
341
|
+
|
|
342
|
+
list[key] = {
|
|
343
|
+
handler: payload => handler?.({ payload, row, index }),
|
|
344
|
+
...content
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return list
|
|
349
|
+
},
|
|
350
|
+
|
|
292
351
|
add (row = {}) {
|
|
293
352
|
const payload = { ...this.rowObject, ...row }
|
|
294
353
|
const hasIdentifierKey = payload[this.identifierItemKey]
|
|
@@ -345,6 +404,7 @@ export default {
|
|
|
345
404
|
},
|
|
346
405
|
|
|
347
406
|
setDefaultNestedValue () {
|
|
407
|
+
if (this.nested.length || this.useStartsEmpty) return
|
|
348
408
|
this.nested.splice(0, 0, { ...this.rowObject })
|
|
349
409
|
},
|
|
350
410
|
|
|
@@ -4,14 +4,24 @@ meta:
|
|
|
4
4
|
desc: Componente para gerar dinamicamente campos nested.
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
|
+
actions-menu-props:
|
|
8
|
+
desc: Repassa as propriedades para o componente QasActionsMenu.
|
|
9
|
+
default: {}
|
|
10
|
+
type: Object
|
|
11
|
+
|
|
12
|
+
add-first-input-label:
|
|
13
|
+
desc: Rótulo do input para adicionar o primeiro campo.
|
|
14
|
+
default: Clique aqui para adicionar
|
|
15
|
+
type: String
|
|
16
|
+
|
|
7
17
|
add-input-label:
|
|
8
18
|
desc: Rótulo do input de adicionar novos campos.
|
|
9
|
-
default:
|
|
10
|
-
type:
|
|
19
|
+
default: Adicionar
|
|
20
|
+
type: String
|
|
11
21
|
|
|
12
22
|
button-destroy-props:
|
|
13
23
|
desc: Props do botão de excluir linha contendo os campos.
|
|
14
|
-
default: "{ label: '
|
|
24
|
+
default: "{ label: 'Excluir', icon: 'o_delete', flat: true, dense: true }"
|
|
15
25
|
debugger: true
|
|
16
26
|
type: Object
|
|
17
27
|
|
|
@@ -76,17 +86,17 @@ props:
|
|
|
76
86
|
model: true
|
|
77
87
|
|
|
78
88
|
row-label:
|
|
79
|
-
desc: Rótulo entre cada linha
|
|
89
|
+
desc: Rótulo entre cada linha.
|
|
80
90
|
type: String
|
|
81
91
|
|
|
82
92
|
row-object:
|
|
83
|
-
desc: Objeto contendo valores iniciais do model de cada linha
|
|
93
|
+
desc: Objeto contendo valores iniciais do model de cada linha.
|
|
84
94
|
default: {}
|
|
85
95
|
type: Object
|
|
86
96
|
examples: ["{ name: '', cities: [] }"]
|
|
87
97
|
|
|
88
98
|
use-add:
|
|
89
|
-
desc: Controla quando vai ter seção de "adicionar" novas
|
|
99
|
+
desc: Controla quando vai ter seção de "adicionar" novas linhas.
|
|
90
100
|
default: true
|
|
91
101
|
type: Boolean
|
|
92
102
|
|
|
@@ -96,7 +106,7 @@ props:
|
|
|
96
106
|
type: Boolean
|
|
97
107
|
|
|
98
108
|
use-destroy-always:
|
|
99
|
-
desc: Controla o botão de remover em todas linhas
|
|
109
|
+
desc: Controla o botão de remover em todas linhas, incluindo a primeira.
|
|
100
110
|
type: Boolean
|
|
101
111
|
|
|
102
112
|
use-duplicate:
|
|
@@ -104,20 +114,30 @@ props:
|
|
|
104
114
|
default: true
|
|
105
115
|
type: Boolean
|
|
106
116
|
|
|
117
|
+
use-first-input-button:
|
|
118
|
+
desc: Controla se vai ter um botão diferente para adicionar o primeiro campo.
|
|
119
|
+
default: true
|
|
120
|
+
type: Boolean
|
|
121
|
+
|
|
107
122
|
use-index-label:
|
|
108
123
|
desc: Se tiver "rowLabel" esta prop controla se cada label da linha vai ter o index como sufixo.
|
|
109
124
|
type: Boolean
|
|
110
125
|
|
|
111
126
|
use-inline-actions:
|
|
112
|
-
desc: Controla o comportamento referente aos estilos das ações de duplicar/adicionar/remover
|
|
127
|
+
desc: Controla o comportamento referente aos estilos das ações de duplicar/adicionar/remover.
|
|
113
128
|
type: Boolean
|
|
114
129
|
|
|
115
130
|
use-single-label:
|
|
116
|
-
desc:
|
|
131
|
+
desc: Exibe apenas uma label referente a todas linhas, e não uma por linha.
|
|
117
132
|
type: Boolean
|
|
118
133
|
|
|
119
134
|
use-remove-on-destroy:
|
|
120
|
-
desc:
|
|
135
|
+
desc: O valor do model será removido senão será adicionar uma flag como `destroyed` por exemplo.
|
|
136
|
+
default: true
|
|
137
|
+
type: Boolean
|
|
138
|
+
|
|
139
|
+
use-starts-empty:
|
|
140
|
+
desc: O componente iniciará sem nenhuma linha.
|
|
121
141
|
default: true
|
|
122
142
|
type: Boolean
|
|
123
143
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-option-group v-model="model" :options="options" v-bind="attributes">
|
|
3
|
+
<template v-for="(_, name) in $slots" #[name]="context">
|
|
4
|
+
<slot :name="name" v-bind="context || {}" />
|
|
5
|
+
</template>
|
|
6
|
+
</q-option-group>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'QasOptionGroup',
|
|
12
|
+
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
|
|
15
|
+
props: {
|
|
16
|
+
options: {
|
|
17
|
+
default: () => [],
|
|
18
|
+
type: Array
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
type: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'radio',
|
|
24
|
+
validator: value => ['radio', 'checkbox', 'toggle'].includes(value)
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
modelValue: {
|
|
28
|
+
default: '',
|
|
29
|
+
type: [String, Number, Array, Boolean]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
emits: ['update:modelValue'],
|
|
34
|
+
|
|
35
|
+
computed: {
|
|
36
|
+
attributes () {
|
|
37
|
+
return {
|
|
38
|
+
...this.$attrs,
|
|
39
|
+
inline: !this.$qas.screen.isSmall
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
model: {
|
|
44
|
+
get () {
|
|
45
|
+
return this.modelValue
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
set (value) {
|
|
49
|
+
return this.$emit('update:modelValue', value)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type: component
|
|
2
|
+
|
|
3
|
+
meta:
|
|
4
|
+
desc: Componente wrapper do [QOptionGroup](https://quasar.dev/vue-components/option-group#introduction).
|
|
5
|
+
|
|
6
|
+
props:
|
|
7
|
+
options:
|
|
8
|
+
desc: Opções contendo objetos com chaves "label" e "value".
|
|
9
|
+
default: []
|
|
10
|
+
type: Array
|
|
11
|
+
|
|
12
|
+
model-value:
|
|
13
|
+
desc: Model do componente, usado para v-model.
|
|
14
|
+
default: []
|
|
15
|
+
type: [String, Number, Array, Boolean]
|
|
16
|
+
examples: [v-model"value"]
|
|
17
|
+
model: true
|
|
18
|
+
|
|
19
|
+
type:
|
|
20
|
+
desc: Tipo de componente, podendo ser radio, checkbox ou toggle.
|
|
21
|
+
default: 'radio'
|
|
22
|
+
type: String
|
|
23
|
+
|
|
24
|
+
events:
|
|
25
|
+
'@update:model-value -> function (value)':
|
|
26
|
+
desc: Dispara toda vez que o model é atualizado, também utilizado para v-model.
|
|
27
|
+
params:
|
|
28
|
+
value:
|
|
29
|
+
desc: Novo valor do v-model
|
|
30
|
+
type: String
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-pagination v-bind="defaultProps" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
name: 'QasPagination',
|
|
8
|
+
|
|
9
|
+
computed: {
|
|
10
|
+
defaultProps () {
|
|
11
|
+
const { modelValue, ...attributes } = this.$attrs
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
activeColor: 'primary',
|
|
15
|
+
activeDesign: 'flat',
|
|
16
|
+
boundaryNumbers: true,
|
|
17
|
+
color: 'grey-7',
|
|
18
|
+
directionLinks: true,
|
|
19
|
+
maxPages: modelValue < 3 ? 3 : 6,
|
|
20
|
+
modelValue,
|
|
21
|
+
|
|
22
|
+
...attributes
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
@@ -68,10 +68,6 @@ export default {
|
|
|
68
68
|
valueKey: {
|
|
69
69
|
default: '',
|
|
70
70
|
type: String
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
useSearch: {
|
|
74
|
-
type: Boolean
|
|
75
71
|
}
|
|
76
72
|
},
|
|
77
73
|
|
|
@@ -112,7 +108,7 @@ export default {
|
|
|
112
108
|
},
|
|
113
109
|
|
|
114
110
|
isSearchable () {
|
|
115
|
-
return this.
|
|
111
|
+
return this.hasFuse || this.useLazyLoading
|
|
116
112
|
},
|
|
117
113
|
|
|
118
114
|
defaultOptions () {
|
|
@@ -127,6 +123,17 @@ export default {
|
|
|
127
123
|
return this.mx_isFetching || this.$attrs.loading
|
|
128
124
|
},
|
|
129
125
|
|
|
126
|
+
hasFuse () {
|
|
127
|
+
/*
|
|
128
|
+
* quantidade de option que precisa ter para o fuse funcionar automaticamente
|
|
129
|
+
* sem necessidade de passar prop manualmente
|
|
130
|
+
*/
|
|
131
|
+
const autoFuseQuantity = 10
|
|
132
|
+
const hasAutoFuseSearch = this.options.length >= autoFuseQuantity && !this.useLazyLoading
|
|
133
|
+
|
|
134
|
+
return hasAutoFuseSearch
|
|
135
|
+
},
|
|
136
|
+
|
|
130
137
|
model: {
|
|
131
138
|
get () {
|
|
132
139
|
return this.modelValue
|
|
@@ -147,7 +154,7 @@ export default {
|
|
|
147
154
|
handler () {
|
|
148
155
|
if (this.useLazyLoading && this.mx_hasFilteredOptions) return
|
|
149
156
|
|
|
150
|
-
if (this.fuse) this.setFuse()
|
|
157
|
+
if (this.fuse || this.hasFuse) this.setFuse()
|
|
151
158
|
|
|
152
159
|
this.mx_filteredOptions = this.defaultOptions
|
|
153
160
|
},
|
|
@@ -163,7 +170,7 @@ export default {
|
|
|
163
170
|
|
|
164
171
|
methods: {
|
|
165
172
|
setFuse () {
|
|
166
|
-
if (this.
|
|
173
|
+
if (this.hasFuse) {
|
|
167
174
|
this.fuse = new Fuse(this.defaultOptions, this.defaultFuseOptions)
|
|
168
175
|
}
|
|
169
176
|
},
|
|
@@ -173,7 +180,7 @@ export default {
|
|
|
173
180
|
await this.mx_filterOptionsByStore(value)
|
|
174
181
|
}
|
|
175
182
|
|
|
176
|
-
if (!this.useLazyLoading && this.
|
|
183
|
+
if (!this.useLazyLoading && this.hasFuse) {
|
|
177
184
|
this.filterOptionsByFuse(value)
|
|
178
185
|
}
|
|
179
186
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<qas-box class="q-
|
|
2
|
+
<qas-box class="q-px-lg q-py-md">
|
|
3
3
|
<q-table ref="table" class="bg-transparent qas-table-generator" :class="tableClass" v-bind="attributes">
|
|
4
4
|
<template v-for="(_, name) in $slots" #[name]="context">
|
|
5
5
|
<slot v-if="hasBodySlot" name="body" :props="context" />
|
|
@@ -70,7 +70,10 @@ export default {
|
|
|
70
70
|
flat: true,
|
|
71
71
|
hideBottom: true,
|
|
72
72
|
pagination: { rowsPerPage: 0 },
|
|
73
|
-
rowKey: this.rowKey
|
|
73
|
+
rowKey: this.rowKey,
|
|
74
|
+
|
|
75
|
+
// Eventos.
|
|
76
|
+
onRowClick: this.$attrs.onRowClick && this.onRowClick
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
return attributes
|
|
@@ -220,6 +223,11 @@ export default {
|
|
|
220
223
|
}
|
|
221
224
|
},
|
|
222
225
|
|
|
226
|
+
onRowClick () {
|
|
227
|
+
if (this.hasScrollOnGrab && this.scrollOnGrab.haveMoved()) return
|
|
228
|
+
this.$attrs.onRowClick(...arguments)
|
|
229
|
+
},
|
|
230
|
+
|
|
223
231
|
setObserver () {
|
|
224
232
|
this.elementToObserve = this.getTableElement()
|
|
225
233
|
this.resizeObserver = new ResizeObserver(entries => {
|
|
@@ -44,3 +44,17 @@ slots:
|
|
|
44
44
|
desc: Payload da linha da tabela.
|
|
45
45
|
default: {}
|
|
46
46
|
type: Object
|
|
47
|
+
|
|
48
|
+
events:
|
|
49
|
+
'@row-click -> function(event, row, index)':
|
|
50
|
+
desc: Dispara ao clicar em uma linha. Não funciona usando slots personalizados (body, row e item).
|
|
51
|
+
params:
|
|
52
|
+
event:
|
|
53
|
+
desc: Evento do click.
|
|
54
|
+
type: Event
|
|
55
|
+
row:
|
|
56
|
+
desc: Payload da linha da tabela.
|
|
57
|
+
type: Object
|
|
58
|
+
index:
|
|
59
|
+
desc: Índice da linha.
|
|
60
|
+
type: Number
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<div ref="truncate" :class="truncateTextClass">
|
|
5
5
|
<slot>{{ text }}</slot>
|
|
6
6
|
</div>
|
|
7
|
-
<div v-if="isTruncated" class="cursor-pointer text-primary" @click="toggleDialog">{{ seeMoreLabel }}</div>
|
|
7
|
+
<div v-if="isTruncated" class="cursor-pointer text-primary" @click.stop="toggleDialog">{{ seeMoreLabel }}</div>
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
10
|
<qas-dialog v-model="showDialog" v-bind="defaultDialogProps">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import './notify';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.q-notification {
|
|
2
|
+
margin-top: 80px;
|
|
3
|
+
|
|
4
|
+
&__content {
|
|
5
|
+
.q-icon {
|
|
6
|
+
margin-right: var(--qas-spacing-sm);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&__actions {
|
|
11
|
+
align-self: start;
|
|
12
|
+
padding-top: var(--qas-spacing-xs);
|
|
13
|
+
|
|
14
|
+
.q-btn {
|
|
15
|
+
color: white;
|
|
16
|
+
height: var(--qas-spacing-md);
|
|
17
|
+
min-height: auto;
|
|
18
|
+
min-width: auto;
|
|
19
|
+
padding: 0;
|
|
20
|
+
text-align: center;
|
|
21
|
+
text-transform: none;
|
|
22
|
+
width: var(--qas-spacing-md);
|
|
23
|
+
|
|
24
|
+
&__content {
|
|
25
|
+
height: var(--qas-spacing-md);
|
|
26
|
+
|
|
27
|
+
span {
|
|
28
|
+
align-self: center;
|
|
29
|
+
height: var(--qas-spacing-md);
|
|
30
|
+
line-height: 0.9;
|
|
31
|
+
width: var(--qas-spacing-md);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (max-width: $breakpoint-xs) {
|
|
38
|
+
margin-top: 40px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
$button-font-size:
|
|
1
|
+
$button-font-size: 1rem;
|
|
2
2
|
$button-line-height: 1.5rem;
|
|
3
|
-
$button-font-weight:
|
|
3
|
+
$button-font-weight: 600;
|