@abi-software/map-side-bar 1.3.35 → 1.3.37

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 (37) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +146 -146
  3. package/babel.config.js +14 -14
  4. package/dist/map-side-bar.common.js +306 -231
  5. package/dist/map-side-bar.common.js.map +1 -1
  6. package/dist/map-side-bar.css +1 -1
  7. package/dist/map-side-bar.umd.js +306 -231
  8. package/dist/map-side-bar.umd.js.map +1 -1
  9. package/dist/map-side-bar.umd.min.js +1 -1
  10. package/dist/map-side-bar.umd.min.js.map +1 -1
  11. package/package-lock.json +13716 -13716
  12. package/package.json +67 -67
  13. package/public/index.html +17 -17
  14. package/src/App.vue +155 -152
  15. package/src/algolia/algolia.js +182 -182
  16. package/src/algolia/utils.js +69 -69
  17. package/src/components/BadgesGroup.vue +142 -142
  18. package/src/components/Cascader.vue +49 -49
  19. package/src/components/ContextCard.vue +391 -381
  20. package/src/components/DatasetCard.vue +325 -325
  21. package/src/components/EventBus.js +3 -3
  22. package/src/components/ImageGallery.vue +525 -515
  23. package/src/components/SearchFilters.vue +585 -586
  24. package/src/components/SideBar.vue +224 -224
  25. package/src/components/SidebarContent.vue +508 -508
  26. package/src/components/Tabs.vue +78 -78
  27. package/src/components/hardcoded-context-info.js +79 -79
  28. package/src/components/index.js +8 -8
  29. package/src/components/species-map.js +8 -8
  30. package/src/main.js +8 -8
  31. package/src/mixins/S3Bucket.vue +31 -0
  32. package/static.json +6 -6
  33. package/vue.config.js +11 -11
  34. package/del.json +0 -27
  35. package/delte.json +0 -30
  36. package/scaffold_context_info.json +0 -31
  37. package/src/components/processFilters.js +0 -22
