@orderly.network/ui-order-entry 2.8.8-alpha.0 → 2.8.9-alpha.0

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/dist/index.js CHANGED
@@ -3838,7 +3838,7 @@ var OrderTPSL = (props) => {
3838
3838
  setOrderValue: props.setOrderValue,
3839
3839
  onChange: props.onChange,
3840
3840
  values: props.values,
3841
- errors: isSlPriceWarning ? {} : props.errors,
3841
+ errors: props.errors,
3842
3842
  quote_dp: props.quote_dp,
3843
3843
  showTPSLAdvanced: props.showTPSLAdvanced,
3844
3844
  isMobile,
@@ -3905,7 +3905,8 @@ var TPSLInputForm = React3__default.default.forwardRef((props, ref) => {
3905
3905
  TPSLInputRow,
3906
3906
  {
3907
3907
  type: "SL",
3908
- error: getErrorMsg("sl_trigger_price"),
3908
+ error: props.isSlPriceWarning ? void 0 : getErrorMsg("sl_trigger_price"),
3909
+ displayErrorMessage: getErrorMsg("sl_trigger_price") !== void 0,
3909
3910
  onChange: props.onChange,
3910
3911
  values: props.values.sl,
3911
3912
  quote_dp: props.quote_dp,
@@ -3975,12 +3976,18 @@ var TPSLTriggerPriceInput = (props) => {
3975
3976
  setInnerValue(props.values.trigger_price ?? "");
3976
3977
  }, [props.values.trigger_price, isFocused]);
3977
3978
  const triggerPriceToolTipEle = React3.useMemo(() => {
3978
- if (props.error && errorMsgVisible)
3979
+ if (props.error && (errorMsgVisible || props.displayErrorMessage))
3979
3980
  return props.error;
3980
3981
  if (tipVisible)
3981
3982
  return tipsEle;
3982
3983
  return null;
3983
- }, [props.error, errorMsgVisible, tipVisible, tipsEle]);
3984
+ }, [
3985
+ props.error,
3986
+ errorMsgVisible,
3987
+ tipVisible,
3988
+ tipsEle,
3989
+ props.displayErrorMessage
3990
+ ]);
3984
3991
  const getPrefixLabel = (trigger_price) => {
3985
3992
  let _prefix = props.type === "TP" ? t("tpsl.tpPrice") : t("tpsl.slPrice");
3986
3993
  if (trigger_price) {
@@ -4056,6 +4063,7 @@ var TPSLInputRow = (props) => {
4056
4063
  testId: props.testIds?.first,
4057
4064
  type: props.type,
4058
4065
  error: props.error,
4066
+ displayErrorMessage: props.displayErrorMessage,
4059
4067
  values: props.values ?? "",
4060
4068
  classNames: props.classNames,
4061
4069
  onChange: (event) => {
@@ -4134,7 +4142,6 @@ var OrderEntry = (props) => {
4134
4142
  });
4135
4143
  const { notification } = hooks.useOrderlyContext();
4136
4144
  const soundAlertId = React3.useId();
4137
- const isSlPriceWarning = props.slPriceError?.sl_trigger_price?.type === hooks.ERROR_MSG_CODES.SL_PRICE_WARNING;
4138
4145
  const { getErrorMsg } = reactApp.useOrderEntryFormErrorMsg(validated ? errors : null);
4139
4146
  const buttonLabel = React3.useMemo(() => {
4140
4147
  return side === types.OrderSide.BUY ? t("orderEntry.buyLong") : t("orderEntry.sellShort");
@@ -4456,7 +4463,7 @@ var OrderEntry = (props) => {
4456
4463
  switchState: props.tpslSwitch,
4457
4464
  onSwitchChanged: props.setTpslSwitch,
4458
4465
  orderType: formattedOrder.order_type,
4459
- errors: validated || isSlPriceWarning ? { ...errors, ...props.slPriceError } : null,
4466
+ errors: validated || props.slPriceError !== void 0 ? { ...errors, ...props.slPriceError } : null,
4460
4467
  setOrderValue,
4461
4468
  reduceOnlyChecked: formattedOrder.reduce_only ?? false,
4462
4469
  onReduceOnlyChange: (checked) => {