@signalplus/params-about 1.0.27-alpha → 1.0.28-alpha

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 (3) hide show
  1. package/index.d.ts +6 -1
  2. package/lib/es/index.js +494 -162
  3. package/package.json +4 -1
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;
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.27-alpha
3
+ * Generated: 2026-09-23
4
+ * Version: 1.0.28-alpha
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
7
7
  */
@@ -561,7 +561,7 @@ var Num = /*#__PURE__*/function (_PureComponent) {
561
561
  className: "param-number-val"
562
562
  }, this.state.tempValue || 'N/A') : /*#__PURE__*/React.createElement("input", {
563
563
  style: {
564
- width: this.props.isPercentage ? 50 : 90
564
+ width: this.props.singleWidth || this.props.isPercentage ? 50 : 90
565
565
  },
566
566
  className: "param-number-val",
567
567
  type: "text",
@@ -629,12 +629,13 @@ 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,
636
636
  readonly: this.props.readonly,
637
- onBlur: this.props.onBlur
637
+ onBlur: this.props.onBlur,
638
+ singleWidth: this.props.singleWidth
638
639
  }), /*#__PURE__*/React.createElement("span", {
639
640
  className: "param-number-range-sep",
640
641
  style: this.props.readonly ? {
@@ -642,12 +643,13 @@ var NumRange = /*#__PURE__*/function (_PureComponent) {
642
643
  marginRight: 4
643
644
  } : undefined
644
645
  }, this.props.readonly ? ',' : '~'), /*#__PURE__*/React.createElement(Num, {
645
- placeholder: 'Max',
646
+ placeholder: this.props.maxName || 'Max',
646
647
  value: (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.max,
647
648
  onChange: this.onChange.bind(null, 'max'),
648
649
  isPercentage: this.props.isPercentage,
649
650
  readonly: this.props.readonly,
650
- onBlur: this.props.onBlur
651
+ onBlur: this.props.onBlur,
652
+ singleWidth: this.props.singleWidth
651
653
  }), this.props.readonly ? ')' : '');
652
654
  }
653
655
  }]);
