@douyinfe/semi-ui 2.7.1 → 2.8.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1869,6 +1869,86 @@ var parent = __webpack_require__("bLuP");
1869
1869
  module.exports = parent;
1870
1870
 
1871
1871
 
1872
+ /***/ }),
1873
+
1874
+ /***/ "0J6L":
1875
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1876
+
1877
+ "use strict";
1878
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return append; });
1879
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return prepend; });
1880
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return convertDOMRectToObject; });
1881
+ /* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("r3cb");
1882
+ /* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_reduce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_reduce__WEBPACK_IMPORTED_MODULE_0__);
1883
+
1884
+
1885
+ /**
1886
+ *
1887
+ * @param {HTMLElement} parentNode
1888
+ * @param {...HTMLElement} nodes
1889
+ *
1890
+ * @param {HTMLElement}
1891
+ */
1892
+
1893
+ function append(parentNode) {
1894
+ for (var _len = arguments.length, nodes = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1895
+ nodes[_key - 1] = arguments[_key];
1896
+ }
1897
+
1898
+ for (const node of nodes) {
1899
+ parentNode.appendChild(node);
1900
+ }
1901
+
1902
+ return parentNode;
1903
+ }
1904
+ /**
1905
+ *
1906
+ * @param {HTMLElement} parentNode
1907
+ * @param {...HTMLElement} nodes
1908
+ *
1909
+ * @param {HTMLElement}
1910
+ */
1911
+
1912
+ function prepend(parentNode) {
1913
+ for (var _len2 = arguments.length, nodes = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1914
+ nodes[_key2 - 1] = arguments[_key2];
1915
+ }
1916
+
1917
+ if (parentNode.children && parentNode.children.length) {
1918
+ const firstNode = parentNode.children[0];
1919
+
1920
+ for (const node of nodes) {
1921
+ parentNode.insertBefore(node, firstNode);
1922
+ }
1923
+ } else {
1924
+ append(parentNode, ...nodes);
1925
+ }
1926
+
1927
+ return parentNode;
1928
+ }
1929
+ /**
1930
+ *
1931
+ * @param {DOMRect} domRect
1932
+ * @returns {object|undefined}
1933
+ */
1934
+
1935
+ function convertDOMRectToObject(domRect) {
1936
+ if (domRect && typeof domRect === 'object') {
1937
+ if (typeof domRect.toJSON === 'function') {
1938
+ return domRect.toJSON();
1939
+ } else {
1940
+ const keys = ['left', 'top', 'right', 'bottom', 'width', 'height'];
1941
+ return _babel_runtime_corejs3_core_js_stable_instance_reduce__WEBPACK_IMPORTED_MODULE_0___default()(keys).call(keys, (obj, key) => {
1942
+ obj[key] = domRect[key];
1943
+ return obj;
1944
+ }, {});
1945
+ }
1946
+ }
1947
+
1948
+ return undefined;
1949
+ }
1950
+
1951
+
1872
1952
  /***/ }),
1873
1953
 
1874
1954
  /***/ "0Ocv":
@@ -4685,6 +4765,25 @@ function copySymbols(source, object) {
4685
4765
  module.exports = copySymbols;
4686
4766
 
4687
4767
 
4768
+ /***/ }),
4769
+
4770
+ /***/ "Awix":
4771
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4772
+
4773
+ "use strict";
4774
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isElement; });
4775
+ function isElement(obj) {
4776
+ try {
4777
+ // Using W3 DOM2 (works for FF, Opera and Chrome)
4778
+ return obj instanceof HTMLElement;
4779
+ } catch (e) {
4780
+ // Browsers not supporting W3 DOM2 don't have HTMLElement and
4781
+ // an exception is thrown and we end up here. Testing some
4782
+ // properties that all elements have (works on IE7)
4783
+ return typeof obj === 'object' && obj.nodeType === 1 && typeof obj.style === 'object' && typeof obj.ownerDocument === 'object';
4784
+ }
4785
+ }
4786
+
4688
4787
  /***/ }),
4689
4788
 
4690
4789
  /***/ "B3mq":
@@ -13626,12 +13725,14 @@ module.exports = {
13626
13725
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
13627
13726
 
13628
13727
  "use strict";
13629
- /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return stopPropagation; });
13728
+ /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return stopPropagation; });
13630
13729
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cloneDeep; });
13631
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getHighLightTextHTML; });
13632
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return registerMediaQuery; });
13633
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isSemiIcon; });
13730
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getHighLightTextHTML; });
13731
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return registerMediaQuery; });
13732
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isSemiIcon; });
13634
13733
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getActiveElement; });
13734
+ /* unused harmony export isNodeContainsFocus */
13735
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getFocusableElements; });
13635
13736
  /* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2srY");
13636
13737
  /* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_0__);
13637
13738
  /* harmony import */ var lodash_set__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("DL3M");
@@ -13648,10 +13749,14 @@ module.exports = {
13648
13749
  /* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_assign__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_assign__WEBPACK_IMPORTED_MODULE_6__);
13649
13750
  /* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("bIJA");
13650
13751
  /* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_7__);
13651
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("cDcd");
13652
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);
13653
- /* harmony import */ var _douyinfe_semi_foundation_utils_warning__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("MYbw");
13654
- /* harmony import */ var _douyinfe_semi_foundation_utils_getHighlight__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("C5xO");
13752
+ /* harmony import */ var _babel_runtime_corejs3_core_js_stable_array_from__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("Dc5z");
13753
+ /* harmony import */ var _babel_runtime_corejs3_core_js_stable_array_from__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_array_from__WEBPACK_IMPORTED_MODULE_8__);
13754
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("cDcd");
13755
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
13756
+ /* harmony import */ var _douyinfe_semi_foundation_utils_warning__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("MYbw");
13757
+ /* harmony import */ var _douyinfe_semi_foundation_utils_getHighlight__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("C5xO");
13758
+ /* harmony import */ var _douyinfe_semi_foundation_utils_dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("Awix");
13759
+
13655
13760
 
13656
13761
 
13657
13762
 
