@saooti/octopus-sdk 37.0.3 → 37.0.4
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/package.json +1 -1
- package/src/assets/bootstrap.scss +3 -2
- package/src/components/display/list/SwiperList.vue +4 -0
- package/src/components/form/ClassicDatePicker.vue +5 -0
- package/src/components/misc/player/radio/RadioHistory.vue +90 -10
- package/src/components/mixins/radio/fetchRadioData.ts +4 -2
package/package.json
CHANGED
|
@@ -146,14 +146,15 @@ input:not([class^="vs__"]), button:not([class^="vs__"]), select:not([class^="vs_
|
|
|
146
146
|
background: transparent;
|
|
147
147
|
border-color: white !important;
|
|
148
148
|
}
|
|
149
|
-
&:disabled
|
|
149
|
+
&:not(.btn-on-dark):disabled,
|
|
150
|
+
&.btn-on-dark:disabled{
|
|
150
151
|
background-color: #cccccc;
|
|
151
152
|
border: 1px solid black;
|
|
152
153
|
cursor: default;
|
|
153
154
|
color: gray !important;
|
|
154
155
|
}
|
|
155
156
|
@media (max-width: 500px){
|
|
156
|
-
|
|
157
|
+
margin: 0.3rem;
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
|
|
@@ -37,6 +37,7 @@ export default defineComponent({
|
|
|
37
37
|
|
|
38
38
|
props: {
|
|
39
39
|
listObject: { default: ()=>[], type: Array as ()=> Array<unknown>},
|
|
40
|
+
sizeItemOverload:{default: undefined, type: Number}
|
|
40
41
|
},
|
|
41
42
|
|
|
42
43
|
data() {
|
|
@@ -47,6 +48,9 @@ export default defineComponent({
|
|
|
47
48
|
},
|
|
48
49
|
computed: {
|
|
49
50
|
sizeItem(): number {
|
|
51
|
+
if(this.sizeItemOverload){
|
|
52
|
+
return this.sizeItemOverload;
|
|
53
|
+
}
|
|
50
54
|
if (window.innerWidth <= 450) {
|
|
51
55
|
return 12.5;
|
|
52
56
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
:is-inline="columnNumber>1"
|
|
13
13
|
:update-on-input="conditionEdit"
|
|
14
14
|
:masks="isMask ? masks : undefined"
|
|
15
|
+
:time-accuracy="timeAccuracy"
|
|
15
16
|
@update:modelValue="$emit('updateDate', $event)"
|
|
16
17
|
>
|
|
17
18
|
<template
|
|
@@ -41,6 +42,7 @@ export default defineComponent({
|
|
|
41
42
|
isMaxDate:{ default: false, type: Boolean},
|
|
42
43
|
isMinDate:{ default: false, type: Boolean},
|
|
43
44
|
columnNumber:{default:1, type: Number},
|
|
45
|
+
timeAccuracy:{default:2, type: Number},
|
|
44
46
|
templateClass:{default: undefined, type: String},
|
|
45
47
|
mode:{default:"dateTime", type: String},
|
|
46
48
|
isMask:{default: false, type: Boolean},
|
|
@@ -66,6 +68,9 @@ export default defineComponent({
|
|
|
66
68
|
@import '@scss/_variables.scss';
|
|
67
69
|
@import 'v-calendar/dist/style.css';
|
|
68
70
|
.octopus-app{
|
|
71
|
+
.vc-base-select select{
|
|
72
|
+
border: 0 !important;
|
|
73
|
+
}
|
|
69
74
|
.vc-select select{
|
|
70
75
|
padding: 0 !important;
|
|
71
76
|
}
|
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
v-if="
|
|
4
|
-
class="d-flex align-items-center
|
|
3
|
+
v-if="playerRadioHistory.length"
|
|
4
|
+
class="d-flex align-items-center mt-3"
|
|
5
5
|
>
|
|
6
6
|
<div class="fw-bold me-3">
|
|
7
7
|
{{ $t('Previously') +':' }}
|
|
8
8
|
</div>
|
|
9
|
-
<
|
|
10
|
-
v-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
<button
|
|
10
|
+
v-if="indexStart!==0"
|
|
11
|
+
class="btn btn-transparent text-light saooti-left"
|
|
12
|
+
@click="handleResize(0)"
|
|
13
|
+
/>
|
|
14
|
+
<div
|
|
15
|
+
ref="historyListContainer"
|
|
16
|
+
class="history-list-container"
|
|
13
17
|
>
|
|
14
|
-
<
|
|
15
|
-
|
|
18
|
+
<div
|
|
19
|
+
v-for="(pastItem, index) in playerRadioHistory"
|
|
20
|
+
:key="pastItem.title"
|
|
21
|
+
:ref="'history' + index"
|
|
22
|
+
class="d-flex flex-shrink-0"
|
|
23
|
+
>
|
|
24
|
+
<div class="d-flex flex-shrink-0 align-items-end">
|
|
25
|
+
<span class="me-2 hour-past-item">{{ displayTimeItem(pastItem) }}</span>
|
|
26
|
+
<span class="me-3">{{ displayPreviousItem(pastItem) }}</span>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
16
29
|
</div>
|
|
30
|
+
<button
|
|
31
|
+
v-if="indexNotDisplay<=playerRadioHistory.length-1"
|
|
32
|
+
class="btn btn-transparent text-light saooti-right"
|
|
33
|
+
@click="handleResize(indexNotDisplay)"
|
|
34
|
+
/>
|
|
17
35
|
</div>
|
|
18
36
|
</template>
|
|
19
37
|
|
|
@@ -34,16 +52,70 @@ export default defineComponent({
|
|
|
34
52
|
emits: ['updateNotListenTime'],
|
|
35
53
|
data() {
|
|
36
54
|
return {
|
|
55
|
+
indexStart: 0 as number,
|
|
56
|
+
indexNotDisplay: 100 as number,
|
|
37
57
|
};
|
|
38
58
|
},
|
|
39
59
|
|
|
40
60
|
computed: {
|
|
41
61
|
...mapState(usePlayerStore, ['playerRadio']),
|
|
62
|
+
playerRadioHistory(){
|
|
63
|
+
return this.playerRadio?.history ?? [];
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
watch:{
|
|
67
|
+
playerRadioHistory: {
|
|
68
|
+
deep: true,
|
|
69
|
+
immediate:true,
|
|
70
|
+
handler(){
|
|
71
|
+
this.$nextTick(() => {
|
|
72
|
+
this.handleResize(0);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
created() {
|
|
78
|
+
window.addEventListener('resize', ()=>{this.handleResize(0);});
|
|
79
|
+
},
|
|
80
|
+
unmounted() {
|
|
81
|
+
window.removeEventListener('resize', ()=>{this.handleResize(0);});
|
|
42
82
|
},
|
|
43
|
-
mounted(){
|
|
44
|
-
|
|
83
|
+
mounted() {
|
|
84
|
+
this.handleResize(0);
|
|
45
85
|
},
|
|
46
86
|
methods:{
|
|
87
|
+
handleResize(indexAsked:number): void {
|
|
88
|
+
const historyList = (this.$refs.historyListContainer as HTMLElement);
|
|
89
|
+
if(null === historyList ||!historyList){
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.indexStart = indexAsked;
|
|
93
|
+
this.indexNotDisplay = this.playerRadioHistory.length;
|
|
94
|
+
for (let index = 0; index < this.playerRadioHistory.length; index++) {
|
|
95
|
+
const el = (this.$refs['history' +index] as Array<HTMLElement>)[0];
|
|
96
|
+
if (!el) continue;
|
|
97
|
+
if(index < this.indexStart && !el.classList.contains('hid')){
|
|
98
|
+
el.classList.add('hid');
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (index >= this.indexStart && el.classList.contains('hid')) {
|
|
102
|
+
el.classList.remove('hid');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
for (let index = this.indexStart + 1; index < this.playerRadioHistory.length; index++) {
|
|
106
|
+
const el = (this.$refs['history' +index] as Array<HTMLElement>)[0];
|
|
107
|
+
if (!el) continue;
|
|
108
|
+
if (index > this.indexNotDisplay && !el.classList.contains('hid')) {
|
|
109
|
+
el.classList.add('hid');
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const parent = el.parentElement;
|
|
113
|
+
if (parent && el.offsetLeft + el.clientWidth > parent.clientWidth ) {
|
|
114
|
+
this.indexNotDisplay = index;
|
|
115
|
+
el.classList.add('hid');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
47
119
|
displayTimeItem(item: MediaRadio):string{
|
|
48
120
|
return dayjs(item.startDate).format('HH:mm');
|
|
49
121
|
},
|
|
@@ -58,6 +130,14 @@ export default defineComponent({
|
|
|
58
130
|
</script>
|
|
59
131
|
<style lang="scss">
|
|
60
132
|
.octopus-app{
|
|
133
|
+
.history-list-container {
|
|
134
|
+
display: inline-flex;
|
|
135
|
+
justify-content: flex-start;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
flex-grow: 1;
|
|
138
|
+
width: 0;
|
|
139
|
+
position: relative;
|
|
140
|
+
}
|
|
61
141
|
.hour-past-item{
|
|
62
142
|
font-size: 0.8rem;
|
|
63
143
|
color: #dbdbdb;
|
|
@@ -20,11 +20,13 @@ export const fetchRadioData = defineComponent({
|
|
|
20
20
|
for (let index = 0, len = arrayMetadata.length; index < len; index++) {
|
|
21
21
|
if(dayjs().valueOf()-18000 > dayjs(arrayMetadata[index].startDate).valueOf()){
|
|
22
22
|
if(previousTitle !== arrayMetadata[index].title){
|
|
23
|
+
const historyIndex = index+1 < len ? index+1 : index;
|
|
24
|
+
const history = arrayMetadata.slice(historyIndex, len);
|
|
23
25
|
if(arrayMetadata[index].podcastId){
|
|
24
26
|
const data : Podcast = await octopusApi.fetchData<Podcast>(0, 'podcast/'+arrayMetadata[index].podcastId);
|
|
25
|
-
callbackMetadata(arrayMetadata[index], data,
|
|
27
|
+
callbackMetadata(arrayMetadata[index], data, history);
|
|
26
28
|
}else{
|
|
27
|
-
callbackMetadata(arrayMetadata[index], undefined,
|
|
29
|
+
callbackMetadata(arrayMetadata[index], undefined, history);
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
return;
|