@abi-software/map-side-bar 2.17.1-demo.1 → 2.19.0

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.
Files changed (41) hide show
  1. package/.postcssrc.json +5 -5
  2. package/README.md +8 -9
  3. package/cypress.config.js +6 -7
  4. package/dist/map-side-bar.js +5906 -7001
  5. package/dist/map-side-bar.umd.cjs +62 -65
  6. package/dist/style.css +1 -1
  7. package/eslint.config.js +44 -9
  8. package/package.json +12 -5
  9. package/reporter-config.json +1 -1
  10. package/src/App.vue +80 -86
  11. package/src/algolia/algolia.js +173 -167
  12. package/src/algolia/utils.js +34 -38
  13. package/src/assets/_variables.scss +12 -10
  14. package/src/assets/connectivity-explorer.scss +1 -1
  15. package/src/assets/fonts.scss +0 -1
  16. package/src/assets/searchPopover.scss +1 -2
  17. package/src/components/AnnotationTool.vue +9 -32
  18. package/src/components/BadgesGroup.vue +29 -32
  19. package/src/components/ConnectivityCard.vue +22 -19
  20. package/src/components/ConnectivityExplorer.vue +107 -128
  21. package/src/components/ConnectivityInfo.vue +169 -128
  22. package/src/components/ContributorItem.vue +15 -11
  23. package/src/components/DatasetCard.vue +166 -201
  24. package/src/components/DatasetExplorer.vue +160 -201
  25. package/src/components/ImageGallery.vue +35 -36
  26. package/src/components/SearchFilters.vue +381 -408
  27. package/src/components/SearchHistory.vue +75 -91
  28. package/src/components/SideBar.vue +86 -193
  29. package/src/components/Tabs.vue +16 -30
  30. package/src/components/index.js +3 -5
  31. package/src/components/species-map.js +7 -7
  32. package/src/components.d.ts +0 -3
  33. package/src/exampleConnectivityInput.js +310 -318
  34. package/src/main.js +6 -6
  35. package/src/mixins/S3Bucket.vue +10 -13
  36. package/vite.config.js +62 -61
  37. package/vuese-generator.js +47 -55
  38. package/src/components/CellCard.vue +0 -994
  39. package/src/components/CellCardExplorer.vue +0 -882
  40. package/src/components/icons/IconOpenExternal.vue +0 -28
  41. package/src/utils/common.js +0 -71
@@ -29,7 +29,7 @@
29
29
  @tabClosed="tabClosed"
30
30
  @trackEvent="trackEvent"
31
31
  />
32
- <template v-for="tab in tabs" key="tab.id">
32
+ <template v-for="tab in tabs" :key="tab.id">
33
33
  <template v-if="tab.type === 'annotation'">
34
34
  <AnnotationTool
35
35
  :ref="'annotationTab_' + tab.id"
@@ -65,20 +65,6 @@
65
65
  @connectivity-item-close="onConnectivityItemClose"
66
66
  />
67
67
  </template>
68
- <template v-else-if="tab.type === 'cellCardExplorer' && showCellCards">
69
- <CellCardExplorer
70
- :ref="'cellCardExplorerTab_' + tab.id"
71
- class="sidebar-content-container"
72
- v-show="tab.id === activeTabId"
73
- :envVars="envVars"
74
- :activeSpecies="activeSpeciesForEntries"
75
- @search-changed="searchChanged(tab.id, $event)"
76
- @dataset-search="openDatasetSearchFromCellCard($event)"
77
- @connectivity-search="openConnectivitySearch($event.facets, $event.query)"
78
- @soma-location-hovered="showSomaLocation"
79
- @soma-locations-ready="onSomaLocationsReady"
80
- />
81
- </template>
82
68
  <template v-else>
83
69
  <DatasetExplorer
84
70
  class="sidebar-content-container"