@@ -13667,6 +13772,7 @@ module.exports = {
13667
13772
 
13668
13773
 
13669
13774
 
13775
+
13670
13776
  /**
13671
13777
  * stop propagation
13672
13778
  *
@@ -13697,7 +13803,7 @@ function cloneDeep(value, customizer) {
13697
13803
  return customizer(v);
13698
13804
  }
13699
13805
 
13700
- if (typeof v === 'function' || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.isValidElement(v)) {
13806
+ if (typeof v === 'function' || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.isValidElement(v)) {
13701
13807
  return v;
13702
13808
  }
13703
13809
 
@@ -13716,7 +13822,7 @@ function cloneDeep(value, customizer) {
13716
13822
  }); // internal-issues:887
13717
13823
 
13718
13824
 
13719
- Object(_douyinfe_semi_foundation_utils_warning__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])(lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(process, 'env.NODE_ENV') !== 'production', "[Semi] You may use an out-of-bounds array. In some cases, your program may not behave as expected.\n The maximum length of an array is 4294967295.\n Please check whether the array subscript in your data exceeds the maximum value of the JS array subscript");
13825
+ Object(_douyinfe_semi_foundation_utils_warning__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(process, 'env.NODE_ENV') !== 'production', "[Semi] You may use an out-of-bounds array. In some cases, your program may not behave as expected.\n The maximum length of an array is 4294967295.\n Please check whether the array subscript in your data exceeds the maximum value of the JS array subscript");
13720
13826
  return newArray;
13721
13827
  } else {
13722
13828
  return undefined;
@@ -13749,7 +13855,7 @@ const getHighLightTextHTML = _ref => {
13749
13855
  caseSensitive: false
13750
13856
  }
13751
13857
  } = _ref;
13752
- const chunks = Object(_douyinfe_semi_foundation_utils_getHighlight__WEBPACK_IMPORTED_MODULE_10__[/* findAll */ "a"])(_babel_runtime_corejs3_core_js_stable_object_assign__WEBPACK_IMPORTED_MODULE_6___default()({
13858
+ const chunks = Object(_douyinfe_semi_foundation_utils_getHighlight__WEBPACK_IMPORTED_MODULE_11__[/* findAll */ "a"])(_babel_runtime_corejs3_core_js_stable_object_assign__WEBPACK_IMPORTED_MODULE_6___default()({
13753
13859
  sourceString,
13754
13860
  searchWords
13755
13861
  }, option));
@@ -13765,7 +13871,7 @@ const getHighLightTextHTML = _ref => {
13765
13871
  const text = sourceString.substr(start, end - start);
13766
13872
 
13767
13873
  if (highlight) {
13768
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(markEle, {
13874
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement(markEle, {
13769
13875
  style: highlightStyle,
13770
13876
  className: highlightClassName,
13771
13877
  key: text + index
@@ -13819,10 +13925,26 @@ const registerMediaQuery = (media, _ref2) => {
13819
13925
  * @returns boolean
13820
13926
  */
13821
13927
 
13822
- const isSemiIcon = icon => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.isValidElement(icon) && lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(icon.type, 'elementType') === 'Icon';
13928
+ const isSemiIcon = icon => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.isValidElement(icon) && lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(icon.type, 'elementType') === 'Icon';
13823
13929
  function getActiveElement() {
13824
13930
  return document ? document.activeElement : null;
13825
13931
  }
13932
+ function isNodeContainsFocus(node) {
13933
+ const activeElement = getActiveElement();
13934
+ return activeElement === node || node.contains(activeElement);
13935
+ }
13936
+ function getFocusableElements(node) {
13937
+ if (!Object(_douyinfe_semi_foundation_utils_dom__WEBPACK_IMPORTED_MODULE_12__[/* default */ "a"])(node)) {
13938
+ return [];
13939
+ }
13940
+
13941
+ const focusableSelectorsList = ["input:not([disabled]):not([tabindex='-1'])", "textarea:not([disabled]):not([tabindex='-1'])", "button:not([disabled]):not([tabindex='-1'])", "a[href]:not([tabindex='-1'])", "select:not([disabled]):not([tabindex='-1'])", "area[href]:not([tabindex='-1'])", "iframe:not([tabindex='-1'])", "object:not([tabindex='-1'])", "*[tabindex]:not([tabindex='-1'])", "*[contenteditable]:not([tabindex='-1'])"];
13942
+ const focusableSelectorsStr = focusableSelectorsList.join(','); // we are not filtered elements which are invisible
13943
+
13944
+ const focusableElements = _babel_runtime_corejs3_core_js_stable_array_from__WEBPACK_IMPORTED_MODULE_8___default()(node.querySelectorAll(focusableSelectorsStr));
13945
+
13946
+ return focusableElements;
13947
+ }
13826
13948
  /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("F63i")))
13827
13949
 
13828
13950
  /***/ }),
@@ -23542,6 +23664,10 @@ var external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_
23542
23664
  var set_timeout = __webpack_require__("rPqN");
23543
23665
  var set_timeout_default = /*#__PURE__*/__webpack_require__.n(set_timeout);
23544
23666
 
23667
+ // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/isFunction.js
23668
+ var isFunction = __webpack_require__("2q8g");
23669
+ var isFunction_default = /*#__PURE__*/__webpack_require__.n(isFunction);
23670
+
23545
23671
  // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/isEmpty.js
23546
23672
  var lodash_isEmpty = __webpack_require__("MwrP");
23547
23673
  var isEmpty_default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty);
@@ -23647,78 +23773,8 @@ class Event_Event {
23647
23773
  }
23648
23774
 
23649
23775
  }
23650
- // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js
23651
- var reduce = __webpack_require__("r3cb");
23652
- var reduce_default = /*#__PURE__*/__webpack_require__.n(reduce);
23653
-
23654
- // CONCATENATED MODULE: ../semi-foundation/utils/dom.ts
23655
-
23656
-
23657
- /**
23658
- *
23659
- * @param {HTMLElement} parentNode
23660
- * @param {...HTMLElement} nodes
23661
- *
23662
- * @param {HTMLElement}
23663
- */
23664
-
23665
- function append(parentNode) {
23666
- for (var _len = arguments.length, nodes = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
23667
- nodes[_key - 1] = arguments[_key];
23668
- }
23669
-
23670
- for (const node of nodes) {
23671
- parentNode.appendChild(node);
23672
- }
23673
-
23674
- return parentNode;
23675
- }
23676
- /**
23677
- *
23678
- * @param {HTMLElement} parentNode
23679
- * @param {...HTMLElement} nodes
23680
- *
23681
- * @param {HTMLElement}
23682
- */
23683
-
23684
- function prepend(parentNode) {
23685
- for (var _len2 = arguments.length, nodes = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
23686
- nodes[_key2 - 1] = arguments[_key2];
23687
- }
23688
-
23689
- if (parentNode.children && parentNode.children.length) {
23690
- const firstNode = parentNode.children[0];
23691
-
23692
- for (const node of nodes) {
23693
- parentNode.insertBefore(node, firstNode);
23694
- }
23695
- } else {
23696
- append(parentNode, ...nodes);
23697
- }
23698
-
23699
- return parentNode;
23700
- }
23701
- /**
23702
- *
23703
- * @param {DOMRect} domRect
23704
- * @returns {object|undefined}
23705
- */
23706
-
23707
- function convertDOMRectToObject(domRect) {
23708
- if (domRect && typeof domRect === 'object') {
23709
- if (typeof domRect.toJSON === 'function') {
23710
- return domRect.toJSON();
23711
- } else {
23712
- const keys = ['left', 'top', 'right', 'bottom', 'width', 'height'];
23713
- return reduce_default()(keys).call(keys, (obj, key) => {
23714
- obj[key] = domRect[key];
23715
- return obj;
23716
- }, {});
23717
- }
23718
- }
23719
-
23720
- return undefined;
23721
- }
23776
+ // EXTERNAL MODULE: ../semi-foundation/utils/dom.ts
23777
+ var dom = __webpack_require__("0J6L");
23722
23778
 
23723
23779
  // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js
23724
23780
  var define_property = __webpack_require__("K1iI");
@@ -23902,6 +23958,42 @@ class foundation_Tooltip extends foundation {
23902
23958
  }
23903
23959
  };
23904
23960
 
23961
+ this.handleContainerKeydown = event => {
23962
+ const {
23963
+ guardFocus,
23964
+ closeOnEsc
23965
+ } = this.getProps();
23966
+
23967
+ switch (event && event.key) {
23968
+ case "Escape":
23969
+ closeOnEsc && this._handleEscKeyDown(event);
23970
+ break;
23971
+
23972
+ case "Tab":
23973
+ if (guardFocus) {
23974
+ const container = this._adapter.getContainer();
23975
+
23976
+ const focusableElements = this._adapter.getFocusableElements(container);
23977
+
23978
+ const focusableNum = focusableElements.length;
23979
+
23980
+ if (focusableNum) {
23981
+ // Shift + Tab will move focus backward
23982
+ if (event.shiftKey) {
23983
+ this._handleContainerShiftTabKeyDown(focusableElements, event);
23984
+ } else {
23985
+ this._handleContainerTabKeyDown(focusableElements, event);
23986
+ }
23987
+ }
23988
+ }
23989
+
23990
+ break;
23991
+
23992
+ default:
23993
+ break;
23994
+ }
23995
+ };
23996
+
23905
23997
  this._timer = null;
23906
23998
  }
23907
23999
 
@@ -23999,7 +24091,12 @@ class foundation_Tooltip extends foundation {
23999
24091
  _generateEvent(types) {
24000
24092
  const eventNames = this._adapter.getEventName();
24001
24093
 
24002
- const triggerEventSet = {};
24094
+ const triggerEventSet = {
24095
+ // bind esc keydown on trigger for a11y
24096
+ [eventNames.keydown]: event => {
24097
+ this._handleTriggerKeydown(event);
24098
+ }
24099
+ };
24003
24100
  let portalEventSet = {};
24004
24101
 
24005
24102
  switch (types) {
@@ -24035,6 +24132,15 @@ class foundation_Tooltip extends foundation {
24035
24132
  triggerEventSet[eventNames.mouseLeave] = () => {
24036
24133
  // console.log(e);
24037
24134
  this.delayHide(); // this.hide('trigger');
24135
+ }; // bind focus to hover trigger for a11y
24136
+
24137
+
24138
+ triggerEventSet[eventNames.focus] = () => {
24139
+ this.delayShow();
24140
+ };
24141
+
24142
+ triggerEventSet[eventNames.blur] = () => {
24143
+ this.delayHide();
24038
24144
  };
24039
24145
 
24040
24146
  portalEventSet = assign_default()({}, triggerEventSet);
@@ -24058,7 +24164,7 @@ class foundation_Tooltip extends foundation {
24058
24164
 
24059
24165
  case 'custom':
24060
24166
  // when trigger type is 'custom', no need to bind eventHandler
24061
- // show/hide completely depond on props.visible which change by user
24167
+ // show/hide completely depend on props.visible which change by user
24062
24168
  break;
24063
24169
 
24064
24170
  default:
@@ -24084,7 +24190,13 @@ class foundation_Tooltip extends foundation {
24084
24190
  const nowVisible = this.getState('visible');
24085
24191
 
24086
24192
  if (nowVisible !== isVisible) {
24087
- this._adapter.togglePortalVisible(isVisible, () => this._adapter.notifyVisibleChange(isVisible));
24193
+ this._adapter.togglePortalVisible(isVisible, () => {
24194
+ if (isVisible) {
24195
+ this._adapter.setInitialFocus();
24196
+ }
24197
+
24198
+ this._adapter.notifyVisibleChange(isVisible);
24199
+ });
24088
24200
  }
24089
24201
  }
24090
24202
 
@@ -24587,6 +24699,106 @@ class foundation_Tooltip extends foundation {
24587
24699
  this._adapter.updateContainerPosition();
24588
24700
  }
24589
24701
 
24702
+ _handleTriggerKeydown(event) {
24703
+ const {
24704
+ closeOnEsc
24705
+ } = this.getProps();
24706
+
24707
+ const container = this._adapter.getContainer();
24708
+
24709
+ const focusableElements = this._adapter.getFocusableElements(container);
24710
+
24711
+ const focusableNum = focusableElements.length;
24712
+
24713
+ switch (event && event.key) {
24714
+ case "Escape":
24715
+ closeOnEsc && this._handleEscKeyDown(event);
24716
+ break;
24717
+
24718
+ case "ArrowUp":
24719
+ focusableNum && this._handleTriggerArrowUpKeydown(focusableElements, event);
24720
+ break;
24721
+
24722
+ case "ArrowDown":
24723
+ focusableNum && this._handleTriggerArrowDownKeydown(focusableElements, event);
24724
+ break;
24725
+
24726
+ default:
24727
+ break;
24728
+ }
24729
+ }
24730
+ /**
24731
+ * focus trigger
24732
+ *
24733
+ * when trigger is 'focus' or 'hover', onFocus is bind to show popup
24734
+ * if we focus trigger, popup will show again
24735
+ *
24736
+ * 如果 trigger 是 focus 或者 hover,则它绑定了 onFocus,这里我们如果重新 focus 的话,popup 会再次打开
24737
+ * 因此 returnFocusOnClose 只支持 click trigger
24738
+ */
24739
+
24740
+
24741
+ _focusTrigger() {
24742
+ const {
24743
+ trigger,
24744
+ returnFocusOnClose
24745
+ } = this.getProps();
24746
+
24747
+ if (returnFocusOnClose && trigger === 'click') {
24748
+ const triggerNode = this._adapter.getTriggerNode();
24749
+
24750
+ if (triggerNode && 'focus' in triggerNode) {
24751
+ triggerNode.focus();
24752
+ }
24753
+ }
24754
+ }
24755
+
24756
+ _handleEscKeyDown(event) {
24757
+ const {
24758
+ trigger
24759
+ } = this.getProps();
24760
+
24761
+ if (trigger !== 'custom') {
24762
+ this.hide();
24763
+
24764
+ this._focusTrigger();
24765
+ }
24766
+
24767
+ this._adapter.notifyEscKeydown(event);
24768
+ }
24769
+
24770
+ _handleContainerTabKeyDown(focusableElements, event) {
24771
+ const activeElement = this._adapter.getActiveElement();
24772
+
24773
+ const isLastCurrentFocus = focusableElements[focusableElements.length - 1] === activeElement;
24774
+
24775
+ if (isLastCurrentFocus) {
24776
+ focusableElements[0].focus();
24777
+ event.preventDefault(); // prevent browser default tab move behavior
24778
+ }
24779
+ }
24780
+
24781
+ _handleContainerShiftTabKeyDown(focusableElements, event) {
24782
+ const activeElement = this._adapter.getActiveElement();
24783
+
24784
+ const isFirstCurrentFocus = focusableElements[0] === activeElement;
24785
+
24786
+ if (isFirstCurrentFocus) {
24787
+ focusableElements[focusableElements.length - 1].focus();
24788
+ event.preventDefault(); // prevent browser default tab move behavior
24789
+ }
24790
+ }
24791
+
24792
+ _handleTriggerArrowDownKeydown(focusableElements, event) {
24793
+ focusableElements[0].focus();
24794
+ event.preventDefault(); // prevent browser default scroll behavior
24795
+ }
24796
+
24797
+ _handleTriggerArrowUpKeydown(focusableElements, event) {
24798
+ focusableElements[focusableElements.length - 1].focus();
24799
+ event.preventDefault(); // prevent browser default scroll behavior
24800
+ }
24801
+
24590
24802
  }
24591
24803
  // CONCATENATED MODULE: ../semi-foundation/tooltip/constants.ts
24592
24804
 
@@ -24664,18 +24876,9 @@ function getUuidShort() {
24664
24876
  // EXTERNAL MODULE: ../semi-foundation/tooltip/tooltip.scss
24665
24877
  var tooltip = __webpack_require__("VQVM");
24666
24878
 
24667
- // CONCATENATED MODULE: ../semi-foundation/utils/isElement.ts
24668
- function isElement(obj) {
24669
- try {
24670
- // Using W3 DOM2 (works for FF, Opera and Chrome)
24671
- return obj instanceof HTMLElement;
24672
- } catch (e) {
24673
- // Browsers not supporting W3 DOM2 don't have HTMLElement and
24674
- // an exception is thrown and we end up here. Testing some
24675
- // properties that all elements have (works on IE7)
24676
- return typeof obj === 'object' && obj.nodeType === 1 && typeof obj.style === 'object' && typeof obj.ownerDocument === 'object';
24677
- }
24678
- }
24879
+ // EXTERNAL MODULE: ../semi-foundation/utils/isElement.ts
24880
+ var isElement = __webpack_require__("Awix");
24881
+
24679
24882
  // EXTERNAL MODULE: ./_utils/index.ts
24680
24883
  var _utils = __webpack_require__("UU7A");
24681
24884
 
@@ -24903,6 +25106,10 @@ const TriangleArrowVertical = props => {
24903
25106
  };
24904
25107
 
24905
25108
  /* harmony default export */ var tooltip_TriangleArrowVertical = (TriangleArrowVertical);
25109
+ // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js
25110
+ var reduce = __webpack_require__("r3cb");
25111
+ var reduce_default = /*#__PURE__*/__webpack_require__.n(reduce);
25112
+
24906
25113
  // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/@babel/runtime-corejs3/core-js-stable/object/values.js
24907
25114
  var object_values = __webpack_require__("Mb5A");
24908
25115
  var values_default = /*#__PURE__*/__webpack_require__.n(object_values);
@@ -26720,6 +26927,7 @@ const TooltipTransition = function () {
26720
26927
 
26721
26928
 
26722
26929
 
26930
+
26723
26931
  var tooltip_rest = undefined && undefined.__rest || function (s, e) {
26724
26932
  var t = {};
26725
26933
 
@@ -26771,7 +26979,7 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
26771
26979
  };
26772
26980
 
26773
26981
  this.isSpecial = elem => {
26774
- if (isElement(elem)) {
26982
+ if (Object(isElement["a" /* default */])(elem)) {
26775
26983
  return Boolean(elem.disabled);
26776
26984
  } else if ( /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["isValidElement"])(elem)) {
26777
26985
  const disabled = get_default()(elem, 'props.disabled');
@@ -26844,10 +27052,21 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
26844
27052
  }
26845
27053
 
26846
27054
  if (this.props.stopPropagation) {
26847
- Object(_utils["f" /* stopPropagation */])(e);
27055
+ Object(_utils["g" /* stopPropagation */])(e);
26848
27056
  }
26849
27057
  };
26850
27058
 
27059
+ this.handlePortalInnerKeyDown = e => {
27060
+ this.foundation.handleContainerKeydown(e);
27061
+ };
27062
+
27063
+ this.renderContentNode = content => {
27064
+ const contentProps = {
27065
+ initialFocusRef: this.initialFocusRef
27066
+ };
27067
+ return !isFunction_default()(content) ? content : content(contentProps);
27068
+ };
27069
+
26851
27070
  this.renderPortal = () => {
26852
27071
  const {
26853
27072
  containerStyle = {},
@@ -26867,6 +27086,7 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
26867
27086
  role,
26868
27087
  zIndex
26869
27088
  } = this.props;
27089
+ const contentNode = this.renderContentNode(content);
26870
27090
  const {
26871
27091
  className: propClassName
26872
27092
  } = this.props;
@@ -26904,7 +27124,7 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
26904
27124
  role: role,
26905
27125
  "x-placement": placement,
26906
27126
  id: id
26907
- }), content, icon);
27127
+ }), contentNode, icon);
26908
27128
  } : null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({
26909
27129
  className: className
26910
27130
  }, portalEventSet, {
@@ -26912,7 +27132,7 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
26912
27132
  style: assign_default()({
26913
27133
  visibility: motion ? undefined : 'visible'
26914
27134
  }, style)
26915
- }), content, icon);
27135
+ }), contentNode, icon);
26916
27136
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(_portal, {
26917
27137
  getPopupContainer: this.props.getPopupContainer,
26918
27138
  style: {
@@ -26922,7 +27142,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
26922
27142
  className: "".concat(BASE_CLASS_PREFIX, "-portal-inner"),
26923
27143
  style: portalInnerStyle,
26924
27144
  ref: this.setContainerEl,
26925
- onClick: this.handlePortalInnerClick
27145
+ onClick: this.handlePortalInnerClick,
27146
+ onKeyDown: this.handlePortalInnerKeyDown
26926
27147
  }, inner));
