first commit

This commit is contained in:
lingxiao865
2026-02-10 08:05:03 +08:00
commit c5af079d8c
1094 changed files with 97530 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
"use strict";
function getPopupStyles({ zIndex, distanceTop, placement, duration }) {
let zIndexStyle = zIndex ? `z-index:${zIndex};` : "";
if ((placement === "top" || placement === "left" || placement === "right") && distanceTop) {
zIndexStyle = `${zIndexStyle}top:${distanceTop}px;--td-popup-distance-top:${distanceTop}px;`;
}
if (duration) {
zIndexStyle = `${zIndexStyle}--td-popup-transition:all ${duration}ms ease;`;
}
return zIndexStyle;
}
const popup = {
getPopupStyles
};
exports.popup = popup;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/popup/computed.js.map

View File

@@ -0,0 +1,140 @@
"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_popup_props = require("./props.js");
const uni_modules_tdesignUniapp_components_mixins_transition = require("../mixins/transition.js");
const uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar = require("../mixins/using-custom-navbar.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const uni_modules_tdesignUniapp_components_popup_computed = require("./computed.js");
const common_vendor = require("../../../../common/vendor.js");
const TOverlay = () => "../overlay/overlay.js";
const TIcon = () => "../icon/icon.js";
delete uni_modules_tdesignUniapp_components_popup_props.props.visible;
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-popup`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
name,
options: {
styleIsolation: "shared"
},
externalClasses: [
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class`,
`${uni_modules_tdesignUniapp_components_common_config.prefix}-class-content`
],
mixins: [uni_modules_tdesignUniapp_components_mixins_transition.transitionMixins, uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar.useCustomNavbarBehavior],
components: {
TOverlay,
TIcon
},
props: {
...uni_modules_tdesignUniapp_components_popup_props.props
},
emits: [
"visible-change",
"leaved",
"update:visible"
],
data() {
return {
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
classPrefix: name,
popup: uni_modules_tdesignUniapp_components_popup_computed.popup,
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools
};
},
computed: {
innerPreventScrollThrough() {
const { preventScrollThrough, overlayProps } = this;
return preventScrollThrough || (overlayProps ? !!overlayProps.preventScrollThrough : false);
}
},
methods: {
noop() {
},
handleOverlayClick() {
const { closeOnOverlayClick } = this;
if (closeOnOverlayClick) {
this.$emit("visible-change", { visible: false, trigger: "overlay" });
this.$emit("update:visible", false);
}
},
handleClose() {
this.$emit("visible-change", { visible: false, trigger: "close-btn" });
this.$emit("update:visible", false);
}
}
});
if (!Array) {
const _easycom_t_icon2 = common_vendor.resolveComponent("t-icon");
const _easycom_t_overlay2 = common_vendor.resolveComponent("t-overlay");
(_easycom_t_icon2 + _easycom_t_overlay2)();
}
const _easycom_t_icon = () => "../icon/icon.js";
const _easycom_t_overlay = () => "../overlay/overlay.js";
if (!Math) {
(_easycom_t_icon + _easycom_t_overlay)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.realVisible
}, _ctx.realVisible ? common_vendor.e({
b: _ctx.innerPreventScrollThrough
}, _ctx.innerPreventScrollThrough ? common_vendor.e({
c: _ctx.closeBtn
}, _ctx.closeBtn ? {
d: common_vendor.p({
name: "close",
size: "64rpx"
})
} : {}, {
e: common_vendor.r("close-btn", {
class: _ctx.classPrefix + "-slot"
}),
f: common_vendor.n(_ctx.classPrefix + "__close"),
g: common_vendor.o((...args) => _ctx.handleClose && _ctx.handleClose(...args)),
h: common_vendor.n(_ctx.classPrefix + "__content " + _ctx.tClassContent),
i: common_vendor.o((...args) => _ctx.noop && _ctx.noop(...args))
}) : common_vendor.e({
j: _ctx.closeBtn
}, _ctx.closeBtn ? {
k: common_vendor.p({
name: "close",
size: "64rpx"
})
} : {}, {
l: common_vendor.r("close-btn", {
class: _ctx.classPrefix + "-slot"
}),
m: common_vendor.n(_ctx.classPrefix + "__close"),
n: common_vendor.o((...args) => _ctx.handleClose && _ctx.handleClose(...args)),
o: common_vendor.n(_ctx.classPrefix + "__content " + _ctx.tClassContent)
}), {
p: common_vendor.s(_ctx.tools._style([_ctx.popup.getPopupStyles({
zIndex: _ctx.zIndex,
distanceTop: _ctx.distanceTop,
placement: _ctx.placement,
duration: _ctx.duration
}), _ctx.customStyle])),
q: common_vendor.n(_ctx.tools.cls(_ctx.classPrefix, [_ctx.placement]) + " " + _ctx.transitionClass + " " + _ctx.tClass),
r: common_vendor.o((...args) => _ctx.onTransitionEnd && _ctx.onTransitionEnd(...args))
}) : {}, {
s: _ctx.showOverlay
}, _ctx.showOverlay ? {
t: common_vendor.o(($event) => _ctx.handleOverlayClick($event, {
tagId: "popup-overlay"
})),
v: common_vendor.p({
id: "popup-overlay",
visible: _ctx.visible,
["using-custom-navbar"]: _ctx.usingCustomNavbar,
["custom-navbar-height"]: _ctx.customNavbarHeight,
["z-index"]: _ctx.overlayProps && _ctx.overlayProps.zIndex || 11e3,
duration: _ctx.overlayProps && _ctx.overlayProps.duration || 300,
["background-color"]: _ctx.overlayProps && _ctx.overlayProps.backgroundColor || "",
["prevent-scroll-through"]: _ctx.preventScrollThrough || (_ctx.overlayProps ? !!_ctx.overlayProps.preventScrollThrough : false),
["custom-style"]: _ctx.overlayProps && _ctx.overlayProps.style || ""
})
} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cb4f1fe8"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/popup/popup.js.map

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"t-overlay": "../overlay/overlay",
"t-icon": "../icon/icon"
}
}

