@signalplus/params-about 1.0.26-alpha2 → 1.0.26-alpha4

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
@@ -92,6 +92,7 @@ interface ParamFormProps {
92
92
  groupEditable?: boolean;
93
93
  onChange?(data: ParamFormData): void;
94
94
  onSubmit?(data: ParamFormData): any;
95
+ onModalWidthChange?(width: number): any;
95
96
  }
96
97
  declare class ParamForm extends PureComponent<ParamFormProps> {
97
98
  ref: React.RefObject<any>;
@@ -110,12 +111,13 @@ declare class ParamFormModalEl extends PureComponent<ParamFormProps & Required<P
110
111
  state: {
111
112
  visible: boolean;
112
113
  pending: boolean;
114
+ width: number | undefined;
113
115
  };
114
116
  get isEdit(): boolean;
115
117
  onShow: () => void;
116
118
  onHide: () => void;
117
119
  onSubmit: () => any;
118
- width: string | null;
120
+ handleModalWidthChange: (width: number) => void;
119
121
  render(): JSX.Element;
120
122
  }
121
123
  declare class ParamFormModal {
@@ -139,6 +141,7 @@ interface ParamValueEditorProps {
139
141
  initialValues: ParamValueEditorData;
140
142
  onChange?(data: ParamValueEditorData): void;
141
143
  onSubmit?(data: ParamValueEditorData): any;
144
+ onModalWidthChange(width: number): void;
142
145
  }
143
146
  declare class ParamValueEditor extends PureComponent<ParamValueEditorProps> {
144
147
  ref: React.RefObject<any>;
@@ -158,10 +161,12 @@ declare class ParamValueEditorModalEl extends PureComponent<ParamValueEditorProp
158
161
  state: {
159
162
  visible: boolean;
160
163
  pending: boolean;
164
+ width: number;
161
165
  };
162
166
  onShow: () => void;
163
167
  onHide: () => void;
164
168
  onSubmit: () => any;
169
+ handleModalWidthChange: (width: number) => void;
165
170
  render(): JSX.Element;
166
171
  }
167
172
  declare class ParamValueEditorModal {
package/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Bundle of @signalplus/params-about
3
- * Generated: 2025-10-15
4
- * Version: 1.0.26-alpha2
3
+ * Generated: 2025-10-28
4
+ * Version: 1.0.26-alpha4
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
7
7
  */
@@ -629,7 +629,7 @@ var NumRange = /*#__PURE__*/function (_PureComponent) {
629
629
  }, this.props.className),
630
630
  style: this.props.style
631
631
  }, this.props.readonly ? '(' : '', /*#__PURE__*/React.createElement(Num, {
632
- placeholder: 'Min',
632
+ placeholder: this.props.minName || 'Min',
633
633
  value: (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.min,
634
634
  onChange: this.onChange.bind(null, 'min'),
635
635
  isPercentage: this.props.isPercentage,
@@ -642,7 +642,7 @@ var NumRange = /*#__PURE__*/function (_PureComponent) {
642
642
  marginRight: 4
643
643
  } : undefined
644
644
  }, this.props.readonly ? ',' : '~'), /*#__PURE__*/React.createElement(Num, {
645
- placeholder: 'Max',
645
+ placeholder: this.props.maxName || 'Max',
646
646
  value: (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.max,
647
647
  onChange: this.onChange.bind(null, 'max'),
648
648
  isPercentage: this.props.isPercentage,
@@ -2788,6 +2788,8 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2788
2788
  min: rule.bidEdgeRange.min,
2789
2789
  max: rule.bidEdgeRange.max
2790
2790
  },
2791
+ minName: "From",
2792
+ maxName: "To",
2791
2793
  onChange: function onChange(val) {
2792
2794
  return _this2.onChange(i, val, 'vegaRules', k, 'bidEdgeRange');
2793
2795
  },
@@ -2798,6 +2800,8 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2798
2800
  min: rule.askEdgeRange.min,
2799
2801
  max: rule.askEdgeRange.max
2800
2802
  },
2803
+ minName: "From",
2804
+ maxName: "To",
2801
2805
  onChange: function onChange(val) {
2802
2806
  return _this2.onChange(i, val, 'vegaRules', k, 'askEdgeRange');
2803
2807
  },
@@ -3402,10 +3406,11 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
3402
3406
  (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, $data);
3403
3407
 
3404
3408
  if ('valueType' in changed) {
3405
- var _this$ref$current$get, _this$ref$current, _this$props$initialVa;
3409
+ var _this$ref$current$get, _this$ref$current, _this$props$initialVa, _this$props$onModalWi, _this$props2, _config$modalWidth;
3406
3410
 
3407
3411
  var config = ParamTypeConfig[(_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];
3408
- localStorage.setItem('__editParamModalWidth', String(config.modalWidth) || '0');
3412
+ localStorage.setItem('__editParamModalWidth', config.modalWidth ? String(config.modalWidth) : '740');
3413
+ (_this$props$onModalWi = (_this$props2 = _this.props).onModalWidthChange) === null || _this$props$onModalWi === void 0 ? void 0 : _this$props$onModalWi.call(_this$props2, (_config$modalWidth = config.modalWidth) !== null && _config$modalWidth !== void 0 ? _config$modalWidth : 740);
3409
3414
 
3410
3415
  _this.forceUpdate();
3411
3416
  }
@@ -3424,7 +3429,6 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
3424
3429
 
3425
3430
  var valueType = (_this$ref$current$get2 = (_this$ref$current2 = this.ref.current) === null || _this$ref$current2 === void 0 ? void 0 : _this$ref$current2.getFieldValue('valueType')) !== null && _this$ref$current$get2 !== void 0 ? _this$ref$current$get2 : (_this$props$initialVa2 = this.props.initialValues) === null || _this$props$initialVa2 === void 0 ? void 0 : _this$props$initialVa2.valueType;
3426
3431
  var config = ParamTypeConfig[valueType];
3427
- localStorage.setItem('__editParamModalWidth', String(config.modalWidth) || '0');
3428
3432
  return [{
3429
3433
  label: '所属分组',
3430
3434
  name: 'parentId',
@@ -3553,6 +3557,8 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
3553
3557
  var _super2 = _createSuper(ParamFormModalEl);
3554
3558
 
3555
3559
  function ParamFormModalEl() {
3560
+ var _this4$props$initialV, _ParamTypeConfig$_thi, _this4$props$initialV2;
3561
+
3556
3562
  var _this4;
3557
3563
 
3558
3564
  _classCallCheck(this, ParamFormModalEl);
@@ -3567,7 +3573,8 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
3567
3573
 
3568
3574
  _defineProperty(_assertThisInitialized(_this4), "state", {
3569
3575
  visible: false,
3570
- pending: false
3576
+ pending: false,
3577
+ width: ((_this4$props$initialV = _this4.props.initialValues) === null || _this4$props$initialV === void 0 ? void 0 : _this4$props$initialV.valueType) ? (_ParamTypeConfig$_thi = ParamTypeConfig[(_this4$props$initialV2 = _this4.props.initialValues) === null || _this4$props$initialV2 === void 0 ? void 0 : _this4$props$initialV2.valueType]) === null || _ParamTypeConfig$_thi === void 0 ? void 0 : _ParamTypeConfig$_thi.modalWidth : 740
3571
3578
  });
3572
3579
 
3573
3580
  _defineProperty(_assertThisInitialized(_this4), "onShow", function () {
@@ -3604,7 +3611,11 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
3604
3611
  });
3605
3612
  });
3606
3613
 
3607
- _defineProperty(_assertThisInitialized(_this4), "width", localStorage.getItem('__editParamModalWidth'));
3614
+ _defineProperty(_assertThisInitialized(_this4), "handleModalWidthChange", function (width) {
3615
+ _this4.setState({
3616
+ width: width
3617
+ });
3618
+ });
3608
3619
 
3609
3620
  return _this4;
3610
3621
  }
@@ -3621,7 +3632,7 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
3621
3632
  value: function render() {
3622
3633
  return /*#__PURE__*/React.createElement(Modal, {
3623
3634
  key: String(this.state.visible),
3624
- width: Number(this.width) || 740,
3635
+ width: this.state.width || 740,
3625
3636
  closable: false,
3626
3637
  title: !this.isEdit ? '新增参数' : '修改参数',
3627
3638
  visible: this.state.visible,
@@ -3634,7 +3645,8 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
3634
3645
  }, "\u786E\u8BA4"))
3635
3646
  }, /*#__PURE__*/React.createElement(ParamForm, Object.assign({}, this.props, {
3636
3647
  ref: this.ref,
3637
- onSubmit: undefined
3648
+ onSubmit: undefined,
3649
+ onModalWidthChange: this.handleModalWidthChange
3638
3650
  })));
3639
3651
  }
