You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8157 lines
285 KiB
8157 lines
285 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[96101],{
|
|
|
|
/***/ 96101:
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/antd/es/select/index.js + 106 modules ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ es_select; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(4942);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
var slicedToArray = __webpack_require__(97685);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(45987);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
var esm_typeof = __webpack_require__(71002);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
var react_namespaceObject = /*#__PURE__*/__webpack_require__.t(react, 2);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/hooks/useEvent.js
|
|
|
|
function useEvent_useEvent(callback) {
|
|
var fnRef = react.useRef();
|
|
fnRef.current = callback;
|
|
var memoFn = react.useCallback(function () {
|
|
var _fnRef$current;
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
}, []);
|
|
return memoFn;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/Dom/canUseDom.js
|
|
function canUseDom() {
|
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
|
|
|
|
|
/**
|
|
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
*/
|
|
var useLayoutEffect = true && canUseDom() ? react.useLayoutEffect : react.useEffect;
|
|
/* harmony default export */ var hooks_useLayoutEffect = (useLayoutEffect);
|
|
var useLayoutEffect_useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
|
|
var firstMountRef = react.useRef(true);
|
|
useLayoutEffect(function () {
|
|
if (!firstMountRef.current) {
|
|
return callback();
|
|
}
|
|
}, deps);
|
|
|
|
// We tell react that first mount has passed
|
|
useLayoutEffect(function () {
|
|
firstMountRef.current = false;
|
|
return function () {
|
|
firstMountRef.current = true;
|
|
};
|
|
}, []);
|
|
};
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/hooks/useState.js
|
|
|
|
|
|
/**
|
|
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
|
|
* We do not make this auto is to avoid real memory leak.
|
|
* Developer should confirm it's safe to ignore themselves.
|
|
*/
|
|
function useSafeState(defaultValue) {
|
|
var destroyRef = react.useRef(false);
|
|
var _React$useState = react.useState(defaultValue),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
value = _React$useState2[0],
|
|
setValue = _React$useState2[1];
|
|
react.useEffect(function () {
|
|
destroyRef.current = false;
|
|
return function () {
|
|
destroyRef.current = true;
|
|
};
|
|
}, []);
|
|
function safeSetState(updater, ignoreDestroy) {
|
|
if (ignoreDestroy && destroyRef.current) {
|
|
return;
|
|
}
|
|
setValue(updater);
|
|
}
|
|
return [value, safeSetState];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/hooks/useMergedState.js
|
|
|
|
|
|
|
|
|
|
/** We only think `undefined` is empty */
|
|
function hasValue(value) {
|
|
return value !== undefined;
|
|
}
|
|
|
|
/**
|
|
* Similar to `useState` but will use props value if provided.
|
|
* Note that internal use rc-util `useState` hook.
|
|
*/
|
|
function useMergedState(defaultStateValue, option) {
|
|
var _ref = option || {},
|
|
defaultValue = _ref.defaultValue,
|
|
value = _ref.value,
|
|
onChange = _ref.onChange,
|
|
postState = _ref.postState;
|
|
|
|
// ======================= Init =======================
|
|
var _useState = useSafeState(function () {
|
|
if (hasValue(value)) {
|
|
return value;
|
|
} else if (hasValue(defaultValue)) {
|
|
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
|
|
} else {
|
|
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
|
|
}
|
|
}),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
innerValue = _useState2[0],
|
|
setInnerValue = _useState2[1];
|
|
var mergedValue = value !== undefined ? value : innerValue;
|
|
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
|
|
// ====================== Change ======================
|
|
var onChangeFn = useEvent_useEvent(onChange);
|
|
var _useState3 = useSafeState([mergedValue]),
|
|
_useState4 = (0,slicedToArray/* default */.Z)(_useState3, 2),
|
|
prevValue = _useState4[0],
|
|
setPrevValue = _useState4[1];
|
|
useLayoutEffect_useLayoutUpdateEffect(function () {
|
|
var prev = prevValue[0];
|
|
if (innerValue !== prev) {
|
|
onChangeFn(innerValue, prev);
|
|
}
|
|
}, [prevValue]);
|
|
|
|
// Sync value back to `undefined` when it from control to un-control
|
|
useLayoutEffect_useLayoutUpdateEffect(function () {
|
|
if (!hasValue(value)) {
|
|
setInnerValue(value);
|
|
}
|
|
}, [value]);
|
|
|
|
// ====================== Update ======================
|
|
var triggerChange = useEvent_useEvent(function (updater, ignoreDestroy) {
|
|
setInnerValue(updater, ignoreDestroy);
|
|
setPrevValue([mergedValue], ignoreDestroy);
|
|
});
|
|
return [postMergedValue, triggerChange];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/warning.js
|
|
/* eslint-disable no-console */
|
|
var warned = {};
|
|
function warning_warning(valid, message) {
|
|
// Support uglify
|
|
if (false) {}
|
|
}
|
|
function note(valid, message) {
|
|
// Support uglify
|
|
if (false) {}
|
|
}
|
|
function resetWarned() {
|
|
warned = {};
|
|
}
|
|
function call(method, valid, message) {
|
|
if (!valid && !warned[message]) {
|
|
method(false, message);
|
|
warned[message] = true;
|
|
}
|
|
}
|
|
function warningOnce(valid, message) {
|
|
call(warning_warning, valid, message);
|
|
}
|
|
function warning_noteOnce(valid, message) {
|
|
call(note, valid, message);
|
|
}
|
|
/* harmony default export */ var es_warning = (warningOnce);
|
|
/* eslint-enable */
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/isMobile.js
|
|
/* harmony default export */ var isMobile = (function () {
|
|
if (typeof navigator === 'undefined' || typeof window === 'undefined') {
|
|
return false;
|
|
}
|
|
var agent = navigator.userAgent || navigator.vendor || window.opera;
|
|
return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent === null || agent === void 0 ? void 0 : agent.substr(0, 4));
|
|
});
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/KeyCode.js
|
|
/**
|
|
* @ignore
|
|
* some key-codes definition and utils from closure-library
|
|
* @author yiminghe@gmail.com
|
|
*/
|
|
|
|
var KeyCode = {
|
|
/**
|
|
* MAC_ENTER
|
|
*/
|
|
MAC_ENTER: 3,
|
|
/**
|
|
* BACKSPACE
|
|
*/
|
|
BACKSPACE: 8,
|
|
/**
|
|
* TAB
|
|
*/
|
|
TAB: 9,
|
|
/**
|
|
* NUMLOCK on FF/Safari Mac
|
|
*/
|
|
NUM_CENTER: 12,
|
|
// NUMLOCK on FF/Safari Mac
|
|
/**
|
|
* ENTER
|
|
*/
|
|
ENTER: 13,
|
|
/**
|
|
* SHIFT
|
|
*/
|
|
SHIFT: 16,
|
|
/**
|
|
* CTRL
|
|
*/
|
|
CTRL: 17,
|
|
/**
|
|
* ALT
|
|
*/
|
|
ALT: 18,
|
|
/**
|
|
* PAUSE
|
|
*/
|
|
PAUSE: 19,
|
|
/**
|
|
* CAPS_LOCK
|
|
*/
|
|
CAPS_LOCK: 20,
|
|
/**
|
|
* ESC
|
|
*/
|
|
ESC: 27,
|
|
/**
|
|
* SPACE
|
|
*/
|
|
SPACE: 32,
|
|
/**
|
|
* PAGE_UP
|
|
*/
|
|
PAGE_UP: 33,
|
|
// also NUM_NORTH_EAST
|
|
/**
|
|
* PAGE_DOWN
|
|
*/
|
|
PAGE_DOWN: 34,
|
|
// also NUM_SOUTH_EAST
|
|
/**
|
|
* END
|
|
*/
|
|
END: 35,
|
|
// also NUM_SOUTH_WEST
|
|
/**
|
|
* HOME
|
|
*/
|
|
HOME: 36,
|
|
// also NUM_NORTH_WEST
|
|
/**
|
|
* LEFT
|
|
*/
|
|
LEFT: 37,
|
|
// also NUM_WEST
|
|
/**
|
|
* UP
|
|
*/
|
|
UP: 38,
|
|
// also NUM_NORTH
|
|
/**
|
|
* RIGHT
|
|
*/
|
|
RIGHT: 39,
|
|
// also NUM_EAST
|
|
/**
|
|
* DOWN
|
|
*/
|
|
DOWN: 40,
|
|
// also NUM_SOUTH
|
|
/**
|
|
* PRINT_SCREEN
|
|
*/
|
|
PRINT_SCREEN: 44,
|
|
/**
|
|
* INSERT
|
|
*/
|
|
INSERT: 45,
|
|
// also NUM_INSERT
|
|
/**
|
|
* DELETE
|
|
*/
|
|
DELETE: 46,
|
|
// also NUM_DELETE
|
|
/**
|
|
* ZERO
|
|
*/
|
|
ZERO: 48,
|
|
/**
|
|
* ONE
|
|
*/
|
|
ONE: 49,
|
|
/**
|
|
* TWO
|
|
*/
|
|
TWO: 50,
|
|
/**
|
|
* THREE
|
|
*/
|
|
THREE: 51,
|
|
/**
|
|
* FOUR
|
|
*/
|
|
FOUR: 52,
|
|
/**
|
|
* FIVE
|
|
*/
|
|
FIVE: 53,
|
|
/**
|
|
* SIX
|
|
*/
|
|
SIX: 54,
|
|
/**
|
|
* SEVEN
|
|
*/
|
|
SEVEN: 55,
|
|
/**
|
|
* EIGHT
|
|
*/
|
|
EIGHT: 56,
|
|
/**
|
|
* NINE
|
|
*/
|
|
NINE: 57,
|
|
/**
|
|
* QUESTION_MARK
|
|
*/
|
|
QUESTION_MARK: 63,
|
|
// needs localization
|
|
/**
|
|
* A
|
|
*/
|
|
A: 65,
|
|
/**
|
|
* B
|
|
*/
|
|
B: 66,
|
|
/**
|
|
* C
|
|
*/
|
|
C: 67,
|
|
/**
|
|
* D
|
|
*/
|
|
D: 68,
|
|
/**
|
|
* E
|
|
*/
|
|
E: 69,
|
|
/**
|
|
* F
|
|
*/
|
|
F: 70,
|
|
/**
|
|
* G
|
|
*/
|
|
G: 71,
|
|
/**
|
|
* H
|
|
*/
|
|
H: 72,
|
|
/**
|
|
* I
|
|
*/
|
|
I: 73,
|
|
/**
|
|
* J
|
|
*/
|
|
J: 74,
|
|
/**
|
|
* K
|
|
*/
|
|
K: 75,
|
|
/**
|
|
* L
|
|
*/
|
|
L: 76,
|
|
/**
|
|
* M
|
|
*/
|
|
M: 77,
|
|
/**
|
|
* N
|
|
*/
|
|
N: 78,
|
|
/**
|
|
* O
|
|
*/
|
|
O: 79,
|
|
/**
|
|
* P
|
|
*/
|
|
P: 80,
|
|
/**
|
|
* Q
|
|
*/
|
|
Q: 81,
|
|
/**
|
|
* R
|
|
*/
|
|
R: 82,
|
|
/**
|
|
* S
|
|
*/
|
|
S: 83,
|
|
/**
|
|
* T
|
|
*/
|
|
T: 84,
|
|
/**
|
|
* U
|
|
*/
|
|
U: 85,
|
|
/**
|
|
* V
|
|
*/
|
|
V: 86,
|
|
/**
|
|
* W
|
|
*/
|
|
W: 87,
|
|
/**
|
|
* X
|
|
*/
|
|
X: 88,
|
|
/**
|
|
* Y
|
|
*/
|
|
Y: 89,
|
|
/**
|
|
* Z
|
|
*/
|
|
Z: 90,
|
|
/**
|
|
* META
|
|
*/
|
|
META: 91,
|
|
// WIN_KEY_LEFT
|
|
/**
|
|
* WIN_KEY_RIGHT
|
|
*/
|
|
WIN_KEY_RIGHT: 92,
|
|
/**
|
|
* CONTEXT_MENU
|
|
*/
|
|
CONTEXT_MENU: 93,
|
|
/**
|
|
* NUM_ZERO
|
|
*/
|
|
NUM_ZERO: 96,
|
|
/**
|
|
* NUM_ONE
|
|
*/
|
|
NUM_ONE: 97,
|
|
/**
|
|
* NUM_TWO
|
|
*/
|
|
NUM_TWO: 98,
|
|
/**
|
|
* NUM_THREE
|
|
*/
|
|
NUM_THREE: 99,
|
|
/**
|
|
* NUM_FOUR
|
|
*/
|
|
NUM_FOUR: 100,
|
|
/**
|
|
* NUM_FIVE
|
|
*/
|
|
NUM_FIVE: 101,
|
|
/**
|
|
* NUM_SIX
|
|
*/
|
|
NUM_SIX: 102,
|
|
/**
|
|
* NUM_SEVEN
|
|
*/
|
|
NUM_SEVEN: 103,
|
|
/**
|
|
* NUM_EIGHT
|
|
*/
|
|
NUM_EIGHT: 104,
|
|
/**
|
|
* NUM_NINE
|
|
*/
|
|
NUM_NINE: 105,
|
|
/**
|
|
* NUM_MULTIPLY
|
|
*/
|
|
NUM_MULTIPLY: 106,
|
|
/**
|
|
* NUM_PLUS
|
|
*/
|
|
NUM_PLUS: 107,
|
|
/**
|
|
* NUM_MINUS
|
|
*/
|
|
NUM_MINUS: 109,
|
|
/**
|
|
* NUM_PERIOD
|
|
*/
|
|
NUM_PERIOD: 110,
|
|
/**
|
|
* NUM_DIVISION
|
|
*/
|
|
NUM_DIVISION: 111,
|
|
/**
|
|
* F1
|
|
*/
|
|
F1: 112,
|
|
/**
|
|
* F2
|
|
*/
|
|
F2: 113,
|
|
/**
|
|
* F3
|
|
*/
|
|
F3: 114,
|
|
/**
|
|
* F4
|
|
*/
|
|
F4: 115,
|
|
/**
|
|
* F5
|
|
*/
|
|
F5: 116,
|
|
/**
|
|
* F6
|
|
*/
|
|
F6: 117,
|
|
/**
|
|
* F7
|
|
*/
|
|
F7: 118,
|
|
/**
|
|
* F8
|
|
*/
|
|
F8: 119,
|
|
/**
|
|
* F9
|
|
*/
|
|
F9: 120,
|
|
/**
|
|
* F10
|
|
*/
|
|
F10: 121,
|
|
/**
|
|
* F11
|
|
*/
|
|
F11: 122,
|
|
/**
|
|
* F12
|
|
*/
|
|
F12: 123,
|
|
/**
|
|
* NUMLOCK
|
|
*/
|
|
NUMLOCK: 144,
|
|
/**
|
|
* SEMICOLON
|
|
*/
|
|
SEMICOLON: 186,
|
|
// needs localization
|
|
/**
|
|
* DASH
|
|
*/
|
|
DASH: 189,
|
|
// needs localization
|
|
/**
|
|
* EQUALS
|
|
*/
|
|
EQUALS: 187,
|
|
// needs localization
|
|
/**
|
|
* COMMA
|
|
*/
|
|
COMMA: 188,
|
|
// needs localization
|
|
/**
|
|
* PERIOD
|
|
*/
|
|
PERIOD: 190,
|
|
// needs localization
|
|
/**
|
|
* SLASH
|
|
*/
|
|
SLASH: 191,
|
|
// needs localization
|
|
/**
|
|
* APOSTROPHE
|
|
*/
|
|
APOSTROPHE: 192,
|
|
// needs localization
|
|
/**
|
|
* SINGLE_QUOTE
|
|
*/
|
|
SINGLE_QUOTE: 222,
|
|
// needs localization
|
|
/**
|
|
* OPEN_SQUARE_BRACKET
|
|
*/
|
|
OPEN_SQUARE_BRACKET: 219,
|
|
// needs localization
|
|
/**
|
|
* BACKSLASH
|
|
*/
|
|
BACKSLASH: 220,
|
|
// needs localization
|
|
/**
|
|
* CLOSE_SQUARE_BRACKET
|
|
*/
|
|
CLOSE_SQUARE_BRACKET: 221,
|
|
// needs localization
|
|
/**
|
|
* WIN_KEY
|
|
*/
|
|
WIN_KEY: 224,
|
|
/**
|
|
* MAC_FF_META
|
|
*/
|
|
MAC_FF_META: 224,
|
|
// Firefox (Gecko) fires this for the meta key instead of 91
|
|
/**
|
|
* WIN_IME
|
|
*/
|
|
WIN_IME: 229,
|
|
// ======================== Function ========================
|
|
/**
|
|
* whether text and modified key is entered at the same time.
|
|
*/
|
|
isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
|
|
var keyCode = e.keyCode;
|
|
if (e.altKey && !e.ctrlKey || e.metaKey ||
|
|
// Function keys don't generate text
|
|
keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
|
|
return false;
|
|
}
|
|
|
|
// The following keys are quite harmless, even in combination with
|
|
// CTRL, ALT or SHIFT.
|
|
switch (keyCode) {
|
|
case KeyCode.ALT:
|
|
case KeyCode.CAPS_LOCK:
|
|
case KeyCode.CONTEXT_MENU:
|
|
case KeyCode.CTRL:
|
|
case KeyCode.DOWN:
|
|
case KeyCode.END:
|
|
case KeyCode.ESC:
|
|
case KeyCode.HOME:
|
|
case KeyCode.INSERT:
|
|
case KeyCode.LEFT:
|
|
case KeyCode.MAC_FF_META:
|
|
case KeyCode.META:
|
|
case KeyCode.NUMLOCK:
|
|
case KeyCode.NUM_CENTER:
|
|
case KeyCode.PAGE_DOWN:
|
|
case KeyCode.PAGE_UP:
|
|
case KeyCode.PAUSE:
|
|
case KeyCode.PRINT_SCREEN:
|
|
case KeyCode.RIGHT:
|
|
case KeyCode.SHIFT:
|
|
case KeyCode.UP:
|
|
case KeyCode.WIN_KEY:
|
|
case KeyCode.WIN_KEY_RIGHT:
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
},
|
|
/**
|
|
* whether character is entered.
|
|
*/
|
|
isCharacterKey: function isCharacterKey(keyCode) {
|
|
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
|
|
return true;
|
|
}
|
|
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
|
|
return true;
|
|
}
|
|
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
|
|
return true;
|
|
}
|
|
|
|
// Safari sends zero key code for non-latin characters.
|
|
if (window.navigator.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
|
|
return true;
|
|
}
|
|
switch (keyCode) {
|
|
case KeyCode.SPACE:
|
|
case KeyCode.QUESTION_MARK:
|
|
case KeyCode.NUM_PLUS:
|
|
case KeyCode.NUM_MINUS:
|
|
case KeyCode.NUM_PERIOD:
|
|
case KeyCode.NUM_DIVISION:
|
|
case KeyCode.SEMICOLON:
|
|
case KeyCode.DASH:
|
|
case KeyCode.EQUALS:
|
|
case KeyCode.COMMA:
|
|
case KeyCode.PERIOD:
|
|
case KeyCode.SLASH:
|
|
case KeyCode.APOSTROPHE:
|
|
case KeyCode.SINGLE_QUOTE:
|
|
case KeyCode.OPEN_SQUARE_BRACKET:
|
|
case KeyCode.BACKSLASH:
|
|
case KeyCode.CLOSE_SQUARE_BRACKET:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
};
|
|
/* harmony default export */ var es_KeyCode = (KeyCode);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/react-is/index.js
|
|
var react_is = __webpack_require__(47655);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/hooks/useMemo.js
|
|
|
|
function useMemo(getValue, condition, shouldUpdate) {
|
|
var cacheRef = react.useRef({});
|
|
if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
|
|
cacheRef.current.value = getValue();
|
|
cacheRef.current.condition = condition;
|
|
}
|
|
return cacheRef.current.value;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/ref.js
|
|
|
|
/* eslint-disable no-param-reassign */
|
|
|
|
|
|
|
|
function fillRef(ref, node) {
|
|
if (typeof ref === 'function') {
|
|
ref(node);
|
|
} else if ((0,esm_typeof/* default */.Z)(ref) === 'object' && ref && 'current' in ref) {
|
|
ref.current = node;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Merge refs into one ref function to support ref passing.
|
|
*/
|
|
function composeRef() {
|
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
refs[_key] = arguments[_key];
|
|
}
|
|
var refList = refs.filter(function (ref) {
|
|
return ref;
|
|
});
|
|
if (refList.length <= 1) {
|
|
return refList[0];
|
|
}
|
|
return function (node) {
|
|
refs.forEach(function (ref) {
|
|
fillRef(ref, node);
|
|
});
|
|
};
|
|
}
|
|
function useComposeRef() {
|
|
for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
refs[_key2] = arguments[_key2];
|
|
}
|
|
return useMemo(function () {
|
|
return composeRef.apply(void 0, refs);
|
|
}, refs, function (prev, next) {
|
|
return prev.length === next.length && prev.every(function (ref, i) {
|
|
return ref === next[i];
|
|
});
|
|
});
|
|
}
|
|
function supportRef(nodeOrComponent) {
|
|
var _type$prototype, _nodeOrComponent$prot;
|
|
var type = (0,react_is.isMemo)(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
|
|
|
|
// Function component node
|
|
if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render)) {
|
|
return false;
|
|
}
|
|
|
|
// Class component
|
|
if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
/* eslint-enable */
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/TransBtn.js
|
|
|
|
|
|
var TransBtn = function TransBtn(_ref) {
|
|
var className = _ref.className,
|
|
customizeIcon = _ref.customizeIcon,
|
|
customizeIconProps = _ref.customizeIconProps,
|
|
_onMouseDown = _ref.onMouseDown,
|
|
onClick = _ref.onClick,
|
|
children = _ref.children;
|
|
var icon;
|
|
if (typeof customizeIcon === 'function') {
|
|
icon = customizeIcon(customizeIconProps);
|
|
} else {
|
|
icon = customizeIcon;
|
|
}
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
className: className,
|
|
onMouseDown: function onMouseDown(event) {
|
|
event.preventDefault();
|
|
if (_onMouseDown) {
|
|
_onMouseDown(event);
|
|
}
|
|
},
|
|
style: {
|
|
userSelect: 'none',
|
|
WebkitUserSelect: 'none'
|
|
},
|
|
unselectable: "on",
|
|
onClick: onClick,
|
|
"aria-hidden": true
|
|
}, icon !== undefined ? icon : /*#__PURE__*/react.createElement("span", {
|
|
className: classnames_default()(className.split(/\s+/).map(function (cls) {
|
|
return "".concat(cls, "-icon");
|
|
}))
|
|
}, children));
|
|
};
|
|
/* harmony default export */ var es_TransBtn = (TransBtn);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useAllowClear.js
|
|
|
|
|
|
|
|
function useAllowClear(prefixCls, onClearMouseDown, displayValues, allowClear, clearIcon) {
|
|
var disabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
var mergedSearchValue = arguments.length > 6 ? arguments[6] : undefined;
|
|
var mode = arguments.length > 7 ? arguments[7] : undefined;
|
|
var mergedClearIcon = react.useMemo(function () {
|
|
if ((0,esm_typeof/* default */.Z)(allowClear) === "object") {
|
|
return allowClear.clearIcon;
|
|
}
|
|
if (!!clearIcon) return clearIcon;
|
|
}, [allowClear, clearIcon]);
|
|
var mergedAllowClear = react.useMemo(function () {
|
|
if (!disabled && !!allowClear && (displayValues.length || mergedSearchValue) && !(mode === 'combobox' && mergedSearchValue === '')) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}, [allowClear, disabled, displayValues.length, mergedSearchValue, mode]);
|
|
return {
|
|
allowClear: mergedAllowClear,
|
|
clearIcon: /*#__PURE__*/react.createElement(es_TransBtn, {
|
|
className: "".concat(prefixCls, "-clear"),
|
|
onMouseDown: onClearMouseDown,
|
|
customizeIcon: mergedClearIcon
|
|
}, "\xD7")
|
|
};
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useBaseProps.js
|
|
/**
|
|
* BaseSelect provide some parsed data into context.
|
|
* You can use this hooks to get them.
|
|
*/
|
|
|
|
|
|
var BaseSelectContext = /*#__PURE__*/react.createContext(null);
|
|
function useBaseProps() {
|
|
return react.useContext(BaseSelectContext);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useDelayReset.js
|
|
|
|
|
|
|
|
/**
|
|
* Similar with `useLock`, but this hook will always execute last value.
|
|
* When set to `true`, it will keep `true` for a short time even if `false` is set.
|
|
*/
|
|
function useDelayReset() {
|
|
var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
var _React$useState = react.useState(false),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
bool = _React$useState2[0],
|
|
setBool = _React$useState2[1];
|
|
var delayRef = react.useRef(null);
|
|
var cancelLatest = function cancelLatest() {
|
|
window.clearTimeout(delayRef.current);
|
|
};
|
|
react.useEffect(function () {
|
|
return cancelLatest;
|
|
}, []);
|
|
var delaySetBool = function delaySetBool(value, callback) {
|
|
cancelLatest();
|
|
delayRef.current = window.setTimeout(function () {
|
|
setBool(value);
|
|
if (callback) {
|
|
callback();
|
|
}
|
|
}, timeout);
|
|
};
|
|
return [bool, delaySetBool, cancelLatest];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useLock.js
|
|
|
|
|
|
/**
|
|
* Locker return cached mark.
|
|
* If set to `true`, will return `true` in a short time even if set `false`.
|
|
* If set to `false` and then set to `true`, will change to `true`.
|
|
* And after time duration, it will back to `null` automatically.
|
|
*/
|
|
function useLock() {
|
|
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 250;
|
|
var lockRef = react.useRef(null);
|
|
var timeoutRef = react.useRef(null);
|
|
|
|
// Clean up
|
|
react.useEffect(function () {
|
|
return function () {
|
|
window.clearTimeout(timeoutRef.current);
|
|
};
|
|
}, []);
|
|
function doLock(locked) {
|
|
if (locked || lockRef.current === null) {
|
|
lockRef.current = locked;
|
|
}
|
|
window.clearTimeout(timeoutRef.current);
|
|
timeoutRef.current = window.setTimeout(function () {
|
|
lockRef.current = null;
|
|
}, duration);
|
|
}
|
|
return [function () {
|
|
return lockRef.current;
|
|
}, doLock];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useSelectTriggerControl.js
|
|
|
|
function useSelectTriggerControl(elements, open, triggerOpen, customizedTrigger) {
|
|
var propsRef = react.useRef(null);
|
|
propsRef.current = {
|
|
open: open,
|
|
triggerOpen: triggerOpen,
|
|
customizedTrigger: customizedTrigger
|
|
};
|
|
react.useEffect(function () {
|
|
function onGlobalMouseDown(event) {
|
|
var _propsRef$current;
|
|
// If trigger is customized, Trigger will take control of popupVisible
|
|
if ((_propsRef$current = propsRef.current) !== null && _propsRef$current !== void 0 && _propsRef$current.customizedTrigger) {
|
|
return;
|
|
}
|
|
var target = event.target;
|
|
if (target.shadowRoot && event.composed) {
|
|
target = event.composedPath()[0] || target;
|
|
}
|
|
if (propsRef.current.open && elements().filter(function (element) {
|
|
return element;
|
|
}).every(function (element) {
|
|
return !element.contains(target) && element !== target;
|
|
})) {
|
|
// Should trigger close
|
|
propsRef.current.triggerOpen(false);
|
|
}
|
|
}
|
|
window.addEventListener('mousedown', onGlobalMouseDown);
|
|
return function () {
|
|
return window.removeEventListener('mousedown', onGlobalMouseDown);
|
|
};
|
|
}, []);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/pickAttrs.js
|
|
|
|
var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap";
|
|
var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError";
|
|
var propList = "".concat(attributes, " ").concat(eventsName).split(/[\s\n]+/);
|
|
|
|
/* eslint-enable max-len */
|
|
var ariaPrefix = 'aria-';
|
|
var dataPrefix = 'data-';
|
|
function match(key, prefix) {
|
|
return key.indexOf(prefix) === 0;
|
|
}
|
|
/**
|
|
* Picker props from exist props with filter
|
|
* @param props Passed props
|
|
* @param ariaOnly boolean | { aria?: boolean; data?: boolean; attr?: boolean; } filter config
|
|
*/
|
|
function pickAttrs(props) {
|
|
var ariaOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
var mergedConfig;
|
|
if (ariaOnly === false) {
|
|
mergedConfig = {
|
|
aria: true,
|
|
data: true,
|
|
attr: true
|
|
};
|
|
} else if (ariaOnly === true) {
|
|
mergedConfig = {
|
|
aria: true
|
|
};
|
|
} else {
|
|
mergedConfig = (0,objectSpread2/* default */.Z)({}, ariaOnly);
|
|
}
|
|
var attrs = {};
|
|
Object.keys(props).forEach(function (key) {
|
|
if (
|
|
// Aria
|
|
mergedConfig.aria && (key === 'role' || match(key, ariaPrefix)) ||
|
|
// Data
|
|
mergedConfig.data && match(key, dataPrefix) ||
|
|
// Attr
|
|
mergedConfig.attr && propList.includes(key)) {
|
|
attrs[key] = props[key];
|
|
}
|
|
});
|
|
return attrs;
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/rc-resize-observer/es/index.js + 4 modules
|
|
var es = __webpack_require__(48555);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/node_modules/rc-util/es/Dom/canUseDom.js
|
|
function canUseDom_canUseDom() {
|
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
|
|
|
|
|
/**
|
|
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
*/
|
|
var useLayoutEffect_useLayoutEffect = true && canUseDom_canUseDom() ? react.useLayoutEffect : react.useEffect;
|
|
/* harmony default export */ var es_hooks_useLayoutEffect = (useLayoutEffect_useLayoutEffect);
|
|
var hooks_useLayoutEffect_useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
|
|
var firstMountRef = React.useRef(true);
|
|
useLayoutEffect_useLayoutEffect(function () {
|
|
if (!firstMountRef.current) {
|
|
return callback();
|
|
}
|
|
}, deps);
|
|
|
|
// We tell react that first mount has passed
|
|
useLayoutEffect_useLayoutEffect(function () {
|
|
firstMountRef.current = false;
|
|
return function () {
|
|
firstMountRef.current = true;
|
|
};
|
|
}, []);
|
|
};
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/es/Item.js
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"];
|
|
|
|
|
|
|
|
// Use shared variable to save bundle size
|
|
var UNDEFINED = undefined;
|
|
function InternalItem(props, ref) {
|
|
var prefixCls = props.prefixCls,
|
|
invalidate = props.invalidate,
|
|
item = props.item,
|
|
renderItem = props.renderItem,
|
|
responsive = props.responsive,
|
|
responsiveDisabled = props.responsiveDisabled,
|
|
registerSize = props.registerSize,
|
|
itemKey = props.itemKey,
|
|
className = props.className,
|
|
style = props.style,
|
|
children = props.children,
|
|
display = props.display,
|
|
order = props.order,
|
|
_props$component = props.component,
|
|
Component = _props$component === void 0 ? 'div' : _props$component,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
|
|
var mergedHidden = responsive && !display;
|
|
// ================================ Effect ================================
|
|
function internalRegisterSize(width) {
|
|
registerSize(itemKey, width);
|
|
}
|
|
react.useEffect(function () {
|
|
return function () {
|
|
internalRegisterSize(null);
|
|
};
|
|
}, []);
|
|
// ================================ Render ================================
|
|
var childNode = renderItem && item !== UNDEFINED ? renderItem(item) : children;
|
|
var overflowStyle;
|
|
if (!invalidate) {
|
|
overflowStyle = {
|
|
opacity: mergedHidden ? 0 : 1,
|
|
height: mergedHidden ? 0 : UNDEFINED,
|
|
overflowY: mergedHidden ? 'hidden' : UNDEFINED,
|
|
order: responsive ? order : UNDEFINED,
|
|
pointerEvents: mergedHidden ? 'none' : UNDEFINED,
|
|
position: mergedHidden ? 'absolute' : UNDEFINED
|
|
};
|
|
}
|
|
var overflowProps = {};
|
|
if (mergedHidden) {
|
|
overflowProps['aria-hidden'] = true;
|
|
}
|
|
var itemNode = /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
|
className: classnames_default()(!invalidate && prefixCls, className),
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, overflowStyle), style)
|
|
}, overflowProps, restProps, {
|
|
ref: ref
|
|
}), childNode);
|
|
if (responsive) {
|
|
itemNode = /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
onResize: function onResize(_ref) {
|
|
var offsetWidth = _ref.offsetWidth;
|
|
internalRegisterSize(offsetWidth);
|
|
},
|
|
disabled: responsiveDisabled
|
|
}, itemNode);
|
|
}
|
|
return itemNode;
|
|
}
|
|
var Item = /*#__PURE__*/react.forwardRef(InternalItem);
|
|
Item.displayName = 'Item';
|
|
/* harmony default export */ var es_Item = (Item);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/node_modules/rc-util/es/hooks/useEvent.js
|
|
|
|
function hooks_useEvent_useEvent(callback) {
|
|
var fnRef = react.useRef();
|
|
fnRef.current = callback;
|
|
var memoFn = react.useCallback(function () {
|
|
var _fnRef$current;
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
}, []);
|
|
return memoFn;
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/react-dom/index.js
|
|
var react_dom = __webpack_require__(73935);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/node_modules/rc-util/es/raf.js
|
|
var raf = function raf(callback) {
|
|
return +setTimeout(callback, 16);
|
|
};
|
|
var caf = function caf(num) {
|
|
return clearTimeout(num);
|
|
};
|
|
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
|
|
raf = function raf(callback) {
|
|
return window.requestAnimationFrame(callback);
|
|
};
|
|
caf = function caf(handle) {
|
|
return window.cancelAnimationFrame(handle);
|
|
};
|
|
}
|
|
var rafUUID = 0;
|
|
var rafIds = new Map();
|
|
function cleanup(id) {
|
|
rafIds.delete(id);
|
|
}
|
|
var wrapperRaf = function wrapperRaf(callback) {
|
|
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
rafUUID += 1;
|
|
var id = rafUUID;
|
|
function callRef(leftTimes) {
|
|
if (leftTimes === 0) {
|
|
// Clean up
|
|
cleanup(id);
|
|
|
|
// Trigger
|
|
callback();
|
|
} else {
|
|
// Next raf
|
|
var realId = raf(function () {
|
|
callRef(leftTimes - 1);
|
|
});
|
|
|
|
// Bind real raf id
|
|
rafIds.set(id, realId);
|
|
}
|
|
}
|
|
callRef(times);
|
|
return id;
|
|
};
|
|
wrapperRaf.cancel = function (id) {
|
|
var realId = rafIds.get(id);
|
|
cleanup(realId);
|
|
return caf(realId);
|
|
};
|
|
/* harmony default export */ var es_raf = (wrapperRaf);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/es/hooks/channelUpdate.js
|
|
|
|
function channelUpdate(callback) {
|
|
if (typeof MessageChannel === 'undefined') {
|
|
es_raf(callback);
|
|
} else {
|
|
var channel = new MessageChannel();
|
|
channel.port1.onmessage = function () {
|
|
return callback();
|
|
};
|
|
channel.port2.postMessage(undefined);
|
|
}
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/es/hooks/useEffectState.js
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Batcher for record any `useEffectState` need update.
|
|
*/
|
|
function useBatcher() {
|
|
// Updater Trigger
|
|
var updateFuncRef = react.useRef(null);
|
|
// Notify update
|
|
var notifyEffectUpdate = function notifyEffectUpdate(callback) {
|
|
if (!updateFuncRef.current) {
|
|
updateFuncRef.current = [];
|
|
channelUpdate(function () {
|
|
(0,react_dom.unstable_batchedUpdates)(function () {
|
|
updateFuncRef.current.forEach(function (fn) {
|
|
fn();
|
|
});
|
|
updateFuncRef.current = null;
|
|
});
|
|
});
|
|
}
|
|
updateFuncRef.current.push(callback);
|
|
};
|
|
return notifyEffectUpdate;
|
|
}
|
|
/**
|
|
* Trigger state update by `useLayoutEffect` to save perf.
|
|
*/
|
|
function useEffectState(notifyEffectUpdate, defaultValue) {
|
|
// Value
|
|
var _React$useState = react.useState(defaultValue),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
stateValue = _React$useState2[0],
|
|
setStateValue = _React$useState2[1];
|
|
// Set State
|
|
var setEffectVal = hooks_useEvent_useEvent(function (nextValue) {
|
|
notifyEffectUpdate(function () {
|
|
setStateValue(nextValue);
|
|
});
|
|
});
|
|
return [stateValue, setEffectVal];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/es/context.js
|
|
|
|
var OverflowContext = /*#__PURE__*/react.createContext(null);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/es/RawItem.js
|
|
|
|
|
|
var RawItem_excluded = ["component"],
|
|
_excluded2 = ["className"],
|
|
_excluded3 = ["className"];
|
|
|
|
|
|
|
|
|
|
var InternalRawItem = function InternalRawItem(props, ref) {
|
|
var context = react.useContext(OverflowContext);
|
|
// Render directly when context not provided
|
|
if (!context) {
|
|
var _props$component = props.component,
|
|
Component = _props$component === void 0 ? 'div' : _props$component,
|
|
_restProps = (0,objectWithoutProperties/* default */.Z)(props, RawItem_excluded);
|
|
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({}, _restProps, {
|
|
ref: ref
|
|
}));
|
|
}
|
|
var contextClassName = context.className,
|
|
restContext = (0,objectWithoutProperties/* default */.Z)(context, _excluded2);
|
|
var className = props.className,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded3);
|
|
// Do not pass context to sub item to avoid multiple measure
|
|
return /*#__PURE__*/react.createElement(OverflowContext.Provider, {
|
|
value: null
|
|
}, /*#__PURE__*/react.createElement(es_Item, (0,esm_extends/* default */.Z)({
|
|
ref: ref,
|
|
className: classnames_default()(contextClassName, className)
|
|
}, restContext, restProps)));
|
|
};
|
|
var RawItem = /*#__PURE__*/react.forwardRef(InternalRawItem);
|
|
RawItem.displayName = 'RawItem';
|
|
/* harmony default export */ var es_RawItem = (RawItem);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/es/Overflow.js
|
|
|
|
|
|
|
|
|
|
var Overflow_excluded = ["prefixCls", "data", "renderItem", "renderRawItem", "itemKey", "itemWidth", "ssr", "style", "className", "maxCount", "renderRest", "renderRawRest", "suffix", "component", "itemComponent", "onVisibleChange"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var RESPONSIVE = 'responsive';
|
|
var INVALIDATE = 'invalidate';
|
|
|
|
function defaultRenderRest(omittedItems) {
|
|
return "+ ".concat(omittedItems.length, " ...");
|
|
}
|
|
function Overflow(props, ref) {
|
|
var _props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-overflow' : _props$prefixCls,
|
|
_props$data = props.data,
|
|
data = _props$data === void 0 ? [] : _props$data,
|
|
renderItem = props.renderItem,
|
|
renderRawItem = props.renderRawItem,
|
|
itemKey = props.itemKey,
|
|
_props$itemWidth = props.itemWidth,
|
|
itemWidth = _props$itemWidth === void 0 ? 10 : _props$itemWidth,
|
|
ssr = props.ssr,
|
|
style = props.style,
|
|
className = props.className,
|
|
maxCount = props.maxCount,
|
|
renderRest = props.renderRest,
|
|
renderRawRest = props.renderRawRest,
|
|
suffix = props.suffix,
|
|
_props$component = props.component,
|
|
Component = _props$component === void 0 ? 'div' : _props$component,
|
|
itemComponent = props.itemComponent,
|
|
onVisibleChange = props.onVisibleChange,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, Overflow_excluded);
|
|
var fullySSR = ssr === 'full';
|
|
var notifyEffectUpdate = useBatcher();
|
|
var _useEffectState = useEffectState(notifyEffectUpdate, null),
|
|
_useEffectState2 = (0,slicedToArray/* default */.Z)(_useEffectState, 2),
|
|
containerWidth = _useEffectState2[0],
|
|
setContainerWidth = _useEffectState2[1];
|
|
var mergedContainerWidth = containerWidth || 0;
|
|
var _useEffectState3 = useEffectState(notifyEffectUpdate, new Map()),
|
|
_useEffectState4 = (0,slicedToArray/* default */.Z)(_useEffectState3, 2),
|
|
itemWidths = _useEffectState4[0],
|
|
setItemWidths = _useEffectState4[1];
|
|
var _useEffectState5 = useEffectState(notifyEffectUpdate, 0),
|
|
_useEffectState6 = (0,slicedToArray/* default */.Z)(_useEffectState5, 2),
|
|
prevRestWidth = _useEffectState6[0],
|
|
setPrevRestWidth = _useEffectState6[1];
|
|
var _useEffectState7 = useEffectState(notifyEffectUpdate, 0),
|
|
_useEffectState8 = (0,slicedToArray/* default */.Z)(_useEffectState7, 2),
|
|
restWidth = _useEffectState8[0],
|
|
setRestWidth = _useEffectState8[1];
|
|
var _useEffectState9 = useEffectState(notifyEffectUpdate, 0),
|
|
_useEffectState10 = (0,slicedToArray/* default */.Z)(_useEffectState9, 2),
|
|
suffixWidth = _useEffectState10[0],
|
|
setSuffixWidth = _useEffectState10[1];
|
|
var _useState = (0,react.useState)(null),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
suffixFixedStart = _useState2[0],
|
|
setSuffixFixedStart = _useState2[1];
|
|
var _useState3 = (0,react.useState)(null),
|
|
_useState4 = (0,slicedToArray/* default */.Z)(_useState3, 2),
|
|
displayCount = _useState4[0],
|
|
setDisplayCount = _useState4[1];
|
|
var mergedDisplayCount = react.useMemo(function () {
|
|
if (displayCount === null && fullySSR) {
|
|
return Number.MAX_SAFE_INTEGER;
|
|
}
|
|
return displayCount || 0;
|
|
}, [displayCount, containerWidth]);
|
|
var _useState5 = (0,react.useState)(false),
|
|
_useState6 = (0,slicedToArray/* default */.Z)(_useState5, 2),
|
|
restReady = _useState6[0],
|
|
setRestReady = _useState6[1];
|
|
var itemPrefixCls = "".concat(prefixCls, "-item");
|
|
// Always use the max width to avoid blink
|
|
var mergedRestWidth = Math.max(prevRestWidth, restWidth);
|
|
// ================================= Data =================================
|
|
var isResponsive = maxCount === RESPONSIVE;
|
|
var shouldResponsive = data.length && isResponsive;
|
|
var invalidate = maxCount === INVALIDATE;
|
|
/**
|
|
* When is `responsive`, we will always render rest node to get the real width of it for calculation
|
|
*/
|
|
var showRest = shouldResponsive || typeof maxCount === 'number' && data.length > maxCount;
|
|
var mergedData = (0,react.useMemo)(function () {
|
|
var items = data;
|
|
if (shouldResponsive) {
|
|
if (containerWidth === null && fullySSR) {
|
|
items = data;
|
|
} else {
|
|
items = data.slice(0, Math.min(data.length, mergedContainerWidth / itemWidth));
|
|
}
|
|
} else if (typeof maxCount === 'number') {
|
|
items = data.slice(0, maxCount);
|
|
}
|
|
return items;
|
|
}, [data, itemWidth, containerWidth, maxCount, shouldResponsive]);
|
|
var omittedItems = (0,react.useMemo)(function () {
|
|
if (shouldResponsive) {
|
|
return data.slice(mergedDisplayCount + 1);
|
|
}
|
|
return data.slice(mergedData.length);
|
|
}, [data, mergedData, shouldResponsive, mergedDisplayCount]);
|
|
// ================================= Item =================================
|
|
var getKey = (0,react.useCallback)(function (item, index) {
|
|
var _ref;
|
|
if (typeof itemKey === 'function') {
|
|
return itemKey(item);
|
|
}
|
|
return (_ref = itemKey && (item === null || item === void 0 ? void 0 : item[itemKey])) !== null && _ref !== void 0 ? _ref : index;
|
|
}, [itemKey]);
|
|
var mergedRenderItem = (0,react.useCallback)(renderItem || function (item) {
|
|
return item;
|
|
}, [renderItem]);
|
|
function updateDisplayCount(count, suffixFixedStartVal, notReady) {
|
|
// React 18 will sync render even when the value is same in some case.
|
|
// We take `mergedData` as deps which may cause dead loop if it's dynamic generate.
|
|
// ref: https://github.com/ant-design/ant-design/issues/36559
|
|
if (displayCount === count && (suffixFixedStartVal === undefined || suffixFixedStartVal === suffixFixedStart)) {
|
|
return;
|
|
}
|
|
setDisplayCount(count);
|
|
if (!notReady) {
|
|
setRestReady(count < data.length - 1);
|
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(count);
|
|
}
|
|
if (suffixFixedStartVal !== undefined) {
|
|
setSuffixFixedStart(suffixFixedStartVal);
|
|
}
|
|
}
|
|
// ================================= Size =================================
|
|
function onOverflowResize(_, element) {
|
|
setContainerWidth(element.clientWidth);
|
|
}
|
|
function registerSize(key, width) {
|
|
setItemWidths(function (origin) {
|
|
var clone = new Map(origin);
|
|
if (width === null) {
|
|
clone.delete(key);
|
|
} else {
|
|
clone.set(key, width);
|
|
}
|
|
return clone;
|
|
});
|
|
}
|
|
function registerOverflowSize(_, width) {
|
|
setRestWidth(width);
|
|
setPrevRestWidth(restWidth);
|
|
}
|
|
function registerSuffixSize(_, width) {
|
|
setSuffixWidth(width);
|
|
}
|
|
// ================================ Effect ================================
|
|
function getItemWidth(index) {
|
|
return itemWidths.get(getKey(mergedData[index], index));
|
|
}
|
|
es_hooks_useLayoutEffect(function () {
|
|
if (mergedContainerWidth && typeof mergedRestWidth === 'number' && mergedData) {
|
|
var totalWidth = suffixWidth;
|
|
var len = mergedData.length;
|
|
var lastIndex = len - 1;
|
|
// When data count change to 0, reset this since not loop will reach
|
|
if (!len) {
|
|
updateDisplayCount(0, null);
|
|
return;
|
|
}
|
|
for (var i = 0; i < len; i += 1) {
|
|
var currentItemWidth = getItemWidth(i);
|
|
// Fully will always render
|
|
if (fullySSR) {
|
|
currentItemWidth = currentItemWidth || 0;
|
|
}
|
|
// Break since data not ready
|
|
if (currentItemWidth === undefined) {
|
|
updateDisplayCount(i - 1, undefined, true);
|
|
break;
|
|
}
|
|
// Find best match
|
|
totalWidth += currentItemWidth;
|
|
if (
|
|
// Only one means `totalWidth` is the final width
|
|
lastIndex === 0 && totalWidth <= mergedContainerWidth ||
|
|
// Last two width will be the final width
|
|
i === lastIndex - 1 && totalWidth + getItemWidth(lastIndex) <= mergedContainerWidth) {
|
|
// Additional check if match the end
|
|
updateDisplayCount(lastIndex, null);
|
|
break;
|
|
} else if (totalWidth + mergedRestWidth > mergedContainerWidth) {
|
|
// Can not hold all the content to show rest
|
|
updateDisplayCount(i - 1, totalWidth - currentItemWidth - suffixWidth + restWidth);
|
|
break;
|
|
}
|
|
}
|
|
if (suffix && getItemWidth(0) + suffixWidth > mergedContainerWidth) {
|
|
setSuffixFixedStart(null);
|
|
}
|
|
}
|
|
}, [mergedContainerWidth, itemWidths, restWidth, suffixWidth, getKey, mergedData]);
|
|
// ================================ Render ================================
|
|
var displayRest = restReady && !!omittedItems.length;
|
|
var suffixStyle = {};
|
|
if (suffixFixedStart !== null && shouldResponsive) {
|
|
suffixStyle = {
|
|
position: 'absolute',
|
|
left: suffixFixedStart,
|
|
top: 0
|
|
};
|
|
}
|
|
var itemSharedProps = {
|
|
prefixCls: itemPrefixCls,
|
|
responsive: shouldResponsive,
|
|
component: itemComponent,
|
|
invalidate: invalidate
|
|
};
|
|
// >>>>> Choice render fun by `renderRawItem`
|
|
var internalRenderItemNode = renderRawItem ? function (item, index) {
|
|
var key = getKey(item, index);
|
|
return /*#__PURE__*/react.createElement(OverflowContext.Provider, {
|
|
key: key,
|
|
value: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, itemSharedProps), {}, {
|
|
order: index,
|
|
item: item,
|
|
itemKey: key,
|
|
registerSize: registerSize,
|
|
display: index <= mergedDisplayCount
|
|
})
|
|
}, renderRawItem(item, index));
|
|
} : function (item, index) {
|
|
var key = getKey(item, index);
|
|
return /*#__PURE__*/react.createElement(es_Item, (0,esm_extends/* default */.Z)({}, itemSharedProps, {
|
|
order: index,
|
|
key: key,
|
|
item: item,
|
|
renderItem: mergedRenderItem,
|
|
itemKey: key,
|
|
registerSize: registerSize,
|
|
display: index <= mergedDisplayCount
|
|
}));
|
|
};
|
|
// >>>>> Rest node
|
|
var restNode;
|
|
var restContextProps = {
|
|
order: displayRest ? mergedDisplayCount : Number.MAX_SAFE_INTEGER,
|
|
className: "".concat(itemPrefixCls, "-rest"),
|
|
registerSize: registerOverflowSize,
|
|
display: displayRest
|
|
};
|
|
if (!renderRawRest) {
|
|
var mergedRenderRest = renderRest || defaultRenderRest;
|
|
restNode = /*#__PURE__*/react.createElement(es_Item, (0,esm_extends/* default */.Z)({}, itemSharedProps, restContextProps), typeof mergedRenderRest === 'function' ? mergedRenderRest(omittedItems) : mergedRenderRest);
|
|
} else if (renderRawRest) {
|
|
restNode = /*#__PURE__*/react.createElement(OverflowContext.Provider, {
|
|
value: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, itemSharedProps), restContextProps)
|
|
}, renderRawRest(omittedItems));
|
|
}
|
|
var overflowNode = /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
|
className: classnames_default()(!invalidate && prefixCls, className),
|
|
style: style,
|
|
ref: ref
|
|
}, restProps), mergedData.map(internalRenderItemNode), showRest ? restNode : null, suffix && /*#__PURE__*/react.createElement(es_Item, (0,esm_extends/* default */.Z)({}, itemSharedProps, {
|
|
responsive: isResponsive,
|
|
responsiveDisabled: !shouldResponsive,
|
|
order: mergedDisplayCount,
|
|
className: "".concat(itemPrefixCls, "-suffix"),
|
|
registerSize: registerSuffixSize,
|
|
display: true,
|
|
style: suffixStyle
|
|
}), suffix));
|
|
if (isResponsive) {
|
|
overflowNode = /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
onResize: onOverflowResize,
|
|
disabled: !shouldResponsive
|
|
}, overflowNode);
|
|
}
|
|
return overflowNode;
|
|
}
|
|
var ForwardOverflow = /*#__PURE__*/react.forwardRef(Overflow);
|
|
ForwardOverflow.displayName = 'Overflow';
|
|
ForwardOverflow.Item = es_RawItem;
|
|
ForwardOverflow.RESPONSIVE = RESPONSIVE;
|
|
ForwardOverflow.INVALIDATE = INVALIDATE;
|
|
// Convert to generic type
|
|
/* harmony default export */ var es_Overflow = (ForwardOverflow);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-overflow/es/index.js
|
|
|
|
/* harmony default export */ var rc_overflow_es = (es_Overflow);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/Selector/Input.js
|
|
|
|
|
|
|
|
|
|
|
|
var Input = function Input(_ref, ref) {
|
|
var _inputNode2, _inputNode2$props;
|
|
var prefixCls = _ref.prefixCls,
|
|
id = _ref.id,
|
|
inputElement = _ref.inputElement,
|
|
disabled = _ref.disabled,
|
|
tabIndex = _ref.tabIndex,
|
|
autoFocus = _ref.autoFocus,
|
|
autoComplete = _ref.autoComplete,
|
|
editable = _ref.editable,
|
|
activeDescendantId = _ref.activeDescendantId,
|
|
value = _ref.value,
|
|
maxLength = _ref.maxLength,
|
|
_onKeyDown = _ref.onKeyDown,
|
|
_onMouseDown = _ref.onMouseDown,
|
|
_onChange = _ref.onChange,
|
|
onPaste = _ref.onPaste,
|
|
_onCompositionStart = _ref.onCompositionStart,
|
|
_onCompositionEnd = _ref.onCompositionEnd,
|
|
open = _ref.open,
|
|
attrs = _ref.attrs;
|
|
var inputNode = inputElement || /*#__PURE__*/react.createElement("input", null);
|
|
var _inputNode = inputNode,
|
|
originRef = _inputNode.ref,
|
|
originProps = _inputNode.props;
|
|
var onOriginKeyDown = originProps.onKeyDown,
|
|
onOriginChange = originProps.onChange,
|
|
onOriginMouseDown = originProps.onMouseDown,
|
|
onOriginCompositionStart = originProps.onCompositionStart,
|
|
onOriginCompositionEnd = originProps.onCompositionEnd,
|
|
style = originProps.style;
|
|
warning_warning(!('maxLength' in inputNode.props), "Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled.");
|
|
inputNode = /*#__PURE__*/react.cloneElement(inputNode, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({
|
|
type: 'search'
|
|
}, originProps), {}, {
|
|
// Override over origin props
|
|
id: id,
|
|
ref: composeRef(ref, originRef),
|
|
disabled: disabled,
|
|
tabIndex: tabIndex,
|
|
autoComplete: autoComplete || 'off',
|
|
autoFocus: autoFocus,
|
|
className: classnames_default()("".concat(prefixCls, "-selection-search-input"), (_inputNode2 = inputNode) === null || _inputNode2 === void 0 ? void 0 : (_inputNode2$props = _inputNode2.props) === null || _inputNode2$props === void 0 ? void 0 : _inputNode2$props.className),
|
|
role: 'combobox',
|
|
'aria-label': 'Search',
|
|
'aria-expanded': open || false,
|
|
'aria-haspopup': 'listbox',
|
|
'aria-owns': "".concat(id, "_list"),
|
|
'aria-autocomplete': 'list',
|
|
'aria-controls': "".concat(id, "_list"),
|
|
'aria-activedescendant': open ? activeDescendantId : undefined
|
|
}, attrs), {}, {
|
|
value: editable ? value : '',
|
|
maxLength: maxLength,
|
|
readOnly: !editable,
|
|
unselectable: !editable ? 'on' : null,
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, style), {}, {
|
|
opacity: editable ? null : 0
|
|
}),
|
|
onKeyDown: function onKeyDown(event) {
|
|
_onKeyDown(event);
|
|
if (onOriginKeyDown) {
|
|
onOriginKeyDown(event);
|
|
}
|
|
},
|
|
onMouseDown: function onMouseDown(event) {
|
|
_onMouseDown(event);
|
|
if (onOriginMouseDown) {
|
|
onOriginMouseDown(event);
|
|
}
|
|
},
|
|
onChange: function onChange(event) {
|
|
_onChange(event);
|
|
if (onOriginChange) {
|
|
onOriginChange(event);
|
|
}
|
|
},
|
|
onCompositionStart: function onCompositionStart(event) {
|
|
_onCompositionStart(event);
|
|
if (onOriginCompositionStart) {
|
|
onOriginCompositionStart(event);
|
|
}
|
|
},
|
|
onCompositionEnd: function onCompositionEnd(event) {
|
|
_onCompositionEnd(event);
|
|
if (onOriginCompositionEnd) {
|
|
onOriginCompositionEnd(event);
|
|
}
|
|
},
|
|
onPaste: onPaste
|
|
}));
|
|
return inputNode;
|
|
};
|
|
var RefInput = /*#__PURE__*/react.forwardRef(Input);
|
|
RefInput.displayName = 'Input';
|
|
/* harmony default export */ var Selector_Input = (RefInput);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/utils/commonUtil.js
|
|
|
|
function commonUtil_toArray(value) {
|
|
if (Array.isArray(value)) {
|
|
return value;
|
|
}
|
|
return value !== undefined ? [value] : [];
|
|
}
|
|
var isClient = typeof window !== 'undefined' && window.document && window.document.documentElement;
|
|
|
|
/** Is client side and not jsdom */
|
|
var isBrowserClient = true && isClient;
|
|
function commonUtil_hasValue(value) {
|
|
return value !== undefined && value !== null;
|
|
}
|
|
|
|
/** combo mode no value judgment function */
|
|
function isComboNoValue(value) {
|
|
return !value && value !== 0;
|
|
}
|
|
function isTitleType(title) {
|
|
return ['string', 'number'].includes((0,esm_typeof/* default */.Z)(title));
|
|
}
|
|
function getTitle(item) {
|
|
var title = undefined;
|
|
if (item) {
|
|
if (isTitleType(item.title)) {
|
|
title = item.title.toString();
|
|
} else if (isTitleType(item.label)) {
|
|
title = item.label.toString();
|
|
}
|
|
}
|
|
return title;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useLayoutEffect.js
|
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
|
|
|
|
|
|
/**
|
|
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
*/
|
|
function hooks_useLayoutEffect_useLayoutEffect(effect, deps) {
|
|
// Never happen in test env
|
|
if (isBrowserClient) {
|
|
/* istanbul ignore next */
|
|
react.useLayoutEffect(effect, deps);
|
|
} else {
|
|
react.useEffect(effect, deps);
|
|
}
|
|
}
|
|
/* eslint-enable */
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/Selector/MultipleSelector.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function itemKey(value) {
|
|
var _value$key;
|
|
return (_value$key = value.key) !== null && _value$key !== void 0 ? _value$key : value.value;
|
|
}
|
|
var onPreventMouseDown = function onPreventMouseDown(event) {
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
};
|
|
var SelectSelector = function SelectSelector(props) {
|
|
var id = props.id,
|
|
prefixCls = props.prefixCls,
|
|
values = props.values,
|
|
open = props.open,
|
|
searchValue = props.searchValue,
|
|
autoClearSearchValue = props.autoClearSearchValue,
|
|
inputRef = props.inputRef,
|
|
placeholder = props.placeholder,
|
|
disabled = props.disabled,
|
|
mode = props.mode,
|
|
showSearch = props.showSearch,
|
|
autoFocus = props.autoFocus,
|
|
autoComplete = props.autoComplete,
|
|
activeDescendantId = props.activeDescendantId,
|
|
tabIndex = props.tabIndex,
|
|
removeIcon = props.removeIcon,
|
|
maxTagCount = props.maxTagCount,
|
|
maxTagTextLength = props.maxTagTextLength,
|
|
_props$maxTagPlacehol = props.maxTagPlaceholder,
|
|
maxTagPlaceholder = _props$maxTagPlacehol === void 0 ? function (omittedValues) {
|
|
return "+ ".concat(omittedValues.length, " ...");
|
|
} : _props$maxTagPlacehol,
|
|
tagRender = props.tagRender,
|
|
onToggleOpen = props.onToggleOpen,
|
|
onRemove = props.onRemove,
|
|
onInputChange = props.onInputChange,
|
|
onInputPaste = props.onInputPaste,
|
|
onInputKeyDown = props.onInputKeyDown,
|
|
onInputMouseDown = props.onInputMouseDown,
|
|
onInputCompositionStart = props.onInputCompositionStart,
|
|
onInputCompositionEnd = props.onInputCompositionEnd;
|
|
var measureRef = react.useRef(null);
|
|
var _useState = (0,react.useState)(0),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
inputWidth = _useState2[0],
|
|
setInputWidth = _useState2[1];
|
|
var _useState3 = (0,react.useState)(false),
|
|
_useState4 = (0,slicedToArray/* default */.Z)(_useState3, 2),
|
|
focused = _useState4[0],
|
|
setFocused = _useState4[1];
|
|
var selectionPrefixCls = "".concat(prefixCls, "-selection");
|
|
|
|
// ===================== Search ======================
|
|
var inputValue = open || mode === "multiple" && autoClearSearchValue === false || mode === 'tags' ? searchValue : '';
|
|
var inputEditable = mode === 'tags' || mode === "multiple" && autoClearSearchValue === false || showSearch && (open || focused);
|
|
|
|
// We measure width and set to the input immediately
|
|
hooks_useLayoutEffect_useLayoutEffect(function () {
|
|
setInputWidth(measureRef.current.scrollWidth);
|
|
}, [inputValue]);
|
|
|
|
// ===================== Render ======================
|
|
// >>> Render Selector Node. Includes Item & Rest
|
|
function defaultRenderSelector(item, content, itemDisabled, closable, onClose) {
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
className: classnames_default()("".concat(selectionPrefixCls, "-item"), (0,defineProperty/* default */.Z)({}, "".concat(selectionPrefixCls, "-item-disabled"), itemDisabled)),
|
|
title: getTitle(item)
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(selectionPrefixCls, "-item-content")
|
|
}, content), closable && /*#__PURE__*/react.createElement(es_TransBtn, {
|
|
className: "".concat(selectionPrefixCls, "-item-remove"),
|
|
onMouseDown: onPreventMouseDown,
|
|
onClick: onClose,
|
|
customizeIcon: removeIcon
|
|
}, "\xD7"));
|
|
}
|
|
function customizeRenderSelector(value, content, itemDisabled, closable, onClose) {
|
|
var onMouseDown = function onMouseDown(e) {
|
|
onPreventMouseDown(e);
|
|
onToggleOpen(!open);
|
|
};
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
onMouseDown: onMouseDown
|
|
}, tagRender({
|
|
label: content,
|
|
value: value,
|
|
disabled: itemDisabled,
|
|
closable: closable,
|
|
onClose: onClose
|
|
}));
|
|
}
|
|
function renderItem(valueItem) {
|
|
var itemDisabled = valueItem.disabled,
|
|
label = valueItem.label,
|
|
value = valueItem.value;
|
|
var closable = !disabled && !itemDisabled;
|
|
var displayLabel = label;
|
|
if (typeof maxTagTextLength === 'number') {
|
|
if (typeof label === 'string' || typeof label === 'number') {
|
|
var strLabel = String(displayLabel);
|
|
if (strLabel.length > maxTagTextLength) {
|
|
displayLabel = "".concat(strLabel.slice(0, maxTagTextLength), "...");
|
|
}
|
|
}
|
|
}
|
|
var onClose = function onClose(event) {
|
|
if (event) event.stopPropagation();
|
|
onRemove(valueItem);
|
|
};
|
|
return typeof tagRender === 'function' ? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose) : defaultRenderSelector(valueItem, displayLabel, itemDisabled, closable, onClose);
|
|
}
|
|
function renderRest(omittedValues) {
|
|
var content = typeof maxTagPlaceholder === 'function' ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder;
|
|
return defaultRenderSelector({
|
|
title: content
|
|
}, content, false);
|
|
}
|
|
|
|
// >>> Input Node
|
|
var inputNode = /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(selectionPrefixCls, "-search"),
|
|
style: {
|
|
width: inputWidth
|
|
},
|
|
onFocus: function onFocus() {
|
|
setFocused(true);
|
|
},
|
|
onBlur: function onBlur() {
|
|
setFocused(false);
|
|
}
|
|
}, /*#__PURE__*/react.createElement(Selector_Input, {
|
|
ref: inputRef,
|
|
open: open,
|
|
prefixCls: prefixCls,
|
|
id: id,
|
|
inputElement: null,
|
|
disabled: disabled,
|
|
autoFocus: autoFocus,
|
|
autoComplete: autoComplete,
|
|
editable: inputEditable,
|
|
activeDescendantId: activeDescendantId,
|
|
value: inputValue,
|
|
onKeyDown: onInputKeyDown,
|
|
onMouseDown: onInputMouseDown,
|
|
onChange: onInputChange,
|
|
onPaste: onInputPaste,
|
|
onCompositionStart: onInputCompositionStart,
|
|
onCompositionEnd: onInputCompositionEnd,
|
|
tabIndex: tabIndex,
|
|
attrs: pickAttrs(props, true)
|
|
}), /*#__PURE__*/react.createElement("span", {
|
|
ref: measureRef,
|
|
className: "".concat(selectionPrefixCls, "-search-mirror"),
|
|
"aria-hidden": true
|
|
}, inputValue, "\xA0"));
|
|
|
|
// >>> Selections
|
|
var selectionNode = /*#__PURE__*/react.createElement(rc_overflow_es, {
|
|
prefixCls: "".concat(selectionPrefixCls, "-overflow"),
|
|
data: values,
|
|
renderItem: renderItem,
|
|
renderRest: renderRest,
|
|
suffix: inputNode,
|
|
itemKey: itemKey,
|
|
maxCount: maxTagCount
|
|
});
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, selectionNode, !values.length && !inputValue && /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(selectionPrefixCls, "-placeholder")
|
|
}, placeholder));
|
|
};
|
|
/* harmony default export */ var MultipleSelector = (SelectSelector);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/Selector/SingleSelector.js
|
|
|
|
|
|
|
|
|
|
|
|
var SingleSelector = function SingleSelector(props) {
|
|
var inputElement = props.inputElement,
|
|
prefixCls = props.prefixCls,
|
|
id = props.id,
|
|
inputRef = props.inputRef,
|
|
disabled = props.disabled,
|
|
autoFocus = props.autoFocus,
|
|
autoComplete = props.autoComplete,
|
|
activeDescendantId = props.activeDescendantId,
|
|
mode = props.mode,
|
|
open = props.open,
|
|
values = props.values,
|
|
placeholder = props.placeholder,
|
|
tabIndex = props.tabIndex,
|
|
showSearch = props.showSearch,
|
|
searchValue = props.searchValue,
|
|
activeValue = props.activeValue,
|
|
maxLength = props.maxLength,
|
|
onInputKeyDown = props.onInputKeyDown,
|
|
onInputMouseDown = props.onInputMouseDown,
|
|
onInputChange = props.onInputChange,
|
|
onInputPaste = props.onInputPaste,
|
|
onInputCompositionStart = props.onInputCompositionStart,
|
|
onInputCompositionEnd = props.onInputCompositionEnd,
|
|
title = props.title;
|
|
var _React$useState = react.useState(false),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
inputChanged = _React$useState2[0],
|
|
setInputChanged = _React$useState2[1];
|
|
var combobox = mode === 'combobox';
|
|
var inputEditable = combobox || showSearch;
|
|
var item = values[0];
|
|
var inputValue = searchValue || '';
|
|
if (combobox && activeValue && !inputChanged) {
|
|
inputValue = activeValue;
|
|
}
|
|
react.useEffect(function () {
|
|
if (combobox) {
|
|
setInputChanged(false);
|
|
}
|
|
}, [combobox, activeValue]);
|
|
|
|
// Not show text when closed expect combobox mode
|
|
var hasTextInput = mode !== 'combobox' && !open && !showSearch ? false : !!inputValue;
|
|
|
|
// Get title of selection item
|
|
var selectionTitle = title === undefined ? getTitle(item) : title;
|
|
var renderPlaceholder = function renderPlaceholder() {
|
|
if (item) {
|
|
return null;
|
|
}
|
|
var hiddenStyle = hasTextInput ? {
|
|
visibility: 'hidden'
|
|
} : undefined;
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-selection-placeholder"),
|
|
style: hiddenStyle
|
|
}, placeholder);
|
|
};
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-selection-search")
|
|
}, /*#__PURE__*/react.createElement(Selector_Input, {
|
|
ref: inputRef,
|
|
prefixCls: prefixCls,
|
|
id: id,
|
|
open: open,
|
|
inputElement: inputElement,
|
|
disabled: disabled,
|
|
autoFocus: autoFocus,
|
|
autoComplete: autoComplete,
|
|
editable: inputEditable,
|
|
activeDescendantId: activeDescendantId,
|
|
value: inputValue,
|
|
onKeyDown: onInputKeyDown,
|
|
onMouseDown: onInputMouseDown,
|
|
onChange: function onChange(e) {
|
|
setInputChanged(true);
|
|
onInputChange(e);
|
|
},
|
|
onPaste: onInputPaste,
|
|
onCompositionStart: onInputCompositionStart,
|
|
onCompositionEnd: onInputCompositionEnd,
|
|
tabIndex: tabIndex,
|
|
attrs: pickAttrs(props, true),
|
|
maxLength: combobox ? maxLength : undefined
|
|
})), !combobox && item ? /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-selection-item"),
|
|
title: selectionTitle
|
|
// 当 Select 已经选中选项时,还需 selection 隐藏但留在原地占位
|
|
// https://github.com/ant-design/ant-design/issues/27688
|
|
// https://github.com/ant-design/ant-design/issues/41530
|
|
,
|
|
style: hasTextInput ? {
|
|
visibility: 'hidden'
|
|
} : undefined
|
|
}, item.label) : null, renderPlaceholder());
|
|
};
|
|
/* harmony default export */ var Selector_SingleSelector = (SingleSelector);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/utils/keyUtil.js
|
|
|
|
|
|
/** keyCode Judgment function */
|
|
function isValidateOpenKey(currentKeyCode) {
|
|
return ![
|
|
// System function button
|
|
es_KeyCode.ESC, es_KeyCode.SHIFT, es_KeyCode.BACKSPACE, es_KeyCode.TAB, es_KeyCode.WIN_KEY, es_KeyCode.ALT, es_KeyCode.META, es_KeyCode.WIN_KEY_RIGHT, es_KeyCode.CTRL, es_KeyCode.SEMICOLON, es_KeyCode.EQUALS, es_KeyCode.CAPS_LOCK, es_KeyCode.CONTEXT_MENU,
|
|
// F1-F12
|
|
es_KeyCode.F1, es_KeyCode.F2, es_KeyCode.F3, es_KeyCode.F4, es_KeyCode.F5, es_KeyCode.F6, es_KeyCode.F7, es_KeyCode.F8, es_KeyCode.F9, es_KeyCode.F10, es_KeyCode.F11, es_KeyCode.F12].includes(currentKeyCode);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/Selector/index.js
|
|
|
|
|
|
/**
|
|
* Cursor rule:
|
|
* 1. Only `showSearch` enabled
|
|
* 2. Only `open` is `true`
|
|
* 3. When typing, set `open` to `true` which hit rule of 2
|
|
*
|
|
* Accessibility:
|
|
* - https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Selector = function Selector(props, ref) {
|
|
var inputRef = (0,react.useRef)(null);
|
|
var compositionStatusRef = (0,react.useRef)(false);
|
|
var prefixCls = props.prefixCls,
|
|
open = props.open,
|
|
mode = props.mode,
|
|
showSearch = props.showSearch,
|
|
tokenWithEnter = props.tokenWithEnter,
|
|
autoClearSearchValue = props.autoClearSearchValue,
|
|
onSearch = props.onSearch,
|
|
onSearchSubmit = props.onSearchSubmit,
|
|
onToggleOpen = props.onToggleOpen,
|
|
onInputKeyDown = props.onInputKeyDown,
|
|
domRef = props.domRef;
|
|
|
|
// ======================= Ref =======================
|
|
react.useImperativeHandle(ref, function () {
|
|
return {
|
|
focus: function focus() {
|
|
inputRef.current.focus();
|
|
},
|
|
blur: function blur() {
|
|
inputRef.current.blur();
|
|
}
|
|
};
|
|
});
|
|
|
|
// ====================== Input ======================
|
|
var _useLock = useLock(0),
|
|
_useLock2 = (0,slicedToArray/* default */.Z)(_useLock, 2),
|
|
getInputMouseDown = _useLock2[0],
|
|
setInputMouseDown = _useLock2[1];
|
|
var onInternalInputKeyDown = function onInternalInputKeyDown(event) {
|
|
var which = event.which;
|
|
if (which === es_KeyCode.UP || which === es_KeyCode.DOWN) {
|
|
event.preventDefault();
|
|
}
|
|
if (onInputKeyDown) {
|
|
onInputKeyDown(event);
|
|
}
|
|
if (which === es_KeyCode.ENTER && mode === 'tags' && !compositionStatusRef.current && !open) {
|
|
// When menu isn't open, OptionList won't trigger a value change
|
|
// So when enter is pressed, the tag's input value should be emitted here to let selector know
|
|
onSearchSubmit === null || onSearchSubmit === void 0 ? void 0 : onSearchSubmit(event.target.value);
|
|
}
|
|
if (isValidateOpenKey(which)) {
|
|
onToggleOpen(true);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* We can not use `findDOMNode` sine it will get warning,
|
|
* have to use timer to check if is input element.
|
|
*/
|
|
var onInternalInputMouseDown = function onInternalInputMouseDown() {
|
|
setInputMouseDown(true);
|
|
};
|
|
|
|
// When paste come, ignore next onChange
|
|
var pastedTextRef = (0,react.useRef)(null);
|
|
var triggerOnSearch = function triggerOnSearch(value) {
|
|
if (onSearch(value, true, compositionStatusRef.current) !== false) {
|
|
onToggleOpen(true);
|
|
}
|
|
};
|
|
var onInputCompositionStart = function onInputCompositionStart() {
|
|
compositionStatusRef.current = true;
|
|
};
|
|
var onInputCompositionEnd = function onInputCompositionEnd(e) {
|
|
compositionStatusRef.current = false;
|
|
|
|
// Trigger search again to support `tokenSeparators` with typewriting
|
|
if (mode !== 'combobox') {
|
|
triggerOnSearch(e.target.value);
|
|
}
|
|
};
|
|
var onInputChange = function onInputChange(event) {
|
|
var value = event.target.value;
|
|
|
|
// Pasted text should replace back to origin content
|
|
if (tokenWithEnter && pastedTextRef.current && /[\r\n]/.test(pastedTextRef.current)) {
|
|
// CRLF will be treated as a single space for input element
|
|
var replacedText = pastedTextRef.current.replace(/[\r\n]+$/, '').replace(/\r\n/g, ' ').replace(/[\r\n]/g, ' ');
|
|
value = value.replace(replacedText, pastedTextRef.current);
|
|
}
|
|
pastedTextRef.current = null;
|
|
triggerOnSearch(value);
|
|
};
|
|
var onInputPaste = function onInputPaste(e) {
|
|
var clipboardData = e.clipboardData;
|
|
var value = clipboardData.getData('text');
|
|
pastedTextRef.current = value;
|
|
};
|
|
var onClick = function onClick(_ref) {
|
|
var target = _ref.target;
|
|
if (target !== inputRef.current) {
|
|
// Should focus input if click the selector
|
|
var isIE = document.body.style.msTouchAction !== undefined;
|
|
if (isIE) {
|
|
setTimeout(function () {
|
|
inputRef.current.focus();
|
|
});
|
|
} else {
|
|
inputRef.current.focus();
|
|
}
|
|
}
|
|
};
|
|
var onMouseDown = function onMouseDown(event) {
|
|
var inputMouseDown = getInputMouseDown();
|
|
|
|
// when mode is combobox, don't prevent default behavior
|
|
// https://github.com/ant-design/ant-design/issues/37320
|
|
if (event.target !== inputRef.current && !inputMouseDown && mode !== 'combobox') {
|
|
event.preventDefault();
|
|
}
|
|
if (mode !== 'combobox' && (!showSearch || !inputMouseDown) || !open) {
|
|
if (open && autoClearSearchValue !== false) {
|
|
onSearch('', true, false);
|
|
}
|
|
onToggleOpen();
|
|
}
|
|
};
|
|
|
|
// ================= Inner Selector ==================
|
|
var sharedProps = {
|
|
inputRef: inputRef,
|
|
onInputKeyDown: onInternalInputKeyDown,
|
|
onInputMouseDown: onInternalInputMouseDown,
|
|
onInputChange: onInputChange,
|
|
onInputPaste: onInputPaste,
|
|
onInputCompositionStart: onInputCompositionStart,
|
|
onInputCompositionEnd: onInputCompositionEnd
|
|
};
|
|
var selectNode = mode === 'multiple' || mode === 'tags' ? /*#__PURE__*/react.createElement(MultipleSelector, (0,esm_extends/* default */.Z)({}, props, sharedProps)) : /*#__PURE__*/react.createElement(Selector_SingleSelector, (0,esm_extends/* default */.Z)({}, props, sharedProps));
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
ref: domRef,
|
|
className: "".concat(prefixCls, "-selector"),
|
|
onClick: onClick,
|
|
onMouseDown: onMouseDown
|
|
}, selectNode);
|
|
};
|
|
var ForwardSelector = /*#__PURE__*/react.forwardRef(Selector);
|
|
ForwardSelector.displayName = 'Selector';
|
|
/* harmony default export */ var es_Selector = (ForwardSelector);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/portal/es/Context.js
|
|
|
|
var OrderContext = /*#__PURE__*/react.createContext(null);
|
|
/* harmony default export */ var Context = (OrderContext);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/portal/es/useDom.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var EMPTY_LIST = [];
|
|
|
|
/**
|
|
* Will add `div` to document. Nest call will keep order
|
|
* @param render Render DOM in document
|
|
*/
|
|
function useDom(render, debug) {
|
|
var _React$useState = react.useState(function () {
|
|
if (!canUseDom()) {
|
|
return null;
|
|
}
|
|
var defaultEle = document.createElement('div');
|
|
if (false) {}
|
|
return defaultEle;
|
|
}),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 1),
|
|
ele = _React$useState2[0];
|
|
|
|
// ========================== Order ==========================
|
|
var appendedRef = react.useRef(false);
|
|
var queueCreate = react.useContext(Context);
|
|
var _React$useState3 = react.useState(EMPTY_LIST),
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
queue = _React$useState4[0],
|
|
setQueue = _React$useState4[1];
|
|
var mergedQueueCreate = queueCreate || (appendedRef.current ? undefined : function (appendFn) {
|
|
setQueue(function (origin) {
|
|
var newQueue = [appendFn].concat((0,toConsumableArray/* default */.Z)(origin));
|
|
return newQueue;
|
|
});
|
|
});
|
|
|
|
// =========================== DOM ===========================
|
|
function append() {
|
|
if (!ele.parentElement) {
|
|
document.body.appendChild(ele);
|
|
}
|
|
appendedRef.current = true;
|
|
}
|
|
function cleanup() {
|
|
var _ele$parentElement;
|
|
(_ele$parentElement = ele.parentElement) === null || _ele$parentElement === void 0 ? void 0 : _ele$parentElement.removeChild(ele);
|
|
appendedRef.current = false;
|
|
}
|
|
hooks_useLayoutEffect(function () {
|
|
if (render) {
|
|
if (queueCreate) {
|
|
queueCreate(append);
|
|
} else {
|
|
append();
|
|
}
|
|
} else {
|
|
cleanup();
|
|
}
|
|
return cleanup;
|
|
}, [render]);
|
|
hooks_useLayoutEffect(function () {
|
|
if (queue.length) {
|
|
queue.forEach(function (appendFn) {
|
|
return appendFn();
|
|
});
|
|
setQueue(EMPTY_LIST);
|
|
}
|
|
}, [queue]);
|
|
return [ele, mergedQueueCreate];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/Dom/contains.js
|
|
function contains(root, n) {
|
|
if (!root) {
|
|
return false;
|
|
}
|
|
|
|
// Use native if support
|
|
if (root.contains) {
|
|
return root.contains(n);
|
|
}
|
|
|
|
// `document.contains` not support with IE11
|
|
var node = n;
|
|
while (node) {
|
|
if (node === root) {
|
|
return true;
|
|
}
|
|
node = node.parentNode;
|
|
}
|
|
return false;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/Dom/dynamicCSS.js
|
|
|
|
|
|
var APPEND_ORDER = 'data-rc-order';
|
|
var MARK_KEY = "rc-util-key";
|
|
var containerCache = new Map();
|
|
function getMark() {
|
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
mark = _ref.mark;
|
|
if (mark) {
|
|
return mark.startsWith('data-') ? mark : "data-".concat(mark);
|
|
}
|
|
return MARK_KEY;
|
|
}
|
|
function getContainer(option) {
|
|
if (option.attachTo) {
|
|
return option.attachTo;
|
|
}
|
|
var head = document.querySelector('head');
|
|
return head || document.body;
|
|
}
|
|
function getOrder(prepend) {
|
|
if (prepend === 'queue') {
|
|
return 'prependQueue';
|
|
}
|
|
return prepend ? 'prepend' : 'append';
|
|
}
|
|
|
|
/**
|
|
* Find style which inject by rc-util
|
|
*/
|
|
function findStyles(container) {
|
|
return Array.from((containerCache.get(container) || container).children).filter(function (node) {
|
|
return node.tagName === 'STYLE';
|
|
});
|
|
}
|
|
function injectCSS(css) {
|
|
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
if (!canUseDom()) {
|
|
return null;
|
|
}
|
|
var csp = option.csp,
|
|
prepend = option.prepend;
|
|
var styleNode = document.createElement('style');
|
|
styleNode.setAttribute(APPEND_ORDER, getOrder(prepend));
|
|
if (csp !== null && csp !== void 0 && csp.nonce) {
|
|
styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
|
|
}
|
|
styleNode.innerHTML = css;
|
|
var container = getContainer(option);
|
|
var firstChild = container.firstChild;
|
|
if (prepend) {
|
|
// If is queue `prepend`, it will prepend first style and then append rest style
|
|
if (prepend === 'queue') {
|
|
var existStyle = findStyles(container).filter(function (node) {
|
|
return ['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER));
|
|
});
|
|
if (existStyle.length) {
|
|
container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
|
|
return styleNode;
|
|
}
|
|
}
|
|
|
|
// Use `insertBefore` as `prepend`
|
|
container.insertBefore(styleNode, firstChild);
|
|
} else {
|
|
container.appendChild(styleNode);
|
|
}
|
|
return styleNode;
|
|
}
|
|
function findExistNode(key) {
|
|
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
var container = getContainer(option);
|
|
return findStyles(container).find(function (node) {
|
|
return node.getAttribute(getMark(option)) === key;
|
|
});
|
|
}
|
|
function removeCSS(key) {
|
|
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
var existNode = findExistNode(key, option);
|
|
if (existNode) {
|
|
var container = getContainer(option);
|
|
container.removeChild(existNode);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* qiankun will inject `appendChild` to insert into other
|
|
*/
|
|
function syncRealContainer(container, option) {
|
|
var cachedRealContainer = containerCache.get(container);
|
|
|
|
// Find real container when not cached or cached container removed
|
|
if (!cachedRealContainer || !contains(document, cachedRealContainer)) {
|
|
var placeholderStyle = injectCSS('', option);
|
|
var parentNode = placeholderStyle.parentNode;
|
|
containerCache.set(container, parentNode);
|
|
container.removeChild(placeholderStyle);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* manually clear container cache to avoid global cache in unit testes
|
|
*/
|
|
function clearContainerCache() {
|
|
containerCache.clear();
|
|
}
|
|
function updateCSS(css, key) {
|
|
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
var container = getContainer(option);
|
|
|
|
// Sync real parent
|
|
syncRealContainer(container, option);
|
|
var existNode = findExistNode(key, option);
|
|
if (existNode) {
|
|
var _option$csp, _option$csp2;
|
|
if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) {
|
|
var _option$csp3;
|
|
existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce;
|
|
}
|
|
if (existNode.innerHTML !== css) {
|
|
existNode.innerHTML = css;
|
|
}
|
|
return existNode;
|
|
}
|
|
var newNode = injectCSS(css, option);
|
|
newNode.setAttribute(getMark(option), key);
|
|
return newNode;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/getScrollBarSize.js
|
|
/* eslint-disable no-param-reassign */
|
|
|
|
var cached;
|
|
function getScrollBarSize(fresh) {
|
|
if (typeof document === 'undefined') {
|
|
return 0;
|
|
}
|
|
if (fresh || cached === undefined) {
|
|
var inner = document.createElement('div');
|
|
inner.style.width = '100%';
|
|
inner.style.height = '200px';
|
|
var outer = document.createElement('div');
|
|
var outerStyle = outer.style;
|
|
outerStyle.position = 'absolute';
|
|
outerStyle.top = '0';
|
|
outerStyle.left = '0';
|
|
outerStyle.pointerEvents = 'none';
|
|
outerStyle.visibility = 'hidden';
|
|
outerStyle.width = '200px';
|
|
outerStyle.height = '150px';
|
|
outerStyle.overflow = 'hidden';
|
|
outer.appendChild(inner);
|
|
document.body.appendChild(outer);
|
|
var widthContained = inner.offsetWidth;
|
|
outer.style.overflow = 'scroll';
|
|
var widthScroll = inner.offsetWidth;
|
|
if (widthContained === widthScroll) {
|
|
widthScroll = outer.clientWidth;
|
|
}
|
|
document.body.removeChild(outer);
|
|
cached = widthContained - widthScroll;
|
|
}
|
|
return cached;
|
|
}
|
|
function ensureSize(str) {
|
|
var match = str.match(/^(.*)px$/);
|
|
var value = Number(match === null || match === void 0 ? void 0 : match[1]);
|
|
return Number.isNaN(value) ? getScrollBarSize() : value;
|
|
}
|
|
function getTargetScrollBarSize(target) {
|
|
if (typeof document === 'undefined' || !target || !(target instanceof Element)) {
|
|
return {
|
|
width: 0,
|
|
height: 0
|
|
};
|
|
}
|
|
var _getComputedStyle = getComputedStyle(target, '::-webkit-scrollbar'),
|
|
width = _getComputedStyle.width,
|
|
height = _getComputedStyle.height;
|
|
return {
|
|
width: ensureSize(width),
|
|
height: ensureSize(height)
|
|
};
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/portal/es/util.js
|
|
/**
|
|
* Test usage export. Do not use in your production
|
|
*/
|
|
function isBodyOverflowing() {
|
|
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/portal/es/useScrollLocker.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var UNIQUE_ID = "rc-util-locker-".concat(Date.now());
|
|
var uuid = 0;
|
|
function useScrollLocker(lock) {
|
|
var mergedLock = !!lock;
|
|
var _React$useState = react.useState(function () {
|
|
uuid += 1;
|
|
return "".concat(UNIQUE_ID, "_").concat(uuid);
|
|
}),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 1),
|
|
id = _React$useState2[0];
|
|
hooks_useLayoutEffect(function () {
|
|
if (mergedLock) {
|
|
var scrollbarSize = getTargetScrollBarSize(document.body).width;
|
|
var isOverflow = isBodyOverflowing();
|
|
updateCSS("\nhtml body {\n overflow-y: hidden;\n ".concat(isOverflow ? "width: calc(100% - ".concat(scrollbarSize, "px);") : '', "\n}"), id);
|
|
} else {
|
|
removeCSS(id);
|
|
}
|
|
return function () {
|
|
removeCSS(id);
|
|
};
|
|
}, [mergedLock, id]);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/portal/es/mock.js
|
|
var inline = false;
|
|
function inlineMock(nextInline) {
|
|
if (typeof nextInline === 'boolean') {
|
|
inline = nextInline;
|
|
}
|
|
return inline;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/portal/es/Portal.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var getPortalContainer = function getPortalContainer(getContainer) {
|
|
if (getContainer === false) {
|
|
return false;
|
|
}
|
|
if (!canUseDom() || !getContainer) {
|
|
return null;
|
|
}
|
|
if (typeof getContainer === 'string') {
|
|
return document.querySelector(getContainer);
|
|
}
|
|
if (typeof getContainer === 'function') {
|
|
return getContainer();
|
|
}
|
|
return getContainer;
|
|
};
|
|
var Portal = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var open = props.open,
|
|
autoLock = props.autoLock,
|
|
getContainer = props.getContainer,
|
|
debug = props.debug,
|
|
_props$autoDestroy = props.autoDestroy,
|
|
autoDestroy = _props$autoDestroy === void 0 ? true : _props$autoDestroy,
|
|
children = props.children;
|
|
var _React$useState = react.useState(open),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
shouldRender = _React$useState2[0],
|
|
setShouldRender = _React$useState2[1];
|
|
var mergedRender = shouldRender || open;
|
|
|
|
// ========================= Warning =========================
|
|
if (false) {}
|
|
|
|
// ====================== Should Render ======================
|
|
react.useEffect(function () {
|
|
if (autoDestroy || open) {
|
|
setShouldRender(open);
|
|
}
|
|
}, [open, autoDestroy]);
|
|
|
|
// ======================== Container ========================
|
|
var _React$useState3 = react.useState(function () {
|
|
return getPortalContainer(getContainer);
|
|
}),
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
innerContainer = _React$useState4[0],
|
|
setInnerContainer = _React$useState4[1];
|
|
react.useEffect(function () {
|
|
var customizeContainer = getPortalContainer(getContainer);
|
|
|
|
// Tell component that we check this in effect which is safe to be `null`
|
|
setInnerContainer(customizeContainer !== null && customizeContainer !== void 0 ? customizeContainer : null);
|
|
});
|
|
var _useDom = useDom(mergedRender && !innerContainer, debug),
|
|
_useDom2 = (0,slicedToArray/* default */.Z)(_useDom, 2),
|
|
defaultContainer = _useDom2[0],
|
|
queueCreate = _useDom2[1];
|
|
var mergedContainer = innerContainer !== null && innerContainer !== void 0 ? innerContainer : defaultContainer;
|
|
|
|
// ========================= Locker ==========================
|
|
useScrollLocker(autoLock && open && canUseDom() && (mergedContainer === defaultContainer || mergedContainer === document.body));
|
|
|
|
// =========================== Ref ===========================
|
|
var childRef = null;
|
|
if (children && supportRef(children) && ref) {
|
|
var _ref = children;
|
|
childRef = _ref.ref;
|
|
}
|
|
var mergedRef = useComposeRef(childRef, ref);
|
|
|
|
// ========================= Render ==========================
|
|
// Do not render when nothing need render
|
|
// When innerContainer is `undefined`, it may not ready since user use ref in the same render
|
|
if (!mergedRender || !canUseDom() || innerContainer === undefined) {
|
|
return null;
|
|
}
|
|
|
|
// Render inline
|
|
var renderInline = mergedContainer === false || inlineMock();
|
|
var reffedChildren = children;
|
|
if (ref) {
|
|
reffedChildren = /*#__PURE__*/react.cloneElement(children, {
|
|
ref: mergedRef
|
|
});
|
|
}
|
|
return /*#__PURE__*/react.createElement(Context.Provider, {
|
|
value: queueCreate
|
|
}, renderInline ? reffedChildren : /*#__PURE__*/(0,react_dom.createPortal)(reffedChildren, mergedContainer));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var es_Portal = (Portal);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/portal/es/index.js
|
|
|
|
|
|
|
|
/* harmony default export */ var portal_es = (es_Portal);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/Dom/findDOMNode.js
|
|
|
|
|
|
function isDOM(node) {
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
// Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
|
|
return node instanceof HTMLElement || node instanceof SVGElement;
|
|
}
|
|
|
|
/**
|
|
* Return if a node is a DOM node. Else will return by `findDOMNode`
|
|
*/
|
|
function findDOMNode(node) {
|
|
if (isDOM(node)) {
|
|
return node;
|
|
}
|
|
if (node instanceof React.Component) {
|
|
return ReactDOM.findDOMNode(node);
|
|
}
|
|
return null;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/Dom/shadow.js
|
|
function getRoot(ele) {
|
|
var _ele$getRootNode;
|
|
return ele === null || ele === void 0 ? void 0 : (_ele$getRootNode = ele.getRootNode) === null || _ele$getRootNode === void 0 ? void 0 : _ele$getRootNode.call(ele);
|
|
}
|
|
|
|
/**
|
|
* Check if is in shadowRoot
|
|
*/
|
|
function inShadow(ele) {
|
|
return getRoot(ele) !== (ele === null || ele === void 0 ? void 0 : ele.ownerDocument);
|
|
}
|
|
|
|
/**
|
|
* Return shadowRoot if possible
|
|
*/
|
|
function getShadowRoot(ele) {
|
|
return inShadow(ele) ? getRoot(ele) : null;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useEvent.js
|
|
|
|
function es_hooks_useEvent_useEvent(callback) {
|
|
var fnRef = react.useRef();
|
|
fnRef.current = callback;
|
|
var memoFn = react.useCallback(function () {
|
|
var _fnRef$current;
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
}, []);
|
|
return memoFn;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useId.js
|
|
|
|
|
|
|
|
function getUseId() {
|
|
// We need fully clone React function here to avoid webpack warning React 17 do not export `useId`
|
|
var fullClone = (0,objectSpread2/* default */.Z)({}, react_namespaceObject);
|
|
return fullClone.useId;
|
|
}
|
|
var useId_uuid = 0;
|
|
|
|
/** @private Note only worked in develop env. Not work in production. */
|
|
function resetUuid() {
|
|
if (false) {}
|
|
}
|
|
function useId(id) {
|
|
// Inner id for accessibility usage. Only work in client side
|
|
var _React$useState = react.useState('ssr-id'),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
innerId = _React$useState2[0],
|
|
setInnerId = _React$useState2[1];
|
|
var useOriginId = getUseId();
|
|
var reactNativeId = useOriginId === null || useOriginId === void 0 ? void 0 : useOriginId();
|
|
react.useEffect(function () {
|
|
if (!useOriginId) {
|
|
var nextId = useId_uuid;
|
|
useId_uuid += 1;
|
|
setInnerId("rc_unique_".concat(nextId));
|
|
}
|
|
}, []);
|
|
|
|
// Developer passed id is single source of truth
|
|
if (id) {
|
|
return id;
|
|
}
|
|
|
|
// Test env always return mock id
|
|
if (false) {}
|
|
|
|
// Return react native id or inner id
|
|
return reactNativeId || innerId;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/Dom/canUseDom.js
|
|
function Dom_canUseDom_canUseDom() {
|
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
|
|
|
|
|
/**
|
|
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
*/
|
|
var useInternalLayoutEffect = true && Dom_canUseDom_canUseDom() ? react.useLayoutEffect : react.useEffect;
|
|
var es_hooks_useLayoutEffect_useLayoutEffect = function useLayoutEffect(callback, deps) {
|
|
var firstMountRef = react.useRef(true);
|
|
useInternalLayoutEffect(function () {
|
|
return callback(firstMountRef.current);
|
|
}, deps);
|
|
|
|
// We tell react that first mount has passed
|
|
useInternalLayoutEffect(function () {
|
|
firstMountRef.current = false;
|
|
return function () {
|
|
firstMountRef.current = true;
|
|
};
|
|
}, []);
|
|
};
|
|
var es_hooks_useLayoutEffect_useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
|
|
es_hooks_useLayoutEffect_useLayoutEffect(function (firstMount) {
|
|
if (!firstMount) {
|
|
return callback();
|
|
}
|
|
}, deps);
|
|
};
|
|
/* harmony default export */ var rc_util_es_hooks_useLayoutEffect = (es_hooks_useLayoutEffect_useLayoutEffect);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/isMobile.js
|
|
/* harmony default export */ var es_isMobile = (function () {
|
|
if (typeof navigator === 'undefined' || typeof window === 'undefined') {
|
|
return false;
|
|
}
|
|
var agent = navigator.userAgent || navigator.vendor || window.opera;
|
|
return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent === null || agent === void 0 ? void 0 : agent.substr(0, 4));
|
|
});
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/context.js
|
|
|
|
var TriggerContext = /*#__PURE__*/react.createContext(null);
|
|
/* harmony default export */ var es_context = (TriggerContext);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/hooks/useAction.js
|
|
|
|
function useAction_toArray(val) {
|
|
return val ? Array.isArray(val) ? val : [val] : [];
|
|
}
|
|
function useAction(mobile, action, showAction, hideAction) {
|
|
return react.useMemo(function () {
|
|
var mergedShowAction = useAction_toArray(showAction !== null && showAction !== void 0 ? showAction : action);
|
|
var mergedHideAction = useAction_toArray(hideAction !== null && hideAction !== void 0 ? hideAction : action);
|
|
var showActionSet = new Set(mergedShowAction);
|
|
var hideActionSet = new Set(mergedHideAction);
|
|
if (mobile) {
|
|
if (showActionSet.has('hover')) {
|
|
showActionSet.delete('hover');
|
|
showActionSet.add('click');
|
|
}
|
|
if (hideActionSet.has('hover')) {
|
|
hideActionSet.delete('hover');
|
|
hideActionSet.add('click');
|
|
}
|
|
}
|
|
return [showActionSet, hideActionSet];
|
|
}, [mobile, action, showAction, hideAction]);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/Dom/isVisible.js
|
|
/* harmony default export */ var isVisible = (function (element) {
|
|
if (!element) {
|
|
return false;
|
|
}
|
|
if (element instanceof Element) {
|
|
if (element.offsetParent) {
|
|
return true;
|
|
}
|
|
if (element.getBBox) {
|
|
var _getBBox = element.getBBox(),
|
|
width = _getBBox.width,
|
|
height = _getBBox.height;
|
|
if (width || height) {
|
|
return true;
|
|
}
|
|
}
|
|
if (element.getBoundingClientRect) {
|
|
var _element$getBoundingC = element.getBoundingClientRect(),
|
|
_width = _element$getBoundingC.width,
|
|
_height = _element$getBoundingC.height;
|
|
if (_width || _height) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
});
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/util.js
|
|
|
|
function isPointsEq() {
|
|
var a1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
var a2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
var isAlignPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
if (isAlignPoint) {
|
|
return a1[0] === a2[0];
|
|
}
|
|
return a1[0] === a2[0] && a1[1] === a2[1];
|
|
}
|
|
function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
|
|
var points = align.points;
|
|
var placements = Object.keys(builtinPlacements);
|
|
for (var i = 0; i < placements.length; i += 1) {
|
|
var _builtinPlacements$pl;
|
|
var placement = placements[i];
|
|
if (isPointsEq((_builtinPlacements$pl = builtinPlacements[placement]) === null || _builtinPlacements$pl === void 0 ? void 0 : _builtinPlacements$pl.points, points, isAlignPoint)) {
|
|
return "".concat(prefixCls, "-placement-").concat(placement);
|
|
}
|
|
}
|
|
return '';
|
|
}
|
|
|
|
/** @deprecated We should not use this if we can refactor all deps */
|
|
function getMotion(prefixCls, motion, animation, transitionName) {
|
|
if (motion) {
|
|
return motion;
|
|
}
|
|
if (animation) {
|
|
return {
|
|
motionName: "".concat(prefixCls, "-").concat(animation)
|
|
};
|
|
}
|
|
if (transitionName) {
|
|
return {
|
|
motionName: transitionName
|
|
};
|
|
}
|
|
return null;
|
|
}
|
|
function getWin(ele) {
|
|
return ele.ownerDocument.defaultView;
|
|
}
|
|
|
|
/**
|
|
* Get all the scrollable parent elements of the element
|
|
* @param ele The element to be detected
|
|
* @param areaOnly Only return the parent which will cut visible area
|
|
*/
|
|
function collectScroller(ele) {
|
|
var scrollerList = [];
|
|
var current = ele === null || ele === void 0 ? void 0 : ele.parentElement;
|
|
var scrollStyle = ['hidden', 'scroll', 'clip', 'auto'];
|
|
while (current) {
|
|
var _getWin$getComputedSt = getWin(current).getComputedStyle(current),
|
|
overflowX = _getWin$getComputedSt.overflowX,
|
|
overflowY = _getWin$getComputedSt.overflowY,
|
|
overflow = _getWin$getComputedSt.overflow;
|
|
if ([overflowX, overflowY, overflow].some(function (o) {
|
|
return scrollStyle.includes(o);
|
|
})) {
|
|
scrollerList.push(current);
|
|
}
|
|
current = current.parentElement;
|
|
}
|
|
return scrollerList;
|
|
}
|
|
function toNum(num) {
|
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
return Number.isNaN(num) ? defaultValue : num;
|
|
}
|
|
function getPxValue(val) {
|
|
return toNum(parseFloat(val), 0);
|
|
}
|
|
/**
|
|
*
|
|
*
|
|
* **************************************
|
|
* * Border *
|
|
* * ************************** *
|
|
* * * * * *
|
|
* * B * * S * B *
|
|
* * o * * c * o *
|
|
* * r * Content * r * r *
|
|
* * d * * o * d *
|
|
* * e * * l * e *
|
|
* * r ******************** l * r *
|
|
* * * Scroll * *
|
|
* * ************************** *
|
|
* * Border *
|
|
* **************************************
|
|
*
|
|
*/
|
|
/**
|
|
* Get visible area of element
|
|
*/
|
|
function getVisibleArea(initArea, scrollerList) {
|
|
var visibleArea = (0,objectSpread2/* default */.Z)({}, initArea);
|
|
(scrollerList || []).forEach(function (ele) {
|
|
if (ele instanceof HTMLBodyElement) {
|
|
return;
|
|
}
|
|
|
|
// Skip if static position which will not affect visible area
|
|
var _getWin$getComputedSt2 = getWin(ele).getComputedStyle(ele),
|
|
overflow = _getWin$getComputedSt2.overflow,
|
|
overflowClipMargin = _getWin$getComputedSt2.overflowClipMargin,
|
|
borderTopWidth = _getWin$getComputedSt2.borderTopWidth,
|
|
borderBottomWidth = _getWin$getComputedSt2.borderBottomWidth,
|
|
borderLeftWidth = _getWin$getComputedSt2.borderLeftWidth,
|
|
borderRightWidth = _getWin$getComputedSt2.borderRightWidth;
|
|
var eleRect = ele.getBoundingClientRect();
|
|
var eleOutHeight = ele.offsetHeight,
|
|
eleInnerHeight = ele.clientHeight,
|
|
eleOutWidth = ele.offsetWidth,
|
|
eleInnerWidth = ele.clientWidth;
|
|
var borderTopNum = getPxValue(borderTopWidth);
|
|
var borderBottomNum = getPxValue(borderBottomWidth);
|
|
var borderLeftNum = getPxValue(borderLeftWidth);
|
|
var borderRightNum = getPxValue(borderRightWidth);
|
|
var scaleX = toNum(Math.round(eleRect.width / eleOutWidth * 1000) / 1000);
|
|
var scaleY = toNum(Math.round(eleRect.height / eleOutHeight * 1000) / 1000);
|
|
|
|
// Original visible area
|
|
var eleScrollWidth = (eleOutWidth - eleInnerWidth - borderLeftNum - borderRightNum) * scaleX;
|
|
var eleScrollHeight = (eleOutHeight - eleInnerHeight - borderTopNum - borderBottomNum) * scaleY;
|
|
|
|
// Cut border size
|
|
var scaledBorderTopWidth = borderTopNum * scaleY;
|
|
var scaledBorderBottomWidth = borderBottomNum * scaleY;
|
|
var scaledBorderLeftWidth = borderLeftNum * scaleX;
|
|
var scaledBorderRightWidth = borderRightNum * scaleX;
|
|
|
|
// Clip margin
|
|
var clipMarginWidth = 0;
|
|
var clipMarginHeight = 0;
|
|
if (overflow === 'clip') {
|
|
var clipNum = getPxValue(overflowClipMargin);
|
|
clipMarginWidth = clipNum * scaleX;
|
|
clipMarginHeight = clipNum * scaleY;
|
|
}
|
|
|
|
// Region
|
|
var eleLeft = eleRect.x + scaledBorderLeftWidth - clipMarginWidth;
|
|
var eleTop = eleRect.y + scaledBorderTopWidth - clipMarginHeight;
|
|
var eleRight = eleLeft + eleRect.width + 2 * clipMarginWidth - scaledBorderLeftWidth - scaledBorderRightWidth - eleScrollWidth;
|
|
var eleBottom = eleTop + eleRect.height + 2 * clipMarginHeight - scaledBorderTopWidth - scaledBorderBottomWidth - eleScrollHeight;
|
|
visibleArea.left = Math.max(visibleArea.left, eleLeft);
|
|
visibleArea.top = Math.max(visibleArea.top, eleTop);
|
|
visibleArea.right = Math.min(visibleArea.right, eleRight);
|
|
visibleArea.bottom = Math.min(visibleArea.bottom, eleBottom);
|
|
});
|
|
return visibleArea;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/hooks/useAlign.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getUnitOffset(size) {
|
|
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
var offsetStr = "".concat(offset);
|
|
var cells = offsetStr.match(/^(.*)\%$/);
|
|
if (cells) {
|
|
return size * (parseFloat(cells[1]) / 100);
|
|
}
|
|
return parseFloat(offsetStr);
|
|
}
|
|
function getNumberOffset(rect, offset) {
|
|
var _ref = offset || [],
|
|
_ref2 = (0,slicedToArray/* default */.Z)(_ref, 2),
|
|
offsetX = _ref2[0],
|
|
offsetY = _ref2[1];
|
|
return [getUnitOffset(rect.width, offsetX), getUnitOffset(rect.height, offsetY)];
|
|
}
|
|
function splitPoints() {
|
|
var points = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
return [points[0], points[1]];
|
|
}
|
|
function getAlignPoint(rect, points) {
|
|
var topBottom = points[0];
|
|
var leftRight = points[1];
|
|
var x;
|
|
var y;
|
|
|
|
// Top & Bottom
|
|
if (topBottom === 't') {
|
|
y = rect.y;
|
|
} else if (topBottom === 'b') {
|
|
y = rect.y + rect.height;
|
|
} else {
|
|
y = rect.y + rect.height / 2;
|
|
}
|
|
|
|
// Left & Right
|
|
if (leftRight === 'l') {
|
|
x = rect.x;
|
|
} else if (leftRight === 'r') {
|
|
x = rect.x + rect.width;
|
|
} else {
|
|
x = rect.x + rect.width / 2;
|
|
}
|
|
return {
|
|
x: x,
|
|
y: y
|
|
};
|
|
}
|
|
function reversePoints(points, index) {
|
|
var reverseMap = {
|
|
t: 'b',
|
|
b: 't',
|
|
l: 'r',
|
|
r: 'l'
|
|
};
|
|
return points.map(function (point, i) {
|
|
if (i === index) {
|
|
return reverseMap[point] || 'c';
|
|
}
|
|
return point;
|
|
}).join('');
|
|
}
|
|
function useAlign(open, popupEle, target, placement, builtinPlacements, popupAlign, onPopupAlign) {
|
|
var _React$useState = react.useState({
|
|
ready: false,
|
|
offsetX: 0,
|
|
offsetY: 0,
|
|
offsetR: 0,
|
|
offsetB: 0,
|
|
arrowX: 0,
|
|
arrowY: 0,
|
|
scaleX: 1,
|
|
scaleY: 1,
|
|
align: builtinPlacements[placement] || {}
|
|
}),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
offsetInfo = _React$useState2[0],
|
|
setOffsetInfo = _React$useState2[1];
|
|
var alignCountRef = react.useRef(0);
|
|
var scrollerList = react.useMemo(function () {
|
|
if (!popupEle) {
|
|
return [];
|
|
}
|
|
return collectScroller(popupEle);
|
|
}, [popupEle]);
|
|
|
|
// ========================= Flip ==========================
|
|
// We will memo flip info.
|
|
// If size change to make flip, it will memo the flip info and use it in next align.
|
|
var prevFlipRef = react.useRef({});
|
|
var resetFlipCache = function resetFlipCache() {
|
|
prevFlipRef.current = {};
|
|
};
|
|
if (!open) {
|
|
resetFlipCache();
|
|
}
|
|
|
|
// ========================= Align =========================
|
|
var onAlign = es_hooks_useEvent_useEvent(function () {
|
|
if (popupEle && target && open) {
|
|
var popupElement = popupEle;
|
|
var originLeft = popupElement.style.left;
|
|
var originTop = popupElement.style.top;
|
|
var originRight = popupElement.style.right;
|
|
var originBottom = popupElement.style.bottom;
|
|
var doc = popupElement.ownerDocument;
|
|
var win = getWin(popupElement);
|
|
|
|
// Placement
|
|
var placementInfo = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, builtinPlacements[placement]), popupAlign);
|
|
|
|
// Reset first
|
|
popupElement.style.left = '0';
|
|
popupElement.style.top = '0';
|
|
popupElement.style.right = 'auto';
|
|
popupElement.style.bottom = 'auto';
|
|
|
|
// Calculate align style, we should consider `transform` case
|
|
var targetRect;
|
|
if (Array.isArray(target)) {
|
|
targetRect = {
|
|
x: target[0],
|
|
y: target[1],
|
|
width: 0,
|
|
height: 0
|
|
};
|
|
} else {
|
|
var rect = target.getBoundingClientRect();
|
|
targetRect = {
|
|
x: rect.x,
|
|
y: rect.y,
|
|
width: rect.width,
|
|
height: rect.height
|
|
};
|
|
}
|
|
var popupRect = popupElement.getBoundingClientRect();
|
|
var _win$getComputedStyle = win.getComputedStyle(popupElement),
|
|
width = _win$getComputedStyle.width,
|
|
height = _win$getComputedStyle.height;
|
|
var _doc$documentElement = doc.documentElement,
|
|
clientWidth = _doc$documentElement.clientWidth,
|
|
clientHeight = _doc$documentElement.clientHeight,
|
|
scrollWidth = _doc$documentElement.scrollWidth,
|
|
scrollHeight = _doc$documentElement.scrollHeight,
|
|
scrollTop = _doc$documentElement.scrollTop,
|
|
scrollLeft = _doc$documentElement.scrollLeft;
|
|
var popupHeight = popupRect.height;
|
|
var popupWidth = popupRect.width;
|
|
var targetHeight = targetRect.height;
|
|
var targetWidth = targetRect.width;
|
|
|
|
// Get bounding of visible area
|
|
var visibleRegion = {
|
|
left: 0,
|
|
top: 0,
|
|
right: clientWidth,
|
|
bottom: clientHeight
|
|
};
|
|
var scrollRegion = {
|
|
left: -scrollLeft,
|
|
top: -scrollTop,
|
|
right: scrollWidth - scrollLeft,
|
|
bottom: scrollHeight - scrollTop
|
|
};
|
|
var htmlRegion = placementInfo.htmlRegion;
|
|
var VISIBLE = 'visible';
|
|
var VISIBLE_FIRST = 'visibleFirst';
|
|
if (htmlRegion !== 'scroll' && htmlRegion !== VISIBLE_FIRST) {
|
|
htmlRegion = VISIBLE;
|
|
}
|
|
var isVisibleFirst = htmlRegion === VISIBLE_FIRST;
|
|
var scrollRegionArea = getVisibleArea(scrollRegion, scrollerList);
|
|
var visibleRegionArea = getVisibleArea(visibleRegion, scrollerList);
|
|
var visibleArea = htmlRegion === VISIBLE ? visibleRegionArea : scrollRegionArea;
|
|
|
|
// When set to `visibleFirst`,
|
|
// the check `adjust` logic will use `visibleRegion` for check first.
|
|
var adjustCheckVisibleArea = isVisibleFirst ? visibleRegionArea : visibleArea;
|
|
|
|
// Record right & bottom align data
|
|
popupElement.style.left = 'auto';
|
|
popupElement.style.top = 'auto';
|
|
popupElement.style.right = '0';
|
|
popupElement.style.bottom = '0';
|
|
var popupMirrorRect = popupElement.getBoundingClientRect();
|
|
|
|
// Reset back
|
|
popupElement.style.left = originLeft;
|
|
popupElement.style.top = originTop;
|
|
popupElement.style.right = originRight;
|
|
popupElement.style.bottom = originBottom;
|
|
|
|
// Calculate scale
|
|
var _scaleX = toNum(Math.round(popupWidth / parseFloat(width) * 1000) / 1000);
|
|
var _scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1000) / 1000);
|
|
|
|
// No need to align since it's not visible in view
|
|
if (_scaleX === 0 || _scaleY === 0 || isDOM(target) && !isVisible(target)) {
|
|
return;
|
|
}
|
|
|
|
// Offset
|
|
var offset = placementInfo.offset,
|
|
targetOffset = placementInfo.targetOffset;
|
|
var _getNumberOffset = getNumberOffset(popupRect, offset),
|
|
_getNumberOffset2 = (0,slicedToArray/* default */.Z)(_getNumberOffset, 2),
|
|
popupOffsetX = _getNumberOffset2[0],
|
|
popupOffsetY = _getNumberOffset2[1];
|
|
var _getNumberOffset3 = getNumberOffset(targetRect, targetOffset),
|
|
_getNumberOffset4 = (0,slicedToArray/* default */.Z)(_getNumberOffset3, 2),
|
|
targetOffsetX = _getNumberOffset4[0],
|
|
targetOffsetY = _getNumberOffset4[1];
|
|
targetRect.x -= targetOffsetX;
|
|
targetRect.y -= targetOffsetY;
|
|
|
|
// Points
|
|
var _ref3 = placementInfo.points || [],
|
|
_ref4 = (0,slicedToArray/* default */.Z)(_ref3, 2),
|
|
popupPoint = _ref4[0],
|
|
targetPoint = _ref4[1];
|
|
var targetPoints = splitPoints(targetPoint);
|
|
var popupPoints = splitPoints(popupPoint);
|
|
var targetAlignPoint = getAlignPoint(targetRect, targetPoints);
|
|
var popupAlignPoint = getAlignPoint(popupRect, popupPoints);
|
|
|
|
// Real align info may not same as origin one
|
|
var nextAlignInfo = (0,objectSpread2/* default */.Z)({}, placementInfo);
|
|
|
|
// Next Offset
|
|
var nextOffsetX = targetAlignPoint.x - popupAlignPoint.x + popupOffsetX;
|
|
var nextOffsetY = targetAlignPoint.y - popupAlignPoint.y + popupOffsetY;
|
|
|
|
// ============== Intersection ===============
|
|
// Get area by position. Used for check if flip area is better
|
|
function getIntersectionVisibleArea(offsetX, offsetY) {
|
|
var area = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : visibleArea;
|
|
var l = popupRect.x + offsetX;
|
|
var t = popupRect.y + offsetY;
|
|
var r = l + popupWidth;
|
|
var b = t + popupHeight;
|
|
var visibleL = Math.max(l, area.left);
|
|
var visibleT = Math.max(t, area.top);
|
|
var visibleR = Math.min(r, area.right);
|
|
var visibleB = Math.min(b, area.bottom);
|
|
return Math.max(0, (visibleR - visibleL) * (visibleB - visibleT));
|
|
}
|
|
var originIntersectionVisibleArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY);
|
|
|
|
// As `visibleFirst`, we prepare this for check
|
|
var originIntersectionRecommendArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY, visibleRegionArea);
|
|
|
|
// ========================== Overflow ===========================
|
|
var targetAlignPointTL = getAlignPoint(targetRect, ['t', 'l']);
|
|
var popupAlignPointTL = getAlignPoint(popupRect, ['t', 'l']);
|
|
var targetAlignPointBR = getAlignPoint(targetRect, ['b', 'r']);
|
|
var popupAlignPointBR = getAlignPoint(popupRect, ['b', 'r']);
|
|
var overflow = placementInfo.overflow || {};
|
|
var adjustX = overflow.adjustX,
|
|
adjustY = overflow.adjustY,
|
|
shiftX = overflow.shiftX,
|
|
shiftY = overflow.shiftY;
|
|
var supportAdjust = function supportAdjust(val) {
|
|
if (typeof val === 'boolean') {
|
|
return val;
|
|
}
|
|
return val >= 0;
|
|
};
|
|
|
|
// Prepare position
|
|
var nextPopupY;
|
|
var nextPopupBottom;
|
|
var nextPopupX;
|
|
var nextPopupRight;
|
|
function syncNextPopupPosition() {
|
|
nextPopupY = popupRect.y + nextOffsetY;
|
|
nextPopupBottom = nextPopupY + popupHeight;
|
|
nextPopupX = popupRect.x + nextOffsetX;
|
|
nextPopupRight = nextPopupX + popupWidth;
|
|
}
|
|
syncNextPopupPosition();
|
|
|
|
// >>>>>>>>>> Top & Bottom
|
|
var needAdjustY = supportAdjust(adjustY);
|
|
var sameTB = popupPoints[0] === targetPoints[0];
|
|
|
|
// Bottom to Top
|
|
if (needAdjustY && popupPoints[0] === 't' && (nextPopupBottom > adjustCheckVisibleArea.bottom || prevFlipRef.current.bt)) {
|
|
var tmpNextOffsetY = nextOffsetY;
|
|
if (sameTB) {
|
|
tmpNextOffsetY -= popupHeight - targetHeight;
|
|
} else {
|
|
tmpNextOffsetY = targetAlignPointTL.y - popupAlignPointBR.y - popupOffsetY;
|
|
}
|
|
var newVisibleArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY);
|
|
var newVisibleRecommendArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY, visibleRegionArea);
|
|
if (
|
|
// Of course use larger one
|
|
newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst ||
|
|
// Choose recommend one
|
|
newVisibleRecommendArea >= originIntersectionRecommendArea)) {
|
|
prevFlipRef.current.bt = true;
|
|
nextOffsetY = tmpNextOffsetY;
|
|
nextAlignInfo.points = [reversePoints(popupPoints, 0), reversePoints(targetPoints, 0)];
|
|
} else {
|
|
prevFlipRef.current.bt = false;
|
|
}
|
|
}
|
|
|
|
// Top to Bottom
|
|
if (needAdjustY && popupPoints[0] === 'b' && (nextPopupY < adjustCheckVisibleArea.top || prevFlipRef.current.tb)) {
|
|
var _tmpNextOffsetY = nextOffsetY;
|
|
if (sameTB) {
|
|
_tmpNextOffsetY += popupHeight - targetHeight;
|
|
} else {
|
|
_tmpNextOffsetY = targetAlignPointBR.y - popupAlignPointTL.y - popupOffsetY;
|
|
}
|
|
var _newVisibleArea = getIntersectionVisibleArea(nextOffsetX, _tmpNextOffsetY);
|
|
var _newVisibleRecommendArea = getIntersectionVisibleArea(nextOffsetX, _tmpNextOffsetY, visibleRegionArea);
|
|
if (
|
|
// Of course use larger one
|
|
_newVisibleArea > originIntersectionVisibleArea || _newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst ||
|
|
// Choose recommend one
|
|
_newVisibleRecommendArea >= originIntersectionRecommendArea)) {
|
|
prevFlipRef.current.tb = true;
|
|
nextOffsetY = _tmpNextOffsetY;
|
|
nextAlignInfo.points = [reversePoints(popupPoints, 0), reversePoints(targetPoints, 0)];
|
|
} else {
|
|
prevFlipRef.current.tb = false;
|
|
}
|
|
}
|
|
|
|
// >>>>>>>>>> Left & Right
|
|
var needAdjustX = supportAdjust(adjustX);
|
|
|
|
// >>>>> Flip
|
|
var sameLR = popupPoints[1] === targetPoints[1];
|
|
|
|
// Right to Left
|
|
if (needAdjustX && popupPoints[1] === 'l' && (nextPopupRight > adjustCheckVisibleArea.right || prevFlipRef.current.rl)) {
|
|
var tmpNextOffsetX = nextOffsetX;
|
|
if (sameLR) {
|
|
tmpNextOffsetX -= popupWidth - targetWidth;
|
|
} else {
|
|
tmpNextOffsetX = targetAlignPointTL.x - popupAlignPointBR.x - popupOffsetX;
|
|
}
|
|
var _newVisibleArea2 = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY);
|
|
var _newVisibleRecommendArea2 = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY, visibleRegionArea);
|
|
if (
|
|
// Of course use larger one
|
|
_newVisibleArea2 > originIntersectionVisibleArea || _newVisibleArea2 === originIntersectionVisibleArea && (!isVisibleFirst ||
|
|
// Choose recommend one
|
|
_newVisibleRecommendArea2 >= originIntersectionRecommendArea)) {
|
|
prevFlipRef.current.rl = true;
|
|
nextOffsetX = tmpNextOffsetX;
|
|
nextAlignInfo.points = [reversePoints(popupPoints, 1), reversePoints(targetPoints, 1)];
|
|
} else {
|
|
prevFlipRef.current.rl = false;
|
|
}
|
|
}
|
|
|
|
// Left to Right
|
|
if (needAdjustX && popupPoints[1] === 'r' && (nextPopupX < adjustCheckVisibleArea.left || prevFlipRef.current.lr)) {
|
|
var _tmpNextOffsetX = nextOffsetX;
|
|
if (sameLR) {
|
|
_tmpNextOffsetX += popupWidth - targetWidth;
|
|
} else {
|
|
_tmpNextOffsetX = targetAlignPointBR.x - popupAlignPointTL.x - popupOffsetX;
|
|
}
|
|
var _newVisibleArea3 = getIntersectionVisibleArea(_tmpNextOffsetX, nextOffsetY);
|
|
var _newVisibleRecommendArea3 = getIntersectionVisibleArea(_tmpNextOffsetX, nextOffsetY, visibleRegionArea);
|
|
if (
|
|
// Of course use larger one
|
|
_newVisibleArea3 > originIntersectionVisibleArea || _newVisibleArea3 === originIntersectionVisibleArea && (!isVisibleFirst ||
|
|
// Choose recommend one
|
|
_newVisibleRecommendArea3 >= originIntersectionRecommendArea)) {
|
|
prevFlipRef.current.lr = true;
|
|
nextOffsetX = _tmpNextOffsetX;
|
|
nextAlignInfo.points = [reversePoints(popupPoints, 1), reversePoints(targetPoints, 1)];
|
|
} else {
|
|
prevFlipRef.current.lr = false;
|
|
}
|
|
}
|
|
|
|
// ============================ Shift ============================
|
|
syncNextPopupPosition();
|
|
var numShiftX = shiftX === true ? 0 : shiftX;
|
|
if (typeof numShiftX === 'number') {
|
|
// Left
|
|
if (nextPopupX < visibleRegionArea.left) {
|
|
nextOffsetX -= nextPopupX - visibleRegionArea.left;
|
|
if (targetRect.x + targetWidth < visibleRegionArea.left + numShiftX) {
|
|
nextOffsetX += targetRect.x - visibleRegionArea.left + targetWidth - numShiftX;
|
|
}
|
|
}
|
|
|
|
// Right
|
|
if (nextPopupRight > visibleRegionArea.right) {
|
|
nextOffsetX -= nextPopupRight - visibleRegionArea.right;
|
|
if (targetRect.x > visibleRegionArea.right - numShiftX) {
|
|
nextOffsetX += targetRect.x - visibleRegionArea.right + numShiftX;
|
|
}
|
|
}
|
|
}
|
|
var numShiftY = shiftY === true ? 0 : shiftY;
|
|
if (typeof numShiftY === 'number') {
|
|
// Top
|
|
if (nextPopupY < visibleRegionArea.top) {
|
|
nextOffsetY -= nextPopupY - visibleRegionArea.top;
|
|
if (targetRect.y + targetHeight < visibleRegionArea.top + numShiftY) {
|
|
nextOffsetY += targetRect.y - visibleRegionArea.top + targetHeight - numShiftY;
|
|
}
|
|
}
|
|
|
|
// Bottom
|
|
if (nextPopupBottom > visibleRegionArea.bottom) {
|
|
nextOffsetY -= nextPopupBottom - visibleRegionArea.bottom;
|
|
if (targetRect.y > visibleRegionArea.bottom - numShiftY) {
|
|
nextOffsetY += targetRect.y - visibleRegionArea.bottom + numShiftY;
|
|
}
|
|
}
|
|
}
|
|
|
|
// ============================ Arrow ============================
|
|
// Arrow center align
|
|
var popupLeft = popupRect.x + nextOffsetX;
|
|
var popupRight = popupLeft + popupWidth;
|
|
var popupTop = popupRect.y + nextOffsetY;
|
|
var popupBottom = popupTop + popupHeight;
|
|
var targetLeft = targetRect.x;
|
|
var targetRight = targetLeft + targetWidth;
|
|
var targetTop = targetRect.y;
|
|
var targetBottom = targetTop + targetHeight;
|
|
var maxLeft = Math.max(popupLeft, targetLeft);
|
|
var minRight = Math.min(popupRight, targetRight);
|
|
var xCenter = (maxLeft + minRight) / 2;
|
|
var nextArrowX = xCenter - popupLeft;
|
|
var maxTop = Math.max(popupTop, targetTop);
|
|
var minBottom = Math.min(popupBottom, targetBottom);
|
|
var yCenter = (maxTop + minBottom) / 2;
|
|
var nextArrowY = yCenter - popupTop;
|
|
onPopupAlign === null || onPopupAlign === void 0 ? void 0 : onPopupAlign(popupEle, nextAlignInfo);
|
|
|
|
// Additional calculate right & bottom position
|
|
var offsetX4Right = popupMirrorRect.right - popupRect.x - (nextOffsetX + popupRect.width);
|
|
var offsetY4Bottom = popupMirrorRect.bottom - popupRect.y - (nextOffsetY + popupRect.height);
|
|
setOffsetInfo({
|
|
ready: true,
|
|
offsetX: nextOffsetX / _scaleX,
|
|
offsetY: nextOffsetY / _scaleY,
|
|
offsetR: offsetX4Right / _scaleX,
|
|
offsetB: offsetY4Bottom / _scaleY,
|
|
arrowX: nextArrowX / _scaleX,
|
|
arrowY: nextArrowY / _scaleY,
|
|
scaleX: _scaleX,
|
|
scaleY: _scaleY,
|
|
align: nextAlignInfo
|
|
});
|
|
}
|
|
});
|
|
var triggerAlign = function triggerAlign() {
|
|
alignCountRef.current += 1;
|
|
var id = alignCountRef.current;
|
|
|
|
// Merge all align requirement into one frame
|
|
Promise.resolve().then(function () {
|
|
if (alignCountRef.current === id) {
|
|
onAlign();
|
|
}
|
|
});
|
|
};
|
|
|
|
// Reset ready status when placement & open changed
|
|
var resetReady = function resetReady() {
|
|
setOffsetInfo(function (ori) {
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, ori), {}, {
|
|
ready: false
|
|
});
|
|
});
|
|
};
|
|
rc_util_es_hooks_useLayoutEffect(resetReady, [placement]);
|
|
rc_util_es_hooks_useLayoutEffect(function () {
|
|
if (!open) {
|
|
resetReady();
|
|
}
|
|
}, [open]);
|
|
return [offsetInfo.ready, offsetInfo.offsetX, offsetInfo.offsetY, offsetInfo.offsetR, offsetInfo.offsetB, offsetInfo.arrowX, offsetInfo.arrowY, offsetInfo.scaleX, offsetInfo.scaleY, offsetInfo.align, triggerAlign];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/hooks/useWatch.js
|
|
|
|
|
|
|
|
function useWatch(open, target, popup, onAlign) {
|
|
rc_util_es_hooks_useLayoutEffect(function () {
|
|
if (open && target && popup) {
|
|
var targetElement = target;
|
|
var popupElement = popup;
|
|
var targetScrollList = collectScroller(targetElement);
|
|
var popupScrollList = collectScroller(popupElement);
|
|
var win = getWin(popupElement);
|
|
var mergedList = new Set([win].concat((0,toConsumableArray/* default */.Z)(targetScrollList), (0,toConsumableArray/* default */.Z)(popupScrollList)));
|
|
function notifyScroll() {
|
|
onAlign();
|
|
}
|
|
mergedList.forEach(function (scroller) {
|
|
scroller.addEventListener('scroll', notifyScroll, {
|
|
passive: true
|
|
});
|
|
});
|
|
win.addEventListener('resize', notifyScroll, {
|
|
passive: true
|
|
});
|
|
|
|
// First time always do align
|
|
onAlign();
|
|
return function () {
|
|
mergedList.forEach(function (scroller) {
|
|
scroller.removeEventListener('scroll', notifyScroll);
|
|
win.removeEventListener('resize', notifyScroll);
|
|
});
|
|
};
|
|
}
|
|
}, [open, target, popup]);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useState.js
|
|
|
|
|
|
/**
|
|
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
|
|
* We do not make this auto is to avoid real memory leak.
|
|
* Developer should confirm it's safe to ignore themselves.
|
|
*/
|
|
function useState_useSafeState(defaultValue) {
|
|
var destroyRef = React.useRef(false);
|
|
var _React$useState = React.useState(defaultValue),
|
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
value = _React$useState2[0],
|
|
setValue = _React$useState2[1];
|
|
React.useEffect(function () {
|
|
destroyRef.current = false;
|
|
return function () {
|
|
destroyRef.current = true;
|
|
};
|
|
}, []);
|
|
function safeSetState(updater, ignoreDestroy) {
|
|
if (ignoreDestroy && destroyRef.current) {
|
|
return;
|
|
}
|
|
setValue(updater);
|
|
}
|
|
return [value, safeSetState];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useMergedState.js
|
|
|
|
|
|
|
|
|
|
/** We only think `undefined` is empty */
|
|
function useMergedState_hasValue(value) {
|
|
return value !== undefined;
|
|
}
|
|
|
|
/**
|
|
* Similar to `useState` but will use props value if provided.
|
|
* Note that internal use rc-util `useState` hook.
|
|
*/
|
|
function useMergedState_useMergedState(defaultStateValue, option) {
|
|
var _ref = option || {},
|
|
defaultValue = _ref.defaultValue,
|
|
value = _ref.value,
|
|
onChange = _ref.onChange,
|
|
postState = _ref.postState;
|
|
|
|
// ======================= Init =======================
|
|
var _useState = useState(function () {
|
|
if (useMergedState_hasValue(value)) {
|
|
return value;
|
|
} else if (useMergedState_hasValue(defaultValue)) {
|
|
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
|
|
} else {
|
|
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
|
|
}
|
|
}),
|
|
_useState2 = _slicedToArray(_useState, 2),
|
|
innerValue = _useState2[0],
|
|
setInnerValue = _useState2[1];
|
|
var mergedValue = value !== undefined ? value : innerValue;
|
|
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
|
|
// ====================== Change ======================
|
|
var onChangeFn = useEvent(onChange);
|
|
var _useState3 = useState([mergedValue]),
|
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
prevValue = _useState4[0],
|
|
setPrevValue = _useState4[1];
|
|
useLayoutUpdateEffect(function () {
|
|
var prev = prevValue[0];
|
|
if (innerValue !== prev) {
|
|
onChangeFn(innerValue, prev);
|
|
}
|
|
}, [prevValue]);
|
|
|
|
// Sync value back to `undefined` when it from control to un-control
|
|
useLayoutUpdateEffect(function () {
|
|
if (!useMergedState_hasValue(value)) {
|
|
setInnerValue(value);
|
|
}
|
|
}, [value]);
|
|
|
|
// ====================== Update ======================
|
|
var triggerChange = useEvent(function (updater, ignoreDestroy) {
|
|
setInnerValue(updater, ignoreDestroy);
|
|
setPrevValue([mergedValue], ignoreDestroy);
|
|
});
|
|
return [postMergedValue, triggerChange];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/utils/set.js
|
|
|
|
|
|
|
|
|
|
|
|
function internalSet(entity, paths, value, removeIfUndefined) {
|
|
if (!paths.length) {
|
|
return value;
|
|
}
|
|
var _paths = _toArray(paths),
|
|
path = _paths[0],
|
|
restPath = _paths.slice(1);
|
|
var clone;
|
|
if (!entity && typeof path === 'number') {
|
|
clone = [];
|
|
} else if (Array.isArray(entity)) {
|
|
clone = _toConsumableArray(entity);
|
|
} else {
|
|
clone = _objectSpread({}, entity);
|
|
}
|
|
|
|
// Delete prop if `removeIfUndefined` and value is undefined
|
|
if (removeIfUndefined && value === undefined && restPath.length === 1) {
|
|
delete clone[path][restPath[0]];
|
|
} else {
|
|
clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
|
|
}
|
|
return clone;
|
|
}
|
|
function set(entity, paths, value) {
|
|
var removeIfUndefined = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
// Do nothing if `removeIfUndefined` and parent object not exist
|
|
if (paths.length && removeIfUndefined && value === undefined && !get(entity, paths.slice(0, -1))) {
|
|
return entity;
|
|
}
|
|
return internalSet(entity, paths, value, removeIfUndefined);
|
|
}
|
|
function isObject(obj) {
|
|
return _typeof(obj) === 'object' && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;
|
|
}
|
|
function createEmpty(source) {
|
|
return Array.isArray(source) ? [] : {};
|
|
}
|
|
var keys = typeof Reflect === 'undefined' ? Object.keys : Reflect.ownKeys;
|
|
|
|
/**
|
|
* Merge objects which will create
|
|
*/
|
|
function merge() {
|
|
for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
sources[_key] = arguments[_key];
|
|
}
|
|
var clone = createEmpty(sources[0]);
|
|
sources.forEach(function (src) {
|
|
function internalMerge(path, parentLoopSet) {
|
|
var loopSet = new Set(parentLoopSet);
|
|
var value = get(src, path);
|
|
var isArr = Array.isArray(value);
|
|
if (isArr || isObject(value)) {
|
|
// Only add not loop obj
|
|
if (!loopSet.has(value)) {
|
|
loopSet.add(value);
|
|
var originValue = get(clone, path);
|
|
if (isArr) {
|
|
// Array will always be override
|
|
clone = set(clone, path, []);
|
|
} else if (!originValue || _typeof(originValue) !== 'object') {
|
|
// Init container if not exist
|
|
clone = set(clone, path, createEmpty(value));
|
|
}
|
|
keys(value).forEach(function (key) {
|
|
internalMerge([].concat(_toConsumableArray(path), [key]), loopSet);
|
|
});
|
|
}
|
|
} else {
|
|
clone = set(clone, path, value);
|
|
}
|
|
}
|
|
internalMerge([]);
|
|
});
|
|
return clone;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/warning.js
|
|
/* eslint-disable no-console */
|
|
var warning_warned = {};
|
|
var preWarningFns = [];
|
|
|
|
/**
|
|
* Pre warning enable you to parse content before console.error.
|
|
* Modify to null will prevent warning.
|
|
*/
|
|
var preMessage = function preMessage(fn) {
|
|
preWarningFns.push(fn);
|
|
};
|
|
function es_warning_warning(valid, message) {
|
|
// Support uglify
|
|
if (false) { var finalMessage; }
|
|
}
|
|
function warning_note(valid, message) {
|
|
// Support uglify
|
|
if (false) { var finalMessage; }
|
|
}
|
|
function warning_resetWarned() {
|
|
warning_warned = {};
|
|
}
|
|
function warning_call(method, valid, message) {
|
|
if (!valid && !warning_warned[message]) {
|
|
method(false, message);
|
|
warning_warned[message] = true;
|
|
}
|
|
}
|
|
function warning_warningOnce(valid, message) {
|
|
warning_call(es_warning_warning, valid, message);
|
|
}
|
|
function es_warning_noteOnce(valid, message) {
|
|
warning_call(warning_note, valid, message);
|
|
}
|
|
warning_warningOnce.preMessage = preMessage;
|
|
warning_warningOnce.resetWarned = warning_resetWarned;
|
|
warning_warningOnce.noteOnce = es_warning_noteOnce;
|
|
/* harmony default export */ var rc_util_es_warning = ((/* unused pure expression or super */ null && (warning_warningOnce)));
|
|
/* eslint-enable */
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/index.js
|
|
|
|
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/raf.js
|
|
var raf_raf = function raf(callback) {
|
|
return +setTimeout(callback, 16);
|
|
};
|
|
var raf_caf = function caf(num) {
|
|
return clearTimeout(num);
|
|
};
|
|
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
|
|
raf_raf = function raf(callback) {
|
|
return window.requestAnimationFrame(callback);
|
|
};
|
|
raf_caf = function caf(handle) {
|
|
return window.cancelAnimationFrame(handle);
|
|
};
|
|
}
|
|
var raf_rafUUID = 0;
|
|
var raf_rafIds = new Map();
|
|
function raf_cleanup(id) {
|
|
raf_rafIds.delete(id);
|
|
}
|
|
var raf_wrapperRaf = function wrapperRaf(callback) {
|
|
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
raf_rafUUID += 1;
|
|
var id = raf_rafUUID;
|
|
function callRef(leftTimes) {
|
|
if (leftTimes === 0) {
|
|
// Clean up
|
|
raf_cleanup(id);
|
|
|
|
// Trigger
|
|
callback();
|
|
} else {
|
|
// Next raf
|
|
var realId = raf_raf(function () {
|
|
callRef(leftTimes - 1);
|
|
});
|
|
|
|
// Bind real raf id
|
|
raf_rafIds.set(id, realId);
|
|
}
|
|
}
|
|
callRef(times);
|
|
return id;
|
|
};
|
|
raf_wrapperRaf.cancel = function (id) {
|
|
var realId = raf_rafIds.get(id);
|
|
raf_cleanup(realId);
|
|
return raf_caf(realId);
|
|
};
|
|
/* harmony default export */ var rc_util_es_raf = (raf_wrapperRaf);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/hooks/useWinClick.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function useWinClick(open, clickToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen) {
|
|
var openRef = react.useRef(open);
|
|
|
|
// Window click to hide should be lock to avoid trigger lock immediately
|
|
var lockRef = react.useRef(false);
|
|
if (openRef.current !== open) {
|
|
lockRef.current = true;
|
|
openRef.current = open;
|
|
}
|
|
react.useEffect(function () {
|
|
var id = rc_util_es_raf(function () {
|
|
lockRef.current = false;
|
|
});
|
|
return function () {
|
|
rc_util_es_raf.cancel(id);
|
|
};
|
|
}, [open]);
|
|
|
|
// Click to hide is special action since click popup element should not hide
|
|
react.useEffect(function () {
|
|
if (clickToHide && popupEle && (!mask || maskClosable)) {
|
|
var genClickEvents = function genClickEvents() {
|
|
var clickInside = false;
|
|
|
|
// User may mouseDown inside and drag out of popup and mouse up
|
|
// Record here to prevent close
|
|
var onWindowMouseDown = function onWindowMouseDown(_ref) {
|
|
var target = _ref.target;
|
|
clickInside = inPopupOrChild(target);
|
|
};
|
|
var onWindowClick = function onWindowClick(_ref2) {
|
|
var target = _ref2.target;
|
|
if (!lockRef.current && openRef.current && !clickInside && !inPopupOrChild(target)) {
|
|
triggerOpen(false);
|
|
}
|
|
};
|
|
return [onWindowMouseDown, onWindowClick];
|
|
};
|
|
|
|
// Events
|
|
var _genClickEvents = genClickEvents(),
|
|
_genClickEvents2 = (0,slicedToArray/* default */.Z)(_genClickEvents, 2),
|
|
onWinMouseDown = _genClickEvents2[0],
|
|
onWinClick = _genClickEvents2[1];
|
|
var _genClickEvents3 = genClickEvents(),
|
|
_genClickEvents4 = (0,slicedToArray/* default */.Z)(_genClickEvents3, 2),
|
|
onShadowMouseDown = _genClickEvents4[0],
|
|
onShadowClick = _genClickEvents4[1];
|
|
var win = getWin(popupEle);
|
|
win.addEventListener('mousedown', onWinMouseDown);
|
|
win.addEventListener('click', onWinClick);
|
|
win.addEventListener('contextmenu', onWinClick);
|
|
|
|
// shadow root
|
|
var targetShadowRoot = getShadowRoot(targetEle);
|
|
if (targetShadowRoot) {
|
|
targetShadowRoot.addEventListener('mousedown', onShadowMouseDown);
|
|
targetShadowRoot.addEventListener('click', onShadowClick);
|
|
targetShadowRoot.addEventListener('contextmenu', onShadowClick);
|
|
}
|
|
|
|
// Warning if target and popup not in same root
|
|
if (false) { var popupRoot, targetRoot, _targetEle$getRootNod, _popupEle$getRootNode; }
|
|
return function () {
|
|
win.removeEventListener('mousedown', onWinMouseDown);
|
|
win.removeEventListener('click', onWinClick);
|
|
win.removeEventListener('contextmenu', onWinClick);
|
|
if (targetShadowRoot) {
|
|
targetShadowRoot.removeEventListener('mousedown', onShadowMouseDown);
|
|
targetShadowRoot.removeEventListener('click', onShadowClick);
|
|
targetShadowRoot.removeEventListener('contextmenu', onShadowClick);
|
|
}
|
|
};
|
|
}
|
|
}, [clickToHide, targetEle, popupEle, mask, maskClosable]);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/Dom/findDOMNode.js
|
|
|
|
|
|
function findDOMNode_isDOM(node) {
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
// Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
|
|
return node instanceof HTMLElement || node instanceof SVGElement;
|
|
}
|
|
|
|
/**
|
|
* Return if a node is a DOM node. Else will return by `findDOMNode`
|
|
*/
|
|
function findDOMNode_findDOMNode(node) {
|
|
if (findDOMNode_isDOM(node)) {
|
|
return node;
|
|
}
|
|
if (node instanceof react.Component) {
|
|
return react_dom.findDOMNode(node);
|
|
}
|
|
return null;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/util/motion.js
|
|
|
|
|
|
|
|
// ================= Transition =================
|
|
// Event wrapper. Copy from react source code
|
|
function makePrefixMap(styleProp, eventName) {
|
|
var prefixes = {};
|
|
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
|
prefixes["Webkit".concat(styleProp)] = "webkit".concat(eventName);
|
|
prefixes["Moz".concat(styleProp)] = "moz".concat(eventName);
|
|
prefixes["ms".concat(styleProp)] = "MS".concat(eventName);
|
|
prefixes["O".concat(styleProp)] = "o".concat(eventName.toLowerCase());
|
|
return prefixes;
|
|
}
|
|
|
|
function getVendorPrefixes(domSupport, win) {
|
|
var prefixes = {
|
|
animationend: makePrefixMap('Animation', 'AnimationEnd'),
|
|
transitionend: makePrefixMap('Transition', 'TransitionEnd')
|
|
};
|
|
|
|
if (domSupport) {
|
|
if (!('AnimationEvent' in win)) {
|
|
delete prefixes.animationend.animation;
|
|
}
|
|
|
|
if (!('TransitionEvent' in win)) {
|
|
delete prefixes.transitionend.transition;
|
|
}
|
|
}
|
|
|
|
return prefixes;
|
|
}
|
|
var vendorPrefixes = getVendorPrefixes(canUseDom(), typeof window !== 'undefined' ? window : {});
|
|
var style = {};
|
|
|
|
if (canUseDom()) {
|
|
var _document$createEleme = document.createElement('div');
|
|
|
|
style = _document$createEleme.style;
|
|
}
|
|
|
|
var prefixedEventNames = {};
|
|
function getVendorPrefixedEventName(eventName) {
|
|
if (prefixedEventNames[eventName]) {
|
|
return prefixedEventNames[eventName];
|
|
}
|
|
|
|
var prefixMap = vendorPrefixes[eventName];
|
|
|
|
if (prefixMap) {
|
|
var stylePropList = Object.keys(prefixMap);
|
|
var len = stylePropList.length;
|
|
|
|
for (var i = 0; i < len; i += 1) {
|
|
var styleProp = stylePropList[i];
|
|
|
|
if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {
|
|
prefixedEventNames[eventName] = prefixMap[styleProp];
|
|
return prefixedEventNames[eventName];
|
|
}
|
|
}
|
|
}
|
|
|
|
return '';
|
|
}
|
|
var internalAnimationEndName = getVendorPrefixedEventName('animationend');
|
|
var internalTransitionEndName = getVendorPrefixedEventName('transitionend');
|
|
var supportTransition = !!(internalAnimationEndName && internalTransitionEndName);
|
|
var animationEndName = internalAnimationEndName || 'animationend';
|
|
var transitionEndName = internalTransitionEndName || 'transitionend';
|
|
function getTransitionName(transitionName, transitionType) {
|
|
if (!transitionName) return null;
|
|
|
|
if ((0,esm_typeof/* default */.Z)(transitionName) === 'object') {
|
|
var type = transitionType.replace(/-\w/g, function (match) {
|
|
return match[1].toUpperCase();
|
|
});
|
|
return transitionName[type];
|
|
}
|
|
|
|
return "".concat(transitionName, "-").concat(transitionType);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/interface.js
|
|
var STATUS_NONE = 'none';
|
|
var STATUS_APPEAR = 'appear';
|
|
var STATUS_ENTER = 'enter';
|
|
var STATUS_LEAVE = 'leave';
|
|
var STEP_NONE = 'none';
|
|
var STEP_PREPARE = 'prepare';
|
|
var STEP_START = 'start';
|
|
var STEP_ACTIVE = 'active';
|
|
var STEP_ACTIVATED = 'end';
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/raf.js
|
|
var es_raf_raf = function raf(callback) {
|
|
return +setTimeout(callback, 16);
|
|
};
|
|
var es_raf_caf = function caf(num) {
|
|
return clearTimeout(num);
|
|
};
|
|
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
|
|
es_raf_raf = function raf(callback) {
|
|
return window.requestAnimationFrame(callback);
|
|
};
|
|
es_raf_caf = function caf(handle) {
|
|
return window.cancelAnimationFrame(handle);
|
|
};
|
|
}
|
|
var es_raf_rafUUID = 0;
|
|
var es_raf_rafIds = new Map();
|
|
function es_raf_cleanup(id) {
|
|
es_raf_rafIds.delete(id);
|
|
}
|
|
var es_raf_wrapperRaf = function wrapperRaf(callback) {
|
|
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
es_raf_rafUUID += 1;
|
|
var id = es_raf_rafUUID;
|
|
function callRef(leftTimes) {
|
|
if (leftTimes === 0) {
|
|
// Clean up
|
|
es_raf_cleanup(id);
|
|
|
|
// Trigger
|
|
callback();
|
|
} else {
|
|
// Next raf
|
|
var realId = es_raf_raf(function () {
|
|
callRef(leftTimes - 1);
|
|
});
|
|
|
|
// Bind real raf id
|
|
es_raf_rafIds.set(id, realId);
|
|
}
|
|
}
|
|
callRef(times);
|
|
return id;
|
|
};
|
|
es_raf_wrapperRaf.cancel = function (id) {
|
|
var realId = es_raf_rafIds.get(id);
|
|
es_raf_cleanup(realId);
|
|
return es_raf_caf(realId);
|
|
};
|
|
/* harmony default export */ var node_modules_rc_util_es_raf = (es_raf_wrapperRaf);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/hooks/useNextFrame.js
|
|
|
|
|
|
/* harmony default export */ var useNextFrame = (function () {
|
|
var nextFrameRef = react.useRef(null);
|
|
|
|
function cancelNextFrame() {
|
|
node_modules_rc_util_es_raf.cancel(nextFrameRef.current);
|
|
}
|
|
|
|
function nextFrame(callback) {
|
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
cancelNextFrame();
|
|
var nextFrameId = node_modules_rc_util_es_raf(function () {
|
|
if (delay <= 1) {
|
|
callback({
|
|
isCanceled: function isCanceled() {
|
|
return nextFrameId !== nextFrameRef.current;
|
|
}
|
|
});
|
|
} else {
|
|
nextFrame(callback, delay - 1);
|
|
}
|
|
});
|
|
nextFrameRef.current = nextFrameId;
|
|
}
|
|
|
|
react.useEffect(function () {
|
|
return function () {
|
|
cancelNextFrame();
|
|
};
|
|
}, []);
|
|
return [nextFrame, cancelNextFrame];
|
|
});
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/hooks/useIsomorphicLayoutEffect.js
|
|
|
|
// It's safe to use `useLayoutEffect` but the warning is annoying
|
|
|
|
var useIsomorphicLayoutEffect = canUseDom() ? react.useLayoutEffect : react.useEffect;
|
|
/* harmony default export */ var hooks_useIsomorphicLayoutEffect = (useIsomorphicLayoutEffect);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/hooks/useStepQueue.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED];
|
|
/** Skip current step */
|
|
|
|
var SkipStep = false;
|
|
/** Current step should be update in */
|
|
|
|
var DoStep = true;
|
|
function isActive(step) {
|
|
return step === STEP_ACTIVE || step === STEP_ACTIVATED;
|
|
}
|
|
/* harmony default export */ var useStepQueue = (function (status, callback) {
|
|
var _useState = useSafeState(STEP_NONE),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
step = _useState2[0],
|
|
setStep = _useState2[1];
|
|
|
|
var _useNextFrame = useNextFrame(),
|
|
_useNextFrame2 = (0,slicedToArray/* default */.Z)(_useNextFrame, 2),
|
|
nextFrame = _useNextFrame2[0],
|
|
cancelNextFrame = _useNextFrame2[1];
|
|
|
|
function startQueue() {
|
|
setStep(STEP_PREPARE, true);
|
|
}
|
|
|
|
hooks_useIsomorphicLayoutEffect(function () {
|
|
if (step !== STEP_NONE && step !== STEP_ACTIVATED) {
|
|
var index = STEP_QUEUE.indexOf(step);
|
|
var nextStep = STEP_QUEUE[index + 1];
|
|
var result = callback(step);
|
|
|
|
if (result === SkipStep) {
|
|
// Skip when no needed
|
|
setStep(nextStep, true);
|
|
} else {
|
|
// Do as frame for step update
|
|
nextFrame(function (info) {
|
|
function doNext() {
|
|
// Skip since current queue is ood
|
|
if (info.isCanceled()) return;
|
|
setStep(nextStep, true);
|
|
}
|
|
|
|
if (result === true) {
|
|
doNext();
|
|
} else {
|
|
// Only promise should be async
|
|
Promise.resolve(result).then(doNext);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}, [status, step]);
|
|
react.useEffect(function () {
|
|
return function () {
|
|
cancelNextFrame();
|
|
};
|
|
}, []);
|
|
return [startQueue, step];
|
|
});
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/hooks/useDomMotionEvents.js
|
|
|
|
|
|
|
|
/* harmony default export */ var useDomMotionEvents = (function (callback) {
|
|
var cacheElementRef = (0,react.useRef)(); // Cache callback
|
|
|
|
var callbackRef = (0,react.useRef)(callback);
|
|
callbackRef.current = callback; // Internal motion event handler
|
|
|
|
var onInternalMotionEnd = react.useCallback(function (event) {
|
|
callbackRef.current(event);
|
|
}, []); // Remove events
|
|
|
|
function removeMotionEvents(element) {
|
|
if (element) {
|
|
element.removeEventListener(transitionEndName, onInternalMotionEnd);
|
|
element.removeEventListener(animationEndName, onInternalMotionEnd);
|
|
}
|
|
} // Patch events
|
|
|
|
|
|
function patchMotionEvents(element) {
|
|
if (cacheElementRef.current && cacheElementRef.current !== element) {
|
|
removeMotionEvents(cacheElementRef.current);
|
|
}
|
|
|
|
if (element && element !== cacheElementRef.current) {
|
|
element.addEventListener(transitionEndName, onInternalMotionEnd);
|
|
element.addEventListener(animationEndName, onInternalMotionEnd); // Save as cache in case dom removed trigger by `motionDeadline`
|
|
|
|
cacheElementRef.current = element;
|
|
}
|
|
} // Clean up when removed
|
|
|
|
|
|
react.useEffect(function () {
|
|
return function () {
|
|
removeMotionEvents(cacheElementRef.current);
|
|
};
|
|
}, []);
|
|
return [patchMotionEvents, removeMotionEvents];
|
|
});
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/hooks/useStatus.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function useStatus(supportMotion, visible, getElement, _ref) {
|
|
var _ref$motionEnter = _ref.motionEnter,
|
|
motionEnter = _ref$motionEnter === void 0 ? true : _ref$motionEnter,
|
|
_ref$motionAppear = _ref.motionAppear,
|
|
motionAppear = _ref$motionAppear === void 0 ? true : _ref$motionAppear,
|
|
_ref$motionLeave = _ref.motionLeave,
|
|
motionLeave = _ref$motionLeave === void 0 ? true : _ref$motionLeave,
|
|
motionDeadline = _ref.motionDeadline,
|
|
motionLeaveImmediately = _ref.motionLeaveImmediately,
|
|
onAppearPrepare = _ref.onAppearPrepare,
|
|
onEnterPrepare = _ref.onEnterPrepare,
|
|
onLeavePrepare = _ref.onLeavePrepare,
|
|
onAppearStart = _ref.onAppearStart,
|
|
onEnterStart = _ref.onEnterStart,
|
|
onLeaveStart = _ref.onLeaveStart,
|
|
onAppearActive = _ref.onAppearActive,
|
|
onEnterActive = _ref.onEnterActive,
|
|
onLeaveActive = _ref.onLeaveActive,
|
|
onAppearEnd = _ref.onAppearEnd,
|
|
onEnterEnd = _ref.onEnterEnd,
|
|
onLeaveEnd = _ref.onLeaveEnd,
|
|
onVisibleChanged = _ref.onVisibleChanged;
|
|
|
|
// Used for outer render usage to avoid `visible: false & status: none` to render nothing
|
|
var _useState = useSafeState(),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
asyncVisible = _useState2[0],
|
|
setAsyncVisible = _useState2[1];
|
|
|
|
var _useState3 = useSafeState(STATUS_NONE),
|
|
_useState4 = (0,slicedToArray/* default */.Z)(_useState3, 2),
|
|
status = _useState4[0],
|
|
setStatus = _useState4[1];
|
|
|
|
var _useState5 = useSafeState(null),
|
|
_useState6 = (0,slicedToArray/* default */.Z)(_useState5, 2),
|
|
style = _useState6[0],
|
|
setStyle = _useState6[1];
|
|
|
|
var mountedRef = (0,react.useRef)(false);
|
|
var deadlineRef = (0,react.useRef)(null); // =========================== Dom Node ===========================
|
|
|
|
function getDomElement() {
|
|
return getElement();
|
|
} // ========================== Motion End ==========================
|
|
|
|
|
|
var activeRef = (0,react.useRef)(false);
|
|
|
|
function onInternalMotionEnd(event) {
|
|
var element = getDomElement();
|
|
|
|
if (event && !event.deadline && event.target !== element) {
|
|
// event exists
|
|
// not initiated by deadline
|
|
// transitionEnd not fired by inner elements
|
|
return;
|
|
}
|
|
|
|
var currentActive = activeRef.current;
|
|
var canEnd;
|
|
|
|
if (status === STATUS_APPEAR && currentActive) {
|
|
canEnd = onAppearEnd === null || onAppearEnd === void 0 ? void 0 : onAppearEnd(element, event);
|
|
} else if (status === STATUS_ENTER && currentActive) {
|
|
canEnd = onEnterEnd === null || onEnterEnd === void 0 ? void 0 : onEnterEnd(element, event);
|
|
} else if (status === STATUS_LEAVE && currentActive) {
|
|
canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event);
|
|
} // Only update status when `canEnd` and not destroyed
|
|
|
|
|
|
if (status !== STATUS_NONE && currentActive && canEnd !== false) {
|
|
setStatus(STATUS_NONE, true);
|
|
setStyle(null, true);
|
|
}
|
|
}
|
|
|
|
var _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd),
|
|
_useDomMotionEvents2 = (0,slicedToArray/* default */.Z)(_useDomMotionEvents, 1),
|
|
patchMotionEvents = _useDomMotionEvents2[0]; // ============================= Step =============================
|
|
|
|
|
|
var eventHandlers = react.useMemo(function () {
|
|
var _ref2, _ref3, _ref4;
|
|
|
|
switch (status) {
|
|
case STATUS_APPEAR:
|
|
return _ref2 = {}, (0,defineProperty/* default */.Z)(_ref2, STEP_PREPARE, onAppearPrepare), (0,defineProperty/* default */.Z)(_ref2, STEP_START, onAppearStart), (0,defineProperty/* default */.Z)(_ref2, STEP_ACTIVE, onAppearActive), _ref2;
|
|
|
|
case STATUS_ENTER:
|
|
return _ref3 = {}, (0,defineProperty/* default */.Z)(_ref3, STEP_PREPARE, onEnterPrepare), (0,defineProperty/* default */.Z)(_ref3, STEP_START, onEnterStart), (0,defineProperty/* default */.Z)(_ref3, STEP_ACTIVE, onEnterActive), _ref3;
|
|
|
|
case STATUS_LEAVE:
|
|
return _ref4 = {}, (0,defineProperty/* default */.Z)(_ref4, STEP_PREPARE, onLeavePrepare), (0,defineProperty/* default */.Z)(_ref4, STEP_START, onLeaveStart), (0,defineProperty/* default */.Z)(_ref4, STEP_ACTIVE, onLeaveActive), _ref4;
|
|
|
|
default:
|
|
return {};
|
|
}
|
|
}, [status]);
|
|
|
|
var _useStepQueue = useStepQueue(status, function (newStep) {
|
|
// Only prepare step can be skip
|
|
if (newStep === STEP_PREPARE) {
|
|
var onPrepare = eventHandlers[STEP_PREPARE];
|
|
|
|
if (!onPrepare) {
|
|
return SkipStep;
|
|
}
|
|
|
|
return onPrepare(getDomElement());
|
|
} // Rest step is sync update
|
|
|
|
|
|
if (step in eventHandlers) {
|
|
var _eventHandlers$step;
|
|
|
|
setStyle(((_eventHandlers$step = eventHandlers[step]) === null || _eventHandlers$step === void 0 ? void 0 : _eventHandlers$step.call(eventHandlers, getDomElement(), null)) || null);
|
|
}
|
|
|
|
if (step === STEP_ACTIVE) {
|
|
// Patch events when motion needed
|
|
patchMotionEvents(getDomElement());
|
|
|
|
if (motionDeadline > 0) {
|
|
clearTimeout(deadlineRef.current);
|
|
deadlineRef.current = setTimeout(function () {
|
|
onInternalMotionEnd({
|
|
deadline: true
|
|
});
|
|
}, motionDeadline);
|
|
}
|
|
}
|
|
|
|
return DoStep;
|
|
}),
|
|
_useStepQueue2 = (0,slicedToArray/* default */.Z)(_useStepQueue, 2),
|
|
startStep = _useStepQueue2[0],
|
|
step = _useStepQueue2[1];
|
|
|
|
var active = isActive(step);
|
|
activeRef.current = active; // ============================ Status ============================
|
|
// Update with new status
|
|
|
|
hooks_useIsomorphicLayoutEffect(function () {
|
|
setAsyncVisible(visible);
|
|
var isMounted = mountedRef.current;
|
|
mountedRef.current = true;
|
|
|
|
if (!supportMotion) {
|
|
return;
|
|
}
|
|
|
|
var nextStatus; // Appear
|
|
|
|
if (!isMounted && visible && motionAppear) {
|
|
nextStatus = STATUS_APPEAR;
|
|
} // Enter
|
|
|
|
|
|
if (isMounted && visible && motionEnter) {
|
|
nextStatus = STATUS_ENTER;
|
|
} // Leave
|
|
|
|
|
|
if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) {
|
|
nextStatus = STATUS_LEAVE;
|
|
} // Update to next status
|
|
|
|
|
|
if (nextStatus) {
|
|
setStatus(nextStatus);
|
|
startStep();
|
|
}
|
|
}, [visible]); // ============================ Effect ============================
|
|
// Reset when motion changed
|
|
|
|
(0,react.useEffect)(function () {
|
|
if ( // Cancel appear
|
|
status === STATUS_APPEAR && !motionAppear || // Cancel enter
|
|
status === STATUS_ENTER && !motionEnter || // Cancel leave
|
|
status === STATUS_LEAVE && !motionLeave) {
|
|
setStatus(STATUS_NONE);
|
|
}
|
|
}, [motionAppear, motionEnter, motionLeave]);
|
|
(0,react.useEffect)(function () {
|
|
return function () {
|
|
mountedRef.current = false;
|
|
clearTimeout(deadlineRef.current);
|
|
};
|
|
}, []); // Trigger `onVisibleChanged`
|
|
|
|
var firstMountChangeRef = react.useRef(false);
|
|
(0,react.useEffect)(function () {
|
|
// [visible & motion not end] => [!visible & motion end] still need trigger onVisibleChanged
|
|
if (asyncVisible) {
|
|
firstMountChangeRef.current = true;
|
|
}
|
|
|
|
if (asyncVisible !== undefined && status === STATUS_NONE) {
|
|
// Skip first render is invisible since it's nothing changed
|
|
if (firstMountChangeRef.current || asyncVisible) {
|
|
onVisibleChanged === null || onVisibleChanged === void 0 ? void 0 : onVisibleChanged(asyncVisible);
|
|
}
|
|
|
|
firstMountChangeRef.current = true;
|
|
}
|
|
}, [asyncVisible, status]); // ============================ Styles ============================
|
|
|
|
var mergedStyle = style;
|
|
|
|
if (eventHandlers[STEP_PREPARE] && step === STEP_START) {
|
|
mergedStyle = (0,objectSpread2/* default */.Z)({
|
|
transition: 'none'
|
|
}, mergedStyle);
|
|
}
|
|
|
|
return [status, step, mergedStyle, asyncVisible !== null && asyncVisible !== void 0 ? asyncVisible : visible];
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
var classCallCheck = __webpack_require__(15671);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
var createClass = __webpack_require__(43144);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
|
var inherits = __webpack_require__(60136);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules
|
|
var createSuper = __webpack_require__(51630);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/DomWrapper.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DomWrapper = /*#__PURE__*/function (_React$Component) {
|
|
(0,inherits/* default */.Z)(DomWrapper, _React$Component);
|
|
|
|
var _super = (0,createSuper/* default */.Z)(DomWrapper);
|
|
|
|
function DomWrapper() {
|
|
(0,classCallCheck/* default */.Z)(this, DomWrapper);
|
|
|
|
return _super.apply(this, arguments);
|
|
}
|
|
|
|
(0,createClass/* default */.Z)(DomWrapper, [{
|
|
key: "render",
|
|
value: function render() {
|
|
return this.props.children;
|
|
}
|
|
}]);
|
|
|
|
return DomWrapper;
|
|
}(react.Component);
|
|
|
|
/* harmony default export */ var es_DomWrapper = (DomWrapper);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/CSSMotion.js
|
|
|
|
|
|
|
|
|
|
|
|
/* eslint-disable react/default-props-match-prop-types, react/no-multi-comp, react/prop-types */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* `transitionSupport` is used for none transition test case.
|
|
* Default we use browser transition event support check.
|
|
*/
|
|
function genCSSMotion(config) {
|
|
var transitionSupport = config;
|
|
|
|
if ((0,esm_typeof/* default */.Z)(config) === 'object') {
|
|
transitionSupport = config.transitionSupport;
|
|
}
|
|
|
|
function isSupportTransition(props) {
|
|
return !!(props.motionName && transitionSupport);
|
|
}
|
|
|
|
var CSSMotion = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var _props$visible = props.visible,
|
|
visible = _props$visible === void 0 ? true : _props$visible,
|
|
_props$removeOnLeave = props.removeOnLeave,
|
|
removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave,
|
|
forceRender = props.forceRender,
|
|
children = props.children,
|
|
motionName = props.motionName,
|
|
leavedClassName = props.leavedClassName,
|
|
eventProps = props.eventProps;
|
|
var supportMotion = isSupportTransition(props); // Ref to the react node, it may be a HTMLElement
|
|
|
|
var nodeRef = (0,react.useRef)(); // Ref to the dom wrapper in case ref can not pass to HTMLElement
|
|
|
|
var wrapperNodeRef = (0,react.useRef)();
|
|
|
|
function getDomElement() {
|
|
try {
|
|
// Here we're avoiding call for findDOMNode since it's deprecated
|
|
// in strict mode. We're calling it only when node ref is not
|
|
// an instance of DOM HTMLElement. Otherwise use
|
|
// findDOMNode as a final resort
|
|
return nodeRef.current instanceof HTMLElement ? nodeRef.current : findDOMNode_findDOMNode(wrapperNodeRef.current);
|
|
} catch (e) {
|
|
// Only happen when `motionDeadline` trigger but element removed.
|
|
return null;
|
|
}
|
|
}
|
|
|
|
var _useStatus = useStatus(supportMotion, visible, getDomElement, props),
|
|
_useStatus2 = (0,slicedToArray/* default */.Z)(_useStatus, 4),
|
|
status = _useStatus2[0],
|
|
statusStep = _useStatus2[1],
|
|
statusStyle = _useStatus2[2],
|
|
mergedVisible = _useStatus2[3]; // Record whether content has rendered
|
|
// Will return null for un-rendered even when `removeOnLeave={false}`
|
|
|
|
|
|
var renderedRef = react.useRef(mergedVisible);
|
|
|
|
if (mergedVisible) {
|
|
renderedRef.current = true;
|
|
} // ====================== Refs ======================
|
|
|
|
|
|
var setNodeRef = react.useCallback(function (node) {
|
|
nodeRef.current = node;
|
|
fillRef(ref, node);
|
|
}, [ref]); // ===================== Render =====================
|
|
|
|
var motionChildren;
|
|
|
|
var mergedProps = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, eventProps), {}, {
|
|
visible: visible
|
|
});
|
|
|
|
if (!children) {
|
|
// No children
|
|
motionChildren = null;
|
|
} else if (status === STATUS_NONE || !isSupportTransition(props)) {
|
|
// Stable children
|
|
if (mergedVisible) {
|
|
motionChildren = children((0,objectSpread2/* default */.Z)({}, mergedProps), setNodeRef);
|
|
} else if (!removeOnLeave && renderedRef.current && leavedClassName) {
|
|
motionChildren = children((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, mergedProps), {}, {
|
|
className: leavedClassName
|
|
}), setNodeRef);
|
|
} else if (forceRender || !removeOnLeave && !leavedClassName) {
|
|
motionChildren = children((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, mergedProps), {}, {
|
|
style: {
|
|
display: 'none'
|
|
}
|
|
}), setNodeRef);
|
|
} else {
|
|
motionChildren = null;
|
|
}
|
|
} else {
|
|
var _classNames;
|
|
|
|
// In motion
|
|
var statusSuffix;
|
|
|
|
if (statusStep === STEP_PREPARE) {
|
|
statusSuffix = 'prepare';
|
|
} else if (isActive(statusStep)) {
|
|
statusSuffix = 'active';
|
|
} else if (statusStep === STEP_START) {
|
|
statusSuffix = 'start';
|
|
}
|
|
|
|
motionChildren = children((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, mergedProps), {}, {
|
|
className: classnames_default()(getTransitionName(motionName, status), (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix)), statusSuffix), (0,defineProperty/* default */.Z)(_classNames, motionName, typeof motionName === 'string'), _classNames)),
|
|
style: statusStyle
|
|
}), setNodeRef);
|
|
} // Auto inject ref if child node not have `ref` props
|
|
|
|
|
|
if ( /*#__PURE__*/react.isValidElement(motionChildren) && supportRef(motionChildren)) {
|
|
var _ref = motionChildren,
|
|
originNodeRef = _ref.ref;
|
|
|
|
if (!originNodeRef) {
|
|
motionChildren = /*#__PURE__*/react.cloneElement(motionChildren, {
|
|
ref: setNodeRef
|
|
});
|
|
}
|
|
}
|
|
|
|
return /*#__PURE__*/react.createElement(es_DomWrapper, {
|
|
ref: wrapperNodeRef
|
|
}, motionChildren);
|
|
});
|
|
CSSMotion.displayName = 'CSSMotion';
|
|
return CSSMotion;
|
|
}
|
|
/* harmony default export */ var es_CSSMotion = (genCSSMotion(supportTransition));
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
|
var assertThisInitialized = __webpack_require__(97326);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/util/diff.js
|
|
|
|
|
|
var STATUS_ADD = 'add';
|
|
var STATUS_KEEP = 'keep';
|
|
var STATUS_REMOVE = 'remove';
|
|
var STATUS_REMOVED = 'removed';
|
|
function wrapKeyToObject(key) {
|
|
var keyObj;
|
|
|
|
if (key && (0,esm_typeof/* default */.Z)(key) === 'object' && 'key' in key) {
|
|
keyObj = key;
|
|
} else {
|
|
keyObj = {
|
|
key: key
|
|
};
|
|
}
|
|
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, keyObj), {}, {
|
|
key: String(keyObj.key)
|
|
});
|
|
}
|
|
function parseKeys() {
|
|
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
return keys.map(wrapKeyToObject);
|
|
}
|
|
function diffKeys() {
|
|
var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
var list = [];
|
|
var currentIndex = 0;
|
|
var currentLen = currentKeys.length;
|
|
var prevKeyObjects = parseKeys(prevKeys);
|
|
var currentKeyObjects = parseKeys(currentKeys); // Check prev keys to insert or keep
|
|
|
|
prevKeyObjects.forEach(function (keyObj) {
|
|
var hit = false;
|
|
|
|
for (var i = currentIndex; i < currentLen; i += 1) {
|
|
var currentKeyObj = currentKeyObjects[i];
|
|
|
|
if (currentKeyObj.key === keyObj.key) {
|
|
// New added keys should add before current key
|
|
if (currentIndex < i) {
|
|
list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) {
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, obj), {}, {
|
|
status: STATUS_ADD
|
|
});
|
|
}));
|
|
currentIndex = i;
|
|
}
|
|
|
|
list.push((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, currentKeyObj), {}, {
|
|
status: STATUS_KEEP
|
|
}));
|
|
currentIndex += 1;
|
|
hit = true;
|
|
break;
|
|
}
|
|
} // If not hit, it means key is removed
|
|
|
|
|
|
if (!hit) {
|
|
list.push((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, keyObj), {}, {
|
|
status: STATUS_REMOVE
|
|
}));
|
|
}
|
|
}); // Add rest to the list
|
|
|
|
if (currentIndex < currentLen) {
|
|
list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) {
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, obj), {}, {
|
|
status: STATUS_ADD
|
|
});
|
|
}));
|
|
}
|
|
/**
|
|
* Merge same key when it remove and add again:
|
|
* [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]
|
|
*/
|
|
|
|
|
|
var keys = {};
|
|
list.forEach(function (_ref) {
|
|
var key = _ref.key;
|
|
keys[key] = (keys[key] || 0) + 1;
|
|
});
|
|
var duplicatedKeys = Object.keys(keys).filter(function (key) {
|
|
return keys[key] > 1;
|
|
});
|
|
duplicatedKeys.forEach(function (matchKey) {
|
|
// Remove `STATUS_REMOVE` node.
|
|
list = list.filter(function (_ref2) {
|
|
var key = _ref2.key,
|
|
status = _ref2.status;
|
|
return key !== matchKey || status !== STATUS_REMOVE;
|
|
}); // Update `STATUS_ADD` to `STATUS_KEEP`
|
|
|
|
list.forEach(function (node) {
|
|
if (node.key === matchKey) {
|
|
// eslint-disable-next-line no-param-reassign
|
|
node.status = STATUS_KEEP;
|
|
}
|
|
});
|
|
});
|
|
return list;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/CSSMotionList.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CSSMotionList_excluded = ["component", "children", "onVisibleChanged", "onAllRemoved"],
|
|
CSSMotionList_excluded2 = ["status"];
|
|
|
|
/* eslint react/prop-types: 0 */
|
|
|
|
|
|
|
|
|
|
var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd'];
|
|
|
|
/**
|
|
* Generate a CSSMotionList component with config
|
|
* @param transitionSupport No need since CSSMotionList no longer depends on transition support
|
|
* @param CSSMotion CSSMotion component
|
|
*/
|
|
function genCSSMotionList(transitionSupport) {
|
|
var CSSMotion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : es_CSSMotion;
|
|
|
|
var CSSMotionList = /*#__PURE__*/function (_React$Component) {
|
|
(0,inherits/* default */.Z)(CSSMotionList, _React$Component);
|
|
|
|
var _super = (0,createSuper/* default */.Z)(CSSMotionList);
|
|
|
|
function CSSMotionList() {
|
|
var _this;
|
|
|
|
(0,classCallCheck/* default */.Z)(this, CSSMotionList);
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
|
|
(0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "state", {
|
|
keyEntities: []
|
|
});
|
|
|
|
(0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "removeKey", function (removeKey) {
|
|
var keyEntities = _this.state.keyEntities;
|
|
var nextKeyEntities = keyEntities.map(function (entity) {
|
|
if (entity.key !== removeKey) return entity;
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, entity), {}, {
|
|
status: STATUS_REMOVED
|
|
});
|
|
});
|
|
|
|
_this.setState({
|
|
keyEntities: nextKeyEntities
|
|
});
|
|
|
|
return nextKeyEntities.filter(function (_ref) {
|
|
var status = _ref.status;
|
|
return status !== STATUS_REMOVED;
|
|
}).length;
|
|
});
|
|
|
|
return _this;
|
|
}
|
|
|
|
(0,createClass/* default */.Z)(CSSMotionList, [{
|
|
key: "render",
|
|
value: function render() {
|
|
var _this2 = this;
|
|
|
|
var keyEntities = this.state.keyEntities;
|
|
|
|
var _this$props = this.props,
|
|
component = _this$props.component,
|
|
children = _this$props.children,
|
|
_onVisibleChanged = _this$props.onVisibleChanged,
|
|
onAllRemoved = _this$props.onAllRemoved,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(_this$props, CSSMotionList_excluded);
|
|
|
|
var Component = component || react.Fragment;
|
|
var motionProps = {};
|
|
MOTION_PROP_NAMES.forEach(function (prop) {
|
|
motionProps[prop] = restProps[prop];
|
|
delete restProps[prop];
|
|
});
|
|
delete restProps.keys;
|
|
return /*#__PURE__*/react.createElement(Component, restProps, keyEntities.map(function (_ref2) {
|
|
var status = _ref2.status,
|
|
eventProps = (0,objectWithoutProperties/* default */.Z)(_ref2, CSSMotionList_excluded2);
|
|
|
|
var visible = status === STATUS_ADD || status === STATUS_KEEP;
|
|
return /*#__PURE__*/react.createElement(CSSMotion, (0,esm_extends/* default */.Z)({}, motionProps, {
|
|
key: eventProps.key,
|
|
visible: visible,
|
|
eventProps: eventProps,
|
|
onVisibleChanged: function onVisibleChanged(changedVisible) {
|
|
_onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, {
|
|
key: eventProps.key
|
|
});
|
|
|
|
if (!changedVisible) {
|
|
var restKeysCount = _this2.removeKey(eventProps.key);
|
|
|
|
if (restKeysCount === 0 && onAllRemoved) {
|
|
onAllRemoved();
|
|
}
|
|
}
|
|
}
|
|
}), children);
|
|
}));
|
|
}
|
|
}], [{
|
|
key: "getDerivedStateFromProps",
|
|
value: function getDerivedStateFromProps(_ref3, _ref4) {
|
|
var keys = _ref3.keys;
|
|
var keyEntities = _ref4.keyEntities;
|
|
var parsedKeyObjects = parseKeys(keys);
|
|
var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);
|
|
return {
|
|
keyEntities: mixedKeyEntities.filter(function (entity) {
|
|
var prevEntity = keyEntities.find(function (_ref5) {
|
|
var key = _ref5.key;
|
|
return entity.key === key;
|
|
}); // Remove if already mark as removed
|
|
|
|
if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
})
|
|
};
|
|
} // ZombieJ: Return the count of rest keys. It's safe to refactor if need more info.
|
|
|
|
}]);
|
|
|
|
return CSSMotionList;
|
|
}(react.Component);
|
|
|
|
(0,defineProperty/* default */.Z)(CSSMotionList, "defaultProps", {
|
|
component: 'div'
|
|
});
|
|
|
|
return CSSMotionList;
|
|
}
|
|
/* harmony default export */ var CSSMotionList = (genCSSMotionList(supportTransition));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-motion/es/index.js
|
|
|
|
|
|
|
|
/* harmony default export */ var rc_motion_es = (es_CSSMotion);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/hooks/useMemo.js
|
|
|
|
function useMemo_useMemo(getValue, condition, shouldUpdate) {
|
|
var cacheRef = react.useRef({});
|
|
if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
|
|
cacheRef.current.value = getValue();
|
|
cacheRef.current.condition = condition;
|
|
}
|
|
return cacheRef.current.value;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/node_modules/rc-util/es/ref.js
|
|
|
|
/* eslint-disable no-param-reassign */
|
|
|
|
|
|
|
|
function ref_fillRef(ref, node) {
|
|
if (typeof ref === 'function') {
|
|
ref(node);
|
|
} else if ((0,esm_typeof/* default */.Z)(ref) === 'object' && ref && 'current' in ref) {
|
|
ref.current = node;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Merge refs into one ref function to support ref passing.
|
|
*/
|
|
function ref_composeRef() {
|
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
refs[_key] = arguments[_key];
|
|
}
|
|
var refList = refs.filter(function (ref) {
|
|
return ref;
|
|
});
|
|
if (refList.length <= 1) {
|
|
return refList[0];
|
|
}
|
|
return function (node) {
|
|
refs.forEach(function (ref) {
|
|
ref_fillRef(ref, node);
|
|
});
|
|
};
|
|
}
|
|
function ref_useComposeRef() {
|
|
for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
refs[_key2] = arguments[_key2];
|
|
}
|
|
return useMemo_useMemo(function () {
|
|
return ref_composeRef.apply(void 0, refs);
|
|
}, refs, function (prev, next) {
|
|
return prev.length === next.length && prev.every(function (ref, i) {
|
|
return ref === next[i];
|
|
});
|
|
});
|
|
}
|
|
function ref_supportRef(nodeOrComponent) {
|
|
var _type$prototype, _nodeOrComponent$prot;
|
|
var type = (0,react_is.isMemo)(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
|
|
|
|
// Function component node
|
|
if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render)) {
|
|
return false;
|
|
}
|
|
|
|
// Class component
|
|
if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
/* eslint-enable */
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/Popup/Arrow.js
|
|
|
|
|
|
function Arrow(props) {
|
|
var prefixCls = props.prefixCls,
|
|
align = props.align,
|
|
arrow = props.arrow,
|
|
arrowPos = props.arrowPos;
|
|
var _ref = arrow || {},
|
|
className = _ref.className,
|
|
content = _ref.content;
|
|
var _arrowPos$x = arrowPos.x,
|
|
x = _arrowPos$x === void 0 ? 0 : _arrowPos$x,
|
|
_arrowPos$y = arrowPos.y,
|
|
y = _arrowPos$y === void 0 ? 0 : _arrowPos$y;
|
|
var arrowRef = react.useRef();
|
|
|
|
// Skip if no align
|
|
if (!align || !align.points) {
|
|
return null;
|
|
}
|
|
var alignStyle = {
|
|
position: 'absolute'
|
|
};
|
|
|
|
// Skip if no need to align
|
|
if (align.autoArrow !== false) {
|
|
var popupPoints = align.points[0];
|
|
var targetPoints = align.points[1];
|
|
var popupTB = popupPoints[0];
|
|
var popupLR = popupPoints[1];
|
|
var targetTB = targetPoints[0];
|
|
var targetLR = targetPoints[1];
|
|
|
|
// Top & Bottom
|
|
if (popupTB === targetTB || !['t', 'b'].includes(popupTB)) {
|
|
alignStyle.top = y;
|
|
} else if (popupTB === 't') {
|
|
alignStyle.top = 0;
|
|
} else {
|
|
alignStyle.bottom = 0;
|
|
}
|
|
|
|
// Left & Right
|
|
if (popupLR === targetLR || !['l', 'r'].includes(popupLR)) {
|
|
alignStyle.left = x;
|
|
} else if (popupLR === 'l') {
|
|
alignStyle.left = 0;
|
|
} else {
|
|
alignStyle.right = 0;
|
|
}
|
|
}
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
ref: arrowRef,
|
|
className: classnames_default()("".concat(prefixCls, "-arrow"), className),
|
|
style: alignStyle
|
|
}, content);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/Popup/Mask.js
|
|
|
|
|
|
|
|
|
|
function Mask(props) {
|
|
var prefixCls = props.prefixCls,
|
|
open = props.open,
|
|
zIndex = props.zIndex,
|
|
mask = props.mask,
|
|
motion = props.motion;
|
|
if (!mask) {
|
|
return null;
|
|
}
|
|
return /*#__PURE__*/react.createElement(rc_motion_es, (0,esm_extends/* default */.Z)({}, motion, {
|
|
motionAppear: true,
|
|
visible: open,
|
|
removeOnLeave: true
|
|
}), function (_ref) {
|
|
var className = _ref.className;
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
style: {
|
|
zIndex: zIndex
|
|
},
|
|
className: classnames_default()("".concat(prefixCls, "-mask"), className)
|
|
});
|
|
});
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/Popup/PopupContent.js
|
|
|
|
var PopupContent = /*#__PURE__*/react.memo(function (_ref) {
|
|
var children = _ref.children;
|
|
return children;
|
|
}, function (_, next) {
|
|
return next.cache;
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var Popup_PopupContent = (PopupContent);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/Popup/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Popup = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var popup = props.popup,
|
|
className = props.className,
|
|
prefixCls = props.prefixCls,
|
|
style = props.style,
|
|
target = props.target,
|
|
_onVisibleChanged = props.onVisibleChanged,
|
|
open = props.open,
|
|
keepDom = props.keepDom,
|
|
onClick = props.onClick,
|
|
mask = props.mask,
|
|
arrow = props.arrow,
|
|
arrowPos = props.arrowPos,
|
|
align = props.align,
|
|
motion = props.motion,
|
|
maskMotion = props.maskMotion,
|
|
forceRender = props.forceRender,
|
|
getPopupContainer = props.getPopupContainer,
|
|
autoDestroy = props.autoDestroy,
|
|
Portal = props.portal,
|
|
zIndex = props.zIndex,
|
|
onMouseEnter = props.onMouseEnter,
|
|
onMouseLeave = props.onMouseLeave,
|
|
ready = props.ready,
|
|
offsetX = props.offsetX,
|
|
offsetY = props.offsetY,
|
|
offsetR = props.offsetR,
|
|
offsetB = props.offsetB,
|
|
onAlign = props.onAlign,
|
|
onPrepare = props.onPrepare,
|
|
stretch = props.stretch,
|
|
targetWidth = props.targetWidth,
|
|
targetHeight = props.targetHeight;
|
|
var childNode = typeof popup === 'function' ? popup() : popup;
|
|
|
|
// We can not remove holder only when motion finished.
|
|
var isNodeVisible = open || keepDom;
|
|
|
|
// ======================= Container ========================
|
|
var getPopupContainerNeedParams = (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.length) > 0;
|
|
var _React$useState = react.useState(!getPopupContainer || !getPopupContainerNeedParams),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
show = _React$useState2[0],
|
|
setShow = _React$useState2[1];
|
|
|
|
// Delay to show since `getPopupContainer` need target element
|
|
rc_util_es_hooks_useLayoutEffect(function () {
|
|
if (!show && getPopupContainerNeedParams && target) {
|
|
setShow(true);
|
|
}
|
|
}, [show, getPopupContainerNeedParams, target]);
|
|
|
|
// ========================= Render =========================
|
|
if (!show) {
|
|
return null;
|
|
}
|
|
|
|
// >>>>> Offset
|
|
var AUTO = 'auto';
|
|
var offsetStyle = {
|
|
left: '-1000vw',
|
|
top: '-1000vh',
|
|
right: AUTO,
|
|
bottom: AUTO
|
|
};
|
|
|
|
// Set align style
|
|
if (ready || !open) {
|
|
var points = align.points,
|
|
_experimental = align._experimental;
|
|
var dynamicInset = _experimental === null || _experimental === void 0 ? void 0 : _experimental.dynamicInset;
|
|
var alignRight = dynamicInset && points[0][1] === 'r';
|
|
var alignBottom = dynamicInset && points[0][0] === 'b';
|
|
if (alignRight) {
|
|
offsetStyle.right = offsetR;
|
|
offsetStyle.left = AUTO;
|
|
} else {
|
|
offsetStyle.left = offsetX;
|
|
offsetStyle.right = AUTO;
|
|
}
|
|
if (alignBottom) {
|
|
offsetStyle.bottom = offsetB;
|
|
offsetStyle.top = AUTO;
|
|
} else {
|
|
offsetStyle.top = offsetY;
|
|
offsetStyle.bottom = AUTO;
|
|
}
|
|
}
|
|
|
|
// >>>>> Misc
|
|
var miscStyle = {};
|
|
if (stretch) {
|
|
if (stretch.includes('height') && targetHeight) {
|
|
miscStyle.height = targetHeight;
|
|
} else if (stretch.includes('minHeight') && targetHeight) {
|
|
miscStyle.minHeight = targetHeight;
|
|
}
|
|
if (stretch.includes('width') && targetWidth) {
|
|
miscStyle.width = targetWidth;
|
|
} else if (stretch.includes('minWidth') && targetWidth) {
|
|
miscStyle.minWidth = targetWidth;
|
|
}
|
|
}
|
|
if (!open) {
|
|
miscStyle.pointerEvents = 'none';
|
|
}
|
|
return /*#__PURE__*/react.createElement(Portal, {
|
|
open: forceRender || isNodeVisible,
|
|
getContainer: getPopupContainer && function () {
|
|
return getPopupContainer(target);
|
|
},
|
|
autoDestroy: autoDestroy
|
|
}, /*#__PURE__*/react.createElement(Mask, {
|
|
prefixCls: prefixCls,
|
|
open: open,
|
|
zIndex: zIndex,
|
|
mask: mask,
|
|
motion: maskMotion
|
|
}), /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
onResize: onAlign,
|
|
disabled: !open
|
|
}, function (resizeObserverRef) {
|
|
return /*#__PURE__*/react.createElement(rc_motion_es, (0,esm_extends/* default */.Z)({
|
|
motionAppear: true,
|
|
motionEnter: true,
|
|
motionLeave: true,
|
|
removeOnLeave: false,
|
|
forceRender: forceRender,
|
|
leavedClassName: "".concat(prefixCls, "-hidden")
|
|
}, motion, {
|
|
onAppearPrepare: onPrepare,
|
|
onEnterPrepare: onPrepare,
|
|
visible: open,
|
|
onVisibleChanged: function onVisibleChanged(nextVisible) {
|
|
var _motion$onVisibleChan;
|
|
motion === null || motion === void 0 ? void 0 : (_motion$onVisibleChan = motion.onVisibleChanged) === null || _motion$onVisibleChan === void 0 ? void 0 : _motion$onVisibleChan.call(motion, nextVisible);
|
|
_onVisibleChanged(nextVisible);
|
|
}
|
|
}), function (_ref, motionRef) {
|
|
var motionClassName = _ref.className,
|
|
motionStyle = _ref.style;
|
|
var cls = classnames_default()(prefixCls, motionClassName, className);
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
ref: ref_composeRef(resizeObserverRef, ref, motionRef),
|
|
className: cls,
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({
|
|
'--arrow-x': "".concat(arrowPos.x || 0, "px"),
|
|
'--arrow-y': "".concat(arrowPos.y || 0, "px")
|
|
}, offsetStyle), miscStyle), motionStyle), {}, {
|
|
boxSizing: 'border-box',
|
|
zIndex: zIndex
|
|
}, style),
|
|
onMouseEnter: onMouseEnter,
|
|
onMouseLeave: onMouseLeave,
|
|
onClick: onClick
|
|
}, arrow && /*#__PURE__*/react.createElement(Arrow, {
|
|
prefixCls: prefixCls,
|
|
arrow: arrow,
|
|
arrowPos: arrowPos,
|
|
align: align
|
|
}), /*#__PURE__*/react.createElement(Popup_PopupContent, {
|
|
cache: !open
|
|
}, childNode));
|
|
});
|
|
}));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var es_Popup = (Popup);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/TriggerWrapper.js
|
|
|
|
|
|
var TriggerWrapper = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var children = props.children,
|
|
getTriggerDOMNode = props.getTriggerDOMNode;
|
|
var canUseRef = ref_supportRef(children);
|
|
|
|
// When use `getTriggerDOMNode`, we should do additional work to get the real dom
|
|
var setRef = react.useCallback(function (node) {
|
|
ref_fillRef(ref, getTriggerDOMNode ? getTriggerDOMNode(node) : node);
|
|
}, [getTriggerDOMNode]);
|
|
var mergedRef = ref_useComposeRef(setRef, children.ref);
|
|
return canUseRef ? /*#__PURE__*/react.cloneElement(children, {
|
|
ref: mergedRef
|
|
}) : children;
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var es_TriggerWrapper = (TriggerWrapper);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/@rc-component/trigger/es/index.js
|
|
|
|
|
|
|
|
var es_excluded = ["prefixCls", "children", "action", "showAction", "hideAction", "popupVisible", "defaultPopupVisible", "onPopupVisibleChange", "afterPopupVisibleChange", "mouseEnterDelay", "mouseLeaveDelay", "focusDelay", "blurDelay", "mask", "maskClosable", "getPopupContainer", "forceRender", "autoDestroy", "destroyPopupOnHide", "popup", "popupClassName", "popupStyle", "popupPlacement", "builtinPlacements", "popupAlign", "zIndex", "stretch", "getPopupClassNameFromAlign", "alignPoint", "onPopupClick", "onPopupAlign", "arrow", "popupMotion", "maskMotion", "popupTransitionName", "popupAnimation", "maskTransitionName", "maskAnimation", "className", "getTriggerDOMNode"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Removed Props List
|
|
// Seems this can be auto
|
|
// getDocument?: (element?: HTMLElement) => Document;
|
|
// New version will not wrap popup with `rc-trigger-popup-content` when multiple children
|
|
function generateTrigger() {
|
|
var PortalComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : portal_es;
|
|
var Trigger = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var _props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-trigger-popup' : _props$prefixCls,
|
|
children = props.children,
|
|
_props$action = props.action,
|
|
action = _props$action === void 0 ? 'hover' : _props$action,
|
|
showAction = props.showAction,
|
|
hideAction = props.hideAction,
|
|
popupVisible = props.popupVisible,
|
|
defaultPopupVisible = props.defaultPopupVisible,
|
|
onPopupVisibleChange = props.onPopupVisibleChange,
|
|
afterPopupVisibleChange = props.afterPopupVisibleChange,
|
|
mouseEnterDelay = props.mouseEnterDelay,
|
|
_props$mouseLeaveDela = props.mouseLeaveDelay,
|
|
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
|
|
focusDelay = props.focusDelay,
|
|
blurDelay = props.blurDelay,
|
|
mask = props.mask,
|
|
_props$maskClosable = props.maskClosable,
|
|
maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
|
|
getPopupContainer = props.getPopupContainer,
|
|
forceRender = props.forceRender,
|
|
autoDestroy = props.autoDestroy,
|
|
destroyPopupOnHide = props.destroyPopupOnHide,
|
|
popup = props.popup,
|
|
popupClassName = props.popupClassName,
|
|
popupStyle = props.popupStyle,
|
|
popupPlacement = props.popupPlacement,
|
|
_props$builtinPlaceme = props.builtinPlacements,
|
|
builtinPlacements = _props$builtinPlaceme === void 0 ? {} : _props$builtinPlaceme,
|
|
popupAlign = props.popupAlign,
|
|
zIndex = props.zIndex,
|
|
stretch = props.stretch,
|
|
getPopupClassNameFromAlign = props.getPopupClassNameFromAlign,
|
|
alignPoint = props.alignPoint,
|
|
onPopupClick = props.onPopupClick,
|
|
onPopupAlign = props.onPopupAlign,
|
|
arrow = props.arrow,
|
|
popupMotion = props.popupMotion,
|
|
maskMotion = props.maskMotion,
|
|
popupTransitionName = props.popupTransitionName,
|
|
popupAnimation = props.popupAnimation,
|
|
maskTransitionName = props.maskTransitionName,
|
|
maskAnimation = props.maskAnimation,
|
|
className = props.className,
|
|
getTriggerDOMNode = props.getTriggerDOMNode,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, es_excluded);
|
|
var mergedAutoDestroy = autoDestroy || destroyPopupOnHide || false;
|
|
|
|
// =========================== Mobile ===========================
|
|
var _React$useState = react.useState(false),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
mobile = _React$useState2[0],
|
|
setMobile = _React$useState2[1];
|
|
rc_util_es_hooks_useLayoutEffect(function () {
|
|
setMobile(es_isMobile());
|
|
}, []);
|
|
|
|
// ========================== Context ===========================
|
|
var subPopupElements = react.useRef({});
|
|
var parentContext = react.useContext(es_context);
|
|
var context = react.useMemo(function () {
|
|
return {
|
|
registerSubPopup: function registerSubPopup(id, subPopupEle) {
|
|
subPopupElements.current[id] = subPopupEle;
|
|
parentContext === null || parentContext === void 0 ? void 0 : parentContext.registerSubPopup(id, subPopupEle);
|
|
}
|
|
};
|
|
}, [parentContext]);
|
|
|
|
// =========================== Popup ============================
|
|
var id = useId();
|
|
var _React$useState3 = react.useState(null),
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
popupEle = _React$useState4[0],
|
|
setPopupEle = _React$useState4[1];
|
|
var setPopupRef = es_hooks_useEvent_useEvent(function (node) {
|
|
if (isDOM(node) && popupEle !== node) {
|
|
setPopupEle(node);
|
|
}
|
|
parentContext === null || parentContext === void 0 ? void 0 : parentContext.registerSubPopup(id, node);
|
|
});
|
|
|
|
// =========================== Target ===========================
|
|
// Use state to control here since `useRef` update not trigger render
|
|
var _React$useState5 = react.useState(null),
|
|
_React$useState6 = (0,slicedToArray/* default */.Z)(_React$useState5, 2),
|
|
targetEle = _React$useState6[0],
|
|
setTargetEle = _React$useState6[1];
|
|
var setTargetRef = es_hooks_useEvent_useEvent(function (node) {
|
|
if (isDOM(node) && targetEle !== node) {
|
|
setTargetEle(node);
|
|
}
|
|
});
|
|
|
|
// ========================== Children ==========================
|
|
var child = react.Children.only(children);
|
|
var originChildProps = (child === null || child === void 0 ? void 0 : child.props) || {};
|
|
var cloneProps = {};
|
|
var inPopupOrChild = es_hooks_useEvent_useEvent(function (ele) {
|
|
var _getShadowRoot, _getShadowRoot2;
|
|
var childDOM = targetEle;
|
|
return (childDOM === null || childDOM === void 0 ? void 0 : childDOM.contains(ele)) || ((_getShadowRoot = getShadowRoot(childDOM)) === null || _getShadowRoot === void 0 ? void 0 : _getShadowRoot.host) === ele || ele === childDOM || (popupEle === null || popupEle === void 0 ? void 0 : popupEle.contains(ele)) || ((_getShadowRoot2 = getShadowRoot(popupEle)) === null || _getShadowRoot2 === void 0 ? void 0 : _getShadowRoot2.host) === ele || ele === popupEle || Object.values(subPopupElements.current).some(function (subPopupEle) {
|
|
return (subPopupEle === null || subPopupEle === void 0 ? void 0 : subPopupEle.contains(ele)) || ele === subPopupEle;
|
|
});
|
|
});
|
|
|
|
// =========================== Motion ===========================
|
|
var mergePopupMotion = getMotion(prefixCls, popupMotion, popupAnimation, popupTransitionName);
|
|
var mergeMaskMotion = getMotion(prefixCls, maskMotion, maskAnimation, maskTransitionName);
|
|
|
|
// ============================ Open ============================
|
|
var _React$useState7 = react.useState(defaultPopupVisible || false),
|
|
_React$useState8 = (0,slicedToArray/* default */.Z)(_React$useState7, 2),
|
|
internalOpen = _React$useState8[0],
|
|
setInternalOpen = _React$useState8[1];
|
|
|
|
// Render still use props as first priority
|
|
var mergedOpen = popupVisible !== null && popupVisible !== void 0 ? popupVisible : internalOpen;
|
|
|
|
// We use effect sync here in case `popupVisible` back to `undefined`
|
|
var setMergedOpen = es_hooks_useEvent_useEvent(function (nextOpen) {
|
|
if (popupVisible === undefined) {
|
|
setInternalOpen(nextOpen);
|
|
}
|
|
});
|
|
rc_util_es_hooks_useLayoutEffect(function () {
|
|
setInternalOpen(popupVisible || false);
|
|
}, [popupVisible]);
|
|
var openRef = react.useRef(mergedOpen);
|
|
openRef.current = mergedOpen;
|
|
var internalTriggerOpen = es_hooks_useEvent_useEvent(function (nextOpen) {
|
|
if (mergedOpen !== nextOpen) {
|
|
setMergedOpen(nextOpen);
|
|
onPopupVisibleChange === null || onPopupVisibleChange === void 0 ? void 0 : onPopupVisibleChange(nextOpen);
|
|
}
|
|
});
|
|
|
|
// Trigger for delay
|
|
var delayRef = react.useRef();
|
|
var clearDelay = function clearDelay() {
|
|
clearTimeout(delayRef.current);
|
|
};
|
|
var triggerOpen = function triggerOpen(nextOpen) {
|
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
clearDelay();
|
|
if (delay === 0) {
|
|
internalTriggerOpen(nextOpen);
|
|
} else {
|
|
delayRef.current = setTimeout(function () {
|
|
internalTriggerOpen(nextOpen);
|
|
}, delay * 1000);
|
|
}
|
|
};
|
|
react.useEffect(function () {
|
|
return clearDelay;
|
|
}, []);
|
|
|
|
// ========================== Motion ============================
|
|
var _React$useState9 = react.useState(false),
|
|
_React$useState10 = (0,slicedToArray/* default */.Z)(_React$useState9, 2),
|
|
inMotion = _React$useState10[0],
|
|
setInMotion = _React$useState10[1];
|
|
rc_util_es_hooks_useLayoutEffect(function (firstMount) {
|
|
if (!firstMount || mergedOpen) {
|
|
setInMotion(true);
|
|
}
|
|
}, [mergedOpen]);
|
|
var _React$useState11 = react.useState(null),
|
|
_React$useState12 = (0,slicedToArray/* default */.Z)(_React$useState11, 2),
|
|
motionPrepareResolve = _React$useState12[0],
|
|
setMotionPrepareResolve = _React$useState12[1];
|
|
|
|
// =========================== Align ============================
|
|
var _React$useState13 = react.useState([0, 0]),
|
|
_React$useState14 = (0,slicedToArray/* default */.Z)(_React$useState13, 2),
|
|
mousePos = _React$useState14[0],
|
|
setMousePos = _React$useState14[1];
|
|
var setMousePosByEvent = function setMousePosByEvent(event) {
|
|
setMousePos([event.clientX, event.clientY]);
|
|
};
|
|
var _useAlign = useAlign(mergedOpen, popupEle, alignPoint ? mousePos : targetEle, popupPlacement, builtinPlacements, popupAlign, onPopupAlign),
|
|
_useAlign2 = (0,slicedToArray/* default */.Z)(_useAlign, 11),
|
|
ready = _useAlign2[0],
|
|
offsetX = _useAlign2[1],
|
|
offsetY = _useAlign2[2],
|
|
offsetR = _useAlign2[3],
|
|
offsetB = _useAlign2[4],
|
|
arrowX = _useAlign2[5],
|
|
arrowY = _useAlign2[6],
|
|
scaleX = _useAlign2[7],
|
|
scaleY = _useAlign2[8],
|
|
alignInfo = _useAlign2[9],
|
|
onAlign = _useAlign2[10];
|
|
var triggerAlign = es_hooks_useEvent_useEvent(function () {
|
|
if (!inMotion) {
|
|
onAlign();
|
|
}
|
|
});
|
|
useWatch(mergedOpen, targetEle, popupEle, triggerAlign);
|
|
rc_util_es_hooks_useLayoutEffect(function () {
|
|
triggerAlign();
|
|
}, [mousePos, popupPlacement]);
|
|
|
|
// When no builtinPlacements and popupAlign changed
|
|
rc_util_es_hooks_useLayoutEffect(function () {
|
|
if (mergedOpen && !(builtinPlacements !== null && builtinPlacements !== void 0 && builtinPlacements[popupPlacement])) {
|
|
triggerAlign();
|
|
}
|
|
}, [JSON.stringify(popupAlign)]);
|
|
var alignedClassName = react.useMemo(function () {
|
|
var baseClassName = getAlignPopupClassName(builtinPlacements, prefixCls, alignInfo, alignPoint);
|
|
return classnames_default()(baseClassName, getPopupClassNameFromAlign === null || getPopupClassNameFromAlign === void 0 ? void 0 : getPopupClassNameFromAlign(alignInfo));
|
|
}, [alignInfo, getPopupClassNameFromAlign, builtinPlacements, prefixCls, alignPoint]);
|
|
react.useImperativeHandle(ref, function () {
|
|
return {
|
|
forceAlign: triggerAlign
|
|
};
|
|
});
|
|
|
|
// ========================== Motion ============================
|
|
var onVisibleChanged = function onVisibleChanged(visible) {
|
|
setInMotion(false);
|
|
onAlign();
|
|
afterPopupVisibleChange === null || afterPopupVisibleChange === void 0 ? void 0 : afterPopupVisibleChange(visible);
|
|
};
|
|
|
|
// We will trigger align when motion is in prepare
|
|
var onPrepare = function onPrepare() {
|
|
return new Promise(function (resolve) {
|
|
setMotionPrepareResolve(function () {
|
|
return resolve;
|
|
});
|
|
});
|
|
};
|
|
rc_util_es_hooks_useLayoutEffect(function () {
|
|
if (motionPrepareResolve) {
|
|
onAlign();
|
|
motionPrepareResolve();
|
|
setMotionPrepareResolve(null);
|
|
}
|
|
}, [motionPrepareResolve]);
|
|
|
|
// ========================== Stretch ===========================
|
|
var _React$useState15 = react.useState(0),
|
|
_React$useState16 = (0,slicedToArray/* default */.Z)(_React$useState15, 2),
|
|
targetWidth = _React$useState16[0],
|
|
setTargetWidth = _React$useState16[1];
|
|
var _React$useState17 = react.useState(0),
|
|
_React$useState18 = (0,slicedToArray/* default */.Z)(_React$useState17, 2),
|
|
targetHeight = _React$useState18[0],
|
|
setTargetHeight = _React$useState18[1];
|
|
var onTargetResize = function onTargetResize(_, ele) {
|
|
triggerAlign();
|
|
if (stretch) {
|
|
var rect = ele.getBoundingClientRect();
|
|
setTargetWidth(rect.width);
|
|
setTargetHeight(rect.height);
|
|
}
|
|
};
|
|
|
|
// =========================== Action ===========================
|
|
var _useAction = useAction(mobile, action, showAction, hideAction),
|
|
_useAction2 = (0,slicedToArray/* default */.Z)(_useAction, 2),
|
|
showActions = _useAction2[0],
|
|
hideActions = _useAction2[1];
|
|
|
|
// Util wrapper for trigger action
|
|
var wrapperAction = function wrapperAction(eventName, nextOpen, delay, preEvent) {
|
|
cloneProps[eventName] = function (event) {
|
|
var _originChildProps$eve;
|
|
preEvent === null || preEvent === void 0 ? void 0 : preEvent(event);
|
|
triggerOpen(nextOpen, delay);
|
|
|
|
// Pass to origin
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
(_originChildProps$eve = originChildProps[eventName]) === null || _originChildProps$eve === void 0 ? void 0 : _originChildProps$eve.call.apply(_originChildProps$eve, [originChildProps, event].concat(args));
|
|
};
|
|
};
|
|
|
|
// ======================= Action: Click ========================
|
|
var clickToShow = showActions.has('click');
|
|
var clickToHide = hideActions.has('click') || hideActions.has('contextMenu');
|
|
if (clickToShow || clickToHide) {
|
|
cloneProps.onClick = function (event) {
|
|
var _originChildProps$onC;
|
|
if (openRef.current && clickToHide) {
|
|
triggerOpen(false);
|
|
} else if (!openRef.current && clickToShow) {
|
|
setMousePosByEvent(event);
|
|
triggerOpen(true);
|
|
}
|
|
|
|
// Pass to origin
|
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
args[_key2 - 1] = arguments[_key2];
|
|
}
|
|
(_originChildProps$onC = originChildProps.onClick) === null || _originChildProps$onC === void 0 ? void 0 : _originChildProps$onC.call.apply(_originChildProps$onC, [originChildProps, event].concat(args));
|
|
};
|
|
}
|
|
|
|
// Click to hide is special action since click popup element should not hide
|
|
useWinClick(mergedOpen, clickToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen);
|
|
|
|
// ======================= Action: Hover ========================
|
|
var hoverToShow = showActions.has('hover');
|
|
var hoverToHide = hideActions.has('hover');
|
|
var onPopupMouseEnter;
|
|
var onPopupMouseLeave;
|
|
if (hoverToShow) {
|
|
wrapperAction('onMouseEnter', true, mouseEnterDelay, function (event) {
|
|
setMousePosByEvent(event);
|
|
});
|
|
onPopupMouseEnter = function onPopupMouseEnter() {
|
|
// Only trigger re-open when popup is visible
|
|
if (mergedOpen || inMotion) {
|
|
triggerOpen(true, mouseEnterDelay);
|
|
}
|
|
};
|
|
|
|
// Align Point
|
|
if (alignPoint) {
|
|
cloneProps.onMouseMove = function (event) {
|
|
var _originChildProps$onM;
|
|
// setMousePosByEvent(event);
|
|
(_originChildProps$onM = originChildProps.onMouseMove) === null || _originChildProps$onM === void 0 ? void 0 : _originChildProps$onM.call(originChildProps, event);
|
|
};
|
|
}
|
|
}
|
|
if (hoverToHide) {
|
|
wrapperAction('onMouseLeave', false, mouseLeaveDelay);
|
|
onPopupMouseLeave = function onPopupMouseLeave() {
|
|
triggerOpen(false, mouseLeaveDelay);
|
|
};
|
|
}
|
|
|
|
// ======================= Action: Focus ========================
|
|
if (showActions.has('focus')) {
|
|
wrapperAction('onFocus', true, focusDelay);
|
|
}
|
|
if (hideActions.has('focus')) {
|
|
wrapperAction('onBlur', false, blurDelay);
|
|
}
|
|
|
|
// ==================== Action: ContextMenu =====================
|
|
if (showActions.has('contextMenu')) {
|
|
cloneProps.onContextMenu = function (event) {
|
|
var _originChildProps$onC2;
|
|
if (openRef.current && hideActions.has('contextMenu')) {
|
|
triggerOpen(false);
|
|
} else {
|
|
setMousePosByEvent(event);
|
|
triggerOpen(true);
|
|
}
|
|
event.preventDefault();
|
|
|
|
// Pass to origin
|
|
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
args[_key3 - 1] = arguments[_key3];
|
|
}
|
|
(_originChildProps$onC2 = originChildProps.onContextMenu) === null || _originChildProps$onC2 === void 0 ? void 0 : _originChildProps$onC2.call.apply(_originChildProps$onC2, [originChildProps, event].concat(args));
|
|
};
|
|
}
|
|
|
|
// ========================= ClassName ==========================
|
|
if (className) {
|
|
cloneProps.className = classnames_default()(originChildProps.className, className);
|
|
}
|
|
|
|
// =========================== Render ===========================
|
|
var mergedChildrenProps = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, originChildProps), cloneProps);
|
|
|
|
// Pass props into cloneProps for nest usage
|
|
var passedProps = {};
|
|
var passedEventList = ['onContextMenu', 'onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur'];
|
|
passedEventList.forEach(function (eventName) {
|
|
if (restProps[eventName]) {
|
|
passedProps[eventName] = function () {
|
|
var _mergedChildrenProps$;
|
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
args[_key4] = arguments[_key4];
|
|
}
|
|
(_mergedChildrenProps$ = mergedChildrenProps[eventName]) === null || _mergedChildrenProps$ === void 0 ? void 0 : _mergedChildrenProps$.call.apply(_mergedChildrenProps$, [mergedChildrenProps].concat(args));
|
|
restProps[eventName].apply(restProps, args);
|
|
};
|
|
}
|
|
});
|
|
|
|
// Child Node
|
|
var triggerNode = /*#__PURE__*/react.cloneElement(child, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, mergedChildrenProps), passedProps));
|
|
var arrowPos = {
|
|
x: arrowX,
|
|
y: arrowY
|
|
};
|
|
var innerArrow = arrow ? (0,objectSpread2/* default */.Z)({}, arrow !== true ? arrow : {}) : null;
|
|
|
|
// Render
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
disabled: !mergedOpen,
|
|
ref: setTargetRef,
|
|
onResize: onTargetResize
|
|
}, /*#__PURE__*/react.createElement(es_TriggerWrapper, {
|
|
getTriggerDOMNode: getTriggerDOMNode
|
|
}, triggerNode)), /*#__PURE__*/react.createElement(es_context.Provider, {
|
|
value: context
|
|
}, /*#__PURE__*/react.createElement(es_Popup, {
|
|
portal: PortalComponent,
|
|
ref: setPopupRef,
|
|
prefixCls: prefixCls,
|
|
popup: popup,
|
|
className: classnames_default()(popupClassName, alignedClassName),
|
|
style: popupStyle,
|
|
target: targetEle,
|
|
onMouseEnter: onPopupMouseEnter,
|
|
onMouseLeave: onPopupMouseLeave,
|
|
zIndex: zIndex
|
|
// Open
|
|
,
|
|
open: mergedOpen,
|
|
keepDom: inMotion
|
|
// Click
|
|
,
|
|
onClick: onPopupClick
|
|
// Mask
|
|
,
|
|
mask: mask
|
|
// Motion
|
|
,
|
|
motion: mergePopupMotion,
|
|
maskMotion: mergeMaskMotion,
|
|
onVisibleChanged: onVisibleChanged,
|
|
onPrepare: onPrepare
|
|
// Portal
|
|
,
|
|
forceRender: forceRender,
|
|
autoDestroy: mergedAutoDestroy,
|
|
getPopupContainer: getPopupContainer
|
|
// Arrow
|
|
,
|
|
align: alignInfo,
|
|
arrow: innerArrow,
|
|
arrowPos: arrowPos
|
|
// Align
|
|
,
|
|
ready: ready,
|
|
offsetX: offsetX,
|
|
offsetY: offsetY,
|
|
offsetR: offsetR,
|
|
offsetB: offsetB,
|
|
onAlign: triggerAlign
|
|
// Stretch
|
|
,
|
|
stretch: stretch,
|
|
targetWidth: targetWidth / scaleX,
|
|
targetHeight: targetHeight / scaleY
|
|
})));
|
|
});
|
|
if (false) {}
|
|
return Trigger;
|
|
}
|
|
/* harmony default export */ var trigger_es = (generateTrigger(portal_es));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/SelectTrigger.js
|
|
|
|
|
|
|
|
|
|
var SelectTrigger_excluded = ["prefixCls", "disabled", "visible", "children", "popupElement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "builtinPlacements", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"];
|
|
|
|
|
|
|
|
var getBuiltInPlacements = function getBuiltInPlacements(dropdownMatchSelectWidth) {
|
|
// Enable horizontal overflow auto-adjustment when a custom dropdown width is provided
|
|
var adjustX = dropdownMatchSelectWidth === true ? 0 : 1;
|
|
return {
|
|
bottomLeft: {
|
|
points: ['tl', 'bl'],
|
|
offset: [0, 4],
|
|
overflow: {
|
|
adjustX: adjustX,
|
|
adjustY: 1
|
|
},
|
|
htmlRegion: 'scroll'
|
|
},
|
|
bottomRight: {
|
|
points: ['tr', 'br'],
|
|
offset: [0, 4],
|
|
overflow: {
|
|
adjustX: adjustX,
|
|
adjustY: 1
|
|
},
|
|
htmlRegion: 'scroll'
|
|
},
|
|
topLeft: {
|
|
points: ['bl', 'tl'],
|
|
offset: [0, -4],
|
|
overflow: {
|
|
adjustX: adjustX,
|
|
adjustY: 1
|
|
},
|
|
htmlRegion: 'scroll'
|
|
},
|
|
topRight: {
|
|
points: ['br', 'tr'],
|
|
offset: [0, -4],
|
|
overflow: {
|
|
adjustX: adjustX,
|
|
adjustY: 1
|
|
},
|
|
htmlRegion: 'scroll'
|
|
}
|
|
};
|
|
};
|
|
var SelectTrigger = function SelectTrigger(props, ref) {
|
|
var prefixCls = props.prefixCls,
|
|
disabled = props.disabled,
|
|
visible = props.visible,
|
|
children = props.children,
|
|
popupElement = props.popupElement,
|
|
animation = props.animation,
|
|
transitionName = props.transitionName,
|
|
dropdownStyle = props.dropdownStyle,
|
|
dropdownClassName = props.dropdownClassName,
|
|
_props$direction = props.direction,
|
|
direction = _props$direction === void 0 ? 'ltr' : _props$direction,
|
|
placement = props.placement,
|
|
builtinPlacements = props.builtinPlacements,
|
|
dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,
|
|
dropdownRender = props.dropdownRender,
|
|
dropdownAlign = props.dropdownAlign,
|
|
getPopupContainer = props.getPopupContainer,
|
|
empty = props.empty,
|
|
getTriggerDOMNode = props.getTriggerDOMNode,
|
|
onPopupVisibleChange = props.onPopupVisibleChange,
|
|
onPopupMouseEnter = props.onPopupMouseEnter,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, SelectTrigger_excluded);
|
|
var dropdownPrefixCls = "".concat(prefixCls, "-dropdown");
|
|
var popupNode = popupElement;
|
|
if (dropdownRender) {
|
|
popupNode = dropdownRender(popupElement);
|
|
}
|
|
var mergedBuiltinPlacements = react.useMemo(function () {
|
|
return builtinPlacements || getBuiltInPlacements(dropdownMatchSelectWidth);
|
|
}, [builtinPlacements, dropdownMatchSelectWidth]);
|
|
|
|
// ===================== Motion ======================
|
|
var mergedTransitionName = animation ? "".concat(dropdownPrefixCls, "-").concat(animation) : transitionName;
|
|
|
|
// =================== Popup Width ===================
|
|
var isNumberPopupWidth = typeof dropdownMatchSelectWidth === 'number';
|
|
var stretch = react.useMemo(function () {
|
|
if (isNumberPopupWidth) {
|
|
return null;
|
|
}
|
|
return dropdownMatchSelectWidth === false ? 'minWidth' : 'width';
|
|
}, [dropdownMatchSelectWidth, isNumberPopupWidth]);
|
|
var popupStyle = dropdownStyle;
|
|
if (isNumberPopupWidth) {
|
|
popupStyle = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, popupStyle), {}, {
|
|
width: dropdownMatchSelectWidth
|
|
});
|
|
}
|
|
|
|
// ======================= Ref =======================
|
|
var popupRef = react.useRef(null);
|
|
react.useImperativeHandle(ref, function () {
|
|
return {
|
|
getPopupElement: function getPopupElement() {
|
|
return popupRef.current;
|
|
}
|
|
};
|
|
});
|
|
return /*#__PURE__*/react.createElement(trigger_es, (0,esm_extends/* default */.Z)({}, restProps, {
|
|
showAction: onPopupVisibleChange ? ['click'] : [],
|
|
hideAction: onPopupVisibleChange ? ['click'] : [],
|
|
popupPlacement: placement || (direction === 'rtl' ? 'bottomRight' : 'bottomLeft'),
|
|
builtinPlacements: mergedBuiltinPlacements,
|
|
prefixCls: dropdownPrefixCls,
|
|
popupTransitionName: mergedTransitionName,
|
|
popup: /*#__PURE__*/react.createElement("div", {
|
|
ref: popupRef,
|
|
onMouseEnter: onPopupMouseEnter
|
|
}, popupNode),
|
|
stretch: stretch,
|
|
popupAlign: dropdownAlign,
|
|
popupVisible: visible,
|
|
getPopupContainer: getPopupContainer,
|
|
popupClassName: classnames_default()(dropdownClassName, (0,defineProperty/* default */.Z)({}, "".concat(dropdownPrefixCls, "-empty"), empty)),
|
|
popupStyle: popupStyle,
|
|
getTriggerDOMNode: getTriggerDOMNode,
|
|
onPopupVisibleChange: onPopupVisibleChange
|
|
}), children);
|
|
};
|
|
var RefSelectTrigger = /*#__PURE__*/react.forwardRef(SelectTrigger);
|
|
RefSelectTrigger.displayName = 'SelectTrigger';
|
|
/* harmony default export */ var es_SelectTrigger = (RefSelectTrigger);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toArray.js
|
|
var esm_toArray = __webpack_require__(84506);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/utils/valueUtil.js
|
|
|
|
|
|
|
|
|
|
function getKey(data, index) {
|
|
var key = data.key;
|
|
var value;
|
|
if ('value' in data) {
|
|
value = data.value;
|
|
}
|
|
if (key !== null && key !== undefined) {
|
|
return key;
|
|
}
|
|
if (value !== undefined) {
|
|
return value;
|
|
}
|
|
return "rc-index-key-".concat(index);
|
|
}
|
|
function fillFieldNames(fieldNames, childrenAsData) {
|
|
var _ref = fieldNames || {},
|
|
label = _ref.label,
|
|
value = _ref.value,
|
|
options = _ref.options,
|
|
groupLabel = _ref.groupLabel;
|
|
var mergedLabel = label || (childrenAsData ? 'children' : 'label');
|
|
return {
|
|
label: mergedLabel,
|
|
value: value || 'value',
|
|
options: options || 'options',
|
|
groupLabel: groupLabel || mergedLabel
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Flat options into flatten list.
|
|
* We use `optionOnly` here is aim to avoid user use nested option group.
|
|
* Here is simply set `key` to the index if not provided.
|
|
*/
|
|
function flattenOptions(options) {
|
|
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
fieldNames = _ref2.fieldNames,
|
|
childrenAsData = _ref2.childrenAsData;
|
|
var flattenList = [];
|
|
var _fillFieldNames = fillFieldNames(fieldNames, false),
|
|
fieldLabel = _fillFieldNames.label,
|
|
fieldValue = _fillFieldNames.value,
|
|
fieldOptions = _fillFieldNames.options,
|
|
groupLabel = _fillFieldNames.groupLabel;
|
|
function dig(list, isGroupOption) {
|
|
list.forEach(function (data) {
|
|
if (isGroupOption || !(fieldOptions in data)) {
|
|
var value = data[fieldValue];
|
|
|
|
// Option
|
|
flattenList.push({
|
|
key: getKey(data, flattenList.length),
|
|
groupOption: isGroupOption,
|
|
data: data,
|
|
label: data[fieldLabel],
|
|
value: value
|
|
});
|
|
} else {
|
|
var grpLabel = data[groupLabel];
|
|
if (grpLabel === undefined && childrenAsData) {
|
|
grpLabel = data.label;
|
|
}
|
|
|
|
// Option Group
|
|
flattenList.push({
|
|
key: getKey(data, flattenList.length),
|
|
group: true,
|
|
data: data,
|
|
label: grpLabel
|
|
});
|
|
dig(data[fieldOptions], true);
|
|
}
|
|
});
|
|
}
|
|
dig(options, false);
|
|
return flattenList;
|
|
}
|
|
|
|
/**
|
|
* Inject `props` into `option` for legacy usage
|
|
*/
|
|
function injectPropsWithOption(option) {
|
|
var newOption = (0,objectSpread2/* default */.Z)({}, option);
|
|
if (!('props' in newOption)) {
|
|
Object.defineProperty(newOption, 'props', {
|
|
get: function get() {
|
|
es_warning(false, 'Return type is option instead of Option instance. Please read value directly instead of reading from `props`.');
|
|
return newOption;
|
|
}
|
|
});
|
|
}
|
|
return newOption;
|
|
}
|
|
function getSeparatedContent(text, tokens) {
|
|
if (!tokens || !tokens.length) {
|
|
return null;
|
|
}
|
|
var match = false;
|
|
function separate(str, _ref3) {
|
|
var _ref4 = (0,esm_toArray/* default */.Z)(_ref3),
|
|
token = _ref4[0],
|
|
restTokens = _ref4.slice(1);
|
|
if (!token) {
|
|
return [str];
|
|
}
|
|
var list = str.split(token);
|
|
match = match || list.length > 1;
|
|
return list.reduce(function (prevList, unitStr) {
|
|
return [].concat((0,toConsumableArray/* default */.Z)(prevList), (0,toConsumableArray/* default */.Z)(separate(unitStr, restTokens)));
|
|
}, []).filter(function (unit) {
|
|
return unit;
|
|
});
|
|
}
|
|
var list = separate(text, tokens);
|
|
return match ? list : null;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/BaseSelect.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var BaseSelect_excluded = ["id", "prefixCls", "className", "showSearch", "tagRender", "direction", "omitDomProps", "displayValues", "onDisplayValuesChange", "emptyOptions", "notFoundContent", "onClear", "mode", "disabled", "loading", "getInputElement", "getRawInputElement", "open", "defaultOpen", "onDropdownVisibleChange", "activeValue", "onActiveValueChange", "activeDescendantId", "searchValue", "autoClearSearchValue", "onSearch", "onSearchSplit", "tokenSeparators", "allowClear", "suffixIcon", "clearIcon", "OptionList", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "placement", "builtinPlacements", "getPopupContainer", "showAction", "onFocus", "onBlur", "onKeyUp", "onKeyDown", "onMouseDown"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DEFAULT_OMIT_PROPS = ['value', 'onChange', 'removeIcon', 'placeholder', 'autoFocus', 'maxTagCount', 'maxTagTextLength', 'maxTagPlaceholder', 'choiceTransitionName', 'onInputKeyDown', 'onPopupScroll', 'tabIndex'];
|
|
function BaseSelect_isMultiple(mode) {
|
|
return mode === 'tags' || mode === 'multiple';
|
|
}
|
|
var BaseSelect = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var _customizeRawInputEle, _classNames2;
|
|
var id = props.id,
|
|
prefixCls = props.prefixCls,
|
|
className = props.className,
|
|
showSearch = props.showSearch,
|
|
tagRender = props.tagRender,
|
|
direction = props.direction,
|
|
omitDomProps = props.omitDomProps,
|
|
displayValues = props.displayValues,
|
|
onDisplayValuesChange = props.onDisplayValuesChange,
|
|
emptyOptions = props.emptyOptions,
|
|
_props$notFoundConten = props.notFoundContent,
|
|
notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,
|
|
onClear = props.onClear,
|
|
mode = props.mode,
|
|
disabled = props.disabled,
|
|
loading = props.loading,
|
|
getInputElement = props.getInputElement,
|
|
getRawInputElement = props.getRawInputElement,
|
|
open = props.open,
|
|
defaultOpen = props.defaultOpen,
|
|
onDropdownVisibleChange = props.onDropdownVisibleChange,
|
|
activeValue = props.activeValue,
|
|
onActiveValueChange = props.onActiveValueChange,
|
|
activeDescendantId = props.activeDescendantId,
|
|
searchValue = props.searchValue,
|
|
autoClearSearchValue = props.autoClearSearchValue,
|
|
onSearch = props.onSearch,
|
|
onSearchSplit = props.onSearchSplit,
|
|
tokenSeparators = props.tokenSeparators,
|
|
allowClear = props.allowClear,
|
|
suffixIcon = props.suffixIcon,
|
|
clearIcon = props.clearIcon,
|
|
OptionList = props.OptionList,
|
|
animation = props.animation,
|
|
transitionName = props.transitionName,
|
|
dropdownStyle = props.dropdownStyle,
|
|
dropdownClassName = props.dropdownClassName,
|
|
dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,
|
|
dropdownRender = props.dropdownRender,
|
|
dropdownAlign = props.dropdownAlign,
|
|
placement = props.placement,
|
|
builtinPlacements = props.builtinPlacements,
|
|
getPopupContainer = props.getPopupContainer,
|
|
_props$showAction = props.showAction,
|
|
showAction = _props$showAction === void 0 ? [] : _props$showAction,
|
|
onFocus = props.onFocus,
|
|
onBlur = props.onBlur,
|
|
onKeyUp = props.onKeyUp,
|
|
onKeyDown = props.onKeyDown,
|
|
onMouseDown = props.onMouseDown,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, BaseSelect_excluded);
|
|
|
|
// ============================== MISC ==============================
|
|
var multiple = BaseSelect_isMultiple(mode);
|
|
var mergedShowSearch = (showSearch !== undefined ? showSearch : multiple) || mode === 'combobox';
|
|
var domProps = (0,objectSpread2/* default */.Z)({}, restProps);
|
|
DEFAULT_OMIT_PROPS.forEach(function (propName) {
|
|
delete domProps[propName];
|
|
});
|
|
omitDomProps === null || omitDomProps === void 0 ? void 0 : omitDomProps.forEach(function (propName) {
|
|
delete domProps[propName];
|
|
});
|
|
|
|
// ============================= Mobile =============================
|
|
var _React$useState = react.useState(false),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
mobile = _React$useState2[0],
|
|
setMobile = _React$useState2[1];
|
|
react.useEffect(function () {
|
|
// Only update on the client side
|
|
setMobile(isMobile());
|
|
}, []);
|
|
|
|
// ============================== Refs ==============================
|
|
var containerRef = react.useRef(null);
|
|
var selectorDomRef = react.useRef(null);
|
|
var triggerRef = react.useRef(null);
|
|
var selectorRef = react.useRef(null);
|
|
var listRef = react.useRef(null);
|
|
|
|
/** Used for component focused management */
|
|
var _useDelayReset = useDelayReset(),
|
|
_useDelayReset2 = (0,slicedToArray/* default */.Z)(_useDelayReset, 3),
|
|
mockFocused = _useDelayReset2[0],
|
|
setMockFocused = _useDelayReset2[1],
|
|
cancelSetMockFocused = _useDelayReset2[2];
|
|
|
|
// =========================== Imperative ===========================
|
|
react.useImperativeHandle(ref, function () {
|
|
var _selectorRef$current, _selectorRef$current2;
|
|
return {
|
|
focus: (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.focus,
|
|
blur: (_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 ? void 0 : _selectorRef$current2.blur,
|
|
scrollTo: function scrollTo(arg) {
|
|
var _listRef$current;
|
|
return (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(arg);
|
|
}
|
|
};
|
|
});
|
|
|
|
// ========================== Search Value ==========================
|
|
var mergedSearchValue = react.useMemo(function () {
|
|
var _displayValues$;
|
|
if (mode !== 'combobox') {
|
|
return searchValue;
|
|
}
|
|
var val = (_displayValues$ = displayValues[0]) === null || _displayValues$ === void 0 ? void 0 : _displayValues$.value;
|
|
return typeof val === 'string' || typeof val === 'number' ? String(val) : '';
|
|
}, [searchValue, mode, displayValues]);
|
|
|
|
// ========================== Custom Input ==========================
|
|
// Only works in `combobox`
|
|
var customizeInputElement = mode === 'combobox' && typeof getInputElement === 'function' && getInputElement() || null;
|
|
|
|
// Used for customize replacement for `rc-cascader`
|
|
var customizeRawInputElement = typeof getRawInputElement === 'function' && getRawInputElement();
|
|
var customizeRawInputRef = useComposeRef(selectorDomRef, customizeRawInputElement === null || customizeRawInputElement === void 0 ? void 0 : (_customizeRawInputEle = customizeRawInputElement.props) === null || _customizeRawInputEle === void 0 ? void 0 : _customizeRawInputEle.ref);
|
|
|
|
// ============================== Open ==============================
|
|
// SSR not support Portal which means we need delay `open` for the first time render
|
|
var _React$useState3 = react.useState(false),
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
rendered = _React$useState4[0],
|
|
setRendered = _React$useState4[1];
|
|
hooks_useLayoutEffect(function () {
|
|
setRendered(true);
|
|
}, []);
|
|
var _useMergedState = useMergedState(false, {
|
|
defaultValue: defaultOpen,
|
|
value: open
|
|
}),
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
innerOpen = _useMergedState2[0],
|
|
setInnerOpen = _useMergedState2[1];
|
|
var mergedOpen = rendered ? innerOpen : false;
|
|
|
|
// Not trigger `open` in `combobox` when `notFoundContent` is empty
|
|
var emptyListContent = !notFoundContent && emptyOptions;
|
|
if (disabled || emptyListContent && mergedOpen && mode === 'combobox') {
|
|
mergedOpen = false;
|
|
}
|
|
var triggerOpen = emptyListContent ? false : mergedOpen;
|
|
var onToggleOpen = react.useCallback(function (newOpen) {
|
|
var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;
|
|
if (!disabled) {
|
|
setInnerOpen(nextOpen);
|
|
if (mergedOpen !== nextOpen) {
|
|
onDropdownVisibleChange === null || onDropdownVisibleChange === void 0 ? void 0 : onDropdownVisibleChange(nextOpen);
|
|
}
|
|
}
|
|
}, [disabled, mergedOpen, setInnerOpen, onDropdownVisibleChange]);
|
|
|
|
// ============================= Search =============================
|
|
var tokenWithEnter = react.useMemo(function () {
|
|
return (tokenSeparators || []).some(function (tokenSeparator) {
|
|
return ['\n', '\r\n'].includes(tokenSeparator);
|
|
});
|
|
}, [tokenSeparators]);
|
|
var onInternalSearch = function onInternalSearch(searchText, fromTyping, isCompositing) {
|
|
var ret = true;
|
|
var newSearchText = searchText;
|
|
onActiveValueChange === null || onActiveValueChange === void 0 ? void 0 : onActiveValueChange(null);
|
|
|
|
// Check if match the `tokenSeparators`
|
|
var patchLabels = isCompositing ? null : getSeparatedContent(searchText, tokenSeparators);
|
|
|
|
// Ignore combobox since it's not split-able
|
|
if (mode !== 'combobox' && patchLabels) {
|
|
newSearchText = '';
|
|
onSearchSplit === null || onSearchSplit === void 0 ? void 0 : onSearchSplit(patchLabels);
|
|
|
|
// Should close when paste finish
|
|
onToggleOpen(false);
|
|
|
|
// Tell Selector that break next actions
|
|
ret = false;
|
|
}
|
|
if (onSearch && mergedSearchValue !== newSearchText) {
|
|
onSearch(newSearchText, {
|
|
source: fromTyping ? 'typing' : 'effect'
|
|
});
|
|
}
|
|
return ret;
|
|
};
|
|
|
|
// Only triggered when menu is closed & mode is tags
|
|
// If menu is open, OptionList will take charge
|
|
// If mode isn't tags, press enter is not meaningful when you can't see any option
|
|
var onInternalSearchSubmit = function onInternalSearchSubmit(searchText) {
|
|
// prevent empty tags from appearing when you click the Enter button
|
|
if (!searchText || !searchText.trim()) {
|
|
return;
|
|
}
|
|
onSearch(searchText, {
|
|
source: 'submit'
|
|
});
|
|
};
|
|
|
|
// Close will clean up single mode search text
|
|
react.useEffect(function () {
|
|
if (!mergedOpen && !multiple && mode !== 'combobox') {
|
|
onInternalSearch('', false, false);
|
|
}
|
|
}, [mergedOpen]);
|
|
|
|
// ============================ Disabled ============================
|
|
// Close dropdown & remove focus state when disabled change
|
|
react.useEffect(function () {
|
|
if (innerOpen && disabled) {
|
|
setInnerOpen(false);
|
|
}
|
|
if (disabled) {
|
|
setMockFocused(false);
|
|
}
|
|
}, [disabled]);
|
|
|
|
// ============================ Keyboard ============================
|
|
/**
|
|
* We record input value here to check if can press to clean up by backspace
|
|
* - null: Key is not down, this is reset by key up
|
|
* - true: Search text is empty when first time backspace down
|
|
* - false: Search text is not empty when first time backspace down
|
|
*/
|
|
var _useLock = useLock(),
|
|
_useLock2 = (0,slicedToArray/* default */.Z)(_useLock, 2),
|
|
getClearLock = _useLock2[0],
|
|
setClearLock = _useLock2[1];
|
|
|
|
// KeyDown
|
|
var onInternalKeyDown = function onInternalKeyDown(event) {
|
|
var clearLock = getClearLock();
|
|
var which = event.which;
|
|
if (which === es_KeyCode.ENTER) {
|
|
// Do not submit form when type in the input
|
|
if (mode !== 'combobox') {
|
|
event.preventDefault();
|
|
}
|
|
|
|
// We only manage open state here, close logic should handle by list component
|
|
if (!mergedOpen) {
|
|
onToggleOpen(true);
|
|
}
|
|
}
|
|
setClearLock(!!mergedSearchValue);
|
|
|
|
// Remove value by `backspace`
|
|
if (which === es_KeyCode.BACKSPACE && !clearLock && multiple && !mergedSearchValue && displayValues.length) {
|
|
var cloneDisplayValues = (0,toConsumableArray/* default */.Z)(displayValues);
|
|
var removedDisplayValue = null;
|
|
for (var i = cloneDisplayValues.length - 1; i >= 0; i -= 1) {
|
|
var current = cloneDisplayValues[i];
|
|
if (!current.disabled) {
|
|
cloneDisplayValues.splice(i, 1);
|
|
removedDisplayValue = current;
|
|
break;
|
|
}
|
|
}
|
|
if (removedDisplayValue) {
|
|
onDisplayValuesChange(cloneDisplayValues, {
|
|
type: 'remove',
|
|
values: [removedDisplayValue]
|
|
});
|
|
}
|
|
}
|
|
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
rest[_key - 1] = arguments[_key];
|
|
}
|
|
if (mergedOpen && listRef.current) {
|
|
var _listRef$current2;
|
|
(_listRef$current2 = listRef.current).onKeyDown.apply(_listRef$current2, [event].concat(rest));
|
|
}
|
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown.apply(void 0, [event].concat(rest));
|
|
};
|
|
|
|
// KeyUp
|
|
var onInternalKeyUp = function onInternalKeyUp(event) {
|
|
for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
rest[_key2 - 1] = arguments[_key2];
|
|
}
|
|
if (mergedOpen && listRef.current) {
|
|
var _listRef$current3;
|
|
(_listRef$current3 = listRef.current).onKeyUp.apply(_listRef$current3, [event].concat(rest));
|
|
}
|
|
onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp.apply(void 0, [event].concat(rest));
|
|
};
|
|
|
|
// ============================ Selector ============================
|
|
var onSelectorRemove = function onSelectorRemove(val) {
|
|
var newValues = displayValues.filter(function (i) {
|
|
return i !== val;
|
|
});
|
|
onDisplayValuesChange(newValues, {
|
|
type: 'remove',
|
|
values: [val]
|
|
});
|
|
};
|
|
|
|
// ========================== Focus / Blur ==========================
|
|
/** Record real focus status */
|
|
var focusRef = react.useRef(false);
|
|
var onContainerFocus = function onContainerFocus() {
|
|
setMockFocused(true);
|
|
if (!disabled) {
|
|
if (onFocus && !focusRef.current) {
|
|
onFocus.apply(void 0, arguments);
|
|
}
|
|
|
|
// `showAction` should handle `focus` if set
|
|
if (showAction.includes('focus')) {
|
|
onToggleOpen(true);
|
|
}
|
|
}
|
|
focusRef.current = true;
|
|
};
|
|
var onContainerBlur = function onContainerBlur() {
|
|
setMockFocused(false, function () {
|
|
focusRef.current = false;
|
|
onToggleOpen(false);
|
|
});
|
|
if (disabled) {
|
|
return;
|
|
}
|
|
if (mergedSearchValue) {
|
|
// `tags` mode should move `searchValue` into values
|
|
if (mode === 'tags') {
|
|
onSearch(mergedSearchValue, {
|
|
source: 'submit'
|
|
});
|
|
} else if (mode === 'multiple') {
|
|
// `multiple` mode only clean the search value but not trigger event
|
|
onSearch('', {
|
|
source: 'blur'
|
|
});
|
|
}
|
|
}
|
|
if (onBlur) {
|
|
onBlur.apply(void 0, arguments);
|
|
}
|
|
};
|
|
|
|
// Give focus back of Select
|
|
var activeTimeoutIds = [];
|
|
react.useEffect(function () {
|
|
return function () {
|
|
activeTimeoutIds.forEach(function (timeoutId) {
|
|
return clearTimeout(timeoutId);
|
|
});
|
|
activeTimeoutIds.splice(0, activeTimeoutIds.length);
|
|
};
|
|
}, []);
|
|
var onInternalMouseDown = function onInternalMouseDown(event) {
|
|
var _triggerRef$current;
|
|
var target = event.target;
|
|
var popupElement = (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getPopupElement();
|
|
|
|
// We should give focus back to selector if clicked item is not focusable
|
|
if (popupElement && popupElement.contains(target)) {
|
|
var timeoutId = setTimeout(function () {
|
|
var index = activeTimeoutIds.indexOf(timeoutId);
|
|
if (index !== -1) {
|
|
activeTimeoutIds.splice(index, 1);
|
|
}
|
|
cancelSetMockFocused();
|
|
if (!mobile && !popupElement.contains(document.activeElement)) {
|
|
var _selectorRef$current3;
|
|
(_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 ? void 0 : _selectorRef$current3.focus();
|
|
}
|
|
});
|
|
activeTimeoutIds.push(timeoutId);
|
|
}
|
|
for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
restArgs[_key3 - 1] = arguments[_key3];
|
|
}
|
|
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown.apply(void 0, [event].concat(restArgs));
|
|
};
|
|
|
|
// ============================ Dropdown ============================
|
|
var _React$useState5 = react.useState({}),
|
|
_React$useState6 = (0,slicedToArray/* default */.Z)(_React$useState5, 2),
|
|
forceUpdate = _React$useState6[1];
|
|
// We need force update here since popup dom is render async
|
|
function onPopupMouseEnter() {
|
|
forceUpdate({});
|
|
}
|
|
|
|
// Used for raw custom input trigger
|
|
var onTriggerVisibleChange;
|
|
if (customizeRawInputElement) {
|
|
onTriggerVisibleChange = function onTriggerVisibleChange(newOpen) {
|
|
onToggleOpen(newOpen);
|
|
};
|
|
}
|
|
|
|
// Close when click on non-select element
|
|
useSelectTriggerControl(function () {
|
|
var _triggerRef$current2;
|
|
return [containerRef.current, (_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.getPopupElement()];
|
|
}, triggerOpen, onToggleOpen, !!customizeRawInputElement);
|
|
|
|
// ============================ Context =============================
|
|
var baseSelectContext = react.useMemo(function () {
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
notFoundContent: notFoundContent,
|
|
open: mergedOpen,
|
|
triggerOpen: triggerOpen,
|
|
id: id,
|
|
showSearch: mergedShowSearch,
|
|
multiple: multiple,
|
|
toggleOpen: onToggleOpen
|
|
});
|
|
}, [props, notFoundContent, triggerOpen, mergedOpen, id, mergedShowSearch, multiple, onToggleOpen]);
|
|
|
|
// ==================================================================
|
|
// == Render ==
|
|
// ==================================================================
|
|
|
|
// ============================= Arrow ==============================
|
|
var showSuffixIcon = !!suffixIcon || loading;
|
|
var arrowNode;
|
|
if (showSuffixIcon) {
|
|
arrowNode = /*#__PURE__*/react.createElement(es_TransBtn, {
|
|
className: classnames_default()("".concat(prefixCls, "-arrow"), (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-arrow-loading"), loading)),
|
|
customizeIcon: suffixIcon,
|
|
customizeIconProps: {
|
|
loading: loading,
|
|
searchValue: mergedSearchValue,
|
|
open: mergedOpen,
|
|
focused: mockFocused,
|
|
showSearch: mergedShowSearch
|
|
}
|
|
});
|
|
}
|
|
|
|
// ============================= Clear ==============================
|
|
var onClearMouseDown = function onClearMouseDown() {
|
|
var _selectorRef$current4;
|
|
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
(_selectorRef$current4 = selectorRef.current) === null || _selectorRef$current4 === void 0 ? void 0 : _selectorRef$current4.focus();
|
|
onDisplayValuesChange([], {
|
|
type: 'clear',
|
|
values: displayValues
|
|
});
|
|
onInternalSearch('', false, false);
|
|
};
|
|
var _useAllowClear = useAllowClear(prefixCls, onClearMouseDown, displayValues, allowClear, clearIcon, disabled, mergedSearchValue, mode),
|
|
mergedAllowClear = _useAllowClear.allowClear,
|
|
clearNode = _useAllowClear.clearIcon;
|
|
|
|
// =========================== OptionList ===========================
|
|
var optionList = /*#__PURE__*/react.createElement(OptionList, {
|
|
ref: listRef
|
|
});
|
|
|
|
// ============================= Select =============================
|
|
var mergedClassName = classnames_default()(prefixCls, className, (_classNames2 = {}, (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-focused"), mockFocused), (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-multiple"), multiple), (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-single"), !multiple), (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-allow-clear"), allowClear), (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-show-arrow"), showSuffixIcon), (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-disabled"), disabled), (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-loading"), loading), (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-open"), mergedOpen), (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-customize-input"), customizeInputElement), (0,defineProperty/* default */.Z)(_classNames2, "".concat(prefixCls, "-show-search"), mergedShowSearch), _classNames2));
|
|
|
|
// >>> Selector
|
|
var selectorNode = /*#__PURE__*/react.createElement(es_SelectTrigger, {
|
|
ref: triggerRef,
|
|
disabled: disabled,
|
|
prefixCls: prefixCls,
|
|
visible: triggerOpen,
|
|
popupElement: optionList,
|
|
animation: animation,
|
|
transitionName: transitionName,
|
|
dropdownStyle: dropdownStyle,
|
|
dropdownClassName: dropdownClassName,
|
|
direction: direction,
|
|
dropdownMatchSelectWidth: dropdownMatchSelectWidth,
|
|
dropdownRender: dropdownRender,
|
|
dropdownAlign: dropdownAlign,
|
|
placement: placement,
|
|
builtinPlacements: builtinPlacements,
|
|
getPopupContainer: getPopupContainer,
|
|
empty: emptyOptions,
|
|
getTriggerDOMNode: function getTriggerDOMNode() {
|
|
return selectorDomRef.current;
|
|
},
|
|
onPopupVisibleChange: onTriggerVisibleChange,
|
|
onPopupMouseEnter: onPopupMouseEnter
|
|
}, customizeRawInputElement ? /*#__PURE__*/react.cloneElement(customizeRawInputElement, {
|
|
ref: customizeRawInputRef
|
|
}) : /*#__PURE__*/react.createElement(es_Selector, (0,esm_extends/* default */.Z)({}, props, {
|
|
domRef: selectorDomRef,
|
|
prefixCls: prefixCls,
|
|
inputElement: customizeInputElement,
|
|
ref: selectorRef,
|
|
id: id,
|
|
showSearch: mergedShowSearch,
|
|
autoClearSearchValue: autoClearSearchValue,
|
|
mode: mode,
|
|
activeDescendantId: activeDescendantId,
|
|
tagRender: tagRender,
|
|
values: displayValues,
|
|
open: mergedOpen,
|
|
onToggleOpen: onToggleOpen,
|
|
activeValue: activeValue,
|
|
searchValue: mergedSearchValue,
|
|
onSearch: onInternalSearch,
|
|
onSearchSubmit: onInternalSearchSubmit,
|
|
onRemove: onSelectorRemove,
|
|
tokenWithEnter: tokenWithEnter
|
|
})));
|
|
|
|
// >>> Render
|
|
var renderNode;
|
|
|
|
// Render raw
|
|
if (customizeRawInputElement) {
|
|
renderNode = selectorNode;
|
|
} else {
|
|
renderNode = /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
className: mergedClassName
|
|
}, domProps, {
|
|
ref: containerRef,
|
|
onMouseDown: onInternalMouseDown,
|
|
onKeyDown: onInternalKeyDown,
|
|
onKeyUp: onInternalKeyUp,
|
|
onFocus: onContainerFocus,
|
|
onBlur: onContainerBlur
|
|
}), mockFocused && !mergedOpen && /*#__PURE__*/react.createElement("span", {
|
|
style: {
|
|
width: 0,
|
|
height: 0,
|
|
position: 'absolute',
|
|
overflow: 'hidden',
|
|
opacity: 0
|
|
},
|
|
"aria-live": "polite"
|
|
}, "".concat(displayValues.map(function (_ref) {
|
|
var label = _ref.label,
|
|
value = _ref.value;
|
|
return ['number', 'string'].includes((0,esm_typeof/* default */.Z)(label)) ? label : value;
|
|
}).join(', '))), selectorNode, arrowNode, mergedAllowClear && clearNode);
|
|
}
|
|
return /*#__PURE__*/react.createElement(BaseSelectContext.Provider, {
|
|
value: baseSelectContext
|
|
}, renderNode);
|
|
});
|
|
|
|
// Set display name for dev
|
|
if (false) {}
|
|
/* harmony default export */ var es_BaseSelect = (BaseSelect);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useCache.js
|
|
|
|
|
|
/**
|
|
* Cache `value` related LabeledValue & options.
|
|
*/
|
|
/* harmony default export */ var useCache = (function (labeledValues, valueOptions) {
|
|
var cacheRef = react.useRef({
|
|
values: new Map(),
|
|
options: new Map()
|
|
});
|
|
var filledLabeledValues = react.useMemo(function () {
|
|
var _cacheRef$current = cacheRef.current,
|
|
prevValueCache = _cacheRef$current.values,
|
|
prevOptionCache = _cacheRef$current.options;
|
|
|
|
// Fill label by cache
|
|
var patchedValues = labeledValues.map(function (item) {
|
|
if (item.label === undefined) {
|
|
var _prevValueCache$get;
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, item), {}, {
|
|
label: (_prevValueCache$get = prevValueCache.get(item.value)) === null || _prevValueCache$get === void 0 ? void 0 : _prevValueCache$get.label
|
|
});
|
|
}
|
|
return item;
|
|
});
|
|
|
|
// Refresh cache
|
|
var valueCache = new Map();
|
|
var optionCache = new Map();
|
|
patchedValues.forEach(function (item) {
|
|
valueCache.set(item.value, item);
|
|
optionCache.set(item.value, valueOptions.get(item.value) || prevOptionCache.get(item.value));
|
|
});
|
|
cacheRef.current.values = valueCache;
|
|
cacheRef.current.options = optionCache;
|
|
return patchedValues;
|
|
}, [labeledValues, valueOptions]);
|
|
var getOption = react.useCallback(function (val) {
|
|
return valueOptions.get(val) || cacheRef.current.options.get(val);
|
|
}, [valueOptions]);
|
|
return [filledLabeledValues, getOption];
|
|
});
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useFilterOptions.js
|
|
|
|
|
|
|
|
|
|
|
|
function includes(test, search) {
|
|
return commonUtil_toArray(test).join('').toUpperCase().includes(search);
|
|
}
|
|
/* harmony default export */ var useFilterOptions = (function (options, fieldNames, searchValue, filterOption, optionFilterProp) {
|
|
return react.useMemo(function () {
|
|
if (!searchValue || filterOption === false) {
|
|
return options;
|
|
}
|
|
var fieldOptions = fieldNames.options,
|
|
fieldLabel = fieldNames.label,
|
|
fieldValue = fieldNames.value;
|
|
var filteredOptions = [];
|
|
var customizeFilter = typeof filterOption === 'function';
|
|
var upperSearch = searchValue.toUpperCase();
|
|
var filterFunc = customizeFilter ? filterOption : function (_, option) {
|
|
// Use provided `optionFilterProp`
|
|
if (optionFilterProp) {
|
|
return includes(option[optionFilterProp], upperSearch);
|
|
}
|
|
|
|
// Auto select `label` or `value` by option type
|
|
if (option[fieldOptions]) {
|
|
// hack `fieldLabel` since `OptionGroup` children is not `label`
|
|
return includes(option[fieldLabel !== 'children' ? fieldLabel : 'label'], upperSearch);
|
|
}
|
|
return includes(option[fieldValue], upperSearch);
|
|
};
|
|
var wrapOption = customizeFilter ? function (opt) {
|
|
return injectPropsWithOption(opt);
|
|
} : function (opt) {
|
|
return opt;
|
|
};
|
|
options.forEach(function (item) {
|
|
// Group should check child options
|
|
if (item[fieldOptions]) {
|
|
// Check group first
|
|
var matchGroup = filterFunc(searchValue, wrapOption(item));
|
|
if (matchGroup) {
|
|
filteredOptions.push(item);
|
|
} else {
|
|
// Check option
|
|
var subOptions = item[fieldOptions].filter(function (subItem) {
|
|
return filterFunc(searchValue, wrapOption(subItem));
|
|
});
|
|
if (subOptions.length) {
|
|
filteredOptions.push((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, item), {}, (0,defineProperty/* default */.Z)({}, fieldOptions, subOptions)));
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
if (filterFunc(searchValue, wrapOption(item))) {
|
|
filteredOptions.push(item);
|
|
}
|
|
});
|
|
return filteredOptions;
|
|
}, [options, filterOption, optionFilterProp, searchValue, fieldNames]);
|
|
});
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useId.js
|
|
|
|
|
|
|
|
var hooks_useId_uuid = 0;
|
|
|
|
/** Is client side and not jsdom */
|
|
var useId_isBrowserClient = true && canUseDom();
|
|
|
|
/** Get unique id for accessibility usage */
|
|
function getUUID() {
|
|
var retId;
|
|
|
|
// Test never reach
|
|
/* istanbul ignore if */
|
|
if (useId_isBrowserClient) {
|
|
retId = hooks_useId_uuid;
|
|
hooks_useId_uuid += 1;
|
|
} else {
|
|
retId = 'TEST_OR_SSR';
|
|
}
|
|
return retId;
|
|
}
|
|
function useId_useId(id) {
|
|
// Inner id for accessibility usage. Only work in client side
|
|
var _React$useState = react.useState(),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
innerId = _React$useState2[0],
|
|
setInnerId = _React$useState2[1];
|
|
react.useEffect(function () {
|
|
setInnerId("rc_select_".concat(getUUID()));
|
|
}, []);
|
|
return id || innerId;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/Children/toArray.js
|
|
|
|
|
|
function toArray_toArray(children) {
|
|
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
var ret = [];
|
|
react.Children.forEach(children, function (child) {
|
|
if ((child === undefined || child === null) && !option.keepEmpty) {
|
|
return;
|
|
}
|
|
if (Array.isArray(child)) {
|
|
ret = ret.concat(toArray_toArray(child));
|
|
} else if ((0,react_is.isFragment)(child) && child.props) {
|
|
ret = ret.concat(toArray_toArray(child.props.children, option));
|
|
} else {
|
|
ret.push(child);
|
|
}
|
|
});
|
|
return ret;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/utils/legacyUtil.js
|
|
|
|
|
|
var legacyUtil_excluded = ["children", "value"],
|
|
legacyUtil_excluded2 = ["children"];
|
|
|
|
|
|
function convertNodeToOption(node) {
|
|
var _ref = node,
|
|
key = _ref.key,
|
|
_ref$props = _ref.props,
|
|
children = _ref$props.children,
|
|
value = _ref$props.value,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(_ref$props, legacyUtil_excluded);
|
|
return (0,objectSpread2/* default */.Z)({
|
|
key: key,
|
|
value: value !== undefined ? value : key,
|
|
children: children
|
|
}, restProps);
|
|
}
|
|
function legacyUtil_convertChildrenToData(nodes) {
|
|
var optionOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
return toArray_toArray(nodes).map(function (node, index) {
|
|
if (! /*#__PURE__*/react.isValidElement(node) || !node.type) {
|
|
return null;
|
|
}
|
|
var _ref2 = node,
|
|
isSelectOptGroup = _ref2.type.isSelectOptGroup,
|
|
key = _ref2.key,
|
|
_ref2$props = _ref2.props,
|
|
children = _ref2$props.children,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(_ref2$props, legacyUtil_excluded2);
|
|
if (optionOnly || !isSelectOptGroup) {
|
|
return convertNodeToOption(node);
|
|
}
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({
|
|
key: "__RC_SELECT_GRP__".concat(key === null ? index : key, "__"),
|
|
label: key
|
|
}, restProps), {}, {
|
|
options: legacyUtil_convertChildrenToData(children)
|
|
});
|
|
}).filter(function (data) {
|
|
return data;
|
|
});
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useOptions.js
|
|
|
|
|
|
|
|
/**
|
|
* Parse `children` to `options` if `options` is not provided.
|
|
* Then flatten the `options`.
|
|
*/
|
|
function useOptions(options, children, fieldNames, optionFilterProp, optionLabelProp) {
|
|
return react.useMemo(function () {
|
|
var mergedOptions = options;
|
|
var childrenAsData = !options;
|
|
if (childrenAsData) {
|
|
mergedOptions = legacyUtil_convertChildrenToData(children);
|
|
}
|
|
var valueOptions = new Map();
|
|
var labelOptions = new Map();
|
|
var setLabelOptions = function setLabelOptions(labelOptionsMap, option, key) {
|
|
if (key && typeof key === 'string') {
|
|
labelOptionsMap.set(option[key], option);
|
|
}
|
|
};
|
|
function dig(optionList) {
|
|
var isChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
// for loop to speed up collection speed
|
|
for (var i = 0; i < optionList.length; i += 1) {
|
|
var option = optionList[i];
|
|
if (!option[fieldNames.options] || isChildren) {
|
|
valueOptions.set(option[fieldNames.value], option);
|
|
setLabelOptions(labelOptions, option, fieldNames.label);
|
|
// https://github.com/ant-design/ant-design/issues/35304
|
|
setLabelOptions(labelOptions, option, optionFilterProp);
|
|
setLabelOptions(labelOptions, option, optionLabelProp);
|
|
} else {
|
|
dig(option[fieldNames.options], true);
|
|
}
|
|
}
|
|
}
|
|
dig(mergedOptions);
|
|
return {
|
|
options: mergedOptions,
|
|
valueOptions: valueOptions,
|
|
labelOptions: labelOptions
|
|
};
|
|
}, [options, children, fieldNames, optionFilterProp, optionLabelProp]);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/hooks/useRefFunc.js
|
|
|
|
|
|
/**
|
|
* Same as `React.useCallback` but always return a memoized function
|
|
* but redirect to real function.
|
|
*/
|
|
function useRefFunc(callback) {
|
|
var funcRef = react.useRef();
|
|
funcRef.current = callback;
|
|
var cacheFn = react.useCallback(function () {
|
|
return funcRef.current.apply(funcRef, arguments);
|
|
}, []);
|
|
return cacheFn;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/OptGroup.js
|
|
/* istanbul ignore file */
|
|
|
|
/** This is a placeholder, not real render in dom */
|
|
var OptGroup = function OptGroup() {
|
|
return null;
|
|
};
|
|
OptGroup.isSelectOptGroup = true;
|
|
/* harmony default export */ var es_OptGroup = (OptGroup);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/Option.js
|
|
/* istanbul ignore file */
|
|
|
|
/** This is a placeholder, not real render in dom */
|
|
var Option = function Option() {
|
|
return null;
|
|
};
|
|
Option.isSelectOption = true;
|
|
/* harmony default export */ var es_Option = (Option);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/node_modules/rc-util/es/omit.js
|
|
|
|
function omit(obj, fields) {
|
|
var clone = (0,objectSpread2/* default */.Z)({}, obj);
|
|
if (Array.isArray(fields)) {
|
|
fields.forEach(function (key) {
|
|
delete clone[key];
|
|
});
|
|
}
|
|
return clone;
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-virtual-list/es/index.js + 18 modules
|
|
var rc_virtual_list_es = __webpack_require__(73358);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/SelectContext.js
|
|
|
|
|
|
// Use any here since we do not get the type during compilation
|
|
|
|
var SelectContext = /*#__PURE__*/react.createContext(null);
|
|
/* harmony default export */ var es_SelectContext = (SelectContext);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/utils/platformUtil.js
|
|
/* istanbul ignore file */
|
|
function isPlatformMac() {
|
|
return /(mac\sos|macintosh)/i.test(navigator.appVersion);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/OptionList.js
|
|
|
|
|
|
|
|
|
|
|
|
var OptionList_excluded = ["disabled", "title", "children", "style", "className"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// export interface OptionListProps<OptionsType extends object[]> {
|
|
|
|
function OptionList_isTitleType(content) {
|
|
return typeof content === 'string' || typeof content === 'number';
|
|
}
|
|
|
|
/**
|
|
* Using virtual list of option display.
|
|
* Will fallback to dom if use customize render.
|
|
*/
|
|
var OptionList = function OptionList(_, ref) {
|
|
var _useBaseProps = useBaseProps(),
|
|
prefixCls = _useBaseProps.prefixCls,
|
|
id = _useBaseProps.id,
|
|
open = _useBaseProps.open,
|
|
multiple = _useBaseProps.multiple,
|
|
mode = _useBaseProps.mode,
|
|
searchValue = _useBaseProps.searchValue,
|
|
toggleOpen = _useBaseProps.toggleOpen,
|
|
notFoundContent = _useBaseProps.notFoundContent,
|
|
onPopupScroll = _useBaseProps.onPopupScroll;
|
|
var _React$useContext = react.useContext(es_SelectContext),
|
|
flattenOptions = _React$useContext.flattenOptions,
|
|
onActiveValue = _React$useContext.onActiveValue,
|
|
defaultActiveFirstOption = _React$useContext.defaultActiveFirstOption,
|
|
onSelect = _React$useContext.onSelect,
|
|
menuItemSelectedIcon = _React$useContext.menuItemSelectedIcon,
|
|
rawValues = _React$useContext.rawValues,
|
|
fieldNames = _React$useContext.fieldNames,
|
|
virtual = _React$useContext.virtual,
|
|
direction = _React$useContext.direction,
|
|
listHeight = _React$useContext.listHeight,
|
|
listItemHeight = _React$useContext.listItemHeight;
|
|
var itemPrefixCls = "".concat(prefixCls, "-item");
|
|
var memoFlattenOptions = useMemo(function () {
|
|
return flattenOptions;
|
|
}, [open, flattenOptions], function (prev, next) {
|
|
return next[0] && prev[1] !== next[1];
|
|
});
|
|
|
|
// =========================== List ===========================
|
|
var listRef = react.useRef(null);
|
|
var onListMouseDown = function onListMouseDown(event) {
|
|
event.preventDefault();
|
|
};
|
|
var scrollIntoView = function scrollIntoView(args) {
|
|
if (listRef.current) {
|
|
listRef.current.scrollTo(typeof args === 'number' ? {
|
|
index: args
|
|
} : args);
|
|
}
|
|
};
|
|
|
|
// ========================== Active ==========================
|
|
var getEnabledActiveIndex = function getEnabledActiveIndex(index) {
|
|
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
var len = memoFlattenOptions.length;
|
|
for (var i = 0; i < len; i += 1) {
|
|
var current = (index + i * offset + len) % len;
|
|
var _memoFlattenOptions$c = memoFlattenOptions[current],
|
|
group = _memoFlattenOptions$c.group,
|
|
data = _memoFlattenOptions$c.data;
|
|
if (!group && !data.disabled) {
|
|
return current;
|
|
}
|
|
}
|
|
return -1;
|
|
};
|
|
var _React$useState = react.useState(function () {
|
|
return getEnabledActiveIndex(0);
|
|
}),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
activeIndex = _React$useState2[0],
|
|
setActiveIndex = _React$useState2[1];
|
|
var setActive = function setActive(index) {
|
|
var fromKeyboard = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
setActiveIndex(index);
|
|
var info = {
|
|
source: fromKeyboard ? 'keyboard' : 'mouse'
|
|
};
|
|
|
|
// Trigger active event
|
|
var flattenItem = memoFlattenOptions[index];
|
|
if (!flattenItem) {
|
|
onActiveValue(null, -1, info);
|
|
return;
|
|
}
|
|
onActiveValue(flattenItem.value, index, info);
|
|
};
|
|
|
|
// Auto active first item when list length or searchValue changed
|
|
(0,react.useEffect)(function () {
|
|
setActive(defaultActiveFirstOption !== false ? getEnabledActiveIndex(0) : -1);
|
|
}, [memoFlattenOptions.length, searchValue]);
|
|
|
|
// https://github.com/ant-design/ant-design/issues/34975
|
|
var isSelected = react.useCallback(function (value) {
|
|
return rawValues.has(value) && mode !== 'combobox';
|
|
}, [mode, (0,toConsumableArray/* default */.Z)(rawValues).toString(), rawValues.size]);
|
|
|
|
// Auto scroll to item position in single mode
|
|
(0,react.useEffect)(function () {
|
|
/**
|
|
* React will skip `onChange` when component update.
|
|
* `setActive` function will call root accessibility state update which makes re-render.
|
|
* So we need to delay to let Input component trigger onChange first.
|
|
*/
|
|
var timeoutId = setTimeout(function () {
|
|
if (!multiple && open && rawValues.size === 1) {
|
|
var value = Array.from(rawValues)[0];
|
|
var index = memoFlattenOptions.findIndex(function (_ref) {
|
|
var data = _ref.data;
|
|
return data.value === value;
|
|
});
|
|
if (index !== -1) {
|
|
setActive(index);
|
|
scrollIntoView(index);
|
|
}
|
|
}
|
|
});
|
|
|
|
// Force trigger scrollbar visible when open
|
|
if (open) {
|
|
var _listRef$current;
|
|
(_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(undefined);
|
|
}
|
|
return function () {
|
|
return clearTimeout(timeoutId);
|
|
};
|
|
}, [open, searchValue, flattenOptions.length]);
|
|
|
|
// ========================== Values ==========================
|
|
var onSelectValue = function onSelectValue(value) {
|
|
if (value !== undefined) {
|
|
onSelect(value, {
|
|
selected: !rawValues.has(value)
|
|
});
|
|
}
|
|
|
|
// Single mode should always close by select
|
|
if (!multiple) {
|
|
toggleOpen(false);
|
|
}
|
|
};
|
|
|
|
// ========================= Keyboard =========================
|
|
react.useImperativeHandle(ref, function () {
|
|
return {
|
|
onKeyDown: function onKeyDown(event) {
|
|
var which = event.which,
|
|
ctrlKey = event.ctrlKey;
|
|
switch (which) {
|
|
// >>> Arrow keys & ctrl + n/p on Mac
|
|
case es_KeyCode.N:
|
|
case es_KeyCode.P:
|
|
case es_KeyCode.UP:
|
|
case es_KeyCode.DOWN:
|
|
{
|
|
var offset = 0;
|
|
if (which === es_KeyCode.UP) {
|
|
offset = -1;
|
|
} else if (which === es_KeyCode.DOWN) {
|
|
offset = 1;
|
|
} else if (isPlatformMac() && ctrlKey) {
|
|
if (which === es_KeyCode.N) {
|
|
offset = 1;
|
|
} else if (which === es_KeyCode.P) {
|
|
offset = -1;
|
|
}
|
|
}
|
|
if (offset !== 0) {
|
|
var nextActiveIndex = getEnabledActiveIndex(activeIndex + offset, offset);
|
|
scrollIntoView(nextActiveIndex);
|
|
setActive(nextActiveIndex, true);
|
|
}
|
|
break;
|
|
}
|
|
|
|
// >>> Select
|
|
case es_KeyCode.ENTER:
|
|
{
|
|
// value
|
|
var item = memoFlattenOptions[activeIndex];
|
|
if (item && !item.data.disabled) {
|
|
onSelectValue(item.value);
|
|
} else {
|
|
onSelectValue(undefined);
|
|
}
|
|
if (open) {
|
|
event.preventDefault();
|
|
}
|
|
break;
|
|
}
|
|
|
|
// >>> Close
|
|
case es_KeyCode.ESC:
|
|
{
|
|
toggleOpen(false);
|
|
if (open) {
|
|
event.stopPropagation();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
onKeyUp: function onKeyUp() {},
|
|
scrollTo: function scrollTo(index) {
|
|
scrollIntoView(index);
|
|
}
|
|
};
|
|
});
|
|
|
|
// ========================== Render ==========================
|
|
if (memoFlattenOptions.length === 0) {
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
role: "listbox",
|
|
id: "".concat(id, "_list"),
|
|
className: "".concat(itemPrefixCls, "-empty"),
|
|
onMouseDown: onListMouseDown
|
|
}, notFoundContent);
|
|
}
|
|
var omitFieldNameList = Object.keys(fieldNames).map(function (key) {
|
|
return fieldNames[key];
|
|
});
|
|
var getLabel = function getLabel(item) {
|
|
return item.label;
|
|
};
|
|
function getItemAriaProps(item, index) {
|
|
var group = item.group;
|
|
return {
|
|
role: group ? 'presentation' : 'option',
|
|
id: "".concat(id, "_list_").concat(index)
|
|
};
|
|
}
|
|
var renderItem = function renderItem(index) {
|
|
var item = memoFlattenOptions[index];
|
|
if (!item) return null;
|
|
var itemData = item.data || {};
|
|
var value = itemData.value;
|
|
var group = item.group;
|
|
var attrs = pickAttrs(itemData, true);
|
|
var mergedLabel = getLabel(item);
|
|
return item ? /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
"aria-label": typeof mergedLabel === 'string' && !group ? mergedLabel : null
|
|
}, attrs, {
|
|
key: index
|
|
}, getItemAriaProps(item, index), {
|
|
"aria-selected": isSelected(value)
|
|
}), value) : null;
|
|
};
|
|
var a11yProps = {
|
|
role: 'listbox',
|
|
id: "".concat(id, "_list")
|
|
};
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, virtual && /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({}, a11yProps, {
|
|
style: {
|
|
height: 0,
|
|
width: 0,
|
|
overflow: 'hidden'
|
|
}
|
|
}), renderItem(activeIndex - 1), renderItem(activeIndex), renderItem(activeIndex + 1)), /*#__PURE__*/react.createElement(rc_virtual_list_es/* default */.Z, {
|
|
itemKey: "key",
|
|
ref: listRef,
|
|
data: memoFlattenOptions,
|
|
height: listHeight,
|
|
itemHeight: listItemHeight,
|
|
fullHeight: false,
|
|
onMouseDown: onListMouseDown,
|
|
onScroll: onPopupScroll,
|
|
virtual: virtual,
|
|
direction: direction,
|
|
innerProps: virtual ? null : a11yProps
|
|
}, function (item, itemIndex) {
|
|
var _classNames;
|
|
var group = item.group,
|
|
groupOption = item.groupOption,
|
|
data = item.data,
|
|
label = item.label,
|
|
value = item.value;
|
|
var key = data.key;
|
|
|
|
// Group
|
|
if (group) {
|
|
var _data$title;
|
|
var groupTitle = (_data$title = data.title) !== null && _data$title !== void 0 ? _data$title : OptionList_isTitleType(label) ? label.toString() : undefined;
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
className: classnames_default()(itemPrefixCls, "".concat(itemPrefixCls, "-group")),
|
|
title: groupTitle
|
|
}, label !== undefined ? label : key);
|
|
}
|
|
var disabled = data.disabled,
|
|
title = data.title,
|
|
children = data.children,
|
|
style = data.style,
|
|
className = data.className,
|
|
otherProps = (0,objectWithoutProperties/* default */.Z)(data, OptionList_excluded);
|
|
var passedProps = omit(otherProps, omitFieldNameList);
|
|
|
|
// Option
|
|
var selected = isSelected(value);
|
|
var optionPrefixCls = "".concat(itemPrefixCls, "-option");
|
|
var optionClassName = classnames_default()(itemPrefixCls, optionPrefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(optionPrefixCls, "-grouped"), groupOption), (0,defineProperty/* default */.Z)(_classNames, "".concat(optionPrefixCls, "-active"), activeIndex === itemIndex && !disabled), (0,defineProperty/* default */.Z)(_classNames, "".concat(optionPrefixCls, "-disabled"), disabled), (0,defineProperty/* default */.Z)(_classNames, "".concat(optionPrefixCls, "-selected"), selected), _classNames));
|
|
var mergedLabel = getLabel(item);
|
|
var iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === 'function' || selected;
|
|
|
|
// https://github.com/ant-design/ant-design/issues/34145
|
|
var content = typeof mergedLabel === 'number' ? mergedLabel : mergedLabel || value;
|
|
// https://github.com/ant-design/ant-design/issues/26717
|
|
var optionTitle = OptionList_isTitleType(content) ? content.toString() : undefined;
|
|
if (title !== undefined) {
|
|
optionTitle = title;
|
|
}
|
|
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({}, pickAttrs(passedProps), !virtual ? getItemAriaProps(item, itemIndex) : {}, {
|
|
"aria-selected": selected,
|
|
className: optionClassName,
|
|
title: optionTitle,
|
|
onMouseMove: function onMouseMove() {
|
|
if (activeIndex === itemIndex || disabled) {
|
|
return;
|
|
}
|
|
setActive(itemIndex);
|
|
},
|
|
onClick: function onClick() {
|
|
if (!disabled) {
|
|
onSelectValue(value);
|
|
}
|
|
},
|
|
style: style
|
|
}), /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(optionPrefixCls, "-content")
|
|
}, content), /*#__PURE__*/react.isValidElement(menuItemSelectedIcon) || selected, iconVisible && /*#__PURE__*/react.createElement(es_TransBtn, {
|
|
className: "".concat(itemPrefixCls, "-option-state"),
|
|
customizeIcon: menuItemSelectedIcon,
|
|
customizeIconProps: {
|
|
isSelected: selected
|
|
}
|
|
}, selected ? '✓' : null));
|
|
}));
|
|
};
|
|
var RefOptionList = /*#__PURE__*/react.forwardRef(OptionList);
|
|
RefOptionList.displayName = 'OptionList';
|
|
/* harmony default export */ var es_OptionList = (RefOptionList);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/utils/warningPropsUtil.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function warningProps(props) {
|
|
var mode = props.mode,
|
|
options = props.options,
|
|
children = props.children,
|
|
backfill = props.backfill,
|
|
allowClear = props.allowClear,
|
|
placeholder = props.placeholder,
|
|
getInputElement = props.getInputElement,
|
|
showSearch = props.showSearch,
|
|
onSearch = props.onSearch,
|
|
defaultOpen = props.defaultOpen,
|
|
autoFocus = props.autoFocus,
|
|
labelInValue = props.labelInValue,
|
|
value = props.value,
|
|
inputValue = props.inputValue,
|
|
optionLabelProp = props.optionLabelProp;
|
|
var multiple = isMultiple(mode);
|
|
var mergedShowSearch = showSearch !== undefined ? showSearch : multiple || mode === 'combobox';
|
|
var mergedOptions = options || convertChildrenToData(children);
|
|
|
|
// `tags` should not set option as disabled
|
|
warning(mode !== 'tags' || mergedOptions.every(function (opt) {
|
|
return !opt.disabled;
|
|
}), 'Please avoid setting option to disabled in tags mode since user can always type text as tag.');
|
|
|
|
// `combobox` & `tags` should option be `string` type
|
|
if (mode === 'tags' || mode === 'combobox') {
|
|
var hasNumberValue = mergedOptions.some(function (item) {
|
|
if (item.options) {
|
|
return item.options.some(function (opt) {
|
|
return typeof ('value' in opt ? opt.value : opt.key) === 'number';
|
|
});
|
|
}
|
|
return typeof ('value' in item ? item.value : item.key) === 'number';
|
|
});
|
|
warning(!hasNumberValue, '`value` of Option should not use number type when `mode` is `tags` or `combobox`.');
|
|
}
|
|
|
|
// `combobox` should not use `optionLabelProp`
|
|
warning(mode !== 'combobox' || !optionLabelProp, '`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly.');
|
|
|
|
// Only `combobox` support `backfill`
|
|
warning(mode === 'combobox' || !backfill, '`backfill` only works with `combobox` mode.');
|
|
|
|
// Only `combobox` support `getInputElement`
|
|
warning(mode === 'combobox' || !getInputElement, '`getInputElement` only work with `combobox` mode.');
|
|
|
|
// Customize `getInputElement` should not use `allowClear` & `placeholder`
|
|
noteOnce(mode !== 'combobox' || !getInputElement || !allowClear || !placeholder, 'Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`.');
|
|
|
|
// `onSearch` should use in `combobox` or `showSearch`
|
|
if (onSearch && !mergedShowSearch && mode !== 'combobox' && mode !== 'tags') {
|
|
warning(false, '`onSearch` should work with `showSearch` instead of use alone.');
|
|
}
|
|
noteOnce(!defaultOpen || autoFocus, '`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed.');
|
|
if (value !== undefined && value !== null) {
|
|
var values = toArray(value);
|
|
warning(!labelInValue || values.every(function (val) {
|
|
return _typeof(val) === 'object' && ('key' in val || 'value' in val);
|
|
}), '`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`');
|
|
warning(!multiple || Array.isArray(value), '`value` should be array when `mode` is `multiple` or `tags`');
|
|
}
|
|
|
|
// Syntactic sugar should use correct children type
|
|
if (children) {
|
|
var invalidateChildType = null;
|
|
toNodeArray(children).some(function (node) {
|
|
if (! /*#__PURE__*/React.isValidElement(node) || !node.type) {
|
|
return false;
|
|
}
|
|
var _ref = node,
|
|
type = _ref.type;
|
|
if (type.isSelectOption) {
|
|
return false;
|
|
}
|
|
if (type.isSelectOptGroup) {
|
|
var allChildrenValid = toNodeArray(node.props.children).every(function (subNode) {
|
|
if (! /*#__PURE__*/React.isValidElement(subNode) || !node.type || subNode.type.isSelectOption) {
|
|
return true;
|
|
}
|
|
invalidateChildType = subNode.type;
|
|
return false;
|
|
});
|
|
if (allChildrenValid) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
invalidateChildType = type;
|
|
return true;
|
|
});
|
|
if (invalidateChildType) {
|
|
warning(false, "`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(invalidateChildType.displayName || invalidateChildType.name || invalidateChildType, "`."));
|
|
}
|
|
warning(inputValue === undefined, '`inputValue` is deprecated, please use `searchValue` instead.');
|
|
}
|
|
}
|
|
|
|
// value in Select option should not be null
|
|
// note: OptGroup has options too
|
|
function warningNullOptions(options, fieldNames) {
|
|
if (options) {
|
|
var recursiveOptions = function recursiveOptions(optionsList) {
|
|
var inGroup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
for (var i = 0; i < optionsList.length; i++) {
|
|
var option = optionsList[i];
|
|
if (option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] === null) {
|
|
warning(false, '`value` in Select options should not be `null`.');
|
|
return true;
|
|
}
|
|
if (!inGroup && Array.isArray(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.options]) && recursiveOptions(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.options], true)) {
|
|
break;
|
|
}
|
|
}
|
|
};
|
|
recursiveOptions(options);
|
|
}
|
|
}
|
|
/* harmony default export */ var warningPropsUtil = ((/* unused pure expression or super */ null && (warningProps)));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/Select.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Select_excluded = ["id", "mode", "prefixCls", "backfill", "fieldNames", "inputValue", "searchValue", "onSearch", "autoClearSearchValue", "onSelect", "onDeselect", "dropdownMatchSelectWidth", "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "direction", "listHeight", "listItemHeight", "value", "defaultValue", "labelInValue", "onChange"];
|
|
/**
|
|
* To match accessibility requirement, we always provide an input in the component.
|
|
* Other element will not set `tabIndex` to avoid `onBlur` sequence problem.
|
|
* For focused select, we set `aria-live="polite"` to update the accessibility content.
|
|
*
|
|
* ref:
|
|
* - keyboard: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role#Keyboard_interactions
|
|
*
|
|
* New api:
|
|
* - listHeight
|
|
* - listItemHeight
|
|
* - component
|
|
*
|
|
* Remove deprecated api:
|
|
* - multiple
|
|
* - tags
|
|
* - combobox
|
|
* - firstActiveValue
|
|
* - dropdownMenuStyle
|
|
* - openClassName (Not list in api)
|
|
*
|
|
* Update:
|
|
* - `backfill` only support `combobox` mode
|
|
* - `combobox` mode not support `labelInValue` since it's meaningless
|
|
* - `getInputElement` only support `combobox` mode
|
|
* - `onChange` return OptionData instead of ReactNode
|
|
* - `filterOption` `onChange` `onSelect` accept OptionData instead of ReactNode
|
|
* - `combobox` mode trigger `onChange` will get `undefined` if no `value` match in Option
|
|
* - `combobox` mode not support `optionLabelProp`
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var OMIT_DOM_PROPS = ['inputValue'];
|
|
function isRawValue(value) {
|
|
return !value || (0,esm_typeof/* default */.Z)(value) !== 'object';
|
|
}
|
|
var Select = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var id = props.id,
|
|
mode = props.mode,
|
|
_props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-select' : _props$prefixCls,
|
|
backfill = props.backfill,
|
|
fieldNames = props.fieldNames,
|
|
inputValue = props.inputValue,
|
|
searchValue = props.searchValue,
|
|
onSearch = props.onSearch,
|
|
_props$autoClearSearc = props.autoClearSearchValue,
|
|
autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,
|
|
onSelect = props.onSelect,
|
|
onDeselect = props.onDeselect,
|
|
_props$dropdownMatchS = props.dropdownMatchSelectWidth,
|
|
dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS,
|
|
filterOption = props.filterOption,
|
|
filterSort = props.filterSort,
|
|
optionFilterProp = props.optionFilterProp,
|
|
optionLabelProp = props.optionLabelProp,
|
|
options = props.options,
|
|
children = props.children,
|
|
defaultActiveFirstOption = props.defaultActiveFirstOption,
|
|
menuItemSelectedIcon = props.menuItemSelectedIcon,
|
|
virtual = props.virtual,
|
|
direction = props.direction,
|
|
_props$listHeight = props.listHeight,
|
|
listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,
|
|
_props$listItemHeight = props.listItemHeight,
|
|
listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,
|
|
value = props.value,
|
|
defaultValue = props.defaultValue,
|
|
labelInValue = props.labelInValue,
|
|
onChange = props.onChange,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, Select_excluded);
|
|
var mergedId = useId_useId(id);
|
|
var multiple = BaseSelect_isMultiple(mode);
|
|
var childrenAsData = !!(!options && children);
|
|
var mergedFilterOption = react.useMemo(function () {
|
|
if (filterOption === undefined && mode === 'combobox') {
|
|
return false;
|
|
}
|
|
return filterOption;
|
|
}, [filterOption, mode]);
|
|
|
|
// ========================= FieldNames =========================
|
|
var mergedFieldNames = react.useMemo(function () {
|
|
return fillFieldNames(fieldNames, childrenAsData);
|
|
}, /* eslint-disable react-hooks/exhaustive-deps */
|
|
[
|
|
// We stringify fieldNames to avoid unnecessary re-renders.
|
|
JSON.stringify(fieldNames), childrenAsData]
|
|
/* eslint-enable react-hooks/exhaustive-deps */);
|
|
|
|
// =========================== Search ===========================
|
|
var _useMergedState = useMergedState('', {
|
|
value: searchValue !== undefined ? searchValue : inputValue,
|
|
postState: function postState(search) {
|
|
return search || '';
|
|
}
|
|
}),
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
mergedSearchValue = _useMergedState2[0],
|
|
setSearchValue = _useMergedState2[1];
|
|
|
|
// =========================== Option ===========================
|
|
var parsedOptions = useOptions(options, children, mergedFieldNames, optionFilterProp, optionLabelProp);
|
|
var valueOptions = parsedOptions.valueOptions,
|
|
labelOptions = parsedOptions.labelOptions,
|
|
mergedOptions = parsedOptions.options;
|
|
|
|
// ========================= Wrap Value =========================
|
|
var convert2LabelValues = react.useCallback(function (draftValues) {
|
|
// Convert to array
|
|
var valueList = commonUtil_toArray(draftValues);
|
|
|
|
// Convert to labelInValue type
|
|
return valueList.map(function (val) {
|
|
var rawValue;
|
|
var rawLabel;
|
|
var rawKey;
|
|
var rawDisabled;
|
|
var rawTitle;
|
|
|
|
// Fill label & value
|
|
if (isRawValue(val)) {
|
|
rawValue = val;
|
|
} else {
|
|
var _val$value;
|
|
rawKey = val.key;
|
|
rawLabel = val.label;
|
|
rawValue = (_val$value = val.value) !== null && _val$value !== void 0 ? _val$value : rawKey;
|
|
}
|
|
var option = valueOptions.get(rawValue);
|
|
if (option) {
|
|
var _option$key;
|
|
// Fill missing props
|
|
if (rawLabel === undefined) rawLabel = option === null || option === void 0 ? void 0 : option[optionLabelProp || mergedFieldNames.label];
|
|
if (rawKey === undefined) rawKey = (_option$key = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key !== void 0 ? _option$key : rawValue;
|
|
rawDisabled = option === null || option === void 0 ? void 0 : option.disabled;
|
|
rawTitle = option === null || option === void 0 ? void 0 : option.title;
|
|
|
|
// Warning if label not same as provided
|
|
if (false) { var optionLabel; }
|
|
}
|
|
return {
|
|
label: rawLabel,
|
|
value: rawValue,
|
|
key: rawKey,
|
|
disabled: rawDisabled,
|
|
title: rawTitle
|
|
};
|
|
});
|
|
}, [mergedFieldNames, optionLabelProp, valueOptions]);
|
|
|
|
// =========================== Values ===========================
|
|
var _useMergedState3 = useMergedState(defaultValue, {
|
|
value: value
|
|
}),
|
|
_useMergedState4 = (0,slicedToArray/* default */.Z)(_useMergedState3, 2),
|
|
internalValue = _useMergedState4[0],
|
|
setInternalValue = _useMergedState4[1];
|
|
|
|
// Merged value with LabelValueType
|
|
var rawLabeledValues = react.useMemo(function () {
|
|
var _values$;
|
|
var values = convert2LabelValues(internalValue);
|
|
|
|
// combobox no need save value when it's no value (exclude value equal 0)
|
|
if (mode === 'combobox' && isComboNoValue((_values$ = values[0]) === null || _values$ === void 0 ? void 0 : _values$.value)) {
|
|
return [];
|
|
}
|
|
return values;
|
|
}, [internalValue, convert2LabelValues, mode]);
|
|
|
|
// Fill label with cache to avoid option remove
|
|
var _useCache = useCache(rawLabeledValues, valueOptions),
|
|
_useCache2 = (0,slicedToArray/* default */.Z)(_useCache, 2),
|
|
mergedValues = _useCache2[0],
|
|
getMixedOption = _useCache2[1];
|
|
var displayValues = react.useMemo(function () {
|
|
// `null` need show as placeholder instead
|
|
// https://github.com/ant-design/ant-design/issues/25057
|
|
if (!mode && mergedValues.length === 1) {
|
|
var firstValue = mergedValues[0];
|
|
if (firstValue.value === null && (firstValue.label === null || firstValue.label === undefined)) {
|
|
return [];
|
|
}
|
|
}
|
|
return mergedValues.map(function (item) {
|
|
var _item$label;
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, item), {}, {
|
|
label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.value
|
|
});
|
|
});
|
|
}, [mode, mergedValues]);
|
|
|
|
/** Convert `displayValues` to raw value type set */
|
|
var rawValues = react.useMemo(function () {
|
|
return new Set(mergedValues.map(function (val) {
|
|
return val.value;
|
|
}));
|
|
}, [mergedValues]);
|
|
react.useEffect(function () {
|
|
if (mode === 'combobox') {
|
|
var _mergedValues$;
|
|
var strValue = (_mergedValues$ = mergedValues[0]) === null || _mergedValues$ === void 0 ? void 0 : _mergedValues$.value;
|
|
setSearchValue(commonUtil_hasValue(strValue) ? String(strValue) : '');
|
|
}
|
|
}, [mergedValues]);
|
|
|
|
// ======================= Display Option =======================
|
|
// Create a placeholder item if not exist in `options`
|
|
var createTagOption = useRefFunc(function (val, label) {
|
|
var _ref;
|
|
var mergedLabel = label !== null && label !== void 0 ? label : val;
|
|
return _ref = {}, (0,defineProperty/* default */.Z)(_ref, mergedFieldNames.value, val), (0,defineProperty/* default */.Z)(_ref, mergedFieldNames.label, mergedLabel), _ref;
|
|
});
|
|
|
|
// Fill tag as option if mode is `tags`
|
|
var filledTagOptions = react.useMemo(function () {
|
|
if (mode !== 'tags') {
|
|
return mergedOptions;
|
|
}
|
|
|
|
// >>> Tag mode
|
|
var cloneOptions = (0,toConsumableArray/* default */.Z)(mergedOptions);
|
|
|
|
// Check if value exist in options (include new patch item)
|
|
var existOptions = function existOptions(val) {
|
|
return valueOptions.has(val);
|
|
};
|
|
|
|
// Fill current value as option
|
|
(0,toConsumableArray/* default */.Z)(mergedValues).sort(function (a, b) {
|
|
return a.value < b.value ? -1 : 1;
|
|
}).forEach(function (item) {
|
|
var val = item.value;
|
|
if (!existOptions(val)) {
|
|
cloneOptions.push(createTagOption(val, item.label));
|
|
}
|
|
});
|
|
return cloneOptions;
|
|
}, [createTagOption, mergedOptions, valueOptions, mergedValues, mode]);
|
|
var filteredOptions = useFilterOptions(filledTagOptions, mergedFieldNames, mergedSearchValue, mergedFilterOption, optionFilterProp);
|
|
|
|
// Fill options with search value if needed
|
|
var filledSearchOptions = react.useMemo(function () {
|
|
if (mode !== 'tags' || !mergedSearchValue || filteredOptions.some(function (item) {
|
|
return item[optionFilterProp || 'value'] === mergedSearchValue;
|
|
})) {
|
|
return filteredOptions;
|
|
}
|
|
// ignore when search value equal select input value
|
|
if (filteredOptions.some(function (item) {
|
|
return item[mergedFieldNames.value] === mergedSearchValue;
|
|
})) {
|
|
return filteredOptions;
|
|
}
|
|
// Fill search value as option
|
|
return [createTagOption(mergedSearchValue)].concat((0,toConsumableArray/* default */.Z)(filteredOptions));
|
|
}, [createTagOption, optionFilterProp, mode, filteredOptions, mergedSearchValue, mergedFieldNames]);
|
|
var orderedFilteredOptions = react.useMemo(function () {
|
|
if (!filterSort) {
|
|
return filledSearchOptions;
|
|
}
|
|
return (0,toConsumableArray/* default */.Z)(filledSearchOptions).sort(function (a, b) {
|
|
return filterSort(a, b);
|
|
});
|
|
}, [filledSearchOptions, filterSort]);
|
|
var displayOptions = react.useMemo(function () {
|
|
return flattenOptions(orderedFilteredOptions, {
|
|
fieldNames: mergedFieldNames,
|
|
childrenAsData: childrenAsData
|
|
});
|
|
}, [orderedFilteredOptions, mergedFieldNames, childrenAsData]);
|
|
|
|
// =========================== Change ===========================
|
|
var triggerChange = function triggerChange(values) {
|
|
var labeledValues = convert2LabelValues(values);
|
|
setInternalValue(labeledValues);
|
|
if (onChange && (
|
|
// Trigger event only when value changed
|
|
labeledValues.length !== mergedValues.length || labeledValues.some(function (newVal, index) {
|
|
var _mergedValues$index;
|
|
return ((_mergedValues$index = mergedValues[index]) === null || _mergedValues$index === void 0 ? void 0 : _mergedValues$index.value) !== (newVal === null || newVal === void 0 ? void 0 : newVal.value);
|
|
}))) {
|
|
var returnValues = labelInValue ? labeledValues : labeledValues.map(function (v) {
|
|
return v.value;
|
|
});
|
|
var returnOptions = labeledValues.map(function (v) {
|
|
return injectPropsWithOption(getMixedOption(v.value));
|
|
});
|
|
onChange(
|
|
// Value
|
|
multiple ? returnValues : returnValues[0],
|
|
// Option
|
|
multiple ? returnOptions : returnOptions[0]);
|
|
}
|
|
};
|
|
|
|
// ======================= Accessibility ========================
|
|
var _React$useState = react.useState(null),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
activeValue = _React$useState2[0],
|
|
setActiveValue = _React$useState2[1];
|
|
var _React$useState3 = react.useState(0),
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
accessibilityIndex = _React$useState4[0],
|
|
setAccessibilityIndex = _React$useState4[1];
|
|
var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';
|
|
var onActiveValue = react.useCallback(function (active, index) {
|
|
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
_ref2$source = _ref2.source,
|
|
source = _ref2$source === void 0 ? 'keyboard' : _ref2$source;
|
|
setAccessibilityIndex(index);
|
|
if (backfill && mode === 'combobox' && active !== null && source === 'keyboard') {
|
|
setActiveValue(String(active));
|
|
}
|
|
}, [backfill, mode]);
|
|
|
|
// ========================= OptionList =========================
|
|
var triggerSelect = function triggerSelect(val, selected, type) {
|
|
var getSelectEnt = function getSelectEnt() {
|
|
var _option$key2;
|
|
var option = getMixedOption(val);
|
|
return [labelInValue ? {
|
|
label: option === null || option === void 0 ? void 0 : option[mergedFieldNames.label],
|
|
value: val,
|
|
key: (_option$key2 = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key2 !== void 0 ? _option$key2 : val
|
|
} : val, injectPropsWithOption(option)];
|
|
};
|
|
if (selected && onSelect) {
|
|
var _getSelectEnt = getSelectEnt(),
|
|
_getSelectEnt2 = (0,slicedToArray/* default */.Z)(_getSelectEnt, 2),
|
|
wrappedValue = _getSelectEnt2[0],
|
|
_option = _getSelectEnt2[1];
|
|
onSelect(wrappedValue, _option);
|
|
} else if (!selected && onDeselect && type !== 'clear') {
|
|
var _getSelectEnt3 = getSelectEnt(),
|
|
_getSelectEnt4 = (0,slicedToArray/* default */.Z)(_getSelectEnt3, 2),
|
|
_wrappedValue = _getSelectEnt4[0],
|
|
_option2 = _getSelectEnt4[1];
|
|
onDeselect(_wrappedValue, _option2);
|
|
}
|
|
};
|
|
|
|
// Used for OptionList selection
|
|
var onInternalSelect = useRefFunc(function (val, info) {
|
|
var cloneValues;
|
|
|
|
// Single mode always trigger select only with option list
|
|
var mergedSelect = multiple ? info.selected : true;
|
|
if (mergedSelect) {
|
|
cloneValues = multiple ? [].concat((0,toConsumableArray/* default */.Z)(mergedValues), [val]) : [val];
|
|
} else {
|
|
cloneValues = mergedValues.filter(function (v) {
|
|
return v.value !== val;
|
|
});
|
|
}
|
|
triggerChange(cloneValues);
|
|
triggerSelect(val, mergedSelect);
|
|
|
|
// Clean search value if single or configured
|
|
if (mode === 'combobox') {
|
|
// setSearchValue(String(val));
|
|
setActiveValue('');
|
|
} else if (!BaseSelect_isMultiple || autoClearSearchValue) {
|
|
setSearchValue('');
|
|
setActiveValue('');
|
|
}
|
|
});
|
|
|
|
// ======================= Display Change =======================
|
|
// BaseSelect display values change
|
|
var onDisplayValuesChange = function onDisplayValuesChange(nextValues, info) {
|
|
triggerChange(nextValues);
|
|
var type = info.type,
|
|
values = info.values;
|
|
if (type === 'remove' || type === 'clear') {
|
|
values.forEach(function (item) {
|
|
triggerSelect(item.value, false, type);
|
|
});
|
|
}
|
|
};
|
|
|
|
// =========================== Search ===========================
|
|
var onInternalSearch = function onInternalSearch(searchText, info) {
|
|
setSearchValue(searchText);
|
|
setActiveValue(null);
|
|
|
|
// [Submit] Tag mode should flush input
|
|
if (info.source === 'submit') {
|
|
var formatted = (searchText || '').trim();
|
|
// prevent empty tags from appearing when you click the Enter button
|
|
if (formatted) {
|
|
var newRawValues = Array.from(new Set([].concat((0,toConsumableArray/* default */.Z)(rawValues), [formatted])));
|
|
triggerChange(newRawValues);
|
|
triggerSelect(formatted, true);
|
|
setSearchValue('');
|
|
}
|
|
return;
|
|
}
|
|
if (info.source !== 'blur') {
|
|
if (mode === 'combobox') {
|
|
triggerChange(searchText);
|
|
}
|
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(searchText);
|
|
}
|
|
};
|
|
var onInternalSearchSplit = function onInternalSearchSplit(words) {
|
|
var patchValues = words;
|
|
if (mode !== 'tags') {
|
|
patchValues = words.map(function (word) {
|
|
var opt = labelOptions.get(word);
|
|
return opt === null || opt === void 0 ? void 0 : opt.value;
|
|
}).filter(function (val) {
|
|
return val !== undefined;
|
|
});
|
|
}
|
|
var newRawValues = Array.from(new Set([].concat((0,toConsumableArray/* default */.Z)(rawValues), (0,toConsumableArray/* default */.Z)(patchValues))));
|
|
triggerChange(newRawValues);
|
|
newRawValues.forEach(function (newRawValue) {
|
|
triggerSelect(newRawValue, true);
|
|
});
|
|
};
|
|
|
|
// ========================== Context ===========================
|
|
var selectContext = react.useMemo(function () {
|
|
var realVirtual = virtual !== false && dropdownMatchSelectWidth !== false;
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, parsedOptions), {}, {
|
|
flattenOptions: displayOptions,
|
|
onActiveValue: onActiveValue,
|
|
defaultActiveFirstOption: mergedDefaultActiveFirstOption,
|
|
onSelect: onInternalSelect,
|
|
menuItemSelectedIcon: menuItemSelectedIcon,
|
|
rawValues: rawValues,
|
|
fieldNames: mergedFieldNames,
|
|
virtual: realVirtual,
|
|
direction: direction,
|
|
listHeight: listHeight,
|
|
listItemHeight: listItemHeight,
|
|
childrenAsData: childrenAsData
|
|
});
|
|
}, [parsedOptions, displayOptions, onActiveValue, mergedDefaultActiveFirstOption, onInternalSelect, menuItemSelectedIcon, rawValues, mergedFieldNames, virtual, dropdownMatchSelectWidth, listHeight, listItemHeight, childrenAsData]);
|
|
|
|
// ========================== Warning ===========================
|
|
if (false) {}
|
|
|
|
// ==============================================================
|
|
// == Render ==
|
|
// ==============================================================
|
|
return /*#__PURE__*/react.createElement(es_SelectContext.Provider, {
|
|
value: selectContext
|
|
}, /*#__PURE__*/react.createElement(es_BaseSelect, (0,esm_extends/* default */.Z)({}, restProps, {
|
|
// >>> MISC
|
|
id: mergedId,
|
|
prefixCls: prefixCls,
|
|
ref: ref,
|
|
omitDomProps: OMIT_DOM_PROPS,
|
|
mode: mode
|
|
// >>> Values
|
|
,
|
|
displayValues: displayValues,
|
|
onDisplayValuesChange: onDisplayValuesChange
|
|
// >>> Trigger
|
|
,
|
|
direction: direction
|
|
// >>> Search
|
|
,
|
|
searchValue: mergedSearchValue,
|
|
onSearch: onInternalSearch,
|
|
autoClearSearchValue: autoClearSearchValue,
|
|
onSearchSplit: onInternalSearchSplit,
|
|
dropdownMatchSelectWidth: dropdownMatchSelectWidth
|
|
// >>> OptionList
|
|
,
|
|
OptionList: es_OptionList,
|
|
emptyOptions: !displayOptions.length
|
|
// >>> Accessibility
|
|
,
|
|
activeValue: activeValue,
|
|
activeDescendantId: "".concat(mergedId, "_list_").concat(accessibilityIndex)
|
|
})));
|
|
});
|
|
if (false) {}
|
|
var TypedSelect = Select;
|
|
TypedSelect.Option = es_Option;
|
|
TypedSelect.OptGroup = es_OptGroup;
|
|
/* harmony default export */ var es_Select = (TypedSelect);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/rc-select/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var rc_select_es = (es_Select);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
|
|
var es_omit = __webpack_require__(10366);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/PurePanel.js
|
|
var PurePanel = __webpack_require__(8745);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/motion.js
|
|
var motion = __webpack_require__(33603);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/statusUtils.js
|
|
var statusUtils = __webpack_require__(9708);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/DisabledContext.js
|
|
var DisabledContext = __webpack_require__(98866);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/defaultRenderEmpty.js
|
|
var defaultRenderEmpty = __webpack_require__(88258);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(98675);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/context.js
|
|
var form_context = __webpack_require__(65223);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/space/Compact.js
|
|
var Compact = __webpack_require__(4173);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/select/style/index.js + 3 modules
|
|
var select_style = __webpack_require__(87244);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/select/useBuiltinPlacements.js
|
|
var useBuiltinPlacements = __webpack_require__(13458);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/select/useShowArrow.js
|
|
var useShowArrow = __webpack_require__(78642);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/select/utils/iconUtil.js
|
|
var iconUtil = __webpack_require__(46163);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/select/index.js
|
|
"use client";
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
// TODO: 4.0 - codemod should help to change `filterOption` to support node props.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
|
|
const InternalSelect = (_a, ref) => {
|
|
var _b;
|
|
var {
|
|
prefixCls: customizePrefixCls,
|
|
bordered = true,
|
|
className,
|
|
rootClassName,
|
|
getPopupContainer,
|
|
popupClassName,
|
|
dropdownClassName,
|
|
listHeight = 256,
|
|
placement,
|
|
listItemHeight = 24,
|
|
size: customizeSize,
|
|
disabled: customDisabled,
|
|
notFoundContent,
|
|
status: customStatus,
|
|
builtinPlacements,
|
|
dropdownMatchSelectWidth,
|
|
popupMatchSelectWidth,
|
|
direction: propDirection,
|
|
style,
|
|
allowClear
|
|
} = _a,
|
|
props = __rest(_a, ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear"]);
|
|
const {
|
|
getPopupContainer: getContextPopupContainer,
|
|
getPrefixCls,
|
|
renderEmpty,
|
|
direction: contextDirection,
|
|
virtual,
|
|
popupMatchSelectWidth: contextPopupMatchSelectWidth,
|
|
popupOverflow,
|
|
select
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
|
const rootPrefixCls = getPrefixCls();
|
|
const direction = propDirection !== null && propDirection !== void 0 ? propDirection : contextDirection;
|
|
const {
|
|
compactSize,
|
|
compactItemClassnames
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
const [wrapSSR, hashId] = (0,select_style/* default */.Z)(prefixCls);
|
|
const mode = react.useMemo(() => {
|
|
const {
|
|
mode: m
|
|
} = props;
|
|
if (m === 'combobox') {
|
|
return undefined;
|
|
}
|
|
if (m === SECRET_COMBOBOX_MODE_DO_NOT_USE) {
|
|
return 'combobox';
|
|
}
|
|
return m;
|
|
}, [props.mode]);
|
|
const isMultiple = mode === 'multiple' || mode === 'tags';
|
|
const showSuffixIcon = (0,useShowArrow/* default */.Z)(props.suffixIcon, props.showArrow);
|
|
const mergedPopupMatchSelectWidth = (_b = popupMatchSelectWidth !== null && popupMatchSelectWidth !== void 0 ? popupMatchSelectWidth : dropdownMatchSelectWidth) !== null && _b !== void 0 ? _b : contextPopupMatchSelectWidth;
|
|
// ===================== Form Status =====================
|
|
const {
|
|
status: contextStatus,
|
|
hasFeedback,
|
|
isFormItemInput,
|
|
feedbackIcon
|
|
} = react.useContext(form_context/* FormItemInputContext */.aM);
|
|
const mergedStatus = (0,statusUtils/* getMergedStatus */.F)(contextStatus, customStatus);
|
|
// ===================== Empty =====================
|
|
let mergedNotFound;
|
|
if (notFoundContent !== undefined) {
|
|
mergedNotFound = notFoundContent;
|
|
} else if (mode === 'combobox') {
|
|
mergedNotFound = null;
|
|
} else {
|
|
mergedNotFound = (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Select')) || /*#__PURE__*/react.createElement(defaultRenderEmpty/* default */.Z, {
|
|
componentName: "Select"
|
|
});
|
|
}
|
|
// ===================== Icons =====================
|
|
const {
|
|
suffixIcon,
|
|
itemIcon,
|
|
removeIcon,
|
|
clearIcon
|
|
} = (0,iconUtil/* default */.Z)(Object.assign(Object.assign({}, props), {
|
|
multiple: isMultiple,
|
|
hasFeedback,
|
|
feedbackIcon,
|
|
showSuffixIcon,
|
|
prefixCls,
|
|
showArrow: props.showArrow,
|
|
componentName: 'Select'
|
|
}));
|
|
const mergedAllowClear = allowClear === true ? {
|
|
clearIcon
|
|
} : allowClear;
|
|
const selectProps = (0,es_omit/* default */.Z)(props, ['suffixIcon', 'itemIcon']);
|
|
const rcSelectRtlDropdownClassName = classnames_default()(popupClassName || dropdownClassName, {
|
|
[`${prefixCls}-dropdown-${direction}`]: direction === 'rtl'
|
|
}, rootClassName, hashId);
|
|
const mergedSize = (0,useSize/* default */.Z)(ctx => {
|
|
var _a;
|
|
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
|
|
});
|
|
// ===================== Disabled =====================
|
|
const disabled = react.useContext(DisabledContext/* default */.Z);
|
|
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
const mergedClassName = classnames_default()({
|
|
[`${prefixCls}-lg`]: mergedSize === 'large',
|
|
[`${prefixCls}-sm`]: mergedSize === 'small',
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
[`${prefixCls}-borderless`]: !bordered,
|
|
[`${prefixCls}-in-form-item`]: isFormItemInput
|
|
}, (0,statusUtils/* getStatusClassNames */.Z)(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, select === null || select === void 0 ? void 0 : select.className, className, rootClassName, hashId);
|
|
// ===================== Placement =====================
|
|
const memoPlacement = react.useMemo(() => {
|
|
if (placement !== undefined) {
|
|
return placement;
|
|
}
|
|
return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
|
|
}, [placement, direction]);
|
|
const mergedBuiltinPlacements = (0,useBuiltinPlacements/* default */.Z)(builtinPlacements, popupOverflow);
|
|
// ====================== Warning ======================
|
|
if (false) {}
|
|
// ====================== Render =======================
|
|
return wrapSSR( /*#__PURE__*/react.createElement(rc_select_es, Object.assign({
|
|
ref: ref,
|
|
virtual: virtual,
|
|
showSearch: select === null || select === void 0 ? void 0 : select.showSearch
|
|
}, selectProps, {
|
|
style: Object.assign(Object.assign({}, select === null || select === void 0 ? void 0 : select.style), style),
|
|
dropdownMatchSelectWidth: mergedPopupMatchSelectWidth,
|
|
builtinPlacements: mergedBuiltinPlacements,
|
|
transitionName: (0,motion/* getTransitionName */.m)(rootPrefixCls, 'slide-up', props.transitionName),
|
|
listHeight: listHeight,
|
|
listItemHeight: listItemHeight,
|
|
mode: mode,
|
|
prefixCls: prefixCls,
|
|
placement: memoPlacement,
|
|
direction: direction,
|
|
suffixIcon: suffixIcon,
|
|
menuItemSelectedIcon: itemIcon,
|
|
removeIcon: removeIcon,
|
|
allowClear: mergedAllowClear,
|
|
notFoundContent: mergedNotFound,
|
|
className: mergedClassName,
|
|
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
|
dropdownClassName: rcSelectRtlDropdownClassName,
|
|
disabled: mergedDisabled
|
|
})));
|
|
};
|
|
if (false) {}
|
|
const select_Select = /*#__PURE__*/react.forwardRef(InternalSelect);
|
|
// We don't care debug panel
|
|
/* istanbul ignore next */
|
|
const select_PurePanel = (0,PurePanel/* default */.Z)(select_Select);
|
|
select_Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
|
|
select_Select.Option = es_Option;
|
|
select_Select.OptGroup = es_OptGroup;
|
|
select_Select._InternalPanelDoNotUseOrYouWillBeFired = select_PurePanel;
|
|
if (false) {}
|
|
/* harmony default export */ var es_select = (select_Select);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 41771:
|
|
/*!*******************************************************************************************************!*\
|
|
!*** ./node_modules/antd/node_modules/rc-select/node_modules/react-is/cjs/react-is.production.min.js ***!
|
|
\*******************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, exports) {
|
|
|
|
var __webpack_unused_export__;
|
|
/** @license React v16.13.1
|
|
* react-is.production.min.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}__webpack_unused_export__=l;__webpack_unused_export__=m;__webpack_unused_export__=k;__webpack_unused_export__=h;__webpack_unused_export__=c;__webpack_unused_export__=n;__webpack_unused_export__=e;__webpack_unused_export__=t;__webpack_unused_export__=r;__webpack_unused_export__=d;
|
|
__webpack_unused_export__=g;__webpack_unused_export__=f;__webpack_unused_export__=p;__webpack_unused_export__=function(a){return A(a)||z(a)===l};__webpack_unused_export__=A;__webpack_unused_export__=function(a){return z(a)===k};__webpack_unused_export__=function(a){return z(a)===h};__webpack_unused_export__=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};__webpack_unused_export__=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};__webpack_unused_export__=function(a){return z(a)===t};
|
|
exports.isMemo=function(a){return z(a)===r};__webpack_unused_export__=function(a){return z(a)===d};__webpack_unused_export__=function(a){return z(a)===g};__webpack_unused_export__=function(a){return z(a)===f};__webpack_unused_export__=function(a){return z(a)===p};
|
|
__webpack_unused_export__=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};__webpack_unused_export__=z;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 47655:
|
|
/*!*********************************************************************************!*\
|
|
!*** ./node_modules/antd/node_modules/rc-select/node_modules/react-is/index.js ***!
|
|
\*********************************************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
|
|
if (true) {
|
|
module.exports = __webpack_require__(/*! ./cjs/react-is.production.min.js */ 41771);
|
|
} else {}
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |