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.
842 lines
30 KiB
842 lines
30 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[5112],{
|
|
|
|
/***/ 5112:
|
|
/*!*********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules ***!
|
|
\*********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
ZP: function() { return /* binding */ es_radio; }
|
|
});
|
|
|
|
// UNUSED EXPORTS: Button, Group
|
|
|
|
// 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.44.4@rc-util/es/hooks/useMergedState.js
|
|
var useMergedState = __webpack_require__(18929);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/pickAttrs.js
|
|
var pickAttrs = __webpack_require__(26112);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// 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/hooks/useSize.js
|
|
var useSize = __webpack_require__(19716);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/context.js
|
|
|
|
const RadioGroupContext = /*#__PURE__*/_react_17_0_2_react.createContext(null);
|
|
const RadioGroupContextProvider = RadioGroupContext.Provider;
|
|
/* harmony default export */ var radio_context = (RadioGroupContext);
|
|
const RadioOptionTypeContext = /*#__PURE__*/_react_17_0_2_react.createContext(null);
|
|
const RadioOptionTypeContextProvider = RadioOptionTypeContext.Provider;
|
|
// EXTERNAL MODULE: ./node_modules/_rc-checkbox@3.1.0@rc-checkbox/es/index.js
|
|
var es = __webpack_require__(5630);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/ref.js
|
|
var es_ref = __webpack_require__(8654);
|
|
// 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/form/context.js
|
|
var form_context = __webpack_require__(32441);
|
|
// 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/radio/style/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
// ============================== Styles ==============================
|
|
// styles from RadioGroup only
|
|
const getGroupRadioStyle = token => {
|
|
const {
|
|
componentCls,
|
|
antCls
|
|
} = token;
|
|
const groupPrefixCls = `${componentCls}-group`;
|
|
return {
|
|
[groupPrefixCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
display: 'inline-block',
|
|
fontSize: 0,
|
|
// RTL
|
|
[`&${groupPrefixCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
},
|
|
[`${antCls}-badge ${antCls}-badge-count`]: {
|
|
zIndex: 1
|
|
},
|
|
[`> ${antCls}-badge:not(:first-child) > ${antCls}-button-wrapper`]: {
|
|
borderInlineStart: 'none'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// Styles from radio-wrapper
|
|
const getRadioBasicStyle = token => {
|
|
const {
|
|
componentCls,
|
|
wrapperMarginInlineEnd,
|
|
colorPrimary,
|
|
radioSize,
|
|
motionDurationSlow,
|
|
motionDurationMid,
|
|
motionEaseInOutCirc,
|
|
colorBgContainer,
|
|
colorBorder,
|
|
lineWidth,
|
|
dotSize,
|
|
colorBgContainerDisabled,
|
|
colorTextDisabled,
|
|
paddingXS,
|
|
dotColorDisabled,
|
|
lineType,
|
|
radioDotDisabledSize,
|
|
wireframe,
|
|
colorWhite
|
|
} = token;
|
|
const radioInnerPrefixCls = `${componentCls}-inner`;
|
|
return {
|
|
[`${componentCls}-wrapper`]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
display: 'inline-flex',
|
|
alignItems: 'baseline',
|
|
marginInlineStart: 0,
|
|
marginInlineEnd: wrapperMarginInlineEnd,
|
|
cursor: 'pointer',
|
|
// RTL
|
|
[`&${componentCls}-wrapper-rtl`]: {
|
|
direction: 'rtl'
|
|
},
|
|
'&-disabled': {
|
|
cursor: 'not-allowed',
|
|
color: token.colorTextDisabled
|
|
},
|
|
'&::after': {
|
|
display: 'inline-block',
|
|
width: 0,
|
|
overflow: 'hidden',
|
|
content: '"\\a0"'
|
|
},
|
|
// hashId 在 wrapper 上,只能铺平
|
|
[`${componentCls}-checked::after`]: {
|
|
position: 'absolute',
|
|
insetBlockStart: 0,
|
|
insetInlineStart: 0,
|
|
width: '100%',
|
|
height: '100%',
|
|
border: `${lineWidth}px ${lineType} ${colorPrimary}`,
|
|
borderRadius: '50%',
|
|
visibility: 'hidden',
|
|
content: '""'
|
|
},
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
outline: 'none',
|
|
cursor: 'pointer',
|
|
alignSelf: 'center',
|
|
borderRadius: '50%'
|
|
}),
|
|
[`${componentCls}-wrapper:hover &,
|
|
&:hover ${radioInnerPrefixCls}`]: {
|
|
borderColor: colorPrimary
|
|
},
|
|
[`${componentCls}-input:focus-visible + ${radioInnerPrefixCls}`]: Object.assign({}, (0,style/* genFocusOutline */.oN)(token)),
|
|
[`${componentCls}:hover::after, ${componentCls}-wrapper:hover &::after`]: {
|
|
visibility: 'visible'
|
|
},
|
|
[`${componentCls}-inner`]: {
|
|
'&::after': {
|
|
boxSizing: 'border-box',
|
|
position: 'absolute',
|
|
insetBlockStart: '50%',
|
|
insetInlineStart: '50%',
|
|
display: 'block',
|
|
width: radioSize,
|
|
height: radioSize,
|
|
marginBlockStart: radioSize / -2,
|
|
marginInlineStart: radioSize / -2,
|
|
backgroundColor: wireframe ? colorPrimary : colorWhite,
|
|
borderBlockStart: 0,
|
|
borderInlineStart: 0,
|
|
borderRadius: radioSize,
|
|
transform: 'scale(0)',
|
|
opacity: 0,
|
|
transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`,
|
|
content: '""'
|
|
},
|
|
boxSizing: 'border-box',
|
|
position: 'relative',
|
|
insetBlockStart: 0,
|
|
insetInlineStart: 0,
|
|
display: 'block',
|
|
width: radioSize,
|
|
height: radioSize,
|
|
backgroundColor: colorBgContainer,
|
|
borderColor: colorBorder,
|
|
borderStyle: 'solid',
|
|
borderWidth: lineWidth,
|
|
borderRadius: '50%',
|
|
transition: `all ${motionDurationMid}`
|
|
},
|
|
[`${componentCls}-input`]: {
|
|
position: 'absolute',
|
|
inset: 0,
|
|
zIndex: 1,
|
|
cursor: 'pointer',
|
|
opacity: 0
|
|
},
|
|
// 选中状态
|
|
[`${componentCls}-checked`]: {
|
|
[radioInnerPrefixCls]: {
|
|
borderColor: colorPrimary,
|
|
backgroundColor: wireframe ? colorBgContainer : colorPrimary,
|
|
'&::after': {
|
|
transform: `scale(${dotSize / radioSize})`,
|
|
opacity: 1,
|
|
transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-disabled`]: {
|
|
cursor: 'not-allowed',
|
|
[radioInnerPrefixCls]: {
|
|
backgroundColor: colorBgContainerDisabled,
|
|
borderColor: colorBorder,
|
|
cursor: 'not-allowed',
|
|
'&::after': {
|
|
backgroundColor: dotColorDisabled
|
|
}
|
|
},
|
|
[`${componentCls}-input`]: {
|
|
cursor: 'not-allowed'
|
|
},
|
|
[`${componentCls}-disabled + span`]: {
|
|
color: colorTextDisabled,
|
|
cursor: 'not-allowed'
|
|
},
|
|
[`&${componentCls}-checked`]: {
|
|
[radioInnerPrefixCls]: {
|
|
'&::after': {
|
|
transform: `scale(${radioDotDisabledSize / radioSize})`
|
|
}
|
|
}
|
|
}
|
|
},
|
|
[`span${componentCls} + *`]: {
|
|
paddingInlineStart: paddingXS,
|
|
paddingInlineEnd: paddingXS
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// Styles from radio-button
|
|
const getRadioButtonStyle = token => {
|
|
const {
|
|
buttonColor,
|
|
controlHeight,
|
|
componentCls,
|
|
lineWidth,
|
|
lineType,
|
|
colorBorder,
|
|
motionDurationSlow,
|
|
motionDurationMid,
|
|
buttonPaddingInline,
|
|
fontSize,
|
|
buttonBg,
|
|
fontSizeLG,
|
|
controlHeightLG,
|
|
controlHeightSM,
|
|
paddingXS,
|
|
borderRadius,
|
|
borderRadiusSM,
|
|
borderRadiusLG,
|
|
buttonCheckedBg,
|
|
buttonSolidCheckedColor,
|
|
colorTextDisabled,
|
|
colorBgContainerDisabled,
|
|
buttonCheckedBgDisabled,
|
|
buttonCheckedColorDisabled,
|
|
colorPrimary,
|
|
colorPrimaryHover,
|
|
colorPrimaryActive,
|
|
buttonSolidCheckedBg,
|
|
buttonSolidCheckedHoverBg,
|
|
buttonSolidCheckedActiveBg
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-button-wrapper`]: {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
height: controlHeight,
|
|
margin: 0,
|
|
paddingInline: buttonPaddingInline,
|
|
paddingBlock: 0,
|
|
color: buttonColor,
|
|
fontSize,
|
|
lineHeight: `${controlHeight - lineWidth * 2}px`,
|
|
background: buttonBg,
|
|
border: `${lineWidth}px ${lineType} ${colorBorder}`,
|
|
// strange align fix for chrome but works
|
|
// https://gw.alipayobjects.com/zos/rmsportal/VFTfKXJuogBAXcvfAUWJ.gif
|
|
borderBlockStartWidth: lineWidth + 0.02,
|
|
borderInlineStartWidth: 0,
|
|
borderInlineEndWidth: lineWidth,
|
|
cursor: 'pointer',
|
|
transition: [`color ${motionDurationMid}`, `background ${motionDurationMid}`, `box-shadow ${motionDurationMid}`].join(','),
|
|
a: {
|
|
color: buttonColor
|
|
},
|
|
[`> ${componentCls}-button`]: {
|
|
position: 'absolute',
|
|
insetBlockStart: 0,
|
|
insetInlineStart: 0,
|
|
zIndex: -1,
|
|
width: '100%',
|
|
height: '100%'
|
|
},
|
|
'&:not(:first-child)': {
|
|
'&::before': {
|
|
position: 'absolute',
|
|
insetBlockStart: -lineWidth,
|
|
insetInlineStart: -lineWidth,
|
|
display: 'block',
|
|
boxSizing: 'content-box',
|
|
width: 1,
|
|
height: '100%',
|
|
paddingBlock: lineWidth,
|
|
paddingInline: 0,
|
|
backgroundColor: colorBorder,
|
|
transition: `background-color ${motionDurationSlow}`,
|
|
content: '""'
|
|
}
|
|
},
|
|
'&:first-child': {
|
|
borderInlineStart: `${lineWidth}px ${lineType} ${colorBorder}`,
|
|
borderStartStartRadius: borderRadius,
|
|
borderEndStartRadius: borderRadius
|
|
},
|
|
'&:last-child': {
|
|
borderStartEndRadius: borderRadius,
|
|
borderEndEndRadius: borderRadius
|
|
},
|
|
'&:first-child:last-child': {
|
|
borderRadius
|
|
},
|
|
[`${componentCls}-group-large &`]: {
|
|
height: controlHeightLG,
|
|
fontSize: fontSizeLG,
|
|
lineHeight: `${controlHeightLG - lineWidth * 2}px`,
|
|
'&:first-child': {
|
|
borderStartStartRadius: borderRadiusLG,
|
|
borderEndStartRadius: borderRadiusLG
|
|
},
|
|
'&:last-child': {
|
|
borderStartEndRadius: borderRadiusLG,
|
|
borderEndEndRadius: borderRadiusLG
|
|
}
|
|
},
|
|
[`${componentCls}-group-small &`]: {
|
|
height: controlHeightSM,
|
|
paddingInline: paddingXS - lineWidth,
|
|
paddingBlock: 0,
|
|
lineHeight: `${controlHeightSM - lineWidth * 2}px`,
|
|
'&:first-child': {
|
|
borderStartStartRadius: borderRadiusSM,
|
|
borderEndStartRadius: borderRadiusSM
|
|
},
|
|
'&:last-child': {
|
|
borderStartEndRadius: borderRadiusSM,
|
|
borderEndEndRadius: borderRadiusSM
|
|
}
|
|
},
|
|
'&:hover': {
|
|
position: 'relative',
|
|
color: colorPrimary
|
|
},
|
|
'&:has(:focus-visible)': Object.assign({}, (0,style/* genFocusOutline */.oN)(token)),
|
|
[`${componentCls}-inner, input[type='checkbox'], input[type='radio']`]: {
|
|
width: 0,
|
|
height: 0,
|
|
opacity: 0,
|
|
pointerEvents: 'none'
|
|
},
|
|
[`&-checked:not(${componentCls}-button-wrapper-disabled)`]: {
|
|
zIndex: 1,
|
|
color: colorPrimary,
|
|
background: buttonCheckedBg,
|
|
borderColor: colorPrimary,
|
|
'&::before': {
|
|
backgroundColor: colorPrimary
|
|
},
|
|
'&:first-child': {
|
|
borderColor: colorPrimary
|
|
},
|
|
'&:hover': {
|
|
color: colorPrimaryHover,
|
|
borderColor: colorPrimaryHover,
|
|
'&::before': {
|
|
backgroundColor: colorPrimaryHover
|
|
}
|
|
},
|
|
'&:active': {
|
|
color: colorPrimaryActive,
|
|
borderColor: colorPrimaryActive,
|
|
'&::before': {
|
|
backgroundColor: colorPrimaryActive
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-group-solid &-checked:not(${componentCls}-button-wrapper-disabled)`]: {
|
|
color: buttonSolidCheckedColor,
|
|
background: buttonSolidCheckedBg,
|
|
borderColor: buttonSolidCheckedBg,
|
|
'&:hover': {
|
|
color: buttonSolidCheckedColor,
|
|
background: buttonSolidCheckedHoverBg,
|
|
borderColor: buttonSolidCheckedHoverBg
|
|
},
|
|
'&:active': {
|
|
color: buttonSolidCheckedColor,
|
|
background: buttonSolidCheckedActiveBg,
|
|
borderColor: buttonSolidCheckedActiveBg
|
|
}
|
|
},
|
|
'&-disabled': {
|
|
color: colorTextDisabled,
|
|
backgroundColor: colorBgContainerDisabled,
|
|
borderColor: colorBorder,
|
|
cursor: 'not-allowed',
|
|
'&:first-child, &:hover': {
|
|
color: colorTextDisabled,
|
|
backgroundColor: colorBgContainerDisabled,
|
|
borderColor: colorBorder
|
|
}
|
|
},
|
|
[`&-disabled${componentCls}-button-wrapper-checked`]: {
|
|
color: buttonCheckedColorDisabled,
|
|
backgroundColor: buttonCheckedBgDisabled,
|
|
borderColor: colorBorder,
|
|
boxShadow: 'none'
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const getDotSize = radioSize => {
|
|
const dotPadding = 4; // Fixed Value
|
|
return radioSize - dotPadding * 2;
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var radio_style = ((0,genComponentStyleHook/* default */.Z)('Radio', token => {
|
|
const {
|
|
controlOutline,
|
|
controlOutlineWidth,
|
|
radioSize
|
|
} = token;
|
|
const radioFocusShadow = `0 0 0 ${controlOutlineWidth}px ${controlOutline}`;
|
|
const radioButtonFocusShadow = radioFocusShadow;
|
|
const radioDotDisabledSize = getDotSize(radioSize);
|
|
const radioToken = (0,statistic/* merge */.TS)(token, {
|
|
radioDotDisabledSize,
|
|
radioFocusShadow,
|
|
radioButtonFocusShadow
|
|
});
|
|
return [getGroupRadioStyle(radioToken), getRadioBasicStyle(radioToken), getRadioButtonStyle(radioToken)];
|
|
}, token => {
|
|
const {
|
|
wireframe,
|
|
padding,
|
|
marginXS,
|
|
lineWidth,
|
|
fontSizeLG,
|
|
colorText,
|
|
colorBgContainer,
|
|
colorTextDisabled,
|
|
controlItemBgActiveDisabled,
|
|
colorTextLightSolid,
|
|
colorPrimary,
|
|
colorPrimaryHover,
|
|
colorPrimaryActive
|
|
} = token;
|
|
const dotPadding = 4; // Fixed value
|
|
const radioSize = fontSizeLG;
|
|
const radioDotSize = wireframe ? getDotSize(radioSize) : radioSize - (dotPadding + lineWidth) * 2;
|
|
return {
|
|
// Radio
|
|
radioSize,
|
|
dotSize: radioDotSize,
|
|
dotColorDisabled: colorTextDisabled,
|
|
// Radio buttons
|
|
buttonSolidCheckedColor: colorTextLightSolid,
|
|
buttonSolidCheckedBg: colorPrimary,
|
|
buttonSolidCheckedHoverBg: colorPrimaryHover,
|
|
buttonSolidCheckedActiveBg: colorPrimaryActive,
|
|
buttonBg: colorBgContainer,
|
|
buttonCheckedBg: colorBgContainer,
|
|
buttonColor: colorText,
|
|
buttonCheckedBgDisabled: controlItemBgActiveDisabled,
|
|
buttonCheckedColorDisabled: colorTextDisabled,
|
|
buttonPaddingInline: padding - lineWidth,
|
|
wrapperMarginInlineEnd: marginXS
|
|
};
|
|
}));
|
|
// 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/_util/wave/interface.js
|
|
var wave_interface = __webpack_require__(4572);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/radio.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 InternalRadio = (props, ref) => {
|
|
var _a, _b;
|
|
const groupContext = _react_17_0_2_react.useContext(radio_context);
|
|
const radioOptionTypeContext = _react_17_0_2_react.useContext(RadioOptionTypeContext);
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
radio
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const innerRef = _react_17_0_2_react.useRef(null);
|
|
const mergedRef = (0,es_ref/* composeRef */.sQ)(ref, innerRef);
|
|
const {
|
|
isFormItemInput
|
|
} = _react_17_0_2_react.useContext(form_context/* FormItemInputContext */.aM);
|
|
false ? 0 : void 0;
|
|
const onChange = e => {
|
|
var _a, _b;
|
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
(_b = groupContext === null || groupContext === void 0 ? void 0 : groupContext.onChange) === null || _b === void 0 ? void 0 : _b.call(groupContext, e);
|
|
};
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
children,
|
|
style
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "children", "style"]);
|
|
const radioPrefixCls = getPrefixCls('radio', customizePrefixCls);
|
|
const isButtonType = ((groupContext === null || groupContext === void 0 ? void 0 : groupContext.optionType) || radioOptionTypeContext) === 'button';
|
|
const prefixCls = isButtonType ? `${radioPrefixCls}-button` : radioPrefixCls;
|
|
// Style
|
|
const [wrapSSR, hashId] = radio_style(radioPrefixCls);
|
|
const radioProps = Object.assign({}, restProps);
|
|
// ===================== Disabled =====================
|
|
const disabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
|
|
if (groupContext) {
|
|
radioProps.name = groupContext.name;
|
|
radioProps.onChange = onChange;
|
|
radioProps.checked = props.value === groupContext.value;
|
|
radioProps.disabled = (_a = radioProps.disabled) !== null && _a !== void 0 ? _a : groupContext.disabled;
|
|
}
|
|
radioProps.disabled = (_b = radioProps.disabled) !== null && _b !== void 0 ? _b : disabled;
|
|
const wrapperClassString = _classnames_2_5_1_classnames_default()(`${prefixCls}-wrapper`, {
|
|
[`${prefixCls}-wrapper-checked`]: radioProps.checked,
|
|
[`${prefixCls}-wrapper-disabled`]: radioProps.disabled,
|
|
[`${prefixCls}-wrapper-rtl`]: direction === 'rtl',
|
|
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
|
|
}, radio === null || radio === void 0 ? void 0 : radio.className, className, rootClassName, hashId);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
|
|
component: "Radio",
|
|
disabled: radioProps.disabled
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("label", {
|
|
className: wrapperClassString,
|
|
style: Object.assign(Object.assign({}, radio === null || radio === void 0 ? void 0 : radio.style), style),
|
|
onMouseEnter: props.onMouseEnter,
|
|
onMouseLeave: props.onMouseLeave
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, Object.assign({}, radioProps, {
|
|
className: _classnames_2_5_1_classnames_default()(radioProps.className, !isButtonType && wave_interface/* TARGET_CLS */.A),
|
|
type: "radio",
|
|
prefixCls: prefixCls,
|
|
ref: mergedRef
|
|
})), children !== undefined ? /*#__PURE__*/_react_17_0_2_react.createElement("span", null, children) : null)));
|
|
};
|
|
const Radio = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalRadio);
|
|
if (false) {}
|
|
/* harmony default export */ var radio_radio = (Radio);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/group.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const RadioGroup = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
const {
|
|
getPrefixCls,
|
|
direction
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const [value, setValue] = (0,useMergedState/* default */.Z)(props.defaultValue, {
|
|
value: props.value
|
|
});
|
|
const onRadioChange = ev => {
|
|
const lastValue = value;
|
|
const val = ev.target.value;
|
|
if (!('value' in props)) {
|
|
setValue(val);
|
|
}
|
|
const {
|
|
onChange
|
|
} = props;
|
|
if (onChange && val !== lastValue) {
|
|
onChange(ev);
|
|
}
|
|
};
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
options,
|
|
buttonStyle = 'outline',
|
|
disabled,
|
|
children,
|
|
size: customizeSize,
|
|
style,
|
|
id,
|
|
onMouseEnter,
|
|
onMouseLeave,
|
|
onFocus,
|
|
onBlur
|
|
} = props;
|
|
const prefixCls = getPrefixCls('radio', customizePrefixCls);
|
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
// Style
|
|
const [wrapSSR, hashId] = radio_style(prefixCls);
|
|
let childrenToRender = children;
|
|
// 如果存在 options, 优先使用
|
|
if (options && options.length > 0) {
|
|
childrenToRender = options.map(option => {
|
|
if (typeof option === 'string' || typeof option === 'number') {
|
|
// 此处类型自动推导为 string
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(radio_radio, {
|
|
key: option.toString(),
|
|
prefixCls: prefixCls,
|
|
disabled: disabled,
|
|
value: option,
|
|
checked: value === option
|
|
}, option);
|
|
}
|
|
// 此处类型自动推导为 { label: string value: string }
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(radio_radio, {
|
|
key: `radio-group-value-options-${option.value}`,
|
|
prefixCls: prefixCls,
|
|
disabled: option.disabled || disabled,
|
|
value: option.value,
|
|
checked: value === option.value,
|
|
title: option.title,
|
|
style: option.style
|
|
}, option.label);
|
|
});
|
|
}
|
|
const mergedSize = (0,useSize/* default */.Z)(customizeSize);
|
|
const classString = _classnames_2_5_1_classnames_default()(groupPrefixCls, `${groupPrefixCls}-${buttonStyle}`, {
|
|
[`${groupPrefixCls}-${mergedSize}`]: mergedSize,
|
|
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({}, (0,pickAttrs/* default */.Z)(props, {
|
|
aria: true,
|
|
data: true
|
|
}), {
|
|
className: classString,
|
|
style: style,
|
|
onMouseEnter: onMouseEnter,
|
|
onMouseLeave: onMouseLeave,
|
|
onFocus: onFocus,
|
|
onBlur: onBlur,
|
|
id: id,
|
|
ref: ref
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(RadioGroupContextProvider, {
|
|
value: {
|
|
onChange: onRadioChange,
|
|
value,
|
|
disabled: props.disabled,
|
|
name: props.name,
|
|
optionType: props.optionType
|
|
}
|
|
}, childrenToRender)));
|
|
});
|
|
/* harmony default export */ var group = (/*#__PURE__*/_react_17_0_2_react.memo(RadioGroup));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/radioButton.js
|
|
"use client";
|
|
|
|
var radioButton_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 RadioButton = (props, ref) => {
|
|
const {
|
|
getPrefixCls
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls
|
|
} = props,
|
|
radioProps = radioButton_rest(props, ["prefixCls"]);
|
|
const prefixCls = getPrefixCls('radio', customizePrefixCls);
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(RadioOptionTypeContextProvider, {
|
|
value: 'button'
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(radio_radio, Object.assign({
|
|
prefixCls: prefixCls
|
|
}, radioProps, {
|
|
type: 'radio',
|
|
ref: ref
|
|
})));
|
|
};
|
|
/* harmony default export */ var radioButton = (/*#__PURE__*/_react_17_0_2_react.forwardRef(RadioButton));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const radio_Radio = radio_radio;
|
|
radio_Radio.Button = radioButton;
|
|
radio_Radio.Group = group;
|
|
radio_Radio.__ANT_RADIO = true;
|
|
/* harmony default export */ var es_radio = (radio_Radio);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 5630:
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/_rc-checkbox@3.1.0@rc-checkbox/es/index.js ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* unused harmony export Checkbox */
|
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ 71409);
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 89490);
|
|
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ 87075);
|
|
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ 11036);
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ 39224);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 92310);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/hooks/useMergedState */ 18929);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"];
|
|
|
|
|
|
|
|
|
|
var Checkbox = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function (props, ref) {
|
|
var _classNames;
|
|
var _props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-checkbox' : _props$prefixCls,
|
|
className = props.className,
|
|
style = props.style,
|
|
checked = props.checked,
|
|
disabled = props.disabled,
|
|
_props$defaultChecked = props.defaultChecked,
|
|
defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,
|
|
_props$type = props.type,
|
|
type = _props$type === void 0 ? 'checkbox' : _props$type,
|
|
title = props.title,
|
|
onChange = props.onChange,
|
|
inputProps = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(props, _excluded);
|
|
var inputRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
|
|
var _useMergedState = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(defaultChecked, {
|
|
value: checked
|
|
}),
|
|
_useMergedState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(_useMergedState, 2),
|
|
rawValue = _useMergedState2[0],
|
|
setRawValue = _useMergedState2[1];
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useImperativeHandle)(ref, function () {
|
|
return {
|
|
focus: function focus() {
|
|
var _inputRef$current;
|
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
},
|
|
blur: function blur() {
|
|
var _inputRef$current2;
|
|
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
|
|
},
|
|
input: inputRef.current
|
|
};
|
|
});
|
|
var classString = classnames__WEBPACK_IMPORTED_MODULE_0___default()(prefixCls, className, (_classNames = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-checked"), rawValue), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
|
|
var handleChange = function handleChange(e) {
|
|
if (disabled) {
|
|
return;
|
|
}
|
|
if (!('checked' in props)) {
|
|
setRawValue(e.target.checked);
|
|
}
|
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
target: (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)({}, props), {}, {
|
|
type: type,
|
|
checked: e.target.checked
|
|
}),
|
|
stopPropagation: function stopPropagation() {
|
|
e.stopPropagation();
|
|
},
|
|
preventDefault: function preventDefault() {
|
|
e.preventDefault();
|
|
},
|
|
nativeEvent: e.nativeEvent
|
|
});
|
|
};
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("span", {
|
|
className: classString,
|
|
title: title,
|
|
style: style
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("input", (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)({}, inputProps, {
|
|
className: "".concat(prefixCls, "-input"),
|
|
ref: inputRef,
|
|
onChange: handleChange,
|
|
disabled: disabled,
|
|
checked: !!rawValue,
|
|
type: type
|
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner")
|
|
}));
|
|
});
|
|
/* harmony default export */ __webpack_exports__.Z = (Checkbox);
|
|
|
|
/***/ })
|
|
|
|
}]); |