升级package, 以及更新声明文件
This commit is contained in:
@@ -1 +1 @@
|
||||
const props={bordered:{type:Boolean,value:!0},fixed:{type:Boolean,value:!0},safeAreaInsetBottom:{type:Boolean,value:!0},shape:{type:String,value:"normal"},split:{type:Boolean,value:!0},theme:{type:String,value:"normal"},value:{type:null,value:null},defaultValue:{type:null}};export default props;
|
||||
const props={bordered:{type:Boolean,value:!0},fixed:{type:Boolean,value:!0},placeholder:{type:Boolean,value:!1},safeAreaInsetBottom:{type:Boolean,value:!0},shape:{type:String,value:"normal"},split:{type:Boolean,value:!0},theme:{type:String,value:"normal"},value:{type:null,value:null},defaultValue:{type:null},zIndex:{type:Number,value:1}};export default props;
|
||||
@@ -6,6 +6,7 @@ export default class Tabbar extends SuperComponent {
|
||||
data: {
|
||||
prefix: string;
|
||||
classPrefix: string;
|
||||
placeholderHeight: number;
|
||||
};
|
||||
properties: import("./type").TdTabBarProps;
|
||||
controlledProps: {
|
||||
@@ -14,11 +15,13 @@ export default class Tabbar extends SuperComponent {
|
||||
}[];
|
||||
observers: {
|
||||
value(): void;
|
||||
'fixed, placeholder'(): void;
|
||||
};
|
||||
lifetimes: {
|
||||
ready(): void;
|
||||
};
|
||||
methods: {
|
||||
setPlaceholderHeight(): void;
|
||||
showChildren(): void;
|
||||
updateChildren(): void;
|
||||
updateValue(value: any): void;
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{__decorate}from"tslib";import{wxComponent,SuperComponent}from"../common/src/index";import config from"../common/config";import props from"./props";const{prefix:prefix}=config,classPrefix=`${prefix}-tab-bar`;let Tabbar=class extends SuperComponent{constructor(){super(...arguments),this.relations={"../tab-bar-item/tab-bar-item":{type:"descendant"}},this.externalClasses=[`${prefix}-class`],this.backupValue=-1,this.data={prefix:prefix,classPrefix:classPrefix},this.properties=props,this.controlledProps=[{key:"value",event:"change"}],this.observers={value(){this.updateChildren()}},this.lifetimes={ready(){this.showChildren()}},this.methods={showChildren(){const{value:e}=this.data;this.$children.forEach(r=>{r.setData({crowded:this.$children.length>3}),r.properties.value===e&&r.showSpread()})},updateChildren(){const{value:e}=this.data;this.$children.forEach(r=>{r.checkActive(e)})},updateValue(e){this._trigger("change",{value:e})},changeOtherSpread(e){this.$children.forEach(r=>{r.properties.value!==e&&r.closeSpread()})},initName(){return this.backupValue+=1}}}};Tabbar=__decorate([wxComponent()],Tabbar);export default Tabbar;
|
||||
import{__decorate}from"tslib";import{wxComponent,SuperComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import{getRect}from"../common/utils";const{prefix:prefix}=config,classPrefix=`${prefix}-tab-bar`;let Tabbar=class extends SuperComponent{constructor(){super(...arguments),this.relations={"../tab-bar-item/tab-bar-item":{type:"descendant"}},this.externalClasses=[`${prefix}-class`],this.backupValue=-1,this.data={prefix:prefix,classPrefix:classPrefix,placeholderHeight:56},this.properties=props,this.controlledProps=[{key:"value",event:"change"}],this.observers={value(){this.updateChildren()},"fixed, placeholder"(){this.setPlaceholderHeight()}},this.lifetimes={ready(){this.showChildren()}},this.methods={setPlaceholderHeight(){this.properties.fixed&&this.properties.placeholder&&wx.nextTick(()=>{getRect(this,`.${classPrefix}`).then(e=>{this.setData({placeholderHeight:e.height})})})},showChildren(){const{value:e}=this.data;this.$children.forEach(t=>{t.setData({crowded:this.$children.length>3}),t.properties.value===e&&t.showSpread()})},updateChildren(){const{value:e}=this.data;this.$children.forEach(t=>{t.checkActive(e)})},updateValue(e){this._trigger("change",{value:e})},changeOtherSpread(e){this.$children.forEach(t=>{t.properties.value!==e&&t.closeSpread()})},initName(){return this.backupValue+=1}}}};Tabbar=__decorate([wxComponent()],Tabbar);export default Tabbar;
|
||||
@@ -1 +1 @@
|
||||
<wxs src="../common/utils.wxs" module="_"/><view style="{{_._style([style, customStyle])}}" class="{{_.cls(classPrefix, [['border', bordered], ['fixed', fixed], ['safe', safeAreaInsetBottom], shape])}} class {{prefix}}-class" aria-role="tablist"><slot/></view>
|
||||
<wxs src="../common/utils.wxs" module="_"/><view wx:if="{{fixed && placeholder}}" class="{{classPrefix}}__placeholder" style="height: {{ placeholderHeight }}px;"/><view style="{{_._style(['z-index: ' + zIndex, style, customStyle])}}" class="{{_.cls(classPrefix, [['border', bordered], ['fixed', fixed], ['safe', safeAreaInsetBottom], shape])}} class {{prefix}}-class" aria-role="tablist"><slot/></view>
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '../common/style/index.wxss';.t-tab-bar{display:flex;flex-wrap:nowrap;align-items:center;position:relative;font-size:16px;background-color:var(--td-tab-bar-bg-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));box-sizing:border-box;pointer-events:auto;}
|
||||
@import '../common/style/index.wxss';.t-tab-bar{display:flex;flex-wrap:nowrap;align-items:center;position:relative;background-color:var(--td-tab-bar-bg-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));box-sizing:border-box;pointer-events:auto;}
|
||||
.t-tab-bar--normal.t-tab-bar--border::before{z-index:1;position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;left:0;top:0;border-top:1px solid var(--td-tab-bar-border-color,var(--td-border-level-1-color,var(--td-gray-color-3,#e7e7e7)));transform:scaleY(.5);transform-origin:0 0;}
|
||||
.t-tab-bar--fixed{position:fixed;left:0;bottom:0;right:0;}
|
||||
.t-tab-bar--normal.t-tab-bar--safe{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);}
|
||||
|
||||
@@ -7,6 +7,10 @@ export interface TdTabBarProps {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
placeholder?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
};
|
||||
safeAreaInsetBottom?: {
|
||||
type: BooleanConstructor;
|
||||
value?: boolean;
|
||||
@@ -31,4 +35,8 @@ export interface TdTabBarProps {
|
||||
type: null;
|
||||
value?: string | number | Array<string | number>;
|
||||
};
|
||||
zIndex?: {
|
||||
type: NumberConstructor;
|
||||
value?: number;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user