|
|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[59176],{
|
|
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[78941],{
|
|
|
|
|
|
|
|
|
|
/***/ 92280:
|
|
|
|
|
/*!*******************************************************************************************************************!*\
|
|
|
|
|
@ -43,49 +43,6 @@ if (false) {}
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 24545:
|
|
|
|
|
/*!*******************************************************************************************************!*\
|
|
|
|
|
!*** ./node_modules/_@ant-design_icons@5.3.0@@ant-design/icons/es/icons/RightOutlined.js + 1 modules ***!
|
|
|
|
|
\*******************************************************************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
Z: function() { return /* binding */ icons_RightOutlined; }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/extends.js
|
|
|
|
|
var esm_extends = __webpack_require__(79384);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/RightOutlined.js
|
|
|
|
|
// This icon file is generated automatically.
|
|
|
|
|
var RightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
|
|
|
|
|
/* harmony default export */ var asn_RightOutlined = (RightOutlined);
|
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.0@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
|
|
var AntdIcon = __webpack_require__(44847);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.3.0@@ant-design/icons/es/icons/RightOutlined.js
|
|
|
|
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var RightOutlined_RightOutlined = function RightOutlined(props, ref) {
|
|
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
|
|
ref: ref,
|
|
|
|
|
icon: asn_RightOutlined
|
|
|
|
|
}));
|
|
|
|
|
};
|
|
|
|
|
if (false) {}
|
|
|
|
|
/* harmony default export */ var icons_RightOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(RightOutlined_RightOutlined));
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 77578:
|
|
|
|
|
/*!**********************************************************************!*\
|
|
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/getRenderPropValue.js ***!
|
|
|
|
|
@ -563,31 +520,502 @@ const genWireframeStyle = token => {
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 8378:
|
|
|
|
|
/*!*******************************************************************!*\
|
|
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/style/motion/collapse.js ***!
|
|
|
|
|
\*******************************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
/***/ 78673:
|
|
|
|
|
/*!**********************************************************************!*\
|
|
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/switch/index.js + 2 modules ***!
|
|
|
|
|
\**********************************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
const genCollapseMotion = token => ({
|
|
|
|
|
[token.componentCls]: {
|
|
|
|
|
// For common/openAnimation
|
|
|
|
|
[`${token.antCls}-motion-collapse-legacy`]: {
|
|
|
|
|
overflow: 'hidden',
|
|
|
|
|
'&-active': {
|
|
|
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
|
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
Z: function() { return /* binding */ es_switch; }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.0@@ant-design/icons/es/icons/LoadingOutlined.js + 1 modules
|
|
|
|
|
var LoadingOutlined = __webpack_require__(20555);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/extends.js
|
|
|
|
|
var esm_extends = __webpack_require__(79384);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/defineProperty.js
|
|
|
|
|
var defineProperty = __webpack_require__(16514);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
|
|
var slicedToArray = __webpack_require__(35372);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
|
|
|
var objectWithoutProperties = __webpack_require__(4606);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/hooks/useMergedState.js
|
|
|
|
|
var useMergedState = __webpack_require__(84381);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/KeyCode.js
|
|
|
|
|
var KeyCode = __webpack_require__(84821);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-switch@4.1.0@rc-switch/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Switch = /*#__PURE__*/_react_17_0_2_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 = (0,objectWithoutProperties/* default */.Z)(_ref, _excluded);
|
|
|
|
|
var _useMergedState = (0,useMergedState/* default */.Z)(false, {
|
|
|
|
|
value: checked,
|
|
|
|
|
defaultValue: defaultChecked
|
|
|
|
|
}),
|
|
|
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_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 === KeyCode/* default */.Z.LEFT) {
|
|
|
|
|
triggerChange(false, e);
|
|
|
|
|
} else if (e.which === KeyCode/* default */.Z.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_2_5_1_classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-checked"), innerChecked), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
|
|
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("button", (0,esm_extends/* default */.Z)({}, restProps, {
|
|
|
|
|
type: "button",
|
|
|
|
|
role: "switch",
|
|
|
|
|
"aria-checked": innerChecked,
|
|
|
|
|
disabled: disabled,
|
|
|
|
|
className: switchClassName,
|
|
|
|
|
ref: ref,
|
|
|
|
|
onKeyDown: onInternalKeyDown,
|
|
|
|
|
onClick: onInternalClick
|
|
|
|
|
}), loadingIcon, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
|
|
className: "".concat(prefixCls, "-inner")
|
|
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
|
|
className: "".concat(prefixCls, "-inner-checked")
|
|
|
|
|
}, checkedChildren), /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
|
|
className: "".concat(prefixCls, "-inner-unchecked")
|
|
|
|
|
}, unCheckedChildren)));
|
|
|
|
|
});
|
|
|
|
|
Switch.displayName = 'Switch';
|
|
|
|
|
/* harmony default export */ var es = (Switch);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
|
|
|
|
|
var wave = __webpack_require__(14088);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
|
|
var context = __webpack_require__(36355);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/DisabledContext.js
|
|
|
|
|
var DisabledContext = __webpack_require__(1684);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/hooks/useSize.js
|
|
|
|
|
var useSize = __webpack_require__(19716);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ctrl_tinycolor@3.6.1@@ctrl/tinycolor/dist/module/index.js
|
|
|
|
|
var dist_module = __webpack_require__(64993);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
|
|
|
var style = __webpack_require__(17313);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
|
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
|
|
|
var statistic = __webpack_require__(37613);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@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
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
[`${token.antCls}-motion-collapse`]: {
|
|
|
|
|
overflow: 'hidden',
|
|
|
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
|
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
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@5.9.0@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_17_0_2_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_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
|
|
// ===================== Disabled =====================
|
|
|
|
|
const disabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
|
|
|
|
|
const mergedDisabled = (customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled) || loading;
|
|
|
|
|
const prefixCls = getPrefixCls('switch', customizePrefixCls);
|
|
|
|
|
const loadingIcon = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
|
|
className: `${prefixCls}-handle`
|
|
|
|
|
}, loading && /*#__PURE__*/_react_17_0_2_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_2_5_1_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_17_0_2_react.createElement(wave/* default */.Z, {
|
|
|
|
|
component: "Switch"
|
|
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es, Object.assign({}, restProps, {
|
|
|
|
|
prefixCls: prefixCls,
|
|
|
|
|
className: classes,
|
|
|
|
|
style: mergedStyle,
|
|
|
|
|
disabled: mergedDisabled,
|
|
|
|
|
ref: ref,
|
|
|
|
|
loadingIcon: loadingIcon
|
|
|
|
|
}))));
|
|
|
|
|
});
|
|
|
|
|
/* harmony default export */ __webpack_exports__.Z = (genCollapseMotion);
|
|
|
|
|
switch_Switch.__ANT_SWITCH = true;
|
|
|
|
|
if (false) {}
|
|
|
|
|
/* harmony default export */ var es_switch = (switch_Switch);
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
@ -655,309 +1083,6 @@ exports["default"] = _default;
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 31561:
|
|
|
|
|
/*!*****************************************************************************!*\
|
|
|
|
|
!*** ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/index.js + 4 modules ***!
|
|
|
|
|
\*****************************************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
Z: function() { return /* binding */ _rc_dropdown_4_1_0_rc_dropdown_es; }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/extends.js
|
|
|
|
|
var esm_extends = __webpack_require__(79384);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/defineProperty.js
|
|
|
|
|
var defineProperty = __webpack_require__(16514);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
|
|
var slicedToArray = __webpack_require__(35372);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.9@@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
|
|
|
var objectWithoutProperties = __webpack_require__(4606);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@rc-component_trigger@1.18.3@@rc-component/trigger/es/index.js + 11 modules
|
|
|
|
|
var es = __webpack_require__(35593);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/ref.js
|
|
|
|
|
var es_ref = __webpack_require__(88831);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/KeyCode.js
|
|
|
|
|
var KeyCode = __webpack_require__(84821);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/raf.js
|
|
|
|
|
var raf = __webpack_require__(90571);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/hooks/useAccessibility.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ESC = KeyCode/* default */.Z.ESC,
|
|
|
|
|
TAB = KeyCode/* default */.Z.TAB;
|
|
|
|
|
function useAccessibility(_ref) {
|
|
|
|
|
var visible = _ref.visible,
|
|
|
|
|
triggerRef = _ref.triggerRef,
|
|
|
|
|
onVisibleChange = _ref.onVisibleChange,
|
|
|
|
|
autoFocus = _ref.autoFocus,
|
|
|
|
|
overlayRef = _ref.overlayRef;
|
|
|
|
|
var focusMenuRef = _react_17_0_2_react.useRef(false);
|
|
|
|
|
var handleCloseMenuAndReturnFocus = function handleCloseMenuAndReturnFocus() {
|
|
|
|
|
if (visible) {
|
|
|
|
|
var _triggerRef$current, _triggerRef$current$f;
|
|
|
|
|
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : (_triggerRef$current$f = _triggerRef$current.focus) === null || _triggerRef$current$f === void 0 ? void 0 : _triggerRef$current$f.call(_triggerRef$current);
|
|
|
|
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var focusMenu = function focusMenu() {
|
|
|
|
|
var _overlayRef$current;
|
|
|
|
|
if ((_overlayRef$current = overlayRef.current) !== null && _overlayRef$current !== void 0 && _overlayRef$current.focus) {
|
|
|
|
|
overlayRef.current.focus();
|
|
|
|
|
focusMenuRef.current = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
var handleKeyDown = function handleKeyDown(event) {
|
|
|
|
|
switch (event.keyCode) {
|
|
|
|
|
case ESC:
|
|
|
|
|
handleCloseMenuAndReturnFocus();
|
|
|
|
|
break;
|
|
|
|
|
case TAB:
|
|
|
|
|
{
|
|
|
|
|
var focusResult = false;
|
|
|
|
|
if (!focusMenuRef.current) {
|
|
|
|
|
focusResult = focusMenu();
|
|
|
|
|
}
|
|
|
|
|
if (focusResult) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
} else {
|
|
|
|
|
handleCloseMenuAndReturnFocus();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
_react_17_0_2_react.useEffect(function () {
|
|
|
|
|
if (visible) {
|
|
|
|
|
window.addEventListener("keydown", handleKeyDown);
|
|
|
|
|
if (autoFocus) {
|
|
|
|
|
// FIXME: hack with raf
|
|
|
|
|
(0,raf/* default */.Z)(focusMenu, 3);
|
|
|
|
|
}
|
|
|
|
|
return function () {
|
|
|
|
|
window.removeEventListener("keydown", handleKeyDown);
|
|
|
|
|
focusMenuRef.current = false;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return function () {
|
|
|
|
|
focusMenuRef.current = false;
|
|
|
|
|
};
|
|
|
|
|
}, [visible]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
|
|
|
}
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/Overlay.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Overlay = /*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(function (props, ref) {
|
|
|
|
|
var overlay = props.overlay,
|
|
|
|
|
arrow = props.arrow,
|
|
|
|
|
prefixCls = props.prefixCls;
|
|
|
|
|
var overlayNode = (0,_react_17_0_2_react.useMemo)(function () {
|
|
|
|
|
var overlayElement;
|
|
|
|
|
if (typeof overlay === 'function') {
|
|
|
|
|
overlayElement = overlay();
|
|
|
|
|
} else {
|
|
|
|
|
overlayElement = overlay;
|
|
|
|
|
}
|
|
|
|
|
return overlayElement;
|
|
|
|
|
}, [overlay]);
|
|
|
|
|
var composedRef = (0,es_ref/* composeRef */.sQ)(ref, overlayNode === null || overlayNode === void 0 ? void 0 : overlayNode.ref);
|
|
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, arrow && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
|
|
className: "".concat(prefixCls, "-arrow")
|
|
|
|
|
}), /*#__PURE__*/_react_17_0_2_react.cloneElement(overlayNode, {
|
|
|
|
|
ref: (0,es_ref/* supportRef */.Yr)(overlayNode) ? composedRef : undefined
|
|
|
|
|
}));
|
|
|
|
|
});
|
|
|
|
|
/* harmony default export */ var es_Overlay = (Overlay);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/placements.js
|
|
|
|
|
var autoAdjustOverflow = {
|
|
|
|
|
adjustX: 1,
|
|
|
|
|
adjustY: 1
|
|
|
|
|
};
|
|
|
|
|
var targetOffset = [0, 0];
|
|
|
|
|
var placements = {
|
|
|
|
|
topLeft: {
|
|
|
|
|
points: ['bl', 'tl'],
|
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
|
offset: [0, -4],
|
|
|
|
|
targetOffset: targetOffset
|
|
|
|
|
},
|
|
|
|
|
top: {
|
|
|
|
|
points: ['bc', 'tc'],
|
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
|
offset: [0, -4],
|
|
|
|
|
targetOffset: targetOffset
|
|
|
|
|
},
|
|
|
|
|
topRight: {
|
|
|
|
|
points: ['br', 'tr'],
|
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
|
offset: [0, -4],
|
|
|
|
|
targetOffset: targetOffset
|
|
|
|
|
},
|
|
|
|
|
bottomLeft: {
|
|
|
|
|
points: ['tl', 'bl'],
|
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
|
offset: [0, 4],
|
|
|
|
|
targetOffset: targetOffset
|
|
|
|
|
},
|
|
|
|
|
bottom: {
|
|
|
|
|
points: ['tc', 'bc'],
|
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
|
offset: [0, 4],
|
|
|
|
|
targetOffset: targetOffset
|
|
|
|
|
},
|
|
|
|
|
bottomRight: {
|
|
|
|
|
points: ['tr', 'br'],
|
|
|
|
|
overflow: autoAdjustOverflow,
|
|
|
|
|
offset: [0, 4],
|
|
|
|
|
targetOffset: targetOffset
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var es_placements = (placements);
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/Dropdown.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["arrow", "prefixCls", "transitionName", "animation", "align", "placement", "placements", "getPopupContainer", "showAction", "hideAction", "overlayClassName", "overlayStyle", "visible", "trigger", "autoFocus", "overlay", "children", "onVisibleChange"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Dropdown(props, ref) {
|
|
|
|
|
var _children$props;
|
|
|
|
|
var _props$arrow = props.arrow,
|
|
|
|
|
arrow = _props$arrow === void 0 ? false : _props$arrow,
|
|
|
|
|
_props$prefixCls = props.prefixCls,
|
|
|
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-dropdown' : _props$prefixCls,
|
|
|
|
|
transitionName = props.transitionName,
|
|
|
|
|
animation = props.animation,
|
|
|
|
|
align = props.align,
|
|
|
|
|
_props$placement = props.placement,
|
|
|
|
|
placement = _props$placement === void 0 ? 'bottomLeft' : _props$placement,
|
|
|
|
|
_props$placements = props.placements,
|
|
|
|
|
placements = _props$placements === void 0 ? es_placements : _props$placements,
|
|
|
|
|
getPopupContainer = props.getPopupContainer,
|
|
|
|
|
showAction = props.showAction,
|
|
|
|
|
hideAction = props.hideAction,
|
|
|
|
|
overlayClassName = props.overlayClassName,
|
|
|
|
|
overlayStyle = props.overlayStyle,
|
|
|
|
|
visible = props.visible,
|
|
|
|
|
_props$trigger = props.trigger,
|
|
|
|
|
trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
|
|
|
|
|
autoFocus = props.autoFocus,
|
|
|
|
|
overlay = props.overlay,
|
|
|
|
|
children = props.children,
|
|
|
|
|
onVisibleChange = props.onVisibleChange,
|
|
|
|
|
otherProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
|
|
|
|
|
var _React$useState = _react_17_0_2_react.useState(),
|
|
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
|
|
triggerVisible = _React$useState2[0],
|
|
|
|
|
setTriggerVisible = _React$useState2[1];
|
|
|
|
|
var mergedVisible = 'visible' in props ? visible : triggerVisible;
|
|
|
|
|
var triggerRef = _react_17_0_2_react.useRef(null);
|
|
|
|
|
var overlayRef = _react_17_0_2_react.useRef(null);
|
|
|
|
|
var childRef = _react_17_0_2_react.useRef(null);
|
|
|
|
|
_react_17_0_2_react.useImperativeHandle(ref, function () {
|
|
|
|
|
return triggerRef.current;
|
|
|
|
|
});
|
|
|
|
|
var handleVisibleChange = function handleVisibleChange(newVisible) {
|
|
|
|
|
setTriggerVisible(newVisible);
|
|
|
|
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(newVisible);
|
|
|
|
|
};
|
|
|
|
|
useAccessibility({
|
|
|
|
|
visible: mergedVisible,
|
|
|
|
|
triggerRef: childRef,
|
|
|
|
|
onVisibleChange: handleVisibleChange,
|
|
|
|
|
autoFocus: autoFocus,
|
|
|
|
|
overlayRef: overlayRef
|
|
|
|
|
});
|
|
|
|
|
var onClick = function onClick(e) {
|
|
|
|
|
var onOverlayClick = props.onOverlayClick;
|
|
|
|
|
setTriggerVisible(false);
|
|
|
|
|
if (onOverlayClick) {
|
|
|
|
|
onOverlayClick(e);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var getMenuElement = function getMenuElement() {
|
|
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es_Overlay, {
|
|
|
|
|
ref: overlayRef,
|
|
|
|
|
overlay: overlay,
|
|
|
|
|
prefixCls: prefixCls,
|
|
|
|
|
arrow: arrow
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var getMenuElementOrLambda = function getMenuElementOrLambda() {
|
|
|
|
|
if (typeof overlay === 'function') {
|
|
|
|
|
return getMenuElement;
|
|
|
|
|
}
|
|
|
|
|
return getMenuElement();
|
|
|
|
|
};
|
|
|
|
|
var getMinOverlayWidthMatchTrigger = function getMinOverlayWidthMatchTrigger() {
|
|
|
|
|
var minOverlayWidthMatchTrigger = props.minOverlayWidthMatchTrigger,
|
|
|
|
|
alignPoint = props.alignPoint;
|
|
|
|
|
if ('minOverlayWidthMatchTrigger' in props) {
|
|
|
|
|
return minOverlayWidthMatchTrigger;
|
|
|
|
|
}
|
|
|
|
|
return !alignPoint;
|
|
|
|
|
};
|
|
|
|
|
var getOpenClassName = function getOpenClassName() {
|
|
|
|
|
var openClassName = props.openClassName;
|
|
|
|
|
if (openClassName !== undefined) {
|
|
|
|
|
return openClassName;
|
|
|
|
|
}
|
|
|
|
|
return "".concat(prefixCls, "-open");
|
|
|
|
|
};
|
|
|
|
|
var childrenNode = /*#__PURE__*/_react_17_0_2_react.cloneElement(children, {
|
|
|
|
|
className: _classnames_2_5_1_classnames_default()((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.className, mergedVisible && getOpenClassName()),
|
|
|
|
|
ref: (0,es_ref/* supportRef */.Yr)(children) ? (0,es_ref/* composeRef */.sQ)(childRef, children.ref) : undefined
|
|
|
|
|
});
|
|
|
|
|
var triggerHideAction = hideAction;
|
|
|
|
|
if (!triggerHideAction && trigger.indexOf('contextMenu') !== -1) {
|
|
|
|
|
triggerHideAction = ['click'];
|
|
|
|
|
}
|
|
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, (0,esm_extends/* default */.Z)({
|
|
|
|
|
builtinPlacements: placements
|
|
|
|
|
}, otherProps, {
|
|
|
|
|
prefixCls: prefixCls,
|
|
|
|
|
ref: triggerRef,
|
|
|
|
|
popupClassName: _classnames_2_5_1_classnames_default()(overlayClassName, (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-show-arrow"), arrow)),
|
|
|
|
|
popupStyle: overlayStyle,
|
|
|
|
|
action: trigger,
|
|
|
|
|
showAction: showAction,
|
|
|
|
|
hideAction: triggerHideAction,
|
|
|
|
|
popupPlacement: placement,
|
|
|
|
|
popupAlign: align,
|
|
|
|
|
popupTransitionName: transitionName,
|
|
|
|
|
popupAnimation: animation,
|
|
|
|
|
popupVisible: mergedVisible,
|
|
|
|
|
stretch: getMinOverlayWidthMatchTrigger() ? 'minWidth' : '',
|
|
|
|
|
popup: getMenuElementOrLambda(),
|
|
|
|
|
onPopupVisibleChange: handleVisibleChange,
|
|
|
|
|
onPopupClick: onClick,
|
|
|
|
|
getPopupContainer: getPopupContainer
|
|
|
|
|
}), childrenNode);
|
|
|
|
|
}
|
|
|
|
|
/* harmony default export */ var es_Dropdown = (/*#__PURE__*/_react_17_0_2_react.forwardRef(Dropdown));
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/index.js
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var _rc_dropdown_4_1_0_rc_dropdown_es = (es_Dropdown);
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 65835:
|
|
|
|
|
/*!**********************************************************************!*\
|
|
|
|
|
!*** ./node_modules/_rc-picker@3.13.2@rc-picker/lib/locale/zh_CN.js ***!
|