@@ -101,16 +87,13 @@
101
87
  import {
102
88
  ArrowLeft as ElIconArrowLeft,
103
89
  ArrowRight as ElIconArrowRight,
104
- } from '@element-plus/icons-vue'
105
- /* eslint-disable no-alert, no-console */
106
- import { ElDrawer as Drawer, ElIcon as Icon } from 'element-plus'
107
- import DatasetExplorer from './DatasetExplorer.vue'
108
- import EventBus from './EventBus.js'
109
- import Tabs from './Tabs.vue'
110
- import AnnotationTool from './AnnotationTool.vue'
111
- import ConnectivityExplorer from './ConnectivityExplorer.vue'
112
- import CellCardExplorer from './CellCardExplorer.vue'
113
- import { removeShowAllFacets } from '../algolia/utils.js'
90
+ } from '@element-plus/icons-vue';
91
+ import DatasetExplorer from './DatasetExplorer.vue';
92
+ import EventBus from './EventBus.js';
93
+ import Tabs from './Tabs.vue';
94
+ import AnnotationTool from './AnnotationTool.vue';
95
+ import ConnectivityExplorer from './ConnectivityExplorer.vue';
96
+ import { removeShowAllFacets } from '../algolia/utils.js';
114
97
 
115
98
  /**
116
99
  * Aims to provide a sidebar for searching capability for SPARC portal.
@@ -121,21 +104,17 @@ export default {
121
104
  Tabs,
122
105
  ElIconArrowLeft,
123
106
  ElIconArrowRight,
124
- Drawer,
125
- Icon,
126
107
  AnnotationTool,
127
108
  ConnectivityExplorer,
128
- CellCardExplorer,
129
109
  },
130
110
  name: 'SideBar',
131
111
  props: {
132
112
  tabs: {
133
113
  type: Array,
134
- default: [
114
+ default: () => [
135
115
  { title: 'Dataset Explorer', id: 1, type: 'datasetExplorer', closable: false },
136
116
  { title: 'Connectivity Explorer', id: 2, type: 'connectivityExplorer', closable: false },
137
117
  { title: 'Annotation', id: 3, type: 'annotation', closable: true },
138
- { title: 'Cell Card Explorer', id: 4, type: 'cellCardExplorer', closable: false },
139
118
  ],
140
119
  },
141
120
  /**
@@ -166,32 +145,32 @@ export default {
166
145
  */
167
146
  connectivityEntry: {
168
147
  type: Array,
169
- default: [],
148
+ default: () => [],
170
149
  },
171
150
  /**
172
151
  * The annotation data to show in sidebar.
173
152
  */
174
153
  annotationEntry: {
175
154
  type: Array,
176
- default: [],
155
+ default: () => [],
177
156
  },
178
157
  createData: {
179
158
  type: Object,
180
- default: {
159
+ default: () => ({
181
160
  toBeConfirmed: false,
182
161
  points: [],
183
- shape: "",
162
+ shape: '',
184
163
  x: 0,
185
164
  y: 0,
186
- },
165
+ }),
187
166
  },
188
167
  connectivityKnowledge: {
189
168
  type: Array,
190
- default: [],
169
+ default: () => [],
191
170
  },
192
171
  filterOptions: {
193
172
  type: Array,
194
- default: [],
173
+ default: () => [],
195
174
  },
196
175
  showVisibilityFilter: {
197
176
  type: Boolean,
@@ -201,19 +180,14 @@ export default {
201
180
  type: Boolean,
202
181
  default: false,
203
182
  },
204
- showCellCards: {
205
- type: Boolean,
206
- default: false,
207
- },
208
183
  },
209
184
  data: function () {
210
185
  return {
211
186
  drawerOpen: false,
212
187
  availableAnatomyFacets: [],
213
188
  activeTabId: 1,
214
- activeAnnotationData: { tabType: "annotation" },
215
- activeConnectivityData: { tabType: "connectivity" },
216
- activeSpeciesForEntries: [],
189
+ activeAnnotationData: { tabType: 'annotation' },
190
+ activeConnectivityData: { tabType: 'connectivity' },
217
191
  state: {
218
192
  dataset: {
219
193
  search: '',
@@ -223,19 +197,15 @@ export default {
223
197
  search: '',
224
198
  filters: [],
225
199
  },
226
- cellCards: {
227
- search: '',
228
- filters: [],
229
- },
230
200
  connectivityEntries: [],
231
201
  annotationEntries: [],
232
202
  activeTabId: this.activeTabId,
233
203
  },
234
- }
204
+ };
235
205
  },
