acud 0.0.62 → 0.0.65

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.
Files changed (59) hide show
  1. package/dist/acud.css +91 -18
  2. package/dist/acud.css.map +1 -1
  3. package/dist/acud.js +972 -311
  4. package/dist/acud.js.map +1 -1
  5. package/dist/acud.min.css +1 -1
  6. package/dist/acud.min.css.map +1 -1
  7. package/dist/acud.min.js +5 -5
  8. package/dist/acud.min.js.map +1 -1
  9. package/es/alert/style/index.css +1 -1
  10. package/es/alert/style/index.less +150 -147
  11. package/es/alert/style/rtl.less +27 -27
  12. package/es/date-picker/src/Picker.js +1 -1
  13. package/es/date-picker/src/RangePicker.js +1 -1
  14. package/es/date-picker/style/index.css +43 -11
  15. package/es/date-picker/style/index.less +13 -2
  16. package/es/date-picker/style/panel.less +32 -10
  17. package/es/dropdown/dropdown-button.js +5 -2
  18. package/es/dropdown/style/index.css +4 -0
  19. package/es/dropdown/style/index.less +4 -0
  20. package/es/modal/DialogBox.d.ts +46 -0
  21. package/es/modal/DialogBox.js +152 -0
  22. package/es/modal/dialog.d.ts +17 -0
  23. package/es/modal/dialog.js +123 -0
  24. package/es/modal/index.d.ts +11 -2
  25. package/es/modal/index.js +10 -1
  26. package/es/modal/style/index.css +40 -4
  27. package/es/modal/style/index.less +60 -1
  28. package/es/style/themes/default/components/datePicker.less +1 -1
  29. package/es/style/themes/default/components/modal.less +2 -2
  30. package/es/tooltip/index.d.ts +0 -1
  31. package/es/tooltip/index.js +3 -8
  32. package/es/transfer/style/index.css +2 -1
  33. package/es/transfer/style/index.less +2 -1
  34. package/lib/alert/style/index.css +1 -1
  35. package/lib/alert/style/index.less +150 -147
  36. package/lib/alert/style/rtl.less +27 -27
  37. package/lib/date-picker/src/Picker.js +1 -1
  38. package/lib/date-picker/src/RangePicker.js +1 -1
  39. package/lib/date-picker/style/index.css +43 -11
  40. package/lib/date-picker/style/index.less +13 -2
  41. package/lib/date-picker/style/panel.less +32 -10
  42. package/lib/dropdown/dropdown-button.js +5 -2
  43. package/lib/dropdown/style/index.css +4 -0
  44. package/lib/dropdown/style/index.less +4 -0
  45. package/lib/modal/DialogBox.d.ts +46 -0
  46. package/lib/modal/DialogBox.js +179 -0
  47. package/lib/modal/dialog.d.ts +17 -0
  48. package/lib/modal/dialog.js +145 -0
  49. package/lib/modal/index.d.ts +11 -2
  50. package/lib/modal/index.js +13 -1
  51. package/lib/modal/style/index.css +40 -4
  52. package/lib/modal/style/index.less +60 -1
  53. package/lib/style/themes/default/components/datePicker.less +1 -1
  54. package/lib/style/themes/default/components/modal.less +2 -2
  55. package/lib/tooltip/index.d.ts +0 -1
  56. package/lib/tooltip/index.js +3 -8
  57. package/lib/transfer/style/index.css +2 -1
  58. package/lib/transfer/style/index.less +2 -1
  59. package/package.json +1 -1
package/dist/acud.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! acud v0.0.62 */
1
+ /*! acud v0.0.65 */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory(require("react"), require("react-dom"));
@@ -9193,7 +9193,7 @@ function InnerPicker(props) {
9193
9193
  size: Object(_utils_uiUtil__WEBPACK_IMPORTED_MODULE_16__["getInputSize"])(picker, formatList[0], generateConfig)
9194
9194
  }, Object(_utils_miscUtil__WEBPACK_IMPORTED_MODULE_14__["default"])(props), {
9195
9195
  autoComplete: autoComplete
9196
- })), suffixNode, clearNode))));
9196
+ })), clearNode, suffixNode))));
9197
9197
  } // Wrap with class component to enable pass generic with instance method
9198
9198
 
9199
9199
 
@@ -10844,7 +10844,7 @@ function InnerRangePicker(props) {
10844
10844
  width: activeBarWidth,
10845
10845
  position: 'absolute'
10846
10846
  })
10847
- }), suffixNode, clearNode)));
10847
+ }), clearNode, suffixNode)));
10848
10848
  } // Wrap with class component to enable pass generic with instance method
10849
10849
 
10850
10850
 
@@ -15253,10 +15253,11 @@ var DropdownButton = function DropdownButton(props) {
15253
15253
 
15254
15254
  var children = props.children,
15255
15255
  overlay = props.overlay,
15256
- visible = props.visible,
15257
15256
  disabled = props.disabled,
15257
+ trigger = props.trigger,
15258
+ visible = props.visible,
15258
15259
  onVisibleChange = props.onVisibleChange,
15259
- restProps = __rest(props, ["children", "overlay", "visible", "disabled", "onVisibleChange"]); // 菜单可见,需要将ICON旋转
15260
+ restProps = __rest(props, ["children", "overlay", "disabled", "trigger", "visible", "onVisibleChange"]); // 菜单可见,需要将ICON旋转
15260
15261
 
15261
15262
 
15262
15263
  var _useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(!!visible),
@@ -15277,7 +15278,9 @@ var DropdownButton = function DropdownButton(props) {
15277
15278
  }, restProps), children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_dropdown__WEBPACK_IMPORTED_MODULE_7__["default"], {
15278
15279
  disabled: disabled,
15279
15280
  placement: "bottomRight",
15281
+ trigger: trigger,
15280
15282
  overlay: overlay,
15283
+ visible: popupVisible,
15281
15284
  onVisibleChange: handleVisibleChange
15282
15285
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_button__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
15283
15286
  disabled: disabled,
@@ -24250,6 +24253,184 @@ __webpack_require__.r(__webpack_exports__);
24250
24253
 
24251
24254
 
24252
24255
 
24256
+ /***/ }),
24257
+
24258
+ /***/ "./components/modal/DialogBox.tsx":
24259
+ /*!****************************************!*\
24260
+ !*** ./components/modal/DialogBox.tsx ***!
24261
+ \****************************************/
24262
+ /*! exports provided: default */
24263
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
24264
+
24265
+ "use strict";
24266
+ __webpack_require__.r(__webpack_exports__);
24267
+ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
24268
+ /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
24269
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
24270
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
24271
+ /* harmony import */ var acud_icon_es_icons_FilledError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! acud-icon/es/icons/FilledError */ "./node_modules/acud-icon/es/icons/FilledError.js");
24272
+ /* harmony import */ var acud_icon_es_icons_OutlinedClose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! acud-icon/es/icons/OutlinedClose */ "./node_modules/acud-icon/es/icons/OutlinedClose.js");
24273
+ /* harmony import */ var acud_icon_es_icons_FilledSuccess__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! acud-icon/es/icons/FilledSuccess */ "./node_modules/acud-icon/es/icons/FilledSuccess.js");
24274
+ /* harmony import */ var acud_icon_es_icons_FilledWarn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! acud-icon/es/icons/FilledWarn */ "./node_modules/acud-icon/es/icons/FilledWarn.js");
24275
+ /* harmony import */ var acud_icon_es_icons_FilledInfo__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! acud-icon/es/icons/FilledInfo */ "./node_modules/acud-icon/es/icons/FilledInfo.js");
24276
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
24277
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__);
24278
+ /* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config-provider */ "./components/config-provider/index.tsx");
24279
+ /* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../button */ "./components/button/index.tsx");
24280
+ /* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Modal */ "./components/modal/Modal.tsx");
24281
+
24282
+
24283
+
24284
+ var __rest = undefined && undefined.__rest || function (s, e) {
24285
+ var t = {};
24286
+
24287
+ for (var p in s) {
24288
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
24289
+ }
24290
+
24291
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
24292
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
24293
+ }
24294
+ return t;
24295
+ };
24296
+
24297
+
24298
+
24299
+
24300
+
24301
+
24302
+
24303
+
24304
+
24305
+
24306
+
24307
+ var DialogType = {
24308
+ success: {
24309
+ className: 'sucess',
24310
+ icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](acud_icon_es_icons_FilledSuccess__WEBPACK_IMPORTED_MODULE_5__["default"], {
24311
+ color: "@S6"
24312
+ })
24313
+ },
24314
+ warning: {
24315
+ className: 'warning',
24316
+ icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](acud_icon_es_icons_FilledWarn__WEBPACK_IMPORTED_MODULE_6__["default"], {
24317
+ color: "@W6"
24318
+ })
24319
+ },
24320
+ confirm: {
24321
+ className: 'confirm',
24322
+ icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](acud_icon_es_icons_FilledWarn__WEBPACK_IMPORTED_MODULE_6__["default"], {
24323
+ color: "@W6"
24324
+ })
24325
+ },
24326
+ info: {
24327
+ className: 'info',
24328
+ icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](acud_icon_es_icons_FilledInfo__WEBPACK_IMPORTED_MODULE_7__["default"], {
24329
+ color: "@B6"
24330
+ })
24331
+ },
24332
+ error: {
24333
+ className: 'error',
24334
+ icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](acud_icon_es_icons_FilledError__WEBPACK_IMPORTED_MODULE_3__["default"], {
24335
+ color: "@E6"
24336
+ })
24337
+ }
24338
+ };
24339
+
24340
+ var DialogBox = function DialogBox(props) {
24341
+ var _React$useContext = react__WEBPACK_IMPORTED_MODULE_2__["useContext"](_config_provider__WEBPACK_IMPORTED_MODULE_9__["ConfigContext"]),
24342
+ getPopupContainer = _React$useContext.getPopupContainer,
24343
+ getPrefixCls = _React$useContext.getPrefixCls;
24344
+
24345
+ var prefixCls = getPrefixCls('modal-dialogbox');
24346
+ var closeIconToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"]("span", {
24347
+ className: "".concat(prefixCls, "-close-x")
24348
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](acud_icon_es_icons_OutlinedClose__WEBPACK_IMPORTED_MODULE_4__["default"], {
24349
+ className: "".concat(prefixCls, "-close-icon")
24350
+ }));
24351
+
24352
+ var visible = props.visible,
24353
+ className = props.className,
24354
+ title = props.title,
24355
+ content = props.content,
24356
+ type = props.type,
24357
+ cancelBtn = props.cancelBtn,
24358
+ okText = props.okText,
24359
+ confirmLoading = props.confirmLoading,
24360
+ onOk = props.onOk,
24361
+ onClose = props.onClose,
24362
+ restProps = __rest(props, ["visible", "className", "title", "content", "type", "cancelBtn", "okText", "confirmLoading", "onOk", "onClose"]);
24363
+
24364
+ var _React$useState = react__WEBPACK_IMPORTED_MODULE_2__["useState"](false),
24365
+ _React$useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_React$useState, 2),
24366
+ loading = _React$useState2[0],
24367
+ toggleLoading = _React$useState2[1];
24368
+
24369
+ var okBtnLoading = react__WEBPACK_IMPORTED_MODULE_2__["useMemo"](function () {
24370
+ if (typeof confirmLoading === 'boolean') {
24371
+ return confirmLoading;
24372
+ }
24373
+
24374
+ return loading;
24375
+ }, [confirmLoading, loading]);
24376
+ var handleOk = react__WEBPACK_IMPORTED_MODULE_2__["useCallback"](function (e) {
24377
+ var okResult = onOk === null || onOk === void 0 ? void 0 : onOk(e);
24378
+
24379
+ if (okResult && typeof okResult.then === 'function') {
24380
+ toggleLoading(true);
24381
+ okResult.then(function () {
24382
+ console.log('then: close');
24383
+ toggleLoading(false);
24384
+ onClose === null || onClose === void 0 ? void 0 : onClose.apply(void 0, arguments);
24385
+ }, function (e) {
24386
+ console.error(e);
24387
+ toggleLoading(false);
24388
+ });
24389
+ } else {
24390
+ onClose === null || onClose === void 0 ? void 0 : onClose(e);
24391
+ }
24392
+ }, [onOk, onClose]);
24393
+ var handleCancel = react__WEBPACK_IMPORTED_MODULE_2__["useCallback"](function () {
24394
+ onClose === null || onClose === void 0 ? void 0 : onClose({
24395
+ triggerCancel: true
24396
+ });
24397
+ }, [onClose]);
24398
+ var titleNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](react__WEBPACK_IMPORTED_MODULE_2__["Fragment"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"]("div", {
24399
+ className: "".concat(prefixCls, "-icon")
24400
+ }, DialogType[type].icon), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"]("div", {
24401
+ className: "".concat(prefixCls, "-title")
24402
+ }, title));
24403
+ var footer = react__WEBPACK_IMPORTED_MODULE_2__["useMemo"](function () {
24404
+ if (!cancelBtn) {
24405
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](_button__WEBPACK_IMPORTED_MODULE_10__["default"], {
24406
+ type: "primary",
24407
+ loading: okBtnLoading,
24408
+ onClick: handleOk
24409
+ }, okText);
24410
+ }
24411
+ }, [okText, cancelBtn, okBtnLoading, handleOk]);
24412
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"](_Modal__WEBPACK_IMPORTED_MODULE_11__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, restProps, {
24413
+ confirmLoading: okBtnLoading,
24414
+ footer: footer,
24415
+ title: titleNode,
24416
+ className: classnames__WEBPACK_IMPORTED_MODULE_8___default()(className, "".concat(prefixCls), "".concat(prefixCls, "-").concat(type)),
24417
+ getContainer: getPopupContainer,
24418
+ visible: visible,
24419
+ closeIcon: closeIconToRender,
24420
+ onCancel: handleCancel,
24421
+ onOk: handleOk,
24422
+ okText: okText
24423
+ }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["createElement"]("div", {
24424
+ className: "".concat(prefixCls, "-content")
24425
+ }, content));
24426
+ };
24427
+
24428
+ DialogBox.defaultProps = {
24429
+ visible: true,
24430
+ type: 'info'
24431
+ };
24432
+ /* harmony default export */ __webpack_exports__["default"] = (DialogBox);
24433
+
24253
24434
  /***/ }),
