You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
10 KiB
1 lines
10 KiB
import{H as e,J as t,K as l,L as a,M as i,N as s,O as n,o,c,P as r,i as d,Q as u,b as p,w as h,d as m,k as y,R as f,m as g,e as b,t as _,j as k,T as S,U as v,V as x,W as $,X as I}from"./index-IX2tYR8R.js";import{_ as w}from"./u-icon.sW6sruaF.js";import{r as B}from"./uni-app.es.Bc5t55A8.js";import{_ as D}from"./_plugin-vue_export-helper.BCo6x5W8.js";const z=D({name:"u-line",mixins:[l,a,e({props:{color:{type:String,default:()=>t.line.color},length:{type:[String,Number],default:()=>t.line.length},direction:{type:String,default:()=>t.line.direction},hairline:{type:Boolean,default:()=>t.line.hairline},margin:{type:[String,Number],default:()=>t.line.margin},dashed:{type:Boolean,default:()=>t.line.dashed}}})],computed:{lineStyle(){const e={};return e.margin=this.margin,"row"===this.direction?(e.borderBottomWidth="1px",e.borderBottomStyle=this.dashed?"dashed":"solid",e.width=i(this.length),this.hairline&&(e.transform="scaleY(0.5)")):(e.borderLeftWidth="1px",e.borderLeftStyle=this.dashed?"dashed":"solid",e.height=i(this.length),this.hairline&&(e.transform="scaleX(0.5)")),e.borderColor=this.color,s(e,n(this.customStyle))}}},[["render",function(e,t,l,a,i,s){const n=d;return o(),c(n,{class:"u-line",style:r([s.lineStyle])},null,8,["style"])}],["__scopeId","data-v-e76fbe42"]]);const C=D({name:"u-cell",data:()=>({}),mixins:[l,a,e({props:{title:{type:[String,Number],default:()=>t.cell.title},label:{type:[String,Number],default:()=>t.cell.label},value:{type:[String,Number],default:()=>t.cell.value},icon:{type:String,default:()=>t.cell.icon},disabled:{type:Boolean,default:()=>t.cell.disabled},border:{type:Boolean,default:()=>t.cell.border},center:{type:Boolean,default:()=>t.cell.center},url:{type:String,default:()=>t.cell.url},linkType:{type:String,default:()=>t.cell.linkType},clickable:{type:Boolean,default:()=>t.cell.clickable},isLink:{type:Boolean,default:()=>t.cell.isLink},required:{type:Boolean,default:()=>t.cell.required},rightIcon:{type:String,default:()=>t.cell.rightIcon},arrowDirection:{type:String,default:()=>t.cell.arrowDirection},iconStyle:{type:[Object,String],default:()=>t.cell.iconStyle},rightIconStyle:{type:[Object,String],default:()=>t.cell.rightIconStyle},titleStyle:{type:[Object,String],default:()=>t.cell.titleStyle},size:{type:String,default:()=>t.cell.size},stop:{type:Boolean,default:()=>t.cell.stop},name:{type:[Number,String],default:()=>t.cell.name}}})],computed:{titleTextStyle(){return n(this.titleStyle)}},emits:["click"],methods:{addStyle:n,testEmpty:u.empty,clickHandler(e){this.disabled||(this.$emit("click",{name:this.name}),this.openPage(),this.stop&&this.preventEvent(e))}}},[["render",function(e,t,l,a,i,s){const n=B(p("u-icon"),w),u=d,S=k,v=B(p("u-line"),z);return o(),c(u,{class:y(["u-cell",[e.customClass]]),style:r([s.addStyle(e.customStyle)]),"hover-class":e.disabled||!e.clickable&&!e.isLink?"":"u-cell--clickable","hover-stay-time":250,onClick:s.clickHandler},{default:h((()=>[m(u,{class:y(["u-cell__body",[e.center&&"u-cell--center","large"===e.size&&"u-cell__body--large"]])},{default:h((()=>[m(u,{class:"u-cell__body__content"},{default:h((()=>[e.$slots.icon||e.icon?(o(),c(u,{key:0,class:"u-cell__left-icon-wrap"},{default:h((()=>[e.$slots.icon?f(e.$slots,"icon",{key:0},void 0,!0):(o(),c(n,{key:1,name:e.icon,"custom-style":e.iconStyle,size:"large"===e.size?22:18},null,8,["name","custom-style","size"]))])),_:3})):g("",!0),m(u,{class:"u-cell__title"},{default:h((()=>[e.$slots.title||!e.title?f(e.$slots,"title",{key:0},void 0,!0):(o(),c(S,{key:1,class:y(["u-cell__title-text",[e.disabled&&"u-cell--disabled","large"===e.size&&"u-cell__title-text--large"]]),style:r([s.titleTextStyle])},{default:h((()=>[b(_(e.title),1)])),_:1},8,["style","class"])),f(e.$slots,"label",{},(()=>[e.label?(o(),c(S,{key:0,class:y(["u-cell__label",[e.disabled&&"u-cell--disabled","large"===e.size&&"u-cell__label--large"]])},{default:h((()=>[b(_(e.label),1)])),_:1},8,["class"])):g("",!0)]),!0)])),_:3})])),_:3}),f(e.$slots,"value",{},(()=>[s.testEmpty(e.value)?g("",!0):(o(),c(S,{key:0,class:y(["u-cell__value",[e.disabled&&"u-cell--disabled","large"===e.size&&"u-cell__value--large"]])},{default:h((()=>[b(_(e.value),1)])),_:1},8,["class"]))]),!0),e.$slots["right-icon"]||e.isLink?(o(),c(u,{key:0,class:y(["u-cell__right-icon-wrap",[`u-cell__right-icon-wrap--${e.arrowDirection}`]])},{default:h((()=>[e.rightIcon&&!e.$slots["right-icon"]?(o(),c(n,{key:0,name:e.rightIcon,"custom-style":e.rightIconStyle,color:e.disabled?"#c8c9cc":"info",size:"large"===e.size?18:16},null,8,["name","custom-style","color","size"])):f(e.$slots,"right-icon",{key:1},void 0,!0)])),_:3},8,["class"])):g("",!0),e.$slots.righticon?(o(),c(u,{key:1,class:y(["u-cell__right-icon-wrap",[`u-cell__right-icon-wrap--${e.arrowDirection}`]])},{default:h((()=>[f(e.$slots,"righticon",{},void 0,!0)])),_:3},8,["class"])):g("",!0)])),_:3},8,["class"]),e.border?(o(),c(v,{key:0})):g("",!0)])),_:3},8,["class","style","hover-class","onClick"])}],["__scopeId","data-v-bbe490a6"]]);const L=D({name:"u-collapse-item",mixins:[l,a,e({props:{title:{type:String,default:()=>t.collapseItem.title},value:{type:String,default:()=>t.collapseItem.value},label:{type:String,default:()=>t.collapseItem.label},disabled:{type:Boolean,default:()=>t.collapseItem.disabled},isLink:{type:Boolean,default:()=>t.collapseItem.isLink},clickable:{type:Boolean,default:()=>t.collapseItem.clickable},border:{type:Boolean,default:()=>t.collapseItem.border},align:{type:String,default:()=>t.collapseItem.align},name:{type:[String,Number],default:()=>t.collapseItem.name},icon:{type:String,default:()=>t.collapseItem.icon},duration:{type:Number,default:()=>t.collapseItem.duration}}})],data:()=>({elId:S(),animationData:{},expanded:!1,showBorder:!1,animating:!1,parentData:{accordion:!1,border:!1}}),watch:{expanded(e){clearTimeout(this.timer),this.timer=null,this.timer=setTimeout((()=>{this.showBorder=e}),e?10:290)}},mounted(){this.init()},methods:{async init(){if(this.updateParentData(),!this.parent)return v();const{value:e,accordion:t,children:l=[]}=this.parent;if(t){if(u.array(e))return v();this.expanded=this.name==e}else{if(!u.array(e)&&null!==e)return v();this.expanded=(e||[]).some((e=>e==this.name))}await x(),this.setContentAnimate()},updateParentData(){this.getParentData("u-collapse")},async setContentAnimate(){const e=await this.queryRect(),t=this.expanded?e.height:0;this.animating=!0;const l=$({timingFunction:"ease-in-out"});l.height(t).step({duration:this.duration}).step(),this.animationData=l.export(),I(this.duration).then((()=>{this.animating=!1}))},clickHandler(){this.disabled&&this.animating||this.parent&&this.parent.onChange(this)},queryRect(){return new Promise((e=>{this.$uGetRect(`#${this.elId}`).then((t=>{e(t)}))}))}}},[["render",function(e,t,l,a,i,s){const n=k,r=B(p("u-icon"),w),u=B(p("u-cell"),C),y=d,S=B(p("u-line"),z);return o(),c(y,{class:"u-collapse-item"},{default:h((()=>[m(u,{title:e.$slots.title?"":e.title,value:e.value,label:e.label,icon:e.icon,isLink:e.isLink,clickable:e.clickable,border:i.parentData.border&&i.showBorder,onClick:s.clickHandler,arrowDirection:i.expanded?"up":"down",disabled:e.disabled},{title:h((()=>[f(e.$slots,"title",{},(()=>[!e.$slots.title&&e.title?(o(),c(n,{key:0},{default:h((()=>[b(_(e.title),1)])),_:1})):g("",!0)]),!0)])),icon:h((()=>[f(e.$slots,"icon",{},(()=>[!e.$slots.icon&&e.icon?(o(),c(r,{key:0,size:22,name:e.icon},null,8,["name"])):g("",!0)]),!0)])),value:h((()=>[f(e.$slots,"value",{},(()=>[!e.$slots.value&&e.value?(o(),c(n,{key:0},{default:h((()=>[b(_(e.value),1)])),_:1})):g("",!0)]),!0)])),"right-icon":h((()=>[e.$slots["right-icon"]?g("",!0):(o(),c(r,{key:0,size:16,name:"arrow-right"})),f(e.$slots,"right-icon",{},void 0,!0)])),_:3},8,["title","value","label","icon","isLink","clickable","border","onClick","arrowDirection","disabled"]),m(y,{class:"u-collapse-item__content",animation:i.animationData,ref:"animation"},{default:h((()=>[m(y,{class:"u-collapse-item__content__text content-class",id:i.elId,ref:i.elId},{default:h((()=>[f(e.$slots,"default",{},void 0,!0)])),_:3},8,["id"])])),_:3},8,["animation"]),i.parentData.border?(o(),c(S,{key:0})):g("",!0)])),_:3})}],["__scopeId","data-v-fad8a361"]]);const N=D({name:"u-collapse",mixins:[l,a,e({props:{value:{type:[String,Number,Array,null],default:()=>t.collapse.value},accordion:{type:Boolean,default:()=>t.collapse.accordion},border:{type:Boolean,default:()=>t.collapse.border}}})],watch:{needInit(){this.init()},parentData(){this.children.length&&this.children.map((e=>{"function"==typeof e.updateParentData&&e.updateParentData()}))}},created(){this.children=[]},computed:{needInit(){return[this.accordion,this.value]}},emits:["open","close","change"],methods:{init(){this.children.map((e=>{e.init()}))},onChange(e){let t=[];this.children.map(((l,a)=>{this.accordion?(l.expanded=l===e&&!e.expanded,l.setContentAnimate()):l===e&&(l.expanded=!l.expanded,l.setContentAnimate()),t.push({name:l.name||a,status:l.expanded?"open":"close"})})),this.$emit("change",t),this.$emit(e.expanded?"open":"close",e.name)}}},[["render",function(e,t,l,a,i,s){const n=B(p("u-line"),z),r=d;return o(),c(r,{class:"u-collapse"},{default:h((()=>[e.border?(o(),c(n,{key:0})):g("",!0),f(e.$slots,"default",{},void 0,!0)])),_:3})}],["__scopeId","data-v-02f3ed75"]]);const j=D({},[["render",function(e,t){const l=k,a=d,i=B(p("up-collapse-item"),L),s=B(p("up-collapse"),N);return o(),c(a,{class:"content"},{default:h((()=>[m(s,{value:["2"],border:!1},{default:h((()=>[m(i,{title:"文档指南"},{default:h((()=>[m(a,{class:"textbg"},{default:h((()=>[m(l,{class:"u-collapse-content"},{default:h((()=>[b("涵盖uniapp各个方面,给开发者方向指导和设计理念,让您茅塞顿开,一马平川")])),_:1})])),_:1})])),_:1}),m(i,{title:"组件全面"},{default:h((()=>[m(a,{class:"textbg"},{default:h((()=>[m(l,{class:"u-collapse-content"},{default:h((()=>[b("众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用")])),_:1})])),_:1})])),_:1}),m(i,{name:"2",title:"众多利器"},{default:h((()=>[m(a,{class:"textbg"},{default:h((()=>[m(l,{class:"u-collapse-content"},{default:h((()=>[b("众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-ab5dafcd"]]);export{j as default};
|