@nutui/nutui-react 2.0.0-alpha.11 → 2.0.0-alpha.13
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/CHANGELOG.md +28 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/ActionSheet.js +28 -37
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/AnimatingNumbers/style/style.css +1 -1
- package/dist/esm/AnimatingNumbers.js +22 -26
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/CountDown/style/style.css +1 -1
- package/dist/esm/CountDown.js +20 -15
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/Ellipsis/style/style.css +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/SearchBar/style/style.css +1 -1
- package/dist/esm/SearchBar.js +33 -87
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +65 -133
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/Toast/style/style.css +1 -1
- package/dist/esm/Toast.js +86 -102
- package/dist/esm/TrendArrow/style/style.css +1 -1
- package/dist/esm/TrendArrow.js +30 -35
- package/dist/esm/Video.js +8 -12
- package/dist/esm/VirtualList/style/style.css +1 -1
- package/dist/esm/VirtualList.js +29 -25
- package/dist/esm/WaterMark.js +8 -11
- package/dist/esm/types/src/packages/actionsheet/actionsheet.d.ts +11 -15
- package/dist/esm/types/src/packages/actionsheet/actionsheet.taro.d.ts +11 -15
- package/dist/esm/types/src/packages/actionsheet/index.d.ts +1 -0
- package/dist/esm/types/src/packages/actionsheet/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/animatingnumbers/countup.d.ts +7 -8
- package/dist/esm/types/src/packages/animatingnumbers/countup.taro.d.ts +7 -8
- package/dist/esm/types/src/packages/animatingnumbers/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/animatingnumbers/demo.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/animatingnumbers/index.d.ts +1 -0
- package/dist/esm/types/src/packages/animatingnumbers/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/avatargroup/avatargroup.taro.d.ts +13 -0
- package/dist/esm/types/src/packages/avatargroup/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +2 -1
- package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/configprovider/index.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -0
- package/dist/esm/types/src/packages/countdown/countdown.d.ts +5 -4
- package/dist/esm/types/src/packages/countdown/countdown.taro.d.ts +5 -4
- package/dist/esm/types/src/packages/countdown/index.d.ts +1 -0
- package/dist/esm/types/src/packages/countdown/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/ellipsis/ellipsis.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/searchbar/index.d.ts +1 -0
- package/dist/esm/types/src/packages/searchbar/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/searchbar/searchbar.d.ts +4 -31
- package/dist/esm/types/src/packages/searchbar/searchbar.taro.d.ts +4 -31
- package/dist/esm/types/src/packages/shortpassword/index.d.ts +1 -0
- package/dist/esm/types/src/packages/shortpassword/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +17 -20
- package/dist/esm/types/src/packages/shortpassword/shortpassword.taro.d.ts +17 -20
- package/dist/esm/types/src/packages/toast/Notification.d.ts +9 -13
- package/dist/esm/types/src/packages/toast/index.d.ts +1 -0
- package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/toast/toast.d.ts +19 -26
- package/dist/esm/types/src/packages/toast/toast.taro.d.ts +9 -11
- package/dist/esm/types/src/packages/trendarrow/trendarrow.d.ts +8 -10
- package/dist/esm/types/src/packages/trendarrow/trendarrow.taro.d.ts +8 -10
- package/dist/esm/types/src/packages/video/index.d.ts +1 -0
- package/dist/esm/types/src/packages/video/index.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/video/video.d.ts +5 -9
- package/dist/esm/types/src/packages/video/video.taro.d.ts +6 -9
- package/dist/esm/types/src/packages/virtuallist/index.d.ts +1 -0
- package/dist/esm/types/src/packages/virtuallist/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/virtuallist/type.d.ts +0 -18
- package/dist/esm/types/src/packages/virtuallist/utils.d.ts +3 -3
- package/dist/esm/types/src/packages/virtuallist/virtuallist.d.ts +15 -4
- package/dist/esm/types/src/packages/virtuallist/virtuallist.taro.d.ts +13 -14
- package/dist/esm/types/src/packages/watermark/demo.d.ts +0 -1
- package/dist/esm/types/src/packages/watermark/demo.taro.d.ts +0 -1
- package/dist/esm/types/src/packages/watermark/index.d.ts +1 -0
- package/dist/esm/types/src/packages/watermark/index.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/watermark/watermark.d.ts +3 -4
- package/dist/esm/types/src/packages/watermark/watermark.taro.d.ts +3 -4
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/tr-TR.js +10 -2
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +525 -590
- package/dist/nutui.react.umd.js +525 -590
- package/dist/packages/actionsheet/actionsheet.scss +26 -73
- package/dist/packages/animatingnumbers/countup.scss +0 -21
- package/dist/packages/countdown/countdown.scss +2 -0
- package/dist/packages/ellipsis/ellipsis.scss +4 -0
- package/dist/packages/popup/popup.scss +98 -47
- package/dist/packages/searchbar/searchbar.scss +13 -71
- package/dist/packages/shortpassword/shortpassword.scss +1 -88
- package/dist/packages/toast/toast.scss +20 -7
- package/dist/packages/trendarrow/trendarrow.scss +4 -3
- package/dist/packages/virtuallist/virtuallist.scss +0 -12
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +58 -68
- package/dist/styles/variables.scss +32 -61
- package/dist/types/packages/actionsheet/actionsheet.d.ts +44 -16
- package/dist/types/packages/actionsheet/index.d.ts +1 -0
- package/dist/types/packages/animate/animate.d.ts +20 -4
- package/dist/types/packages/animatingnumbers/countup.d.ts +7 -8
- package/dist/types/packages/animatingnumbers/index.d.ts +1 -0
- package/dist/types/packages/audio/audio.d.ts +60 -12
- package/dist/types/packages/avatar/avatar.d.ts +50 -10
- package/dist/types/packages/avatargroup/avatargroup.d.ts +40 -8
- package/dist/types/packages/backtop/backtop.d.ts +25 -5
- package/dist/types/packages/badge/badge.d.ts +30 -6
- package/dist/types/packages/button/button.d.ts +50 -10
- package/dist/types/packages/cascader/cascader.d.ts +85 -17
- package/dist/types/packages/cell/cell.d.ts +30 -6
- package/dist/types/packages/cellgroup/cellgroup.d.ts +15 -3
- package/dist/types/packages/checkboxgroup/checkboxgroup.d.ts +40 -8
- package/dist/types/packages/circleprogress/circleprogress.d.ts +35 -7
- package/dist/types/packages/col/col.d.ts +15 -3
- package/dist/types/packages/collapse/collapse.d.ts +25 -5
- package/dist/types/packages/collapseitem/collapseitem.d.ts +20 -4
- package/dist/types/packages/configprovider/configprovider.d.ts +11 -2
- package/dist/types/packages/configprovider/index.d.ts +1 -0
- package/dist/types/packages/configprovider/types.d.ts +1 -0
- package/dist/types/packages/countdown/countdown.d.ts +68 -15
- package/dist/types/packages/countdown/index.d.ts +1 -0
- package/dist/types/packages/divider/divider.d.ts +10 -2
- package/dist/types/packages/drag/drag.d.ts +15 -3
- package/dist/types/packages/elevator/elevator.d.ts +45 -9
- package/dist/types/packages/ellipsis/ellipsis.d.ts +45 -9
- package/dist/types/packages/empty/empty.d.ts +20 -4
- package/dist/types/packages/fixednav/fixednav.d.ts +50 -10
- package/dist/types/packages/grid/grid.d.ts +35 -7
- package/dist/types/packages/griditem/griditem.d.ts +5 -1
- package/dist/types/packages/image/image.d.ts +65 -13
- package/dist/types/packages/imagepreview/imagepreview.d.ts +50 -10
- package/dist/types/packages/indicator/indicator.d.ts +15 -3
- package/dist/types/packages/input/input.d.ts +100 -20
- package/dist/types/packages/inputnumber/inputnumber.d.ts +85 -17
- package/dist/types/packages/menu/menu.d.ts +25 -5
- package/dist/types/packages/menuitem/menuitem.d.ts +35 -7
- package/dist/types/packages/noticebar/noticebar.d.ts +60 -12
- package/dist/types/packages/notify/notify.d.ts +25 -5
- package/dist/types/packages/numberkeyboard/numberkeyboard.d.ts +50 -10
- package/dist/types/packages/overlay/overlay.d.ts +40 -8
- package/dist/types/packages/pagination/pagination.d.ts +55 -11
- package/dist/types/packages/picker/picker.d.ts +55 -11
- package/dist/types/packages/popup/popup.d.ts +75 -15
- package/dist/types/packages/price/price.d.ts +35 -7
- package/dist/types/packages/progress/progress.d.ts +40 -8
- package/dist/types/packages/pulltorefresh/pulltorefresh.d.ts +50 -10
- package/dist/types/packages/radio/radio.d.ts +45 -9
- package/dist/types/packages/radiogroup/radiogroup.d.ts +30 -6
- package/dist/types/packages/range/range.d.ts +80 -16
- package/dist/types/packages/rate/rate.d.ts +50 -10
- package/dist/types/packages/searchbar/index.d.ts +1 -0
- package/dist/types/packages/searchbar/searchbar.d.ts +76 -45
- package/dist/types/packages/shortpassword/index.d.ts +1 -0
- package/dist/types/packages/shortpassword/shortpassword.d.ts +89 -24
- package/dist/types/packages/skeleton/skeleton.d.ts +35 -7
- package/dist/types/packages/step/step.d.ts +20 -4
- package/dist/types/packages/steps/steps.d.ts +15 -3
- package/dist/types/packages/sticky/sticky.d.ts +25 -5
- package/dist/types/packages/swipe/swipe.d.ts +47 -11
- package/dist/types/packages/swiper/swiper.d.ts +65 -13
- package/dist/types/packages/switch/switch.d.ts +30 -6
- package/dist/types/packages/tabbar/tabbar.d.ts +35 -7
- package/dist/types/packages/tabbaritem/tabbaritem.d.ts +10 -2
- package/dist/types/packages/tabpane/tabpane.d.ts +15 -3
- package/dist/types/packages/tabs/tabs.d.ts +60 -12
- package/dist/types/packages/textarea/textarea.d.ts +60 -12
- package/dist/types/packages/toast/Notification.d.ts +9 -13
- package/dist/types/packages/toast/index.d.ts +1 -0
- package/dist/types/packages/toast/toast.d.ts +19 -26
- package/dist/types/packages/trendarrow/trendarrow.d.ts +57 -15
- package/dist/types/packages/uploader/uploader.d.ts +180 -36
- package/dist/types/packages/video/index.d.ts +1 -0
- package/dist/types/packages/video/video.d.ts +27 -11
- package/dist/types/packages/virtuallist/index.d.ts +1 -0
- package/dist/types/packages/virtuallist/type.d.ts +0 -18
- package/dist/types/packages/virtuallist/utils.d.ts +3 -3
- package/dist/types/packages/virtuallist/virtuallist.d.ts +51 -4
- package/dist/types/packages/watermark/index.d.ts +1 -0
- package/dist/types/packages/watermark/watermark.d.ts +72 -17
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
var _excluded = ["title", "description", "tips", "
|
|
5
|
+
var _excluded = ["title", "description", "tips", "visible", "value", "error", "hideFooter", "length", "plain", "style", "className", "closeable", "autoFocus", "onFocus", "onChange", "onConfirm", "onTips", "onCancel", "onClose", "onComplete", "onClickOverlay", "onClickCloseIcon"];
|
|
6
6
|
function ownKeys(object, enumerableOnly) {
|
|
7
7
|
var keys = Object.keys(object);
|
|
8
8
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -24,171 +24,103 @@ function _objectSpread(target) {
|
|
|
24
24
|
}
|
|
25
25
|
return target;
|
|
26
26
|
}
|
|
27
|
-
import React__default, {
|
|
27
|
+
import React__default, { useMemo, useEffect } from "react";
|
|
28
28
|
import { Tips } from "@nutui/icons-react";
|
|
29
|
-
import
|
|
29
|
+
import classNames from "classnames";
|
|
30
30
|
import Popup from "./Popup.js";
|
|
31
31
|
import { useConfig } from "./ConfigProvider.js";
|
|
32
32
|
import { C as ComponentDefaults } from "./typings.js";
|
|
33
|
-
import "
|
|
33
|
+
import { u as usePropsValue } from "./use-props-value.js";
|
|
34
34
|
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
35
|
-
|
|
36
|
-
description: "",
|
|
37
|
-
tips: "",
|
|
38
|
-
tipsIcon: null,
|
|
39
|
-
iconSize: 11,
|
|
35
|
+
value: "",
|
|
40
36
|
visible: false,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
noButton: true,
|
|
44
|
-
closeOnClickOverlay: true,
|
|
37
|
+
plain: false,
|
|
38
|
+
hideFooter: true,
|
|
45
39
|
length: 6,
|
|
46
|
-
|
|
47
|
-
autoFocus: false,
|
|
48
|
-
onChange: function onChange(value) {
|
|
49
|
-
},
|
|
50
|
-
onOk: function onOk(value) {
|
|
51
|
-
},
|
|
52
|
-
onCancel: function onCancel() {
|
|
53
|
-
},
|
|
54
|
-
onClose: function onClose() {
|
|
55
|
-
},
|
|
56
|
-
onTips: function onTips() {
|
|
57
|
-
},
|
|
58
|
-
onComplete: function onComplete(value) {
|
|
59
|
-
}
|
|
40
|
+
autoFocus: false
|
|
60
41
|
});
|
|
61
42
|
var ShortPassword = function ShortPassword2(props) {
|
|
62
43
|
var _useConfig = useConfig(), locale = _useConfig.locale;
|
|
63
|
-
var title = props.title, description = props.description, tips = props.tips,
|
|
64
|
-
var
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
44
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), title = _defaultProps$props.title, description = _defaultProps$props.description, tips = _defaultProps$props.tips, visible = _defaultProps$props.visible, value = _defaultProps$props.value, error = _defaultProps$props.error, hideFooter = _defaultProps$props.hideFooter, length = _defaultProps$props.length, plain = _defaultProps$props.plain, style = _defaultProps$props.style, className = _defaultProps$props.className, closeable = _defaultProps$props.closeable, autoFocus = _defaultProps$props.autoFocus, onFocus = _defaultProps$props.onFocus, onChange = _defaultProps$props.onChange, onConfirm = _defaultProps$props.onConfirm, onTips = _defaultProps$props.onTips, onCancel = _defaultProps$props.onCancel, onClose = _defaultProps$props.onClose, onComplete = _defaultProps$props.onComplete, onClickOverlay = _defaultProps$props.onClickOverlay, onClickCloseIcon = _defaultProps$props.onClickCloseIcon, rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
45
|
+
var classPrefix = "nut-shortpassword";
|
|
46
|
+
var comLen = useMemo(function() {
|
|
47
|
+
return Math.min(Math.max(4, length || 4), 6);
|
|
48
|
+
}, [length]);
|
|
49
|
+
var format = function format2(val) {
|
|
50
|
+
return val.slice(0, comLen);
|
|
68
51
|
};
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
var _usePropsValue = usePropsValue({
|
|
53
|
+
value,
|
|
54
|
+
onChange
|
|
55
|
+
}), _usePropsValue2 = _slicedToArray(_usePropsValue, 2), inputValue = _usePropsValue2[0], setInputValue = _usePropsValue2[1];
|
|
72
56
|
useEffect(function() {
|
|
73
|
-
|
|
57
|
+
if (visible && autoFocus) {
|
|
58
|
+
onFocus && onFocus();
|
|
59
|
+
}
|
|
74
60
|
}, [visible]);
|
|
75
61
|
useEffect(function() {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, [modelValue]);
|
|
80
|
-
var changeValue = function changeValue2(e) {
|
|
81
|
-
var inputValue2 = e.target.value;
|
|
82
|
-
if (String(inputValue2).length > comLen) {
|
|
83
|
-
inputValue2 = inputValue2.slice(0, comLen);
|
|
84
|
-
}
|
|
85
|
-
setInputValue(inputValue2);
|
|
86
|
-
if (String(inputValue2).length === comLen) {
|
|
87
|
-
onComplete2 && onComplete2(inputValue2);
|
|
88
|
-
}
|
|
89
|
-
onChange2 && onChange2(inputValue2);
|
|
90
|
-
};
|
|
91
|
-
var systemStyle = function systemStyle2() {
|
|
92
|
-
var u = navigator.userAgent;
|
|
93
|
-
var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1;
|
|
94
|
-
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
95
|
-
var style2 = {};
|
|
96
|
-
if (isIOS) {
|
|
97
|
-
style2 = {
|
|
98
|
-
paddingRight: "1200px"
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
if (isAndroid) {
|
|
102
|
-
style2 = {
|
|
103
|
-
opacity: 0,
|
|
104
|
-
zIndex: 10
|
|
105
|
-
};
|
|
62
|
+
var val = format(value);
|
|
63
|
+
if (val.length >= comLen) {
|
|
64
|
+
onComplete && onComplete(val);
|
|
106
65
|
}
|
|
107
|
-
|
|
108
|
-
};
|
|
109
|
-
var focus = function focus2() {
|
|
110
|
-
if (textInput.current) {
|
|
111
|
-
textInput.current.focus();
|
|
112
|
-
}
|
|
113
|
-
};
|
|
66
|
+
setInputValue(format(value));
|
|
67
|
+
}, [value]);
|
|
114
68
|
var sure = function sure2() {
|
|
115
|
-
|
|
69
|
+
onConfirm && onConfirm(inputValue);
|
|
116
70
|
};
|
|
117
|
-
|
|
118
|
-
var size = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "11px";
|
|
119
|
-
return React__default.isValidElement(tipsIcon) ? React__default.cloneElement(tipsIcon, _objectSpread(_objectSpread({}, tipsIcon.props), {}, {
|
|
120
|
-
width: size,
|
|
121
|
-
height: size
|
|
122
|
-
})) : React__default.createElement(Tips, {
|
|
123
|
-
width: size,
|
|
124
|
-
height: size
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
return React__default.createElement("div", null, React__default.createElement(Popup, {
|
|
71
|
+
return React__default.createElement(Popup, _objectSpread({
|
|
128
72
|
style: {
|
|
129
73
|
padding: "32px 24px 28px 24px",
|
|
130
74
|
borderRadius: "12px",
|
|
131
75
|
textAlign: "center"
|
|
132
76
|
},
|
|
133
|
-
visible
|
|
77
|
+
visible,
|
|
134
78
|
closeable: true,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
className: b("title")
|
|
79
|
+
onClickOverlay: onClose,
|
|
80
|
+
onClickCloseIcon: onClose
|
|
81
|
+
}, rest), React__default.createElement("div", {
|
|
82
|
+
className: classNames(className, classPrefix),
|
|
83
|
+
style
|
|
84
|
+
}, React__default.createElement("div", {
|
|
85
|
+
className: "".concat(classPrefix, "__title")
|
|
143
86
|
}, title || locale.shortpassword.title), React__default.createElement("div", {
|
|
144
|
-
className:
|
|
87
|
+
className: "".concat(classPrefix, "__description")
|
|
145
88
|
}, description || locale.shortpassword.description), React__default.createElement("div", {
|
|
146
|
-
className:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
className:
|
|
150
|
-
type: "number",
|
|
151
|
-
style: systemStyle(),
|
|
152
|
-
maxLength: 6,
|
|
153
|
-
value: inputValue,
|
|
154
|
-
autoFocus,
|
|
155
|
-
onChange: function onChange3(e) {
|
|
156
|
-
return changeValue(e);
|
|
157
|
-
}
|
|
158
|
-
}), React__default.createElement("div", {
|
|
159
|
-
className: b("input-site")
|
|
89
|
+
className: "".concat(classPrefix, "__input"),
|
|
90
|
+
onClick: onFocus
|
|
91
|
+
}, React__default.createElement("div", {
|
|
92
|
+
className: "".concat(classPrefix, "__input-site")
|
|
160
93
|
}), React__default.createElement("div", {
|
|
161
|
-
className:
|
|
162
|
-
onClick: function onClick() {
|
|
163
|
-
return focus();
|
|
164
|
-
}
|
|
94
|
+
className: "".concat(classPrefix, "__input-fake")
|
|
165
95
|
}, _toConsumableArray(new Array(comLen).keys()).map(function(item, index) {
|
|
166
96
|
return React__default.createElement("div", {
|
|
167
|
-
className:
|
|
97
|
+
className: "".concat(classPrefix, "__input-fake__li"),
|
|
168
98
|
key: index
|
|
169
|
-
},
|
|
170
|
-
className:
|
|
171
|
-
})
|
|
99
|
+
}, inputValue.length > index && React__default.createElement(React__default.Fragment, null, plain ? inputValue[index] : React__default.createElement("div", {
|
|
100
|
+
className: "".concat(classPrefix, "__input-fake__li__icon")
|
|
101
|
+
})));
|
|
172
102
|
}))), React__default.createElement("div", {
|
|
173
|
-
className:
|
|
103
|
+
className: "".concat(classPrefix, "__message")
|
|
174
104
|
}, React__default.createElement("div", {
|
|
175
|
-
className:
|
|
176
|
-
},
|
|
177
|
-
className:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
105
|
+
className: "".concat(classPrefix, "__message__error")
|
|
106
|
+
}, error), React__default.createElement("div", {
|
|
107
|
+
className: "".concat(classPrefix, "__message__forget"),
|
|
108
|
+
onClick: onTips
|
|
109
|
+
}, tips || React__default.createElement(React__default.Fragment, null, React__default.createElement(Tips, {
|
|
110
|
+
width: 11,
|
|
111
|
+
height: 11,
|
|
112
|
+
style: {
|
|
113
|
+
marginRight: "3px"
|
|
114
|
+
}
|
|
115
|
+
}), locale.shortpassword.tips))), !hideFooter && React__default.createElement("div", {
|
|
116
|
+
className: "".concat(classPrefix, "__footer")
|
|
183
117
|
}, React__default.createElement("div", {
|
|
184
|
-
className:
|
|
185
|
-
onClick:
|
|
118
|
+
className: "".concat(classPrefix, "__footer__cancel"),
|
|
119
|
+
onClick: onCancel
|
|
186
120
|
}, locale.cancel), React__default.createElement("div", {
|
|
187
|
-
className:
|
|
188
|
-
onClick:
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
}, locale.confirm)) : null)));
|
|
121
|
+
className: "".concat(classPrefix, "__footer__sure"),
|
|
122
|
+
onClick: sure
|
|
123
|
+
}, locale.confirm))));
|
|
192
124
|
};
|
|
193
125
|
ShortPassword.defaultProps = defaultProps;
|
|
194
126
|
ShortPassword.displayName = "NutShortPassword";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nut-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--nutui-overlay-bg-color, var(--nutui-gray-7, rgba(0, 0, 0, .7)))}.nut-overlay-fade-enter-active{animation:nut-fade-in}.nut-overlay-fade-enter-active .wrapper .content{background-color:var(--nutui-overlay-content-bg-color, var(--nutui-gray-6, #ffffff));color:var(--nutui-overlay-content-color, var(--nutui-gray-1, #1a1a1a))}.nut-overlay-fade-leave-active{animation:nut-fade-out}.nut-overlay-first-render,.nut-overlay-hidden-render{display:none}@keyframes nut-fade-in{0%{opacity:0}1%{opacity:0}to{opacity:1}}@keyframes nut-fade-out{0%{opacity:1}1%{opacity:1}to{opacity:0}}.nut-popup{position:fixed;max-height:100%;overflow-y:auto;background-color:var(--nutui-gray-6, #ffffff);color:var(--nutui-gray-1, #1a1a1a);-webkit-overflow-scrolling:touch}.nut-popup__close-icon{position:absolute!important;z-index:1;color:var(--nutui-popup-close-icon-color, #969799);cursor:pointer;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.nut-popup__close-icon:active{opacity:.7}.nut-popup__close-icon--top-left{top:var(--nutui-popup-close-icon-margin, 16px);left:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--top-right{top:var(--nutui-popup-close-icon-margin, 16px);right:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-left{bottom:var(--nutui-popup-close-icon-margin, 16px);left:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-right{right:var(--nutui-popup-close-icon-margin, 16px);bottom:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup-center{top:50%;left:50%;transform:translate(-50%,-50%)}.nut-popup-center.round{border-radius:var(--nutui-popup-border-radius, 20px)}.nut-popup-bottom{bottom:0;left:0;width:100%}.nut-popup-bottom.round{border-radius:var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px) 0 0}.nut-popup-right{top:0;right:0}.nut-popup-right.round{border-radius:var(--nutui-popup-border-radius, 20px) 0 0 var(--nutui-popup-border-radius, 20px)}.nut-popup-left{top:0;left:0}.nut-popup-left.round{border-radius:0 var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px) 0}.nut-popup-top{top:0;left:0;width:100%}.nut-popup-top.round{border-radius:0 0 var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px)}
|
|
1
|
+
.nut-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--nutui-overlay-bg-color, var(--nutui-gray-7, rgba(0, 0, 0, .7)))}.nut-overlay-fade-enter-active{animation:nut-fade-in}.nut-overlay-fade-enter-active .wrapper .content{background-color:var(--nutui-overlay-content-bg-color, var(--nutui-gray-6, #ffffff));color:var(--nutui-overlay-content-color, var(--nutui-gray-1, #1a1a1a))}.nut-overlay-fade-leave-active{animation:nut-fade-out}.nut-overlay-first-render,.nut-overlay-hidden-render{display:none}@keyframes nut-fade-in{0%{opacity:0}1%{opacity:0}to{opacity:1}}@keyframes nut-fade-out{0%{opacity:1}1%{opacity:1}to{opacity:0}}.nut-popup{position:fixed;max-height:100%;overflow-y:auto;background-color:var(--nutui-gray-6, #ffffff);color:var(--nutui-gray-1, #1a1a1a);-webkit-overflow-scrolling:touch}.nut-popup__close-icon{position:absolute!important;z-index:1;color:var(--nutui-popup-close-icon-color, #969799);cursor:pointer;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.nut-popup__close-icon:active{opacity:.7}.nut-popup__close-icon--top-left{top:var(--nutui-popup-close-icon-margin, 16px);left:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--top-right{top:var(--nutui-popup-close-icon-margin, 16px);right:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-left{bottom:var(--nutui-popup-close-icon-margin, 16px);left:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-right{right:var(--nutui-popup-close-icon-margin, 16px);bottom:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup-center{top:50%;left:50%;transform:translate(-50%,-50%)}.nut-popup-center.round{border-radius:var(--nutui-popup-border-radius, 20px)}.nut-popup-bottom{bottom:0;left:0;width:100%}.nut-popup-bottom.round{border-radius:var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px) 0 0}.nut-popup-right{top:0;right:0}.nut-popup-right.round{border-radius:var(--nutui-popup-border-radius, 20px) 0 0 var(--nutui-popup-border-radius, 20px)}.nut-popup-left{top:0;left:0}.nut-popup-left.round{border-radius:0 var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px) 0}.nut-popup-top{top:0;left:0;width:100%}.nut-popup-top.round{border-radius:0 0 var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px)}@keyframes popup-fade-in{0%{opacity:0}to{opacity:1}}@keyframes popup-fade-out{0%{opacity:1}to{opacity:0}}.nut-popup-slide-center-enter-active{animation-fill-mode:both;animation-name:popup-fade-in;animation-duration:.3s}.nut-popup-slide-center-exit-active{animation-fill-mode:both;animation-name:popup-fade-out;animation-duration:.3s}@keyframes popup-slide-top-enter{0%{transform:translate3d(0,-100%,0)}}@keyframes popup-slide-top-exit{to{transform:translate3d(0,-100%,0)}}.nut-popup-slide-top-enter-active,.nut-popup-slide-top-appear-active{transform:translateZ(0);animation-fill-mode:both;animation-name:popup-slide-top-enter;animation-duration:.3s}.nut-popup-slide-top-exit-active{animation-fill-mode:both;animation-name:popup-slide-top-exit;animation-duration:.3s}@keyframes popup-slide-right-enter{0%{transform:translate3d(100%,0,0)}}@keyframes popup-slide-right-exit{to{transform:translate3d(100%,0,0)}}.nut-popup-slide-right-enter-active,.nut-popup-slide-right-appear-active{transform:translateZ(0);animation-fill-mode:both;animation-name:popup-slide-right-enter;animation-duration:.3s}.nut-popup-slide-right-exit{animation-fill-mode:both;animation-name:popup-slide-right-exit;animation-duration:.3s}@keyframes popup-slide-bottom-enter{0%{transform:translate3d(0,100%,0)}}@keyframes slide-bottom-exit{to{transform:translate3d(0,100%,0)}}.nut-popup-slide-bottom-enter-active,.nut-popup-slide-bottom-appear-active{transform:translate(0);animation-fill-mode:both;animation-name:popup-slide-bottom-enter;animation-duration:.3s}.nut-popup-slide-bottom-exit{animation-fill-mode:both;animation-name:slide-bottom-exit;animation-duration:.3s}@keyframes popup-slide-left-enter{0%{transform:translate3d(-100%,0,0)}}@keyframes popup-slide-left-exit{to{transform:translate3d(-100%,0,0)}}.nut-popup-slide-left-enter-active,.nut-popup-slide-left-appear-active{transform:translate(0);animation-fill-mode:both;animation-name:popup-slide-left-enter;animation-duration:.3s}.nut-popup-slide-left-exit-active,.nut-popup-slide-left-exit-done{animation-fill-mode:both;animation-name:popup-slide-left-exit;animation-duration:.3s}.nut-overflow-hidden{overflow:hidden!important}.nut-sidenavbar{color:#1d1d21;font-size:14px;height:100%;overflow:auto;display:block;background-color:var(--nutui-gray-6, #ffffff)}.nut-sidenavbar .arrow-icon{position:absolute;width:0;height:0;right:16px;top:18px;cursor:pointer}.nut-sidenavbar .arrow-down{border-top:4px solid #909ca4;border-left:4px solid transparent;border-right:4px solid transparent}.nut-sidenavbar .arrow-up{border-bottom:4px solid #909ca4;border-left:4px solid transparent;border-right:4px solid transparent}.nut-sidenavbar__head{height:40px;background:#eeeff2;padding:10px}.nut-sidenavbar__title{height:40px;padding:10px 8px 10px 20px;background:var(--nutui-gray-4, #f4f4f4);color:var(--nutui-gray-1, #1a1a1a)}.nut-sidenavbar__content{position:relative;display:block}.nut-sidenavbar__list.nutShow .nut-sidenavbar__content{height:auto;overflow:inherit}.nut-sidenavbar__list.nutHide .nut-sidenavbar__content{height:0;overflow:hidden}.nut-sidenavbar .border-bt{position:relative}.nut-sidenavbar .border-bt:after{content:"";position:absolute;width:100%;height:1px;background:#eeeff2;transform:scaleY(.5);left:0;bottom:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nut-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--nutui-overlay-bg-color, var(--nutui-gray-7, rgba(0, 0, 0, .7)))}.nut-overlay-fade-enter-active{animation:nut-fade-in}.nut-overlay-fade-enter-active .wrapper .content{background-color:var(--nutui-overlay-content-bg-color, var(--nutui-gray-6, #ffffff));color:var(--nutui-overlay-content-color, var(--nutui-gray-1, #1a1a1a))}.nut-overlay-fade-leave-active{animation:nut-fade-out}.nut-overlay-first-render,.nut-overlay-hidden-render{display:none}@keyframes nut-fade-in{0%{opacity:0}1%{opacity:0}to{opacity:1}}@keyframes nut-fade-out{0%{opacity:1}1%{opacity:1}to{opacity:0}}.nut-popup{position:fixed;max-height:100%;overflow-y:auto;background-color:var(--nutui-gray-6, #ffffff);color:var(--nutui-gray-1, #1a1a1a);-webkit-overflow-scrolling:touch}.nut-popup__close-icon{position:absolute!important;z-index:1;color:var(--nutui-popup-close-icon-color, #969799);cursor:pointer;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.nut-popup__close-icon:active{opacity:.7}.nut-popup__close-icon--top-left{top:var(--nutui-popup-close-icon-margin, 16px);left:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--top-right{top:var(--nutui-popup-close-icon-margin, 16px);right:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-left{bottom:var(--nutui-popup-close-icon-margin, 16px);left:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-right{right:var(--nutui-popup-close-icon-margin, 16px);bottom:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup-center{top:50%;left:50%;transform:translate(-50%,-50%)}.nut-popup-center.round{border-radius:var(--nutui-popup-border-radius, 20px)}.nut-popup-bottom{bottom:0;left:0;width:100%}.nut-popup-bottom.round{border-radius:var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px) 0 0}.nut-popup-right{top:0;right:0}.nut-popup-right.round{border-radius:var(--nutui-popup-border-radius, 20px) 0 0 var(--nutui-popup-border-radius, 20px)}.nut-popup-left{top:0;left:0}.nut-popup-left.round{border-radius:0 var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px) 0}.nut-popup-top{top:0;left:0;width:100%}.nut-popup-top.round{border-radius:0 0 var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px)}
|
|
1
|
+
.nut-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--nutui-overlay-bg-color, var(--nutui-gray-7, rgba(0, 0, 0, .7)))}.nut-overlay-fade-enter-active{animation:nut-fade-in}.nut-overlay-fade-enter-active .wrapper .content{background-color:var(--nutui-overlay-content-bg-color, var(--nutui-gray-6, #ffffff));color:var(--nutui-overlay-content-color, var(--nutui-gray-1, #1a1a1a))}.nut-overlay-fade-leave-active{animation:nut-fade-out}.nut-overlay-first-render,.nut-overlay-hidden-render{display:none}@keyframes nut-fade-in{0%{opacity:0}1%{opacity:0}to{opacity:1}}@keyframes nut-fade-out{0%{opacity:1}1%{opacity:1}to{opacity:0}}.nut-popup{position:fixed;max-height:100%;overflow-y:auto;background-color:var(--nutui-gray-6, #ffffff);color:var(--nutui-gray-1, #1a1a1a);-webkit-overflow-scrolling:touch}.nut-popup__close-icon{position:absolute!important;z-index:1;color:var(--nutui-popup-close-icon-color, #969799);cursor:pointer;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.nut-popup__close-icon:active{opacity:.7}.nut-popup__close-icon--top-left{top:var(--nutui-popup-close-icon-margin, 16px);left:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--top-right{top:var(--nutui-popup-close-icon-margin, 16px);right:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-left{bottom:var(--nutui-popup-close-icon-margin, 16px);left:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup__close-icon--bottom-right{right:var(--nutui-popup-close-icon-margin, 16px);bottom:var(--nutui-popup-close-icon-margin, 16px)}.nut-popup-center{top:50%;left:50%;transform:translate(-50%,-50%)}.nut-popup-center.round{border-radius:var(--nutui-popup-border-radius, 20px)}.nut-popup-bottom{bottom:0;left:0;width:100%}.nut-popup-bottom.round{border-radius:var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px) 0 0}.nut-popup-right{top:0;right:0}.nut-popup-right.round{border-radius:var(--nutui-popup-border-radius, 20px) 0 0 var(--nutui-popup-border-radius, 20px)}.nut-popup-left{top:0;left:0}.nut-popup-left.round{border-radius:0 var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px) 0}.nut-popup-top{top:0;left:0;width:100%}.nut-popup-top.round{border-radius:0 0 var(--nutui-popup-border-radius, 20px) var(--nutui-popup-border-radius, 20px)}@keyframes popup-fade-in{0%{opacity:0}to{opacity:1}}@keyframes popup-fade-out{0%{opacity:1}to{opacity:0}}.nut-popup-slide-center-enter-active{animation-fill-mode:both;animation-name:popup-fade-in;animation-duration:.3s}.nut-popup-slide-center-exit-active{animation-fill-mode:both;animation-name:popup-fade-out;animation-duration:.3s}@keyframes popup-slide-top-enter{0%{transform:translate3d(0,-100%,0)}}@keyframes popup-slide-top-exit{to{transform:translate3d(0,-100%,0)}}.nut-popup-slide-top-enter-active,.nut-popup-slide-top-appear-active{transform:translateZ(0);animation-fill-mode:both;animation-name:popup-slide-top-enter;animation-duration:.3s}.nut-popup-slide-top-exit-active{animation-fill-mode:both;animation-name:popup-slide-top-exit;animation-duration:.3s}@keyframes popup-slide-right-enter{0%{transform:translate3d(100%,0,0)}}@keyframes popup-slide-right-exit{to{transform:translate3d(100%,0,0)}}.nut-popup-slide-right-enter-active,.nut-popup-slide-right-appear-active{transform:translateZ(0);animation-fill-mode:both;animation-name:popup-slide-right-enter;animation-duration:.3s}.nut-popup-slide-right-exit{animation-fill-mode:both;animation-name:popup-slide-right-exit;animation-duration:.3s}@keyframes popup-slide-bottom-enter{0%{transform:translate3d(0,100%,0)}}@keyframes slide-bottom-exit{to{transform:translate3d(0,100%,0)}}.nut-popup-slide-bottom-enter-active,.nut-popup-slide-bottom-appear-active{transform:translate(0);animation-fill-mode:both;animation-name:popup-slide-bottom-enter;animation-duration:.3s}.nut-popup-slide-bottom-exit{animation-fill-mode:both;animation-name:slide-bottom-exit;animation-duration:.3s}@keyframes popup-slide-left-enter{0%{transform:translate3d(-100%,0,0)}}@keyframes popup-slide-left-exit{to{transform:translate3d(-100%,0,0)}}.nut-popup-slide-left-enter-active,.nut-popup-slide-left-appear-active{transform:translate(0);animation-fill-mode:both;animation-name:popup-slide-left-enter;animation-duration:.3s}.nut-popup-slide-left-exit-active,.nut-popup-slide-left-exit-done{animation-fill-mode:both;animation-name:popup-slide-left-exit;animation-duration:.3s}.nut-overflow-hidden{overflow:hidden!important}.nut-theme-dark .nut-timepannel{background-color:#141414;color:#828282}.nut-theme-dark .nut-timepannel--curr{background-color:#141414;color:#e6e6e6}.nut-timepannel{height:var(--nutui-timeselect-timepannel-height, 40px);line-height:40px;text-align:center;color:var(--nutui-timeselect-timepannel-text-color, var(--nutui-gray-2, #757575));font-size:var(--nutui-timeselect-timepannel-font-size, var(--nutui-font-size-2, 14px))}.nut-theme-dark .nut-timedetail{background-color:#1f1f1f}.nut-theme-dark .nut-timedetail__detail__list__item{background-color:#0a0a0a;color:#e6e6e6}.nut-theme-dark .nut-timedetail__detail__list__item--curr{color:var(--nutui-timeselect-timedetail-item-cur-text-color, var(--nutui-brand-color, #fa2c19))}.nut-timedetail{display:flex;align-content:flex-start;flex-wrap:wrap;padding:0 0 50px 13px}.nut-timedetail__item{width:100px;height:50px;line-height:50px;text-align:center;margin-right:10px;margin-bottom:10px;background-color:var(--nutui-gray-4, #f4f4f4);color:var(--nutui-gray-1, #1a1a1a);border-radius:5px;font-size:14px;border:1px solid transparent;font-weight:700}.nut-timedetail__item-active{background-color:#fa2c19}.nut-timedetail__item-active{background-color:var(--nutui-brand-color-opacity);border:1px solid var(--nutui-brand-color, #fa2c19);color:var(--nutui-brand-color, #fa2c19)}.nut-theme-dark .nut-timeselect{background-color:#1f1f1f}.nut-theme-dark .nut-timeselect__title{background-color:#1f1f1f;color:#e6e6e6}.nut-theme-dark .nut-timeselect__content-left{background-color:#141414;color:#e6e6e6}.nut-theme-dark .nut-timeselect__content-left .nut-timepannel-active{background-color:#1f1f1f;color:#e6e6e6}.nut-theme-dark .nut-timedetail__item{background-color:#0a0a0a;color:#e6e6e6}.nut-theme-dark .nut-timedetail__item-active{background-color:#fa2c19}.nut-timeselect{background-color:var(--nutui-gray-6, #ffffff);display:flex;flex-direction:column;height:100%}.nut-timeselect__title{height:var(--nutui-timeselect-title-height, 50px);line-height:var(--nutui-timeselect-title-line-height, 50px);margin-bottom:10px;font-size:var(--nutui-timeselect-title-font-size, var(--nutui-font-size-2, 14px));background-color:var(--nutui-gray-6, #ffffff);color:var(--nutui-gray-1, #1a1a1a);text-align:center}.nut-timeselect__content{display:flex;flex:1}.nut-timeselect__content-left{width:140px;min-width:140px;height:100%;overflow:auto;background-color:var(--nutui-gray-5, #f8f8f8);color:var(--nutui-gray-1, #1a1a1a)}.nut-timeselect__content-left .nut-timepannel-active{background-color:var(--nutui-brand-color, #fa2c19)}.nut-timeselect .nut-timepannel-active{background-color:var(--nutui-gray-6, #ffffff);color:var(--nutui-gray-1, #1a1a1a);font-weight:700}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}.nut-toast{position:fixed;left:0;
|
|
1
|
+
@keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}.nut-toast{position:fixed;left:0;top:0;width:100%;height:100%;text-align:center;pointer-events:none;z-index:9999}.nut-toast__overlay-default{--nutui-overlay-bg-color: rgba(0, 0, 0, 0)}.nut-toast-small .nut-toast__inner{font-size:var(--nutui-font-size-1, 12px)}.nut-toast-large .nut-toast__inner{font-size:var(--nutui-font-size-3, 16px)}.nut-toast-cover{display:flex;align-items:center;justify-content:center;pointer-events:none;height:100%;background:var(--nutui-toast-cover-bg-color, var(--nutui-gray-7, rgba(0, 0, 0, .7)))}.nut-toast__inner{display:inline-block;font-size:var(--nutui-toast-text-font-size, 14px);min-width:40%;max-width:65%;text-align:var(--nutui-toast-inner-text-align, "center");padding:var(--nutui-toast-inner-padding, 24px 30px);word-break:break-all;background:var(--nutui-toast-inner-bg-color, var(--nutui-gray-7, rgba(0, 0, 0, .7)));border-radius:var(--nutui-toast-inner-border-radius, 12px);color:var(--nutui-toast-font-color, #fff);position:absolute;left:50%;top:var(--nutui-toast-inner-top, 50%);transform:translate(-50%,-50%)}.nut-toast-center{top:var(--nutui-toast-inner-top, 50%)}.nut-toast-bottom{top:var(--nutui-toast-inner-top, 80%)}.nut-toast-top{top:var(--nutui-toast-inner-top, 20%)}.nut-toast-text{font-size:var(--nutui-toast-text-font-size, 14px)}.nut-toast-text:empty{margin-bottom:-8px}.nut-toast-title{font-size:var(--nutui-toast-title-font-size, 16px)}.nut-toast-title:empty{margin-bottom:-8px}.nut-toast-has-icon .nut-toast__icon-wrapper{width:100%;display:flex;align-items:center;justify-content:center;margin-bottom:8px}.nut-toast-loading .nut-toast__inner{display:inline-flex;flex-direction:column;justify-content:center;align-items:center}.nut-toast-loading .nut-toast__icon-wrapper{animation:rotation 2s linear infinite}.toast-fade-enter-active,.toast-fade-leave-active{transition:opacity .3s}.toast-fade-enter-from,.toast-fade-leave-to{opacity:0}
|
package/dist/esm/Toast.js
CHANGED
|
@@ -56,11 +56,12 @@ function _isNativeReflectConstruct() {
|
|
|
56
56
|
}
|
|
57
57
|
import * as React from "react";
|
|
58
58
|
import classNames from "classnames";
|
|
59
|
-
import { c as cn } from "./bem.js";
|
|
60
59
|
import { r as render, u as unmount } from "./render.js";
|
|
61
|
-
import {
|
|
62
|
-
import "@
|
|
60
|
+
import { O as Overlay } from "./overlay2.js";
|
|
61
|
+
import { Issue, Failure, Loading, Check } from "@nutui/icons-react";
|
|
62
|
+
import { C as ComponentDefaults } from "./typings.js";
|
|
63
63
|
import "react-dom";
|
|
64
|
+
var classPrefix = "nut-toast";
|
|
64
65
|
var Notification = /* @__PURE__ */ function(_React$PureComponent) {
|
|
65
66
|
_inherits(Notification2, _React$PureComponent);
|
|
66
67
|
var _super = _createSuper(Notification2);
|
|
@@ -104,11 +105,39 @@ var Notification = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
104
105
|
}, {
|
|
105
106
|
key: "clickCover",
|
|
106
107
|
value: function clickCover() {
|
|
107
|
-
var
|
|
108
|
-
if (
|
|
108
|
+
var closeOnOverlayClick = this.props.closeOnOverlayClick;
|
|
109
|
+
if (closeOnOverlayClick) {
|
|
109
110
|
this.close();
|
|
110
111
|
}
|
|
111
112
|
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "renderIcon",
|
|
115
|
+
value: function renderIcon() {
|
|
116
|
+
var icon = this.props.icon;
|
|
117
|
+
if (typeof icon === "string") {
|
|
118
|
+
var iconNode = null;
|
|
119
|
+
switch (icon) {
|
|
120
|
+
case "success":
|
|
121
|
+
iconNode = React.createElement(Check, null);
|
|
122
|
+
break;
|
|
123
|
+
case "loading":
|
|
124
|
+
iconNode = React.createElement(Loading, {
|
|
125
|
+
className: "nut-icon-loading"
|
|
126
|
+
});
|
|
127
|
+
break;
|
|
128
|
+
case "fail":
|
|
129
|
+
iconNode = React.createElement(Failure, null);
|
|
130
|
+
break;
|
|
131
|
+
case "warn":
|
|
132
|
+
iconNode = React.createElement(Issue, null);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
return React.createElement("p", {
|
|
136
|
+
className: "".concat(classPrefix, "__icon-wrapper")
|
|
137
|
+
}, iconNode);
|
|
138
|
+
}
|
|
139
|
+
return icon;
|
|
140
|
+
}
|
|
112
141
|
}, {
|
|
113
142
|
key: "componentDidMount",
|
|
114
143
|
value: function componentDidMount() {
|
|
@@ -122,38 +151,31 @@ var Notification = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
122
151
|
}, {
|
|
123
152
|
key: "render",
|
|
124
153
|
value: function render2() {
|
|
125
|
-
var
|
|
126
|
-
var _this$props = this.props, id = _this$props.id,
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
135
|
-
className: "".concat(toastBem(), " ").concat(classes),
|
|
136
|
-
id: "toast-".concat(id),
|
|
137
|
-
style: _objectSpread({
|
|
138
|
-
bottom: center ? "auto" : "".concat(bottom),
|
|
139
|
-
backgroundColor: cover ? coverColor : ""
|
|
140
|
-
}, style),
|
|
154
|
+
var _this3 = this;
|
|
155
|
+
var _this$props = this.props, id = _this$props.id, icon = _this$props.icon, title = _this$props.title, content = _this$props.content, position = _this$props.position, size = _this$props.size, closeOnOverlayClick = _this$props.closeOnOverlayClick, style = _this$props.style, className = _this$props.className, contentClassName = _this$props.contentClassName, contentStyle = _this$props.contentStyle;
|
|
156
|
+
var classes = classNames(_defineProperty({
|
|
157
|
+
"nut-toast-has-icon": icon
|
|
158
|
+
}, "nut-toast-".concat(size), true));
|
|
159
|
+
return React.createElement(React.Fragment, null, React.createElement(Overlay, {
|
|
160
|
+
visible: true,
|
|
161
|
+
style,
|
|
162
|
+
className: "".concat(classPrefix, "__overlay-default ").concat(className),
|
|
141
163
|
onClick: function onClick() {
|
|
164
|
+
console.log("onclick");
|
|
142
165
|
_this3.clickCover();
|
|
143
|
-
}
|
|
166
|
+
},
|
|
167
|
+
closeOnOverlayClick
|
|
144
168
|
}, React.createElement("div", {
|
|
145
|
-
className:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
},
|
|
151
|
-
className:
|
|
152
|
-
}, icon) : null, title ? React.createElement("div", {
|
|
153
|
-
className: "nut-toast-title"
|
|
169
|
+
className: "".concat(classPrefix, " ").concat(classes),
|
|
170
|
+
id: "toast-".concat(id)
|
|
171
|
+
}, React.createElement("div", {
|
|
172
|
+
className: "".concat(classPrefix, "__inner ").concat(classPrefix, "-").concat(position, " ").concat(contentClassName),
|
|
173
|
+
style: contentStyle
|
|
174
|
+
}, this.renderIcon(), title ? React.createElement("div", {
|
|
175
|
+
className: "".concat(classPrefix, "-title")
|
|
154
176
|
}, title) : null, React.createElement("span", {
|
|
155
|
-
className:
|
|
156
|
-
},
|
|
177
|
+
className: "".concat(classPrefix, "-text")
|
|
178
|
+
}, content)))));
|
|
157
179
|
}
|
|
158
180
|
}]);
|
|
159
181
|
return Notification2;
|
|
@@ -184,29 +206,18 @@ Notification.newInstance = function(properties, callback) {
|
|
|
184
206
|
})), element);
|
|
185
207
|
};
|
|
186
208
|
var messageInstance = null;
|
|
187
|
-
var options = {
|
|
188
|
-
msg: "",
|
|
209
|
+
var options = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
189
210
|
id: "",
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
center: true,
|
|
193
|
-
type: "text",
|
|
211
|
+
duration: 2,
|
|
212
|
+
position: "center",
|
|
194
213
|
title: "",
|
|
195
|
-
customClass: "",
|
|
196
|
-
bottom: "30px",
|
|
197
214
|
size: "base",
|
|
198
215
|
icon: null,
|
|
199
|
-
iconSize: "20",
|
|
200
|
-
textAlignCenter: true,
|
|
201
|
-
loadingRotate: true,
|
|
202
|
-
bgColor: "rgba(0, 0, 0, .8)",
|
|
203
216
|
onClose: function onClose() {
|
|
204
217
|
},
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
// 是否点击遮罩可关闭
|
|
209
|
-
};
|
|
218
|
+
closeOnOverlayClick: false,
|
|
219
|
+
contentClassName: ""
|
|
220
|
+
});
|
|
210
221
|
function getInstance(props, callback) {
|
|
211
222
|
if (messageInstance) {
|
|
212
223
|
messageInstance.destroy();
|
|
@@ -221,6 +232,7 @@ function notice(opts) {
|
|
|
221
232
|
if (messageInstance) {
|
|
222
233
|
messageInstance.destroy();
|
|
223
234
|
messageInstance = null;
|
|
235
|
+
opts.onClose && opts.onClose();
|
|
224
236
|
}
|
|
225
237
|
}
|
|
226
238
|
var opts2 = _objectSpread(_objectSpread(_objectSpread({}, options), opts), {}, {
|
|
@@ -235,59 +247,31 @@ var errorMsg = function errorMsg2(msg) {
|
|
|
235
247
|
console.warn("[NutUI Toast]: msg cannot be null");
|
|
236
248
|
}
|
|
237
249
|
};
|
|
250
|
+
function show(option) {
|
|
251
|
+
if (typeof option === "string") {
|
|
252
|
+
errorMsg(option);
|
|
253
|
+
return notice({
|
|
254
|
+
content: option
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
errorMsg(option.content);
|
|
258
|
+
return notice(_objectSpread({}, option));
|
|
259
|
+
}
|
|
260
|
+
function config(config2) {
|
|
261
|
+
if (config2.duration !== void 0) {
|
|
262
|
+
options.duration = config2.duration;
|
|
263
|
+
}
|
|
264
|
+
if (config2.position !== void 0) {
|
|
265
|
+
options.position = config2.position;
|
|
266
|
+
}
|
|
267
|
+
if (config2.closeOnOverlayClick !== void 0) {
|
|
268
|
+
options.closeOnOverlayClick = config2.closeOnOverlayClick;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
238
271
|
var Toast = {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
return notice(_objectSpread({
|
|
243
|
-
msg,
|
|
244
|
-
type: "text"
|
|
245
|
-
}, option));
|
|
246
|
-
},
|
|
247
|
-
success: function success(msg) {
|
|
248
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
249
|
-
errorMsg(msg);
|
|
250
|
-
return notice(_objectSpread({
|
|
251
|
-
msg,
|
|
252
|
-
icon: "success",
|
|
253
|
-
type: "success"
|
|
254
|
-
}, option));
|
|
255
|
-
},
|
|
256
|
-
fail: function fail(msg) {
|
|
257
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
258
|
-
errorMsg(msg);
|
|
259
|
-
return notice(_objectSpread({
|
|
260
|
-
msg,
|
|
261
|
-
icon: "failure",
|
|
262
|
-
type: "fail"
|
|
263
|
-
}, option));
|
|
264
|
-
},
|
|
265
|
-
loading: function loading(msg) {
|
|
266
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
267
|
-
errorMsg(msg);
|
|
268
|
-
return notice(_objectSpread({
|
|
269
|
-
msg,
|
|
270
|
-
icon: React.createElement(Loading, null),
|
|
271
|
-
type: "loading"
|
|
272
|
-
}, option));
|
|
273
|
-
},
|
|
274
|
-
warn: function warn(msg) {
|
|
275
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
276
|
-
errorMsg(msg);
|
|
277
|
-
return notice(_objectSpread({
|
|
278
|
-
msg,
|
|
279
|
-
icon: "tips",
|
|
280
|
-
type: "warn"
|
|
281
|
-
}, option));
|
|
282
|
-
},
|
|
283
|
-
customIcon: function customIcon(msg) {
|
|
284
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
285
|
-
errorMsg(msg);
|
|
286
|
-
return notice(_objectSpread({
|
|
287
|
-
msg
|
|
288
|
-
}, option));
|
|
289
|
-
},
|
|
290
|
-
hide: function hide() {
|
|
272
|
+
show,
|
|
273
|
+
config,
|
|
274
|
+
clear: function clear() {
|
|
291
275
|
if (messageInstance) {
|
|
292
276
|
messageInstance.destroy();
|
|
293
277
|
messageInstance = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nut-trendarrow{display:inline-
|
|
1
|
+
.nut-trendarrow{display:inline-flex;align-items:center;font-size:var(--nutui-trendarrow-font-size, 14px)}.nut-trendarrow__icon-before{margin-right:var(--nutui-trendarrow-icon-margin, 4px)}.nut-trendarrow__icon-after{margin-left:var(--nutui-trendarrow-icon-margin, 4px)}.nut-trendarrow__rate{vertical-align:middle;display:inline}.nut-trendarrow .nut-icon{vertical-align:middle}
|