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

View File

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

View File

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

View File

@@ -0,0 +1 @@
const props={current:{type:Number,value:0},direction:{type:String,value:"horizontal"},minShowNum:{type:Number,value:2},paginationPosition:{type:String,value:"bottom"},showControls:{type:Boolean,value:!1},total:{type:Number,value:0},type:{type:String,value:"dots"}};export default props;

View File

@@ -0,0 +1,45 @@
import { SuperComponent, RelationsOptions } from '../common/src/index';
import { TdSwiperNavProps } from './type';
export interface SwiperNavProps extends TdSwiperNavProps {
}
export default class SwiperNav extends SuperComponent {
externalClasses: string[];
properties: {
current: {
type: NumberConstructor;
value: number;
};
total: {
type: NumberConstructor;
value: number;
};
type: {
type: StringConstructor;
value: string;
};
minShowNum: {
type: NumberConstructor;
value: number;
};
showControls: {
type: BooleanConstructor;
value: boolean;
};
direction: {
type: StringConstructor;
value: string;
};
paginationPosition: {
type: StringConstructor;
value: string;
};
};
relations: RelationsOptions;
data: {
prefix: string;
classPrefix: string;
};
methods: {
nav(e: any): void;
};
}

View File

@@ -0,0 +1 @@
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";const{prefix:prefix}=config,name=`${prefix}-swiper-nav`;let SwiperNav=class extends SuperComponent{constructor(){super(...arguments),this.externalClasses=[`${prefix}-class`],this.properties={current:{type:Number,value:0},total:{type:Number,value:0},type:{type:String,value:"dots"},minShowNum:{type:Number,value:2},showControls:{type:Boolean,value:!1},direction:{type:String,value:"horizontal"},paginationPosition:{type:String,value:"bottom"}},this.relations={"../swiper/swiper":{type:"parent"}},this.data={prefix:prefix,classPrefix:name},this.methods={nav(e){var t;const{dir:r}=e.target.dataset;this.triggerEvent("nav-btn-change",{dir:r,source:"nav"}),this.$parent&&(null===(t=this.$parent)||void 0===t||t.doNavBtnChange(r,"nav"))}}}};SwiperNav=__decorate([wxComponent()],SwiperNav);export default SwiperNav;

View File

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

View File

@@ -0,0 +1 @@
<wxs src="../common/utils.wxs" module="_"/><view wx:if="{{showControls}}" class="class {{prefix}}-class {{classPrefix}}__btn" style="{{_._style([style, customStyle])}}"><view class="{{classPrefix}}__btn--prev" bind:tap="nav" data-dir="prev" aria-role="button" aria-label="上一张"/><view class="{{classPrefix}}__btn--next" bind:tap="nav" data-dir="next" aria-role="button" aria-label="下一张"/></view><view wx:if="{{total >= minShowNum}}" style="{{_._style([style, customStyle])}}" class="class {{prefix}}-class {{classPrefix}} {{classPrefix}}--{{direction}} {{classPrefix}}__{{type}} {{classPrefix}}--{{paginationPosition}}"><block wx:if="{{ type === 'dots' || type === 'dots-bar'}}"><view wx:for="{{total}}" wx:for-index="idx" wx:key="idx" class="{{_.cls(classPrefix + '__' + type + '-item', [['active', current === idx], direction])}}"/></block><block wx:if="{{ type === 'fraction'}}">{{current + 1}}/{{total}}</block></view>

View File

