This commit is contained in:
2026-01-05 12:47:14 +08:00
commit 1fc846fae3
1614 changed files with 162035 additions and 0 deletions

View File

@@ -0,0 +1 @@
"use strict";const t=require("../../../../common/vendor.js"),e=require("../_utils/common.js");require("../_utils/env.js");const o=require("../_hooks/useTouch.js");exports.useTabContentTouch=function(i,a,n,s){const r=t.ref(),l=`tabsContentRef-${e.getRandomId()}`,u=t.ref({width:0,height:0});t.onMounted((()=>{setTimeout((()=>{(async()=>{var t,e;if(n){const t=await s(l,n);u.value.width=t.width||0,u.value.height=t.height||0}else u.value.width=(null==(t=r.value)?void 0:t.clientWidth)||0,u.value.height=(null==(e=r.value)?void 0:e.clientHeight)||0})()}),100)}));const c=t.reactive({offset:0,moving:!1}),h=o.useTouch();let v="";return{touchMethods:{onTouchStart(t){i.swipeable&&h.start(t)},onTouchMove(t){i.swipeable&&(h.move(t),c.moving=!0,((t,e)=>{var o;let n=t;switch("horizontal"===i.direction?(v=t>0?"right":"left",n=Math.abs(n)/u.value.width*100):(v=e>0?"bottom":"top",n=e,n=Math.abs(n)/(null==(o=u.value)?void 0:o.height)*100),n>85&&(n=85),v){case"left":case"top":a.isEnd()&&(n=0,c.moving=!1);break;case"right":case"bottom":n=-n,a.isBegin()&&(n=0,c.moving=!1)}c.offset=n})(h.deltaX.value,h.deltaY.value),"horizontal"===i.direction&&h.isHorizontal()&&(t.preventDefault(),t.stopPropagation()),"vertical"===i.direction&&h.isVertical()&&(t.preventDefault(),t.stopPropagation()))},onTouchEnd(){if(c.moving)switch(c.moving=!1,v){case"left":case"top":c.offset>35&&a.next();break;case"right":case"bottom":c.offset<-35&&a.prev()}}},touchState:c,tabsContentRef:r,tabsContentID:l}};

View File

@@ -0,0 +1 @@
"use strict";const e=require("../_constants/event.js"),t=require("../_utils/is.js");require("../_utils/env.js");const r=require("../_utils/props.js"),i=Symbol("tabs"),o={...r.commonProps,modelValue:r.makeNumericProp(0),customColor:String,direction:r.makeStringProp("horizontal"),size:r.makeStringProp("normal"),type:r.makeStringProp("line"),titleScroll:Boolean,ellipsis:r.truthProp,swipeable:Boolean,autoHeight:Boolean,background:String,animatedTime:r.makeNumericProp(300),titleGutter:r.makeNumericProp(0),align:r.makeStringProp("center")},s={[e.CLICK_EVENT]:e=>e instanceof Object,[e.CHANGE_EVENT]:e=>e instanceof Object,[e.UPDATE_MODEL_EVENT]:e=>t.isString(e)};exports.TAB_KEY=i,exports.Title=class{constructor(){this.title="",this.paneKey="",this.disabled=!1}},exports.tabsEmits=s,exports.tabsProps=o;

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -0,0 +1 @@
<view ref="container" style="{{C}}" class="{{D}}"><scroll-view id="{{j}}" scroll-x="{{k}}" scroll-y="{{l}}" scroll-with-animation="{{m}}" scroll-left="{{n}}" scroll-top="{{o}}" enable-flex="{{true}}" class="{{['nut-tabs__titles', q && p, r && 'scrollable', t && s]}}" style="{{v}}"><view class="{{['nut-tabs__list', i && 'nut-tabs__titles-left']}}"><slot wx:if="{{a}}" name="titles"/><block wx:else><view wx:for="{{b}}" wx:for-item="item" wx:key="f" style="{{f}}" class="{{['nut-tabs__titles-item', 'uni', item.g && 'nut-tabs-active', item.h && 'disabled', g && 'nut-tabs__titles-item-left']}}" bindtap="{{item.i}}"><view wx:if="{{c}}" class="nut-tabs__titles-item__line" style="{{item.a}}"/><view wx:if="{{d}}" class="nut-tabs__titles-item__smile" style="{{item.d}}"><nut-icon wx:if="{{item.c}}" u-i="{{item.b}}" bind:__l="__l" u-p="{{item.c}}"/></view><view class="{{['nut-tabs__titles-item__text', e && 'ellipsis']}}">{{item.e}}</view></view><view wx:if="{{h}}" class="nut-tabs__titles-placeholder"/></block></view></scroll-view><view id="{{w}}" ref="tabsContentRef" class="nut-tabs__content" style="{{x}}" bindtouchstart="{{y}}" bindtouchmove="{{z}}" bindtouchend="{{A}}" bindtouchcancel="{{B}}"><slot/></view></view>

File diff suppressed because one or more lines are too long