236
206
  methods: {
237
207
  onConnectivityCollapseChange: function (data) {
238
- this.$emit('connectivity-collapse-change', data)
208
+ this.$emit('connectivity-collapse-change', data);
239
209
  },
240
210
  /**
241
211
  * This event is emitted when
@@ -250,7 +220,7 @@ export default {
250
220
  * @arg data
251
221
  */
252
222
  hoverChanged: function (id, data) {
253
- this.$emit('hover-changed', {...data, tabId: id })
223
+ this.$emit('hover-changed', { ...data, tabId: id });
254
224
 
255
225
  const activeTabType = this.getActiveTabTypeById(id);
256
226
  // save the last highlighted data for connectivity and annotation tabs
@@ -261,16 +231,6 @@ export default {
261
231
  this.activeAnnotationData = data;
262
232
  }
263
233
  },
264
- /**
265
- * This event is emitted when the mouse hover on or off a soma location in cell card explorer.
266
- * @param name Soma location
267
- */
268
- showSomaLocation: function (name) {
269
- this.$emit('soma-location-hovered', name);
270
- },
271
- onSomaLocationsReady: function (somaLocations) {
272
- this.$emit('soma-locations-ready', somaLocations);
273
- },
274
234
  /**
275
235
  * This event is emitted when the show connectivity button is clicked.
276
236
  * @arg featureIds
@@ -297,21 +257,21 @@ export default {
297
257
  * @arg `obj` {data, id}
298
258
  */
299
259
  searchChanged: function (id, data) {
300
- this.$emit('search-changed', { ...data, tabId: id })
260
+ this.$emit('search-changed', { ...data, tabId: id });
301
261
  },
302
262
  /**
303
263
  * The function to close sidebar.
304
264
  * @public
305
265
  */
306
266
  close: function () {
307
- this.drawerOpen = false
267
+ this.drawerOpen = false;
308
268
  },
309
269
  /**
310
270
  * The function to toggle (open and close) sidebar.
311
271
  * @public
312
272
  */
313
273
  toggleDrawer: function () {
314
- this.drawerOpen = !this.drawerOpen
274
+ this.drawerOpen = !this.drawerOpen;
315
275
  },
316
276
  openConnectivitySearch: function (facets, query) {
317
277
  this.drawerOpen = true;
@@ -319,65 +279,30 @@ export default {
319
279
  this.$nextTick(() => {
320
280
  const connectivityExplorerTabRef = this.getTabRef(undefined, 'connectivityExplorer', true);
321
281
  connectivityExplorerTabRef.openSearch(facets, query);
322
- })
282
+ });
323
283
  },
324
284
  resetConnectivitySearch: function () {
325
285
  this.$nextTick(() => {
326
286
  const connectivityExplorerTabRef = this.getTabRef(undefined, 'connectivityExplorer', false);
327
287
  connectivityExplorerTabRef.resetSearchIfNoActiveSearch();
328
- })
288
+ });
329
289
  },
330
290
  openSearch: function (facets, query) {
331
- this.drawerOpen = true
291
+ this.drawerOpen = true;
332
292
  // Because refs are in v-for, nextTick is needed here
333
293
  this.$nextTick(() => {
334
294
  const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer', true);
335
295
  datasetExplorerTabRef.openSearch(facets, query);
336
- })
337
- },
338
- openCellCardExplorerSearch: function (filters, query) {
339
- this.drawerOpen = true
340
- // Because refs are in v-for, nextTick is needed here
341
- this.$nextTick(() => {
342
- const cellCardExplorerTabRef = this.getTabRef(undefined, 'cellCardExplorer', true);
343
- if (cellCardExplorerTabRef && typeof cellCardExplorerTabRef.openSearch === 'function') {
344
- cellCardExplorerTabRef.openSearch(filters, query);
345
- }
346
- })
347
- },
348
- openDatasetSearchFromCellCard: function (payload) {
349
- if (!payload || typeof payload !== 'object') {
350
- this.openSearch([], payload);
351
- return;
352
- }
353
-
354
- const facets = [];
355
- if (payload.species) {
356
- facets.push({
357
- facet: payload.species,
358
- term: 'Species',
359
- facetPropPath: 'organisms.primary.species.name',
360
- });
361
- }
362
-
363
- if (payload.location) {
364
- facets.push({
365
- facet: payload.location,
366
- term: 'Anatomical structure',
367
- facetPropPath: 'anatomy.organ.category.name',
368
- AND: true,
369
- });
370
- }
371
-
372
- this.openSearch(facets, '');
296
+ });
373
297
  },
374
298
  /**
375
299
  * Get the ref id of the tab by id and type.
376
300
  */