24254
24435
 
24255
24436
  /***/ "./components/modal/Modal.tsx":
@@ -24376,6 +24557,153 @@ Modal.defaultProps = {
24376
24557
 
24377
24558
  /***/ }),
24378
24559
 
24560
+ /***/ "./components/modal/dialog.tsx":
24561
+ /*!*************************************!*\
24562
+ !*** ./components/modal/dialog.tsx ***!
24563
+ \*************************************/
24564
+ /*! exports provided: destroyAll, confirm, success, info, warning, error */
24565
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
24566
+
24567
+ "use strict";
24568
+ __webpack_require__.r(__webpack_exports__);
24569
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "destroyAll", function() { return destroyAll; });
24570
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "confirm", function() { return confirm; });
24571
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "success", function() { return success; });
24572
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "info", function() { return info; });
24573
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "warning", function() { return warning; });
24574
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "error", function() { return error; });
24575
+ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
24576
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
24577
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
24578
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
24579
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
24580
+ /* harmony import */ var _DialogBox__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DialogBox */ "./components/modal/DialogBox.tsx");
24581
+
24582
+
24583
+
24584
+
24585
+ var destroyFns = [];
24586
+
24587
+ function renderDialogBox(config) {
24588
+ var currentConfig = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, config), {
24589
+ visible: true,
24590
+ onClose: close
24591
+ });
24592
+
24593
+ var container = document.createDocumentFragment();
24594
+
24595
+ function render(dialogConfig) {
24596
+ setTimeout(function () {
24597
+ Object(react_dom__WEBPACK_IMPORTED_MODULE_2__["render"])( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_DialogBox__WEBPACK_IMPORTED_MODULE_3__["default"], dialogConfig), container);
24598
+ });
24599
+ }
24600
+
24601
+ function destroy() {
24602
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24603
+ args[_key] = arguments[_key];
24604
+ }
24605
+
24606
+ var triggerCancel = args.some(function (param) {
24607
+ return param && param.triggerCancel;
24608
+ });
24609
+
24610
+ if (config.onCancel && triggerCancel) {
24611
+ // @ts-ignore
24612
+ config.onCancel.apply(config, args);
24613
+ }
24614
+
24615
+ for (var i = 0; i < destroyFns.length; i++) {
24616
+ var fn = destroyFns[i];
24617
+
24618
+ if (fn === close) {
24619
+ destroyFns.splice(i, 1);
24620
+ break;
24621
+ }
24622
+ }
24623
+
24624
+ Object(react_dom__WEBPACK_IMPORTED_MODULE_2__["unmountComponentAtNode"])(container);
24625
+ }
24626
+
24627
+ function close() {
24628
+ var _this = this;
24629
+
24630
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
24631
+ args[_key2] = arguments[_key2];
24632
+ }
24633
+
24634
+ render(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, currentConfig), {
24635
+ visible: false,
24636
+ afterClose: function afterClose() {
24637
+ if (typeof config.afterClose === 'function') {
24638
+ config.afterClose();
24639
+ }
24640
+
24641
+ destroy.apply(_this, args);
24642
+ }
24643
+ }));
24644
+ }
24645
+
24646
+ render(currentConfig);
24647
+ destroyFns.push(close);
24648
+ return {
24649
+ destroy: close
24650
+ };
24651
+ }
24652
+
24653
+ function destroyAll() {
24654
+ while (destroyFns.length) {
24655
+ var close = destroyFns.pop();
24656
+
24657
+ if (close) {
24658
+ close();
24659
+ }
24660
+ }
24661
+ }
24662
+ function confirm(config) {
24663
+ return renderDialogBox(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, config), {
24664
+ type: 'confirm',
24665
+ cancelBtn: true
24666
+ }));
24667
+ }
24668
+ function success(config) {
24669
+ var _a;
24670
+
24671
+ return renderDialogBox(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, config), {
24672
+ type: 'success',
24673
+ cancelBtn: false,
24674
+ okText: (_a = config.okText) !== null && _a !== void 0 ? _a : '关闭'
24675
+ }));
24676
+ }
24677
+ function info(config) {
24678
+ var _a;
24679
+
24680
+ return renderDialogBox(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, config), {
24681
+ type: 'info',
24682
+ cancelBtn: false,
24683
+ okText: (_a = config.okText) !== null && _a !== void 0 ? _a : '确定'
24684
+ }));
24685
+ }
24686
+ function warning(config) {
24687
+ var _a;
24688
+
24689
+ return renderDialogBox(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, config), {
24690
+ type: 'warning',
24691
+ cancelBtn: false,
24692
+ okText: (_a = config.okText) !== null && _a !== void 0 ? _a : '关闭'
24693
+ }));
24694
+ }
24695
+ function error(config) {
24696
+ var _a;
24697
+
24698
+ return renderDialogBox(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, config), {
24699
+ type: 'error',
24700
+ cancelBtn: false,
24701
+ okText: (_a = config.okText) !== null && _a !== void 0 ? _a : '重试'
24702
+ }));
24703
+ }
24704
+
24705
+ /***/ }),
24706
+
24379
24707
  /***/ "./components/modal/index.tsx":
24380
24708
  /*!************************************!*\
24381
24709
  !*** ./components/modal/index.tsx ***!
@@ -24385,9 +24713,20 @@ Modal.defaultProps = {
24385
24713
 
24386
24714
  "use strict";
24387
24715
  __webpack_require__.r(__webpack_exports__);
24388
- /* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Modal */ "./components/modal/Modal.tsx");
24716
+ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
24717
+ /* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Modal */ "./components/modal/Modal.tsx");
24718
+ /* harmony import */ var _dialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dialog */ "./components/modal/dialog.tsx");
24719
+
24389
24720
 
24390
- /* harmony default export */ __webpack_exports__["default"] = (_Modal__WEBPACK_IMPORTED_MODULE_0__["default"]);
24721
+
24722
+ /* harmony default export */ __webpack_exports__["default"] = (Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])(_Modal__WEBPACK_IMPORTED_MODULE_1__["default"], {
24723
+ confirm: _dialog__WEBPACK_IMPORTED_MODULE_2__["confirm"],
24724
+ success: _dialog__WEBPACK_IMPORTED_MODULE_2__["success"],
24725
+ info: _dialog__WEBPACK_IMPORTED_MODULE_2__["info"],
24726
+ error: _dialog__WEBPACK_IMPORTED_MODULE_2__["error"],
24727
+ warning: _dialog__WEBPACK_IMPORTED_MODULE_2__["warning"],
24728
+ destroyAll: _dialog__WEBPACK_IMPORTED_MODULE_2__["destroyAll"]
24729
+ }));
24391
24730
 
24392
24731
  /***/ }),
24393
24732
 
@@ -41344,7 +41683,7 @@ function getDisabledCompatibleChildren(element, prefixCls) {
41344
41683
  }
41345
41684
 
41346
41685
  var Tooltip = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](function (props, ref) {
41347
- var _classNames2;
41686
+ var _classNames;
41348
41687
 
41349
41688
  var _React$useContext = react__WEBPACK_IMPORTED_MODULE_3__["useContext"](_config_provider__WEBPACK_IMPORTED_MODULE_9__["ConfigContext"]),
41350
41689
  getContextPopupContainer = _React$useContext.getPopupContainer,
@@ -41431,7 +41770,6 @@ var Tooltip = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](func
41431
41770
  };
41432
41771
 
41433
41772
  var customizePrefixCls = props.prefixCls,
41434
- openClassName = props.openClassName,
41435
41773
  getPopupContainer = props.getPopupContainer,
41436
41774
  getTooltipContainer = props.getTooltipContainer,
41437
41775
  overlayClassName = props.overlayClassName,
@@ -41447,9 +41785,7 @@ var Tooltip = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](func
41447
41785
  }
41448
41786
 
41449
41787
  var child = getDisabledCompatibleChildren(Object(_util_reactNode__WEBPACK_IMPORTED_MODULE_8__["isValidElement"])(children) ? children : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["createElement"]("span", null, children), prefixCls);
41450
- var childProps = child.props;
41451
- var childCls = classnames__WEBPACK_IMPORTED_MODULE_6___default()(childProps.className, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, openClassName || "".concat(prefixCls, "-open"), true));
41452
- var customOverlayClassName = classnames__WEBPACK_IMPORTED_MODULE_6___default()(overlayClassName, (_classNames2 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_classNames2, "".concat(prefixCls, "-rtl"), direction === 'rtl'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_classNames2, "".concat(prefixCls, "-").concat(color), color && PresetColorRegex.test(color)), _classNames2));
41788
+ var customOverlayClassName = classnames__WEBPACK_IMPORTED_MODULE_6___default()(overlayClassName, (_classNames = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(_classNames, "".concat(prefixCls, "-").concat(color), color && PresetColorRegex.test(color)), _classNames));
41453
41789
  var formattedOverlayInnerStyle = overlayInnerStyle;
41454
41790
  var arrowContentStyle;
41455
41791
 
@@ -41481,9 +41817,7 @@ var Tooltip = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](func
41481
41817
  motionName: Object(_util_motion__WEBPACK_IMPORTED_MODULE_10__["getTransitionName"])(rootPrefixCls, 'zoom-big-fast', props.transitionName),
41482
41818
  motionDeadline: 1000
41483
41819
  }
41484
- }), tempVisible ? Object(_util_reactNode__WEBPACK_IMPORTED_MODULE_8__["cloneElement"])(child, {
41485
- className: childCls
41486
- }) : child);
41820
+ }), child);
41487
41821
  });
41488
41822
  Tooltip.displayName = 'Tooltip';
