@signalplus/params-about 1.0.26-alpha2 → 1.0.26-alpha20
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 +6 -1
- package/lib/es/index.js +483 -159
- 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:
|
|
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-
|
|
4
|
-
* Version: 1.0.26-
|
|
3
|
+
* Generated: 2025-11-07
|
|
4
|
+
* Version: 1.0.26-alpha20
|
|
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
|
}]);
|
|
@@ -2504,6 +2506,118 @@ var TenorBucketHandlerList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2504
2506
|
return TenorBucketHandlerList;
|
|
2505
2507
|
}(PureComponent);
|
|
2506
2508
|
|
|
2509
|
+
var NumRangeFromTo = /*#__PURE__*/function (_PureComponent) {
|
|
2510
|
+
_inherits(NumRangeFromTo, _PureComponent);
|
|
2511
|
+
|
|
2512
|
+
var _super = _createSuper(NumRangeFromTo);
|
|
2513
|
+
|
|
2514
|
+
function NumRangeFromTo() {
|
|
2515
|
+
var _this;
|
|
2516
|
+
|
|
2517
|
+
_classCallCheck(this, NumRangeFromTo);
|
|
2518
|
+
|
|
2519
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2520
|
+
args[_key] = arguments[_key];
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2524
|
+
|
|
2525
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (key, val) {
|
|
2526
|
+
var _this$props$onChange, _this$props;
|
|
2527
|
+
|
|
2528
|
+
var value = _objectSpread2({}, _this.props.value);
|
|
2529
|
+
|
|
2530
|
+
value[key] = val;
|
|
2531
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
|
|
2532
|
+
});
|
|
2533
|
+
|
|
2534
|
+
return _this;
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
_createClass(NumRangeFromTo, [{
|
|
2538
|
+
key: "render",
|
|
2539
|
+
value: function render() {
|
|
2540
|
+
var _this$props$value, _this$props$value2;
|
|
2541
|
+
|
|
2542
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2543
|
+
className: classNames('param-number-range', {
|
|
2544
|
+
readonly: this.props.readonly
|
|
2545
|
+
}, this.props.className),
|
|
2546
|
+
style: this.props.style
|
|
2547
|
+
}, this.props.readonly ? '(' : '', /*#__PURE__*/React.createElement(Num, {
|
|
2548
|
+
placeholder: 'From',
|
|
2549
|
+
value: (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.from,
|
|
2550
|
+
onChange: this.onChange.bind(null, 'from'),
|
|
2551
|
+
isPercentage: this.props.isPercentage,
|
|
2552
|
+
readonly: this.props.readonly,
|
|
2553
|
+
onBlur: this.props.onBlur
|
|
2554
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
2555
|
+
className: "param-number-range-sep",
|
|
2556
|
+
style: this.props.readonly ? {
|
|
2557
|
+
marginLeft: 0,
|
|
2558
|
+
marginRight: 4
|
|
2559
|
+
} : undefined
|
|
2560
|
+
}, this.props.readonly ? ',' : '~'), /*#__PURE__*/React.createElement(Num, {
|
|
2561
|
+
placeholder: 'To',
|
|
2562
|
+
value: (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.to,
|
|
2563
|
+
onChange: this.onChange.bind(null, 'to'),
|
|
2564
|
+
isPercentage: this.props.isPercentage,
|
|
2565
|
+
readonly: this.props.readonly,
|
|
2566
|
+
onBlur: this.props.onBlur
|
|
2567
|
+
}), this.props.readonly ? ')' : '');
|
|
2568
|
+
}
|
|
2569
|
+
}]);
|
|
2570
|
+
|
|
2571
|
+
return NumRangeFromTo;
|
|
2572
|
+
}(PureComponent);
|
|
2573
|
+
|
|
2574
|
+
function hasRangeOverlap(range1, range2) {
|
|
2575
|
+
var _range1$min, _range1$max, _range2$min, _range2$max;
|
|
2576
|
+
|
|
2577
|
+
var min1 = (_range1$min = range1.min) !== null && _range1$min !== void 0 ? _range1$min : -Infinity;
|
|
2578
|
+
var max1 = (_range1$max = range1.max) !== null && _range1$max !== void 0 ? _range1$max : Infinity;
|
|
2579
|
+
var min2 = (_range2$min = range2.min) !== null && _range2$min !== void 0 ? _range2$min : -Infinity;
|
|
2580
|
+
var max2 = (_range2$max = range2.max) !== null && _range2$max !== void 0 ? _range2$max : Infinity; // 边界相等不算重叠,所以用严格比较
|
|
2581
|
+
|
|
2582
|
+
return min1 < max2 && min2 < max1;
|
|
2583
|
+
}
|
|
2584
|
+
/**
|
|
2585
|
+
* 检查VegaRules数组是否合法
|
|
2586
|
+
*/
|
|
2587
|
+
|
|
2588
|
+
|
|
2589
|
+
function validateVegaRules(rules) {
|
|
2590
|
+
for (var i = 0; i < rules.length; i++) {
|
|
2591
|
+
var _currentRule$optionTy;
|
|
2592
|
+
|
|
2593
|
+
var currentRule = rules[i];
|
|
2594
|
+
var currentType = (_currentRule$optionTy = currentRule.optionType) !== null && _currentRule$optionTy !== void 0 ? _currentRule$optionTy : 'Both'; // 默认按Both处理
|
|
2595
|
+
|
|
2596
|
+
for (var j = i + 1; j < rules.length; j++) {
|
|
2597
|
+
var _compareRule$optionTy;
|
|
2598
|
+
|
|
2599
|
+
var compareRule = rules[j];
|
|
2600
|
+
var compareType = (_compareRule$optionTy = compareRule.optionType) !== null && _compareRule$optionTy !== void 0 ? _compareRule$optionTy : 'Both'; // 检查是否需要比较这两个规则
|
|
2601
|
+
|
|
2602
|
+
var shouldCompare = false;
|
|
2603
|
+
|
|
2604
|
+
if (currentType === 'Both' || compareType === 'Both') {
|
|
2605
|
+
// 任意一个是Both,就需要比较
|
|
2606
|
+
shouldCompare = true;
|
|
2607
|
+
} else if (currentType === compareType) {
|
|
2608
|
+
// 类型相同(都是Call或都是Put),需要比较
|
|
2609
|
+
shouldCompare = true;
|
|
2610
|
+
} // 类型不同(一个Call一个Put),不需要比较
|
|
2611
|
+
|
|
2612
|
+
|
|
2613
|
+
if (shouldCompare && hasRangeOverlap(currentRule.deltaRange, compareRule.deltaRange)) {
|
|
2614
|
+
return false; // 发现重叠,不合法
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
return true; // 没有发现重叠,合法
|
|
2620
|
+
}
|
|
2507
2621
|
var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
2508
2622
|
_inherits(ExpiryVegaAlphaByEdgeList, _PureComponent);
|
|
2509
2623
|
|
|
@@ -2526,7 +2640,7 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2526
2640
|
var _item$vegaRules, _item$expiry;
|
|
2527
2641
|
|
|
2528
2642
|
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.
|
|
2643
|
+
return it.deltaRange.min || it.deltaRange.max || it.bidEdgeSpan.from || it.bidEdgeSpan.to || it.askEdgeSpan.from || it.askEdgeSpan.to;
|
|
2530
2644
|
}) : true;
|
|
2531
2645
|
return !((_item$expiry = item.expiry) === null || _item$expiry === void 0 ? void 0 : _item$expiry.trim()) && !item.vegaTarget && !!vegaRulesValid;
|
|
2532
2646
|
});
|
|
@@ -2545,13 +2659,13 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2545
2659
|
min: undefined,
|
|
2546
2660
|
max: undefined
|
|
2547
2661
|
},
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2662
|
+
bidEdgeSpan: {
|
|
2663
|
+
from: undefined,
|
|
2664
|
+
to: undefined
|
|
2551
2665
|
},
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2666
|
+
askEdgeSpan: {
|
|
2667
|
+
from: undefined,
|
|
2668
|
+
to: undefined
|
|
2555
2669
|
},
|
|
2556
2670
|
allowTaker: false,
|
|
2557
2671
|
disable: false
|
|
@@ -2560,38 +2674,38 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2560
2674
|
|
|
2561
2675
|
if (key) {
|
|
2562
2676
|
if (subKey && typeof k === 'number') {
|
|
2563
|
-
if (subKey === 'optionType') {
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2677
|
+
// if (subKey === 'optionType') {
|
|
2678
|
+
// // console.log('changeValue==========================', value, i, val, key, k, subKey);
|
|
2679
|
+
// if (val === 'Both') {
|
|
2680
|
+
// value[i].vegaRules = [{ ...value[i].vegaRules[k], optionType: 'Both' }];
|
|
2681
|
+
// } else {
|
|
2682
|
+
// if (value[i].vegaRules?.length <= 1)
|
|
2683
|
+
// value[i].vegaRules = [
|
|
2684
|
+
// { ...value[i].vegaRules[k], optionType: val },
|
|
2685
|
+
// {
|
|
2686
|
+
// optionType: val === 'Call' ? 'Put' : 'Call',
|
|
2687
|
+
// deltaRange: {
|
|
2688
|
+
// min: undefined,
|
|
2689
|
+
// max: undefined,
|
|
2690
|
+
// },
|
|
2691
|
+
// bidEdgeSpan: {
|
|
2692
|
+
// from: undefined,
|
|
2693
|
+
// to: undefined,
|
|
2694
|
+
// },
|
|
2695
|
+
// askEdgeSpan: {
|
|
2696
|
+
// from: undefined,
|
|
2697
|
+
// to: undefined,
|
|
2698
|
+
// },
|
|
2699
|
+
// allowTaker: false,
|
|
2700
|
+
// disable: false,
|
|
2701
|
+
// },
|
|
2702
|
+
// ];
|
|
2703
|
+
// else value[i].vegaRules[k][subKey] = val as never;
|
|
2704
|
+
// }
|
|
2705
|
+
// } else {
|
|
2706
|
+
// value[i].vegaRules[k][subKey] = val as never;
|
|
2707
|
+
// }
|
|
2708
|
+
value[i].vegaRules[k][subKey] = val;
|
|
2595
2709
|
} else {
|
|
2596
2710
|
value[i][key] = val;
|
|
2597
2711
|
}
|
|
@@ -2616,13 +2730,13 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2616
2730
|
min: undefined,
|
|
2617
2731
|
max: undefined
|
|
2618
2732
|
},
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2733
|
+
bidEdgeSpan: {
|
|
2734
|
+
from: undefined,
|
|
2735
|
+
to: undefined
|
|
2622
2736
|
},
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2737
|
+
askEdgeSpan: {
|
|
2738
|
+
from: undefined,
|
|
2739
|
+
to: undefined
|
|
2626
2740
|
},
|
|
2627
2741
|
allowTaker: false,
|
|
2628
2742
|
disable: false
|
|
@@ -2632,16 +2746,52 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2632
2746
|
(_this$props$onBlur = (_this$props3 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props3);
|
|
2633
2747
|
});
|
|
2634
2748
|
|
|
2635
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
2749
|
+
_defineProperty(_assertThisInitialized(_this), "onAddRule", function (i, k) {
|
|
2636
2750
|
var _this$props$onChange3, _this$props4, _this$props$onBlur2, _this$props5;
|
|
2637
2751
|
|
|
2638
2752
|
var value = _toConsumableArray(_this.value);
|
|
2639
2753
|
|
|
2640
|
-
value.splice(
|
|
2641
|
-
|
|
2754
|
+
value[i].vegaRules.splice(k + 1, 0, {
|
|
2755
|
+
optionType: undefined,
|
|
2756
|
+
deltaRange: {
|
|
2757
|
+
min: undefined,
|
|
2758
|
+
max: undefined
|
|
2759
|
+
},
|
|
2760
|
+
bidEdgeSpan: {
|
|
2761
|
+
from: undefined,
|
|
2762
|
+
to: undefined
|
|
2763
|
+
},
|
|
2764
|
+
askEdgeSpan: {
|
|
2765
|
+
from: undefined,
|
|
2766
|
+
to: undefined
|
|
2767
|
+
},
|
|
2768
|
+
allowTaker: false,
|
|
2769
|
+
disable: false
|
|
2770
|
+
});
|
|
2771
|
+
(_this$props$onChange3 = (_this$props4 = _this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props4, value);
|
|
2642
2772
|
(_this$props$onBlur2 = (_this$props5 = _this.props).onBlur) === null || _this$props$onBlur2 === void 0 ? void 0 : _this$props$onBlur2.call(_this$props5);
|
|
2643
2773
|
});
|
|
2644
2774
|
|
|
2775
|
+
_defineProperty(_assertThisInitialized(_this), "onDel", function (i) {
|
|
2776
|
+
var _this$props$onChange4, _this$props6, _this$props$onBlur3, _this$props7;
|
|
2777
|
+
|
|
2778
|
+
var value = _toConsumableArray(_this.value);
|
|
2779
|
+
|
|
2780
|
+
value.splice(i, 1);
|
|
2781
|
+
(_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);
|
|
2782
|
+
(_this$props$onBlur3 = (_this$props7 = _this.props).onBlur) === null || _this$props$onBlur3 === void 0 ? void 0 : _this$props$onBlur3.call(_this$props7);
|
|
2783
|
+
});
|
|
2784
|
+
|
|
2785
|
+
_defineProperty(_assertThisInitialized(_this), "onDelRule", function (i, k) {
|
|
2786
|
+
var _this$props$onChange5, _this$props8, _this$props$onBlur4, _this$props9;
|
|
2787
|
+
|
|
2788
|
+
var value = _toConsumableArray(_this.value);
|
|
2789
|
+
|
|
2790
|
+
value[i].vegaRules.splice(k, 1);
|
|
2791
|
+
(_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);
|
|
2792
|
+
(_this$props$onBlur4 = (_this$props9 = _this.props).onBlur) === null || _this$props$onBlur4 === void 0 ? void 0 : _this$props$onBlur4.call(_this$props9);
|
|
2793
|
+
});
|
|
2794
|
+
|
|
2645
2795
|
return _this;
|
|
2646
2796
|
}
|
|
2647
2797
|
|
|
@@ -2664,13 +2814,13 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2664
2814
|
min: undefined,
|
|
2665
2815
|
max: undefined
|
|
2666
2816
|
},
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2817
|
+
bidEdgeSpan: {
|
|
2818
|
+
from: undefined,
|
|
2819
|
+
to: undefined
|
|
2670
2820
|
},
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2821
|
+
askEdgeSpan: {
|
|
2822
|
+
from: undefined,
|
|
2823
|
+
to: undefined
|
|
2674
2824
|
},
|
|
2675
2825
|
allowTaker: false,
|
|
2676
2826
|
disable: false
|
|
@@ -2689,44 +2839,98 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2689
2839
|
}, it.expiry, /*#__PURE__*/React.createElement("span", null, "/"), !isNullLike(it.vegaTarget) ? it.vegaTarget : '-', /*#__PURE__*/React.createElement("span", null, "/"), it.vegaRules.map(function ($it, $i) {
|
|
2690
2840
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
2691
2841
|
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.
|
|
2842
|
+
}, !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
2843
|
})), /*#__PURE__*/React.createElement("br", null));
|
|
2694
2844
|
}) : '-' : /*#__PURE__*/React.createElement("div", {
|
|
2695
2845
|
className: "param-expiries-limit-inputs",
|
|
2696
2846
|
style: {
|
|
2697
|
-
|
|
2847
|
+
display: 'flex',
|
|
2848
|
+
flexDirection: 'column',
|
|
2849
|
+
width: 1150
|
|
2698
2850
|
}
|
|
2699
2851
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2700
|
-
|
|
2852
|
+
style: {
|
|
2853
|
+
display: 'flex',
|
|
2854
|
+
width: '100%',
|
|
2855
|
+
gap: 8
|
|
2856
|
+
}
|
|
2857
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2858
|
+
style: {
|
|
2859
|
+
width: 100
|
|
2860
|
+
}
|
|
2701
2861
|
}, "Expiry"), /*#__PURE__*/React.createElement("div", {
|
|
2702
|
-
|
|
2862
|
+
style: {
|
|
2863
|
+
width: 80
|
|
2864
|
+
}
|
|
2703
2865
|
}, "Vega Target"), /*#__PURE__*/React.createElement("div", {
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2866
|
+
style: {
|
|
2867
|
+
width: 120,
|
|
2868
|
+
paddingLeft: 18
|
|
2869
|
+
}
|
|
2870
|
+
}, "Both/Call/Put"), /*#__PURE__*/React.createElement("div", {
|
|
2871
|
+
style: {
|
|
2872
|
+
width: 160
|
|
2873
|
+
}
|
|
2874
|
+
}, "Delta Range"), /*#__PURE__*/React.createElement("div", {
|
|
2875
|
+
style: {
|
|
2876
|
+
width: 210
|
|
2877
|
+
}
|
|
2878
|
+
}, "Bid Edge Range"), /*#__PURE__*/React.createElement("div", {
|
|
2879
|
+
style: {
|
|
2880
|
+
width: 210
|
|
2881
|
+
}
|
|
2882
|
+
}, "Ask Edge Range"), /*#__PURE__*/React.createElement("div", {
|
|
2883
|
+
style: {
|
|
2884
|
+
width: 74
|
|
2885
|
+
}
|
|
2886
|
+
}, "Allow Taker"), /*#__PURE__*/React.createElement("div", {
|
|
2887
|
+
style: {
|
|
2888
|
+
width: 60
|
|
2889
|
+
}
|
|
2890
|
+
}, "Disable")), this.value.map(function (it, i) {
|
|
2708
2891
|
var _this2$props$value, _this2$props$value$i;
|
|
2709
2892
|
|
|
2710
|
-
return /*#__PURE__*/React.createElement(
|
|
2711
|
-
key: i
|
|
2893
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2894
|
+
key: i,
|
|
2895
|
+
style: {
|
|
2896
|
+
display: 'flex',
|
|
2897
|
+
flexDirection: 'column',
|
|
2898
|
+
width: '100%'
|
|
2899
|
+
}
|
|
2900
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2901
|
+
style: {
|
|
2902
|
+
display: 'flex',
|
|
2903
|
+
width: '100%',
|
|
2904
|
+
alignItems: 'flex-start',
|
|
2905
|
+
gap: 8
|
|
2906
|
+
}
|
|
2907
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2908
|
+
style: {
|
|
2909
|
+
width: 100,
|
|
2910
|
+
marginRight: 0
|
|
2911
|
+
}
|
|
2712
2912
|
}, /*#__PURE__*/React.createElement(Expiries, {
|
|
2713
2913
|
style: {
|
|
2714
|
-
width:
|
|
2715
|
-
minWidth: 0
|
|
2716
|
-
position: 'relative',
|
|
2717
|
-
top: i > 0 ? -30 : 0
|
|
2914
|
+
width: 100,
|
|
2915
|
+
minWidth: 0
|
|
2718
2916
|
},
|
|
2719
2917
|
multiple: false,
|
|
2720
2918
|
options: _this2.props.options,
|
|
2721
2919
|
value: [it.expiry || ''],
|
|
2722
2920
|
onChange: function onChange(val) {
|
|
2723
2921
|
return _this2.onChange(i, val[0], 'expiry');
|
|
2724
|
-
}
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2922
|
+
},
|
|
2923
|
+
onBlur: _this2.props.onBlur,
|
|
2924
|
+
calcDisabled: function calcDisabled(option) {
|
|
2925
|
+
return !!_this2.value.find(function (vega) {
|
|
2926
|
+
return vega.expiry === option;
|
|
2927
|
+
});
|
|
2928
|
+
}
|
|
2929
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
2930
|
+
style: {
|
|
2931
|
+
width: 80
|
|
2932
|
+
}
|
|
2933
|
+
}, /*#__PURE__*/React.createElement(Num, {
|
|
2730
2934
|
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
2935
|
onChange: function onChange(val) {
|
|
2732
2936
|
return _this2.onChange(i, val, 'vegaTarget');
|
|
@@ -2735,46 +2939,66 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2735
2939
|
readonly: _this2.props.readonly,
|
|
2736
2940
|
onBlur: _this2.props.onBlur,
|
|
2737
2941
|
style: {
|
|
2738
|
-
height: 30
|
|
2739
|
-
|
|
2740
|
-
|
|
2942
|
+
height: 30
|
|
2943
|
+
},
|
|
2944
|
+
singleWidth: 50
|
|
2945
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
2946
|
+
style: {
|
|
2947
|
+
flex: 1,
|
|
2948
|
+
minWidth: 734
|
|
2741
2949
|
}
|
|
2742
|
-
}
|
|
2743
|
-
className: "param-expiries-limit-inputs",
|
|
2950
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2744
2951
|
style: {
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
gridTemplateColumns: 'auto auto auto auto auto auto'
|
|
2952
|
+
display: 'flex',
|
|
2953
|
+
flexDirection: 'column',
|
|
2954
|
+
gap: 8
|
|
2749
2955
|
}
|
|
2750
2956
|
}, it.vegaRules.map(function (rule, k) {
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
},
|
|
2762
|
-
|
|
2763
|
-
|
|
2957
|
+
var _it$vegaRules;
|
|
2958
|
+
|
|
2959
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2960
|
+
key: k,
|
|
2961
|
+
style: {
|
|
2962
|
+
display: 'flex',
|
|
2963
|
+
width: '100%',
|
|
2964
|
+
alignItems: 'center',
|
|
2965
|
+
gap: 8
|
|
2966
|
+
}
|
|
2967
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2968
|
+
style: {
|
|
2969
|
+
display: 'flex',
|
|
2970
|
+
width: 120,
|
|
2971
|
+
height: 30,
|
|
2972
|
+
alignItems: 'center'
|
|
2973
|
+
}
|
|
2974
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2975
|
+
className: "param-arr-ops",
|
|
2976
|
+
style: {
|
|
2977
|
+
visibility: k === ((_it$vegaRules = it.vegaRules) === null || _it$vegaRules === void 0 ? void 0 : _it$vegaRules.length) - 1 ? 'visible' : 'hidden'
|
|
2978
|
+
}
|
|
2979
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, {
|
|
2980
|
+
className: "param-arr-ops-add",
|
|
2981
|
+
onClick: _this2.onAddRule.bind(null, i, k),
|
|
2982
|
+
style: {
|
|
2983
|
+
width: 18
|
|
2984
|
+
}
|
|
2985
|
+
})), /*#__PURE__*/React.createElement(TextSelector, {
|
|
2764
2986
|
style: {
|
|
2765
2987
|
width: 88,
|
|
2766
|
-
minWidth: 0,
|
|
2767
2988
|
padding: '0 10px',
|
|
2768
|
-
height:
|
|
2989
|
+
height: '30px !important'
|
|
2769
2990
|
},
|
|
2770
2991
|
multiple: false,
|
|
2771
2992
|
value: [rule.optionType || ''],
|
|
2772
2993
|
onChange: function onChange(val) {
|
|
2773
2994
|
return _this2.onChange(i, val[0], 'vegaRules', k, 'optionType');
|
|
2774
|
-
}
|
|
2775
|
-
,
|
|
2995
|
+
},
|
|
2776
2996
|
options: ['Both', 'Call', 'Put']
|
|
2777
|
-
}), /*#__PURE__*/React.createElement(
|
|
2997
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
2998
|
+
style: {
|
|
2999
|
+
width: 160
|
|
3000
|
+
}
|
|
3001
|
+
}, /*#__PURE__*/React.createElement(NumRange, {
|
|
2778
3002
|
value: {
|
|
2779
3003
|
min: rule.deltaRange.min,
|
|
2780
3004
|
max: rule.deltaRange.max
|
|
@@ -2782,32 +3006,41 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2782
3006
|
onChange: function onChange(val) {
|
|
2783
3007
|
return _this2.onChange(i, val, 'vegaRules', k, 'deltaRange');
|
|
2784
3008
|
},
|
|
2785
|
-
onBlur: _this2.props.onBlur
|
|
2786
|
-
|
|
3009
|
+
onBlur: _this2.props.onBlur,
|
|
3010
|
+
singleWidth: 50
|
|
3011
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
3012
|
+
style: {
|
|
3013
|
+
width: 210
|
|
3014
|
+
}
|
|
3015
|
+
}, /*#__PURE__*/React.createElement(NumRangeFromTo, {
|
|
2787
3016
|
value: {
|
|
2788
|
-
|
|
2789
|
-
|
|
3017
|
+
from: rule.bidEdgeSpan.from,
|
|
3018
|
+
to: rule.bidEdgeSpan.to
|
|
2790
3019
|
},
|
|
2791
3020
|
onChange: function onChange(val) {
|
|
2792
|
-
return _this2.onChange(i, val, 'vegaRules', k, '
|
|
3021
|
+
return _this2.onChange(i, val, 'vegaRules', k, 'bidEdgeSpan');
|
|
2793
3022
|
},
|
|
2794
3023
|
isPercentage: true,
|
|
2795
3024
|
onBlur: _this2.props.onBlur
|
|
2796
|
-
}), /*#__PURE__*/React.createElement(
|
|
3025
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
3026
|
+
style: {
|
|
3027
|
+
width: 210
|
|
3028
|
+
}
|
|
3029
|
+
}, /*#__PURE__*/React.createElement(NumRangeFromTo, {
|
|
2797
3030
|
value: {
|
|
2798
|
-
|
|
2799
|
-
|
|
3031
|
+
from: rule.askEdgeSpan.from,
|
|
3032
|
+
to: rule.askEdgeSpan.to
|
|
2800
3033
|
},
|
|
2801
3034
|
onChange: function onChange(val) {
|
|
2802
|
-
return _this2.onChange(i, val, 'vegaRules', k, '
|
|
3035
|
+
return _this2.onChange(i, val, 'vegaRules', k, 'askEdgeSpan');
|
|
2803
3036
|
},
|
|
2804
3037
|
isPercentage: true,
|
|
2805
3038
|
onBlur: _this2.props.onBlur
|
|
2806
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
3039
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
2807
3040
|
style: {
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
3041
|
+
display: 'flex',
|
|
3042
|
+
justifyContent: 'center',
|
|
3043
|
+
width: 74
|
|
2811
3044
|
}
|
|
2812
3045
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
2813
3046
|
checked: rule.allowTaker,
|
|
@@ -2816,33 +3049,40 @@ var ExpiryVegaAlphaByEdgeList = /*#__PURE__*/function (_PureComponent) {
|
|
|
2816
3049
|
}
|
|
2817
3050
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2818
3051
|
style: {
|
|
2819
|
-
|
|
3052
|
+
display: 'flex',
|
|
3053
|
+
justifyContent: 'center',
|
|
2820
3054
|
position: 'relative',
|
|
2821
|
-
|
|
3055
|
+
width: 60
|
|
2822
3056
|
}
|
|
2823
3057
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
2824
3058
|
checked: rule.disable,
|
|
2825
3059
|
onChange: function onChange(e) {
|
|
2826
3060
|
return _this2.onChange(i, e.target.checked, 'vegaRules', k, 'disable');
|
|
2827
3061
|
}
|
|
2828
|
-
})
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
3062
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
3063
|
+
className: "param-arr-ops",
|
|
3064
|
+
style: {
|
|
3065
|
+
position: 'absolute',
|
|
3066
|
+
right: -80,
|
|
3067
|
+
top: -4,
|
|
3068
|
+
visibility: k === 0 ? 'hidden' : 'visible'
|
|
3069
|
+
}
|
|
3070
|
+
}, /*#__PURE__*/React.createElement(DeleteOutlined, {
|
|
3071
|
+
className: "param-arr-ops-del",
|
|
3072
|
+
onClick: _this2.onDelRule.bind(null, i, k)
|
|
3073
|
+
}))));
|
|
3074
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
3075
|
+
className: "param-arr-ops",
|
|
2834
3076
|
style: {
|
|
2835
|
-
|
|
2836
|
-
top: i > 0 ? -30 : 0
|
|
3077
|
+
width: 60
|
|
2837
3078
|
}
|
|
3079
|
+
}, /*#__PURE__*/React.createElement(PlusOutlined, {
|
|
3080
|
+
className: "param-arr-ops-add",
|
|
3081
|
+
onClick: _this2.onAdd.bind(null, i)
|
|
2838
3082
|
}), /*#__PURE__*/React.createElement(DeleteOutlined, {
|
|
2839
3083
|
className: "param-arr-ops-del",
|
|
2840
|
-
onClick: _this2.onDel.bind(null, i)
|
|
2841
|
-
|
|
2842
|
-
position: 'relative',
|
|
2843
|
-
top: i > 0 ? -30 : 0
|
|
2844
|
-
}
|
|
2845
|
-
})));
|
|
3084
|
+
onClick: _this2.onDel.bind(null, i)
|
|
3085
|
+
}))));
|
|
2846
3086
|
})));
|
|
2847
3087
|
}
|
|
2848
3088
|
}]);
|
|
@@ -2856,6 +3096,10 @@ function emptyErrText(index, key) {
|
|
|
2856
3096
|
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
3097
|
}
|
|
2858
3098
|
|
|
3099
|
+
function zeroErrText(index, key, type, canZero) {
|
|
3100
|
+
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");
|
|
3101
|
+
}
|
|
3102
|
+
|
|
2859
3103
|
var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig, ParamType.ParamGroup, {
|
|
2860
3104
|
name: '参数组',
|
|
2861
3105
|
Comp: function Comp() {
|
|
@@ -3185,6 +3429,10 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
|
|
|
3185
3429
|
return emptyErrText(i, 'vegaTarget');
|
|
3186
3430
|
}
|
|
3187
3431
|
|
|
3432
|
+
if (Number(val.vegaTarget) === 0) {
|
|
3433
|
+
return "The ".concat(i + 1).concat(i === 0 ? 'st' : i === 1 ? 'nd' : i === 2 ? 'rd' : 'th', " item: vega target can not be 0");
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3188
3436
|
var $$val = val.vegaRules || [];
|
|
3189
3437
|
|
|
3190
3438
|
for (var k = 0; k < $$val.length; k++) {
|
|
@@ -3198,24 +3446,70 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
|
|
|
3198
3446
|
return emptyErrText(i, "delta range's min");
|
|
3199
3447
|
}
|
|
3200
3448
|
|
|
3449
|
+
if (Number(vegaRule.deltaRange.min) < 0 || Number(vegaRule.deltaRange.min) > 1) {
|
|
3450
|
+
// return zeroErrText(i, "delta range's min", 'max', true);
|
|
3451
|
+
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");
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3201
3454
|
if (isEmpty(vegaRule.deltaRange.max)) {
|
|
3202
3455
|
return emptyErrText(i, "delta range's max");
|
|
3203
3456
|
}
|
|
3204
3457
|
|
|
3205
|
-
if (
|
|
3206
|
-
return
|
|
3458
|
+
if (Number(vegaRule.deltaRange.max) < 0 || Number(vegaRule.deltaRange.max) > 1) {
|
|
3459
|
+
// return zeroErrText(i, "delta range's max", 'max', true);
|
|
3460
|
+
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");
|
|
3461
|
+
}
|
|
3462
|
+
|
|
3463
|
+
if (isEmpty(vegaRule.bidEdgeSpan.from)) {
|
|
3464
|
+
return emptyErrText(i, "bid edge range's from");
|
|
3207
3465
|
}
|
|
3208
3466
|
|
|
3209
|
-
if (isEmpty(vegaRule.
|
|
3210
|
-
return emptyErrText(i, "bid edge range's
|
|
3467
|
+
if (isEmpty(vegaRule.bidEdgeSpan.to)) {
|
|
3468
|
+
return emptyErrText(i, "bid edge range's to");
|
|
3211
3469
|
}
|
|
3212
3470
|
|
|
3213
|
-
if (isEmpty(vegaRule.
|
|
3214
|
-
return emptyErrText(i, "ask edge range's
|
|
3471
|
+
if (isEmpty(vegaRule.askEdgeSpan.from)) {
|
|
3472
|
+
return emptyErrText(i, "ask edge range's from");
|
|
3215
3473
|
}
|
|
3216
3474
|
|
|
3217
|
-
if (isEmpty(vegaRule.
|
|
3218
|
-
return emptyErrText(i, "ask edge range's
|
|
3475
|
+
if (isEmpty(vegaRule.askEdgeSpan.to)) {
|
|
3476
|
+
return emptyErrText(i, "ask edge range's to");
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
if (Number(val.vegaTarget) > 0) {
|
|
3480
|
+
if (Number(vegaRule.bidEdgeSpan.from) < 0) {
|
|
3481
|
+
return zeroErrText(i, "bid edge range's from", 'max');
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3484
|
+
if (Number(vegaRule.bidEdgeSpan.to) < 0) {
|
|
3485
|
+
return zeroErrText(i, "bid edge range's to", 'max');
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
if (Number(vegaRule.askEdgeSpan.from) < 0) {
|
|
3489
|
+
return zeroErrText(i, "ask edge range's from", 'max');
|
|
3490
|
+
}
|
|
3491
|
+
|
|
3492
|
+
if (Number(vegaRule.askEdgeSpan.to) < 0) {
|
|
3493
|
+
return zeroErrText(i, "ask edge range's to", 'max');
|
|
3494
|
+
}
|
|
3495
|
+
}
|
|
3496
|
+
|
|
3497
|
+
if (Number(val.vegaTarget) < 0) {
|
|
3498
|
+
if (Number(vegaRule.bidEdgeSpan.from) > 0) {
|
|
3499
|
+
return zeroErrText(i, "bid edge range's from", 'min');
|
|
3500
|
+
}
|
|
3501
|
+
|
|
3502
|
+
if (Number(vegaRule.bidEdgeSpan.to) > 0) {
|
|
3503
|
+
return zeroErrText(i, "bid edge range's to", 'min');
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
if (Number(vegaRule.askEdgeSpan.from) > 0) {
|
|
3507
|
+
return zeroErrText(i, "ask edge range's from", 'min');
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3510
|
+
if (Number(vegaRule.askEdgeSpan.to) > 0) {
|
|
3511
|
+
return zeroErrText(i, "ask edge range's to", 'min');
|
|
3512
|
+
}
|
|
3219
3513
|
}
|
|
3220
3514
|
} // if (expiries.includes(val.expiry)) {
|
|
3221
3515
|
// return `The ${i + 1} ${
|
|
@@ -3226,13 +3520,15 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
|
|
|
3226
3520
|
// }
|
|
3227
3521
|
|
|
3228
3522
|
|
|
3523
|
+
var hasOverRange = validateVegaRules($$val);
|
|
3524
|
+
if (!hasOverRange) return "The ".concat(i + 1).concat(i === 0 ? 'st' : i === 1 ? 'nd' : i === 2 ? 'rd' : 'th', " item: delta range overlap");
|
|
3229
3525
|
expiries.push(val.expiry);
|
|
3230
3526
|
}
|
|
3231
3527
|
|
|
3232
3528
|
return '';
|
|
3233
3529
|
},
|
|
3234
3530
|
sort: 18,
|
|
3235
|
-
modalWidth:
|
|
3531
|
+
modalWidth: 1300
|
|
3236
3532
|
}), _ParamTypeConfig);
|
|
3237
3533
|
function paramValidator(val, values, enableEmpty) {
|
|
3238
3534
|
var _config$validator;
|
|
@@ -3402,10 +3698,11 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
3402
3698
|
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, $data);
|
|
3403
3699
|
|
|
3404
3700
|
if ('valueType' in changed) {
|
|
3405
|
-
var _this$ref$current$get, _this$ref$current, _this$props$initialVa;
|
|
3701
|
+
var _this$ref$current$get, _this$ref$current, _this$props$initialVa, _this$props$onModalWi, _this$props2, _config$modalWidth;
|
|
3406
3702
|
|
|
3407
3703
|
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)
|
|
3704
|
+
localStorage.setItem('__editParamModalWidth', config.modalWidth ? String(config.modalWidth) : '740');
|
|
3705
|
+
(_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
3706
|
|
|
3410
3707
|
_this.forceUpdate();
|
|
3411
3708
|
}
|
|
@@ -3424,7 +3721,6 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
3424
3721
|
|
|
3425
3722
|
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
3723
|
var config = ParamTypeConfig[valueType];
|
|
3427
|
-
localStorage.setItem('__editParamModalWidth', String(config.modalWidth) || '0');
|
|
3428
3724
|
return [{
|
|
3429
3725
|
label: '所属分组',
|
|
3430
3726
|
name: 'parentId',
|
|
@@ -3567,12 +3863,16 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
3567
3863
|
|
|
3568
3864
|
_defineProperty(_assertThisInitialized(_this4), "state", {
|
|
3569
3865
|
visible: false,
|
|
3570
|
-
pending: false
|
|
3866
|
+
pending: false,
|
|
3867
|
+
width: 740
|
|
3571
3868
|
});
|
|
3572
3869
|
|
|
3573
3870
|
_defineProperty(_assertThisInitialized(_this4), "onShow", function () {
|
|
3871
|
+
var _this4$props$initialV, _ParamTypeConfig$_thi, _this4$props$initialV2;
|
|
3872
|
+
|
|
3574
3873
|
return _this4.setState({
|
|
3575
|
-
visible: true
|
|
3874
|
+
visible: true,
|
|
3875
|
+
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
3876
|
});
|
|
3577
3877
|
});
|
|
3578
3878
|
|
|
@@ -3604,7 +3904,11 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
3604
3904
|
});
|
|
3605
3905
|
});
|
|
3606
3906
|
|
|
3607
|
-
_defineProperty(_assertThisInitialized(_this4), "
|
|
3907
|
+
_defineProperty(_assertThisInitialized(_this4), "handleModalWidthChange", function (width) {
|
|
3908
|
+
_this4.setState({
|
|
3909
|
+
width: width
|
|
3910
|
+
});
|
|
3911
|
+
});
|
|
3608
3912
|
|
|
3609
3913
|
return _this4;
|
|
3610
3914
|
}
|
|
@@ -3621,10 +3925,11 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
3621
3925
|
value: function render() {
|
|
3622
3926
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
3623
3927
|
key: String(this.state.visible),
|
|
3624
|
-
width:
|
|
3928
|
+
width: this.state.width || 740,
|
|
3625
3929
|
closable: false,
|
|
3626
3930
|
title: !this.isEdit ? '新增参数' : '修改参数',
|
|
3627
3931
|
visible: this.state.visible,
|
|
3932
|
+
destroyOnClose: true,
|
|
3628
3933
|
footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
3629
3934
|
onClick: this.onHide
|
|
3630
3935
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -3634,7 +3939,8 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
3634
3939
|
}, "\u786E\u8BA4"))
|
|
3635
3940
|
}, /*#__PURE__*/React.createElement(ParamForm, Object.assign({}, this.props, {
|
|
3636
3941
|
ref: this.ref,
|
|
3637
|
-
onSubmit: undefined
|
|
3942
|
+
onSubmit: undefined,
|
|
3943
|
+
onModalWidthChange: this.handleModalWidthChange
|
|
3638
3944
|
})));
|
|
3639
3945
|
}
|
|
3640
3946
|
}]);
|
|
@@ -3689,9 +3995,18 @@ var ParamValueEditor = /*#__PURE__*/function (_PureComponent) {
|
|
|
3689
3995
|
_defineProperty(_assertThisInitialized(_this), "ref", React.createRef());
|
|
3690
3996
|
|
|
3691
3997
|
_defineProperty(_assertThisInitialized(_this), "onChange", function (changed, data) {
|
|
3692
|
-
var _this$props$onChange, _this$
|
|
3998
|
+
var _this$props$onChange, _this$props2;
|
|
3693
3999
|
|
|
3694
|
-
|
|
4000
|
+
if ('valueType' in changed) {
|
|
4001
|
+
var _this$ref$current$get, _this$ref$current, _this$props$onModalWi, _this$props, _config$modalWidth;
|
|
4002
|
+
|
|
4003
|
+
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];
|
|
4004
|
+
(_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);
|
|
4005
|
+
|
|
4006
|
+
_this.forceUpdate();
|
|
4007
|
+
}
|
|
4008
|
+
|
|
4009
|
+
(_this$props$onChange = (_this$props2 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props2, data);
|
|
3695
4010
|
});
|
|
3696
4011
|
|
|
3697
4012
|
return _this;
|
|
@@ -3819,12 +4134,14 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
3819
4134
|
|
|
3820
4135
|
_defineProperty(_assertThisInitialized(_this3), "state", {
|
|
3821
4136
|
visible: false,
|
|
3822
|
-
pending: false
|
|
4137
|
+
pending: false,
|
|
4138
|
+
width: 740
|
|
3823
4139
|
});
|
|
3824
4140
|
|
|
3825
4141
|
_defineProperty(_assertThisInitialized(_this3), "onShow", function () {
|
|
3826
4142
|
return _this3.setState({
|
|
3827
|
-
visible: true
|
|
4143
|
+
visible: true,
|
|
4144
|
+
width: ParamTypeConfig[_this3.props.valueType].modalWidth || 740
|
|
3828
4145
|
});
|
|
3829
4146
|
});
|
|
3830
4147
|
|
|
@@ -3856,6 +4173,12 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
3856
4173
|
});
|
|
3857
4174
|
});
|
|
3858
4175
|
|
|
4176
|
+
_defineProperty(_assertThisInitialized(_this3), "handleModalWidthChange", function (width) {
|
|
4177
|
+
_this3.setState({
|
|
4178
|
+
width: width
|
|
4179
|
+
});
|
|
4180
|
+
});
|
|
4181
|
+
|
|
3859
4182
|
return _this3;
|
|
3860
4183
|
}
|
|
3861
4184
|
|
|
@@ -3864,10 +4187,11 @@ var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
3864
4187
|
value: function render() {
|
|
3865
4188
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
3866
4189
|
key: String(this.state.visible),
|
|
3867
|
-
width:
|
|
4190
|
+
width: this.state.width,
|
|
3868
4191
|
title: 'Edit Value',
|
|
3869
4192
|
closable: false,
|
|
3870
4193
|
visible: this.state.visible,
|
|
4194
|
+
destroyOnClose: true,
|
|
3871
4195
|
footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
3872
4196
|
onClick: this.onHide
|
|
3873
4197
|
}, "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.26-
|
|
3
|
+
"version": "1.0.26-alpha20",
|
|
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
|
}
|