officialblock 2.2.1 → 2.2.3
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/index-B1fLxjAL.js +1 -0
- package/dist/{index-B5yG_CNT.mjs → index-BHZjpSaY.mjs} +1524 -1509
- package/dist/index-BX4y1EhQ.mjs +168 -0
- package/dist/{index-BnLlnobj.js → index-C0z5oChH.js} +28 -28
- package/dist/{index-Cd3vX-1f.mjs → index-CDRMcpMM.mjs} +1 -1
- package/dist/index-D2BwXLF3.mjs +4 -0
- package/dist/{index-ClvGlg-U.js → index-DTHsU8Qu.js} +1 -1
- package/dist/index-cl4_6cSS.js +1 -0
- package/dist/official-block.cjs.js +1 -1
- package/dist/official-block.es.js +1 -1
- package/dist/official-block.umd.js +27 -27
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-BIXEQD9w.mjs +0 -4
- package/dist/index-C45XfG_K.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-C0z5oChH.js"),S=["id"],z=["id"],C=["onClick"],P={class:"accordion-button__title"},B=["id","aria-expanded","aria-labelledby"],T={class:"accordion-body"},I=["innerHTML"],L={class:"flex-center mt-10"},O={__name:"index",props:{modelValue:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!0}},emits:["update:modelValue","handleDelete","handleCopy","handlePaste"],setup(m,{emit:V}){const{proxy:_}=e.getCurrentInstance(),{$_vsWidth:p,$_vsScrollY:F,$vsScreenAddListener:M,$vsScreenDestroyListener:A}=_,l=m,k=V,w=()=>{var o;if(l.modelValue&&l.modelValue.data){l.modelValue.openFirst&&l.modelValue.data.length>0&&n.value.size===0&&n.value.add(l.modelValue.data[0].key);return}const t={id:((o=l.modelValue)==null?void 0:o.id)||u.r(),type:"AccordionText",onlyShowPc:!1,openFirst:!1,width:"",style:{},data:[{key:u.r(),title:"tab1",content:"neirng"}]};k("update:modelValue",t)},d=e.ref(Date.now()),c=e.ref(6),v=e.ref(6),n=e.ref(new Set),b=e.ref([]),x=e.computed(()=>{var t;return(t=l.modelValue)!=null&&t.hasOwnProperty("classes")?l.modelValue.classes:null}),$=e.computed(()=>{var t;return(t=l.modelValue)!=null&&t.hasOwnProperty("style")?l.modelValue.style:null});e.computed(()=>{var t;return(t=l.modelValue)!=null&&t.hasOwnProperty("width")?l.modelValue.width:null});const r=e.computed(()=>{var t;return((t=l.modelValue)==null?void 0:t.data)||[]}),y=e.computed(()=>r.value.slice(0,c.value)),E=t=>{var o;n.value.has(t)?n.value.delete(t):((o=l.modelValue)!=null&&o.allowMultiple||n.value.clear(),n.value.add(t)),setTimeout(()=>{g(document.getElementById(`accordion-${d.value}-${t}`))},350)},i=t=>n.value.has(t),g=t=>{if(p.value>=768)return;const s=u.$(t).y-150;window.scroll({top:s,left:0,behavior:"smooth"})},h=()=>{p.value>=768?(c.value=6,v.value=6):(c.value=4,v.value=4)},N=()=>{};return e.watch(r,(t,o)=>{var s;h(),(s=l.modelValue)!=null&&s.openFirst&&t.length>0&&n.value.size===0&&n.value.add(t[0].key)},{deep:!0,immediate:!0}),e.watch(y,()=>{e.nextTick(N)},{immediate:!1}),e.onMounted(()=>{var t;e.nextTick(h),(t=l.modelValue)!=null&&t.openFirst&&r.value.length>0&&n.value.size===0&&n.value.add(r.value[0].key)}),w(),(t,o)=>{var s,f;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["accordion-text",x.value]),id:`accordion-parent-${d.value}`,style:e.normalizeStyle($.value)},[e.createElementVNode("div",{class:e.normalizeClass(["accordion-text__container",[(s=m.modelValue)!=null&&s.width?`container-content-${(f=m.modelValue)==null?void 0:f.width}`:"container-content"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,j)=>(e.openBlock(),e.createElementBlock("div",{key:a.key,class:"accordion-item",ref_for:!0,ref_key:"itemRefs",ref:b,"data-aos":"fade-in"},[e.createElementVNode("div",{class:"accordion-header",id:`accordion-${d.value}-${a.key}`},[e.createElementVNode("button",{class:e.normalizeClass(["accordion-button",{collapsed:!i(a.key)}]),type:"button",onClick:q=>E(a.key)},[e.createElementVNode("div",null,[e.createElementVNode("div",P,e.toDisplayString(a.title),1)]),o[1]||(o[1]=e.createElementVNode("span",{class:"accordion-button__icon"},null,-1))],10,C)],8,z),e.createElementVNode("div",{id:`accordion-${d.value}-collapse-${a.key}`,class:e.normalizeClass(["accordion-collapse collapse",{show:i(a.key)}]),"aria-expanded":i(a.key),"aria-labelledby":`accordion-${d.value}-${a.key}`,style:e.normalizeStyle({height:i(a.key)?"auto":"0",overflow:"hidden"})},[e.createElementVNode("div",T,[e.createElementVNode("div",{class:"accordion__content",innerHTML:a.content},null,8,I)])],14,B)]))),128)),e.withDirectives(e.createElementVNode("div",L,[e.createElementVNode("button",{type:"button",class:"btn btn__load-more",onClick:o[0]||(o[0]=a=>c.value+=v.value)},[...o[2]||(o[2]=[e.createElementVNode("span",{class:"i i-load-more"},null,-1)])])],512),[[e.vShow,c.value<r.value.length]])],2)],14,S)}}},D=u._(O,[["__scopeId","data-v-e60439d5"]]);exports.default=D;
|