@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/nutui.react.es.js
CHANGED
|
@@ -1,40 +1,5 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b2) => {
|
|
9
|
-
for (var prop in b2 || (b2 = {}))
|
|
10
|
-
if (__hasOwnProp.call(b2, prop))
|
|
11
|
-
__defNormalProp(a, prop, b2[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b2)) {
|
|
14
|
-
if (__propIsEnum.call(b2, prop))
|
|
15
|
-
__defNormalProp(a, prop, b2[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b2) => __defProps(a, __getOwnPropDescs(b2));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __publicField = (obj, key, value) => {
|
|
33
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
|
-
return value;
|
|
35
|
-
};
|
|
36
1
|
/*!
|
|
37
|
-
* @nutui/nutui-react v1.
|
|
2
|
+
* @nutui/nutui-react v1.2.0-beta.2 Tue Jul 26 2022 15:12:30 GMT+0800 (China Standard Time)
|
|
38
3
|
* (c) 2022 @jdf2e.
|
|
39
4
|
* Released under the MIT License.
|
|
40
5
|
*/
|
|
@@ -52,13 +17,13 @@ function r$1(r2) {
|
|
|
52
17
|
for (var s in a)
|
|
53
18
|
if (a.hasOwnProperty(s)) {
|
|
54
19
|
var p2 = a[s];
|
|
55
|
-
|
|
20
|
+
true === p2 ? v2 += u + s : p2 && (v2 += u + s + n2 + p2);
|
|
56
21
|
}
|
|
57
22
|
}
|
|
58
|
-
if (
|
|
23
|
+
if (void 0 !== o)
|
|
59
24
|
for (var c6 = 0, l2 = o.length; c6 < l2; c6++) {
|
|
60
25
|
var y2 = o[c6];
|
|
61
|
-
if (y2 && typeof y2.valueOf()
|
|
26
|
+
if (y2 && "string" == typeof y2.valueOf())
|
|
62
27
|
for (var g2 = y2.valueOf().split(" "), d2 = 0; d2 < g2.length; d2++) {
|
|
63
28
|
var h2 = g2[d2];
|
|
64
29
|
h2 !== f2 && (v2 += " " + h2);
|
|
@@ -69,7 +34,7 @@ function r$1(r2) {
|
|
|
69
34
|
var t2 = r2.n || "", n2 = r2.v || r2.m;
|
|
70
35
|
return function(r3, t3) {
|
|
71
36
|
return function(n3, i, a) {
|
|
72
|
-
return typeof n3
|
|
37
|
+
return "string" == typeof n3 ? Array.isArray(i) ? e2(r3, n3, void 0, i) : e2(r3, n3, i, a) : e2(r3, t3, n3, i);
|
|
73
38
|
};
|
|
74
39
|
};
|
|
75
40
|
}
|
|
@@ -80,7 +45,7 @@ classname_production_min.cn = e$1, classname_production_min.withNaming = r$1;
|
|
|
80
45
|
classname.exports = classname_production_min;
|
|
81
46
|
}
|
|
82
47
|
const cn = classname.exports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
83
|
-
const defaultProps
|
|
48
|
+
const defaultProps$13 = {
|
|
84
49
|
name: "",
|
|
85
50
|
size: "",
|
|
86
51
|
classPrefix: "nutui-iconfont",
|
|
@@ -94,7 +59,21 @@ function pxCheck$2(value) {
|
|
|
94
59
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
95
60
|
}
|
|
96
61
|
const Icon = (props) => {
|
|
97
|
-
const
|
|
62
|
+
const {
|
|
63
|
+
name,
|
|
64
|
+
size,
|
|
65
|
+
classPrefix,
|
|
66
|
+
color,
|
|
67
|
+
tag,
|
|
68
|
+
children,
|
|
69
|
+
className,
|
|
70
|
+
style,
|
|
71
|
+
click,
|
|
72
|
+
...rest
|
|
73
|
+
} = {
|
|
74
|
+
...defaultProps$13,
|
|
75
|
+
...props
|
|
76
|
+
};
|
|
98
77
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
99
78
|
const type = isImage ? "img" : tag;
|
|
100
79
|
const b2 = cn("icon");
|
|
@@ -108,21 +87,23 @@ const Icon = (props) => {
|
|
|
108
87
|
return { src: name };
|
|
109
88
|
return {};
|
|
110
89
|
};
|
|
111
|
-
return React__default.createElement(type,
|
|
90
|
+
return React__default.createElement(type, {
|
|
112
91
|
className: isImage ? `${className || ""} ${b2("img")}` : `${className || ""} ${b2(null, [classPrefix])} nut-icon-${name} `,
|
|
113
|
-
style:
|
|
92
|
+
style: {
|
|
114
93
|
color,
|
|
115
94
|
fontSize: pxCheck$2(size),
|
|
116
95
|
width: pxCheck$2(size),
|
|
117
|
-
height: pxCheck$2(size)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
96
|
+
height: pxCheck$2(size),
|
|
97
|
+
...style
|
|
98
|
+
},
|
|
99
|
+
...rest,
|
|
100
|
+
onClick: handleClick,
|
|
101
|
+
...hasSrc()
|
|
102
|
+
}, children);
|
|
122
103
|
};
|
|
123
|
-
Icon.defaultProps = defaultProps
|
|
104
|
+
Icon.defaultProps = defaultProps$13;
|
|
124
105
|
Icon.displayName = "NutIcon";
|
|
125
|
-
const defaultProps$
|
|
106
|
+
const defaultProps$12 = {
|
|
126
107
|
className: "",
|
|
127
108
|
color: "",
|
|
128
109
|
shape: "round",
|
|
@@ -139,7 +120,7 @@ const defaultProps$_ = {
|
|
|
139
120
|
}
|
|
140
121
|
};
|
|
141
122
|
const Button = (props) => {
|
|
142
|
-
const
|
|
123
|
+
const {
|
|
143
124
|
color,
|
|
144
125
|
shape,
|
|
145
126
|
plain,
|
|
@@ -152,22 +133,12 @@ const Button = (props) => {
|
|
|
152
133
|
children,
|
|
153
134
|
onClick,
|
|
154
135
|
className,
|
|
155
|
-
style
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
"disabled",
|
|
162
|
-
"type",
|
|
163
|
-
"size",
|
|
164
|
-
"block",
|
|
165
|
-
"icon",
|
|
166
|
-
"children",
|
|
167
|
-
"onClick",
|
|
168
|
-
"className",
|
|
169
|
-
"style"
|
|
170
|
-
]);
|
|
136
|
+
style,
|
|
137
|
+
...rest
|
|
138
|
+
} = {
|
|
139
|
+
...defaultProps$12,
|
|
140
|
+
...props
|
|
141
|
+
};
|
|
171
142
|
const getStyle = useCallback(() => {
|
|
172
143
|
const style2 = {};
|
|
173
144
|
if (color) {
|
|
@@ -224,12 +195,12 @@ const Button = (props) => {
|
|
|
224
195
|
onClick(e2);
|
|
225
196
|
}
|
|
226
197
|
};
|
|
227
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
198
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
228
199
|
className: `${btnName} ${className}`,
|
|
229
|
-
style:
|
|
230
|
-
|
|
200
|
+
style: { ...btnStyle, ...style },
|
|
201
|
+
...rest,
|
|
231
202
|
onClick: (e2) => handleClick(e2)
|
|
232
|
-
}
|
|
203
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
233
204
|
className: "nut-button__warp",
|
|
234
205
|
style: getStyle()
|
|
235
206
|
}, loading && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
@@ -238,10 +209,10 @@ const Button = (props) => {
|
|
|
238
209
|
name: icon
|
|
239
210
|
}) : "", children));
|
|
240
211
|
};
|
|
241
|
-
Button.defaultProps = defaultProps$
|
|
212
|
+
Button.defaultProps = defaultProps$12;
|
|
242
213
|
Button.displayName = "NutButton";
|
|
243
214
|
function _setPrototypeOf(o, p2) {
|
|
244
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
215
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
245
216
|
o2.__proto__ = p3;
|
|
246
217
|
return o2;
|
|
247
218
|
};
|
|
@@ -262,7 +233,7 @@ function emptyFunctionWithReset() {
|
|
|
262
233
|
}
|
|
263
234
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
264
235
|
var factoryWithThrowingShims = function() {
|
|
265
|
-
function shim(props, propName, componentName,
|
|
236
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
266
237
|
if (secret === ReactPropTypesSecret) {
|
|
267
238
|
return;
|
|
268
239
|
}
|
|
@@ -305,7 +276,7 @@ var factoryWithThrowingShims = function() {
|
|
|
305
276
|
}
|
|
306
277
|
var PropTypes = propTypes.exports;
|
|
307
278
|
function _extends$3() {
|
|
308
|
-
_extends$3 = Object.assign
|
|
279
|
+
_extends$3 = Object.assign ? Object.assign.bind() : function(target) {
|
|
309
280
|
for (var i = 1; i < arguments.length; i++) {
|
|
310
281
|
var source = arguments[i];
|
|
311
282
|
for (var key in source) {
|
|
@@ -406,8 +377,8 @@ function parsePath(path) {
|
|
|
406
377
|
hash: hash === "#" ? "" : hash
|
|
407
378
|
};
|
|
408
379
|
}
|
|
409
|
-
function createPath(
|
|
410
|
-
var pathname =
|
|
380
|
+
function createPath(location) {
|
|
381
|
+
var pathname = location.pathname, search = location.search, hash = location.hash;
|
|
411
382
|
var path = pathname || "/";
|
|
412
383
|
if (search && search !== "?")
|
|
413
384
|
path += search.charAt(0) === "?" ? search : "?" + search;
|
|
@@ -416,52 +387,52 @@ function createPath(location2) {
|
|
|
416
387
|
return path;
|
|
417
388
|
}
|
|
418
389
|
function createLocation(path, state, key, currentLocation) {
|
|
419
|
-
var
|
|
390
|
+
var location;
|
|
420
391
|
if (typeof path === "string") {
|
|
421
|
-
|
|
422
|
-
|
|
392
|
+
location = parsePath(path);
|
|
393
|
+
location.state = state;
|
|
423
394
|
} else {
|
|
424
|
-
|
|
425
|
-
if (
|
|
426
|
-
|
|
427
|
-
if (
|
|
428
|
-
if (
|
|
429
|
-
|
|
395
|
+
location = _extends$3({}, path);
|
|
396
|
+
if (location.pathname === void 0)
|
|
397
|
+
location.pathname = "";
|
|
398
|
+
if (location.search) {
|
|
399
|
+
if (location.search.charAt(0) !== "?")
|
|
400
|
+
location.search = "?" + location.search;
|
|
430
401
|
} else {
|
|
431
|
-
|
|
402
|
+
location.search = "";
|
|
432
403
|
}
|
|
433
|
-
if (
|
|
434
|
-
if (
|
|
435
|
-
|
|
404
|
+
if (location.hash) {
|
|
405
|
+
if (location.hash.charAt(0) !== "#")
|
|
406
|
+
location.hash = "#" + location.hash;
|
|
436
407
|
} else {
|
|
437
|
-
|
|
408
|
+
location.hash = "";
|
|
438
409
|
}
|
|
439
|
-
if (state !== void 0 &&
|
|
440
|
-
|
|
410
|
+
if (state !== void 0 && location.state === void 0)
|
|
411
|
+
location.state = state;
|
|
441
412
|
}
|
|
442
413
|
try {
|
|
443
|
-
|
|
414
|
+
location.pathname = decodeURI(location.pathname);
|
|
444
415
|
} catch (e2) {
|
|
445
416
|
if (e2 instanceof URIError) {
|
|
446
|
-
throw new URIError('Pathname "' +
|
|
417
|
+
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. This is likely caused by an invalid percent-encoding.');
|
|
447
418
|
} else {
|
|
448
419
|
throw e2;
|
|
449
420
|
}
|
|
450
421
|
}
|
|
451
422
|
if (key)
|
|
452
|
-
|
|
423
|
+
location.key = key;
|
|
453
424
|
if (currentLocation) {
|
|
454
|
-
if (!
|
|
455
|
-
|
|
456
|
-
} else if (
|
|
457
|
-
|
|
425
|
+
if (!location.pathname) {
|
|
426
|
+
location.pathname = currentLocation.pathname;
|
|
427
|
+
} else if (location.pathname.charAt(0) !== "/") {
|
|
428
|
+
location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
|
|
458
429
|
}
|
|
459
430
|
} else {
|
|
460
|
-
if (!
|
|
461
|
-
|
|
431
|
+
if (!location.pathname) {
|
|
432
|
+
location.pathname = "/";
|
|
462
433
|
}
|
|
463
434
|
}
|
|
464
|
-
return
|
|
435
|
+
return location;
|
|
465
436
|
}
|
|
466
437
|
function createTransitionManager() {
|
|
467
438
|
var prompt = null;
|
|
@@ -472,9 +443,9 @@ function createTransitionManager() {
|
|
|
472
443
|
prompt = null;
|
|
473
444
|
};
|
|
474
445
|
}
|
|
475
|
-
function confirmTransitionTo(
|
|
446
|
+
function confirmTransitionTo(location, action, getUserConfirmation, callback) {
|
|
476
447
|
if (prompt != null) {
|
|
477
|
-
var result = typeof prompt === "function" ? prompt(
|
|
448
|
+
var result = typeof prompt === "function" ? prompt(location, action) : prompt;
|
|
478
449
|
if (typeof result === "string") {
|
|
479
450
|
if (typeof getUserConfirmation === "function") {
|
|
480
451
|
getUserConfirmation(result, callback);
|
|
@@ -542,21 +513,21 @@ function createMemoryHistory(props) {
|
|
|
542
513
|
var createHref = createPath;
|
|
543
514
|
function push(path, state) {
|
|
544
515
|
var action = "PUSH";
|
|
545
|
-
var
|
|
546
|
-
transitionManager.confirmTransitionTo(
|
|
516
|
+
var location = createLocation(path, state, createKey(), history.location);
|
|
517
|
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function(ok) {
|
|
547
518
|
if (!ok)
|
|
548
519
|
return;
|
|
549
520
|
var prevIndex = history.index;
|
|
550
521
|
var nextIndex = prevIndex + 1;
|
|
551
522
|
var nextEntries = history.entries.slice(0);
|
|
552
523
|
if (nextEntries.length > nextIndex) {
|
|
553
|
-
nextEntries.splice(nextIndex, nextEntries.length - nextIndex,
|
|
524
|
+
nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
|
|
554
525
|
} else {
|
|
555
|
-
nextEntries.push(
|
|
526
|
+
nextEntries.push(location);
|
|
556
527
|
}
|
|
557
528
|
setState({
|
|
558
529
|
action,
|
|
559
|
-
location
|
|
530
|
+
location,
|
|
560
531
|
index: nextIndex,
|
|
561
532
|
entries: nextEntries
|
|
562
533
|
});
|
|
@@ -564,26 +535,26 @@ function createMemoryHistory(props) {
|
|
|
564
535
|
}
|
|
565
536
|
function replace(path, state) {
|
|
566
537
|
var action = "REPLACE";
|
|
567
|
-
var
|
|
568
|
-
transitionManager.confirmTransitionTo(
|
|
538
|
+
var location = createLocation(path, state, createKey(), history.location);
|
|
539
|
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function(ok) {
|
|
569
540
|
if (!ok)
|
|
570
541
|
return;
|
|
571
|
-
history.entries[history.index] =
|
|
542
|
+
history.entries[history.index] = location;
|
|
572
543
|
setState({
|
|
573
544
|
action,
|
|
574
|
-
location
|
|
545
|
+
location
|
|
575
546
|
});
|
|
576
547
|
});
|
|
577
548
|
}
|
|
578
549
|
function go(n2) {
|
|
579
550
|
var nextIndex = clamp$1(history.index + n2, 0, history.entries.length - 1);
|
|
580
551
|
var action = "POP";
|
|
581
|
-
var
|
|
582
|
-
transitionManager.confirmTransitionTo(
|
|
552
|
+
var location = history.entries[nextIndex];
|
|
553
|
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function(ok) {
|
|
583
554
|
if (ok) {
|
|
584
555
|
setState({
|
|
585
556
|
action,
|
|
586
|
-
location
|
|
557
|
+
location,
|
|
587
558
|
index: nextIndex
|
|
588
559
|
});
|
|
589
560
|
} else {
|
|
@@ -1007,9 +978,9 @@ var reactIs_production_min = {};
|
|
|
1007
978
|
* This source code is licensed under the MIT license found in the
|
|
1008
979
|
* LICENSE file in the root directory of this source tree.
|
|
1009
980
|
*/
|
|
1010
|
-
var b = typeof Symbol
|
|
981
|
+
var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
|
|
1011
982
|
function z(a) {
|
|
1012
|
-
if (
|
|
983
|
+
if ("object" === typeof a && null !== a) {
|
|
1013
984
|
var u = a.$$typeof;
|
|
1014
985
|
switch (u) {
|
|
1015
986
|
case c:
|
|
@@ -1065,7 +1036,7 @@ reactIs_production_min.isContextProvider = function(a) {
|
|
|
1065
1036
|
return z(a) === h;
|
|
1066
1037
|
};
|
|
1067
1038
|
reactIs_production_min.isElement = function(a) {
|
|
1068
|
-
return
|
|
1039
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
1069
1040
|
};
|
|
1070
1041
|
reactIs_production_min.isForwardRef = function(a) {
|
|
1071
1042
|
return z(a) === n;
|
|
@@ -1092,7 +1063,7 @@ reactIs_production_min.isSuspense = function(a) {
|
|
|
1092
1063
|
return z(a) === p;
|
|
1093
1064
|
};
|
|
1094
1065
|
reactIs_production_min.isValidElementType = function(a) {
|
|
1095
|
-
return
|
|
1066
|
+
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
1096
1067
|
};
|
|
1097
1068
|
reactIs_production_min.typeOf = z;
|
|
1098
1069
|
{
|
|
@@ -1157,21 +1128,28 @@ var Router = /* @__PURE__ */ function(_React$Component) {
|
|
|
1157
1128
|
_this._isMounted = false;
|
|
1158
1129
|
_this._pendingLocation = null;
|
|
1159
1130
|
if (!props.staticContext) {
|
|
1160
|
-
_this.unlisten = props.history.listen(function(
|
|
1161
|
-
|
|
1162
|
-
_this.setState({
|
|
1163
|
-
location: location2
|
|
1164
|
-
});
|
|
1165
|
-
} else {
|
|
1166
|
-
_this._pendingLocation = location2;
|
|
1167
|
-
}
|
|
1131
|
+
_this.unlisten = props.history.listen(function(location) {
|
|
1132
|
+
_this._pendingLocation = location;
|
|
1168
1133
|
});
|
|
1169
1134
|
}
|
|
1170
1135
|
return _this;
|
|
1171
1136
|
}
|
|
1172
1137
|
var _proto = Router2.prototype;
|
|
1173
1138
|
_proto.componentDidMount = function componentDidMount() {
|
|
1139
|
+
var _this2 = this;
|
|
1174
1140
|
this._isMounted = true;
|
|
1141
|
+
if (this.unlisten) {
|
|
1142
|
+
this.unlisten();
|
|
1143
|
+
}
|
|
1144
|
+
if (!this.props.staticContext) {
|
|
1145
|
+
this.unlisten = this.props.history.listen(function(location) {
|
|
1146
|
+
if (_this2._isMounted) {
|
|
1147
|
+
_this2.setState({
|
|
1148
|
+
location
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1175
1153
|
if (this._pendingLocation) {
|
|
1176
1154
|
this.setState({
|
|
1177
1155
|
location: this._pendingLocation
|
|
@@ -1315,10 +1293,10 @@ function isEmptyChildren(children) {
|
|
|
1315
1293
|
var _this = this;
|
|
1316
1294
|
return /* @__PURE__ */ React__default.createElement(context.Consumer, null, function(context$1) {
|
|
1317
1295
|
!context$1 ? invariant(false) : void 0;
|
|
1318
|
-
var
|
|
1319
|
-
var match = _this.props.computedMatch ? _this.props.computedMatch : _this.props.path ? matchPath(
|
|
1296
|
+
var location = _this.props.location || context$1.location;
|
|
1297
|
+
var match = _this.props.computedMatch ? _this.props.computedMatch : _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
|
|
1320
1298
|
var props = _extends$3({}, context$1, {
|
|
1321
|
-
location
|
|
1299
|
+
location,
|
|
1322
1300
|
match
|
|
1323
1301
|
});
|
|
1324
1302
|
var _this$props = _this.props, children = _this$props.children, component = _this$props.component, render2 = _this$props.render;
|
|
@@ -1335,25 +1313,25 @@ function isEmptyChildren(children) {
|
|
|
1335
1313
|
function addLeadingSlash(path) {
|
|
1336
1314
|
return path.charAt(0) === "/" ? path : "/" + path;
|
|
1337
1315
|
}
|
|
1338
|
-
function addBasename(basename,
|
|
1316
|
+
function addBasename(basename, location) {
|
|
1339
1317
|
if (!basename)
|
|
1340
|
-
return
|
|
1341
|
-
return _extends$3({},
|
|
1342
|
-
pathname: addLeadingSlash(basename) +
|
|
1318
|
+
return location;
|
|
1319
|
+
return _extends$3({}, location, {
|
|
1320
|
+
pathname: addLeadingSlash(basename) + location.pathname
|
|
1343
1321
|
});
|
|
1344
1322
|
}
|
|
1345
|
-
function stripBasename(basename,
|
|
1323
|
+
function stripBasename(basename, location) {
|
|
1346
1324
|
if (!basename)
|
|
1347
|
-
return
|
|
1325
|
+
return location;
|
|
1348
1326
|
var base = addLeadingSlash(basename);
|
|
1349
|
-
if (
|
|
1350
|
-
return
|
|
1351
|
-
return _extends$3({},
|
|
1352
|
-
pathname:
|
|
1327
|
+
if (location.pathname.indexOf(base) !== 0)
|
|
1328
|
+
return location;
|
|
1329
|
+
return _extends$3({}, location, {
|
|
1330
|
+
pathname: location.pathname.substr(base.length)
|
|
1353
1331
|
});
|
|
1354
1332
|
}
|
|
1355
|
-
function createURL(
|
|
1356
|
-
return typeof
|
|
1333
|
+
function createURL(location) {
|
|
1334
|
+
return typeof location === "string" ? location : createPath(location);
|
|
1357
1335
|
}
|
|
1358
1336
|
function staticHandler(methodName) {
|
|
1359
1337
|
return function() {
|
|
@@ -1370,11 +1348,11 @@ function noop$3() {
|
|
|
1370
1348
|
args[_key] = arguments[_key];
|
|
1371
1349
|
}
|
|
1372
1350
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
1373
|
-
_this.handlePush = function(
|
|
1374
|
-
return _this.navigateTo(
|
|
1351
|
+
_this.handlePush = function(location) {
|
|
1352
|
+
return _this.navigateTo(location, "PUSH");
|
|
1375
1353
|
};
|
|
1376
|
-
_this.handleReplace = function(
|
|
1377
|
-
return _this.navigateTo(
|
|
1354
|
+
_this.handleReplace = function(location) {
|
|
1355
|
+
return _this.navigateTo(location, "REPLACE");
|
|
1378
1356
|
};
|
|
1379
1357
|
_this.handleListen = function() {
|
|
1380
1358
|
return noop$3;
|
|
@@ -1385,20 +1363,20 @@ function noop$3() {
|
|
|
1385
1363
|
return _this;
|
|
1386
1364
|
}
|
|
1387
1365
|
var _proto = StaticRouter.prototype;
|
|
1388
|
-
_proto.navigateTo = function navigateTo(
|
|
1366
|
+
_proto.navigateTo = function navigateTo(location, action) {
|
|
1389
1367
|
var _this$props = this.props, _this$props$basename = _this$props.basename, basename = _this$props$basename === void 0 ? "" : _this$props$basename, _this$props$context = _this$props.context, context2 = _this$props$context === void 0 ? {} : _this$props$context;
|
|
1390
1368
|
context2.action = action;
|
|
1391
|
-
context2.location = addBasename(basename, createLocation(
|
|
1369
|
+
context2.location = addBasename(basename, createLocation(location));
|
|
1392
1370
|
context2.url = createURL(context2.location);
|
|
1393
1371
|
};
|
|
1394
1372
|
_proto.render = function render() {
|
|
1395
|
-
var _this$props2 = this.props, _this$props2$basename = _this$props2.basename, basename = _this$props2$basename === void 0 ? "" : _this$props2$basename, _this$props2$context = _this$props2.context, context2 = _this$props2$context === void 0 ? {} : _this$props2$context, _this$props2$location = _this$props2.location,
|
|
1373
|
+
var _this$props2 = this.props, _this$props2$basename = _this$props2.basename, basename = _this$props2$basename === void 0 ? "" : _this$props2$basename, _this$props2$context = _this$props2.context, context2 = _this$props2$context === void 0 ? {} : _this$props2$context, _this$props2$location = _this$props2.location, location = _this$props2$location === void 0 ? "/" : _this$props2$location, rest = _objectWithoutPropertiesLoose$3(_this$props2, ["basename", "context", "location"]);
|
|
1396
1374
|
var history = {
|
|
1397
1375
|
createHref: function createHref(path) {
|
|
1398
1376
|
return addLeadingSlash(basename + createURL(path));
|
|
1399
1377
|
},
|
|
1400
1378
|
action: "POP",
|
|
1401
|
-
location: stripBasename(basename, createLocation(
|
|
1379
|
+
location: stripBasename(basename, createLocation(location)),
|
|
1402
1380
|
push: this.handlePush,
|
|
1403
1381
|
replace: this.handleReplace,
|
|
1404
1382
|
go: staticHandler(),
|
|
@@ -1424,19 +1402,19 @@ function noop$3() {
|
|
|
1424
1402
|
var _this = this;
|
|
1425
1403
|
return /* @__PURE__ */ React__default.createElement(context.Consumer, null, function(context2) {
|
|
1426
1404
|
!context2 ? invariant(false) : void 0;
|
|
1427
|
-
var
|
|
1405
|
+
var location = _this.props.location || context2.location;
|
|
1428
1406
|
var element, match;
|
|
1429
1407
|
React__default.Children.forEach(_this.props.children, function(child) {
|
|
1430
1408
|
if (match == null && /* @__PURE__ */ React__default.isValidElement(child)) {
|
|
1431
1409
|
element = child;
|
|
1432
1410
|
var path = child.props.path || child.props.from;
|
|
1433
|
-
match = path ? matchPath(
|
|
1411
|
+
match = path ? matchPath(location.pathname, _extends$3({}, child.props, {
|
|
1434
1412
|
path
|
|
1435
1413
|
})) : context2.match;
|
|
1436
1414
|
}
|
|
1437
1415
|
});
|
|
1438
1416
|
return match ? /* @__PURE__ */ React__default.cloneElement(element, {
|
|
1439
|
-
location
|
|
1417
|
+
location,
|
|
1440
1418
|
computedMatch: match
|
|
1441
1419
|
}) : null;
|
|
1442
1420
|
});
|
|
@@ -1447,51 +1425,49 @@ var useContext = React__default.useContext;
|
|
|
1447
1425
|
function useHistory() {
|
|
1448
1426
|
return useContext(historyContext);
|
|
1449
1427
|
}
|
|
1450
|
-
const defaultProps$
|
|
1451
|
-
title:
|
|
1452
|
-
subTitle:
|
|
1428
|
+
const defaultProps$11 = {
|
|
1429
|
+
title: null,
|
|
1430
|
+
subTitle: null,
|
|
1453
1431
|
desc: "",
|
|
1454
1432
|
descTextAlign: "right",
|
|
1455
1433
|
isLink: false,
|
|
1434
|
+
icon: "",
|
|
1435
|
+
roundRadius: "6px",
|
|
1436
|
+
url: "",
|
|
1456
1437
|
to: "",
|
|
1457
1438
|
replace: false,
|
|
1458
|
-
|
|
1459
|
-
|
|
1439
|
+
center: false,
|
|
1440
|
+
size: "",
|
|
1460
1441
|
className: "",
|
|
1461
|
-
|
|
1442
|
+
iconSlot: null,
|
|
1443
|
+
linkSlot: null,
|
|
1462
1444
|
click: (event) => {
|
|
1463
1445
|
}
|
|
1464
1446
|
};
|
|
1465
1447
|
const Cell = (props) => {
|
|
1466
|
-
const
|
|
1448
|
+
const {
|
|
1467
1449
|
children,
|
|
1468
1450
|
click,
|
|
1451
|
+
title,
|
|
1452
|
+
subTitle,
|
|
1453
|
+
desc,
|
|
1454
|
+
descTextAlign,
|
|
1469
1455
|
isLink,
|
|
1470
|
-
|
|
1456
|
+
icon,
|
|
1457
|
+
roundRadius,
|
|
1471
1458
|
url,
|
|
1459
|
+
to: to2,
|
|
1472
1460
|
replace,
|
|
1461
|
+
center,
|
|
1462
|
+
size,
|
|
1473
1463
|
className,
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
}
|
|
1481
|
-
"children",
|
|
1482
|
-
"click",
|
|
1483
|
-
"isLink",
|
|
1484
|
-
"to",
|
|
1485
|
-
"url",
|
|
1486
|
-
"replace",
|
|
1487
|
-
"className",
|
|
1488
|
-
"descTextAlign",
|
|
1489
|
-
"desc",
|
|
1490
|
-
"icon",
|
|
1491
|
-
"title",
|
|
1492
|
-
"subTitle",
|
|
1493
|
-
"extra"
|
|
1494
|
-
]);
|
|
1464
|
+
iconSlot,
|
|
1465
|
+
linkSlot,
|
|
1466
|
+
...rest
|
|
1467
|
+
} = {
|
|
1468
|
+
...defaultProps$11,
|
|
1469
|
+
...props
|
|
1470
|
+
};
|
|
1495
1471
|
const b2 = cn("cell");
|
|
1496
1472
|
const history = useHistory();
|
|
1497
1473
|
const handleClick = (event) => {
|
|
@@ -1499,48 +1475,68 @@ const Cell = (props) => {
|
|
|
1499
1475
|
if (to2 && history) {
|
|
1500
1476
|
history[replace ? "replace" : "push"](to2);
|
|
1501
1477
|
} else if (url) {
|
|
1502
|
-
replace ? location.replace(url) : location.href = url;
|
|
1478
|
+
replace ? window.location.replace(url) : window.location.href = url;
|
|
1503
1479
|
}
|
|
1504
1480
|
};
|
|
1481
|
+
const baseStyle = {
|
|
1482
|
+
borderRadius: Number.isNaN(Number(roundRadius)) ? String(roundRadius) : `${roundRadius}px`
|
|
1483
|
+
};
|
|
1505
1484
|
const styles = title || subTitle || icon ? {} : {
|
|
1506
1485
|
textAlign: descTextAlign,
|
|
1507
1486
|
flex: 1
|
|
1508
1487
|
};
|
|
1509
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
1510
|
-
className: `${b2({ clickable: !!(isLink || to2) }, [className])} `,
|
|
1511
|
-
onClick: (event) => handleClick(event)
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
}, icon ? /* @__PURE__ */ React__default.createElement(
|
|
1488
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1489
|
+
className: `${b2({ clickable: !!(isLink || to2), center, large: size === "large" }, [className])} `,
|
|
1490
|
+
onClick: (event) => handleClick(event),
|
|
1491
|
+
style: baseStyle,
|
|
1492
|
+
...rest
|
|
1493
|
+
}, children || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, icon || iconSlot ? /* @__PURE__ */ React__default.createElement("div", {
|
|
1494
|
+
className: b2("icon")
|
|
1495
|
+
}, iconSlot || (icon ? /* @__PURE__ */ React__default.createElement(Icon, {
|
|
1515
1496
|
name: icon,
|
|
1516
|
-
className:
|
|
1517
|
-
}) : null
|
|
1497
|
+
className: "icon"
|
|
1498
|
+
}) : null)) : null, title || subTitle ? /* @__PURE__ */ React__default.createElement("div", {
|
|
1499
|
+
className: `${b2("title")}`
|
|
1500
|
+
}, title ? /* @__PURE__ */ React__default.createElement("div", {
|
|
1518
1501
|
className: b2("maintitle")
|
|
1519
|
-
}, title), /* @__PURE__ */ React__default.createElement("div", {
|
|
1502
|
+
}, title) : null, subTitle ? /* @__PURE__ */ React__default.createElement("div", {
|
|
1520
1503
|
className: b2("subtitle")
|
|
1521
|
-
}, subTitle)
|
|
1522
|
-
className: b2("
|
|
1504
|
+
}, subTitle) : null) : null, desc ? /* @__PURE__ */ React__default.createElement("div", {
|
|
1505
|
+
className: b2("value", {
|
|
1506
|
+
alone: !title && !subTitle
|
|
1507
|
+
}),
|
|
1523
1508
|
style: styles
|
|
1524
|
-
}, desc) : null
|
|
1509
|
+
}, desc) : null, !linkSlot && (isLink || to2) ? /* @__PURE__ */ React__default.createElement(Icon, {
|
|
1525
1510
|
name: "right",
|
|
1526
1511
|
className: b2("link")
|
|
1527
|
-
}) :
|
|
1512
|
+
}) : linkSlot));
|
|
1528
1513
|
};
|
|
1529
|
-
Cell.defaultProps = defaultProps$
|
|
1514
|
+
Cell.defaultProps = defaultProps$11;
|
|
1530
1515
|
Cell.displayName = "NutCell";
|
|
1531
|
-
const defaultProps$
|
|
1516
|
+
const defaultProps$10 = {
|
|
1517
|
+
title: "",
|
|
1518
|
+
desc: "",
|
|
1519
|
+
titleSlot: null,
|
|
1520
|
+
descSlot: null,
|
|
1521
|
+
classPrefix: "nutui-cell-group"
|
|
1522
|
+
};
|
|
1532
1523
|
const CellGroup = (props) => {
|
|
1533
|
-
const { children, classPrefix, title } =
|
|
1524
|
+
const { children, classPrefix, title, desc, titleSlot, descSlot } = {
|
|
1525
|
+
...defaultProps$10,
|
|
1526
|
+
...props
|
|
1527
|
+
};
|
|
1534
1528
|
const b2 = cn("cell-group");
|
|
1535
1529
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
1536
1530
|
className: b2(null, [classPrefix])
|
|
1537
|
-
}, title ? /* @__PURE__ */ React__default.createElement("div", {
|
|
1531
|
+
}, titleSlot || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, title ? /* @__PURE__ */ React__default.createElement("div", {
|
|
1538
1532
|
className: b2("title")
|
|
1539
|
-
}, title) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
1533
|
+
}, title) : null), descSlot || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, title ? /* @__PURE__ */ React__default.createElement("div", {
|
|
1534
|
+
className: b2("desc")
|
|
1535
|
+
}, desc) : null), /* @__PURE__ */ React__default.createElement("div", {
|
|
1540
1536
|
className: b2("wrap")
|
|
1541
1537
|
}, children));
|
|
1542
1538
|
};
|
|
1543
|
-
CellGroup.defaultProps = defaultProps$
|
|
1539
|
+
CellGroup.defaultProps = defaultProps$10;
|
|
1544
1540
|
CellGroup.displayName = "NutCellGroup";
|
|
1545
1541
|
var classnames = { exports: {} };
|
|
1546
1542
|
/*!
|
|
@@ -1600,7 +1596,7 @@ const defaultOverlayProps = {
|
|
|
1600
1596
|
overlayStyle: {}
|
|
1601
1597
|
};
|
|
1602
1598
|
const Overlay = (props) => {
|
|
1603
|
-
const
|
|
1599
|
+
const {
|
|
1604
1600
|
children,
|
|
1605
1601
|
zIndex,
|
|
1606
1602
|
duration,
|
|
@@ -1608,17 +1604,12 @@ const Overlay = (props) => {
|
|
|
1608
1604
|
closeOnClickOverlay,
|
|
1609
1605
|
visible,
|
|
1610
1606
|
lockScroll,
|
|
1611
|
-
overlayStyle
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
"closeOnClickOverlay",
|
|
1618
|
-
"visible",
|
|
1619
|
-
"lockScroll",
|
|
1620
|
-
"overlayStyle"
|
|
1621
|
-
]);
|
|
1607
|
+
overlayStyle,
|
|
1608
|
+
...rest
|
|
1609
|
+
} = {
|
|
1610
|
+
...defaultOverlayProps,
|
|
1611
|
+
...props
|
|
1612
|
+
};
|
|
1622
1613
|
const [show, setShow] = useState(visible);
|
|
1623
1614
|
const renderRef = useRef(true);
|
|
1624
1615
|
const intervalRef = useRef(0);
|
|
@@ -1639,10 +1630,11 @@ const Overlay = (props) => {
|
|
|
1639
1630
|
"first-render": renderRef.current && !visible,
|
|
1640
1631
|
"hidden-render": !visible
|
|
1641
1632
|
}, overlayClass, b2(""));
|
|
1642
|
-
const styles =
|
|
1633
|
+
const styles = {
|
|
1643
1634
|
zIndex,
|
|
1644
|
-
animationDuration: `${props.duration}s
|
|
1645
|
-
|
|
1635
|
+
animationDuration: `${props.duration}s`,
|
|
1636
|
+
...overlayStyle
|
|
1637
|
+
};
|
|
1646
1638
|
const lock = () => {
|
|
1647
1639
|
if (lockScroll && visible) {
|
|
1648
1640
|
document.body.classList.add("nut-overflow-hidden");
|
|
@@ -1660,12 +1652,12 @@ const Overlay = (props) => {
|
|
|
1660
1652
|
intervalRef.current = id;
|
|
1661
1653
|
}
|
|
1662
1654
|
};
|
|
1663
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div",
|
|
1655
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
1664
1656
|
className: classes,
|
|
1665
|
-
style: styles
|
|
1666
|
-
|
|
1657
|
+
style: styles,
|
|
1658
|
+
...rest,
|
|
1667
1659
|
onClick: handleClick
|
|
1668
|
-
}
|
|
1660
|
+
}, children));
|
|
1669
1661
|
};
|
|
1670
1662
|
Overlay.defaultProps = defaultOverlayProps;
|
|
1671
1663
|
Overlay.displayName = "NutOverlay";
|
|
@@ -2084,7 +2076,7 @@ CSSTransition.defaultProps = {
|
|
|
2084
2076
|
};
|
|
2085
2077
|
CSSTransition.propTypes = {};
|
|
2086
2078
|
var CSSTransition$1 = CSSTransition;
|
|
2087
|
-
const defaultProps
|
|
2079
|
+
const defaultProps$$ = {
|
|
2088
2080
|
position: "center",
|
|
2089
2081
|
transition: "",
|
|
2090
2082
|
style: {},
|
|
@@ -2108,8 +2100,9 @@ const defaultProps$X = __spreadValues({
|
|
|
2108
2100
|
onClickOverlay: (e2) => {
|
|
2109
2101
|
},
|
|
2110
2102
|
onClickCloseIcon: (e2) => {
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2103
|
+
},
|
|
2104
|
+
...defaultOverlayProps
|
|
2105
|
+
};
|
|
2113
2106
|
let _zIndex = 2e3;
|
|
2114
2107
|
const Popup = (props) => {
|
|
2115
2108
|
const {
|
|
@@ -2147,8 +2140,14 @@ const Popup = (props) => {
|
|
|
2147
2140
|
zIndex: index2,
|
|
2148
2141
|
animationDuration: `${duration}s`
|
|
2149
2142
|
};
|
|
2150
|
-
const overlayStyles =
|
|
2151
|
-
|
|
2143
|
+
const overlayStyles = {
|
|
2144
|
+
...overlayStyle,
|
|
2145
|
+
...baseStyle
|
|
2146
|
+
};
|
|
2147
|
+
const popStyles = {
|
|
2148
|
+
...style,
|
|
2149
|
+
...baseStyle
|
|
2150
|
+
};
|
|
2152
2151
|
const classes = classNames({
|
|
2153
2152
|
round,
|
|
2154
2153
|
[`popup-${position}`]: true,
|
|
@@ -2233,25 +2232,145 @@ const Popup = (props) => {
|
|
|
2233
2232
|
size: "12px"
|
|
2234
2233
|
})) : "")));
|
|
2235
2234
|
};
|
|
2236
|
-
Popup.defaultProps = defaultProps
|
|
2235
|
+
Popup.defaultProps = defaultProps$$;
|
|
2237
2236
|
Popup.displayName = "NutPopup";
|
|
2238
|
-
const
|
|
2237
|
+
const zhCN = {
|
|
2238
|
+
save: "\u4FDD\u5B58",
|
|
2239
|
+
confirm: "\u786E\u8BA4",
|
|
2240
|
+
cancel: "\u53D6\u6D88",
|
|
2241
|
+
done: "\u5B8C\u6210",
|
|
2242
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
2243
|
+
placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9",
|
|
2244
|
+
select: "\u8BF7\u9009\u62E9",
|
|
2245
|
+
video: {
|
|
2246
|
+
errorTip: "\u89C6\u9891\u52A0\u8F7D\u5931\u8D25",
|
|
2247
|
+
clickRetry: "\u70B9\u51FB\u91CD\u8BD5"
|
|
2248
|
+
},
|
|
2249
|
+
fixednav: {
|
|
2250
|
+
activeText: "\u6536\u8D77\u5BFC\u822A",
|
|
2251
|
+
unActiveText: "\u5FEB\u901F\u5BFC\u822A"
|
|
2252
|
+
},
|
|
2253
|
+
infiniteloading: {
|
|
2254
|
+
pullRefreshText: "\u677E\u5F00\u5237\u65B0",
|
|
2255
|
+
loadText: "\u52A0\u8F7D\u4E2D\u2026\u2026",
|
|
2256
|
+
loadMoreText: "\u54CE\u5440\uFF0C\u8FD9\u91CC\u662F\u5E95\u90E8\u4E86\u5566"
|
|
2257
|
+
},
|
|
2258
|
+
pagination: {
|
|
2259
|
+
prev: "\u4E0A\u4E00\u9875",
|
|
2260
|
+
next: "\u4E0B\u4E00\u9875"
|
|
2261
|
+
},
|
|
2262
|
+
range: {
|
|
2263
|
+
rangeText: "\u4E0D\u5728\u8BE5\u533A\u95F4\u5185"
|
|
2264
|
+
},
|
|
2265
|
+
calendaritem: {
|
|
2266
|
+
weekdays: ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"],
|
|
2267
|
+
end: "\u7ED3\u675F",
|
|
2268
|
+
start: "\u5F00\u59CB",
|
|
2269
|
+
title: "\u65E5\u5386\u9009\u62E9",
|
|
2270
|
+
monthTitle: (year, month) => `${year}\u5E74${month}\u6708`,
|
|
2271
|
+
today: "\u4ECA\u5929",
|
|
2272
|
+
loadPreviousMonth: "\u52A0\u8F7D\u4E0A\u4E00\u4E2A\u6708",
|
|
2273
|
+
noEarlierMonth: "\u6CA1\u6709\u66F4\u65E9\u6708\u4EFD"
|
|
2274
|
+
},
|
|
2275
|
+
shortpassword: {
|
|
2276
|
+
title: "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
2277
|
+
desc: "\u60A8\u4F7F\u7528\u4E86\u865A\u62DF\u8D44\u4EA7\uFF0C\u8BF7\u8FDB\u884C\u9A8C\u8BC1",
|
|
2278
|
+
tips: "\u5FD8\u8BB0\u5BC6\u7801"
|
|
2279
|
+
},
|
|
2280
|
+
uploader: {
|
|
2281
|
+
ready: "\u51C6\u5907\u5B8C\u6210",
|
|
2282
|
+
readyUpload: "\u51C6\u5907\u4E0A\u4F20",
|
|
2283
|
+
waitingUpload: "\u7B49\u5F85\u4E0A\u4F20",
|
|
2284
|
+
uploading: "\u4E0A\u4F20\u4E2D...",
|
|
2285
|
+
success: "\u4E0A\u4F20\u6210\u529F",
|
|
2286
|
+
error: "\u4E0A\u4F20\u5931\u8D25",
|
|
2287
|
+
deleteWord: "\u7528\u6237\u963B\u6B62\u4E86\u5220\u9664\uFF01"
|
|
2288
|
+
},
|
|
2289
|
+
countdown: {
|
|
2290
|
+
day: "\u5929",
|
|
2291
|
+
hour: "\u65F6",
|
|
2292
|
+
minute: "\u5206",
|
|
2293
|
+
second: "\u79D2"
|
|
2294
|
+
},
|
|
2295
|
+
address: {
|
|
2296
|
+
selectRegion: "\u8BF7\u9009\u62E9\u6240\u5728\u5730\u533A",
|
|
2297
|
+
deliveryTo: "\u914D\u9001\u81F3",
|
|
2298
|
+
chooseAnotherAddress: "\u9009\u62E9\u5176\u4ED6\u5730\u5740"
|
|
2299
|
+
},
|
|
2300
|
+
signature: {
|
|
2301
|
+
reSign: "\u91CD\u7B7E",
|
|
2302
|
+
unSupportTpl: "\u5BF9\u4E0D\u8D77\uFF0C\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Canvas\uFF0C\u65E0\u6CD5\u4F7F\u7528\u672C\u63A7\u4EF6\uFF01"
|
|
2303
|
+
},
|
|
2304
|
+
ecard: {
|
|
2305
|
+
chooseText: "\u8BF7\u9009\u62E9\u7535\u5B50\u5361\u9762\u503C",
|
|
2306
|
+
otherValueText: "\u5176\u4ED6\u9762\u503C",
|
|
2307
|
+
placeholder: "\u8BF7\u8F93\u51651-5000\u6574\u6570"
|
|
2308
|
+
},
|
|
2309
|
+
timeselect: {
|
|
2310
|
+
pickupTime: "\u53D6\u4EF6\u65F6\u95F4"
|
|
2311
|
+
},
|
|
2312
|
+
sku: {
|
|
2313
|
+
buyNow: "\u7ACB\u5373\u8D2D\u4E70",
|
|
2314
|
+
buyNumber: "\u8D2D\u4E70\u6570\u91CF",
|
|
2315
|
+
addToCard: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
2316
|
+
},
|
|
2317
|
+
skuheader: {
|
|
2318
|
+
skuId: "\u5546\u54C1\u7F16\u53F7"
|
|
2319
|
+
},
|
|
2320
|
+
addresslist: {
|
|
2321
|
+
addAddress: "\u65B0\u5EFA\u5730\u5740"
|
|
2322
|
+
},
|
|
2323
|
+
comment: {
|
|
2324
|
+
complaintsText: "\u6211\u8981\u6295\u8BC9",
|
|
2325
|
+
additionalReview: (day) => `\u8D2D\u4E70${day}\u5929\u540E\u8FFD\u8BC4`,
|
|
2326
|
+
additionalImages: (length) => `${length}\u5F20\u8FFD\u8BC4\u56FE\u7247`
|
|
2327
|
+
}
|
|
2328
|
+
};
|
|
2329
|
+
const defaultProps$_ = {
|
|
2330
|
+
locale: zhCN
|
|
2331
|
+
};
|
|
2332
|
+
const defaultConfigRef = {
|
|
2333
|
+
current: {
|
|
2334
|
+
locale: zhCN
|
|
2335
|
+
}
|
|
2336
|
+
};
|
|
2337
|
+
const getDefaultConfig = () => {
|
|
2338
|
+
return defaultConfigRef.current;
|
|
2339
|
+
};
|
|
2340
|
+
const useConfig = () => {
|
|
2341
|
+
var _a;
|
|
2342
|
+
return (_a = useContext$1(ConfigContext)) != null ? _a : getDefaultConfig();
|
|
2343
|
+
};
|
|
2344
|
+
const ConfigContext = createContext(null);
|
|
2345
|
+
const ConfigProvider = (props) => {
|
|
2346
|
+
const { children, ...config2 } = { ...defaultProps$_, ...props };
|
|
2347
|
+
const parentConfig = useConfig();
|
|
2348
|
+
return /* @__PURE__ */ React__default.createElement(ConfigContext.Provider, {
|
|
2349
|
+
value: {
|
|
2350
|
+
...parentConfig,
|
|
2351
|
+
...config2
|
|
2352
|
+
}
|
|
2353
|
+
}, children);
|
|
2354
|
+
};
|
|
2355
|
+
ConfigProvider.defaultProps = defaultProps$_;
|
|
2356
|
+
ConfigProvider.displayName = "NutConfigProvider";
|
|
2357
|
+
const defaultProps$Z = {};
|
|
2239
2358
|
const Layout = (props) => {
|
|
2240
|
-
|
|
2359
|
+
({ ...defaultProps$Z, ...props });
|
|
2241
2360
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2242
2361
|
className: "nut-layout"
|
|
2243
2362
|
}, "Layout");
|
|
2244
2363
|
};
|
|
2245
|
-
Layout.defaultProps = defaultProps$
|
|
2364
|
+
Layout.defaultProps = defaultProps$Z;
|
|
2246
2365
|
Layout.displayName = "NutLayout";
|
|
2247
2366
|
const DataContext$2 = createContext({});
|
|
2248
|
-
const defaultProps$
|
|
2367
|
+
const defaultProps$Y = {
|
|
2249
2368
|
span: "24",
|
|
2250
2369
|
offset: "0",
|
|
2251
2370
|
gutter: "0"
|
|
2252
2371
|
};
|
|
2253
2372
|
const Col = (props) => {
|
|
2254
|
-
const { span, offset, children } =
|
|
2373
|
+
const { span, offset, children } = { ...defaultProps$Y, ...props };
|
|
2255
2374
|
const [colName, setColName] = useState("");
|
|
2256
2375
|
const [colStyle, setColStyle] = useState({});
|
|
2257
2376
|
const { gutter } = useContext$1(DataContext$2);
|
|
@@ -2271,12 +2390,12 @@ const Col = (props) => {
|
|
|
2271
2390
|
}, [span, offset, gutter]);
|
|
2272
2391
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2273
2392
|
className: `${colName}`,
|
|
2274
|
-
style:
|
|
2393
|
+
style: { ...colStyle }
|
|
2275
2394
|
}, children);
|
|
2276
2395
|
};
|
|
2277
|
-
Col.defaultProps = defaultProps$
|
|
2396
|
+
Col.defaultProps = defaultProps$Y;
|
|
2278
2397
|
Col.displayName = "NutCol";
|
|
2279
|
-
const defaultProps$
|
|
2398
|
+
const defaultProps$X = {
|
|
2280
2399
|
type: "",
|
|
2281
2400
|
justify: "start",
|
|
2282
2401
|
align: "flex-start",
|
|
@@ -2284,7 +2403,10 @@ const defaultProps$U = {
|
|
|
2284
2403
|
gutter: "0"
|
|
2285
2404
|
};
|
|
2286
2405
|
const Row = (props) => {
|
|
2287
|
-
const { children, type, justify, align, wrap, gutter } =
|
|
2406
|
+
const { children, type, justify, align, wrap, gutter } = {
|
|
2407
|
+
...defaultProps$X,
|
|
2408
|
+
...props
|
|
2409
|
+
};
|
|
2288
2410
|
const prefixCls = "nut-row";
|
|
2289
2411
|
const getClass = (prefix2, type2) => {
|
|
2290
2412
|
return prefix2 ? type2 ? `nut-row-${prefix2}-${type2}` : "" : `nut-row-${type2}`;
|
|
@@ -2307,32 +2429,47 @@ const Row = (props) => {
|
|
|
2307
2429
|
className: getClasses()
|
|
2308
2430
|
}, children));
|
|
2309
2431
|
};
|
|
2310
|
-
Row.defaultProps = defaultProps$
|
|
2432
|
+
Row.defaultProps = defaultProps$X;
|
|
2311
2433
|
Row.displayName = "NutRow";
|
|
2312
|
-
const defaultProps$
|
|
2434
|
+
const defaultProps$W = {
|
|
2313
2435
|
contentPosition: "center",
|
|
2314
2436
|
dashed: false,
|
|
2315
|
-
hairline: true
|
|
2437
|
+
hairline: true,
|
|
2438
|
+
direction: "horizontal"
|
|
2316
2439
|
};
|
|
2317
2440
|
const Divider = (props) => {
|
|
2318
|
-
const {
|
|
2441
|
+
const {
|
|
2442
|
+
children,
|
|
2443
|
+
contentPosition,
|
|
2444
|
+
dashed,
|
|
2445
|
+
hairline,
|
|
2446
|
+
styles,
|
|
2447
|
+
className,
|
|
2448
|
+
direction
|
|
2449
|
+
} = {
|
|
2450
|
+
...defaultProps$W,
|
|
2451
|
+
...props
|
|
2452
|
+
};
|
|
2319
2453
|
const dividerBem = cn("divider");
|
|
2320
|
-
const classes = classNames({
|
|
2454
|
+
const classes = direction === "horizontal" ? classNames({
|
|
2321
2455
|
[dividerBem()]: true,
|
|
2322
2456
|
[dividerBem("center")]: children,
|
|
2323
2457
|
[dividerBem("left")]: contentPosition === "left",
|
|
2324
2458
|
[dividerBem("right")]: contentPosition === "right",
|
|
2325
2459
|
[dividerBem("dashed")]: dashed,
|
|
2326
2460
|
[dividerBem("hairline")]: hairline
|
|
2461
|
+
}) : classNames({
|
|
2462
|
+
[dividerBem()]: true,
|
|
2463
|
+
[dividerBem("vertical")]: direction === "vertical"
|
|
2327
2464
|
});
|
|
2328
2465
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2329
2466
|
className: `${classes} ${className || ""}`,
|
|
2330
2467
|
style: styles
|
|
2331
2468
|
}, children);
|
|
2332
2469
|
};
|
|
2333
|
-
Divider.defaultProps = defaultProps$
|
|
2470
|
+
Divider.defaultProps = defaultProps$W;
|
|
2334
2471
|
Divider.displayName = "NutDivider";
|
|
2335
|
-
const defaultProps$
|
|
2472
|
+
const defaultProps$V = {
|
|
2336
2473
|
title: "",
|
|
2337
2474
|
desc: "",
|
|
2338
2475
|
leftShow: false,
|
|
@@ -2353,7 +2490,10 @@ const NavBar = (props) => {
|
|
|
2353
2490
|
onClickIcon,
|
|
2354
2491
|
onClickBack,
|
|
2355
2492
|
onClickClear
|
|
2356
|
-
} =
|
|
2493
|
+
} = {
|
|
2494
|
+
...defaultProps$V,
|
|
2495
|
+
...props
|
|
2496
|
+
};
|
|
2357
2497
|
const b2 = cn("navbar");
|
|
2358
2498
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2359
2499
|
className: `nut-navbar ${className}`,
|
|
@@ -2376,126 +2516,9 @@ const NavBar = (props) => {
|
|
|
2376
2516
|
name: icon
|
|
2377
2517
|
})));
|
|
2378
2518
|
};
|
|
2379
|
-
NavBar.defaultProps = defaultProps$
|
|
2519
|
+
NavBar.defaultProps = defaultProps$V;
|
|
2380
2520
|
NavBar.displayName = "NutNavBar";
|
|
2381
|
-
const
|
|
2382
|
-
save: "\u4FDD\u5B58",
|
|
2383
|
-
confirm: "\u786E\u8BA4",
|
|
2384
|
-
cancel: "\u53D6\u6D88",
|
|
2385
|
-
done: "\u5B8C\u6210",
|
|
2386
|
-
noData: "\u6682\u65E0\u6570\u636E",
|
|
2387
|
-
placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9",
|
|
2388
|
-
select: "\u8BF7\u9009\u62E9",
|
|
2389
|
-
video: {
|
|
2390
|
-
errorTip: "\u89C6\u9891\u52A0\u8F7D\u5931\u8D25",
|
|
2391
|
-
clickRetry: "\u70B9\u51FB\u91CD\u8BD5"
|
|
2392
|
-
},
|
|
2393
|
-
fixednav: {
|
|
2394
|
-
activeText: "\u6536\u8D77\u5BFC\u822A",
|
|
2395
|
-
unActiveText: "\u5FEB\u901F\u5BFC\u822A"
|
|
2396
|
-
},
|
|
2397
|
-
infiniteloading: {
|
|
2398
|
-
pullRefreshText: "\u677E\u5F00\u5237\u65B0",
|
|
2399
|
-
loadText: "\u52A0\u8F7D\u4E2D\u2026\u2026",
|
|
2400
|
-
loadMoreText: "\u54CE\u5440\uFF0C\u8FD9\u91CC\u662F\u5E95\u90E8\u4E86\u5566"
|
|
2401
|
-
},
|
|
2402
|
-
pagination: {
|
|
2403
|
-
prev: "\u4E0A\u4E00\u9875",
|
|
2404
|
-
next: "\u4E0B\u4E00\u9875"
|
|
2405
|
-
},
|
|
2406
|
-
range: {
|
|
2407
|
-
rangeText: "\u4E0D\u5728\u8BE5\u533A\u95F4\u5185"
|
|
2408
|
-
},
|
|
2409
|
-
calendaritem: {
|
|
2410
|
-
weekdays: ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"],
|
|
2411
|
-
end: "\u7ED3\u675F",
|
|
2412
|
-
start: "\u5F00\u59CB",
|
|
2413
|
-
title: "\u65E5\u5386\u9009\u62E9",
|
|
2414
|
-
monthTitle: (year, month) => `${year}\u5E74${month}\u6708`,
|
|
2415
|
-
today: "\u4ECA\u5929",
|
|
2416
|
-
loadPreviousMonth: "\u52A0\u8F7D\u4E0A\u4E00\u4E2A\u6708",
|
|
2417
|
-
noEarlierMonth: "\u6CA1\u6709\u66F4\u65E9\u6708\u4EFD"
|
|
2418
|
-
},
|
|
2419
|
-
shortpassword: {
|
|
2420
|
-
title: "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
2421
|
-
desc: "\u60A8\u4F7F\u7528\u4E86\u865A\u62DF\u8D44\u4EA7\uFF0C\u8BF7\u8FDB\u884C\u9A8C\u8BC1",
|
|
2422
|
-
tips: "\u5FD8\u8BB0\u5BC6\u7801"
|
|
2423
|
-
},
|
|
2424
|
-
uploader: {
|
|
2425
|
-
ready: "\u51C6\u5907\u5B8C\u6210",
|
|
2426
|
-
readyUpload: "\u51C6\u5907\u4E0A\u4F20",
|
|
2427
|
-
waitingUpload: "\u7B49\u5F85\u4E0A\u4F20",
|
|
2428
|
-
uploading: "\u4E0A\u4F20\u4E2D...",
|
|
2429
|
-
success: "\u4E0A\u4F20\u6210\u529F",
|
|
2430
|
-
error: "\u4E0A\u4F20\u5931\u8D25",
|
|
2431
|
-
deleteWord: "\u7528\u6237\u963B\u6B62\u4E86\u5220\u9664\uFF01"
|
|
2432
|
-
},
|
|
2433
|
-
countdown: {
|
|
2434
|
-
day: "\u5929",
|
|
2435
|
-
hour: "\u65F6",
|
|
2436
|
-
minute: "\u5206",
|
|
2437
|
-
second: "\u79D2"
|
|
2438
|
-
},
|
|
2439
|
-
address: {
|
|
2440
|
-
selectRegion: "\u8BF7\u9009\u62E9\u6240\u5728\u5730\u533A",
|
|
2441
|
-
deliveryTo: "\u914D\u9001\u81F3",
|
|
2442
|
-
chooseAnotherAddress: "\u9009\u62E9\u5176\u4ED6\u5730\u5740"
|
|
2443
|
-
},
|
|
2444
|
-
signature: {
|
|
2445
|
-
reSign: "\u91CD\u7B7E",
|
|
2446
|
-
unSupportTpl: "\u5BF9\u4E0D\u8D77\uFF0C\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Canvas\uFF0C\u65E0\u6CD5\u4F7F\u7528\u672C\u63A7\u4EF6\uFF01"
|
|
2447
|
-
},
|
|
2448
|
-
ecard: {
|
|
2449
|
-
chooseText: "\u8BF7\u9009\u62E9\u7535\u5B50\u5361\u9762\u503C",
|
|
2450
|
-
otherValueText: "\u5176\u4ED6\u9762\u503C",
|
|
2451
|
-
placeholder: "\u8BF7\u8F93\u51651-5000\u6574\u6570"
|
|
2452
|
-
},
|
|
2453
|
-
timeselect: {
|
|
2454
|
-
pickupTime: "\u53D6\u4EF6\u65F6\u95F4"
|
|
2455
|
-
},
|
|
2456
|
-
sku: {
|
|
2457
|
-
buyNow: "\u7ACB\u5373\u8D2D\u4E70",
|
|
2458
|
-
buyNumber: "\u8D2D\u4E70\u6570\u91CF",
|
|
2459
|
-
addToCard: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
2460
|
-
},
|
|
2461
|
-
skuheader: {
|
|
2462
|
-
skuId: "\u5546\u54C1\u7F16\u53F7"
|
|
2463
|
-
},
|
|
2464
|
-
addresslist: {
|
|
2465
|
-
addAddress: "\u65B0\u5EFA\u5730\u5740"
|
|
2466
|
-
},
|
|
2467
|
-
comment: {
|
|
2468
|
-
complaintsText: "\u6211\u8981\u6295\u8BC9",
|
|
2469
|
-
additionalReview: (day) => `\u8D2D\u4E70${day}\u5929\u540E\u8FFD\u8BC4`,
|
|
2470
|
-
additionalImages: (length) => `${length}\u5F20\u8FFD\u8BC4\u56FE\u7247`
|
|
2471
|
-
}
|
|
2472
|
-
};
|
|
2473
|
-
const defaultProps$R = {
|
|
2474
|
-
locale: zhCN
|
|
2475
|
-
};
|
|
2476
|
-
const defaultConfigRef = {
|
|
2477
|
-
current: {
|
|
2478
|
-
locale: zhCN
|
|
2479
|
-
}
|
|
2480
|
-
};
|
|
2481
|
-
const getDefaultConfig = () => {
|
|
2482
|
-
return defaultConfigRef.current;
|
|
2483
|
-
};
|
|
2484
|
-
const useConfig = () => {
|
|
2485
|
-
var _a;
|
|
2486
|
-
return (_a = useContext$1(ConfigContext)) != null ? _a : getDefaultConfig();
|
|
2487
|
-
};
|
|
2488
|
-
const ConfigContext = createContext(null);
|
|
2489
|
-
const ConfigProvider = (props) => {
|
|
2490
|
-
const _a = __spreadValues(__spreadValues({}, defaultProps$R), props), { children } = _a, config2 = __objRest(_a, ["children"]);
|
|
2491
|
-
const parentConfig = useConfig();
|
|
2492
|
-
return /* @__PURE__ */ React__default.createElement(ConfigContext.Provider, {
|
|
2493
|
-
value: __spreadValues(__spreadValues({}, parentConfig), config2)
|
|
2494
|
-
}, children);
|
|
2495
|
-
};
|
|
2496
|
-
ConfigProvider.defaultProps = defaultProps$R;
|
|
2497
|
-
ConfigProvider.displayName = "NutConfigProvider";
|
|
2498
|
-
const defaultProps$Q = {
|
|
2521
|
+
const defaultProps$U = {
|
|
2499
2522
|
fixednavClass: "nut-fixednav",
|
|
2500
2523
|
activeText: "\u6536\u8D77\u5BFC\u822A",
|
|
2501
2524
|
unActiveText: "\u5FEB\u901F\u5BFC\u822A",
|
|
@@ -2507,7 +2530,7 @@ const defaultProps$Q = {
|
|
|
2507
2530
|
};
|
|
2508
2531
|
const FixedNav = (props) => {
|
|
2509
2532
|
const { locale } = useConfig();
|
|
2510
|
-
const
|
|
2533
|
+
const {
|
|
2511
2534
|
fixednavClass,
|
|
2512
2535
|
overlay,
|
|
2513
2536
|
visible,
|
|
@@ -2519,21 +2542,9 @@ const FixedNav = (props) => {
|
|
|
2519
2542
|
onSelected,
|
|
2520
2543
|
type,
|
|
2521
2544
|
slotList,
|
|
2522
|
-
slotBtn
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
"overlay",
|
|
2526
|
-
"visible",
|
|
2527
|
-
"navList",
|
|
2528
|
-
"activeText",
|
|
2529
|
-
"unActiveText",
|
|
2530
|
-
"position",
|
|
2531
|
-
"onChange",
|
|
2532
|
-
"onSelected",
|
|
2533
|
-
"type",
|
|
2534
|
-
"slotList",
|
|
2535
|
-
"slotBtn"
|
|
2536
|
-
]);
|
|
2545
|
+
slotBtn,
|
|
2546
|
+
...rest
|
|
2547
|
+
} = { ...defaultProps$U, ...props };
|
|
2537
2548
|
const b2 = cn("fixednav");
|
|
2538
2549
|
const classes = classNames({
|
|
2539
2550
|
active: visible
|
|
@@ -2544,10 +2555,11 @@ const FixedNav = (props) => {
|
|
|
2544
2555
|
const onUpdateValue = (value = !visible) => {
|
|
2545
2556
|
onChange(value);
|
|
2546
2557
|
};
|
|
2547
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
2558
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2548
2559
|
className: classes,
|
|
2549
|
-
style: position
|
|
2550
|
-
|
|
2560
|
+
style: position,
|
|
2561
|
+
...rest
|
|
2562
|
+
}, overlay && /* @__PURE__ */ React__default.createElement(Overlay, {
|
|
2551
2563
|
visible,
|
|
2552
2564
|
zIndex: 200,
|
|
2553
2565
|
onClick: () => onUpdateValue(false)
|
|
@@ -2578,9 +2590,9 @@ const FixedNav = (props) => {
|
|
|
2578
2590
|
className: "text"
|
|
2579
2591
|
}, visible ? locale.fixednav.activeText || activeText : locale.fixednav.unActiveText || unActiveText))));
|
|
2580
2592
|
};
|
|
2581
|
-
FixedNav.defaultProps = defaultProps$
|
|
2593
|
+
FixedNav.defaultProps = defaultProps$U;
|
|
2582
2594
|
FixedNav.displayName = "NutFixedNav";
|
|
2583
|
-
const defaultProps$
|
|
2595
|
+
const defaultProps$T = {
|
|
2584
2596
|
visible: 0,
|
|
2585
2597
|
bottom: false,
|
|
2586
2598
|
type: "",
|
|
@@ -2593,7 +2605,19 @@ const defaultProps$P = {
|
|
|
2593
2605
|
}
|
|
2594
2606
|
};
|
|
2595
2607
|
const Tabbar = (props) => {
|
|
2596
|
-
const {
|
|
2608
|
+
const {
|
|
2609
|
+
children,
|
|
2610
|
+
visible,
|
|
2611
|
+
bottom,
|
|
2612
|
+
activeColor,
|
|
2613
|
+
unactiveColor,
|
|
2614
|
+
className,
|
|
2615
|
+
style,
|
|
2616
|
+
tabSwitch
|
|
2617
|
+
} = {
|
|
2618
|
+
...defaultProps$T,
|
|
2619
|
+
...props
|
|
2620
|
+
};
|
|
2597
2621
|
const b2 = cn("tabbar");
|
|
2598
2622
|
const [selectIndex, setSelectIndex] = useState(visible);
|
|
2599
2623
|
const handleClick = (idx) => {
|
|
@@ -2606,7 +2630,8 @@ const Tabbar = (props) => {
|
|
|
2606
2630
|
if (!React__default.isValidElement(child)) {
|
|
2607
2631
|
return null;
|
|
2608
2632
|
}
|
|
2609
|
-
const childProps =
|
|
2633
|
+
const childProps = {
|
|
2634
|
+
...child.props,
|
|
2610
2635
|
active: idx === selectIndex,
|
|
2611
2636
|
index: idx,
|
|
2612
2637
|
unactiveColor,
|
|
@@ -2615,13 +2640,13 @@ const Tabbar = (props) => {
|
|
|
2615
2640
|
handleClick(idx);
|
|
2616
2641
|
tabSwitch(child, idx);
|
|
2617
2642
|
}
|
|
2618
|
-
}
|
|
2643
|
+
};
|
|
2619
2644
|
return React__default.cloneElement(child, childProps);
|
|
2620
2645
|
}));
|
|
2621
2646
|
};
|
|
2622
|
-
Tabbar.defaultProps = defaultProps$
|
|
2647
|
+
Tabbar.defaultProps = defaultProps$T;
|
|
2623
2648
|
Tabbar.displayName = "NutTabbar";
|
|
2624
|
-
const defaultProps$
|
|
2649
|
+
const defaultProps$S = {
|
|
2625
2650
|
tabTitle: "",
|
|
2626
2651
|
icon: "",
|
|
2627
2652
|
href: "",
|
|
@@ -2635,7 +2660,21 @@ const defaultProps$O = {
|
|
|
2635
2660
|
}
|
|
2636
2661
|
};
|
|
2637
2662
|
const TabbarItem = (props) => {
|
|
2638
|
-
const {
|
|
2663
|
+
const {
|
|
2664
|
+
tabTitle,
|
|
2665
|
+
icon,
|
|
2666
|
+
href,
|
|
2667
|
+
to: to2,
|
|
2668
|
+
num,
|
|
2669
|
+
active,
|
|
2670
|
+
activeColor,
|
|
2671
|
+
unactiveColor,
|
|
2672
|
+
index: index2,
|
|
2673
|
+
handleClick
|
|
2674
|
+
} = {
|
|
2675
|
+
...defaultProps$S,
|
|
2676
|
+
...props
|
|
2677
|
+
};
|
|
2639
2678
|
const b2 = cn("tabbar-item");
|
|
2640
2679
|
const bIcon = cn("tabbar-item__icon-box");
|
|
2641
2680
|
const history = useHistory();
|
|
@@ -2666,17 +2705,30 @@ const TabbarItem = (props) => {
|
|
|
2666
2705
|
size: 20,
|
|
2667
2706
|
name: icon
|
|
2668
2707
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
2669
|
-
className: bIcon({ "nav-word": true }, [
|
|
2708
|
+
className: bIcon({ "nav-word": true }, [
|
|
2709
|
+
bIcon({ "big-word": !icon })
|
|
2710
|
+
])
|
|
2670
2711
|
}, tabTitle)));
|
|
2671
2712
|
};
|
|
2672
|
-
const defaultProps$
|
|
2713
|
+
const defaultProps$R = {
|
|
2673
2714
|
height: "200px",
|
|
2674
2715
|
acceptKey: "title",
|
|
2675
2716
|
indexList: [],
|
|
2676
2717
|
className: ""
|
|
2677
2718
|
};
|
|
2678
2719
|
const Elevator = (props) => {
|
|
2679
|
-
const
|
|
2720
|
+
const {
|
|
2721
|
+
height,
|
|
2722
|
+
acceptKey,
|
|
2723
|
+
indexList,
|
|
2724
|
+
className,
|
|
2725
|
+
clickItem,
|
|
2726
|
+
clickIndex,
|
|
2727
|
+
...rest
|
|
2728
|
+
} = {
|
|
2729
|
+
...defaultProps$R,
|
|
2730
|
+
...props
|
|
2731
|
+
};
|
|
2680
2732
|
const b2 = cn("elevator");
|
|
2681
2733
|
const spaceHeight = 23;
|
|
2682
2734
|
const listview = useRef(null);
|
|
@@ -2774,9 +2826,10 @@ const Elevator = (props) => {
|
|
|
2774
2826
|
setListGroup();
|
|
2775
2827
|
}
|
|
2776
2828
|
}, [listview.current]);
|
|
2777
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
2778
|
-
className: `${b2()} ${className}
|
|
2779
|
-
|
|
2829
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2830
|
+
className: `${b2()} ${className}`,
|
|
2831
|
+
...rest
|
|
2832
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2780
2833
|
className: b2("list"),
|
|
2781
2834
|
ref: listview,
|
|
2782
2835
|
style: { height: isNaN(+height) ? height : `${height}px` }
|
|
@@ -2810,13 +2863,13 @@ const Elevator = (props) => {
|
|
|
2810
2863
|
}, item[acceptKey]);
|
|
2811
2864
|
}))));
|
|
2812
2865
|
};
|
|
2813
|
-
Elevator.defaultProps = defaultProps$
|
|
2866
|
+
Elevator.defaultProps = defaultProps$R;
|
|
2814
2867
|
Elevator.displayName = "NutElevator";
|
|
2815
|
-
const defaultProps$
|
|
2868
|
+
const defaultProps$Q = {
|
|
2816
2869
|
defaultValue: 1,
|
|
2817
2870
|
mode: "multi",
|
|
2818
|
-
prevText: "
|
|
2819
|
-
nextText: "
|
|
2871
|
+
prevText: "",
|
|
2872
|
+
nextText: "",
|
|
2820
2873
|
pageCount: "",
|
|
2821
2874
|
totalItems: "0",
|
|
2822
2875
|
itemsPerPage: "10",
|
|
@@ -2829,8 +2882,8 @@ const defaultProps$M = {
|
|
|
2829
2882
|
};
|
|
2830
2883
|
const Pagination = (props) => {
|
|
2831
2884
|
const { locale } = useConfig();
|
|
2832
|
-
|
|
2833
|
-
const
|
|
2885
|
+
({ ...defaultProps$Q, ...props });
|
|
2886
|
+
const {
|
|
2834
2887
|
modelValue,
|
|
2835
2888
|
mode,
|
|
2836
2889
|
prevText,
|
|
@@ -2844,33 +2897,19 @@ const Pagination = (props) => {
|
|
|
2844
2897
|
forceEllipses,
|
|
2845
2898
|
pageNodeRender,
|
|
2846
2899
|
defaultValue,
|
|
2847
|
-
className
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
"mode",
|
|
2851
|
-
"prevText",
|
|
2852
|
-
"nextText",
|
|
2853
|
-
"pageCount",
|
|
2854
|
-
"totalItems",
|
|
2855
|
-
"itemsPerPage",
|
|
2856
|
-
"showPageSize",
|
|
2857
|
-
"onChange",
|
|
2858
|
-
"updatecurrent",
|
|
2859
|
-
"forceEllipses",
|
|
2860
|
-
"pageNodeRender",
|
|
2861
|
-
"defaultValue",
|
|
2862
|
-
"className"
|
|
2863
|
-
]);
|
|
2900
|
+
className,
|
|
2901
|
+
...rest
|
|
2902
|
+
} = props;
|
|
2864
2903
|
const [currentPage, setCurrent] = useState(1);
|
|
2865
2904
|
const [pages, setPages] = useState([]);
|
|
2866
2905
|
const [countRef, setCountRef] = useState(Number(pageCount));
|
|
2867
2906
|
const paginationBem = cn("pagination");
|
|
2868
2907
|
const computedCountRef = () => {
|
|
2869
2908
|
const num = Number(pageCount) || Math.ceil(Number(totalItems) / Number(itemsPerPage));
|
|
2870
|
-
return isNaN(num) ? 1 : Math.max(1, num);
|
|
2909
|
+
return Number.isNaN(num) ? 1 : Math.max(1, num);
|
|
2871
2910
|
};
|
|
2872
2911
|
const computedPages = (_currentPage, _countRef) => {
|
|
2873
|
-
if (mode
|
|
2912
|
+
if (mode === "simple")
|
|
2874
2913
|
return [];
|
|
2875
2914
|
const items = [];
|
|
2876
2915
|
const pageCount2 = _countRef || countRef;
|
|
@@ -2888,7 +2927,7 @@ const Pagination = (props) => {
|
|
|
2888
2927
|
}
|
|
2889
2928
|
}
|
|
2890
2929
|
for (let i = startPage; i <= endPage; i++) {
|
|
2891
|
-
const page = setPage(i, i, _current
|
|
2930
|
+
const page = setPage(i, i, _current === i);
|
|
2892
2931
|
items.push(page);
|
|
2893
2932
|
}
|
|
2894
2933
|
if (partialShow && pageSize > 0 && forceEllipses) {
|
|
@@ -2908,11 +2947,11 @@ const Pagination = (props) => {
|
|
|
2908
2947
|
return;
|
|
2909
2948
|
if (!("modelValue" in props)) {
|
|
2910
2949
|
setCurrent(Number(curPage));
|
|
2911
|
-
if (curPage
|
|
2950
|
+
if (curPage !== currentPage) {
|
|
2912
2951
|
setPages(computedPages(curPage));
|
|
2913
2952
|
}
|
|
2914
2953
|
}
|
|
2915
|
-
if (curPage
|
|
2954
|
+
if (curPage !== currentPage) {
|
|
2916
2955
|
updatecurrent && updatecurrent(curPage);
|
|
2917
2956
|
}
|
|
2918
2957
|
if (isSelect)
|
|
@@ -2937,12 +2976,13 @@ const Pagination = (props) => {
|
|
|
2937
2976
|
setPages(computedPages(Number(current)));
|
|
2938
2977
|
}
|
|
2939
2978
|
}
|
|
2940
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
2941
|
-
className: `${paginationBem("")} ${className}
|
|
2942
|
-
|
|
2943
|
-
|
|
2979
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2980
|
+
className: `${paginationBem("")} ${className}`,
|
|
2981
|
+
...rest
|
|
2982
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2983
|
+
className: `${paginationBem("prev")} ${mode === "multi" ? "" : "simple-border"} ${currentPage === 1 ? "disabled" : ""}`,
|
|
2944
2984
|
onClick: (e2) => selectPage(Number(currentPage) - 1, true)
|
|
2945
|
-
}, locale.pagination.prev
|
|
2985
|
+
}, prevText || locale.pagination.prev), mode === "multi" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
2946
2986
|
className: `${paginationBem("contain")}`
|
|
2947
2987
|
}, pages.map((item, index2) => {
|
|
2948
2988
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -2950,26 +2990,26 @@ const Pagination = (props) => {
|
|
|
2950
2990
|
className: `${paginationBem("item")} ${item.active ? "active" : ""}`,
|
|
2951
2991
|
onClick: (e2) => !item.active ? selectPage(item.number, true) : ""
|
|
2952
2992
|
}, pageNodeRender ? pageNodeRender(item) : item.text);
|
|
2953
|
-
})) : "", mode
|
|
2993
|
+
})) : "", mode === "simple" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
2954
2994
|
className: `${paginationBem("contain")}`
|
|
2955
2995
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
2956
2996
|
className: `${paginationBem("simple")}`
|
|
2957
2997
|
}, currentPage, "/", countRef)) : "", /* @__PURE__ */ React__default.createElement("div", {
|
|
2958
2998
|
className: `${paginationBem("next")} ${Number(currentPage) >= countRef ? "disabled" : ""}`,
|
|
2959
2999
|
onClick: (e2) => selectPage(Number(currentPage) + 1, true)
|
|
2960
|
-
}, locale.pagination.next
|
|
3000
|
+
}, nextText || locale.pagination.next));
|
|
2961
3001
|
};
|
|
2962
|
-
Pagination.defaultProps = defaultProps$
|
|
3002
|
+
Pagination.defaultProps = defaultProps$Q;
|
|
2963
3003
|
Pagination.displayName = "NutPagination";
|
|
2964
3004
|
class Title {
|
|
2965
3005
|
constructor() {
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
3006
|
+
this.title = "";
|
|
3007
|
+
this.paneKey = "";
|
|
3008
|
+
this.disabled = false;
|
|
3009
|
+
this.index = 0;
|
|
2970
3010
|
}
|
|
2971
3011
|
}
|
|
2972
|
-
const defaultProps$
|
|
3012
|
+
const defaultProps$P = {
|
|
2973
3013
|
value: 0,
|
|
2974
3014
|
color: "",
|
|
2975
3015
|
background: "",
|
|
@@ -2985,7 +3025,7 @@ const pxCheck$1 = (value) => {
|
|
|
2985
3025
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
2986
3026
|
};
|
|
2987
3027
|
const Tabs = (props) => {
|
|
2988
|
-
const
|
|
3028
|
+
const {
|
|
2989
3029
|
value,
|
|
2990
3030
|
color,
|
|
2991
3031
|
background,
|
|
@@ -3000,36 +3040,21 @@ const Tabs = (props) => {
|
|
|
3000
3040
|
children,
|
|
3001
3041
|
onClick,
|
|
3002
3042
|
onChange,
|
|
3003
|
-
className
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
"color",
|
|
3007
|
-
"background",
|
|
3008
|
-
"direction",
|
|
3009
|
-
"type",
|
|
3010
|
-
"titleScroll",
|
|
3011
|
-
"ellipsis",
|
|
3012
|
-
"animatedTime",
|
|
3013
|
-
"titleGutter",
|
|
3014
|
-
"size",
|
|
3015
|
-
"titleNode",
|
|
3016
|
-
"children",
|
|
3017
|
-
"onClick",
|
|
3018
|
-
"onChange",
|
|
3019
|
-
"className"
|
|
3020
|
-
]);
|
|
3043
|
+
className,
|
|
3044
|
+
...rest
|
|
3045
|
+
} = { ...defaultProps$P, ...props };
|
|
3021
3046
|
const [currentItem, setCurrentItem] = useState({ index: 0 });
|
|
3022
3047
|
const titles = useRef([]);
|
|
3023
3048
|
useEffect(() => {
|
|
3024
3049
|
let currentIndex = 0;
|
|
3025
3050
|
titles.current = [];
|
|
3026
3051
|
React__default.Children.forEach(children, (child, idx) => {
|
|
3027
|
-
var
|
|
3052
|
+
var _a, _b, _c, _d, _e;
|
|
3028
3053
|
if (!React__default.isValidElement(child)) {
|
|
3029
3054
|
return null;
|
|
3030
3055
|
}
|
|
3031
3056
|
const title = new Title();
|
|
3032
|
-
if (((
|
|
3057
|
+
if (((_a = child.props) == null ? void 0 : _a.title) || ((_b = child.props) == null ? void 0 : _b.paneKey)) {
|
|
3033
3058
|
title.title = (_c = child.props) == null ? void 0 : _c.title;
|
|
3034
3059
|
title.paneKey = ((_d = child.props) == null ? void 0 : _d.paneKey) || idx;
|
|
3035
3060
|
title.disabled = (_e = child.props) == null ? void 0 : _e.disabled;
|
|
@@ -3070,9 +3095,10 @@ const Tabs = (props) => {
|
|
|
3070
3095
|
setCurrentItem(item);
|
|
3071
3096
|
onChange && onChange(item);
|
|
3072
3097
|
};
|
|
3073
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
3074
|
-
className: classes
|
|
3075
|
-
|
|
3098
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3099
|
+
className: classes,
|
|
3100
|
+
...rest
|
|
3101
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3076
3102
|
className: classesTitle,
|
|
3077
3103
|
style: { background }
|
|
3078
3104
|
}, !!titleNode && typeof titleNode === "function" ? titleNode() : titles.current.map((item, index22) => {
|
|
@@ -3091,7 +3117,9 @@ const Tabs = (props) => {
|
|
|
3091
3117
|
color,
|
|
3092
3118
|
name: "joy-smile"
|
|
3093
3119
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
3094
|
-
className: classNames({
|
|
3120
|
+
className: classNames({
|
|
3121
|
+
ellipsis: ellipsis && !titleScroll && direction === "horizontal"
|
|
3122
|
+
}, `${b2("")}__titles-item__text`)
|
|
3095
3123
|
}, item.title));
|
|
3096
3124
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
3097
3125
|
className: `${b2("")}__content`,
|
|
@@ -3100,22 +3128,26 @@ const Tabs = (props) => {
|
|
|
3100
3128
|
if (!React__default.isValidElement(child)) {
|
|
3101
3129
|
return null;
|
|
3102
3130
|
}
|
|
3103
|
-
const childProps =
|
|
3131
|
+
const childProps = {
|
|
3132
|
+
...child.props,
|
|
3104
3133
|
activeKey: value
|
|
3105
|
-
}
|
|
3134
|
+
};
|
|
3106
3135
|
return React__default.cloneElement(child, childProps);
|
|
3107
3136
|
})));
|
|
3108
3137
|
};
|
|
3109
|
-
Tabs.defaultProps = defaultProps$
|
|
3138
|
+
Tabs.defaultProps = defaultProps$P;
|
|
3110
3139
|
Tabs.displayName = "NutTabs";
|
|
3111
|
-
const defaultProps$
|
|
3140
|
+
const defaultProps$O = {
|
|
3112
3141
|
title: "",
|
|
3113
3142
|
paneKey: "",
|
|
3114
3143
|
activeKey: "",
|
|
3115
3144
|
disabled: false
|
|
3116
3145
|
};
|
|
3117
3146
|
const TabPane = (props) => {
|
|
3118
|
-
const { children, paneKey, activeKey } =
|
|
3147
|
+
const { children, paneKey, activeKey } = {
|
|
3148
|
+
...defaultProps$O,
|
|
3149
|
+
...props
|
|
3150
|
+
};
|
|
3119
3151
|
const b2 = cn("tabpane");
|
|
3120
3152
|
const classes = classNames({
|
|
3121
3153
|
active: paneKey === activeKey
|
|
@@ -3124,6 +3156,57 @@ const TabPane = (props) => {
|
|
|
3124
3156
|
className: classes
|
|
3125
3157
|
}, children);
|
|
3126
3158
|
};
|
|
3159
|
+
const defaultProps$N = {
|
|
3160
|
+
size: 3,
|
|
3161
|
+
current: 1,
|
|
3162
|
+
block: false,
|
|
3163
|
+
align: "center",
|
|
3164
|
+
fillZero: true,
|
|
3165
|
+
vertical: false
|
|
3166
|
+
};
|
|
3167
|
+
const Indicator = (props) => {
|
|
3168
|
+
const {
|
|
3169
|
+
size,
|
|
3170
|
+
current,
|
|
3171
|
+
block,
|
|
3172
|
+
align,
|
|
3173
|
+
fillZero,
|
|
3174
|
+
children,
|
|
3175
|
+
className,
|
|
3176
|
+
vertical,
|
|
3177
|
+
...rest
|
|
3178
|
+
} = {
|
|
3179
|
+
...defaultProps$N,
|
|
3180
|
+
...props
|
|
3181
|
+
};
|
|
3182
|
+
const b2 = cn("indicator");
|
|
3183
|
+
const classes = classNames({
|
|
3184
|
+
[`${b2("block")}`]: block,
|
|
3185
|
+
[`${b2("align")}__${align}`]: block && align,
|
|
3186
|
+
[`${b2("vertical")}`]: vertical
|
|
3187
|
+
}, b2(""));
|
|
3188
|
+
const renderEles = () => {
|
|
3189
|
+
const childs = [];
|
|
3190
|
+
for (let item = 1; item <= size; item++) {
|
|
3191
|
+
childs.push(item === current ? /* @__PURE__ */ React__default.createElement("div", {
|
|
3192
|
+
key: item,
|
|
3193
|
+
className: b2("number")
|
|
3194
|
+
}, fillZero && item < 10 ? `0${item}` : item) : /* @__PURE__ */ React__default.createElement("div", {
|
|
3195
|
+
key: item,
|
|
3196
|
+
className: b2("dot")
|
|
3197
|
+
}));
|
|
3198
|
+
}
|
|
3199
|
+
return childs;
|
|
3200
|
+
};
|
|
3201
|
+
useEffect(() => {
|
|
3202
|
+
}, []);
|
|
3203
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3204
|
+
className: `${classes} ${className}`,
|
|
3205
|
+
...rest
|
|
3206
|
+
}, renderEles());
|
|
3207
|
+
};
|
|
3208
|
+
Indicator.defaultProps = defaultProps$N;
|
|
3209
|
+
Indicator.displayName = "NutIndicator";
|
|
3127
3210
|
const MIN_DISTANCE = 10;
|
|
3128
3211
|
function getDirection(x2, y2) {
|
|
3129
3212
|
if (x2 > y2 && x2 > MIN_DISTANCE) {
|
|
@@ -3215,7 +3298,6 @@ const useRect = (elementRef) => {
|
|
|
3215
3298
|
class Notification$1 extends React.PureComponent {
|
|
3216
3299
|
constructor(props) {
|
|
3217
3300
|
super(props);
|
|
3218
|
-
__publicField(this, "closeTimer");
|
|
3219
3301
|
this.close = this.close.bind(this);
|
|
3220
3302
|
this.startCloseTimer = this.startCloseTimer.bind(this);
|
|
3221
3303
|
this.clearCloseTimer = this.clearCloseTimer.bind(this);
|
|
@@ -3287,7 +3369,10 @@ class Notification$1 extends React.PureComponent {
|
|
|
3287
3369
|
}
|
|
3288
3370
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
3289
3371
|
className: toastBem("inner"),
|
|
3290
|
-
style: {
|
|
3372
|
+
style: {
|
|
3373
|
+
textAlign: textAlignCenter ? "center" : "left",
|
|
3374
|
+
backgroundColor: bgColor
|
|
3375
|
+
}
|
|
3291
3376
|
}, icon ? /* @__PURE__ */ React.createElement("p", {
|
|
3292
3377
|
className: toastBem("icon-wrapper")
|
|
3293
3378
|
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
@@ -3298,7 +3383,6 @@ class Notification$1 extends React.PureComponent {
|
|
|
3298
3383
|
}, msg))));
|
|
3299
3384
|
}
|
|
3300
3385
|
}
|
|
3301
|
-
__publicField(Notification$1, "newInstance");
|
|
3302
3386
|
Notification$1.newInstance = (properties, callback) => {
|
|
3303
3387
|
const element = document.createElement("div");
|
|
3304
3388
|
if (properties.id) {
|
|
@@ -3319,9 +3403,10 @@ Notification$1.newInstance = (properties, callback) => {
|
|
|
3319
3403
|
}
|
|
3320
3404
|
});
|
|
3321
3405
|
}
|
|
3322
|
-
ReactDOM.render(/* @__PURE__ */ React.createElement(Notification$1,
|
|
3406
|
+
ReactDOM.render(/* @__PURE__ */ React.createElement(Notification$1, {
|
|
3407
|
+
...properties,
|
|
3323
3408
|
ref
|
|
3324
|
-
})
|
|
3409
|
+
}), element);
|
|
3325
3410
|
};
|
|
3326
3411
|
let messageInstance$1 = null;
|
|
3327
3412
|
const options$1 = {
|
|
@@ -3359,7 +3444,7 @@ function notice$1(opts) {
|
|
|
3359
3444
|
messageInstance$1 = null;
|
|
3360
3445
|
}
|
|
3361
3446
|
}
|
|
3362
|
-
const opts2 =
|
|
3447
|
+
const opts2 = { ...options$1, ...opts, onClose: close };
|
|
3363
3448
|
getInstance$1(opts2, (notification) => {
|
|
3364
3449
|
messageInstance$1 = notification;
|
|
3365
3450
|
});
|
|
@@ -3372,27 +3457,27 @@ const errorMsg$1 = (msg) => {
|
|
|
3372
3457
|
var Toast = {
|
|
3373
3458
|
text(msg, option = {}) {
|
|
3374
3459
|
errorMsg$1(msg);
|
|
3375
|
-
return notice$1(
|
|
3460
|
+
return notice$1({ msg, type: "text", ...option });
|
|
3376
3461
|
},
|
|
3377
3462
|
success(msg, option = {}) {
|
|
3378
3463
|
errorMsg$1(msg);
|
|
3379
|
-
return notice$1(
|
|
3464
|
+
return notice$1({ msg, icon: "success", type: "success", ...option });
|
|
3380
3465
|
},
|
|
3381
3466
|
fail(msg, option = {}) {
|
|
3382
3467
|
errorMsg$1(msg);
|
|
3383
|
-
return notice$1(
|
|
3468
|
+
return notice$1({ msg, icon: "failure", type: "fail", ...option });
|
|
3384
3469
|
},
|
|
3385
3470
|
loading(msg, option = {}) {
|
|
3386
3471
|
errorMsg$1(msg);
|
|
3387
|
-
return notice$1(
|
|
3472
|
+
return notice$1({ msg, icon: "loading", type: "loading", ...option });
|
|
3388
3473
|
},
|
|
3389
3474
|
warn(msg, option = {}) {
|
|
3390
3475
|
errorMsg$1(msg);
|
|
3391
|
-
return notice$1(
|
|
3476
|
+
return notice$1({ msg, icon: "tips", type: "warn", ...option });
|
|
3392
3477
|
},
|
|
3393
3478
|
customIcon(msg, option = {}) {
|
|
3394
3479
|
errorMsg$1(msg);
|
|
3395
|
-
return notice$1(
|
|
3480
|
+
return notice$1({ msg, ...option });
|
|
3396
3481
|
},
|
|
3397
3482
|
hide() {
|
|
3398
3483
|
if (messageInstance$1) {
|
|
@@ -3401,7 +3486,7 @@ var Toast = {
|
|
|
3401
3486
|
}
|
|
3402
3487
|
}
|
|
3403
3488
|
};
|
|
3404
|
-
const defaultProps$
|
|
3489
|
+
const defaultProps$M = {
|
|
3405
3490
|
range: false,
|
|
3406
3491
|
hiddenRange: false,
|
|
3407
3492
|
hiddenTag: false,
|
|
@@ -3431,7 +3516,7 @@ const Range = (props) => {
|
|
|
3431
3516
|
change,
|
|
3432
3517
|
dragStart,
|
|
3433
3518
|
dragEnd
|
|
3434
|
-
} =
|
|
3519
|
+
} = { ...defaultProps$M, ...props };
|
|
3435
3520
|
const [buttonIndex, SetButtonIndex] = useState(0);
|
|
3436
3521
|
const [initValue, SetInitValue] = useState();
|
|
3437
3522
|
const [dragStatus, SetDragStatus] = useState("start");
|
|
@@ -3640,7 +3725,7 @@ const Range = (props) => {
|
|
|
3640
3725
|
className: "max"
|
|
3641
3726
|
}, +max) : null);
|
|
3642
3727
|
};
|
|
3643
|
-
Range.defaultProps = defaultProps$
|
|
3728
|
+
Range.defaultProps = defaultProps$M;
|
|
3644
3729
|
Range.displayName = "NutRange";
|
|
3645
3730
|
const Utils = {
|
|
3646
3731
|
isLeapYear(y2) {
|
|
@@ -3649,7 +3734,15 @@ const Utils = {
|
|
|
3649
3734
|
getWhatDay(year, month, day) {
|
|
3650
3735
|
const date = new Date(`${year}/${month}/${day}`);
|
|
3651
3736
|
const index2 = date.getDay();
|
|
3652
|
-
const dayNames = [
|
|
3737
|
+
const dayNames = [
|
|
3738
|
+
"\u661F\u671F\u65E5",
|
|
3739
|
+
"\u661F\u671F\u4E00",
|
|
3740
|
+
"\u661F\u671F\u4E8C",
|
|
3741
|
+
"\u661F\u671F\u4E09",
|
|
3742
|
+
"\u661F\u671F\u56DB",
|
|
3743
|
+
"\u661F\u671F\u4E94",
|
|
3744
|
+
"\u661F\u671F\u516D"
|
|
3745
|
+
];
|
|
3653
3746
|
return dayNames[index2];
|
|
3654
3747
|
},
|
|
3655
3748
|
getMonthPreDay(year, month) {
|
|
@@ -3726,7 +3819,7 @@ function requestAniFrame() {
|
|
|
3726
3819
|
};
|
|
3727
3820
|
}
|
|
3728
3821
|
var requestAniFrame$1 = requestAniFrame();
|
|
3729
|
-
const defaultProps$
|
|
3822
|
+
const defaultProps$L = {
|
|
3730
3823
|
type: "one",
|
|
3731
3824
|
isAutoBackFill: false,
|
|
3732
3825
|
poppable: true,
|
|
@@ -3755,7 +3848,7 @@ const CalendarItem = (props) => {
|
|
|
3755
3848
|
onChoose,
|
|
3756
3849
|
onUpdate,
|
|
3757
3850
|
onClose
|
|
3758
|
-
} =
|
|
3851
|
+
} = { ...defaultProps$L, ...props };
|
|
3759
3852
|
const weeks = locale.calendaritem.weekdays;
|
|
3760
3853
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
3761
3854
|
const [unLoadPrev, setUnLoadPrev] = useState(false);
|
|
@@ -3896,7 +3989,11 @@ const CalendarItem = (props) => {
|
|
|
3896
3989
|
month = month == 12 ? 1 : ++month;
|
|
3897
3990
|
break;
|
|
3898
3991
|
}
|
|
3899
|
-
return [
|
|
3992
|
+
return [
|
|
3993
|
+
year,
|
|
3994
|
+
Utils.getNumTwoBit(month),
|
|
3995
|
+
Utils.getMonthDays(String(year), String(month))
|
|
3996
|
+
];
|
|
3900
3997
|
};
|
|
3901
3998
|
const getDaysStatus = (days, type2) => {
|
|
3902
3999
|
if (type2 == "prev" && days >= 7) {
|
|
@@ -4061,7 +4158,10 @@ const CalendarItem = (props) => {
|
|
|
4061
4158
|
if (endDate && Utils.compareDate(endDate, state.currDate[1])) {
|
|
4062
4159
|
state.currDate.splice(1, 1, endDate);
|
|
4063
4160
|
}
|
|
4064
|
-
state.defaultData = [
|
|
4161
|
+
state.defaultData = [
|
|
4162
|
+
...splitDate(state.currDate[0]),
|
|
4163
|
+
...splitDate(state.currDate[1])
|
|
4164
|
+
];
|
|
4065
4165
|
} else {
|
|
4066
4166
|
if (startDate && Utils.compareDate(state.currDate, startDate)) {
|
|
4067
4167
|
state.currDate = startDate;
|
|
@@ -4121,7 +4221,10 @@ const CalendarItem = (props) => {
|
|
|
4121
4221
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4122
4222
|
className: monthitemclasses
|
|
4123
4223
|
}, month.monthData && month.monthData.map((day, index2) => /* @__PURE__ */ React__default.createElement("div", {
|
|
4124
|
-
className: [
|
|
4224
|
+
className: [
|
|
4225
|
+
"calendar-month-day",
|
|
4226
|
+
getClass(day, month)
|
|
4227
|
+
].join(" "),
|
|
4125
4228
|
key: index2,
|
|
4126
4229
|
onClick: () => {
|
|
4127
4230
|
chooseDay(day, month);
|
|
@@ -4141,9 +4244,9 @@ const CalendarItem = (props) => {
|
|
|
4141
4244
|
onClick: confirm2
|
|
4142
4245
|
}, locale.confirm)) : ""));
|
|
4143
4246
|
};
|
|
4144
|
-
CalendarItem.defaultProps = defaultProps$
|
|
4247
|
+
CalendarItem.defaultProps = defaultProps$L;
|
|
4145
4248
|
CalendarItem.displayName = "NutCalendarItem";
|
|
4146
|
-
const defaultProps$
|
|
4249
|
+
const defaultProps$K = {
|
|
4147
4250
|
type: "one",
|
|
4148
4251
|
isAutoBackFill: false,
|
|
4149
4252
|
poppable: true,
|
|
@@ -4171,7 +4274,7 @@ const Calendar = (props) => {
|
|
|
4171
4274
|
endDate,
|
|
4172
4275
|
onClose,
|
|
4173
4276
|
onChoose
|
|
4174
|
-
} =
|
|
4277
|
+
} = { ...defaultProps$K, ...props };
|
|
4175
4278
|
const close = () => {
|
|
4176
4279
|
onClose && onClose();
|
|
4177
4280
|
};
|
|
@@ -4214,18 +4317,18 @@ const Calendar = (props) => {
|
|
|
4214
4317
|
onChoose: choose
|
|
4215
4318
|
}));
|
|
4216
4319
|
};
|
|
4217
|
-
Calendar.defaultProps = defaultProps$
|
|
4320
|
+
Calendar.defaultProps = defaultProps$K;
|
|
4218
4321
|
Calendar.displayName = "NutCalendar";
|
|
4219
|
-
const defaultProps$
|
|
4322
|
+
const defaultProps$J = {
|
|
4220
4323
|
disabled: false,
|
|
4221
4324
|
checkedValue: [],
|
|
4222
4325
|
onChange: (value) => {
|
|
4223
4326
|
}
|
|
4224
4327
|
};
|
|
4225
4328
|
const CheckboxGroup = React__default.forwardRef((props, ref) => {
|
|
4226
|
-
const { children } =
|
|
4329
|
+
const { children } = { ...defaultProps$J, ...props };
|
|
4227
4330
|
const b2 = cn("checkboxgroup");
|
|
4228
|
-
const
|
|
4331
|
+
const { className, disabled, onChange, checkedValue, ...rest } = props;
|
|
4229
4332
|
const [innerDisabled, setInnerDisabled] = useState(disabled);
|
|
4230
4333
|
const [innerValue, setInnerValue] = useState(checkedValue);
|
|
4231
4334
|
useImperativeHandle(ref, () => ({
|
|
@@ -4278,13 +4381,14 @@ const CheckboxGroup = React__default.forwardRef((props, ref) => {
|
|
|
4278
4381
|
});
|
|
4279
4382
|
});
|
|
4280
4383
|
}
|
|
4281
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
4282
|
-
className: `${b2()} ${className || ""}
|
|
4283
|
-
|
|
4384
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4385
|
+
className: `${b2()} ${className || ""}`,
|
|
4386
|
+
...rest
|
|
4387
|
+
}, cloneChildren());
|
|
4284
4388
|
});
|
|
4285
|
-
CheckboxGroup.defaultProps = defaultProps$
|
|
4389
|
+
CheckboxGroup.defaultProps = defaultProps$J;
|
|
4286
4390
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
4287
|
-
const defaultProps$
|
|
4391
|
+
const defaultProps$I = {
|
|
4288
4392
|
checked: false,
|
|
4289
4393
|
disabled: false,
|
|
4290
4394
|
textPosition: "right",
|
|
@@ -4295,9 +4399,9 @@ const defaultProps$F = {
|
|
|
4295
4399
|
}
|
|
4296
4400
|
};
|
|
4297
4401
|
const Checkbox = (props) => {
|
|
4298
|
-
const { children } =
|
|
4402
|
+
const { children } = { ...defaultProps$I, ...props };
|
|
4299
4403
|
const b2 = cn("checkbox");
|
|
4300
|
-
const
|
|
4404
|
+
const {
|
|
4301
4405
|
iconName,
|
|
4302
4406
|
iconSize,
|
|
4303
4407
|
label,
|
|
@@ -4306,18 +4410,9 @@ const Checkbox = (props) => {
|
|
|
4306
4410
|
iconActiveName,
|
|
4307
4411
|
checked,
|
|
4308
4412
|
disabled,
|
|
4309
|
-
onChange
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
"iconSize",
|
|
4313
|
-
"label",
|
|
4314
|
-
"className",
|
|
4315
|
-
"textPosition",
|
|
4316
|
-
"iconActiveName",
|
|
4317
|
-
"checked",
|
|
4318
|
-
"disabled",
|
|
4319
|
-
"onChange"
|
|
4320
|
-
]);
|
|
4413
|
+
onChange,
|
|
4414
|
+
...rest
|
|
4415
|
+
} = props;
|
|
4321
4416
|
const [innerChecked, setInnerChecked] = useState(checked);
|
|
4322
4417
|
const [innerDisabled, setDisabled] = useState(disabled);
|
|
4323
4418
|
useEffect(() => {
|
|
@@ -4345,17 +4440,23 @@ const Checkbox = (props) => {
|
|
|
4345
4440
|
onChange && onChange(!innerChecked, label || children);
|
|
4346
4441
|
return setInnerChecked(!innerChecked);
|
|
4347
4442
|
};
|
|
4348
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
4349
|
-
className: `${b2({ reverse: textPosition === "left" })} ${className || ""}
|
|
4350
|
-
|
|
4443
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4444
|
+
className: `${b2({ reverse: textPosition === "left" })} ${className || ""}`,
|
|
4445
|
+
...rest,
|
|
4351
4446
|
onClick: handleClick
|
|
4352
|
-
}
|
|
4447
|
+
}, renderIcon(), renderLabel());
|
|
4353
4448
|
};
|
|
4354
|
-
Checkbox.defaultProps = defaultProps$
|
|
4449
|
+
Checkbox.defaultProps = defaultProps$I;
|
|
4355
4450
|
Checkbox.displayName = "NutCheckBox";
|
|
4356
4451
|
Checkbox.Group = CheckboxGroup;
|
|
4357
4452
|
const InternalPickerSlot = (props, ref) => {
|
|
4358
|
-
const {
|
|
4453
|
+
const {
|
|
4454
|
+
isUpdate,
|
|
4455
|
+
keyIndex = 0,
|
|
4456
|
+
defaultValue,
|
|
4457
|
+
listData = [],
|
|
4458
|
+
chooseItem
|
|
4459
|
+
} = props;
|
|
4359
4460
|
const [currIndex, setCurrIndex] = useState(1);
|
|
4360
4461
|
const lineSpacing = 36;
|
|
4361
4462
|
const rotation = 20;
|
|
@@ -4538,7 +4639,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
4538
4639
|
const PickerSlot = React__default.forwardRef(InternalPickerSlot);
|
|
4539
4640
|
const InternalPicker = (props, ref) => {
|
|
4540
4641
|
const { locale } = useConfig();
|
|
4541
|
-
const
|
|
4642
|
+
const {
|
|
4542
4643
|
isVisible,
|
|
4543
4644
|
title,
|
|
4544
4645
|
listData = [],
|
|
@@ -4548,19 +4649,9 @@ const InternalPicker = (props, ref) => {
|
|
|
4548
4649
|
onCloseUpdate,
|
|
4549
4650
|
onChoose,
|
|
4550
4651
|
className,
|
|
4551
|
-
style
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
"title",
|
|
4555
|
-
"listData",
|
|
4556
|
-
"defaultValueData",
|
|
4557
|
-
"onConfirm",
|
|
4558
|
-
"onClose",
|
|
4559
|
-
"onCloseUpdate",
|
|
4560
|
-
"onChoose",
|
|
4561
|
-
"className",
|
|
4562
|
-
"style"
|
|
4563
|
-
]);
|
|
4652
|
+
style,
|
|
4653
|
+
...rest
|
|
4654
|
+
} = props;
|
|
4564
4655
|
const [chooseValueData, setchooseValueData] = useState([]);
|
|
4565
4656
|
const [cacheValueData, setcacheValueData] = useState([]);
|
|
4566
4657
|
const [isUpdate, setisUpdate] = useState(false);
|
|
@@ -4581,7 +4672,7 @@ const InternalPicker = (props, ref) => {
|
|
|
4581
4672
|
init();
|
|
4582
4673
|
}, [listData]);
|
|
4583
4674
|
const updateChooseValue = (index2, value, cacheValueData2) => {
|
|
4584
|
-
var
|
|
4675
|
+
var _a;
|
|
4585
4676
|
if (!value)
|
|
4586
4677
|
return;
|
|
4587
4678
|
setcacheValueData((data) => {
|
|
@@ -4589,7 +4680,7 @@ const InternalPicker = (props, ref) => {
|
|
|
4589
4680
|
cache.splice(index2, 1, value);
|
|
4590
4681
|
return cache;
|
|
4591
4682
|
});
|
|
4592
|
-
(
|
|
4683
|
+
(_a = refList[index2].current) == null ? void 0 : _a.updateTransform(value);
|
|
4593
4684
|
};
|
|
4594
4685
|
useImperativeHandle(ref, () => {
|
|
4595
4686
|
return { updateChooseValue };
|
|
@@ -4637,10 +4728,11 @@ const InternalPicker = (props, ref) => {
|
|
|
4637
4728
|
onClose: () => {
|
|
4638
4729
|
onClose && onClose();
|
|
4639
4730
|
}
|
|
4640
|
-
}, /* @__PURE__ */ React__default.createElement("div",
|
|
4731
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4641
4732
|
className: `${b2()} ${className || ""}`,
|
|
4642
|
-
style
|
|
4643
|
-
|
|
4733
|
+
style,
|
|
4734
|
+
...rest
|
|
4735
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4644
4736
|
className: b2("control")
|
|
4645
4737
|
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
4646
4738
|
className: b2("cancel-btn"),
|
|
@@ -4667,7 +4759,7 @@ const InternalPicker = (props, ref) => {
|
|
|
4667
4759
|
};
|
|
4668
4760
|
const Picker = React__default.forwardRef(InternalPicker);
|
|
4669
4761
|
const currentYear = new Date().getFullYear();
|
|
4670
|
-
const defaultProps$
|
|
4762
|
+
const defaultProps$H = {
|
|
4671
4763
|
modelValue: new Date(),
|
|
4672
4764
|
visible: false,
|
|
4673
4765
|
title: "",
|
|
@@ -4679,7 +4771,7 @@ const defaultProps$E = {
|
|
|
4679
4771
|
onCloseDatePicker: () => void 0
|
|
4680
4772
|
};
|
|
4681
4773
|
const DatePicker = (props) => {
|
|
4682
|
-
const
|
|
4774
|
+
const {
|
|
4683
4775
|
minDate,
|
|
4684
4776
|
maxDate,
|
|
4685
4777
|
type,
|
|
@@ -4691,21 +4783,12 @@ const DatePicker = (props) => {
|
|
|
4691
4783
|
onCloseDatePicker,
|
|
4692
4784
|
onConfirmDatePicker,
|
|
4693
4785
|
className,
|
|
4694
|
-
style
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
"minuteStep",
|
|
4701
|
-
"modelValue",
|
|
4702
|
-
"visible",
|
|
4703
|
-
"title",
|
|
4704
|
-
"onCloseDatePicker",
|
|
4705
|
-
"onConfirmDatePicker",
|
|
4706
|
-
"className",
|
|
4707
|
-
"style"
|
|
4708
|
-
]);
|
|
4786
|
+
style,
|
|
4787
|
+
...rest
|
|
4788
|
+
} = {
|
|
4789
|
+
...defaultProps$H,
|
|
4790
|
+
...props
|
|
4791
|
+
};
|
|
4709
4792
|
const [show, setShow] = useState(false);
|
|
4710
4793
|
const [currentDate, setCurrentDate] = useState(new Date());
|
|
4711
4794
|
const [defaultValue, setDefaultValue] = useState([]);
|
|
@@ -4858,13 +4941,17 @@ const DatePicker = (props) => {
|
|
|
4858
4941
|
modelValue2.getDate() + zhCNType.day
|
|
4859
4942
|
];
|
|
4860
4943
|
} else {
|
|
4861
|
-
val = [
|
|
4944
|
+
val = [
|
|
4945
|
+
modelValue2.getFullYear(),
|
|
4946
|
+
resValue,
|
|
4947
|
+
modelValue2.getDate()
|
|
4948
|
+
];
|
|
4862
4949
|
}
|
|
4863
4950
|
setDefaultValue(val);
|
|
4864
4951
|
setListData(data);
|
|
4865
4952
|
setTimeout(() => {
|
|
4866
|
-
var
|
|
4867
|
-
(
|
|
4953
|
+
var _a;
|
|
4954
|
+
(_a = pickerRef.current) == null ? void 0 : _a.updateChooseValue(index2 + 1, data[1] ? data[1][0].toString() : "0", cacheValueData);
|
|
4868
4955
|
}, 200);
|
|
4869
4956
|
}, 100);
|
|
4870
4957
|
}
|
|
@@ -4920,10 +5007,11 @@ const DatePicker = (props) => {
|
|
|
4920
5007
|
useEffect(() => {
|
|
4921
5008
|
setShow(visible);
|
|
4922
5009
|
}, [visible]);
|
|
4923
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
5010
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4924
5011
|
className: `nut-datepicker ${className || ""}`,
|
|
4925
|
-
style
|
|
4926
|
-
|
|
5012
|
+
style,
|
|
5013
|
+
...rest
|
|
5014
|
+
}, /* @__PURE__ */ React__default.createElement(Picker, {
|
|
4927
5015
|
isVisible: show,
|
|
4928
5016
|
listData,
|
|
4929
5017
|
onClose: onCloseDatePicker,
|
|
@@ -4933,9 +5021,9 @@ const DatePicker = (props) => {
|
|
|
4933
5021
|
ref: pickerRef
|
|
4934
5022
|
}));
|
|
4935
5023
|
};
|
|
4936
|
-
DatePicker.defaultProps = defaultProps$
|
|
5024
|
+
DatePicker.defaultProps = defaultProps$H;
|
|
4937
5025
|
DatePicker.displayName = "NutDatePicker";
|
|
4938
|
-
const defaultProps$
|
|
5026
|
+
const defaultProps$G = {
|
|
4939
5027
|
disabled: false,
|
|
4940
5028
|
buttonSize: "",
|
|
4941
5029
|
min: 1,
|
|
@@ -4951,7 +5039,7 @@ function pxCheck(value) {
|
|
|
4951
5039
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
4952
5040
|
}
|
|
4953
5041
|
const InputNumber = (props) => {
|
|
4954
|
-
const
|
|
5042
|
+
const {
|
|
4955
5043
|
children,
|
|
4956
5044
|
disabled,
|
|
4957
5045
|
buttonSize,
|
|
@@ -4970,28 +5058,12 @@ const InputNumber = (props) => {
|
|
|
4970
5058
|
change,
|
|
4971
5059
|
overlimit,
|
|
4972
5060
|
blur,
|
|
4973
|
-
focus
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
"max",
|
|
4980
|
-
"inputWidth",
|
|
4981
|
-
"readonly",
|
|
4982
|
-
"modelValue",
|
|
4983
|
-
"decimalPlaces",
|
|
4984
|
-
"step",
|
|
4985
|
-
"isAsync",
|
|
4986
|
-
"className",
|
|
4987
|
-
"style",
|
|
4988
|
-
"add",
|
|
4989
|
-
"reduce",
|
|
4990
|
-
"change",
|
|
4991
|
-
"overlimit",
|
|
4992
|
-
"blur",
|
|
4993
|
-
"focus"
|
|
4994
|
-
]);
|
|
5061
|
+
focus,
|
|
5062
|
+
...restProps
|
|
5063
|
+
} = {
|
|
5064
|
+
...defaultProps$G,
|
|
5065
|
+
...props
|
|
5066
|
+
};
|
|
4995
5067
|
const [inputValue, setInputValue] = useState(modelValue);
|
|
4996
5068
|
useEffect(() => {
|
|
4997
5069
|
setInputValue(modelValue);
|
|
@@ -5000,9 +5072,10 @@ const InputNumber = (props) => {
|
|
|
5000
5072
|
const classes = classNames({
|
|
5001
5073
|
[`${b2("")}--disabled`]: disabled
|
|
5002
5074
|
}, className, b2(""));
|
|
5003
|
-
const styles =
|
|
5004
|
-
height: pxCheck(buttonSize)
|
|
5005
|
-
|
|
5075
|
+
const styles = {
|
|
5076
|
+
height: pxCheck(buttonSize),
|
|
5077
|
+
...style
|
|
5078
|
+
};
|
|
5006
5079
|
const addAllow = (value = Number(inputValue)) => {
|
|
5007
5080
|
return value < Number(max) && !disabled;
|
|
5008
5081
|
};
|
|
@@ -5082,10 +5155,11 @@ const InputNumber = (props) => {
|
|
|
5082
5155
|
emitChange(value, e2);
|
|
5083
5156
|
blur && blur(e2);
|
|
5084
5157
|
};
|
|
5085
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
5158
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
5086
5159
|
className: classes,
|
|
5087
|
-
style: styles
|
|
5088
|
-
|
|
5160
|
+
style: styles,
|
|
5161
|
+
...restProps
|
|
5162
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
5089
5163
|
className: iconMinusClasses,
|
|
5090
5164
|
size: buttonSize,
|
|
5091
5165
|
name: "minus",
|
|
@@ -5108,7 +5182,7 @@ const InputNumber = (props) => {
|
|
|
5108
5182
|
click: addNumber
|
|
5109
5183
|
}));
|
|
5110
5184
|
};
|
|
5111
|
-
InputNumber.defaultProps = defaultProps$
|
|
5185
|
+
InputNumber.defaultProps = defaultProps$G;
|
|
5112
5186
|
InputNumber.displayName = "NutInputNumber";
|
|
5113
5187
|
function trimExtraChar(value, char, regExp) {
|
|
5114
5188
|
const index2 = value.indexOf(char);
|
|
@@ -5134,7 +5208,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
5134
5208
|
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
5135
5209
|
return value.replace(regExp, "");
|
|
5136
5210
|
}
|
|
5137
|
-
const defaultProps$
|
|
5211
|
+
const defaultProps$F = {
|
|
5138
5212
|
type: "text",
|
|
5139
5213
|
defaultValue: "",
|
|
5140
5214
|
placeholder: "",
|
|
@@ -5165,7 +5239,7 @@ const Input = (props) => {
|
|
|
5165
5239
|
blur,
|
|
5166
5240
|
focus,
|
|
5167
5241
|
clear
|
|
5168
|
-
} =
|
|
5242
|
+
} = { ...defaultProps$F, ...props };
|
|
5169
5243
|
locale.placeholder = placeholder || locale.placeholder;
|
|
5170
5244
|
const inputBem = cn("input");
|
|
5171
5245
|
const [inputValue, SetInputValue] = useState("");
|
|
@@ -5229,7 +5303,7 @@ const Input = (props) => {
|
|
|
5229
5303
|
disabled,
|
|
5230
5304
|
readOnly: readonly,
|
|
5231
5305
|
value: inputValue,
|
|
5232
|
-
style:
|
|
5306
|
+
style: { ...style, ...textAlignStyle },
|
|
5233
5307
|
maxLength,
|
|
5234
5308
|
onBlur: (e2) => {
|
|
5235
5309
|
valueBlur(e2);
|
|
@@ -5250,14 +5324,14 @@ const Input = (props) => {
|
|
|
5250
5324
|
size: "12px"
|
|
5251
5325
|
}) : null) : null);
|
|
5252
5326
|
};
|
|
5253
|
-
Input.defaultProps = defaultProps$
|
|
5327
|
+
Input.defaultProps = defaultProps$F;
|
|
5254
5328
|
Input.displayName = "NutInput";
|
|
5255
5329
|
const radioContext = {
|
|
5256
5330
|
onChange: (val) => {
|
|
5257
5331
|
}
|
|
5258
5332
|
};
|
|
5259
5333
|
var RadioContext = React__default.createContext(radioContext);
|
|
5260
|
-
const defaultProps$
|
|
5334
|
+
const defaultProps$E = {
|
|
5261
5335
|
value: null,
|
|
5262
5336
|
textPosition: "right",
|
|
5263
5337
|
onChange: (value) => {
|
|
@@ -5265,9 +5339,9 @@ const defaultProps$B = {
|
|
|
5265
5339
|
direction: "vertical"
|
|
5266
5340
|
};
|
|
5267
5341
|
const RadioGroup = React__default.forwardRef((props, ref) => {
|
|
5268
|
-
const { children } =
|
|
5342
|
+
const { children } = { ...defaultProps$E, ...props };
|
|
5269
5343
|
cn("RadioGroup");
|
|
5270
|
-
const
|
|
5344
|
+
const { className, value, onChange, textPosition, direction, ...rest } = props;
|
|
5271
5345
|
const [val2State, setVal2State] = useState(value);
|
|
5272
5346
|
useEffect(() => {
|
|
5273
5347
|
setVal2State(value);
|
|
@@ -5296,13 +5370,14 @@ const RadioGroup = React__default.forwardRef((props, ref) => {
|
|
|
5296
5370
|
onChange && onChange(val);
|
|
5297
5371
|
}
|
|
5298
5372
|
}
|
|
5299
|
-
}, /* @__PURE__ */ React__default.createElement("div",
|
|
5300
|
-
className: `nut-radiogroup nut-radiogroup--${props.direction}
|
|
5301
|
-
|
|
5373
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
5374
|
+
className: `nut-radiogroup nut-radiogroup--${props.direction}`,
|
|
5375
|
+
...rest
|
|
5376
|
+
}, cloneChildren()));
|
|
5302
5377
|
});
|
|
5303
|
-
RadioGroup.defaultProps = defaultProps$
|
|
5378
|
+
RadioGroup.defaultProps = defaultProps$E;
|
|
5304
5379
|
RadioGroup.displayName = "NutRadioGroup";
|
|
5305
|
-
const defaultProps$
|
|
5380
|
+
const defaultProps$D = {
|
|
5306
5381
|
disabled: false,
|
|
5307
5382
|
checked: false,
|
|
5308
5383
|
shape: "round",
|
|
@@ -5315,8 +5390,8 @@ const defaultProps$A = {
|
|
|
5315
5390
|
}
|
|
5316
5391
|
};
|
|
5317
5392
|
const Radio = (props) => {
|
|
5318
|
-
const { children } =
|
|
5319
|
-
const
|
|
5393
|
+
const { children } = { ...defaultProps$D, ...props };
|
|
5394
|
+
const {
|
|
5320
5395
|
className,
|
|
5321
5396
|
disabled,
|
|
5322
5397
|
checked,
|
|
@@ -5326,19 +5401,9 @@ const Radio = (props) => {
|
|
|
5326
5401
|
iconName,
|
|
5327
5402
|
iconActiveName,
|
|
5328
5403
|
iconSize,
|
|
5329
|
-
onChange
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
"disabled",
|
|
5333
|
-
"checked",
|
|
5334
|
-
"shape",
|
|
5335
|
-
"textPosition",
|
|
5336
|
-
"value",
|
|
5337
|
-
"iconName",
|
|
5338
|
-
"iconActiveName",
|
|
5339
|
-
"iconSize",
|
|
5340
|
-
"onChange"
|
|
5341
|
-
]);
|
|
5404
|
+
onChange,
|
|
5405
|
+
...rest
|
|
5406
|
+
} = props;
|
|
5342
5407
|
const componentName = "nut-radio";
|
|
5343
5408
|
const [checkedStatement, setCheckedStatement] = useState(checked);
|
|
5344
5409
|
const [valueStatement, setValueStatement] = useState(value);
|
|
@@ -5378,17 +5443,19 @@ const Radio = (props) => {
|
|
|
5378
5443
|
context2 && context2.onChange(valueStatement);
|
|
5379
5444
|
};
|
|
5380
5445
|
const reverseState = textPosition === "left";
|
|
5381
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
5446
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
5382
5447
|
className: `nut-radio ${className}`,
|
|
5383
|
-
onClick: handleClick
|
|
5384
|
-
|
|
5448
|
+
onClick: handleClick,
|
|
5449
|
+
...rest
|
|
5450
|
+
}, props.shape == "button" ? renderButton() : reverseState ? [renderLabel(), renderIcon()] : [renderIcon(), renderLabel()]);
|
|
5385
5451
|
};
|
|
5386
|
-
Radio.defaultProps = defaultProps$
|
|
5452
|
+
Radio.defaultProps = defaultProps$D;
|
|
5387
5453
|
Radio.displayName = "NutRadio";
|
|
5388
5454
|
Radio.RadioGroup = RadioGroup;
|
|
5389
|
-
const defaultProps$
|
|
5455
|
+
const defaultProps$C = {
|
|
5390
5456
|
count: 5,
|
|
5391
5457
|
modelValue: 0,
|
|
5458
|
+
minimizeValue: 0,
|
|
5392
5459
|
iconSize: 18,
|
|
5393
5460
|
activeColor: "",
|
|
5394
5461
|
voidColor: "",
|
|
@@ -5403,6 +5470,7 @@ const Rate = (props) => {
|
|
|
5403
5470
|
const {
|
|
5404
5471
|
count,
|
|
5405
5472
|
modelValue,
|
|
5473
|
+
minimizeValue,
|
|
5406
5474
|
iconSize,
|
|
5407
5475
|
activeColor,
|
|
5408
5476
|
voidColor,
|
|
@@ -5413,7 +5481,7 @@ const Rate = (props) => {
|
|
|
5413
5481
|
allowHalf,
|
|
5414
5482
|
spacing,
|
|
5415
5483
|
change
|
|
5416
|
-
} =
|
|
5484
|
+
} = { ...defaultProps$C, ...props };
|
|
5417
5485
|
const b2 = cn("rate");
|
|
5418
5486
|
const bi = cn("rate-item");
|
|
5419
5487
|
const [countArray, setCountArray] = useState([1, 2, 3, 4, 5]);
|
|
@@ -5426,7 +5494,7 @@ const Rate = (props) => {
|
|
|
5426
5494
|
setCountArray(tmp);
|
|
5427
5495
|
}, [count]);
|
|
5428
5496
|
useEffect(() => {
|
|
5429
|
-
setScore(Number(modelValue));
|
|
5497
|
+
setScore(Math.max(Number(modelValue), Number(minimizeValue)));
|
|
5430
5498
|
}, [modelValue]);
|
|
5431
5499
|
const pxCheck2 = (value) => {
|
|
5432
5500
|
return isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
@@ -5447,6 +5515,7 @@ const Rate = (props) => {
|
|
|
5447
5515
|
}
|
|
5448
5516
|
}
|
|
5449
5517
|
}
|
|
5518
|
+
value = Math.max(value, Number(minimizeValue));
|
|
5450
5519
|
setScore(value);
|
|
5451
5520
|
change && change(value);
|
|
5452
5521
|
};
|
|
@@ -5476,9 +5545,9 @@ const Rate = (props) => {
|
|
|
5476
5545
|
}));
|
|
5477
5546
|
}));
|
|
5478
5547
|
};
|
|
5479
|
-
Rate.defaultProps = defaultProps$
|
|
5548
|
+
Rate.defaultProps = defaultProps$C;
|
|
5480
5549
|
Rate.displayName = "NutRate";
|
|
5481
|
-
const defaultProps$
|
|
5550
|
+
const defaultProps$B = {
|
|
5482
5551
|
title: "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
5483
5552
|
desc: "\u60A8\u4F7F\u7528\u4E86\u865A\u62DF\u8D44\u4EA7\uFF0C\u8BF7\u8FDB\u884C\u9A8C\u8BC1",
|
|
5484
5553
|
tips: "\u5FD8\u8BB0\u5BC6\u7801",
|
|
@@ -5504,7 +5573,7 @@ const defaultProps$y = {
|
|
|
5504
5573
|
};
|
|
5505
5574
|
const ShortPassword = (props) => {
|
|
5506
5575
|
const { locale } = useConfig();
|
|
5507
|
-
const
|
|
5576
|
+
const {
|
|
5508
5577
|
title,
|
|
5509
5578
|
desc,
|
|
5510
5579
|
tips,
|
|
@@ -5521,26 +5590,9 @@ const ShortPassword = (props) => {
|
|
|
5521
5590
|
onTips,
|
|
5522
5591
|
onCancel,
|
|
5523
5592
|
onClose,
|
|
5524
|
-
complete
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
"desc",
|
|
5528
|
-
"tips",
|
|
5529
|
-
"visible",
|
|
5530
|
-
"modelValue",
|
|
5531
|
-
"errorMsg",
|
|
5532
|
-
"noButton",
|
|
5533
|
-
"closeOnClickOverlay",
|
|
5534
|
-
"length",
|
|
5535
|
-
"style",
|
|
5536
|
-
"className",
|
|
5537
|
-
"change",
|
|
5538
|
-
"onOk",
|
|
5539
|
-
"onTips",
|
|
5540
|
-
"onCancel",
|
|
5541
|
-
"onClose",
|
|
5542
|
-
"complete"
|
|
5543
|
-
]);
|
|
5593
|
+
complete,
|
|
5594
|
+
...reset
|
|
5595
|
+
} = props;
|
|
5544
5596
|
const b2 = cn("shortpassword");
|
|
5545
5597
|
const textInput = useRef(null);
|
|
5546
5598
|
const range = (val) => {
|
|
@@ -5603,10 +5655,11 @@ const ShortPassword = (props) => {
|
|
|
5603
5655
|
"close-on-click-overlay": closeOnClickOverlay,
|
|
5604
5656
|
onClickOverlay: onClose,
|
|
5605
5657
|
onClickCloseIcon: onClose
|
|
5606
|
-
}, /* @__PURE__ */ React__default.createElement("div",
|
|
5658
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
5607
5659
|
className: `${b2()} ${className}`,
|
|
5608
|
-
style:
|
|
5609
|
-
|
|
5660
|
+
style: { ...style },
|
|
5661
|
+
...reset
|
|
5662
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
5610
5663
|
className: b2("title")
|
|
5611
5664
|
}, locale.shortpassword.title || title), /* @__PURE__ */ React__default.createElement("div", {
|
|
5612
5665
|
className: b2("subtitle")
|
|
@@ -5654,15 +5707,15 @@ const ShortPassword = (props) => {
|
|
|
5654
5707
|
onClick: () => sure()
|
|
5655
5708
|
}, locale.confirm)) : null)));
|
|
5656
5709
|
};
|
|
5657
|
-
ShortPassword.defaultProps = defaultProps$
|
|
5710
|
+
ShortPassword.defaultProps = defaultProps$B;
|
|
5658
5711
|
ShortPassword.displayName = "NutShortPassword";
|
|
5659
|
-
const defaultProps$
|
|
5712
|
+
const defaultProps$A = {
|
|
5660
5713
|
defaultValue: "",
|
|
5661
5714
|
textAlign: "left",
|
|
5662
5715
|
limitshow: false,
|
|
5663
5716
|
maxlength: "",
|
|
5664
5717
|
rows: "",
|
|
5665
|
-
placeholder: "
|
|
5718
|
+
placeholder: "",
|
|
5666
5719
|
readonly: false,
|
|
5667
5720
|
disabled: false,
|
|
5668
5721
|
autosize: false
|
|
@@ -5681,10 +5734,10 @@ const TextArea = (props) => {
|
|
|
5681
5734
|
disabled,
|
|
5682
5735
|
autosize,
|
|
5683
5736
|
style,
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
} =
|
|
5737
|
+
onChange,
|
|
5738
|
+
onBlur,
|
|
5739
|
+
onFocus
|
|
5740
|
+
} = { ...defaultProps$A, ...props };
|
|
5688
5741
|
const textareaBem = cn("textarea");
|
|
5689
5742
|
const [inputValue, SetInputValue] = useState("");
|
|
5690
5743
|
useEffect(() => {
|
|
@@ -5702,18 +5755,14 @@ const TextArea = (props) => {
|
|
|
5702
5755
|
text.value = text.value.substring(0, Number(maxlength));
|
|
5703
5756
|
}
|
|
5704
5757
|
SetInputValue(text.value);
|
|
5705
|
-
|
|
5706
|
-
change(text.value, event);
|
|
5707
|
-
}
|
|
5758
|
+
onChange && onChange(text.value, event);
|
|
5708
5759
|
};
|
|
5709
5760
|
const textFocus = (event) => {
|
|
5710
5761
|
if (disabled)
|
|
5711
5762
|
return;
|
|
5712
5763
|
if (readonly)
|
|
5713
5764
|
return;
|
|
5714
|
-
|
|
5715
|
-
focus(event);
|
|
5716
|
-
}
|
|
5765
|
+
onFocus && onFocus(event);
|
|
5717
5766
|
};
|
|
5718
5767
|
const textBlur = (event) => {
|
|
5719
5768
|
if (disabled)
|
|
@@ -5721,21 +5770,18 @@ const TextArea = (props) => {
|
|
|
5721
5770
|
if (readonly)
|
|
5722
5771
|
return;
|
|
5723
5772
|
const text = event.target;
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
}
|
|
5727
|
-
if (blur) {
|
|
5728
|
-
blur(event);
|
|
5729
|
-
}
|
|
5773
|
+
onChange && onChange(text.value, event);
|
|
5774
|
+
onBlur && onBlur(event);
|
|
5730
5775
|
};
|
|
5731
5776
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
5732
5777
|
className: `${textareaBem()} ${disabled ? textareaBem("disabled") : ""} ${className || ""}`
|
|
5733
5778
|
}, /* @__PURE__ */ React__default.createElement("textarea", {
|
|
5734
5779
|
className: textareaBem("textarea"),
|
|
5735
|
-
style:
|
|
5780
|
+
style: {
|
|
5736
5781
|
textAlign,
|
|
5737
|
-
resize: `${autosize ? "vertical" : "none"}
|
|
5738
|
-
|
|
5782
|
+
resize: `${autosize ? "vertical" : "none"}`,
|
|
5783
|
+
...style
|
|
5784
|
+
},
|
|
5739
5785
|
disabled,
|
|
5740
5786
|
readOnly: readonly,
|
|
5741
5787
|
value: inputValue,
|
|
@@ -5750,33 +5796,26 @@ const TextArea = (props) => {
|
|
|
5750
5796
|
},
|
|
5751
5797
|
rows,
|
|
5752
5798
|
maxLength: maxlength < 0 ? 0 : maxlength,
|
|
5753
|
-
placeholder: locale.placeholder
|
|
5799
|
+
placeholder: placeholder || locale.placeholder
|
|
5754
5800
|
}), limitshow ? /* @__PURE__ */ React__default.createElement("div", {
|
|
5755
5801
|
className: textareaBem("limit")
|
|
5756
5802
|
}, inputValue.length, "/", maxlength < 0 ? 0 : maxlength) : null);
|
|
5757
5803
|
};
|
|
5758
|
-
TextArea.defaultProps = defaultProps$
|
|
5804
|
+
TextArea.defaultProps = defaultProps$A;
|
|
5759
5805
|
TextArea.displayName = "NutTextArea";
|
|
5760
5806
|
class UploadOptions {
|
|
5761
5807
|
constructor() {
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
__publicField(this, "withCredentials", false);
|
|
5770
|
-
__publicField(this, "onStart");
|
|
5771
|
-
__publicField(this, "taroFilePath");
|
|
5772
|
-
__publicField(this, "onProgress");
|
|
5773
|
-
__publicField(this, "onSuccess");
|
|
5774
|
-
__publicField(this, "onFailure");
|
|
5808
|
+
this.url = "";
|
|
5809
|
+
this.name = "file";
|
|
5810
|
+
this.method = "post";
|
|
5811
|
+
this.xhrState = 200;
|
|
5812
|
+
this.timeout = 30 * 1e3;
|
|
5813
|
+
this.headers = {};
|
|
5814
|
+
this.withCredentials = false;
|
|
5775
5815
|
}
|
|
5776
5816
|
}
|
|
5777
5817
|
class Upload {
|
|
5778
5818
|
constructor(options2) {
|
|
5779
|
-
__publicField(this, "options");
|
|
5780
5819
|
this.options = options2;
|
|
5781
5820
|
}
|
|
5782
5821
|
upload() {
|
|
@@ -5811,7 +5850,7 @@ class Upload {
|
|
|
5811
5850
|
}
|
|
5812
5851
|
}
|
|
5813
5852
|
}
|
|
5814
|
-
const defaultProps$
|
|
5853
|
+
const defaultProps$z = {
|
|
5815
5854
|
url: "",
|
|
5816
5855
|
maximum: 1,
|
|
5817
5856
|
uploadIcon: "photograph",
|
|
@@ -5840,18 +5879,15 @@ const defaultProps$w = {
|
|
|
5840
5879
|
};
|
|
5841
5880
|
class FileItem {
|
|
5842
5881
|
constructor() {
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
__publicField(this, "url");
|
|
5848
|
-
__publicField(this, "type");
|
|
5849
|
-
__publicField(this, "formData", new FormData());
|
|
5882
|
+
this.status = "ready";
|
|
5883
|
+
this.message = "\u51C6\u5907\u4E2D..";
|
|
5884
|
+
this.uid = new Date().getTime().toString();
|
|
5885
|
+
this.formData = new FormData();
|
|
5850
5886
|
}
|
|
5851
5887
|
}
|
|
5852
5888
|
const InternalUploader = (props, ref) => {
|
|
5853
5889
|
const { locale } = useConfig();
|
|
5854
|
-
const
|
|
5890
|
+
const {
|
|
5855
5891
|
children,
|
|
5856
5892
|
uploadIcon,
|
|
5857
5893
|
uploadIconSize,
|
|
@@ -5887,45 +5923,9 @@ const InternalUploader = (props, ref) => {
|
|
|
5887
5923
|
failure,
|
|
5888
5924
|
oversize,
|
|
5889
5925
|
beforeUpload,
|
|
5890
|
-
beforeDelete
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
"uploadIcon",
|
|
5894
|
-
"uploadIconSize",
|
|
5895
|
-
"name",
|
|
5896
|
-
"accept",
|
|
5897
|
-
"defaultFileList",
|
|
5898
|
-
"listType",
|
|
5899
|
-
"disabled",
|
|
5900
|
-
"multiple",
|
|
5901
|
-
"url",
|
|
5902
|
-
"defaultImg",
|
|
5903
|
-
"headers",
|
|
5904
|
-
"timeout",
|
|
5905
|
-
"method",
|
|
5906
|
-
"xhrState",
|
|
5907
|
-
"withCredentials",
|
|
5908
|
-
"data",
|
|
5909
|
-
"isPreview",
|
|
5910
|
-
"isDeletable",
|
|
5911
|
-
"maximum",
|
|
5912
|
-
"capture",
|
|
5913
|
-
"maximize",
|
|
5914
|
-
"className",
|
|
5915
|
-
"autoUpload",
|
|
5916
|
-
"clearInput",
|
|
5917
|
-
"start",
|
|
5918
|
-
"removeImage",
|
|
5919
|
-
"change",
|
|
5920
|
-
"fileItemClick",
|
|
5921
|
-
"progress",
|
|
5922
|
-
"success",
|
|
5923
|
-
"update",
|
|
5924
|
-
"failure",
|
|
5925
|
-
"oversize",
|
|
5926
|
-
"beforeUpload",
|
|
5927
|
-
"beforeDelete"
|
|
5928
|
-
]);
|
|
5926
|
+
beforeDelete,
|
|
5927
|
+
...restProps
|
|
5928
|
+
} = { ...defaultProps$z, ...props };
|
|
5929
5929
|
const [fileList, setFileList] = useState([]);
|
|
5930
5930
|
const [uploadQueue, setUploadQueue] = useState([]);
|
|
5931
5931
|
useEffect(() => {
|
|
@@ -6113,9 +6113,10 @@ const InternalUploader = (props, ref) => {
|
|
|
6113
6113
|
const handleItemClick = (file) => {
|
|
6114
6114
|
fileItemClick && fileItemClick(file);
|
|
6115
6115
|
};
|
|
6116
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
6117
|
-
className: classes
|
|
6118
|
-
|
|
6116
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6117
|
+
className: classes,
|
|
6118
|
+
...restProps
|
|
6119
|
+
}, children && /* @__PURE__ */ React__default.createElement("div", {
|
|
6119
6120
|
className: "nut-uploader__slot"
|
|
6120
6121
|
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children, maximum > fileList.length && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, capture ? /* @__PURE__ */ React__default.createElement("input", {
|
|
6121
6122
|
className: "nut-uploader__input",
|
|
@@ -6213,9 +6214,9 @@ const InternalUploader = (props, ref) => {
|
|
|
6213
6214
|
})));
|
|
6214
6215
|
};
|
|
6215
6216
|
const Uploader = React__default.forwardRef(InternalUploader);
|
|
6216
|
-
Uploader.defaultProps = defaultProps$
|
|
6217
|
+
Uploader.defaultProps = defaultProps$z;
|
|
6217
6218
|
Uploader.displayName = "NutUploader";
|
|
6218
|
-
const defaultProps$
|
|
6219
|
+
const defaultProps$y = {
|
|
6219
6220
|
cancelTxt: "",
|
|
6220
6221
|
optionTag: "name",
|
|
6221
6222
|
optionSubTag: "subname",
|
|
@@ -6233,7 +6234,7 @@ const defaultProps$v = {
|
|
|
6233
6234
|
style: {}
|
|
6234
6235
|
};
|
|
6235
6236
|
const ActionSheet = (props) => {
|
|
6236
|
-
const
|
|
6237
|
+
const {
|
|
6237
6238
|
cancelTxt,
|
|
6238
6239
|
optionTag,
|
|
6239
6240
|
optionSubTag,
|
|
@@ -6246,22 +6247,9 @@ const ActionSheet = (props) => {
|
|
|
6246
6247
|
choose,
|
|
6247
6248
|
visible,
|
|
6248
6249
|
className,
|
|
6249
|
-
style
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
"optionTag",
|
|
6253
|
-
"optionSubTag",
|
|
6254
|
-
"chooseTagValue",
|
|
6255
|
-
"title",
|
|
6256
|
-
"color",
|
|
6257
|
-
"description",
|
|
6258
|
-
"menuItems",
|
|
6259
|
-
"cancel",
|
|
6260
|
-
"choose",
|
|
6261
|
-
"visible",
|
|
6262
|
-
"className",
|
|
6263
|
-
"style"
|
|
6264
|
-
]);
|
|
6250
|
+
style,
|
|
6251
|
+
...rest
|
|
6252
|
+
} = { ...defaultProps$y, ...props };
|
|
6265
6253
|
const b2 = cn("actionsheet");
|
|
6266
6254
|
const isHighlight = (item) => {
|
|
6267
6255
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -6281,10 +6269,11 @@ const ActionSheet = (props) => {
|
|
|
6281
6269
|
onClose: () => {
|
|
6282
6270
|
cancel && cancel();
|
|
6283
6271
|
}
|
|
6284
|
-
}, /* @__PURE__ */ React__default.createElement("div",
|
|
6272
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
6285
6273
|
className: `${b2()} ${className}`,
|
|
6286
|
-
style
|
|
6287
|
-
|
|
6274
|
+
style,
|
|
6275
|
+
...rest
|
|
6276
|
+
}, title && /* @__PURE__ */ React__default.createElement("div", {
|
|
6288
6277
|
className: b2("title")
|
|
6289
6278
|
}, title), description && /* @__PURE__ */ React__default.createElement("div", {
|
|
6290
6279
|
className: `${b2("item")} desc`
|
|
@@ -6304,9 +6293,9 @@ const ActionSheet = (props) => {
|
|
|
6304
6293
|
onClick: () => cancelActionSheet()
|
|
6305
6294
|
}, cancelTxt)));
|
|
6306
6295
|
};
|
|
6307
|
-
ActionSheet.defaultProps = defaultProps$
|
|
6296
|
+
ActionSheet.defaultProps = defaultProps$y;
|
|
6308
6297
|
ActionSheet.displayName = "NutActionSheet";
|
|
6309
|
-
const defaultProps$
|
|
6298
|
+
const defaultProps$x = {
|
|
6310
6299
|
bottom: 20,
|
|
6311
6300
|
right: 10,
|
|
6312
6301
|
elId: "",
|
|
@@ -6328,11 +6317,14 @@ const BackTop = (props) => {
|
|
|
6328
6317
|
duration,
|
|
6329
6318
|
style,
|
|
6330
6319
|
backTopClick
|
|
6331
|
-
} =
|
|
6320
|
+
} = {
|
|
6321
|
+
...defaultProps$x,
|
|
6322
|
+
...props
|
|
6323
|
+
};
|
|
6332
6324
|
const [backTop, SetBackTop] = useState(false);
|
|
6333
6325
|
const [scrollTop, SetScrollTop] = useState(0);
|
|
6334
6326
|
let startTime = 0;
|
|
6335
|
-
|
|
6327
|
+
const scrollEl = useRef(null);
|
|
6336
6328
|
useEffect(() => {
|
|
6337
6329
|
init();
|
|
6338
6330
|
return () => removeEventListener();
|
|
@@ -6405,7 +6397,7 @@ const BackTop = (props) => {
|
|
|
6405
6397
|
};
|
|
6406
6398
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
6407
6399
|
className: `nut-backtop ${backTop ? "show" : ""} ${className || ""}`,
|
|
6408
|
-
style:
|
|
6400
|
+
style: { ...backTopClass, ...style },
|
|
6409
6401
|
onClick: goTop
|
|
6410
6402
|
}, children || /* @__PURE__ */ React__default.createElement(Icon, {
|
|
6411
6403
|
size: "19px",
|
|
@@ -6413,7 +6405,7 @@ const BackTop = (props) => {
|
|
|
6413
6405
|
name: "top"
|
|
6414
6406
|
}));
|
|
6415
6407
|
};
|
|
6416
|
-
BackTop.defaultProps = defaultProps$
|
|
6408
|
+
BackTop.defaultProps = defaultProps$x;
|
|
6417
6409
|
BackTop.displayName = "NutBackTop";
|
|
6418
6410
|
function clamp(v2, min, max) {
|
|
6419
6411
|
return Math.max(min, Math.min(v2, max));
|
|
@@ -6482,7 +6474,7 @@ function ownKeys(object, enumerableOnly) {
|
|
|
6482
6474
|
}
|
|
6483
6475
|
function _objectSpread2(target) {
|
|
6484
6476
|
for (var i = 1; i < arguments.length; i++) {
|
|
6485
|
-
var source = arguments[i]
|
|
6477
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
6486
6478
|
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
6487
6479
|
_defineProperty(target, key, source[key]);
|
|
6488
6480
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
@@ -8446,26 +8438,25 @@ function deprecateDirectCall() {
|
|
|
8446
8438
|
function isAnimatedString(value) {
|
|
8447
8439
|
return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
|
|
8448
8440
|
}
|
|
8449
|
-
const
|
|
8450
|
-
const
|
|
8441
|
+
const useLayoutEffect = typeof window !== "undefined" && window.document && window.document.createElement ? React.useLayoutEffect : React.useEffect;
|
|
8442
|
+
const useIsMounted = () => {
|
|
8443
|
+
const isMounted = useRef(false);
|
|
8444
|
+
useLayoutEffect(() => {
|
|
8445
|
+
isMounted.current = true;
|
|
8446
|
+
return () => {
|
|
8447
|
+
isMounted.current = false;
|
|
8448
|
+
};
|
|
8449
|
+
}, []);
|
|
8450
|
+
return isMounted;
|
|
8451
|
+
};
|
|
8451
8452
|
function useForceUpdate() {
|
|
8452
8453
|
const update2 = useState()[1];
|
|
8453
|
-
const
|
|
8454
|
-
useOnce(mounted.unmount);
|
|
8454
|
+
const isMounted = useIsMounted();
|
|
8455
8455
|
return () => {
|
|
8456
|
-
if (
|
|
8457
|
-
update2(
|
|
8458
|
-
}
|
|
8459
|
-
};
|
|
8460
|
-
}
|
|
8461
|
-
function makeMountedRef() {
|
|
8462
|
-
const mounted = {
|
|
8463
|
-
current: true,
|
|
8464
|
-
unmount: () => () => {
|
|
8465
|
-
mounted.current = false;
|
|
8456
|
+
if (isMounted.current) {
|
|
8457
|
+
update2(Math.random());
|
|
8466
8458
|
}
|
|
8467
8459
|
};
|
|
8468
|
-
return mounted;
|
|
8469
8460
|
}
|
|
8470
8461
|
function useMemoOne(getResult, inputs) {
|
|
8471
8462
|
const [initial] = useState(() => ({
|
|
@@ -8505,6 +8496,8 @@ function areInputsEqual(next, prev) {
|
|
|
8505
8496
|
}
|
|
8506
8497
|
return true;
|
|
8507
8498
|
}
|
|
8499
|
+
const useOnce = (effect) => useEffect(effect, emptyDeps);
|
|
8500
|
+
const emptyDeps = [];
|
|
8508
8501
|
function usePrev(value) {
|
|
8509
8502
|
const prevRef = useRef();
|
|
8510
8503
|
useEffect(() => {
|
|
@@ -8512,7 +8505,6 @@ function usePrev(value) {
|
|
|
8512
8505
|
});
|
|
8513
8506
|
return prevRef.current;
|
|
8514
8507
|
}
|
|
8515
|
-
const useLayoutEffect = typeof window !== "undefined" && window.document && window.document.createElement ? React.useLayoutEffect : React.useEffect;
|
|
8516
8508
|
const $node = Symbol.for("Animated:node");
|
|
8517
8509
|
const isAnimated = (value) => !!value && value[$node] === value;
|
|
8518
8510
|
const getAnimated = (owner) => owner && owner[$node];
|
|
@@ -8732,13 +8724,14 @@ const withAnimated = (Component2, host2) => {
|
|
|
8732
8724
|
const observer = new PropsObserver(callback, deps);
|
|
8733
8725
|
const observerRef = useRef();
|
|
8734
8726
|
useLayoutEffect(() => {
|
|
8735
|
-
const lastObserver = observerRef.current;
|
|
8736
8727
|
observerRef.current = observer;
|
|
8737
8728
|
each(deps, (dep) => addFluidObserver(dep, observer));
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8729
|
+
return () => {
|
|
8730
|
+
if (observerRef.current) {
|
|
8731
|
+
each(observerRef.current.deps, (dep) => removeFluidObserver(dep, observerRef.current));
|
|
8732
|
+
raf.cancel(observerRef.current.update);
|
|
8733
|
+
}
|
|
8734
|
+
};
|
|
8742
8735
|
});
|
|
8743
8736
|
useEffect(callback, []);
|
|
8744
8737
|
useOnce(() => () => {
|
|
@@ -10815,7 +10808,7 @@ const host = createHost(primitives, {
|
|
|
10815
10808
|
}
|
|
10816
10809
|
});
|
|
10817
10810
|
const animated = host.animated;
|
|
10818
|
-
const defaultProps$
|
|
10811
|
+
const defaultProps$w = {
|
|
10819
10812
|
attract: false,
|
|
10820
10813
|
direction: void 0,
|
|
10821
10814
|
boundary: {
|
|
@@ -10827,7 +10820,10 @@ const defaultProps$t = {
|
|
|
10827
10820
|
className: ""
|
|
10828
10821
|
};
|
|
10829
10822
|
const Drag = (props) => {
|
|
10830
|
-
const
|
|
10823
|
+
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
10824
|
+
...defaultProps$w,
|
|
10825
|
+
...props
|
|
10826
|
+
};
|
|
10831
10827
|
const b2 = cn("drag");
|
|
10832
10828
|
const [boundaryState, setBoundaryState] = useState(boundary);
|
|
10833
10829
|
const myDrag = useRef(null);
|
|
@@ -10874,19 +10870,28 @@ const Drag = (props) => {
|
|
|
10874
10870
|
useEffect(() => {
|
|
10875
10871
|
getInfo();
|
|
10876
10872
|
}, [myDrag]);
|
|
10877
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
10873
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
10878
10874
|
style,
|
|
10879
|
-
className: `${b2()} ${className}
|
|
10880
|
-
|
|
10875
|
+
className: `${b2()} ${className}`,
|
|
10876
|
+
...reset,
|
|
10881
10877
|
ref: myDrag
|
|
10882
|
-
}
|
|
10883
|
-
style: currstyle
|
|
10884
|
-
|
|
10878
|
+
}, /* @__PURE__ */ React__default.createElement(animated.div, {
|
|
10879
|
+
style: currstyle,
|
|
10880
|
+
...bind()
|
|
10881
|
+
}, children));
|
|
10885
10882
|
};
|
|
10886
|
-
Drag.defaultProps = defaultProps$
|
|
10883
|
+
Drag.defaultProps = defaultProps$w;
|
|
10887
10884
|
Drag.displayName = "NutDrag";
|
|
10888
10885
|
const Content = (props) => {
|
|
10889
|
-
const {
|
|
10886
|
+
const {
|
|
10887
|
+
visible,
|
|
10888
|
+
title,
|
|
10889
|
+
footer,
|
|
10890
|
+
textAlign,
|
|
10891
|
+
footerDirection,
|
|
10892
|
+
onClickSelf,
|
|
10893
|
+
children
|
|
10894
|
+
} = props;
|
|
10890
10895
|
let headerNode;
|
|
10891
10896
|
if (title) {
|
|
10892
10897
|
headerNode = /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -10896,11 +10901,17 @@ const Content = (props) => {
|
|
|
10896
10901
|
let footerNode;
|
|
10897
10902
|
if (footer) {
|
|
10898
10903
|
footerNode = /* @__PURE__ */ React__default.createElement("div", {
|
|
10899
|
-
className: classNames("nut-dialog__footer", {
|
|
10904
|
+
className: classNames("nut-dialog__footer", {
|
|
10905
|
+
[footerDirection]: footerDirection
|
|
10906
|
+
})
|
|
10900
10907
|
}, footer);
|
|
10901
10908
|
}
|
|
10909
|
+
const handleClick = () => {
|
|
10910
|
+
onClickSelf && onClickSelf();
|
|
10911
|
+
};
|
|
10902
10912
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
10903
|
-
className: "nut-dialog__outer"
|
|
10913
|
+
className: "nut-dialog__outer",
|
|
10914
|
+
onClick: handleClick
|
|
10904
10915
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
10905
10916
|
className: "nut-dialog",
|
|
10906
10917
|
style: { display: visible ? "flex" : "none" }
|
|
@@ -10916,7 +10927,16 @@ function Mask(props) {
|
|
|
10916
10927
|
});
|
|
10917
10928
|
}
|
|
10918
10929
|
const DialogWrap = (props) => {
|
|
10919
|
-
const {
|
|
10930
|
+
const {
|
|
10931
|
+
className,
|
|
10932
|
+
style,
|
|
10933
|
+
visible,
|
|
10934
|
+
mask,
|
|
10935
|
+
closeOnClickOverlay,
|
|
10936
|
+
lockScroll,
|
|
10937
|
+
onClosed,
|
|
10938
|
+
onCancel
|
|
10939
|
+
} = props;
|
|
10920
10940
|
const handleClick = (e2) => {
|
|
10921
10941
|
if (closeOnClickOverlay && visible && e2.target === e2.currentTarget) {
|
|
10922
10942
|
onClosed == null ? void 0 : onClosed();
|
|
@@ -10924,9 +10944,10 @@ const DialogWrap = (props) => {
|
|
|
10924
10944
|
lockScroll && document.body.classList.remove("nut-overflow-hidden");
|
|
10925
10945
|
}
|
|
10926
10946
|
};
|
|
10927
|
-
const wrapStyle =
|
|
10947
|
+
const wrapStyle = {
|
|
10948
|
+
...style,
|
|
10928
10949
|
display: visible ? "block" : "none"
|
|
10929
|
-
}
|
|
10950
|
+
};
|
|
10930
10951
|
if (lockScroll && visible) {
|
|
10931
10952
|
document.body.classList.add("nut-overflow-hidden");
|
|
10932
10953
|
}
|
|
@@ -10940,9 +10961,10 @@ const DialogWrap = (props) => {
|
|
|
10940
10961
|
className: classNames("nut-dialog__wrap", className),
|
|
10941
10962
|
onClick: handleClick,
|
|
10942
10963
|
style: wrapStyle
|
|
10943
|
-
}, /* @__PURE__ */ React__default.createElement(Content,
|
|
10964
|
+
}, /* @__PURE__ */ React__default.createElement(Content, {
|
|
10965
|
+
...props,
|
|
10944
10966
|
visible
|
|
10945
|
-
})))
|
|
10967
|
+
})));
|
|
10946
10968
|
};
|
|
10947
10969
|
DialogWrap.displayName = "NutDialogWrap";
|
|
10948
10970
|
const DialogWrapper = (props) => {
|
|
@@ -10952,11 +10974,15 @@ const DialogWrapper = (props) => {
|
|
|
10952
10974
|
}
|
|
10953
10975
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
10954
10976
|
style: { display: visible ? "block" : "none" }
|
|
10955
|
-
}, /* @__PURE__ */ React__default.createElement(DialogWrap,
|
|
10977
|
+
}, /* @__PURE__ */ React__default.createElement(DialogWrap, {
|
|
10978
|
+
...props
|
|
10979
|
+
}));
|
|
10956
10980
|
};
|
|
10957
10981
|
DialogWrapper.displayName = "NutDialogWrapper";
|
|
10958
10982
|
function ConfirmDialog(props) {
|
|
10959
|
-
return /* @__PURE__ */ React__default.createElement(Dialog,
|
|
10983
|
+
return /* @__PURE__ */ React__default.createElement(Dialog, {
|
|
10984
|
+
...props
|
|
10985
|
+
}, props.content);
|
|
10960
10986
|
}
|
|
10961
10987
|
const normalizeConfig = (_config) => {
|
|
10962
10988
|
if (_config.isNotice) {
|
|
@@ -10976,14 +11002,16 @@ function confirm(config2, renderFunc) {
|
|
|
10976
11002
|
const div = document.createElement("div");
|
|
10977
11003
|
document.body.appendChild(div);
|
|
10978
11004
|
function render(props) {
|
|
10979
|
-
ReactDOM__default.render(/* @__PURE__ */ React__default.createElement(ConfirmDialog,
|
|
11005
|
+
ReactDOM__default.render(/* @__PURE__ */ React__default.createElement(ConfirmDialog, {
|
|
11006
|
+
...props,
|
|
10980
11007
|
onCancel
|
|
10981
|
-
})
|
|
11008
|
+
}), div);
|
|
10982
11009
|
}
|
|
10983
11010
|
const renderFunction = renderFunc || render;
|
|
10984
|
-
let dialogConfig =
|
|
11011
|
+
let dialogConfig = {
|
|
11012
|
+
...config2,
|
|
10985
11013
|
visible: false
|
|
10986
|
-
}
|
|
11014
|
+
};
|
|
10987
11015
|
const onOk = () => {
|
|
10988
11016
|
let ret;
|
|
10989
11017
|
const _onOk = config2.onOk || config2.onConfirm;
|
|
@@ -11023,9 +11051,11 @@ function confirm(config2, renderFunc) {
|
|
|
11023
11051
|
renderFunction(dialogConfig);
|
|
11024
11052
|
}
|
|
11025
11053
|
function update2(newConfig) {
|
|
11026
|
-
dialogConfig =
|
|
11027
|
-
|
|
11028
|
-
|
|
11054
|
+
dialogConfig = {
|
|
11055
|
+
...dialogConfig,
|
|
11056
|
+
title: config2.title,
|
|
11057
|
+
...newConfig
|
|
11058
|
+
};
|
|
11029
11059
|
dialogConfig = normalizeConfig(dialogConfig);
|
|
11030
11060
|
renderFunction(dialogConfig);
|
|
11031
11061
|
}
|
|
@@ -11042,7 +11072,7 @@ function confirm(config2, renderFunc) {
|
|
|
11042
11072
|
update: update2
|
|
11043
11073
|
};
|
|
11044
11074
|
}
|
|
11045
|
-
const defaultProps$
|
|
11075
|
+
const defaultProps$v = {
|
|
11046
11076
|
okText: "",
|
|
11047
11077
|
cancelText: "",
|
|
11048
11078
|
mask: true,
|
|
@@ -11058,7 +11088,7 @@ const defaultProps$s = {
|
|
|
11058
11088
|
};
|
|
11059
11089
|
const BaseDialog = (props, ref) => {
|
|
11060
11090
|
const { locale } = useConfig();
|
|
11061
|
-
const
|
|
11091
|
+
const {
|
|
11062
11092
|
visible,
|
|
11063
11093
|
footer,
|
|
11064
11094
|
noOkBtn,
|
|
@@ -11070,25 +11100,14 @@ const BaseDialog = (props, ref) => {
|
|
|
11070
11100
|
cancelText,
|
|
11071
11101
|
onClosed,
|
|
11072
11102
|
onCancel,
|
|
11073
|
-
onOk
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
"noOkBtn",
|
|
11078
|
-
"noCancelBtn",
|
|
11079
|
-
"lockScroll",
|
|
11080
|
-
"okBtnDisabled",
|
|
11081
|
-
"cancelAutoClose",
|
|
11082
|
-
"okText",
|
|
11083
|
-
"cancelText",
|
|
11084
|
-
"onClosed",
|
|
11085
|
-
"onCancel",
|
|
11086
|
-
"onOk"
|
|
11087
|
-
]);
|
|
11088
|
-
const renderFooter = () => {
|
|
11103
|
+
onOk,
|
|
11104
|
+
...restProps
|
|
11105
|
+
} = props;
|
|
11106
|
+
const renderFooter = function() {
|
|
11089
11107
|
if (footer === null)
|
|
11090
|
-
return;
|
|
11091
|
-
const handleCancel = ()
|
|
11108
|
+
return "";
|
|
11109
|
+
const handleCancel = function(e2) {
|
|
11110
|
+
e2.stopPropagation();
|
|
11092
11111
|
if (!cancelAutoClose)
|
|
11093
11112
|
return;
|
|
11094
11113
|
onClosed == null ? void 0 : onClosed();
|
|
@@ -11097,7 +11116,8 @@ const BaseDialog = (props, ref) => {
|
|
|
11097
11116
|
document.body.classList.remove("nut-overflow-hidden");
|
|
11098
11117
|
}
|
|
11099
11118
|
};
|
|
11100
|
-
const handleOk = (e2)
|
|
11119
|
+
const handleOk = function(e2) {
|
|
11120
|
+
e2.stopPropagation();
|
|
11101
11121
|
onClosed == null ? void 0 : onClosed();
|
|
11102
11122
|
onOk == null ? void 0 : onOk(e2);
|
|
11103
11123
|
if (lockScroll && visible) {
|
|
@@ -11109,23 +11129,26 @@ const BaseDialog = (props, ref) => {
|
|
|
11109
11129
|
plain: true,
|
|
11110
11130
|
type: "primary",
|
|
11111
11131
|
className: "nut-dialog__footer-cancel",
|
|
11112
|
-
onClick: () => handleCancel()
|
|
11132
|
+
onClick: (e2) => handleCancel(e2)
|
|
11113
11133
|
}, cancelText || locale.cancel), !noOkBtn && /* @__PURE__ */ React__default.createElement(Button, {
|
|
11114
11134
|
size: "small",
|
|
11115
11135
|
type: "primary",
|
|
11116
|
-
className: classNames("nut-dialog__footer-ok", {
|
|
11136
|
+
className: classNames("nut-dialog__footer-ok", {
|
|
11137
|
+
disabled: okBtnDisabled
|
|
11138
|
+
}),
|
|
11117
11139
|
disabled: okBtnDisabled,
|
|
11118
|
-
onClick: () => handleOk()
|
|
11140
|
+
onClick: (e2) => handleOk(e2)
|
|
11119
11141
|
}, okText || locale.confirm));
|
|
11120
11142
|
return footerContent;
|
|
11121
11143
|
};
|
|
11122
|
-
return /* @__PURE__ */ React__default.createElement(DialogWrapper,
|
|
11144
|
+
return /* @__PURE__ */ React__default.createElement(DialogWrapper, {
|
|
11145
|
+
...restProps,
|
|
11123
11146
|
visible,
|
|
11124
11147
|
lockScroll,
|
|
11125
11148
|
footer: renderFooter(),
|
|
11126
11149
|
onClosed,
|
|
11127
11150
|
onCancel
|
|
11128
|
-
})
|
|
11151
|
+
});
|
|
11129
11152
|
};
|
|
11130
11153
|
const Dialog = forwardRef(BaseDialog);
|
|
11131
11154
|
Dialog.confirm = (props) => {
|
|
@@ -11133,15 +11156,16 @@ Dialog.confirm = (props) => {
|
|
|
11133
11156
|
};
|
|
11134
11157
|
["alert"].forEach((type) => {
|
|
11135
11158
|
Dialog[type] = (props) => {
|
|
11136
|
-
return confirm(
|
|
11159
|
+
return confirm({
|
|
11160
|
+
...props,
|
|
11137
11161
|
isNotice: false,
|
|
11138
11162
|
noticeType: type
|
|
11139
|
-
})
|
|
11163
|
+
});
|
|
11140
11164
|
};
|
|
11141
11165
|
});
|
|
11142
|
-
Dialog.defaultProps = defaultProps$
|
|
11166
|
+
Dialog.defaultProps = defaultProps$v;
|
|
11143
11167
|
Dialog.displayName = "NutDialog";
|
|
11144
|
-
const defaultProps$
|
|
11168
|
+
const defaultProps$u = {
|
|
11145
11169
|
hasMore: true,
|
|
11146
11170
|
threshold: 200,
|
|
11147
11171
|
containerId: "",
|
|
@@ -11156,7 +11180,7 @@ const defaultProps$r = {
|
|
|
11156
11180
|
};
|
|
11157
11181
|
const Infiniteloading = (props) => {
|
|
11158
11182
|
const { locale } = useConfig();
|
|
11159
|
-
const
|
|
11183
|
+
const {
|
|
11160
11184
|
children,
|
|
11161
11185
|
hasMore,
|
|
11162
11186
|
threshold,
|
|
@@ -11172,25 +11196,12 @@ const Infiniteloading = (props) => {
|
|
|
11172
11196
|
className,
|
|
11173
11197
|
refresh,
|
|
11174
11198
|
loadMore,
|
|
11175
|
-
scrollChange
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
"useWindow",
|
|
11182
|
-
"useCapture",
|
|
11183
|
-
"isOpenRefresh",
|
|
11184
|
-
"pullIcon",
|
|
11185
|
-
"pullTxt",
|
|
11186
|
-
"loadIcon",
|
|
11187
|
-
"loadTxt",
|
|
11188
|
-
"loadMoreTxt",
|
|
11189
|
-
"className",
|
|
11190
|
-
"refresh",
|
|
11191
|
-
"loadMore",
|
|
11192
|
-
"scrollChange"
|
|
11193
|
-
]);
|
|
11199
|
+
scrollChange,
|
|
11200
|
+
...restProps
|
|
11201
|
+
} = {
|
|
11202
|
+
...defaultProps$u,
|
|
11203
|
+
...props
|
|
11204
|
+
};
|
|
11194
11205
|
const [isInfiniting, setIsInfiniting] = useState(false);
|
|
11195
11206
|
const scroller = useRef(null);
|
|
11196
11207
|
const refreshTop = useRef(null);
|
|
@@ -11312,13 +11323,14 @@ const Infiniteloading = (props) => {
|
|
|
11312
11323
|
scrollChange && scrollChange(resScrollTop);
|
|
11313
11324
|
return offsetDistance <= threshold && direction == "down";
|
|
11314
11325
|
};
|
|
11315
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
11326
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
11316
11327
|
className: classes,
|
|
11317
11328
|
ref: scroller,
|
|
11318
11329
|
onTouchStart: touchStart,
|
|
11319
11330
|
onTouchMove: touchMove,
|
|
11320
|
-
onTouchEnd: touchEnd
|
|
11321
|
-
|
|
11331
|
+
onTouchEnd: touchEnd,
|
|
11332
|
+
...restProps
|
|
11333
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
11322
11334
|
className: "nut-infinite-top",
|
|
11323
11335
|
ref: refreshTop,
|
|
11324
11336
|
style: getStyle()
|
|
@@ -11344,12 +11356,11 @@ const Infiniteloading = (props) => {
|
|
|
11344
11356
|
className: "tips"
|
|
11345
11357
|
}, locale.infiniteloading.loadMoreText || loadMoreTxt)));
|
|
11346
11358
|
};
|
|
11347
|
-
Infiniteloading.defaultProps = defaultProps$
|
|
11359
|
+
Infiniteloading.defaultProps = defaultProps$u;
|
|
11348
11360
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
11349
11361
|
class Notification extends React.PureComponent {
|
|
11350
11362
|
constructor(props) {
|
|
11351
11363
|
super(props);
|
|
11352
|
-
__publicField(this, "closeTimer");
|
|
11353
11364
|
this.close = this.close.bind(this);
|
|
11354
11365
|
this.startCloseTimer = this.startCloseTimer.bind(this);
|
|
11355
11366
|
this.clearCloseTimer = this.clearCloseTimer.bind(this);
|
|
@@ -11409,12 +11420,14 @@ class Notification extends React.PureComponent {
|
|
|
11409
11420
|
appear: true
|
|
11410
11421
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
11411
11422
|
className: `${classes} ${className}`,
|
|
11412
|
-
style: {
|
|
11423
|
+
style: {
|
|
11424
|
+
color: `${color || ""}`,
|
|
11425
|
+
background: `${background || ""}`
|
|
11426
|
+
},
|
|
11413
11427
|
onClick: this.clickCover
|
|
11414
11428
|
}, children || msg)));
|
|
11415
11429
|
}
|
|
11416
11430
|
}
|
|
11417
|
-
__publicField(Notification, "newInstance");
|
|
11418
11431
|
Notification.newInstance = (properties, callback) => {
|
|
11419
11432
|
const element = document.createElement("div");
|
|
11420
11433
|
const id = properties.id ? properties.id : `${new Date().getTime()}`;
|
|
@@ -11437,9 +11450,10 @@ Notification.newInstance = (properties, callback) => {
|
|
|
11437
11450
|
}
|
|
11438
11451
|
});
|
|
11439
11452
|
}
|
|
11440
|
-
ReactDOM.render(/* @__PURE__ */ React.createElement(Notification,
|
|
11453
|
+
ReactDOM.render(/* @__PURE__ */ React.createElement(Notification, {
|
|
11454
|
+
...properties,
|
|
11441
11455
|
ref
|
|
11442
|
-
})
|
|
11456
|
+
}), element);
|
|
11443
11457
|
};
|
|
11444
11458
|
let messageInstance = null;
|
|
11445
11459
|
const options = {
|
|
@@ -11463,7 +11477,7 @@ function getInstance(props, callback) {
|
|
|
11463
11477
|
});
|
|
11464
11478
|
}
|
|
11465
11479
|
function notice(opts) {
|
|
11466
|
-
opts =
|
|
11480
|
+
opts = { ...options, ...opts };
|
|
11467
11481
|
getInstance(opts, (notification) => {
|
|
11468
11482
|
messageInstance = notification;
|
|
11469
11483
|
});
|
|
@@ -11476,23 +11490,23 @@ const errorMsg = (msg) => {
|
|
|
11476
11490
|
var Notify = {
|
|
11477
11491
|
text(msg, option = {}) {
|
|
11478
11492
|
errorMsg(msg);
|
|
11479
|
-
return notice(
|
|
11493
|
+
return notice({ msg, type: "base", ...option });
|
|
11480
11494
|
},
|
|
11481
11495
|
success(msg, option = {}) {
|
|
11482
11496
|
errorMsg(msg);
|
|
11483
|
-
return notice(
|
|
11497
|
+
return notice({ msg, type: "success", ...option });
|
|
11484
11498
|
},
|
|
11485
11499
|
primary(msg, option = {}) {
|
|
11486
11500
|
errorMsg(msg);
|
|
11487
|
-
return notice(
|
|
11501
|
+
return notice({ msg, type: "primary", ...option });
|
|
11488
11502
|
},
|
|
11489
11503
|
danger(msg, option = {}) {
|
|
11490
11504
|
errorMsg(msg);
|
|
11491
|
-
return notice(
|
|
11505
|
+
return notice({ msg, type: "danger", ...option });
|
|
11492
11506
|
},
|
|
11493
11507
|
warn(msg, option = {}) {
|
|
11494
11508
|
errorMsg(msg);
|
|
11495
|
-
return notice(
|
|
11509
|
+
return notice({ msg, type: "warning", ...option });
|
|
11496
11510
|
},
|
|
11497
11511
|
hide() {
|
|
11498
11512
|
if (messageInstance) {
|
|
@@ -11501,7 +11515,7 @@ var Notify = {
|
|
|
11501
11515
|
}
|
|
11502
11516
|
}
|
|
11503
11517
|
};
|
|
11504
|
-
const defaultProps$
|
|
11518
|
+
const defaultProps$t = {
|
|
11505
11519
|
isAsync: false,
|
|
11506
11520
|
checked: false,
|
|
11507
11521
|
disable: false,
|
|
@@ -11523,7 +11537,10 @@ const Switch = (props) => {
|
|
|
11523
11537
|
change,
|
|
11524
11538
|
className,
|
|
11525
11539
|
style
|
|
11526
|
-
} =
|
|
11540
|
+
} = {
|
|
11541
|
+
...defaultProps$t,
|
|
11542
|
+
...props
|
|
11543
|
+
};
|
|
11527
11544
|
const [value, setValue] = useState(false);
|
|
11528
11545
|
const b2 = cn("switch");
|
|
11529
11546
|
useEffect(() => {
|
|
@@ -11533,9 +11550,10 @@ const Switch = (props) => {
|
|
|
11533
11550
|
return `${b2()} ${value ? "switch-open" : "switch-close"} ${disable ? `${b2()}-disable` : ""} ${`${b2()}-base`} ${className}`;
|
|
11534
11551
|
};
|
|
11535
11552
|
const styles = () => {
|
|
11536
|
-
const myStyle =
|
|
11537
|
-
backgroundColor: value ? activeColor : inactiveColor
|
|
11538
|
-
|
|
11553
|
+
const myStyle = {
|
|
11554
|
+
backgroundColor: value ? activeColor : inactiveColor,
|
|
11555
|
+
...style || {}
|
|
11556
|
+
};
|
|
11539
11557
|
return myStyle;
|
|
11540
11558
|
};
|
|
11541
11559
|
const onClick = (event) => {
|
|
@@ -11560,10 +11578,10 @@ const Switch = (props) => {
|
|
|
11560
11578
|
className: `${b2("label")} close`
|
|
11561
11579
|
}, inactiveText))));
|
|
11562
11580
|
};
|
|
11563
|
-
Switch.defaultProps = defaultProps$
|
|
11581
|
+
Switch.defaultProps = defaultProps$t;
|
|
11564
11582
|
Switch.displayName = "NutSwitch";
|
|
11565
11583
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
11566
|
-
const defaultProps$
|
|
11584
|
+
const defaultProps$s = {
|
|
11567
11585
|
strokeWidth: 5,
|
|
11568
11586
|
radius: 50,
|
|
11569
11587
|
strokeLinecap: "round",
|
|
@@ -11572,8 +11590,8 @@ const defaultProps$p = {
|
|
|
11572
11590
|
clockwise: true
|
|
11573
11591
|
};
|
|
11574
11592
|
const CircleProgress = (props) => {
|
|
11575
|
-
var
|
|
11576
|
-
const
|
|
11593
|
+
var _a;
|
|
11594
|
+
const {
|
|
11577
11595
|
children,
|
|
11578
11596
|
progress,
|
|
11579
11597
|
className,
|
|
@@ -11583,32 +11601,26 @@ const CircleProgress = (props) => {
|
|
|
11583
11601
|
circleColor,
|
|
11584
11602
|
strokeWidth,
|
|
11585
11603
|
style,
|
|
11586
|
-
strokeLinecap
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
"pathColor",
|
|
11593
|
-
"clockwise",
|
|
11594
|
-
"circleColor",
|
|
11595
|
-
"strokeWidth",
|
|
11596
|
-
"style",
|
|
11597
|
-
"strokeLinecap"
|
|
11598
|
-
]);
|
|
11604
|
+
strokeLinecap,
|
|
11605
|
+
...restProps
|
|
11606
|
+
} = {
|
|
11607
|
+
...defaultProps$s,
|
|
11608
|
+
...props
|
|
11609
|
+
};
|
|
11599
11610
|
const b2 = cn("circleprogress");
|
|
11600
11611
|
const classes = classNames(className, b2(""));
|
|
11601
11612
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
11602
|
-
const styles =
|
|
11613
|
+
const styles = {
|
|
11603
11614
|
height: `${Number(radius) * 2}px`,
|
|
11604
|
-
width: `${Number(radius) * 2}px
|
|
11605
|
-
|
|
11615
|
+
width: `${Number(radius) * 2}px`,
|
|
11616
|
+
...style
|
|
11617
|
+
};
|
|
11606
11618
|
const pathStyle = {
|
|
11607
11619
|
stroke: pathColor
|
|
11608
11620
|
};
|
|
11609
11621
|
const hoverStyle = () => {
|
|
11610
|
-
|
|
11611
|
-
|
|
11622
|
+
const perimeter = 283;
|
|
11623
|
+
const offset = perimeter * Number(progress) / 100;
|
|
11612
11624
|
return {
|
|
11613
11625
|
stroke: isObject(circleColor) ? `url(#${refRandomId})` : circleColor,
|
|
11614
11626
|
strokeDasharray: `${offset}px ${perimeter}px`
|
|
@@ -11625,11 +11637,11 @@ const CircleProgress = (props) => {
|
|
|
11625
11637
|
if (!isObject(circleColor)) {
|
|
11626
11638
|
return;
|
|
11627
11639
|
}
|
|
11628
|
-
|
|
11640
|
+
const color = circleColor;
|
|
11629
11641
|
const colorArr = Object.keys(color).sort((a, b22) => parseFloat(a) - parseFloat(b22));
|
|
11630
|
-
|
|
11642
|
+
const stopArr = [];
|
|
11631
11643
|
colorArr.map((item) => {
|
|
11632
|
-
|
|
11644
|
+
const obj = {
|
|
11633
11645
|
key: "",
|
|
11634
11646
|
value: ""
|
|
11635
11647
|
};
|
|
@@ -11639,10 +11651,11 @@ const CircleProgress = (props) => {
|
|
|
11639
11651
|
});
|
|
11640
11652
|
return stopArr;
|
|
11641
11653
|
};
|
|
11642
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
11654
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
11643
11655
|
className: classes,
|
|
11644
|
-
style: styles
|
|
11645
|
-
|
|
11656
|
+
style: styles,
|
|
11657
|
+
...restProps
|
|
11658
|
+
}, /* @__PURE__ */ React__default.createElement("svg", {
|
|
11646
11659
|
viewBox: "0 0 100 100"
|
|
11647
11660
|
}, /* @__PURE__ */ React__default.createElement("defs", null, /* @__PURE__ */ React__default.createElement("linearGradient", {
|
|
11648
11661
|
id: refRandomId,
|
|
@@ -11650,7 +11663,7 @@ const CircleProgress = (props) => {
|
|
|
11650
11663
|
y1: "0%",
|
|
11651
11664
|
x2: "0%",
|
|
11652
11665
|
y2: "0%"
|
|
11653
|
-
}, (
|
|
11666
|
+
}, (_a = stop2()) == null ? void 0 : _a.map((item, index2) => {
|
|
11654
11667
|
return /* @__PURE__ */ React__default.createElement("stop", {
|
|
11655
11668
|
key: index2,
|
|
11656
11669
|
offset: item.key,
|
|
@@ -11673,11 +11686,11 @@ const CircleProgress = (props) => {
|
|
|
11673
11686
|
strokeWidth
|
|
11674
11687
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
11675
11688
|
className: "nut-circleprogress-text"
|
|
11676
|
-
}, children
|
|
11689
|
+
}, children || /* @__PURE__ */ React__default.createElement("div", null, progress, "%")));
|
|
11677
11690
|
};
|
|
11678
|
-
CircleProgress.defaultProps = defaultProps$
|
|
11691
|
+
CircleProgress.defaultProps = defaultProps$s;
|
|
11679
11692
|
CircleProgress.displayName = "NutCircleProgress";
|
|
11680
|
-
const defaultProps$
|
|
11693
|
+
const defaultProps$r = {
|
|
11681
11694
|
direction: "across",
|
|
11682
11695
|
list: [],
|
|
11683
11696
|
standTime: 1e3,
|
|
@@ -11715,7 +11728,7 @@ const NoticeBar = (props) => {
|
|
|
11715
11728
|
rightIcon,
|
|
11716
11729
|
close,
|
|
11717
11730
|
click
|
|
11718
|
-
} =
|
|
11731
|
+
} = { ...defaultProps$r, ...props };
|
|
11719
11732
|
const wrap = useRef(null);
|
|
11720
11733
|
const content = useRef(null);
|
|
11721
11734
|
const [showNoticeBar, SetShowNoticeBar] = useState(true);
|
|
@@ -11744,7 +11757,7 @@ const NoticeBar = (props) => {
|
|
|
11744
11757
|
complexAm ? startRoll() : startRollEasy();
|
|
11745
11758
|
}, Number(standTime));
|
|
11746
11759
|
} else {
|
|
11747
|
-
initScrollWrap(
|
|
11760
|
+
initScrollWrap();
|
|
11748
11761
|
}
|
|
11749
11762
|
return () => {
|
|
11750
11763
|
clearInterval(timer);
|
|
@@ -11763,7 +11776,7 @@ const NoticeBar = (props) => {
|
|
|
11763
11776
|
});
|
|
11764
11777
|
};
|
|
11765
11778
|
useEffect(() => {
|
|
11766
|
-
initScrollWrap(
|
|
11779
|
+
initScrollWrap();
|
|
11767
11780
|
}, [text]);
|
|
11768
11781
|
useEffect(() => {
|
|
11769
11782
|
if (list && list.length) {
|
|
@@ -11928,17 +11941,25 @@ const NoticeBar = (props) => {
|
|
|
11928
11941
|
size: "11px"
|
|
11929
11942
|
}) : null))) : null);
|
|
11930
11943
|
};
|
|
11931
|
-
NoticeBar.defaultProps = defaultProps$
|
|
11944
|
+
NoticeBar.defaultProps = defaultProps$r;
|
|
11932
11945
|
NoticeBar.displayName = "NutNoticeBar";
|
|
11933
11946
|
const DataContext$1 = createContext({});
|
|
11934
|
-
const defaultProps$
|
|
11947
|
+
const defaultProps$q = {
|
|
11935
11948
|
current: 0,
|
|
11936
11949
|
direction: "horizontal",
|
|
11937
11950
|
progressDot: false
|
|
11938
11951
|
};
|
|
11939
11952
|
const Steps = (props) => {
|
|
11940
|
-
const propSteps =
|
|
11941
|
-
const
|
|
11953
|
+
const propSteps = { ...defaultProps$q, ...props };
|
|
11954
|
+
const {
|
|
11955
|
+
children,
|
|
11956
|
+
current,
|
|
11957
|
+
direction,
|
|
11958
|
+
className,
|
|
11959
|
+
progressDot,
|
|
11960
|
+
clickStep,
|
|
11961
|
+
...restProps
|
|
11962
|
+
} = propSteps;
|
|
11942
11963
|
const parentSteps = {
|
|
11943
11964
|
propSteps
|
|
11944
11965
|
};
|
|
@@ -11949,13 +11970,14 @@ const Steps = (props) => {
|
|
|
11949
11970
|
}, className, b2(""));
|
|
11950
11971
|
return /* @__PURE__ */ React__default.createElement(DataContext$1.Provider, {
|
|
11951
11972
|
value: parentSteps
|
|
11952
|
-
}, React__default.createElement("div",
|
|
11953
|
-
className: classes
|
|
11954
|
-
|
|
11973
|
+
}, React__default.createElement("div", {
|
|
11974
|
+
className: classes,
|
|
11975
|
+
...restProps
|
|
11976
|
+
}, children));
|
|
11955
11977
|
};
|
|
11956
|
-
Steps.defaultProps = defaultProps$
|
|
11978
|
+
Steps.defaultProps = defaultProps$q;
|
|
11957
11979
|
Steps.displayName = "NutSteps";
|
|
11958
|
-
const defaultProps$
|
|
11980
|
+
const defaultProps$p = {
|
|
11959
11981
|
title: "",
|
|
11960
11982
|
content: "",
|
|
11961
11983
|
activeIndex: 0,
|
|
@@ -11964,7 +11986,7 @@ const defaultProps$m = {
|
|
|
11964
11986
|
size: "12px"
|
|
11965
11987
|
};
|
|
11966
11988
|
const Step = (props) => {
|
|
11967
|
-
const
|
|
11989
|
+
const {
|
|
11968
11990
|
children,
|
|
11969
11991
|
title,
|
|
11970
11992
|
content,
|
|
@@ -11973,18 +11995,12 @@ const Step = (props) => {
|
|
|
11973
11995
|
iconColor,
|
|
11974
11996
|
size,
|
|
11975
11997
|
className,
|
|
11976
|
-
renderContent
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
"icon",
|
|
11983
|
-
"iconColor",
|
|
11984
|
-
"size",
|
|
11985
|
-
"className",
|
|
11986
|
-
"renderContent"
|
|
11987
|
-
]);
|
|
11998
|
+
renderContent,
|
|
11999
|
+
...restProps
|
|
12000
|
+
} = {
|
|
12001
|
+
...defaultProps$p,
|
|
12002
|
+
...props
|
|
12003
|
+
};
|
|
11988
12004
|
const parent = useContext$1(DataContext$1);
|
|
11989
12005
|
const dot = parent.propSteps.progressDot;
|
|
11990
12006
|
const getCurrentStatus = () => {
|
|
@@ -11994,18 +12010,18 @@ const Step = (props) => {
|
|
|
11994
12010
|
return index2 === +parent.propSteps.current ? "process" : "wait";
|
|
11995
12011
|
};
|
|
11996
12012
|
const handleClickStep = () => {
|
|
11997
|
-
var
|
|
11998
|
-
(
|
|
12013
|
+
var _a;
|
|
12014
|
+
(_a = parent.propSteps) == null ? void 0 : _a.clickStep(activeIndex);
|
|
11999
12015
|
};
|
|
12000
12016
|
const b2 = cn("step");
|
|
12001
12017
|
const classes = classNames({
|
|
12002
12018
|
[`${b2("")}-${getCurrentStatus()}`]: true
|
|
12003
12019
|
}, className, b2(""));
|
|
12004
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
12005
|
-
className: classes
|
|
12006
|
-
|
|
12020
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
12021
|
+
className: classes,
|
|
12022
|
+
...restProps,
|
|
12007
12023
|
onClick: handleClickStep
|
|
12008
|
-
}
|
|
12024
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12009
12025
|
className: "nut-step-head"
|
|
12010
12026
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12011
12027
|
className: "nut-step-line"
|
|
@@ -12028,10 +12044,10 @@ const Step = (props) => {
|
|
|
12028
12044
|
className: "nut-step-content"
|
|
12029
12045
|
}, renderContent())));
|
|
12030
12046
|
};
|
|
12031
|
-
Step.defaultProps = defaultProps$
|
|
12047
|
+
Step.defaultProps = defaultProps$p;
|
|
12032
12048
|
Step.displayName = "NutStep";
|
|
12033
12049
|
const DataContext = createContext({});
|
|
12034
|
-
const defaultProps$
|
|
12050
|
+
const defaultProps$o = {
|
|
12035
12051
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
12036
12052
|
height: 0,
|
|
12037
12053
|
duration: 500,
|
|
@@ -12048,8 +12064,8 @@ const defaultProps$l = {
|
|
|
12048
12064
|
};
|
|
12049
12065
|
const DISTANCE = 5;
|
|
12050
12066
|
const Swiper = React__default.forwardRef((props, ref) => {
|
|
12051
|
-
const propSwiper =
|
|
12052
|
-
const
|
|
12067
|
+
const propSwiper = { ...defaultProps$o, ...props };
|
|
12068
|
+
const {
|
|
12053
12069
|
children,
|
|
12054
12070
|
direction,
|
|
12055
12071
|
className,
|
|
@@ -12061,21 +12077,9 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
12061
12077
|
touchable,
|
|
12062
12078
|
isPreventDefault,
|
|
12063
12079
|
isStopPropagation,
|
|
12064
|
-
autoPlay
|
|
12065
|
-
|
|
12066
|
-
|
|
12067
|
-
"direction",
|
|
12068
|
-
"className",
|
|
12069
|
-
"pageContent",
|
|
12070
|
-
"onChange",
|
|
12071
|
-
"initPage",
|
|
12072
|
-
"paginationColor",
|
|
12073
|
-
"paginationVisible",
|
|
12074
|
-
"touchable",
|
|
12075
|
-
"isPreventDefault",
|
|
12076
|
-
"isStopPropagation",
|
|
12077
|
-
"autoPlay"
|
|
12078
|
-
]);
|
|
12080
|
+
autoPlay,
|
|
12081
|
+
...rest
|
|
12082
|
+
} = propSwiper;
|
|
12079
12083
|
const container = useRef(null);
|
|
12080
12084
|
const innerRef = useRef(null);
|
|
12081
12085
|
const _swiper = useRef({
|
|
@@ -12198,7 +12202,12 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
12198
12202
|
});
|
|
12199
12203
|
});
|
|
12200
12204
|
};
|
|
12201
|
-
const move = ({
|
|
12205
|
+
const move = ({
|
|
12206
|
+
pace = 0,
|
|
12207
|
+
offset: offset2 = 0,
|
|
12208
|
+
isEmit = false,
|
|
12209
|
+
movingStatus = false
|
|
12210
|
+
}) => {
|
|
12202
12211
|
if (childCount <= 1)
|
|
12203
12212
|
return;
|
|
12204
12213
|
const targetActive = getActive(pace);
|
|
@@ -12404,7 +12413,7 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
12404
12413
|
if (_size) {
|
|
12405
12414
|
style2[_direction === "horizontal" ? "width" : "height"] = `${_size}px`;
|
|
12406
12415
|
}
|
|
12407
|
-
|
|
12416
|
+
const offset2 = childOffset[index2];
|
|
12408
12417
|
if (offset2) {
|
|
12409
12418
|
style2.transform = `translate3D${_direction === "horizontal" ? `(${offset2}px,0,0)` : `(0,${offset2}px,0)`}`;
|
|
12410
12419
|
}
|
|
@@ -12417,10 +12426,11 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
12417
12426
|
}));
|
|
12418
12427
|
return /* @__PURE__ */ React__default.createElement(DataContext.Provider, {
|
|
12419
12428
|
value: parent
|
|
12420
|
-
}, /* @__PURE__ */ React__default.createElement("div",
|
|
12429
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12421
12430
|
className: `${classes} ${className}`,
|
|
12422
|
-
ref: container
|
|
12423
|
-
|
|
12431
|
+
ref: container,
|
|
12432
|
+
...rest
|
|
12433
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12424
12434
|
className: contentClass,
|
|
12425
12435
|
ref: innerRef
|
|
12426
12436
|
}, React__default.Children.map(childs, (child, index2) => {
|
|
@@ -12443,13 +12453,13 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
12443
12453
|
});
|
|
12444
12454
|
})) : /* @__PURE__ */ React__default.createElement("div", null, pageContent)));
|
|
12445
12455
|
});
|
|
12446
|
-
Swiper.defaultProps = defaultProps$
|
|
12456
|
+
Swiper.defaultProps = defaultProps$o;
|
|
12447
12457
|
Swiper.displayName = "NutSwiper";
|
|
12448
|
-
const defaultProps$
|
|
12458
|
+
const defaultProps$n = {
|
|
12449
12459
|
direction: "horizontal"
|
|
12450
12460
|
};
|
|
12451
12461
|
const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
12452
|
-
const _props =
|
|
12462
|
+
const _props = { ...defaultProps$n, ...props };
|
|
12453
12463
|
const { children, direction, size } = _props;
|
|
12454
12464
|
const parent = useContext$1(DataContext);
|
|
12455
12465
|
const [offset, setOffset] = useState(0);
|
|
@@ -12474,10 +12484,10 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
|
12474
12484
|
style: style()
|
|
12475
12485
|
}, children);
|
|
12476
12486
|
});
|
|
12477
|
-
SwiperItem.defaultProps = defaultProps$
|
|
12487
|
+
SwiperItem.defaultProps = defaultProps$n;
|
|
12478
12488
|
SwiperItem.displayName = "NutSwiperItem";
|
|
12479
12489
|
const AvatarContext = createContext({});
|
|
12480
|
-
const defaultProps$
|
|
12490
|
+
const defaultProps$m = {
|
|
12481
12491
|
size: "",
|
|
12482
12492
|
icon: "",
|
|
12483
12493
|
bgColor: "#eee",
|
|
@@ -12487,8 +12497,8 @@ const defaultProps$j = {
|
|
|
12487
12497
|
alt: ""
|
|
12488
12498
|
};
|
|
12489
12499
|
const Avatar = (props) => {
|
|
12490
|
-
var _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n
|
|
12491
|
-
const
|
|
12500
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
12501
|
+
const {
|
|
12492
12502
|
children,
|
|
12493
12503
|
prefixCls,
|
|
12494
12504
|
size,
|
|
@@ -12501,22 +12511,12 @@ const Avatar = (props) => {
|
|
|
12501
12511
|
className,
|
|
12502
12512
|
style,
|
|
12503
12513
|
activeAvatar,
|
|
12504
|
-
onError
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
"bgColor",
|
|
12511
|
-
"color",
|
|
12512
|
-
"url",
|
|
12513
|
-
"alt",
|
|
12514
|
-
"icon",
|
|
12515
|
-
"className",
|
|
12516
|
-
"style",
|
|
12517
|
-
"activeAvatar",
|
|
12518
|
-
"onError"
|
|
12519
|
-
]);
|
|
12514
|
+
onError,
|
|
12515
|
+
...rest
|
|
12516
|
+
} = {
|
|
12517
|
+
...defaultProps$m,
|
|
12518
|
+
...props
|
|
12519
|
+
};
|
|
12520
12520
|
const [maxSum, setMaxSum] = useState(0);
|
|
12521
12521
|
const [showMax, setShowMax] = useState(false);
|
|
12522
12522
|
const [avatarIndex, setAvatarIndex] = useState(1);
|
|
@@ -12524,24 +12524,25 @@ const Avatar = (props) => {
|
|
|
12524
12524
|
const parent = useContext$1(AvatarContext);
|
|
12525
12525
|
const b2 = cn("avatar");
|
|
12526
12526
|
const classes = classNames({
|
|
12527
|
-
[`nut-avatar-${size || ((
|
|
12528
|
-
[`nut-avatar-${shape || ((
|
|
12527
|
+
[`nut-avatar-${size || ((_a = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _a.size) || "normal"}`]: true,
|
|
12528
|
+
[`nut-avatar-${shape || ((_b = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _b.shape) || "round"}`]: true
|
|
12529
12529
|
});
|
|
12530
12530
|
const cls = classNames(b2(""), classes, className);
|
|
12531
12531
|
const sizeValue = ["large", "normal", "small"];
|
|
12532
|
-
const styles =
|
|
12532
|
+
const styles = {
|
|
12533
12533
|
width: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
12534
12534
|
height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`,
|
|
12535
12535
|
backgroundColor: `${bgColor}`,
|
|
12536
12536
|
color: `${color}`,
|
|
12537
|
-
marginLeft: avatarIndex != 1 && ((
|
|
12538
|
-
zIndex: ((
|
|
12539
|
-
|
|
12537
|
+
marginLeft: avatarIndex != 1 && ((_c = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c.span) ? `${(_d = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _d.span}px` : "",
|
|
12538
|
+
zIndex: ((_e = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _e.zIndex) == "right" ? `${Math.abs(maxSum - avatarIndex)}` : "",
|
|
12539
|
+
...style
|
|
12540
|
+
};
|
|
12540
12541
|
const maxStyles = {
|
|
12541
|
-
backgroundColor: `${(
|
|
12542
|
-
color: `${(
|
|
12542
|
+
backgroundColor: `${(_f = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _f.maxBgColor}`,
|
|
12543
|
+
color: `${(_g = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _g.maxColor}`
|
|
12543
12544
|
};
|
|
12544
|
-
const iconStyles =
|
|
12545
|
+
const iconStyles = icon || "";
|
|
12545
12546
|
useEffect(() => {
|
|
12546
12547
|
var _a2;
|
|
12547
12548
|
const avatarChildren = (_a2 = parent == null ? void 0 : parent.avatarGroupRef) == null ? void 0 : _a2.current.children;
|
|
@@ -12574,13 +12575,13 @@ const Avatar = (props) => {
|
|
|
12574
12575
|
props.activeAvatar(e2);
|
|
12575
12576
|
}
|
|
12576
12577
|
};
|
|
12577
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, (showMax || !((
|
|
12578
|
-
className: cls
|
|
12579
|
-
|
|
12578
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, (showMax || !((_h = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _h.maxCount) || avatarIndex <= ((_i = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _i.maxCount)) && /* @__PURE__ */ React__default.createElement("div", {
|
|
12579
|
+
className: cls,
|
|
12580
|
+
...rest,
|
|
12580
12581
|
style: !showMax ? styles : maxStyles,
|
|
12581
12582
|
onClick: clickAvatar,
|
|
12582
12583
|
ref: avatarRef
|
|
12583
|
-
}
|
|
12584
|
+
}, (!((_j = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _j.maxCount) || avatarIndex <= ((_k = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _k.maxCount)) && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, url && /* @__PURE__ */ React__default.createElement("img", {
|
|
12584
12585
|
src: url,
|
|
12585
12586
|
alt,
|
|
12586
12587
|
onError: errorEvent
|
|
@@ -12591,11 +12592,11 @@ const Avatar = (props) => {
|
|
|
12591
12592
|
className: "text"
|
|
12592
12593
|
}, children)), showMax && /* @__PURE__ */ React__default.createElement("div", {
|
|
12593
12594
|
className: "text"
|
|
12594
|
-
}, ((
|
|
12595
|
+
}, ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxCount)}`)));
|
|
12595
12596
|
};
|
|
12596
|
-
Avatar.defaultProps = defaultProps$
|
|
12597
|
+
Avatar.defaultProps = defaultProps$m;
|
|
12597
12598
|
Avatar.displayName = "NutAvatar";
|
|
12598
|
-
const defaultProps$
|
|
12599
|
+
const defaultProps$l = {
|
|
12599
12600
|
maxContent: "",
|
|
12600
12601
|
maxCount: "",
|
|
12601
12602
|
maxBgColor: "#eee",
|
|
@@ -12607,7 +12608,7 @@ const defaultProps$i = {
|
|
|
12607
12608
|
};
|
|
12608
12609
|
const AvatarGroup = (props) => {
|
|
12609
12610
|
useConfig();
|
|
12610
|
-
const propAvatarGroup =
|
|
12611
|
+
const propAvatarGroup = { ...defaultProps$l, ...props };
|
|
12611
12612
|
const { className, style, children } = propAvatarGroup;
|
|
12612
12613
|
const avatarGroupRef = useRef(null);
|
|
12613
12614
|
const b2 = cn("avatar-group");
|
|
@@ -12624,9 +12625,9 @@ const AvatarGroup = (props) => {
|
|
|
12624
12625
|
ref: avatarGroupRef
|
|
12625
12626
|
}, children));
|
|
12626
12627
|
};
|
|
12627
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
12628
|
+
AvatarGroup.defaultProps = defaultProps$l;
|
|
12628
12629
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
12629
|
-
const defaultProps$
|
|
12630
|
+
const defaultProps$k = {
|
|
12630
12631
|
price: 0,
|
|
12631
12632
|
needSymbol: true,
|
|
12632
12633
|
symbol: "¥",
|
|
@@ -12635,7 +12636,18 @@ const defaultProps$h = {
|
|
|
12635
12636
|
className: ""
|
|
12636
12637
|
};
|
|
12637
12638
|
const Price = (props) => {
|
|
12638
|
-
const
|
|
12639
|
+
const {
|
|
12640
|
+
price,
|
|
12641
|
+
needSymbol,
|
|
12642
|
+
symbol,
|
|
12643
|
+
decimalDigits,
|
|
12644
|
+
thousands,
|
|
12645
|
+
className,
|
|
12646
|
+
...rest
|
|
12647
|
+
} = {
|
|
12648
|
+
...defaultProps$k,
|
|
12649
|
+
...props
|
|
12650
|
+
};
|
|
12639
12651
|
const b2 = cn("price");
|
|
12640
12652
|
const showSymbol = () => {
|
|
12641
12653
|
return { __html: (needSymbol ? symbol : "") || "" };
|
|
@@ -12672,9 +12684,10 @@ const Price = (props) => {
|
|
|
12672
12684
|
const resultFixed = Number(result).toFixed(decimalDigits);
|
|
12673
12685
|
return String(resultFixed).substring(2, resultFixed.length);
|
|
12674
12686
|
};
|
|
12675
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
12676
|
-
className: `${b2()} ${className}
|
|
12677
|
-
|
|
12687
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
12688
|
+
className: `${b2()} ${className}`,
|
|
12689
|
+
...rest
|
|
12690
|
+
}, needSymbol ? /* @__PURE__ */ React__default.createElement("div", {
|
|
12678
12691
|
className: `${b2("symbol")}`,
|
|
12679
12692
|
dangerouslySetInnerHTML: showSymbol()
|
|
12680
12693
|
}) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -12685,9 +12698,9 @@ const Price = (props) => {
|
|
|
12685
12698
|
className: `${b2("small")}`
|
|
12686
12699
|
}, formatDecimal(price)));
|
|
12687
12700
|
};
|
|
12688
|
-
Price.defaultProps = defaultProps$
|
|
12701
|
+
Price.defaultProps = defaultProps$k;
|
|
12689
12702
|
Price.displayName = "NutPrice";
|
|
12690
|
-
const defaultProps$
|
|
12703
|
+
const defaultProps$j = {
|
|
12691
12704
|
value: "",
|
|
12692
12705
|
dot: false,
|
|
12693
12706
|
max: 1e4,
|
|
@@ -12698,7 +12711,10 @@ const defaultProps$g = {
|
|
|
12698
12711
|
icons: ""
|
|
12699
12712
|
};
|
|
12700
12713
|
const Badge = (props) => {
|
|
12701
|
-
const { children, dot, top, right, zIndex, color, icons } =
|
|
12714
|
+
const { children, dot, top, right, zIndex, color, icons } = {
|
|
12715
|
+
...defaultProps$j,
|
|
12716
|
+
...props
|
|
12717
|
+
};
|
|
12702
12718
|
const content = () => {
|
|
12703
12719
|
if (dot)
|
|
12704
12720
|
return;
|
|
@@ -12731,9 +12747,9 @@ const Badge = (props) => {
|
|
|
12731
12747
|
style: getStyle()
|
|
12732
12748
|
}, content()));
|
|
12733
12749
|
};
|
|
12734
|
-
Badge.defaultProps = defaultProps$
|
|
12750
|
+
Badge.defaultProps = defaultProps$j;
|
|
12735
12751
|
Badge.displayName = "NutBadge";
|
|
12736
|
-
const defaultProps$
|
|
12752
|
+
const defaultProps$i = {
|
|
12737
12753
|
type: "default",
|
|
12738
12754
|
color: "",
|
|
12739
12755
|
textColor: "",
|
|
@@ -12759,11 +12775,25 @@ const Tag = (props) => {
|
|
|
12759
12775
|
textColor,
|
|
12760
12776
|
isShow,
|
|
12761
12777
|
onClick
|
|
12762
|
-
} =
|
|
12778
|
+
} = {
|
|
12779
|
+
...defaultProps$i,
|
|
12780
|
+
...props
|
|
12781
|
+
};
|
|
12763
12782
|
const [btnName, setBtnName] = useState("");
|
|
12764
12783
|
useEffect(() => {
|
|
12765
12784
|
setBtnName(classes());
|
|
12766
|
-
}, [
|
|
12785
|
+
}, [
|
|
12786
|
+
type,
|
|
12787
|
+
color,
|
|
12788
|
+
textColor,
|
|
12789
|
+
plain,
|
|
12790
|
+
round,
|
|
12791
|
+
mark,
|
|
12792
|
+
closeable,
|
|
12793
|
+
prefixCls,
|
|
12794
|
+
isShow,
|
|
12795
|
+
onClick
|
|
12796
|
+
]);
|
|
12767
12797
|
const classes = () => {
|
|
12768
12798
|
const prefixCls2 = "nut-tag";
|
|
12769
12799
|
return `${prefixCls2}
|
|
@@ -12812,7 +12842,7 @@ const Tag = (props) => {
|
|
|
12812
12842
|
className: "text"
|
|
12813
12843
|
}, children)));
|
|
12814
12844
|
};
|
|
12815
|
-
Tag.defaultProps = defaultProps$
|
|
12845
|
+
Tag.defaultProps = defaultProps$i;
|
|
12816
12846
|
Tag.displayName = "NutTag";
|
|
12817
12847
|
function fillRef(ref, node) {
|
|
12818
12848
|
if (typeof ref === "function") {
|
|
@@ -12851,7 +12881,9 @@ class Trigger extends React__default.Component {
|
|
|
12851
12881
|
if (child && child.props && child.props.className) {
|
|
12852
12882
|
newChildProps.className = className;
|
|
12853
12883
|
}
|
|
12854
|
-
const cloneProps =
|
|
12884
|
+
const cloneProps = {
|
|
12885
|
+
...newChildProps
|
|
12886
|
+
};
|
|
12855
12887
|
cloneProps.ref = composeRef(this.props.forwardedRef, child.ref);
|
|
12856
12888
|
const trigger = React__default.cloneElement(child, cloneProps);
|
|
12857
12889
|
return trigger;
|
|
@@ -12869,7 +12901,7 @@ const getEleAttr = (ele) => {
|
|
|
12869
12901
|
}
|
|
12870
12902
|
return null;
|
|
12871
12903
|
};
|
|
12872
|
-
const defaultProps$
|
|
12904
|
+
const defaultProps$h = {
|
|
12873
12905
|
list: [],
|
|
12874
12906
|
theme: "light",
|
|
12875
12907
|
location: "bottom",
|
|
@@ -12879,7 +12911,20 @@ const defaultProps$e = {
|
|
|
12879
12911
|
}
|
|
12880
12912
|
};
|
|
12881
12913
|
const Popover = (props) => {
|
|
12882
|
-
const
|
|
12914
|
+
const {
|
|
12915
|
+
children,
|
|
12916
|
+
list,
|
|
12917
|
+
theme,
|
|
12918
|
+
location,
|
|
12919
|
+
visible,
|
|
12920
|
+
className,
|
|
12921
|
+
style,
|
|
12922
|
+
onClick,
|
|
12923
|
+
...reset
|
|
12924
|
+
} = {
|
|
12925
|
+
...defaultProps$h,
|
|
12926
|
+
...props
|
|
12927
|
+
};
|
|
12883
12928
|
const goodItem = useRef(null);
|
|
12884
12929
|
const aa = goodItem.current && findDOMNode(goodItem.current);
|
|
12885
12930
|
setTimeout(() => {
|
|
@@ -12900,13 +12945,13 @@ const Popover = (props) => {
|
|
|
12900
12945
|
}, [list, theme]);
|
|
12901
12946
|
const getStyle = () => {
|
|
12902
12947
|
const style2 = {};
|
|
12903
|
-
if (
|
|
12948
|
+
if (location == "top") {
|
|
12904
12949
|
style2.bottom = elHeight + 20;
|
|
12905
12950
|
style2.left = 0;
|
|
12906
|
-
} else if (
|
|
12951
|
+
} else if (location == "right") {
|
|
12907
12952
|
style2.top = 0;
|
|
12908
12953
|
style2.right = -elWidth - 20;
|
|
12909
|
-
} else if (
|
|
12954
|
+
} else if (location == "left") {
|
|
12910
12955
|
style2.top = 0;
|
|
12911
12956
|
style2.left = -elWidth - 20;
|
|
12912
12957
|
} else {
|
|
@@ -12921,13 +12966,13 @@ const Popover = (props) => {
|
|
|
12921
12966
|
};
|
|
12922
12967
|
const getArrowStyle = () => {
|
|
12923
12968
|
const style2 = {};
|
|
12924
|
-
if (
|
|
12969
|
+
if (location == "top") {
|
|
12925
12970
|
style2.bottom = -20;
|
|
12926
12971
|
style2.left = elWidth / 2;
|
|
12927
|
-
} else if (
|
|
12972
|
+
} else if (location == "right") {
|
|
12928
12973
|
style2.top = 20;
|
|
12929
12974
|
style2.left = -20;
|
|
12930
|
-
} else if (
|
|
12975
|
+
} else if (location == "left") {
|
|
12931
12976
|
style2.top = 20;
|
|
12932
12977
|
style2.right = -20;
|
|
12933
12978
|
} else {
|
|
@@ -12948,22 +12993,23 @@ const Popover = (props) => {
|
|
|
12948
12993
|
const popoverContent_self = () => {
|
|
12949
12994
|
const prefixCls = "popoverContent";
|
|
12950
12995
|
return `${prefixCls}
|
|
12951
|
-
${
|
|
12996
|
+
${location ? `${prefixCls}--${location}` : ""}`;
|
|
12952
12997
|
};
|
|
12953
12998
|
const popoverArrow_self = () => {
|
|
12954
12999
|
const prefixCls = "popoverArrow";
|
|
12955
13000
|
return `${prefixCls}
|
|
12956
|
-
${
|
|
13001
|
+
${location ? `${prefixCls}--${location}` : ""}`;
|
|
12957
13002
|
};
|
|
12958
13003
|
const handleClick = (e2) => {
|
|
12959
13004
|
if (props.onClick) {
|
|
12960
13005
|
props.onClick(e2);
|
|
12961
13006
|
}
|
|
12962
13007
|
};
|
|
12963
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
13008
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
12964
13009
|
className: `${classes} ${className}`,
|
|
12965
|
-
style:
|
|
12966
|
-
|
|
13010
|
+
style: { ...style },
|
|
13011
|
+
...reset
|
|
13012
|
+
}, /* @__PURE__ */ React__default.createElement(Trigger, {
|
|
12967
13013
|
forwardedRef: goodItem
|
|
12968
13014
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12969
13015
|
onClick: (e2) => handleClick(e2)
|
|
@@ -12985,9 +13031,9 @@ const Popover = (props) => {
|
|
|
12985
13031
|
}, item.name));
|
|
12986
13032
|
})) : null)));
|
|
12987
13033
|
};
|
|
12988
|
-
Popover.defaultProps = defaultProps$
|
|
13034
|
+
Popover.defaultProps = defaultProps$h;
|
|
12989
13035
|
Popover.displayName = "NutPopover";
|
|
12990
|
-
const defaultProps$
|
|
13036
|
+
const defaultProps$g = {
|
|
12991
13037
|
width: "100px",
|
|
12992
13038
|
height: "100px",
|
|
12993
13039
|
row: 1,
|
|
@@ -13000,7 +13046,7 @@ const defaultProps$d = {
|
|
|
13000
13046
|
avatarShape: "round"
|
|
13001
13047
|
};
|
|
13002
13048
|
const Skeleton = (props) => {
|
|
13003
|
-
const
|
|
13049
|
+
const {
|
|
13004
13050
|
className,
|
|
13005
13051
|
width,
|
|
13006
13052
|
height,
|
|
@@ -13012,21 +13058,12 @@ const Skeleton = (props) => {
|
|
|
13012
13058
|
round,
|
|
13013
13059
|
loading,
|
|
13014
13060
|
children,
|
|
13015
|
-
avatarShape
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
"row",
|
|
13022
|
-
"title",
|
|
13023
|
-
"avatar",
|
|
13024
|
-
"avatarSize",
|
|
13025
|
-
"round",
|
|
13026
|
-
"loading",
|
|
13027
|
-
"children",
|
|
13028
|
-
"avatarShape"
|
|
13029
|
-
]);
|
|
13061
|
+
avatarShape,
|
|
13062
|
+
...restProps
|
|
13063
|
+
} = {
|
|
13064
|
+
...defaultProps$g,
|
|
13065
|
+
...props
|
|
13066
|
+
};
|
|
13030
13067
|
const b2 = cn("skeleton");
|
|
13031
13068
|
const classes = classNames(className, b2());
|
|
13032
13069
|
const blockClass = classNames({
|
|
@@ -13052,9 +13089,10 @@ const Skeleton = (props) => {
|
|
|
13052
13089
|
height: "50px"
|
|
13053
13090
|
};
|
|
13054
13091
|
};
|
|
13055
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, loading ? /* @__PURE__ */ React__default.createElement("div", null, children) : /* @__PURE__ */ React__default.createElement("div",
|
|
13056
|
-
className: classes
|
|
13057
|
-
|
|
13092
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, loading ? /* @__PURE__ */ React__default.createElement("div", null, children) : /* @__PURE__ */ React__default.createElement("div", {
|
|
13093
|
+
className: classes,
|
|
13094
|
+
...restProps
|
|
13095
|
+
}, animated2 && /* @__PURE__ */ React__default.createElement("div", {
|
|
13058
13096
|
className: "skeleton-animation"
|
|
13059
13097
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
13060
13098
|
className: "nut-skeleton-content"
|
|
@@ -13078,9 +13116,9 @@ const Skeleton = (props) => {
|
|
|
13078
13116
|
});
|
|
13079
13117
|
})))));
|
|
13080
13118
|
};
|
|
13081
|
-
Skeleton.defaultProps = defaultProps$
|
|
13119
|
+
Skeleton.defaultProps = defaultProps$g;
|
|
13082
13120
|
Skeleton.displayName = "NutSkeleton";
|
|
13083
|
-
const defaultProps$
|
|
13121
|
+
const defaultProps$f = {
|
|
13084
13122
|
showPlainText: false,
|
|
13085
13123
|
showDays: false,
|
|
13086
13124
|
paused: false,
|
|
@@ -13089,7 +13127,7 @@ const defaultProps$c = {
|
|
|
13089
13127
|
};
|
|
13090
13128
|
const CountDown = (props) => {
|
|
13091
13129
|
const { locale } = useConfig();
|
|
13092
|
-
const
|
|
13130
|
+
const {
|
|
13093
13131
|
showPlainText,
|
|
13094
13132
|
showDays,
|
|
13095
13133
|
paused,
|
|
@@ -13101,21 +13139,9 @@ const CountDown = (props) => {
|
|
|
13101
13139
|
onPaused,
|
|
13102
13140
|
onRestart,
|
|
13103
13141
|
onUpdate,
|
|
13104
|
-
children
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
"showDays",
|
|
13108
|
-
"paused",
|
|
13109
|
-
"startTime",
|
|
13110
|
-
"endTime",
|
|
13111
|
-
"className",
|
|
13112
|
-
"style",
|
|
13113
|
-
"onEnd",
|
|
13114
|
-
"onPaused",
|
|
13115
|
-
"onRestart",
|
|
13116
|
-
"onUpdate",
|
|
13117
|
-
"children"
|
|
13118
|
-
]);
|
|
13142
|
+
children,
|
|
13143
|
+
...rest
|
|
13144
|
+
} = { ...defaultProps$f, ...props };
|
|
13119
13145
|
const b2 = cn("countdown");
|
|
13120
13146
|
const [restTimeStamp, setRestTime] = useState(0);
|
|
13121
13147
|
const stateRef = useRef({
|
|
@@ -13128,7 +13154,7 @@ const CountDown = (props) => {
|
|
|
13128
13154
|
const fill2 = (v2) => {
|
|
13129
13155
|
v2 += "";
|
|
13130
13156
|
while (v2.length < 2) {
|
|
13131
|
-
v2 =
|
|
13157
|
+
v2 = `0${v2}`;
|
|
13132
13158
|
}
|
|
13133
13159
|
return v2;
|
|
13134
13160
|
};
|
|
@@ -13157,7 +13183,7 @@ const CountDown = (props) => {
|
|
|
13157
13183
|
const m2 = ts2 - d2 * ds - h2 * hs >= ms ? parseInt(String((ts2 - d2 * ds - h2 * hs) / ms)) : 0;
|
|
13158
13184
|
const s = Math.round((ts2 - d2 * ds - h2 * hs - m2 * ms) / 1e3);
|
|
13159
13185
|
if (d2 >= 0)
|
|
13160
|
-
rest2.d = d2
|
|
13186
|
+
rest2.d = `${d2}`;
|
|
13161
13187
|
if (h2 >= 0)
|
|
13162
13188
|
rest2.h = fill2(h2);
|
|
13163
13189
|
if (m2 >= 0)
|
|
@@ -13240,10 +13266,11 @@ const CountDown = (props) => {
|
|
|
13240
13266
|
const componentWillUnmount = () => {
|
|
13241
13267
|
clearInterval(stateRef.current.timer);
|
|
13242
13268
|
};
|
|
13243
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
13269
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13244
13270
|
className: `${b2()} ${className || ""}`,
|
|
13245
|
-
style:
|
|
13246
|
-
|
|
13271
|
+
style: { ...style },
|
|
13272
|
+
...rest
|
|
13273
|
+
}, children || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, showPlainText ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13247
13274
|
className: b2("block")
|
|
13248
13275
|
}, " ", plainText, " ") : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, Number(resttime.d) >= 0 && showDays ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
13249
13276
|
className: b2("block")
|
|
@@ -13261,9 +13288,9 @@ const CountDown = (props) => {
|
|
|
13261
13288
|
className: b2("block")
|
|
13262
13289
|
}, resttime.s))));
|
|
13263
13290
|
};
|
|
13264
|
-
CountDown.defaultProps = defaultProps$
|
|
13291
|
+
CountDown.defaultProps = defaultProps$f;
|
|
13265
13292
|
CountDown.displayName = "NutCountDown";
|
|
13266
|
-
const defaultProps$
|
|
13293
|
+
const defaultProps$e = {
|
|
13267
13294
|
activeName: ["0"],
|
|
13268
13295
|
accordion: false,
|
|
13269
13296
|
icon: "",
|
|
@@ -13275,7 +13302,19 @@ function areEqual(prevProps, nextProps) {
|
|
|
13275
13302
|
return JSON.stringify(prevProps.activeName) === JSON.stringify(nextProps.activeName);
|
|
13276
13303
|
}
|
|
13277
13304
|
const Collapse = memo((props) => {
|
|
13278
|
-
const {
|
|
13305
|
+
const {
|
|
13306
|
+
children,
|
|
13307
|
+
activeName,
|
|
13308
|
+
accordion,
|
|
13309
|
+
icon,
|
|
13310
|
+
rotate,
|
|
13311
|
+
iconSize,
|
|
13312
|
+
iconColor,
|
|
13313
|
+
change
|
|
13314
|
+
} = {
|
|
13315
|
+
...defaultProps$e,
|
|
13316
|
+
...props
|
|
13317
|
+
};
|
|
13279
13318
|
const childrenDom = React__default.Children.toArray(children);
|
|
13280
13319
|
const [defaultOpenIndex, setDefaultOpenIndex] = useState([]);
|
|
13281
13320
|
const handleActiveName = () => {
|
|
@@ -13328,9 +13367,9 @@ const Collapse = memo((props) => {
|
|
|
13328
13367
|
});
|
|
13329
13368
|
}));
|
|
13330
13369
|
}, areEqual);
|
|
13331
|
-
Collapse.defaultProps = defaultProps$
|
|
13370
|
+
Collapse.defaultProps = defaultProps$e;
|
|
13332
13371
|
Collapse.displayName = "NutCollapse";
|
|
13333
|
-
const defaultProps$
|
|
13372
|
+
const defaultProps$d = {
|
|
13334
13373
|
title: "",
|
|
13335
13374
|
name: "",
|
|
13336
13375
|
isOpen: false,
|
|
@@ -13346,7 +13385,7 @@ const defaultProps$a = {
|
|
|
13346
13385
|
titleIconSize: ""
|
|
13347
13386
|
};
|
|
13348
13387
|
const CollapseItem = (props) => {
|
|
13349
|
-
const
|
|
13388
|
+
const {
|
|
13350
13389
|
children,
|
|
13351
13390
|
title,
|
|
13352
13391
|
isOpen,
|
|
@@ -13361,24 +13400,12 @@ const CollapseItem = (props) => {
|
|
|
13361
13400
|
titleIconPosition,
|
|
13362
13401
|
titleIconSize,
|
|
13363
13402
|
iconSize,
|
|
13364
|
-
iconColor
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
"name",
|
|
13371
|
-
"disabled",
|
|
13372
|
-
"icon",
|
|
13373
|
-
"rotate",
|
|
13374
|
-
"subTitle",
|
|
13375
|
-
"titleIcon",
|
|
13376
|
-
"titleIconColor",
|
|
13377
|
-
"titleIconPosition",
|
|
13378
|
-
"titleIconSize",
|
|
13379
|
-
"iconSize",
|
|
13380
|
-
"iconColor"
|
|
13381
|
-
]);
|
|
13403
|
+
iconColor,
|
|
13404
|
+
...rest
|
|
13405
|
+
} = {
|
|
13406
|
+
...defaultProps$d,
|
|
13407
|
+
...props
|
|
13408
|
+
};
|
|
13382
13409
|
const [domHeight, setDomHeight] = useState(-1);
|
|
13383
13410
|
const [currHeight, setCurrHeight] = useState("auto");
|
|
13384
13411
|
const [update2, setUpdate] = useState(false);
|
|
@@ -13402,9 +13429,10 @@ const CollapseItem = (props) => {
|
|
|
13402
13429
|
const newIconStyle = isOpen ? { transform: `translateY(-50%) rotate(${rotate}deg)` } : { transform: "translateY(-50%)" };
|
|
13403
13430
|
setIconStyle(newIconStyle);
|
|
13404
13431
|
}, [isOpen, domHeight]);
|
|
13405
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
13406
|
-
className: colBem()
|
|
13407
|
-
|
|
13432
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13433
|
+
className: colBem(),
|
|
13434
|
+
...rest
|
|
13435
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13408
13436
|
className: colBem("header", { disabled }),
|
|
13409
13437
|
onClick: () => {
|
|
13410
13438
|
if (disabled)
|
|
@@ -13444,9 +13472,9 @@ const CollapseItem = (props) => {
|
|
|
13444
13472
|
className: colBem("content-text")
|
|
13445
13473
|
}, children)));
|
|
13446
13474
|
};
|
|
13447
|
-
CollapseItem.defaultProps = defaultProps$
|
|
13475
|
+
CollapseItem.defaultProps = defaultProps$d;
|
|
13448
13476
|
CollapseItem.displayName = "NutCollapseItem";
|
|
13449
|
-
const defaultProps$
|
|
13477
|
+
const defaultProps$c = {
|
|
13450
13478
|
maxLen: 0,
|
|
13451
13479
|
endNumber: "",
|
|
13452
13480
|
delaySpeed: 300,
|
|
@@ -13455,7 +13483,18 @@ const defaultProps$9 = {
|
|
|
13455
13483
|
className: ""
|
|
13456
13484
|
};
|
|
13457
13485
|
const CountUp = (props) => {
|
|
13458
|
-
const
|
|
13486
|
+
const {
|
|
13487
|
+
maxLen,
|
|
13488
|
+
endNumber,
|
|
13489
|
+
delaySpeed,
|
|
13490
|
+
easeSpeed,
|
|
13491
|
+
className,
|
|
13492
|
+
thousands,
|
|
13493
|
+
...reset
|
|
13494
|
+
} = {
|
|
13495
|
+
...defaultProps$c,
|
|
13496
|
+
...props
|
|
13497
|
+
};
|
|
13459
13498
|
const b2 = cn("countup");
|
|
13460
13499
|
const countupRef = useRef(null);
|
|
13461
13500
|
const timerRef = useRef(0);
|
|
@@ -13519,9 +13558,9 @@ const CountUp = (props) => {
|
|
|
13519
13558
|
}, item));
|
|
13520
13559
|
})));
|
|
13521
13560
|
};
|
|
13522
|
-
CountUp.defaultProps = defaultProps$
|
|
13561
|
+
CountUp.defaultProps = defaultProps$c;
|
|
13523
13562
|
CountUp.displayName = "NutCountUp";
|
|
13524
|
-
const defaultProps$
|
|
13563
|
+
const defaultProps$b = {};
|
|
13525
13564
|
class AnimatingNumbers extends Component {
|
|
13526
13565
|
constructor(props) {
|
|
13527
13566
|
super(props);
|
|
@@ -13533,23 +13572,28 @@ class AnimatingNumbers extends Component {
|
|
|
13533
13572
|
});
|
|
13534
13573
|
}
|
|
13535
13574
|
}
|
|
13536
|
-
|
|
13537
|
-
|
|
13538
|
-
|
|
13575
|
+
AnimatingNumbers.defaultProps = defaultProps$b;
|
|
13576
|
+
AnimatingNumbers.displayName = "NutAnimatingNumbers";
|
|
13577
|
+
AnimatingNumbers.CountUp = CountUp;
|
|
13539
13578
|
AnimatingNumbers.CountUp = CountUp;
|
|
13540
13579
|
const defaultStatus = {
|
|
13541
13580
|
empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
|
|
13542
13581
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
13543
13582
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
13544
13583
|
};
|
|
13545
|
-
const defaultProps$
|
|
13584
|
+
const defaultProps$a = {
|
|
13546
13585
|
description: "\u65E0\u5185\u5BB9",
|
|
13547
13586
|
image: "empty",
|
|
13548
13587
|
imageSize: "",
|
|
13549
13588
|
className: ""
|
|
13550
13589
|
};
|
|
13551
13590
|
const Empty = (props) => {
|
|
13552
|
-
const
|
|
13591
|
+
const { locale } = useConfig();
|
|
13592
|
+
defaultProps$a.description = locale.noData || defaultProps$a.description;
|
|
13593
|
+
const { image, imageSize, description, children, className, ...rest } = {
|
|
13594
|
+
...defaultProps$a,
|
|
13595
|
+
...props
|
|
13596
|
+
};
|
|
13553
13597
|
const [imgStyle, setImgStyle] = useState({});
|
|
13554
13598
|
const b2 = cn("empty");
|
|
13555
13599
|
let imageNode = image;
|
|
@@ -13579,16 +13623,17 @@ const Empty = (props) => {
|
|
|
13579
13623
|
};
|
|
13580
13624
|
});
|
|
13581
13625
|
}, [imageSize]);
|
|
13582
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
13583
|
-
className: `${b2()} ${className}
|
|
13584
|
-
|
|
13626
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13627
|
+
className: `${b2()} ${className}`,
|
|
13628
|
+
...rest
|
|
13629
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13585
13630
|
className: b2("image"),
|
|
13586
13631
|
style: imgStyle
|
|
13587
13632
|
}, imageNode), typeof description === "string" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
13588
13633
|
className: b2("description")
|
|
13589
13634
|
}, description) : { description }, children);
|
|
13590
13635
|
};
|
|
13591
|
-
Empty.defaultProps = defaultProps$
|
|
13636
|
+
Empty.defaultProps = defaultProps$a;
|
|
13592
13637
|
Empty.displayName = "NutEmpty";
|
|
13593
13638
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
13594
13639
|
let index2 = 0;
|
|
@@ -13701,9 +13746,9 @@ const updateItemSize = (positions, items, sizeKey) => {
|
|
|
13701
13746
|
}
|
|
13702
13747
|
});
|
|
13703
13748
|
};
|
|
13704
|
-
const defaultProps$
|
|
13749
|
+
const defaultProps$9 = {};
|
|
13705
13750
|
const VirtualList = (props) => {
|
|
13706
|
-
const
|
|
13751
|
+
const {
|
|
13707
13752
|
sourceData = [],
|
|
13708
13753
|
ItemRender,
|
|
13709
13754
|
itemEqualSize = true,
|
|
@@ -13713,19 +13758,9 @@ const VirtualList = (props) => {
|
|
|
13713
13758
|
key,
|
|
13714
13759
|
handleScroll,
|
|
13715
13760
|
className,
|
|
13716
|
-
containerSize
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
"ItemRender",
|
|
13720
|
-
"itemEqualSize",
|
|
13721
|
-
"itemSize",
|
|
13722
|
-
"horizontal",
|
|
13723
|
-
"overscan",
|
|
13724
|
-
"key",
|
|
13725
|
-
"handleScroll",
|
|
13726
|
-
"className",
|
|
13727
|
-
"containerSize"
|
|
13728
|
-
]);
|
|
13761
|
+
containerSize,
|
|
13762
|
+
...rest
|
|
13763
|
+
} = props;
|
|
13729
13764
|
const sizeKey = horizontal ? "width" : "height";
|
|
13730
13765
|
const scrollKey = horizontal ? "scrollLeft" : "scrollTop";
|
|
13731
13766
|
const offsetKey = horizontal ? "left" : "top";
|
|
@@ -13760,8 +13795,8 @@ const VirtualList = (props) => {
|
|
|
13760
13795
|
setListTotalSize(totalSize);
|
|
13761
13796
|
}, [sourceData, itemSize, horizontal]);
|
|
13762
13797
|
const getElement = useCallback(() => {
|
|
13763
|
-
var
|
|
13764
|
-
return ((
|
|
13798
|
+
var _a;
|
|
13799
|
+
return ((_a = scrollRef.current) == null ? void 0 : _a.parentElement) || document.body;
|
|
13765
13800
|
}, []);
|
|
13766
13801
|
useEffect(() => {
|
|
13767
13802
|
if (containerSize)
|
|
@@ -13775,7 +13810,7 @@ const VirtualList = (props) => {
|
|
|
13775
13810
|
const count = Math.ceil(offSetSize / itemSize) + overscan;
|
|
13776
13811
|
setVisibleCount(count);
|
|
13777
13812
|
setOptions((options22) => {
|
|
13778
|
-
return
|
|
13813
|
+
return { ...options22, endIndex: count };
|
|
13779
13814
|
});
|
|
13780
13815
|
}, [getElement, horizontal, itemSize, overscan, offSetSize]);
|
|
13781
13816
|
const updateTotalSize = useCallback(() => {
|
|
@@ -13796,7 +13831,7 @@ const VirtualList = (props) => {
|
|
|
13796
13831
|
if (!itemEqualSize) {
|
|
13797
13832
|
updateTotalSize();
|
|
13798
13833
|
}
|
|
13799
|
-
|
|
13834
|
+
const endIndex = getEndIndex({
|
|
13800
13835
|
sourceData,
|
|
13801
13836
|
startIndex,
|
|
13802
13837
|
visibleCount,
|
|
@@ -13834,13 +13869,13 @@ const VirtualList = (props) => {
|
|
|
13834
13869
|
element.removeEventListener("scroll", onScroll, false);
|
|
13835
13870
|
};
|
|
13836
13871
|
}, [getElement, onScroll]);
|
|
13837
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
13838
|
-
className: className ? `${className} nut-virtualList-box` : "nut-virtualList-box"
|
|
13839
|
-
|
|
13872
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13873
|
+
className: className ? `${className} nut-virtualList-box` : "nut-virtualList-box",
|
|
13874
|
+
...rest,
|
|
13840
13875
|
style: {
|
|
13841
13876
|
[sizeKey]: containerSize ? `${offSetSize}px` : ""
|
|
13842
13877
|
}
|
|
13843
|
-
}
|
|
13878
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13844
13879
|
ref: scrollRef,
|
|
13845
13880
|
className: horizontal ? "nut-horizontal-box" : "nut-vertical-box",
|
|
13846
13881
|
style: {
|
|
@@ -13870,9 +13905,9 @@ const VirtualList = (props) => {
|
|
|
13870
13905
|
}) : data);
|
|
13871
13906
|
}))));
|
|
13872
13907
|
};
|
|
13873
|
-
VirtualList.defaultProps = defaultProps$
|
|
13908
|
+
VirtualList.defaultProps = defaultProps$9;
|
|
13874
13909
|
VirtualList.displayName = "NutVirtualList";
|
|
13875
|
-
const defaultProps$
|
|
13910
|
+
const defaultProps$8 = {
|
|
13876
13911
|
type: "custom",
|
|
13877
13912
|
existAddress: [],
|
|
13878
13913
|
defaultIcon: "location2",
|
|
@@ -13882,7 +13917,7 @@ const defaultProps$5 = {
|
|
|
13882
13917
|
};
|
|
13883
13918
|
const ExistRender = (props) => {
|
|
13884
13919
|
const { locale } = useConfig();
|
|
13885
|
-
const
|
|
13920
|
+
const {
|
|
13886
13921
|
children,
|
|
13887
13922
|
type,
|
|
13888
13923
|
existAddress,
|
|
@@ -13892,19 +13927,9 @@ const ExistRender = (props) => {
|
|
|
13892
13927
|
customAndExistTitle,
|
|
13893
13928
|
onSelected,
|
|
13894
13929
|
onClose,
|
|
13895
|
-
onSwitchModule
|
|
13896
|
-
|
|
13897
|
-
|
|
13898
|
-
"type",
|
|
13899
|
-
"existAddress",
|
|
13900
|
-
"selectedIcon",
|
|
13901
|
-
"defaultIcon",
|
|
13902
|
-
"isShowCustomAddress",
|
|
13903
|
-
"customAndExistTitle",
|
|
13904
|
-
"onSelected",
|
|
13905
|
-
"onClose",
|
|
13906
|
-
"onSwitchModule"
|
|
13907
|
-
]);
|
|
13930
|
+
onSwitchModule,
|
|
13931
|
+
...rest
|
|
13932
|
+
} = { ...defaultProps$8, ...props };
|
|
13908
13933
|
const b2 = cn("address");
|
|
13909
13934
|
const selectedExist = (item) => {
|
|
13910
13935
|
const copyExistAdd = existAddress;
|
|
@@ -13964,7 +13989,7 @@ const ExistRender = (props) => {
|
|
|
13964
13989
|
className: b2("choose-other-btn")
|
|
13965
13990
|
}, locale.address.chooseAnotherAddress || customAndExistTitle)));
|
|
13966
13991
|
};
|
|
13967
|
-
const defaultProps$
|
|
13992
|
+
const defaultProps$7 = {
|
|
13968
13993
|
type: "custom",
|
|
13969
13994
|
province: [],
|
|
13970
13995
|
city: [],
|
|
@@ -13974,7 +13999,7 @@ const defaultProps$4 = {
|
|
|
13974
13999
|
};
|
|
13975
14000
|
const CustomRender = (props) => {
|
|
13976
14001
|
const { locale } = useConfig();
|
|
13977
|
-
const
|
|
14002
|
+
const {
|
|
13978
14003
|
children,
|
|
13979
14004
|
type,
|
|
13980
14005
|
height,
|
|
@@ -13984,19 +14009,12 @@ const CustomRender = (props) => {
|
|
|
13984
14009
|
town,
|
|
13985
14010
|
onNextArea,
|
|
13986
14011
|
onTabClick,
|
|
13987
|
-
onClose
|
|
13988
|
-
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
"city",
|
|
13994
|
-
"country",
|
|
13995
|
-
"town",
|
|
13996
|
-
"onNextArea",
|
|
13997
|
-
"onTabClick",
|
|
13998
|
-
"onClose"
|
|
13999
|
-
]);
|
|
14012
|
+
onClose,
|
|
14013
|
+
...rest
|
|
14014
|
+
} = {
|
|
14015
|
+
...defaultProps$7,
|
|
14016
|
+
...props
|
|
14017
|
+
};
|
|
14000
14018
|
const b2 = cn("address");
|
|
14001
14019
|
const [privateType] = useState(type);
|
|
14002
14020
|
const [tabIndex, setTabIndex] = useState(0);
|
|
@@ -14057,9 +14075,8 @@ const CustomRender = (props) => {
|
|
|
14057
14075
|
const getTabName = (item, index2) => {
|
|
14058
14076
|
if (tabIndex > index2) {
|
|
14059
14077
|
return item.name;
|
|
14060
|
-
} else {
|
|
14061
|
-
return locale.select;
|
|
14062
14078
|
}
|
|
14079
|
+
return locale.select;
|
|
14063
14080
|
};
|
|
14064
14081
|
const mapRef = {
|
|
14065
14082
|
province: provinceRef,
|
|
@@ -14084,19 +14101,23 @@ const CustomRender = (props) => {
|
|
|
14084
14101
|
custom: tabName[tabIndex],
|
|
14085
14102
|
selectedRegion: {}
|
|
14086
14103
|
};
|
|
14087
|
-
setSelectedRegion(
|
|
14088
|
-
|
|
14089
|
-
}));
|
|
14090
|
-
calBack.selectedRegion = __spreadProps(__spreadValues({}, selectedRegion), {
|
|
14104
|
+
setSelectedRegion({
|
|
14105
|
+
...selectedRegion,
|
|
14091
14106
|
[tabName[tabIndex]]: item
|
|
14092
14107
|
});
|
|
14108
|
+
calBack.selectedRegion = {
|
|
14109
|
+
...selectedRegion,
|
|
14110
|
+
[tabName[tabIndex]]: item
|
|
14111
|
+
};
|
|
14093
14112
|
for (let i = tabIndex; i < tabIndex - 1; i++) {
|
|
14094
|
-
setSelectedRegion(() =>
|
|
14113
|
+
setSelectedRegion(() => ({
|
|
14114
|
+
...selectedRegion,
|
|
14095
14115
|
[tabName[i + 1]]: {}
|
|
14096
14116
|
}));
|
|
14097
|
-
calBack.selectedRegion =
|
|
14117
|
+
calBack.selectedRegion = {
|
|
14118
|
+
...selectedRegion,
|
|
14098
14119
|
[tabName[i + 1]]: {}
|
|
14099
|
-
}
|
|
14120
|
+
};
|
|
14100
14121
|
}
|
|
14101
14122
|
if (tabIndex < 4) {
|
|
14102
14123
|
if (tabIndex === 3) {
|
|
@@ -14123,28 +14144,32 @@ const CustomRender = (props) => {
|
|
|
14123
14144
|
nextAreaList(item);
|
|
14124
14145
|
};
|
|
14125
14146
|
useEffect(() => {
|
|
14126
|
-
const { province: province2 } =
|
|
14127
|
-
setRegionList(
|
|
14147
|
+
const { province: province2 } = { ...defaultProps$7, ...props };
|
|
14148
|
+
setRegionList({
|
|
14149
|
+
...regionList,
|
|
14128
14150
|
province: isCustom2() ? transformData(province2) : province2
|
|
14129
|
-
})
|
|
14151
|
+
});
|
|
14130
14152
|
}, [province]);
|
|
14131
14153
|
useEffect(() => {
|
|
14132
|
-
const { city: city2 } =
|
|
14133
|
-
setRegionList(
|
|
14154
|
+
const { city: city2 } = { ...defaultProps$7, ...props };
|
|
14155
|
+
setRegionList({
|
|
14156
|
+
...regionList,
|
|
14134
14157
|
city: isCustom2() ? transformData(city2) : city2
|
|
14135
|
-
})
|
|
14158
|
+
});
|
|
14136
14159
|
}, [city]);
|
|
14137
14160
|
useEffect(() => {
|
|
14138
|
-
const { country: country2 } =
|
|
14139
|
-
setRegionList(
|
|
14161
|
+
const { country: country2 } = { ...defaultProps$7, ...props };
|
|
14162
|
+
setRegionList({
|
|
14163
|
+
...regionList,
|
|
14140
14164
|
country: isCustom2() ? transformData(country2) : country2
|
|
14141
|
-
})
|
|
14165
|
+
});
|
|
14142
14166
|
}, [country]);
|
|
14143
14167
|
useEffect(() => {
|
|
14144
|
-
const { town: town2 } =
|
|
14145
|
-
setRegionList(
|
|
14168
|
+
const { town: town2 } = { ...defaultProps$7, ...props };
|
|
14169
|
+
setRegionList({
|
|
14170
|
+
...regionList,
|
|
14146
14171
|
town: isCustom2() ? transformData(town2) : town2
|
|
14147
|
-
})
|
|
14172
|
+
});
|
|
14148
14173
|
}, [town]);
|
|
14149
14174
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14150
14175
|
className: b2("custom")
|
|
@@ -14184,7 +14209,7 @@ const CustomRender = (props) => {
|
|
|
14184
14209
|
clickItem: handleElevatorItem
|
|
14185
14210
|
})));
|
|
14186
14211
|
};
|
|
14187
|
-
const defaultProps$
|
|
14212
|
+
const defaultProps$6 = {
|
|
14188
14213
|
modelValue: false,
|
|
14189
14214
|
type: "custom",
|
|
14190
14215
|
customAddressTitle: "\u8BF7\u9009\u62E9\u6240\u5728\u5730\u533A",
|
|
@@ -14204,7 +14229,7 @@ const defaultProps$3 = {
|
|
|
14204
14229
|
};
|
|
14205
14230
|
const Address = (props) => {
|
|
14206
14231
|
const { locale } = useConfig();
|
|
14207
|
-
const
|
|
14232
|
+
const {
|
|
14208
14233
|
modelValue,
|
|
14209
14234
|
children,
|
|
14210
14235
|
type,
|
|
@@ -14229,34 +14254,9 @@ const Address = (props) => {
|
|
|
14229
14254
|
switchModule,
|
|
14230
14255
|
onTabChecked,
|
|
14231
14256
|
style,
|
|
14232
|
-
className
|
|
14233
|
-
|
|
14234
|
-
|
|
14235
|
-
"children",
|
|
14236
|
-
"type",
|
|
14237
|
-
"height",
|
|
14238
|
-
"customAddressTitle",
|
|
14239
|
-
"existAddress",
|
|
14240
|
-
"existAddressTitle",
|
|
14241
|
-
"province",
|
|
14242
|
-
"city",
|
|
14243
|
-
"country",
|
|
14244
|
-
"town",
|
|
14245
|
-
"isShowCustomAddress",
|
|
14246
|
-
"customAndExistTitle",
|
|
14247
|
-
"selectedIcon",
|
|
14248
|
-
"defaultIcon",
|
|
14249
|
-
"closeBtnIcon",
|
|
14250
|
-
"backBtnIcon",
|
|
14251
|
-
"onChange",
|
|
14252
|
-
"onSelected",
|
|
14253
|
-
"onClose",
|
|
14254
|
-
"closeMask",
|
|
14255
|
-
"switchModule",
|
|
14256
|
-
"onTabChecked",
|
|
14257
|
-
"style",
|
|
14258
|
-
"className"
|
|
14259
|
-
]);
|
|
14257
|
+
className,
|
|
14258
|
+
...rest
|
|
14259
|
+
} = { ...defaultProps$6, ...props };
|
|
14260
14260
|
const b2 = cn("address");
|
|
14261
14261
|
const [privateType, setPrivateType] = useState(type);
|
|
14262
14262
|
const [tabName] = useState(["province", "city", "country", "town"]);
|
|
@@ -14281,7 +14281,9 @@ const Address = (props) => {
|
|
|
14281
14281
|
custom: item.custom,
|
|
14282
14282
|
selectedRegion: {}
|
|
14283
14283
|
};
|
|
14284
|
-
setSelectedRegion(
|
|
14284
|
+
setSelectedRegion({
|
|
14285
|
+
...item.selectedRegion
|
|
14286
|
+
});
|
|
14285
14287
|
onChange && onChange(callbackParams);
|
|
14286
14288
|
};
|
|
14287
14289
|
const selectedExist = (prevExistAdd, item, copyExistAdd) => {
|
|
@@ -14292,17 +14294,19 @@ const Address = (props) => {
|
|
|
14292
14294
|
};
|
|
14293
14295
|
const initAddress = () => {
|
|
14294
14296
|
for (let i = 0; i < tabName.length; i++) {
|
|
14295
|
-
setSelectedRegion(
|
|
14297
|
+
setSelectedRegion({
|
|
14298
|
+
...selectedRegion,
|
|
14296
14299
|
[tabName[i]]: {}
|
|
14297
|
-
})
|
|
14300
|
+
});
|
|
14298
14301
|
}
|
|
14299
14302
|
console.log(selectedRegion);
|
|
14300
14303
|
};
|
|
14301
14304
|
const closeFun = () => {
|
|
14302
|
-
const resCopy =
|
|
14305
|
+
const resCopy = {
|
|
14303
14306
|
addressIdStr: "",
|
|
14304
|
-
addressStr: ""
|
|
14305
|
-
|
|
14307
|
+
addressStr: "",
|
|
14308
|
+
...selectedRegion
|
|
14309
|
+
};
|
|
14306
14310
|
const res = {
|
|
14307
14311
|
data: {},
|
|
14308
14312
|
type: privateType
|
|
@@ -14371,10 +14375,11 @@ const Address = (props) => {
|
|
|
14371
14375
|
onClose: () => {
|
|
14372
14376
|
closeFun();
|
|
14373
14377
|
}
|
|
14374
|
-
}, /* @__PURE__ */ React__default.createElement("div",
|
|
14378
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14375
14379
|
className: `${b2()} ${className || ""}`,
|
|
14376
|
-
style:
|
|
14377
|
-
|
|
14380
|
+
style: { ...style },
|
|
14381
|
+
...rest
|
|
14382
|
+
}, headerRender(), (privateType === "custom" || privateType === "custom2") && /* @__PURE__ */ React__default.createElement(CustomRender, {
|
|
14378
14383
|
type: privateType,
|
|
14379
14384
|
province,
|
|
14380
14385
|
city,
|
|
@@ -14399,9 +14404,9 @@ const Address = (props) => {
|
|
|
14399
14404
|
onSwitchModule
|
|
14400
14405
|
}))));
|
|
14401
14406
|
};
|
|
14402
|
-
Address.defaultProps = defaultProps$
|
|
14407
|
+
Address.defaultProps = defaultProps$6;
|
|
14403
14408
|
Address.displayName = "NutAddress";
|
|
14404
|
-
const defaultProps$
|
|
14409
|
+
const defaultProps$5 = {
|
|
14405
14410
|
barrageList: [],
|
|
14406
14411
|
frequency: 500,
|
|
14407
14412
|
loop: true,
|
|
@@ -14410,7 +14415,19 @@ const defaultProps$2 = {
|
|
|
14410
14415
|
top: 10
|
|
14411
14416
|
};
|
|
14412
14417
|
const InternalBarrage = (props, ref) => {
|
|
14413
|
-
const
|
|
14418
|
+
const {
|
|
14419
|
+
className,
|
|
14420
|
+
frequency,
|
|
14421
|
+
loop: loop2,
|
|
14422
|
+
barrageList,
|
|
14423
|
+
speeds,
|
|
14424
|
+
rows,
|
|
14425
|
+
top,
|
|
14426
|
+
...restProps
|
|
14427
|
+
} = {
|
|
14428
|
+
...defaultProps$5,
|
|
14429
|
+
...props
|
|
14430
|
+
};
|
|
14414
14431
|
const barrageBody = useRef(null);
|
|
14415
14432
|
const barrageContainer = useRef(null);
|
|
14416
14433
|
const barrageCWidth = useRef(0);
|
|
@@ -14459,18 +14476,19 @@ const InternalBarrage = (props, ref) => {
|
|
|
14459
14476
|
});
|
|
14460
14477
|
index2.current++;
|
|
14461
14478
|
};
|
|
14462
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
14479
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14463
14480
|
className: classes,
|
|
14464
|
-
ref: barrageBody
|
|
14465
|
-
|
|
14481
|
+
ref: barrageBody,
|
|
14482
|
+
...restProps
|
|
14483
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14466
14484
|
ref: barrageContainer,
|
|
14467
14485
|
className: "bContainer"
|
|
14468
14486
|
}));
|
|
14469
14487
|
};
|
|
14470
14488
|
const Barrage = React__default.forwardRef(InternalBarrage);
|
|
14471
|
-
Barrage.defaultProps = defaultProps$
|
|
14489
|
+
Barrage.defaultProps = defaultProps$5;
|
|
14472
14490
|
Barrage.displayName = "NutBarrage";
|
|
14473
|
-
const defaultProps$
|
|
14491
|
+
const defaultProps$4 = {
|
|
14474
14492
|
type: "png",
|
|
14475
14493
|
lineWidth: 2,
|
|
14476
14494
|
strokeStyle: "#000",
|
|
@@ -14479,7 +14497,10 @@ const defaultProps$1 = {
|
|
|
14479
14497
|
};
|
|
14480
14498
|
const Signature = (props) => {
|
|
14481
14499
|
const { locale } = useConfig();
|
|
14482
|
-
const
|
|
14500
|
+
const { type, lineWidth, strokeStyle, unSupportTpl, className, ...rest } = {
|
|
14501
|
+
...defaultProps$4,
|
|
14502
|
+
...props
|
|
14503
|
+
};
|
|
14483
14504
|
const b2 = cn("signature");
|
|
14484
14505
|
const canvasRef = useRef(null);
|
|
14485
14506
|
const wrapRef = useRef(null);
|
|
@@ -14565,9 +14586,10 @@ const Signature = (props) => {
|
|
|
14565
14586
|
clear();
|
|
14566
14587
|
props.confirm && props.confirm(canvas, dataurl);
|
|
14567
14588
|
};
|
|
14568
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
14569
|
-
className: `${b2()} ${className}
|
|
14570
|
-
|
|
14589
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14590
|
+
className: `${b2()} ${className}`,
|
|
14591
|
+
...rest
|
|
14592
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14571
14593
|
className: `${b2("inner")}`,
|
|
14572
14594
|
ref: wrapRef
|
|
14573
14595
|
}, isCanvasSupported() ? /* @__PURE__ */ React__default.createElement("canvas", {
|
|
@@ -14586,11 +14608,11 @@ const Signature = (props) => {
|
|
|
14586
14608
|
onClick: () => confirm2()
|
|
14587
14609
|
}, locale.confirm));
|
|
14588
14610
|
};
|
|
14589
|
-
Signature.defaultProps = defaultProps$
|
|
14611
|
+
Signature.defaultProps = defaultProps$4;
|
|
14590
14612
|
Signature.displayName = "NutSignature";
|
|
14591
|
-
const defaultProps = {};
|
|
14613
|
+
const defaultProps$3 = {};
|
|
14592
14614
|
const Card = (props) => {
|
|
14593
|
-
const
|
|
14615
|
+
const {
|
|
14594
14616
|
className,
|
|
14595
14617
|
style,
|
|
14596
14618
|
imgUrl,
|
|
@@ -14603,27 +14625,18 @@ const Card = (props) => {
|
|
|
14603
14625
|
shopTagTpl,
|
|
14604
14626
|
originTpl,
|
|
14605
14627
|
prolistTpl,
|
|
14606
|
-
footerTpl
|
|
14607
|
-
|
|
14608
|
-
|
|
14609
|
-
|
|
14610
|
-
|
|
14611
|
-
|
|
14612
|
-
"price",
|
|
14613
|
-
"vipPrice",
|
|
14614
|
-
"shopDesc",
|
|
14615
|
-
"delivery",
|
|
14616
|
-
"shopName",
|
|
14617
|
-
"shopTagTpl",
|
|
14618
|
-
"originTpl",
|
|
14619
|
-
"prolistTpl",
|
|
14620
|
-
"footerTpl"
|
|
14621
|
-
]);
|
|
14628
|
+
footerTpl,
|
|
14629
|
+
...rest
|
|
14630
|
+
} = {
|
|
14631
|
+
...defaultProps$3,
|
|
14632
|
+
...props
|
|
14633
|
+
};
|
|
14622
14634
|
const b2 = cn("card");
|
|
14623
|
-
return /* @__PURE__ */ React__default.createElement("div",
|
|
14635
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14624
14636
|
className: `${b2()} ${className}`,
|
|
14625
|
-
style
|
|
14626
|
-
|
|
14637
|
+
style,
|
|
14638
|
+
...rest
|
|
14639
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14627
14640
|
className: b2("left")
|
|
14628
14641
|
}, /* @__PURE__ */ React__default.createElement("img", {
|
|
14629
14642
|
src: imgUrl,
|
|
@@ -14651,6 +14664,199 @@ const Card = (props) => {
|
|
|
14651
14664
|
className: b2("right__shop__name")
|
|
14652
14665
|
}, shopName), footerTpl)));
|
|
14653
14666
|
};
|
|
14654
|
-
Card.defaultProps = defaultProps;
|
|
14667
|
+
Card.defaultProps = defaultProps$3;
|
|
14655
14668
|
Card.displayName = "NutCard";
|
|
14656
|
-
|
|
14669
|
+
const defaultProps$2 = {
|
|
14670
|
+
className: "",
|
|
14671
|
+
date: "",
|
|
14672
|
+
curKey: 0
|
|
14673
|
+
};
|
|
14674
|
+
const TimePannel = (props) => {
|
|
14675
|
+
useConfig();
|
|
14676
|
+
const { children, className, date, curKey, change } = {
|
|
14677
|
+
...defaultProps$2,
|
|
14678
|
+
...props
|
|
14679
|
+
};
|
|
14680
|
+
const b2 = cn("timepannel");
|
|
14681
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14682
|
+
className: `${b2()} ${className || ""}`,
|
|
14683
|
+
onClick: () => change(curKey)
|
|
14684
|
+
}, date);
|
|
14685
|
+
};
|
|
14686
|
+
TimePannel.defaultProps = defaultProps$2;
|
|
14687
|
+
TimePannel.displayName = "NutTimePannel";
|
|
14688
|
+
const defaultProps$1 = {
|
|
14689
|
+
className: "",
|
|
14690
|
+
currentKey: 0,
|
|
14691
|
+
currentTime: [],
|
|
14692
|
+
times: [],
|
|
14693
|
+
select: () => null
|
|
14694
|
+
};
|
|
14695
|
+
const TimeDetail = (props) => {
|
|
14696
|
+
useConfig();
|
|
14697
|
+
const { children, times, className, currentKey, currentTime, select } = {
|
|
14698
|
+
...defaultProps$1,
|
|
14699
|
+
...props
|
|
14700
|
+
};
|
|
14701
|
+
const b2 = cn("timedetail");
|
|
14702
|
+
const [renderData, setRenderData] = useState([]);
|
|
14703
|
+
useEffect(() => {
|
|
14704
|
+
const currentData = times.find((timesItem) => String(timesItem.key) === String(currentKey));
|
|
14705
|
+
const renderData2 = currentData ? currentData.list : [];
|
|
14706
|
+
setRenderData(renderData2);
|
|
14707
|
+
}, [times, currentKey]);
|
|
14708
|
+
const handleTime = (time) => {
|
|
14709
|
+
select(time);
|
|
14710
|
+
};
|
|
14711
|
+
const getDetailClass = (item) => {
|
|
14712
|
+
let initClass = "nut-timedetail__item";
|
|
14713
|
+
const curTimeData = currentTime.find((item2) => String(item2.key) === String(currentKey));
|
|
14714
|
+
if (curTimeData && curTimeData.list && curTimeData.list.includes(item)) {
|
|
14715
|
+
initClass += " nut-timedetail__item-active";
|
|
14716
|
+
}
|
|
14717
|
+
return initClass;
|
|
14718
|
+
};
|
|
14719
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14720
|
+
className: `${b2()} ${className || ""}`
|
|
14721
|
+
}, renderData.map((item, index2) => /* @__PURE__ */ React__default.createElement("span", {
|
|
14722
|
+
className: getDetailClass(item),
|
|
14723
|
+
key: item,
|
|
14724
|
+
onClick: () => handleTime(item)
|
|
14725
|
+
}, item)));
|
|
14726
|
+
};
|
|
14727
|
+
TimeDetail.defaultProps = defaultProps$1;
|
|
14728
|
+
TimeDetail.displayName = "NutTimeDetail";
|
|
14729
|
+
const defaultProps = {
|
|
14730
|
+
className: "",
|
|
14731
|
+
visible: false,
|
|
14732
|
+
height: "20%",
|
|
14733
|
+
multiple: false,
|
|
14734
|
+
currentKey: 0,
|
|
14735
|
+
currentTime: [],
|
|
14736
|
+
title: "\u53D6\u4EF6\u65F6\u95F4",
|
|
14737
|
+
dates: [],
|
|
14738
|
+
times: []
|
|
14739
|
+
};
|
|
14740
|
+
const TimeSelect = (props) => {
|
|
14741
|
+
useConfig();
|
|
14742
|
+
const {
|
|
14743
|
+
children,
|
|
14744
|
+
visible,
|
|
14745
|
+
className,
|
|
14746
|
+
height,
|
|
14747
|
+
title,
|
|
14748
|
+
currentKey,
|
|
14749
|
+
currentTime,
|
|
14750
|
+
dates,
|
|
14751
|
+
times,
|
|
14752
|
+
multiple,
|
|
14753
|
+
select,
|
|
14754
|
+
pannelChange,
|
|
14755
|
+
timeChange
|
|
14756
|
+
} = {
|
|
14757
|
+
...defaultProps,
|
|
14758
|
+
...props
|
|
14759
|
+
};
|
|
14760
|
+
const [activeKey, setActiveKey] = useState(currentKey);
|
|
14761
|
+
const [activeTime, setActiveTime] = useState(currentTime.length ? currentTime : [
|
|
14762
|
+
{
|
|
14763
|
+
key: currentKey,
|
|
14764
|
+
list: []
|
|
14765
|
+
}
|
|
14766
|
+
]);
|
|
14767
|
+
const [popVisible, setPopVisible] = useState(visible);
|
|
14768
|
+
const popStyle = {
|
|
14769
|
+
width: "100%",
|
|
14770
|
+
height
|
|
14771
|
+
};
|
|
14772
|
+
const b2 = cn("timeselect");
|
|
14773
|
+
const closeFun = () => {
|
|
14774
|
+
select && select(activeTime);
|
|
14775
|
+
};
|
|
14776
|
+
const handleSelectTime = (time) => {
|
|
14777
|
+
let curTimeData = {};
|
|
14778
|
+
let curIndex = -1;
|
|
14779
|
+
for (let i = 0; i < activeTime.length; i++) {
|
|
14780
|
+
if (String(activeTime[i].key) === String(activeKey)) {
|
|
14781
|
+
curTimeData = activeTime[i];
|
|
14782
|
+
curIndex = i;
|
|
14783
|
+
break;
|
|
14784
|
+
}
|
|
14785
|
+
}
|
|
14786
|
+
const curTimeIndex = curTimeData.list.findIndex((item) => String(item) === String(time));
|
|
14787
|
+
if (curTimeIndex === -1) {
|
|
14788
|
+
curTimeData.list.push(time);
|
|
14789
|
+
} else {
|
|
14790
|
+
curTimeData.list.splice(curTimeIndex, 1);
|
|
14791
|
+
}
|
|
14792
|
+
const resultTimeData = [...activeTime];
|
|
14793
|
+
resultTimeData.splice(curIndex, 1, curTimeData);
|
|
14794
|
+
setActiveTime(resultTimeData);
|
|
14795
|
+
timeChange && timeChange(time, resultTimeData);
|
|
14796
|
+
};
|
|
14797
|
+
const handleChange = (pannelKey) => {
|
|
14798
|
+
const resultTimeData = [...activeTime];
|
|
14799
|
+
if (String(pannelKey) !== String(activeKey)) {
|
|
14800
|
+
setActiveKey == null ? void 0 : setActiveKey(pannelKey);
|
|
14801
|
+
if (multiple) {
|
|
14802
|
+
const curTimeDataIndex = activeTime.findIndex((item) => String(item.key) === String(pannelKey));
|
|
14803
|
+
if (curTimeDataIndex === -1) {
|
|
14804
|
+
resultTimeData.push({
|
|
14805
|
+
key: pannelKey,
|
|
14806
|
+
list: []
|
|
14807
|
+
});
|
|
14808
|
+
setActiveTime(resultTimeData);
|
|
14809
|
+
}
|
|
14810
|
+
} else {
|
|
14811
|
+
setActiveTime([
|
|
14812
|
+
{
|
|
14813
|
+
key: pannelKey,
|
|
14814
|
+
list: []
|
|
14815
|
+
}
|
|
14816
|
+
]);
|
|
14817
|
+
}
|
|
14818
|
+
}
|
|
14819
|
+
pannelChange && pannelChange(pannelKey, resultTimeData);
|
|
14820
|
+
};
|
|
14821
|
+
const getTimePannelClass = (dataItem) => {
|
|
14822
|
+
if (String(dataItem["pannel-key"]) === String(activeKey)) {
|
|
14823
|
+
return "nut-timepannel-active";
|
|
14824
|
+
}
|
|
14825
|
+
return "";
|
|
14826
|
+
};
|
|
14827
|
+
useEffect(() => {
|
|
14828
|
+
setPopVisible(visible);
|
|
14829
|
+
}, [visible]);
|
|
14830
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Popup, {
|
|
14831
|
+
closeable: true,
|
|
14832
|
+
round: true,
|
|
14833
|
+
visible: popVisible,
|
|
14834
|
+
position: "bottom",
|
|
14835
|
+
style: popStyle,
|
|
14836
|
+
onClose: () => {
|
|
14837
|
+
closeFun();
|
|
14838
|
+
}
|
|
14839
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14840
|
+
className: `${b2()} ${className || ""}`
|
|
14841
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14842
|
+
className: "nut-timeselect__title"
|
|
14843
|
+
}, title), /* @__PURE__ */ React__default.createElement("div", {
|
|
14844
|
+
className: "nut-timeselect__content"
|
|
14845
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14846
|
+
className: "nut-timeselect__content-left"
|
|
14847
|
+
}, dates.map((dataItem, index2) => /* @__PURE__ */ React__default.createElement(TimePannel, {
|
|
14848
|
+
date: dataItem.date,
|
|
14849
|
+
className: getTimePannelClass(dataItem),
|
|
14850
|
+
key: String(dataItem["pannel-key"] || index2),
|
|
14851
|
+
curKey: String(dataItem["pannel-key"] || index2),
|
|
14852
|
+
change: handleChange
|
|
14853
|
+
}))), /* @__PURE__ */ React__default.createElement(TimeDetail, {
|
|
14854
|
+
times,
|
|
14855
|
+
currentKey: String(activeKey),
|
|
14856
|
+
currentTime: activeTime,
|
|
14857
|
+
select: handleSelectTime
|
|
14858
|
+
})))));
|
|
14859
|
+
};
|
|
14860
|
+
TimeSelect.defaultProps = defaultProps;
|
|
14861
|
+
TimeSelect.displayName = "NutTimeSelect";
|
|
14862
|
+
export { ActionSheet, Address, AnimatingNumbers, Avatar, AvatarGroup, BackTop, Badge, Barrage, Button, Calendar, CalendarItem, Card, Cell, CellGroup, Checkbox, CheckboxGroup, CircleProgress, Col, Collapse, CollapseItem, ConfigProvider, CountDown, DatePicker, Dialog, Divider, Drag, Elevator, Empty, FixedNav, Icon, Indicator, Infiniteloading, Input, InputNumber, Layout, NavBar, NoticeBar, Notify, Overlay, Pagination, Picker, Popover, Popup, Price, Radio, RadioGroup, Range, Rate, Row, ShortPassword, Signature, Skeleton, Step, Steps, Swiper, SwiperItem, Switch, TabPane, Tabbar, TabbarItem, Tabs, Tag, TextArea, TimeDetail, TimePannel, TimeSelect, Toast, Uploader, VirtualList };
|