@@ -1445,7 +1447,8 @@ var InstrumentsValueList = /*#__PURE__*/function (_PureComponent) {
1445
1447
  var _this$props$value,
1446
1448
  _this2 = this;
1447
1449
 
1448
- this.value = this.props.value || [];
1450
+ // Keep the editable placeholder local instead of mutating the parent's array.
1451
+ this.value = _toConsumableArray(this.props.value || []);
1449
1452
  if (!this.value.length && !this.props.readonly) this.value.push({
1450
1453
  instrument: ''
1451
1454
  });
@@ -1663,7 +1666,8 @@ var TextValueList = /*#__PURE__*/function (_PureComponent) {
1663
1666
  var _this$props$value,
1664
1667
  _this2 = this;
1665
1668
 
1666
- this.value = this.props.value || [];
1669
+ // Keep the editable placeholder local instead of mutating the parent's array.
1670
+ this.value = _toConsumableArray(this.props.value || []);
1667
1671
  if (!this.value.length && !this.props.readonly) this.value.push({
1668
1672
  key: ''
1669
1673
  });
@@ -2433,7 +2437,8 @@ var TenorBucketHandlerList = /*#__PURE__*/function (_PureComponent) {
2433
2437
  var _this$props$value,
2434
2438
  _this2 = this;
2435
2439
 
2436
- this.value = this.props.value || [];
2440
+ // Keep the editable placeholder local instead of mutating the parent's array.
2441
+ this.value = _toConsumableArray(this.props.value || []);
2437
2442
  if (!this.value.length && !this.props.readonly) this.value.push({
2438
2443
  key: ''
2439
2444
  });
@@ -2504,6 +2509,118 @@ var TenorBucketHandlerList = /*#__PURE__*/function (_PureComponent) {
2504
2509
  return TenorBucketHandlerList;
2505
2510
  }(PureComponent);
2506
2511
 
2512
+ var NumRangeFromTo = /*#__PURE__*/function (_PureComponent) {
2513
+ _inherits(NumRangeFromTo, _PureComponent);
2514
+
2515
+ var _super = _createSuper(NumRangeFromTo);
2516
+
2517
+ function NumRangeFromTo() {
2518
+ var _this;
2519
+
2520
+ _classCallCheck(this, NumRangeFromTo);
2521
+
2522
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2523
+ args[_key] = arguments[_key];
2524
+ }
2525
+
2526
+ _this = _super.call.apply(_super, [this].concat(args));
2527
+
2528
+ _defineProperty(_assertThisInitialized(_this), "onChange", function (key, val) {
2529
+ var _this$props$onChange, _this$props;
2530
+
2531
+ var value = _objectSpread2({}, _this.props.value);
2532
+
2533
+ value[key] = val;
2534
+ (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
2535
+ });
2536
+
2537
+ return _this;
2538
+ }
2539
+
2540
+ _createClass(NumRangeFromTo, [{
2541
+ key: "render",
2542
+ value: function render() {
2543
+ var _this$props$value, _this$props$value2;
2544
+
2545
+ return /*#__PURE__*/React.createElement("div", {
2546
+ className: classNames('param-number-range', {
2547
+ readonly: this.props.readonly
2548
+ }, this.props.className),
2549
+ style: this.props.style
2550
+ }, this.props.readonly ? '(' : '', /*#__PURE__*/React.createElement(Num, {
2551
+ placeholder: 'From',
2552
+ value: (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.from,
2553
+ onChange: this.onChange.bind(null, 'from'),
2554
+ isPercentage: this.props.isPercentage,
2555
+ readonly: this.props.readonly,
2556
+ onBlur: this.props.onBlur
2557
+ }), /*#__PURE__*/React.createElement("span", {
2558
+ className: "param-number-range-sep",
2559
+ style: this.props.readonly ? {
2560
+ marginLeft: 0,
2561
+ marginRight: 4
2562
+ } : undefined
2563
+ }, this.props.readonly ? ',' : '~'), /*#__PURE__*/React.createElement(Num, {
2564
+ placeholder: 'To',
2565
+ value: (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.to,
2566
+ onChange: this.onChange.bind(null, 'to'),
2567
+ isPercentage: this.props.isPercentage,
2568
+ readonly: this.props.readonly,
2569
+ onBlur: this.props.onBlur
2570
+ }), this.props.readonly ? ')' : '');
2571
+ }
2572
+ }]);
2573
+
2574
+ return NumRangeFromTo;
2575
+ }(PureComponent);
2576
+
2577
+ function hasRangeOverlap(range1, range2) {
2578
+ var _range1$min, _range1$max, _range2$min, _range2$max;
2579
+
2580
+ var min1 = (_range1$min = range1.min) !== null && _range1$min !== void 0 ? _range1$min : -Infinity;
2581
+ var max1 = (_range1$max = range1.max) !== null && _range1$max !== void 0 ? _range1$max : Infinity;
2582
+ var min2 = (_range2$min = range2.min) !== null && _range2$min !== void 0 ? _range2$min : -Infinity;
2583
+ var max2 = (_range2$max = range2.max) !== null && _range2$max !== void 0 ? _range2$max : Infinity; // 边界相等不算重叠,所以用严格比较
2584
+
2585
+ return min1 < max2 && min2 < max1;
2586
+ }
2587
+ /**
2588
+ * 检查VegaRules数组是否合法
2589
+ */
2590
+
2591
+
2592
+ function validateVegaRules(rules) {
2593
+ for (var i = 0; i < rules.length; i++) {
2594
+ var _currentRule$optionTy;
2595
+
2596
+ var currentRule = rules[i];
2597
+ var currentType = (_currentRule$optionTy = currentRule.optionType) !== null && _currentRule$optionTy !== void 0 ? _currentRule$optionTy : 'Both'; // 默认按Both处理
2598
+
2599
+ for (var j = i + 1; j < rules.length; j++) {
2600
+ var _compareRule$optionTy;
2601
+
2602
+ var compareRule = rules[j];
2603
+ var compareType = (_compareRule$optionTy = compareRule.optionType) !== null && _compareRule$optionTy !== void 0 ? _compareRule$optionTy : 'Both'; // 检查是否需要比较这两个规则
2604
+
2605
+ var shouldCompare = false;
2606
+
2607
+ if (currentType === 'Both' || compareType === 'Both') {
2608
+ // 任意一个是Both,就需要比较
2609
+ shouldCompare = true;
2610
+ } else if (currentType === compareType) {
2611
+ // 类型相同(都是Call或都是Put),需要比较
2612
+ shouldCompare = true;
2613
+ } // 类型不同(一个Call一个Put),不需要比较
2614
+
2615
+
2616
+ if (shouldCompare && hasRangeOverlap(currentRule.deltaRange, compareRule.deltaRange)) {
2617
+ return false; // 发现重叠,不合法
2618
+ }
2619
+ }
2620
+ }
2621
+
2622
+ return true; // 没有发现重叠,合法
2623
+ }
2507
2624
  var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2508
2625
  _inherits(ExpiryVegaAlphaByEdgeList, _PureComponent);
2509
2626
 
@@ -2526,7 +2643,7 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2526
2643
  var _item$vegaRules, _item$expiry;
2527
2644
 
2528
2645
  var vegaRulesValid = item.vegaRules ? (_item$vegaRules = item.vegaRules) === null || _item$vegaRules === void 0 ? void 0 : _item$vegaRules.find(function (it) {
2529
- return it.deltaRange.min || it.deltaRange.max || it.bidEdgeRange.min || it.bidEdgeRange.max || it.askEdgeRange.min || it.askEdgeRange.max;
2646
+ return it.deltaRange.min || it.deltaRange.max || it.bidEdgeSpan.from || it.bidEdgeSpan.to || it.askEdgeSpan.from || it.askEdgeSpan.to;
2530
2647
  }) : true;
2531
2648
  return !((_item$expiry = item.expiry) === null || _item$expiry === void 0 ? void 0 : _item$expiry.trim()) && !item.vegaTarget && !!vegaRulesValid;
2532
2649
  });
@@ -2545,13 +2662,13 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2545
2662
  min: undefined,
2546
2663
  max: undefined
2547
2664
  },
2548
- bidEdgeRange: {
2549
- min: undefined,
2550
- max: undefined
2665
+ bidEdgeSpan: {
2666
+ from: undefined,
2667
+ to: undefined
2551
2668
  },
2552
- askEdgeRange: {
2553
- min: undefined,
2554
- max: undefined
2669
+ askEdgeSpan: {
2670
+ from: undefined,
2671
+ to: undefined
2555
2672
  },
2556
2673
  allowTaker: false,
2557
2674
  disable: false
@@ -2560,38 +2677,38 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2560
2677
 
2561
2678
  if (key) {
2562
2679
  if (subKey && typeof k === 'number') {
2563
- if (subKey === 'optionType') {
2564
- // console.log('changeValue==========================', value, i, val, key, k, subKey);
2565
- if (val === 'Both') {
2566
- value[i].vegaRules = [_objectSpread2(_objectSpread2({}, value[i].vegaRules[k]), {}, {
2567
- optionType: 'Both'
2568
- })];
2569
- } else {
2570
- var _value$i$vegaRules;
2571
-
2572
- if (((_value$i$vegaRules = value[i].vegaRules) === null || _value$i$vegaRules === void 0 ? void 0 : _value$i$vegaRules.length) <= 1) value[i].vegaRules = [_objectSpread2(_objectSpread2({}, value[i].vegaRules[k]), {}, {
2573
- optionType: val
2574
- }), {
2575
- optionType: val === 'Call' ? 'Put' : 'Call',
2576
- deltaRange: {
2577
- min: undefined,
2578
- max: undefined
2579
- },
2580
- bidEdgeRange: {
2581
- min: undefined,
2582
- max: undefined
2583
- },
2584
- askEdgeRange: {
2585
- min: undefined,
2586
- max: undefined
2587
- },
2588
- allowTaker: false,
2589
- disable: false
2590
- }];else value[i].vegaRules[k][subKey] = val;
2591
- }
2592
- } else {
2593
- value[i].vegaRules[k][subKey] = val;
2594
- }
2680
+ // if (subKey === 'optionType') {
2681
+ // // console.log('changeValue==========================', value, i, val, key, k, subKey);
2682
+ // if (val === 'Both') {
2683
+ // value[i].vegaRules = [{ ...value[i].vegaRules[k], optionType: 'Both' }];
2684
+ // } else {
2685
+ // if (value[i].vegaRules?.length <= 1)
2686
+ // value[i].vegaRules = [
2687
+ // { ...value[i].vegaRules[k], optionType: val },
2688
+ // {
2689
+ // optionType: val === 'Call' ? 'Put' : 'Call',
2690
+ // deltaRange: {
2691
+ // min: undefined,
2692
+ // max: undefined,
2693
+ // },
2694
+ // bidEdgeSpan: {
2695
+ // from: undefined,
2696
+ // to: undefined,
2697
+ // },
2698
+ // askEdgeSpan: {
2699
+ // from: undefined,
2700
+ // to: undefined,
2701
+ // },
2702
+ // allowTaker: false,
2703
+ // disable: false,
2704
+ // },
2705
+ // ];
2706
+ // else value[i].vegaRules[k][subKey] = val as never;
2707
+ // }
2708
+ // } else {
2709
+ // value[i].vegaRules[k][subKey] = val as never;
2710
+ // }
2711
+ value[i].vegaRules[k][subKey] = val;
2595
2712
  } else {
2596
2713
  value[i][key] = val;
2597
2714
  }
@@ -2616,13 +2733,13 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2616
2733
  min: undefined,
2617
2734
  max: undefined
2618
2735
  },
2619
- bidEdgeRange: {
2620
- min: undefined,
2621
- max: undefined
2736
+ bidEdgeSpan: {
2737
+ from: undefined,
2738
+ to: undefined
2622
2739
  },
2623
- askEdgeRange: {
2624
- min: undefined,
2625
- max: undefined
2740
+ askEdgeSpan: {
2741
+ from: undefined,
2742
+ to: undefined
2626
2743
  },
2627
2744
  allowTaker: false,
2628
2745
  disable: false
@@ -2632,16 +2749,52 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2632
2749
  (_this$props$onBlur = (_this$props3 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props3);
2633
2750
  });
2634
2751
 
2635
- _defineProperty(_assertThisInitialized(_this), "onDel", function (i) {
2752
+ _defineProperty(_assertThisInitialized(_this), "onAddRule", function (i, k) {
2636
2753
  var _this$props$onChange3, _this$props4, _this$props$onBlur2, _this$props5;
2637
2754
 
2638
2755
  var value = _toConsumableArray(_this.value);
2639
2756
 
2640
- value.splice(i, 1);
2641
- (_this$props$onChange3 = (_this$props4 = _this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props4, value.length === 1 && _this.isEmptyItem(value[0]) ? [] : value);
2757
+ value[i].vegaRules.splice(k + 1, 0, {
2758
+ optionType: undefined,
2759
+ deltaRange: {
2760
+ min: undefined,
2761
+ max: undefined
2762
+ },
2763
+ bidEdgeSpan: {
2764
+ from: undefined,
2765
+ to: undefined
2766
+ },
2767
+ askEdgeSpan: {
2768
+ from: undefined,
2769
+ to: undefined
2770
+ },
2771
+ allowTaker: false,
2772
+ disable: false
2773
+ });
2774
+ (_this$props$onChange3 = (_this$props4 = _this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props4, value);
2642
2775
  (_this$props$onBlur2 = (_this$props5 = _this.props).onBlur) === null || _this$props$onBlur2 === void 0 ? void 0 : _this$props$onBlur2.call(_this$props5);
2643
2776
  });
2644
2777
 
2778
+ _defineProperty(_assertThisInitialized(_this), "onDel", function (i) {
2779
+ var _this$props$onChange4, _this$props6, _this$props$onBlur3, _this$props7;
2780
+
2781
+ var value = _toConsumableArray(_this.value);
2782
+
2783
+ value.splice(i, 1);
2784
+ (_this$props$onChange4 = (_this$props6 = _this.props).onChange) === null || _this$props$onChange4 === void 0 ? void 0 : _this$props$onChange4.call(_this$props6, value.length === 1 && _this.isEmptyItem(value[0]) ? [] : value);
2785
+ (_this$props$onBlur3 = (_this$props7 = _this.props).onBlur) === null || _this$props$onBlur3 === void 0 ? void 0 : _this$props$onBlur3.call(_this$props7);
2786
+ });
2787
+
2788
+ _defineProperty(_assertThisInitialized(_this), "onDelRule", function (i, k) {
2789
+ var _this$props$onChange5, _this$props8, _this$props$onBlur4, _this$props9;
2790
+
2791
+ var value = _toConsumableArray(_this.value);
2792
+
2793
+ value[i].vegaRules.splice(k, 1);
2794
+ (_this$props$onChange5 = (_this$props8 = _this.props).onChange) === null || _this$props$onChange5 === void 0 ? void 0 : _this$props$onChange5.call(_this$props8, value.length === 1 && _this.isEmptyItem(value[0]) ? [] : value);
2795
+ (_this$props$onBlur4 = (_this$props9 = _this.props).onBlur) === null || _this$props$onBlur4 === void 0 ? void 0 : _this$props$onBlur4.call(_this$props9);
2796
+ });
2797
+
2645
2798
  return _this;
2646
2799
  }
2647
2800
 
@@ -2664,13 +2817,13 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2664
2817
  min: undefined,
2665
2818
  max: undefined
2666
2819
  },
2667
- bidEdgeRange: {
2668
- min: undefined,
2669
- max: undefined
2820
+ bidEdgeSpan: {
2821
+ from: undefined,
2822
+ to: undefined
2670
2823
  },
2671
- askEdgeRange: {
2672
- min: undefined,
2673
- max: undefined
2824
+ askEdgeSpan: {
2825
+ from: undefined,
2826
+ to: undefined
2674
2827
  },
2675
2828
  allowTaker: false,
2676
2829
  disable: false
@@ -2689,44 +2842,98 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2689
2842
  }, it.expiry, /*#__PURE__*/React.createElement("span", null, "/"), !isNullLike(it.vegaTarget) ? it.vegaTarget : '-', /*#__PURE__*/React.createElement("span", null, "/"), it.vegaRules.map(function ($it, $i) {
2690
2843
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
2691
2844
  key: $i
2692
- }, !isNullLike($it.optionType) ? $it.optionType : '-', /*#__PURE__*/React.createElement("span", null, "/"), !isNullLike($it.deltaRange.min) && !isNullLike($it.deltaRange.max) ? "(".concat($it.deltaRange.min, ", ").concat($it.deltaRange.max, ")") : '-', /*#__PURE__*/React.createElement("span", null, "/"), !isNullLike($it.bidEdgeRange.min) && !isNullLike($it.bidEdgeRange.max) ? "(".concat(NumCvt.show($it.bidEdgeRange.min, true), "%, ").concat(NumCvt.show($it.bidEdgeRange.max, true), "%)") : '-', /*#__PURE__*/React.createElement("span", null, "/"), !isNullLike($it.askEdgeRange.min) && !isNullLike($it.askEdgeRange.max) ? "(".concat(NumCvt.show($it.askEdgeRange.min, true), "%, ").concat(NumCvt.show($it.askEdgeRange.max, true), "%)") : '-', /*#__PURE__*/React.createElement("span", null, "/"), typeof $it.allowTaker === 'boolean' ? $it.allowTaker.toString().toUpperCase() : '-', /*#__PURE__*/React.createElement("span", null, "/"), typeof $it.disable === 'boolean' ? $it.disable.toString().toUpperCase() : '-'), /*#__PURE__*/React.createElement("br", null));
2845
+ }, !isNullLike($it.optionType) ? $it.optionType : '-', /*#__PURE__*/React.createElement("span", null, "/"), !isNullLike($it.deltaRange.min) && !isNullLike($it.deltaRange.max) ? "(".concat($it.deltaRange.min, ", ").concat($it.deltaRange.max, ")") : '-', /*#__PURE__*/React.createElement("span", null, "/"), !isNullLike($it.bidEdgeSpan.from) && !isNullLike($it.bidEdgeSpan.to) ? "(".concat(NumCvt.show($it.bidEdgeSpan.from, true), "%, ").concat(NumCvt.show($it.bidEdgeSpan.to, true), "%)") : '-', /*#__PURE__*/React.createElement("span", null, "/"), !isNullLike($it.askEdgeSpan.from) && !isNullLike($it.askEdgeSpan.to) ? "(".concat(NumCvt.show($it.askEdgeSpan.from, true), "%, ").concat(NumCvt.show($it.askEdgeSpan.to, true), "%)") : '-', /*#__PURE__*/React.createElement("span", null, "/"), typeof $it.allowTaker === 'boolean' ? $it.allowTaker.toString().toUpperCase() : '-', /*#__PURE__*/React.createElement("span", null, "/"), typeof $it.disable === 'boolean' ? $it.disable.toString().toUpperCase() : '-'), /*#__PURE__*/React.createElement("br", null));
2693
2846
  })), /*#__PURE__*/React.createElement("br", null));
