@nutui/nutui-react 1.3.0 → 1.3.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Audio/style/index.js +4 -0
- package/dist/esm/Audio.js +293 -0
- package/dist/esm/Calendar/style/index.js +1 -2
- package/dist/esm/Calendar.js +80 -33
- package/dist/esm/CalendarItem.js +429 -231
- package/dist/esm/Cascader/style/index.js +2 -0
- package/dist/esm/Cascader.js +788 -0
- package/dist/esm/ConfigProvider.js +16 -0
- package/dist/esm/DatePicker.js +37 -6
- package/dist/esm/Dialog.js +9 -16
- package/dist/esm/Elevator.js +16 -5
- package/dist/esm/Grid/style/index.js +2 -0
- package/dist/esm/Grid.js +91 -0
- package/dist/esm/GridItem/style/index.js +2 -0
- package/dist/esm/GridItem.js +99 -0
- package/dist/esm/ImagePreview/style/index.js +2 -0
- package/dist/esm/ImagePreview.js +257 -0
- package/dist/esm/Menu/style/index.js +3 -0
- package/dist/esm/Menu.js +153 -0
- package/dist/esm/MenuItem/style/index.js +3 -0
- package/dist/esm/MenuItem.js +197 -0
- package/dist/esm/NoticeBar.js +3 -2
- package/dist/esm/Notify.js +2 -1
- package/dist/esm/Popover.js +4 -11
- package/dist/esm/Range.js +2 -45
- package/dist/esm/Swipe/style/index.js +2 -0
- package/dist/esm/Swipe.js +265 -0
- package/dist/esm/Swiper.js +2 -1
- package/dist/esm/TabPane.js +5 -33
- package/dist/esm/Tabs.js +6 -196
- package/dist/esm/TextArea.js +45 -4
- package/dist/esm/Toast.js +2 -1
- package/dist/esm/nutui-react.es.js +8 -0
- package/dist/esm/render-4a3856cb.js +32 -0
- package/dist/esm/tabpane-c957ab14.js +33 -0
- package/dist/esm/tabs-a48583e9.js +196 -0
- package/dist/esm/useClientRect-839d18c5.js +44 -0
- package/dist/locales/base.d.ts +16 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +17 -1
- package/dist/locales/id-ID.js +17 -1
- package/dist/locales/zh-CN.js +17 -1
- package/dist/locales/zh-TW.js +17 -1
- package/dist/nutui.react.es.js +2338 -530
- package/dist/nutui.react.umd.js +2345 -529
- package/dist/packages/audio/audio.scss +80 -0
- package/dist/packages/calendar/calendar.scss +57 -36
- package/dist/packages/calendaritem/calendaritem.scss +0 -191
- package/dist/packages/cascader/cascader.scss +69 -0
- package/dist/packages/grid/grid.scss +10 -0
- package/dist/packages/griditem/griditem.scss +103 -0
- package/dist/packages/imagepreview/imagepreview.scss +51 -0
- package/dist/packages/menu/menu.scss +72 -0
- package/dist/packages/menuitem/menuitem.scss +90 -0
- package/dist/packages/popup/popup.scss +1 -1
- package/dist/packages/searchbar/searchbar.scss +1 -0
- package/dist/packages/shortpassword/shortpassword.scss +6 -1
- package/dist/packages/swipe/swipe.scss +33 -0
- package/dist/packages/textarea/textarea.scss +16 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/iconfont.js +20 -18
- package/dist/styles/themes/default.scss +8 -0
- package/dist/styles/variables.scss +59 -8
- package/dist/types/audio/__test__/audio.spec.d.ts +1 -0
- package/dist/types/audio/audio.d.ts +18 -0
- package/dist/types/audio/audio.taro.d.ts +18 -0
- package/dist/types/audio/demo.d.ts +4 -0
- package/dist/types/audio/index.d.ts +2 -0
- package/dist/types/audio/index.taro.d.ts +2 -0
- package/dist/types/backtop/__test__/backtop.spec.d.ts +1 -0
- package/dist/types/calendar/__tests__/calendar.spec.d.ts +1 -0
- package/dist/types/calendar/calendar.d.ts +22 -2
- package/dist/types/calendar/demo.d.ts +1 -0
- package/dist/types/calendaritem/calendaritem.d.ts +21 -3
- package/dist/types/cascader/__tests__/cascader.spec.d.ts +1 -0
- package/dist/types/cascader/cascader.d.ts +25 -0
- package/dist/types/cascader/cascader.taro.d.ts +25 -0
- package/dist/types/cascader/cascaderItem.d.ts +25 -0
- package/dist/types/cascader/cascaderItem.taro.d.ts +25 -0
- package/dist/types/cascader/demo.d.ts +3 -0
- package/dist/types/cascader/helper.d.ts +4 -0
- package/dist/types/cascader/index.d.ts +2 -0
- package/dist/types/cascader/index.taro.d.ts +2 -0
- package/dist/types/cascader/tree.d.ts +12 -0
- package/dist/types/cascader/types.d.ts +28 -0
- package/dist/types/checkbox/checkbox.d.ts +2 -2
- package/dist/types/checkbox/checkbox.taro.d.ts +2 -2
- package/dist/types/checkboxgroup/checkboxgroup.d.ts +2 -2
- package/dist/types/checkboxgroup/checkboxgroup.taro.d.ts +2 -2
- package/dist/types/dialog/__test__/dialog.spec.d.ts +1 -0
- package/dist/types/dialog/config.d.ts +3 -3
- package/dist/types/dialog/dialog.d.ts +2 -1
- package/dist/types/dialog/dialog.taro.d.ts +2 -1
- package/dist/types/fixednav/fixednav.d.ts +2 -2
- package/dist/types/grid/__test__/grid.spec.d.ts +1 -0
- package/dist/types/grid/demo.d.ts +3 -0
- package/dist/types/grid/grid.d.ts +16 -0
- package/dist/types/grid/grid.taro.d.ts +16 -0
- package/dist/types/grid/index.d.ts +2 -0
- package/dist/types/grid/index.taro.d.ts +2 -0
- package/dist/types/griditem/griditem.d.ts +20 -0
- package/dist/types/griditem/griditem.taro.d.ts +20 -0
- package/dist/types/griditem/index.d.ts +2 -0
- package/dist/types/griditem/index.taro.d.ts +2 -0
- package/dist/types/icon/icon.d.ts +1 -2
- package/dist/types/icon/icon.taro.d.ts +1 -2
- package/dist/types/imagepreview/__test__/imagepreview.spec.d.ts +1 -0
- package/dist/types/imagepreview/demo.d.ts +3 -0
- package/dist/types/imagepreview/imagepreview.d.ts +26 -0
- package/dist/types/imagepreview/imagepreview.taro.d.ts +26 -0
- package/dist/types/imagepreview/index.d.ts +2 -0
- package/dist/types/imagepreview/index.taro.d.ts +2 -0
- package/dist/types/input/__test__/input.spec.d.ts +1 -0
- package/dist/types/menu/__test__/menu.spec.d.ts +1 -0
- package/dist/types/menu/demo.d.ts +4 -0
- package/dist/types/menu/index.d.ts +2 -0
- package/dist/types/menu/index.taro.d.ts +2 -0
- package/dist/types/menu/menu.d.ts +12 -0
- package/dist/types/menu/menu.taro.d.ts +12 -0
- package/dist/types/menuitem/index.d.ts +2 -0
- package/dist/types/menuitem/index.taro.d.ts +2 -0
- package/dist/types/menuitem/menuitem.d.ts +23 -0
- package/dist/types/menuitem/menuitem.taro.d.ts +23 -0
- package/dist/types/notify/__test__/notify.spec.d.ts +1 -0
- package/dist/types/notify/notify.d.ts +13 -0
- package/dist/types/notify/notify.taro.d.ts +13 -0
- package/dist/types/nutui.react.d.ts +95 -1
- package/dist/types/picker/doc.en.d.ts +142 -0
- package/dist/types/picker/picker.d.ts +2 -2
- package/dist/types/picker/picker.taro.d.ts +2 -2
- package/dist/types/popup/popup.d.ts +1 -1
- package/dist/types/popup/popup.taro.d.ts +1 -1
- package/dist/types/shortpassword/shortpassword.taro.d.ts +3 -3
- package/dist/types/sidenavbar/sidenavbar.d.ts +14 -2
- package/dist/types/sidenavbar/sidenavbar.taro.d.ts +14 -2
- package/dist/types/sidenavbaritem/sidenavbaritem.d.ts +10 -2
- package/dist/types/sidenavbaritem/sidenavbaritem.taro.d.ts +10 -2
- package/dist/types/subsidenavbar/subsidenavbar.d.ts +13 -3
- package/dist/types/subsidenavbar/subsidenavbar.taro.d.ts +13 -3
- package/dist/types/swipe/__tests__/swipe.spec.d.ts +1 -0
- package/dist/types/swipe/demo.d.ts +3 -0
- package/dist/types/swipe/index.d.ts +2 -0
- package/dist/types/swipe/index.taro.d.ts +2 -0
- package/dist/types/swipe/swipe.d.ts +41 -0
- package/dist/types/swipe/swipe.taro.d.ts +41 -0
- package/dist/types/swiper/swiper.d.ts +1 -2
- package/dist/types/swiperitem/swiperitem.d.ts +1 -2
- package/dist/types/table/table.d.ts +2 -1
- package/dist/types/table/table.taro.d.ts +2 -1
- package/dist/types/table/types.d.ts +1 -1
- package/dist/types/textarea/__test__/textarea.spec.d.ts +1 -0
- package/dist/types/toast/toast.d.ts +21 -0
- package/dist/types/toast/toast.taro.d.ts +18 -0
- package/dist/types/virtuallist/type.d.ts +1 -1
- package/dist/types/virtuallist/virtuallist.d.ts +2 -1
- package/dist/types/virtuallist/virtuallist.taro.d.ts +2 -1
- package/package.json +4 -4
package/dist/nutui.react.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react v1.3.0 Wed Aug
|
|
2
|
+
* @nutui/nutui-react v1.3.1-beta.0 Wed Aug 31 2022 13:31:29 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
classname.exports = classname_production_min;
|
|
73
73
|
}
|
|
74
74
|
const cn = classname.exports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
75
|
-
const defaultProps$
|
|
75
|
+
const defaultProps$1j = {
|
|
76
76
|
name: "",
|
|
77
77
|
size: "",
|
|
78
78
|
classPrefix: "nut-icon",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
onClick,
|
|
101
101
|
...rest
|
|
102
102
|
} = {
|
|
103
|
-
...defaultProps$
|
|
103
|
+
...defaultProps$1j,
|
|
104
104
|
...props
|
|
105
105
|
};
|
|
106
106
|
const isImage = name ? name.indexOf("/") !== -1 : false;
|
|
@@ -134,9 +134,9 @@
|
|
|
134
134
|
children
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
|
-
Icon.defaultProps = defaultProps$
|
|
137
|
+
Icon.defaultProps = defaultProps$1j;
|
|
138
138
|
Icon.displayName = "NutIcon";
|
|
139
|
-
const defaultProps$
|
|
139
|
+
const defaultProps$1i = {
|
|
140
140
|
className: "",
|
|
141
141
|
color: "",
|
|
142
142
|
shape: "round",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
style,
|
|
170
170
|
...rest
|
|
171
171
|
} = {
|
|
172
|
-
...defaultProps$
|
|
172
|
+
...defaultProps$1i,
|
|
173
173
|
...props
|
|
174
174
|
};
|
|
175
175
|
const getStyle = React.useCallback(() => {
|
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
name: icon
|
|
243
243
|
}) : "", children));
|
|
244
244
|
};
|
|
245
|
-
Button.defaultProps = defaultProps$
|
|
245
|
+
Button.defaultProps = defaultProps$1i;
|
|
246
246
|
Button.displayName = "NutButton";
|
|
247
247
|
function _setPrototypeOf(o, p2) {
|
|
248
248
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
@@ -704,7 +704,7 @@
|
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
706
|
};
|
|
707
|
-
_proto.render = function
|
|
707
|
+
_proto.render = function render2() {
|
|
708
708
|
return this.props.children;
|
|
709
709
|
};
|
|
710
710
|
return Provider2;
|
|
@@ -752,7 +752,7 @@
|
|
|
752
752
|
return defaultValue;
|
|
753
753
|
}
|
|
754
754
|
};
|
|
755
|
-
_proto2.render = function
|
|
755
|
+
_proto2.render = function render2() {
|
|
756
756
|
return onlyChild(this.props.children)(this.state.value);
|
|
757
757
|
};
|
|
758
758
|
return Consumer2;
|
|
@@ -1198,7 +1198,7 @@
|
|
|
1198
1198
|
this._pendingLocation = null;
|
|
1199
1199
|
}
|
|
1200
1200
|
};
|
|
1201
|
-
_proto.render = function
|
|
1201
|
+
_proto.render = function render2() {
|
|
1202
1202
|
return /* @__PURE__ */ React__default["default"].createElement(context.Provider, {
|
|
1203
1203
|
value: {
|
|
1204
1204
|
history: this.props.history,
|
|
@@ -1225,7 +1225,7 @@
|
|
|
1225
1225
|
return _this;
|
|
1226
1226
|
}
|
|
1227
1227
|
var _proto = MemoryRouter.prototype;
|
|
1228
|
-
_proto.render = function
|
|
1228
|
+
_proto.render = function render2() {
|
|
1229
1229
|
return /* @__PURE__ */ React__default["default"].createElement(Router, {
|
|
1230
1230
|
history: this.history,
|
|
1231
1231
|
children: this.props.children
|
|
@@ -1251,7 +1251,7 @@
|
|
|
1251
1251
|
if (this.props.onUnmount)
|
|
1252
1252
|
this.props.onUnmount.call(this, this);
|
|
1253
1253
|
};
|
|
1254
|
-
_proto.render = function
|
|
1254
|
+
_proto.render = function render2() {
|
|
1255
1255
|
return null;
|
|
1256
1256
|
};
|
|
1257
1257
|
return Lifecycle;
|
|
@@ -1324,7 +1324,7 @@
|
|
|
1324
1324
|
return _React$Component.apply(this, arguments) || this;
|
|
1325
1325
|
}
|
|
1326
1326
|
var _proto = Route.prototype;
|
|
1327
|
-
_proto.render = function
|
|
1327
|
+
_proto.render = function render2() {
|
|
1328
1328
|
var _this = this;
|
|
1329
1329
|
return /* @__PURE__ */ React__default["default"].createElement(context.Consumer, null, function(context$1) {
|
|
1330
1330
|
!context$1 ? invariant(false) : void 0;
|
|
@@ -1334,13 +1334,13 @@
|
|
|
1334
1334
|
location,
|
|
1335
1335
|
match
|
|
1336
1336
|
});
|
|
1337
|
-
var _this$props = _this.props, children = _this$props.children, component = _this$props.component,
|
|
1337
|
+
var _this$props = _this.props, children = _this$props.children, component = _this$props.component, render3 = _this$props.render;
|
|
1338
1338
|
if (Array.isArray(children) && isEmptyChildren(children)) {
|
|
1339
1339
|
children = null;
|
|
1340
1340
|
}
|
|
1341
1341
|
return /* @__PURE__ */ React__default["default"].createElement(context.Provider, {
|
|
1342
1342
|
value: props
|
|
1343
|
-
}, props.match ? children ? typeof children === "function" ? children(props) : children : component ? /* @__PURE__ */ React__default["default"].createElement(component, props) :
|
|
1343
|
+
}, props.match ? children ? typeof children === "function" ? children(props) : children : component ? /* @__PURE__ */ React__default["default"].createElement(component, props) : render3 ? render3(props) : null : typeof children === "function" ? children(props) : null);
|
|
1344
1344
|
});
|
|
1345
1345
|
};
|
|
1346
1346
|
return Route;
|
|
@@ -1404,7 +1404,7 @@
|
|
|
1404
1404
|
context2.location = addBasename(basename, createLocation(location));
|
|
1405
1405
|
context2.url = createURL(context2.location);
|
|
1406
1406
|
};
|
|
1407
|
-
_proto.render = function
|
|
1407
|
+
_proto.render = function render2() {
|
|
1408
1408
|
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
1409
|
var history = {
|
|
1410
1410
|
createHref: function createHref(path) {
|
|
@@ -1433,7 +1433,7 @@
|
|
|
1433
1433
|
return _React$Component.apply(this, arguments) || this;
|
|
1434
1434
|
}
|
|
1435
1435
|
var _proto = Switch2.prototype;
|
|
1436
|
-
_proto.render = function
|
|
1436
|
+
_proto.render = function render2() {
|
|
1437
1437
|
var _this = this;
|
|
1438
1438
|
return /* @__PURE__ */ React__default["default"].createElement(context.Consumer, null, function(context2) {
|
|
1439
1439
|
!context2 ? invariant(false) : void 0;
|
|
@@ -1460,7 +1460,7 @@
|
|
|
1460
1460
|
function useHistory() {
|
|
1461
1461
|
return useContext(historyContext);
|
|
1462
1462
|
}
|
|
1463
|
-
const defaultProps$
|
|
1463
|
+
const defaultProps$1h = {
|
|
1464
1464
|
title: null,
|
|
1465
1465
|
subTitle: null,
|
|
1466
1466
|
desc: "",
|
|
@@ -1500,7 +1500,7 @@
|
|
|
1500
1500
|
linkSlot,
|
|
1501
1501
|
...rest
|
|
1502
1502
|
} = {
|
|
1503
|
-
...defaultProps$
|
|
1503
|
+
...defaultProps$1h,
|
|
1504
1504
|
...props
|
|
1505
1505
|
};
|
|
1506
1506
|
const b2 = cn("cell");
|
|
@@ -1549,9 +1549,9 @@
|
|
|
1549
1549
|
className: b2("link")
|
|
1550
1550
|
}) : linkSlot));
|
|
1551
1551
|
};
|
|
1552
|
-
Cell.defaultProps = defaultProps$
|
|
1552
|
+
Cell.defaultProps = defaultProps$1h;
|
|
1553
1553
|
Cell.displayName = "NutCell";
|
|
1554
|
-
const defaultProps$
|
|
1554
|
+
const defaultProps$1g = {
|
|
1555
1555
|
title: "",
|
|
1556
1556
|
desc: "",
|
|
1557
1557
|
titleSlot: null,
|
|
@@ -1560,7 +1560,7 @@
|
|
|
1560
1560
|
};
|
|
1561
1561
|
const CellGroup = (props) => {
|
|
1562
1562
|
const { children, classPrefix, title, desc, titleSlot, descSlot } = {
|
|
1563
|
-
...defaultProps$
|
|
1563
|
+
...defaultProps$1g,
|
|
1564
1564
|
...props
|
|
1565
1565
|
};
|
|
1566
1566
|
const b2 = cn("cell-group");
|
|
@@ -1574,7 +1574,7 @@
|
|
|
1574
1574
|
className: b2("wrap")
|
|
1575
1575
|
}, children));
|
|
1576
1576
|
};
|
|
1577
|
-
CellGroup.defaultProps = defaultProps$
|
|
1577
|
+
CellGroup.defaultProps = defaultProps$1g;
|
|
1578
1578
|
CellGroup.displayName = "NutCellGroup";
|
|
1579
1579
|
var classnames = { exports: {} };
|
|
1580
1580
|
/*!
|
|
@@ -1936,7 +1936,7 @@
|
|
|
1936
1936
|
setTimeout(this.nextCallback, timeout);
|
|
1937
1937
|
}
|
|
1938
1938
|
};
|
|
1939
|
-
_proto.render = function
|
|
1939
|
+
_proto.render = function render2() {
|
|
1940
1940
|
var status = this.state.status;
|
|
1941
1941
|
if (status === UNMOUNTED) {
|
|
1942
1942
|
return null;
|
|
@@ -2107,7 +2107,7 @@
|
|
|
2107
2107
|
removeClass(node, doneClassName);
|
|
2108
2108
|
}
|
|
2109
2109
|
};
|
|
2110
|
-
_proto.render = function
|
|
2110
|
+
_proto.render = function render2() {
|
|
2111
2111
|
var _this$props = this.props;
|
|
2112
2112
|
_this$props.classNames;
|
|
2113
2113
|
var props = _objectWithoutPropertiesLoose$3(_this$props, ["classNames"]);
|
|
@@ -2127,7 +2127,7 @@
|
|
|
2127
2127
|
};
|
|
2128
2128
|
CSSTransition.propTypes = {};
|
|
2129
2129
|
var CSSTransition$1 = CSSTransition;
|
|
2130
|
-
const defaultProps$
|
|
2130
|
+
const defaultProps$1f = {
|
|
2131
2131
|
position: "center",
|
|
2132
2132
|
transition: "",
|
|
2133
2133
|
style: {},
|
|
@@ -2308,7 +2308,7 @@
|
|
|
2308
2308
|
}, [position]);
|
|
2309
2309
|
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, renderToContainer(teleport, renderNode()));
|
|
2310
2310
|
};
|
|
2311
|
-
Popup.defaultProps = defaultProps$
|
|
2311
|
+
Popup.defaultProps = defaultProps$1f;
|
|
2312
2312
|
Popup.displayName = "NutPopup";
|
|
2313
2313
|
const zhCN = {
|
|
2314
2314
|
save: "\u4FDD\u5B58",
|
|
@@ -2411,9 +2411,25 @@
|
|
|
2411
2411
|
title4: "\u641C\u7D22\u6846\u6587\u672C\u8BBE\u7F6E",
|
|
2412
2412
|
title5: "\u81EA\u5B9A\u4E49\u56FE\u6807\u8BBE\u7F6E",
|
|
2413
2413
|
title6: "\u6570\u636E\u6539\u53D8\u76D1\u542C"
|
|
2414
|
+
},
|
|
2415
|
+
audio: {
|
|
2416
|
+
back: "\u5FEB\u9000",
|
|
2417
|
+
forward: "\u5FEB\u8FDB",
|
|
2418
|
+
pause: "\u6682\u505C",
|
|
2419
|
+
start: "\u5F00\u59CB",
|
|
2420
|
+
mute: "\u9759\u97F3",
|
|
2421
|
+
tips: "onPlayEnd\u4E8B\u4EF6\u5728loop=false\u65F6\u624D\u4F1A\u89E6\u53D1"
|
|
2422
|
+
},
|
|
2423
|
+
datepicker: {
|
|
2424
|
+
year: "\u5E74",
|
|
2425
|
+
month: "\u6708",
|
|
2426
|
+
day: "\u65E5",
|
|
2427
|
+
hour: "\u65F6",
|
|
2428
|
+
min: "\u5206",
|
|
2429
|
+
seconds: "\u79D2"
|
|
2414
2430
|
}
|
|
2415
2431
|
};
|
|
2416
|
-
const defaultProps$
|
|
2432
|
+
const defaultProps$1e = {
|
|
2417
2433
|
locale: zhCN
|
|
2418
2434
|
};
|
|
2419
2435
|
const defaultConfigRef = {
|
|
@@ -2430,7 +2446,7 @@
|
|
|
2430
2446
|
};
|
|
2431
2447
|
const ConfigContext = React.createContext(null);
|
|
2432
2448
|
const ConfigProvider = (props) => {
|
|
2433
|
-
const { children, ...config2 } = { ...defaultProps$
|
|
2449
|
+
const { children, ...config2 } = { ...defaultProps$1e, ...props };
|
|
2434
2450
|
const parentConfig = useConfig();
|
|
2435
2451
|
return /* @__PURE__ */ React__default["default"].createElement(ConfigContext.Provider, {
|
|
2436
2452
|
value: {
|
|
@@ -2439,25 +2455,25 @@
|
|
|
2439
2455
|
}
|
|
2440
2456
|
}, children);
|
|
2441
2457
|
};
|
|
2442
|
-
ConfigProvider.defaultProps = defaultProps$
|
|
2458
|
+
ConfigProvider.defaultProps = defaultProps$1e;
|
|
2443
2459
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
2444
|
-
const defaultProps$
|
|
2460
|
+
const defaultProps$1d = {};
|
|
2445
2461
|
const Layout = (props) => {
|
|
2446
|
-
({ ...defaultProps$
|
|
2462
|
+
({ ...defaultProps$1d, ...props });
|
|
2447
2463
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2448
2464
|
className: "nut-layout"
|
|
2449
2465
|
}, "Layout");
|
|
2450
2466
|
};
|
|
2451
|
-
Layout.defaultProps = defaultProps$
|
|
2467
|
+
Layout.defaultProps = defaultProps$1d;
|
|
2452
2468
|
Layout.displayName = "NutLayout";
|
|
2453
2469
|
const DataContext$2 = React.createContext({});
|
|
2454
|
-
const defaultProps$
|
|
2470
|
+
const defaultProps$1c = {
|
|
2455
2471
|
span: "24",
|
|
2456
2472
|
offset: "0",
|
|
2457
2473
|
gutter: "0"
|
|
2458
2474
|
};
|
|
2459
2475
|
const Col = (props) => {
|
|
2460
|
-
const { span, offset, children, onClick } = { ...defaultProps$
|
|
2476
|
+
const { span, offset, children, onClick } = { ...defaultProps$1c, ...props };
|
|
2461
2477
|
const [colName, setColName] = React.useState("");
|
|
2462
2478
|
const [colStyle, setColStyle] = React.useState({});
|
|
2463
2479
|
const { gutter } = React.useContext(DataContext$2);
|
|
@@ -2483,9 +2499,9 @@
|
|
|
2483
2499
|
}
|
|
2484
2500
|
}, children);
|
|
2485
2501
|
};
|
|
2486
|
-
Col.defaultProps = defaultProps$
|
|
2502
|
+
Col.defaultProps = defaultProps$1c;
|
|
2487
2503
|
Col.displayName = "NutCol";
|
|
2488
|
-
const defaultProps$
|
|
2504
|
+
const defaultProps$1b = {
|
|
2489
2505
|
type: "",
|
|
2490
2506
|
justify: "start",
|
|
2491
2507
|
align: "flex-start",
|
|
@@ -2494,7 +2510,7 @@
|
|
|
2494
2510
|
};
|
|
2495
2511
|
const Row = (props) => {
|
|
2496
2512
|
const { children, type, justify, align, wrap, gutter, onClick } = {
|
|
2497
|
-
...defaultProps$
|
|
2513
|
+
...defaultProps$1b,
|
|
2498
2514
|
...props
|
|
2499
2515
|
};
|
|
2500
2516
|
const prefixCls = "nut-row";
|
|
@@ -2528,9 +2544,9 @@
|
|
|
2528
2544
|
children
|
|
2529
2545
|
));
|
|
2530
2546
|
};
|
|
2531
|
-
Row.defaultProps = defaultProps$
|
|
2547
|
+
Row.defaultProps = defaultProps$1b;
|
|
2532
2548
|
Row.displayName = "NutRow";
|
|
2533
|
-
const defaultProps$
|
|
2549
|
+
const defaultProps$1a = {
|
|
2534
2550
|
contentPosition: "center",
|
|
2535
2551
|
dashed: false,
|
|
2536
2552
|
hairline: true,
|
|
@@ -2547,7 +2563,7 @@
|
|
|
2547
2563
|
direction,
|
|
2548
2564
|
...rest
|
|
2549
2565
|
} = {
|
|
2550
|
-
...defaultProps$
|
|
2566
|
+
...defaultProps$1a,
|
|
2551
2567
|
...props
|
|
2552
2568
|
};
|
|
2553
2569
|
const dividerBem = cn("divider");
|
|
@@ -2568,9 +2584,153 @@
|
|
|
2568
2584
|
...rest
|
|
2569
2585
|
}, children);
|
|
2570
2586
|
};
|
|
2571
|
-
Divider.defaultProps = defaultProps$
|
|
2587
|
+
Divider.defaultProps = defaultProps$1a;
|
|
2572
2588
|
Divider.displayName = "NutDivider";
|
|
2573
|
-
const defaultProps$
|
|
2589
|
+
const defaultProps$19 = {
|
|
2590
|
+
columnNum: 4,
|
|
2591
|
+
border: true,
|
|
2592
|
+
gutter: 0,
|
|
2593
|
+
center: true,
|
|
2594
|
+
square: false,
|
|
2595
|
+
reverse: false,
|
|
2596
|
+
direction: "vertical",
|
|
2597
|
+
iconSize: 28,
|
|
2598
|
+
iconColor: ""
|
|
2599
|
+
};
|
|
2600
|
+
const Grid = (props) => {
|
|
2601
|
+
useConfig();
|
|
2602
|
+
const {
|
|
2603
|
+
children,
|
|
2604
|
+
columnNum,
|
|
2605
|
+
border,
|
|
2606
|
+
gutter,
|
|
2607
|
+
center,
|
|
2608
|
+
square,
|
|
2609
|
+
reverse,
|
|
2610
|
+
direction,
|
|
2611
|
+
style,
|
|
2612
|
+
iconSize,
|
|
2613
|
+
iconColor,
|
|
2614
|
+
className,
|
|
2615
|
+
...rest
|
|
2616
|
+
} = { ...defaultProps$19, ...props };
|
|
2617
|
+
const childrenDom = React__default["default"].Children.toArray(children);
|
|
2618
|
+
const pxCheck2 = (value) => {
|
|
2619
|
+
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
2620
|
+
};
|
|
2621
|
+
const b2 = cn("grid");
|
|
2622
|
+
const rootClass = () => {
|
|
2623
|
+
const prefixCls = b2();
|
|
2624
|
+
return `${className} ${prefixCls} ${border && !gutter ? `${b2("border")}` : ""}`;
|
|
2625
|
+
};
|
|
2626
|
+
const rootStyle = () => {
|
|
2627
|
+
let styleSelf = {};
|
|
2628
|
+
if (style) {
|
|
2629
|
+
styleSelf = style;
|
|
2630
|
+
}
|
|
2631
|
+
if (gutter) {
|
|
2632
|
+
styleSelf.paddingLeft = pxCheck2(gutter);
|
|
2633
|
+
}
|
|
2634
|
+
return styleSelf;
|
|
2635
|
+
};
|
|
2636
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2637
|
+
className: rootClass(),
|
|
2638
|
+
style: rootStyle(),
|
|
2639
|
+
...rest
|
|
2640
|
+
}, childrenDom.map((item, idex) => {
|
|
2641
|
+
return React__default["default"].cloneElement(item, {
|
|
2642
|
+
index: idex,
|
|
2643
|
+
columnNum,
|
|
2644
|
+
center,
|
|
2645
|
+
border,
|
|
2646
|
+
gutter,
|
|
2647
|
+
square,
|
|
2648
|
+
reverse,
|
|
2649
|
+
direction,
|
|
2650
|
+
parentIconSize: iconSize,
|
|
2651
|
+
parentIconColor: iconColor
|
|
2652
|
+
});
|
|
2653
|
+
}));
|
|
2654
|
+
};
|
|
2655
|
+
Grid.defaultProps = defaultProps$19;
|
|
2656
|
+
Grid.displayName = "NutGrid";
|
|
2657
|
+
const defaultProps$18 = {
|
|
2658
|
+
text: "",
|
|
2659
|
+
icon: "",
|
|
2660
|
+
iconSize: "",
|
|
2661
|
+
iconColor: "",
|
|
2662
|
+
parentIconSize: "",
|
|
2663
|
+
parentIconColor: "",
|
|
2664
|
+
columnNum: 4,
|
|
2665
|
+
border: true,
|
|
2666
|
+
gutter: 0,
|
|
2667
|
+
center: true,
|
|
2668
|
+
square: false,
|
|
2669
|
+
reverse: false,
|
|
2670
|
+
direction: "vertical"
|
|
2671
|
+
};
|
|
2672
|
+
const GridItem = (props) => {
|
|
2673
|
+
useConfig();
|
|
2674
|
+
const {
|
|
2675
|
+
children,
|
|
2676
|
+
columnNum,
|
|
2677
|
+
index: index2,
|
|
2678
|
+
gutter,
|
|
2679
|
+
square,
|
|
2680
|
+
text,
|
|
2681
|
+
icon,
|
|
2682
|
+
iconColor,
|
|
2683
|
+
iconSize,
|
|
2684
|
+
parentIconSize,
|
|
2685
|
+
parentIconColor,
|
|
2686
|
+
border,
|
|
2687
|
+
center,
|
|
2688
|
+
reverse,
|
|
2689
|
+
direction,
|
|
2690
|
+
...rest
|
|
2691
|
+
} = { ...defaultProps$18, ...props };
|
|
2692
|
+
const b2 = cn("grid-item");
|
|
2693
|
+
const pxCheck2 = (value) => {
|
|
2694
|
+
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
2695
|
+
};
|
|
2696
|
+
const rootStyle = () => {
|
|
2697
|
+
const style = {
|
|
2698
|
+
flexBasis: `${100 / +columnNum}%`
|
|
2699
|
+
};
|
|
2700
|
+
if (square) {
|
|
2701
|
+
style.paddingTop = `${100 / +columnNum}%`;
|
|
2702
|
+
} else if (gutter) {
|
|
2703
|
+
style.paddingRight = pxCheck2(gutter);
|
|
2704
|
+
if (index2 >= columnNum) {
|
|
2705
|
+
style.marginTop = pxCheck2(gutter);
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
return style;
|
|
2709
|
+
};
|
|
2710
|
+
const contentClass = () => {
|
|
2711
|
+
return `${b2("content")} ${border && b2("content--border")} ${border && gutter && b2("content--surround")} ${center && b2("content--center")} ${square && b2("content--square")} ${reverse && b2("content--reverse")} ${!!direction && b2(`content--${direction}`)}
|
|
2712
|
+
`;
|
|
2713
|
+
};
|
|
2714
|
+
const isIconName = () => {
|
|
2715
|
+
return typeof icon === "string";
|
|
2716
|
+
};
|
|
2717
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2718
|
+
className: b2(),
|
|
2719
|
+
style: rootStyle(),
|
|
2720
|
+
...rest
|
|
2721
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2722
|
+
className: contentClass()
|
|
2723
|
+
}, icon && isIconName() ? /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
2724
|
+
name: icon,
|
|
2725
|
+
size: iconSize || parentIconSize,
|
|
2726
|
+
color: iconColor || parentIconColor
|
|
2727
|
+
}) : /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, icon), text && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2728
|
+
className: "nut-grid-item__text"
|
|
2729
|
+
}, text), children && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children)));
|
|
2730
|
+
};
|
|
2731
|
+
GridItem.defaultProps = defaultProps$18;
|
|
2732
|
+
GridItem.displayName = "NutGridItem";
|
|
2733
|
+
const defaultProps$17 = {
|
|
2574
2734
|
title: "",
|
|
2575
2735
|
desc: "",
|
|
2576
2736
|
leftShow: true,
|
|
@@ -2603,7 +2763,7 @@
|
|
|
2603
2763
|
onClickBack,
|
|
2604
2764
|
onClickRight
|
|
2605
2765
|
} = {
|
|
2606
|
-
...defaultProps$
|
|
2766
|
+
...defaultProps$17,
|
|
2607
2767
|
...props
|
|
2608
2768
|
};
|
|
2609
2769
|
const b2 = cn("navbar");
|
|
@@ -2668,9 +2828,9 @@
|
|
|
2668
2828
|
className: `${b2("")}--placeholder`
|
|
2669
2829
|
}, renderWrapper()) : renderWrapper());
|
|
2670
2830
|
};
|
|
2671
|
-
NavBar.defaultProps = defaultProps$
|
|
2831
|
+
NavBar.defaultProps = defaultProps$17;
|
|
2672
2832
|
NavBar.displayName = "NutNavBar";
|
|
2673
|
-
const defaultProps
|
|
2833
|
+
const defaultProps$16 = {
|
|
2674
2834
|
fixednavClass: "nut-fixednav",
|
|
2675
2835
|
activeText: "",
|
|
2676
2836
|
unActiveText: "",
|
|
@@ -2696,7 +2856,7 @@
|
|
|
2696
2856
|
slotList,
|
|
2697
2857
|
slotBtn,
|
|
2698
2858
|
...rest
|
|
2699
|
-
} = { ...defaultProps
|
|
2859
|
+
} = { ...defaultProps$16, ...props };
|
|
2700
2860
|
const b2 = cn("fixednav");
|
|
2701
2861
|
const classes = classNames(
|
|
2702
2862
|
{
|
|
@@ -2747,9 +2907,9 @@
|
|
|
2747
2907
|
className: "text"
|
|
2748
2908
|
}, visible ? activeText || locale.fixednav.activeText : unActiveText || locale.fixednav.unActiveText))));
|
|
2749
2909
|
};
|
|
2750
|
-
FixedNav.defaultProps = defaultProps
|
|
2910
|
+
FixedNav.defaultProps = defaultProps$16;
|
|
2751
2911
|
FixedNav.displayName = "NutFixedNav";
|
|
2752
|
-
const defaultProps$
|
|
2912
|
+
const defaultProps$15 = {
|
|
2753
2913
|
visible: 0,
|
|
2754
2914
|
bottom: false,
|
|
2755
2915
|
size: 20,
|
|
@@ -2774,7 +2934,7 @@
|
|
|
2774
2934
|
style,
|
|
2775
2935
|
tabSwitch
|
|
2776
2936
|
} = {
|
|
2777
|
-
...defaultProps$
|
|
2937
|
+
...defaultProps$15,
|
|
2778
2938
|
...props
|
|
2779
2939
|
};
|
|
2780
2940
|
const b2 = cn("tabbar");
|
|
@@ -2809,9 +2969,9 @@
|
|
|
2809
2969
|
return React__default["default"].cloneElement(child, childProps);
|
|
2810
2970
|
}));
|
|
2811
2971
|
};
|
|
2812
|
-
Tabbar.defaultProps = defaultProps$
|
|
2972
|
+
Tabbar.defaultProps = defaultProps$15;
|
|
2813
2973
|
Tabbar.displayName = "NutTabbar";
|
|
2814
|
-
const defaultProps$
|
|
2974
|
+
const defaultProps$14 = {
|
|
2815
2975
|
dot: false,
|
|
2816
2976
|
size: "",
|
|
2817
2977
|
classPrefix: "nut-icon",
|
|
@@ -2843,7 +3003,7 @@
|
|
|
2843
3003
|
index: index2,
|
|
2844
3004
|
handleClick: handleClick2
|
|
2845
3005
|
} = {
|
|
2846
|
-
...defaultProps$
|
|
3006
|
+
...defaultProps$14,
|
|
2847
3007
|
...props
|
|
2848
3008
|
};
|
|
2849
3009
|
const b2 = cn("tabbar-item");
|
|
@@ -2885,7 +3045,7 @@
|
|
|
2885
3045
|
}, tabTitle)));
|
|
2886
3046
|
};
|
|
2887
3047
|
const elevatorContext = React.createContext({});
|
|
2888
|
-
const defaultProps$
|
|
3048
|
+
const defaultProps$13 = {
|
|
2889
3049
|
height: "200px",
|
|
2890
3050
|
acceptKey: "title",
|
|
2891
3051
|
indexList: [],
|
|
@@ -2908,7 +3068,7 @@
|
|
|
2908
3068
|
children,
|
|
2909
3069
|
...rest
|
|
2910
3070
|
} = {
|
|
2911
|
-
...defaultProps$
|
|
3071
|
+
...defaultProps$13,
|
|
2912
3072
|
...props
|
|
2913
3073
|
};
|
|
2914
3074
|
const b2 = cn("elevator");
|
|
@@ -2976,9 +3136,10 @@
|
|
|
2976
3136
|
const firstTouch = e2.touches[0];
|
|
2977
3137
|
touchState.current.y2 = firstTouch.pageY;
|
|
2978
3138
|
const delta = (touchState.current.y2 - touchState.current.y1) / spaceHeight || 0;
|
|
2979
|
-
const cacheIndex = state.current.anchorIndex + delta;
|
|
3139
|
+
const cacheIndex = state.current.anchorIndex + Math.ceil(delta);
|
|
2980
3140
|
setCodeIndex(cacheIndex);
|
|
2981
3141
|
scrollTo(cacheIndex);
|
|
3142
|
+
e2.preventDefault();
|
|
2982
3143
|
};
|
|
2983
3144
|
const touchEnd = () => {
|
|
2984
3145
|
resetScrollState();
|
|
@@ -3051,6 +3212,15 @@
|
|
|
3051
3212
|
return;
|
|
3052
3213
|
state.current.fixedTop = fixedTop;
|
|
3053
3214
|
}, [state.current.diff, titleHeight]);
|
|
3215
|
+
const refIndexBar = React.useRef(null);
|
|
3216
|
+
React.useEffect(() => {
|
|
3217
|
+
refIndexBar.current && refIndexBar.current.addEventListener("touchmove", touchMove, {
|
|
3218
|
+
passive: false
|
|
3219
|
+
});
|
|
3220
|
+
return () => {
|
|
3221
|
+
refIndexBar.current && refIndexBar.current.removeEventListener("touchmove", touchMove);
|
|
3222
|
+
};
|
|
3223
|
+
}, []);
|
|
3054
3224
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3055
3225
|
className: `${b2()} ${className}`,
|
|
3056
3226
|
...rest
|
|
@@ -3084,9 +3254,9 @@
|
|
|
3084
3254
|
}))), indexList.length && scrollStart ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3085
3255
|
className: b2("code--current", { current: true })
|
|
3086
3256
|
}, indexList[codeIndex][acceptKey]) : null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3257
|
+
ref: refIndexBar,
|
|
3087
3258
|
className: b2("bars"),
|
|
3088
|
-
onTouchStart: (event) => touchStart(event)
|
|
3089
|
-
onTouchMove: (event) => touchMove(event)
|
|
3259
|
+
onTouchStart: (event) => touchStart(event)
|
|
3090
3260
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3091
3261
|
className: b2("bars__inner")
|
|
3092
3262
|
}, indexList.map((item, index2) => {
|
|
@@ -3100,9 +3270,9 @@
|
|
|
3100
3270
|
}, item[acceptKey]);
|
|
3101
3271
|
}))));
|
|
3102
3272
|
};
|
|
3103
|
-
Elevator.defaultProps = defaultProps$
|
|
3273
|
+
Elevator.defaultProps = defaultProps$13;
|
|
3104
3274
|
Elevator.displayName = "NutElevator";
|
|
3105
|
-
const defaultProps$
|
|
3275
|
+
const defaultProps$12 = {
|
|
3106
3276
|
defaultValue: 1,
|
|
3107
3277
|
mode: "multi",
|
|
3108
3278
|
prevText: "",
|
|
@@ -3119,7 +3289,7 @@
|
|
|
3119
3289
|
};
|
|
3120
3290
|
const Pagination = (props) => {
|
|
3121
3291
|
const { locale } = useConfig();
|
|
3122
|
-
({ ...defaultProps$
|
|
3292
|
+
({ ...defaultProps$12, ...props });
|
|
3123
3293
|
const {
|
|
3124
3294
|
modelValue,
|
|
3125
3295
|
mode,
|
|
@@ -3236,7 +3406,7 @@
|
|
|
3236
3406
|
onClick: (e2) => selectPage(Number(currentPage) + 1, true)
|
|
3237
3407
|
}, nextText || locale.pagination.next));
|
|
3238
3408
|
};
|
|
3239
|
-
Pagination.defaultProps = defaultProps$
|
|
3409
|
+
Pagination.defaultProps = defaultProps$12;
|
|
3240
3410
|
Pagination.displayName = "NutPagination";
|
|
3241
3411
|
class Title {
|
|
3242
3412
|
constructor() {
|
|
@@ -3246,7 +3416,7 @@
|
|
|
3246
3416
|
this.index = 0;
|
|
3247
3417
|
}
|
|
3248
3418
|
}
|
|
3249
|
-
const defaultProps$
|
|
3419
|
+
const defaultProps$11 = {
|
|
3250
3420
|
value: 0,
|
|
3251
3421
|
color: "",
|
|
3252
3422
|
background: "",
|
|
@@ -3281,7 +3451,7 @@
|
|
|
3281
3451
|
className,
|
|
3282
3452
|
autoHeight,
|
|
3283
3453
|
...rest
|
|
3284
|
-
} = { ...defaultProps$
|
|
3454
|
+
} = { ...defaultProps$11, ...props };
|
|
3285
3455
|
const [currentItem, setCurrentItem] = React.useState({ index: 0 });
|
|
3286
3456
|
const titles = React.useRef([]);
|
|
3287
3457
|
React.useEffect(() => {
|
|
@@ -3393,9 +3563,9 @@
|
|
|
3393
3563
|
return React__default["default"].cloneElement(child, childProps);
|
|
3394
3564
|
})));
|
|
3395
3565
|
};
|
|
3396
|
-
Tabs.defaultProps = defaultProps$
|
|
3566
|
+
Tabs.defaultProps = defaultProps$11;
|
|
3397
3567
|
Tabs.displayName = "NutTabs";
|
|
3398
|
-
const defaultProps$
|
|
3568
|
+
const defaultProps$10 = {
|
|
3399
3569
|
title: "",
|
|
3400
3570
|
paneKey: "",
|
|
3401
3571
|
activeKey: "",
|
|
@@ -3403,7 +3573,7 @@
|
|
|
3403
3573
|
};
|
|
3404
3574
|
const TabPane = (props) => {
|
|
3405
3575
|
const { children, paneKey, activeKey, autoHeightClassName } = {
|
|
3406
|
-
...defaultProps$
|
|
3576
|
+
...defaultProps$10,
|
|
3407
3577
|
...props
|
|
3408
3578
|
};
|
|
3409
3579
|
const b2 = cn("tabpane");
|
|
@@ -3418,7 +3588,7 @@
|
|
|
3418
3588
|
className: classes
|
|
3419
3589
|
}, children);
|
|
3420
3590
|
};
|
|
3421
|
-
const defaultProps
|
|
3591
|
+
const defaultProps$$ = {
|
|
3422
3592
|
size: 3,
|
|
3423
3593
|
current: 1,
|
|
3424
3594
|
block: false,
|
|
@@ -3438,7 +3608,7 @@
|
|
|
3438
3608
|
vertical,
|
|
3439
3609
|
...rest
|
|
3440
3610
|
} = {
|
|
3441
|
-
...defaultProps
|
|
3611
|
+
...defaultProps$$,
|
|
3442
3612
|
...props
|
|
3443
3613
|
};
|
|
3444
3614
|
const b2 = cn("indicator");
|
|
@@ -3472,7 +3642,7 @@
|
|
|
3472
3642
|
...rest
|
|
3473
3643
|
}, renderEles());
|
|
3474
3644
|
};
|
|
3475
|
-
Indicator.defaultProps = defaultProps
|
|
3645
|
+
Indicator.defaultProps = defaultProps$$;
|
|
3476
3646
|
Indicator.displayName = "NutIndicator";
|
|
3477
3647
|
const handleClick = (e2) => {
|
|
3478
3648
|
e2.stopPropagation();
|
|
@@ -3488,7 +3658,7 @@
|
|
|
3488
3658
|
}
|
|
3489
3659
|
};
|
|
3490
3660
|
const OffsetContext = React.createContext(20);
|
|
3491
|
-
const defaultProps$
|
|
3661
|
+
const defaultProps$_ = {
|
|
3492
3662
|
showhead: false,
|
|
3493
3663
|
position: "left",
|
|
3494
3664
|
width: "80%"
|
|
@@ -3506,7 +3676,7 @@
|
|
|
3506
3676
|
handleClose,
|
|
3507
3677
|
...rest
|
|
3508
3678
|
} = {
|
|
3509
|
-
...defaultProps$
|
|
3679
|
+
...defaultProps$_,
|
|
3510
3680
|
...props
|
|
3511
3681
|
};
|
|
3512
3682
|
const offset = props.offset ? Number(props.offset) : 20;
|
|
@@ -3534,14 +3704,14 @@
|
|
|
3534
3704
|
className: "nut-sidenavbar__content"
|
|
3535
3705
|
}, children))))));
|
|
3536
3706
|
};
|
|
3537
|
-
SideNavBar.defaultProps = defaultProps$
|
|
3707
|
+
SideNavBar.defaultProps = defaultProps$_;
|
|
3538
3708
|
SideNavBar.displayName = "NutSideNavBar";
|
|
3539
|
-
const defaultProps$
|
|
3709
|
+
const defaultProps$Z = {
|
|
3540
3710
|
open: true
|
|
3541
3711
|
};
|
|
3542
3712
|
const SubSideNavBar = (props) => {
|
|
3543
3713
|
const { title, ikey, children, titleClick, open, ...rest } = {
|
|
3544
|
-
...defaultProps$
|
|
3714
|
+
...defaultProps$Z,
|
|
3545
3715
|
...props
|
|
3546
3716
|
};
|
|
3547
3717
|
const offset = React.useContext(OffsetContext);
|
|
@@ -3612,6 +3782,274 @@
|
|
|
3612
3782
|
...rest
|
|
3613
3783
|
}, title);
|
|
3614
3784
|
};
|
|
3785
|
+
const defaultProps$Y = {
|
|
3786
|
+
className: "",
|
|
3787
|
+
style: {},
|
|
3788
|
+
activeColor: "#F2270C",
|
|
3789
|
+
closeOnClickOverlay: true,
|
|
3790
|
+
scrollFixed: false,
|
|
3791
|
+
lockScroll: true,
|
|
3792
|
+
titleIcon: ""
|
|
3793
|
+
};
|
|
3794
|
+
const Menu = (props) => {
|
|
3795
|
+
const {
|
|
3796
|
+
className,
|
|
3797
|
+
titleIcon,
|
|
3798
|
+
scrollFixed,
|
|
3799
|
+
lockScroll,
|
|
3800
|
+
closeOnClickOverlay,
|
|
3801
|
+
children,
|
|
3802
|
+
activeColor,
|
|
3803
|
+
...rest
|
|
3804
|
+
} = {
|
|
3805
|
+
...defaultProps$Y,
|
|
3806
|
+
...props
|
|
3807
|
+
};
|
|
3808
|
+
const parentRef = React.useRef(null);
|
|
3809
|
+
const onScroll = () => {
|
|
3810
|
+
};
|
|
3811
|
+
React.useEffect(() => {
|
|
3812
|
+
if (scrollFixed) {
|
|
3813
|
+
window.addEventListener("scroll", onScroll);
|
|
3814
|
+
}
|
|
3815
|
+
return () => window.removeEventListener("scroll", onScroll);
|
|
3816
|
+
}, []);
|
|
3817
|
+
const [itemShow, setItemShow] = React.useState([]);
|
|
3818
|
+
const [itemTitle, setItemTitle] = React.useState([]);
|
|
3819
|
+
const toggleItemShow = (index2) => {
|
|
3820
|
+
itemShow[index2] = !itemShow[index2];
|
|
3821
|
+
const temp = itemShow.map((i, idx) => idx === index2 ? i : false);
|
|
3822
|
+
setItemShow([...temp]);
|
|
3823
|
+
};
|
|
3824
|
+
const hideItemShow = (index2) => {
|
|
3825
|
+
itemShow[index2] = false;
|
|
3826
|
+
setItemShow([...itemShow]);
|
|
3827
|
+
};
|
|
3828
|
+
const updateTitle = (text, index2) => {
|
|
3829
|
+
itemTitle[index2] = text;
|
|
3830
|
+
setItemTitle([...itemTitle]);
|
|
3831
|
+
};
|
|
3832
|
+
const parent = () => {
|
|
3833
|
+
return parentRef;
|
|
3834
|
+
};
|
|
3835
|
+
const cloneChildren = () => {
|
|
3836
|
+
return React__default["default"].Children.map(children, (child, index2) => {
|
|
3837
|
+
return React__default["default"].cloneElement(child, {
|
|
3838
|
+
showPopup: itemShow[index2],
|
|
3839
|
+
orderKey: index2,
|
|
3840
|
+
activeColor,
|
|
3841
|
+
parent: {
|
|
3842
|
+
closeOnClickOverlay,
|
|
3843
|
+
lockScroll,
|
|
3844
|
+
toggleItemShow,
|
|
3845
|
+
updateTitle,
|
|
3846
|
+
hideItemShow,
|
|
3847
|
+
parent
|
|
3848
|
+
}
|
|
3849
|
+
});
|
|
3850
|
+
});
|
|
3851
|
+
};
|
|
3852
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3853
|
+
className: `nut-menu ${className}`,
|
|
3854
|
+
...rest,
|
|
3855
|
+
ref: parentRef
|
|
3856
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3857
|
+
className: `nut-menu__bar ${itemShow.includes(true) ? "opened" : ""} ${className}`
|
|
3858
|
+
}, React__default["default"].Children.toArray(children).map((child, index2) => {
|
|
3859
|
+
if (!child)
|
|
3860
|
+
return null;
|
|
3861
|
+
const { disabled, title, value, direction, options: options2 } = child.props;
|
|
3862
|
+
const currentTitle = options2 == null ? void 0 : options2.filter(
|
|
3863
|
+
(option) => option.value === value
|
|
3864
|
+
);
|
|
3865
|
+
function finallyTitle() {
|
|
3866
|
+
if (title)
|
|
3867
|
+
return title;
|
|
3868
|
+
if (itemTitle && itemTitle[index2])
|
|
3869
|
+
return itemTitle[index2];
|
|
3870
|
+
if (currentTitle && currentTitle[0] && currentTitle[0].text)
|
|
3871
|
+
return currentTitle[0].text;
|
|
3872
|
+
return "";
|
|
3873
|
+
}
|
|
3874
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3875
|
+
className: `nut-menu__item ${classNames({
|
|
3876
|
+
active: itemShow[index2],
|
|
3877
|
+
disabled
|
|
3878
|
+
})}`,
|
|
3879
|
+
style: { color: itemShow[index2] ? activeColor : "" },
|
|
3880
|
+
key: index2,
|
|
3881
|
+
onClick: () => {
|
|
3882
|
+
!disabled && toggleItemShow(index2);
|
|
3883
|
+
}
|
|
3884
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3885
|
+
className: `nut-menu__title ${classNames({
|
|
3886
|
+
active: itemShow[index2],
|
|
3887
|
+
disabled
|
|
3888
|
+
})}`
|
|
3889
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3890
|
+
className: "nut-menu__title-text"
|
|
3891
|
+
}, finallyTitle()), /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
3892
|
+
className: "nut-menu__title-icon",
|
|
3893
|
+
size: "10",
|
|
3894
|
+
name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
|
|
3895
|
+
})));
|
|
3896
|
+
})), cloneChildren());
|
|
3897
|
+
};
|
|
3898
|
+
Menu.defaultProps = defaultProps$Y;
|
|
3899
|
+
Menu.displayName = "NutMenu";
|
|
3900
|
+
const defaultProps$X = {
|
|
3901
|
+
className: "",
|
|
3902
|
+
style: {},
|
|
3903
|
+
columns: 1,
|
|
3904
|
+
direction: "down",
|
|
3905
|
+
optionsIcon: "Check",
|
|
3906
|
+
activeTitleClass: "",
|
|
3907
|
+
inactiveTitleClass: "",
|
|
3908
|
+
iconClassPrefix: "nut-icon",
|
|
3909
|
+
fontClassName: "nutui-iconfont",
|
|
3910
|
+
onChange: (value) => void 0
|
|
3911
|
+
};
|
|
3912
|
+
const MenuItem = (props) => {
|
|
3913
|
+
useConfig();
|
|
3914
|
+
const mergedProps = { ...defaultProps$X, ...props };
|
|
3915
|
+
const {
|
|
3916
|
+
className,
|
|
3917
|
+
style,
|
|
3918
|
+
options: options2,
|
|
3919
|
+
value,
|
|
3920
|
+
columns,
|
|
3921
|
+
title,
|
|
3922
|
+
iconClassPrefix,
|
|
3923
|
+
fontClassName,
|
|
3924
|
+
optionsIcon,
|
|
3925
|
+
direction,
|
|
3926
|
+
onChange,
|
|
3927
|
+
activeTitleClass,
|
|
3928
|
+
inactiveTitleClass,
|
|
3929
|
+
children
|
|
3930
|
+
} = {
|
|
3931
|
+
...defaultProps$X,
|
|
3932
|
+
...props
|
|
3933
|
+
};
|
|
3934
|
+
const { activeColor, showPopup, parent, orderKey } = mergedProps;
|
|
3935
|
+
const [_showPopup, setShowPopup] = React.useState(showPopup);
|
|
3936
|
+
const [_value, setValue] = React.useState(value);
|
|
3937
|
+
React.useEffect(() => {
|
|
3938
|
+
setShowPopup(showPopup);
|
|
3939
|
+
}, [showPopup]);
|
|
3940
|
+
React.useEffect(() => {
|
|
3941
|
+
getParentOffset();
|
|
3942
|
+
}, [_showPopup]);
|
|
3943
|
+
const getIconCName = (optionVal, value2) => {
|
|
3944
|
+
return classNames({
|
|
3945
|
+
[activeTitleClass]: optionVal === value2,
|
|
3946
|
+
[inactiveTitleClass]: optionVal !== value2
|
|
3947
|
+
});
|
|
3948
|
+
};
|
|
3949
|
+
const setTitle = (text) => {
|
|
3950
|
+
if (!title) {
|
|
3951
|
+
parent.updateTitle(text, orderKey);
|
|
3952
|
+
}
|
|
3953
|
+
};
|
|
3954
|
+
const handleClick2 = (item) => {
|
|
3955
|
+
parent.toggleItemShow(orderKey);
|
|
3956
|
+
setTitle(item.text);
|
|
3957
|
+
setValue(item.value);
|
|
3958
|
+
onChange && onChange(item);
|
|
3959
|
+
};
|
|
3960
|
+
const [position, setPosition] = React.useState({
|
|
3961
|
+
top: 0,
|
|
3962
|
+
height: 0
|
|
3963
|
+
});
|
|
3964
|
+
const getParentOffset = () => {
|
|
3965
|
+
setTimeout(() => {
|
|
3966
|
+
const p2 = parent.parent().current;
|
|
3967
|
+
const rect = p2.getBoundingClientRect();
|
|
3968
|
+
console.log(rect, p2.offsetTop, window.screenTop);
|
|
3969
|
+
setPosition({
|
|
3970
|
+
height: rect.height,
|
|
3971
|
+
top: rect.top
|
|
3972
|
+
});
|
|
3973
|
+
});
|
|
3974
|
+
};
|
|
3975
|
+
const isShow = () => {
|
|
3976
|
+
if (_showPopup)
|
|
3977
|
+
return {};
|
|
3978
|
+
return { display: "none" };
|
|
3979
|
+
};
|
|
3980
|
+
const getPosition = () => {
|
|
3981
|
+
return direction === "down" ? { top: `${position.top + position.height}px` } : { bottom: `${window.innerHeight - position.top}px`, top: "auto" };
|
|
3982
|
+
};
|
|
3983
|
+
const placeholderStyle = () => {
|
|
3984
|
+
if (direction === "down") {
|
|
3985
|
+
return {
|
|
3986
|
+
height: `${position.top + position.height}px`,
|
|
3987
|
+
...isShow(),
|
|
3988
|
+
...style
|
|
3989
|
+
};
|
|
3990
|
+
}
|
|
3991
|
+
return {
|
|
3992
|
+
height: `${window.innerHeight - position.top}px`,
|
|
3993
|
+
top: "auto",
|
|
3994
|
+
...isShow(),
|
|
3995
|
+
...style
|
|
3996
|
+
};
|
|
3997
|
+
};
|
|
3998
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
3999
|
+
className: `placeholder-element ${classNames({
|
|
4000
|
+
up: direction === "up"
|
|
4001
|
+
})} ${className}`,
|
|
4002
|
+
style: placeholderStyle(),
|
|
4003
|
+
onClick: () => parent.toggleItemShow(orderKey)
|
|
4004
|
+
}), /* @__PURE__ */ React__default["default"].createElement(Overlay, {
|
|
4005
|
+
overlayClass: "nut-menu__overlay",
|
|
4006
|
+
style: getPosition(),
|
|
4007
|
+
lockScroll: parent.lockScroll,
|
|
4008
|
+
visible: _showPopup,
|
|
4009
|
+
closeOnClickOverlay: parent.closeOnClickOverlay,
|
|
4010
|
+
onClick: () => {
|
|
4011
|
+
parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
|
|
4012
|
+
}
|
|
4013
|
+
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4014
|
+
className: "nut-menu-item__wrap",
|
|
4015
|
+
style: {
|
|
4016
|
+
...getPosition(),
|
|
4017
|
+
...isShow()
|
|
4018
|
+
}
|
|
4019
|
+
}, /* @__PURE__ */ React__default["default"].createElement(CSSTransition$1, {
|
|
4020
|
+
in: _showPopup,
|
|
4021
|
+
timeout: 100,
|
|
4022
|
+
classNames: "menu-item"
|
|
4023
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4024
|
+
className: "nut-menu-item__content"
|
|
4025
|
+
}, options2 == null ? void 0 : options2.map((item, index2) => {
|
|
4026
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4027
|
+
className: `nut-menu-item__option ${classNames({
|
|
4028
|
+
active: item.value === _value
|
|
4029
|
+
})}`,
|
|
4030
|
+
key: item.text,
|
|
4031
|
+
style: {
|
|
4032
|
+
flexBasis: `${100 / columns}%`
|
|
4033
|
+
},
|
|
4034
|
+
onClick: () => {
|
|
4035
|
+
handleClick2(item);
|
|
4036
|
+
}
|
|
4037
|
+
}, item.value === _value ? /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
4038
|
+
className: getIconCName(item.value, value),
|
|
4039
|
+
name: optionsIcon,
|
|
4040
|
+
classPrefix: iconClassPrefix,
|
|
4041
|
+
fontClassName,
|
|
4042
|
+
color: activeColor
|
|
4043
|
+
}) : null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4044
|
+
className: getIconCName(item.value, value),
|
|
4045
|
+
style: {
|
|
4046
|
+
color: `${item.value === _value ? activeColor : ""}`
|
|
4047
|
+
}
|
|
4048
|
+
}, item.text));
|
|
4049
|
+
}), children))));
|
|
4050
|
+
};
|
|
4051
|
+
MenuItem.defaultProps = defaultProps$X;
|
|
4052
|
+
MenuItem.displayName = "NutMenuItem";
|
|
3615
4053
|
const MIN_DISTANCE = 10;
|
|
3616
4054
|
function getDirection(x2, y2) {
|
|
3617
4055
|
if (x2 > y2 && x2 > MIN_DISTANCE) {
|
|
@@ -3706,6 +4144,29 @@
|
|
|
3706
4144
|
height: 0
|
|
3707
4145
|
};
|
|
3708
4146
|
};
|
|
4147
|
+
let createRoot;
|
|
4148
|
+
try {
|
|
4149
|
+
const mainVersion = Number((ReactDOM__namespace.version || "").split(".")[0]);
|
|
4150
|
+
if (mainVersion >= 18 && ReactDOM__namespace.createRoot) {
|
|
4151
|
+
createRoot = ReactDOM__namespace.createRoot;
|
|
4152
|
+
}
|
|
4153
|
+
} catch (e2) {
|
|
4154
|
+
console.log(e2);
|
|
4155
|
+
}
|
|
4156
|
+
function legacyRender(node, container) {
|
|
4157
|
+
ReactDOM__namespace.render(node, container);
|
|
4158
|
+
}
|
|
4159
|
+
function concurrentRender(node, container) {
|
|
4160
|
+
const root = ReactDOM__namespace.createRoot(container);
|
|
4161
|
+
root.render(node);
|
|
4162
|
+
}
|
|
4163
|
+
function render(node, container) {
|
|
4164
|
+
if (createRoot) {
|
|
4165
|
+
concurrentRender(node, container);
|
|
4166
|
+
return;
|
|
4167
|
+
}
|
|
4168
|
+
legacyRender(node, container);
|
|
4169
|
+
}
|
|
3709
4170
|
class Notification$1 extends React__namespace.PureComponent {
|
|
3710
4171
|
constructor(props) {
|
|
3711
4172
|
super(props);
|
|
@@ -3822,7 +4283,7 @@
|
|
|
3822
4283
|
}
|
|
3823
4284
|
});
|
|
3824
4285
|
}
|
|
3825
|
-
|
|
4286
|
+
render(/* @__PURE__ */ React__namespace.createElement(Notification$1, {
|
|
3826
4287
|
...properties,
|
|
3827
4288
|
ref
|
|
3828
4289
|
}), element);
|
|
@@ -3908,7 +4369,7 @@
|
|
|
3908
4369
|
}
|
|
3909
4370
|
}
|
|
3910
4371
|
};
|
|
3911
|
-
const defaultProps$
|
|
4372
|
+
const defaultProps$W = {
|
|
3912
4373
|
range: false,
|
|
3913
4374
|
hiddenRange: false,
|
|
3914
4375
|
hiddenTag: false,
|
|
@@ -3939,8 +4400,8 @@
|
|
|
3939
4400
|
change,
|
|
3940
4401
|
dragStart,
|
|
3941
4402
|
dragEnd
|
|
3942
|
-
} = { ...defaultProps$
|
|
3943
|
-
let { min, max, step } = { ...defaultProps$
|
|
4403
|
+
} = { ...defaultProps$W, ...props };
|
|
4404
|
+
let { min, max, step } = { ...defaultProps$W, ...props };
|
|
3944
4405
|
min = Number(min);
|
|
3945
4406
|
max = Number(max);
|
|
3946
4407
|
step = Number(step);
|
|
@@ -4213,7 +4674,7 @@
|
|
|
4213
4674
|
role: "slider",
|
|
4214
4675
|
key: index2,
|
|
4215
4676
|
className: `${index2 === 0 ? "nut-range-button-wrapper-left" : ""}
|
|
4216
|
-
|
|
4677
|
+
${index2 === 1 ? "nut-range-button-wrapper-right" : ""}`,
|
|
4217
4678
|
tabIndex: disabled ? -1 : 0,
|
|
4218
4679
|
"aria-valuemin": +min,
|
|
4219
4680
|
"aria-valuenow": curValue(index2),
|
|
@@ -4275,7 +4736,7 @@
|
|
|
4275
4736
|
className: "max"
|
|
4276
4737
|
}, +max) : null);
|
|
4277
4738
|
};
|
|
4278
|
-
Range.defaultProps = defaultProps$
|
|
4739
|
+
Range.defaultProps = defaultProps$W;
|
|
4279
4740
|
Range.displayName = "NutRange";
|
|
4280
4741
|
const Utils = {
|
|
4281
4742
|
isLeapYear(y2) {
|
|
@@ -4369,7 +4830,7 @@
|
|
|
4369
4830
|
};
|
|
4370
4831
|
}
|
|
4371
4832
|
var requestAniFrame$1 = requestAniFrame();
|
|
4372
|
-
const defaultProps$
|
|
4833
|
+
const defaultProps$V = {
|
|
4373
4834
|
type: "one",
|
|
4374
4835
|
isAutoBackFill: false,
|
|
4375
4836
|
poppable: true,
|
|
@@ -4378,14 +4839,25 @@
|
|
|
4378
4839
|
defaultValue: "",
|
|
4379
4840
|
startDate: Utils.getDay(0),
|
|
4380
4841
|
endDate: Utils.getDay(365),
|
|
4842
|
+
showToday: true,
|
|
4843
|
+
startText: "\u5F00\u59CB",
|
|
4844
|
+
endText: "\u7ED3\u675F",
|
|
4845
|
+
confirmText: "\u786E\u8BA4",
|
|
4846
|
+
showTitle: true,
|
|
4847
|
+
showSubTitle: true,
|
|
4848
|
+
toDateAnimation: true,
|
|
4849
|
+
onBtn: void 0,
|
|
4850
|
+
onDay: void 0,
|
|
4851
|
+
onTopInfo: void 0,
|
|
4852
|
+
onBottomInfo: void 0,
|
|
4381
4853
|
onChoose: (data) => {
|
|
4382
4854
|
},
|
|
4383
4855
|
onUpdate: () => {
|
|
4384
4856
|
},
|
|
4385
|
-
|
|
4857
|
+
onSelected: (data) => {
|
|
4386
4858
|
}
|
|
4387
4859
|
};
|
|
4388
|
-
const CalendarItem = (props) => {
|
|
4860
|
+
const CalendarItem = React__default["default"].forwardRef((props, ref) => {
|
|
4389
4861
|
const { locale } = useConfig();
|
|
4390
4862
|
const {
|
|
4391
4863
|
type,
|
|
@@ -4393,18 +4865,31 @@
|
|
|
4393
4865
|
poppable,
|
|
4394
4866
|
title,
|
|
4395
4867
|
defaultValue,
|
|
4396
|
-
|
|
4397
|
-
|
|
4868
|
+
showToday,
|
|
4869
|
+
startText,
|
|
4870
|
+
endText,
|
|
4871
|
+
confirmText,
|
|
4872
|
+
showTitle,
|
|
4873
|
+
showSubTitle,
|
|
4874
|
+
toDateAnimation,
|
|
4875
|
+
onBtn,
|
|
4876
|
+
onDay,
|
|
4877
|
+
onTopInfo,
|
|
4878
|
+
onBottomInfo,
|
|
4398
4879
|
onChoose,
|
|
4399
4880
|
onUpdate,
|
|
4400
|
-
|
|
4401
|
-
} = { ...defaultProps$
|
|
4881
|
+
onSelected
|
|
4882
|
+
} = { ...defaultProps$V, ...props };
|
|
4402
4883
|
const weeks = locale.calendaritem.weekdays;
|
|
4403
4884
|
const [yearMonthTitle, setYearMonthTitle] = React.useState("");
|
|
4404
|
-
const [unLoadPrev, setUnLoadPrev] = React.useState(false);
|
|
4405
4885
|
const [monthsData, setMonthsData] = React.useState([]);
|
|
4886
|
+
const [translateY, setTranslateY] = React.useState(0);
|
|
4887
|
+
const [monthDefaultRange, setMonthDefaultRange] = React.useState([]);
|
|
4406
4888
|
const [state] = React.useState({
|
|
4407
4889
|
currDate: "",
|
|
4890
|
+
propStartDate: "",
|
|
4891
|
+
propEndDate: "",
|
|
4892
|
+
unLoadPrev: false,
|
|
4408
4893
|
touchParams: {
|
|
4409
4894
|
startY: 0,
|
|
4410
4895
|
endY: 0,
|
|
@@ -4414,7 +4899,6 @@
|
|
|
4414
4899
|
lastTime: 0
|
|
4415
4900
|
},
|
|
4416
4901
|
transformY: 0,
|
|
4417
|
-
translateY: 0,
|
|
4418
4902
|
scrollDistance: 0,
|
|
4419
4903
|
defaultData: [],
|
|
4420
4904
|
chooseData: [],
|
|
@@ -4422,12 +4906,17 @@
|
|
|
4422
4906
|
dayPrefix: "calendar-month-day",
|
|
4423
4907
|
startData: "",
|
|
4424
4908
|
endData: "",
|
|
4425
|
-
isRange: type === "range",
|
|
4426
|
-
timer: 0
|
|
4909
|
+
isRange: props.type === "range",
|
|
4910
|
+
timer: 0,
|
|
4911
|
+
currentIndex: 0,
|
|
4912
|
+
avgHeight: 0,
|
|
4913
|
+
monthsNum: 0
|
|
4427
4914
|
});
|
|
4428
4915
|
const weeksPanel = React.useRef(null);
|
|
4429
4916
|
const months = React.useRef(null);
|
|
4430
4917
|
const monthsPanel = React.useRef(null);
|
|
4918
|
+
const viewArea = React.useRef(null);
|
|
4919
|
+
let viewHeight = 0;
|
|
4431
4920
|
const b2 = cn("calendar");
|
|
4432
4921
|
const classes = classNames(
|
|
4433
4922
|
{
|
|
@@ -4453,23 +4942,29 @@
|
|
|
4453
4942
|
const isEnd = (currDate) => {
|
|
4454
4943
|
return Utils.isEqual(state.currDate[1], currDate);
|
|
4455
4944
|
};
|
|
4456
|
-
const
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4945
|
+
const isMultiple = (currDate) => {
|
|
4946
|
+
if (state.currDate.length > 0) {
|
|
4947
|
+
return state.currDate.some((item) => {
|
|
4948
|
+
return Utils.isEqual(item, currDate);
|
|
4949
|
+
});
|
|
4950
|
+
}
|
|
4951
|
+
return false;
|
|
4952
|
+
};
|
|
4953
|
+
const getCurrDate = (day, month) => {
|
|
4954
|
+
return `${month.curData[0]}-${month.curData[1]}-${Utils.getNumTwoBit(
|
|
4460
4955
|
+day.day
|
|
4461
4956
|
)}`;
|
|
4462
4957
|
};
|
|
4463
|
-
const getClass = (day, month
|
|
4464
|
-
const currDate = getCurrDate(day, month
|
|
4958
|
+
const getClass = (day, month) => {
|
|
4959
|
+
const currDate = getCurrDate(day, month);
|
|
4465
4960
|
if (day.type === "curr") {
|
|
4466
|
-
if (
|
|
4961
|
+
if (Utils.isEqual(state.currDate, currDate) || type === "range" && (isStart(currDate) || isEnd(currDate)) || type === "multiple" && isMultiple(currDate)) {
|
|
4467
4962
|
return `${state.dayPrefix}-active`;
|
|
4468
4963
|
}
|
|
4469
|
-
if (
|
|
4964
|
+
if (state.propStartDate && Utils.compareDate(currDate, state.propStartDate) || state.propEndDate && Utils.compareDate(state.propEndDate, currDate)) {
|
|
4470
4965
|
return `${state.dayPrefix}-disabled`;
|
|
4471
4966
|
}
|
|
4472
|
-
if (
|
|
4967
|
+
if (type === "range" && Array.isArray(state.currDate) && Object.values(state.currDate).length === 2 && Utils.compareDate(state.currDate[0], currDate) && Utils.compareDate(currDate, state.currDate[1])) {
|
|
4473
4968
|
return `${state.dayPrefix}-choose`;
|
|
4474
4969
|
}
|
|
4475
4970
|
return null;
|
|
@@ -4484,56 +4979,86 @@
|
|
|
4484
4979
|
return Utils.isEqual(date, Utils.date2Str(new Date()));
|
|
4485
4980
|
};
|
|
4486
4981
|
const confirm2 = () => {
|
|
4487
|
-
|
|
4488
|
-
|
|
4982
|
+
const { type: type2 } = props;
|
|
4983
|
+
if (type2 === "range" && state.chooseData.length === 2 || type2 !== "range") {
|
|
4984
|
+
const chooseData = state.chooseData.slice(0);
|
|
4985
|
+
onChoose && onChoose(chooseData);
|
|
4489
4986
|
if (poppable) {
|
|
4490
4987
|
onUpdate && onUpdate();
|
|
4491
4988
|
}
|
|
4492
4989
|
}
|
|
4493
4990
|
};
|
|
4494
|
-
const chooseDay = (day, month, isFirst
|
|
4495
|
-
if (getClass(day, month
|
|
4496
|
-
|
|
4497
|
-
days =
|
|
4991
|
+
const chooseDay = (day, month, isFirst) => {
|
|
4992
|
+
if (getClass(day, month) !== `${state.dayPrefix}-disabled`) {
|
|
4993
|
+
const { type: type2 } = props;
|
|
4994
|
+
const days = [...month.curData];
|
|
4498
4995
|
days[2] = typeof day.day === "number" ? Utils.getNumTwoBit(day.day) : day.day;
|
|
4499
4996
|
days[3] = `${days[0]}-${days[1]}-${days[2]}`;
|
|
4500
4997
|
days[4] = Utils.getWhatDay(+days[0], +days[1], +days[2]);
|
|
4501
|
-
if (
|
|
4502
|
-
state.currDate
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4998
|
+
if (type2 === "multiple") {
|
|
4999
|
+
if (state.currDate.length > 0) {
|
|
5000
|
+
let hasIndex = "";
|
|
5001
|
+
state.currDate.forEach((item, index2) => {
|
|
5002
|
+
if (item === days[3]) {
|
|
5003
|
+
hasIndex = index2;
|
|
5004
|
+
}
|
|
5005
|
+
});
|
|
5006
|
+
if (isFirst) {
|
|
5007
|
+
state.chooseData.push([...days]);
|
|
5008
|
+
} else if (hasIndex !== "") {
|
|
5009
|
+
state.currDate.splice(hasIndex, 1);
|
|
5010
|
+
state.chooseData.splice(hasIndex, 1);
|
|
5011
|
+
} else {
|
|
5012
|
+
state.currDate.push(days[3]);
|
|
5013
|
+
state.chooseData.push([...days]);
|
|
5014
|
+
}
|
|
5015
|
+
} else {
|
|
5016
|
+
state.currDate = [days[3]];
|
|
5017
|
+
state.chooseData = [[...days]];
|
|
5018
|
+
}
|
|
5019
|
+
} else if (type2 === "range") {
|
|
5020
|
+
const curDataLength = Object.values(state.currDate).length;
|
|
5021
|
+
if (curDataLength === 2 || curDataLength === 0) {
|
|
5022
|
+
state.currDate = [days[3]];
|
|
5023
|
+
} else if (Utils.compareDate(state.currDate[0], days[3])) {
|
|
5024
|
+
Array.isArray(state.currDate) && state.currDate.push(days[3]);
|
|
4509
5025
|
} else {
|
|
4510
5026
|
Array.isArray(state.currDate) && state.currDate.unshift(days[3]);
|
|
4511
5027
|
}
|
|
4512
5028
|
if (state.chooseData.length === 2 || !state.chooseData.length) {
|
|
4513
|
-
state.chooseData = [...days];
|
|
4514
|
-
} else if (Utils.compareDate(state.chooseData[3], days[3])) {
|
|
4515
|
-
state.chooseData = [
|
|
5029
|
+
state.chooseData = [[...days]];
|
|
5030
|
+
} else if (Utils.compareDate(state.chooseData[0][3], days[3])) {
|
|
5031
|
+
state.chooseData = [...state.chooseData, [...days]];
|
|
4516
5032
|
} else {
|
|
4517
|
-
state.chooseData = [[...days],
|
|
5033
|
+
state.chooseData = [[...days], ...state.chooseData];
|
|
4518
5034
|
}
|
|
5035
|
+
} else {
|
|
5036
|
+
state.currDate = days[3];
|
|
5037
|
+
state.chooseData = [...days];
|
|
4519
5038
|
}
|
|
4520
|
-
if (
|
|
4521
|
-
|
|
5039
|
+
if (!isFirst) {
|
|
5040
|
+
onSelected && onSelected(state.chooseData);
|
|
5041
|
+
if (isAutoBackFill || !poppable) {
|
|
5042
|
+
confirm2();
|
|
5043
|
+
}
|
|
4522
5044
|
}
|
|
4523
5045
|
setMonthsData(state.monthsData.slice());
|
|
4524
5046
|
}
|
|
4525
5047
|
};
|
|
4526
5048
|
const isStartTip = (day, month) => {
|
|
4527
|
-
|
|
4528
|
-
|
|
5049
|
+
return isActive(day, month) && isStart(getCurrDate(day, month));
|
|
5050
|
+
};
|
|
5051
|
+
const isEndTip = (day, month) => {
|
|
5052
|
+
if (state.currDate.length >= 2 && isEnd(getCurrDate(day, month))) {
|
|
5053
|
+
return isActive(day, month);
|
|
4529
5054
|
}
|
|
4530
5055
|
return false;
|
|
4531
5056
|
};
|
|
4532
|
-
const
|
|
4533
|
-
if (
|
|
4534
|
-
return
|
|
5057
|
+
const rangeTip = () => {
|
|
5058
|
+
if (state.currDate.length >= 2) {
|
|
5059
|
+
return Utils.isEqual(state.currDate[0], state.currDate[1]);
|
|
4535
5060
|
}
|
|
4536
|
-
return
|
|
5061
|
+
return false;
|
|
4537
5062
|
};
|
|
4538
5063
|
const getCurrData = (type2) => {
|
|
4539
5064
|
const monthData = type2 === "prev" ? state.monthsData[0] : state.monthsData[state.monthsData.length - 1];
|
|
@@ -4555,20 +5080,45 @@
|
|
|
4555
5080
|
Utils.getMonthDays(String(year), String(month))
|
|
4556
5081
|
];
|
|
4557
5082
|
};
|
|
4558
|
-
const getDaysStatus = (days, type2) => {
|
|
5083
|
+
const getDaysStatus = (days, type2, dateInfo) => {
|
|
5084
|
+
const { year, month } = dateInfo;
|
|
4559
5085
|
if (type2 === "prev" && days >= 7) {
|
|
4560
5086
|
days -= 7;
|
|
4561
5087
|
}
|
|
4562
5088
|
return Array.from(Array(days), (v2, k2) => {
|
|
4563
5089
|
return {
|
|
4564
5090
|
day: k2 + 1,
|
|
4565
|
-
type: type2
|
|
5091
|
+
type: type2,
|
|
5092
|
+
year,
|
|
5093
|
+
month
|
|
4566
5094
|
};
|
|
4567
5095
|
});
|
|
4568
5096
|
};
|
|
5097
|
+
const getPreDaysStatus = (days, type2, dateInfo, preCurrMonthDays) => {
|
|
5098
|
+
const { year, month } = dateInfo;
|
|
5099
|
+
if (type2 === "prev" && days >= 7) {
|
|
5100
|
+
days -= 7;
|
|
5101
|
+
}
|
|
5102
|
+
const months2 = Array.from(Array(preCurrMonthDays), (v2, k2) => {
|
|
5103
|
+
return {
|
|
5104
|
+
day: k2 + 1,
|
|
5105
|
+
type: type2,
|
|
5106
|
+
year,
|
|
5107
|
+
month
|
|
5108
|
+
};
|
|
5109
|
+
});
|
|
5110
|
+
return months2.slice(preCurrMonthDays - days);
|
|
5111
|
+
};
|
|
4569
5112
|
const getMonth = (curData, type2) => {
|
|
4570
5113
|
const preMonthDays = Utils.getMonthPreDay(+curData[0], +curData[1]);
|
|
5114
|
+
let preMonth = +curData[1] - 1;
|
|
5115
|
+
let preYear = curData[0];
|
|
5116
|
+
if (preMonth <= 0) {
|
|
5117
|
+
preMonth = 12;
|
|
5118
|
+
preYear += 1;
|
|
5119
|
+
}
|
|
4571
5120
|
const currMonthDays = Utils.getMonthDays(curData[0], curData[1]);
|
|
5121
|
+
const preCurrMonthDays = Utils.getMonthDays(`${preYear}`, `${preMonth}`);
|
|
4572
5122
|
const title2 = {
|
|
4573
5123
|
year: curData[0],
|
|
4574
5124
|
month: curData[1]
|
|
@@ -4577,10 +5127,21 @@
|
|
|
4577
5127
|
curData,
|
|
4578
5128
|
title: locale.calendaritem.monthTitle(title2.year, title2.month),
|
|
4579
5129
|
monthData: [
|
|
4580
|
-
...
|
|
4581
|
-
|
|
5130
|
+
...getPreDaysStatus(
|
|
5131
|
+
preMonthDays,
|
|
5132
|
+
"prev",
|
|
5133
|
+
{ month: preMonth, year: preYear },
|
|
5134
|
+
preCurrMonthDays
|
|
5135
|
+
),
|
|
5136
|
+
...getDaysStatus(currMonthDays, "curr", title2)
|
|
4582
5137
|
]
|
|
4583
5138
|
};
|
|
5139
|
+
monthInfo.cssHeight = 39 + (monthInfo.monthData.length > 35 ? 384 : 320);
|
|
5140
|
+
let cssScrollHeight = 0;
|
|
5141
|
+
if (state.monthsData.length > 0) {
|
|
5142
|
+
cssScrollHeight = state.monthsData[state.monthsData.length - 1].cssScrollHeight + state.monthsData[state.monthsData.length - 1].cssHeight;
|
|
5143
|
+
}
|
|
5144
|
+
monthInfo.cssScrollHeight = cssScrollHeight;
|
|
4584
5145
|
if (type2 === "next") {
|
|
4585
5146
|
if (!state.endData || !Utils.compareDate(
|
|
4586
5147
|
`${state.endData[0]}-${state.endData[1]}-${Utils.getMonthDays(
|
|
@@ -4596,187 +5157,260 @@
|
|
|
4596
5157
|
`${state.startData[0]}-${state.startData[1]}-01`
|
|
4597
5158
|
)) {
|
|
4598
5159
|
state.monthsData.unshift(monthInfo);
|
|
4599
|
-
} else {
|
|
4600
|
-
setUnLoadPrev(true);
|
|
4601
5160
|
}
|
|
4602
5161
|
setMonthsData(state.monthsData);
|
|
4603
5162
|
};
|
|
4604
|
-
const
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
}
|
|
4618
|
-
}
|
|
4619
|
-
}
|
|
4620
|
-
});
|
|
4621
|
-
};
|
|
4622
|
-
const setTransform = (translateY = 0, type2, time = 1e3) => {
|
|
4623
|
-
if (monthsPanel == null ? void 0 : monthsPanel.current) {
|
|
4624
|
-
if (type2 === "end") {
|
|
4625
|
-
monthsPanel.current.style.webkitTransition = `transform ${time}ms cubic-bezier(0.19, 1, 0.22, 1)`;
|
|
4626
|
-
clearTimeout(state.timer);
|
|
4627
|
-
state.timer = setTimeout(() => {
|
|
4628
|
-
loadScroll();
|
|
4629
|
-
}, time);
|
|
4630
|
-
} else {
|
|
4631
|
-
monthsPanel.current.style.webkitTransition = "";
|
|
4632
|
-
loadScroll();
|
|
5163
|
+
const setDefaultRange = (monthsNum, current) => {
|
|
5164
|
+
let start2 = 0;
|
|
5165
|
+
let end = 0;
|
|
5166
|
+
if (monthsNum >= 3) {
|
|
5167
|
+
if (current > 0 && current < monthsNum) {
|
|
5168
|
+
start2 = current - 1;
|
|
5169
|
+
end = current + 3;
|
|
5170
|
+
} else if (current === 0) {
|
|
5171
|
+
start2 = current;
|
|
5172
|
+
end = current + 4;
|
|
5173
|
+
} else if (current === monthsNum) {
|
|
5174
|
+
start2 = current - 2;
|
|
5175
|
+
end = current + 2;
|
|
4633
5176
|
}
|
|
4634
|
-
|
|
4635
|
-
|
|
5177
|
+
} else {
|
|
5178
|
+
start2 = 0;
|
|
5179
|
+
end = monthsNum + 2;
|
|
4636
5180
|
}
|
|
5181
|
+
setMonthDefaultRange([start2, end]);
|
|
5182
|
+
setTranslateY(state.monthsData[start2].cssScrollHeight);
|
|
4637
5183
|
};
|
|
4638
|
-
const
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
const
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
5184
|
+
const mothsViewScroll = (e2) => {
|
|
5185
|
+
if (state.monthsData.length <= 1) {
|
|
5186
|
+
return;
|
|
5187
|
+
}
|
|
5188
|
+
const target = e2.target;
|
|
5189
|
+
const currentScrollTop = target.scrollTop;
|
|
5190
|
+
let current = Math.floor(currentScrollTop / state.avgHeight);
|
|
5191
|
+
if (current === 0) {
|
|
5192
|
+
if (currentScrollTop >= state.monthsData[current + 1].cssScrollHeight) {
|
|
5193
|
+
current += 1;
|
|
4646
5194
|
}
|
|
4647
|
-
|
|
4648
|
-
|
|
5195
|
+
} else if (current > 0 && current < state.monthsNum - 1) {
|
|
5196
|
+
if (currentScrollTop >= state.monthsData[current + 1].cssScrollHeight) {
|
|
5197
|
+
current += 1;
|
|
4649
5198
|
}
|
|
4650
|
-
if (
|
|
4651
|
-
|
|
5199
|
+
if (currentScrollTop < state.monthsData[current].cssScrollHeight) {
|
|
5200
|
+
current -= 1;
|
|
4652
5201
|
}
|
|
4653
|
-
setTransform(updateMove, type2, time);
|
|
4654
5202
|
} else {
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
if (updateMove < -offsetHeight + h2 - 100 && state.monthsData.length > 1) {
|
|
4659
|
-
updateMove = -offsetHeight + h2 - 100;
|
|
5203
|
+
const viewPosition = Math.round(currentScrollTop + viewHeight);
|
|
5204
|
+
if (viewPosition < state.monthsData[current].cssScrollHeight + state.monthsData[current].cssHeight && currentScrollTop > state.monthsData[current - 1].cssScrollHeight) {
|
|
5205
|
+
current -= 1;
|
|
4660
5206
|
}
|
|
4661
|
-
if (
|
|
4662
|
-
|
|
5207
|
+
if (current + 1 <= state.monthsNum && viewPosition >= state.monthsData[current + 1].cssScrollHeight + state.monthsData[current + 1].cssHeight) {
|
|
5208
|
+
current += 1;
|
|
4663
5209
|
}
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
};
|
|
4667
|
-
const onTouchStart = (event) => {
|
|
4668
|
-
event.stopPropagation();
|
|
4669
|
-
const changedTouches = event.changedTouches[0];
|
|
4670
|
-
state.touchParams.startY = changedTouches.pageY;
|
|
4671
|
-
state.touchParams.startTime = event.timeStamp || Date.now();
|
|
4672
|
-
state.transformY = state.scrollDistance;
|
|
4673
|
-
};
|
|
4674
|
-
const onTouchMove = (event) => {
|
|
4675
|
-
event.stopPropagation();
|
|
4676
|
-
const changedTouches = event.changedTouches[0];
|
|
4677
|
-
state.touchParams.lastY = changedTouches.pageY;
|
|
4678
|
-
state.touchParams.lastTime = event.timeStamp || Date.now();
|
|
4679
|
-
const move = state.touchParams.lastY - state.touchParams.startY;
|
|
4680
|
-
if (Math.abs(move) < 5) {
|
|
4681
|
-
return false;
|
|
4682
|
-
}
|
|
4683
|
-
setMove(move);
|
|
4684
|
-
};
|
|
4685
|
-
const onTouchEnd = (event) => {
|
|
4686
|
-
var _a, _b;
|
|
4687
|
-
event.stopPropagation();
|
|
4688
|
-
const changedTouches = event.changedTouches[0];
|
|
4689
|
-
state.touchParams.lastY = changedTouches.pageY;
|
|
4690
|
-
state.touchParams.lastTime = event.timeStamp || Date.now();
|
|
4691
|
-
let move = state.touchParams.lastY - state.touchParams.startY;
|
|
4692
|
-
if (Math.abs(move) < 5) {
|
|
4693
|
-
return false;
|
|
4694
|
-
}
|
|
4695
|
-
const updateMove = move + state.transformY;
|
|
4696
|
-
const h2 = ((_a = months.current) == null ? void 0 : _a.offsetHeight) || 0;
|
|
4697
|
-
const offsetHeight = ((_b = monthsPanel.current) == null ? void 0 : _b.offsetHeight) || 0;
|
|
4698
|
-
if (updateMove > 0) {
|
|
4699
|
-
getMonth(getCurrData("prev"), "prev");
|
|
4700
|
-
} else if (updateMove < 0 && updateMove < -offsetHeight + (Math.abs(move) > h2 ? Math.abs(move) : h2) * 5) {
|
|
4701
|
-
getMonth(getCurrData("next"), "next");
|
|
4702
|
-
if (Math.abs(move) >= 300) {
|
|
4703
|
-
getMonth(getCurrData("next"), "next");
|
|
5210
|
+
if (current >= 1 && currentScrollTop < state.monthsData[current - 1].cssScrollHeight) {
|
|
5211
|
+
current -= 1;
|
|
4704
5212
|
}
|
|
4705
5213
|
}
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
moveTime += 1e3;
|
|
4710
|
-
setMove(move, "end", moveTime);
|
|
4711
|
-
} else {
|
|
4712
|
-
setMove(move, "end");
|
|
5214
|
+
if (state.currentIndex !== current) {
|
|
5215
|
+
state.currentIndex = current;
|
|
5216
|
+
setDefaultRange(state.monthsNum, current);
|
|
4713
5217
|
}
|
|
5218
|
+
setYearMonthTitle(state.monthsData[current].title);
|
|
4714
5219
|
};
|
|
4715
5220
|
const initData = () => {
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
5221
|
+
const propStartDate = props.startDate ? props.startDate : Utils.getDay(0);
|
|
5222
|
+
const propEndDate = props.endDate ? props.endDate : Utils.getDay(365);
|
|
5223
|
+
state.propStartDate = propStartDate;
|
|
5224
|
+
state.propEndDate = propEndDate;
|
|
5225
|
+
state.startData = splitDate(propStartDate);
|
|
5226
|
+
state.endData = splitDate(propEndDate);
|
|
5227
|
+
if (defaultValue || Array.isArray(defaultValue) && defaultValue.length > 0) {
|
|
5228
|
+
state.currDate = props.type !== "one" ? [...props.defaultValue] : props.defaultValue;
|
|
5229
|
+
}
|
|
5230
|
+
const startDate = {
|
|
5231
|
+
year: Number(state.startData[0]),
|
|
5232
|
+
month: Number(state.startData[1])
|
|
5233
|
+
};
|
|
5234
|
+
const endDate = {
|
|
5235
|
+
year: Number(state.endData[0]),
|
|
5236
|
+
month: Number(state.endData[1])
|
|
5237
|
+
};
|
|
5238
|
+
let monthsNum = endDate.month - startDate.month;
|
|
5239
|
+
if (endDate.year - startDate.year > 0) {
|
|
5240
|
+
monthsNum += 12 * (endDate.year - startDate.year);
|
|
5241
|
+
}
|
|
5242
|
+
if (monthsNum <= 0) {
|
|
5243
|
+
monthsNum = 1;
|
|
4722
5244
|
}
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
5245
|
+
getMonth(state.startData, "next");
|
|
5246
|
+
let i = 1;
|
|
5247
|
+
do {
|
|
5248
|
+
getMonth(getCurrData("next"), "next");
|
|
5249
|
+
} while (i++ < monthsNum);
|
|
5250
|
+
state.monthsNum = monthsNum;
|
|
5251
|
+
if (type === "range" && Array.isArray(state.currDate)) {
|
|
5252
|
+
if (state.currDate.length > 0) {
|
|
5253
|
+
if (propStartDate && Utils.compareDate(state.currDate[0], propStartDate)) {
|
|
5254
|
+
state.currDate.splice(0, 1, propStartDate);
|
|
5255
|
+
}
|
|
5256
|
+
if (propEndDate && Utils.compareDate(propEndDate, state.currDate[1])) {
|
|
5257
|
+
state.currDate.splice(1, 1, propEndDate);
|
|
5258
|
+
}
|
|
5259
|
+
state.defaultData = [
|
|
5260
|
+
...splitDate(state.currDate[0]),
|
|
5261
|
+
...splitDate(state.currDate[1])
|
|
5262
|
+
];
|
|
4726
5263
|
}
|
|
4727
|
-
|
|
4728
|
-
|
|
5264
|
+
} else if (props.type === "multiple" && Array.isArray(state.currDate)) {
|
|
5265
|
+
if (state.currDate.length > 0) {
|
|
5266
|
+
const defaultArr = [];
|
|
5267
|
+
const obj = {};
|
|
5268
|
+
state.currDate.forEach((item) => {
|
|
5269
|
+
if (propStartDate && !Utils.compareDate(item, propStartDate) && propEndDate && !Utils.compareDate(propEndDate, item)) {
|
|
5270
|
+
if (!Object.hasOwnProperty.call(obj, item)) {
|
|
5271
|
+
defaultArr.push(item);
|
|
5272
|
+
obj[item] = item;
|
|
5273
|
+
}
|
|
5274
|
+
}
|
|
5275
|
+
});
|
|
5276
|
+
state.currDate = [...defaultArr];
|
|
5277
|
+
state.defaultData = [...splitDate(defaultArr[0])];
|
|
4729
5278
|
}
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
if (startDate && Utils.compareDate(state.currDate, startDate)) {
|
|
4736
|
-
state.currDate = startDate;
|
|
4737
|
-
} else if (endDate && !Utils.compareDate(state.currDate, endDate)) {
|
|
4738
|
-
state.currDate = endDate;
|
|
5279
|
+
} else if (state.currDate) {
|
|
5280
|
+
if (propStartDate && Utils.compareDate(state.currDate, propStartDate)) {
|
|
5281
|
+
state.currDate = propStartDate;
|
|
5282
|
+
} else if (propEndDate && !Utils.compareDate(state.currDate, propEndDate)) {
|
|
5283
|
+
state.currDate = propEndDate;
|
|
4739
5284
|
}
|
|
4740
5285
|
state.defaultData = [...splitDate(state.currDate)];
|
|
4741
5286
|
}
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
5287
|
+
let current = 0;
|
|
5288
|
+
let lastCurrent = 0;
|
|
5289
|
+
if (state.defaultData.length > 0) {
|
|
5290
|
+
state.monthsData.forEach((item, index2) => {
|
|
5291
|
+
if (item.title === locale.calendaritem.monthTitle(
|
|
5292
|
+
state.defaultData[0],
|
|
5293
|
+
state.defaultData[1]
|
|
5294
|
+
)) {
|
|
5295
|
+
current = index2;
|
|
5296
|
+
}
|
|
5297
|
+
if (props.type === "range") {
|
|
5298
|
+
if (item.title === locale.calendaritem.monthTitle(
|
|
5299
|
+
state.defaultData[3],
|
|
5300
|
+
state.defaultData[4]
|
|
5301
|
+
)) {
|
|
5302
|
+
lastCurrent = index2;
|
|
5303
|
+
}
|
|
5304
|
+
}
|
|
5305
|
+
});
|
|
5306
|
+
}
|
|
5307
|
+
setDefaultRange(monthsNum, current);
|
|
5308
|
+
state.currentIndex = current;
|
|
5309
|
+
setYearMonthTitle(state.monthsData[state.currentIndex].title);
|
|
5310
|
+
if (state.defaultData.length > 0) {
|
|
5311
|
+
if (type === "range") {
|
|
5312
|
+
chooseDay(
|
|
5313
|
+
{ day: state.defaultData[2], type: "curr" },
|
|
5314
|
+
state.monthsData[state.currentIndex],
|
|
5315
|
+
true
|
|
5316
|
+
);
|
|
5317
|
+
chooseDay(
|
|
5318
|
+
{ day: state.defaultData[5], type: "curr" },
|
|
5319
|
+
state.monthsData[lastCurrent],
|
|
5320
|
+
true
|
|
5321
|
+
);
|
|
5322
|
+
} else if (type === "multiple") {
|
|
5323
|
+
[...state.currDate].forEach((item) => {
|
|
5324
|
+
const dateArr = splitDate(item);
|
|
5325
|
+
let current2 = state.currentIndex;
|
|
5326
|
+
state.monthsData.forEach((item2, index2) => {
|
|
5327
|
+
if (item2.title === locale.calendaritem.monthTitle(dateArr[0], dateArr[1])) {
|
|
5328
|
+
current2 = index2;
|
|
5329
|
+
}
|
|
5330
|
+
});
|
|
5331
|
+
chooseDay(
|
|
5332
|
+
{ day: dateArr[2], type: "curr" },
|
|
5333
|
+
state.monthsData[current2],
|
|
5334
|
+
true
|
|
5335
|
+
);
|
|
5336
|
+
});
|
|
5337
|
+
} else {
|
|
5338
|
+
chooseDay(
|
|
5339
|
+
{ day: state.defaultData[2], type: "curr" },
|
|
5340
|
+
state.monthsData[state.currentIndex],
|
|
5341
|
+
true
|
|
5342
|
+
);
|
|
5343
|
+
}
|
|
4766
5344
|
}
|
|
5345
|
+
const lastItem = state.monthsData[state.monthsData.length - 1];
|
|
5346
|
+
const containerHeight = lastItem.cssHeight + lastItem.cssScrollHeight;
|
|
5347
|
+
requestAniFrame$1(() => {
|
|
5348
|
+
if (months && monthsPanel && viewArea) {
|
|
5349
|
+
viewHeight = months.current.clientHeight;
|
|
5350
|
+
monthsPanel.current.style.height = `${containerHeight}px`;
|
|
5351
|
+
months.current.scrollTop = state.monthsData[state.currentIndex].cssScrollHeight;
|
|
5352
|
+
}
|
|
5353
|
+
});
|
|
5354
|
+
state.avgHeight = Math.floor(containerHeight / (monthsNum + 1));
|
|
5355
|
+
};
|
|
5356
|
+
const resetRender = () => {
|
|
5357
|
+
state.chooseData.splice(0);
|
|
5358
|
+
state.monthsData.splice(0);
|
|
5359
|
+
initData();
|
|
5360
|
+
};
|
|
5361
|
+
const scrollToDate = (date) => {
|
|
5362
|
+
if (Utils.compareDate(date, state.propStartDate)) {
|
|
5363
|
+
date = state.propStartDate;
|
|
5364
|
+
} else if (!Utils.compareDate(date, state.propEndDate)) {
|
|
5365
|
+
date = state.propEndDate;
|
|
5366
|
+
}
|
|
5367
|
+
const dateArr = splitDate(date);
|
|
5368
|
+
state.monthsData.forEach((item, index2) => {
|
|
5369
|
+
if (item.title === locale.calendaritem.monthTitle(dateArr[0], dateArr[1])) {
|
|
5370
|
+
if (months.current) {
|
|
5371
|
+
const distance = state.monthsData[index2].cssScrollHeight - months.current.scrollTop;
|
|
5372
|
+
if (toDateAnimation) {
|
|
5373
|
+
let flag = 0;
|
|
5374
|
+
const interval = setInterval(() => {
|
|
5375
|
+
flag++;
|
|
5376
|
+
if (months.current) {
|
|
5377
|
+
const offset = distance / 10;
|
|
5378
|
+
months.current.scrollTop += offset;
|
|
5379
|
+
}
|
|
5380
|
+
if (flag >= 10) {
|
|
5381
|
+
clearInterval(interval);
|
|
5382
|
+
if (months.current) {
|
|
5383
|
+
months.current.scrollTop = state.monthsData[index2].cssScrollHeight;
|
|
5384
|
+
}
|
|
5385
|
+
}
|
|
5386
|
+
}, 40);
|
|
5387
|
+
} else {
|
|
5388
|
+
months.current.scrollTop = state.monthsData[index2].cssScrollHeight;
|
|
5389
|
+
}
|
|
5390
|
+
}
|
|
5391
|
+
}
|
|
5392
|
+
});
|
|
4767
5393
|
};
|
|
4768
5394
|
React.useEffect(() => {
|
|
4769
5395
|
initData();
|
|
4770
5396
|
}, []);
|
|
5397
|
+
React.useEffect(() => {
|
|
5398
|
+
poppable && resetRender();
|
|
5399
|
+
}, [defaultValue]);
|
|
5400
|
+
React__default["default"].useImperativeHandle(ref, () => ({
|
|
5401
|
+
scrollToDate
|
|
5402
|
+
}));
|
|
4771
5403
|
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4772
5404
|
className: classes
|
|
4773
5405
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4774
5406
|
className: headerClasses
|
|
4775
|
-
},
|
|
5407
|
+
}, showTitle && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4776
5408
|
className: "calendar-title"
|
|
4777
|
-
}, locale.calendaritem.title), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5409
|
+
}, title || locale.calendaritem.title), onBtn && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5410
|
+
className: "calendar-top-slot"
|
|
5411
|
+
}, onBtn()), showSubTitle && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4778
5412
|
className: "calendar-curr-month"
|
|
4779
|
-
}, yearMonthTitle)
|
|
5413
|
+
}, yearMonthTitle), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4780
5414
|
className: "calendar-weeks",
|
|
4781
5415
|
ref: weeksPanel
|
|
4782
5416
|
}, weeks.map((item) => /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
@@ -4784,51 +5418,57 @@
|
|
|
4784
5418
|
key: item
|
|
4785
5419
|
}, item)))), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4786
5420
|
className: "nut-calendar-content",
|
|
4787
|
-
|
|
4788
|
-
onTouchMove,
|
|
4789
|
-
onTouchEnd,
|
|
5421
|
+
onScroll: mothsViewScroll,
|
|
4790
5422
|
ref: months
|
|
4791
5423
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4792
5424
|
className: "calendar-months-panel",
|
|
4793
5425
|
ref: monthsPanel
|
|
4794
5426
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4795
|
-
className: "
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
5427
|
+
className: "viewArea",
|
|
5428
|
+
ref: viewArea,
|
|
5429
|
+
style: { transform: `translateY(${translateY}px)` }
|
|
5430
|
+
}, state.monthsData.slice(monthDefaultRange[0], monthDefaultRange[1]).map((month, key) => {
|
|
5431
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5432
|
+
className: "calendar-month",
|
|
5433
|
+
key
|
|
5434
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5435
|
+
className: "calendar-month-title"
|
|
5436
|
+
}, month.title), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5437
|
+
className: "calendar-month-con"
|
|
5438
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5439
|
+
className: monthitemclasses
|
|
5440
|
+
}, month.monthData.map((day, i) => /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5441
|
+
className: [
|
|
5442
|
+
"calendar-month-day",
|
|
5443
|
+
getClass(day, month)
|
|
5444
|
+
].join(" "),
|
|
5445
|
+
onClick: () => {
|
|
5446
|
+
chooseDay(day, month);
|
|
5447
|
+
},
|
|
5448
|
+
key: i
|
|
5449
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5450
|
+
className: "calendar-day"
|
|
5451
|
+
}, onDay ? onDay(day) : day.day), onTopInfo && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5452
|
+
className: "calendar-curr-tips calendar-curr-tips-top"
|
|
5453
|
+
}, onTopInfo(day)), onBottomInfo && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5454
|
+
className: "calendar-curr-tips calendar-curr-tips-bottom"
|
|
5455
|
+
}, onBottomInfo(day)), !onBottomInfo && showToday && isCurrDay(month, day.day) && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5456
|
+
className: "calendar-curr-tip-curr"
|
|
5457
|
+
}, locale.calendaritem.today), isStartTip(day, month) && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5458
|
+
className: `calendar-day-tip ${rangeTip() ? "calendar-curr-tips-top" : ""}`
|
|
5459
|
+
}, startText || locale.calendaritem.start), isEndTip(day, month) && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5460
|
+
className: "calendar-day-tip"
|
|
5461
|
+
}, endText || locale.calendaritem.end))))));
|
|
5462
|
+
})))), poppable && !isAutoBackFill ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4823
5463
|
className: "nut-calendar-footer"
|
|
4824
5464
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
4825
5465
|
className: "calendar-confirm-btn",
|
|
4826
5466
|
onClick: confirm2
|
|
4827
|
-
}, locale.confirm)) : ""));
|
|
4828
|
-
};
|
|
4829
|
-
CalendarItem.defaultProps = defaultProps$
|
|
5467
|
+
}, confirmText || locale.confirm)) : ""));
|
|
5468
|
+
});
|
|
5469
|
+
CalendarItem.defaultProps = defaultProps$V;
|
|
4830
5470
|
CalendarItem.displayName = "NutCalendarItem";
|
|
4831
|
-
const defaultProps$
|
|
5471
|
+
const defaultProps$U = {
|
|
4832
5472
|
type: "one",
|
|
4833
5473
|
isAutoBackFill: false,
|
|
4834
5474
|
poppable: true,
|
|
@@ -4837,15 +5477,27 @@
|
|
|
4837
5477
|
defaultValue: "",
|
|
4838
5478
|
startDate: Utils.getDay(0),
|
|
4839
5479
|
endDate: Utils.getDay(365),
|
|
5480
|
+
showToday: true,
|
|
5481
|
+
startText: "\u5F00\u59CB",
|
|
5482
|
+
endText: "\u7ED3\u675F",
|
|
5483
|
+
confirmText: "\u786E\u8BA4",
|
|
5484
|
+
showTitle: true,
|
|
5485
|
+
showSubTitle: true,
|
|
5486
|
+
toDateAnimation: true,
|
|
5487
|
+
onBtn: void 0,
|
|
5488
|
+
onDay: void 0,
|
|
5489
|
+
onTopInfo: void 0,
|
|
5490
|
+
onBottomInfo: void 0,
|
|
4840
5491
|
onClose: () => {
|
|
4841
5492
|
},
|
|
4842
5493
|
onChoose: (param) => {
|
|
5494
|
+
},
|
|
5495
|
+
onSelected: (data) => {
|
|
4843
5496
|
}
|
|
4844
5497
|
};
|
|
4845
|
-
const Calendar = (props) => {
|
|
5498
|
+
const Calendar = React__default["default"].forwardRef((props, ref) => {
|
|
4846
5499
|
const { locale } = useConfig();
|
|
4847
5500
|
const {
|
|
4848
|
-
children,
|
|
4849
5501
|
poppable,
|
|
4850
5502
|
visible,
|
|
4851
5503
|
type,
|
|
@@ -4854,14 +5506,25 @@
|
|
|
4854
5506
|
defaultValue,
|
|
4855
5507
|
startDate,
|
|
4856
5508
|
endDate,
|
|
5509
|
+
showToday,
|
|
5510
|
+
startText,
|
|
5511
|
+
endText,
|
|
5512
|
+
confirmText,
|
|
5513
|
+
showTitle,
|
|
5514
|
+
showSubTitle,
|
|
5515
|
+
toDateAnimation,
|
|
5516
|
+
onBtn,
|
|
5517
|
+
onDay,
|
|
5518
|
+
onTopInfo,
|
|
5519
|
+
onBottomInfo,
|
|
4857
5520
|
onClose,
|
|
4858
|
-
onChoose
|
|
4859
|
-
|
|
5521
|
+
onChoose,
|
|
5522
|
+
onSelected
|
|
5523
|
+
} = { ...defaultProps$U, ...props };
|
|
5524
|
+
const calendarRef = React.useRef(null);
|
|
4860
5525
|
const close = () => {
|
|
4861
5526
|
onClose && onClose();
|
|
4862
5527
|
};
|
|
4863
|
-
const update2 = () => {
|
|
4864
|
-
};
|
|
4865
5528
|
const choose = (param) => {
|
|
4866
5529
|
close();
|
|
4867
5530
|
onChoose && onChoose(param);
|
|
@@ -4869,39 +5532,56 @@
|
|
|
4869
5532
|
const closePopup = () => {
|
|
4870
5533
|
close();
|
|
4871
5534
|
};
|
|
5535
|
+
const select = (param) => {
|
|
5536
|
+
onSelected && onSelected(param);
|
|
5537
|
+
};
|
|
5538
|
+
const scrollToDate = (date) => {
|
|
5539
|
+
var _a;
|
|
5540
|
+
(_a = calendarRef.current) == null ? void 0 : _a.scrollToDate(date);
|
|
5541
|
+
};
|
|
5542
|
+
React__default["default"].useImperativeHandle(ref, () => ({
|
|
5543
|
+
scrollToDate
|
|
5544
|
+
}));
|
|
5545
|
+
const renderItem = () => {
|
|
5546
|
+
return /* @__PURE__ */ React__default["default"].createElement(CalendarItem, {
|
|
5547
|
+
ref: calendarRef,
|
|
5548
|
+
type,
|
|
5549
|
+
isAutoBackFill,
|
|
5550
|
+
poppable,
|
|
5551
|
+
title: locale.calendaritem.title || title,
|
|
5552
|
+
defaultValue,
|
|
5553
|
+
startDate,
|
|
5554
|
+
endDate,
|
|
5555
|
+
showToday,
|
|
5556
|
+
startText,
|
|
5557
|
+
endText,
|
|
5558
|
+
confirmText,
|
|
5559
|
+
showTitle,
|
|
5560
|
+
showSubTitle,
|
|
5561
|
+
toDateAnimation,
|
|
5562
|
+
onBtn,
|
|
5563
|
+
onDay,
|
|
5564
|
+
onTopInfo,
|
|
5565
|
+
onBottomInfo,
|
|
5566
|
+
onChoose: choose,
|
|
5567
|
+
onSelected: select
|
|
5568
|
+
});
|
|
5569
|
+
};
|
|
4872
5570
|
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, poppable ? /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
4873
5571
|
visible,
|
|
4874
5572
|
position: "bottom",
|
|
4875
5573
|
round: true,
|
|
5574
|
+
duration: 0.5,
|
|
4876
5575
|
closeable: true,
|
|
5576
|
+
destroyOnClose: true,
|
|
4877
5577
|
onClickOverlay: closePopup,
|
|
4878
|
-
onClickCloseIcon: closePopup
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
title: locale.calendaritem.title || title,
|
|
4884
|
-
defaultValue,
|
|
4885
|
-
startDate,
|
|
4886
|
-
endDate,
|
|
4887
|
-
onUpdate: update2,
|
|
4888
|
-
onClose: close,
|
|
4889
|
-
onChoose: choose
|
|
4890
|
-
})) : /* @__PURE__ */ React__default["default"].createElement(CalendarItem, {
|
|
4891
|
-
type,
|
|
4892
|
-
isAutoBackFill,
|
|
4893
|
-
poppable,
|
|
4894
|
-
title: locale.calendaritem.title,
|
|
4895
|
-
defaultValue,
|
|
4896
|
-
startDate,
|
|
4897
|
-
endDate,
|
|
4898
|
-
onClose: close,
|
|
4899
|
-
onChoose: choose
|
|
4900
|
-
}));
|
|
4901
|
-
};
|
|
4902
|
-
Calendar.defaultProps = defaultProps$P;
|
|
5578
|
+
onClickCloseIcon: closePopup,
|
|
5579
|
+
style: { height: "85vh" }
|
|
5580
|
+
}, renderItem()) : renderItem());
|
|
5581
|
+
});
|
|
5582
|
+
Calendar.defaultProps = defaultProps$U;
|
|
4903
5583
|
Calendar.displayName = "NutCalendar";
|
|
4904
|
-
const defaultProps$
|
|
5584
|
+
const defaultProps$T = {
|
|
4905
5585
|
disabled: false,
|
|
4906
5586
|
checkedValue: [],
|
|
4907
5587
|
max: void 0,
|
|
@@ -4910,7 +5590,7 @@
|
|
|
4910
5590
|
};
|
|
4911
5591
|
const CheckboxGroup = React__default["default"].forwardRef(
|
|
4912
5592
|
(props, ref) => {
|
|
4913
|
-
const { children } = { ...defaultProps$
|
|
5593
|
+
const { children } = { ...defaultProps$T, ...props };
|
|
4914
5594
|
const b2 = cn("checkboxgroup");
|
|
4915
5595
|
const { className, disabled, onChange, checkedValue, max, ...rest } = props;
|
|
4916
5596
|
const [innerDisabled, setInnerDisabled] = React.useState(disabled);
|
|
@@ -4988,9 +5668,9 @@
|
|
|
4988
5668
|
}, cloneChildren());
|
|
4989
5669
|
}
|
|
4990
5670
|
);
|
|
4991
|
-
CheckboxGroup.defaultProps = defaultProps$
|
|
5671
|
+
CheckboxGroup.defaultProps = defaultProps$T;
|
|
4992
5672
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
4993
|
-
const defaultProps$
|
|
5673
|
+
const defaultProps$S = {
|
|
4994
5674
|
checked: false,
|
|
4995
5675
|
disabled: false,
|
|
4996
5676
|
textPosition: "right",
|
|
@@ -5004,7 +5684,7 @@
|
|
|
5004
5684
|
}
|
|
5005
5685
|
};
|
|
5006
5686
|
const Checkbox = (props) => {
|
|
5007
|
-
const { children } = { ...defaultProps$
|
|
5687
|
+
const { children } = { ...defaultProps$S, ...props };
|
|
5008
5688
|
const b2 = cn("checkbox");
|
|
5009
5689
|
const {
|
|
5010
5690
|
iconName,
|
|
@@ -5084,7 +5764,7 @@
|
|
|
5084
5764
|
onClick: handleClick2
|
|
5085
5765
|
}, renderIcon(), renderLabel());
|
|
5086
5766
|
};
|
|
5087
|
-
Checkbox.defaultProps = defaultProps$
|
|
5767
|
+
Checkbox.defaultProps = defaultProps$S;
|
|
5088
5768
|
Checkbox.displayName = "NutCheckBox";
|
|
5089
5769
|
Checkbox.Group = CheckboxGroup;
|
|
5090
5770
|
const InternalPickerSlot = (props, ref) => {
|
|
@@ -5167,7 +5847,7 @@
|
|
|
5167
5847
|
const touchMove = (event) => {
|
|
5168
5848
|
touch.move(event);
|
|
5169
5849
|
if (touch.isVertical) {
|
|
5170
|
-
|
|
5850
|
+
preventDefault2(event, true);
|
|
5171
5851
|
}
|
|
5172
5852
|
const move = touch.deltaY - startY;
|
|
5173
5853
|
setMove(move);
|
|
@@ -5217,7 +5897,7 @@
|
|
|
5217
5897
|
const stopMomentum = () => {
|
|
5218
5898
|
setChooseValue(scrollDistance);
|
|
5219
5899
|
};
|
|
5220
|
-
const
|
|
5900
|
+
const preventDefault2 = (event, isStopPropagation) => {
|
|
5221
5901
|
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
5222
5902
|
event.preventDefault();
|
|
5223
5903
|
}
|
|
@@ -5450,7 +6130,7 @@
|
|
|
5450
6130
|
};
|
|
5451
6131
|
const Picker = React__default["default"].forwardRef(InternalPicker);
|
|
5452
6132
|
const currentYear = new Date().getFullYear();
|
|
5453
|
-
const defaultProps$
|
|
6133
|
+
const defaultProps$R = {
|
|
5454
6134
|
modelValue: null,
|
|
5455
6135
|
visible: false,
|
|
5456
6136
|
title: "",
|
|
@@ -5480,9 +6160,10 @@
|
|
|
5480
6160
|
style,
|
|
5481
6161
|
...rest
|
|
5482
6162
|
} = {
|
|
5483
|
-
...defaultProps$
|
|
6163
|
+
...defaultProps$R,
|
|
5484
6164
|
...props
|
|
5485
6165
|
};
|
|
6166
|
+
const { locale } = useConfig();
|
|
5486
6167
|
const [show, setShow] = React.useState(false);
|
|
5487
6168
|
const [currentDate, setCurrentDate] = React.useState(modelValue);
|
|
5488
6169
|
const [defaultValue, setDefaultValue] = React.useState([]);
|
|
@@ -5491,13 +6172,14 @@
|
|
|
5491
6172
|
const isDate = (val) => {
|
|
5492
6173
|
return Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
|
5493
6174
|
};
|
|
6175
|
+
const datepickerLang = locale.datepicker;
|
|
5494
6176
|
const zhCNType = {
|
|
5495
|
-
day:
|
|
5496
|
-
year:
|
|
5497
|
-
month:
|
|
5498
|
-
hour:
|
|
5499
|
-
minute:
|
|
5500
|
-
seconds:
|
|
6177
|
+
day: datepickerLang.day,
|
|
6178
|
+
year: datepickerLang.year,
|
|
6179
|
+
month: datepickerLang.month,
|
|
6180
|
+
hour: datepickerLang.hour,
|
|
6181
|
+
minute: datepickerLang.min,
|
|
6182
|
+
seconds: datepickerLang.seconds
|
|
5501
6183
|
};
|
|
5502
6184
|
const formatValue = (value) => {
|
|
5503
6185
|
let cvalue = value;
|
|
@@ -5745,9 +6427,9 @@
|
|
|
5745
6427
|
ref: pickerRef
|
|
5746
6428
|
}));
|
|
5747
6429
|
};
|
|
5748
|
-
DatePicker.defaultProps = defaultProps$
|
|
6430
|
+
DatePicker.defaultProps = defaultProps$R;
|
|
5749
6431
|
DatePicker.displayName = "NutDatePicker";
|
|
5750
|
-
const defaultProps$
|
|
6432
|
+
const defaultProps$Q = {
|
|
5751
6433
|
disabled: false,
|
|
5752
6434
|
buttonSize: "",
|
|
5753
6435
|
min: 1,
|
|
@@ -5785,7 +6467,7 @@
|
|
|
5785
6467
|
focus,
|
|
5786
6468
|
...restProps
|
|
5787
6469
|
} = {
|
|
5788
|
-
...defaultProps$
|
|
6470
|
+
...defaultProps$Q,
|
|
5789
6471
|
...props
|
|
5790
6472
|
};
|
|
5791
6473
|
const [inputValue, setInputValue] = React.useState(modelValue);
|
|
@@ -5910,7 +6592,7 @@
|
|
|
5910
6592
|
onClick: addNumber
|
|
5911
6593
|
}));
|
|
5912
6594
|
};
|
|
5913
|
-
InputNumber.defaultProps = defaultProps$
|
|
6595
|
+
InputNumber.defaultProps = defaultProps$Q;
|
|
5914
6596
|
InputNumber.displayName = "NutInputNumber";
|
|
5915
6597
|
function trimExtraChar(value, char, regExp) {
|
|
5916
6598
|
const index2 = value.indexOf(char);
|
|
@@ -5936,7 +6618,7 @@
|
|
|
5936
6618
|
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
5937
6619
|
return value.replace(regExp, "");
|
|
5938
6620
|
}
|
|
5939
|
-
const defaultProps$
|
|
6621
|
+
const defaultProps$P = {
|
|
5940
6622
|
type: "text",
|
|
5941
6623
|
defaultValue: "",
|
|
5942
6624
|
placeholder: "",
|
|
@@ -6019,7 +6701,7 @@
|
|
|
6019
6701
|
clickRightIcon,
|
|
6020
6702
|
click,
|
|
6021
6703
|
...rest
|
|
6022
|
-
} = { ...defaultProps$
|
|
6704
|
+
} = { ...defaultProps$P, ...props };
|
|
6023
6705
|
locale.placeholder = placeholder || locale.placeholder;
|
|
6024
6706
|
const [inputValue, SetInputValue] = React.useState("");
|
|
6025
6707
|
const [active, SetActive] = React.useState(false);
|
|
@@ -6231,14 +6913,14 @@
|
|
|
6231
6913
|
}
|
|
6232
6914
|
}, errorMessage) : null)));
|
|
6233
6915
|
};
|
|
6234
|
-
Input.defaultProps = defaultProps$
|
|
6916
|
+
Input.defaultProps = defaultProps$P;
|
|
6235
6917
|
Input.displayName = "NutInput";
|
|
6236
6918
|
const radioContext = {
|
|
6237
6919
|
onChange: (val) => {
|
|
6238
6920
|
}
|
|
6239
6921
|
};
|
|
6240
6922
|
var RadioContext = React__default["default"].createContext(radioContext);
|
|
6241
|
-
const defaultProps$
|
|
6923
|
+
const defaultProps$O = {
|
|
6242
6924
|
value: null,
|
|
6243
6925
|
textPosition: "right",
|
|
6244
6926
|
onChange: (value) => {
|
|
@@ -6247,7 +6929,7 @@
|
|
|
6247
6929
|
};
|
|
6248
6930
|
const RadioGroup = React__default["default"].forwardRef(
|
|
6249
6931
|
(props, ref) => {
|
|
6250
|
-
const { children } = { ...defaultProps$
|
|
6932
|
+
const { children } = { ...defaultProps$O, ...props };
|
|
6251
6933
|
cn("RadioGroup");
|
|
6252
6934
|
const { className, value, onChange, textPosition, direction, ...rest } = props;
|
|
6253
6935
|
const [val2State, setVal2State] = React.useState(value);
|
|
@@ -6284,9 +6966,9 @@
|
|
|
6284
6966
|
}, cloneChildren()));
|
|
6285
6967
|
}
|
|
6286
6968
|
);
|
|
6287
|
-
RadioGroup.defaultProps = defaultProps$
|
|
6969
|
+
RadioGroup.defaultProps = defaultProps$O;
|
|
6288
6970
|
RadioGroup.displayName = "NutRadioGroup";
|
|
6289
|
-
const defaultProps$
|
|
6971
|
+
const defaultProps$N = {
|
|
6290
6972
|
disabled: false,
|
|
6291
6973
|
checked: false,
|
|
6292
6974
|
shape: "round",
|
|
@@ -6299,7 +6981,7 @@
|
|
|
6299
6981
|
}
|
|
6300
6982
|
};
|
|
6301
6983
|
const Radio = (props) => {
|
|
6302
|
-
const { children } = { ...defaultProps$
|
|
6984
|
+
const { children } = { ...defaultProps$N, ...props };
|
|
6303
6985
|
const {
|
|
6304
6986
|
className,
|
|
6305
6987
|
disabled,
|
|
@@ -6373,10 +7055,10 @@
|
|
|
6373
7055
|
...rest
|
|
6374
7056
|
}, renderRadioItem());
|
|
6375
7057
|
};
|
|
6376
|
-
Radio.defaultProps = defaultProps$
|
|
7058
|
+
Radio.defaultProps = defaultProps$N;
|
|
6377
7059
|
Radio.displayName = "NutRadio";
|
|
6378
7060
|
Radio.RadioGroup = RadioGroup;
|
|
6379
|
-
const defaultProps$
|
|
7061
|
+
const defaultProps$M = {
|
|
6380
7062
|
count: 5,
|
|
6381
7063
|
modelValue: 0,
|
|
6382
7064
|
minimizeValue: 0,
|
|
@@ -6405,7 +7087,7 @@
|
|
|
6405
7087
|
allowHalf,
|
|
6406
7088
|
spacing,
|
|
6407
7089
|
change
|
|
6408
|
-
} = { ...defaultProps$
|
|
7090
|
+
} = { ...defaultProps$M, ...props };
|
|
6409
7091
|
const b2 = cn("rate");
|
|
6410
7092
|
const bi = cn("rate-item");
|
|
6411
7093
|
const [countArray, setCountArray] = React.useState([1, 2, 3, 4, 5]);
|
|
@@ -6471,9 +7153,9 @@
|
|
|
6471
7153
|
}));
|
|
6472
7154
|
}));
|
|
6473
7155
|
};
|
|
6474
|
-
Rate.defaultProps = defaultProps$
|
|
7156
|
+
Rate.defaultProps = defaultProps$M;
|
|
6475
7157
|
Rate.displayName = "NutRate";
|
|
6476
|
-
const defaultProps$
|
|
7158
|
+
const defaultProps$L = {
|
|
6477
7159
|
title: "",
|
|
6478
7160
|
desc: "",
|
|
6479
7161
|
tips: "",
|
|
@@ -6636,9 +7318,9 @@
|
|
|
6636
7318
|
onClick: () => sure()
|
|
6637
7319
|
}, locale.confirm)) : null)));
|
|
6638
7320
|
};
|
|
6639
|
-
ShortPassword.defaultProps = defaultProps$
|
|
7321
|
+
ShortPassword.defaultProps = defaultProps$L;
|
|
6640
7322
|
ShortPassword.displayName = "NutShortPassword";
|
|
6641
|
-
const defaultProps$
|
|
7323
|
+
const defaultProps$K = {
|
|
6642
7324
|
defaultValue: "",
|
|
6643
7325
|
textAlign: "left",
|
|
6644
7326
|
limitshow: false,
|
|
@@ -6666,9 +7348,10 @@
|
|
|
6666
7348
|
onChange,
|
|
6667
7349
|
onBlur,
|
|
6668
7350
|
onFocus
|
|
6669
|
-
} = { ...defaultProps$
|
|
7351
|
+
} = { ...defaultProps$K, ...props };
|
|
6670
7352
|
const textareaBem = cn("textarea");
|
|
6671
7353
|
const [inputValue, SetInputValue] = React.useState("");
|
|
7354
|
+
const textareaRef = React.useRef(null);
|
|
6672
7355
|
React.useEffect(() => {
|
|
6673
7356
|
if (defaultValue) {
|
|
6674
7357
|
let initValue = defaultValue;
|
|
@@ -6677,7 +7360,38 @@
|
|
|
6677
7360
|
}
|
|
6678
7361
|
SetInputValue(initValue);
|
|
6679
7362
|
}
|
|
6680
|
-
|
|
7363
|
+
if (autosize) {
|
|
7364
|
+
setTimeout(() => {
|
|
7365
|
+
setContentHeight();
|
|
7366
|
+
});
|
|
7367
|
+
}
|
|
7368
|
+
}, [defaultValue, autosize]);
|
|
7369
|
+
React.useEffect(() => {
|
|
7370
|
+
if (inputValue) {
|
|
7371
|
+
if (autosize) {
|
|
7372
|
+
setContentHeight();
|
|
7373
|
+
}
|
|
7374
|
+
}
|
|
7375
|
+
}, [inputValue]);
|
|
7376
|
+
const setContentHeight = () => {
|
|
7377
|
+
const textarea = textareaRef.current;
|
|
7378
|
+
if (textarea) {
|
|
7379
|
+
textarea.style.height = "auto";
|
|
7380
|
+
let height = textarea == null ? void 0 : textarea.scrollHeight;
|
|
7381
|
+
if (typeof autosize === "object") {
|
|
7382
|
+
const { maxHeight, minHeight } = autosize;
|
|
7383
|
+
if (maxHeight !== void 0) {
|
|
7384
|
+
height = Math.min(height, maxHeight);
|
|
7385
|
+
}
|
|
7386
|
+
if (minHeight !== void 0) {
|
|
7387
|
+
height = Math.max(height, minHeight);
|
|
7388
|
+
}
|
|
7389
|
+
}
|
|
7390
|
+
if (height) {
|
|
7391
|
+
textarea.style.height = `${height}px`;
|
|
7392
|
+
}
|
|
7393
|
+
}
|
|
7394
|
+
};
|
|
6681
7395
|
const textChange = (event) => {
|
|
6682
7396
|
const text = event.target;
|
|
6683
7397
|
if (maxlength && text.value.length > Number(maxlength)) {
|
|
@@ -6705,10 +7419,10 @@
|
|
|
6705
7419
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
6706
7420
|
className: `${textareaBem()} ${disabled ? textareaBem("disabled") : ""} ${className || ""}`
|
|
6707
7421
|
}, /* @__PURE__ */ React__default["default"].createElement("textarea", {
|
|
7422
|
+
ref: textareaRef,
|
|
6708
7423
|
className: textareaBem("textarea"),
|
|
6709
7424
|
style: {
|
|
6710
7425
|
textAlign,
|
|
6711
|
-
resize: `${autosize ? "vertical" : "none"}`,
|
|
6712
7426
|
...style
|
|
6713
7427
|
},
|
|
6714
7428
|
disabled,
|
|
@@ -6733,7 +7447,7 @@
|
|
|
6733
7447
|
className: textareaBem("limit")
|
|
6734
7448
|
}, inputValue.length, "/", maxlength < 0 ? 0 : maxlength) : null);
|
|
6735
7449
|
};
|
|
6736
|
-
TextArea.defaultProps = defaultProps$
|
|
7450
|
+
TextArea.defaultProps = defaultProps$K;
|
|
6737
7451
|
TextArea.displayName = "NutTextArea";
|
|
6738
7452
|
class UploadOptions {
|
|
6739
7453
|
constructor() {
|
|
@@ -6786,7 +7500,7 @@
|
|
|
6786
7500
|
}
|
|
6787
7501
|
}
|
|
6788
7502
|
}
|
|
6789
|
-
const defaultProps$
|
|
7503
|
+
const defaultProps$J = {
|
|
6790
7504
|
url: "",
|
|
6791
7505
|
maximum: 1,
|
|
6792
7506
|
uploadIcon: "photograph",
|
|
@@ -6861,7 +7575,7 @@
|
|
|
6861
7575
|
beforeUpload,
|
|
6862
7576
|
beforeDelete,
|
|
6863
7577
|
...restProps
|
|
6864
|
-
} = { ...defaultProps$
|
|
7578
|
+
} = { ...defaultProps$J, ...props };
|
|
6865
7579
|
const [fileList, setFileList] = React.useState([]);
|
|
6866
7580
|
const [uploadQueue, setUploadQueue] = React.useState([]);
|
|
6867
7581
|
React.useEffect(() => {
|
|
@@ -7160,9 +7874,497 @@
|
|
|
7160
7874
|
})));
|
|
7161
7875
|
};
|
|
7162
7876
|
const Uploader = React__default["default"].forwardRef(InternalUploader);
|
|
7163
|
-
Uploader.defaultProps = defaultProps$
|
|
7877
|
+
Uploader.defaultProps = defaultProps$J;
|
|
7164
7878
|
Uploader.displayName = "NutUploader";
|
|
7165
|
-
const defaultProps$
|
|
7879
|
+
const defaultProps$I = {
|
|
7880
|
+
data: {
|
|
7881
|
+
text: "",
|
|
7882
|
+
value: "",
|
|
7883
|
+
paneKey: "",
|
|
7884
|
+
disabled: false,
|
|
7885
|
+
loading: false,
|
|
7886
|
+
children: []
|
|
7887
|
+
},
|
|
7888
|
+
checked: false,
|
|
7889
|
+
chooseItem: () => {
|
|
7890
|
+
}
|
|
7891
|
+
};
|
|
7892
|
+
const InternalCascaderItem = (props) => {
|
|
7893
|
+
const { data, checked, chooseItem } = {
|
|
7894
|
+
...defaultProps$I,
|
|
7895
|
+
...props
|
|
7896
|
+
};
|
|
7897
|
+
const b2 = cn("cascader-item");
|
|
7898
|
+
const classes = classNames(
|
|
7899
|
+
{
|
|
7900
|
+
active: checked,
|
|
7901
|
+
disabled: data.disabled
|
|
7902
|
+
},
|
|
7903
|
+
b2("")
|
|
7904
|
+
);
|
|
7905
|
+
const classesTitle = classNames({
|
|
7906
|
+
[`${b2("")}__title`]: true
|
|
7907
|
+
});
|
|
7908
|
+
React.useEffect(() => {
|
|
7909
|
+
initData();
|
|
7910
|
+
}, [data]);
|
|
7911
|
+
const initData = () => {
|
|
7912
|
+
};
|
|
7913
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7914
|
+
className: classes,
|
|
7915
|
+
onClick: () => {
|
|
7916
|
+
chooseItem(data);
|
|
7917
|
+
}
|
|
7918
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7919
|
+
className: classesTitle
|
|
7920
|
+
}, data.text), data.loading ? /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
7921
|
+
color: "#969799",
|
|
7922
|
+
className: "nut-cascader-item__icon-loading",
|
|
7923
|
+
name: "loading"
|
|
7924
|
+
}) : /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
7925
|
+
className: `${checked ? b2("icon-check") : ""}`,
|
|
7926
|
+
name: "checklist"
|
|
7927
|
+
}));
|
|
7928
|
+
};
|
|
7929
|
+
const CascaderItem = React__default["default"].forwardRef(InternalCascaderItem);
|
|
7930
|
+
CascaderItem.defaultProps = defaultProps$I;
|
|
7931
|
+
CascaderItem.displayName = "NutCascaderItem";
|
|
7932
|
+
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
7933
|
+
const {
|
|
7934
|
+
value: valueKey = "value",
|
|
7935
|
+
text: textKey = "text",
|
|
7936
|
+
children: childrenKey = "children"
|
|
7937
|
+
} = config2;
|
|
7938
|
+
const {
|
|
7939
|
+
[valueKey]: value,
|
|
7940
|
+
[textKey]: text,
|
|
7941
|
+
[childrenKey]: children,
|
|
7942
|
+
...others
|
|
7943
|
+
} = node;
|
|
7944
|
+
const newNode = {
|
|
7945
|
+
loading: false,
|
|
7946
|
+
...others,
|
|
7947
|
+
level: parent ? (parent && parent.level || 0) + 1 : 0,
|
|
7948
|
+
value,
|
|
7949
|
+
text,
|
|
7950
|
+
children,
|
|
7951
|
+
_parent: parent
|
|
7952
|
+
};
|
|
7953
|
+
if (newNode.children && newNode.children.length) {
|
|
7954
|
+
newNode.children = formatTree(newNode.children, newNode, config2);
|
|
7955
|
+
}
|
|
7956
|
+
return newNode;
|
|
7957
|
+
});
|
|
7958
|
+
const eachTree = (tree, cb) => {
|
|
7959
|
+
let i = 0;
|
|
7960
|
+
let node;
|
|
7961
|
+
while (node = tree[i++]) {
|
|
7962
|
+
if (cb(node) === true) {
|
|
7963
|
+
break;
|
|
7964
|
+
}
|
|
7965
|
+
if (node.children && node.children.length) {
|
|
7966
|
+
eachTree(node.children, cb);
|
|
7967
|
+
}
|
|
7968
|
+
}
|
|
7969
|
+
};
|
|
7970
|
+
const defaultConvertConfig = {
|
|
7971
|
+
topId: null,
|
|
7972
|
+
idKey: "id",
|
|
7973
|
+
pidKey: "pid",
|
|
7974
|
+
sortKey: ""
|
|
7975
|
+
};
|
|
7976
|
+
const convertListToOptions = (list, options2) => {
|
|
7977
|
+
const mergedOptions = {
|
|
7978
|
+
...defaultConvertConfig,
|
|
7979
|
+
...options2 || {}
|
|
7980
|
+
};
|
|
7981
|
+
const { topId, idKey, pidKey, sortKey } = mergedOptions;
|
|
7982
|
+
let result = [];
|
|
7983
|
+
let map = {};
|
|
7984
|
+
list.forEach((node) => {
|
|
7985
|
+
node = { ...node };
|
|
7986
|
+
const { [idKey]: id, [pidKey]: pid } = node;
|
|
7987
|
+
const children = map[pid] = map[pid] || [];
|
|
7988
|
+
if (!result.length && pid === topId) {
|
|
7989
|
+
result = children;
|
|
7990
|
+
}
|
|
7991
|
+
children.push(node);
|
|
7992
|
+
node.children = map[id] || (map[id] = []);
|
|
7993
|
+
});
|
|
7994
|
+
if (sortKey) {
|
|
7995
|
+
Object.keys(map).forEach((i) => {
|
|
7996
|
+
if (map[i].length > 1) {
|
|
7997
|
+
map[i].sort((a, b2) => a[sortKey] - b2[sortKey]);
|
|
7998
|
+
}
|
|
7999
|
+
});
|
|
8000
|
+
}
|
|
8001
|
+
map = null;
|
|
8002
|
+
return result;
|
|
8003
|
+
};
|
|
8004
|
+
class Tree {
|
|
8005
|
+
constructor(nodes, config2) {
|
|
8006
|
+
this.isLeaf = (node, lazy) => {
|
|
8007
|
+
const { leaf, children } = node;
|
|
8008
|
+
const hasChildren = Array.isArray(children) && Boolean(children.length);
|
|
8009
|
+
return leaf || !hasChildren && !lazy;
|
|
8010
|
+
};
|
|
8011
|
+
this.hasChildren = (node, lazy) => {
|
|
8012
|
+
const isLeaf = this.isLeaf(node, lazy);
|
|
8013
|
+
if (isLeaf) {
|
|
8014
|
+
return false;
|
|
8015
|
+
}
|
|
8016
|
+
const { children } = node;
|
|
8017
|
+
return Array.isArray(children) && Boolean(children.length);
|
|
8018
|
+
};
|
|
8019
|
+
this.config = {
|
|
8020
|
+
value: "value",
|
|
8021
|
+
text: "text",
|
|
8022
|
+
children: "children",
|
|
8023
|
+
...config2 || {}
|
|
8024
|
+
};
|
|
8025
|
+
this.nodes = formatTree(nodes, null, this.config);
|
|
8026
|
+
}
|
|
8027
|
+
updateChildren(nodes, parent) {
|
|
8028
|
+
if (!parent) {
|
|
8029
|
+
this.nodes = formatTree(nodes, null, this.config);
|
|
8030
|
+
} else {
|
|
8031
|
+
parent.children = formatTree(nodes, parent, this.config);
|
|
8032
|
+
}
|
|
8033
|
+
}
|
|
8034
|
+
getNodeByValue(value) {
|
|
8035
|
+
let foundNode;
|
|
8036
|
+
eachTree(this.nodes, (node) => {
|
|
8037
|
+
if (node.value === value) {
|
|
8038
|
+
foundNode = node;
|
|
8039
|
+
return true;
|
|
8040
|
+
}
|
|
8041
|
+
return null;
|
|
8042
|
+
});
|
|
8043
|
+
return foundNode;
|
|
8044
|
+
}
|
|
8045
|
+
getPathNodesByValue(value) {
|
|
8046
|
+
if (!value.length) {
|
|
8047
|
+
return [];
|
|
8048
|
+
}
|
|
8049
|
+
const pathNodes = [];
|
|
8050
|
+
let currentNodes = this.nodes;
|
|
8051
|
+
while (currentNodes && currentNodes.length) {
|
|
8052
|
+
const foundNode = currentNodes.find(
|
|
8053
|
+
(node) => node.value === value[node.level]
|
|
8054
|
+
);
|
|
8055
|
+
if (!foundNode) {
|
|
8056
|
+
break;
|
|
8057
|
+
}
|
|
8058
|
+
pathNodes.push(foundNode);
|
|
8059
|
+
currentNodes = foundNode.children;
|
|
8060
|
+
}
|
|
8061
|
+
return pathNodes;
|
|
8062
|
+
}
|
|
8063
|
+
}
|
|
8064
|
+
const defaultProps$H = {
|
|
8065
|
+
className: "",
|
|
8066
|
+
style: {},
|
|
8067
|
+
visible: false,
|
|
8068
|
+
options: [],
|
|
8069
|
+
value: [],
|
|
8070
|
+
title: "",
|
|
8071
|
+
textKey: "text",
|
|
8072
|
+
valueKey: "value",
|
|
8073
|
+
childrenKey: "children",
|
|
8074
|
+
convertConfig: {},
|
|
8075
|
+
closeable: false,
|
|
8076
|
+
closeIconPosition: "top-right",
|
|
8077
|
+
closeIcon: "close",
|
|
8078
|
+
lazy: false,
|
|
8079
|
+
lazyLoad: () => {
|
|
8080
|
+
},
|
|
8081
|
+
onClose: () => {
|
|
8082
|
+
},
|
|
8083
|
+
onChange: () => {
|
|
8084
|
+
},
|
|
8085
|
+
onPathChange: () => {
|
|
8086
|
+
},
|
|
8087
|
+
...Popup.defaultProps
|
|
8088
|
+
};
|
|
8089
|
+
const InternalCascader = (props) => {
|
|
8090
|
+
const {
|
|
8091
|
+
className,
|
|
8092
|
+
style,
|
|
8093
|
+
visible,
|
|
8094
|
+
options: options2,
|
|
8095
|
+
value,
|
|
8096
|
+
title,
|
|
8097
|
+
textKey,
|
|
8098
|
+
valueKey,
|
|
8099
|
+
childrenKey,
|
|
8100
|
+
convertConfig: convertConfig2,
|
|
8101
|
+
closeable,
|
|
8102
|
+
closeIconPosition,
|
|
8103
|
+
closeIcon,
|
|
8104
|
+
lazy,
|
|
8105
|
+
lazyLoad,
|
|
8106
|
+
onClose,
|
|
8107
|
+
onChange,
|
|
8108
|
+
onPathChange
|
|
8109
|
+
} = { ...defaultProps$H, ...props };
|
|
8110
|
+
const [tabvalue, setTabvalue] = React.useState("c1");
|
|
8111
|
+
const [optiosData, setOptiosData] = React.useState([]);
|
|
8112
|
+
const isLazy = () => state.configs.lazy && Boolean(state.configs.lazyLoad);
|
|
8113
|
+
const [state] = React.useState({
|
|
8114
|
+
optionsData: [],
|
|
8115
|
+
panes: [
|
|
8116
|
+
{
|
|
8117
|
+
nodes: [],
|
|
8118
|
+
selectedNode: [],
|
|
8119
|
+
paneKey: ""
|
|
8120
|
+
}
|
|
8121
|
+
],
|
|
8122
|
+
innerValue: value,
|
|
8123
|
+
tree: new Tree([], {}),
|
|
8124
|
+
tabsCursor: 0,
|
|
8125
|
+
initLoading: false,
|
|
8126
|
+
currentProcessNode: [],
|
|
8127
|
+
configs: {
|
|
8128
|
+
lazy,
|
|
8129
|
+
lazyLoad,
|
|
8130
|
+
valueKey,
|
|
8131
|
+
textKey,
|
|
8132
|
+
childrenKey,
|
|
8133
|
+
convertConfig: convertConfig2
|
|
8134
|
+
},
|
|
8135
|
+
lazyLoadMap: /* @__PURE__ */ new Map()
|
|
8136
|
+
});
|
|
8137
|
+
const b2 = cn("cascader");
|
|
8138
|
+
const classes = classNames(b2(""));
|
|
8139
|
+
const classesPane = classNames({
|
|
8140
|
+
[`${b2("")}-pane`]: true
|
|
8141
|
+
});
|
|
8142
|
+
React.useEffect(() => {
|
|
8143
|
+
initData();
|
|
8144
|
+
}, []);
|
|
8145
|
+
React.useEffect(() => {
|
|
8146
|
+
if (value !== state.innerValue) {
|
|
8147
|
+
state.innerValue = value;
|
|
8148
|
+
}
|
|
8149
|
+
}, [value]);
|
|
8150
|
+
React.useEffect(() => {
|
|
8151
|
+
initData();
|
|
8152
|
+
}, [options2]);
|
|
8153
|
+
const initData = async () => {
|
|
8154
|
+
state.lazyLoadMap.clear();
|
|
8155
|
+
if (convertConfig2 && Object.keys(convertConfig2).length > 0) {
|
|
8156
|
+
state.optionsData = convertListToOptions(
|
|
8157
|
+
options2,
|
|
8158
|
+
convertConfig2
|
|
8159
|
+
);
|
|
8160
|
+
} else {
|
|
8161
|
+
state.optionsData = options2;
|
|
8162
|
+
}
|
|
8163
|
+
state.tree = new Tree(state.optionsData, {
|
|
8164
|
+
value: state.configs.valueKey,
|
|
8165
|
+
text: state.configs.textKey,
|
|
8166
|
+
children: state.configs.childrenKey
|
|
8167
|
+
});
|
|
8168
|
+
if (isLazy() && !state.tree.nodes.length) {
|
|
8169
|
+
await invokeLazyLoad({
|
|
8170
|
+
root: true,
|
|
8171
|
+
loading: true,
|
|
8172
|
+
text: "",
|
|
8173
|
+
value: ""
|
|
8174
|
+
});
|
|
8175
|
+
}
|
|
8176
|
+
state.panes = [
|
|
8177
|
+
{
|
|
8178
|
+
nodes: state.tree.nodes,
|
|
8179
|
+
selectedNode: null,
|
|
8180
|
+
paneKey: "c1"
|
|
8181
|
+
}
|
|
8182
|
+
];
|
|
8183
|
+
syncValue();
|
|
8184
|
+
setOptiosData(state.panes);
|
|
8185
|
+
};
|
|
8186
|
+
const syncValue = async () => {
|
|
8187
|
+
const currentValue2 = state.innerValue;
|
|
8188
|
+
if (currentValue2 === void 0 || !state.tree.nodes.length) {
|
|
8189
|
+
return;
|
|
8190
|
+
}
|
|
8191
|
+
if (currentValue2.length === 0) {
|
|
8192
|
+
state.tabsCursor = 0;
|
|
8193
|
+
return;
|
|
8194
|
+
}
|
|
8195
|
+
let needToSync = currentValue2;
|
|
8196
|
+
if (isLazy() && Array.isArray(currentValue2) && currentValue2.length) {
|
|
8197
|
+
needToSync = [];
|
|
8198
|
+
const parent = state.tree.nodes.find(
|
|
8199
|
+
(node) => node.value === currentValue2[0]
|
|
8200
|
+
);
|
|
8201
|
+
if (parent) {
|
|
8202
|
+
needToSync = [parent.value];
|
|
8203
|
+
state.initLoading = true;
|
|
8204
|
+
const last = await currentValue2.slice(1).reduce(async (p2, value2) => {
|
|
8205
|
+
var _a;
|
|
8206
|
+
const parent2 = await p2;
|
|
8207
|
+
await invokeLazyLoad(parent2);
|
|
8208
|
+
const node = (_a = parent2 == null ? void 0 : parent2.children) == null ? void 0 : _a.find(
|
|
8209
|
+
(item) => item.value === value2
|
|
8210
|
+
);
|
|
8211
|
+
if (node) {
|
|
8212
|
+
needToSync.push(value2);
|
|
8213
|
+
}
|
|
8214
|
+
return Promise.resolve(node);
|
|
8215
|
+
}, Promise.resolve(parent));
|
|
8216
|
+
await invokeLazyLoad(last);
|
|
8217
|
+
state.initLoading = false;
|
|
8218
|
+
}
|
|
8219
|
+
}
|
|
8220
|
+
if (needToSync.length && currentValue2 === value) {
|
|
8221
|
+
const pathNodes = state.tree.getPathNodesByValue(needToSync);
|
|
8222
|
+
pathNodes.forEach((node, index2) => {
|
|
8223
|
+
state.tabsCursor = index2;
|
|
8224
|
+
chooseItem(node, true);
|
|
8225
|
+
});
|
|
8226
|
+
}
|
|
8227
|
+
};
|
|
8228
|
+
const invokeLazyLoad = async (node) => {
|
|
8229
|
+
if (!node) {
|
|
8230
|
+
return;
|
|
8231
|
+
}
|
|
8232
|
+
if (!state.configs.lazyLoad) {
|
|
8233
|
+
node.leaf = true;
|
|
8234
|
+
return;
|
|
8235
|
+
}
|
|
8236
|
+
if (state.tree.isLeaf(node, isLazy()) || state.tree.hasChildren(node, isLazy())) {
|
|
8237
|
+
return;
|
|
8238
|
+
}
|
|
8239
|
+
node.loading = true;
|
|
8240
|
+
const parent = node.root ? null : node;
|
|
8241
|
+
let lazyLoadPromise = state.lazyLoadMap.get(node);
|
|
8242
|
+
if (!lazyLoadPromise) {
|
|
8243
|
+
lazyLoadPromise = new Promise((resolve) => {
|
|
8244
|
+
var _a, _b;
|
|
8245
|
+
(_b = (_a = state.configs).lazyLoad) == null ? void 0 : _b.call(_a, node, resolve);
|
|
8246
|
+
});
|
|
8247
|
+
state.lazyLoadMap.set(node, lazyLoadPromise);
|
|
8248
|
+
}
|
|
8249
|
+
const nodes = await lazyLoadPromise;
|
|
8250
|
+
if (Array.isArray(nodes) && nodes.length > 0) {
|
|
8251
|
+
state.tree.updateChildren(nodes, parent);
|
|
8252
|
+
} else {
|
|
8253
|
+
node.leaf = true;
|
|
8254
|
+
}
|
|
8255
|
+
node.loading = false;
|
|
8256
|
+
state.lazyLoadMap.delete(node);
|
|
8257
|
+
};
|
|
8258
|
+
const close = () => {
|
|
8259
|
+
onClose && onClose();
|
|
8260
|
+
};
|
|
8261
|
+
const closePopup = () => {
|
|
8262
|
+
close();
|
|
8263
|
+
};
|
|
8264
|
+
const chooseItem = async (node, type) => {
|
|
8265
|
+
if (!type && node.disabled || !state.panes[state.tabsCursor]) {
|
|
8266
|
+
return;
|
|
8267
|
+
}
|
|
8268
|
+
if (state.tree.isLeaf(node, isLazy())) {
|
|
8269
|
+
node.leaf = true;
|
|
8270
|
+
state.panes[state.tabsCursor].selectedNode = node;
|
|
8271
|
+
state.panes = state.panes.slice(0, node.level + 1);
|
|
8272
|
+
if (!type) {
|
|
8273
|
+
const pathNodes = state.panes.map((item) => item.selectedNode);
|
|
8274
|
+
const optionParams = pathNodes.map((item) => item.value);
|
|
8275
|
+
onChange(optionParams, pathNodes);
|
|
8276
|
+
onPathChange(optionParams, pathNodes);
|
|
8277
|
+
}
|
|
8278
|
+
setOptiosData(state.panes);
|
|
8279
|
+
close();
|
|
8280
|
+
return;
|
|
8281
|
+
}
|
|
8282
|
+
if (state.tree.hasChildren(node, isLazy())) {
|
|
8283
|
+
const level = node.level + 1;
|
|
8284
|
+
state.panes[state.tabsCursor].selectedNode = node;
|
|
8285
|
+
state.panes = state.panes.slice(0, level);
|
|
8286
|
+
state.tabsCursor = level;
|
|
8287
|
+
state.panes.push({
|
|
8288
|
+
nodes: node.children || [],
|
|
8289
|
+
selectedNode: null,
|
|
8290
|
+
paneKey: `c${state.tabsCursor + 1}`
|
|
8291
|
+
});
|
|
8292
|
+
setTabvalue(`c${state.tabsCursor + 1}`);
|
|
8293
|
+
setOptiosData(state.panes);
|
|
8294
|
+
if (!type) {
|
|
8295
|
+
const pathNodes = state.panes.map((item) => item.selectedNode);
|
|
8296
|
+
const optionParams = pathNodes.map((item) => item == null ? void 0 : item.value);
|
|
8297
|
+
onPathChange(optionParams, pathNodes);
|
|
8298
|
+
}
|
|
8299
|
+
return;
|
|
8300
|
+
}
|
|
8301
|
+
state.currentProcessNode = node;
|
|
8302
|
+
if (node.loading) {
|
|
8303
|
+
return;
|
|
8304
|
+
}
|
|
8305
|
+
await invokeLazyLoad(node);
|
|
8306
|
+
if (state.currentProcessNode === node) {
|
|
8307
|
+
state.panes[state.tabsCursor].selectedNode = node;
|
|
8308
|
+
chooseItem(node, type);
|
|
8309
|
+
}
|
|
8310
|
+
setOptiosData(state.panes);
|
|
8311
|
+
};
|
|
8312
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8313
|
+
className: `${classes} ${className}`,
|
|
8314
|
+
style
|
|
8315
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
8316
|
+
popClass: "cascadar-popup",
|
|
8317
|
+
visible,
|
|
8318
|
+
position: "bottom",
|
|
8319
|
+
round: true,
|
|
8320
|
+
closeable,
|
|
8321
|
+
closeIconPosition,
|
|
8322
|
+
closeIcon,
|
|
8323
|
+
onClickOverlay: closePopup,
|
|
8324
|
+
onClickCloseIcon: closePopup
|
|
8325
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8326
|
+
className: b2("title")
|
|
8327
|
+
}, title), /* @__PURE__ */ React__default["default"].createElement(Tabs, {
|
|
8328
|
+
value: tabvalue,
|
|
8329
|
+
titleNode: () => {
|
|
8330
|
+
return optiosData.map((pane, index2) => {
|
|
8331
|
+
var _a, _b;
|
|
8332
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8333
|
+
onClick: () => {
|
|
8334
|
+
setTabvalue(pane.paneKey);
|
|
8335
|
+
state.tabsCursor = index2;
|
|
8336
|
+
},
|
|
8337
|
+
className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "active" : ""}`,
|
|
8338
|
+
key: pane.paneKey
|
|
8339
|
+
}, /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
8340
|
+
className: "nut-tabs__titles-item__text"
|
|
8341
|
+
}, !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["default"].createElement("span", {
|
|
8342
|
+
className: "nut-tabs__titles-item__line"
|
|
8343
|
+
}));
|
|
8344
|
+
});
|
|
8345
|
+
}
|
|
8346
|
+
}, !state.initLoading && state.panes.length ? optiosData.map((pane) => /* @__PURE__ */ React__default["default"].createElement(TabPane, {
|
|
8347
|
+
key: pane.paneKey,
|
|
8348
|
+
paneKey: pane.paneKey
|
|
8349
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8350
|
+
className: classesPane
|
|
8351
|
+
}, pane.nodes && pane.nodes.map((node, index2) => {
|
|
8352
|
+
var _a;
|
|
8353
|
+
return /* @__PURE__ */ React__default["default"].createElement(CascaderItem, {
|
|
8354
|
+
key: index2,
|
|
8355
|
+
...props,
|
|
8356
|
+
data: node,
|
|
8357
|
+
checked: ((_a = pane.selectedNode) == null ? void 0 : _a.value) === node.value,
|
|
8358
|
+
chooseItem: (node2) => chooseItem(node2, false)
|
|
8359
|
+
});
|
|
8360
|
+
})))) : /* @__PURE__ */ React__default["default"].createElement(TabPane, null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8361
|
+
className: classesPane
|
|
8362
|
+
})))));
|
|
8363
|
+
};
|
|
8364
|
+
const Cascader = React__default["default"].forwardRef(InternalCascader);
|
|
8365
|
+
Cascader.defaultProps = defaultProps$H;
|
|
8366
|
+
Cascader.displayName = "NutCascader";
|
|
8367
|
+
const defaultProps$G = {
|
|
7166
8368
|
placeholder: "",
|
|
7167
8369
|
shape: "square",
|
|
7168
8370
|
disabled: false,
|
|
@@ -7209,7 +8411,7 @@
|
|
|
7209
8411
|
onClickRightinIcon,
|
|
7210
8412
|
onClickRightoutIcon
|
|
7211
8413
|
} = {
|
|
7212
|
-
...defaultProps$
|
|
8414
|
+
...defaultProps$G,
|
|
7213
8415
|
...props
|
|
7214
8416
|
};
|
|
7215
8417
|
const alignClass = `${align}`;
|
|
@@ -7346,9 +8548,9 @@
|
|
|
7346
8548
|
className: `${searchbarBem("content")}`
|
|
7347
8549
|
}, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
|
|
7348
8550
|
};
|
|
7349
|
-
SearchBar.defaultProps = defaultProps$
|
|
8551
|
+
SearchBar.defaultProps = defaultProps$G;
|
|
7350
8552
|
SearchBar.displayName = "NutSearchBar";
|
|
7351
|
-
const defaultProps$
|
|
8553
|
+
const defaultProps$F = {
|
|
7352
8554
|
confirmText: "",
|
|
7353
8555
|
title: "",
|
|
7354
8556
|
visible: false,
|
|
@@ -7546,9 +8748,9 @@
|
|
|
7546
8748
|
})
|
|
7547
8749
|
}, confirmText || locale.done))) : null))));
|
|
7548
8750
|
};
|
|
7549
|
-
NumberKeyboard.defaultProps = defaultProps$
|
|
8751
|
+
NumberKeyboard.defaultProps = defaultProps$F;
|
|
7550
8752
|
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
7551
|
-
const defaultProps$
|
|
8753
|
+
const defaultProps$E = {
|
|
7552
8754
|
cancelTxt: "",
|
|
7553
8755
|
optionTag: "name",
|
|
7554
8756
|
optionSubTag: "subname",
|
|
@@ -7581,7 +8783,7 @@
|
|
|
7581
8783
|
className,
|
|
7582
8784
|
style,
|
|
7583
8785
|
...rest
|
|
7584
|
-
} = { ...defaultProps$
|
|
8786
|
+
} = { ...defaultProps$E, ...props };
|
|
7585
8787
|
const b2 = cn("actionsheet");
|
|
7586
8788
|
const isHighlight = (item) => {
|
|
7587
8789
|
return props.chooseTagValue && props.chooseTagValue === item[props.optionTag || "name"] ? props.color : "#1a1a1a";
|
|
@@ -7625,9 +8827,9 @@
|
|
|
7625
8827
|
onClick: () => cancelActionSheet()
|
|
7626
8828
|
}, cancelTxt)));
|
|
7627
8829
|
};
|
|
7628
|
-
ActionSheet.defaultProps = defaultProps$
|
|
8830
|
+
ActionSheet.defaultProps = defaultProps$E;
|
|
7629
8831
|
ActionSheet.displayName = "NutActionSheet";
|
|
7630
|
-
const defaultProps$
|
|
8832
|
+
const defaultProps$D = {
|
|
7631
8833
|
bottom: 20,
|
|
7632
8834
|
right: 10,
|
|
7633
8835
|
elId: "body",
|
|
@@ -7650,7 +8852,7 @@
|
|
|
7650
8852
|
style,
|
|
7651
8853
|
onClick
|
|
7652
8854
|
} = {
|
|
7653
|
-
...defaultProps$
|
|
8855
|
+
...defaultProps$D,
|
|
7654
8856
|
...props
|
|
7655
8857
|
};
|
|
7656
8858
|
const [backTop, SetBackTop] = React.useState(false);
|
|
@@ -7739,7 +8941,7 @@
|
|
|
7739
8941
|
name: "top"
|
|
7740
8942
|
}));
|
|
7741
8943
|
};
|
|
7742
|
-
BackTop.defaultProps = defaultProps$
|
|
8944
|
+
BackTop.defaultProps = defaultProps$D;
|
|
7743
8945
|
BackTop.displayName = "NutBackTop";
|
|
7744
8946
|
function clamp(v2, min, max) {
|
|
7745
8947
|
return Math.max(min, Math.min(v2, max));
|
|
@@ -12143,7 +13345,7 @@
|
|
|
12143
13345
|
}
|
|
12144
13346
|
});
|
|
12145
13347
|
const animated = host.animated;
|
|
12146
|
-
const defaultProps$
|
|
13348
|
+
const defaultProps$C = {
|
|
12147
13349
|
attract: false,
|
|
12148
13350
|
direction: void 0,
|
|
12149
13351
|
boundary: {
|
|
@@ -12156,7 +13358,7 @@
|
|
|
12156
13358
|
};
|
|
12157
13359
|
const Drag = (props) => {
|
|
12158
13360
|
const { attract, direction, boundary, children, className, style, ...reset } = {
|
|
12159
|
-
...defaultProps$
|
|
13361
|
+
...defaultProps$C,
|
|
12160
13362
|
...props
|
|
12161
13363
|
};
|
|
12162
13364
|
const b2 = cn("drag");
|
|
@@ -12218,7 +13420,7 @@
|
|
|
12218
13420
|
...bind()
|
|
12219
13421
|
}, children));
|
|
12220
13422
|
};
|
|
12221
|
-
Drag.defaultProps = defaultProps$
|
|
13423
|
+
Drag.defaultProps = defaultProps$C;
|
|
12222
13424
|
Drag.displayName = "NutDrag";
|
|
12223
13425
|
const Content = (props) => {
|
|
12224
13426
|
const {
|
|
@@ -12339,13 +13541,13 @@
|
|
|
12339
13541
|
function confirm(config2, renderFunc) {
|
|
12340
13542
|
const div = document.createElement("div");
|
|
12341
13543
|
document.body.appendChild(div);
|
|
12342
|
-
function
|
|
13544
|
+
function render2(props) {
|
|
12343
13545
|
ReactDOM__default["default"].render(/* @__PURE__ */ React__default["default"].createElement(ConfirmDialog, {
|
|
12344
13546
|
...props,
|
|
12345
13547
|
onCancel
|
|
12346
13548
|
}), div);
|
|
12347
13549
|
}
|
|
12348
|
-
const renderFunction = renderFunc ||
|
|
13550
|
+
const renderFunction = renderFunc || render2;
|
|
12349
13551
|
let dialogConfig = {
|
|
12350
13552
|
...config2,
|
|
12351
13553
|
visible: false
|
|
@@ -12413,9 +13615,9 @@
|
|
|
12413
13615
|
update: update2
|
|
12414
13616
|
};
|
|
12415
13617
|
}
|
|
12416
|
-
const defaultProps$
|
|
12417
|
-
okText: "",
|
|
12418
|
-
cancelText: "",
|
|
13618
|
+
const defaultProps$B = {
|
|
13619
|
+
okText: "\u786E\u8BA4",
|
|
13620
|
+
cancelText: "\u53D6\u6D88",
|
|
12419
13621
|
mask: true,
|
|
12420
13622
|
closeOnClickOverlay: true,
|
|
12421
13623
|
noFooter: false,
|
|
@@ -12428,10 +13630,10 @@
|
|
|
12428
13630
|
lockScroll: false
|
|
12429
13631
|
};
|
|
12430
13632
|
const BaseDialog = (props, ref) => {
|
|
12431
|
-
const { locale } = useConfig();
|
|
12432
13633
|
const {
|
|
12433
13634
|
visible,
|
|
12434
13635
|
footer,
|
|
13636
|
+
noFooter,
|
|
12435
13637
|
noOkBtn,
|
|
12436
13638
|
noCancelBtn,
|
|
12437
13639
|
lockScroll,
|
|
@@ -12445,9 +13647,9 @@
|
|
|
12445
13647
|
...restProps
|
|
12446
13648
|
} = props;
|
|
12447
13649
|
const renderFooter = function() {
|
|
12448
|
-
if (footer === null)
|
|
13650
|
+
if (footer === null || noFooter)
|
|
12449
13651
|
return "";
|
|
12450
|
-
const handleCancel =
|
|
13652
|
+
const handleCancel = (e2) => {
|
|
12451
13653
|
e2.stopPropagation();
|
|
12452
13654
|
if (!cancelAutoClose)
|
|
12453
13655
|
return;
|
|
@@ -12457,7 +13659,7 @@
|
|
|
12457
13659
|
document.body.classList.remove("nut-overflow-hidden");
|
|
12458
13660
|
}
|
|
12459
13661
|
};
|
|
12460
|
-
const handleOk =
|
|
13662
|
+
const handleOk = (e2) => {
|
|
12461
13663
|
e2.stopPropagation();
|
|
12462
13664
|
onClosed == null ? void 0 : onClosed();
|
|
12463
13665
|
onOk == null ? void 0 : onOk(e2);
|
|
@@ -12470,16 +13672,16 @@
|
|
|
12470
13672
|
plain: true,
|
|
12471
13673
|
type: "primary",
|
|
12472
13674
|
className: "nut-dialog__footer-cancel",
|
|
12473
|
-
onClick:
|
|
12474
|
-
}, cancelText
|
|
13675
|
+
onClick: handleCancel
|
|
13676
|
+
}, cancelText), !noOkBtn && /* @__PURE__ */ React__default["default"].createElement(Button, {
|
|
12475
13677
|
size: "small",
|
|
12476
13678
|
type: "primary",
|
|
12477
13679
|
className: classNames("nut-dialog__footer-ok", {
|
|
12478
13680
|
disabled: okBtnDisabled
|
|
12479
13681
|
}),
|
|
12480
13682
|
disabled: okBtnDisabled,
|
|
12481
|
-
onClick:
|
|
12482
|
-
}, okText
|
|
13683
|
+
onClick: handleOk
|
|
13684
|
+
}, okText));
|
|
12483
13685
|
return footerContent;
|
|
12484
13686
|
};
|
|
12485
13687
|
return /* @__PURE__ */ React__default["default"].createElement(DialogWrapper, {
|
|
@@ -12504,9 +13706,9 @@
|
|
|
12504
13706
|
});
|
|
12505
13707
|
};
|
|
12506
13708
|
});
|
|
12507
|
-
Dialog.defaultProps = defaultProps$
|
|
13709
|
+
Dialog.defaultProps = defaultProps$B;
|
|
12508
13710
|
Dialog.displayName = "NutDialog";
|
|
12509
|
-
const defaultProps$
|
|
13711
|
+
const defaultProps$A = {
|
|
12510
13712
|
hasMore: true,
|
|
12511
13713
|
threshold: 200,
|
|
12512
13714
|
containerId: "",
|
|
@@ -12540,7 +13742,7 @@
|
|
|
12540
13742
|
scrollChange,
|
|
12541
13743
|
...restProps
|
|
12542
13744
|
} = {
|
|
12543
|
-
...defaultProps$
|
|
13745
|
+
...defaultProps$A,
|
|
12544
13746
|
...props
|
|
12545
13747
|
};
|
|
12546
13748
|
const [isInfiniting, setIsInfiniting] = React.useState(false);
|
|
@@ -12700,7 +13902,7 @@
|
|
|
12700
13902
|
className: "tips"
|
|
12701
13903
|
}, loadMoreTxt || locale.infiniteloading.loadMoreText)));
|
|
12702
13904
|
};
|
|
12703
|
-
Infiniteloading.defaultProps = defaultProps$
|
|
13905
|
+
Infiniteloading.defaultProps = defaultProps$A;
|
|
12704
13906
|
Infiniteloading.displayName = "NutInfiniteloading";
|
|
12705
13907
|
class Notification extends React__namespace.PureComponent {
|
|
12706
13908
|
constructor(props) {
|
|
@@ -12807,7 +14009,7 @@
|
|
|
12807
14009
|
}
|
|
12808
14010
|
});
|
|
12809
14011
|
}
|
|
12810
|
-
|
|
14012
|
+
render(/* @__PURE__ */ React__namespace.createElement(Notification, {
|
|
12811
14013
|
...properties,
|
|
12812
14014
|
ref
|
|
12813
14015
|
}), element);
|
|
@@ -12875,7 +14077,7 @@
|
|
|
12875
14077
|
}
|
|
12876
14078
|
}
|
|
12877
14079
|
};
|
|
12878
|
-
const defaultProps$
|
|
14080
|
+
const defaultProps$z = {
|
|
12879
14081
|
isAsync: false,
|
|
12880
14082
|
checked: false,
|
|
12881
14083
|
disable: false,
|
|
@@ -12898,7 +14100,7 @@
|
|
|
12898
14100
|
className,
|
|
12899
14101
|
style
|
|
12900
14102
|
} = {
|
|
12901
|
-
...defaultProps$
|
|
14103
|
+
...defaultProps$z,
|
|
12902
14104
|
...props
|
|
12903
14105
|
};
|
|
12904
14106
|
const [value, setValue] = React.useState(false);
|
|
@@ -12909,39 +14111,223 @@
|
|
|
12909
14111
|
const classes = () => {
|
|
12910
14112
|
return `${b2()} ${value ? "switch-open" : "switch-close"} ${disable ? `${b2()}-disable` : ""} ${`${b2()}-base`} ${className}`;
|
|
12911
14113
|
};
|
|
12912
|
-
const styles = () => {
|
|
12913
|
-
const myStyle = {
|
|
12914
|
-
backgroundColor: value ? activeColor : inactiveColor,
|
|
12915
|
-
...style || {}
|
|
12916
|
-
};
|
|
12917
|
-
return myStyle;
|
|
14114
|
+
const styles = () => {
|
|
14115
|
+
const myStyle = {
|
|
14116
|
+
backgroundColor: value ? activeColor : inactiveColor,
|
|
14117
|
+
...style || {}
|
|
14118
|
+
};
|
|
14119
|
+
return myStyle;
|
|
14120
|
+
};
|
|
14121
|
+
const onClick = (event) => {
|
|
14122
|
+
if (disable)
|
|
14123
|
+
return;
|
|
14124
|
+
if (!isAsync) {
|
|
14125
|
+
setValue(!value);
|
|
14126
|
+
}
|
|
14127
|
+
change && change(!value, event);
|
|
14128
|
+
};
|
|
14129
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14130
|
+
className: classes(),
|
|
14131
|
+
onClick: (e2) => onClick(e2),
|
|
14132
|
+
style: styles()
|
|
14133
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14134
|
+
className: "switch-button"
|
|
14135
|
+
}, !value && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14136
|
+
className: "close-line"
|
|
14137
|
+
}), activeText && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, value ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14138
|
+
className: `${b2("label")} open`
|
|
14139
|
+
}, activeText) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14140
|
+
className: `${b2("label")} close`
|
|
14141
|
+
}, inactiveText))));
|
|
14142
|
+
};
|
|
14143
|
+
Switch.defaultProps = defaultProps$z;
|
|
14144
|
+
Switch.displayName = "NutSwitch";
|
|
14145
|
+
function preventDefault(event, isStopPropagation) {
|
|
14146
|
+
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
14147
|
+
event.preventDefault();
|
|
14148
|
+
}
|
|
14149
|
+
if (isStopPropagation) {
|
|
14150
|
+
event.stopPropagation();
|
|
14151
|
+
}
|
|
14152
|
+
}
|
|
14153
|
+
const defaultProps$y = {
|
|
14154
|
+
name: "",
|
|
14155
|
+
leftWidth: 0,
|
|
14156
|
+
rightWidth: 0
|
|
14157
|
+
};
|
|
14158
|
+
const Swipe = React.forwardRef((props, instanceRef) => {
|
|
14159
|
+
const swipeBem = cn("swipe");
|
|
14160
|
+
const touch = useTouch();
|
|
14161
|
+
const { children, className, style } = { ...defaultProps$y, ...props };
|
|
14162
|
+
const root = React.useRef();
|
|
14163
|
+
const opened = React.useRef(false);
|
|
14164
|
+
const lockClick = React.useRef(false);
|
|
14165
|
+
const startOffset = React.useRef(0);
|
|
14166
|
+
const [state, setState] = React.useState({
|
|
14167
|
+
offset: 0,
|
|
14168
|
+
dragging: false
|
|
14169
|
+
});
|
|
14170
|
+
const [actionWidth, setActionWidth] = React.useState({
|
|
14171
|
+
left: 0,
|
|
14172
|
+
right: 0
|
|
14173
|
+
});
|
|
14174
|
+
const wrapperStyle = {
|
|
14175
|
+
transform: `translate3d(${state.offset}px, 0, 0)`,
|
|
14176
|
+
transitionDuration: state.dragging ? "0s" : ".6s"
|
|
14177
|
+
};
|
|
14178
|
+
const leftWidth = React.useMemo(
|
|
14179
|
+
() => props.leftWidth ? props.leftWidth : actionWidth.left,
|
|
14180
|
+
[props.leftWidth, actionWidth.left]
|
|
14181
|
+
);
|
|
14182
|
+
const rightWidth = React.useMemo(
|
|
14183
|
+
() => props.rightWidth ? props.rightWidth : actionWidth.right,
|
|
14184
|
+
[props.rightWidth, actionWidth.right]
|
|
14185
|
+
);
|
|
14186
|
+
const onTouchStart = (event) => {
|
|
14187
|
+
if (!props.disabled) {
|
|
14188
|
+
startOffset.current = state.offset;
|
|
14189
|
+
touch.start(event);
|
|
14190
|
+
}
|
|
14191
|
+
};
|
|
14192
|
+
const onTouchMove = (event) => {
|
|
14193
|
+
if (props.disabled) {
|
|
14194
|
+
return;
|
|
14195
|
+
}
|
|
14196
|
+
touch.move(event);
|
|
14197
|
+
if (touch.isHorizontal()) {
|
|
14198
|
+
lockClick.current = true;
|
|
14199
|
+
const newState = { ...state, dragging: true };
|
|
14200
|
+
const isEdge = !opened || touch.deltaX * startOffset.current < 0;
|
|
14201
|
+
if (isEdge) {
|
|
14202
|
+
preventDefault(event, true);
|
|
14203
|
+
}
|
|
14204
|
+
newState.offset = rangeCalculation(
|
|
14205
|
+
touch.deltaX + startOffset.current,
|
|
14206
|
+
-rightWidth,
|
|
14207
|
+
leftWidth
|
|
14208
|
+
);
|
|
14209
|
+
setState(newState);
|
|
14210
|
+
}
|
|
14211
|
+
};
|
|
14212
|
+
const onTouchEnd = () => {
|
|
14213
|
+
if (state.dragging) {
|
|
14214
|
+
setState((v2) => ({ ...v2, dragging: false }));
|
|
14215
|
+
toggle(state.offset > 0 ? "left" : "right");
|
|
14216
|
+
setTimeout(() => {
|
|
14217
|
+
lockClick.current = false;
|
|
14218
|
+
}, 0);
|
|
14219
|
+
}
|
|
14220
|
+
};
|
|
14221
|
+
const toggle = (side) => {
|
|
14222
|
+
const offset = Math.abs(state.offset);
|
|
14223
|
+
const base = 0.3;
|
|
14224
|
+
const baseNum = opened ? 1 - base : base;
|
|
14225
|
+
const width = side === "left" ? leftWidth : rightWidth;
|
|
14226
|
+
if (width && offset > Number(width) * baseNum) {
|
|
14227
|
+
open(side);
|
|
14228
|
+
} else {
|
|
14229
|
+
close(side);
|
|
14230
|
+
}
|
|
14231
|
+
};
|
|
14232
|
+
const open = (side) => {
|
|
14233
|
+
var _a;
|
|
14234
|
+
opened.current = true;
|
|
14235
|
+
const offset = side === "left" ? leftWidth : -rightWidth;
|
|
14236
|
+
const name = props.name;
|
|
14237
|
+
(_a = props.onOpen) == null ? void 0 : _a.call(props, { name, position: side });
|
|
14238
|
+
setState((v2) => ({ ...v2, offset: Number(offset) || 0 }));
|
|
14239
|
+
};
|
|
14240
|
+
const close = (position) => {
|
|
14241
|
+
var _a;
|
|
14242
|
+
if (opened.current) {
|
|
14243
|
+
opened.current = false;
|
|
14244
|
+
(_a = props.onClose) == null ? void 0 : _a.call(props, {
|
|
14245
|
+
name: props.name,
|
|
14246
|
+
position: position || "left"
|
|
14247
|
+
});
|
|
14248
|
+
}
|
|
14249
|
+
setState((v2) => ({ ...v2, offset: 0 }));
|
|
14250
|
+
};
|
|
14251
|
+
const rangeCalculation = (num, min, max) => {
|
|
14252
|
+
return Math.min(Math.max(Number(num), Number(min)), Number(max));
|
|
12918
14253
|
};
|
|
12919
|
-
const
|
|
12920
|
-
if (
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
14254
|
+
const getNodeWidth = (node) => {
|
|
14255
|
+
if (node) {
|
|
14256
|
+
const ele = getRect(node);
|
|
14257
|
+
return ele.width;
|
|
14258
|
+
}
|
|
14259
|
+
return 0;
|
|
14260
|
+
};
|
|
14261
|
+
const leftRef = React.useCallback(
|
|
14262
|
+
(node) => {
|
|
14263
|
+
if (node !== null) {
|
|
14264
|
+
setActionWidth((v2) => ({ ...v2, left: getNodeWidth(node) }));
|
|
14265
|
+
}
|
|
14266
|
+
},
|
|
14267
|
+
[props.leftAction]
|
|
14268
|
+
);
|
|
14269
|
+
const rightRef = React.useCallback(
|
|
14270
|
+
(node) => {
|
|
14271
|
+
if (node !== null) {
|
|
14272
|
+
setActionWidth((v2) => ({ ...v2, right: getNodeWidth(node) }));
|
|
14273
|
+
}
|
|
14274
|
+
},
|
|
14275
|
+
[props.rightAction]
|
|
14276
|
+
);
|
|
14277
|
+
const renderActionContent = (side, measuredRef) => {
|
|
14278
|
+
if (props[`${side}Action`]) {
|
|
14279
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14280
|
+
ref: measuredRef,
|
|
14281
|
+
className: `${swipeBem(side)}`,
|
|
14282
|
+
onClick: (e2) => handleOperate(e2, side)
|
|
14283
|
+
}, props[`${side}Action`]);
|
|
14284
|
+
}
|
|
14285
|
+
return null;
|
|
14286
|
+
};
|
|
14287
|
+
const handleOperate = (event, position) => {
|
|
14288
|
+
event.stopPropagation();
|
|
14289
|
+
if (props.beforeClose) {
|
|
14290
|
+
props.beforeClose(position);
|
|
14291
|
+
} else {
|
|
14292
|
+
props.onActionClick && props.onActionClick(event, position);
|
|
12924
14293
|
}
|
|
12925
|
-
change && change(!value, event);
|
|
12926
14294
|
};
|
|
14295
|
+
React.useImperativeHandle(instanceRef, () => ({
|
|
14296
|
+
open,
|
|
14297
|
+
close: () => close()
|
|
14298
|
+
}));
|
|
14299
|
+
React.useEffect(() => {
|
|
14300
|
+
const handler = (event) => {
|
|
14301
|
+
const targets = [root];
|
|
14302
|
+
if (targets.some((targetItem) => {
|
|
14303
|
+
const targetElement = targetItem.current || targetItem;
|
|
14304
|
+
return !targetElement || (targetElement == null ? void 0 : targetElement.contains(event.target));
|
|
14305
|
+
})) {
|
|
14306
|
+
return;
|
|
14307
|
+
}
|
|
14308
|
+
close();
|
|
14309
|
+
};
|
|
14310
|
+
document.addEventListener("touchstart", handler);
|
|
14311
|
+
return () => {
|
|
14312
|
+
document.removeEventListener("touchstart", handler);
|
|
14313
|
+
};
|
|
14314
|
+
}, []);
|
|
12927
14315
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
14316
|
+
ref: root,
|
|
14317
|
+
className: `${swipeBem()} ${className}`,
|
|
14318
|
+
onTouchStart: (e2) => onTouchStart(e2),
|
|
14319
|
+
onTouchMove: (e2) => onTouchMove(e2),
|
|
14320
|
+
onTouchEnd,
|
|
14321
|
+
style
|
|
12931
14322
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
12932
|
-
className: "
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
className: `${b2("label")} close`
|
|
12939
|
-
}, inactiveText))));
|
|
12940
|
-
};
|
|
12941
|
-
Switch.defaultProps = defaultProps$w;
|
|
12942
|
-
Switch.displayName = "NutSwitch";
|
|
14323
|
+
className: `${swipeBem("wrapper")}`,
|
|
14324
|
+
style: wrapperStyle
|
|
14325
|
+
}, renderActionContent("left", leftRef), children, renderActionContent("right", rightRef)));
|
|
14326
|
+
});
|
|
14327
|
+
Swipe.defaultProps = defaultProps$y;
|
|
14328
|
+
Swipe.displayName = "NutSwipe";
|
|
12943
14329
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
12944
|
-
const defaultProps$
|
|
14330
|
+
const defaultProps$x = {
|
|
12945
14331
|
strokeWidth: 5,
|
|
12946
14332
|
radius: 50,
|
|
12947
14333
|
strokeLinecap: "round",
|
|
@@ -12964,7 +14350,7 @@
|
|
|
12964
14350
|
strokeLinecap,
|
|
12965
14351
|
...restProps
|
|
12966
14352
|
} = {
|
|
12967
|
-
...defaultProps$
|
|
14353
|
+
...defaultProps$x,
|
|
12968
14354
|
...props
|
|
12969
14355
|
};
|
|
12970
14356
|
const b2 = cn("circleprogress");
|
|
@@ -13050,9 +14436,9 @@
|
|
|
13050
14436
|
className: "nut-circleprogress-text"
|
|
13051
14437
|
}, children || /* @__PURE__ */ React__default["default"].createElement("div", null, progress, "%")));
|
|
13052
14438
|
};
|
|
13053
|
-
CircleProgress.defaultProps = defaultProps$
|
|
14439
|
+
CircleProgress.defaultProps = defaultProps$x;
|
|
13054
14440
|
CircleProgress.displayName = "NutCircleProgress";
|
|
13055
|
-
const defaultProps$
|
|
14441
|
+
const defaultProps$w = {
|
|
13056
14442
|
direction: "across",
|
|
13057
14443
|
list: [],
|
|
13058
14444
|
standTime: 1e3,
|
|
@@ -13090,7 +14476,7 @@
|
|
|
13090
14476
|
rightIcon,
|
|
13091
14477
|
close,
|
|
13092
14478
|
click
|
|
13093
|
-
} = { ...defaultProps$
|
|
14479
|
+
} = { ...defaultProps$w, ...props };
|
|
13094
14480
|
const wrap = React.useRef(null);
|
|
13095
14481
|
const content = React.useRef(null);
|
|
13096
14482
|
const [showNoticeBar, SetShowNoticeBar] = React.useState(true);
|
|
@@ -13155,8 +14541,8 @@
|
|
|
13155
14541
|
if (!wrap.current || !content.current) {
|
|
13156
14542
|
return;
|
|
13157
14543
|
}
|
|
13158
|
-
const wrapW = wrap.current
|
|
13159
|
-
const offsetW = content.current
|
|
14544
|
+
const wrapW = getRect(wrap.current).width;
|
|
14545
|
+
const offsetW = getRect(content.current).width;
|
|
13160
14546
|
const canScroll = scrollable == null ? offsetW > wrapW : scrollable;
|
|
13161
14547
|
SetIsCanScroll(canScroll);
|
|
13162
14548
|
if (canScroll) {
|
|
@@ -13330,16 +14716,16 @@
|
|
|
13330
14716
|
size: "11px"
|
|
13331
14717
|
}) : null))) : null);
|
|
13332
14718
|
};
|
|
13333
|
-
NoticeBar.defaultProps = defaultProps$
|
|
14719
|
+
NoticeBar.defaultProps = defaultProps$w;
|
|
13334
14720
|
NoticeBar.displayName = "NutNoticeBar";
|
|
13335
14721
|
const DataContext$1 = React.createContext({});
|
|
13336
|
-
const defaultProps$
|
|
14722
|
+
const defaultProps$v = {
|
|
13337
14723
|
current: 0,
|
|
13338
14724
|
direction: "horizontal",
|
|
13339
14725
|
progressDot: false
|
|
13340
14726
|
};
|
|
13341
14727
|
const Steps = (props) => {
|
|
13342
|
-
const propSteps = { ...defaultProps$
|
|
14728
|
+
const propSteps = { ...defaultProps$v, ...props };
|
|
13343
14729
|
const {
|
|
13344
14730
|
children,
|
|
13345
14731
|
current,
|
|
@@ -13372,9 +14758,9 @@
|
|
|
13372
14758
|
children
|
|
13373
14759
|
));
|
|
13374
14760
|
};
|
|
13375
|
-
Steps.defaultProps = defaultProps$
|
|
14761
|
+
Steps.defaultProps = defaultProps$v;
|
|
13376
14762
|
Steps.displayName = "NutSteps";
|
|
13377
|
-
const defaultProps$
|
|
14763
|
+
const defaultProps$u = {
|
|
13378
14764
|
title: "",
|
|
13379
14765
|
content: "",
|
|
13380
14766
|
activeIndex: 0,
|
|
@@ -13395,7 +14781,7 @@
|
|
|
13395
14781
|
renderContent,
|
|
13396
14782
|
...restProps
|
|
13397
14783
|
} = {
|
|
13398
|
-
...defaultProps$
|
|
14784
|
+
...defaultProps$u,
|
|
13399
14785
|
...props
|
|
13400
14786
|
};
|
|
13401
14787
|
const parent = React.useContext(DataContext$1);
|
|
@@ -13456,10 +14842,10 @@
|
|
|
13456
14842
|
className: "nut-step-content"
|
|
13457
14843
|
}, renderContent())));
|
|
13458
14844
|
};
|
|
13459
|
-
Step.defaultProps = defaultProps$
|
|
14845
|
+
Step.defaultProps = defaultProps$u;
|
|
13460
14846
|
Step.displayName = "NutStep";
|
|
13461
14847
|
const DataContext = React.createContext({});
|
|
13462
|
-
const defaultProps$
|
|
14848
|
+
const defaultProps$t = {
|
|
13463
14849
|
width: typeof window === "object" ? window.innerWidth : 375,
|
|
13464
14850
|
height: 0,
|
|
13465
14851
|
duration: 500,
|
|
@@ -13477,7 +14863,7 @@
|
|
|
13477
14863
|
};
|
|
13478
14864
|
const DISTANCE = 5;
|
|
13479
14865
|
const Swiper = React__default["default"].forwardRef((props, ref) => {
|
|
13480
|
-
const propSwiper = { ...defaultProps$
|
|
14866
|
+
const propSwiper = { ...defaultProps$t, ...props };
|
|
13481
14867
|
const {
|
|
13482
14868
|
children,
|
|
13483
14869
|
direction,
|
|
@@ -13781,7 +15167,7 @@
|
|
|
13781
15167
|
_swiper.current.activePagination = (active + childCount) % childCount;
|
|
13782
15168
|
}, [active]);
|
|
13783
15169
|
const init = (active2 = +propSwiper.initPage) => {
|
|
13784
|
-
const rect2 = container.current
|
|
15170
|
+
const rect2 = getRect(container == null ? void 0 : container.current);
|
|
13785
15171
|
const _active = Math.max(Math.min(childCount - 1, active2), 0);
|
|
13786
15172
|
const _width = propSwiper.width ? +propSwiper.width : rect2.width;
|
|
13787
15173
|
const _height = propSwiper.height ? +propSwiper.height : rect2.height;
|
|
@@ -13887,13 +15273,13 @@
|
|
|
13887
15273
|
});
|
|
13888
15274
|
})) : /* @__PURE__ */ React__default["default"].createElement("div", null, pageContent)));
|
|
13889
15275
|
});
|
|
13890
|
-
Swiper.defaultProps = defaultProps$
|
|
15276
|
+
Swiper.defaultProps = defaultProps$t;
|
|
13891
15277
|
Swiper.displayName = "NutSwiper";
|
|
13892
|
-
const defaultProps$
|
|
15278
|
+
const defaultProps$s = {
|
|
13893
15279
|
direction: "horizontal"
|
|
13894
15280
|
};
|
|
13895
15281
|
const SwiperItem = React__default["default"].forwardRef((props, ref) => {
|
|
13896
|
-
const _props = { ...defaultProps$
|
|
15282
|
+
const _props = { ...defaultProps$s, ...props };
|
|
13897
15283
|
const { children, direction, size } = _props;
|
|
13898
15284
|
const parent = React.useContext(DataContext);
|
|
13899
15285
|
const b2 = cn("swiper-item");
|
|
@@ -13912,10 +15298,10 @@
|
|
|
13912
15298
|
style: style()
|
|
13913
15299
|
}, children);
|
|
13914
15300
|
});
|
|
13915
|
-
SwiperItem.defaultProps = defaultProps$
|
|
15301
|
+
SwiperItem.defaultProps = defaultProps$s;
|
|
13916
15302
|
SwiperItem.displayName = "NutSwiperItem";
|
|
13917
15303
|
const AvatarContext = React.createContext({});
|
|
13918
|
-
const defaultProps$
|
|
15304
|
+
const defaultProps$r = {
|
|
13919
15305
|
size: "",
|
|
13920
15306
|
icon: "",
|
|
13921
15307
|
bgColor: "#eee",
|
|
@@ -13942,7 +15328,7 @@
|
|
|
13942
15328
|
onError,
|
|
13943
15329
|
...rest
|
|
13944
15330
|
} = {
|
|
13945
|
-
...defaultProps$
|
|
15331
|
+
...defaultProps$r,
|
|
13946
15332
|
...props
|
|
13947
15333
|
};
|
|
13948
15334
|
const [maxSum, setMaxSum] = React.useState(0);
|
|
@@ -14023,9 +15409,9 @@
|
|
|
14023
15409
|
className: "text"
|
|
14024
15410
|
}, ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxCount)}`)));
|
|
14025
15411
|
};
|
|
14026
|
-
Avatar.defaultProps = defaultProps$
|
|
15412
|
+
Avatar.defaultProps = defaultProps$r;
|
|
14027
15413
|
Avatar.displayName = "NutAvatar";
|
|
14028
|
-
const defaultProps$
|
|
15414
|
+
const defaultProps$q = {
|
|
14029
15415
|
maxContent: "",
|
|
14030
15416
|
maxCount: "",
|
|
14031
15417
|
maxBgColor: "#eee",
|
|
@@ -14037,7 +15423,7 @@
|
|
|
14037
15423
|
};
|
|
14038
15424
|
const AvatarGroup = (props) => {
|
|
14039
15425
|
useConfig();
|
|
14040
|
-
const propAvatarGroup = { ...defaultProps$
|
|
15426
|
+
const propAvatarGroup = { ...defaultProps$q, ...props };
|
|
14041
15427
|
const { className, style, children } = propAvatarGroup;
|
|
14042
15428
|
const avatarGroupRef = React.useRef(null);
|
|
14043
15429
|
const b2 = cn("avatar-group");
|
|
@@ -14054,9 +15440,9 @@
|
|
|
14054
15440
|
ref: avatarGroupRef
|
|
14055
15441
|
}, children));
|
|
14056
15442
|
};
|
|
14057
|
-
AvatarGroup.defaultProps = defaultProps$
|
|
15443
|
+
AvatarGroup.defaultProps = defaultProps$q;
|
|
14058
15444
|
AvatarGroup.displayName = "NutAvatarGroup";
|
|
14059
|
-
const defaultProps$
|
|
15445
|
+
const defaultProps$p = {
|
|
14060
15446
|
price: 0,
|
|
14061
15447
|
needSymbol: true,
|
|
14062
15448
|
symbol: "¥",
|
|
@@ -14074,7 +15460,7 @@
|
|
|
14074
15460
|
className,
|
|
14075
15461
|
...rest
|
|
14076
15462
|
} = {
|
|
14077
|
-
...defaultProps$
|
|
15463
|
+
...defaultProps$p,
|
|
14078
15464
|
...props
|
|
14079
15465
|
};
|
|
14080
15466
|
const b2 = cn("price");
|
|
@@ -14137,9 +15523,9 @@
|
|
|
14137
15523
|
className: `${b2("small")}`
|
|
14138
15524
|
}, formatDecimal(price)));
|
|
14139
15525
|
};
|
|
14140
|
-
Price.defaultProps = defaultProps$
|
|
15526
|
+
Price.defaultProps = defaultProps$p;
|
|
14141
15527
|
Price.displayName = "NutPrice";
|
|
14142
|
-
const defaultProps$
|
|
15528
|
+
const defaultProps$o = {
|
|
14143
15529
|
value: "",
|
|
14144
15530
|
dot: false,
|
|
14145
15531
|
max: 1e4,
|
|
@@ -14151,7 +15537,7 @@
|
|
|
14151
15537
|
};
|
|
14152
15538
|
const Badge = (props) => {
|
|
14153
15539
|
const { children, dot, top, right, zIndex, color, icons } = {
|
|
14154
|
-
...defaultProps$
|
|
15540
|
+
...defaultProps$o,
|
|
14155
15541
|
...props
|
|
14156
15542
|
};
|
|
14157
15543
|
function content() {
|
|
@@ -14186,9 +15572,9 @@
|
|
|
14186
15572
|
style: getStyle()
|
|
14187
15573
|
}, content()));
|
|
14188
15574
|
};
|
|
14189
|
-
Badge.defaultProps = defaultProps$
|
|
15575
|
+
Badge.defaultProps = defaultProps$o;
|
|
14190
15576
|
Badge.displayName = "NutBadge";
|
|
14191
|
-
const defaultProps$
|
|
15577
|
+
const defaultProps$n = {
|
|
14192
15578
|
type: "default",
|
|
14193
15579
|
color: "",
|
|
14194
15580
|
textColor: "",
|
|
@@ -14216,7 +15602,7 @@
|
|
|
14216
15602
|
onClick,
|
|
14217
15603
|
onClose
|
|
14218
15604
|
} = {
|
|
14219
|
-
...defaultProps$
|
|
15605
|
+
...defaultProps$n,
|
|
14220
15606
|
...props
|
|
14221
15607
|
};
|
|
14222
15608
|
const [btnName, setBtnName] = React.useState("");
|
|
@@ -14288,7 +15674,7 @@
|
|
|
14288
15674
|
className: "text"
|
|
14289
15675
|
}, children)));
|
|
14290
15676
|
};
|
|
14291
|
-
Tag.defaultProps = defaultProps$
|
|
15677
|
+
Tag.defaultProps = defaultProps$n;
|
|
14292
15678
|
Tag.displayName = "NutTag";
|
|
14293
15679
|
function fillRef(ref, node) {
|
|
14294
15680
|
if (typeof ref === "function") {
|
|
@@ -14332,13 +15718,7 @@
|
|
|
14332
15718
|
return trigger;
|
|
14333
15719
|
}
|
|
14334
15720
|
}
|
|
14335
|
-
const
|
|
14336
|
-
if (ele && ele.getBoundingClientRect) {
|
|
14337
|
-
return ele.getBoundingClientRect();
|
|
14338
|
-
}
|
|
14339
|
-
return null;
|
|
14340
|
-
};
|
|
14341
|
-
const defaultProps$k = {
|
|
15721
|
+
const defaultProps$m = {
|
|
14342
15722
|
list: [],
|
|
14343
15723
|
theme: "light",
|
|
14344
15724
|
location: "bottom",
|
|
@@ -14364,14 +15744,14 @@
|
|
|
14364
15744
|
onChoose,
|
|
14365
15745
|
...reset
|
|
14366
15746
|
} = {
|
|
14367
|
-
...defaultProps$
|
|
15747
|
+
...defaultProps$m,
|
|
14368
15748
|
...props
|
|
14369
15749
|
};
|
|
14370
15750
|
const goodItem = React.useRef(null);
|
|
14371
15751
|
setTimeout(() => {
|
|
14372
|
-
if (goodItem.current &&
|
|
14373
|
-
setElWidth(
|
|
14374
|
-
setElHeight(
|
|
15752
|
+
if (goodItem.current && getRect(goodItem.current)) {
|
|
15753
|
+
setElWidth(getRect(goodItem.current).width);
|
|
15754
|
+
setElHeight(getRect(goodItem.current).height);
|
|
14375
15755
|
}
|
|
14376
15756
|
});
|
|
14377
15757
|
const [classes, setClasses] = React.useState("");
|
|
@@ -14456,9 +15836,9 @@
|
|
|
14456
15836
|
style: { background: "transparent" }
|
|
14457
15837
|
}) : "");
|
|
14458
15838
|
};
|
|
14459
|
-
Popover.defaultProps = defaultProps$
|
|
15839
|
+
Popover.defaultProps = defaultProps$m;
|
|
14460
15840
|
Popover.displayName = "NutPopover";
|
|
14461
|
-
const defaultProps$
|
|
15841
|
+
const defaultProps$l = {
|
|
14462
15842
|
width: "100px",
|
|
14463
15843
|
height: "100px",
|
|
14464
15844
|
row: 1,
|
|
@@ -14486,7 +15866,7 @@
|
|
|
14486
15866
|
avatarShape,
|
|
14487
15867
|
...restProps
|
|
14488
15868
|
} = {
|
|
14489
|
-
...defaultProps$
|
|
15869
|
+
...defaultProps$l,
|
|
14490
15870
|
...props
|
|
14491
15871
|
};
|
|
14492
15872
|
const b2 = cn("skeleton");
|
|
@@ -14541,9 +15921,9 @@
|
|
|
14541
15921
|
});
|
|
14542
15922
|
})))));
|
|
14543
15923
|
};
|
|
14544
|
-
Skeleton.defaultProps = defaultProps$
|
|
15924
|
+
Skeleton.defaultProps = defaultProps$l;
|
|
14545
15925
|
Skeleton.displayName = "NutSkeleton";
|
|
14546
|
-
const defaultProps$
|
|
15926
|
+
const defaultProps$k = {
|
|
14547
15927
|
showPlainText: false,
|
|
14548
15928
|
showDays: false,
|
|
14549
15929
|
paused: false,
|
|
@@ -14566,7 +15946,7 @@
|
|
|
14566
15946
|
onUpdate,
|
|
14567
15947
|
children,
|
|
14568
15948
|
...rest
|
|
14569
|
-
} = { ...defaultProps$
|
|
15949
|
+
} = { ...defaultProps$k, ...props };
|
|
14570
15950
|
const b2 = cn("countdown");
|
|
14571
15951
|
const [restTimeStamp, setRestTime] = React.useState(0);
|
|
14572
15952
|
const stateRef = React.useRef({
|
|
@@ -14713,9 +16093,9 @@
|
|
|
14713
16093
|
className: b2("block")
|
|
14714
16094
|
}, resttime.s))));
|
|
14715
16095
|
};
|
|
14716
|
-
CountDown.defaultProps = defaultProps$
|
|
16096
|
+
CountDown.defaultProps = defaultProps$k;
|
|
14717
16097
|
CountDown.displayName = "NutCountDown";
|
|
14718
|
-
const defaultProps$
|
|
16098
|
+
const defaultProps$j = {
|
|
14719
16099
|
activeName: ["0"],
|
|
14720
16100
|
accordion: false,
|
|
14721
16101
|
icon: "",
|
|
@@ -14738,7 +16118,7 @@
|
|
|
14738
16118
|
iconColor,
|
|
14739
16119
|
change
|
|
14740
16120
|
} = {
|
|
14741
|
-
...defaultProps$
|
|
16121
|
+
...defaultProps$j,
|
|
14742
16122
|
...props
|
|
14743
16123
|
};
|
|
14744
16124
|
const childrenDom = React__default["default"].Children.toArray(children);
|
|
@@ -14795,9 +16175,9 @@
|
|
|
14795
16175
|
},
|
|
14796
16176
|
areEqual
|
|
14797
16177
|
);
|
|
14798
|
-
Collapse.defaultProps = defaultProps$
|
|
16178
|
+
Collapse.defaultProps = defaultProps$j;
|
|
14799
16179
|
Collapse.displayName = "NutCollapse";
|
|
14800
|
-
const defaultProps$
|
|
16180
|
+
const defaultProps$i = {
|
|
14801
16181
|
title: "",
|
|
14802
16182
|
name: "",
|
|
14803
16183
|
isOpen: false,
|
|
@@ -14831,7 +16211,7 @@
|
|
|
14831
16211
|
iconColor,
|
|
14832
16212
|
...rest
|
|
14833
16213
|
} = {
|
|
14834
|
-
...defaultProps$
|
|
16214
|
+
...defaultProps$i,
|
|
14835
16215
|
...props
|
|
14836
16216
|
};
|
|
14837
16217
|
const [domHeight, setDomHeight] = React.useState(-1);
|
|
@@ -14905,9 +16285,9 @@
|
|
|
14905
16285
|
className: colBem("content-text")
|
|
14906
16286
|
}, children)));
|
|
14907
16287
|
};
|
|
14908
|
-
CollapseItem.defaultProps = defaultProps$
|
|
16288
|
+
CollapseItem.defaultProps = defaultProps$i;
|
|
14909
16289
|
CollapseItem.displayName = "NutCollapseItem";
|
|
14910
|
-
const defaultProps$
|
|
16290
|
+
const defaultProps$h = {
|
|
14911
16291
|
maxLen: 0,
|
|
14912
16292
|
endNumber: "",
|
|
14913
16293
|
delaySpeed: 300,
|
|
@@ -14925,7 +16305,7 @@
|
|
|
14925
16305
|
thousands,
|
|
14926
16306
|
...reset
|
|
14927
16307
|
} = {
|
|
14928
|
-
...defaultProps$
|
|
16308
|
+
...defaultProps$h,
|
|
14929
16309
|
...props
|
|
14930
16310
|
};
|
|
14931
16311
|
const b2 = cn("countup");
|
|
@@ -14995,9 +16375,9 @@
|
|
|
14995
16375
|
}, item));
|
|
14996
16376
|
})));
|
|
14997
16377
|
};
|
|
14998
|
-
CountUp.defaultProps = defaultProps$
|
|
16378
|
+
CountUp.defaultProps = defaultProps$h;
|
|
14999
16379
|
CountUp.displayName = "NutCountUp";
|
|
15000
|
-
const defaultProps$
|
|
16380
|
+
const defaultProps$g = {};
|
|
15001
16381
|
class AnimatingNumbers extends React.Component {
|
|
15002
16382
|
constructor(props) {
|
|
15003
16383
|
super(props);
|
|
@@ -15009,7 +16389,7 @@
|
|
|
15009
16389
|
});
|
|
15010
16390
|
}
|
|
15011
16391
|
}
|
|
15012
|
-
AnimatingNumbers.defaultProps = defaultProps$
|
|
16392
|
+
AnimatingNumbers.defaultProps = defaultProps$g;
|
|
15013
16393
|
AnimatingNumbers.displayName = "NutAnimatingNumbers";
|
|
15014
16394
|
AnimatingNumbers.CountUp = CountUp;
|
|
15015
16395
|
AnimatingNumbers.CountUp = CountUp;
|
|
@@ -15018,7 +16398,7 @@
|
|
|
15018
16398
|
error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
|
|
15019
16399
|
network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
|
|
15020
16400
|
};
|
|
15021
|
-
const defaultProps$
|
|
16401
|
+
const defaultProps$f = {
|
|
15022
16402
|
description: "\u65E0\u5185\u5BB9",
|
|
15023
16403
|
image: "empty",
|
|
15024
16404
|
imageSize: "",
|
|
@@ -15026,9 +16406,9 @@
|
|
|
15026
16406
|
};
|
|
15027
16407
|
const Empty = (props) => {
|
|
15028
16408
|
const { locale } = useConfig();
|
|
15029
|
-
defaultProps$
|
|
16409
|
+
defaultProps$f.description = locale.noData || defaultProps$f.description;
|
|
15030
16410
|
const { image, imageSize, description, children, className, ...rest } = {
|
|
15031
|
-
...defaultProps$
|
|
16411
|
+
...defaultProps$f,
|
|
15032
16412
|
...props
|
|
15033
16413
|
};
|
|
15034
16414
|
const [imgStyle, setImgStyle] = React.useState({});
|
|
@@ -15070,7 +16450,7 @@
|
|
|
15070
16450
|
className: b2("description")
|
|
15071
16451
|
}, description) : { description }, children));
|
|
15072
16452
|
};
|
|
15073
|
-
Empty.defaultProps = defaultProps$
|
|
16453
|
+
Empty.defaultProps = defaultProps$f;
|
|
15074
16454
|
Empty.displayName = "NutEmpty";
|
|
15075
16455
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
15076
16456
|
let index2 = 0;
|
|
@@ -15183,7 +16563,7 @@
|
|
|
15183
16563
|
}
|
|
15184
16564
|
});
|
|
15185
16565
|
};
|
|
15186
|
-
const defaultProps$
|
|
16566
|
+
const defaultProps$e = {};
|
|
15187
16567
|
const VirtualList = (props) => {
|
|
15188
16568
|
const {
|
|
15189
16569
|
sourceData = [],
|
|
@@ -15342,9 +16722,9 @@
|
|
|
15342
16722
|
}) : data);
|
|
15343
16723
|
}))));
|
|
15344
16724
|
};
|
|
15345
|
-
VirtualList.defaultProps = defaultProps$
|
|
16725
|
+
VirtualList.defaultProps = defaultProps$e;
|
|
15346
16726
|
VirtualList.displayName = "NutVirtualList";
|
|
15347
|
-
const defaultProps$
|
|
16727
|
+
const defaultProps$d = {
|
|
15348
16728
|
className: "",
|
|
15349
16729
|
style: {},
|
|
15350
16730
|
columns: [],
|
|
@@ -15355,7 +16735,7 @@
|
|
|
15355
16735
|
};
|
|
15356
16736
|
const Table = (props) => {
|
|
15357
16737
|
const { locale } = useConfig();
|
|
15358
|
-
defaultProps$
|
|
16738
|
+
defaultProps$d.noData = locale.noData;
|
|
15359
16739
|
const {
|
|
15360
16740
|
children,
|
|
15361
16741
|
className,
|
|
@@ -15369,7 +16749,7 @@
|
|
|
15369
16749
|
onSorter,
|
|
15370
16750
|
...rest
|
|
15371
16751
|
} = {
|
|
15372
|
-
...defaultProps$
|
|
16752
|
+
...defaultProps$d,
|
|
15373
16753
|
...props
|
|
15374
16754
|
};
|
|
15375
16755
|
const [curData, setCurData] = React.useState(data);
|
|
@@ -15421,14 +16801,14 @@
|
|
|
15421
16801
|
});
|
|
15422
16802
|
};
|
|
15423
16803
|
const renderBodyTds = (item) => {
|
|
15424
|
-
return sortDataItem().map(([value,
|
|
16804
|
+
return sortDataItem().map(([value, render2], index2) => {
|
|
15425
16805
|
return /* @__PURE__ */ React__default["default"].createElement("span", {
|
|
15426
16806
|
className: classNames(
|
|
15427
16807
|
"nut-table__main__body__tr__td",
|
|
15428
16808
|
cellClasses(getColumnItem(value))
|
|
15429
16809
|
),
|
|
15430
16810
|
key: value
|
|
15431
|
-
}, typeof item[value] === "function" || typeof
|
|
16811
|
+
}, typeof item[value] === "function" || typeof render2 === "function" ? /* @__PURE__ */ React__default["default"].createElement("div", null, render2 ? render2(item) : item[value](item)) : item[value]);
|
|
15432
16812
|
});
|
|
15433
16813
|
};
|
|
15434
16814
|
const renderBoyTrs = () => {
|
|
@@ -15465,9 +16845,9 @@
|
|
|
15465
16845
|
className: "nut-table__nodata__text"
|
|
15466
16846
|
}, noData))));
|
|
15467
16847
|
};
|
|
15468
|
-
Table.defaultProps = defaultProps$
|
|
16848
|
+
Table.defaultProps = defaultProps$d;
|
|
15469
16849
|
Table.displayName = "NutTable";
|
|
15470
|
-
const defaultProps$
|
|
16850
|
+
const defaultProps$c = {
|
|
15471
16851
|
source: {
|
|
15472
16852
|
type: {},
|
|
15473
16853
|
src: ""
|
|
@@ -15492,7 +16872,7 @@
|
|
|
15492
16872
|
playend,
|
|
15493
16873
|
...restProps
|
|
15494
16874
|
} = {
|
|
15495
|
-
...defaultProps$
|
|
16875
|
+
...defaultProps$c,
|
|
15496
16876
|
...props
|
|
15497
16877
|
};
|
|
15498
16878
|
const rootRef = React.useRef(null);
|
|
@@ -15546,9 +16926,9 @@
|
|
|
15546
16926
|
kind: "captions"
|
|
15547
16927
|
})));
|
|
15548
16928
|
};
|
|
15549
|
-
Video.defaultProps = defaultProps$
|
|
16929
|
+
Video.defaultProps = defaultProps$c;
|
|
15550
16930
|
Video.displayName = "NutVideo";
|
|
15551
|
-
const defaultProps$
|
|
16931
|
+
const defaultProps$b = {
|
|
15552
16932
|
className: "",
|
|
15553
16933
|
style: {},
|
|
15554
16934
|
isShowPercentage: true,
|
|
@@ -15592,7 +16972,7 @@
|
|
|
15592
16972
|
rounded,
|
|
15593
16973
|
children,
|
|
15594
16974
|
...rest
|
|
15595
|
-
} = { ...defaultProps$
|
|
16975
|
+
} = { ...defaultProps$b, ...props };
|
|
15596
16976
|
const b2 = cn("progress");
|
|
15597
16977
|
const classes = classNames(b2(""));
|
|
15598
16978
|
const classesOuter = classNames({
|
|
@@ -15666,8 +17046,436 @@
|
|
|
15666
17046
|
color: iconColor
|
|
15667
17047
|
})));
|
|
15668
17048
|
};
|
|
15669
|
-
Progress.defaultProps = defaultProps$
|
|
17049
|
+
Progress.defaultProps = defaultProps$b;
|
|
15670
17050
|
Progress.displayName = "NutProgress";
|
|
17051
|
+
const defaultProps$a = {
|
|
17052
|
+
className: "",
|
|
17053
|
+
url: "",
|
|
17054
|
+
style: {},
|
|
17055
|
+
muted: false,
|
|
17056
|
+
autoplay: false,
|
|
17057
|
+
loop: false,
|
|
17058
|
+
preload: "auto",
|
|
17059
|
+
type: "progress",
|
|
17060
|
+
onFastBack: (e2) => {
|
|
17061
|
+
},
|
|
17062
|
+
onForward: (e2) => {
|
|
17063
|
+
},
|
|
17064
|
+
onPause: (e2) => {
|
|
17065
|
+
},
|
|
17066
|
+
onPlayEnd: (e2) => {
|
|
17067
|
+
},
|
|
17068
|
+
onMute: (e2) => {
|
|
17069
|
+
},
|
|
17070
|
+
onCanPlay: (e2) => {
|
|
17071
|
+
}
|
|
17072
|
+
};
|
|
17073
|
+
const Audio = (props) => {
|
|
17074
|
+
const { locale } = useConfig();
|
|
17075
|
+
const {
|
|
17076
|
+
className,
|
|
17077
|
+
url,
|
|
17078
|
+
style,
|
|
17079
|
+
muted,
|
|
17080
|
+
autoplay,
|
|
17081
|
+
loop: loop2,
|
|
17082
|
+
preload,
|
|
17083
|
+
type,
|
|
17084
|
+
onFastBack,
|
|
17085
|
+
onForward,
|
|
17086
|
+
onPause,
|
|
17087
|
+
onPlayEnd,
|
|
17088
|
+
onMute,
|
|
17089
|
+
onCanPlay,
|
|
17090
|
+
children,
|
|
17091
|
+
...rest
|
|
17092
|
+
} = {
|
|
17093
|
+
...defaultProps$a,
|
|
17094
|
+
...props
|
|
17095
|
+
};
|
|
17096
|
+
const [playing, setPlaying] = React.useState(false);
|
|
17097
|
+
const [percent, setPercent] = React.useState(0);
|
|
17098
|
+
const [isCanPlay, setIsCanPlay] = React.useState(false);
|
|
17099
|
+
const [currentDuration, setCurrentDuration] = React.useState("00:00:00");
|
|
17100
|
+
const AudioRef = React.useRef(null);
|
|
17101
|
+
const statusRef = React.useRef({
|
|
17102
|
+
currentTime: 0,
|
|
17103
|
+
currentDuration: "00:00:00",
|
|
17104
|
+
percent: 0,
|
|
17105
|
+
duration: "00:00:00",
|
|
17106
|
+
second: 0,
|
|
17107
|
+
hanMuted: props.muted,
|
|
17108
|
+
playing: props.autoplay,
|
|
17109
|
+
handPlaying: false
|
|
17110
|
+
});
|
|
17111
|
+
const b2 = cn("audio");
|
|
17112
|
+
const warn = console.warn;
|
|
17113
|
+
const handleEnded = (e2) => {
|
|
17114
|
+
if (props.loop) {
|
|
17115
|
+
warn(locale.audio.tips || "onPlayEnd\u4E8B\u4EF6\u5728loop=false\u65F6\u624D\u4F1A\u89E6\u53D1");
|
|
17116
|
+
} else {
|
|
17117
|
+
props.onPlayEnd && props.onPlayEnd(e2);
|
|
17118
|
+
}
|
|
17119
|
+
};
|
|
17120
|
+
function watch() {
|
|
17121
|
+
if (AudioRef && AudioRef.current) {
|
|
17122
|
+
const current = AudioRef.current;
|
|
17123
|
+
current.addEventListener("play", () => {
|
|
17124
|
+
setPlaying(true);
|
|
17125
|
+
});
|
|
17126
|
+
}
|
|
17127
|
+
}
|
|
17128
|
+
React.useEffect(() => {
|
|
17129
|
+
watch();
|
|
17130
|
+
}, []);
|
|
17131
|
+
React.useEffect(() => {
|
|
17132
|
+
}, [currentDuration]);
|
|
17133
|
+
const handleStatusChange = () => {
|
|
17134
|
+
setPlaying(!playing);
|
|
17135
|
+
if (playing) {
|
|
17136
|
+
AudioRef && AudioRef.current && AudioRef.current.pause();
|
|
17137
|
+
} else {
|
|
17138
|
+
AudioRef && AudioRef.current && AudioRef.current.play();
|
|
17139
|
+
}
|
|
17140
|
+
};
|
|
17141
|
+
const renderIcon = () => {
|
|
17142
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17143
|
+
className: b2("icon")
|
|
17144
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17145
|
+
className: `${b2("icon-box")} ${playing ? b2("icon-play") : b2("icon-stop")}`,
|
|
17146
|
+
onClick: handleStatusChange
|
|
17147
|
+
}, playing ? /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
17148
|
+
name: "service",
|
|
17149
|
+
className: "nut-icon-loading"
|
|
17150
|
+
}) : /* @__PURE__ */ React__default["default"].createElement(Icon, {
|
|
17151
|
+
name: "service"
|
|
17152
|
+
}))));
|
|
17153
|
+
};
|
|
17154
|
+
const handleBack = () => {
|
|
17155
|
+
if (statusRef.current.currentTime > 0 && AudioRef.current) {
|
|
17156
|
+
statusRef.current.currentTime--;
|
|
17157
|
+
AudioRef.current.currentTime = statusRef.current.currentTime;
|
|
17158
|
+
props.onFastBack && props.onFastBack(AudioRef.current);
|
|
17159
|
+
}
|
|
17160
|
+
};
|
|
17161
|
+
const handleForward = () => {
|
|
17162
|
+
if (AudioRef.current) {
|
|
17163
|
+
statusRef.current.currentTime++;
|
|
17164
|
+
AudioRef.current.currentTime = statusRef.current.currentTime;
|
|
17165
|
+
props.onForward && props.onForward(AudioRef.current);
|
|
17166
|
+
}
|
|
17167
|
+
};
|
|
17168
|
+
const handleMute = () => {
|
|
17169
|
+
if (AudioRef.current) {
|
|
17170
|
+
AudioRef.current.muted = !AudioRef.current.muted;
|
|
17171
|
+
props.onMute && props.onMute(AudioRef.current);
|
|
17172
|
+
}
|
|
17173
|
+
};
|
|
17174
|
+
const handlePause = (e2) => {
|
|
17175
|
+
setPlaying(false);
|
|
17176
|
+
props.onPause && props.onPause(e2);
|
|
17177
|
+
};
|
|
17178
|
+
const formatSeconds = (value) => {
|
|
17179
|
+
if (!value) {
|
|
17180
|
+
return "00:00:00";
|
|
17181
|
+
}
|
|
17182
|
+
const time = parseInt(value);
|
|
17183
|
+
const hours = Math.floor(time / 3600);
|
|
17184
|
+
const minutes = Math.floor((time - hours * 3600) / 60);
|
|
17185
|
+
const seconds = time - hours * 3600 - minutes * 60;
|
|
17186
|
+
let result = "";
|
|
17187
|
+
result += `${`0${hours.toString()}`.slice(-2)}:`;
|
|
17188
|
+
result += `${`0${minutes.toString()}`.slice(-2)}:`;
|
|
17189
|
+
result += `0${seconds.toString()}`.slice(-2);
|
|
17190
|
+
return result;
|
|
17191
|
+
};
|
|
17192
|
+
const renderProgerss = () => {
|
|
17193
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17194
|
+
className: b2("progress")
|
|
17195
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17196
|
+
className: "time"
|
|
17197
|
+
}, currentDuration), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17198
|
+
className: b2("progress-bar-wrapper")
|
|
17199
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Range, {
|
|
17200
|
+
modelValue: percent,
|
|
17201
|
+
hiddenTag: true,
|
|
17202
|
+
hiddenRange: true,
|
|
17203
|
+
"inactive-color": "#cccccc",
|
|
17204
|
+
"active-color": "#fa2c19"
|
|
17205
|
+
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17206
|
+
className: "time"
|
|
17207
|
+
}, AudioRef.current ? formatSeconds(`${statusRef.current.second}`) : "00:00:00")), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17208
|
+
className: isCanPlay ? "custom-button-group" : "custom-button-group-disable"
|
|
17209
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Button, {
|
|
17210
|
+
type: "primary",
|
|
17211
|
+
size: "small",
|
|
17212
|
+
className: "back",
|
|
17213
|
+
onClick: handleBack
|
|
17214
|
+
}, locale.audio.back || "\u5FEB\u9000"), /* @__PURE__ */ React__default["default"].createElement(Button, {
|
|
17215
|
+
type: "primary",
|
|
17216
|
+
size: "small",
|
|
17217
|
+
className: "start",
|
|
17218
|
+
onClick: handleStatusChange
|
|
17219
|
+
}, playing ? `${locale.audio.pause || "\u6682\u505C"}` : `${locale.audio.start || "\u5F00\u59CB"}`), /* @__PURE__ */ React__default["default"].createElement(Button, {
|
|
17220
|
+
type: "primary",
|
|
17221
|
+
size: "small",
|
|
17222
|
+
onClick: handleForward
|
|
17223
|
+
}, locale.audio.forward || "\u5FEB\u8FDB"), /* @__PURE__ */ React__default["default"].createElement(Button, {
|
|
17224
|
+
type: AudioRef.current && AudioRef.current.muted ? "default" : "primary",
|
|
17225
|
+
size: "small",
|
|
17226
|
+
onClick: handleMute
|
|
17227
|
+
}, locale.audio.mute || "\u9759\u97F3")));
|
|
17228
|
+
};
|
|
17229
|
+
const renderNone = () => {
|
|
17230
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17231
|
+
className: b2("none-container"),
|
|
17232
|
+
onClick: handleStatusChange
|
|
17233
|
+
}, children);
|
|
17234
|
+
};
|
|
17235
|
+
const renderAudio = () => {
|
|
17236
|
+
switch (type) {
|
|
17237
|
+
case "icon":
|
|
17238
|
+
return renderIcon();
|
|
17239
|
+
case "progress":
|
|
17240
|
+
return renderProgerss();
|
|
17241
|
+
case "none":
|
|
17242
|
+
return renderNone();
|
|
17243
|
+
default:
|
|
17244
|
+
return null;
|
|
17245
|
+
}
|
|
17246
|
+
};
|
|
17247
|
+
const handleCanplay = (e2) => {
|
|
17248
|
+
setIsCanPlay(true);
|
|
17249
|
+
if (props.autoplay && !playing) {
|
|
17250
|
+
AudioRef && AudioRef.current && AudioRef.current.play();
|
|
17251
|
+
}
|
|
17252
|
+
if (AudioRef.current) {
|
|
17253
|
+
statusRef.current.second = AudioRef.current.duration || 0;
|
|
17254
|
+
props.onCanPlay && props.onCanPlay(e2);
|
|
17255
|
+
}
|
|
17256
|
+
};
|
|
17257
|
+
const onTimeupdate = (e2) => {
|
|
17258
|
+
const time = parseInt(e2.target.currentTime);
|
|
17259
|
+
const formated = formatSeconds(`${time}`);
|
|
17260
|
+
statusRef.current.currentDuration = formated;
|
|
17261
|
+
setPercent(time / statusRef.current.second * 100);
|
|
17262
|
+
setCurrentDuration(formated);
|
|
17263
|
+
statusRef.current.currentTime = time;
|
|
17264
|
+
};
|
|
17265
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17266
|
+
className: `${b2()} ${className}`,
|
|
17267
|
+
style,
|
|
17268
|
+
...rest
|
|
17269
|
+
}, renderAudio(), /* @__PURE__ */ React__default["default"].createElement("audio", {
|
|
17270
|
+
className: "audioMain",
|
|
17271
|
+
controls: type === "controls",
|
|
17272
|
+
ref: AudioRef,
|
|
17273
|
+
src: url,
|
|
17274
|
+
muted,
|
|
17275
|
+
preload,
|
|
17276
|
+
loop: loop2,
|
|
17277
|
+
onPause: (e2) => handlePause(e2),
|
|
17278
|
+
onEnded: (e2) => handleEnded(e2),
|
|
17279
|
+
onCanPlay: (e2) => handleCanplay(e2),
|
|
17280
|
+
onTimeUpdate: (e2) => onTimeupdate(e2)
|
|
17281
|
+
}, /* @__PURE__ */ React__default["default"].createElement("track", {
|
|
17282
|
+
kind: "captions"
|
|
17283
|
+
})));
|
|
17284
|
+
};
|
|
17285
|
+
Audio.defaultProps = defaultProps$a;
|
|
17286
|
+
Audio.displayName = "NutAudio";
|
|
17287
|
+
const defaultProps$9 = {
|
|
17288
|
+
images: [],
|
|
17289
|
+
videos: [],
|
|
17290
|
+
show: false,
|
|
17291
|
+
autoplay: 3e3,
|
|
17292
|
+
initNo: 1,
|
|
17293
|
+
contentClose: false,
|
|
17294
|
+
paginationVisible: false,
|
|
17295
|
+
paginationColor: "#fff",
|
|
17296
|
+
onClose: () => {
|
|
17297
|
+
}
|
|
17298
|
+
};
|
|
17299
|
+
const ImagePreview = (props) => {
|
|
17300
|
+
const {
|
|
17301
|
+
images,
|
|
17302
|
+
videos,
|
|
17303
|
+
show,
|
|
17304
|
+
initNo,
|
|
17305
|
+
paginationColor,
|
|
17306
|
+
paginationVisible,
|
|
17307
|
+
autoplay,
|
|
17308
|
+
contentClose,
|
|
17309
|
+
onClose
|
|
17310
|
+
} = props;
|
|
17311
|
+
const nutImagePreview = React.useRef(null);
|
|
17312
|
+
const [showPop, setShowPop] = React.useState(false);
|
|
17313
|
+
const [active, setActive] = React.useState(1);
|
|
17314
|
+
const [maxNo, setMaxNo] = React.useState(1);
|
|
17315
|
+
const [store, setStore] = React.useState({
|
|
17316
|
+
scale: 1,
|
|
17317
|
+
moveable: false
|
|
17318
|
+
});
|
|
17319
|
+
const [lastTouchEndTime, setLastTouchEndTime] = React.useState(0);
|
|
17320
|
+
const onTouchStart = (event) => {
|
|
17321
|
+
const touches = event.touches;
|
|
17322
|
+
const events = touches[0];
|
|
17323
|
+
const events2 = touches[1];
|
|
17324
|
+
const curTouchTime = new Date().getTime();
|
|
17325
|
+
if (curTouchTime - lastTouchEndTime < 300) {
|
|
17326
|
+
const store12 = store;
|
|
17327
|
+
if (store12.scale > 1) {
|
|
17328
|
+
store12.scale = 1;
|
|
17329
|
+
} else if (store12.scale === 1) {
|
|
17330
|
+
store12.scale = 2;
|
|
17331
|
+
}
|
|
17332
|
+
scaleNow();
|
|
17333
|
+
}
|
|
17334
|
+
const store1 = store;
|
|
17335
|
+
store1.moveable = true;
|
|
17336
|
+
if (events2) {
|
|
17337
|
+
store1.oriDistance = getDistance(
|
|
17338
|
+
{
|
|
17339
|
+
x: events.pageX,
|
|
17340
|
+
y: events.pageY
|
|
17341
|
+
},
|
|
17342
|
+
{
|
|
17343
|
+
x: events2.pageX,
|
|
17344
|
+
y: events2.pageY
|
|
17345
|
+
}
|
|
17346
|
+
);
|
|
17347
|
+
}
|
|
17348
|
+
store1.originScale = store1.scale || 1;
|
|
17349
|
+
};
|
|
17350
|
+
const onTouchMove = (event) => {
|
|
17351
|
+
const touches = event.touches;
|
|
17352
|
+
const events = touches[0];
|
|
17353
|
+
const events2 = touches[1];
|
|
17354
|
+
if (!store.moveable) {
|
|
17355
|
+
return;
|
|
17356
|
+
}
|
|
17357
|
+
const store1 = store;
|
|
17358
|
+
if (events2) {
|
|
17359
|
+
const curDistance = getDistance(
|
|
17360
|
+
{
|
|
17361
|
+
x: events.pageX,
|
|
17362
|
+
y: events.pageY
|
|
17363
|
+
},
|
|
17364
|
+
{
|
|
17365
|
+
x: events2.pageX,
|
|
17366
|
+
y: events2.pageY
|
|
17367
|
+
}
|
|
17368
|
+
);
|
|
17369
|
+
const curScale = curDistance / store1.oriDistance;
|
|
17370
|
+
store1.scale = store1.originScale * curScale;
|
|
17371
|
+
if (store1.scale > 3) {
|
|
17372
|
+
store1.scale = 3;
|
|
17373
|
+
}
|
|
17374
|
+
scaleNow();
|
|
17375
|
+
}
|
|
17376
|
+
};
|
|
17377
|
+
const onTouchEnd = () => {
|
|
17378
|
+
setLastTouchEndTime(new Date().getTime());
|
|
17379
|
+
const store1 = store;
|
|
17380
|
+
store1.moveable = false;
|
|
17381
|
+
if (store1.scale < 1.1 && store1.scale > 1 || store1.scale < 1) {
|
|
17382
|
+
store1.scale = 1;
|
|
17383
|
+
scaleNow();
|
|
17384
|
+
}
|
|
17385
|
+
};
|
|
17386
|
+
const init = () => {
|
|
17387
|
+
document.addEventListener("touchmove", onTouchMove);
|
|
17388
|
+
document.addEventListener("touchend", onTouchEnd);
|
|
17389
|
+
document.addEventListener("touchcancel", onTouchEnd);
|
|
17390
|
+
};
|
|
17391
|
+
React.useEffect(() => {
|
|
17392
|
+
if (show !== void 0) {
|
|
17393
|
+
setShowPop(show);
|
|
17394
|
+
init();
|
|
17395
|
+
}
|
|
17396
|
+
}, [show]);
|
|
17397
|
+
React.useEffect(() => {
|
|
17398
|
+
if (initNo !== void 0) {
|
|
17399
|
+
setActive(initNo);
|
|
17400
|
+
}
|
|
17401
|
+
if (show !== void 0) {
|
|
17402
|
+
setShowPop(show);
|
|
17403
|
+
}
|
|
17404
|
+
if (images && videos) {
|
|
17405
|
+
setMaxNo(images.length + videos.length);
|
|
17406
|
+
}
|
|
17407
|
+
}, []);
|
|
17408
|
+
const scaleNow = () => {
|
|
17409
|
+
if (nutImagePreview.current) {
|
|
17410
|
+
nutImagePreview.current.style.transform = `scale(${store.scale})`;
|
|
17411
|
+
}
|
|
17412
|
+
};
|
|
17413
|
+
const onCloseInner = () => {
|
|
17414
|
+
setShowPop(false);
|
|
17415
|
+
setActive(1);
|
|
17416
|
+
scaleNow();
|
|
17417
|
+
onClose && onClose();
|
|
17418
|
+
setStore({
|
|
17419
|
+
...store,
|
|
17420
|
+
scale: 1
|
|
17421
|
+
});
|
|
17422
|
+
};
|
|
17423
|
+
const getDistance = (first, second) => {
|
|
17424
|
+
return Math.hypot(
|
|
17425
|
+
Math.abs(second.x - first.x),
|
|
17426
|
+
Math.abs(second.y - first.y)
|
|
17427
|
+
);
|
|
17428
|
+
};
|
|
17429
|
+
const slideChangeEnd = (page) => {
|
|
17430
|
+
setActive(page + 1);
|
|
17431
|
+
};
|
|
17432
|
+
const closeOnImg = () => {
|
|
17433
|
+
if (contentClose) {
|
|
17434
|
+
onCloseInner();
|
|
17435
|
+
}
|
|
17436
|
+
};
|
|
17437
|
+
return /* @__PURE__ */ React__default["default"].createElement(Popup, {
|
|
17438
|
+
visible: showPop,
|
|
17439
|
+
popClass: "custom-pop",
|
|
17440
|
+
style: { width: "100%" },
|
|
17441
|
+
onClick: onCloseInner
|
|
17442
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17443
|
+
className: "nut-imagepreview",
|
|
17444
|
+
ref: nutImagePreview,
|
|
17445
|
+
onClick: closeOnImg,
|
|
17446
|
+
onTouchStart
|
|
17447
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Swiper, {
|
|
17448
|
+
autoPlay: autoplay,
|
|
17449
|
+
className: "nut-imagepreview-swiper",
|
|
17450
|
+
loop: true,
|
|
17451
|
+
isPreventDefault: false,
|
|
17452
|
+
style: { display: showPop ? "block" : "none" },
|
|
17453
|
+
direction: "horizontal",
|
|
17454
|
+
onChange: slideChangeEnd,
|
|
17455
|
+
initPage: initNo && (initNo > maxNo ? maxNo - 1 : initNo - 1),
|
|
17456
|
+
paginationColor,
|
|
17457
|
+
paginationVisible
|
|
17458
|
+
}, videos && videos.length > 0 && videos.map((item, index2) => {
|
|
17459
|
+
return /* @__PURE__ */ React__default["default"].createElement(SwiperItem, {
|
|
17460
|
+
key: index2
|
|
17461
|
+
}, /* @__PURE__ */ React__default["default"].createElement(Video, {
|
|
17462
|
+
source: item.source,
|
|
17463
|
+
options: item.options
|
|
17464
|
+
}));
|
|
17465
|
+
}), images && images.length > 0 && images.map((item, index2) => {
|
|
17466
|
+
return /* @__PURE__ */ React__default["default"].createElement(SwiperItem, {
|
|
17467
|
+
key: index2
|
|
17468
|
+
}, /* @__PURE__ */ React__default["default"].createElement("img", {
|
|
17469
|
+
src: item.src,
|
|
17470
|
+
alt: "",
|
|
17471
|
+
className: "nut-imagepreview-img"
|
|
17472
|
+
}));
|
|
17473
|
+
}))), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
17474
|
+
className: "nut-imagepreview-index"
|
|
17475
|
+
}, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)));
|
|
17476
|
+
};
|
|
17477
|
+
ImagePreview.defaultProps = defaultProps$9;
|
|
17478
|
+
ImagePreview.displayName = "NutImagePreview";
|
|
15671
17479
|
const defaultProps$8 = {
|
|
15672
17480
|
type: "custom",
|
|
15673
17481
|
existAddress: [],
|
|
@@ -16696,6 +18504,7 @@
|
|
|
16696
18504
|
exports2.ActionSheet = ActionSheet;
|
|
16697
18505
|
exports2.Address = Address;
|
|
16698
18506
|
exports2.AnimatingNumbers = AnimatingNumbers;
|
|
18507
|
+
exports2.Audio = Audio;
|
|
16699
18508
|
exports2.Avatar = Avatar;
|
|
16700
18509
|
exports2.AvatarGroup = AvatarGroup;
|
|
16701
18510
|
exports2.BackTop = BackTop;
|
|
@@ -16705,6 +18514,7 @@
|
|
|
16705
18514
|
exports2.Calendar = Calendar;
|
|
16706
18515
|
exports2.CalendarItem = CalendarItem;
|
|
16707
18516
|
exports2.Card = Card;
|
|
18517
|
+
exports2.Cascader = Cascader;
|
|
16708
18518
|
exports2.Cell = Cell;
|
|
16709
18519
|
exports2.CellGroup = CellGroup;
|
|
16710
18520
|
exports2.Checkbox = Checkbox;
|
|
@@ -16722,12 +18532,17 @@
|
|
|
16722
18532
|
exports2.Elevator = Elevator;
|
|
16723
18533
|
exports2.Empty = Empty;
|
|
16724
18534
|
exports2.FixedNav = FixedNav;
|
|
18535
|
+
exports2.Grid = Grid;
|
|
18536
|
+
exports2.GridItem = GridItem;
|
|
16725
18537
|
exports2.Icon = Icon;
|
|
18538
|
+
exports2.ImagePreview = ImagePreview;
|
|
16726
18539
|
exports2.Indicator = Indicator;
|
|
16727
18540
|
exports2.Infiniteloading = Infiniteloading;
|
|
16728
18541
|
exports2.Input = Input;
|
|
16729
18542
|
exports2.InputNumber = InputNumber;
|
|
16730
18543
|
exports2.Layout = Layout;
|
|
18544
|
+
exports2.Menu = Menu;
|
|
18545
|
+
exports2.MenuItem = MenuItem;
|
|
16731
18546
|
exports2.NavBar = NavBar;
|
|
16732
18547
|
exports2.NoticeBar = NoticeBar;
|
|
16733
18548
|
exports2.Notify = Notify;
|
|
@@ -16753,6 +18568,7 @@
|
|
|
16753
18568
|
exports2.Step = Step;
|
|
16754
18569
|
exports2.Steps = Steps;
|
|
16755
18570
|
exports2.SubSideNavBar = SubSideNavBar;
|
|
18571
|
+
exports2.Swipe = Swipe;
|
|
16756
18572
|
exports2.Swiper = Swiper;
|
|
16757
18573
|
exports2.SwiperItem = SwiperItem;
|
|
16758
18574
|
exports2.Switch = Switch;
|