@nutui/nutui-react 1.1.3-beta.2 → 1.1.4-beta.1
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 +8 -0
- package/dist/esm/Address.js +22 -28
- package/dist/esm/Badge.js +0 -2
- package/dist/esm/Calendar.js +6 -2
- package/dist/esm/CalendarItem.js +14 -13
- package/dist/esm/CheckboxGroup.js +1 -1
- package/dist/esm/Collapse.js +2 -2
- package/dist/esm/ConfigProvider/style/index.js +2 -0
- package/dist/esm/ConfigProvider.js +146 -0
- package/dist/esm/CountDown.js +8 -4
- package/dist/esm/Dialog.js +7 -3
- package/dist/esm/FixedNav.js +5 -1
- package/dist/esm/Infiniteloading.js +7 -3
- package/dist/esm/Input.js +5 -1
- package/dist/esm/NoticeBar.js +1 -1
- package/dist/esm/Pagination.js +6 -2
- package/dist/esm/Picker.js +6 -2
- package/dist/esm/Range.js +5 -1
- package/dist/esm/ShortPassword.js +9 -5
- package/dist/esm/Signature.js +7 -3
- package/dist/esm/TextArea.js +5 -1
- package/dist/esm/Toast.js +4 -10
- package/dist/esm/nutui-react.es.js +1 -0
- package/dist/locales/base.d.ts +91 -0
- package/dist/locales/base.js +5 -0
- package/dist/locales/en-US.d.ts +3 -0
- package/dist/locales/en-US.js +95 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +97 -0
- package/dist/locales/zh-TW.d.ts +3 -0
- package/dist/locales/zh-TW.js +95 -0
- package/dist/nutui.react.es.js +221 -104
- package/dist/nutui.react.umd.js +26 -26
- package/dist/packages/configprovider/configprovider.scss +2 -0
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/styles/variables-jdw.scss +376 -0
- package/dist/types/configprovider/configprovider.d.ts +12 -0
- package/dist/types/configprovider/index.d.ts +3 -0
- package/dist/types/nutui.react.d.ts +2 -1
- package/dist/types/toast/Notification.d.ts +1 -7
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## v1.1.3
|
|
2
|
+
`2022-04-18`
|
|
3
|
+
|
|
4
|
+
* :zap: feat(countdown): 新增 countdown 组件(#107 ) @irisSong
|
|
5
|
+
* :zap: feat(upload): 新增 defaultImg 属性支持(#108 ) @junjun666
|
|
6
|
+
* :bug: fix(dialog): 修复Dialog自定义关闭事件不清除body样式类问题(#111 ) @yangjinjun3
|
|
7
|
+
* :zap: feat: NutUI-React 官网增加 countdown 组件的文档。
|
|
8
|
+
|
|
1
9
|
## v1.1.2
|
|
2
10
|
`2022-03-29`
|
|
3
11
|
|
package/dist/esm/Address.js
CHANGED
|
@@ -13,6 +13,7 @@ import React__default, { useEffect, useState, useRef } from 'react';
|
|
|
13
13
|
import Icon from './Icon.js';
|
|
14
14
|
import Popup from './Popup.js';
|
|
15
15
|
import { c as cn } from './bem-893ad28d.js';
|
|
16
|
+
import { useConfig } from './ConfigProvider.js';
|
|
16
17
|
import Elevator from './Elevator.js';
|
|
17
18
|
import '@bem-react/classname';
|
|
18
19
|
var defaultProps$2 = {
|
|
@@ -25,6 +26,9 @@ var defaultProps$2 = {
|
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
var ExistRender = function ExistRender(props) {
|
|
29
|
+
var _useConfig = useConfig(),
|
|
30
|
+
locale = _useConfig.locale;
|
|
31
|
+
|
|
28
32
|
var _defaultProps$2$props = _objectSpread(_objectSpread({}, defaultProps$2), props),
|
|
29
33
|
children = _defaultProps$2$props.children,
|
|
30
34
|
type = _defaultProps$2$props.type,
|
|
@@ -103,7 +107,7 @@ var ExistRender = function ExistRender(props) {
|
|
|
103
107
|
onClick: switchModule
|
|
104
108
|
}, React__default.createElement("div", {
|
|
105
109
|
className: b('choose-other-btn')
|
|
106
|
-
}, customAndExistTitle)));
|
|
110
|
+
}, locale.address.chooseAnotherAddress || customAndExistTitle)));
|
|
107
111
|
};
|
|
108
112
|
|
|
109
113
|
var defaultProps$1 = {
|
|
@@ -116,6 +120,9 @@ var defaultProps$1 = {
|
|
|
116
120
|
};
|
|
117
121
|
|
|
118
122
|
var CustomRender = function CustomRender(props) {
|
|
123
|
+
var _useConfig2 = useConfig(),
|
|
124
|
+
locale = _useConfig2.locale;
|
|
125
|
+
|
|
119
126
|
var _defaultProps$1$props = _objectSpread(_objectSpread({}, defaultProps$1), props),
|
|
120
127
|
children = _defaultProps$1$props.children,
|
|
121
128
|
type = _defaultProps$1$props.type,
|
|
@@ -131,9 +138,8 @@ var CustomRender = function CustomRender(props) {
|
|
|
131
138
|
var b = cn('address');
|
|
132
139
|
|
|
133
140
|
var _useState = useState(type),
|
|
134
|
-
_useState2 = _slicedToArray(_useState,
|
|
135
|
-
privateType = _useState2[0]
|
|
136
|
-
setPrivateType = _useState2[1];
|
|
141
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
142
|
+
privateType = _useState2[0];
|
|
137
143
|
|
|
138
144
|
var _useState3 = useState(0),
|
|
139
145
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -141,9 +147,8 @@ var CustomRender = function CustomRender(props) {
|
|
|
141
147
|
setTabIndex = _useState4[1];
|
|
142
148
|
|
|
143
149
|
var _useState5 = useState(['province', 'city', 'country', 'town']),
|
|
144
|
-
_useState6 = _slicedToArray(_useState5,
|
|
145
|
-
tabName = _useState6[0]
|
|
146
|
-
setTabName = _useState6[1];
|
|
150
|
+
_useState6 = _slicedToArray(_useState5, 1),
|
|
151
|
+
tabName = _useState6[0];
|
|
147
152
|
|
|
148
153
|
var provinceRef = useRef(null);
|
|
149
154
|
var cityRef = useRef(null);
|
|
@@ -229,7 +234,7 @@ var CustomRender = function CustomRender(props) {
|
|
|
229
234
|
return item.name;
|
|
230
235
|
}
|
|
231
236
|
|
|
232
|
-
return
|
|
237
|
+
return locale.select;
|
|
233
238
|
};
|
|
234
239
|
|
|
235
240
|
var mapRef = {
|
|
@@ -397,6 +402,9 @@ var defaultProps = {
|
|
|
397
402
|
};
|
|
398
403
|
|
|
399
404
|
var Address = function Address(props) {
|
|
405
|
+
var _useConfig3 = useConfig(),
|
|
406
|
+
locale = _useConfig3.locale;
|
|
407
|
+
|
|
400
408
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
401
409
|
modelValue = _defaultProps$props.modelValue,
|
|
402
410
|
children = _defaultProps$props.children,
|
|
@@ -432,9 +440,8 @@ var Address = function Address(props) {
|
|
|
432
440
|
setPrivateType = _useState14[1];
|
|
433
441
|
|
|
434
442
|
var _useState15 = useState(['province', 'city', 'country', 'town']),
|
|
435
|
-
_useState16 = _slicedToArray(_useState15,
|
|
436
|
-
tabName = _useState16[0]
|
|
437
|
-
setTabName = _useState16[1];
|
|
443
|
+
_useState16 = _slicedToArray(_useState15, 1),
|
|
444
|
+
tabName = _useState16[0];
|
|
438
445
|
|
|
439
446
|
var _useState17 = useState(modelValue),
|
|
440
447
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
@@ -464,25 +471,15 @@ var Address = function Address(props) {
|
|
|
464
471
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
465
472
|
selectedExistAddress = _useState22[0],
|
|
466
473
|
setSelectedExistAddress = _useState22[1]; // 当前选择的地址
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
var _useState23 = useState('self'),
|
|
470
|
-
_useState24 = _slicedToArray(_useState23, 2),
|
|
471
|
-
closeWay = _useState24[0],
|
|
472
|
-
setCloseWay = _useState24[1]; // 手动关闭 点击叉号(cross),或者蒙层(mask)
|
|
474
|
+
// 手动关闭 点击叉号(cross),或者蒙层(mask)
|
|
473
475
|
|
|
474
476
|
|
|
475
477
|
var handClose = function handClose() {
|
|
476
|
-
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'self';
|
|
477
|
-
setCloseWay(function () {
|
|
478
|
-
return type === 'cross' ? 'cross' : 'self';
|
|
479
|
-
});
|
|
480
478
|
setShowPopup(false);
|
|
481
479
|
}; // 点击遮罩层关闭
|
|
482
480
|
|
|
483
481
|
|
|
484
482
|
var clickOverlay = function clickOverlay() {
|
|
485
|
-
setCloseWay('mask');
|
|
486
483
|
closeMask && closeMask({
|
|
487
484
|
closeWay: 'mask'
|
|
488
485
|
});
|
|
@@ -571,9 +568,9 @@ var Address = function Address(props) {
|
|
|
571
568
|
color: "#cccccc"
|
|
572
569
|
})), React__default.createElement("div", {
|
|
573
570
|
className: b('header__title')
|
|
574
|
-
}, privateType === 'custom' ? customAddressTitle : existAddressTitle), React__default.createElement("div", {
|
|
571
|
+
}, privateType === 'custom' ? locale.address.selectRegion || customAddressTitle : locale.address.deliveryTo || existAddressTitle), React__default.createElement("div", {
|
|
575
572
|
onClick: function onClick() {
|
|
576
|
-
return handClose(
|
|
573
|
+
return handClose();
|
|
577
574
|
}
|
|
578
575
|
}, closeBtnIcon && React__default.createElement(Icon, {
|
|
579
576
|
name: closeBtnIcon,
|
|
@@ -594,9 +591,6 @@ var Address = function Address(props) {
|
|
|
594
591
|
visible: showPopup,
|
|
595
592
|
position: "bottom",
|
|
596
593
|
onClickOverlay: clickOverlay,
|
|
597
|
-
onOpen: function onOpen() {
|
|
598
|
-
setCloseWay('self');
|
|
599
|
-
},
|
|
600
594
|
onClose: function onClose() {
|
|
601
595
|
closeFun();
|
|
602
596
|
}
|
|
@@ -620,7 +614,7 @@ var Address = function Address(props) {
|
|
|
620
614
|
selectedIcon: selectedIcon,
|
|
621
615
|
defaultIcon: defaultIcon,
|
|
622
616
|
isShowCustomAddress: isShowCustomAddress,
|
|
623
|
-
customAndExistTitle: customAndExistTitle,
|
|
617
|
+
customAndExistTitle: locale.address.chooseAnotherAddress || customAndExistTitle,
|
|
624
618
|
onSelected: selectedExist,
|
|
625
619
|
onSwitchModule: onSwitchModule
|
|
626
620
|
}))));
|
package/dist/esm/Badge.js
CHANGED
|
@@ -19,10 +19,8 @@ var defaultProps = {
|
|
|
19
19
|
|
|
20
20
|
var Badge = function Badge(props) {
|
|
21
21
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
22
|
-
value = _defaultProps$props.value,
|
|
23
22
|
children = _defaultProps$props.children,
|
|
24
23
|
dot = _defaultProps$props.dot,
|
|
25
|
-
max = _defaultProps$props.max,
|
|
26
24
|
top = _defaultProps$props.top,
|
|
27
25
|
right = _defaultProps$props.right,
|
|
28
26
|
zIndex = _defaultProps$props.zIndex,
|
package/dist/esm/Calendar.js
CHANGED
|
@@ -8,6 +8,7 @@ import React__default from 'react';
|
|
|
8
8
|
import Popup from './Popup.js';
|
|
9
9
|
import CalendarItem from './CalendarItem.js';
|
|
10
10
|
import { U as Utils } from './date-b4847376.js';
|
|
11
|
+
import { useConfig } from './ConfigProvider.js';
|
|
11
12
|
var defaultProps = {
|
|
12
13
|
type: 'one',
|
|
13
14
|
isAutoBackFill: false,
|
|
@@ -22,6 +23,9 @@ var defaultProps = {
|
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
var Calendar = function Calendar(props) {
|
|
26
|
+
var _useConfig = useConfig(),
|
|
27
|
+
locale = _useConfig.locale;
|
|
28
|
+
|
|
25
29
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
26
30
|
children = _defaultProps$props.children,
|
|
27
31
|
poppable = _defaultProps$props.poppable,
|
|
@@ -61,7 +65,7 @@ var Calendar = function Calendar(props) {
|
|
|
61
65
|
type: type,
|
|
62
66
|
isAutoBackFill: isAutoBackFill,
|
|
63
67
|
poppable: poppable,
|
|
64
|
-
title: title,
|
|
68
|
+
title: locale.calendaritem.title || title,
|
|
65
69
|
defaultValue: defaultValue,
|
|
66
70
|
startDate: startDate,
|
|
67
71
|
endDate: endDate,
|
|
@@ -72,7 +76,7 @@ var Calendar = function Calendar(props) {
|
|
|
72
76
|
type: type,
|
|
73
77
|
isAutoBackFill: isAutoBackFill,
|
|
74
78
|
poppable: poppable,
|
|
75
|
-
title: title,
|
|
79
|
+
title: locale.calendaritem.title,
|
|
76
80
|
defaultValue: defaultValue,
|
|
77
81
|
startDate: startDate,
|
|
78
82
|
endDate: endDate,
|
package/dist/esm/CalendarItem.js
CHANGED
|
@@ -10,6 +10,7 @@ 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
12
|
import { U as Utils } from './date-b4847376.js';
|
|
13
|
+
import { useConfig } from './ConfigProvider.js';
|
|
13
14
|
import '@bem-react/classname';
|
|
14
15
|
|
|
15
16
|
function requestAniFrame() {
|
|
@@ -42,12 +43,13 @@ var defaultProps = {
|
|
|
42
43
|
var CalendarItem = function CalendarItem(props) {
|
|
43
44
|
var _classNames, _classNames2;
|
|
44
45
|
|
|
46
|
+
var _useConfig = useConfig(),
|
|
47
|
+
locale = _useConfig.locale;
|
|
48
|
+
|
|
45
49
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
46
|
-
children = _defaultProps$props.children,
|
|
47
50
|
type = _defaultProps$props.type,
|
|
48
51
|
isAutoBackFill = _defaultProps$props.isAutoBackFill,
|
|
49
52
|
poppable = _defaultProps$props.poppable,
|
|
50
|
-
visible = _defaultProps$props.visible,
|
|
51
53
|
title = _defaultProps$props.title,
|
|
52
54
|
defaultValue = _defaultProps$props.defaultValue,
|
|
53
55
|
startDate = _defaultProps$props.startDate,
|
|
@@ -56,7 +58,7 @@ var CalendarItem = function CalendarItem(props) {
|
|
|
56
58
|
onUpdate = _defaultProps$props.onUpdate,
|
|
57
59
|
onClose = _defaultProps$props.onClose;
|
|
58
60
|
|
|
59
|
-
var weeks =
|
|
61
|
+
var weeks = locale.calendaritem.weekdays;
|
|
60
62
|
|
|
61
63
|
var _useState = useState(''),
|
|
62
64
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -95,9 +97,8 @@ var CalendarItem = function CalendarItem(props) {
|
|
|
95
97
|
isRange: type === 'range',
|
|
96
98
|
timer: 0
|
|
97
99
|
}),
|
|
98
|
-
_useState8 = _slicedToArray(_useState7,
|
|
99
|
-
state = _useState8[0]
|
|
100
|
-
setState = _useState8[1];
|
|
100
|
+
_useState8 = _slicedToArray(_useState7, 1),
|
|
101
|
+
state = _useState8[0];
|
|
101
102
|
|
|
102
103
|
var weeksPanel = useRef(null);
|
|
103
104
|
var months = useRef(null);
|
|
@@ -263,7 +264,7 @@ var CalendarItem = function CalendarItem(props) {
|
|
|
263
264
|
};
|
|
264
265
|
var monthInfo = {
|
|
265
266
|
curData: curData,
|
|
266
|
-
title:
|
|
267
|
+
title: locale.calendaritem.monthTitle(title.year, title.month),
|
|
267
268
|
monthData: [].concat(_toConsumableArray(getDaysStatus(preMonthDays, 'prev')), _toConsumableArray(getDaysStatus(currMonthDays, 'curr')))
|
|
268
269
|
};
|
|
269
270
|
|
|
@@ -491,7 +492,7 @@ var CalendarItem = function CalendarItem(props) {
|
|
|
491
492
|
className: headerClasses
|
|
492
493
|
}, poppable ? React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
493
494
|
className: "calendar-title"
|
|
494
|
-
}, title), React__default.createElement("div", {
|
|
495
|
+
}, locale.calendaritem.title), React__default.createElement("div", {
|
|
495
496
|
className: "calendar-curr-month"
|
|
496
497
|
}, yearMonthTitle)) : '', React__default.createElement("div", {
|
|
497
498
|
className: "calendar-weeks",
|
|
@@ -512,7 +513,7 @@ var CalendarItem = function CalendarItem(props) {
|
|
|
512
513
|
ref: monthsPanel
|
|
513
514
|
}, React__default.createElement("div", {
|
|
514
515
|
className: "calendar-loading-tip"
|
|
515
|
-
}, !unLoadPrev ?
|
|
516
|
+
}, !unLoadPrev ? locale.calendaritem.loadPreviousMonth : locale.calendaritem.noEarlierMonth), monthsData.map(function (month, key) {
|
|
516
517
|
return React__default.createElement("div", {
|
|
517
518
|
className: "calendar-month",
|
|
518
519
|
key: key
|
|
@@ -533,18 +534,18 @@ var CalendarItem = function CalendarItem(props) {
|
|
|
533
534
|
className: "calendar-day"
|
|
534
535
|
}, day.type === 'curr' ? day.day : ''), isCurrDay(month, day.day) ? React__default.createElement("div", {
|
|
535
536
|
className: "calendar-curr-tips"
|
|
536
|
-
},
|
|
537
|
+
}, locale.calendaritem.today) : '', isStartTip(day, month) ? React__default.createElement("div", {
|
|
537
538
|
className: "calendar-day-tip"
|
|
538
|
-
},
|
|
539
|
+
}, locale.calendaritem.start) : isEndTip(day, month) ? React__default.createElement("div", {
|
|
539
540
|
className: "calendar-day-tip"
|
|
540
|
-
},
|
|
541
|
+
}, locale.calendaritem.end) : '');
|
|
541
542
|
}))));
|
|
542
543
|
}))), poppable && !isAutoBackFill ? React__default.createElement("div", {
|
|
543
544
|
className: "nut-calendar-footer"
|
|
544
545
|
}, React__default.createElement("div", {
|
|
545
546
|
className: "calendar-confirm-btn",
|
|
546
547
|
onClick: confirm
|
|
547
|
-
},
|
|
548
|
+
}, locale.confirm)) : ''));
|
|
548
549
|
};
|
|
549
550
|
|
|
550
551
|
CalendarItem.defaultProps = defaultProps;
|
|
@@ -83,7 +83,7 @@ var CheckboxGroup = React__default.forwardRef(function (props, ref) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
function cloneChildren() {
|
|
86
|
-
return React__default.Children.map(children, function (child
|
|
86
|
+
return React__default.Children.map(children, function (child) {
|
|
87
87
|
var childChecked = validateChildChecked(child);
|
|
88
88
|
|
|
89
89
|
if (child.type.displayName !== 'NutCheckBox') {
|
package/dist/esm/Collapse.js
CHANGED
|
@@ -19,7 +19,7 @@ var defaultProps = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
function areEqual(prevProps, nextProps) {
|
|
22
|
-
return JSON.stringify(prevProps.activeName)
|
|
22
|
+
return JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var Collapse = memo(function (props) {
|
|
@@ -90,7 +90,7 @@ var Collapse = memo(function (props) {
|
|
|
90
90
|
|
|
91
91
|
return React__default.createElement("div", {
|
|
92
92
|
className: colBem()
|
|
93
|
-
}, childrenDom.map(function (item
|
|
93
|
+
}, childrenDom.map(function (item) {
|
|
94
94
|
return React__default.cloneElement(item, {
|
|
95
95
|
isOpen: defaultOpenIndex.includes(item.props.name),
|
|
96
96
|
onToggle: function onToggle(isOpen, name) {
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
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, { createContext, useContext } from 'react';
|
|
10
|
+
var zhCN = {
|
|
11
|
+
save: '保存',
|
|
12
|
+
confirm: '确认',
|
|
13
|
+
cancel: '取消',
|
|
14
|
+
done: '完成',
|
|
15
|
+
noData: '暂无数据',
|
|
16
|
+
placeholder: '请输入内容',
|
|
17
|
+
select: '请选择',
|
|
18
|
+
video: {
|
|
19
|
+
errorTip: '视频加载失败',
|
|
20
|
+
clickRetry: '点击重试'
|
|
21
|
+
},
|
|
22
|
+
fixednav: {
|
|
23
|
+
activeText: '收起导航',
|
|
24
|
+
unActiveText: '快速导航'
|
|
25
|
+
},
|
|
26
|
+
infiniteloading: {
|
|
27
|
+
pullRefreshText: '松开刷新',
|
|
28
|
+
loadText: '加载中……',
|
|
29
|
+
loadMoreText: '哎呀,这里是底部了啦'
|
|
30
|
+
},
|
|
31
|
+
pagination: {
|
|
32
|
+
prev: '上一页',
|
|
33
|
+
next: '下一页'
|
|
34
|
+
},
|
|
35
|
+
range: {
|
|
36
|
+
rangeText: '不在该区间内'
|
|
37
|
+
},
|
|
38
|
+
calendaritem: {
|
|
39
|
+
weekdays: ['日', '一', '二', '三', '四', '五', '六'],
|
|
40
|
+
end: '结束',
|
|
41
|
+
start: '开始',
|
|
42
|
+
title: '日历选择',
|
|
43
|
+
monthTitle: function monthTitle(year, month) {
|
|
44
|
+
return "".concat(year, "\u5E74").concat(month, "\u6708");
|
|
45
|
+
},
|
|
46
|
+
today: '今天',
|
|
47
|
+
loadPreviousMonth: '加载上一个月',
|
|
48
|
+
noEarlierMonth: '没有更早月份'
|
|
49
|
+
},
|
|
50
|
+
shortpassword: {
|
|
51
|
+
title: '请输入密码',
|
|
52
|
+
desc: '您使用了虚拟资产,请进行验证',
|
|
53
|
+
tips: '忘记密码'
|
|
54
|
+
},
|
|
55
|
+
uploader: {
|
|
56
|
+
ready: '准备完成',
|
|
57
|
+
readyUpload: '准备上传',
|
|
58
|
+
waitingUpload: '等待上传',
|
|
59
|
+
uploading: '上传中',
|
|
60
|
+
success: '上传成功',
|
|
61
|
+
error: '上传失败'
|
|
62
|
+
},
|
|
63
|
+
countdown: {
|
|
64
|
+
day: '天',
|
|
65
|
+
hour: '时',
|
|
66
|
+
minute: '分',
|
|
67
|
+
second: '秒'
|
|
68
|
+
},
|
|
69
|
+
address: {
|
|
70
|
+
selectRegion: '请选择所在地区',
|
|
71
|
+
deliveryTo: '配送至',
|
|
72
|
+
chooseAnotherAddress: '选择其他地址'
|
|
73
|
+
},
|
|
74
|
+
signature: {
|
|
75
|
+
reSign: '重签',
|
|
76
|
+
unSupportTpl: '对不起,当前浏览器不支持Canvas,无法使用本控件!'
|
|
77
|
+
},
|
|
78
|
+
ecard: {
|
|
79
|
+
chooseText: '请选择电子卡面值',
|
|
80
|
+
otherValueText: '其他面值',
|
|
81
|
+
placeholder: '请输入1-5000整数'
|
|
82
|
+
},
|
|
83
|
+
timeselect: {
|
|
84
|
+
pickupTime: '取件时间'
|
|
85
|
+
},
|
|
86
|
+
sku: {
|
|
87
|
+
buyNow: '立即购买',
|
|
88
|
+
buyNumber: '购买数量',
|
|
89
|
+
addToCard: '加入购物车'
|
|
90
|
+
},
|
|
91
|
+
skuheader: {
|
|
92
|
+
skuId: '商品编号'
|
|
93
|
+
},
|
|
94
|
+
addresslist: {
|
|
95
|
+
addAddress: '新建地址'
|
|
96
|
+
},
|
|
97
|
+
comment: {
|
|
98
|
+
complaintsText: '我要投诉',
|
|
99
|
+
additionalReview: function additionalReview(day) {
|
|
100
|
+
return "\u8D2D\u4E70".concat(day, "\u5929\u540E\u8FFD\u8BC4");
|
|
101
|
+
},
|
|
102
|
+
additionalImages: function additionalImages(length) {
|
|
103
|
+
return "".concat(length, "\u5F20\u8FFD\u8BC4\u56FE\u7247");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var defaultProps = {
|
|
108
|
+
locale: zhCN
|
|
109
|
+
};
|
|
110
|
+
var defaultConfigRef = {
|
|
111
|
+
current: {
|
|
112
|
+
locale: zhCN
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
var setDefaultConfig = function setDefaultConfig(config) {
|
|
117
|
+
defaultConfigRef.current = config;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
var getDefaultConfig = function getDefaultConfig() {
|
|
121
|
+
return defaultConfigRef.current;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
var useConfig = function useConfig() {
|
|
125
|
+
var _useContext;
|
|
126
|
+
|
|
127
|
+
return (_useContext = useContext(ConfigContext)) !== null && _useContext !== void 0 ? _useContext : getDefaultConfig();
|
|
128
|
+
}; // 创建一个 Context 对象
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
var ConfigContext = createContext(null);
|
|
132
|
+
|
|
133
|
+
var ConfigProvider = function ConfigProvider(props) {
|
|
134
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
135
|
+
children = _defaultProps$props.children,
|
|
136
|
+
config = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
137
|
+
|
|
138
|
+
var parentConfig = useConfig();
|
|
139
|
+
return React__default.createElement(ConfigContext.Provider, {
|
|
140
|
+
value: _objectSpread(_objectSpread({}, parentConfig), config)
|
|
141
|
+
}, children);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
ConfigProvider.defaultProps = defaultProps;
|
|
145
|
+
ConfigProvider.displayName = 'NutConfigProvider';
|
|
146
|
+
export { ConfigProvider as default, getDefaultConfig, setDefaultConfig, useConfig };
|
package/dist/esm/CountDown.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, useRef, 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
|
var defaultProps = {
|
|
14
15
|
showPlainText: false,
|
|
@@ -19,6 +20,9 @@ var defaultProps = {
|
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
var CountDown = function CountDown(props) {
|
|
23
|
+
var _useConfig = useConfig(),
|
|
24
|
+
locale = _useConfig.locale;
|
|
25
|
+
|
|
22
26
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
23
27
|
showPlainText = _defaultProps$props.showPlainText,
|
|
24
28
|
showDays = _defaultProps$props.showDays,
|
|
@@ -114,7 +118,7 @@ var CountDown = function CountDown(props) {
|
|
|
114
118
|
var t = timeStr;
|
|
115
119
|
t = t > 0 ? +t : t.toString().replace(/\-/g, '/');
|
|
116
120
|
return new Date(t).getTime();
|
|
117
|
-
}; //
|
|
121
|
+
}; // 展示文案,English todo @hanyuxinting
|
|
118
122
|
|
|
119
123
|
|
|
120
124
|
var plainText = function () {
|
|
@@ -122,8 +126,8 @@ var CountDown = function CountDown(props) {
|
|
|
122
126
|
h = resttime.h,
|
|
123
127
|
m = resttime.m,
|
|
124
128
|
s = resttime.s;
|
|
125
|
-
var showDayshours = Number(d) > 0 && showDays ? "".concat(d
|
|
126
|
-
return "".concat(showDayshours
|
|
129
|
+
var showDayshours = Number(d) > 0 && showDays ? "".concat(d).concat(locale.countdown.day).concat(h) : h;
|
|
130
|
+
return "".concat(showDayshours).concat(locale.countdown.hour).concat(m).concat(locale.countdown.minute).concat(s).concat(locale.countdown.second);
|
|
127
131
|
}(); // 初始化
|
|
128
132
|
|
|
129
133
|
|
|
@@ -199,7 +203,7 @@ var CountDown = function CountDown(props) {
|
|
|
199
203
|
className: b('block')
|
|
200
204
|
}, resttime.d), React__default.createElement("div", {
|
|
201
205
|
className: b('dot')
|
|
202
|
-
},
|
|
206
|
+
}, locale.countdown.day || ':')) : null, React__default.createElement("div", {
|
|
203
207
|
className: b('block')
|
|
204
208
|
}, resttime.h), React__default.createElement("div", {
|
|
205
209
|
className: b('dot')
|
package/dist/esm/Dialog.js
CHANGED
|
@@ -12,6 +12,7 @@ import classNames from 'classnames';
|
|
|
12
12
|
import Button from './Button.js';
|
|
13
13
|
import { CSSTransition } from 'react-transition-group';
|
|
14
14
|
import ReactDOM__default from 'react-dom';
|
|
15
|
+
import { useConfig } from './ConfigProvider.js';
|
|
15
16
|
|
|
16
17
|
var Content = function Content(props) {
|
|
17
18
|
var visible = props.visible,
|
|
@@ -249,6 +250,9 @@ var defaultProps = {
|
|
|
249
250
|
};
|
|
250
251
|
|
|
251
252
|
var BaseDialog = function BaseDialog(props, ref) {
|
|
253
|
+
var _useConfig = useConfig(),
|
|
254
|
+
locale = _useConfig.locale;
|
|
255
|
+
|
|
252
256
|
var visible = props.visible,
|
|
253
257
|
footer = props.footer,
|
|
254
258
|
noOkBtn = props.noOkBtn,
|
|
@@ -266,7 +270,7 @@ var BaseDialog = function BaseDialog(props, ref) {
|
|
|
266
270
|
var renderFooter = function renderFooter() {
|
|
267
271
|
if (footer === null) return;
|
|
268
272
|
|
|
269
|
-
var handleCancel = function handleCancel(
|
|
273
|
+
var handleCancel = function handleCancel() {
|
|
270
274
|
if (!cancelAutoClose) return;
|
|
271
275
|
onClosed === null || onClosed === void 0 ? void 0 : onClosed();
|
|
272
276
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
@@ -293,7 +297,7 @@ var BaseDialog = function BaseDialog(props, ref) {
|
|
|
293
297
|
onClick: function onClick() {
|
|
294
298
|
return handleCancel();
|
|
295
299
|
}
|
|
296
|
-
}, cancelText), !noOkBtn && React__default.createElement(Button, {
|
|
300
|
+
}, locale.cancel || cancelText), !noOkBtn && React__default.createElement(Button, {
|
|
297
301
|
size: "small",
|
|
298
302
|
type: "primary",
|
|
299
303
|
className: classNames('nut-dialog__footer-ok', {
|
|
@@ -303,7 +307,7 @@ var BaseDialog = function BaseDialog(props, ref) {
|
|
|
303
307
|
onClick: function onClick() {
|
|
304
308
|
return handleOk();
|
|
305
309
|
}
|
|
306
|
-
}, okText));
|
|
310
|
+
}, locale.confirm || okText));
|
|
307
311
|
return footerContent;
|
|
308
312
|
};
|
|
309
313
|
|
package/dist/esm/FixedNav.js
CHANGED
|
@@ -11,6 +11,7 @@ import classNames from 'classnames';
|
|
|
11
11
|
import Icon from './Icon.js';
|
|
12
12
|
import Overlay from './Overlay.js';
|
|
13
13
|
import { c as cn } from './bem-893ad28d.js';
|
|
14
|
+
import { useConfig } from './ConfigProvider.js';
|
|
14
15
|
import '@bem-react/classname';
|
|
15
16
|
var defaultProps = {
|
|
16
17
|
fixednavClass: 'nut-fixednav',
|
|
@@ -24,6 +25,9 @@ var defaultProps = {
|
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
var FixedNav = function FixedNav(props) {
|
|
28
|
+
var _useConfig = useConfig(),
|
|
29
|
+
locale = _useConfig.locale;
|
|
30
|
+
|
|
27
31
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
28
32
|
fixednavClass = _defaultProps$props.fixednavClass,
|
|
29
33
|
overlay = _defaultProps$props.overlay,
|
|
@@ -97,7 +101,7 @@ var FixedNav = function FixedNav(props) {
|
|
|
97
101
|
color: "#fff"
|
|
98
102
|
}), React__default.createElement("div", {
|
|
99
103
|
className: "text"
|
|
100
|
-
}, visible ? activeText : unActiveText))));
|
|
104
|
+
}, visible ? locale.fixednav.activeText || activeText : locale.fixednav.unActiveText || unActiveText))));
|
|
101
105
|
};
|
|
102
106
|
|
|
103
107
|
FixedNav.defaultProps = defaultProps;
|
|
@@ -11,6 +11,7 @@ import React__default, { useState, useRef, useEffect } from 'react';
|
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { c as cn } from './bem-893ad28d.js';
|
|
13
13
|
import Icon from './Icon.js';
|
|
14
|
+
import { useConfig } from './ConfigProvider.js';
|
|
14
15
|
import '@bem-react/classname';
|
|
15
16
|
var defaultProps = {
|
|
16
17
|
hasMore: true,
|
|
@@ -27,6 +28,9 @@ var defaultProps = {
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
var Infiniteloading = function Infiniteloading(props) {
|
|
31
|
+
var _useConfig = useConfig(),
|
|
32
|
+
locale = _useConfig.locale;
|
|
33
|
+
|
|
30
34
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
31
35
|
children = _defaultProps$props.children,
|
|
32
36
|
hasMore = _defaultProps$props.hasMore,
|
|
@@ -213,7 +217,7 @@ var Infiniteloading = function Infiniteloading(props) {
|
|
|
213
217
|
name: pullIcon
|
|
214
218
|
}), React__default.createElement("span", {
|
|
215
219
|
className: "top-text"
|
|
216
|
-
}, pullTxt))), React__default.createElement("div", {
|
|
220
|
+
}, locale.infiniteloading.pullRefreshText || pullTxt))), React__default.createElement("div", {
|
|
217
221
|
className: "nut-infinite-container"
|
|
218
222
|
}, children), React__default.createElement("div", {
|
|
219
223
|
className: "nut-infinite-bottom"
|
|
@@ -224,9 +228,9 @@ var Infiniteloading = function Infiniteloading(props) {
|
|
|
224
228
|
name: loadIcon
|
|
225
229
|
}), React__default.createElement("div", {
|
|
226
230
|
className: "bottom-text"
|
|
227
|
-
}, loadTxt)) : !hasMore && React__default.createElement("div", {
|
|
231
|
+
}, locale.infiniteloading.loadText || loadTxt)) : !hasMore && React__default.createElement("div", {
|
|
228
232
|
className: "tips"
|
|
229
|
-
}, loadMoreTxt)));
|
|
233
|
+
}, locale.infiniteloading.loadMoreText || loadMoreTxt)));
|
|
230
234
|
};
|
|
231
235
|
|
|
232
236
|
Infiniteloading.defaultProps = defaultProps;
|
package/dist/esm/Input.js
CHANGED
|
@@ -8,6 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
import React__default, { useState, useEffect } from 'react';
|
|
9
9
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
10
|
import Icon from './Icon.js';
|
|
11
|
+
import { useConfig } from './ConfigProvider.js';
|
|
11
12
|
import '@bem-react/classname';
|
|
12
13
|
|
|
13
14
|
function trimExtraChar(value, _char, regExp) {
|
|
@@ -58,6 +59,9 @@ var defaultProps = {
|
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
var Input = function Input(props) {
|
|
62
|
+
var _useConfig = useConfig(),
|
|
63
|
+
locale = _useConfig.locale;
|
|
64
|
+
|
|
61
65
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
62
66
|
type = _defaultProps$props.type,
|
|
63
67
|
defaultValue = _defaultProps$props.defaultValue,
|
|
@@ -155,7 +159,7 @@ var Input = function Input(props) {
|
|
|
155
159
|
}, label) : null), React__default.createElement("input", {
|
|
156
160
|
className: "input-text",
|
|
157
161
|
type: type,
|
|
158
|
-
placeholder: placeholder,
|
|
162
|
+
placeholder: locale.placeholder || placeholder,
|
|
159
163
|
disabled: disabled,
|
|
160
164
|
readOnly: readonly,
|
|
161
165
|
value: inputValue,
|