26927
27148
  };
26928
27149
 
@@ -26990,6 +27211,7 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
26990
27211
  this.eventManager = new Event_Event();
26991
27212
  this.triggerEl = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
26992
27213
  this.containerEl = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
27214
+ this.initialFocusRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
26993
27215
  this.clickOutsideHandler = null;
26994
27216
  this.resizeHandler = null;
26995
27217
  this.isWrapped = false; // Identifies whether a span element is wrapped
@@ -27041,7 +27263,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
27041
27263
  mouseOver: 'onMouseOver',
27042
27264
  click: 'onClick',
27043
27265
  focus: 'onFocus',
27044
- blur: 'onBlur'
27266
+ blur: 'onBlur',
27267
+ keydown: 'onKeyDown'
27045
27268
  }),
27046
27269
  registerTriggerEvent: triggerEventSet => {
27047
27270
  this.setState({
@@ -27059,14 +27282,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
27059
27282
  // eslint-disable-next-line
27060
27283
  // It may be a React component or an html element
27061
27284
  // There is no guarantee that triggerE l.current can get the real dom, so call findDOMNode to ensure that you can get the real dom
27062
- let triggerDOM = this.triggerEl.current;
27063
-
27064
- if (!isElement(this.triggerEl.current)) {
27065
- const realDomNode = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.findDOMNode(this.triggerEl.current);
27066
- this.triggerEl.current = realDomNode;
27067
- triggerDOM = realDomNode;
27068
- }
27069
-
27285
+ const triggerDOM = this.adapter.getTriggerNode();
27286
+ this.triggerEl.current = triggerDOM;
27070
27287
  return triggerDOM && triggerDOM.getBoundingClientRect();
27071
27288
  },
27072
27289
  // Gets the outer size of the specified container
@@ -27074,8 +27291,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
27074
27291
  const container = this.getPopupContainer();
27075
27292
  let rect = null;
27076
27293
 
27077
- if (container && isElement(container)) {
27078
- const boundingRect = convertDOMRectToObject(container.getBoundingClientRect());
27294
+ if (container && Object(isElement["a" /* default */])(container)) {
27295
+ const boundingRect = Object(dom["b" /* convertDOMRectToObject */])(container.getBoundingClientRect());
27079
27296
  rect = assign_default()(assign_default()({}, boundingRect), {
27080
27297
  scrollLeft: container.scrollLeft,
27081
27298
  scrollTop: container.scrollTop
@@ -27203,12 +27420,7 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
27203
27420
  return false;
27204
27421
  }
27205
27422
 
27206
- let triggerDOM = this.triggerEl.current;
27207
-
27208
- if (!isElement(this.triggerEl.current)) {
27209
- triggerDOM = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.findDOMNode(this.triggerEl.current);
27210
- }
27211
-
27423
+ const triggerDOM = this.adapter.getTriggerNode();
27212
27424
  const isRelativeScroll = e.target.contains(triggerDOM);
27213
27425
 
27214
27426
  if (isRelativeScroll) {
@@ -27232,14 +27444,40 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
27232
27444
  updateContainerPosition: () => {
27233
27445
  const container = this.getPopupContainer();
27234
27446
 
27235
- if (container && isElement(container)) {
27447
+ if (container && Object(isElement["a" /* default */])(container)) {
27236
27448
  // getComputedStyle need first parameter is Element type
27237
27449
  const computedStyle = window.getComputedStyle(container);
27238
27450
  const position = computedStyle.getPropertyValue('position');
27239
27451
  this.containerPosition = position;
27240
27452
  }
27241
27453
  },
27242
- getContainerPosition: () => this.containerPosition
27454
+ getContainerPosition: () => this.containerPosition,
27455
+ getContainer: () => this.containerEl && this.containerEl.current,
27456
+ getTriggerNode: () => {
27457
+ let triggerDOM = this.triggerEl.current;
27458
+
27459
+ if (!Object(isElement["a" /* default */])(this.triggerEl.current)) {
27460
+ triggerDOM = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.findDOMNode(this.triggerEl.current);
27461
+ }
27462
+
27463
+ return triggerDOM;
27464
+ },
27465
+ getFocusableElements: node => {
27466
+ return Object(_utils["c" /* getFocusableElements */])(node);
27467
+ },
27468
+ getActiveElement: () => {
27469
+ return Object(_utils["b" /* getActiveElement */])();
27470
+ },
27471
+ setInitialFocus: () => {
27472
+ const focusRefNode = get_default()(this, 'initialFocusRef.current');
27473
+
27474
+ if (focusRefNode && 'focus' in focusRefNode) {
27475
+ focusRefNode.focus();
27476
+ }
27477
+ },
27478
+ notifyEscKeydown: event => {
27479
+ this.props.onEscKeyDown(event);
27480
+ }
27243
27481
  });
27244
27482
  }
27245
27483
 
@@ -27281,7 +27519,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
27281
27519
  } = this.state;
27282
27520
  const {
27283
27521
  wrapWhenSpecial,
27284
- role
27522
+ role,
27523
+ trigger
27285
27524
  } = this.props;
27286
27525
  let {
27287
27526
  children
@@ -27341,7 +27580,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
27341
27580
  } else if (ref && typeof ref === 'object') {
27342
27581
  ref.current = node;
27343
27582
  }
27344
- }
27583
+ },
27584
+ tabIndex: trigger === 'hover' ? 0 : undefined
27345
27585
  })); // If you do not add a layer of div, in order to bind the events and className in the tooltip, you need to cloneElement children, but this time it may overwrite the children's original ref reference