2694
2847
  }) : '-' : /*#__PURE__*/React.createElement("div", {
2695
2848
  className: "param-expiries-limit-inputs",
2696
2849
  style: {
2697
- gridTemplateColumns: '110px 100px auto auto'
2850
+ display: 'flex',
2851
+ flexDirection: 'column',
2852
+ width: 1150
2698
2853
  }
2699
2854
  }, /*#__PURE__*/React.createElement("div", {
2700
- className: "param-number-range readonly"
2855
+ style: {
2856
+ display: 'flex',
2857
+ width: '100%',
2858
+ gap: 8
2859
+ }
2860
+ }, /*#__PURE__*/React.createElement("div", {
2861
+ style: {
2862
+ width: 100
2863
+ }
2701
2864
  }, "Expiry"), /*#__PURE__*/React.createElement("div", {
2702
- className: "param-number-range readonly"
2865
+ style: {
2866
+ width: 80
2867
+ }
2703
2868
  }, "Vega Target"), /*#__PURE__*/React.createElement("div", {
2704
- className: "param-number-range readonly"
2705
- }), /*#__PURE__*/React.createElement("div", {
2706
- className: "param-number-range readonly"
2707
- }), this.value.map(function (it, i) {
2869
+ style: {
2870
+ width: 120,
2871
+ paddingLeft: 18
2872
+ }
2873
+ }, "Both/Call/Put"), /*#__PURE__*/React.createElement("div", {
2874
+ style: {
2875
+ width: 160
2876
+ }
2877
+ }, "Delta Range"), /*#__PURE__*/React.createElement("div", {
2878
+ style: {
2879
+ width: 210
2880
+ }
2881
+ }, "Bid Edge Range"), /*#__PURE__*/React.createElement("div", {
2882
+ style: {
2883
+ width: 210
2884
+ }
2885
+ }, "Ask Edge Range"), /*#__PURE__*/React.createElement("div", {
2886
+ style: {
2887
+ width: 74
2888
+ }
2889
+ }, "Allow Taker"), /*#__PURE__*/React.createElement("div", {
2890
+ style: {
2891
+ width: 60
2892
+ }
2893
+ }, "Disable")), this.value.map(function (it, i) {
2708
2894
  var _this2$props$value, _this2$props$value$i;
2709
2895
 
2710
- return /*#__PURE__*/React.createElement(React.Fragment, {
2711
- key: i
2896
+ return /*#__PURE__*/React.createElement("div", {
2897
+ key: i,
2898
+ style: {
2899
+ display: 'flex',
2900
+ flexDirection: 'column',
2901
+ width: '100%'
2902
+ }
2903
+ }, /*#__PURE__*/React.createElement("div", {
2904
+ style: {
2905
+ display: 'flex',
2906
+ width: '100%',
2907
+ alignItems: 'flex-start',
2908
+ gap: 8
2909
+ }
2910
+ }, /*#__PURE__*/React.createElement("div", {
2911
+ style: {
2912
+ width: 100,
2913
+ marginRight: 0
2914
+ }
2712
2915
  }, /*#__PURE__*/React.createElement(Expiries, {
2713
2916
  style: {
2714
- width: 110,
2715
- minWidth: 0,
2716
- position: 'relative',
2717
- top: i > 0 ? -30 : 0
2917
+ width: 100,
2918
+ minWidth: 0
2718
2919
  },
2719
2920
  multiple: false,
2720
2921
  options: _this2.props.options,
2721
2922
  value: [it.expiry || ''],
2722
2923
  onChange: function onChange(val) {
2723
2924
  return _this2.onChange(i, val[0], 'expiry');
2724
- } // calcDisabled={(expiry) =>
2725
- // this.value.some((item) => item !== it && item.expiry === expiry)
2726
- // }
2727
- ,
2728
- onBlur: _this2.props.onBlur
2729
- }), /*#__PURE__*/React.createElement(Num, {
2925
+ },
2926
+ onBlur: _this2.props.onBlur,
2927
+ calcDisabled: function calcDisabled(option) {
2928
+ return !!_this2.value.find(function (vega) {
2929
+ return vega.expiry === option;
2930
+ });
2931
+ }
2932
+ })), /*#__PURE__*/React.createElement("div", {
2933
+ style: {
2934
+ width: 80
2935
+ }
2936
+ }, /*#__PURE__*/React.createElement(Num, {
2730
2937
  value: (_this2$props$value = _this2.props.value) === null || _this2$props$value === void 0 ? void 0 : (_this2$props$value$i = _this2$props$value[i]) === null || _this2$props$value$i === void 0 ? void 0 : _this2$props$value$i.vegaTarget,
2731
2938
  onChange: function onChange(val) {
2732
2939
  return _this2.onChange(i, val, 'vegaTarget');
@@ -2735,46 +2942,66 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2735
2942
  readonly: _this2.props.readonly,
2736
2943
  onBlur: _this2.props.onBlur,
2737
2944
  style: {
2738
- height: 30,
2739
- position: 'relative',
2740
- top: i > 0 ? -30 : 0
2945
+ height: 30
2946
+ },
2947
+ singleWidth: 50
2948
+ })), /*#__PURE__*/React.createElement("div", {
2949
+ style: {
2950
+ flex: 1,
2951
+ minWidth: 734
2741
2952
  }
2742
- }), /*#__PURE__*/React.createElement("div", {
2743
- className: "param-expiries-limit-inputs",
2953
+ }, /*#__PURE__*/React.createElement("div", {
2744
2954
  style: {
2745
- position: 'relative',
2746
- top: -30,
2747
- width: 734,
2748
- gridTemplateColumns: 'auto auto auto auto auto auto'
2955
+ display: 'flex',
2956
+ flexDirection: 'column',
2957
+ gap: 8
2749
2958
  }
2750
2959
  }, it.vegaRules.map(function (rule, k) {
2751
- return /*#__PURE__*/React.createElement(React.Fragment, null, i === 0 && k === 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2752
- className: "param-number-range readonly"
2753
- }, "Call/Put/Call"), /*#__PURE__*/React.createElement("div", {
2754
- className: "param-number-range readonly"
2755
- }, "Delta Range"), /*#__PURE__*/React.createElement("div", {
2756
- className: "param-number-range readonly"
2757
- }, "Bid Edge Range"), /*#__PURE__*/React.createElement("div", {
2758
- className: "param-number-range readonly"
2759
- }, "Ask Edge Range"), /*#__PURE__*/React.createElement("div", {
2760
- className: "param-number-range readonly"
2761
- }, "Allow Taker"), /*#__PURE__*/React.createElement("div", {
2762
- className: "param-number-range readonly"
2763
- }, "Disabled")) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(TextSelector, {
2960
+ var _it$vegaRules;
2961
+
2962
+ return /*#__PURE__*/React.createElement("div", {
2963
+ key: k,
2964
+ style: {
2965
+ display: 'flex',
2966
+ width: '100%',
2967
+ alignItems: 'center',
2968
+ gap: 8
2969
+ }
2970
+ }, /*#__PURE__*/React.createElement("div", {
2971
+ style: {
2972
+ display: 'flex',
2973
+ width: 120,
2974
+ height: 30,
2975
+ alignItems: 'center'
2976
+ }
2977
+ }, /*#__PURE__*/React.createElement("div", {
2978
+ className: "param-arr-ops",
2979
+ style: {
2980
+ visibility: k === ((_it$vegaRules = it.vegaRules) === null || _it$vegaRules === void 0 ? void 0 : _it$vegaRules.length) - 1 ? 'visible' : 'hidden'
2981
+ }
2982
+ }, /*#__PURE__*/React.createElement(PlusOutlined, {
2983
+ className: "param-arr-ops-add",
2984
+ onClick: _this2.onAddRule.bind(null, i, k),
2985
+ style: {
2986
+ width: 18
2987
+ }
2988
+ })), /*#__PURE__*/React.createElement(TextSelector, {
2764
2989
  style: {
2765
2990
  width: 88,
2766
- minWidth: 0,
2767
2991
  padding: '0 10px',
2768
- height: 30
2992
+ height: '30px !important'
2769
2993
  },
2770
2994
  multiple: false,
2771
2995
  value: [rule.optionType || ''],
2772
2996
  onChange: function onChange(val) {
2773
2997
  return _this2.onChange(i, val[0], 'vegaRules', k, 'optionType');
2774
- } // onBlur={this.props.onBlur}
2775
- ,
2998
+ },
2776
2999
  options: ['Both', 'Call', 'Put']
2777
- }), /*#__PURE__*/React.createElement(NumRange, {
3000
+ })), /*#__PURE__*/React.createElement("div", {
3001
+ style: {
3002
+ width: 160
3003
+ }
3004
+ }, /*#__PURE__*/React.createElement(NumRange, {
2778
3005
  value: {
2779
3006
  min: rule.deltaRange.min,
2780
3007
  max: rule.deltaRange.max
@@ -2782,32 +3009,41 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2782
3009
  onChange: function onChange(val) {
2783
3010
  return _this2.onChange(i, val, 'vegaRules', k, 'deltaRange');
2784
3011
  },
2785
- onBlur: _this2.props.onBlur
2786
- }), /*#__PURE__*/React.createElement(NumRange, {
3012
+ onBlur: _this2.props.onBlur,
3013
+ singleWidth: 50
3014
+ })), /*#__PURE__*/React.createElement("div", {
3015
+ style: {
3016
+ width: 210
3017
+ }
3018
+ }, /*#__PURE__*/React.createElement(NumRangeFromTo, {
2787
3019
  value: {
2788
- min: rule.bidEdgeRange.min,
2789
- max: rule.bidEdgeRange.max
3020
+ from: rule.bidEdgeSpan.from,
3021
+ to: rule.bidEdgeSpan.to
2790
3022
  },
2791
3023
  onChange: function onChange(val) {
2792
- return _this2.onChange(i, val, 'vegaRules', k, 'bidEdgeRange');
3024
+ return _this2.onChange(i, val, 'vegaRules', k, 'bidEdgeSpan');
2793
3025
  },
2794
3026
  isPercentage: true,
2795
3027
  onBlur: _this2.props.onBlur
2796
- }), /*#__PURE__*/React.createElement(NumRange, {
3028
+ })), /*#__PURE__*/React.createElement("div", {
3029
+ style: {
3030
+ width: 210
3031
+ }
3032
+ }, /*#__PURE__*/React.createElement(NumRangeFromTo, {
2797
3033
  value: {
2798
- min: rule.askEdgeRange.min,
2799
- max: rule.askEdgeRange.max
3034
+ from: rule.askEdgeSpan.from,
3035
+ to: rule.askEdgeSpan.to
2800
3036
  },
2801
3037
  onChange: function onChange(val) {
2802
- return _this2.onChange(i, val, 'vegaRules', k, 'askEdgeRange');
3038
+ return _this2.onChange(i, val, 'vegaRules', k, 'askEdgeSpan');
2803
3039
  },
2804
3040
  isPercentage: true,
2805
3041
  onBlur: _this2.props.onBlur
2806
- }), /*#__PURE__*/React.createElement("div", {
3042
+ })), /*#__PURE__*/React.createElement("div", {
2807
3043
  style: {
2808
- width: 74,
2809
- position: 'relative',
2810
- top: 4
3044
+ display: 'flex',
3045
+ justifyContent: 'center',
3046
+ width: 74
2811
3047
  }
2812
3048
  }, /*#__PURE__*/React.createElement(Checkbox, {
2813
3049
  checked: rule.allowTaker,
@@ -2816,33 +3052,40 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
2816
3052
  }
2817
3053
  })), /*#__PURE__*/React.createElement("div", {
2818
3054
  style: {
2819
- width: 74,
3055
+ display: 'flex',
3056
+ justifyContent: 'center',
2820
3057
  position: 'relative',
2821
- top: 4
3058
+ width: 60
2822
3059
  }
2823
3060
  }, /*#__PURE__*/React.createElement(Checkbox, {
2824
3061
  checked: rule.disable,
2825
3062
  onChange: function onChange(e) {
2826
3063
  return _this2.onChange(i, e.target.checked, 'vegaRules', k, 'disable');
2827
3064
  }
2828
- })));
2829
- })), /*#__PURE__*/React.createElement("div", {
2830
- className: "param-arr-ops"
2831
- }, /*#__PURE__*/React.createElement(PlusOutlined, {
2832
- className: "param-arr-ops-add",
2833
- onClick: _this2.onAdd.bind(null, i),
3065
+ }), /*#__PURE__*/React.createElement("div", {
3066
+ className: "param-arr-ops",
3067
+ style: {
3068
+ position: 'absolute',
3069
+ right: -80,
3070
+ top: -4,
3071
+ visibility: k === 0 ? 'hidden' : 'visible'
3072
+ }
3073
+ }, /*#__PURE__*/React.createElement(DeleteOutlined, {
3074
+ className: "param-arr-ops-del",
3075
+ onClick: _this2.onDelRule.bind(null, i, k)
3076
+ }))));
3077
+ }))), /*#__PURE__*/React.createElement("div", {
3078
+ className: "param-arr-ops",
2834
3079
  style: {
2835
- position: 'relative',
2836
- top: i > 0 ? -30 : 0
3080
+ width: 60
2837
3081
  }
3082
+ }, /*#__PURE__*/React.createElement(PlusOutlined, {
3083
+ className: "param-arr-ops-add",
3084
+ onClick: _this2.onAdd.bind(null, i)
2838
3085
  }), /*#__PURE__*/React.createElement(DeleteOutlined, {
2839
3086
  className: "param-arr-ops-del",
2840
- onClick: _this2.onDel.bind(null, i),
2841
- style: {
2842
- position: 'relative',
2843
- top: i > 0 ? -30 : 0
2844
- }
2845
- })));
3087
+ onClick: _this2.onDel.bind(null, i)
3088
+ }))));
2846
3089
  })));
