first commit
This commit is contained in:
51
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/types.js
vendored
Normal file
51
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/types.js
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
const uni_modules_wotDesignUni_components_common_props = require("../common/props.js");
|
||||
const navbarProps = {
|
||||
...uni_modules_wotDesignUni_components_common_props.baseProps,
|
||||
/**
|
||||
* 标题文字
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* 左侧文案
|
||||
*/
|
||||
leftText: String,
|
||||
/**
|
||||
* 右侧文案
|
||||
*/
|
||||
rightText: String,
|
||||
/**
|
||||
* 是否显示左侧箭头
|
||||
*/
|
||||
leftArrow: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否显示下边框
|
||||
*/
|
||||
bordered: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(true),
|
||||
/**
|
||||
* 是否固定到顶部
|
||||
*/
|
||||
fixed: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 固定在顶部时,是否在标签位置生成一个等高的占位元素
|
||||
*/
|
||||
placeholder: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 导航栏 z-index
|
||||
*/
|
||||
zIndex: uni_modules_wotDesignUni_components_common_props.makeNumberProp(500),
|
||||
/**
|
||||
* 是否开启顶部安全区适配
|
||||
*/
|
||||
safeAreaInsetTop: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否禁用左侧按钮,禁用时透明度降低,且无法点击
|
||||
*/
|
||||
leftDisabled: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false),
|
||||
/**
|
||||
* 是否禁用右侧按钮,禁用时透明度降低,且无法点击
|
||||
*/
|
||||
rightDisabled: uni_modules_wotDesignUni_components_common_props.makeBooleanProp(false)
|
||||
};
|
||||
exports.navbarProps = navbarProps;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/types.js.map
|
||||
112
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.js
vendored
Normal file
112
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.js
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_wotDesignUni_components_common_util = require("../common/util.js");
|
||||
const uni_modules_wotDesignUni_components_wdNavbar_types = require("./types.js");
|
||||
if (!Math) {
|
||||
wdIcon();
|
||||
}
|
||||
const wdIcon = () => "../wd-icon/wd-icon.js";
|
||||
const __default__ = {
|
||||
name: "wd-navbar",
|
||||
options: {
|
||||
virtualHost: true,
|
||||
addGlobalClass: true,
|
||||
styleIsolation: "shared"
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
...__default__,
|
||||
props: uni_modules_wotDesignUni_components_wdNavbar_types.navbarProps,
|
||||
emits: ["click-left", "click-right"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
const props = __props;
|
||||
const emit = __emit;
|
||||
const height = common_vendor.ref("");
|
||||
const { statusBarHeight } = common_vendor.index.getSystemInfoSync();
|
||||
common_vendor.watch(
|
||||
[() => props.fixed, () => props.placeholder],
|
||||
() => {
|
||||
setPlaceholderHeight();
|
||||
},
|
||||
{ deep: true, immediate: false }
|
||||
);
|
||||
const rootStyle = common_vendor.computed(() => {
|
||||
const style = {};
|
||||
if (props.fixed && uni_modules_wotDesignUni_components_common_util.isDef(props.zIndex)) {
|
||||
style["z-index"] = props.zIndex;
|
||||
}
|
||||
if (props.safeAreaInsetTop) {
|
||||
style["padding-top"] = uni_modules_wotDesignUni_components_common_util.addUnit(statusBarHeight || 0);
|
||||
}
|
||||
return `${uni_modules_wotDesignUni_components_common_util.objToStyle(style)}${props.customStyle}`;
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
if (props.fixed && props.placeholder) {
|
||||
common_vendor.nextTick$1(() => {
|
||||
setPlaceholderHeight();
|
||||
});
|
||||
}
|
||||
});
|
||||
function handleClickLeft() {
|
||||
if (!props.leftDisabled) {
|
||||
emit("click-left");
|
||||
}
|
||||
}
|
||||
function handleClickRight() {
|
||||
if (!props.rightDisabled) {
|
||||
emit("click-right");
|
||||
}
|
||||
}
|
||||
const { proxy } = common_vendor.getCurrentInstance();
|
||||
function setPlaceholderHeight() {
|
||||
if (!props.fixed || !props.placeholder) {
|
||||
return;
|
||||
}
|
||||
uni_modules_wotDesignUni_components_common_util.getRect(".wd-navbar", false, proxy).then((res) => {
|
||||
height.value = res.height;
|
||||
});
|
||||
}
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: _ctx.$slots.capsule
|
||||
}, _ctx.$slots.capsule ? {} : !_ctx.$slots.left ? common_vendor.e({
|
||||
c: _ctx.leftArrow
|
||||
}, _ctx.leftArrow ? {
|
||||
d: common_vendor.p({
|
||||
name: "arrow-left",
|
||||
["custom-class"]: "wd-navbar__arrow"
|
||||
})
|
||||
} : {}, {
|
||||
e: _ctx.leftText
|
||||
}, _ctx.leftText ? {
|
||||
f: common_vendor.t(_ctx.leftText)
|
||||
} : {}, {
|
||||
g: common_vendor.n(`wd-navbar__left ${_ctx.leftDisabled ? "is-disabled" : ""}`),
|
||||
h: common_vendor.o(handleClickLeft)
|
||||
}) : {
|
||||
i: common_vendor.n(`wd-navbar__left ${_ctx.leftDisabled ? "is-disabled" : ""}`),
|
||||
j: common_vendor.o(handleClickLeft)
|
||||
}, {
|
||||
b: !_ctx.$slots.left,
|
||||
k: !_ctx.$slots.title && _ctx.title
|
||||
}, !_ctx.$slots.title && _ctx.title ? {
|
||||
l: common_vendor.t(_ctx.title)
|
||||
} : {}, {
|
||||
m: _ctx.$slots.right || _ctx.rightText
|
||||
}, _ctx.$slots.right || _ctx.rightText ? common_vendor.e({
|
||||
n: !_ctx.$slots.right && _ctx.rightText
|
||||
}, !_ctx.$slots.right && _ctx.rightText ? {
|
||||
o: common_vendor.t(_ctx.rightText)
|
||||
} : {}, {
|
||||
p: common_vendor.n(`wd-navbar__right ${_ctx.rightDisabled ? "is-disabled" : ""}`),
|
||||
q: common_vendor.o(handleClickRight)
|
||||
}) : {}, {
|
||||
r: common_vendor.n(`wd-navbar ${_ctx.customClass} ${_ctx.fixed ? "is-fixed" : ""} ${_ctx.bordered ? "is-border" : ""}`),
|
||||
s: common_vendor.s(rootStyle.value),
|
||||
t: common_vendor.unref(uni_modules_wotDesignUni_components_common_util.addUnit)(height.value)
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
wx.createComponent(_sfc_main);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.js.map
|
||||
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.json
vendored
Normal file
6
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"wd-icon": "../wd-icon/wd-icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view style="{{'height:' + t}}"><view class="{{r}}" style="{{s}}"><view class="wd-navbar__content"><view wx:if="{{a}}" class="wd-navbar__capsule"><slot name="capsule"/></view><view wx:elif="{{b}}" class="{{g}}" bindtap="{{h}}"><wd-icon wx:if="{{c}}" u-i="a56cc726-0" bind:__l="__l" u-p="{{d}}"/><view wx:if="{{e}}" class="wd-navbar__text">{{f}}</view></view><view wx:else class="{{i}}" bindtap="{{j}}"><slot name="left"/></view><view class="wd-navbar__title"><slot name="title"/><block wx:if="{{k}}">{{l}}</block></view><view wx:if="{{m}}" class="{{p}}" bindtap="{{q}}"><slot name="right"/><view wx:if="{{n}}" class="wd-navbar__text" hover-class="wd-navbar__text--hover" hover-stay-time="{{70}}">{{o}}</view></view></view></view></view>
|
||||
252
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.wxss
vendored
Normal file
252
unpackage/dist/dev/mp-weixin/uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.wxss
vendored
Normal file
@@ -0,0 +1,252 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
/**
|
||||
* 混合宏
|
||||
*/
|
||||
/**
|
||||
* 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-navbar {
|
||||
background-color: var(--wot-dark-background, #131313);
|
||||
}
|
||||
.wot-theme-dark .wd-navbar__title {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-navbar__text {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wot-theme-dark .wd-navbar .wd-navbar__arrow {
|
||||
color: var(--wot-dark-color, var(--wot-color-white, white));
|
||||
}
|
||||
.wd-navbar {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
height: var(--wot-navbar-height, 44px);
|
||||
line-height: var(--wot-navbar-height, 44px);
|
||||
background-color: var(--wot-navbar-background, var(--wot-color-white, white));
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.wd-navbar__content {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.wd-navbar__title {
|
||||
max-width: 60%;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
color: var(--wot-navbar-color, var(--wot-font-gray-1, rgba(0, 0, 0, 0.9)));
|
||||
font-weight: var(--wot-navbar-title-font-weight, 600);
|
||||
font-size: var(--wot-navbar-title-font-size, 18px);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wd-navbar__text {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
color: var(--wot-navbar-desc-font-color, var(--wot-font-gray-1, rgba(0, 0, 0, 0.9)));
|
||||
}
|
||||
.wd-navbar__left, .wd-navbar__right, .wd-navbar__capsule {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
font-size: var(--wot-navbar-desc-font-size, 16px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 12px;
|
||||
}
|
||||
.wd-navbar__left.is-disabled, .wd-navbar__right.is-disabled, .wd-navbar__capsule.is-disabled {
|
||||
opacity: var(--wot-navbar-disabled-opacity, 0.6);
|
||||
}
|
||||
.wd-navbar__left, .wd-navbar__capsule {
|
||||
left: 0;
|
||||
}
|
||||
.wd-navbar__right {
|
||||
right: 0;
|
||||
}
|
||||
.wd-navbar__arrow {
|
||||
font-size: var(--wot-navbar-arrow-size, 24px);
|
||||
color: var(--wot-navbar-color, var(--wot-font-gray-1, rgba(0, 0, 0, 0.9)));
|
||||
}
|
||||
.wd-navbar.is-border {
|
||||
position: relative;
|
||||
}
|
||||
.wd-navbar.is-border::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
transform: scaleY(0.5);
|
||||
background: var(--wot-color-border-light, #e8e8e8);
|
||||
}
|
||||
.wd-navbar.is-fixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 500;
|
||||
}
|
||||
Reference in New Issue
Block a user