@nutui/nutui-react-taro 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +3 -2
- package/dist/esm/ActionSheet.js +3 -3
- package/dist/esm/Address.js +3 -3
- package/dist/esm/Audio.js +6 -7
- package/dist/esm/Avatar.js +2 -2
- package/dist/esm/BackTop.js +2 -2
- package/dist/esm/Badge.js +2 -2
- package/dist/esm/Barrage.js +2 -2
- package/dist/esm/Button.js +2 -2
- package/dist/esm/Calendar.js +3 -3
- package/dist/esm/Card.js +3 -3
- package/dist/esm/Cascader.js +4 -4
- package/dist/esm/Cell.js +2 -2
- package/dist/esm/Checkbox.js +2 -2
- package/dist/esm/CircleProgress.js +2 -2
- package/dist/esm/CollapseItem.js +2 -2
- package/dist/esm/DatePicker.js +4 -4
- package/dist/esm/Dialog.js +3 -3
- package/dist/esm/FixedNav.js +2 -2
- package/dist/esm/GridItem.js +2 -2
- package/dist/esm/ImagePreview.js +5 -5
- package/dist/esm/Infiniteloading.js +4 -2
- package/dist/esm/Input.js +2 -2
- package/dist/esm/InputNumber.js +2 -2
- package/dist/esm/Menu.js +2 -2
- package/dist/esm/MenuItem.js +2 -2
- package/dist/esm/NavBar.js +2 -2
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/Notify.js +2 -3
- package/dist/esm/NumberKeyboard.js +3 -3
- package/dist/esm/Picker.js +3 -3
- package/dist/esm/Popover.js +2 -2
- package/dist/esm/Popup.js +2 -2
- package/dist/esm/Progress.js +2 -2
- package/dist/esm/PullToRefresh.js +2 -2
- package/dist/esm/Radio.js +2 -2
- package/dist/esm/Range.js +3 -5
- package/dist/esm/Rate.js +2 -2
- package/dist/esm/SearchBar.js +2 -2
- package/dist/esm/ShortPassword.js +3 -3
- package/dist/esm/SideNavBar.js +3 -3
- package/dist/esm/Signature.js +3 -3
- package/dist/esm/Skeleton.js +3 -3
- package/dist/esm/Step.js +2 -2
- package/dist/esm/Sticky/style/index.js +2 -0
- package/dist/esm/Sticky.js +5 -0
- package/dist/esm/Swiper.js +3 -3
- package/dist/esm/TabbarItem.js +2 -2
- package/dist/esm/Table.js +2 -2
- package/dist/esm/Tabs.js +2 -2
- package/dist/esm/Tag.js +2 -2
- package/dist/esm/TimeSelect.js +3 -3
- package/dist/esm/Toast.js +2 -4
- package/dist/esm/Uploader.js +8 -4
- package/dist/esm/{actionsheet.taro-08b7eab2.js → actionsheet.taro-360d8d34.js} +1 -1
- package/dist/esm/{address.taro-5f8dbfc3.js → address.taro-7540c626.js} +8 -6
- package/dist/esm/{audio.taro-327472dc.js → audio.taro-ab2528b2.js} +105 -148
- package/dist/esm/{avatar.taro-766690a4.js → avatar.taro-ec620cdd.js} +5 -3
- package/dist/esm/{backtop.taro-c414da6c.js → backtop.taro-aa8b2bc5.js} +5 -3
- package/dist/esm/{badge.taro-351d0088.js → badge.taro-38684262.js} +5 -3
- package/dist/esm/{barrage.taro-efac8422.js → barrage.taro-d86c367a.js} +3 -10
- package/dist/esm/{button.taro-7074924f.js → button.taro-a9ebb937.js} +7 -5
- package/dist/esm/{calendar.taro-156a74c0.js → calendar.taro-438940bd.js} +1 -1
- package/dist/esm/{card.taro-f81f1b5c.js → card.taro-1bc35ebe.js} +1 -1
- package/dist/esm/{cascader.taro-39402f43.js → cascader.taro-35387092.js} +2 -2
- package/dist/esm/{cell.taro-075998e0.js → cell.taro-a4c3bb7b.js} +7 -5
- package/dist/esm/{checkbox.taro-62677b5e.js → checkbox.taro-104557c1.js} +2 -2
- package/dist/esm/{circleprogress.taro-1a38e1c6.js → circleprogress.taro-3c89a157.js} +85 -51
- package/dist/esm/{collapseitem-246e1699.js → collapseitem-75843a5e.js} +13 -9
- package/dist/esm/{datepicker.taro-e0e58f39.js → datepicker.taro-1acec61f.js} +1 -1
- package/dist/esm/{dialog.taro-7e9249e7.js → dialog.taro-54c67e08.js} +8 -6
- package/dist/esm/{fixednav.taro-9ee2dbea.js → fixednav.taro-582322a1.js} +5 -3
- package/dist/esm/{griditem.taro-a2ad1edd.js → griditem.taro-866cd288.js} +5 -3
- package/dist/esm/{imagepreview.taro-99659d6a.js → imagepreview.taro-3f1c7638.js} +2 -2
- package/dist/esm/{infiniteloading.taro-aa47eb1e.js → infiniteloading.taro-9701755f.js} +84 -113
- package/dist/esm/{input.taro-32fac7f7.js → input.taro-2453d7c4.js} +9 -7
- package/dist/esm/{inputnumber.taro-83d108b3.js → inputnumber.taro-0cf7c1b7.js} +7 -5
- package/dist/esm/{menu.taro-8330048e.js → menu.taro-9345dcfd.js} +5 -3
- package/dist/esm/{menuitem.taro-818c9e83.js → menuitem.taro-fc0961b7.js} +31 -14
- package/dist/esm/{navbar.taro-05d293bb.js → navbar.taro-c931c078.js} +7 -5
- package/dist/esm/{noticebar.taro-6845f9ab.js → noticebar.taro-1fa04a96.js} +9 -7
- package/dist/esm/{notify.taro-22b8f4cd.js → notify.taro-0d9cfb07.js} +38 -5
- package/dist/esm/{numberkeyboard.taro-6ff18124.js → numberkeyboard.taro-53c350b8.js} +1 -1
- package/dist/esm/nutui-react.es.js +54 -53
- package/dist/esm/{picker.taro-a3f311a0.js → picker.taro-6a4dad23.js} +1 -1
- package/dist/esm/{popover.taro-604c3116.js → popover.taro-eddd0bd2.js} +5 -3
- package/dist/esm/{popup.taro-d74c3422.js → popup.taro-33d0bbc8.js} +5 -3
- package/dist/esm/{progress.taro-57e1a455.js → progress.taro-623bc807.js} +5 -3
- package/dist/esm/{pulltorefresh.taro-8846f019.js → pulltorefresh.taro-e66c78ad.js} +0 -0
- package/dist/esm/{radio.taro-64546f70.js → radio.taro-95d43860.js} +5 -3
- package/dist/esm/{range.taro-ef3b30f0.js → range.taro-141a0163.js} +35 -12
- package/dist/esm/{rate.taro-0119c0e9.js → rate.taro-5077b962.js} +7 -5
- package/dist/esm/{searchbar.taro-2fff1f66.js → searchbar.taro-f134fb96.js} +5 -3
- package/dist/esm/{shortpassword.taro-d39e038d.js → shortpassword.taro-2e96ca22.js} +6 -4
- package/dist/esm/{sidenavbar.taro-48b136b4.js → sidenavbar.taro-87f056cd.js} +1 -1
- package/dist/esm/{signature.taro-3dbc7030.js → signature.taro-a9286cd1.js} +1 -1
- package/dist/esm/{skeleton.taro-112de52a.js → skeleton.taro-b9ff84b9.js} +1 -1
- package/dist/esm/{step.taro-8c2ba0bb.js → step.taro-f1057500.js} +5 -3
- package/dist/esm/sticky.taro-30d4e453.js +23 -0
- package/dist/esm/{swiper.taro-448cd0ad.js → swiper.taro-58ed323b.js} +4 -4
- package/dist/esm/{tabbaritem.taro-8c0a0a3b.js → tabbaritem.taro-94cd62c2.js} +5 -3
- package/dist/esm/{table.taro-04f9ec51.js → table.taro-7ac89a6c.js} +5 -3
- package/dist/esm/{tabs.taro-7bb22cb5.js → tabs.taro-86186dff.js} +12 -13
- package/dist/esm/{tag.taro-81dcc92d.js → tag.taro-95d7f5c2.js} +5 -3
- package/dist/esm/{timeselect.taro-5b6ed203.js → timeselect.taro-73796bfc.js} +1 -1
- package/dist/esm/toast.taro-cd22a0d7.js +167 -0
- package/dist/esm/types/src/packages/audio/audio.taro.d.ts +13 -14
- package/dist/esm/types/src/packages/button/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/collapseitem/collapseitem.d.ts +1 -0
- package/dist/esm/types/src/packages/drag/drag.d.ts +1 -1
- package/dist/esm/types/src/packages/drag/drag.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/fixednav/fixednav.d.ts +1 -1
- package/dist/esm/types/src/packages/fixednav/fixednav.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/griditem/griditem.d.ts +1 -1
- package/dist/esm/types/src/packages/griditem/griditem.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/infiniteloading/infiniteloading.d.ts +3 -3
- package/dist/esm/types/src/packages/infiniteloading/infiniteloading.taro.d.ts +4 -6
- package/dist/esm/types/src/packages/input/input.d.ts +1 -1
- package/dist/esm/types/src/packages/input/input.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/menuitem/menuitem.d.ts +1 -1
- package/dist/esm/types/src/packages/menuitem/menuitem.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/nutui.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/nutui.react.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.react.scss.d.ts +1 -0
- package/dist/esm/types/src/packages/nutui.react.taro.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/popover/popover.d.ts +1 -1
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/progress/progress.d.ts +1 -1
- package/dist/esm/types/src/packages/progress/progress.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/radio/radio.d.ts +1 -1
- package/dist/esm/types/src/packages/radio/radio.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/sticky/__test__/sticky.spec.d.ts +1 -0
- package/dist/esm/types/src/packages/sticky/demo.d.ts +3 -0
- package/dist/esm/types/src/packages/sticky/index.d.ts +2 -0
- package/dist/esm/types/src/packages/sticky/index.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/sticky/sticky.d.ts +13 -0
- package/dist/esm/types/src/packages/sticky/sticky.taro.d.ts +4 -0
- package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -1
- package/dist/esm/types/src/packages/tabs/tabs.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/toast/toast.taro.d.ts +11 -17
- package/dist/esm/types/src/packages/uploader/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/uploader/upload.d.ts +4 -0
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +16 -12
- package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +39 -19
- package/dist/esm/types/src/utils/date.d.ts +1 -1
- package/dist/esm/types/src/utils/useWatch.d.ts +6 -0
- package/dist/esm/{uploader.taro-4fd5dd3c.js → uploader.taro-6184abe7.js} +181 -131
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +1357 -1235
- package/dist/nutui.react.umd.js +1356 -1233
- package/dist/packages/barrage/barrage.scss +7 -2
- package/dist/packages/circleprogress/circleprogress.scss +3 -0
- package/dist/packages/sticky/sticky.scss +0 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/types/index.d.ts +75 -64
- package/dist/types/nutui.taro.react.build.ts +3 -1
- package/package.json +10 -5
- package/dist/esm/render-4a3856cb.js +0 -32
- package/dist/esm/toast.taro-d4ecd6af.js +0 -300
package/dist/nutui.react.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react-taro v1.3.
|
|
2
|
+
* @nutui/nutui-react-taro v1.3.4-beta.0 Wed Sep 21 2022 14:34:17 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -35,6 +35,21 @@
|
|
|
35
35
|
var Taro__default = /* @__PURE__ */ _interopDefaultLegacy(Taro);
|
|
36
36
|
var ReactDOM__default = /* @__PURE__ */ _interopDefaultLegacy(ReactDOM);
|
|
37
37
|
var ReactDOM__namespace = /* @__PURE__ */ _interopNamespace(ReactDOM);
|
|
38
|
+
function getAugmentedNamespace(n2) {
|
|
39
|
+
if (n2.__esModule)
|
|
40
|
+
return n2;
|
|
41
|
+
var a = Object.defineProperty({}, "__esModule", { value: true });
|
|
42
|
+
Object.keys(n2).forEach(function(k2) {
|
|
43
|
+
var d2 = Object.getOwnPropertyDescriptor(n2, k2);
|
|
44
|
+
Object.defineProperty(a, k2, d2.get ? d2 : {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function() {
|
|
47
|
+
return n2[k2];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
return a;
|
|
52
|
+
}
|
|
38
53
|
var classname = { exports: {} };
|
|
39
54
|
var classname_production_min = {};
|
|
40
55
|
function r$1(r2) {
|
|
@@ -73,7 +88,7 @@
|
|
|
73
88
|
classname.exports = classname_production_min;
|
|
74
89
|
}
|
|
75
90
|
const cn = classname.exports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
76
|
-
const defaultProps$
|
|
91
|
+
const defaultProps$1q = {
|
|
77
92
|
name: "",
|
|
78
93
|
size: "",
|
|
79
94
|
classPrefix: "nut-icon",
|
|
@@ -101,7 +116,7 @@
|
|
|
101
116
|
onClick,
|
|
102
117
|
...rest
|
|
103
118
|
} = {
|
|
104
|
-
...defaultProps$
|
|
119
|
+
...defaultProps$1q,
|
|
105
120
|
...props
|
|
106
121
|
};
|
|
107
122
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
@@ -135,13 +150,13 @@
|
|
|
135
150
|
children
|
|
136
151
|
);
|
|
137
152
|
}
|
|
138
|
-
Icon$1.defaultProps = defaultProps$
|
|
153
|
+
Icon$1.defaultProps = defaultProps$1q;
|
|
139
154
|
Icon$1.displayName = "NutIcon";
|
|
140
155
|
const ComponentDefaults = {
|
|
141
156
|
iconClassPrefix: "nut-icon",
|
|
142
157
|
iconFontClassName: "nutui-iconfont"
|
|
143
158
|
};
|
|
144
|
-
const defaultProps$
|
|
159
|
+
const defaultProps$1p = {
|
|
145
160
|
...ComponentDefaults,
|
|
146
161
|
className: "",
|
|
147
162
|
color: "",
|
|
@@ -173,9 +188,11 @@
|
|
|
173
188
|
onClick,
|
|
174
189
|
className,
|
|
175
190
|
style,
|
|
191
|
+
iconClassPrefix,
|
|
192
|
+
iconFontClassName,
|
|
176
193
|
...rest
|
|
177
194
|
} = {
|
|
178
|
-
...defaultProps$
|
|
195
|
+
...defaultProps$1p,
|
|
179
196
|
...props
|
|
180
197
|
};
|
|
181
198
|
const getStyle = React.useCallback(() => {
|
|
@@ -243,16 +260,16 @@
|
|
|
243
260
|
className: "nut-button__warp",
|
|
244
261
|
style: getStyle()
|
|
245
262
|
}, loading && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
246
|
-
classPrefix:
|
|
247
|
-
fontClassName:
|
|
263
|
+
classPrefix: iconClassPrefix,
|
|
264
|
+
fontClassName: iconFontClassName,
|
|
248
265
|
name: "loading"
|
|
249
266
|
}), !loading && icon ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
250
|
-
classPrefix:
|
|
251
|
-
fontClassName:
|
|
267
|
+
classPrefix: iconClassPrefix,
|
|
268
|
+
fontClassName: iconFontClassName,
|
|
252
269
|
name: icon
|
|
253
270
|
}) : "", children));
|
|
254
271
|
};
|
|
255
|
-
Button$1.defaultProps = defaultProps$
|
|
272
|
+
Button$1.defaultProps = defaultProps$1p;
|
|
256
273
|
Button$1.displayName = "NutButton";
|
|
257
274
|
function _setPrototypeOf(o, p2) {
|
|
258
275
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
@@ -1023,7 +1040,7 @@
|
|
|
1023
1040
|
* This source code is licensed under the MIT license found in the
|
|
1024
1041
|
* LICENSE file in the root directory of this source tree.
|
|
1025
1042
|
*/
|
|
1026
|
-
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;
|
|
1043
|
+
var b$1 = "function" === typeof Symbol && Symbol.for, c = b$1 ? Symbol.for("react.element") : 60103, d = b$1 ? Symbol.for("react.portal") : 60106, e = b$1 ? Symbol.for("react.fragment") : 60107, f = b$1 ? Symbol.for("react.strict_mode") : 60108, g = b$1 ? Symbol.for("react.profiler") : 60114, h = b$1 ? Symbol.for("react.provider") : 60109, k = b$1 ? Symbol.for("react.context") : 60110, l = b$1 ? Symbol.for("react.async_mode") : 60111, m = b$1 ? Symbol.for("react.concurrent_mode") : 60111, n = b$1 ? Symbol.for("react.forward_ref") : 60112, p = b$1 ? Symbol.for("react.suspense") : 60113, q = b$1 ? Symbol.for("react.suspense_list") : 60120, r = b$1 ? Symbol.for("react.memo") : 60115, t = b$1 ? Symbol.for("react.lazy") : 60116, v = b$1 ? Symbol.for("react.block") : 60121, w = b$1 ? Symbol.for("react.fundamental") : 60117, x = b$1 ? Symbol.for("react.responder") : 60118, y = b$1 ? Symbol.for("react.scope") : 60119;
|
|
1027
1044
|
function z(a) {
|
|
1028
1045
|
if ("object" === typeof a && null !== a) {
|
|
1029
1046
|
var u = a.$$typeof;
|
|
@@ -1470,7 +1487,7 @@
|
|
|
1470
1487
|
function useHistory() {
|
|
1471
1488
|
return useContext(historyContext);
|
|
1472
1489
|
}
|
|
1473
|
-
const defaultProps$
|
|
1490
|
+
const defaultProps$1o = {
|
|
1474
1491
|
...ComponentDefaults,
|
|
1475
1492
|
title: null,
|
|
1476
1493
|
subTitle: null,
|
|
@@ -1509,9 +1526,11 @@
|
|
|
1509
1526
|
className,
|
|
1510
1527
|
iconSlot,
|
|
1511
1528
|
linkSlot,
|
|
1529
|
+
iconClassPrefix,
|
|
1530
|
+
iconFontClassName,
|
|
1512
1531
|
...rest
|
|
1513
1532
|
} = {
|
|
1514
|
-
...defaultProps$
|
|
1533
|
+
...defaultProps$1o,
|
|
1515
1534
|
...props
|
|
1516
1535
|
};
|
|
1517
1536
|
const b2 = cn("cell");
|
|
@@ -1546,8 +1565,8 @@
|
|
|
1546
1565
|
}, children || /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, icon || iconSlot ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
1547
1566
|
className: b2("icon")
|
|
1548
1567
|
}, iconSlot || (icon ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
1549
|
-
classPrefix:
|
|
1550
|
-
fontClassName:
|
|
1568
|
+
classPrefix: iconClassPrefix,
|
|
1569
|
+
fontClassName: iconFontClassName,
|
|
1551
1570
|
name: icon,
|
|
1552
1571
|
className: "icon"
|
|
1553
1572
|
}) : null)) : null, title || subTitle ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -1562,15 +1581,15 @@
|
|
|
1562
1581
|
}),
|
|
1563
1582
|
style: styles
|
|
1564
1583
|
}, desc) : null, !linkSlot && (isLink || to2) ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
1565
|
-
classPrefix:
|
|
1566
|
-
fontClassName:
|
|
1584
|
+
classPrefix: iconClassPrefix,
|
|
1585
|
+
fontClassName: iconFontClassName,
|
|
1567
1586
|
name: "right",
|
|
1568
1587
|
className: b2("link")
|
|
1569
1588
|
}) : linkSlot));
|
|
1570
1589
|
};
|
|
1571
|
-
Cell.defaultProps = defaultProps$
|
|
1590
|
+
Cell.defaultProps = defaultProps$1o;
|
|
1572
1591
|
Cell.displayName = "NutCell";
|
|
1573
|
-
const defaultProps$
|
|
1592
|
+
const defaultProps$1n = {
|
|
1574
1593
|
title: "",
|
|
1575
1594
|
desc: "",
|
|
1576
1595
|
titleSlot: null,
|
|
@@ -1579,7 +1598,7 @@
|
|
|
1579
1598
|
};
|
|
1580
1599
|
const CellGroup = (props) => {
|
|
1581
1600
|
const { children, classPrefix, title, desc, titleSlot, descSlot } = {
|
|
1582
|
-
...defaultProps$
|
|
1601
|
+
...defaultProps$1n,
|
|
1583
1602
|
...props
|
|
1584
1603
|
};
|
|
1585
1604
|
const b2 = cn("cell-group");
|
|
@@ -1593,13 +1612,13 @@
|
|
|
1593
1612
|
className: b2("wrap")
|
|
1594
1613
|
}, children));
|
|
1595
1614
|
};
|
|
1596
|
-
CellGroup.defaultProps = defaultProps$
|
|
1615
|
+
CellGroup.defaultProps = defaultProps$1n;
|
|
1597
1616
|
CellGroup.displayName = "NutCellGroup";
|
|
1598
1617
|
var classnames = { exports: {} };
|
|
1599
1618
|
/*!
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1619
|
+
Copyright (c) 2018 Jed Watson.
|
|
1620
|
+
Licensed under the MIT License (MIT), see
|
|
1621
|
+
http://jedwatson.github.io/classnames
|
|
1603
1622
|
*/
|
|
1604
1623
|
(function(module2) {
|
|
1605
1624
|
(function() {
|
|
@@ -1621,14 +1640,14 @@
|
|
|
1621
1640
|
}
|
|
1622
1641
|
}
|
|
1623
1642
|
} else if (argType === "object") {
|
|
1624
|
-
if (arg.toString
|
|
1625
|
-
for (var key in arg) {
|
|
1626
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1627
|
-
classes.push(key);
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
} else {
|
|
1643
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
1631
1644
|
classes.push(arg.toString());
|
|
1645
|
+
continue;
|
|
1646
|
+
}
|
|
1647
|
+
for (var key in arg) {
|
|
1648
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1649
|
+
classes.push(key);
|
|
1650
|
+
}
|
|
1632
1651
|
}
|
|
1633
1652
|
}
|
|
1634
1653
|
}
|
|
@@ -2146,7 +2165,7 @@
|
|
|
2146
2165
|
};
|
|
2147
2166
|
CSSTransition.propTypes = {};
|
|
2148
2167
|
var CSSTransition$1 = CSSTransition;
|
|
2149
|
-
const defaultProps$
|
|
2168
|
+
const defaultProps$1m = {
|
|
2150
2169
|
...ComponentDefaults,
|
|
2151
2170
|
position: "center",
|
|
2152
2171
|
transition: "",
|
|
@@ -2204,7 +2223,9 @@
|
|
|
2204
2223
|
onClickCloseIcon,
|
|
2205
2224
|
onOpened,
|
|
2206
2225
|
onClosed,
|
|
2207
|
-
onClick
|
|
2226
|
+
onClick,
|
|
2227
|
+
iconClassPrefix,
|
|
2228
|
+
iconFontClassName
|
|
2208
2229
|
} = props;
|
|
2209
2230
|
const [index2, setIndex] = React.useState(zIndex || _zIndex);
|
|
2210
2231
|
const [innerVisible, setInnerVisible] = React.useState(visible);
|
|
@@ -2303,8 +2324,8 @@
|
|
|
2303
2324
|
className: closeClasses,
|
|
2304
2325
|
onClick: onHandleClickCloseIcon
|
|
2305
2326
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2306
|
-
classPrefix:
|
|
2307
|
-
fontClassName:
|
|
2327
|
+
classPrefix: iconClassPrefix,
|
|
2328
|
+
fontClassName: iconFontClassName,
|
|
2308
2329
|
name: closeIcon,
|
|
2309
2330
|
size: "12px"
|
|
2310
2331
|
})) : ""));
|
|
@@ -2330,7 +2351,7 @@
|
|
|
2330
2351
|
}, [position]);
|
|
2331
2352
|
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, renderToContainer(teleport, renderNode()));
|
|
2332
2353
|
};
|
|
2333
|
-
Popup.defaultProps = defaultProps$
|
|
2354
|
+
Popup.defaultProps = defaultProps$1m;
|
|
2334
2355
|
Popup.displayName = "NutPopup";
|
|
2335
2356
|
const zhCN = {
|
|
2336
2357
|
save: "\u4FDD\u5B58",
|
|
@@ -2457,7 +2478,7 @@
|
|
|
2457
2478
|
completeText: "\u5237\u65B0\u6210\u529F"
|
|
2458
2479
|
}
|
|
2459
2480
|
};
|
|
2460
|
-
const defaultProps$
|
|
2481
|
+
const defaultProps$1l = {
|
|
2461
2482
|
locale: zhCN
|
|
2462
2483
|
};
|
|
2463
2484
|
const defaultConfigRef$1 = {
|
|
@@ -2474,7 +2495,7 @@
|
|
|
2474
2495
|
};
|
|
2475
2496
|
const ConfigContext$1 = React.createContext(null);
|
|
2476
2497
|
const ConfigProvider = (props) => {
|
|
2477
|
-
const { children, ...config2 } = { ...defaultProps$
|
|
2498
|
+
const { children, ...config2 } = { ...defaultProps$1l, ...props };
|
|
2478
2499
|
const parentConfig = useConfig$1();
|
|
2479
2500
|
return /* @__PURE__ */ React__default["default"].createElement(ConfigContext$1.Provider, {
|
|
2480
2501
|
value: {
|
|
@@ -2483,25 +2504,25 @@
|
|
|
2483
2504
|
}
|
|
2484
2505
|
}, children);
|
|
2485
2506
|
};
|
|
2486
|
-
ConfigProvider.defaultProps = defaultProps$
|
|
2507
|
+
ConfigProvider.defaultProps = defaultProps$1l;
|
|
2487
2508
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
2488
|
-
const defaultProps$
|
|
2509
|
+
const defaultProps$1k = {};
|
|
2489
2510
|
const Layout = (props) => {
|
|
2490
|
-
({ ...defaultProps$
|
|
2511
|
+
({ ...defaultProps$1k, ...props });
|
|
2491
2512
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2492
2513
|
className: "nut-layout"
|
|
2493
2514
|
}, "Layout");
|
|
2494
2515
|
};
|
|
2495
|
-
Layout.defaultProps = defaultProps$
|
|
2516
|
+
Layout.defaultProps = defaultProps$1k;
|
|
2496
2517
|
Layout.displayName = "NutLayout";
|
|
2497
2518
|
const DataContext$2 = React.createContext({});
|
|
2498
|
-
const defaultProps$
|
|
2519
|
+
const defaultProps$1j = {
|
|
2499
2520
|
span: "24",
|
|
2500
2521
|
offset: "0",
|
|
2501
2522
|
gutter: "0"
|
|
2502
2523
|
};
|
|
2503
2524
|
const Col = (props) => {
|
|
2504
|
-
const { span, offset, children, onClick } = { ...defaultProps$
|
|
2525
|
+
const { span, offset, children, onClick } = { ...defaultProps$1j, ...props };
|
|
2505
2526
|
const [colName, setColName] = React.useState("");
|
|
2506
2527
|
const [colStyle, setColStyle] = React.useState({});
|
|
2507
2528
|
const { gutter } = React.useContext(DataContext$2);
|
|
@@ -2527,9 +2548,9 @@
|
|
|
2527
2548
|
}
|
|
2528
2549
|
}, children);
|
|
2529
2550
|
};
|
|
2530
|
-
Col.defaultProps = defaultProps$
|
|
2551
|
+
Col.defaultProps = defaultProps$1j;
|
|
2531
2552
|
Col.displayName = "NutCol";
|
|
2532
|
-
const defaultProps$
|
|
2553
|
+
const defaultProps$1i = {
|
|
2533
2554
|
type: "",
|
|
2534
2555
|
justify: "start",
|
|
2535
2556
|
align: "flex-start",
|
|
@@ -2538,7 +2559,7 @@
|
|
|
2538
2559
|
};
|
|
2539
2560
|
const Row = (props) => {
|
|
2540
2561
|
const { children, type, justify, align, wrap, gutter, onClick } = {
|
|
2541
|
-
...defaultProps$
|
|
2562
|
+
...defaultProps$1i,
|
|
2542
2563
|
...props
|
|
2543
2564
|
};
|
|
2544
2565
|
const prefixCls = "nut-row";
|
|
@@ -2572,9 +2593,9 @@
|
|
|
2572
2593
|
children
|
|
2573
2594
|
));
|
|
2574
2595
|
};
|
|
2575
|
-
Row.defaultProps = defaultProps$
|
|
2596
|
+
Row.defaultProps = defaultProps$1i;
|
|
2576
2597
|
Row.displayName = "NutRow";
|
|
2577
|
-
const defaultProps$
|
|
2598
|
+
const defaultProps$1h = {
|
|
2578
2599
|
contentPosition: "center",
|
|
2579
2600
|
dashed: false,
|
|
2580
2601
|
hairline: true,
|
|
@@ -2591,7 +2612,7 @@
|
|
|
2591
2612
|
direction,
|
|
2592
2613
|
...rest
|
|
2593
2614
|
} = {
|
|
2594
|
-
...defaultProps$
|
|
2615
|
+
...defaultProps$1h,
|
|
2595
2616
|
...props
|
|
2596
2617
|
};
|
|
2597
2618
|
const dividerBem = cn("divider");
|
|
@@ -2612,9 +2633,9 @@
|
|
|
2612
2633
|
...rest
|
|
2613
2634
|
}, children);
|
|
2614
2635
|
};
|
|
2615
|
-
Divider.defaultProps = defaultProps$
|
|
2636
|
+
Divider.defaultProps = defaultProps$1h;
|
|
2616
2637
|
Divider.displayName = "NutDivider";
|
|
2617
|
-
const defaultProps$
|
|
2638
|
+
const defaultProps$1g = {
|
|
2618
2639
|
columnNum: 4,
|
|
2619
2640
|
border: true,
|
|
2620
2641
|
gutter: 0,
|
|
@@ -2641,7 +2662,7 @@
|
|
|
2641
2662
|
iconColor,
|
|
2642
2663
|
className,
|
|
2643
2664
|
...rest
|
|
2644
|
-
} = { ...defaultProps$
|
|
2665
|
+
} = { ...defaultProps$1g, ...props };
|
|
2645
2666
|
const childrenDom = React__default["default"].Children.toArray(children);
|
|
2646
2667
|
const pxCheck2 = (value) => {
|
|
2647
2668
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
@@ -2680,9 +2701,9 @@
|
|
|
2680
2701
|
});
|
|
2681
2702
|
}));
|
|
2682
2703
|
};
|
|
2683
|
-
Grid.defaultProps = defaultProps$
|
|
2704
|
+
Grid.defaultProps = defaultProps$1g;
|
|
2684
2705
|
Grid.displayName = "NutGrid";
|
|
2685
|
-
const defaultProps$
|
|
2706
|
+
const defaultProps$1f = {
|
|
2686
2707
|
...ComponentDefaults,
|
|
2687
2708
|
text: "",
|
|
2688
2709
|
icon: "",
|
|
@@ -2716,8 +2737,13 @@
|
|
|
2716
2737
|
center,
|
|
2717
2738
|
reverse,
|
|
2718
2739
|
direction,
|
|
2740
|
+
iconClassPrefix,
|
|
2741
|
+
iconFontClassName,
|
|
2719
2742
|
...rest
|
|
2720
|
-
} = {
|
|
2743
|
+
} = {
|
|
2744
|
+
...defaultProps$1f,
|
|
2745
|
+
...props
|
|
2746
|
+
};
|
|
2721
2747
|
const b2 = cn("grid-item");
|
|
2722
2748
|
const pxCheck2 = (value) => {
|
|
2723
2749
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
@@ -2750,8 +2776,8 @@
|
|
|
2750
2776
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2751
2777
|
className: contentClass()
|
|
2752
2778
|
}, icon && isIconName() ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2753
|
-
classPrefix:
|
|
2754
|
-
fontClassName:
|
|
2779
|
+
classPrefix: iconClassPrefix,
|
|
2780
|
+
fontClassName: iconFontClassName,
|
|
2755
2781
|
name: icon,
|
|
2756
2782
|
size: iconSize || parentIconSize,
|
|
2757
2783
|
color: iconColor || parentIconColor
|
|
@@ -2759,9 +2785,32 @@
|
|
|
2759
2785
|
className: "nut-grid-item__text"
|
|
2760
2786
|
}, text), children && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children)));
|
|
2761
2787
|
};
|
|
2762
|
-
GridItem.defaultProps = defaultProps$
|
|
2788
|
+
GridItem.defaultProps = defaultProps$1f;
|
|
2763
2789
|
GridItem.displayName = "NutGridItem";
|
|
2764
|
-
const
|
|
2790
|
+
const defaultConfigRef = {
|
|
2791
|
+
current: {
|
|
2792
|
+
locale: zhCN
|
|
2793
|
+
}
|
|
2794
|
+
};
|
|
2795
|
+
const getDefaultConfig = () => {
|
|
2796
|
+
return defaultConfigRef.current;
|
|
2797
|
+
};
|
|
2798
|
+
const useConfig = () => {
|
|
2799
|
+
var _a;
|
|
2800
|
+
return (_a = React.useContext(ConfigContext)) != null ? _a : getDefaultConfig();
|
|
2801
|
+
};
|
|
2802
|
+
const ConfigContext = React.createContext(null);
|
|
2803
|
+
const defaultProps$1e = {};
|
|
2804
|
+
const Sticky = (props) => {
|
|
2805
|
+
useConfig();
|
|
2806
|
+
({ ...defaultProps$1e, ...props });
|
|
2807
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2808
|
+
className: "nut-sticky"
|
|
2809
|
+
}, "Sticky");
|
|
2810
|
+
};
|
|
2811
|
+
Sticky.defaultProps = defaultProps$1e;
|
|
2812
|
+
Sticky.displayName = "NutSticky";
|
|
2813
|
+
const defaultProps$1d = {
|
|
2765
2814
|
...ComponentDefaults,
|
|
2766
2815
|
title: "",
|
|
2767
2816
|
desc: "",
|
|
@@ -2793,9 +2842,11 @@
|
|
|
2793
2842
|
onClickTitle,
|
|
2794
2843
|
onClickIcon,
|
|
2795
2844
|
onClickBack,
|
|
2796
|
-
onClickRight
|
|
2845
|
+
onClickRight,
|
|
2846
|
+
iconClassPrefix,
|
|
2847
|
+
iconFontClassName
|
|
2797
2848
|
} = {
|
|
2798
|
-
...defaultProps$
|
|
2849
|
+
...defaultProps$1d,
|
|
2799
2850
|
...props
|
|
2800
2851
|
};
|
|
2801
2852
|
const b2 = cn("navbar");
|
|
@@ -2818,8 +2869,8 @@
|
|
|
2818
2869
|
className: `${b2("left")}`,
|
|
2819
2870
|
onClick: (e2) => onClickBack(e2)
|
|
2820
2871
|
}, leftShow && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2821
|
-
classPrefix:
|
|
2822
|
-
fontClassName:
|
|
2872
|
+
classPrefix: iconClassPrefix,
|
|
2873
|
+
fontClassName: iconFontClassName,
|
|
2823
2874
|
name: "left",
|
|
2824
2875
|
color: "#979797"
|
|
2825
2876
|
}), leftText && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -2835,8 +2886,8 @@
|
|
|
2835
2886
|
}, title), titIcon && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2836
2887
|
onClick: (e2) => onClickIcon(e2)
|
|
2837
2888
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2838
|
-
classPrefix:
|
|
2839
|
-
fontClassName:
|
|
2889
|
+
classPrefix: iconClassPrefix,
|
|
2890
|
+
fontClassName: iconFontClassName,
|
|
2840
2891
|
name: titIcon
|
|
2841
2892
|
})), slot.content);
|
|
2842
2893
|
};
|
|
@@ -2864,9 +2915,9 @@
|
|
|
2864
2915
|
className: `${b2("")}--placeholder`
|
|
2865
2916
|
}, renderWrapper()) : renderWrapper());
|
|
2866
2917
|
};
|
|
2867
|
-
NavBar.defaultProps = defaultProps$
|
|
2918
|
+
NavBar.defaultProps = defaultProps$1d;
|
|
2868
2919
|
NavBar.displayName = "NutNavBar";
|
|
2869
|
-
const defaultProps$
|
|
2920
|
+
const defaultProps$1c = {
|
|
2870
2921
|
...ComponentDefaults,
|
|
2871
2922
|
fixednavClass: "nut-fixednav",
|
|
2872
2923
|
activeText: "",
|
|
@@ -2892,8 +2943,13 @@
|
|
|
2892
2943
|
type,
|
|
2893
2944
|
slotList,
|
|
2894
2945
|
slotBtn,
|
|
2946
|
+
iconClassPrefix,
|
|
2947
|
+
iconFontClassName,
|
|
2895
2948
|
...rest
|
|
2896
|
-
} = {
|
|
2949
|
+
} = {
|
|
2950
|
+
...defaultProps$1c,
|
|
2951
|
+
...props
|
|
2952
|
+
};
|
|
2897
2953
|
const b2 = cn("fixednav");
|
|
2898
2954
|
const classes = classNames(
|
|
2899
2955
|
{
|
|
@@ -2938,17 +2994,17 @@
|
|
|
2938
2994
|
className: "nut-fixednav__btn",
|
|
2939
2995
|
onClick: () => onUpdateValue()
|
|
2940
2996
|
}, slotBtn || /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
2941
|
-
classPrefix:
|
|
2942
|
-
fontClassName:
|
|
2997
|
+
classPrefix: iconClassPrefix,
|
|
2998
|
+
fontClassName: iconFontClassName,
|
|
2943
2999
|
name: "left",
|
|
2944
3000
|
color: "#fff"
|
|
2945
3001
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2946
3002
|
className: "text"
|
|
2947
3003
|
}, visible ? activeText || locale.fixednav.activeText : unActiveText || locale.fixednav.unActiveText))));
|
|
2948
3004
|
};
|
|
2949
|
-
FixedNav.defaultProps = defaultProps$
|
|
3005
|
+
FixedNav.defaultProps = defaultProps$1c;
|
|
2950
3006
|
FixedNav.displayName = "NutFixedNav";
|
|
2951
|
-
const defaultProps$
|
|
3007
|
+
const defaultProps$1b = {
|
|
2952
3008
|
visible: 0,
|
|
2953
3009
|
bottom: false,
|
|
2954
3010
|
size: 20,
|
|
@@ -2973,7 +3029,7 @@
|
|
|
2973
3029
|
style,
|
|
2974
3030
|
tabSwitch
|
|
2975
3031
|
} = {
|
|
2976
|
-
...defaultProps$
|
|
3032
|
+
...defaultProps$1b,
|
|
2977
3033
|
...props
|
|
2978
3034
|
};
|
|
2979
3035
|
const b2 = cn("tabbar");
|
|
@@ -3008,9 +3064,9 @@
|
|
|
3008
3064
|
return React__default["default"].cloneElement(child, childProps);
|
|
3009
3065
|
}));
|
|
3010
3066
|
};
|
|
3011
|
-
Tabbar.defaultProps = defaultProps$
|
|
3067
|
+
Tabbar.defaultProps = defaultProps$1b;
|
|
3012
3068
|
Tabbar.displayName = "NutTabbar";
|
|
3013
|
-
const defaultProps$
|
|
3069
|
+
const defaultProps$1a = {
|
|
3014
3070
|
...ComponentDefaults,
|
|
3015
3071
|
dot: false,
|
|
3016
3072
|
size: "",
|
|
@@ -3041,9 +3097,11 @@
|
|
|
3041
3097
|
activeColor,
|
|
3042
3098
|
unactiveColor,
|
|
3043
3099
|
index: index2,
|
|
3044
|
-
handleClick: handleClick2
|
|
3100
|
+
handleClick: handleClick2,
|
|
3101
|
+
iconClassPrefix,
|
|
3102
|
+
iconFontClassName
|
|
3045
3103
|
} = {
|
|
3046
|
-
...defaultProps$
|
|
3104
|
+
...defaultProps$1a,
|
|
3047
3105
|
...props
|
|
3048
3106
|
};
|
|
3049
3107
|
const b2 = cn("tabbar-item");
|
|
@@ -3075,8 +3133,8 @@
|
|
|
3075
3133
|
}, "99+")) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3076
3134
|
className: `${bIcon("dot")}`
|
|
3077
3135
|
}), icon && /* @__PURE__ */ React__default["default"].createElement("div", null, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
3078
|
-
classPrefix:
|
|
3079
|
-
fontClassName:
|
|
3136
|
+
classPrefix: iconClassPrefix,
|
|
3137
|
+
fontClassName: iconFontClassName,
|
|
3080
3138
|
size,
|
|
3081
3139
|
name: icon
|
|
3082
3140
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -3188,10 +3246,14 @@
|
|
|
3188
3246
|
return "";
|
|
3189
3247
|
return string[0].toUpperCase() + string.slice(1);
|
|
3190
3248
|
}
|
|
3249
|
+
const actionsWithoutCaptureSupported = ["enter", "leave"];
|
|
3250
|
+
function hasCapture(capture = false, actionKey) {
|
|
3251
|
+
return capture && !actionsWithoutCaptureSupported.includes(actionKey);
|
|
3252
|
+
}
|
|
3191
3253
|
function toHandlerProp(device, action = "", capture = false) {
|
|
3192
3254
|
const deviceProps = EVENT_TYPE_MAP[device];
|
|
3193
3255
|
const actionKey = deviceProps ? deviceProps[action] || action : action;
|
|
3194
|
-
return "on" + capitalize(device) + capitalize(actionKey) + (capture ? "Capture" : "");
|
|
3256
|
+
return "on" + capitalize(device) + capitalize(actionKey) + (hasCapture(capture, actionKey) ? "Capture" : "");
|
|
3195
3257
|
}
|
|
3196
3258
|
const pointerCaptureEvents = ["gotpointercapture", "lostpointercapture"];
|
|
3197
3259
|
function parseProp(prop) {
|
|
@@ -3217,6 +3279,13 @@
|
|
|
3217
3279
|
function isTouch(event) {
|
|
3218
3280
|
return "touches" in event;
|
|
3219
3281
|
}
|
|
3282
|
+
function getPointerType(event) {
|
|
3283
|
+
if (isTouch(event))
|
|
3284
|
+
return "touch";
|
|
3285
|
+
if ("pointerType" in event)
|
|
3286
|
+
return event.pointerType;
|
|
3287
|
+
return "mouse";
|
|
3288
|
+
}
|
|
3220
3289
|
function getCurrentTargetTouchList(event) {
|
|
3221
3290
|
return Array.from(event.touches).filter((e2) => {
|
|
3222
3291
|
var _event$currentTarget, _event$currentTarget$;
|
|
@@ -3446,6 +3515,8 @@
|
|
|
3446
3515
|
const _absoluteDelta = state._delta.map(Math.abs);
|
|
3447
3516
|
V.addTo(state._distance, _absoluteDelta);
|
|
3448
3517
|
}
|
|
3518
|
+
if (this.axisIntent)
|
|
3519
|
+
this.axisIntent(event);
|
|
3449
3520
|
const [_m0, _m1] = state._movement;
|
|
3450
3521
|
const [t0, t1] = config2.threshold;
|
|
3451
3522
|
const {
|
|
@@ -3475,8 +3546,8 @@
|
|
|
3475
3546
|
movement[0] = _step[0] !== false ? _m0 - _step[0] : 0;
|
|
3476
3547
|
movement[1] = _step[1] !== false ? _m1 - _step[1] : 0;
|
|
3477
3548
|
}
|
|
3478
|
-
if (this.
|
|
3479
|
-
this.
|
|
3549
|
+
if (this.restrictToAxis && !state._blocked)
|
|
3550
|
+
this.restrictToAxis(movement);
|
|
3480
3551
|
const previousOffset = state.offset;
|
|
3481
3552
|
const gestureIsActive = state._active && !state._blocked || state.active;
|
|
3482
3553
|
if (gestureIsActive) {
|
|
@@ -3533,23 +3604,16 @@
|
|
|
3533
3604
|
this.timeoutStore.clean();
|
|
3534
3605
|
}
|
|
3535
3606
|
}
|
|
3536
|
-
function selectAxis([dx, dy]) {
|
|
3537
|
-
const
|
|
3538
|
-
|
|
3607
|
+
function selectAxis([dx, dy], threshold) {
|
|
3608
|
+
const absDx = Math.abs(dx);
|
|
3609
|
+
const absDy = Math.abs(dy);
|
|
3610
|
+
if (absDx > absDy && absDx > threshold) {
|
|
3539
3611
|
return "x";
|
|
3540
|
-
|
|
3612
|
+
}
|
|
3613
|
+
if (absDy > absDx && absDy > threshold) {
|
|
3541
3614
|
return "y";
|
|
3542
|
-
return void 0;
|
|
3543
|
-
}
|
|
3544
|
-
function restrictVectorToAxis(v2, axis) {
|
|
3545
|
-
switch (axis) {
|
|
3546
|
-
case "x":
|
|
3547
|
-
v2[1] = 0;
|
|
3548
|
-
break;
|
|
3549
|
-
case "y":
|
|
3550
|
-
v2[0] = 0;
|
|
3551
|
-
break;
|
|
3552
3615
|
}
|
|
3616
|
+
return void 0;
|
|
3553
3617
|
}
|
|
3554
3618
|
class CoordinatesEngine extends Engine {
|
|
3555
3619
|
constructor(...args) {
|
|
@@ -3570,13 +3634,25 @@
|
|
|
3570
3634
|
computeMovement() {
|
|
3571
3635
|
this.state.movement = V.sub(this.state.offset, this.state.lastOffset);
|
|
3572
3636
|
}
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
if (
|
|
3577
|
-
|
|
3637
|
+
axisIntent(event) {
|
|
3638
|
+
const state = this.state;
|
|
3639
|
+
const config2 = this.config;
|
|
3640
|
+
if (!state.axis && event) {
|
|
3641
|
+
const threshold = typeof config2.axisThreshold === "object" ? config2.axisThreshold[getPointerType(event)] : config2.axisThreshold;
|
|
3642
|
+
state.axis = selectAxis(state._movement, threshold);
|
|
3643
|
+
}
|
|
3644
|
+
state._blocked = (config2.lockDirection || !!config2.axis) && !state.axis || !!config2.axis && config2.axis !== state.axis;
|
|
3645
|
+
}
|
|
3646
|
+
restrictToAxis(v2) {
|
|
3578
3647
|
if (this.config.axis || this.config.lockDirection) {
|
|
3579
|
-
|
|
3648
|
+
switch (this.state.axis) {
|
|
3649
|
+
case "x":
|
|
3650
|
+
v2[1] = 0;
|
|
3651
|
+
break;
|
|
3652
|
+
case "y":
|
|
3653
|
+
v2[0] = 0;
|
|
3654
|
+
break;
|
|
3655
|
+
}
|
|
3580
3656
|
}
|
|
3581
3657
|
}
|
|
3582
3658
|
}
|
|
@@ -3586,6 +3662,9 @@
|
|
|
3586
3662
|
enabled(value = true) {
|
|
3587
3663
|
return value;
|
|
3588
3664
|
},
|
|
3665
|
+
eventOptions(value, _k, config2) {
|
|
3666
|
+
return _objectSpread2(_objectSpread2({}, config2.shared.eventOptions), value);
|
|
3667
|
+
},
|
|
3589
3668
|
preventDefault(value = false) {
|
|
3590
3669
|
return value;
|
|
3591
3670
|
},
|
|
@@ -3617,6 +3696,7 @@
|
|
|
3617
3696
|
return V.toVector(value, 0);
|
|
3618
3697
|
}
|
|
3619
3698
|
};
|
|
3699
|
+
const DEFAULT_AXIS_THRESHOLD = 0;
|
|
3620
3700
|
const coordinatesConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
|
|
3621
3701
|
axis(_v, _k, {
|
|
3622
3702
|
axis
|
|
@@ -3625,6 +3705,9 @@
|
|
|
3625
3705
|
if (!this.lockDirection)
|
|
3626
3706
|
return axis;
|
|
3627
3707
|
},
|
|
3708
|
+
axisThreshold(value = DEFAULT_AXIS_THRESHOLD) {
|
|
3709
|
+
return value;
|
|
3710
|
+
},
|
|
3628
3711
|
bounds(value = {}) {
|
|
3629
3712
|
if (typeof value === "function") {
|
|
3630
3713
|
return (state) => coordinatesConfigResolver.bounds(value(state));
|
|
@@ -3708,11 +3791,11 @@
|
|
|
3708
3791
|
const state = this.state;
|
|
3709
3792
|
if (event.buttons != null && (Array.isArray(config2.pointerButtons) ? !config2.pointerButtons.includes(event.buttons) : config2.pointerButtons !== -1 && config2.pointerButtons !== event.buttons))
|
|
3710
3793
|
return;
|
|
3711
|
-
this.ctrl.setEventIds(event);
|
|
3794
|
+
const ctrlIds = this.ctrl.setEventIds(event);
|
|
3712
3795
|
if (config2.pointerCapture) {
|
|
3713
3796
|
event.target.setPointerCapture(event.pointerId);
|
|
3714
3797
|
}
|
|
3715
|
-
if (state._pointerActive)
|
|
3798
|
+
if (ctrlIds && ctrlIds.size > 1 && state._pointerActive)
|
|
3716
3799
|
return;
|
|
3717
3800
|
this.start(event);
|
|
3718
3801
|
this.setupPointer(event);
|
|
@@ -3720,10 +3803,15 @@
|
|
|
3720
3803
|
state._pointerActive = true;
|
|
3721
3804
|
this.computeValues(pointerValues(event));
|
|
3722
3805
|
this.computeInitial();
|
|
3723
|
-
if (config2.
|
|
3806
|
+
if (config2.preventScrollAxis && getPointerType(event) !== "mouse") {
|
|
3807
|
+
state._active = false;
|
|
3724
3808
|
this.setupScrollPrevention(event);
|
|
3725
3809
|
} else if (config2.delay > 0) {
|
|
3726
3810
|
this.setupDelayTrigger(event);
|
|
3811
|
+
if (config2.triggerAllEvents) {
|
|
3812
|
+
this.compute(event);
|
|
3813
|
+
this.emit();
|
|
3814
|
+
}
|
|
3727
3815
|
} else {
|
|
3728
3816
|
this.startPointerDrag(event);
|
|
3729
3817
|
}
|
|
@@ -3755,13 +3843,13 @@
|
|
|
3755
3843
|
}
|
|
3756
3844
|
V.addTo(state._movement, state._delta);
|
|
3757
3845
|
this.compute(event);
|
|
3758
|
-
if (state._delayed) {
|
|
3846
|
+
if (state._delayed && state.intentional) {
|
|
3759
3847
|
this.timeoutStore.remove("dragDelay");
|
|
3760
3848
|
state.active = false;
|
|
3761
3849
|
this.startPointerDrag(event);
|
|
3762
3850
|
return;
|
|
3763
3851
|
}
|
|
3764
|
-
if (config2.
|
|
3852
|
+
if (config2.preventScrollAxis && !state._preventScroll) {
|
|
3765
3853
|
if (state.axis) {
|
|
3766
3854
|
if (state.axis === config2.preventScrollAxis || config2.preventScrollAxis === "xy") {
|
|
3767
3855
|
state._active = false;
|
|
@@ -3789,7 +3877,7 @@
|
|
|
3789
3877
|
}
|
|
3790
3878
|
const state = this.state;
|
|
3791
3879
|
const config2 = this.config;
|
|
3792
|
-
if (!state._pointerActive)
|
|
3880
|
+
if (!state._active || !state._pointerActive)
|
|
3793
3881
|
return;
|
|
3794
3882
|
const id = pointerId(event);
|
|
3795
3883
|
if (state._pointerId !== void 0 && id !== state._pointerId)
|
|
@@ -3818,14 +3906,14 @@
|
|
|
3818
3906
|
this.emit();
|
|
3819
3907
|
}
|
|
3820
3908
|
pointerClick(event) {
|
|
3821
|
-
if (!this.state.tap) {
|
|
3909
|
+
if (!this.state.tap && event.detail > 0) {
|
|
3822
3910
|
event.preventDefault();
|
|
3823
3911
|
event.stopPropagation();
|
|
3824
3912
|
}
|
|
3825
3913
|
}
|
|
3826
3914
|
setupPointer(event) {
|
|
3827
3915
|
const config2 = this.config;
|
|
3828
|
-
|
|
3916
|
+
const device = config2.device;
|
|
3829
3917
|
if (config2.pointerLock) {
|
|
3830
3918
|
event.currentTarget.requestPointerLock();
|
|
3831
3919
|
}
|
|
@@ -3846,29 +3934,29 @@
|
|
|
3846
3934
|
}
|
|
3847
3935
|
}
|
|
3848
3936
|
setupScrollPrevention(event) {
|
|
3937
|
+
this.state._preventScroll = false;
|
|
3849
3938
|
persistEvent(event);
|
|
3850
|
-
this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
|
|
3851
|
-
passive: false
|
|
3852
|
-
});
|
|
3853
|
-
this.eventStore.add(this.sharedConfig.window, "touch", "end", this.clean.bind(this), {
|
|
3854
|
-
passive: false
|
|
3855
|
-
});
|
|
3856
|
-
this.eventStore.add(this.sharedConfig.window, "touch", "cancel", this.clean.bind(this), {
|
|
3939
|
+
const remove = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
|
|
3857
3940
|
passive: false
|
|
3858
3941
|
});
|
|
3859
|
-
this.
|
|
3942
|
+
this.eventStore.add(this.sharedConfig.window, "touch", "end", remove);
|
|
3943
|
+
this.eventStore.add(this.sharedConfig.window, "touch", "cancel", remove);
|
|
3944
|
+
this.timeoutStore.add("startPointerDrag", this.startPointerDrag.bind(this), this.config.preventScrollDelay, event);
|
|
3860
3945
|
}
|
|
3861
3946
|
setupDelayTrigger(event) {
|
|
3862
3947
|
this.state._delayed = true;
|
|
3863
|
-
this.timeoutStore.add("dragDelay",
|
|
3948
|
+
this.timeoutStore.add("dragDelay", () => {
|
|
3949
|
+
this.state._step = [0, 0];
|
|
3950
|
+
this.startPointerDrag(event);
|
|
3951
|
+
}, this.config.delay);
|
|
3864
3952
|
}
|
|
3865
3953
|
keyDown(event) {
|
|
3866
3954
|
const deltaFn = KEYS_DELTA_MAP[event.key];
|
|
3867
3955
|
if (deltaFn) {
|
|
3868
3956
|
const state = this.state;
|
|
3869
3957
|
const factor = event.shiftKey ? 10 : event.altKey ? 0.1 : 1;
|
|
3870
|
-
state._delta = deltaFn(factor);
|
|
3871
3958
|
this.start(event);
|
|
3959
|
+
state._delta = deltaFn(factor);
|
|
3872
3960
|
state._keyboardActive = true;
|
|
3873
3961
|
V.addTo(state._movement, state._delta);
|
|
3874
3962
|
this.compute(event);
|
|
@@ -3892,8 +3980,10 @@
|
|
|
3892
3980
|
bindFunction(device, "cancel", this.pointerUp.bind(this));
|
|
3893
3981
|
bindFunction("lostPointerCapture", "", this.pointerUp.bind(this));
|
|
3894
3982
|
}
|
|
3895
|
-
|
|
3896
|
-
|
|
3983
|
+
if (this.config.keys) {
|
|
3984
|
+
bindFunction("key", "down", this.keyDown.bind(this));
|
|
3985
|
+
bindFunction("key", "up", this.keyUp.bind(this));
|
|
3986
|
+
}
|
|
3897
3987
|
if (this.config.filterTaps) {
|
|
3898
3988
|
bindFunction("click", "", this.pointerClick.bind(this), {
|
|
3899
3989
|
capture: true,
|
|
@@ -3938,6 +4028,11 @@
|
|
|
3938
4028
|
const DEFAULT_SWIPE_VELOCITY = 0.5;
|
|
3939
4029
|
const DEFAULT_SWIPE_DISTANCE = 50;
|
|
3940
4030
|
const DEFAULT_SWIPE_DURATION = 250;
|
|
4031
|
+
const DEFAULT_DRAG_AXIS_THRESHOLD = {
|
|
4032
|
+
mouse: 0,
|
|
4033
|
+
touch: 0,
|
|
4034
|
+
pen: 8
|
|
4035
|
+
};
|
|
3941
4036
|
const dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
|
|
3942
4037
|
device(_v, _k, {
|
|
3943
4038
|
pointer: {
|
|
@@ -3957,15 +4052,13 @@
|
|
|
3957
4052
|
return "touch";
|
|
3958
4053
|
return "mouse";
|
|
3959
4054
|
},
|
|
3960
|
-
|
|
3961
|
-
|
|
4055
|
+
preventScrollAxis(value, _k, {
|
|
4056
|
+
preventScroll
|
|
3962
4057
|
}) {
|
|
3963
|
-
this.
|
|
3964
|
-
if (!SUPPORT.touchscreen)
|
|
3965
|
-
return
|
|
3966
|
-
|
|
3967
|
-
return value;
|
|
3968
|
-
return value ? DEFAULT_PREVENT_SCROLL_DELAY : false;
|
|
4058
|
+
this.preventScrollDelay = typeof preventScroll === "number" ? preventScroll : preventScroll || preventScroll === void 0 && value ? DEFAULT_PREVENT_SCROLL_DELAY : void 0;
|
|
4059
|
+
if (!SUPPORT.touchscreen || preventScroll === false)
|
|
4060
|
+
return void 0;
|
|
4061
|
+
return value ? value : preventScroll !== void 0 ? "y" : void 0;
|
|
3969
4062
|
},
|
|
3970
4063
|
pointerCapture(_v, _k, {
|
|
3971
4064
|
pointer: {
|
|
@@ -3976,6 +4069,9 @@
|
|
|
3976
4069
|
this.pointerButtons = buttons;
|
|
3977
4070
|
return !this.pointerLock && this.device === "pointer" && capture;
|
|
3978
4071
|
},
|
|
4072
|
+
keys(value = true) {
|
|
4073
|
+
return value;
|
|
4074
|
+
},
|
|
3979
4075
|
threshold(value, _k, {
|
|
3980
4076
|
filterTaps = false,
|
|
3981
4077
|
tapsThreshold = 3,
|
|
@@ -4006,10 +4102,15 @@
|
|
|
4006
4102
|
default:
|
|
4007
4103
|
return value;
|
|
4008
4104
|
}
|
|
4105
|
+
},
|
|
4106
|
+
axisThreshold(value) {
|
|
4107
|
+
if (!value)
|
|
4108
|
+
return DEFAULT_DRAG_AXIS_THRESHOLD;
|
|
4109
|
+
return _objectSpread2(_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value);
|
|
4009
4110
|
}
|
|
4010
4111
|
});
|
|
4011
4112
|
const SCALE_ANGLE_RATIO_INTENT_DEG = 30;
|
|
4012
|
-
const PINCH_WHEEL_RATIO =
|
|
4113
|
+
const PINCH_WHEEL_RATIO = 100;
|
|
4013
4114
|
class PinchEngine extends Engine {
|
|
4014
4115
|
constructor(...args) {
|
|
4015
4116
|
super(...args);
|
|
@@ -4048,19 +4149,22 @@
|
|
|
4048
4149
|
} = this.state;
|
|
4049
4150
|
this.state.movement = [offset[0] / lastOffset[0], offset[1] - lastOffset[1]];
|
|
4050
4151
|
}
|
|
4051
|
-
|
|
4152
|
+
axisIntent() {
|
|
4052
4153
|
const state = this.state;
|
|
4154
|
+
const [_m0, _m1] = state._movement;
|
|
4053
4155
|
if (!state.axis) {
|
|
4054
|
-
const axisMovementDifference = Math.abs(
|
|
4156
|
+
const axisMovementDifference = Math.abs(_m0) * SCALE_ANGLE_RATIO_INTENT_DEG - Math.abs(_m1);
|
|
4055
4157
|
if (axisMovementDifference < 0)
|
|
4056
4158
|
state.axis = "angle";
|
|
4057
4159
|
else if (axisMovementDifference > 0)
|
|
4058
4160
|
state.axis = "scale";
|
|
4059
4161
|
}
|
|
4162
|
+
}
|
|
4163
|
+
restrictToAxis(v2) {
|
|
4060
4164
|
if (this.config.lockDirection) {
|
|
4061
|
-
if (state.axis === "scale")
|
|
4165
|
+
if (this.state.axis === "scale")
|
|
4062
4166
|
v2[1] = 0;
|
|
4063
|
-
else if (state.axis === "angle")
|
|
4167
|
+
else if (this.state.axis === "angle")
|
|
4064
4168
|
v2[0] = 0;
|
|
4065
4169
|
}
|
|
4066
4170
|
}
|
|
@@ -4211,7 +4315,8 @@
|
|
|
4211
4315
|
this.emit();
|
|
4212
4316
|
}
|
|
4213
4317
|
wheel(event) {
|
|
4214
|
-
|
|
4318
|
+
const modifierKey = this.config.modifierKey;
|
|
4319
|
+
if (modifierKey && !event[modifierKey])
|
|
4215
4320
|
return;
|
|
4216
4321
|
if (!this.state._active)
|
|
4217
4322
|
this.wheelStart(event);
|
|
@@ -4251,11 +4356,10 @@
|
|
|
4251
4356
|
bindFunction(device, "change", this[device + "Move"].bind(this));
|
|
4252
4357
|
bindFunction(device, "end", this[device + "End"].bind(this));
|
|
4253
4358
|
bindFunction(device, "cancel", this[device + "End"].bind(this));
|
|
4254
|
-
} else {
|
|
4255
|
-
bindFunction("wheel", "", this.wheel.bind(this), {
|
|
4256
|
-
passive: false
|
|
4257
|
-
});
|
|
4258
4359
|
}
|
|
4360
|
+
bindFunction("wheel", "", this.wheel.bind(this), {
|
|
4361
|
+
passive: false
|
|
4362
|
+
});
|
|
4259
4363
|
}
|
|
4260
4364
|
}
|
|
4261
4365
|
const pinchConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
|
|
@@ -4303,6 +4407,11 @@
|
|
|
4303
4407
|
this.lockDirection = config2.axis === "lock";
|
|
4304
4408
|
const threshold = V.toVector(value, this.lockDirection ? [0.1, 3] : 0);
|
|
4305
4409
|
return threshold;
|
|
4410
|
+
},
|
|
4411
|
+
modifierKey(value) {
|
|
4412
|
+
if (value === void 0)
|
|
4413
|
+
return "ctrlKey";
|
|
4414
|
+
return value;
|
|
4306
4415
|
}
|
|
4307
4416
|
});
|
|
4308
4417
|
class MoveEngine extends CoordinatesEngine {
|
|
@@ -4610,19 +4719,27 @@
|
|
|
4610
4719
|
return _config;
|
|
4611
4720
|
}
|
|
4612
4721
|
class EventStore {
|
|
4613
|
-
constructor(ctrl) {
|
|
4614
|
-
_defineProperty(this, "_listeners",
|
|
4722
|
+
constructor(ctrl, gestureKey) {
|
|
4723
|
+
_defineProperty(this, "_listeners", /* @__PURE__ */ new Set());
|
|
4615
4724
|
this._ctrl = ctrl;
|
|
4725
|
+
this._gestureKey = gestureKey;
|
|
4616
4726
|
}
|
|
4617
4727
|
add(element, device, action, handler, options2) {
|
|
4728
|
+
const listeners = this._listeners;
|
|
4618
4729
|
const type = toDomEventType(device, action);
|
|
4619
|
-
const
|
|
4730
|
+
const _options = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {};
|
|
4731
|
+
const eventOptions = _objectSpread2(_objectSpread2({}, _options), options2);
|
|
4620
4732
|
element.addEventListener(type, handler, eventOptions);
|
|
4621
|
-
|
|
4733
|
+
const remove = () => {
|
|
4734
|
+
element.removeEventListener(type, handler, eventOptions);
|
|
4735
|
+
listeners.delete(remove);
|
|
4736
|
+
};
|
|
4737
|
+
listeners.add(remove);
|
|
4738
|
+
return remove;
|
|
4622
4739
|
}
|
|
4623
4740
|
clean() {
|
|
4624
4741
|
this._listeners.forEach((remove) => remove());
|
|
4625
|
-
this._listeners
|
|
4742
|
+
this._listeners.clear();
|
|
4626
4743
|
}
|
|
4627
4744
|
}
|
|
4628
4745
|
class TimeoutStore {
|
|
@@ -4666,11 +4783,13 @@
|
|
|
4666
4783
|
setEventIds(event) {
|
|
4667
4784
|
if (isTouch(event)) {
|
|
4668
4785
|
this.touchIds = new Set(touchIds(event));
|
|
4786
|
+
return this.touchIds;
|
|
4669
4787
|
} else if ("pointerId" in event) {
|
|
4670
4788
|
if (event.type === "pointerup" || event.type === "pointercancel")
|
|
4671
4789
|
this.pointerIds.delete(event.pointerId);
|
|
4672
4790
|
else if (event.type === "pointerdown")
|
|
4673
4791
|
this.pointerIds.add(event.pointerId);
|
|
4792
|
+
return this.pointerIds;
|
|
4674
4793
|
}
|
|
4675
4794
|
}
|
|
4676
4795
|
applyHandlers(handlers, nativeHandlers) {
|
|
@@ -4694,7 +4813,6 @@
|
|
|
4694
4813
|
}
|
|
4695
4814
|
bind(...args) {
|
|
4696
4815
|
const sharedConfig = this.config.shared;
|
|
4697
|
-
const eventOptions = sharedConfig.eventOptions;
|
|
4698
4816
|
const props = {};
|
|
4699
4817
|
let target;
|
|
4700
4818
|
if (sharedConfig.target) {
|
|
@@ -4702,16 +4820,18 @@
|
|
|
4702
4820
|
if (!target)
|
|
4703
4821
|
return;
|
|
4704
4822
|
}
|
|
4705
|
-
const bindFunction = bindToProps(props, eventOptions, !!target);
|
|
4706
4823
|
if (sharedConfig.enabled) {
|
|
4707
4824
|
for (const gestureKey of this.gestures) {
|
|
4708
|
-
|
|
4825
|
+
const gestureConfig = this.config[gestureKey];
|
|
4826
|
+
const bindFunction = bindToProps(props, gestureConfig.eventOptions, !!target);
|
|
4827
|
+
if (gestureConfig.enabled) {
|
|
4709
4828
|
const Engine2 = EngineMap.get(gestureKey);
|
|
4710
4829
|
new Engine2(this, args, gestureKey).bind(bindFunction);
|
|
4711
4830
|
}
|
|
4712
4831
|
}
|
|
4832
|
+
const nativeBindFunction = bindToProps(props, sharedConfig.eventOptions, !!target);
|
|
4713
4833
|
for (const eventKey in this.nativeHandlers) {
|
|
4714
|
-
|
|
4834
|
+
nativeBindFunction(eventKey, "", (event) => this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({}, this.state.shared), {}, {
|
|
4715
4835
|
event,
|
|
4716
4836
|
args
|
|
4717
4837
|
})), void 0, true);
|
|
@@ -4737,7 +4857,7 @@
|
|
|
4737
4857
|
}
|
|
4738
4858
|
function setupGesture(ctrl, gestureKey) {
|
|
4739
4859
|
ctrl.gestures.add(gestureKey);
|
|
4740
|
-
ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl);
|
|
4860
|
+
ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl, gestureKey);
|
|
4741
4861
|
ctrl.gestureTimeoutStores[gestureKey] = new TimeoutStore();
|
|
4742
4862
|
}
|
|
4743
4863
|
function resolveGestures(ctrl, internalHandlers) {
|
|
@@ -4828,26 +4948,26 @@
|
|
|
4828
4948
|
}
|
|
4829
4949
|
return void 0;
|
|
4830
4950
|
}
|
|
4831
|
-
function useDrag(handler, config2
|
|
4951
|
+
function useDrag(handler, config2) {
|
|
4832
4952
|
registerAction(dragAction);
|
|
4833
4953
|
return useRecognizers({
|
|
4834
4954
|
drag: handler
|
|
4835
|
-
}, config2, "drag");
|
|
4955
|
+
}, config2 || {}, "drag");
|
|
4836
4956
|
}
|
|
4837
4957
|
function createUseGesture(actions) {
|
|
4838
4958
|
actions.forEach(registerAction);
|
|
4839
|
-
return function useGesture2(_handlers, _config
|
|
4959
|
+
return function useGesture2(_handlers, _config) {
|
|
4840
4960
|
const {
|
|
4841
4961
|
handlers,
|
|
4842
4962
|
nativeHandlers,
|
|
4843
4963
|
config: config2
|
|
4844
|
-
} = parseMergedHandlers(_handlers, _config);
|
|
4964
|
+
} = parseMergedHandlers(_handlers, _config || {});
|
|
4845
4965
|
return useRecognizers(handlers, config2, void 0, nativeHandlers);
|
|
4846
4966
|
};
|
|
4847
4967
|
}
|
|
4848
|
-
function useGesture(handlers, config2
|
|
4968
|
+
function useGesture(handlers, config2) {
|
|
4849
4969
|
const hook = createUseGesture([dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction]);
|
|
4850
|
-
return hook(handlers, config2);
|
|
4970
|
+
return hook(handlers, config2 || {});
|
|
4851
4971
|
}
|
|
4852
4972
|
let updateQueue = makeQueue();
|
|
4853
4973
|
const raf = (fn) => schedule(fn, updateQueue);
|
|
@@ -5490,7 +5610,7 @@
|
|
|
5490
5610
|
return i - 1;
|
|
5491
5611
|
}
|
|
5492
5612
|
function _extends$2() {
|
|
5493
|
-
_extends$2 = Object.assign
|
|
5613
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function(target) {
|
|
5494
5614
|
for (var i = 1; i < arguments.length; i++) {
|
|
5495
5615
|
var source = arguments[i];
|
|
5496
5616
|
for (var key in source) {
|
|
@@ -5903,7 +6023,7 @@
|
|
|
5903
6023
|
return parentNode ? parentNode.constructor : is.arr(value) ? AnimatedArray : isAnimatedString(value) ? AnimatedString : AnimatedValue;
|
|
5904
6024
|
}
|
|
5905
6025
|
function _extends$1() {
|
|
5906
|
-
_extends$1 = Object.assign
|
|
6026
|
+
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
|
|
5907
6027
|
for (var i = 1; i < arguments.length; i++) {
|
|
5908
6028
|
var source = arguments[i];
|
|
5909
6029
|
for (var key in source) {
|
|
@@ -6022,7 +6142,7 @@
|
|
|
6022
6142
|
};
|
|
6023
6143
|
const getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName) ? arg.displayName : is.fun(arg) && arg.name || null;
|
|
6024
6144
|
function _extends() {
|
|
6025
|
-
_extends = Object.assign
|
|
6145
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
6026
6146
|
for (var i = 1; i < arguments.length; i++) {
|
|
6027
6147
|
var source = arguments[i];
|
|
6028
6148
|
for (var key in source) {
|
|
@@ -6655,6 +6775,7 @@
|
|
|
6655
6775
|
const from = anim.fromValues[i];
|
|
6656
6776
|
const v0 = node2.v0 != null ? node2.v0 : node2.v0 = is.arr(config2.velocity) ? config2.velocity[i] : config2.velocity;
|
|
6657
6777
|
let velocity;
|
|
6778
|
+
const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3));
|
|
6658
6779
|
if (!is.und(config2.duration)) {
|
|
6659
6780
|
let p2 = 1;
|
|
6660
6781
|
if (config2.duration > 0) {
|
|
@@ -6676,11 +6797,10 @@
|
|
|
6676
6797
|
const decay = config2.decay === true ? 0.998 : config2.decay;
|
|
6677
6798
|
const e2 = Math.exp(-(1 - decay) * elapsed);
|
|
6678
6799
|
position = from + v0 / (1 - decay) * (1 - e2);
|
|
6679
|
-
finished = Math.abs(node2.lastPosition - position)
|
|
6800
|
+
finished = Math.abs(node2.lastPosition - position) <= precision;
|
|
6680
6801
|
velocity = v0 * e2;
|
|
6681
6802
|
} else {
|
|
6682
6803
|
velocity = node2.lastVelocity == null ? v0 : node2.lastVelocity;
|
|
6683
|
-
const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3));
|
|
6684
6804
|
const restVelocity = config2.restVelocity || precision / 10;
|
|
6685
6805
|
const bounceFactor = config2.clamp ? 0 : config2.bounce;
|
|
6686
6806
|
const canBounce = !is.und(bounceFactor);
|
|
@@ -8023,7 +8143,7 @@
|
|
|
8023
8143
|
});
|
|
8024
8144
|
const animated = host.animated;
|
|
8025
8145
|
const elevatorContext$1 = React.createContext({});
|
|
8026
|
-
const defaultProps$
|
|
8146
|
+
const defaultProps$19 = {
|
|
8027
8147
|
height: "200px",
|
|
8028
8148
|
acceptKey: "title",
|
|
8029
8149
|
indexList: [],
|
|
@@ -8046,7 +8166,7 @@
|
|
|
8046
8166
|
children,
|
|
8047
8167
|
...rest
|
|
8048
8168
|
} = {
|
|
8049
|
-
...defaultProps$
|
|
8169
|
+
...defaultProps$19,
|
|
8050
8170
|
...props
|
|
8051
8171
|
};
|
|
8052
8172
|
const b2 = cn("elevator");
|
|
@@ -8234,9 +8354,9 @@
|
|
|
8234
8354
|
}, item[acceptKey]);
|
|
8235
8355
|
}))));
|
|
8236
8356
|
};
|
|
8237
|
-
Elevator$1.defaultProps = defaultProps$
|
|
8357
|
+
Elevator$1.defaultProps = defaultProps$19;
|
|
8238
8358
|
Elevator$1.displayName = "NutElevator";
|
|
8239
|
-
const defaultProps$
|
|
8359
|
+
const defaultProps$18 = {
|
|
8240
8360
|
defaultValue: 1,
|
|
8241
8361
|
mode: "multi",
|
|
8242
8362
|
prevText: "",
|
|
@@ -8253,7 +8373,7 @@
|
|
|
8253
8373
|
};
|
|
8254
8374
|
const Pagination = (props) => {
|
|
8255
8375
|
const { locale } = useConfig$1();
|
|
8256
|
-
({ ...defaultProps$
|
|
8376
|
+
({ ...defaultProps$18, ...props });
|
|
8257
8377
|
const {
|
|
8258
8378
|
modelValue,
|
|
8259
8379
|
mode,
|
|
@@ -8370,7 +8490,7 @@
|
|
|
8370
8490
|
onClick: (e2) => selectPage(Number(currentPage) + 1, true)
|
|
8371
8491
|
}, nextText || locale.pagination.next));
|
|
8372
8492
|
};
|
|
8373
|
-
Pagination.defaultProps = defaultProps$
|
|
8493
|
+
Pagination.defaultProps = defaultProps$18;
|
|
8374
8494
|
Pagination.displayName = "NutPagination";
|
|
8375
8495
|
class Title {
|
|
8376
8496
|
constructor() {
|
|
@@ -8380,7 +8500,7 @@
|
|
|
8380
8500
|
this.index = 0;
|
|
8381
8501
|
}
|
|
8382
8502
|
}
|
|
8383
|
-
const defaultProps$
|
|
8503
|
+
const defaultProps$17 = {
|
|
8384
8504
|
...ComponentDefaults,
|
|
8385
8505
|
value: 0,
|
|
8386
8506
|
color: "",
|
|
@@ -8415,23 +8535,28 @@
|
|
|
8415
8535
|
onChange,
|
|
8416
8536
|
className,
|
|
8417
8537
|
autoHeight,
|
|
8538
|
+
iconClassPrefix,
|
|
8539
|
+
iconFontClassName,
|
|
8418
8540
|
...rest
|
|
8419
|
-
} = {
|
|
8541
|
+
} = {
|
|
8542
|
+
...defaultProps$17,
|
|
8543
|
+
...props
|
|
8544
|
+
};
|
|
8420
8545
|
const [currentItem, setCurrentItem] = React.useState({ index: 0 });
|
|
8421
8546
|
const titles = React.useRef([]);
|
|
8422
8547
|
React.useEffect(() => {
|
|
8423
8548
|
let currentIndex = 0;
|
|
8424
8549
|
titles.current = [];
|
|
8425
8550
|
React__default["default"].Children.forEach(children, (child, idx) => {
|
|
8426
|
-
var _a, _b, _c, _d, _e;
|
|
8427
8551
|
if (!React__default["default"].isValidElement(child)) {
|
|
8428
8552
|
return null;
|
|
8429
8553
|
}
|
|
8430
8554
|
const title = new Title();
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
title.
|
|
8434
|
-
title.
|
|
8555
|
+
const childProps = child == null ? void 0 : child.props;
|
|
8556
|
+
if ((childProps == null ? void 0 : childProps.title) || (childProps == null ? void 0 : childProps.paneKey)) {
|
|
8557
|
+
title.title = childProps == null ? void 0 : childProps.title;
|
|
8558
|
+
title.paneKey = (childProps == null ? void 0 : childProps.paneKey) || idx;
|
|
8559
|
+
title.disabled = childProps == null ? void 0 : childProps.disabled;
|
|
8435
8560
|
title.index = idx;
|
|
8436
8561
|
if (title.paneKey === value) {
|
|
8437
8562
|
currentIndex = idx;
|
|
@@ -8497,8 +8622,8 @@
|
|
|
8497
8622
|
className: `${b2("")}__titles-item__smile`,
|
|
8498
8623
|
style: tabsActiveStyle
|
|
8499
8624
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
8500
|
-
classPrefix:
|
|
8501
|
-
fontClassName:
|
|
8625
|
+
classPrefix: iconClassPrefix,
|
|
8626
|
+
fontClassName: iconFontClassName,
|
|
8502
8627
|
color,
|
|
8503
8628
|
name: "joy-smile"
|
|
8504
8629
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -8530,9 +8655,9 @@
|
|
|
8530
8655
|
return React__default["default"].cloneElement(child, childProps);
|
|
8531
8656
|
})));
|
|
8532
8657
|
};
|
|
8533
|
-
Tabs.defaultProps = defaultProps$
|
|
8658
|
+
Tabs.defaultProps = defaultProps$17;
|
|
8534
8659
|
Tabs.displayName = "NutTabs";
|
|
8535
|
-
const defaultProps$
|
|
8660
|
+
const defaultProps$16 = {
|
|
8536
8661
|
title: "",
|
|
8537
8662
|
paneKey: "",
|
|
8538
8663
|
activeKey: "",
|
|
@@ -8540,7 +8665,7 @@
|
|
|
8540
8665
|
};
|
|
8541
8666
|
const TabPane = (props) => {
|
|
8542
8667
|
const { children, paneKey, activeKey, autoHeightClassName } = {
|
|
8543
|
-
...defaultProps$
|
|
8668
|
+
...defaultProps$16,
|
|
8544
8669
|
...props
|
|
8545
8670
|
};
|
|
8546
8671
|
const b2 = cn("tabpane");
|
|
@@ -8555,7 +8680,7 @@
|
|
|
8555
8680
|
className: classes
|
|
8556
8681
|
}, children);
|
|
8557
8682
|
};
|
|
8558
|
-
const defaultProps$
|
|
8683
|
+
const defaultProps$15 = {
|
|
8559
8684
|
size: 3,
|
|
8560
8685
|
current: 1,
|
|
8561
8686
|
block: false,
|
|
@@ -8575,7 +8700,7 @@
|
|
|
8575
8700
|
vertical,
|
|
8576
8701
|
...rest
|
|
8577
8702
|
} = {
|
|
8578
|
-
...defaultProps$
|
|
8703
|
+
...defaultProps$15,
|
|
8579
8704
|
...props
|
|
8580
8705
|
};
|
|
8581
8706
|
const b2 = cn("indicator");
|
|
@@ -8609,7 +8734,7 @@
|
|
|
8609
8734
|
...rest
|
|
8610
8735
|
}, renderEles());
|
|
8611
8736
|
};
|
|
8612
|
-
Indicator.defaultProps = defaultProps$
|
|
8737
|
+
Indicator.defaultProps = defaultProps$15;
|
|
8613
8738
|
Indicator.displayName = "NutIndicator";
|
|
8614
8739
|
const handleClick = (e2) => {
|
|
8615
8740
|
e2.stopPropagation();
|
|
@@ -8625,7 +8750,7 @@
|
|
|
8625
8750
|
}
|
|
8626
8751
|
};
|
|
8627
8752
|
const OffsetContext = React.createContext(20);
|
|
8628
|
-
const defaultProps$
|
|
8753
|
+
const defaultProps$14 = {
|
|
8629
8754
|
showhead: false,
|
|
8630
8755
|
position: "left",
|
|
8631
8756
|
width: "80%"
|
|
@@ -8643,7 +8768,7 @@
|
|
|
8643
8768
|
handleClose,
|
|
8644
8769
|
...rest
|
|
8645
8770
|
} = {
|
|
8646
|
-
...defaultProps$
|
|
8771
|
+
...defaultProps$14,
|
|
8647
8772
|
...props
|
|
8648
8773
|
};
|
|
8649
8774
|
const offset = props.offset ? Number(props.offset) : 20;
|
|
@@ -8671,14 +8796,14 @@
|
|
|
8671
8796
|
className: "nut-sidenavbar__content"
|
|
8672
8797
|
}, children))))));
|
|
8673
8798
|
};
|
|
8674
|
-
SideNavBar.defaultProps = defaultProps$
|
|
8799
|
+
SideNavBar.defaultProps = defaultProps$14;
|
|
8675
8800
|
SideNavBar.displayName = "NutSideNavBar";
|
|
8676
|
-
const defaultProps$
|
|
8801
|
+
const defaultProps$13 = {
|
|
8677
8802
|
open: true
|
|
8678
8803
|
};
|
|
8679
8804
|
const SubSideNavBar = (props) => {
|
|
8680
8805
|
const { title, ikey, children, titleClick, open, ...rest } = {
|
|
8681
|
-
...defaultProps$
|
|
8806
|
+
...defaultProps$13,
|
|
8682
8807
|
...props
|
|
8683
8808
|
};
|
|
8684
8809
|
const offset = React.useContext(OffsetContext);
|
|
@@ -8749,7 +8874,7 @@
|
|
|
8749
8874
|
...rest
|
|
8750
8875
|
}, title);
|
|
8751
8876
|
};
|
|
8752
|
-
const defaultProps$
|
|
8877
|
+
const defaultProps$12 = {
|
|
8753
8878
|
...ComponentDefaults,
|
|
8754
8879
|
className: "",
|
|
8755
8880
|
style: {},
|
|
@@ -8768,9 +8893,11 @@
|
|
|
8768
8893
|
closeOnClickOverlay,
|
|
8769
8894
|
children,
|
|
8770
8895
|
activeColor,
|
|
8896
|
+
iconClassPrefix,
|
|
8897
|
+
iconFontClassName,
|
|
8771
8898
|
...rest
|
|
8772
8899
|
} = {
|
|
8773
|
-
...defaultProps$
|
|
8900
|
+
...defaultProps$12,
|
|
8774
8901
|
...props
|
|
8775
8902
|
};
|
|
8776
8903
|
const parentRef = React.useRef(null);
|
|
@@ -8857,17 +8984,17 @@
|
|
|
8857
8984
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8858
8985
|
className: "nut-menu__title-text"
|
|
8859
8986
|
}, finallyTitle()), /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
8860
|
-
classPrefix:
|
|
8861
|
-
fontClassName:
|
|
8987
|
+
classPrefix: iconClassPrefix,
|
|
8988
|
+
fontClassName: iconFontClassName,
|
|
8862
8989
|
className: "nut-menu__title-icon",
|
|
8863
8990
|
size: "10",
|
|
8864
8991
|
name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
|
|
8865
8992
|
})));
|
|
8866
8993
|
})), cloneChildren());
|
|
8867
8994
|
};
|
|
8868
|
-
Menu.defaultProps = defaultProps$
|
|
8995
|
+
Menu.defaultProps = defaultProps$12;
|
|
8869
8996
|
Menu.displayName = "NutMenu";
|
|
8870
|
-
const defaultProps$
|
|
8997
|
+
const defaultProps$11 = {
|
|
8871
8998
|
...ComponentDefaults,
|
|
8872
8999
|
className: "",
|
|
8873
9000
|
style: {},
|
|
@@ -8882,7 +9009,7 @@
|
|
|
8882
9009
|
};
|
|
8883
9010
|
const MenuItem = (props) => {
|
|
8884
9011
|
useConfig$1();
|
|
8885
|
-
const mergedProps = { ...defaultProps$
|
|
9012
|
+
const mergedProps = { ...defaultProps$11, ...props };
|
|
8886
9013
|
const {
|
|
8887
9014
|
className,
|
|
8888
9015
|
style,
|
|
@@ -8890,16 +9017,16 @@
|
|
|
8890
9017
|
value,
|
|
8891
9018
|
columns,
|
|
8892
9019
|
title,
|
|
8893
|
-
iconClassPrefix,
|
|
8894
|
-
fontClassName,
|
|
8895
9020
|
optionsIcon,
|
|
8896
9021
|
direction,
|
|
8897
9022
|
onChange,
|
|
8898
9023
|
activeTitleClass,
|
|
8899
9024
|
inactiveTitleClass,
|
|
8900
|
-
children
|
|
9025
|
+
children,
|
|
9026
|
+
iconClassPrefix,
|
|
9027
|
+
iconFontClassName
|
|
8901
9028
|
} = {
|
|
8902
|
-
...defaultProps$
|
|
9029
|
+
...defaultProps$11,
|
|
8903
9030
|
...props
|
|
8904
9031
|
};
|
|
8905
9032
|
const { activeColor, showPopup, parent, orderKey } = mergedProps;
|
|
@@ -8933,13 +9060,12 @@
|
|
|
8933
9060
|
height: 0
|
|
8934
9061
|
});
|
|
8935
9062
|
const getParentOffset = () => {
|
|
8936
|
-
setTimeout(() => {
|
|
9063
|
+
setTimeout(async () => {
|
|
8937
9064
|
const p2 = parent.parent().current;
|
|
8938
|
-
p2.getBoundingClientRect()
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
});
|
|
9065
|
+
const rect = await p2.getBoundingClientRect();
|
|
9066
|
+
setPosition({
|
|
9067
|
+
height: rect.height,
|
|
9068
|
+
top: rect.top
|
|
8943
9069
|
});
|
|
8944
9070
|
});
|
|
8945
9071
|
};
|
|
@@ -9006,8 +9132,8 @@
|
|
|
9006
9132
|
handleClick2(item);
|
|
9007
9133
|
}
|
|
9008
9134
|
}, item.value === _value ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
9009
|
-
classPrefix:
|
|
9010
|
-
fontClassName:
|
|
9135
|
+
classPrefix: iconClassPrefix,
|
|
9136
|
+
fontClassName: iconFontClassName,
|
|
9011
9137
|
className: getIconCName(item.value, value),
|
|
9012
9138
|
name: optionsIcon,
|
|
9013
9139
|
color: activeColor
|
|
@@ -9019,7 +9145,7 @@
|
|
|
9019
9145
|
}, item.text));
|
|
9020
9146
|
}), children))));
|
|
9021
9147
|
};
|
|
9022
|
-
MenuItem.defaultProps = defaultProps$
|
|
9148
|
+
MenuItem.defaultProps = defaultProps$11;
|
|
9023
9149
|
MenuItem.displayName = "NutMenuItem";
|
|
9024
9150
|
const MIN_DISTANCE = 10;
|
|
9025
9151
|
function getDirection(x2, y2) {
|
|
@@ -9119,7 +9245,7 @@
|
|
|
9119
9245
|
const res = await element.getBoundingClientRect();
|
|
9120
9246
|
return res;
|
|
9121
9247
|
};
|
|
9122
|
-
const defaultProps
|
|
9248
|
+
const defaultProps$10 = {
|
|
9123
9249
|
name: "",
|
|
9124
9250
|
size: "",
|
|
9125
9251
|
classPrefix: "nut-icon",
|
|
@@ -9147,7 +9273,7 @@
|
|
|
9147
9273
|
onClick,
|
|
9148
9274
|
...rest
|
|
9149
9275
|
} = {
|
|
9150
|
-
...defaultProps
|
|
9276
|
+
...defaultProps$10,
|
|
9151
9277
|
...props
|
|
9152
9278
|
};
|
|
9153
9279
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
@@ -9181,230 +9307,144 @@
|
|
|
9181
9307
|
children
|
|
9182
9308
|
);
|
|
9183
9309
|
}
|
|
9184
|
-
Icon.defaultProps = defaultProps
|
|
9310
|
+
Icon.defaultProps = defaultProps$10;
|
|
9185
9311
|
Icon.displayName = "NutIcon";
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
}
|
|
9207
|
-
legacyRender(node, container);
|
|
9208
|
-
}
|
|
9209
|
-
class Notification$1 extends React__namespace.PureComponent {
|
|
9210
|
-
constructor(props) {
|
|
9211
|
-
super(props);
|
|
9212
|
-
this.close = this.close.bind(this);
|
|
9213
|
-
this.startCloseTimer = this.startCloseTimer.bind(this);
|
|
9214
|
-
this.clearCloseTimer = this.clearCloseTimer.bind(this);
|
|
9215
|
-
this.close = this.close.bind(this);
|
|
9216
|
-
this.clickCover = this.clickCover.bind(this);
|
|
9217
|
-
}
|
|
9218
|
-
close() {
|
|
9219
|
-
this.clearCloseTimer();
|
|
9220
|
-
this.props.onClose();
|
|
9221
|
-
}
|
|
9222
|
-
startCloseTimer() {
|
|
9223
|
-
const { duration } = this.props;
|
|
9224
|
-
if (duration) {
|
|
9225
|
-
this.closeTimer = window.setTimeout(() => {
|
|
9226
|
-
this.close();
|
|
9227
|
-
}, duration * 1e3);
|
|
9228
|
-
}
|
|
9312
|
+
const defaultProps$$ = {
|
|
9313
|
+
id: "",
|
|
9314
|
+
style: {},
|
|
9315
|
+
icon: null,
|
|
9316
|
+
iconSize: "20",
|
|
9317
|
+
msg: "",
|
|
9318
|
+
bottom: "30px",
|
|
9319
|
+
duration: 2,
|
|
9320
|
+
center: true,
|
|
9321
|
+
type: "text",
|
|
9322
|
+
title: "",
|
|
9323
|
+
customClass: "",
|
|
9324
|
+
size: "base",
|
|
9325
|
+
textAlignCenter: true,
|
|
9326
|
+
bgColor: "rgba(0, 0, 0, .8)",
|
|
9327
|
+
cover: false,
|
|
9328
|
+
coverColor: "rgba(0, 0, 0, 0)",
|
|
9329
|
+
closeOnClickOverlay: false,
|
|
9330
|
+
visible: false,
|
|
9331
|
+
onClose: () => {
|
|
9229
9332
|
}
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9333
|
+
};
|
|
9334
|
+
const Toast = (props) => {
|
|
9335
|
+
const {
|
|
9336
|
+
children,
|
|
9337
|
+
id,
|
|
9338
|
+
style,
|
|
9339
|
+
icon,
|
|
9340
|
+
iconSize,
|
|
9341
|
+
msg,
|
|
9342
|
+
bottom,
|
|
9343
|
+
duration,
|
|
9344
|
+
center,
|
|
9345
|
+
type,
|
|
9346
|
+
title,
|
|
9347
|
+
customClass,
|
|
9348
|
+
size,
|
|
9349
|
+
textAlignCenter,
|
|
9350
|
+
bgColor,
|
|
9351
|
+
cover,
|
|
9352
|
+
coverColor,
|
|
9353
|
+
closeOnClickOverlay,
|
|
9354
|
+
visible,
|
|
9355
|
+
onClose,
|
|
9356
|
+
...rest
|
|
9357
|
+
} = { ...defaultProps$$, ...props };
|
|
9358
|
+
let timer;
|
|
9359
|
+
const [openState, SetOpenState] = React.useState(false);
|
|
9360
|
+
React.useEffect(() => {
|
|
9361
|
+
if (visible) {
|
|
9362
|
+
SetOpenState(true);
|
|
9363
|
+
show();
|
|
9364
|
+
} else {
|
|
9365
|
+
hide();
|
|
9234
9366
|
}
|
|
9235
|
-
}
|
|
9236
|
-
|
|
9237
|
-
|
|
9367
|
+
}, [visible]);
|
|
9368
|
+
const clearTimer = () => {
|
|
9369
|
+
if (timer) {
|
|
9370
|
+
clearTimeout(timer);
|
|
9371
|
+
timer = null;
|
|
9372
|
+
}
|
|
9373
|
+
};
|
|
9374
|
+
const hide = () => {
|
|
9375
|
+
SetOpenState(false);
|
|
9376
|
+
onClose();
|
|
9377
|
+
};
|
|
9378
|
+
const show = () => {
|
|
9379
|
+
clearTimer();
|
|
9380
|
+
if (duration) {
|
|
9381
|
+
timer = setTimeout(() => {
|
|
9382
|
+
hide();
|
|
9383
|
+
}, duration * 1e3);
|
|
9384
|
+
}
|
|
9385
|
+
};
|
|
9386
|
+
const clickCover = () => {
|
|
9238
9387
|
if (closeOnClickOverlay) {
|
|
9239
|
-
|
|
9388
|
+
hide();
|
|
9240
9389
|
}
|
|
9241
|
-
}
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
this.clearCloseTimer();
|
|
9247
|
-
}
|
|
9248
|
-
render() {
|
|
9249
|
-
const {
|
|
9250
|
-
id,
|
|
9251
|
-
style,
|
|
9252
|
-
icon,
|
|
9253
|
-
iconSize,
|
|
9254
|
-
title,
|
|
9255
|
-
msg,
|
|
9256
|
-
bottom,
|
|
9257
|
-
center,
|
|
9258
|
-
bgColor,
|
|
9259
|
-
coverColor,
|
|
9260
|
-
textAlignCenter,
|
|
9261
|
-
size,
|
|
9262
|
-
customClass,
|
|
9263
|
-
cover,
|
|
9264
|
-
type
|
|
9265
|
-
} = this.props;
|
|
9266
|
-
const toastBem = cn("toast");
|
|
9267
|
-
const classes = classNames({
|
|
9268
|
-
"nut-toast-center": center,
|
|
9269
|
-
"nut-toast-has-icon": icon,
|
|
9270
|
-
"nut-toast-cover": cover,
|
|
9271
|
-
"nut-toast-loading": type === "loading",
|
|
9272
|
-
[`${customClass}`]: true,
|
|
9273
|
-
[`nut-toast-${size}`]: true
|
|
9274
|
-
});
|
|
9275
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("div", {
|
|
9276
|
-
className: `${toastBem()} ${classes}`,
|
|
9277
|
-
id: `toast-${id}`,
|
|
9278
|
-
style: {
|
|
9279
|
-
bottom: center ? "auto" : `${bottom}`,
|
|
9280
|
-
backgroundColor: cover ? coverColor : "",
|
|
9281
|
-
...style
|
|
9282
|
-
},
|
|
9283
|
-
onClick: () => {
|
|
9284
|
-
this.clickCover();
|
|
9285
|
-
}
|
|
9286
|
-
}, /* @__PURE__ */ React__namespace.createElement("div", {
|
|
9287
|
-
className: toastBem("inner"),
|
|
9288
|
-
style: {
|
|
9289
|
-
textAlign: textAlignCenter ? "center" : "left",
|
|
9290
|
-
backgroundColor: bgColor
|
|
9291
|
-
}
|
|
9292
|
-
}, icon ? /* @__PURE__ */ React__namespace.createElement("p", {
|
|
9293
|
-
className: toastBem("icon-wrapper")
|
|
9294
|
-
}, /* @__PURE__ */ React__namespace.createElement(Icon, {
|
|
9295
|
-
name: icon || "",
|
|
9296
|
-
color: "#ffffff",
|
|
9297
|
-
size: iconSize
|
|
9298
|
-
})) : null, title ? /* @__PURE__ */ React__namespace.createElement("div", {
|
|
9299
|
-
className: "nut-toast-title"
|
|
9300
|
-
}, title) : null, /* @__PURE__ */ React__namespace.createElement("span", {
|
|
9301
|
-
className: toastBem("text")
|
|
9302
|
-
}, msg))));
|
|
9303
|
-
}
|
|
9304
|
-
}
|
|
9305
|
-
Notification$1.newInstance = (properties, callback) => {
|
|
9306
|
-
const element = document.createElement("div");
|
|
9307
|
-
if (properties.id) {
|
|
9308
|
-
element.setAttribute("id", `${properties.id}`);
|
|
9309
|
-
}
|
|
9310
|
-
document.body.appendChild(element);
|
|
9311
|
-
let called = false;
|
|
9312
|
-
function ref(instance) {
|
|
9313
|
-
if (called) {
|
|
9314
|
-
return;
|
|
9390
|
+
};
|
|
9391
|
+
const toastBem = cn("toast");
|
|
9392
|
+
const hasIcon = () => {
|
|
9393
|
+
if (type !== "text") {
|
|
9394
|
+
return true;
|
|
9315
9395
|
}
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
element && element.parentNode && element.parentNode.removeChild(element);
|
|
9322
|
-
}
|
|
9323
|
-
});
|
|
9324
|
-
}
|
|
9325
|
-
render(/* @__PURE__ */ React__namespace.createElement(Notification$1, {
|
|
9326
|
-
...properties,
|
|
9327
|
-
ref
|
|
9328
|
-
}), element);
|
|
9329
|
-
};
|
|
9330
|
-
let messageInstance$1 = null;
|
|
9331
|
-
const options$1 = {
|
|
9332
|
-
msg: "",
|
|
9333
|
-
id: "",
|
|
9334
|
-
duration: 1.5,
|
|
9335
|
-
center: true,
|
|
9336
|
-
type: "text",
|
|
9337
|
-
customClass: "",
|
|
9338
|
-
bottom: 30,
|
|
9339
|
-
size: "base",
|
|
9340
|
-
icon: "",
|
|
9341
|
-
textAlignCenter: true,
|
|
9342
|
-
loadingRotate: true,
|
|
9343
|
-
bgColor: "rgba(0, 0, 0, .8)",
|
|
9344
|
-
onClose: () => {
|
|
9345
|
-
},
|
|
9346
|
-
cover: false,
|
|
9347
|
-
coverColor: "rgba(0, 0, 0, 0)",
|
|
9348
|
-
closeOnClickOverlay: false
|
|
9349
|
-
};
|
|
9350
|
-
function getInstance$1(props, callback) {
|
|
9351
|
-
if (messageInstance$1) {
|
|
9352
|
-
messageInstance$1.destroy();
|
|
9353
|
-
messageInstance$1 = null;
|
|
9354
|
-
}
|
|
9355
|
-
Notification$1.newInstance(props, (notification) => {
|
|
9356
|
-
return callback && callback(notification);
|
|
9357
|
-
});
|
|
9358
|
-
}
|
|
9359
|
-
function notice$1(opts) {
|
|
9360
|
-
function close() {
|
|
9361
|
-
if (messageInstance$1) {
|
|
9362
|
-
messageInstance$1.destroy();
|
|
9363
|
-
messageInstance$1 = null;
|
|
9396
|
+
return !!icon;
|
|
9397
|
+
};
|
|
9398
|
+
const iconName = () => {
|
|
9399
|
+
if (icon) {
|
|
9400
|
+
return icon;
|
|
9364
9401
|
}
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9402
|
+
return {
|
|
9403
|
+
success: "success",
|
|
9404
|
+
fail: "failure",
|
|
9405
|
+
warn: "tips",
|
|
9406
|
+
loading: "loading"
|
|
9407
|
+
}[type];
|
|
9408
|
+
};
|
|
9409
|
+
const classes = classNames({
|
|
9410
|
+
"nut-toast-center": center,
|
|
9411
|
+
"nut-toast-has-icon": icon,
|
|
9412
|
+
"nut-toast-cover": cover,
|
|
9413
|
+
"nut-toast-loading": type === "loading",
|
|
9414
|
+
[`${customClass}`]: true,
|
|
9415
|
+
[`nut-toast-${size}`]: true
|
|
9369
9416
|
});
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
},
|
|
9381
|
-
success(msg, option = {}) {
|
|
9382
|
-
errorMsg$1(msg);
|
|
9383
|
-
return notice$1({ msg, icon: "success", type: "success", ...option });
|
|
9384
|
-
},
|
|
9385
|
-
fail(msg, option = {}) {
|
|
9386
|
-
errorMsg$1(msg);
|
|
9387
|
-
return notice$1({ msg, icon: "failure", type: "fail", ...option });
|
|
9388
|
-
},
|
|
9389
|
-
loading(msg, option = {}) {
|
|
9390
|
-
errorMsg$1(msg);
|
|
9391
|
-
return notice$1({ msg, icon: "loading", type: "loading", ...option });
|
|
9392
|
-
},
|
|
9393
|
-
warn(msg, option = {}) {
|
|
9394
|
-
errorMsg$1(msg);
|
|
9395
|
-
return notice$1({ msg, icon: "tips", type: "warn", ...option });
|
|
9396
|
-
},
|
|
9397
|
-
customIcon(msg, option = {}) {
|
|
9398
|
-
errorMsg$1(msg);
|
|
9399
|
-
return notice$1({ msg, ...option });
|
|
9400
|
-
},
|
|
9401
|
-
hide() {
|
|
9402
|
-
if (messageInstance$1) {
|
|
9403
|
-
messageInstance$1.destroy();
|
|
9404
|
-
messageInstance$1 = null;
|
|
9417
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, openState ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
9418
|
+
className: `${toastBem()} ${classes}`,
|
|
9419
|
+
id,
|
|
9420
|
+
style: {
|
|
9421
|
+
bottom: center ? "auto" : `${bottom}`,
|
|
9422
|
+
backgroundColor: cover ? coverColor : "",
|
|
9423
|
+
...style
|
|
9424
|
+
},
|
|
9425
|
+
onClick: () => {
|
|
9426
|
+
clickCover();
|
|
9405
9427
|
}
|
|
9406
|
-
}
|
|
9407
|
-
|
|
9428
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
9429
|
+
className: toastBem("inner"),
|
|
9430
|
+
style: {
|
|
9431
|
+
textAlign: textAlignCenter ? "center" : "left",
|
|
9432
|
+
backgroundColor: bgColor
|
|
9433
|
+
}
|
|
9434
|
+
}, hasIcon() ? /* @__PURE__ */ React__default["default"].createElement("p", {
|
|
9435
|
+
className: toastBem("icon-wrapper")
|
|
9436
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
9437
|
+
name: iconName(),
|
|
9438
|
+
color: "#ffffff",
|
|
9439
|
+
size: iconSize
|
|
9440
|
+
})) : null, title ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
9441
|
+
className: "nut-toast-title"
|
|
9442
|
+
}, title) : null, /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
9443
|
+
className: toastBem("text")
|
|
9444
|
+
}, msg))) : null);
|
|
9445
|
+
};
|
|
9446
|
+
Toast.defaultProps = defaultProps$$;
|
|
9447
|
+
Toast.displayName = "NutInput";
|
|
9408
9448
|
const defaultProps$_ = {
|
|
9409
9449
|
range: false,
|
|
9410
9450
|
hiddenRange: false,
|
|
@@ -9447,11 +9487,17 @@
|
|
|
9447
9487
|
const touch = useTouch();
|
|
9448
9488
|
const root = React.useRef(null);
|
|
9449
9489
|
const [marksList, SetMarksList] = React.useState([]);
|
|
9490
|
+
const [show, SetShow] = React.useState(false);
|
|
9491
|
+
const [toastMsg, SetToastMsg] = React.useState("");
|
|
9492
|
+
const toastShow = (msg) => {
|
|
9493
|
+
SetToastMsg(msg);
|
|
9494
|
+
SetShow(true);
|
|
9495
|
+
};
|
|
9450
9496
|
React.useEffect(() => {
|
|
9451
9497
|
if (modelValue) {
|
|
9452
9498
|
if (!range && (modelValue < min || modelValue > max)) {
|
|
9453
9499
|
SetInitValue(0);
|
|
9454
|
-
|
|
9500
|
+
toastShow(`${modelValue} ${locale.range.rangeText}`);
|
|
9455
9501
|
return;
|
|
9456
9502
|
}
|
|
9457
9503
|
SetInitValue(modelValue);
|
|
@@ -9770,7 +9816,14 @@
|
|
|
9770
9816
|
className: "number"
|
|
9771
9817
|
}, curValue()) : null)))), !hiddenRange ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
9772
9818
|
className: "max"
|
|
9773
|
-
}, +max) : null
|
|
9819
|
+
}, +max) : null, /* @__PURE__ */ React__default["default"].createElement(Toast, {
|
|
9820
|
+
type: "text",
|
|
9821
|
+
visible: show,
|
|
9822
|
+
msg: toastMsg,
|
|
9823
|
+
onClose: () => {
|
|
9824
|
+
SetShow(false);
|
|
9825
|
+
}
|
|
9826
|
+
}));
|
|
9774
9827
|
};
|
|
9775
9828
|
Range.defaultProps = defaultProps$_;
|
|
9776
9829
|
Range.displayName = "NutRange";
|
|
@@ -10499,7 +10552,10 @@
|
|
|
10499
10552
|
}
|
|
10500
10553
|
};
|
|
10501
10554
|
const Checkbox = (props) => {
|
|
10502
|
-
const { children } = {
|
|
10555
|
+
const { children } = {
|
|
10556
|
+
...defaultProps$W,
|
|
10557
|
+
...props
|
|
10558
|
+
};
|
|
10503
10559
|
const b2 = cn("checkbox");
|
|
10504
10560
|
const {
|
|
10505
10561
|
iconName,
|
|
@@ -10540,8 +10596,8 @@
|
|
|
10540
10596
|
};
|
|
10541
10597
|
const renderIcon = () => {
|
|
10542
10598
|
return /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
10543
|
-
classPrefix:
|
|
10544
|
-
fontClassName:
|
|
10599
|
+
classPrefix: iconClassPrefix,
|
|
10600
|
+
fontClassName: iconFontClassName,
|
|
10545
10601
|
name: getIconName(),
|
|
10546
10602
|
size: iconSize,
|
|
10547
10603
|
className: color()
|
|
@@ -10838,7 +10894,7 @@
|
|
|
10838
10894
|
const [refs, setRefs] = useRefs();
|
|
10839
10895
|
const [columnsList, setColumnsList] = React.useState([]);
|
|
10840
10896
|
const b2 = cn("picker");
|
|
10841
|
-
|
|
10897
|
+
const isConfirmEvent = React.useRef(false);
|
|
10842
10898
|
React.useEffect(() => {
|
|
10843
10899
|
if (defaultValueData && defaultValueData.length !== 0 && defaultValueData.toString() !== chooseValueData.toString()) {
|
|
10844
10900
|
const data = [...defaultValueData];
|
|
@@ -11360,6 +11416,8 @@
|
|
|
11360
11416
|
overlimit,
|
|
11361
11417
|
blur,
|
|
11362
11418
|
focus,
|
|
11419
|
+
iconClassPrefix,
|
|
11420
|
+
iconFontClassName,
|
|
11363
11421
|
...restProps
|
|
11364
11422
|
} = {
|
|
11365
11423
|
...defaultProps$U,
|
|
@@ -11464,8 +11522,8 @@
|
|
|
11464
11522
|
style: styles,
|
|
11465
11523
|
...restProps
|
|
11466
11524
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11467
|
-
classPrefix:
|
|
11468
|
-
fontClassName:
|
|
11525
|
+
classPrefix: iconClassPrefix,
|
|
11526
|
+
fontClassName: iconFontClassName,
|
|
11469
11527
|
className: iconMinusClasses,
|
|
11470
11528
|
size: buttonSize,
|
|
11471
11529
|
name: "minus",
|
|
@@ -11482,8 +11540,8 @@
|
|
|
11482
11540
|
onBlur: burValue,
|
|
11483
11541
|
onFocus: focusValue
|
|
11484
11542
|
}), /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11485
|
-
classPrefix:
|
|
11486
|
-
fontClassName:
|
|
11543
|
+
classPrefix: iconClassPrefix,
|
|
11544
|
+
fontClassName: iconFontClassName,
|
|
11487
11545
|
className: iconAddClasses,
|
|
11488
11546
|
size: buttonSize,
|
|
11489
11547
|
name: "plus",
|
|
@@ -11599,8 +11657,13 @@
|
|
|
11599
11657
|
clickLeftIcon,
|
|
11600
11658
|
clickRightIcon,
|
|
11601
11659
|
click,
|
|
11660
|
+
iconClassPrefix,
|
|
11661
|
+
iconFontClassName,
|
|
11602
11662
|
...rest
|
|
11603
|
-
} = {
|
|
11663
|
+
} = {
|
|
11664
|
+
...defaultProps$T,
|
|
11665
|
+
...props
|
|
11666
|
+
};
|
|
11604
11667
|
locale.placeholder = placeholder || locale.placeholder;
|
|
11605
11668
|
const [inputValue, SetInputValue] = React.useState("");
|
|
11606
11669
|
const [active, SetActive] = React.useState(false);
|
|
@@ -11728,8 +11791,8 @@
|
|
|
11728
11791
|
onClickLeftIcon(e2);
|
|
11729
11792
|
}
|
|
11730
11793
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11731
|
-
classPrefix:
|
|
11732
|
-
fontClassName:
|
|
11794
|
+
classPrefix: iconClassPrefix,
|
|
11795
|
+
fontClassName: iconFontClassName,
|
|
11733
11796
|
name: leftIcon,
|
|
11734
11797
|
size: leftIconSize
|
|
11735
11798
|
})) : null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -11787,8 +11850,8 @@
|
|
|
11787
11850
|
onInput(e2);
|
|
11788
11851
|
}
|
|
11789
11852
|
}), clearable && !readonly && active && inputValue.length > 0 ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11790
|
-
classPrefix:
|
|
11791
|
-
fontClassName:
|
|
11853
|
+
classPrefix: iconClassPrefix,
|
|
11854
|
+
fontClassName: iconFontClassName,
|
|
11792
11855
|
className: "nut-input-clear",
|
|
11793
11856
|
name: clearIcon,
|
|
11794
11857
|
size: clearSize,
|
|
@@ -11801,8 +11864,8 @@
|
|
|
11801
11864
|
onClickRightIcon(e2);
|
|
11802
11865
|
}
|
|
11803
11866
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11804
|
-
classPrefix:
|
|
11805
|
-
fontClassName:
|
|
11867
|
+
classPrefix: iconClassPrefix,
|
|
11868
|
+
fontClassName: iconFontClassName,
|
|
11806
11869
|
name: rightIcon,
|
|
11807
11870
|
size: rightIconSize
|
|
11808
11871
|
})) : null, slotButton ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -11887,7 +11950,10 @@
|
|
|
11887
11950
|
}
|
|
11888
11951
|
};
|
|
11889
11952
|
const Radio = (props) => {
|
|
11890
|
-
const { children } = {
|
|
11953
|
+
const { children } = {
|
|
11954
|
+
...defaultProps$R,
|
|
11955
|
+
...props
|
|
11956
|
+
};
|
|
11891
11957
|
const {
|
|
11892
11958
|
className,
|
|
11893
11959
|
disabled,
|
|
@@ -11899,6 +11965,8 @@
|
|
|
11899
11965
|
iconActiveName,
|
|
11900
11966
|
iconSize,
|
|
11901
11967
|
onChange,
|
|
11968
|
+
iconClassPrefix,
|
|
11969
|
+
iconFontClassName,
|
|
11902
11970
|
...rest
|
|
11903
11971
|
} = props;
|
|
11904
11972
|
const componentName = "nut-radio";
|
|
@@ -11933,8 +12001,8 @@
|
|
|
11933
12001
|
const renderIcon = () => {
|
|
11934
12002
|
const { iconName: iconName2, iconSize: iconSize2, iconActiveName: iconActiveName2 } = props;
|
|
11935
12003
|
return /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
11936
|
-
classPrefix:
|
|
11937
|
-
fontClassName:
|
|
12004
|
+
classPrefix: iconClassPrefix,
|
|
12005
|
+
fontClassName: iconFontClassName,
|
|
11938
12006
|
name: checkedStatement ? iconActiveName2 : iconName2,
|
|
11939
12007
|
size: iconSize2,
|
|
11940
12008
|
className: color()
|
|
@@ -11995,8 +12063,13 @@
|
|
|
11995
12063
|
readonly,
|
|
11996
12064
|
allowHalf,
|
|
11997
12065
|
spacing,
|
|
11998
|
-
onChange
|
|
11999
|
-
|
|
12066
|
+
onChange,
|
|
12067
|
+
iconClassPrefix,
|
|
12068
|
+
iconFontClassName
|
|
12069
|
+
} = {
|
|
12070
|
+
...defaultProps$Q,
|
|
12071
|
+
...props
|
|
12072
|
+
};
|
|
12000
12073
|
const b2 = cn("rate");
|
|
12001
12074
|
const bi = cn("rate-item");
|
|
12002
12075
|
const [countArray, setCountArray] = React.useState([1, 2, 3, 4, 5]);
|
|
@@ -12045,15 +12118,15 @@
|
|
|
12045
12118
|
onClick: (event) => onClick(event, n2),
|
|
12046
12119
|
style: { marginRight: pxCheck2(spacing) }
|
|
12047
12120
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12048
|
-
classPrefix:
|
|
12049
|
-
fontClassName:
|
|
12121
|
+
classPrefix: iconClassPrefix,
|
|
12122
|
+
fontClassName: iconFontClassName,
|
|
12050
12123
|
size: iconSize,
|
|
12051
12124
|
className: `${bi("icon")} ${disabled || n2 > score ? bi("icon--disabled") : ""}`,
|
|
12052
12125
|
name: n2 <= score ? checkedIcon : uncheckedIcon,
|
|
12053
12126
|
color: n2 <= score ? activeColor : voidColor
|
|
12054
12127
|
}), allowHalf && score > n2 - 1 && /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12055
|
-
classPrefix:
|
|
12056
|
-
fontClassName:
|
|
12128
|
+
classPrefix: iconClassPrefix,
|
|
12129
|
+
fontClassName: iconFontClassName,
|
|
12057
12130
|
onClick: (event) => onHalfClick(event, n2),
|
|
12058
12131
|
className: `${bi("icon")} ${bi("icon--half")}`,
|
|
12059
12132
|
color: n2 <= score ? activeColor : voidColor,
|
|
@@ -12109,6 +12182,8 @@
|
|
|
12109
12182
|
onCancel,
|
|
12110
12183
|
onClose,
|
|
12111
12184
|
onComplete,
|
|
12185
|
+
iconClassPrefix,
|
|
12186
|
+
iconFontClassName,
|
|
12112
12187
|
...reset
|
|
12113
12188
|
} = props;
|
|
12114
12189
|
const b2 = cn("shortpassword");
|
|
@@ -12213,8 +12288,8 @@
|
|
|
12213
12288
|
}, errorMsg2), tips || locale.shortpassword.tips ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12214
12289
|
className: b2("message__forget")
|
|
12215
12290
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12216
|
-
classPrefix:
|
|
12217
|
-
fontClassName:
|
|
12291
|
+
classPrefix: iconClassPrefix,
|
|
12292
|
+
fontClassName: iconFontClassName,
|
|
12218
12293
|
className: "icon",
|
|
12219
12294
|
size: "11px",
|
|
12220
12295
|
name: "tips"
|
|
@@ -12329,138 +12404,306 @@
|
|
|
12329
12404
|
};
|
|
12330
12405
|
TextArea.defaultProps = defaultProps$O;
|
|
12331
12406
|
TextArea.displayName = "NutTextArea";
|
|
12332
|
-
class UploadOptions {
|
|
12333
|
-
constructor() {
|
|
12334
|
-
this.url = "";
|
|
12335
|
-
this.name = "file";
|
|
12336
|
-
this.method = "post";
|
|
12337
|
-
this.xhrState = 200;
|
|
12338
|
-
this.timeout = 30 * 1e3;
|
|
12339
|
-
this.headers = {};
|
|
12340
|
-
this.withCredentials = false;
|
|
12341
|
-
}
|
|
12342
|
-
}
|
|
12343
|
-
class Upload {
|
|
12344
|
-
constructor(options2) {
|
|
12345
|
-
this.options = options2;
|
|
12346
|
-
}
|
|
12347
|
-
upload() {
|
|
12348
|
-
var _a;
|
|
12349
|
-
const { options: options2 } = this;
|
|
12350
|
-
const xhr = new XMLHttpRequest();
|
|
12351
|
-
xhr.timeout = options2.timeout;
|
|
12352
|
-
if (xhr.upload) {
|
|
12353
|
-
xhr.upload.addEventListener(
|
|
12354
|
-
"progress",
|
|
12355
|
-
(e2) => {
|
|
12356
|
-
var _a2;
|
|
12357
|
-
(_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, e2, options2);
|
|
12358
|
-
},
|
|
12359
|
-
false
|
|
12360
|
-
);
|
|
12361
|
-
xhr.onreadystatechange = () => {
|
|
12362
|
-
var _a2, _b;
|
|
12363
|
-
if (xhr.readyState === 4) {
|
|
12364
|
-
if (xhr.status === options2.xhrState) {
|
|
12365
|
-
(_a2 = options2.onSuccess) == null ? void 0 : _a2.call(options2, xhr.responseText, options2);
|
|
12366
|
-
} else {
|
|
12367
|
-
(_b = options2.onFailure) == null ? void 0 : _b.call(options2, xhr.responseText, options2);
|
|
12368
|
-
}
|
|
12369
|
-
}
|
|
12370
|
-
};
|
|
12371
|
-
xhr.withCredentials = options2.withCredentials;
|
|
12372
|
-
xhr.open(options2.method, options2.url, true);
|
|
12373
|
-
for (const [key, value] of Object.entries(options2.headers)) {
|
|
12374
|
-
xhr.setRequestHeader(key, value);
|
|
12375
|
-
}
|
|
12376
|
-
(_a = options2.onStart) == null ? void 0 : _a.call(options2, options2);
|
|
12377
|
-
xhr.send(options2.formData);
|
|
12378
|
-
} else {
|
|
12379
|
-
console.warn("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 XMLHttpRequest");
|
|
12380
|
-
}
|
|
12381
|
-
}
|
|
12382
|
-
}
|
|
12383
12407
|
const defaultProps$N = {
|
|
12384
12408
|
...ComponentDefaults,
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12423
|
-
|
|
12424
|
-
|
|
12425
|
-
|
|
12426
|
-
|
|
12409
|
+
className: "",
|
|
12410
|
+
style: {},
|
|
12411
|
+
isShowPercentage: true,
|
|
12412
|
+
percentage: 0,
|
|
12413
|
+
fillColor: "#f3f3f3",
|
|
12414
|
+
strokeColor: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
12415
|
+
strokeWidth: "",
|
|
12416
|
+
textColor: "",
|
|
12417
|
+
textWidth: "",
|
|
12418
|
+
showText: true,
|
|
12419
|
+
textInside: false,
|
|
12420
|
+
textBackground: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
12421
|
+
textType: "text",
|
|
12422
|
+
status: false,
|
|
12423
|
+
iconName: "checked",
|
|
12424
|
+
iconColor: "#439422",
|
|
12425
|
+
iconSize: "16px",
|
|
12426
|
+
rounded: true,
|
|
12427
|
+
children: void 0
|
|
12428
|
+
};
|
|
12429
|
+
const Progress = (props) => {
|
|
12430
|
+
const {
|
|
12431
|
+
className,
|
|
12432
|
+
style,
|
|
12433
|
+
isShowPercentage,
|
|
12434
|
+
percentage,
|
|
12435
|
+
fillColor,
|
|
12436
|
+
strokeColor,
|
|
12437
|
+
strokeWidth,
|
|
12438
|
+
size,
|
|
12439
|
+
textColor,
|
|
12440
|
+
textWidth,
|
|
12441
|
+
showText,
|
|
12442
|
+
textInside,
|
|
12443
|
+
textBackground,
|
|
12444
|
+
textType,
|
|
12445
|
+
status,
|
|
12446
|
+
iconName,
|
|
12447
|
+
iconColor,
|
|
12448
|
+
iconSize,
|
|
12449
|
+
rounded,
|
|
12450
|
+
children,
|
|
12451
|
+
iconClassPrefix,
|
|
12452
|
+
iconFontClassName,
|
|
12453
|
+
...rest
|
|
12454
|
+
} = {
|
|
12455
|
+
...defaultProps$N,
|
|
12456
|
+
...props
|
|
12457
|
+
};
|
|
12458
|
+
const b2 = cn("progress");
|
|
12459
|
+
const classes = classNames(b2(""));
|
|
12460
|
+
const classesOuter = classNames({
|
|
12461
|
+
[`${b2("")}-outer`]: true,
|
|
12462
|
+
[`${b2("")}-${size || "base"}`]: true
|
|
12463
|
+
});
|
|
12464
|
+
const classesInner = classNames({
|
|
12465
|
+
[`${b2("")}-inner`]: true,
|
|
12466
|
+
[`${b2("")}-active`]: status
|
|
12467
|
+
});
|
|
12468
|
+
const classesText = classNames({
|
|
12469
|
+
[`${b2("")}-text`]: true
|
|
12470
|
+
});
|
|
12471
|
+
const classesInsideText = classNames({
|
|
12472
|
+
[`${b2("")}-text`]: true,
|
|
12473
|
+
[`${b2("")}-insidetext`]: true
|
|
12474
|
+
});
|
|
12475
|
+
const classesTextInner = classNames({
|
|
12476
|
+
[`${b2("")}-text__inner`]: true
|
|
12477
|
+
});
|
|
12478
|
+
const stylesOuter = {
|
|
12479
|
+
height: `${strokeWidth}px`,
|
|
12480
|
+
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
12481
|
+
background: `${fillColor}`
|
|
12482
|
+
};
|
|
12483
|
+
const stylesInner = {
|
|
12484
|
+
width: `${percentage}%`,
|
|
12485
|
+
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
12486
|
+
background: `${strokeColor}`
|
|
12487
|
+
};
|
|
12488
|
+
const stylesInsideText = {
|
|
12489
|
+
width: `${textWidth}px`,
|
|
12490
|
+
left: `${percentage}%`,
|
|
12491
|
+
background: textBackground || strokeColor
|
|
12492
|
+
};
|
|
12493
|
+
const stylesInsideIcon = {
|
|
12494
|
+
width: `${textWidth}px`,
|
|
12495
|
+
left: `${percentage}%`
|
|
12496
|
+
};
|
|
12497
|
+
const stylesText = {
|
|
12498
|
+
width: `${textWidth}px`
|
|
12499
|
+
};
|
|
12500
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12501
|
+
className: `${classes} ${className}`,
|
|
12502
|
+
style,
|
|
12503
|
+
...rest
|
|
12504
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12505
|
+
className: classesOuter,
|
|
12506
|
+
style: stylesOuter
|
|
12507
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12508
|
+
className: classesInner,
|
|
12509
|
+
style: stylesInner
|
|
12510
|
+
}, showText && textInside && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12511
|
+
className: classesInsideText,
|
|
12512
|
+
style: stylesInsideIcon
|
|
12513
|
+
}, children) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12514
|
+
className: classesInsideText,
|
|
12515
|
+
style: stylesInsideText
|
|
12516
|
+
}, /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
12517
|
+
className: classesTextInner,
|
|
12518
|
+
style: { color: textColor || "#fff" }
|
|
12519
|
+
}, percentage, isShowPercentage ? "%" : ""))))), showText && !textInside && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12520
|
+
className: classesText,
|
|
12521
|
+
style: stylesText
|
|
12522
|
+
}, textType === "text" && /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
12523
|
+
className: classesTextInner,
|
|
12524
|
+
style: { color: textColor || "#333" }
|
|
12525
|
+
}, percentage, isShowPercentage ? "%" : ""), textType === "icon" && /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12526
|
+
classPrefix: iconClassPrefix,
|
|
12527
|
+
fontClassName: iconFontClassName,
|
|
12528
|
+
size: iconSize,
|
|
12529
|
+
name: iconName,
|
|
12530
|
+
color: iconColor
|
|
12531
|
+
})));
|
|
12532
|
+
};
|
|
12533
|
+
Progress.defaultProps = defaultProps$N;
|
|
12534
|
+
Progress.displayName = "NutProgress";
|
|
12535
|
+
class UploadOptions {
|
|
12536
|
+
constructor() {
|
|
12537
|
+
this.url = "";
|
|
12538
|
+
this.name = "file";
|
|
12539
|
+
this.fileType = "image";
|
|
12540
|
+
this.method = "post";
|
|
12541
|
+
this.xhrState = 200;
|
|
12542
|
+
this.timeout = 30 * 1e3;
|
|
12543
|
+
this.headers = {};
|
|
12544
|
+
this.withCredentials = false;
|
|
12545
|
+
}
|
|
12546
|
+
}
|
|
12547
|
+
class Upload {
|
|
12548
|
+
constructor(options2) {
|
|
12549
|
+
this.options = options2;
|
|
12550
|
+
}
|
|
12551
|
+
upload() {
|
|
12552
|
+
var _a;
|
|
12553
|
+
const { options: options2 } = this;
|
|
12554
|
+
const xhr = new XMLHttpRequest();
|
|
12555
|
+
xhr.timeout = options2.timeout;
|
|
12556
|
+
if (xhr.upload) {
|
|
12557
|
+
xhr.upload.addEventListener(
|
|
12558
|
+
"progress",
|
|
12559
|
+
(e2) => {
|
|
12560
|
+
var _a2;
|
|
12561
|
+
(_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, e2, options2);
|
|
12562
|
+
},
|
|
12563
|
+
false
|
|
12564
|
+
);
|
|
12565
|
+
xhr.onreadystatechange = () => {
|
|
12566
|
+
var _a2, _b;
|
|
12567
|
+
if (xhr.readyState === 4) {
|
|
12568
|
+
if (xhr.status === options2.xhrState) {
|
|
12569
|
+
(_a2 = options2.onSuccess) == null ? void 0 : _a2.call(options2, xhr.responseText, options2);
|
|
12570
|
+
} else {
|
|
12571
|
+
(_b = options2.onFailure) == null ? void 0 : _b.call(options2, xhr.responseText, options2);
|
|
12572
|
+
}
|
|
12573
|
+
}
|
|
12574
|
+
};
|
|
12575
|
+
xhr.withCredentials = options2.withCredentials;
|
|
12576
|
+
xhr.open(options2.method, options2.url, true);
|
|
12577
|
+
for (const [key, value] of Object.entries(options2.headers)) {
|
|
12578
|
+
xhr.setRequestHeader(key, value);
|
|
12579
|
+
}
|
|
12580
|
+
(_a = options2.onStart) == null ? void 0 : _a.call(options2, options2);
|
|
12581
|
+
if (options2.beforeXhrUpload) {
|
|
12582
|
+
options2.beforeXhrUpload(xhr, options2);
|
|
12583
|
+
} else {
|
|
12584
|
+
xhr.send(options2.formData);
|
|
12585
|
+
}
|
|
12586
|
+
} else {
|
|
12587
|
+
console.warn("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 XMLHttpRequest");
|
|
12588
|
+
}
|
|
12589
|
+
}
|
|
12590
|
+
uploadTaro(uploadFile, env) {
|
|
12591
|
+
var _a;
|
|
12592
|
+
const options2 = this.options;
|
|
12593
|
+
if (env === "WEB") {
|
|
12594
|
+
this.upload();
|
|
12595
|
+
} else if (options2.beforeXhrUpload) {
|
|
12596
|
+
options2.beforeXhrUpload(uploadFile, options2);
|
|
12597
|
+
} else {
|
|
12598
|
+
const uploadTask = uploadFile({
|
|
12599
|
+
url: options2.url,
|
|
12600
|
+
filePath: options2.taroFilePath,
|
|
12601
|
+
fileType: options2.fileType,
|
|
12602
|
+
header: {
|
|
12603
|
+
"Content-Type": "multipart/form-data",
|
|
12604
|
+
...options2.headers
|
|
12605
|
+
},
|
|
12606
|
+
formData: options2.formData,
|
|
12607
|
+
name: options2.name,
|
|
12608
|
+
success(response) {
|
|
12609
|
+
var _a2, _b;
|
|
12610
|
+
if (options2.xhrState == response.statusCode) {
|
|
12611
|
+
(_a2 = options2.onSuccess) == null ? void 0 : _a2.call(options2, response, options2);
|
|
12612
|
+
} else {
|
|
12613
|
+
(_b = options2.onFailure) == null ? void 0 : _b.call(options2, response, options2);
|
|
12614
|
+
}
|
|
12615
|
+
},
|
|
12616
|
+
fail(e2) {
|
|
12617
|
+
var _a2;
|
|
12618
|
+
(_a2 = options2.onFailure) == null ? void 0 : _a2.call(options2, e2, options2);
|
|
12619
|
+
}
|
|
12620
|
+
});
|
|
12621
|
+
(_a = options2.onStart) == null ? void 0 : _a.call(options2, options2);
|
|
12622
|
+
uploadTask.progress(
|
|
12623
|
+
(res) => {
|
|
12624
|
+
var _a2;
|
|
12625
|
+
(_a2 = options2.onProgress) == null ? void 0 : _a2.call(options2, res, options2);
|
|
12626
|
+
}
|
|
12627
|
+
);
|
|
12628
|
+
}
|
|
12629
|
+
}
|
|
12630
|
+
}
|
|
12631
|
+
const defaultProps$M = {
|
|
12632
|
+
...ComponentDefaults,
|
|
12633
|
+
url: "",
|
|
12634
|
+
maximum: 9,
|
|
12635
|
+
sizeType: ["original", "compressed"],
|
|
12636
|
+
sourceType: ["album", "camera"],
|
|
12637
|
+
uploadIcon: "photograph",
|
|
12638
|
+
uploadIconSize: "",
|
|
12639
|
+
listType: "picture",
|
|
12640
|
+
name: "file",
|
|
12641
|
+
disabled: false,
|
|
12642
|
+
autoUpload: true,
|
|
12643
|
+
maximize: Number.MAX_VALUE,
|
|
12644
|
+
data: {},
|
|
12645
|
+
headers: {},
|
|
12646
|
+
method: "post",
|
|
12647
|
+
defaultImg: "",
|
|
12648
|
+
xhrState: 200,
|
|
12649
|
+
timeout: 1e3 * 30,
|
|
12650
|
+
isPreview: true,
|
|
12651
|
+
isDeletable: true,
|
|
12652
|
+
onBeforeDelete: (file, files) => {
|
|
12653
|
+
return true;
|
|
12654
|
+
}
|
|
12655
|
+
};
|
|
12656
|
+
class FileItem {
|
|
12657
|
+
constructor() {
|
|
12658
|
+
this.status = "ready";
|
|
12659
|
+
this.message = "\u51C6\u5907\u4E2D..";
|
|
12660
|
+
this.uid = new Date().getTime().toString();
|
|
12661
|
+
this.percentage = 0;
|
|
12662
|
+
this.formData = {};
|
|
12663
|
+
}
|
|
12664
|
+
}
|
|
12665
|
+
const InternalUploader = (props, ref) => {
|
|
12666
|
+
const { locale } = useConfig$1();
|
|
12667
|
+
const {
|
|
12668
|
+
children,
|
|
12669
|
+
uploadIcon,
|
|
12670
|
+
uploadIconSize,
|
|
12671
|
+
name,
|
|
12427
12672
|
defaultFileList,
|
|
12428
12673
|
listType,
|
|
12429
12674
|
disabled,
|
|
12430
|
-
multiple,
|
|
12431
12675
|
url,
|
|
12432
12676
|
defaultImg,
|
|
12433
12677
|
headers,
|
|
12434
12678
|
timeout,
|
|
12435
12679
|
method,
|
|
12436
12680
|
xhrState,
|
|
12437
|
-
withCredentials,
|
|
12438
12681
|
data,
|
|
12439
12682
|
isPreview,
|
|
12440
12683
|
isDeletable,
|
|
12441
12684
|
maximum,
|
|
12442
|
-
capture,
|
|
12443
12685
|
maximize,
|
|
12444
12686
|
className,
|
|
12445
12687
|
autoUpload,
|
|
12446
|
-
|
|
12447
|
-
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
|
|
12453
|
-
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12457
|
-
|
|
12688
|
+
sizeType,
|
|
12689
|
+
sourceType,
|
|
12690
|
+
onStart,
|
|
12691
|
+
onRemove,
|
|
12692
|
+
onChange,
|
|
12693
|
+
onFileItemClick,
|
|
12694
|
+
onProgress,
|
|
12695
|
+
onSuccess,
|
|
12696
|
+
onUpdate,
|
|
12697
|
+
onFailure,
|
|
12698
|
+
onOversize,
|
|
12699
|
+
onBeforeUpload,
|
|
12700
|
+
onBeforeXhrUpload,
|
|
12701
|
+
onBeforeDelete,
|
|
12458
12702
|
...restProps
|
|
12459
|
-
} = { ...defaultProps$
|
|
12703
|
+
} = { ...defaultProps$M, ...props };
|
|
12460
12704
|
const [fileList, setFileList] = React.useState([]);
|
|
12461
12705
|
const [uploadQueue, setUploadQueue] = React.useState([]);
|
|
12462
12706
|
React.useEffect(() => {
|
|
12463
|
-
console.log("defaultFileList", defaultFileList);
|
|
12464
12707
|
if (defaultFileList) {
|
|
12465
12708
|
setFileList(defaultFileList);
|
|
12466
12709
|
}
|
|
@@ -12470,7 +12713,7 @@
|
|
|
12470
12713
|
React.useImperativeHandle(ref, () => ({
|
|
12471
12714
|
submit: () => {
|
|
12472
12715
|
Promise.all(uploadQueue).then((res) => {
|
|
12473
|
-
res.forEach((i) => i.
|
|
12716
|
+
res.forEach((i) => i.uploadTaro(Taro__default["default"].uploadFile, Taro__default["default"].getEnv()));
|
|
12474
12717
|
});
|
|
12475
12718
|
}
|
|
12476
12719
|
}));
|
|
@@ -12482,21 +12725,29 @@
|
|
|
12482
12725
|
setUploadQueue([]);
|
|
12483
12726
|
}
|
|
12484
12727
|
};
|
|
12485
|
-
const
|
|
12486
|
-
|
|
12728
|
+
const chooseImage = () => {
|
|
12729
|
+
if (disabled) {
|
|
12730
|
+
return;
|
|
12731
|
+
}
|
|
12732
|
+
Taro__default["default"].chooseImage({
|
|
12733
|
+
count: maximum * 1 - fileList.length,
|
|
12734
|
+
sizeType,
|
|
12735
|
+
sourceType,
|
|
12736
|
+
success: onChangeFn
|
|
12737
|
+
});
|
|
12487
12738
|
};
|
|
12488
12739
|
const executeUpload = (fileItem, index2) => {
|
|
12489
12740
|
const uploadOption = new UploadOptions();
|
|
12741
|
+
uploadOption.name = name;
|
|
12490
12742
|
uploadOption.url = url;
|
|
12491
|
-
|
|
12492
|
-
fileItem.formData.append(key, value);
|
|
12493
|
-
}
|
|
12743
|
+
uploadOption.fileType = fileItem.type;
|
|
12494
12744
|
uploadOption.formData = fileItem.formData;
|
|
12495
12745
|
uploadOption.timeout = timeout * 1;
|
|
12496
12746
|
uploadOption.method = method;
|
|
12497
12747
|
uploadOption.xhrState = xhrState;
|
|
12498
12748
|
uploadOption.headers = headers;
|
|
12499
|
-
uploadOption.
|
|
12749
|
+
uploadOption.taroFilePath = fileItem.path;
|
|
12750
|
+
uploadOption.beforeXhrUpload = onBeforeXhrUpload;
|
|
12500
12751
|
uploadOption.onStart = (option) => {
|
|
12501
12752
|
clearUploadQueue(index2);
|
|
12502
12753
|
setFileList((fileList2) => {
|
|
@@ -12508,7 +12759,7 @@
|
|
|
12508
12759
|
});
|
|
12509
12760
|
return [...fileList2];
|
|
12510
12761
|
});
|
|
12511
|
-
|
|
12762
|
+
onStart && onStart(option);
|
|
12512
12763
|
};
|
|
12513
12764
|
uploadOption.onProgress = (e2, option) => {
|
|
12514
12765
|
setFileList((fileList2) => {
|
|
@@ -12516,15 +12767,16 @@
|
|
|
12516
12767
|
if (item.uid === fileItem.uid) {
|
|
12517
12768
|
item.status = "uploading";
|
|
12518
12769
|
item.message = locale.uploader.uploading;
|
|
12770
|
+
item.percentage = e2.progress;
|
|
12771
|
+
onProgress && onProgress({ e: e2, option, percentage: item.percentage });
|
|
12519
12772
|
}
|
|
12520
12773
|
});
|
|
12521
12774
|
return [...fileList2];
|
|
12522
12775
|
});
|
|
12523
|
-
progress && progress({ e: e2, option });
|
|
12524
12776
|
};
|
|
12525
12777
|
uploadOption.onSuccess = (responseText, option) => {
|
|
12526
12778
|
setFileList((fileList2) => {
|
|
12527
|
-
|
|
12779
|
+
onUpdate && onUpdate(fileList2);
|
|
12528
12780
|
fileList2.map((item) => {
|
|
12529
12781
|
if (item.uid === fileItem.uid) {
|
|
12530
12782
|
item.status = "success";
|
|
@@ -12533,7 +12785,7 @@
|
|
|
12533
12785
|
});
|
|
12534
12786
|
return [...fileList2];
|
|
12535
12787
|
});
|
|
12536
|
-
|
|
12788
|
+
onSuccess && onSuccess({
|
|
12537
12789
|
responseText,
|
|
12538
12790
|
option
|
|
12539
12791
|
});
|
|
@@ -12548,14 +12800,14 @@
|
|
|
12548
12800
|
});
|
|
12549
12801
|
return [...fileList2];
|
|
12550
12802
|
});
|
|
12551
|
-
|
|
12803
|
+
onFailure && onFailure({
|
|
12552
12804
|
responseText,
|
|
12553
12805
|
option
|
|
12554
12806
|
});
|
|
12555
12807
|
};
|
|
12556
12808
|
const task = new Upload(uploadOption);
|
|
12557
12809
|
if (props.autoUpload) {
|
|
12558
|
-
task.
|
|
12810
|
+
task.uploadTaro(Taro__default["default"].uploadFile, Taro__default["default"].getEnv());
|
|
12559
12811
|
} else {
|
|
12560
12812
|
uploadQueue.push(
|
|
12561
12813
|
new Promise((resolve, reject) => {
|
|
@@ -12566,111 +12818,95 @@
|
|
|
12566
12818
|
}
|
|
12567
12819
|
};
|
|
12568
12820
|
const readFile = (files) => {
|
|
12821
|
+
const imgReg = /\.(png|jpeg|jpg|webp|gif)$/i;
|
|
12569
12822
|
files.forEach((file, index2) => {
|
|
12570
|
-
|
|
12571
|
-
|
|
12823
|
+
var _a, _b;
|
|
12824
|
+
console.log("file", file);
|
|
12825
|
+
let fileType = file.type;
|
|
12572
12826
|
const fileItem = new FileItem();
|
|
12573
|
-
|
|
12827
|
+
if (!fileType && imgReg.test(file.path)) {
|
|
12828
|
+
fileType = "image";
|
|
12829
|
+
}
|
|
12830
|
+
fileItem.path = file.path;
|
|
12831
|
+
fileItem.name = file.path;
|
|
12574
12832
|
fileItem.status = "ready";
|
|
12575
|
-
fileItem.type = file.type;
|
|
12576
|
-
fileItem.formData = formData;
|
|
12577
|
-
fileItem.uid = file.lastModified + fileItem.uid;
|
|
12578
12833
|
fileItem.message = locale.uploader.readyUpload;
|
|
12579
|
-
|
|
12580
|
-
if (
|
|
12581
|
-
const
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
12834
|
+
fileItem.type = fileType;
|
|
12835
|
+
if (Taro__default["default"].getEnv() == "WEB") {
|
|
12836
|
+
const formData = new FormData();
|
|
12837
|
+
for (const [key, value] of Object.entries(data)) {
|
|
12838
|
+
formData.append(key, value);
|
|
12839
|
+
}
|
|
12840
|
+
formData.append(name, file.originalFileObj);
|
|
12841
|
+
fileItem.name = (_a = file.originalFileObj) == null ? void 0 : _a.name;
|
|
12842
|
+
fileItem.type = (_b = file.originalFileObj) == null ? void 0 : _b.type;
|
|
12843
|
+
fileItem.formData = formData;
|
|
12588
12844
|
} else {
|
|
12589
|
-
|
|
12590
|
-
setFileList([...fileList]);
|
|
12845
|
+
fileItem.formData = data;
|
|
12591
12846
|
}
|
|
12847
|
+
if (isPreview) {
|
|
12848
|
+
fileItem.url = file.path;
|
|
12849
|
+
}
|
|
12850
|
+
fileList.push(fileItem);
|
|
12851
|
+
setFileList([...fileList]);
|
|
12852
|
+
executeUpload(fileItem, index2);
|
|
12592
12853
|
});
|
|
12593
12854
|
};
|
|
12594
12855
|
const filterFiles = (files) => {
|
|
12595
12856
|
const maximum2 = props.maximum * 1;
|
|
12857
|
+
const maximize2 = props.maximize * 1;
|
|
12596
12858
|
const oversizes = new Array();
|
|
12597
12859
|
const filterFile = files.filter((file) => {
|
|
12598
|
-
if (file.size >
|
|
12860
|
+
if (file.size > maximize2) {
|
|
12599
12861
|
oversizes.push(file);
|
|
12600
12862
|
return false;
|
|
12601
12863
|
}
|
|
12602
12864
|
return true;
|
|
12603
12865
|
});
|
|
12604
12866
|
if (oversizes.length) {
|
|
12605
|
-
|
|
12606
|
-
}
|
|
12607
|
-
if (filterFile.length > maximum2) {
|
|
12608
|
-
filterFile.splice(maximum2, filterFile.length - maximum2);
|
|
12867
|
+
onOversize && onOversize(files);
|
|
12609
12868
|
}
|
|
12610
|
-
|
|
12611
|
-
|
|
12612
|
-
filterFile.splice(
|
|
12869
|
+
let currentFileLength = filterFile.length + fileList.length;
|
|
12870
|
+
if (currentFileLength > maximum2) {
|
|
12871
|
+
filterFile.splice(filterFile.length - (currentFileLength - maximum2));
|
|
12613
12872
|
}
|
|
12614
12873
|
return filterFile;
|
|
12615
12874
|
};
|
|
12616
12875
|
const onDelete = (file, index2) => {
|
|
12617
12876
|
clearUploadQueue(index2);
|
|
12618
|
-
if (
|
|
12877
|
+
if (onBeforeDelete && onBeforeDelete(file, fileList)) {
|
|
12619
12878
|
fileList.splice(index2, 1);
|
|
12620
|
-
|
|
12879
|
+
onRemove && onRemove(file, fileList);
|
|
12621
12880
|
setFileList([...fileList]);
|
|
12622
12881
|
} else {
|
|
12623
12882
|
console.log(locale.uploader.deleteWord);
|
|
12624
12883
|
}
|
|
12625
12884
|
};
|
|
12626
|
-
const
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
beforeUpload(new Array().slice.call(files)).then(
|
|
12634
|
-
(f2) => {
|
|
12635
|
-
const _files = filterFiles(new Array().slice.call(f2));
|
|
12636
|
-
readFile(_files);
|
|
12637
|
-
}
|
|
12638
|
-
);
|
|
12885
|
+
const onChangeFn = (res) => {
|
|
12886
|
+
const { tempFiles } = res;
|
|
12887
|
+
if (onBeforeUpload) {
|
|
12888
|
+
onBeforeUpload(tempFiles).then((f2) => {
|
|
12889
|
+
const _files = filterFiles(f2);
|
|
12890
|
+
readFile(_files);
|
|
12891
|
+
});
|
|
12639
12892
|
} else {
|
|
12640
|
-
const _files = filterFiles(
|
|
12893
|
+
const _files = filterFiles(tempFiles);
|
|
12641
12894
|
readFile(_files);
|
|
12642
12895
|
}
|
|
12643
|
-
|
|
12644
|
-
if (clearInput) {
|
|
12645
|
-
clearInputValue($el);
|
|
12646
|
-
}
|
|
12896
|
+
onChange && onChange({ fileList });
|
|
12647
12897
|
};
|
|
12648
12898
|
const handleItemClick = (file) => {
|
|
12649
|
-
|
|
12899
|
+
onFileItemClick && onFileItemClick(file);
|
|
12650
12900
|
};
|
|
12651
12901
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12652
12902
|
className: classes,
|
|
12653
12903
|
...restProps
|
|
12654
12904
|
}, children && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12655
12905
|
className: "nut-uploader__slot"
|
|
12656
|
-
}, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children, maximum > fileList.length && /* @__PURE__ */ React__default["default"].createElement(
|
|
12906
|
+
}, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children, maximum > fileList.length && /* @__PURE__ */ React__default["default"].createElement(Button$1, {
|
|
12657
12907
|
className: "nut-uploader__input",
|
|
12658
|
-
|
|
12659
|
-
|
|
12660
|
-
name,
|
|
12661
|
-
accept,
|
|
12662
|
-
disabled,
|
|
12663
|
-
multiple,
|
|
12664
|
-
onChange: fileChange
|
|
12665
|
-
}) : /* @__PURE__ */ React__default["default"].createElement("input", {
|
|
12666
|
-
className: "nut-uploader__input",
|
|
12667
|
-
type: "file",
|
|
12668
|
-
name,
|
|
12669
|
-
accept,
|
|
12670
|
-
disabled,
|
|
12671
|
-
multiple,
|
|
12672
|
-
onChange: fileChange
|
|
12673
|
-
})))), fileList.length !== 0 && fileList.map((item, index2) => {
|
|
12908
|
+
onClick: chooseImage
|
|
12909
|
+
}))), fileList.length !== 0 && fileList.map((item, index2) => {
|
|
12674
12910
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12675
12911
|
className: `nut-uploader__preview ${listType}`,
|
|
12676
12912
|
key: item.uid
|
|
@@ -12682,20 +12918,20 @@
|
|
|
12682
12918
|
className: "nut-uploader__preview__progress__msg"
|
|
12683
12919
|
}, item.message)) : item.status !== "success" && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12684
12920
|
className: "nut-uploader__preview__progress"
|
|
12685
|
-
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12921
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12686
12922
|
classPrefix: props.iconClassPrefix,
|
|
12687
12923
|
fontClassName: props.iconFontClassName,
|
|
12688
12924
|
color: "#fff",
|
|
12689
12925
|
name: `${item.status == "error" ? "failure" : "loading"}`
|
|
12690
12926
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12691
12927
|
className: "nut-uploader__preview__progress__msg"
|
|
12692
|
-
}, item.message)), isDeletable && /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12928
|
+
}, item.message)), isDeletable && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12693
12929
|
classPrefix: props.iconClassPrefix,
|
|
12694
12930
|
fontClassName: props.iconFontClassName,
|
|
12695
12931
|
color: "rgba(0,0,0,0.6)",
|
|
12696
12932
|
className: "close",
|
|
12697
12933
|
name: "failure",
|
|
12698
|
-
|
|
12934
|
+
onClick: () => onDelete(item, index2)
|
|
12699
12935
|
}), item.type.includes("image") ? /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, item.url && /* @__PURE__ */ React__default["default"].createElement("img", {
|
|
12700
12936
|
className: "nut-uploader__preview-img__c",
|
|
12701
12937
|
src: item.url,
|
|
@@ -12709,7 +12945,7 @@
|
|
|
12709
12945
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12710
12946
|
onClick: () => handleItemClick(item),
|
|
12711
12947
|
className: "nut-uploader__preview-img__file__name"
|
|
12712
|
-
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12948
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12713
12949
|
classPrefix: props.iconClassPrefix,
|
|
12714
12950
|
fontClassName: props.iconFontClassName,
|
|
12715
12951
|
color: "#808080",
|
|
@@ -12721,49 +12957,40 @@
|
|
|
12721
12957
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12722
12958
|
className: `nut-uploader__preview-img__file__name ${item.status}`,
|
|
12723
12959
|
onClick: () => handleItemClick(item)
|
|
12724
|
-
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12960
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12725
12961
|
classPrefix: props.iconClassPrefix,
|
|
12726
12962
|
fontClassName: props.iconFontClassName,
|
|
12727
12963
|
name: "link"
|
|
12728
|
-
}), "\xA0", item.name), /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12964
|
+
}), "\xA0", item.name), /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12729
12965
|
classPrefix: props.iconClassPrefix,
|
|
12730
12966
|
fontClassName: props.iconFontClassName,
|
|
12731
12967
|
color: "#808080",
|
|
12732
12968
|
className: "nut-uploader__preview-img__file__del",
|
|
12733
12969
|
name: "del",
|
|
12734
|
-
|
|
12970
|
+
onClick: () => onDelete(item, index2)
|
|
12971
|
+
}), item.status === "uploading" && /* @__PURE__ */ React__default["default"].createElement(Progress, {
|
|
12972
|
+
size: "small",
|
|
12973
|
+
percentage: item.percentage,
|
|
12974
|
+
strokeColor: "linear-gradient(270deg, rgba(18,126,255,1) 0%,rgba(32,147,255,1) 32.815625%,rgba(13,242,204,1) 100%)",
|
|
12975
|
+
showText: false
|
|
12735
12976
|
})));
|
|
12736
12977
|
}), maximum > fileList.length && listType === "picture" && !children && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12737
12978
|
className: `nut-uploader__upload ${listType}`
|
|
12738
|
-
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
12979
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
12739
12980
|
classPrefix: props.iconClassPrefix,
|
|
12740
12981
|
fontClassName: props.iconFontClassName,
|
|
12741
12982
|
size: uploadIconSize,
|
|
12742
12983
|
color: "#808080",
|
|
12743
12984
|
name: uploadIcon
|
|
12744
|
-
}),
|
|
12745
|
-
className: "nut-uploader__input",
|
|
12746
|
-
type: "file",
|
|
12747
|
-
capture: "user",
|
|
12748
|
-
name,
|
|
12749
|
-
accept,
|
|
12750
|
-
disabled,
|
|
12751
|
-
multiple,
|
|
12752
|
-
onChange: fileChange
|
|
12753
|
-
}) : /* @__PURE__ */ React__default["default"].createElement("input", {
|
|
12985
|
+
}), /* @__PURE__ */ React__default["default"].createElement(Button$1, {
|
|
12754
12986
|
className: "nut-uploader__input",
|
|
12755
|
-
|
|
12756
|
-
name,
|
|
12757
|
-
accept,
|
|
12758
|
-
disabled,
|
|
12759
|
-
multiple,
|
|
12760
|
-
onChange: fileChange
|
|
12987
|
+
onClick: chooseImage
|
|
12761
12988
|
})));
|
|
12762
12989
|
};
|
|
12763
12990
|
const Uploader = React__default["default"].forwardRef(InternalUploader);
|
|
12764
|
-
Uploader.defaultProps = defaultProps$
|
|
12991
|
+
Uploader.defaultProps = defaultProps$M;
|
|
12765
12992
|
Uploader.displayName = "NutUploader";
|
|
12766
|
-
const defaultProps$
|
|
12993
|
+
const defaultProps$L = {
|
|
12767
12994
|
data: {
|
|
12768
12995
|
text: "",
|
|
12769
12996
|
value: "",
|
|
@@ -12778,7 +13005,7 @@
|
|
|
12778
13005
|
};
|
|
12779
13006
|
const InternalCascaderItem = (props) => {
|
|
12780
13007
|
const { data, checked, chooseItem } = {
|
|
12781
|
-
...defaultProps$
|
|
13008
|
+
...defaultProps$L,
|
|
12782
13009
|
...props
|
|
12783
13010
|
};
|
|
12784
13011
|
const b2 = cn("cascader-item");
|
|
@@ -12814,7 +13041,7 @@
|
|
|
12814
13041
|
}));
|
|
12815
13042
|
};
|
|
12816
13043
|
const CascaderItem = React__default["default"].forwardRef(InternalCascaderItem);
|
|
12817
|
-
CascaderItem.defaultProps = defaultProps$
|
|
13044
|
+
CascaderItem.defaultProps = defaultProps$L;
|
|
12818
13045
|
CascaderItem.displayName = "NutCascaderItem";
|
|
12819
13046
|
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
12820
13047
|
const {
|
|
@@ -12948,7 +13175,7 @@
|
|
|
12948
13175
|
return pathNodes;
|
|
12949
13176
|
}
|
|
12950
13177
|
}
|
|
12951
|
-
const defaultProps$
|
|
13178
|
+
const defaultProps$K = {
|
|
12952
13179
|
className: "",
|
|
12953
13180
|
style: {},
|
|
12954
13181
|
visible: false,
|
|
@@ -12993,7 +13220,7 @@
|
|
|
12993
13220
|
onClose,
|
|
12994
13221
|
onChange,
|
|
12995
13222
|
onPathChange
|
|
12996
|
-
} = { ...defaultProps$
|
|
13223
|
+
} = { ...defaultProps$K, ...props };
|
|
12997
13224
|
const [tabvalue, setTabvalue] = React.useState("c1");
|
|
12998
13225
|
const [optiosData, setOptiosData] = React.useState([]);
|
|
12999
13226
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
|
|
@@ -13249,9 +13476,9 @@
|
|
|
13249
13476
|
})))));
|
|
13250
13477
|
};
|
|
13251
13478
|
const Cascader = React__default["default"].forwardRef(InternalCascader);
|
|
13252
|
-
Cascader.defaultProps = defaultProps$
|
|
13479
|
+
Cascader.defaultProps = defaultProps$K;
|
|
13253
13480
|
Cascader.displayName = "NutCascader";
|
|
13254
|
-
const defaultProps$
|
|
13481
|
+
const defaultProps$J = {
|
|
13255
13482
|
...ComponentDefaults,
|
|
13256
13483
|
placeholder: "",
|
|
13257
13484
|
shape: "square",
|
|
@@ -13297,9 +13524,11 @@
|
|
|
13297
13524
|
onClickLeftinIcon,
|
|
13298
13525
|
onClickLeftoutIcon,
|
|
13299
13526
|
onClickRightinIcon,
|
|
13300
|
-
onClickRightoutIcon
|
|
13527
|
+
onClickRightoutIcon,
|
|
13528
|
+
iconClassPrefix,
|
|
13529
|
+
iconFontClassName
|
|
13301
13530
|
} = {
|
|
13302
|
-
...defaultProps$
|
|
13531
|
+
...defaultProps$J,
|
|
13303
13532
|
...props
|
|
13304
13533
|
};
|
|
13305
13534
|
const alignClass = `${align}`;
|
|
@@ -13397,8 +13626,8 @@
|
|
|
13397
13626
|
className: `${searchbarBem("clear")} ${rightinIcon ? "pos-right" : ""}`,
|
|
13398
13627
|
onClick: (e2) => clearaVal(e2)
|
|
13399
13628
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
13400
|
-
classPrefix:
|
|
13401
|
-
fontClassName:
|
|
13629
|
+
classPrefix: iconClassPrefix,
|
|
13630
|
+
fontClassName: iconFontClassName,
|
|
13402
13631
|
name: "circle-close",
|
|
13403
13632
|
size: "12",
|
|
13404
13633
|
color: "#555"
|
|
@@ -13438,9 +13667,9 @@
|
|
|
13438
13667
|
className: `${searchbarBem("content")}`
|
|
13439
13668
|
}, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
|
|
13440
13669
|
};
|
|
13441
|
-
SearchBar.defaultProps = defaultProps$
|
|
13670
|
+
SearchBar.defaultProps = defaultProps$J;
|
|
13442
13671
|
SearchBar.displayName = "NutSearchBar";
|
|
13443
|
-
const defaultProps$
|
|
13672
|
+
const defaultProps$I = {
|
|
13444
13673
|
confirmText: "",
|
|
13445
13674
|
title: "",
|
|
13446
13675
|
visible: false,
|
|
@@ -13638,9 +13867,9 @@
|
|
|
13638
13867
|
})
|
|
13639
13868
|
}, confirmText || locale.done))) : null))));
|
|
13640
13869
|
};
|
|
13641
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
13870
|
+
NumberKeyboard.defaultProps = defaultProps$I;
|
|
13642
13871
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
13643
|
-
const defaultProps$
|
|
13872
|
+
const defaultProps$H = {
|
|
13644
13873
|
cancelTxt: "",
|
|
13645
13874
|
optionTag: "name",
|
|
13646
13875
|
optionSubTag: "subname",
|
|
@@ -13674,7 +13903,7 @@
|
|
|
13674
13903
|
className,
|
|
13675
13904
|
style,
|
|
13676
13905
|
...rest
|
|
13677
|
-
} = { ...defaultProps$
|
|
13906
|
+
} = { ...defaultProps$H, ...props };
|
|
13678
13907
|
const b2 = cn("actionsheet");
|
|
13679
13908
|
const isHighlight = (item) => {
|
|
13680
13909
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -13718,9 +13947,9 @@
|
|
|
13718
13947
|
onClick: () => cancelActionSheet()
|
|
13719
13948
|
}, cancelTxt)));
|
|
13720
13949
|
};
|
|
13721
|
-
ActionSheet.defaultProps = defaultProps$
|
|
13950
|
+
ActionSheet.defaultProps = defaultProps$H;
|
|
13722
13951
|
ActionSheet.displayName = "NutActionSheet";
|
|
13723
|
-
const defaultProps$
|
|
13952
|
+
const defaultProps$G = {
|
|
13724
13953
|
...ComponentDefaults,
|
|
13725
13954
|
bottom: 20,
|
|
13726
13955
|
right: 10,
|
|
@@ -13742,9 +13971,11 @@
|
|
|
13742
13971
|
className,
|
|
13743
13972
|
duration,
|
|
13744
13973
|
style,
|
|
13745
|
-
onClick
|
|
13974
|
+
onClick,
|
|
13975
|
+
iconClassPrefix,
|
|
13976
|
+
iconFontClassName
|
|
13746
13977
|
} = {
|
|
13747
|
-
...defaultProps$
|
|
13978
|
+
...defaultProps$G,
|
|
13748
13979
|
...props
|
|
13749
13980
|
};
|
|
13750
13981
|
const [backTop, SetBackTop] = React.useState(false);
|
|
@@ -13828,16 +14059,16 @@
|
|
|
13828
14059
|
goTop(e2);
|
|
13829
14060
|
}
|
|
13830
14061
|
}, children || /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
13831
|
-
classPrefix:
|
|
13832
|
-
fontClassName:
|
|
14062
|
+
classPrefix: iconClassPrefix,
|
|
14063
|
+
fontClassName: iconFontClassName,
|
|
13833
14064
|
size: "19px",
|
|
13834
14065
|
className: "nut-backtop-main",
|
|
13835
14066
|
name: "top"
|
|
13836
14067
|
}));
|
|
13837
14068
|
};
|
|
13838
|
-
BackTop.defaultProps = defaultProps$
|
|
14069
|
+
BackTop.defaultProps = defaultProps$G;
|
|
13839
14070
|
BackTop.displayName = "NutBackTop";
|
|
13840
|
-
const defaultProps$
|
|
14071
|
+
const defaultProps$F = {
|
|
13841
14072
|
attract: false,
|
|
13842
14073
|
direction: void 0,
|
|
13843
14074
|
boundary: {
|
|
@@ -13850,7 +14081,7 @@
|
|
|
13850
14081
|
};
|
|
13851
14082
|
const Drag = (props) => {
|
|
13852
14083
|
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
13853
|
-
...defaultProps$
|
|
14084
|
+
...defaultProps$F,
|
|
13854
14085
|
...props
|
|
13855
14086
|
};
|
|
13856
14087
|
const b2 = cn("drag");
|
|
@@ -13912,7 +14143,7 @@
|
|
|
13912
14143
|
...bind()
|
|
13913
14144
|
}, children));
|
|
13914
14145
|
};
|
|
13915
|
-
Drag.defaultProps = defaultProps$
|
|
14146
|
+
Drag.defaultProps = defaultProps$F;
|
|
13916
14147
|
Drag.displayName = "NutDrag";
|
|
13917
14148
|
const Content = (props) => {
|
|
13918
14149
|
const {
|
|
@@ -14011,7 +14242,7 @@
|
|
|
14011
14242
|
}));
|
|
14012
14243
|
};
|
|
14013
14244
|
DialogWrapper.displayName = "NutDialogWrapper";
|
|
14014
|
-
const defaultProps$
|
|
14245
|
+
const defaultProps$E = {
|
|
14015
14246
|
...ComponentDefaults,
|
|
14016
14247
|
className: "",
|
|
14017
14248
|
color: "",
|
|
@@ -14043,9 +14274,11 @@
|
|
|
14043
14274
|
onClick,
|
|
14044
14275
|
className,
|
|
14045
14276
|
style,
|
|
14277
|
+
iconClassPrefix,
|
|
14278
|
+
iconFontClassName,
|
|
14046
14279
|
...rest
|
|
14047
14280
|
} = {
|
|
14048
|
-
...defaultProps$
|
|
14281
|
+
...defaultProps$E,
|
|
14049
14282
|
...props
|
|
14050
14283
|
};
|
|
14051
14284
|
const getStyle = React.useCallback(() => {
|
|
@@ -14113,18 +14346,18 @@
|
|
|
14113
14346
|
className: "nut-button__warp",
|
|
14114
14347
|
style: getStyle()
|
|
14115
14348
|
}, loading && /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
14116
|
-
classPrefix:
|
|
14117
|
-
fontClassName:
|
|
14349
|
+
classPrefix: iconClassPrefix,
|
|
14350
|
+
fontClassName: iconFontClassName,
|
|
14118
14351
|
name: "loading"
|
|
14119
14352
|
}), !loading && icon ? /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
14120
|
-
classPrefix:
|
|
14121
|
-
fontClassName:
|
|
14353
|
+
classPrefix: iconClassPrefix,
|
|
14354
|
+
fontClassName: iconFontClassName,
|
|
14122
14355
|
name: icon
|
|
14123
14356
|
}) : "", children));
|
|
14124
14357
|
};
|
|
14125
|
-
Button.defaultProps = defaultProps$
|
|
14358
|
+
Button.defaultProps = defaultProps$E;
|
|
14126
14359
|
Button.displayName = "NutButton";
|
|
14127
|
-
const defaultProps$
|
|
14360
|
+
const defaultProps$D = {
|
|
14128
14361
|
okText: "\u786E\u8BA4",
|
|
14129
14362
|
cancelText: "\u53D6\u6D88",
|
|
14130
14363
|
mask: true,
|
|
@@ -14215,7 +14448,7 @@
|
|
|
14215
14448
|
});
|
|
14216
14449
|
};
|
|
14217
14450
|
});
|
|
14218
|
-
Dialog$1.defaultProps = defaultProps$
|
|
14451
|
+
Dialog$1.defaultProps = defaultProps$D;
|
|
14219
14452
|
Dialog$1.displayName = "NutDialog";
|
|
14220
14453
|
function ConfirmDialog(props) {
|
|
14221
14454
|
return /* @__PURE__ */ React__default["default"].createElement(Dialog$1, {
|
|
@@ -14313,7 +14546,7 @@
|
|
|
14313
14546
|
update: update2
|
|
14314
14547
|
};
|
|
14315
14548
|
}
|
|
14316
|
-
const defaultProps$
|
|
14549
|
+
const defaultProps$C = {
|
|
14317
14550
|
okText: "",
|
|
14318
14551
|
cancelText: "",
|
|
14319
14552
|
mask: true,
|
|
@@ -14404,15 +14637,18 @@
|
|
|
14404
14637
|
});
|
|
14405
14638
|
};
|
|
14406
14639
|
});
|
|
14407
|
-
Dialog.defaultProps = defaultProps$
|
|
14640
|
+
Dialog.defaultProps = defaultProps$C;
|
|
14408
14641
|
Dialog.displayName = "NutDialog";
|
|
14409
|
-
|
|
14642
|
+
var index_cjs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
14643
|
+
__proto__: null
|
|
14644
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
14645
|
+
var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index_cjs$1);
|
|
14646
|
+
var index_cjs = require$$0;
|
|
14647
|
+
const defaultProps$B = {
|
|
14410
14648
|
...ComponentDefaults,
|
|
14411
14649
|
hasMore: true,
|
|
14412
|
-
|
|
14650
|
+
upperThreshold: 40,
|
|
14413
14651
|
containerId: "",
|
|
14414
|
-
useWindow: true,
|
|
14415
|
-
useCapture: false,
|
|
14416
14652
|
isOpenRefresh: false,
|
|
14417
14653
|
pullIcon: "https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png",
|
|
14418
14654
|
pullTxt: "\u677E\u5F00\u5237\u65B0",
|
|
@@ -14425,10 +14661,8 @@
|
|
|
14425
14661
|
const {
|
|
14426
14662
|
children,
|
|
14427
14663
|
hasMore,
|
|
14428
|
-
|
|
14664
|
+
upperThreshold,
|
|
14429
14665
|
containerId,
|
|
14430
|
-
useWindow,
|
|
14431
|
-
useCapture,
|
|
14432
14666
|
isOpenRefresh,
|
|
14433
14667
|
pullIcon,
|
|
14434
14668
|
pullTxt,
|
|
@@ -14436,144 +14670,118 @@
|
|
|
14436
14670
|
loadTxt,
|
|
14437
14671
|
loadMoreTxt,
|
|
14438
14672
|
className,
|
|
14439
|
-
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
|
|
14673
|
+
onRefresh,
|
|
14674
|
+
onLoadMore,
|
|
14675
|
+
onScrollChange,
|
|
14676
|
+
iconClassPrefix,
|
|
14677
|
+
iconFontClassName
|
|
14443
14678
|
} = {
|
|
14444
|
-
...defaultProps$
|
|
14679
|
+
...defaultProps$B,
|
|
14445
14680
|
...props
|
|
14446
14681
|
};
|
|
14447
14682
|
const [isInfiniting, setIsInfiniting] = React.useState(false);
|
|
14448
|
-
const
|
|
14683
|
+
const [topDisScoll, setTopDisScoll] = React.useState(0);
|
|
14449
14684
|
const refreshTop = React.useRef(null);
|
|
14450
|
-
const
|
|
14685
|
+
const scrollHeight = React.useRef(0);
|
|
14686
|
+
const scrollTop = React.useRef(0);
|
|
14687
|
+
const direction = React.useRef("down");
|
|
14451
14688
|
const isTouching = React.useRef(false);
|
|
14452
|
-
const beforeScrollTop = React.useRef(0);
|
|
14453
|
-
const refreshMaxH = React.useRef(0);
|
|
14454
14689
|
const y2 = React.useRef(0);
|
|
14690
|
+
const refreshMaxH = React.useRef(0);
|
|
14455
14691
|
const distance = React.useRef(0);
|
|
14456
14692
|
const b2 = cn("infiniteloading");
|
|
14457
14693
|
const classes = classNames(className, b2());
|
|
14458
14694
|
React.useEffect(() => {
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
scrollEl.current.addEventListener("scroll", handleScroll, useCapture);
|
|
14464
|
-
return () => {
|
|
14465
|
-
scrollEl.current.removeEventListener("scroll", handleScroll, useCapture);
|
|
14466
|
-
};
|
|
14695
|
+
refreshMaxH.current = upperThreshold;
|
|
14696
|
+
setTimeout(() => {
|
|
14697
|
+
getScrollHeight();
|
|
14698
|
+
}, 200);
|
|
14467
14699
|
}, [hasMore, isInfiniting]);
|
|
14468
|
-
|
|
14469
|
-
const
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
});
|
|
14475
|
-
};
|
|
14476
|
-
}, []);
|
|
14700
|
+
const getScrollHeight = () => {
|
|
14701
|
+
const parentElement = getParentElement("scroller");
|
|
14702
|
+
parentElement.boundingClientRect((rect) => {
|
|
14703
|
+
scrollHeight.current = rect.height;
|
|
14704
|
+
}).exec();
|
|
14705
|
+
};
|
|
14477
14706
|
const getStyle = () => {
|
|
14478
14707
|
return {
|
|
14479
|
-
height:
|
|
14480
|
-
transition:
|
|
14708
|
+
height: topDisScoll < 0 ? `0px` : `${topDisScoll}px`,
|
|
14709
|
+
transition: `height 0.2s cubic-bezier(0.25,0.1,0.25,1)`
|
|
14481
14710
|
};
|
|
14482
14711
|
};
|
|
14483
14712
|
const getParentElement = (el) => {
|
|
14484
|
-
return
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
requestAniFrame2()(() => {
|
|
14488
|
-
if (!isScrollAtBottom() || !hasMore || isInfiniting) {
|
|
14489
|
-
return false;
|
|
14490
|
-
}
|
|
14491
|
-
setIsInfiniting(true);
|
|
14492
|
-
loadMore && loadMore(infiniteDone);
|
|
14493
|
-
});
|
|
14713
|
+
return Taro__default["default"].createSelectorQuery().select(
|
|
14714
|
+
containerId ? `#${containerId} #${el}` : `#${el}`
|
|
14715
|
+
);
|
|
14494
14716
|
};
|
|
14495
14717
|
const infiniteDone = () => {
|
|
14496
14718
|
setIsInfiniting(false);
|
|
14497
14719
|
};
|
|
14498
14720
|
const refreshDone = () => {
|
|
14499
14721
|
distance.current = 0;
|
|
14500
|
-
|
|
14722
|
+
setTopDisScoll(0);
|
|
14501
14723
|
isTouching.current = false;
|
|
14502
14724
|
};
|
|
14725
|
+
const scrollAction2 = (e2) => {
|
|
14726
|
+
if (e2.detail.scrollTop <= 0) {
|
|
14727
|
+
e2.detail.scrollTop = 0;
|
|
14728
|
+
} else if (e2.detail.scrollTop >= scrollHeight.current) {
|
|
14729
|
+
e2.detail.scrollTop = scrollHeight.current;
|
|
14730
|
+
}
|
|
14731
|
+
if (e2.detail.scrollTop > scrollTop.current || e2.detail.scrollTop >= scrollHeight.current) {
|
|
14732
|
+
direction.current = "down";
|
|
14733
|
+
} else {
|
|
14734
|
+
direction.current = "up";
|
|
14735
|
+
}
|
|
14736
|
+
scrollTop.current = e2.detail.scrollTop;
|
|
14737
|
+
onScrollChange && onScrollChange(e2.detail.scrollTop);
|
|
14738
|
+
};
|
|
14739
|
+
const lower = () => {
|
|
14740
|
+
if (direction.current == "up" || !hasMore || isInfiniting) {
|
|
14741
|
+
return false;
|
|
14742
|
+
}
|
|
14743
|
+
setIsInfiniting(true);
|
|
14744
|
+
onLoadMore && onLoadMore(infiniteDone);
|
|
14745
|
+
};
|
|
14503
14746
|
const touchStart = (event) => {
|
|
14504
|
-
if (
|
|
14747
|
+
if (scrollTop.current == 0 && !isTouching.current && isOpenRefresh) {
|
|
14505
14748
|
y2.current = event.touches[0].pageY;
|
|
14506
14749
|
isTouching.current = true;
|
|
14507
|
-
const childHeight = refreshTop.current.firstElementChild.offsetHeight;
|
|
14508
|
-
refreshMaxH.current = Math.floor(childHeight * 1 + 10);
|
|
14509
14750
|
}
|
|
14510
14751
|
};
|
|
14511
14752
|
const touchMove = (event) => {
|
|
14512
14753
|
distance.current = event.touches[0].pageY - y2.current;
|
|
14513
14754
|
if (distance.current > 0 && isTouching.current) {
|
|
14514
14755
|
event.preventDefault();
|
|
14756
|
+
setTopDisScoll(distance.current);
|
|
14515
14757
|
if (distance.current >= refreshMaxH.current) {
|
|
14516
14758
|
distance.current = refreshMaxH.current;
|
|
14517
|
-
|
|
14518
|
-
} else {
|
|
14519
|
-
refreshTop.current.style.height = `${distance.current}px`;
|
|
14759
|
+
setTopDisScoll(refreshMaxH.current);
|
|
14520
14760
|
}
|
|
14521
14761
|
} else {
|
|
14522
14762
|
distance.current = 0;
|
|
14523
|
-
|
|
14763
|
+
setTopDisScoll(0);
|
|
14524
14764
|
isTouching.current = false;
|
|
14525
14765
|
}
|
|
14526
14766
|
};
|
|
14527
14767
|
const touchEnd = () => {
|
|
14528
14768
|
if (distance.current < refreshMaxH.current) {
|
|
14529
14769
|
distance.current = 0;
|
|
14530
|
-
|
|
14770
|
+
setTopDisScoll(0);
|
|
14531
14771
|
} else {
|
|
14532
|
-
|
|
14772
|
+
onRefresh && onRefresh(refreshDone);
|
|
14533
14773
|
}
|
|
14534
14774
|
};
|
|
14535
|
-
|
|
14536
|
-
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
|
|
14537
|
-
window.setTimeout(callback, 1e3 / 60);
|
|
14538
|
-
};
|
|
14539
|
-
};
|
|
14540
|
-
const getWindowScrollTop = () => {
|
|
14541
|
-
return window.pageYOffset !== void 0 ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
|
|
14542
|
-
};
|
|
14543
|
-
const calculateTopPosition = (el) => {
|
|
14544
|
-
return !el ? 0 : el.offsetTop + calculateTopPosition(el.offsetParent);
|
|
14545
|
-
};
|
|
14546
|
-
const isScrollAtBottom = () => {
|
|
14547
|
-
let offsetDistance = 0;
|
|
14548
|
-
let resScrollTop = 0;
|
|
14549
|
-
let direction = "down";
|
|
14550
|
-
const windowScrollTop = getWindowScrollTop();
|
|
14551
|
-
if (useWindow) {
|
|
14552
|
-
if (scroller.current) {
|
|
14553
|
-
offsetDistance = calculateTopPosition(scroller.current) + scroller.current.offsetHeight - windowScrollTop - window.innerHeight;
|
|
14554
|
-
}
|
|
14555
|
-
resScrollTop = windowScrollTop;
|
|
14556
|
-
} else {
|
|
14557
|
-
const { scrollHeight, clientHeight, scrollTop } = scrollEl.current;
|
|
14558
|
-
offsetDistance = scrollHeight - clientHeight - scrollTop;
|
|
14559
|
-
resScrollTop = scrollTop;
|
|
14560
|
-
}
|
|
14561
|
-
if (beforeScrollTop.current > resScrollTop) {
|
|
14562
|
-
direction = "up";
|
|
14563
|
-
} else {
|
|
14564
|
-
direction = "down";
|
|
14565
|
-
}
|
|
14566
|
-
beforeScrollTop.current = resScrollTop;
|
|
14567
|
-
scrollChange && scrollChange(resScrollTop);
|
|
14568
|
-
return offsetDistance <= threshold && direction == "down";
|
|
14569
|
-
};
|
|
14570
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14775
|
+
return /* @__PURE__ */ React__default["default"].createElement(index_cjs.ScrollView, {
|
|
14571
14776
|
className: classes,
|
|
14572
|
-
|
|
14777
|
+
scrollY: true,
|
|
14778
|
+
id: "scroller",
|
|
14779
|
+
style: { height: "100%" },
|
|
14780
|
+
onScroll: scrollAction2,
|
|
14781
|
+
onScrollToLower: lower,
|
|
14573
14782
|
onTouchStart: touchStart,
|
|
14574
14783
|
onTouchMove: touchMove,
|
|
14575
|
-
onTouchEnd: touchEnd
|
|
14576
|
-
...restProps
|
|
14784
|
+
onTouchEnd: touchEnd
|
|
14577
14785
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14578
14786
|
className: "nut-infinite-top",
|
|
14579
14787
|
ref: refreshTop,
|
|
@@ -14581,31 +14789,60 @@
|
|
|
14581
14789
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14582
14790
|
className: "top-box"
|
|
14583
14791
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
14584
|
-
classPrefix:
|
|
14585
|
-
fontClassName:
|
|
14792
|
+
classPrefix: iconClassPrefix,
|
|
14793
|
+
fontClassName: iconFontClassName,
|
|
14586
14794
|
className: "top-img",
|
|
14587
14795
|
name: pullIcon
|
|
14588
14796
|
}), /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
14589
14797
|
className: "top-text"
|
|
14590
|
-
}, locale.infiniteloading.pullRefreshText
|
|
14798
|
+
}, pullTxt || locale.infiniteloading.pullRefreshText))), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14591
14799
|
className: "nut-infinite-container"
|
|
14592
14800
|
}, children), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14593
14801
|
className: "nut-infinite-bottom"
|
|
14594
14802
|
}, isInfiniting ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14595
14803
|
className: "bottom-box"
|
|
14596
14804
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
14597
|
-
classPrefix:
|
|
14598
|
-
fontClassName:
|
|
14805
|
+
classPrefix: iconClassPrefix,
|
|
14806
|
+
fontClassName: iconFontClassName,
|
|
14599
14807
|
className: "bottom-img",
|
|
14600
14808
|
name: loadIcon
|
|
14601
14809
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14602
14810
|
className: "bottom-text"
|
|
14603
|
-
}, locale.infiniteloading.loadText
|
|
14811
|
+
}, loadTxt || locale.infiniteloading.loadText)) : !hasMore && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14604
14812
|
className: "tips"
|
|
14605
|
-
}, locale.infiniteloading.loadMoreText
|
|
14813
|
+
}, loadMoreTxt || locale.infiniteloading.loadMoreText)));
|
|
14606
14814
|
};
|
|
14607
|
-
Infiniteloading.defaultProps = defaultProps$
|
|
14815
|
+
Infiniteloading.defaultProps = defaultProps$B;
|
|
14608
14816
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
14817
|
+
let createRoot;
|
|
14818
|
+
const { version } = ReactDOM__namespace;
|
|
14819
|
+
const reactDOMClone = {
|
|
14820
|
+
...ReactDOM__namespace
|
|
14821
|
+
};
|
|
14822
|
+
try {
|
|
14823
|
+
const mainVersion = Number((version || "").split(".")[0]);
|
|
14824
|
+
if (mainVersion >= 18) {
|
|
14825
|
+
createRoot = reactDOMClone.createRoot;
|
|
14826
|
+
}
|
|
14827
|
+
} catch (e2) {
|
|
14828
|
+
console.log(e2);
|
|
14829
|
+
}
|
|
14830
|
+
function legacyRender(node, container) {
|
|
14831
|
+
ReactDOM__namespace.render(node, container);
|
|
14832
|
+
}
|
|
14833
|
+
function concurrentRender(node, container) {
|
|
14834
|
+
if (createRoot) {
|
|
14835
|
+
const root = createRoot(container);
|
|
14836
|
+
root.render(node);
|
|
14837
|
+
}
|
|
14838
|
+
}
|
|
14839
|
+
function render(node, container) {
|
|
14840
|
+
if (createRoot) {
|
|
14841
|
+
concurrentRender(node, container);
|
|
14842
|
+
return;
|
|
14843
|
+
}
|
|
14844
|
+
legacyRender(node, container);
|
|
14845
|
+
}
|
|
14609
14846
|
class Notification extends React__namespace.PureComponent {
|
|
14610
14847
|
constructor(props) {
|
|
14611
14848
|
super(props);
|
|
@@ -14781,7 +15018,7 @@
|
|
|
14781
15018
|
}
|
|
14782
15019
|
}
|
|
14783
15020
|
};
|
|
14784
|
-
const defaultProps$
|
|
15021
|
+
const defaultProps$A = {
|
|
14785
15022
|
isAsync: false,
|
|
14786
15023
|
checked: false,
|
|
14787
15024
|
disable: false,
|
|
@@ -14804,7 +15041,7 @@
|
|
|
14804
15041
|
className,
|
|
14805
15042
|
style
|
|
14806
15043
|
} = {
|
|
14807
|
-
...defaultProps$
|
|
15044
|
+
...defaultProps$A,
|
|
14808
15045
|
...props
|
|
14809
15046
|
};
|
|
14810
15047
|
const [value, setValue] = React.useState(false);
|
|
@@ -14844,7 +15081,7 @@
|
|
|
14844
15081
|
className: `${b2("label")} close`
|
|
14845
15082
|
}, inactiveText))));
|
|
14846
15083
|
};
|
|
14847
|
-
Switch.defaultProps = defaultProps$
|
|
15084
|
+
Switch.defaultProps = defaultProps$A;
|
|
14848
15085
|
Switch.displayName = "NutSwitch";
|
|
14849
15086
|
function preventDefault(event, isStopPropagation) {
|
|
14850
15087
|
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
@@ -14854,7 +15091,7 @@
|
|
|
14854
15091
|
event.stopPropagation();
|
|
14855
15092
|
}
|
|
14856
15093
|
}
|
|
14857
|
-
const defaultProps$
|
|
15094
|
+
const defaultProps$z = {
|
|
14858
15095
|
name: "",
|
|
14859
15096
|
leftWidth: 0,
|
|
14860
15097
|
rightWidth: 0
|
|
@@ -14862,7 +15099,7 @@
|
|
|
14862
15099
|
const Swipe = React.forwardRef((props, instanceRef) => {
|
|
14863
15100
|
const swipeBem = cn("swipe");
|
|
14864
15101
|
const touch = useTouch();
|
|
14865
|
-
const { children, className, style } = { ...defaultProps$
|
|
15102
|
+
const { children, className, style } = { ...defaultProps$z, ...props };
|
|
14866
15103
|
const root = React.useRef();
|
|
14867
15104
|
const opened = React.useRef(false);
|
|
14868
15105
|
const lockClick = React.useRef(false);
|
|
@@ -15028,7 +15265,7 @@
|
|
|
15028
15265
|
style: wrapperStyle
|
|
15029
15266
|
}, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef)));
|
|
15030
15267
|
});
|
|
15031
|
-
Swipe.defaultProps = defaultProps$
|
|
15268
|
+
Swipe.defaultProps = defaultProps$z;
|
|
15032
15269
|
Swipe.displayName = "NutSwipe";
|
|
15033
15270
|
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
15034
15271
|
const defaultRoot = canUseDom ? window : void 0;
|
|
@@ -15087,7 +15324,7 @@
|
|
|
15087
15324
|
console.log(e2);
|
|
15088
15325
|
}
|
|
15089
15326
|
}
|
|
15090
|
-
const defaultProps$
|
|
15327
|
+
const defaultProps$y = {
|
|
15091
15328
|
pullingText: "",
|
|
15092
15329
|
canReleaseText: "",
|
|
15093
15330
|
refreshingText: "",
|
|
@@ -15102,7 +15339,7 @@
|
|
|
15102
15339
|
const PullToRefresh = (p2) => {
|
|
15103
15340
|
const { locale } = useConfig$1();
|
|
15104
15341
|
const props = {
|
|
15105
|
-
...defaultProps$
|
|
15342
|
+
...defaultProps$y,
|
|
15106
15343
|
...p2,
|
|
15107
15344
|
...{
|
|
15108
15345
|
pullingText: p2.pullingText || locale.pullToRefresh.pullingText,
|
|
@@ -15241,19 +15478,18 @@
|
|
|
15241
15478
|
className: "nut-pulltorefresh-content"
|
|
15242
15479
|
}, props.children));
|
|
15243
15480
|
};
|
|
15244
|
-
PullToRefresh.defaultProps = defaultProps$
|
|
15481
|
+
PullToRefresh.defaultProps = defaultProps$y;
|
|
15245
15482
|
PullToRefresh.displayName = "NutPullToRefresh";
|
|
15246
15483
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
15247
|
-
const defaultProps$
|
|
15484
|
+
const defaultProps$x = {
|
|
15248
15485
|
strokeWidth: 5,
|
|
15249
15486
|
radius: 50,
|
|
15250
15487
|
strokeLinecap: "round",
|
|
15251
|
-
circleColor: "",
|
|
15252
|
-
pathColor: "",
|
|
15488
|
+
circleColor: "#fa2c19",
|
|
15489
|
+
pathColor: "#e5e9f2",
|
|
15253
15490
|
clockwise: true
|
|
15254
15491
|
};
|
|
15255
15492
|
const CircleProgress = (props) => {
|
|
15256
|
-
var _a;
|
|
15257
15493
|
const {
|
|
15258
15494
|
children,
|
|
15259
15495
|
progress,
|
|
@@ -15267,38 +15503,55 @@
|
|
|
15267
15503
|
strokeLinecap,
|
|
15268
15504
|
...restProps
|
|
15269
15505
|
} = {
|
|
15270
|
-
...defaultProps$
|
|
15506
|
+
...defaultProps$x,
|
|
15271
15507
|
...props
|
|
15272
15508
|
};
|
|
15509
|
+
const [oldValue, setOldValue] = React.useState(progress);
|
|
15273
15510
|
const b2 = cn("circleprogress");
|
|
15274
15511
|
const classes = classNames(className, b2(""));
|
|
15275
15512
|
const refRandomId = Math.random().toString(36).slice(-8);
|
|
15513
|
+
let lastTime = 0;
|
|
15276
15514
|
const styles = {
|
|
15277
15515
|
height: `${Number(radius) * 2}px`,
|
|
15278
15516
|
width: `${Number(radius) * 2}px`,
|
|
15279
15517
|
...style
|
|
15280
15518
|
};
|
|
15281
|
-
|
|
15282
|
-
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
const
|
|
15286
|
-
const
|
|
15287
|
-
|
|
15288
|
-
|
|
15289
|
-
|
|
15519
|
+
React.useEffect(() => {
|
|
15520
|
+
let rafId;
|
|
15521
|
+
const startTime = Date.now();
|
|
15522
|
+
const startRate = Number(oldValue);
|
|
15523
|
+
const endRate = Number(progress);
|
|
15524
|
+
const duration = Math.abs((startRate - endRate) * 1e3 / 100);
|
|
15525
|
+
const animate = () => {
|
|
15526
|
+
const now = Date.now();
|
|
15527
|
+
const progress2 = Math.min((now - startTime) / duration, 1);
|
|
15528
|
+
const rate = progress2 * (endRate - startRate) + startRate;
|
|
15529
|
+
setOldValue(Math.min(Math.max(+rate, 0), 100));
|
|
15530
|
+
if (endRate > startRate ? rate < endRate : rate > endRate) {
|
|
15531
|
+
rafId = requestAnimationFrame2(animate);
|
|
15532
|
+
}
|
|
15290
15533
|
};
|
|
15291
|
-
|
|
15292
|
-
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
};
|
|
15296
|
-
const
|
|
15297
|
-
|
|
15534
|
+
if (rafId) {
|
|
15535
|
+
cancelAnimationFrame2(rafId);
|
|
15536
|
+
}
|
|
15537
|
+
rafId = requestAnimationFrame2(animate);
|
|
15538
|
+
}, [progress]);
|
|
15539
|
+
const requestAnimationFrame2 = function(callback) {
|
|
15540
|
+
const currTime = new Date().getTime();
|
|
15541
|
+
const timeToCall = Math.max(0, 16.7 - (currTime - lastTime));
|
|
15542
|
+
lastTime = currTime + timeToCall;
|
|
15543
|
+
const id = setTimeout(function() {
|
|
15544
|
+
callback();
|
|
15545
|
+
}, timeToCall);
|
|
15546
|
+
lastTime = currTime + timeToCall;
|
|
15547
|
+
return id;
|
|
15548
|
+
};
|
|
15549
|
+
const cancelAnimationFrame2 = function(id) {
|
|
15550
|
+
clearTimeout(id);
|
|
15298
15551
|
};
|
|
15299
15552
|
const stop2 = () => {
|
|
15300
15553
|
if (!isObject(circleColor)) {
|
|
15301
|
-
return;
|
|
15554
|
+
return [];
|
|
15302
15555
|
}
|
|
15303
15556
|
const color = circleColor;
|
|
15304
15557
|
const colorArr = Object.keys(color).sort(
|
|
@@ -15316,46 +15569,54 @@
|
|
|
15316
15569
|
});
|
|
15317
15570
|
return stopArr;
|
|
15318
15571
|
};
|
|
15572
|
+
const transColor = (color) => {
|
|
15573
|
+
return color && color.replace("#", "%23");
|
|
15574
|
+
};
|
|
15575
|
+
const format = (progress2) => Math.min(Math.max(+progress2, 0), 100);
|
|
15576
|
+
const circleStyle = () => {
|
|
15577
|
+
const stopArr = stop2();
|
|
15578
|
+
const stopDom = [];
|
|
15579
|
+
if (stopArr) {
|
|
15580
|
+
stopArr.map((item) => {
|
|
15581
|
+
let obj = "";
|
|
15582
|
+
obj = `%3Cstop offset='${item.key}' stop-color='${transColor(
|
|
15583
|
+
item.value
|
|
15584
|
+
)}'/%3E`;
|
|
15585
|
+
stopDom.push(obj);
|
|
15586
|
+
});
|
|
15587
|
+
}
|
|
15588
|
+
const perimeter = 283;
|
|
15589
|
+
const progress2 = +oldValue;
|
|
15590
|
+
const offset = perimeter * Number(format(parseFloat(progress2.toFixed(1)))) / 100;
|
|
15591
|
+
const isWise = props.clockwise ? 1 : 0;
|
|
15592
|
+
const color = isObject(circleColor) ? `url(%23${refRandomId})` : transColor(circleColor);
|
|
15593
|
+
const d2 = `M 50 50 m 0 -45 a 45 45 0 1 ${isWise} 0 90 a 45 45 0 1, ${isWise} 0 -90`;
|
|
15594
|
+
const pa = `%3Cdefs%3E%3ClinearGradient id='${refRandomId}' x1='100%25' y1='0%25' x2='0%25' y2='0%25'%3E${stopDom}%3C/linearGradient%3E%3C/defs%3E`;
|
|
15595
|
+
const path = `%3Cpath d='${d2}' stroke-width='${strokeWidth}' stroke='${transColor(
|
|
15596
|
+
props.pathColor
|
|
15597
|
+
)}' fill='none'/%3E`;
|
|
15598
|
+
const path1 = `%3Cpath d='${d2}' stroke-width='${strokeWidth}' stroke-dasharray='${offset},${perimeter}' stroke-linecap='round' stroke='${transColor(
|
|
15599
|
+
color
|
|
15600
|
+
)}' fill='none'/%3E`;
|
|
15601
|
+
return {
|
|
15602
|
+
background: `url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E${pa}${path}${path1}%3C/svg%3E")`,
|
|
15603
|
+
width: "100%",
|
|
15604
|
+
height: "100%"
|
|
15605
|
+
};
|
|
15606
|
+
};
|
|
15319
15607
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
15320
15608
|
className: classes,
|
|
15321
15609
|
style: styles,
|
|
15322
15610
|
...restProps
|
|
15323
|
-
}, /* @__PURE__ */ React__default["default"].createElement("
|
|
15324
|
-
|
|
15325
|
-
}, /* @__PURE__ */ React__default["default"].createElement("
|
|
15326
|
-
id: refRandomId,
|
|
15327
|
-
x1: "100%",
|
|
15328
|
-
y1: "0%",
|
|
15329
|
-
x2: "0%",
|
|
15330
|
-
y2: "0%"
|
|
15331
|
-
}, (_a = stop2()) == null ? void 0 : _a.map((item, index2) => {
|
|
15332
|
-
return /* @__PURE__ */ React__default["default"].createElement("stop", {
|
|
15333
|
-
key: index2,
|
|
15334
|
-
offset: item.key,
|
|
15335
|
-
stopColor: item.value
|
|
15336
|
-
});
|
|
15337
|
-
}))), /* @__PURE__ */ React__default["default"].createElement("path", {
|
|
15338
|
-
className: "nut-circleprogress-path",
|
|
15339
|
-
style: pathStyle,
|
|
15340
|
-
d: path(),
|
|
15341
|
-
fill: "none",
|
|
15342
|
-
strokeWidth
|
|
15343
|
-
}), /* @__PURE__ */ React__default["default"].createElement("path", {
|
|
15344
|
-
className: "nut-circleprogress-hover",
|
|
15345
|
-
style: hoverStyle(),
|
|
15346
|
-
d: path(),
|
|
15347
|
-
fill: "none",
|
|
15348
|
-
stroke: hoverColor(),
|
|
15349
|
-
strokeLinecap,
|
|
15350
|
-
transform: "rotate(90,50,50)",
|
|
15351
|
-
strokeWidth
|
|
15352
|
-
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
15611
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
15612
|
+
style: circleStyle()
|
|
15613
|
+
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
15353
15614
|
className: "nut-circleprogress-text"
|
|
15354
15615
|
}, children || /* @__PURE__ */ React__default["default"].createElement("div", null, progress, "%")));
|
|
15355
15616
|
};
|
|
15356
|
-
CircleProgress.defaultProps = defaultProps$
|
|
15617
|
+
CircleProgress.defaultProps = defaultProps$x;
|
|
15357
15618
|
CircleProgress.displayName = "NutCircleProgress";
|
|
15358
|
-
const defaultProps$
|
|
15619
|
+
const defaultProps$w = {
|
|
15359
15620
|
...ComponentDefaults,
|
|
15360
15621
|
direction: "across",
|
|
15361
15622
|
list: [],
|
|
@@ -15393,8 +15654,13 @@
|
|
|
15393
15654
|
speed,
|
|
15394
15655
|
rightIcon,
|
|
15395
15656
|
close,
|
|
15396
|
-
click
|
|
15397
|
-
|
|
15657
|
+
click,
|
|
15658
|
+
iconClassPrefix,
|
|
15659
|
+
iconFontClassName
|
|
15660
|
+
} = {
|
|
15661
|
+
...defaultProps$w,
|
|
15662
|
+
...props
|
|
15663
|
+
};
|
|
15398
15664
|
const wrap = React.useRef(null);
|
|
15399
15665
|
const content = React.useRef(null);
|
|
15400
15666
|
const [showNoticeBar, SetShowNoticeBar] = React.useState(true);
|
|
@@ -15587,8 +15853,8 @@
|
|
|
15587
15853
|
className: "left-icon",
|
|
15588
15854
|
style: { backgroundImage: `url(${iconBg() || ""})` }
|
|
15589
15855
|
}, !iconBg() ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
15590
|
-
classPrefix:
|
|
15591
|
-
fontClassName:
|
|
15856
|
+
classPrefix: iconClassPrefix,
|
|
15857
|
+
fontClassName: iconFontClassName,
|
|
15592
15858
|
name: "notice",
|
|
15593
15859
|
size: "16",
|
|
15594
15860
|
color
|
|
@@ -15604,8 +15870,8 @@
|
|
|
15604
15870
|
className: "right-icon",
|
|
15605
15871
|
onClick: onClickIcon
|
|
15606
15872
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
15607
|
-
classPrefix:
|
|
15608
|
-
fontClassName:
|
|
15873
|
+
classPrefix: iconClassPrefix,
|
|
15874
|
+
fontClassName: iconFontClassName,
|
|
15609
15875
|
name: rightIcon || "close",
|
|
15610
15876
|
color
|
|
15611
15877
|
})) : null) : null, scrollList.current.length > 0 && direction === "vertical" ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -15634,23 +15900,23 @@
|
|
|
15634
15900
|
handleClickIcon();
|
|
15635
15901
|
}
|
|
15636
15902
|
}, rightIcon || (closeMode ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
15637
|
-
classPrefix:
|
|
15638
|
-
fontClassName:
|
|
15903
|
+
classPrefix: iconClassPrefix,
|
|
15904
|
+
fontClassName: iconFontClassName,
|
|
15639
15905
|
name: "cross",
|
|
15640
15906
|
color,
|
|
15641
15907
|
size: "11px"
|
|
15642
15908
|
}) : null))) : null);
|
|
15643
15909
|
};
|
|
15644
|
-
NoticeBar.defaultProps = defaultProps$
|
|
15910
|
+
NoticeBar.defaultProps = defaultProps$w;
|
|
15645
15911
|
NoticeBar.displayName = "NutNoticeBar";
|
|
15646
15912
|
const DataContext$1 = React.createContext({});
|
|
15647
|
-
const defaultProps$
|
|
15913
|
+
const defaultProps$v = {
|
|
15648
15914
|
current: 0,
|
|
15649
15915
|
direction: "horizontal",
|
|
15650
15916
|
progressDot: false
|
|
15651
15917
|
};
|
|
15652
15918
|
const Steps = (props) => {
|
|
15653
|
-
const propSteps = { ...defaultProps$
|
|
15919
|
+
const propSteps = { ...defaultProps$v, ...props };
|
|
15654
15920
|
const {
|
|
15655
15921
|
children,
|
|
15656
15922
|
current,
|
|
@@ -15683,9 +15949,9 @@
|
|
|
15683
15949
|
children
|
|
15684
15950
|
));
|
|
15685
15951
|
};
|
|
15686
|
-
Steps.defaultProps = defaultProps$
|
|
15952
|
+
Steps.defaultProps = defaultProps$v;
|
|
15687
15953
|
Steps.displayName = "NutSteps";
|
|
15688
|
-
const defaultProps$
|
|
15954
|
+
const defaultProps$u = {
|
|
15689
15955
|
...ComponentDefaults,
|
|
15690
15956
|
title: "",
|
|
15691
15957
|
content: "",
|
|
@@ -15705,9 +15971,11 @@
|
|
|
15705
15971
|
size,
|
|
15706
15972
|
className,
|
|
15707
15973
|
renderContent,
|
|
15974
|
+
iconClassPrefix,
|
|
15975
|
+
iconFontClassName,
|
|
15708
15976
|
...restProps
|
|
15709
15977
|
} = {
|
|
15710
|
-
...defaultProps$
|
|
15978
|
+
...defaultProps$u,
|
|
15711
15979
|
...props
|
|
15712
15980
|
};
|
|
15713
15981
|
const parent = React.useContext(DataContext$1);
|
|
@@ -15752,8 +16020,8 @@
|
|
|
15752
16020
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
15753
16021
|
className: renderIconClass()
|
|
15754
16022
|
}, icon ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
15755
|
-
classPrefix:
|
|
15756
|
-
fontClassName:
|
|
16023
|
+
classPrefix: iconClassPrefix,
|
|
16024
|
+
fontClassName: iconFontClassName,
|
|
15757
16025
|
className: "nut-step-icon-inner",
|
|
15758
16026
|
color: iconColor,
|
|
15759
16027
|
name: icon,
|
|
@@ -15770,10 +16038,10 @@
|
|
|
15770
16038
|
className: "nut-step-content"
|
|
15771
16039
|
}, renderContent())));
|
|
15772
16040
|
};
|
|
15773
|
-
Step.defaultProps = defaultProps$
|
|
16041
|
+
Step.defaultProps = defaultProps$u;
|
|
15774
16042
|
Step.displayName = "NutStep";
|
|
15775
16043
|
const DataContext = React.createContext({});
|
|
15776
|
-
const defaultProps$
|
|
16044
|
+
const defaultProps$t = {
|
|
15777
16045
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
15778
16046
|
height: 0,
|
|
15779
16047
|
duration: 500,
|
|
@@ -15791,7 +16059,7 @@
|
|
|
15791
16059
|
};
|
|
15792
16060
|
const DISTANCE = 5;
|
|
15793
16061
|
const Swiper = React__default["default"].forwardRef((props, ref) => {
|
|
15794
|
-
const propSwiper = { ...defaultProps$
|
|
16062
|
+
const propSwiper = { ...defaultProps$t, ...props };
|
|
15795
16063
|
const {
|
|
15796
16064
|
children,
|
|
15797
16065
|
direction,
|
|
@@ -16097,7 +16365,7 @@
|
|
|
16097
16365
|
}, [active]);
|
|
16098
16366
|
const queryRect = (element) => {
|
|
16099
16367
|
return new Promise((resolve) => {
|
|
16100
|
-
const query =
|
|
16368
|
+
const query = Taro.createSelectorQuery();
|
|
16101
16369
|
query.select(`#${element.id}`) && query.select(`#${element.id}`).boundingClientRect();
|
|
16102
16370
|
query.exec(function(res) {
|
|
16103
16371
|
resolve(res[0]);
|
|
@@ -16150,7 +16418,7 @@
|
|
|
16150
16418
|
};
|
|
16151
16419
|
}, []);
|
|
16152
16420
|
Taro.useReady(() => {
|
|
16153
|
-
|
|
16421
|
+
Taro.nextTick(() => {
|
|
16154
16422
|
init();
|
|
16155
16423
|
});
|
|
16156
16424
|
});
|
|
@@ -16178,7 +16446,7 @@
|
|
|
16178
16446
|
className: `${classes} ${className}`,
|
|
16179
16447
|
ref: container,
|
|
16180
16448
|
...rest,
|
|
16181
|
-
id:
|
|
16449
|
+
id: `container-${refRandomId}`,
|
|
16182
16450
|
onTouchStart,
|
|
16183
16451
|
onTouchMove,
|
|
16184
16452
|
onTouchEnd,
|
|
@@ -16210,13 +16478,13 @@
|
|
|
16210
16478
|
});
|
|
16211
16479
|
})) : /* @__PURE__ */ React__default["default"].createElement("div", null, pageContent)));
|
|
16212
16480
|
});
|
|
16213
|
-
Swiper.defaultProps = defaultProps$
|
|
16481
|
+
Swiper.defaultProps = defaultProps$t;
|
|
16214
16482
|
Swiper.displayName = "NutSwiper";
|
|
16215
|
-
const defaultProps$
|
|
16483
|
+
const defaultProps$s = {
|
|
16216
16484
|
direction: "horizontal"
|
|
16217
16485
|
};
|
|
16218
16486
|
const SwiperItem = React__default["default"].forwardRef((props, ref) => {
|
|
16219
|
-
const _props = { ...defaultProps$
|
|
16487
|
+
const _props = { ...defaultProps$s, ...props };
|
|
16220
16488
|
const { children, direction, size } = _props;
|
|
16221
16489
|
const parent = React.useContext(DataContext);
|
|
16222
16490
|
const b2 = cn("swiper-item");
|
|
@@ -16235,10 +16503,10 @@
|
|
|
16235
16503
|
style: style()
|
|
16236
16504
|
}, children);
|
|
16237
16505
|
});
|
|
16238
|
-
SwiperItem.defaultProps = defaultProps$
|
|
16506
|
+
SwiperItem.defaultProps = defaultProps$s;
|
|
16239
16507
|
SwiperItem.displayName = "NutSwiperItem";
|
|
16240
16508
|
const AvatarContext = React.createContext({});
|
|
16241
|
-
const defaultProps$
|
|
16509
|
+
const defaultProps$r = {
|
|
16242
16510
|
...ComponentDefaults,
|
|
16243
16511
|
size: "",
|
|
16244
16512
|
icon: "",
|
|
@@ -16264,9 +16532,11 @@
|
|
|
16264
16532
|
style,
|
|
16265
16533
|
activeAvatar,
|
|
16266
16534
|
onError,
|
|
16535
|
+
iconClassPrefix,
|
|
16536
|
+
iconFontClassName,
|
|
16267
16537
|
...rest
|
|
16268
16538
|
} = {
|
|
16269
|
-
...defaultProps$
|
|
16539
|
+
...defaultProps$r,
|
|
16270
16540
|
...props
|
|
16271
16541
|
};
|
|
16272
16542
|
const [maxSum, setMaxSum] = React.useState(0);
|
|
@@ -16343,8 +16613,8 @@
|
|
|
16343
16613
|
alt,
|
|
16344
16614
|
onError: errorEvent
|
|
16345
16615
|
}), icon && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
16346
|
-
classPrefix:
|
|
16347
|
-
fontClassName:
|
|
16616
|
+
classPrefix: iconClassPrefix,
|
|
16617
|
+
fontClassName: iconFontClassName,
|
|
16348
16618
|
className: "icon",
|
|
16349
16619
|
name: iconStyles
|
|
16350
16620
|
}), children && /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
@@ -16353,22 +16623,9 @@
|
|
|
16353
16623
|
className: "text"
|
|
16354
16624
|
}, ((_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent) ? (_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxContent : `+ ${avatarIndex - ((_o = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _o.maxCount)}`)));
|
|
16355
16625
|
};
|
|
16356
|
-
Avatar.defaultProps = defaultProps$
|
|
16626
|
+
Avatar.defaultProps = defaultProps$r;
|
|
16357
16627
|
Avatar.displayName = "NutAvatar";
|
|
16358
|
-
const
|
|
16359
|
-
current: {
|
|
16360
|
-
locale: zhCN
|
|
16361
|
-
}
|
|
16362
|
-
};
|
|
16363
|
-
const getDefaultConfig = () => {
|
|
16364
|
-
return defaultConfigRef.current;
|
|
16365
|
-
};
|
|
16366
|
-
const useConfig = () => {
|
|
16367
|
-
var _a;
|
|
16368
|
-
return (_a = React.useContext(ConfigContext)) != null ? _a : getDefaultConfig();
|
|
16369
|
-
};
|
|
16370
|
-
const ConfigContext = React.createContext(null);
|
|
16371
|
-
const defaultProps$r = {
|
|
16628
|
+
const defaultProps$q = {
|
|
16372
16629
|
maxContent: "",
|
|
16373
16630
|
maxCount: "",
|
|
16374
16631
|
maxBgColor: "#eee",
|
|
@@ -16380,7 +16637,7 @@
|
|
|
16380
16637
|
};
|
|
16381
16638
|
const AvatarGroup = (props) => {
|
|
16382
16639
|
useConfig();
|
|
16383
|
-
const propAvatarGroup = { ...defaultProps$
|
|
16640
|
+
const propAvatarGroup = { ...defaultProps$q, ...props };
|
|
16384
16641
|
const { className, style, children } = propAvatarGroup;
|
|
16385
16642
|
const avatarGroupRef = React.useRef(null);
|
|
16386
16643
|
const b2 = cn("avatar-group");
|
|
@@ -16397,9 +16654,9 @@
|
|
|
16397
16654
|
ref: avatarGroupRef
|
|
16398
16655
|
}, children));
|
|
16399
16656
|
};
|
|
16400
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
16657
|
+
AvatarGroup.defaultProps = defaultProps$q;
|
|
16401
16658
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
16402
|
-
const defaultProps$
|
|
16659
|
+
const defaultProps$p = {
|
|
16403
16660
|
price: 0,
|
|
16404
16661
|
needSymbol: true,
|
|
16405
16662
|
symbol: "¥",
|
|
@@ -16417,7 +16674,7 @@
|
|
|
16417
16674
|
className,
|
|
16418
16675
|
...rest
|
|
16419
16676
|
} = {
|
|
16420
|
-
...defaultProps$
|
|
16677
|
+
...defaultProps$p,
|
|
16421
16678
|
...props
|
|
16422
16679
|
};
|
|
16423
16680
|
const b2 = cn("price");
|
|
@@ -16480,9 +16737,9 @@
|
|
|
16480
16737
|
className: `${b2("small")}`
|
|
16481
16738
|
}, formatDecimal(price)));
|
|
16482
16739
|
};
|
|
16483
|
-
Price.defaultProps = defaultProps$
|
|
16740
|
+
Price.defaultProps = defaultProps$p;
|
|
16484
16741
|
Price.displayName = "NutPrice";
|
|
16485
|
-
const defaultProps$
|
|
16742
|
+
const defaultProps$o = {
|
|
16486
16743
|
...ComponentDefaults,
|
|
16487
16744
|
value: "",
|
|
16488
16745
|
dot: false,
|
|
@@ -16494,8 +16751,18 @@
|
|
|
16494
16751
|
icons: ""
|
|
16495
16752
|
};
|
|
16496
16753
|
const Badge = (props) => {
|
|
16497
|
-
const {
|
|
16498
|
-
|
|
16754
|
+
const {
|
|
16755
|
+
children,
|
|
16756
|
+
dot,
|
|
16757
|
+
top,
|
|
16758
|
+
right,
|
|
16759
|
+
zIndex,
|
|
16760
|
+
color,
|
|
16761
|
+
icons,
|
|
16762
|
+
iconClassPrefix,
|
|
16763
|
+
iconFontClassName
|
|
16764
|
+
} = {
|
|
16765
|
+
...defaultProps$o,
|
|
16499
16766
|
...props
|
|
16500
16767
|
};
|
|
16501
16768
|
function content() {
|
|
@@ -16521,8 +16788,8 @@
|
|
|
16521
16788
|
}, icons !== "" && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
16522
16789
|
className: "slot-icons"
|
|
16523
16790
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
16524
|
-
classPrefix:
|
|
16525
|
-
fontClassName:
|
|
16791
|
+
classPrefix: iconClassPrefix,
|
|
16792
|
+
fontClassName: iconFontClassName,
|
|
16526
16793
|
className: "_icon",
|
|
16527
16794
|
name: icons,
|
|
16528
16795
|
color: "#ffffff",
|
|
@@ -16532,9 +16799,9 @@
|
|
|
16532
16799
|
style: getStyle()
|
|
16533
16800
|
}, content()));
|
|
16534
16801
|
};
|
|
16535
|
-
Badge.defaultProps = defaultProps$
|
|
16802
|
+
Badge.defaultProps = defaultProps$o;
|
|
16536
16803
|
Badge.displayName = "NutBadge";
|
|
16537
|
-
const defaultProps$
|
|
16804
|
+
const defaultProps$n = {
|
|
16538
16805
|
...ComponentDefaults,
|
|
16539
16806
|
type: "default",
|
|
16540
16807
|
color: "",
|
|
@@ -16561,9 +16828,11 @@
|
|
|
16561
16828
|
closeable,
|
|
16562
16829
|
textColor,
|
|
16563
16830
|
onClick,
|
|
16564
|
-
onClose
|
|
16831
|
+
onClose,
|
|
16832
|
+
iconClassPrefix,
|
|
16833
|
+
iconFontClassName
|
|
16565
16834
|
} = {
|
|
16566
|
-
...defaultProps$
|
|
16835
|
+
...defaultProps$n,
|
|
16567
16836
|
...props
|
|
16568
16837
|
};
|
|
16569
16838
|
const [btnName, setBtnName] = React.useState("");
|
|
@@ -16618,8 +16887,8 @@
|
|
|
16618
16887
|
}, children && /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
16619
16888
|
className: "text"
|
|
16620
16889
|
}, children), /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
16621
|
-
classPrefix:
|
|
16622
|
-
fontClassName:
|
|
16890
|
+
classPrefix: iconClassPrefix,
|
|
16891
|
+
fontClassName: iconFontClassName,
|
|
16623
16892
|
className: "_icon",
|
|
16624
16893
|
name: "close",
|
|
16625
16894
|
size: "12",
|
|
@@ -16637,7 +16906,7 @@
|
|
|
16637
16906
|
className: "text"
|
|
16638
16907
|
}, children)));
|
|
16639
16908
|
};
|
|
16640
|
-
Tag.defaultProps = defaultProps$
|
|
16909
|
+
Tag.defaultProps = defaultProps$n;
|
|
16641
16910
|
Tag.displayName = "NutTag";
|
|
16642
16911
|
function fillRef(ref, node) {
|
|
16643
16912
|
if (typeof ref === "function") {
|
|
@@ -16681,7 +16950,7 @@
|
|
|
16681
16950
|
return trigger;
|
|
16682
16951
|
}
|
|
16683
16952
|
}
|
|
16684
|
-
const defaultProps$
|
|
16953
|
+
const defaultProps$m = {
|
|
16685
16954
|
...ComponentDefaults,
|
|
16686
16955
|
list: [],
|
|
16687
16956
|
theme: "light",
|
|
@@ -16706,9 +16975,11 @@
|
|
|
16706
16975
|
style,
|
|
16707
16976
|
onClick,
|
|
16708
16977
|
onChoose,
|
|
16978
|
+
iconClassPrefix,
|
|
16979
|
+
iconFontClassName,
|
|
16709
16980
|
...reset
|
|
16710
16981
|
} = {
|
|
16711
|
-
...defaultProps$
|
|
16982
|
+
...defaultProps$m,
|
|
16712
16983
|
...props
|
|
16713
16984
|
};
|
|
16714
16985
|
const goodItem = React.useRef(null);
|
|
@@ -16790,8 +17061,8 @@
|
|
|
16790
17061
|
handleChoose(item, i);
|
|
16791
17062
|
}
|
|
16792
17063
|
}, item.icon ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
16793
|
-
classPrefix:
|
|
16794
|
-
fontClassName:
|
|
17064
|
+
classPrefix: iconClassPrefix,
|
|
17065
|
+
fontClassName: iconFontClassName,
|
|
16795
17066
|
className: "popover-menu-item-img",
|
|
16796
17067
|
name: item.icon
|
|
16797
17068
|
}) : "", /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -16803,9 +17074,9 @@
|
|
|
16803
17074
|
style: { background: "transparent" }
|
|
16804
17075
|
}) : "");
|
|
16805
17076
|
};
|
|
16806
|
-
Popover.defaultProps = defaultProps$
|
|
17077
|
+
Popover.defaultProps = defaultProps$m;
|
|
16807
17078
|
Popover.displayName = "NutPopover";
|
|
16808
|
-
const defaultProps$
|
|
17079
|
+
const defaultProps$l = {
|
|
16809
17080
|
width: "100px",
|
|
16810
17081
|
height: "100px",
|
|
16811
17082
|
row: 1,
|
|
@@ -16833,7 +17104,7 @@
|
|
|
16833
17104
|
avatarShape,
|
|
16834
17105
|
...restProps
|
|
16835
17106
|
} = {
|
|
16836
|
-
...defaultProps$
|
|
17107
|
+
...defaultProps$l,
|
|
16837
17108
|
...props
|
|
16838
17109
|
};
|
|
16839
17110
|
const b2 = cn("skeleton");
|
|
@@ -16888,9 +17159,9 @@
|
|
|
16888
17159
|
});
|
|
16889
17160
|
})))));
|
|
16890
17161
|
};
|
|
16891
|
-
Skeleton.defaultProps = defaultProps$
|
|
17162
|
+
Skeleton.defaultProps = defaultProps$l;
|
|
16892
17163
|
Skeleton.displayName = "NutSkeleton";
|
|
16893
|
-
const defaultProps$
|
|
17164
|
+
const defaultProps$k = {
|
|
16894
17165
|
paused: false,
|
|
16895
17166
|
startTime: Date.now(),
|
|
16896
17167
|
endTime: Date.now(),
|
|
@@ -16917,7 +17188,7 @@
|
|
|
16917
17188
|
onUpdate,
|
|
16918
17189
|
children,
|
|
16919
17190
|
...rest
|
|
16920
|
-
} = { ...defaultProps$
|
|
17191
|
+
} = { ...defaultProps$k, ...props };
|
|
16921
17192
|
const b2 = cn("countdown");
|
|
16922
17193
|
const [restTimeStamp, setRestTime] = React.useState(0);
|
|
16923
17194
|
const stateRef = React.useRef({
|
|
@@ -17113,9 +17384,9 @@
|
|
|
17113
17384
|
}));
|
|
17114
17385
|
};
|
|
17115
17386
|
const CountDown = React__default["default"].forwardRef(InternalCountDown);
|
|
17116
|
-
CountDown.defaultProps = defaultProps$
|
|
17387
|
+
CountDown.defaultProps = defaultProps$k;
|
|
17117
17388
|
CountDown.displayName = "NutCountDown";
|
|
17118
|
-
const defaultProps$
|
|
17389
|
+
const defaultProps$j = {
|
|
17119
17390
|
activeName: ["0"],
|
|
17120
17391
|
accordion: false,
|
|
17121
17392
|
icon: "",
|
|
@@ -17138,7 +17409,7 @@
|
|
|
17138
17409
|
iconColor,
|
|
17139
17410
|
change
|
|
17140
17411
|
} = {
|
|
17141
|
-
...defaultProps$
|
|
17412
|
+
...defaultProps$j,
|
|
17142
17413
|
...props
|
|
17143
17414
|
};
|
|
17144
17415
|
const childrenDom = React__default["default"].Children.toArray(children);
|
|
@@ -17195,9 +17466,9 @@
|
|
|
17195
17466
|
},
|
|
17196
17467
|
areEqual
|
|
17197
17468
|
);
|
|
17198
|
-
Collapse.defaultProps = defaultProps$
|
|
17469
|
+
Collapse.defaultProps = defaultProps$j;
|
|
17199
17470
|
Collapse.displayName = "NutCollapse";
|
|
17200
|
-
const defaultProps$
|
|
17471
|
+
const defaultProps$i = {
|
|
17201
17472
|
...ComponentDefaults,
|
|
17202
17473
|
title: "",
|
|
17203
17474
|
name: "",
|
|
@@ -17211,7 +17482,8 @@
|
|
|
17211
17482
|
titleIcon: "",
|
|
17212
17483
|
titleIconColor: "",
|
|
17213
17484
|
titleIconPosition: "",
|
|
17214
|
-
titleIconSize: ""
|
|
17485
|
+
titleIconSize: "",
|
|
17486
|
+
childnull: true
|
|
17215
17487
|
};
|
|
17216
17488
|
const CollapseItem = (props) => {
|
|
17217
17489
|
const {
|
|
@@ -17230,9 +17502,12 @@
|
|
|
17230
17502
|
titleIconSize,
|
|
17231
17503
|
iconSize,
|
|
17232
17504
|
iconColor,
|
|
17505
|
+
childnull,
|
|
17506
|
+
iconClassPrefix,
|
|
17507
|
+
iconFontClassName,
|
|
17233
17508
|
...rest
|
|
17234
17509
|
} = {
|
|
17235
|
-
...defaultProps$
|
|
17510
|
+
...defaultProps$i,
|
|
17236
17511
|
...props
|
|
17237
17512
|
};
|
|
17238
17513
|
const [domHeight, setDomHeight] = React.useState(-1);
|
|
@@ -17278,16 +17553,16 @@
|
|
|
17278
17553
|
}, titleIcon && titleIconPosition === "left" && /* @__PURE__ */ React__default["default"].createElement("b", {
|
|
17279
17554
|
className: colBem("title-icon-left")
|
|
17280
17555
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
17281
|
-
classPrefix:
|
|
17282
|
-
fontClassName:
|
|
17556
|
+
classPrefix: iconClassPrefix,
|
|
17557
|
+
fontClassName: iconFontClassName,
|
|
17283
17558
|
name: titleIcon,
|
|
17284
17559
|
size: titleIconSize,
|
|
17285
17560
|
color: disabled ? "#C2C2C2" : titleIconColor
|
|
17286
17561
|
})), title, titleIcon && titleIconPosition === "right" && /* @__PURE__ */ React__default["default"].createElement("b", {
|
|
17287
17562
|
className: colBem("title-icon-right")
|
|
17288
17563
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
17289
|
-
classPrefix:
|
|
17290
|
-
fontClassName:
|
|
17564
|
+
classPrefix: iconClassPrefix,
|
|
17565
|
+
fontClassName: iconFontClassName,
|
|
17291
17566
|
name: titleIcon,
|
|
17292
17567
|
size: titleIconSize,
|
|
17293
17568
|
color: disabled ? "#C2C2C2" : titleIconColor
|
|
@@ -17299,12 +17574,12 @@
|
|
|
17299
17574
|
className: colBem("icon"),
|
|
17300
17575
|
style: iconStyle
|
|
17301
17576
|
}, /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
17302
|
-
classPrefix:
|
|
17303
|
-
fontClassName:
|
|
17577
|
+
classPrefix: iconClassPrefix,
|
|
17578
|
+
fontClassName: iconFontClassName,
|
|
17304
17579
|
name: icon,
|
|
17305
17580
|
size: iconSize,
|
|
17306
17581
|
color: disabled ? "#C2C2C2" : iconColor
|
|
17307
|
-
})))), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17582
|
+
})))), childnull && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17308
17583
|
className: colBem("content"),
|
|
17309
17584
|
style: { height: currHeight },
|
|
17310
17585
|
ref: measuredRef
|
|
@@ -17312,9 +17587,9 @@
|
|
|
17312
17587
|
className: colBem("content-text")
|
|
17313
17588
|
}, children)));
|
|
17314
17589
|
};
|
|
17315
|
-
CollapseItem.defaultProps = defaultProps$
|
|
17590
|
+
CollapseItem.defaultProps = defaultProps$i;
|
|
17316
17591
|
CollapseItem.displayName = "NutCollapseItem";
|
|
17317
|
-
const defaultProps$
|
|
17592
|
+
const defaultProps$h = {
|
|
17318
17593
|
maxLen: 0,
|
|
17319
17594
|
endNumber: "",
|
|
17320
17595
|
delaySpeed: 300,
|
|
@@ -17332,7 +17607,7 @@
|
|
|
17332
17607
|
thousands,
|
|
17333
17608
|
...reset
|
|
17334
17609
|
} = {
|
|
17335
|
-
...defaultProps$
|
|
17610
|
+
...defaultProps$h,
|
|
17336
17611
|
...props
|
|
17337
17612
|
};
|
|
17338
17613
|
const b2 = cn("countup");
|
|
@@ -17401,9 +17676,9 @@
|
|
|
17401
17676
|
}, item));
|
|
17402
17677
|
})));
|
|
17403
17678
|
};
|
|
17404
|
-
CountUp.defaultProps = defaultProps$
|
|
17679
|
+
CountUp.defaultProps = defaultProps$h;
|
|
17405
17680
|
CountUp.displayName = "NutCountUp";
|
|
17406
|
-
const defaultProps$
|
|
17681
|
+
const defaultProps$g = {};
|
|
17407
17682
|
class AnimatingNumbers extends React.Component {
|
|
17408
17683
|
constructor(props) {
|
|
17409
17684
|
super(props);
|
|
@@ -17415,7 +17690,7 @@
|
|
|
17415
17690
|
});
|
|
17416
17691
|
}
|
|
17417
17692
|
}
|
|
17418
|
-
AnimatingNumbers.defaultProps = defaultProps$
|
|
17693
|
+
AnimatingNumbers.defaultProps = defaultProps$g;
|
|
17419
17694
|
AnimatingNumbers.displayName = "NutAnimatingNumbers";
|
|
17420
17695
|
AnimatingNumbers.CountUp = CountUp;
|
|
17421
17696
|
const defaultStatus = {
|
|
@@ -17423,7 +17698,7 @@
|
|
|
17423
17698
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
17424
17699
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
17425
17700
|
};
|
|
17426
|
-
const defaultProps$
|
|
17701
|
+
const defaultProps$f = {
|
|
17427
17702
|
description: "\u65E0\u5185\u5BB9",
|
|
17428
17703
|
image: "empty",
|
|
17429
17704
|
imageSize: "",
|
|
@@ -17431,9 +17706,9 @@
|
|
|
17431
17706
|
};
|
|
17432
17707
|
const Empty = (props) => {
|
|
17433
17708
|
const { locale } = useConfig$1();
|
|
17434
|
-
defaultProps$
|
|
17709
|
+
defaultProps$f.description = locale.noData || defaultProps$f.description;
|
|
17435
17710
|
const { image, imageSize, description, children, className, ...rest } = {
|
|
17436
|
-
...defaultProps$
|
|
17711
|
+
...defaultProps$f,
|
|
17437
17712
|
...props
|
|
17438
17713
|
};
|
|
17439
17714
|
const [imgStyle, setImgStyle] = React.useState({});
|
|
@@ -17475,7 +17750,7 @@
|
|
|
17475
17750
|
className: b2("description")
|
|
17476
17751
|
}, description) : { description }, children));
|
|
17477
17752
|
};
|
|
17478
|
-
Empty.defaultProps = defaultProps$
|
|
17753
|
+
Empty.defaultProps = defaultProps$f;
|
|
17479
17754
|
Empty.displayName = "NutEmpty";
|
|
17480
17755
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
17481
17756
|
let index2 = 0;
|
|
@@ -17588,7 +17863,7 @@
|
|
|
17588
17863
|
}
|
|
17589
17864
|
});
|
|
17590
17865
|
};
|
|
17591
|
-
const defaultProps$
|
|
17866
|
+
const defaultProps$e = {};
|
|
17592
17867
|
const VirtualList = (props) => {
|
|
17593
17868
|
const {
|
|
17594
17869
|
sourceData = [],
|
|
@@ -17747,9 +18022,9 @@
|
|
|
17747
18022
|
}) : data);
|
|
17748
18023
|
}))));
|
|
17749
18024
|
};
|
|
17750
|
-
VirtualList.defaultProps = defaultProps$
|
|
18025
|
+
VirtualList.defaultProps = defaultProps$e;
|
|
17751
18026
|
VirtualList.displayName = "NutVirtualList";
|
|
17752
|
-
const defaultProps$
|
|
18027
|
+
const defaultProps$d = {
|
|
17753
18028
|
...ComponentDefaults,
|
|
17754
18029
|
className: "",
|
|
17755
18030
|
style: {},
|
|
@@ -17761,7 +18036,7 @@
|
|
|
17761
18036
|
};
|
|
17762
18037
|
const Table = (props) => {
|
|
17763
18038
|
const { locale } = useConfig$1();
|
|
17764
|
-
defaultProps$
|
|
18039
|
+
defaultProps$d.noData = locale.noData;
|
|
17765
18040
|
const {
|
|
17766
18041
|
children,
|
|
17767
18042
|
className,
|
|
@@ -17773,9 +18048,11 @@
|
|
|
17773
18048
|
striped,
|
|
17774
18049
|
noData,
|
|
17775
18050
|
onSorter,
|
|
18051
|
+
iconClassPrefix,
|
|
18052
|
+
iconFontClassName,
|
|
17776
18053
|
...rest
|
|
17777
18054
|
} = {
|
|
17778
|
-
...defaultProps$
|
|
18055
|
+
...defaultProps$d,
|
|
17779
18056
|
...props
|
|
17780
18057
|
};
|
|
17781
18058
|
const [curData, setCurData] = React.useState(data);
|
|
@@ -17816,8 +18093,8 @@
|
|
|
17816
18093
|
key: item.key,
|
|
17817
18094
|
onClick: () => handleSorterClick(item)
|
|
17818
18095
|
}, item.title, item.sorter && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
17819
|
-
classPrefix:
|
|
17820
|
-
fontClassName:
|
|
18096
|
+
classPrefix: iconClassPrefix,
|
|
18097
|
+
fontClassName: iconFontClassName,
|
|
17821
18098
|
name: "down-arrow",
|
|
17822
18099
|
size: "12px"
|
|
17823
18100
|
}));
|
|
@@ -17873,9 +18150,9 @@
|
|
|
17873
18150
|
className: "nut-table__nodata__text"
|
|
17874
18151
|
}, noData))));
|
|
17875
18152
|
};
|
|
17876
|
-
Table.defaultProps = defaultProps$
|
|
18153
|
+
Table.defaultProps = defaultProps$d;
|
|
17877
18154
|
Table.displayName = "NutTable";
|
|
17878
|
-
const defaultProps$
|
|
18155
|
+
const defaultProps$c = {
|
|
17879
18156
|
source: {
|
|
17880
18157
|
type: {},
|
|
17881
18158
|
src: ""
|
|
@@ -17900,7 +18177,7 @@
|
|
|
17900
18177
|
playend,
|
|
17901
18178
|
...restProps
|
|
17902
18179
|
} = {
|
|
17903
|
-
...defaultProps$
|
|
18180
|
+
...defaultProps$c,
|
|
17904
18181
|
...props
|
|
17905
18182
|
};
|
|
17906
18183
|
const rootRef = React.useRef(null);
|
|
@@ -17954,152 +18231,29 @@
|
|
|
17954
18231
|
kind: "captions"
|
|
17955
18232
|
})));
|
|
17956
18233
|
};
|
|
17957
|
-
Video.defaultProps = defaultProps$
|
|
18234
|
+
Video.defaultProps = defaultProps$c;
|
|
17958
18235
|
Video.displayName = "NutVideo";
|
|
17959
|
-
const
|
|
17960
|
-
|
|
17961
|
-
className: "",
|
|
17962
|
-
style: {},
|
|
17963
|
-
isShowPercentage: true,
|
|
17964
|
-
percentage: 0,
|
|
17965
|
-
fillColor: "#f3f3f3",
|
|
17966
|
-
strokeColor: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
17967
|
-
strokeWidth: "",
|
|
17968
|
-
textColor: "",
|
|
17969
|
-
textWidth: "",
|
|
17970
|
-
showText: true,
|
|
17971
|
-
textInside: false,
|
|
17972
|
-
textBackground: "linear-gradient(135deg, #fa2c19 0%, #fa6419 100%)",
|
|
17973
|
-
textType: "text",
|
|
17974
|
-
status: false,
|
|
17975
|
-
iconName: "checked",
|
|
17976
|
-
iconColor: "#439422",
|
|
17977
|
-
iconSize: "16px",
|
|
17978
|
-
rounded: true,
|
|
17979
|
-
children: void 0
|
|
17980
|
-
};
|
|
17981
|
-
const Progress = (props) => {
|
|
17982
|
-
const {
|
|
17983
|
-
className,
|
|
17984
|
-
style,
|
|
17985
|
-
isShowPercentage,
|
|
17986
|
-
percentage,
|
|
17987
|
-
fillColor,
|
|
17988
|
-
strokeColor,
|
|
17989
|
-
strokeWidth,
|
|
17990
|
-
size,
|
|
17991
|
-
textColor,
|
|
17992
|
-
textWidth,
|
|
17993
|
-
showText,
|
|
17994
|
-
textInside,
|
|
17995
|
-
textBackground,
|
|
17996
|
-
textType,
|
|
17997
|
-
status,
|
|
17998
|
-
iconName,
|
|
17999
|
-
iconColor,
|
|
18000
|
-
iconSize,
|
|
18001
|
-
rounded,
|
|
18002
|
-
children,
|
|
18003
|
-
...rest
|
|
18004
|
-
} = { ...defaultProps$c, ...props };
|
|
18005
|
-
const b2 = cn("progress");
|
|
18006
|
-
const classes = classNames(b2(""));
|
|
18007
|
-
const classesOuter = classNames({
|
|
18008
|
-
[`${b2("")}-outer`]: true,
|
|
18009
|
-
[`${b2("")}-${size || "base"}`]: true
|
|
18010
|
-
});
|
|
18011
|
-
const classesInner = classNames({
|
|
18012
|
-
[`${b2("")}-inner`]: true,
|
|
18013
|
-
[`${b2("")}-active`]: status
|
|
18014
|
-
});
|
|
18015
|
-
const classesText = classNames({
|
|
18016
|
-
[`${b2("")}-text`]: true
|
|
18017
|
-
});
|
|
18018
|
-
const classesInsideText = classNames({
|
|
18019
|
-
[`${b2("")}-text`]: true,
|
|
18020
|
-
[`${b2("")}-insidetext`]: true
|
|
18021
|
-
});
|
|
18022
|
-
const classesTextInner = classNames({
|
|
18023
|
-
[`${b2("")}-text__inner`]: true
|
|
18024
|
-
});
|
|
18025
|
-
const stylesOuter = {
|
|
18026
|
-
height: `${strokeWidth}px`,
|
|
18027
|
-
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
18028
|
-
background: `${fillColor}`
|
|
18029
|
-
};
|
|
18030
|
-
const stylesInner = {
|
|
18031
|
-
width: `${percentage}%`,
|
|
18032
|
-
borderRadius: `${rounded ? rounded === true ? "12px" : rounded : 0}`,
|
|
18033
|
-
background: `${strokeColor}`
|
|
18034
|
-
};
|
|
18035
|
-
const stylesInsideText = {
|
|
18036
|
-
width: `${textWidth}px`,
|
|
18037
|
-
left: `${percentage}%`,
|
|
18038
|
-
background: textBackground || strokeColor
|
|
18039
|
-
};
|
|
18040
|
-
const stylesInsideIcon = {
|
|
18041
|
-
width: `${textWidth}px`,
|
|
18042
|
-
left: `${percentage}%`
|
|
18043
|
-
};
|
|
18044
|
-
const stylesText = {
|
|
18045
|
-
width: `${textWidth}px`
|
|
18046
|
-
};
|
|
18047
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18048
|
-
className: `${classes} ${className}`,
|
|
18049
|
-
style,
|
|
18050
|
-
...rest
|
|
18051
|
-
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18052
|
-
className: classesOuter,
|
|
18053
|
-
style: stylesOuter
|
|
18054
|
-
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18055
|
-
className: classesInner,
|
|
18056
|
-
style: stylesInner
|
|
18057
|
-
}, showText && textInside && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18058
|
-
className: classesInsideText,
|
|
18059
|
-
style: stylesInsideIcon
|
|
18060
|
-
}, children) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18061
|
-
className: classesInsideText,
|
|
18062
|
-
style: stylesInsideText
|
|
18063
|
-
}, /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
18064
|
-
className: classesTextInner,
|
|
18065
|
-
style: { color: textColor || "#fff" }
|
|
18066
|
-
}, percentage, isShowPercentage ? "%" : ""))))), showText && !textInside && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18067
|
-
className: classesText,
|
|
18068
|
-
style: stylesText
|
|
18069
|
-
}, textType === "text" && /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
18070
|
-
className: classesTextInner,
|
|
18071
|
-
style: { color: textColor || "#333" }
|
|
18072
|
-
}, percentage, isShowPercentage ? "%" : ""), textType === "icon" && /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
18073
|
-
classPrefix: props.iconClassPrefix,
|
|
18074
|
-
fontClassName: props.iconFontClassName,
|
|
18075
|
-
size: iconSize,
|
|
18076
|
-
name: iconName,
|
|
18077
|
-
color: iconColor
|
|
18078
|
-
})));
|
|
18079
|
-
};
|
|
18080
|
-
Progress.defaultProps = defaultProps$c;
|
|
18081
|
-
Progress.displayName = "NutProgress";
|
|
18236
|
+
const b = cn("audio");
|
|
18237
|
+
const warn = console.warn;
|
|
18082
18238
|
const defaultProps$b = {
|
|
18083
18239
|
...ComponentDefaults,
|
|
18084
18240
|
className: "",
|
|
18085
18241
|
url: "",
|
|
18086
18242
|
style: {},
|
|
18087
|
-
muted: false,
|
|
18088
18243
|
autoplay: false,
|
|
18089
18244
|
loop: false,
|
|
18090
|
-
preload: "auto",
|
|
18091
18245
|
type: "progress",
|
|
18092
|
-
onFastBack: (
|
|
18246
|
+
onFastBack: (ctx2) => {
|
|
18093
18247
|
},
|
|
18094
|
-
onForward: (
|
|
18248
|
+
onForward: (ctx2) => {
|
|
18095
18249
|
},
|
|
18096
|
-
onPause: (
|
|
18250
|
+
onPause: (ctx2) => {
|
|
18097
18251
|
},
|
|
18098
|
-
|
|
18252
|
+
onPlay: (ctx2) => {
|
|
18099
18253
|
},
|
|
18100
|
-
|
|
18254
|
+
onPlayEnd: (ctx2) => {
|
|
18101
18255
|
},
|
|
18102
|
-
onCanPlay: (
|
|
18256
|
+
onCanPlay: (ctx2) => {
|
|
18103
18257
|
}
|
|
18104
18258
|
};
|
|
18105
18259
|
const Audio = (props) => {
|
|
@@ -18108,130 +18262,134 @@
|
|
|
18108
18262
|
className,
|
|
18109
18263
|
url,
|
|
18110
18264
|
style,
|
|
18111
|
-
muted,
|
|
18112
18265
|
autoplay,
|
|
18113
18266
|
loop: loop2,
|
|
18114
|
-
preload,
|
|
18115
18267
|
type,
|
|
18116
18268
|
onFastBack,
|
|
18117
18269
|
onForward,
|
|
18118
18270
|
onPause,
|
|
18271
|
+
onPlay,
|
|
18119
18272
|
onPlayEnd,
|
|
18120
|
-
onMute,
|
|
18121
18273
|
onCanPlay,
|
|
18122
18274
|
children,
|
|
18275
|
+
iconClassPrefix,
|
|
18276
|
+
iconFontClassName,
|
|
18123
18277
|
...rest
|
|
18124
18278
|
} = {
|
|
18125
18279
|
...defaultProps$b,
|
|
18126
18280
|
...props
|
|
18127
18281
|
};
|
|
18128
18282
|
const [playing, setPlaying] = React.useState(false);
|
|
18283
|
+
const [totalSeconds, setTotalSeconds] = React.useState(0);
|
|
18129
18284
|
const [percent, setPercent] = React.useState(0);
|
|
18130
18285
|
const [isCanPlay, setIsCanPlay] = React.useState(false);
|
|
18131
18286
|
const [currentDuration, setCurrentDuration] = React.useState("00:00:00");
|
|
18132
|
-
const AudioRef = React.useRef(null);
|
|
18133
18287
|
const statusRef = React.useRef({
|
|
18134
18288
|
currentTime: 0,
|
|
18135
18289
|
currentDuration: "00:00:00",
|
|
18136
|
-
percent: 0
|
|
18137
|
-
duration: "00:00:00",
|
|
18138
|
-
second: 0,
|
|
18139
|
-
hanMuted: props.muted,
|
|
18140
|
-
playing: props.autoplay,
|
|
18141
|
-
handPlaying: false
|
|
18290
|
+
percent: 0
|
|
18142
18291
|
});
|
|
18143
|
-
const
|
|
18144
|
-
const
|
|
18145
|
-
|
|
18292
|
+
const audioRef = React.useRef(Taro__default["default"].createInnerAudioContext());
|
|
18293
|
+
const audioCtx = audioRef.current;
|
|
18294
|
+
audioCtx.src = url;
|
|
18295
|
+
audioCtx.autoplay = autoplay || false;
|
|
18296
|
+
audioCtx.loop = loop2 || false;
|
|
18297
|
+
audioCtx.onPause(() => {
|
|
18298
|
+
props.onPause && props.onPause(audioCtx);
|
|
18299
|
+
});
|
|
18300
|
+
audioCtx.onEnded(() => {
|
|
18146
18301
|
if (props.loop) {
|
|
18147
18302
|
warn(locale.audio.tips || "onPlayEnd\u4E8B\u4EF6\u5728loop=false\u65F6\u624D\u4F1A\u89E6\u53D1");
|
|
18148
18303
|
} else {
|
|
18149
|
-
props.onPlayEnd && props.onPlayEnd(
|
|
18304
|
+
props.onPlayEnd && props.onPlayEnd(audioCtx);
|
|
18150
18305
|
}
|
|
18151
|
-
};
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18306
|
+
});
|
|
18307
|
+
audioCtx.onPlay(() => {
|
|
18308
|
+
const { duration } = audioCtx;
|
|
18309
|
+
setTotalSeconds(Math.floor(duration));
|
|
18310
|
+
props.onPlay && props.onPlay(audioCtx);
|
|
18311
|
+
});
|
|
18312
|
+
audioCtx.onCanplay(() => {
|
|
18313
|
+
const intervalID = setInterval(function() {
|
|
18314
|
+
if (audioCtx.duration !== 0) {
|
|
18315
|
+
setTotalSeconds(audioCtx.duration);
|
|
18316
|
+
clearInterval(intervalID);
|
|
18317
|
+
}
|
|
18318
|
+
}, 500);
|
|
18319
|
+
setIsCanPlay(true);
|
|
18320
|
+
props.onCanPlay && props.onCanPlay(audioCtx);
|
|
18321
|
+
});
|
|
18322
|
+
audioCtx.onTimeUpdate(() => {
|
|
18323
|
+
const time = parseInt(`${audioCtx.currentTime}`);
|
|
18324
|
+
const formated = formatSeconds(`${time}`);
|
|
18325
|
+
statusRef.current.currentDuration = formated;
|
|
18326
|
+
setPercent(time / totalSeconds * 100);
|
|
18327
|
+
setCurrentDuration(formatSeconds(audioCtx.currentTime.toString()));
|
|
18328
|
+
});
|
|
18329
|
+
audioCtx.onError((res) => {
|
|
18330
|
+
console.log("code", res.errCode);
|
|
18331
|
+
console.log("message", res.errMsg);
|
|
18332
|
+
});
|
|
18333
|
+
function formatSeconds(value) {
|
|
18334
|
+
if (!value) {
|
|
18335
|
+
return "00:00:00";
|
|
18158
18336
|
}
|
|
18337
|
+
const time = parseInt(value);
|
|
18338
|
+
const hours = Math.floor(time / 3600);
|
|
18339
|
+
const minutes = Math.floor((time - hours * 3600) / 60);
|
|
18340
|
+
const secondss = time - hours * 3600 - minutes * 60;
|
|
18341
|
+
let result = "";
|
|
18342
|
+
result += `${`0${hours.toString()}`.slice(-2)}:`;
|
|
18343
|
+
result += `${`0${minutes.toString()}`.slice(-2)}:`;
|
|
18344
|
+
result += `0${secondss.toString()}`.slice(-2);
|
|
18345
|
+
return result;
|
|
18159
18346
|
}
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18163
|
-
|
|
18164
|
-
|
|
18347
|
+
const handleBack = () => {
|
|
18348
|
+
const currentTime = Math.floor(audioCtx.currentTime);
|
|
18349
|
+
statusRef.current.currentTime = Math.max(currentTime - 1, 0);
|
|
18350
|
+
setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
|
|
18351
|
+
audioCtx.seek(statusRef.current.currentTime);
|
|
18352
|
+
props.onFastBack && props.onFastBack(audioCtx);
|
|
18353
|
+
};
|
|
18354
|
+
const handleForward = () => {
|
|
18355
|
+
const currentTime = Math.floor(audioCtx.currentTime);
|
|
18356
|
+
statusRef.current.currentTime = Math.min(currentTime + 1, audioCtx.duration);
|
|
18357
|
+
setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
|
|
18358
|
+
audioCtx.seek(statusRef.current.currentTime);
|
|
18359
|
+
props.onForward && props.onForward(audioCtx);
|
|
18360
|
+
};
|
|
18165
18361
|
const handleStatusChange = () => {
|
|
18166
18362
|
setPlaying(!playing);
|
|
18167
|
-
if (playing) {
|
|
18168
|
-
|
|
18363
|
+
if (!playing) {
|
|
18364
|
+
audioCtx.play();
|
|
18169
18365
|
} else {
|
|
18170
|
-
|
|
18366
|
+
audioCtx.pause();
|
|
18171
18367
|
}
|
|
18172
18368
|
};
|
|
18173
18369
|
const renderIcon = () => {
|
|
18174
18370
|
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18175
|
-
className:
|
|
18371
|
+
className: b("icon")
|
|
18176
18372
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18177
|
-
className: `${
|
|
18373
|
+
className: `${b("icon-box")} ${playing ? b("icon-play") : b("icon-stop")}`,
|
|
18178
18374
|
onClick: handleStatusChange
|
|
18179
18375
|
}, playing ? /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
18180
|
-
classPrefix:
|
|
18181
|
-
fontClassName:
|
|
18376
|
+
classPrefix: iconClassPrefix,
|
|
18377
|
+
fontClassName: iconFontClassName,
|
|
18182
18378
|
name: "service",
|
|
18183
18379
|
className: "nut-icon-loading"
|
|
18184
18380
|
}) : /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
18185
|
-
classPrefix:
|
|
18186
|
-
fontClassName:
|
|
18381
|
+
classPrefix: iconClassPrefix,
|
|
18382
|
+
fontClassName: iconFontClassName,
|
|
18187
18383
|
name: "service"
|
|
18188
18384
|
}))));
|
|
18189
18385
|
};
|
|
18190
|
-
const handleBack = () => {
|
|
18191
|
-
if (statusRef.current.currentTime > 0 && AudioRef.current) {
|
|
18192
|
-
statusRef.current.currentTime--;
|
|
18193
|
-
AudioRef.current.currentTime = statusRef.current.currentTime;
|
|
18194
|
-
props.onFastBack && props.onFastBack(AudioRef.current);
|
|
18195
|
-
}
|
|
18196
|
-
};
|
|
18197
|
-
const handleForward = () => {
|
|
18198
|
-
if (AudioRef.current) {
|
|
18199
|
-
statusRef.current.currentTime++;
|
|
18200
|
-
AudioRef.current.currentTime = statusRef.current.currentTime;
|
|
18201
|
-
props.onForward && props.onForward(AudioRef.current);
|
|
18202
|
-
}
|
|
18203
|
-
};
|
|
18204
|
-
const handleMute = () => {
|
|
18205
|
-
if (AudioRef.current) {
|
|
18206
|
-
AudioRef.current.muted = !AudioRef.current.muted;
|
|
18207
|
-
props.onMute && props.onMute(AudioRef.current);
|
|
18208
|
-
}
|
|
18209
|
-
};
|
|
18210
|
-
const handlePause = (e2) => {
|
|
18211
|
-
setPlaying(false);
|
|
18212
|
-
props.onPause && props.onPause(e2);
|
|
18213
|
-
};
|
|
18214
|
-
const formatSeconds = (value) => {
|
|
18215
|
-
if (!value) {
|
|
18216
|
-
return "00:00:00";
|
|
18217
|
-
}
|
|
18218
|
-
const time = parseInt(value);
|
|
18219
|
-
const hours = Math.floor(time / 3600);
|
|
18220
|
-
const minutes = Math.floor((time - hours * 3600) / 60);
|
|
18221
|
-
const seconds = time - hours * 3600 - minutes * 60;
|
|
18222
|
-
let result = "";
|
|
18223
|
-
result += `${`0${hours.toString()}`.slice(-2)}:`;
|
|
18224
|
-
result += `${`0${minutes.toString()}`.slice(-2)}:`;
|
|
18225
|
-
result += `0${seconds.toString()}`.slice(-2);
|
|
18226
|
-
return result;
|
|
18227
|
-
};
|
|
18228
18386
|
const renderProgerss = () => {
|
|
18229
18387
|
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18230
|
-
className:
|
|
18388
|
+
className: b("progress")
|
|
18231
18389
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18232
18390
|
className: "time"
|
|
18233
18391
|
}, currentDuration), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18234
|
-
className:
|
|
18392
|
+
className: b("progress-bar-wrapper")
|
|
18235
18393
|
}, /* @__PURE__ */ React__default["default"].createElement(Range, {
|
|
18236
18394
|
modelValue: percent,
|
|
18237
18395
|
hiddenTag: true,
|
|
@@ -18240,7 +18398,7 @@
|
|
|
18240
18398
|
"active-color": "#fa2c19"
|
|
18241
18399
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18242
18400
|
className: "time"
|
|
18243
|
-
},
|
|
18401
|
+
}, formatSeconds(`${totalSeconds}`) || "00:00:00")), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18244
18402
|
className: isCanPlay ? "custom-button-group" : "custom-button-group-disable"
|
|
18245
18403
|
}, /* @__PURE__ */ React__default["default"].createElement(Button$1, {
|
|
18246
18404
|
type: "primary",
|
|
@@ -18256,15 +18414,11 @@
|
|
|
18256
18414
|
type: "primary",
|
|
18257
18415
|
size: "small",
|
|
18258
18416
|
onClick: handleForward
|
|
18259
|
-
}, locale.audio.forward || "\u5FEB\u8FDB")
|
|
18260
|
-
type: AudioRef.current && AudioRef.current.muted ? "default" : "primary",
|
|
18261
|
-
size: "small",
|
|
18262
|
-
onClick: handleMute
|
|
18263
|
-
}, locale.audio.mute || "\u9759\u97F3")));
|
|
18417
|
+
}, locale.audio.forward || "\u5FEB\u8FDB")));
|
|
18264
18418
|
};
|
|
18265
18419
|
const renderNone = () => {
|
|
18266
18420
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18267
|
-
className:
|
|
18421
|
+
className: b("none-container"),
|
|
18268
18422
|
onClick: handleStatusChange
|
|
18269
18423
|
}, children);
|
|
18270
18424
|
};
|
|
@@ -18280,43 +18434,11 @@
|
|
|
18280
18434
|
return null;
|
|
18281
18435
|
}
|
|
18282
18436
|
};
|
|
18283
|
-
const handleCanplay = (e2) => {
|
|
18284
|
-
setIsCanPlay(true);
|
|
18285
|
-
if (props.autoplay && !playing) {
|
|
18286
|
-
AudioRef && AudioRef.current && AudioRef.current.play();
|
|
18287
|
-
}
|
|
18288
|
-
if (AudioRef.current) {
|
|
18289
|
-
statusRef.current.second = AudioRef.current.duration || 0;
|
|
18290
|
-
props.onCanPlay && props.onCanPlay(e2);
|
|
18291
|
-
}
|
|
18292
|
-
};
|
|
18293
|
-
const onTimeupdate = (e2) => {
|
|
18294
|
-
const time = parseInt(e2.target.currentTime);
|
|
18295
|
-
const formated = formatSeconds(`${time}`);
|
|
18296
|
-
statusRef.current.currentDuration = formated;
|
|
18297
|
-
setPercent(time / statusRef.current.second * 100);
|
|
18298
|
-
setCurrentDuration(formated);
|
|
18299
|
-
statusRef.current.currentTime = time;
|
|
18300
|
-
};
|
|
18301
18437
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18302
|
-
className: `${
|
|
18438
|
+
className: `${b()} ${className}`,
|
|
18303
18439
|
style,
|
|
18304
18440
|
...rest
|
|
18305
|
-
}, renderAudio()
|
|
18306
|
-
className: "audioMain",
|
|
18307
|
-
controls: type === "controls",
|
|
18308
|
-
ref: AudioRef,
|
|
18309
|
-
src: url,
|
|
18310
|
-
muted,
|
|
18311
|
-
preload,
|
|
18312
|
-
loop: loop2,
|
|
18313
|
-
onPause: (e2) => handlePause(e2),
|
|
18314
|
-
onEnded: (e2) => handleEnded(e2),
|
|
18315
|
-
onCanPlay: (e2) => handleCanplay(e2),
|
|
18316
|
-
onTimeUpdate: (e2) => onTimeupdate(e2)
|
|
18317
|
-
}, /* @__PURE__ */ React__default["default"].createElement("track", {
|
|
18318
|
-
kind: "captions"
|
|
18319
|
-
})));
|
|
18441
|
+
}, renderAudio());
|
|
18320
18442
|
};
|
|
18321
18443
|
Audio.defaultProps = defaultProps$b;
|
|
18322
18444
|
Audio.displayName = "NutAudio";
|
|
@@ -19133,8 +19255,13 @@
|
|
|
19133
19255
|
onTabChecked,
|
|
19134
19256
|
style,
|
|
19135
19257
|
className,
|
|
19258
|
+
iconClassPrefix,
|
|
19259
|
+
iconFontClassName,
|
|
19136
19260
|
...rest
|
|
19137
|
-
} = {
|
|
19261
|
+
} = {
|
|
19262
|
+
...defaultProps$6,
|
|
19263
|
+
...props
|
|
19264
|
+
};
|
|
19138
19265
|
const b2 = cn("address");
|
|
19139
19266
|
const [privateType, setPrivateType] = React.useState(type);
|
|
19140
19267
|
const [tabName] = React.useState(["province", "city", "country", "town"]);
|
|
@@ -19227,8 +19354,8 @@
|
|
|
19227
19354
|
className: "arrow-back",
|
|
19228
19355
|
onClick: onSwitchModule
|
|
19229
19356
|
}, privateType === "custom" && backBtnIcon && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
19230
|
-
classPrefix:
|
|
19231
|
-
fontClassName:
|
|
19357
|
+
classPrefix: iconClassPrefix,
|
|
19358
|
+
fontClassName: iconFontClassName,
|
|
19232
19359
|
name: backBtnIcon,
|
|
19233
19360
|
color: "#cccccc"
|
|
19234
19361
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -19236,8 +19363,8 @@
|
|
|
19236
19363
|
}, privateType === "custom" ? locale.address.selectRegion || customAddressTitle : locale.address.deliveryTo || existAddressTitle), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
19237
19364
|
onClick: () => handClose()
|
|
19238
19365
|
}, closeBtnIcon && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
19239
|
-
classPrefix:
|
|
19240
|
-
fontClassName:
|
|
19366
|
+
classPrefix: iconClassPrefix,
|
|
19367
|
+
fontClassName: iconFontClassName,
|
|
19241
19368
|
name: closeBtnIcon,
|
|
19242
19369
|
color: "#cccccc",
|
|
19243
19370
|
size: "18px"
|
|
@@ -19314,7 +19441,6 @@
|
|
|
19314
19441
|
};
|
|
19315
19442
|
const barrageBody = React.useRef(null);
|
|
19316
19443
|
const barrageContainer = React.useRef(null);
|
|
19317
|
-
const barrageCWidth = React.useRef(0);
|
|
19318
19444
|
const timer = React.useRef(0);
|
|
19319
19445
|
const index2 = React.useRef(0);
|
|
19320
19446
|
const b2 = cn("barrage");
|
|
@@ -19326,10 +19452,7 @@
|
|
|
19326
19452
|
}
|
|
19327
19453
|
}));
|
|
19328
19454
|
React.useEffect(() => {
|
|
19329
|
-
|
|
19330
|
-
barrageCWidth.current = barrageBody.current.offsetWidth;
|
|
19331
|
-
run();
|
|
19332
|
-
}
|
|
19455
|
+
run();
|
|
19333
19456
|
return () => {
|
|
19334
19457
|
clearInterval(timer.current);
|
|
19335
19458
|
};
|
|
@@ -19348,12 +19471,11 @@
|
|
|
19348
19471
|
el.classList.add("barrage-item");
|
|
19349
19472
|
barrageContainer.current.appendChild(el);
|
|
19350
19473
|
Taro__default["default"].createSelectorQuery().select(".barrage-item").boundingClientRect((res) => {
|
|
19351
|
-
res
|
|
19474
|
+
console.log("res", res);
|
|
19352
19475
|
const height = res == null ? void 0 : res.height;
|
|
19353
19476
|
el.classList.add("move");
|
|
19354
19477
|
el.style.animationDuration = `${speeds}ms`;
|
|
19355
19478
|
el.style.top = `${_index % rows * (height + top) + 20}px`;
|
|
19356
|
-
el.style.setProperty("--move-distance", `-${barrageCWidth.current}px`);
|
|
19357
19479
|
el.dataset.index = `${_index}`;
|
|
19358
19480
|
el.addEventListener("animationend", () => {
|
|
19359
19481
|
barrageContainer.current.removeChild(el);
|
|
@@ -19823,6 +19945,7 @@
|
|
|
19823
19945
|
exports2.Skeleton = Skeleton;
|
|
19824
19946
|
exports2.Step = Step;
|
|
19825
19947
|
exports2.Steps = Steps;
|
|
19948
|
+
exports2.Sticky = Sticky;
|
|
19826
19949
|
exports2.SubSideNavBar = SubSideNavBar;
|
|
19827
19950
|
exports2.Swipe = Swipe;
|
|
19828
19951
|
exports2.Swiper = Swiper;
|