@pksep/yui 0.1.162 → 0.1.163
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/sep-yui.es.ts +2 -2
- package/dist/sep-yui.umd.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/sep-yui.es.ts
CHANGED
|
@@ -76564,7 +76564,7 @@ const NPg = /* @__PURE__ */ kUg(VPg), Xw = (C) => {
|
|
|
76564
76564
|
}, [
|
|
76565
76565
|
dg(vg, {
|
|
76566
76566
|
class: "slider-modal__icon",
|
|
76567
|
-
name: gg(wg).
|
|
76567
|
+
name: gg(wg).printer,
|
|
76568
76568
|
width: 24,
|
|
76569
76569
|
height: 24
|
|
76570
76570
|
}, null, 8, ["name"])
|
|
@@ -76578,7 +76578,7 @@ const NPg = /* @__PURE__ */ kUg(VPg), Xw = (C) => {
|
|
|
76578
76578
|
_: 1
|
|
76579
76579
|
}, 8, ["open", "height", "width", "animate-type"]));
|
|
76580
76580
|
}
|
|
76581
|
-
}), cR = /* @__PURE__ */ Kg(UPg, [["__scopeId", "data-v-
|
|
76581
|
+
}), cR = /* @__PURE__ */ Kg(UPg, [["__scopeId", "data-v-a0e27560"]]), EPg = ["data-testid"], PPg = ["data-testid"], _Pg = ["disabled", "data-testid"], qPg = ["data-testid"], $Pg = ["data-testid"], g6g = ["src", "data-testid"], I6g = ["data-testid"], C6g = ["data-testid"], e6g = ["src"], t6g = ["src", "data-testid"], i6g = ["disabled", "data-testid"], A6g = /* @__PURE__ */ ng({
|
|
76582
76582
|
__name: "Slider",
|
|
76583
76583
|
props: {
|
|
76584
76584
|
items: {},
|
package/dist/sep-yui.umd.ts
CHANGED
|
@@ -1319,7 +1319,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
1319
1319
|
size: A4 portrait;
|
|
1320
1320
|
margin: 10mm;
|
|
1321
1321
|
}
|
|
1322
|
-
`),Njg({printable:(q=I.file)==null?void 0:q.path,type:x,style:E})},B=()=>{var x,E,gg;(x=I.file)!=null&&x.path&&Yjg((E=I.file)==null?void 0:E.path,(gg=I.file)==null?void 0:gg.name)},p=(x,E=!1)=>{const gg=x.target;gg.src=Ln,E&&(I.isErrorFile=!0)},Y=()=>{A.value&&R(A.value.nextSlide())},y=()=>{A.value&&R(A.value.prevSlide())},R=x=>{I.defaultIndex=x,T(),I.file=g.items[x]},M=x=>{let E=I.sideBarIndex;x>0?(E=I.sideBarIndex+1,E=Math.min(I.sideBarLength-1,E)):(E=I.sideBarIndex-1,E=Math.max(0,E)),I.sideBarIndex=E},D=()=>{o.nextTick(()=>{if(!I.file)return;iV(I.file.path)==="pdf"&&(I.isErrorFile=!0,H())})},J=()=>{o.nextTick(()=>{if(!e.value||!t.value)return;const x=e.value[I.sideBarIndex];AV(x,t.value)})},H=async()=>{var x,E;try{if(!I.file)return;const gg=Ga.getCache(I.file.path);let Q;if(gg?Q=gg:Q=await zY((x=I.file)==null?void 0:x.path).promise,!Q){I.isErrorFile=!0;return}I.sideBarLength=Q.numPages,I.sideBarItems=new Array(Q.numPages).fill(((E=I.file)==null?void 0:E.path)??""),Ga.setCache(I.file.path,Q),F(0),I.isErrorFile=!1}catch(gg){console.error(gg),I.isErrorFile=!0}},F=async(x=0)=>{I.sideBarIndex=x},T=()=>{I.sideBarItems=[],I.sideBarIndex=0,I.sideBarLength=0};return o.onUnmounted(()=>{T()}),(x,E)=>(o.openBlock(),o.createBlock(ph,{position:"center",class:"slider-modal",ref:"modalRef",open:C.open,height:C.height,width:C.width,"animate-type":o.unref(tV).fade,onClose:E[5]||(E[5]=gg=>x.$emit("close")),onEndAnimation:E[6]||(E[6]=gg=>x.$emit("end-animation")),onUnmounted:E[7]||(E[7]=gg=>x.$emit("unmounted"))},{default:o.withCtx(()=>{var gg,Q,q,lg,wg,$g,rI;return[o.createElementVNode("div",Hjg,[o.createElementVNode("div",{ref_key:"sideBarRef",ref:t,class:o.normalizeClass(["slider-modal__side-bar",[{"slider-modal__side-bar_active":o.unref(Oc)((gg=I.file)==null?void 0:gg.path)}]])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.sideBarItems,(pg,Mg)=>(o.openBlock(),o.createElementBlock("div",{ref_for:!0,ref_key:"miniItemsRef",ref:e,class:o.normalizeClass(["slider-modal__side-bar-item",{"slider-modal__side-bar-item_active":Mg===I.sideBarIndex}]),key:Mg},[o.createElementVNode("div",{class:"slider-modal__mini-prewiew-wrapper",onClick:xg=>b(Mg)},[o.createVNode(Vw,{ref_for:!0,ref:"miniPreviewsRef",class:"slider-modal__mini-preview",src:pg,page:Mg+1},null,8,["src","page"])],8,fjg),o.createElementVNode("div",Djg,o.toDisplayString(Mg+1),1)],2))),128))],2),o.createElementVNode("div",{class:"slider-modal__main",onClick:E[4]||(E[4]=o.withModifiers(pg=>x.$emit("close"),["self"]))},[o.unref(Oc)((Q=I.file)==null?void 0:Q.path)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"slider-modal__item",onClick:E[0]||(E[0]=o.withModifiers(pg=>x.$emit("close"),["self"])),onWheel:Z},[o.createVNode(Vw,{class:"slider-modal__pdf",ref_key:"pdfRef",ref:i,src:(q=I==null?void 0:I.file)==null?void 0:q.path,page:I.sideBarIndex+1},null,8,["src","page"])],32)):o.unref(nV)((lg=I.file)==null?void 0:lg.path)?(o.openBlock(),o.createElementBlock("div",{key:1,class:"slider-modal__item",onClick:E[1]||(E[1]=o.withModifiers(pg=>x.$emit("close"),["self"]))},[o.createVNode(Xjg,{ref_key:"imagePreviewRef",ref:n,class:"slider-modal__image",src:(wg=I.file)==null?void 0:wg.path},null,8,["src"])])):o.unref(Nw)(($g=I.file)==null?void 0:$g.path)?(o.openBlock(),o.createElementBlock("div",{key:2,class:"slider-modal__item",onClick:E[2]||(E[2]=o.withModifiers(pg=>x.$emit("close"),["self"]))},[o.createElementVNode("video",{controls:"",class:"slider-modal__video","data-testid":`${g.dataTestid}-Video`},[o.createElementVNode("source",{src:((rI=I.file)==null?void 0:rI.path)??""},null,8,Kjg)],8,Sjg)])):(o.openBlock(),o.createElementBlock("div",{key:3,class:"slider-modal__item",onClick:E[3]||(E[3]=o.withModifiers(pg=>x.$emit("close"),["self"]))},[o.createElementVNode("img",{class:"slider-modal__image",src:o.unref(Ln)},null,8,kjg)])),o.createElementVNode("div",Fjg,[E[8]||(E[8]=o.createElementVNode("div",{class:"slider-modal__nav-block"},null,-1)),o.createElementVNode("div",zjg,[g.items.length>1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("button",{class:"slider-modal__side-button",disabled:l.value,onClick:y},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).leftBig,width:24,height:24},null,8,["name"])],8,Jjg),o.createVNode(Bjg,{ref_key:"sliderRef",ref:A,class:"slider-modal__bottom-slider","active-index":I.defaultIndex},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.items,(pg,Mg)=>(o.openBlock(),o.createBlock(yjg,{class:"slider-modal__slide",key:Mg,"is-active":Mg===I.defaultIndex,onClick:xg=>u(Mg)},{default:o.withCtx(()=>[o.unref(nV)(pg.path)?(o.openBlock(),o.createElementBlock("img",{key:0,class:"slider-modal__slide-image",src:pg.path,alt:pg.path,onError:p},null,40,Ljg)):o.unref(Oc)(pg.path)?(o.openBlock(),o.createBlock(Vw,{key:1,class:"slider-modal__slide-image",src:pg.path,page:1},null,8,["src"])):o.unref(Nw)(pg.path)?(o.openBlock(),o.createBlock($S,{key:2,class:"slider-modal__slide-image",src:pg.path},null,8,["src"])):(o.openBlock(),o.createElementBlock("img",{key:3,class:"slider-modal__slide-image",src:o.unref(Ln)},null,8,Tjg))]),_:2},1032,["is-active","onClick"]))),128))]),_:1},8,["active-index"]),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:s.value,onClick:Y},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).rightBig,width:24,height:24},null,8,["name"])],8,vjg)],64)):o.createCommentVNode("",!0)]),o.createElementVNode("div",jjg,[o.createElementVNode("button",{class:"slider-modal__side-button",disabled:a.value,onClick:w},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).reset,width:24,height:24},null,8,["name"])],8,xjg),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:m.value,onClick:B},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).uploadCloud,width:24,height:24},null,8,["name"])],8,Ojg),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:d.value,onClick:G},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).uploadCloud,width:24,height:24},null,8,["name"])],8,Qjg)])])])],512)]}),_:1},8,["open","height","width","animate-type"]))}}),[["__scopeId","data-v-2eb315ea"]]),Ujg=["data-testid"],Ejg=["data-testid"],Pjg=["disabled","data-testid"],_jg=["data-testid"],$jg=["data-testid"],qjg=["src","data-testid"],gxg=["data-testid"],Ixg=["data-testid"],Cxg=["src"],exg=["src","data-testid"],txg=["disabled","data-testid"],lV=Yg(o.defineComponent({__name:"Slider",props:{items:{},defaultIndex:{},dataTestid:{default:"Slider"}},setup(C,{expose:g}){const I=C,e=o.reactive({files:I.items.length?I.items:[],file:null,currentIndex:I.defaultIndex||0,extension:null,filePath:null,isShowSliderModal:!1,indexModal:0});o.watch(()=>e.file,()=>{var G;e.filePath=((G=e.file)==null?void 0:G.path)??null},{immediate:!0}),o.watch(()=>I.items,()=>{e.files=I.items.length?I.items:[]});const t=()=>{e.filePath=Ln},i=G=>{if(!G)return;const B=e.files.findIndex(p=>G.path===p.path);B!==-1&&(e.indexModal=B,e.isShowSliderModal=!0)},A=()=>{e.isShowSliderModal=!1},n=()=>{var G;return(G=I.items)!=null&&G.length?e.currentIndex===I.items.length-1:!0},l=G=>{if(!G)return null;const B=G.split("?")[0],p=/\.\w+$/,Y=B.match(p);return e.extension=Y?Y[0].replace(".",""):null,e.extension},s=G=>{const B=l(G);return B?Object.values(eh).includes(B.toLowerCase()):!1},a=G=>{const B=l(G);return B?Object.values(th).includes(B):!1},d=G=>l(G)==="pdf",m=()=>{e.currentIndex--,e.file=e.files[e.currentIndex]},u=()=>{e.currentIndex++,e.file=e.files[e.currentIndex]},b=()=>e.files.length===0,Z=()=>{var G,B,p;return s(((G=e.file)==null?void 0:G.path)??null)==!1&&a(((B=e.file)==null?void 0:B.path)??null)==!1&&d(((p=e.file)==null?void 0:p.path)??null)==!1&&e.files.length>0};o.onMounted(()=>{if(!I.items)return 0;e.files=I.items,I.defaultIndex&&(e.file=e.files[e.currentIndex]),e.file=e.files[e.currentIndex]});const w=G=>{G>=0&&G<e.files.length&&(e.currentIndex=G,e.file=e.files[e.currentIndex])};return o.watch(()=>I.items,()=>{e.files=I.items},{deep:!0}),g({setSlide:w}),(G,B)=>{var p,Y,y,R,M;return o.openBlock(),o.createElementBlock("div",{class:"slider-yui-kit","data-testid":I.dataTestid},[o.createElementVNode("div",{class:"slider-yui-kit__wrapper",ref:"slider-yui-kitWrapperRef","data-testid":`${I.dataTestid}-Wrapper`},[o.createElementVNode("button",{class:"slider-yui-kit__button slider-yui-kit__button--prev",onClick:m,disabled:e.currentIndex===0,"data-testid":`${I.dataTestid}-Prev-Button`},[o.createVNode(Ng,{name:o.unref(dg).leftBig,"data-testid":`${I.dataTestid}-Prev-Icon`},null,8,["name","data-testid"])],8,Pjg),o.createElementVNode("div",{class:"slider-yui-kit__slides","data-testid":`${I.dataTestid}-Slides-Container`},[b()?(o.openBlock(),o.createElementBlock("div",{key:0,class:"placeholder-yui-kit no-content","data-testid":`${I.dataTestid}-NoContent-Placeholder`},[o.createElementVNode("img",{src:o.unref(Ln),alt:"",width:"111px",height:"111px","data-testid":`${I.dataTestid}-NoContent-Image`},null,8,qjg),o.createElementVNode("p",{"data-testid":`${I.dataTestid}-NoContent-Paragrpah`}," Контент отсутствует ",8,gxg)],8,$jg)):Z()?(o.openBlock(),o.createElementBlock("div",{key:1,class:"placeholder-yui-kit","data-testid":`${I.dataTestid}-Invalid-Extension-Placeholder`},[o.createElementVNode("img",{src:o.unref(Ln),alt:"",width:"111px",height:"111px"},null,8,Cxg),o.createElementVNode("p",null,"."+o.toDisplayString(e.extension),1)],8,Ixg)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[s(((p=e.file)==null?void 0:p.path)??"")?(o.openBlock(),o.createElementBlock("img",{key:0,class:"slider__item",src:e.filePath??"","data-testid":`${I.dataTestid}-Image`,onClick:B[0]||(B[0]=D=>i(e.file)),onError:t},null,40,exg)):a(((Y=e.file)==null?void 0:Y.path)??"")?(o.openBlock(),o.createBlock($S,{key:1,class:"slider__item",src:((y=e.file)==null?void 0:y.path)??"",onClick:B[1]||(B[1]=D=>i(e.file))},null,8,["src"])):d(((R=e.file)==null?void 0:R.path)??"")?(o.openBlock(),o.createBlock(Vw,{key:2,class:"slider-yui-kit__pdf-preview slider__item",src:(M=e.file)==null?void 0:M.path,onClick:B[2]||(B[2]=D=>i(e.file))},null,8,["src"])):o.createCommentVNode("",!0)],64))],8,_jg),o.createElementVNode("button",{class:"slider-yui-kit__button slider-yui-kit__button--next",onClick:u,disabled:n(),"data-testid":`${I.dataTestid}-Next-Button`},[o.createVNode(Ng,{name:o.unref(dg).rightBig,"data-testid":`${I.dataTestid}-Next-Icon`},null,8,["name","data-testid"])],8,txg)],8,Ejg),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(Mw,{open:e.isShowSliderModal,items:e.files,"default-index":e.indexModal,onClose:A},null,8,["open","items","default-index"])]))],8,Ujg)}}}),[["__scopeId","data-v-50acfc4d"]]),ixg=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Axg(C){return ixg.test(C)}function qS(){var C=URL.createObjectURL(new Blob),g=C.toString();return URL.revokeObjectURL(C),g.split(/[:\/]/g).pop().toLowerCase()}qS.valid=Axg;const nxg=(C="")=>C+qS();var yh=(C=>(C.small="small",C.medium="medium",C.big="big",C.large="large",C))(yh||{});const lxg=["disabled","data-testid"],sxg=["id","disabled","data-testid"],oxg=["for","data-testid"],axg=o.defineComponent({__name:"Toggle",props:o.mergeModels({disabled:{type:Boolean,default:!1},backgroundColor:{},type:{default:yh.small},dataTestid:{default:"Toggle"}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:o.mergeModels(["change"],["update:modelValue"]),setup(C,{emit:g}){const I=C,e=g,t=o.useModel(C,"modelValue"),i=nxg(),A=o.computed(()=>({"toggle-yui-kit":!0,"toggle-yui-kit_small":I.type===yh.small,"toggle-yui-kit_medium":I.type===yh.medium,"toggle-yui-kit_large":I.type===yh.large})),n=o.computed(()=>({backgroundColor:I.backgroundColor})),l=()=>e("change",!!t.value);return(s,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(A.value),disabled:I.disabled,style:o.normalizeStyle(n.value),"data-testid":`${I.dataTestid}-Toggle`},[o.withDirectives(o.createElementVNode("input",{class:"toggle-yui-kit-input",id:o.unref(i),type:"checkbox",disabled:C.disabled,"onUpdate:modelValue":a[0]||(a[0]=d=>t.value=d),onChange:l,"data-testid":`${I.dataTestid}-Input`},null,40,sxg),[[o.vModelCheckbox,t.value]]),o.createElementVNode("label",{class:"toggle-yui-kit-label",for:o.unref(i),"data-testid":`${I.dataTestid}-Label`},null,8,oxg)],14,lxg))}}),Rw=Yg(axg,[["__scopeId","data-v-38cc7c65"]]);/*!
|
|
1322
|
+
`),Njg({printable:(q=I.file)==null?void 0:q.path,type:x,style:E})},B=()=>{var x,E,gg;(x=I.file)!=null&&x.path&&Yjg((E=I.file)==null?void 0:E.path,(gg=I.file)==null?void 0:gg.name)},p=(x,E=!1)=>{const gg=x.target;gg.src=Ln,E&&(I.isErrorFile=!0)},Y=()=>{A.value&&R(A.value.nextSlide())},y=()=>{A.value&&R(A.value.prevSlide())},R=x=>{I.defaultIndex=x,T(),I.file=g.items[x]},M=x=>{let E=I.sideBarIndex;x>0?(E=I.sideBarIndex+1,E=Math.min(I.sideBarLength-1,E)):(E=I.sideBarIndex-1,E=Math.max(0,E)),I.sideBarIndex=E},D=()=>{o.nextTick(()=>{if(!I.file)return;iV(I.file.path)==="pdf"&&(I.isErrorFile=!0,H())})},J=()=>{o.nextTick(()=>{if(!e.value||!t.value)return;const x=e.value[I.sideBarIndex];AV(x,t.value)})},H=async()=>{var x,E;try{if(!I.file)return;const gg=Ga.getCache(I.file.path);let Q;if(gg?Q=gg:Q=await zY((x=I.file)==null?void 0:x.path).promise,!Q){I.isErrorFile=!0;return}I.sideBarLength=Q.numPages,I.sideBarItems=new Array(Q.numPages).fill(((E=I.file)==null?void 0:E.path)??""),Ga.setCache(I.file.path,Q),F(0),I.isErrorFile=!1}catch(gg){console.error(gg),I.isErrorFile=!0}},F=async(x=0)=>{I.sideBarIndex=x},T=()=>{I.sideBarItems=[],I.sideBarIndex=0,I.sideBarLength=0};return o.onUnmounted(()=>{T()}),(x,E)=>(o.openBlock(),o.createBlock(ph,{position:"center",class:"slider-modal",ref:"modalRef",open:C.open,height:C.height,width:C.width,"animate-type":o.unref(tV).fade,onClose:E[5]||(E[5]=gg=>x.$emit("close")),onEndAnimation:E[6]||(E[6]=gg=>x.$emit("end-animation")),onUnmounted:E[7]||(E[7]=gg=>x.$emit("unmounted"))},{default:o.withCtx(()=>{var gg,Q,q,lg,wg,$g,rI;return[o.createElementVNode("div",Hjg,[o.createElementVNode("div",{ref_key:"sideBarRef",ref:t,class:o.normalizeClass(["slider-modal__side-bar",[{"slider-modal__side-bar_active":o.unref(Oc)((gg=I.file)==null?void 0:gg.path)}]])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.sideBarItems,(pg,Mg)=>(o.openBlock(),o.createElementBlock("div",{ref_for:!0,ref_key:"miniItemsRef",ref:e,class:o.normalizeClass(["slider-modal__side-bar-item",{"slider-modal__side-bar-item_active":Mg===I.sideBarIndex}]),key:Mg},[o.createElementVNode("div",{class:"slider-modal__mini-prewiew-wrapper",onClick:xg=>b(Mg)},[o.createVNode(Vw,{ref_for:!0,ref:"miniPreviewsRef",class:"slider-modal__mini-preview",src:pg,page:Mg+1},null,8,["src","page"])],8,fjg),o.createElementVNode("div",Djg,o.toDisplayString(Mg+1),1)],2))),128))],2),o.createElementVNode("div",{class:"slider-modal__main",onClick:E[4]||(E[4]=o.withModifiers(pg=>x.$emit("close"),["self"]))},[o.unref(Oc)((Q=I.file)==null?void 0:Q.path)?(o.openBlock(),o.createElementBlock("div",{key:0,class:"slider-modal__item",onClick:E[0]||(E[0]=o.withModifiers(pg=>x.$emit("close"),["self"])),onWheel:Z},[o.createVNode(Vw,{class:"slider-modal__pdf",ref_key:"pdfRef",ref:i,src:(q=I==null?void 0:I.file)==null?void 0:q.path,page:I.sideBarIndex+1},null,8,["src","page"])],32)):o.unref(nV)((lg=I.file)==null?void 0:lg.path)?(o.openBlock(),o.createElementBlock("div",{key:1,class:"slider-modal__item",onClick:E[1]||(E[1]=o.withModifiers(pg=>x.$emit("close"),["self"]))},[o.createVNode(Xjg,{ref_key:"imagePreviewRef",ref:n,class:"slider-modal__image",src:(wg=I.file)==null?void 0:wg.path},null,8,["src"])])):o.unref(Nw)(($g=I.file)==null?void 0:$g.path)?(o.openBlock(),o.createElementBlock("div",{key:2,class:"slider-modal__item",onClick:E[2]||(E[2]=o.withModifiers(pg=>x.$emit("close"),["self"]))},[o.createElementVNode("video",{controls:"",class:"slider-modal__video","data-testid":`${g.dataTestid}-Video`},[o.createElementVNode("source",{src:((rI=I.file)==null?void 0:rI.path)??""},null,8,Kjg)],8,Sjg)])):(o.openBlock(),o.createElementBlock("div",{key:3,class:"slider-modal__item",onClick:E[3]||(E[3]=o.withModifiers(pg=>x.$emit("close"),["self"]))},[o.createElementVNode("img",{class:"slider-modal__image",src:o.unref(Ln)},null,8,kjg)])),o.createElementVNode("div",Fjg,[E[8]||(E[8]=o.createElementVNode("div",{class:"slider-modal__nav-block"},null,-1)),o.createElementVNode("div",zjg,[g.items.length>1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("button",{class:"slider-modal__side-button",disabled:l.value,onClick:y},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).leftBig,width:24,height:24},null,8,["name"])],8,Jjg),o.createVNode(Bjg,{ref_key:"sliderRef",ref:A,class:"slider-modal__bottom-slider","active-index":I.defaultIndex},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.items,(pg,Mg)=>(o.openBlock(),o.createBlock(yjg,{class:"slider-modal__slide",key:Mg,"is-active":Mg===I.defaultIndex,onClick:xg=>u(Mg)},{default:o.withCtx(()=>[o.unref(nV)(pg.path)?(o.openBlock(),o.createElementBlock("img",{key:0,class:"slider-modal__slide-image",src:pg.path,alt:pg.path,onError:p},null,40,Ljg)):o.unref(Oc)(pg.path)?(o.openBlock(),o.createBlock(Vw,{key:1,class:"slider-modal__slide-image",src:pg.path,page:1},null,8,["src"])):o.unref(Nw)(pg.path)?(o.openBlock(),o.createBlock($S,{key:2,class:"slider-modal__slide-image",src:pg.path},null,8,["src"])):(o.openBlock(),o.createElementBlock("img",{key:3,class:"slider-modal__slide-image",src:o.unref(Ln)},null,8,Tjg))]),_:2},1032,["is-active","onClick"]))),128))]),_:1},8,["active-index"]),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:s.value,onClick:Y},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).rightBig,width:24,height:24},null,8,["name"])],8,vjg)],64)):o.createCommentVNode("",!0)]),o.createElementVNode("div",jjg,[o.createElementVNode("button",{class:"slider-modal__side-button",disabled:a.value,onClick:w},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).reset,width:24,height:24},null,8,["name"])],8,xjg),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:m.value,onClick:B},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).uploadCloud,width:24,height:24},null,8,["name"])],8,Ojg),o.createElementVNode("button",{class:"slider-modal__side-button",disabled:d.value,onClick:G},[o.createVNode(Ng,{class:"slider-modal__icon",name:o.unref(dg).printer,width:24,height:24},null,8,["name"])],8,Qjg)])])])],512)]}),_:1},8,["open","height","width","animate-type"]))}}),[["__scopeId","data-v-a0e27560"]]),Ujg=["data-testid"],Ejg=["data-testid"],Pjg=["disabled","data-testid"],_jg=["data-testid"],$jg=["data-testid"],qjg=["src","data-testid"],gxg=["data-testid"],Ixg=["data-testid"],Cxg=["src"],exg=["src","data-testid"],txg=["disabled","data-testid"],lV=Yg(o.defineComponent({__name:"Slider",props:{items:{},defaultIndex:{},dataTestid:{default:"Slider"}},setup(C,{expose:g}){const I=C,e=o.reactive({files:I.items.length?I.items:[],file:null,currentIndex:I.defaultIndex||0,extension:null,filePath:null,isShowSliderModal:!1,indexModal:0});o.watch(()=>e.file,()=>{var G;e.filePath=((G=e.file)==null?void 0:G.path)??null},{immediate:!0}),o.watch(()=>I.items,()=>{e.files=I.items.length?I.items:[]});const t=()=>{e.filePath=Ln},i=G=>{if(!G)return;const B=e.files.findIndex(p=>G.path===p.path);B!==-1&&(e.indexModal=B,e.isShowSliderModal=!0)},A=()=>{e.isShowSliderModal=!1},n=()=>{var G;return(G=I.items)!=null&&G.length?e.currentIndex===I.items.length-1:!0},l=G=>{if(!G)return null;const B=G.split("?")[0],p=/\.\w+$/,Y=B.match(p);return e.extension=Y?Y[0].replace(".",""):null,e.extension},s=G=>{const B=l(G);return B?Object.values(eh).includes(B.toLowerCase()):!1},a=G=>{const B=l(G);return B?Object.values(th).includes(B):!1},d=G=>l(G)==="pdf",m=()=>{e.currentIndex--,e.file=e.files[e.currentIndex]},u=()=>{e.currentIndex++,e.file=e.files[e.currentIndex]},b=()=>e.files.length===0,Z=()=>{var G,B,p;return s(((G=e.file)==null?void 0:G.path)??null)==!1&&a(((B=e.file)==null?void 0:B.path)??null)==!1&&d(((p=e.file)==null?void 0:p.path)??null)==!1&&e.files.length>0};o.onMounted(()=>{if(!I.items)return 0;e.files=I.items,I.defaultIndex&&(e.file=e.files[e.currentIndex]),e.file=e.files[e.currentIndex]});const w=G=>{G>=0&&G<e.files.length&&(e.currentIndex=G,e.file=e.files[e.currentIndex])};return o.watch(()=>I.items,()=>{e.files=I.items},{deep:!0}),g({setSlide:w}),(G,B)=>{var p,Y,y,R,M;return o.openBlock(),o.createElementBlock("div",{class:"slider-yui-kit","data-testid":I.dataTestid},[o.createElementVNode("div",{class:"slider-yui-kit__wrapper",ref:"slider-yui-kitWrapperRef","data-testid":`${I.dataTestid}-Wrapper`},[o.createElementVNode("button",{class:"slider-yui-kit__button slider-yui-kit__button--prev",onClick:m,disabled:e.currentIndex===0,"data-testid":`${I.dataTestid}-Prev-Button`},[o.createVNode(Ng,{name:o.unref(dg).leftBig,"data-testid":`${I.dataTestid}-Prev-Icon`},null,8,["name","data-testid"])],8,Pjg),o.createElementVNode("div",{class:"slider-yui-kit__slides","data-testid":`${I.dataTestid}-Slides-Container`},[b()?(o.openBlock(),o.createElementBlock("div",{key:0,class:"placeholder-yui-kit no-content","data-testid":`${I.dataTestid}-NoContent-Placeholder`},[o.createElementVNode("img",{src:o.unref(Ln),alt:"",width:"111px",height:"111px","data-testid":`${I.dataTestid}-NoContent-Image`},null,8,qjg),o.createElementVNode("p",{"data-testid":`${I.dataTestid}-NoContent-Paragrpah`}," Контент отсутствует ",8,gxg)],8,$jg)):Z()?(o.openBlock(),o.createElementBlock("div",{key:1,class:"placeholder-yui-kit","data-testid":`${I.dataTestid}-Invalid-Extension-Placeholder`},[o.createElementVNode("img",{src:o.unref(Ln),alt:"",width:"111px",height:"111px"},null,8,Cxg),o.createElementVNode("p",null,"."+o.toDisplayString(e.extension),1)],8,Ixg)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[s(((p=e.file)==null?void 0:p.path)??"")?(o.openBlock(),o.createElementBlock("img",{key:0,class:"slider__item",src:e.filePath??"","data-testid":`${I.dataTestid}-Image`,onClick:B[0]||(B[0]=D=>i(e.file)),onError:t},null,40,exg)):a(((Y=e.file)==null?void 0:Y.path)??"")?(o.openBlock(),o.createBlock($S,{key:1,class:"slider__item",src:((y=e.file)==null?void 0:y.path)??"",onClick:B[1]||(B[1]=D=>i(e.file))},null,8,["src"])):d(((R=e.file)==null?void 0:R.path)??"")?(o.openBlock(),o.createBlock(Vw,{key:2,class:"slider-yui-kit__pdf-preview slider__item",src:(M=e.file)==null?void 0:M.path,onClick:B[2]||(B[2]=D=>i(e.file))},null,8,["src"])):o.createCommentVNode("",!0)],64))],8,_jg),o.createElementVNode("button",{class:"slider-yui-kit__button slider-yui-kit__button--next",onClick:u,disabled:n(),"data-testid":`${I.dataTestid}-Next-Button`},[o.createVNode(Ng,{name:o.unref(dg).rightBig,"data-testid":`${I.dataTestid}-Next-Icon`},null,8,["name","data-testid"])],8,txg)],8,Ejg),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(Mw,{open:e.isShowSliderModal,items:e.files,"default-index":e.indexModal,onClose:A},null,8,["open","items","default-index"])]))],8,Ujg)}}}),[["__scopeId","data-v-50acfc4d"]]),ixg=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Axg(C){return ixg.test(C)}function qS(){var C=URL.createObjectURL(new Blob),g=C.toString();return URL.revokeObjectURL(C),g.split(/[:\/]/g).pop().toLowerCase()}qS.valid=Axg;const nxg=(C="")=>C+qS();var yh=(C=>(C.small="small",C.medium="medium",C.big="big",C.large="large",C))(yh||{});const lxg=["disabled","data-testid"],sxg=["id","disabled","data-testid"],oxg=["for","data-testid"],axg=o.defineComponent({__name:"Toggle",props:o.mergeModels({disabled:{type:Boolean,default:!1},backgroundColor:{},type:{default:yh.small},dataTestid:{default:"Toggle"}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:o.mergeModels(["change"],["update:modelValue"]),setup(C,{emit:g}){const I=C,e=g,t=o.useModel(C,"modelValue"),i=nxg(),A=o.computed(()=>({"toggle-yui-kit":!0,"toggle-yui-kit_small":I.type===yh.small,"toggle-yui-kit_medium":I.type===yh.medium,"toggle-yui-kit_large":I.type===yh.large})),n=o.computed(()=>({backgroundColor:I.backgroundColor})),l=()=>e("change",!!t.value);return(s,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(A.value),disabled:I.disabled,style:o.normalizeStyle(n.value),"data-testid":`${I.dataTestid}-Toggle`},[o.withDirectives(o.createElementVNode("input",{class:"toggle-yui-kit-input",id:o.unref(i),type:"checkbox",disabled:C.disabled,"onUpdate:modelValue":a[0]||(a[0]=d=>t.value=d),onChange:l,"data-testid":`${I.dataTestid}-Input`},null,40,sxg),[[o.vModelCheckbox,t.value]]),o.createElementVNode("label",{class:"toggle-yui-kit-label",for:o.unref(i),"data-testid":`${I.dataTestid}-Label`},null,8,oxg)],14,lxg))}}),Rw=Yg(axg,[["__scopeId","data-v-38cc7c65"]]);/*!
|
|
1323
1323
|
* perfect-scrollbar v1.5.3
|
|
1324
1324
|
* Copyright 2021 Hyunje Jun, MDBootstrap and Contributors
|
|
1325
1325
|
* Licensed under MIT
|