@afeefa/vue-app 0.0.140 → 0.0.142

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.
@@ -1 +1 @@
1
- 0.0.140
1
+ 0.0.142
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.140",
3
+ "version": "0.0.142",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -90,11 +90,18 @@ export default class ATextField extends Mixins(ComponentWidthMixin) {
90
90
  if (this.clearable) {
91
91
  // empty value if value exists
92
92
  if (this.internalValue) {
93
- event.stopPropagation()
93
+ event.stopPropagation() // break propagation chain, do not close popups e.g.
94
94
  }
95
95
  this.setInternalValue('')
96
+
96
97
  this.$emit('input:internal', '')
97
- this.$emit('input', this.emptyModelValue)
98
+
99
+ if (this.debounceInputFunction) {
100
+ this.debounceInputFunction(this.internalValue)
101
+ } else {
102
+ this.$emit('input', this.emptyModelValue)
103
+ }
104
+
98
105
  this.$emit('clear')
99
106
  }
100
107
  }
@@ -109,7 +116,7 @@ export default class ATextField extends Mixins(ComponentWidthMixin) {
109
116
 
110
117
  const value = this.textFieldValueToModelValue()
111
118
 
112
- // NaN means: wrong numerical value AND no validator present
119
+ // value === NaN means: wrong numerical value AND no validator present
113
120
  // otherwise validator would return validate() -> false
114
121
  if (Number.isNaN(value)) {
115
122
  return
@@ -2,6 +2,7 @@ import { Component, Vue, Watch } from '@a-vue'
2
2
  import { ListAction } from '@a-vue/api-resources/ApiActions'
3
3
  import { sleep } from '@a-vue/utils/timeout'
4
4
  import { ListViewModel } from '@afeefa/api-resources-client'
5
+ import axios from 'axios'
5
6
 
6
7
  import { CurrentRouteFilterSource } from './CurrentRouteFilterSource'
7
8
  import { FilterSourceType } from './FilterSourceType'
@@ -26,6 +27,7 @@ export class ListViewMixin extends Vue {
26
27
  models_ = []
27
28
  meta_ = {}
28
29
  isLoading = false
30
+ cancelSource = null
29
31
 
30
32
  created () {
31
33
  this.init()
@@ -132,10 +134,16 @@ export class ListViewMixin extends Vue {
132
134
  this.isLoading = true
133
135
  this.$emit('update:isLoading', this.isLoading)
134
136
 
137
+ if (this.cancelSource) {
138
+ this.cancelSource.cancel()
139
+ }
140
+
141
+ this.cancelSource = axios.CancelToken.source()
135
142
  const request = this.listViewModel.getApiRequest()
136
143
 
137
144
  const {models, meta} = await ListAction
138
145
  .fromRequest(request)
146
+ .cancelSource(this.cancelSource)
139
147
  .dispatchGlobalLoadingEvents(this.events)
140
148
  .load()
141
149
 
@@ -94,7 +94,7 @@
94
94
  top
95
95
  left
96
96
  class="loadingIndicator"
97
- :isLoading="isLoading"
97
+ :isLoading="!!numLoadingRequests"
98
98
  :color="loaderColor"
99
99
  />
100
100
 
@@ -119,7 +119,7 @@
119
119
  >
120
120
  <sticky-header />
121
121
 
122
- <router-view :class="{isLoading}" />
122
+ <router-view :class="{isLoading: !!numLoadingRequests}" />
123
123
  </v-container>
124
124
 
125
125
  <sticky-footer-container />
@@ -164,7 +164,7 @@ export default class App extends Vue {
164
164
 
165
165
  drawer = true
166
166
  closeMenuIcon = mdiBackburger
167
- isLoading = false
167
+ numLoadingRequests = 0
168
168
 
169
169
  created () {
170
170
  this.$events.on(LoadingEvent.START_LOADING, this.startLoading)
@@ -200,11 +200,11 @@ export default class App extends Vue {
200
200
  }
201
201
 
202
202
  startLoading () {
203
- this.isLoading = true
203
+ this.numLoadingRequests++
204
204
  }
205
205
 
206
206
  stopLoading () {
207
- this.isLoading = false
207
+ this.numLoadingRequests--
208
208
  }
209
209
 
210
210
  toggleDrawer () {