@abi-software/map-side-bar 1.1.17-beta.1 → 1.1.18-fixes-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.
@@ -1,393 +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
- 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
- contextCardUrl: this.entry.contextualInformation ? this.getFileFromPath(this.discoverId, this.version,this.entry.contextualInformation) : undefined,
212
- banner: this.thumbnail,
213
- title: "View simulation",
214
- name: this.entry.name,
215
- description: this.entry.description,
216
- type: "Simulation"
217
- }
218
- EventBus.$emit("PopoverActionClick", action)
219
- },
220
- propogateCardAction: function(action){
221
- EventBus.$emit("PopoverActionClick", action)
222
- if (action.contextCardUrl) {
223
- this.$emit('contextUpdate', action)
224
- }
225
-
226
- },
227
- getScaffoldPath: function(discoverId, version, scaffoldPath){
228
- let id = discoverId
229
- let path = `${this.envVars.API_LOCATION}s3-resource/${id}/${version}/files/${scaffoldPath}`
230
- return path
231
- },
232
- getFileFromPath: function(discoverId, version, path){
233
- return `${this.envVars.API_LOCATION}s3-resource/${discoverId}/${version}/files/${path}`
234
- },
235
- isOverflown: function(el){
236
- return el.clientHeight < el.scrollHeight
237
- },
238
- expand: function() {
239
- this.expanded = true
240
- },
241
- splitDOI: function(doi){
242
- return [doi.split('/')[doi.split('/').length-2], doi.split('/')[doi.split('/').length-1]]
243
- },
244
- getBanner: function () {
245
- let doi = this.splitDOI(this.entry.doi)
246
- fetch(`https://api.pennsieve.io/discover/datasets/doi/${doi[0]}/${doi[1]}`)
247
- .then((response) =>{
248
- if (!response.ok){
249
- throw Error(response.statusText)
250
- } else {
251
- return response.json()
252
- }
253
- })
254
- .then((data) => {
255
- this.thumbnail = data.banner
256
- this.discoverId = data.id
257
- this.version = data.version
258
- this.dataLocation = `https://sparc.science/datasets/${data.id}?type=dataset`
259
- })
260
- .catch(() => {
261
- //set defaults if we hit an error
262
- this.thumbnail = require('@/../assets/missing-image.svg')
263
- this.discoverId = undefined
264
- });
265
- },
266
- lastName: function(fullName){
267
- return fullName.split(',')[0]
268
- },
269
- },
270
- mounted: function(){
271
- this.getBanner()
272
- this.cardOverflow = this.isOverflown(this.$refs.card)
273
- },
274
- updated: function () {
275
- },
276
- watch: {
277
- 'entry.description': function() { // watch it
278
- this.cardOverflow = false
279
- this.expanded = false
280
- this.cardOverflow = this.isOverflown(this.$refs.card)
281
- this.getBanner()
282
- }
283
- },
284
- };
285
- </script>
286
-
287
- <!-- Add "scoped" attribute to limit CSS to this component only -->
288
- <style scoped>
289
- .dataset-card {
290
- padding-left: 16px;
291
- position: relative;
292
- }
293
- .seperator-path {
294
- width: 486px;
295
- height: 0px;
296
- border: solid 1px #e4e7ed;
297
- background-color: #e4e7ed;
298
- }
299
- .title {
300
- padding-bottom: 5px;
301
- font-family: Asap;
302
- font-size: 14px;
303
- font-weight: bold;
304
- font-stretch: normal;
305
- font-style: normal;
306
- line-height: 1.5;
307
- letter-spacing: 1.05px;
308
- color: #484848;
309
- cursor: pointer;
310
- }
311
- .card {
312
- padding-top: 18px;
313
- position: relative;
314
- display: flex;
315
- }
316
-
317
- .card-left{
318
- flex: 1
319
- }
320
-
321
- .card-right {
322
- flex: 1.3;
323
- padding-left: 6px;
324
- }
325
-
326
- .dataset-card .read-more {
327
- position: absolute;
328
- z-index: 9;
329
- bottom: 0;
330
- left: 0;
331
- width: 100%;
332
- height: 20px;
333
- margin: 0; padding: 20px 66px;
334
- /* "transparent" only works here because == rgba(0,0,0,0) */
335
- background-image: linear-gradient(to bottom, transparent, white);
336
- pointer-events: none;
337
- }
338
-
339
- .read-more-button{
340
- width: 85px;
341
- height: 20px;
342
- font-family: Asap;
343
- font-size: 14px;
344
- font-weight: normal;
345
- font-stretch: normal;
346
- font-style: normal;
347
- line-height: normal;
348
- letter-spacing: normal;
349
- color: #8300bf;
350
- padding: 0px;
351
- pointer-events: all;
352
- cursor: pointer;
353
- }
354
-
355
- .button{
356
- z-index: 10;
357
- font-family: Asap;
358
- font-size: 14px;
359
- font-weight: normal;
360
- font-stretch: normal;
361
- font-style: normal;
362
- line-height: normal;
363
- letter-spacing: normal;
364
- background-color: #8300bf;
365
- border: #8300bf;
366
- color: white;
367
- cursor: pointer;
368
- margin-top: 8px;
369
- }
370
-
371
- .button:hover {
372
- background-color: #8300bf;
373
- color: white;
374
- }
375
-
376
- .banner-img {
377
- width: 128px;
378
- height: 128px;
379
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
380
- background-color: #ffffff;
381
- cursor: pointer;
382
- }
383
- .details{
384
- font-family: Asap;
385
- font-size: 14px;
386
- font-weight: normal;
387
- font-stretch: normal;
388
- font-style: normal;
389
- line-height: 1.5;
390
- letter-spacing: 1.05px;
391
- color: #484848;
392
- }
393
- </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>