初始化项目, 添加TDesign等包

This commit is contained in:
zhengw
2025-11-28 16:49:36 +08:00
commit 3e53beb7bb
980 changed files with 39201 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import { TdTabPanelProps } from './type';
declare const props: TdTabPanelProps;
export default props;

View File

@@ -0,0 +1 @@
const props={badgeProps:{type:Object},disabled:{type:Boolean,value:!1},icon:{type:null},label:{type:String,value:""},lazy:{type:Boolean,value:!1},panel:{type:String},value:{type:null}};export default props;

View File

@@ -0,0 +1,25 @@
/// <reference types="miniprogram-api-typings" />
import { SuperComponent, RelationsOptions } from '../common/src/index';
export default class TabPanel extends SuperComponent {
externalClasses: string[];
relations: RelationsOptions;
options: {
multipleSlots: boolean;
};
properties: import("./type").TdTabPanelProps;
data: {
prefix: string;
classPrefix: string;
active: boolean;
hide: boolean;
id: string;
hasActivated: boolean;
};
setId(id: any): void;
observers: {
'label, badgeProps, disabled, icon, panel, value, lazy'(): void;
};
getComputedName(): string;
update(): void;
render(active: Boolean, parent: WechatMiniprogram.Component.TrivialInstance): void;
}

View File

@@ -0,0 +1 @@
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import props from"./props";import config from"../common/config";const{prefix:prefix}=config,name=`${prefix}-tab-panel`;let TabPanel=class extends SuperComponent{constructor(){super(...arguments),this.externalClasses=[`${prefix}-class`],this.relations={"../tabs/tabs":{type:"ancestor"}},this.options={multipleSlots:!0},this.properties=props,this.data={prefix:prefix,classPrefix:name,active:!1,hide:!0,id:"",hasActivated:!1},this.observers={"label, badgeProps, disabled, icon, panel, value, lazy"(){this.update()}}}setId(e){this.setData({id:e})}getComputedName(){return null!=this.properties.value?`${this.properties.value}`:`${this.index}`}update(){var e;null===(e=this.$parent)||void 0===e||e.updateTabs()}render(e,t){this.initialized=this.initialized||e,e&&!this.data.hasActivated&&this.setData({hasActivated:!0}),this.setData({active:e,hide:!t.data.animation&&!e})}};TabPanel=__decorate([wxComponent()],TabPanel);export default TabPanel;

View File

@@ -0,0 +1 @@
{"component":true,"styleIsolation":"apply-shared","usingComponents":{}}

View File

@@ -0,0 +1 @@
<wxs src="../common/utils.wxs" module="_"/><view wx:if="{{!lazy || hasActivated}}" class="class {{prefix}}-class {{classPrefix}} {{active ? classPrefix + '--active': classPrefix + '--inactive'}}" style="{{_._style([style, customStyle, (hide ? 'display: none' : '')])}}" id="{{id}}" aria-role="tabpanel"><view wx:if="{{panel}}">{{panel}}</view><slot/><slot name="panel"/></view>

View File

@@ -0,0 +1,3 @@
@import '../common/style/index.wxss';.t-tab-panel{flex-shrink:0;width:100%;height:100%;box-sizing:border-box;overflow-y:auto;-webkit-overflow-scrolling:touch;}
.t-tab-panel--active{height:auto;}
.t-tab-panel--inactive{height:0;overflow:visible;}

View File

@@ -0,0 +1,31 @@
import { TabValue } from '../tabs/index';
export interface TdTabPanelProps {
badgeProps?: {
type: ObjectConstructor;
value?: object;
};
disabled?: {
type: BooleanConstructor;
value?: boolean;
};
icon?: {
type: null;
value?: string | object;
};
label?: {
type: StringConstructor;
value?: string;
};
lazy?: {
type: BooleanConstructor;
value?: boolean;
};
panel?: {
type: StringConstructor;
value?: string;
};
value?: {
type: null;
value?: TabValue;
};
}

View File

@@ -0,0 +1 @@
export{};