init
This commit is contained in:
1
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/popup.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/popup.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../../../../common/vendor.js"),o=require("../_constants/prefix.js"),s=require("../../../../popup.js"),n=require("./use-popup.js");Math||(r+l+t)();const l=()=>"../icon/icon.js",r=()=>"../overlay/overlay.js",t=()=>"../transition/transition.js",i=`${o.PREFIX}-popup`,a=e.defineComponent({name:i,options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}}),u=e.defineComponent({...a,props:s.popupProps,emits:s.popupEmits,setup(o,{emit:s}){const l=o,r=s,{classes:t,popStyle:i,innerIndex:a,showSlot:u,transitionName:c,onClick:p,onClickCloseIcon:y,onClickOverlay:d,onOpened:v,onClosed:f}=n.usePopup(l,r),m=e.computed((()=>Number(l.duration)));return(o,s)=>e.e({a:l.overlay},l.overlay?{b:e.o(e.unref(d)),c:e.p({"overlay-class":l.overlayClass,"overlay-style":l.overlayStyle,visible:l.visible,"z-index":e.unref(a),duration:m.value,"lock-scroll":l.lockScroll,"close-on-click-overlay":l.closeOnClickOverlay,"destroy-on-close":l.destroyOnClose})}:{},{d:e.unref(u)},(e.unref(u),{}),{e:l.closeable},l.closeable?{f:e.p({name:"close",height:"12px"}),g:e.n(`nut-popup__close-icon--${l.closeIconPosition}`),h:e.o(((...o)=>e.unref(y)&&e.unref(y)(...o)))}:{},{i:e.o(e.unref(v)),j:e.o(e.unref(f)),k:e.o(e.unref(p)),l:e.p({"custom-class":e.unref(t),"custom-style":e.unref(i),name:e.unref(c),show:l.visible,duration:m.value,"destroy-on-close":l.destroyOnClose})})}});wx.createComponent(u);
|
||||
8
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/popup.json
vendored
Normal file
8
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/popup.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"nut-icon": "../icon/icon",
|
||||
"nut-overlay": "../overlay/overlay",
|
||||
"nut-transition": "../transition/transition"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/popup.wxml
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/popup.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<nut-overlay wx:if="{{a}}" bindclick="{{b}}" u-i="fc390718-0" bind:__l="__l" u-p="{{c}}"/><nut-transition wx:if="{{l}}" u-s="{{['d']}}" bindafterEnter="{{i}}" bindafterLeave="{{j}}" bindclick="{{k}}" u-i="fc390718-1" bind:__l="__l" u-p="{{l}}"><slot wx:if="{{d}}"/><view wx:if="{{e}}" class="{{['nut-popup__close-icon', g]}}" bindtap="{{h}}"><block wx:if="{{$slots.closeIcon}}"><slot name="closeIcon"></slot></block><block wx:else><nut-icon wx:if="{{f}}" u-i="fc390718-2,fc390718-1" bind:__l="__l" u-p="{{f}}"/></block></view></nut-transition>
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/popup.wxss
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/popup.wxss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.nut-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--nut-overlay-bg-color, rgba(0, 0, 0, .7))}.nut-overflow-hidden{overflow:hidden!important}.nut-theme-dark .nut-popup{background:var(--nut-dark-background2, #1b1b1b)}.nut-theme-dark .nut-popup__close-icon{color:var(--nut-dark-color, var(--nut-white, #fff))}.nut-popup-slide-center-enter-active,.nut-popup-slide-center-leave-active{transition-timing-function:ease;transition-property:opacity}.nut-popup-slide-center-enter-from,.nut-popup-slide-center-leave-to{opacity:0}.nut-popup-slide-top-enter-from,.nut-popup-slide-top-leave-active{transform:translateY(-100%)}.nut-popup-slide-right-enter-from,.nut-popup-slide-right-leave-active{transform:translate(100%)}.nut-popup-slide-bottom-enter-from,.nut-popup-slide-bottom-leave-active{transform:translateY(100%)}.nut-popup-slide-left-enter-from,.nut-popup-slide-left-leave-active{transform:translate(-100%)}.nut-popup--center{top:50%;left:50%;transform:translate(-50%,-50%)}.nut-popup--center.round{border-radius:var(--nut-popup-border-radius, 20px)}.nut-popup--bottom{bottom:0;left:0;width:100%}.nut-popup--bottom.round{border-radius:var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px) 0 0}.nut-popup--bottom--safebottom{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.nut-popup--right{top:0;right:0}.nut-popup--right.round{border-radius:var(--nut-popup-border-radius, 20px) 0 0 var(--nut-popup-border-radius, 20px)}.nut-popup--left{top:0;left:0}.nut-popup--left.round{border-radius:0 var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px) 0}.nut-popup--top{top:0;left:0;width:100%}.nut-popup--top.round{border-radius:0 0 var(--nut-popup-border-radius, 20px) var(--nut-popup-border-radius, 20px)}.nut-popup--top--safetop{padding-top:var(--status-bar-height);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.nut-popup{position:fixed;max-height:100%;overflow-y:auto;background-color:var(--nut-white, #fff);-webkit-overflow-scrolling:touch}.nut-popup__close-icon{position:absolute!important;z-index:1;width:30px;height:30px;font-size:18px;line-height:30px;color:#969799;text-align:center;cursor:pointer}.nut-popup__close-icon:active{opacity:.7}.nut-popup__close-icon--top-left{top:var(--nut-popup-close-icon-margin, 16px);left:var(--nut-popup-close-icon-margin, 16px)}.nut-popup__close-icon--top-right{top:var(--nut-popup-close-icon-margin, 16px);right:var(--nut-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-left{bottom:var(--nut-popup-close-icon-margin, 16px);left:var(--nut-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-right{right:var(--nut-popup-close-icon-margin, 16px);bottom:var(--nut-popup-close-icon-margin, 16px)}
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/use-popup.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/nutui-uni/components/popup/use-popup.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../../../../common/vendor.js"),n=require("../_constants/event.js"),o=require("../_constants/prefix.js"),i=require("../_constants/types.js"),s=require("../_hooks/useGlobalZIndex.js");require("../_utils/env.js");const t=require("../_utils/style.js"),r=`${o.PREFIX}-popup`;exports.usePopup=function(o,l){const p=e.reactive({innerVisible:!1,innerIndex:o.zIndex,showSlot:!0}),a=e.computed((()=>t.getMainClass(o,r,{round:o.round,[`nut-popup--${o.position}`]:!0,[`nut-popup--${o.position}--safebottom`]:"bottom"===o.position&&o.safeAreaInsetBottom,[`nut-popup--${o.position}--safetop`]:"top"===o.position&&o.safeAreaInsetTop,[o.popClass]:!0}))),u=e.computed((()=>t.getMainStyle(o,{zIndex:p.innerIndex,transitionDuration:`${o.duration}ms`}))),c=e.computed((()=>o.transition?o.transition:`${i.animationName[o.position]}`)),E=()=>{p.innerVisible&&(p.innerVisible=!1,l(n.UPDATE_VISIBLE_EVENT,!1),l(n.CLOSE_EVENT))},d=e=>{e&&!p.innerVisible&&(p.innerVisible||(p.innerIndex=void 0!==o.zIndex?o.zIndex:s.useGlobalZIndex(),p.innerVisible=!0,l(n.UPDATE_VISIBLE_EVENT,!0),p.showSlot=!0,l(n.OPEN_EVENT))),!e&&p.innerVisible&&(p.innerVisible=!1,l(n.CLOSE_EVENT))};return e.watch((()=>o.visible),(e=>{d(e)})),e.onMounted((()=>{d(o.visible)})),{...e.toRefs(p),popStyle:u,transitionName:c,classes:a,onClick:e=>{l("click-pop",e)},onClickCloseIcon:e=>{e.stopPropagation(),l("click-close-icon"),E()},onClickOverlay:()=>{l("click-overlay"),o.closeOnClickOverlay&&E()},onOpened:()=>{l(n.OPENED_EVENT),l("opend")},onClosed:()=>{l(n.CLOSED_EVENT),p.showSlot=!o.destroyOnClose}}};
|
||||
Reference in New Issue
Block a user