@trionesdev/antd-taro-react 0.0.2-beta.2 → 0.0.2-beta.21
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/button.js +2 -3
- package/dist/Button/style.scss +65 -50
- package/dist/Calendar/calendar-grid.d.ts +10 -9
- package/dist/Calendar/calendar-grid.js +37 -62
- package/dist/Calendar/calendar-header.d.ts +3 -2
- package/dist/Calendar/calendar-header.js +9 -6
- package/dist/Calendar/calendar-range.d.ts +4 -3
- package/dist/Calendar/calendar-range.js +22 -18
- package/dist/Calendar/calendar.d.ts +5 -4
- package/dist/Calendar/calendar.js +30 -17
- package/dist/Calendar/style.scss +8 -5
- package/dist/Calendar/touchable-calendar-grid.d.ts +6 -5
- package/dist/Calendar/touchable-calendar-grid.js +87 -86
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +3 -2
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +40 -57
- package/dist/CalendarDatetimePicker/DateTimeSwitch.d.ts +3 -2
- package/dist/CalendarDatetimePicker/DateTimeSwitch.js +2 -2
- package/dist/CalendarDatetimePicker/style.scss +11 -3
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +9 -0
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +60 -0
- package/dist/CalendarDatetimePickerCell/index.d.ts +3 -0
- package/dist/CalendarDatetimePickerCell/index.js +2 -0
- package/dist/CalendarPicker/{calendar-picker.js → CalendarPicker.js} +10 -6
- package/dist/CalendarPicker/{calendar-range-picker.js → CalendarRangePicker.js} +8 -6
- package/dist/CalendarPicker/index.d.ts +3 -4
- package/dist/CalendarPicker/index.js +2 -2
- package/dist/CalendarPicker/style.scss +7 -6
- package/dist/CalendarPicker/types.d.ts +8 -6
- package/dist/CalendarPicker/types.js +1 -1
- package/dist/CalendarPickerCell/CalendarPickerCell.d.ts +11 -0
- package/dist/CalendarPickerCell/CalendarPickerCell.js +54 -0
- package/dist/CalendarPickerCell/CalendarRangePickerCell.d.ts +11 -0
- package/dist/CalendarPickerCell/CalendarRangePickerCell.js +56 -0
- package/dist/CalendarPickerCell/index.d.ts +8 -0
- package/dist/CalendarPickerCell/index.js +5 -0
- package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
- package/dist/CascaderPicker/cascader-picker.js +90 -0
- package/dist/CascaderPicker/index.d.ts +1 -1
- package/dist/CascaderPicker/index.js +1 -1
- package/dist/CascaderPicker/style.scss +45 -0
- package/dist/CascaderPickerCell/CascaderPickerCell.d.ts +20 -0
- package/dist/CascaderPickerCell/CascaderPickerCell.js +70 -0
- package/dist/CascaderPickerCell/index.d.ts +3 -0
- package/dist/CascaderPickerCell/index.js +2 -0
- package/dist/DatePicker/DatePicker.d.ts +18 -0
- package/dist/DatePicker/DatePicker.js +310 -0
- package/dist/DatePicker/index.d.ts +4 -0
- package/dist/DatePicker/index.js +3 -0
- package/dist/DatePicker/style.scss +41 -0
- package/dist/DatePicker/types.d.ts +1 -0
- package/dist/DatePicker/types.js +1 -0
- package/dist/DatePickerCell/DatePickerCell.d.ts +16 -0
- package/dist/DatePickerCell/DatePickerCell.js +78 -0
- package/dist/DatePickerCell/index.d.ts +3 -0
- package/dist/DatePickerCell/index.js +2 -0
- package/dist/FetchPicker/FetchPicker.d.ts +78 -0
- package/dist/FetchPicker/FetchPicker.js +310 -0
- package/dist/FetchPicker/index.d.ts +4 -0
- package/dist/FetchPicker/index.js +3 -0
- package/dist/FetchPicker/styles.scss +130 -0
- package/dist/FloatButton/FloatButton.d.ts +19 -0
- package/dist/FloatButton/FloatButton.js +60 -0
- package/dist/FloatButton/FloatButtonGroup.d.ts +21 -0
- package/dist/FloatButton/FloatButtonGroup.js +141 -0
- package/dist/FloatButton/context.d.ts +10 -0
- package/dist/FloatButton/context.js +2 -0
- package/dist/FloatButton/index.d.ts +10 -0
- package/dist/FloatButton/index.js +5 -0
- package/dist/FloatButton/style.scss +126 -0
- package/dist/Form/FormItem/form-item-content.d.ts +17 -0
- package/dist/Form/FormItem/form-item-content.js +39 -0
- package/dist/Form/FormItem/form-item-label.d.ts +13 -0
- package/dist/Form/FormItem/form-item-label.js +29 -0
- package/dist/Form/FormItem/form-item.d.ts +23 -0
- package/dist/Form/FormItem/form-item.js +77 -0
- package/dist/Form/FormItem/index.d.ts +5 -0
- package/dist/Form/FormItem/index.js +3 -0
- package/dist/Form/index.d.ts +9 -2
- package/dist/Form/index.js +5 -1
- package/dist/Form/style.scss +100 -0
- package/dist/FormCell/index.d.ts +3 -0
- package/dist/FormCell/index.js +2 -0
- package/dist/ImagesPreview/ImagesPreview.js +4 -3
- package/dist/ImagesWall/ImagesWall.js +1 -1
- package/dist/Input/index.d.ts +17 -2
- package/dist/Input/index.js +13 -1
- package/dist/Input/index.scss +282 -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 +70 -0
- package/dist/Input/textarea.d.ts +15 -0
- package/dist/Input/textarea.js +52 -0
- package/dist/Input/types.d.ts +20 -0
- package/dist/Input/types.js +2 -0
- package/dist/Loading/index.d.ts +4 -0
- package/dist/Loading/index.js +3 -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 +27 -0
- package/dist/Picker/Picker.js +100 -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 +126 -0
- package/dist/Progress/index.d.ts +1 -1
- package/dist/Progress/index.js +1 -1
- package/dist/Segmented/index.d.ts +3 -0
- package/dist/Segmented/index.js +2 -0
- package/dist/SideBar/side-bar.js +3 -2
- package/dist/SideBar/style.scss +6 -6
- package/dist/Stepper/index.d.ts +3 -0
- package/dist/Stepper/index.js +2 -0
- 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 +28 -7
- package/dist/index.js +12 -2
- package/dist/style/variable.scss +33 -0
- package/dist/types.d.ts +0 -1
- package/dist/utils/dayjs.d.ts +4 -0
- package/dist/utils/dayjs.js +42 -0
- package/package.json +25 -30
- 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/SpinLoading/index.d.ts +0 -3
- package/dist/SpinLoading/index.js +0 -2
- /package/dist/CalendarPicker/{calendar-picker.d.ts → CalendarPicker.d.ts} +0 -0
- /package/dist/CalendarPicker/{calendar-range-picker.d.ts → CalendarRangePicker.d.ts} +0 -0
|
@@ -5,11 +5,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useEffect } from "react";
|
|
8
|
-
import Mask from "../Mask";
|
|
9
8
|
import classNames from "classnames";
|
|
10
9
|
import "./style.scss";
|
|
11
10
|
import Swiper from "../Swiper";
|
|
12
11
|
import Image from "../Image";
|
|
12
|
+
import Overlay from "../Overlay";
|
|
13
13
|
var cls = 'triones-antm-image-preview';
|
|
14
14
|
export var ImagesPreview = function ImagesPreview(_ref) {
|
|
15
15
|
var className = _ref.className,
|
|
@@ -46,7 +46,7 @@ export var ImagesPreview = function ImagesPreview(_ref) {
|
|
|
46
46
|
}
|
|
47
47
|
setInnerActiveIndex(activeIndex);
|
|
48
48
|
}, [activeIndex]);
|
|
49
|
-
return /*#__PURE__*/React.createElement(
|
|
49
|
+
return /*#__PURE__*/React.createElement(Overlay, {
|
|
50
50
|
open: innerOpen
|
|
51
51
|
}, /*#__PURE__*/React.createElement("div", {
|
|
52
52
|
className: classNames(cls, className),
|
|
@@ -62,8 +62,9 @@ export var ImagesPreview = function ImagesPreview(_ref) {
|
|
|
62
62
|
width: '100%',
|
|
63
63
|
height: '100%'
|
|
64
64
|
}
|
|
65
|
-
}, items === null || items === void 0 ? void 0 : items.map(function (item) {
|
|
65
|
+
}, items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
66
66
|
return /*#__PURE__*/React.createElement(Swiper.Item, {
|
|
67
|
+
key: index,
|
|
67
68
|
style: {
|
|
68
69
|
width: '100%',
|
|
69
70
|
height: '100%',
|
|
@@ -82,7 +82,7 @@ export var ImagesWall = function ImagesWall(_ref2) {
|
|
|
82
82
|
}
|
|
83
83
|
setImages(newImages || []);
|
|
84
84
|
}, [value]);
|
|
85
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ImagesPreview, {
|
|
85
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, preview && /*#__PURE__*/React.createElement(ImagesPreview, {
|
|
86
86
|
open: imagePreviewOpen,
|
|
87
87
|
afterOpenChange: setImagePreviewOpen,
|
|
88
88
|
items: images.map(function (item) {
|
package/dist/Input/index.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
import { Input
|
|
2
|
-
|
|
1
|
+
import { Input as InternalInput } from "./input";
|
|
2
|
+
import { InputDigit, InputDigitProps } from "./input-digit";
|
|
3
|
+
import { InputNumber, InputNumberProps } from "./input-number";
|
|
4
|
+
import { InputPassword, InputPasswordProps } from "./input-password";
|
|
5
|
+
import { Textarea, InputTextareaProps } from "./textarea";
|
|
6
|
+
import "./index.scss";
|
|
7
|
+
import { InputOPT, InputOPTProps } from "./input-opt";
|
|
8
|
+
import { InputProps } from "./types";
|
|
9
|
+
type CompoundedComponent = typeof InternalInput & {
|
|
10
|
+
Password: typeof InputPassword;
|
|
11
|
+
OPT: typeof InputOPT;
|
|
12
|
+
Digit: typeof InputDigit;
|
|
13
|
+
Number: typeof InputNumber;
|
|
14
|
+
Textarea: typeof Textarea;
|
|
15
|
+
};
|
|
16
|
+
declare const Input: CompoundedComponent;
|
|
17
|
+
export type { InputOPTProps, InputPasswordProps, InputProps, InputTextareaProps, InputDigitProps, InputNumberProps };
|
|
3
18
|
export default Input;
|
package/dist/Input/index.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
import { Input } from "
|
|
1
|
+
import { Input as InternalInput } from "./input";
|
|
2
|
+
import { InputDigit } from "./input-digit";
|
|
3
|
+
import { InputNumber } from "./input-number";
|
|
4
|
+
import { InputPassword } from "./input-password";
|
|
5
|
+
import { Textarea } from "./textarea";
|
|
6
|
+
import "./index.scss";
|
|
7
|
+
import { InputOPT } from "./input-opt";
|
|
8
|
+
var Input = InternalInput;
|
|
9
|
+
Input.Password = InputPassword;
|
|
10
|
+
Input.OPT = InputOPT;
|
|
11
|
+
Input.Digit = InputDigit;
|
|
12
|
+
Input.Number = InputNumber;
|
|
13
|
+
Input.Textarea = Textarea;
|
|
2
14
|
export default Input;
|
|
@@ -0,0 +1,282 @@
|
|
|
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
|
+
|
|
45
|
+
&-small {
|
|
46
|
+
padding: variable.$trionesInputPaddingBlockSm 0;
|
|
47
|
+
font-size: variable.$trionesInputInputFontSizeSm;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-large {
|
|
51
|
+
padding: variable.$trionesInputPaddingBlockLg 0;
|
|
52
|
+
font-size: variable.$trionesInputInputFontSizeLg;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&::placeholder {
|
|
56
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
57
|
+
color: $placeholderColor
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.weui-input {
|
|
61
|
+
&::placeholder {
|
|
62
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
63
|
+
color: $placeholderColor
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
.#{$inputAffixWrapperCls} {
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
position: relative;
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
width: 100%;
|
|
75
|
+
min-width: 0;
|
|
76
|
+
flex-shrink: 1;
|
|
77
|
+
//line-height: variable.$trionesLineHeight;
|
|
78
|
+
//padding: variable.$trionesInputPaddingBlock 0;
|
|
79
|
+
gap: 4Px;
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
&-small {
|
|
83
|
+
padding: variable.$trionesInputPaddingBlockSm 0;
|
|
84
|
+
font-size: variable.$trionesInputInputFontSizeSm;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&-large {
|
|
88
|
+
padding: variable.$trionesInputPaddingBlockLg 0;
|
|
89
|
+
font-size: variable.$trionesInputInputFontSizeLg;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
.#{$inputCls} {
|
|
95
|
+
padding: 0;
|
|
96
|
+
background-color: transparent;
|
|
97
|
+
height: 100%;
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
&-prifix {}
|
|
101
|
+
|
|
102
|
+
&-suffix {
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
vertical-align: middle;
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
row-gap: 4Px;
|
|
108
|
+
// padding-inline: 4Px;
|
|
109
|
+
line-height: normal;
|
|
110
|
+
|
|
111
|
+
.clear-icon {
|
|
112
|
+
color: rgba(0, 0, 0, 0.25);
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
color: rgba(0, 0, 0, 0.45);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.triones-antm-icon {
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
padding-inline: 4Px;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
taro-input-core {
|
|
128
|
+
&::placeholder {
|
|
129
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
130
|
+
color: $placeholderColor
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
.weui-input {
|
|
135
|
+
&::placeholder {
|
|
136
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
137
|
+
color: $placeholderColor
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
.triones-antm-icon {
|
|
144
|
+
font-size: 14Px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.#{$inputCls} {
|
|
150
|
+
&-outlined {
|
|
151
|
+
border-radius: variable.$trionesBorderRadius;
|
|
152
|
+
border: 1Px solid variable.$trionesBorderColor;
|
|
153
|
+
padding-block: variable.$trionesInputPaddingBlock;
|
|
154
|
+
padding-inline: variable.$trionesInputPaddingBlock;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&-filled {
|
|
158
|
+
border-radius: variable.$trionesBorderRadius;
|
|
159
|
+
background-color: variable.$trionesColorFillTertiary;
|
|
160
|
+
padding-block: variable.$trionesInputPaddingBlock;
|
|
161
|
+
padding-inline: variable.$trionesInputPaddingBlock;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&-underlined {
|
|
165
|
+
border-bottom: 1Px solid variable.$trionesBorderColor;
|
|
166
|
+
padding-block: variable.$trionesInputPaddingBlock;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.#{$inputGroupWrapperCls} {}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
.#{$inputPotCls} {
|
|
174
|
+
position: relative;
|
|
175
|
+
display: inline-flex;
|
|
176
|
+
vertical-align: middle;
|
|
177
|
+
|
|
178
|
+
&-wrapper {
|
|
179
|
+
position: relative;
|
|
180
|
+
display: inline-flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
flex-wrap: nowrap;
|
|
183
|
+
column-gap: 8Px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&-input {
|
|
187
|
+
position: absolute;
|
|
188
|
+
background-color: transparent;
|
|
189
|
+
z-index: -1;
|
|
190
|
+
left: 0;
|
|
191
|
+
top: 0;
|
|
192
|
+
right: 0;
|
|
193
|
+
bottom: 0;
|
|
194
|
+
opacity: 0;
|
|
195
|
+
-moz-appearance: textfield;
|
|
196
|
+
|
|
197
|
+
&::-webkit-outer-spin-button,
|
|
198
|
+
&::-webkit-inner-spin-button {
|
|
199
|
+
-webkit-appearance: none;
|
|
200
|
+
margin: 0;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&-item {
|
|
205
|
+
text-align: center;
|
|
206
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
207
|
+
height: variable.$trionesControlHeight;
|
|
208
|
+
width: variable.$trionesControlHeight;
|
|
209
|
+
display: inline-flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
justify-content: center;
|
|
212
|
+
|
|
213
|
+
&-sm {
|
|
214
|
+
width: variable.$trionesControlHeightSm;
|
|
215
|
+
height: variable.$trionesControlHeightSm;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&-lg {
|
|
219
|
+
width: variable.$trionesControlHeightLg;
|
|
220
|
+
height: variable.$trionesControlHeightLg;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&::placeholder {
|
|
224
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
225
|
+
color: $placeholderColor
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&-focus {
|
|
229
|
+
&::after {
|
|
230
|
+
content: ' ';
|
|
231
|
+
height: 100%;
|
|
232
|
+
width: 0.5Px;
|
|
233
|
+
background-color: #0a0a0a;
|
|
234
|
+
transition: transform 0.1s ease;
|
|
235
|
+
animation: blink 1s step-end infinite;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.#{$inputCls}-outlined {
|
|
242
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
243
|
+
color: rgba(0, 0, 0, 0.88);
|
|
244
|
+
background: #ffffff;
|
|
245
|
+
border-width: 1Px;
|
|
246
|
+
border-style: solid;
|
|
247
|
+
border-color: #d9d9d9;
|
|
248
|
+
-webkit-appearance: none;
|
|
249
|
+
-moz-appearance: none;
|
|
250
|
+
appearance: none;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
.#{$inputCls}-textarea {
|
|
256
|
+
box-sizing: border-box;
|
|
257
|
+
width: 100%;
|
|
258
|
+
outline: 0;
|
|
259
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
260
|
+
|
|
261
|
+
taro-textarea-core {
|
|
262
|
+
width: 100%;
|
|
263
|
+
}
|
|
264
|
+
.taro-textarea{
|
|
265
|
+
background-color: transparent;
|
|
266
|
+
}
|
|
267
|
+
textarea {
|
|
268
|
+
padding-block: 2Px;
|
|
269
|
+
background-color: transparent;
|
|
270
|
+
&::placeholder {
|
|
271
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
272
|
+
color: $placeholderColor
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@keyframes blink {
|
|
279
|
+
50% {
|
|
280
|
+
background-color: transparent;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
@@ -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), className),
|
|
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>;
|