@sedoo/unidoo 0.1.67 → 0.1.69
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/unidoo/unidoo.common.js +6 -6
- package/dist/unidoo/unidoo.umd.js +6 -6
- package/dist/unidoo/unidoo.umd.min.js +6 -6
- package/package.json +1 -1
- package/src/components/unidoo-player/UnidooPlayer.vue +7 -1
- package/src/components/unidoo-player/unidoo-player-layout/ThumbnailEntries.vue +19 -23
- package/src/components/unidoo-player/unidoo-player-layout/ThumbnailEntry.vue +60 -0
- package/src/components/unidoo-player/unidoo-player-layout/UnidooPlayerLayout.vue +4 -2
- package/src/components/unidoo-player/unidoo-simple-player/UnidooSimplePlayer.vue +7 -1
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
:label="label"
|
|
17
17
|
:entries="entries"
|
|
18
18
|
:displayThumbnails="displayThumbnails"
|
|
19
|
+
:thumbnailRatio="thumbnailRatio"
|
|
19
20
|
>
|
|
20
21
|
|
|
21
22
|
<template v-slot:customField>
|
|
@@ -75,11 +76,16 @@ export default {
|
|
|
75
76
|
displayThumbnails: {
|
|
76
77
|
type: Boolean,
|
|
77
78
|
default: false
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
thumbnailRatio: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: "null"
|
|
78
84
|
}
|
|
79
85
|
},
|
|
80
86
|
|
|
81
87
|
data: () => ({
|
|
82
|
-
entries:
|
|
88
|
+
entries: []
|
|
83
89
|
}),
|
|
84
90
|
|
|
85
91
|
computed: {
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-container class="d-flex justify-start flex-wrap">
|
|
3
|
-
<
|
|
4
|
-
class="thumbnail ma-1"
|
|
5
|
-
:style="selected === index ? activeStyle : ''"
|
|
3
|
+
<thumbnail-entry
|
|
6
4
|
v-for="(link, index) in links"
|
|
7
|
-
:
|
|
8
|
-
:
|
|
9
|
-
:
|
|
10
|
-
:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
></v-img>
|
|
5
|
+
:selected="isActive(index)"
|
|
6
|
+
:link="link"
|
|
7
|
+
:thumbnailRatio="thumbnailRatio"
|
|
8
|
+
:key="index"
|
|
9
|
+
@select="select(index)"
|
|
10
|
+
></thumbnail-entry>
|
|
14
11
|
</v-container>
|
|
15
12
|
</template>
|
|
16
13
|
|
|
17
14
|
<script>
|
|
15
|
+
import ThumbnailEntry from "./ThumbnailEntry.vue";
|
|
16
|
+
|
|
18
17
|
export default {
|
|
19
18
|
name: "thumbnail-entries",
|
|
19
|
+
components: {
|
|
20
|
+
ThumbnailEntry
|
|
21
|
+
},
|
|
20
22
|
props: {
|
|
21
|
-
entries: { type: Array, required: true },
|
|
22
|
-
value: { type: Number, default: 0 }
|
|
23
|
+
entries: { type: Array, default: () => [], required: true },
|
|
24
|
+
value: { type: Number, default: 0 },
|
|
25
|
+
thumbnailRatio: { type: String, default: null }
|
|
23
26
|
},
|
|
24
27
|
data() {
|
|
25
28
|
return {
|
|
26
|
-
selected: null
|
|
27
|
-
activeStyle: "border: 3px solid black; border-radius: 3px;"
|
|
29
|
+
selected: null
|
|
28
30
|
};
|
|
29
31
|
},
|
|
30
32
|
created() {
|
|
@@ -44,9 +46,9 @@ export default {
|
|
|
44
46
|
}
|
|
45
47
|
},
|
|
46
48
|
methods: {
|
|
47
|
-
select(
|
|
48
|
-
this.selected =
|
|
49
|
-
this.$emit("select",
|
|
49
|
+
select(index) {
|
|
50
|
+
this.selected = index;
|
|
51
|
+
this.$emit("select", index);
|
|
50
52
|
},
|
|
51
53
|
isActive(index) {
|
|
52
54
|
return this.selected === index;
|
|
@@ -54,9 +56,3 @@ export default {
|
|
|
54
56
|
}
|
|
55
57
|
};
|
|
56
58
|
</script>
|
|
57
|
-
|
|
58
|
-
<style scoped>
|
|
59
|
-
.thumbnail {
|
|
60
|
-
cursor: pointer;
|
|
61
|
-
}
|
|
62
|
-
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-img
|
|
3
|
+
ref="thumbnail"
|
|
4
|
+
class="thumbnail ma-1"
|
|
5
|
+
:style="selected ? activeStyle : ''"
|
|
6
|
+
:src="link"
|
|
7
|
+
:aspect-ratio="computedRatio"
|
|
8
|
+
:width="width"
|
|
9
|
+
:max-width="width"
|
|
10
|
+
contain
|
|
11
|
+
@click="select"
|
|
12
|
+
@load="handleLoadImage"
|
|
13
|
+
></v-img>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: "thumbnail-entry",
|
|
19
|
+
props: {
|
|
20
|
+
selected: { type: Boolean, default: false },
|
|
21
|
+
link: { type: String, default: null },
|
|
22
|
+
thumbnailRatio: { type: String, default: null }
|
|
23
|
+
},
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
activeStyle: "border: 3px solid black; border-radius: 3px;",
|
|
27
|
+
ratio: null,
|
|
28
|
+
width: "calc(100%/3 - 16px)"
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
computed: {
|
|
32
|
+
computedRatio() {
|
|
33
|
+
if (this.thumbnailRatio) {
|
|
34
|
+
const [a, b] = this.thumbnailRatio.split("/");
|
|
35
|
+
if (b) {
|
|
36
|
+
return Number(a) / Number(b);
|
|
37
|
+
}
|
|
38
|
+
return Number(a);
|
|
39
|
+
}
|
|
40
|
+
return this.ratio;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
select() {
|
|
45
|
+
this.$emit("select");
|
|
46
|
+
},
|
|
47
|
+
handleLoadImage() {
|
|
48
|
+
const { height, width } =
|
|
49
|
+
this.$refs.thumbnail.$el.getBoundingClientRect();
|
|
50
|
+
this.ratio = width / height;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style scoped>
|
|
57
|
+
.thumbnail {
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
@@ -115,6 +115,7 @@
|
|
|
115
115
|
v-if="displayThumbnails"
|
|
116
116
|
:value.sync="value"
|
|
117
117
|
:entries="entries"
|
|
118
|
+
:thumbnailRatio="thumbnailRatio"
|
|
118
119
|
@select="updateFromThumbnail"
|
|
119
120
|
></thumbnail-entries>
|
|
120
121
|
</div>
|
|
@@ -144,8 +145,9 @@ export default {
|
|
|
144
145
|
progressBarTitle: { type: String, default: 'Loading image' },
|
|
145
146
|
clickableFrame: { type: Boolean, default: true },
|
|
146
147
|
playerBarTop: { type: Boolean, default: true },
|
|
147
|
-
entries: { type: Array, default:
|
|
148
|
-
displayThumbnails: { type: Boolean, default: false }
|
|
148
|
+
entries: { type: Array, default: () => [] },
|
|
149
|
+
displayThumbnails: { type: Boolean, default: false },
|
|
150
|
+
thumbnailRatio: { type: String, default: null }
|
|
149
151
|
},
|
|
150
152
|
|
|
151
153
|
data: () => ({
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
:loadedFrames="loadedFrames"
|
|
13
13
|
:entries="entries"
|
|
14
14
|
:displayThumbnails="displayThumbnails"
|
|
15
|
+
:thumbnailRatio="thumbnailRatio"
|
|
15
16
|
@reload-frames="refreshPreload(loadIndex)"
|
|
16
17
|
progressBarTitle="Loading image"
|
|
17
18
|
>
|
|
@@ -63,12 +64,17 @@ export default {
|
|
|
63
64
|
|
|
64
65
|
entries: {
|
|
65
66
|
type: Array,
|
|
66
|
-
default: () =>
|
|
67
|
+
default: () => []
|
|
67
68
|
},
|
|
68
69
|
|
|
69
70
|
displayThumbnails: {
|
|
70
71
|
type: Boolean,
|
|
71
72
|
default: false
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
thumbnailRatio: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: null
|
|
72
78
|
}
|
|
73
79
|
},
|
|
74
80
|
|