377
301
  getTabRef: function (id, type, switchTab = false) {
378
302
  const matchedTab = this.tabEntries.filter((tabEntry) => {
379
- return (id === undefined || tabEntry.id === id) &&
380
- (type === undefined || tabEntry.type === type);
303
+ return (
304
+ (id === undefined || tabEntry.id === id) && (type === undefined || tabEntry.type === type)
305
+ );
381
306
  });
382
307
  const tabInfo = matchedTab.length ? matchedTab : this.tabEntries;
383
308
  const tabRef = tabInfo[0].type + 'Tab_' + tabInfo[0].id;
@@ -395,40 +320,38 @@ export default {
395
320
  */
396
321
  addFilter: function (filter) {
397
322
  if (filter) {
398
- this.drawerOpen = true
323
+ this.drawerOpen = true;
399
324
  let filterToAdd = filter;
400
325
  if (Array.isArray(filter)) {
401
- filterToAdd.forEach(item => item.AND = true);
326
+ filterToAdd.forEach((item) => (item.AND = true));
402
327
  } else {
403
- filter.AND = true // When we add a filter external, it is currently only with an AND boolean
404
- filterToAdd = [filter]
328
+ filter.AND = true; // When we add a filter external, it is currently only with an AND boolean
329
+ filterToAdd = [filter];
405
330
  }
406
331
  // Because refs are in v-for, nextTick is needed here
407
332
  this.$nextTick(() => {
408
333
  const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer', true);
409
- datasetExplorerTabRef.addFilter(filterToAdd)
410
- })
334
+ datasetExplorerTabRef.addFilter(filterToAdd);
335
+ });
411
336
  }
412
337
  },
413
338
  openNeuronSearch: function (neuron) {
414
- this.drawerOpen = true
339
+ this.drawerOpen = true;
415
340
  // Because refs are in v-for, nextTick is needed here
416
341
  this.$nextTick(() => {
417
342
  const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer', true);
418
- datasetExplorerTabRef.openSearch(
419
- '',
420
- undefined,
421
- 'scicrunch-query-string/',
422
- { field: '*organ.curie', curie: neuron }
423
- )
424
- })
343
+ datasetExplorerTabRef.openSearch('', undefined, 'scicrunch-query-string/', {
344
+ field: '*organ.curie',
345
+ curie: neuron,
346
+ });
347
+ });
425
348
  },
426
349
  getAlgoliaFacets: async function () {
427
350
  const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer');
428
- return await datasetExplorerTabRef.getAlgoliaFacets()
351
+ return await datasetExplorerTabRef.getAlgoliaFacets();
429
352
  },
430
353
  setDrawerOpen: function (value = true) {
431
- this.drawerOpen = value
354
+ this.drawerOpen = value;
432
355
  },
