@abi-software/map-side-bar 1.4.1-beta.0 → 1.4.1-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.
Files changed (40) hide show
  1. package/CHANGELOG.md +215 -209
  2. package/LICENSE +201 -201
  3. package/README.md +146 -146
  4. package/babel.config.js +14 -14
  5. package/del.json +27 -0
  6. package/delte.json +30 -0
  7. package/dist/map-side-bar.common.js +467 -423
  8. package/dist/map-side-bar.common.js.map +1 -1
  9. package/dist/map-side-bar.css +1 -1
  10. package/dist/map-side-bar.umd.js +467 -423
  11. package/dist/map-side-bar.umd.js.map +1 -1
  12. package/dist/map-side-bar.umd.min.js +2 -2
  13. package/dist/map-side-bar.umd.min.js.map +1 -1
  14. package/package-lock.json +14536 -14819
  15. package/package.json +75 -75
  16. package/public/index.html +17 -17
  17. package/scaffold_context_info.json +31 -0
  18. package/src/App.vue +160 -155
  19. package/src/algolia/algolia.js +182 -182
  20. package/src/algolia/utils.js +69 -69
  21. package/src/assets/_variables.scss +43 -43
  22. package/src/assets/styles.scss +7 -7
  23. package/src/components/BadgesGroup.vue +144 -144
  24. package/src/components/Cascader.vue +49 -49
  25. package/src/components/ContextCard.vue +397 -397
  26. package/src/components/DatasetCard.vue +328 -328
  27. package/src/components/EventBus.js +3 -3
  28. package/src/components/ImageGallery.vue +531 -531
  29. package/src/components/SearchFilters.vue +587 -587
  30. package/src/components/SideBar.vue +229 -226
  31. package/src/components/SidebarContent.vue +562 -558
  32. package/src/components/Tabs.vue +78 -78
  33. package/src/components/hardcoded-context-info.js +79 -79
  34. package/src/components/index.js +8 -8
  35. package/src/components/processFilters.js +22 -0
  36. package/src/components/species-map.js +8 -8
  37. package/src/main.js +8 -8
  38. package/src/mixins/S3Bucket.vue +31 -31
  39. package/static.json +6 -6
  40. package/vue.config.js +19 -19