2847
3090
  }
2848
3091
  }]);
@@ -2856,6 +3099,10 @@ function emptyErrText(index, key) {
2856
3099
  return "The ".concat(index + 1).concat(index === 0 ? 'st' : index === 1 ? 'nd' : index === 2 ? 'rd' : 'th', " item: ").concat(key ? key + ' ' : '', "should not be empty");
2857
3100
  }
2858
3101
 
3102
+ function zeroErrText(index, key, type, canZero) {
3103
+ return "The ".concat(index + 1).concat(index === 0 ? 'st' : index === 1 ? 'nd' : index === 2 ? 'rd' : 'th', " item: ").concat(key ? key + ' ' : '', "should be ").concat(type === 'min' ? canZero ? '<=' : '<' : canZero ? '>=' : '>', " 0");
3104
+ }
3105
+
2859
3106
  var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig, ParamType.ParamGroup, {
2860
3107
  name: '参数组',
2861
3108
  Comp: function Comp() {
@@ -3185,6 +3432,10 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
3185
3432
  return emptyErrText(i, 'vegaTarget');
3186
3433
  }
3187
3434
 
3435
+ if (Number(val.vegaTarget) === 0) {
3436
+ return "The ".concat(i + 1).concat(i === 0 ? 'st' : i === 1 ? 'nd' : i === 2 ? 'rd' : 'th', " item: vega target can not be 0");
3437
+ }
3438
+
3188
3439
  var $$val = val.vegaRules || [];
3189
3440
 
3190
3441
  for (var k = 0; k < $$val.length; k++) {
@@ -3198,24 +3449,75 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
3198
3449
  return emptyErrText(i, "delta range's min");
3199
3450
  }
3200
3451
 
3452
+ if (Number(vegaRule.deltaRange.min) < 0 || Number(vegaRule.deltaRange.min) > 1) {
3453
+ // return zeroErrText(i, "delta range's min", 'max', true);
3454
+ return "The ".concat(i + 1).concat(i === 0 ? 'st' : i === 1 ? 'nd' : i === 2 ? 'rd' : 'th', " item: delta range's min only support 0 ~ 1");
3455
+ }
3456
+
3201
3457
  if (isEmpty(vegaRule.deltaRange.max)) {
3202
3458
  return emptyErrText(i, "delta range's max");
3203
3459
  }
3204
3460
 
3205
- if (isEmpty(vegaRule.bidEdgeRange.min)) {
3206
- return emptyErrText(i, "bid edge range's min");
3461
+ if (Number(vegaRule.deltaRange.max) < 0 || Number(vegaRule.deltaRange.max) > 1) {
3462
+ // return zeroErrText(i, "delta range's max", 'max', true);
3463
+ return "The ".concat(i + 1).concat(i === 0 ? 'st' : i === 1 ? 'nd' : i === 2 ? 'rd' : 'th', " item: delta range's max only support 0 ~ 1");
3464
+ }
3465
+
3466
+ if (Number(vegaRule.deltaRange.max) <= Number(vegaRule.deltaRange.min)) {
3467
+ // return zeroErrText(i, "delta range's max", 'max', true);
3468
+ return "The ".concat(i + 1).concat(i === 0 ? 'st' : i === 1 ? 'nd' : i === 2 ? 'rd' : 'th', " item: delta range's max should be > min");
3469
+ }
3470
+
3471
+ if (isEmpty(vegaRule.bidEdgeSpan.from)) {
3472
+ return emptyErrText(i, "bid edge range's from");
3207
3473
  }
3208
3474
 
3209
- if (isEmpty(vegaRule.bidEdgeRange.max)) {
3210
- return emptyErrText(i, "bid edge range's max");
3475
+ if (isEmpty(vegaRule.bidEdgeSpan.to)) {
3476
+ return emptyErrText(i, "bid edge range's to");
3211
3477
  }
3212
3478
 
3213
- if (isEmpty(vegaRule.askEdgeRange.min)) {
3214
- return emptyErrText(i, "ask edge range's min");
3479
+ if (isEmpty(vegaRule.askEdgeSpan.from)) {
3480
+ return emptyErrText(i, "ask edge range's from");
3481
+ }
3482
+
3483
+ if (isEmpty(vegaRule.askEdgeSpan.to)) {
3484
+ return emptyErrText(i, "ask edge range's to");
3485
+ }
3486
+
3487
+ if (Number(val.vegaTarget) > 0) {
3488
+ if (Number(vegaRule.bidEdgeSpan.from) < 0) {
3489
+ return zeroErrText(i, "bid edge range's from", 'max', true);
3490
+ }
3491
+
3492
+ if (Number(vegaRule.bidEdgeSpan.to) < 0) {
3493
+ return zeroErrText(i, "bid edge range's to", 'max', true);
3494
+ }
3495
+
3496
+ if (Number(vegaRule.askEdgeSpan.from) < 0) {
3497
+ return zeroErrText(i, "ask edge range's from", 'max', true);
3498
+ }
3499
+
3500
+ if (Number(vegaRule.askEdgeSpan.to) < 0) {
3501
+ return zeroErrText(i, "ask edge range's to", 'max', true);
3502
+ }
3215
3503
  }
3216
3504
 
3217
- if (isEmpty(vegaRule.askEdgeRange.max)) {
3218
- return emptyErrText(i, "ask edge range's max");
3505
+ if (Number(val.vegaTarget) < 0) {
3506
+ if (Number(vegaRule.bidEdgeSpan.from) > 0) {
3507
+ return zeroErrText(i, "bid edge range's from", 'min', true);
3508
+ }
3509
+
3510
+ if (Number(vegaRule.bidEdgeSpan.to) > 0) {
3511
+ return zeroErrText(i, "bid edge range's to", 'min', true);
3512
+ }
3513
+
3514
+ if (Number(vegaRule.askEdgeSpan.from) > 0) {
3515
+ return zeroErrText(i, "ask edge range's from", 'min', true);
3516
+ }
3517
+
3518
+ if (Number(vegaRule.askEdgeSpan.to) > 0) {
3519
+ return zeroErrText(i, "ask edge range's to", 'min', true);
3520
+ }
3219
3521
  }
3220
3522
  } // if (expiries.includes(val.expiry)) {
3221
3523
  // return `The ${i + 1} ${
@@ -3226,13 +3528,15 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
3226
3528
  // }
3227
3529
 
3228
3530
 
3531
+ var hasOverRange = validateVegaRules($$val);
3532
+ if (!hasOverRange) return "The ".concat(i + 1).concat(i === 0 ? 'st' : i === 1 ? 'nd' : i === 2 ? 'rd' : 'th', " item: delta range overlap");
3229
3533
  expiries.push(val.expiry);
3230
3534
  }
3231
3535
 
3232
3536
  return '';
3233
3537
  },
3234
3538
  sort: 18,
3235
- modalWidth: 1280
3539
+ modalWidth: 1300
3236
3540
  }), _ParamTypeConfig);