433
356
  setActiveTab: function (tab) {
434
357
  const matchedTab = this.tabs.filter((tabEntry) => {
@@ -454,10 +377,10 @@ export default {
454
377
  if (connectivityExplorerTabRef && !connectivityExplorerTabRef.expanded) {
455
378
  data = { tabType: 'connectivity' };
456
379
  } else {
457
- data = {...this.activeConnectivityData};
380
+ data = { ...this.activeConnectivityData };
458
381
  }
459
382
  } else if (tab.type === 'annotation') {
460
- data = {...this.activeAnnotationData};
383
+ data = { ...this.activeAnnotationData };
461
384
  } else {
462
385
  // switching to dataset explorer tab will not highlight
463
386
  // the highlight is from the last tab
@@ -465,7 +388,7 @@ export default {
465
388
  }
466
389
 
467
390
  if (data) {
468
- this.$emit('hover-changed', {...data, tabId: tab.id })
391
+ this.$emit('hover-changed', { ...data, tabId: tab.id });
469
392
  }
470
393
  },
471
394
  tabClicked: function (tab) {
@@ -487,7 +410,7 @@ export default {
487
410
  * Store available anatomy facets data for connectivity list component
488
411
  */
489
412
  storeAvailableAnatomyFacets: function (availableAnatomyFacets) {
490
- localStorage.setItem('available-anatomy-facets', JSON.stringify(availableAnatomyFacets))
413
+ localStorage.setItem('available-anatomy-facets', JSON.stringify(availableAnatomyFacets));
491
414
  },
492
415
  closeConnectivity: function () {
493
416
  EventBus.emit('close-connectivity');
@@ -509,13 +432,6 @@ export default {
509
432
  this.state.connectivity.filters = connectivityExplorerTabRef.getFilters();
510
433
  }
511
434
 
512
- // Update cell card explorer state if available
513
- const cellCardExplorerTabRef = this.getTabRef(undefined, 'cellCardExplorer');
514
- if (cellCardExplorerTabRef) {
515
- this.state.cellCards.search = cellCardExplorerTabRef.getSearch();
516
- this.state.cellCards.filters = cellCardExplorerTabRef.getFilters();
517
- }
518
-
519
435
  // Update connectivity entries if available
520
436
  if (this.connectivityEntry && this.connectivityEntry.length > 0) {
521
437
  this.state.connectivityEntries = this.connectivityEntry.map((entry) => entry.id);
@@ -545,15 +461,11 @@ export default {
545
461
  setState: function (state) {
546
462
  // if state is not provided or formatted incorrectly, do nothing
547
463
  if (!state || !state.dataset || !state.connectivity) return;
548
- // Create a deep copy while preserving the original state structure for future extensibility
549
- const newState = JSON.parse(JSON.stringify(state));
550
- this.state = { ...this.state, ...newState };
551
- const datasetFilters = this.state.dataset.filters;
552
- const connectivityFilters = this.state.connectivity.filters;
553
- const datasetSearch = this.state.dataset.search;
554
- const connectivitySearch = this.state.connectivity.search;
555
- const cellCardFilters = this.state.cellCards.filters || [];
556
- const cellCardSearch = this.state.cellCards.search || '';
464
+ this.state = JSON.parse(JSON.stringify(state)); // deep copy to avoid reference issues
465
+ const datasetFilters = state.dataset.filters;
466
+ const connectivityFilters = state.connectivity.filters;
467
+ const datasetSearch = state.dataset.search;
468
+ const connectivitySearch = state.connectivity.search;
557
469
 
558
470
  if (datasetFilters.length || datasetSearch) {
559
471
  this.openSearch(datasetFilters, datasetSearch);
@@ -563,10 +475,6 @@ export default {
563
475
  this.openConnectivitySearch(connectivityFilters, connectivitySearch);
564
476
  }
565
477
 
566
- if (cellCardFilters.length || cellCardSearch) {
567
- this.openCellCardExplorerSearch(cellCardFilters, cellCardSearch);
568
- }
569
-
570
478
  if (state.activeTabId) {
571
479
  this.$nextTick(() => {
572
480
  const hasTab = this.tabEntries.find((t) => t.id === state.activeTabId);
@@ -583,43 +491,26 @@ export default {
583
491
  */
584
492
  trackEvent: function (data) {
585
493
  const taggingData = {
586
- 'event': 'interaction_event',
587
- 'location': 'map_sidebar',
494
+ event: 'interaction_event',
495
+ location: 'map_sidebar',
588
496
  ...data,
589
497
  };
590
498
  this.$emit('trackEvent', taggingData);
591
499
  },
592
- /**
593
- * @public
594
- * Update the active species to use in filters.
595
- * Used by SplitFlow component.
596
- * @param activeSpecies
597
- */
598
- updateActiveSpeciesForEntries: function (activeSpecies) {
599
- const speciesEntries = Array.isArray(activeSpecies) ? activeSpecies : [activeSpecies];
600
- this.activeSpeciesForEntries = [...new Set(speciesEntries.filter(Boolean))];
601
- },
602
500
  },
603
501
  computed: {
604
502
  // This should respect the information provided by the property
605
503
  tabEntries: function () {
606
- return this.tabs.filter((tab) =>
607
- tab.type === "datasetExplorer" ||
608
- tab.type === "connectivityExplorer" ||
609
- (
610
- tab.type === "annotation" &&
611
- this.annotationEntry &&
612
- this.annotationEntry.length > 0
613
- ) ||
614
- (
615
- tab.type === "cellCardExplorer" &&
616
- this.showCellCards
617
- )
504
+ return this.tabs.filter(
505
+ (tab) =>
506
+ tab.type === 'datasetExplorer' ||
507
+ tab.type === 'connectivityExplorer' ||
508
+ (tab.type === 'annotation' && this.annotationEntry && this.annotationEntry.length > 0),
618
509
  );
619
510
  },
620
511
  },
621
512
  created: function () {
622
- this.drawerOpen = this.openAtStart
513
+ this.drawerOpen = this.openAtStart;
623
514
  },
624
515
  mounted: function () {
625
516
  EventBus.on('PopoverActionClick', (payLoad) => {
@@ -627,22 +518,22 @@ export default {
627
518
  * This event is emitted when the image is clicked on or the button below the image is clicked on.
628
519
  * @arg payLoad
629
520
  */
630
- this.$emit('actionClick', payLoad)
631
- })
521
+ this.$emit('actionClick', payLoad);
522
+ });
632
523
  EventBus.on('number-of-datasets-for-anatomies', (payLoad) => {
633
524
  /**
634
525
  * This emits a object with keys as anatomy and values as number of datasets for that anatomy.
635
526
  * @arg payload
636
527
  */
637
- this.$emit('number-of-datasets-for-anatomies', payLoad)
638
- })
528
+ this.$emit('number-of-datasets-for-anatomies', payLoad);
529
+ });
639
530
  EventBus.on('anatomy-in-datasets', (payLoad) => {
640
- /**
531
+ /**
641
532
  * This emits a lis of datasets, with the anatomy for each one. Used by flatmap for markers
642
533
  * @arg payload
643
534
  */
644
- this.$emit('anatomy-in-datasets', payLoad)
645
- })
535
+ this.$emit('anatomy-in-datasets', payLoad);
536
+ });
646
537
 
647
538
  EventBus.on('contextUpdate', (payLoad) => {
648
539
  /**
@@ -650,8 +541,8 @@ export default {
650
541
  * Example, context card update on first load.
651
542
  * @arg payload
652
543
  */
653
- this.$emit('contextUpdate', payLoad)
654
- })
544
+ this.$emit('contextUpdate', payLoad);
545
+ });
655
546
  EventBus.on('datalink-clicked', (payLoad) => {
656
547
  /**
657
548
  * This event is emitted
@@ -660,31 +551,33 @@ export default {
660
551
  * @arg payload
661
552
  */
662
553
  this.$emit('datalink-clicked', payLoad);
663
- })
554
+ });
664
555
  EventBus.on('onConnectivityActionClick', (payLoad) => {
665
556
  // switch to search tab with tab id: 1
666
- this.tabClicked({id: 1, type: 'datasetExplorer'});
557
+ this.tabClicked({ id: 1, type: 'datasetExplorer' });
667
558
  this.$emit('actionClick', payLoad);
668
- })
559
+ });
669
560
  EventBus.on('connectivity-source-change', (payLoad) => {
670
561
  this.$emit('connectivity-source-change', payLoad);
671
- })
562
+ });
672
563
  EventBus.on('show-connectivity-graph', (payLoad) => {
673
564
  this.$emit('show-connectivity-graph', payLoad);
674
- })
565
+ });
675
566
 
