@signalplus/params-about 1.0.0 → 1.0.3

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/index.d.ts CHANGED
@@ -26,9 +26,7 @@ interface ValidateInfo {
26
26
  [key: string]: undefined | string | ValidateInfo;
27
27
  }
28
28
 
29
- interface ParamValueStruct {
30
- [key: string]: any;
31
- }
29
+ declare type ParamValueStruct = Record<string, any>;
32
30
  interface ParamRendererProps extends BaseInputProps {
33
31
  valueType?: ParamType;
34
32
  value?: ParamValueStruct;
@@ -70,9 +68,7 @@ interface ParamFormData {
70
68
  key: string;
71
69
  name?: string;
72
70
  valueType: ParamType;
73
- defaultValue?: {
74
- [key: string]: any;
75
- };
71
+ defaultValue?: Record<string, any>;
76
72
  description?: string;
77
73
  }
78
74
  interface ParamFormProps {
@@ -117,15 +113,9 @@ declare class ParamFormModal {
117
113
  interface ParamValueEditorData {
118
114
  paramId: string;
119
115
  description?: string;
120
- valueBefore: {
121
- [key: string]: any;
122
- };
123
- value?: {
124
- [key: string]: any;
125
- };
126
- defaultValue?: {
127
- [key: string]: any;
128
- };
116
+ valueBefore: Record<string, any>;
117
+ value?: Record<string, any>;
118
+ defaultValue?: Record<string, any>;
129
119
  }
130
120
  interface ParamValueEditorProps {
131
121
  allParams: ParentSelectorProps['parentOptions'];
package/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Bundle of @signalplus/params-about
3
- * Generated: 2022-05-09
4
- * Version: 1.0.0
3
+ * Generated: 2022-06-16
4
+ * Version: 1.0.3
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
7
7
  */
@@ -769,9 +769,13 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
769
769
  });
770
770
 
771
771
  _defineProperty(_assertThisInitialized(_this), "onChange", function (val) {
772
- var _this$props$onChange, _this$props, _this$props$onBlur, _this$props2;
772
+ var _this$props$value, _this$props$onChange, _this$props, _this$props$onBlur, _this$props2;
773
+
774
+ var value = _toConsumableArray(((_this$props$value = _this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (item) {
775
+ var _this$props$options;
773
776
 
774
- var value = _toConsumableArray(_this.props.value || []);
777
+ return (_this$props$options = _this.props.options) === null || _this$props$options === void 0 ? void 0 : _this$props$options.includes(item);
778
+ })) || []);
775
779
 
776
780
  if (_this.props.multiple !== false) {
777
781
  var index = value.findIndex(function (it) {
@@ -793,10 +797,10 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
793
797
  _createClass(Expiries, [{
794
798
  key: "renderValue",
795
799
  value: function renderValue() {
796
- var _this$props$value,
800
+ var _this$props$value2,
797
801
  _this2 = this;
798
802
 
799
- var value = (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (it) {
803
+ var value = (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.filter(function (it) {
800
804
  return it && !isExpired(it);
801
805
  });
802
806
 
@@ -811,9 +815,9 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
811
815
  }, "Choose");
812
816
 
813
817
  if (this.props.multiple === false) {
814
- var _this$props$value2;
818
+ var _this$props$value3;
815
819
 
816
- var _val = (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2[0];
820
+ var _val = (_this$props$value3 = this.props.value) === null || _this$props$value3 === void 0 ? void 0 : _this$props$value3[0];
817
821
 
818
822
  return !_val || isExpired(_val) ? placeholder : /*#__PURE__*/React.createElement("span", {
819
823
  className: "param-expiries-val"
@@ -836,7 +840,7 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
836
840
  }, {
837
841
  key: "render",
838
842
  value: function render() {
839
- var _this$props$options,
843
+ var _this$props$options2,
840
844
  _this3 = this;
841
845
 
842
846
  return /*#__PURE__*/React.createElement(Popover, {
@@ -845,7 +849,7 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
845
849
  placement: 'bottomLeft',
846
850
  visible: !this.props.readonly && this.state.visible,
847
851
  onVisibleChange: this.handleVisibleChange,
848
- content: (_this$props$options = this.props.options) === null || _this$props$options === void 0 ? void 0 : _this$props$options.map(function (it) {
852
+ content: (_this$props$options2 = this.props.options) === null || _this$props$options2 === void 0 ? void 0 : _this$props$options2.map(function (it) {
849
853
  var _this3$props$value, _this3$props$calcDisa, _this3$props, _this3$onChange;
850
854
 
851
855
  var checked = (_this3$props$value = _this3.props.value) === null || _this3$props$value === void 0 ? void 0 : _this3$props$value.includes(it);
@@ -1541,7 +1545,7 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
1541
1545
  }
1542
1546
 
1543
1547
  return _this3.props.onSubmit(data);
1544
- }).then(_this3.onHide).finally(function () {
1548
+ }).then(_this3.onHide).catch(console.error).finally(function () {
1545
1549
  return _this3.setState({
1546
1550
  pending: false
1547
1551
  });
@@ -1788,7 +1792,7 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
1788
1792
  }
1789
1793
 
1790
1794
  return _this3.props.onSubmit(data);
1791
- }).then(_this3.onHide).finally(function () {
1795
+ }).then(_this3.onHide).catch(console.error).finally(function () {
1792
1796
  return _this3.setState({
1793
1797
  pending: false
1794
1798
  });
@@ -2060,7 +2064,7 @@ var ParamGroupEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
2060
2064
  }
2061
2065
 
2062
2066
  return _this3.props.onSubmit(data);
2063
- }).then(_this3.onHide).finally(function () {
2067
+ }).then(_this3.onHide).catch(console.error).finally(function () {
2064
2068
  return _this3.setState({
2065
2069
  pending: false
2066
2070
  });
@@ -2352,7 +2356,7 @@ var ParamMoverModalEl = /*#__PURE__*/function (_PureComponent2) {
2352
2356
  });
2353
2357
  }).then(function () {
2354
2358
  return _this4.props.onSubmit(_this4.ref.current.newParams);
2355
- }).then(_this4.onHide).finally(function () {
2359
+ }).then(_this4.onHide).catch(console.error).finally(function () {
2356
2360
  return _this4.setState({
2357
2361
  pending: false
2358
2362
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalplus/params-about",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "A description for the module",
5
5
  "main": "./lib/umd/index.js",
6
6
  "module": "./lib/es/index.js",