41489
41823
  Tooltip.defaultProps = {
@@ -84848,7 +85182,16 @@ var Schema = /*#__PURE__*/function () {
84848
85182
  if (rule.asyncValidator) {
84849
85183
  res = rule.asyncValidator(rule, data.value, cb, data.source, options);
84850
85184
  } else if (rule.validator) {
84851
- res = rule.validator(rule, data.value, cb, data.source, options);
85185
+ try {
85186
+ res = rule.validator(rule, data.value, cb, data.source, options);
85187
+ } catch (error) {
85188
+ console.error == null ? void 0 : console.error(error); // rethrow to report error
85189
+
85190
+ setTimeout(function () {
85191
+ throw error;
85192
+ }, 0);
85193
+ cb(error.message);
85194
+ }
84852
85195
 
84853
85196
  if (res === true) {
84854
85197
  cb();
@@ -85241,8 +85584,8 @@ function getClientPosition(elem) {
85241
85584
  // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
85242
85585
  // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
85243
85586
 
85244
- x = box.left;
85245
- y = box.top; // In IE, most of the time, 2 extra pixels are added to the top and left
85587
+ x = Math.floor(box.left);
85588
+ y = Math.floor(box.top); // In IE, most of the time, 2 extra pixels are added to the top and left
85246
85589
  // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
85247
85590
  // IE6 standards mode, this border can be overridden by setting the
85248
85591
  // document element's border to zero -- thus, we cannot rely on the
@@ -85649,7 +85992,7 @@ function getWH(elem, name, ex) {
85649
85992
  }
85650
85993
 
85651
85994
  var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
85652
- var borderBoxValue = name === 'width' ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height;
85995
+ var borderBoxValue = name === 'width' ? Math.floor(elem.getBoundingClientRect().width) : Math.floor(elem.getBoundingClientRect().height);
85653
85996
  var isBorderBox = isBorderBoxFn(elem);
85654
85997
  var cssBoxValue = 0;
85655
85998
 
@@ -110401,7 +110744,7 @@ module.exports = toString;
110401
110744
  /***/ (function(module, exports) {
110402
110745
 
110403
110746
  //! moment.js
110404
- //! version : 2.29.1
110747
+ //! version : 2.29.3
110405
110748
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
110406
110749
  //! license : MIT
110407
110750
  //! momentjs.com
@@ -110478,8 +110821,9 @@ module.exports = toString;
110478
110821
 
110479
110822
  function map(arr, fn) {
110480
110823
  var res = [],
110481
- i;
110482
- for (i = 0; i < arr.length; ++i) {
110824
+ i,
110825
+ arrLen = arr.length;
110826
+ for (i = 0; i < arrLen; ++i) {
110483
110827
  res.push(fn(arr[i], i));
110484
110828
  }
110485
110829
  return res;
@@ -110608,7 +110952,10 @@ module.exports = toString;
110608
110952
  updateInProgress = false;
110609
110953
 
110610
110954
  function copyConfig(to, from) {
110611
- var i, prop, val;
110955
+ var i,
110956
+ prop,
110957
+ val,
110958
+ momentPropertiesLen = momentProperties.length;
110612
110959
 
110613
110960
  if (!isUndefined(from._isAMomentObject)) {
110614
110961
  to._isAMomentObject = from._isAMomentObject;
@@ -110641,8 +110988,8 @@ module.exports = toString;
110641
110988
  to._locale = from._locale;
110642
110989
  }
110643
110990
 
110644
- if (momentProperties.length > 0) {
110645
- for (i = 0; i < momentProperties.length; i++) {
110991
+ if (momentPropertiesLen > 0) {
110992
+ for (i = 0; i < momentPropertiesLen; i++) {
110646
110993
  prop = momentProperties[i];
110647
110994
  val = from[prop];
110648
110995
  if (!isUndefined(val)) {
@@ -110697,8 +111044,9 @@ module.exports = toString;
110697
111044
  var args = [],
110698
111045
  arg,
110699
111046
  i,
110700
- key;
110701
- for (i = 0; i < arguments.length; i++) {
111047
+ key,
111048
+ argLen = arguments.length;
111049
+ for (i = 0; i < argLen; i++) {
110702
111050
  arg = '';
110703
111051
  if (typeof arguments[i] === 'object') {
110704
111052
  arg += '\n[' + i + '] ';
@@ -110848,7 +111196,8 @@ module.exports = toString;
110848
111196
  );
110849
111197
  }
110850
111198
 
110851
- var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
111199
+ var formattingTokens =
111200
+ /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
110852
111201
  localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
110853
111202
  formatFunctions = {},
110854
111203
  formatTokenFunctions = {};
@@ -111152,8 +111501,9 @@ module.exports = toString;
111152
111501
  if (typeof units === 'object') {
111153
111502
  units = normalizeObjectUnits(units);
111154
111503
  var prioritized = getPrioritizedUnits(units),
111155
- i;
111156
- for (i = 0; i < prioritized.length; i++) {
111504
+ i,
111505
+ prioritizedLen = prioritized.length;
111506
+ for (i = 0; i < prioritizedLen; i++) {
111157
111507
  this[prioritized[i].unit](units[prioritized[i].unit]);
111158
111508
  }
111159
111509
  } else {
@@ -111183,7 +111533,8 @@ module.exports = toString;
111183
111533
  matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
111184
111534
  // any word (or two) characters or numbers including two/three word month in arabic.
111185
111535
  // includes scottish gaelic two word and hyphenated months
111186
- matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
111536
+ matchWord =
111537
+ /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
111187
111538
  regexes;
111188
111539
 
111189
111540
  regexes = {};
@@ -111209,15 +111560,12 @@ module.exports = toString;
111209
111560
  return regexEscape(
111210
111561
  s
111211
111562
  .replace('\\', '')
111212
- .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
111213
- matched,
111214
- p1,
111215
- p2,
111216
- p3,
111217
- p4
111218
- ) {
111219
- return p1 || p2 || p3 || p4;
111220
- })
111563
+ .replace(
111564
+ /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
111565
+ function (matched, p1, p2, p3, p4) {
111566
+ return p1 || p2 || p3 || p4;
111567
+ }
111568
+ )
111221
111569
  );
111222
111570
  }
111223
111571
 
@@ -111229,7 +111577,8 @@ module.exports = toString;
111229
111577
 
111230
111578
  function addParseToken(token, callback) {
111231
111579
  var i,
111232
- func = callback;
111580
+ func = callback,
111581
+ tokenLen;
111233
111582
  if (typeof token === 'string') {
111234
111583
  token = [token];
111235
111584
  }
@@ -111238,7 +111587,8 @@ module.exports = toString;
111238
111587
  array[callback] = toInt(input);
111239
111588
  };
111240
111589
  }
111241
- for (i = 0; i < token.length; i++) {
111590
+ tokenLen = token.length;
111591
+ for (i = 0; i < tokenLen; i++) {
111242
111592
  tokens[token[i]] = func;
111243
111593
  }
111244
111594
  }
@@ -111349,12 +111699,12 @@ module.exports = toString;
111349
111699
 
111350
111700
  // LOCALES
111351
111701
 
111352
- var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
111353
- '_'
111354
- ),
111355
- defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
111356
- '_'
111357
- ),
111702
+ var defaultLocaleMonths =
111703
+ 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
111704
+ '_'
111705
+ ),
111706
+ defaultLocaleMonthsShort =
111707
+ 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
111358
111708
  MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
111359
111709
  defaultMonthsShortRegex = matchWord,
111360
111710
  defaultMonthsRegex = matchWord;
@@ -111796,14 +112146,12 @@ module.exports = toString;
111796
112146
  addRegexToken('W', match1to2);
111797
112147
  addRegexToken('WW', match1to2, match2);
111798
112148
 
111799
- addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
111800
- input,
111801
- week,
111802
- config,
111803
- token
111804
- ) {
111805
- week[token.substr(0, 1)] = toInt(input);
111806
- });
112149
+ addWeekParseToken(
112150
+ ['w', 'ww', 'W', 'WW'],
112151
+ function (input, week, config, token) {
112152
+ week[token.substr(0, 1)] = toInt(input);
112153
+ }
112154
+ );
111807
112155
 
111808
112156
  // HELPERS
111809
112157
 
@@ -111928,9 +112276,8 @@ module.exports = toString;
111928
112276
  return ws.slice(n, 7).concat(ws.slice(0, n));
111929
112277
  }
111930
112278
 
111931
- var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
111932
- '_'
111933
- ),
112279
+ var defaultLocaleWeekdays =
112280
+ 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
111934
112281
  defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
111935
112282
  defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
111936
112283
  defaultWeekdaysRegex = matchWord,
@@ -112478,6 +112825,11 @@ module.exports = toString;
112478
112825
  return globalLocale;
112479
112826
  }
112480
112827
 
112828
+ function isLocaleNameSane(name) {
112829
+ // Prevent names that look like filesystem paths, i.e contain '/' or '\'
112830
+ return name.match('^[^/\\\\]*$') != null;
112831
+ }
112832
+
112481
112833
  function loadLocale(name) {
112482
112834
  var oldLocale = null,
112483
112835
  aliasedRequire;
@@ -112486,7 +112838,8 @@ module.exports = toString;
112486
112838
  locales[name] === undefined &&
112487
112839
  typeof module !== 'undefined' &&
112488
112840
  module &&
112489
- module.exports
112841
+ module.exports &&
112842
+ isLocaleNameSane(name)
112490
112843
  ) {
112491
112844
  try {
112492
112845
  oldLocale = globalLocale._abbr;
@@ -112703,8 +113056,10 @@ module.exports = toString;
112703
113056
 
112704
113057
  // iso 8601 regex
112705
113058
  // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
112706
- var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
112707
- basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
113059
+ var extendedIsoRegex =
113060
+ /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
113061
+ basicIsoRegex =
113062
+ /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
112708
113063
  tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
112709
113064
  isoDates = [
112710
113065
  ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
@@ -112735,7 +113090,8 @@ module.exports = toString;
112735
113090
  ],
112736
113091
  aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
112737
113092
  // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
112738
- rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
113093
+ rfc2822 =
113094
+ /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
112739
113095
  obsOffsets = {
112740
113096
  UT: 0,
112741
113097
  GMT: 0,
@@ -112758,12 +113114,13 @@ module.exports = toString;
112758
113114
  allowTime,
112759
113115
  dateFormat,
112760
113116
  timeFormat,
112761
- tzFormat;
113117
+ tzFormat,
113118
+ isoDatesLen = isoDates.length,
113119
+ isoTimesLen = isoTimes.length;
112762
113120
 
112763
113121
  if (match) {
112764
113122
  getParsingFlags(config).iso = true;
112765
-
112766
- for (i = 0, l = isoDates.length; i < l; i++) {
113123
+ for (i = 0, l = isoDatesLen; i < l; i++) {
112767
113124
  if (isoDates[i][1].exec(match[1])) {
112768
113125
  dateFormat = isoDates[i][0];
112769
113126
  allowTime = isoDates[i][2] !== false;
@@ -112775,7 +113132,7 @@ module.exports = toString;
112775
113132
  return;
112776
113133
  }
112777
113134
  if (match[3]) {
112778
- for (i = 0, l = isoTimes.length; i < l; i++) {
113135
+ for (i = 0, l = isoTimesLen; i < l; i++) {
112779
113136
  if (isoTimes[i][1].exec(match[3])) {
112780
113137
  // match[2] should be 'T' or space
112781
113138
  timeFormat = (match[2] || ' ') + isoTimes[i][0];
@@ -113155,12 +113512,13 @@ module.exports = toString;
113155
113512
  skipped,
113156
113513
  stringLength = string.length,
113157
113514
  totalParsedInputLength = 0,
113158
- era;
113515
+ era,
113516
+ tokenLen;
113159
113517
 
113160
113518
  tokens =
113161
113519
  expandFormat(config._f, config._locale).match(formattingTokens) || [];
113162
-
113163
- for (i = 0; i < tokens.length; i++) {
113520
+ tokenLen = tokens.length;
113521
+ for (i = 0; i < tokenLen; i++) {
113164
113522
  token = tokens[i];
113165
113523
  parsedInput = (string.match(getParseRegexForToken(token, config)) ||
113166
113524
  [])[0];
@@ -113255,15 +113613,16 @@ module.exports = toString;
113255
113613
  i,
113256
113614
  currentScore,
113257
113615
  validFormatFound,
113258
- bestFormatIsValid = false;
113616
+ bestFormatIsValid = false,
113617
+ configfLen = config._f.length;
113259
113618
 
113260
- if (config._f.length === 0) {
113619
+ if (configfLen === 0) {
113261
113620
  getParsingFlags(config).invalidFormat = true;
113262
113621
  config._d = new Date(NaN);
113263
113622
  return;
113264
113623
  }
113265
113624
 
113266
- for (i = 0; i < config._f.length; i++) {
113625
+ for (i = 0; i < configfLen; i++) {
113267
113626
  currentScore = 0;
113268
113627
  validFormatFound = false;
113269
113628
  tempConfig = copyConfig({}, config);
@@ -113504,7 +113863,8 @@ module.exports = toString;
113504
113863
  function isDurationValid(m) {
113505
113864
  var key,
113506
113865
  unitHasDecimal = false,
113507
- i;
113866
+ i,
113867
+ orderLen = ordering.length;
113508
113868
  for (key in m) {
113509
113869
  if (
113510
113870
  hasOwnProp(m, key) &&
@@ -113517,7 +113877,7 @@ module.exports = toString;
113517
113877
  }
113518
113878
  }
113519
113879
 
113520
- for (i = 0; i < ordering.length; ++i) {
113880
+ for (i = 0; i < orderLen; ++i) {
113521
113881
  if (m[ordering[i]]) {
113522
113882
  if (unitHasDecimal) {
113523
113883
  return false; // only allow non-integers for smallest unit
@@ -113842,7 +114202,8 @@ module.exports = toString;
113842
114202
  // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
113843
114203
  // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
113844
114204
  // and further modified to allow for strings containing both week and day
113845
- isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
114205
+ isoRegex =
114206
+ /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
113846
114207
 
113847
114208
  function createDuration(input, key) {
113848
114209
  var duration = input,
@@ -114063,9 +114424,10 @@ module.exports = toString;
114063
114424
  'ms',
114064
114425
  ],
114065
114426
  i,
114066
- property;
114427
+ property,
114428
+ propertyLen = properties.length;
114067
114429
 
114068
- for (i = 0; i < properties.length; i += 1) {
114430
+ for (i = 0; i < propertyLen; i += 1) {
114069
114431
  property = properties[i];
114070
114432
  propertyTest = propertyTest || hasOwnProp(input, property);
114071
114433
  }
@@ -114688,19 +115050,17 @@ module.exports = toString;
114688
115050
  addRegexToken('NNNN', matchEraName);
114689
115051
  addRegexToken('NNNNN', matchEraNarrow);
114690
115052
 
114691
- addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
114692
- input,
114693
- array,
114694
- config,
114695
- token
114696
- ) {
114697
- var era = config._locale.erasParse(input, token, config._strict);
114698
- if (era) {
114699
- getParsingFlags(config).era = era;
114700
- } else {
114701
- getParsingFlags(config).invalidEra = input;
115053
+ addParseToken(
115054
+ ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
115055
+ function (input, array, config, token) {
115056
+ var era = config._locale.erasParse(input, token, config._strict);
115057
+ if (era) {
115058
+ getParsingFlags(config).era = era;
115059
+ } else {
115060
+ getParsingFlags(config).invalidEra = input;
115061
+ }
114702
115062
  }
114703
- });
115063
+ );
114704
115064
 
114705
115065
  addRegexToken('y', matchUnsigned);
114706
115066
  addRegexToken('yy', matchUnsigned);
@@ -114992,14 +115352,12 @@ module.exports = toString;
114992
115352
  addRegexToken('GGGGG', match1to6, match6);
114993
115353
  addRegexToken('ggggg', match1to6, match6);
114994
115354
 
114995
- addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
114996
- input,
114997
- week,
114998
- config,
114999
- token
115000
- ) {
115001
- week[token.substr(0, 2)] = toInt(input);
115002
- });
115355
+ addWeekParseToken(
115356
+ ['gggg', 'ggggg', 'GGGG', 'GGGGG'],
115357
+ function (input, week, config, token) {
115358
+ week[token.substr(0, 2)] = toInt(input);
115359
+ }
115360
+ );
115003
115361
 
115004
115362
  addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
115005
115363
  week[token] = hooks.parseTwoDigitYear(input);
@@ -116022,7 +116380,7 @@ module.exports = toString;
116022
116380
 
116023
116381
  //! moment.js
116024
116382
 
116025
- hooks.version = '2.29.1';
116383
+ hooks.version = '2.29.3';
116026
116384
 
116027
116385
  setHookCallback(createLocal);
116028
116386
 
@@ -116484,6 +116842,8 @@ __webpack_require__.r(__webpack_exports__);
116484
116842
  }
116485
116843
 
116486
116844
  function trigger(force) {
116845
+ cancelTrigger();
116846
+
116487
116847
  if (!calledRef.current || force === true) {
116488
116848
  if (callback() === false) {
116489
116849
  // Not delay since callback cancelled self
@@ -116491,12 +116851,10 @@ __webpack_require__.r(__webpack_exports__);
116491
116851
  }
116492
116852
 
116493
116853
  calledRef.current = true;
116494
- cancelTrigger();
116495
116854
  timeoutRef.current = window.setTimeout(function () {
116496
116855
  calledRef.current = false;
116497
116856
  }, buffer);
116498
116857
  } else {
116499
- cancelTrigger();
116500
116858
  timeoutRef.current = window.setTimeout(function () {
116501
116859
  calledRef.current = false;
116502
116860
  trigger();
@@ -116925,31 +117283,45 @@ var CollapsePanel = /*#__PURE__*/function (_React$Component) {
116925
117283
  extra = _this$props2.extra,
116926
117284
  collapsible = _this$props2.collapsible;
116927
117285
  var disabled = collapsible === 'disabled';
116928
- var headerCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()("".concat(prefixCls, "-header"), (_classNames = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames, headerClass, headerClass), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames, "".concat(prefixCls, "-header-collapsible-only"), collapsible === 'header'), _classNames));
117286
+ var collapsibleHeader = collapsible === 'header';
117287
+ var headerCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()("".concat(prefixCls, "-header"), (_classNames = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames, headerClass, headerClass), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames, "".concat(prefixCls, "-header-collapsible-only"), collapsibleHeader), _classNames));
116929
117288
  var itemCls = classnames__WEBPACK_IMPORTED_MODULE_7___default()((_classNames2 = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames2, "".concat(prefixCls, "-item"), true), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames2, "".concat(prefixCls, "-item-active"), isActive), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_classNames2, "".concat(prefixCls, "-item-disabled"), disabled), _classNames2), className);
116930
117289
  var icon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createElement"]("i", {
116931
117290
  className: "arrow"
116932
117291
  });
117292
+ /** header 节点属性 */
117293
+
117294
+ var headerProps = {
117295
+ className: headerCls,
117296
+ 'aria-expanded': isActive,
117297
+ onKeyPress: this.handleKeyPress
117298
+ };
116933
117299
 
116934
117300
  if (showArrow && typeof expandIcon === 'function') {
116935
117301
  icon = expandIcon(this.props);
116936
117302
  }
116937
117303
 
117304
+ if (collapsibleHeader) {
117305
+ icon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createElement"]("span", {
117306
+ style: {
117307
+ cursor: 'pointer'
117308
+ },
117309
+ onClick: function onClick() {
117310
+ return _this2.handleItemClick();
117311
+ }
117312
+ }, icon);
117313
+ } else {
117314
+ headerProps.onClick = this.handleItemClick;
117315
+ headerProps.role = accordion ? 'tab' : 'button';
117316
+ headerProps.tabIndex = disabled ? -1 : 0;
117317
+ }
117318
+
116938
117319
  var ifExtraExist = extra !== null && extra !== undefined && typeof extra !== 'boolean';
116939
117320
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createElement"]("div", {
116940
117321
  className: itemCls,
116941
117322
  style: style,
116942
117323
  id: id
116943
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createElement"]("div", {
116944
- className: headerCls,
116945
- onClick: function onClick() {
116946
- return collapsible !== 'header' && _this2.handleItemClick();
116947
- },
116948
- role: accordion ? 'tab' : 'button',
116949
- tabIndex: disabled ? -1 : 0,
116950
- "aria-expanded": isActive,
116951
- onKeyPress: this.handleKeyPress
116952
- }, showArrow && icon, collapsible === 'header' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createElement"]("span", {
117324
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createElement"]("div", headerProps, showArrow && icon, collapsibleHeader ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createElement"]("span", {
116953
117325
  onClick: this.handleItemClick,
116954
117326
  className: "".concat(prefixCls, "-header-text")
116955
117327
  }, header) : header, ifExtraExist && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createElement"]("div", {
@@ -119356,7 +119728,9 @@ var Context = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createContext"]({
119356
119728
  registerField: warningFunc,
119357
119729
  useSubscribe: warningFunc,
119358
119730
  setInitialValues: warningFunc,
119731
+ destroyForm: warningFunc,
119359
119732
  setCallbacks: warningFunc,
119733
+ registerWatch: warningFunc,
119360
119734
  getFields: warningFunc,
119361
119735
  setValidateMessages: warningFunc,
119362
119736
  setPreserve: warningFunc,
@@ -119428,7 +119802,8 @@ var Form = function Form(_ref, ref) {
119428
119802
  setInitialValues = _formInstance$getInte.setInitialValues,
119429
119803
  setCallbacks = _formInstance$getInte.setCallbacks,
119430
119804
  setValidateMessages = _formInstance$getInte.setValidateMessages,
119431
- setPreserve = _formInstance$getInte.setPreserve; // Pass ref with form instance
119805
+ setPreserve = _formInstance$getInte.setPreserve,
119806
+ destroyForm = _formInstance$getInte.destroyForm; // Pass ref with form instance
119432
119807
 
119433
119808
 
119434
119809
  react__WEBPACK_IMPORTED_MODULE_4__["useImperativeHandle"](ref, function () {
@@ -119472,15 +119847,21 @@ var Form = function Form(_ref, ref) {
119472
119847
 
119473
119848
  if (!mountRef.current) {
119474
119849
  mountRef.current = true;
119475
- } // Prepare children by `children` type
119850
+ }
119476
119851
 
119852
+ react__WEBPACK_IMPORTED_MODULE_4__["useEffect"](function () {
119853
+ return destroyForm;
119854
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
119855
+ []); // Prepare children by `children` type
119477
119856
 
119478
- var childrenNode = children;
119857
+ var childrenNode;
119479
119858
  var childrenRenderProps = typeof children === 'function';
119480
119859
 
119481
119860
  if (childrenRenderProps) {
119482
119861
  var values = formInstance.getFieldsValue(true);
119483
119862
  childrenNode = children(values, formInstance);
119863
+ } else {
119864
+ childrenNode = children;
119484
119865
  } // Not use subscribe when using render props
119485
119866
 
119486
119867
 
@@ -119811,7 +120192,7 @@ var ListContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createContext
119811
120192
  /*!************************************************!*\
119812
120193
  !*** ./node_modules/rc-field-form/es/index.js ***!
119813
120194
  \************************************************/
119814
- /*! exports provided: Field, List, useForm, FormProvider, FieldContext, ListContext, default */
120195
+ /*! exports provided: Field, List, useForm, FormProvider, FieldContext, ListContext, useWatch, default */
119815
120196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
119816
120197
 
119817
120198
  "use strict";
@@ -119837,6 +120218,10 @@ __webpack_require__.r(__webpack_exports__);
119837
120218
  /* harmony import */ var _ListContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ListContext */ "./node_modules/rc-field-form/es/ListContext.js");
119838
120219
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListContext", function() { return _ListContext__WEBPACK_IMPORTED_MODULE_7__["default"]; });
119839
120220
 
120221
+ /* harmony import */ var _useWatch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./useWatch */ "./node_modules/rc-field-form/es/useWatch.js");
120222
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useWatch", function() { return _useWatch__WEBPACK_IMPORTED_MODULE_8__["default"]; });
120223
+
120224
+
119840
120225
 
119841
120226
 
119842
120227
 
@@ -119851,6 +120236,7 @@ RefForm.FormProvider = _FormContext__WEBPACK_IMPORTED_MODULE_5__["FormProvider"]
119851
120236
  RefForm.Field = _Field__WEBPACK_IMPORTED_MODULE_1__["default"];
119852
120237
  RefForm.List = _List__WEBPACK_IMPORTED_MODULE_2__["default"];
119853
120238
  RefForm.useForm = _useForm__WEBPACK_IMPORTED_MODULE_3__["default"];
120239
+ RefForm.useWatch = _useWatch__WEBPACK_IMPORTED_MODULE_8__["default"];
119854
120240
 
119855
120241
  /* harmony default export */ __webpack_exports__["default"] = (RefForm);
119856
120242
 
@@ -119941,6 +120327,7 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
119941
120327
  setFieldsValue: _this.setFieldsValue,
119942
120328
  validateFields: _this.validateFields,
119943
120329
  submit: _this.submit,
120330
+ _init: true,
119944
120331
  getInternalHooks: _this.getInternalHooks
119945
120332
  };
119946
120333
  };
@@ -119954,11 +120341,13 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
119954
120341
  registerField: _this.registerField,
119955
120342
  useSubscribe: _this.useSubscribe,
119956
120343
  setInitialValues: _this.setInitialValues,
120344
+ destroyForm: _this.destroyForm,
119957
120345
  setCallbacks: _this.setCallbacks,
119958
120346
  setValidateMessages: _this.setValidateMessages,
119959
120347
  getFields: _this.getFields,
119960
120348
  setPreserve: _this.setPreserve,
119961
- getInitialValue: _this.getInitialValue
120349
+ getInitialValue: _this.getInitialValue,
120350
+ registerWatch: _this.registerWatch
119962
120351
  };
119963
120352
  }
119964
120353
 
@@ -119970,16 +120359,44 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
119970
120359
  _this.subscribable = subscribable;
119971
120360
  };
119972
120361
 
120362
+ this.prevWithoutPreserves = null;
120363
+
119973
120364
  this.setInitialValues = function (initialValues, init) {
119974
120365
  _this.initialValues = initialValues || {};
119975
120366
 
119976
120367
  if (init) {
119977
- _this.store = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValues"])({}, _this.store, initialValues);
120368
+ var _this$prevWithoutPres;
120369
+
120370
+ var nextStore = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValues"])({}, initialValues, _this.store); // We will take consider prev form unmount fields.
120371
+ // When the field is not `preserve`, we need fill this with initialValues instead of store.
120372
+ // eslint-disable-next-line array-callback-return
120373
+
120374
+ (_this$prevWithoutPres = _this.prevWithoutPreserves) === null || _this$prevWithoutPres === void 0 ? void 0 : _this$prevWithoutPres.map(function (_ref) {
120375
+ var namePath = _ref.key;
120376
+ nextStore = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(nextStore, namePath, Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["getValue"])(initialValues, namePath));
120377
+ });
120378
+ _this.prevWithoutPreserves = null;
120379
+
120380
+ _this.updateStore(nextStore);
119978
120381
  }
119979
120382
  };
119980
120383
 
120384
+ this.destroyForm = function () {
120385
+ var prevWithoutPreserves = new _utils_NameMap__WEBPACK_IMPORTED_MODULE_10__["default"]();
120386
+
120387
+ _this.getFieldEntities(true).forEach(function (entity) {
120388
+ if (!entity.isPreserve()) {
120389
+ prevWithoutPreserves.set(entity.getNamePath(), true);
120390
+ }
120391
+ });
120392
+
120393
+ _this.prevWithoutPreserves = prevWithoutPreserves;
120394
+ };
120395
+
119981
120396
  this.getInitialValue = function (namePath) {
119982
- return Object(_utils_cloneDeep__WEBPACK_IMPORTED_MODULE_13__["default"])(Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["getValue"])(_this.initialValues, namePath));
120397
+ var initValue = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["getValue"])(_this.initialValues, namePath); // Not cloneDeep when without `namePath`
120398
+
120399
+ return namePath.length ? Object(_utils_cloneDeep__WEBPACK_IMPORTED_MODULE_13__["default"])(initValue) : initValue;
119983
120400
  };
119984
120401
 
119985
120402
  this.setCallbacks = function (callbacks) {
@@ -119994,6 +120411,31 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
119994
120411
  _this.preserve = preserve;
119995
120412
  };
119996
120413
 
120414
+ this.watchList = [];
120415
+
120416
+ this.registerWatch = function (callback) {
120417
+ _this.watchList.push(callback);
120418
+
120419
+ return function () {
120420
+ _this.watchList = _this.watchList.filter(function (fn) {
120421
+ return fn !== callback;
120422
+ });
120423
+ };
120424
+ };
120425
+
120426
+ this.notifyWatch = function () {
120427
+ var namePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
120428
+
120429
+ // No need to cost perf when nothing need to watch
120430
+ if (_this.watchList.length) {
120431
+ var values = _this.getFieldsValue();
120432
+
120433
+ _this.watchList.forEach(function (callback) {
120434
+ callback(values, namePath);
120435
+ });
120436
+ }
120437
+ };
120438
+
119997
120439
  this.timeoutId = null;
119998
120440
 
119999
120441
  this.warningUnhooked = function () {
@@ -120008,6 +120450,10 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120008
120450
  }
120009
120451
  };
120010
120452
 
120453
+ this.updateStore = function (nextStore) {
120454
+ _this.store = nextStore;
120455
+ };
120456
+
120011
120457
  this.getFieldEntities = function () {
120012
120458
  var pure = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
120013
120459
 
@@ -120190,8 +120636,8 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120190
120636
  return entities.some(isFieldTouched);
120191
120637
  };
120192
120638
 
120193
- var namePathListEntities = map.map(function (_ref) {
120194
- var value = _ref.value;
120639
+ var namePathListEntities = map.map(function (_ref2) {
120640
+ var value = _ref2.value;
120195
120641
  return value;
120196
120642
  });
120197
120643
  return isAllFieldsTouched ? namePathListEntities.every(isNamePathListTouched) : namePathListEntities.some(isNamePathListTouched);
@@ -120271,7 +120717,7 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120271
120717
 
120272
120718
 
120273
120719
  if (!info.skipExist || originValue === undefined) {
120274
- _this.store = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(records)[0].value);
120720
+ _this.updateStore(Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(records)[0].value));
120275
120721
  }
120276
120722
  }
120277
120723
  }
@@ -120309,7 +120755,7 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120309
120755
  var prevStore = _this.store;
120310
120756
 
120311
120757
  if (!nameList) {
120312
- _this.store = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValues"])({}, _this.initialValues);
120758
+ _this.updateStore(Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValues"])({}, _this.initialValues));
120313
120759
 
120314
120760
  _this.resetWithFieldInitialValue();
120315
120761
 
@@ -120317,6 +120763,8 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120317
120763
  type: 'reset'
120318
120764
  });
120319
120765
 
120766
+ _this.notifyWatch();
120767
+
120320
120768
  return;
120321
120769
  } // Reset by `nameList`
120322
120770
 
@@ -120325,7 +120773,7 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120325
120773
  namePathList.forEach(function (namePath) {
120326
120774
  var initialValue = _this.getInitialValue(namePath);
120327
120775
 
120328
- _this.store = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, initialValue);
120776
+ _this.updateStore(Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, initialValue));
120329
120777
  });
120330
120778
 
120331
120779
  _this.resetWithFieldInitialValue({
@@ -120335,21 +120783,25 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120335
120783
  _this.notifyObservers(prevStore, namePathList, {
120336
120784
  type: 'reset'
120337
120785
  });
120786
+
120787
+ _this.notifyWatch(namePathList);
120338
120788
  };
120339
120789
 
120340
120790
  this.setFields = function (fields) {
120341
120791
  _this.warningUnhooked();
120342
120792
 
120343
120793
  var prevStore = _this.store;
120794
+ var namePathList = [];
120344
120795
  fields.forEach(function (fieldData) {
120345
120796
  var name = fieldData.name,
120346
120797
  errors = fieldData.errors,
120347
120798
  data = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(fieldData, _excluded);
120348
120799
 
120349
- var namePath = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["getNamePath"])(name); // Value
120800
+ var namePath = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["getNamePath"])(name);
120801
+ namePathList.push(namePath); // Value
120350
120802
 
120351
120803
  if ('value' in data) {
120352
- _this.store = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, data.value);
120804
+ _this.updateStore(Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, data.value));
120353
120805
  }
120354
120806
 
120355
120807
  _this.notifyObservers(prevStore, [namePath], {
@@ -120357,6 +120809,8 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120357
120809
  data: fieldData
120358
120810
  });
120359
120811
  });
120812
+
120813
+ _this.notifyWatch(namePathList);
120360
120814
  };
