This commit is contained in:
pengxiaolong
2025-05-13 19:39:53 +08:00
parent 37da6765b8
commit c006a8e63d
1232 changed files with 96963 additions and 883 deletions

View File

@@ -0,0 +1,75 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
require("../../../adapter-vue.js");
if (!Math) {
Overlay();
}
const Overlay = () => "../Overlay/index.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
props: {
visible: { type: Boolean, default: true },
popDirection: { default: "bottom" },
useMask: { type: Boolean, default: true },
isFullScreen: { type: Boolean, default: true },
overlayColor: {},
drawerStyle: { default: () => ({}) }
},
emits: ["onOverlayClick"],
setup(__props, { expose: __expose, emit: __emit }) {
var _a;
const emits = __emit;
const props = __props;
const drawerDomRef = common_vendor.ref();
const overlayDomInstanceRef = common_vendor.ref();
const isDrawerShow = common_vendor.ref(false);
const styles = common_vendor.ref(props.drawerStyle[props.popDirection] || {});
common_vendor.watch(() => props.visible, (visible) => {
if (visible) {
isDrawerShow.value = true;
} else {
setTimeout(() => {
isDrawerShow.value = false;
}, 150);
}
}, {
immediate: true
});
function onOverlayClick(e) {
emits("onOverlayClick", e);
}
__expose({
drawerDomRef,
overlayDomRef: (_a = overlayDomInstanceRef.value) == null ? void 0 : _a.overlayDomRef
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.unref(isDrawerShow)
}, common_vendor.unref(isDrawerShow) ? {
b: props.popDirection === "bottom" ? 1 : "",
c: props.popDirection === "right" ? 1 : "",
d: _ctx.visible && props.popDirection === "bottom" ? 1 : "",
e: _ctx.visible && props.popDirection === "right" ? 1 : "",
f: common_vendor.unref(styles).minHeight,
g: common_vendor.unref(styles).maxHeight,
h: common_vendor.unref(styles).borderRadius,
i: common_vendor.unref(styles).boxShadow,
j: common_vendor.unref(styles).width
} : {}, {
k: common_vendor.sr(overlayDomInstanceRef, "c011f16d-0", {
"k": "overlayDomInstanceRef"
}),
l: common_vendor.o$1(onOverlayClick),
m: common_vendor.p({
visible: props.visible,
useMask: props.useMask,
maskColor: props.overlayColor,
isFullScreen: props.isFullScreen
})
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c011f16d"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/common/Drawer/index.js.map

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"overlay": "../Overlay/index"
}
}

View File

@@ -0,0 +1 @@
<overlay wx:if="{{m}}" class="r data-v-c011f16d" u-s="{{['d']}}" u-r="overlayDomInstanceRef" bindonOverlayClick="{{l}}" u-i="c011f16d-0" bind:__l="__l" u-p="{{m}}"><view wx:if="{{a}}" ref="drawerDomRef" class="{{['data-v-c011f16d', 'drawer', b && 'origin-bottom', c && 'origin-right', d && 'slide-bottom', e && 'slide-right']}}" style="{{'min-height:' + f + ';' + ('max-height:' + g) + ';' + ('border-radius:' + h) + ';' + ('box-shadow:' + i) + ';' + ('width:' + j)}}"><view class="drawer-container data-v-c011f16d"><slot/></view></view></overlay>

View File

@@ -0,0 +1,79 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.data-v-c011f16d:not(not) {
display: flex;
flex-direction: column;
box-sizing: border-box;
min-width: 0;
}
.drawer.data-v-c011f16d {
position: absolute;
z-index: 1;
background-color: #fff;
overflow: hidden;
transition: transform 0.15s ease-out;
}
.drawer .drawer-container.data-v-c011f16d {
background-color: #fff;
height: 100%;
width: 100%;
}
.origin-bottom.data-v-c011f16d {
bottom: 0;
left: 0;
right: 0;
transform: translateY(100%);
animation: slide-from-bottom-c011f16d 0.15s ease-out;
}
.origin-right.data-v-c011f16d {
top: 0;
bottom: 0;
right: 0;
transform: translateX(100%);
animation: slide-from-right-c011f16d 0.15s ease-out;
}
.slide-bottom.data-v-c011f16d {
transform: translateY(0);
}
.slide-right.data-v-c011f16d {
transform: translateX(0);
}
@keyframes slide-from-bottom-c011f16d {
0% {
transform: translateY(100%);
}
100% {
transform: translateY(0);
}
}
@keyframes slide-from-right-c011f16d {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(0);
}
}