View File

@@ -0,0 +1 @@
<view class="data-v-cb4f1fe8"><view wx:if="{{a}}" style="{{p}}" class="{{['data-v-cb4f1fe8', q]}}" bindtransitionend="{{r}}"><view wx:if="{{b}}" class="{{['data-v-cb4f1fe8', h]}}" catchtouchmove="{{i}}"><slot name="content"/><slot/><view class="{{['data-v-cb4f1fe8', f]}}" bindtap="{{g}}"><t-icon wx:if="{{c}}" class="data-v-cb4f1fe8" u-i="cb4f1fe8-0" bind:__l="__l" u-p="{{d}}"/><slot name="close-btn"/></view></view><view wx:else class="{{['data-v-cb4f1fe8', o]}}"><slot name="content"/><slot/><view class="{{['data-v-cb4f1fe8', m]}}" bindtap="{{n}}"><t-icon wx:if="{{j}}" class="data-v-cb4f1fe8" u-i="cb4f1fe8-1" bind:__l="__l" u-p="{{k}}"/><slot name="close-btn"/></view></view></view><t-overlay wx:if="{{s}}" class="data-v-cb4f1fe8" id="popup-overlay" bindclick="{{t}}" u-i="cb4f1fe8-2" bind:__l="__l" u-p="{{v}}"/></view>

View File

