初始化项目, 添加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,22 @@
import { SuperComponent, RelationsOptions } from '../common/src/index';
export default class Cell extends SuperComponent {
externalClasses: string[];
relations: RelationsOptions;
options: {
multipleSlots: boolean;
};
properties: import("./type").TdCellProps;
data: {
prefix: string;
classPrefix: string;
isLastChild: boolean;
};
observers: {
leftIcon(v: any): void;
rightIcon(v: any): void;
arrow(v: any): void;
};
setIcon(name: any, value: any, defaultValue: any): void;
onClick(e: any): void;
jumpLink(urlKey?: string, link?: string): void;
}

View File

@@ -0,0 +1 @@
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import{calcIcon}from"../common/utils";const{prefix:prefix}=config,name=`${prefix}-cell`;let Cell=class extends SuperComponent{constructor(){super(...arguments),this.externalClasses=[`${prefix}-class`,`${prefix}-class-title`,`${prefix}-class-description`,`${prefix}-class-note`,`${prefix}-class-hover`,`${prefix}-class-image`,`${prefix}-class-left`,`${prefix}-class-left-icon`,`${prefix}-class-center`,`${prefix}-class-right`,`${prefix}-class-right-icon`],this.relations={"../cell-group/cell-group":{type:"parent"}},this.options={multipleSlots:!0},this.properties=props,this.data={prefix:prefix,classPrefix:name,isLastChild:!1},this.observers={leftIcon(e){this.setIcon("_leftIcon",e,"")},rightIcon(e){this.setIcon("_rightIcon",e,"")},arrow(e){this.setIcon("_arrow",e,"chevron-right")}}}setIcon(e,t,s){this.setData({[e]:calcIcon(t,s)})}onClick(e){this.triggerEvent("click",e.detail),this.jumpLink()}jumpLink(e="url",t="jumpType"){const s=this.data[e],i=this.data[t];s&&wx[i]({url:s})}};Cell=__decorate([wxComponent()],Cell);export default Cell;

View File

@@ -0,0 +1 @@
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"t-icon":"../icon/icon","t-image":"../image/image"}}

View File

@@ -0,0 +1 @@
<import src="../common/template/icon.wxml"/><wxs src="../common/utils.wxs" module="_"/><view style="{{_._style([style, customStyle])}}" class="class {{prefix}}-class {{_.cls(classPrefix, [['bordered', bordered && !isLastChild]])}}" hover-class="{{ hover ? classPrefix + '--hover' : ''}}" hover-stay-time="70" bind:tap="onClick" aria-role="{{ariaRole || (arrow ? 'button' : '')}}" aria-label="{{ariaLabel}}"><view class="{{classPrefix}}__left {{prefix}}-class-left"><template wx:if="{{_leftIcon}}" is="icon" data="{{tClass: classPrefix + '__left-icon ' + prefix + '-class-left-icon', ..._leftIcon }}"/><slot name="left-icon"/><t-image wx:if="{{ image }}" shape="round" t-class="{{classPrefix}}__left-image {{prefix}}-class-image" src="{{ image }}"/><slot name="image"/></view><view class="{{classPrefix}}__title {{prefix}}-class-center"><view class="{{classPrefix}}__title-text {{prefix}}-class-title"><block wx:if="{{ title }}">{{ title}}</block><slot name="title"/><block wx:if="{{required}}"><text decode class="{{classPrefix}}--required">&nbsp;*</text></block></view><view class="{{classPrefix}}__description {{prefix}}-class-description"><view wx:if="{{ description }}" class="{{classPrefix}}__description-text">{{description}}</view><slot name="description"/></view></view><view class="{{classPrefix}}__note {{prefix}}-class-note"><text wx:if="{{ note }}">{{note}}</text><slot name="note"/></view><view class="{{_.cls(classPrefix + '__right', [align])}} {{prefix}}-class-right"><template wx:if="{{_arrow}}" is="icon" data="{{tClass: classPrefix + '__right-icon ' + prefix + '-class-right-icon', ..._arrow }}"/><block wx:else><template wx:if="{{_rightIcon}}" is="icon" data="{{tClass: classPrefix + '__right-icon ' + prefix + '-class-right-icon', ..._rightIcon }}"/><slot name="right-icon"/></block></view></view>

View File