27346
27586
  // So if the user adds ref to the content, you need to use callback ref: https://github.com/facebook/react/issues/8873
27347
27587
 
@@ -27366,7 +27606,7 @@ tooltip_Tooltip.propTypes = {
27366
27606
  clickTriggerToHide: prop_types_default.a.bool,
27367
27607
  visible: prop_types_default.a.bool,
27368
27608
  style: prop_types_default.a.object,
27369
- content: prop_types_default.a.node,
27609
+ content: prop_types_default.a.oneOfType([prop_types_default.a.node, prop_types_default.a.func]),
27370
27610
  prefixCls: prop_types_default.a.string,
27371
27611
  onVisibleChange: prop_types_default.a.func,
27372
27612
  onClickOutSide: prop_types_default.a.func,
@@ -27380,8 +27620,9 @@ tooltip_Tooltip.propTypes = {
27380
27620
  stopPropagation: prop_types_default.a.bool,
27381
27621
  // private
27382
27622
  role: prop_types_default.a.string,
27383
- wrapWhenSpecial: prop_types_default.a.bool // when trigger has special status such as "disabled" or "loading", wrap span
27384
-
27623
+ wrapWhenSpecial: prop_types_default.a.bool,
27624
+ guardFocus: prop_types_default.a.bool,
27625
+ returnFocusOnClose: prop_types_default.a.bool
27385
27626
  };
27386
27627
  tooltip_Tooltip.defaultProps = {
27387
27628
  arrowBounding: numbers.ARROW_BOUNDING,
@@ -27400,7 +27641,11 @@ tooltip_Tooltip.defaultProps = {
27400
27641
  spacing: numbers.SPACING,
27401
27642
  showArrow: true,
27402
27643
  wrapWhenSpecial: true,
27403
- zIndex: numbers.DEFAULT_Z_INDEX
27644
+ zIndex: numbers.DEFAULT_Z_INDEX,
27645
+ closeOnEsc: false,
27646
+ guardFocus: false,
27647
+ returnFocusOnClose: false,
27648
+ onEscKeyDown: noop_default.a
27404
27649
  };
27405
27650
 
27406
27651
  // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/copy-text-to-clipboard/index.js
@@ -30280,6 +30525,7 @@ const keyCode_keyCode = {
30280
30525
  };
30281
30526
  const ENTER_KEY = 'Enter';
30282
30527
  const TAB_KEY = 'Tab';
30528
+ const ESC_KEY = 'Escape';
30283
30529
  /* harmony default export */ var utils_keyCode = (keyCode_keyCode);
30284
30530
  // CONCATENATED MODULE: ../semi-foundation/utils/isEnterPress.ts
30285
30531
 
@@ -30530,6 +30776,7 @@ var popover = __webpack_require__("f8hu");
30530
30776
 
30531
30777
 
30532
30778
 
30779
+
30533
30780
  var popover_rest = undefined && undefined.__rest || function (s, e) {
30534
30781
  var t = {};
30535
30782
 
@@ -30554,23 +30801,45 @@ const popover_positionSet = popover_constants_strings.POSITION_SET;
30554
30801
  const popover_triggerSet = popover_constants_strings.TRIGGER_SET;
30555
30802
 
30556
30803
  class popover_Popover extends external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.PureComponent {
30557
- renderPopCard() {
30558
- const {
30559
- content,
30560
- contentClassName,
30561
- prefixCls
30562
- } = this.props;
30563
- const {
30564
- direction
30565
- } = this.context;
30566
- const popCardCls = classnames_default()(prefixCls, contentClassName, {
30567
- ["".concat(prefixCls, "-rtl")]: direction === 'rtl'
30568
- });
30569
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
30570
- className: popCardCls
30571
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
30572
- className: "".concat(prefixCls, "-content")
30573
- }, content));
30804
+ constructor() {
30805
+ super(...arguments);
30806
+
30807
+ this.renderPopCard = _ref => {
30808
+ let {
30809
+ initialFocusRef
30810
+ } = _ref;
30811
+ const {
30812
+ content,
30813
+ contentClassName,
30814
+ prefixCls
30815
+ } = this.props;
30816
+ const {
30817
+ direction
30818
+ } = this.context;
30819
+ const popCardCls = classnames_default()(prefixCls, contentClassName, {
30820
+ ["".concat(prefixCls, "-rtl")]: direction === 'rtl'
30821
+ });
30822
+ const contentNode = this.renderContentNode({
30823
+ initialFocusRef,
30824
+ content
30825
+ });
30826
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
30827
+ className: popCardCls
30828
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
30829
+ className: "".concat(prefixCls, "-content")
30830
+ }, contentNode));
30831
+ };
30832
+
30833
+ this.renderContentNode = props => {
30834
+ const {
30835
+ initialFocusRef,
30836
+ content
30837
+ } = props;
30838
+ const contentProps = {
30839
+ initialFocusRef
30840
+ };
30841
+ return !isFunction_default()(content) ? content : content(contentProps);
30842
+ };
30574
30843
  }
