UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

1,218 lines (1,124 loc) 8.18 MB
/*! * * antd v5.7.2 * * Copyright 2015-present, Alipay, Inc. * All rights reserved. * */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("dayjs"), require("react"), require("react-dom")); else if(typeof define === 'function' && define.amd) define(["dayjs", "react", "react-dom"], factory); else if(typeof exports === 'object') exports["antd"] = factory(require("dayjs"), require("react"), require("react-dom")); else root["antd"] = factory(root["dayjs"], root["React"], root["ReactDOM"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_dayjs__, __WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./components sync recursive ^\\.\\/[^_][\\w-]+\\/style\\/index\\.tsx?$": /*!**************************************************************!*\ !*** ./components sync ^\.\/[^_][\w-]+\/style\/index\.tsx?$ ***! \**************************************************************/ /*! no static exports found */ /*! all exports used */ /***/ (function(module, exports, __webpack_require__) { var map = { "./affix/style/index.ts": "./components/affix/style/index.ts", "./alert/style/index.ts": "./components/alert/style/index.ts", "./anchor/style/index.ts": "./components/anchor/style/index.ts", "./app/style/index.ts": "./components/app/style/index.ts", "./avatar/style/index.ts": "./components/avatar/style/index.ts", "./back-top/style/index.ts": "./components/back-top/style/index.ts", "./badge/style/index.ts": "./components/badge/style/index.ts", "./breadcrumb/style/index.ts": "./components/breadcrumb/style/index.ts", "./button/style/index.ts": "./components/button/style/index.ts", "./calendar/style/index.ts": "./components/calendar/style/index.ts", "./card/style/index.ts": "./components/card/style/index.ts", "./carousel/style/index.ts": "./components/carousel/style/index.ts", "./cascader/style/index.ts": "./components/cascader/style/index.ts", "./checkbox/style/index.ts": "./components/checkbox/style/index.ts", "./col/style/index.ts": "./components/col/style/index.ts", "./collapse/style/index.ts": "./components/collapse/style/index.ts", "./color-picker/style/index.ts": "./components/color-picker/style/index.ts", "./config-provider/style/index.ts": "./components/config-provider/style/index.ts", "./date-picker/style/index.ts": "./components/date-picker/style/index.ts", "./descriptions/style/index.ts": "./components/descriptions/style/index.ts", "./divider/style/index.ts": "./components/divider/style/index.ts", "./drawer/style/index.ts": "./components/drawer/style/index.ts", "./dropdown/style/index.ts": "./components/dropdown/style/index.ts", "./empty/style/index.ts": "./components/empty/style/index.ts", "./float-button/style/index.ts": "./components/float-button/style/index.ts", "./form/style/index.ts": "./components/form/style/index.ts", "./grid/style/index.ts": "./components/grid/style/index.ts", "./image/style/index.ts": "./components/image/style/index.ts", "./input-number/style/index.ts": "./components/input-number/style/index.ts", "./input/style/index.ts": "./components/input/style/index.ts", "./layout/style/index.ts": "./components/layout/style/index.ts", "./list/style/index.ts": "./components/list/style/index.ts", "./mentions/style/index.ts": "./components/mentions/style/index.ts", "./menu/style/index.tsx": "./components/menu/style/index.tsx", "./message/style/index.tsx": "./components/message/style/index.tsx", "./modal/style/index.tsx": "./components/modal/style/index.tsx", "./notification/style/index.tsx": "./components/notification/style/index.tsx", "./pagination/style/index.ts": "./components/pagination/style/index.ts", "./popconfirm/style/index.tsx": "./components/popconfirm/style/index.tsx", "./popover/style/index.tsx": "./components/popover/style/index.tsx", "./progress/style/index.tsx": "./components/progress/style/index.tsx", "./qr-code/style/index.ts": "./components/qr-code/style/index.ts", "./qrcode/style/index.ts": "./components/qrcode/style/index.ts", "./radio/style/index.tsx": "./components/radio/style/index.tsx", "./rate/style/index.tsx": "./components/rate/style/index.tsx", "./result/style/index.tsx": "./components/result/style/index.tsx", "./row/style/index.tsx": "./components/row/style/index.tsx", "./segmented/style/index.tsx": "./components/segmented/style/index.tsx", "./select/style/index.tsx": "./components/select/style/index.tsx", "./skeleton/style/index.tsx": "./components/skeleton/style/index.tsx", "./slider/style/index.tsx": "./components/slider/style/index.tsx", "./space/style/index.tsx": "./components/space/style/index.tsx", "./spin/style/index.tsx": "./components/spin/style/index.tsx", "./statistic/style/index.tsx": "./components/statistic/style/index.tsx", "./steps/style/index.tsx": "./components/steps/style/index.tsx", "./switch/style/index.ts": "./components/switch/style/index.ts", "./table/style/index.ts": "./components/table/style/index.ts", "./tabs/style/index.ts": "./components/tabs/style/index.ts", "./tag/style/index.ts": "./components/tag/style/index.ts", "./timeline/style/index.ts": "./components/timeline/style/index.ts", "./tooltip/style/index.ts": "./components/tooltip/style/index.ts", "./tour/style/index.ts": "./components/tour/style/index.ts", "./transfer/style/index.ts": "./components/transfer/style/index.ts", "./tree-select/style/index.ts": "./components/tree-select/style/index.ts", "./tree/style/index.ts": "./components/tree/style/index.ts", "./typography/style/index.ts": "./components/typography/style/index.ts", "./upload/style/index.ts": "./components/upload/style/index.ts" }; function webpackContext(req) { var id = webpackContextResolve(req); return __webpack_require__(id); } function webpackContextResolve(req) { if(!__webpack_require__.o(map, req)) { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } return map[req]; } webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = "./components sync recursive ^\\.\\/[^_][\\w-]+\\/style\\/index\\.tsx?$"; /***/ }), /***/ "./components/_util/ActionButton.tsx": /*!*******************************************!*\ !*** ./components/_util/ActionButton.tsx ***! \*******************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var rc_util_es_hooks_useState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-util/es/hooks/useState */ "./node_modules/rc-util/es/hooks/useState.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../button */ "./components/button/index.ts"); /* harmony import */ var _button_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../button/button */ "./components/button/button.tsx"); function isThenable(thing) { return !!(thing && thing.then); } const ActionButton = props => { const { type, children, prefixCls, buttonProps, close, autoFocus, emitEvent, quitOnNullishReturnValue, actionFn } = props; const clickedRef = react__WEBPACK_IMPORTED_MODULE_1__["useRef"](false); const buttonRef = react__WEBPACK_IMPORTED_MODULE_1__["useRef"](null); const [loading, setLoading] = Object(rc_util_es_hooks_useState__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(false); const onInternalClose = function () { close === null || close === void 0 ? void 0 : close.apply(void 0, arguments); }; react__WEBPACK_IMPORTED_MODULE_1__["useEffect"](() => { let timeoutId = null; if (autoFocus) { timeoutId = setTimeout(() => { var _a; (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }); } return () => { if (timeoutId) { clearTimeout(timeoutId); } }; }, []); const handlePromiseOnOk = returnValueOfOnOk => { if (!isThenable(returnValueOfOnOk)) { return; } setLoading(true); returnValueOfOnOk.then(function () { setLoading(false, true); onInternalClose.apply(void 0, arguments); clickedRef.current = false; }, e => { // See: https://github.com/ant-design/ant-design/issues/6183 setLoading(false, true); clickedRef.current = false; return Promise.reject(e); }); }; const onClick = e => { if (clickedRef.current) { return; } clickedRef.current = true; if (!actionFn) { onInternalClose(); return; } let returnValueOfOnOk; if (emitEvent) { returnValueOfOnOk = actionFn(e); if (quitOnNullishReturnValue && !isThenable(returnValueOfOnOk)) { clickedRef.current = false; onInternalClose(e); return; } } else if (actionFn.length) { returnValueOfOnOk = actionFn(close); // https://github.com/ant-design/ant-design/issues/23358 clickedRef.current = false; } else { returnValueOfOnOk = actionFn(); if (!returnValueOfOnOk) { onInternalClose(); return; } } handlePromiseOnOk(returnValueOfOnOk); }; return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_button__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], Object.assign({}, Object(_button_button__WEBPACK_IMPORTED_MODULE_3__[/* convertLegacyProps */ "a"])(type), { onClick: onClick, loading: loading, prefixCls: prefixCls }, buttonProps, { ref: buttonRef }), children); }; /* harmony default export */ __webpack_exports__["a"] = (ActionButton); /***/ }), /***/ "./components/_util/PurePanel.tsx": /*!****************************************!*\ !*** ./components/_util/PurePanel.tsx ***! \****************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return genPurePanel; }); /* harmony import */ var rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-util/es/hooks/useMergedState */ "./node_modules/rc-util/es/hooks/useMergedState.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config-provider */ "./components/config-provider/index.tsx"); /* istanbul ignore next */ function genPurePanel(Component, defaultPrefixCls, getDropdownCls, postProps) { return function PurePanel(props) { const { prefixCls: customizePrefixCls, style } = props; const holderRef = react__WEBPACK_IMPORTED_MODULE_1__["useRef"](null); const [popupHeight, setPopupHeight] = react__WEBPACK_IMPORTED_MODULE_1__["useState"](0); const [popupWidth, setPopupWidth] = react__WEBPACK_IMPORTED_MODULE_1__["useState"](0); const [open, setOpen] = Object(rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(false, { value: props.open }); const { getPrefixCls } = react__WEBPACK_IMPORTED_MODULE_1__["useContext"](_config_provider__WEBPACK_IMPORTED_MODULE_2__[/* ConfigContext */ "a"]); const prefixCls = getPrefixCls(defaultPrefixCls || 'select', customizePrefixCls); react__WEBPACK_IMPORTED_MODULE_1__["useEffect"](() => { // We do not care about ssr setOpen(true); if (typeof ResizeObserver !== 'undefined') { const resizeObserver = new ResizeObserver(entries => { const element = entries[0].target; setPopupHeight(element.offsetHeight + 8); setPopupWidth(element.offsetWidth); }); const interval = setInterval(() => { var _a; const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`; const popup = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(dropdownCls); if (popup) { clearInterval(interval); resizeObserver.observe(popup); } }, 10); return () => { clearInterval(interval); resizeObserver.disconnect(); }; } }, []); let mergedProps = Object.assign(Object.assign({}, props), { style: Object.assign(Object.assign({}, style), { margin: 0 }), open, visible: open, getPopupContainer: () => holderRef.current }); if (postProps) { mergedProps = postProps(mergedProps); } return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_config_provider__WEBPACK_IMPORTED_MODULE_2__[/* default */ "b"], { theme: { token: { motion: false } } }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { ref: holderRef, style: { paddingBottom: popupHeight, position: 'relative', minWidth: popupWidth } }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__["createElement"](Component, Object.assign({}, mergedProps)))); }; } /***/ }), /***/ "./components/_util/capitalize.ts": /*!****************************************!*\ !*** ./components/_util/capitalize.ts ***! \****************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return capitalize; }); function capitalize(str) { if (typeof str !== 'string') { return str; } const ret = str.charAt(0).toUpperCase() + str.slice(1); return ret; } /***/ }), /***/ "./components/_util/colors.ts": /*!************************************!*\ !*** ./components/_util/colors.ts ***! \************************************/ /*! exports provided: PresetStatusColorTypes, isPresetColor, isPresetStatusColor */ /*! exports used: isPresetColor, isPresetStatusColor */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export PresetStatusColorTypes */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isPresetColor; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isPresetStatusColor; }); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var _theme_interface__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../theme/interface */ "./components/theme/interface/index.ts"); const inverseColors = _theme_interface__WEBPACK_IMPORTED_MODULE_1__[/* PresetColors */ "a"].map(color => `${color}-inverse`); const PresetStatusColorTypes = ['success', 'processing', 'error', 'default', 'warning']; /** * determine if the color keyword belongs to the `Ant Design` {@link PresetColors}. * @param color color to be judged * @param includeInverse whether to include reversed colors */ function isPresetColor(color) { let includeInverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (includeInverse) { return [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(inverseColors), Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_theme_interface__WEBPACK_IMPORTED_MODULE_1__[/* PresetColors */ "a"])).includes(color); } return _theme_interface__WEBPACK_IMPORTED_MODULE_1__[/* PresetColors */ "a"].includes(color); } function isPresetStatusColor(color) { return PresetStatusColorTypes.includes(color); } /***/ }), /***/ "./components/_util/easings.ts": /*!*************************************!*\ !*** ./components/_util/easings.ts ***! \*************************************/ /*! exports provided: easeInOutCubic */ /*! exports used: easeInOutCubic */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return easeInOutCubic; }); // eslint-disable-next-line import/prefer-default-export function easeInOutCubic(t, b, c, d) { const cc = c - b; t /= d / 2; if (t < 1) { return cc / 2 * t * t * t + b; } // eslint-disable-next-line no-return-assign return cc / 2 * ((t -= 2) * t * t + 2) + b; } /***/ }), /***/ "./components/_util/extendsObject.ts": /*!*******************************************!*\ !*** ./components/_util/extendsObject.ts ***! \*******************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; function extendsObject() { const result = Object.assign({}, arguments.length <= 0 ? undefined : arguments[0]); for (let i = 1; i < arguments.length; i++) { const obj = i < 0 || arguments.length <= i ? undefined : arguments[i]; if (obj) { Object.keys(obj).forEach(key => { const val = obj[key]; if (val !== undefined) { result[key] = val; } }); } } return result; } /* harmony default export */ __webpack_exports__["a"] = (extendsObject); /***/ }), /***/ "./components/_util/getRenderPropValue.ts": /*!************************************************!*\ !*** ./components/_util/getRenderPropValue.ts ***! \************************************************/ /*! exports provided: getRenderPropValue */ /*! exports used: getRenderPropValue */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getRenderPropValue; }); const getRenderPropValue = propValue => { if (!propValue) { return null; } if (typeof propValue === 'function') { return propValue(); } return propValue; }; /***/ }), /***/ "./components/_util/getScroll.ts": /*!***************************************!*\ !*** ./components/_util/getScroll.ts ***! \***************************************/ /*! exports provided: isWindow, default */ /*! exports used: default, isWindow */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isWindow; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScroll; }); function isWindow(obj) { return obj !== null && obj !== undefined && obj === obj.window; } function getScroll(target, top) { var _a, _b; if (typeof window === 'undefined') { return 0; } const method = top ? 'scrollTop' : 'scrollLeft'; let result = 0; if (isWindow(target)) { result = target[top ? 'pageYOffset' : 'pageXOffset']; } else if (target instanceof Document) { result = target.documentElement[method]; } else if (target instanceof HTMLElement) { result = target[method]; } else if (target) { // According to the type inference, the `target` is `never` type. // Since we configured the loose mode type checking, and supports mocking the target with such shape below:: // `{ documentElement: { scrollLeft: 200, scrollTop: 400 } }`, // the program may falls into this branch. // Check the corresponding tests for details. Don't sure what is the real scenario this happens. result = target[method]; } if (target && !isWindow(target) && typeof result !== 'number') { result = (_b = ((_a = target.ownerDocument) !== null && _a !== void 0 ? _a : target).documentElement) === null || _b === void 0 ? void 0 : _b[method]; } return result; } /***/ }), /***/ "./components/_util/hooks/useClosable.tsx": /*!************************************************!*\ !*** ./components/_util/hooks/useClosable.tsx ***! \************************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useClosable; }); /* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/icons */ "./node_modules/@ant-design/icons/es/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); function useInnerClosable(closable, closeIcon, defaultClosable) { if (typeof closable === 'boolean') { return closable; } if (closeIcon === undefined) { return !!defaultClosable; } return closeIcon !== false && closeIcon !== null; } function useClosable(closable, closeIcon, customCloseIconRender) { let defaultCloseIcon = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_ant_design_icons__WEBPACK_IMPORTED_MODULE_0__[/* CloseOutlined */ "a"], null); let defaultClosable = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; const mergedClosable = useInnerClosable(closable, closeIcon, defaultClosable); if (!mergedClosable) { return [false, null]; } const mergedCloseIcon = typeof closeIcon === 'boolean' || closeIcon === undefined || closeIcon === null ? defaultCloseIcon : closeIcon; return [true, customCloseIconRender ? customCloseIconRender(mergedCloseIcon) : mergedCloseIcon]; } /***/ }), /***/ "./components/_util/hooks/useFlexGapSupport.ts": /*!*****************************************************!*\ !*** ./components/_util/hooks/useFlexGapSupport.ts ***! \*****************************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _styleChecker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../styleChecker */ "./components/_util/styleChecker.ts"); /* harmony default export */ __webpack_exports__["a"] = (() => { const [flexible, setFlexible] = react__WEBPACK_IMPORTED_MODULE_0__["useState"](false); react__WEBPACK_IMPORTED_MODULE_0__["useEffect"](() => { setFlexible(Object(_styleChecker__WEBPACK_IMPORTED_MODULE_1__[/* detectFlexGapSupported */ "b"])()); }, []); return flexible; }); /***/ }), /***/ "./components/_util/hooks/useForceUpdate.ts": /*!**************************************************!*\ !*** ./components/_util/hooks/useForceUpdate.ts ***! \**************************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useForceUpdate; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function useForceUpdate() { const [, forceUpdate] = react__WEBPACK_IMPORTED_MODULE_0__["useReducer"](x => x + 1, 0); return forceUpdate; } /***/ }), /***/ "./components/_util/hooks/usePatchElement.tsx": /*!****************************************************!*\ !*** ./components/_util/hooks/usePatchElement.tsx ***! \****************************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return usePatchElement; }); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); function usePatchElement() { const [elements, setElements] = react__WEBPACK_IMPORTED_MODULE_1__["useState"]([]); const patchElement = react__WEBPACK_IMPORTED_MODULE_1__["useCallback"](element => { // append a new element to elements (and create a new ref) setElements(originElements => [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(originElements), [element])); // return a function that removes the new element out of elements (and create a new ref) // it works a little like useEffect return () => { setElements(originElements => originElements.filter(ele => ele !== element)); }; }, []); return [elements, patchElement]; } /***/ }), /***/ "./components/_util/hooks/useSyncState.ts": /*!************************************************!*\ !*** ./components/_util/hooks/useSyncState.ts ***! \************************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useSyncState; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _useForceUpdate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useForceUpdate */ "./components/_util/hooks/useForceUpdate.ts"); function useSyncState(initialValue) { const ref = react__WEBPACK_IMPORTED_MODULE_0__["useRef"](initialValue); const forceUpdate = Object(_useForceUpdate__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(); return [() => ref.current, newValue => { ref.current = newValue; // re-render forceUpdate(); }]; } /***/ }), /***/ "./components/_util/isNumeric.ts": /*!***************************************!*\ !*** ./components/_util/isNumeric.ts ***! \***************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; const isNumeric = value => !isNaN(parseFloat(value)) && isFinite(value); /* harmony default export */ __webpack_exports__["a"] = (isNumeric); /***/ }), /***/ "./components/_util/motion.ts": /*!************************************!*\ !*** ./components/_util/motion.ts ***! \************************************/ /*! exports provided: getTransitionName, getTransitionDirection, default */ /*! exports used: default, getTransitionDirection, getTransitionName */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getTransitionName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getTransitionDirection; }); // ================== Collapse Motion ================== const getCollapsedHeight = () => ({ height: 0, opacity: 0 }); const getRealHeight = node => { const { scrollHeight } = node; return { height: scrollHeight, opacity: 1 }; }; const getCurrentHeight = node => ({ height: node ? node.offsetHeight : 0 }); const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height'; const initCollapseMotion = function () { let rootCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'ant'; return { motionName: `${rootCls}-motion-collapse`, onAppearStart: getCollapsedHeight, onEnterStart: getCollapsedHeight, onAppearActive: getRealHeight, onEnterActive: getRealHeight, onLeaveStart: getCurrentHeight, onLeaveActive: getCollapsedHeight, onAppearEnd: skipOpacityTransition, onEnterEnd: skipOpacityTransition, onLeaveEnd: skipOpacityTransition, motionDeadline: 500 }; }; const SelectPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight']; const getTransitionDirection = placement => { if (placement !== undefined && (placement === 'topLeft' || placement === 'topRight')) { return `slide-down`; } return `slide-up`; }; const getTransitionName = (rootPrefixCls, motion, transitionName) => { if (transitionName !== undefined) { return transitionName; } return `${rootPrefixCls}-${motion}`; }; /* harmony default export */ __webpack_exports__["a"] = (initCollapseMotion); /***/ }), /***/ "./components/_util/placements.ts": /*!****************************************!*\ !*** ./components/_util/placements.ts ***! \****************************************/ /*! exports provided: getOverflowOptions, default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export getOverflowOptions */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getPlacements; }); /* harmony import */ var _style_placementArrow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../style/placementArrow */ "./components/style/placementArrow.ts"); function getOverflowOptions(placement, arrowOffset, arrowWidth, autoAdjustOverflow) { if (autoAdjustOverflow === false) { return { adjustX: false, adjustY: false }; } const overflow = autoAdjustOverflow && typeof autoAdjustOverflow === 'object' ? autoAdjustOverflow : {}; const baseOverflow = {}; switch (placement) { case 'top': case 'bottom': baseOverflow.shiftX = arrowOffset.dropdownArrowOffset * 2 + arrowWidth; break; case 'left': case 'right': baseOverflow.shiftY = arrowOffset.dropdownArrowOffsetVertical * 2 + arrowWidth; break; } const mergedOverflow = Object.assign(Object.assign({}, baseOverflow), overflow); // Support auto shift if (!mergedOverflow.shiftX) { mergedOverflow.adjustX = true; } if (!mergedOverflow.shiftY) { mergedOverflow.adjustY = true; } return mergedOverflow; } const PlacementAlignMap = { left: { points: ['cr', 'cl'] }, right: { points: ['cl', 'cr'] }, top: { points: ['bc', 'tc'] }, bottom: { points: ['tc', 'bc'] }, topLeft: { points: ['bl', 'tl'] }, leftTop: { points: ['tr', 'tl'] }, topRight: { points: ['br', 'tr'] }, rightTop: { points: ['tl', 'tr'] }, bottomRight: { points: ['tr', 'br'] }, rightBottom: { points: ['bl', 'br'] }, bottomLeft: { points: ['tl', 'bl'] }, leftBottom: { points: ['br', 'bl'] } }; const ArrowCenterPlacementAlignMap = { topLeft: { points: ['bl', 'tc'] }, leftTop: { points: ['tr', 'cl'] }, topRight: { points: ['br', 'tc'] }, rightTop: { points: ['tl', 'cr'] }, bottomRight: { points: ['tr', 'bc'] }, rightBottom: { points: ['bl', 'cr'] }, bottomLeft: { points: ['tl', 'bc'] }, leftBottom: { points: ['br', 'cl'] } }; const DisableAutoArrowList = new Set(['topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop', 'rightBottom']); function getPlacements(config) { const { arrowWidth, autoAdjustOverflow, arrowPointAtCenter, offset, borderRadius, visibleFirst } = config; const halfArrowWidth = arrowWidth / 2; const placementMap = {}; Object.keys(PlacementAlignMap).forEach(key => { const template = arrowPointAtCenter && ArrowCenterPlacementAlignMap[key] || PlacementAlignMap[key]; const placementInfo = Object.assign(Object.assign({}, template), { offset: [0, 0] }); placementMap[key] = placementInfo; // Disable autoArrow since design is fixed position if (DisableAutoArrowList.has(key)) { placementInfo.autoArrow = false; } // Static offset switch (key) { case 'top': case 'topLeft': case 'topRight': placementInfo.offset[1] = -halfArrowWidth - offset; break; case 'bottom': case 'bottomLeft': case 'bottomRight': placementInfo.offset[1] = halfArrowWidth + offset; break; case 'left': case 'leftTop': case 'leftBottom': placementInfo.offset[0] = -halfArrowWidth - offset; break; case 'right': case 'rightTop': case 'rightBottom': placementInfo.offset[0] = halfArrowWidth + offset; break; } // Dynamic offset const arrowOffset = Object(_style_placementArrow__WEBPACK_IMPORTED_MODULE_0__[/* getArrowOffset */ "c"])({ contentRadius: borderRadius, limitVerticalRadius: true }); if (arrowPointAtCenter) { switch (key) { case 'topLeft': case 'bottomLeft': placementInfo.offset[0] = -arrowOffset.dropdownArrowOffset - halfArrowWidth; break; case 'topRight': case 'bottomRight': placementInfo.offset[0] = arrowOffset.dropdownArrowOffset + halfArrowWidth; break; case 'leftTop': case 'rightTop': placementInfo.offset[1] = -arrowOffset.dropdownArrowOffset - halfArrowWidth; break; case 'leftBottom': case 'rightBottom': placementInfo.offset[1] = arrowOffset.dropdownArrowOffset + halfArrowWidth; break; } } // Overflow placementInfo.overflow = getOverflowOptions(key, arrowOffset, arrowWidth, autoAdjustOverflow); // VisibleFirst if (visibleFirst) { placementInfo.htmlRegion = 'visibleFirst'; } }); return placementMap; } /***/ }), /***/ "./components/_util/reactNode.ts": /*!***************************************!*\ !*** ./components/_util/reactNode.ts ***! \***************************************/ /*! exports provided: isValidElement, isFragment, replaceElement, cloneElement */ /*! exports used: cloneElement, isFragment, isValidElement, replaceElement */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isValidElement; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFragment; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return replaceElement; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cloneElement; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); const { isValidElement } = react__WEBPACK_IMPORTED_MODULE_0__; function isFragment(child) { return child && isValidElement(child) && child.type === react__WEBPACK_IMPORTED_MODULE_0__["Fragment"]; } function replaceElement(element, replacement, props) { if (!isValidElement(element)) { return replacement; } return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["cloneElement"](element, typeof props === 'function' ? props(element.props || {}) : props); } function cloneElement(element, props) { return replaceElement(element, element, props); } /***/ }), /***/ "./components/_util/responsiveObserver.ts": /*!************************************************!*\ !*** ./components/_util/responsiveObserver.ts ***! \************************************************/ /*! exports provided: responsiveArray, default */ /*! exports used: default, responsiveArray */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return responsiveArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useResponsiveObserver; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../theme/internal */ "./components/theme/internal.ts"); const responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs']; const getResponsiveMap = token => ({ xs: `(max-width: ${token.screenXSMax}px)`, sm: `(min-width: ${token.screenSM}px)`, md: `(min-width: ${token.screenMD}px)`, lg: `(min-width: ${token.screenLG}px)`, xl: `(min-width: ${token.screenXL}px)`, xxl: `(min-width: ${token.screenXXL}px)` }); /** * Ensures that the breakpoints token are valid, in good order * For each breakpoint : screenMin <= screen <= screenMax and screenMax <= nextScreenMin */ const validateBreakpoints = token => { const indexableToken = token; const revBreakpoints = [].concat(responsiveArray).reverse(); revBreakpoints.forEach((breakpoint, i) => { const breakpointUpper = breakpoint.toUpperCase(); const screenMin = `screen${breakpointUpper}Min`; const screen = `screen${breakpointUpper}`; if (!(indexableToken[screenMin] <= indexableToken[screen])) { throw new Error(`${screenMin}<=${screen} fails : !(${indexableToken[screenMin]}<=${indexableToken[screen]})`); } if (i < revBreakpoints.length - 1) { const screenMax = `screen${breakpointUpper}Max`; if (!(indexableToken[screen] <= indexableToken[screenMax])) { throw new Error(`${screen}<=${screenMax} fails : !(${indexableToken[screen]}<=${indexableToken[screenMax]})`); } const nextBreakpointUpperMin = revBreakpoints[i + 1].toUpperCase(); const nextScreenMin = `screen${nextBreakpointUpperMin}Min`; if (!(indexableToken[screenMax] <= indexableToken[nextScreenMin])) { throw new Error(`${screenMax}<=${nextScreenMin} fails : !(${indexableToken[screenMax]}<=${indexableToken[nextScreenMin]})`); } } }); return token; }; function useResponsiveObserver() { const [, token] = Object(_theme_internal__WEBPACK_IMPORTED_MODULE_1__[/* useToken */ "g"])(); const responsiveMap = getResponsiveMap(validateBreakpoints(token)); // To avoid repeat create instance, we add `useMemo` here. return react__WEBPACK_IMPORTED_MODULE_0___default.a.useMemo(() => { const subscribers = new Map(); let subUid = -1; let screens = {}; return { matchHandlers: {}, dispatch(pointMap) { screens = pointMap; subscribers.forEach(func => func(screens)); return subscribers.size >= 1; }, subscribe(func) { if (!subscribers.size) this.register(); subUid += 1; subscribers.set(subUid, func); func(screens); return subUid; }, unsubscribe(paramToken) { subscribers.delete(paramToken); if (!subscribers.size) this.unregister(); }, unregister() { Object.keys(responsiveMap).forEach(screen => { const matchMediaQuery = responsiveMap[screen]; const handler = this.matchHandlers[matchMediaQuery]; handler === null || handler === void 0 ? void 0 : handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener); }); subscribers.clear(); }, register() { Object.keys(responsiveMap).forEach(screen => { const matchMediaQuery = responsiveMap[screen]; const listener = _ref => { let { matches } = _ref; this.dispatch(Object.assign(Object.assign({}, screens), { [screen]: matches })); }; const mql = window.matchMedia(matchMediaQuery); mql.addListener(listener); this.matchHandlers[matchMediaQuery] = { mql, listener }; listener(mql); }); }, responsiveMap }; }, [token]); } /***/ }), /***/ "./components/_util/scrollTo.ts": /*!**************************************!*\ !*** ./components/_util/scrollTo.ts ***! \**************************************/ /*! exports provided: default */ /*! exports used: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return scrollTo; }); /* harmony import */ var rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-util/es/raf */ "./node_modules/rc-util/es/raf.js"); /* harmony import */ var _easings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./easings */ "./components/_util/easings.ts"); /* harmony import */ var _getScroll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getScroll */ "./components/_util/getScroll.ts"); function scrollTo(y) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const { getContainer = () => window, callback, duration = 450 } = options; const container = getContainer(); const scrollTop = Object(_getScroll__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(container, true); const startTime = Date.now(); const frameFunc = () => { const timestamp = Date.now(); const time = timestamp - startTime; const nextScrollTop = Object(_easings__WEBPACK_IMPORTED_MODULE_1__[/* easeInOutCubic */ "a"])(time > duration ? duration : time, scrollTop, y, duration); if (Object(_getScroll__WEBPACK_IMPORTED_MODULE_2__[/* isWindow */ "b"])(container)) { container.scrollTo(window.pageXOffset, nextScrollTop); } else if (container instanceof Document || container.constructor.name === 'HTMLDocument') { container.documentElement.scrollTop = nextScrollTop; } else { container.scrollTop = nextScrollTop; } if (time < duration) { Object(rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(frameFunc); } else if (typeof callback === 'function') { callback(); } }; Object(rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(frameFunc); } /***/ }), /***/ "./components/_util/statusUtils.ts": /*!*****************************************!*\ !*** ./components/_util/statusUtils.ts ***! \*****************************************/ /*! exports provided: getStatusClassNames, getMergedStatus */ /*! exports used: getMergedStatus, getStatusClassNames */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getStatusClassNames; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getMergedStatus; }); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); const InputStatuses = ['warning', 'error', '']; function getStatusClassNames(prefixCls, status, hasFeedback) { return classnames__WEBPACK_IMPORTED_MODULE_0___default()({ [`${prefixCls}-status-success`]: status === 'success', [`${prefixCls}-status-warning`]: status === 'warning', [`${prefixCls}-status-error`]: status === 'error', [`${prefixCls}-status-validating`]: status === 'validating', [`${prefixCls}-has-feedback`]: hasFeedback }); } const getMergedStatus = (contextStatus, customStatus) => customStatus || contextStatus; /***/ }), /***/ "./components/_util/styleChecker.ts": /*!******************************************!*\ !*** ./components/_util/styleChecker.ts ***! \******************************************/ /*! exports provided: canUseDocElement, isStyleSupport, detectFlexGapSupported */ /*! exports used: canUseDocElement, detectFlexGapSupported, isStyleSupport */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return canUseDocElement; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return detectFlexGapSupported; }); /* harmony import */ var rc_util_es_Dom_canUseDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-util/es/Dom/canUseDom */ "./node_modules/rc-util/es/Dom/canUseDom.js"); /* harmony import */ var rc_util_es_Dom_styleC