This commit is contained in:
lik
2026-05-28 17:06:18 +08:00
parent a93a75b3c6
commit db0f47d994
582 changed files with 8060 additions and 1781 deletions

View File

@@ -1 +1 @@
const props={adjustPosition:{type:Boolean,value:!0},allowInputOverMax:{type:Boolean,value:!1},autofocus:{type:Boolean,value:!1},autosize:{type:null,value:!1},bordered:{type:Boolean,value:!1},confirmHold:{type:Boolean,value:!1},confirmType:{type:String,value:"return"},cursor:{type:Number,value:-1},cursorSpacing:{type:Number,value:0},disableDefaultPadding:{type:Boolean,value:!1},disabled:{type:null,value:void 0},fixed:{type:Boolean,value:!1},focus:{type:Boolean,value:!1},holdKeyboard:{type:Boolean,value:!1},indicator:{type:Boolean,value:!1},label:{type:String},maxcharacter:{type:Number},maxlength:{type:Number,value:-1},placeholder:{type:String,value:void 0},placeholderClass:{type:String,value:"textarea-placeholder"},placeholderStyle:{type:String,value:""},readonly:{type:null,value:void 0},selectionEnd:{type:Number,value:-1},selectionStart:{type:Number,value:-1},showConfirmBar:{type:Boolean,value:!0},value:{type:null,value:null},defaultValue:{type:null}};export default props;
const props={adjustPosition:{type:Boolean,value:!0},allowInputOverMax:{type:Boolean,value:!1},autofocus:{type:Boolean,value:!1},autosize:{type:null,value:!1},bordered:{type:Boolean,value:!1},confirmHold:{type:Boolean,value:!1},confirmType:{type:String,value:"return"},cursor:{type:Number,value:-1},cursorColor:{type:String,value:"#0052d9"},cursorSpacing:{type:Number,value:0},disableDefaultPadding:{type:Boolean,value:!1},disabled:{type:null,value:void 0},fixed:{type:Boolean,value:!1},focus:{type:Boolean,value:!1},holdKeyboard:{type:Boolean,value:!1},indicator:{type:Boolean,value:!1},label:{type:String},maxcharacter:{type:Number},maxlength:{type:Number,value:-1},placeholder:{type:String,value:void 0},placeholderClass:{type:String,value:"textarea-placeholder"},placeholderStyle:{type:String,value:""},readonly:{type:null,value:void 0},selectionEnd:{type:Number,value:-1},selectionStart:{type:Number,value:-1},showConfirmBar:{type:Boolean,value:!0},value:{type:null,value:null},defaultValue:{type:null}};export default props;

View File

@@ -1 +1 @@
<wxs src="../common/utils.wxs" module="_"/><wxs src="./textarea.wxs" module="_this"/><view style="{{_._style([style, customStyle])}}" class="{{classPrefix}} {{bordered? classPrefix + '--border' : ''}} class {{prefix}}-class"><view class="{{classPrefix}}__label {{prefix}}-class-label"><block wx:if="{{label}}">{{ label }}</block><slot name="label"/></view><view class="{{classPrefix}}__wrapper"><textarea class="{{classPrefix}}__wrapper-inner {{disabled? prefix + '-is-disabled' : ''}} {{prefix}}-class-textarea" style="{{_this.textareaStyle(autosize)}}" maxlength="{{allowInputOverMax ? -1 : maxlength}}" disabled="{{disabled || readonly}}" placeholder="{{placeholder}}" placeholder-class="{{classPrefix}}__placeholder {{placeholderClass}}" placeholder-style="{{placeholderStyle}}" value="{{value}}" auto-height="{{!!autosize}}" auto-focus="{{autofocus}}" fixed="{{fixed}}" focus="{{focus}}" cursor="{{cursor}}" cursor-spacing="{{cursorSpacing}}" adjust-position="{{adjustPosition}}" confirm-type="{{confirmType}}" confirm-hold="{{confirmHold}}" disable-default-padding="{{disableDefaultPadding}}" show-confirm-bar="{{showConfirmBar}}" selection-start="{{selectionStart}}" selection-end="{{selectionEnd}}" hold-keyboard="{{holdKeyboard}}" bindinput="onInput" bindfocus="onFocus" bindblur="onBlur" bindconfirm="onConfirm" bindlinechange="onLineChange" bind:keyboardheightchange="onKeyboardHeightChange"/><view wx:if="{{indicator && (maxcharacter > 0 || maxlength > 0 )}}" class="{{classPrefix}}__indicator {{prefix}}-class-indicator">{{count}} / {{maxcharacter || maxlength}}</view></view></view>
<wxs src="../common/utils.wxs" module="_"/><wxs src="./textarea.wxs" module="_this"/><view style="{{_._style([style, customStyle])}}" class="{{classPrefix}} {{bordered? classPrefix + '--border' : ''}} class {{prefix}}-class"><view class="{{classPrefix}}__label {{prefix}}-class-label"><block wx:if="{{label}}">{{ label }}</block><slot name="label"/></view><view class="{{classPrefix}}__wrapper"><textarea class="{{classPrefix}}__wrapper-inner {{disabled? prefix + '-is-disabled' : ''}} {{prefix}}-class-textarea" style="{{_this.textareaStyle(autosize)}}" maxlength="{{allowInputOverMax ? -1 : maxlength}}" disabled="{{disabled || readonly}}" placeholder="{{placeholder}}" placeholder-class="{{classPrefix}}__placeholder {{placeholderClass}}" placeholder-style="{{placeholderStyle}}" value="{{value}}" auto-height="{{!!autosize}}" auto-focus="{{autofocus}}" fixed="{{fixed}}" focus="{{focus}}" cursor="{{cursor}}" cursor-spacing="{{cursorSpacing}}" cursor-color="{{cursorColor}}" adjust-position="{{adjustPosition}}" confirm-type="{{confirmType}}" confirm-hold="{{confirmHold}}" disable-default-padding="{{disableDefaultPadding}}" show-confirm-bar="{{showConfirmBar}}" selection-start="{{selectionStart}}" selection-end="{{selectionEnd}}" hold-keyboard="{{holdKeyboard}}" bindinput="onInput" bindfocus="onFocus" bindblur="onBlur" bindconfirm="onConfirm" bindlinechange="onLineChange" bind:keyboardheightchange="onKeyboardHeightChange"/><view wx:if="{{indicator && (maxcharacter > 0 || maxlength > 0 )}}" class="{{classPrefix}}__indicator {{prefix}}-class-indicator">{{count}} / {{maxcharacter || maxlength}}</view></view></view>

