@abi-software/map-side-bar 2.7.3-beta.0 → 2.7.3-beta.2
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 +7803 -7352
- package/dist/map-side-bar.umd.cjs +62 -62
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/App.vue +96 -32
- package/src/assets/pagination.scss +21 -0
- package/src/components/AnnotationTool.vue +1 -1
- package/src/components/ConnectivityCard.vue +93 -0
- package/src/components/ConnectivityExplorer.vue +615 -0
- package/src/components/ConnectivityInfo.vue +387 -383
- package/src/components/SearchFilters.vue +161 -129
- package/src/components/SearchHistory.vue +11 -13
- package/src/components/SideBar.vue +109 -116
- package/src/components/SidebarContent.vue +24 -18
- package/src/components/Tabs.vue +56 -95
- package/src/components.d.ts +5 -0
- package/src/exampleConnectivityInput.js +320 -290
- package/src/services/flatmapKnowledge.js +94 -0
- package/src/services/flatmapQueries.js +498 -0
|
@@ -22,28 +22,15 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
<div class="sidebar-container">
|
|
24
24
|
<Tabs
|
|
25
|
-
v-if="
|
|
26
|
-
:
|
|
25
|
+
v-if="tabEntries.length > 1"
|
|
26
|
+
:tabEntries="tabEntries"
|
|
27
27
|
:activeId="activeTabId"
|
|
28
|
-
@
|
|
29
|
-
@
|
|
28
|
+
@tabClicked="tabClicked"
|
|
29
|
+
@tabClosed="tabClosed"
|
|
30
30
|
/>
|
|
31
31
|
<template v-for="tab in tabs" key="tab.id">
|
|
32
|
-
<!-- Connectivity Info -->
|
|
33
|
-
<template v-if="tab.type === 'connectivity' && connectivityInfo">
|
|
34
|
-
<connectivity-info
|
|
35
|
-
:entry="connectivityInfo"
|
|
36
|
-
:availableAnatomyFacets="availableAnatomyFacets"
|
|
37
|
-
v-if="tab.id === activeTabId"
|
|
38
|
-
:envVars="envVars"
|
|
39
|
-
:ref="'connectivityTab_' + tab.id"
|
|
40
|
-
@show-connectivity="showConnectivity"
|
|
41
|
-
@show-reference-connectivities="onShowReferenceConnectivities"
|
|
42
|
-
@connectivity-component-click="onConnectivityComponentClick"
|
|
43
|
-
/>
|
|
44
|
-
</template>
|
|
45
32
|
<template v-if="tab.type === 'annotation'">
|
|
46
|
-
<
|
|
33
|
+
<AnnotationTool
|
|
47
34
|
:ref="'annotationTab_' + tab.id"
|
|
48
35
|
v-show="tab.id === activeTabId"
|
|
49
36
|
:annotationEntry="annotationEntry"
|
|
@@ -54,13 +41,29 @@
|
|
|
54
41
|
@confirm-delete="$emit('confirm-delete', $event)"
|
|
55
42
|
/>
|
|
56
43
|
</template>
|
|
57
|
-
<template v-if="tab.type === '
|
|
44
|
+
<template v-else-if="tab.type === 'connectivityExplorer'">
|
|
45
|
+
<ConnectivityExplorer
|
|
46
|
+
:ref="'connectivityExplorerTab_' + tab.id"
|
|
47
|
+
v-show="tab.id === activeTabId"
|
|
48
|
+
:connectivityKnowledge="connectivityKnowledge"
|
|
49
|
+
:envVars="envVars"
|
|
50
|
+
:connectivityEntry="connectivityEntry"
|
|
51
|
+
:availableAnatomyFacets="availableAnatomyFacets"
|
|
52
|
+
@search-changed="searchChanged(tab.id, $event)"
|
|
53
|
+
@hover-changed="hoverChanged($event)"
|
|
54
|
+
@show-connectivity="showConnectivity"
|
|
55
|
+
@show-reference-connectivities="onShowReferenceConnectivities"
|
|
56
|
+
@connectivity-hovered="onConnectivityHovered"
|
|
57
|
+
@connectivity-explorer-clicked="onConnectivityExplorerClicked"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
60
|
+
<template v-else>
|
|
58
61
|
<SidebarContent
|
|
59
62
|
class="sidebar-content-container"
|
|
60
63
|
v-show="tab.id === activeTabId"
|
|
61
64
|
:contextCardEntry="tab.contextCard"
|
|
62
65
|
:envVars="envVars"
|
|
63
|
-
:ref="'
|
|
66
|
+
:ref="'datasetExplorerTab_' + tab.id"
|
|
64
67
|
@search-changed="searchChanged(tab.id, $event)"
|
|
65
68
|
@hover-changed="hoverChanged($event)"
|
|
66
69
|
/>
|
|
@@ -83,7 +86,7 @@ import SidebarContent from './SidebarContent.vue'
|
|
|
83
86
|
import EventBus from './EventBus.js'
|
|
84
87
|
import Tabs from './Tabs.vue'
|
|
85
88
|
import AnnotationTool from './AnnotationTool.vue'
|
|
86
|
-
import
|
|
89
|
+
import ConnectivityExplorer from './ConnectivityExplorer.vue'
|
|
87
90
|
|
|
88
91
|
/**
|
|
89
92
|
* Aims to provide a sidebar for searching capability for SPARC portal.
|
|
@@ -96,11 +99,19 @@ export default {
|
|
|
96
99
|
ElIconArrowRight,
|
|
97
100
|
Drawer,
|
|
98
101
|
Icon,
|
|
99
|
-
ConnectivityInfo,
|
|
100
102
|
AnnotationTool,
|
|
103
|
+
ConnectivityExplorer,
|
|
101
104
|
},
|
|
102
105
|
name: 'SideBar',
|
|
103
106
|
props: {
|
|
107
|
+
tabs: {
|
|
108
|
+
type: Array,
|
|
109
|
+
default: [
|
|
110
|
+
{ title: 'Dataset Explorer', id: 1, type: 'datasetExplorer', closable: false },
|
|
111
|
+
{ title: 'Connectivity Explorer', id: 2, type: 'connectivityExplorer', closable: false },
|
|
112
|
+
{ title: 'Annotation', id: 3, type: 'annotation', closable: true },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
104
115
|
/**
|
|
105
116
|
* The option to show side bar.
|
|
106
117
|
*/
|
|
@@ -118,24 +129,6 @@ export default {
|
|
|
118
129
|
type: Object,
|
|
119
130
|
default: () => {},
|
|
120
131
|
},
|
|
121
|
-
/**
|
|
122
|
-
* The array of objects to show multiple sidebar contents.
|
|
123
|
-
*/
|
|
124
|
-
tabs: {
|
|
125
|
-
type: Array,
|
|
126
|
-
default: () => [
|
|
127
|
-
{ id: 1, title: 'Search', type: 'search' },
|
|
128
|
-
{ id: 2, title: 'Connectivity', type: 'connectivity' },
|
|
129
|
-
{ id: 3, title: 'Annotation', type: 'annotation' }
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
/**
|
|
133
|
-
* The active tab id for default tab.
|
|
134
|
-
*/
|
|
135
|
-
activeTabId: {
|
|
136
|
-
type: Number,
|
|
137
|
-
default: 1,
|
|
138
|
-
},
|
|
139
132
|
/**
|
|
140
133
|
* The option to show or hide sidebar on page load.
|
|
141
134
|
*/
|
|
@@ -146,16 +139,16 @@ export default {
|
|
|
146
139
|
/**
|
|
147
140
|
* The connectivity info data to show in sidebar.
|
|
148
141
|
*/
|
|
149
|
-
|
|
150
|
-
type:
|
|
151
|
-
default:
|
|
142
|
+
connectivityEntry: {
|
|
143
|
+
type: Array,
|
|
144
|
+
default: [],
|
|
152
145
|
},
|
|
153
146
|
/**
|
|
154
147
|
* The annotation data to show in sidebar.
|
|
155
148
|
*/
|
|
156
149
|
annotationEntry: {
|
|
157
|
-
type:
|
|
158
|
-
default:
|
|
150
|
+
type: Array,
|
|
151
|
+
default: [],
|
|
159
152
|
},
|
|
160
153
|
createData: {
|
|
161
154
|
type: Object,
|
|
@@ -166,15 +159,23 @@ export default {
|
|
|
166
159
|
x: 0,
|
|
167
160
|
y: 0,
|
|
168
161
|
},
|
|
169
|
-
}
|
|
162
|
+
},
|
|
163
|
+
connectivityKnowledge: {
|
|
164
|
+
type: Array,
|
|
165
|
+
default: [],
|
|
166
|
+
},
|
|
170
167
|
},
|
|
171
168
|
data: function () {
|
|
172
169
|
return {
|
|
173
170
|
drawerOpen: false,
|
|
174
|
-
availableAnatomyFacets: []
|
|
171
|
+
availableAnatomyFacets: [],
|
|
172
|
+
activeTabId: 1,
|
|
175
173
|
}
|
|
176
174
|
},
|
|
177
175
|
methods: {
|
|
176
|
+
onConnectivityExplorerClicked: function (data) {
|
|
177
|
+
this.$emit('connectivity-explorer-clicked', data)
|
|
178
|
+
},
|
|
178
179
|
/**
|
|
179
180
|
* This event is emitted when the mouse hover are changed.
|
|
180
181
|
* @arg data
|
|
@@ -197,11 +198,11 @@ export default {
|
|
|
197
198
|
this.$emit('show-reference-connectivities', refSource);
|
|
198
199
|
},
|
|
199
200
|
/**
|
|
200
|
-
* This function is triggered after
|
|
201
|
+
* This function is triggered after connectivity term is hovered.
|
|
201
202
|
* @arg data
|
|
202
203
|
*/
|
|
203
|
-
|
|
204
|
-
this.$emit('connectivity-
|
|
204
|
+
onConnectivityHovered: function (data) {
|
|
205
|
+
this.$emit('connectivity-hovered', data);
|
|
205
206
|
},
|
|
206
207
|
/**
|
|
207
208
|
* This event is emitted when the search filters are changed.
|
|
@@ -224,43 +225,34 @@ export default {
|
|
|
224
225
|
toggleDrawer: function () {
|
|
225
226
|
this.drawerOpen = !this.drawerOpen
|
|
226
227
|
},
|
|
228
|
+
openConnectivitySearch: function (facets, query) {
|
|
229
|
+
this.drawerOpen = true;
|
|
230
|
+
// Because refs are in v-for, nextTick is needed here
|
|
231
|
+
this.$nextTick(() => {
|
|
232
|
+
const connectivityExplorerTabRef = this.getTabRef(undefined, 'connectivityExplorer', true);
|
|
233
|
+
connectivityExplorerTabRef.openSearch(facets, query);
|
|
234
|
+
})
|
|
235
|
+
},
|
|
227
236
|
openSearch: function (facets, query) {
|
|
228
237
|
this.drawerOpen = true
|
|
229
238
|
// Because refs are in v-for, nextTick is needed here
|
|
230
239
|
this.$nextTick(() => {
|
|
231
|
-
const
|
|
232
|
-
|
|
240
|
+
const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer', true);
|
|
241
|
+
datasetExplorerTabRef.openSearch(facets, query);
|
|
233
242
|
})
|
|
234
243
|
},
|
|
235
|
-
/**
|
|
236
|
-
* Get the tab object by tab id and type.
|
|
237
|
-
* If not found, return the first available tab.
|
|
238
|
-
*/
|
|
239
|
-
getTabByIdAndType: function (id, type) {
|
|
240
|
-
const tabId = id || this.activeTabId;
|
|
241
|
-
const tabType = type || 'search'; // default to search tab
|
|
242
|
-
const tabObj = this.activeTabs.find((tab) => tab.id === tabId && tab.type === tabType);
|
|
243
|
-
const firstAvailableTab = this.activeTabs[0];
|
|
244
|
-
return tabObj || firstAvailableTab;
|
|
245
|
-
},
|
|
246
244
|
/**
|
|
247
245
|
* Get the ref id of the tab by id and type.
|
|
248
246
|
*/
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
return tabRefId;
|
|
259
|
-
},
|
|
260
|
-
getSearchTabRefById: function (id) {
|
|
261
|
-
const searchTabId = id || 1; // to use id when there are multiple search tabs
|
|
262
|
-
const searchTabRefId = this.getTabRefId(searchTabId, 'search');
|
|
263
|
-
return this.$refs[searchTabRefId][0];
|
|
247
|
+
getTabRef: function (id, type, switchTab = false) {
|
|
248
|
+
const matchedTab = this.tabEntries.filter((tabEntry) => {
|
|
249
|
+
return (id === undefined || tabEntry.id === id) &&
|
|
250
|
+
(type === undefined || tabEntry.type === type);
|
|
251
|
+
});
|
|
252
|
+
const tabInfo = matchedTab.length ? matchedTab : this.tabEntries;
|
|
253
|
+
const tabRef = tabInfo[0].type + 'Tab_' + tabInfo[0].id;
|
|
254
|
+
if (switchTab) this.setActiveTab({ id: tabInfo[0].id, type: tabInfo[0].type });
|
|
255
|
+
return this.$refs[tabRef][0];
|
|
264
256
|
},
|
|
265
257
|
/**
|
|
266
258
|
* The function to add filters to sidebar search.
|
|
@@ -274,16 +266,16 @@ export default {
|
|
|
274
266
|
|
|
275
267
|
// Because refs are in v-for, nextTick is needed here
|
|
276
268
|
this.$nextTick(() => {
|
|
277
|
-
const
|
|
278
|
-
|
|
269
|
+
const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer', true);
|
|
270
|
+
datasetExplorerTabRef.addFilter(filter)
|
|
279
271
|
})
|
|
280
272
|
},
|
|
281
273
|
openNeuronSearch: function (neuron) {
|
|
282
274
|
this.drawerOpen = true
|
|
283
275
|
// Because refs are in v-for, nextTick is needed here
|
|
284
276
|
this.$nextTick(() => {
|
|
285
|
-
const
|
|
286
|
-
|
|
277
|
+
const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer', true);
|
|
278
|
+
datasetExplorerTabRef.openSearch(
|
|
287
279
|
'',
|
|
288
280
|
undefined,
|
|
289
281
|
'scicrunch-query-string/',
|
|
@@ -292,27 +284,25 @@ export default {
|
|
|
292
284
|
})
|
|
293
285
|
},
|
|
294
286
|
getAlgoliaFacets: async function () {
|
|
295
|
-
const
|
|
296
|
-
return await
|
|
287
|
+
const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer');
|
|
288
|
+
return await datasetExplorerTabRef.getAlgoliaFacets()
|
|
297
289
|
},
|
|
298
290
|
setDrawerOpen: function (value = true) {
|
|
299
291
|
this.drawerOpen = value
|
|
300
292
|
},
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
*/
|
|
312
|
-
this.$emit('tabClicked', {id, type});
|
|
293
|
+
setActiveTab: function (tab) {
|
|
294
|
+
const matchedTab = this.tabs.filter((tabEntry) => {
|
|
295
|
+
return tabEntry.id === tab.id && tabEntry.type === tab.type;
|
|
296
|
+
});
|
|
297
|
+
const tabInfo = matchedTab.length ? matchedTab : this.tabEntries;
|
|
298
|
+
this.activeTabId = tabInfo[0].id;
|
|
299
|
+
},
|
|
300
|
+
tabClicked: function (tab) {
|
|
301
|
+
this.setActiveTab(tab);
|
|
302
|
+
this.$emit('tabClicked', tab);
|
|
313
303
|
},
|
|
314
|
-
|
|
315
|
-
this.$emit('
|
|
304
|
+
tabClosed: function (tab) {
|
|
305
|
+
this.$emit('tabClosed', tab);
|
|
316
306
|
},
|
|
317
307
|
/**
|
|
318
308
|
* To receive error message for connectivity graph
|
|
@@ -321,25 +311,25 @@ export default {
|
|
|
321
311
|
updateConnectivityGraphError: function (errorInfo) {
|
|
322
312
|
EventBus.emit('connectivity-graph-error', errorInfo);
|
|
323
313
|
},
|
|
314
|
+
/**
|
|
315
|
+
* Store available anatomy facets data for connectivity list component
|
|
316
|
+
*/
|
|
317
|
+
storeAvailableAnatomyFacets: function (availableAnatomyFacets) {
|
|
318
|
+
localStorage.setItem('available-anatomy-facets', JSON.stringify(availableAnatomyFacets))
|
|
319
|
+
},
|
|
324
320
|
},
|
|
325
321
|
computed: {
|
|
326
322
|
// This should respect the information provided by the property
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (this.annotationEntry && Object.keys(this.annotationEntry).length > 0) {
|
|
338
|
-
tabs.push(tab);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
})
|
|
342
|
-
return tabs;
|
|
323
|
+
tabEntries: function () {
|
|
324
|
+
return this.tabs.filter((tab) =>
|
|
325
|
+
tab.type === "datasetExplorer" ||
|
|
326
|
+
tab.type === "connectivityExplorer" ||
|
|
327
|
+
(
|
|
328
|
+
tab.type === "annotation" &&
|
|
329
|
+
this.annotationEntry &&
|
|
330
|
+
this.annotationEntry.length > 0
|
|
331
|
+
)
|
|
332
|
+
);
|
|
343
333
|
},
|
|
344
334
|
},
|
|
345
335
|
created: function () {
|
|
@@ -387,15 +377,18 @@ export default {
|
|
|
387
377
|
})
|
|
388
378
|
EventBus.on('onConnectivityActionClick', (payLoad) => {
|
|
389
379
|
// switch to search tab with tab id: 1
|
|
390
|
-
this.tabClicked({id: 1, type: '
|
|
380
|
+
this.tabClicked({id: 1, type: 'datasetExplorer'});
|
|
391
381
|
this.$emit('actionClick', payLoad);
|
|
392
382
|
})
|
|
383
|
+
EventBus.on('connectivity-source-change', (payLoad) => {
|
|
384
|
+
this.$emit('connectivity-source-change', payLoad);
|
|
385
|
+
})
|
|
393
386
|
|
|
394
387
|
// Get available anatomy facets for the connectivity info
|
|
395
388
|
EventBus.on('available-facets', (payLoad) => {
|
|
396
389
|
this.availableAnatomyFacets = payLoad.find((facet) => facet.label === 'Anatomical Structure').children
|
|
390
|
+
this.storeAvailableAnatomyFacets(this.availableAnatomyFacets);
|
|
397
391
|
})
|
|
398
|
-
|
|
399
392
|
},
|
|
400
393
|
}
|
|
401
394
|
</script>
|
|
@@ -18,6 +18,14 @@
|
|
|
18
18
|
>
|
|
19
19
|
Search
|
|
20
20
|
</el-button>
|
|
21
|
+
<el-button
|
|
22
|
+
link
|
|
23
|
+
class="el-button-link"
|
|
24
|
+
@click="openSearch([], '')"
|
|
25
|
+
size="large"
|
|
26
|
+
>
|
|
27
|
+
Reset
|
|
28
|
+
</el-button>
|
|
21
29
|
</div>
|
|
22
30
|
</template>
|
|
23
31
|
<SearchFilters
|
|
@@ -32,6 +40,7 @@
|
|
|
32
40
|
></SearchFilters>
|
|
33
41
|
<SearchHistory
|
|
34
42
|
ref="searchHistory"
|
|
43
|
+
localStorageKey="sparc.science-dataset-search-history"
|
|
35
44
|
@search="searchHistorySearch"
|
|
36
45
|
></SearchHistory>
|
|
37
46
|
<div class="content scrollbar" v-loading="loadingCards" ref="content">
|
|
@@ -159,12 +168,14 @@ export default {
|
|
|
159
168
|
return {
|
|
160
169
|
numberOfHits: this.numberOfHits,
|
|
161
170
|
filterFacets: this.filter,
|
|
171
|
+
showFilters: true
|
|
162
172
|
}
|
|
163
173
|
},
|
|
164
174
|
},
|
|
165
175
|
methods: {
|
|
166
176
|
hoverChanged: function (data) {
|
|
167
|
-
|
|
177
|
+
const payload = data ? { ...data, type: 'dataset' } : data
|
|
178
|
+
this.$emit('hover-changed', payload)
|
|
168
179
|
},
|
|
169
180
|
resetSearch: function () {
|
|
170
181
|
this.numberOfHits = 0
|
|
@@ -489,6 +500,8 @@ export default {
|
|
|
489
500
|
</script>
|
|
490
501
|
|
|
491
502
|
<style lang="scss" scoped>
|
|
503
|
+
@import '../assets/pagination.scss';
|
|
504
|
+
|
|
492
505
|
.dataset-card {
|
|
493
506
|
position: relative;
|
|
494
507
|
|
|
@@ -550,23 +563,6 @@ export default {
|
|
|
550
563
|
}
|
|
551
564
|
}
|
|
552
565
|
|
|
553
|
-
.pagination {
|
|
554
|
-
padding-bottom: 16px;
|
|
555
|
-
background-color: white;
|
|
556
|
-
padding-left: 95px;
|
|
557
|
-
font-weight: bold;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
.pagination :deep(button) {
|
|
561
|
-
background-color: white !important;
|
|
562
|
-
}
|
|
563
|
-
.pagination :deep(li) {
|
|
564
|
-
background-color: white !important;
|
|
565
|
-
}
|
|
566
|
-
.pagination :deep(li.is-active) {
|
|
567
|
-
color: $app-primary-color;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
566
|
.error-feedback {
|
|
571
567
|
font-family: Asap;
|
|
572
568
|
font-size: 14px;
|
|
@@ -636,4 +632,14 @@ export default {
|
|
|
636
632
|
background: rgba(0, 0, 0, 0);
|
|
637
633
|
box-shadow: none;
|
|
638
634
|
}
|
|
635
|
+
|
|
636
|
+
.el-button-link {
|
|
637
|
+
color: white !important;
|
|
638
|
+
text-decoration: underline;
|
|
639
|
+
text-underline-offset: 2px;
|
|
640
|
+
|
|
641
|
+
&:hover {
|
|
642
|
+
text-decoration-color: transparent;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
639
645
|
</style>
|
package/src/components/Tabs.vue
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="tabs-container">
|
|
3
3
|
<div
|
|
4
|
-
class="
|
|
5
|
-
v-for="
|
|
6
|
-
:key="
|
|
7
|
-
:class="{ 'active-tab':
|
|
4
|
+
class="tab"
|
|
5
|
+
v-for="tab in tabs"
|
|
6
|
+
:key="tab.id"
|
|
7
|
+
:class="{ 'active-tab': tab.id == activeId }"
|
|
8
|
+
@click="tabClicked(tab)"
|
|
8
9
|
>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
v-
|
|
12
|
-
|
|
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"
|
|
13
15
|
>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
<el-button
|
|
19
|
-
v-if="title.id > 1"
|
|
20
|
-
@click="tabClose(title.id)"
|
|
21
|
-
class="button-tab-close"
|
|
22
|
-
aria-label="Close"
|
|
23
|
-
>
|
|
24
|
-
×
|
|
25
|
-
<span class="visually-hidden">Close</span>
|
|
26
|
-
</el-button>
|
|
16
|
+
<el-icon-close />
|
|
17
|
+
</el-icon>
|
|
27
18
|
</div>
|
|
28
19
|
</div>
|
|
29
20
|
</template>
|
|
30
21
|
|
|
31
22
|
<script>
|
|
32
23
|
/* eslint-disable no-alert, no-console */
|
|
24
|
+
import { Close as ElIconClose } from "@element-plus/icons-vue";
|
|
33
25
|
|
|
34
26
|
export default {
|
|
35
|
-
name:
|
|
27
|
+
name: "Tabs",
|
|
28
|
+
components: {
|
|
29
|
+
ElIconClose,
|
|
30
|
+
},
|
|
36
31
|
props: {
|
|
37
|
-
|
|
32
|
+
tabEntries: {
|
|
38
33
|
type: Array,
|
|
39
34
|
default: () => [],
|
|
40
35
|
},
|
|
@@ -42,106 +37,72 @@ export default {
|
|
|
42
37
|
type: Number,
|
|
43
38
|
default: 1,
|
|
44
39
|
},
|
|
40
|
+
contextArray: {
|
|
41
|
+
type: Array,
|
|
42
|
+
default: () => [],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
tabs: function () {
|
|
47
|
+
// permanent tabs always show in the front
|
|
48
|
+
const permanent = this.tabEntries.filter((t) => !t.closable);
|
|
49
|
+
const temporary = this.tabEntries.filter((t) => t.closable);
|
|
50
|
+
let entries = permanent.concat(temporary);
|
|
51
|
+
if (this.contextArray.length) {
|
|
52
|
+
for (let i in entries) {
|
|
53
|
+
entries[i].contextCard = this.contextArray[i];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return entries;
|
|
57
|
+
},
|
|
45
58
|
},
|
|
46
59
|
methods: {
|
|
47
|
-
|
|
48
|
-
this.$emit(
|
|
60
|
+
tabClicked: function (tab) {
|
|
61
|
+
this.$emit("tabClicked", { id: tab.id, type: tab.type });
|
|
49
62
|
},
|
|
50
|
-
|
|
51
|
-
this.$emit(
|
|
63
|
+
tabClosed: function (tab) {
|
|
64
|
+
this.$emit("tabClosed", { id: tab.id, type: tab.type });
|
|
52
65
|
},
|
|
53
66
|
},
|
|
54
|
-
}
|
|
67
|
+
};
|
|
55
68
|
</script>
|
|
56
69
|
|
|
57
70
|
<style lang="scss" scoped>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.tab-container {
|
|
61
|
-
height: $tab-height + 2;
|
|
71
|
+
.tabs-container {
|
|
62
72
|
display: flex;
|
|
63
|
-
flex-
|
|
64
|
-
|
|
65
|
-
z-index: 1;
|
|
73
|
+
flex-wrap: nowrap;
|
|
74
|
+
align-items: center;
|
|
66
75
|
}
|
|
67
76
|
|
|
68
|
-
.
|
|
69
|
-
height:
|
|
77
|
+
.tab {
|
|
78
|
+
height: 30px;
|
|
70
79
|
border: 1px solid var(--el-border-color);
|
|
71
80
|
border-top-color: transparent;
|
|
72
|
-
|
|
81
|
+
border-bottom-color: transparent;
|
|
73
82
|
display: flex;
|
|
74
|
-
width: fit-content;
|
|
75
83
|
align-items: center;
|
|
76
|
-
position: relative;
|
|
77
84
|
cursor: pointer;
|
|
78
85
|
}
|
|
79
86
|
|
|
80
|
-
.
|
|
81
|
-
text-align: center;
|
|
82
|
-
display: table-cell;
|
|
83
|
-
vertical-align: middle;
|
|
84
|
-
font-size: 14px;
|
|
85
|
-
padding: 0 1rem;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.title-text-table {
|
|
89
|
-
display: table;
|
|
90
|
-
height: 100%;
|
|
91
|
-
width: 100%;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.parent-dialog:hover .title-text {
|
|
95
|
-
color: $app-primary-color;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.title:hover,
|
|
87
|
+
.tab:hover,
|
|
99
88
|
.active-tab {
|
|
100
89
|
background-color: #f9f2fc;
|
|
101
|
-
border: solid #8300bf;
|
|
102
|
-
border-width: 1px 1px .125em;
|
|
90
|
+
border: 1px solid #8300bf;
|
|
103
91
|
color: #8300bf;
|
|
104
92
|
font-weight: 500;
|
|
105
93
|
}
|
|
106
94
|
|
|
107
|
-
.
|
|
108
|
-
|
|
95
|
+
.tab-title {
|
|
96
|
+
text-align: center;
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
padding: 0 1rem;
|
|
109
99
|
}
|
|
110
100
|
|
|
111
|
-
.
|
|
101
|
+
.tab-close-icon {
|
|
112
102
|
width: 20px !important;
|
|
113
103
|
height: 20px !important;
|
|
114
|
-
|
|
115
|
-
padding: 0 !important;
|
|
104
|
+
font-size: 20px !important;
|
|
116
105
|
padding-right: 4px !important;
|
|
117
|
-
font-size: 24px !important;
|
|
118
106
|
color: $app-primary-color !important;
|
|
119
|
-
border: 0 none !important;
|
|
120
|
-
box-shadow: none !important;
|
|
121
|
-
outline: none !important;
|
|
122
|
-
background-color: transparent !important;
|
|
123
|
-
|
|
124
|
-
:deep(> span) {
|
|
125
|
-
height: $tab-height - 2 !important; // tab height minus border
|
|
126
|
-
font-family: Arial !important; // to fix font alignment on different browsers
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
&:hover,
|
|
130
|
-
&:focus {
|
|
131
|
-
border: 0 none !important;
|
|
132
|
-
outline: none !important;
|
|
133
|
-
box-shadow: none !important;
|
|
134
|
-
background-color: transparent !important;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.visually-hidden {
|
|
139
|
-
clip: rect(0 0 0 0);
|
|
140
|
-
clip-path: inset(50%);
|
|
141
|
-
height: 1px;
|
|
142
|
-
overflow: hidden;
|
|
143
|
-
position: absolute;
|
|
144
|
-
white-space: nowrap;
|
|
145
|
-
width: 1px;
|
|
146
107
|
}
|
|
147
108
|
</style>
|
package/src/components.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ declare module 'vue' {
|
|
|
9
9
|
export interface GlobalComponents {
|
|
10
10
|
AnnotationTool: typeof import('./components/AnnotationTool.vue')['default']
|
|
11
11
|
BadgesGroup: typeof import('./components/BadgesGroup.vue')['default']
|
|
12
|
+
ConnectivityCard: typeof import('./components/ConnectivityCard.vue')['default']
|
|
13
|
+
ConnectivityExplorer: typeof import('./components/ConnectivityExplorer.vue')['default']
|
|
12
14
|
ConnectivityInfo: typeof import('./components/ConnectivityInfo.vue')['default']
|
|
13
15
|
DatasetCard: typeof import('./components/DatasetCard.vue')['default']
|
|
14
16
|
ElButton: typeof import('element-plus/es')['ElButton']
|
|
@@ -23,6 +25,7 @@ declare module 'vue' {
|
|
|
23
25
|
ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
|
|
24
26
|
ElIconArrowLeft: typeof import('@element-plus/icons-vue')['ArrowLeft']
|
|
25
27
|
ElIconArrowRight: typeof import('@element-plus/icons-vue')['ArrowRight']
|
|
28
|
+
ElIconClose: typeof import('@element-plus/icons-vue')['Close']
|
|
26
29
|
ElIconDelete: typeof import('@element-plus/icons-vue')['Delete']
|
|
27
30
|
ElIconLocation: typeof import('@element-plus/icons-vue')['Location']
|
|
28
31
|
ElIconWarning: typeof import('@element-plus/icons-vue')['Warning']
|
|
@@ -31,6 +34,8 @@ declare module 'vue' {
|
|
|
31
34
|
ElOption: typeof import('element-plus/es')['ElOption']
|
|
32
35
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
|
33
36
|
ElPopover: typeof import('element-plus/es')['ElPopover']
|
|
37
|
+
ElRadio: typeof import('element-plus/es')['ElRadio']
|
|
38
|
+
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
|
34
39
|
ElRow: typeof import('element-plus/es')['ElRow']
|
|
35
40
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
|
36
41
|
ElTag: typeof import('element-plus/es')['ElTag']
|