acud 0.0.69 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/acud.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! acud v0.0.69 */
1
+ /*! acud v0.0.70 */
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"));
@@ -8570,11 +8570,13 @@ function generatePicker(generateConfig) {
8570
8570
  Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Picker);
8571
8571
 
8572
8572
  _this = _super.call(this, props);
8573
- _this.pickerRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createRef"](); // focus = () => {
8574
- // if (this.pickerRef.current) {
8575
- // this.pickerRef.current.focus();
8576
- // }
8577
- // };
8573
+ _this.pickerRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["createRef"]();
8574
+
8575
+ _this.focus = function () {
8576
+ if (_this.pickerRef.current) {
8577
+ _this.pickerRef.current.focus();
8578
+ }
8579
+ };
8578
8580
 
8579
8581
  _this.blur = function () {
8580
8582
  if (_this.pickerRef.current) {
@@ -8851,6 +8853,43 @@ var locale = {
8851
8853
 
8852
8854
  /***/ }),
8853
8855
 
8856
+ /***/ "./components/date-picker/locale/zh_CN.tsx":
8857
+ /*!*************************************************!*\
8858
+ !*** ./components/date-picker/locale/zh_CN.tsx ***!
8859
+ \*************************************************/
8860
+ /*! exports provided: default */
8861
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
8862
+
8863
+ "use strict";
8864
+ __webpack_require__.r(__webpack_exports__);
8865
+ /* 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");
8866
+ /* harmony import */ var _src_locale_zh_CN__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../src/locale/zh_CN */ "./components/date-picker/src/locale/zh_CN.ts");
8867
+ /* harmony import */ var _time_picker_locale_zh_CN__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../time-picker/locale/zh_CN */ "./components/time-picker/locale/zh_CN.tsx");
8868
+
8869
+
8870
+
8871
+ var timePickerLocale = _time_picker_locale_zh_CN__WEBPACK_IMPORTED_MODULE_2__["default"].timePickerLocale; // 统一合并为完整的 Locale
8872
+
8873
+ var locale = {
8874
+ lang: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
8875
+ placeholder: '请选择日期',
8876
+ yearPlaceholder: '请选择年份',
8877
+ quarterPlaceholder: '请选择季度',
8878
+ monthPlaceholder: '请选择月份',
8879
+ weekPlaceholder: '请选择周',
8880
+ rangePlaceholder: ['开始日期', '结束日期'],
8881
+ rangeYearPlaceholder: ['开始年份', '结束年份'],
8882
+ rangeMonthPlaceholder: ['开始月份', '结束月份'],
8883
+ rangeWeekPlaceholder: ['开始周', '结束周']
8884
+ }, _src_locale_zh_CN__WEBPACK_IMPORTED_MODULE_1__["default"]),
8885
+ timePickerLocale: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, timePickerLocale)
8886
+ }; // should add whitespace between char in Button
8887
+
8888
+ locale.lang.ok = '确 定';
8889
+ /* harmony default export */ __webpack_exports__["default"] = (locale);
8890
+
8891
+ /***/ }),
8892
+
8854
8893
  /***/ "./components/date-picker/src/PanelContext.tsx":
8855
8894
  /*!*****************************************************!*\
8856
8895
  !*** ./components/date-picker/src/PanelContext.tsx ***!
@@ -11922,6 +11961,47 @@ var locale = {
11922
11961
 
11923
11962
  /***/ }),
11924
11963
 
11964
+ /***/ "./components/date-picker/src/locale/zh_CN.ts":
11965
+ /*!****************************************************!*\
11966
+ !*** ./components/date-picker/src/locale/zh_CN.ts ***!
11967
+ \****************************************************/
11968
+ /*! exports provided: default */
11969
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
11970
+
11971
+ "use strict";
11972
+ __webpack_require__.r(__webpack_exports__);
11973
+ var locale = {
11974
+ locale: 'zh_CN',
11975
+ today: '今天',
11976
+ now: '此刻',
11977
+ backToToday: '返回今天',
11978
+ ok: '确定',
11979
+ timeSelect: '选择时间',
11980
+ dateSelect: '选择日期',
11981
+ weekSelect: '选择周',
11982
+ clear: '清除',
11983
+ month: '月',
11984
+ year: '年',
11985
+ previousMonth: '上个月 (翻页上键)',
11986
+ nextMonth: '下个月 (翻页下键)',
11987
+ monthSelect: '选择月份',
11988
+ yearSelect: '选择年份',
11989
+ decadeSelect: '选择年代',
11990
+ yearFormat: 'YYYY年',
11991
+ dayFormat: 'D日',
11992
+ dateFormat: 'YYYY年M月D日',
11993
+ dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒',
11994
+ previousYear: '上一年 (Control键加左方向键)',
11995
+ nextYear: '下一年 (Control键加右方向键)',
11996
+ previousDecade: '上一年代',
11997
+ nextDecade: '下一年代',
11998
+ previousCentury: '上一世纪',
11999
+ nextCentury: '下一世纪'
12000
+ };
12001
+ /* harmony default export */ __webpack_exports__["default"] = (locale);
12002
+
12003
+ /***/ }),
12004
+
11925
12005
  /***/ "./components/date-picker/src/panels/DatePanel/DateBody.tsx":
