@bildvitta/quasar-ui-asteroid 3.10.0-beta.0 → 3.10.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 +1 -1
- package/src/components/empty-result-text/QasEmptyResultText.vue +20 -0
- package/src/components/empty-result-text/QasEmptyResultText.yml +14 -0
- package/src/components/list-view/QasListView.vue +1 -3
- package/src/components/search-box/QasSearchBox.vue +4 -10
- package/src/components/search-box/QasSearchBox.yml +0 -5
- package/src/components/single-view/QasSingleView.vue +1 -4
- package/src/mixins/search-filter.js +9 -2
- package/src/vue-plugin.js +3 -0
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="text-body1 text-grey-8">
|
|
3
|
+
<slot>
|
|
4
|
+
{{ text }}
|
|
5
|
+
</slot>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'QasEmptyResultText',
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
text: {
|
|
15
|
+
default: 'Não há itens para serem exibidos.',
|
|
16
|
+
type: String
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type: component
|
|
2
|
+
|
|
3
|
+
meta:
|
|
4
|
+
desc: Componente de texto em casos de resultados vazio após filtros.
|
|
5
|
+
|
|
6
|
+
props:
|
|
7
|
+
text:
|
|
8
|
+
desc: Texto a ser exibido.
|
|
9
|
+
default: Não há itens para serem exibidos.
|
|
10
|
+
type: String
|
|
11
|
+
|
|
12
|
+
slots:
|
|
13
|
+
default:
|
|
14
|
+
desc: Slot que substitui a propriedade "text".
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
</slot>
|
|
15
15
|
|
|
16
16
|
<slot v-if="showEmptyResult" name="empty-result">
|
|
17
|
-
<
|
|
18
|
-
<q-icon class="q-mb-sm text-center" color="primary" name="sym_r_search" size="38px" />
|
|
19
|
-
<div>{{ emptyResultText }}</div>
|
|
20
|
-
</div>
|
|
17
|
+
<qas-empty-result-text class="q-mt-md" />
|
|
21
18
|
</slot>
|
|
22
19
|
|
|
23
20
|
<q-inner-loading :showing="showInnerLoading">
|
|
@@ -50,11 +47,6 @@ export default {
|
|
|
50
47
|
type: String
|
|
51
48
|
},
|
|
52
49
|
|
|
53
|
-
emptyResultText: {
|
|
54
|
-
default: 'Não há resultados disponíveis.',
|
|
55
|
-
type: String
|
|
56
|
-
},
|
|
57
|
-
|
|
58
50
|
fuseOptions: {
|
|
59
51
|
default: () => ({}),
|
|
60
52
|
type: Object
|
|
@@ -228,7 +220,9 @@ export default {
|
|
|
228
220
|
// Se tiver erro no primeiro fetch, retorna o "done" na proxima.
|
|
229
221
|
if (((this.mx_hasFetchError && !this.mx_hasFilteredOptions) || this.hasNoOptionsOnFirstFetch)) return done()
|
|
230
222
|
|
|
231
|
-
|
|
223
|
+
const canMakeFirstFetch = this.mx_fetchCount === 0 && this.mx_hasFilteredOptions
|
|
224
|
+
|
|
225
|
+
if ((!this.mx_hasFilteredOptions || canMakeFirstFetch) && !this.mx_search) {
|
|
232
226
|
await this.mx_setFetchOptions()
|
|
233
227
|
return done()
|
|
234
228
|
}
|
|
@@ -9,11 +9,6 @@ props:
|
|
|
9
9
|
default: 100px
|
|
10
10
|
type: String
|
|
11
11
|
|
|
12
|
-
empty-result-text:
|
|
13
|
-
desc: Define o texto dentro do box quando a lista está vazia.
|
|
14
|
-
default: Não há resultados disponíveis.
|
|
15
|
-
type: String
|
|
16
|
-
|
|
17
12
|
entity:
|
|
18
13
|
desc: Entidade enviada para a action "fetchFieldOptions" (usar somente quando "useLazyLoading" estiver habilitada).
|
|
19
14
|
default: ''
|
|
@@ -8,10 +8,7 @@
|
|
|
8
8
|
<slot />
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
|
-
<
|
|
12
|
-
<q-icon class="q-mb-sm text-center" color="grey-7" name="sym_r_search" size="38px" />
|
|
13
|
-
<div class="text-grey-7">Nenhum item encontrado.</div>
|
|
14
|
-
</div>
|
|
11
|
+
<qas-empty-result-text v-else-if="!mx_isFetching" class="q-my-xl" />
|
|
15
12
|
|
|
16
13
|
<footer v-if="mx_hasFooterSlot">
|
|
17
14
|
<slot name="footer" />
|
|
@@ -102,14 +102,21 @@ export default {
|
|
|
102
102
|
|
|
103
103
|
this.mx_fromSearch = !!search
|
|
104
104
|
|
|
105
|
-
await this.
|
|
105
|
+
const options = await this.mx_fetchOptions()
|
|
106
|
+
|
|
107
|
+
this.mx_resetOptions()
|
|
108
|
+
|
|
109
|
+
this.mx_filteredOptions.push(...options)
|
|
106
110
|
|
|
107
111
|
if (this.mx_cachedOptions.length && !search) this.mx_setInitialCachedOptions()
|
|
108
112
|
},
|
|
109
113
|
|
|
110
|
-
|
|
114
|
+
mx_resetOptions () {
|
|
111
115
|
this.mx_filteredOptions = []
|
|
112
116
|
this.mx_foundDuplicatedOptions = []
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
mx_resetFilter (search) {
|
|
113
120
|
this.mx_search = search
|
|
114
121
|
this.mx_pagination = {
|
|
115
122
|
page: 1,
|
package/src/vue-plugin.js
CHANGED
|
@@ -19,6 +19,7 @@ import QasDebugger from './components/debugger/QasDebugger.vue'
|
|
|
19
19
|
import QasDelete from './components/delete/QasDelete.vue'
|
|
20
20
|
import QasDialog from './components/dialog/QasDialog.vue'
|
|
21
21
|
import QasDialogRouter from './components/dialog-router/QasDialogRouter.vue'
|
|
22
|
+
import QasEmptyResultText from './components/empty-result-text/QasEmptyResultText.vue'
|
|
22
23
|
import QasField from './components/field/QasField.vue'
|
|
23
24
|
import QasSearchInput from './components/search-input/QasSearchInput.vue'
|
|
24
25
|
import QasFilters from './components/filters/QasFilters.vue'
|
|
@@ -101,6 +102,7 @@ function install (app) {
|
|
|
101
102
|
app.component('QasDelete', QasDelete)
|
|
102
103
|
app.component('QasDialog', QasDialog)
|
|
103
104
|
app.component('QasDialogRouter', QasDialogRouter)
|
|
105
|
+
app.component('QasEmptyResultText', QasEmptyResultText)
|
|
104
106
|
app.component('QasField', QasField)
|
|
105
107
|
app.component('QasSearchInput', QasSearchInput)
|
|
106
108
|
app.component('QasFilters', QasFilters)
|
|
@@ -184,6 +186,7 @@ export {
|
|
|
184
186
|
QasDelete,
|
|
185
187
|
QasDialog,
|
|
186
188
|
QasDialogRouter,
|
|
189
|
+
QasEmptyResultText,
|
|
187
190
|
QasField,
|
|
188
191
|
QasSearchInput,
|
|
189
192
|
QasFilters,
|