@abi-software/map-side-bar 2.4.0 → 2.4.2-beta.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.
@@ -22,9 +22,11 @@
22
22
  </div>
23
23
  <div class="sidebar-container">
24
24
  <Tabs
25
- v-if="tabs.length > 1 && connectivityInfo"
25
+ v-if="tabs.length > 1 && (connectivityInfo || imageThumbnails.length)"
26
26
  :tabTitles="tabs"
27
27
  :activeId="activeTabId"
28
+ :hasConnectivityInfo="!!connectivityInfo"
29
+ :hasImageThumbnails="!!imageThumbnails.length"
28
30
  @titleClicked="tabClicked"
29
31
  @tab-close="tabClose"
30
32
  />
@@ -39,6 +41,13 @@
39
41
  @show-connectivity="showConnectivity"
40
42
  />
41
43
  </template>
44
+ <template v-else-if="tab.type === 'images'">
45
+ <ImageThumbnails
46
+ v-if="imageThumbnails.length"
47
+ v-show="tab.id === activeTabId"
48
+ :imageThumbnails="imageThumbnails"
49
+ />
50
+ </template>
42
51
  <template v-else>
43
52
  <SidebarContent
44
53
  class="sidebar-content-container"
@@ -68,6 +77,7 @@ import SidebarContent from './SidebarContent.vue'
68
77
  import EventBus from './EventBus.js'
69
78
  import Tabs from './Tabs.vue'
70
79
  import ConnectivityInfo from './ConnectivityInfo.vue'
80
+ import ImageThumbnails from './ImageThumbnails.vue'
71
81
 
72
82
  /**
73
83
  * Aims to provide a sidebar for searching capability for SPARC portal.
@@ -81,6 +91,7 @@ export default {
81
91
  Drawer,
82
92
  Icon,
83
93
  ConnectivityInfo,
94
+ ImageThumbnails,
84
95
  },
85
96
  name: 'SideBar',
86
97
  props: {
@@ -108,7 +119,8 @@ export default {
108
119
  type: Array,
109
120
  default: () => [
110
121
  { id: 1, title: 'Search', type: 'search' },
111
- { id: 2, title: 'Connectivity', type: 'connectivity' }
122
+ { id: 2, title: 'Connectivity', type: 'connectivity' },
123
+ { id: 3, title: 'Images', type: 'images' }, // Temporary
112
124
  ],
113
125
  },
114
126
  /**
@@ -132,6 +144,13 @@ export default {
132
144
  type: Object,
133
145
  default: null,
134
146
  },
147
+ /**
148
+ * The image thumbnails data to show in sidebar.
149
+ */
150
+ imageThumbnails: {
151
+ type: Array,
152
+ default: [],
153
+ },
135
154
  },
