@signalplus/params-about 1.0.5-alpha3 → 1.0.5-alpha5

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.
Files changed (2) hide show
  1. package/lib/es/index.js +40 -29
  2. package/package.json +1 -1
package/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Bundle of @signalplus/params-about
3
- * Generated: 2023-05-11
4
- * Version: 1.0.5-alpha3
3
+ * Generated: 2023-05-12
4
+ * Version: 1.0.5-alpha5
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
7
7
  */
@@ -11,7 +11,7 @@ import classNames from 'classnames';
11
11
  import dayjs from 'dayjs';
12
12
  import Big from 'big.js';
13
13
  import { PlusOutlined, DeleteOutlined, CloseOutlined, CheckOutlined, DownOutlined } from '@ant-design/icons';
14
- import { Popover, Input, Cascader, Select, Form, Button, message, Modal } from 'antd';
14
+ import { Popover, Cascader, Input, Select, Form, Button, message, Modal } from 'antd';
15
15
  import ReactGlobalComp from 'react-global-comp';
16
16
  import { isEqual } from 'lodash-es';
17
17
  import ReactFileInput from '@livelybone/react-file-input';
@@ -1316,14 +1316,20 @@ var Instruments = /*#__PURE__*/function (_PureComponent) {
1316
1316
  placement: 'bottomLeft',
1317
1317
  visible: !this.props.readonly && this.state.visible,
1318
1318
  onVisibleChange: this.handleVisibleChange,
1319
- content: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Input, {
1319
+ content: /*#__PURE__*/React.createElement("div", {
1320
+ className: "param-renderer"
1321
+ }, /*#__PURE__*/React.createElement("input", {
1322
+ style: {
1323
+ width: '180px',
1324
+ height: '30px'
1325
+ },
1320
1326
  onChange: function onChange(e) {
1321
1327
  return _this3.inputValueChange(e.target.value);
1322
1328
  }
1323
1329
  }), /*#__PURE__*/React.createElement("div", {
1324
1330
  style: {
1325
1331
  marginTop: 2,
1326
- width: 178,
1332
+ width: 220,
1327
1333
  height: 300,
1328
1334
  overflowY: 'auto',
1329
1335
  overflowX: 'hidden'
@@ -1660,16 +1666,17 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1660
1666
  for (var i = 0; i < $val.length; i++) {
1661
1667
  var val = $val[i];
1662
1668
  var error = expiryValidator(val === null || val === void 0 ? void 0 : val.expiry);
1669
+ if (isNullLike(val.expiry) && isNullLike(val.value)) return '';
1663
1670
 
1664
1671
  if (error) {
1665
1672
  return "Expiry field of the ".concat(i + 1, "th item: ").concat(error);
1666
1673
  }
1667
1674
 
1668
- if (!isNullLike(val.expiry) && isNullLike(val.value)) {
1675
+ if (isNullLike(val.expiry) && !isNullLike(val.value)) {
1669
1676
  return "The ".concat(i + 1, "th item: expiry shold not be empty");
1670
1677
  }
1671
1678
 
1672
- if (isNullLike(val.expiry) && !isNullLike(val.value)) {
1679
+ if (!isNullLike(val.expiry) && isNullLike(val.value)) {
1673
1680
  return "The ".concat(i + 1, "th item: value shold not be empty");
1674
1681
  }
1675
1682
  }
@@ -1723,12 +1730,13 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1723
1730
 
1724
1731
  for (var i = 0; i < $val.length; i++) {
1725
1732
  var val = $val[i];
1733
+ if (isNullLike(val.instrument) && isNullLike(val.value)) return '';
1726
1734
 
1727
- if (!isNullLike(val.instrument) && isNullLike(val.value)) {
1735
+ if (isNullLike(val.instrument) && !isNullLike(val.value)) {
1728
1736
  return "The ".concat(i + 1, "th item: instrument shold not be empty");
1729
1737
  }
1730
1738
 
1731
- if (isNullLike(val.instrument) && !isNullLike(val.value)) {
1739
+ if (!isNullLike(val.instrument) && isNullLike(val.value)) {
1732
1740
  return "The ".concat(i + 1, "th item: value shold not be empty");
1733
1741
  }
1734
1742
  }
@@ -1801,7 +1809,7 @@ var ParamRenderer = /*#__PURE__*/function (_PureComponent) {
1801
1809
  value: function render() {
1802
1810
  var Comp = this.typeConfig.Comp;
1803
1811
  return /*#__PURE__*/React.createElement(Comp, Object.assign({}, this.props, {
1804
- options: this.typeConfig.key === 'expiryNumberList' ? this.props.expiriesOptions : this.props.instrumentsOptions,
1812
+ options: this.typeConfig.key === 'instrumentNumberList' ? this.props.instrumentsOptions : this.props.expiriesOptions,
1805
1813
  value: this.value,
1806
1814
  onChange: this.onChange,
1807
1815
  className: classNames('param-renderer', this.props.className)
@@ -1905,7 +1913,6 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
1905
1913
 
1906
1914
  var valueType = (_this$ref$current$get = (_this$ref$current = this.ref.current) === null || _this$ref$current === void 0 ? void 0 : _this$ref$current.getFieldValue('valueType')) !== null && _this$ref$current$get !== void 0 ? _this$ref$current$get : (_this$props$initialVa = this.props.initialValues) === null || _this$props$initialVa === void 0 ? void 0 : _this$props$initialVa.valueType;
1907
1915
  var config = ParamTypeConfig[valueType];
1908
- console.log('ParamTypeOptions', ParamTypeOptions);
1909
1916
  return [{
1910
1917
  label: '所属分组',
1911
1918
  name: 'parentId',
@@ -1993,6 +2000,8 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
1993
2000
  }, {
1994
2001
  key: "render",
1995
2002
  value: function render() {
2003
+ var _this3 = this;
2004
+
1996
2005
  return /*#__PURE__*/React.createElement(Form, {
1997
2006
  className: "param-form",
1998
2007
  ref: this.ref,
@@ -2001,6 +2010,8 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
2001
2010
  onFinish: this.props.onSubmit,
2002
2011
  onValuesChange: this.onChange
2003
2012
  }, this.formItems.map(function (it) {
2013
+ var _this3$ref$current;
2014
+
2004
2015
  return /*#__PURE__*/React.createElement(Form.Item, {
2005
2016
  key: it.name,
2006
2017
  label: it.label,
@@ -2012,7 +2023,7 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
2012
2023
  return Promise.resolve();
2013
2024
  }
2014
2025
  }],
2015
- validateTrigger: 'onBlur'
2026
+ validateTrigger: it.name === 'defaultValue' && [4, 5, 6, 10, 11].includes((_this3$ref$current = _this3.ref.current) === null || _this3$ref$current === void 0 ? void 0 : _this3$ref$current.getFieldValue('valueType')) ? 'onSubmit' : 'onBlur'
2016
2027
  }, /*#__PURE__*/React.createElement(it.Comp, null));
2017
2028
  }), this.props.onSubmit && /*#__PURE__*/React.createElement(Button, {
2018
2029
  type: "primary",
@@ -2030,7 +2041,7 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
2030
2041
  var _super2 = _createSuper(ParamFormModalEl);
2031
2042
 
2032
2043
  function ParamFormModalEl() {
2033
- var _this3;
2044
+ var _this4;
2034
2045
 
2035
2046
  _classCallCheck(this, ParamFormModalEl);
2036
2047
 
@@ -2038,50 +2049,50 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
2038
2049
  args[_key2] = arguments[_key2];
2039
2050
  }
2040
2051
 
2041
- _this3 = _super2.call.apply(_super2, [this].concat(args));
2052
+ _this4 = _super2.call.apply(_super2, [this].concat(args));
2042
2053
 
2043
- _defineProperty(_assertThisInitialized(_this3), "ref", React.createRef());
2054
+ _defineProperty(_assertThisInitialized(_this4), "ref", React.createRef());
2044
2055
 
2045
- _defineProperty(_assertThisInitialized(_this3), "state", {
2056
+ _defineProperty(_assertThisInitialized(_this4), "state", {
2046
2057
  visible: false,
2047
2058
  pending: false
2048
2059
  });
2049
2060
 
2050
- _defineProperty(_assertThisInitialized(_this3), "onShow", function () {
2051
- return _this3.setState({
2061
+ _defineProperty(_assertThisInitialized(_this4), "onShow", function () {
2062
+ return _this4.setState({
2052
2063
  visible: true
2053
2064
  });
2054
2065
  });
2055
2066
 
2056
- _defineProperty(_assertThisInitialized(_this3), "onHide", function () {
2057
- return _this3.setState({
2067
+ _defineProperty(_assertThisInitialized(_this4), "onHide", function () {
2068
+ return _this4.setState({
2058
2069
  visible: false
2059
2070
  });
2060
2071
  });
2061
2072
 
2062
- _defineProperty(_assertThisInitialized(_this3), "onSubmit", function () {
2063
- var form = _this3.ref.current.ref.current;
2073
+ _defineProperty(_assertThisInitialized(_this4), "onSubmit", function () {
2074
+ var form = _this4.ref.current.ref.current;
2064
2075
  return form.validateFields().then(function () {
2065
- return _this3.setState({
2076
+ return _this4.setState({
2066
2077
  pending: true
2067
2078
  });
2068
2079
  }).then(function () {
2069
- var data = _objectSpread2(_objectSpread2({}, _this3.props.initialValues), form.getFieldsValue());
2080
+ var data = _objectSpread2(_objectSpread2({}, _this4.props.initialValues), form.getFieldsValue());
2070
2081
 
2071
- if (_this3.isEdit && isEqual(data, _this3.props.initialValues)) {
2082
+ if (_this4.isEdit && isEqual(data, _this4.props.initialValues)) {
2072
2083
  message.warning('请修改后再提交');
2073
2084
  return Promise.reject();
2074
2085
  }
2075
2086
 
2076
- return _this3.props.onSubmit(data);
2077
- }).then(_this3.onHide).catch(console.error).finally(function () {
2078
- return _this3.setState({
2087
+ return _this4.props.onSubmit(data);
2088
+ }).then(_this4.onHide).catch(console.error).finally(function () {
2089
+ return _this4.setState({
2079
2090
  pending: false
2080
2091
  });
2081
2092
  });
2082
2093
  });
2083
2094
 
2084
- return _this3;
2095
+ return _this4;
2085
2096
  }
2086
2097
 
2087
2098
  _createClass(ParamFormModalEl, [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalplus/params-about",
3
- "version": "1.0.5-alpha3",
3
+ "version": "1.0.5-alpha5",
4
4
  "description": "A description for the module",
5
5
  "main": "./lib/umd/index.js",
6
6
  "module": "./lib/es/index.js",