@@ -1,224 +1,224 @@
1
- <template>
2
- <div ref="container">
3
- <div v-if="!drawerOpen" @click="toggleDrawer" class="open-tab">
4
- <i class="el-icon-arrow-left"></i>
5
- </div>
6
- <el-drawer
7
- custom-class="my-drawer"
8
- class="side-bar"
9
- :visible.sync="drawerOpen"
10
- :appendToBody="false"
11
- :modal-append-to-body="false"
12
- size=550
13
- :with-header="false"
14
- :wrapperClosable="false"
15
- :modal="false"
16
- >
17
- <div class="box-card">
18
- <div v-if="drawerOpen" @click="close" class="close-tab">
19
- <i class="el-icon-arrow-right"></i>
20
- </div>
21
- <div class="sidebar-container">
22
- <tabs v-if="tabs.length > 1" :tabTitles="tabs" :activeId="activeId"
23
- @titleClicked="tabClicked"/>
24
- <template v-for="tab in tabs">
25
- <sidebar-content class="sidebar-content-container"
26
- v-show="tab.id===activeId" :contextCardEntry="tab.contextCard"
27
- :envVars="envVars"
28
- v-bind:key="tab.id" :ref="tab.id"
29
- @search-changed="searchChanged(tab.id, $event)"/>
30
- </template>
31
- </div>
32
- </div>
33
- </el-drawer>
34
- </div>
35
- </template>
36
-
37
-
38
- <script>
39
- /* eslint-disable no-alert, no-console */
40
- import Vue from "vue";
41
- import {
42
- Drawer,
43
- Icon,
44
- } from "element-ui";
45
- import lang from "element-ui/lib/locale/lang/en";
46
- import locale from "element-ui/lib/locale";
47
- import SidebarContent from './SidebarContent.vue';
48
- import EventBus from './EventBus';
49
- import Tabs from './Tabs'
50
-
51
- locale.use(lang);
52
- Vue.use(Drawer);
53
- Vue.use(Icon);
54
-
55
- export default {
56
- components: {SidebarContent, Tabs },
57
- name: "SideBar",
58
- props: {
59
- visible: {
60
- type: Boolean,
61
- default: false
62
- },
63
- envVars: {
64
- type: Object,
65
- default: () => {}
66
- },
67
- tabs: {
68
- type: Array,
69
- default: () => [{title:'flatmap', id:1}]
70
- },
71
- activeId: {
72
- type: Number,
73
- default: 1
74
- },
75
- openAtStart: {
76
- type: Boolean,
77
- default: false
78
- }
79
- },
80
- data: function () {
81
- return {
82
- drawerOpen: false,
83
- }
84
- },
85
- methods: {
86
- searchChanged: function (id, data) {
87
- this.$emit("search-changed", {...data, id: id});
88
- },
89
- close: function () {
90
- this.drawerOpen = false;
91
- },
92
- toggleDrawer: function () {
93
- this.drawerOpen = !this.drawerOpen;
94
- },
95
- openSearch: function(facets, query){
96
- this.drawerOpen = true;
97
- // Because refs are in v-for, nextTick is needed here
98
- Vue.nextTick(()=>{this.$refs[this.activeId][0].openSearch(facets, query)})
99
- },
100
- addFilter: function(filter){
101
- this.drawerOpen = true;
102
- filter.AND = true // When we add a filter external, it is currently only with an AND boolean
103
-
104
- // Because refs are in v-for, nextTick is needed here
105
- Vue.nextTick(()=>{this.$refs[this.activeId][0].addFilter(filter)})
106
- },
107
- openNeuronSearch: function(neuron){
108
- this.drawerOpen = true;
109
- // Because refs are in v-for, nextTick is needed here
110
- Vue.nextTick(()=>{this.$refs[this.activeId][0].openSearch('', undefined, 'scicrunch-query-string/', {'field': '*organ.curie', 'curie':neuron})})
111
- },
112
- tabClicked: function(id) {
113
- this.$emit("tabClicked", id);
114
- },
115
- },
116
- created:function() {
117
- this.drawerOpen = this.openAtStart;
118
- },
119
- mounted: function(){
120
- EventBus.$on("PopoverActionClick", (payLoad) => {
121
- this.$emit("actionClick", payLoad);
122
- })
123
- EventBus.$on('anatomyFound', (payLoad)=> {
124
- this.$emit('search-changed', {
125
- type: 'keyword-update',
126
- value: payLoad
127
- })
128
- })
129
- }
130
- };
131
- </script>
132
-
133
- <!-- Add "scoped" attribute to limit CSS to this component only -->
134
- <style scoped>
135
-
136
- .box-card {
137
- flex: 3;
138
- height: 100%;
139
- overflow: hidden;
140
- pointer-events: auto;
141
- }
142
-
143
- .side-bar{
144
- position: relative;
145
- height: 100%;
146
- pointer-events: none;
147
- }
148
-
149
- .side-bar >>> .el-drawer:focus{
150
- outline:none;
151
- }
152
-
153
- .sidebar-container {
154
- height: 100%;
155
- flex-flow: column;
156
- display: flex;
157
- }
158
-
159
- .open-tab{
160
- width: 20px;
161
- height: 40px;
162
- z-index: 8;
163
- position: absolute;
164
- top: calc(50vh - 80px);
165
- right: 0px;
166
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
167
- border: solid 1px #8300BF;
168
- background-color: #f9f2fc;
169
- text-align: center;
170
- vertical-align: middle;
171
- cursor: pointer;
172
- pointer-events: auto;
173
- }
174
-
175
- .el-icon-arrow-left,
176
- .el-icon-arrow-right
177
- {
178
- font-weight: 600;
179
- margin-top: 12px;
180
- color: #8300BF;
181
- cursor: pointer;
182
- pointer-events: auto;
183
- transform: scaleY(2.0);
184
- text-align: center;
185
- vertical-align: middle;
186
- }
187
-
188
- .close-tab{
189
- float: left;
190
- flex: 1;
191
- width: 20px;
192
- height: 40px;
193
- z-index: 8;
194
- margin-top: calc(50vh - 80px);
195
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
196
- border: solid 1px #8300BF;
197
- background-color: #f9f2fc;
198
- text-align: center;
199
- vertical-align: middle;
200
- cursor: pointer;
201
- pointer-events: auto;
202
- }
203
-
204
- .box-card {
205
- flex: 3;
206
- height: 100%;
207
- overflow: hidden;
208
- pointer-events: auto;
209
- }
210
-
211
- >>> .my-drawer {
212
- background: rgba(0,0,0,0);
213
- box-shadow: none;
214
- }
215
-
216
- >>> .my-drawer .el-drawer__body {
217
- height: 100%;
218
- }
219
-
220
- .sidebar-content-container {
221
- flex: 1 1 auto;
222
- }
223
-
224
- </style>
1
+ <template>
2
+ <div ref="container">
3
+ <div v-if="!drawerOpen" @click="toggleDrawer" class="open-tab">
4
+ <i class="el-icon-arrow-left"></i>
5
+ </div>
6
+ <el-drawer
7
+ custom-class="my-drawer"
8
+ class="side-bar"
9
+ :visible.sync="drawerOpen"
10
+ :appendToBody="false"
11
+ :modal-append-to-body="false"
12
+ size=550
13
+ :with-header="false"
14
+ :wrapperClosable="false"
15
+ :modal="false"
16
+ >
17
+ <div class="box-card">
18
+ <div v-if="drawerOpen" @click="close" class="close-tab">
19
+ <i class="el-icon-arrow-right"></i>
20
+ </div>
21
+ <div class="sidebar-container">
22
+ <tabs v-if="tabs.length > 1" :tabTitles="tabs" :activeId="activeId"
23
+ @titleClicked="tabClicked"/>
24
+ <template v-for="tab in tabs">
25
+ <sidebar-content class="sidebar-content-container"
26
+ v-show="tab.id===activeId" :contextCardEntry="tab.contextCard"
27
+ :envVars="envVars"
28
+ v-bind:key="tab.id" :ref="tab.id"
29
+ @search-changed="searchChanged(tab.id, $event)"/>
30
+ </template>
31
+ </div>
32
+ </div>
33
+ </el-drawer>
34
+ </div>
35
+ </template>
36
+
37
+
38
+ <script>
39
+ /* eslint-disable no-alert, no-console */
40
+ import Vue from "vue";
41
+ import {
42
+ Drawer,
43
+ Icon,
44
+ } from "element-ui";
45
+ import lang from "element-ui/lib/locale/lang/en";
46
+ import locale from "element-ui/lib/locale";
47
+ import SidebarContent from './SidebarContent.vue';
48
+ import EventBus from './EventBus';
49
+ import Tabs from './Tabs'
50
+
51
+ locale.use(lang);
52
+ Vue.use(Drawer);
53
+ Vue.use(Icon);
54
+
55
+ export default {
56
+ components: {SidebarContent, Tabs },
57
+ name: "SideBar",
58
+ props: {
59
+ visible: {
60
+ type: Boolean,
61
+ default: false
62
+ },
63
+ envVars: {
64
+ type: Object,
65
+ default: () => {}
66
+ },
67
+ tabs: {
68
+ type: Array,
69
+ default: () => [{title:'flatmap', id:1}]
70
+ },
71
+ activeId: {
72
+ type: Number,
73
+ default: 1
74
+ },
75
+ openAtStart: {
76
+ type: Boolean,
77
+ default: false
78
+ }
79
+ },
80
+ data: function () {
81
+ return {
82
+ drawerOpen: false,
83
+ }
84
+ },
85
+ methods: {
86
+ searchChanged: function (id, data) {
87
+ this.$emit("search-changed", {...data, id: id});
88
+ },
89
+ close: function () {
90
+ this.drawerOpen = false;
91
+ },
92
+ toggleDrawer: function () {
93
+ this.drawerOpen = !this.drawerOpen;
94
+ },
95
+ openSearch: function(facets, query){
96
+ this.drawerOpen = true;
97
+ // Because refs are in v-for, nextTick is needed here
98
+ Vue.nextTick(()=>{this.$refs[this.activeId][0].openSearch(facets, query)})
99
+ },
100
+ addFilter: function(filter){
101
+ this.drawerOpen = true;
102
+ filter.AND = true // When we add a filter external, it is currently only with an AND boolean
103
+
104
+ // Because refs are in v-for, nextTick is needed here
105
+ Vue.nextTick(()=>{this.$refs[this.activeId][0].addFilter(filter)})
106
+ },
107
+ openNeuronSearch: function(neuron){
108
+ this.drawerOpen = true;
109
+ // Because refs are in v-for, nextTick is needed here
110
+ Vue.nextTick(()=>{this.$refs[this.activeId][0].openSearch('', undefined, 'scicrunch-query-string/', {'field': '*organ.curie', 'curie':neuron})})
111
+ },
112
+ tabClicked: function(id) {
113
+ this.$emit("tabClicked", id);
114
+ },
115
+ },
116
+ created:function() {
117
+ this.drawerOpen = this.openAtStart;
118
+ },
119
+ mounted: function(){
120
+ EventBus.$on("PopoverActionClick", (payLoad) => {
121
+ this.$emit("actionClick", payLoad);
122
+ })
123
+ EventBus.$on('anatomyFound', (payLoad)=> {
124
+ this.$emit('search-changed', {
125
+ type: 'keyword-update',
126
+ value: payLoad
127
+ })
128
+ })
129
+ }
130
+ };
131
+ </script>
132
+
133
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
134
+ <style scoped>
135
+
136
+ .box-card {
137
+ flex: 3;
138
+ height: 100%;
139
+ overflow: hidden;
140
+ pointer-events: auto;
141
+ }
142
+
143
+ .side-bar{
144
+ position: relative;
145
+ height: 100%;
146
+ pointer-events: none;
147
+ }
148
+
149
+ .side-bar >>> .el-drawer:focus{
150
+ outline:none;
151
+ }
152
+
153
+ .sidebar-container {
154
+ height: 100%;
155
+ flex-flow: column;
156
+ display: flex;
157
+ }
158
+
159
+ .open-tab{
160
+ width: 20px;
161
+ height: 40px;
162
+ z-index: 8;
163
+ position: absolute;
164
+ top: calc(50vh - 80px);
165
+ right: 0px;
166
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
167
+ border: solid 1px #8300BF;
168
+ background-color: #f9f2fc;
169
+ text-align: center;
170
+ vertical-align: middle;
171
+ cursor: pointer;
172
+ pointer-events: auto;
173
+ }
174
+
175
+ .el-icon-arrow-left,
176
+ .el-icon-arrow-right
177
+ {
178
+ font-weight: 600;
179
+ margin-top: 12px;
180
+ color: #8300BF;
181
+ cursor: pointer;
182
+ pointer-events: auto;
183
+ transform: scaleY(2.0);
184
+ text-align: center;
185
+ vertical-align: middle;
186
+ }
187
+
188
+ .close-tab{
189
+ float: left;
190
+ flex: 1;
191
+ width: 20px;
192
+ height: 40px;
193
+ z-index: 8;
194
+ margin-top: calc(50vh - 80px);
195
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
196
+ border: solid 1px #8300BF;
197
+ background-color: #f9f2fc;
198
+ text-align: center;
199
+ vertical-align: middle;
200
+ cursor: pointer;
201
+ pointer-events: auto;
202
+ }
203
+
204
+ .box-card {
205
+ flex: 3;
206
+ height: 100%;
207
+ overflow: hidden;
208
+ pointer-events: auto;
209
+ }
210
+
211
+ >>> .my-drawer {
212
+ background: rgba(0,0,0,0);
213
+ box-shadow: none;
214
+ }
215
+
216
+ >>> .my-drawer .el-drawer__body {
217
+ height: 100%;
218
+ }
219
+
220
+ .sidebar-content-container {
221
+ flex: 1 1 auto;
222
+ }
223
+
224
+ </style>