30575
30844
 
30576
30845
  render() {
@@ -30590,7 +30859,6 @@ class popover_Popover extends external_root_React_commonjs2_react_commonjs_react
30590
30859
  let {
30591
30860
  spacing
30592
30861
  } = this.props;
30593
- const popContent = this.renderPopCard();
30594
30862
  const arrowProps = {
30595
30863
  position,
30596
30864
  className: '',
@@ -30604,11 +30872,13 @@ class popover_Popover extends external_root_React_commonjs2_react_commonjs_react
30604
30872
  }
30605
30873
 
30606
30874
  const role = trigger === 'click' || trigger === 'custom' ? 'dialog' : 'tooltip';
30607
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, assign_default()({}, attr, {
30875
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, assign_default()({
30876
+ guardFocus: true
30877
+ }, attr, {
30608
30878
  trigger: trigger,
30609
30879
  position: position,
30610
30880
  style: style,
30611
- content: popContent,
30881
+ content: this.renderPopCard,
30612
30882
  prefixCls: prefixCls,
30613
30883
  spacing: spacing,
30614
30884
  showArrow: arrow,
@@ -30622,7 +30892,7 @@ class popover_Popover extends external_root_React_commonjs2_react_commonjs_react
30622
30892
  popover_Popover.contextType = configProvider_context;
30623
30893
  popover_Popover.propTypes = {
30624
30894
  children: prop_types_default.a.node,
30625
- content: prop_types_default.a.node,
30895
+ content: prop_types_default.a.oneOfType([prop_types_default.a.node, prop_types_default.a.func]),
30626
30896
  visible: prop_types_default.a.bool,
30627
30897
  autoAdjustOverflow: prop_types_default.a.bool,
30628
30898
  motion: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.object, prop_types_default.a.func]),
@@ -30645,7 +30915,8 @@ popover_Popover.propTypes = {
30645
30915
  }),
30646
30916
  arrowPointAtCenter: prop_types_default.a.bool,
30647
30917
  arrowBounding: prop_types_default.a.object,
30648
- prefixCls: prop_types_default.a.string
30918
+ prefixCls: prop_types_default.a.string,
30919
+ guardFocus: prop_types_default.a.bool
30649
30920
  };
30650
30921
  popover_Popover.defaultProps = {
30651
30922
  arrowBounding: constants_numbers.ARROW_BOUNDING,
@@ -30658,7 +30929,11 @@ popover_Popover.defaultProps = {
30658
30929
  okText: 'Yes',
30659
30930
  position: 'bottom',
30660
30931
  prefixCls: popover_constants_cssClasses.PREFIX,
30661
- onClickOutSide: noop_default.a
30932
+ onClickOutSide: noop_default.a,
30933
+ onEscKeyDown: noop_default.a,
30934
+ closeOnEsc: true,
30935
+ returnFocusOnClose: true,
30936
+ guardFocus: true
30662
30937
  };
30663
30938
  /* harmony default export */ var popover_0 = (popover_Popover);
30664
30939
  // CONCATENATED MODULE: ./typography/util.tsx
@@ -31341,7 +31616,7 @@ class base_Base extends external_root_React_commonjs2_react_commonjs_react_amd_r
31341
31616
  const iconSize = size === 'small' ? 'small' : 'default';
31342
31617
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
31343
31618
  className: "".concat(base_prefixCls, "-icon")
31344
- }, Object(_utils["d" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
31619
+ }, Object(_utils["e" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
31345
31620
  size: iconSize
31346
31621
  }) : icon);
31347
31622
  }
@@ -32950,10 +33225,6 @@ spin_Spin.defaultProps = {
32950
33225
  delay: 0
32951
33226
  };
32952
33227
  /* harmony default export */ var spin_0 = (spin_Spin);
32953
- // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/isFunction.js
32954
- var isFunction = __webpack_require__("2q8g");
32955
- var isFunction_default = /*#__PURE__*/__webpack_require__.n(isFunction);
32956
-
32957
33228
  // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/set.js
32958
33229
  var lodash_set = __webpack_require__("DL3M");
32959
33230
  var lodash_set_default = /*#__PURE__*/__webpack_require__.n(lodash_set);
@@ -33540,7 +33811,7 @@ class input_Input extends baseComponent_BaseComponent {
33540
33811
  const prefixWrapperCls = classnames_default()({
33541
33812
  ["".concat(input_prefixCls, "-prepend")]: true,
33542
33813
  ["".concat(input_prefixCls, "-prepend-text")]: addonBefore && isString_default()(addonBefore),
33543
- ["".concat(input_prefixCls, "-prepend-icon")]: Object(_utils["d" /* isSemiIcon */])(addonBefore)
33814
+ ["".concat(input_prefixCls, "-prepend-icon")]: Object(_utils["e" /* isSemiIcon */])(addonBefore)
33544
33815
  });
33545
33816
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
33546
33817
  className: prefixWrapperCls
@@ -33559,7 +33830,7 @@ class input_Input extends baseComponent_BaseComponent {
33559
33830
  const prefixWrapperCls = classnames_default()({
33560
33831
  ["".concat(input_prefixCls, "-append")]: true,
33561
33832
  ["".concat(input_prefixCls, "-append-text")]: addonAfter && isString_default()(addonAfter),
33562
- ["".concat(input_prefixCls, "-append-icon")]: Object(_utils["d" /* isSemiIcon */])(addonAfter)
33833
+ ["".concat(input_prefixCls, "-append-icon")]: Object(_utils["e" /* isSemiIcon */])(addonAfter)
33563
33834
  });
33564
33835
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
33565
33836
  className: prefixWrapperCls
@@ -33635,7 +33906,7 @@ class input_Input extends baseComponent_BaseComponent {
33635
33906
  ["".concat(input_prefixCls, "-prefix")]: true,
33636
33907
  ["".concat(input_prefixCls, "-inset-label")]: insetLabel,
33637
33908
  ["".concat(input_prefixCls, "-prefix-text")]: labelNode && isString_default()(labelNode),
33638
- ["".concat(input_prefixCls, "-prefix-icon")]: Object(_utils["d" /* isSemiIcon */])(labelNode)
33909
+ ["".concat(input_prefixCls, "-prefix-icon")]: Object(_utils["e" /* isSemiIcon */])(labelNode)
33639
33910
  }); // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
33640
33911
 
33641
33912
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
@@ -33672,7 +33943,7 @@ class input_Input extends baseComponent_BaseComponent {
33672
33943
  const suffixWrapperCls = classnames_default()({
33673
33944
  ["".concat(input_prefixCls, "-suffix")]: true,
33674
33945
  ["".concat(input_prefixCls, "-suffix-text")]: suffix && isString_default()(suffix),
33675
- ["".concat(input_prefixCls, "-suffix-icon")]: Object(_utils["d" /* isSemiIcon */])(suffix),
33946
+ ["".concat(input_prefixCls, "-suffix-icon")]: Object(_utils["e" /* isSemiIcon */])(suffix),
33676
33947
  ["".concat(input_prefixCls, "-suffix-hidden")]: suffixAllowClear && Boolean(hideSuffix)
33677
33948
  }); // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
33678
33949
 
@@ -33722,7 +33993,7 @@ class input_Input extends baseComponent_BaseComponent {
33722
33993
  minLength: stateMinLength
33723
33994
  } = this.state;
33724
33995
  const suffixAllowClear = this.showClearBtn();
33725
- const suffixIsIcon = Object(_utils["d" /* isSemiIcon */])(suffix);
33996
+ const suffixIsIcon = Object(_utils["e" /* isSemiIcon */])(suffix);
33726
33997
  const ref = forwardRef || this.inputRef;
33727
33998
  const wrapperPrefix = "".concat(input_prefixCls, "-wrapper");
33728
33999
  const wrapperCls = classnames_default()(wrapperPrefix, className, {
@@ -34003,7 +34274,7 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
34003
34274
  } = _ref;
34004
34275
 
34005
34276
  if (isString_default()(children) && inputValue) {
34006
- return Object(_utils["c" /* getHighLightTextHTML */])(config);
34277
+ return Object(_utils["d" /* getHighLightTextHTML */])(config);
34007
34278
  }
34008
34279
 
34009
34280
  return children;
@@ -47261,7 +47532,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
47261
47532
  const suffixWrapperCls = classnames_default()({
47262
47533
  ["".concat(cascader_prefixcls, "-suffix")]: true,
47263
47534
  ["".concat(cascader_prefixcls, "-suffix-text")]: suffix && isString_default()(suffix),
47264
- ["".concat(cascader_prefixcls, "-suffix-icon")]: Object(_utils["d" /* isSemiIcon */])(suffix)
47535
+ ["".concat(cascader_prefixcls, "-suffix-icon")]: Object(_utils["e" /* isSemiIcon */])(suffix)
47265
47536
  });
47266
47537
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
47267
47538
  className: suffixWrapperCls
@@ -47280,7 +47551,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
47280
47551
  // to be doublechecked
47281
47552
  ["".concat(cascader_prefixcls, "-inset-label")]: insetLabel,
47282
47553
  ["".concat(cascader_prefixcls, "-prefix-text")]: labelNode && isString_default()(labelNode),
47283
- ["".concat(cascader_prefixcls, "-prefix-icon")]: Object(_utils["d" /* isSemiIcon */])(labelNode)
47554
+ ["".concat(cascader_prefixcls, "-prefix-icon")]: Object(_utils["e" /* isSemiIcon */])(labelNode)
47284
47555
  });
47285
47556
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
47286
47557
  className: prefixWrapperCls,
@@ -55161,76 +55432,6 @@ dateInput_DateInput.defaultProps = {
55161
55432
  prefixCls: datePicker_constants_cssClasses.PREFIX,
55162
55433
  rangeSeparator: datePicker_constants_strings.DEFAULT_SEPARATOR_RANGE
55163
55434
  };
55164
- // CONCATENATED MODULE: /home/runner/work/semi-design/semi-design/node_modules/date-fns/esm/addMonths/index.js
55165
-
55166
-
55167
-
55168
- /**
55169
- * @name addMonths
55170
- * @category Month Helpers
55171
- * @summary Add the specified number of months to the given date.
55172
- *
55173
- * @description
55174
- * Add the specified number of months to the given date.
55175
- *
55176
- * ### v2.0.0 breaking changes:
55177
- *
55178
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
55179
- *
55180
- * @param {Date|Number} date - the date to be changed
55181
- * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
55182
- * @returns {Date} the new date with the months added
55183
- * @throws {TypeError} 2 arguments required
55184
- *
55185
- * @example
55186
- * // Add 5 months to 1 September 2014:
55187
- * const result = addMonths(new Date(2014, 8, 1), 5)
55188
- * //=> Sun Feb 01 2015 00:00:00
55189
- */
55190
-
55191
- function addMonths(dirtyDate, dirtyAmount) {
55192
- requiredArgs(2, arguments);
55193
- var date = toDate(dirtyDate);
55194
- var amount = toInteger(dirtyAmount);
55195
-
55196
- if (isNaN(amount)) {
55197
- return new Date(NaN);
55198
- }
55199
-
55200
- if (!amount) {
55201
- // If 0 months, no-op to avoid changing times in the hour before end of DST
55202
- return date;
55203
- }
55204
-
55205
- var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for
55206
- // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
55207
- // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
55208
- // want except that dates will wrap around the end of a month, meaning that
55209
- // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
55210
- // we'll default to the end of the desired month by adding 1 to the desired
55211
- // month and using a date of 0 to back up one day to the end of the desired
55212
- // month.
55213
-
55214
- var endOfDesiredMonth = new Date(date.getTime());
55215
- endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
55216
- var daysInMonth = endOfDesiredMonth.getDate();
55217
-
55218
- if (dayOfMonth >= daysInMonth) {
55219
- // If we're already at the end of the month, then this is the correct date
55220
- // and we're done.
55221
- return endOfDesiredMonth;
55222
- } else {
55223
- // Otherwise, we now know that setting the original day-of-month value won't
55224
- // cause an overflow, so set the desired day-of-month. Note that we can't
55225
- // just set the date of `endOfDesiredMonth` because that object may have had
55226
- // its time changed in the unusual case where where a DST transition was on
55227
- // the last day of the month and its local time was in the hour skipped or
55228
- // repeated next to a DST transition. So we use `date` instead which is
55229
- // guaranteed to still have the original time.
55230
- date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
55231
- return date;
55232
- }
55233
- }
55234
55435
  // CONCATENATED MODULE: /home/runner/work/semi-design/semi-design/node_modules/date-fns/esm/differenceInCalendarMonths/index.js
55235
55436
 
55236
55437
 
@@ -55303,6 +55504,76 @@ function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {
55303
55504
  var dateRight = toDate(dirtyDateRight);
55304
55505
  return dateLeft.getFullYear() - dateRight.getFullYear();
55305
55506
  }
55507
+ // CONCATENATED MODULE: /home/runner/work/semi-design/semi-design/node_modules/date-fns/esm/addMonths/index.js
55508
+
55509
+
55510
+
55511
+ /**
55512
+ * @name addMonths
55513
+ * @category Month Helpers
55514
+ * @summary Add the specified number of months to the given date.
55515
+ *
55516
+ * @description
55517
+ * Add the specified number of months to the given date.
55518
+ *
55519
+ * ### v2.0.0 breaking changes:
55520
+ *
55521
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
55522
+ *
55523
+ * @param {Date|Number} date - the date to be changed
55524
+ * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
55525
+ * @returns {Date} the new date with the months added
55526
+ * @throws {TypeError} 2 arguments required
55527
+ *
55528
+ * @example
55529
+ * // Add 5 months to 1 September 2014:
55530
+ * const result = addMonths(new Date(2014, 8, 1), 5)
55531
+ * //=> Sun Feb 01 2015 00:00:00
55532
+ */
55533
+
55534
+ function addMonths(dirtyDate, dirtyAmount) {
55535
+ requiredArgs(2, arguments);
55536
+ var date = toDate(dirtyDate);
55537
+ var amount = toInteger(dirtyAmount);
55538
+
55539
+ if (isNaN(amount)) {
55540
+ return new Date(NaN);
55541
+ }
55542
+
55543
+ if (!amount) {
55544
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
55545
+ return date;
55546
+ }
55547
+
55548
+ var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for
55549
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
55550
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
55551
+ // want except that dates will wrap around the end of a month, meaning that
55552
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
55553
+ // we'll default to the end of the desired month by adding 1 to the desired
55554
+ // month and using a date of 0 to back up one day to the end of the desired
55555
+ // month.
55556
+
55557
+ var endOfDesiredMonth = new Date(date.getTime());
55558
+ endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
55559
+ var daysInMonth = endOfDesiredMonth.getDate();
55560
+
55561
+ if (dayOfMonth >= daysInMonth) {
55562
+ // If we're already at the end of the month, then this is the correct date
55563
+ // and we're done.
55564
+ return endOfDesiredMonth;
55565
+ } else {
55566
+ // Otherwise, we now know that setting the original day-of-month value won't
55567
+ // cause an overflow, so set the desired day-of-month. Note that we can't
55568
+ // just set the date of `endOfDesiredMonth` because that object may have had
55569
+ // its time changed in the unusual case where where a DST transition was on
55570
+ // the last day of the month and its local time was in the hour skipped or
55571
+ // repeated next to a DST transition. So we use `date` instead which is
55572
+ // guaranteed to still have the original time.
55573
+ date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
55574
+ return date;
55575
+ }
55576
+ }
55306
55577
  // CONCATENATED MODULE: /home/runner/work/semi-design/semi-design/node_modules/date-fns/esm/subMonths/index.js
55307
55578
 
55308
55579
 
@@ -57702,7 +57973,7 @@ class itemFoundation_ItemFoundation extends foundation {
57702
57973
  list
57703
57974
  } = this.getProps();
57704
57975
 
57705
- if (index > -1 && is_array_default()(list) && list.length && isElement(listWrapper)) {
57976
+ if (index > -1 && is_array_default()(list) && list.length && Object(isElement["a" /* default */])(listWrapper)) {
57706
57977
  const indexInData = index % list.length;
57707
57978
  const item = list[indexInData];
57708
57979
  const node = listWrapper.children[index];
@@ -57723,7 +57994,7 @@ class itemFoundation_ItemFoundation extends foundation {
57723
57994
  list: data
57724
57995
  } = this.getProps();
57725
57996
 
57726
- if (isElement(node) && isElement(listWrapper)) {
57997
+ if (Object(isElement["a" /* default */])(node) && Object(isElement["a" /* default */])(listWrapper)) {
57727
57998
  const indexInList = findIndex_default()(listWrapper.children, ele => ele === node);
57728
57999
 
57729
58000
  const indexInData = indexInList % data.length;
@@ -57766,7 +58037,7 @@ class itemFoundation_ItemFoundation extends foundation {
57766
58037
  let ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
57767
58038
  const tag = 'li';
57768
58039
 
57769
- if (isElement(listWrapper) && isElement(scrollWrapper)) {
58040
+ if (Object(isElement["a" /* default */])(listWrapper) && Object(isElement["a" /* default */])(scrollWrapper)) {
57770
58041
  const itemNodes = listWrapper.querySelectorAll(tag);
57771
58042
  const lastNode = itemNodes[itemNodes.length - 1];
57772
58043
  const {
@@ -57805,7 +58076,7 @@ class itemFoundation_ItemFoundation extends foundation {
57805
58076
  let ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
57806
58077
  const tag = 'li';
57807
58078
 
57808
- if (isElement(listWrapper) && isElement(scrollWrapper)) {
58079
+ if (Object(isElement["a" /* default */])(listWrapper) && Object(isElement["a" /* default */])(scrollWrapper)) {
57809
58080
  const itemNodes = listWrapper.querySelectorAll(tag);
57810
58081
  const firstNode = itemNodes[0];
57811
58082
  const {
@@ -57843,7 +58114,7 @@ class itemFoundation_ItemFoundation extends foundation {
57843
58114
  list
57844
58115
  } = this.getProps();
57845
58116
 
57846
- if (isElement(wrapper) && isElement(listWrapper) && list && list.length) {
58117
+ if (Object(isElement["a" /* default */])(wrapper) && Object(isElement["a" /* default */])(listWrapper) && list && list.length) {
57847
58118
  const allNodes = listWrapper.children;
57848
58119
 
57849
58120
  const baseNodes = lodash_slice_default()(allNodes, 0, list.length);
@@ -57872,7 +58143,7 @@ class itemFoundation_ItemFoundation extends foundation {
57872
58143
  } = this.getProps();
57873
58144
  const nodeTag = 'li';
57874
58145
 
57875
- if (isElement(wrapper) && isElement(listWrapper) && list && list.length) {
58146
+ if (Object(isElement["a" /* default */])(wrapper) && Object(isElement["a" /* default */])(listWrapper) && list && list.length) {
57876
58147
  const allNodes = listWrapper.querySelectorAll(nodeTag);
57877
58148
  const total = allNodes.length;
57878
58149
  const ratio = 1;
@@ -57884,7 +58155,7 @@ class itemFoundation_ItemFoundation extends foundation {
57884
58155
  for (let i = 0; i < prependCount; i++) {
57885
58156
  const nodes = lodash_slice_default()(allNodes, total - list.length * (i + 1), total - list.length * i);
57886
58157
 
57887
- prepend(listWrapper, ...nodes);
58158
+ Object(dom["c" /* prepend */])(listWrapper, ...nodes);
57888
58159
  }
57889
58160
  } // while (this.shouldAppend(listWrapper, wrapper, nearestNode)) {
57890
58161
 
@@ -57893,7 +58164,7 @@ class itemFoundation_ItemFoundation extends foundation {
57893
58164
  for (let i = 0; i < appendCount; i++) {
57894
58165
  const nodes = lodash_slice_default()(allNodes, i * list.length, (i + 1) * list.length);
57895
58166
 
57896
- append(listWrapper, ...nodes);
58167
+ Object(dom["a" /* append */])(listWrapper, ...nodes);
57897
58168
  }
57898
58169
  }
57899
58170
  }
@@ -57907,7 +58178,7 @@ class itemFoundation_ItemFoundation extends foundation {
57907
58178
 
57908
58179
 
57909
58180
  getNearestNodeInfo(listWrapper, selector) {
57910
- if (isElement(listWrapper) && isElement(selector)) {
58181
+ if (Object(isElement["a" /* default */])(listWrapper) && Object(isElement["a" /* default */])(selector)) {
57911
58182
  var _context;
57912
58183
 
57913
58184
  const selectorRect = selector.getBoundingClientRect();
@@ -57946,7 +58217,7 @@ class itemFoundation_ItemFoundation extends foundation {
57946
58217
 
57947
58218
 
57948
58219
  getTargetNode(e, listWrapper) {
57949
- if (e && isElement(listWrapper)) {
58220
+ if (e && Object(isElement["a" /* default */])(listWrapper)) {
57950
58221
  const targetTagName = 'li';
57951
58222
  const currentTarget = e.target;
57952
58223
  const itemNodes = listWrapper.querySelectorAll(targetTagName);
@@ -58059,7 +58330,7 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
58059
58330
  list
58060
58331
  } = this;
58061
58332
 
58062
- if (isElement(node) && isElement(list)) {
58333
+ if (Object(isElement["a" /* default */])(node) && Object(isElement["a" /* default */])(list)) {
58063
58334
  const chilren = list.children;
58064
58335
 
58065
58336
  const index = findIndex_default()(chilren, node);
@@ -58075,7 +58346,7 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
58075
58346
  list
58076
58347
  } = this;
58077
58348
 
58078
- if (isElement(node) && isElement(list)) {
58349
+ if (Object(isElement["a" /* default */])(node) && Object(isElement["a" /* default */])(list)) {
58079
58350
  const {
58080
58351
  children
58081
58352
  } = list;
@@ -58117,7 +58388,7 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
58117
58388
  this.isDisabledNode = node => {
58118
58389
  const listWrapper = this.list;
58119
58390
 
58120
- if (isElement(node) && isElement(listWrapper)) {
58391
+ if (Object(isElement["a" /* default */])(node) && Object(isElement["a" /* default */])(listWrapper)) {
58121
58392
  const index = findIndex_default()(listWrapper.children, child => child === node);
58122
58393
 
58123
58394
  return this.isDisabledIndex(index);
@@ -58137,7 +58408,7 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
58137
58408
  } = _this;
58138
58409
  selectedNode = selectedNode || _this.selectedNode;
58139
58410
 
58140
- if (isElement(selectedNode) && isElement(list)) {
58411
+ if (Object(isElement["a" /* default */])(selectedNode) && Object(isElement["a" /* default */])(list)) {
58141
58412
  const {
58142
58413
  children
58143
58414
  } = list;
@@ -58252,7 +58523,7 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
58252
58523
  selectedNode = selectedNode || this.selectedNode;
58253
58524
  scrollWrapper = scrollWrapper || this.wrapper;
58254
58525
 
58255
- if (isElement(selectedNode) && isElement(scrollWrapper)) {
58526
+ if (Object(isElement["a" /* default */])(selectedNode) && Object(isElement["a" /* default */])(scrollWrapper)) {
58256
58527
  const scrollRect = scrollWrapper.getBoundingClientRect();
58257
58528
  const selectedRect = selectedNode.getBoundingClientRect();
58258
58529
  const targetTop = scrollWrapper.scrollTop + (selectedRect.top - (scrollRect.top + scrollRect.height / 2 - selectedRect.height / 2));
@@ -58519,7 +58790,7 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
58519
58790
  list
58520
58791
  } = this.props;
58521
58792
 
58522
- if (isElement(refNode) && isElement(listWrapper) && typeof offset === 'number' && is_array_default()(list) && list.length) {
58793
+ if (Object(isElement["a" /* default */])(refNode) && Object(isElement["a" /* default */])(listWrapper) && typeof offset === 'number' && is_array_default()(list) && list.length) {
58523
58794
  offset = offset % list.length;
58524
58795
  const refIndex = this.getIndexByNode(refNode);
58525
58796
  let targetIndex = refIndex + offset;
@@ -59456,8 +59727,65 @@ yearAndMonth_YearAndMonth.defaultProps = {
59456
59727
  onSelect: noop_default.a
59457
59728
  };
59458
59729
  /* harmony default export */ var yearAndMonth = (yearAndMonth_YearAndMonth);
59459
- // CONCATENATED MODULE: ./datePicker/monthsGrid.tsx
59730
+ // CONCATENATED MODULE: ../semi-foundation/datePicker/_utils/getDefaultPickerDate.ts
59731
+
59732
+
59733
+
59734
+
59735
+
59736
+ /**
59737
+ * get left panel picker date and right panel picker date
59738
+ */
59739
+
59740
+ function getDefaultPickerDate(options) {
59741
+ const {
59742
+ defaultPickerValue,
59743
+ format,
59744
+ dateFnsLocale
59745
+ } = options;
59746
+ let nowDate = is_array_default()(defaultPickerValue) ? defaultPickerValue[0] : defaultPickerValue;
59747
+ let nextDate = is_array_default()(defaultPickerValue) ? defaultPickerValue[1] : undefined;
59748
+
59749
+ switch (true) {
59750
+ case isValidDate(nowDate):
59751
+ break;
59752
+
59753
+ case isTimestamp(nowDate):
59754
+ nowDate = new Date(nowDate);
59755
+ break;
59756
+
59757
+ case typeof nowDate === 'string':
59758
+ nowDate = compatiableParse(nowDate, format, undefined, dateFnsLocale);
59759
+ break;
59760
+
59761
+ default:
59762
+ nowDate = new Date();
59763
+ break;
59764
+ }
59765
+
59766
+ switch (true) {
59767
+ case isValidDate(nextDate):
59768
+ break;
59769
+
59770
+ case isTimestamp(nextDate):
59771
+ nextDate = new Date(nextDate);
59772
+ break;
59773
+
59774
+ case typeof nextDate === 'string':
59775
+ nextDate = compatiableParse(nextDate, format, undefined, dateFnsLocale);
59776
+ break;
59777
+
59778
+ default:
59779
+ nextDate = addMonths(nowDate, 1);
59780
+ break;
59781
+ }
59460
59782
 
59783
+ return {
59784
+ nowDate: nowDate,
59785
+ nextDate: nextDate
59786
+ };
59787
+ }
59788
+ // CONCATENATED MODULE: ./datePicker/monthsGrid.tsx
59461
59789
 
59462
59790
 
59463
59791
 
@@ -59489,6 +59817,7 @@ yearAndMonth_YearAndMonth.defaultProps = {
59489
59817
 
59490
59818
 
59491
59819
 
59820
+
59492
59821
  const monthsGrid_prefixCls = datePicker_constants_cssClasses.PREFIX;
59493
59822
  class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
59494
59823
  constructor(props) {
@@ -59591,23 +59920,15 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
59591
59920
  return this.foundation.getYAMOpenType();
59592
59921
  };
59593
59922
 
59594
- let nowDate = is_array_default()(props.defaultPickerValue) ? props.defaultPickerValue[0] : props.defaultPickerValue;
59595
59923
  const validFormat = props.format || getDefaultFormatTokenByType(props.type);
59596
-
59597
- if (!nowDate) {
59598
- nowDate = new Date();
59599
- } else {
59600
- nowDate = compatiableParse(nowDate, validFormat, undefined, props.dateFnsLocale);
59601
- }
59602
-
59603
- let nextDate = is_array_default()(props.defaultPickerValue) ? props.defaultPickerValue[1] : undefined;
59604
-
59605
- if (!nextDate) {
59606
- nextDate = addMonths(nowDate, 1);
59607
- } else {
59608
- nextDate = compatiableParse(nextDate, validFormat, undefined, props.dateFnsLocale);
59609
- }
59610
-
59924
+ const {
59925
+ nowDate,
59926
+ nextDate
59927
+ } = getDefaultPickerDate({
59928
+ defaultPickerValue: props.defaultPickerValue,
59929
+ format: validFormat,
59930
+ dateFnsLocale: props.dateFnsLocale
59931
+ });
59611
59932
  const dateState = {
59612
59933
  // Direct use of full date string storage, mainly considering the month rendering comparison to save a conversion
59613
59934
  // The selected value for single or multiple selection, full date string, eg. {'2019-10-01', '2019-10-02'}
@@ -60106,7 +60427,7 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
60106
60427
  className: monthGridCls,
60107
60428
  "x-type": type,
60108
60429
  "x-panel-yearandmonth-open-type": yearOpenType,
60109
- "x-insetInput": insetInput ? "true" : "false",
60430
+ "x-insetinput": insetInput ? "true" : "false",
60110
60431
  ref: current => this.cacheRefCurrent('monthGrid', current)
60111
60432
  }, content);
60112
60433
  }
@@ -62000,7 +62321,7 @@ const ConfirmModal = props => {
62000
62321
  ["".concat(confirmCls, "-rtl")]: direction === 'rtl'
62001
62322
  });
62002
62323
  const typeCls = classnames_default()(concat_default()(_context = "".concat(modal_constants_cssClasses.DIALOG, "-")).call(_context, type));
62003
- const iconNode = Object(_utils["d" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
62324
+ const iconNode = Object(_utils["e" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
62004
62325
  className: concat_default()(_context2 = "".concat(confirmCls, "-icon ")).call(_context2, typeCls, "-icon"),
62005
62326
  size: 'extra-large'
62006
62327
  }) : icon;
@@ -63252,7 +63573,7 @@ class row_Row extends external_root_React_commonjs2_react_commonjs_react_amd_rea
63252
63573
  componentDidMount() {
63253
63574
  var _context;
63254
63575
 
63255
- this.unRegisters = map_default()(_context = keys_default()(responsiveMap)).call(_context, screen => Object(_utils["e" /* registerMediaQuery */])(responsiveMap[screen], {
63576
+ this.unRegisters = map_default()(_context = keys_default()(responsiveMap)).call(_context, screen => Object(_utils["f" /* registerMediaQuery */])(responsiveMap[screen], {
63256
63577
  match: () => {
63257
63578
  if (typeof this.props.gutter !== 'object') {
63258
63579
  return;
@@ -63602,7 +63923,7 @@ class Sider_Sider extends external_root_React_commonjs2_react_commonjs_react_amd
63602
63923
 
63603
63924
  const matchBpt = filter_default()(_context2 = keys_default()(Sider_responsiveMap)).call(_context2, item => breakpoint && index_of_default()(breakpoint).call(breakpoint, item) !== -1);
63604
63925
 
63605
- const unRegisters = map_default()(matchBpt).call(matchBpt, screen => Object(_utils["e" /* registerMediaQuery */])(Sider_responsiveMap[screen], {
63926
+ const unRegisters = map_default()(matchBpt).call(matchBpt, screen => Object(_utils["f" /* registerMediaQuery */])(Sider_responsiveMap[screen], {
63606
63927
  match: () => {
63607
63928
  this.responsiveHandler(screen, true);
63608
63929
  },
@@ -65642,7 +65963,7 @@ class foundation_InputNumberFoundation extends foundation {
65642
65963
  _adjustPrec(num) {
65643
65964
  const precision = this.getProp('precision');
65644
65965
 
65645
- if (typeof precision === 'number') {
65966
+ if (typeof precision === 'number' && num !== '') {
65646
65967
  num = Number(num).toFixed(precision);
65647
65968
  }
65648
65969
 
@@ -67150,7 +67471,7 @@ class Item_NavItem extends baseComponent_BaseComponent {
67150
67471
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("i", {
67151
67472
  className: className,
67152
67473
  key: key
67153
- }, Object(_utils["d" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
67474
+ }, Object(_utils["e" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
67154
67475
  size: icon.props.size || iconSize
67155
67476
  }) : icon);
67156
67477
  }
@@ -68688,7 +69009,7 @@ class notice_Notice extends baseComponent_BaseComponent {
68688
69009
  if (iconType) {
68689
69010
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
68690
69011
  className: iconCls
68691
- }, Object(_utils["d" /* isSemiIcon */])(iconType) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(iconType, {
69012
+ }, Object(_utils["e" /* isSemiIcon */])(iconType) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(iconType, {
68692
69013
  size: iconType.props.size || 'large'
68693
69014
  }) : iconType);
68694
69015
  }
@@ -69000,9 +69321,10 @@ function useNotification_usePatchElement() {
69000
69321
  function useNotification() {
69001
69322
  const [elements, patchElement] = useNotification_usePatchElement();
69002
69323
  const noticeRef = new core_js_stable_map_default.a();
69003
- const id = getUuid('semi_notice_');
69004
69324
 
69005
69325
  const addNotice = config => {
69326
+ const id = getUuid('semi_notice_');
69327
+
69006
69328
  const mergeConfig = assign_default()(assign_default()({}, config), {
69007
69329
  id
69008
69330
  }); // eslint-disable-next-line prefer-const
@@ -74776,7 +75098,7 @@ class select_Select extends baseComponent_BaseComponent {
74776
75098
  const suffixWrapperCls = classnames_default()({
74777
75099
  ["".concat(select_prefixcls, "-suffix")]: true,
74778
75100
  ["".concat(select_prefixcls, "-suffix-text")]: suffix && isString_default()(suffix),
74779
- ["".concat(select_prefixcls, "-suffix-icon")]: Object(_utils["d" /* isSemiIcon */])(suffix)
75101
+ ["".concat(select_prefixcls, "-suffix-icon")]: Object(_utils["e" /* isSemiIcon */])(suffix)
74780
75102
  });
74781
75103
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
74782
75104
  className: suffixWrapperCls
@@ -74794,7 +75116,7 @@ class select_Select extends baseComponent_BaseComponent {
74794
75116
  ["".concat(select_prefixcls, "-prefix")]: true,
74795
75117
  ["".concat(select_prefixcls, "-inset-label")]: insetLabel,
74796
75118
  ["".concat(select_prefixcls, "-prefix-text")]: labelNode && isString_default()(labelNode),
74797
- ["".concat(select_prefixcls, "-prefix-icon")]: Object(_utils["d" /* isSemiIcon */])(labelNode)
75119
+ ["".concat(select_prefixcls, "-prefix-icon")]: Object(_utils["e" /* isSemiIcon */])(labelNode)
74798
75120
  });
74799
75121
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
74800
75122
  className: prefixWrapperCls,
@@ -90954,7 +91276,7 @@ class toast_Toast extends baseComponent_BaseComponent {
90954
91276
  const iconCls = classnames_default()("".concat(toast_prefixCls, "-icon"), concat_default()(_context = "".concat(toast_prefixCls, "-icon-")).call(_context, type));
90955
91277
 
90956
91278
  if (icon) {
90957
- return Object(_utils["d" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
91279
+ return Object(_utils["e" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
90958
91280
  size: iconSize,
90959
91281
  className: "".concat(toast_prefixCls, "-icon")
90960
91282
  }) : icon;
@@ -94861,7 +95183,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
94861
95183
  const suffixWrapperCls = classnames_default()({
94862
95184
  ["".concat(treeSelect_prefixcls, "-suffix")]: true,
94863
95185
  ["".concat(treeSelect_prefixcls, "-suffix-text")]: suffix && isString_default()(suffix),
94864
- ["".concat(treeSelect_prefixcls, "-suffix-icon")]: Object(_utils["d" /* isSemiIcon */])(suffix)
95186
+ ["".concat(treeSelect_prefixcls, "-suffix-icon")]: Object(_utils["e" /* isSemiIcon */])(suffix)
94865
95187
  });
94866
95188
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
94867
95189
  className: suffixWrapperCls
@@ -94880,7 +95202,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
94880
95202
  // to be doublechecked
94881
95203
  ["".concat(treeSelect_prefixcls, "-inset-label")]: insetLabel,
94882
95204
  ["".concat(treeSelect_prefixcls, "-prefix-text")]: labelNode && isString_default()(labelNode),
94883
- ["".concat(treeSelect_prefixcls, "-prefix-icon")]: Object(_utils["d" /* isSemiIcon */])(labelNode)
95205
+ ["".concat(treeSelect_prefixcls, "-prefix-icon")]: Object(_utils["e" /* isSemiIcon */])(labelNode)
94884
95206
  });
94885
95207
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
94886
95208
  className: prefixWrapperCls,