@abi-software/map-side-bar 1.1.17 → 1.1.18-fixes-1

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.
@@ -1,388 +1,394 @@
1
- <template>
2
- <div class="dataset-card-container" ref="container">
3
- <div v-bind:class=" expanded ? 'dataset-card-expanded' : 'dataset-card'" ref="card">
4
- <div v-if="entry.id !== 0" class="seperator-path"></div>
5
- <div class="card" >
6
- <span class="card-left">
7
- <img svg-inline class="banner-img" :src="thumbnail" @click="openDataset"/>
8
- </span>
9
- <div class="card-right" >
10
- <div class="title" @click="cardClicked">{{entry.name}}</div>
11
- <div class="details">{{contributors}} {{entry.publishDate ? `(${publishYear})` : ''}}</div>
12
- <div class="details">{{samples}}</div>
13
- <div class="details">id: {{discoverId}}</div>
14
- <div>
15
- <el-button v-if="!entry.simulation" @click="openDataset" size="mini" class="button" icon="el-icon-coin">View dataset</el-button>
16
- </div>
17
- <div>
18
- <el-button v-if="entry.scaffolds" @click="openScaffold" size="mini" class="button" icon="el-icon-view">View scaffold</el-button>
19
- </div>
20
- <div>
21
- <el-button v-if="hasCSVFile" @click="openPlot" size="mini" class="button" icon="el-icon-view">View plot</el-button>
22
- </div>
23
- <div>
24
- <el-button v-if="entry.simulation" @click="openRepository" size="mini" class="button" icon="el-icon-view">View repository</el-button>
25
- </div>
26
- <div>
27
- <el-button v-if="entry.simulation" @click="openSimulation" size="mini" class="button" icon="el-icon-view">View simulation</el-button>
28
- </div>
29
- </div>
30
-
31
- </div>
32
- <p v-if="(cardOverflow && !expanded)" class="read-more"><el-button @click="expand" class="read-more-button">Read more...</el-button></p>
33
- </div>
34
- </div>
35
- </template>
36
-
37
-
38
- <script>
39
- /* eslint-disable no-alert, no-console */
40
- import Vue from "vue";
41
- import { Button, Icon } from "element-ui";
42
- import lang from "element-ui/lib/locale/lang/en";
43
- import locale from "element-ui/lib/locale";
44
- import EventBus from "./EventBus"
45
- import speciesMap from "./species-map";
46
-
47
- locale.use(lang);
48
- Vue.use(Button);
49
- Vue.use(Icon);
50
-
51
- const capitalise = function(string){
52
- return string.replace(/\b\w/g, v => v.toUpperCase());
53
- }
54
-
55
- export default {
56
- name: "DatasetCard",
57
- props: {
58
- /**
59
- * Object containing information for
60
- * the required viewing.
61
- */
62
- entry: Object,
63
- envVars: {
64
- type: Object,
65
- default: () => {}
66
- },
67
- },
68
- data: function () {
69
- return {
70
- thumbnail: require('@/../assets/missing-image.svg'),
71
- dataLocation: this.entry.doi,
72
- discoverId: undefined,
73
- cardOverflow: false,
74
- expanded: false
75
- };
76
- },
77
- computed: {
78
- hasCSVFile: function(){
79
- return ( this.entry.csvFiles && this.entry.csvFiles.length !== 0 )
80
- },
81
- contributors: function() {
82
- let text = "";
83
- if (this.entry.contributors) {
84
- if (this.entry.contributors.length === 1) {
85
- text = this.lastName(this.entry.contributors[0].name);
86
- } else if (this.entry.contributors.length === 2) {
87
- text = this.lastName(this.entry.contributors[0].name) + " & " + this.lastName(this.entry.contributors[1].name);
88
- } else if (this.entry.contributors.length > 2) {
89
- text = this.lastName(this.entry.contributors[0].name) + " et al.";
90
- }
91
- }
92
- return text;
93
- },
94
- samples: function() {
95
- let text = "";
96
- if (this.entry.species) {
97
- if (speciesMap[this.entry.species[0].toLowerCase()]){
98
- text = `${speciesMap[this.entry.species[0].toLowerCase()]}`;
99
- } else {
100
- text = `${this.entry.species}`;
101
- }
102
- }
103
- if (this.entry.numberSamples > 0) {
104
- text += " (";
105
- if (this.entry.numberSamples === 1) {
106
- text += `${this.entry.numberSamples} sample`;
107
- } else if (this.entry.numberSamples > 1) {
108
- text += `${this.entry.numberSamples} samples`;
109
- }
110
- if (this.entry.numberSubjects === 1) {
111
- text += ` from ${this.entry.numberSubjects} subject`;
112
- } else if (this.entry.numberSamples > 1) {
113
- text += ` from ${this.entry.numberSubjects} subjects`;
114
- }
115
- text += ")";
116
- }
117
-
118
- return text;
119
- },
120
- label: function(){
121
- return this.entry.organs ? this.entry.organs[0] : this.entry.name
122
- },
123
- publishYear: function() {
124
- return this.entry.publishDate.split('-')[0]
125
- }
126
- },
127
- methods: {
128
- cardClicked: function(){
129
- if(this.entry.scaffolds){
130
- this.openScaffold()
131
- }else{
132
- this.openDataset()
133
- }
134
- },
135
- openScaffold: function(){
136
- let action = {
137
- label: capitalise(this.label),
138
- resource: this.getScaffoldPath(this.discoverId, this.version, this.entry.scaffolds[0].dataset.path),
139
- title: "View 3D scaffold",
140
- type: "Scaffold",
141
- discoverId: this.discoverId,
142
- apiLocation: this.envVars.API_LOCATION,
143
- version: this.version,
144
- contextCardUrl: this.entry.contextualInformation ? this.getFileFromPath(this.discoverId, this.version,this.entry.contextualInformation) : undefined,
145
- banner: this.thumbnail
146
- }
147
- this.propogateCardAction(action)
148
- },
149
- openPlot: function(){
150
- let action = {
151
- label: capitalise(this.label),
152
- resource: this.getFileFromPath(this.discoverId, this.version, this.entry.csvFiles[0].dataset.path),
153
- title: "View plot",
154
- type: "Plot",
155
- discoverId: this.discoverId,
156
- apiLocation: this.envVars.API_LOCATION,
157
- version: this.version,
158
- contextCardUrl: this.entry.contextualInformation ? this.getFileFromPath(this.discoverId, this.version,this.entry.contextualInformation) : undefined,
159
- banner: this.thumbnail
160
- }
161
- this.propogateCardAction(action)
162
- },
163
- openDataset: function(){
164
- window.open(this.dataLocation,'_blank');
165
- },
166
- openRepository: function() {
167
- let apiLocation = this.envVars.API_LOCATION;
168
- this.entry.additionalLinks.forEach(function(el) {
169
- if (el.description == "Repository") {
170
- let xmlhttp = new XMLHttpRequest();
171
- xmlhttp.open("POST", apiLocation + "/pmr_latest_exposure", true);
172
- xmlhttp.setRequestHeader("Content-type", "application/json");
173
- xmlhttp.onreadystatechange = () => {
174
- if (xmlhttp.readyState === 4) {
175
- let url = "";
176
- if (xmlhttp.status === 200) {
177
- url = JSON.parse(xmlhttp.responseText)["url"];
178
- }
179
- if (url === "") {
180
- url = el.uri;
181
- }
182
- window.open(url,'_blank');
183
- }
184
- };
185
- xmlhttp.send(JSON.stringify({workspace_url: el.uri}));
186
- }
187
- });
188
- },
189
- openSimulation: function() {
190
- let isSedmlResource = false;
191
- let resource = undefined;
192
- this.entry.additionalLinks.forEach(function(el) {
193
- if (el.description == "SED-ML file") {
194
- isSedmlResource = true;
195
- resource = el.uri;
196
- } else if (!isSedmlResource && (el.description == "CellML file")) {
197
- resource = el.uri;
198
- }
199
- });
200
- let action = {
201
- label: undefined,
202
- resource: resource,
203
- dataset: this.dataLocation,
204
- apiLocation: this.envVars.API_LOCATION,
205
- version: this.version,
206
- contextCardUrl: this.entry.contextualInformation ? this.getFileFromPath(this.discoverId, this.version,this.entry.contextualInformation) : undefined,
207
- banner: this.thumbnail,
208
- title: "View simulation",
209
- name: this.entry.name,
210
- description: this.entry.description,
211
- type: "Simulation"
212
- }
213
- EventBus.$emit("PopoverActionClick", action)
214
- },
215
- propogateCardAction: function(action){
216
- EventBus.$emit("PopoverActionClick", action)
217
- if (action.contextCardUrl) {
218
- this.$emit('contextUpdate', action)
219
- }
220
-
221
- },
222
- getScaffoldPath: function(discoverId, version, scaffoldPath){
223
- let id = discoverId
224
- let path = `${this.envVars.API_LOCATION}s3-resource/${id}/${version}/files/${scaffoldPath}`
225
- return path
226
- },
227
- getFileFromPath: function(discoverId, version, path){
228
- return `${this.envVars.API_LOCATION}s3-resource/${discoverId}/${version}/files/${path}`
229
- },
230
- isOverflown: function(el){
231
- return el.clientHeight < el.scrollHeight
232
- },
233
- expand: function() {
234
- this.expanded = true
235
- },
236
- splitDOI: function(doi){
237
- return [doi.split('/')[doi.split('/').length-2], doi.split('/')[doi.split('/').length-1]]
238
- },
239
- getBanner: function () {
240
- let doi = this.splitDOI(this.entry.doi)
241
- fetch(`https://api.pennsieve.io/discover/datasets/doi/${doi[0]}/${doi[1]}`)
242
- .then((response) =>{
243
- if (!response.ok){
244
- throw Error(response.statusText)
245
- } else {
246
- return response.json()
247
- }
248
- })
249
- .then((data) => {
250
- this.thumbnail = data.banner
251
- this.discoverId = data.id
252
- this.version = data.version
253
- this.dataLocation = `https://sparc.science/datasets/${data.id}?type=dataset`
254
- })
255
- .catch(() => {
256
- //set defaults if we hit an error
257
- this.thumbnail = require('@/../assets/missing-image.svg')
258
- this.discoverId = undefined
259
- });
260
- },
261
- lastName: function(fullName){
262
- return fullName.split(',')[0]
263
- },
264
- },
265
- mounted: function(){
266
- this.getBanner()
267
- this.cardOverflow = this.isOverflown(this.$refs.card)
268
- },
269
- updated: function () {
270
- },
271
- watch: {
272
- 'entry.description': function() { // watch it
273
- this.cardOverflow = false
274
- this.expanded = false
275
- this.cardOverflow = this.isOverflown(this.$refs.card)
276
- this.getBanner()
277
- }
278
- },
279
- };
280
- </script>
281
-
282
- <!-- Add "scoped" attribute to limit CSS to this component only -->
283
- <style scoped>
284
- .dataset-card {
285
- padding-left: 16px;
286
- position: relative;
287
- }
288
- .seperator-path {
289
- width: 486px;
290
- height: 0px;
291
- border: solid 1px #e4e7ed;
292
- background-color: #e4e7ed;
293
- }
294
- .title {
295
- padding-bottom: 5px;
296
- font-family: Asap;
297
- font-size: 14px;
298
- font-weight: bold;
299
- font-stretch: normal;
300
- font-style: normal;
301
- line-height: 1.5;
302
- letter-spacing: 1.05px;
303
- color: #484848;
304
- cursor: pointer;
305
- }
306
- .card {
307
- padding-top: 18px;
308
- position: relative;
309
- display: flex;
310
- }
311
-
312
- .card-left{
313
- flex: 1
314
- }
315
-
316
- .card-right {
317
- flex: 1.3;
318
- padding-left: 6px;
319
- }
320
-
321
- .dataset-card .read-more {
322
- position: absolute;
323
- z-index: 9;
324
- bottom: 0;
325
- left: 0;
326
- width: 100%;
327
- height: 20px;
328
- margin: 0; padding: 20px 66px;
329
- /* "transparent" only works here because == rgba(0,0,0,0) */
330
- background-image: linear-gradient(to bottom, transparent, white);
331
- pointer-events: none;
332
- }
333
-
334
- .read-more-button{
335
- width: 85px;
336
- height: 20px;
337
- font-family: Asap;
338
- font-size: 14px;
339
- font-weight: normal;
340
- font-stretch: normal;
341
- font-style: normal;
342
- line-height: normal;
343
- letter-spacing: normal;
344
- color: #8300bf;
345
- padding: 0px;
346
- pointer-events: all;
347
- cursor: pointer;
348
- }
349
-
350
- .button{
351
- z-index: 10;
352
- font-family: Asap;
353
- font-size: 14px;
354
- font-weight: normal;
355
- font-stretch: normal;
356
- font-style: normal;
357
- line-height: normal;
358
- letter-spacing: normal;
359
- background-color: #8300bf;
360
- border: #8300bf;
361
- color: white;
362
- cursor: pointer;
363
- margin-top: 8px;
364
- }
365
-
366
- .button:hover {
367
- background-color: #8300bf;
368
- color: white;
369
- }
370
-
371
- .banner-img {
372
- width: 128px;
373
- height: 128px;
374
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
375
- background-color: #ffffff;
376
- cursor: pointer;
377
- }
378
- .details{
379
- font-family: Asap;
380
- font-size: 14px;
381
- font-weight: normal;
382
- font-stretch: normal;
383
- font-style: normal;
384
- line-height: 1.5;
385
- letter-spacing: 1.05px;
386
- color: #484848;
387
- }
388
- </style>
1
+ <template>
2
+ <div class="dataset-card-container" ref="container">
3
+ <div v-bind:class=" expanded ? 'dataset-card-expanded' : 'dataset-card'" ref="card">
4
+ <div v-if="entry.id !== 0" class="seperator-path"></div>
5
+ <div class="card" >
6
+ <span class="card-left">
7
+ <img svg-inline class="banner-img" :src="thumbnail" @click="openDataset"/>
8
+ </span>
9
+ <div class="card-right" >
10
+ <div class="title" @click="cardClicked">{{entry.name}}</div>
11
+ <div class="details">{{contributors}} {{entry.publishDate ? `(${publishYear})` : ''}}</div>
12
+ <div class="details">{{samples}}</div>
13
+ <div class="details">id: {{discoverId}}</div>
14
+ <div>
15
+ <el-button v-if="!entry.simulation" @click="openDataset" size="mini" class="button" icon="el-icon-coin">View dataset</el-button>
16
+ </div>
17
+ <div>
18
+ <el-button v-if="entry.scaffolds" @click="openScaffold" size="mini" class="button" icon="el-icon-view">View scaffold</el-button>
19
+ </div>
20
+ <div>
21
+ <el-button v-if="hasCSVFile" @click="openPlot" size="mini" class="button" icon="el-icon-view">View plot</el-button>
22
+ </div>
23
+ <div>
24
+ <el-button v-if="entry.simulation" @click="openRepository" size="mini" class="button" icon="el-icon-view">View repository</el-button>
25
+ </div>
26
+ <div>
27
+ <el-button v-if="entry.simulation" @click="openSimulation" size="mini" class="button" icon="el-icon-view">View simulation</el-button>
28
+ </div>
29
+ </div>
30
+
31
+ </div>
32
+ <p v-if="(cardOverflow && !expanded)" class="read-more"><el-button @click="expand" class="read-more-button">Read more...</el-button></p>
33
+ </div>
34
+ </div>
35
+ </template>
36
+
37
+
38
+ <script>
39
+ /* eslint-disable no-alert, no-console */
40
+ import Vue from "vue";
41
+ import { Button, Icon } from "element-ui";
42
+ import lang from "element-ui/lib/locale/lang/en";
43
+ import locale from "element-ui/lib/locale";
44
+ import EventBus from "./EventBus"
45
+ import speciesMap from "./species-map";
46
+ import hardcoded_info from './hardcoded-context-info'
47
+
48
+ locale.use(lang);
49
+ Vue.use(Button);
50
+ Vue.use(Icon);
51
+
52
+
53
+ const capitalise = function(string){
54
+ return string.replace(/\b\w/g, v => v.toUpperCase());
55
+ }
56
+
57
+ export default {
58
+ name: "DatasetCard",
59
+ props: {
60
+ /**
61
+ * Object containing information for
62
+ * the required viewing.
63
+ */
64
+ entry: Object,
65
+ envVars: {
66
+ type: Object,
67
+ default: () => {}
68
+ },
69
+ },
70
+ data: function () {
71
+ return {
72
+ thumbnail: require('@/../assets/missing-image.svg'),
73
+ dataLocation: this.entry.doi,
74
+ discoverId: undefined,
75
+ cardOverflow: false,
76
+ expanded: false
77
+ };
78
+ },
79
+ computed: {
80
+ hasCSVFile: function(){
81
+ return ( this.entry.csvFiles && this.entry.csvFiles.length !== 0 )
82
+ },
83
+ contributors: function() {
84
+ let text = "";
85
+ if (this.entry.contributors) {
86
+ if (this.entry.contributors.length === 1) {
87
+ text = this.lastName(this.entry.contributors[0].name);
88
+ } else if (this.entry.contributors.length === 2) {
89
+ text = this.lastName(this.entry.contributors[0].name) + " & " + this.lastName(this.entry.contributors[1].name);
90
+ } else if (this.entry.contributors.length > 2) {
91
+ text = this.lastName(this.entry.contributors[0].name) + " et al.";
92
+ }
93
+ }
94
+ return text;
95
+ },
96
+ samples: function() {
97
+ let text = "";
98
+ if (this.entry.species) {
99
+ if (speciesMap[this.entry.species[0].toLowerCase()]){
100
+ text = `${speciesMap[this.entry.species[0].toLowerCase()]}`;
101
+ } else {
102
+ text = `${this.entry.species}`;
103
+ }
104
+ }
105
+ if (this.entry.numberSamples > 0) {
106
+ text += " (";
107
+ if (this.entry.numberSamples === 1) {
108
+ text += `${this.entry.numberSamples} sample`;
109
+ } else if (this.entry.numberSamples > 1) {
110
+ text += `${this.entry.numberSamples} samples`;
111
+ }
112
+ if (this.entry.numberSubjects === 1) {
113
+ text += ` from ${this.entry.numberSubjects} subject`;
114
+ } else if (this.entry.numberSamples > 1) {
115
+ text += ` from ${this.entry.numberSubjects} subjects`;
116
+ }
117
+ text += ")";
118
+ }
119
+
120
+ return text;
121
+ },
122
+ label: function(){
123
+ return this.entry.organs ? this.entry.organs[0] : this.entry.name
124
+ },
125
+ publishYear: function() {
126
+ return this.entry.publishDate.split('-')[0]
127
+ }
128
+ },
129
+ methods: {
130
+ cardClicked: function(){
131
+ if(this.entry.scaffolds){
132
+ this.openScaffold()
133
+ }else{
134
+ this.openDataset()
135
+ }
136
+ },
137
+ openScaffold: function(){
138
+ let action = {
139
+ label: capitalise(this.label),
140
+ resource: this.getScaffoldPath(this.discoverId, this.version, this.entry.scaffolds[0].dataset.path),
141
+ title: "View 3D scaffold",
142
+ type: "Scaffold",
143
+ discoverId: this.discoverId,
144
+ apiLocation: this.envVars.API_LOCATION,
145
+ version: this.version,
146
+ contextCardUrl: this.entry.contextualInformation ? this.getFileFromPath(this.discoverId, this.version,this.entry.contextualInformation) : undefined,
147
+ banner: this.thumbnail
148
+ }
149
+ if (hardcoded_info[this.discoverId]){
150
+ action.contextCardUrl = true
151
+ }
152
+ this.propogateCardAction(action)
153
+ },
154
+ openPlot: function(){
155
+ let action = {
156
+ label: capitalise(this.label),
157
+ resource: this.getFileFromPath(this.discoverId, this.version, this.entry.csvFiles[0].dataset.path),
158
+ title: "View plot",
159
+ type: "Plot",
160
+ discoverId: this.discoverId,
161
+ apiLocation: this.envVars.API_LOCATION,
162
+ version: this.version,
163
+ contextCardUrl: this.entry.contextualInformation ? this.getFileFromPath(this.discoverId, this.version,this.entry.contextualInformation) : undefined,
164
+ banner: this.thumbnail
165
+ }
166
+ this.propogateCardAction(action)
167
+ },
168
+ openDataset: function(){
169
+ window.open(this.dataLocation,'_blank');
170
+ },
171
+ openRepository: function() {
172
+ let apiLocation = this.envVars.API_LOCATION;
173
+ this.entry.additionalLinks.forEach(function(el) {
174
+ if (el.description == "Repository") {
175
+ let xmlhttp = new XMLHttpRequest();
176
+ xmlhttp.open("POST", apiLocation + "/pmr_latest_exposure", true);
177
+ xmlhttp.setRequestHeader("Content-type", "application/json");
178
+ xmlhttp.onreadystatechange = () => {
179
+ if (xmlhttp.readyState === 4) {
180
+ let url = "";
181
+ if (xmlhttp.status === 200) {
182
+ url = JSON.parse(xmlhttp.responseText)["url"];
183
+ }
184
+ if (url === "") {
185
+ url = el.uri;
186
+ }
187
+ window.open(url,'_blank');
188
+ }
189
+ };
190
+ xmlhttp.send(JSON.stringify({workspace_url: el.uri}));
191
+ }
192
+ });
193
+ },
194
+ openSimulation: function() {
195
+ let isSedmlResource = false;
196
+ let resource = undefined;
197
+ this.entry.additionalLinks.forEach(function(el) {
198
+ if (el.description == "SED-ML file") {
199
+ isSedmlResource = true;
200
+ resource = el.uri;
201
+ } else if (!isSedmlResource && (el.description == "CellML file")) {
202
+ resource = el.uri;
203
+ }
204
+ });
205
+ let action = {
206
+ label: undefined,
207
+ resource: resource,
208
+ dataset: this.dataLocation,
209
+ apiLocation: this.envVars.API_LOCATION,
210
+ version: this.version,
211
+ discoverId: this.discoverId,
212
+ contextCardUrl: this.entry.contextualInformation ? this.getFileFromPath(this.discoverId, this.version,this.entry.contextualInformation) : undefined,
213
+ banner: this.thumbnail,
214
+ title: "View simulation",
215
+ name: this.entry.name,
216
+ description: this.entry.description,
217
+ type: "Simulation"
218
+ }
219
+ EventBus.$emit("PopoverActionClick", action)
220
+ },
221
+ propogateCardAction: function(action){
222
+ EventBus.$emit("PopoverActionClick", action)
223
+ if (action.contextCardUrl) {
224
+ this.$emit('contextUpdate', action)
225
+ }
226
+
227
+ },
228
+ getScaffoldPath: function(discoverId, version, scaffoldPath){
229
+ let id = discoverId
230
+ let path = `${this.envVars.API_LOCATION}s3-resource/${id}/${version}/files/${scaffoldPath}`
231
+ return path
232
+ },
233
+ getFileFromPath: function(discoverId, version, path){
234
+ return `${this.envVars.API_LOCATION}s3-resource/${discoverId}/${version}/files/${path}`
235
+ },
236
+ isOverflown: function(el){
237
+ return el.clientHeight < el.scrollHeight
238
+ },
239
+ expand: function() {
240
+ this.expanded = true
241
+ },
242
+ splitDOI: function(doi){
243
+ return [doi.split('/')[doi.split('/').length-2], doi.split('/')[doi.split('/').length-1]]
244
+ },
245
+ getBanner: function () {
246
+ let doi = this.splitDOI(this.entry.doi)
247
+ fetch(`https://api.pennsieve.io/discover/datasets/doi/${doi[0]}/${doi[1]}`)
248
+ .then((response) =>{
249
+ if (!response.ok){
250
+ throw Error(response.statusText)
251
+ } else {
252
+ return response.json()
253
+ }
254
+ })
255
+ .then((data) => {
256
+ this.thumbnail = data.banner
257
+ this.discoverId = data.id
258
+ this.version = data.version
259
+ this.dataLocation = `https://sparc.science/datasets/${data.id}?type=dataset`
260
+ })
261
+ .catch(() => {
262
+ //set defaults if we hit an error
263
+ this.thumbnail = require('@/../assets/missing-image.svg')
264
+ this.discoverId = undefined
265
+ });
266
+ },
267
+ lastName: function(fullName){
268
+ return fullName.split(',')[0]
269
+ },
270
+ },
271
+ mounted: function(){
272
+ this.getBanner()
273
+ this.cardOverflow = this.isOverflown(this.$refs.card)
274
+ },
275
+ updated: function () {
276
+ },
277
+ watch: {
278
+ 'entry.description': function() { // watch it
279
+ this.cardOverflow = false
280
+ this.expanded = false
281
+ this.cardOverflow = this.isOverflown(this.$refs.card)
282
+ this.getBanner()
283
+ }
284
+ },
285
+ };
286
+ </script>
287
+
288
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
289
+ <style scoped>
290
+ .dataset-card {
291
+ padding-left: 16px;
292
+ position: relative;
293
+ }
294
+ .seperator-path {
295
+ width: 486px;
296
+ height: 0px;
297
+ border: solid 1px #e4e7ed;
298
+ background-color: #e4e7ed;
299
+ }
300
+ .title {
301
+ padding-bottom: 5px;
302
+ font-family: Asap;
303
+ font-size: 14px;
304
+ font-weight: bold;
305
+ font-stretch: normal;
306
+ font-style: normal;
307
+ line-height: 1.5;
308
+ letter-spacing: 1.05px;
309
+ color: #484848;
310
+ cursor: pointer;
311
+ }
312
+ .card {
313
+ padding-top: 18px;
314
+ position: relative;
315
+ display: flex;
316
+ }
317
+
318
+ .card-left{
319
+ flex: 1
320
+ }
321
+
322
+ .card-right {
323
+ flex: 1.3;
324
+ padding-left: 6px;
325
+ }
326
+
327
+ .dataset-card .read-more {
328
+ position: absolute;
329
+ z-index: 9;
330
+ bottom: 0;
331
+ left: 0;
332
+ width: 100%;
333
+ height: 20px;
334
+ margin: 0; padding: 20px 66px;
335
+ /* "transparent" only works here because == rgba(0,0,0,0) */
336
+ background-image: linear-gradient(to bottom, transparent, white);
337
+ pointer-events: none;
338
+ }
339
+
340
+ .read-more-button{
341
+ width: 85px;
342
+ height: 20px;
343
+ font-family: Asap;
344
+ font-size: 14px;
345
+ font-weight: normal;
346
+ font-stretch: normal;
347
+ font-style: normal;
348
+ line-height: normal;
349
+ letter-spacing: normal;
350
+ color: #8300bf;
351
+ padding: 0px;
352
+ pointer-events: all;
353
+ cursor: pointer;
354
+ }
355
+
356
+ .button{
357
+ z-index: 10;
358
+ font-family: Asap;
359
+ font-size: 14px;
360
+ font-weight: normal;
361
+ font-stretch: normal;
362
+ font-style: normal;
363
+ line-height: normal;
364
+ letter-spacing: normal;
365
+ background-color: #8300bf;
366
+ border: #8300bf;
367
+ color: white;
368
+ cursor: pointer;
369
+ margin-top: 8px;
370
+ }
371
+
372
+ .button:hover {
373
+ background-color: #8300bf;
374
+ color: white;
375
+ }
376
+
377
+ .banner-img {
378
+ width: 128px;
379
+ height: 128px;
380
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
381
+ background-color: #ffffff;
382
+ cursor: pointer;
383
+ }
384
+ .details{
385
+ font-family: Asap;
386
+ font-size: 14px;
387
+ font-weight: normal;
388
+ font-stretch: normal;
389
+ font-style: normal;
390
+ line-height: 1.5;
391
+ letter-spacing: 1.05px;
392
+ color: #484848;
393
+ }
394
+ </style>