@trionesdev/antd-mobile-react 0.0.2-beta.1 → 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/LICENSE +21 -21
- 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/Avatar/demo/base.js +2 -2
- package/dist/Avatar/demo/style.scss +6 -6
- package/dist/Badge/demo/base.js +2 -2
- package/dist/Badge/demo/base.scss +6 -6
- package/dist/Button/demo/base.js +2 -2
- package/dist/Button/style.scss +234 -232
- package/dist/Calendar/calendar.js +2 -1
- package/dist/Calendar/style.scss +85 -85
- package/dist/Calendar/touchable-calendar-grid.js +9 -9
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +5 -6
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +37 -132
- package/dist/CalendarDatetimePicker/demo/base.js +5 -21
- package/dist/CalendarDatetimePicker/index.d.ts +2 -2
- package/dist/CalendarDatetimePicker/style.scss +10 -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 +136 -0
- package/dist/CalendarDatetimePopup/demo/base.js +41 -0
- package/dist/CalendarDatetimePopup/index.d.ts +3 -0
- package/dist/CalendarDatetimePopup/index.js +2 -0
- package/dist/CalendarDatetimePopup/style.scss +54 -0
- package/dist/CalendarDatetimePopup/types.d.ts +5 -0
- package/dist/CalendarDatetimePopup/types.js +6 -0
- package/dist/CalendarPopup/calendar-popup.d.ts +4 -0
- package/dist/{CalendarPicker/calendar-picker.js → CalendarPopup/calendar-popup.js} +2 -2
- package/dist/CalendarPopup/calendar-range-popup.d.ts +4 -0
- package/dist/{CalendarPicker/calendar-range-picker.js → CalendarPopup/calendar-range-popup.js} +8 -7
- package/dist/{CalendarPicker → CalendarPopup}/demo/base.js +3 -3
- package/dist/CalendarPopup/index.d.ts +9 -0
- package/dist/CalendarPopup/index.js +5 -0
- package/dist/CalendarPopup/style.scss +31 -0
- package/dist/{CalendarPicker → CalendarPopup}/types.d.ts +2 -2
- package/dist/Card/demo/base.js +2 -2
- package/dist/Card/demo/base.scss +18 -18
- package/dist/CascaderPicker/CascaderPicker.d.ts +25 -0
- package/dist/CascaderPicker/CascaderPicker.js +78 -0
- package/dist/CascaderPicker/demo/base.js +6 -18
- 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/demo/base.d.ts +3 -0
- package/dist/CascaderPopup/demo/base.js +82 -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/Cell/demo/base.js +41 -2
- package/dist/Checkbox/demo/base.js +11 -6
- package/dist/Checkbox/demo/disabled.js +2 -1
- package/dist/ConfigProvider/demo/base.js +2 -2
- package/dist/DemoBlock/index.d.ts +6 -0
- package/dist/DemoBlock/index.js +9 -2
- package/dist/DemoBlock/index.scss +20 -20
- package/dist/DemoDescription/index.scss +3 -3
- package/dist/Divider/demo/base.js +2 -2
- package/dist/Ellipsis/demo/base.js +2 -2
- package/dist/Empty/demo/base.js +2 -2
- package/dist/ErrorBlock/demo/base.js +2 -2
- package/dist/Footer/demo/base.js +2 -2
- 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 +27 -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/demo/input.js +1 -1
- package/dist/Form/index.d.ts +8 -1
- package/dist/Form/index.js +5 -1
- package/dist/Form/style.scss +67 -0
- package/dist/Grid/demo/base.js +2 -2
- package/dist/Grid/demo/base.scss +7 -7
- package/dist/Icon/demo/base.js +2 -2
- package/dist/Image/demo/base.js +2 -2
- package/dist/Image/demo/base.scss +4 -4
- package/dist/Image/style.scss +30 -30
- package/dist/ImagesPreview/ImagesPreview.js +2 -2
- package/dist/ImagesPreview/style.scss +34 -34
- package/dist/ImagesWall/CameraModal.js +2 -2
- package/dist/ImagesWall/style.scss +70 -70
- package/dist/Input/base-input.d.ts +13 -0
- package/dist/Input/base-input.js +41 -0
- package/dist/Input/demo/base.js +89 -13
- package/dist/Input/index.d.ts +14 -2
- package/dist/Input/index.js +11 -1
- package/dist/Input/index.scss +223 -0
- package/dist/Input/input-affix-wrapper.d.ts +11 -0
- package/dist/Input/input-affix-wrapper.js +37 -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 +7 -0
- package/dist/Input/input-password.js +48 -0
- package/dist/Input/input.d.ts +18 -0
- package/dist/Input/input.js +63 -0
- package/dist/Input/textarea.d.ts +15 -0
- package/dist/Input/textarea.js +51 -0
- package/dist/Input/types.d.ts +3 -0
- package/dist/Input/types.js +2 -0
- package/dist/NavBar/demo/base.scss +5 -5
- package/dist/NoticeBar/demo/base.js +2 -2
- package/dist/Overlay/Overlay.d.ts +16 -0
- package/dist/Overlay/Overlay.js +117 -0
- package/dist/Overlay/demo/base.d.ts +3 -0
- package/dist/{Mask → Overlay}/demo/base.js +14 -16
- package/dist/Overlay/index.d.ts +4 -0
- package/dist/Overlay/index.js +3 -0
- package/dist/Overlay/style.scss +20 -0
- package/dist/PageIndicator/demo/base.js +2 -2
- package/dist/Picker/index.d.ts +1 -1
- package/dist/Picker/index.js +1 -1
- package/dist/Picker/picker.d.ts +19 -0
- package/dist/Picker/picker.js +97 -0
- package/dist/Picker/style.scss +44 -0
- package/dist/PickerView/index.d.ts +2 -1
- package/dist/PickerView/index.js +1 -1
- package/dist/PickerView/picker-view-column-item.d.ts +7 -0
- package/dist/PickerView/picker-view-column-item.js +11 -0
- package/dist/PickerView/picker-view-column.d.ts +10 -0
- package/dist/PickerView/picker-view-column.js +117 -0
- package/dist/PickerView/picker-view.d.ts +12 -0
- package/dist/PickerView/picker-view.js +60 -0
- package/dist/PickerView/style.scss +72 -0
- package/dist/PickerView/types.d.ts +4 -0
- package/dist/PickerView/types.js +1 -0
- package/dist/Popup/demo/base.js +109 -27
- package/dist/Popup/index.d.ts +2 -1
- package/dist/Popup/index.js +2 -1
- package/dist/Popup/popup.d.ts +31 -0
- package/dist/Popup/popup.js +87 -0
- package/dist/Popup/style.scss +129 -0
- package/dist/Progress/index.d.ts +1 -1
- package/dist/Progress/index.js +1 -1
- package/dist/Radio/demo/base.js +2 -2
- package/dist/Radio/demo/base.scss +4 -4
- package/dist/Result/demo/base.js +2 -2
- package/dist/SafeArea/demo/base.scss +18 -18
- package/dist/ScrollView/index.d.ts +2 -1
- package/dist/ScrollView/index.js +1 -1
- package/dist/ScrollView/scroll-view.d.ts +4 -0
- package/dist/ScrollView/scroll-view.js +55 -0
- package/dist/ScrollView/style.scss +19 -0
- package/dist/ScrollView/types.d.ts +26 -0
- package/dist/ScrollView/types.js +1 -0
- package/dist/SideBar/index.d.ts +1 -1
- package/dist/SideBar/side-bar.js +6 -6
- package/dist/SideBar/style.scss +85 -85
- package/dist/Space/demo/base.js +2 -2
- package/dist/Swiper/style.scss +54 -54
- package/dist/Switch/demo/base.js +2 -2
- package/dist/TabBar/demo/base.js +2 -2
- package/dist/Tag/demo/base.js +2 -2
- package/dist/Tag/demo/style.scss +8 -8
- package/dist/Toast/style.scss +63 -63
- package/dist/Toast/toast-modal.js +4 -4
- package/dist/VerificationCodeInput/demo/base.js +2 -2
- 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/WaterMark/demo/demo1.js +2 -2
- package/dist/WaterMark/demo/demo1.scss +6 -6
- package/dist/WaterMark/demo/demo2.js +2 -2
- package/dist/index.d.ts +9 -7
- package/dist/index.js +4 -3
- package/dist/style/variable.scss +1 -1
- package/dist/types.d.ts +0 -8
- package/dist/types.js +0 -1
- package/dist/utils/type.js +36 -36
- package/dist/utils/use-isomorphic-update-layout-effect.d.ts +1 -1
- package/dist/utils/with-default-props.js +4 -4
- package/package.json +10 -11
- package/readme.md +43 -43
- 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 -37
- package/dist/Progress/Progress.js +0 -52
- package/dist/Progress/ProgressCircle.d.ts +0 -17
- package/dist/Progress/ProgressCircle.js +0 -148
- 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 → CalendarDatetimePopup}/demo/base.d.ts +0 -0
- /package/dist/{Mask → CalendarPopup}/demo/base.d.ts +0 -0
- /package/dist/{CalendarPicker → CalendarPopup}/types.js +0 -0
|
@@ -0,0 +1,223 @@
|
|
|
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: #808080;
|
|
13
|
+
|
|
14
|
+
.#{$inputCls} {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
display: inline-block;
|
|
17
|
+
position: relative;
|
|
18
|
+
width: 100%;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
transition: all .2s;
|
|
21
|
+
outline: none;
|
|
22
|
+
box-shadow: none;
|
|
23
|
+
border: none;
|
|
24
|
+
border-radius: variable.$trionesBorderRadius;
|
|
25
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
26
|
+
padding: variable.$trionesInputPaddingBlock 0;
|
|
27
|
+
|
|
28
|
+
&-sm {
|
|
29
|
+
max-height: $inputSm;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&-lg {
|
|
33
|
+
max-height: $inputLg;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&::placeholder {
|
|
37
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
38
|
+
color: $placeholderColor
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
.#{$inputAffixWrapperCls} {
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
position: relative;
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
width: 100%;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
//line-height: variable.$trionesLineHeight;
|
|
53
|
+
padding: variable.$trionesInputPaddingBlock 0;
|
|
54
|
+
gap: 4Px;
|
|
55
|
+
|
|
56
|
+
.#{$inputCls} {
|
|
57
|
+
padding: 0;
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
|
|
60
|
+
&-prifix {
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-suffix {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
gap: 4Px;
|
|
68
|
+
|
|
69
|
+
.clear-icon {
|
|
70
|
+
color: rgba(0, 0, 0, 0.25);
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
&:hover {
|
|
74
|
+
color: rgba(0, 0, 0, 0.45);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.triones-antm-icon {
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
input {
|
|
85
|
+
// height: 1.47059em;
|
|
86
|
+
line-height: 1.47059;
|
|
87
|
+
|
|
88
|
+
&::placeholder {
|
|
89
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
90
|
+
color: $placeholderColor
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.#{$inputCls} {
|
|
96
|
+
&-outlined {
|
|
97
|
+
border-radius: variable.$trionesBorderRadius;
|
|
98
|
+
border: 1Px solid variable.$trionesBorderColor;
|
|
99
|
+
padding-inline: 4Px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&-filled {
|
|
103
|
+
border-radius: variable.$trionesBorderRadius;
|
|
104
|
+
background-color: variable.$trionesColorFillTertiary;
|
|
105
|
+
padding-inline: 4Px;
|
|
106
|
+
border: 0;
|
|
107
|
+
}
|
|
108
|
+
&-borderless {
|
|
109
|
+
border: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&-underlined {
|
|
113
|
+
border-top: 0;
|
|
114
|
+
border-left: 0;
|
|
115
|
+
border-right: 0;
|
|
116
|
+
border-bottom: 1Px solid variable.$trionesBorderColor;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.#{$inputGroupWrapperCls} {
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
.#{$inputPotCls} {
|
|
125
|
+
position: relative;
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
vertical-align: middle;
|
|
128
|
+
|
|
129
|
+
&-wrapper {
|
|
130
|
+
position: relative;
|
|
131
|
+
display: inline-flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
flex-wrap: nowrap;
|
|
134
|
+
column-gap: 8Px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&-input {
|
|
138
|
+
position: absolute;
|
|
139
|
+
background-color: transparent;
|
|
140
|
+
z-index: -1;
|
|
141
|
+
left: 0;
|
|
142
|
+
top: 0;
|
|
143
|
+
right: 0;
|
|
144
|
+
bottom: 0;
|
|
145
|
+
opacity: 0;
|
|
146
|
+
-moz-appearance: textfield;
|
|
147
|
+
|
|
148
|
+
&::-webkit-outer-spin-button,
|
|
149
|
+
&::-webkit-inner-spin-button {
|
|
150
|
+
-webkit-appearance: none;
|
|
151
|
+
margin: 0;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&-item {
|
|
156
|
+
text-align: center;
|
|
157
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
158
|
+
height: 32Px;
|
|
159
|
+
width: 32Px;
|
|
160
|
+
display: inline-flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: center;
|
|
163
|
+
|
|
164
|
+
&-sm {
|
|
165
|
+
width: $inputSm;
|
|
166
|
+
height: $inputSm;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&-lg {
|
|
170
|
+
width: $inputLg;
|
|
171
|
+
height: $inputLg;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&::placeholder {
|
|
175
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
176
|
+
color: $placeholderColor
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&-focus {
|
|
180
|
+
&::after {
|
|
181
|
+
content: ' ';
|
|
182
|
+
height: 100%;
|
|
183
|
+
width: 0.5Px;
|
|
184
|
+
background-color: #0a0a0a;
|
|
185
|
+
transition: transform 0.1s ease;
|
|
186
|
+
animation: blink 1s step-end infinite;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.#{$inputCls}-outlined {
|
|
193
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
194
|
+
color: rgba(0, 0, 0, 0.88);
|
|
195
|
+
background: #ffffff;
|
|
196
|
+
border-width: 1Px;
|
|
197
|
+
border-style: solid;
|
|
198
|
+
border-color: #d9d9d9;
|
|
199
|
+
-webkit-appearance: none;
|
|
200
|
+
-moz-appearance: none;
|
|
201
|
+
appearance: none;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
.#{$inputCls}-textarea {
|
|
207
|
+
box-sizing: border-box;
|
|
208
|
+
width: 100%;
|
|
209
|
+
outline: 0;
|
|
210
|
+
padding-block: variable.$trionesInputPaddingBlock;
|
|
211
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
212
|
+
|
|
213
|
+
&::placeholder {
|
|
214
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
215
|
+
color: $placeholderColor
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@keyframes blink {
|
|
220
|
+
50% {
|
|
221
|
+
background-color: transparent;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { BaseInputProps } from './base-input';
|
|
3
|
+
import { variantType } from "./types";
|
|
4
|
+
export type InputAffixWrapperProps = BaseInputProps & {
|
|
5
|
+
prefix?: React.ReactNode;
|
|
6
|
+
suffix?: React.ReactNode;
|
|
7
|
+
variant?: variantType;
|
|
8
|
+
allowClear?: boolean;
|
|
9
|
+
onClear?: () => void;
|
|
10
|
+
};
|
|
11
|
+
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", "prefix", "suffix", "variant", "allowClear", "value", "onChange", "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 { CloseCircleFill } from "../../../antd-mobile-icons-react";
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { inputAffixWrapperCls, inputCls } from "./types";
|
|
12
|
+
export var InputAffixWrapper = function InputAffixWrapper(_ref) {
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
prefix = _ref.prefix,
|
|
15
|
+
suffix = _ref.suffix,
|
|
16
|
+
_ref$variant = _ref.variant,
|
|
17
|
+
variant = _ref$variant === void 0 ? 'borderless' : _ref$variant,
|
|
18
|
+
allowClear = _ref.allowClear,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
onChange = _ref.onChange,
|
|
21
|
+
onClear = _ref.onClear,
|
|
22
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
var innerStyle = rest.style || {};
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: classNames([inputAffixWrapperCls, _defineProperty({}, "".concat(inputCls, "-").concat(variant), variant), rest.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,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,7 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { InputProps } from './input';
|
|
3
|
+
export type InputPasswordProps = Omit<InputProps, 'type'> & {
|
|
4
|
+
iconRender?: (visible: boolean) => React.ReactNode;
|
|
5
|
+
visibilityToggle?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const InputPassword: FC<InputPasswordProps>;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { EyeInvisibleOutline, EyeOutline } from "../../../antd-mobile-icons-react";
|
|
12
|
+
import React, { useState } from 'react';
|
|
13
|
+
import { Input } from "./input";
|
|
14
|
+
export var InputPassword = function InputPassword(_ref) {
|
|
15
|
+
var iconRender = _ref.iconRender,
|
|
16
|
+
_ref$visibilityToggle = _ref.visibilityToggle,
|
|
17
|
+
visibilityToggle = _ref$visibilityToggle === void 0 ? true : _ref$visibilityToggle,
|
|
18
|
+
suffix = _ref.suffix,
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
var _useState = useState(false),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
visible = _useState2[0],
|
|
23
|
+
setVisible = _useState2[1];
|
|
24
|
+
var toggleRender = function toggleRender() {
|
|
25
|
+
if (iconRender) {
|
|
26
|
+
return iconRender(visible);
|
|
27
|
+
} else {
|
|
28
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, visible ? /*#__PURE__*/React.createElement(EyeOutline, {
|
|
29
|
+
onClick: function onClick() {
|
|
30
|
+
return setVisible(false);
|
|
31
|
+
}
|
|
32
|
+
}) : /*#__PURE__*/React.createElement(EyeInvisibleOutline, {
|
|
33
|
+
onClick: function onClick() {
|
|
34
|
+
return setVisible(true);
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return /*#__PURE__*/React.createElement(Input, _extends({}, rest, {
|
|
40
|
+
type: visible ? 'text' : 'password',
|
|
41
|
+
suffix: /*#__PURE__*/React.createElement(React.Fragment, null, ' ', visibilityToggle && /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
style: {
|
|
43
|
+
paddingLeft: 4,
|
|
44
|
+
paddingRight: 4
|
|
45
|
+
}
|
|
46
|
+
}, toggleRender()), " ", suffix, ' ')
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
import { variantType } from "./types";
|
|
4
|
+
export type InputProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
type?: 'text' | 'password' | 'textarea';
|
|
9
|
+
variant?: variantType;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
allowClear?: boolean;
|
|
12
|
+
prefix?: React.ReactNode;
|
|
13
|
+
suffix?: React.ReactNode;
|
|
14
|
+
defaultValue?: any;
|
|
15
|
+
value?: any;
|
|
16
|
+
onChange?: (e: any) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const Input: FC<InputProps>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var _excluded = ["className", "style", "placeholder", "type", "disabled", "allowClear", "prefix", "suffix", "defaultValue", "value", "onChange"];
|
|
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 { BaseInput } from "./base-input";
|
|
13
|
+
import "./index.scss";
|
|
14
|
+
import { InputAffixWrapper } from "./input-affix-wrapper";
|
|
15
|
+
export var Input = function Input(_ref) {
|
|
16
|
+
var className = _ref.className,
|
|
17
|
+
style = _ref.style,
|
|
18
|
+
placeholder = _ref.placeholder,
|
|
19
|
+
type = _ref.type,
|
|
20
|
+
disabled = _ref.disabled,
|
|
21
|
+
allowClear = _ref.allowClear,
|
|
22
|
+
prefix = _ref.prefix,
|
|
23
|
+
suffix = _ref.suffix,
|
|
24
|
+
defaultValue = _ref.defaultValue,
|
|
25
|
+
value = _ref.value,
|
|
26
|
+
_onChange = _ref.onChange,
|
|
27
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
var _React$useState = React.useState(value),
|
|
29
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
30
|
+
innerValue = _React$useState2[0],
|
|
31
|
+
setInnerValue = _React$useState2[1];
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
if (value === undefined) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (value !== innerValue) {
|
|
37
|
+
setInnerValue(value);
|
|
38
|
+
}
|
|
39
|
+
}, [value]);
|
|
40
|
+
return /*#__PURE__*/React.createElement(InputAffixWrapper, _extends({}, rest, {
|
|
41
|
+
className: className,
|
|
42
|
+
style: style,
|
|
43
|
+
placeholder: placeholder,
|
|
44
|
+
prefix: prefix,
|
|
45
|
+
suffix: suffix,
|
|
46
|
+
allowClear: allowClear,
|
|
47
|
+
type: type,
|
|
48
|
+
value: innerValue,
|
|
49
|
+
onChange: _onChange,
|
|
50
|
+
onClear: function onClear() {
|
|
51
|
+
setInnerValue('');
|
|
52
|
+
}
|
|
53
|
+
}), /*#__PURE__*/React.createElement(BaseInput, _extends({}, rest, {
|
|
54
|
+
placeholder: placeholder,
|
|
55
|
+
type: type,
|
|
56
|
+
disabled: disabled,
|
|
57
|
+
value: innerValue,
|
|
58
|
+
onChange: function onChange(value) {
|
|
59
|
+
setInnerValue(value);
|
|
60
|
+
_onChange === null || _onChange === void 0 || _onChange(value);
|
|
61
|
+
}
|
|
62
|
+
})));
|
|
63
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
import { variantType } from './types';
|
|
4
|
+
export type InputTextareaProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
allowClear?: boolean;
|
|
10
|
+
variant?: variantType;
|
|
11
|
+
rows?: number;
|
|
12
|
+
value?: any;
|
|
13
|
+
onChange?: (e: any) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const Textarea: FC<InputTextareaProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
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); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
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."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import React, { useEffect } from 'react';
|
|
12
|
+
import "./index.scss";
|
|
13
|
+
import { inputCls } from "./types";
|
|
14
|
+
import classNames from 'classnames';
|
|
15
|
+
export var Textarea = function Textarea(_ref) {
|
|
16
|
+
var className = _ref.className,
|
|
17
|
+
style = _ref.style,
|
|
18
|
+
placeholder = _ref.placeholder,
|
|
19
|
+
disabled = _ref.disabled,
|
|
20
|
+
allowClear = _ref.allowClear,
|
|
21
|
+
_ref$variant = _ref.variant,
|
|
22
|
+
variant = _ref$variant === void 0 ? 'borderless' : _ref$variant,
|
|
23
|
+
rows = _ref.rows,
|
|
24
|
+
value = _ref.value,
|
|
25
|
+
onChange = _ref.onChange;
|
|
26
|
+
var _React$useState = React.useState(value),
|
|
27
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
28
|
+
internalValue = _React$useState2[0],
|
|
29
|
+
setInternalValue = _React$useState2[1];
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
if (value === undefined) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (value === internalValue) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
setInternalValue(value);
|
|
38
|
+
}, [value]);
|
|
39
|
+
return /*#__PURE__*/React.createElement("textarea", {
|
|
40
|
+
className: classNames("".concat(inputCls, "-textarea"), _defineProperty({}, "".concat(inputCls, "-").concat(variant), variant), className),
|
|
41
|
+
style: style,
|
|
42
|
+
placeholder: placeholder,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
rows: rows,
|
|
45
|
+
value: internalValue,
|
|
46
|
+
onInput: function onInput(e) {
|
|
47
|
+
setInternalValue(e.target.value);
|
|
48
|
+
onChange === null || onChange === void 0 || onChange(e.target.value);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
.my-nav-bar {
|
|
2
|
-
&-subtitle {
|
|
3
|
-
font-size: 12px;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
1
|
+
.my-nav-bar {
|
|
2
|
+
&-subtitle {
|
|
3
|
+
font-size: 12px;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { FC, PropsWithChildren } from 'react';
|
|
2
|
+
export type OverlayProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
open: boolean;
|
|
6
|
+
zIndex?: number;
|
|
7
|
+
closeOnOverlayClick?: boolean;
|
|
8
|
+
destroyOnHidden?: boolean;
|
|
9
|
+
onClick?: (e: any) => void;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
afterClose?: () => void;
|
|
12
|
+
afterOpenChange?: (open: boolean) => void;
|
|
13
|
+
duration?: number;
|
|
14
|
+
getContainer?: () => HTMLElement;
|
|
15
|
+
};
|
|
16
|
+
export declare const Overlay: FC<PropsWithChildren<OverlayProps>>;
|