@@ -0,0 +1,21 @@
@import '../common/style/index.wxss';.t-cell{position:relative;display:flex;box-sizing:border-box;width:100%;padding:var(--td-cell-vertical-padding,32rpx) var(--td-cell-horizontal-padding,32rpx);line-height:var(--td-cell-line-height,48rpx);height:var(--td-cell-height,auto);background-color:var(--td-cell-bg-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));}
.t-cell--bordered::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;left:0;bottom:0;border-bottom:var(--td-cell-border-width,1px) solid var(--td-cell-border-color,var(--td-component-stroke,var(--td-gray-color-3,#e7e7e7)));transform:scaleY(.5);transform-origin:bottom;left:var(--td-cell-border-left-space,var(--td-cell-horizontal-padding,32rpx));right:var(--td-cell-border-right-space,0);}
.t-cell__description{font-size:var(--td-cell-description-font-size,var(--td-font-size-base,28rpx));line-height:var(--td-cell-description-line-height,44rpx);color:var(--td-cell-description-color,var(--td-text-color-secondary,var(--td-font-gray-2,rgba(0,0,0,.6))));}
.t-cell__description-text{margin-top:calc(var(--td-spacer,16rpx)/ 2);}
.t-cell__note{display:flex;align-items:center;justify-content:flex-end;color:var(--td-cell-note-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));font-size:var(--td-cell-note-font-size,var(--td-font-size-m,32rpx));}
.t-cell__title{margin-right:var(--td-spacer-2,32rpx);}
.t-cell__note,.t-cell__title{flex:1 1 auto;}
.t-cell__note:empty,.t-cell__title:empty{display:none;}
.t-cell__title-text{display:flex;font-size:var(--td-cell-title-font-size,var(--td-font-size-m,32rpx));color:var(--td-cell-title-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));font-weight:400;}
.t-cell__left,.t-cell__right{align-self:stretch;}
.t-cell__left:not(:empty){margin-right:var(--td-spacer-1,24rpx);}
.t-cell__left-icon{color:var(--td-cell-left-icon-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));font-size:var(--td-cell-left-icon-font-size,48rpx);}
.t-cell__left-image{height:var(--td-cell-image-height,96rpx);width:var(--td-cell-image-width,96rpx);}
.t-cell__note:not(:empty)+.t-cell__right{margin-left:calc(var(--td-spacer,16rpx)/ 2);}
.t-cell__right{display:flex;}
.t-cell__right-icon{color:var(--td-cell-right-icon-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));font-size:var(--td-cell-right-icon-font-size,48rpx);}
.t-cell__right--middle{align-items:center;}
.t-cell__right--top{align-items:flex-start;}
.t-cell__right--bottom{align-items:flex-end;}
.t-cell--hover{background-color:var(--td-cell-hover-color,var(--td-bg-color-secondarycontainer,var(--td-gray-color-1,#f3f3f3)));}
.t-cell--required{font-size:var(--td-cell-required-font-size,var(--td-font-size-m,32rpx));color:var(--td-cell-required-color,var(--td-error-color,var(--td-error-color-6,#d54941)));}

View File

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

View File

@@ -0,0 +1 @@
const props={align:{type:String,value:"middle"},arrow:{type:null,value:!1},bordered:{type:Boolean,value:!0},description:{type:String},hover:{type:Boolean},image:{type:String},jumpType:{type:String,value:"navigateTo"},leftIcon:{type:null},note:{type:String},required:{type:Boolean,value:!1},rightIcon:{type:null},title:{type:String},url:{type:String,value:""}};export default props;

View File

@@ -0,0 +1,54 @@
export interface TdCellProps {
align?: {
type: StringConstructor;
value?: 'top' | 'middle' | 'bottom';
};
arrow?: {
type: null;
value?: boolean | object;
};
bordered?: {
type: BooleanConstructor;
value?: boolean;
};
description?: {
type: StringConstructor;
value?: string;
};
hover?: {
type: BooleanConstructor;
value?: boolean;
};
image?: {
type: StringConstructor;
value?: string;
};
jumpType?: {
type: StringConstructor;
value?: 'switchTab' | 'reLaunch' | 'redirectTo' | 'navigateTo';
};
leftIcon?: {
type: null;
value?: string | object;
};
note?: {
type: StringConstructor;
value?: string;
};
required?: {
type: BooleanConstructor;
value?: boolean;
};
rightIcon?: {
type: null;
value?: string | object;
};
title?: {
type: StringConstructor;
value?: string;
};
url?: {
type: StringConstructor;
value?: string;
};
}

View File

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