first commit
This commit is contained in:
93
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/types.js
vendored
Normal file
93
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/types.js
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const popupProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 动画类型,参见 wd-transition 组件的name
|
||||
* 类型:string
|
||||
* 可选值:fade / fade-up / fade-down / fade-left / fade-right / slide-up / slide-down / slide-left / slide-right / zoom-in
|
||||
*/
|
||||
transition: String,
|
||||
/**
|
||||
* 关闭按钮
|
||||
* 类型:boolean
|
||||
* 默认值:false
|
||||
*/
|
||||
closable: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 弹出框的位置
|
||||
* 类型:string
|
||||
* 默认值:center
|
||||
* 可选值:center / top / right / bottom / left
|
||||
*/
|
||||
position: uni_modules_wotDesignUni_components_common_props.makeStringProp("center"),
|
||||
/**
|
||||
* 点击遮罩是否关闭
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
closeOnClickModal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 动画持续时间
|
||||
* 类型:number | boolean
|
||||
* 默认值:300
|
||||
*/
|
||||
duration: {
|
||||
type: [Number, Boolean],
|
||||
default: 300
|
||||
},
|
||||
/**
|
||||
* 是否显示遮罩
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
modal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 设置层级
|
||||
* 类型:number
|
||||
* 默认值:10
|
||||
*/
|
||||
zIndex: uni_modules_wotDesignUni_components_common_props.makeNumberProp(10),
|
||||
/**
|
||||
* 是否当关闭时将弹出层隐藏(display: none)
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
hideWhenClose: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 遮罩样式
|
||||
* 类型:string
|
||||
* 默认值:''
|
||||
*/
|
||||
modalStyle: uni_modules_wotDesignUni_components_common_props.makeStringProp(""),
|
||||
/**
|
||||
* 弹出面板是否设置底部安全距离(iphone X 类型的机型)
|
||||
* 类型:boolean
|
||||
* 默认值:false
|
||||
*/
|
||||
safeAreaInsetBottom: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 弹出层是否显示
|
||||
*/
|
||||
modelValue: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 弹层内容懒渲染,触发展示时才渲染内容
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
lazyRender: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 是否锁定滚动
|
||||
* 类型:boolean
|
||||
* 默认值:true
|
||||
*/
|
||||
lockScroll: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
|
||||
* 类型:boolean
|
||||
* 默认值:false
|
||||
*/
|
||||
rootPortal: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false)
|
||||
};
|
||||
exports.popupProps = popupProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/types.js.map
|
||||
167
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.js
vendored
Normal file
167
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.js
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_wdPopup_types = require("./types.js");
|
||||
if (!Math) {
|
||||
(wdOverlay + wdIcon + wdTransition + wdRootPortal)();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const wdOverlay = () => "../wd-overlay/wd-overlay.js";
|
||||
const wdTransition = () => "../wd-transition/wd-transition.js";
|
||||
const wdRootPortal = () => "../wd-root-portal/wd-root-portal.js";
|
||||
const __default__ = {
|
||||
name: "wd-popup",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdPopup_types.popupProps,
|
||||
emits: [
|
||||
"update:modelValue",
|
||||
"before-enter",
|
||||
"enter",
|
||||
"before-leave",
|
||||
"leave",
|
||||
"after-leave",
|
||||
"after-enter",
|
||||
"click-modal",
|
||||
"close"
|
||||
],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const transitionName = common_vendor.computed(() => {
|
||||
if (props.transition) {
|
||||
return props.transition;
|
||||
}
|
||||
if (props.position === "center") {
|
||||
return ["zoom-in", "fade"];
|
||||
}
|
||||
if (props.position === "left") {
|
||||
return "slide-left";
|
||||
}
|
||||
if (props.position === "right") {
|
||||
return "slide-right";
|
||||
}
|
||||
if (props.position === "bottom") {
|
||||
return "slide-up";
|
||||
}
|
||||
if (props.position === "top") {
|
||||
return "slide-down";
|
||||
}
|
||||
return "slide-up";
|
||||
});
|
||||
const safeBottom = common_vendor.ref(0);
|
||||
const style = common_vendor.computed(() => {
|
||||
return `z-index:${props.zIndex}; padding-bottom: ${safeBottom.value}px;${props.customStyle}`;
|
||||
});
|
||||
const rootClass = common_vendor.computed(() => {
|
||||
return `wd-popup wd-popup--${props.position} ${!props.transition && props.position === "center" ? "is-deep" : ""} ${props.customClass || ""}`;
|
||||
});
|
||||
common_vendor.onBeforeMount(() => {
|
||||
if (props.safeAreaInsetBottom) {
|
||||
const { safeArea, screenHeight, safeAreaInsets } = common_vendor.index.getSystemInfoSync();
|
||||
if (safeArea) {
|
||||
safeBottom.value = screenHeight - (safeArea.bottom || 0);
|
||||
} else {
|
||||
safeBottom.value = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
function handleClickModal() {
|
||||
emit("click-modal");
|
||||
if (props.closeOnClickModal) {
|
||||
close();
|
||||
}
|
||||
}
|
||||
function close() {
|
||||
emit("close");
|
||||
emit("update:modelValue", false);
|
||||
}
|
||||
function noop() {
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.rootPortal
|
||||
}, _ctx.rootPortal ? common_vendor.e({
|
||||
b: _ctx.modal
|
||||
}, _ctx.modal ? {
|
||||
c: common_vendor.o(handleClickModal),
|
||||
d: common_vendor.o(noop),
|
||||
e: common_vendor.p({
|
||||
show: _ctx.modelValue,
|
||||
["z-index"]: _ctx.zIndex,
|
||||
["lock-scroll"]: _ctx.lockScroll,
|
||||
duration: _ctx.duration,
|
||||
["custom-style"]: _ctx.modalStyle
|
||||
})
|
||||
} : {}, {
|
||||
f: _ctx.closable
|
||||
}, _ctx.closable ? {
|
||||
g: common_vendor.o(close),
|
||||
h: common_vendor.p({
|
||||
["custom-class"]: "wd-popup__close",
|
||||
name: "add"
|
||||
})
|
||||
} : {}, {
|
||||
i: common_vendor.o(($event) => emit("before-enter")),
|
||||
j: common_vendor.o(($event) => emit("enter")),
|
||||
k: common_vendor.o(($event) => emit("after-enter")),
|
||||
l: common_vendor.o(($event) => emit("before-leave")),
|
||||
m: common_vendor.o(($event) => emit("leave")),
|
||||
n: common_vendor.o(($event) => emit("after-leave")),
|
||||
o: common_vendor.p({
|
||||
["lazy-render"]: _ctx.lazyRender,
|
||||
["custom-class"]: rootClass.value,
|
||||
["custom-style"]: style.value,
|
||||
duration: _ctx.duration,
|
||||
show: _ctx.modelValue,
|
||||
name: transitionName.value,
|
||||
destroy: _ctx.hideWhenClose
|
||||
})
|
||||
}) : common_vendor.e({
|
||||
p: _ctx.modal
|
||||
}, _ctx.modal ? {
|
||||
q: common_vendor.o(handleClickModal),
|
||||
r: common_vendor.o(noop),
|
||||
s: common_vendor.p({
|
||||
show: _ctx.modelValue,
|
||||
["z-index"]: _ctx.zIndex,
|
||||
["lock-scroll"]: _ctx.lockScroll,
|
||||
duration: _ctx.duration,
|
||||
["custom-style"]: _ctx.modalStyle
|
||||
})
|
||||
} : {}, {
|
||||
t: _ctx.closable
|
||||
}, _ctx.closable ? {
|
||||
v: common_vendor.o(close),
|
||||
w: common_vendor.p({
|
||||
["custom-class"]: "wd-popup__close",
|
||||
name: "add"
|
||||
})
|
||||
} : {}, {
|
||||
x: common_vendor.o(($event) => emit("before-enter")),
|
||||
y: common_vendor.o(($event) => emit("enter")),
|
||||
z: common_vendor.o(($event) => emit("after-enter")),
|
||||
A: common_vendor.o(($event) => emit("before-leave")),
|
||||
B: common_vendor.o(($event) => emit("leave")),
|
||||
C: common_vendor.o(($event) => emit("after-leave")),
|
||||
D: common_vendor.p({
|
||||
["lazy-render"]: _ctx.lazyRender,
|
||||
["custom-class"]: rootClass.value,
|
||||
["custom-style"]: style.value,
|
||||
duration: _ctx.duration,
|
||||
show: _ctx.modelValue,
|
||||
name: transitionName.value,
|
||||
destroy: _ctx.hideWhenClose
|
||||
})
|
||||
}));
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-25a8a9f7"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.js.map
|
||||
9
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon",
|
||||
"wd-overlay": "../wd-overlay/wd-overlay",
|
||||
"wd-transition": "../wd-transition/wd-transition",
|
||||
"wd-root-portal": "../wd-root-portal/wd-root-portal"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<wd-root-portal wx:if="{{a}}" class="data-v-25a8a9f7" u-s="{{['d']}}" u-i="25a8a9f7-0" bind:__l="__l"><view class="wd-popup-wrapper data-v-25a8a9f7"><wd-overlay wx:if="{{b}}" class="data-v-25a8a9f7" bindclick="{{c}}" bindtouchmove="{{d}}" u-i="25a8a9f7-1,25a8a9f7-0" bind:__l="__l" u-p="{{e}}"/><wd-transition wx:if="{{o}}" class="data-v-25a8a9f7" u-s="{{['d']}}" bindbeforeEnter="{{i}}" bindenter="{{j}}" bindafterEnter="{{k}}" bindbeforeLeave="{{l}}" bindleave="{{m}}" bindafterLeave="{{n}}" u-i="25a8a9f7-2,25a8a9f7-0" bind:__l="__l" u-p="{{o}}"><slot/><wd-icon wx:if="{{f}}" class="data-v-25a8a9f7" bindclick="{{g}}" u-i="25a8a9f7-3,25a8a9f7-2" bind:__l="__l" u-p="{{h}}"/></wd-transition></view></wd-root-portal><view wx:else class="wd-popup-wrapper data-v-25a8a9f7"><wd-overlay wx:if="{{p}}" class="data-v-25a8a9f7" bindclick="{{q}}" bindtouchmove="{{r}}" u-i="25a8a9f7-4" bind:__l="__l" u-p="{{s}}"/><wd-transition wx:if="{{D}}" class="data-v-25a8a9f7" u-s="{{['d']}}" bindbeforeEnter="{{x}}" bindenter="{{y}}" bindafterEnter="{{z}}" bindbeforeLeave="{{A}}" bindleave="{{B}}" bindafterLeave="{{C}}" u-i="25a8a9f7-5" bind:__l="__l" u-p="{{D}}"><slot/><wd-icon wx:if="{{t}}" class="data-v-25a8a9f7" bindclick="{{v}}" u-i="25a8a9f7-6,25a8a9f7-5" bind:__l="__l" u-p="{{w}}"/></wd-transition></view>
|
||||
218
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.wxss
vendored
Normal file
218
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-popup/wd-popup.wxss
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* SCSS 配置项:命名空间以及BEM
|
||||
*/
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* SCSS 配置项:命名空间以及BEM
|
||||
*/
|
||||
/* 转换成字符串 */
|
||||
/* 判断是否存在 Modifier */
|
||||
/* 判断是否存在伪类 */
|
||||
/**
|
||||
* 主题色切换
|
||||
* @params $theme-color 主题色
|
||||
* @params $type 变暗’dark‘ 变亮 'light'
|
||||
* @params $mix-color 自己设置的混色
|
||||
*/
|
||||
/**
|
||||
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
|
||||
* @params $open-linear 是否开启线性渐变色
|
||||
* @params $deg 渐变色角度
|
||||
* @params $theme-color 当前配色
|
||||
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
|
||||
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
|
||||
* @params [Array] $per-list 渐变色比例
|
||||
*/
|
||||
/**
|
||||
* BEM,定义块(b)
|
||||
*/
|
||||
/* 定义元素(e),对于伪类,会自动将 e 嵌套在 伪类 底下 */
|
||||
/* 此方法用于生成穿透样式 */
|
||||
/* 定义元素(e),对于伪类,会自动将 e 嵌套在 伪类 底下 */
|
||||
/* 定义状态(m) */
|
||||
/* 定义状态(m) */
|
||||
/* 对于需要需要嵌套在 m 底下的 e,调用这个混合宏,一般在切换整个组件的状态,如切换颜色的时候 */
|
||||
/* 状态,生成 is-$state 类名 */
|
||||
/**
|
||||
* 常用混合宏
|
||||
*/
|
||||
/* 单行超出隐藏 */
|
||||
/* 多行超出隐藏 */
|
||||
/* 清除浮动 */
|
||||
/* 0.5px 边框 指定方向*/
|
||||
/* 0.5px 边框 环绕 */
|
||||
/**
|
||||
* 三角形实现尖角样式,适用于背景透明情况
|
||||
* @param $size 三角形高,底边为 $size * 2
|
||||
* @param $bg 三角形背景颜色
|
||||
*/
|
||||
/**
|
||||
* 正方形实现尖角样式,适用于背景不透明情况
|
||||
* @param $size 正方形边长
|
||||
* @param $bg 正方形背景颜色
|
||||
* @param $z-index z-index属性值,不得大于外部包裹器
|
||||
* @param $box-shadow 阴影
|
||||
*/
|
||||
/**
|
||||
* 辅助函数
|
||||
*/
|
||||
/**
|
||||
* SCSS 配置项:命名空间以及BEM
|
||||
*/
|
||||
/* 转换成字符串 */
|
||||
/* 判断是否存在 Modifier */
|
||||
/* 判断是否存在伪类 */
|
||||
/**
|
||||
* 主题色切换
|
||||
* @params $theme-color 主题色
|
||||
* @params $type 变暗’dark‘ 变亮 'light'
|
||||
* @params $mix-color 自己设置的混色
|
||||
*/
|
||||
/**
|
||||
* 颜色结果切换, 如果开启线性渐变色 使用渐变色,如果没有开启,那么使用主题色
|
||||
* @params $open-linear 是否开启线性渐变色
|
||||
* @params $deg 渐变色角度
|
||||
* @params $theme-color 当前配色
|
||||
* @params [Array] $set 主题色明暗设置,与 $color-list 数量对应
|
||||
* @params [Array] $color-list 渐变色顺序, $color-list 和 $per-list 数量相同
|
||||
* @params [Array] $per-list 渐变色比例
|
||||
*/
|
||||
/**
|
||||
* UI规范基础变量
|
||||
*/
|
||||
/*----------------------------------------- Theme color. start ----------------------------------------*/
|
||||
/* 主题颜色 */
|
||||
/* 辅助色 */
|
||||
/* 文字颜色(默认浅色背景下 */
|
||||
/* 暗黑模式 */
|
||||
/* 图形颜色 */
|
||||
/*----------------------------------------- Theme color. end -------------------------------------------*/
|
||||
/*-------------------------------- Theme color application size. start --------------------------------*/
|
||||
/* 文字字号 */
|
||||
/* 文字字重 */
|
||||
/* 尺寸 */
|
||||
/*-------------------------------- Theme color application size. end --------------------------------*/
|
||||
/* component var */
|
||||
/* action-sheet */
|
||||
/* badge */
|
||||
/* button */
|
||||
/* cell */
|
||||
/* calendar */
|
||||
/* checkbox */
|
||||
/* collapse */
|
||||
/* divider */
|
||||
/* drop-menu */
|
||||
/* input-number */
|
||||
/* input */
|
||||
/* textarea */
|
||||
/* loadmore */
|
||||
/* message-box */
|
||||
/* notice-bar */
|
||||
/* pagination */
|
||||
/* picker */
|
||||
/* col-picker */
|
||||
/* overlay */
|
||||
/* popup */
|
||||
/* progress */
|
||||
/* radio */
|
||||
/* search */
|
||||
/* slider */
|
||||
/* sort-button */
|
||||
/* steps */
|
||||
/* switch */
|
||||
/* tabs */
|
||||
/* tag */
|
||||
/* toast */
|
||||
/* loading */
|
||||
/* tooltip */
|
||||
/* popover */
|
||||
/* grid-item */
|
||||
/* statustip */
|
||||
/* card */
|
||||
/* upload */
|
||||
/* curtain */
|
||||
/* notify */
|
||||
/* skeleton */
|
||||
/* circle */
|
||||
/* swiper */
|
||||
/* swiper-nav */
|
||||
/* segmented */
|
||||
/* tabbar */
|
||||
/* tabbar-item */
|
||||
/* navbar */
|
||||
/* navbar-capsule */
|
||||
/* table */
|
||||
/* sidebar */
|
||||
/* sidebar-item */
|
||||
/* fab */
|
||||
/* count-down */
|
||||
/* keyboard */
|
||||
/* number-keyboard */
|
||||
/* passwod-input */
|
||||
/* form-item */
|
||||
/* backtop */
|
||||
/* index-bar */
|
||||
/* text */
|
||||
/* video-preview */
|
||||
/* img-cropper */
|
||||
/* floating-panel */
|
||||
/* signature */
|
||||
.wot-theme-dark .wd-popup-wrapper.data-v-25a8a9f7 .wd-popup {
|
||||
background: var(--wot-dark-background2, #1b1b1b);
|
||||
}
|
||||
.wot-theme-dark .wd-popup-wrapper.data-v-25a8a9f7 .wd-popup__close {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-popup-wrapper.data-v-25a8a9f7 .wd-popup {
|
||||
position: fixed;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
background: #fff;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup__close {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
color: var(--wot-popup-close-color, #666);
|
||||
font-size: var(--wot-popup-close-size, 24px);
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--center {
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate3d(-50%, -50%, 0);
|
||||
transform-origin: 0% 0%;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--center.wd-zoom-in-enter,.data-v-25a8a9f7 .wd-popup--center.wd-zoom-in-leave-to {
|
||||
transform: scale(0.8) translate3d(-50%, -50%, 0) !important;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--center.is-deep.wd-zoom-in-enter,.data-v-25a8a9f7 .wd-popup--center.is-deep.wd-zoom-in-leave-to {
|
||||
transform: scale(0.1) translate3d(-50%, -50%, 0) !important;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--left {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--right {
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--top {
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.data-v-25a8a9f7 .wd-popup--bottom {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
Reference in New Issue
Block a user