3237
3541
  function paramValidator(val, values, enableEmpty) {
3238
3542
  var _config$validator;
@@ -3402,10 +3706,11 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
3402
3706
  (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, $data);
3403
3707
 
3404
3708
  if ('valueType' in changed) {
3405
- var _this$ref$current$get, _this$ref$current, _this$props$initialVa;
3709
+ var _this$ref$current$get, _this$ref$current, _this$props$initialVa, _this$props$onModalWi, _this$props2, _config$modalWidth;
3406
3710
 
3407
3711
  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');
3712
+ localStorage.setItem('__editParamModalWidth', config.modalWidth ? String(config.modalWidth) : '740');
3713
+ (_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
3714
 
3410
3715
  _this.forceUpdate();
3411
3716
  }
@@ -3424,7 +3729,6 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
3424
3729
 
3425
3730
  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
3731
  var config = ParamTypeConfig[valueType];
3427
- localStorage.setItem('__editParamModalWidth', String(config.modalWidth) || '0');
3428
3732
  return [{
3429
3733
  label: '所属分组',
3430
3734
  name: 'parentId',
@@ -3567,12 +3871,16 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
3567
3871
 
3568
3872
  _defineProperty(_assertThisInitialized(_this4), "state", {
3569
3873
  visible: false,
3570
- pending: false
3874
+ pending: false,
3875
+ width: 740
3571
3876
  });
3572
3877
 
3573
3878
  _defineProperty(_assertThisInitialized(_this4), "onShow", function () {
3879
+ var _this4$props$initialV, _ParamTypeConfig$_thi, _this4$props$initialV2;
3880
+
3574
3881
  return _this4.setState({
3575
- visible: true
3882
+ visible: true,
3883
+ 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
3576
3884
  });
3577
3885
  });
3578
3886
 
@@ -3604,7 +3912,11 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
3604
3912
  });
3605
3913
  });
