|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[72565],{
|
|
|
|
|
|
/***/ 72565:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/antd/es/drawer/index.js + 36 modules ***!
|
|
|
\***********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ drawer; }
|
|
|
});
|
|
|
|
|
|
// 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/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/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/react-dom/index.js
|
|
|
var react_dom = __webpack_require__(73935);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/node_modules/@rc-component/portal/node_modules/rc-util/es/Dom/canUseDom.js
|
|
|
function canUseDom_canUseDom() {
|
|
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/node_modules/@rc-component/portal/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 noteOnce(valid, message) {
|
|
|
call(note, valid, message);
|
|
|
}
|
|
|
/* harmony default export */ var es_warning = ((/* unused pure expression or super */ null && (warningOnce)));
|
|
|
/* eslint-enable */
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
|
var esm_typeof = __webpack_require__(71002);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-drawer/node_modules/@rc-component/portal/node_modules/react-is/index.js
|
|
|
var react_is = __webpack_require__(18459);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/node_modules/@rc-component/portal/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/rc-drawer/node_modules/@rc-component/portal/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/rc-drawer/node_modules/@rc-component/portal/es/Context.js
|
|
|
|
|
|
var OrderContext = /*#__PURE__*/react.createContext(null);
|
|
|
/* harmony default export */ var Context = (OrderContext);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/node_modules/@rc-component/portal/node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
|
*/
|
|
|
var useLayoutEffect = true && canUseDom_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/rc-drawer/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_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/rc-drawer/node_modules/@rc-component/portal/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/rc-drawer/node_modules/@rc-component/portal/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_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/rc-drawer/node_modules/@rc-component/portal/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/rc-drawer/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/rc-drawer/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/rc-drawer/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/rc-drawer/node_modules/@rc-component/portal/es/Portal.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var getPortalContainer = function getPortalContainer(getContainer) {
|
|
|
if (getContainer === false) {
|
|
|
return false;
|
|
|
}
|
|
|
if (!canUseDom_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_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_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/rc-drawer/node_modules/@rc-component/portal/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var es = (es_Portal);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/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/rc-drawer/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 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 hooks_useLayoutEffect_useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
|
|
|
useLayoutEffect_useLayoutEffect(function (firstMount) {
|
|
|
if (!firstMount) {
|
|
|
return callback();
|
|
|
}
|
|
|
}, deps);
|
|
|
};
|
|
|
/* harmony default export */ var es_hooks_useLayoutEffect = (useLayoutEffect_useLayoutEffect);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/es/context.js
|
|
|
|
|
|
var DrawerContext = /*#__PURE__*/react.createContext(null);
|
|
|
var RefContext = /*#__PURE__*/react.createContext({});
|
|
|
/* harmony default export */ var context = (DrawerContext);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
|
var defineProperty = __webpack_require__(4942);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-motion/es/index.js + 11 modules
|
|
|
var rc_motion_es = __webpack_require__(62874);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/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);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/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;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/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/rc-drawer/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 = _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/rc-drawer/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 = useState(function () {
|
|
|
if (hasValue(value)) {
|
|
|
return value;
|
|
|
} else if (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 (!hasValue(value)) {
|
|
|
setInnerValue(value);
|
|
|
}
|
|
|
}, [value]);
|
|
|
|
|
|
// ====================== Update ======================
|
|
|
var triggerChange = useEvent(function (updater, ignoreDestroy) {
|
|
|
setInnerValue(updater, ignoreDestroy);
|
|
|
setPrevValue([mergedValue], ignoreDestroy);
|
|
|
});
|
|
|
return [postMergedValue, triggerChange];
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-drawer/node_modules/react-is/index.js
|
|
|
var node_modules_react_is = __webpack_require__(33993);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/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/rc-drawer/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 = 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;
|
|
|
}
|
|
|
function supportNodeRef(node) {
|
|
|
if (! /*#__PURE__*/isValidElement(node)) {
|
|
|
return false;
|
|
|
}
|
|
|
if (isFragment(node)) {
|
|
|
return false;
|
|
|
}
|
|
|
return ref_supportRef(node);
|
|
|
}
|
|
|
/* eslint-enable */
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/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/rc-drawer/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 warning_noteOnce(valid, message) {
|
|
|
warning_call(warning_note, valid, message);
|
|
|
}
|
|
|
warning_warningOnce.preMessage = preMessage;
|
|
|
warning_warningOnce.resetWarned = warning_resetWarned;
|
|
|
warning_warningOnce.noteOnce = warning_noteOnce;
|
|
|
/* harmony default export */ var rc_util_es_warning = (warning_warningOnce);
|
|
|
/* eslint-enable */
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/node_modules/rc-util/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/es/DrawerPanel.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DrawerPanel = function DrawerPanel(props) {
|
|
|
var prefixCls = props.prefixCls,
|
|
|
className = props.className,
|
|
|
style = props.style,
|
|
|
children = props.children,
|
|
|
containerRef = props.containerRef,
|
|
|
id = props.id,
|
|
|
onMouseEnter = props.onMouseEnter,
|
|
|
onMouseOver = props.onMouseOver,
|
|
|
onMouseLeave = props.onMouseLeave,
|
|
|
onClick = props.onClick,
|
|
|
onKeyDown = props.onKeyDown,
|
|
|
onKeyUp = props.onKeyUp;
|
|
|
var eventHandlers = {
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseOver: onMouseOver,
|
|
|
onMouseLeave: onMouseLeave,
|
|
|
onClick: onClick,
|
|
|
onKeyDown: onKeyDown,
|
|
|
onKeyUp: onKeyUp
|
|
|
};
|
|
|
var _React$useContext = react.useContext(RefContext),
|
|
|
panelRef = _React$useContext.panel;
|
|
|
var mergedRef = ref_useComposeRef(panelRef, containerRef);
|
|
|
|
|
|
// =============================== Render ===============================
|
|
|
|
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
|
id: id,
|
|
|
className: classnames_default()("".concat(prefixCls, "-content"), className),
|
|
|
style: (0,objectSpread2/* default */.Z)({}, style),
|
|
|
"aria-modal": "true",
|
|
|
role: "dialog",
|
|
|
ref: mergedRef
|
|
|
}, eventHandlers), children));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var es_DrawerPanel = (DrawerPanel);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/es/util.js
|
|
|
|
|
|
|
|
|
function parseWidthHeight(value) {
|
|
|
if (typeof value === 'string' && String(Number(value)) === value) {
|
|
|
rc_util_es_warning(false, 'Invalid value type of `width` or `height` which should be number type instead.');
|
|
|
return Number(value);
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
function warnCheck(props) {
|
|
|
warning(!('wrapperClassName' in props), "'wrapperClassName' is removed. Please use 'rootClassName' instead.");
|
|
|
warning(canUseDom() || !props.open, "Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.");
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/es/DrawerPopup.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var sentinelStyle = {
|
|
|
width: 0,
|
|
|
height: 0,
|
|
|
overflow: 'hidden',
|
|
|
outline: 'none',
|
|
|
position: 'absolute'
|
|
|
};
|
|
|
function DrawerPopup(props, ref) {
|
|
|
var _ref, _pushConfig$distance, _pushConfig, _classNames;
|
|
|
var prefixCls = props.prefixCls,
|
|
|
open = props.open,
|
|
|
placement = props.placement,
|
|
|
inline = props.inline,
|
|
|
push = props.push,
|
|
|
forceRender = props.forceRender,
|
|
|
autoFocus = props.autoFocus,
|
|
|
keyboard = props.keyboard,
|
|
|
rootClassName = props.rootClassName,
|
|
|
rootStyle = props.rootStyle,
|
|
|
zIndex = props.zIndex,
|
|
|
className = props.className,
|
|
|
id = props.id,
|
|
|
style = props.style,
|
|
|
motion = props.motion,
|
|
|
width = props.width,
|
|
|
height = props.height,
|
|
|
children = props.children,
|
|
|
contentWrapperStyle = props.contentWrapperStyle,
|
|
|
mask = props.mask,
|
|
|
maskClosable = props.maskClosable,
|
|
|
maskMotion = props.maskMotion,
|
|
|
maskClassName = props.maskClassName,
|
|
|
maskStyle = props.maskStyle,
|
|
|
afterOpenChange = props.afterOpenChange,
|
|
|
onClose = props.onClose,
|
|
|
onMouseEnter = props.onMouseEnter,
|
|
|
onMouseOver = props.onMouseOver,
|
|
|
onMouseLeave = props.onMouseLeave,
|
|
|
onClick = props.onClick,
|
|
|
onKeyDown = props.onKeyDown,
|
|
|
onKeyUp = props.onKeyUp;
|
|
|
|
|
|
// ================================ Refs ================================
|
|
|
var panelRef = react.useRef();
|
|
|
var sentinelStartRef = react.useRef();
|
|
|
var sentinelEndRef = react.useRef();
|
|
|
react.useImperativeHandle(ref, function () {
|
|
|
return panelRef.current;
|
|
|
});
|
|
|
var onPanelKeyDown = function onPanelKeyDown(event) {
|
|
|
var keyCode = event.keyCode,
|
|
|
shiftKey = event.shiftKey;
|
|
|
switch (keyCode) {
|
|
|
// Tab active
|
|
|
case es_KeyCode.TAB:
|
|
|
{
|
|
|
if (keyCode === es_KeyCode.TAB) {
|
|
|
if (!shiftKey && document.activeElement === sentinelEndRef.current) {
|
|
|
var _sentinelStartRef$cur;
|
|
|
(_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 ? void 0 : _sentinelStartRef$cur.focus({
|
|
|
preventScroll: true
|
|
|
});
|
|
|
} else if (shiftKey && document.activeElement === sentinelStartRef.current) {
|
|
|
var _sentinelEndRef$curre;
|
|
|
(_sentinelEndRef$curre = sentinelEndRef.current) === null || _sentinelEndRef$curre === void 0 ? void 0 : _sentinelEndRef$curre.focus({
|
|
|
preventScroll: true
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
// Close
|
|
|
case es_KeyCode.ESC:
|
|
|
{
|
|
|
if (onClose && keyboard) {
|
|
|
event.stopPropagation();
|
|
|
onClose(event);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// ========================== Control ===========================
|
|
|
// Auto Focus
|
|
|
react.useEffect(function () {
|
|
|
if (open && autoFocus) {
|
|
|
var _panelRef$current;
|
|
|
(_panelRef$current = panelRef.current) === null || _panelRef$current === void 0 ? void 0 : _panelRef$current.focus({
|
|
|
preventScroll: true
|
|
|
});
|
|
|
}
|
|
|
}, [open]);
|
|
|
|
|
|
// ============================ Push ============================
|
|
|
var _React$useState = react.useState(false),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
pushed = _React$useState2[0],
|
|
|
setPushed = _React$useState2[1];
|
|
|
var parentContext = react.useContext(context);
|
|
|
|
|
|
// Merge push distance
|
|
|
var pushConfig;
|
|
|
if (push === false) {
|
|
|
pushConfig = {
|
|
|
distance: 0
|
|
|
};
|
|
|
} else if (push === true) {
|
|
|
pushConfig = {};
|
|
|
} else {
|
|
|
pushConfig = push || {};
|
|
|
}
|
|
|
var pushDistance = (_ref = (_pushConfig$distance = (_pushConfig = pushConfig) === null || _pushConfig === void 0 ? void 0 : _pushConfig.distance) !== null && _pushConfig$distance !== void 0 ? _pushConfig$distance : parentContext === null || parentContext === void 0 ? void 0 : parentContext.pushDistance) !== null && _ref !== void 0 ? _ref : 180;
|
|
|
var mergedContext = react.useMemo(function () {
|
|
|
return {
|
|
|
pushDistance: pushDistance,
|
|
|
push: function push() {
|
|
|
setPushed(true);
|
|
|
},
|
|
|
pull: function pull() {
|
|
|
setPushed(false);
|
|
|
}
|
|
|
};
|
|
|
}, [pushDistance]);
|
|
|
|
|
|
// ========================= ScrollLock =========================
|
|
|
// Tell parent to push
|
|
|
react.useEffect(function () {
|
|
|
if (open) {
|
|
|
var _parentContext$push;
|
|
|
parentContext === null || parentContext === void 0 ? void 0 : (_parentContext$push = parentContext.push) === null || _parentContext$push === void 0 ? void 0 : _parentContext$push.call(parentContext);
|
|
|
} else {
|
|
|
var _parentContext$pull;
|
|
|
parentContext === null || parentContext === void 0 ? void 0 : (_parentContext$pull = parentContext.pull) === null || _parentContext$pull === void 0 ? void 0 : _parentContext$pull.call(parentContext);
|
|
|
}
|
|
|
}, [open]);
|
|
|
|
|
|
// Clean up
|
|
|
react.useEffect(function () {
|
|
|
return function () {
|
|
|
var _parentContext$pull2;
|
|
|
parentContext === null || parentContext === void 0 ? void 0 : (_parentContext$pull2 = parentContext.pull) === null || _parentContext$pull2 === void 0 ? void 0 : _parentContext$pull2.call(parentContext);
|
|
|
};
|
|
|
}, []);
|
|
|
|
|
|
// ============================ Mask ============================
|
|
|
var maskNode = mask && /*#__PURE__*/react.createElement(rc_motion_es/* default */.Z, (0,esm_extends/* default */.Z)({
|
|
|
key: "mask"
|
|
|
}, maskMotion, {
|
|
|
visible: open
|
|
|
}), function (_ref2, maskRef) {
|
|
|
var motionMaskClassName = _ref2.className,
|
|
|
motionMaskStyle = _ref2.style;
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
className: classnames_default()("".concat(prefixCls, "-mask"), motionMaskClassName, maskClassName),
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, motionMaskStyle), maskStyle),
|
|
|
onClick: maskClosable && open ? onClose : undefined,
|
|
|
ref: maskRef
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// =========================== Panel ============================
|
|
|
var motionProps = typeof motion === 'function' ? motion(placement) : motion;
|
|
|
var wrapperStyle = {};
|
|
|
if (pushed && pushDistance) {
|
|
|
switch (placement) {
|
|
|
case 'top':
|
|
|
wrapperStyle.transform = "translateY(".concat(pushDistance, "px)");
|
|
|
break;
|
|
|
case 'bottom':
|
|
|
wrapperStyle.transform = "translateY(".concat(-pushDistance, "px)");
|
|
|
break;
|
|
|
case 'left':
|
|
|
wrapperStyle.transform = "translateX(".concat(pushDistance, "px)");
|
|
|
break;
|
|
|
default:
|
|
|
wrapperStyle.transform = "translateX(".concat(-pushDistance, "px)");
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (placement === 'left' || placement === 'right') {
|
|
|
wrapperStyle.width = parseWidthHeight(width);
|
|
|
} else {
|
|
|
wrapperStyle.height = parseWidthHeight(height);
|
|
|
}
|
|
|
var eventHandlers = {
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseOver: onMouseOver,
|
|
|
onMouseLeave: onMouseLeave,
|
|
|
onClick: onClick,
|
|
|
onKeyDown: onKeyDown,
|
|
|
onKeyUp: onKeyUp
|
|
|
};
|
|
|
var panelNode = /*#__PURE__*/react.createElement(rc_motion_es/* default */.Z, (0,esm_extends/* default */.Z)({
|
|
|
key: "panel"
|
|
|
}, motionProps, {
|
|
|
visible: open,
|
|
|
forceRender: forceRender,
|
|
|
onVisibleChanged: function onVisibleChanged(nextVisible) {
|
|
|
afterOpenChange === null || afterOpenChange === void 0 ? void 0 : afterOpenChange(nextVisible);
|
|
|
},
|
|
|
removeOnLeave: false,
|
|
|
leavedClassName: "".concat(prefixCls, "-content-wrapper-hidden")
|
|
|
}), function (_ref3, motionRef) {
|
|
|
var motionClassName = _ref3.className,
|
|
|
motionStyle = _ref3.style;
|
|
|
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
|
className: classnames_default()("".concat(prefixCls, "-content-wrapper"), motionClassName),
|
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, wrapperStyle), motionStyle), contentWrapperStyle)
|
|
|
}, pickAttrs(props, {
|
|
|
data: true
|
|
|
})), /*#__PURE__*/react.createElement(es_DrawerPanel, (0,esm_extends/* default */.Z)({
|
|
|
id: id,
|
|
|
containerRef: motionRef,
|
|
|
prefixCls: prefixCls,
|
|
|
className: className,
|
|
|
style: style
|
|
|
}, eventHandlers), children));
|
|
|
});
|
|
|
|
|
|
// =========================== Render ===========================
|
|
|
var containerStyle = (0,objectSpread2/* default */.Z)({}, rootStyle);
|
|
|
if (zIndex) {
|
|
|
containerStyle.zIndex = zIndex;
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement(context.Provider, {
|
|
|
value: mergedContext
|
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
|
className: classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(placement), rootClassName, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-open"), open), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-inline"), inline), _classNames)),
|
|
|
style: containerStyle,
|
|
|
tabIndex: -1,
|
|
|
ref: panelRef,
|
|
|
onKeyDown: onPanelKeyDown
|
|
|
}, maskNode, /*#__PURE__*/react.createElement("div", {
|
|
|
tabIndex: 0,
|
|
|
ref: sentinelStartRef,
|
|
|
style: sentinelStyle,
|
|
|
"aria-hidden": "true",
|
|
|
"data-sentinel": "start"
|
|
|
}), panelNode, /*#__PURE__*/react.createElement("div", {
|
|
|
tabIndex: 0,
|
|
|
ref: sentinelEndRef,
|
|
|
style: sentinelStyle,
|
|
|
"aria-hidden": "true",
|
|
|
"data-sentinel": "end"
|
|
|
})));
|
|
|
}
|
|
|
var RefDrawerPopup = /*#__PURE__*/react.forwardRef(DrawerPopup);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var es_DrawerPopup = (RefDrawerPopup);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/es/Drawer.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Drawer = function Drawer(props) {
|
|
|
var _props$open = props.open,
|
|
|
open = _props$open === void 0 ? false : _props$open,
|
|
|
_props$prefixCls = props.prefixCls,
|
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-drawer' : _props$prefixCls,
|
|
|
_props$placement = props.placement,
|
|
|
placement = _props$placement === void 0 ? 'right' : _props$placement,
|
|
|
_props$autoFocus = props.autoFocus,
|
|
|
autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,
|
|
|
_props$keyboard = props.keyboard,
|
|
|
keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
|
|
|
_props$width = props.width,
|
|
|
width = _props$width === void 0 ? 378 : _props$width,
|
|
|
_props$mask = props.mask,
|
|
|
mask = _props$mask === void 0 ? true : _props$mask,
|
|
|
_props$maskClosable = props.maskClosable,
|
|
|
maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
|
|
|
getContainer = props.getContainer,
|
|
|
forceRender = props.forceRender,
|
|
|
afterOpenChange = props.afterOpenChange,
|
|
|
destroyOnClose = props.destroyOnClose,
|
|
|
onMouseEnter = props.onMouseEnter,
|
|
|
onMouseOver = props.onMouseOver,
|
|
|
onMouseLeave = props.onMouseLeave,
|
|
|
onClick = props.onClick,
|
|
|
onKeyDown = props.onKeyDown,
|
|
|
onKeyUp = props.onKeyUp,
|
|
|
panelRef = props.panelRef;
|
|
|
var _React$useState = react.useState(false),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
animatedVisible = _React$useState2[0],
|
|
|
setAnimatedVisible = _React$useState2[1];
|
|
|
|
|
|
// ============================= Warn =============================
|
|
|
if (false) {}
|
|
|
|
|
|
// ============================= Open =============================
|
|
|
var _React$useState3 = react.useState(false),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
mounted = _React$useState4[0],
|
|
|
setMounted = _React$useState4[1];
|
|
|
es_hooks_useLayoutEffect(function () {
|
|
|
setMounted(true);
|
|
|
}, []);
|
|
|
var mergedOpen = mounted ? open : false;
|
|
|
|
|
|
// ============================ Focus =============================
|
|
|
var popupRef = react.useRef();
|
|
|
var lastActiveRef = react.useRef();
|
|
|
es_hooks_useLayoutEffect(function () {
|
|
|
if (mergedOpen) {
|
|
|
lastActiveRef.current = document.activeElement;
|
|
|
}
|
|
|
}, [mergedOpen]);
|
|
|
|
|
|
// ============================= Open =============================
|
|
|
var internalAfterOpenChange = function internalAfterOpenChange(nextVisible) {
|
|
|
var _popupRef$current;
|
|
|
setAnimatedVisible(nextVisible);
|
|
|
afterOpenChange === null || afterOpenChange === void 0 ? void 0 : afterOpenChange(nextVisible);
|
|
|
if (!nextVisible && lastActiveRef.current && !((_popupRef$current = popupRef.current) !== null && _popupRef$current !== void 0 && _popupRef$current.contains(lastActiveRef.current))) {
|
|
|
var _lastActiveRef$curren;
|
|
|
(_lastActiveRef$curren = lastActiveRef.current) === null || _lastActiveRef$curren === void 0 ? void 0 : _lastActiveRef$curren.focus({
|
|
|
preventScroll: true
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// =========================== Context ============================
|
|
|
var refContext = react.useMemo(function () {
|
|
|
return {
|
|
|
panel: panelRef
|
|
|
};
|
|
|
}, [panelRef]);
|
|
|
|
|
|
// ============================ Render ============================
|
|
|
if (!forceRender && !animatedVisible && !mergedOpen && destroyOnClose) {
|
|
|
return null;
|
|
|
}
|
|
|
var eventHandlers = {
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseOver: onMouseOver,
|
|
|
onMouseLeave: onMouseLeave,
|
|
|
onClick: onClick,
|
|
|
onKeyDown: onKeyDown,
|
|
|
onKeyUp: onKeyUp
|
|
|
};
|
|
|
var drawerPopupProps = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
|
open: mergedOpen,
|
|
|
prefixCls: prefixCls,
|
|
|
placement: placement,
|
|
|
autoFocus: autoFocus,
|
|
|
keyboard: keyboard,
|
|
|
width: width,
|
|
|
mask: mask,
|
|
|
maskClosable: maskClosable,
|
|
|
inline: getContainer === false,
|
|
|
afterOpenChange: internalAfterOpenChange,
|
|
|
ref: popupRef
|
|
|
}, eventHandlers);
|
|
|
return /*#__PURE__*/react.createElement(RefContext.Provider, {
|
|
|
value: refContext
|
|
|
}, /*#__PURE__*/react.createElement(es, {
|
|
|
open: mergedOpen || forceRender || animatedVisible,
|
|
|
autoDestroy: false,
|
|
|
getContainer: getContainer,
|
|
|
autoLock: mask && (mergedOpen || animatedVisible)
|
|
|
}, /*#__PURE__*/react.createElement(es_DrawerPopup, drawerPopupProps)));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var es_Drawer = (Drawer);
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-drawer/es/index.js
|
|
|
// export this package's api
|
|
|
|
|
|
/* harmony default export */ var rc_drawer_es = (es_Drawer);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/motion.js
|
|
|
var motion = __webpack_require__(33603);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
|
var config_provider_context = __webpack_require__(53124);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/context.js
|
|
|
var form_context = __webpack_require__(65223);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/hooks/useClosable.js
|
|
|
var useClosable = __webpack_require__(69760);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/drawer/DrawerPanel.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const DrawerPanel_DrawerPanel = props => {
|
|
|
const {
|
|
|
prefixCls,
|
|
|
title,
|
|
|
footer,
|
|
|
extra,
|
|
|
closeIcon,
|
|
|
closable,
|
|
|
onClose,
|
|
|
headerStyle,
|
|
|
drawerStyle,
|
|
|
bodyStyle,
|
|
|
footerStyle,
|
|
|
children
|
|
|
} = props;
|
|
|
const customCloseIconRender = react.useCallback(icon => /*#__PURE__*/react.createElement("button", {
|
|
|
type: "button",
|
|
|
onClick: onClose,
|
|
|
"aria-label": "Close",
|
|
|
className: `${prefixCls}-close`
|
|
|
}, icon), [onClose]);
|
|
|
const [mergedClosable, mergedCloseIcon] = (0,useClosable/* default */.Z)(closable, closeIcon, customCloseIconRender, undefined, true);
|
|
|
const headerNode = react.useMemo(() => {
|
|
|
if (!title && !mergedClosable) {
|
|
|
return null;
|
|
|
}
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
style: headerStyle,
|
|
|
className: classnames_default()(`${prefixCls}-header`, {
|
|
|
[`${prefixCls}-header-close-only`]: mergedClosable && !title && !extra
|
|
|
})
|
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
|
className: `${prefixCls}-header-title`
|
|
|
}, mergedCloseIcon, title && /*#__PURE__*/react.createElement("div", {
|
|
|
className: `${prefixCls}-title`
|
|
|
}, title)), extra && /*#__PURE__*/react.createElement("div", {
|
|
|
className: `${prefixCls}-extra`
|
|
|
}, extra));
|
|
|
}, [mergedClosable, mergedCloseIcon, extra, headerStyle, prefixCls, title]);
|
|
|
const footerNode = react.useMemo(() => {
|
|
|
if (!footer) {
|
|
|
return null;
|
|
|
}
|
|
|
const footerClassName = `${prefixCls}-footer`;
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
className: footerClassName,
|
|
|
style: footerStyle
|
|
|
}, footer);
|
|
|
}, [footer, footerStyle, prefixCls]);
|
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
|
className: `${prefixCls}-wrapper-body`,
|
|
|
style: drawerStyle
|
|
|
}, headerNode, /*#__PURE__*/react.createElement("div", {
|
|
|
className: `${prefixCls}-body`,
|
|
|
style: bodyStyle
|
|
|
}, children), footerNode);
|
|
|
};
|
|
|
/* harmony default export */ var drawer_DrawerPanel = (DrawerPanel_DrawerPanel);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(4173);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(67968);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(45503);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/drawer/style/motion.js
|
|
|
const genMotionStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
motionDurationSlow
|
|
|
} = token;
|
|
|
const sharedPanelMotion = {
|
|
|
'&-enter, &-appear, &-leave': {
|
|
|
'&-start': {
|
|
|
transition: 'none'
|
|
|
},
|
|
|
'&-active': {
|
|
|
transition: `all ${motionDurationSlow}`
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
[componentCls]: {
|
|
|
// ======================== Mask ========================
|
|
|
[`${componentCls}-mask-motion`]: {
|
|
|
'&-enter, &-appear, &-leave': {
|
|
|
'&-active': {
|
|
|
transition: `all ${motionDurationSlow}`
|
|
|
}
|
|
|
},
|
|
|
'&-enter, &-appear': {
|
|
|
opacity: 0,
|
|
|
'&-active': {
|
|
|
opacity: 1
|
|
|
}
|
|
|
},
|
|
|
'&-leave': {
|
|
|
opacity: 1,
|
|
|
'&-active': {
|
|
|
opacity: 0
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// ======================= Panel ========================
|
|
|
[`${componentCls}-panel-motion`]: {
|
|
|
// Left
|
|
|
'&-left': [sharedPanelMotion, {
|
|
|
'&-enter, &-appear': {
|
|
|
'&-start': {
|
|
|
transform: 'translateX(-100%) !important'
|
|
|
},
|
|
|
'&-active': {
|
|
|
transform: 'translateX(0)'
|
|
|
}
|
|
|
},
|
|
|
'&-leave': {
|
|
|
transform: 'translateX(0)',
|
|
|
'&-active': {
|
|
|
transform: 'translateX(-100%)'
|
|
|
}
|
|
|
}
|
|
|
}],
|
|
|
// Right
|
|
|
'&-right': [sharedPanelMotion, {
|
|
|
'&-enter, &-appear': {
|
|
|
'&-start': {
|
|
|
transform: 'translateX(100%) !important'
|
|
|
},
|
|
|
'&-active': {
|
|
|
transform: 'translateX(0)'
|
|
|
}
|
|
|
},
|
|
|
'&-leave': {
|
|
|
transform: 'translateX(0)',
|
|
|
'&-active': {
|
|
|
transform: 'translateX(100%)'
|
|
|
}
|
|
|
}
|
|
|
}],
|
|
|
// Top
|
|
|
'&-top': [sharedPanelMotion, {
|
|
|
'&-enter, &-appear': {
|
|
|
'&-start': {
|
|
|
transform: 'translateY(-100%) !important'
|
|
|
},
|
|
|
'&-active': {
|
|
|
transform: 'translateY(0)'
|
|
|
}
|
|
|
},
|
|
|
'&-leave': {
|
|
|
transform: 'translateY(0)',
|
|
|
'&-active': {
|
|
|
transform: 'translateY(-100%)'
|
|
|
}
|
|
|
}
|
|
|
}],
|
|
|
// Bottom
|
|
|
'&-bottom': [sharedPanelMotion, {
|
|
|
'&-enter, &-appear': {
|
|
|
'&-start': {
|
|
|
transform: 'translateY(100%) !important'
|
|
|
},
|
|
|
'&-active': {
|
|
|
transform: 'translateY(0)'
|
|
|
}
|
|
|
},
|
|
|
'&-leave': {
|
|
|
transform: 'translateY(0)',
|
|
|
'&-active': {
|
|
|
transform: 'translateY(100%)'
|
|
|
}
|
|
|
}
|
|
|
}]
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ var style_motion = (genMotionStyle);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/drawer/style/index.js
|
|
|
|
|
|
|
|
|
// =============================== Base ===============================
|
|
|
const genDrawerStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
zIndexPopup,
|
|
|
colorBgMask,
|
|
|
colorBgElevated,
|
|
|
motionDurationSlow,
|
|
|
motionDurationMid,
|
|
|
padding,
|
|
|
paddingLG,
|
|
|
fontSizeLG,
|
|
|
lineHeightLG,
|
|
|
lineWidth,
|
|
|
lineType,
|
|
|
colorSplit,
|
|
|
marginSM,
|
|
|
colorIcon,
|
|
|
colorIconHover,
|
|
|
colorText,
|
|
|
fontWeightStrong,
|
|
|
footerPaddingBlock,
|
|
|
footerPaddingInline
|
|
|
} = token;
|
|
|
const wrapperCls = `${componentCls}-content-wrapper`;
|
|
|
return {
|
|
|
[componentCls]: {
|
|
|
position: 'fixed',
|
|
|
inset: 0,
|
|
|
zIndex: zIndexPopup,
|
|
|
pointerEvents: 'none',
|
|
|
'&-pure': {
|
|
|
position: 'relative',
|
|
|
background: colorBgElevated,
|
|
|
[`&${componentCls}-left`]: {
|
|
|
boxShadow: token.boxShadowDrawerLeft
|
|
|
},
|
|
|
[`&${componentCls}-right`]: {
|
|
|
boxShadow: token.boxShadowDrawerRight
|
|
|
},
|
|
|
[`&${componentCls}-top`]: {
|
|
|
boxShadow: token.boxShadowDrawerUp
|
|
|
},
|
|
|
[`&${componentCls}-bottom`]: {
|
|
|
boxShadow: token.boxShadowDrawerDown
|
|
|
}
|
|
|
},
|
|
|
'&-inline': {
|
|
|
position: 'absolute'
|
|
|
},
|
|
|
// ====================== Mask ======================
|
|
|
[`${componentCls}-mask`]: {
|
|
|
position: 'absolute',
|
|
|
inset: 0,
|
|
|
zIndex: zIndexPopup,
|
|
|
background: colorBgMask,
|
|
|
pointerEvents: 'auto'
|
|
|
},
|
|
|
// ==================== Content =====================
|
|
|
[wrapperCls]: {
|
|
|
position: 'absolute',
|
|
|
zIndex: zIndexPopup,
|
|
|
maxWidth: '100vw',
|
|
|
transition: `all ${motionDurationSlow}`,
|
|
|
'&-hidden': {
|
|
|
display: 'none'
|
|
|
}
|
|
|
},
|
|
|
// Placement
|
|
|
[`&-left > ${wrapperCls}`]: {
|
|
|
top: 0,
|
|
|
bottom: 0,
|
|
|
left: {
|
|
|
_skip_check_: true,
|
|
|
value: 0
|
|
|
},
|
|
|
boxShadow: token.boxShadowDrawerLeft
|
|
|
},
|
|
|
[`&-right > ${wrapperCls}`]: {
|
|
|
top: 0,
|
|
|
right: {
|
|
|
_skip_check_: true,
|
|
|
value: 0
|
|
|
},
|
|
|
bottom: 0,
|
|
|
boxShadow: token.boxShadowDrawerRight
|
|
|
},
|
|
|
[`&-top > ${wrapperCls}`]: {
|
|
|
top: 0,
|
|
|
insetInline: 0,
|
|
|
boxShadow: token.boxShadowDrawerUp
|
|
|
},
|
|
|
[`&-bottom > ${wrapperCls}`]: {
|
|
|
bottom: 0,
|
|
|
insetInline: 0,
|
|
|
boxShadow: token.boxShadowDrawerDown
|
|
|
},
|
|
|
[`${componentCls}-content`]: {
|
|
|
width: '100%',
|
|
|
height: '100%',
|
|
|
overflow: 'auto',
|
|
|
background: colorBgElevated,
|
|
|
pointerEvents: 'auto'
|
|
|
},
|
|
|
// ===================== Panel ======================
|
|
|
[`${componentCls}-wrapper-body`]: {
|
|
|
display: 'flex',
|
|
|
flexDirection: 'column',
|
|
|
width: '100%',
|
|
|
height: '100%'
|
|
|
},
|
|
|
// Header
|
|
|
[`${componentCls}-header`]: {
|
|
|
display: 'flex',
|
|
|
flex: 0,
|
|
|
alignItems: 'center',
|
|
|
padding: `${padding}px ${paddingLG}px`,
|
|
|
fontSize: fontSizeLG,
|
|
|
lineHeight: lineHeightLG,
|
|
|
borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`,
|
|
|
'&-title': {
|
|
|
display: 'flex',
|
|
|
flex: 1,
|
|
|
alignItems: 'center',
|
|
|
minWidth: 0,
|
|
|
minHeight: 0
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-extra`]: {
|
|
|
flex: 'none'
|
|
|
},
|
|
|
[`${componentCls}-close`]: {
|
|
|
display: 'inline-block',
|
|
|
marginInlineEnd: marginSM,
|
|
|
color: colorIcon,
|
|
|
fontWeight: fontWeightStrong,
|
|
|
fontSize: fontSizeLG,
|
|
|
fontStyle: 'normal',
|
|
|
lineHeight: 1,
|
|
|
textAlign: 'center',
|
|
|
textTransform: 'none',
|
|
|
textDecoration: 'none',
|
|
|
background: 'transparent',
|
|
|
border: 0,
|
|
|
outline: 0,
|
|
|
cursor: 'pointer',
|
|
|
transition: `color ${motionDurationMid}`,
|
|
|
textRendering: 'auto',
|
|
|
'&:focus, &:hover': {
|
|
|
color: colorIconHover,
|
|
|
textDecoration: 'none'
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-title`]: {
|
|
|
flex: 1,
|
|
|
margin: 0,
|
|
|
color: colorText,
|
|
|
fontWeight: token.fontWeightStrong,
|
|
|
fontSize: fontSizeLG,
|
|
|
lineHeight: lineHeightLG
|
|
|
},
|
|
|
// Body
|
|
|
[`${componentCls}-body`]: {
|
|
|
flex: 1,
|
|
|
minWidth: 0,
|
|
|
minHeight: 0,
|
|
|
padding: paddingLG,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
// Footer
|
|
|
[`${componentCls}-footer`]: {
|
|
|
flexShrink: 0,
|
|
|
padding: `${footerPaddingBlock}px ${footerPaddingInline}px`,
|
|
|
borderTop: `${lineWidth}px ${lineType} ${colorSplit}`
|
|
|
},
|
|
|
// ====================== RTL =======================
|
|
|
'&-rtl': {
|
|
|
direction: 'rtl'
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var drawer_style = ((0,genComponentStyleHook/* default */.Z)('Drawer', token => {
|
|
|
const drawerToken = (0,statistic/* merge */.TS)(token, {});
|
|
|
return [genDrawerStyle(drawerToken), style_motion(drawerToken)];
|
|
|
}, token => ({
|
|
|
zIndexPopup: token.zIndexPopupBase,
|
|
|
footerPaddingBlock: token.paddingXS,
|
|
|
footerPaddingInline: token.padding
|
|
|
})));
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/watermark/context.js
|
|
|
var watermark_context = __webpack_require__(16569);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/drawer/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;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CSSINJS
|
|
|
|
|
|
|
|
|
|
|
|
const SizeTypes = (/* unused pure expression or super */ null && (['default', 'large']));
|
|
|
const defaultPushState = {
|
|
|
distance: 180
|
|
|
};
|
|
|
const drawer_Drawer = props => {
|
|
|
var _a;
|
|
|
const {
|
|
|
rootClassName,
|
|
|
width,
|
|
|
height,
|
|
|
size = 'default',
|
|
|
mask = true,
|
|
|
push = defaultPushState,
|
|
|
open,
|
|
|
afterOpenChange,
|
|
|
onClose,
|
|
|
prefixCls: customizePrefixCls,
|
|
|
getContainer: customizeGetContainer,
|
|
|
style,
|
|
|
className,
|
|
|
// Deprecated
|
|
|
visible,
|
|
|
afterVisibleChange
|
|
|
} = props,
|
|
|
rest = __rest(props, ["rootClassName", "width", "height", "size", "mask", "push", "open", "afterOpenChange", "onClose", "prefixCls", "getContainer", "style", "className", "visible", "afterVisibleChange"]);
|
|
|
const {
|
|
|
getPopupContainer,
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
drawer
|
|
|
} = react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const prefixCls = getPrefixCls('drawer', customizePrefixCls);
|
|
|
// Style
|
|
|
const [wrapSSR, hashId] = drawer_style(prefixCls);
|
|
|
const getContainer =
|
|
|
// 有可能为 false,所以不能直接判断
|
|
|
customizeGetContainer === undefined && getPopupContainer ? () => getPopupContainer(document.body) : customizeGetContainer;
|
|
|
const drawerClassName = classnames_default()({
|
|
|
'no-mask': !mask,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, rootClassName, hashId);
|
|
|
// ========================== Warning ===========================
|
|
|
if (false) {}
|
|
|
// ============================ Size ============================
|
|
|
const mergedWidth = react.useMemo(() => width !== null && width !== void 0 ? width : size === 'large' ? 736 : 378, [width, size]);
|
|
|
const mergedHeight = react.useMemo(() => height !== null && height !== void 0 ? height : size === 'large' ? 736 : 378, [height, size]);
|
|
|
// =========================== Motion ===========================
|
|
|
const maskMotion = {
|
|
|
motionName: (0,motion/* getTransitionName */.m)(prefixCls, 'mask-motion'),
|
|
|
motionAppear: true,
|
|
|
motionEnter: true,
|
|
|
motionLeave: true,
|
|
|
motionDeadline: 500
|
|
|
};
|
|
|
const panelMotion = motionPlacement => ({
|
|
|
motionName: (0,motion/* getTransitionName */.m)(prefixCls, `panel-motion-${motionPlacement}`),
|
|
|
motionAppear: true,
|
|
|
motionEnter: true,
|
|
|
motionLeave: true,
|
|
|
motionDeadline: 500
|
|
|
});
|
|
|
// ============================ Refs ============================
|
|
|
// Select `ant-modal-content` by `panelRef`
|
|
|
const panelRef = (0,watermark_context/* usePanelRef */.H)();
|
|
|
// =========================== Render ===========================
|
|
|
return wrapSSR( /*#__PURE__*/react.createElement(Compact/* NoCompactStyle */.BR, null, /*#__PURE__*/react.createElement(form_context/* NoFormStyle */.Ux, {
|
|
|
status: true,
|
|
|
override: true
|
|
|
}, /*#__PURE__*/react.createElement(rc_drawer_es, Object.assign({
|
|
|
prefixCls: prefixCls,
|
|
|
onClose: onClose,
|
|
|
maskMotion: maskMotion,
|
|
|
motion: panelMotion
|
|
|
}, rest, {
|
|
|
open: open !== null && open !== void 0 ? open : visible,
|
|
|
mask: mask,
|
|
|
push: push,
|
|
|
width: mergedWidth,
|
|
|
height: mergedHeight,
|
|
|
style: Object.assign(Object.assign({}, drawer === null || drawer === void 0 ? void 0 : drawer.style), style),
|
|
|
className: classnames_default()(drawer === null || drawer === void 0 ? void 0 : drawer.className, className),
|
|
|
rootClassName: drawerClassName,
|
|
|
getContainer: getContainer,
|
|
|
afterOpenChange: afterOpenChange !== null && afterOpenChange !== void 0 ? afterOpenChange : afterVisibleChange,
|
|
|
panelRef: panelRef
|
|
|
}), /*#__PURE__*/react.createElement(drawer_DrawerPanel, Object.assign({
|
|
|
prefixCls: prefixCls
|
|
|
}, rest, {
|
|
|
onClose: onClose
|
|
|
}))))));
|
|
|
};
|
|
|
/** @private Internal Component. Do not use in your production. */
|
|
|
const PurePanel = props => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
style,
|
|
|
className,
|
|
|
placement = 'right'
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "style", "className", "placement"]);
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const prefixCls = getPrefixCls('drawer', customizePrefixCls);
|
|
|
// Style
|
|
|
const [wrapSSR, hashId] = drawer_style(prefixCls);
|
|
|
const cls = classnames_default()(prefixCls, `${prefixCls}-pure`, `${prefixCls}-${placement}`, hashId, className);
|
|
|
return wrapSSR( /*#__PURE__*/react.createElement("div", {
|
|
|
className: cls,
|
|
|
style: style
|
|
|
}, /*#__PURE__*/react.createElement(drawer_DrawerPanel, Object.assign({
|
|
|
prefixCls: prefixCls
|
|
|
}, restProps))));
|
|
|
};
|
|
|
drawer_Drawer._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var drawer = (drawer_Drawer);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 26819:
|
|
|
/*!***********************************************************************************************************************!*\
|
|
|
!*** ./node_modules/rc-drawer/node_modules/@rc-component/portal/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};__webpack_unused_export__=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;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 18459:
|
|
|
/*!*************************************************************************************************!*\
|
|
|
!*** ./node_modules/rc-drawer/node_modules/@rc-component/portal/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 */ 26819);
|
|
|
} else {}
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 16651:
|
|
|
/*!*************************************************************************************!*\
|
|
|
!*** ./node_modules/rc-drawer/node_modules/react-is/cjs/react-is.production.min.js ***!
|
|
|
\*************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, exports) {
|
|
|
|
|
|
var __webpack_unused_export__;
|
|
|
/**
|
|
|
* @license React
|
|
|
* 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=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
|
|
|
function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}__webpack_unused_export__=h;__webpack_unused_export__=g;__webpack_unused_export__=b;__webpack_unused_export__=l;__webpack_unused_export__=d;__webpack_unused_export__=q;__webpack_unused_export__=p;__webpack_unused_export__=c;__webpack_unused_export__=f;__webpack_unused_export__=e;__webpack_unused_export__=m;
|
|
|
__webpack_unused_export__=n;__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(a){return v(a)===h};__webpack_unused_export__=function(a){return v(a)===g};__webpack_unused_export__=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};__webpack_unused_export__=function(a){return v(a)===l};__webpack_unused_export__=function(a){return v(a)===d};__webpack_unused_export__=function(a){return v(a)===q};__webpack_unused_export__=function(a){return v(a)===p};
|
|
|
__webpack_unused_export__=function(a){return v(a)===c};__webpack_unused_export__=function(a){return v(a)===f};__webpack_unused_export__=function(a){return v(a)===e};__webpack_unused_export__=function(a){return v(a)===m};__webpack_unused_export__=function(a){return v(a)===n};
|
|
|
__webpack_unused_export__=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};__webpack_unused_export__=v;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 33993:
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./node_modules/rc-drawer/node_modules/react-is/index.js ***!
|
|
|
\***************************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
if (true) {
|
|
|
/* unused reexport */ __webpack_require__(/*! ./cjs/react-is.production.min.js */ 16651);
|
|
|
} else {}
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |