first commit

This commit is contained in:
编码猿
2024-09-27 01:32:49 +08:00
commit 28ebe05a64
7399 changed files with 1174529 additions and 0 deletions

View File

@@ -0,0 +1 @@
893d5d42-61f6-4cc3-9172-de30d3924a12

View File

@@ -0,0 +1 @@
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames")),_styleToCssString=_interopRequireDefault(require("../helpers/styleToCssString")),_index=require("../index");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}(0,_baseComponent.default)({useSafeArea:!0,externalClasses:["wux-content-class","wux-header-class","wux-body-class","wux-footer-class","wux-close-class"],properties:{prefixCls:{type:String,value:"wux-popup"},animationPrefixCls:{type:String,value:"wux-animate"},title:{type:String,value:""},content:{type:String,value:""},extra:{type:String,value:""},position:{type:String,value:"center",observer:"getTransitionName"},wrapStyle:{type:[String,Object],value:"",observer:function(e){this.setData({extStyle:(0,_styleToCssString.default)(e)})}},closable:{type:Boolean,value:!1},mask:{type:Boolean,value:!0},maskClosable:{type:Boolean,value:!0},visible:{type:Boolean,value:!1,observer:"setPopupVisible"},zIndex:{type:Number,value:1e3},hasHeader:{type:Boolean,value:!0},hasFooter:{type:Boolean,value:!0},mountOnEnter:{type:Boolean,value:!0},unmountOnExit:{type:Boolean,value:!0}},data:{transitionName:"",popupVisible:!1,extStyle:""},computed:{classes:["prefixCls, position, safeAreaConfig, isIPhoneX",function(e,t,a,i){var o;return{wrap:(0,_classNames2.default)("".concat(e,"-position"),(_defineProperty(o={},"".concat(e,"-position--").concat(t),t),_defineProperty(o,"".concat(e,"-position--is-iphonex"),a.bottom&&i),o)),content:"".concat(e,"__content"),hd:"".concat(e,"__hd"),title:"".concat(e,"__title"),bd:"".concat(e,"__bd"),ft:"".concat(e,"__ft"),extra:"".concat(e,"__extra"),close:"".concat(e,"__close"),x:"".concat(e,"__close-x")}}]},methods:{close:function(){this.triggerEvent("close")},onMaskClick:function(){this.data.maskClosable&&this.close()},onExited:function(){this.triggerEvent("closed")},getTransitionName:function(e){var t=0<arguments.length&&void 0!==e?e:this.data.position,a=this.data.animationPrefixCls,i="";switch(t){case"top":i="".concat(a,"--slideInDown");break;case"right":i="".concat(a,"--slideInRight");break;case"bottom":i="".concat(a,"--slideInUp");break;case"left":i="".concat(a,"--slideInLeft");break;default:i="".concat(a,"--fadeIn")}this.setData({transitionName:i})},setPopupVisible:function(e){this.data.popupVisible!==e&&(this.setData({popupVisible:e}),this.setBackdropVisible(e))},setBackdropVisible:function(e){this.data.mask&&this.$wuxBackdrop&&this.$wuxBackdrop[e?"retain":"release"]()}},created:function(){this.data.mask&&(this.$wuxBackdrop=(0,_index.$wuxBackdrop)("#wux-backdrop",this))},attached:function(){this.setPopupVisible(this.data.visible),this.getTransitionName()}});

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"wux-animation-group": "../animation-group/index",
"wux-backdrop": "../backdrop/index"
}
}

View File

@@ -0,0 +1,26 @@
<wux-backdrop id="wux-backdrop" wx:if="{{ mask }}" bind:click="onMaskClick" zIndex="{{ zIndex }}" />
<view class="wux-class {{ classes.wrap }}" style="{{ extStyle }}">
<wux-animation-group wux-class="{{ prefixCls }}" in="{{ popupVisible }}" classNames="{{ transitionName }}" bind:exited="onExited" wrapStyle="{{ { zIndex } }}" mountOnEnter="{{ mountOnEnter }}" unmountOnExit="{{ unmountOnExit }}">
<view class="wux-content-class {{ classes.content }}">
<view class="wux-header-class {{ classes.hd }}" wx:if="{{ hasHeader }}">
<view class="{{ classes.title }}" wx:if="{{ title }}">{{ title }}</view>
<block wx:else>
<slot name="header"></slot>
</block>
</view>
<view class="wux-body-class {{ classes.bd }}">
<view wx:if="{{ content }}">{{ content }}</view>
<slot></slot>
</view>
<view class="wux-footer-class {{ classes.ft }}" wx:if="{{ hasFooter }}">
<view class="{{ classes.extra }}" wx:if="{{ extra }}">{{ extra }}</view>
<block wx:else>
<slot name="footer"></slot>
</block>
</view>
<view class="wux-close-class {{ classes.close }}" wx:if="{{ closable }}" bindtap="close">
<text class="{{ classes.x }}"></text>
</view>
</view>
</wux-animation-group>
</view>

View File

@@ -0,0 +1 @@
.wux-popup{position:fixed;z-index:1000;width:80%;max-width:600rpx}.wux-popup-position.wux-popup-position--center .wux-popup{top:50%;left:50%;transform:translate(-50%,-50%)}.wux-popup-position.wux-popup-position--center .wux-popup__content{border-radius:6rpx}.wux-popup-position.wux-popup-position--center .wux-popup__hd{padding:1.3em 1.6em .5em}.wux-popup-position.wux-popup-position--center .wux-popup__bd{padding:0 1.6em .8em}.wux-popup-position.wux-popup-position--center .wux-popup__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:2rpx;border-top:2rpx solid #d5d5d6;color:#d5d5d6;transform-origin:0 0;transform:scaleY(.5)}.wux-popup-position.wux-popup-position--top .wux-popup{position:fixed;left:0;top:0;width:100%;max-width:100%}.wux-popup-position.wux-popup-position--right .wux-popup{position:fixed;top:0;right:0;width:80%;max-width:100%;height:100%;max-height:100%}.wux-popup-position.wux-popup-position--bottom .wux-popup{position:fixed;left:0;bottom:0;width:100%;max-width:100%}.wux-popup-position.wux-popup-position--left .wux-popup{position:fixed;left:0;top:0;width:80%;max-width:100%;height:100%;max-height:100%}.wux-popup-position.wux-popup-position--is-iphonex .wux-popup__content{padding-bottom:68rpx}.wux-popup__content{position:relative;background-color:#fff;border:0;background-clip:padding-box;height:100%;text-align:center;overflow:hidden}.wux-popup__title{font-weight:400;font-size:36rpx}.wux-popup__bd{min-height:80rpx;font-size:30rpx;line-height:1.3;word-wrap:break-word;word-break:break-all;color:#999}.wux-popup__ft{position:relative;line-height:96rpx;font-size:36rpx;display:-ms-flexbox;display:flex}.wux-popup__close{border:0;padding:6rpx;background-color:transparent;outline:0;position:absolute;top:12rpx;right:12rpx;height:42rpx;width:42rpx}.wux-popup__close-x{display:inline-block;width:30rpx;height:30rpx;background-repeat:no-repeat;background-size:cover;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23888' fill-rule='evenodd'%3E%3Cpath d='M1.414 0l28.284 28.284-1.414 1.414L0 1.414z'/%3E%3Cpath d='M28.284 0L0 28.284l1.414 1.414L29.698 1.414z'/%3E%3C/g%3E%3C/svg%3E")}