初始化项目, 添加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 @@
export * from './props';
export * from './type';
export * from './overlay';

View File

@@ -0,0 +1 @@
export*from"./props";export*from"./type";export*from"./overlay";

View File

@@ -0,0 +1,22 @@
import { SuperComponent } from '../common/src/index';
import { TdOverlayProps } from './type';
export interface OverlayProps extends TdOverlayProps {
}
export default class Overlay extends SuperComponent {
properties: TdOverlayProps;
behaviors: string[];
data: {
prefix: string;
classPrefix: string;
computedStyle: string;
_zIndex: number;
};
observers: {
backgroundColor(v: any): void;
zIndex(v: any): void;
};
methods: {
handleClick(): void;
noop(): 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 transition from"../mixins/transition";import useCustomNavbar from"../mixins/using-custom-navbar";const{prefix:prefix}=config,name=`${prefix}-overlay`;let Overlay=class extends SuperComponent{constructor(){super(...arguments),this.properties=props,this.behaviors=[transition(),useCustomNavbar],this.data={prefix:prefix,classPrefix:name,computedStyle:"",_zIndex:11e3},this.observers={backgroundColor(o){this.setData({computedStyle:o?`background-color: ${o};`:""})},zIndex(o){0!==o&&this.setData({_zIndex:o})}},this.methods={handleClick(){this.triggerEvent("click",{visible:!this.properties.visible})},noop(){}}}};Overlay=__decorate([wxComponent()],Overlay);export default Overlay;

View File

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

View File

@@ -0,0 +1 @@
<wxs src="../common/utils.wxs" module="_"/><view wx:if="{{realVisible && preventScrollThrough}}" class="{{prefix}}-overlay {{transitionClass}} class" style="{{_._style(['--td-overlay-transition-duration:' + duration + 'ms', 'z-index:' + _zIndex, 'top:' + distanceTop + 'px', computedStyle, style, customStyle])}}" bind:tap="handleClick" catchtouchmove="noop" bind:transitionend="onTransitionEnd" aria-role="{{ ariaRole || 'button' }}" aria-label="{{ ariaLabel || '关闭' }}"><slot/></view><view wx:elif="{{realVisible}}" class="{{prefix}}-overlay {{transitionClass}} class" style="{{_._style(['z-index:' + _zIndex, 'top:' + distanceTop + 'px', computedStyle, style, customStyle])}}" bind:tap="handleClick" bind:transitionend="onTransitionEnd" aria-role="{{ ariaRole || 'button' }}" aria-label="{{ ariaLabel || '关闭' }}"><slot/></view>

View File

@@ -0,0 +1,3 @@
@import '../common/style/index.wxss';.t-overlay{position:fixed;top:0;left:0;width:100%;bottom:0;background-color:var(--td-overlay-bg-color,var(--td-mask-active,rgba(0,0,0,.6)));transition-property:opacity;transition-duration:var(--td-overlay-transition-duration,300ms);transition-timing-function:ease;}
.t-fade-enter{opacity:0;}
.t-fade-leave-to{opacity:0;}

View File

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

View File

@@ -0,0 +1 @@
const props={backgroundColor:{type:String,value:""},duration:{type:Number,value:300},preventScrollThrough:{type:Boolean,value:!0},zIndex:{type:Number,value:11e3}};export default props;

View File

@@ -0,0 +1,26 @@
export interface TdOverlayProps {
backgroundColor?: {
type: StringConstructor;
value?: string;
};
duration?: {
type: NumberConstructor;
value?: number;
};
preventScrollThrough?: {
type: BooleanConstructor;
value?: boolean;
};
usingCustomNavbar?: {
type: BooleanConstructor;
value?: boolean;
};
visible?: {
type: BooleanConstructor;
value?: boolean;
};
zIndex?: {
type: NumberConstructor;
value?: number;
};
}

View File

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