11926
12006
  /*!******************************************************************!*\
11927
12007
  !*** ./components/date-picker/src/panels/DatePanel/DateBody.tsx ***!
@@ -21102,8 +21182,10 @@ __webpack_require__.r(__webpack_exports__);
21102
21182
 
21103
21183
  "use strict";
21104
21184
  __webpack_require__.r(__webpack_exports__);
21185
+ /* harmony import */ var _date_picker_locale_zh_CN__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../date-picker/locale/zh_CN */ "./components/date-picker/locale/zh_CN.tsx");
21105
21186
  /* eslint-disable no-template-curly-in-string */
21106
21187
  // import {Locale} from '../locale-provider';
21188
+
21107
21189
  var typeTemplate = '${label}不是一个有效的${type}'; // const localeValues: Locale = {
21108
21190
 
21109
21191
  var localeValues = {
@@ -21112,6 +21194,7 @@ var localeValues = {
21112
21194
  global: {
21113
21195
  placeholder: '请选择'
21114
21196
  },
21197
+ DatePicker: _date_picker_locale_zh_CN__WEBPACK_IMPORTED_MODULE_0__["default"],
21115
21198
  Table: {
21116
21199
  filterTitle: '筛选',
21117
21200
  filterConfirm: '确定',
@@ -40809,6 +40892,32 @@ var locale = {
40809
40892
 
40810
40893
  /***/ }),
40811
40894
 
40895
+ /***/ "./components/time-picker/locale/zh_CN.tsx":
40896
+ /*!*************************************************!*\
40897
+ !*** ./components/time-picker/locale/zh_CN.tsx ***!
40898
+ \*************************************************/
40899
+ /*! exports provided: default */
40900
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
40901
+
40902
+ "use strict";
40903
+ __webpack_require__.r(__webpack_exports__);
40904
+ var locale = {
40905
+ lang: {
40906
+ locale: 'zh_CN',
40907
+ now: '此刻',
40908
+ ok: '确定',
40909
+ timeSelect: '选择时间',
40910
+ clear: '清除'
40911
+ },
40912
+ timePickerLocale: {
40913
+ placeholder: '请选择时间',
40914
+ rangePlaceholder: ['开始时间', '结束时间']
40915
+ }
40916
+ };
40917
+ /* harmony default export */ __webpack_exports__["default"] = (locale);
40918
+
40919
+ /***/ }),
40920
+
40812
40921
  /***/ "./components/time-picker/style/index.less":