120361
120815
 
120362
120816
  this.getFields = function () {
@@ -120387,13 +120841,17 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120387
120841
  var prevValue = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["getValue"])(_this.store, namePath);
120388
120842
 
120389
120843
  if (prevValue === undefined) {
120390
- _this.store = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, initialValue);
120844
+ _this.updateStore(Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, initialValue));
120391
120845
  }
120392
120846
  }
120393
120847
  };
120394
120848
 
120395
120849
  this.registerField = function (entity) {
120396
- _this.fieldEntities.push(entity); // Set initial values
120850
+ _this.fieldEntities.push(entity);
120851
+
120852
+ var namePath = entity.getNamePath();
120853
+
120854
+ _this.notifyWatch([namePath]); // Set initial values
120397
120855
 
120398
120856
 
120399
120857
  if (entity.props.initialValue !== undefined) {
@@ -120420,7 +120878,6 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120420
120878
  var mergedPreserve = preserve !== undefined ? preserve : _this.preserve;
120421
120879
 
120422
120880
  if (mergedPreserve === false && (!isListField || subNamePath.length > 1)) {
120423
- var namePath = entity.getNamePath();
120424
120881
  var defaultValue = isListField ? undefined : _this.getInitialValue(namePath);
120425
120882
 
120426
120883
  if (namePath.length && _this.getFieldValue(namePath) !== defaultValue && _this.fieldEntities.every(function (field) {
@@ -120429,7 +120886,9 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120429
120886
  );
120430
120887
  })) {
120431
120888
  var _prevStore = _this.store;
120432
- _this.store = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_prevStore, namePath, defaultValue, true); // Notify that field is unmount
120889
+
120890
+ _this.updateStore(Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_prevStore, namePath, defaultValue, true)); // Notify that field is unmount
120891
+
120433
120892
 
120434
120893
  _this.notifyObservers(_prevStore, [namePath], {
120435
120894
  type: 'remove'
@@ -120439,6 +120898,8 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120439
120898
  _this.triggerDependenciesUpdate(_prevStore, namePath);
120440
120899
  }
120441
120900
  }
120901
+
120902
+ _this.notifyWatch([namePath]);
120442
120903
  };
