@saooti/octopus-sdk 37.0.13 → 37.0.15
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/index.ts +3 -1
- package/package.json +1 -1
- package/src/assets/share.scss +1 -1
- package/src/components/display/emission/EmissionInlineList.vue +18 -24
- package/src/components/display/list/ListPaginate.vue +4 -15
- package/src/components/display/list/SwiperList.vue +39 -36
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +18 -23
- package/src/components/display/podcasts/PodcastInlineListClassic.vue +19 -21
- package/src/components/mixins/resizePhone.ts +23 -0
package/index.ts
CHANGED
|
@@ -80,6 +80,7 @@ import imageProxy from "./src/components/mixins/imageProxy.ts";
|
|
|
80
80
|
import orgaFilter from "./src/components/mixins/organisationFilter.ts";
|
|
81
81
|
import initSDK from "./src/components/mixins/init.ts";
|
|
82
82
|
import tagOfMixins from "./src/components/mixins/tagOfMixins.ts";
|
|
83
|
+
import resizePhone from "./src/components/mixins/resizePhone.ts";
|
|
83
84
|
|
|
84
85
|
export {
|
|
85
86
|
selenium,
|
|
@@ -88,5 +89,6 @@ export {
|
|
|
88
89
|
imageProxy,
|
|
89
90
|
orgaFilter,
|
|
90
91
|
initSDK,
|
|
91
|
-
tagOfMixins
|
|
92
|
+
tagOfMixins,
|
|
93
|
+
resizePhone
|
|
92
94
|
};
|
package/package.json
CHANGED
package/src/assets/share.scss
CHANGED
|
@@ -64,6 +64,7 @@ import { Rubrique } from "@/stores/class/rubrique/rubrique";
|
|
|
64
64
|
import { defineComponent } from "vue";
|
|
65
65
|
import { AxiosError } from "axios";
|
|
66
66
|
import imageProxy from "../../mixins/imageProxy";
|
|
67
|
+
import resizePhone from "../../mixins/resizePhone";
|
|
67
68
|
import { Rubriquage } from "@/stores/class/rubrique/rubriquage";
|
|
68
69
|
export default defineComponent({
|
|
69
70
|
name: "EmissionInlineList",
|
|
@@ -73,7 +74,7 @@ export default defineComponent({
|
|
|
73
74
|
ClassicLoading,
|
|
74
75
|
},
|
|
75
76
|
|
|
76
|
-
mixins: [handle403, imageProxy],
|
|
77
|
+
mixins: [handle403, imageProxy, resizePhone],
|
|
77
78
|
|
|
78
79
|
props: {
|
|
79
80
|
organisationId: { default: undefined, type: String },
|
|
@@ -98,6 +99,8 @@ export default defineComponent({
|
|
|
98
99
|
direction: 1 as number,
|
|
99
100
|
alignLeft: false as boolean,
|
|
100
101
|
rubriques: undefined as Array<Rubrique> | undefined,
|
|
102
|
+
isPhone: false as boolean,
|
|
103
|
+
windowWidth: 0 as number
|
|
101
104
|
};
|
|
102
105
|
},
|
|
103
106
|
|
|
@@ -129,18 +132,23 @@ export default defineComponent({
|
|
|
129
132
|
sizeItem() {
|
|
130
133
|
this.handleResize();
|
|
131
134
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
windowWidth(){
|
|
136
|
+
if (!this.$el) return;
|
|
137
|
+
if (this.overflowScroll) {
|
|
138
|
+
this.size = 20;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (window.innerWidth <= PHONE_WIDTH) {
|
|
142
|
+
this.size = 10;
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const width = (this.$el as HTMLElement).offsetWidth;
|
|
146
|
+
const sixteen = domHelper.convertRemToPixels(this.itemSize + 0.7);
|
|
147
|
+
this.size = Math.floor(width / sixteen);
|
|
148
|
+
}
|
|
140
149
|
},
|
|
141
150
|
|
|
142
151
|
mounted() {
|
|
143
|
-
this.handleResize();
|
|
144
152
|
this.fetchNext();
|
|
145
153
|
if (this.displayRubriquage) {
|
|
146
154
|
this.fetchRubriques();
|
|
@@ -200,20 +208,6 @@ export default defineComponent({
|
|
|
200
208
|
}
|
|
201
209
|
this.index += 1;
|
|
202
210
|
},
|
|
203
|
-
handleResize(): void {
|
|
204
|
-
if (!this.$el) return;
|
|
205
|
-
if (this.overflowScroll) {
|
|
206
|
-
this.size = 20;
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (window.innerWidth <= PHONE_WIDTH) {
|
|
210
|
-
this.size = 10;
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
const width = (this.$el as HTMLElement).offsetWidth;
|
|
214
|
-
const sixteen = domHelper.convertRemToPixels(this.itemSize + 0.7);
|
|
215
|
-
this.size = Math.floor(width / sixteen);
|
|
216
|
-
},
|
|
217
211
|
reset(): void {
|
|
218
212
|
this.loading = true;
|
|
219
213
|
this.loaded = true;
|
|
@@ -55,6 +55,7 @@ import ClassicLoading from "../../form/ClassicLoading.vue";
|
|
|
55
55
|
import { state } from "../../../stores/ParamSdkStore";
|
|
56
56
|
import PaginateParams from "./PaginateParams.vue";
|
|
57
57
|
import PaginateSection from "./PaginateSection.vue";
|
|
58
|
+
import resizePhone from "../../mixins/resizePhone";
|
|
58
59
|
import { defineComponent } from "vue";
|
|
59
60
|
export default defineComponent({
|
|
60
61
|
name: "ListPaginate",
|
|
@@ -63,6 +64,7 @@ export default defineComponent({
|
|
|
63
64
|
PaginateParams,
|
|
64
65
|
ClassicLoading,
|
|
65
66
|
},
|
|
67
|
+
mixins: [resizePhone],
|
|
66
68
|
props: {
|
|
67
69
|
first: { default: 0, type: Number },
|
|
68
70
|
rowsPerPage: { default: 30, type: Number },
|
|
@@ -79,16 +81,14 @@ export default defineComponent({
|
|
|
79
81
|
emits: ["update:first", "update:rowsPerPage", "update:isMobile"],
|
|
80
82
|
data() {
|
|
81
83
|
return {
|
|
82
|
-
|
|
84
|
+
isPhone: false as boolean,
|
|
85
|
+
windowWidth: 0 as number
|
|
83
86
|
};
|
|
84
87
|
},
|
|
85
88
|
computed: {
|
|
86
89
|
buttonPlus(): boolean {
|
|
87
90
|
return state.generalParameters.buttonPlus as boolean;
|
|
88
91
|
},
|
|
89
|
-
isPhone() {
|
|
90
|
-
return 960 >= this.windowWidth;
|
|
91
|
-
},
|
|
92
92
|
rangeSize() {
|
|
93
93
|
if (this.windowWidth > 1600) {
|
|
94
94
|
return 3;
|
|
@@ -104,18 +104,7 @@ export default defineComponent({
|
|
|
104
104
|
},
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
|
-
mounted() {
|
|
108
|
-
this.$nextTick(() => {
|
|
109
|
-
window.addEventListener("resize", this.onResize);
|
|
110
|
-
});
|
|
111
|
-
},
|
|
112
|
-
beforeUnmount() {
|
|
113
|
-
window.removeEventListener("resize", this.onResize);
|
|
114
|
-
},
|
|
115
107
|
methods: {
|
|
116
|
-
onResize() {
|
|
117
|
-
this.windowWidth = window.innerWidth;
|
|
118
|
-
},
|
|
119
108
|
fetchMore() {
|
|
120
109
|
this.$emit("update:first", this.first + this.rowsPerPage);
|
|
121
110
|
},
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
<div class="position-relative">
|
|
3
|
+
<template v-if="!isPhone">
|
|
4
|
+
<button class="btn-transparent swiper-button-prev" v-show="isLoop" @click="slidePrevButton()"></button>
|
|
5
|
+
<swiper
|
|
6
|
+
:slides-per-view="numberItem"
|
|
7
|
+
:space-between="0"
|
|
8
|
+
:loop="isLoop"
|
|
9
|
+
:navigation="true"
|
|
10
|
+
:modules="modules"
|
|
11
|
+
>
|
|
12
|
+
<swiper-slide v-for="(obj, index) in listObject" :key="obj">
|
|
13
|
+
<slot name="octopusSlide" :option="obj" :index="index" />
|
|
14
|
+
</swiper-slide>
|
|
15
|
+
</swiper>
|
|
16
|
+
</template>
|
|
17
|
+
<div class="element-list-inline" v-else>
|
|
18
|
+
<div v-for="(obj, index) in listObject" :key="obj">
|
|
19
|
+
<slot name="octopusSlide" :option="obj" :index="index" />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
13
23
|
</template>
|
|
14
24
|
|
|
15
25
|
<script lang="ts">
|
|
@@ -19,6 +29,7 @@ import { Swiper, SwiperSlide } from "swiper/vue";
|
|
|
19
29
|
import { Navigation } from "swiper/modules";
|
|
20
30
|
import "swiper/css";
|
|
21
31
|
import "swiper/css/navigation";
|
|
32
|
+
import resizePhone from "../../mixins/resizePhone";
|
|
22
33
|
import { defineComponent } from "vue";
|
|
23
34
|
export default defineComponent({
|
|
24
35
|
name: "SwiperList",
|
|
@@ -27,6 +38,7 @@ export default defineComponent({
|
|
|
27
38
|
Swiper,
|
|
28
39
|
SwiperSlide,
|
|
29
40
|
},
|
|
41
|
+
mixins:[resizePhone],
|
|
30
42
|
|
|
31
43
|
props: {
|
|
32
44
|
listObject: { default: () => [], type: Array as () => Array<unknown> },
|
|
@@ -37,6 +49,8 @@ export default defineComponent({
|
|
|
37
49
|
return {
|
|
38
50
|
modules: [Navigation],
|
|
39
51
|
numberItem: 5 as number,
|
|
52
|
+
isPhone: false as boolean,
|
|
53
|
+
windowWidth: 0 as number
|
|
40
54
|
};
|
|
41
55
|
},
|
|
42
56
|
computed: {
|
|
@@ -44,31 +58,29 @@ export default defineComponent({
|
|
|
44
58
|
if (this.sizeItemOverload) {
|
|
45
59
|
return this.sizeItemOverload;
|
|
46
60
|
}
|
|
47
|
-
if (
|
|
61
|
+
if (this.windowWidth <= 450) {
|
|
48
62
|
return 12.5;
|
|
49
63
|
}
|
|
50
64
|
return state.generalParameters.podcastItem
|
|
51
65
|
? state.generalParameters.podcastItem
|
|
52
66
|
: 13.5;
|
|
53
67
|
},
|
|
68
|
+
isLoop():boolean{
|
|
69
|
+
return this.listObject.length >= this.numberItem;
|
|
70
|
+
},
|
|
54
71
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
window.addEventListener("resize", this.handleResize);
|
|
58
|
-
},
|
|
59
|
-
unmounted() {
|
|
60
|
-
window.removeEventListener("resize", this.handleResize);
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
mounted() {
|
|
64
|
-
this.handleResize();
|
|
65
|
-
},
|
|
66
|
-
methods: {
|
|
67
|
-
handleResize(): void {
|
|
72
|
+
watch:{
|
|
73
|
+
windowWidth(){
|
|
68
74
|
if (!this.$el) return;
|
|
69
75
|
const width = (this.$el as HTMLElement).offsetWidth - 95;
|
|
70
76
|
const sixteen = domHelper.convertRemToPixels(this.sizeItem + 0.5);
|
|
71
77
|
this.numberItem = Math.max(1, Math.floor(width / sixteen));
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
methods: {
|
|
82
|
+
slidePrevButton(){
|
|
83
|
+
this.$el.querySelector(".swiper").swiper.slidePrev();
|
|
72
84
|
},
|
|
73
85
|
},
|
|
74
86
|
});
|
|
@@ -91,23 +103,14 @@ export default defineComponent({
|
|
|
91
103
|
right: 0;
|
|
92
104
|
}
|
|
93
105
|
.swiper-button-prev {
|
|
94
|
-
left:
|
|
95
|
-
}
|
|
96
|
-
/* .swiper-slide-active{
|
|
97
|
-
padding-left:27px;
|
|
98
|
-
@media (max-width: 550px) {
|
|
99
|
-
padding-left:0;
|
|
100
|
-
}
|
|
106
|
+
left: -35px;
|
|
101
107
|
}
|
|
102
|
-
.swiper-slide-next{
|
|
103
|
-
padding-right:27px;
|
|
104
|
-
} */
|
|
105
108
|
.swiper-button-lock {
|
|
106
109
|
display: flex;
|
|
107
110
|
}
|
|
108
111
|
.swiper-slide {
|
|
109
112
|
display: flex;
|
|
110
|
-
justify-content: center;
|
|
113
|
+
/* justify-content: center; */
|
|
111
114
|
align-items: center;
|
|
112
115
|
}
|
|
113
116
|
</style>
|
|
@@ -61,6 +61,7 @@ const PHONE_WIDTH = 960;
|
|
|
61
61
|
import { state } from "../../../stores/ParamSdkStore";
|
|
62
62
|
import { Podcast } from "@/stores/class/general/podcast";
|
|
63
63
|
import { Playlist } from "@/stores/class/general/playlist";
|
|
64
|
+
import resizePhone from "../../mixins/resizePhone";
|
|
64
65
|
import { defineComponent } from "vue";
|
|
65
66
|
export default defineComponent({
|
|
66
67
|
name: "PodcastPlaylistInlineList",
|
|
@@ -69,6 +70,7 @@ export default defineComponent({
|
|
|
69
70
|
PodcastItem,
|
|
70
71
|
ClassicLoading,
|
|
71
72
|
},
|
|
73
|
+
mixins: [resizePhone],
|
|
72
74
|
|
|
73
75
|
props: {
|
|
74
76
|
playlistId: { default: undefined, type: Number },
|
|
@@ -85,6 +87,8 @@ export default defineComponent({
|
|
|
85
87
|
allPodcasts: [] as Array<Podcast>,
|
|
86
88
|
direction: 1 as number,
|
|
87
89
|
alignLeft: false as boolean,
|
|
90
|
+
isPhone: false as boolean,
|
|
91
|
+
windowWidth: 0 as number
|
|
88
92
|
};
|
|
89
93
|
},
|
|
90
94
|
computed: {
|
|
@@ -120,18 +124,23 @@ export default defineComponent({
|
|
|
120
124
|
this.reset();
|
|
121
125
|
this.fetchContent();
|
|
122
126
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
windowWidth(){
|
|
128
|
+
if (!this.$el) return;
|
|
129
|
+
if (this.overflowScroll) {
|
|
130
|
+
this.size = 20;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (this.windowWidth <= PHONE_WIDTH) {
|
|
134
|
+
this.size = 10;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const width = (this.$el as HTMLElement).offsetWidth;
|
|
138
|
+
const sixteen = domHelper.convertRemToPixels(this.sizeItem + 0.8);
|
|
139
|
+
this.size = Math.floor(width / sixteen);
|
|
140
|
+
}
|
|
131
141
|
},
|
|
132
142
|
|
|
133
143
|
mounted() {
|
|
134
|
-
this.handleResize();
|
|
135
144
|
this.fetchContent();
|
|
136
145
|
},
|
|
137
146
|
methods: {
|
|
@@ -175,20 +184,6 @@ export default defineComponent({
|
|
|
175
184
|
if (!this.nextAvailable) return;
|
|
176
185
|
this.index += 1;
|
|
177
186
|
},
|
|
178
|
-
handleResize(): void {
|
|
179
|
-
if (!this.$el) return;
|
|
180
|
-
if (this.overflowScroll) {
|
|
181
|
-
this.size = 20;
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
if (window.innerWidth <= PHONE_WIDTH) {
|
|
185
|
-
this.size = 10;
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
const width = (this.$el as HTMLElement).offsetWidth;
|
|
189
|
-
const sixteen = domHelper.convertRemToPixels(this.sizeItem + 0.7);
|
|
190
|
-
this.size = Math.floor(width / sixteen);
|
|
191
|
-
},
|
|
192
187
|
reset(): void {
|
|
193
188
|
this.index = 0;
|
|
194
189
|
this.first = 0;
|
|
@@ -58,6 +58,7 @@ import { mapState } from "pinia";
|
|
|
58
58
|
import { state } from "../../../stores/ParamSdkStore";
|
|
59
59
|
import { Podcast } from "@/stores/class/general/podcast";
|
|
60
60
|
import imageProxy from "../../mixins/imageProxy";
|
|
61
|
+
import resizePhone from "../../mixins/resizePhone";
|
|
61
62
|
import { defineComponent } from "vue";
|
|
62
63
|
export default defineComponent({
|
|
63
64
|
name: "PodcastInlineListClassic",
|
|
@@ -67,7 +68,7 @@ export default defineComponent({
|
|
|
67
68
|
ClassicLoading,
|
|
68
69
|
PodcastInlineListTemplate,
|
|
69
70
|
},
|
|
70
|
-
mixins: [imageProxy],
|
|
71
|
+
mixins: [imageProxy, resizePhone],
|
|
71
72
|
props: {
|
|
72
73
|
organisationId: { default: () => [], type: Array as () => Array<string> },
|
|
73
74
|
emissionId: { default: undefined, type: Number },
|
|
@@ -97,6 +98,8 @@ export default defineComponent({
|
|
|
97
98
|
allPodcasts: [] as Array<Podcast>,
|
|
98
99
|
direction: 1 as number,
|
|
99
100
|
alignLeft: false as boolean,
|
|
101
|
+
isPhone: false as boolean,
|
|
102
|
+
windowWidth: 0 as number
|
|
100
103
|
};
|
|
101
104
|
},
|
|
102
105
|
computed: {
|
|
@@ -139,6 +142,20 @@ export default defineComponent({
|
|
|
139
142
|
this.reset();
|
|
140
143
|
this.fetchNext();
|
|
141
144
|
},
|
|
145
|
+
windowWidth(){
|
|
146
|
+
if (!this.$el) return;
|
|
147
|
+
if (this.overflowScroll) {
|
|
148
|
+
this.size = 20;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (this.windowWidth <= PHONE_WIDTH) {
|
|
152
|
+
this.size = 10;
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const width = (this.$el as HTMLElement).offsetWidth;
|
|
156
|
+
const sixteen = domHelper.convertRemToPixels(this.sizeItem + 0.8);
|
|
157
|
+
this.size = Math.floor(width / sixteen);
|
|
158
|
+
}
|
|
142
159
|
},
|
|
143
160
|
|
|
144
161
|
created() {
|
|
@@ -148,15 +165,9 @@ export default defineComponent({
|
|
|
148
165
|
if (undefined !== this.isArrow) {
|
|
149
166
|
this.$emit("update:isArrow", true);
|
|
150
167
|
}
|
|
151
|
-
window.addEventListener("resize", this.handleResize);
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
unmounted() {
|
|
155
|
-
window.removeEventListener("resize", this.handleResize);
|
|
156
168
|
},
|
|
157
169
|
|
|
158
170
|
mounted() {
|
|
159
|
-
this.handleResize();
|
|
160
171
|
this.fetchNext();
|
|
161
172
|
},
|
|
162
173
|
methods: {
|
|
@@ -248,20 +259,7 @@ export default defineComponent({
|
|
|
248
259
|
}
|
|
249
260
|
this.index += 1;
|
|
250
261
|
},
|
|
251
|
-
|
|
252
|
-
if (!this.$el) return;
|
|
253
|
-
if (this.overflowScroll) {
|
|
254
|
-
this.size = 20;
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (window.innerWidth <= PHONE_WIDTH) {
|
|
258
|
-
this.size = 10;
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
const width = (this.$el as HTMLElement).offsetWidth;
|
|
262
|
-
const sixteen = domHelper.convertRemToPixels(this.sizeItem + 0.8);
|
|
263
|
-
this.size = Math.floor(width / sixteen);
|
|
264
|
-
},
|
|
262
|
+
|
|
265
263
|
sortPopular(): void {
|
|
266
264
|
if (this.popularSort) return;
|
|
267
265
|
this.popularSort = true;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
import { defineComponent } from 'vue';
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
data() {
|
|
5
|
+
return {
|
|
6
|
+
isPhone: false as boolean,
|
|
7
|
+
windowWidth: 0 as number
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
created() {
|
|
11
|
+
window.addEventListener('resize', this.handleResize);
|
|
12
|
+
this.handleResize();
|
|
13
|
+
},
|
|
14
|
+
unmounted() {
|
|
15
|
+
window.removeEventListener('resize', this.handleResize);
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
handleResize(): void {
|
|
19
|
+
this.windowWidth= window.innerWidth;
|
|
20
|
+
this.isPhone =this.windowWidth < 960;
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|