136
155
  data: function () {
137
156
  return {
@@ -260,7 +279,12 @@ export default {
260
279
  this.$emit('tabClicked', {id, type});
261
280
  },
262
281
  tabClose: function (id) {
263
- this.$emit('connectivity-info-close');
282
+ const closedTab = this.tabs.find((tab) => tab.id === id);
283
+ if (closedTab.type === 'connectivity') {
284
+ this.$emit('connectivity-info-close');
285
+ } else if (closedTab.type === 'images') {
286
+ this.$emit('image-thumbnail-close');
287
+ }
264
288
  },
265
289
  },
266
290
  created: function () {
@@ -2,7 +2,7 @@
2
2
  <div class="tab-container">
3
3
  <div
4
4
  class="title"
5
- v-for="title in tabTitles"
5
+ v-for="title in titles"
6
6
  :key="title.id"
7
7
  :class="{ 'active-tab': title.id == activeId }"
8
8
  >
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
  </div>
18
18
  <el-button
19
- v-if="title.id === 2"
19
+ v-if="title.type === 'connectivity' || title.type === 'images'"
20
20
  @click="tabClose(title.id)"
21
21
  class="button-tab-close"
22
22
  aria-label="Close"
@@ -42,6 +42,25 @@ export default {
42
42
  type: Number,
43
43
  default: 1,
44
44
  },
45
+ hasConnectivityInfo: {
46
+ type: Boolean,
47
+ default: true,
48
+ },
49
+ hasImageThumbnails: {
50
+ type: Boolean,
51
+ default: true,
52
+ },
53
+ },
54
+ computed: {
55
+ titles: function() {
56
+ if (!this.hasConnectivityInfo) {
57
+ return this.tabTitles.filter((tab) => tab.type !== 'connectivity');
58
+ }
59
+ else if (!this.hasImageThumbnails) {
60
+ return this.tabTitles.filter((tab) => tab.type !== 'images');
61
+ }
62
+ return this.tabTitles;
63
+ },
45
64
  },
46
65
  methods: {
47
66
  titleClicked: function (id, type) {
@@ -73,6 +92,7 @@ $tab-height: 30px;
73
92
  align-items: center;
74
93
  position: relative;
75
94
  cursor: pointer;
95
+ z-index: 2;
76
96
  }
77
97
 
78
98
  .title-text {
@@ -19,6 +19,8 @@ declare module 'vue' {
19
19
  ElIconArrowRight: typeof import('@element-plus/icons-vue')['ArrowRight']
20
20
  ElIconLocation: typeof import('@element-plus/icons-vue')['Location']
21
21
  ElIconWarning: typeof import('@element-plus/icons-vue')['Warning']
22
+ ElIconWarnTriangleFilled: typeof import('@element-plus/icons-vue')['WarnTriangleFilled']
23
+ ElImage: typeof import('element-plus/es')['ElImage']
22
24
  ElInput: typeof import('element-plus/es')['ElInput']
23
25
  ElOption: typeof import('element-plus/es')['ElOption']
24
26
  ElPagination: typeof import('element-plus/es')['ElPagination']
@@ -27,6 +29,7 @@ declare module 'vue' {
27
29
  ElTag: typeof import('element-plus/es')['ElTag']
28
30
  ExternalResourceCard: typeof import('./components/ExternalResourceCard.vue')['default']
29
31
  ImageGallery: typeof import('./components/ImageGallery.vue')['default']
32
+ ImageThumbnails: typeof import('./components/ImageThumbnails.vue')['default']
30
33
  SearchFilters: typeof import('./components/SearchFilters.vue')['default']
31
34
  SearchHistory: typeof import('./components/SearchHistory.vue')['default']
32
35
  SideBar: typeof import('./components/SideBar.vue')['default']
@@ -0,0 +1,41 @@
1
+ [
2
+ {
3
+ "thumbnail": "http://localhost:8000//thumbnail/21567",
4
+ "resource": "derivative/sub-Pirt-1A/sam-7/2020-01-06_11.26.19_ AAV DRG inj.- Pirt Cre 1A_DRG T2b.jpx",
5
+ "id": "353",
6
+ "title": "2020-01-06_11.26.19_ AAV DRG inj.- Pirt Cre 1A_DRG T2b.jpx",
7
+ "type": "Image",
8
+ "link": "http://localhost:8000//thumbnail/21567",
9
+ "mimetype": "image/jpx",
10
+ "species": [
11
+ "Mouse"
12
+ ],
13
+ "version": "1"
14
+ },
15
+ {
16
+ "thumbnail": "http://localhost:8000//thumbnail/21568",
17
+ "resource": "derivative/sub-Pirt-1A/sam-7/2020-01-06_11.36.02_FusionStitcher AAV DRG inj.- Pirt Cre 1A_DRG T4ab.jpx",
18
+ "id": "353",
19
+ "title": "2020-01-06_11.36.02_FusionStitcher AAV DRG inj.- Pirt Cre 1A_DRG T4ab.jpx",
20
+ "type": "Image",
21
+ "link": "http://localhost:8000//thumbnail/21568",
22
+ "mimetype": "image/jpx",
23
+ "species": [
24
+ "Mouse"
25
+ ],
26
+ "version": "1"
27
+ },
28
+ {
29
+ "thumbnail": "http://localhost:8000//thumbnail/21569",
30
+ "resource": "derivative/sub-Pirt-2A/2020-01-13_11.16.35_ssxxs_Kim_FusionStitcher vagal ganglia.jpx",
31
+ "id": "353",
32
+ "title": "2020-01-13_11.16.35_ssxxs_Kim_FusionStitcher vagal ganglia.jpx",
33
+ "type": "Image",
34
+ "link": "http://localhost:8000//thumbnail/21569",
35
+ "mimetype": "image/jpx",
36
+ "species": [
37
+ "Mouse"
38
+ ],
39
+ "version": "1"
40
+ }
41
+ ]