120443
120904
  };
120444
120905
 
@@ -120477,8 +120938,8 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120477
120938
  store: _this.getFieldsValue(true)
120478
120939
  });
120479
120940
 
120480
- _this.getFieldEntities().forEach(function (_ref2) {
120481
- var onStoreChange = _ref2.onStoreChange;
120941
+ _this.getFieldEntities().forEach(function (_ref3) {
120942
+ var onStoreChange = _ref3.onStoreChange;
120482
120943
  onStoreChange(prevStore, namePathList, mergedInfo);
120483
120944
  });
120484
120945
  } else {
@@ -120504,12 +120965,15 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120504
120965
  this.updateValue = function (name, value) {
120505
120966
  var namePath = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["getNamePath"])(name);
120506
120967
  var prevStore = _this.store;
120507
- _this.store = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, value);
120968
+
120969
+ _this.updateStore(Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValue"])(_this.store, namePath, value));
120508
120970
 
120509
120971
  _this.notifyObservers(prevStore, [namePath], {
120510
120972
  type: 'valueUpdate',
120511
120973
  source: 'internal'
120512
- }); // Dependencies update
120974
+ });
120975
+
120976
+ _this.notifyWatch([namePath]); // Dependencies update
120513
120977
 
120514
120978
 
120515
120979
  var childrenFields = _this.triggerDependenciesUpdate(prevStore, namePath); // trigger callback function
@@ -120531,13 +120995,17 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120531
120995
  var prevStore = _this.store;
120532
120996
 
120533
120997
  if (store) {
120534
- _this.store = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValues"])(_this.store, store);
120998
+ var nextStore = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["setValues"])(_this.store, store);
120999
+
121000
+ _this.updateStore(nextStore);
120535
121001
  }
120536
121002
 
120537
121003
  _this.notifyObservers(prevStore, null, {
120538
121004
  type: 'valueUpdate',
120539
121005
  source: 'external'
120540
121006
  });
121007
+
121008
+ _this.notifyWatch();
120541
121009
  };
120542
121010
 
120543
121011
  this.getDependencyChildrenFields = function (rootNamePath) {
@@ -120592,9 +121060,9 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120592
121060
 
120593
121061
  if (filedErrors) {
120594
121062
  var cache = new _utils_NameMap__WEBPACK_IMPORTED_MODULE_10__["default"]();
120595
- filedErrors.forEach(function (_ref3) {
120596
- var name = _ref3.name,
120597
- errors = _ref3.errors;
121063
+ filedErrors.forEach(function (_ref4) {
121064
+ var name = _ref4.name,
121065
+ errors = _ref4.errors;
120598
121066
  cache.set(name, errors);
120599
121067
  });
120600
121068
  fields.forEach(function (field) {
@@ -120603,8 +121071,8 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120603
121071
  });
120604
121072
  }
120605
121073
 
120606
- var changedFields = fields.filter(function (_ref4) {
120607
- var fieldName = _ref4.name;
121074
+ var changedFields = fields.filter(function (_ref5) {
121075
+ var fieldName = _ref5.name;
120608
121076
  return Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_12__["containsNamePath"])(namePathList, fieldName);
120609
121077
  });
120610
121078
  onFieldsChange(changedFields, fields);
@@ -120663,9 +121131,9 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120663
121131
  }).catch(function (ruleErrors) {
120664
121132
  var mergedErrors = [];
120665
121133
  var mergedWarnings = [];
120666
- ruleErrors.forEach(function (_ref5) {
120667
- var warningOnly = _ref5.rule.warningOnly,
120668
- errors = _ref5.errors;
121134
+ ruleErrors.forEach(function (_ref6) {
121135
+ var warningOnly = _ref6.rule.warningOnly,
121136
+ errors = _ref6.errors;
120669
121137
 
120670
121138
  if (warningOnly) {
120671
121139
  mergedWarnings.push.apply(mergedWarnings, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__["default"])(errors));
@@ -120697,8 +121165,8 @@ var FormStore = /*#__PURE__*/Object(_babel_runtime_helpers_esm_createClass__WEBP
120697
121165
  summaryPromise.catch(function (results) {
120698
121166
  return results;
120699
121167
  }).then(function (results) {
120700
- var resultNamePathList = results.map(function (_ref6) {
120701
- var name = _ref6.name;
121168
+ var resultNamePathList = results.map(function (_ref7) {
121169
+ var name = _ref7.name;
120702
121170
  return name;
120703
121171
  });
120704
121172
 
@@ -120785,6 +121253,96 @@ function useForm(form) {
120785
121253
 
120786
121254
  /***/ }),
120787
121255
 
121256
+ /***/ "./node_modules/rc-field-form/es/useWatch.js":
121257
+ /*!***************************************************!*\
121258
+ !*** ./node_modules/rc-field-form/es/useWatch.js ***!
121259
+ \***************************************************/
121260
+ /*! exports provided: default */
121261
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
121262
+
121263
+ "use strict";
121264
+ __webpack_require__.r(__webpack_exports__);
121265
+ /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
121266
+ /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! . */ "./node_modules/rc-field-form/es/index.js");
121267
+ /* harmony import */ var rc_util_es_warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rc-util/es/warning */ "./node_modules/rc-util/es/warning.js");
121268
+ /* harmony import */ var _FieldContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FieldContext */ "./node_modules/rc-field-form/es/FieldContext.js");
121269
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
121270
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
121271
+ /* harmony import */ var _utils_valueUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/valueUtil */ "./node_modules/rc-field-form/es/utils/valueUtil.js");
121272
+
121273
+
121274
+
121275
+
121276
+
121277
+
121278
+
121279
+ function stringify(value) {
121280
+ try {
121281
+ return JSON.stringify(value);
121282
+ } catch (err) {
121283
+ return Math.random();
121284
+ }
121285
+ }
121286
+
121287
+ function useWatch() {
121288
+ var dependencies = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
121289
+ var form = arguments.length > 1 ? arguments[1] : undefined;
121290
+
121291
+ var _useState = Object(react__WEBPACK_IMPORTED_MODULE_4__["useState"])(),
121292
+ _useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_useState, 2),
121293
+ value = _useState2[0],
121294
+ setValue = _useState2[1];
121295
+
121296
+ var valueStr = Object(react__WEBPACK_IMPORTED_MODULE_4__["useMemo"])(function () {
121297
+ return stringify(value);
121298
+ }, [value]);
121299
+ var valueStrRef = Object(react__WEBPACK_IMPORTED_MODULE_4__["useRef"])(valueStr);
121300
+ valueStrRef.current = valueStr;
121301
+ var fieldContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(___WEBPACK_IMPORTED_MODULE_1__["FieldContext"]);
121302
+ var formInstance = form || fieldContext;
121303
+ var isValidForm = formInstance && formInstance._init; // Warning if not exist form instance
121304
+
121305
+ if (true) {
121306
+ Object(rc_util_es_warning__WEBPACK_IMPORTED_MODULE_2__["default"])(isValidForm, 'useWatch requires a form instance since it can not auto detect from context.');
121307
+ }
121308
+
121309
+ var namePath = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_5__["getNamePath"])(dependencies);
121310
+ var namePathRef = Object(react__WEBPACK_IMPORTED_MODULE_4__["useRef"])(namePath);
121311
+ namePathRef.current = namePath;
121312
+ Object(react__WEBPACK_IMPORTED_MODULE_4__["useEffect"])(function () {
121313
+ // Skip if not exist form instance
121314
+ if (!isValidForm) {
121315
+ return;
121316
+ }
121317
+
121318
+ var getFieldsValue = formInstance.getFieldsValue,
121319
+ getInternalHooks = formInstance.getInternalHooks;
121320
+
121321
+ var _getInternalHooks = getInternalHooks(_FieldContext__WEBPACK_IMPORTED_MODULE_3__["HOOK_MARK"]),
121322
+ registerWatch = _getInternalHooks.registerWatch;
121323
+
121324
+ var cancelRegister = registerWatch(function (store) {
121325
+ var newValue = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_5__["getValue"])(store, namePathRef.current);
121326
+ var nextValueStr = stringify(newValue); // Compare stringify in case it's nest object
121327
+
121328
+ if (valueStrRef.current !== nextValueStr) {
121329
+ setValue(newValue);
121330
+ }
121331
+ }); // TODO: We can improve this perf in future
121332
+
121333
+ var initialValue = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_5__["getValue"])(getFieldsValue(), namePathRef.current);
121334
+ setValue(initialValue);
121335
+ return cancelRegister;
121336
+ }, // We do not need re-register since namePath content is the same
121337
+ // eslint-disable-next-line react-hooks/exhaustive-deps
121338
+ []);
121339
+ return value;
121340
+ }
121341
+
121342
+ /* harmony default export */ __webpack_exports__["default"] = (useWatch);
121343
+
121344
+ /***/ }),
121345
+
120788
121346
  /***/ "./node_modules/rc-field-form/es/utils/NameMap.js":
120789
121347
  /*!********************************************************!*\
120790
121348
  !*** ./node_modules/rc-field-form/es/utils/NameMap.js ***!
@@ -121115,6 +121673,8 @@ function replaceMessage(template, kv) {
121115
121673
  });
121116
121674
  }
121117
121675
 
121676
+ var CODE_LOGIC_ERROR = 'CODE_LOGIC_ERROR';
121677
+
121118
121678
  function validateRule(_x, _x2, _x3, _x4, _x5) {
121119
121679
  return _validateRule.apply(this, arguments);
121120
121680
  }
@@ -121126,7 +121686,7 @@ function validateRule(_x, _x2, _x3, _x4, _x5) {
121126
121686
 
121127
121687
  function _validateRule() {
121128
121688
  _validateRule = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee2(name, value, rule, options, messageVariables) {
121129
- var cloneRule, subRuleField, validator, messages, result, subResults, kv, fillVariableResult;
121689
+ var cloneRule, originValidator, subRuleField, validator, messages, result, subResults, kv, fillVariableResult;
121130
121690
  return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee2$(_context2) {
121131
121691
  while (1) {
121132
121692
  switch (_context2.prev = _context2.next) {
@@ -121135,7 +121695,21 @@ function _validateRule() {
121135
121695
  // https://github.com/react-component/field-form/issues/316
121136
121696
  // https://github.com/react-component/field-form/issues/313
121137
121697
 
121138
- delete cloneRule.ruleIndex; // We should special handle array validate
121698
+ delete cloneRule.ruleIndex;
121699
+
121700
+ if (cloneRule.validator) {
121701
+ originValidator = cloneRule.validator;
121702
+
121703
+ cloneRule.validator = function () {
121704
+ try {
121705
+ return originValidator.apply(void 0, arguments);
121706
+ } catch (error) {
121707
+ console.error(error);
121708
+ return Promise.reject(CODE_LOGIC_ERROR);
121709
+ }
121710
+ };
121711
+ } // We should special handle array validate
121712
+
121139
121713
 
121140
121714
  subRuleField = null;
121141
121715
 
@@ -121148,52 +121722,49 @@ function _validateRule() {
121148
121722
  messages = Object(_valueUtil__WEBPACK_IMPORTED_MODULE_9__["setValues"])({}, _messages__WEBPACK_IMPORTED_MODULE_8__["defaultValidateMessages"], options.validateMessages);
121149
121723
  validator.messages(messages);
121150
121724
  result = [];
121151
- _context2.prev = 8;
121152
- _context2.next = 11;
121725
+ _context2.prev = 9;
121726
+ _context2.next = 12;
121153
121727
  return Promise.resolve(validator.validate(Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])({}, name, value), Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__["default"])({}, options)));
121154
121728
 
121155
- case 11:
121156
- _context2.next = 16;
121729
+ case 12:
121730
+ _context2.next = 17;
121157
121731
  break;
121158
121732
 
121159
- case 13:
121160
- _context2.prev = 13;
121161
- _context2.t0 = _context2["catch"](8);
121733
+ case 14:
121734
+ _context2.prev = 14;
121735
+ _context2.t0 = _context2["catch"](9);
121162
121736
 
121163
121737
  if (_context2.t0.errors) {
121164
121738
  result = _context2.t0.errors.map(function (_ref4, index) {
121165
121739
  var message = _ref4.message;
121166
- return (// Wrap ReactNode with `key`
121167
-
121168
- /*#__PURE__*/
121169
- react__WEBPACK_IMPORTED_MODULE_6__["isValidElement"](message) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["cloneElement"](message, {
121170
- key: "error_".concat(index)
121171
- }) : message
121172
- );
121740
+ var mergedMessage = message === CODE_LOGIC_ERROR ? messages.default : message;
121741
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["isValidElement"](mergedMessage) ?
121742
+ /*#__PURE__*/
121743
+ // Wrap ReactNode with `key`
121744
+ react__WEBPACK_IMPORTED_MODULE_6__["cloneElement"](mergedMessage, {
121745
+ key: "error_".concat(index)
121746
+ }) : mergedMessage;
121173
121747
  });
121174
- } else {
121175
- console.error(_context2.t0);
121176
- result = [messages.default];
121177
121748
  }
121178
121749
 
121179
- case 16:
121750
+ case 17:
121180
121751
  if (!(!result.length && subRuleField)) {
121181
- _context2.next = 21;
121752
+ _context2.next = 22;
121182
121753
  break;
121183
121754
  }
121184
121755
 
121185
- _context2.next = 19;
121756
+ _context2.next = 20;
121186
121757
  return Promise.all(value.map(function (subValue, i) {
121187
121758
  return validateRule("".concat(name, ".").concat(i), subValue, subRuleField, options, messageVariables);
121188
121759
  }));
121189
121760
 
121190
- case 19:
121761
+ case 20:
121191
121762
  subResults = _context2.sent;
121192
121763
  return _context2.abrupt("return", subResults.reduce(function (prev, errors) {
121193
121764
  return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(prev), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(errors));
121194
121765
  }, []));
121195
121766
 
121196
- case 21:
121767
+ case 22:
121197
121768
  // Replace message with variables
121198
121769
  kv = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__["default"])({}, rule), {}, {
121199
121770
  name: name,
@@ -121208,12 +121779,12 @@ function _validateRule() {
121208
121779
  });
121209
121780
  return _context2.abrupt("return", fillVariableResult);
121210
121781
 
121211
- case 24:
121782
+ case 25:
121212
121783
  case "end":
121213
121784
  return _context2.stop();
121214
121785
  }
121215
121786
  }
121216
- }, _callee2, null, [[8, 13]]);
121787
+ }, _callee2, null, [[9, 14]]);
121217
121788
  }));
121218
121789
  return _validateRule.apply(this, arguments);
121219
121790
  }
@@ -123638,7 +124209,12 @@ function Overflow(props, ref) {
123638
124209
  }
123639
124210
 