40813
40922
  /*!*************************************************!*\
40814
40923
  !*** ./components/time-picker/style/index.less ***!
@@ -41615,8 +41724,8 @@ function ToastDom(props) {
41615
41724
  onClose = _props$onClose === void 0 ? null : _props$onClose;
41616
41725
 
41617
41726
  var _useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(null),
41618
- _useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState, 1),
41619
- setTimerID = _useState2[0];
41727
+ _useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState, 2),
41728
+ setTimerID = _useState2[1];
41620
41729
 
41621
41730
  var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(countdown),
41622
41731
  _useState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState3, 2),
@@ -85512,16 +85621,7 @@ var Schema = /*#__PURE__*/function () {
85512
85621
  if (rule.asyncValidator) {
85513
85622
  res = rule.asyncValidator(rule, data.value, cb, data.source, options);
85514
85623
  } else if (rule.validator) {
85515
- try {
85516
- res = rule.validator(rule, data.value, cb, data.source, options);
85517
- } catch (error) {
85518
- console.error == null ? void 0 : console.error(error); // rethrow to report error
85519
-
85520
- setTimeout(function () {
85521
- throw error;
85522
- }, 0);
85523
- cb(error.message);
85524
- }
85624
+ res = rule.validator(rule, data.value, cb, data.source, options);
85525
85625
 
85526
85626
  if (res === true) {
85527
85627
  cb();
@@ -86034,8 +86134,8 @@ function getClientPosition(elem) {
86034
86134
  // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
86035
86135
  // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
86036
86136
 
86037
- x = Math.floor(box.left);
86038
- y = Math.floor(box.top); // In IE, most of the time, 2 extra pixels are added to the top and left
86137
+ x = box.left;
86138
+ y = box.top; // In IE, most of the time, 2 extra pixels are added to the top and left
86039
86139
  // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
86040
86140
  // IE6 standards mode, this border can be overridden by setting the
86041
86141
  // document element's border to zero -- thus, we cannot rely on the
@@ -86442,7 +86542,7 @@ function getWH(elem, name, ex) {
86442
86542
  }
86443
86543
 
86444
86544
  var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
86445
- var borderBoxValue = name === 'width' ? Math.floor(elem.getBoundingClientRect().width) : Math.floor(elem.getBoundingClientRect().height);
86545
+ var borderBoxValue = name === 'width' ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height;
86446
86546
  var isBorderBox = isBorderBoxFn(elem);
86447
86547
  var cssBoxValue = 0;
86448
86548
 
@@ -117292,8 +117392,6 @@ __webpack_require__.r(__webpack_exports__);
117292
117392
  }
117293
117393
 
117294
117394
  function trigger(force) {
117295
- cancelTrigger();
117296
-
117297
117395
  if (!calledRef.current || force === true) {
117298
117396
  if (callback() === false) {
117299
117397
  // Not delay since callback cancelled self
@@ -117301,10 +117399,12 @@ __webpack_require__.r(__webpack_exports__);
117301
117399
  }
117302
117400
 
117303
117401
  calledRef.current = true;
117402
+ cancelTrigger();
117304
117403
  timeoutRef.current = window.setTimeout(function () {
117305
117404
  calledRef.current = false;
117306
117405
  }, buffer);
117307
117406
  } else {
117407
+ cancelTrigger();
117308
117408
  timeoutRef.current = window.setTimeout(function () {
117309
117409
  calledRef.current = false;
117310
117410
  trigger();
@@ -121726,14 +121826,6 @@ __webpack_require__.r(__webpack_exports__);
121726
121826
 
121727
121827
 
121728
121828
 
121729
- function stringify(value) {
121730
- try {
121731
- return JSON.stringify(value);
121732
- } catch (err) {
121733
- return Math.random();
121734
- }
121735
- }
121736
-
121737
121829
  function useWatch() {
121738
121830
  var dependencies = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
121739
121831
  var form = arguments.length > 1 ? arguments[1] : undefined;
@@ -121743,11 +121835,8 @@ function useWatch() {
121743
121835
  value = _useState2[0],
121744
121836
  setValue = _useState2[1];
121745
121837
 
121746
- var valueStr = Object(react__WEBPACK_IMPORTED_MODULE_4__["useMemo"])(function () {
121747
- return stringify(value);
121748
- }, [value]);
121749
- var valueStrRef = Object(react__WEBPACK_IMPORTED_MODULE_4__["useRef"])(valueStr);
121750
- valueStrRef.current = valueStr;
121838
+ var valueCacheRef = Object(react__WEBPACK_IMPORTED_MODULE_4__["useRef"])();
121839
+ valueCacheRef.current = value;
121751
121840
  var fieldContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(___WEBPACK_IMPORTED_MODULE_1__["FieldContext"]);
121752
121841
  var formInstance = form || fieldContext;
121753
121842
  var isValidForm = formInstance && formInstance._init; // Warning if not exist form instance
@@ -121773,9 +121862,8 @@ function useWatch() {
121773
121862
 
121774
121863
  var cancelRegister = registerWatch(function (store) {
121775
121864
  var newValue = Object(_utils_valueUtil__WEBPACK_IMPORTED_MODULE_5__["getValue"])(store, namePathRef.current);
121776
- var nextValueStr = stringify(newValue); // Compare stringify in case it's nest object
121777
121865
 
121778
- if (valueStrRef.current !== nextValueStr) {
121866
+ if (valueCacheRef.current !== newValue) {
121779
121867
  setValue(newValue);
121780
121868
  }
121781
121869
  }); // TODO: We can improve this perf in future
@@ -122123,8 +122211,6 @@ function replaceMessage(template, kv) {
122123
122211
  });
122124
122212
  }
122125
122213
 
122126
- var CODE_LOGIC_ERROR = 'CODE_LOGIC_ERROR';
122127
-
122128
122214
  function validateRule(_x, _x2, _x3, _x4, _x5) {
122129
122215
  return _validateRule.apply(this, arguments);
122130
122216
  }
@@ -122136,7 +122222,7 @@ function validateRule(_x, _x2, _x3, _x4, _x5) {
122136
122222
 
122137
122223
  function _validateRule() {
122138
122224
  _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) {
122139
- var cloneRule, originValidator, subRuleField, validator, messages, result, subResults, kv, fillVariableResult;
122225
+ var cloneRule, subRuleField, validator, messages, result, subResults, kv, fillVariableResult;
122140
122226
  return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee2$(_context2) {
122141
122227
  while (1) {
122142
122228
  switch (_context2.prev = _context2.next) {
@@ -122145,21 +122231,7 @@ function _validateRule() {
122145
122231
  // https://github.com/react-component/field-form/issues/316
122146
122232
  // https://github.com/react-component/field-form/issues/313
122147
122233
 
122148
- delete cloneRule.ruleIndex;
122149
-
122150
- if (cloneRule.validator) {
122151
- originValidator = cloneRule.validator;
122152
-
122153
- cloneRule.validator = function () {
122154
- try {
122155
- return originValidator.apply(void 0, arguments);
122156
- } catch (error) {
122157
- console.error(error);
122158
- return Promise.reject(CODE_LOGIC_ERROR);
122159
- }
122160
- };
122161
- } // We should special handle array validate
122162
-
122234
+ delete cloneRule.ruleIndex; // We should special handle array validate
122163
122235
 
122164
122236
  subRuleField = null;
122165
122237
 
@@ -122172,49 +122244,52 @@ function _validateRule() {
122172
122244
  messages = Object(_valueUtil__WEBPACK_IMPORTED_MODULE_9__["setValues"])({}, _messages__WEBPACK_IMPORTED_MODULE_8__["defaultValidateMessages"], options.validateMessages);
122173
122245
  validator.messages(messages);
122174
122246
  result = [];
122175
- _context2.prev = 9;
122176
- _context2.next = 12;
122247
+ _context2.prev = 8;
122248
+ _context2.next = 11;
122177
122249
  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)));
122178
122250
 
122179
- case 12:
122180
- _context2.next = 17;
122251
+ case 11:
122252
+ _context2.next = 16;
122181
122253
  break;
122182
122254
 
122183
- case 14:
122184
- _context2.prev = 14;
122185
- _context2.t0 = _context2["catch"](9);
122255
+ case 13:
122256
+ _context2.prev = 13;
122257
+ _context2.t0 = _context2["catch"](8);
122186
122258
 
122187
122259
  if (_context2.t0.errors) {
122188
122260
  result = _context2.t0.errors.map(function (_ref4, index) {
122189
122261
  var message = _ref4.message;
122190
- var mergedMessage = message === CODE_LOGIC_ERROR ? messages.default : message;
122191
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["isValidElement"](mergedMessage) ?
122192
- /*#__PURE__*/
122193
- // Wrap ReactNode with `key`
122194
- react__WEBPACK_IMPORTED_MODULE_6__["cloneElement"](mergedMessage, {
122195
- key: "error_".concat(index)
122196
- }) : mergedMessage;
122262
+ return (// Wrap ReactNode with `key`
122263
+
122264
+ /*#__PURE__*/
122265
+ react__WEBPACK_IMPORTED_MODULE_6__["isValidElement"](message) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6__["cloneElement"](message, {
122266
+ key: "error_".concat(index)
122267
+ }) : message
122268
+ );
122197
122269
  });
122270
+ } else {
122271
+ console.error(_context2.t0);
122272
+ result = [messages.default];
122198
122273
  }
122199
122274
 
122200
- case 17:
122275
+ case 16:
122201
122276
  if (!(!result.length && subRuleField)) {
122202
- _context2.next = 22;
122277
+ _context2.next = 21;
122203
122278
  break;
122204
122279
  }
122205
122280
 
122206
- _context2.next = 20;
122281
+ _context2.next = 19;
122207
122282
  return Promise.all(value.map(function (subValue, i) {
122208
122283
  return validateRule("".concat(name, ".").concat(i), subValue, subRuleField, options, messageVariables);
122209
122284
  }));
122210
122285
 
122211
- case 20:
122286
+ case 19:
122212
122287
  subResults = _context2.sent;
122213
122288
  return _context2.abrupt("return", subResults.reduce(function (prev, errors) {
122214
122289
  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));
122215
122290
  }, []));
122216
122291
 
122217
- case 22:
122292
+ case 21:
122218
122293
  // Replace message with variables
122219
122294
  kv = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_3__["default"])({}, rule), {}, {
122220
122295
  name: name,
@@ -122229,12 +122304,12 @@ function _validateRule() {
122229
122304
  });
122230
122305
  return _context2.abrupt("return", fillVariableResult);
122231
122306
 
122232
- case 25:
122307
+ case 24:
122233
122308
  case "end":
122234
122309
  return _context2.stop();
122235
122310
  }
122236
122311
  }
122237
- }, _callee2, null, [[9, 14]]);
122312
+ }, _callee2, null, [[8, 13]]);
122238
122313
  }));
122239
122314
  return _validateRule.apply(this, arguments);
122240
122315
  }
@@ -124659,12 +124734,7 @@ function Overflow(props, ref) {
124659
124734
  }
124660
124735
 
124661
124736
  for (var i = 0; i < len; i += 1) {
124662
- var currentItemWidth = getItemWidth(i); // Fully will always render
124663
-
124664
- if (fullySSR) {
124665
- currentItemWidth = currentItemWidth || 0;
124666
- } // Break since data not ready
124667
-
124737
+ var currentItemWidth = getItemWidth(i); // Break since data not ready
124668
124738
 
124669
124739
  if (currentItemWidth === undefined) {
124670
124740
  updateDisplayCount(i - 1, true);
@@ -128611,16 +128681,11 @@ var RefNodeList = function RefNodeList(props, ref) {
128611
128681
  var _React$useState9 = react__WEBPACK_IMPORTED_MODULE_3__["useState"](null),
128612
128682
  _React$useState10 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_React$useState9, 2),
128613
128683
  motionType = _React$useState10[0],
128614
- setMotionType = _React$useState10[1]; // When motion end but data change, this will makes data back to previous one
128615
-
128616
-
128617
- var dataRef = react__WEBPACK_IMPORTED_MODULE_3__["useRef"](data);
128618
- dataRef.current = data;
128684
+ setMotionType = _React$useState10[1];
128619
128685
 
128620
128686
  function onMotionEnd() {
128621
- var latestData = dataRef.current;
128622
- setPrevData(latestData);
128623
- setTransitionData(latestData);
128687
+ setPrevData(data);
128688
+ setTransitionData(data);
128624
128689
  setTransitionRange([]);
128625
128690
  setMotionType(null);
128626
128691
  onListChangeEnd();
@@ -129181,56 +129246,24 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129181
129246
  _this.currentMouseOverDroppableNodeKey = null;
129182
129247
  };
129183
129248
 
129184
- _this.triggerExpandActionExpand = function (e, treeNode) {
129185
- var _this$state5 = _this.state,
129186
- expandedKeys = _this$state5.expandedKeys,
129187
- flattenNodes = _this$state5.flattenNodes;
129188
- var expanded = treeNode.expanded,
129189
- key = treeNode.key;
129190
- var node = flattenNodes.filter(function (nodeItem) {
129191
- return nodeItem.key === key;
129192
- })[0];
129193
- 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())), {}, {
129194
- data: node.data
129195
- }));
129196
-
129197
- _this.setExpandedKeys(expanded ? Object(_util__WEBPACK_IMPORTED_MODULE_16__["arrDel"])(expandedKeys, key) : Object(_util__WEBPACK_IMPORTED_MODULE_16__["arrAdd"])(expandedKeys, key));
129198
-
129199
- _this.onNodeExpand(e, eventNode);
129200
- };
129201
-
129202
129249
  _this.onNodeClick = function (e, treeNode) {
129203
- var _this$props3 = _this.props,
129204
- onClick = _this$props3.onClick,
129205
- expandAction = _this$props3.expandAction;
129206
-
129207
- if (expandAction === 'click') {
129208
- _this.triggerExpandActionExpand(e, treeNode);
129209
- }
129210
-
129250
+ var onClick = _this.props.onClick;
129211
129251
  onClick === null || onClick === void 0 ? void 0 : onClick(e, treeNode);
129212
129252
  };
