u-popup.js
7.7 KB
"use strict";const r=require("../../../../common/vendor.js"),l=require("./props.js"),a=require("../../libs/mixin/mpMixin.js"),d=require("../../libs/mixin/mixin.js");require("../../libs/config/props.js");require("../../libs/config/config.js");require("../../libs/config/props/actionSheet.js");require("../../libs/config/props/album.js");require("../../libs/config/props/alert.js");require("../../libs/config/props/avatar.js");require("../../libs/config/props/avatarGroup.js");require("../../libs/config/props/backtop.js");require("../../libs/config/props/badge.js");require("../../libs/config/props/button.js");require("../../libs/config/props/calendar.js");require("../../libs/config/props/carKeyboard.js");require("../../libs/config/props/cell.js");require("../../libs/config/props/cellGroup.js");require("../../libs/config/props/checkbox.js");require("../../libs/config/props/checkboxGroup.js");require("../../libs/config/props/circleProgress.js");require("../../libs/config/props/code.js");require("../../libs/config/props/codeInput.js");require("../../libs/config/props/col.js");require("../../libs/config/props/collapse.js");require("../../libs/config/props/collapseItem.js");require("../../libs/config/props/columnNotice.js");require("../../libs/config/props/countDown.js");require("../../libs/config/props/countTo.js");require("../../libs/config/props/datetimePicker.js");require("../../libs/config/props/divider.js");require("../../libs/config/props/empty.js");require("../../libs/config/props/form.js");require("../../libs/config/props/formItem.js");require("../../libs/config/props/gap.js");require("../../libs/config/props/grid.js");require("../../libs/config/props/gridItem.js");require("../../libs/config/props/icon.js");require("../../libs/config/props/image.js");require("../../libs/config/props/indexAnchor.js");require("../../libs/config/props/indexList.js");require("../../libs/config/props/input.js");require("../../libs/config/props/keyboard.js");require("../../libs/config/props/line.js");require("../../libs/config/props/lineProgress.js");require("../../libs/config/props/link.js");require("../../libs/config/props/list.js");require("../../libs/config/props/listItem.js");require("../../libs/config/props/loadingIcon.js");require("../../libs/config/props/loadingPage.js");require("../../libs/config/props/loadmore.js");require("../../libs/config/props/modal.js");require("../../libs/config/props/navbar.js");require("../../libs/config/color.js");require("../../libs/config/props/noNetwork.js");require("../../libs/config/props/noticeBar.js");require("../../libs/config/props/notify.js");require("../../libs/config/props/numberBox.js");require("../../libs/config/props/numberKeyboard.js");require("../../libs/config/props/overlay.js");require("../../libs/config/props/parse.js");require("../../libs/config/props/picker.js");require("../../libs/config/props/popup.js");require("../../libs/config/props/radio.js");require("../../libs/config/props/radioGroup.js");require("../../libs/config/props/rate.js");require("../../libs/config/props/readMore.js");require("../../libs/config/props/row.js");require("../../libs/config/props/rowNotice.js");require("../../libs/config/props/scrollList.js");require("../../libs/config/props/search.js");require("../../libs/config/props/section.js");require("../../libs/config/props/skeleton.js");require("../../libs/config/props/slider.js");require("../../libs/config/props/statusBar.js");require("../../libs/config/props/steps.js");require("../../libs/config/props/stepsItem.js");require("../../libs/config/props/sticky.js");require("../../libs/config/props/subsection.js");require("../../libs/config/props/swipeAction.js");require("../../libs/config/props/swipeActionItem.js");require("../../libs/config/props/swiper.js");require("../../libs/config/props/swipterIndicator.js");require("../../libs/config/props/switch.js");require("../../libs/config/props/tabbar.js");require("../../libs/config/props/tabbarItem.js");require("../../libs/config/props/tabs.js");require("../../libs/config/props/tag.js");require("../../libs/config/props/text.js");require("../../libs/config/props/textarea.js");require("../../libs/config/props/toast.js");require("../../libs/config/props/toolbar.js");require("../../libs/config/props/tooltip.js");require("../../libs/config/props/transition.js");require("../../libs/config/props/upload.js");require("../../libs/config/props/drawer.js");const m={name:"u-popup",mixins:[a.mpMixin,d.mixin,l.props],data(){return{overlayDuration:this.duration+50}},watch:{show(e,i){if(e===!0){const t=this.$children;this.retryComputedComponentRect(t)}}},computed:{transitionStyle(){const e={zIndex:this.zIndex,position:"fixed",display:"flex"};if(e[this.mode]=0,this.mode==="left")return r.index.$u.deepMerge(e,{bottom:0,top:0});if(this.mode==="right")return r.index.$u.deepMerge(e,{bottom:0,top:0});if(this.mode==="top")return r.index.$u.deepMerge(e,{left:0,right:0});if(this.mode==="bottom")return r.index.$u.deepMerge(e,{left:0,right:0});if(this.mode==="center")return r.index.$u.deepMerge(e,{alignItems:"center","justify-content":"center",top:0,left:0,right:0,bottom:0})},contentStyle(){const e={};if(r.index.$u.sys(),this.mode!=="center"&&(e.flex=1),this.bgColor&&(e.backgroundColor=this.bgColor),this.round){const i=r.index.$u.addUnit(this.round);this.mode==="top"?(e.borderBottomLeftRadius=i,e.borderBottomRightRadius=i):this.mode==="bottom"?(e.borderTopLeftRadius=i,e.borderTopRightRadius=i):this.mode==="center"&&(e.borderRadius=i)}return r.index.$u.deepMerge(e,r.index.$u.addStyle(this.customStyle))},position(){if(this.mode==="center")return this.zoom?"fade-zoom":"fade";if(this.mode==="left")return"slide-left";if(this.mode==="right")return"slide-right";if(this.mode==="bottom")return"slide-up";if(this.mode==="top")return"slide-down"}},methods:{overlayClick(){this.closeOnClickOverlay&&this.$emit("close")},close(e){this.$emit("close")},afterEnter(){this.$emit("open")},clickHandler(){this.mode==="center"&&this.overlayClick(),this.$emit("click")},retryComputedComponentRect(e){const i=["u-calendar-month","u-album","u-collapse-item","u-dropdown","u-index-item","u-index-list","u-line-progress","u-list-item","u-rate","u-read-more","u-row","u-row-notice","u-scroll-list","u-skeleton","u-slider","u-steps-item","u-sticky","u-subsection","u-swipe-action-item","u-tabbar","u-tabs","u-tooltip"];for(let t=0;t<e.length;t++){const o=e[t],s=o.$children;i.includes(o.$options.name)&&typeof(o==null?void 0:o.init)=="function"&&r.index.$u.sleep(50).then(()=>{o.init()}),s.length&&this.retryComputedComponentRect(s)}}}};if(!Array){const e=r.resolveComponent("u-overlay"),i=r.resolveComponent("u-status-bar"),t=r.resolveComponent("u-icon"),o=r.resolveComponent("u-safe-bottom"),s=r.resolveComponent("u-transition");(e+i+t+o+s)()}const q=()=>"../u-overlay/u-overlay.js",c=()=>"../u-status-bar/u-status-bar.js",p=()=>"../u-icon/u-icon.js",h=()=>"../u-safe-bottom/u-safe-bottom.js",f=()=>"../u-transition/u-transition.js";Math||(q+c+p+h+f)();function _(e,i,t,o,s,u){return r.e({a:e.overlay},e.overlay?{b:r.o(u.overlayClick),c:r.p({show:e.show,duration:s.overlayDuration,customStyle:e.overlayStyle,opacity:e.overlayOpacity})}:{},{d:e.safeAreaInsetTop},e.safeAreaInsetTop?{}:{},{e:e.closeable},e.closeable?{f:r.p({name:"close",color:"#909399",size:"18",bold:!0}),g:r.o((...n)=>u.close&&u.close(...n)),h:r.n("u-popup__content__close--"+e.closeIconPos)}:{},{i:e.safeAreaInsetBottom},e.safeAreaInsetBottom?{}:{},{j:r.s(u.contentStyle),k:r.o((...n)=>e.noop&&e.noop(...n)),l:r.o(u.afterEnter),m:r.o(u.clickHandler),n:r.p({show:e.show,customStyle:u.transitionStyle,mode:u.position,duration:e.duration})})}const y=r._export_sfc(m,[["render",_],["__scopeId","data-v-05c24e9b"],["__file","D:/vue/大健康商城/healthMall/uni_modules/uview-plus/components/u-popup/u-popup.vue"]]);wx.createComponent(y);