@phoenix-cg/v-filters 0.2.0-beta.4 → 0.2.0-beta.7
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/dist/v-filters.common.js +33 -4
- package/dist/v-filters.common.js.map +1 -1
- package/dist/v-filters.umd.js +33 -4
- package/dist/v-filters.umd.js.map +1 -1
- package/dist/v-filters.umd.min.js +1 -1
- package/dist/v-filters.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VFilters.vue +23 -3
package/package.json
CHANGED
|
@@ -197,6 +197,21 @@ export default {
|
|
|
197
197
|
value = paramsValue
|
|
198
198
|
}
|
|
199
199
|
this.addEditedField(field._name)
|
|
200
|
+
} else if (params[field._name] && isUpdate && field._type !== 'range') {
|
|
201
|
+
if (valueNotArray) {
|
|
202
|
+
const isValueInData = field.data.some(dataValue => dataValue._id === value._id || dataValue._id === value)
|
|
203
|
+
if (!isValueInData) {
|
|
204
|
+
value = field.data[0]
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
value = field.value.reduce((acc, currentValue) => {
|
|
208
|
+
const isValueInData = field.data.some(dataValue => dataValue._id === currentValue._id || dataValue._id === currentValue)
|
|
209
|
+
if (isValueInData) {
|
|
210
|
+
acc.push(currentValue)
|
|
211
|
+
}
|
|
212
|
+
return acc
|
|
213
|
+
}, [])
|
|
214
|
+
}
|
|
200
215
|
} else if ((!params[field._name] || isUpdate) && valueNotArray) {
|
|
201
216
|
[value] = field.value
|
|
202
217
|
} else if (!params[field._name] || isUpdate) {
|
|
@@ -221,7 +236,7 @@ export default {
|
|
|
221
236
|
this.$set(this.filters, field._name, value)
|
|
222
237
|
})
|
|
223
238
|
this.setUrlParams(isUpdate)
|
|
224
|
-
!isUpdate && this.doAction()
|
|
239
|
+
!isUpdate && this.doAction(true)
|
|
225
240
|
},
|
|
226
241
|
resetFilters () {
|
|
227
242
|
this.editedFields = []
|
|
@@ -232,8 +247,13 @@ export default {
|
|
|
232
247
|
this.editedFields.push(name)
|
|
233
248
|
}
|
|
234
249
|
},
|
|
235
|
-
doAction () {
|
|
236
|
-
|
|
250
|
+
doAction (both = false) {
|
|
251
|
+
if (both) {
|
|
252
|
+
this.requestCount()
|
|
253
|
+
this.showResult()
|
|
254
|
+
} else {
|
|
255
|
+
this.immediate ? this.showResult() : this.requestCount()
|
|
256
|
+
}
|
|
237
257
|
},
|
|
238
258
|
requestCount () {
|
|
239
259
|
this.$emit('request-count', this.flatFilters)
|