676
567
  // Get available anatomy facets for the connectivity info
677
568
  EventBus.on('available-facets', (payLoad) => {
678
- this.availableAnatomyFacets = payLoad.find((facet) => facet.label === 'Anatomical Structure').children
679
- this.storeAvailableAnatomyFacets(this.availableAnatomyFacets);
680
- })
569
+ this.availableAnatomyFacets = payLoad.find(
570
+ (facet) => facet.label === 'Anatomical Structure',
571
+ ).children;
572
+ this.storeAvailableAnatomyFacets(this.availableAnatomyFacets);
573
+ });
681
574
 
682
575
  // Event tracking
683
576
  EventBus.on('trackEvent', (data) => {
684
577
  this.trackEvent(data);
685
578
  });
686
579
  },
687
- }
580
+ };
688
581
  </script>
689
582
 
690
583
  <style lang="scss" scoped>
@@ -699,7 +592,7 @@ export default {
699
592
  position: relative;
700
593
  height: 100%;
701
594
  pointer-events: none;
702
- width:600px;
595
+ width: 600px;
703
596
  float: right;
704
597
  }
705
598
 
@@ -786,12 +679,12 @@ export default {
786
679
 
787
680
  <style lang="scss">
788
681
  .side-bar {
789
- --el-color-primary: #8300BF;
790
- --el-color-primary-light-7: #DAB3EC;
682
+ --el-color-primary: #8300bf;
683
+ --el-color-primary-light-7: #dab3ec;
791
684
  --el-color-primary-light-8: #e6ccf2;
792
685
  --el-color-primary-light-9: #f3e6f9;
793
686
  --el-color-primary-light-3: #f3e6f9;
794
- --el-color-primary-dark-2: #7600AC;
687
+ --el-color-primary-dark-2: #7600ac;
795
688
  }
796
689
  .el-button--primary {
797
690
  --el-button-hover-text-color: var(--el-color-primary);
@@ -4,15 +4,11 @@
4
4
  class="tab"
5
5
  v-for="tab in tabs"
6
6
  :key="tab.id"
7
- :class="{ 'active-tab': tab.id == activeId, 'closable-tab': tab.closable }"
7
+ :class="{ 'active-tab': tab.id == activeId }"
8
8
  @click="tabClicked(tab)"
9
9
  >
10
- <span class="tab-title">{{ tab.title }} </span>
11
- <el-icon
12
- v-if="tab.closable"
13
- @click.stop="tabClosed(tab)"
14
- class="tab-close-icon"
15
- >
10
+ <span class="tab-title">{{ tab.title }}</span>
11
+ <el-icon v-if="tab.closable" @click.stop="tabClosed(tab)" class="tab-close-icon">
16
12
  <el-icon-close />
17
13
  </el-icon>
18
14
  </div>
@@ -20,11 +16,10 @@
20
16
  </template>
21
17
 
22
18
  <script>
23
- /* eslint-disable no-alert, no-console */
24
- import { Close as ElIconClose } from "@element-plus/icons-vue";
19
+ import { Close as ElIconClose } from '@element-plus/icons-vue';
25
20
 
26
21
  export default {
27
- name: "Tabs",
22
+ name: 'Tabs',
28
23
  components: {
29
24
  ElIconClose,
30
25
  },
@@ -58,18 +53,18 @@ export default {
58
53
  },
59
54
  methods: {
60
55
  tabClicked: function (tab) {
61
- this.$emit("tabClicked", { id: tab.id, type: tab.type });
56
+ this.$emit('tabClicked', { id: tab.id, type: tab.type });
62
57
 
63
58
  // To track only direct tab click events
64
59
  this.$emit('trackEvent', {
65
- 'event': 'interaction_event',
66
- 'event_name': 'portal_maps_sidebar_open_tab',
67
- 'category': tab.type,
68
- 'location': 'map_sidebar_tabs',
60
+ event: 'interaction_event',
61
+ event_name: 'portal_maps_sidebar_open_tab',
62
+ category: tab.type,
63
+ location: 'map_sidebar_tabs',
69
64
  });
70
65
  },
71
66
  tabClosed: function (tab) {
72
- this.$emit("tabClosed", { id: tab.id, type: tab.type });
67
+ this.$emit('tabClosed', { id: tab.id, type: tab.type });
73
68
  },
74
69
  },
75
70
  };
@@ -103,23 +98,14 @@ export default {
103
98
  .tab-title {
104
99
  text-align: center;
105
100
  font-size: 14px;
106
- padding: 0 0.75rem;
107
-
108
- .closable-tab & {
109
- padding-right: 0.25rem;
110
- }
101
+ padding: 0 1rem;
111
102
  }
112
103
 
113
104
  .tab-close-icon {
114
- width: 18px !important;
115
- height: 18px !important;
116
- font-size: 18px !important;
117
- margin-right: 4px !important;
105
+ width: 20px !important;
106
+ height: 20px !important;
107
+ font-size: 20px !important;
108
+ padding-right: 4px !important;
118
109
  color: $app-primary-color !important;
119
- border-radius: 2px;
120
-
121
- &:hover {
122
- background-color: rgba($app-primary-color, 0.15) !important;
123
- }
124
110
  }
125
111
  </style>
@@ -1,6 +1,4 @@
1
- import SideBar from "./SideBar.vue"
2
- import "../assets/fonts.scss";
1
+ import SideBar from './SideBar.vue';
2
+ import '../assets/fonts.scss';
3
3
 
4
- export {
5
- SideBar
6
- };
4
+ export { SideBar };
@@ -1,8 +1,8 @@
1
1
  export default {
2
- 'homo sapiens': 'Human',
3
- 'rattus norvegicus': 'Rat',
4
- 'mus musculus': 'Mouse',
5
- 'sus scrofa domesticus': 'Pig',
6
- 'sus scrofa': 'Boar',
7
- 'felis catus': 'Cat'
8
- }
2
+ 'homo sapiens': 'Human',
3
+ 'rattus norvegicus': 'Rat',
4
+ 'mus musculus': 'Mouse',
5
+ 'sus scrofa domesticus': 'Pig',
6
+ 'sus scrofa': 'Boar',
7
+ 'felis catus': 'Cat',
8
+ };