@@ -0,0 +1,80 @@
.t-popup.data-v-cb4f1fe8 {
position: fixed;
z-index: 11500;
max-height: calc(100vh - var(--td-popup-distance-top, 0));
transition: var(--td-popup-transition, all 300ms ease);
background-color: var(--td-popup-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
}
.t-popup__content.data-v-cb4f1fe8 {
position: relative;
height: 100%;
z-index: 1;
}
.t-popup__close.data-v-cb4f1fe8 {
position: absolute;
top: 0;
right: 0;
padding: 20rpx;
line-height: 1;
color: var(--td-popup-close-btn-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
}
.t-popup--top.data-v-cb4f1fe8 {
top: 0;
left: 0;
width: 100%;
border-bottom-left-radius: var(--td-popup-border-radius, var(--td-radius-extraLarge, 24rpx));
border-bottom-right-radius: var(--td-popup-border-radius, var(--td-radius-extraLarge, 24rpx));
}
.t-popup--bottom.data-v-cb4f1fe8 {
bottom: 0;
left: 0;
width: 100%;
border-top-left-radius: var(--td-popup-border-radius, var(--td-radius-extraLarge, 24rpx));
border-top-right-radius: var(--td-popup-border-radius, var(--td-radius-extraLarge, 24rpx));
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.t-popup--left.data-v-cb4f1fe8 {
top: 0;
left: 0;
height: 100%;
}
.t-popup--right.data-v-cb4f1fe8 {
top: 0;
right: 0;
height: 100%;
}
.t-popup--center.data-v-cb4f1fe8 {
top: 50%;
left: 50%;
transform: scale(1) translate3d(-50%, -50%, 0);
transform-origin: 0% 0%;
border-radius: var(--td-popup-border-radius, var(--td-radius-extraLarge, 24rpx));
}
.t-popup.t-fade-enter.t-popup--top.data-v-cb4f1fe8,
.t-popup.t-fade-leave-to.t-popup--top.data-v-cb4f1fe8 {
transform: translateY(-100%);
transform-origin: 0% 0%;
}
.t-popup.t-fade-enter.t-popup--bottom.data-v-cb4f1fe8,
.t-popup.t-fade-leave-to.t-popup--bottom.data-v-cb4f1fe8 {
transform: translateY(100%);
}
.t-popup.t-fade-enter.t-popup--left.data-v-cb4f1fe8,
.t-popup.t-fade-leave-to.t-popup--left.data-v-cb4f1fe8 {
transform: translateX(-100%);
}
.t-popup.t-fade-enter.t-popup--right.data-v-cb4f1fe8,
.t-popup.t-fade-leave-to.t-popup--right.data-v-cb4f1fe8 {
transform: translateX(100%);
}
.t-popup.t-fade-enter.t-popup--center.data-v-cb4f1fe8,
.t-popup.t-fade-leave-to.t-popup--center.data-v-cb4f1fe8 {
transform: scale(0.6) translate3d(-50%, -50%, 0);
opacity: 0;
}
.t-popup.t-dialog-enter.t-popup--center.data-v-cb4f1fe8,
.t-popup.t-dialog-leave-to.t-popup--center.data-v-cb4f1fe8 {
transform: scale(0.6) translate3d(-50%, -50%, 0);
opacity: 0;
}

View File

@@ -0,0 +1,64 @@
"use strict";
const props = {
/** 关闭按钮,值类型为 Boolean 时表示是否显示关闭按钮。也可以自定义关闭按钮 */
closeBtn: {
type: Boolean
},
/** 点击遮罩层是否关闭 */
closeOnOverlayClick: {
type: Boolean,
default: true
},
/** 浮层里面的内容 */
content: {
type: String
},
/** 动画过渡时间 */
duration: {
type: Number,
default: 240
},
/** 遮罩层的属性,透传至 overlay */
overlayProps: {
type: Object,
default: () => ({})
},
/** 浮层出现位置 */
placement: {
type: String,
default: "top",
validator(val) {
if (!val)
return true;
return ["top", "left", "right", "bottom", "center"].includes(val);
}
},
/** 是否阻止背景滚动 */
preventScrollThrough: {
type: Boolean,
default: true
},
/** 是否显示遮罩层 */
showOverlay: {
type: Boolean,
default: true
},
/** 是否使用了自定义导航栏 */
usingCustomNavbar: Boolean,
/** 是否显示浮层 */
visible: Boolean,
/** 是否显示浮层,非受控属性 */
defaultVisible: Boolean,
/** 组件层级Web 侧样式默认为 5500移动端样式默认为 1500小程序样式默认为11500 */
zIndex: {
type: Number,
default: 11500
},
/** 当浮层隐藏或显示时触发 */
onVisibleChange: {
type: Function,
default: () => ({})
}
};
exports.props = props;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/popup/props.js.map