init: initial commit

This commit is contained in:
Blizzard
2026-02-04 14:02:31 +08:00
commit 6ceda92e9d
2234 changed files with 38231 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
export * from './props';
export * from './type';
export * from './overlay';
+1
View File
@@ -0,0 +1 @@
export*from"./props";export*from"./type";export*from"./overlay";
+65
View File
@@ -0,0 +1,65 @@
/// <reference types="miniprogram-api-typings" />
/// <reference types="miniprogram-api-typings" />
import { SuperComponent } from '../common/src/index';
import { TdOverlayProps } from './type';
export interface OverlayProps extends TdOverlayProps {
}
export default class Overlay extends SuperComponent {
properties: TdOverlayProps;
behaviors: (WechatMiniprogram.Behavior.BehaviorIdentifier<{
transitionClass: string;
transitionDurations: number;
className: string;
realVisible: boolean;
}, {
visible: {
type: BooleanConstructor;
value: any;
observer: string;
};
appear: BooleanConstructor;
name: {
type: StringConstructor;
value: string;
};
durations: {
type: NumberConstructor;
optionalTypes: ArrayConstructor[];
};
}, {
watchVisible(curr: any, prev: any): void;
getDurations(): number[];
enter(): void;
entered(): void;
leave(): void;
leaved(): void;
onTransitionEnd(): void;
}, WechatMiniprogram.Component.BehaviorOption> | WechatMiniprogram.Behavior.BehaviorIdentifier<{
distanceTop: number;
}, {
usingCustomNavbar: {
type: BooleanConstructor;
value: false;
};
customNavbarHeight: {
type: NumberConstructor;
value: number;
};
}, {
calculateCustomNavbarDistanceTop(): void;
}, WechatMiniprogram.Component.BehaviorOption>)[];
data: {
prefix: string;
classPrefix: string;
computedStyle: string;
_zIndex: number;
};
observers: {
backgroundColor(v: any): void;
zIndex(v: any): void;
};
methods: {
handleClick(): void;
noop(): void;
};
}
+1
View File
@@ -0,0 +1 @@
import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import transition from"../mixins/transition";import useCustomNavbar from"../mixins/using-custom-navbar";const{prefix:prefix}=config,name=`${prefix}-overlay`;let Overlay=class extends SuperComponent{constructor(){super(...arguments),this.properties=props,this.behaviors=[transition(),useCustomNavbar],this.data={prefix:prefix,classPrefix:name,computedStyle:"",_zIndex:11e3},this.observers={backgroundColor(o){this.setData({computedStyle:o?`background-color: ${o};`:""})},zIndex(o){0!==o&&this.setData({_zIndex:o})}},this.methods={handleClick(){this.triggerEvent("click",{visible:!this.properties.visible})},noop(){}}}};Overlay=__decorate([wxComponent()],Overlay);export default Overlay;
@@ -0,0 +1 @@
{"component":true,"styleIsolation":"apply-shared"}
@@ -0,0 +1 @@
<wxs src="../common/utils.wxs" module="_"/><view wx:if="{{realVisible && preventScrollThrough}}" class="{{prefix}}-overlay {{transitionClass}} class" style="{{_._style(['--td-overlay-transition-duration:' + duration + 'ms', 'z-index:' + _zIndex, 'top:' + distanceTop + 'px', computedStyle, style, customStyle])}}" bind:tap="handleClick" catchtouchmove="noop" bind:transitionend="onTransitionEnd" aria-role="{{ ariaRole || 'button' }}" aria-label="{{ ariaLabel || '关闭' }}"><slot/></view><view wx:elif="{{realVisible}}" class="{{prefix}}-overlay {{transitionClass}} class" style="{{_._style(['z-index:' + _zIndex, 'top:' + distanceTop + 'px', computedStyle, style, customStyle])}}" bind:tap="handleClick" bind:transitionend="onTransitionEnd" aria-role="{{ ariaRole || 'button' }}" aria-label="{{ ariaLabel || '关闭' }}"><slot/></view>
@@ -0,0 +1,3 @@
@import '../common/style/index.wxss';.t-overlay{position:fixed;top:0;left:0;width:100%;bottom:0;background-color:var(--td-overlay-bg-color,var(--td-mask-active,rgba(0,0,0,.6)));transition-property:opacity;transition-duration:var(--td-overlay-transition-duration,300ms);transition-timing-function:ease;}
.t-fade-enter{opacity:0;}
.t-fade-leave-to{opacity:0;}
+3
View File
@@ -0,0 +1,3 @@
import { TdOverlayProps } from './type';
declare const props: TdOverlayProps;
export default props;
+1
View File
@@ -0,0 +1 @@
const props={backgroundColor:{type:String,value:""},duration:{type:Number,value:300},preventScrollThrough:{type:Boolean,value:!0},zIndex:{type:Number,value:11e3}};export default props;
+26
View File
@@ -0,0 +1,26 @@
export interface TdOverlayProps {
backgroundColor?: {
type: StringConstructor;
value?: string;
};
duration?: {
type: NumberConstructor;
value?: number;
};
preventScrollThrough?: {
type: BooleanConstructor;
value?: boolean;
};
usingCustomNavbar?: {
type: BooleanConstructor;
value?: boolean;
};
visible?: {
type: BooleanConstructor;
value?: boolean;
};
zIndex?: {
type: NumberConstructor;
value?: number;
};
}
+1
View File
@@ -0,0 +1 @@
export{};