3640
3652
  }]);
@@ -3689,9 +3701,18 @@ var ParamValueEditor = /*#__PURE__*/function (_PureComponent) {
3689
3701
  _defineProperty(_assertThisInitialized(_this), "ref", React.createRef());
3690
3702
 
3691
3703
  _defineProperty(_assertThisInitialized(_this), "onChange", function (changed, data) {
3692
- var _this$props$onChange, _this$props;
3704
+ var _this$props$onChange, _this$props2;
3693
3705
 
3694
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, data);
3706
+ if ('valueType' in changed) {
3707
+ var _this$ref$current$get, _this$ref$current, _this$props$onModalWi, _this$props, _config$modalWidth;
3708
+
3709
+ var config = ParamTypeConfig[(_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.valueType];
3710
+ (_this$props$onModalWi = (_this$props = _this.props).onModalWidthChange) === null || _this$props$onModalWi === void 0 ? void 0 : _this$props$onModalWi.call(_this$props, (_config$modalWidth = config.modalWidth) !== null && _config$modalWidth !== void 0 ? _config$modalWidth : 740);
3711
+
3712
+ _this.forceUpdate();
3713
+ }
3714
+
3715
+ (_this$props$onChange = (_this$props2 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props2, data);
3695
3716
  });
3696
3717
 
3697
3718
  return _this;
@@ -3819,7 +3840,8 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
3819
3840
 
3820
3841
  _defineProperty(_assertThisInitialized(_this3), "state", {
3821
3842
  visible: false,
3822
- pending: false
3843
+ pending: false,
3844
+ width: ParamTypeConfig[_this3.props.valueType].modalWidth || 740
3823
3845
  });
3824
3846
 
3825
3847
  _defineProperty(_assertThisInitialized(_this3), "onShow", function () {
@@ -3856,6 +3878,12 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
3856
3878
  });
3857
3879
  });
3858
3880
 
3881
+ _defineProperty(_assertThisInitialized(_this3), "handleModalWidthChange", function (width) {
3882
+ _this3.setState({
3883
+ width: width
3884
+ });
3885
+ });
3886
+
3859
3887
  return _this3;
3860
3888
  }
3861
3889
 
@@ -3864,7 +3892,7 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
3864
3892
  value: function render() {
3865
3893
  return /*#__PURE__*/React.createElement(Modal, {
3866
3894
  key: String(this.state.visible),
3867
- width: 740,
3895
+ width: this.state.width || 740,
3868
3896
  title: 'Edit Value',
3869
3897
  closable: false,
3870
3898
  visible: this.state.visible,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalplus/params-about",
3
- "version": "1.0.26-alpha2",
3
+ "version": "1.0.26-alpha4",
4
4
  "description": "A description for the module",
5
5
  "main": "./lib/umd/index.js",
6
6
  "module": "./lib/es/index.js",