@kdcloudjs/kdesign 1.6.20 → 1.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/kdesign-complete.less +11 -13
- package/dist/kdesign.css +19 -2
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +116 -87
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +5 -5
- package/dist/kdesign.min.js.map +1 -1
- package/es/checkbox/checkbox.js +1 -1
- package/es/checkbox/group.d.ts +1 -1
- package/es/checkbox/group.js +4 -4
- package/es/date-picker/range-picker.js +8 -1
- package/es/menu/style/index.css +18 -1
- package/es/menu/style/index.less +2 -13
- package/es/menu/style/mixin.less +9 -0
- package/es/radio/group.js +5 -6
- package/es/radio/interface.d.ts +2 -2
- package/es/radio/radio.js +25 -22
- package/lib/checkbox/checkbox.js +1 -1
- package/lib/checkbox/group.d.ts +1 -1
- package/lib/checkbox/group.js +4 -4
- package/lib/date-picker/range-picker.js +9 -1
- package/lib/menu/style/index.css +18 -1
- package/lib/menu/style/index.less +2 -13
- package/lib/menu/style/mixin.less +9 -0
- package/lib/radio/group.js +5 -6
- package/lib/radio/interface.d.ts +2 -2
- package/lib/radio/radio.js +29 -23
- package/package.json +7 -2
package/dist/kdesign.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* @kdcloudjs/kdesign v1.6.
|
|
3
|
+
* @kdcloudjs/kdesign v1.6.21
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2020-present, Kingdee, Inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -6939,7 +6939,7 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
6939
6939
|
var innerIconClassName = classnames__WEBPACK_IMPORTED_MODULE_7___default()(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, "".concat(checkboxPrefixCls, "-").concat(mergedCheckboxType, "-inner"), true));
|
|
6940
6940
|
var handleChange = Object(react__WEBPACK_IMPORTED_MODULE_6__["useCallback"])(function (e) {
|
|
6941
6941
|
onChange && onChange(e);
|
|
6942
|
-
(checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange) && (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange(value, e.target.checked));
|
|
6942
|
+
(checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange) && (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange(value, e.target.checked, e));
|
|
6943
6943
|
|
|
6944
6944
|
if (!(checkboxGroup !== null && checkboxGroup !== void 0 && checkboxGroup.isControlled)) {
|
|
6945
6945
|
setSelected(e.target.checked);
|
|
@@ -7114,7 +7114,7 @@ var CheckboxGroup = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6___default.a.fo
|
|
|
7114
7114
|
return innerValue.current.indexOf(targetValue) > -1 ? innerValue.current : innerValue.current.concat(targetValue);
|
|
7115
7115
|
};
|
|
7116
7116
|
|
|
7117
|
-
var onCheckboxChange = function onCheckboxChange(checkedValue, isChecked) {
|
|
7117
|
+
var onCheckboxChange = function onCheckboxChange(checkedValue, isChecked, e) {
|
|
7118
7118
|
var newVal = [];
|
|
7119
7119
|
|
|
7120
7120
|
if (isChecked) {
|
|
@@ -7127,7 +7127,7 @@ var CheckboxGroup = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6___default.a.fo
|
|
|
7127
7127
|
innerValue.current = newVal;
|
|
7128
7128
|
}
|
|
7129
7129
|
|
|
7130
|
-
onChange && onChange(newVal);
|
|
7130
|
+
onChange && onChange(e, newVal);
|
|
7131
7131
|
};
|
|
7132
7132
|
|
|
7133
7133
|
var context = {
|
|
@@ -7136,8 +7136,8 @@ var CheckboxGroup = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_6___default.a.fo
|
|
|
7136
7136
|
name: name,
|
|
7137
7137
|
isControlled: isControlled,
|
|
7138
7138
|
checkboxType: checkboxType,
|
|
7139
|
-
onCheckboxGroupChange: function onCheckboxGroupChange(checkedValue, isChecked) {
|
|
7140
|
-
onCheckboxChange(checkedValue, isChecked);
|
|
7139
|
+
onCheckboxGroupChange: function onCheckboxGroupChange(checkedValue, isChecked, e) {
|
|
7140
|
+
onCheckboxChange(checkedValue, isChecked, e);
|
|
7141
7141
|
}
|
|
7142
7142
|
};
|
|
7143
7143
|
|
|
@@ -12342,6 +12342,7 @@ var InternalRangePicker = function InternalRangePicker(props, ref) {
|
|
|
12342
12342
|
_ref$secondStep = _ref.secondStep,
|
|
12343
12343
|
secondStep = _ref$secondStep === void 0 ? 1 : _ref$secondStep,
|
|
12344
12344
|
suffixIcon = _ref.suffixIcon,
|
|
12345
|
+
panelRender = _ref.panelRender,
|
|
12345
12346
|
renderExtraFooter = _ref.renderExtraFooter,
|
|
12346
12347
|
disabledHours = _ref.disabledHours,
|
|
12347
12348
|
disabledMinutes = _ref.disabledMinutes,
|
|
@@ -12772,7 +12773,13 @@ var InternalRangePicker = function InternalRangePicker(props, ref) {
|
|
|
12772
12773
|
disabledDate: mergedActivePickerIndex === 0 ? disabledStartDate : disabledEndDate
|
|
12773
12774
|
});
|
|
12774
12775
|
|
|
12775
|
-
|
|
12776
|
+
var panelNode = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(_date_panel__WEBPACK_IMPORTED_MODULE_18__["default"], panelProps);
|
|
12777
|
+
|
|
12778
|
+
if (panelRender) {
|
|
12779
|
+
panelNode = panelRender(panelNode);
|
|
12780
|
+
}
|
|
12781
|
+
|
|
12782
|
+
return panelNode;
|
|
12776
12783
|
};
|
|
12777
12784
|
|
|
12778
12785
|
var extraNode = Object(_utils_get_extra_footer__WEBPACK_IMPORTED_MODULE_27__["default"])(datePickerPrefixCls, mergedModes[mergedActivePickerIndex], renderExtraFooter);
|
|
@@ -26502,23 +26509,22 @@ var RadioGroup = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__["forwardRef"](f
|
|
|
26502
26509
|
|
|
26503
26510
|
|
|
26504
26511
|
react__WEBPACK_IMPORTED_MODULE_4__["useEffect"](function () {
|
|
26505
|
-
if (props.value) {
|
|
26512
|
+
if (props.value !== undefined) {
|
|
26506
26513
|
setValue(props.value);
|
|
26507
26514
|
}
|
|
26508
26515
|
}, [props.value]);
|
|
26509
26516
|
|
|
26510
|
-
var onRadioChange = function onRadioChange(ev) {
|
|
26517
|
+
var onRadioChange = function onRadioChange(ev, checkedValue) {
|
|
26511
26518
|
var lastValue = value;
|
|
26512
|
-
var val = ev.target.value;
|
|
26513
26519
|
|
|
26514
26520
|
if (!('value' in props)) {
|
|
26515
|
-
setValue(
|
|
26521
|
+
setValue(checkedValue);
|
|
26516
26522
|
}
|
|
26517
26523
|
|
|
26518
26524
|
var onChange = props.onChange;
|
|
26519
26525
|
|
|
26520
|
-
if (onChange &&
|
|
26521
|
-
onChange(ev);
|
|
26526
|
+
if (onChange && checkedValue !== lastValue) {
|
|
26527
|
+
onChange(ev, checkedValue);
|
|
26522
26528
|
}
|
|
26523
26529
|
};
|
|
26524
26530
|
|
|
@@ -26713,56 +26719,38 @@ var RadioButton = function RadioButton(props, ref) {
|
|
|
26713
26719
|
|
|
26714
26720
|
"use strict";
|
|
26715
26721
|
__webpack_require__.r(__webpack_exports__);
|
|
26716
|
-
/* harmony import */ var
|
|
26717
|
-
/* harmony import */ var
|
|
26718
|
-
/* harmony import */ var
|
|
26719
|
-
/* harmony import */ var
|
|
26720
|
-
/* harmony import */ var
|
|
26721
|
-
/* harmony import */ var
|
|
26722
|
-
/* harmony import */ var
|
|
26723
|
-
/* harmony import */ var
|
|
26724
|
-
/* harmony import */ var
|
|
26725
|
-
/* harmony import */ var
|
|
26726
|
-
/* harmony import */ var
|
|
26727
|
-
/* harmony import */ var
|
|
26728
|
-
/* harmony import */ var
|
|
26729
|
-
/* harmony import */ var
|
|
26730
|
-
/* harmony import */ var
|
|
26731
|
-
/* harmony import */ var
|
|
26732
|
-
/* harmony import */ var
|
|
26733
|
-
/* harmony import */ var
|
|
26734
|
-
/* harmony import */ var
|
|
26735
|
-
/* harmony import */ var
|
|
26736
|
-
/* harmony import */ var
|
|
26737
|
-
/* harmony import */ var
|
|
26738
|
-
/* harmony import */ var
|
|
26739
|
-
/* harmony import */ var
|
|
26740
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react */ "react");
|
|
26741
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_12__);
|
|
26742
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
26743
|
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_13__);
|
|
26744
|
-
/* harmony import */ var lodash_isBoolean__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! lodash/isBoolean */ "./node_modules/lodash/isBoolean.js");
|
|
26745
|
-
/* harmony import */ var lodash_isBoolean__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(lodash_isBoolean__WEBPACK_IMPORTED_MODULE_14__);
|
|
26746
|
-
/* harmony import */ var _config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../config-provider/ConfigContext */ "./components/config-provider/ConfigContext.tsx");
|
|
26747
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../_utils */ "./components/_utils/index.ts");
|
|
26748
|
-
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./context */ "./components/radio/context.tsx");
|
|
26749
|
-
|
|
26750
|
-
|
|
26751
|
-
|
|
26752
|
-
|
|
26753
|
-
|
|
26754
|
-
|
|
26755
|
-
|
|
26722
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js");
|
|
26723
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
26724
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
|
|
26725
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);
|
|
26726
|
+
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
|
|
26727
|
+
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__);
|
|
26728
|
+
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/objectWithoutProperties.js");
|
|
26729
|
+
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__);
|
|
26730
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
|
|
26731
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
26732
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "react");
|
|
26733
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
|
|
26734
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
26735
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__);
|
|
26736
|
+
/* harmony import */ var lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash/isBoolean */ "./node_modules/lodash/isBoolean.js");
|
|
26737
|
+
/* harmony import */ var lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7__);
|
|
26738
|
+
/* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash/isNumber */ "./node_modules/lodash/isNumber.js");
|
|
26739
|
+
/* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_isNumber__WEBPACK_IMPORTED_MODULE_8__);
|
|
26740
|
+
/* harmony import */ var lodash_isString__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash/isString */ "./node_modules/lodash/isString.js");
|
|
26741
|
+
/* harmony import */ var lodash_isString__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash_isString__WEBPACK_IMPORTED_MODULE_9__);
|
|
26742
|
+
/* harmony import */ var _config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../config-provider/ConfigContext */ "./components/config-provider/ConfigContext.tsx");
|
|
26743
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../_utils */ "./components/_utils/index.ts");
|
|
26744
|
+
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./context */ "./components/radio/context.tsx");
|
|
26745
|
+
/* harmony import */ var _utils_devwarning__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../_utils/devwarning */ "./components/_utils/devwarning.ts");
|
|
26756
26746
|
|
|
26757
26747
|
|
|
26758
26748
|
|
|
26759
26749
|
|
|
26760
|
-
var _excluded = ["style", "checked", "children", "className", "radioType", "defaultChecked", "prefixCls"];
|
|
26750
|
+
var _excluded = ["style", "checked", "children", "className", "radioType", "value", "disabled", "defaultChecked", "prefixCls"];
|
|
26761
26751
|
|
|
26762
26752
|
|
|
26763
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26764
26753
|
|
|
26765
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26766
26754
|
|
|
26767
26755
|
|
|
26768
26756
|
|
|
@@ -26774,30 +26762,33 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
26774
26762
|
var InternalRadio = function InternalRadio(props, ref) {
|
|
26775
26763
|
var _classNames;
|
|
26776
26764
|
|
|
26777
|
-
var context =
|
|
26765
|
+
var context = react__WEBPACK_IMPORTED_MODULE_5___default.a.useContext(_context__WEBPACK_IMPORTED_MODULE_12__["default"]);
|
|
26778
26766
|
|
|
26779
|
-
var _React$useContext =
|
|
26767
|
+
var _React$useContext = react__WEBPACK_IMPORTED_MODULE_5___default.a.useContext(_config_provider_ConfigContext__WEBPACK_IMPORTED_MODULE_10__["default"]),
|
|
26780
26768
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
26781
26769
|
prefixCls = _React$useContext.prefixCls,
|
|
26782
26770
|
userDefaultProps = _React$useContext.compDefaultProps;
|
|
26783
26771
|
|
|
26784
|
-
var innerRef =
|
|
26772
|
+
var innerRef = react__WEBPACK_IMPORTED_MODULE_5___default.a.useRef();
|
|
26785
26773
|
var mergedRef = ref || innerRef;
|
|
26786
26774
|
|
|
26787
|
-
var _getCompProps = Object(
|
|
26775
|
+
var _getCompProps = Object(_utils__WEBPACK_IMPORTED_MODULE_11__["getCompProps"])('Radio', userDefaultProps, props),
|
|
26788
26776
|
style = _getCompProps.style,
|
|
26789
26777
|
checked = _getCompProps.checked,
|
|
26790
26778
|
children = _getCompProps.children,
|
|
26791
26779
|
className = _getCompProps.className,
|
|
26792
26780
|
radioType = _getCompProps.radioType,
|
|
26781
|
+
value = _getCompProps.value,
|
|
26782
|
+
disabled = _getCompProps.disabled,
|
|
26793
26783
|
defaultChecked = _getCompProps.defaultChecked,
|
|
26794
26784
|
customPrefixcls = _getCompProps.prefixCls,
|
|
26795
|
-
restProps =
|
|
26785
|
+
restProps = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3___default()(_getCompProps, _excluded); // 属性需要合并一遍用户定义的默认属性
|
|
26796
26786
|
|
|
26797
26787
|
|
|
26798
|
-
|
|
26799
|
-
|
|
26800
|
-
|
|
26788
|
+
Object(_utils_devwarning__WEBPACK_IMPORTED_MODULE_13__["default"])(!(lodash_isNumber__WEBPACK_IMPORTED_MODULE_8___default()(value) || lodash_isString__WEBPACK_IMPORTED_MODULE_9___default()(value)) && value !== '', 'radio', 'radio `value` type must string or number ');
|
|
26789
|
+
Object(_utils_devwarning__WEBPACK_IMPORTED_MODULE_13__["default"])(value === '', 'radio', 'radio value type is not empty string ');
|
|
26790
|
+
var mergedDisabled = (context === null || context === void 0 ? void 0 : context.disabled) || restProps.disabled;
|
|
26791
|
+
var initValue = context ? value === context.value : lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7___default()(checked) ? checked : defaultChecked;
|
|
26801
26792
|
|
|
26802
26793
|
var getPrefix = function getPrefix(radioType) {
|
|
26803
26794
|
return "radio".concat(radioType === 'square' ? "-".concat(radioType) : '');
|
|
@@ -26805,18 +26796,18 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
26805
26796
|
|
|
26806
26797
|
var radioPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, getPrefix(radioType), customPrefixcls); // 样式前缀
|
|
26807
26798
|
|
|
26808
|
-
var _React$useState =
|
|
26809
|
-
_React$useState2 =
|
|
26799
|
+
var _React$useState = react__WEBPACK_IMPORTED_MODULE_5___default.a.useState(initValue),
|
|
26800
|
+
_React$useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_React$useState, 2),
|
|
26810
26801
|
isChecked = _React$useState2[0],
|
|
26811
26802
|
setIsChecked = _React$useState2[1];
|
|
26812
26803
|
|
|
26813
|
-
|
|
26814
|
-
|
|
26815
|
-
|
|
26816
|
-
|
|
26817
|
-
var radioProps = _objectSpread({}, restProps);
|
|
26804
|
+
react__WEBPACK_IMPORTED_MODULE_5___default.a.useEffect(function () {
|
|
26805
|
+
var checkedValue = context ? value === context.value : lodash_isBoolean__WEBPACK_IMPORTED_MODULE_7___default()(checked) ? checked : defaultChecked;
|
|
26806
|
+
setIsChecked(checkedValue);
|
|
26807
|
+
}, [checked, defaultChecked, context === null || context === void 0 ? void 0 : context.value]);
|
|
26818
26808
|
|
|
26819
26809
|
var onChange = function onChange(e) {
|
|
26810
|
+
if (disabled) return;
|
|
26820
26811
|
setIsChecked(e.target.checked);
|
|
26821
26812
|
|
|
26822
26813
|
if (props.onChange) {
|
|
@@ -26824,21 +26815,13 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
26824
26815
|
}
|
|
26825
26816
|
|
|
26826
26817
|
if (context !== null && context !== void 0 && context.onChange) {
|
|
26827
|
-
context.onChange(e);
|
|
26818
|
+
context.onChange(e, value);
|
|
26828
26819
|
}
|
|
26829
26820
|
};
|
|
26830
26821
|
|
|
26831
|
-
|
|
26822
|
+
var classString = classnames__WEBPACK_IMPORTED_MODULE_6___default()((_classNames = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(radioPrefixCls), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(radioPrefixCls, "-disabled"), disabled), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_classNames, "".concat(radioPrefixCls, "-checked"), isChecked), _classNames), className); // 单选包裹元素class名称
|
|
26832
26823
|
|
|
26833
|
-
|
|
26834
|
-
radioProps.name = context.name;
|
|
26835
|
-
radioProps.checked = String(props.value) === String(context.value);
|
|
26836
|
-
radioProps.disabled = props.disabled || context.disabled;
|
|
26837
|
-
}
|
|
26838
|
-
|
|
26839
|
-
var classString = classnames__WEBPACK_IMPORTED_MODULE_13___default()((_classNames = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_classNames, "".concat(radioPrefixCls), true), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_classNames, "".concat(radioPrefixCls, "-disabled"), radioProps.disabled), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_classNames, "".concat(radioPrefixCls, "-checked"), context ? radioProps.checked : isChecked), _classNames), className); // 单选包裹元素class名称
|
|
26840
|
-
|
|
26841
|
-
Object(react__WEBPACK_IMPORTED_MODULE_12__["useEffect"])(function () {
|
|
26824
|
+
Object(react__WEBPACK_IMPORTED_MODULE_5__["useEffect"])(function () {
|
|
26842
26825
|
var _radioRef$current;
|
|
26843
26826
|
|
|
26844
26827
|
var handleRepeatClick = function handleRepeatClick(e) {
|
|
@@ -26861,20 +26844,25 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
26861
26844
|
return (
|
|
26862
26845
|
/*#__PURE__*/
|
|
26863
26846
|
// eslint-disable-next-line
|
|
26864
|
-
|
|
26847
|
+
react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("label", {
|
|
26865
26848
|
className: classString,
|
|
26866
26849
|
style: style,
|
|
26867
26850
|
ref: mergedRef
|
|
26868
|
-
}, /*#__PURE__*/
|
|
26851
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("input", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
26869
26852
|
type: "radio",
|
|
26870
|
-
className: "".concat(radioPrefixCls, "-input")
|
|
26871
|
-
|
|
26853
|
+
className: "".concat(radioPrefixCls, "-input"),
|
|
26854
|
+
checked: isChecked,
|
|
26855
|
+
onChange: onChange,
|
|
26856
|
+
value: value,
|
|
26857
|
+
name: context === null || context === void 0 ? void 0 : context.name,
|
|
26858
|
+
disabled: mergedDisabled
|
|
26859
|
+
}, restProps)), children !== undefined ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement("span", {
|
|
26872
26860
|
className: "".concat(radioPrefixCls, "-text")
|
|
26873
26861
|
}, children) : null)
|
|
26874
26862
|
);
|
|
26875
26863
|
};
|
|
26876
26864
|
|
|
26877
|
-
var Radio = /*#__PURE__*/
|
|
26865
|
+
var Radio = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.forwardRef(InternalRadio);
|
|
26878
26866
|
Radio.displayName = 'Radio';
|
|
26879
26867
|
/* harmony default export */ __webpack_exports__["default"] = (Radio);
|
|
26880
26868
|
|
|
@@ -105245,6 +105233,47 @@ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
|
105245
105233
|
module.exports = isSet;
|
|
105246
105234
|
|
|
105247
105235
|
|
|
105236
|
+
/***/ }),
|
|
105237
|
+
|
|
105238
|
+
/***/ "./node_modules/lodash/isString.js":
|
|
105239
|
+
/*!*****************************************!*\
|
|
105240
|
+
!*** ./node_modules/lodash/isString.js ***!
|
|
105241
|
+
\*****************************************/
|
|
105242
|
+
/*! no static exports found */
|
|
105243
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
105244
|
+
|
|
105245
|
+
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
|
|
105246
|
+
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
|
|
105247
|
+
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
|
|
105248
|
+
|
|
105249
|
+
/** `Object#toString` result references. */
|
|
105250
|
+
var stringTag = '[object String]';
|
|
105251
|
+
|
|
105252
|
+
/**
|
|
105253
|
+
* Checks if `value` is classified as a `String` primitive or object.
|
|
105254
|
+
*
|
|
105255
|
+
* @static
|
|
105256
|
+
* @since 0.1.0
|
|
105257
|
+
* @memberOf _
|
|
105258
|
+
* @category Lang
|
|
105259
|
+
* @param {*} value The value to check.
|
|
105260
|
+
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
|
|
105261
|
+
* @example
|
|
105262
|
+
*
|
|
105263
|
+
* _.isString('abc');
|
|
105264
|
+
* // => true
|
|
105265
|
+
*
|
|
105266
|
+
* _.isString(1);
|
|
105267
|
+
* // => false
|
|
105268
|
+
*/
|
|
105269
|
+
function isString(value) {
|
|
105270
|
+
return typeof value == 'string' ||
|
|
105271
|
+
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
|
|
105272
|
+
}
|
|
105273
|
+
|
|
105274
|
+
module.exports = isString;
|
|
105275
|
+
|
|
105276
|
+
|
|
105248
105277
|
/***/ }),
|
|
105249
105278
|
|
|
105250
105279
|
/***/ "./node_modules/lodash/isSymbol.js":
|