初始化项目, 添加TDesign等包
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
20
miniprogram/app.json
Normal file
20
miniprogram/app.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/agreement/agreement",
|
||||
"pages/my/my"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "Weixin",
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
},
|
||||
"componentFramework": "glass-easel",
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"usingComponents": {
|
||||
"page-plugin": "pages/components/page-plugin"
|
||||
},
|
||||
"resolveAlias": {
|
||||
"@/*": "/*"
|
||||
}
|
||||
}
|
||||
22
miniprogram/app.ts
Normal file
22
miniprogram/app.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// app.ts
|
||||
App<
|
||||
IAppOption & {
|
||||
// Storage: IStorage
|
||||
}
|
||||
>({
|
||||
globalData: {},
|
||||
onLaunch() {
|
||||
// 展示本地存储能力
|
||||
// const logs = wx.getStorageSync("logs") || [];
|
||||
// logs.unshift(Date.now());
|
||||
// setStorage("logs", logs);
|
||||
// // 登录
|
||||
// wx.login({
|
||||
// success: (res) => {
|
||||
// console.log(res.code);
|
||||
// // 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||
// },
|
||||
// });
|
||||
},
|
||||
// Storage: Storage, // 将 Storage 挂载到 App 实例上
|
||||
});
|
||||
3
miniprogram/app.wxss
Normal file
3
miniprogram/app.wxss
Normal file
@@ -0,0 +1,3 @@
|
||||
button.t-button {
|
||||
font-weight: normal;
|
||||
}
|
||||
1058
miniprogram/miniprogram_npm/big.js/index.js
Normal file
1058
miniprogram/miniprogram_npm/big.js/index.js
Normal file
File diff suppressed because it is too large
Load Diff
1
miniprogram/miniprogram_npm/big.js/index.js.map
Normal file
1
miniprogram/miniprogram_npm/big.js/index.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
88
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.d.ts
vendored
Normal file
88
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.d.ts
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
import { SuperComponent } from '../common/src/index';
|
||||
export default class ActionSheet extends SuperComponent {
|
||||
static show: (options: import("./show").ActionSheetShowOption) => WechatMiniprogram.Component.TrivialInstance;
|
||||
behaviors: string[];
|
||||
externalClasses: string[];
|
||||
properties: {
|
||||
align?: {
|
||||
type: StringConstructor;
|
||||
value?: "left" | "center";
|
||||
};
|
||||
cancelText?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
count?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
description?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
items: {
|
||||
type: ArrayConstructor;
|
||||
value?: (string | import("./type").ActionSheetItem)[];
|
||||
required?: boolean;
|
||||
};
|
||||
popupProps?: {
|
||||
type: ObjectConstructor;
|
||||
value?: import("../popup").TdPopupProps;
|
||||
};
|
||||
showCancel?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
showOverlay?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
theme?: {
|
||||
type: StringConstructor;
|
||||
value?: "list" | "grid";
|
||||
};
|
||||
usingCustomNavbar?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
visible?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
defaultVisible?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
};
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
gridThemeItems: any[];
|
||||
currentSwiperIndex: number;
|
||||
defaultPopUpProps: {};
|
||||
defaultPopUpzIndex: number;
|
||||
};
|
||||
controlledProps: {
|
||||
key: string;
|
||||
event: string;
|
||||
}[];
|
||||
observers: {
|
||||
items(): void;
|
||||
};
|
||||
lifetimes: {
|
||||
ready(): void;
|
||||
};
|
||||
methods: {
|
||||
init(): void;
|
||||
memoInitialData(): void;
|
||||
splitGridThemeActions(): void;
|
||||
show(options: any): void;
|
||||
close(): void;
|
||||
onPopupVisibleChange({ detail }: {
|
||||
detail: any;
|
||||
}): void;
|
||||
onSwiperChange(e: WechatMiniprogram.TouchEvent): void;
|
||||
onSelect(event: WechatMiniprogram.TouchEvent): void;
|
||||
onCancel(): void;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import{__decorate}from"tslib";import{chunk}from"../common/utils";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import{ActionSheetTheme,show}from"./show";import props from"./props";import useCustomNavbar from"../mixins/using-custom-navbar";const{prefix:prefix}=config,name=`${prefix}-action-sheet`;let ActionSheet=class extends SuperComponent{constructor(){super(...arguments),this.behaviors=[useCustomNavbar],this.externalClasses=[`${prefix}-class`,`${prefix}-class-content`,`${prefix}-class-cancel`],this.properties=Object.assign({},props),this.data={prefix:prefix,classPrefix:name,gridThemeItems:[],currentSwiperIndex:0,defaultPopUpProps:{},defaultPopUpzIndex:11500},this.controlledProps=[{key:"visible",event:"visible-change"}],this.observers={items(){this.splitGridThemeActions()}},this.lifetimes={ready(){this.init()}},this.methods={init(){this.memoInitialData(),this.splitGridThemeActions()},memoInitialData(){this.initialData=Object.assign(Object.assign({},this.properties),this.data)},splitGridThemeActions(){this.data.theme===ActionSheetTheme.Grid&&this.setData({gridThemeItems:chunk(this.data.items,this.data.count)})},show(e){this.setData(Object.assign(Object.assign(Object.assign({},this.initialData),e),{visible:!0})),this.splitGridThemeActions(),this.autoClose=!0,this._trigger("visible-change",{visible:!0})},close(){this.triggerEvent("close",{trigger:"command"}),this._trigger("visible-change",{visible:!1})},onPopupVisibleChange({detail:e}){e.visible||(this.triggerEvent("close",{trigger:"overlay"}),this._trigger("visible-change",{visible:!1})),this.autoClose&&(this.setData({visible:!1}),this.autoClose=!1)},onSwiperChange(e){const{current:t}=e.detail;this.setData({currentSwiperIndex:t})},onSelect(e){const{currentSwiperIndex:t,items:i,gridThemeItems:s,count:o,theme:r}=this.data,{index:n}=e.currentTarget.dataset,a=r===ActionSheetTheme.Grid,h=a?s[t][n]:i[n],c=a?n+t*o:n;h&&(this.triggerEvent("selected",{selected:h,index:c}),h.disabled||(this.triggerEvent("close",{trigger:"select"}),this._trigger("visible-change",{visible:!1})))},onCancel(){this.triggerEvent("cancel"),this.autoClose&&(this.setData({visible:!1}),this.autoClose=!1)}}}};ActionSheet.show=show,ActionSheet=__decorate([wxComponent()],ActionSheet);export default ActionSheet;
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"t-icon":"../icon/icon","t-popup":"../popup/popup","t-grid":"../grid/grid","t-grid-item":"../grid-item/grid-item"}}
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="./action-sheet.wxs" module="_this"/><wxs src="../common/utils.wxs" module="_"/><import src="./template/list.wxml"/><import src="./template/grid.wxml"/><view id="{{classPrefix}}" style="{{_._style([style, customStyle])}}" class="{{classPrefix}} class {{prefix}}-class"><t-popup visible="{{visible}}" placement="bottom" usingCustomNavbar="{{usingCustomNavbar}}" bind:visible-change="onPopupVisibleChange" show-overlay="{{showOverlay}}" z-index="{{ popupProps.zIndex || defaultPopUpzIndex }}" overlay-props="{{ popupProps.overlayProps || defaultPopUpProps }}"><view class="{{_.cls(classPrefix + '__content', [['grid', gridThemeItems.length]])}} {{prefix}}-class-content" tabindex="0"><view wx:if="{{description}}" tabindex="0" class="{{_.cls(classPrefix + '__description', [align])}}">{{description}}</view><block wx:if="{{gridThemeItems.length}}"><template is="grid" data="{{classPrefix, prefix, gridThemeItems, count, currentSwiperIndex}}"/></block><view wx:elif="{{items && items.length}}" class="{{classPrefix}}__list"><block wx:for="{{ items }}" wx:key="index"><template is="list" data="{{index, classPrefix, listThemeItemClass: _.cls(classPrefix + '__list-item', [align, [disabled, item.disabled]]), item}}"/></block></view></view><slot/><view wx:if="{{showCancel}}" class="{{classPrefix}}__footer"><view class="{{classPrefix}}__gap-{{theme}}"/><view class="{{classPrefix}}__cancel {{prefix}}-class-cancel" hover-class="{{classPrefix}}__cancel--hover" hover-stay-time="70" bind:tap="onCancel" aria-role="button">{{ cancelText || '取消' }}</view></view></t-popup></view>
|
||||
@@ -0,0 +1,19 @@
|
||||
var getListThemeItemClass = function (props) {
|
||||
var classPrefix = props.classPrefix;
|
||||
var item = props.item;
|
||||
var prefix = props.prefix;
|
||||
var classList = [classPrefix + '__list-item'];
|
||||
if (item.disabled) {
|
||||
classList.push(prefix + '-is-disabled');
|
||||
}
|
||||
return classList.join(' ');
|
||||
};
|
||||
|
||||
var isImage = function (name) {
|
||||
return name.indexOf('/') !== -1;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getListThemeItemClass: getListThemeItemClass,
|
||||
isImage: isImage,
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
@import '../common/style/index.wxss';.t-action-sheet__content{color:var(--td-action-sheet-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));border-top-left-radius:var(--td-action-sheet-border-radius,var(--td-radius-extraLarge,24rpx));border-top-right-radius:var(--td-action-sheet-border-radius,var(--td-radius-extraLarge,24rpx));background-color:var(--td-bg-color-container,var(--td-font-white-1,#fff));overflow:hidden;}
|
||||
.t-action-sheet__content--grid{padding-top:16rpx;}
|
||||
.t-action-sheet__content:focus{outline:0;}
|
||||
.t-action-sheet__grid{padding-bottom:16rpx;}
|
||||
.t-action-sheet__grid--swiper{padding-bottom:48rpx;}
|
||||
.t-action-sheet__description{color:var(--td-action-sheet-description-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));line-height:44rpx;font-size:28rpx;text-align:var(--td-action-sheet-text-align,center);padding:24rpx 32rpx;position:relative;}
|
||||
.t-action-sheet__description:focus{outline:0;}
|
||||
.t-action-sheet__description::after{content:'';display:block;position:absolute;top:unset;bottom:0;left:unset;right:unset;background-color:var(--td-action-sheet-border-color,var(--td-border-level-1-color,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-action-sheet__description::after{height:1px;left:0;right:0;transform:scaleY(.5);}
|
||||
.t-action-sheet__description--left{text-align:left;}
|
||||
.t-action-sheet__description--left::after{left:32rpx;}
|
||||
.t-action-sheet__list-item{display:flex;align-items:center;justify-content:center;position:relative;height:var(--td-action-sheet-list-item-height,112rpx);padding:0 32rpx;}
|
||||
.t-action-sheet__list-item::after{content:'';display:block;position:absolute;top:unset;bottom:0;left:unset;right:unset;background-color:var(--td-action-sheet-border-color,var(--td-border-level-1-color,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-action-sheet__list-item::after{height:1px;left:0;right:0;transform:scaleY(.5);}
|
||||
.t-action-sheet__list-item:focus{outline:0;}
|
||||
.t-action-sheet__list-item--left{justify-content:start;}
|
||||
.t-action-sheet__list-item--left::after{left:32rpx;}
|
||||
.t-action-sheet__list-item--disabled{color:var(--td-action-sheet-list-item-disabled-color,var(--td-text-color-disabled,var(--td-font-gray-4,rgba(0,0,0,.26))));}
|
||||
.t-action-sheet__list-item-text{font-size:var(--td-font-size-m,32rpx);word-wrap:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||
.t-action-sheet__list-item-icon{margin-right:16rpx;}
|
||||
.t-action-sheet__list-item-icon--suffix{margin-left:auto;}
|
||||
.t-action-sheet__swiper-wrap{margin-top:8rpx;position:relative;}
|
||||
.t-action-sheet__footer{background-color:var(--td-bg-color-container,var(--td-font-white-1,#fff));}
|
||||
.t-action-sheet__gap-list{height:16rpx;background-color:var(--td-action-sheet-gap-color,var(--td-bg-color-page,var(--td-gray-color-1,#f3f3f3)));}
|
||||
.t-action-sheet__gap-grid{height:1rpx;background-color:var(--td-action-sheet-border-color,var(--td-border-level-1-color,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-action-sheet__cancel{display:flex;align-items:center;justify-content:center;color:var(--td-action-sheet-cancel-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));height:var(--td-action-sheet-cancel-height,96rpx);}
|
||||
.t-action-sheet__dots{position:absolute;left:50%;bottom:32rpx;transform:translateX(-50%);display:flex;flex-direction:row;}
|
||||
.t-action-sheet__dots-item{width:16rpx;height:16rpx;background-color:#dcdcdc;border-radius:50%;margin:0 16rpx;transition:all .4s ease-in;}
|
||||
.t-action-sheet__dots-item.t-is-active{background-color:#0052d9;}
|
||||
8
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/index.d.ts
vendored
Normal file
8
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/index.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
import { ActionSheetItem, ActionSheetTheme, ActionSheetShowOption } from './show';
|
||||
export { ActionSheetItem, ActionSheetTheme, ActionSheetShowOption };
|
||||
declare const _default: {
|
||||
show(options: ActionSheetShowOption): WechatMiniprogram.Component.TrivialInstance;
|
||||
close(options: ActionSheetShowOption): void;
|
||||
};
|
||||
export default _default;
|
||||
@@ -0,0 +1 @@
|
||||
import{show,close,ActionSheetTheme}from"./show";export{ActionSheetTheme};export default{show:e=>show(e),close:e=>close(e)};
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdActionSheetProps } from './type';
|
||||
declare const props: TdActionSheetProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={align:{type:String,value:"center"},cancelText:{type:String,value:""},count:{type:Number,value:8},description:{type:String,value:""},items:{type:Array,required:!0},popupProps:{type:Object,value:{}},showCancel:{type:Boolean,value:!0},showOverlay:{type:Boolean,value:!0},theme:{type:String,value:"list"},usingCustomNavbar:{type:Boolean,value:!1},visible:{type:Boolean,value:null},defaultVisible:{type:Boolean,value:!1}};export default props;
|
||||
26
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/show.d.ts
vendored
Normal file
26
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/show.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
import { ActionSheetItem } from './type';
|
||||
export { ActionSheetItem };
|
||||
declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
|
||||
export declare enum ActionSheetTheme {
|
||||
List = "list",
|
||||
Grid = "grid"
|
||||
}
|
||||
interface ActionSheetProps {
|
||||
align: 'center' | 'left';
|
||||
cancelText?: string;
|
||||
count?: number;
|
||||
description: string;
|
||||
items: Array<string | ActionSheetItem>;
|
||||
showCancel?: boolean;
|
||||
theme?: ActionSheetTheme;
|
||||
visible: boolean;
|
||||
defaultVisible?: boolean;
|
||||
}
|
||||
export interface ActionSheetShowOption extends Omit<ActionSheetProps, 'visible'> {
|
||||
context?: Context;
|
||||
selector?: string;
|
||||
}
|
||||
export declare const show: (options: ActionSheetShowOption) => WechatMiniprogram.Component.TrivialInstance;
|
||||
export declare const close: (options: ActionSheetShowOption) => void;
|
||||
@@ -0,0 +1 @@
|
||||
import{__rest}from"tslib";import{getInstance}from"../common/utils";export var ActionSheetTheme;!function(t){t.List="list",t.Grid="grid"}(ActionSheetTheme||(ActionSheetTheme={}));export const show=function(t){const e=Object.assign({},t),{context:o,selector:n="#t-action-sheet"}=e,c=__rest(e,["context","selector"]),s=getInstance(o,n);if(s)return s.show(Object.assign({},c)),s;console.error("未找到组件,请确认 selector && context 是否正确")};export const close=function(t){const{context:e,selector:o="#t-action-sheet"}=Object.assign({},t),n=getInstance(e,o);n&&n.close()};
|
||||
@@ -0,0 +1 @@
|
||||
<template name="grid"><block wx:if="{{gridThemeItems.length === 1}}"><t-grid align="center" t-class="{{classPrefix}}__grid" column="{{count / 2}}" class="{{classPrefix}}__single-wrap"><t-grid-item t-class="{{classPrefix}}__grid-item" class="{{classPrefix}}__square" wx:for="{{gridThemeItems[0]}}" wx:key="index" bind:tap="onSelect" data-index="{{index}}" icon="{{ { name: item.icon, color: item.color } }}" text="{{item.label || ''}}" image="{{item.image || ''}}" style="--td-grid-item-text-color: {{item.color}}"></t-grid-item></t-grid></block><block wx:elif="{{gridThemeItems.length > 1}}"><view class="{{classPrefix}}__swiper-wrap"><swiper style="height: 456rpx" autoplay="{{false}}" current="{{currentSwiperIndex}}" bindchange="onSwiperChange"><swiper-item wx:for="{{gridThemeItems}}" wx:key="index"><t-grid align="center" t-class="{{classPrefix}}__grid {{classPrefix}}__grid--swiper" column="{{count / 2}}"><t-grid-item t-class="{{classPrefix}}__grid-item" class="{{classPrefix}}__square" wx:for="{{item}}" wx:key="index" data-index="{{index}}" bind:tap="onSelect" icon="{{ { name: item.icon, color: item.color } }}" text="{{item.label || ''}}" image="{{item.image || ''}}" style="--td-grid-item-text-color: {{item.color}}"></t-grid-item></t-grid></swiper-item></swiper><view class="{{classPrefix}}__nav"><view class="{{classPrefix}}__dots"><view wx:for="{{gridThemeItems.length}}" wx:key="index" class="{{classPrefix}}__dots-item {{index === currentSwiperIndex ? prefix + '-is-active' : ''}}"/></view></view></view></block></template>
|
||||
@@ -0,0 +1 @@
|
||||
<template name="list"><view data-index="{{index}}" style="{{ item.color ? 'color: ' + item.color : '' }}" class="{{listThemeItemClass}}" bind:tap="onSelect" aria-role="{{ariaRole || 'button'}}" aria-label="{{item.label || item}}" tabindex="0"><t-icon wx:if="{{item.icon}}" name="{{item.icon}}" class="{{classPrefix}}__list-item-icon" size="48rpx"></t-icon><view class="{{classPrefix}}__list-item-text">{{item.label || item}}</view><t-icon wx:if="{{item.suffixIcon}}" name="{{item.suffixIcon}}" class="{{classPrefix}}__list-item-icon {{classPrefix}}__list-item-icon--suffix" size="48rpx"></t-icon></view></template>
|
||||
59
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/type.d.ts
vendored
Normal file
59
miniprogram/miniprogram_npm/tdesign-miniprogram/action-sheet/type.d.ts
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { PopupProps } from '../popup/index';
|
||||
export interface TdActionSheetProps {
|
||||
align?: {
|
||||
type: StringConstructor;
|
||||
value?: 'center' | 'left';
|
||||
};
|
||||
cancelText?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
count?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
description?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
items: {
|
||||
type: ArrayConstructor;
|
||||
value?: Array<string | ActionSheetItem>;
|
||||
required?: boolean;
|
||||
};
|
||||
popupProps?: {
|
||||
type: ObjectConstructor;
|
||||
value?: PopupProps;
|
||||
};
|
||||
showCancel?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
showOverlay?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
theme?: {
|
||||
type: StringConstructor;
|
||||
value?: 'list' | 'grid';
|
||||
};
|
||||
usingCustomNavbar?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
visible?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
defaultVisible?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
}
|
||||
export interface ActionSheetItem {
|
||||
label: string;
|
||||
color?: string;
|
||||
disabled?: boolean;
|
||||
icon?: string;
|
||||
suffixIcon?: string;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
28
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.d.ts
vendored
Normal file
28
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar-group/avatar-group.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { SuperComponent, RelationsOptions } from '../common/src/index';
|
||||
export default class AvatarGroup extends SuperComponent {
|
||||
externalClasses: string[];
|
||||
properties: import("./type").TdAvatarGroupProps;
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
hasChild: boolean;
|
||||
length: number;
|
||||
className: string;
|
||||
};
|
||||
options: {
|
||||
multipleSlots: boolean;
|
||||
};
|
||||
relations: RelationsOptions;
|
||||
lifetimes: {
|
||||
attached(): void;
|
||||
ready(): void;
|
||||
};
|
||||
observers: {
|
||||
'cascading, size'(): void;
|
||||
};
|
||||
methods: {
|
||||
setClass(): void;
|
||||
handleMax(): void;
|
||||
onCollapsedItemClick(e: WechatMiniprogram.CustomEvent): void;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import avatarGroupProps from"./props";const{prefix:prefix}=config,name=`${prefix}-avatar-group`;let AvatarGroup=class extends SuperComponent{constructor(){super(...arguments),this.externalClasses=[`${prefix}-class`,`${prefix}-class-content`,`${prefix}-class-image`],this.properties=avatarGroupProps,this.data={prefix:prefix,classPrefix:name,hasChild:!0,length:0,className:""},this.options={multipleSlots:!0},this.relations={"../avatar/avatar":{type:"descendant"}},this.lifetimes={attached(){this.setClass()},ready(){this.setData({length:this.$children.length}),this.handleMax()}},this.observers={"cascading, size"(){this.setClass()}},this.methods={setClass(){const{cascading:e,size:t}=this.properties,s=e.split("-")[0],a=[name,`${prefix}-class`,`${name}-offset-${s}`,`${name}-offset-${s}-${t.indexOf("px")>-1?"medium":t||"medium"}`];this.setData({className:a.join(" ")})},handleMax(){const{max:e}=this.data,t=this.$children.length;if(!e||e>t)return;this.$children.splice(e,t-e).forEach(e=>{e.hide()})},onCollapsedItemClick(e){this.triggerEvent("collapsed-item-click",e.detail)}}}};AvatarGroup=__decorate([wxComponent()],AvatarGroup);export default AvatarGroup;
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"shared","usingComponents":{"t-avatar":"../avatar/avatar"}}
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="../common/utils.wxs" module="_"/><view style="{{_._style([style, customStyle])}}" class="{{className}} class"><slot/><view class="{{classPrefix}}__collapse--slot"><slot name="collapse-avatar"/></view><view class="{{classPrefix}}__collapse--default" wx:if="{{max && (max < length)}}" bindtap="onCollapsedItemClick"><t-avatar t-class-image="{{prefix}}-avatar--border {{prefix}}-avatar--border-{{size}} {{prefix}}-class-image" t-class-content="{{prefix}}-class-content" size="{{size}}" shape="{{shape}}" icon="{{ collapseAvatar ? '' : 'user-add'}}" aria-role="none">{{collapseAvatar}}</t-avatar></view></view>
|
||||
@@ -0,0 +1,59 @@
|
||||
@import '../common/style/index.wxss';.t-avatar-group{display:inline-flex;flex-wrap:wrap;align-items:center;}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper,.t-avatar-group-offset-right .t-avatar__wrapper{padding:var(--td-avatar-group-line-spacing,4rpx) 0;}
|
||||
.t-avatar-group-offset-left-small,.t-avatar-group-offset-right-small{--td-avatar-margin-left:var(--td-avatar-group-margin-left-small, -16rpx);}
|
||||
.t-avatar-group-offset-left-medium,.t-avatar-group-offset-right-medium{--td-avatar-margin-left:var(--td-avatar-group-margin-left-medium, -16rpx);}
|
||||
.t-avatar-group-offset-left-large,.t-avatar-group-offset-right-large{--td-avatar-margin-left:var(--td-avatar-group-margin-left-large, -16rpx);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(1){z-index:calc(var(--td-avatar-group-init-z-index,50) - 1);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(2){z-index:calc(var(--td-avatar-group-init-z-index,50) - 2);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(3){z-index:calc(var(--td-avatar-group-init-z-index,50) - 3);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(4){z-index:calc(var(--td-avatar-group-init-z-index,50) - 4);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(5){z-index:calc(var(--td-avatar-group-init-z-index,50) - 5);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(6){z-index:calc(var(--td-avatar-group-init-z-index,50) - 6);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(7){z-index:calc(var(--td-avatar-group-init-z-index,50) - 7);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(8){z-index:calc(var(--td-avatar-group-init-z-index,50) - 8);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(9){z-index:calc(var(--td-avatar-group-init-z-index,50) - 9);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(10){z-index:calc(var(--td-avatar-group-init-z-index,50) - 10);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(11){z-index:calc(var(--td-avatar-group-init-z-index,50) - 11);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(12){z-index:calc(var(--td-avatar-group-init-z-index,50) - 12);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(13){z-index:calc(var(--td-avatar-group-init-z-index,50) - 13);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(14){z-index:calc(var(--td-avatar-group-init-z-index,50) - 14);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(15){z-index:calc(var(--td-avatar-group-init-z-index,50) - 15);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(16){z-index:calc(var(--td-avatar-group-init-z-index,50) - 16);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(17){z-index:calc(var(--td-avatar-group-init-z-index,50) - 17);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(18){z-index:calc(var(--td-avatar-group-init-z-index,50) - 18);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(19){z-index:calc(var(--td-avatar-group-init-z-index,50) - 19);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(20){z-index:calc(var(--td-avatar-group-init-z-index,50) - 20);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(21){z-index:calc(var(--td-avatar-group-init-z-index,50) - 21);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(22){z-index:calc(var(--td-avatar-group-init-z-index,50) - 22);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(23){z-index:calc(var(--td-avatar-group-init-z-index,50) - 23);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(24){z-index:calc(var(--td-avatar-group-init-z-index,50) - 24);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(25){z-index:calc(var(--td-avatar-group-init-z-index,50) - 25);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(26){z-index:calc(var(--td-avatar-group-init-z-index,50) - 26);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(27){z-index:calc(var(--td-avatar-group-init-z-index,50) - 27);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(28){z-index:calc(var(--td-avatar-group-init-z-index,50) - 28);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(29){z-index:calc(var(--td-avatar-group-init-z-index,50) - 29);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(30){z-index:calc(var(--td-avatar-group-init-z-index,50) - 30);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(31){z-index:calc(var(--td-avatar-group-init-z-index,50) - 31);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(32){z-index:calc(var(--td-avatar-group-init-z-index,50) - 32);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(33){z-index:calc(var(--td-avatar-group-init-z-index,50) - 33);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(34){z-index:calc(var(--td-avatar-group-init-z-index,50) - 34);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(35){z-index:calc(var(--td-avatar-group-init-z-index,50) - 35);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(36){z-index:calc(var(--td-avatar-group-init-z-index,50) - 36);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(37){z-index:calc(var(--td-avatar-group-init-z-index,50) - 37);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(38){z-index:calc(var(--td-avatar-group-init-z-index,50) - 38);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(39){z-index:calc(var(--td-avatar-group-init-z-index,50) - 39);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(40){z-index:calc(var(--td-avatar-group-init-z-index,50) - 40);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(41){z-index:calc(var(--td-avatar-group-init-z-index,50) - 41);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(42){z-index:calc(var(--td-avatar-group-init-z-index,50) - 42);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(43){z-index:calc(var(--td-avatar-group-init-z-index,50) - 43);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(44){z-index:calc(var(--td-avatar-group-init-z-index,50) - 44);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(45){z-index:calc(var(--td-avatar-group-init-z-index,50) - 45);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(46){z-index:calc(var(--td-avatar-group-init-z-index,50) - 46);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(47){z-index:calc(var(--td-avatar-group-init-z-index,50) - 47);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(48){z-index:calc(var(--td-avatar-group-init-z-index,50) - 48);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(49){z-index:calc(var(--td-avatar-group-init-z-index,50) - 49);}
|
||||
.t-avatar-group-offset-left .t-avatar__wrapper:nth-child(50){z-index:calc(var(--td-avatar-group-init-z-index,50) - 50);}
|
||||
.t-avatar-group__collapse--default,.t-avatar-group__collapse--slot{z-index:0;font-weight:600;}
|
||||
.t-avatar-group__collapse--slot{float:left;}
|
||||
.t-avatar-group__collapse--slot:not(:empty)+.t-avatar-group__collapse--default{display:none;float:left;}
|
||||
.t-avatar-group__collapse--slot:empty+.t-avatar-group__collapse--default{display:block;float:left;}
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar-group/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar-group/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdAvatarGroupProps } from './type';
|
||||
declare const props: TdAvatarGroupProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={cascading:{type:String,value:"left-up"},collapseAvatar:{type:String},max:{type:Number},shape:{type:String},size:{type:String,value:""}};export default props;
|
||||
24
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar-group/type.d.ts
vendored
Normal file
24
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar-group/type.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ShapeEnum } from '../common/common';
|
||||
export interface TdAvatarGroupProps {
|
||||
cascading?: {
|
||||
type: StringConstructor;
|
||||
value?: CascadingValue;
|
||||
};
|
||||
collapseAvatar?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
max?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
shape?: {
|
||||
type: StringConstructor;
|
||||
value?: ShapeEnum;
|
||||
};
|
||||
size?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
}
|
||||
export declare type CascadingValue = 'left-up' | 'right-up';
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
22
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar/avatar.d.ts
vendored
Normal file
22
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar/avatar.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
import { SuperComponent, RelationsOptions } from '../common/src/index';
|
||||
export default class Avatar extends SuperComponent {
|
||||
options: WechatMiniprogram.Component.ComponentOptions;
|
||||
externalClasses: string[];
|
||||
properties: import("./type").TdAvatarProps;
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
isShow: boolean;
|
||||
zIndex: number;
|
||||
systemInfo: WechatMiniprogram.WindowInfo | WechatMiniprogram.SystemInfo;
|
||||
};
|
||||
relations: RelationsOptions;
|
||||
observers: {
|
||||
icon(icon: any): void;
|
||||
};
|
||||
methods: {
|
||||
hide(): void;
|
||||
onLoadError(e: WechatMiniprogram.CustomEvent): void;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import avatarProps from"./props";import{setIcon,systemInfo}from"../common/utils";const{prefix:prefix}=config,name=`${prefix}-avatar`;let Avatar=class extends SuperComponent{constructor(){super(...arguments),this.options={multipleSlots:!0},this.externalClasses=[`${prefix}-class`,`${prefix}-class-image`,`${prefix}-class-icon`,`${prefix}-class-alt`,`${prefix}-class-content`],this.properties=avatarProps,this.data={prefix:prefix,classPrefix:name,isShow:!0,zIndex:0,systemInfo:systemInfo},this.relations={"../avatar-group/avatar-group":{type:"ancestor",linked(t){this.parent=t,this.setData({shape:this.data.shape||t.data.shape||"circle",size:this.data.size||t.data.size,bordered:!0})}}},this.observers={icon(t){const s=setIcon("icon",t,"");this.setData(Object.assign({},s))}},this.methods={hide(){this.setData({isShow:!1})},onLoadError(t){this.properties.hideOnLoadFailed&&this.setData({isShow:!1}),this.triggerEvent("error",t.detail)}}}};Avatar=__decorate([wxComponent()],Avatar);export default Avatar;
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"shared","usingComponents":{"t-icon":"../icon/icon","t-badge":"../badge/badge","t-image":"../image/image"}}
|
||||
@@ -0,0 +1 @@
|
||||
<import src="../common/template/icon.wxml"/><wxs src="../common/utils.wxs" module="_"/><wxs src="./avatar.wxs" module="_this"/><view class="{{classPrefix}}__wrapper class {{prefix}}-class" style="{{_._style([_this.getStyles(isShow), style, customStyle])}}"><t-badge color="{{badgeProps.color || ''}}" content="{{badgeProps.content || ''}}" count="{{badgeProps.count || 0}}" dot="{{badgeProps.dot || false}}" max-count="{{badgeProps.maxCount || 99}}" offset="{{badgeProps.offset || []}}" shape="{{badgeProps.shape || 'circle'}}" show-zero="{{badgeProps.showZero || false}}" size="{{badgeProps.size || 'medium'}}" t-class="{{badgeProps.tClass}}" t-class-content="{{badgeProps.tClassContent}}" t-class-count="{{badgeProps.tClassCount}}"><view class="{{_this.getClass(classPrefix, size || 'medium', shape, bordered)}} {{prefix}}-class-image" style="{{_this.getSize(size, systemInfo)}}" aria-label="{{ ariaLabel || alt ||'头像'}}" aria-role="{{ ariaRole || 'img'}}" aria-hidden="{{ ariaHidden }}"><t-image wx:if="{{image}}" t-class="{{prefix}}-image {{classPrefix}}__image" t-class-load="{{prefix}}-class-alt" style="{{imageProps && imageProps.style || ''}}" src="{{image}}" mode="{{imageProps && imageProps.mode || 'aspectFill'}}" lazy="{{imageProps && imageProps.lazy || false}}" loading="{{imageProps && imageProps.loading || 'default'}}" shape="{{imageProps && imageProps.shape || 'round'}}" webp="{{imageProps && imageProps.webp || false}}" error="{{alt || 'default'}}" bind:error="onLoadError"/><template wx:elif="{{iconName || _.isNoEmptyObj(iconData)}}" is="icon" data="{{tClass: classPrefix + '__icon ' + prefix + '-class-icon', name: iconName, ...iconData}}"/><view wx:else class="{{classPrefix}}__text {{prefix}}-class-content"><slot/></view></view></t-badge></view>
|
||||
@@ -0,0 +1,30 @@
|
||||
module.exports = {
|
||||
getClass: function (classPrefix, size, shape, bordered) {
|
||||
var hasPx = (size || '').indexOf('px') > -1;
|
||||
var borderSize = hasPx ? 'medium' : size;
|
||||
var classNames = [
|
||||
classPrefix,
|
||||
classPrefix + (shape === 'round' ? '--round' : '--circle'),
|
||||
bordered ? classPrefix + '--border' + ' ' + classPrefix + '--border-' + borderSize : '',
|
||||
hasPx ? '' : classPrefix + '--' + size,
|
||||
];
|
||||
return classNames.join(' ');
|
||||
},
|
||||
|
||||
getSize: function (size = 'medium', systemInfo) {
|
||||
var res = getRegExp('^([0-9]+)(px|rpx)$').exec(size);
|
||||
|
||||
if (res && res.length >= 3) {
|
||||
var px = res[1];
|
||||
if (res[2] === 'rpx') {
|
||||
px = Math.floor((systemInfo.windowWidth * res[1]) / 750);
|
||||
}
|
||||
|
||||
return 'width:' + size + ';height:' + size + ';font-size:' + ((px / 8) * 3 + 2) + 'px';
|
||||
}
|
||||
},
|
||||
|
||||
getStyles: function (isShow) {
|
||||
return isShow ? '' : 'display: none;';
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
@import '../common/style/index.wxss';.t-avatar{display:flex;align-items:center;justify-content:center;box-sizing:border-box;background-color:var(--td-avatar-bg-color,var(--td-brand-color-light-active,var(--td-primary-color-2,#d9e1ff)));color:var(--td-avatar-content-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));}
|
||||
.t-avatar__wrapper{display:inline-flex;position:relative;vertical-align:top;margin-left:var(--td-avatar-margin-left,0);}
|
||||
.t-avatar--large{width:var(--td-avatar-large-width,128rpx);height:var(--td-avatar-large-width,128rpx);font-size:var(--td-avatar-text-large-font-size,var(--td-font-size-xl,40rpx));}
|
||||
.t-avatar--large .t-avatar__icon{font-size:var(--td-avatar-icon-large-font-size,64rpx);}
|
||||
.t-avatar--medium{width:var(--td-avatar-medium-width,96rpx);height:var(--td-avatar-medium-width,96rpx);font-size:var(--td-avatar-text-medium-font-size,var(--td-font-size-m,32rpx));}
|
||||
.t-avatar--medium .t-avatar__icon{font-size:var(--td-avatar-icon-medium-font-size,48rpx);}
|
||||
.t-avatar--small{width:var(--td-avatar-small-width,80rpx);height:var(--td-avatar-small-width,80rpx);font-size:var(--td-avatar-text-small-font-size,var(--td-font-size-base,28rpx));}
|
||||
.t-avatar--small .t-avatar__icon{font-size:var(--td-avatar-icon-small-font-size,40rpx);}
|
||||
.t-avatar .t-image,.t-avatar__image{width:100%;height:100%;}
|
||||
.t-avatar--circle{border-radius:var(--td-avatar-circle-border-radius,var(--td-radius-circle,50%));overflow:hidden;}
|
||||
.t-avatar--round{border-radius:var(--td-avatar-round-border-radius,var(--td-radius-default,12rpx));overflow:hidden;}
|
||||
.t-avatar__icon,.t-avatar__text{width:100%;height:100%;display:flex;align-items:center;justify-content:center;}
|
||||
.t-avatar__icon:empty,.t-avatar__text:empty{width:0;height:0;}
|
||||
.t-avatar--border{border-color:var(--td-avatar-border-color,#fff);border-style:solid;}
|
||||
.t-avatar--border-small{border-width:var(--td-avatar-border-width-small,2rpx);}
|
||||
.t-avatar--border-medium{border-width:var(--td-avatar-border-width-medium,4rpx);}
|
||||
.t-avatar--border-large{border-width:var(--td-avatar-border-width-large,6rpx);}
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdAvatarProps } from './type';
|
||||
declare const props: TdAvatarProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={alt:{type:String,value:""},badgeProps:{type:Object},bordered:{type:Boolean,value:!1},hideOnLoadFailed:{type:Boolean,value:!1},icon:{type:null},image:{type:String,value:""},imageProps:{type:Object},shape:{type:String},size:{type:String,value:""}};export default props;
|
||||
41
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar/type.d.ts
vendored
Normal file
41
miniprogram/miniprogram_npm/tdesign-miniprogram/avatar/type.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { BadgeProps } from '../badge/index';
|
||||
import { ImageProps } from '../image/index';
|
||||
import { ShapeEnum } from '../common/common';
|
||||
export interface TdAvatarProps {
|
||||
alt?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
badgeProps?: {
|
||||
type: ObjectConstructor;
|
||||
value?: BadgeProps;
|
||||
};
|
||||
bordered?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
hideOnLoadFailed?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
icon?: {
|
||||
type: null;
|
||||
value?: string | object;
|
||||
};
|
||||
image?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
imageProps?: {
|
||||
type: ObjectConstructor;
|
||||
value?: ImageProps;
|
||||
};
|
||||
shape?: {
|
||||
type: StringConstructor;
|
||||
value?: ShapeEnum;
|
||||
};
|
||||
size?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
26
miniprogram/miniprogram_npm/tdesign-miniprogram/back-top/back-top.d.ts
vendored
Normal file
26
miniprogram/miniprogram_npm/tdesign-miniprogram/back-top/back-top.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { SuperComponent, RelationsOptions } from '../common/src/index';
|
||||
export default class BackTop extends SuperComponent {
|
||||
externalClasses: string[];
|
||||
options: {
|
||||
multipleSlots: boolean;
|
||||
};
|
||||
properties: import("./type").TdBackTopProps;
|
||||
relations: RelationsOptions;
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
_icon: any;
|
||||
hidden: boolean;
|
||||
};
|
||||
observers: {
|
||||
icon(): void;
|
||||
scrollTop(value: number): void;
|
||||
};
|
||||
lifetimes: {
|
||||
ready(): void;
|
||||
};
|
||||
methods: {
|
||||
setIcon(v: any): void;
|
||||
toTop(): void;
|
||||
};
|
||||
}
|
||||
@@ -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}-back-top`;let BackTop=class extends SuperComponent{constructor(){super(...arguments),this.externalClasses=[`${prefix}-class`,`${prefix}-class-icon`,`${prefix}-class-text`],this.options={multipleSlots:!0},this.properties=props,this.relations={"../pull-down-refresh/pull-down-refresh":{type:"ancestor"}},this.data={prefix:prefix,classPrefix:name,_icon:null,hidden:!0},this.observers={icon(){this.setIcon()},scrollTop(o){const{visibilityHeight:t}=this.properties;this.setData({hidden:o<t})}},this.lifetimes={ready(){const{icon:o}=this.properties;this.setIcon(o)}},this.methods={setIcon(o){this.setData({_icon:calcIcon(o,"backtop")})},toTop(){var o;this.triggerEvent("to-top"),this.$parent?(null===(o=this.$parent)||void 0===o||o.setScrollTop(0),this.setData({hidden:!0})):wx.pageScrollTo({scrollTop:0,duration:300})}}}};BackTop=__decorate([wxComponent()],BackTop);export default BackTop;
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"t-icon":"../icon/icon"}}
|
||||
@@ -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, [['fixed', fixed], theme])}}" bindtap="toTop" aria-role="button" hidden="{{hidden}}"><view class="{{classPrefix}}__icon" aria-hidden><slot name="icon"/><template wx:if="{{_icon}}" is="icon" data="{{tClass: prefix + '-class-icon', ..._icon }}"/></view><view wx:if="{{!!text}}" class="{{classPrefix}}__text--{{theme}} {{prefix}}-class-text">{{text}}</view><slot/></view>
|
||||
@@ -0,0 +1,10 @@
|
||||
@import '../common/style/index.wxss';.t-back-top{display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:transparent;overflow:hidden;box-sizing:border-box;transition:height .2s;height:auto;}
|
||||
.t-back-top--fixed{position:fixed;right:var(--td-spacer,16rpx);bottom:calc(var(--td-spacer-2,32rpx) + env(safe-area-inset-bottom));}
|
||||
.t-back-top--round,.t-back-top--round-dark{width:96rpx;height:96rpx;border-radius:var(--td-back-top-round-border-radius,var(--td-radius-circle,50%));}
|
||||
.t-back-top--half-round,.t-back-top--round{color:var(--td-back-top-round-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));border:1rpx solid var(--td-back-top-round-border-color,var(--td-component-border,var(--td-gray-color-4,#dcdcdc)));background-color:var(--td-back-top-round-bg-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));}
|
||||
.t-back-top--half-round-dark,.t-back-top--round-dark{color:var(--td-back-top-round-dark-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));background-color:var(--td-back-top-round-dark-bg-color,var(--td-gray-color-13,#242424));}
|
||||
.t-back-top--half-round,.t-back-top--half-round-dark{width:120rpx;height:80rpx;border-radius:0;border-top-left-radius:var(--td-back-top-half-round-border-radius,var(--td-radius-round,999px));border-bottom-left-radius:var(--td-back-top-half-round-border-radius,var(--td-radius-round,999px));flex-direction:row;right:0;}
|
||||
.t-back-top__text--half-round,.t-back-top__text--half-round-dark,.t-back-top__text--round,.t-back-top__text--round-dark{font-size:var(--td-font-size,20rpx);line-height:24rpx;}
|
||||
.t-back-top__text--half-round,.t-back-top__text--half-round-dark{width:48rpx;}
|
||||
.t-back-top__icon:not(:empty)+.t-back-top__text--half-round,.t-back-top__icon:not(:empty)+.t-back-top__text--half-round-dark{margin-left:8rpx;}
|
||||
.t-back-top__icon{display:flex;justify-content:center;align-items:center;font-size:44rpx;}
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/back-top/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/back-top/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdBackTopProps } from './type';
|
||||
declare const props: TdBackTopProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={fixed:{type:Boolean,value:!0},icon:{type:null,value:!0},scrollTop:{type:Number,value:0},text:{type:String,value:""},theme:{type:String,value:"round"},visibilityHeight:{type:Number,value:200}};export default props;
|
||||
26
miniprogram/miniprogram_npm/tdesign-miniprogram/back-top/type.d.ts
vendored
Normal file
26
miniprogram/miniprogram_npm/tdesign-miniprogram/back-top/type.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
export interface TdBackTopProps {
|
||||
fixed?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
icon?: {
|
||||
type: null;
|
||||
value?: string | boolean | object;
|
||||
};
|
||||
scrollTop?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
text?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
theme?: {
|
||||
type: StringConstructor;
|
||||
value?: 'round' | 'half-round' | 'round-dark' | 'half-round-dark';
|
||||
};
|
||||
visibilityHeight?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
21
miniprogram/miniprogram_npm/tdesign-miniprogram/badge/badge.d.ts
vendored
Normal file
21
miniprogram/miniprogram_npm/tdesign-miniprogram/badge/badge.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { SuperComponent } from '../common/src/index';
|
||||
import type { TdBadgeProps } from './type';
|
||||
export interface BadgeProps extends TdBadgeProps {
|
||||
}
|
||||
export default class Badge extends SuperComponent {
|
||||
options: {
|
||||
multipleSlots: boolean;
|
||||
};
|
||||
externalClasses: string[];
|
||||
properties: TdBadgeProps;
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
value: string;
|
||||
labelID: string;
|
||||
descriptionID: string;
|
||||
};
|
||||
lifetimes: {
|
||||
ready(): void;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import{uniqueFactory}from"../common/utils";const{prefix:prefix}=config,name=`${prefix}-badge`,getUniqueID=uniqueFactory("badge");let Badge=class extends SuperComponent{constructor(){super(...arguments),this.options={multipleSlots:!0},this.externalClasses=[`${prefix}-class`,`${prefix}-class-count`,`${prefix}-class-content`],this.properties=props,this.data={prefix:prefix,classPrefix:name,value:"",labelID:"",descriptionID:""},this.lifetimes={ready(){const e=getUniqueID();this.setData({labelID:`${e}_label`,descriptionID:`${e}_description`})}}}};Badge=__decorate([wxComponent()],Badge);export default Badge;
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"apply-shared","usingComponents":{}}
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="./badge.wxs" module="_this"/><wxs src="../common/utils.wxs" module="_"/><view style="{{_._style([style, customStyle])}}" class="{{_this.getBadgeOuterClass({shape})}} class {{prefix}}-class" aria-labelledby="{{labelID}}" aria-describedby="{{descriptionID}}" aria-role="{{ ariaRole || 'option'}}"><view id="{{labelID}}" class="{{classPrefix}}__content {{prefix}}-class-content" aria-hidden="true"><slot wx:if="{{!content}}" class="{{classPrefix}}__content-slot"/><text wx:else class="{{classPrefix}}__content-text">{{content}}</text></view><view aria-hidden="true" aria-label="{{ ariaLabel || _.getBadgeAriaLabel({dot, count, maxCount}) }}" wx:if="{{_this.isShowBadge({dot,count,showZero})}}" id="{{descriptionID}}" class="{{_this.getBadgeInnerClass({dot, size, shape, count})}} {{prefix}}-has-count {{prefix}}-class-count" style="{{_._style([_this.getBadgeStyles({color, offset})])}}" aria-hidden="true" aria-label="{{ ariaLabel || _.getBadgeAriaLabel({dot, count, maxCount}) }}">{{ _this.getBadgeValue({dot, count, maxCount}) }}</view><slot name="count"/></view>
|
||||
@@ -0,0 +1,71 @@
|
||||
var getBadgeValue = function (props) {
|
||||
if (props.dot) {
|
||||
return '';
|
||||
}
|
||||
if (isNaN(props.count) || isNaN(props.maxCount)) {
|
||||
return props.count;
|
||||
}
|
||||
return parseInt(props.count) > props.maxCount ? props.maxCount + '+' : props.count;
|
||||
};
|
||||
|
||||
var hasUnit = function (unit) {
|
||||
return (
|
||||
unit.indexOf('px') > 0 ||
|
||||
unit.indexOf('rpx') > 0 ||
|
||||
unit.indexOf('em') > 0 ||
|
||||
unit.indexOf('rem') > 0 ||
|
||||
unit.indexOf('%') > 0 ||
|
||||
unit.indexOf('vh') > 0 ||
|
||||
unit.indexOf('vm') > 0
|
||||
);
|
||||
};
|
||||
|
||||
var getBadgeStyles = function (props) {
|
||||
var styleStr = '';
|
||||
if (props.color) {
|
||||
styleStr += 'background:' + props.color + ';';
|
||||
}
|
||||
if (props.offset[0]) {
|
||||
styleStr +=
|
||||
'left: calc(100% + ' + (hasUnit(props.offset[0].toString()) ? props.offset[0] : props.offset[0] + 'px') + ');';
|
||||
}
|
||||
if (props.offset[1]) {
|
||||
styleStr += 'top:' + (hasUnit(props.offset[1].toString()) ? props.offset[1] : props.offset[1] + 'px') + ';';
|
||||
}
|
||||
return styleStr;
|
||||
};
|
||||
|
||||
var getBadgeOuterClass = function (props) {
|
||||
var baseClass = 't-badge';
|
||||
var classNames = [baseClass, props.shape === 'ribbon' ? baseClass + '__ribbon-outer' : ''];
|
||||
return classNames.join(' ');
|
||||
};
|
||||
|
||||
var getBadgeInnerClass = function (props) {
|
||||
var baseClass = 't-badge';
|
||||
var classNames = [
|
||||
baseClass + '--basic',
|
||||
props.dot ? baseClass + '--dot' : '',
|
||||
baseClass + '--' + props.size,
|
||||
baseClass + '--' + props.shape,
|
||||
!props.dot && props.count ? baseClass + '--count' : '',
|
||||
];
|
||||
return classNames.join(' ');
|
||||
};
|
||||
|
||||
var isShowBadge = function (props) {
|
||||
if (props.dot) {
|
||||
return true;
|
||||
}
|
||||
if (!props.showZero && !isNaN(props.count) && parseInt(props.count) === 0) {
|
||||
return false;
|
||||
}
|
||||
if (props.count == null) return false;
|
||||
return true;
|
||||
};
|
||||
|
||||
module.exports.getBadgeValue = getBadgeValue;
|
||||
module.exports.getBadgeStyles = getBadgeStyles;
|
||||
module.exports.getBadgeOuterClass = getBadgeOuterClass;
|
||||
module.exports.getBadgeInnerClass = getBadgeInnerClass;
|
||||
module.exports.isShowBadge = isShowBadge;
|
||||
@@ -0,0 +1,15 @@
|
||||
@import '../common/style/index.wxss';.t-badge{position:relative;display:inline-flex;align-items:start;}
|
||||
.t-badge--basic{z-index:100;padding:0 var(--td-badge-basic-padding,8rpx);font-size:var(--td-badge-font-size,var(--td-font-size-xs,var(--td-font-size,20rpx)));color:var(--td-badge-text-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));background-color:var(--td-badge-bg-color,var(--td-error-color,var(--td-error-color-6,#d54941)));text-align:center;height:var(--td-badge-basic-height,32rpx);line-height:var(--td-badge-basic-height,32rpx);font-weight:var(--td-badge-font-weight,600);border-radius:var(--td-badge-border-radius,4rpx);}
|
||||
.t-badge--dot{height:var(--td-badge-dot-size,16rpx);border-radius:50%;min-width:var(--td-badge-dot-size,16rpx);padding:0;}
|
||||
.t-badge--count{min-width:var(--td-badge-basic-width,32rpx);white-space:nowrap;box-sizing:border-box;}
|
||||
.t-badge--circle{border-radius:calc(var(--td-badge-basic-height,32rpx)/ 2);}
|
||||
.t-badge__ribbon-outer{position:absolute;top:0;right:0;}
|
||||
.t-badge--ribbon{position:relative;display:inline-block;transform-origin:center center;transform:translate(calc(50% - var(--td-badge-basic-height,32rpx) + 1rpx),calc(-50% + var(--td-badge-basic-height,32rpx) - 1rpx)) rotate(45deg);border-radius:0;}
|
||||
.t-badge--ribbon::after,.t-badge--ribbon::before{content:'';position:absolute;width:0;height:0;bottom:0;border-bottom:var(--td-badge-basic-height,32rpx) solid var(--td-badge-bg-color,var(--td-error-color,var(--td-error-color-6,#d54941)));font-size:0;}
|
||||
.t-badge--ribbon::before{left:calc(-1 * var(--td-badge-basic-height,32rpx) + 1rpx);border-left:var(--td-badge-basic-height,32rpx) solid transparent;}
|
||||
.t-badge--ribbon::after{right:calc(-1 * var(--td-badge-basic-height,32rpx) + 1rpx);border-right:var(--td-badge-basic-height,32rpx) solid transparent;}
|
||||
.t-badge--bubble{border-radius:var(--td-badge-bubble-border-radius,20rpx 20rpx 20rpx 1px);}
|
||||
.t-badge--large{font-size:var(--td-badge-large-font-size,var(--td-font-size-s,24rpx));height:var(--td-badge-large-height,40rpx);min-width:var(--td-badge-large-height,40rpx);line-height:var(--td-badge-large-height,40rpx);padding:0 var(--td-badge-large-padding,10rpx);}
|
||||
.t-badge--large.t-badge--circle{border-radius:calc(var(--td-badge-large-height,40rpx)/ 2);}
|
||||
.t-badge__content:not(:empty)+.t-has-count{transform-origin:center center;transform:translate(-50%,-50%);position:absolute;left:100%;top:0;}
|
||||
.t-badge__content-text{display:block;line-height:48rpx;color:var(--td-badge-content-text-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));}
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/badge/index.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/badge/index.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './type';
|
||||
export * from './props';
|
||||
export * from './badge';
|
||||
@@ -0,0 +1 @@
|
||||
export*from"./type";export*from"./props";export*from"./badge";
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/badge/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/badge/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdBadgeProps } from './type';
|
||||
declare const props: TdBadgeProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={color:{type:String,value:""},content:{type:String,value:""},count:{type:null,value:0},dot:{type:Boolean,value:!1},maxCount:{type:Number,value:99},offset:{type:Array},shape:{type:String,value:"circle"},showZero:{type:Boolean,value:!1},size:{type:String,value:"medium"}};export default props;
|
||||
38
miniprogram/miniprogram_npm/tdesign-miniprogram/badge/type.d.ts
vendored
Normal file
38
miniprogram/miniprogram_npm/tdesign-miniprogram/badge/type.d.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
export interface TdBadgeProps {
|
||||
color?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
content?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
count?: {
|
||||
type: null;
|
||||
value?: string | number;
|
||||
};
|
||||
dot?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
maxCount?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
offset?: {
|
||||
type: ArrayConstructor;
|
||||
value?: Array<string | number>;
|
||||
};
|
||||
shape?: {
|
||||
type: StringConstructor;
|
||||
value?: 'circle' | 'square' | 'bubble' | 'ribbon';
|
||||
};
|
||||
showZero?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
size?: {
|
||||
type: StringConstructor;
|
||||
value?: 'medium' | 'large';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
38
miniprogram/miniprogram_npm/tdesign-miniprogram/button/button.d.ts
vendored
Normal file
38
miniprogram/miniprogram_npm/tdesign-miniprogram/button/button.d.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { SuperComponent } from '../common/src/index';
|
||||
import type { TdButtonProps } from './type';
|
||||
export interface ButtonProps extends TdButtonProps {
|
||||
}
|
||||
export default class Button extends SuperComponent {
|
||||
externalClasses: string[];
|
||||
behaviors: string[];
|
||||
properties: TdButtonProps;
|
||||
options: {
|
||||
multipleSlots: boolean;
|
||||
};
|
||||
data: {
|
||||
prefix: string;
|
||||
className: string;
|
||||
classPrefix: string;
|
||||
};
|
||||
observers: {
|
||||
'theme, size, plain, block, shape, disabled, loading, variant'(): void;
|
||||
icon(icon: any): void;
|
||||
};
|
||||
lifetimes: {
|
||||
attached(): void;
|
||||
};
|
||||
methods: {
|
||||
setClass(): void;
|
||||
getuserinfo(e: any): void;
|
||||
contact(e: any): void;
|
||||
createliveactivity(e: any): void;
|
||||
getphonenumber(e: any): void;
|
||||
getrealtimephonenumber(e: any): void;
|
||||
error(e: any): void;
|
||||
opensetting(e: any): void;
|
||||
launchapp(e: any): void;
|
||||
chooseavatar(e: any): void;
|
||||
agreeprivacyauthorization(e: any): void;
|
||||
handleTap(e: any): void;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import{canIUseFormFieldButton}from"../common/version";import{calcIcon}from"../common/utils";const{prefix:prefix}=config,name=`${prefix}-button`;let Button=class extends SuperComponent{constructor(){super(...arguments),this.externalClasses=[`${prefix}-class`,`${prefix}-class-icon`,`${prefix}-class-loading`],this.behaviors=canIUseFormFieldButton()?["wx://form-field-button"]:[],this.properties=props,this.options={multipleSlots:!0},this.data={prefix:prefix,className:"",classPrefix:name},this.observers={"theme, size, plain, block, shape, disabled, loading, variant"(){this.setClass()},icon(t){this.setData({_icon:calcIcon(t,"")})}},this.lifetimes={attached(){this.setClass()}},this.methods={setClass(){const t=[name,`${prefix}-class`,`${name}--${this.data.variant||"base"}`,`${name}--${this.data.theme||"default"}`,`${name}--${this.data.shape||"rectangle"}`,`${name}--size-${this.data.size||"medium"}`];this.data.block&&t.push(`${name}--block`),this.data.disabled&&t.push(`${name}--disabled`),this.data.ghost&&t.push(`${name}--ghost`),this.setData({className:t.join(" ")})},getuserinfo(t){this.triggerEvent("getuserinfo",t.detail)},contact(t){this.triggerEvent("contact",t.detail)},createliveactivity(t){this.triggerEvent("createliveactivity",t.detail)},getphonenumber(t){this.triggerEvent("getphonenumber",t.detail)},getrealtimephonenumber(t){this.triggerEvent("getrealtimephonenumber",t.detail)},error(t){this.triggerEvent("error",t.detail)},opensetting(t){this.triggerEvent("opensetting",t.detail)},launchapp(t){this.triggerEvent("launchapp",t.detail)},chooseavatar(t){this.triggerEvent("chooseavatar",t.detail)},agreeprivacyauthorization(t){this.triggerEvent("agreeprivacyauthorization",t.detail)},handleTap(t){this.data.disabled||this.data.loading||this.triggerEvent("tap",t)}}}};Button=__decorate([wxComponent()],Button);export default Button;
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"t-icon":"../icon/icon","t-loading":"../loading/loading"}}
|
||||
@@ -0,0 +1 @@
|
||||
<import src="../common/template/icon.wxml"/><wxs src="../common/utils.wxs" module="_"/><button id="{{tId}}" style="{{_._style([style, customStyle])}}" data-custom="{{ customDataset }}" class="class {{className}}" form-type="{{disabled || loading ? '' : type}}" open-type="{{disabled || loading ? '' : openType}}" hover-stop-propagation="{{hoverStopPropagation}}" hover-start-time="{{hoverStartTime}}" hover-stay-time="{{hoverStayTime}}" lang="{{lang}}" session-from="{{sessionFrom}}" hover-class="{{disabled || loading ? '' : (hoverClass || classPrefix + '--hover')}}" send-message-title="{{sendMessageTitle}}" send-message-path="{{sendMessagePath}}" send-message-img="{{sendMessageImg}}" app-parameter="{{appParameter}}" show-message-card="{{showMessageCard}}" catch:tap="handleTap" bind:getuserinfo="getuserinfo" bind:contact="contact" bind:createliveactivity="createliveactivity" bind:getphonenumber="getphonenumber" bind:getrealtimephonenumber="getrealtimephonenumber" bind:error="error" bind:opensetting="opensetting" bind:launchapp="launchapp" bind:chooseavatar="chooseavatar" bind:agreeprivacyauthorization="agreeprivacyauthorization" aria-label="{{ariaLabel}}"><template wx:if="{{_icon}}" is="icon" data="{{tClass: classPrefix + '__icon ' + prefix + '-class-icon', ariaHidden: true, name: iconName, ..._icon}}"/><t-loading wx:if="{{loading}}" delay="{{loadingProps.delay || 0}}" duration="{{loadingProps.duration || 800}}" indicator="{{loadingProps.indicator || true}}" inheritColor="{{loadingProps.inheritColor || true}}" layout="{{loadingProps.layout || 'horizontal'}}" pause="{{loadingProps.pause || false}}" progress="{{loadingProps.progress || 0}}" reverse="{{loadingProps.reverse || false}}" size="{{loadingProps.size || '40rpx'}}" text="{{loadingProps.text || '' }}" theme="{{loadingProps.theme || 'circular'}}" loading t-class="{{classPrefix}}__loading {{classPrefix}}__loading--wrapper" t-class-indicator="{{classPrefix}}__loading--indicator {{prefix}}-class-loading"/><view class="{{classPrefix}}__content"><slot name="content"/><block wx:if="{{content}}">{{content}}</block><slot/></view><slot name="suffix"/></button>
|
||||
@@ -0,0 +1,129 @@
|
||||
@import '../common/style/index.wxss';.t-button--size-extra-small{font-size:var(--td-button-extra-small-font-size,var(--td-font-size-base,28rpx));padding-left:var(--td-button-extra-small-padding-horizontal,16rpx);padding-right:var(--td-button-extra-small-padding-horizontal,16rpx);height:var(--td-button-extra-small-height,56rpx);line-height:var(--td-button-extra-small-height,56rpx);}
|
||||
.t-button--size-extra-small .t-button__icon{font-size:var(--td-button-extra-small-icon-font-size,36rpx);}
|
||||
.t-button--size-small{font-size:var(--td-button-small-font-size,var(--td-font-size-base,28rpx));padding-left:var(--td-button-small-padding-horizontal,24rpx);padding-right:var(--td-button-small-padding-horizontal,24rpx);height:var(--td-button-small-height,64rpx);line-height:var(--td-button-small-height,64rpx);}
|
||||
.t-button--size-small .t-button__icon{font-size:var(--td-button-small-icon-font-size,36rpx);}
|
||||
.t-button--size-medium{font-size:var(--td-button-medium-font-size,var(--td-font-size-m,32rpx));padding-left:var(--td-button-medium-padding-horizontal,32rpx);padding-right:var(--td-button-medium-padding-horizontal,32rpx);height:var(--td-button-medium-height,80rpx);line-height:var(--td-button-medium-height,80rpx);}
|
||||
.t-button--size-medium .t-button__icon{font-size:var(--td-button-medium-icon-font-size,40rpx);}
|
||||
.t-button--size-large{font-size:var(--td-button-large-font-size,var(--td-font-size-m,32rpx));padding-left:var(--td-button-large-padding-horizontal,40rpx);padding-right:var(--td-button-large-padding-horizontal,40rpx);height:var(--td-button-large-height,96rpx);line-height:var(--td-button-large-height,96rpx);}
|
||||
.t-button--size-large .t-button__icon{font-size:var(--td-button-large-icon-font-size,48rpx);}
|
||||
.t-button--default{color:var(--td-button-default-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));background-color:var(--td-button-default-bg-color,var(--td-bg-color-component,var(--td-gray-color-3,#e7e7e7)));border-color:var(--td-button-default-border-color,var(--td-bg-color-component,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-button--default::after{border-width:var(--td-button-border-width,4rpx);border-color:var(--td-button-default-border-color,var(--td-bg-color-component,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-button--default.t-button--hover{z-index:0;}
|
||||
.t-button--default.t-button--hover,.t-button--default.t-button--hover::after{background-color:var(--td-button-default-active-bg-color,var(--td-bg-color-component-active,var(--td-gray-color-6,#a6a6a6)));border-color:var(--td-button-default-active-border-color,var(--td-bg-color-component-active,var(--td-gray-color-6,#a6a6a6)));}
|
||||
.t-button--default.t-button--disabled{color:var(--td-button-default-disabled-color,var(--td-text-color-disabled,var(--td-font-gray-4,rgba(0,0,0,.26))));background-color:var(--td-button-default-disabled-bg,var(--td-bg-color-component-disabled,var(--td-gray-color-2,#eee)));}
|
||||
.t-button--default.t-button--disabled,.t-button--default.t-button--disabled::after{border-color:var(--td-button-default-disabled-border-color,var(--td-bg-color-component-disabled,var(--td-gray-color-2,#eee)));}
|
||||
.t-button--primary{color:var(--td-button-primary-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));background-color:var(--td-button-primary-bg-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));border-color:var(--td-button-primary-border-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));}
|
||||
.t-button--primary::after{border-width:var(--td-button-border-width,4rpx);border-color:var(--td-button-primary-border-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));}
|
||||
.t-button--primary.t-button--hover{z-index:0;}
|
||||
.t-button--primary.t-button--hover,.t-button--primary.t-button--hover::after{background-color:var(--td-button-primary-active-bg-color,var(--td-brand-color-active,var(--td-primary-color-8,#003cab)));border-color:var(--td-button-primary-active-border-color,var(--td-brand-color-active,var(--td-primary-color-8,#003cab)));}
|
||||
.t-button--primary.t-button--disabled{color:var(--td-button-primary-disabled-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));background-color:var(--td-button-primary-disabled-bg,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));}
|
||||
.t-button--primary.t-button--disabled,.t-button--primary.t-button--disabled::after{border-color:var(--td-button-primary-disabled-border-color,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));}
|
||||
.t-button--light{color:var(--td-button-light-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));background-color:var(--td-button-light-bg-color,var(--td-brand-color-light,var(--td-primary-color-1,#f2f3ff)));border-color:var(--td-button-light-border-color,var(--td-brand-color-light,var(--td-primary-color-1,#f2f3ff)));}
|
||||
.t-button--light::after{border-width:var(--td-button-border-width,4rpx);border-color:var(--td-button-light-border-color,var(--td-brand-color-light,var(--td-primary-color-1,#f2f3ff)));}
|
||||
.t-button--light.t-button--hover{z-index:0;}
|
||||
.t-button--light.t-button--hover,.t-button--light.t-button--hover::after{background-color:var(--td-button-light-active-bg-color,var(--td-brand-color-light-active,var(--td-primary-color-2,#d9e1ff)));border-color:var(--td-button-light-active-border-color,var(--td-brand-color-light-active,var(--td-primary-color-2,#d9e1ff)));}
|
||||
.t-button--light.t-button--disabled{color:var(--td-button-light-disabled-color,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));background-color:var(--td-button-light-disabled-bg,var(--td-brand-color-light,var(--td-primary-color-1,#f2f3ff)));}
|
||||
.t-button--light.t-button--disabled,.t-button--light.t-button--disabled::after{border-color:var(--td-button-light-disabled-border-color,var(--td-brand-color-light,var(--td-primary-color-1,#f2f3ff)));}
|
||||
.t-button--danger{color:var(--td-button-danger-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));background-color:var(--td-button-danger-bg-color,var(--td-error-color,var(--td-error-color-6,#d54941)));border-color:var(--td-button-danger-border-color,var(--td-error-color,var(--td-error-color-6,#d54941)));}
|
||||
.t-button--danger::after{border-width:var(--td-button-border-width,4rpx);border-color:var(--td-button-danger-border-color,var(--td-error-color,var(--td-error-color-6,#d54941)));}
|
||||
.t-button--danger.t-button--hover{z-index:0;}
|
||||
.t-button--danger.t-button--hover,.t-button--danger.t-button--hover::after{background-color:var(--td-button-danger-active-bg-color,var(--td-error-color-active,var(--td-error-color-7,#ad352f)));border-color:var(--td-button-danger-active-border-color,var(--td-error-color-active,var(--td-error-color-7,#ad352f)));}
|
||||
.t-button--danger.t-button--disabled{color:var(--td-button-danger-disabled-color,var(--td-font-white-1,#fff));background-color:var(--td-button-danger-disabled-bg,var(--td-error-color-3,#ffb9b0));}
|
||||
.t-button--danger.t-button--disabled,.t-button--danger.t-button--disabled::after{border-color:var(--td-button-danger-disabled-border-color,var(--td-error-color-3,#ffb9b0));}
|
||||
.t-button{display:inline-flex;align-items:center;justify-content:center;position:relative;white-space:nowrap;text-align:center;background-image:none;transition:all .3s;touch-action:manipulation;border-radius:var(--td-button-border-radius,var(--td-radius-default,12rpx));outline:0;font-family:PingFang SC,Microsoft YaHei,Arial Regular;font-weight:var(--td-button-font-weight,600);vertical-align:top;box-sizing:border-box;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;-webkit-appearance:none;}
|
||||
.t-button::after{border-radius:calc(var(--td-button-border-radius,var(--td-radius-default,12rpx)) * 2);}
|
||||
.t-button--text{color:var(--td-button-default-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));background-color:transparent;}
|
||||
.t-button--text,.t-button--text::after{border:0;}
|
||||
.t-button--text.t-button--hover,.t-button--text.t-button--hover::after{background-color:var(--td-button-default-text-active-bg-color,var(--td-bg-color-container-active,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-button--text.t-button--primary{color:var(--td-button-primary-text-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));background-color:transparent;}
|
||||
.t-button--text.t-button--primary.t-button--hover,.t-button--text.t-button--primary.t-button--hover::after{background-color:var(--td-button-primary-text-active-bg-color,var(--td-bg-color-container-active,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-button--text.t-button--primary.t-button--disabled{color:var(--td-button-primary-text-disabled-color,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));background-color:var(--td-bg-color-container,var(--td-font-white-1,#fff));}
|
||||
.t-button--text.t-button--danger{color:var(--td-button-danger-text-color,var(--td-error-color,var(--td-error-color-6,#d54941)));background-color:transparent;}
|
||||
.t-button--text.t-button--danger.t-button--hover,.t-button--text.t-button--danger.t-button--hover::after{background-color:var(--td-button-danger-text-active-bg-color,var(--td-bg-color-container-active,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-button--text.t-button--danger.t-button--disabled{color:var(--td-button-danger-text-disabled-color,var(--td-button-danger-disabled-color,var(--td-font-white-1,#fff)));background-color:var(--td-bg-color-container,var(--td-font-white-1,#fff));}
|
||||
.t-button--text.t-button--light{color:var(--td-button-light-text-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));background-color:transparent;}
|
||||
.t-button--text.t-button--light.t-button--hover,.t-button--text.t-button--light.t-button--hover::after{background-color:var(--td-button-light-text-active-bg-color,var(--td-bg-color-container-active,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-button--text.t-button--disabled{color:var(--td-button-default-disabled-color,var(--td-text-color-disabled,var(--td-font-gray-4,rgba(0,0,0,.26))));}
|
||||
.t-button--outline{color:var(--td-button-default-outline-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));background-color:var(--td-bg-color-container,var(--td-font-white-1,#fff));}
|
||||
.t-button--outline,.t-button--outline::after{border-color:var(--td-button-default-outline-border-color,var(--td-component-border,var(--td-gray-color-4,#dcdcdc)));}
|
||||
.t-button--outline.t-button--hover,.t-button--outline.t-button--hover::after{background-color:var(--td-button-default-outline-active-bg-color,var(--td-bg-color-container-active,var(--td-gray-color-3,#e7e7e7)));border-color:var(--td-button-default-outline-active-border-color,var(--td-component-border,var(--td-gray-color-4,#dcdcdc)));}
|
||||
.t-button--outline.t-button--disabled{color:var(--td-button-default-outline-disabled-color,var(--td-component-border,var(--td-gray-color-4,#dcdcdc)));}
|
||||
.t-button--outline.t-button--disabled,.t-button--outline.t-button--disabled::after{border-color:var(--td-button-default-outline-disabled-color,var(--td-component-border,var(--td-gray-color-4,#dcdcdc)));}
|
||||
.t-button--outline.t-button--primary{color:var(--td-button-primary-outline-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));}
|
||||
.t-button--outline.t-button--primary,.t-button--outline.t-button--primary::after{border-color:var(--td-button-primary-outline-border-color,var(--td-button-primary-outline-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9))));}
|
||||
.t-button--outline.t-button--primary.t-button--hover{color:var(--td-button-primary-outline-active-border-color,var(--td-brand-color-active,var(--td-primary-color-8,#003cab)));}
|
||||
.t-button--outline.t-button--primary.t-button--hover::after{background-color:var(--td-button-primary-outline-active-bg-color,var(--td-bg-color-container-active,var(--td-gray-color-3,#e7e7e7)));border-color:var(--td-button-primary-outline-active-border-color,var(--td-brand-color-active,var(--td-primary-color-8,#003cab)));}
|
||||
.t-button--outline.t-button--primary.t-button--disabled{background-color:transparent;color:var(--td-button-primary-outline-disabled-color,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));}
|
||||
.t-button--outline.t-button--primary.t-button--disabled,.t-button--outline.t-button--primary.t-button--disabled::after{border-color:var(--td-button-primary-outline-disabled-color,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));}
|
||||
.t-button--outline.t-button--danger{color:var(--td-button-danger-outline-color,var(--td-error-color,var(--td-error-color-6,#d54941)));}
|
||||
.t-button--outline.t-button--danger,.t-button--outline.t-button--danger::after{border-color:var(--td-button-danger-outline-border-color,var(--td-button-danger-outline-color,var(--td-error-color,var(--td-error-color-6,#d54941))));}
|
||||
.t-button--outline.t-button--danger.t-button--hover{color:var(--td-button-danger-outline-active-border-color,var(--td-error-color-active,var(--td-error-color-7,#ad352f)));}
|
||||
.t-button--outline.t-button--danger.t-button--hover::after{background-color:var(--td-button-danger-outline-active-bg-color,var(--td-bg-color-container-active,var(--td-gray-color-3,#e7e7e7)));border-color:var(--td-button-danger-outline-active-border-color,var(--td-error-color-active,var(--td-error-color-7,#ad352f)));}
|
||||
.t-button--outline.t-button--danger.t-button--disabled{background-color:var(--td-bg-color-container,var(--td-font-white-1,#fff));color:var(--td-button-danger-outline-disabled-color,var(--td-error-color-3,#ffb9b0));}
|
||||
.t-button--outline.t-button--danger.t-button--disabled,.t-button--outline.t-button--danger.t-button--disabled::after{border-color:var(--td-button-danger-outline-disabled-color,var(--td-error-color-3,#ffb9b0));}
|
||||
.t-button--outline.t-button--light{color:var(--td-button-light-outline-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));background-color:var(--td-button-light-outline-bg-color,var(--td-brand-color-light,var(--td-primary-color-1,#f2f3ff)));}
|
||||
.t-button--outline.t-button--light,.t-button--outline.t-button--light::after{border-color:var(--td-button-light-outline-border-color,var(--td-button-light-outline-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9))));}
|
||||
.t-button--outline.t-button--light.t-button--hover{color:var(--td-button-light-outline-active-border-color,var(--td-brand-color-active,var(--td-primary-color-8,#003cab)));}
|
||||
.t-button--outline.t-button--light.t-button--hover,.t-button--outline.t-button--light.t-button--hover::after{background-color:var(--td-button-light-outline-active-bg-color,var(--td-brand-color-light-active,var(--td-primary-color-2,#d9e1ff)));border-color:var(--td-button-light-outline-active-border-color,var(--td-brand-color-active,var(--td-primary-color-8,#003cab)));}
|
||||
.t-button--outline.t-button--light.t-button--disabled{background-color:var(--td-bg-color-container,var(--td-font-white-1,#fff));color:var(--td-button-light-outline-disabled-color,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));}
|
||||
.t-button--outline.t-button--light.t-button--disabled,.t-button--outline.t-button--light.t-button--disabled::after{border-color:var(--td-button-light-outline-disabled-color,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));}
|
||||
.t-button--dashed{background-color:var(--td-bg-color-container,var(--td-font-white-1,#fff));border-style:dashed;border-width:2rpx;}
|
||||
.t-button--dashed::after{border:0;}
|
||||
.t-button--dashed.t-button--hover,.t-button--dashed.t-button--hover::after{background-color:var(--td-button-default-outline-active-bg-color,var(--td-bg-color-container-active,var(--td-gray-color-3,#e7e7e7)));border-color:var(--td-button-default-outline-active-border-color,var(--td-component-border,var(--td-gray-color-4,#dcdcdc)));}
|
||||
.t-button--dashed.t-button--primary{color:var(--td-button-primary-dashed-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));}
|
||||
.t-button--dashed.t-button--primary,.t-button--dashed.t-button--primary::after{border-color:var(--td-button-primary-dashed-border-color,var(--td-button-primary-dashed-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9))));}
|
||||
.t-button--dashed.t-button--primary.t-button--disabled{background-color:var(--td-bg-color-container,var(--td-font-white-1,#fff));color:var(--td-button-primary-dashed-disabled-color,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));}
|
||||
.t-button--dashed.t-button--primary.t-button--disabled,.t-button--dashed.t-button--primary.t-button--disabled::after{border-color:var(--td-button-primary-dashed-disabled-color,var(--td-brand-color-disabled,var(--td-primary-color-3,#b5c7ff)));}
|
||||
.t-button--dashed.t-button--danger{color:var(--td-button-danger-dashed-color,var(--td-error-color,var(--td-error-color-6,#d54941)));}
|
||||
.t-button--dashed.t-button--danger,.t-button--dashed.t-button--danger::after{border-color:var(--td-button-danger-dashed-border-color,var(--td-button-danger-dashed-color,var(--td-error-color,var(--td-error-color-6,#d54941))));}
|
||||
.t-button--dashed.t-button--danger.t-button--disabled{background-color:transparent;color:var(--td-button-danger-dashed-disabled-color,var(--td-button-danger-disabled-color,var(--td-font-white-1,#fff)));}
|
||||
.t-button--dashed.t-button--danger.t-button--disabled::after{border-color:var(--td-button-danger-dashed-disabled-color,var(--td-button-danger-disabled-color,var(--td-font-white-1,#fff)));}
|
||||
.t-button--ghost{background-color:transparent;color:var(--td-button-ghost-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));}
|
||||
.t-button--ghost,.t-button--ghost::after{border-color:var(--td-button-ghost-border-color,var(--td-button-ghost-color,var(--td-text-color-anti,var(--td-font-white-1,#fff))));}
|
||||
.t-button--ghost.t-button--default.t-button--hover{color:var(--td-button-ghost-hover-color,var(--td-font-white-2,rgba(255,255,255,.55)));}
|
||||
.t-button--ghost.t-button--default.t-button--hover,.t-button--ghost.t-button--default.t-button--hover::after{background-color:transparent;border-color:var(--td-button-ghost-hover-color,var(--td-font-white-2,rgba(255,255,255,.55)));}
|
||||
.t-button--ghost.t-button--primary{color:var(--td-button-ghost-primary-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));}
|
||||
.t-button--ghost.t-button--primary,.t-button--ghost.t-button--primary::after{border-color:var(--td-button-ghost-primary-border-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));}
|
||||
.t-button--ghost.t-button--primary.t-button--hover{color:var(--td-button-ghost-primary-hover-color,var(--td-brand-color-active,var(--td-primary-color-8,#003cab)));}
|
||||
.t-button--ghost.t-button--primary.t-button--hover,.t-button--ghost.t-button--primary.t-button--hover::after{background-color:transparent;border-color:var(--td-button-ghost-primary-hover-color,var(--td-brand-color-active,var(--td-primary-color-8,#003cab)));}
|
||||
.t-button--ghost.t-button--primary.t-button--text.t-button--hover,.t-button--ghost.t-button--primary.t-button--text.t-button--hover::after{background-color:var(--td-gray-color-10,#4b4b4b);}
|
||||
.t-button--ghost.t-button--primary.t-button--disabled{background-color:transparent;color:var(--td-button-ghost-disabled-color,var(--td-font-white-4,rgba(255,255,255,.22)));}
|
||||
.t-button--ghost.t-button--primary.t-button--disabled,.t-button--ghost.t-button--primary.t-button--disabled::after{border-color:var(--td-button-ghost-disabled-color,var(--td-font-white-4,rgba(255,255,255,.22)));}
|
||||
.t-button--ghost.t-button--danger{color:var(--td-button-ghost-danger-color,var(--td-error-color,var(--td-error-color-6,#d54941)));}
|
||||
.t-button--ghost.t-button--danger,.t-button--ghost.t-button--danger::after{border-color:var(--td-button-ghost-danger-border-color,var(--td-error-color,var(--td-error-color-6,#d54941)));}
|
||||
.t-button--ghost.t-button--danger.t-button--hover{color:var(--td-button-ghost-danger-hover-color,var(--td-error-color-active,var(--td-error-color-7,#ad352f)));}
|
||||
.t-button--ghost.t-button--danger.t-button--hover,.t-button--ghost.t-button--danger.t-button--hover::after{background-color:transparent;border-color:var(--td-button-ghost-danger-hover-color,var(--td-error-color-active,var(--td-error-color-7,#ad352f)));}
|
||||
.t-button--ghost.t-button--danger.t-button--text.t-button--hover,.t-button--ghost.t-button--danger.t-button--text.t-button--hover::after{background-color:var(--td-gray-color-10,#4b4b4b);}
|
||||
.t-button--ghost.t-button--danger.t-button--disabled{background-color:transparent;color:var(--td-button-ghost-disabled-color,var(--td-font-white-4,rgba(255,255,255,.22)));}
|
||||
.t-button--ghost.t-button--danger.t-button--disabled,.t-button--ghost.t-button--danger.t-button--disabled::after{border-color:var(--td-button-ghost-disabled-color,var(--td-font-white-4,rgba(255,255,255,.22)));}
|
||||
.t-button--ghost.t-button--default.t-button--text.t-button--hover,.t-button--ghost.t-button--default.t-button--text.t-button--hover::after{background-color:var(--td-gray-color-10,#4b4b4b);}
|
||||
.t-button--ghost.t-button--default.t-button--disabled{background-color:transparent;color:var(--td-button-ghost-disabled-color,var(--td-font-white-4,rgba(255,255,255,.22)));}
|
||||
.t-button--ghost.t-button--default.t-button--disabled,.t-button--ghost.t-button--default.t-button--disabled::after{border-color:var(--td-button-ghost-disabled-color,var(--td-font-white-4,rgba(255,255,255,.22)));}
|
||||
.t-button__icon+.t-button__content:not(:empty),.t-button__loading+.t-button__content:not(:empty){margin-left:8rpx;}
|
||||
.t-button__icon{border-radius:var(--td-button-icon-border-radius,8rpx);}
|
||||
.t-button--round.t-button--size-large{border-radius:calc(var(--td-button-large-height,96rpx)/ 2);}
|
||||
.t-button--round.t-button--size-large::after{border-radius:var(--td-button-large-height,96rpx);}
|
||||
.t-button--round.t-button--size-medium{border-radius:calc(var(--td-button-medium-height,80rpx)/ 2);}
|
||||
.t-button--round.t-button--size-medium::after{border-radius:var(--td-button-medium-height,80rpx);}
|
||||
.t-button--round.t-button--size-small{border-radius:calc(var(--td-button-small-height,64rpx)/ 2);}
|
||||
.t-button--round.t-button--size-small::after{border-radius:var(--td-button-small-height,64rpx);}
|
||||
.t-button--round.t-button--size-extra-small{border-radius:calc(var(--td-button-extra-small-height,56rpx)/ 2);}
|
||||
.t-button--round.t-button--size-extra-small::after{border-radius:var(--td-button-extra-small-height,56rpx);}
|
||||
.t-button--square{padding:0;}
|
||||
.t-button--square.t-button--size-large{width:var(--td-button-large-height,96rpx);}
|
||||
.t-button--square.t-button--size-medium{width:var(--td-button-medium-height,80rpx);}
|
||||
.t-button--square.t-button--size-small{width:var(--td-button-small-height,64rpx);}
|
||||
.t-button--square.t-button--size-extra-small{width:var(--td-button-extra-small-height,56rpx);}
|
||||
.t-button--circle{padding:0;border-radius:50%;}
|
||||
.t-button--circle.t-button--size-large{width:var(--td-button-large-height,96rpx);}
|
||||
.t-button--circle.t-button--size-large::after{border-radius:50%;}
|
||||
.t-button--circle.t-button--size-medium{width:var(--td-button-medium-height,80rpx);}
|
||||
.t-button--circle.t-button--size-medium::after{border-radius:50%;}
|
||||
.t-button--circle.t-button--size-small{width:var(--td-button-small-height,64rpx);}
|
||||
.t-button--circle.t-button--size-small::after{border-radius:50%;}
|
||||
.t-button--circle.t-button--size-extra-small{width:var(--td-button-extra-small-height,56rpx);}
|
||||
.t-button--circle.t-button--size-extra-small::after{border-radius:50%;}
|
||||
.t-button--block{display:flex;width:100%;}
|
||||
.t-button--disabled{cursor:not-allowed;}
|
||||
.t-button__loading--wrapper{display:flex;align-items:center;justify-content:center;}
|
||||
.t-button.t-button--hover::after{z-index:-1;}
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/button/index.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/button/index.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './props';
|
||||
export * from './type';
|
||||
export * from './button';
|
||||
@@ -0,0 +1 @@
|
||||
export*from"./props";export*from"./type";export*from"./button";
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/button/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/button/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdButtonProps } from './type';
|
||||
declare const props: TdButtonProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={appParameter:{type:String,value:""},block:{type:Boolean,value:!1},content:{type:String},customDataset:{type:null},disabled:{type:null,value:void 0},ghost:{type:Boolean,value:!1},hoverClass:{type:String,value:""},hoverStartTime:{type:Number,value:20},hoverStayTime:{type:Number,value:70},hoverStopPropagation:{type:Boolean,value:!1},icon:{type:null},lang:{type:String},loading:{type:Boolean,value:!1},loadingProps:{type:Object},openType:{type:String},phoneNumberNoQuotaToast:{type:Boolean,value:!0},sendMessageImg:{type:String,value:"截图"},sendMessagePath:{type:String,value:"当前分享路径"},sendMessageTitle:{type:String,value:"当前标题"},sessionFrom:{type:String,value:""},shape:{type:String,value:"rectangle"},showMessageCard:{type:Boolean,value:!1},size:{type:String,value:"medium"},tId:{type:String,value:""},theme:{type:String,value:"default"},type:{type:String},variant:{type:String,value:"base"}};export default props;
|
||||
111
miniprogram/miniprogram_npm/tdesign-miniprogram/button/type.d.ts
vendored
Normal file
111
miniprogram/miniprogram_npm/tdesign-miniprogram/button/type.d.ts
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
import { LoadingProps } from '../loading/index';
|
||||
export interface TdButtonProps {
|
||||
appParameter?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
block?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
content?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
customDataset?: {
|
||||
type: null;
|
||||
value?: null;
|
||||
};
|
||||
disabled?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
ghost?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
hoverClass?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
hoverStartTime?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
hoverStayTime?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
hoverStopPropagation?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
icon?: {
|
||||
type: null;
|
||||
value?: string | object;
|
||||
};
|
||||
lang?: {
|
||||
type: StringConstructor;
|
||||
value?: 'en' | 'zh_CN' | 'zh_TW';
|
||||
};
|
||||
loading?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
loadingProps?: {
|
||||
type: ObjectConstructor;
|
||||
value?: LoadingProps;
|
||||
};
|
||||
openType?: {
|
||||
type: StringConstructor;
|
||||
value?: 'contact' | 'share' | 'getPhoneNumber' | 'getUserInfo' | 'launchApp' | 'openSetting' | 'feedback' | 'chooseAvatar' | 'agreePrivacyAuthorization';
|
||||
};
|
||||
phoneNumberNoQuotaToast?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
sendMessageImg?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
sendMessagePath?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
sendMessageTitle?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
sessionFrom?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
shape?: {
|
||||
type: StringConstructor;
|
||||
value?: 'rectangle' | 'square' | 'round' | 'circle';
|
||||
};
|
||||
showMessageCard?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
size?: {
|
||||
type: StringConstructor;
|
||||
value?: 'extra-small' | 'small' | 'medium' | 'large';
|
||||
};
|
||||
tId?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
theme?: {
|
||||
type: StringConstructor;
|
||||
value?: 'default' | 'primary' | 'danger' | 'light';
|
||||
};
|
||||
type?: {
|
||||
type: StringConstructor;
|
||||
value?: 'submit' | 'reset';
|
||||
};
|
||||
variant?: {
|
||||
type: StringConstructor;
|
||||
value?: 'base' | 'outline' | 'dashed' | 'text';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="../common/utils.wxs" module="_"/><template name="calendar-header"><view class="{{tClass}} {{classPrefix}} {{switchMode !== 'none' ? classPrefix + '__with-action' : ''}}" id="{{tId}}"><view class="{{classPrefix}}__action" wx:if="{{switchMode !== 'none'}}"><view wx:if="{{switchMode === 'year-month'}}" class="{{_.cls(classPrefix + '__icon', [['disabled', preYearBtnDisable]])}}" data-disabled="{{preYearBtnDisable}}" data-type="pre-year" bindtap="handleSwitchModeChange"><t-icon name="chevron-left-double"/></view><view class="{{_.cls(classPrefix + '__icon', [['disabled', prevMonthBtnDisable]])}}" data-disabled="{{prevMonthBtnDisable}}" data-type="pre-month" bindtap="handleSwitchModeChange"><t-icon name="chevron-left"/></view></view><view class="{{classPrefix}}__title">{{ title }}</view><view class="{{classPrefix}}__action" wx:if="{{switchMode !== 'none'}}"><view class="{{_.cls(classPrefix + '__icon', [['disabled', nextMonthBtnDisable]])}}" data-disabled="{{nextMonthBtnDisable}}" data-type="next-month" bindtap="handleSwitchModeChange"><t-icon name="chevron-right"/></view><view wx:if="{{switchMode === 'year-month'}}" class="{{_.cls(classPrefix + '__icon', [['disabled', nextYearBtnDisable]])}}" data-disabled="{{nextYearBtnDisable}}" data-type="next-year" bindtap="handleSwitchModeChange"><t-icon name="chevron-right-double"/></view></view></view></template>
|
||||
64
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/calendar.d.ts
vendored
Normal file
64
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/calendar.d.ts
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
import { SuperComponent } from '../common/src/index';
|
||||
import { TdCalendarProps } from './type';
|
||||
export interface CalendarProps extends TdCalendarProps {
|
||||
}
|
||||
export default class Calendar extends SuperComponent {
|
||||
behaviors: string[];
|
||||
externalClasses: string[];
|
||||
options: WechatMiniprogram.Component.ComponentOptions;
|
||||
properties: TdCalendarProps;
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
months: any[];
|
||||
scrollIntoView: string;
|
||||
innerConfirmBtn: {};
|
||||
realLocalText: {};
|
||||
currentMonth: {};
|
||||
actionButtons: {
|
||||
preYearBtnDisable: boolean;
|
||||
prevMonthBtnDisable: boolean;
|
||||
nextMonthBtnDisable: boolean;
|
||||
nextYearBtnDisable: boolean;
|
||||
};
|
||||
};
|
||||
controlledProps: {
|
||||
key: string;
|
||||
event: string;
|
||||
}[];
|
||||
lifetimes: {
|
||||
created(): void;
|
||||
ready(): void;
|
||||
};
|
||||
observers: {
|
||||
type(v: any): void;
|
||||
allowSameDay(v: any): void;
|
||||
confirmBtn(v: any): void;
|
||||
'firstDayOfWeek,minDate,maxDate'(firstDayOfWeek: any, minDate: any, maxDate: any): void;
|
||||
value(v: any): void;
|
||||
visible(v: any): void;
|
||||
format(v: any): void;
|
||||
};
|
||||
methods: {
|
||||
initialValue(): void;
|
||||
scrollIntoView(): void;
|
||||
getCurrentYearAndMonth(v: Date): {
|
||||
year: number;
|
||||
month: number;
|
||||
};
|
||||
updateActionButton(value: Date): void;
|
||||
updateCurrentMonth(newValue?: any): void;
|
||||
calcCurrentMonth(newValue?: any): void;
|
||||
calcMonths(): void;
|
||||
close(trigger: any): void;
|
||||
onVisibleChange(): void;
|
||||
handleClose(): void;
|
||||
handleSelect(e: any): void;
|
||||
onTplButtonTap(): void;
|
||||
toTime(val: any): any;
|
||||
onScroll(e: any): void;
|
||||
getCurrentDate(): any;
|
||||
handleSwitchModeChange(e: any): void;
|
||||
};
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"t-popup":"../popup/popup","t-button":"../button/button","t-icon":"../icon/icon"}}
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="./calendar.wxs" module="_this"/><wxs src="../common/utils.wxs" module="_"/><t-popup wx:if="{{usePopup}}" class="class" visible="{{visible}}" usingCustomNavbar="{{usingCustomNavbar}}" bind:visible-change="onVisibleChange" placement="bottom"><include src="./template.wxml"/></t-popup><block wx:else><include src="./template.wxml"/></block>
|
||||
@@ -0,0 +1,44 @@
|
||||
function getDateLabel(monthItem, dateItem) {
|
||||
var weekdayText = ['日', '一', '二', '三', '四', '五', '六'];
|
||||
var weekday = (monthItem.weekdayOfFirstDay + dateItem.day - 1) % 7;
|
||||
var label = monthItem.month + 1 + '月' + dateItem.day + '日, 星期' + weekdayText[weekday];
|
||||
if (dateItem.type === 'start') {
|
||||
label = '开始日期:' + label;
|
||||
}
|
||||
if (dateItem.type === 'end') {
|
||||
label = '结束日期:' + label;
|
||||
}
|
||||
if (isDateSelected(dateItem)) {
|
||||
label = '已选中, ' + label;
|
||||
}
|
||||
if (dateItem.prefix) {
|
||||
label += ', ' + dateItem.prefix;
|
||||
}
|
||||
if (dateItem.suffix) {
|
||||
label += ', ' + dateItem.suffix;
|
||||
}
|
||||
return label;
|
||||
}
|
||||
|
||||
function isDateSelected(dateItem) {
|
||||
return ['start', 'end', 'selected', 'centre'].indexOf(dateItem.type) >= 0;
|
||||
}
|
||||
|
||||
function getMonthTitle(year, month, pattern = '') {
|
||||
// prettier-ignore
|
||||
var REGEXP = getRegExp('\{year\}|\{month\}', 'g');
|
||||
|
||||
return pattern.replace(REGEXP, function (match) {
|
||||
var replacements = {
|
||||
'{year}': year,
|
||||
'{month}': month < 10 ? '0' + month : month,
|
||||
};
|
||||
return replacements[match] || match;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getDateLabel: getDateLabel,
|
||||
isDateSelected: isDateSelected,
|
||||
getMonthTitle: getMonthTitle,
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
@import '../common/style/index.wxss';.t-calendar{width:inherit;position:relative;z-index:9999;background:var(--td-calendar-bg-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));overflow-x:hidden;}
|
||||
.t-calendar--popup{border-top-left-radius:var(--td-calendar-radius,24rpx);border-top-right-radius:var(--td-calendar-radius,24rpx);}
|
||||
.t-calendar__title{display:flex;align-items:center;justify-content:center;font-size:var(--td-calendar-title-font-size,18px);font-weight:600;color:var(--td-calendar-title-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));height:52rpx;padding:32rpx;}
|
||||
.t-calendar__title:focus{outline:0;}
|
||||
.t-calendar__close-btn{position:absolute;top:32rpx;right:32rpx;margin:-24rpx;padding:24rpx;color:var(--td-calendar-title-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));}
|
||||
.t-calendar__days{display:grid;grid-template-columns:repeat(7,1fr);grid-column-gap:8rpx;padding:0 32rpx;text-align:center;line-height:92rpx;}
|
||||
.t-calendar__days-item{height:92rpx;font-size:28rpx;color:var(--td-calendar-days-color,var(--td-text-color-secondary,var(--td-font-gray-2,rgba(0,0,0,.6))));}
|
||||
.t-calendar__content{min-height:400rpx;display:flex;flex-direction:column;}
|
||||
.t-calendar__month{font-size:28rpx;color:var(--td-calendar-title-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));font-weight:600;padding:32rpx 0 0;}
|
||||
.t-calendar__months{height:712rpx;padding:0 32rpx 32rpx;box-sizing:border-box;}
|
||||
.t-calendar__months::-webkit-scrollbar{display:none;}
|
||||
.t-calendar__dates{flex:1;display:grid;grid-template-columns:repeat(7,1fr);grid-column-gap:8rpx;}
|
||||
.t-calendar__dates-item{position:relative;display:flex;align-items:center;justify-content:center;font-size:32rpx;border-radius:var(--td-calendar-selected-border-radius,var(--td-radius-default,12rpx));height:120rpx;line-height:48rpx;font-weight:600;margin-top:16rpx;color:var(--td-calendar-title-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;}
|
||||
.t-calendar__dates-item-prefix,.t-calendar__dates-item-suffix{position:absolute;font-size:20rpx;line-height:32rpx;width:100%;text-align:center;font-weight:400;}
|
||||
.t-calendar__dates-item-prefix{top:8rpx;}
|
||||
.t-calendar__dates-item-suffix{bottom:8rpx;color:var(--td-calendar-item-suffix-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));}
|
||||
.t-calendar__dates-item-suffix--end,.t-calendar__dates-item-suffix--selected,.t-calendar__dates-item-suffix--start{color:var(--td-calendar-selected-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));}
|
||||
.t-calendar__dates-item-suffix--disabled{color:var(--td-calendar-item-disabled-color,var(--td-text-color-disabled,var(--td-font-gray-4,rgba(0,0,0,.26))));}
|
||||
.t-calendar__dates-item--end,.t-calendar__dates-item--selected,.t-calendar__dates-item--start,.t-calendar__dates-item--start-end{background:var(--td-calendar-active-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));color:var(--td-calendar-selected-color,var(--td-text-color-anti,var(--td-font-white-1,#fff)));border-radius:var(--td-calendar-selected-border-radius,var(--td-radius-default,12rpx));}
|
||||
.t-calendar__dates-item--start{border-radius:var(--td-calendar-selected-border-radius,var(--td-radius-default,12rpx)) 0 0 var(--td-calendar-selected-border-radius,var(--td-radius-default,12rpx));}
|
||||
.t-calendar__dates-item--end{border-radius:0 var(--td-calendar-selected-border-radius,var(--td-radius-default,12rpx)) var(--td-calendar-selected-border-radius,var(--td-radius-default,12rpx)) 0;}
|
||||
.t-calendar__dates-item--start+.t-calendar__dates-item--end::before{content:'';display:block;position:absolute;top:0;width:8rpx;height:100%;background:var(--td-calendar-active-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));}
|
||||
.t-calendar__dates-item--start+.t-calendar__dates-item--end:before{left:-8rpx;}
|
||||
.t-calendar__dates-item--centre{border-radius:0;background-color:var(--td-calendar-item-centre-color,var(--td-brand-color-light,var(--td-primary-color-1,#f2f3ff)));}
|
||||
.t-calendar__dates-item--centre::after,.t-calendar__dates-item--centre::before{content:'';display:block;position:absolute;top:0;width:8rpx;height:100%;background-color:var(--td-calendar-item-centre-color,var(--td-brand-color-light,var(--td-primary-color-1,#f2f3ff)));}
|
||||
.t-calendar__dates-item--centre:before{left:-8rpx;}
|
||||
.t-calendar__dates-item--centre:after{right:-8rpx;}
|
||||
.t-calendar__dates-item--disabled{color:var(--td-calendar-item-disabled-color,var(--td-text-color-disabled,var(--td-font-gray-4,rgba(0,0,0,.26))));cursor:default;}
|
||||
.t-calendar__footer{padding:32rpx;}
|
||||
.t-calendar-switch-mode--none>.t-calendar__months{height:60vh;}
|
||||
.t-calendar-header{display:flex;justify-content:space-between;align-items:center;line-height:44rpx;}
|
||||
.t-calendar-header__with-action{padding:0rpx 32rpx 16rpx 32rpx;box-sizing:border-box;position:relative;}
|
||||
.t-calendar-header__with-action::after{content:'';display:block;position:absolute;top:unset;bottom:0;left:unset;right:unset;background-color:var(--td-border-color,var(--td-gray-color-3,#e7e7e7));}
|
||||
.t-calendar-header__with-action::after{height:1px;left:0;right:0;transform:scaleY(.5);}
|
||||
.t-calendar-header__with-action .t-calendar-header__title{flex:1;text-align:center;font-size:28rpx;font-weight:600;}
|
||||
.t-calendar-header__action{display:flex;font-size:40rpx;color:var(--td-calendar-switch-mode-icon-color,var(--td-text-color-secondary,var(--td-font-gray-2,rgba(0,0,0,.6))));}
|
||||
.t-calendar-header__icon{padding:16rpx;}
|
||||
.t-calendar-header__icon--disabled{color:var(--td-calendar-switch-mode-icon-disabled-color,var(--td-text-color-disabled,var(--td-font-gray-4,rgba(0,0,0,.26))));}
|
||||
.t-calendar-header__title{text-align:left;}
|
||||
2
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/index.d.ts
vendored
Normal file
2
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/index.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './type';
|
||||
export * from './calendar';
|
||||
@@ -0,0 +1 @@
|
||||
export*from"./type";export*from"./calendar";
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdCalendarProps } from './type';
|
||||
declare const props: TdCalendarProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={allowSameDay:{type:Boolean,value:!1},autoClose:{type:Boolean,value:!0},confirmBtn:{type:null,value:""},firstDayOfWeek:{type:Number,value:0},format:{type:null},localeText:{type:Object},maxDate:{type:Number},minDate:{type:Number},readonly:{type:Boolean},switchMode:{type:String,value:"none"},title:{type:String},type:{type:String,value:"single"},usePopup:{type:Boolean,value:!0},usingCustomNavbar:{type:Boolean,value:!1},value:{type:null,value:null},defaultValue:{type:null},visible:{type:Boolean,value:!1}};export default props;
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="./calendar.wxs" module="_this"/><wxs src="../common/utils.wxs" module="_"/><import src="../common/template/button.wxml"/><import src="./calendar-header.wxml"/><view class="{{_.cls(classPrefix, [['popup', usePopup]])}} {{classPrefix}}-switch-mode--{{switchMode}} class {{prefix}}-class" style="{{_._style([style, customStyle])}}"><view class="{{classPrefix}}__title" tabindex="0"><slot name="title"/><text wx:if="{{title || realLocalText.title}}">{{ title || realLocalText.title }}</text></view><t-icon wx:if="{{usePopup}}" name="close" class="{{classPrefix}}__close-btn" size="48rpx" aria-role="button" aria-label="关闭" bind:tap="handleClose"/><template wx:if="{{switchMode !== 'none'}}" is="calendar-header" data="{{ classPrefix: classPrefix + '-header', switchMode, ...actionButtons, title: _this.getMonthTitle(currentMonth[0].year, realLocalText.months[currentMonth[0].month], realLocalText.monthTitle)}}"/><view aria-hidden class="{{classPrefix}}__days"><view wx:for="{{days}}" wx:key="index" class="{{classPrefix}}__days-item">{{ item }}</view></view><scroll-view class="{{classPrefix}}__months" scroll-into-view="{{scrollIntoView}}" scroll-y enhanced show-scrollbar="{{false}}" bindscroll="onScroll"><block wx:for="{{ switchMode === 'none' ? months : currentMonth}}" wx:key="index"><template wx:if="{{switchMode === 'none'}}" is="calendar-header" data="{{tClass: classPrefix + '__month', classPrefix: classPrefix + '-header', tId: 'year_' + item.year + '_month_' + item.month, switchMode, ...actionButtons, title: _this.getMonthTitle(item.year, realLocalText.months[item.month], realLocalText.monthTitle) }}"/><view class="{{classPrefix}}__dates"><view wx:for="{{(item.weekdayOfFirstDay - firstDayOfWeek + 7) % 7}}" wx:key="index"/><block wx:for="{{item.months}}" wx:for-index="dateIndex" wx:for-item="dateItem" wx:key="dateIndex"><view class="{{classPrefix}}__dates-item {{dateItem.className}} {{classPrefix}}__dates-item--{{dateItem.type}}" data-year="{{item.year}}" data-month="{{item.month}}" data-date="{{dateItem}}" aria-role="button" aria-label="{{_this.getDateLabel(item, dateItem)}}" aria-disabled="{{dateItem.type === 'disabled'}}" bind:tap="handleSelect"><view wx:if="{{dateItem.prefix}}" class="{{classPrefix}}__dates-item-prefix">{{ dateItem.prefix }}</view>{{ dateItem.day }}<view wx:if="{{dateItem.suffix}}" class="{{classPrefix}}__dates-item-suffix {{classPrefix}}__dates-item-suffix--{{dateItem.type}}">{{ dateItem.suffix }}</view></view></block></view></block></scroll-view><view wx:if="{{innerConfirmBtn != null && usePopup}}" class="{{classPrefix}}__footer"><slot wx:if="{{innerConfirmBtn === 'slot'}}" name="confirm-btn"/><block wx:elif="{{innerConfirmBtn}}"><template is="button" data="{{ block: true, theme: 'primary', rootClass: 't-calendar__confirm-btn', content: realLocalText.confirm, ...innerConfirmBtn }}"/></block></view></view>
|
||||
88
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/type.d.ts
vendored
Normal file
88
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/type.d.ts
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
import { ButtonProps } from '../button/index';
|
||||
export interface TdCalendarProps {
|
||||
allowSameDay?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
autoClose?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
confirmBtn?: {
|
||||
type: null;
|
||||
value?: string | ButtonProps | null;
|
||||
};
|
||||
firstDayOfWeek?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
format?: {
|
||||
type: undefined;
|
||||
value?: CalendarFormatType;
|
||||
};
|
||||
localeText?: {
|
||||
type: ObjectConstructor;
|
||||
value?: CalendarLocaleText;
|
||||
};
|
||||
maxDate?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
minDate?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
readonly?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
switchMode?: {
|
||||
type: StringConstructor;
|
||||
value?: 'none' | 'month' | 'year-month';
|
||||
};
|
||||
title?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
type?: {
|
||||
type: StringConstructor;
|
||||
value?: 'single' | 'multiple' | 'range';
|
||||
};
|
||||
usePopup?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
usingCustomNavbar?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
value?: {
|
||||
type: null;
|
||||
value?: number | number[];
|
||||
};
|
||||
defaultValue?: {
|
||||
type: null;
|
||||
value?: number | number[];
|
||||
};
|
||||
visible?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
}
|
||||
export declare type CalendarFormatType = (day: TDate) => TDate;
|
||||
export declare type TDateType = 'selected' | 'disabled' | 'start' | 'centre' | 'end' | '';
|
||||
export interface TDate {
|
||||
date: Date;
|
||||
day: number;
|
||||
type: TDateType;
|
||||
className?: string;
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
}
|
||||
export interface CalendarLocaleText {
|
||||
title?: string;
|
||||
weekdays?: string[];
|
||||
monthTitle?: string;
|
||||
months?: string[];
|
||||
confirm?: string;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
6
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/utils.d.ts
vendored
Normal file
6
miniprogram/miniprogram_npm/tdesign-miniprogram/calendar/utils.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export declare function getMonthByOffset(date: Date, offset: number): Date;
|
||||
export declare function getYearByOffset(date: Date, offset: number): Date;
|
||||
export declare const getPrevMonth: (date: Date) => Date;
|
||||
export declare const getNextMonth: (date: Date) => Date;
|
||||
export declare const getPrevYear: (date: Date) => Date;
|
||||
export declare const getNextYear: (date: Date) => Date;
|
||||
@@ -0,0 +1 @@
|
||||
export function getMonthByOffset(t,e){const n=new Date(t);return n.setMonth(n.getMonth()+e),n}export function getYearByOffset(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n}export const getPrevMonth=t=>getMonthByOffset(t,-1);export const getNextMonth=t=>getMonthByOffset(t,1);export const getPrevYear=t=>getYearByOffset(t,-1);export const getNextYear=t=>getYearByOffset(t,1);
|
||||
59
miniprogram/miniprogram_npm/tdesign-miniprogram/cascader/cascader.d.ts
vendored
Normal file
59
miniprogram/miniprogram_npm/tdesign-miniprogram/cascader/cascader.d.ts
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
import { SuperComponent } from '../common/src/index';
|
||||
import { TdCascaderProps } from './type';
|
||||
export interface CascaderProps extends TdCascaderProps {
|
||||
}
|
||||
export default class Cascader extends SuperComponent {
|
||||
externalClasses: string[];
|
||||
options: WechatMiniprogram.Component.ComponentOptions;
|
||||
properties: TdCascaderProps<import("../common/common").TreeOptionData<string | number>>;
|
||||
controlledProps: {
|
||||
key: string;
|
||||
event: string;
|
||||
}[];
|
||||
state: {
|
||||
contentHeight: number;
|
||||
stepHeight: number;
|
||||
tabsHeight: number;
|
||||
subTitlesHeight: number;
|
||||
stepsInitHeight: number;
|
||||
};
|
||||
data: {
|
||||
prefix: string;
|
||||
name: string;
|
||||
stepIndex: number;
|
||||
selectedIndexes: any[];
|
||||
selectedValue: any[];
|
||||
scrollTopList: any[];
|
||||
steps: any[];
|
||||
_optionsHeight: number;
|
||||
};
|
||||
observers: {
|
||||
visible(v: any): void;
|
||||
value(): void;
|
||||
options(): void;
|
||||
selectedIndexes(): void;
|
||||
stepIndex(): Promise<void>;
|
||||
};
|
||||
methods: {
|
||||
updateOptionsHeight(steps: number): void;
|
||||
initOptionsHeight(steps: number): Promise<void>;
|
||||
initWithValue(): void;
|
||||
getIndexesByValue(options: import("../common/common").TreeOptionData<string | number>[], value: any): any[];
|
||||
updateScrollTop(): void;
|
||||
hide(trigger: any): void;
|
||||
onVisibleChange(): void;
|
||||
onClose(): void;
|
||||
onStepClick(e: any): void;
|
||||
onTabChange(e: any): void;
|
||||
genItems(): {
|
||||
selectedValue: any[];
|
||||
steps: any[];
|
||||
items: {
|
||||
[x: string]: any;
|
||||
}[][];
|
||||
};
|
||||
handleSelect(e: any): void;
|
||||
triggerChange(): void;
|
||||
};
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"t-icon":"../icon/icon","t-popup":"../popup/popup","t-tabs":"../tabs/tabs","t-tab-panel":"../tab-panel/tab-panel","t-radio-group":"../radio-group/radio-group"}}
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="../common/utils.wxs" module="_"/><t-popup class="class" visible="{{visible}}" placement="bottom" bind:visible-change="onVisibleChange"><view style="{{_._style([style, customStyle])}}" class="{{name}}"><view class="{{name}}__title"><slot name="title"/>{{title}}</view><view class="{{name}}__close-btn" bind:tap="onClose"><slot name="close-btn"/><t-icon wx:if="{{closeBtn}}" size="48rpx" name="close"/></view><slot name="header"/><view class="{{name}}__content"><block wx:if="{{steps && steps.length}}"><view wx:if="{{theme == 'step'}}" class="{{name}}__steps"><view wx:for="{{steps}}" wx:key="index" class="{{name}}__step" bind:tap="onStepClick" data-index="{{index}}"><view class="{{name}}__step-dot {{name}}__step-dot--{{item !== placeholder ? 'active' : ''}} {{name}}__step-dot--{{index === steps.length - 1 ? 'last' : ''}}"></view><view class="{{name}}__step-label {{name}}__step-label--{{index === stepIndex ? 'active' : ''}}">{{ item }}</view><t-icon name="chevron-right" size="44rpx" t-class="{{name}}__step-arrow"/></view></view><block wx:if="{{theme == 'tab'}}"><t-tabs id="tabs" value="{{stepIndex}}" bind:change="onTabChange" space-evenly="{{false}}"><t-tab-panel wx:for="{{steps}}" wx:key="index" value="{{index}}" label="{{item}}"/></t-tabs></block></block><view wx:if="{{ subTitles && subTitles[stepIndex] }}" class="{{name}}__options-title">{{subTitles[stepIndex]}}</view><view class="{{name}}__options-container" style="width: {{items.length + 1}}00vw; transform: translateX(-{{stepIndex}}00vw)"><scroll-view wx:for="{{items}}" wx:for-item="options" wx:key="index" class="{{name}}__options" scroll-y scroll-top="{{scrollTopList[index]}}" type="list" style="height: {{_optionsHeight}}px"><view class="cascader-radio-group-{{index}}"><t-radio-group value="{{selectedValue[index]}}" keys="{{keys}}" options="{{options}}" bind:change="handleSelect" data-level="{{index}}" placement="right" icon="line" borderless></t-radio-group></view></scroll-view></view></view></view></t-popup>
|
||||
@@ -0,0 +1,17 @@
|
||||
@import '../common/style/index.wxss';.t-cascader{display:flex;flex-direction:column;background-color:var(--td-cascader-bg-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));color:var(--td-cascader-title-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));border-radius:var(--td-radius-extraLarge,24rpx) var(--td-radius-extraLarge,24rpx) 0 0;--td-radio-icon-checked-color:var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));--td-tab-item-active-color:var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));--td-tab-track-color:var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));}
|
||||
.t-cascader__close-btn{right:32rpx;top:24rpx;position:absolute;}
|
||||
.t-cascader__title{position:relative;font-weight:700;text-align:center;line-height:var(--td-cascader-title-height,26rpx);padding:var(--td-cascader-title-padding,var(--td-spacer-2,32rpx));font-size:var(--td-cascader-title-font-size,36rpx);}
|
||||
.t-cascader__content{width:100%;height:var(--td-cascader-content-height,78vh);display:flex;flex-direction:column;}
|
||||
.t-cascader__options{width:100vw;}
|
||||
.t-cascader__options-title{color:var(--td-cascader-options-title-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));font-size:var(--td-font-size-base,28rpx);line-height:44rpx;padding-top:40rpx;padding-left:var(--td-spacer-2,32rpx);box-sizing:border-box;}
|
||||
.t-cascader__options-container{flex:1;display:flex;transition:all ease .3s;}
|
||||
.t-cascader__step{display:flex;align-items:center;height:var(--td-cascader-step-height,88rpx);}
|
||||
.t-cascader__steps{padding:0 32rpx 10rpx;position:relative;}
|
||||
.t-cascader__steps::after{content:'';display:block;position:absolute;top:unset;bottom:0;left:unset;right:unset;background-color:var(--td-cascader-border-color,var(--td-component-stroke,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-cascader__steps::after{height:1px;left:0;right:0;transform:scaleY(.5);}
|
||||
.t-cascader__step-dot{position:relative;width:var(--td-cascader-step-dot-size,16rpx);height:var(--td-cascader-step-dot-size,16rpx);border-radius:50%;border:2rpx solid var(--td-cascader-active-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));box-sizing:border-box;}
|
||||
.t-cascader__step-dot:not(.t-cascader__step-dot--last)::after{content:'';display:block;position:absolute;left:50%;top:calc(var(--td-cascader-step-dot-size,16rpx) + 14rpx);height:36rpx;width:2rpx;background:var(--td-cascader-active-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));transform:translateX(-50%);}
|
||||
.t-cascader__step-dot--active{background:var(--td-cascader-active-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));border-color:var(--td-cascader-active-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));}
|
||||
.t-cascader__step-label{padding-left:var(--td-spacer-2,32rpx);font-size:var(--td-font-size-m,32rpx);}
|
||||
.t-cascader__step-label--active{color:var(--td-cascader-active-color,var(--td-brand-color,var(--td-primary-color-7,#0052d9)));font-weight:600;}
|
||||
.t-cascader__step-arrow{color:var(--td-cascader-step-arrow-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));margin-left:auto;}
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/cascader/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/cascader/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdCascaderProps } from './type';
|
||||
declare const props: TdCascaderProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={checkStrictly:{type:Boolean,value:!1},closeBtn:{type:Boolean,value:!0},keys:{type:Object},options:{type:Array,value:[]},placeholder:{type:String,value:"选择选项"},subTitles:{type:Array,value:[]},theme:{type:String,value:"step"},title:{type:String},value:{type:null,value:null},defaultValue:{type:null,value:null},visible:{type:Boolean,value:!1}};export default props;
|
||||
48
miniprogram/miniprogram_npm/tdesign-miniprogram/cascader/type.d.ts
vendored
Normal file
48
miniprogram/miniprogram_npm/tdesign-miniprogram/cascader/type.d.ts
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { TreeOptionData, TreeKeysType } from '../common/common';
|
||||
export interface TdCascaderProps<CascaderOption extends TreeOptionData = TreeOptionData> {
|
||||
checkStrictly?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
closeBtn?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
keys?: {
|
||||
type: ObjectConstructor;
|
||||
value?: CascaderKeysType;
|
||||
};
|
||||
options?: {
|
||||
type: ArrayConstructor;
|
||||
value?: Array<CascaderOption>;
|
||||
};
|
||||
placeholder?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
subTitles?: {
|
||||
type: ArrayConstructor;
|
||||
value?: Array<string>;
|
||||
};
|
||||
theme?: {
|
||||
type: StringConstructor;
|
||||
value?: 'step' | 'tab';
|
||||
};
|
||||
title?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
value?: {
|
||||
type: null;
|
||||
value?: string | number;
|
||||
};
|
||||
defaultValue?: {
|
||||
type: null;
|
||||
value?: string | number;
|
||||
};
|
||||
visible?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
}
|
||||
export declare type CascaderKeysType = TreeKeysType;
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
13
miniprogram/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.d.ts
vendored
Normal file
13
miniprogram/miniprogram_npm/tdesign-miniprogram/cell-group/cell-group.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { SuperComponent, RelationsOptions } from '../common/src/index';
|
||||
export default class CellGroup extends SuperComponent {
|
||||
externalClasses: string[];
|
||||
relations: RelationsOptions;
|
||||
properties: import("./type").TdCellGroupProps;
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
};
|
||||
methods: {
|
||||
updateLastChid(): void;
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user