@trionesdev/antd-taro-react 0.0.2-beta.0 → 0.0.2-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionSheet/ActionSheet.d.ts +25 -0
- package/dist/ActionSheet/ActionSheet.js +77 -0
- package/dist/ActionSheet/index.d.ts +1 -1
- package/dist/ActionSheet/index.js +1 -1
- package/dist/ActionSheet/style.scss +52 -0
- package/dist/Button/button.d.ts +2 -1
- package/dist/Button/style.scss +235 -231
- package/dist/Calendar/calendar-grid.js +1 -2
- package/dist/Calendar/calendar-range.js +1 -1
- package/dist/Calendar/calendar.js +5 -5
- package/dist/Calendar/style.scss +85 -85
- package/dist/Calendar/touchable-calendar-grid.js +9 -9
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +4 -4
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +42 -156
- package/dist/CalendarDatetimePicker/style.scss +24 -54
- package/dist/CalendarDatetimePicker/types.d.ts +0 -4
- package/dist/CalendarDatetimePicker/types.js +1 -6
- package/dist/CalendarDatetimePopup/CalendarDatetimePopup.d.ts +10 -0
- package/dist/CalendarDatetimePopup/CalendarDatetimePopup.js +163 -0
- package/dist/CalendarDatetimePopup/index.d.ts +3 -0
- package/dist/CalendarDatetimePopup/index.js +2 -0
- package/dist/CalendarDatetimePopup/style.scss +62 -0
- package/dist/CalendarDatetimePopup/types.d.ts +5 -0
- package/dist/CalendarDatetimePopup/types.js +6 -0
- package/dist/CalendarPopup/CalendarPopup.d.ts +4 -0
- package/dist/{CalendarPicker/calendar-picker.js → CalendarPopup/CalendarPopup.js} +6 -4
- package/dist/CalendarPopup/CalendarRangePopup.d.ts +4 -0
- package/dist/{CalendarPicker/calendar-range-picker.js → CalendarPopup/CalendarRangePopup.js} +5 -4
- package/dist/CalendarPopup/index.d.ts +8 -0
- package/dist/CalendarPopup/index.js +5 -0
- package/dist/CalendarPopup/style.scss +32 -0
- package/dist/{CalendarPicker → CalendarPopup}/types.d.ts +3 -2
- package/dist/CalendarPopup/types.js +1 -0
- package/dist/CascaderPicker/CascaderPicker.d.ts +25 -0
- package/dist/CascaderPicker/CascaderPicker.js +78 -0
- package/dist/CascaderPicker/index.d.ts +1 -1
- package/dist/CascaderPicker/index.js +1 -1
- package/dist/CascaderPicker/style.scss +24 -0
- package/dist/CascaderPopup/cascader-popup.d.ts +27 -0
- package/dist/CascaderPopup/cascader-popup.js +90 -0
- package/dist/CascaderPopup/index.d.ts +3 -0
- package/dist/CascaderPopup/index.js +2 -0
- package/dist/CascaderPopup/style.scss +45 -0
- package/dist/DatePicker/DatePicker.d.ts +15 -0
- package/dist/DatePicker/DatePicker.js +85 -0
- package/dist/DatePicker/DatePickerPopup.d.ts +18 -0
- package/dist/DatePicker/DatePickerPopup.js +329 -0
- package/dist/DatePicker/index.d.ts +3 -0
- package/dist/DatePicker/index.js +3 -0
- package/dist/DatePicker/style.scss +64 -0
- package/dist/DatePicker/types.d.ts +1 -0
- package/dist/Form/FormItem/form-item-input.d.ts +15 -0
- package/dist/Form/FormItem/form-item-input.js +39 -0
- package/dist/Form/FormItem/form-item-label.d.ts +13 -0
- package/dist/Form/FormItem/form-item-label.js +35 -0
- package/dist/Form/FormItem/form-item.d.ts +22 -0
- package/dist/Form/FormItem/form-item.js +73 -0
- package/dist/Form/FormItem/index.d.ts +5 -0
- package/dist/Form/FormItem/index.js +3 -0
- package/dist/Form/index.d.ts +8 -1
- package/dist/Form/index.js +5 -1
- package/dist/Form/style.scss +78 -0
- package/dist/ImagesPreview/ImagesPreview.js +4 -3
- package/dist/ImagesPreview/style.scss +34 -34
- package/dist/ImagesWall/ImagesWall.js +4 -4
- package/dist/ImagesWall/style.scss +70 -70
- package/dist/Input/index.d.ts +17 -2
- package/dist/Input/index.js +13 -1
- package/dist/Input/index.scss +267 -0
- package/dist/Input/input-affix-wrapper.d.ts +13 -0
- package/dist/Input/input-affix-wrapper.js +37 -0
- package/dist/Input/input-digit.d.ts +7 -0
- package/dist/Input/input-digit.js +53 -0
- package/dist/Input/input-number.d.ts +7 -0
- package/dist/Input/input-number.js +50 -0
- package/dist/Input/input-opt.d.ts +16 -0
- package/dist/Input/input-opt.js +87 -0
- package/dist/Input/input-password.d.ts +8 -0
- package/dist/Input/input-password.js +49 -0
- package/dist/Input/input.d.ts +3 -0
- package/dist/Input/input.js +7 -0
- package/dist/Input/taro-input.d.ts +8 -0
- package/dist/Input/taro-input.js +54 -0
- package/dist/Input/textarea.d.ts +15 -0
- package/dist/Input/textarea.js +52 -0
- package/dist/Input/types.d.ts +19 -0
- package/dist/Input/types.js +2 -0
- package/dist/Overlay/Overlay.d.ts +17 -0
- package/dist/Overlay/Overlay.js +100 -0
- package/dist/Overlay/index.d.ts +4 -0
- package/dist/Overlay/index.js +3 -0
- package/dist/Overlay/style.scss +20 -0
- package/dist/Picker/Picker.d.ts +19 -0
- package/dist/Picker/Picker.js +75 -0
- package/dist/Picker/index.d.ts +1 -1
- package/dist/Picker/index.js +1 -1
- package/dist/Picker/style.scss +41 -0
- package/dist/PickerView/PickerView.d.ts +4 -0
- package/dist/PickerView/PickerView.js +71 -0
- package/dist/PickerView/index.d.ts +2 -2
- package/dist/PickerView/index.js +1 -1
- package/dist/PickerView/style.scss +13 -0
- package/dist/PickerView/types.d.ts +15 -0
- package/dist/PickerView/types.js +1 -0
- package/dist/Popup/Popup.d.ts +48 -0
- package/dist/Popup/Popup.js +135 -0
- package/dist/Popup/index.d.ts +2 -1
- package/dist/Popup/index.js +2 -1
- package/dist/Popup/style.scss +124 -0
- package/dist/Progress/index.d.ts +1 -1
- package/dist/Progress/index.js +1 -1
- package/dist/SideBar/side-bar.js +9 -8
- package/dist/SideBar/style.scss +85 -85
- package/dist/Toast/Toast.d.ts +18 -0
- package/dist/Toast/Toast.js +112 -0
- package/dist/Toast/index.d.ts +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/Toast/style.scss +63 -0
- package/dist/VerificationCodeInput/index.d.ts +2 -2
- package/dist/VerificationCodeInput/index.js +1 -1
- package/dist/VerificationCodeInput/style.scss +20 -0
- package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
- package/dist/VerificationCodeInput/verification-code-input.js +99 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.js +5 -2
- package/dist/style/variable.scss +20 -0
- package/dist/types.d.ts +0 -1
- package/package.json +26 -26
- package/readme.md +23 -23
- package/dist/CalendarPicker/calendar-picker.d.ts +0 -4
- package/dist/CalendarPicker/calendar-range-picker.d.ts +0 -4
- package/dist/CalendarPicker/index.d.ts +0 -9
- package/dist/CalendarPicker/index.js +0 -5
- package/dist/CalendarPicker/style.scss +0 -31
- package/dist/Mask/index.d.ts +0 -3
- package/dist/Mask/index.js +0 -2
- package/dist/Progress/Progress.d.ts +0 -38
- package/dist/Progress/Progress.js +0 -53
- package/dist/Progress/ProgressCircle.d.ts +0 -16
- package/dist/Progress/ProgressCircle.js +0 -147
- package/dist/Progress/ProgressLine.d.ts +0 -15
- package/dist/Progress/ProgressLine.js +0 -87
- package/dist/Progress/style.scss +0 -33
- package/dist/Progress/types.d.ts +0 -4
- package/dist/Progress/types.js +0 -2
- /package/dist/{CalendarDatetimePicker → CalendarDatetimePopup}/DateTimeSwitch.d.ts +0 -0
- /package/dist/{CalendarDatetimePicker → CalendarDatetimePopup}/DateTimeSwitch.js +0 -0
- /package/dist/{CalendarPicker → DatePicker}/types.js +0 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
@use "../style/variable" as variable;
|
|
2
|
+
|
|
3
|
+
$inputCls: 'triones-antm-input';
|
|
4
|
+
$inputAffixWrapperCls: 'triones-antm-input-affix-wrapper';
|
|
5
|
+
$inputGroupWrapperCls: 'triones-antm-input-group-wrapper';
|
|
6
|
+
$inputPotCls: 'triones-antm-pot';
|
|
7
|
+
|
|
8
|
+
$inputSm: 24Px;
|
|
9
|
+
$inputMd: 32Px;
|
|
10
|
+
$inputLg: 40Px;
|
|
11
|
+
|
|
12
|
+
$placeholderColor: variable.$trionesColorTextPlaceholder;
|
|
13
|
+
|
|
14
|
+
input {
|
|
15
|
+
height: auto;
|
|
16
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
&::placeholder {
|
|
20
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
21
|
+
color: $placeholderColor
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
wx-input {
|
|
26
|
+
&::placeholder {
|
|
27
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
28
|
+
color: $placeholderColor
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.#{$inputCls} {
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
display: inline-block;
|
|
35
|
+
position: relative;
|
|
36
|
+
width: 100%;
|
|
37
|
+
min-width: 0;
|
|
38
|
+
transition: all .2s;
|
|
39
|
+
outline: none;
|
|
40
|
+
box-shadow: none;
|
|
41
|
+
border: none;
|
|
42
|
+
border-radius: variable.$trionesBorderRadius;
|
|
43
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
44
|
+
padding: variable.$trionesInputPaddingBlock 0;
|
|
45
|
+
|
|
46
|
+
&-sm {
|
|
47
|
+
max-height: $inputSm;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-lg {
|
|
51
|
+
max-height: $inputLg;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&::placeholder {
|
|
55
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
56
|
+
color: $placeholderColor
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.weui-input {
|
|
60
|
+
&::placeholder {
|
|
61
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
62
|
+
color: $placeholderColor
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
.#{$inputAffixWrapperCls} {
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
position: relative;
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
width: 100%;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
flex-shrink: 1;
|
|
76
|
+
//line-height: variable.$trionesLineHeight;
|
|
77
|
+
padding: variable.$trionesInputPaddingBlock 0;
|
|
78
|
+
gap: 4Px;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
.#{$inputCls} {
|
|
83
|
+
padding: 0;
|
|
84
|
+
background-color: transparent;
|
|
85
|
+
height: 100%;
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
&-prifix {}
|
|
89
|
+
|
|
90
|
+
&-suffix {
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
vertical-align: middle;
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
row-gap: 4Px;
|
|
96
|
+
// padding-inline: 4Px;
|
|
97
|
+
line-height: normal;
|
|
98
|
+
|
|
99
|
+
.clear-icon {
|
|
100
|
+
color: rgba(0, 0, 0, 0.25);
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
&:hover {
|
|
104
|
+
color: rgba(0, 0, 0, 0.45);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.triones-antm-icon {
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
padding-inline: 4Px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
taro-input-core {
|
|
116
|
+
&::placeholder {
|
|
117
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
118
|
+
color: $placeholderColor
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
.weui-input {
|
|
123
|
+
&::placeholder {
|
|
124
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
125
|
+
color: $placeholderColor
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
.triones-antm-icon {
|
|
132
|
+
font-size: 14Px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.#{$inputCls} {
|
|
138
|
+
&-outlined {
|
|
139
|
+
border-radius: variable.$trionesBorderRadius;
|
|
140
|
+
border: 1Px solid variable.$trionesBorderColor;
|
|
141
|
+
padding-inline: 4Px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&-filled {
|
|
145
|
+
border-radius: variable.$trionesBorderRadius;
|
|
146
|
+
background-color: variable.$trionesColorFillTertiary;
|
|
147
|
+
padding-inline: 4Px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&-underlined {
|
|
151
|
+
border-bottom: 1Px solid variable.$trionesBorderColor;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.#{$inputGroupWrapperCls} {}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
.#{$inputPotCls} {
|
|
159
|
+
position: relative;
|
|
160
|
+
display: inline-flex;
|
|
161
|
+
vertical-align: middle;
|
|
162
|
+
|
|
163
|
+
&-wrapper {
|
|
164
|
+
position: relative;
|
|
165
|
+
display: inline-flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
flex-wrap: nowrap;
|
|
168
|
+
column-gap: 8Px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&-input {
|
|
172
|
+
position: absolute;
|
|
173
|
+
background-color: transparent;
|
|
174
|
+
z-index: -1;
|
|
175
|
+
left: 0;
|
|
176
|
+
top: 0;
|
|
177
|
+
right: 0;
|
|
178
|
+
bottom: 0;
|
|
179
|
+
opacity: 0;
|
|
180
|
+
-moz-appearance: textfield;
|
|
181
|
+
|
|
182
|
+
&::-webkit-outer-spin-button,
|
|
183
|
+
&::-webkit-inner-spin-button {
|
|
184
|
+
-webkit-appearance: none;
|
|
185
|
+
margin: 0;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&-item {
|
|
190
|
+
text-align: center;
|
|
191
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
192
|
+
height: 32Px;
|
|
193
|
+
width: 32Px;
|
|
194
|
+
display: inline-flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
justify-content: center;
|
|
197
|
+
|
|
198
|
+
&-sm {
|
|
199
|
+
width: $inputSm;
|
|
200
|
+
height: $inputSm;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&-lg {
|
|
204
|
+
width: $inputLg;
|
|
205
|
+
height: $inputLg;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&::placeholder {
|
|
209
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
210
|
+
color: $placeholderColor
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&-focus {
|
|
214
|
+
&::after {
|
|
215
|
+
content: ' ';
|
|
216
|
+
height: 100%;
|
|
217
|
+
width: 0.5Px;
|
|
218
|
+
background-color: #0a0a0a;
|
|
219
|
+
transition: transform 0.1s ease;
|
|
220
|
+
animation: blink 1s step-end infinite;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.#{$inputCls}-outlined {
|
|
227
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
228
|
+
color: rgba(0, 0, 0, 0.88);
|
|
229
|
+
background: #ffffff;
|
|
230
|
+
border-width: 1Px;
|
|
231
|
+
border-style: solid;
|
|
232
|
+
border-color: #d9d9d9;
|
|
233
|
+
-webkit-appearance: none;
|
|
234
|
+
-moz-appearance: none;
|
|
235
|
+
appearance: none;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
.#{$inputCls}-textarea {
|
|
241
|
+
box-sizing: border-box;
|
|
242
|
+
width: 100%;
|
|
243
|
+
outline: 0;
|
|
244
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
245
|
+
|
|
246
|
+
taro-textarea-core {
|
|
247
|
+
width: 100%;
|
|
248
|
+
}
|
|
249
|
+
.taro-textarea{
|
|
250
|
+
background-color: transparent;
|
|
251
|
+
}
|
|
252
|
+
textarea {
|
|
253
|
+
padding: variable.$trionesInputPaddingBlock 0;
|
|
254
|
+
background-color: transparent;
|
|
255
|
+
&::placeholder {
|
|
256
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
257
|
+
color: $placeholderColor
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@keyframes blink {
|
|
264
|
+
50% {
|
|
265
|
+
background-color: transparent;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { variantType } from "./types";
|
|
3
|
+
export type InputAffixWrapperProps = {
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
className?: string;
|
|
6
|
+
prefix?: React.ReactNode;
|
|
7
|
+
suffix?: React.ReactNode;
|
|
8
|
+
variant?: variantType;
|
|
9
|
+
allowClear?: boolean;
|
|
10
|
+
value?: any;
|
|
11
|
+
onClear?: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const InputAffixWrapper: FC<PropsWithChildren<InputAffixWrapperProps>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["children", "style", "className", "prefix", "suffix", "variant", "allowClear", "value", "onClear"];
|
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { inputAffixWrapperCls, inputCls } from "./types";
|
|
11
|
+
import { CloseCircleFill } from '@trionesdev/antd-mobile-icons-react';
|
|
12
|
+
export var InputAffixWrapper = function InputAffixWrapper(_ref) {
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
style = _ref.style,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
prefix = _ref.prefix,
|
|
17
|
+
suffix = _ref.suffix,
|
|
18
|
+
variant = _ref.variant,
|
|
19
|
+
allowClear = _ref.allowClear,
|
|
20
|
+
value = _ref.value,
|
|
21
|
+
onClear = _ref.onClear,
|
|
22
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
var innerStyle = style || {};
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: classNames([inputAffixWrapperCls, _defineProperty({}, "".concat(inputCls, "-").concat(variant), variant)]),
|
|
26
|
+
style: innerStyle
|
|
27
|
+
}, prefix && /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: classNames(["".concat(inputCls, "-prefix")])
|
|
29
|
+
}, prefix), children, (suffix || allowClear) && /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: classNames(["".concat(inputCls, "-suffix")])
|
|
31
|
+
}, allowClear && value && /*#__PURE__*/React.createElement(CloseCircleFill, {
|
|
32
|
+
className: "clear-icon",
|
|
33
|
+
onClick: function onClick() {
|
|
34
|
+
onClear === null || onClear === void 0 || onClear();
|
|
35
|
+
}
|
|
36
|
+
}), suffix));
|
|
37
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var _excluded = ["min", "max"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
import React, { useEffect } from "react";
|
|
12
|
+
import { TaroInput } from "./taro-input";
|
|
13
|
+
export var InputDigit = function InputDigit(_ref) {
|
|
14
|
+
var min = _ref.min,
|
|
15
|
+
max = _ref.max,
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
var _React$useState = React.useState(rest.value),
|
|
18
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
19
|
+
internalValue = _React$useState2[0],
|
|
20
|
+
setInternalValue = _React$useState2[1];
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
if (rest.value === undefined) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (rest.value === internalValue) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
setInternalValue(rest.value);
|
|
29
|
+
}, [rest.value]);
|
|
30
|
+
return /*#__PURE__*/React.createElement(TaroInput, _extends({}, rest, {
|
|
31
|
+
type: "digit",
|
|
32
|
+
value: internalValue,
|
|
33
|
+
onChange: function onChange(value) {
|
|
34
|
+
var _rest$onChange;
|
|
35
|
+
var newValue = value;
|
|
36
|
+
if (newValue !== '') {
|
|
37
|
+
newValue = Number(value);
|
|
38
|
+
}
|
|
39
|
+
if (isNaN(newValue)) {
|
|
40
|
+
newValue = undefined;
|
|
41
|
+
} else {
|
|
42
|
+
if (min != undefined && newValue < min) {
|
|
43
|
+
newValue = min;
|
|
44
|
+
}
|
|
45
|
+
if (max != undefined && newValue > max) {
|
|
46
|
+
newValue = max;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
setInternalValue(newValue);
|
|
50
|
+
(_rest$onChange = rest.onChange) === null || _rest$onChange === void 0 || _rest$onChange.call(rest, newValue);
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var _excluded = ["min", "max"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
import React, { useEffect } from "react";
|
|
12
|
+
import { TaroInput } from "./taro-input";
|
|
13
|
+
export var InputNumber = function InputNumber(_ref) {
|
|
14
|
+
var min = _ref.min,
|
|
15
|
+
max = _ref.max,
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
var _React$useState = React.useState(rest.value),
|
|
18
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
19
|
+
internalValue = _React$useState2[0],
|
|
20
|
+
setInternalValue = _React$useState2[1];
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
if (rest.value === internalValue) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
setInternalValue(rest.value);
|
|
26
|
+
}, [rest.value]);
|
|
27
|
+
return /*#__PURE__*/React.createElement(TaroInput, _extends({}, rest, {
|
|
28
|
+
type: "number",
|
|
29
|
+
value: internalValue,
|
|
30
|
+
onChange: function onChange(value) {
|
|
31
|
+
var _rest$onChange;
|
|
32
|
+
var newValue = value;
|
|
33
|
+
if (newValue !== '') {
|
|
34
|
+
newValue = Number(value);
|
|
35
|
+
}
|
|
36
|
+
if (isNaN(newValue)) {
|
|
37
|
+
newValue = undefined;
|
|
38
|
+
} else {
|
|
39
|
+
if (min != undefined && newValue < min) {
|
|
40
|
+
newValue = min;
|
|
41
|
+
}
|
|
42
|
+
if (max != undefined && newValue > max) {
|
|
43
|
+
newValue = max;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
setInternalValue(newValue);
|
|
47
|
+
(_rest$onChange = rest.onChange) === null || _rest$onChange === void 0 || _rest$onChange.call(rest, newValue);
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export type InputOPTProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
length?: number;
|
|
7
|
+
value?: string;
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
};
|
|
10
|
+
export type InputOPTItemProps = {
|
|
11
|
+
index: number;
|
|
12
|
+
focusIndex?: number;
|
|
13
|
+
value?: string;
|
|
14
|
+
onFocus?: (index: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const InputOPT: FC<InputOPTProps>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
9
|
+
import "./index.scss";
|
|
10
|
+
var cls = 'triones-antm-pot';
|
|
11
|
+
var inputCls = 'triones-antm-input';
|
|
12
|
+
var InputOPTItem = function InputOPTItem(_ref) {
|
|
13
|
+
var index = _ref.index,
|
|
14
|
+
focusIndex = _ref.focusIndex,
|
|
15
|
+
value = _ref.value,
|
|
16
|
+
onFocus = _ref.onFocus;
|
|
17
|
+
var ref = React.useRef(null);
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
ref: ref,
|
|
20
|
+
className: classNames("".concat(inputCls), "".concat(cls, "-item"), "".concat(inputCls, "-outlined")),
|
|
21
|
+
onClick: function onClick() {
|
|
22
|
+
onFocus === null || onFocus === void 0 || onFocus(index);
|
|
23
|
+
}
|
|
24
|
+
}, value);
|
|
25
|
+
};
|
|
26
|
+
export var InputOPT = function InputOPT(_ref2) {
|
|
27
|
+
var className = _ref2.className,
|
|
28
|
+
style = _ref2.style,
|
|
29
|
+
_ref2$length = _ref2.length,
|
|
30
|
+
length = _ref2$length === void 0 ? 6 : _ref2$length,
|
|
31
|
+
value = _ref2.value,
|
|
32
|
+
_onChange = _ref2.onChange;
|
|
33
|
+
var inputRef = useRef();
|
|
34
|
+
var _useState = useState(value || ''),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
inputValue = _useState2[0],
|
|
37
|
+
setInputValue = _useState2[1];
|
|
38
|
+
var _React$useState = React.useState(Array.from({
|
|
39
|
+
length: length
|
|
40
|
+
}).map(function () {
|
|
41
|
+
return '';
|
|
42
|
+
})),
|
|
43
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
44
|
+
optValue = _React$useState2[0],
|
|
45
|
+
setOptValue = _React$useState2[1];
|
|
46
|
+
var _useState3 = useState(0),
|
|
47
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
48
|
+
focusIndex = _useState4[0],
|
|
49
|
+
setFocusIndex = _useState4[1];
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
setOptValue(Array.from(inputValue !== null && inputValue !== void 0 ? inputValue : ''));
|
|
52
|
+
}, [inputValue]);
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: classNames(cls, className),
|
|
55
|
+
style: style
|
|
56
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: classNames("".concat(cls, "-wrapper")),
|
|
58
|
+
onClick: function onClick() {
|
|
59
|
+
var _inputRef$current;
|
|
60
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
61
|
+
}
|
|
62
|
+
}, Array.from({
|
|
63
|
+
length: length
|
|
64
|
+
}).map(function (_, index) {
|
|
65
|
+
return /*#__PURE__*/React.createElement(InputOPTItem, {
|
|
66
|
+
key: index,
|
|
67
|
+
index: index,
|
|
68
|
+
focusIndex: focusIndex,
|
|
69
|
+
value: (optValue === null || optValue === void 0 ? void 0 : optValue[index]) || '',
|
|
70
|
+
onFocus: function onFocus(index) {
|
|
71
|
+
setFocusIndex(index);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
})), /*#__PURE__*/React.createElement("input", {
|
|
75
|
+
ref: inputRef,
|
|
76
|
+
className: "".concat(cls, "-input"),
|
|
77
|
+
type: "number",
|
|
78
|
+
value: inputValue,
|
|
79
|
+
onChange: function onChange(e) {
|
|
80
|
+
if (e.target.value.length > length) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
setInputValue(e.target.value);
|
|
84
|
+
_onChange === null || _onChange === void 0 || _onChange(e.target.value);
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { TaroInputProps } from "./taro-input";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export type InputPasswordProps = Omit<TaroInputProps, 'type'> & {
|
|
5
|
+
iconRender?: (visible: boolean) => React.ReactNode;
|
|
6
|
+
visibilityToggle?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const InputPassword: FC<InputPasswordProps>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var _excluded = ["iconRender", "visibilityToggle", "suffix"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import { TaroInput } from "./taro-input";
|
|
13
|
+
import { EyeInvisibleOutline, EyeOutline } from "@trionesdev/antd-mobile-icons-react";
|
|
14
|
+
import React from "react";
|
|
15
|
+
export var InputPassword = function InputPassword(_ref) {
|
|
16
|
+
var iconRender = _ref.iconRender,
|
|
17
|
+
_ref$visibilityToggle = _ref.visibilityToggle,
|
|
18
|
+
visibilityToggle = _ref$visibilityToggle === void 0 ? true : _ref$visibilityToggle,
|
|
19
|
+
suffix = _ref.suffix,
|
|
20
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var _useState = useState(false),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
visible = _useState2[0],
|
|
24
|
+
setVisible = _useState2[1];
|
|
25
|
+
var toggleRender = function toggleRender() {
|
|
26
|
+
if (iconRender) {
|
|
27
|
+
return iconRender(visible);
|
|
28
|
+
} else {
|
|
29
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, visible ? /*#__PURE__*/React.createElement(EyeOutline, {
|
|
30
|
+
onClick: function onClick() {
|
|
31
|
+
return setVisible(false);
|
|
32
|
+
}
|
|
33
|
+
}) : /*#__PURE__*/React.createElement(EyeInvisibleOutline, {
|
|
34
|
+
onClick: function onClick() {
|
|
35
|
+
return setVisible(true);
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return /*#__PURE__*/React.createElement(TaroInput, _extends({}, rest, {
|
|
41
|
+
password: visible ? false : true,
|
|
42
|
+
suffix: /*#__PURE__*/React.createElement(React.Fragment, null, ' ', visibilityToggle && /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
style: {
|
|
44
|
+
paddingLeft: 4,
|
|
45
|
+
paddingRight: 4
|
|
46
|
+
}
|
|
47
|
+
}, toggleRender()), " ", suffix, ' ')
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
2
|
+
import { TaroInput } from "./taro-input";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export var Input = function Input(_ref) {
|
|
5
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
6
|
+
return /*#__PURE__*/React.createElement(TaroInput, rest);
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InputProps as InternalTaroInputProps } from '@tarojs/components';
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
import { InputProps } from "./types";
|
|
4
|
+
export type TaroInputProps = Omit<InputProps, 'type'> & {
|
|
5
|
+
type?: keyof InternalTaroInputProps.Type;
|
|
6
|
+
password?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const TaroInput: FC<TaroInputProps>;
|