tmp
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { SuperComponent, ComponentsOptionsType, RelationsOptions } from '../common/src/index';
|
||||
import { TdCheckboxProps } from './type';
|
||||
export declare type CheckboxProps = TdCheckboxProps;
|
||||
export default class CheckBox extends SuperComponent {
|
||||
externalClasses: string[];
|
||||
behaviors: string[];
|
||||
@@ -46,7 +48,7 @@ export default class CheckBox extends SuperComponent {
|
||||
};
|
||||
icon?: {
|
||||
type: null;
|
||||
value?: string[] | "rectangle" | "circle" | "line";
|
||||
value?: import("./type").CheckboxIconType;
|
||||
};
|
||||
indeterminate?: {
|
||||
type: BooleanConstructor;
|
||||
|
||||
@@ -1 +1 @@
|
||||
<wxs src="../common/utils.wxs" module="_"/><view id="{{tId}}" style="{{_._style([style, customStyle])}}" class="{{_.cls(classPrefix, [placement, theme, ['checked', checked], ['block', block]])}} class {{prefix}}-class" aria-role="checkbox" aria-checked="{{checked ? (indeterminate ? 'mixed' : true) : false}}" aria-disabled="{{_disabled ? true : false}}" mut-bind:tap="handleTap" tabindex="{{tabindex}}"><view wx:if="{{theme == 'default'}}" class="{{_.cls(classPrefix + '__icon', [placement, ['checked', checked], ['disabled', _disabled]])}} {{prefix}}-class-icon"><slot name="icon" wx:if="{{icon === 'slot'}}"/><view wx:elif="{{_.isArray(icon)}}" class="{{classPrefix}}__icon"><image src="{{checked ? indeterminate && icon[2] ? icon[2] : icon[0] : icon[1]}}" class="{{classPrefix}}__icon-image" webp/></view><block wx:else><t-icon wx:if="{{checked && (icon == 'circle' || icon == 'rectangle')}}" name="{{indeterminate ? ('minus-' + icon + '-filled') : ('check-' + icon + '-filled')}}" class="{{_.cls(classPrefix + '__icon-wrapper', [])}}"/><t-icon wx:if="{{checked && icon == 'line'}}" name="{{indeterminate ? ('minus-' + icon + '-filled') : 'check'}}" class="{{_.cls(classPrefix + '__icon-wrapper', [])}}"/><view wx:elif="{{!checked && (icon == 'circle' || icon == 'rectangle')}}" class="{{_.cls(classPrefix + '__icon-' + icon, [['disabled', _disabled]])}}"/><view wx:if="{{!checked && icon == 'line'}}" class="placeholder"></view></block></view><view class="{{classPrefix}}__content" data-target="text" mut-bind:tap="handleTap"><view class="{{_.cls(classPrefix + '__title', [['disabled', _disabled], ['checked', checked]])}} {{prefix}}-class-label" style="-webkit-line-clamp:{{maxLabelRow}}"><block wx:if="{{label}}">{{label}}</block><slot/><slot name="label"/></view><view class="{{_.cls(classPrefix + '__description', [['disabled', _disabled]])}} {{prefix}}-class-content" style="-webkit-line-clamp:{{maxContentRow}}"><block wx:if="{{content}}">{{content}}</block><slot name="content"/></view></view><view wx:if="{{theme == 'default' && !borderless}}" class="{{_.cls(classPrefix + '__border', [placement])}} {{prefix}}-class-border"/></view>
|
||||
<wxs src="../common/utils.wxs" module="_"/><view id="{{tId}}" style="{{_._style([style, customStyle])}}" class="{{_.cls(classPrefix, [placement, theme, ['checked', checked], ['block', block], ['disabled', _disabled]])}} class {{prefix}}-class" aria-role="checkbox" aria-checked="{{checked ? (indeterminate ? 'mixed' : true) : false}}" aria-disabled="{{_disabled ? true : false}}" mut-bind:tap="handleTap" tabindex="{{tabindex}}"><view wx:if="{{theme == 'default'}}" class="{{_.cls(classPrefix + '__icon', [placement, ['checked', checked], ['disabled', _disabled]])}} {{prefix}}-class-icon"><slot name="icon" wx:if="{{icon === 'slot'}}"/><view wx:elif="{{_.isArray(icon)}}" class="{{classPrefix}}__icon"><image src="{{checked ? indeterminate && icon[2] ? icon[2] : icon[0] : icon[1]}}" class="{{classPrefix}}__icon-image"/></view><block wx:else><t-icon wx:if="{{checked && (icon == 'circle' || icon == 'rectangle')}}" name="{{indeterminate ? ('minus-' + icon + '-filled') : ('check-' + icon + '-filled')}}" class="{{classPrefix}}__icon-wrapper"/><t-icon wx:if="{{checked && icon == 'line'}}" name="{{indeterminate ? ('minus-' + icon + '-filled') : 'check'}}" class="{{classPrefix}}__icon-wrapper"/><view wx:elif="{{!checked && (icon == 'circle' || icon == 'rectangle')}}" class="{{_.cls(classPrefix + '__icon-' + icon, [['disabled', _disabled]])}}"/><view wx:if="{{!checked && icon == 'line'}}" class="placeholder"></view></block></view><view class="{{classPrefix}}__content" data-target="text" mut-bind:tap="handleTap"><view class="{{_.cls(classPrefix + '__title', [['disabled', _disabled], ['checked', checked]])}} {{prefix}}-class-label" style="-webkit-line-clamp:{{maxLabelRow}}"><block wx:if="{{label}}">{{label}}</block><slot/><slot name="label"/></view><view class="{{_.cls(classPrefix + '__description', [['disabled', _disabled]])}} {{prefix}}-class-content" style="-webkit-line-clamp:{{maxContentRow}}"><block wx:if="{{content}}">{{content}}</block><slot name="content"/></view></view><view wx:if="{{theme == 'default' && !borderless}}" class="{{_.cls(classPrefix + '__border', [placement])}} {{prefix}}-class-border"/></view>
|
||||
File diff suppressed because one or more lines are too long
3
miniprogram_npm/tdesign-miniprogram/checkbox/index.d.ts
vendored
Normal file
3
miniprogram_npm/tdesign-miniprogram/checkbox/index.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './props';
|
||||
export * from './type';
|
||||
export * from './checkbox';
|
||||
1
miniprogram_npm/tdesign-miniprogram/checkbox/index.js
Normal file
1
miniprogram_npm/tdesign-miniprogram/checkbox/index.js
Normal file
@@ -0,0 +1 @@
|
||||
export*from"./props";export*from"./type";export*from"./checkbox";
|
||||
@@ -1 +1 @@
|
||||
const props={block:{type:Boolean,value:!0},borderless:{type:Boolean,value:!1},checkAll:{type:Boolean,value:!1},checked:{type:Boolean,value:null},defaultChecked:{type:Boolean,value:!1},content:{type:String},contentDisabled:{type:Boolean},disabled:{type:null,value:void 0},icon:{type:null,value:"circle"},indeterminate:{type:Boolean,value:!1},label:{type:String},maxContentRow:{type:Number,value:5},maxLabelRow:{type:Number,value:3},name:{type:String,value:""},placement:{type:String,value:"left"},readonly:{type:Boolean,value:!1},value:{type:null}};export default props;
|
||||
const props={block:{type:Boolean,value:!0},borderless:{type:null,value:void 0},checkAll:{type:Boolean,value:!1},checked:{type:Boolean,value:null},defaultChecked:{type:Boolean,value:!1},content:{type:String},contentDisabled:{type:Boolean},disabled:{type:null,value:void 0},icon:{type:null,value:"circle"},indeterminate:{type:Boolean,value:!1},label:{type:String},maxContentRow:{type:Number,value:5},maxLabelRow:{type:Number,value:3},name:{type:String,value:""},placement:{type:String,value:"left"},readonly:{type:null,value:void 0},value:{type:null}};export default props;
|
||||
@@ -33,7 +33,7 @@ export interface TdCheckboxProps {
|
||||
};
|
||||
icon?: {
|
||||
type: null;
|
||||
value?: 'circle' | 'line' | 'rectangle' | string[];
|
||||
value?: CheckboxIconType;
|
||||
};
|
||||
indeterminate?: {
|
||||
type: BooleanConstructor;
|
||||
@@ -68,3 +68,4 @@ export interface TdCheckboxProps {
|
||||
value?: string | number | boolean;
|
||||
};
|
||||
}
|
||||
export declare type CheckboxIconType = 'circle' | 'line' | 'rectangle' | string[];
|
||||
|
||||
Reference in New Issue
Block a user