@kmkf-fe-packages/basic-components 0.7.15-alpha.62 → 0.7.15-alpha.65

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/dist/index.esm.js CHANGED
@@ -820,21 +820,23 @@ function ApaasRadio(props) {
820
820
  var triggerChange = function triggerChange(changedValue) {
821
821
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), changedValue));
822
822
  };
823
- var onRadioChange = function onRadioChange(e) {
824
- var radioValue = e.target.value;
825
- triggerChange({
826
- value: radioValue
827
- });
828
- };
829
823
  var onOtherChange = function onOtherChange(e) {
830
824
  var other = e.target.value;
831
825
  triggerChange({
832
826
  other: other
833
827
  });
834
828
  };
829
+ var onRadioClick = function onRadioClick(e) {
830
+ var selectValue = e.target.value;
831
+ if (selectValue === radioValue) {
832
+ selectValue = '';
833
+ }
834
+ triggerChange({
835
+ value: selectValue
836
+ });
837
+ };
835
838
  return /*#__PURE__*/React.createElement(Radio.Group, _objectSpread2({
836
- value: radioValue,
837
- onChange: onRadioChange
839
+ value: radioValue
838
840
  }, otherProps), /*#__PURE__*/React.createElement(Space, {
839
841
  direction: horizontal ? 'horizontal' : 'vertical',
840
842
  wrap: true
@@ -842,11 +844,13 @@ function ApaasRadio(props) {
842
844
  return /*#__PURE__*/React.createElement(Radio, {
843
845
  value: item.value,
844
846
  key: item.label,
845
- disabled: disabled
847
+ disabled: disabled,
848
+ onClick: onRadioClick
846
849
  }, item.label);
847
850
  }), showOther && /*#__PURE__*/React.createElement(Radio, {
848
851
  value: "\u5176\u4ED6",
849
- disabled: disabled
852
+ disabled: disabled,
853
+ onClick: onRadioClick
850
854
  }, "\u5176\u4ED6", /*#__PURE__*/React.createElement(Input, {
851
855
  disabled: disabled,
852
856
  value: other,
package/dist/index.js CHANGED
@@ -831,21 +831,23 @@ function ApaasRadio(props) {
831
831
  var triggerChange = function triggerChange(changedValue) {
832
832
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), changedValue));
833
833
  };
834
- var onRadioChange = function onRadioChange(e) {
835
- var radioValue = e.target.value;
836
- triggerChange({
837
- value: radioValue
838
- });
839
- };
840
834
  var onOtherChange = function onOtherChange(e) {
841
835
  var other = e.target.value;
842
836
  triggerChange({
843
837
  other: other
844
838
  });
845
839
  };
840
+ var onRadioClick = function onRadioClick(e) {
841
+ var selectValue = e.target.value;
842
+ if (selectValue === radioValue) {
843
+ selectValue = '';
844
+ }
845
+ triggerChange({
846
+ value: selectValue
847
+ });
848
+ };
846
849
  return /*#__PURE__*/React__default['default'].createElement(antd.Radio.Group, _objectSpread2({
847
- value: radioValue,
848
- onChange: onRadioChange
850
+ value: radioValue
849
851
  }, otherProps), /*#__PURE__*/React__default['default'].createElement(antd.Space, {
850
852
  direction: horizontal ? 'horizontal' : 'vertical',
851
853
  wrap: true
@@ -853,11 +855,13 @@ function ApaasRadio(props) {
853
855
  return /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
854
856
  value: item.value,
855
857
  key: item.label,
856
- disabled: disabled
858
+ disabled: disabled,
859
+ onClick: onRadioClick
857
860
  }, item.label);
858
861
  }), showOther && /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
859
862
  value: "\u5176\u4ED6",
860
- disabled: disabled
863
+ disabled: disabled,
864
+ onClick: onRadioClick
861
865
  }, "\u5176\u4ED6", /*#__PURE__*/React__default['default'].createElement(antd.Input, {
862
866
  disabled: disabled,
863
867
  value: other,
@@ -9,7 +9,7 @@ interface RadioValue {
9
9
  value?: string;
10
10
  other?: string;
11
11
  }
12
- export interface ApaasRadioProps extends Omit<RadioGroupProps, "onChange" | "value"> {
12
+ export interface ApaasRadioProps extends Omit<RadioGroupProps, 'onChange' | 'value'> {
13
13
  showOther?: boolean;
14
14
  horizontal?: boolean;
15
15
  options?: OptionsType[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.7.15-alpha.62",
3
+ "version": "0.7.15-alpha.65",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.62",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.65",
24
24
  "lodash": "^4.17.21",
25
25
  "pubsub-js": "^1.9.4",
26
26
  "umi-request": "^1.4.0"
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "6b726e827ca34ded9025522623713130f0f77037"
61
+ "gitHead": "0f431208a98f7579499d0803badf695085888ec9"
62
62
  }