3606
3914
 
3607
- _defineProperty(_assertThisInitialized(_this4), "width", localStorage.getItem('__editParamModalWidth'));
3915
+ _defineProperty(_assertThisInitialized(_this4), "handleModalWidthChange", function (width) {
3916
+ _this4.setState({
3917
+ width: width
3918
+ });
3919
+ });
3608
3920
 
3609
3921
  return _this4;
3610
3922
  }
@@ -3621,10 +3933,11 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
3621
3933
  value: function render() {
3622
3934
  return /*#__PURE__*/React.createElement(Modal, {
3623
3935
  key: String(this.state.visible),
3624
- width: Number(this.width) || 740,
3936
+ width: this.state.width || 740,
3625
3937
  closable: false,
3626
3938
  title: !this.isEdit ? '新增参数' : '修改参数',
3627
3939
  visible: this.state.visible,
3940
+ destroyOnClose: true,
3628
3941
  footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
3629
3942
  onClick: this.onHide
3630
3943
  }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
@@ -3634,7 +3947,8 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
3634
3947
  }, "\u786E\u8BA4"))
3635
3948
  }, /*#__PURE__*/React.createElement(ParamForm, Object.assign({}, this.props, {
3636
3949
  ref: this.ref,
3637
- onSubmit: undefined
3950
+ onSubmit: undefined,
3951
+ onModalWidthChange: this.handleModalWidthChange
3638
3952
  })));
