@kmkf-fe-packages/basic-components 0.8.9-alpha.12 → 0.8.9-alpha.15

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
@@ -514,19 +514,22 @@ function ApaasInputNumber(props) {
514
514
  return /*#__PURE__*/React.createElement(InputNumber, _objectSpread2({}, props));
515
515
  }
516
516
 
517
- var _excluded$2 = ["options", "basicMultSelect"];
517
+ var _excluded$2 = ["options", "basicMultSelect", "readonly"];
518
518
  function ApaasSelect(props) {
519
519
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
520
520
  var _props$options = props.options,
521
521
  options = _props$options === void 0 ? [] : _props$options,
522
522
  basicMultSelect = props.basicMultSelect,
523
+ readonly = props.readonly,
523
524
  otherProps = _objectWithoutProperties(props, _excluded$2);
524
525
  return /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, otherProps), {}, {
526
+ showSearch: !readonly,
525
527
  style: {
526
528
  width: '100%'
527
529
  }
528
530
  }), options.map(function (item) {
529
531
  return /*#__PURE__*/React.createElement(Select.Option, {
532
+ disabled: readonly,
530
533
  value: item.value,
531
534
  key: item.value
532
535
  }, item.label);
@@ -804,7 +807,7 @@ var ApaasUpload = function ApaasUpload(_ref) {
804
807
  })));
805
808
  };
806
809
 
807
- var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
810
+ var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "hideUnselectedItem"];
808
811
  function ApaasRadio(props) {
809
812
  var showOther = props.showOther,
810
813
  _props$horizontal = props.horizontal,
@@ -815,6 +818,7 @@ function ApaasRadio(props) {
815
818
  value = _props$value === void 0 ? {} : _props$value,
816
819
  onChange = props.onChange,
817
820
  disabled = props.disabled,
821
+ hideUnselectedItem = props.hideUnselectedItem,
818
822
  otherProps = _objectWithoutProperties(props, _excluded$5);
819
823
  var radioValue = value.value,
820
824
  other = value.other;
@@ -842,13 +846,14 @@ function ApaasRadio(props) {
842
846
  direction: horizontal ? 'horizontal' : 'vertical',
843
847
  wrap: true
844
848
  }, options.map(function (item) {
849
+ if (hideUnselectedItem && item.value !== radioValue) return /*#__PURE__*/React.createElement(React.Fragment, null);
845
850
  return /*#__PURE__*/React.createElement(Radio, {
846
851
  value: item.value,
847
852
  key: item.label,
848
853
  disabled: disabled,
849
854
  onClick: onRadioClick
850
855
  }, item.label);
851
- }), showOther && /*#__PURE__*/React.createElement(Radio, {
856
+ }), showOther && (!hideUnselectedItem || radioValue === '其他') && /*#__PURE__*/React.createElement(Radio, {
852
857
  value: "\u5176\u4ED6",
853
858
  disabled: disabled,
854
859
  onClick: onRadioClick
package/dist/index.js CHANGED
@@ -525,19 +525,22 @@ function ApaasInputNumber(props) {
525
525
  return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, _objectSpread2({}, props));
526
526
  }
527
527
 
528
- var _excluded$2 = ["options", "basicMultSelect"];
528
+ var _excluded$2 = ["options", "basicMultSelect", "readonly"];
529
529
  function ApaasSelect(props) {
530
530
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
531
531
  var _props$options = props.options,
532
532
  options = _props$options === void 0 ? [] : _props$options,
533
533
  basicMultSelect = props.basicMultSelect,
534
+ readonly = props.readonly,
534
535
  otherProps = _objectWithoutProperties(props, _excluded$2);
535
536
  return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, otherProps), {}, {
537
+ showSearch: !readonly,
536
538
  style: {
537
539
  width: '100%'
538
540
  }
539
541
  }), options.map(function (item) {
540
542
  return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
543
+ disabled: readonly,
541
544
  value: item.value,
542
545
  key: item.value
543
546
  }, item.label);
@@ -815,7 +818,7 @@ var ApaasUpload = function ApaasUpload(_ref) {
815
818
  })));
816
819
  };
817
820
 
818
- var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
821
+ var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "hideUnselectedItem"];
819
822
  function ApaasRadio(props) {
820
823
  var showOther = props.showOther,
821
824
  _props$horizontal = props.horizontal,
@@ -826,6 +829,7 @@ function ApaasRadio(props) {
826
829
  value = _props$value === void 0 ? {} : _props$value,
827
830
  onChange = props.onChange,
828
831
  disabled = props.disabled,
832
+ hideUnselectedItem = props.hideUnselectedItem,
829
833
  otherProps = _objectWithoutProperties(props, _excluded$5);
830
834
  var radioValue = value.value,
831
835
  other = value.other;
@@ -853,13 +857,14 @@ function ApaasRadio(props) {
853
857
  direction: horizontal ? 'horizontal' : 'vertical',
854
858
  wrap: true
855
859
  }, options.map(function (item) {
860
+ if (hideUnselectedItem && item.value !== radioValue) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
856
861
  return /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
857
862
  value: item.value,
858
863
  key: item.label,
859
864
  disabled: disabled,
860
865
  onClick: onRadioClick
861
866
  }, item.label);
862
- }), showOther && /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
867
+ }), showOther && (!hideUnselectedItem || radioValue === '其他') && /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
863
868
  value: "\u5176\u4ED6",
864
869
  disabled: disabled,
865
870
  onClick: onRadioClick
@@ -14,6 +14,7 @@ export interface ApaasRadioProps extends Omit<RadioGroupProps, 'onChange' | 'val
14
14
  horizontal?: boolean;
15
15
  options?: OptionsType[];
16
16
  disabled?: boolean;
17
+ hideUnselectedItem?: boolean;
17
18
  onChange?: (value: RadioValue) => void;
18
19
  value?: RadioValue;
19
20
  }
@@ -7,6 +7,7 @@ type OptionsType = {
7
7
  };
8
8
  export interface ApaasSelectProps extends SelectProps<string[]> {
9
9
  options?: OptionsType[];
10
+ readonly?: boolean;
10
11
  [propName: string]: any;
11
12
  }
12
13
  declare function ApaasSelect(props: ApaasSelectProps): React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.8.9-alpha.12",
3
+ "version": "0.8.9-alpha.15",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -60,5 +60,5 @@
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "8dacfd2ad0656abd11684055ab4a9a35aa460d08"
63
+ "gitHead": "cf889c49a3699f46e3a6092e42de8212d85242b1"
64
64
  }