You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6967 lines
215 KiB
6967 lines
215 KiB
(self["webpackChunk"] = self["webpackChunk"] || []).push([[37567,47897,48358,88511],{
|
|
|
|
/***/ 97937:
|
|
/*!******************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/CloseOutlined.js + 1 modules ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_CloseOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/CloseOutlined.js
|
|
// This icon file is generated automatically.
|
|
var CloseOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" } }] }, "name": "close", "theme": "outlined" };
|
|
/* harmony default export */ var asn_CloseOutlined = (CloseOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 9 modules
|
|
var AntdIcon = __webpack_require__(43387);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/CloseOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var CloseOutlined_CloseOutlined = function CloseOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_CloseOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_CloseOutlined = (/*#__PURE__*/react.forwardRef(CloseOutlined_CloseOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 95604:
|
|
/*!*******************************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/DeliveredProcedureOutlined.js + 1 modules ***!
|
|
\*******************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_DeliveredProcedureOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/DeliveredProcedureOutlined.js
|
|
// This icon file is generated automatically.
|
|
var DeliveredProcedureOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M632 698.3l141.9-112a8 8 0 000-12.6L632 461.7c-5.3-4.2-13-.4-13 6.3v76H295c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h324v76c0 6.7 7.8 10.4 13 6.3zm261.3-405L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v278c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V422c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-83.5c0-17-6.7-33.2-18.7-45.2zM640 288H384V184h256v104zm264 436h-56c-4.4 0-8 3.6-8 8v108H184V732c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v148c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V732c0-4.4-3.6-8-8-8z" } }] }, "name": "delivered-procedure", "theme": "outlined" };
|
|
/* harmony default export */ var asn_DeliveredProcedureOutlined = (DeliveredProcedureOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 9 modules
|
|
var AntdIcon = __webpack_require__(43387);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/DeliveredProcedureOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var DeliveredProcedureOutlined_DeliveredProcedureOutlined = function DeliveredProcedureOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_DeliveredProcedureOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_DeliveredProcedureOutlined = (/*#__PURE__*/react.forwardRef(DeliveredProcedureOutlined_DeliveredProcedureOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 23430:
|
|
/*!*********************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/DownloadOutlined.js + 1 modules ***!
|
|
\*********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_DownloadOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/DownloadOutlined.js
|
|
// This icon file is generated automatically.
|
|
var DownloadOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" } }] }, "name": "download", "theme": "outlined" };
|
|
/* harmony default export */ var asn_DownloadOutlined = (DownloadOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 9 modules
|
|
var AntdIcon = __webpack_require__(43387);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/DownloadOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var DownloadOutlined_DownloadOutlined = function DownloadOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_DownloadOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_DownloadOutlined = (/*#__PURE__*/react.forwardRef(DownloadOutlined_DownloadOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 24969:
|
|
/*!*****************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/PlusOutlined.js + 1 modules ***!
|
|
\*****************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_PlusOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/PlusOutlined.js
|
|
// This icon file is generated automatically.
|
|
var PlusOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" };
|
|
/* harmony default export */ var asn_PlusOutlined = (PlusOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 9 modules
|
|
var AntdIcon = __webpack_require__(43387);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/PlusOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var PlusOutlined_PlusOutlined = function PlusOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_PlusOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_PlusOutlined = (/*#__PURE__*/react.forwardRef(PlusOutlined_PlusOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 33160:
|
|
/*!*******************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/ReloadOutlined.js + 1 modules ***!
|
|
\*******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_ReloadOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/ReloadOutlined.js
|
|
// This icon file is generated automatically.
|
|
var ReloadOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z" } }] }, "name": "reload", "theme": "outlined" };
|
|
/* harmony default export */ var asn_ReloadOutlined = (ReloadOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 9 modules
|
|
var AntdIcon = __webpack_require__(43387);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/ReloadOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var ReloadOutlined_ReloadOutlined = function ReloadOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_ReloadOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_ReloadOutlined = (/*#__PURE__*/react.forwardRef(ReloadOutlined_ReloadOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 42952:
|
|
/*!********************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/SettingOutlined.js + 1 modules ***!
|
|
\********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_SettingOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/SettingOutlined.js
|
|
// This icon file is generated automatically.
|
|
var SettingOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z" } }] }, "name": "setting", "theme": "outlined" };
|
|
/* harmony default export */ var asn_SettingOutlined = (SettingOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 9 modules
|
|
var AntdIcon = __webpack_require__(43387);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/SettingOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var SettingOutlined_SettingOutlined = function SettingOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_SettingOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_SettingOutlined = (/*#__PURE__*/react.forwardRef(SettingOutlined_SettingOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 48783:
|
|
/*!****************************************************************!*\
|
|
!*** ./node_modules/antd/es/_util/throttleByAnimationFrame.js ***!
|
|
\****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ 74902);
|
|
/* harmony import */ var rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-util/es/raf */ 96523);
|
|
|
|
|
|
function throttleByAnimationFrame(fn) {
|
|
let requestId;
|
|
const later = args => () => {
|
|
requestId = null;
|
|
fn.apply(void 0, (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(args));
|
|
};
|
|
const throttled = function () {
|
|
if (requestId == null) {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
requestId = (0,rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(later(args));
|
|
}
|
|
};
|
|
throttled.cancel = () => {
|
|
rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__/* ["default"].cancel */ .Z.cancel(requestId);
|
|
requestId = null;
|
|
};
|
|
return throttled;
|
|
}
|
|
/* harmony default export */ __webpack_exports__["Z"] = (throttleByAnimationFrame);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 30291:
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/antd/es/affix/index.js + 2 modules ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ affix; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
var classCallCheck = __webpack_require__(15671);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
var createClass = __webpack_require__(43144);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
|
var inherits = __webpack_require__(60136);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules
|
|
var createSuper = __webpack_require__(51630);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/rc-resize-observer/es/index.js + 4 modules
|
|
var es = __webpack_require__(48555);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
|
|
var omit = __webpack_require__(10366);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/throttleByAnimationFrame.js
|
|
var throttleByAnimationFrame = __webpack_require__(48783);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// 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/affix/style/index.js
|
|
|
|
// ============================== Shared ==============================
|
|
const genSharedAffixStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: {
|
|
position: 'fixed',
|
|
zIndex: token.zIndexPopup
|
|
}
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var style = ((0,genComponentStyleHook/* default */.Z)('Affix', token => {
|
|
const affixToken = (0,statistic/* merge */.TS)(token, {
|
|
zIndexPopup: token.zIndexBase + 10
|
|
});
|
|
return [genSharedAffixStyle(affixToken)];
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/affix/utils.js
|
|
function getTargetRect(target) {
|
|
return target !== window ? target.getBoundingClientRect() : {
|
|
top: 0,
|
|
bottom: window.innerHeight
|
|
};
|
|
}
|
|
function getFixedTop(placeholderRect, targetRect, offsetTop) {
|
|
if (offsetTop !== undefined && targetRect.top > placeholderRect.top - offsetTop) {
|
|
return offsetTop + targetRect.top;
|
|
}
|
|
return undefined;
|
|
}
|
|
function getFixedBottom(placeholderRect, targetRect, offsetBottom) {
|
|
if (offsetBottom !== undefined && targetRect.bottom < placeholderRect.bottom + offsetBottom) {
|
|
const targetBottomOffset = window.innerHeight - targetRect.bottom;
|
|
return offsetBottom + targetBottomOffset;
|
|
}
|
|
return undefined;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/affix/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TRIGGER_EVENTS = ['resize', 'scroll', 'touchstart', 'touchmove', 'touchend', 'pageshow', 'load'];
|
|
function getDefaultTarget() {
|
|
return typeof window !== 'undefined' ? window : null;
|
|
}
|
|
var AffixStatus;
|
|
(function (AffixStatus) {
|
|
AffixStatus[AffixStatus["None"] = 0] = "None";
|
|
AffixStatus[AffixStatus["Prepare"] = 1] = "Prepare";
|
|
})(AffixStatus || (AffixStatus = {}));
|
|
let InternalAffix = /*#__PURE__*/function (_React$Component) {
|
|
(0,inherits/* default */.Z)(InternalAffix, _React$Component);
|
|
var _super = (0,createSuper/* default */.Z)(InternalAffix);
|
|
function InternalAffix() {
|
|
var _this;
|
|
(0,classCallCheck/* default */.Z)(this, InternalAffix);
|
|
_this = _super.apply(this, arguments);
|
|
_this.state = {
|
|
status: AffixStatus.None,
|
|
lastAffix: false,
|
|
prevTarget: null
|
|
};
|
|
_this.placeholderNodeRef = /*#__PURE__*/(0,react.createRef)();
|
|
_this.fixedNodeRef = /*#__PURE__*/(0,react.createRef)();
|
|
_this.addListeners = () => {
|
|
const targetFunc = _this.getTargetFunc();
|
|
const target = targetFunc === null || targetFunc === void 0 ? void 0 : targetFunc();
|
|
const {
|
|
prevTarget
|
|
} = _this.state;
|
|
if (prevTarget !== target) {
|
|
TRIGGER_EVENTS.forEach(eventName => {
|
|
prevTarget === null || prevTarget === void 0 ? void 0 : prevTarget.removeEventListener(eventName, _this.lazyUpdatePosition);
|
|
target === null || target === void 0 ? void 0 : target.addEventListener(eventName, _this.lazyUpdatePosition);
|
|
});
|
|
_this.updatePosition();
|
|
_this.setState({
|
|
prevTarget: target
|
|
});
|
|
}
|
|
};
|
|
_this.removeListeners = () => {
|
|
if (_this.timer) {
|
|
clearTimeout(_this.timer);
|
|
_this.timer = null;
|
|
}
|
|
const {
|
|
prevTarget
|
|
} = _this.state;
|
|
const targetFunc = _this.getTargetFunc();
|
|
const newTarget = targetFunc === null || targetFunc === void 0 ? void 0 : targetFunc();
|
|
TRIGGER_EVENTS.forEach(eventName => {
|
|
newTarget === null || newTarget === void 0 ? void 0 : newTarget.removeEventListener(eventName, _this.lazyUpdatePosition);
|
|
prevTarget === null || prevTarget === void 0 ? void 0 : prevTarget.removeEventListener(eventName, _this.lazyUpdatePosition);
|
|
});
|
|
_this.updatePosition.cancel();
|
|
// https://github.com/ant-design/ant-design/issues/22683
|
|
_this.lazyUpdatePosition.cancel();
|
|
};
|
|
_this.getOffsetTop = () => {
|
|
const {
|
|
offsetBottom,
|
|
offsetTop
|
|
} = _this.props;
|
|
return offsetBottom === undefined && offsetTop === undefined ? 0 : offsetTop;
|
|
};
|
|
_this.getOffsetBottom = () => _this.props.offsetBottom;
|
|
// =================== Measure ===================
|
|
_this.measure = () => {
|
|
const {
|
|
status,
|
|
lastAffix
|
|
} = _this.state;
|
|
const {
|
|
onChange
|
|
} = _this.props;
|
|
const targetFunc = _this.getTargetFunc();
|
|
if (status !== AffixStatus.Prepare || !_this.fixedNodeRef.current || !_this.placeholderNodeRef.current || !targetFunc) {
|
|
return;
|
|
}
|
|
const offsetTop = _this.getOffsetTop();
|
|
const offsetBottom = _this.getOffsetBottom();
|
|
const targetNode = targetFunc();
|
|
if (targetNode) {
|
|
const newState = {
|
|
status: AffixStatus.None
|
|
};
|
|
const placeholderRect = getTargetRect(_this.placeholderNodeRef.current);
|
|
if (placeholderRect.top === 0 && placeholderRect.left === 0 && placeholderRect.width === 0 && placeholderRect.height === 0) {
|
|
return;
|
|
}
|
|
const targetRect = getTargetRect(targetNode);
|
|
const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop);
|
|
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
|
|
if (fixedTop !== undefined) {
|
|
newState.affixStyle = {
|
|
position: 'fixed',
|
|
top: fixedTop,
|
|
width: placeholderRect.width,
|
|
height: placeholderRect.height
|
|
};
|
|
newState.placeholderStyle = {
|
|
width: placeholderRect.width,
|
|
height: placeholderRect.height
|
|
};
|
|
} else if (fixedBottom !== undefined) {
|
|
newState.affixStyle = {
|
|
position: 'fixed',
|
|
bottom: fixedBottom,
|
|
width: placeholderRect.width,
|
|
height: placeholderRect.height
|
|
};
|
|
newState.placeholderStyle = {
|
|
width: placeholderRect.width,
|
|
height: placeholderRect.height
|
|
};
|
|
}
|
|
newState.lastAffix = !!newState.affixStyle;
|
|
if (onChange && lastAffix !== newState.lastAffix) {
|
|
onChange(newState.lastAffix);
|
|
}
|
|
_this.setState(newState);
|
|
}
|
|
};
|
|
_this.prepareMeasure = () => {
|
|
// event param is used before. Keep compatible ts define here.
|
|
_this.setState({
|
|
status: AffixStatus.Prepare,
|
|
affixStyle: undefined,
|
|
placeholderStyle: undefined
|
|
});
|
|
// Test if `updatePosition` called
|
|
if (false) {}
|
|
};
|
|
_this.updatePosition = (0,throttleByAnimationFrame/* default */.Z)(() => {
|
|
_this.prepareMeasure();
|
|
});
|
|
_this.lazyUpdatePosition = (0,throttleByAnimationFrame/* default */.Z)(() => {
|
|
const targetFunc = _this.getTargetFunc();
|
|
const {
|
|
affixStyle
|
|
} = _this.state;
|
|
// Check position change before measure to make Safari smooth
|
|
if (targetFunc && affixStyle) {
|
|
const offsetTop = _this.getOffsetTop();
|
|
const offsetBottom = _this.getOffsetBottom();
|
|
const targetNode = targetFunc();
|
|
if (targetNode && _this.placeholderNodeRef.current) {
|
|
const targetRect = getTargetRect(targetNode);
|
|
const placeholderRect = getTargetRect(_this.placeholderNodeRef.current);
|
|
const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop);
|
|
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
|
|
if (fixedTop !== undefined && affixStyle.top === fixedTop || fixedBottom !== undefined && affixStyle.bottom === fixedBottom) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
// Directly call prepare measure since it's already throttled.
|
|
_this.prepareMeasure();
|
|
});
|
|
return _this;
|
|
}
|
|
(0,createClass/* default */.Z)(InternalAffix, [{
|
|
key: "getTargetFunc",
|
|
value: function getTargetFunc() {
|
|
const {
|
|
getTargetContainer
|
|
} = this.context;
|
|
const {
|
|
target
|
|
} = this.props;
|
|
if (target !== undefined) {
|
|
return target;
|
|
}
|
|
return getTargetContainer !== null && getTargetContainer !== void 0 ? getTargetContainer : getDefaultTarget;
|
|
}
|
|
// Event handler
|
|
}, {
|
|
key: "componentDidMount",
|
|
value: function componentDidMount() {
|
|
// [Legacy] Wait for parent component ref has its value.
|
|
// We should use target as directly element instead of function which makes element check hard.
|
|
this.timer = setTimeout(this.addListeners);
|
|
}
|
|
}, {
|
|
key: "componentDidUpdate",
|
|
value: function componentDidUpdate(prevProps) {
|
|
this.addListeners();
|
|
if (prevProps.offsetTop !== this.props.offsetTop || prevProps.offsetBottom !== this.props.offsetBottom) {
|
|
this.updatePosition();
|
|
}
|
|
this.measure();
|
|
}
|
|
}, {
|
|
key: "componentWillUnmount",
|
|
value: function componentWillUnmount() {
|
|
this.removeListeners();
|
|
}
|
|
// =================== Render ===================
|
|
}, {
|
|
key: "render",
|
|
value: function render() {
|
|
const {
|
|
affixStyle,
|
|
placeholderStyle
|
|
} = this.state;
|
|
const {
|
|
affixPrefixCls,
|
|
rootClassName,
|
|
children
|
|
} = this.props;
|
|
const className = classnames_default()(affixStyle && rootClassName, {
|
|
[affixPrefixCls]: !!affixStyle
|
|
});
|
|
let props = (0,omit/* default */.Z)(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target', 'onChange', 'affixPrefixCls', 'rootClassName']);
|
|
// Omit this since `onTestUpdatePosition` only works on test.
|
|
if (false) {}
|
|
return /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
onResize: this.updatePosition
|
|
}, /*#__PURE__*/react.createElement("div", Object.assign({}, props, {
|
|
ref: this.placeholderNodeRef
|
|
}), affixStyle && /*#__PURE__*/react.createElement("div", {
|
|
style: placeholderStyle,
|
|
"aria-hidden": "true"
|
|
}), /*#__PURE__*/react.createElement("div", {
|
|
className: className,
|
|
ref: this.fixedNodeRef,
|
|
style: affixStyle
|
|
}, /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
onResize: this.updatePosition
|
|
}, children))));
|
|
}
|
|
}]);
|
|
return InternalAffix;
|
|
}(react.Component);
|
|
InternalAffix.contextType = context/* ConfigContext */.E_;
|
|
const Affix = /*#__PURE__*/(0,react.forwardRef)((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
rootClassName
|
|
} = props;
|
|
const {
|
|
getPrefixCls
|
|
} = (0,react.useContext)(context/* ConfigContext */.E_);
|
|
const affixPrefixCls = getPrefixCls('affix', customizePrefixCls);
|
|
const [wrapSSR, hashId] = style(affixPrefixCls);
|
|
const AffixProps = Object.assign(Object.assign({}, props), {
|
|
affixPrefixCls,
|
|
rootClassName: classnames_default()(rootClassName, hashId)
|
|
});
|
|
return wrapSSR( /*#__PURE__*/react.createElement(InternalAffix, Object.assign({}, AffixProps, {
|
|
ref: ref
|
|
})));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var affix = (Affix);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 85673:
|
|
/*!**************************************************************!*\
|
|
!*** ./node_modules/antd/es/breadcrumb/index.js + 6 modules ***!
|
|
\**************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ breadcrumb; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/Children/toArray.js
|
|
var toArray = __webpack_require__(37419);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/pickAttrs.js
|
|
var pickAttrs = __webpack_require__(1337);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/reactNode.js
|
|
var reactNode = __webpack_require__(96159);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
var DownOutlined = __webpack_require__(15558);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/dropdown.js + 64 modules
|
|
var dropdown = __webpack_require__(56153);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/BreadcrumbSeparator.js
|
|
"use client";
|
|
|
|
|
|
|
|
const BreadcrumbSeparator = _ref => {
|
|
let {
|
|
children
|
|
} = _ref;
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('breadcrumb');
|
|
return /*#__PURE__*/react.createElement("li", {
|
|
className: `${prefixCls}-separator`,
|
|
"aria-hidden": "true"
|
|
}, children === '' ? children : children || '/');
|
|
};
|
|
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
|
|
/* harmony default export */ var breadcrumb_BreadcrumbSeparator = (BreadcrumbSeparator);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/useItemRender.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;
|
|
};
|
|
|
|
|
|
|
|
function getBreadcrumbName(route, params) {
|
|
if (route.title === undefined || route.title === null) {
|
|
return null;
|
|
}
|
|
const paramsKeys = Object.keys(params).join('|');
|
|
return typeof route.title === 'object' ? route.title : String(route.title).replace(new RegExp(`:(${paramsKeys})`, 'g'), (replacement, key) => params[key] || replacement);
|
|
}
|
|
function renderItem(prefixCls, item, children, href) {
|
|
if (children === null || children === undefined) {
|
|
return null;
|
|
}
|
|
const {
|
|
className,
|
|
onClick
|
|
} = item,
|
|
restItem = __rest(item, ["className", "onClick"]);
|
|
const passedProps = Object.assign(Object.assign({}, (0,pickAttrs/* default */.Z)(restItem, {
|
|
data: true,
|
|
aria: true
|
|
})), {
|
|
onClick
|
|
});
|
|
if (href !== undefined) {
|
|
return /*#__PURE__*/react.createElement("a", Object.assign({}, passedProps, {
|
|
className: classnames_default()(`${prefixCls}-link`, className),
|
|
href: href
|
|
}), children);
|
|
}
|
|
return /*#__PURE__*/react.createElement("span", Object.assign({}, passedProps, {
|
|
className: classnames_default()(`${prefixCls}-link`, className)
|
|
}), children);
|
|
}
|
|
function useItemRender(prefixCls, itemRender) {
|
|
const mergedItemRender = (item, params, routes, path, href) => {
|
|
if (itemRender) {
|
|
return itemRender(item, params, routes, path);
|
|
}
|
|
const name = getBreadcrumbName(item, params);
|
|
return renderItem(prefixCls, item, name, href);
|
|
};
|
|
return mergedItemRender;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/BreadcrumbItem.js
|
|
"use client";
|
|
|
|
var BreadcrumbItem_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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalBreadcrumbItem = props => {
|
|
const {
|
|
prefixCls,
|
|
separator = '/',
|
|
children,
|
|
menu,
|
|
overlay,
|
|
dropdownProps,
|
|
href
|
|
} = props;
|
|
// Warning for deprecated usage
|
|
if (false) {}
|
|
/** If overlay is have Wrap a Dropdown */
|
|
const renderBreadcrumbNode = breadcrumbItem => {
|
|
if (menu || overlay) {
|
|
const mergeDropDownProps = Object.assign({}, dropdownProps);
|
|
if (menu) {
|
|
const _a = menu || {},
|
|
{
|
|
items
|
|
} = _a,
|
|
menuProps = BreadcrumbItem_rest(_a, ["items"]);
|
|
mergeDropDownProps.menu = Object.assign(Object.assign({}, menuProps), {
|
|
items: items === null || items === void 0 ? void 0 : items.map((_a, index) => {
|
|
var {
|
|
key,
|
|
title,
|
|
label,
|
|
path
|
|
} = _a,
|
|
itemProps = BreadcrumbItem_rest(_a, ["key", "title", "label", "path"]);
|
|
let mergedLabel = label !== null && label !== void 0 ? label : title;
|
|
if (path) {
|
|
mergedLabel = /*#__PURE__*/react.createElement("a", {
|
|
href: `${href}${path}`
|
|
}, mergedLabel);
|
|
}
|
|
return Object.assign(Object.assign({}, itemProps), {
|
|
key: key !== null && key !== void 0 ? key : index,
|
|
label: mergedLabel
|
|
});
|
|
})
|
|
});
|
|
} else if (overlay) {
|
|
mergeDropDownProps.overlay = overlay;
|
|
}
|
|
return /*#__PURE__*/react.createElement(dropdown/* default */.Z, Object.assign({
|
|
placement: "bottom"
|
|
}, mergeDropDownProps), /*#__PURE__*/react.createElement("span", {
|
|
className: `${prefixCls}-overlay-link`
|
|
}, breadcrumbItem, /*#__PURE__*/react.createElement(DownOutlined/* default */.Z, null)));
|
|
}
|
|
return breadcrumbItem;
|
|
};
|
|
// wrap to dropDown
|
|
const link = renderBreadcrumbNode(children);
|
|
if (link !== undefined && link !== null) {
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("li", null, link), separator && /*#__PURE__*/react.createElement(breadcrumb_BreadcrumbSeparator, null, separator));
|
|
}
|
|
return null;
|
|
};
|
|
const BreadcrumbItem = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
children,
|
|
href
|
|
} = props,
|
|
restProps = BreadcrumbItem_rest(props, ["prefixCls", "children", "href"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
|
return /*#__PURE__*/react.createElement(InternalBreadcrumbItem, Object.assign({}, restProps, {
|
|
prefixCls: prefixCls
|
|
}), renderItem(prefixCls, restProps, children, href));
|
|
};
|
|
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
|
|
/* harmony default export */ var breadcrumb_BreadcrumbItem = (BreadcrumbItem);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
var style = __webpack_require__(14747);
|
|
// 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/breadcrumb/style/index.js
|
|
|
|
|
|
const genBreadcrumbStyle = token => {
|
|
const {
|
|
componentCls,
|
|
iconCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
color: token.itemColor,
|
|
fontSize: token.fontSize,
|
|
[iconCls]: {
|
|
fontSize: token.iconFontSize
|
|
},
|
|
ol: {
|
|
display: 'flex',
|
|
flexWrap: 'wrap',
|
|
margin: 0,
|
|
padding: 0,
|
|
listStyle: 'none'
|
|
},
|
|
a: Object.assign({
|
|
color: token.linkColor,
|
|
transition: `color ${token.motionDurationMid}`,
|
|
padding: `0 ${token.paddingXXS}px`,
|
|
borderRadius: token.borderRadiusSM,
|
|
height: token.lineHeight * token.fontSize,
|
|
display: 'inline-block',
|
|
marginInline: -token.marginXXS,
|
|
'&:hover': {
|
|
color: token.linkHoverColor,
|
|
backgroundColor: token.colorBgTextHover
|
|
}
|
|
}, (0,style/* genFocusStyle */.Qy)(token)),
|
|
[`li:last-child`]: {
|
|
color: token.lastItemColor
|
|
},
|
|
[`${componentCls}-separator`]: {
|
|
marginInline: token.separatorMargin,
|
|
color: token.separatorColor
|
|
},
|
|
[`${componentCls}-link`]: {
|
|
[`
|
|
> ${iconCls} + span,
|
|
> ${iconCls} + a
|
|
`]: {
|
|
marginInlineStart: token.marginXXS
|
|
}
|
|
},
|
|
[`${componentCls}-overlay-link`]: {
|
|
borderRadius: token.borderRadiusSM,
|
|
height: token.lineHeight * token.fontSize,
|
|
display: 'inline-block',
|
|
padding: `0 ${token.paddingXXS}px`,
|
|
marginInline: -token.marginXXS,
|
|
[`> ${iconCls}`]: {
|
|
marginInlineStart: token.marginXXS,
|
|
fontSize: token.fontSizeIcon
|
|
},
|
|
'&:hover': {
|
|
color: token.linkHoverColor,
|
|
backgroundColor: token.colorBgTextHover,
|
|
a: {
|
|
color: token.linkHoverColor
|
|
}
|
|
},
|
|
a: {
|
|
'&:hover': {
|
|
backgroundColor: 'transparent'
|
|
}
|
|
}
|
|
},
|
|
// rtl style
|
|
[`&${token.componentCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var breadcrumb_style = ((0,genComponentStyleHook/* default */.Z)('Breadcrumb', token => {
|
|
const BreadcrumbToken = (0,statistic/* merge */.TS)(token, {});
|
|
return [genBreadcrumbStyle(BreadcrumbToken)];
|
|
}, token => ({
|
|
itemColor: token.colorTextDescription,
|
|
lastItemColor: token.colorText,
|
|
iconFontSize: token.fontSize,
|
|
linkColor: token.colorTextDescription,
|
|
linkHoverColor: token.colorText,
|
|
separatorColor: token.colorTextDescription,
|
|
separatorMargin: token.marginXS
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/useItems.js
|
|
var useItems_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;
|
|
};
|
|
|
|
function route2item(route) {
|
|
const {
|
|
breadcrumbName,
|
|
children
|
|
} = route,
|
|
rest = useItems_rest(route, ["breadcrumbName", "children"]);
|
|
const clone = Object.assign({
|
|
title: breadcrumbName
|
|
}, rest);
|
|
if (children) {
|
|
clone.menu = {
|
|
items: children.map(_a => {
|
|
var {
|
|
breadcrumbName: itemBreadcrumbName
|
|
} = _a,
|
|
itemProps = useItems_rest(_a, ["breadcrumbName"]);
|
|
return Object.assign(Object.assign({}, itemProps), {
|
|
title: itemBreadcrumbName
|
|
});
|
|
})
|
|
};
|
|
}
|
|
return clone;
|
|
}
|
|
function useItems(items, routes) {
|
|
return (0,react.useMemo)(() => {
|
|
if (items) {
|
|
return items;
|
|
}
|
|
if (routes) {
|
|
return routes.map(route2item);
|
|
}
|
|
return null;
|
|
}, [items, routes]);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/Breadcrumb.js
|
|
"use client";
|
|
|
|
var Breadcrumb_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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getPath = (params, path) => {
|
|
if (path === undefined) {
|
|
return path;
|
|
}
|
|
let mergedPath = (path || '').replace(/^\//, '');
|
|
Object.keys(params).forEach(key => {
|
|
mergedPath = mergedPath.replace(`:${key}`, params[key]);
|
|
});
|
|
return mergedPath;
|
|
};
|
|
const Breadcrumb = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
separator = '/',
|
|
style,
|
|
className,
|
|
rootClassName,
|
|
routes: legacyRoutes,
|
|
items,
|
|
children,
|
|
itemRender,
|
|
params = {}
|
|
} = props,
|
|
restProps = Breadcrumb_rest(props, ["prefixCls", "separator", "style", "className", "rootClassName", "routes", "items", "children", "itemRender", "params"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
breadcrumb
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
let crumbs;
|
|
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
|
const [wrapSSR, hashId] = breadcrumb_style(prefixCls);
|
|
const mergedItems = useItems(items, legacyRoutes);
|
|
if (false) {}
|
|
const mergedItemRender = useItemRender(prefixCls, itemRender);
|
|
if (mergedItems && mergedItems.length > 0) {
|
|
// generated by route
|
|
const paths = [];
|
|
const itemRenderRoutes = items || legacyRoutes;
|
|
crumbs = mergedItems.map((item, index) => {
|
|
const {
|
|
path,
|
|
key,
|
|
type,
|
|
menu,
|
|
overlay,
|
|
onClick,
|
|
className: itemClassName,
|
|
separator: itemSeparator,
|
|
dropdownProps
|
|
} = item;
|
|
const mergedPath = getPath(params, path);
|
|
if (mergedPath !== undefined) {
|
|
paths.push(mergedPath);
|
|
}
|
|
const mergedKey = key !== null && key !== void 0 ? key : index;
|
|
if (type === 'separator') {
|
|
return /*#__PURE__*/react.createElement(breadcrumb_BreadcrumbSeparator, {
|
|
key: mergedKey
|
|
}, itemSeparator);
|
|
}
|
|
const itemProps = {};
|
|
const isLastItem = index === mergedItems.length - 1;
|
|
if (menu) {
|
|
itemProps.menu = menu;
|
|
} else if (overlay) {
|
|
itemProps.overlay = overlay;
|
|
}
|
|
let {
|
|
href
|
|
} = item;
|
|
if (paths.length && mergedPath !== undefined) {
|
|
href = `#/${paths.join('/')}`;
|
|
}
|
|
return /*#__PURE__*/react.createElement(InternalBreadcrumbItem, Object.assign({
|
|
key: mergedKey
|
|
}, itemProps, (0,pickAttrs/* default */.Z)(item, {
|
|
data: true,
|
|
aria: true
|
|
}), {
|
|
className: itemClassName,
|
|
dropdownProps: dropdownProps,
|
|
href: href,
|
|
separator: isLastItem ? '' : separator,
|
|
onClick: onClick,
|
|
prefixCls: prefixCls
|
|
}), mergedItemRender(item, params, itemRenderRoutes, paths, href));
|
|
});
|
|
} else if (children) {
|
|
const childrenLength = (0,toArray/* default */.Z)(children).length;
|
|
crumbs = (0,toArray/* default */.Z)(children).map((element, index) => {
|
|
if (!element) {
|
|
return element;
|
|
}
|
|
// =================== Warning =====================
|
|
if (false) {}
|
|
false ? 0 : void 0;
|
|
const isLastItem = index === childrenLength - 1;
|
|
return (0,reactNode/* cloneElement */.Tm)(element, {
|
|
separator: isLastItem ? '' : separator,
|
|
key: index
|
|
});
|
|
});
|
|
}
|
|
const breadcrumbClassName = classnames_default()(prefixCls, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.className, {
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const mergedStyle = Object.assign(Object.assign({}, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.style), style);
|
|
return wrapSSR( /*#__PURE__*/react.createElement("nav", Object.assign({
|
|
className: breadcrumbClassName,
|
|
style: mergedStyle
|
|
}, restProps), /*#__PURE__*/react.createElement("ol", null, crumbs)));
|
|
};
|
|
Breadcrumb.Item = breadcrumb_BreadcrumbItem;
|
|
Breadcrumb.Separator = breadcrumb_BreadcrumbSeparator;
|
|
if (false) {}
|
|
/* harmony default export */ var breadcrumb_Breadcrumb = (Breadcrumb);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/index.js
|
|
"use client";
|
|
|
|
|
|
/* harmony default export */ var breadcrumb = (breadcrumb_Breadcrumb);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 96074:
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/antd/es/divider/index.js + 1 modules ***!
|
|
\***********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ divider; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
var style = __webpack_require__(14747);
|
|
// 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/divider/style/index.js
|
|
|
|
|
|
// ============================== Shared ==============================
|
|
const genSharedDividerStyle = token => {
|
|
const {
|
|
componentCls,
|
|
sizePaddingEdgeHorizontal,
|
|
colorSplit,
|
|
lineWidth,
|
|
textPaddingInline,
|
|
orientationMargin,
|
|
verticalMarginInline
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
borderBlockStart: `${lineWidth}px solid ${colorSplit}`,
|
|
// vertical
|
|
'&-vertical': {
|
|
position: 'relative',
|
|
top: '-0.06em',
|
|
display: 'inline-block',
|
|
height: '0.9em',
|
|
marginInline: verticalMarginInline,
|
|
marginBlock: 0,
|
|
verticalAlign: 'middle',
|
|
borderTop: 0,
|
|
borderInlineStart: `${lineWidth}px solid ${colorSplit}`
|
|
},
|
|
'&-horizontal': {
|
|
display: 'flex',
|
|
clear: 'both',
|
|
width: '100%',
|
|
minWidth: '100%',
|
|
margin: `${token.dividerHorizontalGutterMargin}px 0`
|
|
},
|
|
[`&-horizontal${componentCls}-with-text`]: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
margin: `${token.dividerHorizontalWithTextGutterMargin}px 0`,
|
|
color: token.colorTextHeading,
|
|
fontWeight: 500,
|
|
fontSize: token.fontSizeLG,
|
|
whiteSpace: 'nowrap',
|
|
textAlign: 'center',
|
|
borderBlockStart: `0 ${colorSplit}`,
|
|
'&::before, &::after': {
|
|
position: 'relative',
|
|
width: '50%',
|
|
borderBlockStart: `${lineWidth}px solid transparent`,
|
|
// Chrome not accept `inherit` in `border-top`
|
|
borderBlockStartColor: 'inherit',
|
|
borderBlockEnd: 0,
|
|
transform: 'translateY(50%)',
|
|
content: "''"
|
|
}
|
|
},
|
|
[`&-horizontal${componentCls}-with-text-left`]: {
|
|
'&::before': {
|
|
width: `${orientationMargin * 100}%`
|
|
},
|
|
'&::after': {
|
|
width: `${100 - orientationMargin * 100}%`
|
|
}
|
|
},
|
|
[`&-horizontal${componentCls}-with-text-right`]: {
|
|
'&::before': {
|
|
width: `${100 - orientationMargin * 100}%`
|
|
},
|
|
'&::after': {
|
|
width: `${orientationMargin * 100}%`
|
|
}
|
|
},
|
|
[`${componentCls}-inner-text`]: {
|
|
display: 'inline-block',
|
|
paddingBlock: 0,
|
|
paddingInline: textPaddingInline
|
|
},
|
|
'&-dashed': {
|
|
background: 'none',
|
|
borderColor: colorSplit,
|
|
borderStyle: 'dashed',
|
|
borderWidth: `${lineWidth}px 0 0`
|
|
},
|
|
[`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: {
|
|
'&::before, &::after': {
|
|
borderStyle: 'dashed none none'
|
|
}
|
|
},
|
|
[`&-vertical${componentCls}-dashed`]: {
|
|
borderInlineStartWidth: lineWidth,
|
|
borderInlineEnd: 0,
|
|
borderBlockStart: 0,
|
|
borderBlockEnd: 0
|
|
},
|
|
[`&-plain${componentCls}-with-text`]: {
|
|
color: token.colorText,
|
|
fontWeight: 'normal',
|
|
fontSize: token.fontSize
|
|
},
|
|
[`&-horizontal${componentCls}-with-text-left${componentCls}-no-default-orientation-margin-left`]: {
|
|
'&::before': {
|
|
width: 0
|
|
},
|
|
'&::after': {
|
|
width: '100%'
|
|
},
|
|
[`${componentCls}-inner-text`]: {
|
|
paddingInlineStart: sizePaddingEdgeHorizontal
|
|
}
|
|
},
|
|
[`&-horizontal${componentCls}-with-text-right${componentCls}-no-default-orientation-margin-right`]: {
|
|
'&::before': {
|
|
width: '100%'
|
|
},
|
|
'&::after': {
|
|
width: 0
|
|
},
|
|
[`${componentCls}-inner-text`]: {
|
|
paddingInlineEnd: sizePaddingEdgeHorizontal
|
|
}
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var divider_style = ((0,genComponentStyleHook/* default */.Z)('Divider', token => {
|
|
const dividerToken = (0,statistic/* merge */.TS)(token, {
|
|
dividerHorizontalWithTextGutterMargin: token.margin,
|
|
dividerHorizontalGutterMargin: token.marginLG,
|
|
sizePaddingEdgeHorizontal: 0
|
|
});
|
|
return [genSharedDividerStyle(dividerToken)];
|
|
}, token => ({
|
|
textPaddingInline: '1em',
|
|
orientationMargin: 0.05,
|
|
verticalMarginInline: token.marginXS
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/divider/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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const Divider = props => {
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
divider
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
type = 'horizontal',
|
|
orientation = 'center',
|
|
orientationMargin,
|
|
className,
|
|
rootClassName,
|
|
children,
|
|
dashed,
|
|
plain,
|
|
style
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "plain", "style"]);
|
|
const prefixCls = getPrefixCls('divider', customizePrefixCls);
|
|
const [wrapSSR, hashId] = divider_style(prefixCls);
|
|
const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation;
|
|
const hasChildren = !!children;
|
|
const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null;
|
|
const hasCustomMarginRight = orientation === 'right' && orientationMargin != null;
|
|
const classString = classnames_default()(prefixCls, divider === null || divider === void 0 ? void 0 : divider.className, hashId, `${prefixCls}-${type}`, {
|
|
[`${prefixCls}-with-text`]: hasChildren,
|
|
[`${prefixCls}-with-text${orientationPrefix}`]: hasChildren,
|
|
[`${prefixCls}-dashed`]: !!dashed,
|
|
[`${prefixCls}-plain`]: !!plain,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
[`${prefixCls}-no-default-orientation-margin-left`]: hasCustomMarginLeft,
|
|
[`${prefixCls}-no-default-orientation-margin-right`]: hasCustomMarginRight
|
|
}, className, rootClassName);
|
|
const memoizedOrientationMargin = react.useMemo(() => {
|
|
if (typeof orientationMargin === 'number') {
|
|
return orientationMargin;
|
|
}
|
|
if (/^\d+$/.test(orientationMargin)) {
|
|
return Number(orientationMargin);
|
|
}
|
|
return orientationMargin;
|
|
}, [orientationMargin]);
|
|
const innerStyle = Object.assign(Object.assign({}, hasCustomMarginLeft && {
|
|
marginLeft: memoizedOrientationMargin
|
|
}), hasCustomMarginRight && {
|
|
marginRight: memoizedOrientationMargin
|
|
});
|
|
// Warning children not work in vertical mode
|
|
if (false) {}
|
|
return wrapSSR( /*#__PURE__*/react.createElement("div", Object.assign({
|
|
className: classString,
|
|
style: Object.assign(Object.assign({}, divider === null || divider === void 0 ? void 0 : divider.style), style)
|
|
}, restProps, {
|
|
role: "separator"
|
|
}), children && type !== 'vertical' && /*#__PURE__*/react.createElement("span", {
|
|
className: `${prefixCls}-inner-text`,
|
|
style: innerStyle
|
|
}, children)));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var divider = (Divider);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 28596:
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/antd/es/image/index.js + 52 modules ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ es_image; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
var react_namespaceObject = /*#__PURE__*/__webpack_require__.t(react, 2);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/EyeOutlined.js + 1 modules
|
|
var EyeOutlined = __webpack_require__(43481);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(4942);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
var slicedToArray = __webpack_require__(97685);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
var esm_typeof = __webpack_require__(71002);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(45987);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/Dom/css.js
|
|
/* eslint-disable no-nested-ternary */
|
|
var PIXEL_PATTERN = /margin|padding|width|height|max|min|offset/;
|
|
var removePixel = {
|
|
left: true,
|
|
top: true
|
|
};
|
|
var floatMap = {
|
|
cssFloat: 1,
|
|
styleFloat: 1,
|
|
float: 1
|
|
};
|
|
function getComputedStyle(node) {
|
|
return node.nodeType === 1 ? node.ownerDocument.defaultView.getComputedStyle(node, null) : {};
|
|
}
|
|
function getStyleValue(node, type, value) {
|
|
type = type.toLowerCase();
|
|
if (value === 'auto') {
|
|
if (type === 'height') {
|
|
return node.offsetHeight;
|
|
}
|
|
if (type === 'width') {
|
|
return node.offsetWidth;
|
|
}
|
|
}
|
|
if (!(type in removePixel)) {
|
|
removePixel[type] = PIXEL_PATTERN.test(type);
|
|
}
|
|
return removePixel[type] ? parseFloat(value) || 0 : value;
|
|
}
|
|
function get(node, name) {
|
|
var length = arguments.length;
|
|
var style = getComputedStyle(node);
|
|
name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
|
|
return length === 1 ? style : getStyleValue(node, name, style[name] || node.style[name]);
|
|
}
|
|
function set(node, name, value) {
|
|
var length = arguments.length;
|
|
name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
|
|
if (length === 3) {
|
|
if (typeof value === 'number' && PIXEL_PATTERN.test(name)) {
|
|
value = "".concat(value, "px");
|
|
}
|
|
node.style[name] = value; // Number
|
|
return value;
|
|
}
|
|
for (var x in name) {
|
|
if (name.hasOwnProperty(x)) {
|
|
set(node, x, name[x]);
|
|
}
|
|
}
|
|
return getComputedStyle(node);
|
|
}
|
|
function getOuterWidth(el) {
|
|
if (el === document.body) {
|
|
return document.documentElement.clientWidth;
|
|
}
|
|
return el.offsetWidth;
|
|
}
|
|
function getOuterHeight(el) {
|
|
if (el === document.body) {
|
|
return window.innerHeight || document.documentElement.clientHeight;
|
|
}
|
|
return el.offsetHeight;
|
|
}
|
|
function getDocSize() {
|
|
var width = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
|
|
var height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
|
|
return {
|
|
width: width,
|
|
height: height
|
|
};
|
|
}
|
|
function getClientSize() {
|
|
var width = document.documentElement.clientWidth;
|
|
var height = window.innerHeight || document.documentElement.clientHeight;
|
|
return {
|
|
width: width,
|
|
height: height
|
|
};
|
|
}
|
|
function getScroll() {
|
|
return {
|
|
scrollLeft: Math.max(document.documentElement.scrollLeft, document.body.scrollLeft),
|
|
scrollTop: Math.max(document.documentElement.scrollTop, document.body.scrollTop)
|
|
};
|
|
}
|
|
function getOffset(node) {
|
|
var box = node.getBoundingClientRect();
|
|
var docElem = document.documentElement;
|
|
|
|
// < ie8 不支持 win.pageXOffset, 则使用 docElem.scrollLeft
|
|
return {
|
|
left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
|
|
top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
|
|
};
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/hooks/useEvent.js
|
|
|
|
function 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-image/node_modules/rc-util/es/Dom/canUseDom.js
|
|
function canUseDom() {
|
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
|
|
|
|
|
/**
|
|
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
*/
|
|
var useInternalLayoutEffect = true && canUseDom() ? react.useLayoutEffect : react.useEffect;
|
|
var 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 useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
|
|
useLayoutEffect(function (firstMount) {
|
|
if (!firstMount) {
|
|
return callback();
|
|
}
|
|
}, deps);
|
|
};
|
|
/* harmony default export */ var hooks_useLayoutEffect = ((/* unused pure expression or super */ null && (useLayoutEffect)));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/hooks/useState.js
|
|
|
|
|
|
/**
|
|
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
|
|
* We do not make this auto is to avoid real memory leak.
|
|
* Developer should confirm it's safe to ignore themselves.
|
|
*/
|
|
function useSafeState(defaultValue) {
|
|
var destroyRef = react.useRef(false);
|
|
var _React$useState = react.useState(defaultValue),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
value = _React$useState2[0],
|
|
setValue = _React$useState2[1];
|
|
react.useEffect(function () {
|
|
destroyRef.current = false;
|
|
return function () {
|
|
destroyRef.current = true;
|
|
};
|
|
}, []);
|
|
function safeSetState(updater, ignoreDestroy) {
|
|
if (ignoreDestroy && destroyRef.current) {
|
|
return;
|
|
}
|
|
setValue(updater);
|
|
}
|
|
return [value, safeSetState];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/hooks/useMergedState.js
|
|
|
|
|
|
|
|
|
|
/** We only think `undefined` is empty */
|
|
function hasValue(value) {
|
|
return value !== undefined;
|
|
}
|
|
|
|
/**
|
|
* Similar to `useState` but will use props value if provided.
|
|
* Note that internal use rc-util `useState` hook.
|
|
*/
|
|
function useMergedState(defaultStateValue, option) {
|
|
var _ref = option || {},
|
|
defaultValue = _ref.defaultValue,
|
|
value = _ref.value,
|
|
onChange = _ref.onChange,
|
|
postState = _ref.postState;
|
|
|
|
// ======================= Init =======================
|
|
var _useState = useSafeState(function () {
|
|
if (hasValue(value)) {
|
|
return value;
|
|
} else if (hasValue(defaultValue)) {
|
|
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
|
|
} else {
|
|
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
|
|
}
|
|
}),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
innerValue = _useState2[0],
|
|
setInnerValue = _useState2[1];
|
|
var mergedValue = value !== undefined ? value : innerValue;
|
|
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
|
|
// ====================== Change ======================
|
|
var onChangeFn = useEvent(onChange);
|
|
var _useState3 = useSafeState([mergedValue]),
|
|
_useState4 = (0,slicedToArray/* default */.Z)(_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];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/common.js
|
|
var COMMON_PROPS = ['crossOrigin', 'decoding', 'draggable', 'loading', 'referrerPolicy', 'sizes', 'srcSet', 'useMap', 'alt'];
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/context.js
|
|
|
|
var PreviewGroupContext = /*#__PURE__*/react.createContext(null);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/hooks/useRegisterImage.js
|
|
|
|
|
|
|
|
var uid = 0;
|
|
function useRegisterImage(canPreview, data) {
|
|
var _React$useState = react.useState(function () {
|
|
uid += 1;
|
|
return String(uid);
|
|
}),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 1),
|
|
id = _React$useState2[0];
|
|
var groupContext = react.useContext(PreviewGroupContext);
|
|
var registerData = {
|
|
data: data,
|
|
canPreview: canPreview
|
|
};
|
|
|
|
// Keep order start
|
|
// Resolve https://github.com/ant-design/ant-design/issues/28881
|
|
// Only need unRegister when component unMount
|
|
react.useEffect(function () {
|
|
if (groupContext) {
|
|
return groupContext.register(id, registerData);
|
|
}
|
|
}, []);
|
|
react.useEffect(function () {
|
|
if (groupContext) {
|
|
groupContext.register(id, registerData);
|
|
}
|
|
}, [canPreview, data]);
|
|
return id;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/util.js
|
|
function isImageValid(src) {
|
|
return new Promise(function (resolve) {
|
|
var img = document.createElement('img');
|
|
img.onerror = function () {
|
|
return resolve(false);
|
|
};
|
|
img.onload = function () {
|
|
return resolve(true);
|
|
};
|
|
img.src = src;
|
|
});
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/hooks/useStatus.js
|
|
|
|
|
|
|
|
function useStatus(_ref) {
|
|
var src = _ref.src,
|
|
isCustomPlaceholder = _ref.isCustomPlaceholder,
|
|
fallback = _ref.fallback;
|
|
var _useState = (0,react.useState)(isCustomPlaceholder ? 'loading' : 'normal'),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
status = _useState2[0],
|
|
setStatus = _useState2[1];
|
|
var isLoaded = (0,react.useRef)(false);
|
|
var isError = status === 'error';
|
|
|
|
// https://github.com/react-component/image/pull/187
|
|
(0,react.useEffect)(function () {
|
|
isImageValid(src).then(function (isValid) {
|
|
if (!isValid) {
|
|
setStatus('error');
|
|
}
|
|
});
|
|
}, [src]);
|
|
(0,react.useEffect)(function () {
|
|
if (isCustomPlaceholder && !isLoaded.current) {
|
|
setStatus('loading');
|
|
} else if (isError) {
|
|
setStatus('normal');
|
|
}
|
|
}, [src]);
|
|
var onLoad = function onLoad() {
|
|
setStatus('normal');
|
|
};
|
|
var getImgRef = function getImgRef(img) {
|
|
isLoaded.current = false;
|
|
if (status !== 'loading') {
|
|
return;
|
|
}
|
|
if (img !== null && img !== void 0 && img.complete && (img.naturalWidth || img.naturalHeight)) {
|
|
isLoaded.current = true;
|
|
onLoad();
|
|
}
|
|
};
|
|
var srcAndOnload = isError && fallback ? {
|
|
src: fallback
|
|
} : {
|
|
onLoad: onLoad,
|
|
src: src
|
|
};
|
|
return [getImgRef, srcAndOnload, status];
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/@rc-component/portal/es/index.js + 6 modules
|
|
var es = __webpack_require__(2788);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/es/context.js
|
|
|
|
var RefContext = /*#__PURE__*/react.createContext({});
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/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-image/node_modules/rc-dialog/node_modules/rc-util/es/hooks/useId.js
|
|
|
|
|
|
|
|
function getUseId() {
|
|
// We need fully clone React function here to avoid webpack warning React 17 do not export `useId`
|
|
var fullClone = (0,objectSpread2/* default */.Z)({}, react_namespaceObject);
|
|
return fullClone.useId;
|
|
}
|
|
var uuid = 0;
|
|
|
|
/** @private Note only worked in develop env. Not work in production. */
|
|
function resetUuid() {
|
|
if (false) {}
|
|
}
|
|
function useId(id) {
|
|
// Inner id for accessibility usage. Only work in client side
|
|
var _React$useState = react.useState('ssr-id'),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
innerId = _React$useState2[0],
|
|
setInnerId = _React$useState2[1];
|
|
var useOriginId = getUseId();
|
|
var reactNativeId = useOriginId === null || useOriginId === void 0 ? void 0 : useOriginId();
|
|
react.useEffect(function () {
|
|
if (!useOriginId) {
|
|
var nextId = uuid;
|
|
uuid += 1;
|
|
setInnerId("rc_unique_".concat(nextId));
|
|
}
|
|
}, []);
|
|
|
|
// Developer passed id is single source of truth
|
|
if (id) {
|
|
return id;
|
|
}
|
|
|
|
// Test env always return mock id
|
|
if (false) {}
|
|
|
|
// Return react native id or inner id
|
|
return reactNativeId || innerId;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/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-image/node_modules/rc-dialog/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-image/node_modules/rc-dialog/es/util.js
|
|
// =============================== Motion ===============================
|
|
function getMotionName(prefixCls, transitionName, animationName) {
|
|
var motionName = transitionName;
|
|
if (!motionName && animationName) {
|
|
motionName = "".concat(prefixCls, "-").concat(animationName);
|
|
}
|
|
return motionName;
|
|
}
|
|
|
|
// =============================== Offset ===============================
|
|
function util_getScroll(w, top) {
|
|
var ret = w["page".concat(top ? 'Y' : 'X', "Offset")];
|
|
var method = "scroll".concat(top ? 'Top' : 'Left');
|
|
if (typeof ret !== 'number') {
|
|
var d = w.document;
|
|
ret = d.documentElement[method];
|
|
if (typeof ret !== 'number') {
|
|
ret = d.body[method];
|
|
}
|
|
}
|
|
return ret;
|
|
}
|
|
function offset(el) {
|
|
var rect = el.getBoundingClientRect();
|
|
var pos = {
|
|
left: rect.left,
|
|
top: rect.top
|
|
};
|
|
var doc = el.ownerDocument;
|
|
var w = doc.defaultView || doc.parentWindow;
|
|
pos.left += util_getScroll(w);
|
|
pos.top += util_getScroll(w, true);
|
|
return pos;
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/rc-motion/es/index.js + 11 modules
|
|
var rc_motion_es = __webpack_require__(62874);
|
|
// EXTERNAL MODULE: ./node_modules/react-is/index.js
|
|
var react_is = __webpack_require__(59864);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/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-image/node_modules/rc-dialog/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 = 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-image/node_modules/rc-dialog/es/Dialog/Content/MemoChildren.js
|
|
|
|
/* harmony default export */ var MemoChildren = (/*#__PURE__*/react.memo(function (_ref) {
|
|
var children = _ref.children;
|
|
return children;
|
|
}, function (_, _ref2) {
|
|
var shouldUpdate = _ref2.shouldUpdate;
|
|
return !shouldUpdate;
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/es/Dialog/Content/Panel.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var sentinelStyle = {
|
|
width: 0,
|
|
height: 0,
|
|
overflow: 'hidden',
|
|
outline: 'none'
|
|
};
|
|
var Panel = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var prefixCls = props.prefixCls,
|
|
className = props.className,
|
|
style = props.style,
|
|
title = props.title,
|
|
ariaId = props.ariaId,
|
|
footer = props.footer,
|
|
closable = props.closable,
|
|
closeIcon = props.closeIcon,
|
|
onClose = props.onClose,
|
|
children = props.children,
|
|
bodyStyle = props.bodyStyle,
|
|
bodyProps = props.bodyProps,
|
|
modalRender = props.modalRender,
|
|
onMouseDown = props.onMouseDown,
|
|
onMouseUp = props.onMouseUp,
|
|
holderRef = props.holderRef,
|
|
visible = props.visible,
|
|
forceRender = props.forceRender,
|
|
width = props.width,
|
|
height = props.height;
|
|
|
|
// ================================= Refs =================================
|
|
var _React$useContext = react.useContext(RefContext),
|
|
panelRef = _React$useContext.panel;
|
|
var mergedRef = useComposeRef(holderRef, panelRef);
|
|
var sentinelStartRef = (0,react.useRef)();
|
|
var sentinelEndRef = (0,react.useRef)();
|
|
react.useImperativeHandle(ref, function () {
|
|
return {
|
|
focus: function focus() {
|
|
var _sentinelStartRef$cur;
|
|
(_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 ? void 0 : _sentinelStartRef$cur.focus();
|
|
},
|
|
changeActive: function changeActive(next) {
|
|
var _document = document,
|
|
activeElement = _document.activeElement;
|
|
if (next && activeElement === sentinelEndRef.current) {
|
|
sentinelStartRef.current.focus();
|
|
} else if (!next && activeElement === sentinelStartRef.current) {
|
|
sentinelEndRef.current.focus();
|
|
}
|
|
}
|
|
};
|
|
});
|
|
|
|
// ================================ Style =================================
|
|
var contentStyle = {};
|
|
if (width !== undefined) {
|
|
contentStyle.width = width;
|
|
}
|
|
if (height !== undefined) {
|
|
contentStyle.height = height;
|
|
}
|
|
// ================================ Render ================================
|
|
var footerNode;
|
|
if (footer) {
|
|
footerNode = /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(prefixCls, "-footer")
|
|
}, footer);
|
|
}
|
|
var headerNode;
|
|
if (title) {
|
|
headerNode = /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(prefixCls, "-header")
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(prefixCls, "-title"),
|
|
id: ariaId
|
|
}, title));
|
|
}
|
|
var closer;
|
|
if (closable) {
|
|
closer = /*#__PURE__*/react.createElement("button", {
|
|
type: "button",
|
|
onClick: onClose,
|
|
"aria-label": "Close",
|
|
className: "".concat(prefixCls, "-close")
|
|
}, closeIcon || /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-close-x")
|
|
}));
|
|
}
|
|
var content = /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(prefixCls, "-content")
|
|
}, closer, headerNode, /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
className: "".concat(prefixCls, "-body"),
|
|
style: bodyStyle
|
|
}, bodyProps), children), footerNode);
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
key: "dialog-element",
|
|
role: "dialog",
|
|
"aria-labelledby": title ? ariaId : null,
|
|
"aria-modal": "true",
|
|
ref: mergedRef,
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, style), contentStyle),
|
|
className: classnames_default()(prefixCls, className),
|
|
onMouseDown: onMouseDown,
|
|
onMouseUp: onMouseUp
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
tabIndex: 0,
|
|
ref: sentinelStartRef,
|
|
style: sentinelStyle,
|
|
"aria-hidden": "true"
|
|
}), /*#__PURE__*/react.createElement(MemoChildren, {
|
|
shouldUpdate: visible || forceRender
|
|
}, modalRender ? modalRender(content) : content), /*#__PURE__*/react.createElement("div", {
|
|
tabIndex: 0,
|
|
ref: sentinelEndRef,
|
|
style: sentinelStyle,
|
|
"aria-hidden": "true"
|
|
}));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var Content_Panel = (Panel);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/es/Dialog/Content/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Content = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var prefixCls = props.prefixCls,
|
|
title = props.title,
|
|
style = props.style,
|
|
className = props.className,
|
|
visible = props.visible,
|
|
forceRender = props.forceRender,
|
|
destroyOnClose = props.destroyOnClose,
|
|
motionName = props.motionName,
|
|
ariaId = props.ariaId,
|
|
onVisibleChanged = props.onVisibleChanged,
|
|
mousePosition = props.mousePosition;
|
|
var dialogRef = (0,react.useRef)();
|
|
|
|
// ============================= Style ==============================
|
|
var _React$useState = react.useState(),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
transformOrigin = _React$useState2[0],
|
|
setTransformOrigin = _React$useState2[1];
|
|
var contentStyle = {};
|
|
if (transformOrigin) {
|
|
contentStyle.transformOrigin = transformOrigin;
|
|
}
|
|
function onPrepare() {
|
|
var elementOffset = offset(dialogRef.current);
|
|
setTransformOrigin(mousePosition ? "".concat(mousePosition.x - elementOffset.left, "px ").concat(mousePosition.y - elementOffset.top, "px") : '');
|
|
}
|
|
|
|
// ============================= Render =============================
|
|
return /*#__PURE__*/react.createElement(rc_motion_es/* default */.Z, {
|
|
visible: visible,
|
|
onVisibleChanged: onVisibleChanged,
|
|
onAppearPrepare: onPrepare,
|
|
onEnterPrepare: onPrepare,
|
|
forceRender: forceRender,
|
|
motionName: motionName,
|
|
removeOnLeave: destroyOnClose,
|
|
ref: dialogRef
|
|
}, function (_ref, motionRef) {
|
|
var motionClassName = _ref.className,
|
|
motionStyle = _ref.style;
|
|
return /*#__PURE__*/react.createElement(Content_Panel, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
title: title,
|
|
ariaId: ariaId,
|
|
prefixCls: prefixCls,
|
|
holderRef: motionRef,
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, motionStyle), style), contentStyle),
|
|
className: classnames_default()(className, motionClassName)
|
|
}));
|
|
});
|
|
});
|
|
Content.displayName = 'Content';
|
|
/* harmony default export */ var Dialog_Content = (Content);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/es/Dialog/Mask.js
|
|
|
|
|
|
|
|
|
|
|
|
function Mask(props) {
|
|
var prefixCls = props.prefixCls,
|
|
style = props.style,
|
|
visible = props.visible,
|
|
maskProps = props.maskProps,
|
|
motionName = props.motionName;
|
|
return /*#__PURE__*/react.createElement(rc_motion_es/* default */.Z, {
|
|
key: "mask",
|
|
visible: visible,
|
|
motionName: motionName,
|
|
leavedClassName: "".concat(prefixCls, "-mask-hidden")
|
|
}, function (_ref, ref) {
|
|
var motionClassName = _ref.className,
|
|
motionStyle = _ref.style;
|
|
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
ref: ref,
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, motionStyle), style),
|
|
className: classnames_default()("".concat(prefixCls, "-mask"), motionClassName)
|
|
}, maskProps));
|
|
});
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/es/Dialog/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Dialog(props) {
|
|
var _props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-dialog' : _props$prefixCls,
|
|
zIndex = props.zIndex,
|
|
_props$visible = props.visible,
|
|
visible = _props$visible === void 0 ? false : _props$visible,
|
|
_props$keyboard = props.keyboard,
|
|
keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
|
|
_props$focusTriggerAf = props.focusTriggerAfterClose,
|
|
focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,
|
|
wrapStyle = props.wrapStyle,
|
|
wrapClassName = props.wrapClassName,
|
|
wrapProps = props.wrapProps,
|
|
onClose = props.onClose,
|
|
afterOpenChange = props.afterOpenChange,
|
|
afterClose = props.afterClose,
|
|
transitionName = props.transitionName,
|
|
animation = props.animation,
|
|
_props$closable = props.closable,
|
|
closable = _props$closable === void 0 ? true : _props$closable,
|
|
_props$mask = props.mask,
|
|
mask = _props$mask === void 0 ? true : _props$mask,
|
|
maskTransitionName = props.maskTransitionName,
|
|
maskAnimation = props.maskAnimation,
|
|
_props$maskClosable = props.maskClosable,
|
|
maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
|
|
maskStyle = props.maskStyle,
|
|
maskProps = props.maskProps,
|
|
rootClassName = props.rootClassName;
|
|
var lastOutSideActiveElementRef = (0,react.useRef)();
|
|
var wrapperRef = (0,react.useRef)();
|
|
var contentRef = (0,react.useRef)();
|
|
var _React$useState = react.useState(visible),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
animatedVisible = _React$useState2[0],
|
|
setAnimatedVisible = _React$useState2[1];
|
|
|
|
// ========================== Init ==========================
|
|
var ariaId = useId();
|
|
function saveLastOutSideActiveElementRef() {
|
|
if (!contains(wrapperRef.current, document.activeElement)) {
|
|
lastOutSideActiveElementRef.current = document.activeElement;
|
|
}
|
|
}
|
|
function focusDialogContent() {
|
|
if (!contains(wrapperRef.current, document.activeElement)) {
|
|
var _contentRef$current;
|
|
(_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.focus();
|
|
}
|
|
}
|
|
|
|
// ========================= Events =========================
|
|
function onDialogVisibleChanged(newVisible) {
|
|
// Try to focus
|
|
if (newVisible) {
|
|
focusDialogContent();
|
|
} else {
|
|
// Clean up scroll bar & focus back
|
|
setAnimatedVisible(false);
|
|
if (mask && lastOutSideActiveElementRef.current && focusTriggerAfterClose) {
|
|
try {
|
|
lastOutSideActiveElementRef.current.focus({
|
|
preventScroll: true
|
|
});
|
|
} catch (e) {
|
|
// Do nothing
|
|
}
|
|
lastOutSideActiveElementRef.current = null;
|
|
}
|
|
|
|
// Trigger afterClose only when change visible from true to false
|
|
if (animatedVisible) {
|
|
afterClose === null || afterClose === void 0 ? void 0 : afterClose();
|
|
}
|
|
}
|
|
afterOpenChange === null || afterOpenChange === void 0 ? void 0 : afterOpenChange(newVisible);
|
|
}
|
|
function onInternalClose(e) {
|
|
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
}
|
|
|
|
// >>> Content
|
|
var contentClickRef = (0,react.useRef)(false);
|
|
var contentTimeoutRef = (0,react.useRef)();
|
|
|
|
// We need record content click incase content popup out of dialog
|
|
var onContentMouseDown = function onContentMouseDown() {
|
|
clearTimeout(contentTimeoutRef.current);
|
|
contentClickRef.current = true;
|
|
};
|
|
var onContentMouseUp = function onContentMouseUp() {
|
|
contentTimeoutRef.current = setTimeout(function () {
|
|
contentClickRef.current = false;
|
|
});
|
|
};
|
|
|
|
// >>> Wrapper
|
|
// Close only when element not on dialog
|
|
var onWrapperClick = null;
|
|
if (maskClosable) {
|
|
onWrapperClick = function onWrapperClick(e) {
|
|
if (contentClickRef.current) {
|
|
contentClickRef.current = false;
|
|
} else if (wrapperRef.current === e.target) {
|
|
onInternalClose(e);
|
|
}
|
|
};
|
|
}
|
|
function onWrapperKeyDown(e) {
|
|
if (keyboard && e.keyCode === es_KeyCode.ESC) {
|
|
e.stopPropagation();
|
|
onInternalClose(e);
|
|
return;
|
|
}
|
|
|
|
// keep focus inside dialog
|
|
if (visible) {
|
|
if (e.keyCode === es_KeyCode.TAB) {
|
|
contentRef.current.changeActive(!e.shiftKey);
|
|
}
|
|
}
|
|
}
|
|
|
|
// ========================= Effect =========================
|
|
(0,react.useEffect)(function () {
|
|
if (visible) {
|
|
setAnimatedVisible(true);
|
|
saveLastOutSideActiveElementRef();
|
|
}
|
|
}, [visible]);
|
|
|
|
// Remove direct should also check the scroll bar update
|
|
(0,react.useEffect)(function () {
|
|
return function () {
|
|
clearTimeout(contentTimeoutRef.current);
|
|
};
|
|
}, []);
|
|
|
|
// ========================= Render =========================
|
|
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
className: classnames_default()("".concat(prefixCls, "-root"), rootClassName)
|
|
}, pickAttrs(props, {
|
|
data: true
|
|
})), /*#__PURE__*/react.createElement(Mask, {
|
|
prefixCls: prefixCls,
|
|
visible: mask && visible,
|
|
motionName: getMotionName(prefixCls, maskTransitionName, maskAnimation),
|
|
style: (0,objectSpread2/* default */.Z)({
|
|
zIndex: zIndex
|
|
}, maskStyle),
|
|
maskProps: maskProps
|
|
}), /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
tabIndex: -1,
|
|
onKeyDown: onWrapperKeyDown,
|
|
className: classnames_default()("".concat(prefixCls, "-wrap"), wrapClassName),
|
|
ref: wrapperRef,
|
|
onClick: onWrapperClick,
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({
|
|
zIndex: zIndex
|
|
}, wrapStyle), {}, {
|
|
display: !animatedVisible ? 'none' : null
|
|
})
|
|
}, wrapProps), /*#__PURE__*/react.createElement(Dialog_Content, (0,esm_extends/* default */.Z)({}, props, {
|
|
onMouseDown: onContentMouseDown,
|
|
onMouseUp: onContentMouseUp,
|
|
ref: contentRef,
|
|
closable: closable,
|
|
ariaId: ariaId,
|
|
prefixCls: prefixCls,
|
|
visible: visible && animatedVisible,
|
|
onClose: onInternalClose,
|
|
onVisibleChanged: onDialogVisibleChanged,
|
|
motionName: getMotionName(prefixCls, transitionName, animation)
|
|
}))));
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/es/DialogWrap.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fix issue #10656
|
|
/*
|
|
* getContainer remarks
|
|
* Custom container should not be return, because in the Portal component, it will remove the
|
|
* return container element here, if the custom container is the only child of it's component,
|
|
* like issue #10656, It will has a conflict with removeChild method in react-dom.
|
|
* So here should add a child (div element) to custom container.
|
|
* */
|
|
var DialogWrap = function DialogWrap(props) {
|
|
var visible = props.visible,
|
|
getContainer = props.getContainer,
|
|
forceRender = props.forceRender,
|
|
_props$destroyOnClose = props.destroyOnClose,
|
|
destroyOnClose = _props$destroyOnClose === void 0 ? false : _props$destroyOnClose,
|
|
_afterClose = props.afterClose,
|
|
panelRef = props.panelRef;
|
|
var _React$useState = react.useState(visible),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
animatedVisible = _React$useState2[0],
|
|
setAnimatedVisible = _React$useState2[1];
|
|
var refContext = react.useMemo(function () {
|
|
return {
|
|
panel: panelRef
|
|
};
|
|
}, [panelRef]);
|
|
react.useEffect(function () {
|
|
if (visible) {
|
|
setAnimatedVisible(true);
|
|
}
|
|
}, [visible]);
|
|
|
|
// Destroy on close will remove wrapped div
|
|
if (!forceRender && destroyOnClose && !animatedVisible) {
|
|
return null;
|
|
}
|
|
return /*#__PURE__*/react.createElement(RefContext.Provider, {
|
|
value: refContext
|
|
}, /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
open: visible || forceRender || animatedVisible,
|
|
autoDestroy: false,
|
|
getContainer: getContainer,
|
|
autoLock: visible || animatedVisible
|
|
}, /*#__PURE__*/react.createElement(Dialog, (0,esm_extends/* default */.Z)({}, props, {
|
|
destroyOnClose: destroyOnClose,
|
|
afterClose: function afterClose() {
|
|
_afterClose === null || _afterClose === void 0 ? void 0 : _afterClose();
|
|
setAnimatedVisible(false);
|
|
}
|
|
}))));
|
|
};
|
|
DialogWrap.displayName = 'Dialog';
|
|
/* harmony default export */ var es_DialogWrap = (DialogWrap);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-dialog/es/index.js
|
|
|
|
|
|
|
|
/* harmony default export */ var rc_dialog_es = (es_DialogWrap);
|
|
// EXTERNAL MODULE: ./node_modules/react-dom/index.js
|
|
var react_dom = __webpack_require__(73935);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/Dom/addEventListener.js
|
|
|
|
function addEventListenerWrap(target, eventType, cb, option) {
|
|
/* eslint camelcase: 2 */
|
|
var callback = react_dom.unstable_batchedUpdates ? function run(e) {
|
|
react_dom.unstable_batchedUpdates(cb, e);
|
|
} : cb;
|
|
if (target !== null && target !== void 0 && target.addEventListener) {
|
|
target.addEventListener(eventType, callback, option);
|
|
}
|
|
return {
|
|
remove: function remove() {
|
|
if (target !== null && target !== void 0 && target.removeEventListener) {
|
|
target.removeEventListener(eventType, callback, option);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/KeyCode.js
|
|
/**
|
|
* @ignore
|
|
* some key-codes definition and utils from closure-library
|
|
* @author yiminghe@gmail.com
|
|
*/
|
|
|
|
var KeyCode_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_KeyCode.F1 && keyCode <= KeyCode_KeyCode.F12) {
|
|
return false;
|
|
}
|
|
|
|
// The following keys are quite harmless, even in combination with
|
|
// CTRL, ALT or SHIFT.
|
|
switch (keyCode) {
|
|
case KeyCode_KeyCode.ALT:
|
|
case KeyCode_KeyCode.CAPS_LOCK:
|
|
case KeyCode_KeyCode.CONTEXT_MENU:
|
|
case KeyCode_KeyCode.CTRL:
|
|
case KeyCode_KeyCode.DOWN:
|
|
case KeyCode_KeyCode.END:
|
|
case KeyCode_KeyCode.ESC:
|
|
case KeyCode_KeyCode.HOME:
|
|
case KeyCode_KeyCode.INSERT:
|
|
case KeyCode_KeyCode.LEFT:
|
|
case KeyCode_KeyCode.MAC_FF_META:
|
|
case KeyCode_KeyCode.META:
|
|
case KeyCode_KeyCode.NUMLOCK:
|
|
case KeyCode_KeyCode.NUM_CENTER:
|
|
case KeyCode_KeyCode.PAGE_DOWN:
|
|
case KeyCode_KeyCode.PAGE_UP:
|
|
case KeyCode_KeyCode.PAUSE:
|
|
case KeyCode_KeyCode.PRINT_SCREEN:
|
|
case KeyCode_KeyCode.RIGHT:
|
|
case KeyCode_KeyCode.SHIFT:
|
|
case KeyCode_KeyCode.UP:
|
|
case KeyCode_KeyCode.WIN_KEY:
|
|
case KeyCode_KeyCode.WIN_KEY_RIGHT:
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
},
|
|
/**
|
|
* whether character is entered.
|
|
*/
|
|
isCharacterKey: function isCharacterKey(keyCode) {
|
|
if (keyCode >= KeyCode_KeyCode.ZERO && keyCode <= KeyCode_KeyCode.NINE) {
|
|
return true;
|
|
}
|
|
if (keyCode >= KeyCode_KeyCode.NUM_ZERO && keyCode <= KeyCode_KeyCode.NUM_MULTIPLY) {
|
|
return true;
|
|
}
|
|
if (keyCode >= KeyCode_KeyCode.A && keyCode <= 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_KeyCode.SPACE:
|
|
case KeyCode_KeyCode.QUESTION_MARK:
|
|
case KeyCode_KeyCode.NUM_PLUS:
|
|
case KeyCode_KeyCode.NUM_MINUS:
|
|
case KeyCode_KeyCode.NUM_PERIOD:
|
|
case KeyCode_KeyCode.NUM_DIVISION:
|
|
case KeyCode_KeyCode.SEMICOLON:
|
|
case KeyCode_KeyCode.DASH:
|
|
case KeyCode_KeyCode.EQUALS:
|
|
case KeyCode_KeyCode.COMMA:
|
|
case KeyCode_KeyCode.PERIOD:
|
|
case KeyCode_KeyCode.SLASH:
|
|
case KeyCode_KeyCode.APOSTROPHE:
|
|
case KeyCode_KeyCode.SINGLE_QUOTE:
|
|
case KeyCode_KeyCode.OPEN_SQUARE_BRACKET:
|
|
case KeyCode_KeyCode.BACKSLASH:
|
|
case KeyCode_KeyCode.CLOSE_SQUARE_BRACKET:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
};
|
|
/* harmony default export */ var rc_util_es_KeyCode = (KeyCode_KeyCode);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/warning.js
|
|
/* eslint-disable no-console */
|
|
var 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 warning(valid, message) {
|
|
// Support uglify
|
|
if (false) { var finalMessage; }
|
|
}
|
|
function note(valid, message) {
|
|
// Support uglify
|
|
if (false) { var finalMessage; }
|
|
}
|
|
function resetWarned() {
|
|
warned = {};
|
|
}
|
|
function call(method, valid, message) {
|
|
if (!valid && !warned[message]) {
|
|
method(false, message);
|
|
warned[message] = true;
|
|
}
|
|
}
|
|
function warningOnce(valid, message) {
|
|
call(warning, valid, message);
|
|
}
|
|
function noteOnce(valid, message) {
|
|
call(note, valid, message);
|
|
}
|
|
warningOnce.preMessage = preMessage;
|
|
warningOnce.resetWarned = resetWarned;
|
|
warningOnce.noteOnce = noteOnce;
|
|
/* harmony default export */ var es_warning = (warningOnce);
|
|
/* eslint-enable */
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/getFixScaleEleTransPosition.js
|
|
|
|
|
|
|
|
function fixPoint(key, start, width, clientWidth) {
|
|
var startAddWidth = start + width;
|
|
var offsetStart = (width - clientWidth) / 2;
|
|
if (width > clientWidth) {
|
|
if (start > 0) {
|
|
return (0,defineProperty/* default */.Z)({}, key, offsetStart);
|
|
}
|
|
if (start < 0 && startAddWidth < clientWidth) {
|
|
return (0,defineProperty/* default */.Z)({}, key, -offsetStart);
|
|
}
|
|
} else if (start < 0 || startAddWidth > clientWidth) {
|
|
return (0,defineProperty/* default */.Z)({}, key, start < 0 ? offsetStart : -offsetStart);
|
|
}
|
|
return {};
|
|
}
|
|
|
|
/**
|
|
* Fix positon x,y point when
|
|
*
|
|
* Ele width && height < client
|
|
* - Back origin
|
|
*
|
|
* - Ele width | height > clientWidth | clientHeight
|
|
* - left | top > 0 -> Back 0
|
|
* - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight
|
|
*
|
|
* Regardless of other
|
|
*/
|
|
function getFixScaleEleTransPosition(width, height, left, top) {
|
|
var _getClientSize = getClientSize(),
|
|
clientWidth = _getClientSize.width,
|
|
clientHeight = _getClientSize.height;
|
|
var fixPos = null;
|
|
if (width <= clientWidth && height <= clientHeight) {
|
|
fixPos = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
} else if (width > clientWidth || height > clientHeight) {
|
|
fixPos = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, fixPoint('x', left, width, clientWidth)), fixPoint('y', top, height, clientHeight));
|
|
}
|
|
return fixPos;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/isEqual.js
|
|
|
|
|
|
|
|
/**
|
|
* Deeply compares two object literals.
|
|
* @param obj1 object 1
|
|
* @param obj2 object 2
|
|
* @param shallow shallow compare
|
|
* @returns
|
|
*/
|
|
function isEqual(obj1, obj2) {
|
|
var shallow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
// https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f
|
|
var refSet = new Set();
|
|
function deepEqual(a, b) {
|
|
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
var circular = refSet.has(a);
|
|
es_warning(!circular, 'Warning: There may be circular references');
|
|
if (circular) {
|
|
return false;
|
|
}
|
|
if (a === b) {
|
|
return true;
|
|
}
|
|
if (shallow && level > 1) {
|
|
return false;
|
|
}
|
|
refSet.add(a);
|
|
var newLevel = level + 1;
|
|
if (Array.isArray(a)) {
|
|
if (!Array.isArray(b) || a.length !== b.length) {
|
|
return false;
|
|
}
|
|
for (var i = 0; i < a.length; i++) {
|
|
if (!deepEqual(a[i], b[i], newLevel)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
if (a && b && (0,esm_typeof/* default */.Z)(a) === 'object' && (0,esm_typeof/* default */.Z)(b) === 'object') {
|
|
var keys = Object.keys(a);
|
|
if (keys.length !== Object.keys(b).length) {
|
|
return false;
|
|
}
|
|
return keys.every(function (key) {
|
|
return deepEqual(a[key], b[key], newLevel);
|
|
});
|
|
}
|
|
// other
|
|
return false;
|
|
}
|
|
return deepEqual(obj1, obj2);
|
|
}
|
|
/* harmony default export */ var es_isEqual = (isEqual);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/node_modules/rc-util/es/raf.js
|
|
var raf = function raf(callback) {
|
|
return +setTimeout(callback, 16);
|
|
};
|
|
var caf = function caf(num) {
|
|
return clearTimeout(num);
|
|
};
|
|
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
|
|
raf = function raf(callback) {
|
|
return window.requestAnimationFrame(callback);
|
|
};
|
|
caf = function caf(handle) {
|
|
return window.cancelAnimationFrame(handle);
|
|
};
|
|
}
|
|
var rafUUID = 0;
|
|
var rafIds = new Map();
|
|
function cleanup(id) {
|
|
rafIds.delete(id);
|
|
}
|
|
var wrapperRaf = function wrapperRaf(callback) {
|
|
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
rafUUID += 1;
|
|
var id = rafUUID;
|
|
function callRef(leftTimes) {
|
|
if (leftTimes === 0) {
|
|
// Clean up
|
|
cleanup(id);
|
|
|
|
// Trigger
|
|
callback();
|
|
} else {
|
|
// Next raf
|
|
var realId = raf(function () {
|
|
callRef(leftTimes - 1);
|
|
});
|
|
|
|
// Bind real raf id
|
|
rafIds.set(id, realId);
|
|
}
|
|
}
|
|
callRef(times);
|
|
return id;
|
|
};
|
|
wrapperRaf.cancel = function (id) {
|
|
var realId = rafIds.get(id);
|
|
cleanup(realId);
|
|
return caf(realId);
|
|
};
|
|
/* harmony default export */ var es_raf = (wrapperRaf);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/hooks/useImageTransform.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var initialTransform = {
|
|
x: 0,
|
|
y: 0,
|
|
rotate: 0,
|
|
scale: 1,
|
|
flipX: false,
|
|
flipY: false
|
|
};
|
|
function useImageTransform(imgRef, minScale, maxScale, onTransform) {
|
|
var frame = (0,react.useRef)(null);
|
|
var queue = (0,react.useRef)([]);
|
|
var _useState = (0,react.useState)(initialTransform),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
transform = _useState2[0],
|
|
setTransform = _useState2[1];
|
|
var resetTransform = function resetTransform(action) {
|
|
setTransform(initialTransform);
|
|
if (onTransform && !es_isEqual(initialTransform, transform)) {
|
|
onTransform({
|
|
transform: initialTransform,
|
|
action: action
|
|
});
|
|
}
|
|
};
|
|
|
|
/** Direct update transform */
|
|
var updateTransform = function updateTransform(newTransform, action) {
|
|
if (frame.current === null) {
|
|
queue.current = [];
|
|
frame.current = es_raf(function () {
|
|
setTransform(function (preState) {
|
|
var memoState = preState;
|
|
queue.current.forEach(function (queueState) {
|
|
memoState = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, memoState), queueState);
|
|
});
|
|
frame.current = null;
|
|
onTransform === null || onTransform === void 0 ? void 0 : onTransform({
|
|
transform: memoState,
|
|
action: action
|
|
});
|
|
return memoState;
|
|
});
|
|
});
|
|
}
|
|
queue.current.push((0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, transform), newTransform));
|
|
};
|
|
|
|
/** Scale according to the position of clientX and clientY */
|
|
var dispatchZoomChange = function dispatchZoomChange(ratio, action, clientX, clientY) {
|
|
var _imgRef$current = imgRef.current,
|
|
width = _imgRef$current.width,
|
|
height = _imgRef$current.height,
|
|
offsetWidth = _imgRef$current.offsetWidth,
|
|
offsetHeight = _imgRef$current.offsetHeight,
|
|
offsetLeft = _imgRef$current.offsetLeft,
|
|
offsetTop = _imgRef$current.offsetTop;
|
|
var newRatio = ratio;
|
|
var newScale = transform.scale * ratio;
|
|
if (newScale > maxScale) {
|
|
newRatio = maxScale / transform.scale;
|
|
newScale = maxScale;
|
|
} else if (newScale < minScale) {
|
|
newRatio = minScale / transform.scale;
|
|
newScale = minScale;
|
|
}
|
|
|
|
/** Default center point scaling */
|
|
var mergedClientX = clientX !== null && clientX !== void 0 ? clientX : innerWidth / 2;
|
|
var mergedClientY = clientY !== null && clientY !== void 0 ? clientY : innerHeight / 2;
|
|
var diffRatio = newRatio - 1;
|
|
/** Deviation calculated from image size */
|
|
var diffImgX = diffRatio * width * 0.5;
|
|
var diffImgY = diffRatio * height * 0.5;
|
|
/** The difference between the click position and the edge of the document */
|
|
var diffOffsetLeft = diffRatio * (mergedClientX - transform.x - offsetLeft);
|
|
var diffOffsetTop = diffRatio * (mergedClientY - transform.y - offsetTop);
|
|
/** Final positioning */
|
|
var newX = transform.x - (diffOffsetLeft - diffImgX);
|
|
var newY = transform.y - (diffOffsetTop - diffImgY);
|
|
|
|
/**
|
|
* When zooming the image
|
|
* When the image size is smaller than the width and height of the window, the position is initialized
|
|
*/
|
|
if (ratio < 1 && newScale === 1) {
|
|
var mergedWidth = offsetWidth * newScale;
|
|
var mergedHeight = offsetHeight * newScale;
|
|
var _getClientSize = getClientSize(),
|
|
clientWidth = _getClientSize.width,
|
|
clientHeight = _getClientSize.height;
|
|
if (mergedWidth <= clientWidth && mergedHeight <= clientHeight) {
|
|
newX = 0;
|
|
newY = 0;
|
|
}
|
|
}
|
|
updateTransform({
|
|
x: newX,
|
|
y: newY,
|
|
scale: newScale
|
|
}, action);
|
|
};
|
|
return {
|
|
transform: transform,
|
|
resetTransform: resetTransform,
|
|
updateTransform: updateTransform,
|
|
dispatchZoomChange: dispatchZoomChange
|
|
};
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/Operations.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Operations = function Operations(props) {
|
|
var visible = props.visible,
|
|
maskTransitionName = props.maskTransitionName,
|
|
getContainer = props.getContainer,
|
|
prefixCls = props.prefixCls,
|
|
rootClassName = props.rootClassName,
|
|
icons = props.icons,
|
|
countRender = props.countRender,
|
|
showSwitch = props.showSwitch,
|
|
showProgress = props.showProgress,
|
|
current = props.current,
|
|
transform = props.transform,
|
|
count = props.count,
|
|
scale = props.scale,
|
|
minScale = props.minScale,
|
|
maxScale = props.maxScale,
|
|
closeIcon = props.closeIcon,
|
|
onSwitchLeft = props.onSwitchLeft,
|
|
onSwitchRight = props.onSwitchRight,
|
|
onClose = props.onClose,
|
|
onZoomIn = props.onZoomIn,
|
|
onZoomOut = props.onZoomOut,
|
|
onRotateRight = props.onRotateRight,
|
|
onRotateLeft = props.onRotateLeft,
|
|
onFlipX = props.onFlipX,
|
|
onFlipY = props.onFlipY,
|
|
toolbarRender = props.toolbarRender;
|
|
var groupContext = (0,react.useContext)(PreviewGroupContext);
|
|
var rotateLeft = icons.rotateLeft,
|
|
rotateRight = icons.rotateRight,
|
|
zoomIn = icons.zoomIn,
|
|
zoomOut = icons.zoomOut,
|
|
close = icons.close,
|
|
left = icons.left,
|
|
right = icons.right,
|
|
flipX = icons.flipX,
|
|
flipY = icons.flipY;
|
|
var toolClassName = "".concat(prefixCls, "-operations-operation");
|
|
react.useEffect(function () {
|
|
var onKeyDown = function onKeyDown(e) {
|
|
if (e.keyCode === rc_util_es_KeyCode.ESC) {
|
|
onClose();
|
|
}
|
|
};
|
|
if (visible) {
|
|
window.addEventListener('keydown', onKeyDown);
|
|
}
|
|
return function () {
|
|
window.removeEventListener('keydown', onKeyDown);
|
|
};
|
|
}, [visible]);
|
|
var tools = [{
|
|
icon: flipY,
|
|
onClick: onFlipY,
|
|
type: 'flipY'
|
|
}, {
|
|
icon: flipX,
|
|
onClick: onFlipX,
|
|
type: 'flipX'
|
|
}, {
|
|
icon: rotateLeft,
|
|
onClick: onRotateLeft,
|
|
type: 'rotateLeft'
|
|
}, {
|
|
icon: rotateRight,
|
|
onClick: onRotateRight,
|
|
type: 'rotateRight'
|
|
}, {
|
|
icon: zoomOut,
|
|
onClick: onZoomOut,
|
|
type: 'zoomOut',
|
|
disabled: scale === minScale
|
|
}, {
|
|
icon: zoomIn,
|
|
onClick: onZoomIn,
|
|
type: 'zoomIn',
|
|
disabled: scale === maxScale
|
|
}];
|
|
var toolsNode = tools.map(function (_ref) {
|
|
var _classnames;
|
|
var icon = _ref.icon,
|
|
onClick = _ref.onClick,
|
|
type = _ref.type,
|
|
disabled = _ref.disabled;
|
|
return /*#__PURE__*/react.createElement("div", {
|
|
className: classnames_default()(toolClassName, (_classnames = {}, (0,defineProperty/* default */.Z)(_classnames, "".concat(prefixCls, "-operations-operation-").concat(type), true), (0,defineProperty/* default */.Z)(_classnames, "".concat(prefixCls, "-operations-operation-disabled"), !!disabled), _classnames)),
|
|
onClick: onClick,
|
|
key: type
|
|
}, icon);
|
|
});
|
|
var toolbarNode = /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(prefixCls, "-operations")
|
|
}, toolsNode);
|
|
return /*#__PURE__*/react.createElement(rc_motion_es/* default */.Z, {
|
|
visible: visible,
|
|
motionName: maskTransitionName
|
|
}, function (_ref2) {
|
|
var className = _ref2.className,
|
|
style = _ref2.style;
|
|
return /*#__PURE__*/react.createElement(es/* default */.Z, {
|
|
open: true,
|
|
getContainer: getContainer !== null && getContainer !== void 0 ? getContainer : document.body
|
|
}, /*#__PURE__*/react.createElement("div", {
|
|
className: classnames_default()("".concat(prefixCls, "-operations-wrapper"), className, rootClassName),
|
|
style: style
|
|
}, closeIcon === null ? null : /*#__PURE__*/react.createElement("button", {
|
|
className: "".concat(prefixCls, "-close"),
|
|
onClick: onClose
|
|
}, closeIcon || close), showSwitch && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("div", {
|
|
className: classnames_default()("".concat(prefixCls, "-switch-left"), (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-switch-left-disabled"), current === 0)),
|
|
onClick: onSwitchLeft
|
|
}, left), /*#__PURE__*/react.createElement("div", {
|
|
className: classnames_default()("".concat(prefixCls, "-switch-right"), (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-switch-right-disabled"), current === count - 1)),
|
|
onClick: onSwitchRight
|
|
}, right)), /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(prefixCls, "-footer")
|
|
}, showProgress && /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(prefixCls, "-progress")
|
|
}, countRender ? countRender(current + 1, count) : "".concat(current + 1, " / ").concat(count)), toolbarRender ? toolbarRender(toolbarNode, (0,objectSpread2/* default */.Z)({
|
|
icons: {
|
|
flipYIcon: toolsNode[0],
|
|
flipXIcon: toolsNode[1],
|
|
rotateLeftIcon: toolsNode[2],
|
|
rotateRightIcon: toolsNode[3],
|
|
zoomOutIcon: toolsNode[4],
|
|
zoomInIcon: toolsNode[5]
|
|
},
|
|
actions: {
|
|
onFlipY: onFlipY,
|
|
onFlipX: onFlipX,
|
|
onRotateLeft: onRotateLeft,
|
|
onRotateRight: onRotateRight,
|
|
onZoomOut: onZoomOut,
|
|
onZoomIn: onZoomIn
|
|
},
|
|
transform: transform
|
|
}, groupContext ? {
|
|
current: current,
|
|
total: count
|
|
} : {})) : toolbarNode)));
|
|
});
|
|
};
|
|
/* harmony default export */ var es_Operations = (Operations);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/previewConfig.js
|
|
/** Scale the ratio base */
|
|
var BASE_SCALE_RATIO = 1;
|
|
/** The maximum zoom ratio when the mouse zooms in, adjustable */
|
|
var WHEEL_MAX_SCALE_RATIO = 1;
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/Preview.js
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["fallback", "src", "imgRef"],
|
|
_excluded2 = ["prefixCls", "src", "alt", "fallback", "movable", "onClose", "visible", "icons", "rootClassName", "closeIcon", "getContainer", "current", "count", "countRender", "scaleStep", "minScale", "maxScale", "transitionName", "maskTransitionName", "imageRender", "imgCommonProps", "toolbarRender", "onTransform", "onChange"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PreviewImage = function PreviewImage(_ref) {
|
|
var fallback = _ref.fallback,
|
|
src = _ref.src,
|
|
imgRef = _ref.imgRef,
|
|
props = (0,objectWithoutProperties/* default */.Z)(_ref, _excluded);
|
|
var _useStatus = useStatus({
|
|
src: src,
|
|
fallback: fallback
|
|
}),
|
|
_useStatus2 = (0,slicedToArray/* default */.Z)(_useStatus, 2),
|
|
getImgRef = _useStatus2[0],
|
|
srcAndOnload = _useStatus2[1];
|
|
return /*#__PURE__*/react.createElement("img", (0,esm_extends/* default */.Z)({
|
|
ref: function ref(_ref2) {
|
|
imgRef.current = _ref2;
|
|
getImgRef(_ref2);
|
|
}
|
|
}, props, srcAndOnload));
|
|
};
|
|
var Preview = function Preview(props) {
|
|
var prefixCls = props.prefixCls,
|
|
src = props.src,
|
|
alt = props.alt,
|
|
fallback = props.fallback,
|
|
_props$movable = props.movable,
|
|
movable = _props$movable === void 0 ? true : _props$movable,
|
|
onClose = props.onClose,
|
|
visible = props.visible,
|
|
_props$icons = props.icons,
|
|
icons = _props$icons === void 0 ? {} : _props$icons,
|
|
rootClassName = props.rootClassName,
|
|
closeIcon = props.closeIcon,
|
|
getContainer = props.getContainer,
|
|
_props$current = props.current,
|
|
current = _props$current === void 0 ? 0 : _props$current,
|
|
_props$count = props.count,
|
|
count = _props$count === void 0 ? 1 : _props$count,
|
|
countRender = props.countRender,
|
|
_props$scaleStep = props.scaleStep,
|
|
scaleStep = _props$scaleStep === void 0 ? 0.5 : _props$scaleStep,
|
|
_props$minScale = props.minScale,
|
|
minScale = _props$minScale === void 0 ? 1 : _props$minScale,
|
|
_props$maxScale = props.maxScale,
|
|
maxScale = _props$maxScale === void 0 ? 50 : _props$maxScale,
|
|
_props$transitionName = props.transitionName,
|
|
transitionName = _props$transitionName === void 0 ? 'zoom' : _props$transitionName,
|
|
_props$maskTransition = props.maskTransitionName,
|
|
maskTransitionName = _props$maskTransition === void 0 ? 'fade' : _props$maskTransition,
|
|
imageRender = props.imageRender,
|
|
imgCommonProps = props.imgCommonProps,
|
|
toolbarRender = props.toolbarRender,
|
|
onTransform = props.onTransform,
|
|
onChange = props.onChange,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded2);
|
|
var imgRef = (0,react.useRef)();
|
|
var downPositionRef = (0,react.useRef)({
|
|
deltaX: 0,
|
|
deltaY: 0,
|
|
transformX: 0,
|
|
transformY: 0
|
|
});
|
|
var _useState = (0,react.useState)(false),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
isMoving = _useState2[0],
|
|
setMoving = _useState2[1];
|
|
var groupContext = (0,react.useContext)(PreviewGroupContext);
|
|
var showLeftOrRightSwitches = groupContext && count > 1;
|
|
var showOperationsProgress = groupContext && count >= 1;
|
|
var _useImageTransform = useImageTransform(imgRef, minScale, maxScale, onTransform),
|
|
transform = _useImageTransform.transform,
|
|
resetTransform = _useImageTransform.resetTransform,
|
|
updateTransform = _useImageTransform.updateTransform,
|
|
dispatchZoomChange = _useImageTransform.dispatchZoomChange;
|
|
var _useState3 = (0,react.useState)(true),
|
|
_useState4 = (0,slicedToArray/* default */.Z)(_useState3, 2),
|
|
enableTransition = _useState4[0],
|
|
setEnableTransition = _useState4[1];
|
|
var rotate = transform.rotate,
|
|
scale = transform.scale,
|
|
x = transform.x,
|
|
y = transform.y;
|
|
var wrapClassName = classnames_default()((0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-moving"), isMoving));
|
|
(0,react.useEffect)(function () {
|
|
if (!enableTransition) {
|
|
setEnableTransition(true);
|
|
}
|
|
}, [enableTransition]);
|
|
var onAfterClose = function onAfterClose() {
|
|
resetTransform('close');
|
|
};
|
|
var onZoomIn = function onZoomIn() {
|
|
dispatchZoomChange(BASE_SCALE_RATIO + scaleStep, 'zoomIn');
|
|
};
|
|
var onZoomOut = function onZoomOut() {
|
|
dispatchZoomChange(BASE_SCALE_RATIO / (BASE_SCALE_RATIO + scaleStep), 'zoomOut');
|
|
};
|
|
var onRotateRight = function onRotateRight() {
|
|
updateTransform({
|
|
rotate: rotate + 90
|
|
}, 'rotateRight');
|
|
};
|
|
var onRotateLeft = function onRotateLeft() {
|
|
updateTransform({
|
|
rotate: rotate - 90
|
|
}, 'rotateLeft');
|
|
};
|
|
var onFlipX = function onFlipX() {
|
|
updateTransform({
|
|
flipX: !transform.flipX
|
|
}, 'flipX');
|
|
};
|
|
var onFlipY = function onFlipY() {
|
|
updateTransform({
|
|
flipY: !transform.flipY
|
|
}, 'flipY');
|
|
};
|
|
var onSwitchLeft = function onSwitchLeft(event) {
|
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
if (current > 0) {
|
|
setEnableTransition(false);
|
|
resetTransform('prev');
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(current - 1, current);
|
|
}
|
|
};
|
|
var onSwitchRight = function onSwitchRight(event) {
|
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
if (current < count - 1) {
|
|
setEnableTransition(false);
|
|
resetTransform('next');
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(current + 1, current);
|
|
}
|
|
};
|
|
var onMouseUp = function onMouseUp() {
|
|
if (visible && isMoving) {
|
|
setMoving(false);
|
|
/** No need to restore the position when the picture is not moved, So as not to interfere with the click */
|
|
var _downPositionRef$curr = downPositionRef.current,
|
|
transformX = _downPositionRef$curr.transformX,
|
|
transformY = _downPositionRef$curr.transformY;
|
|
var hasChangedPosition = x !== transformX && y !== transformY;
|
|
if (!hasChangedPosition) {
|
|
return;
|
|
}
|
|
var width = imgRef.current.offsetWidth * scale;
|
|
var height = imgRef.current.offsetHeight * scale;
|
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
var _imgRef$current$getBo = imgRef.current.getBoundingClientRect(),
|
|
left = _imgRef$current$getBo.left,
|
|
top = _imgRef$current$getBo.top;
|
|
var isRotate = rotate % 180 !== 0;
|
|
var fixState = getFixScaleEleTransPosition(isRotate ? height : width, isRotate ? width : height, left, top);
|
|
if (fixState) {
|
|
updateTransform((0,objectSpread2/* default */.Z)({}, fixState), 'dragRebound');
|
|
}
|
|
}
|
|
};
|
|
var onMouseDown = function onMouseDown(event) {
|
|
// Only allow main button
|
|
if (!movable || event.button !== 0) return;
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
downPositionRef.current = {
|
|
deltaX: event.pageX - transform.x,
|
|
deltaY: event.pageY - transform.y,
|
|
transformX: transform.x,
|
|
transformY: transform.y
|
|
};
|
|
setMoving(true);
|
|
};
|
|
var onMouseMove = function onMouseMove(event) {
|
|
if (visible && isMoving) {
|
|
updateTransform({
|
|
x: event.pageX - downPositionRef.current.deltaX,
|
|
y: event.pageY - downPositionRef.current.deltaY
|
|
}, 'move');
|
|
}
|
|
};
|
|
var onWheel = function onWheel(event) {
|
|
if (!visible || event.deltaY == 0) return;
|
|
// Scale ratio depends on the deltaY size
|
|
var scaleRatio = Math.abs(event.deltaY / 100);
|
|
// Limit the maximum scale ratio
|
|
var mergedScaleRatio = Math.min(scaleRatio, WHEEL_MAX_SCALE_RATIO);
|
|
// Scale the ratio each time
|
|
var ratio = BASE_SCALE_RATIO + mergedScaleRatio * scaleStep;
|
|
if (event.deltaY > 0) {
|
|
ratio = BASE_SCALE_RATIO / ratio;
|
|
}
|
|
dispatchZoomChange(ratio, 'wheel', event.clientX, event.clientY);
|
|
};
|
|
var onKeyDown = function onKeyDown(event) {
|
|
if (!visible || !showLeftOrRightSwitches) return;
|
|
if (event.keyCode === rc_util_es_KeyCode.LEFT) {
|
|
onSwitchLeft();
|
|
} else if (event.keyCode === rc_util_es_KeyCode.RIGHT) {
|
|
onSwitchRight();
|
|
}
|
|
};
|
|
var onDoubleClick = function onDoubleClick(event) {
|
|
if (visible) {
|
|
if (scale !== 1) {
|
|
updateTransform({
|
|
x: 0,
|
|
y: 0,
|
|
scale: 1
|
|
}, 'doubleClick');
|
|
} else {
|
|
dispatchZoomChange(BASE_SCALE_RATIO + scaleStep, 'doubleClick', event.clientX, event.clientY);
|
|
}
|
|
}
|
|
};
|
|
(0,react.useEffect)(function () {
|
|
var onTopMouseUpListener;
|
|
var onTopMouseMoveListener;
|
|
var onMouseUpListener;
|
|
var onMouseMoveListener;
|
|
if (movable) {
|
|
onMouseUpListener = addEventListenerWrap(window, 'mouseup', onMouseUp, false);
|
|
onMouseMoveListener = addEventListenerWrap(window, 'mousemove', onMouseMove, false);
|
|
try {
|
|
// Resolve if in iframe lost event
|
|
/* istanbul ignore next */
|
|
if (window.top !== window.self) {
|
|
onTopMouseUpListener = addEventListenerWrap(window.top, 'mouseup', onMouseUp, false);
|
|
onTopMouseMoveListener = addEventListenerWrap(window.top, 'mousemove', onMouseMove, false);
|
|
}
|
|
} catch (error) {
|
|
/* istanbul ignore next */
|
|
warning(false, "[rc-image] ".concat(error));
|
|
}
|
|
}
|
|
return function () {
|
|
var _onMouseUpListener, _onMouseMoveListener, _onTopMouseUpListener, _onTopMouseMoveListen;
|
|
(_onMouseUpListener = onMouseUpListener) === null || _onMouseUpListener === void 0 ? void 0 : _onMouseUpListener.remove();
|
|
(_onMouseMoveListener = onMouseMoveListener) === null || _onMouseMoveListener === void 0 ? void 0 : _onMouseMoveListener.remove();
|
|
/* istanbul ignore next */
|
|
(_onTopMouseUpListener = onTopMouseUpListener) === null || _onTopMouseUpListener === void 0 ? void 0 : _onTopMouseUpListener.remove();
|
|
/* istanbul ignore next */
|
|
(_onTopMouseMoveListen = onTopMouseMoveListener) === null || _onTopMouseMoveListen === void 0 ? void 0 : _onTopMouseMoveListen.remove();
|
|
};
|
|
}, [visible, isMoving, x, y, rotate, movable]);
|
|
(0,react.useEffect)(function () {
|
|
var onKeyDownListener = addEventListenerWrap(window, 'keydown', onKeyDown, false);
|
|
return function () {
|
|
onKeyDownListener.remove();
|
|
};
|
|
}, [visible, showLeftOrRightSwitches, current]);
|
|
var imgNode = /*#__PURE__*/react.createElement(PreviewImage, (0,esm_extends/* default */.Z)({}, imgCommonProps, {
|
|
width: props.width,
|
|
height: props.height,
|
|
imgRef: imgRef,
|
|
className: "".concat(prefixCls, "-img"),
|
|
alt: alt,
|
|
style: {
|
|
transform: "translate3d(".concat(transform.x, "px, ").concat(transform.y, "px, 0) scale3d(").concat(transform.flipX ? '-' : '').concat(scale, ", ").concat(transform.flipY ? '-' : '').concat(scale, ", 1) rotate(").concat(rotate, "deg)"),
|
|
transitionDuration: !enableTransition && '0s'
|
|
},
|
|
fallback: fallback,
|
|
src: src,
|
|
onWheel: onWheel,
|
|
onMouseDown: onMouseDown,
|
|
onDoubleClick: onDoubleClick
|
|
}));
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(rc_dialog_es, (0,esm_extends/* default */.Z)({
|
|
transitionName: transitionName,
|
|
maskTransitionName: maskTransitionName,
|
|
closable: false,
|
|
keyboard: true,
|
|
prefixCls: prefixCls,
|
|
onClose: onClose,
|
|
visible: visible,
|
|
wrapClassName: wrapClassName,
|
|
rootClassName: rootClassName,
|
|
getContainer: getContainer
|
|
}, restProps, {
|
|
afterClose: onAfterClose
|
|
}), /*#__PURE__*/react.createElement("div", {
|
|
className: "".concat(prefixCls, "-img-wrapper")
|
|
}, imageRender ? imageRender(imgNode, (0,objectSpread2/* default */.Z)({
|
|
transform: transform
|
|
}, groupContext ? {
|
|
current: current
|
|
} : {})) : imgNode)), /*#__PURE__*/react.createElement(es_Operations, {
|
|
visible: visible,
|
|
transform: transform,
|
|
maskTransitionName: maskTransitionName,
|
|
closeIcon: closeIcon,
|
|
getContainer: getContainer,
|
|
prefixCls: prefixCls,
|
|
rootClassName: rootClassName,
|
|
icons: icons,
|
|
countRender: countRender,
|
|
showSwitch: showLeftOrRightSwitches,
|
|
showProgress: showOperationsProgress,
|
|
current: current,
|
|
count: count,
|
|
scale: scale,
|
|
minScale: minScale,
|
|
maxScale: maxScale,
|
|
toolbarRender: toolbarRender,
|
|
onSwitchLeft: onSwitchLeft,
|
|
onSwitchRight: onSwitchRight,
|
|
onZoomIn: onZoomIn,
|
|
onZoomOut: onZoomOut,
|
|
onRotateRight: onRotateRight,
|
|
onRotateLeft: onRotateLeft,
|
|
onFlipX: onFlipX,
|
|
onFlipY: onFlipY,
|
|
onClose: onClose
|
|
}));
|
|
};
|
|
/* harmony default export */ var es_Preview = (Preview);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/hooks/usePreviewItems.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Merge props provided `items` or context collected images
|
|
*/
|
|
function usePreviewItems(items) {
|
|
// Context collection image data
|
|
var _React$useState = react.useState({}),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
images = _React$useState2[0],
|
|
setImages = _React$useState2[1];
|
|
var registerImage = react.useCallback(function (id, data) {
|
|
setImages(function (imgs) {
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, imgs), {}, (0,defineProperty/* default */.Z)({}, id, data));
|
|
});
|
|
return function () {
|
|
setImages(function (imgs) {
|
|
var cloneImgs = (0,objectSpread2/* default */.Z)({}, imgs);
|
|
delete cloneImgs[id];
|
|
return cloneImgs;
|
|
});
|
|
};
|
|
}, []);
|
|
|
|
// items
|
|
var mergedItems = react.useMemo(function () {
|
|
if (items) {
|
|
return items.map(function (item) {
|
|
if (typeof item === 'string') {
|
|
return {
|
|
data: {
|
|
src: item
|
|
}
|
|
};
|
|
}
|
|
var data = {};
|
|
Object.keys(item).forEach(function (key) {
|
|
if (['src'].concat((0,toConsumableArray/* default */.Z)(COMMON_PROPS)).includes(key)) {
|
|
data[key] = item[key];
|
|
}
|
|
});
|
|
return {
|
|
data: data
|
|
};
|
|
});
|
|
}
|
|
return Object.keys(images).reduce(function (total, id) {
|
|
var _images$id = images[id],
|
|
canPreview = _images$id.canPreview,
|
|
data = _images$id.data;
|
|
if (canPreview) {
|
|
total.push({
|
|
data: data,
|
|
id: id
|
|
});
|
|
}
|
|
return total;
|
|
}, []);
|
|
}, [items, images]);
|
|
return [mergedItems, registerImage];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/PreviewGroup.js
|
|
|
|
|
|
|
|
|
|
var PreviewGroup_excluded = ["visible", "onVisibleChange", "getContainer", "current", "movable", "minScale", "maxScale", "countRender", "closeIcon", "onChange", "onTransform", "toolbarRender", "imageRender"],
|
|
PreviewGroup_excluded2 = ["src"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Group = function Group(_ref) {
|
|
var _mergedItems$current;
|
|
var _ref$previewPrefixCls = _ref.previewPrefixCls,
|
|
previewPrefixCls = _ref$previewPrefixCls === void 0 ? 'rc-image-preview' : _ref$previewPrefixCls,
|
|
children = _ref.children,
|
|
_ref$icons = _ref.icons,
|
|
icons = _ref$icons === void 0 ? {} : _ref$icons,
|
|
items = _ref.items,
|
|
preview = _ref.preview,
|
|
fallback = _ref.fallback;
|
|
var _ref2 = (0,esm_typeof/* default */.Z)(preview) === 'object' ? preview : {},
|
|
previewVisible = _ref2.visible,
|
|
onVisibleChange = _ref2.onVisibleChange,
|
|
getContainer = _ref2.getContainer,
|
|
currentIndex = _ref2.current,
|
|
movable = _ref2.movable,
|
|
minScale = _ref2.minScale,
|
|
maxScale = _ref2.maxScale,
|
|
countRender = _ref2.countRender,
|
|
closeIcon = _ref2.closeIcon,
|
|
onChange = _ref2.onChange,
|
|
onTransform = _ref2.onTransform,
|
|
toolbarRender = _ref2.toolbarRender,
|
|
imageRender = _ref2.imageRender,
|
|
dialogProps = (0,objectWithoutProperties/* default */.Z)(_ref2, PreviewGroup_excluded);
|
|
|
|
// ========================== Items ===========================
|
|
var _usePreviewItems = usePreviewItems(items),
|
|
_usePreviewItems2 = (0,slicedToArray/* default */.Z)(_usePreviewItems, 2),
|
|
mergedItems = _usePreviewItems2[0],
|
|
register = _usePreviewItems2[1];
|
|
|
|
// ========================= Preview ==========================
|
|
// >>> Index
|
|
var _useMergedState = useMergedState(0, {
|
|
value: currentIndex
|
|
}),
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
current = _useMergedState2[0],
|
|
setCurrent = _useMergedState2[1];
|
|
var _useState = (0,react.useState)(false),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
keepOpenIndex = _useState2[0],
|
|
setKeepOpenIndex = _useState2[1];
|
|
|
|
// >>> Image
|
|
var _ref3 = ((_mergedItems$current = mergedItems[current]) === null || _mergedItems$current === void 0 ? void 0 : _mergedItems$current.data) || {},
|
|
src = _ref3.src,
|
|
imgCommonProps = (0,objectWithoutProperties/* default */.Z)(_ref3, PreviewGroup_excluded2);
|
|
// >>> Visible
|
|
var _useMergedState3 = useMergedState(!!previewVisible, {
|
|
value: previewVisible,
|
|
onChange: function onChange(val, prevVal) {
|
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(val, prevVal, current);
|
|
}
|
|
}),
|
|
_useMergedState4 = (0,slicedToArray/* default */.Z)(_useMergedState3, 2),
|
|
isShowPreview = _useMergedState4[0],
|
|
setShowPreview = _useMergedState4[1];
|
|
|
|
// >>> Position
|
|
var _useState3 = (0,react.useState)(null),
|
|
_useState4 = (0,slicedToArray/* default */.Z)(_useState3, 2),
|
|
mousePosition = _useState4[0],
|
|
setMousePosition = _useState4[1];
|
|
var onPreviewFromImage = react.useCallback(function (id, mouseX, mouseY) {
|
|
var index = mergedItems.findIndex(function (item) {
|
|
return item.id === id;
|
|
});
|
|
setShowPreview(true);
|
|
setMousePosition({
|
|
x: mouseX,
|
|
y: mouseY
|
|
});
|
|
setCurrent(index < 0 ? 0 : index);
|
|
setKeepOpenIndex(true);
|
|
}, [mergedItems]);
|
|
|
|
// Reset current when reopen
|
|
react.useEffect(function () {
|
|
if (isShowPreview) {
|
|
if (!keepOpenIndex) {
|
|
setCurrent(0);
|
|
}
|
|
} else {
|
|
setKeepOpenIndex(false);
|
|
}
|
|
}, [isShowPreview]);
|
|
|
|
// ========================== Events ==========================
|
|
var onInternalChange = function onInternalChange(next, prev) {
|
|
setCurrent(next);
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(next, prev);
|
|
};
|
|
var onPreviewClose = function onPreviewClose() {
|
|
setShowPreview(false);
|
|
setMousePosition(null);
|
|
};
|
|
|
|
// ========================= Context ==========================
|
|
var previewGroupContext = react.useMemo(function () {
|
|
return {
|
|
register: register,
|
|
onPreview: onPreviewFromImage
|
|
};
|
|
}, [register, onPreviewFromImage]);
|
|
|
|
// ========================== Render ==========================
|
|
return /*#__PURE__*/react.createElement(PreviewGroupContext.Provider, {
|
|
value: previewGroupContext
|
|
}, children, /*#__PURE__*/react.createElement(es_Preview, (0,esm_extends/* default */.Z)({
|
|
"aria-hidden": !isShowPreview,
|
|
movable: movable,
|
|
visible: isShowPreview,
|
|
prefixCls: previewPrefixCls,
|
|
closeIcon: closeIcon,
|
|
onClose: onPreviewClose,
|
|
mousePosition: mousePosition,
|
|
imgCommonProps: imgCommonProps,
|
|
src: src,
|
|
fallback: fallback,
|
|
icons: icons,
|
|
minScale: minScale,
|
|
maxScale: maxScale,
|
|
getContainer: getContainer,
|
|
current: current,
|
|
count: mergedItems.length,
|
|
countRender: countRender,
|
|
onTransform: onTransform,
|
|
toolbarRender: toolbarRender,
|
|
imageRender: imageRender,
|
|
onChange: onInternalChange
|
|
}, dialogProps)));
|
|
};
|
|
/* harmony default export */ var PreviewGroup = (Group);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/Image.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Image_excluded = ["src", "alt", "onPreviewClose", "prefixCls", "previewPrefixCls", "placeholder", "fallback", "width", "height", "style", "preview", "className", "onClick", "onError", "wrapperClassName", "wrapperStyle", "rootClassName"],
|
|
Image_excluded2 = ["src", "visible", "onVisibleChange", "getContainer", "mask", "maskClassName", "movable", "icons", "scaleStep", "minScale", "maxScale", "imageRender", "toolbarRender"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ImageInternal = function ImageInternal(props) {
|
|
var imgSrc = props.src,
|
|
alt = props.alt,
|
|
onInitialPreviewClose = props.onPreviewClose,
|
|
_props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-image' : _props$prefixCls,
|
|
_props$previewPrefixC = props.previewPrefixCls,
|
|
previewPrefixCls = _props$previewPrefixC === void 0 ? "".concat(prefixCls, "-preview") : _props$previewPrefixC,
|
|
placeholder = props.placeholder,
|
|
fallback = props.fallback,
|
|
width = props.width,
|
|
height = props.height,
|
|
style = props.style,
|
|
_props$preview = props.preview,
|
|
preview = _props$preview === void 0 ? true : _props$preview,
|
|
className = props.className,
|
|
onClick = props.onClick,
|
|
onError = props.onError,
|
|
wrapperClassName = props.wrapperClassName,
|
|
wrapperStyle = props.wrapperStyle,
|
|
rootClassName = props.rootClassName,
|
|
otherProps = (0,objectWithoutProperties/* default */.Z)(props, Image_excluded);
|
|
var isCustomPlaceholder = placeholder && placeholder !== true;
|
|
var _ref = (0,esm_typeof/* default */.Z)(preview) === 'object' ? preview : {},
|
|
previewSrc = _ref.src,
|
|
_ref$visible = _ref.visible,
|
|
previewVisible = _ref$visible === void 0 ? undefined : _ref$visible,
|
|
_ref$onVisibleChange = _ref.onVisibleChange,
|
|
onPreviewVisibleChange = _ref$onVisibleChange === void 0 ? onInitialPreviewClose : _ref$onVisibleChange,
|
|
_ref$getContainer = _ref.getContainer,
|
|
getPreviewContainer = _ref$getContainer === void 0 ? undefined : _ref$getContainer,
|
|
previewMask = _ref.mask,
|
|
maskClassName = _ref.maskClassName,
|
|
movable = _ref.movable,
|
|
icons = _ref.icons,
|
|
scaleStep = _ref.scaleStep,
|
|
minScale = _ref.minScale,
|
|
maxScale = _ref.maxScale,
|
|
imageRender = _ref.imageRender,
|
|
toolbarRender = _ref.toolbarRender,
|
|
dialogProps = (0,objectWithoutProperties/* default */.Z)(_ref, Image_excluded2);
|
|
var src = previewSrc !== null && previewSrc !== void 0 ? previewSrc : imgSrc;
|
|
var _useMergedState = useMergedState(!!previewVisible, {
|
|
value: previewVisible,
|
|
onChange: onPreviewVisibleChange
|
|
}),
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
isShowPreview = _useMergedState2[0],
|
|
setShowPreview = _useMergedState2[1];
|
|
var _useStatus = useStatus({
|
|
src: imgSrc,
|
|
isCustomPlaceholder: isCustomPlaceholder,
|
|
fallback: fallback
|
|
}),
|
|
_useStatus2 = (0,slicedToArray/* default */.Z)(_useStatus, 3),
|
|
getImgRef = _useStatus2[0],
|
|
srcAndOnload = _useStatus2[1],
|
|
status = _useStatus2[2];
|
|
var _useState = (0,react.useState)(null),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
mousePosition = _useState2[0],
|
|
setMousePosition = _useState2[1];
|
|
var groupContext = (0,react.useContext)(PreviewGroupContext);
|
|
var canPreview = !!preview;
|
|
var onPreviewClose = function onPreviewClose() {
|
|
setShowPreview(false);
|
|
setMousePosition(null);
|
|
};
|
|
var wrapperClass = classnames_default()(prefixCls, wrapperClassName, rootClassName, (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-error"), status === 'error'));
|
|
|
|
// ========================= ImageProps =========================
|
|
var imgCommonProps = (0,react.useMemo)(function () {
|
|
var obj = {};
|
|
COMMON_PROPS.forEach(function (prop) {
|
|
if (props[prop] !== undefined) {
|
|
obj[prop] = props[prop];
|
|
}
|
|
});
|
|
return obj;
|
|
}, COMMON_PROPS.map(function (prop) {
|
|
return props[prop];
|
|
}));
|
|
|
|
// ========================== Register ==========================
|
|
var registerData = (0,react.useMemo)(function () {
|
|
return (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, imgCommonProps), {}, {
|
|
src: src
|
|
});
|
|
}, [src, imgCommonProps]);
|
|
var imageId = useRegisterImage(canPreview, registerData);
|
|
|
|
// ========================== Preview ===========================
|
|
var onPreview = function onPreview(e) {
|
|
var _getOffset = getOffset(e.target),
|
|
left = _getOffset.left,
|
|
top = _getOffset.top;
|
|
if (groupContext) {
|
|
groupContext.onPreview(imageId, left, top);
|
|
} else {
|
|
setMousePosition({
|
|
x: left,
|
|
y: top
|
|
});
|
|
setShowPreview(true);
|
|
}
|
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
};
|
|
|
|
// =========================== Render ===========================
|
|
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({}, otherProps, {
|
|
className: wrapperClass,
|
|
onClick: canPreview ? onPreview : onClick,
|
|
style: (0,objectSpread2/* default */.Z)({
|
|
width: width,
|
|
height: height
|
|
}, wrapperStyle)
|
|
}), /*#__PURE__*/react.createElement("img", (0,esm_extends/* default */.Z)({}, imgCommonProps, {
|
|
className: classnames_default()("".concat(prefixCls, "-img"), (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-img-placeholder"), placeholder === true), className),
|
|
style: (0,objectSpread2/* default */.Z)({
|
|
height: height
|
|
}, style),
|
|
ref: getImgRef
|
|
}, srcAndOnload, {
|
|
width: width,
|
|
height: height,
|
|
onError: onError
|
|
})), status === 'loading' && /*#__PURE__*/react.createElement("div", {
|
|
"aria-hidden": "true",
|
|
className: "".concat(prefixCls, "-placeholder")
|
|
}, placeholder), previewMask && canPreview && /*#__PURE__*/react.createElement("div", {
|
|
className: classnames_default()("".concat(prefixCls, "-mask"), maskClassName),
|
|
style: {
|
|
display: (style === null || style === void 0 ? void 0 : style.display) === 'none' ? 'none' : undefined
|
|
}
|
|
}, previewMask)), !groupContext && canPreview && /*#__PURE__*/react.createElement(es_Preview, (0,esm_extends/* default */.Z)({
|
|
"aria-hidden": !isShowPreview,
|
|
visible: isShowPreview,
|
|
prefixCls: previewPrefixCls,
|
|
onClose: onPreviewClose,
|
|
mousePosition: mousePosition,
|
|
src: src,
|
|
alt: alt,
|
|
fallback: fallback,
|
|
getContainer: getPreviewContainer,
|
|
icons: icons,
|
|
movable: movable,
|
|
scaleStep: scaleStep,
|
|
minScale: minScale,
|
|
maxScale: maxScale,
|
|
rootClassName: rootClassName,
|
|
imageRender: imageRender,
|
|
imgCommonProps: imgCommonProps,
|
|
toolbarRender: toolbarRender
|
|
}, dialogProps)));
|
|
};
|
|
ImageInternal.PreviewGroup = PreviewGroup;
|
|
ImageInternal.displayName = 'Image';
|
|
/* harmony default export */ var Image = (ImageInternal);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-image/es/index.js
|
|
|
|
|
|
/* harmony default export */ var rc_image_es = (Image);
|
|
// 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 context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/locale/en_US.js + 1 modules
|
|
var en_US = __webpack_require__(24457);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/CloseOutlined.js + 1 modules
|
|
var CloseOutlined = __webpack_require__(85846);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/LeftOutlined.js + 1 modules
|
|
var LeftOutlined = __webpack_require__(55007);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/RightOutlined.js + 1 modules
|
|
var RightOutlined = __webpack_require__(79269);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/RotateLeftOutlined.js
|
|
// This icon file is generated automatically.
|
|
var RotateLeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z" } }, { "tag": "path", "attrs": { "d": "M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z" } }] }, "name": "rotate-left", "theme": "outlined" };
|
|
/* harmony default export */ var asn_RotateLeftOutlined = (RotateLeftOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(44327);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/RotateLeftOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var RotateLeftOutlined_RotateLeftOutlined = function RotateLeftOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_RotateLeftOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_RotateLeftOutlined = (/*#__PURE__*/react.forwardRef(RotateLeftOutlined_RotateLeftOutlined));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/RotateRightOutlined.js
|
|
// This icon file is generated automatically.
|
|
var RotateRightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-.4-12.6 6.1l-.2 64c-118.6.5-235.8 53.4-314.6 154.2A399.75 399.75 0 00123.5 631h74.9c-.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8z" } }, { "tag": "path", "attrs": { "d": "M880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H396V494h440v326z" } }] }, "name": "rotate-right", "theme": "outlined" };
|
|
/* harmony default export */ var asn_RotateRightOutlined = (RotateRightOutlined);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/RotateRightOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var RotateRightOutlined_RotateRightOutlined = function RotateRightOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_RotateRightOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_RotateRightOutlined = (/*#__PURE__*/react.forwardRef(RotateRightOutlined_RotateRightOutlined));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/SwapOutlined.js
|
|
// This icon file is generated automatically.
|
|
var SwapOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "swap", "theme": "outlined" };
|
|
/* harmony default export */ var asn_SwapOutlined = (SwapOutlined);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/SwapOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var SwapOutlined_SwapOutlined = function SwapOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_SwapOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_SwapOutlined = (/*#__PURE__*/react.forwardRef(SwapOutlined_SwapOutlined));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/ZoomInOutlined.js
|
|
// This icon file is generated automatically.
|
|
var ZoomInOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z" } }] }, "name": "zoom-in", "theme": "outlined" };
|
|
/* harmony default export */ var asn_ZoomInOutlined = (ZoomInOutlined);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/ZoomInOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var ZoomInOutlined_ZoomInOutlined = function ZoomInOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_ZoomInOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_ZoomInOutlined = (/*#__PURE__*/react.forwardRef(ZoomInOutlined_ZoomInOutlined));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons-svg/es/asn/ZoomOutOutlined.js
|
|
// This icon file is generated automatically.
|
|
var ZoomOutOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z" } }] }, "name": "zoom-out", "theme": "outlined" };
|
|
/* harmony default export */ var asn_ZoomOutOutlined = (ZoomOutOutlined);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/ZoomOutOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var ZoomOutOutlined_ZoomOutOutlined = function ZoomOutOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_ZoomOutOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_ZoomOutOutlined = (/*#__PURE__*/react.forwardRef(ZoomOutOutlined_ZoomOutOutlined));
|
|
// EXTERNAL MODULE: ./node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
var dist_module = __webpack_require__(10274);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js
|
|
var style = __webpack_require__(71194);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
var es_style = __webpack_require__(14747);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/motion/zoom.js
|
|
var zoom = __webpack_require__(50438);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/motion/fade.js
|
|
var fade = __webpack_require__(16932);
|
|
// 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/image/style/index.js
|
|
|
|
|
|
|
|
|
|
|
|
const genBoxStyle = position => ({
|
|
position: position || 'absolute',
|
|
inset: 0
|
|
});
|
|
const genImageMaskStyle = token => {
|
|
const {
|
|
iconCls,
|
|
motionDurationSlow,
|
|
paddingXXS,
|
|
marginXXS,
|
|
prefixCls,
|
|
colorTextLightSolid
|
|
} = token;
|
|
return {
|
|
position: 'absolute',
|
|
inset: 0,
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
color: colorTextLightSolid,
|
|
background: new dist_module/* TinyColor */.C('#000').setAlpha(0.5).toRgbString(),
|
|
cursor: 'pointer',
|
|
opacity: 0,
|
|
transition: `opacity ${motionDurationSlow}`,
|
|
[`.${prefixCls}-mask-info`]: Object.assign(Object.assign({}, es_style/* textEllipsis */.vS), {
|
|
padding: `0 ${paddingXXS}px`,
|
|
[iconCls]: {
|
|
marginInlineEnd: marginXXS,
|
|
svg: {
|
|
verticalAlign: 'baseline'
|
|
}
|
|
}
|
|
})
|
|
};
|
|
};
|
|
const genPreviewOperationsStyle = token => {
|
|
const {
|
|
previewCls,
|
|
modalMaskBg,
|
|
paddingSM,
|
|
marginXL,
|
|
margin,
|
|
paddingLG,
|
|
previewOperationColorDisabled,
|
|
previewOperationHoverColor,
|
|
motionDurationSlow,
|
|
iconCls,
|
|
colorTextLightSolid
|
|
} = token;
|
|
const operationBg = new dist_module/* TinyColor */.C(modalMaskBg).setAlpha(0.1);
|
|
const operationBgHover = operationBg.clone().setAlpha(0.2);
|
|
return {
|
|
[`${previewCls}-footer`]: {
|
|
position: 'fixed',
|
|
bottom: marginXL,
|
|
left: {
|
|
_skip_check_: true,
|
|
value: 0
|
|
},
|
|
width: '100%',
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
alignItems: 'center',
|
|
color: token.previewOperationColor
|
|
},
|
|
[`${previewCls}-progress`]: {
|
|
marginBottom: margin
|
|
},
|
|
[`${previewCls}-close`]: {
|
|
position: 'fixed',
|
|
top: marginXL,
|
|
right: {
|
|
_skip_check_: true,
|
|
value: marginXL
|
|
},
|
|
display: 'flex',
|
|
color: colorTextLightSolid,
|
|
backgroundColor: operationBg.toRgbString(),
|
|
borderRadius: '50%',
|
|
padding: paddingSM,
|
|
outline: 0,
|
|
border: 0,
|
|
cursor: 'pointer',
|
|
transition: `all ${motionDurationSlow}`,
|
|
'&:hover': {
|
|
backgroundColor: operationBgHover.toRgbString()
|
|
},
|
|
[`& > ${iconCls}`]: {
|
|
fontSize: token.previewOperationSize
|
|
}
|
|
},
|
|
[`${previewCls}-operations`]: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
padding: `0 ${paddingLG}px`,
|
|
backgroundColor: operationBg.toRgbString(),
|
|
borderRadius: 100,
|
|
'&-operation': {
|
|
marginInlineStart: paddingSM,
|
|
padding: paddingSM,
|
|
cursor: 'pointer',
|
|
transition: `all ${motionDurationSlow}`,
|
|
userSelect: 'none',
|
|
[`&:not(${previewCls}-operations-operation-disabled):hover > ${iconCls}`]: {
|
|
color: previewOperationHoverColor
|
|
},
|
|
'&-disabled': {
|
|
color: previewOperationColorDisabled,
|
|
cursor: 'not-allowed'
|
|
},
|
|
'&:first-of-type': {
|
|
marginInlineStart: 0
|
|
},
|
|
[`& > ${iconCls}`]: {
|
|
fontSize: token.previewOperationSize
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genPreviewSwitchStyle = token => {
|
|
const {
|
|
modalMaskBg,
|
|
iconCls,
|
|
previewOperationColorDisabled,
|
|
previewCls,
|
|
zIndexPopup,
|
|
motionDurationSlow
|
|
} = token;
|
|
const operationBg = new dist_module/* TinyColor */.C(modalMaskBg).setAlpha(0.1);
|
|
const operationBgHover = operationBg.clone().setAlpha(0.2);
|
|
return {
|
|
[`${previewCls}-switch-left, ${previewCls}-switch-right`]: {
|
|
position: 'fixed',
|
|
insetBlockStart: '50%',
|
|
zIndex: zIndexPopup + 1,
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
width: token.imagePreviewSwitchSize,
|
|
height: token.imagePreviewSwitchSize,
|
|
marginTop: -token.imagePreviewSwitchSize / 2,
|
|
color: token.previewOperationColor,
|
|
background: operationBg.toRgbString(),
|
|
borderRadius: '50%',
|
|
transform: `translateY(-50%)`,
|
|
cursor: 'pointer',
|
|
transition: `all ${motionDurationSlow}`,
|
|
userSelect: 'none',
|
|
'&:hover': {
|
|
background: operationBgHover.toRgbString()
|
|
},
|
|
[`&-disabled`]: {
|
|
'&, &:hover': {
|
|
color: previewOperationColorDisabled,
|
|
background: 'transparent',
|
|
cursor: 'not-allowed',
|
|
[`> ${iconCls}`]: {
|
|
cursor: 'not-allowed'
|
|
}
|
|
}
|
|
},
|
|
[`> ${iconCls}`]: {
|
|
fontSize: token.previewOperationSize
|
|
}
|
|
},
|
|
[`${previewCls}-switch-left`]: {
|
|
insetInlineStart: token.marginSM
|
|
},
|
|
[`${previewCls}-switch-right`]: {
|
|
insetInlineEnd: token.marginSM
|
|
}
|
|
};
|
|
};
|
|
const genImagePreviewStyle = token => {
|
|
const {
|
|
motionEaseOut,
|
|
previewCls,
|
|
motionDurationSlow,
|
|
componentCls
|
|
} = token;
|
|
return [{
|
|
[`${componentCls}-preview-root`]: {
|
|
[previewCls]: {
|
|
height: '100%',
|
|
textAlign: 'center',
|
|
pointerEvents: 'none'
|
|
},
|
|
[`${previewCls}-body`]: Object.assign(Object.assign({}, genBoxStyle()), {
|
|
overflow: 'hidden'
|
|
}),
|
|
[`${previewCls}-img`]: {
|
|
maxWidth: '100%',
|
|
maxHeight: '70%',
|
|
verticalAlign: 'middle',
|
|
transform: 'scale3d(1, 1, 1)',
|
|
cursor: 'grab',
|
|
transition: `transform ${motionDurationSlow} ${motionEaseOut} 0s`,
|
|
userSelect: 'none',
|
|
'&-wrapper': Object.assign(Object.assign({}, genBoxStyle()), {
|
|
transition: `transform ${motionDurationSlow} ${motionEaseOut} 0s`,
|
|
// https://github.com/ant-design/ant-design/issues/39913
|
|
// TailwindCSS will reset img default style.
|
|
// Let's set back.
|
|
display: 'flex',
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
'& > *': {
|
|
pointerEvents: 'auto'
|
|
},
|
|
'&::before': {
|
|
display: 'inline-block',
|
|
width: 1,
|
|
height: '50%',
|
|
marginInlineEnd: -1,
|
|
content: '""'
|
|
}
|
|
})
|
|
},
|
|
[`${previewCls}-moving`]: {
|
|
[`${previewCls}-preview-img`]: {
|
|
cursor: 'grabbing',
|
|
'&-wrapper': {
|
|
transitionDuration: '0s'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
// Override
|
|
{
|
|
[`${componentCls}-preview-root`]: {
|
|
[`${previewCls}-wrap`]: {
|
|
zIndex: token.zIndexPopup
|
|
}
|
|
}
|
|
},
|
|
// Preview operations & switch
|
|
{
|
|
[`${componentCls}-preview-operations-wrapper`]: {
|
|
position: 'fixed',
|
|
zIndex: token.zIndexPopup + 1
|
|
},
|
|
'&': [genPreviewOperationsStyle(token), genPreviewSwitchStyle(token)]
|
|
}];
|
|
};
|
|
const genImageStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
// ============================== image ==============================
|
|
[componentCls]: {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
[`${componentCls}-img`]: {
|
|
width: '100%',
|
|
height: 'auto',
|
|
verticalAlign: 'middle'
|
|
},
|
|
[`${componentCls}-img-placeholder`]: {
|
|
backgroundColor: token.colorBgContainerDisabled,
|
|
backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",
|
|
backgroundRepeat: 'no-repeat',
|
|
backgroundPosition: 'center center',
|
|
backgroundSize: '30%'
|
|
},
|
|
[`${componentCls}-mask`]: Object.assign({}, genImageMaskStyle(token)),
|
|
[`${componentCls}-mask:hover`]: {
|
|
opacity: 1
|
|
},
|
|
[`${componentCls}-placeholder`]: Object.assign({}, genBoxStyle())
|
|
}
|
|
};
|
|
};
|
|
const genPreviewMotion = token => {
|
|
const {
|
|
previewCls
|
|
} = token;
|
|
return {
|
|
[`${previewCls}-root`]: (0,zoom/* initZoomMotion */._y)(token, 'zoom'),
|
|
[`&`]: (0,fade/* initFadeMotion */.J$)(token, true)
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var image_style = ((0,genComponentStyleHook/* default */.Z)('Image', token => {
|
|
const previewCls = `${token.componentCls}-preview`;
|
|
const imageToken = (0,statistic/* merge */.TS)(token, {
|
|
previewCls,
|
|
modalMaskBg: new dist_module/* TinyColor */.C('#000').setAlpha(0.45).toRgbString(),
|
|
imagePreviewSwitchSize: token.controlHeightLG
|
|
});
|
|
return [genImageStyle(imageToken), genImagePreviewStyle(imageToken), (0,style/* genModalMaskStyle */.QA)((0,statistic/* merge */.TS)(imageToken, {
|
|
componentCls: previewCls
|
|
})), genPreviewMotion(imageToken)];
|
|
}, token => ({
|
|
zIndexPopup: token.zIndexPopupBase + 80,
|
|
previewOperationColor: new dist_module/* TinyColor */.C(token.colorTextLightSolid).setAlpha(0.65).toRgbString(),
|
|
previewOperationHoverColor: new dist_module/* TinyColor */.C(token.colorTextLightSolid).setAlpha(0.85).toRgbString(),
|
|
previewOperationColorDisabled: new dist_module/* TinyColor */.C(token.colorTextLightSolid).setAlpha(0.25).toRgbString(),
|
|
previewOperationSize: token.fontSizeIcon * 1.5 // FIXME: fontSizeIconLG
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/image/PreviewGroup.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 icons = {
|
|
rotateLeft: /*#__PURE__*/react.createElement(icons_RotateLeftOutlined, null),
|
|
rotateRight: /*#__PURE__*/react.createElement(icons_RotateRightOutlined, null),
|
|
zoomIn: /*#__PURE__*/react.createElement(icons_ZoomInOutlined, null),
|
|
zoomOut: /*#__PURE__*/react.createElement(icons_ZoomOutOutlined, null),
|
|
close: /*#__PURE__*/react.createElement(CloseOutlined/* default */.Z, null),
|
|
left: /*#__PURE__*/react.createElement(LeftOutlined/* default */.Z, null),
|
|
right: /*#__PURE__*/react.createElement(RightOutlined/* default */.Z, null),
|
|
flipX: /*#__PURE__*/react.createElement(icons_SwapOutlined, null),
|
|
flipY: /*#__PURE__*/react.createElement(icons_SwapOutlined, {
|
|
rotate: 90
|
|
})
|
|
};
|
|
const InternalPreviewGroup = _a => {
|
|
var {
|
|
previewPrefixCls: customizePrefixCls,
|
|
preview
|
|
} = _a,
|
|
props = __rest(_a, ["previewPrefixCls", "preview"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('image', customizePrefixCls);
|
|
const previewPrefixCls = `${prefixCls}-preview`;
|
|
const rootPrefixCls = getPrefixCls();
|
|
const [wrapSSR, hashId] = image_style(prefixCls);
|
|
const mergedPreview = react.useMemo(() => {
|
|
var _a;
|
|
if (preview === false) {
|
|
return preview;
|
|
}
|
|
const _preview = typeof preview === 'object' ? preview : {};
|
|
const mergedRootClassName = classnames_default()(hashId, (_a = _preview.rootClassName) !== null && _a !== void 0 ? _a : '');
|
|
return Object.assign(Object.assign({}, _preview), {
|
|
transitionName: (0,motion/* getTransitionName */.m)(rootPrefixCls, 'zoom', _preview.transitionName),
|
|
maskTransitionName: (0,motion/* getTransitionName */.m)(rootPrefixCls, 'fade', _preview.maskTransitionName),
|
|
rootClassName: mergedRootClassName
|
|
});
|
|
}, [preview]);
|
|
return wrapSSR( /*#__PURE__*/react.createElement(rc_image_es.PreviewGroup, Object.assign({
|
|
preview: mergedPreview,
|
|
previewPrefixCls: previewPrefixCls,
|
|
icons: icons
|
|
}, props)));
|
|
};
|
|
/* harmony default export */ var image_PreviewGroup = (InternalPreviewGroup);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/image/index.js
|
|
"use client";
|
|
|
|
var image_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 image_Image = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
preview,
|
|
className,
|
|
rootClassName,
|
|
style
|
|
} = props,
|
|
otherProps = image_rest(props, ["prefixCls", "preview", "className", "rootClassName", "style"]);
|
|
const {
|
|
getPrefixCls,
|
|
locale: contextLocale = en_US/* default */.Z,
|
|
getPopupContainer: getContextPopupContainer,
|
|
image
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('image', customizePrefixCls);
|
|
const rootPrefixCls = getPrefixCls();
|
|
const imageLocale = contextLocale.Image || en_US/* default.Image */.Z.Image;
|
|
// Style
|
|
const [wrapSSR, hashId] = image_style(prefixCls);
|
|
const mergedRootClassName = classnames_default()(rootClassName, hashId);
|
|
const mergedClassName = classnames_default()(className, hashId, image === null || image === void 0 ? void 0 : image.className);
|
|
const mergedPreview = react.useMemo(() => {
|
|
if (preview === false) {
|
|
return preview;
|
|
}
|
|
const _preview = typeof preview === 'object' ? preview : {};
|
|
const {
|
|
getContainer
|
|
} = _preview,
|
|
restPreviewProps = image_rest(_preview, ["getContainer"]);
|
|
return Object.assign(Object.assign({
|
|
mask: /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-mask-info`
|
|
}, /*#__PURE__*/react.createElement(EyeOutlined/* default */.Z, null), imageLocale === null || imageLocale === void 0 ? void 0 : imageLocale.preview),
|
|
icons: icons
|
|
}, restPreviewProps), {
|
|
getContainer: getContainer || getContextPopupContainer,
|
|
transitionName: (0,motion/* getTransitionName */.m)(rootPrefixCls, 'zoom', _preview.transitionName),
|
|
maskTransitionName: (0,motion/* getTransitionName */.m)(rootPrefixCls, 'fade', _preview.maskTransitionName)
|
|
});
|
|
}, [preview, imageLocale]);
|
|
const mergedStyle = Object.assign(Object.assign({}, image === null || image === void 0 ? void 0 : image.style), style);
|
|
return wrapSSR( /*#__PURE__*/react.createElement(rc_image_es, Object.assign({
|
|
prefixCls: prefixCls,
|
|
preview: mergedPreview,
|
|
rootClassName: mergedRootClassName,
|
|
className: mergedClassName,
|
|
style: mergedStyle
|
|
}, otherProps)));
|
|
};
|
|
image_Image.PreviewGroup = image_PreviewGroup;
|
|
if (false) {}
|
|
/* harmony default export */ var es_image = (image_Image);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 47897:
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/antd/es/switch/index.js + 27 modules ***!
|
|
\***********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ es_switch; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/LoadingOutlined.js + 1 modules
|
|
var LoadingOutlined = __webpack_require__(77322);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
function _extends() {
|
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
for (var i = 1; i < arguments.length; i++) {
|
|
var source = arguments[i];
|
|
for (var key in source) {
|
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
}
|
|
return target;
|
|
};
|
|
return _extends.apply(this, arguments);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
|
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
return typeof obj;
|
|
} : function (obj) {
|
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
}, _typeof(obj);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
|
|
function _toPrimitive(input, hint) {
|
|
if (_typeof(input) !== "object" || input === null) return input;
|
|
var prim = input[Symbol.toPrimitive];
|
|
if (prim !== undefined) {
|
|
var res = prim.call(input, hint || "default");
|
|
if (_typeof(res) !== "object") return res;
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
}
|
|
return (hint === "string" ? String : Number)(input);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
|
|
|
|
function _toPropertyKey(arg) {
|
|
var key = _toPrimitive(arg, "string");
|
|
return _typeof(key) === "symbol" ? key : String(key);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
|
|
function _defineProperty(obj, key, value) {
|
|
key = _toPropertyKey(key);
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, {
|
|
value: value,
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true
|
|
});
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
|
function _arrayWithHoles(arr) {
|
|
if (Array.isArray(arr)) return arr;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
|
function _iterableToArrayLimit(arr, i) {
|
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
if (null != _i) {
|
|
var _s,
|
|
_e,
|
|
_x,
|
|
_r,
|
|
_arr = [],
|
|
_n = !0,
|
|
_d = !1;
|
|
try {
|
|
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
if (Object(_i) !== _i) return;
|
|
_n = !1;
|
|
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
} catch (err) {
|
|
_d = !0, _e = err;
|
|
} finally {
|
|
try {
|
|
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
} finally {
|
|
if (_d) throw _e;
|
|
}
|
|
}
|
|
return _arr;
|
|
}
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
function _arrayLikeToArray(arr, len) {
|
|
if (len == null || len > arr.length) len = arr.length;
|
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
return arr2;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
|
|
|
function _unsupportedIterableToArray(o, minLen) {
|
|
if (!o) return;
|
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
|
function _nonIterableRest() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
|
|
|
|
|
|
|
|
|
function _slicedToArray(arr, i) {
|
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
if (source == null) return {};
|
|
var target = {};
|
|
var sourceKeys = Object.keys(source);
|
|
var key, i;
|
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
key = sourceKeys[i];
|
|
if (excluded.indexOf(key) >= 0) continue;
|
|
target[key] = source[key];
|
|
}
|
|
return target;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
|
|
function _objectWithoutProperties(source, excluded) {
|
|
if (source == null) return {};
|
|
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
var key, i;
|
|
if (Object.getOwnPropertySymbols) {
|
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
key = sourceSymbolKeys[i];
|
|
if (excluded.indexOf(key) >= 0) continue;
|
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
|
function arrayWithHoles_arrayWithHoles(arr) {
|
|
if (Array.isArray(arr)) return arr;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
|
function iterableToArrayLimit_iterableToArrayLimit(arr, i) {
|
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
if (null != _i) {
|
|
var _s,
|
|
_e,
|
|
_x,
|
|
_r,
|
|
_arr = [],
|
|
_n = !0,
|
|
_d = !1;
|
|
try {
|
|
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
if (Object(_i) !== _i) return;
|
|
_n = !1;
|
|
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
} catch (err) {
|
|
_d = !0, _e = err;
|
|
} finally {
|
|
try {
|
|
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
} finally {
|
|
if (_d) throw _e;
|
|
}
|
|
}
|
|
return _arr;
|
|
}
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
function arrayLikeToArray_arrayLikeToArray(arr, len) {
|
|
if (len == null || len > arr.length) len = arr.length;
|
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
return arr2;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
|
|
|
function unsupportedIterableToArray_unsupportedIterableToArray(o, minLen) {
|
|
if (!o) return;
|
|
if (typeof o === "string") return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray_arrayLikeToArray(o, minLen);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
|
function nonIterableRest_nonIterableRest() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
|
|
|
|
|
|
|
|
|
function slicedToArray_slicedToArray(arr, i) {
|
|
return arrayWithHoles_arrayWithHoles(arr) || iterableToArrayLimit_iterableToArrayLimit(arr, i) || unsupportedIterableToArray_unsupportedIterableToArray(arr, i) || nonIterableRest_nonIterableRest();
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/es/hooks/useEvent.js
|
|
|
|
function 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-switch/node_modules/rc-util/es/Dom/canUseDom.js
|
|
function canUseDom() {
|
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
|
|
|
|
|
/**
|
|
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
*/
|
|
var useInternalLayoutEffect = true && canUseDom() ? react.useLayoutEffect : react.useEffect;
|
|
var 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 useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
|
|
useLayoutEffect(function (firstMount) {
|
|
if (!firstMount) {
|
|
return callback();
|
|
}
|
|
}, deps);
|
|
};
|
|
/* harmony default export */ var hooks_useLayoutEffect = ((/* unused pure expression or super */ null && (useLayoutEffect)));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/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_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-switch/node_modules/rc-util/es/hooks/useMergedState.js
|
|
|
|
|
|
|
|
|
|
/** We only think `undefined` is empty */
|
|
function hasValue(value) {
|
|
return value !== undefined;
|
|
}
|
|
|
|
/**
|
|
* Similar to `useState` but will use props value if provided.
|
|
* Note that internal use rc-util `useState` hook.
|
|
*/
|
|
function useMergedState(defaultStateValue, option) {
|
|
var _ref = option || {},
|
|
defaultValue = _ref.defaultValue,
|
|
value = _ref.value,
|
|
onChange = _ref.onChange,
|
|
postState = _ref.postState;
|
|
|
|
// ======================= Init =======================
|
|
var _useState = useSafeState(function () {
|
|
if (hasValue(value)) {
|
|
return value;
|
|
} else if (hasValue(defaultValue)) {
|
|
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
|
|
} else {
|
|
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
|
|
}
|
|
}),
|
|
_useState2 = slicedToArray_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 = useSafeState([mergedValue]),
|
|
_useState4 = slicedToArray_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];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-switch/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-switch/es/index.js
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"];
|
|
|
|
|
|
|
|
|
|
var Switch = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
var _classNames;
|
|
var _ref$prefixCls = _ref.prefixCls,
|
|
prefixCls = _ref$prefixCls === void 0 ? 'rc-switch' : _ref$prefixCls,
|
|
className = _ref.className,
|
|
checked = _ref.checked,
|
|
defaultChecked = _ref.defaultChecked,
|
|
disabled = _ref.disabled,
|
|
loadingIcon = _ref.loadingIcon,
|
|
checkedChildren = _ref.checkedChildren,
|
|
unCheckedChildren = _ref.unCheckedChildren,
|
|
onClick = _ref.onClick,
|
|
onChange = _ref.onChange,
|
|
onKeyDown = _ref.onKeyDown,
|
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
var _useMergedState = useMergedState(false, {
|
|
value: checked,
|
|
defaultValue: defaultChecked
|
|
}),
|
|
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
innerChecked = _useMergedState2[0],
|
|
setInnerChecked = _useMergedState2[1];
|
|
function triggerChange(newChecked, event) {
|
|
var mergedChecked = innerChecked;
|
|
if (!disabled) {
|
|
mergedChecked = newChecked;
|
|
setInnerChecked(mergedChecked);
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(mergedChecked, event);
|
|
}
|
|
return mergedChecked;
|
|
}
|
|
function onInternalKeyDown(e) {
|
|
if (e.which === es_KeyCode.LEFT) {
|
|
triggerChange(false, e);
|
|
} else if (e.which === es_KeyCode.RIGHT) {
|
|
triggerChange(true, e);
|
|
}
|
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
}
|
|
function onInternalClick(e) {
|
|
var ret = triggerChange(!innerChecked, e);
|
|
// [Legacy] trigger onClick with value
|
|
onClick === null || onClick === void 0 ? void 0 : onClick(ret, e);
|
|
}
|
|
var switchClassName = classnames_default()(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-checked"), innerChecked), _defineProperty(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
|
|
return /*#__PURE__*/react.createElement("button", _extends({}, restProps, {
|
|
type: "button",
|
|
role: "switch",
|
|
"aria-checked": innerChecked,
|
|
disabled: disabled,
|
|
className: switchClassName,
|
|
ref: ref,
|
|
onKeyDown: onInternalKeyDown,
|
|
onClick: onInternalClick
|
|
}), loadingIcon, /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner")
|
|
}, /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner-checked")
|
|
}, checkedChildren), /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner-unchecked")
|
|
}, unCheckedChildren)));
|
|
});
|
|
Switch.displayName = 'Switch';
|
|
/* harmony default export */ var es = (Switch);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/wave/index.js + 4 modules
|
|
var wave = __webpack_require__(45353);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/DisabledContext.js
|
|
var DisabledContext = __webpack_require__(98866);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(98675);
|
|
// EXTERNAL MODULE: ./node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
var dist_module = __webpack_require__(10274);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/index.js
|
|
var style = __webpack_require__(14747);
|
|
// 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/switch/style/index.js
|
|
|
|
|
|
|
|
const genSwitchSmallStyle = token => {
|
|
const {
|
|
componentCls,
|
|
trackHeightSM,
|
|
trackPadding,
|
|
trackMinWidthSM,
|
|
innerMinMarginSM,
|
|
innerMaxMarginSM,
|
|
handleSizeSM
|
|
} = token;
|
|
const switchInnerCls = `${componentCls}-inner`;
|
|
return {
|
|
[componentCls]: {
|
|
[`&${componentCls}-small`]: {
|
|
minWidth: trackMinWidthSM,
|
|
height: trackHeightSM,
|
|
lineHeight: `${trackHeightSM}px`,
|
|
[`${componentCls}-inner`]: {
|
|
paddingInlineStart: innerMaxMarginSM,
|
|
paddingInlineEnd: innerMinMarginSM,
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: `calc(-100% + ${handleSizeSM + trackPadding * 2}px - ${innerMaxMarginSM * 2}px)`,
|
|
marginInlineEnd: `calc(100% - ${handleSizeSM + trackPadding * 2}px + ${innerMaxMarginSM * 2}px)`
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginTop: -trackHeightSM,
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
}
|
|
},
|
|
[`${componentCls}-handle`]: {
|
|
width: handleSizeSM,
|
|
height: handleSizeSM
|
|
},
|
|
[`${componentCls}-loading-icon`]: {
|
|
top: (handleSizeSM - token.switchLoadingIconSize) / 2,
|
|
fontSize: token.switchLoadingIconSize
|
|
},
|
|
[`&${componentCls}-checked`]: {
|
|
[`${componentCls}-inner`]: {
|
|
paddingInlineStart: innerMinMarginSM,
|
|
paddingInlineEnd: innerMaxMarginSM,
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: `calc(100% - ${handleSizeSM + trackPadding * 2}px + ${innerMaxMarginSM * 2}px)`,
|
|
marginInlineEnd: `calc(-100% + ${handleSizeSM + trackPadding * 2}px - ${innerMaxMarginSM * 2}px)`
|
|
}
|
|
},
|
|
[`${componentCls}-handle`]: {
|
|
insetInlineStart: `calc(100% - ${handleSizeSM + trackPadding}px)`
|
|
}
|
|
},
|
|
[`&:not(${componentCls}-disabled):active`]: {
|
|
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: token.marginXXS / 2,
|
|
marginInlineEnd: -token.marginXXS / 2
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: -token.marginXXS / 2,
|
|
marginInlineEnd: token.marginXXS / 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchLoadingStyle = token => {
|
|
const {
|
|
componentCls,
|
|
handleSize
|
|
} = token;
|
|
return {
|
|
[componentCls]: {
|
|
[`${componentCls}-loading-icon${token.iconCls}`]: {
|
|
position: 'relative',
|
|
top: (handleSize - token.fontSize) / 2,
|
|
color: token.switchLoadingIconColor,
|
|
verticalAlign: 'top'
|
|
},
|
|
[`&${componentCls}-checked ${componentCls}-loading-icon`]: {
|
|
color: token.switchColor
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchHandleStyle = token => {
|
|
const {
|
|
componentCls,
|
|
motion,
|
|
trackPadding,
|
|
handleBg,
|
|
handleShadow,
|
|
handleSize
|
|
} = token;
|
|
const switchHandleCls = `${componentCls}-handle`;
|
|
return {
|
|
[componentCls]: {
|
|
[switchHandleCls]: {
|
|
position: 'absolute',
|
|
top: trackPadding,
|
|
insetInlineStart: trackPadding,
|
|
width: handleSize,
|
|
height: handleSize,
|
|
transition: `all ${token.switchDuration} ease-in-out`,
|
|
'&::before': {
|
|
position: 'absolute',
|
|
top: 0,
|
|
insetInlineEnd: 0,
|
|
bottom: 0,
|
|
insetInlineStart: 0,
|
|
backgroundColor: handleBg,
|
|
borderRadius: handleSize / 2,
|
|
boxShadow: handleShadow,
|
|
transition: `all ${token.switchDuration} ease-in-out`,
|
|
content: '""'
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchHandleCls}`]: {
|
|
insetInlineStart: `calc(100% - ${handleSize + trackPadding}px)`
|
|
},
|
|
[`&:not(${componentCls}-disabled):active`]: motion ? {
|
|
[`${switchHandleCls}::before`]: {
|
|
insetInlineEnd: token.switchHandleActiveInset,
|
|
insetInlineStart: 0
|
|
},
|
|
[`&${componentCls}-checked ${switchHandleCls}::before`]: {
|
|
insetInlineEnd: 0,
|
|
insetInlineStart: token.switchHandleActiveInset
|
|
}
|
|
} : /* istanbul ignore next */
|
|
{}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchInnerStyle = token => {
|
|
const {
|
|
componentCls,
|
|
trackHeight,
|
|
trackPadding,
|
|
innerMinMargin,
|
|
innerMaxMargin,
|
|
handleSize
|
|
} = token;
|
|
const switchInnerCls = `${componentCls}-inner`;
|
|
return {
|
|
[componentCls]: {
|
|
[switchInnerCls]: {
|
|
display: 'block',
|
|
overflow: 'hidden',
|
|
borderRadius: 100,
|
|
height: '100%',
|
|
paddingInlineStart: innerMaxMargin,
|
|
paddingInlineEnd: innerMinMargin,
|
|
transition: `padding-inline-start ${token.switchDuration} ease-in-out, padding-inline-end ${token.switchDuration} ease-in-out`,
|
|
[`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: {
|
|
display: 'block',
|
|
color: token.colorTextLightSolid,
|
|
fontSize: token.fontSizeSM,
|
|
transition: `margin-inline-start ${token.switchDuration} ease-in-out, margin-inline-end ${token.switchDuration} ease-in-out`,
|
|
pointerEvents: 'none'
|
|
},
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: `calc(-100% + ${handleSize + trackPadding * 2}px - ${innerMaxMargin * 2}px)`,
|
|
marginInlineEnd: `calc(100% - ${handleSize + trackPadding * 2}px + ${innerMaxMargin * 2}px)`
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginTop: -trackHeight,
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
|
paddingInlineStart: innerMinMargin,
|
|
paddingInlineEnd: innerMaxMargin,
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: 0
|
|
},
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: `calc(100% - ${handleSize + trackPadding * 2}px + ${innerMaxMargin * 2}px)`,
|
|
marginInlineEnd: `calc(-100% + ${handleSize + trackPadding * 2}px - ${innerMaxMargin * 2}px)`
|
|
}
|
|
},
|
|
[`&:not(${componentCls}-disabled):active`]: {
|
|
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-unchecked`]: {
|
|
marginInlineStart: trackPadding * 2,
|
|
marginInlineEnd: -trackPadding * 2
|
|
}
|
|
},
|
|
[`&${componentCls}-checked ${switchInnerCls}`]: {
|
|
[`${switchInnerCls}-checked`]: {
|
|
marginInlineStart: -trackPadding * 2,
|
|
marginInlineEnd: trackPadding * 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genSwitchStyle = token => {
|
|
const {
|
|
componentCls,
|
|
trackHeight,
|
|
trackMinWidth
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
boxSizing: 'border-box',
|
|
minWidth: trackMinWidth,
|
|
height: trackHeight,
|
|
lineHeight: `${trackHeight}px`,
|
|
verticalAlign: 'middle',
|
|
background: token.colorTextQuaternary,
|
|
border: '0',
|
|
borderRadius: 100,
|
|
cursor: 'pointer',
|
|
transition: `all ${token.motionDurationMid}`,
|
|
userSelect: 'none',
|
|
[`&:hover:not(${componentCls}-disabled)`]: {
|
|
background: token.colorTextTertiary
|
|
}
|
|
}), (0,style/* genFocusStyle */.Qy)(token)), {
|
|
[`&${componentCls}-checked`]: {
|
|
background: token.switchColor,
|
|
[`&:hover:not(${componentCls}-disabled)`]: {
|
|
background: token.colorPrimaryHover
|
|
}
|
|
},
|
|
[`&${componentCls}-loading, &${componentCls}-disabled`]: {
|
|
cursor: 'not-allowed',
|
|
opacity: token.switchDisabledOpacity,
|
|
'*': {
|
|
boxShadow: 'none',
|
|
cursor: 'not-allowed'
|
|
}
|
|
},
|
|
// rtl style
|
|
[`&${componentCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var switch_style = ((0,genComponentStyleHook/* default */.Z)('Switch', token => {
|
|
const switchToken = (0,statistic/* merge */.TS)(token, {
|
|
switchDuration: token.motionDurationMid,
|
|
switchColor: token.colorPrimary,
|
|
switchDisabledOpacity: token.opacityLoading,
|
|
switchLoadingIconSize: token.fontSizeIcon * 0.75,
|
|
switchLoadingIconColor: `rgba(0, 0, 0, ${token.opacityLoading})`,
|
|
switchHandleActiveInset: '-30%'
|
|
});
|
|
return [genSwitchStyle(switchToken),
|
|
// inner style
|
|
genSwitchInnerStyle(switchToken),
|
|
// handle style
|
|
genSwitchHandleStyle(switchToken),
|
|
// loading style
|
|
genSwitchLoadingStyle(switchToken),
|
|
// small style
|
|
genSwitchSmallStyle(switchToken)];
|
|
}, token => {
|
|
const {
|
|
fontSize,
|
|
lineHeight,
|
|
controlHeight,
|
|
colorWhite
|
|
} = token;
|
|
const height = fontSize * lineHeight;
|
|
const heightSM = controlHeight / 2;
|
|
const padding = 2; // Fixed value
|
|
const handleSize = height - padding * 2;
|
|
const handleSizeSM = heightSM - padding * 2;
|
|
return {
|
|
trackHeight: height,
|
|
trackHeightSM: heightSM,
|
|
trackMinWidth: handleSize * 2 + padding * 4,
|
|
trackMinWidthSM: handleSizeSM * 2 + padding * 2,
|
|
trackPadding: padding,
|
|
handleBg: colorWhite,
|
|
handleSize,
|
|
handleSizeSM,
|
|
handleShadow: `0 2px 4px 0 ${new dist_module/* TinyColor */.C('#00230b').setAlpha(0.2).toRgbString()}`,
|
|
innerMinMargin: handleSize / 2,
|
|
innerMaxMargin: handleSize + padding + padding * 2,
|
|
innerMinMarginSM: handleSizeSM / 2,
|
|
innerMaxMarginSM: handleSizeSM + padding + padding * 2
|
|
};
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/switch/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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const switch_Switch = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
size: customizeSize,
|
|
disabled: customDisabled,
|
|
loading,
|
|
className,
|
|
rootClassName,
|
|
style
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style"]);
|
|
false ? 0 : void 0;
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
switch: SWITCH
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
// ===================== Disabled =====================
|
|
const disabled = react.useContext(DisabledContext/* default */.Z);
|
|
const mergedDisabled = (customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled) || loading;
|
|
const prefixCls = getPrefixCls('switch', customizePrefixCls);
|
|
const loadingIcon = /*#__PURE__*/react.createElement("div", {
|
|
className: `${prefixCls}-handle`
|
|
}, loading && /*#__PURE__*/react.createElement(LoadingOutlined/* default */.Z, {
|
|
className: `${prefixCls}-loading-icon`
|
|
}));
|
|
// Style
|
|
const [wrapSSR, hashId] = switch_style(prefixCls);
|
|
const mergedSize = (0,useSize/* default */.Z)(customizeSize);
|
|
const classes = classnames_default()(SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.className, {
|
|
[`${prefixCls}-small`]: mergedSize === 'small',
|
|
[`${prefixCls}-loading`]: loading,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const mergedStyle = Object.assign(Object.assign({}, SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.style), style);
|
|
return wrapSSR( /*#__PURE__*/react.createElement(wave/* default */.Z, {
|
|
component: "Switch"
|
|
}, /*#__PURE__*/react.createElement(es, Object.assign({}, restProps, {
|
|
prefixCls: prefixCls,
|
|
className: classes,
|
|
style: mergedStyle,
|
|
disabled: mergedDisabled,
|
|
ref: ref,
|
|
loadingIcon: loadingIcon
|
|
}))));
|
|
});
|
|
switch_Switch.__ANT_SWITCH = true;
|
|
if (false) {}
|
|
/* harmony default export */ var es_switch = (switch_Switch);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 19575:
|
|
/*!******************************************!*\
|
|
!*** ./node_modules/js-base64/base64.js ***!
|
|
\******************************************/
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
|
|
* base64.js
|
|
*
|
|
* Licensed under the BSD 3-Clause License.
|
|
* http://opensource.org/licenses/BSD-3-Clause
|
|
*
|
|
* References:
|
|
* http://en.wikipedia.org/wiki/Base64
|
|
*/
|
|
;(function (global, factory) {
|
|
true
|
|
? module.exports = factory(global)
|
|
: 0
|
|
}((
|
|
typeof self !== 'undefined' ? self
|
|
: typeof window !== 'undefined' ? window
|
|
: typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g
|
|
: this
|
|
), function(global) {
|
|
'use strict';
|
|
// existing version for noConflict()
|
|
global = global || {};
|
|
var _Base64 = global.Base64;
|
|
var version = "2.6.4";
|
|
// constants
|
|
var b64chars
|
|
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
var b64tab = function(bin) {
|
|
var t = {};
|
|
for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i;
|
|
return t;
|
|
}(b64chars);
|
|
var fromCharCode = String.fromCharCode;
|
|
// encoder stuff
|
|
var cb_utob = function(c) {
|
|
if (c.length < 2) {
|
|
var cc = c.charCodeAt(0);
|
|
return cc < 0x80 ? c
|
|
: cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6))
|
|
+ fromCharCode(0x80 | (cc & 0x3f)))
|
|
: (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f))
|
|
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
|
|
+ fromCharCode(0x80 | ( cc & 0x3f)));
|
|
} else {
|
|
var cc = 0x10000
|
|
+ (c.charCodeAt(0) - 0xD800) * 0x400
|
|
+ (c.charCodeAt(1) - 0xDC00);
|
|
return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07))
|
|
+ fromCharCode(0x80 | ((cc >>> 12) & 0x3f))
|
|
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
|
|
+ fromCharCode(0x80 | ( cc & 0x3f)));
|
|
}
|
|
};
|
|
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
var utob = function(u) {
|
|
return u.replace(re_utob, cb_utob);
|
|
};
|
|
var cb_encode = function(ccc) {
|
|
var padlen = [0, 2, 1][ccc.length % 3],
|
|
ord = ccc.charCodeAt(0) << 16
|
|
| ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
|
|
| ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
|
|
chars = [
|
|
b64chars.charAt( ord >>> 18),
|
|
b64chars.charAt((ord >>> 12) & 63),
|
|
padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
|
|
padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
|
|
];
|
|
return chars.join('');
|
|
};
|
|
var btoa = global.btoa && typeof global.btoa == 'function'
|
|
? function(b){ return global.btoa(b) } : function(b) {
|
|
if (b.match(/[^\x00-\xFF]/)) throw new RangeError(
|
|
'The string contains invalid characters.'
|
|
);
|
|
return b.replace(/[\s\S]{1,3}/g, cb_encode);
|
|
};
|
|
var _encode = function(u) {
|
|
return btoa(utob(String(u)));
|
|
};
|
|
var mkUriSafe = function (b64) {
|
|
return b64.replace(/[+\/]/g, function(m0) {
|
|
return m0 == '+' ? '-' : '_';
|
|
}).replace(/=/g, '');
|
|
};
|
|
var encode = function(u, urisafe) {
|
|
return urisafe ? mkUriSafe(_encode(u)) : _encode(u);
|
|
};
|
|
var encodeURI = function(u) { return encode(u, true) };
|
|
var fromUint8Array;
|
|
if (global.Uint8Array) fromUint8Array = function(a, urisafe) {
|
|
// return btoa(fromCharCode.apply(null, a));
|
|
var b64 = '';
|
|
for (var i = 0, l = a.length; i < l; i += 3) {
|
|
var a0 = a[i], a1 = a[i+1], a2 = a[i+2];
|
|
var ord = a0 << 16 | a1 << 8 | a2;
|
|
b64 += b64chars.charAt( ord >>> 18)
|
|
+ b64chars.charAt((ord >>> 12) & 63)
|
|
+ ( typeof a1 != 'undefined'
|
|
? b64chars.charAt((ord >>> 6) & 63) : '=')
|
|
+ ( typeof a2 != 'undefined'
|
|
? b64chars.charAt( ord & 63) : '=');
|
|
}
|
|
return urisafe ? mkUriSafe(b64) : b64;
|
|
};
|
|
// decoder stuff
|
|
var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
var cb_btou = function(cccc) {
|
|
switch(cccc.length) {
|
|
case 4:
|
|
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
|
|
| ((0x3f & cccc.charCodeAt(1)) << 12)
|
|
| ((0x3f & cccc.charCodeAt(2)) << 6)
|
|
| (0x3f & cccc.charCodeAt(3)),
|
|
offset = cp - 0x10000;
|
|
return (fromCharCode((offset >>> 10) + 0xD800)
|
|
+ fromCharCode((offset & 0x3FF) + 0xDC00));
|
|
case 3:
|
|
return fromCharCode(
|
|
((0x0f & cccc.charCodeAt(0)) << 12)
|
|
| ((0x3f & cccc.charCodeAt(1)) << 6)
|
|
| (0x3f & cccc.charCodeAt(2))
|
|
);
|
|
default:
|
|
return fromCharCode(
|
|
((0x1f & cccc.charCodeAt(0)) << 6)
|
|
| (0x3f & cccc.charCodeAt(1))
|
|
);
|
|
}
|
|
};
|
|
var btou = function(b) {
|
|
return b.replace(re_btou, cb_btou);
|
|
};
|
|
var cb_decode = function(cccc) {
|
|
var len = cccc.length,
|
|
padlen = len % 4,
|
|
n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0)
|
|
| (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0)
|
|
| (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0)
|
|
| (len > 3 ? b64tab[cccc.charAt(3)] : 0),
|
|
chars = [
|
|
fromCharCode( n >>> 16),
|
|
fromCharCode((n >>> 8) & 0xff),
|
|
fromCharCode( n & 0xff)
|
|
];
|
|
chars.length -= [0, 0, 2, 1][padlen];
|
|
return chars.join('');
|
|
};
|
|
var _atob = global.atob && typeof global.atob == 'function'
|
|
? function(a){ return global.atob(a) } : function(a){
|
|
return a.replace(/\S{1,4}/g, cb_decode);
|
|
};
|
|
var atob = function(a) {
|
|
return _atob(String(a).replace(/[^A-Za-z0-9\+\/]/g, ''));
|
|
};
|
|
var _decode = function(a) { return btou(_atob(a)) };
|
|
var _fromURI = function(a) {
|
|
return String(a).replace(/[-_]/g, function(m0) {
|
|
return m0 == '-' ? '+' : '/'
|
|
}).replace(/[^A-Za-z0-9\+\/]/g, '');
|
|
};
|
|
var decode = function(a){
|
|
return _decode(_fromURI(a));
|
|
};
|
|
var toUint8Array;
|
|
if (global.Uint8Array) toUint8Array = function(a) {
|
|
return Uint8Array.from(atob(_fromURI(a)), function(c) {
|
|
return c.charCodeAt(0);
|
|
});
|
|
};
|
|
var noConflict = function() {
|
|
var Base64 = global.Base64;
|
|
global.Base64 = _Base64;
|
|
return Base64;
|
|
};
|
|
// export Base64
|
|
global.Base64 = {
|
|
VERSION: version,
|
|
atob: atob,
|
|
btoa: btoa,
|
|
fromBase64: decode,
|
|
toBase64: encode,
|
|
utob: utob,
|
|
encode: encode,
|
|
encodeURI: encodeURI,
|
|
btou: btou,
|
|
decode: decode,
|
|
noConflict: noConflict,
|
|
fromUint8Array: fromUint8Array,
|
|
toUint8Array: toUint8Array
|
|
};
|
|
// if ES5 is available, make Base64.extendString() available
|
|
if (typeof Object.defineProperty === 'function') {
|
|
var noEnum = function(v){
|
|
return {value:v,enumerable:false,writable:true,configurable:true};
|
|
};
|
|
global.Base64.extendString = function () {
|
|
Object.defineProperty(
|
|
String.prototype, 'fromBase64', noEnum(function () {
|
|
return decode(this)
|
|
}));
|
|
Object.defineProperty(
|
|
String.prototype, 'toBase64', noEnum(function (urisafe) {
|
|
return encode(this, urisafe)
|
|
}));
|
|
Object.defineProperty(
|
|
String.prototype, 'toBase64URI', noEnum(function () {
|
|
return encode(this, true)
|
|
}));
|
|
};
|
|
}
|
|
//
|
|
// export Base64 to the namespace
|
|
//
|
|
if (global['Meteor']) { // Meteor.js
|
|
Base64 = global.Base64;
|
|
}
|
|
// module.exports and AMD are mutually exclusive.
|
|
// module.exports has precedence.
|
|
if ( true && module.exports) {
|
|
module.exports.Base64 = global.Base64;
|
|
}
|
|
else if (true) {
|
|
// AMD. Register as an anonymous module.
|
|
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function(){ return global.Base64 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
}
|
|
// that's it!
|
|
return {Base64: global.Base64}
|
|
}));
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |