first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:10:55 +08:00
commit 1c24452b6c
1735 changed files with 150474 additions and 0 deletions

View File

@@ -0,0 +1 @@
"use strict";const e=require("../common/props.js"),o={...e.baseProps,title:String,leftText:String,rightText:String,leftArrow:e.makeBooleanProp(!1),bordered:e.makeBooleanProp(!0),fixed:e.makeBooleanProp(!1),placeholder:e.makeBooleanProp(!1),zIndex:e.makeNumberProp(500),safeAreaInsetTop:e.makeBooleanProp(!1),leftDisabled:e.makeBooleanProp(!1),rightDisabled:e.makeBooleanProp(!1)};exports.navbarProps=o;

View File

@@ -0,0 +1 @@
"use strict";const t=require("../../../../common/vendor.js"),e=require("../common/util.js"),s=require("./types.js");Math||i();const i=()=>"../wd-icon/wd-icon.js",l=t.defineComponent({name:"wd-navbar",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"},props:s.navbarProps,emits:["click-left","click-right"],setup(s,{emit:i}){const l=s,o=i,r=t.ref(""),{statusBarHeight:n}=t.index.getSystemInfoSync();t.watch([()=>l.fixed,()=>l.placeholder],(()=>{h()}),{deep:!0,immediate:!1});const a=t.computed((()=>{const t={};return l.fixed&&e.isDef(l.zIndex)&&(t["z-index"]=l.zIndex),l.safeAreaInsetTop&&(t["padding-top"]=e.addUnit(n||0)),`${e.objToStyle(t)}${l.customStyle}`}));function d(){l.leftDisabled||o("click-left")}function c(){l.rightDisabled||o("click-right")}t.onMounted((()=>{l.fixed&&l.placeholder&&t.nextTick$1((()=>{h()}))}));const{proxy:f}=t.getCurrentInstance();function h(){l.fixed&&l.placeholder&&e.getRect(".wd-navbar",!1,f).then((t=>{r.value=t.height}))}return(s,i)=>t.e({a:s.$slots.capsule},s.$slots.capsule?{}:s.$slots.left?{i:t.n("wd-navbar__left "+(s.leftDisabled?"is-disabled":"")),j:t.o(d)}:t.e({c:s.leftArrow},s.leftArrow?{d:t.p({name:"arrow-left","custom-class":"wd-navbar__arrow"})}:{},{e:s.leftText},s.leftText?{f:t.t(s.leftText)}:{},{g:t.n("wd-navbar__left "+(s.leftDisabled?"is-disabled":"")),h:t.o(d)}),{b:!s.$slots.left,k:!s.$slots.title&&s.title},!s.$slots.title&&s.title?{l:t.t(s.title)}:{},{m:s.$slots.right||s.rightText},s.$slots.right||s.rightText?t.e({n:!s.$slots.right&&s.rightText},!s.$slots.right&&s.rightText?{o:t.t(s.rightText)}:{},{p:t.n("wd-navbar__right "+(s.rightDisabled?"is-disabled":"")),q:t.o(c)}):{},{r:t.n(`wd-navbar ${s.customClass} ${s.fixed?"is-fixed":""} ${s.bordered?"is-border":""}`),s:t.s(a.value),t:t.unref(e.addUnit)(r.value)})}});wx.createComponent(l);

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"wd-icon": "../wd-icon/wd-icon"
}
}

View 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>

View File

@@ -0,0 +1 @@
.wot-theme-dark .wd-navbar{background-color:var(--wot-dark-background, #131313)}.wot-theme-dark .wd-navbar__title,.wot-theme-dark .wd-navbar__text,.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, .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, .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, .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, .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(.5);background:var(--wot-color-border-light, #e8e8e8)}.wd-navbar.is-fixed{position:fixed;top:0;left:0;width:100%;z-index:500}