@nutui/nutui-react 1.2.3-beta.3 → 1.3.0
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/Avatar.js +7 -5
- package/dist/esm/CalendarItem.js +19 -15
- package/dist/esm/CheckboxGroup.js +0 -1
- package/dist/esm/Drag.js +1 -1
- package/dist/esm/Icon/style/index.js +1 -0
- package/dist/esm/Icon.js +2 -2
- package/dist/esm/Infiniteloading.js +6 -5
- package/dist/esm/Input.js +8 -2
- package/dist/esm/InputNumber.js +11 -11
- package/dist/esm/NoticeBar.js +67 -28
- package/dist/esm/Notify.js +17 -3
- package/dist/esm/Picker.js +9 -4
- package/dist/esm/Popover.js +56 -72
- package/dist/esm/Price.js +14 -3
- package/dist/esm/Progress.js +1 -1
- package/dist/esm/Range.js +9 -3
- package/dist/esm/ShortPassword.js +22 -17
- package/dist/esm/TabbarItem.js +1 -1
- package/dist/esm/Tag.js +1 -1
- package/dist/esm/TextArea.js +3 -0
- package/dist/esm/Toast.js +22 -12
- package/dist/esm/Uploader.js +16 -6
- package/dist/esm/{icon-62bd7379.js → icon-8dc4de10.js} +9 -9
- 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/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +240 -173
- package/dist/nutui.react.umd.js +16771 -28
- package/dist/packages/col/col.scss +2 -2
- package/dist/packages/collapseitem/collapseitem.scss +1 -2
- package/dist/packages/icon/icon.scss +104 -12
- package/dist/packages/noticebar/noticebar.scss +31 -15
- package/dist/packages/notify/notify.scss +9 -0
- package/dist/packages/popover/popover.scss +205 -83
- package/dist/packages/rate/rate.scss +14 -13
- package/dist/packages/toast/toast.scss +16 -13
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/animation/icon.scss +245 -0
- package/dist/styles/animation/index.scss +1 -0
- package/dist/styles/font/config.json +169 -0
- package/dist/styles/font/demo_index.html +210 -3
- package/dist/styles/font/iconfont.css +39 -3
- package/dist/styles/font/iconfont.js +32 -32
- package/dist/styles/font/iconfont.json +63 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/variables.scss +23 -8
- package/dist/types/actionsheet/actionsheet.taro.d.ts +20 -0
- package/dist/types/actionsheet/index.taro.d.ts +2 -0
- package/dist/types/address/address.taro.d.ts +34 -0
- package/dist/types/address/index.taro.d.ts +2 -0
- package/dist/types/animatingnumbers/animatingnumbers.taro.d.ts +12 -0
- package/dist/types/animatingnumbers/countup.taro.d.ts +11 -0
- package/dist/types/animatingnumbers/index.taro.d.ts +2 -0
- package/dist/types/avatar/avatar.taro.d.ts +17 -0
- package/dist/types/avatar/index.taro.d.ts +2 -0
- package/dist/types/avatargroup/index.taro.d.ts +2 -0
- package/dist/types/backtop/backtop.taro.d.ts +15 -0
- package/dist/types/backtop/index.taro.d.ts +2 -0
- package/dist/types/badge/badge.taro.d.ts +14 -0
- package/dist/types/badge/index.taro.d.ts +2 -0
- package/dist/types/barrage/barrage.taro.d.ts +12 -0
- package/dist/types/barrage/index.taro.d.ts +2 -0
- package/dist/types/button/button.taro.d.ts +20 -0
- package/dist/types/button/index.taro.d.ts +2 -0
- package/dist/types/calendar/calendar.taro.d.ts +14 -0
- package/dist/types/calendar/index.taro.d.ts +2 -0
- package/dist/types/calendaritem/calendaritem.taro.d.ts +17 -0
- package/dist/types/calendaritem/index.taro.d.ts +2 -0
- package/dist/types/card/card.taro.d.ts +17 -0
- package/dist/types/card/index.taro.d.ts +2 -0
- package/dist/types/cell/cell.taro.d.ts +20 -0
- package/dist/types/cell/index.taro.d.ts +2 -0
- package/dist/types/cellgroup/cellgroup.taro.d.ts +10 -0
- package/dist/types/cellgroup/index.taro.d.ts +2 -0
- package/dist/types/checkbox/checkbox.taro.d.ts +19 -0
- package/dist/types/checkbox/index.taro.d.ts +2 -0
- package/dist/types/checkboxgroup/checkboxgroup.taro.d.ts +8 -0
- package/dist/types/checkboxgroup/index.taro.d.ts +2 -0
- package/dist/types/circleprogress/circleprogress.taro.d.ts +15 -0
- package/dist/types/circleprogress/index.taro.d.ts +2 -0
- package/dist/types/col/col.taro.d.ts +10 -0
- package/dist/types/col/index.taro.d.ts +2 -0
- package/dist/types/collapse/collapse.taro.d.ts +12 -0
- package/dist/types/collapse/index.taro.d.ts +2 -0
- package/dist/types/collapseitem/index.taro.d.ts +2 -0
- package/dist/types/configprovider/configprovider.taro.d.ts +12 -0
- package/dist/types/configprovider/index.taro.d.ts +2 -0
- package/dist/types/countdown/countdown.taro.d.ts +15 -0
- package/dist/types/countdown/index.taro.d.ts +2 -0
- package/dist/types/datepicker/datepicker.taro.d.ts +27 -0
- package/dist/types/datepicker/index.taro.d.ts +2 -0
- package/dist/types/dialog/dialog.taro.d.ts +2 -0
- package/dist/types/dialog/index.taro.d.ts +2 -0
- package/dist/types/divider/divider.taro.d.ts +12 -0
- package/dist/types/divider/index.taro.d.ts +2 -0
- package/dist/types/drag/drag.taro.d.ts +14 -0
- package/dist/types/drag/index.taro.d.ts +2 -0
- package/dist/types/elevator/elevator.taro.d.ts +22 -0
- package/dist/types/elevator/index.taro.d.ts +2 -0
- package/dist/types/empty/empty.taro.d.ts +8 -0
- package/dist/types/empty/index.taro.d.ts +2 -0
- package/dist/types/fixednav/fixednav.taro.d.ts +22 -0
- package/dist/types/fixednav/index.taro.d.ts +2 -0
- package/dist/types/icon/icon.d.ts +9 -3
- package/dist/types/icon/icon.taro.d.ts +19 -0
- package/dist/types/icon/index.taro.d.ts +2 -0
- package/dist/types/indicator/index.taro.d.ts +2 -0
- package/dist/types/indicator/indicator.taro.d.ts +10 -0
- package/dist/types/infiniteloading/index.taro.d.ts +2 -0
- package/dist/types/infiniteloading/infiniteloading.taro.d.ts +20 -0
- package/dist/types/input/index.taro.d.ts +2 -0
- package/dist/types/input/input.taro.d.ts +57 -0
- package/dist/types/inputnumber/index.taro.d.ts +2 -0
- package/dist/types/inputnumber/inputnumber.taro.d.ts +22 -0
- package/dist/types/layout/index.taro.d.ts +2 -0
- package/dist/types/layout/layout.taro.d.ts +4 -0
- package/dist/types/navbar/index.taro.d.ts +2 -0
- package/dist/types/navbar/navbar.taro.d.ts +21 -0
- package/dist/types/noticebar/demo.d.ts +1 -0
- package/dist/types/noticebar/index.taro.d.ts +2 -0
- package/dist/types/noticebar/noticebar.d.ts +1 -1
- package/dist/types/noticebar/noticebar.taro.d.ts +23 -0
- package/dist/types/notify/Notification.d.ts +8 -7
- package/dist/types/notify/index.taro.d.ts +2 -0
- package/dist/types/notify/notify.taro.d.ts +10 -0
- package/dist/types/numberkeyboard/index.taro.d.ts +2 -0
- package/dist/types/numberkeyboard/numberkeyboard.taro.d.ts +20 -0
- package/dist/types/overlay/index.taro.d.ts +2 -0
- package/dist/types/overlay/overlay.taro.d.ts +12 -0
- package/dist/types/pagination/index.taro.d.ts +2 -0
- package/dist/types/pagination/pagination.taro.d.ts +19 -0
- package/dist/types/picker/index.taro.d.ts +2 -0
- package/dist/types/picker/picker.d.ts +1 -0
- package/dist/types/picker/picker.taro.d.ts +24 -0
- package/dist/types/picker/pickerSlot.d.ts +1 -0
- package/dist/types/popover/__tests__/popover.spec.d.ts +1 -0
- package/dist/types/popover/index.taro.d.ts +2 -0
- package/dist/types/popover/popover.d.ts +14 -7
- package/dist/types/popover/popover.taro.d.ts +21 -0
- package/dist/types/popup/index.taro.d.ts +2 -0
- package/dist/types/popup/popup.taro.d.ts +25 -0
- package/dist/types/price/index.taro.d.ts +2 -0
- package/dist/types/price/price.taro.d.ts +11 -0
- package/dist/types/progress/index.taro.d.ts +2 -0
- package/dist/types/progress/progress.taro.d.ts +26 -0
- package/dist/types/radio/index.taro.d.ts +2 -0
- package/dist/types/radio/radio.taro.d.ts +21 -0
- package/dist/types/radiogroup/index.taro.d.ts +2 -0
- package/dist/types/range/index.taro.d.ts +2 -0
- package/dist/types/range/range.taro.d.ts +25 -0
- package/dist/types/rate/index.taro.d.ts +2 -0
- package/dist/types/rate/rate.taro.d.ts +17 -0
- package/dist/types/row/index.taro.d.ts +2 -0
- package/dist/types/row/row.taro.d.ts +12 -0
- package/dist/types/searchbar/index.taro.d.ts +2 -0
- package/dist/types/searchbar/searchbar.taro.d.ts +60 -0
- package/dist/types/shortpassword/_test_/index.spec.d.ts +1 -0
- package/dist/types/shortpassword/index.taro.d.ts +2 -0
- package/dist/types/shortpassword/shortpassword.d.ts +3 -3
- package/dist/types/shortpassword/shortpassword.taro.d.ts +21 -0
- package/dist/types/sidenavbar/index.taro.d.ts +2 -0
- package/dist/types/sidenavbar/sidenavbar.taro.d.ts +3 -0
- package/dist/types/sidenavbaritem/index.taro.d.ts +2 -0
- package/dist/types/sidenavbaritem/sidenavbaritem.taro.d.ts +3 -0
- package/dist/types/signature/index.taro.d.ts +2 -0
- package/dist/types/signature/signature.taro.d.ts +11 -0
- package/dist/types/skeleton/index.taro.d.ts +2 -0
- package/dist/types/skeleton/skeleton.taro.d.ts +19 -0
- package/dist/types/step/index.taro.d.ts +2 -0
- package/dist/types/steps/index.taro.d.ts +2 -0
- package/dist/types/steps/steps.taro.d.ts +10 -0
- package/dist/types/subsidenavbar/index.taro.d.ts +2 -0
- package/dist/types/subsidenavbar/subsidenavbar.taro.d.ts +3 -0
- package/dist/types/swiper/index.taro.d.ts +2 -0
- package/dist/types/swiper/swiper.taro.d.ts +27 -0
- package/dist/types/swiperitem/index.taro.d.ts +2 -0
- package/dist/types/switch/index.taro.d.ts +2 -0
- package/dist/types/switch/switch.taro.d.ts +14 -0
- package/dist/types/tabbar/index.taro.d.ts +2 -0
- package/dist/types/tabbar/tabbar.taro.d.ts +14 -0
- package/dist/types/tabbaritem/index.taro.d.ts +2 -0
- package/dist/types/tabbaritem/tabbaritem.taro.d.ts +17 -0
- package/dist/types/table/index.taro.d.ts +2 -0
- package/dist/types/table/table.taro.d.ts +3 -0
- package/dist/types/tabpane/index.taro.d.ts +2 -0
- package/dist/types/tabpane/tabpane.taro.d.ts +10 -0
- package/dist/types/tabs/index.taro.d.ts +2 -0
- package/dist/types/tabs/tabs.taro.d.ts +30 -0
- package/dist/types/tag/index.taro.d.ts +2 -0
- package/dist/types/tag/tag.taro.d.ts +16 -0
- package/dist/types/textarea/index.taro.d.ts +2 -0
- package/dist/types/textarea/textarea.taro.d.ts +18 -0
- package/dist/types/timedetail/index.taro.d.ts +2 -0
- package/dist/types/timedetail/timedetail.taro.d.ts +13 -0
- package/dist/types/timepannel/index.taro.d.ts +2 -0
- package/dist/types/timepannel/timepannel.taro.d.ts +8 -0
- package/dist/types/timeselect/index.taro.d.ts +2 -0
- package/dist/types/timeselect/timeselect.taro.d.ts +21 -0
- package/dist/types/toast/Notification.d.ts +6 -4
- package/dist/types/toast/__test__/toast.spec.d.ts +1 -0
- package/dist/types/toast/index.taro.d.ts +2 -0
- package/dist/types/toast/toast.taro.d.ts +11 -0
- package/dist/types/uploader/index.taro.d.ts +2 -0
- package/dist/types/uploader/uploader.d.ts +2 -2
- package/dist/types/uploader/uploader.taro.d.ts +68 -0
- package/dist/types/video/index.taro.d.ts +2 -0
- package/dist/types/virtuallist/index.taro.d.ts +2 -0
- package/dist/types/virtuallist/virtuallist.taro.d.ts +3 -0
- package/package.json +15 -4
package/dist/esm/Popover.js
CHANGED
|
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
10
|
-
var _excluded = ["children", "list", "theme", "location", "visible", "className", "style", "onClick"];
|
|
10
|
+
var _excluded = ["children", "list", "theme", "location", "visible", "offset", "className", "style", "onClick", "onChoose"];
|
|
11
11
|
|
|
12
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
13
|
|
|
@@ -18,8 +18,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
18
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
19
|
|
|
20
20
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
21
|
-
import ReactDOM__default from 'react-dom';
|
|
22
21
|
import Icon from './Icon.js';
|
|
22
|
+
import Overlay from './Overlay.js';
|
|
23
23
|
/**
|
|
24
24
|
* 过滤ref
|
|
25
25
|
*/
|
|
@@ -101,15 +101,6 @@ var Trigger = /*#__PURE__*/function (_React__default$Compo) {
|
|
|
101
101
|
return Trigger;
|
|
102
102
|
}(React__default.Component);
|
|
103
103
|
|
|
104
|
-
function findDOMNode(node) {
|
|
105
|
-
if (node instanceof HTMLElement) {
|
|
106
|
-
return node;
|
|
107
|
-
} // eslint-disable-next-line react/no-find-dom-node
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return ReactDOM__default.findDOMNode(node);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
104
|
var getEleAttr = function getEleAttr(ele) {
|
|
114
105
|
if (ele && ele.getBoundingClientRect) {
|
|
115
106
|
return ele.getBoundingClientRect();
|
|
@@ -123,8 +114,10 @@ var defaultProps = {
|
|
|
123
114
|
theme: 'light',
|
|
124
115
|
location: 'bottom',
|
|
125
116
|
visible: false,
|
|
117
|
+
offset: 20,
|
|
126
118
|
className: '',
|
|
127
|
-
onClick: function onClick(e) {}
|
|
119
|
+
onClick: function onClick(e) {},
|
|
120
|
+
onChoose: function onChoose(item, index) {}
|
|
128
121
|
};
|
|
129
122
|
|
|
130
123
|
var Popover = function Popover(props) {
|
|
@@ -134,18 +127,18 @@ var Popover = function Popover(props) {
|
|
|
134
127
|
theme = _defaultProps$props.theme,
|
|
135
128
|
location = _defaultProps$props.location,
|
|
136
129
|
visible = _defaultProps$props.visible,
|
|
130
|
+
offset = _defaultProps$props.offset,
|
|
137
131
|
className = _defaultProps$props.className,
|
|
138
132
|
style = _defaultProps$props.style,
|
|
139
133
|
onClick = _defaultProps$props.onClick,
|
|
134
|
+
onChoose = _defaultProps$props.onChoose,
|
|
140
135
|
reset = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
141
136
|
|
|
142
|
-
var goodItem = useRef(null);
|
|
143
|
-
|
|
144
|
-
var aa = goodItem.current && findDOMNode(goodItem.current);
|
|
137
|
+
var goodItem = useRef(null);
|
|
145
138
|
setTimeout(function () {
|
|
146
|
-
if (
|
|
147
|
-
setElWidth(getEleAttr(
|
|
148
|
-
setElHeight(getEleAttr(
|
|
139
|
+
if (goodItem.current && getEleAttr(goodItem.current)) {
|
|
140
|
+
setElWidth(getEleAttr(goodItem.current).width);
|
|
141
|
+
setElHeight(getEleAttr(goodItem.current).height);
|
|
149
142
|
}
|
|
150
143
|
});
|
|
151
144
|
|
|
@@ -181,68 +174,43 @@ var Popover = function Popover(props) {
|
|
|
181
174
|
}, [list, theme]);
|
|
182
175
|
|
|
183
176
|
var getStyle = function getStyle() {
|
|
177
|
+
var offNumer = Number(offset) ? Number(offset) : 0;
|
|
184
178
|
var style = {};
|
|
185
179
|
|
|
186
|
-
if (location
|
|
187
|
-
style.bottom = elHeight +
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
style.right =
|
|
192
|
-
} else if (location === 'left') {
|
|
193
|
-
style.top = 0;
|
|
194
|
-
style.left = -elWidth - 20;
|
|
195
|
-
} else {
|
|
196
|
-
style.top = elHeight + 20;
|
|
197
|
-
style.left = 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
style.top += 'px';
|
|
201
|
-
style.left += 'px';
|
|
202
|
-
style.bottom += 'px';
|
|
203
|
-
style.right += 'px';
|
|
204
|
-
return style;
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
var getArrowStyle = function getArrowStyle() {
|
|
208
|
-
var style = {};
|
|
209
|
-
|
|
210
|
-
if (location === 'top') {
|
|
211
|
-
style.bottom = -20;
|
|
212
|
-
style.left = elWidth / 2;
|
|
213
|
-
} else if (location === 'right') {
|
|
214
|
-
style.top = 20;
|
|
215
|
-
style.left = -20;
|
|
216
|
-
} else if (location === 'left') {
|
|
217
|
-
style.top = 20;
|
|
218
|
-
style.right = -20;
|
|
180
|
+
if (location.includes('top')) {
|
|
181
|
+
style.bottom = "".concat(elHeight + offNumer, "px");
|
|
182
|
+
} else if (location.includes('right')) {
|
|
183
|
+
style.left = "".concat(elWidth + offNumer, "px");
|
|
184
|
+
} else if (location.includes('left')) {
|
|
185
|
+
style.right = "".concat(elWidth + offNumer, "px");
|
|
219
186
|
} else {
|
|
220
|
-
style.
|
|
221
|
-
style.top = -20;
|
|
187
|
+
style.top = "".concat(elHeight + offNumer, "px");
|
|
222
188
|
}
|
|
223
189
|
|
|
224
|
-
style.top += 'px';
|
|
225
|
-
style.left += 'px';
|
|
226
|
-
style.bottom += 'px';
|
|
227
|
-
style.right += 'px';
|
|
228
190
|
return style;
|
|
229
191
|
};
|
|
230
192
|
|
|
231
193
|
var classesSelf = function classesSelf() {
|
|
232
194
|
var prefixCls = 'nut-popover';
|
|
233
|
-
return "".concat(prefixCls, "
|
|
195
|
+
return "".concat(prefixCls, " ").concat(theme ? "".concat(prefixCls, "--").concat(theme) : '');
|
|
234
196
|
};
|
|
235
197
|
|
|
236
198
|
var popoverContentSelf = function popoverContentSelf() {
|
|
237
|
-
var prefixCls = '
|
|
238
|
-
return "".concat(prefixCls, "
|
|
199
|
+
var prefixCls = 'popover-content';
|
|
200
|
+
return "".concat(prefixCls, "-show ").concat(prefixCls, " ").concat(location ? "".concat(prefixCls, "--").concat(location) : '');
|
|
239
201
|
};
|
|
240
202
|
|
|
241
|
-
var
|
|
242
|
-
var
|
|
243
|
-
return
|
|
244
|
-
|
|
203
|
+
var filter = function filter() {
|
|
204
|
+
var ms = ['top', 'bottom', 'left', 'right'];
|
|
205
|
+
return ms.filter(function (m) {
|
|
206
|
+
return location.includes(m);
|
|
207
|
+
})[0];
|
|
208
|
+
};
|
|
245
209
|
|
|
210
|
+
var popoverArrowSelf = function popoverArrowSelf() {
|
|
211
|
+
var prefixCls = 'popover-arrow';
|
|
212
|
+
return "".concat(prefixCls, " ").concat(prefixCls, "-").concat(filter(), " ").concat(location ? "".concat(prefixCls, "--").concat(location) : '');
|
|
213
|
+
};
|
|
246
214
|
|
|
247
215
|
var handleClick = function handleClick(e) {
|
|
248
216
|
if (props.onClick) {
|
|
@@ -250,7 +218,13 @@ var Popover = function Popover(props) {
|
|
|
250
218
|
}
|
|
251
219
|
};
|
|
252
220
|
|
|
253
|
-
|
|
221
|
+
var handleChoose = function handleChoose(item, index) {
|
|
222
|
+
if (!item.disabled) {
|
|
223
|
+
onChoose(item, index);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", _objectSpread({
|
|
254
228
|
className: "".concat(classes, " ").concat(className),
|
|
255
229
|
style: _objectSpread({}, style)
|
|
256
230
|
}, reset), React__default.createElement(Trigger, {
|
|
@@ -263,19 +237,29 @@ var Popover = function Popover(props) {
|
|
|
263
237
|
className: "".concat(popoverContent),
|
|
264
238
|
style: getStyle()
|
|
265
239
|
}, React__default.createElement("div", {
|
|
266
|
-
className: "".concat(popoverArrow)
|
|
267
|
-
|
|
268
|
-
}, ' '), Array.isArray(children) ? children[1] : '', list.map(function (item) {
|
|
240
|
+
className: "".concat(popoverArrow)
|
|
241
|
+
}), Array.isArray(children) ? children[1] : '', list.map(function (item, i) {
|
|
269
242
|
return React__default.createElement("div", {
|
|
270
243
|
key: item.name,
|
|
271
|
-
className: "
|
|
244
|
+
className: "popover-menu-item ".concat(item.disabled ? 'disabled' : ''),
|
|
245
|
+
onClick: function onClick() {
|
|
246
|
+
handleChoose(item, i);
|
|
247
|
+
}
|
|
272
248
|
}, item.icon ? React__default.createElement(Icon, {
|
|
273
|
-
className: "item-img",
|
|
249
|
+
className: "popover-menu-item-img",
|
|
274
250
|
name: item.icon
|
|
275
251
|
}) : '', React__default.createElement("div", {
|
|
276
|
-
className: "
|
|
252
|
+
className: "popover-menu-item-name"
|
|
277
253
|
}, item.name));
|
|
278
|
-
})) : null)))
|
|
254
|
+
})) : null))), visible ? React__default.createElement(Overlay, {
|
|
255
|
+
visible: visible,
|
|
256
|
+
onClick: function onClick(e) {
|
|
257
|
+
return handleClick(e);
|
|
258
|
+
},
|
|
259
|
+
style: {
|
|
260
|
+
background: 'transparent'
|
|
261
|
+
}
|
|
262
|
+
}) : '');
|
|
279
263
|
};
|
|
280
264
|
|
|
281
265
|
Popover.defaultProps = defaultProps;
|
package/dist/esm/Price.js
CHANGED
|
@@ -30,9 +30,20 @@ var Price = function Price(props) {
|
|
|
30
30
|
|
|
31
31
|
var b = cn('price');
|
|
32
32
|
|
|
33
|
+
var replaceSpecialChar = function replaceSpecialChar(symbol) {
|
|
34
|
+
var desSymbol = symbol;
|
|
35
|
+
desSymbol = symbol.replace(/"/g, '"');
|
|
36
|
+
desSymbol = symbol.replace(/&/g, '&');
|
|
37
|
+
desSymbol = symbol.replace(/</g, '<');
|
|
38
|
+
desSymbol = symbol.replace(/>/g, '>');
|
|
39
|
+
desSymbol = symbol.replace(/ /g, ' ');
|
|
40
|
+
desSymbol = symbol.replace(/¥/g, '¥');
|
|
41
|
+
return desSymbol;
|
|
42
|
+
};
|
|
43
|
+
|
|
33
44
|
var showSymbol = function showSymbol() {
|
|
34
45
|
return {
|
|
35
|
-
__html: (needSymbol ? symbol : '') || ''
|
|
46
|
+
__html: (needSymbol ? replaceSpecialChar(symbol) : '') || ''
|
|
36
47
|
};
|
|
37
48
|
};
|
|
38
49
|
|
|
@@ -41,7 +52,7 @@ var Price = function Price(props) {
|
|
|
41
52
|
};
|
|
42
53
|
|
|
43
54
|
var formatThousands = function formatThousands(num) {
|
|
44
|
-
if (Number(num)
|
|
55
|
+
if (Number(num) === 0) {
|
|
45
56
|
num = 0;
|
|
46
57
|
}
|
|
47
58
|
|
|
@@ -60,7 +71,7 @@ var Price = function Price(props) {
|
|
|
60
71
|
};
|
|
61
72
|
|
|
62
73
|
var formatDecimal = function formatDecimal(decimalNum) {
|
|
63
|
-
if (Number(decimalNum)
|
|
74
|
+
if (Number(decimalNum) === 0) {
|
|
64
75
|
decimalNum = 0;
|
|
65
76
|
}
|
|
66
77
|
|
package/dist/esm/Progress.js
CHANGED
|
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
|
|
9
9
|
import React__default from 'react';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
|
-
import { I as Icon } from './icon-
|
|
11
|
+
import { I as Icon } from './icon-8dc4de10.js';
|
|
12
12
|
import { c as cn } from './bem-893ad28d.js';
|
|
13
13
|
import '@bem-react/classname';
|
|
14
14
|
var defaultProps = {
|
package/dist/esm/Range.js
CHANGED
|
@@ -80,9 +80,6 @@ var Range = function Range(props) {
|
|
|
80
80
|
buttonColor = _defaultProps$props.buttonColor,
|
|
81
81
|
hiddenRange = _defaultProps$props.hiddenRange,
|
|
82
82
|
hiddenTag = _defaultProps$props.hiddenTag,
|
|
83
|
-
min = _defaultProps$props.min,
|
|
84
|
-
max = _defaultProps$props.max,
|
|
85
|
-
step = _defaultProps$props.step,
|
|
86
83
|
modelValue = _defaultProps$props.modelValue,
|
|
87
84
|
button = _defaultProps$props.button,
|
|
88
85
|
vertical = _defaultProps$props.vertical,
|
|
@@ -91,6 +88,15 @@ var Range = function Range(props) {
|
|
|
91
88
|
dragStart = _defaultProps$props.dragStart,
|
|
92
89
|
dragEnd = _defaultProps$props.dragEnd;
|
|
93
90
|
|
|
91
|
+
var _defaultProps$props2 = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
92
|
+
min = _defaultProps$props2.min,
|
|
93
|
+
max = _defaultProps$props2.max,
|
|
94
|
+
step = _defaultProps$props2.step;
|
|
95
|
+
|
|
96
|
+
min = Number(min);
|
|
97
|
+
max = Number(max);
|
|
98
|
+
step = Number(step);
|
|
99
|
+
|
|
94
100
|
var _useState = useState(0),
|
|
95
101
|
_useState2 = _slicedToArray(_useState, 2),
|
|
96
102
|
buttonIndex = _useState2[0],
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["title", "desc", "tips", "visible", "modelValue", "errorMsg", "noButton", "closeOnClickOverlay", "length", "style", "className", "
|
|
5
|
+
var _excluded = ["title", "desc", "tips", "visible", "modelValue", "errorMsg", "noButton", "closeOnClickOverlay", "length", "style", "className", "onChange", "onOk", "onTips", "onCancel", "onClose", "onComplete"];
|
|
6
6
|
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
8
|
|
|
@@ -15,9 +15,9 @@ import Icon from './Icon.js';
|
|
|
15
15
|
import { useConfig } from './ConfigProvider.js';
|
|
16
16
|
import '@bem-react/classname';
|
|
17
17
|
var defaultProps = {
|
|
18
|
-
title: '
|
|
19
|
-
desc: '
|
|
20
|
-
tips: '
|
|
18
|
+
title: '',
|
|
19
|
+
desc: '',
|
|
20
|
+
tips: '',
|
|
21
21
|
visible: false,
|
|
22
22
|
modelValue: '',
|
|
23
23
|
errorMsg: '',
|
|
@@ -25,12 +25,12 @@ var defaultProps = {
|
|
|
25
25
|
closeOnClickOverlay: true,
|
|
26
26
|
length: 6,
|
|
27
27
|
className: '',
|
|
28
|
-
|
|
28
|
+
onChange: function onChange(value) {},
|
|
29
29
|
onOk: function onOk(value) {},
|
|
30
30
|
onCancel: function onCancel() {},
|
|
31
31
|
onClose: function onClose() {},
|
|
32
32
|
onTips: function onTips() {},
|
|
33
|
-
|
|
33
|
+
onComplete: function onComplete(value) {}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
var ShortPassword = function ShortPassword(props) {
|
|
@@ -48,12 +48,12 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
48
48
|
length = props.length,
|
|
49
49
|
style = props.style,
|
|
50
50
|
className = props.className,
|
|
51
|
-
|
|
51
|
+
onChange = props.onChange,
|
|
52
52
|
onOk = props.onOk,
|
|
53
53
|
onTips = props.onTips,
|
|
54
54
|
onCancel = props.onCancel,
|
|
55
55
|
onClose = props.onClose,
|
|
56
|
-
|
|
56
|
+
onComplete = props.onComplete,
|
|
57
57
|
reset = _objectWithoutProperties(props, _excluded);
|
|
58
58
|
|
|
59
59
|
var b = cn('shortpassword');
|
|
@@ -82,7 +82,7 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
82
82
|
setInnerVisible(visible);
|
|
83
83
|
}, [visible]);
|
|
84
84
|
useEffect(function () {
|
|
85
|
-
if (modelValue) {
|
|
85
|
+
if (typeof modelValue !== 'undefined') {
|
|
86
86
|
setInputValue(modelValue);
|
|
87
87
|
}
|
|
88
88
|
}, [modelValue]);
|
|
@@ -97,10 +97,10 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
97
97
|
setInputValue(inputValue);
|
|
98
98
|
|
|
99
99
|
if (String(inputValue).length === comLen) {
|
|
100
|
-
|
|
100
|
+
onComplete && onComplete(inputValue);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
onChange && onChange(inputValue);
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
var systemStyle = function systemStyle() {
|
|
@@ -109,18 +109,23 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
109
109
|
|
|
110
110
|
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
|
|
111
111
|
|
|
112
|
+
var style = {};
|
|
113
|
+
console.log(isIOS, isAndroid);
|
|
114
|
+
|
|
112
115
|
if (isIOS) {
|
|
113
|
-
|
|
116
|
+
style = {
|
|
114
117
|
paddingRight: '1200px'
|
|
115
118
|
};
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
if (isAndroid) {
|
|
119
|
-
|
|
122
|
+
style = {
|
|
120
123
|
opacity: 0,
|
|
121
124
|
zIndex: 10
|
|
122
125
|
};
|
|
123
126
|
}
|
|
127
|
+
|
|
128
|
+
return style;
|
|
124
129
|
};
|
|
125
130
|
|
|
126
131
|
var focus = function focus() {
|
|
@@ -149,9 +154,9 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
149
154
|
style: _objectSpread({}, style)
|
|
150
155
|
}, reset), React__default.createElement("div", {
|
|
151
156
|
className: b('title')
|
|
152
|
-
}, locale.shortpassword.title
|
|
157
|
+
}, title || locale.shortpassword.title), React__default.createElement("div", {
|
|
153
158
|
className: b('subtitle')
|
|
154
|
-
}, locale.shortpassword.desc
|
|
159
|
+
}, desc || locale.shortpassword.desc), React__default.createElement("div", {
|
|
155
160
|
className: b('input')
|
|
156
161
|
}, React__default.createElement("input", {
|
|
157
162
|
ref: textInput,
|
|
@@ -181,7 +186,7 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
181
186
|
className: b('message')
|
|
182
187
|
}, React__default.createElement("div", {
|
|
183
188
|
className: b('message__error')
|
|
184
|
-
}, errorMsg), tips ? React__default.createElement("div", {
|
|
189
|
+
}, errorMsg), tips || locale.shortpassword.tips ? React__default.createElement("div", {
|
|
185
190
|
className: b('message__forget')
|
|
186
191
|
}, React__default.createElement(Icon, {
|
|
187
192
|
className: "icon",
|
|
@@ -189,7 +194,7 @@ var ShortPassword = function ShortPassword(props) {
|
|
|
189
194
|
name: "tips"
|
|
190
195
|
}), React__default.createElement("div", {
|
|
191
196
|
onClick: onTips
|
|
192
|
-
}, locale.shortpassword.tips
|
|
197
|
+
}, tips || locale.shortpassword.tips)) : null), !noButton ? React__default.createElement("div", {
|
|
193
198
|
className: b('footer')
|
|
194
199
|
}, React__default.createElement("div", {
|
|
195
200
|
className: b('footer__cancel'),
|
package/dist/esm/TabbarItem.js
CHANGED
package/dist/esm/Tag.js
CHANGED
package/dist/esm/TextArea.js
CHANGED
package/dist/esm/Toast.js
CHANGED
|
@@ -92,11 +92,15 @@ var Notification = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
92
92
|
}, {
|
|
93
93
|
key: "render",
|
|
94
94
|
value: function render() {
|
|
95
|
-
var
|
|
95
|
+
var _classNames,
|
|
96
|
+
_this3 = this;
|
|
96
97
|
|
|
97
98
|
var _this$props = this.props,
|
|
99
|
+
id = _this$props.id,
|
|
98
100
|
style = _this$props.style,
|
|
99
101
|
icon = _this$props.icon,
|
|
102
|
+
iconSize = _this$props.iconSize,
|
|
103
|
+
title = _this$props.title,
|
|
100
104
|
msg = _this$props.msg,
|
|
101
105
|
bottom = _this$props.bottom,
|
|
102
106
|
center = _this$props.center,
|
|
@@ -108,19 +112,19 @@ var Notification = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
108
112
|
cover = _this$props.cover,
|
|
109
113
|
type = _this$props.type;
|
|
110
114
|
var toastBem = cn('toast');
|
|
111
|
-
var classes = classNames(
|
|
115
|
+
var classes = classNames((_classNames = {
|
|
112
116
|
'nut-toast-center': center,
|
|
113
117
|
'nut-toast-has-icon': icon,
|
|
114
118
|
'nut-toast-cover': cover,
|
|
115
|
-
'nut-toast-loading': type === 'loading'
|
|
116
|
-
|
|
117
|
-
}, "nut-toast-".concat(size), true));
|
|
119
|
+
'nut-toast-loading': type === 'loading'
|
|
120
|
+
}, _defineProperty(_classNames, "".concat(customClass), true), _defineProperty(_classNames, "nut-toast-".concat(size), true), _classNames));
|
|
118
121
|
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
119
122
|
className: "".concat(toastBem(), " ").concat(classes),
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
id: "toast-".concat(id),
|
|
124
|
+
style: _objectSpread({
|
|
125
|
+
bottom: center ? 'auto' : "".concat(bottom),
|
|
122
126
|
backgroundColor: cover ? coverColor : ''
|
|
123
|
-
},
|
|
127
|
+
}, style),
|
|
124
128
|
onClick: function onClick() {
|
|
125
129
|
_this3.clickCover();
|
|
126
130
|
}
|
|
@@ -134,8 +138,11 @@ var Notification = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
134
138
|
className: toastBem('icon-wrapper')
|
|
135
139
|
}, React.createElement(Icon, {
|
|
136
140
|
name: icon || '',
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
color: "#ffffff",
|
|
142
|
+
size: iconSize
|
|
143
|
+
})) : null, title ? React.createElement("div", {
|
|
144
|
+
className: "nut-toast-title"
|
|
145
|
+
}, title) : null, React.createElement("span", {
|
|
139
146
|
className: toastBem('text')
|
|
140
147
|
}, msg))));
|
|
141
148
|
}
|
|
@@ -180,13 +187,16 @@ var messageInstance = null;
|
|
|
180
187
|
var options = {
|
|
181
188
|
msg: '',
|
|
182
189
|
id: '',
|
|
190
|
+
style: {},
|
|
183
191
|
duration: 1.5,
|
|
184
192
|
center: true,
|
|
185
193
|
type: 'text',
|
|
194
|
+
title: '',
|
|
186
195
|
customClass: '',
|
|
187
|
-
bottom:
|
|
196
|
+
bottom: '30px',
|
|
188
197
|
size: 'base',
|
|
189
|
-
icon:
|
|
198
|
+
icon: null,
|
|
199
|
+
iconSize: '20',
|
|
190
200
|
textAlignCenter: true,
|
|
191
201
|
loadingRotate: true,
|
|
192
202
|
bgColor: 'rgba(0, 0, 0, .8)',
|
package/dist/esm/Uploader.js
CHANGED
|
@@ -270,6 +270,8 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
270
270
|
item.status = 'ready';
|
|
271
271
|
item.message = locale.uploader.readyUpload;
|
|
272
272
|
}
|
|
273
|
+
|
|
274
|
+
return item;
|
|
273
275
|
});
|
|
274
276
|
return _toConsumableArray(fileList);
|
|
275
277
|
});
|
|
@@ -283,6 +285,8 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
283
285
|
item.status = 'uploading';
|
|
284
286
|
item.message = locale.uploader.uploading;
|
|
285
287
|
}
|
|
288
|
+
|
|
289
|
+
return item;
|
|
286
290
|
});
|
|
287
291
|
return _toConsumableArray(fileList);
|
|
288
292
|
});
|
|
@@ -300,6 +304,8 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
300
304
|
item.status = 'success';
|
|
301
305
|
item.message = locale.uploader.success;
|
|
302
306
|
}
|
|
307
|
+
|
|
308
|
+
return item;
|
|
303
309
|
});
|
|
304
310
|
return _toConsumableArray(fileList);
|
|
305
311
|
});
|
|
@@ -316,6 +322,8 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
316
322
|
item.status = 'error';
|
|
317
323
|
item.message = locale.uploader.error;
|
|
318
324
|
}
|
|
325
|
+
|
|
326
|
+
return item;
|
|
319
327
|
});
|
|
320
328
|
return _toConsumableArray(fileList);
|
|
321
329
|
});
|
|
@@ -466,7 +474,7 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
466
474
|
return React__default.createElement("div", {
|
|
467
475
|
className: "nut-uploader__preview ".concat(listType),
|
|
468
476
|
key: item.uid
|
|
469
|
-
}, listType
|
|
477
|
+
}, listType === 'picture' && !children && React__default.createElement("div", {
|
|
470
478
|
className: "nut-uploader__preview-img"
|
|
471
479
|
}, item.status === 'ready' ? React__default.createElement("div", {
|
|
472
480
|
className: "nut-uploader__preview__progress"
|
|
@@ -476,25 +484,27 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
476
484
|
className: "nut-uploader__preview__progress"
|
|
477
485
|
}, React__default.createElement(Icon, {
|
|
478
486
|
color: "#fff",
|
|
479
|
-
name: "".concat(item.status
|
|
487
|
+
name: "".concat(item.status === 'error' ? 'failure' : 'loading')
|
|
480
488
|
}), React__default.createElement("div", {
|
|
481
489
|
className: "nut-uploader__preview__progress__msg"
|
|
482
490
|
}, item.message)), isDeletable && React__default.createElement(Icon, {
|
|
483
491
|
color: "rgba(0,0,0,0.6)",
|
|
484
492
|
className: "close",
|
|
485
493
|
name: "failure",
|
|
486
|
-
|
|
494
|
+
onClick: function onClick() {
|
|
487
495
|
return onDelete(item, index);
|
|
488
496
|
}
|
|
489
497
|
}), item.type.includes('image') ? React__default.createElement(React__default.Fragment, null, item.url && React__default.createElement("img", {
|
|
490
498
|
className: "nut-uploader__preview-img__c",
|
|
491
499
|
src: item.url,
|
|
500
|
+
alt: "",
|
|
492
501
|
onClick: function onClick() {
|
|
493
502
|
return handleItemClick(item);
|
|
494
503
|
}
|
|
495
504
|
})) : React__default.createElement(React__default.Fragment, null, defaultImg ? React__default.createElement("img", {
|
|
496
505
|
className: "nut-uploader__preview-img__c",
|
|
497
506
|
src: defaultImg,
|
|
507
|
+
alt: "",
|
|
498
508
|
onClick: function onClick() {
|
|
499
509
|
return handleItemClick(item);
|
|
500
510
|
}
|
|
@@ -510,7 +520,7 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
510
520
|
name: "link"
|
|
511
521
|
}), "\xA0", item.name))), React__default.createElement("div", {
|
|
512
522
|
className: "tips"
|
|
513
|
-
}, item.name)), listType
|
|
523
|
+
}, item.name)), listType === 'list' && React__default.createElement("div", {
|
|
514
524
|
className: "nut-uploader__preview-list"
|
|
515
525
|
}, React__default.createElement("div", {
|
|
516
526
|
className: "nut-uploader__preview-img__file__name ".concat(item.status),
|
|
@@ -523,11 +533,11 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
523
533
|
color: "#808080",
|
|
524
534
|
className: "nut-uploader__preview-img__file__del",
|
|
525
535
|
name: "del",
|
|
526
|
-
|
|
536
|
+
onClick: function onClick() {
|
|
527
537
|
return onDelete(item, index);
|
|
528
538
|
}
|
|
529
539
|
})));
|
|
530
|
-
}), maximum > fileList.length && listType
|
|
540
|
+
}), maximum > fileList.length && listType === 'picture' && !children && React__default.createElement("div", {
|
|
531
541
|
className: "nut-uploader__upload ".concat(listType)
|
|
532
542
|
}, React__default.createElement(Icon, {
|
|
533
543
|
size: uploadIconSize,
|