129213
129253
 
129214
129254
  _this.onNodeDoubleClick = function (e, treeNode) {
129215
- var _this$props4 = _this.props,
129216
- onDoubleClick = _this$props4.onDoubleClick,
129217
- expandAction = _this$props4.expandAction;
129218
-
129219
- if (expandAction === 'doubleClick') {
129220
- _this.triggerExpandActionExpand(e, treeNode);
129221
- }
129222
-
129255
+ var onDoubleClick = _this.props.onDoubleClick;
129223
129256
  onDoubleClick === null || onDoubleClick === void 0 ? void 0 : onDoubleClick(e, treeNode);
129224
129257
  };
129225
129258
 
129226
129259
  _this.onNodeSelect = function (e, treeNode) {
129227
129260
  var selectedKeys = _this.state.selectedKeys;
129228
- var _this$state6 = _this.state,
129229
- keyEntities = _this$state6.keyEntities,
129230
- fieldNames = _this$state6.fieldNames;
129231
- var _this$props5 = _this.props,
129232
- onSelect = _this$props5.onSelect,
129233
- multiple = _this$props5.multiple;
129261
+ var _this$state5 = _this.state,
129262
+ keyEntities = _this$state5.keyEntities,
129263
+ fieldNames = _this$state5.fieldNames;
129264
+ var _this$props3 = _this.props,
129265
+ onSelect = _this$props3.onSelect,
129266
+ multiple = _this$props3.multiple;
129234
129267
  var selected = treeNode.selected;
129235
129268
  var key = treeNode[fieldNames.key];
129236
129269
  var targetSelected = !selected; // Update selected keys
@@ -129266,13 +129299,13 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129266
129299
  };
129267
129300
 