123640
124211
  for (var i = 0; i < len; i += 1) {
123641
- var currentItemWidth = getItemWidth(i); // Break since data not ready
124212
+ var currentItemWidth = getItemWidth(i); // Fully will always render
124213
+
124214
+ if (fullySSR) {
124215
+ currentItemWidth = currentItemWidth || 0;
124216
+ } // Break since data not ready
124217
+
123642
124218
 
123643
124219
  if (currentItemWidth === undefined) {
123644
124220
  updateDisplayCount(i - 1, true);
@@ -127585,11 +128161,16 @@ var RefNodeList = function RefNodeList(props, ref) {
127585
128161
  var _React$useState9 = react__WEBPACK_IMPORTED_MODULE_3__["useState"](null),
127586
128162
  _React$useState10 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_React$useState9, 2),
127587
128163
  motionType = _React$useState10[0],
127588
- setMotionType = _React$useState10[1];
128164
+ setMotionType = _React$useState10[1]; // When motion end but data change, this will makes data back to previous one
128165
+
128166
+
128167
+ var dataRef = react__WEBPACK_IMPORTED_MODULE_3__["useRef"](data);
128168
+ dataRef.current = data;
127589
128169
 
127590
128170
  function onMotionEnd() {
127591
- setPrevData(data);
127592
- setTransitionData(data);
128171
+ var latestData = dataRef.current;
128172
+ setPrevData(latestData);
128173
+ setTransitionData(latestData);
127593
128174
  setTransitionRange([]);
127594
128175
  setMotionType(null);
127595
128176
  onListChangeEnd();
@@ -128150,24 +128731,56 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128150
128731
  _this.currentMouseOverDroppableNodeKey = null;
128151
128732
  };
128152
128733
 
128734
+ _this.triggerExpandActionExpand = function (e, treeNode) {
128735
+ var _this$state5 = _this.state,
128736
+ expandedKeys = _this$state5.expandedKeys,
128737
+ flattenNodes = _this$state5.flattenNodes;
128738
+ var expanded = treeNode.expanded,
128739
+ key = treeNode.key;
128740
+ var node = flattenNodes.filter(function (nodeItem) {
128741
+ return nodeItem.key === key;
128742
+ })[0];
128743
+ var eventNode = Object(_utils_treeUtil__WEBPACK_IMPORTED_MODULE_17__["convertNodePropsToEventData"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__["default"])({}, Object(_utils_treeUtil__WEBPACK_IMPORTED_MODULE_17__["getTreeNodeProps"])(key, _this.getTreeNodeRequiredProps())), {}, {
128744
+ data: node.data
128745
+ }));
128746
+
128747
+ _this.setExpandedKeys(expanded ? Object(_util__WEBPACK_IMPORTED_MODULE_16__["arrDel"])(expandedKeys, key) : Object(_util__WEBPACK_IMPORTED_MODULE_16__["arrAdd"])(expandedKeys, key));
128748
+
128749
+ _this.onNodeExpand(e, eventNode);
128750
+ };
128751
+
128153
128752
  _this.onNodeClick = function (e, treeNode) {
128154
- var onClick = _this.props.onClick;
128753
+ var _this$props3 = _this.props,
128754
+ onClick = _this$props3.onClick,
128755
+ expandAction = _this$props3.expandAction;
128756
+
128757
+ if (expandAction === 'click') {
128758
+ _this.triggerExpandActionExpand(e, treeNode);
128759
+ }
128760
+
128155
128761
  onClick === null || onClick === void 0 ? void 0 : onClick(e, treeNode);
128156
128762
  };
128157
128763
 
128158
128764
  _this.onNodeDoubleClick = function (e, treeNode) {
128159
- var onDoubleClick = _this.props.onDoubleClick;
128765
+ var _this$props4 = _this.props,
128766
+ onDoubleClick = _this$props4.onDoubleClick,
128767
+ expandAction = _this$props4.expandAction;
128768
+
128769
+ if (expandAction === 'doubleClick') {
128770
+ _this.triggerExpandActionExpand(e, treeNode);
128771
+ }
128772
+
128160
128773
  onDoubleClick === null || onDoubleClick === void 0 ? void 0 : onDoubleClick(e, treeNode);
128161
128774
  };
128162
128775
 
128163
128776
  _this.onNodeSelect = function (e, treeNode) {
128164
128777
  var selectedKeys = _this.state.selectedKeys;
128165
- var _this$state5 = _this.state,
128166
- keyEntities = _this$state5.keyEntities,
128167
- fieldNames = _this$state5.fieldNames;
128168
- var _this$props3 = _this.props,
128169
- onSelect = _this$props3.onSelect,
128170
- multiple = _this$props3.multiple;
128778
+ var _this$state6 = _this.state,
128779
+ keyEntities = _this$state6.keyEntities,
128780
+ fieldNames = _this$state6.fieldNames;
128781
+ var _this$props5 = _this.props,
128782
+ onSelect = _this$props5.onSelect,
128783
+ multiple = _this$props5.multiple;
128171
128784
  var selected = treeNode.selected;
128172
128785
  var key = treeNode[fieldNames.key];
128173
128786
  var targetSelected = !selected; // Update selected keys
@@ -128203,13 +128816,13 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128203
128816
  };
128204
128817
 
128205
128818
  _this.onNodeCheck = function (e, treeNode, checked) {
128206
- var _this$state6 = _this.state,
128207
- keyEntities = _this$state6.keyEntities,
128208
- oriCheckedKeys = _this$state6.checkedKeys,
128209
- oriHalfCheckedKeys = _this$state6.halfCheckedKeys;
128210
- var _this$props4 = _this.props,
128211
- checkStrictly = _this$props4.checkStrictly,
128212
- onCheck = _this$props4.onCheck;
128819
+ var _this$state7 = _this.state,
128820
+ keyEntities = _this$state7.keyEntities,
128821
+ oriCheckedKeys = _this$state7.checkedKeys,
128822
+ oriHalfCheckedKeys = _this$state7.halfCheckedKeys;
128823
+ var _this$props6 = _this.props,
128824
+ checkStrictly = _this$props6.checkStrictly,
128825
+ onCheck = _this$props6.onCheck;
128213
128826
  var key = treeNode.key; // Prepare trigger arguments
128214
128827
 
128215
128828
  var checkedObj;
@@ -128295,9 +128908,9 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128295
128908
  loadedKeys = _ref$loadedKeys === void 0 ? [] : _ref$loadedKeys,
128296
128909
  _ref$loadingKeys = _ref.loadingKeys,
128297
128910
  loadingKeys = _ref$loadingKeys === void 0 ? [] : _ref$loadingKeys;
128298
- var _this$props5 = _this.props,
128299
- loadData = _this$props5.loadData,
128300
- onLoad = _this$props5.onLoad;
128911
+ var _this$props7 = _this.props,
128912
+ loadData = _this$props7.loadData,
128913
+ onLoad = _this$props7.onLoad;
128301
128914
 
128302
128915
  if (!loadData || loadedKeys.indexOf(key) !== -1 || loadingKeys.indexOf(key) !== -1) {
128303
128916
  return null;
@@ -128418,16 +129031,16 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128418
129031
  };
128419
129032
 
128420
129033
  _this.getTreeNodeRequiredProps = function () {
128421
- var _this$state7 = _this.state,
128422
- expandedKeys = _this$state7.expandedKeys,
128423
- selectedKeys = _this$state7.selectedKeys,
128424
- loadedKeys = _this$state7.loadedKeys,
128425
- loadingKeys = _this$state7.loadingKeys,
128426
- checkedKeys = _this$state7.checkedKeys,
128427
- halfCheckedKeys = _this$state7.halfCheckedKeys,
128428
- dragOverNodeKey = _this$state7.dragOverNodeKey,
128429
- dropPosition = _this$state7.dropPosition,
128430
- keyEntities = _this$state7.keyEntities;
129034
+ var _this$state8 = _this.state,
129035
+ expandedKeys = _this$state8.expandedKeys,
129036
+ selectedKeys = _this$state8.selectedKeys,
129037
+ loadedKeys = _this$state8.loadedKeys,
129038
+ loadingKeys = _this$state8.loadingKeys,
129039
+ checkedKeys = _this$state8.checkedKeys,
129040
+ halfCheckedKeys = _this$state8.halfCheckedKeys,
129041
+ dragOverNodeKey = _this$state8.dragOverNodeKey,
129042
+ dropPosition = _this$state8.dropPosition,
129043
+ keyEntities = _this$state8.keyEntities;
128431
129044
  return {
128432
129045
  expandedKeys: expandedKeys || [],
128433
129046
  selectedKeys: selectedKeys || [],
@@ -128442,9 +129055,9 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128442
129055
  };
128443
129056
 
128444
129057
  _this.setExpandedKeys = function (expandedKeys) {
128445
- var _this$state8 = _this.state,
128446
- treeData = _this$state8.treeData,
128447
- fieldNames = _this$state8.fieldNames;
129058
+ var _this$state9 = _this.state,
129059
+ treeData = _this$state9.treeData,
129060
+ fieldNames = _this$state9.fieldNames;
128448
129061
  var flattenNodes = Object(_utils_treeUtil__WEBPACK_IMPORTED_MODULE_17__["flattenTreeData"])(treeData, expandedKeys, fieldNames);
128449
129062
 
128450
129063
  _this.setUncontrolledState({
@@ -128455,12 +129068,12 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128455
129068
 
128456
129069
  _this.onNodeExpand = function (e, treeNode) {
128457
129070
  var expandedKeys = _this.state.expandedKeys;
128458
- var _this$state9 = _this.state,
128459
- listChanging = _this$state9.listChanging,
128460
- fieldNames = _this$state9.fieldNames;
128461
- var _this$props6 = _this.props,
128462
- onExpand = _this$props6.onExpand,
128463
- loadData = _this$props6.loadData;
129071
+ var _this$state10 = _this.state,
129072
+ listChanging = _this$state10.listChanging,
129073
+ fieldNames = _this$state10.fieldNames;
129074
+ var _this$props8 = _this.props,
129075
+ onExpand = _this$props8.onExpand,
129076
+ loadData = _this$props8.loadData;
128464
129077
  var expanded = treeNode.expanded;
128465
129078
  var key = treeNode[fieldNames.key]; // Do nothing when motion is in progress
128466
129079
 
@@ -128544,9 +129157,9 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128544
129157
  };
128545
129158
 
128546
129159
  _this.getActiveItem = function () {
128547
- var _this$state10 = _this.state,
128548
- activeKey = _this$state10.activeKey,
128549
- flattenNodes = _this$state10.flattenNodes;
129160
+ var _this$state11 = _this.state,
129161
+ activeKey = _this$state11.activeKey,
129162
+ flattenNodes = _this$state11.flattenNodes;
128550
129163
 
128551
129164
  if (activeKey === null) {
128552
129165
  return null;
@@ -128559,9 +129172,9 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128559
129172
  };
128560
129173
 
128561
129174
  _this.offsetActiveKey = function (offset) {
128562
- var _this$state11 = _this.state,
128563
- flattenNodes = _this$state11.flattenNodes,
128564
- activeKey = _this$state11.activeKey;
129175
+ var _this$state12 = _this.state,
129176
+ flattenNodes = _this$state12.flattenNodes,
129177
+ activeKey = _this$state12.activeKey;
128565
129178
  var index = flattenNodes.findIndex(function (_ref3) {
128566
129179
  var key = _ref3.key;
128567
129180
  return key === activeKey;
@@ -128584,14 +129197,14 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128584
129197
  };
128585
129198
 
128586
129199
  _this.onKeyDown = function (event) {
128587
- var _this$state12 = _this.state,
128588
- activeKey = _this$state12.activeKey,
128589
- expandedKeys = _this$state12.expandedKeys,
128590
- checkedKeys = _this$state12.checkedKeys;
128591
- var _this$props7 = _this.props,
128592
- onKeyDown = _this$props7.onKeyDown,
128593
- checkable = _this$props7.checkable,
128594
- selectable = _this$props7.selectable; // >>>>>>>>>> Direction
129200
+ var _this$state13 = _this.state,
129201
+ activeKey = _this$state13.activeKey,
129202
+ expandedKeys = _this$state13.expandedKeys,
129203
+ checkedKeys = _this$state13.checkedKeys;
129204
+ var _this$props9 = _this.props,
129205
+ onKeyDown = _this$props9.onKeyDown,
129206
+ checkable = _this$props9.checkable,
129207
+ selectable = _this$props9.selectable; // >>>>>>>>>> Direction
128595
129208
 
128596
129209
  switch (event.which) {
128597
129210
  case rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_11__["default"].UP:
@@ -128751,47 +129364,47 @@ var Tree = /*#__PURE__*/function (_React$Component) {
128751
129364
  value: function render() {
128752
129365
  var _classNames;
128753
129366
 
128754
- var _this$state13 = this.state,
128755
- focused = _this$state13.focused,
128756
- flattenNodes = _this$state13.flattenNodes,
128757
- keyEntities = _this$state13.keyEntities,
128758
- draggingNodeKey = _this$state13.draggingNodeKey,
128759
- activeKey = _this$state13.activeKey,
128760
- dropLevelOffset = _this$state13.dropLevelOffset,
128761
- dropContainerKey = _this$state13.dropContainerKey,
128762
- dropTargetKey = _this$state13.dropTargetKey,
128763
- dropPosition = _this$state13.dropPosition,
128764
- dragOverNodeKey = _this$state13.dragOverNodeKey,
128765
- indent = _this$state13.indent;
128766
- var _this$props8 = this.props,
128767
- prefixCls = _this$props8.prefixCls,
128768
- className = _this$props8.className,
128769
- style = _this$props8.style,
128770
- showLine = _this$props8.showLine,
128771
- focusable = _this$props8.focusable,
128772
- _this$props8$tabIndex = _this$props8.tabIndex,
128773
- tabIndex = _this$props8$tabIndex === void 0 ? 0 : _this$props8$tabIndex,
128774
- selectable = _this$props8.selectable,
128775
- showIcon = _this$props8.showIcon,
128776
- icon = _this$props8.icon,
128777
- switcherIcon = _this$props8.switcherIcon,
128778
- draggable = _this$props8.draggable,
128779
- checkable = _this$props8.checkable,
128780
- checkStrictly = _this$props8.checkStrictly,
128781
- disabled = _this$props8.disabled,
128782
- motion = _this$props8.motion,
128783
- loadData = _this$props8.loadData,
128784
- filterTreeNode = _this$props8.filterTreeNode,
128785
- height = _this$props8.height,
128786
- itemHeight = _this$props8.itemHeight,
128787
- virtual = _this$props8.virtual,
128788
- titleRender = _this$props8.titleRender,
128789
- dropIndicatorRender = _this$props8.dropIndicatorRender,
128790
- onContextMenu = _this$props8.onContextMenu,
128791
- onScroll = _this$props8.onScroll,
128792
- direction = _this$props8.direction,
128793
- rootClassName = _this$props8.rootClassName,
128794
- rootStyle = _this$props8.rootStyle;
129367
+ var _this$state14 = this.state,
129368
+ focused = _this$state14.focused,
129369
+ flattenNodes = _this$state14.flattenNodes,
129370
+ keyEntities = _this$state14.keyEntities,
129371
+ draggingNodeKey = _this$state14.draggingNodeKey,
129372
+ activeKey = _this$state14.activeKey,
129373
+ dropLevelOffset = _this$state14.dropLevelOffset,
129374
+ dropContainerKey = _this$state14.dropContainerKey,
129375
+ dropTargetKey = _this$state14.dropTargetKey,
129376
+ dropPosition = _this$state14.dropPosition,
129377
+ dragOverNodeKey = _this$state14.dragOverNodeKey,
129378
+ indent = _this$state14.indent;
129379
+ var _this$props10 = this.props,
129380
+ prefixCls = _this$props10.prefixCls,
129381
+ className = _this$props10.className,
129382
+ style = _this$props10.style,
129383
+ showLine = _this$props10.showLine,
129384
+ focusable = _this$props10.focusable,
129385
+ _this$props10$tabInde = _this$props10.tabIndex,
129386
+ tabIndex = _this$props10$tabInde === void 0 ? 0 : _this$props10$tabInde,
129387
+ selectable = _this$props10.selectable,
129388
+ showIcon = _this$props10.showIcon,
129389
+ icon = _this$props10.icon,
129390
+ switcherIcon = _this$props10.switcherIcon,
129391
+ draggable = _this$props10.draggable,
129392
+ checkable = _this$props10.checkable,
129393
+ checkStrictly = _this$props10.checkStrictly,
129394
+ disabled = _this$props10.disabled,
129395
+ motion = _this$props10.motion,
129396
+ loadData = _this$props10.loadData,
129397
+ filterTreeNode = _this$props10.filterTreeNode,
129398
+ height = _this$props10.height,
129399
+ itemHeight = _this$props10.itemHeight,
129400
+ virtual = _this$props10.virtual,
129401
+ titleRender = _this$props10.titleRender,
129402
+ dropIndicatorRender = _this$props10.dropIndicatorRender,
129403
+ onContextMenu = _this$props10.onContextMenu,
129404
+ onScroll = _this$props10.onScroll,
129405
+ direction = _this$props10.direction,
129406
+ rootClassName = _this$props10.rootClassName,
129407
+ rootStyle = _this$props10.rootStyle;
128795
129408
  var domProps = Object(rc_util_es_pickAttrs__WEBPACK_IMPORTED_MODULE_13__["default"])(this.props, {
128796
129409
  aria: true,
128797
129410
  data: true
@@ -129024,7 +129637,8 @@ Tree.defaultProps = {
129024
129637
  dropIndicatorRender: _DropIndicator__WEBPACK_IMPORTED_MODULE_21__["default"],
129025
129638
  allowDrop: function allowDrop() {
129026
129639
  return true;
129027
- }
129640
+ },
129641
+ expandAction: false
129028
129642
  };
129029
129643
  Tree.TreeNode = _TreeNode__WEBPACK_IMPORTED_MODULE_19__["default"];
129030
129644
  /* harmony default export */ __webpack_exports__["default"] = (Tree);
@@ -130846,12 +131460,14 @@ __webpack_require__.r(__webpack_exports__);
130846
131460
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
130847
131461
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
130848
131462
  /* harmony import */ var rc_align__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rc-align */ "./node_modules/rc-align/es/index.js");
130849
- /* harmony import */ var rc_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rc-motion */ "./node_modules/rc-motion/es/index.js");
130850
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
130851
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__);
130852
- /* harmony import */ var _useVisibleStatus__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./useVisibleStatus */ "./node_modules/rc-trigger/es/Popup/useVisibleStatus.js");
130853
- /* harmony import */ var _utils_legacyUtil__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/legacyUtil */ "./node_modules/rc-trigger/es/utils/legacyUtil.js");
130854
- /* harmony import */ var _useStretchStyle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./useStretchStyle */ "./node_modules/rc-trigger/es/Popup/useStretchStyle.js");
131463
+ /* harmony import */ var rc_util_es_hooks_useLayoutEffect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rc-util/es/hooks/useLayoutEffect */ "./node_modules/rc-util/es/hooks/useLayoutEffect.js");
131464
+ /* harmony import */ var rc_motion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rc-motion */ "./node_modules/rc-motion/es/index.js");
131465
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
131466
+ /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__);
131467
+ /* harmony import */ var _useVisibleStatus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./useVisibleStatus */ "./node_modules/rc-trigger/es/Popup/useVisibleStatus.js");
131468
+ /* harmony import */ var _utils_legacyUtil__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/legacyUtil */ "./node_modules/rc-trigger/es/utils/legacyUtil.js");
131469
+ /* harmony import */ var _useStretchStyle__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./useStretchStyle */ "./node_modules/rc-trigger/es/Popup/useStretchStyle.js");
131470
+
130855
131471
 
130856
131472
 
130857
131473
 
@@ -130891,7 +131507,7 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
130891
131507
  setAlignedClassName = _useState2[1]; // ======================= Measure ========================
130892
131508
 
130893
131509
 
130894
- var _useStretchStyle = Object(_useStretchStyle__WEBPACK_IMPORTED_MODULE_9__["default"])(stretch),
131510
+ var _useStretchStyle = Object(_useStretchStyle__WEBPACK_IMPORTED_MODULE_10__["default"])(stretch),
130895
131511
  _useStretchStyle2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useStretchStyle, 2),
130896
131512
  stretchStyle = _useStretchStyle2[0],
130897
131513
  measureStretchStyle = _useStretchStyle2[1];
@@ -130903,13 +131519,32 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
130903
131519
  } // ======================== Status ========================
