@seresweb/website-component 2.0.1 → 2.1.0
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/cjs/horizontal-viewer.cjs +1 -1
- package/dist/cjs/image-indicator.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/swiper-normal.cjs +1 -1
- package/dist/cjs/video.cjs +1 -1
- package/dist/css/horizontal-viewer.css +1 -1
- package/dist/css/swiper-vehicle.css +1 -1
- package/dist/css/video.css +1 -1
- package/dist/es/horizontal-viewer.mjs +1 -1
- package/dist/es/image-indicator.mjs +1 -1
- package/dist/es/index.mjs +1 -1
- package/dist/es/swiper-normal.mjs +1 -1
- package/dist/es/video.mjs +221 -194
- package/dist/index-BVX78e_m.cjs +1 -0
- package/dist/index-C6ZSfMR8.js +561 -0
- package/dist/index.css +1 -1
- package/dist/scss/horizontal-viewer.scss +16 -1
- package/dist/scss/swiper-vehicle.scss +2 -2
- package/dist/scss/video.scss +11 -0
- package/dist/types/components/horizontal-viewer/pc-viewer.vue.d.ts +6 -1
- package/dist/types/components/horizontal-viewer/type.d.ts +2 -0
- package/dist/types/components/image-indicator/type.d.ts +1 -0
- package/dist/types/components/video/type.d.ts +10 -1
- package/dist/types/components/video/video-wrapper.vue.d.ts +6 -6
- package/dist/types/components/video/video.vue.d.ts +186 -34
- package/package.json +1 -1
- package/dist/index-CM1T0AYM.js +0 -536
- package/dist/index-DL7IXrBi.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),H=require("./index-DrnEpWXW.cjs"),r=require("./_vars-CyrPevgT.cjs");require("./cjs/accordion-info-panel.cjs");require("./cjs/animated-number.cjs");require("./cjs/drawer.cjs");require("./cjs/dropdown.cjs");require("./cjs/gradual-highlight.cjs");const X=require("@vavt/util");require("./cjs/input.cjs");const S=require("./cjs/layz-image.cjs");require("./cjs/parameter-box.cjs");require("./cjs/radio.cjs");const q=require("./cjs/tab-indicator.cjs"),$=require("./cjs/video.cjs"),W=["innerHTML"],O=["innerHTML"],U=["innerHTML"],D=["innerHTML"],A=e.defineComponent({__name:"pc-viewer",props:{title:{},desc:{},dataList:{},extraTopSpacing:{default:0},extraBottomSpacing:{default:0}},setup(l){const p=l,a=e.ref(),v=e.ref(),o=e.ref(),d=e.ref(),f=e.ref(),i=e.ref(),h=e.reactive({container:"",root:"",item:""}),u=n=>typeof n!="number"||Number.isNaN(n)?0:n,g=(n,s,c)=>{const k=Math.min(Math.max(n,0),c),_=Math.min(Math.max(s,0),Math.max(c-k,0));return{safeTop:k,safeBottom:_}},B=()=>{var b;if(!o.value)return;const n=o.value.offsetHeight,s=window.innerHeight,c=((b=i.value)==null?void 0:b.offsetHeight)||0,k=m(i.value),_=u(p.extraTopSpacing),E=u(p.extraBottomSpacing),{safeTop:I,safeBottom:L}=g(_,E,s),C=Math.max(s-I-L,0),z=Math.max((C-c-n-k)/2,0),M=I+z,N=L+z;h.container=`padding-top: ${M}px; padding-bottom: ${N}px; min-height: ${s}px;`;const x=o.value.scrollWidth;h.root=`height: ${Math.max(x,s)}px`},t=()=>{const n=document.documentElement.getAttribute("dir")||"ltr",s=n==="rtl"?"right":"left";if(!a.value||!o.value||!d.value||!f.value)return;const k=a.value.clientHeight-window.innerHeight,{offsetTop:_}=X.getRootOffset(a.value),E=document.documentElement.scrollTop-_;if(E<0){o.value.scrollTo({left:0}),f.value.style[s]="0px";return}if(E>k){const z=o.value.scrollWidth-window.innerWidth;o.value.scrollTo({left:n==="rtl"?-z:z}),f.value.style[s]=d.value.clientWidth-f.value.clientWidth+"px";return}const I=E/k,L=I*(o.value.scrollWidth-window.innerWidth),C=I*(d.value.clientWidth*2/3);o.value.scrollTo({left:n==="rtl"?-L:L}),f.value.style[s]=`${C}px`},w=()=>{h.container="",B()},m=n=>{if(!(n instanceof HTMLElement))return 0;const s=window.getComputedStyle(n),c=parseFloat(s.marginTop)||0,k=parseFloat(s.marginBottom)||0;return c+k};let y;return e.watch(()=>[p.extraTopSpacing,p.extraBottomSpacing],()=>{h.container="",B()}),e.onMounted(()=>{y=new IntersectionObserver(n=>{n.forEach(s=>{s.isIntersecting&&(h.container="",B())})},{root:null,rootMargin:"200px 0px 200px 0px",threshold:0}),window.addEventListener("scroll",t),window.addEventListener("resize",w),a.value&&y.observe(a.value)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",w),y&&y.disconnect()}),(n,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer`),style:e.normalizeStyle(h.root)},[e.createElementVNode("div",{ref_key:"containerRef",ref:v,class:e.normalizeClass([`${e.unref(r.PREFIX)}-horizontal-viewer__container`,(n.title||n.desc)&&"has-header"]),style:e.normalizeStyle(h.container)},[n.title||n.desc?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer__header`),ref_key:"headerRef",ref:i},[n.title?(e.openBlock(),e.createElementBlock("p",{key:0,innerHTML:n.title},null,8,W)):e.createCommentVNode("v-if",!0),n.desc?(e.openBlock(),e.createElementBlock("p",{key:1,innerHTML:n.desc},null,8,O)):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"scrollerRef",ref:o,class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer__scroller`)},[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer__content`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataList,c=>(e.openBlock(),e.createElementBlock("div",{key:c.title,class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer__content-item`)},[c.type==="img"?(e.openBlock(),e.createBlock(e.unref(S.ScLayzImage),{key:0,src:c.url,alt:c.alt},null,8,["src","alt"])):(e.openBlock(),e.createBlock(e.unref($.ScVideo),{key:1,url:c.url,poster:c.poster,"auto-play":!1},null,8,["url","poster"])),e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer__content-item-footer`)},[e.createElementVNode("p",{innerHTML:c.title},null,8,U),e.createElementVNode("p",{innerHTML:c.desc},null,8,D)],2)],2))),128))],2)],2),e.createElementVNode("div",{ref_key:"paginationRef",ref:d,class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer__pagination`)},[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer__scrollbar`)},[e.createElementVNode("div",{ref_key:"scrollbarDragRef",ref:f,class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer__scrollbar-drag`)},null,2)],2)],2)],6)],6))}}),Y=e.defineComponent({__name:"mb-viewer",props:{title:{},desc:{},isMobile:{type:Boolean},extraTopSpacing:{},extraBottomSpacing:{},modelValue:{},dataList:{},swiperOptions:{},effect:{},showIntro:{type:Boolean},videoProps:{},indicatorClass:{},tabIndicatorBottom:{},widthType:{},indicatorType:{},showIndicator:{type:Boolean},indicatorPosition:{}},setup(l){const p=l,a=e.ref();return(v,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass(`${e.unref(r.PREFIX)}-horizontal-viewer-mb`)},[e.createVNode(e.unref(F),e.mergeProps(p,{indicatorType:"image"}),null,16)],2))}}),R=e.defineComponent({__name:"horizontal-viewer",props:{title:{},desc:{},isMobile:{type:Boolean},extraTopSpacing:{},extraBottomSpacing:{},modelValue:{},dataList:{},swiperOptions:{},effect:{},showIntro:{type:Boolean},videoProps:{},indicatorClass:{},tabIndicatorBottom:{},widthType:{},indicatorType:{},showIndicator:{type:Boolean,default:!0},indicatorPosition:{}},setup(l){const p=l;return(a,v)=>a.isMobile?(e.openBlock(),e.createBlock(Y,e.normalizeProps(e.mergeProps({key:0},p)),null,16)):(e.openBlock(),e.createBlock(A,e.normalizeProps(e.mergeProps({key:1},p)),null,16))}});R.install=l=>(l.component("ScHorizontalViewer",R),l);const Z=R,j=["onClick"],G=["innerHTML"],J=["innerHTML"],V=e.defineComponent({__name:"image-indicator",props:{dataList:{},showIntro:{type:Boolean,default:!0}},emits:["change"],setup(l,{emit:p}){const a=p,v=e.ref(0),o=e.ref([]),d=e.computed(()=>{const i=o.value[v.value];return{height:`${i==null?void 0:i.offsetHeight}px`}}),f=i=>{v.value=i,a("change",i)};return(i,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`${e.unref(r.PREFIX)}-image-indicator`)},[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(r.PREFIX)}-image-indicator__list`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,(u,g)=>(e.openBlock(),e.createElementBlock("div",{key:u.url,class:e.normalizeClass([`${e.unref(r.PREFIX)}-image-indicator__list-item`,v.value===g?`${e.unref(r.PREFIX)}-image-indicator__active`:""]),onClick:B=>f(g)},[e.createVNode(e.unref(S.ScLayzImage),{src:u.url,alt:u.alt},null,8,["src","alt"])],10,j))),128))],2),i.showIntro?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${e.unref(r.PREFIX)}-image-indicator__intro`),style:e.normalizeStyle(d.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,(u,g)=>(e.openBlock(),e.createElementBlock("div",{key:u.url,ref_for:!0,ref_key:"introItemRef",ref:o,class:e.normalizeClass([`${e.unref(r.PREFIX)}-image-indicator__intro-item`,v.value===g&&`${e.unref(r.PREFIX)}-image-indicator__active`])},[u.title?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(`${e.unref(r.PREFIX)}-image-indicator__intro-title`),innerHTML:u.title},null,10,G)):e.createCommentVNode("v-if",!0),u.desc?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(`${e.unref(r.PREFIX)}-image-indicator__intro-desc`),innerHTML:u.desc},null,10,J)):e.createCommentVNode("v-if",!0)],2))),128))],6)):e.createCommentVNode("v-if",!0)],2))}});V.install=l=>(l.component("ScImageIndicator",V),l);const T=V,K={class:"swiper-wrapper"},P=e.defineComponent({__name:"swiper-normal",props:{modelValue:{default:0},dataList:{},swiperOptions:{default:()=>({})},effect:{},showIntro:{type:Boolean,default:!0},videoProps:{},indicatorClass:{},tabIndicatorBottom:{},widthType:{default:"full"},indicatorType:{default:"tab"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{default:"relative"}},emits:["change","update:modelValue"],setup(l,{emit:p}){const a=l,v=p;let o=null;const d=e.ref(a.modelValue),f=e.ref(),i=e.computed(()=>{const t=[`${r.PREFIX}-swiper-main`];return a.widthType==="middle"?t.push(`${r.PREFIX}-swiper-main__middle`):t.push(`${r.PREFIX}-swiper-main__full`),t}),h=e.computed(()=>{const t={};return a.tabIndicatorBottom&&(t.position="absolute",t.zIndex=1,t.bottom=typeof a.tabIndicatorBottom=="number"?`${a.tabIndicatorBottom}px`:a.tabIndicatorBottom),t});e.watch(()=>a.modelValue,()=>{d.value=a.modelValue,g(d.value)});const u=e.computed(()=>a.dataList.map(t=>({...t,url:t.type==="img"?t.url||"":t.poster||""}))),g=t=>{o==null||o.slideTo(t)},B=()=>{o==null||o.destroy(),f.value&&(o=new H.Swiper(f.value,{slidesPerView:1,allowTouchMove:!1,effect:a.effect,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},...a.swiperOptions}),o.on("slideChange",t=>{d.value=t.activeIndex,v("change",t.activeIndex),v("update:modelValue",t.activeIndex)}))};return e.onMounted(()=>{B(),window.addEventListener("resize",B)}),e.onBeforeUnmount(()=>{o==null||o.destroy(),window.removeEventListener("resize",B)}),(t,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`${e.unref(r.PREFIX)}-swiper`)},[e.createElementVNode("div",{ref_key:"swiperRef",ref:f,class:e.normalizeClass(i.value)},[e.createElementVNode("div",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataList,(m,y)=>(e.openBlock(),e.createElementBlock("div",{key:m.title,class:"swiper-slide"},[m.type==="img"?(e.openBlock(),e.createBlock(e.unref(S.ScLayzImage),{key:0,src:m.url,alt:m.alt},null,8,["src","alt"])):(e.openBlock(),e.createBlock(e.unref($.ScVideo),e.mergeProps({key:1,ref_for:!0},t.videoProps,{url:m.url,poster:m.poster,playable:d.value===y}),null,16,["url","poster","playable"])),m.mask?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(`${e.unref(r.PREFIX)}-swiper-mask`)},null,2)):e.createCommentVNode("v-if",!0)]))),128))]),w[2]||(w[2]=e.createStaticVNode('<div class="swiper-button-next"><svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none"><path d="M9.64299 3.12871L9.51887 5.83301L15.6859 12L9.51887 18.167L9.64299 20.8713L18.5143 12L9.64299 3.12871Z" fill="white"></path></svg></div><div class="swiper-button-prev"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M15.1289 3.12871L15.2531 5.83301L9.08609 12L15.2531 18.167L15.1289 20.8713L6.25766 12L15.1289 3.12871Z" fill="white"></path></svg></div>',2))],2),t.showIndicator?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.indicatorType==="tab"?(e.openBlock(),e.createBlock(e.unref(q.ScTabIndicator),{key:0,modelValue:d.value,"onUpdate:modelValue":w[0]||(w[0]=m=>d.value=m),class:e.normalizeClass([t.indicatorClass,t.indicatorPosition==="absolute"&&`${e.unref(r.PREFIX)}-swiper-indicator-absolute`]),dataList:t.dataList,"show-intro":t.showIntro,style:e.normalizeStyle(h.value),onChange:g},null,8,["modelValue","class","dataList","show-intro","style"])):(e.openBlock(),e.createBlock(e.unref(T),{key:1,modelValue:d.value,"onUpdate:modelValue":w[1]||(w[1]=m=>d.value=m),dataList:u.value,onChange:g},null,8,["modelValue","dataList"]))],64)):e.createCommentVNode("v-if",!0)],2))}});P.install=l=>(l.component("ScSwiperNormal",P),l);const F=P;exports.ScHorizontalViewer=Z;exports.ScImageIndicator=T;exports.ScSwiperNormal=F;
|
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
import { defineComponent as P, ref as y, reactive as te, watch as Z, onMounted as j, onBeforeUnmount as q, createElementBlock as s, openBlock as o, normalizeStyle as E, normalizeClass as l, unref as t, createElementVNode as w, createCommentVNode as S, Fragment as R, renderList as N, createBlock as I, createVNode as G, mergeProps as W, normalizeProps as Y, computed as C, createStaticVNode as oe } from "vue";
|
|
2
|
+
import { a as ne } from "./index-BrggpRcU.js";
|
|
3
|
+
import { P as i } from "./_vars-BV4QQF-p.js";
|
|
4
|
+
import "./es/accordion-info-panel.mjs";
|
|
5
|
+
import "./es/animated-number.mjs";
|
|
6
|
+
import "./es/drawer.mjs";
|
|
7
|
+
import "./es/dropdown.mjs";
|
|
8
|
+
import "./es/gradual-highlight.mjs";
|
|
9
|
+
import { getRootOffset as re } from "@vavt/util";
|
|
10
|
+
import "./es/input.mjs";
|
|
11
|
+
import { ScLayzImage as A } from "./es/layz-image.mjs";
|
|
12
|
+
import "./es/parameter-box.mjs";
|
|
13
|
+
import "./es/radio.mjs";
|
|
14
|
+
import { ScTabIndicator as ie } from "./es/tab-indicator.mjs";
|
|
15
|
+
import { ScVideo as J } from "./es/video.mjs";
|
|
16
|
+
const ae = ["innerHTML"], le = ["innerHTML"], se = ["innerHTML"], ce = ["innerHTML"], de = /* @__PURE__ */ P({
|
|
17
|
+
__name: "pc-viewer",
|
|
18
|
+
props: {
|
|
19
|
+
title: {},
|
|
20
|
+
desc: {},
|
|
21
|
+
dataList: {},
|
|
22
|
+
extraTopSpacing: { default: 0 },
|
|
23
|
+
extraBottomSpacing: { default: 0 }
|
|
24
|
+
},
|
|
25
|
+
setup(c) {
|
|
26
|
+
const v = c, a = y(), _ = y(), n = y(), f = y(), g = y(), d = y(), L = te({
|
|
27
|
+
container: "",
|
|
28
|
+
root: "",
|
|
29
|
+
item: ""
|
|
30
|
+
}), m = (r) => typeof r != "number" || Number.isNaN(r) ? 0 : r, b = (r, u, p) => {
|
|
31
|
+
const T = Math.min(Math.max(r, 0), p), M = Math.min(Math.max(u, 0), Math.max(p - T, 0));
|
|
32
|
+
return { safeTop: T, safeBottom: M };
|
|
33
|
+
}, k = () => {
|
|
34
|
+
var X;
|
|
35
|
+
if (!n.value)
|
|
36
|
+
return;
|
|
37
|
+
const r = n.value.offsetHeight, u = window.innerHeight, p = ((X = d.value) == null ? void 0 : X.offsetHeight) || 0, T = h(d.value), M = m(v.extraTopSpacing), x = m(v.extraBottomSpacing), { safeTop: H, safeBottom: z } = b(M, x, u), O = Math.max(u - H - z, 0), V = Math.max((O - p - r - T) / 2, 0), K = H + V, Q = z + V;
|
|
38
|
+
L.container = `padding-top: ${K}px; padding-bottom: ${Q}px; min-height: ${u}px;`;
|
|
39
|
+
const ee = n.value.scrollWidth;
|
|
40
|
+
L.root = `height: ${Math.max(ee, u)}px`;
|
|
41
|
+
}, e = () => {
|
|
42
|
+
const r = document.documentElement.getAttribute("dir") || "ltr", u = r === "rtl" ? "right" : "left";
|
|
43
|
+
if (!a.value || !n.value || !f.value || !g.value) return;
|
|
44
|
+
const T = a.value.clientHeight - window.innerHeight, { offsetTop: M } = re(a.value), x = document.documentElement.scrollTop - M;
|
|
45
|
+
if (x < 0) {
|
|
46
|
+
n.value.scrollTo({ left: 0 }), g.value.style[u] = "0px";
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (x > T) {
|
|
50
|
+
const V = n.value.scrollWidth - window.innerWidth;
|
|
51
|
+
n.value.scrollTo({ left: r === "rtl" ? -V : V }), g.value.style[u] = f.value.clientWidth - g.value.clientWidth + "px";
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const H = x / T, z = H * (n.value.scrollWidth - window.innerWidth), O = H * (f.value.clientWidth * 2 / 3);
|
|
55
|
+
n.value.scrollTo({ left: r === "rtl" ? -z : z }), g.value.style[u] = `${O}px`;
|
|
56
|
+
}, $ = () => {
|
|
57
|
+
L.container = "", k();
|
|
58
|
+
}, h = (r) => {
|
|
59
|
+
if (!(r instanceof HTMLElement))
|
|
60
|
+
return 0;
|
|
61
|
+
const u = window.getComputedStyle(r), p = parseFloat(u.marginTop) || 0, T = parseFloat(u.marginBottom) || 0;
|
|
62
|
+
return p + T;
|
|
63
|
+
};
|
|
64
|
+
let B;
|
|
65
|
+
return Z(
|
|
66
|
+
() => [v.extraTopSpacing, v.extraBottomSpacing],
|
|
67
|
+
() => {
|
|
68
|
+
L.container = "", k();
|
|
69
|
+
}
|
|
70
|
+
), j(() => {
|
|
71
|
+
B = new IntersectionObserver(
|
|
72
|
+
(r) => {
|
|
73
|
+
r.forEach((u) => {
|
|
74
|
+
u.isIntersecting && (L.container = "", k());
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
root: null,
|
|
79
|
+
// 相对于 viewport
|
|
80
|
+
rootMargin: "200px 0px 200px 0px",
|
|
81
|
+
// 提前100px触发
|
|
82
|
+
threshold: 0
|
|
83
|
+
}
|
|
84
|
+
), window.addEventListener("scroll", e), window.addEventListener("resize", $), a.value && B.observe(a.value);
|
|
85
|
+
}), q(() => {
|
|
86
|
+
window.removeEventListener("scroll", e), window.removeEventListener("resize", $), B && B.disconnect();
|
|
87
|
+
}), (r, u) => (o(), s(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
ref_key: "rootRef",
|
|
91
|
+
ref: a,
|
|
92
|
+
class: l(`${t(i)}-horizontal-viewer`),
|
|
93
|
+
style: E(L.root)
|
|
94
|
+
},
|
|
95
|
+
[
|
|
96
|
+
w(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
ref_key: "containerRef",
|
|
100
|
+
ref: _,
|
|
101
|
+
class: l([`${t(i)}-horizontal-viewer__container`, (r.title || r.desc) && "has-header"]),
|
|
102
|
+
style: E(L.container)
|
|
103
|
+
},
|
|
104
|
+
[
|
|
105
|
+
r.title || r.desc ? (o(), s(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
key: 0,
|
|
109
|
+
class: l(`${t(i)}-horizontal-viewer__header`),
|
|
110
|
+
ref_key: "headerRef",
|
|
111
|
+
ref: d
|
|
112
|
+
},
|
|
113
|
+
[
|
|
114
|
+
r.title ? (o(), s("p", {
|
|
115
|
+
key: 0,
|
|
116
|
+
innerHTML: r.title
|
|
117
|
+
}, null, 8, ae)) : S("v-if", !0),
|
|
118
|
+
r.desc ? (o(), s("p", {
|
|
119
|
+
key: 1,
|
|
120
|
+
innerHTML: r.desc
|
|
121
|
+
}, null, 8, le)) : S("v-if", !0)
|
|
122
|
+
],
|
|
123
|
+
2
|
|
124
|
+
/* CLASS */
|
|
125
|
+
)) : S("v-if", !0),
|
|
126
|
+
w(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
ref_key: "scrollerRef",
|
|
130
|
+
ref: n,
|
|
131
|
+
class: l(`${t(i)}-horizontal-viewer__scroller`)
|
|
132
|
+
},
|
|
133
|
+
[
|
|
134
|
+
w(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
class: l(`${t(i)}-horizontal-viewer__content`)
|
|
138
|
+
},
|
|
139
|
+
[
|
|
140
|
+
(o(!0), s(
|
|
141
|
+
R,
|
|
142
|
+
null,
|
|
143
|
+
N(r.dataList, (p) => (o(), s(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
key: p.title,
|
|
147
|
+
class: l(`${t(i)}-horizontal-viewer__content-item`)
|
|
148
|
+
},
|
|
149
|
+
[
|
|
150
|
+
p.type === "img" ? (o(), I(t(A), {
|
|
151
|
+
key: 0,
|
|
152
|
+
src: p.url,
|
|
153
|
+
alt: p.alt
|
|
154
|
+
}, null, 8, ["src", "alt"])) : (o(), I(t(J), {
|
|
155
|
+
key: 1,
|
|
156
|
+
url: p.url,
|
|
157
|
+
poster: p.poster,
|
|
158
|
+
"auto-play": !1
|
|
159
|
+
}, null, 8, ["url", "poster"])),
|
|
160
|
+
w(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
class: l(`${t(i)}-horizontal-viewer__content-item-footer`)
|
|
164
|
+
},
|
|
165
|
+
[
|
|
166
|
+
w("p", {
|
|
167
|
+
innerHTML: p.title
|
|
168
|
+
}, null, 8, se),
|
|
169
|
+
w("p", {
|
|
170
|
+
innerHTML: p.desc
|
|
171
|
+
}, null, 8, ce)
|
|
172
|
+
],
|
|
173
|
+
2
|
|
174
|
+
/* CLASS */
|
|
175
|
+
)
|
|
176
|
+
],
|
|
177
|
+
2
|
|
178
|
+
/* CLASS */
|
|
179
|
+
))),
|
|
180
|
+
128
|
|
181
|
+
/* KEYED_FRAGMENT */
|
|
182
|
+
))
|
|
183
|
+
],
|
|
184
|
+
2
|
|
185
|
+
/* CLASS */
|
|
186
|
+
)
|
|
187
|
+
],
|
|
188
|
+
2
|
|
189
|
+
/* CLASS */
|
|
190
|
+
),
|
|
191
|
+
w(
|
|
192
|
+
"div",
|
|
193
|
+
{
|
|
194
|
+
ref_key: "paginationRef",
|
|
195
|
+
ref: f,
|
|
196
|
+
class: l(`${t(i)}-horizontal-viewer__pagination`)
|
|
197
|
+
},
|
|
198
|
+
[
|
|
199
|
+
w(
|
|
200
|
+
"div",
|
|
201
|
+
{
|
|
202
|
+
class: l(`${t(i)}-horizontal-viewer__scrollbar`)
|
|
203
|
+
},
|
|
204
|
+
[
|
|
205
|
+
w(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
ref_key: "scrollbarDragRef",
|
|
209
|
+
ref: g,
|
|
210
|
+
class: l(`${t(i)}-horizontal-viewer__scrollbar-drag`)
|
|
211
|
+
},
|
|
212
|
+
null,
|
|
213
|
+
2
|
|
214
|
+
/* CLASS */
|
|
215
|
+
)
|
|
216
|
+
],
|
|
217
|
+
2
|
|
218
|
+
/* CLASS */
|
|
219
|
+
)
|
|
220
|
+
],
|
|
221
|
+
2
|
|
222
|
+
/* CLASS */
|
|
223
|
+
)
|
|
224
|
+
],
|
|
225
|
+
6
|
|
226
|
+
/* CLASS, STYLE */
|
|
227
|
+
)
|
|
228
|
+
],
|
|
229
|
+
6
|
|
230
|
+
/* CLASS, STYLE */
|
|
231
|
+
));
|
|
232
|
+
}
|
|
233
|
+
}), ue = /* @__PURE__ */ P({
|
|
234
|
+
__name: "mb-viewer",
|
|
235
|
+
props: {
|
|
236
|
+
title: {},
|
|
237
|
+
desc: {},
|
|
238
|
+
isMobile: { type: Boolean },
|
|
239
|
+
extraTopSpacing: {},
|
|
240
|
+
extraBottomSpacing: {},
|
|
241
|
+
modelValue: {},
|
|
242
|
+
dataList: {},
|
|
243
|
+
swiperOptions: {},
|
|
244
|
+
effect: {},
|
|
245
|
+
showIntro: { type: Boolean },
|
|
246
|
+
videoProps: {},
|
|
247
|
+
indicatorClass: {},
|
|
248
|
+
tabIndicatorBottom: {},
|
|
249
|
+
widthType: {},
|
|
250
|
+
indicatorType: {},
|
|
251
|
+
showIndicator: { type: Boolean },
|
|
252
|
+
indicatorPosition: {}
|
|
253
|
+
},
|
|
254
|
+
setup(c) {
|
|
255
|
+
const v = c, a = y();
|
|
256
|
+
return (_, n) => (o(), s(
|
|
257
|
+
"div",
|
|
258
|
+
{
|
|
259
|
+
ref_key: "rootRef",
|
|
260
|
+
ref: a,
|
|
261
|
+
class: l(`${t(i)}-horizontal-viewer-mb`)
|
|
262
|
+
},
|
|
263
|
+
[
|
|
264
|
+
G(
|
|
265
|
+
t(ge),
|
|
266
|
+
W(v, { indicatorType: "image" }),
|
|
267
|
+
null,
|
|
268
|
+
16
|
|
269
|
+
/* FULL_PROPS */
|
|
270
|
+
)
|
|
271
|
+
],
|
|
272
|
+
2
|
|
273
|
+
/* CLASS */
|
|
274
|
+
));
|
|
275
|
+
}
|
|
276
|
+
}), F = /* @__PURE__ */ P({
|
|
277
|
+
__name: "horizontal-viewer",
|
|
278
|
+
props: {
|
|
279
|
+
title: {},
|
|
280
|
+
desc: {},
|
|
281
|
+
isMobile: { type: Boolean },
|
|
282
|
+
extraTopSpacing: {},
|
|
283
|
+
extraBottomSpacing: {},
|
|
284
|
+
modelValue: {},
|
|
285
|
+
dataList: {},
|
|
286
|
+
swiperOptions: {},
|
|
287
|
+
effect: {},
|
|
288
|
+
showIntro: { type: Boolean },
|
|
289
|
+
videoProps: {},
|
|
290
|
+
indicatorClass: {},
|
|
291
|
+
tabIndicatorBottom: {},
|
|
292
|
+
widthType: {},
|
|
293
|
+
indicatorType: {},
|
|
294
|
+
showIndicator: { type: Boolean, default: !0 },
|
|
295
|
+
indicatorPosition: {}
|
|
296
|
+
},
|
|
297
|
+
setup(c) {
|
|
298
|
+
const v = c;
|
|
299
|
+
return (a, _) => a.isMobile ? (o(), I(
|
|
300
|
+
ue,
|
|
301
|
+
Y(W({ key: 0 }, v)),
|
|
302
|
+
null,
|
|
303
|
+
16
|
|
304
|
+
/* FULL_PROPS */
|
|
305
|
+
)) : (o(), I(
|
|
306
|
+
de,
|
|
307
|
+
Y(W({ key: 1 }, v)),
|
|
308
|
+
null,
|
|
309
|
+
16
|
|
310
|
+
/* FULL_PROPS */
|
|
311
|
+
));
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
F.install = (c) => (c.component("ScHorizontalViewer", F), c);
|
|
315
|
+
const Ve = F, pe = ["onClick"], fe = ["innerHTML"], me = ["innerHTML"], D = /* @__PURE__ */ P({
|
|
316
|
+
__name: "image-indicator",
|
|
317
|
+
props: {
|
|
318
|
+
dataList: {},
|
|
319
|
+
showIntro: { type: Boolean, default: !0 }
|
|
320
|
+
},
|
|
321
|
+
emits: ["change"],
|
|
322
|
+
setup(c, { emit: v }) {
|
|
323
|
+
const a = v, _ = y(0), n = y([]), f = C(() => {
|
|
324
|
+
const d = n.value[_.value];
|
|
325
|
+
return {
|
|
326
|
+
height: `${d == null ? void 0 : d.offsetHeight}px`
|
|
327
|
+
};
|
|
328
|
+
}), g = (d) => {
|
|
329
|
+
_.value = d, a("change", d);
|
|
330
|
+
};
|
|
331
|
+
return (d, L) => (o(), s(
|
|
332
|
+
"div",
|
|
333
|
+
{
|
|
334
|
+
class: l(`${t(i)}-image-indicator`)
|
|
335
|
+
},
|
|
336
|
+
[
|
|
337
|
+
w(
|
|
338
|
+
"div",
|
|
339
|
+
{
|
|
340
|
+
class: l(`${t(i)}-image-indicator__list`)
|
|
341
|
+
},
|
|
342
|
+
[
|
|
343
|
+
(o(!0), s(
|
|
344
|
+
R,
|
|
345
|
+
null,
|
|
346
|
+
N(d.dataList, (m, b) => (o(), s("div", {
|
|
347
|
+
key: m.url,
|
|
348
|
+
class: l([
|
|
349
|
+
`${t(i)}-image-indicator__list-item`,
|
|
350
|
+
_.value === b ? `${t(i)}-image-indicator__active` : ""
|
|
351
|
+
]),
|
|
352
|
+
onClick: (k) => g(b)
|
|
353
|
+
}, [
|
|
354
|
+
G(t(A), {
|
|
355
|
+
src: m.url,
|
|
356
|
+
alt: m.alt
|
|
357
|
+
}, null, 8, ["src", "alt"])
|
|
358
|
+
], 10, pe))),
|
|
359
|
+
128
|
|
360
|
+
/* KEYED_FRAGMENT */
|
|
361
|
+
))
|
|
362
|
+
],
|
|
363
|
+
2
|
|
364
|
+
/* CLASS */
|
|
365
|
+
),
|
|
366
|
+
d.showIntro ? (o(), s(
|
|
367
|
+
"div",
|
|
368
|
+
{
|
|
369
|
+
key: 0,
|
|
370
|
+
class: l(`${t(i)}-image-indicator__intro`),
|
|
371
|
+
style: E(f.value)
|
|
372
|
+
},
|
|
373
|
+
[
|
|
374
|
+
(o(!0), s(
|
|
375
|
+
R,
|
|
376
|
+
null,
|
|
377
|
+
N(d.dataList, (m, b) => (o(), s(
|
|
378
|
+
"div",
|
|
379
|
+
{
|
|
380
|
+
key: m.url,
|
|
381
|
+
ref_for: !0,
|
|
382
|
+
ref_key: "introItemRef",
|
|
383
|
+
ref: n,
|
|
384
|
+
class: l([`${t(i)}-image-indicator__intro-item`, _.value === b && `${t(i)}-image-indicator__active`])
|
|
385
|
+
},
|
|
386
|
+
[
|
|
387
|
+
m.title ? (o(), s("p", {
|
|
388
|
+
key: 0,
|
|
389
|
+
class: l(`${t(i)}-image-indicator__intro-title`),
|
|
390
|
+
innerHTML: m.title
|
|
391
|
+
}, null, 10, fe)) : S("v-if", !0),
|
|
392
|
+
m.desc ? (o(), s("p", {
|
|
393
|
+
key: 1,
|
|
394
|
+
class: l(`${t(i)}-image-indicator__intro-desc`),
|
|
395
|
+
innerHTML: m.desc
|
|
396
|
+
}, null, 10, me)) : S("v-if", !0)
|
|
397
|
+
],
|
|
398
|
+
2
|
|
399
|
+
/* CLASS */
|
|
400
|
+
))),
|
|
401
|
+
128
|
|
402
|
+
/* KEYED_FRAGMENT */
|
|
403
|
+
))
|
|
404
|
+
],
|
|
405
|
+
6
|
|
406
|
+
/* CLASS, STYLE */
|
|
407
|
+
)) : S("v-if", !0)
|
|
408
|
+
],
|
|
409
|
+
2
|
|
410
|
+
/* CLASS */
|
|
411
|
+
));
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
D.install = (c) => (c.component("ScImageIndicator", D), c);
|
|
415
|
+
const ve = D, he = { class: "swiper-wrapper" }, U = /* @__PURE__ */ P({
|
|
416
|
+
__name: "swiper-normal",
|
|
417
|
+
props: {
|
|
418
|
+
modelValue: { default: 0 },
|
|
419
|
+
dataList: {},
|
|
420
|
+
swiperOptions: { default: () => ({}) },
|
|
421
|
+
effect: {},
|
|
422
|
+
showIntro: { type: Boolean, default: !0 },
|
|
423
|
+
videoProps: {},
|
|
424
|
+
indicatorClass: {},
|
|
425
|
+
tabIndicatorBottom: {},
|
|
426
|
+
widthType: { default: "full" },
|
|
427
|
+
indicatorType: { default: "tab" },
|
|
428
|
+
showIndicator: { type: Boolean, default: !0 },
|
|
429
|
+
indicatorPosition: { default: "relative" }
|
|
430
|
+
},
|
|
431
|
+
emits: ["change", "update:modelValue"],
|
|
432
|
+
setup(c, { emit: v }) {
|
|
433
|
+
const a = c, _ = v;
|
|
434
|
+
let n = null;
|
|
435
|
+
const f = y(a.modelValue), g = y(), d = C(() => {
|
|
436
|
+
const e = [`${i}-swiper-main`];
|
|
437
|
+
return a.widthType === "middle" ? e.push(`${i}-swiper-main__middle`) : e.push(`${i}-swiper-main__full`), e;
|
|
438
|
+
}), L = C(() => {
|
|
439
|
+
const e = {};
|
|
440
|
+
return a.tabIndicatorBottom && (e.position = "absolute", e.zIndex = 1, e.bottom = typeof a.tabIndicatorBottom == "number" ? `${a.tabIndicatorBottom}px` : a.tabIndicatorBottom), e;
|
|
441
|
+
});
|
|
442
|
+
Z(
|
|
443
|
+
() => a.modelValue,
|
|
444
|
+
() => {
|
|
445
|
+
f.value = a.modelValue, b(f.value);
|
|
446
|
+
}
|
|
447
|
+
);
|
|
448
|
+
const m = C(() => a.dataList.map((e) => ({
|
|
449
|
+
...e,
|
|
450
|
+
url: e.type === "img" ? e.url || "" : e.poster || ""
|
|
451
|
+
}))), b = (e) => {
|
|
452
|
+
n == null || n.slideTo(e);
|
|
453
|
+
}, k = () => {
|
|
454
|
+
n == null || n.destroy(), g.value && (n = new ne(g.value, {
|
|
455
|
+
slidesPerView: 1,
|
|
456
|
+
allowTouchMove: !1,
|
|
457
|
+
effect: a.effect,
|
|
458
|
+
navigation: {
|
|
459
|
+
nextEl: ".swiper-button-next",
|
|
460
|
+
prevEl: ".swiper-button-prev"
|
|
461
|
+
},
|
|
462
|
+
...a.swiperOptions
|
|
463
|
+
}), n.on("slideChange", (e) => {
|
|
464
|
+
f.value = e.activeIndex, _("change", e.activeIndex), _("update:modelValue", e.activeIndex);
|
|
465
|
+
}));
|
|
466
|
+
};
|
|
467
|
+
return j(() => {
|
|
468
|
+
k(), window.addEventListener("resize", k);
|
|
469
|
+
}), q(() => {
|
|
470
|
+
n == null || n.destroy(), window.removeEventListener("resize", k);
|
|
471
|
+
}), (e, $) => (o(), s(
|
|
472
|
+
"div",
|
|
473
|
+
{
|
|
474
|
+
class: l(`${t(i)}-swiper`)
|
|
475
|
+
},
|
|
476
|
+
[
|
|
477
|
+
w(
|
|
478
|
+
"div",
|
|
479
|
+
{
|
|
480
|
+
ref_key: "swiperRef",
|
|
481
|
+
ref: g,
|
|
482
|
+
class: l(d.value)
|
|
483
|
+
},
|
|
484
|
+
[
|
|
485
|
+
w("div", he, [
|
|
486
|
+
(o(!0), s(
|
|
487
|
+
R,
|
|
488
|
+
null,
|
|
489
|
+
N(e.dataList, (h, B) => (o(), s("div", {
|
|
490
|
+
key: h.title,
|
|
491
|
+
class: "swiper-slide"
|
|
492
|
+
}, [
|
|
493
|
+
h.type === "img" ? (o(), I(t(A), {
|
|
494
|
+
key: 0,
|
|
495
|
+
src: h.url,
|
|
496
|
+
alt: h.alt
|
|
497
|
+
}, null, 8, ["src", "alt"])) : (o(), I(t(J), W({
|
|
498
|
+
key: 1,
|
|
499
|
+
ref_for: !0
|
|
500
|
+
}, e.videoProps, {
|
|
501
|
+
url: h.url,
|
|
502
|
+
poster: h.poster,
|
|
503
|
+
playable: f.value === B
|
|
504
|
+
}), null, 16, ["url", "poster", "playable"])),
|
|
505
|
+
h.mask ? (o(), s(
|
|
506
|
+
"div",
|
|
507
|
+
{
|
|
508
|
+
key: 2,
|
|
509
|
+
class: l(`${t(i)}-swiper-mask`)
|
|
510
|
+
},
|
|
511
|
+
null,
|
|
512
|
+
2
|
|
513
|
+
/* CLASS */
|
|
514
|
+
)) : S("v-if", !0)
|
|
515
|
+
]))),
|
|
516
|
+
128
|
|
517
|
+
/* KEYED_FRAGMENT */
|
|
518
|
+
))
|
|
519
|
+
]),
|
|
520
|
+
$[2] || ($[2] = oe('<div class="swiper-button-next"><svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none"><path d="M9.64299 3.12871L9.51887 5.83301L15.6859 12L9.51887 18.167L9.64299 20.8713L18.5143 12L9.64299 3.12871Z" fill="white"></path></svg></div><div class="swiper-button-prev"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M15.1289 3.12871L15.2531 5.83301L9.08609 12L15.2531 18.167L15.1289 20.8713L6.25766 12L15.1289 3.12871Z" fill="white"></path></svg></div>', 2))
|
|
521
|
+
],
|
|
522
|
+
2
|
|
523
|
+
/* CLASS */
|
|
524
|
+
),
|
|
525
|
+
e.showIndicator ? (o(), s(
|
|
526
|
+
R,
|
|
527
|
+
{ key: 0 },
|
|
528
|
+
[
|
|
529
|
+
e.indicatorType === "tab" ? (o(), I(t(ie), {
|
|
530
|
+
key: 0,
|
|
531
|
+
modelValue: f.value,
|
|
532
|
+
"onUpdate:modelValue": $[0] || ($[0] = (h) => f.value = h),
|
|
533
|
+
class: l([e.indicatorClass, e.indicatorPosition === "absolute" && `${t(i)}-swiper-indicator-absolute`]),
|
|
534
|
+
dataList: e.dataList,
|
|
535
|
+
"show-intro": e.showIntro,
|
|
536
|
+
style: E(L.value),
|
|
537
|
+
onChange: b
|
|
538
|
+
}, null, 8, ["modelValue", "class", "dataList", "show-intro", "style"])) : (o(), I(t(ve), {
|
|
539
|
+
key: 1,
|
|
540
|
+
modelValue: f.value,
|
|
541
|
+
"onUpdate:modelValue": $[1] || ($[1] = (h) => f.value = h),
|
|
542
|
+
dataList: m.value,
|
|
543
|
+
onChange: b
|
|
544
|
+
}, null, 8, ["modelValue", "dataList"]))
|
|
545
|
+
],
|
|
546
|
+
64
|
|
547
|
+
/* STABLE_FRAGMENT */
|
|
548
|
+
)) : S("v-if", !0)
|
|
549
|
+
],
|
|
550
|
+
2
|
|
551
|
+
/* CLASS */
|
|
552
|
+
));
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
U.install = (c) => (c.component("ScSwiperNormal", U), c);
|
|
556
|
+
const ge = U;
|
|
557
|
+
export {
|
|
558
|
+
Ve as S,
|
|
559
|
+
ve as a,
|
|
560
|
+
ge as b
|
|
561
|
+
};
|