129268
129301
  _this.onNodeCheck = function (e, treeNode, checked) {
129269
- var _this$state7 = _this.state,
129270
- keyEntities = _this$state7.keyEntities,
129271
- oriCheckedKeys = _this$state7.checkedKeys,
129272
- oriHalfCheckedKeys = _this$state7.halfCheckedKeys;
129273
- var _this$props6 = _this.props,
129274
- checkStrictly = _this$props6.checkStrictly,
129275
- onCheck = _this$props6.onCheck;
129302
+ var _this$state6 = _this.state,
129303
+ keyEntities = _this$state6.keyEntities,
129304
+ oriCheckedKeys = _this$state6.checkedKeys,
129305
+ oriHalfCheckedKeys = _this$state6.halfCheckedKeys;
129306
+ var _this$props4 = _this.props,
129307
+ checkStrictly = _this$props4.checkStrictly,
129308
+ onCheck = _this$props4.onCheck;
129276
129309
  var key = treeNode.key; // Prepare trigger arguments
129277
129310
 
129278
129311
  var checkedObj;
@@ -129358,9 +129391,9 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129358
129391
  loadedKeys = _ref$loadedKeys === void 0 ? [] : _ref$loadedKeys,
129359
129392
  _ref$loadingKeys = _ref.loadingKeys,
129360
129393
  loadingKeys = _ref$loadingKeys === void 0 ? [] : _ref$loadingKeys;
129361
- var _this$props7 = _this.props,
129362
- loadData = _this$props7.loadData,
129363
- onLoad = _this$props7.onLoad;
129394
+ var _this$props5 = _this.props,
129395
+ loadData = _this$props5.loadData,
129396
+ onLoad = _this$props5.onLoad;
129364
129397
 
129365
129398
  if (!loadData || loadedKeys.indexOf(key) !== -1 || loadingKeys.indexOf(key) !== -1) {
129366
129399
  return null;
@@ -129481,16 +129514,16 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129481
129514
  };
129482
129515
 
129483
129516
  _this.getTreeNodeRequiredProps = function () {
129484
- var _this$state8 = _this.state,
129485
- expandedKeys = _this$state8.expandedKeys,
129486
- selectedKeys = _this$state8.selectedKeys,
129487
- loadedKeys = _this$state8.loadedKeys,
129488
- loadingKeys = _this$state8.loadingKeys,
129489
- checkedKeys = _this$state8.checkedKeys,
129490
- halfCheckedKeys = _this$state8.halfCheckedKeys,
129491
- dragOverNodeKey = _this$state8.dragOverNodeKey,
129492
- dropPosition = _this$state8.dropPosition,
129493
- keyEntities = _this$state8.keyEntities;
129517
+ var _this$state7 = _this.state,
129518
+ expandedKeys = _this$state7.expandedKeys,
129519
+ selectedKeys = _this$state7.selectedKeys,
129520
+ loadedKeys = _this$state7.loadedKeys,
129521
+ loadingKeys = _this$state7.loadingKeys,
129522
+ checkedKeys = _this$state7.checkedKeys,
129523
+ halfCheckedKeys = _this$state7.halfCheckedKeys,
129524
+ dragOverNodeKey = _this$state7.dragOverNodeKey,
129525
+ dropPosition = _this$state7.dropPosition,
129526
+ keyEntities = _this$state7.keyEntities;
129494
129527
  return {
129495
129528
  expandedKeys: expandedKeys || [],
129496
129529
  selectedKeys: selectedKeys || [],
@@ -129505,9 +129538,9 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129505
129538
  };
129506
129539
 
129507
129540
  _this.setExpandedKeys = function (expandedKeys) {
129508
- var _this$state9 = _this.state,
129509
- treeData = _this$state9.treeData,
129510
- fieldNames = _this$state9.fieldNames;
129541
+ var _this$state8 = _this.state,
129542
+ treeData = _this$state8.treeData,
129543
+ fieldNames = _this$state8.fieldNames;
129511
129544
  var flattenNodes = Object(_utils_treeUtil__WEBPACK_IMPORTED_MODULE_17__["flattenTreeData"])(treeData, expandedKeys, fieldNames);
129512
129545
 
129513
129546
  _this.setUncontrolledState({
@@ -129518,12 +129551,12 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129518
129551
 
129519
129552
  _this.onNodeExpand = function (e, treeNode) {
129520
129553
  var expandedKeys = _this.state.expandedKeys;
129521
- var _this$state10 = _this.state,
129522
- listChanging = _this$state10.listChanging,
129523
- fieldNames = _this$state10.fieldNames;
129524
- var _this$props8 = _this.props,
129525
- onExpand = _this$props8.onExpand,
129526
- loadData = _this$props8.loadData;
129554
+ var _this$state9 = _this.state,
129555
+ listChanging = _this$state9.listChanging,
129556
+ fieldNames = _this$state9.fieldNames;
129557
+ var _this$props6 = _this.props,
129558
+ onExpand = _this$props6.onExpand,
129559
+ loadData = _this$props6.loadData;
129527
129560
  var expanded = treeNode.expanded;
129528
129561
  var key = treeNode[fieldNames.key]; // Do nothing when motion is in progress
129529
129562
 
@@ -129607,9 +129640,9 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129607
129640
  };
129608
129641
 
129609
129642
  _this.getActiveItem = function () {
129610
- var _this$state11 = _this.state,
129611
- activeKey = _this$state11.activeKey,
129612
- flattenNodes = _this$state11.flattenNodes;
129643
+ var _this$state10 = _this.state,
129644
+ activeKey = _this$state10.activeKey,
129645
+ flattenNodes = _this$state10.flattenNodes;
129613
129646
 
129614
129647
  if (activeKey === null) {
129615
129648
  return null;
@@ -129622,9 +129655,9 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129622
129655
  };
129623
129656
 
129624
129657
  _this.offsetActiveKey = function (offset) {
129625
- var _this$state12 = _this.state,
129626
- flattenNodes = _this$state12.flattenNodes,
129627
- activeKey = _this$state12.activeKey;
129658
+ var _this$state11 = _this.state,
129659
+ flattenNodes = _this$state11.flattenNodes,
129660
+ activeKey = _this$state11.activeKey;
129628
129661
  var index = flattenNodes.findIndex(function (_ref3) {
129629
129662
  var key = _ref3.key;
129630
129663
  return key === activeKey;
@@ -129647,14 +129680,14 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129647
129680
  };
129648
129681
 
129649
129682
  _this.onKeyDown = function (event) {
129650
- var _this$state13 = _this.state,
129651
- activeKey = _this$state13.activeKey,
129652
- expandedKeys = _this$state13.expandedKeys,
129653
- checkedKeys = _this$state13.checkedKeys;
129654
- var _this$props9 = _this.props,
129655
- onKeyDown = _this$props9.onKeyDown,
129656
- checkable = _this$props9.checkable,
129657
- selectable = _this$props9.selectable; // >>>>>>>>>> Direction
129683
+ var _this$state12 = _this.state,
129684
+ activeKey = _this$state12.activeKey,
129685
+ expandedKeys = _this$state12.expandedKeys,
129686
+ checkedKeys = _this$state12.checkedKeys;
129687
+ var _this$props7 = _this.props,
129688
+ onKeyDown = _this$props7.onKeyDown,
129689
+ checkable = _this$props7.checkable,
129690
+ selectable = _this$props7.selectable; // >>>>>>>>>> Direction
129658
129691
 
129659
129692
  switch (event.which) {
129660
129693
  case rc_util_es_KeyCode__WEBPACK_IMPORTED_MODULE_11__["default"].UP:
@@ -129814,47 +129847,47 @@ var Tree = /*#__PURE__*/function (_React$Component) {
129814
129847
  value: function render() {
129815
129848
  var _classNames;
129816
129849
 
129817
- var _this$state14 = this.state,
129818
- focused = _this$state14.focused,
129819
- flattenNodes = _this$state14.flattenNodes,
129820
- keyEntities = _this$state14.keyEntities,
129821
- draggingNodeKey = _this$state14.draggingNodeKey,
129822
- activeKey = _this$state14.activeKey,
129823
- dropLevelOffset = _this$state14.dropLevelOffset,
129824
- dropContainerKey = _this$state14.dropContainerKey,
129825
- dropTargetKey = _this$state14.dropTargetKey,
129826
- dropPosition = _this$state14.dropPosition,
129827
- dragOverNodeKey = _this$state14.dragOverNodeKey,
129828
- indent = _this$state14.indent;
129829
- var _this$props10 = this.props,
129830
- prefixCls = _this$props10.prefixCls,
129831
- className = _this$props10.className,
129832
- style = _this$props10.style,
129833
- showLine = _this$props10.showLine,
129834
- focusable = _this$props10.focusable,
129835
- _this$props10$tabInde = _this$props10.tabIndex,
129836
- tabIndex = _this$props10$tabInde === void 0 ? 0 : _this$props10$tabInde,
129837
- selectable = _this$props10.selectable,
129838
- showIcon = _this$props10.showIcon,
129839
- icon = _this$props10.icon,
129840
- switcherIcon = _this$props10.switcherIcon,
129841
- draggable = _this$props10.draggable,
129842
- checkable = _this$props10.checkable,
129843
- checkStrictly = _this$props10.checkStrictly,
129844
- disabled = _this$props10.disabled,
129845
- motion = _this$props10.motion,
129846
- loadData = _this$props10.loadData,
129847
- filterTreeNode = _this$props10.filterTreeNode,
129848
- height = _this$props10.height,
129849
- itemHeight = _this$props10.itemHeight,
129850
- virtual = _this$props10.virtual,
129851
- titleRender = _this$props10.titleRender,
129852
- dropIndicatorRender = _this$props10.dropIndicatorRender,
129853
- onContextMenu = _this$props10.onContextMenu,
129854
- onScroll = _this$props10.onScroll,
129855
- direction = _this$props10.direction,
129856
- rootClassName = _this$props10.rootClassName,
129857
- rootStyle = _this$props10.rootStyle;
129850
+ var _this$state13 = this.state,
129851
+ focused = _this$state13.focused,
129852
+ flattenNodes = _this$state13.flattenNodes,
129853
+ keyEntities = _this$state13.keyEntities,
129854
+ draggingNodeKey = _this$state13.draggingNodeKey,
129855
+ activeKey = _this$state13.activeKey,
129856
+ dropLevelOffset = _this$state13.dropLevelOffset,
129857
+ dropContainerKey = _this$state13.dropContainerKey,
129858
+ dropTargetKey = _this$state13.dropTargetKey,
129859
+ dropPosition = _this$state13.dropPosition,
129860
+ dragOverNodeKey = _this$state13.dragOverNodeKey,
129861
+ indent = _this$state13.indent;
129862
+ var _this$props8 = this.props,
129863
+ prefixCls = _this$props8.prefixCls,
129864
+ className = _this$props8.className,
129865
+ style = _this$props8.style,
129866
+ showLine = _this$props8.showLine,
129867
+ focusable = _this$props8.focusable,
129868
+ _this$props8$tabIndex = _this$props8.tabIndex,
129869
+ tabIndex = _this$props8$tabIndex === void 0 ? 0 : _this$props8$tabIndex,
129870
+ selectable = _this$props8.selectable,
129871
+ showIcon = _this$props8.showIcon,
129872
+ icon = _this$props8.icon,
129873
+ switcherIcon = _this$props8.switcherIcon,
129874
+ draggable = _this$props8.draggable,
129875
+ checkable = _this$props8.checkable,
129876
+ checkStrictly = _this$props8.checkStrictly,
129877
+ disabled = _this$props8.disabled,
129878
+ motion = _this$props8.motion,
129879
+ loadData = _this$props8.loadData,
129880
+ filterTreeNode = _this$props8.filterTreeNode,
129881
+ height = _this$props8.height,
129882
+ itemHeight = _this$props8.itemHeight,
129883
+ virtual = _this$props8.virtual,
129884
+ titleRender = _this$props8.titleRender,
129885
+ dropIndicatorRender = _this$props8.dropIndicatorRender,
129886
+ onContextMenu = _this$props8.onContextMenu,
129887
+ onScroll = _this$props8.onScroll,
129888
+ direction = _this$props8.direction,
129889
+ rootClassName = _this$props8.rootClassName,
129890
+ rootStyle = _this$props8.rootStyle;
129858
129891
  var domProps = Object(rc_util_es_pickAttrs__WEBPACK_IMPORTED_MODULE_13__["default"])(this.props, {
129859
129892
  aria: true,
129860
129893
  data: true
@@ -130087,8 +130120,7 @@ Tree.defaultProps = {
130087
130120
  dropIndicatorRender: _DropIndicator__WEBPACK_IMPORTED_MODULE_21__["default"],
130088
130121
  allowDrop: function allowDrop() {
130089
130122
  return true;
130090
- },
130091
- expandAction: false
130123
+ }
130092
130124
  };
130093
130125
  Tree.TreeNode = _TreeNode__WEBPACK_IMPORTED_MODULE_19__["default"];
130094
130126
  /* harmony default export */ __webpack_exports__["default"] = (Tree);
@@ -131974,27 +132006,13 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
131974
132006
  status = _useVisibleStatus2[0],
131975
132007
  goNextStatus = _useVisibleStatus2[1]; // ======================== Aligns ========================
131976
132008
 
131977
- /**
131978
- * `alignedClassName` may modify `source` size,
131979
- * which means one time align may not move to the correct position at once.
131980
- *
131981
- * We will reset `alignTimes` for each status switch to `alignPre`
131982
- * and let `rc-align` to align for multiple times to ensure get final stable place.
131983
- * Currently we mark `alignTimes < 2` repeat align, it will increase if user report for align issue.
131984
- */
131985
-
131986
132009
 
131987
- var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(0),
132010
+ var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(null),
131988
132011
  _useState4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState3, 2),
131989
- alignTimes = _useState4[0],
131990
- setAlignTimes = _useState4[1];
132012
+ alignInfo = _useState4[0],
132013
+ setAlignInfo = _useState4[1];
131991
132014
 
131992
- var prepareResolveRef = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])();
131993
- Object(rc_util_es_hooks_useLayoutEffect__WEBPACK_IMPORTED_MODULE_5__["default"])(function () {
131994
- if (status === 'alignPre') {
131995
- setAlignTimes(0);
131996
- }
131997
- }, [status]); // `target` on `rc-align` can accept as a function to get the bind element or a point.
132015
+ 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.
131998
132016
  // ref: https://www.npmjs.com/package/rc-align
131999
132017
 
132000
132018
  function getAlignTarget() {
@@ -132016,12 +132034,9 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
132016
132034
 
132017
132035
  if (alignedClassName !== nextAlignedClassName) {
132018
132036
  setAlignedClassName(nextAlignedClassName);
132019
- } // We will retry multi times to make sure that the element has been align in the right position.
132020
-
132037
+ }
132021
132038
 
132022
- setAlignTimes(function (val) {
132023
- return val + 1;
132024
- });
132039
+ setAlignInfo(matchAlign);
132025
132040
 
132026
132041
  if (status === 'align') {
132027
132042
  onAlign === null || onAlign === void 0 ? void 0 : onAlign(popupDomNode, matchAlign);
@@ -132030,9 +132045,10 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
132030
132045
 
132031
132046
 
132032
132047
  Object(rc_util_es_hooks_useLayoutEffect__WEBPACK_IMPORTED_MODULE_5__["default"])(function () {
132033
- if (status === 'align') {
132034
- // Repeat until not more align needed
132035
- if (alignTimes < 2) {
132048
+ if (alignInfo && status === 'align') {
132049
+ var nextAlignedClassName = getClassNameFromAlign(alignInfo); // Repeat until not more align needed
132050
+
132051
+ if (alignedClassName !== nextAlignedClassName) {
132036
132052
  forceAlign();
132037
132053
  } else {
132038
132054
  goNextStatus(function () {
@@ -132042,7 +132058,7 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
132042
132058
  });
132043
132059
  }
132044
132060
  }
132045
- }, [alignTimes]); // ======================== Motion ========================
132061
+ }, [alignInfo]); // ======================== Motion ========================
132046
132062
 
132047
132063
  var motion = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["default"])({}, Object(_utils_legacyUtil__WEBPACK_IMPORTED_MODULE_9__["getMotion"])(props));
132048
132064
 
@@ -132080,9 +132096,7 @@ var PopupInner = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__["forwardRef"](f
132080
132096
  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), {}, {
132081
132097
  zIndex: zIndex,
132082
132098
  opacity: status === 'motion' || status === 'stable' || !visible ? undefined : 0,
132083
- // Cannot interact with disappearing elements
132084
- // https://github.com/ant-design/ant-design/issues/35051#issuecomment-1101340714
132085
- pointerEvents: !visible && status !== 'stable' ? 'none' : undefined
132099
+ pointerEvents: status === 'stable' ? undefined : 'none'
132086
132100
  }, style); // Align status
132087
132101
 
132088
132102
 
@@ -132290,7 +132304,7 @@ __webpack_require__.r(__webpack_exports__);
132290
132304
 
132291
132305
 
132292
132306
 
132293
- var StatusQueue = ['measure', 'alignPre', 'align', null, 'motion'];
132307
+ var StatusQueue = ['measure', 'align', null, 'motion'];
132294
132308
  /* harmony default export */ __webpack_exports__["default"] = (function (visible, doMeasure) {
132295
132309
  var _useState = Object(rc_util_es_hooks_useState__WEBPACK_IMPORTED_MODULE_5__["default"])(null),
132296
132310
  _useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__["default"])(_useState, 2),
@@ -136249,19 +136263,16 @@ var ScrollBar = /*#__PURE__*/function (_React$Component) {
136249
136263
  };
136250
136264
 
136251
136265
  _this.removeEvents = function () {
136252
- var _this$scrollbarRef$cu;
136253
-
136254
136266
  window.removeEventListener('mousemove', _this.onMouseMove);
136255
136267
  window.removeEventListener('mouseup', _this.onMouseUp);
136256
- (_this$scrollbarRef$cu = _this.scrollbarRef.current) === null || _this$scrollbarRef$cu === void 0 ? void 0 : _this$scrollbarRef$cu.removeEventListener('touchstart', _this.onScrollbarTouchStart);
136257
136268
 
136258
- if (_this.thumbRef.current) {
136259
- _this.thumbRef.current.removeEventListener('touchstart', _this.onMouseDown);
136269
+ _this.scrollbarRef.current.removeEventListener('touchstart', _this.onScrollbarTouchStart);
136260
136270
 
136261
- _this.thumbRef.current.removeEventListener('touchmove', _this.onMouseMove);
136271
+ _this.thumbRef.current.removeEventListener('touchstart', _this.onMouseDown);
136262
136272
 
136263
- _this.thumbRef.current.removeEventListener('touchend', _this.onMouseUp);
136264
- }
136273
+ _this.thumbRef.current.removeEventListener('touchmove', _this.onMouseMove);
136274
+
136275
+ _this.thumbRef.current.removeEventListener('touchend', _this.onMouseUp);
136265
136276
 
136266
136277
  rc_util_es_raf__WEBPACK_IMPORTED_MODULE_2__["default"].cancel(_this.moveRaf);
136267
136278
  };