@abi-software/map-side-bar 2.14.8-demo.2 → 2.14.8-demo.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "2.14.8-demo.2",
3
+ "version": "2.14.8-demo.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -152,8 +152,16 @@
152
152
  </div>
153
153
  <div v-if="cellType.relatedCells?.length" class="card-section">
154
154
  <div class="card-section-title">Related Species Variants</div>
155
- <ul v-for="relatedCell in cellType.relatedCells" :key="relatedCell">
156
- <li>{{ relatedCell.label }}</li>
155
+ <ul class="related-cell-list">
156
+ <li v-for="relatedCell in cellType.relatedCells" :key="relatedCell">
157
+ <button
158
+ class="related-cell-item"
159
+ @click.stop="$emit('related-cell-click', relatedCell)"
160
+ title="Click to view this cell type"
161
+ >
162
+ {{ relatedCell.label }}
163
+ </button>
164
+ </li>
157
165
  </ul>
158
166
  </div>
159
167
  <div v-if="cellType.sourceNomenclature" class="card-section source-publication-section">
@@ -236,7 +244,7 @@ export default {
236
244
  default: false,
237
245
  },
238
246
  },
239
- emits: ['open', 'close', 'soma-location-hovered', 'dataset-search', 'connectivity-search'],
247
+ emits: ['open', 'close', 'soma-location-hovered', 'dataset-search', 'connectivity-search', 'related-cell-click'],
240
248
  data() {
241
249
  return {
242
250
  cardElement: null,
@@ -741,6 +749,11 @@ export default {
741
749
  margin: 0;
742
750
  padding-left: 1rem;
743
751
 
752
+ &.related-cell-list {
753
+ list-style-type: none;
754
+ padding-left: 0;
755
+ }
756
+
744
757
  li {
745
758
  color: #606266;
746
759
  }
@@ -955,4 +968,27 @@ export default {
955
968
  }
956
969
  }
957
970
  }
971
+
972
+ .related-cell-list {
973
+ li + li {
974
+ margin-top: 0.5rem;
975
+ }
976
+ }
977
+
978
+ .related-cell-item {
979
+ cursor: pointer;
980
+ color: $app-primary-color;
981
+ background: none;
982
+ border: 1px solid $app-primary-color;
983
+ border-radius: 4px;
984
+ padding: 2px 4px;
985
+ font-family: inherit;
986
+ font-size: inherit;
987
+ line-height: inherit;
988
+ transition: background-color 0.2s ease, border-color 0.2s ease, text-decoration-color 0.2s ease;
989
+
990
+ &:hover {
991
+ background-color: rgba($app-primary-color, 0.08);
992
+ }
993
+ }
958
994
  </style>
@@ -92,6 +92,7 @@
92
92
  @dataset-search="onDatasetSearch"
93
93
  @connectivity-search="onConnectivitySearch"
94
94
  @soma-location-hovered="showSomaLocation"
95
+ @related-cell-click="onRelatedCellClick"
95
96
  />
96
97
  <el-pagination
97
98
  class="pagination"
@@ -739,6 +740,52 @@ export default {
739
740
  tabType: "cellType",
740
741
  });
741
742
  },
743
+ onRelatedCellClick: function(relatedCell) {
744
+ const species = relatedCell.species;
745
+ const label = relatedCell.label;
746
+
747
+ // Normalize species (e.g., "human male" -> "human")
748
+ const normalizedSpecies = this.normalizeActiveSpeciesFilterTerm(species);
749
+
750
+ // Check if this species filter already exists
751
+ const speciesFilterExists = this.activeFilters.some(function(filter) {
752
+ return this.normalizeFacetValue(filter.term) === 'species'
753
+ && this.normalizeFacetValue(filter.facet) === this.normalizeFacetValue(normalizedSpecies);
754
+ }, this);
755
+
756
+ // Add species filter if not already present
757
+ if (!speciesFilterExists && normalizedSpecies) {
758
+ this.activeFilters.push({
759
+ facetPropPath: 'species',
760
+ facet: capitalise(normalizedSpecies),
761
+ term: 'Species',
762
+ tagLabel: capitalise(normalizedSpecies),
763
+ });
764
+ }
765
+
766
+ // Clear search input to avoid text search interfering
767
+ this.searchInput = '';
768
+ this.page = 1;
769
+ this.start = 0;
770
+
771
+ // Apply filters and sync cascader UI
772
+ this.applyFilters(this.activeFilters);
773
+ this.syncCascaderFromActiveFilters();
774
+ this.emitSomaLocations(this.filterOptions);
775
+
776
+ // Find the matching cell type by preferredLabel and open its card
777
+ const matchingCellType = this.allCellTypes.find(function(ct) {
778
+ return (ct.preferredLabel || '').toLowerCase() === (label || '').toLowerCase();
779
+ });
780
+
781
+ if (matchingCellType) {
782
+ this.activeCardId = matchingCellType.id;
783
+ }
784
+
785
+ this.$nextTick(function() {
786
+ this.scrollToTop();
787
+ });
788
+ },
742
789
  showSomaLocation: function (name) {
743
790
  this.$emit('soma-location-hovered', name);
744
791
  },