@nutui/nutui-react-taro 1.3.4 → 1.3.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/esm/Address.js +3 -4
- package/dist/esm/AnimatingNumbers.js +2 -2
- package/dist/esm/Audio.js +4 -4
- package/dist/esm/Cascader/style/index.js +2 -1
- package/dist/esm/Cascader.js +2 -2
- package/dist/esm/Dialog.js +2 -4
- package/dist/esm/ImagePreview/style/index.js +3 -1
- package/dist/esm/ImagePreview.js +3 -4
- package/dist/esm/Infiniteloading.js +2 -2
- package/dist/esm/Notify.js +2 -3
- package/dist/esm/Range.js +3 -3
- package/dist/esm/Rate.js +2 -2
- package/dist/esm/Swiper/style/index.js +1 -1
- package/dist/esm/Swiper.js +2 -2
- package/dist/esm/Toast.js +2 -2
- package/dist/esm/{address.taro-7540c626.js → address.taro-f16cef31.js} +76 -373
- package/dist/esm/{animatingnumbers.taro-877baa98.js → animatingnumbers.taro-6f40a2e9.js} +41 -25
- package/dist/esm/{audio.taro-ab2528b2.js → audio.taro-29f5568f.js} +1 -1
- package/dist/esm/{cascader.taro-35387092.js → cascader.taro-77100fb4.js} +54 -48
- package/dist/esm/dialog.taro-492e2b9a.js +218 -0
- package/dist/esm/{imagepreview.taro-3f1c7638.js → imagepreview.taro-1199e977.js} +3 -11
- package/dist/esm/{infiniteloading.taro-9701755f.js → infiniteloading.taro-b95e62bf.js} +1 -3
- package/dist/esm/notify.taro-d9c48fae.js +122 -0
- package/dist/esm/nutui-react.es.js +12 -12
- package/dist/esm/{range.taro-141a0163.js → range.taro-515d37a4.js} +1 -1
- package/dist/esm/{rate.taro-5077b962.js → rate.taro-69c85081.js} +4 -2
- package/dist/esm/{swiper.taro-58ed323b.js → swiper.taro-f314d67a.js} +4 -2
- package/dist/esm/{toast.taro-cd22a0d7.js → toast.taro-86862dff.js} +1 -1
- package/dist/esm/types/src/packages/address/customRender.taro.d.ts +15 -0
- package/dist/esm/types/src/packages/cascader/cascader.d.ts +1 -0
- package/dist/esm/types/src/packages/cascader/cascader.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/notify/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/notify/notify.taro.d.ts +9 -15
- 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 +582 -1232
- package/dist/nutui.react.umd.js +577 -1227
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/types/index.d.ts +169 -174
- package/package.json +1 -1
- package/dist/esm/dialog.taro-54c67e08.js +0 -554
- package/dist/esm/notify.taro-0d9cfb07.js +0 -300
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react-taro v1.3.
|
|
2
|
+
* @nutui/nutui-react-taro v1.3.5-beta.1 Wed Sep 28 2022 14:33:38 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import React__default, { useCallback, useState, useEffect, Component, useRef, createContext, useContext as useContext$1, useLayoutEffect, forwardRef, useMemo, useImperativeHandle, memo } from "react";
|
|
8
|
-
import Taro, {
|
|
9
|
-
import
|
|
10
|
-
import ReactDOM__default, { createPortal, unstable_batchedUpdates } from "react-dom";
|
|
8
|
+
import Taro, { nextTick, useReady, createSelectorQuery } from "@tarojs/taro";
|
|
9
|
+
import ReactDOM, { createPortal, unstable_batchedUpdates } from "react-dom";
|
|
11
10
|
function getAugmentedNamespace(n2) {
|
|
12
11
|
if (n2.__esModule)
|
|
13
12
|
return n2;
|
|
@@ -61,7 +60,7 @@ classname_production_min.cn = e$1, classname_production_min.withNaming = r$1;
|
|
|
61
60
|
classname.exports = classname_production_min;
|
|
62
61
|
}
|
|
63
62
|
const cn = classname.exports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
64
|
-
const defaultProps$
|
|
63
|
+
const defaultProps$1o = {
|
|
65
64
|
name: "",
|
|
66
65
|
size: "",
|
|
67
66
|
classPrefix: "nut-icon",
|
|
@@ -89,7 +88,7 @@ function Icon$1(props) {
|
|
|
89
88
|
onClick,
|
|
90
89
|
...rest
|
|
91
90
|
} = {
|
|
92
|
-
...defaultProps$
|
|
91
|
+
...defaultProps$1o,
|
|
93
92
|
...props
|
|
94
93
|
};
|
|
95
94
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
@@ -123,13 +122,13 @@ function Icon$1(props) {
|
|
|
123
122
|
children
|
|
124
123
|
);
|
|
125
124
|
}
|
|
126
|
-
Icon$1.defaultProps = defaultProps$
|
|
125
|
+
Icon$1.defaultProps = defaultProps$1o;
|
|
127
126
|
Icon$1.displayName = "NutIcon";
|
|
128
127
|
const ComponentDefaults = {
|
|
129
128
|
iconClassPrefix: "nut-icon",
|
|
130
129
|
iconFontClassName: "nutui-iconfont"
|
|
131
130
|
};
|
|
132
|
-
const defaultProps$
|
|
131
|
+
const defaultProps$1n = {
|
|
133
132
|
...ComponentDefaults,
|
|
134
133
|
className: "",
|
|
135
134
|
color: "",
|
|
@@ -146,7 +145,7 @@ const defaultProps$1p = {
|
|
|
146
145
|
onClick: (e2) => {
|
|
147
146
|
}
|
|
148
147
|
};
|
|
149
|
-
const Button
|
|
148
|
+
const Button = (props) => {
|
|
150
149
|
const {
|
|
151
150
|
color,
|
|
152
151
|
shape,
|
|
@@ -165,7 +164,7 @@ const Button$1 = (props) => {
|
|
|
165
164
|
iconFontClassName,
|
|
166
165
|
...rest
|
|
167
166
|
} = {
|
|
168
|
-
...defaultProps$
|
|
167
|
+
...defaultProps$1n,
|
|
169
168
|
...props
|
|
170
169
|
};
|
|
171
170
|
const getStyle = useCallback(() => {
|
|
@@ -242,8 +241,8 @@ const Button$1 = (props) => {
|
|
|
242
241
|
name: icon
|
|
243
242
|
}) : "", children));
|
|
244
243
|
};
|
|
245
|
-
Button
|
|
246
|
-
Button
|
|
244
|
+
Button.defaultProps = defaultProps$1n;
|
|
245
|
+
Button.displayName = "NutButton";
|
|
247
246
|
function _setPrototypeOf(o, p2) {
|
|
248
247
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
249
248
|
o2.__proto__ = p3;
|
|
@@ -704,7 +703,7 @@ function createReactContext(defaultValue, calculateChangedBits) {
|
|
|
704
703
|
}
|
|
705
704
|
}
|
|
706
705
|
};
|
|
707
|
-
_proto.render = function
|
|
706
|
+
_proto.render = function render() {
|
|
708
707
|
return this.props.children;
|
|
709
708
|
};
|
|
710
709
|
return Provider2;
|
|
@@ -752,7 +751,7 @@ function createReactContext(defaultValue, calculateChangedBits) {
|
|
|
752
751
|
return defaultValue;
|
|
753
752
|
}
|
|
754
753
|
};
|
|
755
|
-
_proto2.render = function
|
|
754
|
+
_proto2.render = function render() {
|
|
756
755
|
return onlyChild(this.props.children)(this.state.value);
|
|
757
756
|
};
|
|
758
757
|
return Consumer2;
|
|
@@ -778,12 +777,12 @@ var PATH_REGEXP = new RegExp([
|
|
|
778
777
|
"(\\\\.)",
|
|
779
778
|
"([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"
|
|
780
779
|
].join("|"), "g");
|
|
781
|
-
function parse$1(str,
|
|
780
|
+
function parse$1(str, options) {
|
|
782
781
|
var tokens = [];
|
|
783
782
|
var key = 0;
|
|
784
783
|
var index2 = 0;
|
|
785
784
|
var path = "";
|
|
786
|
-
var defaultDelimiter =
|
|
785
|
+
var defaultDelimiter = options && options.delimiter || "/";
|
|
787
786
|
var res;
|
|
788
787
|
while ((res = PATH_REGEXP.exec(str)) != null) {
|
|
789
788
|
var m2 = res[0];
|
|
@@ -830,8 +829,8 @@ function parse$1(str, options2) {
|
|
|
830
829
|
}
|
|
831
830
|
return tokens;
|
|
832
831
|
}
|
|
833
|
-
function compile(str,
|
|
834
|
-
return tokensToFunction(parse$1(str,
|
|
832
|
+
function compile(str, options) {
|
|
833
|
+
return tokensToFunction(parse$1(str, options), options);
|
|
835
834
|
}
|
|
836
835
|
function encodeURIComponentPretty(str) {
|
|
837
836
|
return encodeURI(str).replace(/[\/?#]/g, function(c6) {
|
|
@@ -843,18 +842,18 @@ function encodeAsterisk(str) {
|
|
|
843
842
|
return "%" + c6.charCodeAt(0).toString(16).toUpperCase();
|
|
844
843
|
});
|
|
845
844
|
}
|
|
846
|
-
function tokensToFunction(tokens,
|
|
845
|
+
function tokensToFunction(tokens, options) {
|
|
847
846
|
var matches = new Array(tokens.length);
|
|
848
847
|
for (var i = 0; i < tokens.length; i++) {
|
|
849
848
|
if (typeof tokens[i] === "object") {
|
|
850
|
-
matches[i] = new RegExp("^(?:" + tokens[i].pattern + ")$", flags(
|
|
849
|
+
matches[i] = new RegExp("^(?:" + tokens[i].pattern + ")$", flags(options));
|
|
851
850
|
}
|
|
852
851
|
}
|
|
853
852
|
return function(obj, opts) {
|
|
854
853
|
var path = "";
|
|
855
854
|
var data = obj || {};
|
|
856
|
-
var
|
|
857
|
-
var encode =
|
|
855
|
+
var options2 = opts || {};
|
|
856
|
+
var encode = options2.pretty ? encodeURIComponentPretty : encodeURIComponent;
|
|
858
857
|
for (var i2 = 0; i2 < tokens.length; i2++) {
|
|
859
858
|
var token = tokens[i2];
|
|
860
859
|
if (typeof token === "string") {
|
|
@@ -912,8 +911,8 @@ function attachKeys(re, keys) {
|
|
|
912
911
|
re.keys = keys;
|
|
913
912
|
return re;
|
|
914
913
|
}
|
|
915
|
-
function flags(
|
|
916
|
-
return
|
|
914
|
+
function flags(options) {
|
|
915
|
+
return options && options.sensitive ? "" : "i";
|
|
917
916
|
}
|
|
918
917
|
function regexpToRegexp(path, keys) {
|
|
919
918
|
var groups = path.source.match(/\((?!\?)/g);
|
|
@@ -933,25 +932,25 @@ function regexpToRegexp(path, keys) {
|
|
|
933
932
|
}
|
|
934
933
|
return attachKeys(path, keys);
|
|
935
934
|
}
|
|
936
|
-
function arrayToRegexp(path, keys,
|
|
935
|
+
function arrayToRegexp(path, keys, options) {
|
|
937
936
|
var parts = [];
|
|
938
937
|
for (var i = 0; i < path.length; i++) {
|
|
939
|
-
parts.push(pathToRegexp(path[i], keys,
|
|
938
|
+
parts.push(pathToRegexp(path[i], keys, options).source);
|
|
940
939
|
}
|
|
941
|
-
var regexp = new RegExp("(?:" + parts.join("|") + ")", flags(
|
|
940
|
+
var regexp = new RegExp("(?:" + parts.join("|") + ")", flags(options));
|
|
942
941
|
return attachKeys(regexp, keys);
|
|
943
942
|
}
|
|
944
|
-
function stringToRegexp(path, keys,
|
|
945
|
-
return tokensToRegExp(parse$1(path,
|
|
943
|
+
function stringToRegexp(path, keys, options) {
|
|
944
|
+
return tokensToRegExp(parse$1(path, options), keys, options);
|
|
946
945
|
}
|
|
947
|
-
function tokensToRegExp(tokens, keys,
|
|
946
|
+
function tokensToRegExp(tokens, keys, options) {
|
|
948
947
|
if (!isarray(keys)) {
|
|
949
|
-
|
|
948
|
+
options = keys || options;
|
|
950
949
|
keys = [];
|
|
951
950
|
}
|
|
952
|
-
|
|
953
|
-
var strict =
|
|
954
|
-
var end =
|
|
951
|
+
options = options || {};
|
|
952
|
+
var strict = options.strict;
|
|
953
|
+
var end = options.end !== false;
|
|
955
954
|
var route = "";
|
|
956
955
|
for (var i = 0; i < tokens.length; i++) {
|
|
957
956
|
var token = tokens[i];
|
|
@@ -976,7 +975,7 @@ function tokensToRegExp(tokens, keys, options2) {
|
|
|
976
975
|
route += capture;
|
|
977
976
|
}
|
|
978
977
|
}
|
|
979
|
-
var delimiter = escapeString(
|
|
978
|
+
var delimiter = escapeString(options.delimiter || "/");
|
|
980
979
|
var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
|
|
981
980
|
if (!strict) {
|
|
982
981
|
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + "(?:" + delimiter + "(?=$))?";
|
|
@@ -986,21 +985,21 @@ function tokensToRegExp(tokens, keys, options2) {
|
|
|
986
985
|
} else {
|
|
987
986
|
route += strict && endsWithDelimiter ? "" : "(?=" + delimiter + "|$)";
|
|
988
987
|
}
|
|
989
|
-
return attachKeys(new RegExp("^" + route, flags(
|
|
988
|
+
return attachKeys(new RegExp("^" + route, flags(options)), keys);
|
|
990
989
|
}
|
|
991
|
-
function pathToRegexp(path, keys,
|
|
990
|
+
function pathToRegexp(path, keys, options) {
|
|
992
991
|
if (!isarray(keys)) {
|
|
993
|
-
|
|
992
|
+
options = keys || options;
|
|
994
993
|
keys = [];
|
|
995
994
|
}
|
|
996
|
-
|
|
995
|
+
options = options || {};
|
|
997
996
|
if (path instanceof RegExp) {
|
|
998
997
|
return regexpToRegexp(path, keys);
|
|
999
998
|
}
|
|
1000
999
|
if (isarray(path)) {
|
|
1001
|
-
return arrayToRegexp(path, keys,
|
|
1000
|
+
return arrayToRegexp(path, keys, options);
|
|
1002
1001
|
}
|
|
1003
|
-
return stringToRegexp(path, keys,
|
|
1002
|
+
return stringToRegexp(path, keys, options);
|
|
1004
1003
|
}
|
|
1005
1004
|
var pathToRegexp$1 = pathToRegexp$2.exports;
|
|
1006
1005
|
var reactIs$1 = { exports: {} };
|
|
@@ -1198,7 +1197,7 @@ var Router = /* @__PURE__ */ function(_React$Component) {
|
|
|
1198
1197
|
this._pendingLocation = null;
|
|
1199
1198
|
}
|
|
1200
1199
|
};
|
|
1201
|
-
_proto.render = function
|
|
1200
|
+
_proto.render = function render() {
|
|
1202
1201
|
return /* @__PURE__ */ React__default.createElement(context.Provider, {
|
|
1203
1202
|
value: {
|
|
1204
1203
|
history: this.props.history,
|
|
@@ -1225,7 +1224,7 @@ var Router = /* @__PURE__ */ function(_React$Component) {
|
|
|
1225
1224
|
return _this;
|
|
1226
1225
|
}
|
|
1227
1226
|
var _proto = MemoryRouter.prototype;
|
|
1228
|
-
_proto.render = function
|
|
1227
|
+
_proto.render = function render() {
|
|
1229
1228
|
return /* @__PURE__ */ React__default.createElement(Router, {
|
|
1230
1229
|
history: this.history,
|
|
1231
1230
|
children: this.props.children
|
|
@@ -1251,7 +1250,7 @@ var Router = /* @__PURE__ */ function(_React$Component) {
|
|
|
1251
1250
|
if (this.props.onUnmount)
|
|
1252
1251
|
this.props.onUnmount.call(this, this);
|
|
1253
1252
|
};
|
|
1254
|
-
_proto.render = function
|
|
1253
|
+
_proto.render = function render() {
|
|
1255
1254
|
return null;
|
|
1256
1255
|
};
|
|
1257
1256
|
return Lifecycle;
|
|
@@ -1259,13 +1258,13 @@ var Router = /* @__PURE__ */ function(_React$Component) {
|
|
|
1259
1258
|
var cache$1 = {};
|
|
1260
1259
|
var cacheLimit$1 = 1e4;
|
|
1261
1260
|
var cacheCount$1 = 0;
|
|
1262
|
-
function compilePath$1(path,
|
|
1263
|
-
var cacheKey2 = "" +
|
|
1261
|
+
function compilePath$1(path, options) {
|
|
1262
|
+
var cacheKey2 = "" + options.end + options.strict + options.sensitive;
|
|
1264
1263
|
var pathCache = cache$1[cacheKey2] || (cache$1[cacheKey2] = {});
|
|
1265
1264
|
if (pathCache[path])
|
|
1266
1265
|
return pathCache[path];
|
|
1267
1266
|
var keys = [];
|
|
1268
|
-
var regexp = pathToRegexp$1(path, keys,
|
|
1267
|
+
var regexp = pathToRegexp$1(path, keys, options);
|
|
1269
1268
|
var result = {
|
|
1270
1269
|
regexp,
|
|
1271
1270
|
keys
|
|
@@ -1276,16 +1275,16 @@ function compilePath$1(path, options2) {
|
|
|
1276
1275
|
}
|
|
1277
1276
|
return result;
|
|
1278
1277
|
}
|
|
1279
|
-
function matchPath(pathname,
|
|
1280
|
-
if (
|
|
1281
|
-
|
|
1278
|
+
function matchPath(pathname, options) {
|
|
1279
|
+
if (options === void 0) {
|
|
1280
|
+
options = {};
|
|
1282
1281
|
}
|
|
1283
|
-
if (typeof
|
|
1284
|
-
|
|
1285
|
-
path:
|
|
1282
|
+
if (typeof options === "string" || Array.isArray(options)) {
|
|
1283
|
+
options = {
|
|
1284
|
+
path: options
|
|
1286
1285
|
};
|
|
1287
1286
|
}
|
|
1288
|
-
var _options =
|
|
1287
|
+
var _options = options, path = _options.path, _options$exact = _options.exact, exact = _options$exact === void 0 ? false : _options$exact, _options$strict = _options.strict, strict = _options$strict === void 0 ? false : _options$strict, _options$sensitive = _options.sensitive, sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
|
|
1289
1288
|
var paths = [].concat(path);
|
|
1290
1289
|
return paths.reduce(function(matched, path2) {
|
|
1291
1290
|
if (!path2 && path2 !== "")
|
|
@@ -1324,7 +1323,7 @@ function isEmptyChildren(children) {
|
|
|
1324
1323
|
return _React$Component.apply(this, arguments) || this;
|
|
1325
1324
|
}
|
|
1326
1325
|
var _proto = Route.prototype;
|
|
1327
|
-
_proto.render = function
|
|
1326
|
+
_proto.render = function render() {
|
|
1328
1327
|
var _this = this;
|
|
1329
1328
|
return /* @__PURE__ */ React__default.createElement(context.Consumer, null, function(context$1) {
|
|
1330
1329
|
!context$1 ? invariant(false) : void 0;
|
|
@@ -1334,13 +1333,13 @@ function isEmptyChildren(children) {
|
|
|
1334
1333
|
location,
|
|
1335
1334
|
match
|
|
1336
1335
|
});
|
|
1337
|
-
var _this$props = _this.props, children = _this$props.children, component = _this$props.component,
|
|
1336
|
+
var _this$props = _this.props, children = _this$props.children, component = _this$props.component, render2 = _this$props.render;
|
|
1338
1337
|
if (Array.isArray(children) && isEmptyChildren(children)) {
|
|
1339
1338
|
children = null;
|
|
1340
1339
|
}
|
|
1341
1340
|
return /* @__PURE__ */ React__default.createElement(context.Provider, {
|
|
1342
1341
|
value: props
|
|
1343
|
-
}, props.match ? children ? typeof children === "function" ? children(props) : children : component ? /* @__PURE__ */ React__default.createElement(component, props) :
|
|
1342
|
+
}, props.match ? children ? typeof children === "function" ? children(props) : children : component ? /* @__PURE__ */ React__default.createElement(component, props) : render2 ? render2(props) : null : typeof children === "function" ? children(props) : null);
|
|
1344
1343
|
});
|
|
1345
1344
|
};
|
|
1346
1345
|
return Route;
|
|
@@ -1404,7 +1403,7 @@ function noop$3() {
|
|
|
1404
1403
|
context2.location = addBasename(basename, createLocation(location));
|
|
1405
1404
|
context2.url = createURL(context2.location);
|
|
1406
1405
|
};
|
|
1407
|
-
_proto.render = function
|
|
1406
|
+
_proto.render = function render() {
|
|
1408
1407
|
var _this$props2 = this.props, _this$props2$basename = _this$props2.basename, basename = _this$props2$basename === void 0 ? "" : _this$props2$basename, _this$props2$context = _this$props2.context, context2 = _this$props2$context === void 0 ? {} : _this$props2$context, _this$props2$location = _this$props2.location, location = _this$props2$location === void 0 ? "/" : _this$props2$location, rest = _objectWithoutPropertiesLoose$3(_this$props2, ["basename", "context", "location"]);
|
|
1409
1408
|
var history = {
|
|
1410
1409
|
createHref: function createHref(path) {
|
|
@@ -1433,7 +1432,7 @@ function noop$3() {
|
|
|
1433
1432
|
return _React$Component.apply(this, arguments) || this;
|
|
1434
1433
|
}
|
|
1435
1434
|
var _proto = Switch2.prototype;
|
|
1436
|
-
_proto.render = function
|
|
1435
|
+
_proto.render = function render() {
|
|
1437
1436
|
var _this = this;
|
|
1438
1437
|
return /* @__PURE__ */ React__default.createElement(context.Consumer, null, function(context2) {
|
|
1439
1438
|
!context2 ? invariant(false) : void 0;
|
|
@@ -1460,7 +1459,7 @@ var useContext = React__default.useContext;
|
|
|
1460
1459
|
function useHistory() {
|
|
1461
1460
|
return useContext(historyContext);
|
|
1462
1461
|
}
|
|
1463
|
-
const defaultProps$
|
|
1462
|
+
const defaultProps$1m = {
|
|
1464
1463
|
...ComponentDefaults,
|
|
1465
1464
|
title: null,
|
|
1466
1465
|
subTitle: null,
|
|
@@ -1503,7 +1502,7 @@ const Cell = (props) => {
|
|
|
1503
1502
|
iconFontClassName,
|
|
1504
1503
|
...rest
|
|
1505
1504
|
} = {
|
|
1506
|
-
...defaultProps$
|
|
1505
|
+
...defaultProps$1m,
|
|
1507
1506
|
...props
|
|
1508
1507
|
};
|
|
1509
1508
|
const b2 = cn("cell");
|
|
@@ -1560,9 +1559,9 @@ const Cell = (props) => {
|
|
|
1560
1559
|
className: b2("link")
|
|
1561
1560
|
}) : linkSlot));
|
|
1562
1561
|
};
|
|
1563
|
-
Cell.defaultProps = defaultProps$
|
|
1562
|
+
Cell.defaultProps = defaultProps$1m;
|
|
1564
1563
|
Cell.displayName = "NutCell";
|
|
1565
|
-
const defaultProps$
|
|
1564
|
+
const defaultProps$1l = {
|
|
1566
1565
|
title: "",
|
|
1567
1566
|
desc: "",
|
|
1568
1567
|
titleSlot: null,
|
|
@@ -1571,7 +1570,7 @@ const defaultProps$1n = {
|
|
|
1571
1570
|
};
|
|
1572
1571
|
const CellGroup = (props) => {
|
|
1573
1572
|
const { children, classPrefix, title, desc, titleSlot, descSlot } = {
|
|
1574
|
-
...defaultProps$
|
|
1573
|
+
...defaultProps$1l,
|
|
1575
1574
|
...props
|
|
1576
1575
|
};
|
|
1577
1576
|
const b2 = cn("cell-group");
|
|
@@ -1585,7 +1584,7 @@ const CellGroup = (props) => {
|
|
|
1585
1584
|
className: b2("wrap")
|
|
1586
1585
|
}, children));
|
|
1587
1586
|
};
|
|
1588
|
-
CellGroup.defaultProps = defaultProps$
|
|
1587
|
+
CellGroup.defaultProps = defaultProps$1l;
|
|
1589
1588
|
CellGroup.displayName = "NutCellGroup";
|
|
1590
1589
|
var classnames = { exports: {} };
|
|
1591
1590
|
/*!
|
|
@@ -1836,7 +1835,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1836
1835
|
this.cancelNextCallback();
|
|
1837
1836
|
if (nextStatus === ENTERING) {
|
|
1838
1837
|
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
1839
|
-
var node = this.props.nodeRef ? this.props.nodeRef.current :
|
|
1838
|
+
var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
|
|
1840
1839
|
if (node)
|
|
1841
1840
|
forceReflow(node);
|
|
1842
1841
|
}
|
|
@@ -1854,7 +1853,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1854
1853
|
var _this2 = this;
|
|
1855
1854
|
var enter = this.props.enter;
|
|
1856
1855
|
var appearing = this.context ? this.context.isMounting : mounting;
|
|
1857
|
-
var _ref2 = this.props.nodeRef ? [appearing] : [
|
|
1856
|
+
var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1];
|
|
1858
1857
|
var timeouts2 = this.getTimeouts();
|
|
1859
1858
|
var enterTimeout = appearing ? timeouts2.appear : timeouts2.enter;
|
|
1860
1859
|
if (!mounting && !enter || config$1.disabled) {
|
|
@@ -1883,7 +1882,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1883
1882
|
var _this3 = this;
|
|
1884
1883
|
var exit = this.props.exit;
|
|
1885
1884
|
var timeouts2 = this.getTimeouts();
|
|
1886
|
-
var maybeNode = this.props.nodeRef ? void 0 :
|
|
1885
|
+
var maybeNode = this.props.nodeRef ? void 0 : ReactDOM.findDOMNode(this);
|
|
1887
1886
|
if (!exit || config$1.disabled) {
|
|
1888
1887
|
this.safeSetState({
|
|
1889
1888
|
status: EXITED
|
|
@@ -1933,7 +1932,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1933
1932
|
};
|
|
1934
1933
|
_proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
|
|
1935
1934
|
this.setNextCallback(handler);
|
|
1936
|
-
var node = this.props.nodeRef ? this.props.nodeRef.current :
|
|
1935
|
+
var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
|
|
1937
1936
|
var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
|
|
1938
1937
|
if (!node || doesNotHaveTimeoutOrListener) {
|
|
1939
1938
|
setTimeout(this.nextCallback, 0);
|
|
@@ -1947,7 +1946,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1947
1946
|
setTimeout(this.nextCallback, timeout);
|
|
1948
1947
|
}
|
|
1949
1948
|
};
|
|
1950
|
-
_proto.render = function
|
|
1949
|
+
_proto.render = function render() {
|
|
1951
1950
|
var status = this.state.status;
|
|
1952
1951
|
if (status === UNMOUNTED) {
|
|
1953
1952
|
return null;
|
|
@@ -2118,7 +2117,7 @@ var CSSTransition = /* @__PURE__ */ function(_React$Component) {
|
|
|
2118
2117
|
removeClass(node, doneClassName);
|
|
2119
2118
|
}
|
|
2120
2119
|
};
|
|
2121
|
-
_proto.render = function
|
|
2120
|
+
_proto.render = function render() {
|
|
2122
2121
|
var _this$props = this.props;
|
|
2123
2122
|
_this$props.classNames;
|
|
2124
2123
|
var props = _objectWithoutPropertiesLoose$3(_this$props, ["classNames"]);
|
|
@@ -2138,7 +2137,7 @@ CSSTransition.defaultProps = {
|
|
|
2138
2137
|
};
|
|
2139
2138
|
CSSTransition.propTypes = {};
|
|
2140
2139
|
var CSSTransition$1 = CSSTransition;
|
|
2141
|
-
const defaultProps$
|
|
2140
|
+
const defaultProps$1k = {
|
|
2142
2141
|
...ComponentDefaults,
|
|
2143
2142
|
position: "center",
|
|
2144
2143
|
transition: "",
|
|
@@ -2324,7 +2323,7 @@ const Popup = (props) => {
|
|
|
2324
2323
|
}, [position]);
|
|
2325
2324
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderToContainer(teleport, renderNode()));
|
|
2326
2325
|
};
|
|
2327
|
-
Popup.defaultProps = defaultProps$
|
|
2326
|
+
Popup.defaultProps = defaultProps$1k;
|
|
2328
2327
|
Popup.displayName = "NutPopup";
|
|
2329
2328
|
const zhCN = {
|
|
2330
2329
|
save: "\u4FDD\u5B58",
|
|
@@ -2451,7 +2450,7 @@ const zhCN = {
|
|
|
2451
2450
|
completeText: "\u5237\u65B0\u6210\u529F"
|
|
2452
2451
|
}
|
|
2453
2452
|
};
|
|
2454
|
-
const defaultProps$
|
|
2453
|
+
const defaultProps$1j = {
|
|
2455
2454
|
locale: zhCN
|
|
2456
2455
|
};
|
|
2457
2456
|
const defaultConfigRef$1 = {
|
|
@@ -2468,7 +2467,7 @@ const useConfig$1 = () => {
|
|
|
2468
2467
|
};
|
|
2469
2468
|
const ConfigContext$1 = createContext(null);
|
|
2470
2469
|
const ConfigProvider = (props) => {
|
|
2471
|
-
const { children, ...config2 } = { ...defaultProps$
|
|
2470
|
+
const { children, ...config2 } = { ...defaultProps$1j, ...props };
|
|
2472
2471
|
const parentConfig = useConfig$1();
|
|
2473
2472
|
return /* @__PURE__ */ React__default.createElement(ConfigContext$1.Provider, {
|
|
2474
2473
|
value: {
|
|
@@ -2477,25 +2476,25 @@ const ConfigProvider = (props) => {
|
|
|
2477
2476
|
}
|
|
2478
2477
|
}, children);
|
|
2479
2478
|
};
|
|
2480
|
-
ConfigProvider.defaultProps = defaultProps$
|
|
2479
|
+
ConfigProvider.defaultProps = defaultProps$1j;
|
|
2481
2480
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
2482
|
-
const defaultProps$
|
|
2481
|
+
const defaultProps$1i = {};
|
|
2483
2482
|
const Layout = (props) => {
|
|
2484
|
-
({ ...defaultProps$
|
|
2483
|
+
({ ...defaultProps$1i, ...props });
|
|
2485
2484
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2486
2485
|
className: "nut-layout"
|
|
2487
2486
|
}, "Layout");
|
|
2488
2487
|
};
|
|
2489
|
-
Layout.defaultProps = defaultProps$
|
|
2488
|
+
Layout.defaultProps = defaultProps$1i;
|
|
2490
2489
|
Layout.displayName = "NutLayout";
|
|
2491
2490
|
const DataContext$2 = createContext({});
|
|
2492
|
-
const defaultProps$
|
|
2491
|
+
const defaultProps$1h = {
|
|
2493
2492
|
span: "24",
|
|
2494
2493
|
offset: "0",
|
|
2495
2494
|
gutter: "0"
|
|
2496
2495
|
};
|
|
2497
2496
|
const Col = (props) => {
|
|
2498
|
-
const { span, offset, children, onClick } = { ...defaultProps$
|
|
2497
|
+
const { span, offset, children, onClick } = { ...defaultProps$1h, ...props };
|
|
2499
2498
|
const [colName, setColName] = useState("");
|
|
2500
2499
|
const [colStyle, setColStyle] = useState({});
|
|
2501
2500
|
const { gutter } = useContext$1(DataContext$2);
|
|
@@ -2521,9 +2520,9 @@ const Col = (props) => {
|
|
|
2521
2520
|
}
|
|
2522
2521
|
}, children);
|
|
2523
2522
|
};
|
|
2524
|
-
Col.defaultProps = defaultProps$
|
|
2523
|
+
Col.defaultProps = defaultProps$1h;
|
|
2525
2524
|
Col.displayName = "NutCol";
|
|
2526
|
-
const defaultProps$
|
|
2525
|
+
const defaultProps$1g = {
|
|
2527
2526
|
type: "",
|
|
2528
2527
|
justify: "start",
|
|
2529
2528
|
align: "flex-start",
|
|
@@ -2532,7 +2531,7 @@ const defaultProps$1i = {
|
|
|
2532
2531
|
};
|
|
2533
2532
|
const Row = (props) => {
|
|
2534
2533
|
const { children, type, justify, align, wrap, gutter, onClick } = {
|
|
2535
|
-
...defaultProps$
|
|
2534
|
+
...defaultProps$1g,
|
|
2536
2535
|
...props
|
|
2537
2536
|
};
|
|
2538
2537
|
const prefixCls = "nut-row";
|
|
@@ -2566,9 +2565,9 @@ const Row = (props) => {
|
|
|
2566
2565
|
children
|
|
2567
2566
|
));
|
|
2568
2567
|
};
|
|
2569
|
-
Row.defaultProps = defaultProps$
|
|
2568
|
+
Row.defaultProps = defaultProps$1g;
|
|
2570
2569
|
Row.displayName = "NutRow";
|
|
2571
|
-
const defaultProps$
|
|
2570
|
+
const defaultProps$1f = {
|
|
2572
2571
|
contentPosition: "center",
|
|
2573
2572
|
dashed: false,
|
|
2574
2573
|
hairline: true,
|
|
@@ -2585,7 +2584,7 @@ const Divider = (props) => {
|
|
|
2585
2584
|
direction,
|
|
2586
2585
|
...rest
|
|
2587
2586
|
} = {
|
|
2588
|
-
...defaultProps$
|
|
2587
|
+
...defaultProps$1f,
|
|
2589
2588
|
...props
|
|
2590
2589
|
};
|
|
2591
2590
|
const dividerBem = cn("divider");
|
|
@@ -2606,9 +2605,9 @@ const Divider = (props) => {
|
|
|
2606
2605
|
...rest
|
|
2607
2606
|
}, children);
|
|
2608
2607
|
};
|
|
2609
|
-
Divider.defaultProps = defaultProps$
|
|
2608
|
+
Divider.defaultProps = defaultProps$1f;
|
|
2610
2609
|
Divider.displayName = "NutDivider";
|
|
2611
|
-
const defaultProps$
|
|
2610
|
+
const defaultProps$1e = {
|
|
2612
2611
|
columnNum: 4,
|
|
2613
2612
|
border: true,
|
|
2614
2613
|
gutter: 0,
|
|
@@ -2635,7 +2634,7 @@ const Grid = (props) => {
|
|
|
2635
2634
|
iconColor,
|
|
2636
2635
|
className,
|
|
2637
2636
|
...rest
|
|
2638
|
-
} = { ...defaultProps$
|
|
2637
|
+
} = { ...defaultProps$1e, ...props };
|
|
2639
2638
|
const childrenDom = React__default.Children.toArray(children);
|
|
2640
2639
|
const pxCheck2 = (value) => {
|
|
2641
2640
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
@@ -2674,9 +2673,9 @@ const Grid = (props) => {
|
|
|
2674
2673
|
});
|
|
2675
2674
|
}));
|
|
2676
2675
|
};
|
|
2677
|
-
Grid.defaultProps = defaultProps$
|
|
2676
|
+
Grid.defaultProps = defaultProps$1e;
|
|
2678
2677
|
Grid.displayName = "NutGrid";
|
|
2679
|
-
const defaultProps$
|
|
2678
|
+
const defaultProps$1d = {
|
|
2680
2679
|
...ComponentDefaults,
|
|
2681
2680
|
text: "",
|
|
2682
2681
|
icon: "",
|
|
@@ -2714,7 +2713,7 @@ const GridItem = (props) => {
|
|
|
2714
2713
|
iconFontClassName,
|
|
2715
2714
|
...rest
|
|
2716
2715
|
} = {
|
|
2717
|
-
...defaultProps$
|
|
2716
|
+
...defaultProps$1d,
|
|
2718
2717
|
...props
|
|
2719
2718
|
};
|
|
2720
2719
|
const b2 = cn("grid-item");
|
|
@@ -2758,7 +2757,7 @@ const GridItem = (props) => {
|
|
|
2758
2757
|
className: "nut-grid-item__text"
|
|
2759
2758
|
}, text), children && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children)));
|
|
2760
2759
|
};
|
|
2761
|
-
GridItem.defaultProps = defaultProps$
|
|
2760
|
+
GridItem.defaultProps = defaultProps$1d;
|
|
2762
2761
|
GridItem.displayName = "NutGridItem";
|
|
2763
2762
|
const defaultConfigRef = {
|
|
2764
2763
|
current: {
|
|
@@ -2773,17 +2772,17 @@ const useConfig = () => {
|
|
|
2773
2772
|
return (_a = useContext$1(ConfigContext)) != null ? _a : getDefaultConfig();
|
|
2774
2773
|
};
|
|
2775
2774
|
const ConfigContext = createContext(null);
|
|
2776
|
-
const defaultProps$
|
|
2775
|
+
const defaultProps$1c = {};
|
|
2777
2776
|
const Sticky = (props) => {
|
|
2778
2777
|
useConfig();
|
|
2779
|
-
({ ...defaultProps$
|
|
2778
|
+
({ ...defaultProps$1c, ...props });
|
|
2780
2779
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2781
2780
|
className: "nut-sticky"
|
|
2782
2781
|
}, "Sticky");
|
|
2783
2782
|
};
|
|
2784
|
-
Sticky.defaultProps = defaultProps$
|
|
2783
|
+
Sticky.defaultProps = defaultProps$1c;
|
|
2785
2784
|
Sticky.displayName = "NutSticky";
|
|
2786
|
-
const defaultProps$
|
|
2785
|
+
const defaultProps$1b = {
|
|
2787
2786
|
...ComponentDefaults,
|
|
2788
2787
|
title: "",
|
|
2789
2788
|
desc: "",
|
|
@@ -2819,7 +2818,7 @@ const NavBar = (props) => {
|
|
|
2819
2818
|
iconClassPrefix,
|
|
2820
2819
|
iconFontClassName
|
|
2821
2820
|
} = {
|
|
2822
|
-
...defaultProps$
|
|
2821
|
+
...defaultProps$1b,
|
|
2823
2822
|
...props
|
|
2824
2823
|
};
|
|
2825
2824
|
const b2 = cn("navbar");
|
|
@@ -2888,9 +2887,9 @@ const NavBar = (props) => {
|
|
|
2888
2887
|
className: `${b2("")}--placeholder`
|
|
2889
2888
|
}, renderWrapper()) : renderWrapper());
|
|
2890
2889
|
};
|
|
2891
|
-
NavBar.defaultProps = defaultProps$
|
|
2890
|
+
NavBar.defaultProps = defaultProps$1b;
|
|
2892
2891
|
NavBar.displayName = "NutNavBar";
|
|
2893
|
-
const defaultProps$
|
|
2892
|
+
const defaultProps$1a = {
|
|
2894
2893
|
...ComponentDefaults,
|
|
2895
2894
|
fixednavClass: "nut-fixednav",
|
|
2896
2895
|
activeText: "",
|
|
@@ -2920,7 +2919,7 @@ const FixedNav = (props) => {
|
|
|
2920
2919
|
iconFontClassName,
|
|
2921
2920
|
...rest
|
|
2922
2921
|
} = {
|
|
2923
|
-
...defaultProps$
|
|
2922
|
+
...defaultProps$1a,
|
|
2924
2923
|
...props
|
|
2925
2924
|
};
|
|
2926
2925
|
const b2 = cn("fixednav");
|
|
@@ -2975,9 +2974,9 @@ const FixedNav = (props) => {
|
|
|
2975
2974
|
className: "text"
|
|
2976
2975
|
}, visible ? activeText || locale.fixednav.activeText : unActiveText || locale.fixednav.unActiveText))));
|
|
2977
2976
|
};
|
|
2978
|
-
FixedNav.defaultProps = defaultProps$
|
|
2977
|
+
FixedNav.defaultProps = defaultProps$1a;
|
|
2979
2978
|
FixedNav.displayName = "NutFixedNav";
|
|
2980
|
-
const defaultProps$
|
|
2979
|
+
const defaultProps$19 = {
|
|
2981
2980
|
visible: 0,
|
|
2982
2981
|
bottom: false,
|
|
2983
2982
|
size: 20,
|
|
@@ -3002,7 +3001,7 @@ const Tabbar = (props) => {
|
|
|
3002
3001
|
style,
|
|
3003
3002
|
tabSwitch
|
|
3004
3003
|
} = {
|
|
3005
|
-
...defaultProps$
|
|
3004
|
+
...defaultProps$19,
|
|
3006
3005
|
...props
|
|
3007
3006
|
};
|
|
3008
3007
|
const b2 = cn("tabbar");
|
|
@@ -3037,9 +3036,9 @@ const Tabbar = (props) => {
|
|
|
3037
3036
|
return React__default.cloneElement(child, childProps);
|
|
3038
3037
|
}));
|
|
3039
3038
|
};
|
|
3040
|
-
Tabbar.defaultProps = defaultProps$
|
|
3039
|
+
Tabbar.defaultProps = defaultProps$19;
|
|
3041
3040
|
Tabbar.displayName = "NutTabbar";
|
|
3042
|
-
const defaultProps$
|
|
3041
|
+
const defaultProps$18 = {
|
|
3043
3042
|
...ComponentDefaults,
|
|
3044
3043
|
dot: false,
|
|
3045
3044
|
size: "",
|
|
@@ -3074,7 +3073,7 @@ const TabbarItem = (props) => {
|
|
|
3074
3073
|
iconClassPrefix,
|
|
3075
3074
|
iconFontClassName
|
|
3076
3075
|
} = {
|
|
3077
|
-
...defaultProps$
|
|
3076
|
+
...defaultProps$18,
|
|
3078
3077
|
...props
|
|
3079
3078
|
};
|
|
3080
3079
|
const b2 = cn("tabbar-item");
|
|
@@ -4657,23 +4656,21 @@ function resolveWith(config2 = {}, resolvers) {
|
|
|
4657
4656
|
}
|
|
4658
4657
|
return result;
|
|
4659
4658
|
}
|
|
4660
|
-
function parse(
|
|
4661
|
-
const _ref =
|
|
4659
|
+
function parse(newConfig, gestureKey, _config = {}) {
|
|
4660
|
+
const _ref = newConfig, {
|
|
4662
4661
|
target,
|
|
4663
4662
|
eventOptions,
|
|
4664
4663
|
window: window2,
|
|
4665
4664
|
enabled,
|
|
4666
4665
|
transform
|
|
4667
4666
|
} = _ref, rest = _objectWithoutProperties(_ref, _excluded$4);
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
}, sharedConfigResolver)
|
|
4676
|
-
};
|
|
4667
|
+
_config.shared = resolveWith({
|
|
4668
|
+
target,
|
|
4669
|
+
eventOptions,
|
|
4670
|
+
window: window2,
|
|
4671
|
+
enabled,
|
|
4672
|
+
transform
|
|
4673
|
+
}, sharedConfigResolver);
|
|
4677
4674
|
if (gestureKey) {
|
|
4678
4675
|
const resolver = ConfigResolverMap.get(gestureKey);
|
|
4679
4676
|
_config[gestureKey] = resolveWith(_objectSpread2({
|
|
@@ -4697,11 +4694,11 @@ class EventStore {
|
|
|
4697
4694
|
this._ctrl = ctrl;
|
|
4698
4695
|
this._gestureKey = gestureKey;
|
|
4699
4696
|
}
|
|
4700
|
-
add(element, device, action, handler,
|
|
4697
|
+
add(element, device, action, handler, options) {
|
|
4701
4698
|
const listeners = this._listeners;
|
|
4702
4699
|
const type = toDomEventType(device, action);
|
|
4703
4700
|
const _options = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {};
|
|
4704
|
-
const eventOptions = _objectSpread2(_objectSpread2({}, _options),
|
|
4701
|
+
const eventOptions = _objectSpread2(_objectSpread2({}, _options), options);
|
|
4705
4702
|
element.addEventListener(type, handler, eventOptions);
|
|
4706
4703
|
const remove = () => {
|
|
4707
4704
|
element.removeEventListener(type, handler, eventOptions);
|
|
@@ -4770,7 +4767,7 @@ class Controller$1 {
|
|
|
4770
4767
|
this.nativeHandlers = nativeHandlers;
|
|
4771
4768
|
}
|
|
4772
4769
|
applyConfig(config2, gestureKey) {
|
|
4773
|
-
this.config = parse(config2, gestureKey);
|
|
4770
|
+
this.config = parse(config2, gestureKey, this.config);
|
|
4774
4771
|
}
|
|
4775
4772
|
clean() {
|
|
4776
4773
|
this._targetEventStore.clean();
|
|
@@ -4847,10 +4844,10 @@ function resolveGestures(ctrl, internalHandlers) {
|
|
|
4847
4844
|
if (internalHandlers.hover)
|
|
4848
4845
|
setupGesture(ctrl, "hover");
|
|
4849
4846
|
}
|
|
4850
|
-
const bindToProps = (props, eventOptions, withPassiveOption) => (device, action, handler,
|
|
4847
|
+
const bindToProps = (props, eventOptions, withPassiveOption) => (device, action, handler, options = {}, isNative = false) => {
|
|
4851
4848
|
var _options$capture, _options$passive;
|
|
4852
|
-
const capture = (_options$capture =
|
|
4853
|
-
const passive = (_options$passive =
|
|
4849
|
+
const capture = (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : eventOptions.capture;
|
|
4850
|
+
const passive = (_options$passive = options.passive) !== null && _options$passive !== void 0 ? _options$passive : eventOptions.passive;
|
|
4854
4851
|
let handlerProp = isNative ? device : toHandlerProp(device, action, capture);
|
|
4855
4852
|
if (withPassiveOption && passive)
|
|
4856
4853
|
handlerProp += "Passive";
|
|
@@ -8115,8 +8112,8 @@ const host = createHost(primitives, {
|
|
|
8115
8112
|
}
|
|
8116
8113
|
});
|
|
8117
8114
|
const animated = host.animated;
|
|
8118
|
-
const elevatorContext
|
|
8119
|
-
const defaultProps$
|
|
8115
|
+
const elevatorContext = createContext({});
|
|
8116
|
+
const defaultProps$17 = {
|
|
8120
8117
|
height: "200px",
|
|
8121
8118
|
acceptKey: "title",
|
|
8122
8119
|
indexList: [],
|
|
@@ -8125,7 +8122,7 @@ const defaultProps$19 = {
|
|
|
8125
8122
|
titleHeight: 35,
|
|
8126
8123
|
className: ""
|
|
8127
8124
|
};
|
|
8128
|
-
const Elevator
|
|
8125
|
+
const Elevator = (props) => {
|
|
8129
8126
|
const {
|
|
8130
8127
|
height,
|
|
8131
8128
|
acceptKey,
|
|
@@ -8139,7 +8136,7 @@ const Elevator$1 = (props) => {
|
|
|
8139
8136
|
children,
|
|
8140
8137
|
...rest
|
|
8141
8138
|
} = {
|
|
8142
|
-
...defaultProps$
|
|
8139
|
+
...defaultProps$17,
|
|
8143
8140
|
...props
|
|
8144
8141
|
};
|
|
8145
8142
|
const b2 = cn("elevator");
|
|
@@ -8304,7 +8301,7 @@ const Elevator$1 = (props) => {
|
|
|
8304
8301
|
}),
|
|
8305
8302
|
key: subitem.id,
|
|
8306
8303
|
onClick: () => handleClickItem(item[acceptKey], subitem)
|
|
8307
|
-
}, children ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(elevatorContext
|
|
8304
|
+
}, children ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(elevatorContext.Provider, {
|
|
8308
8305
|
value: subitem
|
|
8309
8306
|
}, children)) : subitem.name);
|
|
8310
8307
|
})));
|
|
@@ -8327,9 +8324,9 @@ const Elevator$1 = (props) => {
|
|
|
8327
8324
|
}, item[acceptKey]);
|
|
8328
8325
|
}))));
|
|
8329
8326
|
};
|
|
8330
|
-
Elevator
|
|
8331
|
-
Elevator
|
|
8332
|
-
const defaultProps$
|
|
8327
|
+
Elevator.defaultProps = defaultProps$17;
|
|
8328
|
+
Elevator.displayName = "NutElevator";
|
|
8329
|
+
const defaultProps$16 = {
|
|
8333
8330
|
defaultValue: 1,
|
|
8334
8331
|
mode: "multi",
|
|
8335
8332
|
prevText: "",
|
|
@@ -8346,7 +8343,7 @@ const defaultProps$18 = {
|
|
|
8346
8343
|
};
|
|
8347
8344
|
const Pagination = (props) => {
|
|
8348
8345
|
const { locale } = useConfig$1();
|
|
8349
|
-
({ ...defaultProps$
|
|
8346
|
+
({ ...defaultProps$16, ...props });
|
|
8350
8347
|
const {
|
|
8351
8348
|
modelValue,
|
|
8352
8349
|
mode,
|
|
@@ -8463,7 +8460,7 @@ const Pagination = (props) => {
|
|
|
8463
8460
|
onClick: (e2) => selectPage(Number(currentPage) + 1, true)
|
|
8464
8461
|
}, nextText || locale.pagination.next));
|
|
8465
8462
|
};
|
|
8466
|
-
Pagination.defaultProps = defaultProps$
|
|
8463
|
+
Pagination.defaultProps = defaultProps$16;
|
|
8467
8464
|
Pagination.displayName = "NutPagination";
|
|
8468
8465
|
class Title {
|
|
8469
8466
|
constructor() {
|
|
@@ -8473,7 +8470,7 @@ class Title {
|
|
|
8473
8470
|
this.index = 0;
|
|
8474
8471
|
}
|
|
8475
8472
|
}
|
|
8476
|
-
const defaultProps$
|
|
8473
|
+
const defaultProps$15 = {
|
|
8477
8474
|
...ComponentDefaults,
|
|
8478
8475
|
value: 0,
|
|
8479
8476
|
color: "",
|
|
@@ -8512,7 +8509,7 @@ const Tabs = (props) => {
|
|
|
8512
8509
|
iconFontClassName,
|
|
8513
8510
|
...rest
|
|
8514
8511
|
} = {
|
|
8515
|
-
...defaultProps$
|
|
8512
|
+
...defaultProps$15,
|
|
8516
8513
|
...props
|
|
8517
8514
|
};
|
|
8518
8515
|
const [currentItem, setCurrentItem] = useState({ index: 0 });
|
|
@@ -8628,9 +8625,9 @@ const Tabs = (props) => {
|
|
|
8628
8625
|
return React__default.cloneElement(child, childProps);
|
|
8629
8626
|
})));
|
|
8630
8627
|
};
|
|
8631
|
-
Tabs.defaultProps = defaultProps$
|
|
8628
|
+
Tabs.defaultProps = defaultProps$15;
|
|
8632
8629
|
Tabs.displayName = "NutTabs";
|
|
8633
|
-
const defaultProps$
|
|
8630
|
+
const defaultProps$14 = {
|
|
8634
8631
|
title: "",
|
|
8635
8632
|
paneKey: "",
|
|
8636
8633
|
activeKey: "",
|
|
@@ -8638,7 +8635,7 @@ const defaultProps$16 = {
|
|
|
8638
8635
|
};
|
|
8639
8636
|
const TabPane = (props) => {
|
|
8640
8637
|
const { children, paneKey, activeKey, autoHeightClassName } = {
|
|
8641
|
-
...defaultProps$
|
|
8638
|
+
...defaultProps$14,
|
|
8642
8639
|
...props
|
|
8643
8640
|
};
|
|
8644
8641
|
const b2 = cn("tabpane");
|
|
@@ -8653,7 +8650,7 @@ const TabPane = (props) => {
|
|
|
8653
8650
|
className: classes
|
|
8654
8651
|
}, children);
|
|
8655
8652
|
};
|
|
8656
|
-
const defaultProps$
|
|
8653
|
+
const defaultProps$13 = {
|
|
8657
8654
|
size: 3,
|
|
8658
8655
|
current: 1,
|
|
8659
8656
|
block: false,
|
|
@@ -8673,7 +8670,7 @@ const Indicator = (props) => {
|
|
|
8673
8670
|
vertical,
|
|
8674
8671
|
...rest
|
|
8675
8672
|
} = {
|
|
8676
|
-
...defaultProps$
|
|
8673
|
+
...defaultProps$13,
|
|
8677
8674
|
...props
|
|
8678
8675
|
};
|
|
8679
8676
|
const b2 = cn("indicator");
|
|
@@ -8707,7 +8704,7 @@ const Indicator = (props) => {
|
|
|
8707
8704
|
...rest
|
|
8708
8705
|
}, renderEles());
|
|
8709
8706
|
};
|
|
8710
|
-
Indicator.defaultProps = defaultProps$
|
|
8707
|
+
Indicator.defaultProps = defaultProps$13;
|
|
8711
8708
|
Indicator.displayName = "NutIndicator";
|
|
8712
8709
|
const handleClick = (e2) => {
|
|
8713
8710
|
e2.stopPropagation();
|
|
@@ -8723,7 +8720,7 @@ const handleClick = (e2) => {
|
|
|
8723
8720
|
}
|
|
8724
8721
|
};
|
|
8725
8722
|
const OffsetContext = createContext(20);
|
|
8726
|
-
const defaultProps$
|
|
8723
|
+
const defaultProps$12 = {
|
|
8727
8724
|
showhead: false,
|
|
8728
8725
|
position: "left",
|
|
8729
8726
|
width: "80%"
|
|
@@ -8741,7 +8738,7 @@ const SideNavBar = (props) => {
|
|
|
8741
8738
|
handleClose,
|
|
8742
8739
|
...rest
|
|
8743
8740
|
} = {
|
|
8744
|
-
...defaultProps$
|
|
8741
|
+
...defaultProps$12,
|
|
8745
8742
|
...props
|
|
8746
8743
|
};
|
|
8747
8744
|
const offset = props.offset ? Number(props.offset) : 20;
|
|
@@ -8769,14 +8766,14 @@ const SideNavBar = (props) => {
|
|
|
8769
8766
|
className: "nut-sidenavbar__content"
|
|
8770
8767
|
}, children))))));
|
|
8771
8768
|
};
|
|
8772
|
-
SideNavBar.defaultProps = defaultProps$
|
|
8769
|
+
SideNavBar.defaultProps = defaultProps$12;
|
|
8773
8770
|
SideNavBar.displayName = "NutSideNavBar";
|
|
8774
|
-
const defaultProps$
|
|
8771
|
+
const defaultProps$11 = {
|
|
8775
8772
|
open: true
|
|
8776
8773
|
};
|
|
8777
8774
|
const SubSideNavBar = (props) => {
|
|
8778
8775
|
const { title, ikey, children, titleClick, open, ...rest } = {
|
|
8779
|
-
...defaultProps$
|
|
8776
|
+
...defaultProps$11,
|
|
8780
8777
|
...props
|
|
8781
8778
|
};
|
|
8782
8779
|
const offset = useContext$1(OffsetContext);
|
|
@@ -8847,7 +8844,7 @@ const SideNavBarItem = (props) => {
|
|
|
8847
8844
|
...rest
|
|
8848
8845
|
}, title);
|
|
8849
8846
|
};
|
|
8850
|
-
const defaultProps$
|
|
8847
|
+
const defaultProps$10 = {
|
|
8851
8848
|
...ComponentDefaults,
|
|
8852
8849
|
className: "",
|
|
8853
8850
|
style: {},
|
|
@@ -8870,7 +8867,7 @@ const Menu = (props) => {
|
|
|
8870
8867
|
iconFontClassName,
|
|
8871
8868
|
...rest
|
|
8872
8869
|
} = {
|
|
8873
|
-
...defaultProps$
|
|
8870
|
+
...defaultProps$10,
|
|
8874
8871
|
...props
|
|
8875
8872
|
};
|
|
8876
8873
|
const parentRef = useRef(null);
|
|
@@ -8926,8 +8923,8 @@ const Menu = (props) => {
|
|
|
8926
8923
|
}, React__default.Children.toArray(children).map((child, index2) => {
|
|
8927
8924
|
if (!child)
|
|
8928
8925
|
return null;
|
|
8929
|
-
const { disabled, title, value, direction, options
|
|
8930
|
-
const currentTitle =
|
|
8926
|
+
const { disabled, title, value, direction, options } = child.props;
|
|
8927
|
+
const currentTitle = options == null ? void 0 : options.filter(
|
|
8931
8928
|
(option) => option.value === value
|
|
8932
8929
|
);
|
|
8933
8930
|
function finallyTitle() {
|
|
@@ -8965,9 +8962,9 @@ const Menu = (props) => {
|
|
|
8965
8962
|
})));
|
|
8966
8963
|
})), cloneChildren());
|
|
8967
8964
|
};
|
|
8968
|
-
Menu.defaultProps = defaultProps$
|
|
8965
|
+
Menu.defaultProps = defaultProps$10;
|
|
8969
8966
|
Menu.displayName = "NutMenu";
|
|
8970
|
-
const defaultProps
|
|
8967
|
+
const defaultProps$$ = {
|
|
8971
8968
|
...ComponentDefaults,
|
|
8972
8969
|
className: "",
|
|
8973
8970
|
style: {},
|
|
@@ -8982,11 +8979,11 @@ const defaultProps$11 = {
|
|
|
8982
8979
|
};
|
|
8983
8980
|
const MenuItem = (props) => {
|
|
8984
8981
|
useConfig$1();
|
|
8985
|
-
const mergedProps = { ...defaultProps
|
|
8982
|
+
const mergedProps = { ...defaultProps$$, ...props };
|
|
8986
8983
|
const {
|
|
8987
8984
|
className,
|
|
8988
8985
|
style,
|
|
8989
|
-
options
|
|
8986
|
+
options,
|
|
8990
8987
|
value,
|
|
8991
8988
|
columns,
|
|
8992
8989
|
title,
|
|
@@ -8999,7 +8996,7 @@ const MenuItem = (props) => {
|
|
|
8999
8996
|
iconClassPrefix,
|
|
9000
8997
|
iconFontClassName
|
|
9001
8998
|
} = {
|
|
9002
|
-
...defaultProps
|
|
8999
|
+
...defaultProps$$,
|
|
9003
9000
|
...props
|
|
9004
9001
|
};
|
|
9005
9002
|
const { activeColor, showPopup, parent, orderKey } = mergedProps;
|
|
@@ -9092,7 +9089,7 @@ const MenuItem = (props) => {
|
|
|
9092
9089
|
classNames: "menu-item"
|
|
9093
9090
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
9094
9091
|
className: "nut-menu-item__content"
|
|
9095
|
-
},
|
|
9092
|
+
}, options == null ? void 0 : options.map((item, index2) => {
|
|
9096
9093
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
9097
9094
|
className: `nut-menu-item__option ${classNames({
|
|
9098
9095
|
active: item.value === _value
|
|
@@ -9118,7 +9115,7 @@ const MenuItem = (props) => {
|
|
|
9118
9115
|
}, item.text));
|
|
9119
9116
|
}), children))));
|
|
9120
9117
|
};
|
|
9121
|
-
MenuItem.defaultProps = defaultProps
|
|
9118
|
+
MenuItem.defaultProps = defaultProps$$;
|
|
9122
9119
|
MenuItem.displayName = "NutMenuItem";
|
|
9123
9120
|
const MIN_DISTANCE = 10;
|
|
9124
9121
|
function getDirection(x2, y2) {
|
|
@@ -9218,7 +9215,7 @@ const getRectByTaro = async (element) => {
|
|
|
9218
9215
|
const res = await element.getBoundingClientRect();
|
|
9219
9216
|
return res;
|
|
9220
9217
|
};
|
|
9221
|
-
const defaultProps$
|
|
9218
|
+
const defaultProps$_ = {
|
|
9222
9219
|
name: "",
|
|
9223
9220
|
size: "",
|
|
9224
9221
|
classPrefix: "nut-icon",
|
|
@@ -9246,7 +9243,7 @@ function Icon(props) {
|
|
|
9246
9243
|
onClick,
|
|
9247
9244
|
...rest
|
|
9248
9245
|
} = {
|
|
9249
|
-
...defaultProps$
|
|
9246
|
+
...defaultProps$_,
|
|
9250
9247
|
...props
|
|
9251
9248
|
};
|
|
9252
9249
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
@@ -9280,9 +9277,9 @@ function Icon(props) {
|
|
|
9280
9277
|
children
|
|
9281
9278
|
);
|
|
9282
9279
|
}
|
|
9283
|
-
Icon.defaultProps = defaultProps$
|
|
9280
|
+
Icon.defaultProps = defaultProps$_;
|
|
9284
9281
|
Icon.displayName = "NutIcon";
|
|
9285
|
-
const defaultProps
|
|
9282
|
+
const defaultProps$Z = {
|
|
9286
9283
|
id: "",
|
|
9287
9284
|
style: {},
|
|
9288
9285
|
icon: null,
|
|
@@ -9327,7 +9324,7 @@ const Toast = (props) => {
|
|
|
9327
9324
|
visible,
|
|
9328
9325
|
onClose,
|
|
9329
9326
|
...rest
|
|
9330
|
-
} = { ...defaultProps
|
|
9327
|
+
} = { ...defaultProps$Z, ...props };
|
|
9331
9328
|
let timer;
|
|
9332
9329
|
const [openState, SetOpenState] = useState(false);
|
|
9333
9330
|
useEffect(() => {
|
|
@@ -9416,9 +9413,9 @@ const Toast = (props) => {
|
|
|
9416
9413
|
className: toastBem("text")
|
|
9417
9414
|
}, msg))) : null);
|
|
9418
9415
|
};
|
|
9419
|
-
Toast.defaultProps = defaultProps
|
|
9420
|
-
Toast.displayName = "
|
|
9421
|
-
const defaultProps$
|
|
9416
|
+
Toast.defaultProps = defaultProps$Z;
|
|
9417
|
+
Toast.displayName = "NutToast";
|
|
9418
|
+
const defaultProps$Y = {
|
|
9422
9419
|
range: false,
|
|
9423
9420
|
hiddenRange: false,
|
|
9424
9421
|
hiddenTag: false,
|
|
@@ -9449,8 +9446,8 @@ const Range = (props) => {
|
|
|
9449
9446
|
change,
|
|
9450
9447
|
dragStart,
|
|
9451
9448
|
dragEnd
|
|
9452
|
-
} = { ...defaultProps$
|
|
9453
|
-
let { min, max, step } = { ...defaultProps$
|
|
9449
|
+
} = { ...defaultProps$Y, ...props };
|
|
9450
|
+
let { min, max, step } = { ...defaultProps$Y, ...props };
|
|
9454
9451
|
min = Number(min);
|
|
9455
9452
|
max = Number(max);
|
|
9456
9453
|
step = Number(step);
|
|
@@ -9798,7 +9795,7 @@ const Range = (props) => {
|
|
|
9798
9795
|
}
|
|
9799
9796
|
}));
|
|
9800
9797
|
};
|
|
9801
|
-
Range.defaultProps = defaultProps$
|
|
9798
|
+
Range.defaultProps = defaultProps$Y;
|
|
9802
9799
|
Range.displayName = "NutRange";
|
|
9803
9800
|
const Utils = {
|
|
9804
9801
|
isLeapYear(y2) {
|
|
@@ -9892,7 +9889,7 @@ function requestAniFrame() {
|
|
|
9892
9889
|
};
|
|
9893
9890
|
}
|
|
9894
9891
|
var requestAniFrame$1 = requestAniFrame();
|
|
9895
|
-
const defaultProps$
|
|
9892
|
+
const defaultProps$X = {
|
|
9896
9893
|
type: "one",
|
|
9897
9894
|
isAutoBackFill: false,
|
|
9898
9895
|
poppable: true,
|
|
@@ -9921,7 +9918,7 @@ const CalendarItem = (props) => {
|
|
|
9921
9918
|
onChoose,
|
|
9922
9919
|
onUpdate,
|
|
9923
9920
|
onClose
|
|
9924
|
-
} = { ...defaultProps$
|
|
9921
|
+
} = { ...defaultProps$X, ...props };
|
|
9925
9922
|
const weeks = locale.calendaritem.weekdays;
|
|
9926
9923
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
9927
9924
|
const [unLoadPrev, setUnLoadPrev] = useState(false);
|
|
@@ -10006,7 +10003,7 @@ const CalendarItem = (props) => {
|
|
|
10006
10003
|
const date = `${month.curData[0]}-${month.curData[1]}-${day}`;
|
|
10007
10004
|
return Utils.isEqual(date, Utils.date2Str(new Date()));
|
|
10008
10005
|
};
|
|
10009
|
-
const
|
|
10006
|
+
const confirm = () => {
|
|
10010
10007
|
if (state.isRange && state.chooseData.length === 2 || !state.isRange) {
|
|
10011
10008
|
onChoose && onChoose(state.chooseData);
|
|
10012
10009
|
if (poppable) {
|
|
@@ -10041,7 +10038,7 @@ const CalendarItem = (props) => {
|
|
|
10041
10038
|
}
|
|
10042
10039
|
}
|
|
10043
10040
|
if (isAutoBackFill && !isFirst) {
|
|
10044
|
-
|
|
10041
|
+
confirm();
|
|
10045
10042
|
}
|
|
10046
10043
|
setMonthsData(state.monthsData.slice());
|
|
10047
10044
|
}
|
|
@@ -10342,12 +10339,12 @@ const CalendarItem = (props) => {
|
|
|
10342
10339
|
className: "nut-calendar-footer"
|
|
10343
10340
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
10344
10341
|
className: "calendar-confirm-btn",
|
|
10345
|
-
onClick:
|
|
10342
|
+
onClick: confirm
|
|
10346
10343
|
}, locale.confirm)) : ""));
|
|
10347
10344
|
};
|
|
10348
|
-
CalendarItem.defaultProps = defaultProps$
|
|
10345
|
+
CalendarItem.defaultProps = defaultProps$X;
|
|
10349
10346
|
CalendarItem.displayName = "NutCalendarItem";
|
|
10350
|
-
const defaultProps$
|
|
10347
|
+
const defaultProps$W = {
|
|
10351
10348
|
type: "one",
|
|
10352
10349
|
isAutoBackFill: false,
|
|
10353
10350
|
poppable: true,
|
|
@@ -10375,7 +10372,7 @@ const Calendar = (props) => {
|
|
|
10375
10372
|
endDate,
|
|
10376
10373
|
onClose,
|
|
10377
10374
|
onChoose
|
|
10378
|
-
} = { ...defaultProps$
|
|
10375
|
+
} = { ...defaultProps$W, ...props };
|
|
10379
10376
|
const close = () => {
|
|
10380
10377
|
onClose && onClose();
|
|
10381
10378
|
};
|
|
@@ -10418,9 +10415,9 @@ const Calendar = (props) => {
|
|
|
10418
10415
|
onChoose: choose
|
|
10419
10416
|
}));
|
|
10420
10417
|
};
|
|
10421
|
-
Calendar.defaultProps = defaultProps$
|
|
10418
|
+
Calendar.defaultProps = defaultProps$W;
|
|
10422
10419
|
Calendar.displayName = "NutCalendar";
|
|
10423
|
-
const defaultProps$
|
|
10420
|
+
const defaultProps$V = {
|
|
10424
10421
|
disabled: false,
|
|
10425
10422
|
checkedValue: [],
|
|
10426
10423
|
max: void 0,
|
|
@@ -10429,7 +10426,7 @@ const defaultProps$X = {
|
|
|
10429
10426
|
};
|
|
10430
10427
|
const CheckboxGroup = React__default.forwardRef(
|
|
10431
10428
|
(props, ref) => {
|
|
10432
|
-
const { children } = { ...defaultProps$
|
|
10429
|
+
const { children } = { ...defaultProps$V, ...props };
|
|
10433
10430
|
const b2 = cn("checkboxgroup");
|
|
10434
10431
|
const { className, disabled, onChange, checkedValue, max, ...rest } = props;
|
|
10435
10432
|
const [innerDisabled, setInnerDisabled] = useState(disabled);
|
|
@@ -10508,9 +10505,9 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
10508
10505
|
}, cloneChildren());
|
|
10509
10506
|
}
|
|
10510
10507
|
);
|
|
10511
|
-
CheckboxGroup.defaultProps = defaultProps$
|
|
10508
|
+
CheckboxGroup.defaultProps = defaultProps$V;
|
|
10512
10509
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
10513
|
-
const defaultProps$
|
|
10510
|
+
const defaultProps$U = {
|
|
10514
10511
|
...ComponentDefaults,
|
|
10515
10512
|
checked: false,
|
|
10516
10513
|
disabled: false,
|
|
@@ -10526,7 +10523,7 @@ const defaultProps$W = {
|
|
|
10526
10523
|
};
|
|
10527
10524
|
const Checkbox = (props) => {
|
|
10528
10525
|
const { children } = {
|
|
10529
|
-
...defaultProps$
|
|
10526
|
+
...defaultProps$U,
|
|
10530
10527
|
...props
|
|
10531
10528
|
};
|
|
10532
10529
|
const b2 = cn("checkbox");
|
|
@@ -10608,7 +10605,7 @@ const Checkbox = (props) => {
|
|
|
10608
10605
|
onClick: handleClick2
|
|
10609
10606
|
}, renderIcon(), renderLabel());
|
|
10610
10607
|
};
|
|
10611
|
-
Checkbox.defaultProps = defaultProps$
|
|
10608
|
+
Checkbox.defaultProps = defaultProps$U;
|
|
10612
10609
|
Checkbox.displayName = "NutCheckBox";
|
|
10613
10610
|
Checkbox.Group = CheckboxGroup;
|
|
10614
10611
|
const InternalPickerSlot = (props, ref) => {
|
|
@@ -10889,7 +10886,7 @@ const InternalPicker = (props, ref) => {
|
|
|
10889
10886
|
onClose && onClose(chooseValueData, selectedOptions());
|
|
10890
10887
|
onCloseUpdate && onCloseUpdate(chooseValueData, selectedOptions(), pickerRef);
|
|
10891
10888
|
};
|
|
10892
|
-
const
|
|
10889
|
+
const confirm = () => {
|
|
10893
10890
|
let movings = false;
|
|
10894
10891
|
refs.forEach((_ref) => {
|
|
10895
10892
|
if (_ref.moving)
|
|
@@ -10988,16 +10985,16 @@ const InternalPicker = (props, ref) => {
|
|
|
10988
10985
|
};
|
|
10989
10986
|
let columnIndex2 = 0;
|
|
10990
10987
|
while (cursor && cursor.children) {
|
|
10991
|
-
const
|
|
10988
|
+
const options = cursor.children;
|
|
10992
10989
|
const value = defaultValues[columnIndex2];
|
|
10993
|
-
let index2 =
|
|
10990
|
+
let index2 = options.findIndex(
|
|
10994
10991
|
(columnItem) => columnItem.value === value
|
|
10995
10992
|
);
|
|
10996
10993
|
if (index2 === -1)
|
|
10997
10994
|
index2 = 0;
|
|
10998
10995
|
cursor = cursor.children[index2];
|
|
10999
10996
|
columnIndex2++;
|
|
11000
|
-
formatted.push(
|
|
10997
|
+
formatted.push(options);
|
|
11001
10998
|
}
|
|
11002
10999
|
return formatted;
|
|
11003
11000
|
};
|
|
@@ -11023,7 +11020,7 @@ const InternalPicker = (props, ref) => {
|
|
|
11023
11020
|
className: b2("title")
|
|
11024
11021
|
}, title || ""), /* @__PURE__ */ React__default.createElement("span", {
|
|
11025
11022
|
className: b2("confirm-btn"),
|
|
11026
|
-
onClick:
|
|
11023
|
+
onClick: confirm
|
|
11027
11024
|
}, locale.confirm));
|
|
11028
11025
|
};
|
|
11029
11026
|
return /* @__PURE__ */ React__default.createElement(Popup, {
|
|
@@ -11055,7 +11052,7 @@ const InternalPicker = (props, ref) => {
|
|
|
11055
11052
|
};
|
|
11056
11053
|
const Picker = React__default.forwardRef(InternalPicker);
|
|
11057
11054
|
const currentYear = new Date().getFullYear();
|
|
11058
|
-
const defaultProps$
|
|
11055
|
+
const defaultProps$T = {
|
|
11059
11056
|
modelValue: null,
|
|
11060
11057
|
visible: false,
|
|
11061
11058
|
title: "",
|
|
@@ -11085,7 +11082,7 @@ const DatePicker = (props) => {
|
|
|
11085
11082
|
style,
|
|
11086
11083
|
...rest
|
|
11087
11084
|
} = {
|
|
11088
|
-
...defaultProps$
|
|
11085
|
+
...defaultProps$T,
|
|
11089
11086
|
...props
|
|
11090
11087
|
};
|
|
11091
11088
|
const [show, setShow] = useState(false);
|
|
@@ -11344,15 +11341,15 @@ const DatePicker = (props) => {
|
|
|
11344
11341
|
listData,
|
|
11345
11342
|
onClose: onCloseDatePicker,
|
|
11346
11343
|
defaultValueData: defaultValue,
|
|
11347
|
-
onConfirm: (values,
|
|
11344
|
+
onConfirm: (values, options) => onConfirmDatePicker && onConfirmDatePicker(values, options),
|
|
11348
11345
|
onChange: (index2, value, list) => updateChooseValueCustmer(index2, value, list),
|
|
11349
11346
|
threeDimensional,
|
|
11350
11347
|
ref: pickerRef
|
|
11351
11348
|
}));
|
|
11352
11349
|
};
|
|
11353
|
-
DatePicker.defaultProps = defaultProps$
|
|
11350
|
+
DatePicker.defaultProps = defaultProps$T;
|
|
11354
11351
|
DatePicker.displayName = "NutDatePicker";
|
|
11355
|
-
const defaultProps$
|
|
11352
|
+
const defaultProps$S = {
|
|
11356
11353
|
...ComponentDefaults,
|
|
11357
11354
|
disabled: false,
|
|
11358
11355
|
buttonSize: "",
|
|
@@ -11393,7 +11390,7 @@ const InputNumber = (props) => {
|
|
|
11393
11390
|
iconFontClassName,
|
|
11394
11391
|
...restProps
|
|
11395
11392
|
} = {
|
|
11396
|
-
...defaultProps$
|
|
11393
|
+
...defaultProps$S,
|
|
11397
11394
|
...props
|
|
11398
11395
|
};
|
|
11399
11396
|
const [inputValue, setInputValue] = useState(modelValue);
|
|
@@ -11521,7 +11518,7 @@ const InputNumber = (props) => {
|
|
|
11521
11518
|
onClick: addNumber
|
|
11522
11519
|
}));
|
|
11523
11520
|
};
|
|
11524
|
-
InputNumber.defaultProps = defaultProps$
|
|
11521
|
+
InputNumber.defaultProps = defaultProps$S;
|
|
11525
11522
|
InputNumber.displayName = "NutInputNumber";
|
|
11526
11523
|
function trimExtraChar(value, char, regExp) {
|
|
11527
11524
|
const index2 = value.indexOf(char);
|
|
@@ -11547,7 +11544,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
|
11547
11544
|
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
11548
11545
|
return value.replace(regExp, "");
|
|
11549
11546
|
}
|
|
11550
|
-
const defaultProps$
|
|
11547
|
+
const defaultProps$R = {
|
|
11551
11548
|
...ComponentDefaults,
|
|
11552
11549
|
type: "text",
|
|
11553
11550
|
defaultValue: "",
|
|
@@ -11634,7 +11631,7 @@ const Input = (props) => {
|
|
|
11634
11631
|
iconFontClassName,
|
|
11635
11632
|
...rest
|
|
11636
11633
|
} = {
|
|
11637
|
-
...defaultProps$
|
|
11634
|
+
...defaultProps$R,
|
|
11638
11635
|
...props
|
|
11639
11636
|
};
|
|
11640
11637
|
locale.placeholder = placeholder || locale.placeholder;
|
|
@@ -11854,14 +11851,14 @@ const Input = (props) => {
|
|
|
11854
11851
|
}
|
|
11855
11852
|
}, errorMessage) : null)));
|
|
11856
11853
|
};
|
|
11857
|
-
Input.defaultProps = defaultProps$
|
|
11854
|
+
Input.defaultProps = defaultProps$R;
|
|
11858
11855
|
Input.displayName = "NutInput";
|
|
11859
11856
|
const radioContext = {
|
|
11860
11857
|
onChange: (val) => {
|
|
11861
11858
|
}
|
|
11862
11859
|
};
|
|
11863
11860
|
var RadioContext = React__default.createContext(radioContext);
|
|
11864
|
-
const defaultProps$
|
|
11861
|
+
const defaultProps$Q = {
|
|
11865
11862
|
value: null,
|
|
11866
11863
|
textPosition: "right",
|
|
11867
11864
|
onChange: (value) => {
|
|
@@ -11870,7 +11867,7 @@ const defaultProps$S = {
|
|
|
11870
11867
|
};
|
|
11871
11868
|
const RadioGroup = React__default.forwardRef(
|
|
11872
11869
|
(props, ref) => {
|
|
11873
|
-
const { children } = { ...defaultProps$
|
|
11870
|
+
const { children } = { ...defaultProps$Q, ...props };
|
|
11874
11871
|
cn("RadioGroup");
|
|
11875
11872
|
const { className, value, onChange, textPosition, direction, ...rest } = props;
|
|
11876
11873
|
const [val2State, setVal2State] = useState(value);
|
|
@@ -11907,9 +11904,9 @@ const RadioGroup = React__default.forwardRef(
|
|
|
11907
11904
|
}, cloneChildren()));
|
|
11908
11905
|
}
|
|
11909
11906
|
);
|
|
11910
|
-
RadioGroup.defaultProps = defaultProps$
|
|
11907
|
+
RadioGroup.defaultProps = defaultProps$Q;
|
|
11911
11908
|
RadioGroup.displayName = "NutRadioGroup";
|
|
11912
|
-
const defaultProps$
|
|
11909
|
+
const defaultProps$P = {
|
|
11913
11910
|
...ComponentDefaults,
|
|
11914
11911
|
disabled: false,
|
|
11915
11912
|
checked: false,
|
|
@@ -11924,7 +11921,7 @@ const defaultProps$R = {
|
|
|
11924
11921
|
};
|
|
11925
11922
|
const Radio = (props) => {
|
|
11926
11923
|
const { children } = {
|
|
11927
|
-
...defaultProps$
|
|
11924
|
+
...defaultProps$P,
|
|
11928
11925
|
...props
|
|
11929
11926
|
};
|
|
11930
11927
|
const {
|
|
@@ -12004,10 +12001,10 @@ const Radio = (props) => {
|
|
|
12004
12001
|
...rest
|
|
12005
12002
|
}, renderRadioItem());
|
|
12006
12003
|
};
|
|
12007
|
-
Radio.defaultProps = defaultProps$
|
|
12004
|
+
Radio.defaultProps = defaultProps$P;
|
|
12008
12005
|
Radio.displayName = "NutRadio";
|
|
12009
12006
|
Radio.RadioGroup = RadioGroup;
|
|
12010
|
-
const defaultProps$
|
|
12007
|
+
const defaultProps$O = {
|
|
12011
12008
|
...ComponentDefaults,
|
|
12012
12009
|
count: 5,
|
|
12013
12010
|
modelValue: 0,
|
|
@@ -12040,7 +12037,7 @@ const Rate = (props) => {
|
|
|
12040
12037
|
iconClassPrefix,
|
|
12041
12038
|
iconFontClassName
|
|
12042
12039
|
} = {
|
|
12043
|
-
...defaultProps$
|
|
12040
|
+
...defaultProps$O,
|
|
12044
12041
|
...props
|
|
12045
12042
|
};
|
|
12046
12043
|
const b2 = cn("rate");
|
|
@@ -12058,7 +12055,7 @@ const Rate = (props) => {
|
|
|
12058
12055
|
setScore(Math.max(Number(modelValue), Number(minimizeValue)));
|
|
12059
12056
|
}, [modelValue]);
|
|
12060
12057
|
const pxCheck2 = (value) => {
|
|
12061
|
-
return isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
12058
|
+
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
12062
12059
|
};
|
|
12063
12060
|
const onClick = (e2, index2) => {
|
|
12064
12061
|
e2.preventDefault();
|
|
@@ -12066,9 +12063,7 @@ const Rate = (props) => {
|
|
|
12066
12063
|
if (disabled || readonly)
|
|
12067
12064
|
return;
|
|
12068
12065
|
let value = 0;
|
|
12069
|
-
if (index2 === 1 && score === index2)
|
|
12070
|
-
;
|
|
12071
|
-
else {
|
|
12066
|
+
if (!(index2 === 1 && score === index2)) {
|
|
12072
12067
|
value = index2;
|
|
12073
12068
|
}
|
|
12074
12069
|
value = Math.max(value, Number(minimizeValue));
|
|
@@ -12108,9 +12103,9 @@ const Rate = (props) => {
|
|
|
12108
12103
|
}));
|
|
12109
12104
|
}));
|
|
12110
12105
|
};
|
|
12111
|
-
Rate.defaultProps = defaultProps$
|
|
12106
|
+
Rate.defaultProps = defaultProps$O;
|
|
12112
12107
|
Rate.displayName = "NutRate";
|
|
12113
|
-
const defaultProps$
|
|
12108
|
+
const defaultProps$N = {
|
|
12114
12109
|
...ComponentDefaults,
|
|
12115
12110
|
title: "",
|
|
12116
12111
|
desc: "",
|
|
@@ -12143,7 +12138,7 @@ const ShortPassword = (props) => {
|
|
|
12143
12138
|
tips,
|
|
12144
12139
|
visible,
|
|
12145
12140
|
modelValue,
|
|
12146
|
-
errorMsg
|
|
12141
|
+
errorMsg,
|
|
12147
12142
|
noButton,
|
|
12148
12143
|
closeOnClickOverlay,
|
|
12149
12144
|
length,
|
|
@@ -12258,7 +12253,7 @@ const ShortPassword = (props) => {
|
|
|
12258
12253
|
className: b2("message")
|
|
12259
12254
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
12260
12255
|
className: b2("message__error")
|
|
12261
|
-
},
|
|
12256
|
+
}, errorMsg), tips || locale.shortpassword.tips ? /* @__PURE__ */ React__default.createElement("div", {
|
|
12262
12257
|
className: b2("message__forget")
|
|
12263
12258
|
}, /* @__PURE__ */ React__default.createElement(Icon$1, {
|
|
12264
12259
|
classPrefix: iconClassPrefix,
|
|
@@ -12278,9 +12273,9 @@ const ShortPassword = (props) => {
|
|
|
12278
12273
|
onClick: () => sure()
|
|
12279
12274
|
}, locale.confirm)) : null)));
|
|
12280
12275
|
};
|
|
12281
|
-
ShortPassword.defaultProps = defaultProps$
|
|
12276
|
+
ShortPassword.defaultProps = defaultProps$N;
|
|
12282
12277
|
ShortPassword.displayName = "NutShortPassword";
|
|
12283
|
-
const defaultProps$
|
|
12278
|
+
const defaultProps$M = {
|
|
12284
12279
|
defaultValue: "",
|
|
12285
12280
|
textAlign: "left",
|
|
12286
12281
|
limitshow: false,
|
|
@@ -12308,7 +12303,7 @@ const TextArea = (props) => {
|
|
|
12308
12303
|
onChange,
|
|
12309
12304
|
onBlur,
|
|
12310
12305
|
onFocus
|
|
12311
|
-
} = { ...defaultProps$
|
|
12306
|
+
} = { ...defaultProps$M, ...props };
|
|
12312
12307
|
const textareaBem = cn("textarea");
|
|
12313
12308
|
const [inputValue, SetInputValue] = useState("");
|
|
12314
12309
|
useEffect(() => {
|
|
@@ -12375,9 +12370,9 @@ const TextArea = (props) => {
|
|
|
12375
12370
|
className: textareaBem("limit")
|
|
12376
12371
|
}, inputValue.length, "/", maxlength < 0 ? 0 : maxlength) : null);
|
|
12377
12372
|
};
|
|
12378
|
-
TextArea.defaultProps = defaultProps$
|
|
12373
|
+
TextArea.defaultProps = defaultProps$M;
|
|
12379
12374
|
TextArea.displayName = "NutTextArea";
|
|
12380
|
-
const defaultProps$
|
|
12375
|
+
const defaultProps$L = {
|
|
12381
12376
|
...ComponentDefaults,
|
|
12382
12377
|
className: "",
|
|
12383
12378
|
style: {},
|
|
@@ -12425,7 +12420,7 @@ const Progress = (props) => {
|
|
|
12425
12420
|
iconFontClassName,
|
|
12426
12421
|
...rest
|
|
12427
12422
|
} = {
|
|
12428
|
-
...defaultProps$
|
|
12423
|
+
...defaultProps$L,
|
|
12429
12424
|
...props
|
|
12430
12425
|
};
|
|
12431
12426
|
const b2 = cn("progress");
|
|
@@ -12503,7 +12498,7 @@ const Progress = (props) => {
|
|
|
12503
12498
|
color: iconColor
|
|
12504
12499
|
})));
|
|
12505
12500
|
};
|
|
12506
|
-
Progress.defaultProps = defaultProps$
|
|
12501
|
+
Progress.defaultProps = defaultProps$L;
|
|
12507
12502
|
Progress.displayName = "NutProgress";
|
|
12508
12503
|
class UploadOptions {
|
|
12509
12504
|
constructor() {
|
|
@@ -12518,43 +12513,43 @@ class UploadOptions {
|
|
|
12518
12513
|
}
|
|
12519
12514
|
}
|
|
12520
12515
|
class Upload {
|
|
12521
|
-
constructor(
|
|
12522
|
-
this.options =
|
|
12516
|
+
constructor(options) {
|
|
12517
|
+
this.options = options;
|
|
12523
12518
|
}
|
|
12524
12519
|
upload() {
|
|
12525
12520
|
var _a;
|
|
12526
|
-
const { options
|
|
12521
|
+
const { options } = this;
|
|
12527
12522
|
const xhr = new XMLHttpRequest();
|
|
12528
|
-
xhr.timeout =
|
|
12523
|
+
xhr.timeout = options.timeout;
|
|
12529
12524
|
if (xhr.upload) {
|
|
12530
12525
|
xhr.upload.addEventListener(
|
|
12531
12526
|
"progress",
|
|
12532
12527
|
(e2) => {
|
|
12533
12528
|
var _a2;
|
|
12534
|
-
(_a2 =
|
|
12529
|
+
(_a2 = options.onProgress) == null ? void 0 : _a2.call(options, e2, options);
|
|
12535
12530
|
},
|
|
12536
12531
|
false
|
|
12537
12532
|
);
|
|
12538
12533
|
xhr.onreadystatechange = () => {
|
|
12539
12534
|
var _a2, _b;
|
|
12540
12535
|
if (xhr.readyState === 4) {
|
|
12541
|
-
if (xhr.status ===
|
|
12542
|
-
(_a2 =
|
|
12536
|
+
if (xhr.status === options.xhrState) {
|
|
12537
|
+
(_a2 = options.onSuccess) == null ? void 0 : _a2.call(options, xhr.responseText, options);
|
|
12543
12538
|
} else {
|
|
12544
|
-
(_b =
|
|
12539
|
+
(_b = options.onFailure) == null ? void 0 : _b.call(options, xhr.responseText, options);
|
|
12545
12540
|
}
|
|
12546
12541
|
}
|
|
12547
12542
|
};
|
|
12548
|
-
xhr.withCredentials =
|
|
12549
|
-
xhr.open(
|
|
12550
|
-
for (const [key, value] of Object.entries(
|
|
12543
|
+
xhr.withCredentials = options.withCredentials;
|
|
12544
|
+
xhr.open(options.method, options.url, true);
|
|
12545
|
+
for (const [key, value] of Object.entries(options.headers)) {
|
|
12551
12546
|
xhr.setRequestHeader(key, value);
|
|
12552
12547
|
}
|
|
12553
|
-
(_a =
|
|
12554
|
-
if (
|
|
12555
|
-
|
|
12548
|
+
(_a = options.onStart) == null ? void 0 : _a.call(options, options);
|
|
12549
|
+
if (options.beforeXhrUpload) {
|
|
12550
|
+
options.beforeXhrUpload(xhr, options);
|
|
12556
12551
|
} else {
|
|
12557
|
-
xhr.send(
|
|
12552
|
+
xhr.send(options.formData);
|
|
12558
12553
|
}
|
|
12559
12554
|
} else {
|
|
12560
12555
|
console.warn("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 XMLHttpRequest");
|
|
@@ -12562,46 +12557,46 @@ class Upload {
|
|
|
12562
12557
|
}
|
|
12563
12558
|
uploadTaro(uploadFile, env) {
|
|
12564
12559
|
var _a;
|
|
12565
|
-
const
|
|
12560
|
+
const options = this.options;
|
|
12566
12561
|
if (env === "WEB") {
|
|
12567
12562
|
this.upload();
|
|
12568
|
-
} else if (
|
|
12569
|
-
|
|
12563
|
+
} else if (options.beforeXhrUpload) {
|
|
12564
|
+
options.beforeXhrUpload(uploadFile, options);
|
|
12570
12565
|
} else {
|
|
12571
12566
|
const uploadTask = uploadFile({
|
|
12572
|
-
url:
|
|
12573
|
-
filePath:
|
|
12574
|
-
fileType:
|
|
12567
|
+
url: options.url,
|
|
12568
|
+
filePath: options.taroFilePath,
|
|
12569
|
+
fileType: options.fileType,
|
|
12575
12570
|
header: {
|
|
12576
12571
|
"Content-Type": "multipart/form-data",
|
|
12577
|
-
...
|
|
12572
|
+
...options.headers
|
|
12578
12573
|
},
|
|
12579
|
-
formData:
|
|
12580
|
-
name:
|
|
12574
|
+
formData: options.formData,
|
|
12575
|
+
name: options.name,
|
|
12581
12576
|
success(response) {
|
|
12582
12577
|
var _a2, _b;
|
|
12583
|
-
if (
|
|
12584
|
-
(_a2 =
|
|
12578
|
+
if (options.xhrState == response.statusCode) {
|
|
12579
|
+
(_a2 = options.onSuccess) == null ? void 0 : _a2.call(options, response, options);
|
|
12585
12580
|
} else {
|
|
12586
|
-
(_b =
|
|
12581
|
+
(_b = options.onFailure) == null ? void 0 : _b.call(options, response, options);
|
|
12587
12582
|
}
|
|
12588
12583
|
},
|
|
12589
12584
|
fail(e2) {
|
|
12590
12585
|
var _a2;
|
|
12591
|
-
(_a2 =
|
|
12586
|
+
(_a2 = options.onFailure) == null ? void 0 : _a2.call(options, e2, options);
|
|
12592
12587
|
}
|
|
12593
12588
|
});
|
|
12594
|
-
(_a =
|
|
12589
|
+
(_a = options.onStart) == null ? void 0 : _a.call(options, options);
|
|
12595
12590
|
uploadTask.progress(
|
|
12596
12591
|
(res) => {
|
|
12597
12592
|
var _a2;
|
|
12598
|
-
(_a2 =
|
|
12593
|
+
(_a2 = options.onProgress) == null ? void 0 : _a2.call(options, res, options);
|
|
12599
12594
|
}
|
|
12600
12595
|
);
|
|
12601
12596
|
}
|
|
12602
12597
|
}
|
|
12603
12598
|
}
|
|
12604
|
-
const defaultProps$
|
|
12599
|
+
const defaultProps$K = {
|
|
12605
12600
|
...ComponentDefaults,
|
|
12606
12601
|
url: "",
|
|
12607
12602
|
maximum: 9,
|
|
@@ -12673,7 +12668,7 @@ const InternalUploader = (props, ref) => {
|
|
|
12673
12668
|
onBeforeXhrUpload,
|
|
12674
12669
|
onBeforeDelete,
|
|
12675
12670
|
...restProps
|
|
12676
|
-
} = { ...defaultProps$
|
|
12671
|
+
} = { ...defaultProps$K, ...props };
|
|
12677
12672
|
const [fileList, setFileList] = useState([]);
|
|
12678
12673
|
const [uploadQueue, setUploadQueue] = useState([]);
|
|
12679
12674
|
useEffect(() => {
|
|
@@ -12876,7 +12871,7 @@ const InternalUploader = (props, ref) => {
|
|
|
12876
12871
|
...restProps
|
|
12877
12872
|
}, children && /* @__PURE__ */ React__default.createElement("div", {
|
|
12878
12873
|
className: "nut-uploader__slot"
|
|
12879
|
-
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children, maximum > fileList.length && /* @__PURE__ */ React__default.createElement(Button
|
|
12874
|
+
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children, maximum > fileList.length && /* @__PURE__ */ React__default.createElement(Button, {
|
|
12880
12875
|
className: "nut-uploader__input",
|
|
12881
12876
|
onClick: chooseImage
|
|
12882
12877
|
}))), fileList.length !== 0 && fileList.map((item, index2) => {
|
|
@@ -12955,15 +12950,15 @@ const InternalUploader = (props, ref) => {
|
|
|
12955
12950
|
size: uploadIconSize,
|
|
12956
12951
|
color: "#808080",
|
|
12957
12952
|
name: uploadIcon
|
|
12958
|
-
}), /* @__PURE__ */ React__default.createElement(Button
|
|
12953
|
+
}), /* @__PURE__ */ React__default.createElement(Button, {
|
|
12959
12954
|
className: "nut-uploader__input",
|
|
12960
12955
|
onClick: chooseImage
|
|
12961
12956
|
})));
|
|
12962
12957
|
};
|
|
12963
12958
|
const Uploader = React__default.forwardRef(InternalUploader);
|
|
12964
|
-
Uploader.defaultProps = defaultProps$
|
|
12959
|
+
Uploader.defaultProps = defaultProps$K;
|
|
12965
12960
|
Uploader.displayName = "NutUploader";
|
|
12966
|
-
const defaultProps$
|
|
12961
|
+
const defaultProps$J = {
|
|
12967
12962
|
data: {
|
|
12968
12963
|
text: "",
|
|
12969
12964
|
value: "",
|
|
@@ -12978,7 +12973,7 @@ const defaultProps$L = {
|
|
|
12978
12973
|
};
|
|
12979
12974
|
const InternalCascaderItem = (props) => {
|
|
12980
12975
|
const { data, checked, chooseItem } = {
|
|
12981
|
-
...defaultProps$
|
|
12976
|
+
...defaultProps$J,
|
|
12982
12977
|
...props
|
|
12983
12978
|
};
|
|
12984
12979
|
const b2 = cn("cascader-item");
|
|
@@ -13014,7 +13009,7 @@ const InternalCascaderItem = (props) => {
|
|
|
13014
13009
|
}));
|
|
13015
13010
|
};
|
|
13016
13011
|
const CascaderItem = React__default.forwardRef(InternalCascaderItem);
|
|
13017
|
-
CascaderItem.defaultProps = defaultProps$
|
|
13012
|
+
CascaderItem.defaultProps = defaultProps$J;
|
|
13018
13013
|
CascaderItem.displayName = "NutCascaderItem";
|
|
13019
13014
|
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
13020
13015
|
const {
|
|
@@ -13060,10 +13055,10 @@ const defaultConvertConfig = {
|
|
|
13060
13055
|
pidKey: "pid",
|
|
13061
13056
|
sortKey: ""
|
|
13062
13057
|
};
|
|
13063
|
-
const convertListToOptions = (list,
|
|
13058
|
+
const convertListToOptions = (list, options) => {
|
|
13064
13059
|
const mergedOptions = {
|
|
13065
13060
|
...defaultConvertConfig,
|
|
13066
|
-
...
|
|
13061
|
+
...options || {}
|
|
13067
13062
|
};
|
|
13068
13063
|
const { topId, idKey, pidKey, sortKey } = mergedOptions;
|
|
13069
13064
|
let result = [];
|
|
@@ -13148,9 +13143,10 @@ class Tree {
|
|
|
13148
13143
|
return pathNodes;
|
|
13149
13144
|
}
|
|
13150
13145
|
}
|
|
13151
|
-
const defaultProps$
|
|
13146
|
+
const defaultProps$I = {
|
|
13152
13147
|
className: "",
|
|
13153
13148
|
style: {},
|
|
13149
|
+
poppable: true,
|
|
13154
13150
|
visible: false,
|
|
13155
13151
|
options: [],
|
|
13156
13152
|
value: [],
|
|
@@ -13177,8 +13173,9 @@ const InternalCascader = (props) => {
|
|
|
13177
13173
|
const {
|
|
13178
13174
|
className,
|
|
13179
13175
|
style,
|
|
13176
|
+
poppable,
|
|
13180
13177
|
visible,
|
|
13181
|
-
options
|
|
13178
|
+
options,
|
|
13182
13179
|
value,
|
|
13183
13180
|
title,
|
|
13184
13181
|
textKey,
|
|
@@ -13193,7 +13190,7 @@ const InternalCascader = (props) => {
|
|
|
13193
13190
|
onClose,
|
|
13194
13191
|
onChange,
|
|
13195
13192
|
onPathChange
|
|
13196
|
-
} = { ...defaultProps$
|
|
13193
|
+
} = { ...defaultProps$I, ...props };
|
|
13197
13194
|
const [tabvalue, setTabvalue] = useState("c1");
|
|
13198
13195
|
const [optiosData, setOptiosData] = useState([]);
|
|
13199
13196
|
const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
|
|
@@ -13236,16 +13233,16 @@ const InternalCascader = (props) => {
|
|
|
13236
13233
|
}, [value]);
|
|
13237
13234
|
useEffect(() => {
|
|
13238
13235
|
initData();
|
|
13239
|
-
}, [
|
|
13236
|
+
}, [options]);
|
|
13240
13237
|
const initData = async () => {
|
|
13241
13238
|
state.lazyLoadMap.clear();
|
|
13242
13239
|
if (convertConfig2 && Object.keys(convertConfig2).length > 0) {
|
|
13243
13240
|
state.optionsData = convertListToOptions(
|
|
13244
|
-
|
|
13241
|
+
options,
|
|
13245
13242
|
convertConfig2
|
|
13246
13243
|
);
|
|
13247
13244
|
} else {
|
|
13248
|
-
state.optionsData =
|
|
13245
|
+
state.optionsData = options;
|
|
13249
13246
|
}
|
|
13250
13247
|
state.tree = new Tree(state.optionsData, {
|
|
13251
13248
|
value: state.configs.valueKey,
|
|
@@ -13396,10 +13393,50 @@ const InternalCascader = (props) => {
|
|
|
13396
13393
|
}
|
|
13397
13394
|
setOptiosData(state.panes);
|
|
13398
13395
|
};
|
|
13399
|
-
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
|
|
13396
|
+
const renderItem = () => {
|
|
13397
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13398
|
+
className: `${classes} ${className}`,
|
|
13399
|
+
style
|
|
13400
|
+
}, poppable && /* @__PURE__ */ React__default.createElement("div", {
|
|
13401
|
+
className: b2("title")
|
|
13402
|
+
}, title), /* @__PURE__ */ React__default.createElement(Tabs, {
|
|
13403
|
+
value: tabvalue,
|
|
13404
|
+
titleNode: () => {
|
|
13405
|
+
return optiosData.map((pane, index2) => {
|
|
13406
|
+
var _a, _b;
|
|
13407
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13408
|
+
onClick: () => {
|
|
13409
|
+
setTabvalue(pane.paneKey);
|
|
13410
|
+
state.tabsCursor = index2;
|
|
13411
|
+
},
|
|
13412
|
+
className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "active" : ""}`,
|
|
13413
|
+
key: pane.paneKey
|
|
13414
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
13415
|
+
className: "nut-tabs__titles-item__text"
|
|
13416
|
+
}, !state.initLoading && state.panes.length && ((_a = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a.text), !state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) && "\u8BF7\u9009\u62E9", !(!state.initLoading && state.panes.length) && "Loading..."), /* @__PURE__ */ React__default.createElement("span", {
|
|
13417
|
+
className: "nut-tabs__titles-item__line"
|
|
13418
|
+
}));
|
|
13419
|
+
});
|
|
13420
|
+
}
|
|
13421
|
+
}, !state.initLoading && state.panes.length ? optiosData.map((pane) => /* @__PURE__ */ React__default.createElement(TabPane, {
|
|
13422
|
+
key: pane.paneKey,
|
|
13423
|
+
paneKey: pane.paneKey
|
|
13424
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13425
|
+
className: classesPane
|
|
13426
|
+
}, pane.nodes && pane.nodes.map((node, index2) => {
|
|
13427
|
+
var _a;
|
|
13428
|
+
return /* @__PURE__ */ React__default.createElement(CascaderItem, {
|
|
13429
|
+
key: index2,
|
|
13430
|
+
...props,
|
|
13431
|
+
data: node,
|
|
13432
|
+
checked: ((_a = pane.selectedNode) == null ? void 0 : _a.value) === node.value,
|
|
13433
|
+
chooseItem: (node2) => chooseItem(node2, false)
|
|
13434
|
+
});
|
|
13435
|
+
})))) : /* @__PURE__ */ React__default.createElement(TabPane, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
13436
|
+
className: classesPane
|
|
13437
|
+
}))));
|
|
13438
|
+
};
|
|
13439
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, poppable ? /* @__PURE__ */ React__default.createElement(Popup, {
|
|
13403
13440
|
popClass: "cascadar-popup",
|
|
13404
13441
|
visible,
|
|
13405
13442
|
position: "bottom",
|
|
@@ -13409,49 +13446,12 @@ const InternalCascader = (props) => {
|
|
|
13409
13446
|
closeIcon,
|
|
13410
13447
|
onClickOverlay: closePopup,
|
|
13411
13448
|
onClickCloseIcon: closePopup
|
|
13412
|
-
},
|
|
13413
|
-
className: b2("title")
|
|
13414
|
-
}, title), /* @__PURE__ */ React__default.createElement(Tabs, {
|
|
13415
|
-
value: tabvalue,
|
|
13416
|
-
titleNode: () => {
|
|
13417
|
-
return optiosData.map((pane, index2) => {
|
|
13418
|
-
var _a, _b;
|
|
13419
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13420
|
-
onClick: () => {
|
|
13421
|
-
setTabvalue(pane.paneKey);
|
|
13422
|
-
state.tabsCursor = index2;
|
|
13423
|
-
},
|
|
13424
|
-
className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "active" : ""}`,
|
|
13425
|
-
key: pane.paneKey
|
|
13426
|
-
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
13427
|
-
className: "nut-tabs__titles-item__text"
|
|
13428
|
-
}, !state.initLoading && state.panes.length && ((_a = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a.text), !state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) && "\u8BF7\u9009\u62E9", !(!state.initLoading && state.panes.length) && "Loading..."), /* @__PURE__ */ React__default.createElement("span", {
|
|
13429
|
-
className: "nut-tabs__titles-item__line"
|
|
13430
|
-
}));
|
|
13431
|
-
});
|
|
13432
|
-
}
|
|
13433
|
-
}, !state.initLoading && state.panes.length ? optiosData.map((pane) => /* @__PURE__ */ React__default.createElement(TabPane, {
|
|
13434
|
-
key: pane.paneKey,
|
|
13435
|
-
paneKey: pane.paneKey
|
|
13436
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13437
|
-
className: classesPane
|
|
13438
|
-
}, pane.nodes && pane.nodes.map((node, index2) => {
|
|
13439
|
-
var _a;
|
|
13440
|
-
return /* @__PURE__ */ React__default.createElement(CascaderItem, {
|
|
13441
|
-
key: index2,
|
|
13442
|
-
...props,
|
|
13443
|
-
data: node,
|
|
13444
|
-
checked: ((_a = pane.selectedNode) == null ? void 0 : _a.value) === node.value,
|
|
13445
|
-
chooseItem: (node2) => chooseItem(node2, false)
|
|
13446
|
-
});
|
|
13447
|
-
})))) : /* @__PURE__ */ React__default.createElement(TabPane, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
13448
|
-
className: classesPane
|
|
13449
|
-
})))));
|
|
13449
|
+
}, renderItem()) : renderItem());
|
|
13450
13450
|
};
|
|
13451
13451
|
const Cascader = React__default.forwardRef(InternalCascader);
|
|
13452
|
-
Cascader.defaultProps = defaultProps$
|
|
13452
|
+
Cascader.defaultProps = defaultProps$I;
|
|
13453
13453
|
Cascader.displayName = "NutCascader";
|
|
13454
|
-
const defaultProps$
|
|
13454
|
+
const defaultProps$H = {
|
|
13455
13455
|
...ComponentDefaults,
|
|
13456
13456
|
placeholder: "",
|
|
13457
13457
|
shape: "square",
|
|
@@ -13501,7 +13501,7 @@ const SearchBar = (props) => {
|
|
|
13501
13501
|
iconClassPrefix,
|
|
13502
13502
|
iconFontClassName
|
|
13503
13503
|
} = {
|
|
13504
|
-
...defaultProps$
|
|
13504
|
+
...defaultProps$H,
|
|
13505
13505
|
...props
|
|
13506
13506
|
};
|
|
13507
13507
|
const alignClass = `${align}`;
|
|
@@ -13640,9 +13640,9 @@ const SearchBar = (props) => {
|
|
|
13640
13640
|
className: `${searchbarBem("content")}`
|
|
13641
13641
|
}, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
|
|
13642
13642
|
};
|
|
13643
|
-
SearchBar.defaultProps = defaultProps$
|
|
13643
|
+
SearchBar.defaultProps = defaultProps$H;
|
|
13644
13644
|
SearchBar.displayName = "NutSearchBar";
|
|
13645
|
-
const defaultProps$
|
|
13645
|
+
const defaultProps$G = {
|
|
13646
13646
|
confirmText: "",
|
|
13647
13647
|
title: "",
|
|
13648
13648
|
visible: false,
|
|
@@ -13840,9 +13840,9 @@ const NumberKeyboard = (props) => {
|
|
|
13840
13840
|
})
|
|
13841
13841
|
}, confirmText || locale.done))) : null))));
|
|
13842
13842
|
};
|
|
13843
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
13843
|
+
NumberKeyboard.defaultProps = defaultProps$G;
|
|
13844
13844
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
13845
|
-
const defaultProps$
|
|
13845
|
+
const defaultProps$F = {
|
|
13846
13846
|
cancelTxt: "",
|
|
13847
13847
|
optionTag: "name",
|
|
13848
13848
|
optionSubTag: "subname",
|
|
@@ -13876,7 +13876,7 @@ const ActionSheet = (props) => {
|
|
|
13876
13876
|
className,
|
|
13877
13877
|
style,
|
|
13878
13878
|
...rest
|
|
13879
|
-
} = { ...defaultProps$
|
|
13879
|
+
} = { ...defaultProps$F, ...props };
|
|
13880
13880
|
const b2 = cn("actionsheet");
|
|
13881
13881
|
const isHighlight = (item) => {
|
|
13882
13882
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -13920,9 +13920,9 @@ const ActionSheet = (props) => {
|
|
|
13920
13920
|
onClick: () => cancelActionSheet()
|
|
13921
13921
|
}, cancelTxt)));
|
|
13922
13922
|
};
|
|
13923
|
-
ActionSheet.defaultProps = defaultProps$
|
|
13923
|
+
ActionSheet.defaultProps = defaultProps$F;
|
|
13924
13924
|
ActionSheet.displayName = "NutActionSheet";
|
|
13925
|
-
const defaultProps$
|
|
13925
|
+
const defaultProps$E = {
|
|
13926
13926
|
...ComponentDefaults,
|
|
13927
13927
|
bottom: 20,
|
|
13928
13928
|
right: 10,
|
|
@@ -13948,7 +13948,7 @@ const BackTop = (props) => {
|
|
|
13948
13948
|
iconClassPrefix,
|
|
13949
13949
|
iconFontClassName
|
|
13950
13950
|
} = {
|
|
13951
|
-
...defaultProps$
|
|
13951
|
+
...defaultProps$E,
|
|
13952
13952
|
...props
|
|
13953
13953
|
};
|
|
13954
13954
|
const [backTop, SetBackTop] = useState(false);
|
|
@@ -14039,9 +14039,9 @@ const BackTop = (props) => {
|
|
|
14039
14039
|
name: "top"
|
|
14040
14040
|
}));
|
|
14041
14041
|
};
|
|
14042
|
-
BackTop.defaultProps = defaultProps$
|
|
14042
|
+
BackTop.defaultProps = defaultProps$E;
|
|
14043
14043
|
BackTop.displayName = "NutBackTop";
|
|
14044
|
-
const defaultProps$
|
|
14044
|
+
const defaultProps$D = {
|
|
14045
14045
|
attract: false,
|
|
14046
14046
|
direction: void 0,
|
|
14047
14047
|
boundary: {
|
|
@@ -14054,7 +14054,7 @@ const defaultProps$F = {
|
|
|
14054
14054
|
};
|
|
14055
14055
|
const Drag = (props) => {
|
|
14056
14056
|
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
14057
|
-
...defaultProps$
|
|
14057
|
+
...defaultProps$D,
|
|
14058
14058
|
...props
|
|
14059
14059
|
};
|
|
14060
14060
|
const b2 = cn("drag");
|
|
@@ -14116,7 +14116,7 @@ const Drag = (props) => {
|
|
|
14116
14116
|
...bind()
|
|
14117
14117
|
}, children));
|
|
14118
14118
|
};
|
|
14119
|
-
Drag.defaultProps = defaultProps$
|
|
14119
|
+
Drag.defaultProps = defaultProps$D;
|
|
14120
14120
|
Drag.displayName = "NutDrag";
|
|
14121
14121
|
const Content = (props) => {
|
|
14122
14122
|
const {
|
|
@@ -14215,326 +14215,22 @@ const DialogWrapper = (props) => {
|
|
|
14215
14215
|
}));
|
|
14216
14216
|
};
|
|
14217
14217
|
DialogWrapper.displayName = "NutDialogWrapper";
|
|
14218
|
-
const defaultProps$
|
|
14219
|
-
|
|
14220
|
-
|
|
14221
|
-
|
|
14222
|
-
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
14229
|
-
|
|
14230
|
-
|
|
14231
|
-
children: void 0,
|
|
14232
|
-
onClick: (e2) => {
|
|
14233
|
-
}
|
|
14218
|
+
const defaultProps$C = {
|
|
14219
|
+
okText: "",
|
|
14220
|
+
cancelText: "",
|
|
14221
|
+
mask: true,
|
|
14222
|
+
closeOnClickOverlay: true,
|
|
14223
|
+
noFooter: false,
|
|
14224
|
+
noOkBtn: false,
|
|
14225
|
+
noCancelBtn: false,
|
|
14226
|
+
okBtnDisabled: false,
|
|
14227
|
+
cancelAutoClose: true,
|
|
14228
|
+
textAlign: "center",
|
|
14229
|
+
footerDirection: "horizontal",
|
|
14230
|
+
lockScroll: false
|
|
14234
14231
|
};
|
|
14235
|
-
const
|
|
14236
|
-
const {
|
|
14237
|
-
color,
|
|
14238
|
-
shape,
|
|
14239
|
-
plain,
|
|
14240
|
-
loading,
|
|
14241
|
-
disabled,
|
|
14242
|
-
type,
|
|
14243
|
-
size,
|
|
14244
|
-
block,
|
|
14245
|
-
icon,
|
|
14246
|
-
children,
|
|
14247
|
-
onClick,
|
|
14248
|
-
className,
|
|
14249
|
-
style,
|
|
14250
|
-
iconClassPrefix,
|
|
14251
|
-
iconFontClassName,
|
|
14252
|
-
...rest
|
|
14253
|
-
} = {
|
|
14254
|
-
...defaultProps$E,
|
|
14255
|
-
...props
|
|
14256
|
-
};
|
|
14257
|
-
const getStyle = useCallback(() => {
|
|
14258
|
-
const style2 = {};
|
|
14259
|
-
if (color) {
|
|
14260
|
-
if (plain) {
|
|
14261
|
-
style2.color = color;
|
|
14262
|
-
style2.background = "#fff";
|
|
14263
|
-
if (!(color == null ? void 0 : color.includes("gradient"))) {
|
|
14264
|
-
style2.borderColor = color;
|
|
14265
|
-
}
|
|
14266
|
-
} else {
|
|
14267
|
-
style2.color = "#fff";
|
|
14268
|
-
style2.background = color;
|
|
14269
|
-
}
|
|
14270
|
-
}
|
|
14271
|
-
return style2;
|
|
14272
|
-
}, [color, plain]);
|
|
14273
|
-
const classes = useCallback(() => {
|
|
14274
|
-
const prefixCls = "nut-button";
|
|
14275
|
-
return [
|
|
14276
|
-
prefixCls,
|
|
14277
|
-
`${type ? `${prefixCls}--${type}` : ""}`,
|
|
14278
|
-
`${size ? `${prefixCls}--${size}` : ""}`,
|
|
14279
|
-
`${shape ? `${prefixCls}--${shape}` : ""}`,
|
|
14280
|
-
`${plain ? `${prefixCls}--plain` : ""}`,
|
|
14281
|
-
`${block ? `${prefixCls}--block` : ""}`,
|
|
14282
|
-
`${disabled ? `${prefixCls}--disabled` : ""}`,
|
|
14283
|
-
`${loading ? `${prefixCls}--loading` : ""}`
|
|
14284
|
-
].filter(Boolean).join(" ");
|
|
14285
|
-
}, [block, disabled, loading, plain, shape, size, type]);
|
|
14286
|
-
const [btnName, setBtnName] = useState(classes());
|
|
14287
|
-
const [btnStyle, setBtnStyle] = useState(getStyle());
|
|
14288
|
-
useEffect(() => {
|
|
14289
|
-
setBtnName(classes());
|
|
14290
|
-
setBtnStyle(getStyle());
|
|
14291
|
-
}, [
|
|
14292
|
-
className,
|
|
14293
|
-
color,
|
|
14294
|
-
shape,
|
|
14295
|
-
plain,
|
|
14296
|
-
loading,
|
|
14297
|
-
disabled,
|
|
14298
|
-
style,
|
|
14299
|
-
type,
|
|
14300
|
-
size,
|
|
14301
|
-
block,
|
|
14302
|
-
icon,
|
|
14303
|
-
children,
|
|
14304
|
-
onClick,
|
|
14305
|
-
classes,
|
|
14306
|
-
getStyle
|
|
14307
|
-
]);
|
|
14308
|
-
const handleClick2 = (e2) => {
|
|
14309
|
-
if (!loading && !disabled && onClick) {
|
|
14310
|
-
onClick(e2);
|
|
14311
|
-
}
|
|
14312
|
-
};
|
|
14313
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14314
|
-
className: `${btnName} ${className}`,
|
|
14315
|
-
style: { ...btnStyle, ...style },
|
|
14316
|
-
...rest,
|
|
14317
|
-
onClick: (e2) => handleClick2(e2)
|
|
14318
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14319
|
-
className: "nut-button__warp",
|
|
14320
|
-
style: getStyle()
|
|
14321
|
-
}, loading && /* @__PURE__ */ React__default.createElement(Icon, {
|
|
14322
|
-
classPrefix: iconClassPrefix,
|
|
14323
|
-
fontClassName: iconFontClassName,
|
|
14324
|
-
name: "loading"
|
|
14325
|
-
}), !loading && icon ? /* @__PURE__ */ React__default.createElement(Icon, {
|
|
14326
|
-
classPrefix: iconClassPrefix,
|
|
14327
|
-
fontClassName: iconFontClassName,
|
|
14328
|
-
name: icon
|
|
14329
|
-
}) : "", children));
|
|
14330
|
-
};
|
|
14331
|
-
Button.defaultProps = defaultProps$E;
|
|
14332
|
-
Button.displayName = "NutButton";
|
|
14333
|
-
const defaultProps$D = {
|
|
14334
|
-
okText: "\u786E\u8BA4",
|
|
14335
|
-
cancelText: "\u53D6\u6D88",
|
|
14336
|
-
mask: true,
|
|
14337
|
-
closeOnClickOverlay: true,
|
|
14338
|
-
noFooter: false,
|
|
14339
|
-
noOkBtn: false,
|
|
14340
|
-
noCancelBtn: false,
|
|
14341
|
-
okBtnDisabled: false,
|
|
14342
|
-
cancelAutoClose: true,
|
|
14343
|
-
textAlign: "center",
|
|
14344
|
-
footerDirection: "horizontal",
|
|
14345
|
-
lockScroll: false
|
|
14346
|
-
};
|
|
14347
|
-
const BaseDialog$1 = (props, ref) => {
|
|
14348
|
-
const {
|
|
14349
|
-
visible,
|
|
14350
|
-
footer,
|
|
14351
|
-
noFooter,
|
|
14352
|
-
noOkBtn,
|
|
14353
|
-
noCancelBtn,
|
|
14354
|
-
lockScroll,
|
|
14355
|
-
okBtnDisabled,
|
|
14356
|
-
cancelAutoClose,
|
|
14357
|
-
okText,
|
|
14358
|
-
cancelText,
|
|
14359
|
-
onClosed,
|
|
14360
|
-
onCancel,
|
|
14361
|
-
onOk,
|
|
14362
|
-
...restProps
|
|
14363
|
-
} = props;
|
|
14364
|
-
const renderFooter = function() {
|
|
14365
|
-
if (footer === null || noFooter)
|
|
14366
|
-
return "";
|
|
14367
|
-
const handleCancel = (e2) => {
|
|
14368
|
-
e2.stopPropagation();
|
|
14369
|
-
if (!cancelAutoClose)
|
|
14370
|
-
return;
|
|
14371
|
-
onClosed == null ? void 0 : onClosed();
|
|
14372
|
-
onCancel == null ? void 0 : onCancel();
|
|
14373
|
-
if (lockScroll && visible) {
|
|
14374
|
-
document.body.classList.remove("nut-overflow-hidden");
|
|
14375
|
-
}
|
|
14376
|
-
};
|
|
14377
|
-
const handleOk = (e2) => {
|
|
14378
|
-
e2.stopPropagation();
|
|
14379
|
-
onClosed == null ? void 0 : onClosed();
|
|
14380
|
-
onOk == null ? void 0 : onOk(e2);
|
|
14381
|
-
if (lockScroll && visible) {
|
|
14382
|
-
document.body.classList.remove("nut-overflow-hidden");
|
|
14383
|
-
}
|
|
14384
|
-
};
|
|
14385
|
-
const footerContent = footer || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !noCancelBtn && /* @__PURE__ */ React__default.createElement(Button, {
|
|
14386
|
-
size: "small",
|
|
14387
|
-
plain: true,
|
|
14388
|
-
type: "primary",
|
|
14389
|
-
className: "nut-dialog__footer-cancel",
|
|
14390
|
-
onClick: handleCancel
|
|
14391
|
-
}, cancelText), !noOkBtn && /* @__PURE__ */ React__default.createElement(Button, {
|
|
14392
|
-
size: "small",
|
|
14393
|
-
type: "primary",
|
|
14394
|
-
className: classNames("nut-dialog__footer-ok", {
|
|
14395
|
-
disabled: okBtnDisabled
|
|
14396
|
-
}),
|
|
14397
|
-
disabled: okBtnDisabled,
|
|
14398
|
-
onClick: handleOk
|
|
14399
|
-
}, okText));
|
|
14400
|
-
return footerContent;
|
|
14401
|
-
};
|
|
14402
|
-
return /* @__PURE__ */ React__default.createElement(DialogWrapper, {
|
|
14403
|
-
...restProps,
|
|
14404
|
-
visible,
|
|
14405
|
-
lockScroll,
|
|
14406
|
-
footer: renderFooter(),
|
|
14407
|
-
onClosed,
|
|
14408
|
-
onCancel
|
|
14409
|
-
});
|
|
14410
|
-
};
|
|
14411
|
-
const Dialog$1 = forwardRef(BaseDialog$1);
|
|
14412
|
-
Dialog$1.confirm = (props) => {
|
|
14413
|
-
return confirm(props);
|
|
14414
|
-
};
|
|
14415
|
-
["alert"].forEach((type) => {
|
|
14416
|
-
Dialog$1[type] = (props) => {
|
|
14417
|
-
return confirm({
|
|
14418
|
-
...props,
|
|
14419
|
-
isNotice: false,
|
|
14420
|
-
noticeType: type
|
|
14421
|
-
});
|
|
14422
|
-
};
|
|
14423
|
-
});
|
|
14424
|
-
Dialog$1.defaultProps = defaultProps$D;
|
|
14425
|
-
Dialog$1.displayName = "NutDialog";
|
|
14426
|
-
function ConfirmDialog(props) {
|
|
14427
|
-
return /* @__PURE__ */ React__default.createElement(Dialog$1, {
|
|
14428
|
-
...props
|
|
14429
|
-
}, props.content);
|
|
14430
|
-
}
|
|
14431
|
-
const normalizeConfig = (_config) => {
|
|
14432
|
-
if (_config.isNotice) {
|
|
14433
|
-
let { icon } = _config;
|
|
14434
|
-
if (!icon && icon !== null) {
|
|
14435
|
-
switch (_config.noticeType) {
|
|
14436
|
-
case "alert":
|
|
14437
|
-
icon = "";
|
|
14438
|
-
break;
|
|
14439
|
-
}
|
|
14440
|
-
}
|
|
14441
|
-
_config.noCancelBtn = true;
|
|
14442
|
-
}
|
|
14443
|
-
return _config;
|
|
14444
|
-
};
|
|
14445
|
-
function confirm(config2, renderFunc) {
|
|
14446
|
-
const div = document.createElement("div");
|
|
14447
|
-
document.body.appendChild(div);
|
|
14448
|
-
function render2(props) {
|
|
14449
|
-
ReactDOM__default.render(/* @__PURE__ */ React__default.createElement(ConfirmDialog, {
|
|
14450
|
-
...props,
|
|
14451
|
-
onCancel
|
|
14452
|
-
}), div);
|
|
14453
|
-
}
|
|
14454
|
-
const renderFunction = renderFunc || render2;
|
|
14455
|
-
let dialogConfig = {
|
|
14456
|
-
...config2,
|
|
14457
|
-
visible: false
|
|
14458
|
-
};
|
|
14459
|
-
const onOk = () => {
|
|
14460
|
-
let ret;
|
|
14461
|
-
const _onOk = config2.onOk || config2.onConfirm;
|
|
14462
|
-
if (_onOk) {
|
|
14463
|
-
ret = _onOk();
|
|
14464
|
-
}
|
|
14465
|
-
if (ret && ret.then) {
|
|
14466
|
-
renderFunction(dialogConfig);
|
|
14467
|
-
ret.then(
|
|
14468
|
-
() => {
|
|
14469
|
-
onCancel(true);
|
|
14470
|
-
},
|
|
14471
|
-
(e2) => {
|
|
14472
|
-
console.error(e2);
|
|
14473
|
-
renderFunction(dialogConfig);
|
|
14474
|
-
}
|
|
14475
|
-
);
|
|
14476
|
-
}
|
|
14477
|
-
if (!ret) {
|
|
14478
|
-
onCancel(true);
|
|
14479
|
-
}
|
|
14480
|
-
};
|
|
14481
|
-
dialogConfig.onOk = onOk;
|
|
14482
|
-
dialogConfig = normalizeConfig(dialogConfig);
|
|
14483
|
-
dialogConfig.visible = true;
|
|
14484
|
-
renderFunction(dialogConfig);
|
|
14485
|
-
function destroy() {
|
|
14486
|
-
const unmountEle = ReactDOM__default.unmountComponentAtNode(div);
|
|
14487
|
-
if (unmountEle && div.parentNode) {
|
|
14488
|
-
div.parentNode.removeChild(div);
|
|
14489
|
-
}
|
|
14490
|
-
}
|
|
14491
|
-
function onCancel(isOnOk) {
|
|
14492
|
-
!isOnOk && config2.onCancel && config2.onCancel();
|
|
14493
|
-
dialogConfig.visible = false;
|
|
14494
|
-
dialogConfig.onClosed = () => {
|
|
14495
|
-
config2.onClosed && config2.onClosed();
|
|
14496
|
-
destroy();
|
|
14497
|
-
};
|
|
14498
|
-
renderFunction(dialogConfig);
|
|
14499
|
-
}
|
|
14500
|
-
function update2(newConfig) {
|
|
14501
|
-
dialogConfig = {
|
|
14502
|
-
...dialogConfig,
|
|
14503
|
-
title: config2.title,
|
|
14504
|
-
...newConfig
|
|
14505
|
-
};
|
|
14506
|
-
dialogConfig = normalizeConfig(dialogConfig);
|
|
14507
|
-
renderFunction(dialogConfig);
|
|
14508
|
-
}
|
|
14509
|
-
function close() {
|
|
14510
|
-
dialogConfig.visible = false;
|
|
14511
|
-
dialogConfig.onClosed = () => {
|
|
14512
|
-
config2.onClosed && config2.onClosed();
|
|
14513
|
-
destroy();
|
|
14514
|
-
};
|
|
14515
|
-
renderFunction(dialogConfig);
|
|
14516
|
-
}
|
|
14517
|
-
return {
|
|
14518
|
-
close,
|
|
14519
|
-
update: update2
|
|
14520
|
-
};
|
|
14521
|
-
}
|
|
14522
|
-
const defaultProps$C = {
|
|
14523
|
-
okText: "",
|
|
14524
|
-
cancelText: "",
|
|
14525
|
-
mask: true,
|
|
14526
|
-
closeOnClickOverlay: true,
|
|
14527
|
-
noFooter: false,
|
|
14528
|
-
noOkBtn: false,
|
|
14529
|
-
noCancelBtn: false,
|
|
14530
|
-
okBtnDisabled: false,
|
|
14531
|
-
cancelAutoClose: true,
|
|
14532
|
-
textAlign: "center",
|
|
14533
|
-
footerDirection: "horizontal",
|
|
14534
|
-
lockScroll: false
|
|
14535
|
-
};
|
|
14536
|
-
const BaseDialog = (props, ref) => {
|
|
14537
|
-
const { locale } = useConfig$1();
|
|
14232
|
+
const BaseDialog = (props, ref) => {
|
|
14233
|
+
const { locale } = useConfig$1();
|
|
14538
14234
|
const {
|
|
14539
14235
|
visible,
|
|
14540
14236
|
footer,
|
|
@@ -14571,13 +14267,13 @@ const BaseDialog = (props, ref) => {
|
|
|
14571
14267
|
document.body.classList.remove("nut-overflow-hidden");
|
|
14572
14268
|
}
|
|
14573
14269
|
};
|
|
14574
|
-
const footerContent = footer || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !noCancelBtn && /* @__PURE__ */ React__default.createElement(Button
|
|
14270
|
+
const footerContent = footer || /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !noCancelBtn && /* @__PURE__ */ React__default.createElement(Button, {
|
|
14575
14271
|
size: "small",
|
|
14576
14272
|
plain: true,
|
|
14577
14273
|
type: "primary",
|
|
14578
14274
|
className: "nut-dialog__footer-cancel",
|
|
14579
14275
|
onClick: (e2) => handleCancel(e2)
|
|
14580
|
-
}, cancelText || locale.cancel), !noOkBtn && /* @__PURE__ */ React__default.createElement(Button
|
|
14276
|
+
}, cancelText || locale.cancel), !noOkBtn && /* @__PURE__ */ React__default.createElement(Button, {
|
|
14581
14277
|
size: "small",
|
|
14582
14278
|
type: "primary",
|
|
14583
14279
|
className: classNames("nut-dialog__footer-ok", {
|
|
@@ -14585,7 +14281,7 @@ const BaseDialog = (props, ref) => {
|
|
|
14585
14281
|
}),
|
|
14586
14282
|
disabled: okBtnDisabled,
|
|
14587
14283
|
onClick: (e2) => handleOk(e2)
|
|
14588
|
-
}, okText
|
|
14284
|
+
}, okText));
|
|
14589
14285
|
return footerContent;
|
|
14590
14286
|
};
|
|
14591
14287
|
return /* @__PURE__ */ React__default.createElement(DialogWrapper, {
|
|
@@ -14598,18 +14294,6 @@ const BaseDialog = (props, ref) => {
|
|
|
14598
14294
|
});
|
|
14599
14295
|
};
|
|
14600
14296
|
const Dialog = forwardRef(BaseDialog);
|
|
14601
|
-
Dialog.confirm = (props) => {
|
|
14602
|
-
return confirm(props);
|
|
14603
|
-
};
|
|
14604
|
-
["alert"].forEach((type) => {
|
|
14605
|
-
Dialog[type] = (props) => {
|
|
14606
|
-
return confirm({
|
|
14607
|
-
...props,
|
|
14608
|
-
isNotice: false,
|
|
14609
|
-
noticeType: type
|
|
14610
|
-
});
|
|
14611
|
-
};
|
|
14612
|
-
});
|
|
14613
14297
|
Dialog.defaultProps = defaultProps$C;
|
|
14614
14298
|
Dialog.displayName = "NutDialog";
|
|
14615
14299
|
var index_cjs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -14749,7 +14433,6 @@ const Infiniteloading = (props) => {
|
|
|
14749
14433
|
className: classes,
|
|
14750
14434
|
scrollY: true,
|
|
14751
14435
|
id: "scroller",
|
|
14752
|
-
style: { height: "100%" },
|
|
14753
14436
|
onScroll: scrollAction2,
|
|
14754
14437
|
onScrollToLower: lower,
|
|
14755
14438
|
onTouchStart: touchStart,
|
|
@@ -14787,211 +14470,103 @@ const Infiniteloading = (props) => {
|
|
|
14787
14470
|
};
|
|
14788
14471
|
Infiniteloading.defaultProps = defaultProps$B;
|
|
14789
14472
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
14790
|
-
|
|
14791
|
-
const { version } = ReactDOM;
|
|
14792
|
-
const reactDOMClone = {
|
|
14793
|
-
...ReactDOM
|
|
14794
|
-
};
|
|
14795
|
-
try {
|
|
14796
|
-
const mainVersion = Number((version || "").split(".")[0]);
|
|
14797
|
-
if (mainVersion >= 18) {
|
|
14798
|
-
createRoot = reactDOMClone.createRoot;
|
|
14799
|
-
}
|
|
14800
|
-
} catch (e2) {
|
|
14801
|
-
console.log(e2);
|
|
14802
|
-
}
|
|
14803
|
-
function legacyRender(node, container) {
|
|
14804
|
-
ReactDOM.render(node, container);
|
|
14805
|
-
}
|
|
14806
|
-
function concurrentRender(node, container) {
|
|
14807
|
-
if (createRoot) {
|
|
14808
|
-
const root = createRoot(container);
|
|
14809
|
-
root.render(node);
|
|
14810
|
-
}
|
|
14811
|
-
}
|
|
14812
|
-
function render(node, container) {
|
|
14813
|
-
if (createRoot) {
|
|
14814
|
-
concurrentRender(node, container);
|
|
14815
|
-
return;
|
|
14816
|
-
}
|
|
14817
|
-
legacyRender(node, container);
|
|
14818
|
-
}
|
|
14819
|
-
class Notification extends React.PureComponent {
|
|
14820
|
-
constructor(props) {
|
|
14821
|
-
super(props);
|
|
14822
|
-
this.close = this.close.bind(this);
|
|
14823
|
-
this.startCloseTimer = this.startCloseTimer.bind(this);
|
|
14824
|
-
this.clearCloseTimer = this.clearCloseTimer.bind(this);
|
|
14825
|
-
this.clickCover = this.clickCover.bind(this);
|
|
14826
|
-
this.state = {
|
|
14827
|
-
show: true
|
|
14828
|
-
};
|
|
14829
|
-
}
|
|
14830
|
-
close() {
|
|
14831
|
-
this.setState({
|
|
14832
|
-
show: false
|
|
14833
|
-
});
|
|
14834
|
-
this.clearCloseTimer();
|
|
14835
|
-
if (this.props.id) {
|
|
14836
|
-
const element = document.getElementById(this.props.id);
|
|
14837
|
-
element && element.parentNode && element.parentNode.removeChild(element);
|
|
14838
|
-
}
|
|
14839
|
-
this.props.onClosed();
|
|
14840
|
-
}
|
|
14841
|
-
startCloseTimer() {
|
|
14842
|
-
const { duration } = this.props;
|
|
14843
|
-
if (duration) {
|
|
14844
|
-
this.closeTimer = window.setTimeout(() => {
|
|
14845
|
-
this.close();
|
|
14846
|
-
}, duration);
|
|
14847
|
-
}
|
|
14848
|
-
}
|
|
14849
|
-
clearCloseTimer() {
|
|
14850
|
-
if (this.closeTimer) {
|
|
14851
|
-
clearTimeout(this.closeTimer);
|
|
14852
|
-
this.closeTimer = -1;
|
|
14853
|
-
}
|
|
14854
|
-
}
|
|
14855
|
-
clickCover() {
|
|
14856
|
-
this.props.onClick();
|
|
14857
|
-
}
|
|
14858
|
-
componentDidMount() {
|
|
14859
|
-
this.startCloseTimer();
|
|
14860
|
-
}
|
|
14861
|
-
componentWillUnmount() {
|
|
14862
|
-
this.clearCloseTimer();
|
|
14863
|
-
}
|
|
14864
|
-
render() {
|
|
14865
|
-
const {
|
|
14866
|
-
children,
|
|
14867
|
-
style,
|
|
14868
|
-
msg,
|
|
14869
|
-
color,
|
|
14870
|
-
background,
|
|
14871
|
-
type,
|
|
14872
|
-
className,
|
|
14873
|
-
position,
|
|
14874
|
-
isWrapTeleport
|
|
14875
|
-
} = this.props;
|
|
14876
|
-
this.state;
|
|
14877
|
-
cn("notify");
|
|
14878
|
-
const classes = classNames({
|
|
14879
|
-
"popup-top": position === "top",
|
|
14880
|
-
"popup-bottom": position === "bottom",
|
|
14881
|
-
"nut-notify": true,
|
|
14882
|
-
[`nut-notify--${type}`]: true
|
|
14883
|
-
});
|
|
14884
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CSSTransition$1, {
|
|
14885
|
-
in: this.state.show,
|
|
14886
|
-
timeout: 300,
|
|
14887
|
-
classNames: "fade",
|
|
14888
|
-
unmountOnExit: true,
|
|
14889
|
-
appear: true,
|
|
14890
|
-
position,
|
|
14891
|
-
isWrapTeleport
|
|
14892
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
14893
|
-
className: `${classes} ${className}`,
|
|
14894
|
-
style: {
|
|
14895
|
-
color: `${color || ""}`,
|
|
14896
|
-
background: `${background || ""}`
|
|
14897
|
-
},
|
|
14898
|
-
onClick: this.clickCover
|
|
14899
|
-
}, children || msg)));
|
|
14900
|
-
}
|
|
14901
|
-
}
|
|
14902
|
-
Notification.newInstance = (properties, callback) => {
|
|
14903
|
-
const element = document.createElement("div");
|
|
14904
|
-
const id = properties.id ? properties.id : `${new Date().getTime()}`;
|
|
14905
|
-
element.id = id;
|
|
14906
|
-
properties.id = id;
|
|
14907
|
-
document.body.appendChild(element);
|
|
14908
|
-
let called = false;
|
|
14909
|
-
function ref(instance) {
|
|
14910
|
-
if (called) {
|
|
14911
|
-
return;
|
|
14912
|
-
}
|
|
14913
|
-
called = true;
|
|
14914
|
-
callback({
|
|
14915
|
-
component: instance,
|
|
14916
|
-
destroy() {
|
|
14917
|
-
setTimeout(() => {
|
|
14918
|
-
ReactDOM.unmountComponentAtNode(element);
|
|
14919
|
-
element && element.parentNode && element.parentNode.removeChild(element);
|
|
14920
|
-
}, 300);
|
|
14921
|
-
}
|
|
14922
|
-
});
|
|
14923
|
-
}
|
|
14924
|
-
render(/* @__PURE__ */ React.createElement(Notification, {
|
|
14925
|
-
...properties,
|
|
14926
|
-
ref
|
|
14927
|
-
}), element);
|
|
14928
|
-
};
|
|
14929
|
-
let messageInstance = null;
|
|
14930
|
-
const options = {
|
|
14931
|
-
msg: "",
|
|
14473
|
+
const defaultProps$A = {
|
|
14932
14474
|
id: "",
|
|
14933
|
-
|
|
14475
|
+
msg: "",
|
|
14934
14476
|
color: "",
|
|
14477
|
+
duration: 3e3,
|
|
14935
14478
|
type: "danger",
|
|
14936
14479
|
className: "",
|
|
14480
|
+
background: "",
|
|
14937
14481
|
position: "top",
|
|
14938
14482
|
isWrapTeleport: true,
|
|
14483
|
+
visible: false,
|
|
14939
14484
|
onClosed: () => {
|
|
14940
14485
|
},
|
|
14941
14486
|
onClick: () => {
|
|
14942
14487
|
}
|
|
14943
14488
|
};
|
|
14944
|
-
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
14957
|
-
|
|
14958
|
-
|
|
14959
|
-
|
|
14960
|
-
|
|
14961
|
-
|
|
14962
|
-
|
|
14963
|
-
|
|
14964
|
-
|
|
14965
|
-
|
|
14966
|
-
|
|
14967
|
-
|
|
14968
|
-
|
|
14969
|
-
|
|
14970
|
-
},
|
|
14971
|
-
success(msg, option = {}) {
|
|
14972
|
-
errorMsg(msg);
|
|
14973
|
-
return notice({ msg, type: "success", ...option });
|
|
14974
|
-
},
|
|
14975
|
-
primary(msg, option = {}) {
|
|
14976
|
-
errorMsg(msg);
|
|
14977
|
-
return notice({ msg, type: "primary", ...option });
|
|
14978
|
-
},
|
|
14979
|
-
danger(msg, option = {}) {
|
|
14980
|
-
errorMsg(msg);
|
|
14981
|
-
return notice({ msg, type: "danger", ...option });
|
|
14982
|
-
},
|
|
14983
|
-
warn(msg, option = {}) {
|
|
14984
|
-
errorMsg(msg);
|
|
14985
|
-
return notice({ msg, type: "warning", ...option });
|
|
14986
|
-
},
|
|
14987
|
-
hide() {
|
|
14988
|
-
if (messageInstance) {
|
|
14989
|
-
messageInstance.destroy();
|
|
14990
|
-
messageInstance = null;
|
|
14489
|
+
const Notify = (props) => {
|
|
14490
|
+
const {
|
|
14491
|
+
id,
|
|
14492
|
+
children,
|
|
14493
|
+
style,
|
|
14494
|
+
msg,
|
|
14495
|
+
color,
|
|
14496
|
+
background,
|
|
14497
|
+
type,
|
|
14498
|
+
className,
|
|
14499
|
+
position,
|
|
14500
|
+
isWrapTeleport,
|
|
14501
|
+
visible,
|
|
14502
|
+
duration,
|
|
14503
|
+
onClosed,
|
|
14504
|
+
onClick,
|
|
14505
|
+
...rest
|
|
14506
|
+
} = { ...defaultProps$A, ...props };
|
|
14507
|
+
let timer;
|
|
14508
|
+
const [showNotify, SetShow] = useState(false);
|
|
14509
|
+
useEffect(() => {
|
|
14510
|
+
if (visible) {
|
|
14511
|
+
SetShow(true);
|
|
14512
|
+
show();
|
|
14513
|
+
} else {
|
|
14514
|
+
hide();
|
|
14991
14515
|
}
|
|
14992
|
-
}
|
|
14516
|
+
}, [visible]);
|
|
14517
|
+
const clickHandle = () => {
|
|
14518
|
+
onClick();
|
|
14519
|
+
};
|
|
14520
|
+
const show = () => {
|
|
14521
|
+
clearTimer();
|
|
14522
|
+
if (duration) {
|
|
14523
|
+
timer = setTimeout(() => {
|
|
14524
|
+
hide();
|
|
14525
|
+
}, duration);
|
|
14526
|
+
}
|
|
14527
|
+
};
|
|
14528
|
+
const clearTimer = () => {
|
|
14529
|
+
if (timer) {
|
|
14530
|
+
clearTimeout(timer);
|
|
14531
|
+
timer = null;
|
|
14532
|
+
}
|
|
14533
|
+
};
|
|
14534
|
+
const hide = () => {
|
|
14535
|
+
SetShow(false);
|
|
14536
|
+
if (id) {
|
|
14537
|
+
const element = document.getElementById(id);
|
|
14538
|
+
element && element.parentNode && element.parentNode.removeChild(element);
|
|
14539
|
+
}
|
|
14540
|
+
onClosed();
|
|
14541
|
+
};
|
|
14542
|
+
cn("notify");
|
|
14543
|
+
const classes = classNames({
|
|
14544
|
+
"popup-top": position === "top",
|
|
14545
|
+
"popup-bottom": position === "bottom",
|
|
14546
|
+
"nut-notify": true,
|
|
14547
|
+
[`nut-notify--${type}`]: true
|
|
14548
|
+
});
|
|
14549
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(CSSTransition$1, {
|
|
14550
|
+
in: showNotify,
|
|
14551
|
+
timeout: 300,
|
|
14552
|
+
classNames: "fade",
|
|
14553
|
+
unmountOnExit: true,
|
|
14554
|
+
appear: true,
|
|
14555
|
+
position,
|
|
14556
|
+
isWrapTeleport,
|
|
14557
|
+
id
|
|
14558
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14559
|
+
className: `${classes} ${className}`,
|
|
14560
|
+
style: {
|
|
14561
|
+
color: `${color || ""}`,
|
|
14562
|
+
background: `${background || ""}`
|
|
14563
|
+
},
|
|
14564
|
+
onClick: clickHandle
|
|
14565
|
+
}, children || msg)));
|
|
14993
14566
|
};
|
|
14994
|
-
|
|
14567
|
+
Notify.defaultProps = defaultProps$A;
|
|
14568
|
+
Notify.displayName = "NutNotify";
|
|
14569
|
+
const defaultProps$z = {
|
|
14995
14570
|
isAsync: false,
|
|
14996
14571
|
checked: false,
|
|
14997
14572
|
disable: false,
|
|
@@ -15014,7 +14589,7 @@ const Switch = (props) => {
|
|
|
15014
14589
|
className,
|
|
15015
14590
|
style
|
|
15016
14591
|
} = {
|
|
15017
|
-
...defaultProps$
|
|
14592
|
+
...defaultProps$z,
|
|
15018
14593
|
...props
|
|
15019
14594
|
};
|
|
15020
14595
|
const [value, setValue] = useState(false);
|
|
@@ -15054,7 +14629,7 @@ const Switch = (props) => {
|
|
|
15054
14629
|
className: `${b2("label")} close`
|
|
15055
14630
|
}, inactiveText))));
|
|
15056
14631
|
};
|
|
15057
|
-
Switch.defaultProps = defaultProps$
|
|
14632
|
+
Switch.defaultProps = defaultProps$z;
|
|
15058
14633
|
Switch.displayName = "NutSwitch";
|
|
15059
14634
|
function preventDefault(event, isStopPropagation) {
|
|
15060
14635
|
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
@@ -15064,7 +14639,7 @@ function preventDefault(event, isStopPropagation) {
|
|
|
15064
14639
|
event.stopPropagation();
|
|
15065
14640
|
}
|
|
15066
14641
|
}
|
|
15067
|
-
const defaultProps$
|
|
14642
|
+
const defaultProps$y = {
|
|
15068
14643
|
name: "",
|
|
15069
14644
|
leftWidth: 0,
|
|
15070
14645
|
rightWidth: 0
|
|
@@ -15072,7 +14647,7 @@ const defaultProps$z = {
|
|
|
15072
14647
|
const Swipe = forwardRef((props, instanceRef) => {
|
|
15073
14648
|
const swipeBem = cn("swipe");
|
|
15074
14649
|
const touch = useTouch();
|
|
15075
|
-
const { children, className, style } = { ...defaultProps$
|
|
14650
|
+
const { children, className, style } = { ...defaultProps$y, ...props };
|
|
15076
14651
|
const root = useRef();
|
|
15077
14652
|
const opened = useRef(false);
|
|
15078
14653
|
const lockClick = useRef(false);
|
|
@@ -15238,7 +14813,7 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
15238
14813
|
style: wrapperStyle
|
|
15239
14814
|
}, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef)));
|
|
15240
14815
|
});
|
|
15241
|
-
Swipe.defaultProps = defaultProps$
|
|
14816
|
+
Swipe.defaultProps = defaultProps$y;
|
|
15242
14817
|
Swipe.displayName = "NutSwipe";
|
|
15243
14818
|
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
15244
14819
|
const defaultRoot = canUseDom ? window : void 0;
|
|
@@ -15297,7 +14872,7 @@ if (canUseDom) {
|
|
|
15297
14872
|
console.log(e2);
|
|
15298
14873
|
}
|
|
15299
14874
|
}
|
|
15300
|
-
const defaultProps$
|
|
14875
|
+
const defaultProps$x = {
|
|
15301
14876
|
pullingText: "",
|
|
15302
14877
|
canReleaseText: "",
|
|
15303
14878
|
refreshingText: "",
|
|
@@ -15312,7 +14887,7 @@ const defaultProps$y = {
|
|
|
15312
14887
|
const PullToRefresh = (p2) => {
|
|
15313
14888
|
const { locale } = useConfig$1();
|
|
15314
14889
|
const props = {
|
|
15315
|
-
...defaultProps$
|
|
14890
|
+
...defaultProps$x,
|
|
15316
14891
|
...p2,
|
|
15317
14892
|
...{
|
|
15318
14893
|
pullingText: p2.pullingText || locale.pullToRefresh.pullingText,
|
|
@@ -15451,10 +15026,10 @@ const PullToRefresh = (p2) => {
|
|
|
15451
15026
|
className: "nut-pulltorefresh-content"
|
|
15452
15027
|
}, props.children));
|
|
15453
15028
|
};
|
|
15454
|
-
PullToRefresh.defaultProps = defaultProps$
|
|
15029
|
+
PullToRefresh.defaultProps = defaultProps$x;
|
|
15455
15030
|
PullToRefresh.displayName = "NutPullToRefresh";
|
|
15456
15031
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
15457
|
-
const defaultProps$
|
|
15032
|
+
const defaultProps$w = {
|
|
15458
15033
|
strokeWidth: 5,
|
|
15459
15034
|
radius: 50,
|
|
15460
15035
|
strokeLinecap: "round",
|
|
@@ -15476,7 +15051,7 @@ const CircleProgress = (props) => {
|
|
|
15476
15051
|
strokeLinecap,
|
|
15477
15052
|
...restProps
|
|
15478
15053
|
} = {
|
|
15479
|
-
...defaultProps$
|
|
15054
|
+
...defaultProps$w,
|
|
15480
15055
|
...props
|
|
15481
15056
|
};
|
|
15482
15057
|
const [oldValue, setOldValue] = useState(progress);
|
|
@@ -15587,9 +15162,9 @@ const CircleProgress = (props) => {
|
|
|
15587
15162
|
className: "nut-circleprogress-text"
|
|
15588
15163
|
}, children || /* @__PURE__ */ React__default.createElement("div", null, progress, "%")));
|
|
15589
15164
|
};
|
|
15590
|
-
CircleProgress.defaultProps = defaultProps$
|
|
15165
|
+
CircleProgress.defaultProps = defaultProps$w;
|
|
15591
15166
|
CircleProgress.displayName = "NutCircleProgress";
|
|
15592
|
-
const defaultProps$
|
|
15167
|
+
const defaultProps$v = {
|
|
15593
15168
|
...ComponentDefaults,
|
|
15594
15169
|
direction: "across",
|
|
15595
15170
|
list: [],
|
|
@@ -15631,7 +15206,7 @@ const NoticeBar = (props) => {
|
|
|
15631
15206
|
iconClassPrefix,
|
|
15632
15207
|
iconFontClassName
|
|
15633
15208
|
} = {
|
|
15634
|
-
...defaultProps$
|
|
15209
|
+
...defaultProps$v,
|
|
15635
15210
|
...props
|
|
15636
15211
|
};
|
|
15637
15212
|
const wrap = useRef(null);
|
|
@@ -15880,16 +15455,16 @@ const NoticeBar = (props) => {
|
|
|
15880
15455
|
size: "11px"
|
|
15881
15456
|
}) : null))) : null);
|
|
15882
15457
|
};
|
|
15883
|
-
NoticeBar.defaultProps = defaultProps$
|
|
15458
|
+
NoticeBar.defaultProps = defaultProps$v;
|
|
15884
15459
|
NoticeBar.displayName = "NutNoticeBar";
|
|
15885
15460
|
const DataContext$1 = createContext({});
|
|
15886
|
-
const defaultProps$
|
|
15461
|
+
const defaultProps$u = {
|
|
15887
15462
|
current: 0,
|
|
15888
15463
|
direction: "horizontal",
|
|
15889
15464
|
progressDot: false
|
|
15890
15465
|
};
|
|
15891
15466
|
const Steps = (props) => {
|
|
15892
|
-
const propSteps = { ...defaultProps$
|
|
15467
|
+
const propSteps = { ...defaultProps$u, ...props };
|
|
15893
15468
|
const {
|
|
15894
15469
|
children,
|
|
15895
15470
|
current,
|
|
@@ -15922,9 +15497,9 @@ const Steps = (props) => {
|
|
|
15922
15497
|
children
|
|
15923
15498
|
));
|
|
15924
15499
|
};
|
|
15925
|
-
Steps.defaultProps = defaultProps$
|
|
15500
|
+
Steps.defaultProps = defaultProps$u;
|
|
15926
15501
|
Steps.displayName = "NutSteps";
|
|
15927
|
-
const defaultProps$
|
|
15502
|
+
const defaultProps$t = {
|
|
15928
15503
|
...ComponentDefaults,
|
|
15929
15504
|
title: "",
|
|
15930
15505
|
content: "",
|
|
@@ -15948,7 +15523,7 @@ const Step = (props) => {
|
|
|
15948
15523
|
iconFontClassName,
|
|
15949
15524
|
...restProps
|
|
15950
15525
|
} = {
|
|
15951
|
-
...defaultProps$
|
|
15526
|
+
...defaultProps$t,
|
|
15952
15527
|
...props
|
|
15953
15528
|
};
|
|
15954
15529
|
const parent = useContext$1(DataContext$1);
|
|
@@ -16011,10 +15586,10 @@ const Step = (props) => {
|
|
|
16011
15586
|
className: "nut-step-content"
|
|
16012
15587
|
}, renderContent())));
|
|
16013
15588
|
};
|
|
16014
|
-
Step.defaultProps = defaultProps$
|
|
15589
|
+
Step.defaultProps = defaultProps$t;
|
|
16015
15590
|
Step.displayName = "NutStep";
|
|
16016
15591
|
const DataContext = createContext({});
|
|
16017
|
-
const defaultProps$
|
|
15592
|
+
const defaultProps$s = {
|
|
16018
15593
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
16019
15594
|
height: 0,
|
|
16020
15595
|
duration: 500,
|
|
@@ -16032,7 +15607,7 @@ const defaultProps$t = {
|
|
|
16032
15607
|
};
|
|
16033
15608
|
const DISTANCE = 5;
|
|
16034
15609
|
const Swiper = React__default.forwardRef((props, ref) => {
|
|
16035
|
-
const propSwiper = { ...defaultProps$
|
|
15610
|
+
const propSwiper = { ...defaultProps$s, ...props };
|
|
16036
15611
|
const {
|
|
16037
15612
|
children,
|
|
16038
15613
|
direction,
|
|
@@ -16383,7 +15958,9 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
16383
15958
|
autoplay();
|
|
16384
15959
|
}, [children]);
|
|
16385
15960
|
useEffect(() => {
|
|
16386
|
-
|
|
15961
|
+
nextTick(() => {
|
|
15962
|
+
init();
|
|
15963
|
+
});
|
|
16387
15964
|
}, [propSwiper.initPage]);
|
|
16388
15965
|
useEffect(() => {
|
|
16389
15966
|
return () => {
|
|
@@ -16451,13 +16028,13 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
16451
16028
|
});
|
|
16452
16029
|
})) : /* @__PURE__ */ React__default.createElement("div", null, pageContent)));
|
|
16453
16030
|
});
|
|
16454
|
-
Swiper.defaultProps = defaultProps$
|
|
16031
|
+
Swiper.defaultProps = defaultProps$s;
|
|
16455
16032
|
Swiper.displayName = "NutSwiper";
|
|
16456
|
-
const defaultProps$
|
|
16033
|
+
const defaultProps$r = {
|
|
16457
16034
|
direction: "horizontal"
|
|
16458
16035
|
};
|
|
16459
16036
|
const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
16460
|
-
const _props = { ...defaultProps$
|
|
16037
|
+
const _props = { ...defaultProps$r, ...props };
|
|
16461
16038
|
const { children, direction, size } = _props;
|
|
16462
16039
|
const parent = useContext$1(DataContext);
|
|
16463
16040
|
const b2 = cn("swiper-item");
|
|
@@ -16476,10 +16053,10 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
|
16476
16053
|
style: style()
|
|
16477
16054
|
}, children);
|
|
16478
16055
|
});
|
|
16479
|
-
SwiperItem.defaultProps = defaultProps$
|
|
16056
|
+
SwiperItem.defaultProps = defaultProps$r;
|
|
16480
16057
|
SwiperItem.displayName = "NutSwiperItem";
|
|
16481
16058
|
const AvatarContext = createContext({});
|
|
16482
|
-
const defaultProps$
|
|
16059
|
+
const defaultProps$q = {
|
|
16483
16060
|
...ComponentDefaults,
|
|
16484
16061
|
size: "",
|
|
16485
16062
|
icon: "",
|
|
@@ -16509,7 +16086,7 @@ const Avatar = (props) => {
|
|
|
16509
16086
|
iconFontClassName,
|
|
16510
16087
|
...rest
|
|
16511
16088
|
} = {
|
|
16512
|
-
...defaultProps$
|
|
16089
|
+
...defaultProps$q,
|
|
16513
16090
|
...props
|
|
16514
16091
|
};
|
|
16515
16092
|
const [maxSum, setMaxSum] = useState(0);
|
|
@@ -16596,9 +16173,9 @@ const Avatar = (props) => {
|
|
|
16596
16173
|
className: "text"
|
|
16597
16174
|
}, ((_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)}`)));
|
|
16598
16175
|
};
|
|
16599
|
-
Avatar.defaultProps = defaultProps$
|
|
16176
|
+
Avatar.defaultProps = defaultProps$q;
|
|
16600
16177
|
Avatar.displayName = "NutAvatar";
|
|
16601
|
-
const defaultProps$
|
|
16178
|
+
const defaultProps$p = {
|
|
16602
16179
|
maxContent: "",
|
|
16603
16180
|
maxCount: "",
|
|
16604
16181
|
maxBgColor: "#eee",
|
|
@@ -16610,7 +16187,7 @@ const defaultProps$q = {
|
|
|
16610
16187
|
};
|
|
16611
16188
|
const AvatarGroup = (props) => {
|
|
16612
16189
|
useConfig();
|
|
16613
|
-
const propAvatarGroup = { ...defaultProps$
|
|
16190
|
+
const propAvatarGroup = { ...defaultProps$p, ...props };
|
|
16614
16191
|
const { className, style, children } = propAvatarGroup;
|
|
16615
16192
|
const avatarGroupRef = useRef(null);
|
|
16616
16193
|
const b2 = cn("avatar-group");
|
|
@@ -16627,9 +16204,9 @@ const AvatarGroup = (props) => {
|
|
|
16627
16204
|
ref: avatarGroupRef
|
|
16628
16205
|
}, children));
|
|
16629
16206
|
};
|
|
16630
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
16207
|
+
AvatarGroup.defaultProps = defaultProps$p;
|
|
16631
16208
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
16632
|
-
const defaultProps$
|
|
16209
|
+
const defaultProps$o = {
|
|
16633
16210
|
price: 0,
|
|
16634
16211
|
needSymbol: true,
|
|
16635
16212
|
symbol: "¥",
|
|
@@ -16647,7 +16224,7 @@ const Price = (props) => {
|
|
|
16647
16224
|
className,
|
|
16648
16225
|
...rest
|
|
16649
16226
|
} = {
|
|
16650
|
-
...defaultProps$
|
|
16227
|
+
...defaultProps$o,
|
|
16651
16228
|
...props
|
|
16652
16229
|
};
|
|
16653
16230
|
const b2 = cn("price");
|
|
@@ -16710,9 +16287,9 @@ const Price = (props) => {
|
|
|
16710
16287
|
className: `${b2("small")}`
|
|
16711
16288
|
}, formatDecimal(price)));
|
|
16712
16289
|
};
|
|
16713
|
-
Price.defaultProps = defaultProps$
|
|
16290
|
+
Price.defaultProps = defaultProps$o;
|
|
16714
16291
|
Price.displayName = "NutPrice";
|
|
16715
|
-
const defaultProps$
|
|
16292
|
+
const defaultProps$n = {
|
|
16716
16293
|
...ComponentDefaults,
|
|
16717
16294
|
value: "",
|
|
16718
16295
|
dot: false,
|
|
@@ -16735,7 +16312,7 @@ const Badge = (props) => {
|
|
|
16735
16312
|
iconClassPrefix,
|
|
16736
16313
|
iconFontClassName
|
|
16737
16314
|
} = {
|
|
16738
|
-
...defaultProps$
|
|
16315
|
+
...defaultProps$n,
|
|
16739
16316
|
...props
|
|
16740
16317
|
};
|
|
16741
16318
|
function content() {
|
|
@@ -16772,9 +16349,9 @@ const Badge = (props) => {
|
|
|
16772
16349
|
style: getStyle()
|
|
16773
16350
|
}, content()));
|
|
16774
16351
|
};
|
|
16775
|
-
Badge.defaultProps = defaultProps$
|
|
16352
|
+
Badge.defaultProps = defaultProps$n;
|
|
16776
16353
|
Badge.displayName = "NutBadge";
|
|
16777
|
-
const defaultProps$
|
|
16354
|
+
const defaultProps$m = {
|
|
16778
16355
|
...ComponentDefaults,
|
|
16779
16356
|
type: "default",
|
|
16780
16357
|
color: "",
|
|
@@ -16805,7 +16382,7 @@ const Tag = (props) => {
|
|
|
16805
16382
|
iconClassPrefix,
|
|
16806
16383
|
iconFontClassName
|
|
16807
16384
|
} = {
|
|
16808
|
-
...defaultProps$
|
|
16385
|
+
...defaultProps$m,
|
|
16809
16386
|
...props
|
|
16810
16387
|
};
|
|
16811
16388
|
const [btnName, setBtnName] = useState("");
|
|
@@ -16879,7 +16456,7 @@ const Tag = (props) => {
|
|
|
16879
16456
|
className: "text"
|
|
16880
16457
|
}, children)));
|
|
16881
16458
|
};
|
|
16882
|
-
Tag.defaultProps = defaultProps$
|
|
16459
|
+
Tag.defaultProps = defaultProps$m;
|
|
16883
16460
|
Tag.displayName = "NutTag";
|
|
16884
16461
|
function fillRef(ref, node) {
|
|
16885
16462
|
if (typeof ref === "function") {
|
|
@@ -16923,7 +16500,7 @@ class Trigger extends React__default.Component {
|
|
|
16923
16500
|
return trigger;
|
|
16924
16501
|
}
|
|
16925
16502
|
}
|
|
16926
|
-
const defaultProps$
|
|
16503
|
+
const defaultProps$l = {
|
|
16927
16504
|
...ComponentDefaults,
|
|
16928
16505
|
list: [],
|
|
16929
16506
|
theme: "light",
|
|
@@ -16952,7 +16529,7 @@ const Popover = (props) => {
|
|
|
16952
16529
|
iconFontClassName,
|
|
16953
16530
|
...reset
|
|
16954
16531
|
} = {
|
|
16955
|
-
...defaultProps$
|
|
16532
|
+
...defaultProps$l,
|
|
16956
16533
|
...props
|
|
16957
16534
|
};
|
|
16958
16535
|
const goodItem = useRef(null);
|
|
@@ -17047,9 +16624,9 @@ const Popover = (props) => {
|
|
|
17047
16624
|
style: { background: "transparent" }
|
|
17048
16625
|
}) : "");
|
|
17049
16626
|
};
|
|
17050
|
-
Popover.defaultProps = defaultProps$
|
|
16627
|
+
Popover.defaultProps = defaultProps$l;
|
|
17051
16628
|
Popover.displayName = "NutPopover";
|
|
17052
|
-
const defaultProps$
|
|
16629
|
+
const defaultProps$k = {
|
|
17053
16630
|
width: "100px",
|
|
17054
16631
|
height: "100px",
|
|
17055
16632
|
row: 1,
|
|
@@ -17077,7 +16654,7 @@ const Skeleton = (props) => {
|
|
|
17077
16654
|
avatarShape,
|
|
17078
16655
|
...restProps
|
|
17079
16656
|
} = {
|
|
17080
|
-
...defaultProps$
|
|
16657
|
+
...defaultProps$k,
|
|
17081
16658
|
...props
|
|
17082
16659
|
};
|
|
17083
16660
|
const b2 = cn("skeleton");
|
|
@@ -17132,9 +16709,9 @@ const Skeleton = (props) => {
|
|
|
17132
16709
|
});
|
|
17133
16710
|
})))));
|
|
17134
16711
|
};
|
|
17135
|
-
Skeleton.defaultProps = defaultProps$
|
|
16712
|
+
Skeleton.defaultProps = defaultProps$k;
|
|
17136
16713
|
Skeleton.displayName = "NutSkeleton";
|
|
17137
|
-
const defaultProps$
|
|
16714
|
+
const defaultProps$j = {
|
|
17138
16715
|
paused: false,
|
|
17139
16716
|
startTime: Date.now(),
|
|
17140
16717
|
endTime: Date.now(),
|
|
@@ -17161,7 +16738,7 @@ const InternalCountDown = (props, ref) => {
|
|
|
17161
16738
|
onUpdate,
|
|
17162
16739
|
children,
|
|
17163
16740
|
...rest
|
|
17164
|
-
} = { ...defaultProps$
|
|
16741
|
+
} = { ...defaultProps$j, ...props };
|
|
17165
16742
|
const b2 = cn("countdown");
|
|
17166
16743
|
const [restTimeStamp, setRestTime] = useState(0);
|
|
17167
16744
|
const stateRef = useRef({
|
|
@@ -17357,9 +16934,9 @@ const InternalCountDown = (props, ref) => {
|
|
|
17357
16934
|
}));
|
|
17358
16935
|
};
|
|
17359
16936
|
const CountDown = React__default.forwardRef(InternalCountDown);
|
|
17360
|
-
CountDown.defaultProps = defaultProps$
|
|
16937
|
+
CountDown.defaultProps = defaultProps$j;
|
|
17361
16938
|
CountDown.displayName = "NutCountDown";
|
|
17362
|
-
const defaultProps$
|
|
16939
|
+
const defaultProps$i = {
|
|
17363
16940
|
activeName: ["0"],
|
|
17364
16941
|
accordion: false,
|
|
17365
16942
|
icon: "",
|
|
@@ -17382,7 +16959,7 @@ const Collapse = memo(
|
|
|
17382
16959
|
iconColor,
|
|
17383
16960
|
change
|
|
17384
16961
|
} = {
|
|
17385
|
-
...defaultProps$
|
|
16962
|
+
...defaultProps$i,
|
|
17386
16963
|
...props
|
|
17387
16964
|
};
|
|
17388
16965
|
const childrenDom = React__default.Children.toArray(children);
|
|
@@ -17439,9 +17016,9 @@ const Collapse = memo(
|
|
|
17439
17016
|
},
|
|
17440
17017
|
areEqual
|
|
17441
17018
|
);
|
|
17442
|
-
Collapse.defaultProps = defaultProps$
|
|
17019
|
+
Collapse.defaultProps = defaultProps$i;
|
|
17443
17020
|
Collapse.displayName = "NutCollapse";
|
|
17444
|
-
const defaultProps$
|
|
17021
|
+
const defaultProps$h = {
|
|
17445
17022
|
...ComponentDefaults,
|
|
17446
17023
|
title: "",
|
|
17447
17024
|
name: "",
|
|
@@ -17480,7 +17057,7 @@ const CollapseItem = (props) => {
|
|
|
17480
17057
|
iconFontClassName,
|
|
17481
17058
|
...rest
|
|
17482
17059
|
} = {
|
|
17483
|
-
...defaultProps$
|
|
17060
|
+
...defaultProps$h,
|
|
17484
17061
|
...props
|
|
17485
17062
|
};
|
|
17486
17063
|
const [domHeight, setDomHeight] = useState(-1);
|
|
@@ -17560,9 +17137,9 @@ const CollapseItem = (props) => {
|
|
|
17560
17137
|
className: colBem("content-text")
|
|
17561
17138
|
}, children)));
|
|
17562
17139
|
};
|
|
17563
|
-
CollapseItem.defaultProps = defaultProps$
|
|
17140
|
+
CollapseItem.defaultProps = defaultProps$h;
|
|
17564
17141
|
CollapseItem.displayName = "NutCollapseItem";
|
|
17565
|
-
const defaultProps$
|
|
17142
|
+
const defaultProps$g = {
|
|
17566
17143
|
maxLen: 0,
|
|
17567
17144
|
endNumber: "",
|
|
17568
17145
|
delaySpeed: 300,
|
|
@@ -17580,7 +17157,7 @@ const CountUp = (props) => {
|
|
|
17580
17157
|
thousands,
|
|
17581
17158
|
...reset
|
|
17582
17159
|
} = {
|
|
17583
|
-
...defaultProps$
|
|
17160
|
+
...defaultProps$g,
|
|
17584
17161
|
...props
|
|
17585
17162
|
};
|
|
17586
17163
|
const b2 = cn("countup");
|
|
@@ -17593,39 +17170,47 @@ const CountUp = (props) => {
|
|
|
17593
17170
|
const currNumber = `${thousands ? intNumber.replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") : intNumber}${splitArr[1] ? "." : ""}${splitArr[1] || ""}`;
|
|
17594
17171
|
return currNumber.split("");
|
|
17595
17172
|
};
|
|
17596
|
-
const numerArr =
|
|
17173
|
+
const [numerArr, setNumerArr] = useState([]);
|
|
17174
|
+
const [transformArr, setTransformArr] = useState([]);
|
|
17175
|
+
const isLoaded = useRef(false);
|
|
17597
17176
|
const setNumberTransform = () => {
|
|
17598
|
-
if (countupRef.current) {
|
|
17599
|
-
Taro.createSelectorQuery().selectAll(".nut-
|
|
17600
|
-
const
|
|
17601
|
-
(item) => !Number.isNaN(Number(item))
|
|
17602
|
-
);
|
|
17177
|
+
if (countupRef.current && numerArr.length) {
|
|
17178
|
+
Taro.createSelectorQuery().selectAll(".nut-countup__listitem").node((numberItems) => {
|
|
17179
|
+
const transformArrCache = [];
|
|
17603
17180
|
Object.keys(numberItems).forEach((key) => {
|
|
17604
17181
|
const elem = numberItems[Number(key)];
|
|
17605
|
-
const idx = Number(
|
|
17606
|
-
if (
|
|
17607
|
-
const transform = `translate(0, -${(idx === 0 ? 10 : idx) * 5}%)
|
|
17608
|
-
|
|
17609
|
-
elem.style.webkitTransform = transform;
|
|
17182
|
+
const idx = Number(numerArr[Number(key)]);
|
|
17183
|
+
if (elem) {
|
|
17184
|
+
const transform = idx || idx === 0 ? `translate(0, -${(idx === 0 ? 10 : idx) * 5}%)` : "";
|
|
17185
|
+
transformArrCache.push(transform);
|
|
17610
17186
|
}
|
|
17611
17187
|
});
|
|
17188
|
+
setTransformArr([...transformArrCache]);
|
|
17612
17189
|
}).exec();
|
|
17613
17190
|
}
|
|
17614
17191
|
};
|
|
17615
|
-
const numberEaseStyle = {
|
|
17616
|
-
|
|
17192
|
+
const numberEaseStyle = (idx) => {
|
|
17193
|
+
return {
|
|
17194
|
+
transition: `transform ${easeSpeed}s ease-in-out`,
|
|
17195
|
+
transform: transformArr[idx] ? transformArr[idx] : null
|
|
17196
|
+
};
|
|
17617
17197
|
};
|
|
17618
17198
|
useEffect(() => {
|
|
17619
|
-
|
|
17620
|
-
|
|
17621
|
-
|
|
17199
|
+
setNumberTransform();
|
|
17200
|
+
}, [numerArr]);
|
|
17201
|
+
useEffect(() => {
|
|
17202
|
+
if (!isLoaded.current) {
|
|
17203
|
+
isLoaded.current = true;
|
|
17204
|
+
timerRef.current = window.setTimeout(() => {
|
|
17205
|
+
setNumerArr(getShowNumber());
|
|
17206
|
+
}, delaySpeed);
|
|
17207
|
+
} else {
|
|
17208
|
+
setNumerArr(getShowNumber());
|
|
17209
|
+
}
|
|
17622
17210
|
return () => {
|
|
17623
17211
|
window.clearTimeout(timerRef.current);
|
|
17624
17212
|
};
|
|
17625
|
-
}, []);
|
|
17626
|
-
useEffect(() => {
|
|
17627
|
-
setNumberTransform();
|
|
17628
|
-
}, [numerArr]);
|
|
17213
|
+
}, [endNumber]);
|
|
17629
17214
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
17630
17215
|
className: `${b2()} ${className}`,
|
|
17631
17216
|
ref: countupRef
|
|
@@ -17639,7 +17224,7 @@ const CountUp = (props) => {
|
|
|
17639
17224
|
key: idx
|
|
17640
17225
|
}, !Number.isNaN(Number(item)) ? /* @__PURE__ */ React__default.createElement("span", {
|
|
17641
17226
|
className: b2("number"),
|
|
17642
|
-
style: numberEaseStyle
|
|
17227
|
+
style: numberEaseStyle(idx)
|
|
17643
17228
|
}, [...numbers, ...numbers].map((number, subidx) => {
|
|
17644
17229
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
17645
17230
|
key: subidx
|
|
@@ -17649,9 +17234,9 @@ const CountUp = (props) => {
|
|
|
17649
17234
|
}, item));
|
|
17650
17235
|
})));
|
|
17651
17236
|
};
|
|
17652
|
-
CountUp.defaultProps = defaultProps$
|
|
17237
|
+
CountUp.defaultProps = defaultProps$g;
|
|
17653
17238
|
CountUp.displayName = "NutCountUp";
|
|
17654
|
-
const defaultProps$
|
|
17239
|
+
const defaultProps$f = {};
|
|
17655
17240
|
class AnimatingNumbers extends Component {
|
|
17656
17241
|
constructor(props) {
|
|
17657
17242
|
super(props);
|
|
@@ -17663,7 +17248,7 @@ class AnimatingNumbers extends Component {
|
|
|
17663
17248
|
});
|
|
17664
17249
|
}
|
|
17665
17250
|
}
|
|
17666
|
-
AnimatingNumbers.defaultProps = defaultProps$
|
|
17251
|
+
AnimatingNumbers.defaultProps = defaultProps$f;
|
|
17667
17252
|
AnimatingNumbers.displayName = "NutAnimatingNumbers";
|
|
17668
17253
|
AnimatingNumbers.CountUp = CountUp;
|
|
17669
17254
|
const defaultStatus = {
|
|
@@ -17671,7 +17256,7 @@ const defaultStatus = {
|
|
|
17671
17256
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
17672
17257
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
17673
17258
|
};
|
|
17674
|
-
const defaultProps$
|
|
17259
|
+
const defaultProps$e = {
|
|
17675
17260
|
description: "\u65E0\u5185\u5BB9",
|
|
17676
17261
|
image: "empty",
|
|
17677
17262
|
imageSize: "",
|
|
@@ -17679,9 +17264,9 @@ const defaultProps$f = {
|
|
|
17679
17264
|
};
|
|
17680
17265
|
const Empty = (props) => {
|
|
17681
17266
|
const { locale } = useConfig$1();
|
|
17682
|
-
defaultProps$
|
|
17267
|
+
defaultProps$e.description = locale.noData || defaultProps$e.description;
|
|
17683
17268
|
const { image, imageSize, description, children, className, ...rest } = {
|
|
17684
|
-
...defaultProps$
|
|
17269
|
+
...defaultProps$e,
|
|
17685
17270
|
...props
|
|
17686
17271
|
};
|
|
17687
17272
|
const [imgStyle, setImgStyle] = useState({});
|
|
@@ -17723,7 +17308,7 @@ const Empty = (props) => {
|
|
|
17723
17308
|
className: b2("description")
|
|
17724
17309
|
}, description) : { description }, children));
|
|
17725
17310
|
};
|
|
17726
|
-
Empty.defaultProps = defaultProps$
|
|
17311
|
+
Empty.defaultProps = defaultProps$e;
|
|
17727
17312
|
Empty.displayName = "NutEmpty";
|
|
17728
17313
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
17729
17314
|
let index2 = 0;
|
|
@@ -17836,7 +17421,7 @@ const updateItemSize = (positions, items, sizeKey) => {
|
|
|
17836
17421
|
}
|
|
17837
17422
|
});
|
|
17838
17423
|
};
|
|
17839
|
-
const defaultProps$
|
|
17424
|
+
const defaultProps$d = {};
|
|
17840
17425
|
const VirtualList = (props) => {
|
|
17841
17426
|
const {
|
|
17842
17427
|
sourceData = [],
|
|
@@ -17872,7 +17457,7 @@ const VirtualList = (props) => {
|
|
|
17872
17457
|
const [listTotalSize, setListTotalSize] = useState(99999999);
|
|
17873
17458
|
const [visibleCount, setVisibleCount] = useState(0);
|
|
17874
17459
|
const [offSetSize, setOffSetSize] = useState(containerSize || 0);
|
|
17875
|
-
const [
|
|
17460
|
+
const [options, setOptions] = useState({
|
|
17876
17461
|
startOffset: 0,
|
|
17877
17462
|
startIndex: 0,
|
|
17878
17463
|
overStart: 0,
|
|
@@ -17899,8 +17484,8 @@ const VirtualList = (props) => {
|
|
|
17899
17484
|
return;
|
|
17900
17485
|
const count = Math.ceil(offSetSize / itemSize) + overscan;
|
|
17901
17486
|
setVisibleCount(count);
|
|
17902
|
-
setOptions((
|
|
17903
|
-
return { ...
|
|
17487
|
+
setOptions((options2) => {
|
|
17488
|
+
return { ...options2, endIndex: count };
|
|
17904
17489
|
});
|
|
17905
17490
|
}, [getElement, horizontal, itemSize, overscan, offSetSize]);
|
|
17906
17491
|
const updateTotalSize = useCallback(() => {
|
|
@@ -17976,10 +17561,10 @@ const VirtualList = (props) => {
|
|
|
17976
17561
|
className: horizontal ? "nut-virtuallist-items nut-horizontal-items" : "nut-virtuallist-items nut-vertical-items",
|
|
17977
17562
|
ref: itemsRef,
|
|
17978
17563
|
style: {
|
|
17979
|
-
transform: horizontal ? `translate3d(${
|
|
17564
|
+
transform: horizontal ? `translate3d(${options.startOffset}px,0,0)` : `translate3d(0,${options.startOffset}px,0)`
|
|
17980
17565
|
}
|
|
17981
|
-
}, sourceData.slice(
|
|
17982
|
-
const { startIndex, overStart } =
|
|
17566
|
+
}, sourceData.slice(options.overStart, options.endIndex).map((data, index2) => {
|
|
17567
|
+
const { startIndex, overStart } = options;
|
|
17983
17568
|
const dataIndex = overStart + index2;
|
|
17984
17569
|
const styleVal = dataIndex < startIndex ? "none" : "block";
|
|
17985
17570
|
const keyVal = key && data[key] ? data[key] : dataIndex;
|
|
@@ -17995,9 +17580,9 @@ const VirtualList = (props) => {
|
|
|
17995
17580
|
}) : data);
|
|
17996
17581
|
}))));
|
|
17997
17582
|
};
|
|
17998
|
-
VirtualList.defaultProps = defaultProps$
|
|
17583
|
+
VirtualList.defaultProps = defaultProps$d;
|
|
17999
17584
|
VirtualList.displayName = "NutVirtualList";
|
|
18000
|
-
const defaultProps$
|
|
17585
|
+
const defaultProps$c = {
|
|
18001
17586
|
...ComponentDefaults,
|
|
18002
17587
|
className: "",
|
|
18003
17588
|
style: {},
|
|
@@ -18009,7 +17594,7 @@ const defaultProps$d = {
|
|
|
18009
17594
|
};
|
|
18010
17595
|
const Table = (props) => {
|
|
18011
17596
|
const { locale } = useConfig$1();
|
|
18012
|
-
defaultProps$
|
|
17597
|
+
defaultProps$c.noData = locale.noData;
|
|
18013
17598
|
const {
|
|
18014
17599
|
children,
|
|
18015
17600
|
className,
|
|
@@ -18025,7 +17610,7 @@ const Table = (props) => {
|
|
|
18025
17610
|
iconFontClassName,
|
|
18026
17611
|
...rest
|
|
18027
17612
|
} = {
|
|
18028
|
-
...defaultProps$
|
|
17613
|
+
...defaultProps$c,
|
|
18029
17614
|
...props
|
|
18030
17615
|
};
|
|
18031
17616
|
const [curData, setCurData] = useState(data);
|
|
@@ -18079,14 +17664,14 @@ const Table = (props) => {
|
|
|
18079
17664
|
});
|
|
18080
17665
|
};
|
|
18081
17666
|
const renderBodyTds = (item) => {
|
|
18082
|
-
return sortDataItem().map(([value,
|
|
17667
|
+
return sortDataItem().map(([value, render], index2) => {
|
|
18083
17668
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
18084
17669
|
className: classNames(
|
|
18085
17670
|
"nut-table__main__body__tr__td",
|
|
18086
17671
|
cellClasses(getColumnItem(value))
|
|
18087
17672
|
),
|
|
18088
17673
|
key: value
|
|
18089
|
-
}, typeof item[value] === "function" || typeof
|
|
17674
|
+
}, typeof item[value] === "function" || typeof render === "function" ? /* @__PURE__ */ React__default.createElement("div", null, render ? render(item) : item[value](item)) : item[value]);
|
|
18090
17675
|
});
|
|
18091
17676
|
};
|
|
18092
17677
|
const renderBoyTrs = () => {
|
|
@@ -18123,9 +17708,9 @@ const Table = (props) => {
|
|
|
18123
17708
|
className: "nut-table__nodata__text"
|
|
18124
17709
|
}, noData))));
|
|
18125
17710
|
};
|
|
18126
|
-
Table.defaultProps = defaultProps$
|
|
17711
|
+
Table.defaultProps = defaultProps$c;
|
|
18127
17712
|
Table.displayName = "NutTable";
|
|
18128
|
-
const defaultProps$
|
|
17713
|
+
const defaultProps$b = {
|
|
18129
17714
|
source: {
|
|
18130
17715
|
type: {},
|
|
18131
17716
|
src: ""
|
|
@@ -18143,14 +17728,14 @@ const Video = (props) => {
|
|
|
18143
17728
|
const {
|
|
18144
17729
|
children,
|
|
18145
17730
|
source,
|
|
18146
|
-
options
|
|
17731
|
+
options,
|
|
18147
17732
|
className,
|
|
18148
17733
|
play,
|
|
18149
17734
|
pause,
|
|
18150
17735
|
playend,
|
|
18151
17736
|
...restProps
|
|
18152
17737
|
} = {
|
|
18153
|
-
...defaultProps$
|
|
17738
|
+
...defaultProps$b,
|
|
18154
17739
|
...props
|
|
18155
17740
|
};
|
|
18156
17741
|
const rootRef = useRef(null);
|
|
@@ -18162,14 +17747,14 @@ const Video = (props) => {
|
|
|
18162
17747
|
const init = () => {
|
|
18163
17748
|
if (rootRef.current) {
|
|
18164
17749
|
const videoRef = rootRef.current;
|
|
18165
|
-
if (
|
|
17750
|
+
if (options.autoplay) {
|
|
18166
17751
|
setTimeout(() => {
|
|
18167
17752
|
videoRef.play();
|
|
18168
17753
|
}, 200);
|
|
18169
17754
|
}
|
|
18170
|
-
if (
|
|
18171
|
-
videoRef.setAttribute("playsinline", String(
|
|
18172
|
-
videoRef.setAttribute("webkit-playsinline", String(
|
|
17755
|
+
if (options.playsinline) {
|
|
17756
|
+
videoRef.setAttribute("playsinline", String(options.playsinline));
|
|
17757
|
+
videoRef.setAttribute("webkit-playsinline", String(options.playsinline));
|
|
18173
17758
|
videoRef.setAttribute("x5-video-player-type", "h5-page");
|
|
18174
17759
|
videoRef.setAttribute("x5-video-player-fullscreen", "false");
|
|
18175
17760
|
}
|
|
@@ -18190,11 +17775,11 @@ const Video = (props) => {
|
|
|
18190
17775
|
...restProps
|
|
18191
17776
|
}, /* @__PURE__ */ React__default.createElement("video", {
|
|
18192
17777
|
className: "nut-video-player",
|
|
18193
|
-
muted:
|
|
18194
|
-
autoPlay:
|
|
18195
|
-
loop:
|
|
18196
|
-
poster:
|
|
18197
|
-
controls:
|
|
17778
|
+
muted: options.muted,
|
|
17779
|
+
autoPlay: options.autoplay,
|
|
17780
|
+
loop: options.loop,
|
|
17781
|
+
poster: options.poster,
|
|
17782
|
+
controls: options.controls,
|
|
18198
17783
|
ref: rootRef,
|
|
18199
17784
|
src: source.src
|
|
18200
17785
|
}, /* @__PURE__ */ React__default.createElement("source", {
|
|
@@ -18204,11 +17789,11 @@ const Video = (props) => {
|
|
|
18204
17789
|
kind: "captions"
|
|
18205
17790
|
})));
|
|
18206
17791
|
};
|
|
18207
|
-
Video.defaultProps = defaultProps$
|
|
17792
|
+
Video.defaultProps = defaultProps$b;
|
|
18208
17793
|
Video.displayName = "NutVideo";
|
|
18209
17794
|
const b = cn("audio");
|
|
18210
17795
|
const warn = console.warn;
|
|
18211
|
-
const defaultProps$
|
|
17796
|
+
const defaultProps$a = {
|
|
18212
17797
|
...ComponentDefaults,
|
|
18213
17798
|
className: "",
|
|
18214
17799
|
url: "",
|
|
@@ -18249,7 +17834,7 @@ const Audio = (props) => {
|
|
|
18249
17834
|
iconFontClassName,
|
|
18250
17835
|
...rest
|
|
18251
17836
|
} = {
|
|
18252
|
-
...defaultProps$
|
|
17837
|
+
...defaultProps$a,
|
|
18253
17838
|
...props
|
|
18254
17839
|
};
|
|
18255
17840
|
const [playing, setPlaying] = useState(false);
|
|
@@ -18373,17 +17958,17 @@ const Audio = (props) => {
|
|
|
18373
17958
|
className: "time"
|
|
18374
17959
|
}, formatSeconds(`${totalSeconds}`) || "00:00:00")), /* @__PURE__ */ React__default.createElement("div", {
|
|
18375
17960
|
className: isCanPlay ? "custom-button-group" : "custom-button-group-disable"
|
|
18376
|
-
}, /* @__PURE__ */ React__default.createElement(Button
|
|
17961
|
+
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
18377
17962
|
type: "primary",
|
|
18378
17963
|
size: "small",
|
|
18379
17964
|
className: "back",
|
|
18380
17965
|
onClick: handleBack
|
|
18381
|
-
}, locale.audio.back || "\u5FEB\u9000"), /* @__PURE__ */ React__default.createElement(Button
|
|
17966
|
+
}, locale.audio.back || "\u5FEB\u9000"), /* @__PURE__ */ React__default.createElement(Button, {
|
|
18382
17967
|
type: "primary",
|
|
18383
17968
|
size: "small",
|
|
18384
17969
|
className: "start",
|
|
18385
17970
|
onClick: handleStatusChange
|
|
18386
|
-
}, playing ? `${locale.audio.pause || "\u6682\u505C"}` : `${locale.audio.start || "\u5F00\u59CB"}`), /* @__PURE__ */ React__default.createElement(Button
|
|
17971
|
+
}, playing ? `${locale.audio.pause || "\u6682\u505C"}` : `${locale.audio.start || "\u5F00\u59CB"}`), /* @__PURE__ */ React__default.createElement(Button, {
|
|
18387
17972
|
type: "primary",
|
|
18388
17973
|
size: "small",
|
|
18389
17974
|
onClick: handleForward
|
|
@@ -18413,9 +17998,9 @@ const Audio = (props) => {
|
|
|
18413
17998
|
...rest
|
|
18414
17999
|
}, renderAudio());
|
|
18415
18000
|
};
|
|
18416
|
-
Audio.defaultProps = defaultProps$
|
|
18001
|
+
Audio.defaultProps = defaultProps$a;
|
|
18417
18002
|
Audio.displayName = "NutAudio";
|
|
18418
|
-
const defaultProps$
|
|
18003
|
+
const defaultProps$9 = {
|
|
18419
18004
|
images: [],
|
|
18420
18005
|
videos: [],
|
|
18421
18006
|
show: false,
|
|
@@ -18586,14 +18171,7 @@ const ImagePreview = (props) => {
|
|
|
18586
18171
|
initPage: initNo && (initNo > maxNo ? maxNo - 1 : initNo - 1),
|
|
18587
18172
|
paginationColor,
|
|
18588
18173
|
paginationVisible
|
|
18589
|
-
},
|
|
18590
|
-
return /* @__PURE__ */ React__default.createElement(SwiperItem, {
|
|
18591
|
-
key: index2
|
|
18592
|
-
}, /* @__PURE__ */ React__default.createElement(Video, {
|
|
18593
|
-
source: item.source,
|
|
18594
|
-
options: item.options
|
|
18595
|
-
}));
|
|
18596
|
-
}), images && images.length > 0 && images.map((item, index2) => {
|
|
18174
|
+
}, images && images.length > 0 ? images.map((item, index2) => {
|
|
18597
18175
|
return /* @__PURE__ */ React__default.createElement(SwiperItem, {
|
|
18598
18176
|
key: index2
|
|
18599
18177
|
}, /* @__PURE__ */ React__default.createElement("img", {
|
|
@@ -18601,13 +18179,13 @@ const ImagePreview = (props) => {
|
|
|
18601
18179
|
alt: "",
|
|
18602
18180
|
className: "nut-imagepreview-img"
|
|
18603
18181
|
}));
|
|
18604
|
-
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
18182
|
+
}) : [])), /* @__PURE__ */ React__default.createElement("div", {
|
|
18605
18183
|
className: "nut-imagepreview-index"
|
|
18606
18184
|
}, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)));
|
|
18607
18185
|
};
|
|
18608
|
-
ImagePreview.defaultProps = defaultProps$
|
|
18186
|
+
ImagePreview.defaultProps = defaultProps$9;
|
|
18609
18187
|
ImagePreview.displayName = "NutImagePreview";
|
|
18610
|
-
const defaultProps$
|
|
18188
|
+
const defaultProps$8 = {
|
|
18611
18189
|
type: "custom",
|
|
18612
18190
|
existAddress: [],
|
|
18613
18191
|
defaultIcon: "location2",
|
|
@@ -18629,7 +18207,7 @@ const ExistRender = (props) => {
|
|
|
18629
18207
|
onClose,
|
|
18630
18208
|
onSwitchModule,
|
|
18631
18209
|
...rest
|
|
18632
|
-
} = { ...defaultProps$
|
|
18210
|
+
} = { ...defaultProps$8, ...props };
|
|
18633
18211
|
const b2 = cn("address");
|
|
18634
18212
|
const selectedExist = (item) => {
|
|
18635
18213
|
const copyExistAdd = existAddress;
|
|
@@ -18690,219 +18268,6 @@ const ExistRender = (props) => {
|
|
|
18690
18268
|
className: b2("choose-other-btn")
|
|
18691
18269
|
}, locale.address.chooseAnotherAddress || customAndExistTitle)));
|
|
18692
18270
|
};
|
|
18693
|
-
const elevatorContext = createContext({});
|
|
18694
|
-
const defaultProps$8 = {
|
|
18695
|
-
height: "200px",
|
|
18696
|
-
acceptKey: "title",
|
|
18697
|
-
indexList: [],
|
|
18698
|
-
isSticky: false,
|
|
18699
|
-
spaceHeight: 23,
|
|
18700
|
-
titleHeight: 35,
|
|
18701
|
-
className: ""
|
|
18702
|
-
};
|
|
18703
|
-
const Elevator = (props) => {
|
|
18704
|
-
const {
|
|
18705
|
-
height,
|
|
18706
|
-
acceptKey,
|
|
18707
|
-
indexList,
|
|
18708
|
-
isSticky,
|
|
18709
|
-
spaceHeight,
|
|
18710
|
-
titleHeight,
|
|
18711
|
-
className,
|
|
18712
|
-
onClickItem,
|
|
18713
|
-
onClickIndex,
|
|
18714
|
-
children,
|
|
18715
|
-
...rest
|
|
18716
|
-
} = {
|
|
18717
|
-
...defaultProps$8,
|
|
18718
|
-
...props
|
|
18719
|
-
};
|
|
18720
|
-
const b2 = cn("elevator");
|
|
18721
|
-
const listview = useRef(null);
|
|
18722
|
-
const initData = {
|
|
18723
|
-
anchorIndex: 0,
|
|
18724
|
-
listHeight: [],
|
|
18725
|
-
listGroup: [],
|
|
18726
|
-
scrollY: 0,
|
|
18727
|
-
diff: -1,
|
|
18728
|
-
fixedTop: 0
|
|
18729
|
-
};
|
|
18730
|
-
const touchState = useRef({
|
|
18731
|
-
y1: 0,
|
|
18732
|
-
y2: 0
|
|
18733
|
-
});
|
|
18734
|
-
const [scrollY, setScrollY] = useState(0);
|
|
18735
|
-
const [currentData, setCurrentData] = useState(
|
|
18736
|
-
{}
|
|
18737
|
-
);
|
|
18738
|
-
const [currentKey, setCurrentKey] = useState("");
|
|
18739
|
-
const [currentIndex, setCurrentIndex] = useState(0);
|
|
18740
|
-
const [codeIndex, setCodeIndex] = useState(0);
|
|
18741
|
-
const [scrollStart, setScrollStart] = useState(false);
|
|
18742
|
-
const state = useRef(initData);
|
|
18743
|
-
const resetScrollState = () => {
|
|
18744
|
-
setScrollStart(false);
|
|
18745
|
-
};
|
|
18746
|
-
const clientHeight = () => {
|
|
18747
|
-
return listview.current ? listview.current.clientHeight : 0;
|
|
18748
|
-
};
|
|
18749
|
-
const getData = (el, name) => {
|
|
18750
|
-
const prefix2 = "data-";
|
|
18751
|
-
return el.getAttribute(prefix2 + name);
|
|
18752
|
-
};
|
|
18753
|
-
const calculateHeight = () => {
|
|
18754
|
-
let height2 = 0;
|
|
18755
|
-
state.current.listHeight.push(height2);
|
|
18756
|
-
for (let i = 0; i < state.current.listGroup.length; i++) {
|
|
18757
|
-
const item = state.current.listGroup[i];
|
|
18758
|
-
height2 += item.clientHeight;
|
|
18759
|
-
state.current.listHeight.push(height2);
|
|
18760
|
-
}
|
|
18761
|
-
};
|
|
18762
|
-
const scrollTo = (index2) => {
|
|
18763
|
-
if (!index2 && index2 !== 0) {
|
|
18764
|
-
return;
|
|
18765
|
-
}
|
|
18766
|
-
if (!state.current.listHeight.length) {
|
|
18767
|
-
calculateHeight();
|
|
18768
|
-
}
|
|
18769
|
-
let cacheIndex = index2;
|
|
18770
|
-
if (index2 < 0) {
|
|
18771
|
-
cacheIndex = 0;
|
|
18772
|
-
}
|
|
18773
|
-
if (index2 > state.current.listHeight.length - 2) {
|
|
18774
|
-
cacheIndex = state.current.listHeight.length - 2;
|
|
18775
|
-
}
|
|
18776
|
-
setCodeIndex(cacheIndex);
|
|
18777
|
-
if (listview.current) {
|
|
18778
|
-
listview.current.scrollTo(0, state.current.listHeight[cacheIndex]);
|
|
18779
|
-
}
|
|
18780
|
-
};
|
|
18781
|
-
const bind = useGesture({
|
|
18782
|
-
onDragStart: ({ target, offset }) => {
|
|
18783
|
-
setScrollStart(true);
|
|
18784
|
-
const index2 = Number(getData(target, "index"));
|
|
18785
|
-
touchState.current.y1 = offset[1];
|
|
18786
|
-
state.current.anchorIndex = +index2;
|
|
18787
|
-
setCodeIndex((codeIndex2) => codeIndex2 + index2);
|
|
18788
|
-
scrollTo(index2);
|
|
18789
|
-
},
|
|
18790
|
-
onDragEnd: ({ offset }) => {
|
|
18791
|
-
touchState.current.y2 = offset[1];
|
|
18792
|
-
const delta = (touchState.current.y2 - touchState.current.y1) / spaceHeight || 0;
|
|
18793
|
-
const cacheIndex = state.current.anchorIndex + Math.ceil(delta);
|
|
18794
|
-
setCodeIndex(cacheIndex);
|
|
18795
|
-
scrollTo(cacheIndex);
|
|
18796
|
-
resetScrollState();
|
|
18797
|
-
}
|
|
18798
|
-
});
|
|
18799
|
-
const handleClickItem = (key, item) => {
|
|
18800
|
-
onClickItem && onClickItem(key, item);
|
|
18801
|
-
setCurrentData(item);
|
|
18802
|
-
setCurrentKey(key);
|
|
18803
|
-
};
|
|
18804
|
-
const handleClickIndex = (key) => {
|
|
18805
|
-
onClickIndex && onClickIndex(key);
|
|
18806
|
-
};
|
|
18807
|
-
const setListGroup = () => {
|
|
18808
|
-
if (listview.current) {
|
|
18809
|
-
const els = listview.current.querySelectorAll(".nut-elevator__list__item");
|
|
18810
|
-
els.forEach((el) => {
|
|
18811
|
-
if (el != null && !state.current.listGroup.includes(el)) {
|
|
18812
|
-
state.current.listGroup.push(el);
|
|
18813
|
-
}
|
|
18814
|
-
});
|
|
18815
|
-
}
|
|
18816
|
-
};
|
|
18817
|
-
const listViewScroll = (e2) => {
|
|
18818
|
-
const { listHeight } = state.current;
|
|
18819
|
-
if (!listHeight.length) {
|
|
18820
|
-
calculateHeight();
|
|
18821
|
-
}
|
|
18822
|
-
const target = e2.target;
|
|
18823
|
-
const { scrollTop } = target;
|
|
18824
|
-
state.current.scrollY = scrollTop;
|
|
18825
|
-
setScrollY(scrollTop);
|
|
18826
|
-
for (let i = 0; i < listHeight.length - 1; i++) {
|
|
18827
|
-
const height1 = listHeight[i];
|
|
18828
|
-
const height2 = listHeight[i + 1];
|
|
18829
|
-
if (state.current.scrollY >= height1 && state.current.scrollY < height2) {
|
|
18830
|
-
setCurrentIndex(i);
|
|
18831
|
-
state.current.diff = height2 - state.current.scrollY;
|
|
18832
|
-
return;
|
|
18833
|
-
}
|
|
18834
|
-
}
|
|
18835
|
-
setCurrentIndex(listHeight.length - 2);
|
|
18836
|
-
};
|
|
18837
|
-
useEffect(() => {
|
|
18838
|
-
if (listview.current) {
|
|
18839
|
-
setListGroup();
|
|
18840
|
-
listview.current.addEventListener("scroll", listViewScroll);
|
|
18841
|
-
}
|
|
18842
|
-
}, [listview]);
|
|
18843
|
-
useEffect(() => {
|
|
18844
|
-
const { listHeight, diff, scrollY: scrollY2 } = state.current;
|
|
18845
|
-
let fixedTop = diff > 0 && diff < titleHeight ? diff - titleHeight : 0;
|
|
18846
|
-
if (scrollY2 + clientHeight() === listHeight[listHeight.length - 1]) {
|
|
18847
|
-
if (fixedTop !== 0) {
|
|
18848
|
-
fixedTop = 0;
|
|
18849
|
-
}
|
|
18850
|
-
}
|
|
18851
|
-
if (state.current.fixedTop === fixedTop)
|
|
18852
|
-
return;
|
|
18853
|
-
state.current.fixedTop = fixedTop;
|
|
18854
|
-
}, [state.current.diff, titleHeight]);
|
|
18855
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
18856
|
-
className: `${b2()} ${className}`,
|
|
18857
|
-
...rest
|
|
18858
|
-
}, isSticky && scrollY > 0 ? /* @__PURE__ */ React__default.createElement("div", {
|
|
18859
|
-
className: b2("list__fixed")
|
|
18860
|
-
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
18861
|
-
className: "fixed-title"
|
|
18862
|
-
}, indexList[currentIndex][acceptKey])) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
18863
|
-
className: b2("list"),
|
|
18864
|
-
style: { height: Number.isNaN(+height) ? height : `${height}px` }
|
|
18865
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
18866
|
-
className: b2("list__inner"),
|
|
18867
|
-
ref: listview
|
|
18868
|
-
}, indexList.map((item, idx) => {
|
|
18869
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
18870
|
-
className: b2("list__item"),
|
|
18871
|
-
key: idx
|
|
18872
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
18873
|
-
className: b2("list__item__code")
|
|
18874
|
-
}, item[acceptKey]), /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.list.map((subitem) => {
|
|
18875
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
18876
|
-
className: b2("list__item__name", {
|
|
18877
|
-
highcolor: currentData.id === subitem.id && currentKey === item[acceptKey]
|
|
18878
|
-
}),
|
|
18879
|
-
key: subitem.id,
|
|
18880
|
-
onClick: () => handleClickItem(item[acceptKey], subitem)
|
|
18881
|
-
}, children ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(elevatorContext.Provider, {
|
|
18882
|
-
value: subitem
|
|
18883
|
-
}, children)) : subitem.name);
|
|
18884
|
-
})));
|
|
18885
|
-
}))), indexList.length && scrollStart ? /* @__PURE__ */ React__default.createElement("div", {
|
|
18886
|
-
className: b2("code--current", { current: true })
|
|
18887
|
-
}, indexList[codeIndex][acceptKey]) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
18888
|
-
className: b2("bars")
|
|
18889
|
-
}, /* @__PURE__ */ React__default.createElement(animated.div, {
|
|
18890
|
-
className: b2("bars__inner"),
|
|
18891
|
-
...bind(),
|
|
18892
|
-
style: { touchAction: "pan-y" }
|
|
18893
|
-
}, indexList.map((item, index2) => {
|
|
18894
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
18895
|
-
className: b2("bars__inner__item", {
|
|
18896
|
-
active: item[acceptKey] === indexList[currentIndex][acceptKey]
|
|
18897
|
-
}),
|
|
18898
|
-
"data-index": index2,
|
|
18899
|
-
key: index2,
|
|
18900
|
-
onClick: () => handleClickIndex(item[acceptKey])
|
|
18901
|
-
}, item[acceptKey]);
|
|
18902
|
-
}))));
|
|
18903
|
-
};
|
|
18904
|
-
Elevator.defaultProps = defaultProps$8;
|
|
18905
|
-
Elevator.displayName = "NutElevator";
|
|
18906
18271
|
const defaultProps$7 = {
|
|
18907
18272
|
modelValue: [],
|
|
18908
18273
|
type: "custom",
|
|
@@ -18935,10 +18300,10 @@ const CustomRender = (props) => {
|
|
|
18935
18300
|
const [privateType] = useState(type);
|
|
18936
18301
|
const [tabIndex, setTabIndex] = useState(0);
|
|
18937
18302
|
const [tabName] = useState(["province", "city", "country", "town"]);
|
|
18938
|
-
|
|
18939
|
-
|
|
18940
|
-
|
|
18941
|
-
|
|
18303
|
+
useRef(null);
|
|
18304
|
+
useRef(null);
|
|
18305
|
+
useRef(null);
|
|
18306
|
+
useRef(null);
|
|
18942
18307
|
const regionLine = useRef(null);
|
|
18943
18308
|
const isCustom2 = () => {
|
|
18944
18309
|
return type === "custom2";
|
|
@@ -18996,21 +18361,16 @@ const CustomRender = (props) => {
|
|
|
18996
18361
|
}
|
|
18997
18362
|
return locale.select;
|
|
18998
18363
|
};
|
|
18999
|
-
const mapRef = {
|
|
19000
|
-
province: provinceRef,
|
|
19001
|
-
city: cityRef,
|
|
19002
|
-
country: countryRef,
|
|
19003
|
-
town: townRef
|
|
19004
|
-
};
|
|
19005
18364
|
const lineAnimation = (index2) => {
|
|
19006
18365
|
setTimeout(() => {
|
|
19007
18366
|
const name = tabName[index2];
|
|
19008
|
-
|
|
19009
|
-
|
|
19010
|
-
|
|
19011
|
-
|
|
19012
|
-
|
|
19013
|
-
|
|
18367
|
+
Taro.createSelectorQuery().selectAll(`.${name}`).boundingClientRect((rects) => {
|
|
18368
|
+
rects && rects.length > 0 && rects.forEach((rect) => {
|
|
18369
|
+
if (rect.width > 0)
|
|
18370
|
+
setLineDistance(rect.left || 20);
|
|
18371
|
+
});
|
|
18372
|
+
}).exec();
|
|
18373
|
+
}, 100);
|
|
19014
18374
|
};
|
|
19015
18375
|
const nextAreaList = (item) => {
|
|
19016
18376
|
const calBack = {
|
|
@@ -19093,9 +18453,6 @@ const CustomRender = (props) => {
|
|
|
19093
18453
|
lineAnimation(tagIndex);
|
|
19094
18454
|
}
|
|
19095
18455
|
};
|
|
19096
|
-
const handleElevatorItem = (key, item) => {
|
|
19097
|
-
nextAreaList(item);
|
|
19098
|
-
};
|
|
19099
18456
|
useEffect(() => {
|
|
19100
18457
|
const { province: province2 } = { ...defaultProps$7, ...props };
|
|
19101
18458
|
setRegionList({
|
|
@@ -19134,9 +18491,8 @@ const CustomRender = (props) => {
|
|
|
19134
18491
|
}, selectedRegion && Object.keys(selectedRegion).map(
|
|
19135
18492
|
(key, index2) => {
|
|
19136
18493
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
19137
|
-
className: `${b2("tab-item")} ${index2 === tabIndex ? "active" : ""}`,
|
|
18494
|
+
className: `${b2("tab-item")} ${index2 === tabIndex ? "active" : ""} ${tabName[index2]}`,
|
|
19138
18495
|
key: index2,
|
|
19139
|
-
ref: mapRef[key],
|
|
19140
18496
|
onClick: () => changeRegionTab(
|
|
19141
18497
|
selectedRegion[key],
|
|
19142
18498
|
index2,
|
|
@@ -19171,13 +18527,7 @@ const CustomRender = (props) => {
|
|
|
19171
18527
|
size: "13px"
|
|
19172
18528
|
}), item.name));
|
|
19173
18529
|
}
|
|
19174
|
-
)))
|
|
19175
|
-
className: b2("elevator-group")
|
|
19176
|
-
}, /* @__PURE__ */ React__default.createElement(Elevator, {
|
|
19177
|
-
height,
|
|
19178
|
-
indexList: regionList[tabName[tabIndex]],
|
|
19179
|
-
onClickItem: handleElevatorItem
|
|
19180
|
-
})));
|
|
18530
|
+
))));
|
|
19181
18531
|
};
|
|
19182
18532
|
const defaultProps$6 = {
|
|
19183
18533
|
...ComponentDefaults,
|
|
@@ -19550,7 +18900,7 @@ const Signature = (props) => {
|
|
|
19550
18900
|
}
|
|
19551
18901
|
props.clear && props.clear();
|
|
19552
18902
|
};
|
|
19553
|
-
const
|
|
18903
|
+
const confirm = () => {
|
|
19554
18904
|
onSave(canvasRef.current);
|
|
19555
18905
|
};
|
|
19556
18906
|
const onSave = (canvas) => {
|
|
@@ -19580,14 +18930,14 @@ const Signature = (props) => {
|
|
|
19580
18930
|
width: canvasWidth
|
|
19581
18931
|
}) : /* @__PURE__ */ React__default.createElement("p", {
|
|
19582
18932
|
className: `${b2("unsopport")}`
|
|
19583
|
-
}, locale.signature.unSupportTpl || unSupportTpl)), /* @__PURE__ */ React__default.createElement(Button
|
|
18933
|
+
}, locale.signature.unSupportTpl || unSupportTpl)), /* @__PURE__ */ React__default.createElement(Button, {
|
|
19584
18934
|
className: `${b2("btn")}`,
|
|
19585
18935
|
type: "default",
|
|
19586
18936
|
onClick: () => clear()
|
|
19587
|
-
}, locale.signature.reSign), /* @__PURE__ */ React__default.createElement(Button
|
|
18937
|
+
}, locale.signature.reSign), /* @__PURE__ */ React__default.createElement(Button, {
|
|
19588
18938
|
className: `${b2("btn")}`,
|
|
19589
18939
|
type: "primary",
|
|
19590
|
-
onClick: () =>
|
|
18940
|
+
onClick: () => confirm()
|
|
19591
18941
|
}, locale.confirm));
|
|
19592
18942
|
};
|
|
19593
18943
|
Signature.defaultProps = defaultProps$4;
|
|
@@ -19851,4 +19201,4 @@ const TimeSelect = (props) => {
|
|
|
19851
19201
|
};
|
|
19852
19202
|
TimeSelect.defaultProps = defaultProps;
|
|
19853
19203
|
TimeSelect.displayName = "NutTimeSelect";
|
|
19854
|
-
export { ActionSheet, Address, AnimatingNumbers, Audio, Avatar, AvatarGroup, BackTop, Badge, Barrage, Button
|
|
19204
|
+
export { ActionSheet, Address, AnimatingNumbers, Audio, Avatar, AvatarGroup, BackTop, Badge, Barrage, Button, Calendar, CalendarItem, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, CircleProgress, Col, Collapse, CollapseItem, ConfigProvider, CountDown, DatePicker, Dialog, Divider, Drag, Elevator, Empty, FixedNav, Grid, GridItem, Icon$1 as Icon, ImagePreview, Indicator, Infiniteloading, Input, InputNumber, Layout, Menu, MenuItem, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, Picker, Popover, Popup, Price, Progress, PullToRefresh, Radio, RadioGroup, Range, Rate, Row, SearchBar, ShortPassword, SideNavBar, SideNavBarItem, Signature, Skeleton, Step, Steps, Sticky, SubSideNavBar, Swipe, Swiper, SwiperItem, Switch, TabPane, Tabbar, TabbarItem, Table, Tabs, Tag, TextArea, TimeDetail, TimePannel, TimeSelect, Toast, Uploader, Video, VirtualList };
|