130904
131520
 
130905
131521
 
130906
- var _useVisibleStatus = Object(_useVisibleStatus__WEBPACK_IMPORTED_MODULE_7__["default"])(visible, doMeasure),
131522
+ var _useVisibleStatus = Object(_useVisibleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(visible, doMeasure),
130907
131523
  _useVisibleStatus2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useVisibleStatus, 2),
130908
131524
  status = _useVisibleStatus2[0],
130909
131525
  goNextStatus = _useVisibleStatus2[1]; // ======================== Aligns ========================
130910
131526
 
131527
+ /**
131528
+ * `alignedClassName` may modify `source` size,
131529
+ * which means one time align may not move to the correct position at once.
131530
+ *
131531
+ * We will reset `alignTimes` for each status switch to `alignPre`
131532
+ * and let `rc-align` to align for multiple times to ensure get final stable place.
131533
+ * Currently we mark `alignTimes < 2` repeat align, it will increase if user report for align issue.
131534
+ */
131535
+
131536
+
131537
+ var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(0),
131538
+ _useState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState3, 2),
131539
+ alignTimes = _useState4[0],
131540
+ setAlignTimes = _useState4[1];
130911
131541
 
130912
- var prepareResolveRef = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(); // `target` on `rc-align` can accept as a function to get the bind element or a point.
131542
+ var prepareResolveRef = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])();
131543
+ Object(rc_util_es_hooks_useLayoutEffect__WEBPACK_IMPORTED_MODULE_5__["default"])(function () {
131544
+ if (status === 'alignPre') {
131545
+ setAlignTimes(0);
131546
+ }
131547
+ }, [status]); // `target` on `rc-align` can accept as a function to get the bind element or a point.
130913
131548
  // ref: https://www.npmjs.com/package/rc-align
130914
131549
 
130915
131550
  function getAlignTarget() {
@@ -130931,14 +131566,24 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
130931
131566
 
130932
131567
  if (alignedClassName !== nextAlignedClassName) {
130933
131568
  setAlignedClassName(nextAlignedClassName);
131569
+ } // We will retry multi times to make sure that the element has been align in the right position.
131570
+
131571
+
131572
+ setAlignTimes(function (val) {
131573
+ return val + 1;
131574
+ });
131575
+
131576
+ if (status === 'align') {
131577
+ onAlign === null || onAlign === void 0 ? void 0 : onAlign(popupDomNode, matchAlign);
130934
131578
  }
131579
+ } // Delay to go to next status
131580
+
130935
131581
 
131582
+ Object(rc_util_es_hooks_useLayoutEffect__WEBPACK_IMPORTED_MODULE_5__["default"])(function () {
130936
131583
  if (status === 'align') {
130937
131584
  // Repeat until not more align needed
130938
- if (alignedClassName !== nextAlignedClassName) {
130939
- Promise.resolve().then(function () {
130940
- forceAlign();
130941
- });
131585
+ if (alignTimes < 2) {
131586
+ forceAlign();
130942
131587
  } else {
130943
131588
  goNextStatus(function () {
130944
131589
  var _prepareResolveRef$cu;
@@ -130946,13 +131591,10 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
130946
131591
  (_prepareResolveRef$cu = prepareResolveRef.current) === null || _prepareResolveRef$cu === void 0 ? void 0 : _prepareResolveRef$cu.call(prepareResolveRef);
130947
131592
  });
130948
131593
  }
130949
-
130950
- onAlign === null || onAlign === void 0 ? void 0 : onAlign(popupDomNode, matchAlign);
130951
131594
  }
130952
- } // ======================== Motion ========================
131595
+ }, [alignTimes]); // ======================== Motion ========================
130953
131596
 
130954
-
130955
- var motion = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["default"])({}, Object(_utils_legacyUtil__WEBPACK_IMPORTED_MODULE_8__["getMotion"])(props));
131597
+ var motion = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["default"])({}, Object(_utils_legacyUtil__WEBPACK_IMPORTED_MODULE_9__["getMotion"])(props));
130956
131598
 
130957
131599
  ['onAppearEnd', 'onEnterEnd', 'onLeaveEnd'].forEach(function (eventName) {
130958
131600
  var originHandler = motion[eventName];
@@ -130988,7 +131630,9 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
130988
131630
  var mergedStyle = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["default"])({}, stretchStyle), {}, {
130989
131631
  zIndex: zIndex,
130990
131632
  opacity: status === 'motion' || status === 'stable' || !visible ? undefined : 0,
130991
- pointerEvents: status === 'stable' ? undefined : 'none'
131633
+ // Cannot interact with disappearing elements
131634
+ // https://github.com/ant-design/ant-design/issues/35051#issuecomment-1101340714
131635
+ pointerEvents: !visible && status !== 'stable' ? 'none' : undefined
130992
131636
  }, style); // Align status
130993
131637
 
130994
131638
 
@@ -131006,7 +131650,7 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
131006
131650
  }, children);
131007
131651
  }
131008
131652
 
131009
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["createElement"](rc_motion__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
131653
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["createElement"](rc_motion__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
131010
131654
  visible: visible,
131011
131655
  ref: elementRef,
131012
131656
  leavedClassName: "".concat(prefixCls, "-hidden")
@@ -131018,7 +131662,7 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
131018
131662
  }), function (_ref, motionRef) {
131019
131663
  var motionClassName = _ref.className,
131020
131664
  motionStyle = _ref.style;
131021
- var mergedClassName = classnames__WEBPACK_IMPORTED_MODULE_6___default()(prefixCls, className, alignedClassName, motionClassName);
131665
+ var mergedClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(prefixCls, className, alignedClassName, motionClassName);
131022
131666
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["createElement"](rc_align__WEBPACK_IMPORTED_MODULE_4__["default"], {
131023
131667
  target: getAlignTarget(),
131024
131668
  key: "popup",
@@ -131196,7 +131840,7 @@ __webpack_require__.r(__webpack_exports__);
131196
131840
 
131197
131841
 
131198
131842
 
131199
- var StatusQueue = ['measure', 'align', null, 'motion'];
131843
+ var StatusQueue = ['measure', 'alignPre', 'align', null, 'motion'];
131200
131844
  /* harmony default export */ __webpack_exports__["default"] = (function (visible, doMeasure) {
131201
131845
  var _useState = Object(rc_util_es_hooks_useState__WEBPACK_IMPORTED_MODULE_5__["default"])(null),
131202
131846
  _useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState, 2),
@@ -131375,6 +132019,7 @@ function generateTrigger(PortalComponent) {
131375
132019
 
131376
132020
  var _super = Object(_babel_runtime_helpers_esm_createSuper__WEBPACK_IMPORTED_MODULE_6__["default"])(Trigger);
131377
132021
 
132022
+ // ensure `getContainer` will be called only once
131378
132023
  function Trigger(props) {
131379
132024
  var _this;
131380
132025
 
@@ -131383,6 +132028,7 @@ function generateTrigger(PortalComponent) {
131383
132028
  _this = _super.call(this, props);
131384
132029
  _this.popupRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7__["createRef"]();
131385
132030
  _this.triggerRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7__["createRef"]();
132031
+ _this.portalContainer = void 0;
131386
132032
  _this.attachId = void 0;
131387
132033
  _this.clickOutsideHandler = void 0;
131388
132034
  _this.touchOutsideHandler = void 0;
@@ -131684,18 +132330,26 @@ function generateTrigger(PortalComponent) {
131684
132330
  };
131685
132331
 
131686
132332
  _this.getContainer = function () {
131687
- var getDocument = _this.props.getDocument;
131688
- var popupContainer = getDocument(_this.getRootDomNode()).createElement('div'); // Make sure default popup container will never cause scrollbar appearing
131689
- // https://github.com/react-component/trigger/issues/41
131690
-
131691
- popupContainer.style.position = 'absolute';
131692
- popupContainer.style.top = '0';
131693
- popupContainer.style.left = '0';
131694
- popupContainer.style.width = '100%';
131695
-
131696
- _this.attachParent(popupContainer);
131697
-
131698
- return popupContainer;
132333
+ if (!_this.portalContainer) {
132334
+ // In React.StrictMode component will call render multiple time in first mount.
132335
+ // When you want to refactor with FC, useRef will also init multiple time and
132336
+ // point to different useRef instance which will create multiple element
132337
+ // (This multiple render will not trigger effect so you can not clean up this
132338
+ // in effect). But this is safe with class component since it always point to same class instance.
132339
+ var getDocument = _this.props.getDocument;
132340
+ var popupContainer = getDocument(_this.getRootDomNode()).createElement('div'); // Make sure default popup container will never cause scrollbar appearing
132341
+ // https://github.com/react-component/trigger/issues/41
132342
+
132343
+ popupContainer.style.position = 'absolute';
132344
+ popupContainer.style.top = '0';
132345
+ popupContainer.style.left = '0';
132346
+ popupContainer.style.width = '100%';
132347
+ _this.portalContainer = popupContainer;
132348
+ }
132349
+
132350
+ _this.attachParent(_this.portalContainer);
132351
+
132352
+ return _this.portalContainer;
131699
132353
  };
131700
132354
 
131701
132355
  _this.setPoint = function (point) {
@@ -134957,9 +135611,11 @@ function RawList(props, ref) {
134957
135611
  componentRef.current.addEventListener('DOMMouseScroll', onFireFoxScroll);
134958
135612
  componentRef.current.addEventListener('MozMousePixelScroll', onMozMousePixelScroll);
134959
135613
  return function () {
134960
- componentRef.current.removeEventListener('wheel', onRawWheel);
134961
- componentRef.current.removeEventListener('DOMMouseScroll', onFireFoxScroll);
134962
- componentRef.current.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll);
135614
+ if (componentRef.current) {
135615
+ componentRef.current.removeEventListener('wheel', onRawWheel);
135616
+ componentRef.current.removeEventListener('DOMMouseScroll', onFireFoxScroll);
135617
+ componentRef.current.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll);
135618
+ }
134963
135619
  };
134964
135620
  }, [useVirtual]); // ================================= Ref ==================================
134965
135621
 
@@ -135143,16 +135799,19 @@ var ScrollBar = /*#__PURE__*/function (_React$Component) {
135143
135799
  };
135144
135800
 
135145
135801
  _this.removeEvents = function () {
135802
+ var _this$scrollbarRef$cu;
135803
+
135146
135804
  window.removeEventListener('mousemove', _this.onMouseMove);
135147
135805
  window.removeEventListener('mouseup', _this.onMouseUp);
135806
+ (_this$scrollbarRef$cu = _this.scrollbarRef.current) === null || _this$scrollbarRef$cu === void 0 ? void 0 : _this$scrollbarRef$cu.removeEventListener('touchstart', _this.onScrollbarTouchStart);
135148
135807
 
135149
- _this.scrollbarRef.current.removeEventListener('touchstart', _this.onScrollbarTouchStart);
135150
-
135151
- _this.thumbRef.current.removeEventListener('touchstart', _this.onMouseDown);
135808
+ if (_this.thumbRef.current) {
135809
+ _this.thumbRef.current.removeEventListener('touchstart', _this.onMouseDown);
135152
135810
 
135153
- _this.thumbRef.current.removeEventListener('touchmove', _this.onMouseMove);
135811
+ _this.thumbRef.current.removeEventListener('touchmove', _this.onMouseMove);
135154
135812
 
135155
- _this.thumbRef.current.removeEventListener('touchend', _this.onMouseUp);
135813
+ _this.thumbRef.current.removeEventListener('touchend', _this.onMouseUp);
135814
+ }
135156
135815
 
135157
135816
  rc_util_es_raf__WEBPACK_IMPORTED_MODULE_2__["default"].cancel(_this.moveRaf);
135158
135817
  };
@@ -135650,7 +136309,9 @@ function useMobileTouchMove(inVirtual, listRef, callback) {
135650
136309
  }
135651
136310
 
135652
136311
  return function () {
135653
- listRef.current.removeEventListener('touchstart', onTouchStart);
136312
+ var _listRef$current;
136313
+
136314
+ (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.removeEventListener('touchstart', onTouchStart);
135654
136315
  cleanUpEvents();
135655
136316
  clearInterval(intervalRef.current);
135656
136317
  };