@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.10.0-beta.0",
4
+ "version": "3.10.0-beta.1",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -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".
@@ -16,9 +16,7 @@
16
16
 
17
17
  <div v-else-if="!mx_isFetching">
18
18
  <slot name="empty-results">
19
- <div class="q-my-lg text-body1 text-grey-7">
20
- Não há itens para serem exibidos.
21
- </div>
19
+ <qas-empty-result-text />
22
20
  </slot>
23
21
  </div>
24
22
 
@@ -14,10 +14,7 @@
14
14
  </slot>
15
15
 
16
16
  <slot v-if="showEmptyResult" name="empty-result">
17
- <div class="absolute-center text-center">
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
- if (!this.mx_hasFilteredOptions && !this.mx_search) {
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
- <div v-else-if="!mx_isFetching" class="q-my-xl text-center">
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.mx_setFetchOptions()
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
- mx_resetFilter (search) {
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,