@bildvitta/quasar-ui-asteroid 3.10.0-beta.4 → 3.10.0-beta.6
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
|
@@ -229,7 +229,7 @@ export default {
|
|
|
229
229
|
},
|
|
230
230
|
|
|
231
231
|
methods: {
|
|
232
|
-
clearFilters () {
|
|
232
|
+
async clearFilters () {
|
|
233
233
|
const { filters } = this.mx_context
|
|
234
234
|
const query = { ...this.$route.query }
|
|
235
235
|
const activeFilters = {
|
|
@@ -254,8 +254,10 @@ export default {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
this.hideFiltersMenu()
|
|
257
|
+
|
|
258
|
+
await this.updateRouteQuery(query)
|
|
259
|
+
|
|
257
260
|
this.updateCurrentFilters()
|
|
258
|
-
this.updateRouteQuery(query)
|
|
259
261
|
},
|
|
260
262
|
|
|
261
263
|
clearSearch () {
|
|
@@ -302,7 +304,7 @@ export default {
|
|
|
302
304
|
}
|
|
303
305
|
},
|
|
304
306
|
|
|
305
|
-
filter (external) {
|
|
307
|
+
async filter (external) {
|
|
306
308
|
const { filters, page, ...context } = this.mx_context
|
|
307
309
|
|
|
308
310
|
const query = {
|
|
@@ -318,8 +320,10 @@ export default {
|
|
|
318
320
|
}
|
|
319
321
|
|
|
320
322
|
this.hideFiltersMenu()
|
|
323
|
+
|
|
324
|
+
await this.updateRouteQuery(query)
|
|
325
|
+
|
|
321
326
|
this.updateCurrentFilters()
|
|
322
|
-
this.updateRouteQuery(query)
|
|
323
327
|
},
|
|
324
328
|
|
|
325
329
|
getChipValue (value) {
|
|
@@ -330,14 +334,15 @@ export default {
|
|
|
330
334
|
this.$refs.filtersButton?.hideMenu()
|
|
331
335
|
},
|
|
332
336
|
|
|
333
|
-
removeFilter ({ name }) {
|
|
337
|
+
async removeFilter ({ name }) {
|
|
334
338
|
const query = { ...this.$route.query }
|
|
335
339
|
|
|
336
340
|
delete query[name]
|
|
337
341
|
delete this.filters[name]
|
|
338
342
|
|
|
343
|
+
await this.updateRouteQuery(query)
|
|
344
|
+
|
|
339
345
|
this.updateCurrentFilters()
|
|
340
|
-
this.updateRouteQuery(query)
|
|
341
346
|
},
|
|
342
347
|
|
|
343
348
|
updateCurrentFilters () {
|
|
@@ -349,18 +354,13 @@ export default {
|
|
|
349
354
|
this.$emit('update:currentFilters', this.currentFilters)
|
|
350
355
|
},
|
|
351
356
|
|
|
352
|
-
updateRouteQuery (query) {
|
|
353
|
-
this.useUpdateRoute && this.$router.push({ query })
|
|
357
|
+
async updateRouteQuery (query) {
|
|
358
|
+
this.useUpdateRoute && await this.$router.push({ query })
|
|
354
359
|
},
|
|
355
360
|
|
|
356
361
|
updateValues () {
|
|
357
362
|
this.setSearch()
|
|
358
|
-
|
|
359
|
-
const { filters } = this.mx_context
|
|
360
|
-
|
|
361
|
-
for (const key in filters) {
|
|
362
|
-
this.filters[key] = parseValue(this.normalizeValues(filters[key], this.fields[key]?.multiple))
|
|
363
|
-
}
|
|
363
|
+
this.setFilters()
|
|
364
364
|
},
|
|
365
365
|
|
|
366
366
|
normalizeValues (value, isMultiple) {
|
|
@@ -373,7 +373,7 @@ export default {
|
|
|
373
373
|
if (!this.useUpdateRoute) return
|
|
374
374
|
|
|
375
375
|
const watchOnce = this.$watch('fields', values => {
|
|
376
|
-
if (Object.keys(values).length) {
|
|
376
|
+
if (Object.keys(values || {}).length) {
|
|
377
377
|
this.updateValues()
|
|
378
378
|
this.updateCurrentFilters()
|
|
379
379
|
watchOnce()
|
|
@@ -396,6 +396,16 @@ export default {
|
|
|
396
396
|
setSearch () {
|
|
397
397
|
const { search } = this.mx_context
|
|
398
398
|
this.search = search || ''
|
|
399
|
+
},
|
|
400
|
+
|
|
401
|
+
setFilters () {
|
|
402
|
+
this.filters = {}
|
|
403
|
+
|
|
404
|
+
const { filters } = this.mx_context
|
|
405
|
+
|
|
406
|
+
for (const key in filters) {
|
|
407
|
+
this.filters[key] = parseValue(this.normalizeValues(filters[key], this.fields[key]?.multiple))
|
|
408
|
+
}
|
|
399
409
|
}
|
|
400
410
|
}
|
|
401
411
|
}
|
|
@@ -4,6 +4,13 @@ meta:
|
|
|
4
4
|
desc: Componente para criação de filtros dinâmicos.
|
|
5
5
|
|
|
6
6
|
props:
|
|
7
|
+
current-filters:
|
|
8
|
+
model: true
|
|
9
|
+
desc: Utilizado para recuperar os filtros realizados internamente.
|
|
10
|
+
default: {}
|
|
11
|
+
type: Object
|
|
12
|
+
examples: [v-model:currentFilters="currentFilters"]
|
|
13
|
+
|
|
7
14
|
entity:
|
|
8
15
|
desc: Entidade da store, por exemplo se tiver que trabalhar com modulo de usuários, teremos o model "users" na store, que vai ser nossa "entity".
|
|
9
16
|
required: true
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :id="fieldName" class="qas-nested-fields">
|
|
3
|
-
<div class="text-left">
|
|
4
|
-
<qas-label
|
|
3
|
+
<div v-if="useSingleLabel" class="text-left">
|
|
4
|
+
<qas-label :label="fieldLabel" margin="lg" />
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<div ref="inputContent">
|
|
8
8
|
<component :is="componentTag" v-bind="componentProps">
|
|
9
9
|
<template v-for="(row, index) in nested" :key="`row-${index}`">
|
|
10
|
-
<div v-if="!row[destroyKey]" :id="`row-${index}`" class="full-width q-mt-md">
|
|
11
|
-
<header class="flex items-center q-
|
|
12
|
-
<qas-label v-if="!useSingleLabel" :label="getRowLabel(index)" />
|
|
10
|
+
<div v-if="!row[destroyKey]" :id="`row-${index}`" class="full-width q-mt-md qas-nested-fields__field-item">
|
|
11
|
+
<header v-if="hasHeader" class="flex items-center q-pb-md" :class="headerClasses">
|
|
12
|
+
<qas-label v-if="!useSingleLabel" :label="getRowLabel(index)" margin="none" />
|
|
13
13
|
<qas-actions-menu v-if="hasBlockActions(row)" v-bind="actionsMenuProps" :list="getActionsList(index, row)" />
|
|
14
14
|
</header>
|
|
15
15
|
|
|
@@ -290,8 +290,15 @@ export default {
|
|
|
290
290
|
return this.useFirstInputButton && !this.nested.length
|
|
291
291
|
},
|
|
292
292
|
|
|
293
|
+
hasHeader () {
|
|
294
|
+
return (this.useSingleLabel && !this.useInlineActions) || !this.useSingleLabel
|
|
295
|
+
},
|
|
296
|
+
|
|
293
297
|
headerClasses () {
|
|
294
|
-
return
|
|
298
|
+
return {
|
|
299
|
+
'justify-end': this.useSingleLabel,
|
|
300
|
+
'justify-between': !this.useSingleLabel
|
|
301
|
+
}
|
|
295
302
|
}
|
|
296
303
|
},
|
|
297
304
|
|
|
@@ -463,5 +470,9 @@ export default {
|
|
|
463
470
|
&__actions {
|
|
464
471
|
height: 56px;
|
|
465
472
|
}
|
|
473
|
+
|
|
474
|
+
&__field-item + &__field-item {
|
|
475
|
+
margin-top: var(--qas-spacing-xl);
|
|
476
|
+
}
|
|
466
477
|
}
|
|
467
478
|
</style>
|
|
@@ -24,11 +24,15 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<template #list="scope">
|
|
27
|
-
<div v-if="hasGalleryCardSection" class="q-col-gutter-lg q-mt-sm row">
|
|
27
|
+
<div v-if="hasGalleryCardSection(getFilesList(scope.files, scope))" class="q-col-gutter-lg q-mt-sm row">
|
|
28
28
|
<div v-for="(file, key, index) in getFilesList(scope.files, scope)" :key="index" :class="columnClasses">
|
|
29
29
|
<pv-uploader-gallery-card v-bind="getUploaderGalleryCardProps({ key, scope, file, index })" />
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
32
|
+
|
|
33
|
+
<div v-else class="q-mt-lg">
|
|
34
|
+
<qas-empty-result-text />
|
|
35
|
+
</div>
|
|
32
36
|
</template>
|
|
33
37
|
</q-uploader>
|
|
34
38
|
|
|
@@ -268,12 +272,6 @@ export default {
|
|
|
268
272
|
return this.$slots['custom-upload']
|
|
269
273
|
},
|
|
270
274
|
|
|
271
|
-
hasGalleryCardSection () {
|
|
272
|
-
return (
|
|
273
|
-
(this.useObjectModel ? !!Object.keys(this.modelValue).length : !!this.modelValue?.length) || this.hasError
|
|
274
|
-
)
|
|
275
|
-
},
|
|
276
|
-
|
|
277
275
|
hasHeaderSlot () {
|
|
278
276
|
return this.$slots.header
|
|
279
277
|
},
|
|
@@ -450,6 +448,10 @@ export default {
|
|
|
450
448
|
if (entity === this.entity) this.setSavedFiles()
|
|
451
449
|
},
|
|
452
450
|
|
|
451
|
+
hasGalleryCardSection (files) {
|
|
452
|
+
return Object.keys(files).length
|
|
453
|
+
},
|
|
454
|
+
|
|
453
455
|
isFailed (file) {
|
|
454
456
|
return file.__status === 'failed'
|
|
455
457
|
},
|