3639
3953
  }
3640
3954
  }]);
@@ -3689,9 +4003,18 @@ var ParamValueEditor = /*#__PURE__*/function (_PureComponent) {
3689
4003
  _defineProperty(_assertThisInitialized(_this), "ref", React.createRef());
3690
4004
 
3691
4005
  _defineProperty(_assertThisInitialized(_this), "onChange", function (changed, data) {
3692
- var _this$props$onChange, _this$props;
4006
+ var _this$props$onChange, _this$props2;
3693
4007
 
3694
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, data);
4008
+ if ('valueType' in changed) {
4009
+ var _this$ref$current$get, _this$ref$current, _this$props$onModalWi, _this$props, _config$modalWidth;
4010
+
4011
+ 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];
4012
+ (_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);
4013
+
4014
+ _this.forceUpdate();
4015
+ }
4016
+
4017
+ (_this$props$onChange = (_this$props2 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props2, data);
3695
4018
  });
3696
4019
 
3697
4020
  return _this;
@@ -3819,12 +4142,14 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
3819
4142
 
3820
4143
  _defineProperty(_assertThisInitialized(_this3), "state", {
3821
4144
  visible: false,
3822
- pending: false
4145
+ pending: false,
4146
+ width: 740
3823
4147
  });
3824
4148
 
