@douyinfe/semi-ui 2.20.2 → 2.20.3
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/umd/semi-ui.js +255 -233
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/anchor/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/breadcrumb/item.js +1 -0
- package/lib/cjs/button/buttonGroup.js +14 -9
- package/lib/cjs/datePicker/datePicker.d.ts +2 -2
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/datePicker/quickControl.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/cjs/dropdown/index.d.ts +1 -1
- package/lib/cjs/dropdown/index.js +1 -0
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/form/hoc/withField.js +7 -4
- package/lib/cjs/inputNumber/index.js +1 -1
- package/lib/cjs/modal/ModalContent.js +9 -2
- package/lib/cjs/navigation/Footer.js +2 -2
- package/lib/cjs/navigation/OpenIconTransition.js +1 -0
- package/lib/cjs/navigation/SubNav.js +6 -2
- package/lib/cjs/popover/index.d.ts +1 -1
- package/lib/cjs/select/index.d.ts +1 -1
- package/lib/cjs/table/Body/index.js +1 -1
- package/lib/cjs/table/Table.d.ts +1 -1
- package/lib/cjs/timeline/index.js +1 -0
- package/lib/cjs/tooltip/index.d.ts +1 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/anchor/index.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/breadcrumb/item.js +1 -0
- package/lib/es/button/buttonGroup.js +14 -9
- package/lib/es/datePicker/datePicker.d.ts +2 -2
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/quickControl.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/es/dropdown/index.d.ts +1 -1
- package/lib/es/dropdown/index.js +1 -0
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +8 -5
- package/lib/es/inputNumber/index.js +1 -1
- package/lib/es/modal/ModalContent.js +8 -2
- package/lib/es/navigation/Footer.js +2 -2
- package/lib/es/navigation/OpenIconTransition.js +1 -0
- package/lib/es/navigation/SubNav.js +6 -2
- package/lib/es/popover/index.d.ts +1 -1
- package/lib/es/select/index.d.ts +1 -1
- package/lib/es/table/Body/index.js +1 -1
- package/lib/es/table/Table.d.ts +1 -1
- package/lib/es/timeline/index.js +1 -0
- package/lib/es/tooltip/index.d.ts +1 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +7 -7
package/dist/umd/semi-ui.js
CHANGED
|
@@ -7856,6 +7856,216 @@ var defineProperty = (function() {
|
|
|
7856
7856
|
module.exports = defineProperty;
|
|
7857
7857
|
|
|
7858
7858
|
|
|
7859
|
+
/***/ }),
|
|
7860
|
+
|
|
7861
|
+
/***/ "Q0Dl":
|
|
7862
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7863
|
+
|
|
7864
|
+
"use strict";
|
|
7865
|
+
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return stopPropagation; });
|
|
7866
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cloneDeep; });
|
|
7867
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getHighLightTextHTML; });
|
|
7868
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return registerMediaQuery; });
|
|
7869
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isSemiIcon; });
|
|
7870
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getActiveElement; });
|
|
7871
|
+
/* unused harmony export isNodeContainsFocus */
|
|
7872
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getFocusableElements; });
|
|
7873
|
+
/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2srY");
|
|
7874
|
+
/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_0__);
|
|
7875
|
+
/* harmony import */ var lodash_set__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("DL3M");
|
|
7876
|
+
/* harmony import */ var lodash_set__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_set__WEBPACK_IMPORTED_MODULE_1__);
|
|
7877
|
+
/* harmony import */ var lodash_cloneDeepWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("NdXQ");
|
|
7878
|
+
/* harmony import */ var lodash_cloneDeepWith__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeepWith__WEBPACK_IMPORTED_MODULE_2__);
|
|
7879
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd");
|
|
7880
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
|
|
7881
|
+
/* harmony import */ var _douyinfe_semi_foundation_utils_warning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("MYbw");
|
|
7882
|
+
/* harmony import */ var _douyinfe_semi_foundation_utils_getHighlight__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("C5xO");
|
|
7883
|
+
/* harmony import */ var _douyinfe_semi_foundation_utils_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("Awix");
|
|
7884
|
+
|
|
7885
|
+
|
|
7886
|
+
|
|
7887
|
+
|
|
7888
|
+
/* eslint-disable max-len */
|
|
7889
|
+
|
|
7890
|
+
/* argus-disable unPkgSensitiveInfo */
|
|
7891
|
+
|
|
7892
|
+
|
|
7893
|
+
|
|
7894
|
+
|
|
7895
|
+
/**
|
|
7896
|
+
* stop propagation
|
|
7897
|
+
*
|
|
7898
|
+
* @param {React.MouseEvent<HTMLElement>} e React mouse event object
|
|
7899
|
+
* @param {boolean} noImmediate Skip stopping immediate propagation
|
|
7900
|
+
*/
|
|
7901
|
+
|
|
7902
|
+
function stopPropagation(e, noImmediate) {
|
|
7903
|
+
if (e && typeof e.stopPropagation === 'function') {
|
|
7904
|
+
e.stopPropagation();
|
|
7905
|
+
}
|
|
7906
|
+
|
|
7907
|
+
if (!noImmediate && e.nativeEvent && typeof e.nativeEvent.stopImmediatePropagation === 'function') {
|
|
7908
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
7909
|
+
}
|
|
7910
|
+
}
|
|
7911
|
+
/**
|
|
7912
|
+
*
|
|
7913
|
+
* @param {any} value
|
|
7914
|
+
* @param {Function} customizer
|
|
7915
|
+
* @returns {any}
|
|
7916
|
+
* use in Table, Form, Navigation
|
|
7917
|
+
*/
|
|
7918
|
+
|
|
7919
|
+
function cloneDeep(value, customizer) {
|
|
7920
|
+
return lodash_cloneDeepWith__WEBPACK_IMPORTED_MODULE_2___default()(value, v => {
|
|
7921
|
+
if (typeof customizer === 'function') {
|
|
7922
|
+
return customizer(v);
|
|
7923
|
+
}
|
|
7924
|
+
|
|
7925
|
+
if (typeof v === 'function' || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.isValidElement(v)) {
|
|
7926
|
+
return v;
|
|
7927
|
+
}
|
|
7928
|
+
|
|
7929
|
+
if (Object.prototype.toString.call(v) === '[object Error]') {
|
|
7930
|
+
return v;
|
|
7931
|
+
}
|
|
7932
|
+
|
|
7933
|
+
if (Array.isArray(v) && v.length === 0) {
|
|
7934
|
+
const keys = Object.keys(v);
|
|
7935
|
+
|
|
7936
|
+
if (keys.length) {
|
|
7937
|
+
const newArray = [];
|
|
7938
|
+
keys.forEach(key => {
|
|
7939
|
+
lodash_set__WEBPACK_IMPORTED_MODULE_1___default()(newArray, key, v[key]);
|
|
7940
|
+
}); // internal-issues:887
|
|
7941
|
+
|
|
7942
|
+
try {
|
|
7943
|
+
Object(_douyinfe_semi_foundation_utils_warning__WEBPACK_IMPORTED_MODULE_4__[/* 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");
|
|
7944
|
+
} catch (e) {}
|
|
7945
|
+
|
|
7946
|
+
return newArray;
|
|
7947
|
+
} else {
|
|
7948
|
+
return undefined;
|
|
7949
|
+
}
|
|
7950
|
+
}
|
|
7951
|
+
|
|
7952
|
+
return undefined;
|
|
7953
|
+
});
|
|
7954
|
+
}
|
|
7955
|
+
/**
|
|
7956
|
+
* [getHighLightTextHTML description]
|
|
7957
|
+
*
|
|
7958
|
+
* @param {string} sourceString [source content text]
|
|
7959
|
+
* @param {Array<string>} searchWords [keywords to be highlighted]
|
|
7960
|
+
* @param {object} option
|
|
7961
|
+
* @param {true} option.highlightTag [The tag wrapped by the highlighted content, mark is used by default]
|
|
7962
|
+
* @param {true} option.highlightClassName
|
|
7963
|
+
* @param {true} option.highlightStyle
|
|
7964
|
+
* @param {boolean} option.caseSensitive
|
|
7965
|
+
*
|
|
7966
|
+
* @return {Array<object>}
|
|
7967
|
+
*/
|
|
7968
|
+
|
|
7969
|
+
const getHighLightTextHTML = _ref => {
|
|
7970
|
+
let {
|
|
7971
|
+
sourceString = '',
|
|
7972
|
+
searchWords = [],
|
|
7973
|
+
option = {
|
|
7974
|
+
autoEscape: true,
|
|
7975
|
+
caseSensitive: false
|
|
7976
|
+
}
|
|
7977
|
+
} = _ref;
|
|
7978
|
+
const chunks = Object(_douyinfe_semi_foundation_utils_getHighlight__WEBPACK_IMPORTED_MODULE_5__[/* findAll */ "a"])(Object.assign({
|
|
7979
|
+
sourceString,
|
|
7980
|
+
searchWords
|
|
7981
|
+
}, option));
|
|
7982
|
+
const markEle = option.highlightTag || 'mark';
|
|
7983
|
+
const highlightClassName = option.highlightClassName || '';
|
|
7984
|
+
const highlightStyle = option.highlightStyle || {};
|
|
7985
|
+
return chunks.map((chunk, index) => {
|
|
7986
|
+
const {
|
|
7987
|
+
end,
|
|
7988
|
+
start,
|
|
7989
|
+
highlight
|
|
7990
|
+
} = chunk;
|
|
7991
|
+
const text = sourceString.substr(start, end - start);
|
|
7992
|
+
|
|
7993
|
+
if (highlight) {
|
|
7994
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(markEle, {
|
|
7995
|
+
style: highlightStyle,
|
|
7996
|
+
className: highlightClassName,
|
|
7997
|
+
key: text + index
|
|
7998
|
+
}, text);
|
|
7999
|
+
} else {
|
|
8000
|
+
return text;
|
|
8001
|
+
}
|
|
8002
|
+
});
|
|
8003
|
+
};
|
|
8004
|
+
/**
|
|
8005
|
+
* register matchFn and unMatchFn callback while media query
|
|
8006
|
+
* @param {string} media media string
|
|
8007
|
+
* @param {object} param param object
|
|
8008
|
+
* @returns function
|
|
8009
|
+
*/
|
|
8010
|
+
|
|
8011
|
+
const registerMediaQuery = (media, _ref2) => {
|
|
8012
|
+
let {
|
|
8013
|
+
match,
|
|
8014
|
+
unmatch,
|
|
8015
|
+
callInInit = true
|
|
8016
|
+
} = _ref2;
|
|
8017
|
+
|
|
8018
|
+
if (typeof window !== 'undefined') {
|
|
8019
|
+
const mediaQueryList = window.matchMedia(media);
|
|
8020
|
+
|
|
8021
|
+
function handlerMediaChange(e) {
|
|
8022
|
+
if (e.matches) {
|
|
8023
|
+
match && match(e);
|
|
8024
|
+
} else {
|
|
8025
|
+
unmatch && unmatch(e);
|
|
8026
|
+
}
|
|
8027
|
+
}
|
|
8028
|
+
|
|
8029
|
+
callInInit && handlerMediaChange(mediaQueryList);
|
|
8030
|
+
|
|
8031
|
+
if (Object.prototype.hasOwnProperty.call(mediaQueryList, 'addEventListener')) {
|
|
8032
|
+
mediaQueryList.addEventListener('change', handlerMediaChange);
|
|
8033
|
+
return () => mediaQueryList.removeEventListener('change', handlerMediaChange);
|
|
8034
|
+
}
|
|
8035
|
+
|
|
8036
|
+
mediaQueryList.addListener(handlerMediaChange);
|
|
8037
|
+
return () => mediaQueryList.removeListener(handlerMediaChange);
|
|
8038
|
+
}
|
|
8039
|
+
|
|
8040
|
+
return () => undefined;
|
|
8041
|
+
};
|
|
8042
|
+
/**
|
|
8043
|
+
* Determine whether the incoming element is a built-in icon
|
|
8044
|
+
* @param icon 元素
|
|
8045
|
+
* @returns boolean
|
|
8046
|
+
*/
|
|
8047
|
+
|
|
8048
|
+
const isSemiIcon = icon => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.isValidElement(icon) && lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(icon.type, 'elementType') === 'Icon';
|
|
8049
|
+
function getActiveElement() {
|
|
8050
|
+
return document ? document.activeElement : null;
|
|
8051
|
+
}
|
|
8052
|
+
function isNodeContainsFocus(node) {
|
|
8053
|
+
const activeElement = getActiveElement();
|
|
8054
|
+
return activeElement === node || node.contains(activeElement);
|
|
8055
|
+
}
|
|
8056
|
+
function getFocusableElements(node) {
|
|
8057
|
+
if (!Object(_douyinfe_semi_foundation_utils_dom__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(node)) {
|
|
8058
|
+
return [];
|
|
8059
|
+
}
|
|
8060
|
+
|
|
8061
|
+
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'])"];
|
|
8062
|
+
const focusableSelectorsStr = focusableSelectorsList.join(','); // we are not filtered elements which are invisible
|
|
8063
|
+
|
|
8064
|
+
const focusableElements = Array.from(node.querySelectorAll(focusableSelectorsStr));
|
|
8065
|
+
return focusableElements;
|
|
8066
|
+
}
|
|
8067
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("F63i")))
|
|
8068
|
+
|
|
7859
8069
|
/***/ }),
|
|
7860
8070
|
|
|
7861
8071
|
/***/ "Q4oW":
|
|
@@ -10053,216 +10263,6 @@ module.exports = isRegExp;
|
|
|
10053
10263
|
|
|
10054
10264
|
|
|
10055
10265
|
|
|
10056
|
-
/***/ }),
|
|
10057
|
-
|
|
10058
|
-
/***/ "UU7A":
|
|
10059
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10060
|
-
|
|
10061
|
-
"use strict";
|
|
10062
|
-
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return stopPropagation; });
|
|
10063
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cloneDeep; });
|
|
10064
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getHighLightTextHTML; });
|
|
10065
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return registerMediaQuery; });
|
|
10066
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isSemiIcon; });
|
|
10067
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getActiveElement; });
|
|
10068
|
-
/* unused harmony export isNodeContainsFocus */
|
|
10069
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getFocusableElements; });
|
|
10070
|
-
/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2srY");
|
|
10071
|
-
/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_0__);
|
|
10072
|
-
/* harmony import */ var lodash_set__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("DL3M");
|
|
10073
|
-
/* harmony import */ var lodash_set__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_set__WEBPACK_IMPORTED_MODULE_1__);
|
|
10074
|
-
/* harmony import */ var lodash_cloneDeepWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("NdXQ");
|
|
10075
|
-
/* harmony import */ var lodash_cloneDeepWith__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeepWith__WEBPACK_IMPORTED_MODULE_2__);
|
|
10076
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd");
|
|
10077
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
|
|
10078
|
-
/* harmony import */ var _douyinfe_semi_foundation_utils_warning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("MYbw");
|
|
10079
|
-
/* harmony import */ var _douyinfe_semi_foundation_utils_getHighlight__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("C5xO");
|
|
10080
|
-
/* harmony import */ var _douyinfe_semi_foundation_utils_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("Awix");
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
/* eslint-disable max-len */
|
|
10086
|
-
|
|
10087
|
-
/* argus-disable unPkgSensitiveInfo */
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
/**
|
|
10093
|
-
* stop propagation
|
|
10094
|
-
*
|
|
10095
|
-
* @param {React.MouseEvent<HTMLElement>} e React mouse event object
|
|
10096
|
-
* @param {boolean} noImmediate Skip stopping immediate propagation
|
|
10097
|
-
*/
|
|
10098
|
-
|
|
10099
|
-
function stopPropagation(e, noImmediate) {
|
|
10100
|
-
if (e && typeof e.stopPropagation === 'function') {
|
|
10101
|
-
e.stopPropagation();
|
|
10102
|
-
}
|
|
10103
|
-
|
|
10104
|
-
if (!noImmediate && e.nativeEvent && typeof e.nativeEvent.stopImmediatePropagation === 'function') {
|
|
10105
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
10106
|
-
}
|
|
10107
|
-
}
|
|
10108
|
-
/**
|
|
10109
|
-
*
|
|
10110
|
-
* @param {any} value
|
|
10111
|
-
* @param {Function} customizer
|
|
10112
|
-
* @returns {any}
|
|
10113
|
-
* use in Table, Form, Navigation
|
|
10114
|
-
*/
|
|
10115
|
-
|
|
10116
|
-
function cloneDeep(value, customizer) {
|
|
10117
|
-
return lodash_cloneDeepWith__WEBPACK_IMPORTED_MODULE_2___default()(value, v => {
|
|
10118
|
-
if (typeof customizer === 'function') {
|
|
10119
|
-
return customizer(v);
|
|
10120
|
-
}
|
|
10121
|
-
|
|
10122
|
-
if (typeof v === 'function' || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.isValidElement(v)) {
|
|
10123
|
-
return v;
|
|
10124
|
-
}
|
|
10125
|
-
|
|
10126
|
-
if (Object.prototype.toString.call(v) === '[object Error]') {
|
|
10127
|
-
return v;
|
|
10128
|
-
}
|
|
10129
|
-
|
|
10130
|
-
if (Array.isArray(v) && v.length === 0) {
|
|
10131
|
-
const keys = Object.keys(v);
|
|
10132
|
-
|
|
10133
|
-
if (keys.length) {
|
|
10134
|
-
const newArray = [];
|
|
10135
|
-
keys.forEach(key => {
|
|
10136
|
-
lodash_set__WEBPACK_IMPORTED_MODULE_1___default()(newArray, key, v[key]);
|
|
10137
|
-
}); // internal-issues:887
|
|
10138
|
-
|
|
10139
|
-
try {
|
|
10140
|
-
Object(_douyinfe_semi_foundation_utils_warning__WEBPACK_IMPORTED_MODULE_4__[/* 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");
|
|
10141
|
-
} catch (e) {}
|
|
10142
|
-
|
|
10143
|
-
return newArray;
|
|
10144
|
-
} else {
|
|
10145
|
-
return undefined;
|
|
10146
|
-
}
|
|
10147
|
-
}
|
|
10148
|
-
|
|
10149
|
-
return undefined;
|
|
10150
|
-
});
|
|
10151
|
-
}
|
|
10152
|
-
/**
|
|
10153
|
-
* [getHighLightTextHTML description]
|
|
10154
|
-
*
|
|
10155
|
-
* @param {string} sourceString [source content text]
|
|
10156
|
-
* @param {Array<string>} searchWords [keywords to be highlighted]
|
|
10157
|
-
* @param {object} option
|
|
10158
|
-
* @param {true} option.highlightTag [The tag wrapped by the highlighted content, mark is used by default]
|
|
10159
|
-
* @param {true} option.highlightClassName
|
|
10160
|
-
* @param {true} option.highlightStyle
|
|
10161
|
-
* @param {boolean} option.caseSensitive
|
|
10162
|
-
*
|
|
10163
|
-
* @return {Array<object>}
|
|
10164
|
-
*/
|
|
10165
|
-
|
|
10166
|
-
const getHighLightTextHTML = _ref => {
|
|
10167
|
-
let {
|
|
10168
|
-
sourceString = '',
|
|
10169
|
-
searchWords = [],
|
|
10170
|
-
option = {
|
|
10171
|
-
autoEscape: true,
|
|
10172
|
-
caseSensitive: false
|
|
10173
|
-
}
|
|
10174
|
-
} = _ref;
|
|
10175
|
-
const chunks = Object(_douyinfe_semi_foundation_utils_getHighlight__WEBPACK_IMPORTED_MODULE_5__[/* findAll */ "a"])(Object.assign({
|
|
10176
|
-
sourceString,
|
|
10177
|
-
searchWords
|
|
10178
|
-
}, option));
|
|
10179
|
-
const markEle = option.highlightTag || 'mark';
|
|
10180
|
-
const highlightClassName = option.highlightClassName || '';
|
|
10181
|
-
const highlightStyle = option.highlightStyle || {};
|
|
10182
|
-
return chunks.map((chunk, index) => {
|
|
10183
|
-
const {
|
|
10184
|
-
end,
|
|
10185
|
-
start,
|
|
10186
|
-
highlight
|
|
10187
|
-
} = chunk;
|
|
10188
|
-
const text = sourceString.substr(start, end - start);
|
|
10189
|
-
|
|
10190
|
-
if (highlight) {
|
|
10191
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(markEle, {
|
|
10192
|
-
style: highlightStyle,
|
|
10193
|
-
className: highlightClassName,
|
|
10194
|
-
key: text + index
|
|
10195
|
-
}, text);
|
|
10196
|
-
} else {
|
|
10197
|
-
return text;
|
|
10198
|
-
}
|
|
10199
|
-
});
|
|
10200
|
-
};
|
|
10201
|
-
/**
|
|
10202
|
-
* register matchFn and unMatchFn callback while media query
|
|
10203
|
-
* @param {string} media media string
|
|
10204
|
-
* @param {object} param param object
|
|
10205
|
-
* @returns function
|
|
10206
|
-
*/
|
|
10207
|
-
|
|
10208
|
-
const registerMediaQuery = (media, _ref2) => {
|
|
10209
|
-
let {
|
|
10210
|
-
match,
|
|
10211
|
-
unmatch,
|
|
10212
|
-
callInInit = true
|
|
10213
|
-
} = _ref2;
|
|
10214
|
-
|
|
10215
|
-
if (typeof window !== 'undefined') {
|
|
10216
|
-
const mediaQueryList = window.matchMedia(media);
|
|
10217
|
-
|
|
10218
|
-
function handlerMediaChange(e) {
|
|
10219
|
-
if (e.matches) {
|
|
10220
|
-
match && match(e);
|
|
10221
|
-
} else {
|
|
10222
|
-
unmatch && unmatch(e);
|
|
10223
|
-
}
|
|
10224
|
-
}
|
|
10225
|
-
|
|
10226
|
-
callInInit && handlerMediaChange(mediaQueryList);
|
|
10227
|
-
|
|
10228
|
-
if (Object.prototype.hasOwnProperty.call(mediaQueryList, 'addEventListener')) {
|
|
10229
|
-
mediaQueryList.addEventListener('change', handlerMediaChange);
|
|
10230
|
-
return () => mediaQueryList.removeEventListener('change', handlerMediaChange);
|
|
10231
|
-
}
|
|
10232
|
-
|
|
10233
|
-
mediaQueryList.addListener(handlerMediaChange);
|
|
10234
|
-
return () => mediaQueryList.removeListener(handlerMediaChange);
|
|
10235
|
-
}
|
|
10236
|
-
|
|
10237
|
-
return () => undefined;
|
|
10238
|
-
};
|
|
10239
|
-
/**
|
|
10240
|
-
* Determine whether the incoming element is a built-in icon
|
|
10241
|
-
* @param icon 元素
|
|
10242
|
-
* @returns boolean
|
|
10243
|
-
*/
|
|
10244
|
-
|
|
10245
|
-
const isSemiIcon = icon => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.isValidElement(icon) && lodash_get__WEBPACK_IMPORTED_MODULE_0___default()(icon.type, 'elementType') === 'Icon';
|
|
10246
|
-
function getActiveElement() {
|
|
10247
|
-
return document ? document.activeElement : null;
|
|
10248
|
-
}
|
|
10249
|
-
function isNodeContainsFocus(node) {
|
|
10250
|
-
const activeElement = getActiveElement();
|
|
10251
|
-
return activeElement === node || node.contains(activeElement);
|
|
10252
|
-
}
|
|
10253
|
-
function getFocusableElements(node) {
|
|
10254
|
-
if (!Object(_douyinfe_semi_foundation_utils_dom__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(node)) {
|
|
10255
|
-
return [];
|
|
10256
|
-
}
|
|
10257
|
-
|
|
10258
|
-
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'])"];
|
|
10259
|
-
const focusableSelectorsStr = focusableSelectorsList.join(','); // we are not filtered elements which are invisible
|
|
10260
|
-
|
|
10261
|
-
const focusableElements = Array.from(node.querySelectorAll(focusableSelectorsStr));
|
|
10262
|
-
return focusableElements;
|
|
10263
|
-
}
|
|
10264
|
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("F63i")))
|
|
10265
|
-
|
|
10266
10266
|
/***/ }),
|
|
10267
10267
|
|
|
10268
10268
|
/***/ "UdtX":
|
|
@@ -19301,8 +19301,8 @@ var tooltip = __webpack_require__("VQVM");
|
|
|
19301
19301
|
// EXTERNAL MODULE: ../semi-foundation/utils/isElement.ts
|
|
19302
19302
|
var isElement = __webpack_require__("Awix");
|
|
19303
19303
|
|
|
19304
|
-
// EXTERNAL MODULE: ./_utils/index.
|
|
19305
|
-
var _utils = __webpack_require__("
|
|
19304
|
+
// EXTERNAL MODULE: ./_utils/index.tsx
|
|
19305
|
+
var _utils = __webpack_require__("Q0Dl");
|
|
19306
19306
|
|
|
19307
19307
|
// CONCATENATED MODULE: ./configProvider/context.tsx
|
|
19308
19308
|
|
|
@@ -30713,6 +30713,7 @@ class item_BreadcrumbItem extends baseComponent_BaseComponent {
|
|
|
30713
30713
|
const className = "".concat(item_clsPrefix, "-item-icon");
|
|
30714
30714
|
|
|
30715
30715
|
if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(iconType)) {
|
|
30716
|
+
//@ts-ignore
|
|
30716
30717
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(iconType, {
|
|
30717
30718
|
className,
|
|
30718
30719
|
size: iconSize
|
|
@@ -31204,7 +31205,7 @@ class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
|
|
|
31204
31205
|
let lineCls = "".concat(buttonGroup_prefixCls, "-group-line");
|
|
31205
31206
|
|
|
31206
31207
|
if (inner.length > 1) {
|
|
31207
|
-
inner.slice(0, -1).forEach(item => {
|
|
31208
|
+
inner.slice(0, -1).forEach((item, index) => {
|
|
31208
31209
|
const isButtonType = get_default()(item, 'type.elementType') === 'Button';
|
|
31209
31210
|
|
|
31210
31211
|
const buttonProps = get_default()(item, 'props');
|
|
@@ -31222,7 +31223,8 @@ class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
|
|
|
31222
31223
|
|
|
31223
31224
|
if (isButtonType) {
|
|
31224
31225
|
innerWithLine.push(item, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
31225
|
-
className: lineCls
|
|
31226
|
+
className: lineCls,
|
|
31227
|
+
key: "line-".concat(index)
|
|
31226
31228
|
}));
|
|
31227
31229
|
} else {
|
|
31228
31230
|
innerWithLine.push(item);
|
|
@@ -31253,13 +31255,17 @@ class buttonGroup_ButtonGroup extends baseComponent_BaseComponent {
|
|
|
31253
31255
|
const cls = classnames_default()("".concat(buttonGroup_prefixCls, "-group"), className);
|
|
31254
31256
|
|
|
31255
31257
|
if (children) {
|
|
31256
|
-
inner = (Array.isArray(children) ? children : [children]).map((itm, index) =>
|
|
31257
|
-
|
|
31258
|
-
|
|
31259
|
-
|
|
31260
|
-
|
|
31261
|
-
|
|
31262
|
-
|
|
31258
|
+
inner = (Array.isArray(children) ? children : [children]).map((itm, index) => {
|
|
31259
|
+
var _a;
|
|
31260
|
+
|
|
31261
|
+
return /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["isValidElement"])(itm) ? /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["cloneElement"])(itm, Object.assign(Object.assign(Object.assign({
|
|
31262
|
+
disabled,
|
|
31263
|
+
size,
|
|
31264
|
+
type
|
|
31265
|
+
}, itm.props), rest), {
|
|
31266
|
+
key: (_a = itm.key) !== null && _a !== void 0 ? _a : index
|
|
31267
|
+
})) : itm;
|
|
31268
|
+
});
|
|
31263
31269
|
innerWithLine = this.getInnerWithLine(inner);
|
|
31264
31270
|
}
|
|
31265
31271
|
|
|
@@ -59822,7 +59828,6 @@ class ModalContent_ModalContent extends baseComponent_BaseComponent {
|
|
|
59822
59828
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
59823
59829
|
role: "dialog",
|
|
59824
59830
|
ref: this.modalDialogRef,
|
|
59825
|
-
tabIndex: -1,
|
|
59826
59831
|
"aria-modal": "true",
|
|
59827
59832
|
"aria-labelledby": "".concat(modal_constants_cssClasses.DIALOG, "-title"),
|
|
59828
59833
|
"aria-describedby": "".concat(modal_constants_cssClasses.DIALOG, "-body"),
|
|
@@ -59922,8 +59927,16 @@ class ModalContent_ModalContent extends baseComponent_BaseComponent {
|
|
|
59922
59927
|
}
|
|
59923
59928
|
|
|
59924
59929
|
componentDidMount() {
|
|
59930
|
+
var _a;
|
|
59931
|
+
|
|
59925
59932
|
this.foundation.handleKeyDownEventListenerMount();
|
|
59926
59933
|
this.foundation.modalDialogFocus();
|
|
59934
|
+
const nodes = FocusHandle.getFocusableElements(this.modalDialogRef.current);
|
|
59935
|
+
|
|
59936
|
+
if (!this.modalDialogRef.current.contains(document.activeElement)) {
|
|
59937
|
+
// focus on first focusable element
|
|
59938
|
+
(_a = nodes[0]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
59939
|
+
}
|
|
59927
59940
|
}
|
|
59928
59941
|
|
|
59929
59942
|
componentWillUnmount() {
|
|
@@ -59952,7 +59965,6 @@ class ModalContent_ModalContent extends baseComponent_BaseComponent {
|
|
|
59952
59965
|
className: classList
|
|
59953
59966
|
}, this.getMaskElement(), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
59954
59967
|
role: "none",
|
|
59955
|
-
tabIndex: -1,
|
|
59956
59968
|
className: classnames_default()({
|
|
59957
59969
|
["".concat(modal_constants_cssClasses.DIALOG, "-wrap")]: true,
|
|
59958
59970
|
["".concat(modal_constants_cssClasses.DIALOG, "-wrap-center")]: this.props.centered
|
|
@@ -61313,6 +61325,7 @@ class dropdown_Dropdown extends baseComponent_BaseComponent {
|
|
|
61313
61325
|
showArrow: false,
|
|
61314
61326
|
returnFocusOnClose: true
|
|
61315
61327
|
}, attr), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(children) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(children, {
|
|
61328
|
+
//@ts-ignore
|
|
61316
61329
|
className: classnames_default()(get_default()(children, 'props.className'), {
|
|
61317
61330
|
["".concat(prefixCls, "-showing")]: popVisible
|
|
61318
61331
|
}),
|
|
@@ -64304,7 +64317,7 @@ class inputNumber_InputNumber extends baseComponent_BaseComponent {
|
|
|
64304
64317
|
}
|
|
64305
64318
|
}
|
|
64306
64319
|
|
|
64307
|
-
if (isString_default()(newValue) && newValue !== String(this.props.value)) {
|
|
64320
|
+
if (newValue && isString_default()(newValue) && newValue !== String(this.props.value)) {
|
|
64308
64321
|
this.foundation.notifyChange(newValue, null);
|
|
64309
64322
|
}
|
|
64310
64323
|
}
|
|
@@ -65441,6 +65454,7 @@ function OpenIconTransition() {
|
|
|
65441
65454
|
|
|
65442
65455
|
if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(children)) {
|
|
65443
65456
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(children, {
|
|
65457
|
+
// @ts-ignore
|
|
65444
65458
|
style: Object.assign(Object.assign({}, children.props && children.props.style), formatedStyle)
|
|
65445
65459
|
});
|
|
65446
65460
|
}
|
|
@@ -65584,11 +65598,15 @@ class SubNav_SubNav extends baseComponent_BaseComponent {
|
|
|
65584
65598
|
["".concat(prefixCls, "-item-icon-info")]: !isToggleIcon
|
|
65585
65599
|
});
|
|
65586
65600
|
const isOpen = this.adapter.getIsOpen();
|
|
65587
|
-
const iconElem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(icon) ? withTransition ?
|
|
65601
|
+
const iconElem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(icon) ? withTransition ?
|
|
65602
|
+
/*#__PURE__*/
|
|
65603
|
+
// @ts-ignore
|
|
65604
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(navigation_OpenIconTransition, {
|
|
65588
65605
|
isOpen: isOpen
|
|
65589
65606
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
|
|
65590
65607
|
size: iconSize
|
|
65591
|
-
}))
|
|
65608
|
+
})) //@ts-ignore
|
|
65609
|
+
: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
|
|
65592
65610
|
size: iconSize
|
|
65593
65611
|
}) : null;
|
|
65594
65612
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("i", {
|
|
@@ -65922,13 +65940,13 @@ class Footer_NavFooter extends external_root_React_commonjs2_react_commonjs_reac
|
|
|
65922
65940
|
locale,
|
|
65923
65941
|
isCollapsed
|
|
65924
65942
|
} = this.context;
|
|
65925
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(CollapseButton,
|
|
65943
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(CollapseButton, {
|
|
65926
65944
|
prefixCls: prefixCls,
|
|
65927
65945
|
isCollapsed: isCollapsed,
|
|
65928
65946
|
locale: locale,
|
|
65929
65947
|
onClick: onCollapseChange,
|
|
65930
65948
|
collapseText: collapseText
|
|
65931
|
-
}
|
|
65949
|
+
});
|
|
65932
65950
|
};
|
|
65933
65951
|
}
|
|
65934
65952
|
|
|
@@ -84635,7 +84653,7 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
84635
84653
|
overflowY: 'auto'
|
|
84636
84654
|
};
|
|
84637
84655
|
const wrapCls = classnames_default()("".concat(prefixCls, "-body"));
|
|
84638
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(VariableSizeList, Object.assign({}, virtualized, {
|
|
84656
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(VariableSizeList, Object.assign({}, typeof virtualized === 'object' ? virtualized : {}, {
|
|
84639
84657
|
initialScrollOffset: this.state.cache.virtualizedScrollTop,
|
|
84640
84658
|
onScroll: this.handleVirtualizedScroll,
|
|
84641
84659
|
onItemsRendered: this.onItemsRendered,
|
|
@@ -88321,6 +88339,7 @@ class timeline_Timeline extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
88321
88339
|
this.addClassName = items => external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children.map(items, (ele, idx) => {
|
|
88322
88340
|
if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(ele)) {
|
|
88323
88341
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(ele, {
|
|
88342
|
+
// @ts-ignore
|
|
88324
88343
|
className: classnames_default()(ele.props.className, this.getPosCls(ele, idx))
|
|
88325
88344
|
});
|
|
88326
88345
|
}
|
|
@@ -100072,7 +100091,10 @@ function useStateWithGetter(initial) {
|
|
|
100072
100091
|
|
|
100073
100092
|
|
|
100074
100093
|
|
|
100075
|
-
const withField_prefix = form_constants_cssClasses.PREFIX;
|
|
100094
|
+
const withField_prefix = form_constants_cssClasses.PREFIX; // To avoid useLayoutEffect warning when ssr, refer: https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
100095
|
+
// Fix issue 1140
|
|
100096
|
+
|
|
100097
|
+
const useIsomorphicEffect = typeof window !== 'undefined' ? external_root_React_commonjs2_react_commonjs_react_amd_react_["useLayoutEffect"] : external_root_React_commonjs2_react_commonjs_react_amd_react_["useEffect"];
|
|
100076
100098
|
/**
|
|
100077
100099
|
* withFiled is used to inject components
|
|
100078
100100
|
* 1. Takes over the value and onChange of the component and synchronizes them to Form Foundation
|
|
@@ -100412,12 +100434,12 @@ function withField(Component, opts) {
|
|
|
100412
100434
|
status
|
|
100413
100435
|
}; // avoid hooks capture value, fixed issue 346
|
|
100414
100436
|
|
|
100415
|
-
|
|
100437
|
+
useIsomorphicEffect(() => {
|
|
100416
100438
|
rulesRef.current = rules;
|
|
100417
100439
|
validateRef.current = validate;
|
|
100418
100440
|
}, [rules, validate]); // exec validate once when trigger inlcude 'mount'
|
|
100419
100441
|
|
|
100420
|
-
|
|
100442
|
+
useIsomorphicEffect(() => {
|
|
100421
100443
|
if (validateOnMount) {
|
|
100422
100444
|
fieldValidate(value);
|
|
100423
100445
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -100425,7 +100447,7 @@ function withField(Component, opts) {
|
|
|
100425
100447
|
}, []); // register when mounted,unregister when unmounted
|
|
100426
100448
|
// register again when field change
|
|
100427
100449
|
|
|
100428
|
-
|
|
100450
|
+
useIsomorphicEffect(() => {
|
|
100429
100451
|
// register
|
|
100430
100452
|
if (typeof field === 'undefined') {
|
|
100431
100453
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|