View File

@@ -1 +1,9 @@
@import '../common/style/index.wxss';.t-textarea{display:flex;flex-direction:column;box-sizing:border-box;padding:32rpx 32rpx;background-color:var(--td-textarea-background-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)))}.t-textarea__label:not(:empty){font-size:var(--td-font-size-base,28rpx);color:var(--td-textarea-label-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));flex-shrink:0;line-height:44rpx;padding-bottom:var(--td-spacer,16rpx);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.t-textarea__wrapper{display:flex;flex-direction:column;width:100%;flex:1 1 auto;overflow:hidden}.t-textarea__wrapper-inner{flex:1 1 auto;box-sizing:border-box;width:inherit;min-width:0;min-height:20px;margin:0;padding:0;text-align:left;background-color:transparent;border:0;resize:none;font-size:var(--td-font-size-m,32rpx);color:var(--td-textarea-text-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));line-height:48rpx}.t-textarea__placeholder{color:var(--td-textarea-placeholder-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));font-size:var(--td-font-size-m,32rpx)}.t-textarea__indicator:not(:empty){flex-shrink:0;color:var(--td-textarea-indicator-text-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));font-size:var(--td-spacer-1,24rpx);text-align:right;line-height:40rpx;padding-top:var(--td-spacer,16rpx)}.t-textarea--border{border-radius:var(--td-textarea-border-radius,var(--td-radius-default,12rpx));border:2rpx solid var(--td-textarea-border-color,var(--td-component-border,var(--td-gray-color-4,#dcdcdc)))}.t-textarea .t-is-disabled{color:var(--td-textarea-disabled-text-color,var(--td-text-color-disabled,var(--td-font-gray-4,rgba(0,0,0,.26))))}
@import '../common/style/index.wxss';.t-textarea{display:flex;flex-direction:column;box-sizing:border-box;padding:var(--td-textarea-padding,32rpx);background-color:var(--td-textarea-background-color,var(--td-bg-color-container,var(--td-font-white-1,#fff)));}
.t-textarea__label:not(:empty){font:var(--td-font-body-medium,28rpx / 44rpx var(--td-font-family,PingFang SC,Microsoft YaHei,Arial Regular));color:var(--td-textarea-label-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));flex-shrink:0;padding-bottom:var(--td-spacer,16rpx);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.t-textarea__wrapper{display:flex;flex-direction:column;width:100%;flex:1 1 auto;overflow:hidden;}
.t-textarea__wrapper-inner{flex:1 1 auto;box-sizing:border-box;width:inherit;min-width:0;min-height:20px;margin:0;padding:0;text-align:left;background-color:transparent;border:0;resize:none;font:var(--td-font-body-large,32rpx / 48rpx var(--td-font-family,PingFang SC,Microsoft YaHei,Arial Regular));color:var(--td-textarea-text-color,var(--td-text-color-primary,var(--td-font-gray-1,rgba(0,0,0,.9))));}
.t-textarea__placeholder{color:var(--td-textarea-placeholder-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));font:var(--td-font-body-medium,28rpx / 44rpx var(--td-font-family,PingFang SC,Microsoft YaHei,Arial Regular));}
.t-textarea__indicator:not(:empty){flex-shrink:0;color:var(--td-textarea-indicator-text-color,var(--td-text-color-placeholder,var(--td-font-gray-3,rgba(0,0,0,.4))));font:var(--td-font-body-small,24rpx / 40rpx var(--td-font-family,PingFang SC,Microsoft YaHei,Arial Regular));text-align:right;padding-top:var(--td-spacer,16rpx);}
.t-textarea--border{border-radius:var(--td-textarea-border-radius,var(--td-radius-default,12rpx));position:relative;}
.t-textarea--border::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;border:2rpx solid var(--td-textarea-border-color,var(--td-component-border,var(--td-gray-color-4,#dcdcdc)));border-radius:inherit;pointer-events:none;}
.t-textarea .t-is-disabled{color:var(--td-textarea-disabled-text-color,var(--td-text-color-disabled,var(--td-font-gray-4,rgba(0,0,0,.26))));}

View File

@@ -34,6 +34,10 @@ export interface TdTextareaProps {
type: NumberConstructor;
value?: number;
};
cursorColor?: {
type: StringConstructor;
value?: string;
};
cursorSpacing?: {
type: NumberConstructor;
value?: number;