3825
4149
  _defineProperty(_assertThisInitialized(_this3), "onShow", function () {
3826
4150
  return _this3.setState({
3827
- visible: true
4151
+ visible: true,
4152
+ width: ParamTypeConfig[_this3.props.valueType].modalWidth || 740
3828
4153
  });
3829
4154
  });
3830
4155
 
@@ -3856,6 +4181,12 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
3856
4181
  });
3857
4182
  });
3858
4183
 
4184
+ _defineProperty(_assertThisInitialized(_this3), "handleModalWidthChange", function (width) {
4185
+ _this3.setState({
4186
+ width: width
4187
+ });
4188
+ });
4189
+
3859
4190
  return _this3;
3860
4191
  }
3861
4192
 
@@ -3864,10 +4195,11 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
3864
4195
  value: function render() {
3865
4196
  return /*#__PURE__*/React.createElement(Modal, {
3866
4197
  key: String(this.state.visible),
3867
- width: 740,
4198
+ width: this.state.width,
3868
4199
  title: 'Edit Value',
3869
4200
  closable: false,
3870
4201
  visible: this.state.visible,
4202
+ destroyOnClose: true,
3871
4203
  footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
3872
4204
  onClick: this.onHide
3873
4205
  }, "Cancel"), /*#__PURE__*/React.createElement(Button, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalplus/params-about",
3
- "version": "1.0.27-alpha",
3
+ "version": "1.0.28-alpha",
4
4
  "description": "A description for the module",
5
5
  "main": "./lib/umd/index.js",
6
6
  "module": "./lib/es/index.js",
@@ -89,5 +89,8 @@
89
89
  "dayjs": "^1.11.0",
90
90
  "lodash-es": "^4.17.21",
91
91
  "react-global-comp": "^2.0.1"
92
+ },
93
+ "dependencies": {
94
+ "@signalplus/params-about": "1.0.26-alpha18"
92
95
  }
93
96
  }