@abi-software/map-side-bar 2.14.8-demo.3 → 2.14.8-demo.4
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.js +890 -886
- package/dist/map-side-bar.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CellCardExplorer.vue +14 -9
package/package.json
CHANGED
|
@@ -609,8 +609,8 @@ export default {
|
|
|
609
609
|
const selectedSomaLocationFilters = this.getSelectedSomaLocationFilters();
|
|
610
610
|
const shouldFilterBySelectedSomaLocations = (this.activeFilters || []).length > 0 && selectedSomaLocationFilters.length > 0;
|
|
611
611
|
const selectedSomaLocationSet = new Set(selectedSomaLocationFilters);
|
|
612
|
-
const
|
|
613
|
-
const somaLocationCounts =
|
|
612
|
+
const filteredCellTypes = this.getFilteredCellTypes(this.activeFilters, this.searchInput);
|
|
613
|
+
const somaLocationCounts = filteredCellTypes.reduce((counts, cellType) => {
|
|
614
614
|
(Array.isArray(cellType?.somaLocations) ? cellType.somaLocations : []).forEach((location) => {
|
|
615
615
|
const normalizedLocation = String(location || '').trim().toLowerCase();
|
|
616
616
|
if (!normalizedLocation) return;
|
|
@@ -704,8 +704,8 @@ export default {
|
|
|
704
704
|
|
|
705
705
|
return false;
|
|
706
706
|
},
|
|
707
|
-
|
|
708
|
-
const searchTerms = this.normalizeSearchTerms(
|
|
707
|
+
getFilteredCellTypes: function(filters = this.activeFilters, searchInput = this.searchInput) {
|
|
708
|
+
const searchTerms = this.normalizeSearchTerms(searchInput);
|
|
709
709
|
const activeFilters = (filters || []).filter((filter) => {
|
|
710
710
|
return filter?.term && filter?.facet && this.normalizeFacetValue(filter.facet) !== 'show all';
|
|
711
711
|
});
|
|
@@ -721,11 +721,16 @@ export default {
|
|
|
721
721
|
|
|
722
722
|
const filterGroups = Object.values(filtersByTerm);
|
|
723
723
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
return
|
|
727
|
-
|
|
728
|
-
|
|
724
|
+
return this.allCellTypes
|
|
725
|
+
.filter((cellType) => {
|
|
726
|
+
return filterGroups.every((termGroup) => {
|
|
727
|
+
return termGroup.some((filter) => this.matchFieldFilter(cellType, filter));
|
|
728
|
+
});
|
|
729
|
+
})
|
|
730
|
+
.filter((cellType) => this.matchSearchQuery(cellType, searchTerms));
|
|
731
|
+
},
|
|
732
|
+
applyFilters: function(filters) {
|
|
733
|
+
const filtered = this.getFilteredCellTypes(filters, this.searchInput);
|
|
729
734
|
|
|
730
735
|
this.totalFilteredCount = filtered.length;
|
|
731
736
|
this.cellTypes = filtered.slice(this.start, this.start + this.numberPerPage);
|