初始化项目, 添加TDesign等包
This commit is contained in:
16
miniprogram/miniprogram_npm/tdesign-miniprogram/drawer/drawer.d.ts
vendored
Normal file
16
miniprogram/miniprogram_npm/tdesign-miniprogram/drawer/drawer.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ComponentsOptionsType, SuperComponent } from '../common/src/index';
|
||||
export default class Drawer extends SuperComponent {
|
||||
behaviors: string[];
|
||||
externalClasses: any[];
|
||||
options: ComponentsOptionsType;
|
||||
properties: import("./type").TdDrawerProps;
|
||||
data: {
|
||||
classPrefix: string;
|
||||
};
|
||||
methods: {
|
||||
onVisibleChange({ detail }: {
|
||||
detail: any;
|
||||
}): void;
|
||||
onItemClick(detail: 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 useCustomNavbar from"../mixins/using-custom-navbar";const{prefix:prefix}=config,name=`${prefix}-drawer`;let Drawer=class extends SuperComponent{constructor(){super(...arguments),this.behaviors=[useCustomNavbar],this.externalClasses=[],this.options={multipleSlots:!0},this.properties=props,this.data={classPrefix:name},this.methods={onVisibleChange({detail:e}){const{visible:t}=e,{showOverlay:r}=this.data;this.setData({visible:t}),t||this.triggerEvent("close",{trigger:"overlay"}),r&&this.triggerEvent("overlay-click",{visible:t})},onItemClick(e){const{index:t,item:r}=e.currentTarget.dataset;this.triggerEvent("item-click",{index:t,item:r})}}}};Drawer=__decorate([wxComponent()],Drawer);export default Drawer;
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"styleIsolation":"apply-shared","usingComponents":{"t-popup":"../popup/popup","t-icon":"../icon/icon"}}
|
||||
@@ -0,0 +1 @@
|
||||
<wxs src="../common/utils.wxs" module="_"/><t-popup wx:if="{{!destroyOnClose || visible}}" style="{{_._style([style, customStyle])}}" class="class" visible="{{visible}}" z-index="{{zIndex}}" using-custom-navbar="{{usingCustomNavbar}}" placement="{{placement == 'right' ? 'right' : 'left'}}" show-overlay="{{showOverlay}}" overlay-props="{{overlayProps}}" close-on-click-overlay="{{closeOnOverlayClick}}" bind:visible-change="onVisibleChange"><view class="{{classPrefix}}"><slot name="title"/><view wx:if="{{title}}" class="{{classPrefix}}__title">{{title}}</view><scroll-view class="{{classPrefix}}__sidebar" scroll-y type="list"><view class="{{classPrefix}}__sidebar-item" hover-class="{{classPrefix}}--hover" hover-start-time="{{0}}" hover-stay-time="{{100}}" wx:for="{{items}}" wx:item="item" wx:key="index" data-item="{{item}}" data-index="{{index}}" aria-role="{{ ariaRole || 'button' }}" aria-label="{{item.title}}" bindtap="onItemClick"><view aria-hidden="{{true}}" wx:if="{{item.icon}}" class="{{classPrefix}}__sidebar-item-icon"><t-icon name="{{item.icon}}"/></view><view class="{{classPrefix}}__sidebar-item-title">{{item.title}}</view></view></scroll-view><view class="{{classPrefix}}__footer"><slot/><slot name="footer"/></view></view></t-popup>
|
||||
@@ -0,0 +1,11 @@
|
||||
@import '../common/style/index.wxss';.t-drawer{background:var(--td-drawer-bg-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));width:var(--td-drawer-width,560rpx);height:100%;display:flex;flex-direction:column;}
|
||||
.t-drawer--hover{background-color:var(--td-drawer-hover-color,var(--td-bg-color-secondarycontainer,var(--td-gray-color-1,#f3f3f3)));}
|
||||
.t-drawer__title{font-weight:600;font-size:var(--td-drawer-title-font-size,36rpx);padding:48rpx 32rpx 16rpx;color:var(--td-drawer-title-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));}
|
||||
.t-drawer__sidebar{height:var(--td-drawer-sidebar-height,70vh);}
|
||||
.t-drawer__sidebar-item{display:flex;align-items:center;position:relative;padding-top:var(--td-drawer-item-padding,32rpx);padding-right:0;padding-bottom:var(--td-drawer-item-padding,32rpx);padding-left:var(--td-drawer-item-padding,32rpx);line-height:var(--td-drawer-item-height,48rpx);}
|
||||
.t-drawer__sidebar-item::after{content:'';display:block;position:absolute;top:unset;bottom:0;left:unset;right:unset;background-color:var(--td-drawer-border-color,var(--td-border-level-1-color,var(--td-gray-color-3,#e7e7e7)));}
|
||||
.t-drawer__sidebar-item::after{height:1px;left:0;right:0;transform:scaleY(.5);}
|
||||
.t-drawer__sidebar-item::after{left:var(--td-drawer-item-padding,32rpx);}
|
||||
.t-drawer__sidebar-item-title{flex:1;color:var(--td-drawer-title-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));}
|
||||
.t-drawer__sidebar-item-icon{padding-right:16rpx;color:var(--td-drawer-item-icon-color,var(--td-drawer-title-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9)))));font-size:var(--td-drawer-item-icon-size,48rpx);}
|
||||
.t-drawer__footer{flex:1;display:flex;flex-direction:column;padding-bottom:var(--td-drawer-footer-padding-bottom,40rpx);}
|
||||
3
miniprogram/miniprogram_npm/tdesign-miniprogram/drawer/props.d.ts
vendored
Normal file
3
miniprogram/miniprogram_npm/tdesign-miniprogram/drawer/props.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TdDrawerProps } from './type';
|
||||
declare const props: TdDrawerProps;
|
||||
export default props;
|
||||
@@ -0,0 +1 @@
|
||||
const props={closeOnOverlayClick:{type:Boolean,value:!0},destroyOnClose:{type:Boolean,value:!1},items:{type:Array},overlayProps:{type:Object,value:{}},placement:{type:String,value:"right"},showOverlay:{type:Boolean,value:!0},title:{type:String},usingCustomNavbar:{type:Boolean,value:!1},visible:{type:Boolean,value:!1},zIndex:{type:Number,value:11500}};export default props;
|
||||
47
miniprogram/miniprogram_npm/tdesign-miniprogram/drawer/type.d.ts
vendored
Normal file
47
miniprogram/miniprogram_npm/tdesign-miniprogram/drawer/type.d.ts
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { OverlayProps } from '../overlay/index';
|
||||
export interface TdDrawerProps {
|
||||
closeOnOverlayClick?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
destroyOnClose?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
items?: {
|
||||
type: ArrayConstructor;
|
||||
value?: DrawerItem[];
|
||||
};
|
||||
overlayProps?: {
|
||||
type: ObjectConstructor;
|
||||
value?: OverlayProps;
|
||||
};
|
||||
placement?: {
|
||||
type: StringConstructor;
|
||||
value?: 'left' | 'right';
|
||||
};
|
||||
showOverlay?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
title?: {
|
||||
type: StringConstructor;
|
||||
value?: string;
|
||||
};
|
||||
usingCustomNavbar?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
visible?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
zIndex?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
}
|
||||
export interface DrawerItem {
|
||||
title: string;
|
||||
icon: string;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export{};
|
||||
Reference in New Issue
Block a user