@trionesdev/antd-mobile-react 0.0.2-beta.2 → 0.0.2-beta.20
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/button.d.ts +2 -1
- package/dist/Button/button.js +1 -1
- package/dist/Button/demo/base.js +2 -2
- package/dist/Button/style.scss +234 -232
- package/dist/Calendar/calendar-grid.d.ts +10 -9
- package/dist/Calendar/calendar-grid.js +41 -64
- package/dist/Calendar/calendar-header.d.ts +3 -2
- package/dist/Calendar/calendar-header.js +6 -6
- package/dist/Calendar/calendar-range.d.ts +4 -3
- package/dist/Calendar/calendar-range.js +12 -11
- package/dist/Calendar/calendar.d.ts +5 -4
- package/dist/Calendar/calendar.js +23 -14
- package/dist/Calendar/style.scss +85 -85
- package/dist/Calendar/touchable-calendar-grid.d.ts +6 -5
- package/dist/Calendar/touchable-calendar-grid.js +67 -59
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +3 -2
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +14 -28
- package/dist/CalendarDatetimePicker/DateTimeSwitch.d.ts +3 -2
- package/dist/CalendarDatetimePicker/DateTimeSwitch.js +4 -3
- package/dist/CalendarDatetimePicker/demo/base.js +1 -1
- package/dist/CalendarDatetimePicker/style.scss +54 -54
- package/dist/CalendarDatetimePicker/types.d.ts +1 -1
- package/dist/CalendarDatetimePicker/types.js +1 -1
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +11 -0
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +61 -0
- package/dist/{Mask → CalendarDatetimePickerCell}/demo/base.js +9 -15
- package/dist/CalendarDatetimePickerCell/index.d.ts +3 -0
- package/dist/CalendarDatetimePickerCell/index.js +2 -0
- package/dist/CalendarDatetimePickerCell/style.scss +10 -0
- package/dist/CalendarDatetimePickerCell/types.d.ts +1 -0
- package/dist/CalendarDatetimePickerCell/types.js +1 -0
- package/dist/CalendarPicker/calendar-picker.js +2 -2
- package/dist/CalendarPicker/calendar-range-picker.d.ts +4 -4
- package/dist/CalendarPicker/calendar-range-picker.js +11 -9
- package/dist/CalendarPicker/demo/base.js +6 -6
- package/dist/CalendarPicker/index.d.ts +2 -2
- package/dist/CalendarPicker/index.js +3 -3
- package/dist/CalendarPicker/style.scss +31 -31
- package/dist/CalendarPicker/types.d.ts +8 -7
- 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/demo/base.d.ts +3 -0
- package/dist/CalendarPickerCell/demo/base.js +31 -0
- package/dist/CalendarPickerCell/index.d.ts +8 -0
- package/dist/CalendarPickerCell/index.js +5 -0
- package/dist/Card/demo/base.js +2 -2
- package/dist/Card/demo/base.scss +18 -18
- package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
- package/dist/CascaderPicker/cascader-picker.js +90 -0
- package/dist/CascaderPicker/demo/base.js +1 -4
- 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 +21 -0
- package/dist/CascaderPickerCell/CascaderPickerCell.js +70 -0
- package/dist/CascaderPickerCell/demo/base.js +71 -0
- package/dist/CascaderPickerCell/index.d.ts +3 -0
- package/dist/CascaderPickerCell/index.js +2 -0
- package/dist/CascaderPickerCell/style.scss +24 -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/FetchPicker/FetchPicker.d.ts +113 -0
- package/dist/FetchPicker/FetchPicker.js +319 -0
- package/dist/FetchPicker/index.d.ts +4 -0
- package/dist/FetchPicker/index.js +3 -0
- package/dist/FetchPicker/styles.scss +118 -0
- package/dist/FloatButton/FloatButton.d.ts +21 -0
- package/dist/FloatButton/FloatButton.js +66 -0
- package/dist/FloatButton/FloatButtonGroup.d.ts +21 -0
- package/dist/FloatButton/FloatButtonGroup.js +120 -0
- package/dist/FloatButton/context.d.ts +13 -0
- package/dist/FloatButton/context.js +2 -0
- package/dist/FloatButton/demo/base.d.ts +3 -0
- package/dist/FloatButton/demo/base.js +10 -0
- package/dist/FloatButton/demo/group.d.ts +3 -0
- package/dist/FloatButton/demo/group.js +20 -0
- package/dist/FloatButton/demo/square.d.ts +3 -0
- package/dist/FloatButton/demo/square.js +12 -0
- package/dist/FloatButton/index.d.ts +10 -0
- package/dist/FloatButton/index.js +5 -0
- package/dist/FloatButton/style.scss +123 -0
- package/dist/Footer/demo/base.js +2 -2
- 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 +51 -0
- package/dist/Form/FormItem/form-item.js +74 -0
- package/dist/Form/FormItem/index.d.ts +5 -0
- package/dist/Form/FormItem/index.js +3 -0
- package/dist/Form/demo/input.js +7 -3
- package/dist/Form/demo/vertical.d.ts +3 -0
- package/dist/Form/demo/vertical.js +45 -0
- package/dist/Form/index.d.ts +9 -2
- package/dist/Form/index.js +5 -1
- package/dist/Form/style.scss +106 -0
- package/dist/FormCell/index.d.ts +3 -0
- package/dist/FormCell/index.js +2 -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 +115 -13
- package/dist/Input/index.d.ts +14 -2
- package/dist/Input/index.js +11 -1
- package/dist/Input/index.scss +240 -0
- package/dist/Input/input-affix-wrapper.d.ts +13 -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 +20 -0
- package/dist/Input/input.js +66 -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/Loading/DotLoading.d.ts +1 -0
- package/dist/Loading/DotLoading.js +1 -0
- package/dist/Loading/SpinLoading.d.ts +1 -0
- package/dist/Loading/SpinLoading.js +1 -0
- package/dist/Loading/demo/base.d.ts +3 -0
- package/dist/{SpinLoading → Loading}/demo/base.js +8 -2
- package/dist/Loading/demo/dot-loading.d.ts +3 -0
- package/dist/Loading/demo/dot-loading.js +25 -0
- package/dist/Loading/index.d.ts +5 -0
- package/dist/Loading/index.js +3 -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/Overlay/demo/base.js +27 -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/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 +20 -0
- package/dist/Picker/picker.js +94 -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/Segmented/demo/base.d.ts +3 -0
- package/dist/Segmented/demo/base.js +33 -0
- package/dist/Segmented/index.d.ts +3 -0
- package/dist/Segmented/index.js +2 -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/Skeleton/demo/base.d.ts +3 -0
- package/dist/Skeleton/demo/base.js +8 -0
- package/dist/Skeleton/index.d.ts +3 -0
- package/dist/Skeleton/index.js +2 -0
- package/dist/Space/demo/base.js +2 -2
- package/dist/Stepper/demo/base.d.ts +3 -0
- package/dist/Stepper/demo/base.js +23 -0
- package/dist/Stepper/index.d.ts +3 -0
- package/dist/Stepper/index.js +2 -0
- 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 +33 -19
- package/dist/index.js +9 -2
- package/dist/style/variable.scss +1 -1
- package/dist/types.d.ts +0 -8
- package/dist/types.js +0 -1
- package/dist/utils/dayjs.d.ts +4 -0
- package/dist/utils/dayjs.js +42 -0
- 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 +11 -16
- package/readme.md +43 -43
- 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/SpinLoading/index.d.ts +0 -3
- package/dist/SpinLoading/index.js +0 -2
- /package/dist/{Mask → CalendarDatetimePickerCell}/demo/base.d.ts +0 -0
- /package/dist/{SpinLoading → CascaderPickerCell}/demo/base.d.ts +0 -0
package/dist/Input/demo/base.js
CHANGED
|
@@ -1,29 +1,131 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* compact: true
|
|
1
|
+
/**
|
|
2
|
+
* compact: true
|
|
3
3
|
*/
|
|
4
4
|
import { DemoBlock } from "../../DemoBlock";
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import Input from "../index";
|
|
7
|
+
import Space from "../../Space";
|
|
7
8
|
export default (function () {
|
|
8
9
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DemoBlock, {
|
|
9
|
-
title: "\u57FA\u7840\u7528\u6CD5"
|
|
10
|
+
title: "\u57FA\u7840\u7528\u6CD5",
|
|
11
|
+
styles: {
|
|
12
|
+
body: {
|
|
13
|
+
backgroundColor: '#D5D5D5'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
style: {
|
|
18
|
+
backgroundColor: '#FFFFFF'
|
|
19
|
+
}
|
|
10
20
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
11
21
|
placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9"
|
|
12
|
-
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
13
|
-
title: "\
|
|
22
|
+
}))), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
23
|
+
title: "\u57FA\u7840\u7528\u6CD5\uFF08\u5927\u5C0F\uFF09",
|
|
24
|
+
styles: {
|
|
25
|
+
body: {
|
|
26
|
+
backgroundColor: '#D5D5D5'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
style: {
|
|
31
|
+
backgroundColor: '#FFFFFF'
|
|
32
|
+
}
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
34
|
+
direction: "vertical",
|
|
35
|
+
block: true
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
37
|
+
placeholder: "Large Size",
|
|
38
|
+
size: "large",
|
|
39
|
+
variant: "outlined"
|
|
40
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
41
|
+
placeholder: "Middle Size",
|
|
42
|
+
size: "medium",
|
|
43
|
+
variant: 'outlined'
|
|
44
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
45
|
+
placeholder: "Small Size",
|
|
46
|
+
size: "small",
|
|
47
|
+
variant: "outlined"
|
|
48
|
+
})))), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
49
|
+
title: "\u5E26\u6E05\u9664\u6309\u94AE",
|
|
50
|
+
styles: {
|
|
51
|
+
body: {
|
|
52
|
+
backgroundColor: '#D5D5D5'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
style: {
|
|
57
|
+
backgroundColor: '#FFFFFF'
|
|
58
|
+
}
|
|
14
59
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
15
60
|
placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9",
|
|
16
61
|
allowClear: true
|
|
17
|
-
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
18
|
-
title: "\u5BC6\u7801\u6A21\u5F0F"
|
|
62
|
+
}))), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
63
|
+
title: "\u5BC6\u7801\u6A21\u5F0F",
|
|
64
|
+
styles: {
|
|
65
|
+
body: {
|
|
66
|
+
backgroundColor: '#D5D5D5'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
style: {
|
|
71
|
+
backgroundColor: '#FFFFFF'
|
|
72
|
+
}
|
|
19
73
|
}, /*#__PURE__*/React.createElement(Input.Password, {
|
|
20
74
|
placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9",
|
|
21
75
|
allowClear: true
|
|
22
|
-
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
23
|
-
title: "OPT\u6A21\u5F0F"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
76
|
+
}))), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
77
|
+
title: "OPT\u6A21\u5F0F",
|
|
78
|
+
styles: {
|
|
79
|
+
body: {
|
|
80
|
+
backgroundColor: '#D5D5D5'
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
style: {
|
|
85
|
+
backgroundColor: '#FFFFFF'
|
|
86
|
+
}
|
|
87
|
+
}, /*#__PURE__*/React.createElement(Input.OPT, null))), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
88
|
+
title: "Textarea",
|
|
89
|
+
styles: {
|
|
90
|
+
body: {
|
|
91
|
+
backgroundColor: '#D5D5D5'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Input.Textarea, {
|
|
27
95
|
placeholder: '请输入内容'
|
|
28
|
-
}))
|
|
96
|
+
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
97
|
+
title: "\u53D8\u4F53"
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
99
|
+
direction: "vertical",
|
|
100
|
+
block: true
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
102
|
+
variant: "outlined",
|
|
103
|
+
placeholder: "outlined"
|
|
104
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
105
|
+
variant: "filled",
|
|
106
|
+
placeholder: "filled"
|
|
107
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
108
|
+
variant: "borderless",
|
|
109
|
+
placeholder: "borderless"
|
|
110
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
111
|
+
variant: "underlined",
|
|
112
|
+
placeholder: "underlined"
|
|
113
|
+
}))), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
114
|
+
title: "\u5C3A\u5BF8"
|
|
115
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
116
|
+
direction: "vertical",
|
|
117
|
+
block: true
|
|
118
|
+
}, /*#__PURE__*/React.createElement(Input.Textarea, {
|
|
119
|
+
variant: "outlined",
|
|
120
|
+
placeholder: "outlined"
|
|
121
|
+
}), /*#__PURE__*/React.createElement(Input.Textarea, {
|
|
122
|
+
variant: "filled",
|
|
123
|
+
placeholder: "filled"
|
|
124
|
+
}), /*#__PURE__*/React.createElement(Input.Textarea, {
|
|
125
|
+
variant: "borderless",
|
|
126
|
+
placeholder: "borderless"
|
|
127
|
+
}), /*#__PURE__*/React.createElement(Input.Textarea, {
|
|
128
|
+
variant: "underlined",
|
|
129
|
+
placeholder: "underlined"
|
|
130
|
+
}))));
|
|
29
131
|
});
|
package/dist/Input/index.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { InputAffixWrapperProps, InputAffixWrapper } from "./input-affix-wrapper";
|
|
2
|
+
import { InputProps, Input as InternalInput } from './input';
|
|
3
|
+
import { InputOPT, InputOPTProps } from './input-opt';
|
|
4
|
+
import { InputPassword, InputPasswordProps } from './input-password';
|
|
5
|
+
import { InputTextareaProps, Textarea } from './textarea';
|
|
6
|
+
type CompoundedComponent = typeof InternalInput & {
|
|
7
|
+
Password: typeof InputPassword;
|
|
8
|
+
Textarea: typeof Textarea;
|
|
9
|
+
OPT: typeof InputOPT;
|
|
10
|
+
};
|
|
11
|
+
declare const Input: CompoundedComponent;
|
|
12
|
+
export type { InputAffixWrapperProps, InputOPTProps, InputPasswordProps, InputProps, InputTextareaProps, };
|
|
13
|
+
export * from './types';
|
|
14
|
+
export { InputAffixWrapper };
|
|
3
15
|
export default Input;
|
package/dist/Input/index.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputAffixWrapper } from "./input-affix-wrapper";
|
|
2
|
+
import { Input as InternalInput } from "./input";
|
|
3
|
+
import { InputOPT } from "./input-opt";
|
|
4
|
+
import { InputPassword } from "./input-password";
|
|
5
|
+
import { Textarea } from "./textarea";
|
|
6
|
+
var Input = InternalInput;
|
|
7
|
+
Input.Password = InputPassword;
|
|
8
|
+
Input.OPT = InputOPT;
|
|
9
|
+
Input.Textarea = Textarea;
|
|
10
|
+
export * from "./types";
|
|
11
|
+
export { InputAffixWrapper };
|
|
2
12
|
export default Input;
|
|
@@ -0,0 +1,240 @@
|
|
|
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: #CCCCCC;
|
|
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
|
+
//font-size: variable.$trionesInputPaddingInlineSm 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-lg {
|
|
34
|
+
max-height: $inputLg;
|
|
35
|
+
//font-size: variable.$trionesInputPaddingInlineLg 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&::placeholder {
|
|
39
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
40
|
+
color: $placeholderColor
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
.#{$inputAffixWrapperCls} {
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
position: relative;
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
width: 100%;
|
|
53
|
+
min-width: 0;
|
|
54
|
+
//line-height: variable.$trionesLineHeight;
|
|
55
|
+
//padding: variable.$trionesInputPaddingBlock 0;
|
|
56
|
+
gap: 4Px;
|
|
57
|
+
|
|
58
|
+
&-small {
|
|
59
|
+
padding: variable.$trionesInputPaddingBlockSm 0;
|
|
60
|
+
font-size: variable.$trionesInputInputFontSizeSm;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-large {
|
|
64
|
+
padding: variable.$trionesInputPaddingBlockLg 0;
|
|
65
|
+
font-size: variable.$trionesInputInputFontSizeLg;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.#{$inputCls} {
|
|
69
|
+
padding: 0;
|
|
70
|
+
background-color: transparent;
|
|
71
|
+
|
|
72
|
+
&-prifix {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&-suffix {
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
flex-shrink: 0;
|
|
79
|
+
gap: 4Px;
|
|
80
|
+
|
|
81
|
+
.clear-icon {
|
|
82
|
+
color: rgba(0, 0, 0, 0.25);
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
&:hover {
|
|
86
|
+
color: rgba(0, 0, 0, 0.45);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.triones-antm-icon {
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
input {
|
|
97
|
+
// height: 1.47059em;
|
|
98
|
+
line-height: 1.47059;
|
|
99
|
+
|
|
100
|
+
&::placeholder {
|
|
101
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
102
|
+
color: $placeholderColor
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.#{$inputCls} {
|
|
108
|
+
&-outlined {
|
|
109
|
+
padding-block: variable.$trionesInputPaddingBlock;
|
|
110
|
+
border-radius: variable.$trionesBorderRadius;
|
|
111
|
+
border: 1Px solid variable.$trionesBorderColor;
|
|
112
|
+
padding-inline: 4Px;
|
|
113
|
+
box-sizing: border-box;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&-filled {
|
|
117
|
+
border-radius: variable.$trionesBorderRadius;
|
|
118
|
+
background-color: variable.$trionesColorFillTertiary;
|
|
119
|
+
padding-inline: variable.$trionesInputPaddingBlock;
|
|
120
|
+
padding-block: variable.$trionesInputPaddingBlock;
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
border: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&-borderless {
|
|
126
|
+
border: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&-underlined {
|
|
130
|
+
border-top: 0;
|
|
131
|
+
border-left: 0;
|
|
132
|
+
border-right: 0;
|
|
133
|
+
border-bottom: 1Px solid variable.$trionesBorderColor;
|
|
134
|
+
padding-block: variable.$trionesInputPaddingBlock;
|
|
135
|
+
box-sizing: border-box;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
.#{$inputPotCls} {
|
|
142
|
+
position: relative;
|
|
143
|
+
display: inline-flex;
|
|
144
|
+
vertical-align: middle;
|
|
145
|
+
|
|
146
|
+
&-wrapper {
|
|
147
|
+
position: relative;
|
|
148
|
+
display: inline-flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
flex-wrap: nowrap;
|
|
151
|
+
column-gap: 8Px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&-input {
|
|
155
|
+
position: absolute;
|
|
156
|
+
background-color: transparent;
|
|
157
|
+
z-index: -1;
|
|
158
|
+
left: 0;
|
|
159
|
+
top: 0;
|
|
160
|
+
right: 0;
|
|
161
|
+
bottom: 0;
|
|
162
|
+
opacity: 0;
|
|
163
|
+
-moz-appearance: textfield;
|
|
164
|
+
|
|
165
|
+
&::-webkit-outer-spin-button,
|
|
166
|
+
&::-webkit-inner-spin-button {
|
|
167
|
+
-webkit-appearance: none;
|
|
168
|
+
margin: 0;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&-item {
|
|
173
|
+
text-align: center;
|
|
174
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
175
|
+
height: variable.$trionesControlHeight;
|
|
176
|
+
width: variable.$trionesControlHeight;
|
|
177
|
+
display: inline-flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
|
|
181
|
+
&-sm {
|
|
182
|
+
width: variable.$trionesControlHeightSm;
|
|
183
|
+
height: variable.$trionesControlHeightSm;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&-lg {
|
|
187
|
+
width: variable.$trionesControlHeightLg;
|
|
188
|
+
height: variable.$trionesControlHeightLg;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&::placeholder {
|
|
192
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
193
|
+
color: $placeholderColor
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&-focus {
|
|
197
|
+
&::after {
|
|
198
|
+
content: ' ';
|
|
199
|
+
height: 100%;
|
|
200
|
+
width: 0.5Px;
|
|
201
|
+
background-color: #0a0a0a;
|
|
202
|
+
transition: transform 0.1s ease;
|
|
203
|
+
animation: blink 1s step-end infinite;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.#{$inputCls}-outlined {
|
|
210
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
211
|
+
color: rgba(0, 0, 0, 0.88);
|
|
212
|
+
background: #ffffff;
|
|
213
|
+
border-width: 1Px;
|
|
214
|
+
border-style: solid;
|
|
215
|
+
border-color: #d9d9d9;
|
|
216
|
+
-webkit-appearance: none;
|
|
217
|
+
-moz-appearance: none;
|
|
218
|
+
appearance: none;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
.#{$inputCls}-textarea {
|
|
224
|
+
box-sizing: border-box;
|
|
225
|
+
width: 100%;
|
|
226
|
+
outline: 0;
|
|
227
|
+
//padding-block: variable.$trionesInputPaddingBlock;
|
|
228
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
229
|
+
|
|
230
|
+
&::placeholder {
|
|
231
|
+
font-size: variable.$trionesInputInputFontSize;
|
|
232
|
+
color: $placeholderColor
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@keyframes blink {
|
|
237
|
+
50% {
|
|
238
|
+
background-color: transparent;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { BaseInputProps } from './base-input';
|
|
3
|
+
import { variantType } from './types';
|
|
4
|
+
import { AntSize } from "@trionesdev/antd-mobile-base-react";
|
|
5
|
+
export type InputAffixWrapperProps = BaseInputProps & {
|
|
6
|
+
size?: AntSize;
|
|
7
|
+
prefix?: React.ReactNode;
|
|
8
|
+
suffix?: React.ReactNode;
|
|
9
|
+
variant?: variantType;
|
|
10
|
+
allowClear?: boolean;
|
|
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", "size", "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
|
+
size = _ref.size,
|
|
15
|
+
prefix = _ref.prefix,
|
|
16
|
+
suffix = _ref.suffix,
|
|
17
|
+
_ref$variant = _ref.variant,
|
|
18
|
+
variant = _ref$variant === void 0 ? 'borderless' : _ref$variant,
|
|
19
|
+
allowClear = _ref.allowClear,
|
|
20
|
+
value = _ref.value,
|
|
21
|
+
onClear = _ref.onClear,
|
|
22
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
var innerStyle = rest.style || {};
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: classNames([inputAffixWrapperCls, "".concat(inputAffixWrapperCls, "-").concat(size), _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,20 @@
|
|
|
1
|
+
import { AntSize } from '@trionesdev/antd-mobile-base-react';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
import { variantType } from './types';
|
|
5
|
+
export type InputProps = {
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
size?: AntSize;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
type?: 'text' | 'password' | 'textarea';
|
|
11
|
+
variant?: variantType;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
allowClear?: boolean;
|
|
14
|
+
prefix?: React.ReactNode;
|
|
15
|
+
suffix?: React.ReactNode;
|
|
16
|
+
defaultValue?: any;
|
|
17
|
+
value?: any;
|
|
18
|
+
onChange?: (e: any) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const Input: FC<InputProps>;
|