@orderly.network/ui-tradingview 2.10.2 → 3.0.0-beta.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.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +178 -103
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +180 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
package/dist/index.d.mts
CHANGED
|
@@ -15535,6 +15535,8 @@ declare const TradingviewWidget: React$1.ForwardRefExoticComponent<TradingviewWi
|
|
|
15535
15535
|
|
|
15536
15536
|
declare const TradingviewUI: React__default.ForwardRefExoticComponent<TradingviewUIPropsInterface & React__default.RefAttributes<HTMLDivElement>>;
|
|
15537
15537
|
|
|
15538
|
+
declare const InjectableTradingviewDesktop: React$1.ComponentType<TradingviewUIPropsInterface>;
|
|
15539
|
+
|
|
15538
15540
|
declare function useTradingviewScript(props: TradingviewWidgetPropsInterface): {
|
|
15539
15541
|
tradingViewScriptSrc: string | undefined;
|
|
15540
15542
|
chartRef: React$1.RefObject<HTMLDivElement>;
|
|
@@ -15555,4 +15557,4 @@ declare function useTradingviewScript(props: TradingviewWidgetPropsInterface): {
|
|
|
15555
15557
|
fullscreen: any;
|
|
15556
15558
|
};
|
|
15557
15559
|
|
|
15558
|
-
export { type DisplayControlSettingInterface, type TradingviewLocaleCode, TradingviewUI, type TradingviewUIPropsInterface, TradingviewWidget, type TradingviewWidgetPropsInterface, useTradingviewScript };
|
|
15560
|
+
export { type DisplayControlSettingInterface, InjectableTradingviewDesktop, type TradingviewLocaleCode, TradingviewUI, type TradingviewUIPropsInterface, TradingviewWidget, type TradingviewWidgetPropsInterface, useTradingviewScript };
|
package/dist/index.d.ts
CHANGED
|
@@ -15535,6 +15535,8 @@ declare const TradingviewWidget: React$1.ForwardRefExoticComponent<TradingviewWi
|
|
|
15535
15535
|
|
|
15536
15536
|
declare const TradingviewUI: React__default.ForwardRefExoticComponent<TradingviewUIPropsInterface & React__default.RefAttributes<HTMLDivElement>>;
|
|
15537
15537
|
|
|
15538
|
+
declare const InjectableTradingviewDesktop: React$1.ComponentType<TradingviewUIPropsInterface>;
|
|
15539
|
+
|
|
15538
15540
|
declare function useTradingviewScript(props: TradingviewWidgetPropsInterface): {
|
|
15539
15541
|
tradingViewScriptSrc: string | undefined;
|
|
15540
15542
|
chartRef: React$1.RefObject<HTMLDivElement>;
|
|
@@ -15555,4 +15557,4 @@ declare function useTradingviewScript(props: TradingviewWidgetPropsInterface): {
|
|
|
15555
15557
|
fullscreen: any;
|
|
15556
15558
|
};
|
|
15557
15559
|
|
|
15558
|
-
export { type DisplayControlSettingInterface, type TradingviewLocaleCode, TradingviewUI, type TradingviewUIPropsInterface, TradingviewWidget, type TradingviewWidgetPropsInterface, useTradingviewScript };
|
|
15560
|
+
export { type DisplayControlSettingInterface, InjectableTradingviewDesktop, type TradingviewLocaleCode, TradingviewUI, type TradingviewUIPropsInterface, TradingviewWidget, type TradingviewWidgetPropsInterface, useTradingviewScript };
|
package/dist/index.js
CHANGED
|
@@ -2495,7 +2495,8 @@ function useEditOrder(onToast) {
|
|
|
2495
2495
|
order_type: order.type,
|
|
2496
2496
|
side: order.side,
|
|
2497
2497
|
visible_quantity: 0,
|
|
2498
|
-
reduce_only: order.reduce_only
|
|
2498
|
+
reduce_only: order.reduce_only,
|
|
2499
|
+
margin_mode: order.margin_mode
|
|
2499
2500
|
};
|
|
2500
2501
|
if (new utils.Decimal(order.visible_quantity ?? order.visible ?? 0).eq(
|
|
2501
2502
|
order.quantity
|
|
@@ -2921,7 +2922,10 @@ var _OrderLineService = class _OrderLineService {
|
|
|
2921
2922
|
this.cleanOldPendingOrders(this.pendingOrders);
|
|
2922
2923
|
this.tpslCalService.prepareTpslPnlMap(this.pendingOrders);
|
|
2923
2924
|
this.tpslCalService.prepareQuantityTpslNoMap(this.pendingOrders);
|
|
2924
|
-
this.pendingOrders.
|
|
2925
|
+
const needDrawMarginMode = this.pendingOrders.length > 1;
|
|
2926
|
+
this.pendingOrders.forEach(
|
|
2927
|
+
(order) => this.renderPendingOrder(order, needDrawMarginMode)
|
|
2928
|
+
);
|
|
2925
2929
|
}
|
|
2926
2930
|
updatePositions(positions) {
|
|
2927
2931
|
const changed = this.tpslCalService.recalculatePnl(
|
|
@@ -2930,12 +2934,12 @@ var _OrderLineService = class _OrderLineService {
|
|
|
2930
2934
|
);
|
|
2931
2935
|
this.pendingOrders.filter((order) => changed.includes(getOrderId(order))).forEach((order) => this.renderPendingOrder(order));
|
|
2932
2936
|
}
|
|
2933
|
-
renderPendingOrder(order) {
|
|
2937
|
+
renderPendingOrder(order, needDrawMarginMode = false) {
|
|
2934
2938
|
const orderId = _OrderLineService.getOrderId(order);
|
|
2935
2939
|
if (!orderId) {
|
|
2936
2940
|
return;
|
|
2937
2941
|
}
|
|
2938
|
-
const orderLine = this.drawOrderLine(orderId, order);
|
|
2942
|
+
const orderLine = this.drawOrderLine(orderId, order, needDrawMarginMode);
|
|
2939
2943
|
if (orderLine) {
|
|
2940
2944
|
this.pendingOrderLineMap.set(orderId, orderLine);
|
|
2941
2945
|
}
|
|
@@ -3073,8 +3077,8 @@ var _OrderLineService = class _OrderLineService {
|
|
|
3073
3077
|
}
|
|
3074
3078
|
return utils.commify(new utils.Decimal(pendingOrder.quantity).toString());
|
|
3075
3079
|
}
|
|
3076
|
-
drawOrderLine(orderId, pendingOrder) {
|
|
3077
|
-
|
|
3080
|
+
drawOrderLine(orderId, pendingOrder, needDrawMarginMode = false) {
|
|
3081
|
+
let text = isTpslOrder(pendingOrder) ? this.getTPSLText(pendingOrder) : _OrderLineService.getText(pendingOrder);
|
|
3078
3082
|
if (text === null) {
|
|
3079
3083
|
return null;
|
|
3080
3084
|
}
|
|
@@ -3099,7 +3103,10 @@ var _OrderLineService = class _OrderLineService {
|
|
|
3099
3103
|
const lineLength = 100;
|
|
3100
3104
|
const quantity = this.getOrderQuantity(pendingOrder);
|
|
3101
3105
|
const textColor = colorConfig.textColor;
|
|
3102
|
-
|
|
3106
|
+
if (needDrawMarginMode) {
|
|
3107
|
+
text += ` (${pendingOrder.margin_mode === "ISOLATED" ? "Isolated" : "Cross"})`;
|
|
3108
|
+
}
|
|
3109
|
+
orderLine.setText(text).setCancelButtonIconColor(colorConfig.closeIcon).setCancelButtonBorderColor(color).setBodyTextColor(textColor).setBodyBorderColor(borderColor).setQuantityBorderColor(borderColor).setQuantityTextColor(color).setLineColor(color).setLineLength(lineLength).setQuantity(quantity).setPrice(price);
|
|
3103
3110
|
if (this.broker.mode !== 3 /* MOBILE */) {
|
|
3104
3111
|
orderLine.onCancel(null, () => this.broker.cancelOrder(pendingOrder));
|
|
3105
3112
|
this.applyEditOnMove(orderLine, pendingOrder);
|
|
@@ -3169,7 +3176,10 @@ var PositionLineService = class _PositionLineService {
|
|
|
3169
3176
|
this.removePositions();
|
|
3170
3177
|
this.currentSymbol = positions[0].symbol;
|
|
3171
3178
|
}
|
|
3172
|
-
|
|
3179
|
+
const needDrawMarginMode = positions.length > 1;
|
|
3180
|
+
positions.forEach(
|
|
3181
|
+
(position, idx) => this.drawPositionLine(position, idx, needDrawMarginMode)
|
|
3182
|
+
);
|
|
3173
3183
|
this.lastPositions = positions;
|
|
3174
3184
|
}
|
|
3175
3185
|
getBasePositionLine() {
|
|
@@ -3209,7 +3219,7 @@ var PositionLineService = class _PositionLineService {
|
|
|
3209
3219
|
delete this.positionLines[Number(lineId)];
|
|
3210
3220
|
});
|
|
3211
3221
|
}
|
|
3212
|
-
drawPositionLine(position, idx) {
|
|
3222
|
+
drawPositionLine(position, idx, needDrawMarginMode = false) {
|
|
3213
3223
|
const colorConfig = this.broker.colorConfig;
|
|
3214
3224
|
const isPositiveBalance = position.balance >= 0;
|
|
3215
3225
|
const pnlDecimal = new utils.Decimal(position.unrealPnl);
|
|
@@ -3224,22 +3234,24 @@ var PositionLineService = class _PositionLineService {
|
|
|
3224
3234
|
const sideColor = isPositiveBalance ? colorConfig.upColor : colorConfig.downColor;
|
|
3225
3235
|
const price = new utils.Decimal(position.open).toNumber();
|
|
3226
3236
|
this.positionLines[idx] = this.positionLines[idx] ?? this.getBasePositionLine();
|
|
3227
|
-
let
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
position.unrealPnlDecimal
|
|
3231
|
-
)
|
|
3237
|
+
let text = _PositionLineService.getPositionPnL(
|
|
3238
|
+
position.unrealPnl,
|
|
3239
|
+
position.unrealPnlDecimal
|
|
3232
3240
|
);
|
|
3241
|
+
const quantity = _PositionLineService.getPositionQuantity(position.balance);
|
|
3242
|
+
if (needDrawMarginMode) {
|
|
3243
|
+
text += ` (${position.marginMode === "ISOLATED" ? "Isolated" : "Cross"})`;
|
|
3244
|
+
}
|
|
3245
|
+
const line = this.positionLines[idx].setQuantity(quantity).setPrice(price).setCloseButtonIconColor(colorConfig.closeIcon).setCloseButtonBorderColor(sideColor).setBodyBackgroundColor(pnlColor).setQuantityTextColor(sideColor).setBodyBorderColor(pnlColor).setLineColor(sideColor).setQuantityBorderColor(sideColor).setText(text);
|
|
3233
3246
|
if (colorConfig.closeIcon) {
|
|
3234
|
-
line
|
|
3247
|
+
line.setCloseButtonIconColor(colorConfig.closeIcon);
|
|
3235
3248
|
}
|
|
3236
3249
|
if (sideColor) {
|
|
3237
|
-
line
|
|
3250
|
+
line.setCloseButtonBorderColor(sideColor).setQuantityTextColor(sideColor).setLineColor(sideColor).setQuantityBorderColor(sideColor);
|
|
3238
3251
|
}
|
|
3239
3252
|
if (pnlColor) {
|
|
3240
|
-
line
|
|
3253
|
+
line.setBodyBackgroundColor(pnlColor).setBodyBorderColor(pnlColor);
|
|
3241
3254
|
}
|
|
3242
|
-
this.positionLines[idx] = line;
|
|
3243
3255
|
if (this.broker.mode !== 3 /* MOBILE */) {
|
|
3244
3256
|
this.positionLines[idx].onClose(null, () => {
|
|
3245
3257
|
this.broker.closePosition(position);
|
|
@@ -3593,14 +3605,20 @@ var Renderer = class {
|
|
|
3593
3605
|
};
|
|
3594
3606
|
|
|
3595
3607
|
// src/tradingviewAdapter/hooks/useCreateRenderer.ts
|
|
3596
|
-
function useCreateRenderer(symbol, displayControlSetting) {
|
|
3608
|
+
function useCreateRenderer(symbol, displayControlSetting, marginMode) {
|
|
3597
3609
|
const [renderer, setRenderer] = React3.useState();
|
|
3598
3610
|
const rendererRef = React3.useRef();
|
|
3599
3611
|
const { state } = hooks.useAccount();
|
|
3600
3612
|
const [unPnlPriceBasis] = hooks.useLocalStorage("unPnlPriceBasis", "markPrice");
|
|
3601
|
-
const [{ rows
|
|
3613
|
+
const [{ rows }, positionsInfo] = hooks.usePositionStream(symbol, {
|
|
3602
3614
|
calcMode: unPnlPriceBasis
|
|
3603
3615
|
});
|
|
3616
|
+
const positions = React3.useMemo(() => {
|
|
3617
|
+
if (!rows?.length) return [];
|
|
3618
|
+
return rows.filter(
|
|
3619
|
+
(item) => item.symbol === symbol && (marginMode == null || item.margin_mode === marginMode)
|
|
3620
|
+
);
|
|
3621
|
+
}, [rows, symbol, marginMode]);
|
|
3604
3622
|
const [pendingOrders] = hooks.useOrderStream({
|
|
3605
3623
|
status: types.OrderStatus.INCOMPLETE,
|
|
3606
3624
|
symbol
|
|
@@ -3639,7 +3657,7 @@ function useCreateRenderer(symbol, displayControlSetting) {
|
|
|
3639
3657
|
renderer?.renderPositions([]);
|
|
3640
3658
|
return;
|
|
3641
3659
|
}
|
|
3642
|
-
const positionList =
|
|
3660
|
+
const positionList = positions.map((item) => {
|
|
3643
3661
|
return {
|
|
3644
3662
|
symbol: item.symbol,
|
|
3645
3663
|
open: item.average_open_price,
|
|
@@ -3650,7 +3668,7 @@ function useCreateRenderer(symbol, displayControlSetting) {
|
|
|
3650
3668
|
interest: 0,
|
|
3651
3669
|
unrealPnlDecimal: 2,
|
|
3652
3670
|
basePriceDecimal: 4,
|
|
3653
|
-
|
|
3671
|
+
marginMode: item.margin_mode
|
|
3654
3672
|
};
|
|
3655
3673
|
});
|
|
3656
3674
|
renderer?.renderPositions(positionList);
|
|
@@ -3705,9 +3723,7 @@ function useCreateRenderer(symbol, displayControlSetting) {
|
|
|
3705
3723
|
renderer?.renderPendingOrders([]);
|
|
3706
3724
|
return;
|
|
3707
3725
|
}
|
|
3708
|
-
const symbolPosition = (
|
|
3709
|
-
(item) => item.symbol === symbol
|
|
3710
|
-
);
|
|
3726
|
+
const symbolPosition = positions.find((item) => item.symbol === symbol);
|
|
3711
3727
|
pendingOrders?.forEach((order) => {
|
|
3712
3728
|
if (symbol !== order.symbol) {
|
|
3713
3729
|
return;
|
|
@@ -4290,6 +4306,7 @@ function useTradingviewScript(props) {
|
|
|
4290
4306
|
watchOrderbook: true
|
|
4291
4307
|
}
|
|
4292
4308
|
);
|
|
4309
|
+
const { marginMode } = hooks.useMarginModeBySymbol(symbol ?? "");
|
|
4293
4310
|
const [displayControlState, setDisplayControlState] = React3.useState(() => {
|
|
4294
4311
|
const displaySettingInfo = localStorage.getItem(
|
|
4295
4312
|
TradingViewSDKLocalstorageKey.displayControlSetting
|
|
@@ -4380,7 +4397,8 @@ function useTradingviewScript(props) {
|
|
|
4380
4397
|
});
|
|
4381
4398
|
const [createRenderer, removeRenderer] = useCreateRenderer(
|
|
4382
4399
|
symbol,
|
|
4383
|
-
displayControlState
|
|
4400
|
+
displayControlState,
|
|
4401
|
+
marginMode
|
|
4384
4402
|
);
|
|
4385
4403
|
const onFullScreenChange = () => {
|
|
4386
4404
|
if (fullscreen) {
|
|
@@ -4662,9 +4680,25 @@ var NoTradingview = () => {
|
|
|
4662
4680
|
] }) });
|
|
4663
4681
|
};
|
|
4664
4682
|
var TopBar = (props) => {
|
|
4665
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "top-toolbar oui-flex oui-h-[44px] oui-justify-between md:oui-justify-start oui-items-center oui-p-2 md:oui-px-3 md:oui-pt-3 md:oui-pb-[14px]", children: props.children });
|
|
4683
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "top-toolbar oui-flex oui-h-[44px] oui-justify-between md:oui-justify-start oui-items-center oui-p-2 md:oui-px-3 md:oui-pt-3 md:oui-pb-[14px] oui-w-full", children: props.children });
|
|
4666
4684
|
};
|
|
4667
4685
|
var topBar_default = TopBar;
|
|
4686
|
+
var TradingviewChart = ({ chartRef }) => {
|
|
4687
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4688
|
+
"div",
|
|
4689
|
+
{
|
|
4690
|
+
"data-testid": "tradingview-chart",
|
|
4691
|
+
ref: chartRef,
|
|
4692
|
+
className: "oui-size-full oui-overflow-hidden"
|
|
4693
|
+
}
|
|
4694
|
+
);
|
|
4695
|
+
};
|
|
4696
|
+
|
|
4697
|
+
// src/components/tradingview.injectable.tsx
|
|
4698
|
+
var InjectableTradingviewDesktop = ui.injectable(
|
|
4699
|
+
TradingviewChart,
|
|
4700
|
+
"TradingView.Desktop"
|
|
4701
|
+
);
|
|
4668
4702
|
var LazyLineType = React3__default.default.lazy(() => Promise.resolve().then(() => (init_lineType(), lineType_exports)));
|
|
4669
4703
|
var LazyTimeInterval = React3__default.default.lazy(
|
|
4670
4704
|
() => Promise.resolve().then(() => (init_timeInterval(), timeInterval_exports)).then((mod) => ({ default: mod.TimeInterval }))
|
|
@@ -4679,6 +4713,98 @@ var LazyDesktopDisplayControl = React3__default.default.lazy(
|
|
|
4679
4713
|
default: mod.DesktopDisplayControl
|
|
4680
4714
|
}))
|
|
4681
4715
|
);
|
|
4716
|
+
var MobileTopBar = ({
|
|
4717
|
+
interval,
|
|
4718
|
+
changeInterval,
|
|
4719
|
+
displayControlState,
|
|
4720
|
+
changeDisplaySetting,
|
|
4721
|
+
openChartIndicators
|
|
4722
|
+
}) => {
|
|
4723
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4724
|
+
ui.Flex,
|
|
4725
|
+
{
|
|
4726
|
+
gapX: 2,
|
|
4727
|
+
width: "100%",
|
|
4728
|
+
justify: "between",
|
|
4729
|
+
className: "oui-hide-scrollbar oui-overflow-x-scroll",
|
|
4730
|
+
children: [
|
|
4731
|
+
/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4732
|
+
LazyTimeInterval,
|
|
4733
|
+
{
|
|
4734
|
+
interval: interval ?? "15",
|
|
4735
|
+
changeInterval
|
|
4736
|
+
}
|
|
4737
|
+
) }),
|
|
4738
|
+
/* @__PURE__ */ jsxRuntime.jsx(OperateButton, { onClick: openChartIndicators, children: /* @__PURE__ */ jsxRuntime.jsx(IndicatorsIcon, {}) }),
|
|
4739
|
+
/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4740
|
+
LazyMobileDisplayControl,
|
|
4741
|
+
{
|
|
4742
|
+
displayControlState,
|
|
4743
|
+
changeDisplayControlState: changeDisplaySetting
|
|
4744
|
+
}
|
|
4745
|
+
) })
|
|
4746
|
+
]
|
|
4747
|
+
}
|
|
4748
|
+
);
|
|
4749
|
+
};
|
|
4750
|
+
var DesktopTopBar = ({
|
|
4751
|
+
interval,
|
|
4752
|
+
changeInterval,
|
|
4753
|
+
displayControlState,
|
|
4754
|
+
changeDisplaySetting,
|
|
4755
|
+
openChartIndicators,
|
|
4756
|
+
lineType,
|
|
4757
|
+
changeLineType,
|
|
4758
|
+
openChartSetting,
|
|
4759
|
+
fullscreen,
|
|
4760
|
+
onFullScreenChange
|
|
4761
|
+
}) => {
|
|
4762
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { justify: "between", itemAlign: "center", width: "100%", children: [
|
|
4763
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { children: [
|
|
4764
|
+
/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4765
|
+
LazyTimeInterval,
|
|
4766
|
+
{
|
|
4767
|
+
interval: interval ?? "1",
|
|
4768
|
+
changeInterval
|
|
4769
|
+
}
|
|
4770
|
+
) }),
|
|
4771
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4772
|
+
ui.Divider,
|
|
4773
|
+
{
|
|
4774
|
+
direction: "vertical",
|
|
4775
|
+
className: "oui-h-4",
|
|
4776
|
+
mx: 2,
|
|
4777
|
+
intensity: 8
|
|
4778
|
+
}
|
|
4779
|
+
),
|
|
4780
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { justify: "start", itemAlign: "center", gap: 2, children: [
|
|
4781
|
+
/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4782
|
+
LazyDesktopDisplayControl,
|
|
4783
|
+
{
|
|
4784
|
+
displayControlState,
|
|
4785
|
+
changeDisplayControlState: changeDisplaySetting
|
|
4786
|
+
}
|
|
4787
|
+
) }),
|
|
4788
|
+
/* @__PURE__ */ jsxRuntime.jsx(OperateButton, { onClick: openChartIndicators, children: /* @__PURE__ */ jsxRuntime.jsx(IndicatorsIcon, {}) }),
|
|
4789
|
+
/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(LazyLineType, { lineType, changeLineType }) }),
|
|
4790
|
+
/* @__PURE__ */ jsxRuntime.jsx(OperateButton, { onClick: openChartSetting, children: /* @__PURE__ */ jsxRuntime.jsx(SettingIcon, {}) })
|
|
4791
|
+
] })
|
|
4792
|
+
] }),
|
|
4793
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { children: fullscreen ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4794
|
+
ZoomOutIcon,
|
|
4795
|
+
{
|
|
4796
|
+
className: "oui-text-base-contrast-54 hover:oui-text-base-contrast oui-cursor-pointer",
|
|
4797
|
+
onClick: onFullScreenChange
|
|
4798
|
+
}
|
|
4799
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4800
|
+
ZoomInIcon,
|
|
4801
|
+
{
|
|
4802
|
+
className: "oui-text-base-contrast-54 hover:oui-text-base-contrast oui-cursor-pointer",
|
|
4803
|
+
onClick: onFullScreenChange
|
|
4804
|
+
}
|
|
4805
|
+
) })
|
|
4806
|
+
] });
|
|
4807
|
+
};
|
|
4682
4808
|
var OperateButton = ({ children, onClick }) => {
|
|
4683
4809
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4684
4810
|
ui.Box,
|
|
@@ -4748,83 +4874,31 @@ var TradingviewUI = React3.forwardRef((props, ref) => {
|
|
|
4748
4874
|
props.classNames?.content
|
|
4749
4875
|
),
|
|
4750
4876
|
children: [
|
|
4751
|
-
/* @__PURE__ */ jsxRuntime.jsx(topBar_default, { children: isMobile ? /* @__PURE__ */ jsxRuntime.
|
|
4752
|
-
|
|
4877
|
+
/* @__PURE__ */ jsxRuntime.jsx(topBar_default, { children: isMobile ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4878
|
+
MobileTopBar,
|
|
4753
4879
|
{
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4760
|
-
LazyTimeInterval,
|
|
4761
|
-
{
|
|
4762
|
-
interval: interval ?? "15",
|
|
4763
|
-
changeInterval
|
|
4764
|
-
}
|
|
4765
|
-
) }),
|
|
4766
|
-
/* @__PURE__ */ jsxRuntime.jsx(OperateButton, { onClick: openChartIndicators, children: /* @__PURE__ */ jsxRuntime.jsx(IndicatorsIcon, {}) }),
|
|
4767
|
-
/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4768
|
-
LazyMobileDisplayControl,
|
|
4769
|
-
{
|
|
4770
|
-
displayControlState,
|
|
4771
|
-
changeDisplayControlState: changeDisplaySetting
|
|
4772
|
-
}
|
|
4773
|
-
) })
|
|
4774
|
-
]
|
|
4880
|
+
interval,
|
|
4881
|
+
changeInterval,
|
|
4882
|
+
displayControlState,
|
|
4883
|
+
changeDisplaySetting,
|
|
4884
|
+
openChartIndicators
|
|
4775
4885
|
}
|
|
4776
|
-
) : /* @__PURE__ */ jsxRuntime.
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
}
|
|
4793
|
-
),
|
|
4794
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { justify: "start", itemAlign: "center", gap: 2, children: [
|
|
4795
|
-
/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4796
|
-
LazyDesktopDisplayControl,
|
|
4797
|
-
{
|
|
4798
|
-
displayControlState,
|
|
4799
|
-
changeDisplayControlState: changeDisplaySetting
|
|
4800
|
-
}
|
|
4801
|
-
) }),
|
|
4802
|
-
/* @__PURE__ */ jsxRuntime.jsx(OperateButton, { onClick: openChartIndicators, children: /* @__PURE__ */ jsxRuntime.jsx(IndicatorsIcon, {}) }),
|
|
4803
|
-
/* @__PURE__ */ jsxRuntime.jsx(React3__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4804
|
-
LazyLineType,
|
|
4805
|
-
{
|
|
4806
|
-
lineType,
|
|
4807
|
-
changeLineType
|
|
4808
|
-
}
|
|
4809
|
-
) }),
|
|
4810
|
-
/* @__PURE__ */ jsxRuntime.jsx(OperateButton, { onClick: openChartSetting, children: /* @__PURE__ */ jsxRuntime.jsx(SettingIcon, {}) })
|
|
4811
|
-
] })
|
|
4812
|
-
] }),
|
|
4813
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { children: props.fullscreen ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4814
|
-
ZoomOutIcon,
|
|
4815
|
-
{
|
|
4816
|
-
className: "oui-text-base-contrast-54 hover:oui-text-base-contrast oui-cursor-pointer",
|
|
4817
|
-
onClick: onFullScreenChange
|
|
4818
|
-
}
|
|
4819
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4820
|
-
ZoomInIcon,
|
|
4821
|
-
{
|
|
4822
|
-
className: "oui-text-base-contrast-54 hover:oui-text-base-contrast oui-cursor-pointer",
|
|
4823
|
-
onClick: onFullScreenChange
|
|
4824
|
-
}
|
|
4825
|
-
) })
|
|
4826
|
-
] }) }),
|
|
4827
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: chartRef, className: "oui-size-full oui-overflow-hidden" })
|
|
4886
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4887
|
+
DesktopTopBar,
|
|
4888
|
+
{
|
|
4889
|
+
interval,
|
|
4890
|
+
changeInterval,
|
|
4891
|
+
displayControlState,
|
|
4892
|
+
changeDisplaySetting,
|
|
4893
|
+
openChartIndicators,
|
|
4894
|
+
lineType,
|
|
4895
|
+
changeLineType,
|
|
4896
|
+
openChartSetting,
|
|
4897
|
+
fullscreen: props.fullscreen,
|
|
4898
|
+
onFullScreenChange
|
|
4899
|
+
}
|
|
4900
|
+
) }),
|
|
4901
|
+
/* @__PURE__ */ jsxRuntime.jsx(InjectableTradingviewDesktop, { ...props })
|
|
4828
4902
|
]
|
|
4829
4903
|
}
|
|
4830
4904
|
)
|
|
@@ -4833,9 +4907,10 @@ var TradingviewUI = React3.forwardRef((props, ref) => {
|
|
|
4833
4907
|
});
|
|
4834
4908
|
var TradingviewWidget = React3.forwardRef((props, ref) => {
|
|
4835
4909
|
const state = useTradingviewScript(props);
|
|
4836
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TradingviewUI, { ...state
|
|
4910
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TradingviewUI, { ...state });
|
|
4837
4911
|
});
|
|
4838
4912
|
|
|
4913
|
+
exports.InjectableTradingviewDesktop = InjectableTradingviewDesktop;
|
|
4839
4914
|
exports.TradingviewUI = TradingviewUI;
|
|
4840
4915
|
exports.TradingviewWidget = TradingviewWidget;
|
|
4841
4916
|
exports.useTradingviewScript = useTradingviewScript;
|