@@ -0,0 +1,23 @@
@import '../common/style/index.wxss';.t-swiper-nav__dots,.t-swiper-nav__dots-bar{display:flex;flex-direction:row;}
.t-swiper-nav__dots-bar-item,.t-swiper-nav__dots-item{width:var(--td-swiper-nav-dot-size,12rpx);height:var(--td-swiper-nav-dot-size,12rpx);background:var(--td-swiper-nav-dot-color,var(--td-font-white-2,rgba(255,255,255,.55)));border-radius:50%;margin:0 10rpx;transition:all .4s ease-in;}
.t-swiper-nav__dots-bar-item--vertical,.t-swiper-nav__dots-item--vertical{margin:10rpx 0;}
.t-swiper-nav__dots-bar-item--active,.t-swiper-nav__dots-item--active{background-color:var(--td-swiper-nav-dot-active-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));}
.t-swiper-nav__dots-bar-item--vertical.t-swiper-nav__dots-bar-item--active{width:var(--td-swiper-nav-dot-size,12rpx);height:var(--td-swiper-nav-dots-bar-active-width,40rpx);}
.t-swiper-nav__dots-bar-item--active{width:var(--td-swiper-nav-dots-bar-active-width,40rpx);border-radius:calc(var(--td-swiper-nav-dot-size,12rpx)/ 2);background-color:var(--td-swiper-nav-dot-active-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));}
.t-swiper-nav--left{position:absolute;left:24rpx;top:50%;transform:translateY(-50%);}
.t-swiper-nav--right{position:absolute;right:24rpx;top:50%;transform:translateY(-50%);}
.t-swiper-nav--top-left{position:absolute;top:24rpx;left:24rpx;}
.t-swiper-nav--top{position:absolute;left:50%;top:24rpx;transform:translateX(-50%);}
.t-swiper-nav--top-right{position:absolute;top:24rpx;right:24rpx;}
.t-swiper-nav--bottom-left{position:absolute;left:24rpx;bottom:24rpx;}
.t-swiper-nav--bottom{position:absolute;left:50%;bottom:24rpx;transform:translateX(-50%);}
.t-swiper-nav--bottom-right{position:absolute;right:24rpx;bottom:24rpx;}
.t-swiper-nav--vertical{flex-direction:column;}
.t-swiper-nav__fraction{padding:0 16rpx;height:var(--td-swiper-nav-fraction-height,48rpx);line-height:var(--td-swiper-nav-fraction-height,48rpx);border-radius:calc(var(--td-swiper-nav-fraction-height,48rpx)/ 2);background:var(--td-swiper-nav-fraction-bg-color,var(--td-font-gray-3,rgba(0,0,0,.4)));color:var(--td-swiper-nav-fraction-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));font-size:var(--td-swiper-nav-fraction-font-size,24rpx);}
.t-swiper-nav__btn{width:100%;position:absolute;top:50%;transform:translateY(-50%);}
.t-swiper-nav__btn--next,.t-swiper-nav__btn--prev{position:absolute;top:50%;transform:translateY(-50%);width:var(--td-swiper-nav-btn-size,48rpx);height:var(--td-swiper-nav-btn-size,48rpx);border-radius:50%;background:var(--td-swiper-nav-btn-bg-color,var(--td-font-gray-3,rgba(0,0,0,.4)));}
.t-swiper-nav__btn--next::after,.t-swiper-nav__btn--prev::after{position:absolute;left:50%;top:50%;display:block;content:'';width:12rpx;height:12rpx;border-color:var(--td-swiper-nav-btn-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));border-style:solid;}
.t-swiper-nav__btn--prev{left:30rpx;}
.t-swiper-nav__btn--prev::after{margin-left:4rpx;border-width:2rpx 0 0 2rpx;transform:translate(-50%,-50%) rotateZ(-45deg);}
.t-swiper-nav__btn--next{right:30rpx;}
.t-swiper-nav__btn--next::after{margin-left:-4rpx;border-width:2rpx 2rpx 0 0;transform:translate(-50%,-50%) rotateZ(45deg);}

View File

@@ -0,0 +1,31 @@
export interface TdSwiperNavProps {
current?: {
type: NumberConstructor;
value?: number;
};
direction?: {
type: StringConstructor;
value?: 'horizontal' | 'vertical';
};
minShowNum?: {
type: NumberConstructor;
value?: number;
};
paginationPosition?: {
type: StringConstructor;
value?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right';
};
showControls?: {
type: BooleanConstructor;
value?: boolean;
};
total?: {
type: NumberConstructor;
value?: number;
};
type?: {
type: StringConstructor;
value?: SwiperNavigationType;
};
}
export declare type SwiperNavigationType = 'dots' | 'dots-bar' | 'fraction';

View File

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