@@ -1,226 +1,229 @@
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 lang="scss">
135
- @import "~element-ui/packages/theme-chalk/src/drawer";
136
- @import "~element-ui/packages/theme-chalk/src/icon";
137
-
138
- .box-card {
139
- flex: 3;
140
- height: 100%;
141
- overflow: hidden;
142
- pointer-events: auto;
143
- }
144
-
145
- .side-bar{
146
- position: relative;
147
- height: 100%;
148
- pointer-events: none;
149
- }
150
-
151
- .side-bar ::v-deep .el-drawer:focus{
152
- outline:none;
153
- }
154
-
155
- .sidebar-container {
156
- height: 100%;
157
- flex-flow: column;
158
- display: flex;
159
- }
160
-
161
- .open-tab{
162
- width: 20px;
163
- height: 40px;
164
- z-index: 8;
165
- position: absolute;
166
- top: calc(50vh - 80px);
167
- right: 0px;
168
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
169
- border: solid 1px $app-primary-color;
170
- background-color: #f9f2fc;
171
- text-align: center;
172
- vertical-align: middle;
173
- cursor: pointer;
174
- pointer-events: auto;
175
- }
176
-
177
- .el-icon-arrow-left,
178
- .el-icon-arrow-right
179
- {
180
- font-weight: 600;
181
- margin-top: 12px;
182
- color: $app-primary-color;
183
- cursor: pointer;
184
- pointer-events: auto;
185
- transform: scaleY(2.0);
186
- text-align: center;
187
- vertical-align: middle;
188
- }
189
-
190
- .close-tab{
191
- float: left;
192
- flex: 1;
193
- width: 20px;
194
- height: 40px;
195
- z-index: 8;
196
- margin-top: calc(50vh - 80px);
197
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
198
- border: solid 1px $app-primary-color;
199
- background-color: #f9f2fc;
200
- text-align: center;
201
- vertical-align: middle;
202
- cursor: pointer;
203
- pointer-events: auto;
204
- }
205
-
206
- .box-card {
207
- flex: 3;
208
- height: 100%;
209
- overflow: hidden;
210
- pointer-events: auto;
211
- }
212
-
213
- ::v-deep .my-drawer {
214
- background: rgba(0,0,0,0);
215
- box-shadow: none;
216
- }
217
-
218
- ::v-deep .my-drawer .el-drawer__body {
219
- height: 100%;
220
- }
221
-
222
- .sidebar-content-container {
223
- flex: 1 1 auto;
224
- }
225
-
226
- </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
+ getAlgoliaFacets: async function(){
113
+ return await this.$refs[this.activeId][0].getAlgoliaFacets()
114
+ },
115
+ tabClicked: function(id) {
116
+ this.$emit("tabClicked", id);
117
+ },
118
+ },
119
+ created:function() {
120
+ this.drawerOpen = this.openAtStart;
121
+ },
122
+ mounted: function(){
123
+ EventBus.$on("PopoverActionClick", (payLoad) => {
124
+ this.$emit("actionClick", payLoad);
125
+ })
126
+ EventBus.$on('anatomyFound', (payLoad)=> {
127
+ this.$emit('search-changed', {
128
+ type: 'keyword-update',
129
+ value: payLoad
130
+ })
131
+ })
132
+ }
133
+ };
134
+ </script>
135
+
136
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
137
+ <style scoped lang="scss">
138
+ @import "~element-ui/packages/theme-chalk/src/drawer";
139
+ @import "~element-ui/packages/theme-chalk/src/icon";
140
+
141
+ .box-card {
142
+ flex: 3;
143
+ height: 100%;
144
+ overflow: hidden;
145
+ pointer-events: auto;
146
+ }
147
+
148
+ .side-bar{
149
+ position: relative;
150
+ height: 100%;
151
+ pointer-events: none;
152
+ }
153
+
154
+ .side-bar ::v-deep .el-drawer:focus{
155
+ outline:none;
156
+ }
157
+
158
+ .sidebar-container {
159
+ height: 100%;
160
+ flex-flow: column;
161
+ display: flex;
162
+ }
163
+
164
+ .open-tab{
165
+ width: 20px;
166
+ height: 40px;
167
+ z-index: 8;
168
+ position: absolute;
169
+ top: calc(50vh - 80px);
170
+ right: 0px;
171
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
172
+ border: solid 1px $app-primary-color;
173
+ background-color: #f9f2fc;
174
+ text-align: center;
175
+ vertical-align: middle;
176
+ cursor: pointer;
177
+ pointer-events: auto;
178
+ }
179
+
180
+ .el-icon-arrow-left,
181
+ .el-icon-arrow-right
182
+ {
183
+ font-weight: 600;
184
+ margin-top: 12px;
185
+ color: $app-primary-color;
186
+ cursor: pointer;
187
+ pointer-events: auto;
188
+ transform: scaleY(2.0);
189
+ text-align: center;
190
+ vertical-align: middle;
191
+ }
192
+
193
+ .close-tab{
194
+ float: left;
195
+ flex: 1;
196
+ width: 20px;
197
+ height: 40px;
198
+ z-index: 8;
199
+ margin-top: calc(50vh - 80px);
200
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
201
+ border: solid 1px $app-primary-color;
202
+ background-color: #f9f2fc;
203
+ text-align: center;
204
+ vertical-align: middle;
205
+ cursor: pointer;
206
+ pointer-events: auto;
207
+ }
208
+
209
+ .box-card {
210
+ flex: 3;
211
+ height: 100%;
212
+ overflow: hidden;
213
+ pointer-events: auto;
214
+ }
215
+
216
+ ::v-deep .my-drawer {
217
+ background: rgba(0,0,0,0);
218
+ box-shadow: none;
219
+ }
220
+
221
+ ::v-deep .my-drawer .el-drawer__body {
222
+ height: 100%;
223
+ }
224
+
225
+ .sidebar-content-container {
226
+ flex: 1 1 auto;
227
+ }
228
+
229
+ </style>