first commit
This commit is contained in:
85
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.js
vendored
Normal file
85
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.js
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
"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_overlay_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 common_vendor = require("../../../../common/vendor.js");
|
||||
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-overlay`;
|
||||
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
|
||||
name,
|
||||
options: {
|
||||
styleIsolation: "shared"
|
||||
},
|
||||
mixins: [
|
||||
uni_modules_tdesignUniapp_components_mixins_transition.transition(),
|
||||
uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar.useCustomNavbarBehavior
|
||||
],
|
||||
props: {
|
||||
...uni_modules_tdesignUniapp_components_overlay_props.props
|
||||
},
|
||||
emits: [
|
||||
"click",
|
||||
"leaved"
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
|
||||
classPrefix: name,
|
||||
computedStyle: "",
|
||||
_zIndex: 11e3,
|
||||
tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
backgroundColor: {
|
||||
handler(v) {
|
||||
this.computedStyle = v ? `background-color: ${v};` : "";
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
zIndex: {
|
||||
handler(v) {
|
||||
if (v !== 0) {
|
||||
this._zIndex = v;
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.$emit("click", {
|
||||
visible: !this.visible
|
||||
});
|
||||
},
|
||||
noop() {
|
||||
}
|
||||
}
|
||||
});
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: _ctx.realVisible && _ctx.preventScrollThrough
|
||||
}, _ctx.realVisible && _ctx.preventScrollThrough ? {
|
||||
b: common_vendor.n(_ctx.prefix + "-overlay " + _ctx.transitionClass),
|
||||
c: common_vendor.s(_ctx.tools._style(["--td-overlay-transition-duration:" + _ctx.duration + "ms", "z-index:" + _ctx._zIndex, "top:" + _ctx.distanceTop + "px", _ctx.computedStyle, _ctx.customStyle])),
|
||||
d: _ctx.ariaRole || "button",
|
||||
e: _ctx.ariaLabel || "关闭",
|
||||
f: common_vendor.o((...args) => _ctx.handleClick && _ctx.handleClick(...args)),
|
||||
g: common_vendor.o((...args) => _ctx.noop && _ctx.noop(...args)),
|
||||
h: common_vendor.o((...args) => _ctx.onTransitionEnd && _ctx.onTransitionEnd(...args))
|
||||
} : _ctx.realVisible ? {
|
||||
j: common_vendor.n(_ctx.prefix + "-overlay " + _ctx.transitionClass),
|
||||
k: common_vendor.s(_ctx.tools._style(["z-index:" + _ctx._zIndex, "top:" + _ctx.distanceTop + "px", _ctx.computedStyle, _ctx.customStyle])),
|
||||
l: _ctx.ariaRole || "button",
|
||||
m: _ctx.ariaLabel || "关闭",
|
||||
n: common_vendor.o((...args) => _ctx.handleClick && _ctx.handleClick(...args)),
|
||||
o: common_vendor.o((...args) => _ctx.onTransitionEnd && _ctx.onTransitionEnd(...args))
|
||||
} : {}, {
|
||||
i: _ctx.realVisible
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8997f975"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="data-v-8997f975"><view wx:if="{{a}}" class="{{['data-v-8997f975', b]}}" style="{{c}}" aria-role="{{d}}" aria-label="{{e}}" disable-scroll catchtap="{{f}}" catchtouchmove="{{g}}" bindtransitionend="{{h}}"><slot/></view><view wx:elif="{{i}}" class="{{['data-v-8997f975', j]}}" style="{{k}}" aria-role="{{l}}" aria-label="{{m}}" catchtap="{{n}}" bindtransitionend="{{o}}"><slot/></view></view>
|
||||
17
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.wxss
vendored
Normal file
17
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.wxss
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
.t-overlay.data-v-8997f975 {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
background-color: var(--td-overlay-bg-color, var(--td-mask-active, rgba(0, 0, 0, 0.6)));
|
||||
transition-property: opacity;
|
||||
transition-duration: var(--td-overlay-transition-duration, 300ms);
|
||||
transition-timing-function: ease;
|
||||
}
|
||||
.t-fade-enter.data-v-8997f975 {
|
||||
opacity: 0;
|
||||
}
|
||||
.t-fade-leave-to.data-v-8997f975 {
|
||||
opacity: 0;
|
||||
}
|
||||
34
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/props.js
vendored
Normal file
34
unpackage/dist/dev/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/props.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
const props = {
|
||||
/** 遮罩层的背景色 */
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
/** 背景色过渡时间,单位毫秒 */
|
||||
duration: {
|
||||
type: Number,
|
||||
default: 300
|
||||
},
|
||||
/** 防止滚动穿透,即不允许点击和滚动 */
|
||||
preventScrollThrough: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
/** 是否使用了自定义导航栏 */
|
||||
usingCustomNavbar: Boolean,
|
||||
/** 是否展示 */
|
||||
visible: Boolean,
|
||||
/** 遮罩层级 */
|
||||
zIndex: {
|
||||
type: Number,
|
||||
default: 11e3
|
||||
},
|
||||
/** 点击遮罩时触发 */
|
||||
onClick: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
}
|
||||
};
|
||||
exports.props = props;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/props.js.map
|
||||
Reference in New Issue
Block a user