@nutui/nutui-react 1.1.5-beta.4 → 1.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Address.js +2 -2
- package/dist/esm/AnimatingNumbers.js +1 -2
- package/dist/esm/Avatar.js +2 -2
- package/dist/esm/AvatarGroup.js +1 -1
- package/dist/esm/Calendar.js +1 -1
- package/dist/esm/CalendarItem.js +1 -1
- package/dist/esm/Cell.js +44 -28
- package/dist/esm/CellGroup.js +11 -3
- package/dist/esm/CircleProgress.js +1 -1
- package/dist/esm/CountDown.js +2 -2
- package/dist/esm/Dialog.js +15 -7
- package/dist/esm/Divider.js +6 -4
- package/dist/esm/Elevator.js +1 -1
- package/dist/esm/Empty.js +6 -0
- package/dist/esm/Indicator/style/index.js +2 -0
- package/dist/esm/Indicator.js +63 -0
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/Pagination.js +11 -11
- package/dist/esm/Rate.js +4 -1
- package/dist/esm/TextArea.js +9 -21
- package/dist/esm/TimeDetail/style/index.js +2 -0
- package/dist/esm/TimeDetail.js +82 -0
- package/dist/esm/TimePannel/style/index.js +2 -0
- package/dist/esm/TimePannel.js +38 -0
- package/dist/esm/TimeSelect/style/index.js +3 -0
- package/dist/esm/TimeSelect.js +182 -0
- package/dist/esm/{date-b4847376.js → date-710f8c7c.js} +0 -0
- package/dist/esm/nutui-react.es.js +5 -1
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.d.ts +3 -0
- package/dist/locales/id-ID.js +96 -0
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +1488 -1282
- package/dist/nutui.react.umd.js +19 -19
- package/dist/packages/cell/cell.scss +29 -15
- package/dist/packages/cellgroup/cellgroup.scss +14 -0
- package/dist/packages/divider/divider.scss +17 -8
- package/dist/packages/indicator/indicator.scss +63 -0
- package/dist/packages/timedetail/timedetail.scss +26 -0
- package/dist/packages/timepannel/timepannel.scss +7 -0
- package/dist/packages/timeselect/timeselect.scss +34 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +5 -1
- package/dist/styles/variables.scss +68 -16
- package/dist/types/actionsheet/demo.d.ts +3 -0
- package/dist/types/address/demo.d.ts +3 -0
- package/dist/types/animatingnumbers/demo.d.ts +3 -0
- package/dist/types/avatar/demo.d.ts +4 -0
- package/dist/types/backtop/demo.d.ts +3 -0
- package/dist/types/badge/demo.d.ts +3 -0
- package/dist/types/barrage/demo.d.ts +4 -0
- package/dist/types/button/demo.d.ts +3 -0
- package/dist/types/calendar/demo.d.ts +3 -0
- package/dist/types/card/demo.d.ts +3 -0
- package/dist/types/cell/cell.d.ts +10 -6
- package/dist/types/cell/demo.d.ts +3 -0
- package/dist/types/cellgroup/cellgroup.d.ts +5 -2
- package/dist/types/checkbox/demo.d.ts +3 -0
- package/dist/types/circleprogress/demo.d.ts +4 -0
- package/dist/types/collapse/demo.d.ts +3 -0
- package/dist/types/configprovider/demo.d.ts +3 -0
- package/dist/types/countdown/demo.d.ts +3 -0
- package/dist/types/datepicker/demo.d.ts +3 -0
- package/dist/types/dialog/Content.d.ts +2 -1
- package/dist/types/dialog/DialogWrap.d.ts +1 -0
- package/dist/types/dialog/config.d.ts +7 -6
- package/dist/types/dialog/demo.d.ts +3 -0
- package/dist/types/divider/demo.d.ts +3 -0
- package/dist/types/divider/divider.d.ts +4 -1
- package/dist/types/drag/demo.d.ts +3 -0
- package/dist/types/elevator/demo.d.ts +3 -0
- package/dist/types/empty/__test__/empty.spec.d.ts +1 -0
- package/dist/types/empty/demo.d.ts +4 -0
- package/dist/types/fixednav/demo.d.ts +3 -0
- package/dist/types/icon/demo.d.ts +3 -0
- package/dist/types/indicator/__test__/indicator.spec.d.ts +1 -0
- package/dist/types/indicator/demo.d.ts +4 -0
- package/dist/types/indicator/index.d.ts +2 -0
- package/dist/types/indicator/indicator.d.ts +10 -0
- package/dist/types/infiniteloading/demo.d.ts +4 -0
- package/dist/types/input/demo.d.ts +3 -0
- package/dist/types/inputnumber/demo.d.ts +3 -0
- package/dist/types/layout/demo.d.ts +4 -0
- package/dist/types/navbar/demo.d.ts +3 -0
- package/dist/types/noticebar/demo.d.ts +3 -0
- package/dist/types/notify/demo.d.ts +3 -0
- package/dist/types/nutui.react.d.ts +6 -2
- package/dist/types/overlay/demo.d.ts +4 -0
- package/dist/types/pagination/__tests__/pagination.spec.d.ts +1 -0
- package/dist/types/pagination/demo.d.ts +3 -0
- package/dist/types/pagination/pagination.d.ts +2 -2
- package/dist/types/picker/demo.d.ts +3 -0
- package/dist/types/popover/demo.d.ts +3 -0
- package/dist/types/popup/demo.d.ts +4 -0
- package/dist/types/price/demo.d.ts +3 -0
- package/dist/types/radio/demo.d.ts +3 -0
- package/dist/types/range/demo.d.ts +3 -0
- package/dist/types/rate/__test__/rate.spec.d.ts +1 -0
- package/dist/types/rate/demo.d.ts +3 -0
- package/dist/types/rate/rate.d.ts +1 -0
- package/dist/types/shortpassword/demo.d.ts +3 -0
- package/dist/types/signature/demo.d.ts +3 -0
- package/dist/types/skeleton/demo.d.ts +4 -0
- package/dist/types/steps/demo.d.ts +4 -0
- package/dist/types/swiper/demo.d.ts +4 -0
- package/dist/types/switch/demo.d.ts +3 -0
- package/dist/types/tabbar/demo.d.ts +3 -0
- package/dist/types/tabs/demo.d.ts +3 -0
- package/dist/types/tag/demo.d.ts +3 -0
- package/dist/types/textarea/demo.d.ts +3 -0
- package/dist/types/textarea/textarea.d.ts +4 -4
- package/dist/types/timedetail/demo.d.ts +3 -0
- package/dist/types/timedetail/index.d.ts +3 -0
- package/dist/types/timedetail/timedetail.d.ts +13 -0
- package/dist/types/timepannel/demo.d.ts +3 -0
- package/dist/types/timepannel/index.d.ts +2 -0
- package/dist/types/timepannel/timepannel.d.ts +8 -0
- package/dist/types/timeselect/demo.d.ts +3 -0
- package/dist/types/timeselect/index.d.ts +2 -0
- package/dist/types/timeselect/timeselect.d.ts +21 -0
- package/dist/types/toast/demo.d.ts +3 -0
- package/dist/types/uploader/demo.d.ts +3 -0
- package/dist/types/virtuallist/demo.d.ts +3 -0
- package/dist/types/virtuallist/utils.d.ts +1 -1
- package/package.json +5 -5
package/dist/esm/Address.js
CHANGED
|
@@ -231,9 +231,9 @@ var CustomRender = function CustomRender(props) {
|
|
|
231
231
|
var getTabName = function getTabName(item, index) {
|
|
232
232
|
if (tabIndex > index) {
|
|
233
233
|
return item.name;
|
|
234
|
-
} else {
|
|
235
|
-
return locale.select;
|
|
236
234
|
}
|
|
235
|
+
|
|
236
|
+
return locale.select;
|
|
237
237
|
};
|
|
238
238
|
|
|
239
239
|
var mapRef = {
|
|
@@ -3,7 +3,6 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
9
8
|
var _excluded = ["maxLen", "endNumber", "delaySpeed", "easeSpeed", "className", "thousands"];
|
|
@@ -106,7 +105,7 @@ var CountUp = function CountUp(props) {
|
|
|
106
105
|
}, !isNaN(item) ? React__default.createElement("span", {
|
|
107
106
|
className: b('number'),
|
|
108
107
|
style: numberEaseStyle
|
|
109
|
-
}, [].concat(
|
|
108
|
+
}, [].concat(numbers, numbers).map(function (number, subidx) {
|
|
110
109
|
return React__default.createElement("span", {
|
|
111
110
|
key: subidx
|
|
112
111
|
}, number);
|
package/dist/esm/Avatar.js
CHANGED
|
@@ -8,9 +8,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
8
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
9
|
|
|
10
10
|
import React__default, { useState, useRef, useContext, useEffect } from 'react';
|
|
11
|
+
import classNames from 'classnames';
|
|
11
12
|
import { A as AvatarContext } from './AvatarContext-7153ad2b.js';
|
|
12
13
|
import { c as cn } from './bem-893ad28d.js';
|
|
13
|
-
import classNames from 'classnames';
|
|
14
14
|
import Icon from './Icon.js';
|
|
15
15
|
import '@bem-react/classname';
|
|
16
16
|
var defaultProps = {
|
|
@@ -80,7 +80,7 @@ var Avatar = function Avatar(props) {
|
|
|
80
80
|
backgroundColor: "".concat(parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro6 = parent.propAvatarGroup) === null || _parent$propAvatarGro6 === void 0 ? void 0 : _parent$propAvatarGro6.maxBgColor),
|
|
81
81
|
color: "".concat(parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro7 = parent.propAvatarGroup) === null || _parent$propAvatarGro7 === void 0 ? void 0 : _parent$propAvatarGro7.maxColor)
|
|
82
82
|
};
|
|
83
|
-
var iconStyles =
|
|
83
|
+
var iconStyles = icon || '';
|
|
84
84
|
useEffect(function () {
|
|
85
85
|
var _parent$avatarGroupRe;
|
|
86
86
|
|
package/dist/esm/AvatarGroup.js
CHANGED
|
@@ -5,9 +5,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import React__default, { useRef } from 'react';
|
|
8
|
+
import classNames from 'classnames';
|
|
8
9
|
import { A as AvatarContext } from './AvatarContext-7153ad2b.js';
|
|
9
10
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
|
-
import classNames from 'classnames';
|
|
11
11
|
import { useConfig } from './ConfigProvider.js';
|
|
12
12
|
import '@bem-react/classname';
|
|
13
13
|
var defaultProps = {
|
package/dist/esm/Calendar.js
CHANGED
|
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
import Popup from './Popup.js';
|
|
9
9
|
import CalendarItem from './CalendarItem.js';
|
|
10
|
-
import { U as Utils } from './date-
|
|
10
|
+
import { U as Utils } from './date-710f8c7c.js';
|
|
11
11
|
import { useConfig } from './ConfigProvider.js';
|
|
12
12
|
var defaultProps = {
|
|
13
13
|
type: 'one',
|
package/dist/esm/CalendarItem.js
CHANGED
|
@@ -9,7 +9,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import { c as cn } from './bem-893ad28d.js';
|
|
12
|
-
import { U as Utils } from './date-
|
|
12
|
+
import { U as Utils } from './date-710f8c7c.js';
|
|
13
13
|
import { useConfig } from './ConfigProvider.js';
|
|
14
14
|
import '@bem-react/classname';
|
|
15
15
|
|
package/dist/esm/Cell.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "click", "isLink", "
|
|
3
|
+
var _excluded = ["children", "click", "title", "subTitle", "desc", "descTextAlign", "isLink", "icon", "roundRadius", "url", "to", "replace", "center", "size", "className", "iconSlot", "linkSlot"];
|
|
4
4
|
|
|
5
5
|
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; }
|
|
6
6
|
|
|
@@ -12,17 +12,21 @@ import { c as cn } from './bem-893ad28d.js';
|
|
|
12
12
|
import Icon from './Icon.js';
|
|
13
13
|
import '@bem-react/classname';
|
|
14
14
|
var defaultProps = {
|
|
15
|
-
title:
|
|
16
|
-
subTitle:
|
|
15
|
+
title: null,
|
|
16
|
+
subTitle: null,
|
|
17
17
|
desc: '',
|
|
18
18
|
descTextAlign: 'right',
|
|
19
19
|
isLink: false,
|
|
20
|
+
icon: '',
|
|
21
|
+
roundRadius: '6px',
|
|
22
|
+
url: '',
|
|
20
23
|
to: '',
|
|
21
24
|
replace: false,
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
center: false,
|
|
26
|
+
size: '',
|
|
24
27
|
className: '',
|
|
25
|
-
|
|
28
|
+
iconSlot: null,
|
|
29
|
+
linkSlot: null,
|
|
26
30
|
click: function click(event) {}
|
|
27
31
|
};
|
|
28
32
|
|
|
@@ -30,17 +34,21 @@ var Cell = function Cell(props) {
|
|
|
30
34
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
31
35
|
children = _defaultProps$props.children,
|
|
32
36
|
click = _defaultProps$props.click,
|
|
37
|
+
title = _defaultProps$props.title,
|
|
38
|
+
subTitle = _defaultProps$props.subTitle,
|
|
39
|
+
desc = _defaultProps$props.desc,
|
|
40
|
+
descTextAlign = _defaultProps$props.descTextAlign,
|
|
33
41
|
isLink = _defaultProps$props.isLink,
|
|
34
|
-
|
|
42
|
+
icon = _defaultProps$props.icon,
|
|
43
|
+
roundRadius = _defaultProps$props.roundRadius,
|
|
35
44
|
url = _defaultProps$props.url,
|
|
45
|
+
to = _defaultProps$props.to,
|
|
36
46
|
replace = _defaultProps$props.replace,
|
|
47
|
+
center = _defaultProps$props.center,
|
|
48
|
+
size = _defaultProps$props.size,
|
|
37
49
|
className = _defaultProps$props.className,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
icon = _defaultProps$props.icon,
|
|
41
|
-
title = _defaultProps$props.title,
|
|
42
|
-
subTitle = _defaultProps$props.subTitle,
|
|
43
|
-
extra = _defaultProps$props.extra,
|
|
50
|
+
iconSlot = _defaultProps$props.iconSlot,
|
|
51
|
+
linkSlot = _defaultProps$props.linkSlot,
|
|
44
52
|
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
45
53
|
|
|
46
54
|
var b = cn('cell');
|
|
@@ -52,39 +60,47 @@ var Cell = function Cell(props) {
|
|
|
52
60
|
if (to && history) {
|
|
53
61
|
history[replace ? 'replace' : 'push'](to);
|
|
54
62
|
} else if (url) {
|
|
55
|
-
replace ? location.replace(url) : location.href = url;
|
|
63
|
+
replace ? window.location.replace(url) : window.location.href = url;
|
|
56
64
|
}
|
|
57
65
|
};
|
|
58
66
|
|
|
67
|
+
var baseStyle = {
|
|
68
|
+
borderRadius: Number.isNaN(Number(roundRadius)) ? String(roundRadius) : "".concat(roundRadius, "px")
|
|
69
|
+
};
|
|
59
70
|
var styles = title || subTitle || icon ? {} : {
|
|
60
71
|
textAlign: descTextAlign,
|
|
61
72
|
flex: 1
|
|
62
73
|
};
|
|
63
74
|
return React__default.createElement("div", _objectSpread({
|
|
64
75
|
className: "".concat(b({
|
|
65
|
-
clickable: !!(isLink || to)
|
|
76
|
+
clickable: !!(isLink || to),
|
|
77
|
+
center: center,
|
|
78
|
+
large: size === 'large'
|
|
66
79
|
}, [className]), " "),
|
|
67
80
|
onClick: function onClick(event) {
|
|
68
81
|
return handleClick(event);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, icon ? React__default.createElement(Icon, {
|
|
82
|
+
},
|
|
83
|
+
style: baseStyle
|
|
84
|
+
}, rest), children || React__default.createElement(React__default.Fragment, null, icon || iconSlot ? React__default.createElement("div", {
|
|
85
|
+
className: b('icon')
|
|
86
|
+
}, iconSlot || (icon ? React__default.createElement(Icon, {
|
|
75
87
|
name: icon,
|
|
76
|
-
className: ""
|
|
77
|
-
}) : null, subTitle ? React__default.createElement(
|
|
88
|
+
className: "icon"
|
|
89
|
+
}) : null)) : null, title || subTitle ? React__default.createElement("div", {
|
|
90
|
+
className: "".concat(b('title'))
|
|
91
|
+
}, title ? React__default.createElement("div", {
|
|
78
92
|
className: b('maintitle')
|
|
79
|
-
}, title), React__default.createElement("div", {
|
|
93
|
+
}, title) : null, subTitle ? React__default.createElement("div", {
|
|
80
94
|
className: b('subtitle')
|
|
81
|
-
}, subTitle)
|
|
82
|
-
className: b('
|
|
95
|
+
}, subTitle) : null) : null, desc ? React__default.createElement("div", {
|
|
96
|
+
className: b('value', {
|
|
97
|
+
alone: !title && !subTitle
|
|
98
|
+
}),
|
|
83
99
|
style: styles
|
|
84
|
-
}, desc) : null
|
|
100
|
+
}, desc) : null, !linkSlot && (isLink || to) ? React__default.createElement(Icon, {
|
|
85
101
|
name: "right",
|
|
86
102
|
className: b('link')
|
|
87
|
-
}) :
|
|
103
|
+
}) : linkSlot));
|
|
88
104
|
};
|
|
89
105
|
|
|
90
106
|
Cell.defaultProps = defaultProps;
|
package/dist/esm/CellGroup.js
CHANGED
|
@@ -9,6 +9,9 @@ import { c as cn } from './bem-893ad28d.js';
|
|
|
9
9
|
import '@bem-react/classname';
|
|
10
10
|
var defaultProps = {
|
|
11
11
|
title: '',
|
|
12
|
+
desc: '',
|
|
13
|
+
titleSlot: null,
|
|
14
|
+
descSlot: null,
|
|
12
15
|
classPrefix: 'nutui-cell-group'
|
|
13
16
|
};
|
|
14
17
|
|
|
@@ -16,14 +19,19 @@ var CellGroup = function CellGroup(props) {
|
|
|
16
19
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
17
20
|
children = _defaultProps$props.children,
|
|
18
21
|
classPrefix = _defaultProps$props.classPrefix,
|
|
19
|
-
title = _defaultProps$props.title
|
|
22
|
+
title = _defaultProps$props.title,
|
|
23
|
+
desc = _defaultProps$props.desc,
|
|
24
|
+
titleSlot = _defaultProps$props.titleSlot,
|
|
25
|
+
descSlot = _defaultProps$props.descSlot;
|
|
20
26
|
|
|
21
27
|
var b = cn('cell-group');
|
|
22
28
|
return React__default.createElement("div", {
|
|
23
29
|
className: b(null, [classPrefix])
|
|
24
|
-
}, title ? React__default.createElement("div", {
|
|
30
|
+
}, titleSlot || React__default.createElement(React__default.Fragment, null, title ? React__default.createElement("div", {
|
|
25
31
|
className: b('title')
|
|
26
|
-
}, title) : null, React__default.createElement("div", {
|
|
32
|
+
}, title) : null), descSlot || React__default.createElement(React__default.Fragment, null, title ? React__default.createElement("div", {
|
|
33
|
+
className: b('desc')
|
|
34
|
+
}, desc) : null), React__default.createElement("div", {
|
|
27
35
|
className: b('wrap')
|
|
28
36
|
}, children));
|
|
29
37
|
};
|
|
@@ -128,7 +128,7 @@ var CircleProgress = function CircleProgress(props) {
|
|
|
128
128
|
strokeWidth: strokeWidth
|
|
129
129
|
})), React__default.createElement("div", {
|
|
130
130
|
className: "nut-circleprogress-text"
|
|
131
|
-
}, children
|
|
131
|
+
}, children || React__default.createElement("div", null, progress, "%")));
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
CircleProgress.defaultProps = defaultProps;
|
package/dist/esm/CountDown.js
CHANGED
|
@@ -57,7 +57,7 @@ var CountDown = function CountDown(props) {
|
|
|
57
57
|
v += '';
|
|
58
58
|
|
|
59
59
|
while (v.length < 2) {
|
|
60
|
-
v =
|
|
60
|
+
v = "0".concat(v);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
return v;
|
|
@@ -90,7 +90,7 @@ var CountDown = function CountDown(props) {
|
|
|
90
90
|
var h = ts - d * ds >= hs ? parseInt(String((ts - d * ds) / hs)) : 0;
|
|
91
91
|
var m = ts - d * ds - h * hs >= ms ? parseInt(String((ts - d * ds - h * hs) / ms)) : 0;
|
|
92
92
|
var s = Math.round((ts - d * ds - h * hs - m * ms) / 1000);
|
|
93
|
-
if (d >= 0) rest.d = d
|
|
93
|
+
if (d >= 0) rest.d = "".concat(d);
|
|
94
94
|
if (h >= 0) rest.h = fill2(h);
|
|
95
95
|
if (m >= 0) rest.m = fill2(m);
|
|
96
96
|
if (s >= 0) rest.s = fill2(s);
|
package/dist/esm/Dialog.js
CHANGED
|
@@ -20,6 +20,7 @@ var Content = function Content(props) {
|
|
|
20
20
|
footer = props.footer,
|
|
21
21
|
textAlign = props.textAlign,
|
|
22
22
|
footerDirection = props.footerDirection,
|
|
23
|
+
onClickSelf = props.onClickSelf,
|
|
23
24
|
children = props.children;
|
|
24
25
|
var headerNode;
|
|
25
26
|
|
|
@@ -37,8 +38,13 @@ var Content = function Content(props) {
|
|
|
37
38
|
}, footer);
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
var handleClick = function handleClick() {
|
|
42
|
+
onClickSelf && onClickSelf();
|
|
43
|
+
};
|
|
44
|
+
|
|
40
45
|
return React__default.createElement("div", {
|
|
41
|
-
className: "nut-dialog__outer"
|
|
46
|
+
className: "nut-dialog__outer",
|
|
47
|
+
onClick: handleClick
|
|
42
48
|
}, React__default.createElement("div", {
|
|
43
49
|
className: "nut-dialog",
|
|
44
50
|
style: {
|
|
@@ -268,9 +274,10 @@ var BaseDialog = function BaseDialog(props, ref) {
|
|
|
268
274
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
269
275
|
|
|
270
276
|
var renderFooter = function renderFooter() {
|
|
271
|
-
if (footer === null) return;
|
|
277
|
+
if (footer === null) return '';
|
|
272
278
|
|
|
273
|
-
var handleCancel = function handleCancel() {
|
|
279
|
+
var handleCancel = function handleCancel(e) {
|
|
280
|
+
e.stopPropagation();
|
|
274
281
|
if (!cancelAutoClose) return;
|
|
275
282
|
onClosed === null || onClosed === void 0 ? void 0 : onClosed();
|
|
276
283
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
@@ -281,6 +288,7 @@ var BaseDialog = function BaseDialog(props, ref) {
|
|
|
281
288
|
};
|
|
282
289
|
|
|
283
290
|
var handleOk = function handleOk(e) {
|
|
291
|
+
e.stopPropagation();
|
|
284
292
|
onClosed === null || onClosed === void 0 ? void 0 : onClosed();
|
|
285
293
|
onOk === null || onOk === void 0 ? void 0 : onOk(e);
|
|
286
294
|
|
|
@@ -294,8 +302,8 @@ var BaseDialog = function BaseDialog(props, ref) {
|
|
|
294
302
|
plain: true,
|
|
295
303
|
type: "primary",
|
|
296
304
|
className: "nut-dialog__footer-cancel",
|
|
297
|
-
onClick: function onClick() {
|
|
298
|
-
return handleCancel();
|
|
305
|
+
onClick: function onClick(e) {
|
|
306
|
+
return handleCancel(e);
|
|
299
307
|
}
|
|
300
308
|
}, cancelText || locale.cancel), !noOkBtn && React__default.createElement(Button, {
|
|
301
309
|
size: "small",
|
|
@@ -304,8 +312,8 @@ var BaseDialog = function BaseDialog(props, ref) {
|
|
|
304
312
|
disabled: okBtnDisabled
|
|
305
313
|
}),
|
|
306
314
|
disabled: okBtnDisabled,
|
|
307
|
-
onClick: function onClick() {
|
|
308
|
-
return handleOk();
|
|
315
|
+
onClick: function onClick(e) {
|
|
316
|
+
return handleOk(e);
|
|
309
317
|
}
|
|
310
318
|
}, okText || locale.confirm));
|
|
311
319
|
return footerContent;
|
package/dist/esm/Divider.js
CHANGED
|
@@ -11,11 +11,12 @@ import '@bem-react/classname';
|
|
|
11
11
|
var defaultProps = {
|
|
12
12
|
contentPosition: 'center',
|
|
13
13
|
dashed: false,
|
|
14
|
-
hairline: true
|
|
14
|
+
hairline: true,
|
|
15
|
+
direction: 'horizontal'
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
var Divider = function Divider(props) {
|
|
18
|
-
var _classNames;
|
|
19
|
+
var _classNames, _classNames2;
|
|
19
20
|
|
|
20
21
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
21
22
|
children = _defaultProps$props.children,
|
|
@@ -23,10 +24,11 @@ var Divider = function Divider(props) {
|
|
|
23
24
|
dashed = _defaultProps$props.dashed,
|
|
24
25
|
hairline = _defaultProps$props.hairline,
|
|
25
26
|
styles = _defaultProps$props.styles,
|
|
26
|
-
className = _defaultProps$props.className
|
|
27
|
+
className = _defaultProps$props.className,
|
|
28
|
+
direction = _defaultProps$props.direction;
|
|
27
29
|
|
|
28
30
|
var dividerBem = cn('divider');
|
|
29
|
-
var classes = classNames((_classNames = {}, _defineProperty(_classNames, dividerBem(), true), _defineProperty(_classNames, dividerBem('center'), children), _defineProperty(_classNames, dividerBem('left'), contentPosition === 'left'), _defineProperty(_classNames, dividerBem('right'), contentPosition === 'right'), _defineProperty(_classNames, dividerBem('dashed'), dashed), _defineProperty(_classNames, dividerBem('hairline'), hairline), _classNames));
|
|
31
|
+
var classes = direction === 'horizontal' ? classNames((_classNames = {}, _defineProperty(_classNames, dividerBem(), true), _defineProperty(_classNames, dividerBem('center'), children), _defineProperty(_classNames, dividerBem('left'), contentPosition === 'left'), _defineProperty(_classNames, dividerBem('right'), contentPosition === 'right'), _defineProperty(_classNames, dividerBem('dashed'), dashed), _defineProperty(_classNames, dividerBem('hairline'), hairline), _classNames)) : classNames((_classNames2 = {}, _defineProperty(_classNames2, dividerBem(), true), _defineProperty(_classNames2, dividerBem('vertical'), direction === 'vertical'), _classNames2));
|
|
30
32
|
return React__default.createElement("div", {
|
|
31
33
|
className: "".concat(classes, " ").concat(className || ''),
|
|
32
34
|
style: styles
|
package/dist/esm/Elevator.js
CHANGED
|
@@ -175,7 +175,7 @@ var Elevator = function Elevator(props) {
|
|
|
175
175
|
className: b('code', {
|
|
176
176
|
current: true
|
|
177
177
|
})
|
|
178
|
-
},
|
|
178
|
+
}, ' ', indexList[currentIndex][acceptKey]) : null, React__default.createElement("div", {
|
|
179
179
|
className: b('bars'),
|
|
180
180
|
onTouchStart: function onTouchStart(event) {
|
|
181
181
|
return touchStart(event);
|
package/dist/esm/Empty.js
CHANGED
|
@@ -9,6 +9,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
|
|
10
10
|
import React__default, { useState, useEffect } from 'react';
|
|
11
11
|
import { c as cn } from './bem-893ad28d.js';
|
|
12
|
+
import { useConfig } from './ConfigProvider.js';
|
|
12
13
|
import '@bem-react/classname';
|
|
13
14
|
/**
|
|
14
15
|
* 内置图片地址
|
|
@@ -27,6 +28,11 @@ var defaultProps = {
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
var Empty = function Empty(props) {
|
|
31
|
+
var _useConfig = useConfig(),
|
|
32
|
+
locale = _useConfig.locale;
|
|
33
|
+
|
|
34
|
+
defaultProps.description = locale.noData || defaultProps.description;
|
|
35
|
+
|
|
30
36
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
31
37
|
image = _defaultProps$props.image,
|
|
32
38
|
imageSize = _defaultProps$props.imageSize,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["size", "current", "block", "align", "fillZero", "children", "className", "vertical"];
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
+
|
|
9
|
+
import React__default, { useEffect } from 'react';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import { c as cn } from './bem-893ad28d.js';
|
|
12
|
+
import '@bem-react/classname';
|
|
13
|
+
var defaultProps = {
|
|
14
|
+
size: 3,
|
|
15
|
+
current: 1,
|
|
16
|
+
block: false,
|
|
17
|
+
align: 'center',
|
|
18
|
+
fillZero: true,
|
|
19
|
+
vertical: false
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var Indicator = function Indicator(props) {
|
|
23
|
+
var _classNames;
|
|
24
|
+
|
|
25
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
26
|
+
size = _defaultProps$props.size,
|
|
27
|
+
current = _defaultProps$props.current,
|
|
28
|
+
block = _defaultProps$props.block,
|
|
29
|
+
align = _defaultProps$props.align,
|
|
30
|
+
fillZero = _defaultProps$props.fillZero,
|
|
31
|
+
children = _defaultProps$props.children,
|
|
32
|
+
className = _defaultProps$props.className,
|
|
33
|
+
vertical = _defaultProps$props.vertical,
|
|
34
|
+
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
35
|
+
|
|
36
|
+
var b = cn('indicator');
|
|
37
|
+
var classes = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(b('block')), block), _defineProperty(_classNames, "".concat(b('align'), "__").concat(align), block && align), _defineProperty(_classNames, "".concat(b('vertical')), vertical), _classNames), b(''));
|
|
38
|
+
|
|
39
|
+
var renderEles = function renderEles() {
|
|
40
|
+
var childs = [];
|
|
41
|
+
|
|
42
|
+
for (var item = 1; item <= size; item++) {
|
|
43
|
+
childs.push(item === current ? React__default.createElement("div", {
|
|
44
|
+
key: item,
|
|
45
|
+
className: b('number')
|
|
46
|
+
}, fillZero && item < 10 ? "0".concat(item) : item) : React__default.createElement("div", {
|
|
47
|
+
key: item,
|
|
48
|
+
className: b('dot')
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return childs;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
useEffect(function () {}, []);
|
|
56
|
+
return React__default.createElement("div", _objectSpread({
|
|
57
|
+
className: "".concat(classes, " ").concat(className)
|
|
58
|
+
}, rest), renderEles());
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
Indicator.defaultProps = defaultProps;
|
|
62
|
+
Indicator.displayName = 'NutIndicator';
|
|
63
|
+
export { Indicator as default };
|
package/dist/esm/NoticeBar.js
CHANGED
|
@@ -118,7 +118,7 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
118
118
|
complexAm ? startRoll() : startRollEasy();
|
|
119
119
|
}, Number(standTime));
|
|
120
120
|
} else {
|
|
121
|
-
initScrollWrap(
|
|
121
|
+
initScrollWrap();
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
return function () {
|
|
@@ -141,7 +141,7 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
useEffect(function () {
|
|
144
|
-
initScrollWrap(
|
|
144
|
+
initScrollWrap();
|
|
145
145
|
}, [text]);
|
|
146
146
|
useEffect(function () {
|
|
147
147
|
if (list && list.length) {
|
package/dist/esm/Pagination.js
CHANGED
|
@@ -14,8 +14,8 @@ import '@bem-react/classname';
|
|
|
14
14
|
var defaultProps = {
|
|
15
15
|
defaultValue: 1,
|
|
16
16
|
mode: 'multi',
|
|
17
|
-
prevText: '
|
|
18
|
-
nextText: '
|
|
17
|
+
prevText: '',
|
|
18
|
+
nextText: '',
|
|
19
19
|
pageCount: '',
|
|
20
20
|
totalItems: '0',
|
|
21
21
|
itemsPerPage: '10',
|
|
@@ -68,12 +68,12 @@ var Pagination = function Pagination(props) {
|
|
|
68
68
|
|
|
69
69
|
var computedCountRef = function computedCountRef() {
|
|
70
70
|
var num = Number(pageCount) || Math.ceil(Number(totalItems) / Number(itemsPerPage));
|
|
71
|
-
return isNaN(num) ? 1 : Math.max(1, num);
|
|
71
|
+
return Number.isNaN(num) ? 1 : Math.max(1, num);
|
|
72
72
|
}; // 生成pages数组,用来遍历
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
var computedPages = function computedPages(_currentPage, _countRef) {
|
|
76
|
-
if (mode
|
|
76
|
+
if (mode === 'simple') return [];
|
|
77
77
|
var items = [];
|
|
78
78
|
var pageCount = _countRef || countRef; // 总的页面数量
|
|
79
79
|
|
|
@@ -99,7 +99,7 @@ var Pagination = function Pagination(props) {
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
for (var i = startPage; i <= endPage; i++) {
|
|
102
|
-
var page = setPage(i, i, _current
|
|
102
|
+
var page = setPage(i, i, _current === i);
|
|
103
103
|
items.push(page);
|
|
104
104
|
} // 判断是否有折叠
|
|
105
105
|
|
|
@@ -126,12 +126,12 @@ var Pagination = function Pagination(props) {
|
|
|
126
126
|
if (!('modelValue' in props)) {
|
|
127
127
|
setCurrent(Number(curPage));
|
|
128
128
|
|
|
129
|
-
if (curPage
|
|
129
|
+
if (curPage !== currentPage) {
|
|
130
130
|
setPages(computedPages(curPage));
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
if (curPage
|
|
134
|
+
if (curPage !== currentPage) {
|
|
135
135
|
updatecurrent && updatecurrent(curPage);
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -172,11 +172,11 @@ var Pagination = function Pagination(props) {
|
|
|
172
172
|
return React__default.createElement("div", _objectSpread({
|
|
173
173
|
className: "".concat(paginationBem(''), " ").concat(className)
|
|
174
174
|
}, rest), React__default.createElement("div", {
|
|
175
|
-
className: "".concat(paginationBem('prev'), " ").concat(mode
|
|
175
|
+
className: "".concat(paginationBem('prev'), " ").concat(mode === 'multi' ? '' : 'simple-border', " ").concat(currentPage === 1 ? 'disabled' : ''),
|
|
176
176
|
onClick: function onClick(e) {
|
|
177
177
|
return selectPage(Number(currentPage) - 1, true);
|
|
178
178
|
}
|
|
179
|
-
}, locale.pagination.prev
|
|
179
|
+
}, prevText || locale.pagination.prev), mode === 'multi' ? React__default.createElement("div", {
|
|
180
180
|
className: "".concat(paginationBem('contain'))
|
|
181
181
|
}, pages.map(function (item, index) {
|
|
182
182
|
return React__default.createElement("div", {
|
|
@@ -186,7 +186,7 @@ var Pagination = function Pagination(props) {
|
|
|
186
186
|
return !item.active ? selectPage(item.number, true) : '';
|
|
187
187
|
}
|
|
188
188
|
}, pageNodeRender ? pageNodeRender(item) : item.text);
|
|
189
|
-
})) : '', mode
|
|
189
|
+
})) : '', mode === 'simple' ? React__default.createElement("div", {
|
|
190
190
|
className: "".concat(paginationBem('contain'))
|
|
191
191
|
}, React__default.createElement("div", {
|
|
192
192
|
className: "".concat(paginationBem('simple'))
|
|
@@ -195,7 +195,7 @@ var Pagination = function Pagination(props) {
|
|
|
195
195
|
onClick: function onClick(e) {
|
|
196
196
|
return selectPage(Number(currentPage) + 1, true);
|
|
197
197
|
}
|
|
198
|
-
}, locale.pagination.next
|
|
198
|
+
}, nextText || locale.pagination.next));
|
|
199
199
|
};
|
|
200
200
|
|
|
201
201
|
Pagination.defaultProps = defaultProps;
|
package/dist/esm/Rate.js
CHANGED
|
@@ -12,6 +12,7 @@ import '@bem-react/classname';
|
|
|
12
12
|
var defaultProps = {
|
|
13
13
|
count: 5,
|
|
14
14
|
modelValue: 0,
|
|
15
|
+
minimizeValue: 0,
|
|
15
16
|
iconSize: 18,
|
|
16
17
|
activeColor: '',
|
|
17
18
|
voidColor: '',
|
|
@@ -27,6 +28,7 @@ var Rate = function Rate(props) {
|
|
|
27
28
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
28
29
|
count = _defaultProps$props.count,
|
|
29
30
|
modelValue = _defaultProps$props.modelValue,
|
|
31
|
+
minimizeValue = _defaultProps$props.minimizeValue,
|
|
30
32
|
iconSize = _defaultProps$props.iconSize,
|
|
31
33
|
activeColor = _defaultProps$props.activeColor,
|
|
32
34
|
voidColor = _defaultProps$props.voidColor,
|
|
@@ -61,7 +63,7 @@ var Rate = function Rate(props) {
|
|
|
61
63
|
setCountArray(tmp);
|
|
62
64
|
}, [count]);
|
|
63
65
|
useEffect(function () {
|
|
64
|
-
setScore(Number(modelValue));
|
|
66
|
+
setScore(Math.max(Number(modelValue), Number(minimizeValue)));
|
|
65
67
|
}, [modelValue]);
|
|
66
68
|
|
|
67
69
|
var pxCheck = function pxCheck(value) {
|
|
@@ -82,6 +84,7 @@ var Rate = function Rate(props) {
|
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
}
|
|
87
|
+
value = Math.max(value, Number(minimizeValue));
|
|
85
88
|
setScore(value);
|
|
86
89
|
change && change(value);
|
|
87
90
|
};
|