初始化项目, 添加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,18 @@
import { SuperComponent } from '../common/src/index';
export default class Icon extends SuperComponent {
externalClasses: string[];
properties: import("./type").TdIconProps;
data: {
componentPrefix: string;
classPrefix: string;
isImage: boolean;
iconStyle: any;
};
observers: {
'name, color, size, style'(): void;
};
methods: {
onTap(event: any): void;
setIconStyle(): void;
};
}

View File

@@ -0,0 +1 @@
import{__awaiter,__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import{styles,addUnit,getRect}from"../common/utils";const{prefix:prefix}=config,name=`${prefix}-icon`;let Icon=class extends SuperComponent{constructor(){super(...arguments),this.externalClasses=[`${prefix}-class`],this.properties=props,this.data={componentPrefix:prefix,classPrefix:name,isImage:!1,iconStyle:void 0},this.observers={"name, color, size, style"(){this.setIconStyle()}},this.methods={onTap(t){this.triggerEvent("click",t.detail)},setIconStyle(){const{name:t,color:e,size:o,classPrefix:i}=this.data,s=-1!==t.indexOf("/"),n=addUnit(o),r=e?{color:e}:{},c=o?{"font-size":n}:{},a=Object.assign(Object.assign({},r),c);this.setData({isImage:s},()=>__awaiter(this,void 0,void 0,function*(){if(s){let t=n;t||(yield getRect(this,`.${i}`).then(e=>{t=addUnit(null==e?void 0:e.height)}).catch(()=>{})),a.width=t,a.height=t}this.setData({iconStyle:`${styles(a)}`})}))}}}};Icon=__decorate([wxComponent()],Icon);export default Icon;

View File

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

View File

@@ -0,0 +1 @@
<wxs src="../common/utils.wxs" module="_"/><view class="{{ prefix ? prefix : classPrefix}} class {{componentPrefix}}-class" style="{{_._style([iconStyle, style, customStyle])}}" bind:tap="onTap" aria-hidden="{{ariaHidden}}" aria-label="{{ariaLabel}}" aria-role="{{ariaRole}}"><view wx:if="{{ isImage }}" class="{{classPrefix}}--image"><image src="{{ name }}" mode="aspectFit" class="{{classPrefix}}__image"/></view><label wx:if="{{ _.isValidIconName(name) && !isImage }}" class="{{ prefix ? prefix : classPrefix }}-{{ name}} {{ classPrefix }}-base"></label></view>

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -0,0 +1 @@
const props={color:{type:String,value:""},name:{type:String,value:"",required:!0},prefix:{type:String,value:""},size:{type:null}};export default props;

View File

@@ -0,0 +1,19 @@
export interface TdIconProps {
color?: {
type: StringConstructor;
value?: string;
};
name: {
type: StringConstructor;
value?: string;
required?: boolean;
};
prefix?: {
type: StringConstructor;
value?: string;
};
size?: {
type: null;
value?: string | number;
};
}

View File

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