@abi-software/map-side-bar 1.3.8 → 1.3.11
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/map-side-bar.common.js +116 -94
- package/dist/map-side-bar.common.js.map +1 -1
- package/dist/map-side-bar.css +1 -1
- package/dist/map-side-bar.umd.js +116 -94
- package/dist/map-side-bar.umd.js.map +1 -1
- package/dist/map-side-bar.umd.min.js +1 -1
- package/dist/map-side-bar.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/SearchFilters.vue +15 -1
- package/src/components/SideBar.vue +2 -0
package/package.json
CHANGED
|
@@ -122,6 +122,7 @@ export default {
|
|
|
122
122
|
showFilters: true,
|
|
123
123
|
showFiltersText: true,
|
|
124
124
|
cascadeSelected: [],
|
|
125
|
+
cascadeSelectedWithBoolean: [],
|
|
125
126
|
numberShown: 10,
|
|
126
127
|
filters: [],
|
|
127
128
|
facets: ["Species", "Gender", "Organ", "Datasets"],
|
|
@@ -341,6 +342,15 @@ export default {
|
|
|
341
342
|
//Do not set the value unless it is ready
|
|
342
343
|
if (this.cascaderIsReady && filterFacets && filterFacets.length != 0) {
|
|
343
344
|
this.cascadeSelected = filterFacets.map(e => {
|
|
345
|
+
return [
|
|
346
|
+
e.facetPropPath,
|
|
347
|
+
this.createCascaderItemValue(capitalise(e.term), e.facet),
|
|
348
|
+
]
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
// Unforttunately the cascader is very particular about it's v-model
|
|
352
|
+
// to get around this we create a clone of it and use this clone for adding our boolean information
|
|
353
|
+
this.cascadeSelectedWithBoolean= filterFacets.map(e => {
|
|
344
354
|
return [
|
|
345
355
|
e.facetPropPath,
|
|
346
356
|
this.createCascaderItemValue(capitalise(e.term), e.facet),
|
|
@@ -355,11 +365,15 @@ export default {
|
|
|
355
365
|
if (this.cascaderIsReady && filter) {
|
|
356
366
|
this.cascadeSelected.filter(f=>f.term != filter.term)
|
|
357
367
|
this.cascadeSelected.push([filter.facetPropPath, this.createCascaderItemValue(filter.term, filter.facet), filter.AND])
|
|
368
|
+
|
|
369
|
+
this.cascadeSelectedWithBoolean.push([filter.facetPropPath, this.createCascaderItemValue(filter.term, filter.facet), filter.AND])
|
|
358
370
|
// The 'AND' her is to set the boolean value when we search on the filters. It can be undefined without breaking anything
|
|
371
|
+
|
|
372
|
+
|
|
359
373
|
}
|
|
360
374
|
},
|
|
361
375
|
initiateSearch: function() {
|
|
362
|
-
this.cascadeEvent(this.
|
|
376
|
+
this.cascadeEvent(this.cascadeSelectedWithBoolean)
|
|
363
377
|
},
|
|
364
378
|
// checkShowAllBoxes: Checks each 'Show all' cascade option by using the setCascader function
|
|
365
379
|
checkShowAllBoxes: function(){
|
|
@@ -120,6 +120,8 @@ export default {
|
|
|
120
120
|
},
|
|
121
121
|
addFilter: function(filter){
|
|
122
122
|
this.drawerOpen = true;
|
|
123
|
+
filter.AND = true // When we add a filter external, it is currently only with an AND boolean
|
|
124
|
+
|
|
123
125
|
// Because refs are in v-for, nextTick is needed here
|
|
124
126
|
Vue.nextTick(()=>{this.$refs[this.activeId][0].addFilter(filter)})
|
|
125
127
|
},
|