@nutui/nutui-react 1.3.5 → 1.3.6
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 +7 -0
- package/dist/esm/ActionSheet.js +15 -25
- package/dist/esm/Address.js +151 -221
- package/dist/esm/AnimatingNumbers.js +7 -31
- package/dist/esm/Audio.js +31 -66
- package/dist/esm/Avatar.js +25 -51
- package/dist/esm/AvatarGroup.js +2 -9
- package/dist/esm/BackTop.js +29 -55
- package/dist/esm/Badge.js +9 -20
- package/dist/esm/Barrage.js +8 -20
- package/dist/esm/Button.js +22 -37
- package/dist/esm/Calendar.js +23 -37
- package/dist/esm/CalendarItem.js +86 -186
- package/dist/esm/Card.js +14 -20
- package/dist/esm/Cascader.js +77 -197
- package/dist/esm/Cell.js +20 -30
- package/dist/esm/CellGroup.js +6 -12
- package/dist/esm/Checkbox.js +27 -48
- package/dist/esm/CheckboxGroup.js +12 -30
- package/dist/esm/CircleProgress.js +11 -28
- package/dist/esm/Col.js +11 -22
- package/dist/esm/Collapse.js +11 -27
- package/dist/esm/CollapseItem.js +33 -47
- package/dist/esm/ConfigProvider.js +4 -15
- package/dist/esm/CountDown.js +37 -74
- package/dist/esm/DatePicker.js +44 -106
- package/dist/esm/Dialog.js +31 -89
- package/dist/esm/Divider.js +8 -15
- package/dist/esm/Drag.js +30 -45
- package/dist/esm/Elevator.js +37 -74
- package/dist/esm/Empty.js +11 -24
- package/dist/esm/FixedNav.js +18 -29
- package/dist/esm/Grid.js +13 -28
- package/dist/esm/GridItem.js +18 -34
- package/dist/esm/ImagePreview.js +36 -71
- package/dist/esm/Indicator.js +9 -20
- package/dist/esm/Infiniteloading.js +26 -55
- package/dist/esm/Input.js +62 -106
- package/dist/esm/InputNumber.js +25 -52
- package/dist/esm/Layout.js +0 -6
- package/dist/esm/Menu.js +24 -46
- package/dist/esm/MenuItem.js +29 -52
- package/dist/esm/NavBar.js +18 -34
- package/dist/esm/NoticeBar.js +54 -102
- package/dist/esm/Notify.js +9 -38
- package/dist/esm/NumberKeyboard.js +21 -52
- package/dist/esm/Pagination.js +38 -71
- package/dist/esm/Picker.js +91 -178
- package/dist/esm/Popover.js +32 -72
- package/dist/esm/Popup.js +40 -72
- package/dist/esm/Price.js +7 -24
- package/dist/esm/Progress.js +35 -50
- package/dist/esm/PullToRefresh.js +28 -83
- package/dist/esm/Radio.js +24 -47
- package/dist/esm/RadioGroup.js +14 -24
- package/dist/esm/Range.js +44 -116
- package/dist/esm/Rate.js +21 -39
- package/dist/esm/Row.js +7 -16
- package/dist/esm/SearchBar.js +47 -68
- package/dist/esm/ShortPassword.js +29 -56
- package/dist/esm/SideNavBar.js +9 -16
- package/dist/esm/SideNavBarItem.js +4 -11
- package/dist/esm/Signature.js +13 -43
- package/dist/esm/Skeleton.js +13 -23
- package/dist/esm/Step.js +12 -28
- package/dist/esm/Steps.js +6 -14
- package/dist/esm/Sticky.js +24 -52
- package/dist/esm/SubSideNavBar.js +7 -22
- package/dist/esm/Swipe.js +15 -54
- package/dist/esm/Swiper.js +102 -186
- package/dist/esm/SwiperItem.js +2 -12
- package/dist/esm/Switch.js +13 -27
- package/dist/esm/Tabbar.js +13 -25
- package/dist/esm/TabbarItem.js +15 -23
- package/dist/esm/Table.js +19 -39
- package/dist/esm/Tag.js +19 -36
- package/dist/esm/TextArea.js +19 -43
- package/dist/esm/TimeDetail.js +15 -28
- package/dist/esm/TimePannel.js +5 -12
- package/dist/esm/TimeSelect.js +35 -59
- package/dist/esm/Toast.js +16 -49
- package/dist/esm/Uploader.js +57 -152
- package/dist/esm/Video.js +8 -19
- package/dist/esm/VirtualList.js +84 -118
- package/dist/esm/date-710f8c7c.js +9 -33
- package/dist/esm/get-scroll-parent-3dcd3f53.js +1 -9
- package/dist/esm/icon-8dc4de10.js +11 -21
- package/dist/esm/offsetContext-0e3d04b3.js +0 -3
- package/dist/esm/overlay-ed3eb37d.js +12 -23
- package/dist/esm/render-18227751.js +0 -11
- package/dist/esm/tabpane-c957ab14.js +4 -10
- package/dist/esm/tabs-0896a61b.js +28 -56
- package/dist/esm/types/src/packages/elevator/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/searchbar/searchbar.d.ts +2 -0
- package/dist/esm/useClientRect-839d18c5.js +0 -5
- package/dist/esm/useTouch-a2ea68c6.js +27 -47
- 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 +424 -406
- package/dist/nutui.react.umd.js +416 -398
- package/dist/packages/searchbar/searchbar.scss +20 -3
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/nutui.react.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.3.
|
|
2
|
+
* @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:06:20 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import React__default, { useCallback, useState, useEffect,
|
|
7
|
+
import React__default, { useCallback, useState, useEffect, useRef, createContext as createContext$1, useContext as useContext$1, useLayoutEffect, forwardRef, useMemo, useImperativeHandle, memo, Component } from "react";
|
|
8
8
|
import * as ReactDOM from "react-dom";
|
|
9
9
|
import ReactDOM__default, { createPortal, unstable_batchedUpdates } from "react-dom";
|
|
10
10
|
var classname = { exports: {} };
|
|
@@ -311,8 +311,8 @@ function _extends$3() {
|
|
|
311
311
|
function isAbsolute(pathname) {
|
|
312
312
|
return pathname.charAt(0) === "/";
|
|
313
313
|
}
|
|
314
|
-
function spliceOne(list,
|
|
315
|
-
for (var i =
|
|
314
|
+
function spliceOne(list, index) {
|
|
315
|
+
for (var i = index, k2 = i + 1, n2 = list.length; k2 < n2; i += 1, k2 += 1) {
|
|
316
316
|
list[i] = list[k2];
|
|
317
317
|
}
|
|
318
318
|
list.pop();
|
|
@@ -373,7 +373,7 @@ function invariant(condition, message) {
|
|
|
373
373
|
throw new Error(prefix$1);
|
|
374
374
|
}
|
|
375
375
|
var provided = typeof message === "function" ? message() : message;
|
|
376
|
-
var value = provided ? prefix$1
|
|
376
|
+
var value = provided ? "".concat(prefix$1, ": ").concat(provided) : prefix$1;
|
|
377
377
|
throw new Error(value);
|
|
378
378
|
}
|
|
379
379
|
function parsePath(path) {
|
|
@@ -525,7 +525,7 @@ function createMemoryHistory(props) {
|
|
|
525
525
|
function createKey() {
|
|
526
526
|
return Math.random().toString(36).substr(2, keyLength);
|
|
527
527
|
}
|
|
528
|
-
var
|
|
528
|
+
var index = clamp$1(initialIndex, 0, initialEntries.length - 1);
|
|
529
529
|
var entries = initialEntries.map(function(entry) {
|
|
530
530
|
return typeof entry === "string" ? createLocation(entry, void 0, createKey()) : createLocation(entry, void 0, entry.key || createKey());
|
|
531
531
|
});
|
|
@@ -603,8 +603,8 @@ function createMemoryHistory(props) {
|
|
|
603
603
|
var history = {
|
|
604
604
|
length: entries.length,
|
|
605
605
|
action: "POP",
|
|
606
|
-
location: entries[
|
|
607
|
-
index
|
|
606
|
+
location: entries[index],
|
|
607
|
+
index,
|
|
608
608
|
entries,
|
|
609
609
|
createHref,
|
|
610
610
|
push,
|
|
@@ -618,136 +618,6 @@ function createMemoryHistory(props) {
|
|
|
618
618
|
};
|
|
619
619
|
return history;
|
|
620
620
|
}
|
|
621
|
-
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
|
622
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
|
|
623
|
-
function getUniqueId() {
|
|
624
|
-
var key = "__global_unique_id__";
|
|
625
|
-
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
|
|
626
|
-
}
|
|
627
|
-
function objectIs(x2, y2) {
|
|
628
|
-
if (x2 === y2) {
|
|
629
|
-
return x2 !== 0 || 1 / x2 === 1 / y2;
|
|
630
|
-
} else {
|
|
631
|
-
return x2 !== x2 && y2 !== y2;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
function createEventEmitter(value) {
|
|
635
|
-
var handlers = [];
|
|
636
|
-
return {
|
|
637
|
-
on: function on(handler) {
|
|
638
|
-
handlers.push(handler);
|
|
639
|
-
},
|
|
640
|
-
off: function off(handler) {
|
|
641
|
-
handlers = handlers.filter(function(h2) {
|
|
642
|
-
return h2 !== handler;
|
|
643
|
-
});
|
|
644
|
-
},
|
|
645
|
-
get: function get() {
|
|
646
|
-
return value;
|
|
647
|
-
},
|
|
648
|
-
set: function set(newValue, changedBits) {
|
|
649
|
-
value = newValue;
|
|
650
|
-
handlers.forEach(function(handler) {
|
|
651
|
-
return handler(value, changedBits);
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
function onlyChild(children) {
|
|
657
|
-
return Array.isArray(children) ? children[0] : children;
|
|
658
|
-
}
|
|
659
|
-
function createReactContext(defaultValue, calculateChangedBits) {
|
|
660
|
-
var _Provider$childContex, _Consumer$contextType;
|
|
661
|
-
var contextProp = "__create-react-context-" + getUniqueId() + "__";
|
|
662
|
-
var Provider = /* @__PURE__ */ function(_Component) {
|
|
663
|
-
_inheritsLoose(Provider2, _Component);
|
|
664
|
-
function Provider2() {
|
|
665
|
-
var _this;
|
|
666
|
-
_this = _Component.apply(this, arguments) || this;
|
|
667
|
-
_this.emitter = createEventEmitter(_this.props.value);
|
|
668
|
-
return _this;
|
|
669
|
-
}
|
|
670
|
-
var _proto = Provider2.prototype;
|
|
671
|
-
_proto.getChildContext = function getChildContext() {
|
|
672
|
-
var _ref;
|
|
673
|
-
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
|
|
674
|
-
};
|
|
675
|
-
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
676
|
-
if (this.props.value !== nextProps.value) {
|
|
677
|
-
var oldValue = this.props.value;
|
|
678
|
-
var newValue = nextProps.value;
|
|
679
|
-
var changedBits;
|
|
680
|
-
if (objectIs(oldValue, newValue)) {
|
|
681
|
-
changedBits = 0;
|
|
682
|
-
} else {
|
|
683
|
-
changedBits = typeof calculateChangedBits === "function" ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
|
684
|
-
changedBits |= 0;
|
|
685
|
-
if (changedBits !== 0) {
|
|
686
|
-
this.emitter.set(nextProps.value, changedBits);
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
};
|
|
691
|
-
_proto.render = function render2() {
|
|
692
|
-
return this.props.children;
|
|
693
|
-
};
|
|
694
|
-
return Provider2;
|
|
695
|
-
}(Component);
|
|
696
|
-
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex);
|
|
697
|
-
var Consumer = /* @__PURE__ */ function(_Component2) {
|
|
698
|
-
_inheritsLoose(Consumer2, _Component2);
|
|
699
|
-
function Consumer2() {
|
|
700
|
-
var _this2;
|
|
701
|
-
_this2 = _Component2.apply(this, arguments) || this;
|
|
702
|
-
_this2.state = {
|
|
703
|
-
value: _this2.getValue()
|
|
704
|
-
};
|
|
705
|
-
_this2.onUpdate = function(newValue, changedBits) {
|
|
706
|
-
var observedBits = _this2.observedBits | 0;
|
|
707
|
-
if ((observedBits & changedBits) !== 0) {
|
|
708
|
-
_this2.setState({
|
|
709
|
-
value: _this2.getValue()
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
};
|
|
713
|
-
return _this2;
|
|
714
|
-
}
|
|
715
|
-
var _proto2 = Consumer2.prototype;
|
|
716
|
-
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
717
|
-
var observedBits = nextProps.observedBits;
|
|
718
|
-
this.observedBits = observedBits === void 0 || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
|
719
|
-
};
|
|
720
|
-
_proto2.componentDidMount = function componentDidMount() {
|
|
721
|
-
if (this.context[contextProp]) {
|
|
722
|
-
this.context[contextProp].on(this.onUpdate);
|
|
723
|
-
}
|
|
724
|
-
var observedBits = this.props.observedBits;
|
|
725
|
-
this.observedBits = observedBits === void 0 || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
|
726
|
-
};
|
|
727
|
-
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
728
|
-
if (this.context[contextProp]) {
|
|
729
|
-
this.context[contextProp].off(this.onUpdate);
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
_proto2.getValue = function getValue() {
|
|
733
|
-
if (this.context[contextProp]) {
|
|
734
|
-
return this.context[contextProp].get();
|
|
735
|
-
} else {
|
|
736
|
-
return defaultValue;
|
|
737
|
-
}
|
|
738
|
-
};
|
|
739
|
-
_proto2.render = function render2() {
|
|
740
|
-
return onlyChild(this.props.children)(this.state.value);
|
|
741
|
-
};
|
|
742
|
-
return Consumer2;
|
|
743
|
-
}(Component);
|
|
744
|
-
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType);
|
|
745
|
-
return {
|
|
746
|
-
Provider,
|
|
747
|
-
Consumer
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
var index = React__default.createContext || createReactContext;
|
|
751
621
|
var pathToRegexp$2 = { exports: {} };
|
|
752
622
|
var isarray$1 = Array.isArray || function(arr) {
|
|
753
623
|
return Object.prototype.toString.call(arr) == "[object Array]";
|
|
@@ -765,7 +635,7 @@ var PATH_REGEXP = new RegExp([
|
|
|
765
635
|
function parse$1(str, options2) {
|
|
766
636
|
var tokens = [];
|
|
767
637
|
var key = 0;
|
|
768
|
-
var
|
|
638
|
+
var index = 0;
|
|
769
639
|
var path = "";
|
|
770
640
|
var defaultDelimiter = options2 && options2.delimiter || "/";
|
|
771
641
|
var res;
|
|
@@ -773,13 +643,13 @@ function parse$1(str, options2) {
|
|
|
773
643
|
var m2 = res[0];
|
|
774
644
|
var escaped = res[1];
|
|
775
645
|
var offset = res.index;
|
|
776
|
-
path += str.slice(
|
|
777
|
-
|
|
646
|
+
path += str.slice(index, offset);
|
|
647
|
+
index = offset + m2.length;
|
|
778
648
|
if (escaped) {
|
|
779
649
|
path += escaped[1];
|
|
780
650
|
continue;
|
|
781
651
|
}
|
|
782
|
-
var next = str[
|
|
652
|
+
var next = str[index];
|
|
783
653
|
var prefix2 = res[2];
|
|
784
654
|
var name = res[3];
|
|
785
655
|
var capture = res[4];
|
|
@@ -806,8 +676,8 @@ function parse$1(str, options2) {
|
|
|
806
676
|
pattern: pattern ? escapeGroup(pattern) : asterisk ? ".*" : "[^" + escapeString(delimiter) + "]+?"
|
|
807
677
|
});
|
|
808
678
|
}
|
|
809
|
-
if (
|
|
810
|
-
path += str.substr(
|
|
679
|
+
if (index < str.length) {
|
|
680
|
+
path += str.substr(index);
|
|
811
681
|
}
|
|
812
682
|
if (path) {
|
|
813
683
|
tokens.push(path);
|
|
@@ -1121,8 +991,145 @@ var MEMO_STATICS = {
|
|
|
1121
991
|
var TYPE_STATICS = {};
|
|
1122
992
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
1123
993
|
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
994
|
+
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
|
995
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
|
|
996
|
+
function getUniqueId() {
|
|
997
|
+
var key = "__global_unique_id__";
|
|
998
|
+
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
|
|
999
|
+
}
|
|
1000
|
+
function objectIs(x2, y2) {
|
|
1001
|
+
if (x2 === y2) {
|
|
1002
|
+
return x2 !== 0 || 1 / x2 === 1 / y2;
|
|
1003
|
+
} else {
|
|
1004
|
+
return x2 !== x2 && y2 !== y2;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
function createEventEmitter(value) {
|
|
1008
|
+
var handlers = [];
|
|
1009
|
+
return {
|
|
1010
|
+
on: function on(handler) {
|
|
1011
|
+
handlers.push(handler);
|
|
1012
|
+
},
|
|
1013
|
+
off: function off(handler) {
|
|
1014
|
+
handlers = handlers.filter(function(h2) {
|
|
1015
|
+
return h2 !== handler;
|
|
1016
|
+
});
|
|
1017
|
+
},
|
|
1018
|
+
get: function get() {
|
|
1019
|
+
return value;
|
|
1020
|
+
},
|
|
1021
|
+
set: function set(newValue, changedBits) {
|
|
1022
|
+
value = newValue;
|
|
1023
|
+
handlers.forEach(function(handler) {
|
|
1024
|
+
return handler(value, changedBits);
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
function onlyChild(children) {
|
|
1030
|
+
return Array.isArray(children) ? children[0] : children;
|
|
1031
|
+
}
|
|
1032
|
+
function createReactContext(defaultValue, calculateChangedBits) {
|
|
1033
|
+
var _Provider$childContex, _Consumer$contextType;
|
|
1034
|
+
var contextProp = "__create-react-context-" + getUniqueId() + "__";
|
|
1035
|
+
var Provider = /* @__PURE__ */ function(_React$Component) {
|
|
1036
|
+
_inheritsLoose(Provider2, _React$Component);
|
|
1037
|
+
function Provider2() {
|
|
1038
|
+
var _this;
|
|
1039
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1040
|
+
args[_key] = arguments[_key];
|
|
1041
|
+
}
|
|
1042
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
1043
|
+
_this.emitter = createEventEmitter(_this.props.value);
|
|
1044
|
+
return _this;
|
|
1045
|
+
}
|
|
1046
|
+
var _proto = Provider2.prototype;
|
|
1047
|
+
_proto.getChildContext = function getChildContext() {
|
|
1048
|
+
var _ref;
|
|
1049
|
+
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
|
|
1050
|
+
};
|
|
1051
|
+
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
1052
|
+
if (this.props.value !== nextProps.value) {
|
|
1053
|
+
var oldValue = this.props.value;
|
|
1054
|
+
var newValue = nextProps.value;
|
|
1055
|
+
var changedBits;
|
|
1056
|
+
if (objectIs(oldValue, newValue)) {
|
|
1057
|
+
changedBits = 0;
|
|
1058
|
+
} else {
|
|
1059
|
+
changedBits = typeof calculateChangedBits === "function" ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
|
1060
|
+
changedBits |= 0;
|
|
1061
|
+
if (changedBits !== 0) {
|
|
1062
|
+
this.emitter.set(nextProps.value, changedBits);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
_proto.render = function render2() {
|
|
1068
|
+
return this.props.children;
|
|
1069
|
+
};
|
|
1070
|
+
return Provider2;
|
|
1071
|
+
}(React__default.Component);
|
|
1072
|
+
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex);
|
|
1073
|
+
var Consumer = /* @__PURE__ */ function(_React$Component2) {
|
|
1074
|
+
_inheritsLoose(Consumer2, _React$Component2);
|
|
1075
|
+
function Consumer2() {
|
|
1076
|
+
var _this2;
|
|
1077
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1078
|
+
args[_key2] = arguments[_key2];
|
|
1079
|
+
}
|
|
1080
|
+
_this2 = _React$Component2.call.apply(_React$Component2, [this].concat(args)) || this;
|
|
1081
|
+
_this2.observedBits = void 0;
|
|
1082
|
+
_this2.state = {
|
|
1083
|
+
value: _this2.getValue()
|
|
1084
|
+
};
|
|
1085
|
+
_this2.onUpdate = function(newValue, changedBits) {
|
|
1086
|
+
var observedBits = _this2.observedBits | 0;
|
|
1087
|
+
if ((observedBits & changedBits) !== 0) {
|
|
1088
|
+
_this2.setState({
|
|
1089
|
+
value: _this2.getValue()
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
return _this2;
|
|
1094
|
+
}
|
|
1095
|
+
var _proto2 = Consumer2.prototype;
|
|
1096
|
+
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
1097
|
+
var observedBits = nextProps.observedBits;
|
|
1098
|
+
this.observedBits = observedBits === void 0 || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
|
1099
|
+
};
|
|
1100
|
+
_proto2.componentDidMount = function componentDidMount() {
|
|
1101
|
+
if (this.context[contextProp]) {
|
|
1102
|
+
this.context[contextProp].on(this.onUpdate);
|
|
1103
|
+
}
|
|
1104
|
+
var observedBits = this.props.observedBits;
|
|
1105
|
+
this.observedBits = observedBits === void 0 || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
|
1106
|
+
};
|
|
1107
|
+
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
1108
|
+
if (this.context[contextProp]) {
|
|
1109
|
+
this.context[contextProp].off(this.onUpdate);
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1112
|
+
_proto2.getValue = function getValue() {
|
|
1113
|
+
if (this.context[contextProp]) {
|
|
1114
|
+
return this.context[contextProp].get();
|
|
1115
|
+
} else {
|
|
1116
|
+
return defaultValue;
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
_proto2.render = function render2() {
|
|
1120
|
+
return onlyChild(this.props.children)(this.state.value);
|
|
1121
|
+
};
|
|
1122
|
+
return Consumer2;
|
|
1123
|
+
}(React__default.Component);
|
|
1124
|
+
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType);
|
|
1125
|
+
return {
|
|
1126
|
+
Provider,
|
|
1127
|
+
Consumer
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
var createContext = React__default.createContext || createReactContext;
|
|
1124
1131
|
var createNamedContext = function createNamedContext2(name) {
|
|
1125
|
-
var context2 =
|
|
1132
|
+
var context2 = createContext();
|
|
1126
1133
|
context2.displayName = name;
|
|
1127
1134
|
return context2;
|
|
1128
1135
|
};
|
|
@@ -1292,8 +1299,8 @@ function matchPath(pathname, options2) {
|
|
|
1292
1299
|
path: path2,
|
|
1293
1300
|
url: path2 === "/" && url === "" ? "/" : url,
|
|
1294
1301
|
isExact,
|
|
1295
|
-
params: keys.reduce(function(memo2, key,
|
|
1296
|
-
memo2[key.name] = values[
|
|
1302
|
+
params: keys.reduce(function(memo2, key, index) {
|
|
1303
|
+
memo2[key.name] = values[index];
|
|
1297
1304
|
return memo2;
|
|
1298
1305
|
}, {})
|
|
1299
1306
|
};
|
|
@@ -2180,13 +2187,13 @@ const Popup = (props) => {
|
|
|
2180
2187
|
iconClassPrefix,
|
|
2181
2188
|
iconFontClassName
|
|
2182
2189
|
} = props;
|
|
2183
|
-
const [
|
|
2190
|
+
const [index, setIndex] = useState(zIndex || _zIndex);
|
|
2184
2191
|
const [innerVisible, setInnerVisible] = useState(visible);
|
|
2185
2192
|
const [showChildren, setShowChildren] = useState(true);
|
|
2186
2193
|
const [transitionName, setTransitionName] = useState("");
|
|
2187
2194
|
const b2 = cn("popup");
|
|
2188
2195
|
const baseStyle = {
|
|
2189
|
-
zIndex:
|
|
2196
|
+
zIndex: index,
|
|
2190
2197
|
animationDuration: `${duration}s`
|
|
2191
2198
|
};
|
|
2192
2199
|
const overlayStyles = {
|
|
@@ -2446,7 +2453,7 @@ const useConfig = () => {
|
|
|
2446
2453
|
var _a;
|
|
2447
2454
|
return (_a = useContext$1(ConfigContext)) != null ? _a : getDefaultConfig();
|
|
2448
2455
|
};
|
|
2449
|
-
const ConfigContext = createContext(null);
|
|
2456
|
+
const ConfigContext = createContext$1(null);
|
|
2450
2457
|
const ConfigProvider = (props) => {
|
|
2451
2458
|
const { children, ...config2 } = { ...defaultProps$1g, ...props };
|
|
2452
2459
|
const parentConfig = useConfig();
|
|
@@ -2468,7 +2475,7 @@ const Layout = (props) => {
|
|
|
2468
2475
|
};
|
|
2469
2476
|
Layout.defaultProps = defaultProps$1f;
|
|
2470
2477
|
Layout.displayName = "NutLayout";
|
|
2471
|
-
const DataContext$2 = createContext({});
|
|
2478
|
+
const DataContext$2 = createContext$1({});
|
|
2472
2479
|
const defaultProps$1e = {
|
|
2473
2480
|
span: "24",
|
|
2474
2481
|
offset: "0",
|
|
@@ -2677,7 +2684,7 @@ const GridItem = (props) => {
|
|
|
2677
2684
|
const {
|
|
2678
2685
|
children,
|
|
2679
2686
|
columnNum,
|
|
2680
|
-
index
|
|
2687
|
+
index,
|
|
2681
2688
|
gutter,
|
|
2682
2689
|
square,
|
|
2683
2690
|
text,
|
|
@@ -2709,7 +2716,7 @@ const GridItem = (props) => {
|
|
|
2709
2716
|
style.paddingTop = `${100 / +columnNum}%`;
|
|
2710
2717
|
} else if (gutter) {
|
|
2711
2718
|
style.paddingRight = pxCheck2(gutter);
|
|
2712
|
-
if (
|
|
2719
|
+
if (index >= columnNum) {
|
|
2713
2720
|
style.marginTop = pxCheck2(gutter);
|
|
2714
2721
|
}
|
|
2715
2722
|
}
|
|
@@ -3119,11 +3126,11 @@ const FixedNav = (props) => {
|
|
|
3119
3126
|
className: "list"
|
|
3120
3127
|
}, slotList || /* @__PURE__ */ React__default.createElement("div", {
|
|
3121
3128
|
className: "nut-fixednav__list"
|
|
3122
|
-
}, navList.map((item,
|
|
3129
|
+
}, navList.map((item, index) => {
|
|
3123
3130
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3124
3131
|
className: "nut-fixednav__list-item",
|
|
3125
3132
|
onClick: (event) => onSelectCb(event, item),
|
|
3126
|
-
key: item.id ||
|
|
3133
|
+
key: item.id || index
|
|
3127
3134
|
}, /* @__PURE__ */ React__default.createElement("img", {
|
|
3128
3135
|
src: item.icon,
|
|
3129
3136
|
alt: ""
|
|
@@ -3238,7 +3245,7 @@ const TabbarItem = (props) => {
|
|
|
3238
3245
|
active,
|
|
3239
3246
|
activeColor,
|
|
3240
3247
|
unactiveColor,
|
|
3241
|
-
index
|
|
3248
|
+
index,
|
|
3242
3249
|
handleClick: handleClick2,
|
|
3243
3250
|
iconClassPrefix,
|
|
3244
3251
|
iconFontClassName
|
|
@@ -3264,7 +3271,7 @@ const TabbarItem = (props) => {
|
|
|
3264
3271
|
color: active ? activeColor : unactiveColor
|
|
3265
3272
|
},
|
|
3266
3273
|
onClick: () => {
|
|
3267
|
-
handleClick2(
|
|
3274
|
+
handleClick2(index);
|
|
3268
3275
|
}
|
|
3269
3276
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3270
3277
|
className: `${bIcon()}`
|
|
@@ -5425,8 +5432,8 @@ function advance(dt) {
|
|
|
5425
5432
|
return currentFrame.length > 0;
|
|
5426
5433
|
}
|
|
5427
5434
|
function findIndex(arr, test) {
|
|
5428
|
-
const
|
|
5429
|
-
return
|
|
5435
|
+
const index = arr.findIndex(test);
|
|
5436
|
+
return index < 0 ? arr.length : index;
|
|
5430
5437
|
}
|
|
5431
5438
|
const colors = {
|
|
5432
5439
|
transparent: 0,
|
|
@@ -7878,8 +7885,8 @@ const SpringRef = () => {
|
|
|
7878
7885
|
each(current, (ctrl, i) => ctrl.update(this._getProps(props, ctrl, i)));
|
|
7879
7886
|
return this;
|
|
7880
7887
|
};
|
|
7881
|
-
const _getProps = function _getProps2(arg, ctrl,
|
|
7882
|
-
return is.fun(arg) ? arg(
|
|
7888
|
+
const _getProps = function _getProps2(arg, ctrl, index) {
|
|
7889
|
+
return is.fun(arg) ? arg(index, ctrl) : arg;
|
|
7883
7890
|
};
|
|
7884
7891
|
SpringRef2._getProps = _getProps;
|
|
7885
7892
|
return SpringRef2;
|
|
@@ -8282,7 +8289,7 @@ const host = createHost(primitives, {
|
|
|
8282
8289
|
}
|
|
8283
8290
|
});
|
|
8284
8291
|
const animated = host.animated;
|
|
8285
|
-
const elevatorContext = createContext({});
|
|
8292
|
+
const elevatorContext = createContext$1({});
|
|
8286
8293
|
const defaultProps$15 = {
|
|
8287
8294
|
height: "200px",
|
|
8288
8295
|
acceptKey: "title",
|
|
@@ -8351,18 +8358,18 @@ const Elevator = (props) => {
|
|
|
8351
8358
|
state.current.listHeight.push(height2);
|
|
8352
8359
|
}
|
|
8353
8360
|
};
|
|
8354
|
-
const scrollTo = (
|
|
8355
|
-
if (!
|
|
8361
|
+
const scrollTo = (index) => {
|
|
8362
|
+
if (!index && index !== 0) {
|
|
8356
8363
|
return;
|
|
8357
8364
|
}
|
|
8358
8365
|
if (!state.current.listHeight.length) {
|
|
8359
8366
|
calculateHeight();
|
|
8360
8367
|
}
|
|
8361
|
-
let cacheIndex =
|
|
8362
|
-
if (
|
|
8368
|
+
let cacheIndex = index;
|
|
8369
|
+
if (index < 0) {
|
|
8363
8370
|
cacheIndex = 0;
|
|
8364
8371
|
}
|
|
8365
|
-
if (
|
|
8372
|
+
if (index > state.current.listHeight.length - 2) {
|
|
8366
8373
|
cacheIndex = state.current.listHeight.length - 2;
|
|
8367
8374
|
}
|
|
8368
8375
|
setCodeIndex(cacheIndex);
|
|
@@ -8373,11 +8380,11 @@ const Elevator = (props) => {
|
|
|
8373
8380
|
const bind = useGesture({
|
|
8374
8381
|
onDragStart: ({ target, offset }) => {
|
|
8375
8382
|
setScrollStart(true);
|
|
8376
|
-
const
|
|
8383
|
+
const index = Number(getData(target, "index"));
|
|
8377
8384
|
touchState.current.y1 = offset[1];
|
|
8378
|
-
state.current.anchorIndex = +
|
|
8379
|
-
setCodeIndex((codeIndex2) => codeIndex2 +
|
|
8380
|
-
scrollTo(
|
|
8385
|
+
state.current.anchorIndex = +index;
|
|
8386
|
+
setCodeIndex((codeIndex2) => codeIndex2 + index);
|
|
8387
|
+
scrollTo(index);
|
|
8381
8388
|
},
|
|
8382
8389
|
onDragEnd: ({ offset }) => {
|
|
8383
8390
|
touchState.current.y2 = offset[1];
|
|
@@ -8482,13 +8489,13 @@ const Elevator = (props) => {
|
|
|
8482
8489
|
className: b2("bars__inner"),
|
|
8483
8490
|
...bind(),
|
|
8484
8491
|
style: { touchAction: "pan-y" }
|
|
8485
|
-
}, indexList.map((item,
|
|
8492
|
+
}, indexList.map((item, index) => {
|
|
8486
8493
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8487
8494
|
className: b2("bars__inner__item", {
|
|
8488
8495
|
active: item[acceptKey] === indexList[currentIndex][acceptKey]
|
|
8489
8496
|
}),
|
|
8490
|
-
"data-index":
|
|
8491
|
-
key:
|
|
8497
|
+
"data-index": index,
|
|
8498
|
+
key: index,
|
|
8492
8499
|
onClick: () => handleClickIndex(item[acceptKey])
|
|
8493
8500
|
}, item[acceptKey]);
|
|
8494
8501
|
}))));
|
|
@@ -8614,9 +8621,9 @@ const Pagination = (props) => {
|
|
|
8614
8621
|
onClick: (e2) => selectPage(Number(currentPage) - 1, true)
|
|
8615
8622
|
}, prevText || locale.pagination.prev), mode === "multi" ? /* @__PURE__ */ React__default.createElement("div", {
|
|
8616
8623
|
className: `${paginationBem("contain")}`
|
|
8617
|
-
}, pages.map((item,
|
|
8624
|
+
}, pages.map((item, index) => {
|
|
8618
8625
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8619
|
-
key: `${
|
|
8626
|
+
key: `${index}pagination`,
|
|
8620
8627
|
className: `${paginationBem("item")} ${item.active ? "active" : ""}`,
|
|
8621
8628
|
onClick: (e2) => !item.active ? selectPage(item.number, true) : ""
|
|
8622
8629
|
}, pageNodeRender ? pageNodeRender(item) : item.text);
|
|
@@ -8723,12 +8730,12 @@ const Tabs = (props) => {
|
|
|
8723
8730
|
color: type === "smile" ? color : "",
|
|
8724
8731
|
background: type === "line" ? color : ""
|
|
8725
8732
|
};
|
|
8726
|
-
const
|
|
8733
|
+
const index = titles.current.findIndex((t2) => t2.paneKey === value);
|
|
8727
8734
|
const contentStyle = {
|
|
8728
|
-
transform: direction === "horizontal" ? `translate3d(-${
|
|
8735
|
+
transform: direction === "horizontal" ? `translate3d(-${index * 100}%, 0, 0)` : `translate3d( 0,-${index * 100}%, 0)`,
|
|
8729
8736
|
transitionDuration: `${animatedTime}ms`
|
|
8730
8737
|
};
|
|
8731
|
-
const tabChange = (item,
|
|
8738
|
+
const tabChange = (item, index2) => {
|
|
8732
8739
|
onClick && onClick(item);
|
|
8733
8740
|
if (item.disabled) {
|
|
8734
8741
|
return;
|
|
@@ -8742,7 +8749,7 @@ const Tabs = (props) => {
|
|
|
8742
8749
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
8743
8750
|
className: classesTitle,
|
|
8744
8751
|
style: { background }
|
|
8745
|
-
}, !!titleNode && typeof titleNode === "function" ? titleNode() : titles.current.map((item,
|
|
8752
|
+
}, !!titleNode && typeof titleNode === "function" ? titleNode() : titles.current.map((item, index2) => {
|
|
8746
8753
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8747
8754
|
style: titleStyle,
|
|
8748
8755
|
onClick: (e2) => tabChange(item),
|
|
@@ -8888,7 +8895,7 @@ const handleClick = (e2) => {
|
|
|
8888
8895
|
arrowIcon.className = isShow ? iconClass.replace("arrow-down", "arrow-up") : iconClass.replace("arrow-up", "arrow-down");
|
|
8889
8896
|
}
|
|
8890
8897
|
};
|
|
8891
|
-
const OffsetContext = createContext(20);
|
|
8898
|
+
const OffsetContext = createContext$1(20);
|
|
8892
8899
|
const defaultProps$10 = {
|
|
8893
8900
|
showhead: false,
|
|
8894
8901
|
position: "left",
|
|
@@ -9059,27 +9066,27 @@ const Menu = (props) => {
|
|
|
9059
9066
|
}, []);
|
|
9060
9067
|
const [itemShow, setItemShow] = useState([]);
|
|
9061
9068
|
const [itemTitle, setItemTitle] = useState([]);
|
|
9062
|
-
const toggleItemShow = (
|
|
9063
|
-
itemShow[
|
|
9064
|
-
const temp = itemShow.map((i, idx) => idx ===
|
|
9069
|
+
const toggleItemShow = (index) => {
|
|
9070
|
+
itemShow[index] = !itemShow[index];
|
|
9071
|
+
const temp = itemShow.map((i, idx) => idx === index ? i : false);
|
|
9065
9072
|
setItemShow([...temp]);
|
|
9066
9073
|
};
|
|
9067
|
-
const hideItemShow = (
|
|
9068
|
-
itemShow[
|
|
9074
|
+
const hideItemShow = (index) => {
|
|
9075
|
+
itemShow[index] = false;
|
|
9069
9076
|
setItemShow([...itemShow]);
|
|
9070
9077
|
};
|
|
9071
|
-
const updateTitle = (text,
|
|
9072
|
-
itemTitle[
|
|
9078
|
+
const updateTitle = (text, index) => {
|
|
9079
|
+
itemTitle[index] = text;
|
|
9073
9080
|
setItemTitle([...itemTitle]);
|
|
9074
9081
|
};
|
|
9075
9082
|
const parent = () => {
|
|
9076
9083
|
return parentRef;
|
|
9077
9084
|
};
|
|
9078
9085
|
const cloneChildren = () => {
|
|
9079
|
-
return React__default.Children.map(children, (child,
|
|
9086
|
+
return React__default.Children.map(children, (child, index) => {
|
|
9080
9087
|
return React__default.cloneElement(child, {
|
|
9081
|
-
showPopup: itemShow[
|
|
9082
|
-
orderKey:
|
|
9088
|
+
showPopup: itemShow[index],
|
|
9089
|
+
orderKey: index,
|
|
9083
9090
|
activeColor,
|
|
9084
9091
|
parent: {
|
|
9085
9092
|
closeOnClickOverlay,
|
|
@@ -9099,7 +9106,7 @@ const Menu = (props) => {
|
|
|
9099
9106
|
ref: parentRef
|
|
9100
9107
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
9101
9108
|
className: `nut-menu__bar ${itemShow.includes(true) ? "opened" : ""} ${className}`
|
|
9102
|
-
}, React__default.Children.toArray(children).map((child,
|
|
9109
|
+
}, React__default.Children.toArray(children).map((child, index) => {
|
|
9103
9110
|
if (!child)
|
|
9104
9111
|
return null;
|
|
9105
9112
|
const { disabled, title, value, direction, options: options2 } = child.props;
|
|
@@ -9109,25 +9116,25 @@ const Menu = (props) => {
|
|
|
9109
9116
|
function finallyTitle() {
|
|
9110
9117
|
if (title)
|
|
9111
9118
|
return title;
|
|
9112
|
-
if (itemTitle && itemTitle[
|
|
9113
|
-
return itemTitle[
|
|
9119
|
+
if (itemTitle && itemTitle[index])
|
|
9120
|
+
return itemTitle[index];
|
|
9114
9121
|
if (currentTitle && currentTitle[0] && currentTitle[0].text)
|
|
9115
9122
|
return currentTitle[0].text;
|
|
9116
9123
|
return "";
|
|
9117
9124
|
}
|
|
9118
9125
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
9119
9126
|
className: `nut-menu__item ${classNames({
|
|
9120
|
-
active: itemShow[
|
|
9127
|
+
active: itemShow[index],
|
|
9121
9128
|
disabled
|
|
9122
9129
|
})}`,
|
|
9123
|
-
style: { color: itemShow[
|
|
9124
|
-
key:
|
|
9130
|
+
style: { color: itemShow[index] ? activeColor : "" },
|
|
9131
|
+
key: index,
|
|
9125
9132
|
onClick: () => {
|
|
9126
|
-
!disabled && toggleItemShow(
|
|
9133
|
+
!disabled && toggleItemShow(index);
|
|
9127
9134
|
}
|
|
9128
9135
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
9129
9136
|
className: `nut-menu__title ${classNames({
|
|
9130
|
-
active: itemShow[
|
|
9137
|
+
active: itemShow[index],
|
|
9131
9138
|
disabled
|
|
9132
9139
|
})}`
|
|
9133
9140
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -9269,7 +9276,7 @@ const MenuItem = (props) => {
|
|
|
9269
9276
|
classNames: "menu-item"
|
|
9270
9277
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
9271
9278
|
className: "nut-menu-item__content"
|
|
9272
|
-
}, options2 == null ? void 0 : options2.map((item,
|
|
9279
|
+
}, options2 == null ? void 0 : options2.map((item, index) => {
|
|
9273
9280
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
9274
9281
|
className: `nut-menu-item__option ${classNames({
|
|
9275
9282
|
active: item.value === _value
|
|
@@ -9893,20 +9900,20 @@ const Range = (props) => {
|
|
|
9893
9900
|
})) : null, /* @__PURE__ */ React__default.createElement("div", {
|
|
9894
9901
|
className: "nut-range-bar",
|
|
9895
9902
|
style: barStyle()
|
|
9896
|
-
}, range ? [0, 1].map((item,
|
|
9903
|
+
}, range ? [0, 1].map((item, index) => {
|
|
9897
9904
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
9898
9905
|
role: "slider",
|
|
9899
|
-
key:
|
|
9900
|
-
className: `${
|
|
9901
|
-
${
|
|
9906
|
+
key: index,
|
|
9907
|
+
className: `${index === 0 ? "nut-range-button-wrapper-left" : ""}
|
|
9908
|
+
${index === 1 ? "nut-range-button-wrapper-right" : ""}`,
|
|
9902
9909
|
tabIndex: disabled ? -1 : 0,
|
|
9903
9910
|
"aria-valuemin": +min,
|
|
9904
|
-
"aria-valuenow": curValue(
|
|
9911
|
+
"aria-valuenow": curValue(index),
|
|
9905
9912
|
"aria-valuemax": +max,
|
|
9906
9913
|
"aria-orientation": "horizontal",
|
|
9907
9914
|
onTouchStart: (e2) => {
|
|
9908
|
-
if (typeof
|
|
9909
|
-
SetButtonIndex(
|
|
9915
|
+
if (typeof index === "number") {
|
|
9916
|
+
SetButtonIndex(index);
|
|
9910
9917
|
}
|
|
9911
9918
|
onTouchStart(e2);
|
|
9912
9919
|
},
|
|
@@ -9927,7 +9934,7 @@ const Range = (props) => {
|
|
|
9927
9934
|
style: buttonStyle()
|
|
9928
9935
|
}, !hiddenTag ? /* @__PURE__ */ React__default.createElement("div", {
|
|
9929
9936
|
className: "number"
|
|
9930
|
-
}, curValue(
|
|
9937
|
+
}, curValue(index)) : null));
|
|
9931
9938
|
}) : /* @__PURE__ */ React__default.createElement("div", {
|
|
9932
9939
|
role: "slider",
|
|
9933
9940
|
className: "nut-range-button-wrapper",
|
|
@@ -9968,7 +9975,7 @@ const Utils = {
|
|
|
9968
9975
|
},
|
|
9969
9976
|
getWhatDay(year, month, day) {
|
|
9970
9977
|
const date = new Date(`${year}/${month}/${day}`);
|
|
9971
|
-
const
|
|
9978
|
+
const index = date.getDay();
|
|
9972
9979
|
const dayNames = [
|
|
9973
9980
|
"\u661F\u671F\u65E5",
|
|
9974
9981
|
"\u661F\u671F\u4E00",
|
|
@@ -9978,7 +9985,7 @@ const Utils = {
|
|
|
9978
9985
|
"\u661F\u671F\u4E94",
|
|
9979
9986
|
"\u661F\u671F\u516D"
|
|
9980
9987
|
];
|
|
9981
|
-
return dayNames[
|
|
9988
|
+
return dayNames[index];
|
|
9982
9989
|
},
|
|
9983
9990
|
getMonthPreDay(year, month) {
|
|
9984
9991
|
const date = new Date(`${year}/${month}/01`);
|
|
@@ -10222,9 +10229,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
10222
10229
|
if (type2 === "multiple") {
|
|
10223
10230
|
if (state.currDate.length > 0) {
|
|
10224
10231
|
let hasIndex = "";
|
|
10225
|
-
state.currDate.forEach((item,
|
|
10232
|
+
state.currDate.forEach((item, index) => {
|
|
10226
10233
|
if (item === days[3]) {
|
|
10227
|
-
hasIndex =
|
|
10234
|
+
hasIndex = index;
|
|
10228
10235
|
}
|
|
10229
10236
|
});
|
|
10230
10237
|
if (isFirst) {
|
|
@@ -10511,19 +10518,19 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
10511
10518
|
let current = 0;
|
|
10512
10519
|
let lastCurrent = 0;
|
|
10513
10520
|
if (state.defaultData.length > 0) {
|
|
10514
|
-
state.monthsData.forEach((item,
|
|
10521
|
+
state.monthsData.forEach((item, index) => {
|
|
10515
10522
|
if (item.title === locale.calendaritem.monthTitle(
|
|
10516
10523
|
state.defaultData[0],
|
|
10517
10524
|
state.defaultData[1]
|
|
10518
10525
|
)) {
|
|
10519
|
-
current =
|
|
10526
|
+
current = index;
|
|
10520
10527
|
}
|
|
10521
10528
|
if (props.type === "range") {
|
|
10522
10529
|
if (item.title === locale.calendaritem.monthTitle(
|
|
10523
10530
|
state.defaultData[3],
|
|
10524
10531
|
state.defaultData[4]
|
|
10525
10532
|
)) {
|
|
10526
|
-
lastCurrent =
|
|
10533
|
+
lastCurrent = index;
|
|
10527
10534
|
}
|
|
10528
10535
|
}
|
|
10529
10536
|
});
|
|
@@ -10547,9 +10554,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
10547
10554
|
[...state.currDate].forEach((item) => {
|
|
10548
10555
|
const dateArr = splitDate(item);
|
|
10549
10556
|
let current2 = state.currentIndex;
|
|
10550
|
-
state.monthsData.forEach((item2,
|
|
10557
|
+
state.monthsData.forEach((item2, index) => {
|
|
10551
10558
|
if (item2.title === locale.calendaritem.monthTitle(dateArr[0], dateArr[1])) {
|
|
10552
|
-
current2 =
|
|
10559
|
+
current2 = index;
|
|
10553
10560
|
}
|
|
10554
10561
|
});
|
|
10555
10562
|
chooseDay(
|
|
@@ -10589,10 +10596,10 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
10589
10596
|
date = state.propEndDate;
|
|
10590
10597
|
}
|
|
10591
10598
|
const dateArr = splitDate(date);
|
|
10592
|
-
state.monthsData.forEach((item,
|
|
10599
|
+
state.monthsData.forEach((item, index) => {
|
|
10593
10600
|
if (item.title === locale.calendaritem.monthTitle(dateArr[0], dateArr[1])) {
|
|
10594
10601
|
if (months.current) {
|
|
10595
|
-
const distance = state.monthsData[
|
|
10602
|
+
const distance = state.monthsData[index].cssScrollHeight - months.current.scrollTop;
|
|
10596
10603
|
if (toDateAnimation) {
|
|
10597
10604
|
let flag = 0;
|
|
10598
10605
|
const interval = setInterval(() => {
|
|
@@ -10604,12 +10611,12 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
10604
10611
|
if (flag >= 10) {
|
|
10605
10612
|
clearInterval(interval);
|
|
10606
10613
|
if (months.current) {
|
|
10607
|
-
months.current.scrollTop = state.monthsData[
|
|
10614
|
+
months.current.scrollTop = state.monthsData[index].cssScrollHeight;
|
|
10608
10615
|
}
|
|
10609
10616
|
}
|
|
10610
10617
|
}, 40);
|
|
10611
10618
|
} else {
|
|
10612
|
-
months.current.scrollTop = state.monthsData[
|
|
10619
|
+
months.current.scrollTop = state.monthsData[index].cssScrollHeight;
|
|
10613
10620
|
}
|
|
10614
10621
|
}
|
|
10615
10622
|
}
|
|
@@ -11022,8 +11029,8 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
11022
11029
|
const [startY, setStartY] = useState(0);
|
|
11023
11030
|
const transformY = useRef(0);
|
|
11024
11031
|
const [scrollDistance, setScrollDistance] = useState(0);
|
|
11025
|
-
const isHidden = (
|
|
11026
|
-
if (
|
|
11032
|
+
const isHidden = (index) => {
|
|
11033
|
+
if (index >= currIndex + 8 || index <= currIndex - 8) {
|
|
11027
11034
|
return true;
|
|
11028
11035
|
}
|
|
11029
11036
|
return false;
|
|
@@ -11103,11 +11110,11 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
11103
11110
|
};
|
|
11104
11111
|
const modifyStatus = (type, val) => {
|
|
11105
11112
|
const value = val || defaultValue;
|
|
11106
|
-
let
|
|
11113
|
+
let index = -1;
|
|
11107
11114
|
if (value) {
|
|
11108
11115
|
listData.some((item, idx) => {
|
|
11109
11116
|
if (item.value === value) {
|
|
11110
|
-
|
|
11117
|
+
index = idx;
|
|
11111
11118
|
return true;
|
|
11112
11119
|
}
|
|
11113
11120
|
return false;
|
|
@@ -11115,12 +11122,12 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
11115
11122
|
} else {
|
|
11116
11123
|
listData.forEach((item, i) => {
|
|
11117
11124
|
if (item.value === defaultValue) {
|
|
11118
|
-
|
|
11125
|
+
index = i;
|
|
11119
11126
|
}
|
|
11120
11127
|
});
|
|
11121
11128
|
}
|
|
11122
|
-
setCurrIndex(
|
|
11123
|
-
const move =
|
|
11129
|
+
setCurrIndex(index === -1 ? 1 : index + 1);
|
|
11130
|
+
const move = index === -1 ? 0 : index * lineSpacing;
|
|
11124
11131
|
type && setChooseValue(-move);
|
|
11125
11132
|
setMove(-move);
|
|
11126
11133
|
};
|
|
@@ -11172,18 +11179,18 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
11172
11179
|
ref: rollerRef,
|
|
11173
11180
|
style: threeDimensional ? touchRollerStyle() : touchTileStyle(),
|
|
11174
11181
|
onTransitionEnd: stopMomentum
|
|
11175
|
-
}, threeDimensional && listData.map((item,
|
|
11182
|
+
}, threeDimensional && listData.map((item, index) => {
|
|
11176
11183
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
11177
|
-
className: `nut-picker-roller-item ${isHidden(
|
|
11184
|
+
className: `nut-picker-roller-item ${isHidden(index + 1) && "nut-picker-roller-item-hidden"}`,
|
|
11178
11185
|
style: {
|
|
11179
|
-
transform: `rotate3d(1, 0, 0, ${-rotation * (
|
|
11186
|
+
transform: `rotate3d(1, 0, 0, ${-rotation * (index + 1)}deg) translate3d(0px, 0px, 104px)`
|
|
11180
11187
|
},
|
|
11181
|
-
key: item.value ? item.value :
|
|
11188
|
+
key: item.value ? item.value : index
|
|
11182
11189
|
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.text ? item.text : item));
|
|
11183
|
-
}), !threeDimensional && listData.map((item,
|
|
11190
|
+
}), !threeDimensional && listData.map((item, index) => {
|
|
11184
11191
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
11185
11192
|
className: "nut-picker-roller-item-tile",
|
|
11186
|
-
key: item.value ? item.value :
|
|
11193
|
+
key: item.value ? item.value : index
|
|
11187
11194
|
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.text ? item.text : item));
|
|
11188
11195
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
11189
11196
|
className: "nut-picker-mask"
|
|
@@ -11195,9 +11202,9 @@ const PickerSlot = React__default.forwardRef(InternalPickerSlot);
|
|
|
11195
11202
|
function useRefs() {
|
|
11196
11203
|
const refs = React__default.useRef([]);
|
|
11197
11204
|
const setRefs = React__default.useCallback(
|
|
11198
|
-
(
|
|
11205
|
+
(index) => (el) => {
|
|
11199
11206
|
if (el)
|
|
11200
|
-
refs.current[
|
|
11207
|
+
refs.current[index] = el;
|
|
11201
11208
|
},
|
|
11202
11209
|
[]
|
|
11203
11210
|
);
|
|
@@ -11271,10 +11278,10 @@ const InternalPicker = (props, ref) => {
|
|
|
11271
11278
|
};
|
|
11272
11279
|
const selectedOptions = () => {
|
|
11273
11280
|
const optins = [];
|
|
11274
|
-
columnsList.map((column,
|
|
11281
|
+
columnsList.map((column, index) => {
|
|
11275
11282
|
let currOptions = [];
|
|
11276
11283
|
currOptions = column.filter(
|
|
11277
|
-
(item) => item.value === chooseValueData[
|
|
11284
|
+
(item) => item.value === chooseValueData[index]
|
|
11278
11285
|
);
|
|
11279
11286
|
if (currOptions[0]) {
|
|
11280
11287
|
optins.push(currOptions[0]);
|
|
@@ -11291,17 +11298,17 @@ const InternalPicker = (props, ref) => {
|
|
|
11291
11298
|
if (columnsType() === "cascade") {
|
|
11292
11299
|
chooseValueData[columnIndex2] = option.value ? option.value : "";
|
|
11293
11300
|
setchooseValueData([...chooseValueData]);
|
|
11294
|
-
let
|
|
11301
|
+
let index = columnIndex2;
|
|
11295
11302
|
let cursor = option;
|
|
11296
11303
|
while (cursor && cursor.children && cursor.children[0]) {
|
|
11297
|
-
chooseValueData[
|
|
11304
|
+
chooseValueData[index + 1] = cursor.children[0].value;
|
|
11298
11305
|
setchooseValueData([...chooseValueData]);
|
|
11299
|
-
|
|
11306
|
+
index++;
|
|
11300
11307
|
const cc = cursor.children[0];
|
|
11301
11308
|
cursor = cc;
|
|
11302
11309
|
}
|
|
11303
11310
|
if (cursor && cursor.children) {
|
|
11304
|
-
chooseValueData[
|
|
11311
|
+
chooseValueData[index + 1] = "";
|
|
11305
11312
|
setchooseValueData([...chooseValueData]);
|
|
11306
11313
|
}
|
|
11307
11314
|
setColumnsList(normalListData());
|
|
@@ -11353,12 +11360,12 @@ const InternalPicker = (props, ref) => {
|
|
|
11353
11360
|
while (cursor && cursor.children) {
|
|
11354
11361
|
const options2 = cursor.children;
|
|
11355
11362
|
const value = defaultValues[columnIndex2];
|
|
11356
|
-
let
|
|
11363
|
+
let index = options2.findIndex(
|
|
11357
11364
|
(columnItem) => columnItem.value === value
|
|
11358
11365
|
);
|
|
11359
|
-
if (
|
|
11360
|
-
|
|
11361
|
-
cursor = cursor.children[
|
|
11366
|
+
if (index === -1)
|
|
11367
|
+
index = 0;
|
|
11368
|
+
cursor = cursor.children[index];
|
|
11362
11369
|
columnIndex2++;
|
|
11363
11370
|
formatted.push(options2);
|
|
11364
11371
|
}
|
|
@@ -11402,16 +11409,16 @@ const InternalPicker = (props, ref) => {
|
|
|
11402
11409
|
}, renderToolbar(), /* @__PURE__ */ React__default.createElement("div", {
|
|
11403
11410
|
className: b2("panel"),
|
|
11404
11411
|
ref: pickerRef
|
|
11405
|
-
}, columnsList == null ? void 0 : columnsList.map((item,
|
|
11412
|
+
}, columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
11406
11413
|
return /* @__PURE__ */ React__default.createElement(PickerSlot, {
|
|
11407
|
-
ref: setRefs(
|
|
11408
|
-
defaultValue: chooseValueData == null ? void 0 : chooseValueData[
|
|
11414
|
+
ref: setRefs(index),
|
|
11415
|
+
defaultValue: chooseValueData == null ? void 0 : chooseValueData[index],
|
|
11409
11416
|
listData: item,
|
|
11410
11417
|
threeDimensional,
|
|
11411
|
-
chooseItem: (value,
|
|
11418
|
+
chooseItem: (value, index2) => chooseItem(value, index2),
|
|
11412
11419
|
swipeDuration,
|
|
11413
|
-
key:
|
|
11414
|
-
keyIndex:
|
|
11420
|
+
key: index,
|
|
11421
|
+
keyIndex: index
|
|
11415
11422
|
});
|
|
11416
11423
|
}))));
|
|
11417
11424
|
};
|
|
@@ -11570,7 +11577,7 @@ const DatePicker = (props) => {
|
|
|
11570
11577
|
}
|
|
11571
11578
|
return result;
|
|
11572
11579
|
};
|
|
11573
|
-
const updateChooseValueCustmer = (
|
|
11580
|
+
const updateChooseValueCustmer = (index, selectedValue, cacheValueData) => {
|
|
11574
11581
|
if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
|
|
11575
11582
|
type.toLocaleLowerCase()
|
|
11576
11583
|
)) {
|
|
@@ -11609,7 +11616,7 @@ const DatePicker = (props) => {
|
|
|
11609
11616
|
const isEqual2 = (currentDate == null ? void 0 : currentDate.getTime()) === (date == null ? void 0 : date.getTime());
|
|
11610
11617
|
date && isDate(date) && !isEqual2 && setCurrentDate(formatValue(date));
|
|
11611
11618
|
}
|
|
11612
|
-
props.onChangeDatePicker && props.onChangeDatePicker(
|
|
11619
|
+
props.onChangeDatePicker && props.onChangeDatePicker(index, selectedValue, cacheValueData);
|
|
11613
11620
|
};
|
|
11614
11621
|
const padZero = (num, targetLength = 2) => {
|
|
11615
11622
|
let str = `${num}`;
|
|
@@ -11635,7 +11642,7 @@ const DatePicker = (props) => {
|
|
|
11635
11642
|
const generateValue = (min, max, val, type2, columnIndex) => {
|
|
11636
11643
|
let cmin = min;
|
|
11637
11644
|
const arr = [];
|
|
11638
|
-
let
|
|
11645
|
+
let index = 0;
|
|
11639
11646
|
while (cmin <= max) {
|
|
11640
11647
|
arr.push(formatterOption(type2, cmin));
|
|
11641
11648
|
if (type2 === "minute") {
|
|
@@ -11644,10 +11651,10 @@ const DatePicker = (props) => {
|
|
|
11644
11651
|
cmin++;
|
|
11645
11652
|
}
|
|
11646
11653
|
if (cmin <= val) {
|
|
11647
|
-
|
|
11654
|
+
index++;
|
|
11648
11655
|
}
|
|
11649
11656
|
}
|
|
11650
|
-
defaultValue[columnIndex] = arr[
|
|
11657
|
+
defaultValue[columnIndex] = arr[index].value;
|
|
11651
11658
|
setDefaultValue([...defaultValue]);
|
|
11652
11659
|
if (props.filter && props.filter(type2, arr)) {
|
|
11653
11660
|
return props.filter(type2, arr);
|
|
@@ -11709,7 +11716,7 @@ const DatePicker = (props) => {
|
|
|
11709
11716
|
onClose: onCloseDatePicker,
|
|
11710
11717
|
defaultValueData: defaultValue,
|
|
11711
11718
|
onConfirm: (values, options2) => onConfirmDatePicker && onConfirmDatePicker(values, options2),
|
|
11712
|
-
onChange: (
|
|
11719
|
+
onChange: (index, value, list) => updateChooseValueCustmer(index, value, list),
|
|
11713
11720
|
threeDimensional,
|
|
11714
11721
|
ref: pickerRef
|
|
11715
11722
|
}));
|
|
@@ -11889,14 +11896,14 @@ const InputNumber = (props) => {
|
|
|
11889
11896
|
InputNumber.defaultProps = defaultProps$S;
|
|
11890
11897
|
InputNumber.displayName = "NutInputNumber";
|
|
11891
11898
|
function trimExtraChar(value, char, regExp) {
|
|
11892
|
-
const
|
|
11893
|
-
if (
|
|
11899
|
+
const index = value.indexOf(char);
|
|
11900
|
+
if (index === -1) {
|
|
11894
11901
|
return value;
|
|
11895
11902
|
}
|
|
11896
|
-
if (char === "-" &&
|
|
11897
|
-
return value.slice(0,
|
|
11903
|
+
if (char === "-" && index !== 0) {
|
|
11904
|
+
return value.slice(0, index);
|
|
11898
11905
|
}
|
|
11899
|
-
return value.slice(0,
|
|
11906
|
+
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
11900
11907
|
}
|
|
11901
11908
|
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
11902
11909
|
if (allowDot) {
|
|
@@ -12248,7 +12255,7 @@ const RadioGroup = React__default.forwardRef(
|
|
|
12248
12255
|
return val2State === child.props.value;
|
|
12249
12256
|
}
|
|
12250
12257
|
function cloneChildren() {
|
|
12251
|
-
return React__default.Children.map(children, (child,
|
|
12258
|
+
return React__default.Children.map(children, (child, index) => {
|
|
12252
12259
|
const childChecked = validateChildChecked(child);
|
|
12253
12260
|
if (child.type.displayName !== "NutRadio") {
|
|
12254
12261
|
return React__default.cloneElement(child);
|
|
@@ -12427,14 +12434,14 @@ const Rate = (props) => {
|
|
|
12427
12434
|
const pxCheck2 = (value) => {
|
|
12428
12435
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
12429
12436
|
};
|
|
12430
|
-
const onClick = (e2,
|
|
12437
|
+
const onClick = (e2, index) => {
|
|
12431
12438
|
e2.preventDefault();
|
|
12432
12439
|
e2.stopPropagation();
|
|
12433
12440
|
if (disabled || readonly)
|
|
12434
12441
|
return;
|
|
12435
12442
|
let value = 0;
|
|
12436
|
-
if (!(
|
|
12437
|
-
value =
|
|
12443
|
+
if (!(index === 1 && score === index)) {
|
|
12444
|
+
value = index;
|
|
12438
12445
|
if (allowHalf) {
|
|
12439
12446
|
if ((e2 == null ? void 0 : e2.target).className.includes("__icon--half")) {
|
|
12440
12447
|
value -= 0.5;
|
|
@@ -12618,11 +12625,11 @@ const ShortPassword = (props) => {
|
|
|
12618
12625
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
12619
12626
|
className: b2("input-fake"),
|
|
12620
12627
|
onClick: () => focus()
|
|
12621
|
-
}, [...new Array(comLen).keys()].map((item,
|
|
12628
|
+
}, [...new Array(comLen).keys()].map((item, index) => {
|
|
12622
12629
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
12623
12630
|
className: b2("input-fake__li"),
|
|
12624
|
-
key:
|
|
12625
|
-
}, String(inputValue).length >
|
|
12631
|
+
key: index
|
|
12632
|
+
}, String(inputValue).length > index ? /* @__PURE__ */ React__default.createElement("div", {
|
|
12626
12633
|
className: b2("input-fake__li__icon")
|
|
12627
12634
|
}) : null);
|
|
12628
12635
|
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -13165,9 +13172,9 @@ const InternalUploader = (props, ref) => {
|
|
|
13165
13172
|
});
|
|
13166
13173
|
}
|
|
13167
13174
|
}));
|
|
13168
|
-
const clearUploadQueue = (
|
|
13169
|
-
if (
|
|
13170
|
-
uploadQueue.splice(
|
|
13175
|
+
const clearUploadQueue = (index = -1) => {
|
|
13176
|
+
if (index > -1) {
|
|
13177
|
+
uploadQueue.splice(index, 1);
|
|
13171
13178
|
setUploadQueue(uploadQueue);
|
|
13172
13179
|
} else {
|
|
13173
13180
|
setUploadQueue([]);
|
|
@@ -13176,7 +13183,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13176
13183
|
const clearInputValue = (el) => {
|
|
13177
13184
|
el.value = "";
|
|
13178
13185
|
};
|
|
13179
|
-
const executeUpload = (fileItem,
|
|
13186
|
+
const executeUpload = (fileItem, index) => {
|
|
13180
13187
|
const uploadOption = new UploadOptions();
|
|
13181
13188
|
uploadOption.url = url;
|
|
13182
13189
|
for (const [key, value] of Object.entries(data)) {
|
|
@@ -13194,7 +13201,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13194
13201
|
} catch (error) {
|
|
13195
13202
|
}
|
|
13196
13203
|
uploadOption.onStart = (option) => {
|
|
13197
|
-
clearUploadQueue(
|
|
13204
|
+
clearUploadQueue(index);
|
|
13198
13205
|
setFileList((fileList2) => {
|
|
13199
13206
|
fileList2.map((item) => {
|
|
13200
13207
|
if (item.uid === fileItem.uid) {
|
|
@@ -13267,7 +13274,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13267
13274
|
}
|
|
13268
13275
|
};
|
|
13269
13276
|
const readFile = (files) => {
|
|
13270
|
-
files.forEach((file,
|
|
13277
|
+
files.forEach((file, index) => {
|
|
13271
13278
|
const formData = new FormData();
|
|
13272
13279
|
formData.append(name, file);
|
|
13273
13280
|
const fileItem = new FileItem();
|
|
@@ -13277,7 +13284,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13277
13284
|
fileItem.formData = formData;
|
|
13278
13285
|
fileItem.uid = file.lastModified + fileItem.uid;
|
|
13279
13286
|
fileItem.message = locale.uploader.readyUpload;
|
|
13280
|
-
executeUpload(fileItem,
|
|
13287
|
+
executeUpload(fileItem, index);
|
|
13281
13288
|
if (isPreview && file.type.includes("image")) {
|
|
13282
13289
|
const reader = new FileReader();
|
|
13283
13290
|
reader.onload = (event) => {
|
|
@@ -13309,15 +13316,15 @@ const InternalUploader = (props, ref) => {
|
|
|
13309
13316
|
filterFile.splice(maximum2, filterFile.length - maximum2);
|
|
13310
13317
|
}
|
|
13311
13318
|
if (fileList.length !== 0) {
|
|
13312
|
-
const
|
|
13313
|
-
filterFile.splice(
|
|
13319
|
+
const index = maximum2 - fileList.length;
|
|
13320
|
+
filterFile.splice(index, filterFile.length - index);
|
|
13314
13321
|
}
|
|
13315
13322
|
return filterFile;
|
|
13316
13323
|
};
|
|
13317
|
-
const onDelete = (file,
|
|
13318
|
-
clearUploadQueue(
|
|
13324
|
+
const onDelete = (file, index) => {
|
|
13325
|
+
clearUploadQueue(index);
|
|
13319
13326
|
if (onBeforeDelete && onBeforeDelete(file, fileList)) {
|
|
13320
|
-
fileList.splice(
|
|
13327
|
+
fileList.splice(index, 1);
|
|
13321
13328
|
onRemove && onRemove(file, fileList);
|
|
13322
13329
|
setFileList([...fileList]);
|
|
13323
13330
|
} else {
|
|
@@ -13371,7 +13378,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13371
13378
|
disabled,
|
|
13372
13379
|
multiple,
|
|
13373
13380
|
onChange: fileChange
|
|
13374
|
-
})))), fileList.length !== 0 && fileList.map((item,
|
|
13381
|
+
})))), fileList.length !== 0 && fileList.map((item, index) => {
|
|
13375
13382
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13376
13383
|
className: `nut-uploader__preview ${listType}`,
|
|
13377
13384
|
key: item.uid
|
|
@@ -13396,7 +13403,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13396
13403
|
color: "rgba(0,0,0,0.6)",
|
|
13397
13404
|
className: "close",
|
|
13398
13405
|
name: "failure",
|
|
13399
|
-
onClick: () => onDelete(item,
|
|
13406
|
+
onClick: () => onDelete(item, index)
|
|
13400
13407
|
}), item.type.includes("image") ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, item.url && /* @__PURE__ */ React__default.createElement("img", {
|
|
13401
13408
|
className: "nut-uploader__preview-img__c",
|
|
13402
13409
|
src: item.url,
|
|
@@ -13434,7 +13441,7 @@ const InternalUploader = (props, ref) => {
|
|
|
13434
13441
|
color: "#808080",
|
|
13435
13442
|
className: "nut-uploader__preview-img__file__del",
|
|
13436
13443
|
name: "del",
|
|
13437
|
-
onClick: () => onDelete(item,
|
|
13444
|
+
onClick: () => onDelete(item, index)
|
|
13438
13445
|
}), item.status === "uploading" && /* @__PURE__ */ React__default.createElement(Progress, {
|
|
13439
13446
|
size: "small",
|
|
13440
13447
|
percentage: item.percentage,
|
|
@@ -13816,8 +13823,8 @@ const InternalCascader = (props) => {
|
|
|
13816
13823
|
}
|
|
13817
13824
|
if (needToSync.length && currentValue2 === value) {
|
|
13818
13825
|
const pathNodes = state.tree.getPathNodesByValue(needToSync);
|
|
13819
|
-
pathNodes.forEach((node,
|
|
13820
|
-
state.tabsCursor =
|
|
13826
|
+
pathNodes.forEach((node, index) => {
|
|
13827
|
+
state.tabsCursor = index;
|
|
13821
13828
|
chooseItem(node, true);
|
|
13822
13829
|
});
|
|
13823
13830
|
}
|
|
@@ -13915,12 +13922,12 @@ const InternalCascader = (props) => {
|
|
|
13915
13922
|
}, title), /* @__PURE__ */ React__default.createElement(Tabs, {
|
|
13916
13923
|
value: tabvalue,
|
|
13917
13924
|
titleNode: () => {
|
|
13918
|
-
return optiosData.map((pane,
|
|
13925
|
+
return optiosData.map((pane, index) => {
|
|
13919
13926
|
var _a, _b;
|
|
13920
13927
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
13921
13928
|
onClick: () => {
|
|
13922
13929
|
setTabvalue(pane.paneKey);
|
|
13923
|
-
state.tabsCursor =
|
|
13930
|
+
state.tabsCursor = index;
|
|
13924
13931
|
},
|
|
13925
13932
|
className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "active" : ""}`,
|
|
13926
13933
|
key: pane.paneKey
|
|
@@ -13936,10 +13943,10 @@ const InternalCascader = (props) => {
|
|
|
13936
13943
|
paneKey: pane.paneKey
|
|
13937
13944
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
13938
13945
|
className: classesPane
|
|
13939
|
-
}, pane.nodes && pane.nodes.map((node,
|
|
13946
|
+
}, pane.nodes && pane.nodes.map((node, index) => {
|
|
13940
13947
|
var _a;
|
|
13941
13948
|
return /* @__PURE__ */ React__default.createElement(CascaderItem, {
|
|
13942
|
-
key:
|
|
13949
|
+
key: index,
|
|
13943
13950
|
...props,
|
|
13944
13951
|
data: node,
|
|
13945
13952
|
checked: ((_a = pane.selectedNode) == null ? void 0 : _a.value) === node.value,
|
|
@@ -14005,6 +14012,7 @@ const SearchBar = (props) => {
|
|
|
14005
14012
|
onFocus,
|
|
14006
14013
|
onBlur,
|
|
14007
14014
|
onClear,
|
|
14015
|
+
onCancel,
|
|
14008
14016
|
onSearch,
|
|
14009
14017
|
onClickInput,
|
|
14010
14018
|
onClickLeftinIcon,
|
|
@@ -14052,6 +14060,7 @@ const SearchBar = (props) => {
|
|
|
14052
14060
|
disabled,
|
|
14053
14061
|
readOnly,
|
|
14054
14062
|
maxLength,
|
|
14063
|
+
onKeyPress: onKeypress,
|
|
14055
14064
|
onChange: (e2) => change(e2),
|
|
14056
14065
|
onFocus: (e2) => focus(e2),
|
|
14057
14066
|
onBlur: (e2) => blur(e2),
|
|
@@ -14130,13 +14139,22 @@ const SearchBar = (props) => {
|
|
|
14130
14139
|
if (actionText) {
|
|
14131
14140
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14132
14141
|
className: searchbarBem("action-text"),
|
|
14133
|
-
onClick:
|
|
14142
|
+
onClick: cancel
|
|
14134
14143
|
}, actionText);
|
|
14135
14144
|
}
|
|
14136
14145
|
return null;
|
|
14137
14146
|
};
|
|
14138
|
-
const
|
|
14139
|
-
|
|
14147
|
+
const onKeypress = (e2) => {
|
|
14148
|
+
if (e2.key === "Enter") {
|
|
14149
|
+
const event = e2.nativeEvent;
|
|
14150
|
+
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
14151
|
+
event.preventDefault();
|
|
14152
|
+
}
|
|
14153
|
+
onSearch && onSearch(value);
|
|
14154
|
+
}
|
|
14155
|
+
};
|
|
14156
|
+
const cancel = () => {
|
|
14157
|
+
onCancel && onCancel();
|
|
14140
14158
|
};
|
|
14141
14159
|
const renderLabel = () => {
|
|
14142
14160
|
if (label) {
|
|
@@ -14303,9 +14321,9 @@ const NumberKeyboard = (props) => {
|
|
|
14303
14321
|
className: b2("body")
|
|
14304
14322
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
14305
14323
|
className: b2("body__keys")
|
|
14306
|
-
}, keysList == null ? void 0 : keysList.map((item,
|
|
14324
|
+
}, keysList == null ? void 0 : keysList.map((item, index) => {
|
|
14307
14325
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14308
|
-
key:
|
|
14326
|
+
key: index,
|
|
14309
14327
|
className: classNames({
|
|
14310
14328
|
"key-board-wrapper": true,
|
|
14311
14329
|
"key-board-wrapper-large": item.id === 0 && type === "rightColumn" && Array.isArray(customKey) && customKey.length === 1
|
|
@@ -14397,9 +14415,9 @@ const ActionSheet = (props) => {
|
|
|
14397
14415
|
const cancelActionSheet = () => {
|
|
14398
14416
|
onCancel && onCancel();
|
|
14399
14417
|
};
|
|
14400
|
-
const chooseItem = (item,
|
|
14418
|
+
const chooseItem = (item, index) => {
|
|
14401
14419
|
if (!item.disable) {
|
|
14402
|
-
onChoose && onChoose(item,
|
|
14420
|
+
onChoose && onChoose(item, index);
|
|
14403
14421
|
}
|
|
14404
14422
|
};
|
|
14405
14423
|
return /* @__PURE__ */ React__default.createElement(Popup, {
|
|
@@ -14419,12 +14437,12 @@ const ActionSheet = (props) => {
|
|
|
14419
14437
|
className: `${b2("item")} desc`
|
|
14420
14438
|
}, description), menuItems.length ? /* @__PURE__ */ React__default.createElement("div", {
|
|
14421
14439
|
className: b2("menu")
|
|
14422
|
-
}, menuItems.map((item,
|
|
14440
|
+
}, menuItems.map((item, index) => {
|
|
14423
14441
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
14424
14442
|
className: `${b2("item")} ${item.disable ? b2("item-disabled") : ""}`,
|
|
14425
14443
|
style: { color: isHighlight(item) },
|
|
14426
|
-
key:
|
|
14427
|
-
onClick: () => chooseItem(item,
|
|
14444
|
+
key: index,
|
|
14445
|
+
onClick: () => chooseItem(item, index)
|
|
14428
14446
|
}, item[optionTag], /* @__PURE__ */ React__default.createElement("div", {
|
|
14429
14447
|
className: "subdesc"
|
|
14430
14448
|
}, item[optionSubTag]));
|
|
@@ -15821,9 +15839,9 @@ const CircleProgress = (props) => {
|
|
|
15821
15839
|
y1: "0%",
|
|
15822
15840
|
x2: "0%",
|
|
15823
15841
|
y2: "0%"
|
|
15824
|
-
}, (_a = stop2()) == null ? void 0 : _a.map((item,
|
|
15842
|
+
}, (_a = stop2()) == null ? void 0 : _a.map((item, index) => {
|
|
15825
15843
|
return /* @__PURE__ */ React__default.createElement("stop", {
|
|
15826
|
-
key:
|
|
15844
|
+
key: index,
|
|
15827
15845
|
offset: item.key,
|
|
15828
15846
|
stopColor: item.value
|
|
15829
15847
|
});
|
|
@@ -15930,8 +15948,8 @@ const NoticeBar = (props) => {
|
|
|
15930
15948
|
};
|
|
15931
15949
|
}, []);
|
|
15932
15950
|
const cloneChild = (listItem, listIndex) => {
|
|
15933
|
-
return React__default.Children.map(children, function(child,
|
|
15934
|
-
if (child &&
|
|
15951
|
+
return React__default.Children.map(children, function(child, index) {
|
|
15952
|
+
if (child && index === listIndex) {
|
|
15935
15953
|
return React__default.cloneElement(child, {
|
|
15936
15954
|
key: listIndex,
|
|
15937
15955
|
children: listItem
|
|
@@ -16110,16 +16128,16 @@ const NoticeBar = (props) => {
|
|
|
16110
16128
|
}, children ? /* @__PURE__ */ React__default.createElement("div", {
|
|
16111
16129
|
className: "horseLamp_list",
|
|
16112
16130
|
style: horseLampStyle
|
|
16113
|
-
}, scrollList.current.map((item,
|
|
16114
|
-
return cloneChild(item,
|
|
16131
|
+
}, scrollList.current.map((item, index) => {
|
|
16132
|
+
return cloneChild(item, index);
|
|
16115
16133
|
})) : /* @__PURE__ */ React__default.createElement("ul", {
|
|
16116
16134
|
className: "horseLamp_list",
|
|
16117
16135
|
style: horseLampStyle
|
|
16118
|
-
}, scrollList.current.map((item,
|
|
16136
|
+
}, scrollList.current.map((item, index) => {
|
|
16119
16137
|
return /* @__PURE__ */ React__default.createElement("li", {
|
|
16120
16138
|
className: "horseLamp_list_item",
|
|
16121
16139
|
style: { height },
|
|
16122
|
-
key:
|
|
16140
|
+
key: index,
|
|
16123
16141
|
onClick: () => {
|
|
16124
16142
|
go(item);
|
|
16125
16143
|
}
|
|
@@ -16139,7 +16157,7 @@ const NoticeBar = (props) => {
|
|
|
16139
16157
|
};
|
|
16140
16158
|
NoticeBar.defaultProps = defaultProps$v;
|
|
16141
16159
|
NoticeBar.displayName = "NutNoticeBar";
|
|
16142
|
-
const DataContext$1 = createContext({});
|
|
16160
|
+
const DataContext$1 = createContext$1({});
|
|
16143
16161
|
const defaultProps$u = {
|
|
16144
16162
|
current: 0,
|
|
16145
16163
|
direction: "horizontal",
|
|
@@ -16211,10 +16229,10 @@ const Step = (props) => {
|
|
|
16211
16229
|
const parent = useContext$1(DataContext$1);
|
|
16212
16230
|
const dot = parent.propSteps.progressDot;
|
|
16213
16231
|
const getCurrentStatus = () => {
|
|
16214
|
-
const
|
|
16215
|
-
if (
|
|
16232
|
+
const index = activeIndex;
|
|
16233
|
+
if (index < +parent.propSteps.current)
|
|
16216
16234
|
return "finish";
|
|
16217
|
-
return
|
|
16235
|
+
return index === +parent.propSteps.current ? "process" : "wait";
|
|
16218
16236
|
};
|
|
16219
16237
|
const handleClickStep = () => {
|
|
16220
16238
|
var _a, _b;
|
|
@@ -16270,7 +16288,7 @@ const Step = (props) => {
|
|
|
16270
16288
|
};
|
|
16271
16289
|
Step.defaultProps = defaultProps$t;
|
|
16272
16290
|
Step.displayName = "NutStep";
|
|
16273
|
-
const DataContext = createContext({});
|
|
16291
|
+
const DataContext = createContext$1({});
|
|
16274
16292
|
const defaultProps$s = {
|
|
16275
16293
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
16276
16294
|
height: 0,
|
|
@@ -16409,17 +16427,17 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
16409
16427
|
});
|
|
16410
16428
|
});
|
|
16411
16429
|
};
|
|
16412
|
-
const to2 = (
|
|
16430
|
+
const to2 = (index) => {
|
|
16413
16431
|
resettPosition();
|
|
16414
16432
|
touchReset();
|
|
16415
16433
|
requestFrame(() => {
|
|
16416
16434
|
requestFrame(() => {
|
|
16417
16435
|
_swiper.current.moving = false;
|
|
16418
16436
|
let targetIndex;
|
|
16419
|
-
if (props.loop && childCount ===
|
|
16420
|
-
targetIndex = active === 0 ? 0 :
|
|
16437
|
+
if (props.loop && childCount === index) {
|
|
16438
|
+
targetIndex = active === 0 ? 0 : index;
|
|
16421
16439
|
} else {
|
|
16422
|
-
targetIndex =
|
|
16440
|
+
targetIndex = index % childCount;
|
|
16423
16441
|
}
|
|
16424
16442
|
move({
|
|
16425
16443
|
pace: targetIndex - active,
|
|
@@ -16648,14 +16666,14 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
16648
16666
|
stopAutoPlay();
|
|
16649
16667
|
};
|
|
16650
16668
|
}, []);
|
|
16651
|
-
const itemStyle = (
|
|
16669
|
+
const itemStyle = (index) => {
|
|
16652
16670
|
const style = {};
|
|
16653
16671
|
const _direction = propSwiper.direction || direction;
|
|
16654
16672
|
const _size = size;
|
|
16655
16673
|
if (_size) {
|
|
16656
16674
|
style[_direction === "horizontal" ? "width" : "height"] = `${_size}px`;
|
|
16657
16675
|
}
|
|
16658
|
-
const offset2 = childOffset[
|
|
16676
|
+
const offset2 = childOffset[index];
|
|
16659
16677
|
if (offset2) {
|
|
16660
16678
|
style.transform = `translate3D${_direction === "horizontal" ? `(${offset2}px,0,0)` : `(0,${offset2}px,0)`}`;
|
|
16661
16679
|
}
|
|
@@ -16675,27 +16693,27 @@ const Swiper = React__default.forwardRef((props, ref) => {
|
|
|
16675
16693
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
16676
16694
|
className: contentClass,
|
|
16677
16695
|
ref: innerRef
|
|
16678
|
-
}, React__default.Children.map(childs, (child,
|
|
16696
|
+
}, React__default.Children.map(childs, (child, index) => {
|
|
16679
16697
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
16680
16698
|
className: b2("item-wrapper"),
|
|
16681
|
-
style: itemStyle(
|
|
16682
|
-
key:
|
|
16699
|
+
style: itemStyle(index),
|
|
16700
|
+
key: index
|
|
16683
16701
|
}, child);
|
|
16684
16702
|
})), propSwiper.paginationVisible && !("pageContent" in propSwiper) ? /* @__PURE__ */ React__default.createElement("div", {
|
|
16685
16703
|
className: classNames({
|
|
16686
16704
|
[`${b2("pagination")}`]: true,
|
|
16687
16705
|
[`${b2("pagination-vertical")}`]: isVertical
|
|
16688
16706
|
})
|
|
16689
|
-
}, React__default.Children.map(childs, (item,
|
|
16707
|
+
}, React__default.Children.map(childs, (item, index) => {
|
|
16690
16708
|
return /* @__PURE__ */ React__default.createElement("i", {
|
|
16691
|
-
style: (active + childCount) % childCount ===
|
|
16709
|
+
style: (active + childCount) % childCount === index ? {
|
|
16692
16710
|
backgroundColor: propSwiper.paginationColor
|
|
16693
16711
|
} : void 0,
|
|
16694
16712
|
className: classNames({
|
|
16695
16713
|
[`${b2("pagination-item")}`]: true,
|
|
16696
|
-
active: (active + childCount) % childCount ===
|
|
16714
|
+
active: (active + childCount) % childCount === index
|
|
16697
16715
|
}),
|
|
16698
|
-
key:
|
|
16716
|
+
key: index
|
|
16699
16717
|
});
|
|
16700
16718
|
})) : /* @__PURE__ */ React__default.createElement("div", null, pageContent)));
|
|
16701
16719
|
});
|
|
@@ -16726,7 +16744,7 @@ const SwiperItem = React__default.forwardRef((props, ref) => {
|
|
|
16726
16744
|
});
|
|
16727
16745
|
SwiperItem.defaultProps = defaultProps$r;
|
|
16728
16746
|
SwiperItem.displayName = "NutSwiperItem";
|
|
16729
|
-
const AvatarContext = createContext({});
|
|
16747
|
+
const AvatarContext = createContext$1({});
|
|
16730
16748
|
const defaultProps$q = {
|
|
16731
16749
|
...ComponentDefaults,
|
|
16732
16750
|
size: "",
|
|
@@ -16801,11 +16819,11 @@ const Avatar = (props) => {
|
|
|
16801
16819
|
children2[i].setAttribute("data-index", i + 1);
|
|
16802
16820
|
}
|
|
16803
16821
|
}
|
|
16804
|
-
const
|
|
16822
|
+
const index = Number((_b2 = (_a2 = avatarRef == null ? void 0 : avatarRef.current) == null ? void 0 : _a2.dataset) == null ? void 0 : _b2.index);
|
|
16805
16823
|
const maxCount = (_c2 = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _c2.maxCount;
|
|
16806
16824
|
setMaxSum(children2.length);
|
|
16807
|
-
setAvatarIndex(
|
|
16808
|
-
if (
|
|
16825
|
+
setAvatarIndex(index);
|
|
16826
|
+
if (index === children2.length && index !== maxCount && children2.length > maxCount) {
|
|
16809
16827
|
setShowMax(true);
|
|
16810
16828
|
}
|
|
16811
16829
|
};
|
|
@@ -17177,7 +17195,7 @@ const defaultProps$l = {
|
|
|
17177
17195
|
className: "",
|
|
17178
17196
|
onClick: (e2) => {
|
|
17179
17197
|
},
|
|
17180
|
-
onChoose: (item,
|
|
17198
|
+
onChoose: (item, index) => {
|
|
17181
17199
|
}
|
|
17182
17200
|
};
|
|
17183
17201
|
const Popover = (props) => {
|
|
@@ -17251,9 +17269,9 @@ const Popover = (props) => {
|
|
|
17251
17269
|
props.onClick(e2);
|
|
17252
17270
|
}
|
|
17253
17271
|
};
|
|
17254
|
-
const handleChoose = (item,
|
|
17272
|
+
const handleChoose = (item, index) => {
|
|
17255
17273
|
if (!item.disabled) {
|
|
17256
|
-
onChoose(item,
|
|
17274
|
+
onChoose(item, index);
|
|
17257
17275
|
}
|
|
17258
17276
|
};
|
|
17259
17277
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -17367,10 +17385,10 @@ const Skeleton = (props) => {
|
|
|
17367
17385
|
className: "skeleton-content-line"
|
|
17368
17386
|
}, title && /* @__PURE__ */ React__default.createElement("div", {
|
|
17369
17387
|
className: "skeleton-title"
|
|
17370
|
-
}), repeatLines(row).map((item,
|
|
17388
|
+
}), repeatLines(row).map((item, index) => {
|
|
17371
17389
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
17372
17390
|
className: blockClass,
|
|
17373
|
-
key:
|
|
17391
|
+
key: index,
|
|
17374
17392
|
style: { width, height }
|
|
17375
17393
|
});
|
|
17376
17394
|
})))));
|
|
@@ -17972,29 +17990,29 @@ const Empty = (props) => {
|
|
|
17972
17990
|
Empty.defaultProps = defaultProps$e;
|
|
17973
17991
|
Empty.displayName = "NutEmpty";
|
|
17974
17992
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
17975
|
-
let
|
|
17993
|
+
let index = 0;
|
|
17976
17994
|
const positions = Array(length);
|
|
17977
|
-
while (
|
|
17978
|
-
positions[
|
|
17979
|
-
index
|
|
17995
|
+
while (index < length) {
|
|
17996
|
+
positions[index] = {
|
|
17997
|
+
index,
|
|
17980
17998
|
height: reaItemSize,
|
|
17981
17999
|
width: reaItemSize,
|
|
17982
|
-
top:
|
|
17983
|
-
bottom: (
|
|
17984
|
-
left:
|
|
17985
|
-
right: (
|
|
18000
|
+
top: index * reaItemSize,
|
|
18001
|
+
bottom: (index + 1) * reaItemSize,
|
|
18002
|
+
left: index * reaItemSize,
|
|
18003
|
+
right: (index + 1) * reaItemSize
|
|
17986
18004
|
};
|
|
17987
|
-
|
|
18005
|
+
index++;
|
|
17988
18006
|
}
|
|
17989
18007
|
return positions;
|
|
17990
18008
|
};
|
|
17991
18009
|
const getListTotalSize = (positions, horizontal) => {
|
|
17992
|
-
const
|
|
18010
|
+
const index = positions.length - 1;
|
|
17993
18011
|
let size = 0;
|
|
17994
|
-
if (
|
|
18012
|
+
if (index < 0) {
|
|
17995
18013
|
size = 0;
|
|
17996
18014
|
} else {
|
|
17997
|
-
size = horizontal ? positions[
|
|
18015
|
+
size = horizontal ? positions[index].right : positions[index].bottom;
|
|
17998
18016
|
}
|
|
17999
18017
|
return size;
|
|
18000
18018
|
};
|
|
@@ -18056,25 +18074,25 @@ const getEndIndex = ({
|
|
|
18056
18074
|
const updateItemSize = (positions, items, sizeKey) => {
|
|
18057
18075
|
const newPos = positions.concat();
|
|
18058
18076
|
Array.from(items).forEach((item) => {
|
|
18059
|
-
const
|
|
18077
|
+
const index = Number(item.getAttribute("data-index"));
|
|
18060
18078
|
const styleVal = item.getAttribute("style");
|
|
18061
18079
|
if (styleVal && styleVal.includes("none"))
|
|
18062
18080
|
return;
|
|
18063
18081
|
const nowSize = item.getBoundingClientRect()[sizeKey];
|
|
18064
|
-
const oldSize = positions[
|
|
18082
|
+
const oldSize = positions[index][sizeKey];
|
|
18065
18083
|
const dValue = oldSize - nowSize;
|
|
18066
18084
|
if (dValue) {
|
|
18067
18085
|
if (sizeKey === "width") {
|
|
18068
|
-
newPos[
|
|
18069
|
-
newPos[
|
|
18070
|
-
for (let k2 =
|
|
18086
|
+
newPos[index].right -= dValue;
|
|
18087
|
+
newPos[index][sizeKey] = nowSize;
|
|
18088
|
+
for (let k2 = index + 1; k2 < positions.length; k2++) {
|
|
18071
18089
|
newPos[k2].left = positions[k2 - 1].right;
|
|
18072
18090
|
newPos[k2].right -= dValue;
|
|
18073
18091
|
}
|
|
18074
18092
|
} else if (sizeKey === "height") {
|
|
18075
|
-
newPos[
|
|
18076
|
-
newPos[
|
|
18077
|
-
for (let k2 =
|
|
18093
|
+
newPos[index].bottom -= dValue;
|
|
18094
|
+
newPos[index][sizeKey] = nowSize;
|
|
18095
|
+
for (let k2 = index + 1; k2 < positions.length; k2++) {
|
|
18078
18096
|
newPos[k2].top = positions[k2 - 1].bottom;
|
|
18079
18097
|
newPos[k2].bottom -= dValue;
|
|
18080
18098
|
}
|
|
@@ -18224,9 +18242,9 @@ const VirtualList = (props) => {
|
|
|
18224
18242
|
style: {
|
|
18225
18243
|
transform: horizontal ? `translate3d(${options2.startOffset}px,0,0)` : `translate3d(0,${options2.startOffset}px,0)`
|
|
18226
18244
|
}
|
|
18227
|
-
}, sourceData.slice(options2.overStart, options2.endIndex).map((data,
|
|
18245
|
+
}, sourceData.slice(options2.overStart, options2.endIndex).map((data, index) => {
|
|
18228
18246
|
const { startIndex, overStart } = options2;
|
|
18229
|
-
const dataIndex = overStart +
|
|
18247
|
+
const dataIndex = overStart + index;
|
|
18230
18248
|
const styleVal = dataIndex < startIndex ? "none" : "block";
|
|
18231
18249
|
const keyVal = key && data[key] ? data[key] : dataIndex;
|
|
18232
18250
|
return /* @__PURE__ */ React__default.createElement("li", {
|
|
@@ -18303,7 +18321,7 @@ const Table = (props) => {
|
|
|
18303
18321
|
return columns.filter((item) => item.key === value)[0];
|
|
18304
18322
|
};
|
|
18305
18323
|
const renderHeadCells = () => {
|
|
18306
|
-
return columns.map((item,
|
|
18324
|
+
return columns.map((item, index) => {
|
|
18307
18325
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
18308
18326
|
className: classNames(
|
|
18309
18327
|
"nut-table__main__head__tr__th",
|
|
@@ -18325,7 +18343,7 @@ const Table = (props) => {
|
|
|
18325
18343
|
});
|
|
18326
18344
|
};
|
|
18327
18345
|
const renderBodyTds = (item) => {
|
|
18328
|
-
return sortDataItem().map(([value, render2],
|
|
18346
|
+
return sortDataItem().map(([value, render2], index) => {
|
|
18329
18347
|
return /* @__PURE__ */ React__default.createElement("span", {
|
|
18330
18348
|
className: classNames(
|
|
18331
18349
|
"nut-table__main__body__tr__td",
|
|
@@ -18336,10 +18354,10 @@ const Table = (props) => {
|
|
|
18336
18354
|
});
|
|
18337
18355
|
};
|
|
18338
18356
|
const renderBoyTrs = () => {
|
|
18339
|
-
return curData.map((item,
|
|
18357
|
+
return curData.map((item, index) => {
|
|
18340
18358
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
18341
18359
|
className: "nut-table__main__body__tr",
|
|
18342
|
-
key:
|
|
18360
|
+
key: index
|
|
18343
18361
|
}, renderBodyTds(item));
|
|
18344
18362
|
});
|
|
18345
18363
|
};
|
|
@@ -18866,17 +18884,17 @@ const ImagePreview = (props) => {
|
|
|
18866
18884
|
initPage: initNo && (initNo > maxNo ? maxNo - 1 : initNo - 1),
|
|
18867
18885
|
paginationColor,
|
|
18868
18886
|
paginationVisible
|
|
18869
|
-
}, (videos && videos.length > 0 ? videos.map((item,
|
|
18887
|
+
}, (videos && videos.length > 0 ? videos.map((item, index) => {
|
|
18870
18888
|
return /* @__PURE__ */ React__default.createElement(SwiperItem, {
|
|
18871
|
-
key:
|
|
18889
|
+
key: index
|
|
18872
18890
|
}, /* @__PURE__ */ React__default.createElement(Video, {
|
|
18873
18891
|
source: item.source,
|
|
18874
18892
|
options: item.options
|
|
18875
18893
|
}));
|
|
18876
18894
|
}) : []).concat(
|
|
18877
|
-
images && images.length > 0 ? images.map((item,
|
|
18895
|
+
images && images.length > 0 ? images.map((item, index) => {
|
|
18878
18896
|
return /* @__PURE__ */ React__default.createElement(SwiperItem, {
|
|
18879
|
-
key:
|
|
18897
|
+
key: index
|
|
18880
18898
|
}, /* @__PURE__ */ React__default.createElement("img", {
|
|
18881
18899
|
src: item.src,
|
|
18882
18900
|
alt: "",
|
|
@@ -18923,7 +18941,7 @@ const ExistRender = (props) => {
|
|
|
18923
18941
|
addressDetail: "",
|
|
18924
18942
|
selectedAddress: false
|
|
18925
18943
|
};
|
|
18926
|
-
copyExistAdd.forEach((list,
|
|
18944
|
+
copyExistAdd.forEach((list, index) => {
|
|
18927
18945
|
if (list && list.selectedAddress) {
|
|
18928
18946
|
prevExistAdd = list;
|
|
18929
18947
|
}
|
|
@@ -18943,10 +18961,10 @@ const ExistRender = (props) => {
|
|
|
18943
18961
|
className: b2("exist-group")
|
|
18944
18962
|
}, /* @__PURE__ */ React__default.createElement("ul", {
|
|
18945
18963
|
className: b2("exist-ul")
|
|
18946
|
-
}, existAddress.map((item,
|
|
18964
|
+
}, existAddress.map((item, index) => {
|
|
18947
18965
|
return /* @__PURE__ */ React__default.createElement("li", {
|
|
18948
18966
|
className: b2("exist-item"),
|
|
18949
|
-
key:
|
|
18967
|
+
key: index
|
|
18950
18968
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
18951
18969
|
onClick: () => selectedExist(item)
|
|
18952
18970
|
}, /* @__PURE__ */ React__default.createElement(Icon$1, {
|
|
@@ -19029,18 +19047,18 @@ const CustomRender = (props) => {
|
|
|
19029
19047
|
return a.title.localeCompare(b22.title);
|
|
19030
19048
|
});
|
|
19031
19049
|
data.forEach((item) => {
|
|
19032
|
-
const
|
|
19050
|
+
const index = newData.findIndex(
|
|
19033
19051
|
(value) => value.title === item.title
|
|
19034
19052
|
);
|
|
19035
|
-
if (
|
|
19053
|
+
if (index <= -1) {
|
|
19036
19054
|
newData.push({
|
|
19037
19055
|
title: item.title,
|
|
19038
19056
|
list: [].concat(item)
|
|
19039
19057
|
});
|
|
19040
19058
|
} else {
|
|
19041
|
-
newData[
|
|
19059
|
+
newData[index] = {
|
|
19042
19060
|
title: item.title,
|
|
19043
|
-
list: newData[
|
|
19061
|
+
list: newData[index].list.concat(item)
|
|
19044
19062
|
};
|
|
19045
19063
|
}
|
|
19046
19064
|
});
|
|
@@ -19059,8 +19077,8 @@ const CustomRender = (props) => {
|
|
|
19059
19077
|
town: { name: "" }
|
|
19060
19078
|
});
|
|
19061
19079
|
const [lineDistance, setLineDistance] = useState(20);
|
|
19062
|
-
const getTabName = (item,
|
|
19063
|
-
if (tabIndex >
|
|
19080
|
+
const getTabName = (item, index) => {
|
|
19081
|
+
if (tabIndex > index) {
|
|
19064
19082
|
return item.name;
|
|
19065
19083
|
}
|
|
19066
19084
|
return locale.select;
|
|
@@ -19071,9 +19089,9 @@ const CustomRender = (props) => {
|
|
|
19071
19089
|
country: countryRef,
|
|
19072
19090
|
town: townRef
|
|
19073
19091
|
};
|
|
19074
|
-
const lineAnimation = (
|
|
19092
|
+
const lineAnimation = (index) => {
|
|
19075
19093
|
setTimeout(() => {
|
|
19076
|
-
const name = tabName[
|
|
19094
|
+
const name = tabName[index];
|
|
19077
19095
|
const refD = mapRef;
|
|
19078
19096
|
if (name && refD[name] && refD[name].current) {
|
|
19079
19097
|
const distance = refD[name].current.offsetLeft;
|
|
@@ -19122,10 +19140,10 @@ const CustomRender = (props) => {
|
|
|
19122
19140
|
onClose && onClose();
|
|
19123
19141
|
}
|
|
19124
19142
|
};
|
|
19125
|
-
const changeRegionTab = (item,
|
|
19126
|
-
if (getTabName(item,
|
|
19127
|
-
setTabIndex(
|
|
19128
|
-
lineAnimation(
|
|
19143
|
+
const changeRegionTab = (item, index, key) => {
|
|
19144
|
+
if (getTabName(item, index)) {
|
|
19145
|
+
setTabIndex(index);
|
|
19146
|
+
lineAnimation(index);
|
|
19129
19147
|
}
|
|
19130
19148
|
onTabClick && onTabClick(key);
|
|
19131
19149
|
};
|
|
@@ -19133,16 +19151,16 @@ const CustomRender = (props) => {
|
|
|
19133
19151
|
if (modelValue.length > 0) {
|
|
19134
19152
|
let tagIndex = 0;
|
|
19135
19153
|
const selectedRegionC = selectedRegion && Object.assign(selectedRegion);
|
|
19136
|
-
for (let
|
|
19137
|
-
if (regionList[tabName[
|
|
19138
|
-
tagIndex =
|
|
19139
|
-
setTabIndex(
|
|
19154
|
+
for (let index = 0; index < modelValue.length; index++) {
|
|
19155
|
+
if (regionList[tabName[index]].length === 0) {
|
|
19156
|
+
tagIndex = index - 1;
|
|
19157
|
+
setTabIndex(index - 1);
|
|
19140
19158
|
break;
|
|
19141
19159
|
} else {
|
|
19142
|
-
const val = modelValue[
|
|
19143
|
-
const arr = regionList[tabName[
|
|
19160
|
+
const val = modelValue[index];
|
|
19161
|
+
const arr = regionList[tabName[index]];
|
|
19144
19162
|
if (privateType === "custom") {
|
|
19145
|
-
selectedRegionC[[tabName[
|
|
19163
|
+
selectedRegionC[[tabName[index]]] = arr.filter(
|
|
19146
19164
|
(item) => item.id === val
|
|
19147
19165
|
)[0];
|
|
19148
19166
|
} else if (privateType === "custom2") {
|
|
@@ -19150,11 +19168,11 @@ const CustomRender = (props) => {
|
|
|
19150
19168
|
arr.forEach((item) => {
|
|
19151
19169
|
sumArr.push(...item.list);
|
|
19152
19170
|
});
|
|
19153
|
-
selectedRegionC[[tabName[
|
|
19171
|
+
selectedRegionC[[tabName[index]]] = sumArr.filter(
|
|
19154
19172
|
(item) => item.id === val
|
|
19155
19173
|
)[0];
|
|
19156
19174
|
}
|
|
19157
|
-
tagIndex =
|
|
19175
|
+
tagIndex = index;
|
|
19158
19176
|
setSelectedRegion(selectedRegionC);
|
|
19159
19177
|
}
|
|
19160
19178
|
}
|
|
@@ -19201,19 +19219,19 @@ const CustomRender = (props) => {
|
|
|
19201
19219
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
19202
19220
|
className: b2("region-tab")
|
|
19203
19221
|
}, selectedRegion && Object.keys(selectedRegion).map(
|
|
19204
|
-
(key,
|
|
19222
|
+
(key, index) => {
|
|
19205
19223
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
19206
|
-
className: `${b2("tab-item")} ${
|
|
19207
|
-
key:
|
|
19224
|
+
className: `${b2("tab-item")} ${index === tabIndex ? "active" : ""}`,
|
|
19225
|
+
key: index,
|
|
19208
19226
|
ref: mapRef[key],
|
|
19209
19227
|
onClick: () => changeRegionTab(
|
|
19210
19228
|
selectedRegion[key],
|
|
19211
|
-
|
|
19229
|
+
index,
|
|
19212
19230
|
key
|
|
19213
19231
|
)
|
|
19214
|
-
},
|
|
19232
|
+
}, index <= tabIndex && /* @__PURE__ */ React__default.createElement("div", null, getTabName(
|
|
19215
19233
|
selectedRegion[key],
|
|
19216
|
-
|
|
19234
|
+
index
|
|
19217
19235
|
)));
|
|
19218
19236
|
}
|
|
19219
19237
|
), /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -19225,9 +19243,9 @@ const CustomRender = (props) => {
|
|
|
19225
19243
|
}, /* @__PURE__ */ React__default.createElement("ul", {
|
|
19226
19244
|
className: b2("region-group")
|
|
19227
19245
|
}, regionList[tabName[tabIndex]].map(
|
|
19228
|
-
(item,
|
|
19246
|
+
(item, index) => {
|
|
19229
19247
|
return /* @__PURE__ */ React__default.createElement("li", {
|
|
19230
|
-
key:
|
|
19248
|
+
key: index,
|
|
19231
19249
|
className: b2("region-item")
|
|
19232
19250
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
19233
19251
|
onClick: () => {
|
|
@@ -19485,12 +19503,12 @@ const InternalBarrage = (props, ref) => {
|
|
|
19485
19503
|
const barrageContainer = useRef(null);
|
|
19486
19504
|
const barrageCWidth = useRef(0);
|
|
19487
19505
|
const timer = useRef(0);
|
|
19488
|
-
const
|
|
19506
|
+
const index = useRef(0);
|
|
19489
19507
|
const b2 = cn("barrage");
|
|
19490
19508
|
const classes = classNames(className, b2(""));
|
|
19491
19509
|
useImperativeHandle(ref, () => ({
|
|
19492
19510
|
add: (word) => {
|
|
19493
|
-
const _index =
|
|
19511
|
+
const _index = index.current % barrageList.length;
|
|
19494
19512
|
barrageList.splice(_index, 0, word);
|
|
19495
19513
|
}
|
|
19496
19514
|
}));
|
|
@@ -19511,7 +19529,7 @@ const InternalBarrage = (props, ref) => {
|
|
|
19511
19529
|
}, frequency);
|
|
19512
19530
|
};
|
|
19513
19531
|
const play = () => {
|
|
19514
|
-
const _index = loop2 ?
|
|
19532
|
+
const _index = loop2 ? index.current % barrageList.length : index.current;
|
|
19515
19533
|
const el = document.createElement(`div`);
|
|
19516
19534
|
el.innerHTML = barrageList[_index];
|
|
19517
19535
|
el.classList.add("barrage-item");
|
|
@@ -19527,7 +19545,7 @@ const InternalBarrage = (props, ref) => {
|
|
|
19527
19545
|
el.addEventListener("animationend", () => {
|
|
19528
19546
|
barrageContainer.current.removeChild(el);
|
|
19529
19547
|
});
|
|
19530
|
-
|
|
19548
|
+
index.current++;
|
|
19531
19549
|
};
|
|
19532
19550
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
19533
19551
|
className: classes,
|
|
@@ -19777,7 +19795,7 @@ const TimeDetail = (props) => {
|
|
|
19777
19795
|
};
|
|
19778
19796
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
19779
19797
|
className: `${b2()} ${className || ""}`
|
|
19780
|
-
}, renderData.map((item,
|
|
19798
|
+
}, renderData.map((item, index) => /* @__PURE__ */ React__default.createElement("span", {
|
|
19781
19799
|
className: getDetailClass(item),
|
|
19782
19800
|
key: item,
|
|
19783
19801
|
onClick: () => handleTime(item)
|
|
@@ -19909,11 +19927,11 @@ const TimeSelect = (props) => {
|
|
|
19909
19927
|
className: "nut-timeselect__content"
|
|
19910
19928
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
19911
19929
|
className: "nut-timeselect__content-left"
|
|
19912
|
-
}, dates.map((dataItem,
|
|
19930
|
+
}, dates.map((dataItem, index) => /* @__PURE__ */ React__default.createElement(TimePannel, {
|
|
19913
19931
|
date: dataItem.date,
|
|
19914
19932
|
className: getTimePannelClass(dataItem),
|
|
19915
|
-
key: String(dataItem["pannel-key"] ||
|
|
19916
|
-
curKey: String(dataItem["pannel-key"] ||
|
|
19933
|
+
key: String(dataItem["pannel-key"] || index),
|
|
19934
|
+
curKey: String(dataItem["pannel-key"] || index),
|
|
19917
19935
|
change: handleChange
|
|
19918
19936
|
}))), /* @__PURE__ */ React__default.createElement(TimeDetail, {
|
|
19919
19937
|
times,
|