-
Notifications
You must be signed in to change notification settings - Fork 266
/
input.wxml
71 lines (70 loc) · 2.98 KB
/
input.wxml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<view
class="{{classPrefix}} {{!!errorMessage ? classBasePrefix + '-is-error' : ''}} {{classPrefix}}--size-{{size}} {{classPrefix + (borderless ? '' : '--bordered')}} {{prefix}}-class"
>
<view wx:if="{{prefixIcon}}" class="{{classPrefix + '__icon-wrap'}}">
<slot name="prefixIcon" wx:if="{{prefixIcon === 'slot'}}" />
<t-icon wx:else class="{{classPrefix + '__icon--prefix'}}" name="{{prefixIcon}}" />
</view>
<view wx:if="{{label}}" class="{{classPrefix + '__name'}}">
<slot name="label" wx:if="{{label === 'slot'}}" />
<text wx:else>{{label}}</text>
</view>
<view class="{{classPrefix}}__wrap">
<view class="{{classPrefix}}__content">
<input
maxlength="{{maxlength || maxchars || -1}}"
disabled="{{disabled}}"
placeholder="{{placeholder}}"
placeholderStyle="{{placeholderStyle}}"
placeholder-class="{{classPrefix}}__placeholder t-class-placeholder {{placeholderClass}}"
value="{{value}}"
bindinput="onInput"
bindfocus="onFocus"
bindblur="onBlur"
bindconfirm="onConfirm"
bind:keyboardheightchange="onKeyboardHeightChange"
password="{{type === 'password'}}"
type="{{type === 'password' ? 'text' : type}}"
focus="{{focus}}"
confirm-type="{{confirmType}}"
confirm-hold="{{confirmHold}}"
cursor="{{cursor}}"
cursor-spacing="{{cursorSpacing}}"
adjust-position="{{adjustPosition}}"
auto-focus="{{autoFocus}}"
always-embed="{{alwaysEmbed}}"
selection-start="{{selectionStart}}"
selection-end="{{selectionEnd}}"
hold-keyboard="{{holdKeyboard}}"
safe-password-cert-path="{{safePasswordCertPath}}"
safe-password-length="{{safePasswordLength}}"
safe-password-time-stamp="{{safePasswordTimeStamp}}"
safe-password-nonce="{{safePasswordNonce}}"
safe-password-salt="{{safePasswordSalt}}"
safe-password-custom-hash="{{safePasswordCustomHash}}"
class="{{classPrefix}}__control {{suffix || align ==='right' ? classPrefix + '__control--right':''}} {{align === 'center' ? classPrefix + '__control--center':''}} {{prefix}}-class-input"
/>
<view
wx:if="{{ clearable && (value.length > 0 || characterLength > 0)}}"
class="{{classPrefix}}__wrap--icon"
bind:tap="clearInput"
>
<t-icon name="close-circle-filled" customStyle="font-size: 39rpx" />
</view>
<view class="{{classPrefix}}__wrap--suffix">
<slot name="suffix" />
</view>
<view wx:if="{{suffix}}" class="{{classPrefix}}__wrap--suffix-text">
<text>{{suffix}}</text>
</view>
<view wx:if="{{suffixIcon}}" class="{{classPrefix}}__wrap--icon">
<t-icon name="{{suffixIcon}}" customStyle="font-size: 39rpx" />
</view>
</view>
<view
wx:if="{{errorMessage && errorMessage.length > 0}}"
class="{{classPrefix}}__error-msg {{prefix}}-class-error-msg"
>{{errorMessage}}
</view>
</view>
</view>